AFTD Auto-Formalizing Theoretical Domains

perspective_affine_hasDerivAt_zero

theoremverified

For Q0 > 0, the perspective t ↦ (Q0 + t Q1) f((C0 + t C1)/(Q0 + t Q1)) has derivative Q1 f(C0/Q0) + (C1 Q0 - C0 Q1) f'(C0/Q0)/Q0 at 0.

Statement

theorem perspective_affine_hasDerivAt_zero (f f1 : ℝ → ℝ) (Q0 Q1 C0 C1 : ℝ) (hQ : 0 < Q0)
    (hf : HasDerivAt f (f1 (C0 / Q0)) (C0 / Q0)) :
    HasDerivAt (fun t : ℝ => (Q0 + t * Q1) * f ((C0 + t * C1) / (Q0 + t * Q1)))
      (Q1 * f (C0 / Q0) + (C1 * Q0 - C0 * Q1) * f1 (C0 / Q0) / Q0) 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 of the perspective function t ↦ (Q0 + t * Q1) * f((C0 + t * C1) / (Q0 + t * Q1)) at t = 0 by systematically applying standard calculus rules. First, the derivatives of the linear numerator and denominator at 0 are established, and the quotient rule yields the derivative of their ratio, which is valid because Q0 > 0. Next, the chain rule differentiates the composition with f, and the product rule combines this with the denominator factor. Finally, the resulting expression is simplified algebraically at t = 0 to match the stated formula.

  1. The affine function t ↦ Q0 + t * Q1 has derivative Q1 at t = 0.

    The identity function has derivative 1 everywhere by hasDerivAt_id'. Scaling by the constant Q1 and adding the constant Q0 shows that t ↦ Q0 + t * Q1 has derivative Q1 at 0.

    lines 5–6

    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
  2. The affine function t ↦ C0 + t * C1 has derivative C1 at t = 0.

    Similarly, scaling the identity by C1 and adding C0 shows that t ↦ C0 + t * C1 has derivative C1 at 0.

    lines 7–8

    uses hasDerivAt_id'

      have hCt : HasDerivAt (fun t : ℝ => C0 + t * C1) C1 0 := by
        simpa using ((hasDerivAt_id' (0:ℝ)).mul_const C1).const_add C0
  3. The quotient function t ↦ (C0 + t * C1) / (Q0 + t * Q1) has derivative (C1 * (Q0 + 0 * Q1) - (C0 + 0 * C1) * Q1) / (Q0 + 0 * Q1)^2 at t = 0.

    Applying the quotient rule to the affine numerator and denominator gives the derivative of their ratio at 0. The denominator is nonzero at 0 because Q0 + 0 * Q1 = Q0 > 0.

    line 9

      have hdiv := hCt.fun_div hQt (by simp; exact hQ.ne')
  4. The composite function t ↦ f((C0 + t * C1) / (Q0 + t * Q1)) has derivative f1(C0 / Q0) * ((C1 * (Q0 + 0 * Q1) - (C0 + 0 * C1) * Q1) / (Q0 + 0 * Q1)^2) at t = 0.

    At t = 0, the quotient evaluates to C0 / Q0. Since f has derivative f1(C0 / Q0) at that point by assumption, the chain rule yields the derivative of the composition at 0.

    lines 10–12

      have hf' : HasDerivAt f (f1 (C0 / Q0)) ((fun t : ℝ => (C0 + t * C1) / (Q0 + t * Q1)) 0) := by
        simpa using hf
      have hcomp := hf'.comp (h := fun t : ℝ => (C0 + t * C1) / (Q0 + t * Q1)) 0 hdiv
  5. The product t ↦ (Q0 + t * Q1) * f((C0 + t * C1) / (Q0 + t * Q1)) has derivative Q1 * f(C0 / Q0) + (Q0 + 0 * Q1) * [f1(C0 / Q0) * ((C1 * (Q0 + 0 * Q1) - (C0 + 0 * C1) * Q1) / (Q0 + 0 * Q1)^2)] at t = 0.

    Applying the product rule to the factor Q0 + t * Q1 and the composite factor f((C0 + t * C1) / (Q0 + t * Q1)) gives the derivative of their product at 0.

    line 13

      have := hQt.fun_mul hcomp
  6. The derivative of the perspective function at 0 is Q1 * f(C0 / Q0) + (C1 * Q0 - C0 * Q1) * f1(C0 / Q0) / Q0.

    The proof finishes by replacing the derivative value obtained from the calculus rules with the algebraically simplified target form. Evaluating the zero terms reduces the second term's coefficient to Q0 * (C1 * Q0 - C0 * Q1) / Q0^2; since Q0 is nonzero, clearing the common factor of Q0 in the denominator leaves (C1 * Q0 - C0 * Q1) / Q0, which field_simp verifies.

    lines 14–17

    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 has derivative 1 at any point.
zero_mul
Multiplying any element by zero on the left yields zero: 0 * a = 0.
add_zero
Adding zero to any element on the right leaves it unchanged: a + 0 = a.
Function.comp_apply
The definition of function composition: (f ∘ g)(x) = f(g(x)).
Pi.sub_apply
Pointwise subtraction of functions evaluates as (f - g)(x) = f(x) - g(x).
sub_self
Subtracting any element from itself yields 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_hasDerivAt_zero (f f1 : ℝ → ℝ) (Q0 Q1 C0 C1 : ℝ) (hQ : 0 < Q0)    (hf : HasDerivAt f (f1 (C0 / Q0)) (C0 / Q0)) :    HasDerivAt (fun t : ℝ => (Q0 + t * Q1) * f ((C0 + t * C1) / (Q0 + t * Q1)))      (Q1 * f (C0 / Q0) + (C1 * Q0 - C0 * Q1) * f1 (C0 / Q0) / Q0) 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 hcomp := hf'.comp (h := fun t : ℝ => (C0 + t * C1) / (Q0 + t * Q1)) 0 hdiv  have := hQt.fun_mul hcomp  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