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.Jacobi.Index.WeightedJacobiCoefficients |
| 2 | |
| 3 | /-! Adapted from Mapher `PoincareMT/Proofs/M08/WeightedJacobiIdentities.lean` at |
| 4 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. -/ |
| 5 | |
| 6 | |
| 7 | set_option autoImplicit false |
| 8 | set_option backward.isDefEq.respectTransparency false |
| 9 | |
| 10 | noncomputable section |
| 11 | |
| 12 | open Set Filter Topology |
| 13 | open scoped Manifold ContDiff Bundle |
| 14 | |
| 15 | universe u |
| 16 | |
| 17 | namespace PoincareMT.LGeometry |
| 18 | |
| 19 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 20 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 21 | |
| 22 | local instance weightedJacobiIdentitiesDualGroup : |
| 23 | NormedAddCommGroup (EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 24 | ContinuousLinearMap.toNormedAddCommGroup |
| 25 | local instance weightedJacobiIdentitiesDualSpace : |
| 26 | NormedSpace ℝ (EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 27 | ContinuousLinearMap.toNormedSpace |
| 28 | local instance weightedJacobiIdentitiesBilinGroup : |
| 29 | NormedAddCommGroup (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 30 | ContinuousLinearMap.toNormedAddCommGroup |
| 31 | local instance weightedJacobiIdentitiesBilinSpace : |
| 32 | NormedSpace ℝ (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 33 | ContinuousLinearMap.toNormedSpace |
| 34 | local instance weightedJacobiIdentitiesEndGroup : |
| 35 | NormedAddCommGroup (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n)) := |
| 36 | ContinuousLinearMap.toNormedAddCommGroup |
| 37 | local instance weightedJacobiIdentitiesEndSpace : |
| 38 | NormedSpace ℝ (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n)) := |
| 39 | ContinuousLinearMap.toNormedSpace |
| 40 | local instance weightedJacobiIdentitiesConnectionGroup : |
| 41 | NormedAddCommGroup (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] |
| 42 | EuclideanSpace ℝ (Fin n)) := ContinuousLinearMap.toNormedAddCommGroup |
| 43 | local instance weightedJacobiIdentitiesConnectionSpace : |
| 44 | NormedSpace ℝ (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] |
| 45 | EuclideanSpace ℝ (Fin n)) := ContinuousLinearMap.toNormedSpace |
| 46 | |
| 47 | set_option maxHeartbeats 1600000 in |
| 48 | theorem weighted_chart_hessian {J C : Set ℝ} (F : RicciFlow n M J) |
| 49 | (hM04 : RicciFlowCurvatureTheory.{u}) (T : ℝ) (hC : UniqueDiffOn ℝ C) |
| 50 | (htime : ∀ s ∈ C, T - s ^ 2 ∈ J) |
| 51 | {x y : M} (hy : y ∈ (chartAt (EuclideanSpace ℝ (Fin n)) x).source) |
| 52 | {s : ℝ} (hs : s ∈ C) (v w : EuclideanSpace ℝ (Fin n)) : |
| 53 | chartHessianForm (closedChartConnection F T x C (s, extChartAt (𝓡 n) x y)) |
| 54 | (spatialWithinFDeriv C (extChartAt (𝓡 n) x).target |
| 55 | (chartActionPotential F T x) (s, extChartAt (𝓡 n) x y)) |
| 56 | (spatialWithinFDeriv C (extChartAt (𝓡 n) x).target |
| 57 | (spatialWithinFDeriv C (extChartAt (𝓡 n) x).target |
| 58 | (chartActionPotential F T x)) (s, extChartAt (𝓡 n) x y)) v w = |
| 59 | 2 * s ^ 2 * (F.connection (T - s ^ 2)).hessian |
| 60 | (F.connection (T - s ^ 2)).scalarCurvature y (chartFrame x v y) (chartFrame x w y) := by |
| 61 | let e := extChartAt (𝓡 n) x |
| 62 | let U := e.target |
| 63 | let P := chartActionPotential F T x |
| 64 | let f := (F.connection (T - s ^ 2)).scalarCurvature |
| 65 | let f₀ := f ∘ e.symm |
| 66 | have hU : IsOpen U := isOpen_extChartAt_target (I := 𝓡 n) x |
| 67 | have hq : e y ∈ U := e.map_source (by simpa only [e, extChartAt_source] using hy) |
| 68 | have hf : ContMDiff (𝓡 n) (𝓘(ℝ, ℝ)) ∞ f := |
| 69 | fun p ↦ scalarCurvature_slice_contMDiffAt_of_mem F hM04 (htime s hs) p |
| 70 | have hf₀ (q : EuclideanSpace ℝ (Fin n)) (hq : q ∈ U) : ContDiffAt ℝ ∞ f₀ q := |
| 71 | (hf.contMDiffAt.comp q |
| 72 | (((contMDiffOn_extChartAt_symm (I := 𝓡 n) (n := ∞) x) q hq).contMDiffAt |
| 73 | (hU.mem_nhds hq))).contDiffAt |
| 74 | have hP := chartActionPotential_closed_contDiffOn F hM04 T x htime |
| 75 | have hD := spatialWithinFDeriv_contDiffOn hC hU P hP |
| 76 | have hfirst (q : EuclideanSpace ℝ (Fin n)) (hq : q ∈ U) : |
| 77 | spatialWithinFDeriv C U P (s, q) = (2 * s ^ 2) • fderiv ℝ f₀ q := by |
| 78 | have hd := hasFDerivAt_spatialWithin hU P hP hs hq |
| 79 | have hscaled : HasFDerivAt (fun r ↦ P (s, r)) |
| 80 | ((2 * s ^ 2) • fderiv ℝ f₀ q) q := by |
| 81 | convert ((hf₀ q hq).differentiableAt (by simp)).hasFDerivAt.const_smul (2 * s ^ 2) |
| 82 | using 1 <;> rfl |
| 83 | exact hd.unique hscaled |
| 84 | have hfd : DifferentiableAt ℝ (fderiv ℝ f₀) (e y) := |
| 85 | ((hf₀ (e y) hq).fderiv_right (m := ∞) (by simp)).differentiableAt (by simp) |
| 86 | have hsecond : spatialWithinFDeriv C U (spatialWithinFDeriv C U P) (s, e y) = |
| 87 | (2 * s ^ 2) • fderiv ℝ (fderiv ℝ f₀) (e y) := by |
| 88 | have hd := hasFDerivAt_spatialWithin hU _ hD hs hq |
| 89 | have hscaled : HasFDerivAt (fun r ↦ spatialWithinFDeriv C U P (s, r)) |
| 90 | ((2 * s ^ 2) • fderiv ℝ (fderiv ℝ f₀) (e y)) (e y) := by |
| 91 | apply (hfd.hasFDerivAt.const_smul (2 * s ^ 2)).congr_of_eventuallyEq |
| 92 | filter_upwards [hU.mem_nhds hq] with r hr |
| 93 | exact hfirst r hr |
| 94 | exact hd.unique hscaled |
| 95 | change chartHessianForm (closedChartConnection F T x C (s, e y)) |
| 96 | (spatialWithinFDeriv C U P (s, e y)) |
| 97 | (spatialWithinFDeriv C U (spatialWithinFDeriv C U P) (s, e y)) v w = _ |
| 98 | rw [chartHessianForm_apply, hfirst (e y) hq, hsecond, |
| 99 | closedChartConnection_apply, hessian_chart F T htime hy hs f hf] |
| 100 | simp only [smul_apply, smul_eq_mul] |
| 101 | dsimp only [f₀, f, e] |
| 102 | ring |
| 103 | |
| 104 | theorem chartCurvatureAlong_pair {J C : Set ℝ} (F : RicciFlow n M J) |
| 105 | (hM04 : RicciFlowCurvatureTheory.{u}) (T : ℝ) (hC : UniqueDiffOn ℝ C) |
| 106 | (htime : ∀ s ∈ C, T - s ^ 2 ∈ J) |
| 107 | {x y : M} (hy : y ∈ (chartAt (EuclideanSpace ℝ (Fin n)) x).source) |
| 108 | {s : ℝ} (hs : s ∈ C) (A v w : EuclideanSpace ℝ (Fin n)) : |
| 109 | chartActionMetric F T x (s, extChartAt (𝓡 n) x y) |
| 110 | (chartCurvatureAlong (closedChartConnection F T x C (s, extChartAt (𝓡 n) x y)) |
| 111 | (spatialWithinFDeriv C (extChartAt (𝓡 n) x).target |
| 112 | (closedChartConnection F T x C) (s, extChartAt (𝓡 n) x y)) A v) w = |
| 113 | (F.connection (T - s ^ 2)).curvatureTensor y |
| 114 | (chartFrame x v y) (chartFrame x A y) (chartFrame x w y) (chartFrame x A y) := by |
| 115 | have hq : extChartAt (𝓡 n) x y ∈ (extChartAt (𝓡 n) x).target := |
| 116 | (extChartAt (𝓡 n) x).map_source (by simpa only [extChartAt_source] using hy) |
| 117 | rw [curvatureTensor_chart F hM04 T hC htime hy hs, |
| 118 | chartCurvatureAlong_apply, |
| 119 | closedChartConnection_spatial_apply F T x hC htime hs hq, |
| 120 | closedChartConnection_spatial_apply F T x hC htime hs hq] |
| 121 | simp only [closedChartConnection_apply] |
| 122 | |
| 123 | set_option maxHeartbeats 1200000 in |
| 124 | theorem closedChartJacobiPotential_identification {J C : Set ℝ} (F : RicciFlow n M J) |
| 125 | (hM04 : RicciFlowCurvatureTheory.{u}) (T : ℝ) (hC : UniqueDiffOn ℝ C) |
| 126 | (htime : ∀ s ∈ C, T - s ^ 2 ∈ J) |
| 127 | {x y : M} (hy : y ∈ (chartAt (EuclideanSpace ℝ (Fin n)) x).source) |
| 128 | {s : ℝ} (hs : s ∈ C) |
| 129 | (hcl : (s, extChartAt (𝓡 n) x y) ∈ |
| 130 | closure (interior (C ×ˢ (extChartAt (𝓡 n) x).target))) |
| 131 | (A v w : EuclideanSpace ℝ (Fin n)) : |
| 132 | closedChartJacobiPotential F T x C (s, extChartAt (𝓡 n) x y) A v w = |
| 133 | -(F.connection (T - s ^ 2)).curvatureTensor y |
| 134 | (chartFrame x v y) (chartFrame x A y) (chartFrame x w y) (chartFrame x A y) + |
| 135 | 2 * s * backwardConnectionVariationPairing (F.connection (T - s ^ 2)) y |
| 136 | (chartFrame x A y) (chartFrame x v y) (chartFrame x w y) + |
| 137 | 2 * s ^ 2 * (F.connection (T - s ^ 2)).hessian |
| 138 | (F.connection (T - s ^ 2)).scalarCurvature y (chartFrame x v y) (chartFrame x w y) - |
| 139 | 4 * s * ricciDerivativePairing (F.connection (T - s ^ 2)) y |
| 140 | (chartFrame x v y) (chartFrame x A y) (chartFrame x w y) := by |
| 141 | have hq : extChartAt (𝓡 n) x y ∈ (extChartAt (𝓡 n) x).target := |
| 142 | (extChartAt (𝓡 n) x).map_source (by simpa only [extChartAt_source] using hy) |
| 143 | unfold closedChartJacobiPotential |
| 144 | rw [weightedChartPotential_apply, |
| 145 | chartCurvatureAlong_pair F hM04 T hC htime hy hs, |
| 146 | ← chartHessianForm_apply, |
| 147 | weighted_chart_hessian F hM04 T hC htime hy hs, |
| 148 | closedChartConnection_time_apply F T x hC htime hs hq, |
| 149 | closedChartChristoffel_time_eq_connectionVariation F hM04 T hC htime hy hs hcl] |
| 150 | unfold backwardConnectionVariationPairing |
| 151 | rw [ricciDerivativePairing_chart_symm F hM04 T htime hy hs v w A, |
| 152 | ricciDerivativePairing_chart_symm F hM04 T htime hy hs w v A] |
| 153 | ring |
| 154 | |
| 155 | end PoincareMT.LGeometry |