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.Euler.EulerGaugeUnique |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Paths.SquareRoot.Action.SquareRootComparison |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Coordinates.GaugeLift |
| 5 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Jacobi.OverlappingIntervals |
| 6 | import PoincareLib.Geometry.RicciFlow.Generalized.Gauge.Geometry |
| 7 | |
| 8 | /-! |
| 9 | # Relative local uniqueness of actual square-root Euler paths |
| 10 | |
| 11 | Morgan-Tian Lemma 6.18, pp. 113-114. At a meeting point and |
| 12 | horizontal velocity, both paths lift to one actual gauge on a |
| 13 | relative closed neighborhood. Coordinate uniqueness identifies them |
| 14 | there, and derivative restriction identifies their actual velocities. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | |
| 19 | open Set Filter Topology |
| 20 | open scoped Manifold ContDiff |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | namespace PoincareMT.M14 |
| 25 | |
| 26 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 27 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 28 | |
| 29 | /-- Actual square-root Euler paths meeting with the same horizontal |
| 30 | velocity agree as point-and-velocity phases near that time, relative |
| 31 | to any nondegenerate common closed interval. This proves the local |
| 32 | uniqueness assertion of Lemma 6.18, pp. 113-114, without a supplied gauge. -/ |
| 33 | theorem squareRootEuler_eventuallyEqWithin |
| 34 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 35 | {T τ₁ τ₂ σ₁ σ₂ : ℝ} {x₁ y₁ x₂ y₂ : G.Point} |
| 36 | {p₁ : M14BackwardPath G T τ₁ τ₂ x₁ y₁} {p₂ : M14BackwardPath G T σ₁ σ₂ x₂ y₂} |
| 37 | (R₁ : M14SquareRootPath G p₁) (R₂ : M14SquareRootPath G p₂) |
| 38 | {a c s₀ : ℝ} (hac : a < c) |
| 39 | (hsub₁ : Icc a c ⊆ M14SqrtParameterInterval τ₁ τ₂) |
| 40 | (hsub₂ : Icc a c ⊆ M14SqrtParameterInterval σ₁ σ₂) |
| 41 | (E₁ : M14PullbackExtension G R₁.curve (M14SqrtParameterInterval τ₁ τ₂) |
| 42 | R₁.horizontal_velocity) |
| 43 | (E₂ : M14PullbackExtension G R₂.curve (M14SqrtParameterInterval σ₁ σ₂) |
| 44 | R₂.horizontal_velocity) |
| 45 | (heuler₁ : ∀ s ∈ Icc a c, ∀ Z : G.Horizontal (R₁.curve s), |
| 46 | M14SquareRootEulerResidual G R₁ E₁ s Z = 0) |
| 47 | (heuler₂ : ∀ s ∈ Icc a c, ∀ Z : G.Horizontal (R₂.curve s), |
| 48 | M14SquareRootEulerResidual G R₂ E₂ s Z = 0) |
| 49 | (hs₀ : s₀ ∈ Icc a c) (heq : R₁.curve s₀ = R₂.curve s₀) |
| 50 | (hvel : HEq (R₁.horizontal_velocity s₀) (R₂.horizontal_velocity s₀)) : |
| 51 | ∀ᶠ s in 𝓝[Icc a c] s₀, |
| 52 | R₁.curve s = R₂.curve s ∧ HEq (R₁.horizontal_velocity s) (R₂.horizontal_velocity s) := by |
| 53 | classical |
| 54 | have hCoordinates := hM12.coordinate_gauges X time I G.spacetime G.slices |
| 55 | G.timeIntervals G.gaugeCover G.leafwise |
| 56 | have hscalar := ((hM12.leafwise_calculus X time I G.spacetime G.slices |
| 57 | G.timeIntervals G.gaugeCover).2 G.leafwise).scalar_smooth |
| 58 | obtain ⟨b, U, lift, hU, hsU, hlift, hright, hclock⟩ := |
| 59 | exists_smooth_gauge_lift G (R₁.curve s₀) |
| 60 | have hR₁ := (R₁.smooth.mono R₁.interval_subset).mono hsub₁ |
| 61 | have hR₂ := (R₂.smooth.mono R₂.interval_subset).mono hsub₂ |
| 62 | have hpre₁ : R₁.curve ⁻¹' U ∈ 𝓝[Icc a c] s₀ := |
| 63 | (hR₁.continuousOn s₀ hs₀).preimage_mem_nhdsWithin (hU.mem_nhds hsU) |
| 64 | have hpre₂ : R₂.curve ⁻¹' U ∈ 𝓝[Icc a c] s₀ := |
| 65 | (hR₂.continuousOn s₀ hs₀).preimage_mem_nhdsWithin (hU.mem_nhds (heq ▸ hsU)) |
| 66 | obtain ⟨N, hN, hsN, hNsub⟩ := mem_nhdsWithin.mp (inter_mem hpre₁ hpre₂) |
| 67 | have hcore : Icc s₀ s₀ ⊆ N := by simpa only [Icc_self, singleton_subset_iff] using hsN |
| 68 | obtain ⟨l, r, hal, hlr, hrc, hls, hsr, hJN, hnear⟩ := |
| 69 | M08.exists_enlarged_closed_interval hac hs₀.1 le_rfl hs₀.2 hN hcore |
| 70 | have hJC : Icc l r ⊆ Icc a c := Icc_subset_Icc hal hrc |
| 71 | have hmap₁ : MapsTo R₁.curve (Icc l r) U := fun s hs => (hNsub ⟨hJN hs, hJC hs⟩).1 |
| 72 | have hmap₂ : MapsTo R₂.curve (Icc l r) U := fun s hs => (hNsub ⟨hJN hs, hJC hs⟩).2 |
| 73 | let W := Classical.choice (ordinaryGaugeWitness_nonempty b hCoordinates) |
| 74 | have hlocal := squareRootEuler_gauge_unique b hCoordinates hscalar W hM04 |
| 75 | (lift (R₁.curve s₀)).2 R₁ R₂ hlr (hJC.trans hsub₁) (hJC.trans hsub₂) |
| 76 | (hlift.comp (hR₁.mono hJC) hmap₁) (hlift.comp (hR₂.mono hJC) hmap₂) |
| 77 | (fun s hs => hright _ (hmap₁ hs)) (fun s hs => hright _ (hmap₂ hs)) |
| 78 | (fun s hs => (hclock _ (hmap₁ hs)).trans (R₁.curve_time s (hsub₁ (hJC hs)))) |
| 79 | (fun s hs => (hclock _ (hmap₂ hs)).trans (R₂.curve_time s (hsub₂ (hJC hs)))) |
| 80 | E₁ E₂ (fun s hs => heuler₁ s (hJC hs)) (fun s hs => heuler₂ s (hJC hs)) |
| 81 | ⟨hls, hsr⟩ heq hvel |
| 82 | filter_upwards [hnear s₀ ⟨le_rfl, le_rfl⟩] with s hs |
| 83 | exact ⟨hlocal hs, squareRoot_horizontalVelocity_heq_on_subset R₁ R₂ |
| 84 | (hJC.trans hsub₁) (hJC.trans hsub₂) hlocal hs (uniqueDiffOn_Icc hlr s hs)⟩ |
| 85 | |
| 86 | end PoincareMT.M14 |