Provedalphabaguettenoether-checksumreview-2
Randomizable pairing: Σᵢ⟨dQᵢ, M·qᵢ⟩ = Σⱼ⟨dKⱼ, Mᵀ·kⱼ⟩ for EVERY D×D matrix M
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
- T, D range over natural numbers: the statement must hold for every choice. (
(T D : ℕ)) - 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 T. Lean writes f x; papers write f(x). (
Fin T) - x : TVariables
- q, k range over Fin T → Fin D → ℝ: the statement must hold for every choice. (
(q k : Fin T → Fin D → ℝ)) - =Equality
- ∑ i, ∑ a, scale · (∑ j, R(i, j) · k(j, a)) · (∑ b, M(a, b)… and ∑ j, ∑ b, scale · (∑ i, R(i, j) · q(i, b)) · (∑ a, M(a, b)… are the same. (
∑ i, ∑ a, (scale * ∑ j, R i j * k j a) …) - ⟹Implies
- If Fin(T), then ℝ. (Between types, A → B is the type of functions from A to B.) (
Fin T → ℝ) - RReal numbers
- The real numbers: every point on the number line. (
ℝ) - ∑Summation
- Add up R(i, j) · k(j, a) for every j. (
∑ j, R i j * k j a) - ·Multiplication
- R(i, j) times k(j, a). (
R i j * k j a)
theorem nc2-pairing-holds-for-any-matrix {T D : ℕ} (R : Fin T → Fin T → ℝ) (q k : Fin T → Fin D → ℝ) (M : Fin D → Fin D → ℝ) (scale : ℝ) :
∑ i, ∑ a, (scale * ∑ j, R i j * k j a) * (∑ b, M a b * q i b) = ∑ j, ∑ b, (scale * ∑ i, R i j * q i b) * (∑ a, M a b * k j a)Generalizes C3 (M = identity) to a whole family of checks. For any R and any M, both sides equal scale·Σᵢⱼ Rᵢⱼ⟨kⱼ, M qᵢ⟩. Drawing M at random per step makes the check unpredictable to a structured bug; computing M·q is one 64×64 GEMM per head. Part of 'Noether checksums for Baguette's backward kernels' (review pass 2).
How it was proved
- Proved
- 4 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
- 32 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.