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.Generalized.BoundedDistance.GeometryImports |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Existence.Predecessors.BoundedDistanceInputs |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Tensor.TensorTrace |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Analysis.Geometry.LastLevel |
| 5 | |
| 6 | /-! |
| 7 | # Short paths and scalar-level truncation |
| 8 | |
| 9 | The actual metric ball yields a short C1 path by Mathlib's Riemannian |
| 10 | distance API. M04 tensor calculus and M09 metric-trace regularity give |
| 11 | scalar continuity on the selected slice. These are the inputs to the |
| 12 | high-curvature path truncation in Morgan--Tian section 10.3, p. 247. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open scoped Manifold ContDiff Bundle ENNReal Topology |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT |
| 22 | |
| 23 | /-- A point in an actual Riemannian ball can be joined to its center by |
| 24 | a globally C1 path of strictly smaller length than the ball radius, |
| 25 | locally constant at its endpoints. See Morgan--Tian section 10.3, p. 247. -/ |
| 26 | theorem RiemannianMetric.exists_short_path_of_mem_ball |
| 27 | {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 28 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 29 | (g : RiemannianMetric n M) {x y : M} {r : ℝ} (hy : y ∈ g.ball x r) : |
| 30 | ∃ γ : ℝ → M, γ 0 = x ∧ γ 1 = y ∧ ContMDiff 𝓘(ℝ) (𝓡 n) 1 γ ∧ |
| 31 | g.pathELength γ 0 1 < ENNReal.ofReal r ∧ |
| 32 | γ =ᶠ[𝓝 0] (fun _ ↦ x) ∧ γ =ᶠ[𝓝 1] (fun _ ↦ y) := by |
| 33 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 34 | ⟨g.toRiemannianMetric⟩ |
| 35 | exact Manifold.exists_lt_locally_constant_of_riemannianEDist_lt hy zero_lt_one |
| 36 | |
| 37 | /-- The actual scalar curvature is continuous on each selected slice. |
| 38 | This uses only M04 tensor calculus and the proved metric-trace operation, |
| 39 | as needed in Morgan--Tian section 10.3, printed p. 247. -/ |
| 40 | theorem GeneralizedRicciFlowData.continuous_scalar_slice |
| 41 | (F : GeneralizedRicciFlowData.{u}) (P : RicciFlowCurvatureTheory.{u}) (t : ℝ) : |
| 42 | Continuous (fun x : (F.slice t).carrier ↦ F.scalar ⟨t, x⟩) := by |
| 43 | exact (Proofs.M09.tensorMetricTrace_smooth (F.metric t) (F.connection t).ricciEvaluation |
| 44 | (P.tensor_calculus 3 (F.slice t).carrier (F.metric t) (F.connection t)).2.1).continuous |
| 45 | |
| 46 | /-- Truncate a path at its last occurrence of the canonical-control cutoff. |
| 47 | Every point of the remaining closed segment has a certificate from the |
| 48 | same controlled slice. See Morgan--Tian section 10.3, printed p. 247. -/ |
| 49 | theorem generalizedSliceStrongCanonicalNeighborhoods.path_last_level |
| 50 | {F : GeneralizedRicciFlowData.{u}} (P : RicciFlowCurvatureTheory.{u}) |
| 51 | {epsilon C Q t : ℝ} |
| 52 | (hcanonical : generalizedSliceStrongCanonicalNeighborhoods F epsilon C Q t) |
| 53 | (γ : ℝ → (F.slice t).carrier) (hγ : ContinuousOn γ (Set.Icc 0 1)) |
| 54 | (hstart : F.scalar ⟨t, γ 0⟩ ≤ Q) (hend : Q < F.scalar ⟨t, γ 1⟩) : |
| 55 | ∃ s ∈ Set.Icc (0 : ℝ) 1, F.scalar ⟨t, γ s⟩ = Q ∧ |
| 56 | ∀ v ∈ Set.Icc s 1, |
| 57 | Nonempty (GeneralizedCanonicalControl (F := F) t (γ v) epsilon C) := by |
| 58 | have hscalar : ContinuousOn (fun v ↦ F.scalar ⟨t, γ v⟩) (Set.Icc 0 1) := |
| 59 | (F.continuous_scalar_slice P t).comp_continuousOn hγ |
| 60 | obtain ⟨s, hs, heq, hafter⟩ := |
| 61 | exists_last_eq_of_continuousOn zero_le_one hscalar hstart hend |
| 62 | refine ⟨s, hs, heq, ?_⟩ |
| 63 | intro v hv |
| 64 | apply hcanonical |
| 65 | rcases eq_or_lt_of_le hv.1 with hvs | hvs |
| 66 | · simpa [← hvs] using heq.ge |
| 67 | · exact (hafter v ⟨hvs, hv.2⟩).le |
| 68 | |
| 69 | end PoincareMT |