scalar_repair_certificate_tangency
For all real numbers f_star, s_star, sigma_star, and H satisfying s_star = 1 - f_star, sigma_star = 9 - 16 * f_star + 6 * f_star², 2 * f_star³ - 4 * f_star² + 1 = 0, f_star ≠ 0, and f_star + H ≠ 0, the scalar repair certificate satisfies scalar_repair_certificate f_star H - sigma_star = (2 * f_star - 1) * (H - s_star)² / (f_star * (f_star + H)).
Statement
theorem scalar_repair_certificate_tangency (f_star s_star sigma_star H : ℝ)
(hs : s_star = 1 - f_star)
(hsigma : sigma_star = 9 - 16 * f_star + 6 * f_star^2)
(hcubic : 2 * f_star^3 - 4 * f_star^2 + 1 = 0)
(hf_pos : f_star ≠ 0)
(hdenom : f_star + H ≠ 0) :
scalar_repair_certificate f_star H - sigma_star =
(2 * f_star - 1) * (H - s_star)^2 / (f_star * (f_star + H))- Formalizes
- arXiv:2611.06076:2499
- Verified
- 08 Nov 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 1
- scalar_repair_certificateThe scalar repair progress certificate K_f(H) for activation budget f and memory weight H is (1 + H) * (f + (2f - 1)H) / (f(f + H)).
Read back from the Lean
For all real numbers $f^*, s^*, \sigma^*, H$, if:
1. $s^* = 1 - f^*$,
2. $\sigma^* = 9 - 16 f^* + 6 (f^*)^2$,
3. $2 (f^*)^3 - 4 (f^*)^2 + 1 = 0$,
4. $f^* \neq 0$, and
5. $f^* + H \neq 0$,
then scalar_repair_certificate f_star H minus $\sigma^*$ equals $\frac{(2 f^* - 1)(H - s^*)^2}{f^* (f^* + H)}$.
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 establishes the quadratic tangency of the scalar repair certificate at the critical point $s^*$ by clearing denominators and applying a polynomial identity. After unfolding the definition of the certificate and substituting $s^* = 1 - f^*$ and $\sigma^* = 9 - 16 f^* + 6 (f^*)^2$, both sides share the common non-zero denominator $D = f^* (f^* + H)$. By right cancellation, the statement reduces to showing that multiplying both sides by $D$ yields identical expressions. The resulting difference of polynomials factors as $(1 - 3 f^* - 3 H)(2 (f^*)^3 - 4 (f^*)^2 + 1)$, which vanishes because $f^*$ is a root of the cubic equation $2 (f^*)^3 - 4 (f^*)^2 + 1 = 0$.
Expand the definition of the scalar repair certificate and substitute the values of $s^*$ and $\sigma^*$.
Unfolding `scalar_repair_certificate` replaces the certificate with its definition $((1 + H)(f^* + (2 f^* - 1)H)) / (f^* (f^* + H))$. Rewriting with $s^* = 1 - f^*$ and $\sigma^* = 9 - 16 f^* + 6 (f^*)^2$ reduces the theorem to an equation in $f^*$ and $H$.
unfold scalar_repair_certificate rw [hs, hsigma]
The denominator $f^* (f^* + H)$ is non-zero.
Since $f^* \neq 0$ by assumption and $f^* + H \neq 0$ by assumption, their product $f^* (f^* + H)$ is non-zero by `mul_ne_zero`.
uses
mul_ne_zerohave hD : f_star * (f_star + H) ≠ 0 := mul_ne_zero hf_pos hdenomIt suffices to establish the equality after multiplying both sides by the common denominator $f^* (f^* + H)$.
Because the denominator $D = f^* (f^* + H)$ is non-zero, right cancellation (`mul_right_cancel₀`) reduces showing $A = B$ to showing $A \cdot D = B \cdot D$.
uses
mul_right_cancel₀apply mul_right_cancel₀ hDDistributing the denominator across the left-hand side clears the fraction.
Distributing multiplication over subtraction using `sub_mul` and canceling the quotient with the denominator using `div_mul_cancel₀` clears the fraction on the left-hand side, leaving $(1 + H)(f^* + (2 f^* - 1)H) - (9 - 16 f^* + 6 (f^*)^2)(f^* (f^* + H))$.
uses
sub_mul,div_mul_cancel₀calc ((1 + H) * (f_star + (2 * f_star - 1) * H) / (f_star * (f_star + H)) - (9 - 16 * f_star + 6 * f_star ^ 2)) * (f_star * (f_star + H)) = (1 + H) * (f_star + (2 * f_star - 1) * H) - (9 - 16 * f_star + 6 * f_star ^ 2) * (f_star * (f_star + H)) := by rw [sub_mul, div_mul_cancel₀ _ hD]
The cleared left-hand expression equals $(2 f^* - 1)(H - (1 - f^*))^2$.
The difference between the cleared left-hand polynomial and $(2 f^* - 1)(H - (1 - f^*))^2$ factors algebraically as $(1 - 3 f^* - 3 H)(2 (f^*)^3 - 4 (f^*)^2 + 1)$. This difference vanishes because $f^*$ satisfies the cubic equation $2 (f^*)^3 - 4 (f^*)^2 + 1 = 0$ (`hcubic`).
_ = (2 * f_star - 1) * (H - (1 - f_star)) ^ 2 := by linear_combination (1 - 3 * f_star - 3 * H) * hcubicThe polynomial $(2 f^* - 1)(H - (1 - f^*))^2$ is rewritten into the target quotient multiplied by $f^* (f^* + H)$.
Since $D = f^* (f^* + H) \neq 0$, dividing by $D$ and multiplying by $D$ leaves the quantity unchanged by `div_mul_cancel₀`, matching the right-hand side multiplied by $D$.
uses
div_mul_cancel₀_ = (2 * f_star - 1) * (H - (1 - f_star)) ^ 2 / (f_star * (f_star + H)) * (f_star * (f_star + H)) := by rw [div_mul_cancel₀ _ hD]
mul_ne_zero- If $a \neq 0$ and $b \neq 0$ in a structure with no zero divisors, then $a \cdot b \neq 0$.
mul_right_cancel₀- If $b \neq 0$ and $a \cdot b = c \cdot b$, then $a = c$.
sub_mul- Multiplication distributes over subtraction from the right: $(a - b) \cdot c = a \cdot c - b \cdot c$.
div_mul_cancel₀- For any non-zero element $b$, dividing $a$ by $b$ and multiplying by $b$ yields $a$.
- The polynomial identity in line 20 is verified by Lean's `linear_combination` tactic, which automatically expands both polynomials and checks that their difference is $(1 - 3 f^* - 3 H)(2 (f^*)^3 - 4 (f^*)^2 + 1)$.
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
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
/-- Quadratic tangency of the scalar repair certificate at the critical point s_star. -/theorem scalar_repair_certificate_tangency (f_star s_star sigma_star H : ℝ) (hs : s_star = 1 - f_star) (hsigma : sigma_star = 9 - 16 * f_star + 6 * f_star^2) (hcubic : 2 * f_star^3 - 4 * f_star^2 + 1 = 0) (hf_pos : f_star ≠ 0) (hdenom : f_star + H ≠ 0) : scalar_repair_certificate f_star H - sigma_star = (2 * f_star - 1) * (H - s_star)^2 / (f_star * (f_star + H)) := by unfold scalar_repair_certificate rw [hs, hsigma] have hD : f_star * (f_star + H) ≠ 0 := mul_ne_zero hf_pos hdenom apply mul_right_cancel₀ hD calc ((1 + H) * (f_star + (2 * f_star - 1) * H) / (f_star * (f_star + H)) - (9 - 16 * f_star + 6 * f_star ^ 2)) * (f_star * (f_star + H)) = (1 + H) * (f_star + (2 * f_star - 1) * H) - (9 - 16 * f_star + 6 * f_star ^ 2) * (f_star * (f_star + H)) := by rw [sub_mul, div_mul_cancel₀ _ hD] _ = (2 * f_star - 1) * (H - (1 - f_star)) ^ 2 := by linear_combination (1 - 3 * f_star - 3 * H) * hcubic _ = (2 * f_star - 1) * (H - (1 - f_star)) ^ 2 / (f_star * (f_star + H)) * (f_star * (f_star + H)) := by rw [div_mul_cancel₀ _ hD]