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.Measure.CalibratedVolume |
| 2 | import Mathlib.Topology.Connected.LocallyConnected |
| 3 | import Mathlib.SetTheory.Cardinal.Finite |
| 4 | |
| 5 | /-! |
| 6 | Adapted from Mapher `PoincareMT/Proofs/M49/InitialComponents.lean` at |
| 7 | revision `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. |
| 8 | |
| 9 | # Initial component counts from normalized volume |
| 10 | |
| 11 | Morgan-Tian Lemma 17.12, pp. 410-411. Each normalized initial component |
| 12 | contains a unit metric ball of uniformly positive volume. Finite component |
| 13 | enumeration and disjoint additivity bound their number before choosing the |
| 14 | raw flow. See `proof-work/tasks/M49/derivations/04-initial-components.md`. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | |
| 19 | open Set MeasureTheory |
| 20 | open scoped Manifold ContDiff Bundle ENNReal BigOperators |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | namespace PoincareMT.SurgeryVolume |
| 25 | |
| 26 | /-- A finite-radius metric ball stays in its connected component, as used |
| 27 | in the normalization argument of MT Lemma 17.12, pp. 410-411. -/ |
| 28 | theorem ball_subset_connectedComponent {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 29 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 30 | (g : RiemannianMetric n M) (x : M) (r : ℝ) : |
| 31 | g.ball x r ⊆ connectedComponent x := by |
| 32 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 33 | ⟨g.toRiemannianMetric⟩ |
| 34 | intro y hy |
| 35 | change Manifold.riemannianEDist (𝓡 n) x y < ENNReal.ofReal r at hy |
| 36 | obtain ⟨γ, hγx, hγy, hγ, _⟩ := Manifold.exists_lt_of_riemannianEDist_lt hy |
| 37 | have hc : IsPreconnected (γ '' Icc (0 : ℝ) 1) := |
| 38 | isPreconnected_Icc.image γ hγ.continuousOn |
| 39 | exact hc.subset_connectedComponent ⟨0, by norm_num, hγx⟩ ⟨1, by norm_num, hγy⟩ |
| 40 | |
| 41 | /-- Included compact slices have finitely many components, as used for |
| 42 | the component bookkeeping in MT Lemma 17.12, pp. 410-411. -/ |
| 43 | theorem slice_components_finite (F : SurgeryFlowData.{u}) {t : ℝ} |
| 44 | (ht : t ∈ F.time_domain) : Finite (ConnectedComponents (F.slice t).carrier) := by |
| 45 | let : CompactSpace (F.slice t).carrier := isCompact_univ_iff.mp (F.slices_compact t ht) |
| 46 | let : LocallyConnectedSpace (F.slice t).carrier := |
| 47 | ChartedSpace.locallyConnectedSpace (EuclideanSpace ℝ (Fin 3)) (F.slice t).carrier |
| 48 | infer_instance |
| 49 | |
| 50 | /-- The normalized unit-ball volume per component in MT Lemma 17.12, |
| 51 | pp. 410-411, is a fixed positive real number. -/ |
| 52 | theorem initial_component_unit_volume_pos : |
| 53 | 0 < euclideanUnitBallLebesgueVolume.toReal / 2 := by |
| 54 | apply div_pos _ (by norm_num) |
| 55 | apply ENNReal.toReal_pos |
| 56 | · exact (Metric.measure_ball_pos volume (0 : EuclideanSpace ℝ (Fin 3)) |
| 57 | (by norm_num : (0 : ℝ) < 1)).ne' |
| 58 | · exact measure_ball_lt_top.ne |
| 59 | |
| 60 | /-- Every actual initial component has the normalized lower volume of |
| 61 | MT Lemma 17.12, pp. 410-411. -/ |
| 62 | theorem initial_component_volume_lower_bound (F : SurgeryFlowData.{u}) |
| 63 | (x : (F.slice 0).carrier) : |
| 64 | ENNReal.ofReal (euclideanUnitBallLebesgueVolume.toReal / 2) ≤ |
| 65 | calibratedMetricVolume (F.metric 0) (connectedComponent x) := by |
| 66 | have hball := (F.initial_normalized x).2 1 (by norm_num) le_rfl |
| 67 | simp only [one_pow, mul_one] at hball |
| 68 | exact hball.trans (measure_mono (ball_subset_connectedComponent (F.metric 0) x 1)) |
| 69 | |
| 70 | /-- Summing the disjoint normalized initial components gives the volume |
| 71 | bound used for deletion counts in MT Lemma 17.12, pp. 410-411. -/ |
| 72 | theorem initial_components_volume_bound (F : SurgeryFlowData.{u}) : |
| 73 | (Nat.card (ConnectedComponents (F.slice 0).carrier) : ℝ≥0∞) * |
| 74 | ENNReal.ofReal (euclideanUnitBallLebesgueVolume.toReal / 2) ≤ |
| 75 | calibratedMetricVolume (F.metric 0) univ := by |
| 76 | classical |
| 77 | let : Finite (ConnectedComponents (F.slice 0).carrier) := |
| 78 | slice_components_finite F F.zero_mem |
| 79 | let : Fintype (ConnectedComponents (F.slice 0).carrier) := Fintype.ofFinite _ |
| 80 | let p : ConnectedComponents (F.slice 0).carrier → (F.slice 0).carrier := |
| 81 | fun c => (ConnectedComponents.surjective_coe c).choose |
| 82 | have hp (c : ConnectedComponents (F.slice 0).carrier) : ConnectedComponents.mk (p c) = c := |
| 83 | (ConnectedComponents.surjective_coe c).choose_spec |
| 84 | let A : ConnectedComponents (F.slice 0).carrier → Set (F.slice 0).carrier := |
| 85 | fun c => {x | ConnectedComponents.mk x = c} |
| 86 | have hA (c : ConnectedComponents (F.slice 0).carrier) : A c = connectedComponent (p c) := by |
| 87 | change ConnectedComponents.mk ⁻¹' {c} = _ |
| 88 | simpa only [hp c] using (connectedComponents_preimage_singleton (x := p c)) |
| 89 | have hd : Pairwise (fun c d => Disjoint (A c) (A d)) := by |
| 90 | intro c d hcd |
| 91 | exact disjoint_left.mpr (fun _ hx hy => hcd (hx.symm.trans hy)) |
| 92 | calc |
| 93 | _ = ∑ _c : ConnectedComponents (F.slice 0).carrier, |
| 94 | ENNReal.ofReal (euclideanUnitBallLebesgueVolume.toReal / 2) := by |
| 95 | simp [Nat.card_eq_fintype_card, nsmul_eq_mul] |
| 96 | _ ≤ ∑ c : ConnectedComponents (F.slice 0).carrier, |
| 97 | calibratedMetricVolume (F.metric 0) (A c) := by |
| 98 | apply Finset.sum_le_sum |
| 99 | intro c _ |
| 100 | rw [hA] |
| 101 | exact initial_component_volume_lower_bound F (p c) |
| 102 | _ ≤ _ := sum_measure_le_measure_univ |
| 103 | (fun c _ => by rw [hA]; exact isClosed_connectedComponent.measurableSet.nullMeasurableSet) |
| 104 | (fun _ _ _ _ hcd => (hd hcd).aedisjoint) |
| 105 | |
| 106 | /-- A finite initial-volume bound fixes an initial-component bound before |
| 107 | the raw flow is chosen (MT Lemma 17.12, pp. 410-411). -/ |
| 108 | theorem exists_uniform_initial_component_bound (V₀ : ℝ≥0∞) (hV₀ : V₀ ≠ ⊤) : |
| 109 | ∃ n : ℕ, ∀ F : SurgeryFlowData.{u}, |
| 110 | calibratedMetricVolume (F.metric 0) univ ≤ V₀ → |
| 111 | Nat.card (ConnectedComponents (F.slice 0).carrier) ≤ n := by |
| 112 | obtain ⟨n, hn⟩ := exists_nat_ge (V₀.toReal / (euclideanUnitBallLebesgueVolume.toReal / 2)) |
| 113 | refine ⟨n, fun F hF => ?_⟩ |
| 114 | have hc := ENNReal.toReal_mono hV₀ ((initial_components_volume_bound F).trans hF) |
| 115 | simp only [ENNReal.toReal_mul, ENNReal.toReal_natCast, |
| 116 | ENNReal.toReal_ofReal initial_component_unit_volume_pos.le] at hc |
| 117 | have hn' := ((le_div_iff₀ initial_component_unit_volume_pos).mpr hc).trans hn |
| 118 | exact_mod_cast hn' |
| 119 | |
| 120 | end PoincareMT.SurgeryVolume |