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.Compactness.Embedding.LocalDiffeomorphism |
| 2 | import PoincareLib.Geometry.RicciFlow.Compactness.GeometricLimit.SourceBallCoverage |
| 3 | |
| 4 | /-! |
| 5 | # Coverage by images of precompact domains |
| 6 | |
| 7 | A spatial embedding defined beyond the closure of a domain covers any ball |
| 8 | about an interior image point which misses the image of the domain boundary. |
| 9 | This local argument needs no completeness of either metric. It is the |
| 10 | no-escape step used in Morgan--Tian, Section 5.1, pp. 85--89. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set Filter |
| 16 | open scoped Manifold ContDiff Bundle ENNReal Topology |
| 17 | |
| 18 | namespace PoincareMT |
| 19 | |
| 20 | /-- A Riemannian ball is preconnected, also for incomplete metrics. -/ |
| 21 | theorem RiemannianMetric.isPreconnected_ball |
| 22 | {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 24 | (g : RiemannianMetric n M) (p : M) (r : ℝ) : |
| 25 | IsPreconnected (g.ball p r) := by |
| 26 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 27 | ⟨g.toRiemannianMetric⟩ |
| 28 | apply isPreconnected_of_forall p |
| 29 | intro y hy |
| 30 | obtain ⟨γ, hγ0, hγ1, hγ, hlength⟩ := |
| 31 | Manifold.exists_lt_of_riemannianEDist_lt hy |
| 32 | refine ⟨γ '' Icc (0 : ℝ) 1, ?_, ⟨0, ⟨le_rfl, zero_le_one⟩, hγ0⟩, |
| 33 | ⟨1, ⟨zero_le_one, le_rfl⟩, hγ1⟩, |
| 34 | isPreconnected_Icc.image γ hγ.continuousOn⟩ |
| 35 | rintro _ ⟨s, hs, rfl⟩ |
| 36 | exact lt_of_le_of_lt |
| 37 | ((Manifold.riemannianEDist_le_pathELength |
| 38 | (hγ.mono (Icc_subset_Icc le_rfl hs.2)) hγ0 rfl hs.1).trans |
| 39 | (Manifold.pathELength_mono le_rfl hs.2)) hlength |
| 40 | |
| 41 | namespace SmoothSpacetimeEmbedding |
| 42 | |
| 43 | set_option backward.isDefEq.respectTransparency false in |
| 44 | /-- A ball avoiding the embedded boundary is covered by the embedded domain. -/ |
| 45 | theorem ball_subset_spatial_image_of_boundary_avoided |
| 46 | {n : ℕ} {T' T : ℝ} {C D : FlowCarrier n} |
| 47 | {F : BasedFlow n T' T C} {G : BasedFlow n T' T D} |
| 48 | {U V : Set C.carrier} |
| 49 | (e : SmoothSpacetimeEmbedding F G (Ioo T' T ×ˢ U)) |
| 50 | (hU : @IsOpen C.carrier C.topologicalSpace U) |
| 51 | (hV : @IsOpen C.carrier C.topologicalSpace V) |
| 52 | (hcompact : @IsCompact C.carrier C.topologicalSpace |
| 53 | (@closure C.carrier C.topologicalSpace V)) |
| 54 | (hVU : @closure C.carrier C.topologicalSpace V ⊆ U) |
| 55 | (hp : F.base ∈ V) {t A : ℝ} (ht : t ∈ Ioo T' T) (hA : 0 < A) |
| 56 | (hboundary : ∀ x ∈ @frontier C.carrier C.topologicalSpace V, |
| 57 | ENNReal.ofReal A ≤ (D.metricEMetricSpace (G.metricAt t)).edist |
| 58 | (e.toFun (t, F.base)).2 (e.toFun (t, x)).2) : |
| 59 | D.metricBall (G.metricAt t) (e.toFun (t, F.base)).2 A ⊆ |
| 60 | (fun x => (e.toFun (t, x)).2) '' V := by |
| 61 | let : TopologicalSpace C.carrier := C.topologicalSpace |
| 62 | let : ChartedSpace (EuclideanSpace ℝ (Fin n)) C.carrier := C.chartedSpace |
| 63 | let : IsManifold (𝓡 n) ∞ C.carrier := C.isManifold |
| 64 | let : TopologicalSpace D.carrier := D.topologicalSpace |
| 65 | let : ChartedSpace (EuclideanSpace ℝ (Fin n)) D.carrier := D.chartedSpace |
| 66 | let : IsManifold (𝓡 n) ∞ D.carrier := D.isManifold |
| 67 | let : T2Space D.carrier := D.t2Space |
| 68 | let f : C.carrier → D.carrier := fun x => (e.toFun (t, x)).2 |
| 69 | have hf : ∀ x ∈ U, ContMDiffAt (𝓡 n) (𝓡 n) ∞ f x := |
| 70 | fun x hx => e.spatialMap_contMDiffAt hU ht hx |
| 71 | have hopen : IsOpen (f '' V) := by |
| 72 | apply isOpen_iff_mem_nhds.mpr |
| 73 | rintro _ ⟨x, hx, rfl⟩ |
| 74 | rw [← Poincare.map_nhds_eq_of_contMDiffAt_mfderiv_bijective |
| 75 | (hf x (hVU (subset_closure hx))) |
| 76 | (e.spatialMap_mfderiv_bijective hU ht (hVU (subset_closure hx)))] |
| 77 | exact image_mem_map (hV.mem_nhds hx) |
| 78 | have hclosed : IsClosed (f '' closure V) := |
| 79 | (hcompact.image_of_continuousOn |
| 80 | (fun x hx => (hf x (hVU hx)).continuousAt.continuousWithinAt)).isClosed |
| 81 | have hclosure : closure (f '' V) ⊆ f '' closure V := |
| 82 | closure_minimal (image_mono subset_closure) hclosed |
| 83 | apply (G.metricAt t).isPreconnected_ball (f F.base) A |
| 84 | |>.subset_of_closure_inter_subset hopen |
| 85 | · refine ⟨f F.base, ?_, mem_image_of_mem f hp⟩ |
| 86 | change (G.metricAt t).edist (f F.base) (f F.base) < ENNReal.ofReal A |
| 87 | simpa only [RiemannianMetric.edist, Manifold.riemannianEDist_self] using |
| 88 | ENNReal.ofReal_pos.mpr hA |
| 89 | · rintro y ⟨hyclosure, hyball⟩ |
| 90 | obtain ⟨x, hx, rfl⟩ := hclosure hyclosure |
| 91 | have hxV : x ∈ V := by |
| 92 | by_contra hxV |
| 93 | have hfront : x ∈ frontier V := by |
| 94 | rw [frontier, hV.interior_eq] |
| 95 | exact ⟨hx, hxV⟩ |
| 96 | exact (not_lt_of_ge (hboundary x hfront)) hyball |
| 97 | exact mem_image_of_mem f hxV |
| 98 | |
| 99 | end SmoothSpacetimeEmbedding |
| 100 | |
| 101 | namespace PointedGeometricConvergence |
| 102 | |
| 103 | /-- If the embedded boundaries escape every source ball, each source ball is |
| 104 | eventually covered by one fixed exhaustion stage. -/ |
| 105 | theorem source_ball_coverage_of_boundary_escape |
| 106 | {n : ℕ} {T' T : ℝ} {S : PointedFlowSequence n T' T} |
| 107 | (G : PointedGeometricConvergence S) (hT : T' < 0 ∧ 0 < T) |
| 108 | (hescape : ∀ A : ℝ, 0 < A → ∃ j : ℕ, ∀ᶠ k in atTop, |
| 109 | ∀ x ∈ @frontier G.limitCarrier.carrier G.limitCarrier.topologicalSpace |
| 110 | (G.exhaustion j), |
| 111 | ENNReal.ofReal A ≤ |
| 112 | ((S.carrier (G.subsequence k)).metricEMetricSpace |
| 113 | ((S.flow (G.subsequence k)).metricAt 0)).edist |
| 114 | (S.flow (G.subsequence k)).base ((G.embedding k).toFun (0, x)).2) : |
| 115 | ∀ A : ℝ, 0 < A → ∃ j : ℕ, ∀ᶠ k in atTop, |
| 116 | (S.flow (G.subsequence k)).zeroBall A ⊆ |
| 117 | (fun x => ((G.embedding k).toFun (0, x)).2) '' G.exhaustion j := by |
| 118 | let : TopologicalSpace G.limitCarrier.carrier := G.limitCarrier.topologicalSpace |
| 119 | intro A hA |
| 120 | obtain ⟨j, hj⟩ := hescape A hA |
| 121 | obtain ⟨l, hl⟩ := G.exists_exhaustion_superset (G.exhaustion_compactClosure j) |
| 122 | refine ⟨j, ?_⟩ |
| 123 | filter_upwards [hj, eventually_ge_atTop l] with k hk hlk |
| 124 | have hbound : ∀ x ∈ frontier (G.exhaustion j), |
| 125 | ENNReal.ofReal A ≤ |
| 126 | ((S.carrier (G.subsequence k)).metricEMetricSpace |
| 127 | ((S.flow (G.subsequence k)).metricAt 0)).edist |
| 128 | ((G.embedding k).toFun (0, G.limitFlow.base)).2 |
| 129 | ((G.embedding k).toFun (0, x)).2 := by |
| 130 | simpa only [G.base_preserving k] using hk |
| 131 | have hcover := (G.embedding k).ball_subset_spatial_image_of_boundary_avoided |
| 132 | (G.exhaustion_open k) (G.exhaustion_open j) (G.exhaustion_compactClosure j) |
| 133 | (hl.trans (G.exhaustion_monotone hlk)) (G.base_in_exhaustion j) hT hA hbound |
| 134 | simpa only [G.base_preserving k, BasedFlow.zeroBall, BasedFlow.metricAt] using hcover |
| 135 | |
| 136 | /-- Boundary escape proves completeness of the actual zero-time limit metric. -/ |
| 137 | theorem metricComplete_zero_of_boundary_escape |
| 138 | {n : ℕ} {T' T : ℝ} {S : PointedFlowSequence n T' T} |
| 139 | (G : PointedGeometricConvergence S) (hT : T' < 0 ∧ 0 < T) |
| 140 | (hescape : ∀ A : ℝ, 0 < A → ∃ j : ℕ, ∀ᶠ k in atTop, |
| 141 | ∀ x ∈ @frontier G.limitCarrier.carrier G.limitCarrier.topologicalSpace |
| 142 | (G.exhaustion j), |
| 143 | ENNReal.ofReal A ≤ |
| 144 | ((S.carrier (G.subsequence k)).metricEMetricSpace |
| 145 | ((S.flow (G.subsequence k)).metricAt 0)).edist |
| 146 | (S.flow (G.subsequence k)).base ((G.embedding k).toFun (0, x)).2) : |
| 147 | G.limitCarrier.metricComplete (G.limitFlow.metricAt 0) := |
| 148 | G.metricComplete_zero_of_source_ball_coverage hT |
| 149 | (G.source_ball_coverage_of_boundary_escape hT hescape) |
| 150 | |
| 151 | end PointedGeometricConvergence |
| 152 | |
| 153 | end PoincareMT |