M06 — Frozen-input differentiation
ProvedVathekProof.M06_frozen_input_gradientTwo facts about frozen components.
(i) The chain derivative through a frozen component's input survives. Take the concrete graft of the source: a trainable bridge grafted into a frozen donor , with loss evaluated at . The composite has gradient at : freezing the donor's parameters does not remove the derivative through its input (detaching that input would falsely give ).
(ii) The declared masked update preserves frozen coordinates. For the masked AdamW instance with , , and nonnegative incoming second moments: every frozen coordinate () of is unchanged by the update, second moments stay nonnegative, and the update denominator is strictly positive — properties of this declared masked update, not of an arbitrary update function.
import Definitions.Def_VathekFrame import Definitions.Def_VathekState import Definitions.Def_VathekAdamW import Definitions.Def_VathekWitness
namespace VathekProof
/-- **M06 — Frozen-input differentiation.** (i) The §5.3 chain instance: a trainable
bridge `w ↦ 3w` grafted into a *frozen* donor `u ↦ 2u`, with loss `½‖u - 1‖²` at
`w₀ = 2`, has the nonzero gradient `66` — freezing the donor's parameters does not
remove the chain derivative through its input (detaching that input would instead
falsely give `0`). (ii) For the declared masked AdamW update: frozen coordinates are
preserved untouched, nonnegative second moments stay nonnegative, and the update
denominator `√v̂ + ε` is strictly positive — properties of this declared masked
update, not of an arbitrary update function. -/
theorem M06_frozen_input_gradient :
HasGradientAt
(fun (w : EuclideanSpace ℝ (Fin 1)) =>
(1 / 2) * ‖(2 : ℝ) • ((3 : ℝ) • w) - WithLp.toLp 2 (fun _ => (1 : ℝ))‖ ^ 2)
(WithLp.toLp 2 (fun _ => (66 : ℝ)))
(WithLp.toLp 2 (fun _ => (2 : ℝ)))
∧ (WithLp.toLp 2 (fun _ => (66 : ℝ)) : EuclideanSpace ℝ (Fin 1)) ≠ 0
∧ ∀ (d : ℕ) (β₁ β₂ η lam ε : ℝ) (T : Finset (Fin d)) (S : TrainState d)
(g : EuclideanSpace ℝ (Fin d)),
0 ≤ β₁ → β₁ < 1 → 0 ≤ β₂ → β₂ < 1 → 0 < ε → (∀ j, 0 ≤ S.mom2 j) →
(∀ j ∉ T, (adamWStep β₁ β₂ η lam ε T S g).w j = S.w j)
∧ (∀ j, 0 ≤ (adamWStep β₁ β₂ η lam ε T S g).mom2 j)
∧ ∀ j, 0 < Real.sqrt (adamM2 β₂ S g j / (1 - β₂ ^ (S.t + 1))) + ε := by sorry
end VathekProofRead-back
What the Lean code literally says, in plain math · glm-5.3 (independent auditor subagent)
{"text": "{\n "readback": "The theorem M06_frozen_input_gradient asserts a conjunction of three statements.\n\nFirst conjunct \u2014 the concrete gradient claim. Let , the one-coordinate Euclidean space (vectors are written via the identification , which packages a coordinate function as an -typed vector; e.g. \\\\mathrm{WithLp.toLp}\\\\ 2\\\\ (\\\\lambda \\\\_ \\\\mapsto 2) is the constant vector ). The claim is that the function\n\n
\n\nwhere is the Euclidean norm on the one-coordinate space and is the constant vector , has gradient at the point equal to the constant vector . Here HasGradientAt is the standard Fr\u00e9chet-gradient notion: as . Concretely on the single coordinate, so the assertion is the literal numerical statement . Note that is the composition of scaling by with scaling by (i.e. ); the norm and squaring are the Euclidean ones.\n\nSecond conjunct \u2014 nonzeroness. The constant vector is not the zero vector. This is a bare inequality; combined with the first conjunct it says the gradient in question is nonzero, but the conjunct itself asserts only .\n\nThird conjunct \u2014 the universally quantified AdamW clause. For every natural number , real numbers , finite set of trainable coordinates, training state , and gradient vector , assuming:\n\n- and ;\n- and ;\n- ;\n- every second-moment slot of is nonnegative: for all coordinates ;\n\nit concludes all three of the following about the state , where the masked AdamW transition is defined coordinatewise by\n\n
\n\nwith the parameter, first-moment, and second-moment vectors of and its step counter:\n\n1. Frozen coordinates preserved: for every coordinate , the updated parameter equals the old one, ;\n2. Second moments stay nonnegative: for every ;\n3. Denominator positivity: for every , , where the square root is the real square root.\n\nEdge cases and fine print. The hypotheses and make the bias-correction denominators and positive (so no division by zero there), and together with they make ; the third conclusion's strict positivity then rests on (it forces the denominator strictly positive even when ). No sign or size restrictions are placed on or (the learning rate and weight-decay coefficient appear only in the trainable-branch formula and are otherwise unconstrained), nor on or . The quantification includes the degenerate cases (empty coordinate set, all three conclusions vacuous coordinatewise) and empty (then conclusion 1 says all coordinates of are unchanged) or full. No conclusion is drawn about the trainable-branch coordinates of , about , or about the step counter beyond its increment as part of the definition. Conclusion 3 concerns the same denominator expression used inside the trainable branch of the update, with computed from the pre-update state ."\n}", "details": {"resolvedPath": "/home/ajax/.omp/agent/sessions/-math/2026-09-22T19-31-08-510Z_01a0ca99-be5e-7000-93c6-dac7c74cc004/RB-M06.md", "contentType": "text/markdown", "totalLines": 3, "displayContent": {"text": "{\n "readback": "The theorem M06_frozen_input_gradient asserts a conjunction of three statements.\n\nFirst conjunct \u2014 the concrete gradient claim. Let , the one-coordinate Euclidean space (vectors are written via the identification , which packages a coordinate function as an -typed vector; e.g. \\\\mathrm{WithLp.toLp}\\\\ 2\\\\ (\\\\lambda \\\\_ \\\\mapsto 2) is the constant vector ). The claim is that the function\n\n
\n\nwhere is the Euclidean norm on the one-coordinate space and is the constant vector , has gradient at the point equal to the constant vector . Here HasGradientAt is the standard Fr\u00e9chet-gradient notion: as . Concretely on the single coordinate, so the assertion is the literal numerical statement . Note that is the composition of scaling by with scaling by (i.e. ); the norm and squaring are the Euclidean ones.\n\nSecond conjunct \u2014 nonzeroness. The constant vector is not the zero vector. This is a bare inequality; combined with the first conjunct it says the gradient in question is nonzero, but the conjunct itself asserts only .\n\nThird conjunct \u2014 the universally quantified AdamW clause. For every natural number , real numbers , finite set of trainable coordinates, training state , and gradient vector , assuming:\n\n- and ;\n- and ;\n- ;\n- every second-moment slot of is nonnegative: for all coordinates ;\n\nit concludes all three of the following about the state , where the masked AdamW transition is defined coordinatewise by\n\n
\n\nwith the parameter, first-moment, and second-moment vectors of and its step counter:\n\n1. Frozen coordinates preserved: for every coordinate , the updated parameter equals the old one, ;\n2. Second moments stay nonnegative: for every ;\n3. Denominator positivity: for every , , where the square root is the real square root.\n\nEdge cases and fine print. The hypotheses and make the bias-correction denominators and positive (so no division by zero there), and together with they make ; the third conclusion's strict positivity then rests on (it forces the denominator strictly positive even when ). No sign or size restrictions are placed on or (the learning rate and weight-decay coefficient appear only in the trainable-branch formula and are otherwise unconstrained), nor on or . The quantification includes the degenerate cases (empty coordinate set, all three conclusions vacuous coordinatewise) and empty (then conclusion 1 says all coordinates of are unchanged) or full. No conclusion is drawn about the trainable-branch coordinates of , about , or about the step counter beyond its increment as part of the definition. Conclusion 3 concerns the same denominator expression used inside the trainable branch of the update, with computed from the pre-update state ."\n}", "startLine": 1, "lineNumbers": [1, 2, 3]}, "meta": {"source": {"type": "internal", "value": "agent://RB-M06"}}}}
Confirmed by the mission captain (proposal self-audit).