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.Regularity.Lipschitz.LocalLipschitzDistance |
| 2 | |
| 3 | /-! |
| 4 | # Uniform terminal tails enter a prescribed stable-slice neighborhood |
| 5 | |
| 6 | The auxiliary speed bound controls short terminal tails uniformly over |
| 7 | the supplied minimizing paths. Only the actual topology and actual |
| 8 | clock are used. Morgan-Tian Proposition 6.59 and Lemma 6.60, |
| 9 | pp. 134-137, in the proof of Proposition 6.56, p. 133. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set Filter |
| 15 | open scoped Manifold ContDiff Topology ENNReal |
| 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 | {T τ : ℝ} {x q0 : G.Point} |
| 24 | |
| 25 | /-- One actual endpoint neighborhood forces every uniformly bounded |
| 26 | square-path terminal tail to reach a prescribed neighborhood at the |
| 27 | fixed reference time. This requires no completeness, Proposition 6.59 |
| 28 | and Lemma 6.60, pp. 134-137. -/ |
| 29 | theorem exists_terminal_tail_neighborhood (hτ : 0 < τ) |
| 30 | (htime : G.spacetime.timeFunction q0 = T - τ) |
| 31 | {U : Set G.Point} (hU : U ∈ 𝓝 q0) {C : ℝ} (hC : 0 ≤ C) : |
| 32 | ∃ O : Set G.Point, IsOpen O ∧ q0 ∈ O ∧ |
| 33 | ∀ q ∈ O, ∀ p : M14BackwardPath G T 0 (T - G.spacetime.timeFunction q) x q, |
| 34 | ∀ R : M14SquareRootPath G p, |
| 35 | (∀ s ∈ M14SqrtParameterInterval 0 (T - G.spacetime.timeFunction q), |
| 36 | G.spacetime.horizontalMetric.inner (R.curve s) |
| 37 | (R.horizontal_velocity s) (R.horizontal_velocity s) + 4 * s ^ 2 ≤ C ^ 2) → |
| 38 | τ < T - G.spacetime.timeFunction q → p.curve τ ∈ U := by |
| 39 | obtain ⟨ε, hε, hεU⟩ := auxiliarySpacetimeEDist_ball_subset G.spacetime hU |
| 40 | have ht : ContMDiff (spacetimeModel n) 𝓘(ℝ) ∞ G.spacetime.timeFunction := |
| 41 | G.spacetime.time_smooth |
| 42 | have htimec : Continuous G.spacetime.timeFunction := ht.continuous |
| 43 | let d : G.Point → ℝ := fun q => |
| 44 | C * (Real.sqrt (T - G.spacetime.timeFunction q) - Real.sqrt τ) |
| 45 | have hdc : Continuous d := continuous_const.mul |
| 46 | ((Real.continuous_sqrt.comp (continuous_const.sub htimec)).sub continuous_const) |
| 47 | let O := {q | auxiliarySpacetimeEDist G.spacetime q0 q < ENNReal.ofReal (ε / 2)} ∩ |
| 48 | {q | d q < ε / 2} |
| 49 | have hO : IsOpen O := |
| 50 | (isOpen_lt (auxiliarySpacetimeEDist_continuous G.spacetime q0) continuous_const).inter |
| 51 | (isOpen_lt hdc continuous_const) |
| 52 | have hq0 : q0 ∈ O := by |
| 53 | constructor |
| 54 | · change auxiliarySpacetimeEDist G.spacetime q0 q0 < ENNReal.ofReal (ε / 2) |
| 55 | rw [auxiliarySpacetimeEDist_self] |
| 56 | exact ENNReal.ofReal_pos.mpr (half_pos hε) |
| 57 | · change C * (Real.sqrt (T - G.spacetime.timeFunction q0) - Real.sqrt τ) < ε / 2 |
| 58 | rw [htime, sub_sub_cancel, sub_self, mul_zero] |
| 59 | exact half_pos hε |
| 60 | refine ⟨O, hO, hq0, ?_⟩ |
| 61 | intro q hq p R henergy hτb |
| 62 | let b := T - G.spacetime.timeFunction q |
| 63 | have hb : 0 < b := hτ.trans hτb |
| 64 | have hτr : Real.sqrt τ ∈ M14SqrtParameterInterval 0 b := by |
| 65 | exact ⟨by simpa only [Real.sqrt_zero] using Real.sqrt_nonneg τ, |
| 66 | Real.sqrt_le_sqrt hτb.le⟩ |
| 67 | have hbr : Real.sqrt b ∈ M14SqrtParameterInterval 0 b := by |
| 68 | exact ⟨by simpa only [Real.sqrt_zero] using Real.sqrt_nonneg b, le_rfl⟩ |
| 69 | have hRτ : R.curve (Real.sqrt τ) = p.curve τ := by |
| 70 | simpa only [Real.sq_sqrt hτ.le] using R.agrees (Real.sqrt τ) hτr |
| 71 | have hRb : R.curve (Real.sqrt b) = q := by |
| 72 | simpa only [Real.sq_sqrt hb.le] using |
| 73 | (R.agrees (Real.sqrt b) hbr).trans |
| 74 | (by simpa only [Real.sq_sqrt hb.le] using p.curve_end) |
| 75 | have htail := auxiliarySpacetimeEDist_squareRoot_le R hτr.1 le_rfl |
| 76 | (Real.sqrt_le_sqrt hτb.le) hC (fun s hs => henergy s |
| 77 | ⟨hτr.1.trans hs.1.le, hs.2.le⟩) |
| 78 | rw [hRτ, hRb, auxiliarySpacetimeEDist_comm] at htail |
| 79 | apply hεU |
| 80 | calc |
| 81 | auxiliarySpacetimeEDist G.spacetime q0 (p.curve τ) ≤ |
| 82 | auxiliarySpacetimeEDist G.spacetime q0 q + |
| 83 | auxiliarySpacetimeEDist G.spacetime q (p.curve τ) := |
| 84 | auxiliarySpacetimeEDist_triangle G.spacetime q0 q (p.curve τ) |
| 85 | _ ≤ auxiliarySpacetimeEDist G.spacetime q0 q + ENNReal.ofReal (d q) := |
| 86 | add_le_add le_rfl htail |
| 87 | _ < ENNReal.ofReal (ε / 2) + ENNReal.ofReal (ε / 2) := |
| 88 | ENNReal.add_lt_add hq.1 ((ENNReal.ofReal_lt_ofReal_iff (half_pos hε)).mpr hq.2) |
| 89 | _ = ENNReal.ofReal ε := by |
| 90 | rw [← ENNReal.ofReal_add (half_pos hε).le (half_pos hε).le] |
| 91 | congr 1 |
| 92 | ring |
| 93 | |
| 94 | end PoincareMT.M14 |