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.Basic |
| 2 | import PoincareLib.Geometry.Riemannian.Tensor.Operations |
| 3 | import PoincareLib.Geometry.Riemannian.ScalarOperators |
| 4 | import Mathlib.Geometry.Manifold.MFDeriv.NormedSpace |
| 5 | import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic |
| 6 | |
| 7 | /-! Ported from Mapher06/Poincare-MorganTian, `PoincareMT/Definitions/M14PathCalculus.lean`, |
| 8 | revision `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. Declaration bodies are unchanged; |
| 9 | imports and module placement are adapted. See |
| 10 | `references/ricci-flow/mapher/generalized-noncollapse-port.json`. -/ |
| 11 | |
| 12 | /-! |
| 13 | # M14 path calculus on the actual horizontal bundle |
| 14 | |
| 15 | The records in this file carry the geometric fields used by the variational |
| 16 | calculus. In particular, a pullback derivative is built from a genuine |
| 17 | parameter-dependent horizontal extension and `rawHorizontalCovariantDerivative`; |
| 18 | there are no stand-alone scalar residual or Jacobi operator fields. |
| 19 | -/ |
| 20 | |
| 21 | set_option autoImplicit false |
| 22 | |
| 23 | open scoped Manifold ContDiff Bundle intervalIntegral |
| 24 | |
| 25 | universe u |
| 26 | |
| 27 | namespace PoincareMT |
| 28 | |
| 29 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 30 | {I : SpacetimeInterval} |
| 31 | variable {G : GeneralizedLGeometryTransport n X time I} |
| 32 | |
| 33 | /-- The closed interval used by the square-root parameter. -/ |
| 34 | def M14SqrtParameterInterval (τ₁ τ₂ : ℝ) : Set ℝ := |
| 35 | Set.Icc (Real.sqrt τ₁) (Real.sqrt τ₂) |
| 36 | |
| 37 | /-- A parameter-dependent local horizontal extension along an actual curve. -/ |
| 38 | structure M14PullbackExtension |
| 39 | (G : GeneralizedLGeometryTransport n X time I) |
| 40 | (γ : ℝ → G.Point) (J : Set ℝ) |
| 41 | (Y : ∀ s, G.Horizontal (γ s)) where |
| 42 | extension : ℝ → HorizontalSection G.spacetime |
| 43 | domain : Set G.Point |
| 44 | domain_open : IsOpen domain |
| 45 | graph_mem : ∀ s ∈ J, γ s ∈ domain |
| 46 | spatial_smooth : ∀ r, IsSmoothHorizontalSectionOn G.spacetime (extension r) domain |
| 47 | joint_smooth : ∃ U : Set (ℝ × G.Point), IsOpen U ∧ |
| 48 | (∀ s ∈ J, (s, γ s) ∈ U) ∧ |
| 49 | ContMDiffOn ((𝓘(ℝ, ℝ)).prod (spacetimeModel n)) |
| 50 | ((spacetimeModel n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 51 | (fun z : ℝ × G.Point => |
| 52 | Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) |
| 53 | (E := G.spacetime.Horizontal) z.2 (extension z.1 z.2)) U |
| 54 | agrees : ∀ s ∈ J, extension s (γ s) = Y s |
| 55 | parameter_derivative : ∀ s ∈ J, ∃ d : G.Horizontal (γ s), |
| 56 | HasDerivAt (fun r : ℝ => extension r (γ s)) d s |
| 57 | |
| 58 | /-- Pullback covariant derivative using the actual horizontal connection. -/ |
| 59 | noncomputable def M14HorizontalCovariantDerivative |
| 60 | (G : GeneralizedLGeometryTransport n X time I) |
| 61 | (γ : ℝ → G.Point) (J : Set ℝ) |
| 62 | (Y : ∀ s, G.Horizontal (γ s)) |
| 63 | (E : M14PullbackExtension G γ J Y) (s : ℝ) : G.Horizontal (γ s) := |
| 64 | deriv (fun r : ℝ => E.extension r (γ s)) s + |
| 65 | rawHorizontalCovariantDerivative G.leafwise (E.extension s) (γ s) |
| 66 | (mfderivWithin (𝓘(ℝ, ℝ)) (spacetimeModel n) γ J s (1 : ℝ)) |
| 67 | |
| 68 | /-- The horizontal differential of scalar curvature on the selected slice. -/ |
| 69 | noncomputable def M14HorizontalScalarDifferential |
| 70 | (G : GeneralizedLGeometryTransport n X time I) |
| 71 | (p : G.Point) : TangentSpace (spacetimeModel n) p →L[ℝ] ℝ := |
| 72 | mvfderiv (spacetimeModel n) (fun q : G.Point => |
| 73 | horizontalScalarCurvature G.leafwise q) p |
| 74 | |
| 75 | /-- The paired singular Euler residual at a positive backward time. -/ |
| 76 | noncomputable def M14EulerResidual |
| 77 | (G : GeneralizedLGeometryTransport n X time I) |
| 78 | {T τ₁ τ₂ : ℝ} {x y : G.Point} |
| 79 | (p : M14BackwardPath G T τ₁ τ₂ x y) |
| 80 | (E : M14PullbackExtension G p.curve (Set.Ioo τ₁ τ₂) p.horizontal_velocity) |
| 81 | (τ : ℝ) (W : G.Horizontal (p.curve τ)) : ℝ := |
| 82 | G.spacetime.horizontalMetric.inner (p.curve τ) |
| 83 | (M14HorizontalCovariantDerivative G p.curve (Set.Ioo τ₁ τ₂) |
| 84 | p.horizontal_velocity E τ) W - |
| 85 | (1 / 2 : ℝ) * M14HorizontalScalarDifferential G (p.curve τ) W.val + |
| 86 | (1 / (2 * τ) : ℝ) * G.spacetime.horizontalMetric.inner (p.curve τ) |
| 87 | (p.horizontal_velocity τ) W + |
| 88 | 2 * horizontalRicci G.leafwise (p.curve τ) (p.horizontal_velocity τ) W |
| 89 | |
| 90 | /-- The paired Euler equation on the actual interior. -/ |
| 91 | def M14EulerEquation |
| 92 | (G : GeneralizedLGeometryTransport n X time I) |
| 93 | {T τ₁ τ₂ : ℝ} {x y : G.Point} |
| 94 | (p : M14BackwardPath G T τ₁ τ₂ x y) |
| 95 | (E : M14PullbackExtension G p.curve (Set.Ioo τ₁ τ₂) p.horizontal_velocity) : Prop := |
| 96 | ∀ τ ∈ Set.Ioo τ₁ τ₂, ∀ W : G.Horizontal (p.curve τ), M14EulerResidual G p E τ W = 0 |
| 97 | |
| 98 | /-- A smooth square-root representative with its actual horizontal velocity. -/ |
| 99 | structure M14SquareRootPath |
| 100 | (G : GeneralizedLGeometryTransport n X time I) |
| 101 | {T τ₁ τ₂ : ℝ} {x y : G.Point} |
| 102 | (p : M14BackwardPath G T τ₁ τ₂ x y) where |
| 103 | curve : ℝ → G.Point |
| 104 | domain : Set ℝ |
| 105 | interval_subset : M14SqrtParameterInterval τ₁ τ₂ ⊆ domain |
| 106 | smooth : ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) ∞ curve domain |
| 107 | agrees : ∀ s ∈ M14SqrtParameterInterval τ₁ τ₂, curve s = p.curve (s ^ 2) |
| 108 | curve_time : ∀ s ∈ M14SqrtParameterInterval τ₁ τ₂, |
| 109 | G.spacetime.timeFunction (curve s) = T - s ^ 2 |
| 110 | horizontal_velocity : ∀ s, G.Horizontal (curve s) |
| 111 | horizontal_agrees : ∀ s (hs : s ∈ Set.Ioo (Real.sqrt τ₁) (Real.sqrt τ₂)), |
| 112 | horizontal_velocity s = |
| 113 | (agrees s ⟨le_of_lt hs.1, le_of_lt hs.2⟩).symm ▸ |
| 114 | ((2 * s) • p.horizontal_velocity (s ^ 2)) |
| 115 | derivative_eq : ∀ s ∈ M14SqrtParameterInterval τ₁ τ₂, |
| 116 | mfderivWithin (𝓘(ℝ, ℝ)) (spacetimeModel n) curve |
| 117 | (M14SqrtParameterInterval τ₁ τ₂) s (1 : ℝ) = |
| 118 | -(2 * s) • G.spacetime.timeVector (curve s) + (horizontal_velocity s).val |
| 119 | |
| 120 | /-- The actual square-root horizontal velocity `A = 2s X`. -/ |
| 121 | noncomputable def M14SquareRootVelocity |
| 122 | {T τ₁ τ₂ : ℝ} {x y : G.Point} |
| 123 | {p : M14BackwardPath G T τ₁ τ₂ x y} |
| 124 | (R : M14SquareRootPath G p) (s : ℝ) : G.Horizontal (R.curve s) := |
| 125 | R.horizontal_velocity s |
| 126 | |
| 127 | /-- The square-root Euler residual, paired with a horizontal vector. -/ |
| 128 | noncomputable def M14SquareRootEulerResidual |
| 129 | (G : GeneralizedLGeometryTransport n X time I) |
| 130 | {T τ₁ τ₂ : ℝ} {x y : G.Point} |
| 131 | {p : M14BackwardPath G T τ₁ τ₂ x y} |
| 132 | (R : M14SquareRootPath G p) |
| 133 | (E : M14PullbackExtension G R.curve (M14SqrtParameterInterval τ₁ τ₂) |
| 134 | R.horizontal_velocity) |
| 135 | (s : ℝ) (W : G.Horizontal (R.curve s)) : ℝ := |
| 136 | G.spacetime.horizontalMetric.inner (R.curve s) |
| 137 | (M14HorizontalCovariantDerivative G R.curve |
| 138 | (M14SqrtParameterInterval τ₁ τ₂) R.horizontal_velocity E s) W - |
| 139 | 2 * s ^ 2 * M14HorizontalScalarDifferential G (R.curve s) W.val + |
| 140 | 4 * s * horizontalRicci G.leafwise (R.curve s) |
| 141 | (M14SquareRootVelocity R s) W |
| 142 | |
| 143 | /-- Ricci's covariant derivative, transported from the selected slice. -/ |
| 144 | noncomputable def M14HorizontalRicciDerivativePairing |
| 145 | (G : GeneralizedLGeometryTransport n X time I) |
| 146 | (p : G.Point) (U V W : G.Horizontal p) : ℝ := |
| 147 | let t := G.spacetime.timeFunction p |
| 148 | let x := spacetimeSlicePoint G.slices p |
| 149 | let j := (G.slices t).tangentEquiv x |
| 150 | (G.leafwise.sliceConnection t).covariantTensorDerivative |
| 151 | (G.leafwise.sliceConnection t).ricciEvaluation x ![ |
| 152 | j.symm U, j.symm V, j.symm W] |
| 153 | |
| 154 | /-- The connection-time variation tensor paired with the metric. -/ |
| 155 | noncomputable def M14BcalPairing |
| 156 | (G : GeneralizedLGeometryTransport n X time I) |
| 157 | (p : G.Point) (U V W : G.Horizontal p) : ℝ := |
| 158 | M14HorizontalRicciDerivativePairing G p U V W + |
| 159 | M14HorizontalRicciDerivativePairing G p V U W - |
| 160 | M14HorizontalRicciDerivativePairing G p W U V |
| 161 | |
| 162 | /-- The transported Hessian of scalar curvature. -/ |
| 163 | noncomputable def M14HorizontalHessianPairing |
| 164 | (G : GeneralizedLGeometryTransport n X time I) |
| 165 | (p : G.Point) (U V : G.Horizontal p) : ℝ := |
| 166 | let t := G.spacetime.timeFunction p |
| 167 | let x := spacetimeSlicePoint G.slices p |
| 168 | let j := (G.slices t).tangentEquiv x |
| 169 | LeviCivitaData.hessian (G.leafwise.sliceConnection t) |
| 170 | (G.leafwise.sliceConnection t).scalarCurvature x (j.symm U) (j.symm V) |
| 171 | |
| 172 | /-- A horizontal field with actual first and second pullback derivative data. -/ |
| 173 | structure M14JacobiFieldData |
| 174 | (G : GeneralizedLGeometryTransport n X time I) |
| 175 | (γ : ℝ → G.Point) (J : Set ℝ) where |
| 176 | field : ∀ s, G.Horizontal (γ s) |
| 177 | extension : M14PullbackExtension G γ J field |
| 178 | derivative_extension : M14PullbackExtension G γ J |
| 179 | (fun s => M14HorizontalCovariantDerivative G γ J field extension s) |
| 180 | |
| 181 | noncomputable def M14JacobiFirstDerivative |
| 182 | {γ : ℝ → G.Point} {J : Set ℝ} |
| 183 | (Q : M14JacobiFieldData G γ J) (s : ℝ) : G.Horizontal (γ s) := |
| 184 | M14HorizontalCovariantDerivative G γ J Q.field Q.extension s |
| 185 | |
| 186 | noncomputable def M14JacobiSecondDerivative |
| 187 | {γ : ℝ → G.Point} {J : Set ℝ} |
| 188 | (Q : M14JacobiFieldData G γ J) (s : ℝ) : G.Horizontal (γ s) := |
| 189 | M14HorizontalCovariantDerivative G γ J |
| 190 | (fun r => M14JacobiFirstDerivative Q r) Q.derivative_extension s |
| 191 | |
| 192 | /-- The corrected square-root Jacobi residual, paired with a horizontal vector. |
| 193 | The curvature slots `Y A W A` give `g(R(Y,A)A,W)` in the project's convention. -/ |
| 194 | noncomputable def M14JacobiResidual |
| 195 | (G : GeneralizedLGeometryTransport n X time I) |
| 196 | {T τ₁ τ₂ : ℝ} {x y : G.Point} |
| 197 | {p : M14BackwardPath G T τ₁ τ₂ x y} |
| 198 | (R : M14SquareRootPath G p) |
| 199 | (Q : M14JacobiFieldData G R.curve (M14SqrtParameterInterval τ₁ τ₂)) |
| 200 | (s : ℝ) (W : G.Horizontal (R.curve s)) : ℝ := |
| 201 | let q := R.curve s |
| 202 | let A := M14SquareRootVelocity R s |
| 203 | let Y := Q.field s |
| 204 | let DY := M14JacobiFirstDerivative Q s |
| 205 | G.spacetime.horizontalMetric.inner q (M14JacobiSecondDerivative Q s) W + |
| 206 | horizontalRiemann G.leafwise q Y A W A - |
| 207 | 2 * s * M14BcalPairing G q A Y W - |
| 208 | 2 * s ^ 2 * M14HorizontalHessianPairing G q Y W + |
| 209 | 4 * s * M14HorizontalRicciDerivativePairing G q Y A W + |
| 210 | 4 * s * horizontalRicci G.leafwise q DY W |
| 211 | |
| 212 | end PoincareMT |
| 213 |