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.Soliton.ThreeDimensional.Noncompact.Rigidity.ScalarFlow |
| 2 | |
| 3 | /-! |
| 4 | # Escape and strict scalar growth on high gradient trajectories |
| 5 | |
| 6 | Above the regular tail the potential grows at least linearly in gradient |
| 7 | flow time. Compact metric balls therefore cannot contain a tail of the |
| 8 | trajectory. Positive Ricci curvature makes scalar curvature strictly increase. |
| 9 | -/ |
| 10 | |
| 11 | noncomputable section |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | open Set Filter |
| 16 | open scoped Manifold ContDiff Bundle Topology |
| 17 | |
| 18 | namespace PoincareMT.GradientShrinkingSolitonData |
| 19 | |
| 20 | variable {M : Type*} [TopologicalSpace M] |
| 21 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 22 | [MeasurableSpace M] [BorelSpace M] [T2Space M] [T3Space M] |
| 23 | [SecondCountableTopology M] [ConnectedSpace M] |
| 24 | |
| 25 | theorem hasDerivAt_potential_along_gradient_flow |
| 26 | (S : GradientShrinkingSolitonData 3 M) |
| 27 | {γ : ℝ → M} (hγ : IsMIntegralCurve γ (S.connection.gradient S.potential)) (t : ℝ) : |
| 28 | HasDerivAt (S.potential ∘ γ) |
| 29 | (S.metric.inner (γ t) (S.connection.gradient S.potential (γ t)) |
| 30 | (S.connection.gradient S.potential (γ t))) t := by |
| 31 | have h := RiemannianMetric.hasDerivAt_comp_integralCurve S.potential_contMDiff hγ t |
| 32 | rw [S.connection.inner_gradient] |
| 33 | exact h |
| 34 | |
| 35 | theorem potential_monotone_on_gradient_flow |
| 36 | (S : GradientShrinkingSolitonData 3 M) |
| 37 | {γ : ℝ → M} (hγ : IsMIntegralCurve γ (S.connection.gradient S.potential)) : |
| 38 | Monotone (S.potential ∘ γ) := by |
| 39 | apply monotone_of_hasDerivAt_nonneg (S.hasDerivAt_potential_along_gradient_flow hγ) |
| 40 | intro t |
| 41 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 42 | ⟨S.metric.toRiemannianMetric⟩ |
| 43 | change 0 ≤ inner ℝ (S.connection.gradient S.potential (γ t)) |
| 44 | (S.connection.gradient S.potential (γ t)) |
| 45 | exact real_inner_self_nonneg |
| 46 | |
| 47 | /-- Starting in a high superlevel, forward gradient time gives a linear |
| 48 | lower bound for the original potential. -/ |
| 49 | theorem potential_linear_growth_on_forward_gradient_curve |
| 50 | (S : GradientShrinkingSolitonData 3 M) {a : ℝ} |
| 51 | (ha : ∀ x : M, a ≤ S.potential x → 1 ≤ |
| 52 | S.metric.inner x (S.connection.gradient S.potential x) |
| 53 | (S.connection.gradient S.potential x)) |
| 54 | {γ : ℝ → M} (hγ : IsMIntegralCurve γ (S.connection.gradient S.potential)) |
| 55 | (hstart : a ≤ S.potential (γ 0)) (t : ℝ) (ht : 0 ≤ t) : |
| 56 | S.potential (γ 0) + t ≤ S.potential (γ t) := by |
| 57 | have hd : Differentiable ℝ (S.potential ∘ γ) := |
| 58 | fun s => (S.hasDerivAt_potential_along_gradient_flow hγ s).differentiableAt |
| 59 | have hbound := (convex_Ici (0 : ℝ)).mul_sub_le_image_sub_of_le_deriv |
| 60 | hd.continuous.continuousOn hd.differentiableOn |
| 61 | (C := (1 : ℝ)) (fun s hs => by |
| 62 | rw [(S.hasDerivAt_potential_along_gradient_flow hγ s).deriv] |
| 63 | exact ha _ (hstart.trans (S.potential_monotone_on_gradient_flow hγ (interior_subset hs)))) |
| 64 | 0 (by simp) t ht ht |
| 65 | dsimp only [Function.comp_def] at hbound |
| 66 | linarith |
| 67 | |
| 68 | /-- Integer points on a high forward gradient trajectory escape every |
| 69 | bounded ball in the original complete metric. -/ |
| 70 | theorem forward_gradient_curve_centers_escape |
| 71 | (S : GradientShrinkingSolitonData 3 M) {a : ℝ} |
| 72 | (ha : ∀ x : M, a ≤ S.potential x → 1 ≤ |
| 73 | S.metric.inner x (S.connection.gradient S.potential x) |
| 74 | (S.connection.gradient S.potential x)) |
| 75 | {γ : ℝ → M} (hγ : IsMIntegralCurve γ (S.connection.gradient S.potential)) |
| 76 | (hstart : a ≤ S.potential (γ 0)) (p : M) : |
| 77 | Tendsto (fun k : ℕ => (S.metric.edist p (γ k)).toReal) atTop atTop := by |
| 78 | apply tendsto_atTop.mpr |
| 79 | intro R |
| 80 | let K := {x : M | S.metric.edist p x ≤ ENNReal.ofReal R} |
| 81 | have hK : IsCompact K := S.metric.isCompact_closedBall_of_metricComplete S.complete p R |
| 82 | obtain ⟨B, hB⟩ := hK.bddAbove_image S.potential_C2.continuous.continuousOn |
| 83 | filter_upwards [(tendsto_natCast_atTop_atTop (R := ℝ)).eventually_gt_atTop |
| 84 | (B - S.potential (γ 0))] with k hk |
| 85 | by_contra hnot |
| 86 | have hmem : γ (k : ℝ) ∈ K := by |
| 87 | change S.metric.edist p (γ (k : ℝ)) ≤ ENNReal.ofReal R |
| 88 | rw [← ENNReal.ofReal_toReal (S.metric.edist_ne_top _ _)] |
| 89 | exact ENNReal.ofReal_le_ofReal (lt_of_not_ge hnot).le |
| 90 | have hupper := hB (mem_image_of_mem _ hmem) |
| 91 | have hlower := S.potential_linear_growth_on_forward_gradient_curve ha hγ hstart |
| 92 | (k : ℝ) (Nat.cast_nonneg k) |
| 93 | linarith |
| 94 | |
| 95 | /-- Positive Ricci curvature gives strict scalar growth along every forward |
| 96 | gradient trajectory that starts above the gradient threshold. -/ |
| 97 | theorem scalar_strictMonoOn_forward_gradient_curve |
| 98 | (S : GradientShrinkingSolitonData 3 M) |
| 99 | (hD : S.connection.CurvatureTensorCalculus) |
| 100 | (hRic : ∀ x : M, ∀ v : TangentSpace (𝓡 3) x, v ≠ 0 → |
| 101 | 0 < S.connection.ricci x v v) |
| 102 | {a : ℝ} (ha : ∀ x : M, a ≤ S.potential x → 1 ≤ |
| 103 | S.metric.inner x (S.connection.gradient S.potential x) |
| 104 | (S.connection.gradient S.potential x)) |
| 105 | {γ : ℝ → M} (hγ : IsMIntegralCurve γ (S.connection.gradient S.potential)) |
| 106 | (hstart : a ≤ S.potential (γ 0)) : |
| 107 | StrictMonoOn (fun t => S.connection.scalarCurvature (γ t)) (Ici 0) := by |
| 108 | have hd := S.hasDerivAt_scalar_along_gradient_flow hD hγ |
| 109 | apply strictMonoOn_of_deriv_pos (convex_Ici (0 : ℝ)) |
| 110 | ((continuous_iff_continuousAt.mpr fun t => (hd t).continuousAt).continuousOn) |
| 111 | intro t ht |
| 112 | rw [(hd t).deriv] |
| 113 | apply mul_pos (by norm_num) |
| 114 | apply hRic |
| 115 | intro hzero |
| 116 | have hg := ha _ (hstart.trans (S.potential_monotone_on_gradient_flow hγ |
| 117 | (show 0 ≤ t from interior_subset ht))) |
| 118 | simp [hzero] at hg |
| 119 | norm_num at hg |
| 120 | |
| 121 | /-- Subsequence control of scalar curvature at infinity gives a strict |
| 122 | scalar upper bound on a high superlevel when Ricci is positive. -/ |
| 123 | theorem exists_threshold_scalar_lt_of_escaping_subsequence |
| 124 | (S : GradientShrinkingSolitonData 3 M) |
| 125 | (hD : S.connection.CurvatureTensorCalculus) |
| 126 | (hRic : ∀ x : M, ∀ v : TangentSpace (𝓡 3) x, v ≠ 0 → |
| 127 | 0 < S.connection.ricci x v v) |
| 128 | (p : M) {c : ℝ} |
| 129 | (hlimit : ∀ q : ℕ → M, |
| 130 | Tendsto (fun k => (S.metric.edist p (q k)).toReal) atTop atTop → |
| 131 | ∃ r : ℕ → ℕ, StrictMono r ∧ |
| 132 | Tendsto (fun k => S.connection.scalarCurvature (q (r k))) atTop (𝓝 c)) : |
| 133 | ∃ a : ℝ, ∀ x : M, a ≤ S.potential x → S.connection.scalarCurvature x < c := by |
| 134 | obtain ⟨a, ha⟩ := S.exists_gradient_sq_gt_on_superlevel hD 1 |
| 135 | obtain ⟨C, hC, hess⟩ := S.exists_hessian_quadratic_bound |
| 136 | obtain ⟨Φ, h0, hΦ, -, -⟩ := |
| 137 | S.connection.exists_complete_gradientFlow_of_bounded_hessian S.complete |
| 138 | S.potential_contMDiff hC hess |
| 139 | refine ⟨a, fun x hx => ?_⟩ |
| 140 | have hstart : a ≤ S.potential (Φ 0 x) := by rwa [h0 x] |
| 141 | have hescape := S.forward_gradient_curve_centers_escape |
| 142 | (fun y hy => (ha y hy).le) (hΦ x) hstart p |
| 143 | obtain ⟨r, hr, hlim⟩ := hlimit (fun k => Φ (k : ℝ) x) hescape |
| 144 | have hmono := S.scalar_monotone_on_gradient_flow hD (hΦ x) |
| 145 | (fun y v => (S.connection.ricci_bounds_of_nonnegative_curvatureOperator |
| 146 | hD y (S.nonnegative_curvature y) v).1) |
| 147 | have hle : S.connection.scalarCurvature (Φ 1 x) ≤ c := by |
| 148 | apply le_of_tendsto_of_tendsto tendsto_const_nhds hlim |
| 149 | filter_upwards [hr.tendsto_atTop.eventually_ge_atTop 1] with k hk |
| 150 | exact hmono (by exact_mod_cast hk) |
| 151 | have hstrict := S.scalar_strictMonoOn_forward_gradient_curve hD hRic |
| 152 | (fun y hy => (ha y hy).le) (hΦ x) hstart |
| 153 | (show (0 : ℝ) ∈ Ici 0 by norm_num) (show (1 : ℝ) ∈ Ici 0 by norm_num) |
| 154 | (show (0 : ℝ) < 1 by norm_num) |
| 155 | dsimp only at hstrict |
| 156 | rw [h0 x] at hstrict |
| 157 | exact hstrict.trans_le hle |
| 158 | |
| 159 | end PoincareMT.GradientShrinkingSolitonData |