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.Attainment.Minimum.SquareModulus |
| 2 | import Mathlib.Topology.Compactness.LocallyCompact |
| 3 | import Mathlib.Topology.UniformSpace.Compact |
| 4 | |
| 5 | /-! |
| 6 | # Uniform compact neighborhoods of actual path crossings |
| 7 | |
| 8 | Proposition 16.21, pp. 384-387. The actual auxiliary metric has a |
| 9 | global square-time energy modulus. A compact set of regular surgery |
| 10 | points therefore confines every sufficiently short segment crossing |
| 11 | it, with a constant depending on that compact set and the energy bound. |
| 12 | No preterminal metric bound or preassigned path cage is assumed. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set Filter MeasureTheory Manifold |
| 19 | open scoped Manifold ContDiff Bundle Topology ENNReal |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.Proofs.M46 |
| 24 | |
| 25 | variable {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 26 | {I : SpacetimeInterval} (G : GeneralizedLGeometryTransport 3 X time I) |
| 27 | |
| 28 | /-- A compact set in the actual regular spacetime has a uniform |
| 29 | compact neighborhood for all bounded-energy path crossings. The |
| 30 | time width is in the original backward parameter, including zero. |
| 31 | Source: Definition 16.20 and Proposition 16.21, pp. 384-387. -/ |
| 32 | theorem exists_compact_crossing_neighborhood {K : Set G.Point} (hK : IsCompact K) |
| 33 | {D H : ℝ} (hD : 0 ≤ D) (hH : 0 ≤ H) : |
| 34 | ∃ N : Set G.Point, IsCompact N ∧ K ⊆ interior N ∧ |
| 35 | ∃ delta : ℝ, 0 < delta ∧ |
| 36 | ∀ (T tau : ℝ) (x y : G.Point) (p : M14BackwardPath G T 0 tau x y), |
| 37 | tau ≤ H → |
| 38 | IntervalIntegrable (M14.pathSquareKinetic p) volume 0 (Real.sqrt tau) → |
| 39 | (∫ s in 0..Real.sqrt tau, M14.pathSquareKinetic p s) ≤ D → |
| 40 | ∀ a ∈ Icc 0 tau, ∀ b ∈ Icc 0 tau, |
| 41 | |b - a| < delta → p.curve a ∈ K → p.curve b ∈ N := by |
| 42 | let : Bundle.RiemannianBundle (TangentSpace (spacetimeModel 3) : G.Point → Type _) := |
| 43 | ⟨(M14.auxiliarySpacetimeMetric G.spacetime).toRiemannianMetric⟩ |
| 44 | let : EMetricSpace G.Point := .ofRiemannianMetric (spacetimeModel 3) G.Point |
| 45 | let : LocallyCompactSpace G.Point := |
| 46 | Manifold.locallyCompact_of_finiteDimensional (M := G.Point) (spacetimeModel 3) |
| 47 | obtain ⟨N, hN, hKN⟩ := exists_compact_superset hK |
| 48 | obtain ⟨epsilon, hepsilon, hball⟩ := lebesgue_number_lemma_of_emetric_nhds |
| 49 | (c := fun _ : G.Point => N) hK (fun z hz => |
| 50 | mem_interior_iff_mem_nhds.mp (hKN hz)) |
| 51 | let Q := Real.sqrt (D + 4 * H * Real.sqrt H + 1) |
| 52 | let modulus : ℝ → ℝ≥0∞ := fun r => ENNReal.ofReal (Q * Real.sqrt |r|) |
| 53 | have hcont : Continuous modulus := |
| 54 | ENNReal.continuous_ofReal.comp (continuous_const.mul |
| 55 | (Real.continuous_sqrt.comp continuous_abs)) |
| 56 | have hzero : modulus 0 = 0 := by simp [modulus] |
| 57 | have hnear : modulus ⁻¹' Iio epsilon ∈ 𝓝 (0 : ℝ) := |
| 58 | hcont.continuousAt.preimage_mem_nhds (hzero ▸ Iio_mem_nhds hepsilon) |
| 59 | obtain ⟨d, hd, hmodulus⟩ := Metric.mem_nhds_iff.mp hnear |
| 60 | have hsqrt : UniformContinuousOn Real.sqrt (Icc (0 : ℝ) H) := |
| 61 | isCompact_Icc.uniformContinuousOn_of_continuous Real.continuous_sqrt.continuousOn |
| 62 | obtain ⟨delta, hdelta, hsqrt_delta⟩ := Metric.uniformContinuousOn_iff.mp hsqrt d hd |
| 63 | refine ⟨N, hN, hKN, delta, hdelta, ?_⟩ |
| 64 | intro T tau x y p htau hkin henergy a ha b hb hclose hstart |
| 65 | have haH : a ∈ Icc 0 H := ⟨ha.1, ha.2.trans htau⟩ |
| 66 | have hbH : b ∈ Icc 0 H := ⟨hb.1, hb.2.trans htau⟩ |
| 67 | have hroot_close : |Real.sqrt b - Real.sqrt a| < d := by |
| 68 | simpa only [Real.dist_eq] using hsqrt_delta b hbH a haH |
| 69 | (by simpa only [Real.dist_eq] using hclose) |
| 70 | have hsmall : modulus (Real.sqrt b - Real.sqrt a) < epsilon := by |
| 71 | apply hmodulus |
| 72 | simpa only [Metric.mem_ball, Real.dist_eq, sub_zero] using hroot_close |
| 73 | have hbound := backward_squarePath_edist_le_sqrt p hD hkin henergy |
| 74 | ⟨Real.sqrt_nonneg a, Real.sqrt_le_sqrt ha.2⟩ |
| 75 | ⟨Real.sqrt_nonneg b, Real.sqrt_le_sqrt hb.2⟩ |
| 76 | rw [Real.sq_sqrt ha.1, Real.sq_sqrt hb.1] at hbound |
| 77 | have hcoeff : Real.sqrt (D + 4 * tau * Real.sqrt tau + 1) ≤ Q := by |
| 78 | apply Real.sqrt_le_sqrt |
| 79 | have hprod : tau * Real.sqrt tau ≤ H * Real.sqrt H := |
| 80 | mul_le_mul htau (Real.sqrt_le_sqrt htau) (Real.sqrt_nonneg tau) hH |
| 81 | linarith |
| 82 | have hdist : edist (p.curve a) (p.curve b) < epsilon := by |
| 83 | apply (hbound.trans (ENNReal.ofReal_le_ofReal |
| 84 | (mul_le_mul_of_nonneg_right hcoeff (Real.sqrt_nonneg _)))).trans_lt hsmall |
| 85 | obtain ⟨_, hsubset⟩ := hball (p.curve a) hstart |
| 86 | apply hsubset |
| 87 | change edist (p.curve b) (p.curve a) < epsilon |
| 88 | rwa [edist_comm] |
| 89 | |
| 90 | end PoincareMT.Proofs.M46 |