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.Generalized.ReducedGeometry.Variation.IndexForm.IndexPair |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Jacobi.JacobiGaugeCoordinates |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Jacobi.JacobiGaugeCoefficients |
| 5 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Jacobi.JacobiGaugeCover |
| 6 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Euler.EulerResidual |
| 7 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Jacobi.Index.IndexPairAlgebra |
| 8 | |
| 9 | /-! |
| 10 | # Symmetry and polarization of the actual horizontal index density |
| 11 | |
| 12 | Morgan-Tian Proposition 6.13 and Corollary 6.16, pp. 110-112. |
| 13 | Compatible gauge coordinates identify the actual paired density with |
| 14 | the metric and the closed Jacobi potential. Direct M08 potential |
| 15 | symmetry supplies the symmetric quadratic law, including endpoints. |
| 16 | -/ |
| 17 | |
| 18 | set_option autoImplicit false |
| 19 | -- Equal reconstructed base points identify the actual horizontal fibers. |
| 20 | set_option backward.isDefEq.respectTransparency false |
| 21 | |
| 22 | open Set Filter Topology |
| 23 | open scoped Manifold ContDiff |
| 24 | |
| 25 | universe u |
| 26 | |
| 27 | namespace PoincareMT.M14 |
| 28 | |
| 29 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 30 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 31 | |
| 32 | private theorem five_horizontal_eval_heq |
| 33 | (F : ∀ q, G.Horizontal q → G.Horizontal q → G.Horizontal q → |
| 34 | G.Horizontal q → G.Horizontal q → ℝ) |
| 35 | {q r : G.Point} (h : q = r) |
| 36 | {A Y Z DY DZ : G.Horizontal q} {A' Y' Z' DY' DZ' : G.Horizontal r} |
| 37 | (hA : HEq A A') (hY : HEq Y Y') (hZ : HEq Z Z') |
| 38 | (hDY : HEq DY DY') (hDZ : HEq DZ DZ') : |
| 39 | F q A Y Z DY DZ = F r A' Y' Z' DY' DZ' := by |
| 40 | cases h |
| 41 | cases hA |
| 42 | cases hY |
| 43 | cases hZ |
| 44 | cases hDY |
| 45 | cases hDZ |
| 46 | rfl |
| 47 | |
| 48 | private theorem cast_equiv_coordinates {q r : G.Point} (h : q = r) |
| 49 | (e : EuclideanSpace ℝ (Fin n) ≃L[ℝ] G.Horizontal q) (v : G.Horizontal r) : |
| 50 | HEq v (e ((h ▸ e).symm v)) := by |
| 51 | cases h |
| 52 | exact heq_of_eq (e.apply_symm_apply v).symm |
| 53 | |
| 54 | variable {T τ₁ τ₂ : ℝ} {x y : G.Point} {p : M14BackwardPath G T τ₁ τ₂ x y} |
| 55 | (R : M14SquareRootPath G p) |
| 56 | |
| 57 | /-- The actual paired index density is the chart metric plus the |
| 58 | closed corrected Jacobi potential under the actual spatial tangent |
| 59 | equivalence, Proposition 6.13 and Corollary 6.16, pp. 110-112. -/ |
| 60 | theorem horizontalIndexPairDensity_gauge (b : G.gaugeCover.index) |
| 61 | (hCoordinates : SpacetimeGaugeTheory.{u, 0} G.leafwise G.timeIntervals) |
| 62 | (hscalar : ContMDiff (spacetimeModel n) (𝓘(ℝ, ℝ)) ∞ |
| 63 | (horizontalScalarCurvature G.leafwise)) |
| 64 | (W : OrdinaryGaugeWitness G.leafwise (G.gaugeCover.cylinder b) (G.gaugeCover.metric b)) |
| 65 | (hM04 : RicciFlowCurvatureTheory.{0}) (x₀ : G.gaugeCover.spatial b) |
| 66 | {a c : ℝ} (hac : a < c) (hsub : Icc a c ⊆ M14SqrtParameterInterval τ₁ τ₂) |
| 67 | {β : ℝ → (G.timeIntervals.interval (G.gaugeCover.interval b)).Point × |
| 68 | G.gaugeCover.spatial b} |
| 69 | (hβ : ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) ∞ β (Icc a c)) |
| 70 | (hrec : ∀ s ∈ Icc a c, (G.gaugeCover.cylinder b).toSpacetime (β s) = R.curve s) |
| 71 | (hclock : ∀ s ∈ Icc a c, (β s).1.val = T - s ^ 2) |
| 72 | {s : ℝ} (hs : s ∈ Icc a c) {Y Z DY DZ : G.Horizontal (R.curve s)} |
| 73 | (v w d e : EuclideanSpace ℝ (Fin n)) |
| 74 | (hY : HEq Y ((G.gaugeCover.metric b).spatialTangentEquiv (β s).1 (β s).2 v)) |
| 75 | (hZ : HEq Z ((G.gaugeCover.metric b).spatialTangentEquiv (β s).1 (β s).2 w)) |
| 76 | (hDY : HEq DY ((G.gaugeCover.metric b).spatialTangentEquiv (β s).1 (β s).2 d)) |
| 77 | (hDZ : HEq DZ ((G.gaugeCover.metric b).spatialTangentEquiv (β s).1 (β s).2 e)) : |
| 78 | horizontalIndexPairDensity R s Y Z DY DZ = |
| 79 | M08.chartActionMetric W.flow T x₀ (s, (β s).2.val) d e + |
| 80 | M08.closedChartJacobiPotential W.flow T x₀ (Icc a c) (s, (β s).2.val) |
| 81 | (derivWithin (fun r => (β r).2.val) (Icc a c) s) v w := by |
| 82 | have htime (r : ℝ) (hr : r ∈ Icc a c) : T - r ^ 2 ∈ (G.gaugeCover.interval b).domain := by |
| 83 | rw [← hclock r hr] |
| 84 | exact (β r).1.property |
| 85 | have hA := squareRootVelocity_gauge_subset b R hsub hβ hrec hs (uniqueDiffOn_Icc hac s hs) |
| 86 | let φ := fun (q : G.Point) (A Y Z DY DZ : G.Horizontal q) => |
| 87 | G.spacetime.horizontalMetric.inner q DY DZ - horizontalRiemann G.leafwise q Y A Z A + |
| 88 | 2 * s * M14BcalPairing G q A Y Z + 2 * s ^ 2 * M14HorizontalHessianPairing G q Y Z - |
| 89 | 4 * s * M14HorizontalRicciDerivativePairing G q Y A Z |
| 90 | have hgeom := five_horizontal_eval_heq φ (hrec s hs).symm hA hY hZ hDY hDZ |
| 91 | change φ (R.curve s) (R.horizontal_velocity s) Y Z DY DZ = _ |
| 92 | rw [hgeom] |
| 93 | rw [gauge_chartActionMetric b W T x₀ (β s).2 s (β s).1 (hclock s hs).symm, |
| 94 | gauge_closedJacobiPotential b hCoordinates W hM04 T hac htime x₀ (β s).2 hs (β s).1 |
| 95 | (hclock s hs).symm hscalar] |
| 96 | dsimp only [φ] |
| 97 | ring |
| 98 | |
| 99 | private theorem indexPair_coordinate_forms |
| 100 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 101 | {s : ℝ} (hs : s ∈ M14SqrtParameterInterval τ₁ τ₂) : |
| 102 | ∃ j : EuclideanSpace ℝ (Fin n) ≃L[ℝ] G.Horizontal (R.curve s), |
| 103 | ∃ B C : EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ, |
| 104 | (∀ v w, B v w = B w v) ∧ (∀ v w, C v w = C w v) ∧ |
| 105 | ∀ Y Z DY DZ : G.Horizontal (R.curve s), |
| 106 | horizontalIndexPairDensity R s Y Z DY DZ = |
| 107 | B (j.symm DY) (j.symm DZ) + C (j.symm Y) (j.symm Z) := by |
| 108 | have hCoordinates := hM12.coordinate_gauges X time I G.spacetime G.slices |
| 109 | G.timeIntervals G.gaugeCover G.leafwise |
| 110 | have hscalar := ((hM12.leafwise_calculus X time I G.spacetime G.slices |
| 111 | G.timeIntervals G.gaugeCover).2 G.leafwise).scalar_smooth |
| 112 | obtain ⟨b, N, β, hN, hsN, hβ, hrec, hclock⟩ := exists_squareRoot_gauge_neighborhood R hs |
| 113 | have hab := Real.sqrt_lt_sqrt p.tau_nonneg p.tau_lt |
| 114 | obtain ⟨l, r, hal, hlr, hrb, hls, hsr, hsubN, hnear⟩ := |
| 115 | M08.exists_enlarged_closed_interval hab hs.1 le_rfl hs.2 hN |
| 116 | (by simpa only [Icc_self, singleton_subset_iff] using hsN) |
| 117 | have hsub : Icc l r ⊆ M14SqrtParameterInterval τ₁ τ₂ := Icc_subset_Icc hal hrb |
| 118 | have hsub' : Icc l r ⊆ M14SqrtParameterInterval τ₁ τ₂ ∩ N := |
| 119 | fun _ hv => ⟨hsub hv, hsubN hv⟩ |
| 120 | have hs' : s ∈ Icc l r := ⟨hls, hsr⟩ |
| 121 | obtain ⟨W⟩ := ordinaryGaugeWitness_nonempty b hCoordinates |
| 122 | let x₀ := (β s).2 |
| 123 | let q := fun v => (β v).2.val |
| 124 | let A := derivWithin q (Icc l r) s |
| 125 | let B := M08.chartActionMetric W.flow T x₀ (s, q s) |
| 126 | let C := M08.closedChartJacobiPotential W.flow T x₀ (Icc l r) (s, q s) A |
| 127 | let e := (G.gaugeCover.metric b).spatialTangentEquiv (β s).1 (β s).2 |
| 128 | let j : EuclideanSpace ℝ (Fin n) ≃L[ℝ] G.Horizontal (R.curve s) := |
| 129 | hrec s (hsub' hs') ▸ e |
| 130 | have htime (v : ℝ) (hv : v ∈ Icc l r) : T - v ^ 2 ∈ (G.gaugeCover.interval b).domain := by |
| 131 | rw [← hclock v (hsub' hv)] |
| 132 | exact (β v).1.property |
| 133 | have hx : (β s).2 ∈ (chartAt (EuclideanSpace ℝ (Fin n)) x₀).source := |
| 134 | mem_chart_source _ _ |
| 135 | have he : extChartAt (𝓡 n) x₀ (β s).2 = q s := by |
| 136 | rw [extChartAt_coe] |
| 137 | rfl |
| 138 | have htarget := (extChartAt (𝓡 n) x₀).map_source |
| 139 | (show (β s).2 ∈ (extChartAt (𝓡 n) x₀).source from by |
| 140 | simpa only [extChartAt_source] using hx) |
| 141 | refine ⟨j, B, C, ?_, ?_, ?_⟩ |
| 142 | · intro v w |
| 143 | simpa only [he] using M08.chartActionMetric_symm_at W.flow T hx s v w |
| 144 | · intro v w |
| 145 | simpa only [he] using M08.closedChartJacobiPotential_symm W.flow hM04 T |
| 146 | (uniqueDiffOn_Icc hlr) htime hx hs' |
| 147 | (M08.mem_closure_interior_Icc_prod hlr (isOpen_extChartAt_target (I := 𝓡 n) x₀) |
| 148 | hs' htarget) A v w |
| 149 | · intro Y Z DY DZ |
| 150 | exact horizontalIndexPairDensity_gauge R b hCoordinates hscalar W hM04 x₀ hlr hsub |
| 151 | (hβ.mono hsub') (fun v hv => hrec v (hsub' hv)) (fun v hv => hclock v (hsub' hv)) |
| 152 | hs' (j.symm Y) (j.symm Z) (j.symm DY) (j.symm DZ) |
| 153 | (cast_equiv_coordinates (hrec s (hsub' hs')) e Y) |
| 154 | (cast_equiv_coordinates (hrec s (hsub' hs')) e Z) |
| 155 | (cast_equiv_coordinates (hrec s (hsub' hs')) e DY) |
| 156 | (cast_equiv_coordinates (hrec s (hsub' hs')) e DZ) |
| 157 | |
| 158 | /-- The actual paired horizontal index density is symmetric, |
| 159 | including closed endpoints, Corollary 6.16, pp. 111-112. -/ |
| 160 | theorem horizontalIndexPairDensity_symm |
| 161 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 162 | {s : ℝ} (hs : s ∈ M14SqrtParameterInterval τ₁ τ₂) |
| 163 | (Y Z DY DZ : G.Horizontal (R.curve s)) : |
| 164 | horizontalIndexPairDensity R s Y Z DY DZ = horizontalIndexPairDensity R s Z Y DZ DY := by |
| 165 | obtain ⟨j, B, C, hB, hC, h⟩ := indexPair_coordinate_forms R hM04 hM12 hs |
| 166 | rw [h, h, hB, hC] |
| 167 | |
| 168 | /-- The actual paired index density is linear under simultaneous |
| 169 | scaling of the test field and its derivative, Proposition 6.13 and |
| 170 | Corollary 6.16, pp. 110-112. -/ |
| 171 | theorem horizontalIndexPairDensity_smul_right |
| 172 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 173 | {s : ℝ} (hs : s ∈ M14SqrtParameterInterval τ₁ τ₂) |
| 174 | (Y Z DY DZ : G.Horizontal (R.curve s)) (c : ℝ) : |
| 175 | horizontalIndexPairDensity R s Y (c • Z) DY (c • DZ) = |
| 176 | c * horizontalIndexPairDensity R s Y Z DY DZ := by |
| 177 | obtain ⟨j, B, C, hB, hC, h⟩ := indexPair_coordinate_forms R hM04 hM12 hs |
| 178 | simp only [h, map_smul, smul_eq_mul] |
| 179 | ring |
| 180 | |
| 181 | /-- The diagonal index density has the exact affine quadratic law |
| 182 | used in the positive-semidefinite argument, Proposition 6.13, |
| 183 | pp. 110-112. -/ |
| 184 | theorem horizontalIndexPairDensity_quadratic |
| 185 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 186 | {s : ℝ} (hs : s ∈ M14SqrtParameterInterval τ₁ τ₂) |
| 187 | (Y Z DY DZ : G.Horizontal (R.curve s)) (c : ℝ) : |
| 188 | horizontalIndexPairDensity R s (Y + c • Z) (Y + c • Z) (DY + c • DZ) (DY + c • DZ) = |
| 189 | horizontalIndexPairDensity R s Y Y DY DY + |
| 190 | 2 * c * horizontalIndexPairDensity R s Y Z DY DZ + |
| 191 | c ^ 2 * horizontalIndexPairDensity R s Z Z DZ DZ := by |
| 192 | obtain ⟨j, B, C, hB, hC, h⟩ := indexPair_coordinate_forms R hM04 hM12 hs |
| 193 | have hsym := horizontalIndexPairDensity_symm R hM04 hM12 hs Y Z DY DZ |
| 194 | simp only [h] at hsym ⊢ |
| 195 | simp only [map_add, map_smul, add_apply, smul_apply, smul_eq_mul] |
| 196 | linear_combination -c * hsym |
| 197 | |
| 198 | /-- The corrected Jacobi residual is linear in the test vector, |
| 199 | including endpoints, Proposition 6.13 and Lemma 6.14, pp. 110-112. -/ |
| 200 | theorem horizontalJacobiPairResidual_smul_right |
| 201 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 202 | {s : ℝ} (hs : s ∈ M14SqrtParameterInterval τ₁ τ₂) |
| 203 | (Y P DP Z : G.Horizontal (R.curve s)) (c : ℝ) : |
| 204 | horizontalJacobiPairResidual R s Y P DP (c • Z) = |
| 205 | c * horizontalJacobiPairResidual R s Y P DP Z := by |
| 206 | have h₁ := horizontalIndexPairDensity_green_value R s Y (c • Z) P 0 DP |
| 207 | have h₂ := horizontalIndexPairDensity_green_value R s Y Z P 0 DP |
| 208 | have hI := horizontalIndexPairDensity_smul_right R hM04 hM12 hs Y Z P 0 c |
| 209 | simp only [smul_zero] at hI |
| 210 | rw [hI] at h₁ |
| 211 | simp only [map_smul, smul_eq_mul, horizontalRicci_smul_right hM12, map_zero] at h₁ h₂ |
| 212 | linear_combination h₁ - c * h₂ |
| 213 | |
| 214 | end PoincareMT.M14 |