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 | import PoincareLib.Geometry.Riemannian.Distance.PathVariation |
| 4 | import PoincareLib.Geometry.Riemannian.Distance.CompactConfinement |
| 5 | import PoincareLib.Topology.MetricSpace.Curves.ArcLength |
| 6 | |
| 7 | /-! |
| 8 | # The metric parametrization of the actual regional minimum |
| 9 | |
| 10 | Morgan--Tian, Claim 10.3 and Appendix A.9, use the selected regional minimum |
| 11 | as a geodesic. This first step constructs its actual arclength representative, |
| 12 | with the same trace and an explicit monotone clock. The only compact carrier |
| 13 | is the original path's own image. No ambient completeness is used. |
| 14 | See `claim10_4/2026-09-23-source-minimizing-geodesic.md`. |
| 15 | -/ |
| 16 | |
| 17 | noncomputable section |
| 18 | set_option autoImplicit false |
| 19 | set_option backward.isDefEq.respectTransparency false |
| 20 | |
| 21 | open Set Filter |
| 22 | open scoped Manifold ContDiff Topology ENNReal Bundle |
| 23 | |
| 24 | universe u |
| 25 | |
| 26 | namespace PoincareMT.M28 |
| 27 | |
| 28 | private theorem exists_isometric_arcLength_with_clock |
| 29 | {X : Type*} [MetricSpace X] {γ : ℝ → X} |
| 30 | (hc : ContinuousOn γ (Icc (0 : ℝ) 1)) |
| 31 | (hmin : eVariationOn γ (Icc (0 : ℝ) 1) = edist (γ 0) (γ 1)) : |
| 32 | ∃ η : ℝ → X, ∃ c : ℝ → ℝ, |
| 33 | η 0 = γ 0 ∧ η (dist (γ 0) (γ 1)) = γ 1 ∧ |
| 34 | ContinuousOn η (Icc 0 (dist (γ 0) (γ 1))) ∧ |
| 35 | η '' Icc 0 (dist (γ 0) (γ 1)) = γ '' Icc (0 : ℝ) 1 ∧ |
| 36 | ContinuousOn c (Icc (0 : ℝ) 1) ∧ MonotoneOn c (Icc (0 : ℝ) 1) ∧ |
| 37 | c 0 = 0 ∧ c 1 = dist (γ 0) (γ 1) ∧ |
| 38 | c '' Icc (0 : ℝ) 1 = Icc 0 (dist (γ 0) (γ 1)) ∧ |
| 39 | (∀ t ∈ Icc (0 : ℝ) 1, η (c t) = γ t) ∧ |
| 40 | ∀ s ∈ Icc 0 (dist (γ 0) (γ 1)), ∀ t ∈ Icc 0 (dist (γ 0) (γ 1)), |
| 41 | dist (η s) (η t) = |s - t| := by |
| 42 | have hv : BoundedVariationOn γ (Icc (0 : ℝ) 1) := by |
| 43 | rw [BoundedVariationOn, hmin] |
| 44 | exact edist_ne_top _ _ |
| 45 | let η := naturalParameterization γ (Icc (0 : ℝ) 1) 0 |
| 46 | let c := variationOnFromTo γ (Icc (0 : ℝ) 1) 0 |
| 47 | have hc0 : c 0 = 0 := variationOnFromTo.self _ _ _ |
| 48 | have hc1 : c 1 = dist (γ 0) (γ 1) := by |
| 49 | simp only [c, variationOnFromTo.eq_of_le _ _ zero_le_one, inter_self, |
| 50 | hmin, ← dist_edist] |
| 51 | have hccont : ContinuousOn c (Icc (0 : ℝ) 1) := |
| 52 | Poincare.MetricCurves.continuousOn_cumulative_variation zero_le_one hc hv |
| 53 | have hcmono : MonotoneOn c (Icc (0 : ℝ) 1) := |
| 54 | variationOnFromTo.monotoneOn hv.locallyBoundedVariationOn (by norm_num) |
| 55 | have hcimage : c '' Icc (0 : ℝ) 1 = Icc 0 (dist (γ 0) (γ 1)) := by |
| 56 | simpa only [hc0, hc1] using hccont.image_Icc_of_monotoneOn zero_le_one hcmono |
| 57 | have hread : ∀ t ∈ Icc (0 : ℝ) 1, η (c t) = γ t := fun t ht => |
| 58 | edist_eq_zero.mp (edist_naturalParameterization_eq_zero |
| 59 | hv.locallyBoundedVariationOn (by norm_num) ht) |
| 60 | have hunit : HasUnitSpeedOn η (Icc 0 (dist (γ 0) (γ 1))) := by |
| 61 | rw [← hcimage] |
| 62 | exact has_unit_speed_naturalParameterization γ hv.locallyBoundedVariationOn |
| 63 | (by norm_num) |
| 64 | have hlip : LipschitzOnWith 1 η (Icc 0 (dist (γ 0) (γ 1))) := by |
| 65 | intro s hs t ht |
| 66 | wlog hst : s ≤ t generalizing s t |
| 67 | · simpa only [edist_comm] using this ht hs (le_of_not_ge hst) |
| 68 | have hbound := eVariationOn.edist_le η |
| 69 | (show s ∈ Icc 0 (dist (γ 0) (γ 1)) ∩ Icc s t from ⟨hs, le_rfl, hst⟩) |
| 70 | (show t ∈ Icc 0 (dist (γ 0) (γ 1)) ∩ Icc s t from ⟨ht, hst, le_rfl⟩) |
| 71 | have hvar := hunit hs ht |
| 72 | simpa only [hvar, NNReal.coe_one, ENNReal.coe_one, one_mul, edist_dist, |
| 73 | Real.dist_eq, abs_of_nonpos (sub_nonpos.mpr hst), neg_sub] using hbound |
| 74 | have hη0 : η 0 = γ 0 := by |
| 75 | simpa only [hc0] using hread 0 (by norm_num) |
| 76 | have hη1 : η (dist (γ 0) (γ 1)) = γ 1 := by |
| 77 | rw [← hc1] |
| 78 | exact hread 1 (by norm_num) |
| 79 | refine ⟨η, c, hη0, hη1, hlip.continuousOn, ?_, hccont, hcmono, |
| 80 | hc0, hc1, hcimage, hread, ?_⟩ |
| 81 | · rw [← hcimage, image_image] |
| 82 | exact image_congr hread |
| 83 | · apply Poincare.MetricCurves.subsegment_dist_of_unit_lipschitz dist_nonneg hlip |
| 84 | rw [hη0, hη1] |
| 85 | |
| 86 | variable {M : Type u} [TopologicalSpace M] [T2Space M] |
| 87 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 88 | [IsManifold (𝓡 3) ∞ M] |
| 89 | |
| 90 | /-- A genuine finite C1 regional minimum has an isometric arclength |
| 91 | representative with exactly the original trace and a continuous monotone |
| 92 | parameter identification. Compactness is derived from that same trace. -/ |
| 93 | theorem exists_intrinsic_arcLength_minimizer |
| 94 | (g : RiemannianMetric 3 M) (U : TopologicalSpace.Opens M) |
| 95 | {γ : ℝ → M} (hγ : ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 3) 1 γ (Icc (0 : ℝ) 1)) |
| 96 | (hγU : MapsTo γ (Icc (0 : ℝ) 1) (U : Set M)) |
| 97 | (hmin : g.pathELength γ 0 1 = intrinsicEDist g (U : Set M) (γ 0) (γ 1)) |
| 98 | (hfinite : g.pathELength γ 0 1 ≠ ⊤) : |
| 99 | let L := (g.pathELength γ 0 1).toReal |
| 100 | ∃ η : ℝ → M, ∃ c : ℝ → ℝ, |
| 101 | η 0 = γ 0 ∧ η L = γ 1 ∧ ContinuousOn η (Icc 0 L) ∧ |
| 102 | MapsTo η (Icc 0 L) (U : Set M) ∧ |
| 103 | η '' Icc 0 L = γ '' Icc (0 : ℝ) 1 ∧ IsCompact (η '' Icc 0 L) ∧ |
| 104 | ContinuousOn c (Icc (0 : ℝ) 1) ∧ MonotoneOn c (Icc (0 : ℝ) 1) ∧ |
| 105 | c 0 = 0 ∧ c 1 = L ∧ c '' Icc (0 : ℝ) 1 = Icc 0 L ∧ |
| 106 | (∀ t ∈ Icc (0 : ℝ) 1, η (c t) = γ t) ∧ |
| 107 | ∀ s ∈ Icc 0 L, ∀ t ∈ Icc 0 L, |
| 108 | intrinsicEDist g (U : Set M) (η s) (η t) = ENNReal.ofReal |s - t| := by |
| 109 | classical |
| 110 | let gU := intrinsicOpenMetric g U |
| 111 | let : LocallyCompactSpace U := ChartedSpace.locallyCompactSpace |
| 112 | (EuclideanSpace ℝ (Fin 3)) U |
| 113 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : U → Type _) := |
| 114 | ⟨gU.toRiemannianMetric⟩ |
| 115 | let : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin 3)) |
| 116 | (TangentSpace (𝓡 3) : U → Type _) := |
| 117 | ⟨⟨gU.inner, gU.toContinuousRiemannianMetric.continuous, fun _ _ _ => rfl⟩⟩ |
| 118 | let : EMetricSpace U := EMetricSpace.ofRiemannianMetric (𝓡 3) U |
| 119 | obtain ⟨τ, hτ, hread, hτlength⟩ := |
| 120 | exists_intrinsicOpenMetric_path_lift g U zero_le_one hγ hγU |
| 121 | let K : Set U := τ '' Icc (0 : ℝ) 1 |
| 122 | have hprefix {t : ℝ} (ht : t ∈ Icc (0 : ℝ) 1) : |
| 123 | gU.edist (τ 0) (τ t) ≠ ⊤ := by |
| 124 | apply ne_top_of_le_ne_top _ (gU.edist_le_pathELength_of_mem_Icc hτ ht) |
| 125 | simpa only [gU, hτlength] using hfinite |
| 126 | have hfiniteK (x y : K) : EDist.edist x y ≠ ⊤ := by |
| 127 | obtain ⟨s, hs, hxs⟩ := x.property |
| 128 | obtain ⟨t, ht, hyt⟩ := y.property |
| 129 | apply ne_top_of_le_ne_top _ (edist_triangle x.val (τ 0) y.val) |
| 130 | apply ENNReal.add_ne_top.mpr |
| 131 | constructor |
| 132 | · rw [edist_comm, ← hxs] |
| 133 | exact hprefix hs |
| 134 | · rw [← hyt] |
| 135 | exact hprefix ht |
| 136 | let : MetricSpace K := EMetricSpace.toMetricSpace hfiniteK |
| 137 | let σ (t : ℝ) : K := |
| 138 | ⟨τ (projIcc 0 1 zero_le_one t), |
| 139 | ⟨projIcc 0 1 zero_le_one t, (projIcc 0 1 zero_le_one t).property, rfl⟩⟩ |
| 140 | have hσ {t : ℝ} (ht : t ∈ Icc (0 : ℝ) 1) : (σ t).val = τ t := by |
| 141 | simp only [σ, projIcc_of_mem zero_le_one ht] |
| 142 | have hc : ContinuousOn σ (Icc (0 : ℝ) 1) := by |
| 143 | apply Continuous.continuousOn |
| 144 | apply Continuous.subtype_mk |
| 145 | exact hτ.continuousOn.domRestrict.comp continuous_projIcc |
| 146 | have hvar : eVariationOn σ (Icc (0 : ℝ) 1) ≤ g.pathELength γ 0 1 := by |
| 147 | rw [← hτlength] |
| 148 | apply gU.eVariationOn_le_pathELength_of_edist_le hτ |
| 149 | intro s hs t ht |
| 150 | change gU.edist (σ s).val (σ t).val ≤ gU.edist (τ s) (τ t) |
| 151 | rw [hσ hs, hσ ht] |
| 152 | have hendpoint : edist (σ 0) (σ 1) = g.pathELength γ 0 1 := by |
| 153 | have hread0 : (τ 0 : M) = γ 0 := hread (by norm_num) |
| 154 | have hread1 : (τ 1 : M) = γ 1 := hread (by norm_num) |
| 155 | change gU.edist (σ 0).val (σ 1).val = _ |
| 156 | rw [hσ (by norm_num), hσ (by norm_num), |
| 157 | intrinsicOpenMetric_edist g U, hread0, hread1, hmin] |
| 158 | have hvariation : eVariationOn σ (Icc (0 : ℝ) 1) = edist (σ 0) (σ 1) := by |
| 159 | apply le_antisymm |
| 160 | · simpa only [hendpoint] using hvar |
| 161 | · exact eVariationOn.edist_le σ (by norm_num) (by norm_num) |
| 162 | obtain ⟨η, c, hη0, hη1, hηcont, hηimage, hccont, hcmono, |
| 163 | hc0, hc1, hcimage, hηread, hηdist⟩ := exists_isometric_arcLength_with_clock hc hvariation |
| 164 | have hL : dist (σ 0) (σ 1) = (g.pathELength γ 0 1).toReal := by |
| 165 | rw [dist_edist, hendpoint] |
| 166 | rw [hL] at hη1 hηcont hηimage hc1 hcimage hηdist |
| 167 | let ηM (t : ℝ) : M := ((η t).val : M) |
| 168 | have hσread {t : ℝ} (ht : t ∈ Icc (0 : ℝ) 1) : |
| 169 | ((σ t).val : M) = γ t := by |
| 170 | rw [hσ ht] |
| 171 | exact hread ht |
| 172 | have himage : ηM '' Icc 0 (g.pathELength γ 0 1).toReal = γ '' Icc (0 : ℝ) 1 := by |
| 173 | calc |
| 174 | ηM '' Icc 0 (g.pathELength γ 0 1).toReal = |
| 175 | (fun x : K => (x.val : M)) '' (η '' Icc 0 (g.pathELength γ 0 1).toReal) := |
| 176 | (Set.image_image (fun x : K => (x.val : M)) η _).symm |
| 177 | _ = (fun x : K => (x.val : M)) '' (σ '' Icc (0 : ℝ) 1) := by rw [hηimage] |
| 178 | _ = (fun t => ((σ t).val : M)) '' Icc (0 : ℝ) 1 := Set.image_image _ _ _ |
| 179 | _ = γ '' Icc (0 : ℝ) 1 := image_congr (fun t ht => hσread ht) |
| 180 | refine ⟨ηM, c, ?_, ?_, ?_, ?_, himage, ?_, hccont, hcmono, |
| 181 | hc0, hc1, hcimage, ?_, ?_⟩ |
| 182 | · exact (congrArg (fun x : K => (x.val : M)) hη0).trans (hσread (by norm_num)) |
| 183 | · exact (congrArg (fun x : K => (x.val : M)) hη1).trans (hσread (by norm_num)) |
| 184 | · exact continuous_subtype_val.comp_continuousOn |
| 185 | (continuous_subtype_val.comp_continuousOn hηcont) |
| 186 | · exact fun t _ => (η t).val.property |
| 187 | · rw [himage] |
| 188 | exact isCompact_Icc.image_of_continuousOn hγ.continuousOn |
| 189 | · intro t ht |
| 190 | exact (congrArg (fun x : K => (x.val : M)) (hηread t ht)).trans (hσread ht) |
| 191 | · intro s hs t ht |
| 192 | rw [← intrinsicOpenMetric_edist g U (η s).val (η t).val] |
| 193 | change edist (η s) (η t) = _ |
| 194 | rw [edist_dist, hηdist s hs t ht] |
| 195 | |
| 196 | end PoincareMT.M28 |