Poincaré conjecture: the Lean proof, cleaned up together
The 2026 Lean proof of the Poincaré conjecture after Morgan and Tian, 3 million lines, cleaned up together: smaller, faster to build, more readable, the theorems unchanged

| 1 | # Comparator |
| 2 | |
| 3 | The comparator checks the two public Poincare endpoint propositions against an |
| 4 | independent Mathlib-only statement module. |
| 5 | |
| 6 | `Challenge.lean` defines the endpoint types with two `sorry` placeholders for |
| 7 | the required proofs. `Solution.lean` imports the Mathlib-only |
| 8 | `PoincareConjecture.Statement` module and the subject-organized |
| 9 | `PoincareLib.Topology.Manifold.Poincare` assembly. It applies |
| 10 | `PoincareMT.smoothPoincareSkeleton` and `PoincareMT.topologicalPoincareSkeleton` |
| 11 | to prove the corresponding declarations. Keeping the public definitions in their |
| 12 | own module prevents proof-library instances from changing statement elaboration. |
| 13 | `config.json` names both |
| 14 | modules, the two theorem targets, and the permitted foundational axioms. |
| 15 | |
| 16 | Use Linux with a working user systemd service and install |
| 17 | [Landrun](https://github.com/Zouuup/landrun) and |
| 18 | [Nanoda](https://github.com/ammkrn/nanoda_lib) in `PATH`. Both are required by |
| 19 | this configuration. The Comparator and lean4export revisions are pinned in |
| 20 | the root Lake configuration. |
| 21 | |
| 22 | The external tool revisions used for verification are: |
| 23 | |
| 24 | - Landrun: `811cfff51ceaf3d9843708aa6d22e9b84ccac8b4` (0.1.18). |
| 25 | - Nanoda: `079049d584b2aed2b0172218164082f4fc6eede2` (0.4.18). |
| 26 | |
| 27 | The parallel Nanoda executable sets `cfg.num_threads = 32` after loading its |
| 28 | configuration when that value is `0`. Its checker library is unchanged. The |
| 29 | stock executable performs the same checks with its default worker count. |
| 30 | Set `COMPARATOR_NANODA` to select an alternative executable; the command |
| 31 | below defaults to `nanoda_bin` in `PATH`. |
| 32 | |
| 33 | From the repository root, build the two modules separately from each other and |
| 34 | the tools, then run as an unprivileged user. Use a disk-backed `TMPDIR` with |
| 35 | sufficient free space for the exported environments: |
| 36 | |
| 37 | ```sh |
| 38 | lake build Challenge Solution @Comparator/comparator @lean4export/lean4export |
| 39 | export TMPDIR="${TMPDIR:-$HOME/.cache/poincare-comparator}" |
| 40 | mkdir -p "$TMPDIR" |
| 41 | export PATH="$PWD/.lake/packages/Comparator/.lake/build/bin:$PWD/.lake/packages/lean4export/.lake/build/bin:$PATH" |
| 42 | export COMPARATOR_NANODA="${COMPARATOR_NANODA:-nanoda_bin}" |
| 43 | systemd-run --user --wait --pipe --collect \ |
| 44 | --property=RestrictAddressFamilies=~AF_UNIX --working-directory="$PWD" \ |
| 45 | -E PATH -E COMPARATOR_NANODA -E TMPDIR -- lake env comparator Comparator/config.json |
| 46 | ``` |
| 47 | |
| 48 | Success requires `Nanoda kernel accepts the solution`, |
| 49 | `Lean default kernel accepts the solution`, and `Your solution is okay!`. |
| 50 | The sandbox restriction follows the |
| 51 | [pinned upstream instructions](https://github.com/leanprover/comparator/tree/3927ad383f208ae977c340a91c48ac9b497d2097). |
| 52 | |
| 53 | The import PR has not run a Lean build or Comparator; verification is left to |
| 54 | the reviewer. The source repository's |
| 55 | [earlier verification report](https://github.com/frenzymath/Poincare-Conjecture/blob/432c38f2aa5a30efb13871292d17b4a3309a496a/archive/PoincareConjecture/references/ricci-flow/mapher/integration-verification/README.md) |
| 56 | records a successful run with a small Comparator execution-order patch that |
| 57 | runs Nanoda before parsing the environments, avoiding simultaneous retention of |
| 58 | both kernels' proof representations. The command above uses the pinned stock |
| 59 | driver, which may require more memory. The source's |
| 60 | [hash-checked patch and preparation script](https://github.com/frenzymath/Poincare-Conjecture/tree/432c38f2aa5a30efb13871292d17b4a3309a496a/PoincareConjecture/Comparator) |
| 61 | are available for reviewers needing that memory optimization; both kernel checks, |
| 62 | statement comparison and axiom validation remain required. |