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.ReducedGeometry.ReducedVolume.Comparison.Density |
| 2 | |
| 3 | /-! |
| 4 | # Scalar calculus for the weighted volume Jacobian |
| 5 | |
| 6 | This product rule uses genuine derivative witnesses for the action and |
| 7 | Jacobian. The geometric Jacobian evolution must be produced separately. |
| 8 | The calculation is valid in dimension zero and does not divide by J. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | namespace PoincareMT.ReducedVolume |
| 14 | |
| 15 | /-- The derivative of the unnormalized scalar weighted Jacobian. -/ |
| 16 | theorem weightedJacobian_hasDerivAt {n : ℕ} {a J : ℝ → ℝ} {d R L t : ℝ} |
| 17 | (ht : 0 < t) (ha : HasDerivAt a d t) (hJ : HasDerivAt J (J t * (R + L)) t) : |
| 18 | HasDerivAt (fun s ↦ Real.rpow s (-(n : ℝ) / 2) * Real.exp (-a s) * J s) |
| 19 | ((Real.rpow t (-(n : ℝ) / 2) * Real.exp (-a t) * J t) * |
| 20 | (R + L - d - (n : ℝ) / (2 * t))) t := by |
| 21 | have hp := Real.hasDerivAt_rpow_const (p := -(n : ℝ) / 2) (Or.inl ht.ne') |
| 22 | apply ((hp.mul ha.neg.exp).mul hJ).congr_deriv |
| 23 | rw [Real.rpow_sub_one ht.ne'] |
| 24 | simp only [Pi.neg_apply, Real.rpow_eq_pow, Pi.mul_apply] |
| 25 | ring |
| 26 | |
| 27 | /-- A nonnegative Jacobian and the first regular residual give a nonpositive derivative. -/ |
| 28 | theorem weightedJacobian_deriv_nonpos {n : ℕ} {a J : ℝ → ℝ} {D Q R L t : ℝ} |
| 29 | (ht : 0 < t) (ha : HasDerivAt a (D + Q) t) |
| 30 | (hJ : HasDerivAt J (J t * (R + L)) t) (hJnonneg : 0 ≤ J t) |
| 31 | (hres : 0 ≤ D - L + Q - R + (n : ℝ) / (2 * t)) : |
| 32 | deriv (fun s ↦ Real.rpow s (-(n : ℝ) / 2) * Real.exp (-a s) * J s) t ≤ 0 := by |
| 33 | rw [(weightedJacobian_hasDerivAt ht ha hJ).deriv] |
| 34 | apply mul_nonpos_of_nonneg_of_nonpos |
| 35 | · exact mul_nonneg (mul_pos (Real.rpow_pos_of_pos ht _) (Real.exp_pos _)).le hJnonneg |
| 36 | · linarith |
| 37 | |
| 38 | end PoincareMT.ReducedVolume |