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.Exponential.Endpoint.EndpointPrefixDifferential |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Exponential.Differential.ExponentialLineRegularity |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Paths.Joining.PrefixGaugeVelocity |
| 4 | |
| 5 | /-! |
| 6 | # Actual exponential prefixes supply the meeting momentum |
| 7 | |
| 8 | Morgan-Tian Lemma 6.22 and Proposition 6.30, pp. 115-116, 118-119. |
| 9 | For every nearby surviving branch, the actual prefix Euler path and |
| 10 | its smooth continuation identify the first variation with the genuine |
| 11 | fixed-time gauge metric paired against the coordinate velocity. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | -- The endpoint identities transport actual horizontal tangent fibers. |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set Filter |
| 19 | open scoped Manifold ContDiff Topology |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.M14 |
| 24 | |
| 25 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 26 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 27 | {T : ℝ} {x : G.Point} |
| 28 | |
| 29 | /-- Along the actual coordinate diagonal, the genuine prefix action |
| 30 | has the actual metric momentum as its full differential near the |
| 31 | central branch, Proposition 6.30, pp. 118-119. -/ |
| 32 | theorem exponential_prefixAction_fderiv_eventually |
| 33 | (hCoordinates : M12MetricPredecessors.{0} n) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 34 | (E : M14ExponentialFamily G T x) (Z W : G.Horizontal x) |
| 35 | {b c : ℝ} {U : Set ℝ} (hU : IsOpen U) |
| 36 | (hsurv : ∀ r ∈ U, (Z + r • W, b) ∈ E.domain) (hc : c ∈ Ioo 0 b) |
| 37 | (j : G.gaugeCover.index) |
| 38 | (lift : G.Point → (G.timeIntervals.interval (G.gaugeCover.interval j)).Point × |
| 39 | G.gaugeCover.spatial j) |
| 40 | (D : GaugeEndpointFamily (fun z : ℝ × ℝ => E.gamma (Z + z.2 • W) z.1) |
| 41 | U T 0 b c 0 j lift) |
| 42 | {V : Set G.Point} (hV : IsOpen V) |
| 43 | (hlift : ContMDiffOn (spacetimeModel n) (spacetimeModel n) ∞ lift V) |
| 44 | (hright : ∀ q ∈ V, (G.gaugeCover.cylinder j).toSpacetime (lift q) = q) |
| 45 | (hcenter : E.gamma Z c ∈ V) : |
| 46 | let f := fun z : ℝ × ℝ => E.gamma (Z + z.2 • W) z.1 |
| 47 | ∀ᶠ r in 𝓝 (0 : ℝ), ∀ d : ℝ × EuclideanSpace ℝ (Fin n), |
| 48 | fderiv ℝ D.prefixAction (r, (lift (f (c, r))).2.val) d = |
| 49 | ((G.gaugeCover.metric j).metric (lift (f (c, 0))).1.val).inner |
| 50 | (lift (f (c, r))).2 (deriv (fun s => (lift (f (s, r))).2.val) c) d.2 := by |
| 51 | let f := fun z : ℝ × ℝ => E.gamma (Z + z.2 • W) z.1 |
| 52 | have hzero : (0 : ℝ) ∈ U := D.parameter_subset _ D.center_mem |
| 53 | have hFc : ContMDiffAt (𝓘(ℝ, ℝ)) (spacetimeModel n) ∞ (fun r => f (c, r)) 0 := by |
| 54 | have h := (exponentialLine_contMDiffAt E Z W hU hsurv hc hzero).comp 0 |
| 55 | (contMDiffAt_const.prodMk contMDiffAt_id) |
| 56 | exact h |
| 57 | have hnear : ∀ᶠ r in 𝓝 (0 : ℝ), f (c, r) ∈ V := |
| 58 | hFc.continuousAt.preimage_mem_nhds (hV.mem_nhds (by |
| 59 | simpa only [f, zero_smul, add_zero] using hcenter)) |
| 60 | filter_upwards [D.diagonal_eventually_mem, hnear] with r hr hrV |
| 61 | have hrU : r ∈ U := D.parameter_subset _ hr |
| 62 | have hsurvC : (Z + r • W, c) ∈ E.domain := |
| 63 | (E.maximal_lifetime _).out (E.domain_zero _) (hsurv r hrU) ⟨hc.1.le, hc.2.le⟩ |
| 64 | let R := E.square_path (Z + r • W) c hsurvC hc.1 |
| 65 | have hC : M14SqrtParameterInterval 0 (c ^ 2) = Icc 0 c := by |
| 66 | rw [M14SqrtParameterInterval, Real.sqrt_zero, Real.sqrt_sq hc.1.le] |
| 67 | have hbase : EqOn R.curve (fun s => f (s, r)) (M14SqrtParameterInterval 0 (c ^ 2)) := |
| 68 | fun _ hs => exponential_square_curve_eq E (Z + r • W) hsurvC hc.1 hs |
| 69 | have hsc : c ∈ M14SqrtParameterInterval 0 (c ^ 2) := hC.symm ▸ ⟨hc.1.le, le_rfl⟩ |
| 70 | have hF := exponentialLine_contMDiffAt E Z W hU hsurv hc hrU |
| 71 | have hα : MDifferentiableAt (𝓘(ℝ, ℝ)) (spacetimeModel n) (fun s => f (s, r)) c := by |
| 72 | have h := hF.comp c (contMDiffAt_id.prodMk contMDiffAt_const) |
| 73 | exact h.mdifferentiableAt (by simp) |
| 74 | have hrec : (fun s => f (s, r)) =ᶠ[𝓝 c] |
| 75 | (fun s => (G.gaugeCover.cylinder j).toSpacetime (lift (f (s, r)))) := by |
| 76 | filter_upwards [hα.continuousAt.preimage_mem_nhds (hV.mem_nhds hrV)] with s hs |
| 77 | exact (hright _ hs).symm |
| 78 | have hvel := squareRootVelocity_gauge_continuation R (fun s => f (s, r)) hbase hsc hα j lift |
| 79 | (((hlift _ hrV).contMDiffAt (hV.mem_nhds hrV)).mdifferentiableAt (by simp)) hrec |
| 80 | obtain ⟨hy, hmark⟩ := D.marked _ hr |
| 81 | have hrecovery := D.recovery _ hr c ⟨hc.1.le, hc.2.le⟩ |
| 82 | have htime : (lift (f (c, r))).1 = (lift (f (c, 0))).1 := by |
| 83 | have hpoint : (G.gaugeCover.cylinder j).toSpacetime (lift (f (c, r))) = |
| 84 | (G.gaugeCover.cylinder j).toSpacetime |
| 85 | ((lift (f (c, 0))).1, (lift (f (c, r))).2) := |
| 86 | (hright _ hrV).trans (hrecovery.symm.trans hmark) |
| 87 | have hpair := (G.gaugeCover.cylinder j).embedding.injective hpoint |
| 88 | have ht := congrArg Prod.fst hpair |
| 89 | exact ht |
| 90 | rw [htime] at hvel |
| 91 | intro d |
| 92 | exact D.prefixAction_fderiv_of_velocity hCoordinates hM12 hc R |
| 93 | (E.square_extension (Z + r • W) c hsurvC hc.1) |
| 94 | (E.square_euler (Z + r • W) c hsurvC hc.1) r hr |
| 95 | (fun s hs => (hbase (hC.symm ▸ hs)).symm) |
| 96 | (fun v _ => E.gamma_at_zero (Z + v • W)) _ hvel d |
| 97 | |
| 98 | end PoincareMT.M14 |