AFTD Auto-Formalizing Theoretical Domains

sigmoid_sub_ge_of_le

theoremverified

For any real numbers 0 ≤ u ≤ v ≤ 1, the difference sigmoid(v) - sigmoid(u) is at least (1/6) * (v - u).

Statement

theorem sigmoid_sub_ge_of_le (u v : ℝ) (hu : 0 ≤ u) (huv : u ≤ v) (hv : v ≤ 1) :
    (1 / 6 : ℝ) * (v - u) ≤ Real.sigmoid v - Real.sigmoid u
Source
scout/2611-21910-new-gate-weight-and-wire-complexity-bounds-for-sigmoid-neur.md:897
Verified
19 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 4
Used by 1

Read back from the Lean

For any real numbers $u$ and $v$, if $0 \le u$, $u \le v$, and $v \le 1$, then $\frac{1}{6}(v - u) \le \operatorname{Real.sigmoid}(v) - \operatorname{Real.sigmoid}(u)$.

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

The proof, explained

The proof applies the mean value inequality on the convex interval [0, 1] to bound the difference sigmoid(v) - sigmoid(u) from below by the infimum of the derivative times (v - u). Because the derivative is σ'(x) = σ(x)(1 - σ(x)) and σ increases from σ(0) = 1/2 to σ(1) on [0, 1], the quadratic y(1 - y) decreases on [1/2, σ(1)], attaining its minimum at x = 1. A numerical verification confirms σ'(x) ≥ σ(1)(1 - σ(1)) ≥ 1/6 on (0, 1), yielding the desired inequality.

  1. The interval [0, 1] is convex, and the sigmoid function is continuous on [0, 1] and differentiable on its interior (0, 1).

    We verify the regularity conditions needed for the mean value inequality. The closed interval [0, 1] is convex by convex_Icc. Since the sigmoid function is globally continuous and differentiable on all of ℝ, its restriction is continuous on [0, 1] (via continuous_sigmoid.continuousOn) and differentiable on the interior (0, 1) (via differentiable_sigmoid.differentiableOn).

    lines 4–8

    uses convex_Icc, continuous_sigmoid.continuousOn, differentiable_sigmoid.differentiableOn

      open Set Real in
      have hcvx : Convex ℝ (Icc (0:ℝ) 1) := convex_Icc 0 1
      have hcont : ContinuousOn sigmoid (Icc 0 1) := continuous_sigmoid.continuousOn
      have hdiff : DifferentiableOn ℝ sigmoid (interior (Icc 0 1)) :=
        differentiable_sigmoid.differentiableOn
  2. At the right endpoint x = 1, the product σ(1)(1 - σ(1)) is bounded below by 1/6. automation

    By definition, σ(1) = (1 + exp(-1))⁻¹. The tactic `num_ineq` evaluates the transcendental constants and automatically verifies the numerical inequality 1/6 ≤ (1 + exp(-1))⁻¹ * (1 - (1 + exp(-1))⁻¹), which numerically is approximately 0.1667 ≤ 0.1966.

    lines 9–11

      have h_one : (1 / 6 : ℝ) ≤ sigmoid 1 * (1 - sigmoid 1) := by
        unfold sigmoid
        num_ineq
  3. For every x in the interior of [0, 1], the derivative of the sigmoid satisfies σ'(x) ≥ 1/6.

    Let x be in the interior of [0, 1]. By interior_subset, 0 ≤ x ≤ 1. Monotonicity of the sigmoid (sigmoid_le) and sigmoid_zero give 1/2 = σ(0) ≤ σ(x) ≤ σ(1). Because the quadratic polynomial y ↦ y(1 - y) is decreasing on [1/2, 1], non-linear arithmetic (`nlinarith`) deduces σ(1)(1 - σ(1)) ≤ σ(x)(1 - σ(x)). Using the identity σ'(x) = σ(x)(1 - σ(x)) from deriv_sigmoid and chaining with the numerical bound σ(1)(1 - σ(1)) ≥ 1/6 from the previous step, linear arithmetic (`linarith`) concludes σ'(x) ≥ 1/6.

    lines 12–26

    uses interior_subset, sigmoid_le, sigmoid_zero, deriv_sigmoid

      have hderiv : ∀ x ∈ interior (Icc (0:ℝ) 1), (1 / 6 : ℝ) ≤ deriv sigmoid x := by
        intro x hx
        have hx_icc : x ∈ Icc (0:ℝ) 1 := interior_subset hx
        have h0x : (0:ℝ) ≤ x := hx_icc.1
        have hx1 : x ≤ 1 := hx_icc.2
        have hsig0 : sigmoid 0 ≤ sigmoid x := sigmoid_le h0x
        have hsig1 : sigmoid x ≤ sigmoid 1 := sigmoid_le hx1
        rw [sigmoid_zero] at hsig0
        have h_quad : sigmoid 1 * (1 - sigmoid 1) ≤ sigmoid x * (1 - sigmoid x) := by
          have : (1 / 2 : ℝ) ≤ sigmoid x := by linarith [hsig0]
          nlinarith
        have hd : deriv sigmoid x = sigmoid x * (1 - sigmoid x) := by
          rw [deriv_sigmoid]
        rw [hd]
        linarith
  4. Both u and v lie in [0, 1], and the mean value inequality yields (1/6) * (v - u) ≤ σ(v) - σ(u).

    From the hypotheses 0 ≤ u ≤ v ≤ 1, transitivity implies 0 ≤ u ≤ 1 and 0 ≤ v ≤ 1, so u, v ∈ [0, 1]. Applying the mean value inequality for convex sets (mul_sub_le_image_sub_of_le_deriv) with the convexity of [0, 1], the continuity and interior differentiability of σ, and the derivative lower bound 1/6 on (0, 1) completes the proof.

    lines 27–29

    uses mul_sub_le_image_sub_of_le_deriv

      have hu_mem : u ∈ Icc (0:ℝ) 1 := ⟨hu, huv.trans hv⟩
      have hv_mem : v ∈ Icc (0:ℝ) 1 := ⟨hu.trans huv, hv⟩
      exact hcvx.mul_sub_le_image_sub_of_le_deriv hcont hdiff hderiv u hu_mem v hv_mem huv
convex_Icc
The closed interval [a, b] is a convex set.
continuous_sigmoid.continuousOn
The sigmoid function is continuous on any set.
differentiable_sigmoid.differentiableOn
The sigmoid function is differentiable on any set.
interior_subset
The interior of a set is contained in the set itself.
sigmoid_le
The sigmoid function is monotone: if a ≤ b, then sigmoid(a) ≤ sigmoid(b).
sigmoid_zero
The value of the sigmoid function at 0 is 1/2.
deriv_sigmoid
The derivative of the sigmoid function is sigmoid'(x) = sigmoid(x) * (1 - sigmoid(x)).
mul_sub_le_image_sub_of_le_deriv
If a function f is continuous on a convex set D and differentiable on its interior with deriv f ≥ C everywhere on the interior, then C * (y - x) ≤ f(y) - f(x) for all x ≤ y in D.

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

/-- Mean value lower bound for the standard sigmoid function on the interval [0, 1]. -/theorem sigmoid_sub_ge_of_le (u v : ℝ) (hu : 0 ≤ u) (huv : u ≤ v) (hv : v ≤ 1) :    (1 / 6 : ℝ) * (v - u) ≤ Real.sigmoid v - Real.sigmoid u := by  open Set Real in  have hcvx : Convex ℝ (Icc (0:ℝ) 1) := convex_Icc 0 1  have hcont : ContinuousOn sigmoid (Icc 0 1) := continuous_sigmoid.continuousOn  have hdiff : DifferentiableOn ℝ sigmoid (interior (Icc 0 1)) :=    differentiable_sigmoid.differentiableOn  have h_one : (1 / 6 : ℝ) ≤ sigmoid 1 * (1 - sigmoid 1) := by    unfold sigmoid    num_ineq  have hderiv : ∀ x ∈ interior (Icc (0:ℝ) 1), (1 / 6 : ℝ) ≤ deriv sigmoid x := by    intro x hx    have hx_icc : x ∈ Icc (0:ℝ) 1 := interior_subset hx    have h0x : (0:ℝ) ≤ x := hx_icc.1    have hx1 : x ≤ 1 := hx_icc.2    have hsig0 : sigmoid 0 ≤ sigmoid x := sigmoid_le h0x    have hsig1 : sigmoid x ≤ sigmoid 1 := sigmoid_le hx1    rw [sigmoid_zero] at hsig0    have h_quad : sigmoid 1 * (1 - sigmoid 1) ≤ sigmoid x * (1 - sigmoid x) := by      have : (1 / 2 : ℝ) ≤ sigmoid x := by linarith [hsig0]      nlinarith    have hd : deriv sigmoid x = sigmoid x * (1 - sigmoid x) := by      rw [deriv_sigmoid]    rw [hd]    linarith  have hu_mem : u ∈ Icc (0:ℝ) 1 := ⟨hu, huv.trans hv⟩  have hv_mem : v ∈ Icc (0:ℝ) 1 := ⟨hu.trans huv, hv⟩  exact hcvx.mul_sub_le_image_sub_of_le_deriv hcont hdiff hderiv u hu_mem v hv_mem huv
See it in the graphDiscuss this resultChallenge it