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.Exponential.Families.ClosedEulerODE |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Euler.EulerGaugePhase |
| 4 | |
| 5 | /-! |
| 6 | # Uniqueness of actual Euler paths in a common gauge |
| 7 | |
| 8 | Morgan-Tian Lemma 6.18, pp. 113-114. Initial spacetime and |
| 9 | horizontal-velocity equality determine the same coordinate phase. |
| 10 | Closed phase uniqueness and the common clock identify both paths. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | -- Gauge reconstruction transports the actual dependent horizontal fibers. |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set |
| 18 | open scoped Manifold ContDiff |
| 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 | (b : G.gaugeCover.index) |
| 27 | |
| 28 | private theorem gaugeTangent_eq_of_heq |
| 29 | {z z' : (G.timeIntervals.interval (G.gaugeCover.interval b)).Point × |
| 30 | G.gaugeCover.spatial b} |
| 31 | (hz : z = z') {v w : EuclideanSpace ℝ (Fin n)} |
| 32 | (hv : HEq ((G.gaugeCover.metric b).spatialTangentEquiv z.1 z.2 v) |
| 33 | ((G.gaugeCover.metric b).spatialTangentEquiv z'.1 z'.2 w)) : v = w := by |
| 34 | cases hz |
| 35 | exact ((G.gaugeCover.metric b).spatialTangentEquiv z.1 z.2).injective (eq_of_heq hv) |
| 36 | |
| 37 | /-- Actual square-root Euler paths that meet with the same horizontal |
| 38 | velocity agree on every common closed gauge interval. Their original |
| 39 | intervals may differ. This is Lemma 6.18, pp. 113-114, with the frozen |
| 40 | closed-endpoint semantics retained. -/ |
| 41 | theorem squareRootEuler_gauge_unique |
| 42 | (hCoordinates : SpacetimeGaugeTheory.{u, 0} G.leafwise G.timeIntervals) |
| 43 | (hscalar : ContMDiff (spacetimeModel n) (𝓘(ℝ, ℝ)) ∞ |
| 44 | (horizontalScalarCurvature G.leafwise)) |
| 45 | (W : OrdinaryGaugeWitness G.leafwise (G.gaugeCover.cylinder b) (G.gaugeCover.metric b)) |
| 46 | (hM04 : RicciFlowCurvatureTheory.{0}) (x₀ : G.gaugeCover.spatial b) |
| 47 | {T τ₁ τ₂ σ₁ σ₂ : ℝ} {x₁ y₁ x₂ y₂ : G.Point} |
| 48 | {p₁ : M14BackwardPath G T τ₁ τ₂ x₁ y₁} {p₂ : M14BackwardPath G T σ₁ σ₂ x₂ y₂} |
| 49 | (R₁ : M14SquareRootPath G p₁) (R₂ : M14SquareRootPath G p₂) |
| 50 | {a c s₀ : ℝ} (hac : a < c) |
| 51 | (hsub₁ : Icc a c ⊆ M14SqrtParameterInterval τ₁ τ₂) |
| 52 | (hsub₂ : Icc a c ⊆ M14SqrtParameterInterval σ₁ σ₂) |
| 53 | {β₁ β₂ : ℝ → (G.timeIntervals.interval (G.gaugeCover.interval b)).Point × |
| 54 | G.gaugeCover.spatial b} |
| 55 | (hβ₁ : ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) ∞ β₁ (Icc a c)) |
| 56 | (hβ₂ : ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) ∞ β₂ (Icc a c)) |
| 57 | (hrec₁ : ∀ s ∈ Icc a c, (G.gaugeCover.cylinder b).toSpacetime (β₁ s) = R₁.curve s) |
| 58 | (hrec₂ : ∀ s ∈ Icc a c, (G.gaugeCover.cylinder b).toSpacetime (β₂ s) = R₂.curve s) |
| 59 | (hclock₁ : ∀ s ∈ Icc a c, (β₁ s).1.val = T - s ^ 2) |
| 60 | (hclock₂ : ∀ s ∈ Icc a c, (β₂ s).1.val = T - s ^ 2) |
| 61 | (E₁ : M14PullbackExtension G R₁.curve (M14SqrtParameterInterval τ₁ τ₂) |
| 62 | R₁.horizontal_velocity) |
| 63 | (E₂ : M14PullbackExtension G R₂.curve (M14SqrtParameterInterval σ₁ σ₂) |
| 64 | R₂.horizontal_velocity) |
| 65 | (heuler₁ : ∀ s ∈ Icc a c, ∀ Z : G.Horizontal (R₁.curve s), |
| 66 | M14SquareRootEulerResidual G R₁ E₁ s Z = 0) |
| 67 | (heuler₂ : ∀ s ∈ Icc a c, ∀ Z : G.Horizontal (R₂.curve s), |
| 68 | M14SquareRootEulerResidual G R₂ E₂ s Z = 0) |
| 69 | (hs₀ : s₀ ∈ Icc a c) (heq : R₁.curve s₀ = R₂.curve s₀) |
| 70 | (hvel : HEq (R₁.horizontal_velocity s₀) (R₂.horizontal_velocity s₀)) : |
| 71 | EqOn R₁.curve R₂.curve (Icc a c) := by |
| 72 | let q₁ := fun s => (β₁ s).2.val |
| 73 | let q₂ := fun s => (β₂ s).2.val |
| 74 | let B := M08.chartActionMetric W.flow T x₀ |
| 75 | let P₁ := fun s => M08.chartMomentumVector (B (s, q₁ s)) (derivWithin q₁ (Icc a c) s) |
| 76 | let P₂ := fun s => M08.chartMomentumVector (B (s, q₂ s)) (derivWithin q₂ (Icc a c) s) |
| 77 | have hbase : β₁ s₀ = β₂ s₀ := (G.gaugeCover.cylinder b).embedding.injective |
| 78 | ((hrec₁ s₀ hs₀).trans (heq.trans (hrec₂ s₀ hs₀).symm)) |
| 79 | have hq₀ : q₁ s₀ = q₂ s₀ := congrArg (fun z => z.2.val) hbase |
| 80 | have hv₁ := squareRootVelocity_gauge_subset b R₁ hsub₁ hβ₁ hrec₁ hs₀ |
| 81 | (uniqueDiffOn_Icc hac s₀ hs₀) |
| 82 | have hv₂ := squareRootVelocity_gauge_subset b R₂ hsub₂ hβ₂ hrec₂ hs₀ |
| 83 | (uniqueDiffOn_Icc hac s₀ hs₀) |
| 84 | have hv₀ : derivWithin q₁ (Icc a c) s₀ = derivWithin q₂ (Icc a c) s₀ := |
| 85 | gaugeTangent_eq_of_heq b hbase (hv₁.symm.trans (hvel.trans hv₂)) |
| 86 | have hP₀ : P₁ s₀ = P₂ s₀ := by dsimp only [P₁, P₂]; rw [hq₀, hv₀] |
| 87 | have hphase₁ := squareRootEuler_gauge_phase R₁ b hCoordinates hscalar W hM04 x₀ hac hsub₁ |
| 88 | hβ₁ hrec₁ hclock₁ E₁ heuler₁ |
| 89 | have hphase₂ := squareRootEuler_gauge_phase R₂ b hCoordinates hscalar W hM04 x₀ hac hsub₂ |
| 90 | hβ₂ hrec₂ hclock₂ E₂ heuler₂ |
| 91 | have htime (s : ℝ) (hs : s ∈ Icc a c) : T - s ^ 2 ∈ (G.gaugeCover.interval b).domain := by |
| 92 | rw [← hclock₁ s hs] |
| 93 | exact (β₁ s).1.property |
| 94 | have hsrc (s : ℝ) (_hs : s ∈ Icc a c) : q₁ s ∈ (extChartAt (𝓡 n) x₀).target := by |
| 95 | have hval : extChartAt (𝓡 n) x₀ (β₁ s).2 = q₁ s := by rw [extChartAt_coe]; rfl |
| 96 | rw [← hval] |
| 97 | apply (extChartAt (𝓡 n) x₀).map_source |
| 98 | rw [extChartAt_source, (G.gaugeCover.spatial b).chartAt_source_eq_univ] |
| 99 | exact mem_univ _ |
| 100 | have hphases := closedChartEulerPhase_unique W.flow hM04 T x₀ hac htime hsrc |
| 101 | hphase₁ hphase₂ hs₀ (Prod.ext hq₀ hP₀) |
| 102 | intro s hs |
| 103 | have hqs : q₁ s = q₂ s := congrArg Prod.fst (hphases hs) |
| 104 | have hβs : β₁ s = β₂ s := Prod.ext |
| 105 | (Subtype.ext ((hclock₁ s hs).trans (hclock₂ s hs).symm)) (Subtype.ext hqs) |
| 106 | exact (hrec₁ s hs).symm.trans ((congrArg (G.gaugeCover.cylinder b).toSpacetime hβs).trans |
| 107 | (hrec₂ s hs)) |
| 108 | |
| 109 | end PoincareMT.M14 |