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.Variation.Coordinates.GaugeClockNeighborhood |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Calculus.ODE.Extension.ClosedLeftNeighborhood |
| 3 | |
| 4 | /-! |
| 5 | # Positive closed square-time windows in actual gauges |
| 6 | |
| 7 | Morgan-Tian Definition 3.38 and Lemma 6.18, pp. 61, 113-114. |
| 8 | Admissible square times have closed prefixes. Relative physical |
| 9 | gauge neighborhoods contain closed windows with a strict positive |
| 10 | left margin, including at a physical earliest-time endpoint. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set Filter |
| 16 | open scoped Topology |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.M14 |
| 21 | |
| 22 | /-- Every nonnegative prefix of an admissible square time is |
| 23 | physically admissible, by order-connectedness of the physical clock |
| 24 | interval, Definition 6.17 and Lemma 6.18, pp. 113-114. -/ |
| 25 | theorem squareClock_admissible_prefix {I : SpacetimeInterval} {T b : ℝ} |
| 26 | (hT : T ∈ I.domain) (hb : 0 ≤ b) (hclock : T - b ^ 2 ∈ I.domain) : |
| 27 | ∀ s ∈ Icc 0 b, T - s ^ 2 ∈ I.domain := by |
| 28 | intro s hs |
| 29 | have hsq : s ^ 2 ≤ b ^ 2 := (sq_le_sq₀ hs.1 hb).mpr hs.2 |
| 30 | exact I.ordConnected.out hclock hT ⟨by linarith, sub_le_self _ (sq_nonneg s)⟩ |
| 31 | |
| 32 | /-- At a positive admissible square time there is an admissible |
| 33 | closed prefix containing a relative physical neighborhood. It may |
| 34 | end at that time when the physical clock has no earlier value, |
| 35 | Definition 6.17 and Lemma 6.18, pp. 113-114. -/ |
| 36 | theorem exists_squareClock_prefix_neighborhood {I : SpacetimeInterval} {T s : ℝ} |
| 37 | (hT : T ∈ I.domain) (hs : 0 < s) (hclock : T - s ^ 2 ∈ I.domain) : |
| 38 | ∃ b : ℝ, s ≤ b ∧ (∀ r ∈ Icc 0 b, T - r ^ 2 ∈ I.domain) ∧ |
| 39 | Icc 0 b ∈ 𝓝[{r | 0 ≤ r ∧ T - r ^ 2 ∈ I.domain}] s := by |
| 40 | by_cases hnext : ∃ b : ℝ, 0 ≤ b ∧ T - b ^ 2 ∈ I.domain ∧ s < b |
| 41 | · obtain ⟨b, hb, htime, hsb⟩ := hnext |
| 42 | exact ⟨b, hsb.le, squareClock_admissible_prefix hT hb htime, |
| 43 | mem_nhdsWithin_of_mem_nhds (Icc_mem_nhds hs hsb)⟩ |
| 44 | · refine ⟨s, le_rfl, squareClock_admissible_prefix hT hs.le hclock, ?_⟩ |
| 45 | filter_upwards [self_mem_nhdsWithin] with r hr |
| 46 | exact ⟨hr.1, le_of_not_gt (fun hsr => hnext ⟨r, hr.1, hr.2, hsr⟩)⟩ |
| 47 | |
| 48 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 49 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 50 | |
| 51 | /-- Every gauge through a positive admissible square time has a |
| 52 | positive closed clock window with a strict left margin, containing |
| 53 | a relative neighborhood in the full physical admissible set. |
| 54 | This includes a physical earliest-time endpoint, Lemma 6.18, |
| 55 | pp. 113-114. -/ |
| 56 | theorem exists_gauge_positive_squareClock_window (b : G.gaugeCover.index) |
| 57 | (t₀ : (G.timeIntervals.interval (G.gaugeCover.interval b)).Point) |
| 58 | (x₀ : G.gaugeCover.spatial b) {T s : ℝ} (hT : T ∈ I.domain) (hs : 0 < s) |
| 59 | (hclock : T - s ^ 2 = t₀.val) : |
| 60 | ∃ a c : ℝ, 0 < a ∧ a < s ∧ s ≤ c ∧ |
| 61 | (∀ r ∈ Icc a c, T - r ^ 2 ∈ (G.gaugeCover.interval b).domain) ∧ |
| 62 | Icc a c ∈ 𝓝[{r | 0 ≤ r ∧ T - r ^ 2 ∈ I.domain}] s := by |
| 63 | have hphysical : T - s ^ 2 ∈ I.domain := |
| 64 | hclock ▸ (G.gaugeCover.cylinder b).interval_subset t₀.property |
| 65 | obtain ⟨m, hsm, htime, hnear⟩ := exists_squareClock_prefix_neighborhood hT hs hphysical |
| 66 | have hlocal := gauge_squareClock_mem_nhdsWithin b t₀ x₀ hclock htime |
| 67 | obtain ⟨a, c, ha, has, hsc, _, hsub, hC⟩ := exists_closed_left_neighborhood hs hsm hlocal |
| 68 | exact ⟨a, c, ha, has, hsc, fun r hr => hsub hr, nhdsWithin_le_of_mem hnear hC⟩ |
| 69 | |
| 70 | end PoincareMT.M14 |