Principal declarations
theorem AttainCircuit.cancel_iff_bit
Module AttainCircuit
(lean/phase3/AttainCircuit.lean, lines 29–62) · file SHA-256 13b98daabaa917e5… Axioms reported by the fresh build: propext, Quot.sound
x XOR t < x iff x has t's top bit (t ≠ 0).
Statement as elaborated and printed by Lean 4.26.0
∀ {x t : ℕ}, t ≠ 0 → (x ^^^ t < x ↔ x.testBit t.log2 = true)
Exact source text, lines 29–62
29/-- x XOR t < x iff x has t's top bit (t ≠ 0). -/30theorem cancel_iff_bit {x t : Nat} (ht : t ≠ 0) : x ^^^ t < x ↔ x.testBit t.log2 = true := by31 have htk : t.testBit t.log2 = true := by32 cases hb : t.testBit t.log2 with33 | true => rfl34 | false =>35 exfalso36 have hlt : t < 2 ^ t.log2 := by37 apply Nat.lt_pow_two_of_testBit38 intro i hi39 by_cases hik : i = t.log240 · subst hik; exact hb41 · exact Nat.testBit_lt_two_pow (Nat.lt_of_lt_of_le Nat.lt_log2_self42 (Nat.pow_le_pow_right (by decide) (by omega)))43 exact absurd (Nat.log2_self_le ht) (Nat.not_le.mpr hlt)44 have habove : ∀ i, t.log2 < i → t.testBit i = false := fun i hi =>45 Nat.testBit_lt_two_pow (Nat.lt_of_lt_of_le Nat.lt_log2_self46 (Nat.pow_le_pow_right (by decide) (by omega)))47 constructor48 · intro hlt49 cases hx : x.testBit t.log2 with50 | true => rfl51 | false =>52 exfalso53 have : x < x ^^^ t := by54 apply lt_of_top_testBit (k := t.log2) hx55 · rw [Nat.testBit_xor, hx, htk]; rfl56 · intro i hi; rw [Nat.testBit_xor, habove i hi, Bool.xor_false]57 omega58 · intro hx59 apply lt_of_top_testBit (k := t.log2)60 · rw [Nat.testBit_xor, hx, htk]; rfl61 · exact hx62 · intro i hi; rw [Nat.testBit_xor, habove i hi, Bool.xor_false]
Project declarations in the statement: none
Project declarations used by the proof or definition body
Rollout.lt_of_top_testBit
theorem LocalRestore.localDelta_eq
Module LocalRestore
(lean/phase4/LocalRestore.lean, lines 153–174) · file SHA-256 fc4c7f908b0c9c58… Axioms reported by the fresh build: propext, Quot.sound
SINGLE-CHANGE DELTA: on frames differing in at most one heap the local delta is
nim(Q) ⊕ nim(Q').
Statement as elaborated and printed by Lean 4.26.0
∀ {B N : ℕ} {Q Q' : List ℕ},
Q.length = N →
Q'.length = N →
NimAudit.Game.Width B Q →
NimAudit.Game.Width B Q' →
NimAudit.LocalRestore.OneChange Q Q' →
NimAudit.LocalRestore.localDelta B N Q Q' = NimAudit.nimSum Q ^^^ NimAudit.nimSum Q'
Exact source text, lines 153–174
153/-- SINGLE-CHANGE DELTA: on frames differing in at most one heap the local delta is154 nim(Q) ⊕ nim(Q'). -/155theorem localDelta_eq {B N : Nat} {Q Q' : List Nat} (hQ : Q.length = N) (hQ' : Q'.length = N)156 (hw : Width B Q) (hw' : Width B Q') (h1 : OneChange Q Q') :157 localDelta B N Q Q' = nimSum Q ^^^ nimSum Q' := by158 apply ofBits_testBit_eq (Nat.xor_lt_two_pow (nimSum_lt hw) (nimSum_lt hw'))159 intro q _160 rcases h1 with rfl | ⟨pre, x, post, y, rfl, rfl⟩161 · simp162 · rw [delta_oneChange, Nat.testBit_xor]163 have hN : N = pre.length + 1 + post.length := by rw [← hQ]; simp; omega164 apply Bool.eq_iff_iff.mpr165 simp only [List.any_eq_true, List.mem_range, getD_split]166 constructor167 · rintro ⟨i, _, hi⟩168 by_cases h1 : i < pre.length169 · simp [h1] at hi170 · by_cases h2 : i = pre.length171 · simpa [h2] using hi172 · simp [h1, h2] at hi173 · intro h174 exact ⟨pre.length, by omega, by simpa using h⟩
Project declarations in the statement: Game.Width, LocalRestore.OneChange, LocalRestore.localDelta, nimSum
Project declarations used by the proof or definition body
Game.Width, Game.nimSum_lt, LocalRestore.OneChange, LocalRestore.delta_oneChange, LocalRestore.getD_split, Recurrent.ofBits_testBit_eq, nimSum
Definitions these statements use
def Game.Width
Module NimGame
(lean/phase2/NimGame.lean, lines 31–32) · file SHA-256 23df6bb87ecfd344…
B-bit board: every heap is below 2^B.
Statement as elaborated and printed by Lean 4.26.0
ℕ → List ℕ → Prop
Exact source text, lines 31–32
31/-- B-bit board: every heap is below 2^B. -/32def Width (B : Nat) (p : List Nat) : Prop := ∀ x ∈ p, x < 2 ^ B
Project declarations in the statement: none
Project declarations used by the proof or definition body
none
def LocalRestore.OneChange
Module LocalRestore
(lean/phase4/LocalRestore.lean, lines 99–101) · file SHA-256 fc4c7f908b0c9c58…
The frames differ in at most one heap.
Statement as elaborated and printed by Lean 4.26.0
List ℕ → List ℕ → Prop
Exact source text, lines 99–101
99/-- The frames differ in at most one heap. -/100def OneChange (Q Q' : List Nat) : Prop :=101 Q = Q' ∨ ∃ pre x post y, Q = pre ++ x :: post ∧ Q' = pre ++ y :: post
Project declarations in the statement: none
Project declarations used by the proof or definition body
none
def LocalRestore.localDelta
Module LocalRestore
(lean/phase4/LocalRestore.lean, lines 132–134) · file SHA-256 fc4c7f908b0c9c58…
The local delta value read off the circuit (no promise).
Statement as elaborated and printed by Lean 4.26.0
ℕ → ℕ → List ℕ → List ℕ → ℕ
Exact source text, lines 132–134
132/-- The local delta value read off the circuit (no promise). -/133def localDelta (B N : Nat) (Q Q' : List Nat) : Nat :=134 ofBits B (fun q => (List.range N).any (fun i => (Q.getD i 0).testBit q != (Q'.getD i 0).testBit q))
Project declarations in the statement: none
Project declarations used by the proof or definition body
Game.ofBits
def nimSum
Module NimCore
(lean/NimCore.lean, lines 7–9) · file SHA-256 b07db6c505210d5a…
Statement as elaborated and printed by Lean 4.26.0
List ℕ → ℕ
Exact source text, lines 7–9
7def nimSum : List Nat → Nat8 | [] => 09 | h :: t => h ^^^ nimSum t
Project declarations in the statement: none
Project declarations used by the proof or definition body
none
Full modules
Build evidence: fresh isolated rebuild of all 38 bundled modules with Lean (version 4.26.0, started 2026-10-10T15:21:56Z, finished 2026-10-10T15:27:00Z: 38/38 modules compiled, 1588 axiom reports, no errors. See Build for the commands and the independent audit of 2026-10-10 (dated evidence).