**Verified exact-grid bridge.** The module below compiled with Lean 4.33.1 and Mathlib `0df444a360eaa60ab8c11dca51a86af692955474`; separate LeanChecker replay of both target modules also exited 0 with sockets blocked. This is a conditional reduction of the existence problem: it establishes the center and all four opposite-pair identities for every grid satisfying the original predicate. The [Formal Conjectures toolchain][fc-toolchain] and [manifest][fc-manifest] independently confirm those pins. The [pinned statement][upstream] labels the problem `research open`. The live [Left to Solve page](https://lefttosolve.com/p/MagicSquares.exists_magic_square_squares) returned HTTP 403, so a current solved-status claim could not be verified here. The upstream existential binders are `m : Fin 3 → Fin 3 → ℕ` and `t : ℕ`; the [trunk Center module][center] uses the same grid and sum types (`Nat` and `ℕ` are identical). `Grid` retains joint injectivity, positive square entries, both quantified finite-sum conditions, and both diagonals in their original order. Text comparison after removing whitespace confirmed the entire conjunction and the literal proposition in the equivalence below. No Formal Conjectures module or admitted declaration is imported. Save this complete module as `MagicResearch/GridBridge.lean` on trunk, alongside the unchanged pinned `MagicResearch/Center.lean`: ```lean import MagicResearch.Center import Mathlib.Algebra.BigOperators.Fin import Mathlib.Algebra.Group.Even open scoped BigOperators namespace MagicResearch /-- The complete conjunction following the two upstream existential binders. -/ def Grid (m : Fin 3 → Fin 3 → ℕ) (t : ℕ) : Prop := m.Injective2 ∧ (∀ i j, 0 < (m i j) ∧ IsSquare (m i j)) ∧ (∀ i, ∑ j, m i j = t) ∧ (∀ j, ∑ i, m i j = t) ∧ m 0 0 + m 1 1 + m 2 2 = t ∧ m 0 2 + m 1 1 + m 2 0 = t theorem Grid.hasMagicSum {m : Fin 3 → Fin 3 → ℕ} {t : ℕ} (h : Grid m t) : HasMagicSum m t := by have row (i : Fin 3) : m i 0 + m i 1 + m i 2 = t := (Fin.sum_univ_three (m i)).symm.trans (h.2.2.1 i) have col (j : Fin 3) : m 0 j + m 1 j + m 2 j = t := (Fin.sum_univ_three (fun i => m i j)).symm.trans (h.2.2.2.1 j) exact ⟨row 0, row 1, row 2, col 0, col 1, col 2, h.2.2.2.2.1, h.2.2.2.2.2⟩ theorem Grid.center_and_opposite_pairs {m : Fin 3 → Fin 3 → ℕ} {t : ℕ} (h : Grid m t) : t = m 1 1 + m 1 1 + m 1 1 ∧ m 0 0 + m 2 2 = m 1 1 + m 1 1 ∧ m 0 1 + m 2 1 = m 1 1 + m 1 1 ∧ m 0 2 + m 2 0 = m 1 1 + m 1 1 ∧ m 1 0 + m 1 2 = m 1 1 + m 1 1 := MagicResearch.center_and_opposite_pairs h.hasMagicSum theorem exists_grid_iff_upstream : (∃ m : Fin 3 → Fin 3 → ℕ, ∃ t : ℕ, Grid m t) ↔ (∃ m : Fin 3 → Fin 3 → ℕ, ∃ t : ℕ, m.Injective2 ∧ (∀ i j, 0 < (m i j) ∧ IsSquare (m i j)) ∧ (∀ i, ∑ j, m i j = t) ∧ (∀ j, ∑ i, m i j = t) ∧ m 0 0 + m 1 1 + m 2 2 = t ∧ m 0 2 + m 1 1 + m 2 0 = t) := Iff.rfl #print axioms Grid.hasMagicSum #print axioms Grid.center_and_opposite_pairs #print axioms exists_grid_iff_upstream #print axioms MagicResearch.center_and_opposite_pairs end MagicResearch ``` In `Grid.hasMagicSum`, applying [Fin's three-element sum theorem][fin] to `m i` expands rows; applying it to `fun i => m i j` expands columns. The resulting six equations and the two unchanged diagonal equations construct `HasMagicSum`. The center result then follows directly from the trunk theorem, with its full five-conjunct conclusion. Positivity, squareness and injectivity remain in `Grid`, although the line-sum argument does not need them. [IsSquare's definition][even] is `∃ r, a = r * r`. The equivalence is definitional: `Iff.rfl` succeeds after unfolding `Grid`. Its right side is the literal upstream proposition, rather than a reference to the upstream existence theorem. Neither direction asserts existence. The [paired input][input] was fetched independently and matched SHA-256 `9336882d0ce395294ddffa1cf492ead489457cc9a991d9747a71dc1da4a06758`. I inspected and tested its selective recipe against the pinned [hash computation][hashing], [generation 5][cache-io], [archive naming][cache-lean], [container selection][infra] and [URL construction][requests]. The implementation hashes generation 5 and the three root-file contents, then each module's path components, normalized text and dependency hashes in parser order. The `getRootHash` docstring also mentions `Lean.githash`, but its executable code does not hash it; the recipe correctly follows the executable code. For online preparation, use a fresh Linux x86-64 directory with Python 3, curl, GNU tar and Zstandard. Save the following as `online.py` and run `python3 online.py`. It extracts only the two inspected helpers from the hash-checked input, retrieves individual transitive source/cache files and the Lean release, and checks every archive against the sorted receipt. It fetches no repository archive or submodule. Place the bridge module above in that directory before the offline step. The [Mathlib dependency manifest][manifest] supplies dependency commits; the [release metadata][release] supplies the Lean archive size and digest. ```python from pathlib import Path import hashlib, json, re, subprocess, urllib.request M = '0df444a360eaa60ab8c11dca51a86af692955474' C = 'c49c47bb49aa031ae7e92ef314e0f0d26da02559' R = '9336882d0ce395294ddffa1cf492ead489457cc9a991d9747a71dc1da4a06758' raw = 'https://raw.githubusercontent.com' base = f'{raw}/leanprover-community/mathlib4/{M}' def fetch(path, url): p = Path(path) p.parent.mkdir(parents=True, exist_ok=True) if not p.exists(): p.write_bytes(urllib.request.urlopen(url, timeout=120).read()) return p.read_bytes() report = fetch('after-fin-three.md', f'https://api.imd.fun/artifacts/{R}') assert hashlib.sha256(report).hexdigest() == R blocks = re.findall(r'```(?:lean|python)\n(.*?)\n```', report.decode(), re.S) for path, prefix, digest in [ ('Select.lean', 'import Lean.Elab.ParseImportsFast', '88d9ad947927315771994357e7db3e06913b2cff7ae865b010f006fe18d790f4'), ('download.py', 'from concurrent.futures import ThreadPoolExecutor', 'ecfe4b43acfd08c14d53aaed031c60b4b0a3b70137fd390c66cb8e322a4e4760')]: data = (next(b for b in blocks if b.startswith(prefix)) + '\n').encode() assert hashlib.sha256(data).hexdigest() == digest Path(path).write_bytes(data) data = fetch('lean.tar.zst', 'https://github.com/leanprover/lean4/releases/' 'download/v4.33.1/lean-4.33.1-linux.tar.zst') assert len(data) == 570405234 assert hashlib.sha256(data).hexdigest() == \ '890afd185370f85666025b883914ab4f4b339136f8c96167b69cfb62aecaf235' del data if not Path('lean-4.33.1-linux/bin/lean').exists(): subprocess.run(['tar', '--zstd', '-xf', 'lean.tar.zst'], check=True) for path in ('lakefile.lean', 'lean-toolchain', 'lake-manifest.json'): fetch(path, f'{base}/{path}') fetch('MagicResearch/Center.lean', f'{raw}/identity-md-launches/goal-3516-left-solve/' f'{C}/MagicResearch/Center.lean') prefix = dict(plausible='Plausible', LeanSearchClient='LeanSearchClient', importGraph='ImportGraph', proofwidgets='ProofWidgets', aesop='Aesop', Qq='Qq', batteries='Batteries', Cli='Cli') bases = [f'Mathlib={base}'] for p in json.loads(Path('lake-manifest.json').read_text())['packages']: repo = p['url'].removeprefix('https://github.com/') bases.append(f"{prefix[p['name']]}={raw}/{repo}/{p['rev']}") with Path('keys.txt').open('w') as out: subprocess.run(['lean-4.33.1-linux/bin/lean', '--run', 'Select.lean', *bases], stdout=out, check=True) subprocess.run(['python3', 'download.py'], check=True) receipt = Path('archives.tsv').read_bytes() assert len(receipt) == 149721 assert hashlib.sha256(receipt).hexdigest() == \ '0946208ddd39a20ecff44d551ef72bfff36bd5046e2386d6f21a3b93217b9cb5' rows = receipt.decode().splitlines() assert rows == sorted(rows) and len(rows) == 839 assert sum(int(r.split('\t')[2]) for r in rows) == 68585420 files = [] for row in rows: mod, url, size, digest = row.split('\t') p = Path('ltar') / url.rsplit('/', 1)[1] assert p.stat().st_size == int(size) assert hashlib.sha256(p.read_bytes()).hexdigest() == digest files.append(str(p.resolve())) Path('compiled').mkdir(exist_ok=True) subprocess.run([str(Path('lean-4.33.1-linux/bin/leantar').resolve()), '-x', '-'], input='\n'.join(files) + '\n', text=True, cwd='compiled', check=True) print('Preparation, byte checks, sorted receipt: PASS') ``` Before compiling, compare the source digests below (in particular the unchanged Center bytes). The following is the exact `offline.sh` used, run from the prepared directory. It invokes only local tools and files. ```bash #!/usr/bin/env bash set -euo pipefail export PATH="$PWD/lean-4.33.1-linux/bin:$PATH" mkdir -p replay-build/MagicResearch export LEAN_PATH="$PWD/replay-build:$PWD/compiled/.lake/build/lib/lean" for lib in "$PWD"/compiled/.lake/packages/*/.lake/build/lib/lean; do if [ -d "$lib" ]; then LEAN_PATH="$LEAN_PATH:$lib"; fi done lean --version lean -DwarningAsError=true -o replay-build/MagicResearch/Center.olean MagicResearch/Center.lean lean -DwarningAsError=true -o replay-build/MagicResearch/GridBridge.olean MagicResearch/GridBridge.lean leanchecker --verbose MagicResearch.Center MagicResearch.GridBridge ``` The exact compile and kernel replay invocation was `python3 no-network.py bash offline.sh`, using this `no-network.py`. It installs an inherited seccomp filter rejecting socket creation and network-send/connect syscalls, then confirms an IPv4 socket fails with EPERM before executing the script. Linux and `libseccomp.so.2` are required for this isolation wrapper. An ordinary offline host can run `bash offline.sh` directly. ```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) if not ctx: raise RuntimeError('seccomp_init failed') for name in (b'socket', b'socketpair', b'connect', b'sendto', b'sendmsg', b'sendmmsg'): syscall = sec.seccomp_syscall_resolve_name(name) if syscall < 0 or sec.seccomp_rule_add(ctx, 0x00050001, syscall, 0) != 0: raise RuntimeError(f'seccomp rule failed: {name!r}') if sec.seccomp_load(ctx) != 0: raise RuntimeError(f'seccomp_load failed: errno {ctypes.get_errno()}') 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('Network socket probe unexpectedly succeeded') os.execvp(sys.argv[1], sys.argv[1:]) ``` Both Lean compilations used `-DwarningAsError=true`; compilation and replay exited 0. The actual output, including every requested `#print axioms`, was: ```text Network socket probe: EPERM (seccomp active) Lean (version 4.33.1, x86_64-unknown-linux-gnu, commit 819816b2e0a3bf405af45ae5c7af2491d8f5bee6, Release) 'MagicResearch.Grid.hasMagicSum' depends on axioms: [propext, Classical.choice, Quot.sound] 'MagicResearch.Grid.center_and_opposite_pairs' depends on axioms: [propext, Classical.choice, Quot.sound] 'MagicResearch.exists_grid_iff_upstream' depends on axioms: [propext, Classical.choice, Quot.sound] 'MagicResearch.center_and_opposite_pairs' depends on axioms: [propext, Quot.sound] replaying MagicResearch.GridBridge replaying MagicResearch.Center ``` Thus each new theorem depends only on `propext`, `Classical.choice`, and `Quot.sound`; the trunk theorem uses `propext` and `Quot.sound`. No placeholder proof, custom axiom or `native_decide` occurs in the new module. [LeanChecker][checker] replays declarations introduced by the two target modules over their imported environment, using Lean's kernel in a separate process. Independent byte checks reproduced all 839 cache entries, all in `mathlib4-master`, totaling 68,585,420 compressed bytes. Every downloaded length and SHA-256 was checked. `archives.tsv` is UTF-8 with LF endings and a final LF, sorted lexicographically by module; each line is `moduleURLbytessha256`. It has 149,721 bytes and SHA-256 `0946208ddd39a20ecff44d551ef72bfff36bd5046e2386d6f21a3b93217b9cb5`, exactly matching the [input receipt claim][input]. Run each metadata check separately: ```bash lean-4.33.1-linux/bin/leantar -k ltar/4b8300f42d59918f.ltar lean-4.33.1-linux/bin/leantar -k ltar/6580d0fc4cc5f2e6.ltar ``` Both printed `git=mathlib4@0df444a360eaa60ab8c11dca51a86af692955474`. The two direct-import rows of the sorted receipt are: ```text Mathlib.Algebra.BigOperators.Fin https://lakecache.blob.core.windows.net/mathlib4-master/f/4b8300f42d59918f.ltar 127735 fb914f38246be1e6041e8ab9f84662c583f7f4069a0c5b0141657d63e531a3d2 Mathlib.Algebra.Group.Even https://lakecache.blob.core.windows.net/mathlib4-master/f/6580d0fc4cc5f2e6.ltar 24878 dc25f312b2075e9f0745534e1da0c99b743dfda9b549a213de4967df7778c932 ``` The archive digests cover all packed artifacts, not just the principal `.olean`. These are the independently measured principal imported `.olean` bytes after extraction: | Artifact | Bytes | SHA-256 | | --- | ---: | --- | | [Mathlib/Algebra/BigOperators/Fin.olean][fin-archive] | 426288 | `b154c4875df6ff8d8c146e4424195b2c80b4c065ba31bc2ce28122ad039aecaa` | | [Mathlib/Algebra/Group/Even.olean][even-archive] | 122832 | `8eb983d9d7c41b5a623b1212784fc991ec99b75ae973bb2260c77da1dc075fdd` | Source digests below are SHA-256 over original downloaded UTF-8 bytes, including final newlines. The new module digest is over the fenced Lean block saved with exactly one final newline. | Source | Bytes | SHA-256 | | --- | ---: | --- | | [MagicResearch/Center.lean][center] | 1393 | `31c94e62c570660dcd4c466e3f18eb42ebf1541af228fe48831d5bac44c79428` | | [MagicSquares.lean][upstream] | 2568 | `615bd6c0479f6541f147269ead158bdebc63b75be45a24c0000d0e9e81464f14` | | [fc-lean-toolchain][fc-toolchain] | 25 | `3aac669c7a910ec2389f4e4f921b605adf6ebf2d1e0c9b9cd0be4d33f3f5db71` | | [fc-lake-manifest.json][fc-manifest] | 3152 | `c8ffc0d59f492007162fe54c68396e4b9f2f305fcf69210a7fbaf0b18fcd8cd9` | | [lakefile.lean][lakefile] | 7130 | `9618b4491ba2a0ce2edde2cd29a6ff12974ccec5b331773ad0ae679cbebbc857` | | [lean-toolchain][toolchain] | 25 | `3aac669c7a910ec2389f4e4f921b605adf6ebf2d1e0c9b9cd0be4d33f3f5db71` | | [lake-manifest.json][manifest] | 2811 | `1009a101f52a9d5d8ca57666f0256bae91abdb693e0f27b5a4622cffcc38cf03` | | [Mathlib/Algebra/BigOperators/Fin.lean][fin] | 31770 | `4fe78cba9cdeac4eb8badbdd6359b055031900906fb94f3e51aba6d81451dbd5` | | [Mathlib/Algebra/Group/Even.lean][even] | 6473 | `1180fa9ac282e55257e95c8402acd7314fcbd0a18bcfdede92a3cde16e1db630` | | `MagicResearch/GridBridge.lean` (new) | 1821 | `a8ec4c634f7fb9872f363d29a8c3a436439360fa173e7c6f25d1abf5c35721c5` | For an additional source-closure check, the following reproduces `sources.tsv`: 839 entries, 81,807 bytes, SHA-256 `42463b79a7c633ca21a21893e99d038cfcc03333b7ea7b44b8466d5b0144fe75`. Unlike the archive receipt, this is a new measurement from this run. ```python from pathlib import Path import hashlib rows = [] for line in sorted(Path('keys.txt').read_text().splitlines()): module, key = line.split() p = Path(*module.split('.')).with_suffix('.lean') data = p.read_bytes() rows.append(f'{module}\t{len(data)}\t{hashlib.sha256(data).hexdigest()}') Path('sources.tsv').write_bytes(('\n'.join(rows) + '\n').encode()) assert hashlib.sha256(Path('sources.tsv').read_bytes()).hexdigest() == \ '42463b79a7c633ca21a21893e99d038cfcc03333b7ea7b44b8466d5b0144fe75' ``` Failed preliminary stages and repairs: the live site returned HTTP 403; `unshare -Urn true` failed with `Operation not permitted`, so the successful offline run used the tested seccomp wrapper. The initial standalone checker invocation could not execute `lean` (PATH omitted the release bin); setting PATH as in `offline.sh` repaired it. A pin-audit assertion initially expected two final newlines instead of one, and one preparation invocation used a duplicated relative directory; correcting those harness errors passed. There was no Lean proof error, missing cache entry, mathematical discrepancy, or mismatch with the paired report's pins, archive bytes or sorted receipt. All 17 exact source quotations were fetched again and confirmed before delivery. [input]: https://api.imd.fun/artifacts/9336882d0ce395294ddffa1cf492ead489457cc9a991d9747a71dc1da4a06758 [center]: https://raw.githubusercontent.com/identity-md-launches/goal-3516-left-solve/c49c47bb49aa031ae7e92ef314e0f0d26da02559/MagicResearch/Center.lean [upstream]: https://raw.githubusercontent.com/google-deepmind/formal-conjectures/9097e2f90e66d2f6244209cb1c07f7120d17ec53/FormalConjectures/Wikipedia/MagicSquares.lean [fc-toolchain]: https://raw.githubusercontent.com/google-deepmind/formal-conjectures/9097e2f90e66d2f6244209cb1c07f7120d17ec53/lean-toolchain [fc-manifest]: https://raw.githubusercontent.com/google-deepmind/formal-conjectures/9097e2f90e66d2f6244209cb1c07f7120d17ec53/lake-manifest.json [fin]: https://raw.githubusercontent.com/leanprover-community/mathlib4/0df444a360eaa60ab8c11dca51a86af692955474/Mathlib/Algebra/BigOperators/Fin.lean [even]: https://raw.githubusercontent.com/leanprover-community/mathlib4/0df444a360eaa60ab8c11dca51a86af692955474/Mathlib/Algebra/Group/Even.lean [lakefile]: https://raw.githubusercontent.com/leanprover-community/mathlib4/0df444a360eaa60ab8c11dca51a86af692955474/lakefile.lean [toolchain]: https://raw.githubusercontent.com/leanprover-community/mathlib4/0df444a360eaa60ab8c11dca51a86af692955474/lean-toolchain [manifest]: https://raw.githubusercontent.com/leanprover-community/mathlib4/0df444a360eaa60ab8c11dca51a86af692955474/lake-manifest.json [hashing]: https://raw.githubusercontent.com/leanprover-community/mathlib4/0df444a360eaa60ab8c11dca51a86af692955474/Cache/Hashing.lean [cache-io]: https://raw.githubusercontent.com/leanprover-community/mathlib4/0df444a360eaa60ab8c11dca51a86af692955474/Cache/IO.lean [cache-lean]: https://raw.githubusercontent.com/leanprover-community/mathlib4/0df444a360eaa60ab8c11dca51a86af692955474/Cache/Lean.lean [infra]: https://raw.githubusercontent.com/leanprover-community/mathlib4/0df444a360eaa60ab8c11dca51a86af692955474/Cache/Infra.lean [requests]: https://raw.githubusercontent.com/leanprover-community/mathlib4/0df444a360eaa60ab8c11dca51a86af692955474/Cache/Requests.lean [release]: https://api.github.com/repos/leanprover/lean4/releases/tags/v4.33.1 [checker]: https://raw.githubusercontent.com/leanprover/lean4/819816b2e0a3bf405af45ae5c7af2491d8f5bee6/src/LeanChecker.lean [fin-archive]: https://lakecache.blob.core.windows.net/mathlib4-master/f/4b8300f42d59918f.ltar [even-archive]: https://lakecache.blob.core.windows.net/mathlib4-master/f/6580d0fc4cc5f2e6.ltar