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.Volume.Surgery.Analysis.DeterminantCalculus |
| 2 | import Mathlib.Analysis.Calculus.Deriv.Mul |
| 3 | |
| 4 | /-! |
| 5 | Adapted from Mapher `PoincareMT/Proofs/M10/JacobianEvolution.lean` at |
| 6 | revision `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. |
| 7 | |
| 8 | # Jacobian evolution calculus |
| 9 | |
| 10 | The geometric part of the reduced-volume argument supplies a derivative for a |
| 11 | normalized Gram matrix. This file isolates the finite-dimensional passage |
| 12 | from that matrix derivative to the square-root Jacobian. Keeping the local |
| 13 | germ equality explicit lets the geometric producer choose its preferred |
| 14 | endpoint coordinates without introducing a global coordinate convention. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | |
| 19 | open Filter |
| 20 | open scoped BigOperators Topology |
| 21 | |
| 22 | namespace PoincareMT.SurgeryVolume.Measure |
| 23 | |
| 24 | variable {ι : Type*} [Fintype ι] [DecidableEq ι] |
| 25 | |
| 26 | /-- A normalized Gram derivative gives the corresponding Jacobian derivative. |
| 27 | |
| 28 | The equality is only required as a neighborhood germ, which is the exact |
| 29 | locality needed when a regular exponential branch is used. No invertibility |
| 30 | or positive-dimension assumption is hidden in this adapter; positivity of the |
| 31 | normalized Gram determinant is supplied by the geometric branch. |
| 32 | -/ |
| 33 | theorem hasDerivAt_jacobian_of_normalized_gram |
| 34 | {J : ℝ → ℝ} {A : ℝ → Matrix ι ι ℝ} {B : Matrix ι ι ℝ} {t : ℝ} |
| 35 | (hJ : J =ᶠ[𝓝 t] (fun s ↦ Real.sqrt ((A s).det))) |
| 36 | (hA : HasDerivAt A B t) (hAt : A t = 1) : |
| 37 | HasDerivAt J (B.trace / 2) t := by |
| 38 | exact (hasDerivAt_sqrt_matrix_det_of_eq_one hA hAt).congr_of_eventuallyEq hJ |
| 39 | |
| 40 | /-- Restoring a constant source normalization gives the multiplicative evolution law. -/ |
| 41 | theorem hasDerivAt_jacobian_of_scaled_normalized_gram |
| 42 | {J : ℝ → ℝ} {A : ℝ → Matrix ι ι ℝ} {B : Matrix ι ι ℝ} {t c : ℝ} |
| 43 | (hc : c ≠ 0) |
| 44 | (hJ : (fun s ↦ c * J s) =ᶠ[𝓝 t] (fun s ↦ Real.sqrt ((A s).det))) |
| 45 | (hA : HasDerivAt A B t) (hAt : A t = 1) : |
| 46 | HasDerivAt J (J t * (B.trace / 2)) t := by |
| 47 | have hnorm : c * J t = 1 := by |
| 48 | simpa only [hAt, Matrix.det_one, Real.sqrt_one] using hJ.eq_of_nhds |
| 49 | have h := (hasDerivAt_jacobian_of_normalized_gram hJ hA hAt).const_mul c⁻¹ |
| 50 | have hfun : (fun s ↦ c⁻¹ * (c * J s)) = J := by |
| 51 | funext s |
| 52 | rw [← mul_assoc, inv_mul_cancel₀ hc, one_mul] |
| 53 | rw [hfun] at h |
| 54 | have hvalue : c⁻¹ = J t := by |
| 55 | calc |
| 56 | c⁻¹ = c⁻¹ * (c * J t) := by rw [hnorm, mul_one] |
| 57 | _ = J t := by rw [← mul_assoc, inv_mul_cancel₀ hc, one_mul] |
| 58 | simpa only [hvalue] using h |
| 59 | |
| 60 | end PoincareMT.SurgeryVolume.Measure |