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.Compactness.Pointed |
| 2 | import PoincareLib.Geometry.RicciFlow.Compactness.Convergence |
| 3 | import PoincareLib.Geometry.RicciFlow.Harnack.Regularity |
| 4 | |
| 5 | /-! Finite-window based flows retain the exact metric and connection |
| 6 | representatives of a source Ricci flow on a larger time domain. -/ |
| 7 | |
| 8 | set_option autoImplicit false |
| 9 | |
| 10 | open Set |
| 11 | open scoped Manifold ContDiff Topology |
| 12 | |
| 13 | namespace PoincareMT |
| 14 | |
| 15 | /-- A compact subset of an ancient time interval lies in a bounded interior |
| 16 | window which also contains the base time zero. -/ |
| 17 | theorem exists_ancient_window_of_isCompact {T : ℝ} (hT : 0 < T) |
| 18 | {K : Set ℝ} (hK : IsCompact K) (hKT : K ⊆ Iio T) : |
| 19 | ∃ a b : ℝ, a < 0 ∧ 0 < b ∧ b < T ∧ K ⊆ Ioo a b := by |
| 20 | obtain ⟨l, hl⟩ := (hK.insert 0).exists_isLeast (insert_nonempty 0 K) |
| 21 | obtain ⟨u, hu⟩ := (hK.insert 0).exists_isGreatest (insert_nonempty 0 K) |
| 22 | have hl0 : l ≤ 0 := hl.2 (mem_insert 0 K) |
| 23 | have hu0 : 0 ≤ u := hu.2 (mem_insert 0 K) |
| 24 | have huT : u < T := by |
| 25 | rcases hu.1 with rfl | huK |
| 26 | · exact hT |
| 27 | · exact hKT huK |
| 28 | refine ⟨l - 1, (u + T) / 2, by linarith, by linarith, by linarith, ?_⟩ |
| 29 | intro t ht |
| 30 | have hlt := hl.2 (mem_insert_of_mem 0 ht) |
| 31 | have htu := hu.2 (mem_insert_of_mem 0 ht) |
| 32 | constructor <;> linarith |
| 33 | |
| 34 | /-- Eventual inclusion of a closed time window gives a source tail defined |
| 35 | on its open interior. -/ |
| 36 | theorem exists_source_window_tail {J : ℕ → Set ℝ} {a b : ℝ} |
| 37 | (h : ∀ᶠ k in Filter.atTop, Icc a b ⊆ J k) : |
| 38 | ∃ N : ℕ, ∀ k, Ioo a b ⊆ J (k + N) := by |
| 39 | obtain ⟨N, hN⟩ := Filter.eventually_atTop.mp h |
| 40 | exact ⟨N, fun k ↦ Ioo_subset_Icc_self.trans (hN (k + N) (by omega))⟩ |
| 41 | |
| 42 | /-- View a time restriction as a based flow using its canonical volume and |
| 43 | ordinary product spacetime vector field. -/ |
| 44 | noncomputable def FlowCarrier.basedWindow {n : ℕ} (C : FlowCarrier n) |
| 45 | {J : Set ℝ} {a b : ℝ} |
| 46 | (F : @RicciFlow n C.carrier C.topologicalSpace C.chartedSpace C.isManifold J) |
| 47 | (p : C.carrier) (hsub : Ioo a b ⊆ J) (hab : a < b) : BasedFlow n a b C := by |
| 48 | letI := C.topologicalSpace |
| 49 | letI := C.chartedSpace |
| 50 | letI := C.isManifold |
| 51 | exact { |
| 52 | base := p |
| 53 | flow := Poincare.Geometry.RicciFlow.Harnack.restrictFlow F hsub ordConnected_Ioo (by |
| 54 | refine ⟨(2 * a + b) / 3, ⟨?_, ?_⟩, (a + 2 * b) / 3, ⟨?_, ?_⟩, ?_⟩ <;> linarith) |
| 55 | volumeMeasure := C.metricHausdorffVolume (F.metric 0) |
| 56 | spacetimeVectorField := fun _ _ ↦ (1, 0) |
| 57 | spacetimeVectorField_time := fun _ _ ↦ rfl |
| 58 | spacetimeVectorField_spatial_zero := fun _ _ ↦ rfl } |
| 59 | |
| 60 | /-- Restrict a tail of expanding-domain source flows to a common finite |
| 61 | interval, retaining their source carriers and points. -/ |
| 62 | noncomputable def sourceWindowSequence {n : ℕ} (C : ℕ → FlowCarrier n) |
| 63 | {J : ℕ → Set ℝ} {a b : ℝ} |
| 64 | (F : ∀ k, @RicciFlow n (C k).carrier (C k).topologicalSpace |
| 65 | (C k).chartedSpace (C k).isManifold (J k)) |
| 66 | (p : ∀ k, (C k).carrier) (N : ℕ) |
| 67 | (hsub : ∀ k, Ioo a b ⊆ J (k + N)) (hab : a < b) : |
| 68 | PointedFlowSequence n a b where |
| 69 | carrier := fun k ↦ C (k + N) |
| 70 | flow := fun k ↦ (C (k + N)).basedWindow (F (k + N)) (p (k + N)) (hsub k) hab |
| 71 | |
| 72 | end PoincareMT |