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 PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Persistence.SourceNames.Metric |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Persistence.Analysis.Compactness.CompactSmoothConvergence |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.Metric.Comparison.Jets.ComparisonCovariantJets |
| 4 | |
| 5 | /-! |
| 6 | # Intrinsic squared errors from compact coefficient convergence |
| 7 | |
| 8 | The published M36 coordinate-to-covariant estimate turns convergence |
| 9 | of finitely many ordinary coefficient jets into a single strict bound |
| 10 | for the intrinsic squared error. Morgan--Tian, Corollary 16.7, p. 372; |
| 11 | see derivation 23. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set Filter |
| 18 | open scoped Manifold ContDiff Topology |
| 19 | |
| 20 | namespace PoincareMT.M44 |
| 21 | |
| 22 | local notation "E" => EuclideanSpace ℝ (Fin 3) |
| 23 | local notation "Bilin" => E →L[ℝ] E →L[ℝ] ℝ |
| 24 | |
| 25 | noncomputable local instance intrinsicJetBilinearNormedGroup : NormedAddCommGroup Bilin := |
| 26 | ContinuousLinearMap.toNormedAddCommGroup |
| 27 | |
| 28 | noncomputable local instance intrinsicJetBilinearNormedSpace : NormedSpace ℝ Bilin := |
| 29 | ContinuousLinearMap.toNormedSpace |
| 30 | |
| 31 | /-- A compact smooth coefficient limit gives a uniform intrinsic |
| 32 | finite-jet error below each positive tolerance, with one bound for |
| 33 | the whole compact set. Source: Corollary 16.7, p. 372. -/ |
| 34 | theorem eventually_intrinsic_jet_error_bound |
| 35 | {ι : Type*} {l : Filter ι} (g : RiemannianMetric 3 E) (D : LeviCivitaData g) |
| 36 | {B : ι → E → Bilin} {U K : Set E} |
| 37 | (h : CompactSmoothConvergenceOn B g.euclideanCoefficients l U) |
| 38 | (hK : IsCompact K) (hKU : K ⊆ U) (m : ℕ) {epsilon : ℝ} (hepsilon : 0 < epsilon) : |
| 39 | ∃ bound : ℝ, bound < epsilon ∧ ∀ᶠ i in l, ∀ x ∈ K, |
| 40 | singularMetricJetErrorSquared g D (fun y v => B i y (v 0) (v 1)) m x ≤ bound := by |
| 41 | obtain ⟨C, hC, hbound⟩ := M36.exists_comparison_covariant_jet_bound g D hK m |
| 42 | let rho := Real.sqrt (epsilon / (2 * C)) |
| 43 | have hrho : 0 < rho := Real.sqrt_pos.mpr (div_pos hepsilon (by positivity)) |
| 44 | have hrhosq : C * rho ^ 2 = epsilon / 2 := by |
| 45 | rw [Real.sq_sqrt (le_of_lt (div_pos hepsilon (by positivity)))] |
| 46 | field_simp |
| 47 | obtain ⟨V, hV, hKV, hVU⟩ := exists_compact_between hK h.isOpen hKU |
| 48 | have hs : ∀ᶠ i in l, ContDiffOn ℝ ∞ (B i) (interior V) := by |
| 49 | filter_upwards [h.eventually_smooth V hV hVU] with i hi |
| 50 | exact fun x hx => (hi x (interior_subset hx)).contDiffWithinAt |
| 51 | have hjets : ∀ᶠ i in l, ∀ j : Fin (m + 1), ∀ x ∈ K, |
| 52 | dist (iteratedFDeriv ℝ (j : ℕ) g.euclideanCoefficients x) |
| 53 | (iteratedFDeriv ℝ (j : ℕ) (B i) x) < rho := by |
| 54 | rw [eventually_all] |
| 55 | intro j |
| 56 | exact Metric.tendstoUniformlyOn_iff.mp (h.jets j K hK hKU) rho hrho |
| 57 | refine ⟨epsilon / 2, half_lt_self hepsilon, ?_⟩ |
| 58 | filter_upwards [hs, hjets] with i his hij |
| 59 | intro x hx |
| 60 | rw [← hrhosq] |
| 61 | apply hbound (interior V) isOpen_interior hKV (B i) his rho hrho.le x hx |
| 62 | intro j hj |
| 63 | have hb := his.contDiffAt (isOpen_interior.mem_nhds (hKV hx)) |
| 64 | have hg := g.contDiffAt_euclideanCoefficients x |
| 65 | rw [iteratedFDeriv_sub_apply |
| 66 | (hb.of_le (by exact_mod_cast le_top)) (hg.of_le (by exact_mod_cast le_top))] |
| 67 | simpa only [dist_eq_norm, norm_sub_rev] using |
| 68 | (hij ⟨j, Nat.lt_succ_of_le hj⟩ x hx).le |
| 69 | |
| 70 | end PoincareMT.M44 |