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.Surgery.Induction.Noncollapse.Assembly.NeckPatch |
| 2 | |
| 3 | /-! |
| 4 | # Tested-ball volume in a canonical neck |
| 5 | |
| 6 | Morgan--Tian Proposition 16.3, p. 368. The shared neck image-volume theorem |
| 7 | and actual cylinder product measure turn the contained coordinate patch |
| 8 | into a scale-independent cubic lower bound. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | -- The sphere measure and fixed cylinder rechart retain the same metric data. |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | open Set MeasureTheory |
| 16 | open scoped Manifold ContDiff Bundle ENNReal |
| 17 | |
| 18 | namespace PoincareMT.Proofs.M46 |
| 19 | |
| 20 | /-- The numerical neck constant is fixed before the flow or surgery radius. -/ |
| 21 | noncomputable def canonicalNeckVolumeFloor : ℝ := canonicalSphereVolumeFloor / 256 |
| 22 | |
| 23 | /-- The neck constant is strictly positive. -/ |
| 24 | theorem canonicalNeckVolumeFloor_pos : 0 < canonicalNeckVolumeFloor := |
| 25 | div_pos canonicalSphereVolumeFloor_pos (by norm_num) |
| 26 | |
| 27 | /-- The product patch is measurable for the actual cylinder measure. -/ |
| 28 | theorem canonicalNeckPatch_measurable (q : UnitTwoSphere) (a : ℝ) : |
| 29 | MeasurableSet (canonicalNeckPatch q a) := by |
| 30 | have hball : MeasurableSet (canonicalSphereMetric.ball q a) := by |
| 31 | change MeasurableSet {y : UnitTwoSphere | |
| 32 | canonicalSphereMetric.edist q y < ENNReal.ofReal a} |
| 33 | simp_rw [canonicalSphereMetric, rescaledMetric_edist, |
| 34 | Poincare.Geometry.Riemannian.SpaceForm.roundSphereMetric_edist_eq_angle |
| 35 | (by norm_num : 1 ≤ (2 : ℕ))] |
| 36 | apply IsOpen.measurableSet |
| 37 | apply isOpen_lt _ continuous_const |
| 38 | exact (ENNReal.continuous_const_mul ENNReal.ofReal_ne_top).comp |
| 39 | (ENNReal.continuous_ofReal.comp (by fun_prop)) |
| 40 | exact hball.prod measurableSet_Ioo |
| 41 | |
| 42 | /-- The frozen round-cylinder measure supplies the patch's cubic volume. -/ |
| 43 | theorem canonicalNeckPatch_model_volume (q : UnitTwoSphere) {a : ℝ} |
| 44 | (ha : 0 < a) (ha1 : a ≤ 1) : |
| 45 | ENNReal.ofReal (canonicalSphereVolumeFloor * a ^ 2 * (2 * a)) ≤ |
| 46 | roundCylinderVolumeMeasure (canonicalNeckPatch q a) := by |
| 47 | rw [canonicalNeckPatch, roundCylinderVolumeMeasure_eq_prod, Measure.prod_prod, |
| 48 | Real.volume_Ioo, sub_neg_eq_add] |
| 49 | rw [ENNReal.ofReal_mul (mul_nonneg canonicalSphereVolumeFloor_pos.le (sq_nonneg a))] |
| 50 | simpa only [two_mul] using |
| 51 | mul_le_mul' (canonicalSphere_small_ball_volume q ha ha1) (le_refl (ENNReal.ofReal (2 * a))) |
| 52 | |
| 53 | variable {M : Type*} [TopologicalSpace M] |
| 54 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 55 | [IsManifold (𝓡 3) ∞ M] [MeasurableSpace M] [BorelSpace M] |
| 56 | [T2Space M] [T3Space M] {g : RiemannianMetric 3 M} (N : EpsilonNeck g) |
| 57 | |
| 58 | /-- The actual neck ball contains the image of a positive-volume patch. -/ |
| 59 | theorem canonicalNeck_patch_ball_volume (q : UnitTwoSphere) |
| 60 | (hq : N.coordinate_map (q, 0) = N.center) {a : ℝ} |
| 61 | (ha : 0 < a) (ha1 : a ≤ 1) : |
| 62 | ENNReal.ofReal (N.scale ^ 3 * canonicalSphereVolumeFloor * a ^ 3 / 4) ≤ |
| 63 | g.volumeMeasure (g.ball N.center (4 * N.scale * a)) := by |
| 64 | have hscale0 := N.scale_pos |
| 65 | have hroot : 1 / 2 ≤ Real.sqrt (1 - N.epsilon) := by |
| 66 | nlinarith [Real.sq_sqrt (show 0 ≤ 1 - N.epsilon by linarith [N.epsilon_lt_half]), |
| 67 | Real.sqrt_nonneg (1 - N.epsilon), N.epsilon_lt_half] |
| 68 | have hfactor : ENNReal.ofReal (N.scale / 2) ^ 3 ≤ |
| 69 | ENNReal.ofReal (N.scale * Real.sqrt (1 - N.epsilon)) ^ 3 := by |
| 70 | gcongr |
| 71 | nlinarith |
| 72 | have hpatch := N.volumeMeasure_image_bounds (canonicalNeckPatch_measurable q a) |
| 73 | (canonicalNeckPatch_subset_domain N q ha1) |
| 74 | have h := (mul_le_mul' hfactor (canonicalNeckPatch_model_volume q ha ha1)).trans |
| 75 | (hpatch.1.trans (measure_mono (canonicalNeckPatch_image_subset_ball N q hq ha ha1))) |
| 76 | rw [← ENNReal.ofReal_pow (by positivity : 0 ≤ N.scale / 2), |
| 77 | ← ENNReal.ofReal_mul (by positivity : 0 ≤ (N.scale / 2) ^ 3)] at h |
| 78 | have heq : N.scale ^ 3 * canonicalSphereVolumeFloor * a ^ 3 / 4 = |
| 79 | (N.scale / 2) ^ 3 * (canonicalSphereVolumeFloor * a ^ 2 * (2 * a)) := by ring |
| 80 | rw [heq] |
| 81 | exact h |
| 82 | |
| 83 | /-- The scale-independent neck estimate used in Proposition 16.3. The |
| 84 | public test's scalar trace will supply the upper bound on s/scale. -/ |
| 85 | theorem canonicalNeck_test_ball_volume {s : ℝ} (hs : 0 < s) |
| 86 | (hscale : s ≤ 3 * N.scale) : |
| 87 | ENNReal.ofReal (canonicalNeckVolumeFloor * s ^ 3) ≤ |
| 88 | g.volumeMeasure (g.ball N.center s) := by |
| 89 | have hscale0 := N.scale_pos |
| 90 | obtain ⟨⟨q, z⟩, ⟨_, hz⟩, hq⟩ := N.central_sphere_eq ▸ N.center_on_central_sphere |
| 91 | have hz0 : z = 0 := hz |
| 92 | subst z |
| 93 | let a := s / (4 * N.scale) |
| 94 | have ha : 0 < a := div_pos hs (mul_pos (by norm_num) N.scale_pos) |
| 95 | have ha1 : a ≤ 1 := by |
| 96 | apply (div_le_iff₀ (by positivity : 0 < 4 * N.scale)).mpr |
| 97 | linarith [N.scale_pos] |
| 98 | have heq : 4 * N.scale * a = s := by dsimp [a]; field_simp [hscale0.ne'] |
| 99 | have h := canonicalNeck_patch_ball_volume N q hq ha ha1 |
| 100 | rw [heq] at h |
| 101 | convert h using 1 |
| 102 | congr 1 |
| 103 | unfold canonicalNeckVolumeFloor |
| 104 | dsimp [a] |
| 105 | field_simp [hscale0.ne'] |
| 106 | ring |
| 107 | |
| 108 | end PoincareMT.Proofs.M46 |