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.Convergence |
| 2 | import PoincareLib.Geometry.Riemannian.MetricComparison |
| 3 | |
| 4 | /-! |
| 5 | # Time independence of product-flow embeddings |
| 6 | |
| 7 | The frozen vector-field compatibility condition forces the spatial velocity |
| 8 | of an ordinary product-flow embedding to vanish. Its spatial time curves |
| 9 | therefore have zero length and are constant on each interior time interval. |
| 10 | This propagates the based condition from time zero to every interior time. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | open Set MeasureTheory |
| 15 | open scoped Manifold ContDiff Bundle ENNReal Topology |
| 16 | |
| 17 | namespace PoincareMT.SmoothSpacetimeEmbedding |
| 18 | |
| 19 | variable {n : ℕ} {T' T : ℝ} {C D : FlowCarrier n} |
| 20 | {F : BasedFlow n T' T C} {G : BasedFlow n T' T D} |
| 21 | {U : Set C.carrier} |
| 22 | |
| 23 | /-- Product-flow compatibility makes the spatial velocity zero, including |
| 24 | for the total representatives outside the smoothness domain. -/ |
| 25 | theorem spatial_velocity_eq_zero |
| 26 | (e : SmoothSpacetimeEmbedding F G (Ioo T' T ×ˢ U)) (t : ℝ) (x : C.carrier) : |
| 27 | letI : TopologicalSpace D.carrier := D.topologicalSpace |
| 28 | letI : ChartedSpace (EuclideanSpace ℝ (Fin n)) D.carrier := D.chartedSpace |
| 29 | mfderiv (𝓘(ℝ, ℝ)) (𝓡 n) (fun s ↦ (e.toFun (s, x)).2) t 1 = 0 := by |
| 30 | simpa only [F.spacetimeVectorField_spatial_zero, G.spacetimeVectorField_spatial_zero, |
| 31 | map_zero, add_zero] using e.vector_field_compatible t x |
| 32 | |
| 33 | /-- The spatial map of a product-flow embedding is independent of interior time |
| 34 | at every point of its spatial domain. -/ |
| 35 | theorem spatial_eq_of_mem |
| 36 | (e : SmoothSpacetimeEmbedding F G (Ioo T' T ×ˢ U)) |
| 37 | {s t : ℝ} (hs : s ∈ Ioo T' T) (ht : t ∈ Ioo T' T) |
| 38 | {x : C.carrier} (hx : x ∈ U) : |
| 39 | (e.toFun (s, x)).2 = (e.toFun (t, x)).2 := by |
| 40 | let : TopologicalSpace C.carrier := C.topologicalSpace |
| 41 | let : ChartedSpace (EuclideanSpace ℝ (Fin n)) C.carrier := C.chartedSpace |
| 42 | let : IsManifold (𝓡 n) ∞ C.carrier := C.isManifold |
| 43 | let : TopologicalSpace D.carrier := D.topologicalSpace |
| 44 | let : ChartedSpace (EuclideanSpace ℝ (Fin n)) D.carrier := D.chartedSpace |
| 45 | let : IsManifold (𝓡 n) ∞ D.carrier := D.isManifold |
| 46 | let σ : ℝ → D.carrier := fun τ ↦ (e.toFun (τ, x)).2 |
| 47 | have hσ : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ σ (Ioo T' T) := by |
| 48 | intro τ hτ |
| 49 | exact ((e.smooth_on.comp (contMDiff_id.prodMk contMDiff_const).contMDiffOn |
| 50 | (fun u hu ↦ ⟨hu, hx⟩)) τ hτ).snd |
| 51 | have hforward : ∀ a ∈ Ioo T' T, ∀ b ∈ Ioo T' T, a ≤ b → σ a = σ b := by |
| 52 | intro a ha b hb hab |
| 53 | have hI : Icc a b ⊆ Ioo T' T := fun τ hτ ↦ |
| 54 | ⟨ha.1.trans_le hτ.1, hτ.2.trans_lt hb.2⟩ |
| 55 | have hlength : (G.flow.metric 0).pathELength σ a b = 0 := by |
| 56 | rw [RiemannianMetric.pathELength_eq_lintegral_tangentNorm] |
| 57 | simp only [σ, e.spatial_velocity_eq_zero, RiemannianMetric.tangentNorm, |
| 58 | map_zero, Real.sqrt_zero, ENNReal.ofReal_zero, lintegral_zero] |
| 59 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : D.carrier → Type _) := |
| 60 | ⟨(G.flow.metric 0).toRiemannianMetric⟩ |
| 61 | have hdist : (G.flow.metric 0).edist (σ a) (σ b) ≤ 0 := by |
| 62 | exact (Manifold.riemannianEDist_le_pathELength ((hσ.mono hI).of_le (by simp)) |
| 63 | rfl rfl hab).trans hlength.le |
| 64 | let : EMetricSpace D.carrier := D.metricEMetricSpace (G.metricAt 0) |
| 65 | exact edist_eq_zero.mp (le_antisymm hdist bot_le) |
| 66 | rcases le_total s t with hst | hts |
| 67 | · exact hforward s hs t ht hst |
| 68 | · exact (hforward t ht s hs hts).symm |
| 69 | |
| 70 | end PoincareMT.SmoothSpacetimeEmbedding |
| 71 | |
| 72 | namespace PoincareMT.PointedGeometricConvergence |
| 73 | |
| 74 | /-- The frozen based condition at zero persists at every interior time. -/ |
| 75 | theorem base_preserving_at_time |
| 76 | {n : ℕ} {T' T : ℝ} {S : PointedFlowSequence n T' T} |
| 77 | (G : PointedGeometricConvergence S) (hT : T' < 0 ∧ 0 < T) |
| 78 | (j : ℕ) {t : ℝ} (ht : t ∈ Ioo T' T) : |
| 79 | (G.embedding j).toFun (t, G.limitFlow.base) = |
| 80 | (t, (S.flow (G.subsequence j)).base) := by |
| 81 | apply Prod.ext |
| 82 | · exact (G.embedding j).time_preserving t G.limitFlow.base |
| 83 | · have hbase := congrArg Prod.snd (G.base_preserving j) |
| 84 | exact ((G.embedding j).spatial_eq_of_mem (s := t) (t := 0) ht hT |
| 85 | (G.base_in_exhaustion j)).trans hbase |
| 86 | |
| 87 | end PoincareMT.PointedGeometricConvergence |