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.ContinuationZero |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Continuation.ContinuationRegularized |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Regularity.RegularizedGeodesic |
| 4 | |
| 5 | /-! Adapted from Mapher `PoincareMT/Proofs/M08/ContinuationPath.lean` at |
| 6 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. -/ |
| 7 | |
| 8 | |
| 9 | set_option autoImplicit false |
| 10 | set_option backward.isDefEq.respectTransparency false |
| 11 | |
| 12 | noncomputable section |
| 13 | |
| 14 | open Set Filter Topology |
| 15 | open scoped Manifold ContDiff Bundle |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.LGeometry |
| 20 | |
| 21 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 23 | [ConnectedSpace M] [T3Space M] [SecondCountableTopology M] |
| 24 | |
| 25 | set_option maxHeartbeats 1400000 in |
| 26 | theorem exists_extended_square_continuation {J : Set ℝ} {F : RicciFlow n M J} |
| 27 | {T τmax τ₁ τ₂ : ℝ} (hM04 : RicciFlowCurvatureTheory.{u}) |
| 28 | (hwindow : Icc (T - τmax) T ⊆ J) |
| 29 | (hcurvature : CompleteBoundedCurvatureOn F (Icc (T - τmax) T)) |
| 30 | (hτ₁ : 0 < τ₁) (hτ₂ : τ₂ ≤ τmax) |
| 31 | (p : BackwardTimePath F T τ₁ τ₂) (R : RegularizedLGeodesicData p) : |
| 32 | ∃ α : ℝ → M, |
| 33 | ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α (Icc 0 (Real.sqrt τ₂)) ∧ |
| 34 | IsContinuationCurve F T α (Ioo 0 (Real.sqrt τ₂)) ∧ |
| 35 | EqOn α R.path.curve (sqrtParameterInterval τ₁ τ₂) := by |
| 36 | classical |
| 37 | let A := Real.sqrt τ₁ |
| 38 | let B := Real.sqrt τ₂ |
| 39 | have hA : 0 < A := Real.sqrt_pos.mpr hτ₁ |
| 40 | have hAB : A < B := Real.sqrt_lt_sqrt p.nonnegative p.ordered |
| 41 | have hB : 0 < B := hA.trans hAB |
| 42 | obtain ⟨c, hAc, hcB⟩ := exists_between hAB |
| 43 | obtain ⟨b, hcb, hbB⟩ := exists_between hcB |
| 44 | have hc : 0 < c := hA.trans hAc |
| 45 | have hb : 0 < b := hc.trans hcb |
| 46 | have hcm : c ^ 2 < τmax := by |
| 47 | have hsq := (sq_lt_sq₀ hc.le hB.le).mpr hcB |
| 48 | have hBsq : B ^ 2 = τ₂ := Real.sq_sqrt (hτ₁.trans p.ordered).le |
| 49 | rw [hBsq] at hsq |
| 50 | exact hsq.trans_le hτ₂ |
| 51 | have htimeB (s : ℝ) (hs : s ∈ Ioo 0 B) : T - s ^ 2 ∈ interior J := by |
| 52 | apply backwardSquareTime_mem_interior hwindow (τ₁ := 0) le_rfl |
| 53 | (hτ₁.trans p.ordered) hτ₂ |
| 54 | simpa only [Real.sqrt_zero, B] using hs |
| 55 | have hR : IsContinuationCurve F T R.path.curve (Ioo A B) := |
| 56 | regularizedData_isContinuationCurve hM04 hwindow hτ₂ p R |
| 57 | obtain ⟨β, hβ, hβ0, hβtail⟩ := exists_continuation_to_zero F hM04 T τmax hA.le hAc |
| 58 | hcb hcm hwindow hcurvature (fun s hs ↦ htimeB s ⟨hs.1, hs.2.trans hbB⟩) |
| 59 | R.path.curve (hR.mono (Ioo_subset_Ioo le_rfl hbB.le)) |
| 60 | have hβR : EqOn β R.path.curve (Ioo A b) := by |
| 61 | have h := continuationCurve_eqOn_of_tail F hM04 T (d := 0) (e := A) |
| 62 | le_rfl hA.le hc hAc hcb (fun s hs ↦ interior_subset (htimeB s ⟨hs.1, hs.2.trans hbB⟩)) |
| 63 | hβ (hR.mono (Ioo_subset_Ioo le_rfl hbB.le)) hβtail (fun _ _ ↦ rfl) |
| 64 | simpa only [max_eq_right hA.le] using h |
| 65 | let t := (c + b) / 2 |
| 66 | have hct : c < t := by dsimp only [t]; linarith |
| 67 | have htb : t < b := by dsimp only [t]; linarith |
| 68 | let α : ℝ → M := fun s ↦ if s ≤ t then β s else R.path.curve s |
| 69 | have hαβ : EqOn α β (Iio b) := by |
| 70 | intro s hs |
| 71 | dsimp only [α] |
| 72 | split_ifs with hst |
| 73 | · rfl |
| 74 | · exact (hβtail ⟨hct.trans (lt_of_not_ge hst), hs⟩).symm |
| 75 | have hαR : EqOn α R.path.curve (Ioi c) := by |
| 76 | intro s hs |
| 77 | dsimp only [α] |
| 78 | split_ifs with hst |
| 79 | · exact hβtail ⟨hs, hst.trans_lt htb⟩ |
| 80 | · rfl |
| 81 | have hαL : IsContinuationCurve F T α (Ioo 0 b) := |
| 82 | hβ.congr isOpen_Ioo (fun s hs ↦ hαβ hs.2) |
| 83 | have hαU : IsContinuationCurve F T α (Ioo c B) := |
| 84 | (hR.mono (Ioo_subset_Ioo hAc.le le_rfl)).congr isOpen_Ioo (fun s hs ↦ hαR hs.1) |
| 85 | have hαI : IsContinuationCurve F T α (Ioo 0 B) := by |
| 86 | apply (hαL.union isOpen_Ioo isOpen_Ioo hαU).mono |
| 87 | intro s hs |
| 88 | by_cases hsb : s < b |
| 89 | · exact Or.inl ⟨hs.1, hsb⟩ |
| 90 | · exact Or.inr ⟨hcb.trans_le (le_of_not_gt hsb), hs.2⟩ |
| 91 | have hαC : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α (Icc 0 B) := by |
| 92 | intro s hs |
| 93 | by_cases hs0 : s = 0 |
| 94 | · subst s |
| 95 | have hnear : α =ᶠ[𝓝 (0 : ℝ)] β := eventuallyEq_of_mem (Iio_mem_nhds hb) hαβ |
| 96 | exact (hβ0.congr_of_eventuallyEq (hnear.filter_mono nhdsWithin_le_nhds) |
| 97 | hnear.self_of_nhds).mono Icc_subset_Ici_self |
| 98 | · have hspos : 0 < s := lt_of_le_of_ne hs.1 (Ne.symm hs0) |
| 99 | rcases eq_or_lt_of_le hs.2 with hseq | hsB |
| 100 | · subst s |
| 101 | have hBC : B ∈ sqrtParameterInterval τ₁ τ₂ := ⟨hAB.le, le_rfl⟩ |
| 102 | exact (((R.path.smooth B (R.path.interval_subset hBC)).contMDiffAt |
| 103 | (R.path.open_domain.mem_nhds (R.path.interval_subset hBC))).congr_of_eventuallyEq |
| 104 | (eventuallyEq_of_mem (Ioi_mem_nhds hcB) hαR)).contMDiffWithinAt |
| 105 | · exact ((hαI.smooth s ⟨hspos, hsB⟩).contMDiffAt |
| 106 | (isOpen_Ioo.mem_nhds ⟨hspos, hsB⟩)).contMDiffWithinAt |
| 107 | have hαRo : EqOn α R.path.curve (Ioo A B) := by |
| 108 | intro s hs |
| 109 | by_cases hsb : s < b |
| 110 | · exact (hαβ hsb).trans (hβR ⟨hs.1, hsb⟩) |
| 111 | · exact hαR (hcb.trans_le (le_of_not_gt hsb)) |
| 112 | have hαRc : EqOn α R.path.curve (Icc A B) := hαRo.of_subset_closure |
| 113 | (hαC.continuousOn.mono (Icc_subset_Icc hA.le le_rfl)) |
| 114 | (R.path.smooth.continuousOn.mono R.path.interval_subset) Ioo_subset_Icc_self |
| 115 | (by rw [closure_Ioo hAB.ne]) |
| 116 | exact ⟨α, hαC, hαI, hαRc⟩ |
| 117 | |
| 118 | end PoincareMT.LGeometry |
| 119 | |
| 120 |