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.ContinuationLimit |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Continuation.ContinuationCurve |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Regularity.ManifoldEndpointExtension |
| 4 | |
| 5 | /-! Adapted from Mapher `PoincareMT/Proofs/M08/ContinuationRecovery.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 MeasureTheory |
| 15 | open scoped Manifold ContDiff Bundle intervalIntegral |
| 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 | |
| 24 | local instance continuationRecoveryDualGroup : NormedAddCommGroup (EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 25 | ContinuousLinearMap.toNormedAddCommGroup |
| 26 | local instance continuationRecoveryDualSpace : NormedSpace ℝ (EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 27 | ContinuousLinearMap.toNormedSpace |
| 28 | local instance continuationRecoveryBilinGroup : |
| 29 | NormedAddCommGroup (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 30 | ContinuousLinearMap.toNormedAddCommGroup |
| 31 | local instance continuationRecoveryBilinSpace : |
| 32 | NormedSpace ℝ (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 33 | ContinuousLinearMap.toNormedSpace |
| 34 | |
| 35 | private theorem recovery_referenceSpeedSq_congr (g : RiemannianMetric n M) |
| 36 | {α β : ℝ → M} {s : ℝ} (h : β =ᶠ[𝓝 s] α) : |
| 37 | referenceSpeedSq g β s = referenceSpeedSq g α s := by |
| 38 | unfold referenceSpeedSq curveVelocity |
| 39 | rw [h.mfderiv_eq, h.self_of_nhds] |
| 40 | |
| 41 | set_option maxHeartbeats 2000000 in |
| 42 | /-- Completeness and bounded speed recover the actual smooth closed endpoint phase. -/ |
| 43 | theorem exists_continuation_endpoint_phase [ConnectedSpace M] [T3Space M] |
| 44 | {J : Set ℝ} (F : RicciFlow n M J) (hM04 : RicciFlowCurvatureTheory.{u}) |
| 45 | (T : ℝ) (g : RiemannianMetric n M) (hg : MetricComplete g) |
| 46 | {a c b L : ℝ} (hac : a < c) (hcb : c < b) (hL : 0 ≤ L) |
| 47 | (α : ℝ → M) (hα : IsContinuationCurve F T α (Ioo a b)) |
| 48 | (hspeed : ∀ s ∈ Ioc a c, referenceSpeedSq g α s ≤ L) |
| 49 | (htime : ∀ s ∈ Icc a c, T - s ^ 2 ∈ J) : |
| 50 | ∃ (β : ℝ → M) (d : ℝ) (Pbar : ℝ → EuclideanSpace ℝ (Fin n)), |
| 51 | ContinuousOn β (Icc a c) ∧ EqOn β α (Ioi a) ∧ |
| 52 | ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ β (Icc a c) ∧ a < d ∧ d < c ∧ |
| 53 | MapsTo β (Icc a d) (chartAt (EuclideanSpace ℝ (Fin n)) (β a)).source ∧ |
| 54 | ContDiffOn ℝ ∞ (fun s ↦ (extChartAt (𝓡 n) (β a) (β s), Pbar s)) (Icc a d) ∧ |
| 55 | EqOn Pbar (fun s ↦ chartMetricOperator F T (β a) |
| 56 | (s, extChartAt (𝓡 n) (β a) (β s)) |
| 57 | (deriv ((extChartAt (𝓡 n) (β a)) ∘ β) s)) (Ioo a d) ∧ |
| 58 | ∀ s ∈ Icc a d, HasDerivWithinAt |
| 59 | (fun r ↦ (extChartAt (𝓡 n) (β a) (β r), Pbar r)) |
| 60 | (closedChartEulerPhase F T (β a) (Icc a d) s |
| 61 | (extChartAt (𝓡 n) (β a) (β s), Pbar s)) (Icc a d) s := by |
| 62 | classical |
| 63 | letI : MetricSpace M := referenceMetricSpace g |
| 64 | letI : CompleteSpace M := referenceMetricSpace_complete g hg |
| 65 | have hsub : Ioc a c ⊆ Ioo a b := fun s hs ↦ ⟨hs.1, hs.2.trans_lt hcb⟩ |
| 66 | have hLip := lipschitzOnWith_of_referenceSpeed_bound g hL isOpen_Ioo hsub α |
| 67 | (hα.smooth.of_le (by simp)) hspeed |
| 68 | obtain ⟨γ, hγ, hγα, _⟩ := exists_continuous_endpoint_of_lipschitz hac α hLip |
| 69 | let β : ℝ → M := fun s ↦ if s = a then γ a else α s |
| 70 | have hβα : EqOn β α (Ioi a) := by |
| 71 | intro s hs |
| 72 | exact if_neg (ne_of_gt hs) |
| 73 | have hβγ : EqOn β γ (Icc a c) := by |
| 74 | intro s hs |
| 75 | by_cases hsa : s = a |
| 76 | · subst s |
| 77 | simp only [β, if_pos rfl] |
| 78 | · have has : a < s := lt_of_le_of_ne hs.1 (Ne.symm hsa) |
| 79 | exact (hβα has).trans (hγα ⟨has, hs.2⟩).symm |
| 80 | have hβc : ContinuousOn β (Icc a c) := hγ.congr hβγ |
| 81 | have hβU : IsContinuationCurve F T β (Ioo a b) := |
| 82 | hα.congr isOpen_Ioo (fun s hs ↦ hβα hs.1) |
| 83 | obtain ⟨d, d', had, hdc, _, _, hsrc, _⟩ := endpoint_chart_intervals (n := n) hac β hβc |
| 84 | let x := β a |
| 85 | let e := extChartAt (𝓡 n) x |
| 86 | let q := e ∘ β |
| 87 | have hsmall : Icc a d ⊆ Icc a c := Icc_subset_Icc le_rfl hdc.le |
| 88 | have hopen : Ioo a d ⊆ Ioo a b := Ioo_subset_Ioo le_rfl (hdc.trans hcb).le |
| 89 | have hβreg : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ β (Ioo a d) := hβU.smooth.mono hopen |
| 90 | have hsrc' : MapsTo β (Icc a d) e.source := by |
| 91 | simpa only [e, x, extChartAt_source] using hsrc |
| 92 | have htarget : MapsTo q (Icc a d) e.target := fun s hs ↦ e.map_source (hsrc' hs) |
| 93 | have hq : ContinuousOn q (Icc a d) := |
| 94 | (continuousOn_extChartAt (I := 𝓡 n) x).comp (hβc.mono hsmall) hsrc' |
| 95 | have hqd (s : ℝ) (hs : s ∈ Ioo a d) : HasDerivAt q (deriv q s) s := by |
| 96 | have hm := ((hβreg s hs).contMDiffAt (isOpen_Ioo.mem_nhds hs)).mdifferentiableAt (by simp) |
| 97 | exact ((mdifferentiableAt_extChartAt (hsrc (Ioo_subset_Icc_self hs))).comp s hm).differentiableAt.hasDerivAt |
| 98 | have hβspeed (s : ℝ) (hs : s ∈ Ioo a d) : referenceSpeedSq g β s ≤ L := by |
| 99 | have hnear : β =ᶠ[𝓝 s] α := |
| 100 | Filter.eventuallyEq_of_mem (isOpen_Ioi.mem_nhds hs.1) hβα |
| 101 | rw [recovery_referenceSpeedSq_congr g hnear] |
| 102 | exact hspeed s ⟨hs.1, hs.2.le.trans hdc.le⟩ |
| 103 | have hqmeas : AEStronglyMeasurable (referenceSpeedSq g β) (volume.restrict (Icc a d)) := by |
| 104 | rw [← restrict_Ioo_eq_restrict_Icc] |
| 105 | exact (referenceSpeedSq_continuousOn g isOpen_Ioo (hβreg.of_le (by simp))).aestronglyMeasurable |
| 106 | measurableSet_Ioo |
| 107 | have hqbound : ∀ᵐ s ∂volume.restrict (Icc a d), ‖referenceSpeedSq g β s‖ ≤ L := by |
| 108 | rw [← restrict_Ioo_eq_restrict_Icc] |
| 109 | filter_upwards [ae_restrict_mem measurableSet_Ioo] with s hs |
| 110 | simpa only [Real.norm_eq_abs, abs_of_nonneg (referenceSpeedSq_nonneg g β s)] using hβspeed s hs |
| 111 | have hE : IntervalIntegrable (referenceSpeedSq g β) volume a d := by |
| 112 | apply (intervalIntegrable_iff_integrableOn_Icc_of_le had.le).mpr |
| 113 | exact (show Integrable (fun _ : ℝ ↦ L) (volume.restrict (Icc a d)) from |
| 114 | integrable_const L).mono' hqmeas hqbound |
| 115 | obtain ⟨k, hk, hcoercive⟩ := chart_velocity_L2_bound g x |
| 116 | (isCompact_Icc.image_of_continuousOn (hβc.mono hsmall)) |
| 117 | (by rintro y ⟨s, hs, rfl⟩; exact hsrc hs) |
| 118 | obtain ⟨hd, _⟩ := hcoercive had.le β (hβreg.of_le (by simp)) |
| 119 | (fun s hs ↦ mem_image_of_mem β hs) hE le_rfl |
| 120 | have hmomentum (s : ℝ) (hs : s ∈ Ioo a d) : |
| 121 | HasDerivAt (fun r ↦ chartMetricOperator F T x (r, q r) (deriv q r)) |
| 122 | (chartForceVector |
| 123 | (spatialWithinFDeriv (Icc a d) e.target (chartActionMetric F T x) (s, q s)) |
| 124 | (spatialWithinFDeriv (Icc a d) e.target (chartActionPotential F T x) (s, q s)) |
| 125 | (deriv q s)) s := by |
| 126 | rw [spatialWithinFDeriv_eq_spatialFDeriv (isOpen_extChartAt_target (I := 𝓡 n) x) |
| 127 | _ (Icc_mem_nhds hs.1 hs.2) (htarget (Ioo_subset_Icc_self hs)), |
| 128 | spatialWithinFDeriv_eq_spatialFDeriv (isOpen_extChartAt_target (I := 𝓡 n) x) |
| 129 | _ (Icc_mem_nhds hs.1 hs.2) (htarget (Ioo_subset_Icc_self hs))] |
| 130 | exact continuationCurve_momentum F T hβU (hopen hs) x (hsrc (Ioo_subset_Icc_self hs)) |
| 131 | obtain ⟨Pbar, hP, hPeq, hPd⟩ := endpoint_chart_phase_contDiffOn F hM04 T x had |
| 132 | q (deriv q) hq hqd hd htarget (fun s hs ↦ htime s (hsmall hs)) hmomentum |
| 133 | have hβlocal : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ β (Icc a d) := by |
| 134 | have h := (contMDiffOn_extChartAt_symm (I := 𝓡 n) x).comp hP.fst.contMDiffOn htarget |
| 135 | exact h.congr (fun s hs ↦ (e.left_inv (hsrc' hs)).symm) |
| 136 | have hβsmooth : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ β (Icc a c) := by |
| 137 | intro s hs |
| 138 | by_cases hsa : s = a |
| 139 | · subst s |
| 140 | have hnhds : Icc a d ∈ 𝓝[Icc a c] a := by |
| 141 | apply mem_nhdsWithin_iff_exists_mem_nhds_inter.mpr |
| 142 | refine ⟨Iio d, isOpen_Iio.mem_nhds had, ?_⟩ |
| 143 | intro r hr |
| 144 | exact ⟨hr.2.1, hr.1.le⟩ |
| 145 | exact (hβlocal a ⟨le_rfl, had.le⟩).mono_of_mem_nhdsWithin hnhds |
| 146 | · have hsU : s ∈ Ioo a b := ⟨lt_of_le_of_ne hs.1 (Ne.symm hsa), hs.2.trans_lt hcb⟩ |
| 147 | exact ((hβU.smooth s hsU).contMDiffAt (isOpen_Ioo.mem_nhds hsU)).contMDiffWithinAt |
| 148 | exact ⟨β, d, Pbar, hβc, hβα, hβsmooth, had, hdc, hsrc, hP, hPeq, hPd⟩ |
| 149 | |
| 150 | end PoincareMT.LGeometry |