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.Positivity.Scalar.ChartBarrier |
| 2 | import PoincareLib.Geometry.RicciFlow.Positivity.Scalar.LocalBarrier |
| 3 | import PoincareLib.Geometry.RicciFlow.Positivity.Scalar.ConnectedPropagation |
| 4 | |
| 5 | /-! Adapted from Mapher06/Poincare-MorganTian, `PoincareMT/Proofs/M04/ScalarStrongMaximum.lean`, |
| 6 | revision `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. See the curvature import record under |
| 7 | `references/ricci-flow/mapher/curvature/`. -/ |
| 8 | |
| 9 | /-! |
| 10 | # Local positive transfer for scalar heat supersolutions |
| 11 | |
| 12 | A positive seed expands inside a compact chart ball using the actual |
| 13 | time-dependent Laplacian and the reviewed smooth barrier comparison. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | |
| 18 | open scoped Manifold ContDiff Bundle |
| 19 | open Set Topology Filter Metric |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.RicciFlowAnalysis |
| 24 | |
| 25 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 27 | |
| 28 | set_option maxHeartbeats 1200000 in |
| 29 | -- The moving barrier and compact-domain comparison need extra elaboration. |
| 30 | set_option backward.isDefEq.respectTransparency false in |
| 31 | theorem ricciFlow_local_positive_transfer [T2Space M] |
| 32 | {J : Set ℝ} {a b : ℝ} (hab : a < b) (F : RicciFlow n M J) |
| 33 | (hJ : Icc a b ⊆ J) (f v : ℝ → M → ℝ) |
| 34 | (hf : ContinuousOn (Function.uncurry f) (Icc a b ×ˢ univ)) |
| 35 | (hderiv : ∀ t ∈ Icc a b, ∀ x : M, |
| 36 | HasDerivWithinAt (fun s ↦ f s x) (v t x) (Icc a b) t) |
| 37 | (hsmooth : ∀ t ∈ Icc a b, ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ (f t)) |
| 38 | (hnonneg : ∀ t ∈ Icc a b, ∀ x : M, 0 ≤ f t x) |
| 39 | (hevol : ∀ t ∈ Ioc a b, ∀ x : M, |
| 40 | (F.connection t).laplacian (f t) x ≤ v t x) |
| 41 | (p : M) : |
| 42 | ∃ U : Set M, IsOpen U ∧ p ∈ U ∧ |
| 43 | ∀ s t : ℝ, a ≤ s → s < t → t ≤ b → ∀ y ∈ U, ∀ z ∈ U, |
| 44 | 0 < f s y → 0 < f t z := by |
| 45 | let E := EuclideanSpace ℝ (Fin n) |
| 46 | let e := extChartAt (𝓡 n) p |
| 47 | obtain ⟨rho, hrho, htarget⟩ := Metric.mem_nhds_iff.mp |
| 48 | ((isOpen_extChartAt_target (I := 𝓡 n) p).mem_nhds (mem_extChartAt_target p)) |
| 49 | let R : ℝ := rho / 4 |
| 50 | have hR : 0 < R := by dsimp [R]; positivity |
| 51 | have hball : closedBall (e p) (3 * R) ⊆ e.target := |
| 52 | (closedBall_subset_ball (by dsimp [R]; linarith)).trans htarget |
| 53 | let U : Set M := e.source ∩ e ⁻¹' ball (e p) (R / 4) |
| 54 | have hU : IsOpen U := |
| 55 | (continuousOn_extChartAt p).isOpen_inter_preimage |
| 56 | (isOpen_extChartAt_source p) isOpen_ball |
| 57 | refine ⟨U, hU, ⟨mem_extChartAt_source p, mem_ball_self (by positivity)⟩, ?_⟩ |
| 58 | intro s t has hst htb y hy z hz hpositive |
| 59 | have hyS : y ∈ e.source := hy.1 |
| 60 | have hzS : z ∈ e.source := hz.1 |
| 61 | have hyR : dist (e y) (e p) < R / 4 := hy.2 |
| 62 | have hzR : dist (e z) (e p) < R / 4 := hz.2 |
| 63 | have hzy : ‖e z - e y‖ < R / 2 := by |
| 64 | have h := dist_triangle (e z) (e p) (e y) |
| 65 | rw [dist_comm (e p) (e y)] at h |
| 66 | have hd : dist (e z) (e y) < R / 2 := by linarith |
| 67 | simpa only [dist_eq_norm] using hd |
| 68 | have hballY : closedBall (e y) R ⊆ e.target := |
| 69 | (closedBall_subset_closedBall' (by linarith : R + dist (e y) (e p) ≤ 3 * R)).trans hball |
| 70 | let C : Set M := e.symm '' closedBall (e y) R |
| 71 | obtain ⟨hC, hCU, hmem, hinterior⟩ := chart_closedBall_properties p (e y) hR hballY |
| 72 | have hzC : z ∈ C := (hmem z hzS).2 (by linarith) |
| 73 | have hstI : Icc s t ⊆ Icc a b := Icc_subset_Icc has htb |
| 74 | have hs : s ∈ Icc a b := hstI ⟨le_rfl, hst.le⟩ |
| 75 | let epsilon : ℝ := f s y / 2 |
| 76 | have hepsilon : 0 < epsilon := by dsimp [epsilon]; positivity |
| 77 | have hcont : ContinuousAt (fun w : E ↦ f s (e.symm w)) (e y) := |
| 78 | (hsmooth s hs).continuous.continuousAt.comp (continuousAt_extChartAt_symm' hyS) |
| 79 | have hseed : {w : E | epsilon < f s (e.symm w)} ∈ 𝓝 (e y) := by |
| 80 | apply hcont.preimage_mem_nhds |
| 81 | apply Ioi_mem_nhds |
| 82 | rw [e.left_inv hyS] |
| 83 | dsimp [epsilon] |
| 84 | linarith |
| 85 | obtain ⟨delta, hdelta, hseedBall⟩ := Metric.mem_nhds_iff.mp hseed |
| 86 | let r : ℝ := min (R / 4) (delta / 2) |
| 87 | have hr : 0 < r := lt_min (by positivity) (by positivity) |
| 88 | have hrR : r < R / 2 := by |
| 89 | have h : r ≤ R / 4 := min_le_left _ _ |
| 90 | linarith |
| 91 | have hrdelta : r < delta := by |
| 92 | have h : r ≤ delta / 2 := min_le_right _ _ |
| 93 | linarith |
| 94 | have hrsq : r ^ 2 < (R / 2) ^ 2 := (sq_lt_sq₀ hr.le (by positivity)).2 hrR |
| 95 | let q : M → ℝ := fun x ↦ r ^ 2 - ‖e x - e y‖ ^ 2 |
| 96 | let speed : ℝ := ((R / 2) ^ 2 - r ^ 2) / (t - s) |
| 97 | have hspeed : 0 < speed := div_pos (sub_pos.mpr hrsq) (sub_pos.mpr hst) |
| 98 | have hspeedEnd : speed * (t - s) = (R / 2) ^ 2 - r ^ 2 := |
| 99 | div_mul_cancel₀ _ (sub_ne_zero.mpr hst.ne') |
| 100 | have hq : ContMDiffOn (𝓡 n) 𝓘(ℝ, ℝ) ∞ q e.source := |
| 101 | contMDiffOn_chart_radial p (e y) r |
| 102 | have hcritical : ∀ tau ∈ Icc s t, ∀ x ∈ C, |
| 103 | q x + speed * (tau - s) = 0 → mfderiv (𝓡 n) 𝓘(ℝ, ℝ) q x ≠ 0 := by |
| 104 | intro tau htau x hx hzero |
| 105 | apply mfderiv_chart_radial_ne_zero p (e y) r (hCU hx) |
| 106 | intro heq |
| 107 | change e x = e y at heq |
| 108 | have hqx : q x = r ^ 2 := by simp [q, heq] |
| 109 | rw [hqx] at hzero |
| 110 | have hmul : 0 ≤ speed * (tau - s) := mul_nonneg hspeed.le (sub_nonneg.mpr htau.1) |
| 111 | nlinarith [sq_pos_of_pos hr] |
| 112 | have hboundary : ∀ tau ∈ Icc s t, ∀ x ∈ C \ interior C, |
| 113 | q x + speed * (tau - s) ≤ 0 := by |
| 114 | intro tau htau x hx |
| 115 | have hnorm : ‖e x - e y‖ = R := le_antisymm ((hmem x (hCU hx.1)).mp hx.1) |
| 116 | (le_of_not_gt (fun hlt ↦ hx.2 (hinterior x (hCU hx.1) hlt))) |
| 117 | have hmul : speed * (tau - s) ≤ speed * (t - s) := |
| 118 | mul_le_mul_of_nonneg_left (by linarith [htau.2]) hspeed.le |
| 119 | change r ^ 2 - ‖e x - e y‖ ^ 2 + speed * (tau - s) ≤ 0 |
| 120 | rw [hnorm] |
| 121 | nlinarith [sq_nonneg R] |
| 122 | have hinit : ∀ x ∈ C, epsilon * expNegInvGlue (q x) ≤ f s x := by |
| 123 | intro x hx |
| 124 | by_cases hqx : q x ≤ 0 |
| 125 | · rw [expNegInvGlue.zero_of_nonpos hqx, mul_zero] |
| 126 | exact hnonneg s hs x |
| 127 | · have hpos : 0 < q x := lt_of_not_ge hqx |
| 128 | have hsq : ‖e x - e y‖ ^ 2 < r ^ 2 := by |
| 129 | dsimp [q] at hpos |
| 130 | linarith |
| 131 | have hnorm : ‖e x - e y‖ < r := (sq_lt_sq₀ (norm_nonneg _) hr.le).mp hsq |
| 132 | have hseedx : epsilon ≤ f s x := by |
| 133 | have h := hseedBall (mem_ball_iff_norm.mpr (hnorm.trans hrdelta)) |
| 134 | change epsilon < f s (e.symm (e x)) at h |
| 135 | rw [e.left_inv (hCU hx)] at h |
| 136 | exact h.le |
| 137 | have hprofile : expNegInvGlue (q x) ≤ 1 := by |
| 138 | rw [expNegInvGlue, if_neg hqx] |
| 139 | exact Real.exp_le_one_iff.mpr (neg_nonpos.mpr (inv_nonneg.mpr hpos.le)) |
| 140 | calc |
| 141 | epsilon * expNegInvGlue (q x) ≤ epsilon * 1 := |
| 142 | mul_le_mul_of_nonneg_left hprofile hepsilon.le |
| 143 | _ = epsilon := mul_one _ |
| 144 | _ ≤ f s x := hseedx |
| 145 | obtain ⟨A, _, hbar⟩ := ricciFlow_compactDomain_moving_barrier hst F (hstI.trans hJ) |
| 146 | (isOpen_extChartAt_source p) hC hCU hq hcritical f v |
| 147 | (hf.mono (prod_mono hstI (subset_univ C))) |
| 148 | (fun tau htau x _ ↦ (hderiv tau (hstI htau) x).mono hstI) |
| 149 | (fun tau htau ↦ (hsmooth tau (hstI htau)).contMDiffOn) |
| 150 | (fun tau htau x _ ↦ hnonneg tau (hstI htau) x) |
| 151 | (fun tau htau x _ ↦ hevol tau ⟨has.trans_lt htau.1, htau.2.trans htb⟩ x) |
| 152 | hboundary |
| 153 | have hcomparison := hbar epsilon hepsilon.le hinit t ⟨hst.le, le_rfl⟩ z hzC |
| 154 | have hargument : 0 < q z + speed * (t - s) := by |
| 155 | have hsq : ‖e z - e y‖ ^ 2 < (R / 2) ^ 2 := |
| 156 | (sq_lt_sq₀ (norm_nonneg _) (by positivity)).2 hzy |
| 157 | dsimp [q] |
| 158 | linarith |
| 159 | exact (mul_pos (mul_pos hepsilon (Real.exp_pos _)) |
| 160 | (expNegInvGlue.pos_of_pos hargument)).trans_le hcomparison |
| 161 | |
| 162 | theorem ricciFlow_supersolution_positive_at_later_time [T2Space M] [ConnectedSpace M] |
| 163 | {J : Set ℝ} {a b : ℝ} (hab : a < b) (F : RicciFlow n M J) |
| 164 | (hJ : Icc a b ⊆ J) (f v : ℝ → M → ℝ) |
| 165 | (hf : ContinuousOn (Function.uncurry f) (Icc a b ×ˢ univ)) |
| 166 | (hderiv : ∀ t ∈ Icc a b, ∀ x : M, |
| 167 | HasDerivWithinAt (fun s ↦ f s x) (v t x) (Icc a b) t) |
| 168 | (hsmooth : ∀ t ∈ Icc a b, ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ (f t)) |
| 169 | (hnonneg : ∀ t ∈ Icc a b, ∀ x : M, 0 ≤ f t x) |
| 170 | (hevol : ∀ t ∈ Ioc a b, ∀ x : M, |
| 171 | (F.connection t).laplacian (f t) x ≤ v t x) |
| 172 | (p : M) (hp : 0 < f a p) : ∀ x : M, 0 < f b x := by |
| 173 | exact positive_everywhere_of_local_transfer hab f |
| 174 | (fun t ht ↦ (hsmooth t ht).continuous) |
| 175 | (ricciFlow_local_positive_transfer hab F hJ f v hf hderiv hsmooth hnonneg hevol) p hp |
| 176 | |
| 177 | end PoincareMT.RicciFlowAnalysis |
| 178 |