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.AncientKappa.Noncollapse.Universal.ReducedLength.Recovery |
| 2 | import PoincareLib.Geometry.RicciFlow.AncientKappa.Noncollapse.Universal.Constants |
| 3 | |
| 4 | /-! |
| 5 | # Quantitative terminal reduced length |
| 6 | |
| 7 | A minimizing seed at backward time one is joined to an actual smooth |
| 8 | spatial path over the next unit interval. Smooth recovery justifies the |
| 9 | corner. Scalar and kinetic bounds on that terminal path give the fixed |
| 10 | length constant used by generalized noncollapse. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set Filter MeasureTheory |
| 17 | open scoped Manifold ContDiff Bundle Topology intervalIntegral |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT |
| 22 | |
| 23 | namespace ReducedLengthMinimum.Variational |
| 24 | |
| 25 | theorem exists_continuous_interval_join {M : Type*} [TopologicalSpace M] |
| 26 | {a c b : ℝ} (hac : a ≤ c) (hcb : c ≤ b) (α β : ℝ → M) |
| 27 | (hα : ContinuousOn α (Icc a c)) (hβ : ContinuousOn β (Icc c b)) |
| 28 | (hmatch : α c = β c) : |
| 29 | ∃ γ : ℝ → M, Continuous γ ∧ EqOn γ α (Icc a c) ∧ EqOn γ β (Icc c b) := by |
| 30 | classical |
| 31 | let left : ℝ → M := fun s => α (projIcc a c hac s) |
| 32 | let right : ℝ → M := fun s => β (projIcc c b hcb s) |
| 33 | have hl : Continuous left := |
| 34 | (continuousOn_iff_continuous_domRestrict.mp hα).comp continuous_projIcc |
| 35 | have hr : Continuous right := |
| 36 | (continuousOn_iff_continuous_domRestrict.mp hβ).comp continuous_projIcc |
| 37 | have hleft : EqOn left α (Icc a c) := by |
| 38 | intro s hs |
| 39 | dsimp only [left] |
| 40 | rw [projIcc_of_mem _ hs] |
| 41 | have hright : EqOn right β (Icc c b) := by |
| 42 | intro s hs |
| 43 | dsimp only [right] |
| 44 | rw [projIcc_of_mem _ hs] |
| 45 | let γ := (Iic c).piecewise left right |
| 46 | refine ⟨γ, ?_, ?_, ?_⟩ |
| 47 | · apply Continuous.piecewise ?_ hl hr |
| 48 | intro s hs |
| 49 | have hs' : s = c := by simpa only [frontier_Iic, mem_singleton_iff] using hs |
| 50 | subst s |
| 51 | exact (hleft ⟨hac, le_rfl⟩).trans (hmatch.trans (hright ⟨le_rfl, hcb⟩).symm) |
| 52 | · intro s hs |
| 53 | exact (piecewise_eq_of_mem (Iic c) left right hs.2).trans (hleft hs) |
| 54 | · intro s hs |
| 55 | by_cases hsc : s ≤ c |
| 56 | · have heq : s = c := le_antisymm hsc hs.1 |
| 57 | subst s |
| 58 | exact (piecewise_eq_of_mem (Iic c) left right (show c ∈ Iic c by simp)).trans |
| 59 | ((hleft ⟨hac, le_rfl⟩).trans hmatch) |
| 60 | · exact (piecewise_eq_of_notMem (Iic c) left right hsc).trans (hright hs) |
| 61 | |
| 62 | private theorem integral_le_nonnegative_const {a b C : ℝ} (hab : a ≤ b) (hC : 0 ≤ C) |
| 63 | (f : ℝ → ℝ) (hf : ∀ s ∈ Icc a b, f s ≤ C) : |
| 64 | (∫ s in a..b, f s) ≤ (b - a) * C := by |
| 65 | by_cases hi : IntervalIntegrable f volume a b |
| 66 | · have h := intervalIntegral.integral_mono_on hab hi intervalIntegrable_const hf |
| 67 | simpa only [intervalIntegral.integral_const, smul_eq_mul] using h |
| 68 | · rw [intervalIntegral.integral_undef hi] |
| 69 | exact mul_nonneg (sub_nonneg.mpr hab) hC |
| 70 | |
| 71 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 72 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 73 | {J : Set ℝ} {F : RicciFlow n M J} |
| 74 | |
| 75 | /-- A scalar bound two and actual unit-time kinetic bound `exp 4` control |
| 76 | the transformed terminal action by a fixed constant. -/ |
| 77 | theorem terminal_square_action_le |
| 78 | (q : ℝ → M) {W : Set ℝ} (hW : IsOpen W) (hIW : Icc (1 : ℝ) 2 ⊆ W) |
| 79 | (hq : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ q W) |
| 80 | (hscalar : ∀ s ∈ Icc (1 : ℝ) 2, (F.connection (0 - s)).scalarCurvature (q s) ≤ 2) |
| 81 | (hspeed : ∀ s ∈ Icc (1 : ℝ) 2, |
| 82 | (F.metric (0 - s)).inner (q s) (curveVelocity q s) (curveVelocity q s) ≤ Real.exp 4) : |
| 83 | (∫ s in 1..Real.sqrt 2, regularizedLIntegrand F 0 (fun r => q (r ^ 2)) s) ≤ |
| 84 | 8 + 4 * Real.exp 4 := by |
| 85 | have hsqrt : (1 : ℝ) ≤ Real.sqrt 2 := by |
| 86 | rw [Real.le_sqrt (by norm_num) (by norm_num)] |
| 87 | norm_num |
| 88 | have hbound : ∀ s ∈ Icc 1 (Real.sqrt 2), |
| 89 | regularizedLIntegrand F 0 (fun r => q (r ^ 2)) s ≤ 8 + 4 * Real.exp 4 := by |
| 90 | intro s hs |
| 91 | have hs2 : s ^ 2 ∈ Icc (1 : ℝ) 2 := by |
| 92 | constructor |
| 93 | · nlinarith [hs.1] |
| 94 | · exact (Real.le_sqrt (by linarith [hs.1]) (by norm_num)).mp hs.2 |
| 95 | have hvel := curveVelocity_comp_sq |
| 96 | (((hq _ (hIW hs2)).contMDiffAt (hW.mem_nhds (hIW hs2))).mdifferentiableAt (by simp)) |
| 97 | unfold regularizedLIntegrand |
| 98 | rw [hvel] |
| 99 | simp only [map_smul, smul_apply, smul_eq_mul] |
| 100 | have hR := hscalar _ hs2 |
| 101 | have hv := hspeed _ hs2 |
| 102 | have hpot := mul_le_mul_of_nonneg_left hR (by positivity : 0 ≤ 2 * s ^ 2) |
| 103 | have hkin := mul_le_mul_of_nonneg_left hv (by positivity : 0 ≤ 2 * s ^ 2) |
| 104 | have hexp := Real.exp_pos (4 : ℝ) |
| 105 | nlinarith [hs2.2] |
| 106 | have h := integral_le_nonnegative_const hsqrt (by positivity) _ hbound |
| 107 | have hlen : Real.sqrt 2 - 1 ≤ 1 := by |
| 108 | have hsq := Real.sq_sqrt (show (0 : ℝ) ≤ 2 by norm_num) |
| 109 | nlinarith [Real.sqrt_nonneg (2 : ℝ)] |
| 110 | exact h.trans (by nlinarith [Real.exp_pos (4 : ℝ)]) |
| 111 | |
| 112 | end ReducedLengthMinimum.Variational |
| 113 | |
| 114 | namespace LGeodesicTheory |
| 115 | |
| 116 | open ReducedLengthMinimum ReducedLengthMinimum.Variational |
| 117 | |
| 118 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 119 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 120 | [T3Space M] [ConnectedSpace M] {J : Set ℝ} {F : RicciFlow n M J} |
| 121 | {τmax : ℝ} |
| 122 | |
| 123 | /-- A genuine smooth short terminal path propagates the normalized seed |
| 124 | bound to the fixed backward time two. The minimizing seed and the corner |
| 125 | smoothing are constructed from the ordinary theory. -/ |
| 126 | theorem reducedLength_two_le_of_terminal_path |
| 127 | (L : LGeodesicTheory F 0 τmax) (hmax : 2 ≤ τmax) |
| 128 | (hzero : 0 ∈ J) (hback : ∀ s ∈ Icc (0 : ℝ) 2, 0 - s ∈ J) |
| 129 | (hscalarRegular : ContinuousOn (fun z : ℝ × M => |
| 130 | (F.connection z.1).scalarCurvature z.2) (J ×ˢ univ)) |
| 131 | (p z y : M) (hseed : reducedLength F 0 p z 1 ≤ 3) |
| 132 | (q : ℝ → M) {W : Set ℝ} (hW : IsOpen W) (hIW : Icc (1 : ℝ) 2 ⊆ W) |
| 133 | (hq : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ q W) |
| 134 | (hqone : q 1 = z) (hqtwo : q 2 = y) |
| 135 | (hscalar : ∀ s ∈ Icc (1 : ℝ) 2, (F.connection (0 - s)).scalarCurvature (q s) ≤ 2) |
| 136 | (hspeed : ∀ s ∈ Icc (1 : ℝ) 2, |
| 137 | (F.metric (0 - s)).inner (q s) (curveVelocity q s) (curveVelocity q s) ≤ Real.exp 4) : |
| 138 | reducedLength F 0 p y 2 ≤ universalNoncollapseLength := by |
| 139 | let : MetricSpace M := referenceMetricSpace (F.metric 0) |
| 140 | have hsqrt : (1 : ℝ) ≤ Real.sqrt 2 := by |
| 141 | rw [Real.le_sqrt (by norm_num) (by norm_num)] |
| 142 | norm_num |
| 143 | obtain ⟨path, hp0, hp1, hpmin, hvalue⟩ := |
| 144 | L.reduced_length_attained 1 (by norm_num) (by linarith) p z |
| 145 | have heuler := L.euler_lagrange 0 1 (by norm_num) (by norm_num) (by linarith) path hpmin |
| 146 | obtain ⟨S⟩ := L.regularized_geodesic 0 1 (by norm_num) (by norm_num) (by linarith) path heuler |
| 147 | have hIS : Icc (0 : ℝ) 1 ⊆ S.path.domain := by |
| 148 | simpa only [sqrtParameterInterval, Real.sqrt_zero, Real.sqrt_one] using S.path.interval_subset |
| 149 | have hS (s : ℝ) (hs : s ∈ Icc (0 : ℝ) 1) : S.path.curve s = path.curve (s ^ 2) := |
| 150 | S.path.agrees s (by simpa only [sqrtParameterInterval, Real.sqrt_zero, Real.sqrt_one] using hs) |
| 151 | have hsqI (s : ℝ) (hs : s ∈ Icc 1 (Real.sqrt 2)) : s ^ 2 ∈ Icc (1 : ℝ) 2 := by |
| 152 | constructor |
| 153 | · nlinarith [hs.1] |
| 154 | · exact (Real.le_sqrt (by linarith [hs.1]) (by norm_num)).mp hs.2 |
| 155 | let β : ℝ → M := fun s => q (s ^ 2) |
| 156 | let V : Set ℝ := (fun s : ℝ => s ^ 2) ⁻¹' W |
| 157 | have hV : IsOpen V := hW.preimage (continuous_id.pow 2) |
| 158 | have hIV : Icc 1 (Real.sqrt 2) ⊆ V := fun s hs => hIW (hsqI s hs) |
| 159 | have hβ : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ β V := |
| 160 | hq.comp ((contDiff_id.pow 2).contMDiff.contMDiffOn) (fun _ hs => hs) |
| 161 | have hmatch : S.path.curve 1 = β 1 := by |
| 162 | have hs := hS 1 (by norm_num) |
| 163 | simp only [one_pow] at hs |
| 164 | simpa only [β, one_pow, hqone] using hs.trans hp1 |
| 165 | obtain ⟨γ, hγ, hleft, hright⟩ := exists_continuous_interval_join |
| 166 | (by norm_num : (0 : ℝ) ≤ 1) hsqrt S.path.curve β |
| 167 | (S.path.smooth.continuousOn.mono hIS) (hβ.continuousOn.mono hIV) hmatch |
| 168 | have hγ0 : γ 0 = p := by |
| 169 | rw [hleft (by norm_num), hS 0 (by norm_num)] |
| 170 | simpa only [zero_pow (by norm_num : 2 ≠ 0)] using hp0 |
| 171 | have hγend : γ (Real.sqrt 2) = y := by |
| 172 | rw [hright ⟨hsqrt, le_rfl⟩] |
| 173 | change q ((Real.sqrt 2) ^ 2) = y |
| 174 | simpa only [Real.sq_sqrt (show (0 : ℝ) ≤ 2 by norm_num)] using hqtwo |
| 175 | have hpotential : ContinuousOn (fun a : ℝ × M => |
| 176 | 2 * a.1 ^ 2 * (F.connection (0 - a.1 ^ 2)).scalarCurvature a.2) |
| 177 | (Icc 0 (Real.sqrt 2) ×ˢ univ) := by |
| 178 | apply (continuousOn_const.mul (continuousOn_fst.pow 2)).mul |
| 179 | apply hscalarRegular.comp |
| 180 | ((continuousOn_const.sub (continuousOn_fst.pow 2)).prodMk continuousOn_snd) |
| 181 | intro a ha |
| 182 | exact ⟨hback _ ⟨sq_nonneg _, |
| 183 | (Real.le_sqrt ha.1.1 (by norm_num)).mp ha.1.2⟩, mem_univ _⟩ |
| 184 | have hbound := reducedLength_le_two_smooth_pieces L (by norm_num) hmax |
| 185 | ⟨by norm_num, hsqrt⟩ hzero hback hpotential γ S.path.curve β hγ |
| 186 | S.path.open_domain hV hIS hIV S.path.smooth hβ hleft hright |
| 187 | rw [hγ0, hγend] at hbound |
| 188 | have haction : (∫ s in 0..1, regularizedLIntegrand F 0 S.path.curve s) = |
| 189 | backwardLLength F 0 0 1 path.curve := by |
| 190 | calc |
| 191 | _ = ∫ s in 0..1, regularizedLIntegrand F 0 (fun r => path.curve (r ^ 2)) s := by |
| 192 | apply intervalIntegral.integral_congr_Ioo_of_le (by norm_num : (0 : ℝ) ≤ 1) |
| 193 | intro s hs |
| 194 | apply regularizedLIntegrand_congr_eventually |
| 195 | exact eventually_of_mem (isOpen_Ioo.mem_nhds hs) |
| 196 | (fun r hr => hS r (Ioo_subset_Icc_self hr)) |
| 197 | _ = _ := by simpa only [regularizedLAction, Real.sqrt_one] using (squarePath_action path).2 |
| 198 | rw [haction] at hbound |
| 199 | have hseedAction : backwardLLength F 0 0 1 path.curve ≤ 6 := by |
| 200 | rw [Real.sqrt_one] at hvalue |
| 201 | norm_num at hvalue |
| 202 | linarith |
| 203 | have htail := terminal_square_action_le q hW hIW hq hscalar hspeed |
| 204 | have htotal : 2 * Real.sqrt 2 * reducedLength F 0 p y 2 ≤ 14 + 4 * Real.exp 4 := by |
| 205 | change (∫ s in 1..Real.sqrt 2, regularizedLIntegrand F 0 β s) ≤ _ at htail |
| 206 | linarith |
| 207 | have hconst : 14 + 4 * Real.exp 4 ≤ 2 * universalNoncollapseLength := by |
| 208 | unfold universalNoncollapseLength |
| 209 | nlinarith [Real.exp_pos (4 : ℝ)] |
| 210 | have hscale : 2 * universalNoncollapseLength ≤ |
| 211 | (2 * Real.sqrt 2) * universalNoncollapseLength := |
| 212 | mul_le_mul_of_nonneg_right (by nlinarith) universalNoncollapseLength_pos.le |
| 213 | exact (mul_le_mul_iff_right₀ (show 0 < 2 * Real.sqrt 2 by positivity)).mp |
| 214 | (htotal.trans (hconst.trans hscale)) |
| 215 | |
| 216 | end LGeodesicTheory |
| 217 | |
| 218 | end PoincareMT |