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.Variation.Coordinates.MovingMetric |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Fields.VariationExtensions |
| 3 | |
| 4 | /-! |
| 5 | # The smooth boundary pair in first variation |
| 6 | |
| 7 | Morgan-Tian Lemma 6.4, pp. 107-108. The actual pairing of the base |
| 8 | square-root velocity and the variation field is smooth on the closed |
| 9 | interval. Its within derivative includes the +4s Ricci metric defect. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open scoped Manifold ContDiff Bundle |
| 15 | |
| 16 | universe u |
| 17 | |
| 18 | namespace PoincareMT.M14 |
| 19 | |
| 20 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 21 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 22 | {T τ₁ τ₂ : ℝ} {x y : G.Point} {p : M14BackwardPath G T τ₁ τ₂ x y} |
| 23 | {R : M14SquareRootPath G p} |
| 24 | |
| 25 | /-- The boundary pairing in square-root first variation, |
| 26 | Lemma 6.4 and equation (6.2), pp. 106-108. -/ |
| 27 | noncomputable def variationBoundaryPair (V : M14LVariationData G p R) (s : ℝ) : ℝ := |
| 28 | G.spacetime.horizontalMetric.inner (R.curve s) |
| 29 | (R.horizontal_velocity s) (M14VariationField V s) |
| 30 | |
| 31 | set_option backward.isDefEq.respectTransparency false in |
| 32 | -- Bundle evaluation and the scalar pairing unfold to the same selected metric. |
| 33 | /-- The boundary pairing is smooth within the full closed interval, |
| 34 | including an initial square-root time zero, Lemma 6.4, pp. 107-108. -/ |
| 35 | theorem variationBoundaryPair_contDiffOn (V : M14LVariationData G p R) : |
| 36 | ContDiffOn ℝ ∞ (variationBoundaryPair V) (M14SqrtParameterInterval τ₁ τ₂) := by |
| 37 | have hmetric := G.spacetime.horizontalMetric.contMDiff.comp_contMDiffOn |
| 38 | (R.smooth.mono R.interval_subset) |
| 39 | have hpair := hmetric.clm_bundle_apply₂ (F₃ := ℝ) (E₃ := Bundle.Trivial G.Point ℝ) |
| 40 | (squareRoot_horizontalVelocity_smooth R) (variation_field_smooth V) |
| 41 | have h : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓘(ℝ, ℝ)) ∞ |
| 42 | (fun s => G.spacetime.horizontalMetric.inner (R.curve s) |
| 43 | (R.horizontal_velocity s) (M14VariationField V s)) |
| 44 | (M14SqrtParameterInterval τ₁ τ₂) := by |
| 45 | intro s hs |
| 46 | simpa only [Bundle.Trivial.fiberBundle_trivializationAt', Bundle.Trivial.trivialization_apply] |
| 47 | using (Bundle.contMDiffWithinAt_totalSpace.mp (hpair s hs)).2 |
| 48 | exact h.contDiffOn |
| 49 | |
| 50 | /-- The actual boundary-pair derivative has the +4s Ricci defect, |
| 51 | at every closed time point, Lemma 6.4, pp. 107-108. -/ |
| 52 | theorem hasDerivWithinAt_variationBoundaryPair |
| 53 | (V : M14LVariationData G p R) (D : M14VariationDerivativeData V) |
| 54 | {s : ℝ} (hs : s ∈ M14SqrtParameterInterval τ₁ τ₂) : |
| 55 | HasDerivWithinAt (variationBoundaryPair V) |
| 56 | (G.spacetime.horizontalMetric.inner (R.curve s) |
| 57 | (M14HorizontalCovariantDerivative G R.curve (M14SqrtParameterInterval τ₁ τ₂) |
| 58 | R.horizontal_velocity D.base_extension s) (M14VariationField V s) + |
| 59 | G.spacetime.horizontalMetric.inner (R.curve s) (R.horizontal_velocity s) |
| 60 | (M14HorizontalCovariantDerivative G R.curve (M14SqrtParameterInterval τ₁ τ₂) |
| 61 | (M14VariationField V) D.variation_extension s) + |
| 62 | 4 * s * horizontalRicci G.leafwise (R.curve s) |
| 63 | (R.horizontal_velocity s) (M14VariationField V s)) |
| 64 | (M14SqrtParameterInterval τ₁ τ₂) s := |
| 65 | squareRoot_covariantDerivative_metric_product R D.base_extension D.variation_extension hs |
| 66 | |
| 67 | end PoincareMT.M14 |