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.AdaptedFields.UnitAdaptedField |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Coordinates.MovingMetric |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.Gauge.Geometry |
| 4 | import Mathlib.Analysis.Calculus.MeanValue |
| 5 | |
| 6 | /-! |
| 7 | # Metric conservation for actual adapted factors |
| 8 | |
| 9 | The actual Ricci correction cancels the square-time metric defect. |
| 10 | Pairings are constant on every closed interval, and positive definiteness |
| 11 | gives uniqueness from any interval point. Morgan-Tian Lemma 6.36, p. 122. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.M14 |
| 22 | |
| 23 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 24 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 25 | {T τ₁ τ₂ : ℝ} {x y : G.Point} {p : M14BackwardPath G T τ₁ τ₂ x y} |
| 26 | {R : M14SquareRootPath G p} {a b : ℝ} {P Q : ∀ s, G.Horizontal (R.curve s)} |
| 27 | |
| 28 | set_option backward.isDefEq.respectTransparency false in |
| 29 | -- The scalar clock tangent fiber is the actual real model. |
| 30 | /-- The actual pairing of two unit-adapted fields has zero within |
| 31 | derivative, including at both endpoints, Lemma 6.36, p. 122. -/ |
| 32 | theorem horizontalUnitAdapted_pair_hasDerivWithinAt |
| 33 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 34 | (hP : IsHorizontalUnitAdaptedFieldOn R a b P) |
| 35 | (hQ : IsHorizontalUnitAdaptedFieldOn R a b Q) {s : ℝ} (hs : s ∈ Icc a b) : |
| 36 | HasDerivWithinAt (fun r => G.spacetime.horizontalMetric.inner (R.curve r) (P r) (Q r)) |
| 37 | 0 (Icc a b) s := by |
| 38 | obtain ⟨E, hE⟩ := hP.equation |
| 39 | obtain ⟨F, hF⟩ := hQ.equation |
| 40 | have hR := R.smooth.mono R.interval_subset |
| 41 | have hJ := uniqueDiffOn_Icc hP.ordered s hs |
| 42 | have hclock : (show ℝ from mfderiv (spacetimeModel n) 𝓘(ℝ) |
| 43 | G.spacetime.timeFunction (R.curve s) |
| 44 | (mfderivWithin (𝓘(ℝ, ℝ)) (spacetimeModel n) R.curve (Icc a b) s (1 : ℝ))) = |
| 45 | -(2 * s) := by |
| 46 | rw [mfderivWithin_subset hP.interval_subset hJ.uniqueMDiffWithinAt |
| 47 | ((hR s (hP.interval_subset hs)).mdifferentiableWithinAt (by simp))] |
| 48 | exact squareRoot_velocity_clock R (hP.interval_subset hs) |
| 49 | have hd := horizontalCovariantDerivative_metric_product E F hs hJ |
| 50 | (((hR.mono hP.interval_subset) s hs).mdifferentiableWithinAt (by simp)) |
| 51 | have H := (hM12.leafwise_calculus X time I G.spacetime G.slices |
| 52 | G.timeIntervals G.gaugeCover).2 G.leafwise |
| 53 | rw [hclock, G.spacetime.horizontalMetric.symm (R.curve s) (P s), |
| 54 | hE s hs, hF s hs, H.ricci_symmetric (R.curve s) (Q s)] at hd |
| 55 | convert hd using 1 |
| 56 | ring |
| 57 | |
| 58 | /-- Actual unit-adapted pairings are constant throughout the closed |
| 59 | interval, the nonsingular form of Lemma 6.36, p. 122. -/ |
| 60 | theorem horizontalUnitAdapted_pair_eq (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 61 | (hP : IsHorizontalUnitAdaptedFieldOn R a b P) |
| 62 | (hQ : IsHorizontalUnitAdaptedFieldOn R a b Q) |
| 63 | {s t : ℝ} (hs : s ∈ Icc a b) (ht : t ∈ Icc a b) : |
| 64 | G.spacetime.horizontalMetric.inner (R.curve t) (P t) (Q t) = |
| 65 | G.spacetime.horizontalMetric.inner (R.curve s) (P s) (Q s) := by |
| 66 | have h := (convex_Icc a b).norm_image_sub_le_of_norm_hasDerivWithin_le |
| 67 | (fun r hr => horizontalUnitAdapted_pair_hasDerivWithinAt hM12 hP hQ hr) |
| 68 | (C := 0) (fun _ _ => by simp) hs ht |
| 69 | simpa only [zero_mul, norm_le_zero_iff, sub_eq_zero] using h |
| 70 | |
| 71 | /-- Actual unit-adapted fields agreeing at any one interval point |
| 72 | agree on the whole closed interval, by Lemma 6.36, p. 122. -/ |
| 73 | theorem horizontalUnitAdapted_unique (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 74 | (hP : IsHorizontalUnitAdaptedFieldOn R a b P) |
| 75 | (hQ : IsHorizontalUnitAdaptedFieldOn R a b Q) |
| 76 | {t₀ : ℝ} (ht₀ : t₀ ∈ Icc a b) (heq : P t₀ = Q t₀) : |
| 77 | ∀ s ∈ Icc a b, P s = Q s := by |
| 78 | intro s hs |
| 79 | have hPP := horizontalUnitAdapted_pair_eq hM12 hP hP ht₀ hs |
| 80 | have hPQ := horizontalUnitAdapted_pair_eq hM12 hP hQ ht₀ hs |
| 81 | have hQQ := horizontalUnitAdapted_pair_eq hM12 hQ hQ ht₀ hs |
| 82 | rw [heq] at hPP hPQ |
| 83 | by_contra hne |
| 84 | have hpos := G.spacetime.horizontalMetric.pos (R.curve s) (P s - Q s) |
| 85 | (sub_ne_zero.mpr hne) |
| 86 | simp only [map_sub, sub_apply] at hpos |
| 87 | rw [G.spacetime.horizontalMetric.symm (R.curve s) (Q s) (P s)] at hpos |
| 88 | linarith |
| 89 | |
| 90 | end PoincareMT.M14 |