# residue-locus: exact mod-11 locus for class I0:0000/0101/0110 **Status: written, not compiled.** On this machine the Lean source was written and its definitions were cross-checked numerically in Python, but Lean never ran on it. The disk this checkout shares with other workers was full: free space went between 0 and about 240 MB during the run. The 4.33.1 toolchain needs about 575 MB to elaborate even a file that only imports `Init`: `libleanshared.so` is 231 MB, and the `Init` `.olean`, `.olean.server` and `.olean.private` files are about 345 MB. Lean refused to start without the `.olean.server` and `.olean.private` files. So **no build, no `leanchecker` replay and no `#print axioms` output exist from this run.** The commands below are the ones to run. The outcomes listed are what I expect, not what I observed. ## Files changed - `MagicResearch/Residue11.lean` (new, 7272 bytes, sha256 `9c6133492fd9589d5ca0f222d609d0b7f457e8b29610679d7ba86478f2a3eb22`). It uses Lean core only: no `import` line, so only the implicit `Init`. It has no Mathlib and no dependency on other items of this wave. It does not import `MagicResearch.Center`, which is not needed. `MagicResearch.lean` is outside my paths and was not changed, so `lake build` alone does not build this module. Build it by name, as shown below. - This file. ## Public definitions (namespace `MagicResearch.Residue11`) - `F := Fin 11`, `G := F × F`. The pair `(a, b)` means `a + b i` in F₁₁[i]. - `norm x = a² + b²`. - `mul` is Gaussian multiplication. - `conj (a, b) = (a, -b)`. - `npow` gives natural powers. - `zpow` gives integer powers. A negative exponent is a power of `conj`, which is the inverse on norm one. - `J s c` is the matrix with rows p `(−1,−2,−2,−2)`, q `(−1,1,−1,1)`, r `(−1,1,1,−1)`. - `W p q r c = ∏_s g_s^(2·J s c)`, and `V p q r c = Im (W p q r c)`. - `sgn : Bool → F` sends true to 1 and false to −1. - `Rel a b x y :≡ x = a + b ∧ y = a − b`. - `EdgeRel v e0 e1 e2 e3 sw` applies the four independent signs to `v`. Then `sw = false` requires `Rel w0 w1 w2 w3`, and `sw = true` requires `Rel w0 w1 w3 w2`. - `Signed v :≡ ∃ e0 e1 e2 e3 sw : Bool, EdgeRel v e0 e1 e2 e3 sw`. These are four signs and the edge order. - `InMu4 x :≡ x = (1,0) ∨ x = (10,0) ∨ x = (0,1) ∨ x = (0,10)`. - `normOne` lists the 12 norm-one pairs. `mu4` lists the 4 points. `allTriples` holds all 12³ norm-one triples, `solutions` is its filter by `Signed ∘ V`, and `mu4Triples` holds the 4³ triples. - `decExistsBool` is a hand-written `Decidable (∃ b : Bool, P b)` instance. ## Theorems | name | statement | |---|---| | `norm_one_iff` | `norm x = 1 ↔ x ∈ normOne` for every `x : Fin 11 × Fin 11`. It classifies all 121 pairs, so every norm-one pair is covered. | | `normOne_length` | `normOne.length = 12` | | `inMu4_iff` | `InMu4 x ↔ norm x = 1 ∧ npow x 4 = (1,0)`. The four points are exactly the elements of fourth power one. | | `inMu4_iff_mem_mu4` | `InMu4 (a,b) ↔ (a,b) ∈ mu4` | | `locus_on_normOne` | the finite calculation: `∀ p q r ∈ normOne, Signed (V p q r) ↔ InMu4 p ∧ InMu4 q ∧ InMu4 r` | | **`residue_locus`** | for `p q r : G` with `norm p = norm q = norm r = 1`: `Signed (V p q r) ↔ InMu4 p ∧ InMu4 q ∧ InMu4 r` | | `residue_locus_pow` | the same statement, with the right side `p⁴ = q⁴ = r⁴ = 1` | | `solutions_eq_mu4Triples` | `solutions = mu4Triples`, an exact list equality over the 1728 norm-one triples | | `mu4Triples_length`, `solutions_length` | `= 64` | **Proof method.** Each finite fact is closed by `decide +kernel`, which reduces the `Decidable` instance in the kernel. It uses no `native_decide`, `sorry`, `admit` or `axiom`. The first step classifies the 12 norm-one pairs (`norm_one_iff`) over 121 cases. The 1728-triple check then covers each triple with 2⁵ sign and order choices. `residue_locus` is that check specialized through the classification. I read the core 4.33.1 sources, streamed from the release tarball, for the instances the proofs rely on: - `Nat.decidableForallFin` is a structural `decidable_of_iff` over `decidableBallLT`, and the source notes that kernel reduction is unaffected by its `@[csimp]` runtime replacement. - `List.decidableBAll` exists. - `instDecidableEqProd` exists. - `Fin` has `Neg`, `Sub` and `Mul` instances. - `DecideConfig.kernel` (`decide +kernel`) exists. I found no core instance for `∃ b : Bool`, so the module defines `decExistsBool`. **Expected axioms.** For every public theorem I expect a subset of `[propext]`, coming from the `rw` steps with `Iff` in `residue_locus_pow` and `solutions_length`. I have not observed this. ## Check that was run: Python cross-check of the exact definitions A Python 3 standard-library script mirrored the Lean definitions exactly: `mul`, `conj`, `npow`, `zpow`, the `J` table, `V`, `sgn`, and both edge orders over all 16 sign vectors. It printed: ``` [(0, 1), (0, 10), (1, 0), (3, 5), (3, 6), (5, 3), (5, 8), (6, 3), (6, 8), (8, 5), (8, 6), (10, 0)] 12 True # InMu4 x ↔ norm x = 1 ∧ x^4 = 1, on all 121 pairs [(0, 1), (0, 10), (1, 0), (10, 0)] # mu4, in normOne order 64 True # 64 solutions, list-equal to mu4 × mu4 × mu4 in lex order ``` This agrees with the mathematical data in `bd5dcdeacc72c44c6bc4a19d04a32b6126439c5d5c1d3714f78c8a339e01940b` (§3–4: "64 triples solvable, equal to μ4³"). I checked that artifact's sha256 and treated it as data. The Mathlib closure artifact `28eca342…7e28` was fetched and its hash checked. It was not needed, because the module is core-only. ## Preparation (needs about 2.5 GB free disk) ```sh curl -LO https://github.com/leanprover/lean4/releases/download/v4.33.1/lean-4.33.1-linux.tar.zst echo "890afd185370f85666025b883914ab4f4b339136f8c96167b69cfb62aecaf235 lean-4.33.1-linux.tar.zst" | sha256sum -c tar --zstd -xf lean-4.33.1-linux.tar.zst export PATH="$PWD/lean-4.33.1-linux/bin:$PATH" ``` I confirmed on this machine that the tarball is 570405234 bytes and matches that sha256. It could not be fully extracted for lack of disk space. ## Offline replay (from the repository root; not run here) ```sh lean --version # expect: Lean (version 4.33.1, ...) lake env lean -DwarningAsError=true MagicResearch/Residue11.lean lake build MagicResearch.Residue11 # builds .lake/build/lib/lean/MagicResearch/Residue11.olean lake env leanchecker -v MagicResearch.Residue11 # kernel replay of the new module lake env lean --stdin <<'LEAN' import MagicResearch.Residue11 open MagicResearch.Residue11 #print axioms norm_one_iff #print axioms inMu4_iff #print axioms locus_on_normOne #print axioms residue_locus #print axioms residue_locus_pow #print axioms solutions_eq_mu4Triples #print axioms solutions_length LEAN ``` **Expected outcomes, not observed:** - compiles with no warnings; - `leanchecker` reports no errors; - each `#print axioms` lists only a subset of `propext`, `Classical.choice` and `Quot.sound`. The two 1728-triple kernel checks carry `set_option maxHeartbeats 0`. ## Risks for whoever builds this first - `decide +kernel` cost: `locus_on_normOne` and `solutions_eq_mu4Triples` each evaluate up to 1728 × 32 sign and order choices with `Fin 11` arithmetic. I expect seconds to a few minutes. - If elaboration fails, the most likely places are: - instance synthesis for `Signed` through the `abbrev`s and `decExistsBool`; - the `rw` chain in `residue_locus_pow`. Neither touches the mathematical content. A failure in a `decide +kernel` line would mean the finite claim is false, which the Python mirror says it is not. ## What this gives the main problem Take a grid in class I0:0000/0101/0110 with center `p²qr`. The reduction in the data artifact, §2, sends it to `Signed (V gp gq gr)` with `g_s = π_s/π̄_s` of norm one mod 11. That reduction is not formalized here. `residue_locus` then forces every `g_s ∈ μ4`, the factorwise test ab(a²−b²) ≡ 0 mod 11. The global problem `MagicSquares.exists_magic_square_squares` remains open.