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.Soliton.ThreeDimensional.Noncompact.Rigidity.Levels.Graph.Component |
| 2 | import PoincareLib.Geometry.RicciFlow.Soliton.ThreeDimensional.Noncompact.Rigidity.Levels.MetricExpansion.Global |
| 3 | import PoincareLib.Geometry.RicciFlow.Soliton.ThreeDimensional.Noncompact.Rigidity.Levels.Transport.Diffeomorph |
| 4 | import PoincareLib.Geometry.RicciFlow.Soliton.ThreeDimensional.Noncompact.Rigidity.Levels.AreaConvergence |
| 5 | import PoincareLib.Geometry.Riemannian.Metric.Diffeomorph |
| 6 | import PoincareLib.Geometry.Riemannian.Metric.Induced.Immersion |
| 7 | |
| 8 | /-! |
| 9 | # Comparison of compact parametrized potential components |
| 10 | |
| 11 | Injective immersed compact connected level surfaces fill their components. |
| 12 | A common point after normalized-gradient transport identifies these components |
| 13 | and constructs a diffeomorphism of their parametrizations. Metric expansion |
| 14 | then compares their intrinsic areas. |
| 15 | -/ |
| 16 | |
| 17 | noncomputable section |
| 18 | set_option autoImplicit false |
| 19 | set_option backward.isDefEq.respectTransparency false |
| 20 | set_option maxSynthPendingDepth 8 |
| 21 | open Set Function Filter TopologicalSpace MeasureTheory |
| 22 | open Poincare.Geometry.Manifold.RegularLevel |
| 23 | open scoped Manifold ContDiff Topology |
| 24 | |
| 25 | namespace Poincare.Manifold |
| 26 | |
| 27 | private theorem contMDiff_lift_of_injective_localDiffeomorph |
| 28 | {n : ℕ} {N P L : Type*} [TopologicalSpace N] [TopologicalSpace P] [TopologicalSpace L] |
| 29 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) N] |
| 30 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) P] |
| 31 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) L] |
| 32 | {F : N → L} {G : P → L} {e : N → P} |
| 33 | (hF : ContMDiff (𝓡 n) (𝓡 n) ∞ F) |
| 34 | (hG : IsLocalDiffeomorph (𝓡 n) (𝓡 n) ∞ G) (hGi : Injective G) |
| 35 | (he : ∀ x, G (e x) = F x) : ContMDiff (𝓡 n) (𝓡 n) ∞ e := by |
| 36 | intro x |
| 37 | have hloc := hG (e x) |
| 38 | have hi : ContMDiffAt (𝓡 n) (𝓡 n) ∞ hloc.localInverse (F x) := by |
| 39 | rw [← he x] |
| 40 | exact hloc.localInverse_contMDiffAt |
| 41 | apply (hi.comp x (hF x)).congr_of_eventuallyEq |
| 42 | have hn := hloc.localInverse_eventuallyEq_right |
| 43 | rw [he x] at hn |
| 44 | filter_upwards [(hF x).continuousAt.tendsto.eventually hn] with y hy |
| 45 | apply hGi |
| 46 | exact (he y).trans hy.symm |
| 47 | |
| 48 | /-- Injective local diffeomorphisms with the same range identify their |
| 49 | domains by a genuine diffeomorphism. -/ |
| 50 | theorem exists_diffeomorph_of_injective_localDiffeomorph_same_range |
| 51 | {n : ℕ} {N P L : Type*} [TopologicalSpace N] [TopologicalSpace P] [TopologicalSpace L] |
| 52 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) N] |
| 53 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) P] |
| 54 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) L] |
| 55 | {F : N → L} {G : P → L} |
| 56 | (hF : IsLocalDiffeomorph (𝓡 n) (𝓡 n) ∞ F) |
| 57 | (hG : IsLocalDiffeomorph (𝓡 n) (𝓡 n) ∞ G) |
| 58 | (hFi : Injective F) (hGi : Injective G) (hrange : range F = range G) : |
| 59 | ∃ e : N ≃ₘ⟮𝓡 n, 𝓡 n⟯ P, ∀ x, G (e x) = F x := by |
| 60 | classical |
| 61 | have hpre (x : N) : ∃ y : P, G y = F x := by |
| 62 | apply mem_range.mp |
| 63 | rw [← hrange] |
| 64 | exact mem_range_self x |
| 65 | choose e he using hpre |
| 66 | have hbij : Bijective e := by |
| 67 | constructor |
| 68 | · intro x y hxy |
| 69 | apply hFi |
| 70 | rw [← he x, ← he y, hxy] |
| 71 | · intro y |
| 72 | have hy : G y ∈ range F := hrange ▸ mem_range_self y |
| 73 | obtain ⟨x, hx⟩ := hy |
| 74 | exact ⟨x, hGi ((he x).trans hx)⟩ |
| 75 | let E := Equiv.ofBijective e hbij |
| 76 | have hEs : ContMDiff (𝓡 n) (𝓡 n) ∞ E := |
| 77 | contMDiff_lift_of_injective_localDiffeomorph hF.contMDiff hG hGi he |
| 78 | have hEinv : ∀ y, F (E.symm y) = G y := by |
| 79 | intro y |
| 80 | rw [← he (E.symm y)] |
| 81 | exact congrArg G (E.apply_symm_apply y) |
| 82 | exact ⟨{ E with |
| 83 | contMDiff_toFun := hEs |
| 84 | contMDiff_invFun := contMDiff_lift_of_injective_localDiffeomorph |
| 85 | hG.contMDiff hF hFi hEinv }, he⟩ |
| 86 | |
| 87 | private theorem range_eq_component_of_compact_localDiffeomorph |
| 88 | {n : ℕ} {N L : Type*} [TopologicalSpace N] [TopologicalSpace L] |
| 89 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) N] |
| 90 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) L] |
| 91 | [CompactSpace N] [ConnectedSpace N] [T2Space L] |
| 92 | {F : N → L} (hF : IsLocalDiffeomorph (𝓡 n) (𝓡 n) ∞ F) (x : N) : |
| 93 | range F = connectedComponent (F x) := by |
| 94 | have hc := hF.contMDiff.continuous |
| 95 | have hclopen : IsClopen (range F) := ⟨(isCompact_range hc).isClosed, hF.isOpen_range⟩ |
| 96 | exact (isPreconnected_range hc).subset_connectedComponent (mem_range_self x) |
| 97 | |>.antisymm (hclopen.connectedComponent_subset (mem_range_self x)) |
| 98 | |
| 99 | end Poincare.Manifold |
| 100 | |
| 101 | namespace PoincareMT.RiemannianMetric |
| 102 | |
| 103 | /-- A diffeomorphism expanding quadratic forms compares total areas of |
| 104 | compact surfaces. The comparison follows through the actual pullback metric. -/ |
| 105 | theorem area_le_of_diffeomorph_expands_metric |
| 106 | {N P : Type*} [TopologicalSpace N] [TopologicalSpace P] [T3Space N] [T3Space P] |
| 107 | [MeasurableSpace N] [BorelSpace N] [MeasurableSpace P] [BorelSpace P] |
| 108 | [ChartedSpace (EuclideanSpace ℝ (Fin 2)) N] |
| 109 | [ChartedSpace (EuclideanSpace ℝ (Fin 2)) P] |
| 110 | [IsManifold (𝓡 2) ∞ N] [IsManifold (𝓡 2) ∞ P] [CompactSpace N] [CompactSpace P] |
| 111 | (gN : RiemannianMetric 2 N) (gP : RiemannianMetric 2 P) |
| 112 | (e : N ≃ₘ⟮𝓡 2, 𝓡 2⟯ P) |
| 113 | (hmetric : ∀ x (v : TangentSpace (𝓡 2) x), gN.inner x v v ≤ |
| 114 | gP.inner (e x) (mfderiv (𝓡 2) (𝓡 2) e x v) (mfderiv (𝓡 2) (𝓡 2) e x v)) : |
| 115 | gN.volumeMeasure.real univ ≤ gP.volumeMeasure.real univ := by |
| 116 | let h : RiemannianMetric 2 N := Induced.pullbackMetric gP e e.contMDiff |
| 117 | (fun x => (e.isLocalDiffeomorph x).mfderivToContinuousLinearEquiv (by simp) |>.injective) |
| 118 | have harea := h.area_le_of_quadraticForm_le gN (by norm_num : (0 : ℝ) < 1) |
| 119 | (fun x v => by |
| 120 | change gN.inner x v v ≤ 1 * gP.inner (e x) |
| 121 | (mfderiv (𝓡 2) (𝓡 2) e x v) (mfderiv (𝓡 2) (𝓡 2) e x v) |
| 122 | simpa only [one_mul] using hmetric x v) |
| 123 | have hvol := volumeMeasure_image_diffeomorph h gP e (fun _ _ _ => rfl) univ |
| 124 | have heuniv : (e : N → P) '' univ = univ := |
| 125 | image_univ_of_surjective (show Surjective (e : N → P) from e.surjective) |
| 126 | rw [heuniv] at hvol |
| 127 | simpa only [one_mul, Measure.real, ← hvol] using harea |
| 128 | |
| 129 | end PoincareMT.RiemannianMetric |
| 130 | |
| 131 | namespace PoincareMT.LeviCivitaData |
| 132 | |
| 133 | variable {M N P : Type*} [TopologicalSpace M] [TopologicalSpace N] [TopologicalSpace P] |
| 134 | [T2Space M] [T3Space N] [T3Space P] |
| 135 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 136 | [ChartedSpace (EuclideanSpace ℝ (Fin 2)) N] |
| 137 | [ChartedSpace (EuclideanSpace ℝ (Fin 2)) P] |
| 138 | [IsManifold (𝓡 3) ∞ M] [IsManifold (𝓡 2) ∞ N] [IsManifold (𝓡 2) ∞ P] |
| 139 | [CompactSpace N] [ConnectedSpace N] [CompactSpace P] [ConnectedSpace P] |
| 140 | {g : RiemannianMetric 3 M} |
| 141 | |
| 142 | omit [T3Space N] [T3Space P] in |
| 143 | /-- Two compact connected injective level immersions meeting at a point |
| 144 | after normalized transport are diffeomorphic by that actual transport. -/ |
| 145 | theorem exists_diffeomorph_between_transported_level_parametrizations |
| 146 | (D : LeviCivitaData g) {f : M → ℝ} |
| 147 | (hf : ContMDiff (𝓡 3) 𝓘(ℝ, ℝ) ∞ f) {a : ℝ} |
| 148 | (ha : ∀ y, a < f y → 1 ≤ g.inner y (D.gradient f y) (D.gradient f y)) |
| 149 | {Φ : ℝ → M → M} (h0 : ∀ x, Φ 0 x = x) |
| 150 | (hΦ : ∀ x, IsMIntegralCurve (fun t => Φ t x) (D.boundedNormalizedGradient f)) |
| 151 | (hadd : ∀ s t x, Φ (s + t) x = Φ s (Φ t x)) |
| 152 | (hs : ContMDiff (𝓘(ℝ, ℝ).prod (𝓡 3)) (𝓡 3) ∞ (Function.uncurry Φ)) |
| 153 | {c d : ℝ} (hc : a < c) (hd : a < d) |
| 154 | (F : N → openLevelSet f (g.regularDomain hf) c) |
| 155 | (G : P → openLevelSet f (g.regularDomain hf) d) |
| 156 | (hF : ContMDiff (𝓡 2) (𝓡 3) ∞ (openLevelIncl f (g.regularDomain hf) c ∘ F)) |
| 157 | (hG : ContMDiff (𝓡 2) (𝓡 3) ∞ (openLevelIncl f (g.regularDomain hf) d ∘ G)) |
| 158 | (hFi : Injective F) (hGi : Injective G) |
| 159 | (hFd : ∀ x, Injective (mfderiv (𝓡 2) (𝓡 3) |
| 160 | (openLevelIncl f (g.regularDomain hf) c ∘ F) x)) |
| 161 | (hGd : ∀ x, Injective (mfderiv (𝓡 2) (𝓡 3) |
| 162 | (openLevelIncl f (g.regularDomain hf) d ∘ G) x)) |
| 163 | (x₀ : N) (y₀ : P) |
| 164 | (hbase : Φ (d - c) (openLevelIncl f (g.regularDomain hf) c (F x₀)) = |
| 165 | openLevelIncl f (g.regularDomain hf) d (G y₀)) : |
| 166 | ∃ e : N ≃ₘ⟮𝓡 2, 𝓡 2⟯ P, ∀ x, |
| 167 | openLevelIncl f (g.regularDomain hf) d (G (e x)) = |
| 168 | Φ (d - c) (openLevelIncl f (g.regularDomain hf) c (F x)) := by |
| 169 | let U := g.regularDomain hf |
| 170 | let hreg := g.regularDomain_regular hf |
| 171 | let : Fact (Module.finrank ℝ (EuclideanSpace ℝ (Fin 3)) = 2 + 1) := |
| 172 | ⟨finrank_euclideanSpace_fin⟩ |
| 173 | let := openLevelSetChartedSpace hf U hreg 2 c |
| 174 | let := openLevelSetChartedSpace hf U hreg 2 d |
| 175 | let := isManifold_openLevelSet hf U hreg 2 c |
| 176 | let := isManifold_openLevelSet hf U hreg 2 d |
| 177 | obtain ⟨eL, heL⟩ := D.exists_normalizedGradient_levelDiffeomorph hf ha h0 hΦ hadd hs hc hd |
| 178 | have hFl := Poincare.Manifold.isLocalDiffeomorph_into_level_of_ambient_immersion |
| 179 | hf U hreg c F hF hFd |
| 180 | have hGl := Poincare.Manifold.isLocalDiffeomorph_into_level_of_ambient_immersion |
| 181 | hf U hreg d G hG hGd |
| 182 | have hFt : IsLocalDiffeomorph (𝓡 2) (𝓡 2) ∞ (eL ∘ F) := |
| 183 | fun x => (hFl x).comp (𝓡 2) (openLevelSet f U d) (eL.isLocalDiffeomorph (F x)) |
| 184 | have hbase' : eL (F x₀) = G y₀ := by |
| 185 | apply (isEmbedding_openLevelIncl f U d).injective |
| 186 | exact (heL (F x₀)).trans hbase |
| 187 | have hrange : range (eL ∘ F) = range G := by |
| 188 | rw [Poincare.Manifold.range_eq_component_of_compact_localDiffeomorph hFt x₀, |
| 189 | Poincare.Manifold.range_eq_component_of_compact_localDiffeomorph hGl y₀] |
| 190 | exact congrArg connectedComponent hbase' |
| 191 | obtain ⟨e, he⟩ := Poincare.Manifold.exists_diffeomorph_of_injective_localDiffeomorph_same_range |
| 192 | hFt hGl (eL.injective.comp hFi) hGi hrange |
| 193 | exact ⟨e, fun x => (congrArg (openLevelIncl f U d) (he x)).trans (heL (F x))⟩ |
| 194 | |
| 195 | /-- The component diffeomorphism constructed from a shared transported |
| 196 | basepoint expands the actual induced metrics and hence compares their areas. -/ |
| 197 | theorem exists_area_nondecreasing_diffeomorph_between_transported_levels |
| 198 | [MeasurableSpace N] [BorelSpace N] [MeasurableSpace P] [BorelSpace P] |
| 199 | (D : LeviCivitaData g) {f : M → ℝ} |
| 200 | (hf : ContMDiff (𝓡 3) 𝓘(ℝ, ℝ) ∞ f) {a : ℝ} |
| 201 | (ha : ∀ y, a < f y → 1 ≤ g.inner y (D.gradient f y) (D.gradient f y)) |
| 202 | (hhess : ∀ y, a < f y → ∀ w : TangentSpace (𝓡 3) y, |
| 203 | mvfderiv (𝓡 3) f y w = 0 → 0 ≤ D.hessian f y w w) |
| 204 | {Φ : ℝ → M → M} (h0 : ∀ x, Φ 0 x = x) |
| 205 | (hΦ : ∀ x, IsMIntegralCurve (fun t => Φ t x) (D.boundedNormalizedGradient f)) |
| 206 | (hadd : ∀ s t x, Φ (s + t) x = Φ s (Φ t x)) |
| 207 | (hs : ContMDiff (𝓘(ℝ, ℝ).prod (𝓡 3)) (𝓡 3) ∞ (Function.uncurry Φ)) |
| 208 | {c d : ℝ} (hc : a < c) (hcd : c ≤ d) |
| 209 | (F : N → openLevelSet f (g.regularDomain hf) c) |
| 210 | (G : P → openLevelSet f (g.regularDomain hf) d) |
| 211 | (hF : ContMDiff (𝓡 2) (𝓡 3) ∞ (openLevelIncl f (g.regularDomain hf) c ∘ F)) |
| 212 | (hG : ContMDiff (𝓡 2) (𝓡 3) ∞ (openLevelIncl f (g.regularDomain hf) d ∘ G)) |
| 213 | (hFi : Injective F) (hGi : Injective G) |
| 214 | (hFd : ∀ x, Injective (mfderiv (𝓡 2) (𝓡 3) |
| 215 | (openLevelIncl f (g.regularDomain hf) c ∘ F) x)) |
| 216 | (hGd : ∀ x, Injective (mfderiv (𝓡 2) (𝓡 3) |
| 217 | (openLevelIncl f (g.regularDomain hf) d ∘ G) x)) |
| 218 | (gN : RiemannianMetric 2 N) (gP : RiemannianMetric 2 P) |
| 219 | (hN : ∀ x (v w : TangentSpace (𝓡 2) x), gN.inner x v w = |
| 220 | g.inner (openLevelIncl f (g.regularDomain hf) c (F x)) |
| 221 | (mfderiv (𝓡 2) (𝓡 3) (openLevelIncl f (g.regularDomain hf) c ∘ F) x v) |
| 222 | (mfderiv (𝓡 2) (𝓡 3) (openLevelIncl f (g.regularDomain hf) c ∘ F) x w)) |
| 223 | (hP : ∀ x (v w : TangentSpace (𝓡 2) x), gP.inner x v w = |
| 224 | g.inner (openLevelIncl f (g.regularDomain hf) d (G x)) |
| 225 | (mfderiv (𝓡 2) (𝓡 3) (openLevelIncl f (g.regularDomain hf) d ∘ G) x v) |
| 226 | (mfderiv (𝓡 2) (𝓡 3) (openLevelIncl f (g.regularDomain hf) d ∘ G) x w)) |
| 227 | (x₀ : N) (y₀ : P) |
| 228 | (hbase : Φ (d - c) (openLevelIncl f (g.regularDomain hf) c (F x₀)) = |
| 229 | openLevelIncl f (g.regularDomain hf) d (G y₀)) : |
| 230 | ∃ e : N ≃ₘ⟮𝓡 2, 𝓡 2⟯ P, |
| 231 | (∀ x, openLevelIncl f (g.regularDomain hf) d (G (e x)) = |
| 232 | Φ (d - c) (openLevelIncl f (g.regularDomain hf) c (F x))) ∧ |
| 233 | (∀ x (v : TangentSpace (𝓡 2) x), gN.inner x v v ≤ |
| 234 | gP.inner (e x) (mfderiv (𝓡 2) (𝓡 2) e x v) (mfderiv (𝓡 2) (𝓡 2) e x v)) ∧ |
| 235 | gN.volumeMeasure.real univ ≤ gP.volumeMeasure.real univ := by |
| 236 | obtain ⟨e, he⟩ := D.exists_diffeomorph_between_transported_level_parametrizations |
| 237 | hf ha h0 hΦ hadd hs hc (hc.trans_le hcd) F G hF hG hFi hGi hFd hGd x₀ y₀ hbase |
| 238 | let F₀ := openLevelIncl f (g.regularDomain hf) c ∘ F |
| 239 | let G₀ := openLevelIncl f (g.regularDomain hf) d ∘ G |
| 240 | have hFs : ContMDiff (𝓡 3) (𝓡 3) ∞ (Φ (d - c)) := |
| 241 | hs.comp (contMDiff_const.prodMk contMDiff_id) |
| 242 | have hmetric (x : N) (v : TangentSpace (𝓡 2) x) : gN.inner x v v ≤ |
| 243 | gP.inner (e x) (mfderiv (𝓡 2) (𝓡 2) e x v) (mfderiv (𝓡 2) (𝓡 2) e x v) := by |
| 244 | have hlevel : f ∘ F₀ = fun _ => c := funext (fun y => (F y).2) |
| 245 | have htan : mvfderiv (𝓡 3) f (F₀ x) (mfderiv (𝓡 2) (𝓡 3) F₀ x v) = 0 := by |
| 246 | have hd := mvfderiv_comp x ((hf _).mdifferentiableAt (by simp)) |
| 247 | ((hF x).mdifferentiableAt (by simp)) |
| 248 | rw [hlevel, mvfderiv_const] at hd |
| 249 | exact (congrArg (fun L => L v) hd).symm |
| 250 | have hexp := D.boundedNormalizedGradient_flow_expands_level_metric hf hs h0 hΦ ha hhess |
| 251 | (show a < f (F₀ x) by rw [show f (F₀ x) = c from (F x).2]; exact hc) |
| 252 | (mfderiv (𝓡 2) (𝓡 3) F₀ x v) htan (sub_nonneg.mpr hcd) |
| 253 | have hcomp : G₀ ∘ e = Φ (d - c) ∘ F₀ := funext he |
| 254 | have hd := mfderiv_comp x ((hFs _).mdifferentiableAt (by simp)) |
| 255 | ((hF x).mdifferentiableAt (by simp)) |
| 256 | rw [← hcomp, mfderiv_comp x ((hG _).mdifferentiableAt (by simp)) |
| 257 | ((e.contMDiff x).mdifferentiableAt (by simp))] at hd |
| 258 | have hv := congrArg (fun L => L v) hd |
| 259 | change mfderiv (𝓡 2) (𝓡 3) G₀ (e x) (mfderiv (𝓡 2) (𝓡 2) e x v) = |
| 260 | mfderiv (𝓡 3) (𝓡 3) (Φ (d - c)) (F₀ x) (mfderiv (𝓡 2) (𝓡 3) F₀ x v) at hv |
| 261 | have hpoint : G₀ (e x) = Φ (d - c) (F₀ x) := he x |
| 262 | rw [hN, hP] |
| 263 | change g.inner (F₀ x) (mfderiv (𝓡 2) (𝓡 3) F₀ x v) |
| 264 | (mfderiv (𝓡 2) (𝓡 3) F₀ x v) ≤ |
| 265 | g.inner (G₀ (e x)) |
| 266 | (mfderiv (𝓡 2) (𝓡 3) G₀ (e x) (mfderiv (𝓡 2) (𝓡 2) e x v)) |
| 267 | (mfderiv (𝓡 2) (𝓡 3) G₀ (e x) (mfderiv (𝓡 2) (𝓡 2) e x v)) |
| 268 | rw [hv, hpoint] |
| 269 | exact hexp |
| 270 | exact ⟨e, he, hmetric, gN.area_le_of_diffeomorph_expands_metric gP e hmetric⟩ |
| 271 | |
| 272 | end PoincareMT.LeviCivitaData |