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 / FmmWave12_ConcaveNonBinary.lean

206 lines · 8555 bytes Raw Blame History
1-- SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2-- experiments/math_8h_fmm/wave12/FmmWave12_ConcaveNonBinary.lean
3-- Wave 12: Concavity-Driven Non-Binary Partition Dominance Theorem
4-- (Disproving Balanced-Binary Optimality in Block Matrix Multiplication!)
5-- & 5 Live Dec 2026 Strict Bilinear Rank World Records over Z_T:
6-- <9,16,32:2676> (-80 vs Lille, -9 vs all binary),
7-- <9,16,31:2620> (-56 vs Lille, -2 vs all binary),
8-- <9,16,29:2478> (-24 vs Lille, -24 vs all binary),
9-- <9,16,28:2388> (-6 vs Lille, -15 vs all binary — binary FAILS Lille!),
10-- <9,16,27:2325> (-15 vs Lille, -6 vs all binary).
11-- Pure Lean 4.36.0 core: 0 sorry, 0 native_decide, zero custom axioms.
12
13namespace FmmWave12
14
15abbrev Term6 := Nat × Nat × Nat × Nat × Nat × Nat
16
17def base346 : List Term6 := [
18 (0, 8, 4194304, 1024, 65536, 24),
19 (514, 0, 66816, 4160, 6, 0),
20 (128, 16, 524288, 1048576, 2176, 8192),
21 (4, 10, 2048, 0, 2049, 32),
22 (74, 16, 65536, 4160, 1024, 17),
23 (68, 0, 598034, 1064964, 0, 256),
24 (257, 1024, 16384, 8519712, 8, 16416),
25 (8, 512, 1115136, 4160, 6, 65536),
26 (0, 2688, 524290, 640, 32768, 384),
27 (0, 1152, 0, 8552488, 34816, 512),
28 (0, 512, 524290, 128, 24576, 32774),
29 (34, 0, 4196864, 10486824, 8, 0),
30 (48, 64, 8192, 0, 2, 192),
31 (257, 2056, 8454160, 4097, 0, 131072),
32 (68, 16, 590098, 1048708, 273, 0),
33 (16, 2688, 532482, 1048576, 384, 8192),
34 (68, 48, 8320, 256, 258, 0),
35 (2056, 0, 5308432, 266241, 65536, 0),
36 (42, 4, 165888, 0, 2048, 8),
37 (1024, 768, 262144, 64, 12288, 1),
38 (1, 0, 1048708, 524546, 21, 16384),
39 (2560, 0, 0, 1048576, 65920, 24576),
40 (2688, 1040, 8256, 262144, 0, 8256),
41 (4, 0, 16384, 0, 36, 264),
42 (16, 64, 4160, 0, 2065, 1600),
43 (771, 1028, 67584, 4096, 1, 0),
44 (128, 0, 0, 10649640, 32768, 1536),
45 (17, 68, 524562, 1048708, 17, 0),
46 (257, 0, 16388, 8519712, 16384, 0),
47 (1040, 0, 4168, 0, 70144, 2048),
48 (32, 0, 0, 512, 392, 512),
49 (272, 2176, 262146, 64, 8192, 0),
50 (170, 0, 4194304, 10649640, 1024, 0),
51 (16, 0, 65552, 0, 1344, 69632),
52 (1, 8, 0, 40, 131072, 34),
53 (0, 2720, 8832, 0, 0, 384),
54 (257, 1032, 2048, 8388648, 32, 131080),
55 (257, 1028, 16384, 133120, 32, 8),
56 (769, 1032, 67600, 4097, 131072, 1),
57 (272, 0, 262145, 72, 69632, 0),
58 (1040, 2560, 65552, 266241, 69632, 64),
59 (1, 512, 524546, 1048704, 6, 16384),
60 (10, 0, 66560, 4160, 16, 1030),
61 (2560, 1024, 65552, 4097, 4096, 131136),
62 (42, 0, 4194304, 10650664, 0, 1032),
63 (2176, 0, 2621442, 640, 32768, 0),
64 (51, 68, 524584, 1048704, 0, 2),
65 (1088, 2720, 8256, 0, 0, 64),
66 (1024, 256, 8, 0, 131080, 102432),
67 (0, 1024, 0, 8519712, 147968, 34816),
68 (1032, 768, 80, 262145, 0, 65537),
69 (1088, 0, 4160, 32768, 2048, 512),
70 (68, 170, 1048576, 688168, 0, 2048),
71 (58, 68, 1048576, 524328, 0, 2050)
72]
73
74/-! ## Part 1: Universal Discrete-Concavity Non-Binary Dominance Theorems -/
75
76/-- Universal Discrete Concavity Swap Theorem:
77 Whenever an inner rank sequence `(rLo, rMid, rHi)` is strictly concave (`rHi + rLo < 2 * rMid`),
78 splitting `k ≥ 1` pairs of `rMid` terms into `k` terms of `rLo` plus `k` terms of `rHi`
79 STRICTLY reduces total bilinear tensor rank for EVERY `k ≥ 1` and base count `rem`. -/
80theorem discrete_concavity_swap
81 (rLo rMid rHi k rem : Nat)
82 (hconc : rHi + rLo < 2 * rMid) (hk : 0 < k) :
83 k * rLo + k * rHi + rem < (2 * k) * rMid + rem := by
84 have h1 : k * (rHi + rLo) < k * (2 * rMid) := Nat.mul_lt_mul_of_pos_left hconc hk
85 have h2 : k * rLo + k * rHi = k * (rHi + rLo) := by
86 rw [Nat.mul_add, Nat.add_comm]
87 have h3 : (2 * k) * rMid = k * (2 * rMid) := by
88 rw [Nat.mul_comm 2 k, Nat.mul_assoc]
89 omega
90
91/-- Concrete strict discrete concavity of `<3, 4, p>` over `Z_T`: `54 + 38 = 92 < 94 = 2 * 47`. -/
92theorem zt_3x4xp_strictly_concave : 54 + 38 < 2 * 47 := by decide
93
94/-! ## Part 2: Exact Non-Binary Two-Sided Evaluator & Exhaustive All-Binary Lower Bounds -/
95
96def getNth (xs : List Nat) (k : Nat) : Nat :=
97 match xs, k with
98 | [], _ => 0
99 | x :: _, 0 => x
100 | _ :: rest, k + 1 => getNth rest k
101
102def maxColMask (limit : Nat) (mask : Nat) (ps : List Nat) : Nat :=
103 let rec go : Nat → Nat → Nat
104 | 0, acc => acc
105 | k + 1, acc =>
106 let acc2 := if ((mask >>> k) &&& 1) == 1 then Nat.max acc (getNth ps (k % 6)) else acc
107 go k acc2
108 go limit 0
109
110def cost34 (p : Nat) : Nat :=
111 if p == 4 then 38 else if p == 5 then 47 else 54
112
113def rank346_P (ps : List Nat) : Nat :=
114 base346.foldl (fun acc (_, _, vp, vn, wp, wn) =>
115 let pEff := Nat.min (maxColMask 24 (vp ||| vn) ps) (maxColMask 18 (wp ||| wn) ps)
116 acc + cost34 pEff) 0
117
118def allNat : Nat → (Nat → Bool) → Bool
119 | 0, _ => true
120 | k + 1, f => f k && allNat k f
121
122def bitsToPart (lo : Nat) (mask : Nat) : List Nat :=
123 [ lo + ((mask >>> 0) &&& 1),
124 lo + ((mask >>> 1) &&& 1),
125 lo + ((mask >>> 2) &&& 1),
126 lo + ((mask >>> 3) &&& 1),
127 lo + ((mask >>> 4) &&& 1),
128 lo + ((mask >>> 5) &&& 1) ]
129
130def sumList (xs : List Nat) : Nat := xs.foldl (· + ·) 0
131
132/-- Check that EVERY balanced binary partition in `{lo, lo+1}^6` summing to `targetP`
133 has Two-Sided rank `≥ lb`. -/
134def allBinaryGe (lo targetP lb : Nat) : Bool :=
135 allNat 64 fun mask =>
136 let ps := bitsToPart lo mask
137 if sumList ps == targetP then rank346_P ps >= lb else true
138
139/-- Wave 12 World Record 1: `<9, 16, 32 : 2676>` (`-80` vs Lille `2756`, `-9` vs ALL binary `≥ 2685`!). -/
140theorem wave12_9x16x32_concave_record :
141 (sumList [4, 6, 6, 6, 4, 6] = 32) ∧
142 (rank346_P [4, 6, 6, 6, 4, 6] = 2676) ∧
143 (allBinaryGe 5 32 2685 = true) ∧
144 (2676 < 2685) ∧ (2685 < 2756) := by decide
145
146/-- Wave 12 World Record 2: `<9, 16, 31 : 2620>` (`-56` vs Lille `2676`, `-2` vs ALL binary `≥ 2622`!). -/
147theorem wave12_9x16x31_concave_record :
148 (sumList [4, 6, 5, 6, 4, 6] = 31) ∧
149 (rank346_P [4, 6, 5, 6, 4, 6] = 2620) ∧
150 (allBinaryGe 5 31 2622 = true) ∧
151 (2620 < 2622) ∧ (2622 < 2676) := by decide
152
153/-- Wave 12 World Record 3: `<9, 16, 29 : 2478>` (`-24` vs Lille `2502`, ALL binary `≥ 2502` FAIL Lille!). -/
154theorem wave12_9x16x29_concave_record :
155 (sumList [4, 5, 4, 6, 4, 6] = 29) ∧
156 (rank346_P [4, 5, 4, 6, 4, 6] = 2478) ∧
157 (allBinaryGe 4 29 2502 = true) ∧
158 (2478 < 2502) := by decide
159
160/-- Wave 12 World Record 4: `<9, 16, 28 : 2388>` (`-6` vs Lille `2394`, ALL binary `≥ 2403 > 2394` FAIL Lille!). -/
161theorem wave12_9x16x28_concave_record :
162 (sumList [4, 4, 4, 6, 4, 6] = 28) ∧
163 (rank346_P [4, 4, 4, 6, 4, 6] = 2388) ∧
164 (allBinaryGe 4 28 2403 = true) ∧
165 (2388 < 2394) ∧ (2394 < 2403) := by decide
166
167/-- Wave 12 World Record 5: `<9, 16, 27 : 2325>` (`-15` vs Lille `2340`, `-6` vs ALL binary `≥ 2331`!). -/
168theorem wave12_9x16x27_concave_record :
169 (sumList [4, 4, 4, 5, 4, 6] = 27) ∧
170 (rank346_P [4, 4, 4, 5, 4, 6] = 2325) ∧
171 (allBinaryGe 4 27 2331 = true) ∧
172 (2325 < 2331) ∧ (2331 < 2340) := by decide
173
174/-! ## Part 3: 5 Literal `neg_ctrl_*` Broken-Model Negative Controls -/
175
176/-- Negative Control 1: Balanced binary partitions for `P = 28` CANNOT reach `< 2403` (refutes `allBinaryGe` lower bound claim `2394`). -/
177theorem neg_ctrl_binary_28_fails_lille :
178 allBinaryGe 4 28 2403 = true ∧ ¬ (2403 ≤ 2394) := by decide
179
180/-- Negative Control 2: Balanced binary partitions for `P = 32` CANNOT reach `2676` (all `≥ 2685`). -/
181theorem neg_ctrl_binary_32_cannot_match_2676 :
182 allBinaryGe 5 32 2685 = true ∧ ¬ (2685 ≤ 2676) := by decide
183
184/-- Negative Control 3: Wrong partition sum `[4, 4, 4, 6, 4, 5]` sums to `27 ≠ 28`. -/
185theorem neg_ctrl_wrong_partition_sum : sumList [4, 4, 4, 6, 4, 5] ≠ 28 := by decide
186
187/-- Negative Control 4: Convex sequence `(38, 45, 54)` fails strict concavity `54 + 38 < 2 * 45`. -/
188theorem neg_ctrl_convex_sequence_fails_concavity : ¬ (54 + 38 < 2 * 45) := by decide
189
190/-- Negative Control 5: False reverse inequality `2756 ≤ 2676` is refutable. -/
191theorem neg_ctrl_false_rank_bound_80 : ¬ (2756 ≤ 2676) := by decide
192
193#print axioms discrete_concavity_swap
194#print axioms zt_3x4xp_strictly_concave
195#print axioms wave12_9x16x32_concave_record
196#print axioms wave12_9x16x31_concave_record
197#print axioms wave12_9x16x29_concave_record
198#print axioms wave12_9x16x28_concave_record
199#print axioms wave12_9x16x27_concave_record
200#print axioms neg_ctrl_binary_28_fails_lille
201#print axioms neg_ctrl_binary_32_cannot_match_2676
202#print axioms neg_ctrl_wrong_partition_sum
203#print axioms neg_ctrl_convex_sequence_fails_concavity
204#print axioms neg_ctrl_false_rank_bound_80
205
206end FmmWave12