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.ReducedLength.Minimum.Variational.TimeSupport.RegularPath |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Theory |
| 3 | |
| 4 | /-! |
| 5 | # Reduced-length comparison through smooth recovery |
| 6 | |
| 7 | Finite chart primitives are smoothed at their joins before comparison with |
| 8 | the ordinary minimizing path. The dimension-general recovery theorem is |
| 9 | applied to the same flow, endpoints and square-root action. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | open Set Filter MeasureTheory |
| 16 | open scoped Manifold ContDiff Bundle Topology intervalIntegral |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT |
| 21 | |
| 22 | namespace LGeodesicTheory |
| 23 | |
| 24 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 26 | [ConnectedSpace M] {J : Set ℝ} {F : RicciFlow n M J} {T τmax : ℝ} |
| 27 | |
| 28 | theorem reducedLength_le_path (L : LGeodesicTheory F T τmax) |
| 29 | {τ : ℝ} (hτ : 0 < τ) (hτmax : τ ≤ τmax) (p q : M) |
| 30 | (path : BackwardTimePath F T 0 τ) (hp : path.curve 0 = p) (hq : path.curve τ = q) : |
| 31 | reducedLength F T p q τ ≤ backwardLLength F T 0 τ path.curve / (2 * Real.sqrt τ) := by |
| 32 | obtain ⟨minimal, hm0, hmτ, hm, hvalue⟩ := L.reduced_length_attained τ hτ hτmax p q |
| 33 | rw [hvalue] |
| 34 | exact div_le_div_of_nonneg_right (hm path (hp.trans hm0.symm) (hq.trans hmτ.symm)) |
| 35 | (by positivity) |
| 36 | |
| 37 | end LGeodesicTheory |
| 38 | |
| 39 | namespace ReducedLengthMinimum.Variational |
| 40 | |
| 41 | variable {n : ℕ} {M : Type u} [MetricSpace M] |
| 42 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 43 | [ConnectedSpace M] {J : Set ℝ} {F : RicciFlow n M J} {T τmax : ℝ} |
| 44 | |
| 45 | /-- Smooth recovery turns literal finite coordinate primitives into a |
| 46 | comparison for the actual frozen ordinary reduced length. -/ |
| 47 | theorem reducedLength_le_finite_piece_action |
| 48 | (L : LGeodesicTheory F T τmax) {τ : ℝ} (hτ : 0 < τ) (hτmax : τ ≤ τmax) |
| 49 | (hT : T ∈ J) (hback : ∀ r ∈ Icc 0 τ, T - r ∈ J) |
| 50 | {m : ℕ} (t : Fin (m + 1) → ℝ) (ht : Monotone t) |
| 51 | (hta : t 0 = 0) (htb : t (Fin.last m) = Real.sqrt τ) |
| 52 | (hpotential : ContinuousOn (fun z : ℝ × M => |
| 53 | 2 * z.1 ^ 2 * (F.connection (T - z.1 ^ 2)).scalarCurvature z.2) |
| 54 | (Icc 0 (Real.sqrt τ) ×ˢ univ)) |
| 55 | (γ : ℝ → M) (β : Fin m → ℝ → M) |
| 56 | (hβ : ∀ i, ContinuousOn (β i) (Icc (t i.castSucc) (t i.succ))) |
| 57 | (hβa : ∀ i, β i (t i.castSucc) = γ (t i.castSucc)) |
| 58 | (hβb : ∀ i, β i (t i.succ) = γ (t i.succ)) |
| 59 | (x : Fin m → M) |
| 60 | (hsrc : ∀ i, MapsTo (β i) (Icc (t i.castSucc) (t i.succ)) |
| 61 | (chartAt (EuclideanSpace ℝ (Fin n)) (x i)).source) |
| 62 | (w : ∀ i : Fin m, IntervalL2 (EuclideanSpace ℝ (Fin n)) (t i.castSucc) (t i.succ)) |
| 63 | (hprimitive : ∀ i s, s ∈ Icc (t i.castSucc) (t i.succ) → |
| 64 | extChartAt (𝓡 n) (x i) (β i s) = extChartAt (𝓡 n) (x i) (β i (t i.castSucc)) + |
| 65 | ∫ r in t i.castSucc..s, w i r) : |
| 66 | 2 * Real.sqrt τ * reducedLength F T (γ 0) (γ (Real.sqrt τ)) τ ≤ |
| 67 | ∑ i, chartH1Action F T (x i) (t i.castSucc) (t i.succ) (β i) (w i) := by |
| 68 | have htime (s : ℝ) (hs : s ∈ Icc (t 0) (t (Fin.last m))) : T - s ^ 2 ∈ J := by |
| 69 | rw [hta, htb] at hs |
| 70 | exact hback _ ⟨sq_nonneg _, (Real.le_sqrt hs.1 hτ.le).mp hs.2⟩ |
| 71 | have hpotential' : ContinuousOn (fun z : ℝ × M => |
| 72 | 2 * z.1 ^ 2 * (F.connection (T - z.1 ^ 2)).scalarCurvature z.2) |
| 73 | (Icc (t 0) (t (Fin.last m)) ×ˢ univ) := by |
| 74 | simpa only [hta, htb] using hpotential |
| 75 | obtain ⟨α, hα, _, hlim⟩ := exists_smooth_finite_chart_piece_recovery F T t ht htime |
| 76 | hpotential' γ β hβ hβa hβb x hsrc w hprimitive |
| 77 | have hcont (k : ℕ) : ContinuousOn (α k) (Icc (Real.sqrt 0) (Real.sqrt τ)) := |
| 78 | (hα k).1.continuous.continuousOn |
| 79 | have hreg (k : ℕ) : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) 1 (α k) |
| 80 | (Ioo (Real.sqrt 0) (Real.sqrt τ)) := ((hα k).1.of_le (by simp)).contMDiffOn |
| 81 | have hint (k : ℕ) : IntervalIntegrable (regularizedLIntegrand F T (α k)) volume |
| 82 | (Real.sqrt 0) (Real.sqrt τ) := by |
| 83 | simpa only [hta, htb, Real.sqrt_zero] using (hα k).2.2.2 |
| 84 | let paths : ℕ → BackwardTimePath F T 0 τ := fun k => |
| 85 | backwardPathOfSqrt F T 0 τ le_rfl hτ hT hback (α k) (hcont k) (hreg k) (hint k) |
| 86 | have hstart (k : ℕ) : (paths k).curve 0 = γ 0 := by |
| 87 | change α k (Real.sqrt 0) = γ 0 |
| 88 | simpa only [Real.sqrt_zero, hta] using (hα k).2.1 |
| 89 | have hend (k : ℕ) : (paths k).curve τ = γ (Real.sqrt τ) := by |
| 90 | change α k (Real.sqrt τ) = γ (Real.sqrt τ) |
| 91 | simpa only [htb] using (hα k).2.2.1 |
| 92 | have haction (k : ℕ) : backwardLLength F T 0 τ (paths k).curve = |
| 93 | ∫ s in t 0..t (Fin.last m), regularizedLIntegrand F T (α k) s := by |
| 94 | rw [backwardPathOfSqrt_action] |
| 95 | simp only [hta, htb, Real.sqrt_zero] |
| 96 | apply ge_of_tendsto hlim |
| 97 | apply Eventually.of_forall |
| 98 | intro k |
| 99 | have h := (le_div_iff₀ (show 0 < 2 * Real.sqrt τ by positivity)).mp |
| 100 | (L.reducedLength_le_path hτ hτmax _ _ (paths k) (hstart k) (hend k)) |
| 101 | simpa only [haction, mul_comm] using h |
| 102 | |
| 103 | /-- Smoothing the corner of two smooth square-time pieces gives the sum of |
| 104 | their actual actions as a reduced-length upper bound. -/ |
| 105 | theorem reducedLength_le_two_smooth_pieces |
| 106 | (L : LGeodesicTheory F T τmax) {τ c : ℝ} |
| 107 | (hτ : 0 < τ) (hτmax : τ ≤ τmax) (hc : c ∈ Icc 0 (Real.sqrt τ)) |
| 108 | (hT : T ∈ J) (hback : ∀ r ∈ Icc 0 τ, T - r ∈ J) |
| 109 | (hpotential : ContinuousOn (fun z : ℝ × M => |
| 110 | 2 * z.1 ^ 2 * (F.connection (T - z.1 ^ 2)).scalarCurvature z.2) |
| 111 | (Icc 0 (Real.sqrt τ) ×ˢ univ)) |
| 112 | (γ α β : ℝ → M) (hγ : Continuous γ) |
| 113 | {U V : Set ℝ} (hU : IsOpen U) (hV : IsOpen V) |
| 114 | (hIU : Icc 0 c ⊆ U) (hIV : Icc c (Real.sqrt τ) ⊆ V) |
| 115 | (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α U) |
| 116 | (hβ : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ β V) |
| 117 | (hleft : EqOn γ α (Icc 0 c)) (hright : EqOn γ β (Icc c (Real.sqrt τ))) : |
| 118 | 2 * Real.sqrt τ * reducedLength F T (γ 0) (γ (Real.sqrt τ)) τ ≤ |
| 119 | (∫ s in 0..c, regularizedLIntegrand F T α s) + |
| 120 | ∫ s in c..Real.sqrt τ, regularizedLIntegrand F T β s := by |
| 121 | classical |
| 122 | let R : Set (ℝ × ℝ) := {ab | ab.1 ≤ ab.2 ∧ |
| 123 | ∃ x : M, ∃ w : IntervalL2 (EuclideanSpace ℝ (Fin n)) ab.1 ab.2, |
| 124 | MapsTo γ (Icc ab.1 ab.2) (chartAt (EuclideanSpace ℝ (Fin n)) x).source ∧ |
| 125 | (∀ s ∈ Icc ab.1 ab.2, |
| 126 | extChartAt (𝓡 n) x (γ s) = extChartAt (𝓡 n) x (γ ab.1) + |
| 127 | ∫ r in ab.1..s, w r) ∧ |
| 128 | ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) 1 γ (Ioo ab.1 ab.2)} |
| 129 | have partition {a b : ℝ} (hab : a ≤ b) (δ : ℝ → M) {W : Set ℝ} |
| 130 | (hW : IsOpen W) (hIW : Icc a b ⊆ W) |
| 131 | (hδ : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ δ W) |
| 132 | (heq : EqOn γ δ (Icc a b)) : |
| 133 | ∃ p : RelSeries R, p.head = a ∧ p.last = b := by |
| 134 | obtain ⟨m, t, x, w, ht, hta, htb, hsrc, hw⟩ := |
| 135 | exists_finite_chart_primitive_of_smooth hab δ γ hγ hW hIW hδ heq |
| 136 | refine ⟨⟨m, t, ?_⟩, hta, htb⟩ |
| 137 | intro i |
| 138 | refine ⟨ht (Fin.castSucc_le_succ i), x i, w i, hsrc i, hw i, ?_⟩ |
| 139 | have hsub : Ioo (t i.castSucc) (t i.succ) ⊆ Icc a b := by |
| 140 | rw [← hta, ← htb] |
| 141 | exact Ioo_subset_Icc_self.trans |
| 142 | (Icc_subset_Icc (ht (Fin.zero_le _)) (ht (Fin.le_last _))) |
| 143 | exact ((hδ.of_le (by simp)).mono (hsub.trans hIW)).congr |
| 144 | (fun s hs => heq (hsub hs)) |
| 145 | obtain ⟨p, hp0, hpc⟩ := partition hc.1 α hU hIU hα hleft |
| 146 | obtain ⟨q, hqc, hqb⟩ := partition hc.2 β hV hIV hβ hright |
| 147 | have hpq : p.last = q.head := hpc.trans hqc.symm |
| 148 | let r := p.smash q hpq |
| 149 | let t : Fin (r.length + 1) → ℝ := r |
| 150 | have ht : Monotone t := Fin.monotone_iff_le_succ.mpr (fun i => (r.step i).1) |
| 151 | have hta : t 0 = 0 := by |
| 152 | change r.head = 0 |
| 153 | simpa only [r, RelSeries.head_smash] using hp0 |
| 154 | have htb : t (Fin.last r.length) = Real.sqrt τ := by |
| 155 | change r.last = Real.sqrt τ |
| 156 | simpa only [r, RelSeries.last_smash] using hqb |
| 157 | choose x w hsrc hw hreg using fun i : Fin r.length => (r.step i).2 |
| 158 | have hseg (i : Fin r.length) : t i.castSucc ≤ t i.succ := ht (Fin.castSucc_le_succ i) |
| 159 | have hsub (i : Fin r.length) : Icc (t i.castSucc) (t i.succ) ⊆ Icc 0 (Real.sqrt τ) := by |
| 160 | rw [← hta, ← htb] |
| 161 | exact Icc_subset_Icc (ht (Fin.zero_le _)) (ht (Fin.le_last _)) |
| 162 | have htime (i : Fin r.length) (s : ℝ) (hs : s ∈ Icc (t i.castSucc) (t i.succ)) : |
| 163 | T - s ^ 2 ∈ J := |
| 164 | hback _ ⟨sq_nonneg _, (Real.le_sqrt (hsub i hs).1 hτ.le).mp (hsub i hs).2⟩ |
| 165 | have hvel (i : Fin r.length) : |
| 166 | (w i : ℝ → EuclideanSpace ℝ (Fin n)) =ᵐ[volume.restrict (Icc (t i.castSucc) (t i.succ))] |
| 167 | deriv ((extChartAt (𝓡 n) (x i)) ∘ γ) := by |
| 168 | filter_upwards [primitive_ae_hasDerivAt (hseg i) |
| 169 | ((extChartAt (𝓡 n) (x i)) ∘ γ) (w i) (hw i)] with s hs |
| 170 | exact hs.deriv.symm |
| 171 | have hpot (i : Fin r.length) : ContinuousOn |
| 172 | (fun s => 2 * s ^ 2 * (F.connection (T - s ^ 2)).scalarCurvature (γ s)) |
| 173 | (Icc (t i.castSucc) (t i.succ)) := |
| 174 | hpotential.comp (continuousOn_id.prodMk hγ.continuousOn) |
| 175 | (fun s hs => ⟨hsub i hs, mem_univ _⟩) |
| 176 | have hint (i : Fin r.length) : |
| 177 | IntervalIntegrable (regularizedLIntegrand F T γ) volume (t i.castSucc) (t i.succ) := |
| 178 | chart_piece_integrable F T (hseg i) (x i) γ hγ.continuousOn (hreg i) |
| 179 | (hsrc i) (htime i) (hpot i) (w i) (hvel i) |
| 180 | obtain ⟨hglobal, hsum⟩ := integrable_sum_fin_partition t (regularizedLIntegrand F T γ) hint |
| 181 | have hsum' : (∑ i, chartH1Action F T (x i) (t i.castSucc) (t i.succ) γ (w i)) = |
| 182 | ∫ s in 0..Real.sqrt τ, regularizedLIntegrand F T γ s := by |
| 183 | calc |
| 184 | _ = ∑ i : Fin r.length, |
| 185 | ∫ s in t i.castSucc..t i.succ, regularizedLIntegrand F T γ s := by |
| 186 | apply Finset.sum_congr rfl |
| 187 | intro i _ |
| 188 | exact chart_piece_action_eq F T (hseg i) (x i) γ (hreg i) (hsrc i) |
| 189 | (hpot i) (hint i) (w i) (hvel i) |
| 190 | _ = _ := by simpa only [hta, htb] using hsum |
| 191 | have hbound := reducedLength_le_finite_piece_action L hτ hτmax hT hback t ht hta htb |
| 192 | hpotential γ (fun _ => γ) (fun _ => hγ.continuousOn) (fun _ => rfl) (fun _ => rfl) |
| 193 | x hsrc w hw |
| 194 | rw [hsum'] at hbound |
| 195 | have hint' : IntervalIntegrable (regularizedLIntegrand F T γ) volume 0 (Real.sqrt τ) := by |
| 196 | simpa only [hta, htb] using hglobal |
| 197 | have hintLeft : IntervalIntegrable (regularizedLIntegrand F T γ) volume 0 c := by |
| 198 | apply hint'.mono_set |
| 199 | rw [uIcc_of_le hc.1, uIcc_of_le (Real.sqrt_nonneg τ)] |
| 200 | exact Icc_subset_Icc le_rfl hc.2 |
| 201 | have hintRight : IntervalIntegrable (regularizedLIntegrand F T γ) volume c (Real.sqrt τ) := by |
| 202 | apply hint'.mono_set |
| 203 | rw [uIcc_of_le hc.2, uIcc_of_le (Real.sqrt_nonneg τ)] |
| 204 | exact Icc_subset_Icc hc.1 le_rfl |
| 205 | rw [← intervalIntegral.integral_add_adjacent_intervals hintLeft hintRight] at hbound |
| 206 | convert hbound using 1 |
| 207 | congr 1 |
| 208 | · apply intervalIntegral.integral_congr_Ioo_of_le hc.1 |
| 209 | intro s hs |
| 210 | apply regularizedLIntegrand_congr_eventually |
| 211 | exact eventually_of_mem (isOpen_Ioo.mem_nhds hs) |
| 212 | (fun v hv => (hleft (Ioo_subset_Icc_self hv)).symm) |
| 213 | · apply intervalIntegral.integral_congr_Ioo_of_le hc.2 |
| 214 | intro s hs |
| 215 | apply regularizedLIntegrand_congr_eventually |
| 216 | exact eventually_of_mem (isOpen_Ioo.mem_nhds hs) |
| 217 | (fun v hv => (hright (Ioo_subset_Icc_self hv)).symm) |
| 218 | |
| 219 | end ReducedLengthMinimum.Variational |
| 220 | |
| 221 | end PoincareMT |