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.Singular.RegularLimit.Canonical.Cap.Gradient.Transport |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Singular.RegularLimit.Canonical.Cap.ScalarRatio |
| 3 | import Mathlib.Analysis.SpecialFunctions.Pow.Continuity |
| 4 | |
| 5 | /-! # Persistence of the cap scalar gradient bound -/ |
| 6 | |
| 7 | set_option autoImplicit false |
| 8 | set_option backward.isDefEq.respectTransparency false |
| 9 | |
| 10 | open Set Filter |
| 11 | open scoped Manifold ContDiff Bundle Topology |
| 12 | |
| 13 | universe u |
| 14 | |
| 15 | namespace PoincareMT.RicciFlow |
| 16 | |
| 17 | /-- Every nonnegative real power of scalar curvature converges uniformly on |
| 18 | compact sets at included flow times, even across scalar zeroes. -/ |
| 19 | theorem tendstoUniformlyOn_scalarCurvature_rpow_of_nonneg |
| 20 | {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 21 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 22 | {J : Set ℝ} (G : RicciFlow n M J) |
| 23 | {T : ℝ} (hT : T ∈ J) {A : Set M} (hA : IsCompact A) |
| 24 | {p : ℝ} (hp : 0 ≤ p) : |
| 25 | TendstoUniformlyOn (fun t x => ((G.connection t).scalarCurvature x) ^ p) |
| 26 | (fun x => ((G.connection T).scalarCurvature x) ^ p) (𝓝[J] T) A := by |
| 27 | have hcontinuous : ContinuousOn |
| 28 | (fun z : ℝ × M => ((G.connection z.1).scalarCurvature z.2) ^ p) (J ×ˢ univ) := |
| 29 | G.contMDiffOn_scalarCurvature.continuousOn.rpow_const (fun _ _ => Or.inr hp) |
| 30 | apply Metric.tendstoUniformlyOn_iff.mpr |
| 31 | intro ε hε |
| 32 | obtain ⟨V, hV, hbound⟩ := hA.mem_uniformity_of_prod |
| 33 | (f := fun t x => ((G.connection t).scalarCurvature x) ^ p) |
| 34 | (hcontinuous.mono (prod_mono subset_rfl (subset_univ A))) hT |
| 35 | (Metric.dist_mem_uniformity hε) |
| 36 | filter_upwards [hV] with t ht x hx |
| 37 | have hb : dist (((G.connection t).scalarCurvature x) ^ p) |
| 38 | (((G.connection T).scalarCurvature x) ^ p) < ε := hbound t ht x hx |
| 39 | rwa [dist_comm] at hb |
| 40 | |
| 41 | end PoincareMT.RicciFlow |
| 42 | |
| 43 | namespace PoincareMT.SingularTimeAssumptions |
| 44 | |
| 45 | variable {M : Type u} [TopologicalSpace M] |
| 46 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 47 | [IsManifold (𝓡 3) ∞ M] [MeasurableSpace M] [BorelSpace M] |
| 48 | [T2Space M] [T3Space M] [SecondCountableTopology M] |
| 49 | {F : GeneralizedRicciFlowData.{u}} {T : ℝ} |
| 50 | |
| 51 | /-- The actual scalar gradient bound persists uniformly on every captured |
| 52 | late cap through a positive-scalar point, with witness `3 C / 2 < 2 C`. -/ |
| 53 | theorem eventually_captured_cap_terminal_scalarGradient_bound |
| 54 | (H : SingularTimeAssumptions F T M) (P04 : RicciFlowCurvatureTheory.{u}) |
| 55 | {A : Set (H.regularRegion P04)} (hA : IsCompact A) |
| 56 | (x₀ : H.regularRegion P04) |
| 57 | (hx₀ : 0 < (H.terminalConnection P04).scalarCurvature x₀) : |
| 58 | ∀ᶠ t in 𝓝[<] T, ∀ ht : t ∈ Ico H.reference.tMinus T, |
| 59 | ∀ N : CapCertificate (F.metric t), N.cap_constant ≤ H.constant → |
| 60 | N.connection = F.connection t → |
| 61 | H.reference.inverse t ht '' N.carrier ⊆ Subtype.val '' A → |
| 62 | H.reference.forward t ht x₀ ∈ N.core → |
| 63 | ∃ b : ℝ, b < 2 * H.constant ∧ |
| 64 | ∀ x ∈ H.regularReferencePreimage P04 t ht N.carrier, |
| 65 | scalarGradientNorm (H.terminalMetric P04) (H.terminalConnection P04) x ≤ |
| 66 | b * ((H.terminalConnection P04).scalarCurvature x) ^ (3 / 2 : ℝ) := by |
| 67 | let G := H.terminalFlow P04 |
| 68 | let m := (H.terminalConnection P04).scalarCurvature x₀ / 2 |
| 69 | have hm : 0 < m := half_pos hx₀ |
| 70 | let a := m / (2 * H.constant) |
| 71 | have ha : 0 < a := by dsimp [a]; positivity [H.constant_pos] |
| 72 | let δ := H.constant * a ^ (3 / 2 : ℝ) / (4 * (H.constant + 1)) |
| 73 | have hδ : 0 < δ := by dsimp [δ]; positivity [H.constant_pos] |
| 74 | have hδeq : (H.constant + 1) * δ = H.constant * a ^ (3 / 2 : ℝ) / 4 := by |
| 75 | dsimp [δ] |
| 76 | field_simp [ne_of_gt (add_pos H.constant_pos zero_lt_one)] |
| 77 | have hfilter : 𝓝[<] T ≤ 𝓝[Ioc H.reference.tMinus T] T := |
| 78 | nhdsWithin_le_of_mem (Ioc_mem_nhdsLT H.reference.tMinus_lt) |
| 79 | have hscalar : ∀ᶠ t in 𝓝[<] T, m < H.reference.scalar t x₀ := |
| 80 | (H.tendsto_terminal_scalarCurvature P04 x₀).eventually (Ioi_mem_nhds (half_lt_self hx₀)) |
| 81 | have hclose := Metric.tendstoUniformlyOn_iff.mp |
| 82 | (H.tendstoUniformlyOn_terminal_scalarCurvature P04 hA) a ha |
| 83 | have hgradient := hfilter (Metric.tendstoUniformlyOn_iff.mp |
| 84 | (G.tendstoUniformlyOn_scalarGradientNorm ⟨H.reference.tMinus_lt, le_rfl⟩ hA) δ hδ) |
| 85 | have hpower := hfilter (Metric.tendstoUniformlyOn_iff.mp |
| 86 | (G.tendstoUniformlyOn_scalarCurvature_rpow_of_nonneg |
| 87 | ⟨H.reference.tMinus_lt, le_rfl⟩ hA (by norm_num : 0 ≤ (3 / 2 : ℝ))) δ hδ) |
| 88 | filter_upwards [hscalar, hclose, hgradient, hpower] with t hscalar hclose hgradient hpower |
| 89 | intro ht N hconstant hconnection hcapture hx₀core |
| 90 | refine ⟨3 * H.constant / 2, by nlinarith [H.constant_pos], ?_⟩ |
| 91 | intro x hx |
| 92 | have hxA := H.regularReferencePreimage_subset P04 t ht N.carrier hcapture hx |
| 93 | have hpos := N.scalar_pos _ hx |
| 94 | have hratio := N.scalar_lt_constant_mul hx (N.core_subset_carrier hx₀core) |
| 95 | rw [hconnection, H.reference.scalar_pullback, H.reference.scalar_pullback] at hratio |
| 96 | rw [hconnection, H.reference.scalar_pullback] at hpos |
| 97 | have hlower : m ≤ H.constant * H.reference.scalar t x := |
| 98 | hscalar.le.trans (hratio.le.trans (mul_le_mul_of_nonneg_right hconstant hpos.le)) |
| 99 | have herror := hclose x hxA |
| 100 | rw [Real.dist_eq] at herror |
| 101 | have hmul := mul_lt_mul_of_pos_left (abs_sub_lt_iff.mp herror).2 H.constant_pos |
| 102 | have hacancel : H.constant * a = m / 2 := by |
| 103 | dsimp [a] |
| 104 | field_simp [H.constant_pos.ne'] |
| 105 | have hnewlower : a ≤ (H.terminalConnection P04).scalarCurvature x := by |
| 106 | apply (mul_le_mul_iff_right₀ H.constant_pos).mp |
| 107 | nlinarith |
| 108 | have hnewpow := Real.rpow_le_rpow ha.le hnewlower (by norm_num : 0 ≤ (3 / 2 : ℝ)) |
| 109 | have hgrad := hgradient x hxA |
| 110 | rw [Real.dist_eq, H.terminalFlow_scalarGradientNorm_at_terminal P04, |
| 111 | H.terminalFlow_scalarGradientNorm_of_lt P04 t ht] at hgrad |
| 112 | have hpow := hpower x hxA |
| 113 | rw [Real.dist_eq, H.terminalFlow_scalar_at_terminal P04, |
| 114 | H.terminalFlow_scalar_of_ne P04 ht.2.ne] at hpow |
| 115 | obtain ⟨b, hb, hbound⟩ := N.gradient_bound |
| 116 | have hold := (hbound _ hx).trans (mul_le_mul_of_nonneg_right |
| 117 | (hb.le.trans hconstant) (Real.rpow_nonneg (N.scalar_pos _ hx).le _)) |
| 118 | rw [hconnection, H.reference.scalar_pullback] at hold |
| 119 | change scalarGradientNorm (F.metric t) (F.connection t) |
| 120 | (H.reference.forward t ht x) ≤ H.constant * H.reference.scalar t x ^ (3 / 2 : ℝ) at hold |
| 121 | have hpowmul := mul_lt_mul_of_pos_left (abs_sub_lt_iff.mp hpow).2 H.constant_pos |
| 122 | have hmargin := mul_le_mul_of_nonneg_left hnewpow H.constant_pos.le |
| 123 | have hnonneg := mul_nonneg H.constant_pos.le (Real.rpow_nonneg (ha.le.trans hnewlower) (3 / 2 : ℝ)) |
| 124 | have hgrad' := (abs_sub_lt_iff.mp hgrad).1 |
| 125 | nlinarith only [hold, hgrad', hpowmul, hmargin, hδeq, hnonneg] |
| 126 | |
| 127 | end PoincareMT.SingularTimeAssumptions |