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 Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform |
| 2 | |
| 3 | /-! Adapted from Mapher `PoincareMT/Proofs/M15/Mathlib/OrthonormalGaussian.lean` at |
| 4 | `0c5d5c4e1ecbc12703b1994e226df1b15d2e8d39`. See the source mapping in |
| 5 | `references/ricci-flow/mapher/noncollapse/import.json`. -/ |
| 6 | |
| 7 | /-! |
| 8 | # Gaussian integration in coordinates for a specified bilinear form |
| 9 | |
| 10 | Morgan-Tian Lemma 8.9, pp. 175-176, uses the initial metric's Gaussian and |
| 11 | volume. These lemmas identify them using an orthonormal basis, without |
| 12 | identifying the specified bilinear form with a preexisting ambient norm. |
| 13 | See `references/ricci-flow/mapher/noncollapse/derivations/2026-09-20-horizontal-gaussian.md`. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | |
| 18 | open MeasureTheory |
| 19 | open scoped BigOperators |
| 20 | |
| 21 | variable {n : ℕ} {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 22 | |
| 23 | /-- An orthonormal coordinate expansion of a specified bilinear form. |
| 24 | This is the coordinate identity used in Lemma 8.9, p. 175. -/ |
| 25 | theorem Module.Basis.bilin_apply_equivFun_symm |
| 26 | (b : Module.Basis (Fin n) ℝ E) (B : E →L[ℝ] E →L[ℝ] ℝ) |
| 27 | (hb : ∀ i j, B (b i) (b j) = if i = j then 1 else 0) (z : Fin n → ℝ) : |
| 28 | B (b.equivFun.symm z) (b.equivFun.symm z) = ∑ i, z i ^ 2 := by |
| 29 | simp only [Module.Basis.equivFun_symm_apply, map_sum, map_smul, |
| 30 | sum_apply, smul_eq_mul] |
| 31 | simp [hb, mul_ite, pow_two] |
| 32 | |
| 33 | namespace MeasureTheory |
| 34 | |
| 35 | variable [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] |
| 36 | |
| 37 | /-- The Gaussian integral for a bilinear form and the volume specified by |
| 38 | an orthonormal coordinate basis. Source: Lemma 8.9, pp. 175-176. -/ |
| 39 | theorem integral_exp_neg_bilin_of_orthonormal_basis |
| 40 | (b : Module.Basis (Fin n) ℝ E) (B : E →L[ℝ] E →L[ℝ] ℝ) |
| 41 | (hb : ∀ i j, B (b i) (b j) = if i = j then 1 else 0) |
| 42 | {c : ℝ} (hc : 0 < c) : |
| 43 | (∫ v, Real.exp (-c * B v v) ∂Measure.map b.equivFun.symm volume) = |
| 44 | Real.rpow (Real.pi / c) ((n : ℝ) / 2) := by |
| 45 | let e := b.equivFun.toContinuousLinearEquiv.symm |
| 46 | change (∫ v, Real.exp (-c * B v v) ∂Measure.map e.toHomeomorph volume) = _ |
| 47 | rw [e.toHomeomorph.measurableEmbedding.integral_map] |
| 48 | change (∫ z : Fin n → ℝ, |
| 49 | Real.exp (-c * B (b.equivFun.symm z) (b.equivFun.symm z))) = _ |
| 50 | simp_rw [b.bilin_apply_equivFun_symm B hb] |
| 51 | have h := GaussianFourier.integral_rexp_neg_mul_sq_norm |
| 52 | (V := EuclideanSpace ℝ (Fin n)) hc |
| 53 | rw [← (PiLp.volume_preserving_toLp (Fin n)).integral_comp |
| 54 | (MeasurableEquiv.toLp 2 _).measurableEmbedding] at h |
| 55 | simpa [EuclideanSpace.real_norm_sq_eq] using h |
| 56 | |
| 57 | /-- The same Gaussian is integrable: its explicitly evaluated integral is |
| 58 | positive, so it cannot be an undefined Bochner integral. Source: the |
| 59 | Gaussian domination argument in Lemma 8.9, pp. 175-176. -/ |
| 60 | theorem integrable_exp_neg_bilin_of_orthonormal_basis |
| 61 | (b : Module.Basis (Fin n) ℝ E) (B : E →L[ℝ] E →L[ℝ] ℝ) |
| 62 | (hb : ∀ i j, B (b i) (b j) = if i = j then 1 else 0) |
| 63 | {c : ℝ} (hc : 0 < c) : |
| 64 | Integrable (fun v => Real.exp (-c * B v v)) |
| 65 | (Measure.map b.equivFun.symm volume) := by |
| 66 | by_contra h |
| 67 | have hvalue := integral_exp_neg_bilin_of_orthonormal_basis b B hb hc |
| 68 | rw [integral_undef h] at hvalue |
| 69 | exact (ne_of_gt (Real.rpow_pos_of_pos (div_pos Real.pi_pos hc) _)) hvalue.symm |
| 70 | |
| 71 | end MeasureTheory |