AFTD Auto-Formalizing Theoretical Domains

hasDerivAt_comp_affine_at_zero

theoremverified

If g has derivative g' at c, then t ↦ g(c + t d) has derivative g' d at 0.

Statement

theorem hasDerivAt_comp_affine_at_zero (gw : ℝ → ℝ) (gw' c d : ℝ) (h : HasDerivAt gw gw' c) :
    HasDerivAt (fun t : ℝ => gw (c + t * d)) (gw' * d) 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 2

The proof, explained

The proof views the function t ↦ gw (c + t * d) as the composition of gw with the affine map t ↦ c + t * d and applies the one-dimensional chain rule. It first computes the derivative of the inner affine map at 0 to be d by differentiating the identity map, scaling by d, and shifting by c. It then notes that the base point c is the value of the affine map at 0, and concludes by multiplying the outer derivative gw' and the inner derivative d.

  1. The affine map t ↦ c + t * d has derivative d at t = 0.

    The identity function t ↦ t has derivative 1 at 0 by `hasDerivAt_id'`. Multiplying by the constant d via `mul_const` gives that t ↦ t * d has derivative 1 * d at 0, and adding the constant c via `const_add` shows that t ↦ c + t * d has derivative 1 * d at 0. The tactic `simpa` evaluates the scalar product 1 * d to d.

    lines 3–4

    uses hasDerivAt_id', mul_const, const_add

      have hh : HasDerivAt (fun t : ℝ => c + t * d) d 0 := by
        simpa using ((hasDerivAt_id' (0:ℝ)).mul_const d).const_add c
  2. The function gw has derivative gw' at the point (c + 0 * d).

    The hypothesis h states that gw has derivative gw' at c. Since the affine map evaluated at 0 is c + 0 * d = c, the tactic `simpa` reformulates h as differentiability of gw at the value (c + 0 * d).

    line 5

      have h' : HasDerivAt gw gw' ((fun t : ℝ => c + t * d) 0) := by simpa using h
  3. The composite function t ↦ gw (c + t * d) has derivative gw' * d at t = 0.

    Applying the chain rule `comp` to the outer derivative of gw at (c + 0 * d) (from h') and the inner derivative of t ↦ c + t * d at 0 (from hh) yields that the derivative of the composite map at 0 is the product gw' * d.

    line 6

    uses comp

      exact h'.comp (h := fun t : ℝ => c + t * d) 0 hh
hasDerivAt_id'
The identity function has derivative 1 at any point.
mul_const
If a function has derivative c' at x, then multiplying it by a constant scalar d gives a function with derivative c' * d at x.
const_add
If a function has derivative f' at x, then adding a constant c gives a function with derivative f' at x.
comp
If h₂ has derivative h₂' at h(x) and h has derivative h' at x, then the composition h₂ ∘ h has derivative h₂' * h' at x.

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 hasDerivAt_comp_affine_at_zero (gw : ℝ → ℝ) (gw' c d : ℝ) (h : HasDerivAt gw gw' c) :    HasDerivAt (fun t : ℝ => gw (c + t * d)) (gw' * d) 0 := by  have hh : HasDerivAt (fun t : ℝ => c + t * d) d 0 := by    simpa using ((hasDerivAt_id' (0:ℝ)).mul_const d).const_add c  have h' : HasDerivAt gw gw' ((fun t : ℝ => c + t * d) 0) := by simpa using h  exact h'.comp (h := fun t : ℝ => c + t * d) 0 hh
See it in the graphDiscuss this resultChallenge it