NIM paper · interactive edition Interactive edition · paper, explanations and Lean proofs.

Equation (6.2)The total OR-of-XORs extension equals Δ's bit on single-change pairs; not a character for N≥2; degree two for N=1

Checked theorem Lean checks a formal statement corresponding to this claim.

1 Paper text

Local vs. global parity in NIM. In our encoding, the jjth bit of the nim-sum is the parity of the jjth bits across all NN heaps, hence a degree-NN character. Conditional on a specified changed heap ii, the sign encoding of the jjth delta bit is the two-coordinate character (−1)xi,j+xi,j′(-1)^{x_{i,j}+x'_{i,j}}. When the changed index is unknown, the delta bit is specified on pairs of boards differing in at most one heap. A shallow extension to all pairs is dj(P,P′)=⋁i=1N(xi,j⊕xi,j′).d_j(P,P')=\bigvee_{i=1}^{N}(x_{i,j}\oplus x'_{i,j}).(6.2) On the promised domain this is the required delta bit. For N≥2N\ge2, its sign encoding (−1)dj(-1)^{d_j} is not a single character, even up to sign; for N=1N=1 it is exactly a degree-two character. Thus local computability does not mean that the full unknown-index map has degree two. It follows from the explicit AC0\AC^0 construction in Lemma 5.4.

Generated from paper_jmlr.tex, lines 974–981.

2 Explain this

The problem. When the changed heap is not known, the delta bit is only specified on pairs of boards that differ in at most one heap. To talk about its Fourier expansion we need a function on all pairs.

The extension used. dj(P,P′)=⋁i(xi,j⊕xi,j′)d_j(P,P')=\bigvee_i(x_{i,j}\oplus x'_{i,j}): "some heap differs in bit jj". On pairs differing in at most one heap this is exactly the delta bit, and it is computed by a shallow circuit.

Its spectrum. For N≥2N\ge2, the sign of djd_j is not a single character, not even up to sign; for N=1N=1 it is exactly a degree-two character. So "locally computable" does not mean "degree two" once the index is unknown.

Caveat. The promised domain contains every pair with at most one changed heap, including increases and unchanged pairs, not only legal decreasing moves. The statement is about this particular extension, not about every possible extension.

3 How this is formalised

The extension is the circuit LocalRestore.dC and its sign encoding Fourier.dSign on the full 2BN2BN-bit cube.

  • RealFourier.dSign_enc_real: on every pair of BB-bit boards of equal length differing in at most one heap, the sign of djd_j equals the sign of bit jj of nim⁡(Q)⊕nim⁡(Q′)\operatorname{nim}(Q)\oplus\operatorname{nim}(Q').
  • RealFourier.dC_not_character_real and Fourier.dC_not_character: for N≥2N\ge2 and j<Bj<B there is no mask SS and sign c=±1c=\pm1 with sign⁡(dj)=c χS\operatorname{sign}(d_j)=c\,\chi_S on the full cube.
  • RealFourier.dC_one_exactDeg_real: for N=1N=1 it has exact degree 22.
  • Fourier.gMask_delta: the global parity character of degree 2N2N (bit jj of every heap in both frames) agrees with the delta bit on every pair of boards; Fourier.char_unique: it is the only character that agrees with the delta bit on all single-change pairs; Fourier.no_low_degree_extension: hence no character of degree less than 2N2N does. These concern all single-change pairs (including increases and unchanged boards), not legal decreases only.
Coverage record
Paper anchoreq:delta-extension (manuscript label)
Displayed asEquation (6.2)
ClaimThe total OR-of-XORs extension equals Δ's bit on single-change pairs; not a character for N≥2; degree two for N=1
Coverage categoryChecked theorem
Statement sourcepaper_jmlr.tex lines 974–981; SHA-256 of the normalised block source 5228c8bfadd11fe2…
Lean declarations
Assumptions and domain

The promised domain is pairs of boards that differ in at most one heap. It contains more than legal decreases: increases and unchanged pairs are included.

Prose-to-formal notes

The claim concerns the one specified extension djd_j, not every extension of the partial delta function. A separate checked theorem shows that the degree-2N2N global character is the unique character agreeing with the delta bit on all single-change pairs; it is not a statement about legal decreases only.

Depends onLemma 5.4
Audited correspondence rowseq:delta-extension
Explanationsexplain/eq:delta-extension, formal/eq:delta-extension
Build evidencefresh isolated rebuild, audit report

4 Lean statement and source

Principal declarations

theorem RealFourier.dSign_enc_real

Module RealFourier (lean/phase8/RealFourier.lean, lines 207–210) · file SHA-256 e0e69edd199d8650… Axioms reported by the fresh build: propext, Classical.choice, Quot.sound

Statement as elaborated and printed by Lean 4.26.0

∀ {B N q : ℕ} {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.Fourier.dSign B N q (NimAudit.Fourier.enc B N Q Q') =
              NimAudit.Noise.sg ((NimAudit.nimSum Q ^^^ NimAudit.nimSum Q').testBit q)
Exact source text, lines 207–210
207theorem dSign_enc_real {B N q : ℕ} {Q Q' : List ℕ} (hQ : Q.length = N) (hQ' : Q'.length = N)208    (hw : Game.Width B Q) (hw' : Game.Width B Q') (h1 : LocalRestore.OneChange Q Q') :209    (dSign B N q (enc B N Q Q') : ℝ) = sg ((nimSum Q ^^^ nimSum Q').testBit q) :=210  dSign_enc hQ hQ' hw hw' h1

Project declarations in the statement: Fourier.dSign, Fourier.enc, Game.Width, LocalRestore.OneChange, Noise.sg, nimSum

Project declarations used by the proof or definition body

Fourier.dSign_enc, Game.Width, LocalRestore.OneChange

theorem RealFourier.dC_not_character_real

Module RealFourier (lean/phase8/RealFourier.lean, lines 198–200) · file SHA-256 e0e69edd199d8650… Axioms reported by the fresh build: propext, Classical.choice, Quot.sound

Statement as elaborated and printed by Lean 4.26.0

∀ {B N q : ℕ},
  2 ≤ N →
    q < B →
      ¬∃ S c,
          c * c = 1 ∧
            ∀ z ∈ NimAudit.Bridge.bitvecs (2 * (B * N)),
              NimAudit.Fourier.dSign B N q z = c * NimAudit.Fourier.chi S z
Exact source text, lines 198–200
198theorem dC_not_character_real {B N q : ℕ} (hN : 2 ≤ N) (hq : q < B) :199    ¬ ∃ (S : List Bool) (c : ℝ), c * c = 1 ∧ ∀ z ∈ bitvecs (2 * (B * N)), dSign B N q z = c * chi S z :=200  dC_not_character hN hq

Project declarations in the statement: Bridge.bitvecs, Fourier.chi, Fourier.dSign

Project declarations used by the proof or definition body

Fourier.dC_not_character

theorem RealFourier.dC_one_exactDeg_real

Module RealFourier (lean/phase8/RealFourier.lean, lines 217–218) · file SHA-256 e0e69edd199d8650… Axioms reported by the fresh build: propext, Classical.choice, Quot.sound

Statement as elaborated and printed by Lean 4.26.0

∀ {B q : ℕ}, q < B → NimAudit.Fourier.ExactDeg (2 * (B * 1)) (NimAudit.Fourier.dSign B 1 q) 2
Exact source text, lines 217–218
217theorem dC_one_exactDeg_real {B q : ℕ} (hq : q < B) : ExactDeg (2 * (B * 1)) (dSign (R := ℝ) B 1 q) 2 :=218  dC_one_exactDeg hq

Project declarations in the statement: Fourier.ExactDeg, Fourier.dSign

Project declarations used by the proof or definition body

Fourier.dC_one_exactDeg

theorem Fourier.dC_not_character

Module Fourier (lean/phase8/Fourier.lean, lines 723–782) · file SHA-256 afffe6072d707e40… Axioms reported by the fresh build: propext, Classical.choice, Quot.sound

B3 (MAIN): for N ≥ 2 and q < B the sign encoding of dC B N q on the FULL 2BN-bit cube is not ±χ_S for ANY mask S (of any degree).

Statement as elaborated and printed by Lean 4.26.0

∀ {R : Type} [inst : Grind.Field R] [inst_1 : LE R] [inst_2 : LT R] [Std.LawfulOrderLT R]
  [inst_4 : Std.IsLinearOrder R] [Grind.OrderedRing R] {B N q : ℕ},
  2 ≤ N →
    q < B →
      ¬∃ S c,
          c * c = 1 ∧
            ∀ z ∈ NimAudit.Bridge.bitvecs (2 * (B * N)),
              NimAudit.Fourier.dSign B N q z = c * NimAudit.Fourier.chi S z
Exact source text, lines 723–782
723/-- B3 (MAIN): for N ≥ 2 and q < B the sign encoding of dC B N q on the FULL 2BN-bit cube is724    not ±χ_S for ANY mask S (of any degree). -/725theorem dC_not_character {B N q : Nat} (hN : 2 ≤ N) (hq : q < B) :726    ¬ ∃ (S : List Bool) (c : R), c * c = 1 ∧ ∀ z ∈ bitvecs (2 * (B * N)), dSign B N q z = c * chi S z := by727  rintro ⟨S, c, hc, hf⟩728  obtain ⟨p, hp⟩ : ∃ p, p = B - 1 - q := ⟨_, rfl⟩729  have hBN : 2 * B ≤ B * N := by730    have := Nat.mul_le_mul_left B hN; rw [Nat.mul_comm B 2] at this; exact this731  have hB : 1 ≤ B := by omega732  have hpB : p < B := by omega733  have ha : p < 2 * (B * N) := by omega734  have hb : B + p < 2 * (B * N) := by omega735  have m0 : List.replicate (2 * (B * N)) false ∈ bitvecs (2 * (B * N)) := mem_bitvecs_of_length (by simp)736  have m1 := pt_mem (2 * (B * N)) p737  have m2 := pt_mem (2 * (B * N)) (B + p)738  have m12 := twoMask_mem (2 * (B * N)) p (B + p)739  -- values of dSign at the four points740  have v0 : (dSign B N q (List.replicate (2 * (B * N)) false) : R) = 1 := by741    unfold dSign742    rw [eval_dC_any hq hp]743    have : (List.range N).any (fun i => xor (vfun (List.replicate (2 * (B * N)) false) (B * i + p))744        (vfun (List.replicate (2 * (B * N)) false) (B * N + (B * i + p)))) = false := by745      simp only [vfun, getD_replicate_false, Bool.xor_false, List.any_eq_false]; simp746    rw [this]; rfl747  have v1 : (dSign B N q (pt (2 * (B * N)) p) : R) = -1 := by748    apply dSign_true hq hp (i := 0) (by omega)749    rw [pt_getD, pt_getD]750    have e1 : decide (B * 0 + p = p) = true := by simp751    have e2 : decide (B * 0 + p < 2 * (B * N)) = true := by simp; omega752    have e3 : decide (B * N + (B * 0 + p) = p) = false := by simp; omega753    rw [e1, e2, e3]; rfl754  have v2 : (dSign B N q (pt (2 * (B * N)) (B + p)) : R) = -1 := by755    apply dSign_true hq hp (i := 1) (by omega)756    rw [pt_getD, pt_getD]757    have e1 : decide (B * 1 + p = B + p) = true := by simp758    have e2 : decide (B * 1 + p < 2 * (B * N)) = true := by simp; omega759    have e3 : decide (B * N + (B * 1 + p) = B + p) = false := by simp; omega760    rw [e1, e2, e3]; rfl761  have v12 : (dSign B N q (twoMask (2 * (B * N)) p (B + p)) : R) = -1 := by762    apply dSign_true hq hp (i := 0) (by omega)763    rw [twoMask_getD, twoMask_getD]764    have e1 : decide (B * 0 + p = p) = true := by simp765    have e2 : decide (B * 0 + p < 2 * (B * N)) = true := by simp; omega766    have e3 : decide (B * 0 + p = B + p) = false := by simp; omega767    have e4 : decide (B * N + (B * 0 + p) = p) = false := by simp; omega768    have e5 : decide (B * N + (B * 0 + p) = B + p) = false := by simp; omega769    rw [e1, e2, e3, e4, e5]; rfl770  have c0 := hf _ m0771  have c1 := hf _ m1772  have c2 := hf _ m2773  have c12 := hf _ m12774  have hmul : (chi S (twoMask (2 * (B * N)) p (B + p)) : R) = chi S (pt (2 * (B * N)) p) * chi S (pt (2 * (B * N)) (B + p)) :=775    (chi_mul_right S (by simp [pt])).symm776  rw [chi_zeros, v0] at c0777  rw [v1] at c1; rw [v2] at c2; rw [v12, hmul] at c12778  -- 1 = c, −1 = c χ₁, −1 = c χ₂, −1 = c χ₁ χ₂  ⇒  −1 = 1779  have hc1 : c = 1 := by grind780  subst hc1781  have : (-1 : R) = 1 := by grind782  exact one_ne_neg_one this.symm

Project declarations in the statement: Bridge.bitvecs, Fourier.chi, Fourier.dSign

Project declarations used by the proof or definition body

AC0.Circ.eval, Bridge.bitvecs, Bridge.mem_bitvecs_of_length, Bridge.vfun, Fourier.chi, Fourier.chi_mul_right, Fourier.chi_zeros, Fourier.dSign, Fourier.dSign_true, Fourier.eval_dC_any, Fourier.getD_replicate_false, Fourier.one_ne_neg_one, Fourier.pt, Fourier.pt_getD, Fourier.pt_mem, Fourier.twoMask, Fourier.twoMask_getD, Fourier.twoMask_mem, LocalRestore.dC, Noise.sg

theorem Fourier.gMask_delta

Module Fourier (lean/phase8/Fourier.lean, lines 977–985) · file SHA-256 afffe6072d707e40… Axioms reported by the fresh build: propext, Classical.choice, Quot.sound

EXISTENCE: the global parity character (degree 2N) agrees with the delta bit on EVERY encoded pair of B-bit boards (no promise needed).

Statement as elaborated and printed by Lean 4.26.0

∀ {R : Type} [inst : Grind.Field R] [inst_1 : LE R] [inst_2 : LT R] [Std.LawfulOrderLT R]
  [inst_4 : Std.IsLinearOrder R] [Grind.OrderedRing R] {B N q : ℕ},
  q < B →
    ∀ {Q Q' : List ℕ},
      Q.length = N →
        Q'.length = N →
          NimAudit.Game.Width B Q →
            NimAudit.Game.Width B Q' →
              NimAudit.Fourier.chi (NimAudit.Fourier.gMask B N q) (NimAudit.Fourier.enc B N Q Q') =
                NimAudit.Noise.sg ((NimAudit.nimSum Q ^^^ NimAudit.nimSum Q').testBit q)
Exact source text, lines 977–985
977/-- EXISTENCE: the global parity character (degree 2N) agrees with the delta bit on EVERY978    encoded pair of B-bit boards (no promise needed). -/979theorem gMask_delta {B N q : Nat} (hq : q < B) {Q Q' : List Nat} (hQ : Q.length = N) (hQ' : Q'.length = N)980    (hw : Game.Width B Q) (hw' : Game.Width B Q') :981    (chi (gMask B N q) (enc B N Q Q') : R) = sg ((nimSum Q ^^^ nimSum Q').testBit q) := by982  unfold chi gMask983  rw [enc_split, pm_append (by rw [length_maskU, frame_length]),984    ← (Misc.nimsum_bit_character hq (frame_mem B N Q)).1, ← (Misc.nimsum_bit_character hq (frame_mem B N Q')).1,985    decode_frame hQ hw, decode_frame hQ' hw', Nat.testBit_xor]

Project declarations in the statement: Fourier.chi, Fourier.enc, Fourier.gMask, Game.Width, Noise.sg, nimSum

Project declarations used by the proof or definition body

Bridge.decodeBoard, Bridge.length_maskU, Bridge.maskU, Bridge.ones, Bridge.pm, Bridge.pm_append, Fourier.chi, Fourier.decode_frame, Fourier.enc, Fourier.enc_split, Fourier.frame, Fourier.frame_length, Fourier.frame_mem, Fourier.gMask, Game.Width, Misc.nimsum_bit_character, Noise.sg, nimSum

theorem Fourier.char_unique

Module Fourier (lean/phase8/Fourier.lean, lines 1121–1175) · file SHA-256 afffe6072d707e40… Axioms reported by the fresh build: propext, Classical.choice, Quot.sound

UNIQUENESS: a character that agrees with the delta bit q on every single-change pair of B-bit boards is the global parity character. So, for N ≥ 2, no character of degree less than 2N (in particular no degree-two character) agrees with the delta map on the promised single-change domain; the local circuit dC is a different total extension, and is not a character at all (dC_not_character).

Statement as elaborated and printed by Lean 4.26.0

∀ {R : Type} [inst : Grind.Field R] [inst_1 : LE R] [inst_2 : LT R] [Std.LawfulOrderLT R]
  [inst_4 : Std.IsLinearOrder R] [Grind.OrderedRing R] {B N q : ℕ},
  q < B →
    ∀ {S : List Bool},
      S ∈ NimAudit.Bridge.bitvecs (2 * (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.Fourier.chi S (NimAudit.Fourier.enc B N Q Q') =
                        NimAudit.Noise.sg ((NimAudit.nimSum Q ^^^ NimAudit.nimSum Q').testBit q)) →
          S = NimAudit.Fourier.gMask B N q
Exact source text, lines 1121–1175
1121/-- UNIQUENESS: a character that agrees with the delta bit q on every single-change pair of1122    B-bit boards is the global parity character.  So, for N ≥ 2, no character of degree1123    less than 2N (in particular no degree-two character) agrees with the delta map on the1124    promised single-change domain; the local circuit dC is a different total extension,1125    and is not a character at all (dC_not_character). -/1126theorem char_unique {B N q : Nat} (hq : q < B) {S : List Bool} (hS : S ∈ bitvecs (2 * (B * N)))1127    (h : ∀ Q Q', Q.length = N → Q'.length = N → Game.Width B Q → Game.Width B Q' → LocalRestore.OneChange Q Q' →1128      (chi S (enc B N Q Q') : R) = sg ((nimSum Q ^^^ nimSum Q').testBit q)) :1129    S = gMask B N q := by1130  have hSl := mem_bitvecs_length hS1131  have hB : 0 < B := by omega1132  apply mask_ext hS (gMask_mem B N q)1133  intro a ha1134  by_cases ha1 : a < B * N1135  · -- first frame: the pair (unit board, empty board)1136    have hi : a / B < N := by rw [Nat.div_lt_iff_lt_mul hB, Nat.mul_comm]; exact ha11137    have hm : a % B < B := Nat.mod_lt _ hB1138    have hr : B - 1 - a % B < B := by omega1139    have hpos : a = B * (a / B) + (B - 1 - (B - 1 - a % B)) := by1140      have := Nat.div_add_mod a B; omega1141    obtain ⟨pre, post, h0, h1⟩ := unitBoard_split hi (B - 1 - a % B)1142    have hc := h (unitBoard N (a / B) (B - 1 - a % B)) (List.replicate N 0) (unitBoard_length _ _ _) (by simp)1143      (unitBoard_width hr) (zero_width B N) (Or.inr ⟨pre, 2 ^ (B - 1 - a % B), post, 0, h1, h0⟩)1144    rw [enc_unit_left hi hr, h1, h0, LocalRestore.delta_oneChange, ← hpos] at hc1145    unfold chi at hc1146    rw [pm_pt_left hSl ha] at hc1147    have e1 := sg_inj hc1148    rw [e1, Nat.xor_zero, Nat.testBit_two_pow]1149    unfold gMask1150    rw [List.getD_eq_getElem?_getD, List.getElem?_append_left (by rw [length_maskU]; exact ha1),1151      ← List.getD_eq_getElem?_getD]1152    conv => rhs; rw [show a = B * (a / B) + a % B from (Nat.div_add_mod a B).symm]1153    rw [maskU_getD (2 ^ q) hm N (a / B) hi, Nat.testBit_two_pow]1154    simp only [decide_eq_decide]; omega1155  · -- second frame: the pair (empty board, unit board)1156    have hb : a - B * N < B * N := by omega1157    have hi : (a - B * N) / B < N := by rw [Nat.div_lt_iff_lt_mul hB, Nat.mul_comm N B]; exact hb1158    have hm : (a - B * N) % B < B := Nat.mod_lt _ hB1159    have hr : B - 1 - (a - B * N) % B < B := by omega1160    have hpos : a = B * N + (B * ((a - B * N) / B) + (B - 1 - (B - 1 - (a - B * N) % B))) := by1161      have := Nat.div_add_mod (a - B * N) B; omega1162    obtain ⟨pre, post, h0, h1⟩ := unitBoard_split hi (B - 1 - (a - B * N) % B)1163    have hc := h (List.replicate N 0) (unitBoard N ((a - B * N) / B) (B - 1 - (a - B * N) % B)) (by simp)1164      (unitBoard_length _ _ _) (zero_width B N) (unitBoard_width hr) (Or.inr ⟨pre, 0, post, _, h0, h1⟩)1165    rw [enc_unit_right hi hr, h1, h0, LocalRestore.delta_oneChange, ← hpos] at hc1166    unfold chi at hc1167    rw [pm_pt_left hSl ha] at hc1168    have e1 := sg_inj hc1169    rw [e1, Nat.zero_xor, Nat.testBit_two_pow]1170    unfold gMask1171    rw [List.getD_eq_getElem?_getD, List.getElem?_append_right (by rw [length_maskU]; omega), length_maskU,1172      ← List.getD_eq_getElem?_getD]1173    conv => rhs; rw [show a - B * N = B * ((a - B * N) / B) + (a - B * N) % B from (Nat.div_add_mod _ B).symm]1174    rw [maskU_getD (2 ^ q) hm N _ hi, Nat.testBit_two_pow]1175    simp only [decide_eq_decide]; omega

Project declarations in the statement: Bridge.bitvecs, Fourier.chi, Fourier.enc, Fourier.gMask, Game.Width, LocalRestore.OneChange, Noise.sg, nimSum

Project declarations used by the proof or definition body

Bridge.bitvecs, Bridge.length_maskU, Bridge.maskU, Bridge.mem_bitvecs_length, Bridge.pm, Fourier.chi, Fourier.enc, Fourier.enc_unit_left, Fourier.enc_unit_right, Fourier.gMask, Fourier.gMask_mem, Fourier.maskU_getD, Fourier.mask_ext, Fourier.pm_pt_left, Fourier.pt, Fourier.sg_inj, Fourier.unitBoard, Fourier.unitBoard_length, Fourier.unitBoard_split, Fourier.unitBoard_width, Fourier.zero_width, Game.Width, LocalRestore.OneChange, LocalRestore.delta_oneChange, Noise.sg, nimSum

theorem Fourier.no_low_degree_extension

Module Fourier (lean/phase8/Fourier.lean, lines 1210–1218) · file SHA-256 afffe6072d707e40… Axioms reported by the fresh build: propext, Classical.choice, Quot.sound

COROLLARY: for N ≥ 2 no character of degree two (indeed of degree < 2N) agrees with the delta bit on the promised single-change domain, while the global character of degree 2N does.

Statement as elaborated and printed by Lean 4.26.0

∀ {R : Type} [inst : Grind.Field R] [inst_1 : LE R] [inst_2 : LT R] [Std.LawfulOrderLT R]
  [inst_4 : Std.IsLinearOrder R] [Grind.OrderedRing R] {B N q : ℕ},
  q < B →
    ∀ {S : List Bool},
      S ∈ NimAudit.Bridge.bitvecs (2 * (B * N)) →
        NimAudit.Bridge.ones S < 2 * 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.Fourier.chi S (NimAudit.Fourier.enc B N Q Q') =
                          NimAudit.Noise.sg
                            ((NimAudit.nimSum Q ^^^ NimAudit.nimSum Q').testBit q)) →
            False
Exact source text, lines 1210–1218
1210/-- COROLLARY: for N ≥ 2 no character of degree two (indeed of degree < 2N) agrees with the1211    delta bit on the promised single-change domain, while the global character of degree1212    2N does. -/1213theorem no_low_degree_extension {B N q : Nat} (hq : q < B) {S : List Bool} (hS : S ∈ bitvecs (2 * (B * N)))1214    (hdeg : ones S < 2 * N)1215    (h : ∀ Q Q', Q.length = N → Q'.length = N → Game.Width B Q → Game.Width B Q' → LocalRestore.OneChange Q Q' →1216      (chi S (enc B N Q Q') : R) = sg ((nimSum Q ^^^ nimSum Q').testBit q)) : False := by1217  have := char_unique hq hS h1218  rw [this, ones_gMask hq] at hdeg; omega

Project declarations in the statement: Bridge.bitvecs, Bridge.ones, Fourier.chi, Fourier.enc, Game.Width, LocalRestore.OneChange, Noise.sg, nimSum

Project declarations used by the proof or definition body

Bridge.bitvecs, Bridge.ones, Fourier.char_unique, Fourier.chi, Fourier.enc, Fourier.gMask, Fourier.ones_gMask, Game.Width, LocalRestore.OneChange, Noise.sg, nimSum

Definitions these statements use

def LocalRestore.dC

Module LocalRestore (lean/phase4/LocalRestore.lean, lines 57–58) · file SHA-256 fc4c7f908b0c9c58…

Little-endian bit q of the single-change delta: OR over heaps of the bit-q XORs.

Statement as elaborated and printed by Lean 4.26.0

ℕ → ℕ → ℕ → NimAudit.AC0.Circ
Exact source text, lines 57–58
57/-- Little-endian bit q of the single-change delta: OR over heaps of the bit-q XORs. -/58def dC (B N q : Nat) : Circ := if q < B then or ((List.range N).map (fun i => yC B N i (B - 1 - q))) else const false

Project declarations in the statement: AC0.Circ

Project declarations used by the proof or definition body

AC0.Circ, AC0.Circ.const, AC0.Circ.or, LocalRestore.yC

def Fourier.dSign

Module Fourier (lean/phase8/Fourier.lean, lines 689–690) · file SHA-256 afffe6072d707e40…

The sign encoding of the total single-change delta circuit, on the full cube.

Statement as elaborated and printed by Lean 4.26.0

{R : Type} → [Grind.Field R] → ℕ → ℕ → ℕ → List Bool → R
Exact source text, lines 689–690
689/-- The sign encoding of the total single-change delta circuit, on the full cube. -/690def dSign (B N q : Nat) (z : List Bool) : R := sg (eval (vfun z) (LocalRestore.dC B N q))

Project declarations in the statement: none

Project declarations used by the proof or definition body

AC0.Circ.eval, Bridge.vfun, LocalRestore.dC, Noise.sg

def Fourier.enc

Module Fourier (lean/phase8/Fourier.lean, lines 859–860) · file SHA-256 afffe6072d707e40…

The two frames as a point of the full cube.

Statement as elaborated and printed by Lean 4.26.0

ℕ → ℕ → List ℕ → List ℕ → List Bool
Exact source text, lines 859–860
859/-- The two frames as a point of the full cube. -/860def enc (B N : Nat) (Q Q' : List Nat) : List Bool := (List.range (2 * (B * N))).map (LocalRestore.tf B N Q Q')

Project declarations in the statement: none

Project declarations used by the proof or definition body

LocalRestore.tf

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 Noise.sg

Module NoiseModel (lean/phase7/NoiseModel.lean, lines 222–223) · file SHA-256 bde0a1ff202682bd…

±1 encoding of a bit.

Statement as elaborated and printed by Lean 4.26.0

{R : Type} → [Grind.Field R] → Bool → R
Exact source text, lines 222–223
222/-- ±1 encoding of a bit. -/223def sg (b : Bool) : R := if b then -1 else 1

Project declarations in the statement: none

Project declarations used by the proof or definition body

none

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

def Bridge.bitvecs

Module BitBridge (lean/phase3/BitBridge.lean, lines 27–29) · file SHA-256 000644dc271d27f9…

Statement as elaborated and printed by Lean 4.26.0

ℕ → List (List Bool)
Exact source text, lines 27–29
27def bitvecs : Nat → List (List Bool)28  | 0 => [[]]29  | n + 1 => (bitvecs n).map (false :: ·) ++ (bitvecs n).map (true :: ·)

Project declarations in the statement: none

Project declarations used by the proof or definition body

none

def Fourier.chi

Module Fourier (lean/phase8/Fourier.lean, lines 198–199) · file SHA-256 afffe6072d707e40…

The Walsh–Hadamard character χ_S(x) = (−1)^{⟨S,x⟩}.

Statement as elaborated and printed by Lean 4.26.0

{R : Type} → [Grind.Field R] → List Bool → List Bool → R
Exact source text, lines 198–199
198/-- The Walsh–Hadamard character χ_S(x) = (−1)^{⟨S,x⟩}. -/199def chi (S x : List Bool) : R := sg (pm S x)

Project declarations in the statement: none

Project declarations used by the proof or definition body

Bridge.pm, Noise.sg

def Fourier.ExactDeg

Module Fourier (lean/phase8/Fourier.lean, lines 390–392) · file SHA-256 afffe6072d707e40…

Exact Fourier degree d.

Statement as elaborated and printed by Lean 4.26.0

{R : Type} → [Grind.Field R] → ℕ → (List Bool → R) → ℕ → Prop
Exact source text, lines 390–392
390/-- Exact Fourier degree d. -/391def ExactDeg (n : Nat) (f : List Bool → R) (d : Nat) : Prop :=392  DegLe n f d ∧ ∃ T ∈ bitvecs n, ones T = d ∧ coef n f T ≠ 0

Project declarations in the statement: none

Project declarations used by the proof or definition body

Bridge.bitvecs, Bridge.ones, Fourier.DegLe, Fourier.coef

def Fourier.gMask

Module Fourier (lean/phase8/Fourier.lean, lines 967–968) · file SHA-256 afffe6072d707e40…

The global mask: bit q of every heap, in both frames (2N coordinates).

Statement as elaborated and printed by Lean 4.26.0

ℕ → ℕ → ℕ → List Bool
Exact source text, lines 967–968
967/-- The global mask: bit q of every heap, in both frames (2N coordinates). -/968def gMask (B N q : Nat) : List Bool := maskU B N (2 ^ q) ++ maskU B N (2 ^ q)

Project declarations in the statement: none

Project declarations used by the proof or definition body

Bridge.maskU

def Bridge.ones

Module BitBridge (lean/phase3/BitBridge.lean, lines 275–276) · file SHA-256 000644dc271d27f9…

Number of ones in a bit list.

Statement as elaborated and printed by Lean 4.26.0

List Bool → ℕ
Exact source text, lines 275–276
275/-- Number of ones in a bit list. -/276def ones (l : List Bool) : Nat := (l.filter id).length

Project declarations in the statement: none

Project declarations used by the proof or definition body

none

Full modules

ModuleFileLinesImports
BitBridgelean/phase3/BitBridge.lean560Circuit
Fourierlean/phase8/Fourier.lean1379NoiseModel
LocalRestorelean/phase4/LocalRestore.lean587SelectCircuit
NimCorelean/NimCore.lean139Std
NimGamelean/phase2/NimGame.lean634NimRollout
NoiseModellean/phase7/NoiseModel.lean1008Misc
RealFourierlean/phase8/RealFourier.lean275Mathlib.Data.Real.Archimedean, Mathlib.Data.Fintype.BigOperators, Mathlib.Algebra.BigOperators.Fin, Mathlib.Tactic.Linarith, Mathlib.Tactic.Positivity, Mathlib.Tactic.FieldSimp, Mathlib.Tactic.NormNum, Mathlib.Tactic.Ring, Fourier, RealNoise

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).