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.Harnack.Noncompact.CurvatureControl.Distance.FiniteCutoff |
| 2 | import PoincareLib.Geometry.RicciFlow.Harnack.Noncompact.CurvatureControl.ScalarContact |
| 3 | |
| 4 | /-! # Finite-distance scalar contact |
| 5 | |
| 6 | The distance-localized scalar lower support is valid on a selected finite |
| 7 | metric component of a disconnected manifold. The center case is handled by |
| 8 | the flat profile, while noncentral points use the finite Calabi support. |
| 9 | -/ |
| 10 | |
| 11 | noncomputable section |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | set_option maxHeartbeats 800000 |
| 15 | |
| 16 | open Set Filter |
| 17 | open scoped Manifold ContDiff Topology Bundle |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.RicciFlow |
| 22 | |
| 23 | variable {m : ℕ} {M : Type u} [TopologicalSpace M] [T3Space M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin (m + 1))) M] |
| 25 | [IsManifold (𝓡 (m + 1)) ∞ M] {J : Set ℝ} |
| 26 | |
| 27 | /-- A finite-distance scalar contact away from the cutoff center has a lower |
| 28 | time support satisfying the localized scalar differential inequality. -/ |
| 29 | theorem exists_lower_time_support_distance_cutoff_scalarCurvature_of_finite |
| 30 | (hTheory : RicciFlowCurvatureTheory.{u}) (F : RicciFlow (m + 1) M J) |
| 31 | {a t r Λ scale δ d₀ A B C Q : ℝ} (ht : t ∈ interior J) (hm : 0 < m) |
| 32 | (hcomplete : MetricComplete (F.metric t)) |
| 33 | (hRic : ∀ y : M, ∀ w : TangentSpace (𝓡 (m + 1)) y, |
| 34 | 0 ≤ (F.connection t).ricci y w w) |
| 35 | (hΛ : 0 ≤ Λ) (hscale : 0 < scale) (p x : M) |
| 36 | (hx : x ∈ (F.metric t).ball p r) (hpx : p ≠ x) |
| 37 | (hupper : ∀ y ∈ (F.metric t).ball p r, ∀ w : TangentSpace (𝓡 (m + 1)) y, |
| 38 | (F.connection t).ricci y w w ≤ Λ * (F.metric t).inner y w w) |
| 39 | (hRicpast : ∀ s ∈ Icc a t, ∀ w : TangentSpace (𝓡 (m + 1)) x, |
| 40 | 0 ≤ (F.connection s).ricci x w w) |
| 41 | {χ : ℝ → ℝ} (hχ : ContDiff ℝ ∞ χ) (hanti : Antitone χ) |
| 42 | (hχnonneg : ∀ z, 0 ≤ χ z) (hδ : 0 < δ) |
| 43 | (hflat : ∀ z, z ≤ 1 → χ z = 1) (hd₀ : 0 ≤ d₀) |
| 44 | (hA₀ : 0 ≤ A) (hB₀ : 0 ≤ B) (hC₀ : 0 ≤ C) |
| 45 | (hA : ∀ z, deriv χ z ^ 2 ≤ A * χ z) |
| 46 | (hB : ∀ z, -B ≤ deriv (deriv χ) z) (hC : ∀ z, -C ≤ deriv χ z) |
| 47 | (hQ : (F.connection t).scalarCurvature x ≤ Q) |
| 48 | (hpos : 0 < χ ((((F.metric t).edist p x).toReal - d₀) / δ) * |
| 49 | (F.connection t).scalarCurvature x) |
| 50 | (hmax : IsLocalMax (fun y => |
| 51 | χ ((((F.metric t).edist p y).toReal - d₀) / δ) * |
| 52 | (F.connection t).scalarCurvature y) x) : |
| 53 | ∃ (v : ℝ → ℝ) (d : ℝ), |
| 54 | v t = χ ((((F.metric t).edist p x).toReal - d₀) / δ) * |
| 55 | (F.connection t).scalarCurvature x ∧ |
| 56 | (∀ᶠ s in 𝓝[Icc a t] t, |
| 57 | v s ≤ χ ((((F.metric s).edist p x).toReal - d₀) / δ) * |
| 58 | (F.connection s).scalarCurvature x) ∧ |
| 59 | HasDerivAt v d t ∧ |
| 60 | d ≤ 2 * Q * (χ ((((F.metric t).edist p x).toReal - d₀) / δ) * |
| 61 | (F.connection t).scalarCurvature x) + |
| 62 | Q * (C * (4 * ((m + 1 : ℕ) : ℝ) * scale + 8 * Λ / scale) / δ + |
| 63 | (B + 2 * A + 2 * (m : ℝ) * C) / δ ^ 2) := by |
| 64 | have hcutoffpos : 0 < χ ((((F.metric t).edist p x).toReal - d₀) / δ) := |
| 65 | lt_of_le_of_ne (hχnonneg _) (by |
| 66 | intro hz |
| 67 | rw [← hz, zero_mul] at hpos |
| 68 | exact (lt_irrefl 0) hpos) |
| 69 | obtain ⟨U, φ, hU, hxU, hφ, heq, hle, hφtime, hheat⟩ := |
| 70 | F.exists_distance_cutoff_lower_support_of_flat_finite ht hm hcomplete hRic hΛ hscale |
| 71 | p x hx hpx (ne_top_of_lt hx) hupper hχ hanti hδ hflat hd₀ hA hB hC hcutoffpos |
| 72 | have hRnow (y : M) : 0 ≤ (F.connection t).scalarCurvature y := |
| 73 | Finset.sum_nonneg (fun _ _ => hRic y _) |
| 74 | have hRpast (s : ℝ) (hs : s ∈ Icc a t) : 0 ≤ (F.connection s).scalarCurvature x := |
| 75 | Finset.sum_nonneg (fun _ _ => hRicpast s hs _) |
| 76 | have hlocal : IsLocalMax |
| 77 | (fun y => φ t y * (F.connection t).scalarCurvature y) x := by |
| 78 | filter_upwards [hU.mem_nhds hxU, hmax] with y hy hmy |
| 79 | calc |
| 80 | φ t y * (F.connection t).scalarCurvature y ≤ |
| 81 | χ ((((F.metric t).edist p y).toReal - d₀) / δ) * |
| 82 | (F.connection t).scalarCurvature y := |
| 83 | mul_le_mul_of_nonneg_right (hle t y hy) (hRnow y) |
| 84 | _ ≤ χ ((((F.metric t).edist p x).toReal - d₀) / δ) * |
| 85 | (F.connection t).scalarCurvature x := hmy |
| 86 | _ = φ t x * (F.connection t).scalarCurvature x := by rw [heq] |
| 87 | have hRtime := (hTheory.scalar_evolution (m + 1) M J F t (interior_subset ht) x).hasDerivAt |
| 88 | (mem_interior_iff_mem_nhds.mp ht) |
| 89 | let v : ℝ → ℝ := fun s => φ s x * (F.connection s).scalarCurvature x |
| 90 | have hv : DifferentiableAt ℝ v t := hφtime.mul hRtime.differentiableAt |
| 91 | refine ⟨v, deriv v t, by simp only [v, heq], ?_, hv.hasDerivAt, ?_⟩ |
| 92 | · filter_upwards [self_mem_nhdsWithin] with s hs |
| 93 | exact mul_le_mul_of_nonneg_right (hle s x hxU) (hRpast s hs) |
| 94 | · have hb := F.deriv_cutoff_mul_scalarCurvature_le_linear_at_max_on_open |
| 95 | hTheory ht x φ hU hxU hφ hφtime (by simpa only [heq] using hcutoffpos) |
| 96 | (hRic x) hlocal hQ (by positivity) hheat |
| 97 | simpa only [v, heq] using hb |
| 98 | |
| 99 | /-- The flat cutoff includes the center in the finite-distance scalar |
| 100 | contact inequality. -/ |
| 101 | theorem exists_lower_time_support_distance_cutoff_scalarCurvature_all_points_of_finite |
| 102 | (hTheory : RicciFlowCurvatureTheory.{u}) (F : RicciFlow (m + 1) M J) |
| 103 | {a t r Λ scale δ d₀ A B C Q : ℝ} (ht : t ∈ interior J) (hm : 0 < m) |
| 104 | (hcomplete : MetricComplete (F.metric t)) |
| 105 | (hRic : ∀ y : M, ∀ w : TangentSpace (𝓡 (m + 1)) y, |
| 106 | 0 ≤ (F.connection t).ricci y w w) |
| 107 | (hΛ : 0 ≤ Λ) (hscale : 0 < scale) (p x : M) |
| 108 | (hx : x ∈ (F.metric t).ball p r) |
| 109 | (hupper : ∀ y ∈ (F.metric t).ball p r, ∀ w : TangentSpace (𝓡 (m + 1)) y, |
| 110 | (F.connection t).ricci y w w ≤ Λ * (F.metric t).inner y w w) |
| 111 | (hRicpast : ∀ s ∈ Icc a t, ∀ w : TangentSpace (𝓡 (m + 1)) x, |
| 112 | 0 ≤ (F.connection s).ricci x w w) |
| 113 | {χ : ℝ → ℝ} (hχ : ContDiff ℝ ∞ χ) (hanti : Antitone χ) |
| 114 | (hχnonneg : ∀ z, 0 ≤ χ z) (hδ : 0 < δ) |
| 115 | (hflat : ∀ z, z ≤ 1 → χ z = 1) (hd₀ : 0 ≤ d₀) |
| 116 | (hA₀ : 0 ≤ A) (hB₀ : 0 ≤ B) (hC₀ : 0 ≤ C) |
| 117 | (hA : ∀ z, deriv χ z ^ 2 ≤ A * χ z) |
| 118 | (hB : ∀ z, -B ≤ deriv (deriv χ) z) (hC : ∀ z, -C ≤ deriv χ z) |
| 119 | (hQ : (F.connection t).scalarCurvature x ≤ Q) |
| 120 | (hpos : 0 < χ ((((F.metric t).edist p x).toReal - d₀) / δ) * |
| 121 | (F.connection t).scalarCurvature x) |
| 122 | (hmax : IsLocalMax (fun y => |
| 123 | χ ((((F.metric t).edist p y).toReal - d₀) / δ) * |
| 124 | (F.connection t).scalarCurvature y) x) : |
| 125 | ∃ (v : ℝ → ℝ) (d : ℝ), |
| 126 | v t = χ ((((F.metric t).edist p x).toReal - d₀) / δ) * |
| 127 | (F.connection t).scalarCurvature x ∧ |
| 128 | (∀ᶠ s in 𝓝[Icc a t] t, |
| 129 | v s ≤ χ ((((F.metric s).edist p x).toReal - d₀) / δ) * |
| 130 | (F.connection s).scalarCurvature x) ∧ |
| 131 | HasDerivAt v d t ∧ |
| 132 | d ≤ 2 * Q * (χ ((((F.metric t).edist p x).toReal - d₀) / δ) * |
| 133 | (F.connection t).scalarCurvature x) + |
| 134 | Q * (C * (4 * ((m + 1 : ℕ) : ℝ) * scale + 8 * Λ / scale) / δ + |
| 135 | (B + 2 * A + 2 * (m : ℝ) * C) / δ ^ 2) := by |
| 136 | by_cases hpx : p = x |
| 137 | · subst x |
| 138 | have hself (s : ℝ) : ((F.metric s).edist p p).toReal = 0 := by |
| 139 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 (m + 1)) : M → Type _) := |
| 140 | ⟨(F.metric s).toRiemannianMetric⟩ |
| 141 | change (Manifold.riemannianEDist (𝓡 (m + 1)) p p).toReal = 0 |
| 142 | simp only [Manifold.riemannianEDist_self, ENNReal.toReal_zero] |
| 143 | have hcenter (s : ℝ) : χ ((((F.metric s).edist p p).toReal - d₀) / δ) = 1 := by |
| 144 | apply hflat |
| 145 | rw [hself] |
| 146 | exact (div_le_one hδ).mpr (by linarith) |
| 147 | have hnear : ∀ᶠ y in 𝓝 p, ((F.metric t).edist p y).toReal < δ := by |
| 148 | exact (PoincareMT.RiemannianMetric.continuousAt_toReal_edist_of_ne_top |
| 149 | (F.metric t) p p (by |
| 150 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 (m + 1)) : M → Type _) := |
| 151 | ⟨(F.metric t).toRiemannianMetric⟩ |
| 152 | change (Manifold.riemannianEDist (𝓡 (m + 1)) p p) ≠ ⊤ |
| 153 | rw [Manifold.riemannianEDist_self] |
| 154 | exact ENNReal.zero_ne_top)).eventually |
| 155 | (eventually_lt_nhds (by simpa only [hself] using hδ)) |
| 156 | have hlocal : IsLocalMax (F.connection t).scalarCurvature p := by |
| 157 | apply hmax.congr |
| 158 | filter_upwards [hnear] with y hy |
| 159 | rw [hflat _ ((div_le_one hδ).mpr (by linarith)), one_mul] |
| 160 | have hRnonneg : 0 ≤ (F.connection t).scalarCurvature p := |
| 161 | Finset.sum_nonneg (fun _ _ => hRic p _) |
| 162 | have hQnonneg : 0 ≤ Q := hRnonneg.trans hQ |
| 163 | have hRtime := (hTheory.scalar_evolution (m + 1) M J F t (interior_subset ht) p).hasDerivAt |
| 164 | (mem_interior_iff_mem_nhds.mp ht) |
| 165 | have hlap := (F.connection t).laplacian_nonpos_of_isLocalMax |
| 166 | (hTheory.tensor_calculus (m + 1) M (F.metric t) (F.connection t)).contMDiff_scalarCurvature |
| 167 | hlocal |
| 168 | have hderiv := F.deriv_scalarCurvature_le_laplacian_add_sq_of_ricci_nonneg |
| 169 | hTheory ht p (hRic p) |
| 170 | have hreaction := mul_le_mul_of_nonneg_right hQ hRnonneg |
| 171 | refine ⟨fun s => (F.connection s).scalarCurvature p, |
| 172 | deriv (fun s => (F.connection s).scalarCurvature p) t, |
| 173 | by rw [hcenter, one_mul], ?_, hRtime.differentiableAt.hasDerivAt, ?_⟩ |
| 174 | · filter_upwards [] with s |
| 175 | rw [hcenter, one_mul] |
| 176 | · rw [hcenter, one_mul] |
| 177 | have hheat : 0 ≤ Q * |
| 178 | (C * (4 * ((m + 1 : ℕ) : ℝ) * scale + 8 * Λ / scale) / δ + |
| 179 | (B + 2 * A + 2 * (m : ℝ) * C) / δ ^ 2) := by positivity |
| 180 | nlinarith only [hderiv, hlap, hreaction, hheat] |
| 181 | · exact F.exists_lower_time_support_distance_cutoff_scalarCurvature_of_finite |
| 182 | hTheory ht hm hcomplete hRic hΛ hscale p x hx hpx hupper hRicpast |
| 183 | hχ hanti hχnonneg hδ hflat hd₀ hA₀ hB₀ hC₀ hA hB hC hQ hpos hmax |
| 184 | |
| 185 | end PoincareMT.RicciFlow |