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.Variation.Coordinates.ChartEulerCoefficients |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Minimization.Charts.ChartStationarity |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Variation.Extension.BackwardEulerTransport |
| 4 | |
| 5 | /-! Adapted from Mapher `PoincareMT/Proofs/M08/ChartEulerEquation.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 | |
| 24 | local instance chartEulerEquationInstance1 : NormedAddCommGroup (EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 25 | ContinuousLinearMap.toNormedAddCommGroup |
| 26 | local instance chartEulerEquationInstance2 : NormedSpace ℝ (EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 27 | ContinuousLinearMap.toNormedSpace |
| 28 | local instance chartEulerEquationInstance3 : |
| 29 | NormedAddCommGroup (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 30 | ContinuousLinearMap.toNormedAddCommGroup |
| 31 | local instance chartEulerEquationInstance4 : |
| 32 | NormedSpace ℝ (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 33 | ContinuousLinearMap.toNormedSpace |
| 34 | |
| 35 | theorem chart_curve_contDiffOn {I : Set ℝ} (x : M) (α : ℝ → M) |
| 36 | (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α I) |
| 37 | (hsrc : MapsTo α I (chartAt (EuclideanSpace ℝ (Fin n)) x).source) : |
| 38 | ContDiffOn ℝ ∞ ((extChartAt (𝓡 n) x) ∘ α) I := by |
| 39 | apply ContMDiffOn.contDiffOn |
| 40 | apply (contMDiffOn_extChartAt (I := 𝓡 n) (x := x)).comp hα |
| 41 | intro r hr |
| 42 | simpa only [mem_preimage, extChartAt_source] using hsrc hr |
| 43 | |
| 44 | noncomputable def chartVelocityExtension {I : Set ℝ} (hI : IsOpen I) |
| 45 | (x : M) (α : ℝ → M) (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α I) |
| 46 | (hsrc : MapsTo α I (chartAt (EuclideanSpace ℝ (Fin n)) x).source) : |
| 47 | ParametricAlongCurveExtensionOn I α (curveVelocityWithin (n := n) α I) := by |
| 48 | let e := trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) x |
| 49 | let u := (extChartAt (𝓡 n) x) ∘ α |
| 50 | have hu : ContDiffOn ℝ ∞ u I := chart_curve_contDiffOn x α hα hsrc |
| 51 | have hq : ContDiffOn ℝ ∞ (deriv u) I := hu.deriv_of_isOpen hI (by simp) |
| 52 | refine parametricExtensionInChart e (deriv u) hI Subset.rfl hsrc hq.contMDiffOn ?_ |
| 53 | intro s hs |
| 54 | change e.symm (α s) (deriv ((extChartAt (𝓡 n) x) ∘ α) s) = _ |
| 55 | rw [← e.symmL_apply (R := ℝ) (hsrc hs), chart_deriv_eq_velocity (hsrc hs) |
| 56 | (((hα s hs).contMDiffAt (hI.mem_nhds hs)).mdifferentiableAt (by simp)), |
| 57 | e.symmL_continuousLinearMapAt (hsrc hs)] |
| 58 | simp only [curveVelocityWithin, curveVelocity, mfderivWithin_of_mem_nhds (hI.mem_nhds hs)] |
| 59 | |
| 60 | theorem chartVelocityExtension_apply {I : Set ℝ} (hI : IsOpen I) |
| 61 | (x : M) (α : ℝ → M) (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α I) |
| 62 | (hsrc : MapsTo α I (chartAt (EuclideanSpace ℝ (Fin n)) x).source) |
| 63 | (s : ℝ) {y : M} (hy : y ∈ (chartAt (EuclideanSpace ℝ (Fin n)) x).source) : |
| 64 | (chartVelocityExtension hI x α hα hsrc).extension s y = |
| 65 | chartFrame x (deriv ((extChartAt (𝓡 n) x) ∘ α) s) y := by |
| 66 | exact (Bundle.Trivialization.symmL_apply (R := ℝ) |
| 67 | (trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) x) hy _).symm |
| 68 | |
| 69 | theorem chartVelocityExtension_deriv {I : Set ℝ} (hI : IsOpen I) |
| 70 | (x : M) (α : ℝ → M) (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α I) |
| 71 | (hsrc : MapsTo α I (chartAt (EuclideanSpace ℝ (Fin n)) x).source) |
| 72 | {s : ℝ} (hs : s ∈ I) {y : M} |
| 73 | (hy : y ∈ (chartAt (EuclideanSpace ℝ (Fin n)) x).source) : |
| 74 | deriv (fun r ↦ (chartVelocityExtension hI x α hα hsrc).extension r y) s = |
| 75 | chartFrame x (deriv (deriv ((extChartAt (𝓡 n) x) ∘ α)) s) y := by |
| 76 | let : NormedAddCommGroup (TangentSpace (𝓡 n) y) := |
| 77 | inferInstanceAs (NormedAddCommGroup (EuclideanSpace ℝ (Fin n))) |
| 78 | let : NormedSpace ℝ (TangentSpace (𝓡 n) y) := |
| 79 | inferInstanceAs (NormedSpace ℝ (EuclideanSpace ℝ (Fin n))) |
| 80 | let e := trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) x |
| 81 | let u := (extChartAt (𝓡 n) x) ∘ α |
| 82 | have hu : ContDiffOn ℝ ∞ u I := chart_curve_contDiffOn x α hα hsrc |
| 83 | have hq : ContDiffOn ℝ ∞ (deriv u) I := hu.deriv_of_isOpen hI (by simp) |
| 84 | have hqd := ((hq s hs).contDiffAt (hI.mem_nhds hs)).differentiableAt (by simp) |
| 85 | have heq : (fun r ↦ (chartVelocityExtension hI x α hα hsrc).extension r y) = |
| 86 | fun r ↦ e.symmL ℝ y (deriv u r) := |
| 87 | funext (fun r ↦ chartVelocityExtension_apply hI x α hα hsrc r hy) |
| 88 | rw [heq] |
| 89 | exact ((e.symmL ℝ y).hasFDerivAt.comp_hasDerivAt s hqd.hasDerivAt).deriv |
| 90 | |
| 91 | theorem chartVelocityExtension_pullback {J I : Set ℝ} (F : RicciFlow n M J) |
| 92 | (time : ℝ → ℝ) (hI : IsOpen I) |
| 93 | (x : M) (α : ℝ → M) (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α I) |
| 94 | (hsrc : MapsTo α I (chartAt (EuclideanSpace ℝ (Fin n)) x).source) |
| 95 | {s : ℝ} (hs : s ∈ I) : |
| 96 | pullbackCovariantDerivative F time α (curveVelocityWithin (n := n) α I) I |
| 97 | (chartVelocityExtension hI x α hα hsrc) s = |
| 98 | chartFrame x (deriv (deriv ((extChartAt (𝓡 n) x) ∘ α)) s) (α s) + |
| 99 | (F.connection (time s)).connection |
| 100 | (chartFrame x (deriv ((extChartAt (𝓡 n) x) ∘ α) s)) (α s) |
| 101 | (chartFrame x (deriv ((extChartAt (𝓡 n) x) ∘ α) s) (α s)) := by |
| 102 | let E := chartVelocityExtension hI x α hα hsrc |
| 103 | let q := deriv ((extChartAt (𝓡 n) x) ∘ α) |
| 104 | have heq : E.extension s =ᶠ[𝓝 (α s)] chartFrame x (q s) := by |
| 105 | filter_upwards [(chartAt (EuclideanSpace ℝ (Fin n)) x).open_source.mem_nhds (hsrc hs)] |
| 106 | with y hy |
| 107 | exact chartVelocityExtension_apply hI x α hα hsrc s hy |
| 108 | have hE := (parametricExtension_contMDiffAt_space E (E.graph_mem s hs)).mdifferentiableAt |
| 109 | (by simp) |
| 110 | have hframe := ((chartFrame_contMDiffOn x (q s) (α s) (hsrc hs)).contMDiffAt |
| 111 | ((chartAt (EuclideanSpace ℝ (Fin n)) x).open_source.mem_nhds (hsrc hs))).mdifferentiableAt |
| 112 | (by simp) |
| 113 | have hcov := (F.connection (time s)).connection.isCovariantDerivativeOn.congr_of_eventuallyEq |
| 114 | hE hframe univ_mem heq |
| 115 | have hvel : curveVelocityWithin (n := n) α I s = chartFrame x (q s) (α s) := |
| 116 | (E.agrees s hs).symm.trans (chartVelocityExtension_apply hI x α hα hsrc s (hsrc hs)) |
| 117 | unfold pullbackCovariantDerivative |
| 118 | rw [chartVelocityExtension_deriv hI x α hα hsrc hs (hsrc hs), hcov, hvel] |
| 119 | |
| 120 | set_option maxHeartbeats 800000 in |
| 121 | theorem chart_momentum_regularized_equation {J I : Set ℝ} (F : RicciFlow n M J) |
| 122 | (hM04 : RicciFlowCurvatureTheory.{u}) (T : ℝ) (hI : IsOpen I) |
| 123 | (x : M) (α : ℝ → M) (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α I) |
| 124 | (hsrc : MapsTo α I (chartAt (EuclideanSpace ℝ (Fin n)) x).source) |
| 125 | {s : ℝ} (hs : s ∈ I) (ht : T - s ^ 2 ∈ interior J) |
| 126 | (hmomentum : |
| 127 | HasDerivAt (fun r ↦ chartMomentumVector |
| 128 | (chartActionMetric F T x (r, extChartAt (𝓡 n) x (α r))) |
| 129 | (deriv ((extChartAt (𝓡 n) x) ∘ α) r)) |
| 130 | (chartForceVector |
| 131 | (spatialFDeriv (chartActionMetric F T x) (s, extChartAt (𝓡 n) x (α s))) |
| 132 | (spatialFDeriv (chartActionPotential F T x) (s, extChartAt (𝓡 n) x (α s))) |
| 133 | (deriv ((extChartAt (𝓡 n) x) ∘ α) s)) s) : |
| 134 | regularizedLGeodesicEquation F T α I (chartVelocityExtension hI x α hα hsrc) s := by |
| 135 | let u := (extChartAt (𝓡 n) x) ∘ α |
| 136 | let q := deriv u |
| 137 | let E := chartVelocityExtension hI x α hα hsrc |
| 138 | have hu : ContDiffOn ℝ ∞ u I := chart_curve_contDiffOn x α hα hsrc |
| 139 | have hq : ContDiffOn ℝ ∞ q I := hu.deriv_of_isOpen hI (by simp) |
| 140 | have hud := ((hu s hs).contDiffAt (hI.mem_nhds hs)).differentiableAt (by simp) |
| 141 | have hqd := ((hq s hs).contDiffAt (hI.mem_nhds hs)).differentiableAt (by simp) |
| 142 | intro W |
| 143 | let z := (trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) x).continuousLinearMapAt |
| 144 | ℝ (α s) W |
| 145 | have hW : chartFrame x z (α s) = W := |
| 146 | Bundle.Trivialization.symmL_continuousLinearMapAt |
| 147 | (trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) x) (hsrc hs) W |
| 148 | have hpair : HasDerivAt (fun r ↦ chartActionMetric F T x (r, u r) (q r) z) |
| 149 | (spatialFDeriv (chartActionMetric F T x) (s, u s) z (q s) (q s) / 2 + |
| 150 | spatialFDeriv (chartActionPotential F T x) (s, u s) z) s := by |
| 151 | simpa only [u, q, Function.comp_def, innerSL_apply_apply, |
| 152 | chartMomentumVector_inner, chartForceVector_inner] |
| 153 | using ((innerSL ℝ z).hasFDerivAt.comp_hasDerivAt s hmomentum) |
| 154 | have hmetric := chartActionMetric_curve_derivative F T (hsrc hs) ht hud.hasDerivAt |
| 155 | hqd.hasDerivAt (rfl : u s = extChartAt (𝓡 n) x (α s)) z |
| 156 | have hscalar := hmetric.unique hpair |
| 157 | have hvel : curveVelocityWithin (n := n) α I s = chartFrame x (q s) (α s) := |
| 158 | (E.agrees s hs).symm.trans (chartVelocityExtension_apply hI x α hα hsrc s (hsrc hs)) |
| 159 | have hpot := chartActionPotential_spatial_apply F hM04 T (hsrc hs) ht z |
| 160 | rw [← hW] |
| 161 | unfold regularizedEulerResidual |
| 162 | rw [chartVelocityExtension_pullback F (fun r ↦ T - r ^ 2) hI x α hα hsrc hs, hvel, |
| 163 | map_add, ContinuousLinearMap.add_apply, |
| 164 | ← chartActionMetric_apply F T (hsrc hs) s, |
| 165 | chartActionMetric_connection_diagonal F T (hsrc hs) ht] |
| 166 | unfold scalarCurvatureDifferential |
| 167 | rw [← hpot] |
| 168 | dsimp only [u, q, Function.comp_apply] at hscalar ⊢ |
| 169 | linarith |
| 170 | |
| 171 | end PoincareMT.LGeometry |