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.Exponential |
| 2 | import Mathlib.Analysis.SpecialFunctions.Pow.Real |
| 3 | |
| 4 | /-! |
| 5 | # The positive backward square clock on spacetime |
| 6 | |
| 7 | The inverse time coordinate is the actual sqrt(T-time) and is smooth |
| 8 | where time is strictly before T. Relative physical square-time |
| 9 | neighborhoods pull back to open spacetime neighborhoods. This retains |
| 10 | included physical endpoints in Proposition 6.28, p. 117. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set Filter |
| 16 | open scoped Manifold ContDiff Topology |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.M14 |
| 21 | |
| 22 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 23 | {I : SpacetimeInterval} (G : GeneralizedLGeometryTransport n X time I) (T : ℝ) |
| 24 | |
| 25 | /-- The actual inverse of the positive backward square-time clock, |
| 26 | Proposition 6.28, p. 117. Values at or after T are only totalizations. -/ |
| 27 | noncomputable def backwardSquareClock (q : G.Point) : ℝ := |
| 28 | Real.sqrt (T - G.spacetime.timeFunction q) |
| 29 | |
| 30 | /-- The actual backward square clock is continuous everywhere, |
| 31 | Proposition 6.28, p. 117. -/ |
| 32 | theorem backwardSquareClock_continuous : Continuous (backwardSquareClock G T) := by |
| 33 | have ht : ContMDiff (spacetimeModel n) (𝓘(ℝ, ℝ)) ∞ G.spacetime.timeFunction := |
| 34 | G.spacetime.time_smooth |
| 35 | exact Real.continuous_sqrt.comp (continuous_const.sub ht.continuous) |
| 36 | |
| 37 | /-- The actual backward square clock is smooth strictly before T, |
| 38 | including included physical boundary points, Proposition 6.28, p. 117. -/ |
| 39 | theorem backwardSquareClock_contMDiffOn : |
| 40 | ContMDiffOn (spacetimeModel n) (𝓘(ℝ, ℝ)) ∞ (backwardSquareClock G T) |
| 41 | {q | G.spacetime.timeFunction q < T} := by |
| 42 | intro q hq |
| 43 | have ht : ContMDiff (spacetimeModel n) (𝓘(ℝ, ℝ)) ∞ G.spacetime.timeFunction := |
| 44 | G.spacetime.time_smooth |
| 45 | exact ((Real.contDiffAt_sqrt (ne_of_gt (sub_pos.mpr hq))).contMDiffAt.comp q |
| 46 | ((contMDiff_const.sub ht).contMDiffAt)).contMDiffWithinAt |
| 47 | |
| 48 | /-- Before T, the inverse square clock is physically admissible and |
| 49 | recovers the actual spacetime time, Proposition 6.28, p. 117. -/ |
| 50 | theorem backwardSquareClock_admissible {q : G.Point} |
| 51 | (hq : G.spacetime.timeFunction q ≤ T) : |
| 52 | 0 ≤ backwardSquareClock G T q ∧ |
| 53 | T - backwardSquareClock G T q ^ 2 = G.spacetime.timeFunction q ∧ |
| 54 | T - backwardSquareClock G T q ^ 2 ∈ I.domain := by |
| 55 | have heq : T - backwardSquareClock G T q ^ 2 = G.spacetime.timeFunction q := by |
| 56 | rw [backwardSquareClock, Real.sq_sqrt (sub_nonneg.mpr hq), sub_sub_cancel] |
| 57 | refine ⟨Real.sqrt_nonneg _, heq, ?_⟩ |
| 58 | rw [heq, ← G.spacetime.time_range] |
| 59 | exact ⟨q, rfl⟩ |
| 60 | |
| 61 | /-- The selected exponential clock is inverted exactly on its actual |
| 62 | survival domain, Proposition 6.28, p. 117. -/ |
| 63 | theorem backwardSquareClock_exponential {x : G.Point} |
| 64 | (E : M14ExponentialFamily G T x) {Z : G.Horizontal x} {s : ℝ} |
| 65 | (hs : (Z, s) ∈ E.domain) : backwardSquareClock G T (E.gamma Z s) = s := by |
| 66 | rw [backwardSquareClock, E.clock Z s hs, sub_sub_cancel, |
| 67 | Real.sqrt_sq (E.domain_admissible hs).1] |
| 68 | |
| 69 | /-- A relative neighborhood of a positive physical square time |
| 70 | contains all inverse clocks on an open spacetime neighborhood of |
| 71 | the endpoint, Proposition 6.28, p. 117. -/ |
| 72 | theorem exists_backwardSquareClock_neighborhood {x : G.Point} |
| 73 | (E : M14ExponentialFamily G T x) {Z : G.Horizontal x} {s : ℝ} |
| 74 | (hs : (Z, s) ∈ E.domain) (hpos : 0 < s) {C : Set ℝ} |
| 75 | (hC : C ∈ 𝓝[{r | 0 ≤ r ∧ T - r ^ 2 ∈ I.domain}] s) : |
| 76 | ∃ O : Set G.Point, IsOpen O ∧ E.gamma Z s ∈ O ∧ |
| 77 | ∀ q ∈ O, G.spacetime.timeFunction q < T ∧ backwardSquareClock G T q ∈ C := by |
| 78 | have htime : G.spacetime.timeFunction (E.gamma Z s) < T := by |
| 79 | rw [E.clock Z s hs] |
| 80 | exact sub_lt_self T (sq_pos_of_pos hpos) |
| 81 | have htimesm : ContMDiff (spacetimeModel n) (𝓘(ℝ, ℝ)) ∞ G.spacetime.timeFunction := |
| 82 | G.spacetime.time_smooth |
| 83 | have hn : {q : G.Point | G.spacetime.timeFunction q < T} ∈ 𝓝 (E.gamma Z s) := |
| 84 | (isOpen_lt htimesm.continuous continuous_const).mem_nhds htime |
| 85 | have hadm : ∀ᶠ q in 𝓝 (E.gamma Z s), |
| 86 | backwardSquareClock G T q ∈ {r | 0 ≤ r ∧ T - r ^ 2 ∈ I.domain} := by |
| 87 | filter_upwards [hn] with q hq |
| 88 | exact ⟨(backwardSquareClock_admissible G T hq.le).1, |
| 89 | (backwardSquareClock_admissible G T hq.le).2.2⟩ |
| 90 | have ht : Tendsto (backwardSquareClock G T) (𝓝 (E.gamma Z s)) |
| 91 | (𝓝[{r | 0 ≤ r ∧ T - r ^ 2 ∈ I.domain}] s) := by |
| 92 | apply tendsto_nhdsWithin_iff.mpr |
| 93 | refine ⟨?_, hadm⟩ |
| 94 | have hcont : Tendsto (backwardSquareClock G T) (𝓝 (E.gamma Z s)) |
| 95 | (𝓝 (backwardSquareClock G T (E.gamma Z s))) := |
| 96 | (backwardSquareClock_continuous G T).continuousAt |
| 97 | rwa [backwardSquareClock_exponential G T E hs] at hcont |
| 98 | obtain ⟨O, hOsub, hO, hpO⟩ := mem_nhds_iff.mp (inter_mem hn (ht hC)) |
| 99 | exact ⟨O, hO, hpO, fun _ hq => hOsub hq⟩ |
| 100 | |
| 101 | end PoincareMT.M14 |