# digit-induction: compatible abstract 11-adic lifting Implemented `MagicResearch/DigitTower.lean`; the only other delivered file is this report. Center and repository configuration are unchanged. All tools, references, tests and compiled output were confined to the disposable `test/scratch/` directory. No Lake build was invoked and no `.lake/` directory or generated C file was created. ## Contract All names below are in `MagicResearch.DigitTower`. `Point = Fin 6 → Int`, `Errors = Fin 5 → Int`, and `F : Point → Errors` is arbitrary. `Congruent m x y` means `∀ i, m ∣ x i - y i`; `Vanishes F m x` means `∀ j, m ∣ F x j`. `base` is `(1,0,1,0,1,0)`. `FirstOrder F seed` requires, for every `x,m,h` with `Congruent 11 x seed`, `11 ∣ m`, and `h 5 = 0`, the five congruences ``` 11*m ∣ F (fun i => x i + m*h i) j - (F x j + m*linear h j). linear h = (2*h0, 2*h2, 2*h4, 10*h1+2*h3, -6*h1+6*h3). ``` Thus for `h=(a,u,b,v,c,0)` its increments are exactly the five specified in the assignment. This hypothesis contains no existence-of-a-lift assumption, polynomial assumption or dependency on another wave item. `correction E` uses the following canonical integer residues modulo 11: ``` a = (-6*E0)%11; b = (-6*E1)%11; c = (-6*E2)%11; u = (2*(-6*E3+2*E4))%11; v = (2*(-6*E3-10*E4))%11; h = (a,u,b,v,c,0). ``` `correction_digits` proves the bounds `0 ≤ h i < 11` and `h 5 = 0`. `correction_cancels` proves `∀ j, 11 ∣ E j + linear h j`, for every integer error vector, including negative errors. Before residue reduction the first three sums equal `-11*Ej`, and the final two equal `-143*Ej = -13*11*Ej`. Reducing the digits modulo 11 preserves these congruences. `errors F m x j = F x j / m` is exact when `Vanishes F m x`. `lift_spec` proves, assuming `FirstOrder F seed`, `Congruent 11 x seed`, `11 ∣ m`, and `Vanishes F m x`, that the explicitly defined `lift F m x` both vanishes modulo `11*m` and is congruent to `x` modulo `m`. `modulus n = (11 : Int)^(n+2)` and the computable recursion is ``` tower F seed 0 = seed tower F seed (n+1) = lift F (modulus n) (tower F seed n). ``` `tower_spec` establishes all three properties for this same sequence: residuals vanish modulo `modulus n`, adjacent stages are congruent modulo `modulus n`, and every stage preserves the seed modulo 121. Its hypotheses are only seed vanishing modulo 121 and `FirstOrder`. The principal interface `exists_compatible_tower` additionally takes `Congruent 11 seed base` and concludes: ```lean ∃ X : Nat → Point, X 0 = seed ∧ (∀ n j, (11 : Int) ^ (n + 2) ∣ F (X n) j) ∧ (∀ n i, (11 : Int) ^ (n + 2) ∣ X (n + 1) i - X n i) ∧ (∀ n i, (121 : Int) ∣ X n i - seed i) ∧ (∀ n, Congruent 11 (X n) base) ``` Its witness is precisely `tower F seed`; the construction does not select unrelated solutions at different precisions. The theorem is a local, conditional partial result. Instantiating the polynomial residual map, proving its seed and first-order hypotheses, and addressing global rational/integer existence remain outside this item. It does not solve the magic-square-of-squares existence conjecture. ## Preparation (online) Run from the repository root on Linux x86-64 with Python 3, curl, tar and Zstandard: ```bash mkdir -p test/scratch curl -fL --retry 3 https://github.com/leanprover/lean4/releases/download/v4.33.1/lean-4.33.1-linux.tar.zst -o test/scratch/lean.tar.zst printf '%s %s\n' 890afd185370f85666025b883914ab4f4b339136f8c96167b69cfb62aecaf235 test/scratch/lean.tar.zst | sha256sum -c - test "$(wc -c < test/scratch/lean.tar.zst)" -eq 570405234 tar --zstd -xf test/scratch/lean.tar.zst -C test/scratch ``` The downloaded release digest matched. The executable reports Lean 4.33.1, commit `819816b2e0a3bf405af45ae5c7af2491d8f5bee6`, Release. The sole source import is the existing `MagicResearch.Center`, which imports `Init.Omega`; Mathlib is unnecessary. Consequently there are no new dependency pins, repository clones, submodules, package installation or Mathlib cache downloads. The two individually retrieved research references were hash-checked with `sha256sum`, each matching its artifact ID: - [Local paper proof](https://api.imd.fun/artifacts/5131581d655d8cf5c09bb071513e21e68c3ea72245b00b122df53bafb198adbe): 8,612 bytes. - [Pinned dependency/import-closure reference](https://api.imd.fun/artifacts/28eca342e4d3a8a3880f6e8767e93703f2eedb21c99508d495083e3b97d37e28): 19,379 bytes. Inspected for the pinned Lean/Mathlib environment and independent replay procedure; no Mathlib modules were needed. The reference downloads can be reproduced with `curl -fL URL -o test/scratch/NAME` for each link, followed by `sha256sum test/scratch/NAME`. ## Independent consumer test Save this as `test/scratch/Consumer.lean`. It proves the first-order rule for a nonconstant affine map with all five initial errors equal to 1. It then applies the public theorem and checks all six coordinates of the first step. These examples use kernel-checked `decide`. ```lean import MagicResearch.DigitTower open MagicResearch.DigitTower namespace DigitTowerConsumer -- An affine residual map with nonzero initial errors, independent of the -- unknown magic-square polynomials. All five initial errors are exactly 1. def residual (x : Point) : Errors := fun j => linear (fun i => x i - base i) j + 121 private theorem index_cases (j : Fin 5) : j = 0 ∨ j = 1 ∨ j = 2 ∨ j = 3 ∨ j = 4 := by have bound := j.isLt omega theorem initial : Vanishes residual 121 base := by intro j rcases index_cases j with rfl | rfl | rfl | rfl | rfl all_goals change (121 : Int) ∣ 121 all_goals exact Int.dvd_refl 121 theorem rule : FirstOrder residual base := by intro x m h _ _ _ j have exact_rule : residual (shift x m h) j = residual x j + m * linear h j := by rcases index_cases j with rfl | rfl | rfl | rfl | rfl · change 2 * (x 0 + m * h 0 - base 0) + 121 = (2 * (x 0 - base 0) + 121) + m * (2 * h 0) simp only [Int.mul_sub, Int.mul_add, Int.mul_left_comm] omega · change 2 * (x 2 + m * h 2 - base 2) + 121 = (2 * (x 2 - base 2) + 121) + m * (2 * h 2) simp only [Int.mul_sub, Int.mul_add, Int.mul_left_comm] omega · change 2 * (x 4 + m * h 4 - base 4) + 121 = (2 * (x 4 - base 4) + 121) + m * (2 * h 4) simp only [Int.mul_sub, Int.mul_add, Int.mul_left_comm] omega · change (10 * (x 1 + m * h 1 - base 1) + 2 * (x 3 + m * h 3 - base 3)) + 121 = (10 * (x 1 - base 1) + 2 * (x 3 - base 3) + 121) + m * (10 * h 1 + 2 * h 3) simp only [Int.mul_sub, Int.mul_add, Int.mul_left_comm] omega · change (-6 * (x 1 + m * h 1 - base 1) + 6 * (x 3 + m * h 3 - base 3)) + 121 = (-6 * (x 1 - base 1) + 6 * (x 3 - base 3) + 121) + m * (-6 * h 1 + 6 * h 3) simp only [Int.mul_sub, Int.mul_add, Int.mul_left_comm] omega rw [exact_rule, Int.sub_self] exact Int.dvd_zero _ -- No Mathlib import and no module belonging to another wave item is used. example : ∃ X : Nat → Point, X 0 = base ∧ (∀ n j, (11 : Int) ^ (n + 2) ∣ residual (X n) j) ∧ (∀ n i, (11 : Int) ^ (n + 2) ∣ X (n + 1) i - X n i) ∧ (∀ n i, (121 : Int) ∣ X n i - base i) ∧ (∀ n, Congruent 11 (X n) base) := by exact exists_compatible_tower (fun i => by omega) initial rule -- The first lift actually moves, including the two coupled imaginary digits. example : tower residual base 1 0 = 606 := by decide example : tower residual base 1 1 = 363 := by decide example : tower residual base 1 2 = 606 := by decide example : tower residual base 1 3 = 121 := by decide example : tower residual base 1 4 = 606 := by decide example : tower residual base 1 5 = 0 := by decide #print axioms initial #print axioms rule end DigitTowerConsumer ``` ## Offline compile and kernel replay Save the following as `test/scratch/offline.sh`. It writes every compiled artifact under scratch, never under `.lake/`: ```bash #!/usr/bin/env bash set -euo pipefail export PATH="$PWD/test/scratch/lean-4.33.1-linux/bin:$PATH" export LEAN_PATH="$PWD/test/scratch/build" mkdir -p test/scratch/build/MagicResearch lean --version lean -DwarningAsError=true -o test/scratch/build/MagicResearch/Center.olean MagicResearch/Center.lean lean -DwarningAsError=true -o test/scratch/build/MagicResearch/DigitTower.olean MagicResearch/DigitTower.lean lean -DwarningAsError=true -o test/scratch/build/Consumer.olean test/scratch/Consumer.lean leanchecker --verbose MagicResearch.Center MagicResearch.DigitTower Consumer leanchecker --verbose --fresh MagicResearch.DigitTower ``` `bash test/scratch/offline.sh` is the reproducible verification command once preparation and the consumer file are present. For an enforced offline run, save the following as `test/scratch/no-network.py` and run `python3 test/scratch/no-network.py bash test/scratch/offline.sh`. It requires Linux `libseccomp.so.2`; all descendants inherit the socket-denial filter. ```python import ctypes import os import socket import sys sec = ctypes.CDLL('libseccomp.so.2', use_errno=True) sec.seccomp_init.argtypes = [ctypes.c_uint32] sec.seccomp_init.restype = ctypes.c_void_p sec.seccomp_syscall_resolve_name.argtypes = [ctypes.c_char_p] sec.seccomp_syscall_resolve_name.restype = ctypes.c_int sec.seccomp_rule_add.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_int, ctypes.c_uint] sec.seccomp_load.argtypes = [ctypes.c_void_p] sec.seccomp_release.argtypes = [ctypes.c_void_p] ctx = sec.seccomp_init(0x7fff0000) assert ctx for name in (b'socket', b'socketpair', b'connect', b'sendto', b'sendmsg', b'sendmmsg'): syscall = sec.seccomp_syscall_resolve_name(name) assert syscall >= 0 assert sec.seccomp_rule_add(ctx, 0x00050001, syscall, 0) == 0 assert sec.seccomp_load(ctx) == 0 sec.seccomp_release(ctx) try: socket.socket(socket.AF_INET, socket.SOCK_STREAM) except PermissionError: print('Network socket probe: EPERM (seccomp active)', flush=True) else: raise RuntimeError('Socket creation unexpectedly succeeded') os.execvp(sys.argv[1], sys.argv[1:]) ``` ## Outcomes and audit `python3 test/scratch/no-network.py bash test/scratch/offline.sh` exited **0**. The socket probe returned EPERM. All three modules compiled with `-DwarningAsError=true`, all consumer examples passed, ordinary LeanChecker replay passed for Center, DigitTower and Consumer, and `leanchecker --verbose --fresh MagicResearch.DigitTower` also passed. The latter replays the target and all imported declarations into a fresh environment. This uses Lean's kernel in a separate process, not a separate proof-assistant implementation. The final log ended: ```text replaying Consumer replaying MagicResearch.DigitTower replaying MagicResearch.Center replaying MagicResearch.DigitTower with --fresh ``` Every public theorem has a `#print axioms` command in the delivered module. The complete resulting axiom sets (names abbreviated by the common namespace) are: | Results | Exact axiom set | | --- | --- | | `correction_digits`, `lift_spec`, `tower_spec`, `exists_compatible_tower` | `propext, Classical.choice, Quot.sound` | | `correction_cancels`, `shift_congruent`, `congruent_trans`, `seed_modulus_dvd`, `eleven_dvd_modulus` | `propext, Quot.sound` | | `congruent_of_dvd`, `modulus_succ` | `propext` | | Definitions `correction`, `lift`, `tower` (also printed) | `propext` | Thus all public results use only the permitted foundations. The deterministic tower definition itself needs no choice. Both independent consumer lemmas printed exactly `propext, Quot.sound`. There are no proof placeholders, added axioms, `native_decide` calls or unauthorized axiom dependencies in the deliverable. The source digest of unchanged `MagicResearch/Center.lean` is `31c94e62c570660dcd4c466e3f18eb42ebf1541af228fe48831d5bac44c79428`. The delivered `MagicResearch/DigitTower.lean` is 8,919 bytes with SHA-256 `90220988a0001ff37d853033a9dd1997e54ef9980eea988f91d4ba613104f356`. Initial diagnostic failures were repaired before the final checks: web-tool access to both artifact links failed, so curl retrieved the individual files; the optional `file` utility was unavailable; an initial `leanchecker --help` lacked `lean` on PATH, repaired by prepending the release bin directory. Initial source compilation failed at `MagicResearch/DigitTower.lean:81` because finite numeral matches were not reduced before omega, repaired by explicit `change` statements in each of the five cases; its base case at then-line 172 needed explicit subtraction simplification. Scratch probes also reported nonexistent helper names (`Reduce.lean:3,6`), so those names were not used. The first consumer draft failed at `Consumer.lean:29` for the same finite-index reduction issue, plus unused simp arguments at lines 27–28; explicit coordinate equations repaired it. These were development failures, not accepted proof claims. No final failed declaration or extra axiom remains. Final repository checks: `git diff --check`; `test ! -e .lake`; and a word-boundary source search for forbidden proof placeholders/custom-axiom declarations/`native_decide`. All passed. Source and this named report are left untracked, as requested; no Git index changes were made.