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.BoundedDistance.GeometryImports |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Spacetime.Geometry.FullNeckVolumeCharts |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Spacetime.StrongNecks.Geometry.StrongNeckVolumeModelCover |
| 4 | import PoincareLib.Geometry.Riemannian.Comparison.Volume.CenterDensity |
| 5 | import Mathlib.Algebra.Order.Floor.Ring |
| 6 | import Mathlib.Data.Int.Interval |
| 7 | |
| 8 | /-! |
| 9 | # Universal full-neck volume upper bound |
| 10 | |
| 11 | A fixed finite model-slab cover and integer axial translates cover the |
| 12 | entire actual neck. Each coordinate ball is intersected with its valid |
| 13 | source before the calibrated Hausdorff density formula is used. The count |
| 14 | is linear in the neck length, giving the scale-cubed full-carrier estimate |
| 15 | needed in Morgan--Tian Claim 10.6, p. 253, and Theorem 5.6, pp. 85-87. |
| 16 | See the M28 full-neck-volume derivation. |
| 17 | -/ |
| 18 | |
| 19 | set_option autoImplicit false |
| 20 | set_option backward.isDefEq.respectTransparency false |
| 21 | |
| 22 | open Set MeasureTheory |
| 23 | open scoped Manifold ContDiff Bundle Topology ENNReal BigOperators |
| 24 | |
| 25 | universe u |
| 26 | |
| 27 | namespace PoincareMT.M28 |
| 28 | |
| 29 | open tube RiemannianMetric |
| 30 | |
| 31 | private abbrev E := EuclideanSpace ℝ (Fin 3) |
| 32 | private abbrev ModelSlab := |
| 33 | (univ ×ˢ Icc (-2 * (1 : ℝ)) (2 * 1) : Set RoundCylinderSpace) |
| 34 | |
| 35 | private theorem neck_volume_model_add_axis (q : UnitTwoSphere) (s a : ℝ) (x : E) : |
| 36 | neckVolumeModelChart q (s + a) x = |
| 37 | ((neckVolumeModelChart q s x).1, (neckVolumeModelChart q s x).2 + a) := by |
| 38 | apply Prod.ext <;> |
| 39 | simp [neckVolumeModelChart_apply, cylinderSphereParametrization, |
| 40 | cylinderScalarCoordinates, add_assoc] |
| 41 | |
| 42 | private theorem full_neck_axis_count {A : ℝ} (hA : 2 < A) : |
| 43 | ((Finset.Icc (-⌈A⌉) ⌈A⌉).card : ℝ) ≤ 4 * A := by |
| 44 | have hnA : A ≤ (⌈A⌉ : ℝ) := Int.le_ceil A |
| 45 | have hn0 : (0 : ℤ) ≤ ⌈A⌉ := by |
| 46 | exact_mod_cast (show (0 : ℝ) ≤ (⌈A⌉ : ℝ) by linarith only [hA, hnA]) |
| 47 | have hcard := Int.card_Icc_of_le (a := -⌈A⌉) (b := ⌈A⌉) (by omega) |
| 48 | have hreal : ((Finset.Icc (-⌈A⌉) ⌈A⌉).card : ℝ) = |
| 49 | (⌈A⌉ : ℝ) + 1 - (-(⌈A⌉ : ℝ)) := by exact_mod_cast hcard |
| 50 | have hceil : (⌈A⌉ : ℝ) < A + 1 := Int.ceil_lt_add_one A |
| 51 | linarith only [hreal, hceil, hA] |
| 52 | |
| 53 | /-- One universal constant bounds the full calibrated volume of every |
| 54 | actual epsilon-neck by scale cubed times inverse epsilon. The certificate's |
| 55 | own epsilon bound suffices; no buffered-ball or volume premise is used. -/ |
| 56 | theorem exists_full_neck_volume_upper_constant : |
| 57 | ∃ cvol : ℝ, 0 < cvol ∧ |
| 58 | ∀ (M : Type u) [TopologicalSpace M] [MeasurableSpace M] |
| 59 | [BorelSpace M] [T3Space M] |
| 60 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 61 | (g : RiemannianMetric 3 M) (N : EpsilonNeck g), |
| 62 | g.volumeMeasure N.carrier ≤ |
| 63 | ENNReal.ofReal (cvol * N.scale ^ 3 * N.epsilon⁻¹) := by |
| 64 | classical |
| 65 | obtain ⟨t, hcover⟩ : ∃ t : Finset ModelSlab, |
| 66 | ModelSlab ⊆ ⋃ z ∈ t, |
| 67 | neckVolumeModelChart z.val.1 z.val.2 '' Metric.ball (0 : E) 1 := by |
| 68 | exact exists_neckVolumeModelChart_finite_cover (1 : ℝ) |
| 69 | let cvol : ℝ := 1536 * ((t.card : ℝ) + 1) * euclideanUnitBallVolume 3 |
| 70 | have hunit : 0 < euclideanUnitBallVolume 3 := euclideanUnitBallVolume_pos 3 |
| 71 | refine ⟨cvol, by dsimp only [cvol]; positivity, ?_⟩ |
| 72 | intro M _ _ _ _ _ _ g N |
| 73 | let A : ℝ := N.epsilon⁻¹ |
| 74 | have hA : 2 < A := by |
| 75 | have h := one_div_lt_one_div_of_lt N.epsilon_pos N.epsilon_lt_half |
| 76 | norm_num at h |
| 77 | exact h |
| 78 | let J : Finset ℤ := Finset.Icc (-⌈A⌉) ⌈A⌉ |
| 79 | let F : Finset (ModelSlab × ℤ) := t ×ˢ J |
| 80 | let domain (w : ModelSlab × ℤ) : Set E := Metric.ball 0 1 ∩ |
| 81 | cylinderNeckChartDomain N w.1.val.1 (w.1.val.2 + (w.2 : ℝ)) |
| 82 | let images (w : ModelSlab × ℤ) : Set M := |
| 83 | cylinderNeckChart N w.1.val.1 (w.1.val.2 + (w.2 : ℝ)) '' domain w |
| 84 | have hcarrier : N.carrier ⊆ ⋃ w ∈ F, images w := by |
| 85 | intro x hx |
| 86 | let a : ℝ := (N.coordinate_inverse x).2 |
| 87 | let j : ℤ := ⌊a⌋ |
| 88 | have ha : a ∈ Ioo (-A) A := (N.coordinate_inverse_mem x hx).2 |
| 89 | have hnA : A ≤ (⌈A⌉ : ℝ) := Int.le_ceil A |
| 90 | have hjlow : -⌈A⌉ ≤ j := by |
| 91 | change -⌈A⌉ ≤ ⌊a⌋ |
| 92 | rw [Int.le_floor] |
| 93 | push_cast |
| 94 | linarith only [ha.1, hnA] |
| 95 | have hjfloor : (j : ℝ) ≤ a := Int.floor_le a |
| 96 | have hjhigh : j ≤ ⌈A⌉ := by |
| 97 | exact_mod_cast |
| 98 | (show (j : ℝ) ≤ (⌈A⌉ : ℝ) by linarith only [hjfloor, ha.2, hnA]) |
| 99 | have hj : j ∈ J := Finset.mem_Icc.mpr ⟨hjlow, hjhigh⟩ |
| 100 | have hjnext : a < (j : ℝ) + 1 := Int.lt_floor_add_one a |
| 101 | have hz : ((N.coordinate_inverse x).1, a - (j : ℝ)) ∈ ModelSlab := |
| 102 | ⟨mem_univ _, by linarith only [hjfloor], by linarith only [hjnext]⟩ |
| 103 | obtain ⟨z, hzt, y, hy, heq⟩ := by |
| 104 | simpa only [mem_iUnion, exists_prop, mem_image] using hcover hz |
| 105 | have hmodel : neckVolumeModelChart z.val.1 (z.val.2 + (j : ℝ)) y = |
| 106 | N.coordinate_inverse x := by |
| 107 | rw [neck_volume_model_add_axis, heq] |
| 108 | exact Prod.ext rfl (by dsimp only [a]; ring) |
| 109 | have hydomain : y ∈ cylinderNeckChartDomain N z.val.1 (z.val.2 + (j : ℝ)) := by |
| 110 | rw [← neckVolumeChart_source, neckVolumeChart, |
| 111 | OpenPartialHomeomorph.trans_source, neckVolumeModelChart_source, univ_inter] |
| 112 | change neckVolumeModelChart z.val.1 (z.val.2 + (j : ℝ)) y ∈ |
| 113 | univ ×ˢ Ioo (-N.epsilon⁻¹) N.epsilon⁻¹ |
| 114 | rw [hmodel] |
| 115 | exact N.coordinate_inverse_mem x hx |
| 116 | apply mem_iUnion.mpr |
| 117 | refine ⟨(z, j), mem_iUnion.mpr ⟨Finset.mem_product.mpr ⟨hzt, hj⟩, ?_⟩⟩ |
| 118 | refine ⟨y, ⟨hy, hydomain⟩, ?_⟩ |
| 119 | change N.coordinate_map (neckVolumeModelChart z.val.1 (z.val.2 + (j : ℝ)) y) = x |
| 120 | exact (congrArg N.coordinate_map hmodel).trans (N.coordinate_map_coordinate_inverse hx) |
| 121 | let c : ℝ := (384 * N.scale ^ 3) * euclideanUnitBallVolume 3 |
| 122 | have hdensity : 0 ≤ 384 * N.scale ^ 3 := |
| 123 | mul_nonneg (by norm_num) (pow_nonneg N.scale_pos.le _) |
| 124 | have hc : 0 ≤ c := mul_nonneg hdensity hunit.le |
| 125 | have himage (w : ModelSlab × ℤ) : g.volumeMeasure (images w) ≤ ENNReal.ofReal c := by |
| 126 | have hmeas : MeasurableSet (domain w) := |
| 127 | measurableSet_ball.inter |
| 128 | (isOpen_cylinderNeckChartDomain N w.1.val.1 (w.1.val.2 + (w.2 : ℝ))).measurableSet |
| 129 | have hvol := full_neck_chart_image_volume_upper N w.1.val.1 |
| 130 | (w.1.val.2 + (w.2 : ℝ)) hmeas inter_subset_right |
| 131 | calc |
| 132 | g.volumeMeasure (images w) ≤ ENNReal.ofReal (384 * N.scale ^ 3) * |
| 133 | volume (domain w) := hvol |
| 134 | _ ≤ ENNReal.ofReal (384 * N.scale ^ 3) * volume (Metric.ball (0 : E) 1) := |
| 135 | mul_le_mul_right (measure_mono inter_subset_left) _ |
| 136 | _ = ENNReal.ofReal c := by |
| 137 | rw [euclidean_ball_volume_eq 3 zero_lt_one, one_pow, mul_one, |
| 138 | ← ENNReal.ofReal_mul hdensity] |
| 139 | have hcount : (F.card : ℝ) ≤ 4 * ((t.card : ℝ) + 1) * A := by |
| 140 | have hJ : (J.card : ℝ) ≤ 4 * A := full_neck_axis_count hA |
| 141 | calc |
| 142 | (F.card : ℝ) = (t.card : ℝ) * (J.card : ℝ) := by |
| 143 | dsimp only [F] |
| 144 | have hp := congrArg (fun n : ℕ => (n : ℝ)) (Finset.card_product t J) |
| 145 | simpa only [Nat.cast_mul] using hp |
| 146 | _ ≤ (t.card : ℝ) * (4 * A) := mul_le_mul_of_nonneg_left hJ (Nat.cast_nonneg _) |
| 147 | _ ≤ ((t.card : ℝ) + 1) * (4 * A) := |
| 148 | mul_le_mul_of_nonneg_right (by linarith) (by linarith only [hA]) |
| 149 | _ = 4 * ((t.card : ℝ) + 1) * A := by ring |
| 150 | calc |
| 151 | g.volumeMeasure N.carrier ≤ g.volumeMeasure (⋃ w ∈ F, images w) := |
| 152 | measure_mono hcarrier |
| 153 | _ ≤ ∑ w ∈ F, g.volumeMeasure (images w) := measure_biUnion_finset_le F images |
| 154 | _ ≤ ∑ _w ∈ F, ENNReal.ofReal c := Finset.sum_le_sum (fun w _ => himage w) |
| 155 | _ = ENNReal.ofReal ((F.card : ℝ) * c) := by |
| 156 | simp only [Finset.sum_const, nsmul_eq_mul, |
| 157 | ENNReal.ofReal_mul (Nat.cast_nonneg F.card), ENNReal.ofReal_natCast] |
| 158 | _ ≤ ENNReal.ofReal (cvol * N.scale ^ 3 * N.epsilon⁻¹) := by |
| 159 | apply ENNReal.ofReal_le_ofReal |
| 160 | calc |
| 161 | (F.card : ℝ) * c ≤ (4 * ((t.card : ℝ) + 1) * A) * c := |
| 162 | mul_le_mul_of_nonneg_right hcount hc |
| 163 | _ = cvol * N.scale ^ 3 * N.epsilon⁻¹ := by dsimp only [cvol, c, A]; ring |
| 164 | |
| 165 | end PoincareMT.M28 |