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.CanonicalInduction.Terminal.Germs.TerminalGermsInteriorFlow |
| 2 | import PoincareLib.Geometry.RicciFlow.Compactness.GeometricLimit.Overlap.LocalFlows |
| 3 | |
| 4 | /-! |
| 5 | # Actual closed Ricci flow on each extracted coordinate piece |
| 6 | |
| 7 | Interior mixed jets produce the Ricci equation. The metric-derived |
| 8 | continuity theorem then includes both endpoints, using the produced |
| 9 | interior flow's own connection on the literal limiting metric. |
| 10 | Source: MT Proposition 5.14, pp. 90-91; |
| 11 | derivations/terminal-germs-closed-jets.md, Stage A5i. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set Filter Poincare.Gluing |
| 18 | open scoped Manifold ContDiff Topology |
| 19 | |
| 20 | namespace PoincareMT.M47 |
| 21 | |
| 22 | /-- One chart's actual source flows and interior coefficient jets |
| 23 | construct its Ricci flow on the included local interval. -/ |
| 24 | theorem terminalGerms_exists_closed_chart_flow |
| 25 | {ι : Type*} {n : ℕ} |
| 26 | (U : ι → Set (EuclideanSpace ℝ (Fin n))) (hU : ∀ i, IsOpen (U i)) |
| 27 | [∀ i, Nonempty (Piece U i)] |
| 28 | {M : ℕ → Type*} [∀ k, TopologicalSpace (M k)] |
| 29 | [∀ k, ChartedSpace (EuclideanSpace ℝ (Fin n)) (M k)] |
| 30 | [∀ k, IsManifold (𝓡 n) ∞ (M k)] |
| 31 | {a : ℝ} (ha : a < 0) (Fseq : ∀ k, RicciFlow n (M k) (Icc a 0)) |
| 32 | (i : ι) (e : ∀ k, Piece U i → M k) |
| 33 | (he : letI := (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 34 | ∀ k, IsLocalDiffeomorph (𝓡 n) (𝓡 n) ∞ (e k)) |
| 35 | (g : ℝ → CanonicalMetric U hU i) |
| 36 | (hg : letI := (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 37 | letI := (hU i).isOpenEmbedding_subtypeVal.isManifold_singleton (I := 𝓡 n) (n := ∞) |
| 38 | RiemannianMetric.IsSmoothFamilyOn g (Icc a 0)) |
| 39 | (B : ℝ × EuclideanSpace ℝ (Fin n) → |
| 40 | EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) |
| 41 | (hcoeff : letI := (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 42 | letI := (hU i).isOpenEmbedding_subtypeVal.isManifold_singleton (I := 𝓡 n) (n := ∞) |
| 43 | ∀ t ∈ Icc a 0, ∀ (x : Piece U i) v w, (g t).inner x v w = B (t, x) v w) |
| 44 | (hjet : ∀ m K, IsCompact K → K ⊆ Ioo a 0 ×ˢ U i → TendstoUniformlyOn |
| 45 | (fun k => iteratedFDeriv ℝ m (fun p : ℝ × EuclideanSpace ℝ (Fin n) => |
| 46 | ((Fseq k).metric p.1).pullbackCoefficients |
| 47 | (ChartDistance.chartParametrization U hU (e k)) p.2)) |
| 48 | (iteratedFDeriv ℝ m B) atTop K) : |
| 49 | letI := (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 50 | letI := (hU i).isOpenEmbedding_subtypeVal.isManifold_singleton (I := 𝓡 n) (n := ∞) |
| 51 | ∃ F : RicciFlow n (Piece U i) (Icc a 0), F.metric = g := by |
| 52 | let := (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 53 | let := (hU i).isOpenEmbedding_subtypeVal.isManifold_singleton (I := 𝓡 n) (n := ∞) |
| 54 | have hnontrivial : (Ioo a 0).Nontrivial := by |
| 55 | obtain ⟨x, hax, hx⟩ := exists_between ha |
| 56 | obtain ⟨y, hxy, hy⟩ := exists_between hx |
| 57 | exact ⟨x, ⟨hax, hx⟩, y, ⟨hax.trans hxy, hy⟩, hxy.ne⟩ |
| 58 | let Fopen : ∀ k, RicciFlow n (M k) (Ioo a 0) := fun k => { |
| 59 | metric := (Fseq k).metric |
| 60 | connection := (Fseq k).connection |
| 61 | interval := ordConnected_Ioo |
| 62 | nontrivial := hnontrivial |
| 63 | smooth := (Fseq k).smooth.mono (prod_mono Ioo_subset_Icc_self subset_rfl) |
| 64 | equation := fun t ht x v w => |
| 65 | ((Fseq k).equation t (Ioo_subset_Icc_self ht) x v w).mono Ioo_subset_Icc_self } |
| 66 | obtain ⟨Fminus, hmetric⟩ := ChartDistance.exists_ricciFlow_on_coordinate_limit U hU |
| 67 | isOpen_Ioo Fopen i e he g |
| 68 | (hg.mono (prod_mono Ioo_subset_Icc_self subset_rfl)) B |
| 69 | (fun t ht => hcoeff t (Ioo_subset_Icc_self ht)) hjet |
| 70 | subst g |
| 71 | apply terminalGerms_exists_flow_of_interior Fminus.metric Fminus.connection hg |
| 72 | ordConnected_Icc |
| 73 | (show (Icc a 0).Nontrivial from |
| 74 | ⟨a, ⟨le_rfl, ha.le⟩, 0, ⟨ha.le, le_rfl⟩, ha.ne⟩) |
| 75 | intro t ht x v w |
| 76 | have ht' : t ∈ Ioo a 0 := by simpa only [interior_Icc] using ht |
| 77 | exact (Fminus.equation t ht' x v w).hasDerivAt (isOpen_Ioo.mem_nhds ht') |
| 78 | |
| 79 | end PoincareMT.M47 |