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.Joining.GaugeJoinRegularity |
| 2 | |
| 3 | /-! |
| 4 | # Clock and closed continuity of the joined curve |
| 5 | |
| 6 | The one-sided gauge transition preserves the actual clock of its two |
| 7 | pieces. Its unchanged outer germs preserve their closed endpoint |
| 8 | continuity. These are the boundary fields of the admissible competitor |
| 9 | in Morgan-Tian Proposition 6.30, pp. 118-119. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set Filter |
| 15 | open scoped Manifold ContDiff Topology |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.M14 |
| 20 | |
| 21 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 22 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 23 | (b : G.gaugeCover.index) |
| 24 | (lift : G.Point → (G.timeIntervals.interval (G.gaugeCover.interval b)).Point × |
| 25 | G.gaugeCover.spatial b) |
| 26 | (α β : ℝ → G.Point) |
| 27 | |
| 28 | /-- The actual joined curve retains the specified clock on its whole |
| 29 | closed interval; in square time the clock is T-s^2. Proposition 6.30, |
| 30 | pp. 118-119. -/ |
| 31 | theorem oneSidedGaugeJoin_clock {A B c r d : ℝ} (hr : 0 < r) (θ : ℝ → ℝ) |
| 32 | (hα : ∀ s ∈ Icc A c, G.spacetime.timeFunction (α s) = θ s) |
| 33 | (hβ : ∀ s ∈ Icc (c - r) B, G.spacetime.timeFunction (β s) = θ s) |
| 34 | (hβrec : ∀ s ∈ Icc (c - r) c, |
| 35 | (G.gaugeCover.cylinder b).toSpacetime (lift (β s)) = β s) |
| 36 | {s : ℝ} (hs : s ∈ Icc A B) : |
| 37 | G.spacetime.timeFunction (oneSidedGaugeJoin b lift α β c r d s) = θ s := by |
| 38 | by_cases hl : s < c - r |
| 39 | · rw [oneSidedGaugeJoin, if_pos hl] |
| 40 | exact hα s ⟨hs.1, by linarith⟩ |
| 41 | have hleft : c - r ≤ s := le_of_not_gt hl |
| 42 | by_cases hh : c ≤ s |
| 43 | · rw [oneSidedGaugeJoin, if_neg hl, if_pos hh] |
| 44 | exact hβ s ⟨hleft, hs.2⟩ |
| 45 | have hsc : s < c := lt_of_not_ge hh |
| 46 | rw [oneSidedGaugeJoin_eq_middle b lift α β ⟨hleft, hsc⟩, |
| 47 | gaugeBlend_time b lift α β _ _ _ (hβrec s ⟨hleft, hsc.le⟩)] |
| 48 | exact hβ s ⟨hleft, hs.2⟩ |
| 49 | |
| 50 | /-- Closed endpoint continuity is retained from the unchanged outer |
| 51 | pieces of the joining curve. Interior continuity includes the patch |
| 52 | boundaries, Proposition 6.30, pp. 118-119. -/ |
| 53 | theorem oneSidedGaugeJoin_continuousOn {A B c r d : ℝ} (hr : 0 < r) |
| 54 | (hA : A < c - r) (hB : c < B) |
| 55 | (hα : ContinuousOn α (Icc A c)) (hβ : ContinuousOn β (Icc (c - r) B)) |
| 56 | (hreg : ContinuousOn (oneSidedGaugeJoin b lift α β c r d) (Ioo A B)) : |
| 57 | ContinuousOn (oneSidedGaugeJoin b lift α β c r d) (Icc A B) := by |
| 58 | intro s hs |
| 59 | rcases hs.1.eq_or_lt with heq | hAs |
| 60 | · subst s |
| 61 | have hAc : A < c := by linarith |
| 62 | have hnear : Icc A c ∈ 𝓝[Icc A B] A := by |
| 63 | filter_upwards [self_mem_nhdsWithin, |
| 64 | mem_nhdsWithin_of_mem_nhds (gt_mem_nhds hAc)] with t ht htc |
| 65 | exact ⟨ht.1, htc.le⟩ |
| 66 | have hcont := (hα A ⟨le_rfl, hAc.le⟩).mono_of_mem_nhdsWithin hnear |
| 67 | have hEq : oneSidedGaugeJoin b lift α β c r d =ᶠ[𝓝 A] α := by |
| 68 | filter_upwards [gt_mem_nhds hA] with t ht |
| 69 | simp only [oneSidedGaugeJoin, if_pos ht] |
| 70 | exact hcont.congr_of_eventuallyEq (hEq.filter_mono nhdsWithin_le_nhds) hEq.eq_of_nhds |
| 71 | rcases hs.2.eq_or_lt with heq | hsB |
| 72 | · subst s |
| 73 | have hBc : c - r < B := by linarith |
| 74 | have hnear : Icc (c - r) B ∈ 𝓝[Icc A B] B := by |
| 75 | filter_upwards [self_mem_nhdsWithin, |
| 76 | mem_nhdsWithin_of_mem_nhds (lt_mem_nhds hBc)] with t ht htc |
| 77 | exact ⟨htc.le, ht.2⟩ |
| 78 | have hcont := (hβ B ⟨hBc.le, le_rfl⟩).mono_of_mem_nhdsWithin hnear |
| 79 | have hEq : oneSidedGaugeJoin b lift α β c r d =ᶠ[𝓝 B] β := by |
| 80 | filter_upwards [lt_mem_nhds hB] with t ht |
| 81 | have hn : ¬t < c - r := by linarith |
| 82 | simp only [oneSidedGaugeJoin, if_neg hn, if_pos ht.le] |
| 83 | exact hcont.congr_of_eventuallyEq (hEq.filter_mono nhdsWithin_le_nhds) hEq.eq_of_nhds |
| 84 | exact (hreg.continuousAt (isOpen_Ioo.mem_nhds ⟨hAs, hsB⟩)).continuousWithinAt |
| 85 | |
| 86 | end PoincareMT.M14 |