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.Generalized.BoundedDistance.Tube.IntrinsicGeometry.IntrinsicOpenMetric |
| 3 | |
| 4 | /-! |
| 5 | # Cap intrinsic distances after open restriction |
| 6 | |
| 7 | For the relative A.8 construction, the actual paths in a cap carrier |
| 8 | correspond under open inclusion, with unchanged tested-interval lengths. |
| 9 | Thus both the frozen intrinsic distance and the frozen intrinsic diameter |
| 10 | are preserved. The carrier need not itself be open for this argument. |
| 11 | See the cap-topology open-cap restriction derivation. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set |
| 18 | open scoped Manifold ContDiff Topology ENNReal Bundle |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.M28 |
| 23 | |
| 24 | variable {M : Type u} [TopologicalSpace M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 26 | [IsManifold (𝓡 3) ∞ M] |
| 27 | |
| 28 | /-- Lift and pushdown identify the entire candidate-length sets for a |
| 29 | carrier contained in the selected open region. -/ |
| 30 | theorem intrinsicOpenMetric_intrinsicEDist (g : RiemannianMetric 3 M) |
| 31 | (V : TopologicalSpace.Opens M) {S : Set M} (hSV : S ⊆ (V : Set M)) |
| 32 | (p q : V) : |
| 33 | intrinsicEDist (intrinsicOpenMetric g V) ((Subtype.val : V → M) ⁻¹' S) p q = |
| 34 | intrinsicEDist g S (p : M) (q : M) := by |
| 35 | unfold intrinsicEDist |
| 36 | apply congrArg sInf |
| 37 | ext L |
| 38 | constructor |
| 39 | · rintro ⟨α, hα, hα0, hα1, hαS, hL⟩ |
| 40 | refine ⟨Subtype.val ∘ α, |
| 41 | (contMDiff_subtype_val (I := 𝓡 3) (U := V)).comp_contMDiffOn hα, |
| 42 | congrArg Subtype.val hα0, congrArg Subtype.val hα1, ?_, ?_⟩ |
| 43 | · rintro z ⟨t, ht, rfl⟩ |
| 44 | exact hαS ⟨t, ht, rfl⟩ |
| 45 | · exact hL.trans (intrinsicOpenMetric_pathELength g V zero_le_one hα) |
| 46 | · rintro ⟨α, hα, hα0, hα1, hαS, hL⟩ |
| 47 | obtain ⟨β, hβ, heq, hlength⟩ := |
| 48 | exists_intrinsicOpenMetric_path_lift g V zero_le_one hα |
| 49 | (fun t ht => hSV (hαS ⟨t, ht, rfl⟩)) |
| 50 | refine ⟨β, hβ, Subtype.ext ((heq (by norm_num)).trans hα0), |
| 51 | Subtype.ext ((heq (by norm_num)).trans hα1), ?_, hL.trans hlength.symm⟩ |
| 52 | rintro z ⟨t, ht, rfl⟩ |
| 53 | change (Subtype.val ∘ β) t ∈ S |
| 54 | rw [heq ht] |
| 55 | exact hαS ⟨t, ht, rfl⟩ |
| 56 | |
| 57 | /-- The frozen cap diameter is exactly unchanged by the actual open |
| 58 | restriction, including its strict supremum semantics. -/ |
| 59 | theorem intrinsicOpenMetric_intrinsicDiameter (g : RiemannianMetric 3 M) |
| 60 | (V : TopologicalSpace.Opens M) {S : Set M} (hSV : S ⊆ (V : Set M)) : |
| 61 | intrinsicDiameter (intrinsicOpenMetric g V) ((Subtype.val : V → M) ⁻¹' S) = |
| 62 | intrinsicDiameter g S := by |
| 63 | unfold intrinsicDiameter |
| 64 | apply congrArg sSup |
| 65 | ext L |
| 66 | constructor |
| 67 | · rintro ⟨⟨p, q⟩, rfl⟩ |
| 68 | refine ⟨(⟨(p : V), p.property⟩, ⟨(q : V), q.property⟩), ?_⟩ |
| 69 | exact (intrinsicOpenMetric_intrinsicEDist g V hSV p q).symm |
| 70 | · rintro ⟨⟨p, q⟩, rfl⟩ |
| 71 | refine ⟨(⟨⟨(p : M), hSV p.property⟩, p.property⟩, |
| 72 | ⟨⟨(q : M), hSV q.property⟩, q.property⟩), ?_⟩ |
| 73 | exact intrinsicOpenMetric_intrinsicEDist g V hSV _ _ |
| 74 | |
| 75 | end PoincareMT.M28 |