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.Paths.SquareRoot.Action.SquareRootComparison |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Coordinates.GaugeParameterDifferential |
| 3 | |
| 4 | /-! |
| 5 | # Gauge velocity at a closed prefix endpoint |
| 6 | |
| 7 | Morgan-Tian Lemma 6.22 and Proposition 6.30, pp. 115-116, 118-119. |
| 8 | A prefix curve agrees with an actual smooth continuation on its |
| 9 | closed interval. Unique within derivatives identify its retained |
| 10 | velocity with the continuation's ordinary gauge-coordinate derivative. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | -- The actual derivative values share the fixed spacetime tangent model. |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set Filter |
| 18 | open scoped Manifold ContDiff Topology |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.M14 |
| 23 | |
| 24 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 25 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 26 | {T a b : ℝ} {x y : G.Point} {p : M14BackwardPath G T a b x y} |
| 27 | |
| 28 | /-- The closed prefix velocity is the actual spatial derivative of |
| 29 | its smooth continuation in a compatible inverse gauge, |
| 30 | Proposition 6.30, pp. 118-119. -/ |
| 31 | theorem squareRootVelocity_gauge_continuation (R : M14SquareRootPath G p) |
| 32 | (α : ℝ → G.Point) (heq : EqOn R.curve α (M14SqrtParameterInterval a b)) |
| 33 | {s : ℝ} (hs : s ∈ M14SqrtParameterInterval a b) |
| 34 | (hα : MDifferentiableAt (𝓘(ℝ, ℝ)) (spacetimeModel n) α s) |
| 35 | (j : G.gaugeCover.index) |
| 36 | (lift : G.Point → (G.timeIntervals.interval (G.gaugeCover.interval j)).Point × |
| 37 | G.gaugeCover.spatial j) |
| 38 | (hlift : MDifferentiableAt (spacetimeModel n) (spacetimeModel n) lift (α s)) |
| 39 | (hrec : α =ᶠ[𝓝 s] fun t => (G.gaugeCover.cylinder j).toSpacetime (lift (α t))) : |
| 40 | HEq (R.horizontal_velocity s) ((G.gaugeCover.metric j).spatialTangentEquiv |
| 41 | (lift (α s)).1 (lift (α s)).2 (deriv (fun t => (lift (α t)).2.val) s)) := by |
| 42 | have hC := uniqueDiffOn_Icc (Real.sqrt_lt_sqrt p.tau_nonneg p.tau_lt) s hs |
| 43 | have hv := projectedCurveVelocityWithin_congrOn (G := G) heq hs |
| 44 | rw [squareRoot_projectedVelocityWithin_subset R Subset.rfl hs hC] at hv |
| 45 | have hactual : projectedCurveVelocityWithin G α (M14SqrtParameterInterval a b) s = |
| 46 | projectedCurveVelocity G α s := by |
| 47 | exact congrArg (fun L : ℝ →L[ℝ] SpacetimeModelVector n => |
| 48 | G.spacetime.horizontalProjection (α s) (L (1 : ℝ))) |
| 49 | (mfderivWithin_eq_mfderiv hC.uniqueMDiffWithinAt hα) |
| 50 | rw [hactual] at hv |
| 51 | have hg := gaugeMap_projectedDifferential_congr j (hlift.comp s hα) hrec (1 : ℝ) |
| 52 | rw [fderiv_apply_one_eq_deriv] at hg |
| 53 | exact hv.trans hg |
| 54 | |
| 55 | end PoincareMT.M14 |