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.Metric.ScalarPowers |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Singular.RegularLimit.Canonical.Cap.Supremum |
| 3 | |
| 4 | /-! # Limits and positivity of canonical scalar-radius extrema -/ |
| 5 | |
| 6 | set_option autoImplicit false |
| 7 | set_option backward.isDefEq.respectTransparency false |
| 8 | |
| 9 | open Set Filter |
| 10 | open scoped Manifold ContDiff Bundle Topology |
| 11 | |
| 12 | universe u |
| 13 | |
| 14 | namespace PoincareMT.SingularRegularLimit |
| 15 | |
| 16 | /-- Uniform errors control real infima as well as suprema. -/ |
| 17 | theorem abs_sub_scalar_inf_le {X : Type*} [Nonempty X] (f g : X → ℝ) |
| 18 | (hg : BddBelow (range g)) (ε : ℝ) (hfg : ∀ x, |f x - g x| ≤ ε) : |
| 19 | |sInf (range f) - sInf (range g)| ≤ ε := by |
| 20 | have hfg' (x : X) : f x ≤ g x + ε := by |
| 21 | have := (abs_sub_le_iff.mp (hfg x)).1 |
| 22 | linarith |
| 23 | have hgf' (x : X) : g x ≤ f x + ε := by |
| 24 | have := (abs_sub_le_iff.mp (hfg x)).2 |
| 25 | linarith |
| 26 | have hf : BddBelow (range f) := by |
| 27 | refine ⟨sInf (range g) - ε, ?_⟩ |
| 28 | rintro _ ⟨x, rfl⟩ |
| 29 | linarith [hgf' x, csInf_le hg (mem_range_self x)] |
| 30 | have hfginf : sInf (range f) - ε ≤ sInf (range g) := by |
| 31 | apply le_csInf (range_nonempty g) |
| 32 | rintro _ ⟨x, rfl⟩ |
| 33 | linarith [hfg' x, csInf_le hf (mem_range_self x)] |
| 34 | have hgfinf : sInf (range g) - ε ≤ sInf (range f) := by |
| 35 | apply le_csInf (range_nonempty f) |
| 36 | rintro _ ⟨x, rfl⟩ |
| 37 | linarith [hgf' x, csInf_le hg (mem_range_self x)] |
| 38 | exact abs_sub_le_iff.mpr ⟨by linarith, by linarith⟩ |
| 39 | |
| 40 | end PoincareMT.SingularRegularLimit |
| 41 | |
| 42 | namespace PoincareMT.SingularTimeAssumptions |
| 43 | |
| 44 | variable {M : Type u} [TopologicalSpace M] |
| 45 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 46 | [IsManifold (𝓡 3) ∞ M] [MeasurableSpace M] [BorelSpace M] |
| 47 | [T2Space M] [T3Space M] [SecondCountableTopology M] |
| 48 | {F : GeneralizedRicciFlowData.{u}} {T : ℝ} |
| 49 | |
| 50 | theorem tendsto_terminal_scalarRadius_sup |
| 51 | (H : SingularTimeAssumptions F T M) (P04 : RicciFlowCurvatureTheory.{u}) |
| 52 | {A : Set (H.regularRegion P04)} (hA : IsCompact A) (hne : A.Nonempty) |
| 53 | (hpos : ∀ x ∈ A, 0 < (H.terminalConnection P04).scalarCurvature x) : |
| 54 | Tendsto (fun t => sSup (range (fun x : A => |
| 55 | H.reference.scalar t (x : H.regularRegion P04) ^ (-1 / 2 : ℝ)))) (𝓝[<] T) |
| 56 | (𝓝 (sSup (range (fun x : A => |
| 57 | (H.terminalConnection P04).scalarCurvature x ^ (-1 / 2 : ℝ))))) := by |
| 58 | let _ : Nonempty A := nonempty_subtype.mpr hne |
| 59 | have hcontinuous := (H.terminalConnection P04).continuous_scalarCurvature.continuousOn.rpow_const |
| 60 | (p := (-1 / 2 : ℝ)) (fun x hx => Or.inl (hpos x hx).ne') |
| 61 | have hbounded : BddAbove (range (fun x : A => |
| 62 | (H.terminalConnection P04).scalarCurvature x ^ (-1 / 2 : ℝ))) := by |
| 63 | apply (hA.bddAbove_image hcontinuous).mono |
| 64 | rintro _ ⟨x, rfl⟩ |
| 65 | exact ⟨x, x.property, rfl⟩ |
| 66 | apply Metric.tendsto_nhds.mpr |
| 67 | intro ε hε |
| 68 | filter_upwards [Metric.tendstoUniformlyOn_iff.mp |
| 69 | (H.tendstoUniformlyOn_terminal_scalar_rpow P04 hA hpos (-1 / 2)) |
| 70 | (ε / 2) (by positivity)] with t ht |
| 71 | have h := SingularRegularLimit.abs_sub_scalar_sup_le |
| 72 | (fun x : A => H.reference.scalar t (x : H.regularRegion P04) ^ (-1 / 2 : ℝ)) |
| 73 | (fun x : A => (H.terminalConnection P04).scalarCurvature x ^ (-1 / 2 : ℝ)) |
| 74 | hbounded (ε / 2) (fun x => by |
| 75 | simpa only [Real.dist_eq, abs_sub_comm] using (ht x x.property).le) |
| 76 | exact (by simpa only [Real.dist_eq] using h.trans_lt (by linarith)) |
| 77 | |
| 78 | theorem tendsto_terminal_scalarRadius_inf |
| 79 | (H : SingularTimeAssumptions F T M) (P04 : RicciFlowCurvatureTheory.{u}) |
| 80 | {A : Set (H.regularRegion P04)} (hA : IsCompact A) (hne : A.Nonempty) |
| 81 | (hpos : ∀ x ∈ A, 0 < (H.terminalConnection P04).scalarCurvature x) : |
| 82 | Tendsto (fun t => sInf (range (fun x : A => |
| 83 | H.reference.scalar t (x : H.regularRegion P04) ^ (-1 / 2 : ℝ)))) (𝓝[<] T) |
| 84 | (𝓝 (sInf (range (fun x : A => |
| 85 | (H.terminalConnection P04).scalarCurvature x ^ (-1 / 2 : ℝ))))) := by |
| 86 | let _ : Nonempty A := nonempty_subtype.mpr hne |
| 87 | have hcontinuous := (H.terminalConnection P04).continuous_scalarCurvature.continuousOn.rpow_const |
| 88 | (p := (-1 / 2 : ℝ)) (fun x hx => Or.inl (hpos x hx).ne') |
| 89 | have hbounded : BddBelow (range (fun x : A => |
| 90 | (H.terminalConnection P04).scalarCurvature x ^ (-1 / 2 : ℝ))) := by |
| 91 | apply (hA.bddBelow_image hcontinuous).mono |
| 92 | rintro _ ⟨x, rfl⟩ |
| 93 | exact ⟨x, x.property, rfl⟩ |
| 94 | apply Metric.tendsto_nhds.mpr |
| 95 | intro ε hε |
| 96 | filter_upwards [Metric.tendstoUniformlyOn_iff.mp |
| 97 | (H.tendstoUniformlyOn_terminal_scalar_rpow P04 hA hpos (-1 / 2)) |
| 98 | (ε / 2) (by positivity)] with t ht |
| 99 | have h := SingularRegularLimit.abs_sub_scalar_inf_le |
| 100 | (fun x : A => H.reference.scalar t (x : H.regularRegion P04) ^ (-1 / 2 : ℝ)) |
| 101 | (fun x : A => (H.terminalConnection P04).scalarCurvature x ^ (-1 / 2 : ℝ)) |
| 102 | hbounded (ε / 2) (fun x => by |
| 103 | simpa only [Real.dist_eq, abs_sub_comm] using (ht x x.property).le) |
| 104 | exact (by simpa only [Real.dist_eq] using h.trans_lt (by linarith)) |
| 105 | |
| 106 | theorem terminal_scalarRadius_extrema_pos |
| 107 | (H : SingularTimeAssumptions F T M) (P04 : RicciFlowCurvatureTheory.{u}) |
| 108 | {A : Set (H.regularRegion P04)} (hA : IsCompact A) (hne : A.Nonempty) |
| 109 | (hpos : ∀ x ∈ A, 0 < (H.terminalConnection P04).scalarCurvature x) : |
| 110 | 0 < sSup (range (fun x : A => |
| 111 | (H.terminalConnection P04).scalarCurvature x ^ (-1 / 2 : ℝ))) ∧ |
| 112 | 0 < sInf (range (fun x : A => |
| 113 | (H.terminalConnection P04).scalarCurvature x ^ (-1 / 2 : ℝ))) := by |
| 114 | let _ : Nonempty A := nonempty_subtype.mpr hne |
| 115 | have hcontinuous := (H.terminalConnection P04).continuous_scalarCurvature.continuousOn.rpow_const |
| 116 | (p := (-1 / 2 : ℝ)) (fun x hx => Or.inl (hpos x hx).ne') |
| 117 | have hbounded : BddAbove (range (fun x : A => |
| 118 | (H.terminalConnection P04).scalarCurvature x ^ (-1 / 2 : ℝ))) := by |
| 119 | apply (hA.bddAbove_image hcontinuous).mono |
| 120 | rintro _ ⟨x, rfl⟩ |
| 121 | exact ⟨x, x.property, rfl⟩ |
| 122 | obtain ⟨a, ha, hbound⟩ := hA.exists_forall_le' hcontinuous |
| 123 | (fun x hx => Real.rpow_pos_of_pos (hpos x hx) (-1 / 2)) |
| 124 | obtain ⟨x, hx⟩ := hne |
| 125 | constructor |
| 126 | · exact (Real.rpow_pos_of_pos (hpos x hx) (-1 / 2)).trans_le |
| 127 | (le_csSup hbounded ⟨⟨x, hx⟩, rfl⟩) |
| 128 | · apply ha.trans_le |
| 129 | apply le_csInf (range_nonempty _) |
| 130 | rintro _ ⟨z, rfl⟩ |
| 131 | exact hbound z z.property |
| 132 | |
| 133 | end PoincareMT.SingularTimeAssumptions |