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.Splitting.MaximumPrinciple.Endpoint |
| 2 | import PoincareLib.Geometry.RicciFlow.Splitting.MaximumPrinciple.CompactBounds |
| 3 | import PoincareLib.Geometry.RicciFlow.Splitting.MaximumPrinciple.ChartChain.SeedTube |
| 4 | import PoincareLib.Geometry.RicciFlow.Splitting.MaximumPrinciple.ChartChain.ScheduledSegments |
| 5 | |
| 6 | |
| 7 | noncomputable section |
| 8 | open Set Metric Filter |
| 9 | open scoped ContDiff Manifold Topology InnerProductSpace |
| 10 | |
| 11 | namespace PoincareMT.RicciFlow.Splitting.MaximumPrinciple |
| 12 | |
| 13 | open Barrier ChartChain |
| 14 | |
| 15 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] [T2Space M] |
| 16 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 17 | |
| 18 | /-- **Math.** Compact moving bumps propagate positivity for spatial lower heat contacts. -/ |
| 19 | theorem positive_along_chart_path |
| 20 | {D : Set M} (hD : IsCompact D) (α : M) |
| 21 | (hchart : D ⊆ (chartAt (EuclideanSpace ℝ (Fin n)) α).source) |
| 22 | {g : ℝ → RiemannianMetric n M} {J : Set ℝ} |
| 23 | (conn : ∀ t, LeviCivitaData (g t)) |
| 24 | (hgmetric : RiemannianMetric.IsSmoothFamilyOn g J) (hJdiff : UniqueDiffOn ℝ J) |
| 25 | {a b : ℝ} (hab : a < b) (hJ : Icc a b ⊆ J) |
| 26 | {gamma : ℝ → EuclideanSpace ℝ (Fin n)} (hg : ContDiff ℝ ∞ gamma) |
| 27 | (hpath : ∀ t ∈ Icc a b, ∃ x ∈ interior D, extChartAt (𝓡 n) α x = gamma t) |
| 28 | {v : M → ℝ → ℝ} |
| 29 | (hv : ContinuousOn (fun z : M × ℝ => v z.1 z.2) (D ×ˢ Icc a b)) |
| 30 | (hvs : HeatLowerContacts conn (interior D) (Ioo a b) v) |
| 31 | (hinit : ∀ x ∈ D, 0 ≤ v x a) |
| 32 | (hlateral : ∀ x ∈ D, x ∉ interior D → ∀ t ∈ Icc a b, 0 ≤ v x t) |
| 33 | {p q : M} (hp : p ∈ interior D) (hq : q ∈ D) |
| 34 | (hstart : extChartAt (𝓡 n) α p = gamma a) (hend : extChartAt (𝓡 n) α q = gamma b) |
| 35 | (hpos : 0 < v p a) : 0 < v q b := by |
| 36 | have hvc : ContinuousOn (fun x => v x a) D := |
| 37 | hv.comp (continuous_id.prodMk continuous_const).continuousOn |
| 38 | (fun x hx => ⟨hx, le_rfl, hab.le⟩) |
| 39 | obtain ⟨ε, r, hε, hr, hseed⟩ := exists_initial_ball_seed (I := 𝓡 n) α hchart hvc hp hpos |
| 40 | obtain ⟨s, hs, hclear⟩ := exists_lateral_clearance (I := 𝓡 n) hD α hchart hg.continuous hpath |
| 41 | let rho := min r s |
| 42 | have hrho : 0 < rho := lt_min hr hs |
| 43 | have hsource : D ⊆ (extChartAt (𝓡 n) α).source := by |
| 44 | simpa only [extChartAt_source] using hchart |
| 45 | let K := Icc a b ×ˢ (extChartAt (𝓡 n) α '' D) |
| 46 | have hK : IsCompact K := isCompact_Icc.prod |
| 47 | (hD.image_of_continuousOn ((continuousOn_extChartAt α).mono hsource)) |
| 48 | have hKU : K ⊆ J ×ˢ (extChartAt (𝓡 n) α).target := by |
| 49 | rintro ⟨t, y⟩ ⟨ht, x, hx, rfl⟩ |
| 50 | exact ⟨hJ ht, (extChartAt (𝓡 n) α).map_source (hsource hx)⟩ |
| 51 | obtain ⟨lam, Lam, H₀, hlam, hLam, hH₀, hQ, hH⟩ := |
| 52 | exists_compact_chart_bounds (g := g) (K := K) (gamma := gamma) |
| 53 | hgmetric hJdiff α hK hKU hg |
| 54 | apply positive_at_chart_endpoint hD α hchart conn hab hrho hlam hLam hH₀ hε hg |
| 55 | hv hvs _ hinit _ hlateral _ hq hend |
| 56 | · intro x hx t ht _ |
| 57 | have hz : (t, extChartAt (𝓡 n) α x) ∈ K := |
| 58 | ⟨⟨ht.1.le, ht.2.le⟩, mem_image_of_mem _ (interior_subset hx)⟩ |
| 59 | have hrad := hQ (t, extChartAt (𝓡 n) α x) hz (extChartAt (𝓡 n) α x - gamma t) |
| 60 | have hrest := hH (t, extChartAt (𝓡 n) α x) hz |
| 61 | exact ⟨hrad.1, hrad.2, hrest⟩ |
| 62 | · intro x hx hdist |
| 63 | apply hseed x hx |
| 64 | rw [hstart] |
| 65 | exact hdist.trans_le (min_le_left _ _) |
| 66 | · intro x hx hn t ht |
| 67 | exact (min_le_right _ _).trans (hclear x hx hn t ht) |
| 68 | |
| 69 | /-- **Math.** Spatial lower heat contacts propagate positivity through a connected open domain. -/ |
| 70 | theorem positive_of_connected |
| 71 | {U : Set M} (hU : IsOpen U) (hconn : IsConnected U) |
| 72 | {g : ℝ → RiemannianMetric n M} {J : Set ℝ} |
| 73 | (conn : ∀ t, LeviCivitaData (g t)) |
| 74 | (hgmetric : RiemannianMetric.IsSmoothFamilyOn g J) (hJdiff : UniqueDiffOn ℝ J) |
| 75 | {a b : ℝ} (hab : a < b) (hJ : Icc a b ⊆ J) |
| 76 | {v : M → ℝ → ℝ} |
| 77 | (hv : ContinuousOn (fun z : M × ℝ => v z.1 z.2) (U ×ˢ Icc a b)) |
| 78 | (hvs : HeatLowerContacts conn U (Ioo a b) v) |
| 79 | (hnonneg : ∀ x ∈ U, ∀ t ∈ Icc a b, 0 ≤ v x t) |
| 80 | {p q : M} (hp : p ∈ U) (hq : q ∈ U) (hpos : 0 < v p a) : |
| 81 | 0 < v q b := by |
| 82 | obtain ⟨γ, _, _, ⟨S⟩⟩ := exists_compact_path_subdivision (I := 𝓡 n) hU hconn hp hq |
| 83 | have hprop : ∀ k : ℕ, k ≤ S.count → |
| 84 | 0 < v (γ (S.cut k)) (timeCut a b S.count k) := by |
| 85 | intro k |
| 86 | induction k with |
| 87 | | zero => |
| 88 | intro _ |
| 89 | simpa only [S.cut_zero, Path.source, timeCut_zero] using hpos |
| 90 | | succ k ih => |
| 91 | intro hk |
| 92 | let i : Fin S.count := ⟨k, by omega⟩ |
| 93 | let B := S.ball i |
| 94 | let l := timeCut a b S.count k |
| 95 | let r := timeCut a b S.count (k + 1) |
| 96 | have hl : l ∈ Icc a b := timeCut_mem hab S.count_pos (by omega) |
| 97 | have hr : r ∈ Icc a b := timeCut_mem hab S.count_pos hk |
| 98 | have hclosed : Icc l r ⊆ Icc a b := |
| 99 | fun _ ht => ⟨hl.1.trans ht.1, ht.2.trans hr.2⟩ |
| 100 | have hopen : Ioo l r ⊆ Ioo a b := |
| 101 | fun _ ht => ⟨hl.1.trans_lt ht.1, ht.2.trans_le hr.2⟩ |
| 102 | obtain ⟨c, hlt, hc, _, hstart, hend, hpath⟩ := S.scheduled_segment hab i |
| 103 | have hBU : interior B.domain ⊆ U := interior_subset.trans B.domain_subset |
| 104 | have hleft : γ (S.cut k) ∈ interior B.domain := |
| 105 | B.core_subset_interior (S.left_mem i) |
| 106 | have hright : γ (S.cut (k + 1)) ∈ B.domain := |
| 107 | interior_subset (B.core_subset_interior (S.right_mem i)) |
| 108 | apply positive_along_chart_path B.isCompact_domain B.center B.domain_chart |
| 109 | conn hgmetric hJdiff hlt (hclosed.trans hJ) hc hpath |
| 110 | (hv.mono (Set.prod_mono B.domain_subset hclosed)) |
| 111 | (fun x hx t ht => hvs x (hBU hx) t (hopen ht)) |
| 112 | (fun x hx => hnonneg x (B.domain_subset hx) l hl) |
| 113 | (fun x hx _ t ht => hnonneg x (B.domain_subset hx) t (hclosed ht)) |
| 114 | hleft hright hstart.symm hend.symm (ih (by omega)) |
| 115 | simpa only [S.cut_last, Path.target, timeCut_last a b S.count_pos] using |
| 116 | hprop S.count le_rfl |
| 117 | |
| 118 | /-- On a closed time slab, one positive initial value propagates to every |
| 119 | point of the same connected open domain at terminal time. -/ |
| 120 | theorem positive_of_connected_on_Icc |
| 121 | {U : Set M} (hU : IsOpen U) (hconn : IsConnected U) |
| 122 | {g : ℝ → RiemannianMetric n M} (conn : ∀ t, LeviCivitaData (g t)) |
| 123 | {a b : ℝ} (hab : a < b) |
| 124 | (hg : RiemannianMetric.IsSmoothFamilyOn g (Icc a b)) |
| 125 | {v : M → ℝ → ℝ} |
| 126 | (hv : ContinuousOn (fun z : M × ℝ => v z.1 z.2) (U ×ˢ Icc a b)) |
| 127 | (hvs : HeatLowerContacts conn U (Ioo a b) v) |
| 128 | (hnonneg : ∀ x ∈ U, ∀ t ∈ Icc a b, 0 ≤ v x t) |
| 129 | {p q : M} (hp : p ∈ U) (hq : q ∈ U) (hpos : 0 < v p a) : |
| 130 | 0 < v q b := |
| 131 | positive_of_connected hU hconn conn hg (uniqueDiffOn_Icc hab) hab Subset.rfl |
| 132 | hv hvs hnonneg hp hq hpos |
| 133 | |
| 134 | /-- A terminal zero of a nonnegative lower-contact supersolution forces |
| 135 | vanishing at every strictly earlier spacetime point in the domain. -/ |
| 136 | theorem eq_zero_before_of_eq_zero |
| 137 | {U : Set M} (hU : IsOpen U) (hconn : IsConnected U) |
| 138 | {g : ℝ → RiemannianMetric n M} (conn : ∀ t, LeviCivitaData (g t)) |
| 139 | {a b : ℝ} (hab : a < b) |
| 140 | (hg : RiemannianMetric.IsSmoothFamilyOn g (Icc a b)) |
| 141 | {v : M → ℝ → ℝ} |
| 142 | (hv : ContinuousOn (fun z : M × ℝ => v z.1 z.2) (U ×ˢ Icc a b)) |
| 143 | (hvs : HeatLowerContacts conn U (Ioo a b) v) |
| 144 | (hnonneg : ∀ x ∈ U, ∀ t ∈ Icc a b, 0 ≤ v x t) |
| 145 | {q : M} (hq : q ∈ U) (hzero : v q b = 0) |
| 146 | {t : ℝ} (ht : t ∈ Ico a b) {p : M} (hp : p ∈ U) : v p t = 0 := by |
| 147 | apply le_antisymm _ (hnonneg p hp t ⟨ht.1, ht.2.le⟩) |
| 148 | by_contra hn |
| 149 | have hsub : Icc t b ⊆ Icc a b := Icc_subset_Icc ht.1 le_rfl |
| 150 | have hpos := positive_of_connected hU hconn conn hg (uniqueDiffOn_Icc hab) ht.2 hsub |
| 151 | (hv.mono (prod_mono_right hsub)) |
| 152 | (fun x hx s hs => hvs x hx s ⟨ht.1.trans_lt hs.1, hs.2⟩) |
| 153 | (fun x hx s hs => hnonneg x hx s (hsub hs)) hp hq (lt_of_not_ge hn) |
| 154 | exact (ne_of_gt hpos) hzero |
| 155 | |
| 156 | /-- Continuity extends backward vanishing to the entire closed slab, |
| 157 | including other spatial points at the terminal time. -/ |
| 158 | theorem eq_zero_on_Icc_of_eq_zero |
| 159 | {U : Set M} (hU : IsOpen U) (hconn : IsConnected U) |
| 160 | {g : ℝ → RiemannianMetric n M} (conn : ∀ t, LeviCivitaData (g t)) |
| 161 | {a b : ℝ} (hab : a < b) |
| 162 | (hg : RiemannianMetric.IsSmoothFamilyOn g (Icc a b)) |
| 163 | {v : M → ℝ → ℝ} |
| 164 | (hv : ContinuousOn (fun z : M × ℝ => v z.1 z.2) (U ×ˢ Icc a b)) |
| 165 | (hvs : HeatLowerContacts conn U (Ioo a b) v) |
| 166 | (hnonneg : ∀ x ∈ U, ∀ t ∈ Icc a b, 0 ≤ v x t) |
| 167 | {q : M} (hq : q ∈ U) (hzero : v q b = 0) |
| 168 | {t : ℝ} (ht : t ∈ Icc a b) {p : M} (hp : p ∈ U) : v p t = 0 := by |
| 169 | have hbefore : ∀ s ∈ Ico a b, v p s ≤ 0 := by |
| 170 | intro s hs |
| 171 | exact (eq_zero_before_of_eq_zero hU hconn conn hab hg hv hvs hnonneg hq hzero hs hp).le |
| 172 | have hc : ContinuousOn (v p) (Icc a b) := |
| 173 | hv.comp (continuous_const.prodMk continuous_id).continuousOn |
| 174 | (fun s hs => ⟨hp, hs⟩) |
| 175 | have hclosed := le_on_closure hbefore |
| 176 | (show ContinuousOn (v p) (closure (Ico a b)) by simpa [closure_Ico hab.ne] using hc) |
| 177 | (show ContinuousOn (fun _ : ℝ => (0 : ℝ)) (closure (Ico a b)) from continuousOn_const) |
| 178 | exact le_antisymm (hclosed (by simpa [closure_Ico hab.ne] using ht)) (hnonneg p hp t ht) |
| 179 | |
| 180 | /-- At every positive time in the slab, the zero set of a nonnegative |
| 181 | lower-contact supersolution is either empty or the entire connected domain. -/ |
| 182 | theorem eq_zero_at_positive_time_iff |
| 183 | {U : Set M} (hU : IsOpen U) (hconn : IsConnected U) |
| 184 | {g : ℝ → RiemannianMetric n M} (conn : ∀ t, LeviCivitaData (g t)) |
| 185 | {a b : ℝ} (hg : RiemannianMetric.IsSmoothFamilyOn g (Icc a b)) |
| 186 | {v : M → ℝ → ℝ} |
| 187 | (hv : ContinuousOn (fun z : M × ℝ => v z.1 z.2) (U ×ˢ Icc a b)) |
| 188 | (hvs : HeatLowerContacts conn U (Ioo a b) v) |
| 189 | (hnonneg : ∀ x ∈ U, ∀ t ∈ Icc a b, 0 ≤ v x t) |
| 190 | {t : ℝ} (ht : t ∈ Ioc a b) {p q : M} (hp : p ∈ U) (hq : q ∈ U) : |
| 191 | v p t = 0 ↔ v q t = 0 := by |
| 192 | have hsub : Icc a t ⊆ Icc a b := Icc_subset_Icc_right ht.2 |
| 193 | have hg' : RiemannianMetric.IsSmoothFamilyOn g (Icc a t) := |
| 194 | hg.mono (prod_mono_left hsub) |
| 195 | have hv' := hv.mono (prod_mono_right hsub) |
| 196 | have hvs' : HeatLowerContacts conn U (Ioo a t) v := |
| 197 | fun x hx s hs => hvs x hx s ⟨hs.1, hs.2.trans_le ht.2⟩ |
| 198 | have hn' : ∀ x ∈ U, ∀ s ∈ Icc a t, 0 ≤ v x s := |
| 199 | fun x hx s hs => hnonneg x hx s (hsub hs) |
| 200 | constructor |
| 201 | · intro hz |
| 202 | exact eq_zero_on_Icc_of_eq_zero hU hconn conn ht.1 hg' hv' hvs' hn' hp hz |
| 203 | ⟨ht.1.le, le_rfl⟩ hq |
| 204 | · intro hz |
| 205 | exact eq_zero_on_Icc_of_eq_zero hU hconn conn ht.1 hg' hv' hvs' hn' hq hz |
| 206 | ⟨ht.1.le, le_rfl⟩ hp |
| 207 | |
| 208 | end PoincareMT.RicciFlow.Splitting.MaximumPrinciple |