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.Analysis.Parabolic.SupportTransport |
| 2 | import PoincareLib.Analysis.Parabolic.CompactMaximum |
| 3 | import Mathlib.Analysis.Normed.Group.Bounded |
| 4 | import Mathlib.Topology.Compactness.LocallyCompact |
| 5 | import Mathlib.Topology.Homeomorph.Lemmas |
| 6 | import Mathlib.Topology.Separation.Basic |
| 7 | |
| 8 | /-! |
| 9 | # Convex preservation from local isometric coordinates |
| 10 | |
| 11 | Local carrier coordinates and continuous local section components suffice for |
| 12 | compact comparison. A finite compact shrinking cover supplies a compact family |
| 13 | of bounded supporting pairs, without any topology on the total bundle space. |
| 14 | |
| 15 | Source: Morgan--Tian, Theorems 4.7--4.8, printed p. 66. |
| 16 | -/ |
| 17 | |
| 18 | set_option autoImplicit false |
| 19 | set_option backward.isDefEq.respectTransparency false |
| 20 | |
| 21 | open Set |
| 22 | open scoped InnerProductSpace Topology NNReal BigOperators Classical |
| 23 | |
| 24 | namespace Poincare.Parabolic |
| 25 | |
| 26 | variable {B : Type*} [TopologicalSpace B] [CompactSpace B] [T2Space B] |
| 27 | {V : B → Type*} [∀ x, NormedAddCommGroup (V x)] [∀ x, InnerProductSpace ℝ (V x)] |
| 28 | [∀ x, FiniteDimensional ℝ (V x)] |
| 29 | |
| 30 | /-- Convex preservation in finite-dimensional metric fibers, using only local |
| 31 | isometric carrier coordinates. The spatial contact estimate is supplied by the |
| 32 | connection calculation, and the compact support family is constructed here. -/ |
| 33 | theorem local_mem_of_inward_of_contact |
| 34 | {K : ∀ x, Set (V x)} (hne : ∀ x, (K x).Nonempty) |
| 35 | (hclosed : ∀ x, IsClosed (K x)) (hconv : ∀ x, Convex ℝ (K x)) |
| 36 | (O : B → Set B) (hO : ∀ p, IsOpen (O p)) (hpO : ∀ p, p ∈ O p) |
| 37 | (e : ∀ p x, x ∈ O p → V p ≃ₗᵢ[ℝ] V x) |
| 38 | (heK : ∀ p x hx, e p x hx '' K p = K x) |
| 39 | {U L : ∀ x, ℝ → V x} {ψ : ∀ x, ℝ → V x → V x} {a b : ℝ} |
| 40 | (hU : ∀ p, ContinuousOn (fun z : B × ℝ => |
| 41 | if hx : z.1 ∈ O p then (e p z.1 hx).symm (U z.1 z.2) else 0) |
| 42 | (O p ×ˢ Icc a b)) |
| 43 | (hevol : ∀ x t, t ∈ Ioc a b → |
| 44 | HasDerivWithinAt (U x) (L x t + ψ x t (U x t)) (Icc a b) t) |
| 45 | (hlip : ∀ R : ℝ, ∃ D : ℝ≥0, ∀ x t, t ∈ Ioc a b → |
| 46 | LipschitzOnWith D (ψ x t) (Metric.closedBall 0 R)) |
| 47 | (hinward : ∀ x t, t ∈ Ioc a b → ∀ q ∈ unitSupportSet (K x), |
| 48 | ⟪q.2, ψ x t q.1⟫_ℝ ≤ 0) |
| 49 | (hcontact : ∀ x t, t ∈ Ioc a b → ∀ q ∈ unitSupportSet (K x), |
| 50 | 0 < Metric.infDist (U x t) (K x) → |
| 51 | ⟪q.2, U x t - q.1⟫_ℝ = Metric.infDist (U x t) (K x) → |
| 52 | (∀ y, Metric.infDist (U y t) (K y) ≤ Metric.infDist (U x t) (K x)) → |
| 53 | ⟪q.2, L x t⟫_ℝ ≤ 0) |
| 54 | (hinit : ∀ x, U x a ∈ K x) : |
| 55 | ∀ x t, t ∈ Icc a b → U x t ∈ K x := by |
| 56 | classical |
| 57 | let UP (p : B) (z : B × ℝ) : V p := |
| 58 | if hx : z.1 ∈ O p then (e p z.1 hx).symm (U z.1 z.2) else 0 |
| 59 | have hUP (p x : B) (hx : x ∈ O p) (t : ℝ) : |
| 60 | UP p (x, t) = (e p x hx).symm (U x t) := dif_pos hx |
| 61 | choose C hCmem hCsub hCcompact using fun p => |
| 62 | local_compact_nhds ((hO p).mem_nhds (hpO p)) |
| 63 | obtain ⟨s, -, hs⟩ := isCompact_univ.elim_nhds_subcover C (fun p _ => hCmem p) |
| 64 | have hcover (x : B) : ∃ p : s, x ∈ C p.1 := by |
| 65 | obtain ⟨p, hp, hx⟩ := mem_iUnion₂.mp (hs (mem_univ x)) |
| 66 | exact ⟨⟨p, hp⟩, hx⟩ |
| 67 | have hbound (p : s) : ∃ N : ℝ, ∀ z ∈ C p.1 ×ˢ Icc a b, ‖UP p.1 z‖ ≤ N := |
| 68 | ((hCcompact p.1).prod isCompact_Icc).exists_bound_of_continuousOn |
| 69 | ((hU p.1).mono (fun _ hz => ⟨hCsub p.1 hz.1, hz.2⟩)) |
| 70 | choose Np hNp using hbound |
| 71 | let N : ℝ := ∑ p : s, |Np p| |
| 72 | have hN (x : B) (t : ℝ) (ht : t ∈ Icc a b) : ‖U x t‖ ≤ N := by |
| 73 | obtain ⟨p, hx⟩ := hcover x |
| 74 | have hn := hNp p (x, t) ⟨hx, ht⟩ |
| 75 | rw [hUP p.1 x (hCsub p.1 hx) t, (e p.1 x (hCsub p.1 hx)).symm.norm_map] at hn |
| 76 | exact hn.trans ((le_abs_self _).trans |
| 77 | (Finset.single_le_sum (f := fun q : s => |Np q|) |
| 78 | (fun _ _ => abs_nonneg _) (Finset.mem_univ p))) |
| 79 | obtain ⟨w, hw⟩ := Classical.axiomOfChoice hne |
| 80 | let A : ℝ := ∑ p : s, ‖w p.1‖ |
| 81 | have hanchor (x : B) : ∃ z ∈ K x, ‖z‖ ≤ A := by |
| 82 | obtain ⟨p, hx⟩ := hcover x |
| 83 | refine ⟨e p.1 x (hCsub p.1 hx) (w p.1), ?_, ?_⟩ |
| 84 | · rw [← heK p.1 x (hCsub p.1 hx)] |
| 85 | exact mem_image_of_mem _ (hw p.1) |
| 86 | · rw [(e p.1 x (hCsub p.1 hx)).norm_map] |
| 87 | exact Finset.single_le_sum (f := fun q : s => ‖w q.1‖) |
| 88 | (fun _ _ => norm_nonneg _) (Finset.mem_univ p) |
| 89 | choose z hz hzbound using hanchor |
| 90 | let R : ℝ := 2 * N + A |
| 91 | let P (p : s) := C p.1 × boundedUnitSupportSet (K p.1) R |
| 92 | let (p : s) : CompactSpace (C p.1) := isCompact_iff_compactSpace.mp (hCcompact p.1) |
| 93 | let (p : s) : CompactSpace (boundedUnitSupportSet (K p.1) R) := |
| 94 | isCompact_iff_compactSpace.mp (isCompact_boundedUnitSupportSet _ R (hclosed p.1)) |
| 95 | let S := Σ p : s, P p |
| 96 | let base (q : S) : B := q.2.1.1 |
| 97 | let iso (q : S) : V q.1.1 ≃ₗᵢ[ℝ] V (base q) := |
| 98 | e q.1.1 (base q) (hCsub q.1.1 q.2.1.2) |
| 99 | let pair (q : S) : V (base q) × V (base q) := |
| 100 | (iso q q.2.2.1.1, iso q q.2.2.1.2) |
| 101 | have hpair (q : S) : pair q ∈ unitSupportSet (K (base q)) := by |
| 102 | rw [← heK q.1.1 (base q) (hCsub q.1.1 q.2.1.2)] |
| 103 | exact unitSupport_map (iso q) q.2.2.2.1 |
| 104 | let f (q : S) (t : ℝ) : ℝ := ⟪(pair q).2, U (base q) t - (pair q).1⟫_ℝ |
| 105 | let f' (q : S) (t : ℝ) : ℝ := |
| 106 | ⟪(pair q).2, L (base q) t + ψ (base q) t (U (base q) t)⟫_ℝ |
| 107 | have hf_model (q : S) (t : ℝ) : f q t = |
| 108 | ⟪q.2.2.1.2, UP q.1.1 (base q, t) - q.2.2.1.1⟫_ℝ := by |
| 109 | rw [hUP q.1.1 (base q) (hCsub q.1.1 q.2.1.2)] |
| 110 | exact support_eval_pullback (iso q) _ _ _ |
| 111 | have hf_cont : Continuous (fun q : S × Icc a b => f q.1 q.2) := by |
| 112 | have hp : Continuous (fun q : Σ p : s, P p × Icc a b => f ⟨q.1, q.2.1⟩ q.2.2) := by |
| 113 | apply continuous_sigma |
| 114 | intro p |
| 115 | have hc : Continuous (fun q : P p × Icc a b => UP p.1 (q.1.1.1, q.2)) := |
| 116 | (hU p.1).comp_continuous |
| 117 | ((continuous_subtype_val.comp (continuous_fst.comp continuous_fst)).prodMk |
| 118 | (continuous_subtype_val.comp continuous_snd)) |
| 119 | (fun q => ⟨hCsub p.1 q.1.1.2, q.2.2⟩) |
| 120 | have hn : Continuous (fun q : P p × Icc a b => q.1.2.1.2) := |
| 121 | (continuous_subtype_val.comp (continuous_snd.comp continuous_fst)).snd |
| 122 | have hv : Continuous (fun q : P p × Icc a b => q.1.2.1.1) := |
| 123 | (continuous_subtype_val.comp (continuous_snd.comp continuous_fst)).fst |
| 124 | convert hn.inner (hc.sub hv) using 1 |
| 125 | ext q |
| 126 | exact hf_model ⟨p, q.1⟩ q.2 |
| 127 | exact hp.comp Homeomorph.sigmaProdDistrib.continuous |
| 128 | have hf : ContinuousOn (Function.uncurry f) (univ ×ˢ Icc a b) := by |
| 129 | rw [continuousOn_iff_continuous_domRestrict] |
| 130 | exact hf_cont.comp |
| 131 | ((continuous_subtype_val.fst).prodMk |
| 132 | (continuous_subtype_val.snd.subtype_mk (fun q => q.2.2))) |
| 133 | have hderiv (q : S) (t : ℝ) (ht : t ∈ Ioc a b) : |
| 134 | HasDerivWithinAt (f q) (f' q t) (Icc a b) t := by |
| 135 | simpa [f, f'] using (hasDerivWithinAt_const t (Icc a b) (pair q).2).inner ℝ |
| 136 | ((hevol (base q) t ht).sub_const (pair q).1) |
| 137 | have hrealize (x : B) (r : V x × V x) (hr : r ∈ boundedUnitSupportSet (K x) R) : |
| 138 | ∃ q : S, ∀ t, f q t = ⟪r.2, U x t - r.1⟫_ℝ := by |
| 139 | obtain ⟨p, hx⟩ := hcover x |
| 140 | let ex := e p.1 x (hCsub p.1 hx) |
| 141 | have hmap : ex.symm '' K x = K p.1 := by |
| 142 | rw [← heK p.1 x (hCsub p.1 hx)] |
| 143 | exact Set.ext fun v => by simp [ex] |
| 144 | have hr' : (ex.symm r.1, ex.symm r.2) ∈ boundedUnitSupportSet (K p.1) R := by |
| 145 | rw [← hmap] |
| 146 | exact (boundedUnitSupport_map_iff ex.symm).mpr hr |
| 147 | refine ⟨⟨p, ⟨x, hx⟩, ⟨(ex.symm r.1, ex.symm r.2), hr'⟩⟩, ?_⟩ |
| 148 | intro t |
| 149 | simp only [f, pair, iso, base, ex, LinearIsometryEquiv.apply_symm_apply] |
| 150 | have hactive (q : S) (t : ℝ) (ht : t ∈ Icc a b) (hpos : 0 < f q t) |
| 151 | (hmax : ∀ p, f p t ≤ f q t) : |
| 152 | f q t = Metric.infDist (U (base q) t) (K (base q)) ∧ |
| 153 | ∀ y, Metric.infDist (U y t) (K y) ≤ |
| 154 | Metric.infDist (U (base q) t) (K (base q)) := by |
| 155 | have hle := unitSupport_eval_le_infDist (hne (base q)) (hclosed (base q)) |
| 156 | (hconv (base q)) (hpair q) (U (base q) t) |
| 157 | have hdist (y : B) : Metric.infDist (U y t) (K y) ≤ f q t := by |
| 158 | by_cases hy : U y t ∈ K y |
| 159 | · simpa only [Metric.infDist_zero_of_mem hy] using hpos.le |
| 160 | · obtain ⟨r, hr, heq⟩ := exists_boundedUnitSupport_active (hne y) (hclosed y) |
| 161 | (hconv y) (hz y) (hN y t ht) hy |
| 162 | have hr' : r ∈ boundedUnitSupportSet (K y) R := |
| 163 | ⟨hr.1, hr.2.trans (add_le_add (le_refl (2 * N)) (hzbound y))⟩ |
| 164 | obtain ⟨p, hp⟩ := hrealize y r hr' |
| 165 | rw [← heq, ← hp t] |
| 166 | exact hmax p |
| 167 | exact ⟨le_antisymm hle (hdist (base q)), fun y => (hdist y).trans hle⟩ |
| 168 | obtain ⟨D, hD⟩ := hlip (max N R) |
| 169 | have hmax (q : S) (t : ℝ) (ht : t ∈ Ioc a b) (hpos : 0 < f q t) |
| 170 | (hmax : ∀ p, f p t ≤ f q t) : f' q t ≤ D * f q t := by |
| 171 | have ht' : t ∈ Icc a b := ⟨ht.1.le, ht.2⟩ |
| 172 | obtain ⟨ha, hs⟩ := hactive q t ht' hpos hmax |
| 173 | have hd := hcontact (base q) t ht (pair q) (hpair q) (ha ▸ hpos) ha hs |
| 174 | have hr := reaction_inner_le_mul_infDist (hne (base q)) (hclosed (base q)) |
| 175 | (hconv (base q)) (hpair q) ha (hD (base q) t ht) |
| 176 | (show U (base q) t ∈ Metric.closedBall 0 (max N R) by |
| 177 | simpa only [Metric.mem_closedBall, dist_zero_right] using |
| 178 | (hN (base q) t ht').trans (le_max_left _ _)) |
| 179 | (show nearestPoint (K (base q)) (hne (base q)) (hclosed (base q)) (hconv (base q)) |
| 180 | (U (base q) t) ∈ Metric.closedBall 0 (max N R) by |
| 181 | have hp := norm_nearestPoint_le (hne (base q)) (hclosed (base q)) (hconv (base q)) |
| 182 | (hz (base q)) (hN (base q) t ht') |
| 183 | have hp' : _ ≤ R := hp.trans (add_le_add (le_refl (2 * N)) (hzbound (base q))) |
| 184 | simpa only [Metric.mem_closedBall, dist_zero_right] using |
| 185 | hp'.trans (le_max_right _ _)) |
| 186 | (hinward (base q) t ht) |
| 187 | dsimp only [f'] |
| 188 | rw [inner_add_right, ha] |
| 189 | linarith |
| 190 | have hnonpos := nonpos_of_deriv_le_mul_at_max hf hderiv hmax |
| 191 | (fun q => (hpair q).2.2 (U (base q) a) (hinit (base q))) |
| 192 | intro x t ht |
| 193 | by_contra hnot |
| 194 | obtain ⟨r, hr, heq⟩ := exists_boundedUnitSupport_active (hne x) (hclosed x) (hconv x) |
| 195 | (hz x) (hN x t ht) hnot |
| 196 | have hr' : r ∈ boundedUnitSupportSet (K x) R := |
| 197 | ⟨hr.1, hr.2.trans (add_le_add (le_refl (2 * N)) (hzbound x))⟩ |
| 198 | obtain ⟨q, hq⟩ := hrealize x r hr' |
| 199 | have h := hnonpos q t ht |
| 200 | rw [hq t, heq] at h |
| 201 | exact (not_lt_of_ge h) (((hclosed x).notMem_iff_infDist_pos (hne x)).mp hnot) |
| 202 | |
| 203 | end Poincare.Parabolic |