AFTD Auto-Formalizing Theoretical Domains

perspective_affine_deriv_hasDerivAt_zero

theoremverified

For Q0 > 0, the first derivative of the affine perspective along t has derivative (C1 Q0 - C0 Q1)² f''(C0/Q0)/Q0³ at 0: the perspective's second derivative.

Statement

theorem perspective_affine_deriv_hasDerivAt_zero (f f1 f2 : ℝ → ℝ) (Q0 Q1 C0 C1 : ℝ) (hQ : 0 < Q0)
    (hf : HasDerivAt f (f1 (C0 / Q0)) (C0 / Q0))
    (hf1 : HasDerivAt f1 (f2 (C0 / Q0)) (C0 / Q0)) :
    HasDerivAt (fun t : ℝ => Q1 * f ((C0 + t * C1) / (Q0 + t * Q1)) +
        (C1 * (Q0 + t * Q1) - (C0 + t * C1) * Q1) * f1 ((C0 + t * C1) / (Q0 + t * Q1)) /
          (Q0 + t * Q1))
      ((C1 * Q0 - C0 * Q1) ^ 2 * f2 (C0 / Q0) / Q0 ^ 3) 0
Source
arXiv:2610.21231 (On the subadditivity of mutual f-information), Appendix B, proof of Lemma 4
Verified
24 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Used by 1

The proof, explained

The proof computes the derivative at t = 0 of the first derivative of an affine perspective slice, yielding the second directional derivative. Standard calculus rules (linear combinations, quotient rule, product rule, and chain rule) are applied to differentiate each building block: the affine components, their ratio u(t), the compositions f(u(t)) and f₁(u(t)), and the cross-term C₁(Q₀ + t Q₁) - (C₀ + t C₁) Q₁. Crucially, the derivative of the cross-term at 0 is C₁ Q₁ - C₁ Q₁ = 0, which causes the first-order terms involving f₁ to cancel completely. Algebraic simplification with `field_simp` and `ring` then confirms that the remaining second-order term simplifies to (C₁ Q₀ - C₀ Q₁)² f₂(C₀/Q₀) / Q₀³.

  1. The affine functions t ↦ Q₀ + t Q₁ and t ↦ C₀ + t C₁ have derivatives Q₁ and C₁ at t = 0, respectively.

    Differentiating the identity function at 0 (via `hasDerivAt_id'`), multiplying by the constants Q₁ and C₁, and adding the constants Q₀ and C₀ establishes the derivatives of the two affine components.

    lines 8–11

    uses hasDerivAt_id'

      have hQt : HasDerivAt (fun t : ℝ => Q0 + t * Q1) Q1 0 := by
        simpa using ((hasDerivAt_id' (0:ℝ)).mul_const Q1).const_add Q0
      have hCt : HasDerivAt (fun t : ℝ => C0 + t * C1) C1 0 := by
        simpa using ((hasDerivAt_id' (0:ℝ)).mul_const C1).const_add C0
  2. The quotient u(t) = (C₀ + t C₁) / (Q₀ + t Q₁) has derivative (C₁(Q₀ + 0·Q₁) - (C₀ + 0·C₁)Q₁) / (Q₀ + 0·Q₁)² at t = 0.

    The quotient rule is applied to the two affine functions. The hypothesis 0 < Q₀ ensures that the denominator at t = 0 is non-zero (Q₀ ≠ 0).

    line 12

      have hdiv := hCt.fun_div hQt (by simp; exact hQ.ne')
  3. The composite functions f(u(t)) and f₁(u(t)) are differentiable at t = 0 with derivatives given by the chain rule.

    At t = 0, the argument u(0) = (C₀ + 0·C₁) / (Q₀ + 0·Q₁) simplifies to C₀/Q₀. Rewriting the assumed derivatives of f and f₁ at C₀/Q₀ as derivatives at u(0) allows the chain rule to be applied with the derivative of u at 0.

    lines 13–18

      have hf' : HasDerivAt f (f1 (C0 / Q0)) ((fun t : ℝ => (C0 + t * C1) / (Q0 + t * Q1)) 0) := by
        simpa using hf
      have hf1' : HasDerivAt f1 (f2 (C0 / Q0)) ((fun t : ℝ => (C0 + t * C1) / (Q0 + t * Q1)) 0) := by
        simpa using hf1
      have hc := hf'.comp (h := fun t : ℝ => (C0 + t * C1) / (Q0 + t * Q1)) 0 hdiv
      have hc1 := hf1'.comp (h := fun t : ℝ => (C0 + t * C1) / (Q0 + t * Q1)) 0 hdiv
  4. The cross-term L(t) = C₁(Q₀ + t Q₁) - (C₀ + t C₁)Q₁ has derivative C₁ Q₁ - C₁ Q₁ = 0 at t = 0.

    Using the linearity of differentiation, the derivative is the difference between C₁ times the derivative of Q(t) and Q₁ times the derivative of C(t).

    line 19

      have hl := (hQt.const_mul C1).sub (hCt.mul_const Q1)
  5. The complete perspective expression is differentiable at t = 0 with derivative given by standard calculus rules.

    The expression is the sum of Q₁ · f(u(t)) and (L(t) · f₁(u(t))) / (Q₀ + t Q₁). Calculus rules for scalar multiplication, products, quotients (with non-zero denominator Q₀), and addition are combined to differentiate the full expression at 0.

    line 20

      have := (hc.const_mul Q1).add ((hl.fun_mul hc1).fun_div hQt (by simp; exact hQ.ne'))
  6. The derivative of the perspective expression at t = 0 simplifies to (C₁ Q₀ - C₀ Q₁)² f₂(C₀/Q₀) / Q₀³. automation

    Applying `congr_deriv`, the proof shows that the derivative expression produced by calculus rules matches the target formula. At t = 0, terms with factor 0 simplify, L'(0) = C₁ Q₁ - C₁ Q₁ = 0 eliminates the first derivative term from the numerator's product rule, and the remaining terms containing f₁(C₀/Q₀) cancel out. Clearing denominators with `field_simp` and verifying the resulting polynomial identity with `ring` closes the goal.

    lines 21–24

    uses zero_mul, add_zero, Function.comp_apply, Pi.sub_apply, sub_self

      exact this.congr_deriv (by
        simp only [zero_mul, add_zero, Function.comp_apply, Pi.sub_apply, sub_self]
        field_simp
        try ring)
hasDerivAt_id'
The identity function x ↦ x has derivative 1 at any point x.
zero_mul
Multiplying by zero on the left gives zero: 0 * a = 0.
add_zero
Adding zero on the right leaves an element unchanged: a + 0 = a.
Function.comp_apply
Function composition satisfies (f ∘ g)(x) = f(g(x)).
Pi.sub_apply
The pointwise difference of two functions evaluated at i satisfies (f - g)(i) = f(i) - g(i).
sub_self
Subtracting any element from itself gives zero: a - a = 0.

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

theorem perspective_affine_deriv_hasDerivAt_zero (f f1 f2 : ℝ → ℝ) (Q0 Q1 C0 C1 : ℝ) (hQ : 0 < Q0)    (hf : HasDerivAt f (f1 (C0 / Q0)) (C0 / Q0))    (hf1 : HasDerivAt f1 (f2 (C0 / Q0)) (C0 / Q0)) :    HasDerivAt (fun t : ℝ => Q1 * f ((C0 + t * C1) / (Q0 + t * Q1)) +        (C1 * (Q0 + t * Q1) - (C0 + t * C1) * Q1) * f1 ((C0 + t * C1) / (Q0 + t * Q1)) /          (Q0 + t * Q1))      ((C1 * Q0 - C0 * Q1) ^ 2 * f2 (C0 / Q0) / Q0 ^ 3) 0 := by  have hQt : HasDerivAt (fun t : ℝ => Q0 + t * Q1) Q1 0 := by    simpa using ((hasDerivAt_id' (0:ℝ)).mul_const Q1).const_add Q0  have hCt : HasDerivAt (fun t : ℝ => C0 + t * C1) C1 0 := by    simpa using ((hasDerivAt_id' (0:ℝ)).mul_const C1).const_add C0  have hdiv := hCt.fun_div hQt (by simp; exact hQ.ne')  have hf' : HasDerivAt f (f1 (C0 / Q0)) ((fun t : ℝ => (C0 + t * C1) / (Q0 + t * Q1)) 0) := by    simpa using hf  have hf1' : HasDerivAt f1 (f2 (C0 / Q0)) ((fun t : ℝ => (C0 + t * C1) / (Q0 + t * Q1)) 0) := by    simpa using hf1  have hc := hf'.comp (h := fun t : ℝ => (C0 + t * C1) / (Q0 + t * Q1)) 0 hdiv  have hc1 := hf1'.comp (h := fun t : ℝ => (C0 + t * C1) / (Q0 + t * Q1)) 0 hdiv  have hl := (hQt.const_mul C1).sub (hCt.mul_const Q1)  have := (hc.const_mul Q1).add ((hl.fun_mul hc1).fun_div hQt (by simp; exact hQ.ne'))  exact this.congr_deriv (by    simp only [zero_mul, add_zero, Function.comp_apply, Pi.sub_apply, sub_self]    field_simp    try ring)
See it in the graphDiscuss this resultChallenge it