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.Riemannian.Curvature.LocalIsometryInvariants |
| 4 | |
| 5 | /-! |
| 6 | # Scalar continuity on the actual generalized spacetime |
| 7 | |
| 8 | Local isometry invariance identifies the supplied slice connection's scalar |
| 9 | with the ordinary scalar in each original flow box. M04 joint regularity |
| 10 | and the open box cover then give continuity on the actual sigma spacetime, |
| 11 | including included time endpoints. This supplies scalar transport in the |
| 12 | reviewed dense-time form of Theorem 10.2; see task derivation 08. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set |
| 19 | open scoped Manifold ContDiff Topology |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT |
| 24 | |
| 25 | /-- Original flow-box scalar curvature equals the scalar of the actual |
| 26 | slice connection; Morgan--Tian Definitions 3.34-3.38, printed pp. 59-61. -/ |
| 27 | theorem GeneralizedRicciFlowData.scalar_box |
| 28 | (F : GeneralizedRicciFlowData.{u}) (b : F.box_index) |
| 29 | (t : ℝ) (ht : t ∈ (F.box b).interval) (x : (F.box b).carrier.carrier) : |
| 30 | F.scalar ⟨t, (F.box b).forward t ht x⟩ = |
| 31 | ((F.box b).flow.connection t).scalarCurvature x := by |
| 32 | symm |
| 33 | exact ((F.box b).flow.connection t).scalarCurvature_eq_of_local_isometry |
| 34 | (F.connection t) isOpen_univ ((F.box b).forward_smooth t ht).contMDiffOn |
| 35 | (fun y _ v w => ((F.box b).metric_pullback t ht y v w).symm) (mem_univ x) |
| 36 | |
| 37 | /-- M04 scalar regularity is continuous on the product of the actual time |
| 38 | interval and spatial carrier, including endpoints (task derivation 08). -/ |
| 39 | theorem RicciFlow.continuous_scalar_parameter |
| 40 | {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 41 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 42 | {J : Set ℝ} (G : RicciFlow n M J) (P : RicciFlowCurvatureTheory.{u}) : |
| 43 | Continuous (fun z : J × M => (G.connection z.1.1).scalarCurvature z.2) := by |
| 44 | have hscalar : ContinuousOn |
| 45 | (fun z : ℝ × M => (G.connection z.1).scalarCurvature z.2) (J ×ˢ univ) := |
| 46 | (P.scalar_regular n M J G).continuousOn |
| 47 | have hmap : Continuous (fun z : J × M => (z.1.val, z.2)) := |
| 48 | (continuous_subtype_val.comp continuous_fst).prodMk continuous_snd |
| 49 | exact hscalar.comp_continuous (f := fun z : J × M => (z.1.val, z.2)) hmap |
| 50 | (fun z => ⟨z.1.property, mem_univ z.2⟩) |
| 51 | |
| 52 | /-- The actual generalized scalar is continuous on the entire spacetime, |
| 53 | including relative time endpoints, as used in the dense-time form of |
| 54 | Morgan--Tian Theorem 10.2 (task derivation 08). -/ |
| 55 | theorem GeneralizedRicciFlowData.continuous_scalar_m28 |
| 56 | (F : GeneralizedRicciFlowData.{u}) (P : RicciFlowCurvatureTheory.{u}) : |
| 57 | Continuous F.scalar := by |
| 58 | apply continuous_iff_continuousAt.mpr |
| 59 | rintro ⟨t, x⟩ |
| 60 | obtain ⟨b, ht, y, rfl⟩ := F.box_covers t x |
| 61 | apply ((F.box_openEmbedding b).continuousAt_iff |
| 62 | (x := (⟨t, ht⟩, y)) (g := F.scalar)).mp |
| 63 | have hR := (F.box b).flow.continuous_scalar_parameter P |
| 64 | simpa only [Function.comp_def, F.scalar_box] using |
| 65 | hR.continuousAt (x := (⟨t, ht⟩, y)) |
| 66 | |
| 67 | /-- Scalar curvature is jointly continuous in the time and spatial variables |
| 68 | of every actual generalized cylinder, including its included endpoints. |
| 69 | This is the scalar producer in the dense-time argument (task derivation 08). -/ |
| 70 | theorem GeneralizedFlowCylinder.continuous_scalar |
| 71 | {F : GeneralizedRicciFlowData.{u}} {C : GeneralizedSliceCarrier.{u}} |
| 72 | {origin scale : ℝ} {I : Set ℝ} {U : Set C.carrier} |
| 73 | (e : GeneralizedFlowCylinder F C origin scale I U) |
| 74 | (P : RicciFlowCurvatureTheory.{u}) : |
| 75 | Continuous (fun z : I × U => F.scalar (e.pointMap z.1.1 z.1.2 z.2.1)) := |
| 76 | (F.continuous_scalar_m28 P).comp e.embedding.continuous |
| 77 | |
| 78 | end PoincareMT |