AFTD Auto-Formalizing Theoretical Domains

subadditive_f_weight_mul_log

theoremverified

Sanity: for the Shannon generator f(x) = x log x, the weight is g(x) = x² · (1/x) = x for x > 0.

Statement

theorem subadditive_f_weight_mul_log {x : ℝ} (hx : 0 < x) :
    subadditive_f_weight (fun y => y * Real.log y) x = x
Source
sanity lemma for subadditive_f_weight
Verified
23 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 1
  • subadditive_f_weightThe weight g(x) = x² f''(x) attached to a generator f in Theorem 1 of arXiv:2610.21231 (f'' is the iterated derivative deriv (deriv f)).

The proof, explained

The weight of the Shannon generator f(y) = y log y is defined as g(x) = x² f''(x). The proof first shows that f'(y) = log y + 1 for all y in a neighborhood of x > 0. Differentiating this expression gives the second derivative f''(x) = x⁻¹. Finally, substituting f''(x) = x⁻¹ into the definition and clearing the denominator yields x² · x⁻¹ = x.

  1. In a neighborhood of x, the derivative of y ↦ y log y is log y + 1.

    Since x > 0, the open ray (0, ∞) is a neighborhood of x by lt_mem_nhds. For any y in this neighborhood, y > 0 implies y ≠ 0 by ne_of_gt, so Real.hasDerivAt_mul_log applies to show the derivative of y ↦ y log y at y is log y + 1.

    lines 3–5

    uses lt_mem_nhds, ne_of_gt, Real.hasDerivAt_mul_log

      have heq : deriv (fun y => y * Real.log y) =ᶠ[nhds x] fun y => Real.log y + 1 := by
        filter_upwards [lt_mem_nhds hx] with y hy
        exact (Real.hasDerivAt_mul_log (ne_of_gt hy)).deriv
  2. The second derivative of y ↦ y log y at x is x⁻¹.

    Since x > 0 implies x ≠ 0 by ne_of_gt, Real.hasDerivAt_log shows that log has derivative x⁻¹ at x. Adding the constant 1 does not change the derivative (via add_const). Because the first derivative of y ↦ y log y agrees with log y + 1 in a neighborhood of x (established in the previous step), congr_of_eventuallyEq implies that it also has derivative x⁻¹ at x.

    lines 6–7

    uses Real.hasDerivAt_log, ne_of_gt, add_const, congr_of_eventuallyEq

      have h2 : HasDerivAt (deriv (fun y => y * Real.log y)) x⁻¹ x :=
        (((Real.hasDerivAt_log (ne_of_gt hx)).add_const 1).congr_of_eventuallyEq heq)
  3. The subadditive weight of y ↦ y log y at x equals x.

    Unfolding the definition of subadditive_f_weight gives x² times the second derivative of y ↦ y log y at x. Substituting the second derivative x⁻¹ (from h2) turns the expression into x² * x⁻¹. Field simplification then cancels the factor of x to conclude that x² * x⁻¹ = x, using x > 0 to know x ≠ 0.

    lines 8–10

      unfold subadditive_f_weight
      rw [h2.deriv]
      field_simp
lt_mem_nhds
If a < b in an ordered topological space, then the interval (a, ∞) is a neighborhood of b.
ne_of_gt
If b < a, then a ≠ b.
Real.hasDerivAt_mul_log
For any non-zero real number x, the function y ↦ y * log y has derivative log x + 1 at x.
Real.hasDerivAt_log
For any non-zero real number x, the natural logarithm has derivative x⁻¹ at x.
add_const
Adding a constant to a differentiable function preserves its derivative.
congr_of_eventuallyEq
If two functions agree in a neighborhood of a point, their derivatives at that point coincide.

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 subadditive_f_weight_mul_log {x : ℝ} (hx : 0 < x) :    subadditive_f_weight (fun y => y * Real.log y) x = x := by  have heq : deriv (fun y => y * Real.log y) =ᶠ[nhds x] fun y => Real.log y + 1 := by    filter_upwards [lt_mem_nhds hx] with y hy    exact (Real.hasDerivAt_mul_log (ne_of_gt hy)).deriv  have h2 : HasDerivAt (deriv (fun y => y * Real.log y)) x⁻¹ x :=    (((Real.hasDerivAt_log (ne_of_gt hx)).add_const 1).congr_of_eventuallyEq heq)  unfold subadditive_f_weight  rw [h2.deriv]  field_simp
See it in the graphDiscuss this resultChallenge it