M03 — Shared-path chain rule
ProvedVathekProof.M03_chain_rule_pairThe shared-path chain rule for the pair map. Let be differentiable at , let its partial gradient in the parameter argument at that point be (the gradient of at ) and its partial gradient in the shared-state argument be (the gradient of at ), and let have Fréchet derivative at . Then the composite has gradient
All derivatives are genuine Fréchet derivatives, paired with their gradient vectors by inner-product duality — no uninterpreted function named gradient appears. Note that the two partial-gradient hypotheses alone would not give the conclusion (partial derivatives do not imply total differentiability); the differentiability of at the point used is a genuine hypothesis. Freezing a component's parameters does not remove the chain derivative through its input.
import Definitions.Def_VathekFrame import Definitions.Def_VathekState import Definitions.Def_VathekAdamW import Definitions.Def_VathekWitness
namespace VathekProof
/-- **M03 — Shared-path chain rule** (white paper Eq. (7)). If `f` is differentiable
at `(w₀, h w₀)` with partial gradients `a` (in the parameter argument) and `c` (in the
shared-state argument), and `h` has derivative `h'` at `w₀`, then the composite
`w ↦ f (w, h w)` has gradient `a + h'ᵀ c`. Derivatives are genuine Fréchet
derivatives paired by inner-product duality; freezing a component's parameters does
not remove the chain derivative through its input. -/
theorem M03_chain_rule_pair {d m : ℕ}
(f : EuclideanSpace ℝ (Fin d) × EuclideanSpace ℝ (Fin m) → ℝ)
(h : EuclideanSpace ℝ (Fin d) → EuclideanSpace ℝ (Fin m))
(w₀ : EuclideanSpace ℝ (Fin d))
(a : EuclideanSpace ℝ (Fin d)) (c : EuclideanSpace ℝ (Fin m))
(h' : EuclideanSpace ℝ (Fin d) →L[ℝ] EuclideanSpace ℝ (Fin m))
(ha : HasGradientAt (fun w => f (w, h w₀)) a w₀)
(hc : HasGradientAt (fun v => f (w₀, v)) c (h w₀))
(hh : HasFDerivAt h h' w₀)
(hf : DifferentiableAt ℝ f (w₀, h w₀)) :
HasGradientAt (fun w => f (w, h w)) (a + h'.adjoint c) w₀ := by sorry
end VathekProofRead-back
What the Lean code literally says, in plain math · glm-5.3 (independent auditor subagent)
{"text": "{\n "readback": "Theorem M03_chain_rule_pair (in namespace VathekProof). For all natural numbers and (either of which may be ), write and for the Euclidean spaces of real - and -tuples, equipped with the standard inner product (sum over the , resp. , coordinates) and the norm . The theorem takes as data, each of them arbitrary except as constrained by the four hypotheses below: a function (the product space is normed by ); a function ; a point ; vectors and ; and a continuous -linear map (in finite dimensions continuity is automatic, so is simply a linear map, represented in the standard bases by an real matrix ).\n\nThroughout, \u201cgradient\u201d is meant in the inner-product (Riesz) sense. For a real-valued function on a Euclidean space, the assertion \u201c has gradient at the point \u201d means that is Fr\u00e9chet differentiable at and its derivative functional is exactly the map ; equivalently,\n\n
\n\nIn particular the assertion includes the existence of the Fr\u00e9chet derivative, and the representing vector is unique when it exists.\n\nThe four hypotheses are:\n\n- the function \u2014 that is, with its second argument frozen at the single value \u2014 has gradient at the point ;\n- the function \u2014 with its first argument frozen at \u2014 has gradient at the point ;\n- is Fr\u00e9chet differentiable at with derivative , i.e. as ;\n- , regarded as a function of the pair , is Fr\u00e9chet differentiable at the single point \u2014 existence only, with no derivative value specified.\n\nNote exactly where the evaluations sit: both partial-gradient hypotheses and the differentiability hypothesis concern the one common pair \u2014 varies the first coordinate around while the second is held at , and varies the second coordinate around while the first is held at ; is taken at .\n\nThe conclusion asserts that the composite function has gradient\n\n
a + h'^\\\\dagger c \\\\;\\\\in\\\\; E_d\n\nat ; that is, this composite is Fr\u00e9chet differentiable at and its derivative there is the functional z \\\\mapsto \\\\langle a + h'^\\\\dagger c,\\\\; z\\\\rangle. Here h'^\\\\dagger denotes the adjoint of : the unique continuous linear map h'^\\\\dagger : E_m \\\\to E_d characterized by\n\n
\\\\langle h' x,\\\\; y\\\\rangle_{E_m} = \\\\langle x,\\\\; h'^\\\\dagger y\\\\rangle_{E_d} \\\\qquad \\\\text{for all } x \\\\in E_d,\\\\; y \\\\in E_m.\n\nIn matrix terms, if is given by the matrix , then h'^\\\\dagger is given by the transpose , so the claimed gradient vector is .\n\nEverything in the statement is pointwise: and are not required to be continuous, differentiable, or bounded anywhere except as stated at the points , , and , and the conclusion likewise concerns only the single point . Degenerate dimensions are included in the quantifiers: if , then is the one-point zero space, and are necessarily its unique element , is the unique (zero) map and h'^\\\\dagger c = 0, is constant, and the conclusion coincides verbatim with hypothesis ; if the parameter space is a single point and the gradient assertion becomes trivial in content. The hypotheses are jointly satisfiable \u2014 for example with an affine and any satisfies all four, with , , and the linear part \u2014 so the statement is not vacuous."\n}", "details": {"resolvedPath": "/home/ajax/.omp/agent/sessions/-math/2026-09-22T19-31-08-510Z_01a0ca99-be5e-7000-93c6-dac7c74cc004/RB-M03.md", "contentType": "text/markdown", "totalLines": 3, "displayContent": {"text": "{\n "readback": "Theorem M03_chain_rule_pair (in namespace VathekProof). For all natural numbers and (either of which may be ), write and for the Euclidean spaces of real - and -tuples, equipped with the standard inner product (sum over the , resp. , coordinates) and the norm . The theorem takes as data, each of them arbitrary except as constrained by the four hypotheses below: a function (the product space is normed by ); a function ; a point ; vectors and ; and a continuous -linear map (in finite dimensions continuity is automatic, so is simply a linear map, represented in the standard bases by an real matrix ).\n\nThroughout, \u201cgradient\u201d is meant in the inner-product (Riesz) sense. For a real-valued function on a Euclidean space, the assertion \u201c has gradient at the point \u201d means that is Fr\u00e9chet differentiable at and its derivative functional is exactly the map ; equivalently,\n\n
\n\nIn particular the assertion includes the existence of the Fr\u00e9chet derivative, and the representing vector is unique when it exists.\n\nThe four hypotheses are:\n\n- the function \u2014 that is, with its second argument frozen at the single value \u2014 has gradient at the point ;\n- the function \u2014 with its first argument frozen at \u2014 has gradient at the point ;\n- is Fr\u00e9chet differentiable at with derivative , i.e. as ;\n- , regarded as a function of the pair , is Fr\u00e9chet differentiable at the single point \u2014 existence only, with no derivative value specified.\n\nNote exactly where the evaluations sit: both partial-gradient hypotheses and the differentiability hypothesis concern the one common pair \u2014 varies the first coordinate around while the second is held at , and varies the second coordinate around while the first is held at ; is taken at .\n\nThe conclusion asserts that the composite function has gradient\n\n
a + h'^\\\\dagger c \\\\;\\\\in\\\\; E_d\n\nat ; that is, this composite is Fr\u00e9chet differentiable at and its derivative there is the functional z \\\\mapsto \\\\langle a + h'^\\\\dagger c,\\\\; z\\\\rangle. Here h'^\\\\dagger denotes the adjoint of : the unique continuous linear map h'^\\\\dagger : E_m \\\\to E_d characterized by\n\n
\\\\langle h' x,\\\\; y\\\\rangle_{E_m} = \\\\langle x,\\\\; h'^\\\\dagger y\\\\rangle_{E_d} \\\\qquad \\\\text{for all } x \\\\in E_d,\\\\; y \\\\in E_m.\n\nIn matrix terms, if is given by the matrix , then h'^\\\\dagger is given by the transpose , so the claimed gradient vector is .\n\nEverything in the statement is pointwise: and are not required to be continuous, differentiable, or bounded anywhere except as stated at the points , , and , and the conclusion likewise concerns only the single point . Degenerate dimensions are included in the quantifiers: if , then is the one-point zero space, and are necessarily its unique element , is the unique (zero) map and h'^\\\\dagger c = 0, is constant, and the conclusion coincides verbatim with hypothesis ; if the parameter space is a single point and the gradient assertion becomes trivial in content. The hypotheses are jointly satisfiable \u2014 for example with an affine and any satisfies all four, with , , and the linear part \u2014 so the statement is not vacuous."\n}", "startLine": 1, "lineNumbers": [1, 2, 3]}, "meta": {"source": {"type": "internal", "value": "agent://RB-M03"}}}}
Confirmed by the mission captain (proposal self-audit).