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.Continuation.ContinuationCurve |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Continuation.ContinuationEndpoint |
| 3 | |
| 4 | /-! Adapted from Mapher `PoincareMT/Proofs/M08/ContinuationPastEndpoint.lean` at |
| 5 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. -/ |
| 6 | |
| 7 | |
| 8 | set_option autoImplicit false |
| 9 | set_option backward.isDefEq.respectTransparency false |
| 10 | |
| 11 | noncomputable section |
| 12 | |
| 13 | open Set Filter Topology |
| 14 | open scoped Manifold ContDiff Bundle |
| 15 | |
| 16 | universe u |
| 17 | |
| 18 | namespace PoincareMT.LGeometry |
| 19 | |
| 20 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 21 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 22 | |
| 23 | set_option maxHeartbeats 1400000 in |
| 24 | theorem exists_continuation_past_positive_endpoint {J : Set ℝ} |
| 25 | (F : RicciFlow n M J) (hM04 : RicciFlowCurvatureTheory.{u}) (T : ℝ) |
| 26 | {a d b : ℝ} (ha : 0 < a) (had : a < d) (hdb : d < b) |
| 27 | (htime : ∀ s ∈ Ioo 0 b, T - s ^ 2 ∈ interior J) |
| 28 | (α β : ℝ → M) (hα : IsContinuationCurve F T α (Ioo a b)) |
| 29 | (hβα : EqOn β α (Ioi a)) (x : M) |
| 30 | (hsrc : MapsTo β (Icc a d) (chartAt (EuclideanSpace ℝ (Fin n)) x).source) |
| 31 | (Pbar : ℝ → EuclideanSpace ℝ (Fin n)) |
| 32 | (hphase : ∀ s ∈ Icc a d, HasDerivWithinAt |
| 33 | (fun r ↦ (extChartAt (𝓡 n) x (β r), Pbar r)) |
| 34 | (closedChartEulerPhase F T x (Icc a d) s (extChartAt (𝓡 n) x (β s), Pbar s)) |
| 35 | (Icc a d) s) : |
| 36 | ∃ e : ℝ, 0 ≤ e ∧ e < a ∧ ∃ δ : ℝ → M, |
| 37 | IsContinuationCurve F T δ (Ioo e b) ∧ EqOn δ α (Ioo a b) := by |
| 38 | classical |
| 39 | let chart := extChartAt (𝓡 n) x |
| 40 | let z := fun r ↦ (chart (β r), Pbar r) |
| 41 | have hab : a < b := had.trans hdb |
| 42 | have haC : a ∈ Icc a d := ⟨le_rfl, had.le⟩ |
| 43 | have htarget (r : ℝ) (hr : r ∈ Icc a d) : chart (β r) ∈ chart.target := by |
| 44 | apply chart.map_source |
| 45 | simpa only [chart, extChartAt_source] using hsrc hr |
| 46 | obtain ⟨ε, hε, γ, hWU, hγ, hγ₀, hγsrc⟩ := |
| 47 | exists_continuationCurve_from_phase F hM04 T x isOpen_Ioo htime |
| 48 | (show a ∈ Ioo 0 b from ⟨ha, hab⟩) (chart (β a)) (Pbar a) (htarget a haC) |
| 49 | let W := Ioo (a - 2 * ε) (a + 2 * ε) |
| 50 | have haW : a ∈ W := ⟨by linarith, by linarith⟩ |
| 51 | have htimeC (r : ℝ) (hr : r ∈ Icc a d) : T - r ^ 2 ∈ J := |
| 52 | interior_subset (htime r ⟨ha.trans_le hr.1, hr.2.trans_lt hdb⟩) |
| 53 | obtain ⟨k₀, hak₀, hk₀m⟩ := exists_between (lt_min had (show a < a + ε by linarith)) |
| 54 | have hk₀d : k₀ < d := hk₀m.trans_le (min_le_left d (a + ε)) |
| 55 | have hsmall : Icc a k₀ ⊆ Icc a d := Icc_subset_Icc_right hk₀d.le |
| 56 | have hsmallW : Icc a k₀ ⊆ W := by |
| 57 | intro r hr |
| 58 | have hk₀ε := hk₀m.trans_le (min_le_right d (a + ε)) |
| 59 | exact ⟨by linarith [hr.1], by linarith [hr.2]⟩ |
| 60 | let f := closedChartEulerPhase F T x univ |
| 61 | let w := continuationCurvePhase F T x γ |
| 62 | have hz (r : ℝ) (hr : r ∈ Icc a k₀) : |
| 63 | HasDerivWithinAt z (f r (z r)) (Icc a k₀) r := by |
| 64 | have h := (hphase r (hsmall hr)).mono hsmall |
| 65 | rw [closedChartEulerPhase_eq_univ F hM04 T x htimeC (hsmall hr) |
| 66 | (htime r ⟨ha.trans_le hr.1, (hr.2.trans hk₀d.le).trans_lt hdb⟩) |
| 67 | _ (htarget r (hsmall hr))] at h |
| 68 | exact h |
| 69 | have hw (r : ℝ) (hr : r ∈ Icc a k₀) : |
| 70 | HasDerivWithinAt w (f r (w r)) (Icc a k₀) r := |
| 71 | (hγ.phase r (hsmallW hr) x (hγsrc (hsmallW hr))).hasDerivWithinAt |
| 72 | have hdom : (a, z a) ∈ Ioo 0 b ×ˢ (chart.target ×ˢ univ) := |
| 73 | ⟨⟨ha, hab⟩, htarget a haC, mem_univ _⟩ |
| 74 | have hf : ContDiffAt ℝ 1 (Function.uncurry f) (a, z a) := |
| 75 | (((continuationChartPhase_contDiffOn F hM04 T x isOpen_Ioo |
| 76 | (fun r hr ↦ interior_subset (htime r hr))) _ hdom).contDiffAt |
| 77 | ((isOpen_Ioo.prod ((isOpen_extChartAt_target (I := 𝓡 n) x).prod isOpen_univ)).mem_nhds |
| 78 | hdom)).of_le (by simp) |
| 79 | obtain ⟨k, hak, hkk₀, hzw⟩ := smooth_phase_eqOn_right f hak₀ hf hz hw hγ₀.symm |
| 80 | have hkg (r : ℝ) (hr : r ∈ Icc a k) : β r = γ r := by |
| 81 | have hr₀ : r ∈ Icc a k₀ := ⟨hr.1, hr.2.trans hkk₀.le⟩ |
| 82 | have heq : chart (β r) = chart (γ r) := congrArg Prod.fst (hzw hr) |
| 83 | have hβsrc : β r ∈ chart.source := by |
| 84 | simpa only [chart, extChartAt_source] using hsrc (hsmall hr₀) |
| 85 | have hγsrc' : γ r ∈ chart.source := by |
| 86 | simpa only [chart, extChartAt_source] using hγsrc (hsmallW hr₀) |
| 87 | exact (chart.left_inv hβsrc).symm.trans |
| 88 | ((congrArg chart.symm heq).trans (chart.left_inv hγsrc')) |
| 89 | let e := a - ε |
| 90 | have heW : e ∈ W := ⟨by dsimp only [e, W]; linarith, by dsimp only [e, W]; linarith⟩ |
| 91 | have he : 0 ≤ e := (hWU heW).1.le |
| 92 | have hea : e < a := by dsimp only [e]; linarith |
| 93 | let δ := fun r ↦ if r ≤ a then γ r else α r |
| 94 | have hδα : EqOn δ α (Ioo a b) := by |
| 95 | intro r hr |
| 96 | simp only [δ, if_neg hr.1.not_ge] |
| 97 | have hδγ : EqOn δ γ (Ioo e k) := by |
| 98 | intro r hr |
| 99 | dsimp only [δ] |
| 100 | split_ifs with hra |
| 101 | · rfl |
| 102 | · exact (hβα (lt_of_not_ge hra)).symm.trans |
| 103 | (hkg r ⟨(lt_of_not_ge hra).le, hr.2.le⟩) |
| 104 | have hekW : Ioo e k ⊆ W := by |
| 105 | intro r hr |
| 106 | have hkε := hkk₀.trans (hk₀m.trans_le (min_le_right d (a + ε))) |
| 107 | exact ⟨by dsimp only [W, e] at *; linarith [hr.1], |
| 108 | by linarith [hr.2]⟩ |
| 109 | have hδL := (hγ.mono hekW).congr isOpen_Ioo hδγ |
| 110 | have hδR := hα.congr isOpen_Ioo hδα |
| 111 | refine ⟨e, he, hea, δ, (hδL.union isOpen_Ioo isOpen_Ioo hδR).mono ?_, hδα⟩ |
| 112 | intro r hr |
| 113 | by_cases hrk : r < k |
| 114 | · exact Or.inl ⟨hr.1, hrk⟩ |
| 115 | · exact Or.inr ⟨hak.trans_le (le_of_not_gt hrk), hr.2⟩ |
| 116 | |
| 117 | end PoincareMT.LGeometry |