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.Dense |
| 2 | import PoincareLib.Geometry.RicciFlow.Curvature.Evolution.Scalar.Within |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.PartialLimits.Coordinates.WithinMetricCoefficients |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.PartialLimits.Geometry.Parabolic.SpatialContinuity |
| 5 | import Mathlib.Order.Filter.Finite |
| 6 | import Mathlib.Topology.UniformSpace.HeineCantor |
| 7 | |
| 8 | /-! |
| 9 | # Good slices preserving finite compact metric tests |
| 10 | |
| 11 | Morgan--Tian Claim 11.6 and its use in Claim 11.7, pp. 270-271, require |
| 12 | canonical neighborhoods near the terminal static metric. The frozen M30 |
| 13 | input supplies whole good slices densely from the left. Relative joint |
| 14 | continuity retains all finite compact jet and scalar tests at one such |
| 15 | slice, without extending the actual ordinary flow beyond its endpoint. |
| 16 | -/ |
| 17 | |
| 18 | set_option autoImplicit false |
| 19 | set_option backward.isDefEq.respectTransparency false |
| 20 | |
| 21 | open Set Filter |
| 22 | open scoped Manifold ContDiff Bundle Topology |
| 23 | |
| 24 | universe u v w |
| 25 | |
| 26 | namespace PoincareMT.M30 |
| 27 | |
| 28 | set_option maxHeartbeats 800000 in |
| 29 | -- Relative compact uniformity and finite nested jet tests are elaborated together. |
| 30 | /-- Select one whole canonical slice while preserving finite compact |
| 31 | metric-jet and actual scalar tests of an independently supplied flow |
| 32 | (Claim 11.6, pp. 270-271, with the earlier-dense frozen input). |
| 33 | The generalized and ordinary source manifolds may have different universes. -/ |
| 34 | theorem exists_good_slice_with_finite_metric_jets |
| 35 | (F : GeneralizedRicciFlowData.{u}) {epsilon C t : ℝ} |
| 36 | (htF : t ∈ F.interval) (xbase : (F.slice t).carrier) |
| 37 | (hdense : generalizedEarlierDenseStrongCanonicalNeighborhoods F epsilon C t xbase) |
| 38 | {Q T : ℝ} (hQ : 0 < Q) (hT : 0 < T) |
| 39 | {Y : Type v} [TopologicalSpace Y] |
| 40 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) Y] [IsManifold (𝓡 3) ∞ Y] |
| 41 | (P : RicciFlow 3 Y (Icc (-T) 0)) |
| 42 | {ι : Type w} [Finite ι] |
| 43 | (U Kchart : ι → Set (EuclideanSpace ℝ (Fin 3))) |
| 44 | (hU : ∀ i, IsOpen (U i)) (hKchart : ∀ i, IsCompact (Kchart i)) |
| 45 | (hKU : ∀ i, Kchart i ⊆ U i) |
| 46 | (ψ : ι → EuclideanSpace ℝ (Fin 3) → Y) |
| 47 | (hψ : ∀ i, ContMDiffOn (𝓡 3) (𝓡 3) ∞ (ψ i) (U i)) |
| 48 | (K : Set Y) (hK : IsCompact K) (d : ℕ) {delta : ℝ} (hdelta : 0 < delta) : |
| 49 | ∃ s : ℝ, s ∈ Icc (-T) 0 ∧ -delta < s ∧ t + s / Q ∈ F.interval ∧ |
| 50 | generalizedSliceStrongCanonicalNeighborhoods F epsilon C |
| 51 | (4 * F.scalar ⟨t, xbase⟩) (t + s / Q) ∧ |
| 52 | (∀ i m, m ≤ d → ∀ z ∈ Kchart i, |
| 53 | ‖iteratedFDeriv ℝ m ((P.metric s).pullbackCoefficients (ψ i)) z - |
| 54 | iteratedFDeriv ℝ m ((P.metric 0).pullbackCoefficients (ψ i)) z‖ < delta) ∧ |
| 55 | ∀ y ∈ K, |(P.connection s).scalarCurvature y - |
| 56 | (P.connection 0).scalarCurvature y| < delta := by |
| 57 | let J : Set ℝ := Icc (-T) 0 |
| 58 | have hzero : (0 : ℝ) ∈ J := ⟨by linarith, le_rfl⟩ |
| 59 | have hJ : UniqueDiffOn ℝ J := uniqueDiffOn_Icc (by linarith) |
| 60 | have hjet (i : ι) (m : ℕ) : ∀ᶠ s in 𝓝[J] (0 : ℝ), ∀ z ∈ Kchart i, |
| 61 | ‖iteratedFDeriv ℝ m ((P.metric s).pullbackCoefficients (ψ i)) z - |
| 62 | iteratedFDeriv ℝ m ((P.metric 0).pullbackCoefficients (ψ i)) z‖ < delta := by |
| 63 | have hcoeff := P.smooth.contDiffOn_spacetime_pullbackCoefficients_within |
| 64 | (hU i) (hψ i) |
| 65 | have hcontinuous := M28.continuousOn_spatialJet_of_within hJ (hU i) hcoeff m |
| 66 | obtain ⟨V, hV, hclose⟩ := (hKchart i).mem_uniformity_of_prod |
| 67 | (f := fun s z => iteratedFDeriv ℝ m |
| 68 | ((P.metric s).pullbackCoefficients (ψ i)) z) |
| 69 | (s := J) (hcontinuous.mono (Set.prod_mono_right (hKU i))) hzero |
| 70 | (Metric.dist_mem_uniformity hdelta) |
| 71 | filter_upwards [hV] with s hs |
| 72 | intro z hz |
| 73 | simpa only [Set.mem_ofPred_eq, dist_eq_norm] using! hclose s hs z hz |
| 74 | have hscalar : ∀ᶠ s in 𝓝[J] (0 : ℝ), ∀ y ∈ K, |
| 75 | |(P.connection s).scalarCurvature y - |
| 76 | (P.connection 0).scalarCurvature y| < delta := by |
| 77 | have hcontinuous := P.contMDiffOn_scalarCurvature.continuousOn |
| 78 | obtain ⟨V, hV, hclose⟩ := hK.mem_uniformity_of_prod |
| 79 | (f := fun s y => (P.connection s).scalarCurvature y) |
| 80 | (s := J) (hcontinuous.mono (Set.prod_mono_right (subset_univ K))) hzero |
| 81 | (Metric.dist_mem_uniformity hdelta) |
| 82 | filter_upwards [hV] with s hs |
| 83 | intro y hy |
| 84 | simpa only [Set.mem_ofPred_eq, Real.dist_eq] using! hclose s hs y hy |
| 85 | have hfinite : ∀ᶠ s in 𝓝[J] (0 : ℝ), ∀ i, ∀ m : Fin (d + 1), ∀ z ∈ Kchart i, |
| 86 | ‖iteratedFDeriv ℝ (m : ℕ) ((P.metric s).pullbackCoefficients (ψ i)) z - |
| 87 | iteratedFDeriv ℝ (m : ℕ) ((P.metric 0).pullbackCoefficients (ψ i)) z‖ < delta := |
| 88 | Filter.eventually_all.mpr fun i => |
| 89 | Filter.eventually_all.mpr fun m : Fin (d + 1) => hjet i m |
| 90 | obtain ⟨radius, hradius, hnear⟩ := |
| 91 | Metric.mem_nhdsWithin_iff.mp (hfinite.and hscalar) |
| 92 | let b := min T (min delta radius) |
| 93 | have hb : 0 < b := lt_min hT (lt_min hdelta hradius) |
| 94 | have hbT : b ≤ T := min_le_left _ _ |
| 95 | have hbdelta : b ≤ delta := (min_le_right _ _).trans (min_le_left _ _) |
| 96 | have hbradius : b ≤ radius := (min_le_right _ _).trans (min_le_right _ _) |
| 97 | obtain ⟨u, huF, hulower, hupper, hgood⟩ := |
| 98 | hdense t htF le_rfl (t - b / Q) (sub_lt_self _ (div_pos hb hQ)) |
| 99 | let s := Q * (u - t) |
| 100 | have hslower : -b < s := by |
| 101 | have hdiv : -b / Q < u - t := by |
| 102 | rw [neg_div] |
| 103 | linarith |
| 104 | have hmul := (div_lt_iff₀ hQ).mp hdiv |
| 105 | simpa only [s, mul_comm] using hmul |
| 106 | have hsupper : s ≤ 0 := |
| 107 | mul_nonpos_of_nonneg_of_nonpos hQ.le (sub_nonpos.mpr hupper) |
| 108 | have hsJ : s ∈ J := ⟨by linarith, hsupper⟩ |
| 109 | have hclock : t + s / Q = u := by |
| 110 | dsimp only [s] |
| 111 | field_simp [hQ.ne'] |
| 112 | ring |
| 113 | have hsball : s ∈ Metric.ball (0 : ℝ) radius := by |
| 114 | change dist s 0 < radius |
| 115 | rw [Real.dist_eq, sub_zero, abs_of_nonpos hsupper] |
| 116 | linarith |
| 117 | obtain ⟨hjets, hscalars⟩ := hnear ⟨hsball, hsJ⟩ |
| 118 | refine ⟨s, hsJ, by linarith, ?_, ?_, ?_, hscalars⟩ |
| 119 | · rwa [hclock] |
| 120 | · rwa [hclock] |
| 121 | · intro i m hm z hz |
| 122 | exact hjets i ⟨m, by omega⟩ z hz |
| 123 | |
| 124 | end PoincareMT.M30 |