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.Coordinates.GaugeCoordinateLift |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Euler.PhaseEuler |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Paths.SquareRoot.Action.SquareCurvePath |
| 5 | |
| 6 | /-! |
| 7 | # Geometric square-root Euler paths from actual coordinate phases |
| 8 | |
| 9 | Morgan-Tian Definition 6.7 and Lemmas 6.8 and 6.18, |
| 10 | pp. 108-109, 113-114. A valid closed coordinate phase lifts into |
| 11 | the actual compatible cylinder. Square substitution packages the |
| 12 | backward and square-root paths, and the reverse phase identity gives |
| 13 | the actual geometric Euler equation for a genuine velocity extension. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | -- The reconstructed curve transports the actual horizontal tangent fibers. |
| 18 | set_option backward.isDefEq.respectTransparency false |
| 19 | |
| 20 | open Set |
| 21 | open scoped Manifold ContDiff |
| 22 | |
| 23 | universe u |
| 24 | |
| 25 | namespace PoincareMT.M14 |
| 26 | |
| 27 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 28 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 29 | |
| 30 | /-- An actual closed Euler phase reconstructs genuine backward and |
| 31 | square-root paths with the prescribed gauge coordinates, actual |
| 32 | horizontal velocity and geometric Euler equation. This is the |
| 33 | reconstruction in Definition 6.7 and Lemma 6.18, pp. 108-109, 113-114. -/ |
| 34 | theorem exists_gaugeEulerPath_of_phase |
| 35 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 36 | (b : G.gaugeCover.index) |
| 37 | (W : OrdinaryGaugeWitness G.leafwise (G.gaugeCover.cylinder b) (G.gaugeCover.metric b)) |
| 38 | (t₀ : (G.timeIntervals.interval (G.gaugeCover.interval b)).Point) |
| 39 | (x₀ : G.gaugeCover.spatial b) {T a c : ℝ} (ha : 0 ≤ a) (hac : a < c) |
| 40 | (htime : ∀ s ∈ M14SqrtParameterInterval a c, |
| 41 | T - s ^ 2 ∈ (G.gaugeCover.interval b).domain) |
| 42 | {q P : ℝ → EuclideanSpace ℝ (Fin n)} |
| 43 | (hq : ContDiffOn ℝ ∞ q (M14SqrtParameterInterval a c)) |
| 44 | (hmap : MapsTo q (M14SqrtParameterInterval a c) (extChartAt (𝓡 n) x₀).target) |
| 45 | (hphase : ∀ s ∈ M14SqrtParameterInterval a c, |
| 46 | HasDerivWithinAt (fun r => (q r, P r)) |
| 47 | (M08.closedChartEulerPhase W.flow T x₀ (M14SqrtParameterInterval a c) |
| 48 | s (q s, P s)) (M14SqrtParameterInterval a c) s) : |
| 49 | ∃ β : ℝ → (G.timeIntervals.interval (G.gaugeCover.interval b)).Point × |
| 50 | G.gaugeCover.spatial b, |
| 51 | ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) ∞ β (M14SqrtParameterInterval a c) ∧ |
| 52 | (∀ s ∈ M14SqrtParameterInterval a c, (β s).1.val = T - s ^ 2) ∧ |
| 53 | (∀ s ∈ M14SqrtParameterInterval a c, (β s).2.val = q s) ∧ |
| 54 | ∃ (p : M14BackwardPath G T a c |
| 55 | ((G.gaugeCover.cylinder b).toSpacetime (β (Real.sqrt a))) |
| 56 | ((G.gaugeCover.cylinder b).toSpacetime (β (Real.sqrt c)))) |
| 57 | (R : M14SquareRootPath G p) |
| 58 | (E : M14PullbackExtension G R.curve (M14SqrtParameterInterval a c) R.horizontal_velocity), |
| 59 | (∀ τ ∈ Icc a c, p.curve τ = (G.gaugeCover.cylinder b).toSpacetime (β (Real.sqrt τ))) ∧ |
| 60 | (∀ s ∈ M14SqrtParameterInterval a c, |
| 61 | R.curve s = (G.gaugeCover.cylinder b).toSpacetime (β s)) ∧ |
| 62 | (∀ s ∈ M14SqrtParameterInterval a c, ∀ Z : G.Horizontal (R.curve s), |
| 63 | M14SquareRootEulerResidual G R E s Z = 0) ∧ |
| 64 | ∀ s ∈ M14SqrtParameterInterval a c, |
| 65 | HEq (R.horizontal_velocity s) |
| 66 | ((G.gaugeCover.metric b).spatialTangentEquiv (β s).1 (β s).2 |
| 67 | (derivWithin q (M14SqrtParameterInterval a c) s)) := by |
| 68 | obtain ⟨β, hβ, hclock, hcoord⟩ := |
| 69 | exists_smooth_gaugeLift_of_coordinates b t₀ x₀ T htime hq hmap |
| 70 | let α := fun s => (G.gaugeCover.cylinder b).toSpacetime (β s) |
| 71 | have hα : ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) ∞ α (M14SqrtParameterInterval a c) := |
| 72 | (G.gaugeCover.cylinder b).smooth.comp_contMDiffOn hβ |
| 73 | have hαclock (s : ℝ) (hs : s ∈ M14SqrtParameterInterval a c) : |
| 74 | G.spacetime.timeFunction (α s) = T - s ^ 2 := |
| 75 | ((G.gaugeCover.cylinder b).time_eq (β s)).trans (hclock s hs) |
| 76 | let p := backwardPathOfSquareCurve hM12 ha hac α hα hαclock |
| 77 | let R := squareRootPathOfSquareCurve hM12 ha hac α hα hαclock |
| 78 | obtain ⟨E⟩ := exists_squareRoot_velocity_extension R |
| 79 | have hrec (s : ℝ) (hs : s ∈ M14SqrtParameterInterval a c) : |
| 80 | (G.gaugeCover.cylinder b).toSpacetime (β s) = R.curve s := |
| 81 | (squareRootPathOfSquareCurve_curve hM12 ha hac α hα hαclock hs).symm |
| 82 | have hphaseβ (s : ℝ) (hs : s ∈ M14SqrtParameterInterval a c) : |
| 83 | HasDerivWithinAt (fun r => ((β r).2.val, P r)) |
| 84 | (M08.closedChartEulerPhase W.flow T x₀ (M14SqrtParameterInterval a c) |
| 85 | s ((β s).2.val, P s)) (M14SqrtParameterInterval a c) s := by |
| 86 | rw [hcoord s hs] |
| 87 | exact (hphase s hs).congr_of_mem (fun r hr => Prod.ext (hcoord r hr) rfl) hs |
| 88 | have hCoordinates := hM12.coordinate_gauges X time I G.spacetime G.slices |
| 89 | G.timeIntervals G.gaugeCover G.leafwise |
| 90 | have hscalar := ((hM12.leafwise_calculus X time I G.spacetime G.slices |
| 91 | G.timeIntervals G.gaugeCover).2 G.leafwise).scalar_smooth |
| 92 | have hC := Real.sqrt_lt_sqrt ha hac |
| 93 | refine ⟨β, hβ, hclock, hcoord, p, R, E, fun _ _ => rfl, |
| 94 | fun s hs => (hrec s hs).symm, |
| 95 | squareRootEuler_of_gauge_phase R b hCoordinates hscalar W hM04 x₀ hC Subset.rfl |
| 96 | hβ hrec hclock E hphaseβ, ?_⟩ |
| 97 | intro s hs |
| 98 | have hv := squareRootVelocity_gauge_subset b R Subset.rfl hβ hrec hs (uniqueDiffOn_Icc hC s hs) |
| 99 | rw [derivWithin_congr hcoord (hcoord s hs)] at hv |
| 100 | exact hv |
| 101 | |
| 102 | end PoincareMT.M14 |