Provedalphabaguettebaguette-zreversible
Backward recomputation reconstructs every intermediate state exactly
For all , and , if (given ), then
What the notation means · or point at any symbol
- Type
- Type: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (
Type) - AddGroup
- AddGroup: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (
AddGroup) - f(x)Function application
- AddGroup applied to G. Lean writes f x; papers write f(x). (
AddGroup G) - NNatural numbers
- The natural numbers 0, 1, 2, …. In Lean they start at 0. (
ℕ) - x : TVariables
- F, H range over ℕ → G → G: the statement must hold for every choice. (
(F H : ℕ → G → G)) - ∀For all
- The statement after the comma holds for every l. (
∀ l, s (l + 1) = ((s l).1 + F l (s l).2…) - ⟹Implies
- If G, then G. (Between types, A → B is the type of functions from A to B.) (
G → G) - ×Product
- Pairs of an element of G and an element of G. (
G × G) - =Equality
- s(l + 1) and (s(l).1 + F(l, s(l)).2, s(l).2 + H(l, s(l).1 + F(l, s(l)).… are the same. (
s (l + 1) = ((s l).1 + F l (s l).2, (s …) - +Addition
- l plus 1. (
l + 1) - (a, b)Tuple
- The ordered pair (or tuple) of s(l).1 + F(l, s(l)).2, s(l).2 + H(l, s(l).1 + F(l, s(l)).2). (
((s l).1 + F l (s l).2, (s l).2 + H l (…) - p₁Component
- Component 1 of s(l) (the first). (
(s l).1) - -Subtraction
- s(l + 1).2 minus H(l, s(l + 1)).1. On ℕ, Lean's subtraction stops at 0: 2 − 5 = 0. (
(s (l + 1)).2 - H l (s (l + 1)).1)
theorem bz-rev-reconstruct-every-state {G : Type} [AddGroup G] (F H : ℕ → G → G) (s : ℕ → G × G) (hs : ∀ l, s (l + 1) = ((s l).1 + F l (s l).2, (s l).2 + H l ((s l).1 + F l (s l).2))) :
∀ l, ((s (l + 1)).1 - F l ((s (l + 1)).2 - H l (s (l + 1)).1), (s (l + 1)).2 - H l (s (l + 1)).1) = s lIf the stored-nothing forward pass satisfies s(l+1) = block_l(s(l)), then applying the explicit inverse of block l to s(l+1) returns s(l) exactly, for every layer l. No activations need to be saved. Part of the plan 'Baguette-Z: closed-loop certified integer-state training'.
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
- propext
- Proof
- 14 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.