Provedalphabaguettenoether-checksumlinear
Checksum E1 (Euler homogeneity): for y = Wx, Σₜ⟨dyₜ, yₜ⟩ = ⟨dW, W⟩ = Σₜ⟨dxₜ, xₜ⟩
For all , , and :
What the notation means · or point at any symbol
- NNatural numbers
- The natural numbers 0, 1, 2, …. In Lean they start at 0. (
ℕ) - x ∈ TVariables
- N, Din, Dout range over natural numbers: the statement must hold for every choice. (
(N Din Dout : ℕ)) - Fin
- Fin: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (
Fin) - f(x)Function application
- Fin applied to Dout. Lean writes f x; papers write f(x). (
Fin Dout) - ∧And
- Both hold: (∑ t, ∑ o, dy(t, o) · (∑ c, W(o, c) · x(t, c))) = (∑ o, ∑ …, and (∑ t, ∑ o, dy(t, o) · (∑ c, W(o, c) · x(t, c))) = (∑ t, ∑ …. (
(∑ t, ∑ o, dy t o * (∑ c, W o c * x t c…) - =Equality
- ∑ t, ∑ o, dy(t, o) · (∑ c, W(o, c) · x(t, c)) and ∑ o, ∑ c, (∑ t, dy(t, o) · x(t, c)) · W(o, c) are the same. (
∑ t, ∑ o, dy t o * (∑ c, W o c * x t c)…) - ⟹Implies
- If Fin(Din), then ℝ. (Between types, A → B is the type of functions from A to B.) (
Fin Din → ℝ) - RReal numbers
- The real numbers: every point on the number line. (
ℝ) - ∑Summation
- Add up W(o, c) · x(t, c) for every c. (
∑ c, W o c * x t c) - ·Multiplication
- W(o, c) times x(t, c). (
W o c * x t c)
theorem nc-linear-euler-identity {N Din Dout : ℕ} (W : Fin Dout → Fin Din → ℝ) (x : Fin N → Fin Din → ℝ) (dy : Fin N → Fin Dout → ℝ) :
(∑ t, ∑ o, dy t o * (∑ c, W o c * x t c) = ∑ o, ∑ c, (∑ t, dy t o * x t c) * W o c) ∧ (∑ t, ∑ o, dy t o * (∑ c, W o c * x t c) = ∑ t, ∑ c, (∑ o, W o c * dy t o) * x t c)A linear layer is homogeneous of degree one in its weights and in its input. Euler's identity ties the forward output, the weight-gradient kernel (dW = Σₜ dyₜxₜᵀ) and the data-gradient kernel (dxₜ = Wᵀdyₜ) together: three scalars that must agree. In the experiment a weight-gradient kernel reading input rows in the wrong order is flagged at ≈ 4·10⁶× the clean residual. Part of 'Noether checksums for Baguette's backward kernels'.
How it was proved
- Proved
- 3 October 2026
- By
- Ajax, with the agent “Baguette math & proofs (Claude Code, 2026-10-03)”
- Checked by
- Lean's kernel (Lean 4.33.1, with Mathlib); the proof is signed and replays offline
- Axioms
- Classical.choice, Quot.sound, propext
- Proof
- 24 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.