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 | import Mathlib.Topology.Compactness.Compact |
| 2 | import Mathlib.Topology.Instances.ENNReal.Lemmas |
| 3 | |
| 4 | /-! Adapted from Mapher `PoincareMT/Proofs/M15/Mathlib/CompactBuffer.lean` at |
| 5 | `0c5d5c4e1ecbc12703b1994e226df1b15d2e8d39`. See the source mapping in |
| 6 | `references/ricci-flow/mapher/noncollapse/import.json`. -/ |
| 7 | |
| 8 | /-! |
| 9 | # Compact balls inside an embedded spatial buffer |
| 10 | |
| 11 | The initial-time buffer needed in Morgan-Tian Claim 8.5, p. 172, as |
| 12 | recorded in `references/ricci-flow/mapher/noncollapse/derivations/2026-09-20-compact-buffer.md`. |
| 13 | Only a radial distance bound and compact closure of the target ball are |
| 14 | used. No completeness or Hausdorff assumption is needed. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | |
| 19 | open Set |
| 20 | open scoped ENNReal NNReal Topology |
| 21 | |
| 22 | namespace Metric |
| 23 | |
| 24 | /-- A radial distance bound inside a compact target buffer makes the source |
| 25 | ball precompact. This is the topological step in corrected Claim 8.5, |
| 26 | Morgan-Tian p. 172. -/ |
| 27 | theorem isCompact_closure_eball_of_isEmbedding |
| 28 | {C N : Type*} [PseudoEMetricSpace C] [PseudoEMetricSpace N] |
| 29 | {f : C → N} (hf : Topology.IsEmbedding f) {x : N} {c : C} |
| 30 | {R r₀ r₁ ρ : ℝ≥0∞} {L : ℝ≥0} |
| 31 | (hrange : range f = eball x R) |
| 32 | (hcompact : IsCompact (closure (eball x R))) |
| 33 | (hc : edist x (f c) ≤ r₀) |
| 34 | (hbound : ∀ z, edist (f c) (f z) ≤ (L : ℝ≥0∞) * edist c z) |
| 35 | (hbuffer : r₀ + (L : ℝ≥0∞) * ρ ≤ r₁) (hsmall : r₁ < R) : |
| 36 | IsCompact (closure (eball c ρ)) := by |
| 37 | have hsub : closedEBall x r₁ ⊆ eball x R := |
| 38 | fun _ hz => (mem_closedEBall.mp hz).trans_lt hsmall |
| 39 | have hK : IsCompact (closedEBall x r₁) := |
| 40 | hcompact.of_isClosed_subset isClosed_closedEBall (hsub.trans subset_closure) |
| 41 | have hKr : closedEBall x r₁ ⊆ range f := by |
| 42 | rw [hrange] |
| 43 | exact hsub |
| 44 | have hpre := hf.isInducing.isCompact_preimage' hK hKr |
| 45 | apply hpre.of_isClosed_subset isClosed_closure |
| 46 | intro z hz |
| 47 | have hz' : z ∈ closedEBall c ρ := |
| 48 | (closure_minimal eball_subset_closedEBall isClosed_closedEBall) hz |
| 49 | apply mem_closedEBall'.mpr |
| 50 | calc |
| 51 | edist x (f z) ≤ edist x (f c) + edist (f c) (f z) := edist_triangle _ _ _ |
| 52 | _ ≤ r₀ + (L : ℝ≥0∞) * ρ := |
| 53 | add_le_add hc ((hbound z).trans (mul_le_mul_right (mem_closedEBall'.mp hz') _)) |
| 54 | _ ≤ r₁ := hbuffer |
| 55 | |
| 56 | end Metric |