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.Surgery.StandardCap.Existence.Geometry.Flow.FlowLocality |
| 2 | |
| 3 | /-! |
| 4 | # Union of compatible forward Ricci flows |
| 5 | |
| 6 | Choose total representatives from a covering family, and use their metric |
| 7 | agreement on overlaps to prove local smoothness and the equation. This |
| 8 | is the bounded-supremum union step of Morgan-Tian Theorem 12.5, p. 297; |
| 9 | see the reviewed common-compact-lifetime derivation in the task records. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open scoped Manifold ContDiff Bundle Topology |
| 15 | open Set Filter |
| 16 | |
| 17 | namespace PoincareMT.M34 |
| 18 | |
| 19 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 20 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 21 | |
| 22 | /-- Pairwise compatible forward flows covering a positive interval have |
| 23 | an actual union flow agreeing with each member (Theorem 12.5, p. 297). -/ |
| 24 | theorem exists_forwardFlowUnion {ι : Type*} (T : ι → ℝ) |
| 25 | (F : (i : ι) → RicciFlow n M (Ico 0 (T i))) (i0 : ι) |
| 26 | (hcompat : ∀ i j : ι, EqOn (F i).metric (F j).metric |
| 27 | (Ico 0 (T i) ∩ Ico 0 (T j))) |
| 28 | {S : ℝ} (hS : 0 < S) (hcover : ∀ t ∈ Ico 0 S, ∃ i : ι, t ∈ Ico 0 (T i)) : |
| 29 | ∃ G : RicciFlow n M (Ico 0 S), ∀ i : ι, |
| 30 | EqOn G.metric (F i).metric (Ico 0 S ∩ Ico 0 (T i)) := by |
| 31 | classical |
| 32 | let index : ℝ → ι := fun t => if h : ∃ i : ι, t ∈ Ico 0 (T i) then h.choose else i0 |
| 33 | have hindex {t : ℝ} (ht : t ∈ Ico 0 S) : t ∈ Ico 0 (T (index t)) := by |
| 34 | dsimp [index] |
| 35 | rw [dif_pos (hcover t ht)] |
| 36 | exact (hcover t ht).choose_spec |
| 37 | let g : ℝ → RiemannianMetric n M := fun t => (F (index t)).metric t |
| 38 | let D : (t : ℝ) → LeviCivitaData (g t) := fun t => (F (index t)).connection t |
| 39 | have hmatch (i : ι) : EqOn g (F i).metric (Ico 0 S ∩ Ico 0 (T i)) := by |
| 40 | intro t ht |
| 41 | exact hcompat (index t) i ⟨hindex ht.1, ht.2⟩ |
| 42 | have hne : (Ico 0 S).Nontrivial := by |
| 43 | refine ⟨0, ⟨le_rfl, hS⟩, S / 2, ⟨by linarith, by linarith⟩, ?_⟩ |
| 44 | linarith |
| 45 | have hloc : ∀ t ∈ Ico 0 S, ∃ K : Set ℝ, ∃ G : RicciFlow n M K, |
| 46 | t ∈ K ∧ K ∈ 𝓝[Ico 0 S] t ∧ g =ᶠ[𝓝[Ico 0 S] t] G.metric := by |
| 47 | intro t ht |
| 48 | obtain ⟨i, hi⟩ := hcover t ht |
| 49 | have hK : Ico 0 (T i) ∈ 𝓝[Ico 0 S] t := by |
| 50 | filter_upwards [self_mem_nhdsWithin, |
| 51 | mem_nhdsWithin_of_mem_nhds (Iio_mem_nhds hi.2)] with s hs hs' |
| 52 | exact ⟨hs.1, hs'⟩ |
| 53 | refine ⟨Ico 0 (T i), F i, hi, hK, ?_⟩ |
| 54 | filter_upwards [self_mem_nhdsWithin, hK] with s hs hsK |
| 55 | exact hmatch i ⟨hs, hsK⟩ |
| 56 | exact ⟨flowOfLocalRepresentatives (Ico 0 S) g D ordConnected_Ico hne hloc, hmatch⟩ |
| 57 | |
| 58 | end PoincareMT.M34 |