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.EndpointEulerCoefficients |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Regularity.ChartEulerEquation |
| 3 | |
| 4 | /-! Adapted from Mapher `PoincareMT/Proofs/M08/EndpointEulerEquation.lean` at |
| 5 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. -/ |
| 6 | |
| 7 | |
| 8 | set_option autoImplicit false |
| 9 | set_option backward.isDefEq.respectTransparency false |
| 10 | |
| 11 | noncomputable section |
| 12 | |
| 13 | open Set Filter Topology |
| 14 | open scoped Manifold ContDiff Bundle |
| 15 | |
| 16 | universe u |
| 17 | |
| 18 | namespace PoincareMT.LGeometry |
| 19 | |
| 20 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 21 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 22 | |
| 23 | local instance endpointEulerEquationInstance1 : NormedAddCommGroup (EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 24 | ContinuousLinearMap.toNormedAddCommGroup |
| 25 | local instance endpointEulerEquationInstance2 : NormedSpace ℝ (EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 26 | ContinuousLinearMap.toNormedSpace |
| 27 | local instance endpointEulerEquationInstance3 : |
| 28 | NormedAddCommGroup (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 29 | ContinuousLinearMap.toNormedAddCommGroup |
| 30 | local instance endpointEulerEquationInstance4 : |
| 31 | NormedSpace ℝ (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 32 | ContinuousLinearMap.toNormedSpace |
| 33 | |
| 34 | theorem curveVelocityWithin_eq_of_uniqueDiff {C U : Set ℝ} (hU : IsOpen U) |
| 35 | (hCU : C ⊆ U) (hC : UniqueDiffOn ℝ C) (α : ℝ → M) |
| 36 | (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α U) {s : ℝ} (hs : s ∈ C) : |
| 37 | curveVelocityWithin (n := n) α C s = curveVelocityWithin (n := n) α U s := by |
| 38 | unfold curveVelocityWithin |
| 39 | rw [mfderivWithin_eq_mfderiv (hC s hs).uniqueMDiffWithinAt |
| 40 | (((hα s (hCU hs)).contMDiffAt (hU.mem_nhds (hCU hs))).mdifferentiableAt (by simp)), |
| 41 | mfderivWithin_of_mem_nhds (hU.mem_nhds (hCU hs))] |
| 42 | |
| 43 | def chartVelocityExtensionWithin {C U : Set ℝ} (hU : IsOpen U) |
| 44 | (hCU : C ⊆ U) (hC : UniqueDiffOn ℝ C) (x : M) (α : ℝ → M) |
| 45 | (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α U) |
| 46 | (hsrc : MapsTo α U (chartAt (EuclideanSpace ℝ (Fin n)) x).source) : |
| 47 | ParametricAlongCurveExtensionOn C α (curveVelocityWithin (n := n) α C) where |
| 48 | extension := (chartVelocityExtension hU x α hα hsrc).extension |
| 49 | domain := (chartVelocityExtension hU x α hα hsrc).domain |
| 50 | open_domain := (chartVelocityExtension hU x α hα hsrc).open_domain |
| 51 | graph_mem s hs := (chartVelocityExtension hU x α hα hsrc).graph_mem s (hCU hs) |
| 52 | smooth := (chartVelocityExtension hU x α hα hsrc).smooth |
| 53 | agrees s hs := ((chartVelocityExtension hU x α hα hsrc).agrees s (hCU hs)).trans |
| 54 | (curveVelocityWithin_eq_of_uniqueDiff hU hCU hC α hα hs).symm |
| 55 | |
| 56 | theorem chartVelocityExtensionWithin_pullback {J C U : Set ℝ} (F : RicciFlow n M J) |
| 57 | (time : ℝ → ℝ) (hU : IsOpen U) (hCU : C ⊆ U) (hC : UniqueDiffOn ℝ C) |
| 58 | (x : M) (α : ℝ → M) (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α U) |
| 59 | (hsrc : MapsTo α U (chartAt (EuclideanSpace ℝ (Fin n)) x).source) |
| 60 | {s : ℝ} (hs : s ∈ C) : |
| 61 | pullbackCovariantDerivative F time α (curveVelocityWithin (n := n) α C) C |
| 62 | (chartVelocityExtensionWithin hU hCU hC x α hα hsrc) s = |
| 63 | chartFrame x (deriv (deriv ((extChartAt (𝓡 n) x) ∘ α)) s) (α s) + |
| 64 | (F.connection (time s)).connection |
| 65 | (chartFrame x (deriv ((extChartAt (𝓡 n) x) ∘ α) s)) (α s) |
| 66 | (chartFrame x (deriv ((extChartAt (𝓡 n) x) ∘ α) s) (α s)) := by |
| 67 | have h := chartVelocityExtension_pullback F time hU x α hα hsrc (hCU hs) |
| 68 | unfold pullbackCovariantDerivative chartVelocityExtensionWithin |
| 69 | rw [curveVelocityWithin_eq_of_uniqueDiff hU hCU hC α hα hs] |
| 70 | exact h |
| 71 | |
| 72 | set_option maxHeartbeats 1000000 in |
| 73 | theorem closed_chart_momentum_regularized_equation {J C U : Set ℝ} (F : RicciFlow n M J) |
| 74 | (hM04 : RicciFlowCurvatureTheory.{u}) (T : ℝ) |
| 75 | (hU : IsOpen U) (hCU : C ⊆ U) (hC : UniqueDiffOn ℝ C) |
| 76 | (x : M) (α : ℝ → M) (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α U) |
| 77 | (hsrc : MapsTo α U (chartAt (EuclideanSpace ℝ (Fin n)) x).source) |
| 78 | (htime : ∀ r ∈ C, T - r ^ 2 ∈ J) {s : ℝ} (hs : s ∈ C) |
| 79 | (hmomentum : HasDerivWithinAt (fun r ↦ chartMomentumVector |
| 80 | (chartActionMetric F T x (r, extChartAt (𝓡 n) x (α r))) |
| 81 | (deriv ((extChartAt (𝓡 n) x) ∘ α) r)) |
| 82 | (chartForceVector |
| 83 | (spatialWithinFDeriv C (extChartAt (𝓡 n) x).target (chartActionMetric F T x) |
| 84 | (s, extChartAt (𝓡 n) x (α s))) |
| 85 | (spatialWithinFDeriv C (extChartAt (𝓡 n) x).target (chartActionPotential F T x) |
| 86 | (s, extChartAt (𝓡 n) x (α s))) |
| 87 | (deriv ((extChartAt (𝓡 n) x) ∘ α) s)) C s) : |
| 88 | regularizedLGeodesicEquation F T α C |
| 89 | (chartVelocityExtensionWithin hU hCU hC x α hα hsrc) s := by |
| 90 | let u := (extChartAt (𝓡 n) x) ∘ α |
| 91 | let q := deriv u |
| 92 | let E := chartVelocityExtensionWithin hU hCU hC x α hα hsrc |
| 93 | have hu : ContDiffOn ℝ ∞ u U := chart_curve_contDiffOn x α hα hsrc |
| 94 | have hq : ContDiffOn ℝ ∞ q U := hu.deriv_of_isOpen hU (by simp) |
| 95 | have hud := ((hu s (hCU hs)).contDiffAt (hU.mem_nhds (hCU hs))).differentiableAt (by simp) |
| 96 | have hqd := ((hq s (hCU hs)).contDiffAt (hU.mem_nhds (hCU hs))).differentiableAt (by simp) |
| 97 | have htarget : MapsTo u C (extChartAt (𝓡 n) x).target := by |
| 98 | intro r hr |
| 99 | apply (extChartAt (𝓡 n) x).map_source |
| 100 | simpa only [extChartAt_source] using hsrc (hCU hr) |
| 101 | intro W |
| 102 | let z := (trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) x).continuousLinearMapAt |
| 103 | ℝ (α s) W |
| 104 | have hW : chartFrame x z (α s) = W := |
| 105 | Bundle.Trivialization.symmL_continuousLinearMapAt |
| 106 | (trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) x) (hsrc (hCU hs)) W |
| 107 | have hpair : HasDerivWithinAt (fun r ↦ chartActionMetric F T x (r, u r) (q r) z) |
| 108 | (spatialWithinFDeriv C (extChartAt (𝓡 n) x).target (chartActionMetric F T x) |
| 109 | (s, u s) z (q s) (q s) / 2 + |
| 110 | spatialWithinFDeriv C (extChartAt (𝓡 n) x).target (chartActionPotential F T x) |
| 111 | (s, u s) z) C s := by |
| 112 | simpa only [u, q, Function.comp_def, innerSL_apply_apply, |
| 113 | chartMomentumVector_inner, chartForceVector_inner] |
| 114 | using ((innerSL ℝ z).hasFDerivAt.comp_hasDerivWithinAt s hmomentum) |
| 115 | have hmetric := chartActionMetric_closed_curve_derivative F T htime (hsrc (hCU hs)) hs |
| 116 | (hC s hs) hud.hasDerivAt hqd.hasDerivAt (rfl : u s = extChartAt (𝓡 n) x (α s)) htarget z |
| 117 | have hscalar := (hmetric.derivWithin (hC s hs)).symm.trans (hpair.derivWithin (hC s hs)) |
| 118 | have hvel : curveVelocityWithin (n := n) α C s = chartFrame x (q s) (α s) := |
| 119 | (E.agrees s hs).symm.trans |
| 120 | (chartVelocityExtension_apply hU x α hα hsrc s (hsrc (hCU hs))) |
| 121 | have hpot := chartActionPotential_closed_spatial_apply F hM04 T htime (hsrc (hCU hs)) hs z |
| 122 | rw [← hW] |
| 123 | unfold regularizedEulerResidual |
| 124 | rw [chartVelocityExtensionWithin_pullback F (fun r ↦ T - r ^ 2) hU hCU hC x α hα hsrc hs, |
| 125 | hvel, map_add, add_apply, ← chartActionMetric_apply F T (hsrc (hCU hs)) s, |
| 126 | chartActionMetric_closed_connection_diagonal F T htime (hsrc (hCU hs)) hs] |
| 127 | unfold scalarCurvatureDifferential |
| 128 | rw [← hpot] |
| 129 | dsimp only [u, q, Function.comp_apply] at hscalar ⊢ |
| 130 | linarith |
| 131 | |
| 132 | set_option maxHeartbeats 800000 in |
| 133 | theorem closed_phase_momentum_of_eqOn {J C U : Set ℝ} (F : RicciFlow n M J) |
| 134 | (T : ℝ) (x : M) (hU : IsOpen U) (hCU : C ⊆ U) (hC : UniqueDiffOn ℝ C) |
| 135 | (u v Pbar : ℝ → EuclideanSpace ℝ (Fin n)) |
| 136 | (hv : ContDiffOn ℝ ∞ v U) (hvu : EqOn v u C) |
| 137 | (htarget : MapsTo u C (extChartAt (𝓡 n) x).target) |
| 138 | (hphase : ∀ s ∈ C, HasDerivWithinAt (fun r ↦ (u r, Pbar r)) |
| 139 | (closedChartEulerPhase F T x C s (u s, Pbar s)) C s) : |
| 140 | ∀ s ∈ C, HasDerivWithinAt |
| 141 | (fun r ↦ chartMomentumVector (chartActionMetric F T x (r, v r)) (deriv v r)) |
| 142 | (chartForceVector |
| 143 | (spatialWithinFDeriv C (extChartAt (𝓡 n) x).target (chartActionMetric F T x) (s, v s)) |
| 144 | (spatialWithinFDeriv C (extChartAt (𝓡 n) x).target (chartActionPotential F T x) (s, v s)) |
| 145 | (deriv v s)) C s := by |
| 146 | have hderiv (s : ℝ) (hs : s ∈ C) : |
| 147 | deriv v s = Ring.inverse (chartMetricOperator F T x (s, u s)) (Pbar s) := by |
| 148 | have hud : HasDerivWithinAt u |
| 149 | (Ring.inverse (chartMetricOperator F T x (s, u s)) (Pbar s)) C s := (hphase s hs).fst |
| 150 | have hvd : HasDerivWithinAt v (deriv v s) C s := |
| 151 | (((hv s (hCU hs)).contDiffAt (hU.mem_nhds (hCU hs))).differentiableAt |
| 152 | (by simp)).hasDerivAt.hasDerivWithinAt |
| 153 | exact (hvd.derivWithin (hC s hs)).symm.trans |
| 154 | ((hud.congr_of_mem hvu hs).derivWithin (hC s hs)) |
| 155 | have hmomentum : EqOn |
| 156 | (fun r ↦ chartMomentumVector (chartActionMetric F T x (r, v r)) (deriv v r)) Pbar C := by |
| 157 | intro s hs |
| 158 | change chartMetricOperator F T x (s, v s) (deriv v s) = Pbar s |
| 159 | rw [hvu hs, hderiv s hs] |
| 160 | exact congrArg (fun A : EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) ↦ A (Pbar s)) |
| 161 | (Ring.mul_inverse_cancel _ (chartMetricOperator_isUnit_of_target F T x (htarget hs))) |
| 162 | intro s hs |
| 163 | have hPd : HasDerivWithinAt Pbar |
| 164 | (chartForceVector |
| 165 | (spatialWithinFDeriv C (extChartAt (𝓡 n) x).target (chartActionMetric F T x) (s, u s)) |
| 166 | (spatialWithinFDeriv C (extChartAt (𝓡 n) x).target (chartActionPotential F T x) (s, u s)) |
| 167 | (Ring.inverse (chartMetricOperator F T x (s, u s)) (Pbar s))) C s := (hphase s hs).snd |
| 168 | rw [← hderiv s hs, ← hvu hs] at hPd |
| 169 | exact hPd.congr_of_mem hmomentum hs |
| 170 | |
| 171 | end PoincareMT.LGeometry |
| 172 |