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.Regularity.EndpointChartRegularity |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Regularity.EulerMomentum |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Variation.Extension.SquareEulerTransport |
| 4 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Regularity.MinimizerEulerLocal |
| 5 | |
| 6 | /-! Adapted from Mapher `PoincareMT/Proofs/M08/EulerPathCharts.lean` at |
| 7 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. -/ |
| 8 | |
| 9 | |
| 10 | set_option autoImplicit false |
| 11 | set_option backward.isDefEq.respectTransparency false |
| 12 | |
| 13 | noncomputable section |
| 14 | |
| 15 | open Set Filter MeasureTheory |
| 16 | open scoped Manifold ContDiff Bundle Topology intervalIntegral |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.LGeometry |
| 21 | |
| 22 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 24 | |
| 25 | noncomputable def restrictOpenVelocityExtension {I U : Set ℝ} |
| 26 | (hI : IsOpen I) (hU : IsOpen U) (hsub : U ⊆ I) (α : ℝ → M) |
| 27 | (E : ParametricAlongCurveExtensionOn I α (curveVelocityWithin (n := n) α I)) : |
| 28 | ParametricAlongCurveExtensionOn U α (curveVelocityWithin (n := n) α U) where |
| 29 | extension := E.extension |
| 30 | domain := E.domain |
| 31 | open_domain := E.open_domain |
| 32 | graph_mem s hs := E.graph_mem s (hsub hs) |
| 33 | smooth := E.smooth |
| 34 | agrees s hs := by |
| 35 | rw [E.agrees s (hsub hs)] |
| 36 | unfold curveVelocityWithin |
| 37 | rw [mfderivWithin_of_mem_nhds (hI.mem_nhds (hsub hs)), |
| 38 | mfderivWithin_of_mem_nhds (hU.mem_nhds hs)] |
| 39 | |
| 40 | theorem regularizedEulerResidual_restrictOpenVelocityExtension {J I U : Set ℝ} |
| 41 | (F : RicciFlow n M J) (T : ℝ) (hI : IsOpen I) (hU : IsOpen U) |
| 42 | (hsub : U ⊆ I) (α : ℝ → M) |
| 43 | (E : ParametricAlongCurveExtensionOn I α (curveVelocityWithin (n := n) α I)) |
| 44 | {s : ℝ} (hs : s ∈ U) (W : TangentSpace (𝓡 n) (α s)) : |
| 45 | regularizedEulerResidual F T α U (restrictOpenVelocityExtension hI hU hsub α E) s W = |
| 46 | regularizedEulerResidual F T α I E s W := by |
| 47 | unfold regularizedEulerResidual pullbackCovariantDerivative |
| 48 | restrictOpenVelocityExtension curveVelocityWithin |
| 49 | rw [mfderivWithin_of_mem_nhds (hI.mem_nhds (hsub hs)), |
| 50 | mfderivWithin_of_mem_nhds (hU.mem_nhds hs)] |
| 51 | |
| 52 | variable [ConnectedSpace M] [T3Space M] |
| 53 | |
| 54 | theorem squarePath_chart_derivative_memLp {J : Set ℝ} {F : RicciFlow n M J} |
| 55 | {T τmax τ₁ τ₂ a b : ℝ} (hM04 : RicciFlowCurvatureTheory.{u}) |
| 56 | (hwindow : Icc (T - τmax) T ⊆ J) |
| 57 | (hcurvature : CompleteBoundedCurvatureOn F (Icc (T - τmax) T)) |
| 58 | (hτ₂ : τ₂ ≤ τmax) (p : BackwardTimePath F T τ₁ τ₂) |
| 59 | (hab : a < b) (hAa : Real.sqrt τ₁ ≤ a) (hbB : b ≤ Real.sqrt τ₂) |
| 60 | (x : M) (hsrc : MapsTo (squareReparameterizedCurve p.curve) (Icc a b) |
| 61 | (chartAt (EuclideanSpace ℝ (Fin n)) x).source) : |
| 62 | ContinuousOn ((extChartAt (𝓡 n) x) ∘ squareReparameterizedCurve p.curve) (Icc a b) ∧ |
| 63 | (∀ s ∈ Ioo a b, HasDerivAt |
| 64 | ((extChartAt (𝓡 n) x) ∘ squareReparameterizedCurve p.curve) |
| 65 | (deriv ((extChartAt (𝓡 n) x) ∘ squareReparameterizedCurve p.curve) s) s) ∧ |
| 66 | MemLp (deriv ((extChartAt (𝓡 n) x) ∘ squareReparameterizedCurve p.curve)) |
| 67 | 2 (volume.restrict (Icc a b)) := by |
| 68 | let α := squareReparameterizedCurve p.curve |
| 69 | have hsub : Icc a b ⊆ Icc (Real.sqrt τ₁) (Real.sqrt τ₂) := Icc_subset_Icc hAa hbB |
| 70 | have hsubo : Ioo a b ⊆ Ioo (Real.sqrt τ₁) (Real.sqrt τ₂) := Ioo_subset_Ioo hAa hbB |
| 71 | have hα : ContinuousOn α (Icc a b) := (squarePath_continuousOn p).mono hsub |
| 72 | have hαreg : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) 1 α (Ioo a b) := |
| 73 | (squarePath_regular p).mono hsubo |
| 74 | have hsrc' : MapsTo α (Icc a b) (extChartAt (𝓡 n) x).source := by |
| 75 | simpa only [extChartAt_source] using hsrc |
| 76 | refine ⟨(continuousOn_extChartAt (I := 𝓡 n) x).comp hα hsrc', ?_, ?_⟩ |
| 77 | · intro s hs |
| 78 | have hm := ((hαreg s hs).contMDiffAt (isOpen_Ioo.mem_nhds hs)).mdifferentiableAt |
| 79 | one_ne_zero |
| 80 | have hd := (mdifferentiableAt_extChartAt (hsrc (Ioo_subset_Icc_self hs))).comp s hm |
| 81 | exact hd.differentiableAt.hasDerivAt |
| 82 | · obtain ⟨K, hK, hbound⟩ := hcurvature.2 |
| 83 | have hweighted := (referenceWeightedEnergy_bound hM04 hwindow hK hbound p hτ₂).1 |
| 84 | have henergy := (squarePath_referenceEnergy p (F.metric T) hweighted).1 |
| 85 | have hlocal : IntervalIntegrable (referenceSpeedSq (F.metric T) α) volume a b := by |
| 86 | apply henergy.mono_set |
| 87 | simpa only [uIcc_of_le hab.le, uIcc_of_le (Real.sqrt_le_sqrt p.ordered.le)] using hsub |
| 88 | obtain ⟨c, hc, hcoercive⟩ := chart_velocity_L2_bound (F.metric T) x |
| 89 | (isCompact_Icc.image_of_continuousOn hα) |
| 90 | (by rintro y ⟨s, hs, rfl⟩; exact hsrc hs) |
| 91 | obtain ⟨hLp, _⟩ := hcoercive hab.le α hαreg |
| 92 | (fun s hs ↦ mem_image_of_mem α hs) hlocal le_rfl |
| 93 | exact hLp |
| 94 | |
| 95 | set_option maxHeartbeats 1000000 in |
| 96 | theorem squarePath_chart_phase {J : Set ℝ} {F : RicciFlow n M J} |
| 97 | {T τmax τ₁ τ₂ a b : ℝ} (hM04 : RicciFlowCurvatureTheory.{u}) |
| 98 | (hwindow : Icc (T - τmax) T ⊆ J) |
| 99 | (hcurvature : CompleteBoundedCurvatureOn F (Icc (T - τmax) T)) |
| 100 | (hτ₂ : τ₂ ≤ τmax) (p : BackwardTimePath F T τ₁ τ₂) |
| 101 | (hp : IsBackwardLGeodesic F T τ₁ τ₂ p) |
| 102 | (hab : a < b) (hAa : Real.sqrt τ₁ ≤ a) (hbB : b ≤ Real.sqrt τ₂) |
| 103 | (x : M) (hsrc : MapsTo (squareReparameterizedCurve p.curve) (Icc a b) |
| 104 | (chartAt (EuclideanSpace ℝ (Fin n)) x).source) : |
| 105 | ∃ Pbar : ℝ → EuclideanSpace ℝ (Fin n), |
| 106 | ContDiffOn ℝ ∞ (fun s ↦ |
| 107 | (extChartAt (𝓡 n) x (squareReparameterizedCurve p.curve s), Pbar s)) (Icc a b) ∧ |
| 108 | EqOn Pbar (fun s ↦ chartMetricOperator F T x |
| 109 | (s, extChartAt (𝓡 n) x (squareReparameterizedCurve p.curve s)) |
| 110 | (deriv ((extChartAt (𝓡 n) x) ∘ squareReparameterizedCurve p.curve) s)) (Ioo a b) ∧ |
| 111 | ∀ s ∈ Icc a b, HasDerivWithinAt (fun r ↦ |
| 112 | (extChartAt (𝓡 n) x (squareReparameterizedCurve p.curve r), Pbar r)) |
| 113 | (closedChartEulerPhase F T x (Icc a b) s |
| 114 | (extChartAt (𝓡 n) x (squareReparameterizedCurve p.curve s), Pbar s)) (Icc a b) s := by |
| 115 | let α := squareReparameterizedCurve p.curve |
| 116 | let e := extChartAt (𝓡 n) x |
| 117 | let u := e ∘ α |
| 118 | have hsub : Icc a b ⊆ Icc (Real.sqrt τ₁) (Real.sqrt τ₂) := Icc_subset_Icc hAa hbB |
| 119 | have hsubo : Ioo a b ⊆ Ioo (Real.sqrt τ₁) (Real.sqrt τ₂) := Ioo_subset_Ioo hAa hbB |
| 120 | obtain ⟨hu, hud, hd⟩ := squarePath_chart_derivative_memLp hM04 hwindow hcurvature hτ₂ p |
| 121 | hab hAa hbB x hsrc |
| 122 | have hsrc' : MapsTo α (Icc a b) e.source := by |
| 123 | simpa only [e, extChartAt_source] using hsrc |
| 124 | have htarget : MapsTo u (Icc a b) e.target := fun s hs ↦ e.map_source (hsrc' hs) |
| 125 | have htime (s : ℝ) (hs : s ∈ Icc a b) : T - s ^ 2 ∈ J := by |
| 126 | apply p.time_mem |
| 127 | have hglobal := hsub hs |
| 128 | have hsnonneg := (Real.sqrt_nonneg τ₁).trans hglobal.1 |
| 129 | constructor |
| 130 | · simpa only [Real.sq_sqrt p.nonnegative] using |
| 131 | (sq_le_sq₀ (Real.sqrt_nonneg τ₁) hsnonneg).mpr hglobal.1 |
| 132 | · simpa only [Real.sq_sqrt (p.nonnegative.trans p.ordered.le)] using |
| 133 | (sq_le_sq₀ hsnonneg (Real.sqrt_nonneg τ₂)).mpr hglobal.2 |
| 134 | obtain ⟨E, hE⟩ := exists_regularizedEuler_extension_of_backward hM04 p hp |
| 135 | let E' := restrictOpenVelocityExtension isOpen_Ioo isOpen_Ioo hsubo α E |
| 136 | have hE' (s : ℝ) (hs : s ∈ Ioo a b) : regularizedLGeodesicEquation F T α (Ioo a b) E' s := by |
| 137 | intro W |
| 138 | rw [regularizedEulerResidual_restrictOpenVelocityExtension F T isOpen_Ioo |
| 139 | isOpen_Ioo hsubo α E hs W] |
| 140 | exact hE s (hsubo hs) W |
| 141 | apply endpoint_chart_phase_contDiffOn F hM04 T x hab u (deriv u) hu hud hd htarget htime |
| 142 | intro s hs |
| 143 | have hmomentum := regularized_equation_chart_momentum F hM04 T isOpen_Ioo x α |
| 144 | ((squarePath_regular p).mono hsubo) (hsrc.mono_left Ioo_subset_Icc_self) E' hs |
| 145 | (backwardSquareTime_mem_interior hwindow p.nonnegative p.ordered hτ₂ (hsubo hs)) |
| 146 | (hE' s hs) |
| 147 | rw [spatialWithinFDeriv_eq_spatialFDeriv (isOpen_extChartAt_target (I := 𝓡 n) x) |
| 148 | _ (Icc_mem_nhds hs.1 hs.2) (htarget (Ioo_subset_Icc_self hs)), |
| 149 | spatialWithinFDeriv_eq_spatialFDeriv (isOpen_extChartAt_target (I := 𝓡 n) x) |
| 150 | _ (Icc_mem_nhds hs.1 hs.2) (htarget (Ioo_subset_Icc_self hs))] |
| 151 | exact hmomentum |
| 152 | |
| 153 | set_option maxHeartbeats 1000000 in |
| 154 | theorem squarePath_local_phase {J : Set ℝ} {F : RicciFlow n M J} |
| 155 | {T τmax τ₁ τ₂ s₀ : ℝ} (hM04 : RicciFlowCurvatureTheory.{u}) |
| 156 | (hwindow : Icc (T - τmax) T ⊆ J) |
| 157 | (hcurvature : CompleteBoundedCurvatureOn F (Icc (T - τmax) T)) |
| 158 | (hτ₂ : τ₂ ≤ τmax) (p : BackwardTimePath F T τ₁ τ₂) |
| 159 | (hp : IsBackwardLGeodesic F T τ₁ τ₂ p) |
| 160 | (hs₀ : s₀ ∈ sqrtParameterInterval τ₁ τ₂) : |
| 161 | ∃ (a b : ℝ) (x : M) (Pbar : ℝ → EuclideanSpace ℝ (Fin n)), |
| 162 | a < b ∧ Real.sqrt τ₁ ≤ a ∧ b ≤ Real.sqrt τ₂ ∧ s₀ ∈ Icc a b ∧ |
| 163 | Icc a b ∈ 𝓝[sqrtParameterInterval τ₁ τ₂] s₀ ∧ |
| 164 | MapsTo (squareReparameterizedCurve p.curve) (Icc a b) |
| 165 | (chartAt (EuclideanSpace ℝ (Fin n)) x).source ∧ |
| 166 | ContDiffOn ℝ ∞ (fun s ↦ |
| 167 | (extChartAt (𝓡 n) x (squareReparameterizedCurve p.curve s), Pbar s)) (Icc a b) ∧ |
| 168 | EqOn Pbar (fun s ↦ chartMetricOperator F T x |
| 169 | (s, extChartAt (𝓡 n) x (squareReparameterizedCurve p.curve s)) |
| 170 | (deriv ((extChartAt (𝓡 n) x) ∘ squareReparameterizedCurve p.curve) s)) (Ioo a b) ∧ |
| 171 | ∀ s ∈ Icc a b, HasDerivWithinAt (fun r ↦ |
| 172 | (extChartAt (𝓡 n) x (squareReparameterizedCurve p.curve r), Pbar r)) |
| 173 | (closedChartEulerPhase F T x (Icc a b) s |
| 174 | (extChartAt (𝓡 n) x (squareReparameterizedCurve p.curve s), Pbar s)) (Icc a b) s := by |
| 175 | let A := Real.sqrt τ₁ |
| 176 | let B := Real.sqrt τ₂ |
| 177 | let α := squareReparameterizedCurve p.curve |
| 178 | let x := α s₀ |
| 179 | have hAB : A < B := Real.sqrt_lt_sqrt p.nonnegative p.ordered |
| 180 | obtain ⟨γ, hγ, hγα⟩ := exists_continuous_squarePath_extension p |
| 181 | have hnear : γ ⁻¹' (chartAt (EuclideanSpace ℝ (Fin n)) x).source ∈ 𝓝 s₀ := by |
| 182 | apply hγ.continuousAt.preimage_mem_nhds |
| 183 | apply (chartAt (EuclideanSpace ℝ (Fin n)) x).open_source.mem_nhds |
| 184 | rw [hγα hs₀] |
| 185 | exact mem_chart_source _ _ |
| 186 | obtain ⟨l, r, ⟨hls, hsr⟩, hchart⟩ := mem_nhds_iff_exists_Ioo_subset.mp hnear |
| 187 | let l' := (l + s₀) / 2 |
| 188 | let r' := (s₀ + r) / 2 |
| 189 | let a := max A l' |
| 190 | let b := min B r' |
| 191 | have hll : l < l' := by dsimp only [l']; linarith |
| 192 | have hls' : l' < s₀ := by dsimp only [l']; linarith |
| 193 | have hsr' : s₀ < r' := by dsimp only [r']; linarith |
| 194 | have hrr : r' < r := by dsimp only [r']; linarith |
| 195 | have hAa : A ≤ a := le_max_left _ _ |
| 196 | have hbB : b ≤ B := min_le_left _ _ |
| 197 | have hab : a < b := by |
| 198 | apply max_lt |
| 199 | · exact lt_min hAB (lt_of_le_of_lt hs₀.1 hsr') |
| 200 | · exact lt_min (lt_of_lt_of_le hls' hs₀.2) (hls'.trans hsr') |
| 201 | have hsab : s₀ ∈ Icc a b := |
| 202 | ⟨max_le hs₀.1 hls'.le, le_min hs₀.2 hsr'.le⟩ |
| 203 | have hnhds : Icc a b ∈ 𝓝[sqrtParameterInterval τ₁ τ₂] s₀ := by |
| 204 | apply mem_nhdsWithin_iff_exists_mem_nhds_inter.mpr |
| 205 | refine ⟨Ioo l' r', Ioo_mem_nhds hls' hsr', ?_⟩ |
| 206 | intro s hs |
| 207 | exact ⟨max_le hs.2.1 hs.1.1.le, le_min hs.2.2 hs.1.2.le⟩ |
| 208 | have hsrc : MapsTo α (Icc a b) (chartAt (EuclideanSpace ℝ (Fin n)) x).source := by |
| 209 | intro s hs |
| 210 | have h := hchart ⟨hll.trans_le ((le_max_right _ _).trans hs.1), |
| 211 | (hs.2.trans (min_le_right _ _)).trans_lt hrr⟩ |
| 212 | change γ s ∈ (chartAt (EuclideanSpace ℝ (Fin n)) x).source at h |
| 213 | rwa [hγα ⟨hAa.trans hs.1, hs.2.trans hbB⟩] at h |
| 214 | obtain ⟨Pbar, hsm, hag, hd⟩ := squarePath_chart_phase hM04 hwindow hcurvature hτ₂ p hp |
| 215 | hab hAa hbB x hsrc |
| 216 | exact ⟨a, b, x, Pbar, hab, hAa, hbB, hsab, hnhds, hsrc, hsm, hag, hd⟩ |
| 217 | |
| 218 | theorem squarePath_contMDiffOn_of_euler {J : Set ℝ} {F : RicciFlow n M J} |
| 219 | {T τmax τ₁ τ₂ : ℝ} (hM04 : RicciFlowCurvatureTheory.{u}) |
| 220 | (hwindow : Icc (T - τmax) T ⊆ J) |
| 221 | (hcurvature : CompleteBoundedCurvatureOn F (Icc (T - τmax) T)) |
| 222 | (hτ₂ : τ₂ ≤ τmax) (p : BackwardTimePath F T τ₁ τ₂) |
| 223 | (hp : IsBackwardLGeodesic F T τ₁ τ₂ p) : |
| 224 | ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ (squareReparameterizedCurve p.curve) |
| 225 | (sqrtParameterInterval τ₁ τ₂) := by |
| 226 | intro s hs |
| 227 | obtain ⟨a, b, x, Pbar, _, _, _, hsab, hnhds, hsrc, hsm, _, _⟩ := |
| 228 | squarePath_local_phase hM04 hwindow hcurvature hτ₂ p hp hs |
| 229 | let e := extChartAt (𝓡 n) x |
| 230 | let α := squareReparameterizedCurve p.curve |
| 231 | have hsrc' : MapsTo α (Icc a b) e.source := by |
| 232 | simpa only [e, extChartAt_source] using hsrc |
| 233 | have htarget : MapsTo (e ∘ α) (Icc a b) e.target := |
| 234 | fun r hr ↦ e.map_source (hsrc' hr) |
| 235 | have hcomp := (contMDiffOn_extChartAt_symm (I := 𝓡 n) x).comp |
| 236 | hsm.fst.contMDiffOn htarget |
| 237 | have hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α (Icc a b) := |
| 238 | hcomp.congr (fun r hr ↦ (e.left_inv (hsrc' hr)).symm) |
| 239 | exact (hα s hsab).mono_of_mem_nhdsWithin hnhds |
| 240 | |
| 241 | end PoincareMT.LGeometry |