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.Topology.Manifold.Poincare.Final.Compatibility.SourceNames |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Terminal.Regular.TerminalRegularStageFamily |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Terminal.Source.TerminalSourceCountableAtlas |
| 4 | |
| 5 | /-! |
| 6 | # The actual complete atlas of the regular source family |
| 7 | |
| 8 | The produced ordinary sources and finite physical charts supply every |
| 9 | geometric and analytic field of the countable extraction. Both terminal |
| 10 | and negative-time jets survive on the same complete terminal quotient. |
| 11 | MT Theorem 5.11; terminal-regular-countable-atlas.md, G3. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set Filter TopologicalSpace Poincare.Gluing |
| 18 | open scoped Manifold ContDiff Topology NNReal |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.M47 |
| 23 | |
| 24 | local notation "E" => EuclideanSpace ℝ (Fin 3) |
| 25 | local notation "Bilin" => E →L[ℝ] E →L[ℝ] ℝ |
| 26 | |
| 27 | section Family |
| 28 | |
| 29 | variable (S : RepairedControlledSchedulesData.{u}) |
| 30 | (B : M47ComponentAnalyticBounds.{u} S.setup.C) (p : SurgeryParameterPrefix S.constants) |
| 31 | (F : ℕ → SurgeryFlowData.{u}) (O : ∀ k, SurgeryObservation (F k)) |
| 32 | (W : ∀ k, M33RegularHistoryWindow (F k)) (H : ∀ k, M33RegularHistoryData (W k)) |
| 33 | (base Q r A tau0 tau K L R rho : ℕ → ℝ) (N : ℕ → ℕ) |
| 34 | (center : ∀ k, ((F k).slice (base k)).carrier) |
| 35 | (data : ∀ k j, j ≤ k → TerminalRegularStageData S B p (O k) (H k) |
| 36 | (base k) (Q k) (r k) (A j) (tau0 j) (tau j) (K j) (L j) |
| 37 | ((j : ℝ) + 1) (R j) (rho j) (N j) (center k)) |
| 38 | (hrho : ∀ j, 0 < rho j) |
| 39 | |
| 40 | local notation "M" => (fun k : ℕ => Poincare.connectedComponentOpens E (center k)) |
| 41 | local notation "gPhysical" => (fun k : ℕ => |
| 42 | M13.scaleSmoothMetric (SurgeryFlowData.metric (F k) (base k)) (Q k) |
| 43 | (SurgeryFlowCylinder.scale_pos (TerminalRegularStageData.original (data k 0 (Nat.zero_le k))))) |
| 44 | local notation "g" => (fun k : ℕ => |
| 45 | RiemannianMetric.connectedComponentMetric (gPhysical k) (center k)) |
| 46 | local notation "e" => (fun (k j : ℕ) (hjk : j ≤ k) => TerminalRegularStageData.maps (data k j hjk)) |
| 47 | local notation "point" => (fun k : ℕ => (Subtype.mk (center k) mem_connectedComponent : M k)) |
| 48 | local notation "src" => (fun (j : ℕ) (a : {k : ℕ // j ≤ k}) => |
| 49 | terminalRegularStageSource (F (Subtype.val a)) (base (Subtype.val a)) (Q (Subtype.val a)) |
| 50 | (A j) (center (Subtype.val a))) |
| 51 | local notation "flow" => (fun (j : ℕ) (a : {k : ℕ // j ≤ k}) => |
| 52 | TerminalRegularStageData.flow (data (Subtype.val a) j (Subtype.property a))) |
| 53 | local notation "chart" => (fun (j : ℕ) (a : {k : ℕ // j ≤ k}) => |
| 54 | TerminalSourceIndexedChartCover.chart |
| 55 | (TerminalRegularStageData.cover (data (Subtype.val a) j (Subtype.property a)))) |
| 56 | |
| 57 | private def RegularCountableAtlasOutput : Prop := |
| 58 | letI : ∀ k, MetricSpace (M k) := |
| 59 | fun k => terminalSourceComponentMetricSpace (gPhysical k) (center k) |
| 60 | let label := terminalSourceCountableLabel N |
| 61 | let U := fun n => terminalSourceCountableDomain (rho (label n).1) |
| 62 | letI : ∀ n, Nonempty (U n) := fun n => ⟨terminalSourceCountableZero (hrho (label n).1)⟩ |
| 63 | let total := fun k n => terminalSourceCountableMap hrho e k (label n).1 (label n).2 |
| 64 | let f0 := fun n k => (g k).pullbackCoefficients |
| 65 | (ChartDistance.chartParametrization (fun n => (U n : Set E)) (fun n => (U n).isOpen) |
| 66 | (total k n)) |
| 67 | let fminus := fun n => terminalSourceCountableNegative (label n).1 |
| 68 | (fun a => (src (label n).1 a : Type u)) (flow (label n).1) |
| 69 | (fun a => chart (label n).1 a (label n).2) (f0 n) |
| 70 | ∃ sigma : ℕ → ℕ, StrictMono sigma ∧ |
| 71 | (∀ n, ∀ᶠ k in atTop, ∃ hjk : (label n).1 ≤ sigma k, |
| 72 | total (sigma k) n = e (sigma k) (label n).1 hjk (label n).2 ∧ |
| 73 | fminus n (sigma k) = fun z : ℝ × E => |
| 74 | ((flow (label n).1 ⟨sigma k, hjk⟩).metric z.1).pullbackCoefficients |
| 75 | (chart (label n).1 ⟨sigma k, hjk⟩ (label n).2).chart z.2) ∧ |
| 76 | ∃ B0 : ℕ → E → Bilin, |
| 77 | (∀ n, ContDiffOn ℝ ∞ (B0 n) (U n)) ∧ |
| 78 | (∀ n m C, IsCompact C → C ⊆ U n → TendstoUniformlyOn |
| 79 | (fun k => iteratedFDeriv ℝ m (f0 n (sigma k))) |
| 80 | (iteratedFDeriv ℝ m (B0 n)) atTop C) ∧ |
| 81 | ∃ Bminus : ℕ → ℝ × E → Bilin, |
| 82 | (∀ n, ContDiffOn ℝ ∞ (Bminus n) |
| 83 | (Ioo (-(tau (label n).1 / 2)) 0 ×ˢ (U n : Set E))) ∧ |
| 84 | (∀ n m C, IsCompact C → |
| 85 | C ⊆ Ioo (-(tau (label n).1 / 2)) 0 ×ˢ (U n : Set E) → TendstoUniformlyOn |
| 86 | (fun k => iteratedFDeriv ℝ m (fminus n (sigma k))) |
| 87 | (iteratedFDeriv ℝ m (Bminus n)) atTop C) ∧ |
| 88 | ∃ D : ∀ n n', C(U n × U n', ℝ), |
| 89 | ∃ hD : ∀ n n', TendstoLocallyUniformly |
| 90 | (fun k z => dist (total (sigma k) n z.1) (total (sigma k) n' z.2)) (D n n') atTop, |
| 91 | let selected := fun k n => total (sigma k) n |
| 92 | let c := fun n => terminalSourceCountableScaleFactor (rho 0) (rho (label n).1) / 2 |
| 93 | ∃ he : ∀ k n, LipschitzWith (3 / 2 : ℝ≥0) (selected k n), |
| 94 | ∃ hc : ∀ n, 0 < c n, |
| 95 | ∃ hlower : ∀ k n x y, c n * dist x y ≤ dist (selected k n x) (selected k n y), |
| 96 | ∃ ho : ∀ k n, Topology.IsOpenEmbedding (selected k n), |
| 97 | ∃ hconn : ∀ k (x : M (sigma k)) s, IsPreconnected (Metric.ball x s), |
| 98 | (∀ k, selected k 0 (terminalSourceCountableZero (hrho (label 0).1)) = point (sigma k)) ∧ |
| 99 | TerminalSourceCountableAtlasResult (fun n => (U n : Set E)) (fun n => (U n).isOpen) |
| 100 | (fun k => g (sigma k)) selected D hD (fun _ => (3 / 2 : ℝ≥0)) |
| 101 | he c hc hlower ho hconn B0 (terminalSourceCountableZero (hrho (label 0).1)) |
| 102 | |
| 103 | /-- The actual produced stage family constructs one shared extraction, |
| 104 | all retained mixed jets, and the complete original terminal atlas. -/ |
| 105 | theorem terminalSource_regular_countable_atlas |
| 106 | (P : M46Predecessors.{u}) (htau : ∀ j, 0 < tau j) |
| 107 | (hrhoR : ∀ j, 2 * rho j < R j) |
| 108 | (hsmall : ∀ j s, |s| ≤ 2 * rho j → |
| 109 | ((13 * max (4 * L j / 3) 1) * s ^ 2) * |
| 110 | Real.exp (max 1 ((13 * max (4 * L j / 3) 1) * s ^ 2)) ≤ 3) : |
| 111 | RegularCountableAtlasOutput S B p F O W H base Q r A tau0 tau K L R rho N center data hrho := by |
| 112 | classical |
| 113 | let : ∀ k, MetricSpace (M k) := |
| 114 | fun k => terminalSourceComponentMetricSpace (gPhysical k) (center k) |
| 115 | let cyl := fun (j : ℕ) (a : {k : ℕ // j ≤ k}) => (data a.val j a.property).cylinder |
| 116 | have hGood (j : ℕ) (i : Fin (N j + 1)) : |
| 117 | ∀ᶠ a in Filter.comap (Subtype.val : {k : ℕ // j ≤ k} → ℕ) atTop, |
| 118 | TerminalSourceJetsG4Good S B p (O a.val) (H a.val) (src j a) (cyl j a) (flow j a) |
| 119 | (rNext := r a.val) (L := L j) (eta := 1) (chart j a i) := |
| 120 | Filter.Eventually.of_forall (fun a => (data a.val j a.property).good i) |
| 121 | have hopen := fun k j hjk i => ((data k j hjk).geometry i).1 |
| 122 | have hsmooth := fun k j hjk i => ((data k j hjk).geometry i).2 |
| 123 | have hdist := fun k j hjk => (data k j hjk).distances |
| 124 | have hzero (k : ℕ) : e k 0 (Nat.zero_le k) 0 (terminalSourceCountableZero (hrho 0)) = point k := |
| 125 | (data k 0 (Nat.zero_le k)).zero |
| 126 | have hbase := fun k j hjk => (data k j hjk).based_distances |
| 127 | have hmetric := fun k j hjk => (data k j hjk).map_metric |
| 128 | obtain ⟨sigma, hsigma, hlate, B0, hB0, hBjets, Bminus, hBminus, hNegative, D, hD⟩ := |
| 129 | terminalSourceCountable_extract_actual_charts S B p P g rho tau R L (fun _ => 1) N |
| 130 | hrho htau hrhoR hsmall |
| 131 | (fun _ a => F a.val) (fun _ a => O a.val) (fun _ a => W a.val) (fun _ a => H a.val) |
| 132 | (fun _ a => (F a.val).slice (base a.val)) |
| 133 | (fun _ a => base a.val) (fun _ a => Q a.val) (fun _ a => r a.val) |
| 134 | src cyl flow chart hGood e hopen hsmooth hdist point (fun j => (j : ℝ) + 1 + R j) |
| 135 | hzero hbase hmetric |
| 136 | have hactual (k : ℕ) (x y : M k) : edist x y = (g k).edist x y := rfl |
| 137 | have hconn (k : ℕ) (x : M k) (s : ℝ) : IsPreconnected (Metric.ball x s) := |
| 138 | (terminalSourceComponent_balls (gPhysical k) (center k) x s).2.2 |
| 139 | have hcofinal (s : ℝ) (_hs : 0 < s) : ∃ j : ℕ, s ≤ (j : ℝ) + 1 := by |
| 140 | obtain ⟨j, hj⟩ := exists_nat_gt s |
| 141 | exact ⟨j, by linarith⟩ |
| 142 | have hcover (k j : ℕ) (hjk : j ≤ k) : |
| 143 | Metric.ball (point k) ((j : ℝ) + 1) ⊆ |
| 144 | ⋃ i, e k j hjk i '' terminalSourceCountableCore (rho j) := by |
| 145 | obtain ⟨core, _hcore, hcoreEq, hcover⟩ := (data k j hjk).cores |
| 146 | have hcore : core = terminalSourceCountableCore (rho j) := Set.ext hcoreEq |
| 147 | rwa [hcore] at hcover |
| 148 | obtain ⟨he, hc, hlower, ho, hpoint, hatlas⟩ := |
| 149 | terminalSourceCountable_complete_atlas S B p P g hactual hconn rho tau R L (fun _ => 1) N |
| 150 | hrho htau hrhoR hsmall |
| 151 | (fun _ a => F a.val) (fun _ a => O a.val) (fun _ a => W a.val) (fun _ a => H a.val) |
| 152 | (fun _ a => (F a.val).slice (base a.val)) |
| 153 | (fun _ a => base a.val) (fun _ a => Q a.val) (fun _ a => r a.val) |
| 154 | src cyl flow chart hGood e hopen hsmooth hdist point hzero |
| 155 | (fun j => (j : ℝ) + 1) hcofinal hcover hmetric hsigma B0 hB0 hBjets D hD |
| 156 | exact ⟨sigma, hsigma, hlate, B0, hB0, hBjets, Bminus, hBminus, hNegative, D, hD, |
| 157 | he, hc, hlower, ho, (fun k => hconn (sigma k)), hpoint, hatlas⟩ |
| 158 | |
| 159 | end Family |
| 160 | |
| 161 | end PoincareMT.M47 |