# class-columns: class I0:0000/0101/0110 reduced mod 11 (Lean 4.33.1, core only) ## What changed - **Added `MagicResearch/IntegralColumns.lean`** (new module, 19170 bytes, sha256 `b950afb2e54e94619a800d2c89de8c54c5bd8d2416c6fb4b51a4058f9ba9d1f0`). Its only import is `MagicResearch.Center`, the merged trunk module, which itself imports only `Init.Omega`. It does not use Mathlib or any other dependency, so it compiles independently of the other items in this wave. - No other repository file changed. `MagicResearch.lean` is outside my paths, so the root file does not import the new module. Build it as `MagicResearch.IntegralColumns`. - All building took place in a copy under `$TMPDIR`. No `.lake/` build output was written in the checkout. The previous attempt was rejected for `.lake/build/ir/MagicResearch/Center.c`, and that fault is not repeated here. ## Precise contract (namespace `MagicResearch.IntegralColumns`) Data types: - `GInt`: a Gaussian integer, given as a pair of `Int`s, with `mul`, `conj`, `norm`, `pow` and `unit : Fin 4 → GInt` (the units 1, i, −1, −i). - `G11 := Fin 11 × Fin 11`: the field ℤ[i]/11 = F₁₂₁, with `mul`, `conj`, `norm`, `inv x = N(x)⁹·conj x` and `zpow` (powers with an `Int` exponent). - `toF : Int → Fin 11`: the core `Lean.Grind` ring cast. - `red : GInt → G11`: reduction mod 11. The lemmas `red_mul`, `red_conj`, `red_pow` and `red_norm` show it respects the operations. Class data: - `kexp = (2,1,1)`. - `J` has rows (−1,−2,−2,−2), (−1,1,−1,1), (−1,1,1,−1), for p, q, r. Its columns are corner₀, corner₁, edge₂, edge₃. - `ePlus = k+J` and `eMinus = k−J`; `exponents_spec` (by `decide`) shows both are exact. - `column π c = ∏_s π_s^(k_s+J_sc)·conj(π_s)^(k_s−J_sc)`. - `gq π s = red π_s / conj(red π_s)`. - `W π c = ∏_s g_s^(2J_sc)` and `V π c = (W π c).2`, which is Im W_c, in `Fin 11`. **Membership** `InClassI0 m π` is defined solely by integer witnesses. It asks for: - the corner order `cs` and the edge order `es` (both `Bool`); - integers `A B : Fin 4 → Int` and units `u : Fin 4 → Fin 4`. For every column `c`, the pair placed in that column by `slot cs es c` must satisfy two conditions: - `{A c², B c²}` is that opposite pair, in either orientation. The pairs are, in reference order, (m22,m00), (m20,m02), (m01,m21), (m10,m12). Swapping the orientation is the same as conjugating the column. - `A c + B c = 2·Re(u_c·column π c)` and `A c − B c = 2·Im(u_c·column π c)`. That is, `(A+B)+(A−B)i = 2u∏π_s^(k+J)π̄_s^(k−J)`. Conjugating a row π_s is covered because the theorem holds for every `π` with the given norms. Main theorem: ```lean theorem class_columns_mod11 {m : Fin 3 → Fin 3 → Nat} {t : Nat} (h : HasMagicSum m t) (π : Fin 3 → GInt) (p q r e : Int) (he : e = p ^ 2 * q * r) (_hC : (m 1 1 : Int) = e ^ 2) (h11 : ¬ (11 : Int) ∣ e) (hp : GInt.norm (π 0) = p) (hq : GInt.norm (π 1) = q) (hr : GInt.norm (π 2) = r) (hcls : InClassI0 m π) : ∃ ε : Fin 4 → Bool, (sgnF (ε 2) (V π 2) = sgnF (ε 0) (V π 0) + sgnF (ε 1) (V π 1) ∧ sgnF (ε 3) (V π 3) = sgnF (ε 0) (V π 0) - sgnF (ε 1) (V π 1)) ∨ (sgnF (ε 3) (V π 3) = sgnF (ε 0) (V π 0) + sgnF (ε 1) (V π 1) ∧ sgnF (ε 2) (V π 2) = sgnF (ε 0) (V π 0) - sgnF (ε 1) (V π 1)) ``` Here `sgnF b x` is `−x` when `b` is true and `x` otherwise, so `v_c = sgnF (ε c) (V c) = ±V_c`. The two disjuncts are the two edge orders. Intermediate public results: - `offsets_from_lines`: over ℤ, with C = m11, α = C − m00 and β = C − m02, the lines give m01−C = α+β, m10−C = α−β, m12−C = β−α, m22−C = α, m20−C = β and m21−C = −(α+β). **Correction to the brief:** the brief says m12 − C = α − β. That is false: with the Lo Shu square 2 7 6 / 9 5 1 / 4 3 8, m12 − C = −4 while α − β = 4. The correct identities are m10 − C = α − β and m12 − C = −(α − β). The sign is absorbed by the ± in the conclusion, so the theorem the brief asks for is unaffected. - `offset_eq_im_sq`: if A² = C + D, B² = C − D and (A+B)+(A−B)i = 2uQ, then D = ±Im(Q²). It covers all four units, since u² = ±1. - `factor_sq_mod11` (by `decide`, kernel-checked, no `native_decide`): for every (a,b) ∈ F₁₂₁ with N ≠ 0 and every entry (s,c), (x^(k+J)·x̄^(k−J))² = N(x)^(2k)·(x/x̄)^(2J). - `red_column_sq`: red(column π c)² = e²·W_c in F₁₂₁. This uses 11 ∤ e, which gives 11 ∤ p, q, r. - `column_offset_mod11`: for each column, toF(pairHi − C) = e²·(±V_c), with either orientation of the pair. - `cancel_relations`: cancels e² ≠ 0 in `Fin 11`. `flip_relation` absorbs the sign change caused by a corner swap. How the proof handles each choice: - **Units**: u² = ±1, which becomes the sign σ_c. - **Column conjugation**: the A/B orientation flips D → −D, which also goes into σ_c. - **Corner swap**: v₀ − v₁ becomes v₁ − v₀. The proof absorbs this by negating ε₃ (or ε₂ when the edges are also swapped). - **Edge swap**: selects the second disjunct. Four cases (cs, es) are handled explicitly. The hypothesis `_hC` (center = e²) is kept because the brief states it. The proof does not need it: D_c = A² − C, and the factorization forces C = N(w_c) = e². **How `Grid.hasMagicSum` supplies the premise.** The Mathlib bridge `Grid.hasMagicSum : Grid m t → HasMagicSum m t` comes from the earlier GridBridge work and is not in this trunk. It specializes the upstream row and column hypotheses `∀ i, ∑ j, m i j = t` and `∀ j, ∑ i, m i j = t` at 0, 1, 2. It expands each sum with `Fin.sum_univ_three` and passes the two diagonals through unchanged. So for a witness `h : Grid m t` of `MagicSquares.exists_magic_square_squares`, the term `class_columns_mod11 h.hasMagicSum π p q r e …` applies directly. This module does not import Mathlib, so I state this composition here but did not compile it. ## Preparation (online, once) The Lean archive was hash-checked before extraction. This machine had no `zstd` and no python, so I used Node's built-in zstd. ```sh curl -sL -o lean.tar.zst https://github.com/leanprover/lean4/releases/download/v4.33.1/lean-4.33.1-linux.tar.zst stat -c %s lean.tar.zst # 570405234 sha256sum lean.tar.zst # 890afd185370f85666025b883914ab4f4b339136f8c96167b69cfb62aecaf235 node -e "const z=require('zlib'),fs=require('fs');fs.createReadStream('lean.tar.zst').pipe(z.createZstdDecompress()).pipe(fs.createWriteStream('lean.tar'))" tar -xf lean.tar # or: tar --zstd -xf lean.tar.zst export PATH=$PWD/lean-4.33.1-linux/bin:$PATH ``` ## Offline replay (from a copy of the project root) The package list is empty, so no network access is needed. ```sh lean --version # Lean (version 4.33.1, ..., commit 819816b2e0a3bf405af45ae5c7af2491d8f5bee6, Release) lake env lean -DwarningAsError=true MagicResearch/IntegralColumns.lean # (after: lake build MagicResearch.Center) lake build --wfail MagicResearch.IntegralColumns lake env leanchecker -v MagicResearch.IntegralColumns lake env lean --stdin <<'LEAN' import MagicResearch.IntegralColumns open MagicResearch.IntegralColumns #print axioms class_columns_mod11 #print axioms column_offset_mod11 #print axioms offsets_from_lines #print axioms offset_eq_im_sq #print axioms red_column_sq #print axioms factor_sq_mod11 #print axioms exponents_spec #print axioms cancel_relations LEAN ``` ## Outcomes (all run on this machine) | command | outcome | |---|---| | `lake env lean -DwarningAsError=true MagicResearch/IntegralColumns.lean` | no output, exit 0 (≈11 s) | | `lake build --wfail MagicResearch.IntegralColumns` | `✔ [3/3] Built MagicResearch.IntegralColumns (10s)`, `Build completed successfully`, exit 0 | | `lake env leanchecker -v MagicResearch.IntegralColumns` | `replaying MagicResearch.IntegralColumns`, exit 0 | | `#print axioms class_columns_mod11`, `column_offset_mod11`, `offsets_from_lines`, `offset_eq_im_sq`, `red_column_sq`, `cancel_relations` | `[propext, Classical.choice, Quot.sound]` | | `#print axioms factor_sq_mod11` | `[propext]` | | `#print axioms exponents_spec` | does not depend on any axioms | | `grep -nE "sorry|admit|native_decide|^axiom"` | only the docstring line saying `native_decide` is not used | Before the final version compiled, two errors appeared and were fixed: an unreduced `kexp`/`fpow` in `red_column_sq`, and an unreduced `slot` match in the main theorem. The fix for the second was the `rfl` table `pairHi_slot`. A scratch smoke test (`#eval`, not part of the module and not a proof) used π = (1+2i, 5+6i, 10+i), with norms 5, 61 and 101. It gives V = (8,3,3,3) in `Fin 11`. These values fit no signed relation, so by `class_columns_mod11` no grid with center (5²·61·101)² lies in this class with these π. That agrees with the data artifact's exact computation. ## What is left - The μ4³ characterization is not formalized here: that the signed system forces g_s⁴ = 1, i.e. a_s b_s(a_s² − b_s²) ≡ 0 mod 11. It would follow from `class_columns_mod11` together with a finite F₁₂₁ enumeration of 1728 triples × 16 signs × 2 orders. - The Mathlib composition with `Grid.hasMagicSum` is stated above but was not compiled, because this module stays core-only. - The global problem remains open. This is one class-wise piece of the partial result.