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.MetricComparison |
| 2 | import PoincareLib.Geometry.Riemannian.Curvature.NormBounds |
| 3 | import PoincareLib.Geometry.Riemannian.Metric.Induced.Complete |
| 4 | |
| 5 | /-! |
| 6 | # Compact initial balls inside a terminal spatial buffer |
| 7 | |
| 8 | Morgan--Tian Theorem 3.28, p. 51, and Corollary 11.3, p. 269. |
| 9 | Bounded curvature compares the initial and terminal intrinsic balls. The |
| 10 | actual terminal pullback metric makes ambient distance no larger than |
| 11 | intrinsic distance. A smaller compact ambient ball therefore contains the |
| 12 | initial intrinsic balls required by the local Shi estimate. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set |
| 18 | open scoped Manifold ContDiff Bundle ENNReal Topology |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.M30 |
| 23 | |
| 24 | /-- An open terminal ball with a compact smaller buffer supplies compact |
| 25 | initial intrinsic balls, uniformly for centers in a fixed inner ball |
| 26 | (Theorem 3.28 and Corollary 11.3, pp. 51 and 269). Completeness is not assumed. -/ |
| 27 | theorem isCompact_closure_initial_ball_of_terminal_buffer |
| 28 | {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 29 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 30 | [T2Space M] (g : RiemannianMetric n M) (p : M) |
| 31 | (U : TopologicalSpace.Opens M) {A R T B : ℝ} |
| 32 | (hT : 0 < T) (hA : 0 < A) (hAR : A < R) |
| 33 | (hU : (U : Set M) = g.ball p R) |
| 34 | (G : RicciFlow n U (Icc (-T) 0)) |
| 35 | (hmetric : ∀ (x : U) (v w : TangentSpace (𝓡 n) x), |
| 36 | (G.metric 0).inner x v w = g.inner x.val |
| 37 | (mfderiv (𝓡 n) (𝓡 n) (Subtype.val : U → M) x v) |
| 38 | (mfderiv (𝓡 n) (𝓡 n) (Subtype.val : U → M) x w)) |
| 39 | (hcurv : ∀ s ∈ Icc (-T) 0, ∀ y : U, |
| 40 | (G.connection s).curvatureTensorNorm y ≤ B) |
| 41 | (hcompact : IsCompact (closure (g.ball p ((A + R) / 2)))) |
| 42 | (x : U) (hx : x.val ∈ g.ball p A) : |
| 43 | IsCompact (closure ((G.metric (-T)).ball x |
| 44 | ((R - A) / (2 * Real.exp ((n : ℝ) ^ 3 * max B 1 * T))))) := by |
| 45 | let K : ℝ := max B 1 |
| 46 | let L : ℝ := (n : ℝ) ^ 3 * K |
| 47 | let E : ℝ := Real.exp (L * T) |
| 48 | let r : ℝ := (R - A) / (2 * E) |
| 49 | let ρ : ℝ := (A + R) / 2 |
| 50 | have hE : 0 < E := Real.exp_pos _ |
| 51 | have hr : 0 < r := div_pos (sub_pos.mpr hAR) (mul_pos (by norm_num) hE) |
| 52 | have hρR : ρ < R := by dsimp [ρ]; linarith |
| 53 | have hR : 0 < R := hA.trans hAR |
| 54 | have hEr : E * r = (R - A) / 2 := by |
| 55 | dsimp only [r] |
| 56 | field_simp [hE.ne'] |
| 57 | let : LocallyCompactSpace M := |
| 58 | ChartedSpace.locallyCompactSpace (EuclideanSpace ℝ (Fin n)) M |
| 59 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 60 | ⟨g.toRiemannianMetric⟩ |
| 61 | let : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin n)) |
| 62 | (TangentSpace (𝓡 n) : M → Type _) := |
| 63 | ⟨⟨g.inner, g.toContinuousRiemannianMetric.continuous, fun _ _ _ => rfl⟩⟩ |
| 64 | let : EMetricSpace M := EMetricSpace.ofRiemannianMetric (𝓡 n) M |
| 65 | have hRic (s : ℝ) (hs : s ∈ Icc (-T) 0) (y : U) |
| 66 | (v : TangentSpace (𝓡 n) y) : |
| 67 | |(G.connection s).ricci y v v| ≤ L * (G.metric s).inner y v v := by |
| 68 | have hQ : 0 ≤ (G.metric s).inner y v v := by |
| 69 | by_cases hv : v = 0 |
| 70 | · subst v; simp |
| 71 | · exact ((G.metric s).pos y v hv).le |
| 72 | have hnorm := (G.connection s).abs_ricci_quadratic_le_curvatureTensorNorm y v |
| 73 | have hdim : Module.finrank ℝ (TangentSpace (𝓡 n) y) = n := |
| 74 | finrank_euclideanSpace_fin |
| 75 | simp only [Fintype.card_fin, hdim] at hnorm |
| 76 | exact hnorm.trans (mul_le_mul_of_nonneg_right |
| 77 | (mul_le_mul_of_nonneg_left ((hcurv s hs y).trans (le_max_left B 1)) |
| 78 | (by positivity)) hQ) |
| 79 | have hcompare : (G.metric (-T)).ball x r ⊆ (G.metric 0).ball x (E * r) := by |
| 80 | have h := G.ball_subset_ball_of_ricci_bound (convex_Icc (-T) 0) (Subset.refl _) |
| 81 | x r L (s := -T) (t := 0) ⟨le_rfl, by linarith⟩ ⟨by linarith, le_rfl⟩ |
| 82 | (fun s hs y _ v => hRic s hs y v) |
| 83 | simpa only [zero_sub, neg_neg, abs_of_nonneg hT.le] using h |
| 84 | have hbuffer : closure (g.ball p ρ) ⊆ U := by |
| 85 | have hclosed : IsClosed {y : M | edist p y ≤ ENNReal.ofReal ρ} := |
| 86 | isClosed_le (continuous_const.edist continuous_id) continuous_const |
| 87 | have hsub : g.ball p ρ ⊆ {y : M | edist p y ≤ ENNReal.ofReal ρ} := by |
| 88 | intro y hy |
| 89 | change edist p y < ENNReal.ofReal ρ at hy |
| 90 | exact hy.le |
| 91 | intro y hy |
| 92 | rw [hU] |
| 93 | exact (closure_minimal hsub hclosed hy).trans_lt |
| 94 | ((ENNReal.ofReal_lt_ofReal_iff hR).mpr hρR) |
| 95 | let Q : Set U := (Subtype.val : U → M) ⁻¹' closure (g.ball p ρ) |
| 96 | have hQcompact : IsCompact Q := |
| 97 | Topology.IsInducing.subtypeVal.isCompact_preimage' hcompact |
| 98 | (fun y hy => ⟨⟨y, hbuffer hy⟩, rfl⟩) |
| 99 | have hQclosed : IsClosed Q := isClosed_closure.preimage continuous_subtype_val |
| 100 | apply hQcompact.of_isClosed_subset isClosed_closure |
| 101 | apply closure_minimal ?_ hQclosed |
| 102 | intro y hy |
| 103 | apply subset_closure |
| 104 | have hxy : edist x.val y.val < ENNReal.ofReal (E * r) := |
| 105 | ((G.metric 0).edist_map_le_of_metric_pullback g contMDiff_subtype_val hmetric x y).trans_lt |
| 106 | (hcompare hy) |
| 107 | change edist p y.val < ENNReal.ofReal ρ |
| 108 | calc |
| 109 | edist p y.val ≤ edist p x.val + edist x.val y.val := edist_triangle _ _ _ |
| 110 | _ < ENNReal.ofReal A + ENNReal.ofReal (E * r) := ENNReal.add_lt_add hx hxy |
| 111 | _ = ENNReal.ofReal ρ := by |
| 112 | rw [← ENNReal.ofReal_add hA.le (mul_pos hE hr).le, hEr] |
| 113 | congr 1 |
| 114 | dsimp [ρ] |
| 115 | ring |
| 116 | |
| 117 | end PoincareMT.M30 |