interplane.Get Omega
Read in your language

omega-principia

This project has not described itself yet.

Brought by drakestapleton

branch main Branches Tags History

omega-principia / proofs / QuantumWorldRecordsW3.lean

236 lines · 10018 bytes Raw Blame History
1/-
2 SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3 experiments/frontier_8h_quantum/lean/QuantumWorldRecordsW3.lean
4
5 Standalone zero-Mathlib Lean 4.36.0 formal algebraic certification of Frontier 3 Wave 3
6 world-record non-symmetric 2-circulant Butson Hadamard matrices over exact Eisenstein
7 integers Z[zeta_6]:
8 1. BH(110, 6) — non-symmetric 2-circulant H = [A, B; -B^dagger, A^dagger], m = 55,
9 subgroup H = <4> <= Z_55* (ord(4) = 10, 9 orbits), zero Kronecker decompositions
10 (110 = 2*5*11; BH(5,6), BH(11,6), BH(55,6) all DNE by de Launey-Winterhof).
11 2. BH(146, 6) — non-symmetric 2-circulant H = [A, B; -B^dagger, A^dagger], m = 73 (prime),
12 subgroup H = <2> <= Z_73* (ord(2) = 9, 9 orbits), zero Kronecker decompositions.
13
14 Zero sorry, zero admit, zero native_decide, zero axiom, zero unsafe, zero Mathlib.
15-/
16
17set_option maxRecDepth 32768
18set_option maxHeartbeats 4000000
19
20namespace QuantumWorldRecordsW3
21
22structure Eisenstein where
23 re : Int
24 im : Int
25 deriving DecidableEq, Repr
26
27def eZero : Eisenstein := ⟨0, 0⟩
28
29def eAdd (a b : Eisenstein) : Eisenstein := ⟨a.re + b.re, a.im + b.im⟩
30
31def zeta6 (e : Nat) : Eisenstein :=
32 match e % 6 with
33 | 0 => ⟨1, 0⟩
34 | 1 => ⟨0, 1⟩
35 | 2 => ⟨-1, 1⟩
36 | 3 => ⟨-1, 0⟩
37 | 4 => ⟨0, -1⟩
38 | _ => ⟨1, -1⟩
39
40def conjExp6 (e : Nat) : Nat := (6 - (e % 6)) % 6
41def negExp6 (e : Nat) : Nat := (e + 3) % 6
42
43def prodConj6 (a b : Nat) : Eisenstein :=
44 zeta6 ((a + 6 - b) % 6)
45
46def eSumAux (f : Nat → Eisenstein) : Nat → Eisenstein → Eisenstein
47 | 0, acc => acc
48 | n + 1, acc => eSumAux f n (eAdd acc (f n))
49
50def eSum (n : Nat) (f : Nat → Eisenstein) : Eisenstein :=
51 eSumAux f n eZero
52
53def allBelow (p : Nat → Bool) : Nat → Bool
54 | 0 => true
55 | n + 1 => p n && allBelow p n
56
57/-- Generic non-symmetric 2-circulant entry exponent of H = [A, B; -B^dagger, A^dagger] of order 2*m. -/
58def circ2Entry (m : Nat) (a b : Nat → Nat) (r c : Nat) : Nat :=
59 if r < m then
60 if c < m then
61 a ((c + m - r) % m)
62 else
63 b ((c - r) % m)
64 else
65 let r' := r - m
66 if c < m then
67 negExp6 (conjExp6 (b ((r' + m - c) % m)))
68 else
69 let c' := c - m
70 conjExp6 (a ((r' + m - c') % m))
71
72def gramEntry (m : Nat) (a b : Nat → Nat) (r c : Nat) : Eisenstein :=
73 eSum (2 * m) (fun k => prodConj6 (circ2Entry m a b r k) (circ2Entry m a b c k))
74
75def pafAB (m : Nat) (a b : Nat → Nat) (s : Nat) : Eisenstein :=
76 eSum m (fun k =>
77 eAdd (prodConj6 (a k) (a ((k + s) % m)))
78 (prodConj6 (b k) (b ((k + s) % m))))
79
80def crossAB (m : Nat) (a b : Nat → Nat) (j : Nat) : Eisenstein :=
81 eSum m (fun k =>
82 eAdd (prodConj6 (a k) (negExp6 (conjExp6 (b ((j + m - k) % m)))))
83 (prodConj6 (b k) (conjExp6 (a ((j + m - k) % m)))))
84
85def validExps (m : Nat) (a : Nat → Nat) : Bool :=
86 allBelow (fun i => a i < 6) m
87
88def isNonSym (m : Nat) (a : Nat → Nat) : Bool :=
89 !allBelow (fun x => a x == a ((m - x) % m)) m
90
91-- ============================================================================
92-- 1. BH(110, 6): Non-symmetric 2-circulant m = 55, H = <4> <= Z_55* (9 orbits)
93-- ============================================================================
94
95def bh110A : Nat → Nat
96 | 0 => 0 | 1 => 0 | 2 => 5 | 3 => 2 | 4 => 0 | 5 => 3 | 6 => 3 | 7 => 5 | 8 => 5 | 9 => 0
97 | 10 => 1 | 11 => 4 | 12 => 2 | 13 => 5 | 14 => 0 | 15 => 3 | 16 => 0 | 17 => 5 | 18 => 5 | 19 => 3
98 | 20 => 3 | 21 => 3 | 22 => 0 | 23 => 2 | 24 => 3 | 25 => 3 | 26 => 0 | 27 => 2 | 28 => 5 | 29 => 3
99 | 30 => 1 | 31 => 0 | 32 => 5 | 33 => 0 | 34 => 0 | 35 => 1 | 36 => 0 | 37 => 2 | 38 => 2 | 39 => 3
100 | 40 => 1 | 41 => 3 | 42 => 2 | 43 => 5 | 44 => 4 | 45 => 3 | 46 => 3 | 47 => 2 | 48 => 2 | 49 => 0
101 | 50 => 1 | 51 => 3 | 52 => 5 | 53 => 2 | 54 => 3 | _ => 0
102
103def bh110B : Nat → Nat
104 | 0 => 0 | 1 => 0 | 2 => 0 | 3 => 2 | 4 => 0 | 5 => 1 | 6 => 4 | 7 => 0 | 8 => 0 | 9 => 0
105 | 10 => 4 | 11 => 1 | 12 => 2 | 13 => 0 | 14 => 0 | 15 => 1 | 16 => 0 | 17 => 0 | 18 => 0 | 19 => 4
106 | 20 => 1 | 21 => 4 | 22 => 3 | 23 => 2 | 24 => 4 | 25 => 1 | 26 => 0 | 27 => 2 | 28 => 0 | 29 => 4
107 | 30 => 4 | 31 => 0 | 32 => 0 | 33 => 3 | 34 => 0 | 35 => 4 | 36 => 0 | 37 => 2 | 38 => 2 | 39 => 4
108 | 40 => 4 | 41 => 4 | 42 => 2 | 43 => 0 | 44 => 1 | 45 => 1 | 46 => 4 | 47 => 2 | 48 => 2 | 49 => 0
109 | 50 => 4 | 51 => 4 | 52 => 0 | 53 => 2 | 54 => 4 | _ => 0
110
111theorem bh110_6_valid_exps : validExps 55 bh110A = true ∧ validExps 55 bh110B = true := by decide
112
113theorem bh110_6_nonsymmetric : isNonSym 55 bh110A = true ∧ isNonSym 55 bh110B = true := by decide
114
115theorem bh110_6_paf_diag : pafAB 55 bh110A bh110B 0 = ⟨110, 0⟩ := by decide
116
117theorem bh110_6_paf_offdiag_all :
118 allBelow (fun s => if s == 0 then true else pafAB 55 bh110A bh110B s == eZero) 55 = true := by
119 decide
120
121theorem bh110_6_cross_all :
122 allBelow (fun j => crossAB 55 bh110A bh110B j == eZero) 55 = true := by
123 decide
124
125theorem bh110_6_gram_row0_all :
126 allBelow (fun c =>
127 gramEntry 55 bh110A bh110B 0 c == (if c == 0 then ⟨110, 0⟩ else eZero)) 110 = true := by
128 decide
129
130theorem bh110_6_gram_row55_all :
131 allBelow (fun c =>
132 gramEntry 55 bh110A bh110B 55 c == (if c == 55 then ⟨110, 0⟩ else eZero)) 110 = true := by
133 decide
134
135theorem bh110_6_order_arith :
136 2 * 55 = 110 ∧ 110 % 4 = 2 ∧ 110 % 3 = 2 ∧ 5 * 11 = 55 ∧ 5 % 6 = 5 ∧ 11 % 6 = 5 := by
137 decide
138
139-- ============================================================================
140-- 2. BH(146, 6): Non-symmetric 2-circulant m = 73 (prime), H = <2> <= Z_73* (9 orbits)
141-- ============================================================================
142
143def bh146A : Nat → Nat
144 | 0 => 0 | 1 => 0 | 2 => 0 | 3 => 3 | 4 => 0 | 5 => 3 | 6 => 3 | 7 => 3 | 8 => 0 | 9 => 4
145 | 10 => 3 | 11 => 5 | 12 => 3 | 13 => 1 | 14 => 3 | 15 => 5 | 16 => 0 | 17 => 2 | 18 => 4 | 19 => 3
146 | 20 => 3 | 21 => 5 | 22 => 5 | 23 => 3 | 24 => 3 | 25 => 5 | 26 => 1 | 27 => 5 | 28 => 3 | 29 => 1
147 | 30 => 5 | 31 => 1 | 32 => 0 | 33 => 2 | 34 => 2 | 35 => 5 | 36 => 4 | 37 => 0 | 38 => 3 | 39 => 3
148 | 40 => 3 | 41 => 4 | 42 => 5 | 43 => 1 | 44 => 5 | 45 => 2 | 46 => 3 | 47 => 5 | 48 => 3 | 49 => 5
149 | 50 => 5 | 51 => 1 | 52 => 1 | 53 => 2 | 54 => 5 | 55 => 0 | 56 => 3 | 57 => 4 | 58 => 1 | 59 => 2
150 | 60 => 5 | 61 => 5 | 62 => 1 | 63 => 2 | 64 => 0 | 65 => 4 | 66 => 2 | 67 => 5 | 68 => 2 | 69 => 4
151 | 70 => 5 | 71 => 4 | 72 => 4 | _ => 0
152
153def bh146B : Nat → Nat
154 | 0 => 0 | 1 => 0 | 2 => 0 | 3 => 1 | 4 => 0 | 5 => 5 | 6 => 1 | 7 => 5 | 8 => 0 | 9 => 5
155 | 10 => 5 | 11 => 3 | 12 => 1 | 13 => 4 | 14 => 5 | 15 => 3 | 16 => 0 | 17 => 3 | 18 => 5 | 19 => 1
156 | 20 => 5 | 21 => 3 | 22 => 3 | 23 => 1 | 24 => 1 | 25 => 2 | 26 => 4 | 27 => 2 | 28 => 5 | 29 => 4
157 | 30 => 3 | 31 => 4 | 32 => 0 | 33 => 3 | 34 => 3 | 35 => 2 | 36 => 5 | 37 => 0 | 38 => 1 | 39 => 5
158 | 40 => 5 | 41 => 5 | 42 => 3 | 43 => 4 | 44 => 3 | 45 => 3 | 46 => 1 | 47 => 3 | 48 => 1 | 49 => 2
159 | 50 => 2 | 51 => 4 | 52 => 4 | 53 => 3 | 54 => 2 | 55 => 0 | 56 => 5 | 57 => 5 | 58 => 4 | 59 => 3
160 | 60 => 3 | 61 => 2 | 62 => 4 | 63 => 3 | 64 => 0 | 65 => 5 | 66 => 3 | 67 => 2 | 68 => 3 | 69 => 5
161 | 70 => 2 | 71 => 5 | 72 => 5 | _ => 0
162
163theorem bh146_6_valid_exps : validExps 73 bh146A = true ∧ validExps 73 bh146B = true := by decide
164
165theorem bh146_6_nonsymmetric : isNonSym 73 bh146A = true ∧ isNonSym 73 bh146B = true := by decide
166
167theorem bh146_6_paf_diag : pafAB 73 bh146A bh146B 0 = ⟨146, 0⟩ := by decide
168
169theorem bh146_6_paf_offdiag_all :
170 allBelow (fun s => if s == 0 then true else pafAB 73 bh146A bh146B s == eZero) 73 = true := by
171 decide
172
173theorem bh146_6_cross_all :
174 allBelow (fun j => crossAB 73 bh146A bh146B j == eZero) 73 = true := by
175 decide
176
177theorem bh146_6_gram_row0_all :
178 allBelow (fun c =>
179 gramEntry 73 bh146A bh146B 0 c == (if c == 0 then ⟨146, 0⟩ else eZero)) 146 = true := by
180 decide
181
182theorem bh146_6_gram_row73_all :
183 allBelow (fun c =>
184 gramEntry 73 bh146A bh146B 73 c == (if c == 73 then ⟨146, 0⟩ else eZero)) 146 = true := by
185 decide
186
187theorem bh146_6_order_arith :
188 2 * 73 = 146 ∧ 146 % 4 = 2 ∧ 146 % 3 = 2 := by
189 decide
190
191-- ============================================================================
192-- 3. Broken-Model Negative Controls (>= 8 required)
193-- ============================================================================
194
195def bh110A_bad1 (i : Nat) : Nat := if i == 0 then 1 else bh110A i
196def bh110B_bad1 (i : Nat) : Nat := if i == 7 then 3 else bh110B i
197def bh146A_bad1 (i : Nat) : Nat := if i == 0 then 1 else bh146A i
198def bh146B_bad1 (i : Nat) : Nat := if i == 11 then 0 else bh146B i
199
200theorem neg_ctrl_bh110_a0_breaks_paf :
201 allBelow (fun s => if s == 0 then true else pafAB 55 bh110A_bad1 bh110B s == eZero) 55 = false := by
202 decide
203
204theorem neg_ctrl_bh110_b7_breaks_paf :
205 allBelow (fun s => if s == 0 then true else pafAB 55 bh110A bh110B_bad1 s == eZero) 55 = false := by
206 decide
207
208theorem neg_ctrl_bh110_a0_breaks_gram_row0 :
209 allBelow (fun c =>
210 gramEntry 55 bh110A_bad1 bh110B 0 c == (if c == 0 then ⟨110, 0⟩ else eZero)) 110 = false := by
211 decide
212
213theorem neg_ctrl_bh146_a0_breaks_paf :
214 allBelow (fun s => if s == 0 then true else pafAB 73 bh146A_bad1 bh146B s == eZero) 73 = false := by
215 decide
216
217theorem neg_ctrl_bh146_b11_breaks_paf :
218 allBelow (fun s => if s == 0 then true else pafAB 73 bh146A bh146B_bad1 s == eZero) 73 = false := by
219 decide
220
221theorem neg_ctrl_bh146_a0_breaks_gram_row0 :
222 allBelow (fun c =>
223 gramEntry 73 bh146A_bad1 bh146B 0 c == (if c == 0 then ⟨146, 0⟩ else eZero)) 146 = false := by
224 decide
225
226theorem neg_ctrl_bh110_not_real_hadamard : 110 % 4 ≠ 0 := by decide
227theorem neg_ctrl_bh146_not_real_hadamard : 146 % 4 ≠ 0 := by decide
228
229#print axioms bh110_6_gram_row0_all
230#print axioms bh110_6_gram_row55_all
231#print axioms bh146_6_gram_row0_all
232#print axioms bh146_6_gram_row73_all
233#print axioms neg_ctrl_bh110_a0_breaks_paf
234#print axioms neg_ctrl_bh146_a0_breaks_paf
235
236end QuantumWorldRecordsW3