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.ReducedLength |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Paths.Joining.GaugeJoin |
| 3 | |
| 4 | /-! |
| 5 | # Regularity across the two gauge-join patch boundaries |
| 6 | |
| 7 | The cutoff is constant before the transition and before the joining |
| 8 | endpoint. Agreement on open overlaps therefore gives the same interior |
| 9 | regularity as the original pieces. Morgan-Tian Proposition 6.30, |
| 10 | pp. 118-119, with the finite-energy endpoint approximation recorded in |
| 11 | proof-work/tasks/M14/derivations/2026-09-21-strict-prefix.md. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set Filter |
| 17 | open scoped Manifold ContDiff Topology |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.M14 |
| 22 | |
| 23 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 24 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 25 | (b : G.gaugeCover.index) |
| 26 | (lift : G.Point → (G.timeIntervals.interval (G.gaugeCover.interval b)).Point × |
| 27 | G.gaugeCover.spatial b) |
| 28 | (α β : ℝ → G.Point) |
| 29 | |
| 30 | /-- The actual patched gauge transition has the regularity of its |
| 31 | pieces throughout the whole open path interval, including both patch |
| 32 | boundaries. Proposition 6.30, pp. 118-119. -/ |
| 33 | theorem oneSidedGaugeJoin_contMDiffOn {U : Set G.Point} (hU : IsOpen U) |
| 34 | (hlift : ContMDiffOn (spacetimeModel n) (spacetimeModel n) ∞ lift U) |
| 35 | {k : ℕ∞ω} (hk : k ≤ ∞) {A B c r d : ℝ} (hd : 0 < d) (hdr : 2 * d < r) |
| 36 | (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) k α (Ioo A c)) |
| 37 | (hβ : ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) k β (Ioo (c - r) B)) |
| 38 | (hαU : ∀ s ∈ Icc (c - r) c, α s ∈ U) |
| 39 | (hβU : ∀ s ∈ Icc (c - r) c, β s ∈ U) |
| 40 | (hαrec : ∀ s ∈ Icc (c - r) c, |
| 41 | (G.gaugeCover.cylinder b).toSpacetime (lift (α s)) = α s) |
| 42 | (hβrec : ∀ s ∈ Icc (c - r) c, |
| 43 | (G.gaugeCover.cylinder b).toSpacetime (lift (β s)) = β s) |
| 44 | (htime : ∀ s ∈ Icc (c - r) c, (lift (α s)).1 = (lift (β s)).1) |
| 45 | (hmem : ∀ s ∈ Ioo (c - r) c, |
| 46 | Proofs.M09.smoothJoinBlend (fun t => (lift (α t)).2.val) |
| 47 | (fun t => (lift (β t)).2.val) (c - 3 * d / 2) (d / 2) s ∈ G.gaugeCover.spatial b) : |
| 48 | ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) k |
| 49 | (oneSidedGaugeJoin b lift α β c r d) (Ioo A B) := by |
| 50 | intro s hs |
| 51 | by_cases hl : s < c - 2 * d |
| 52 | · have hsc : s < c := by linarith |
| 53 | have hreg := (hα s ⟨hs.1, hsc⟩).contMDiffAt (isOpen_Ioo.mem_nhds ⟨hs.1, hsc⟩) |
| 54 | have heq : oneSidedGaugeJoin b lift α β c r d =ᶠ[𝓝 s] α := by |
| 55 | filter_upwards [gt_mem_nhds hl] with t ht |
| 56 | exact oneSidedGaugeJoin_eq_left b lift α β hd hαrec htime ht.le |
| 57 | exact (hreg.congr_of_eventuallyEq heq).contMDiffWithinAt |
| 58 | by_cases hr : c - d < s |
| 59 | · have hcs : c - r < s := by linarith |
| 60 | have hreg := (hβ s ⟨hcs, hs.2⟩).contMDiffAt (isOpen_Ioo.mem_nhds ⟨hcs, hs.2⟩) |
| 61 | have heq : oneSidedGaugeJoin b lift α β c r d =ᶠ[𝓝 s] β := by |
| 62 | filter_upwards [lt_mem_nhds hr] with t ht |
| 63 | exact oneSidedGaugeJoin_eq_right b lift α β hd hdr hβrec ht.le |
| 64 | exact (hreg.congr_of_eventuallyEq heq).contMDiffWithinAt |
| 65 | have hsJ : s ∈ Ioo (c - r) c := |
| 66 | ⟨by linarith [not_lt.mp hl], by linarith [not_lt.mp hr]⟩ |
| 67 | have heq : oneSidedGaugeJoin b lift α β c r d =ᶠ[𝓝 s] |
| 68 | gaugeBlend b lift α β (c - 3 * d / 2) (d / 2) := by |
| 69 | filter_upwards [isOpen_Ioo.mem_nhds hsJ] with t ht |
| 70 | exact oneSidedGaugeJoin_eq_middle b lift α β ⟨ht.1.le, ht.2⟩ |
| 71 | have hreg := gaugeBlend_contMDiffAt b lift α β hU hlift hk |
| 72 | ((hα s ⟨hs.1, hsJ.2⟩).contMDiffAt (isOpen_Ioo.mem_nhds ⟨hs.1, hsJ.2⟩)) |
| 73 | ((hβ s ⟨hsJ.1, hs.2⟩).contMDiffAt (isOpen_Ioo.mem_nhds ⟨hsJ.1, hs.2⟩)) |
| 74 | (hαU s (Ioo_subset_Icc_self hsJ)) (hβU s (Ioo_subset_Icc_self hsJ)) (hmem s hsJ) |
| 75 | exact (hreg.congr_of_eventuallyEq heq).contMDiffWithinAt |
| 76 | |
| 77 | end PoincareMT.M14 |