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.ReducedGeometry.LGeometry.Regularity.EndpointExtensionGluing |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Regularity.ManifoldEndpointExtension |
| 3 | |
| 4 | /-! Adapted from Mapher `PoincareMT/Proofs/M08/ClosedPhaseAssembly.lean` at |
| 5 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. -/ |
| 6 | |
| 7 | |
| 8 | set_option autoImplicit false |
| 9 | set_option backward.isDefEq.respectTransparency false |
| 10 | |
| 11 | open Set Filter Topology |
| 12 | open scoped Manifold ContDiff Bundle |
| 13 | |
| 14 | universe u |
| 15 | |
| 16 | namespace PoincareMT.LGeometry |
| 17 | |
| 18 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 19 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 20 | |
| 21 | set_option maxHeartbeats 1000000 in |
| 22 | theorem exists_closedEuler_extension_of_phase_cover {J C U : Set ℝ} (F : RicciFlow n M J) |
| 23 | (hM04 : RicciFlowCurvatureTheory.{u}) (T : ℝ) |
| 24 | (hCclosed : IsClosed C) (hC : UniqueDiffOn ℝ C) (hU : IsOpen U) (hCU : C ⊆ U) |
| 25 | (γ α : ℝ → M) (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α U) |
| 26 | (hαγ : EqOn α γ C) (htime : ∀ r ∈ C, T - r ^ 2 ∈ J) |
| 27 | (hcover : ∀ s ∈ C, ∃ (a b : ℝ) (x : M) (Pbar : ℝ → EuclideanSpace ℝ (Fin n)), |
| 28 | a < b ∧ s ∈ Icc a b ∧ Icc a b ⊆ C ∧ Icc a b ∈ 𝓝[C] s ∧ |
| 29 | MapsTo γ (Icc a b) (chartAt (EuclideanSpace ℝ (Fin n)) x).source ∧ |
| 30 | ∀ r ∈ Icc a b, HasDerivWithinAt |
| 31 | (fun t ↦ (extChartAt (𝓡 n) x (γ t), Pbar t)) |
| 32 | (closedChartEulerPhase F T x (Icc a b) r (extChartAt (𝓡 n) x (γ r), Pbar r)) |
| 33 | (Icc a b) r) : |
| 34 | ∃ E : ParametricAlongCurveExtensionOn C α (curveVelocityWithin (n := n) α C), |
| 35 | ∀ s ∈ C, regularizedLGeodesicEquation F T α C E s := by |
| 36 | apply exists_closedEuler_extension_of_local F T hCclosed hC hU hCU α hα |
| 37 | intro s hs |
| 38 | obtain ⟨a, b, x, Pbar, hab, hsab, habC, hnear, hsrcγ, hphase⟩ := hcover s hs |
| 39 | let V := U ∩ α ⁻¹' (chartAt (EuclideanSpace ℝ (Fin n)) x).source |
| 40 | have hV : IsOpen V := hα.continuousOn.isOpen_inter_preimage hU |
| 41 | (chartAt (EuclideanSpace ℝ (Fin n)) x).open_source |
| 42 | have hVU : V ⊆ U := inter_subset_left |
| 43 | have habV : Icc a b ⊆ V := by |
| 44 | intro r hr |
| 45 | refine ⟨hCU (habC hr), ?_⟩ |
| 46 | change α r ∈ (chartAt (EuclideanSpace ℝ (Fin n)) x).source |
| 47 | rw [hαγ (habC hr)] |
| 48 | exact hsrcγ hr |
| 49 | have hαV := hα.mono hVU |
| 50 | have hsrcα : MapsTo α V (chartAt (EuclideanSpace ℝ (Fin n)) x).source := |
| 51 | fun r hr ↦ hr.2 |
| 52 | let e := extChartAt (𝓡 n) x |
| 53 | have htarget : MapsTo (e ∘ γ) (Icc a b) e.target := by |
| 54 | intro r hr |
| 55 | apply e.map_source |
| 56 | simpa only [e, extChartAt_source] using hsrcγ hr |
| 57 | have hmomentum := closed_phase_momentum_of_eqOn F T x hV habV (uniqueDiffOn_Icc hab) |
| 58 | (e ∘ γ) (e ∘ α) Pbar (chart_curve_contDiffOn x α hαV hsrcα) |
| 59 | (fun r hr ↦ congrArg e (hαγ (habC hr))) htarget hphase |
| 60 | let E := chartVelocityExtension hV x α hαV hsrcα |
| 61 | have heq (r : ℝ) (hr : r ∈ Icc a b) : regularizedLGeodesicEquation F T α V E r := by |
| 62 | intro W |
| 63 | have h := closed_chart_momentum_regularized_equation F hM04 T hV habV |
| 64 | (uniqueDiffOn_Icc hab) x α hαV hsrcα (fun t ht ↦ htime t (habC ht)) hr |
| 65 | (hmomentum r hr) W |
| 66 | unfold regularizedEulerResidual pullbackCovariantDerivative chartVelocityExtensionWithin at h |
| 67 | rw [curveVelocityWithin_eq_of_uniqueDiff hV habV (uniqueDiffOn_Icc hab) α hαV hr] at h |
| 68 | exact h |
| 69 | obtain ⟨N, hN, hsN, hNC⟩ := mem_nhdsWithin.mp hnear |
| 70 | let W := V ∩ N |
| 71 | have hW : IsOpen W := hV.inter hN |
| 72 | have hWV : W ⊆ V := inter_subset_left |
| 73 | refine ⟨W, hW, ⟨habV hsab, hsN⟩, hWV.trans hVU, |
| 74 | restrictParametricVelocityExtension hV hWV hW.uniqueDiffOn α hαV E, ?_⟩ |
| 75 | intro r hr hrC |
| 76 | exact restrictParametricVelocityExtension_equation F T hV hWV hW.uniqueDiffOn α hαV E hr |
| 77 | (heq r (hNC ⟨hr.2, hrC⟩)) |
| 78 | |
| 79 | theorem nonempty_regularizedData_of_closed_phase_cover {J : Set ℝ} {F : RicciFlow n M J} |
| 80 | {T τ₁ τ₂ : ℝ} (hM04 : RicciFlowCurvatureTheory.{u}) (p : BackwardTimePath F T τ₁ τ₂) |
| 81 | (hsmooth : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ (squareReparameterizedCurve p.curve) |
| 82 | (sqrtParameterInterval τ₁ τ₂)) |
| 83 | (hcover : ∀ s ∈ sqrtParameterInterval τ₁ τ₂, |
| 84 | ∃ (a b : ℝ) (x : M) (Pbar : ℝ → EuclideanSpace ℝ (Fin n)), |
| 85 | a < b ∧ s ∈ Icc a b ∧ Icc a b ⊆ sqrtParameterInterval τ₁ τ₂ ∧ |
| 86 | Icc a b ∈ 𝓝[sqrtParameterInterval τ₁ τ₂] s ∧ |
| 87 | MapsTo (squareReparameterizedCurve p.curve) (Icc a b) |
| 88 | (chartAt (EuclideanSpace ℝ (Fin n)) x).source ∧ |
| 89 | ∀ r ∈ Icc a b, HasDerivWithinAt |
| 90 | (fun t ↦ (extChartAt (𝓡 n) x (p.curve (t ^ 2)), Pbar t)) |
| 91 | (closedChartEulerPhase F T x (Icc a b) r |
| 92 | (extChartAt (𝓡 n) x (p.curve (r ^ 2)), Pbar r)) (Icc a b) r) : |
| 93 | Nonempty (RegularizedLGeodesicData p) := by |
| 94 | have hab : Real.sqrt τ₁ < Real.sqrt τ₂ := |
| 95 | Real.sqrt_lt_sqrt p.nonnegative p.ordered |
| 96 | obtain ⟨α, U, hU, hCU, hα, hαγ⟩ := exists_smooth_manifold_extension_Icc hab |
| 97 | (squareReparameterizedCurve p.curve) hsmooth |
| 98 | have htime (r : ℝ) (hr : r ∈ sqrtParameterInterval τ₁ τ₂) : T - r ^ 2 ∈ J := by |
| 99 | apply p.time_mem |
| 100 | have hr0 : 0 ≤ r := (Real.sqrt_nonneg τ₁).trans hr.1 |
| 101 | constructor |
| 102 | · nlinarith [Real.sq_sqrt p.nonnegative, Real.sqrt_nonneg τ₁, hr.1] |
| 103 | · nlinarith [Real.sq_sqrt (p.nonnegative.trans p.ordered.le), Real.sqrt_nonneg τ₂, hr.2] |
| 104 | obtain ⟨E, hE⟩ := exists_closedEuler_extension_of_phase_cover F hM04 T isClosed_Icc |
| 105 | (uniqueDiffOn_Icc hab) hU hCU (squareReparameterizedCurve p.curve) α hα hαγ htime hcover |
| 106 | exact ⟨⟨⟨α, U, hU, hCU, hα, hαγ⟩, E, hE⟩⟩ |
| 107 | |
| 108 | end PoincareMT.LGeometry |