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.Surgery.Metric.Distance.MetricComparison |
| 2 | import PoincareLib.Geometry.Riemannian.Normalization.Scaling.Distance |
| 3 | import PoincareLib.Geometry.Riemannian.Normalization.Scaling.Geometry |
| 4 | import PoincareLib.Geometry.RicciFlow.Surgery.Comparison.Distance.LengthLocalToGlobal |
| 5 | /-! |
| 6 | # Local path estimates for the comparison map |
| 7 | |
| 8 | Morgan--Tian Proposition 15.12, p. 365, and Claim 18.22, p. 433. The |
| 9 | published local surgery path estimates are applied to a constant rescaling |
| 10 | of the source metric. No new local surgery result is chosen and no MetricSurgery |
| 11 | theorem service is assumed. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open scoped Manifold ContDiff Bundle ENNReal Topology |
| 17 | |
| 18 | universe u v w |
| 19 | |
| 20 | namespace PoincareMT.SurgeryComparison |
| 21 | |
| 22 | variable {X : Type u} {Y : Type v} [TopologicalSpace X] [TopologicalSpace Y] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) X] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) Y] |
| 25 | [IsManifold (𝓡 3) ∞ X] [IsManifold (𝓡 3) ∞ Y] |
| 26 | |
| 27 | /-- A confined C1 path on any ordered interval bounds intrinsic distance. |
| 28 | The affine reparametrization uses the exact path class in the frozen |
| 29 | definition, as required by the local collapse estimate of Theorem 13.2. -/ |
| 30 | theorem intrinsicEDist_le_pathELength |
| 31 | (g : RiemannianMetric 3 X) {U : Set X} {γ : ℝ → X} |
| 32 | {a b : ℝ} (hab : a ≤ b) |
| 33 | (hγ : ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 3) 1 γ (Set.Icc a b)) |
| 34 | (hU : Set.MapsTo γ (Set.Icc a b) U) : |
| 35 | intrinsicEDist g U (γ a) (γ b) ≤ g.pathELength γ a b := by |
| 36 | let r : ℝ →ᴬ[ℝ] ℝ := ContinuousAffineMap.lineMap a b |
| 37 | have hrange : Set.MapsTo r (Set.Icc 0 1) (Set.Icc a b) := by |
| 38 | rw [Set.mapsTo_iff_image_subset, show (r : ℝ → ℝ) = AffineMap.lineMap a b from rfl, |
| 39 | ← segment_eq_image_lineMap, segment_eq_Icc hab] |
| 40 | have hcomp : ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 3) 1 (γ ∘ r) (Set.Icc 0 1) := |
| 41 | hγ.comp r.contDiff.contMDiff.contMDiffOn hrange |
| 42 | have hlength : g.pathELength (γ ∘ r) 0 1 = g.pathELength γ a b := by |
| 43 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : X → Type _) := |
| 44 | ⟨g.toRiemannianMetric⟩ |
| 45 | change Manifold.pathELength (𝓡 3) (γ ∘ r) 0 1 = |
| 46 | Manifold.pathELength (𝓡 3) γ a b |
| 47 | have h := Manifold.pathELength_comp_of_monotoneOn (I := 𝓡 3) |
| 48 | (γ := γ) (f := r) zero_le_one |
| 49 | ((AffineMap.lineMap_mono hab).monotoneOn (Set.Icc 0 1)) |
| 50 | r.differentiableOn |
| 51 | (by simpa [r, ContinuousAffineMap.coe_lineMap_eq] using |
| 52 | hγ.mdifferentiableOn one_ne_zero) |
| 53 | simpa [r, ContinuousAffineMap.coe_lineMap_eq] using h |
| 54 | apply sInf_le |
| 55 | refine ⟨γ ∘ r, hcomp, ?_, ?_, Set.mapsTo_iff_image_subset.mp (hU.comp hrange), |
| 56 | hlength.symm⟩ |
| 57 | · simp [r, ContinuousAffineMap.coe_lineMap_eq] |
| 58 | · simp [r, ContinuousAffineMap.coe_lineMap_eq] |
| 59 | |
| 60 | /-- A quadratic pullback bound compares the actual derivative-integral |
| 61 | lengths, including paths restricted to a neck (Theorem 13.2, pp. 331-334, |
| 62 | and Proposition 15.12, p. 365). -/ |
| 63 | theorem pathELength_comp_le_mul |
| 64 | (g : RiemannianMetric 3 X) (h : RiemannianMetric 3 Y) |
| 65 | {f : X → Y} {U : Set X} {C : ℝ} (hC : 0 < C) |
| 66 | (hf : ∀ x ∈ U, ContMDiffAt (𝓡 3) (𝓡 3) ∞ f x) |
| 67 | (hmetric : ∀ x ∈ U, ∀ v : TangentSpace (𝓡 3) x, |
| 68 | h.inner (f x) (mfderiv (𝓡 3) (𝓡 3) f x v) |
| 69 | (mfderiv (𝓡 3) (𝓡 3) f x v) ≤ C ^ 2 * g.inner x v v) |
| 70 | {γ : ℝ → X} {a b : ℝ} |
| 71 | (hγ : ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 3) 1 γ (Set.Icc a b)) |
| 72 | (hU : Set.MapsTo γ (Set.Icc a b) U) : |
| 73 | h.pathELength (f ∘ γ) a b ≤ ENNReal.ofReal C * g.pathELength γ a b := by |
| 74 | have hb := MetricSurgery.pathELength_comp_le_of_pullback_bound |
| 75 | (rescaledMetric g (C ^ 2) (sq_pos_of_pos hC)) h hf hmetric hγ |
| 76 | (Set.mapsTo_iff_image_subset.mp hU) |
| 77 | rwa [rescaledMetric_pathELength, Real.sqrt_sq hC.le] at hb |
| 78 | |
| 79 | /-- A quadratic pullback estimate bounds the image endpoint distance by |
| 80 | the source path length, with the square-root factor required by Claim |
| 81 | 18.22, Morgan--Tian p. 433. -/ |
| 82 | theorem edist_comp_le_mul_pathELength |
| 83 | (g : RiemannianMetric 3 X) (h : RiemannianMetric 3 Y) |
| 84 | {f : X → Y} {U : Set X} {C : ℝ} (hC : 0 < C) |
| 85 | (hf : ∀ x ∈ U, ContMDiffAt (𝓡 3) (𝓡 3) ∞ f x) |
| 86 | (hmetric : ∀ x ∈ U, ∀ v : TangentSpace (𝓡 3) x, |
| 87 | h.inner (f x) (mfderiv (𝓡 3) (𝓡 3) f x v) |
| 88 | (mfderiv (𝓡 3) (𝓡 3) f x v) ≤ C ^ 2 * g.inner x v v) |
| 89 | {γ : ℝ → X} {a b : ℝ} (hab : a ≤ b) |
| 90 | (hγ : ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 3) 1 γ (Set.Icc a b)) |
| 91 | (hU : Set.MapsTo γ (Set.Icc a b) U) : |
| 92 | h.edist (f (γ a)) (f (γ b)) ≤ ENNReal.ofReal C * g.pathELength γ a b := by |
| 93 | have hb := MetricSurgery.edist_comp_le_pathELength_of_pullback_bound |
| 94 | (rescaledMetric g (C ^ 2) (sq_pos_of_pos hC)) h hf hmetric hab hγ |
| 95 | (Set.mapsTo_iff_image_subset.mp hU) |
| 96 | rwa [rescaledMetric_pathELength, Real.sqrt_sq hC.le] at hb |
| 97 | |
| 98 | /-- A static intrinsic-distance bound after a smooth coordinate map gives |
| 99 | a source path bound. The nonsmooth local collapse of Theorem 13.2 is |
| 100 | handled entirely by its distance inequality; Proposition 15.12, p. 365. -/ |
| 101 | theorem edist_comp_le_mul_pathELength_of_intrinsic_bound |
| 102 | {Z : Type w} [TopologicalSpace Z] |
| 103 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) Z] [IsManifold (𝓡 3) ∞ Z] |
| 104 | (g : RiemannianMetric 3 X) (h : RiemannianMetric 3 Y) |
| 105 | (k : RiemannianMetric 3 Z) {f : X → Y} {c : Y → Z} |
| 106 | {U : Set X} {V : Set Y} {C : ℝ} (hC : 0 < C) |
| 107 | (hf : ∀ x ∈ U, ContMDiffAt (𝓡 3) (𝓡 3) ∞ f x) |
| 108 | (hmetric : ∀ x ∈ U, ∀ v : TangentSpace (𝓡 3) x, |
| 109 | h.inner (f x) (mfderiv (𝓡 3) (𝓡 3) f x v) |
| 110 | (mfderiv (𝓡 3) (𝓡 3) f x v) ≤ C ^ 2 * g.inner x v v) |
| 111 | (hfV : Set.MapsTo f U V) |
| 112 | (hstatic : ∀ x ∈ V, ∀ y ∈ V, |
| 113 | k.edist (c x) (c y) ≤ intrinsicEDist h V x y) |
| 114 | {γ : ℝ → X} {a b : ℝ} (hab : a ≤ b) |
| 115 | (hγ : ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 3) 1 γ (Set.Icc a b)) |
| 116 | (hU : Set.MapsTo γ (Set.Icc a b) U) : |
| 117 | k.edist (c (f (γ a))) (c (f (γ b))) ≤ |
| 118 | ENNReal.ofReal C * g.pathELength γ a b := by |
| 119 | have hcomp : ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 3) 1 (f ∘ γ) (Set.Icc a b) := by |
| 120 | intro t ht |
| 121 | exact ((hf (γ t) (hU ht)).of_le (by simp)).comp_contMDiffWithinAt t (hγ t ht) |
| 122 | exact (hstatic _ (hfV (hU ⟨le_rfl, hab⟩)) _ (hfV (hU ⟨hab, le_rfl⟩))).trans |
| 123 | ((intrinsicEDist_le_pathELength h hab hcomp (hfV.comp hU)).trans |
| 124 | (pathELength_comp_le_mul g h hC hf hmetric hγ hU)) |
| 125 | |
| 126 | /-- A cover of local path bounds gives the global distance bound for the |
| 127 | explicit source and target metrics. The map can be nonsmooth on its |
| 128 | constant-tail boundary, as in Proposition 15.12, Morgan--Tian p. 365. -/ |
| 129 | theorem metric_edist_le_mul_of_open_cover [RegularSpace Y] |
| 130 | (g : RiemannianMetric 3 X) (h : RiemannianMetric 3 Y) |
| 131 | {ι : Type*} (U : ι → Set X) (hU : ∀ i, IsOpen (U i)) |
| 132 | (hcover : ∀ x, ∃ i, x ∈ U i) (f : X → Y) |
| 133 | {C : ℝ} (hC : 0 < C) |
| 134 | (hlocal : ∀ i, ∀ (γ : ℝ → X) (a b : ℝ), a ≤ b → |
| 135 | ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 3) 1 γ (Set.Icc a b) → |
| 136 | Set.MapsTo γ (Set.Icc a b) (U i) → |
| 137 | h.edist (f (γ a)) (f (γ b)) ≤ ENNReal.ofReal C * g.pathELength γ a b) |
| 138 | (x y : X) : h.edist (f x) (f y) ≤ ENNReal.ofReal C * g.edist x y := by |
| 139 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : X → Type _) := |
| 140 | ⟨g.toRiemannianMetric⟩ |
| 141 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : Y → Type _) := |
| 142 | ⟨h.toRiemannianMetric⟩ |
| 143 | let : IsContinuousRiemannianBundle (EuclideanSpace ℝ (Fin 3)) |
| 144 | (TangentSpace (𝓡 3) : Y → Type _) := |
| 145 | ⟨⟨h.inner, h.toContinuousRiemannianMetric.continuous, fun _ _ _ => rfl⟩⟩ |
| 146 | let : PseudoEMetricSpace Y := PseudoEMetricSpace.ofRiemannianMetric (𝓡 3) Y |
| 147 | exact Manifold.edist_le_mul_riemannianEDist_of_open_cover U hU hcover f |
| 148 | (ENNReal.ofReal_ne_zero_iff.mpr hC) ENNReal.ofReal_ne_top hlocal x y |
| 149 | |
| 150 | /-- A globally smooth pullback bound implies an ambient distance bound. |
| 151 | Applied to the event's local embedding and child inverse, this transports |
| 152 | the same local collapse estimate into the actual child (Proposition 15.12). -/ |
| 153 | theorem metric_edist_le_mul_of_pullback [RegularSpace Y] |
| 154 | (g : RiemannianMetric 3 X) (h : RiemannianMetric 3 Y) |
| 155 | {f : X → Y} {C : ℝ} (hC : 0 < C) |
| 156 | (hf : ContMDiff (𝓡 3) (𝓡 3) ∞ f) |
| 157 | (hmetric : ∀ x, ∀ v : TangentSpace (𝓡 3) x, |
| 158 | h.inner (f x) (mfderiv (𝓡 3) (𝓡 3) f x v) |
| 159 | (mfderiv (𝓡 3) (𝓡 3) f x v) ≤ C ^ 2 * g.inner x v v) |
| 160 | (x y : X) : h.edist (f x) (f y) ≤ ENNReal.ofReal C * g.edist x y := by |
| 161 | apply metric_edist_le_mul_of_open_cover g h (fun _ : Unit => Set.univ) |
| 162 | (fun _ => isOpen_univ) (fun _ => ⟨(), Set.mem_univ _⟩) f hC |
| 163 | intro _ γ a b hab hγ hU |
| 164 | exact edist_comp_le_mul_pathELength g h hC (fun z _ => hf z) |
| 165 | (fun z _ => hmetric z) hab hγ hU |
| 166 | |
| 167 | end PoincareMT.SurgeryComparison |