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.Geometry.Manifold.IsManifold.ExtChartAt |
| 2 | import Mathlib.Analysis.Normed.Module.FiniteDimension |
| 3 | import Mathlib.Topology.UnitInterval |
| 4 | |
| 5 | /-! |
| 6 | # Compact chart balls and a finite path subdivision in one open domain |
| 7 | |
| 8 | For the local-path argument in Morgan--Tian, Theorem 4.18, pp. 95--96, |
| 9 | connectedness of an open manifold domain produces an actual path. Compactness |
| 10 | of its parameter interval produces finitely many chart balls. Their closed |
| 11 | coordinate balls are mapped back into the same domain; no compactness or |
| 12 | completeness of that domain is assumed. |
| 13 | -/ |
| 14 | |
| 15 | noncomputable section |
| 16 | open Set Metric Filter Topology |
| 17 | |
| 18 | namespace PoincareMT.RicciFlow.Splitting.MaximumPrinciple.ChartChain |
| 19 | |
| 20 | variable {E H M : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 21 | [TopologicalSpace H] {I : ModelWithCorners ℝ E H} |
| 22 | [TopologicalSpace M] [ChartedSpace H M] |
| 23 | |
| 24 | /-- A positive coordinate ball with its entire closed inverse image in `U`. -/ |
| 25 | structure ChartBall (I : ModelWithCorners ℝ E H) (U : Set M) where |
| 26 | center : M |
| 27 | radius : ℝ |
| 28 | radius_pos : 0 < radius |
| 29 | in_target : closedBall (extChartAt I center center) radius ⊆ |
| 30 | (extChartAt I center).target |
| 31 | in_domain : (extChartAt I center).symm '' |
| 32 | closedBall (extChartAt I center center) radius ⊆ U |
| 33 | |
| 34 | namespace ChartBall |
| 35 | |
| 36 | variable {U : Set M} (B : ChartBall I U) |
| 37 | |
| 38 | /-- The compact inverse image of the closed coordinate ball. -/ |
| 39 | def domain : Set M := (extChartAt I B.center).symm '' |
| 40 | closedBall (extChartAt I B.center B.center) B.radius |
| 41 | |
| 42 | /-- The open chart neighborhood inside the compact domain. -/ |
| 43 | def core : Set M := (extChartAt I B.center).source ∩ |
| 44 | extChartAt I B.center ⁻¹' ball (extChartAt I B.center B.center) B.radius |
| 45 | |
| 46 | /-- The closed chart ball is genuinely compact in the ambient manifold. -/ |
| 47 | theorem isCompact_domain [FiniteDimensional ℝ E] : IsCompact B.domain := |
| 48 | (isCompact_closedBall _ _).image_of_continuousOn |
| 49 | ((continuousOn_extChartAt_symm B.center).mono B.in_target) |
| 50 | |
| 51 | /-- The compact chart ball remains in the prescribed domain. -/ |
| 52 | theorem domain_subset : B.domain ⊆ U := B.in_domain |
| 53 | |
| 54 | /-- All of the compact chart ball lies in the same chart source. -/ |
| 55 | theorem domain_chart : B.domain ⊆ (chartAt H B.center).source := by |
| 56 | rintro x ⟨y, hy, rfl⟩ |
| 57 | simpa only [extChartAt_source] using |
| 58 | (extChartAt I B.center).map_target (B.in_target hy) |
| 59 | |
| 60 | /-- The chart core is open in the ambient manifold. -/ |
| 61 | theorem isOpen_core : IsOpen B.core := |
| 62 | isOpen_extChartAt_preimage' B.center isOpen_ball |
| 63 | |
| 64 | /-- The center belongs to the core. -/ |
| 65 | theorem center_mem_core : B.center ∈ B.core := |
| 66 | ⟨mem_extChartAt_source B.center, mem_ball_self B.radius_pos⟩ |
| 67 | |
| 68 | /-- The entire core is in the interior of the compact comparison domain. -/ |
| 69 | theorem core_subset_interior : B.core ⊆ interior B.domain := by |
| 70 | apply interior_maximal _ B.isOpen_core |
| 71 | intro x hx |
| 72 | exact ⟨extChartAt I B.center x, ball_subset_closedBall hx.2, |
| 73 | (extChartAt I B.center).left_inv hx.1⟩ |
| 74 | |
| 75 | /-- Inverse coordinates of points in the open ball belong to the core. -/ |
| 76 | theorem inverse_mem_core {y : E} |
| 77 | (hy : y ∈ ball (extChartAt I B.center B.center) B.radius) : |
| 78 | (extChartAt I B.center).symm y ∈ B.core := by |
| 79 | have ht := B.in_target (ball_subset_closedBall hy) |
| 80 | exact ⟨(extChartAt I B.center).map_target ht, |
| 81 | by simpa only [mem_preimage, (extChartAt I B.center).right_inv ht] using hy⟩ |
| 82 | |
| 83 | end ChartBall |
| 84 | |
| 85 | /-- Every point of an open domain has a positive compact chart ball in it. -/ |
| 86 | theorem exists_chartBall [I.Boundaryless] {U : Set M} (hU : IsOpen U) |
| 87 | {p : M} (hp : p ∈ U) : |
| 88 | ∃ B : ChartBall I U, B.center = p := by |
| 89 | have ht := (extChartAt I p).map_source (mem_extChartAt_source p) |
| 90 | have hc : ContinuousAt (extChartAt I p).symm (extChartAt I p p) := |
| 91 | ((continuousOn_extChartAt_symm p) _ ht).continuousAt |
| 92 | ((isOpen_extChartAt_target p).mem_nhds ht) |
| 93 | have hU' : (extChartAt I p).symm ⁻¹' U ∈ 𝓝 (extChartAt I p p) := |
| 94 | hc.preimage_mem_nhds (hU.mem_nhds (by |
| 95 | simpa only [(extChartAt I p).left_inv (mem_extChartAt_source p)] using hp)) |
| 96 | obtain ⟨r, hr, hball⟩ := Metric.mem_nhds_iff.mp |
| 97 | (inter_mem ((isOpen_extChartAt_target p).mem_nhds ht) hU') |
| 98 | have hclosed := (closedBall_subset_ball (half_lt_self hr)).trans hball |
| 99 | exact ⟨⟨p, r / 2, half_pos hr, fun _ hy => (hclosed hy).1, |
| 100 | by rintro _ ⟨y, hy, rfl⟩; exact (hclosed hy).2⟩, rfl⟩ |
| 101 | |
| 102 | include I in |
| 103 | /-- Local path connectedness comes from the manifold model and chart maps. -/ |
| 104 | theorem manifold_locallyPathConnected : LocallyPathConnectedSpace M := by |
| 105 | let : LocallyPathConnectedSpace (range I) := I.convex_range.locallyPathConnectedSpace |
| 106 | let : LocallyPathConnectedSpace H := |
| 107 | I.isClosedEmbedding.toHomeomorph.isOpenEmbedding.locallyPathConnectedSpace |
| 108 | exact ChartedSpace.locallyPathConnectedSpace H M |
| 109 | |
| 110 | include I in |
| 111 | /-- An actual compact path in a connected open domain, with ambient containment. -/ |
| 112 | theorem exists_compact_path {U : Set M} (hU : IsOpen U) (hconn : IsConnected U) |
| 113 | {p q : M} (hp : p ∈ U) (hq : q ∈ U) : |
| 114 | ∃ γ : Path p q, IsCompact (range γ) ∧ range γ ⊆ U := by |
| 115 | let : LocallyPathConnectedSpace M := manifold_locallyPathConnected (I := I) |
| 116 | have hj := (hU.isConnected_iff_isPathConnected.mp hconn).joinedIn p hp q hq |
| 117 | exact ⟨hj.somePath, isCompact_range hj.somePath.continuous, |
| 118 | by rintro _ ⟨t, rfl⟩; exact hj.somePath_mem t⟩ |
| 119 | |
| 120 | /-- Finite chart-local pieces of an actual path, including shared endpoints. -/ |
| 121 | structure Subdivision {U : Set M} {p q : M} (γ : Path p q) where |
| 122 | count : ℕ |
| 123 | count_pos : 0 < count |
| 124 | cut : ℕ → unitInterval |
| 125 | cut_zero : cut 0 = 0 |
| 126 | cut_last : cut count = 1 |
| 127 | monotone_cut : Monotone cut |
| 128 | ball : Fin count → ChartBall I U |
| 129 | subordinate : ∀ i : Fin count, ∀ t ∈ Icc (cut i) (cut (i + 1)), |
| 130 | γ t ∈ (ball i).core |
| 131 | |
| 132 | /-- Compactness gives finitely many chart-ball pieces of the supplied path. -/ |
| 133 | theorem exists_subdivision [I.Boundaryless] {U : Set M} (hU : IsOpen U) {p q : M} |
| 134 | (γ : Path p q) (hγ : range γ ⊆ U) : Nonempty (Subdivision (I := I) (U := U) γ) := by |
| 135 | classical |
| 136 | have hc : ∀ t : unitInterval, ∃ B : ChartBall I U, γ t ∈ B.core := by |
| 137 | intro t |
| 138 | obtain ⟨B, hB⟩ := exists_chartBall (I := I) hU (hγ (mem_range_self t)) |
| 139 | exact ⟨B, hB ▸ B.center_mem_core⟩ |
| 140 | obtain ⟨cut, hzero, hmono, ⟨n, hn⟩, hsub⟩ := |
| 141 | exists_monotone_Icc_subset_open_cover_unitInterval |
| 142 | (fun B : ChartBall I U => B.isOpen_core.preimage γ.continuous) |
| 143 | (show univ ⊆ ⋃ B : ChartBall I U, γ ⁻¹' B.core from |
| 144 | fun t _ => by obtain ⟨B, hB⟩ := hc t; exact mem_iUnion.mpr ⟨B, hB⟩) |
| 145 | choose B hB using hsub |
| 146 | exact ⟨⟨n + 1, Nat.succ_pos n, cut, hzero, hn _ (Nat.le_succ n), hmono, |
| 147 | fun i => B i, fun i => hB i⟩⟩ |
| 148 | |
| 149 | /-- Connectedness supplies both the compact path and its finite chart subdivision. -/ |
| 150 | theorem exists_compact_path_subdivision [I.Boundaryless] {U : Set M} (hU : IsOpen U) |
| 151 | (hconn : IsConnected U) {p q : M} (hp : p ∈ U) (hq : q ∈ U) : |
| 152 | ∃ γ : Path p q, IsCompact (range γ) ∧ range γ ⊆ U ∧ |
| 153 | Nonempty (Subdivision (I := I) (U := U) γ) := by |
| 154 | obtain ⟨γ, hcompact, hγ⟩ := exists_compact_path (I := I) hU hconn hp hq |
| 155 | exact ⟨γ, hcompact, hγ, exists_subdivision hU γ hγ⟩ |
| 156 | |
| 157 | end PoincareMT.RicciFlow.Splitting.MaximumPrinciple.ChartChain |