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.Generalized.ReducedGeometry.SourceNames.LGeometry |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Regularity.EndpointEulerCoefficients |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Jacobi.Index.WeightedJacobiCoefficients |
| 4 | |
| 5 | /-! |
| 6 | # Actual closed coordinate momentum and the Euler residual |
| 7 | |
| 8 | Morgan-Tian equation (6.5) and Lemma 6.18, pp. 108-109, 113-114. |
| 9 | M08's closed metric, connection and bilinear derivative identities |
| 10 | identify the derivative of actual Riesz momentum minus the quadratic |
| 11 | force with the coordinate Euler residual. Every curve derivative is |
| 12 | taken within its supplied parameter set. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | -- Standard operator norms and the Riesz map use the same Euclidean topology. |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set |
| 20 | open scoped Manifold ContDiff |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | namespace PoincareMT.M14 |
| 25 | |
| 26 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 27 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 28 | {J C : Set ℝ} (F : RicciFlow n M J) (T : ℝ) (x : M) |
| 29 | |
| 30 | private noncomputable local instance dualNormedGroup : |
| 31 | NormedAddCommGroup (EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 32 | ContinuousLinearMap.toNormedAddCommGroup |
| 33 | |
| 34 | private noncomputable local instance dualNormedSpace : |
| 35 | NormedSpace ℝ (EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := ContinuousLinearMap.toNormedSpace |
| 36 | |
| 37 | private noncomputable local instance bilinearNormedGroup : |
| 38 | NormedAddCommGroup |
| 39 | (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 40 | ContinuousLinearMap.toNormedAddCommGroup |
| 41 | |
| 42 | private noncomputable local instance bilinearNormedSpace : |
| 43 | NormedSpace ℝ (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 44 | ContinuousLinearMap.toNormedSpace |
| 45 | |
| 46 | /-- Actual coordinate momentum is smooth within the curve's |
| 47 | parameter set, including unique within endpoints, Lemmas 6.8 |
| 48 | and 6.18, pp. 108-109, 113-114. -/ |
| 49 | theorem closedChartMomentum_contDiffOn (hC : UniqueDiffOn ℝ C) |
| 50 | (htime : ∀ s ∈ C, T - s ^ 2 ∈ J) |
| 51 | {q : ℝ → EuclideanSpace ℝ (Fin n)} (hq : ContDiffOn ℝ ∞ q C) |
| 52 | (hmap : MapsTo q C (extChartAt (𝓡 n) x).target) : |
| 53 | ContDiffOn ℝ ∞ (fun s => M08.chartMomentumVector |
| 54 | (M08.chartActionMetric F T x (s, q s)) (derivWithin q C s)) C := by |
| 55 | have hB := M08.chartActionMetric_closed_contDiffOn F T x htime |
| 56 | have hv := hq.derivWithin hC (m := ∞) (by simp) |
| 57 | let L := (InnerProductSpace.toDual ℝ (EuclideanSpace ℝ (Fin n))).symm.toContinuousLinearEquiv |
| 58 | exact L.contDiff.comp_contDiffOn ((hB.comp (contDiffOn_id.prodMk hq) |
| 59 | (fun s hs => ⟨hs, hmap hs⟩)).clm_apply hv) |
| 60 | |
| 61 | /-- The closed chart connection has the exact diagonal metric |
| 62 | pairing given by the spatial metric derivatives, equation (6.5) |
| 63 | and Lemma 6.18, pp. 108-109, 113-114. -/ |
| 64 | theorem closedChartConnection_diagonal_pair |
| 65 | (htime : ∀ s ∈ C, T - s ^ 2 ∈ J) {s : ℝ} (hs : s ∈ C) |
| 66 | {y : M} (hy : y ∈ (chartAt (EuclideanSpace ℝ (Fin n)) x).source) |
| 67 | (v w : EuclideanSpace ℝ (Fin n)) : |
| 68 | M08.chartActionMetric F T x (s, extChartAt (𝓡 n) x y) |
| 69 | (M08.closedChartConnection F T x C (s, extChartAt (𝓡 n) x y) v v) w = |
| 70 | M08.spatialWithinFDeriv C (extChartAt (𝓡 n) x).target |
| 71 | (M08.chartActionMetric F T x) (s, extChartAt (𝓡 n) x y) v v w - |
| 72 | M08.spatialWithinFDeriv C (extChartAt (𝓡 n) x).target |
| 73 | (M08.chartActionMetric F T x) (s, extChartAt (𝓡 n) x y) w v v / 2 := by |
| 74 | rw [M08.chartActionMetric_apply F T hy s, M08.closedChartConnection_apply, |
| 75 | ← M08.closedChartChristoffel_connection F T htime hy hs] |
| 76 | exact M08.chartActionMetric_closed_connection_diagonal F T htime hy hs v w |
| 77 | |
| 78 | /-- The derivative of actual Riesz momentum minus the actual |
| 79 | quadratic force pairs to the closed coordinate Euler residual, |
| 80 | equation (6.5) and Lemma 6.18, pp. 108-109, 113-114. -/ |
| 81 | theorem closedChartMomentum_residual_pair (hC : UniqueDiffOn ℝ C) |
| 82 | (htime : ∀ s ∈ C, T - s ^ 2 ∈ J) |
| 83 | {q : ℝ → EuclideanSpace ℝ (Fin n)} (hq : ContDiffOn ℝ ∞ q C) |
| 84 | (hmap : MapsTo q C (extChartAt (𝓡 n) x).target) |
| 85 | {s : ℝ} (hs : s ∈ C) (w : EuclideanSpace ℝ (Fin n)) : |
| 86 | let B := M08.chartActionMetric F T x |
| 87 | let v := derivWithin q C |
| 88 | let P := fun r => M08.chartMomentumVector (B (r, q r)) (v r) |
| 89 | inner ℝ w (derivWithin P C s - |
| 90 | M08.chartForceVector (M08.spatialWithinFDeriv C (extChartAt (𝓡 n) x).target B (s, q s)) |
| 91 | (M08.spatialWithinFDeriv C (extChartAt (𝓡 n) x).target |
| 92 | (M08.chartActionPotential F T x) (s, q s)) (v s)) = |
| 93 | B (s, q s) (derivWithin v C s + |
| 94 | M08.closedChartConnection F T x C (s, q s) (v s) (v s)) w - |
| 95 | M08.spatialWithinFDeriv C (extChartAt (𝓡 n) x).target |
| 96 | (M08.chartActionPotential F T x) (s, q s) w + |
| 97 | M08.timeWithinFDeriv C (extChartAt (𝓡 n) x).target B (s, q s) (v s) w := by |
| 98 | dsimp only |
| 99 | let B := M08.chartActionMetric F T x |
| 100 | let v := derivWithin q C |
| 101 | let P := fun r => M08.chartMomentumVector (B (r, q r)) (v r) |
| 102 | have hB := M08.chartActionMetric_closed_contDiffOn F T x htime |
| 103 | have hv := hq.derivWithin hC (m := ∞) (by simp) |
| 104 | have hPd := ((closedChartMomentum_contDiffOn F T x hC htime hq hmap) s hs) |
| 105 | |>.differentiableWithinAt (by simp) |>.hasDerivWithinAt |
| 106 | have hpair := M08.bilinear_curve_hasDerivWithinAt B |
| 107 | ((hB (s, q s) ⟨hs, hmap hs⟩).differentiableWithinAt (by simp)).hasFDerivWithinAt |
| 108 | ((hq s hs).differentiableWithinAt (by simp)).hasDerivWithinAt |
| 109 | ((hv s hs).differentiableWithinAt (by simp)).hasDerivWithinAt |
| 110 | (fun r hr => ⟨hr, hmap hr⟩) w |
| 111 | have hinner := (innerSL ℝ w).hasFDerivAt.comp_hasDerivWithinAt s hPd |
| 112 | simp only [Function.comp_def, innerSL_apply_apply, M08.chartMomentumVector_inner] at hinner |
| 113 | have hd := (hinner.derivWithin (hC s hs)).symm.trans (hpair.derivWithin (hC s hs)) |
| 114 | have hy : (extChartAt (𝓡 n) x).symm (q s) ∈ |
| 115 | (chartAt (EuclideanSpace ℝ (Fin n)) x).source := by |
| 116 | simpa only [extChartAt_source] using (extChartAt (𝓡 n) x).map_target (hmap hs) |
| 117 | have hdiag := closedChartConnection_diagonal_pair F T x htime hs hy (v s) w |
| 118 | rw [(extChartAt (𝓡 n) x).right_inv (hmap hs)] at hdiag |
| 119 | rw [inner_sub_right, M08.chartForceVector_inner, hd, map_add, add_apply, hdiag] |
| 120 | dsimp only [M08.spatialWithinFDeriv, M08.timeWithinFDeriv, |
| 121 | ContinuousLinearMap.comp_apply, ContinuousLinearMap.inr_apply] |
| 122 | ring |
| 123 | |
| 124 | end PoincareMT.M14 |