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.Generalized.ReducedGeometry.SourceNames.ReducedVolume |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Exponential.Jacobian.WeightedJacobian |
| 3 | import Mathlib.Analysis.Calculus.Deriv.MeanValue |
| 4 | |
| 5 | /-! |
| 6 | # Scalar weighted Jacobian calculus on positive intervals |
| 7 | |
| 8 | The actual tangential derivative and metric Jacobian evolution give |
| 9 | the logarithmic factor in Morgan-Tian Proposition 6.81, equations |
| 10 | 6.19-6.21, pp. 145-146. The scalar Laplacian bound makes it |
| 11 | nonpositive. The argument never divides by the Jacobian and also |
| 12 | covers dimension zero and a merely continuous terminal endpoint. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set Filter |
| 18 | open scoped Topology |
| 19 | |
| 20 | namespace PoincareMT.M14 |
| 21 | |
| 22 | /-- The square-time weighted Jacobian derivative follows from the |
| 23 | generic M10 product rule at dimension twice n, Proposition 6.81, |
| 24 | equations 6.19-6.21, pp. 145-146. -/ |
| 25 | theorem squareWeightedJacobian_hasDerivAt {n : ℕ} {a J : ℝ → ℝ} |
| 26 | {K R L s : ℝ} (hs : 0 < s) (ha : HasDerivAt a (-K / s ^ 2) s) |
| 27 | (hJ : HasDerivAt J (2 * s * J s * (R + L)) s) : |
| 28 | HasDerivAt (fun r => Real.rpow r (-(n : ℝ)) * Real.exp (-a r) * J r) |
| 29 | ((Real.rpow s (-(n : ℝ)) * Real.exp (-a s) * J s) * |
| 30 | (2 * s * (R + L) + K / s ^ 2 - (n : ℝ) / s)) s := by |
| 31 | have hJ' : HasDerivAt J (J s * (2 * s * R + 2 * s * L)) s := by |
| 32 | convert hJ using 1 |
| 33 | ring |
| 34 | have h := M10.weightedJacobian_hasDerivAt (n := 2 * n) hs ha hJ' |
| 35 | have hdim : -( ((2 * n : ℕ) : ℝ)) / 2 = -(n : ℝ) := by |
| 36 | push_cast |
| 37 | ring |
| 38 | rw [hdim] at h |
| 39 | apply h.congr_deriv |
| 40 | congr 1 |
| 41 | push_cast |
| 42 | ring |
| 43 | |
| 44 | /-- The actual regular Laplacian bound gives a nonpositive scalar |
| 45 | weighted-Jacobian derivative without assuming J is positive, |
| 46 | Proposition 6.81, pp. 145-146. -/ |
| 47 | theorem squareWeightedJacobian_deriv_nonpos {n : ℕ} {a J : ℝ → ℝ} |
| 48 | {K R L s : ℝ} (hs : 0 < s) (ha : HasDerivAt a (-K / s ^ 2) s) |
| 49 | (hJ : HasDerivAt J (2 * s * J s * (R + L)) s) (hJnonneg : 0 ≤ J s) |
| 50 | (hL : L ≤ (n : ℝ) / (2 * s ^ 2) - R - K / (2 * s ^ 3)) : |
| 51 | deriv (fun r => Real.rpow r (-(n : ℝ)) * Real.exp (-a r) * J r) s ≤ 0 := by |
| 52 | rw [(squareWeightedJacobian_hasDerivAt hs ha hJ).deriv] |
| 53 | apply mul_nonpos_of_nonneg_of_nonpos |
| 54 | · exact mul_nonneg (mul_pos (Real.rpow_pos_of_pos hs _) (Real.exp_pos _)).le hJnonneg |
| 55 | · have heq : 2 * s * (R + L) + K / s ^ 2 - (n : ℝ) / s = |
| 56 | 2 * s * (L - ((n : ℝ) / (2 * s ^ 2) - R - K / (2 * s ^ 3))) := by |
| 57 | field_simp [hs.ne'] |
| 58 | ring |
| 59 | rw [heq] |
| 60 | exact mul_nonpos_of_nonneg_of_nonpos (mul_pos zero_lt_two hs).le (sub_nonpos.mpr hL) |
| 61 | |
| 62 | /-- Interior evolution and terminal continuity give monotonicity |
| 63 | on the whole positive prefix, including its terminal endpoint, |
| 64 | Proposition 6.81, pp. 145-146. -/ |
| 65 | theorem squareWeightedJacobian_antitoneOn {n : ℕ} {a J K R L : ℝ → ℝ} {b : ℝ} |
| 66 | (ha : ContinuousOn a (Ioc 0 b)) (hJ : ContinuousOn J (Ioc 0 b)) |
| 67 | (ha' : ∀ s ∈ Ioo 0 b, HasDerivAt a (-K s / s ^ 2) s) |
| 68 | (hJ' : ∀ s ∈ Ioo 0 b, HasDerivAt J (2 * s * J s * (R s + L s)) s) |
| 69 | (hJnonneg : ∀ s ∈ Ioo 0 b, 0 ≤ J s) |
| 70 | (hL : ∀ s ∈ Ioo 0 b, |
| 71 | L s ≤ (n : ℝ) / (2 * s ^ 2) - R s - K s / (2 * s ^ 3)) : |
| 72 | AntitoneOn (fun s => Real.rpow s (-(n : ℝ)) * Real.exp (-a s) * J s) (Ioc 0 b) := by |
| 73 | have hp : ContinuousOn (fun s : ℝ => Real.rpow s (-(n : ℝ))) (Ioc 0 b) := |
| 74 | fun s hs => (Real.hasDerivAt_rpow_const (p := -(n : ℝ)) |
| 75 | (Or.inl hs.1.ne')).continuousAt.continuousWithinAt |
| 76 | have hexp := Real.continuous_exp.comp_continuousOn ha.neg |
| 77 | apply antitoneOn_of_deriv_nonpos (convex_Ioc 0 b) ((hp.mul hexp).mul hJ) |
| 78 | · intro s hs |
| 79 | rw [interior_Ioc] at hs |
| 80 | exact (squareWeightedJacobian_hasDerivAt (n := n) hs.1 |
| 81 | (ha' s hs) (hJ' s hs)).differentiableAt.differentiableWithinAt |
| 82 | · intro s hs |
| 83 | rw [interior_Ioc] at hs |
| 84 | exact squareWeightedJacobian_deriv_nonpos hs.1 (ha' s hs) (hJ' s hs) |
| 85 | (hJnonneg s hs) (hL s hs) |
| 86 | |
| 87 | /-- A positive-prefix antitone density is bounded by its initial |
| 88 | one-sided limit, the Gaussian comparison in Proposition 6.81, |
| 89 | pp. 145-146. -/ |
| 90 | theorem positivePrefix_le_initial_limit {f : ℝ → ℝ} {b c s : ℝ} |
| 91 | (hanti : AntitoneOn f (Ioc 0 b)) (hlim : Tendsto f (𝓝[>] (0 : ℝ)) (𝓝 c)) |
| 92 | (hs : s ∈ Ioc 0 b) : f s ≤ c := by |
| 93 | apply ge_of_tendsto hlim |
| 94 | filter_upwards [Ioc_mem_nhdsGT hs.1] with r hr |
| 95 | exact hanti ⟨hr.1, hr.2.trans hs.2⟩ hs hr.2 |
| 96 | |
| 97 | end PoincareMT.M14 |