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.ReducedGeometry.Exponential.Families.FamilyDensity |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Calculus.Differential.CompactPartialDerivative |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Exponential |
| 4 | |
| 5 | /-! |
| 6 | # Smooth candidate coordinates and density on one closed rectangle |
| 7 | |
| 8 | The same actual family controls coordinate speed and actual square |
| 9 | action density. Both remain smooth through the closed time endpoints. |
| 10 | Morgan-Tian equation (6.2), Lemma 6.22 and Corollary 6.79, |
| 11 | pp. 106, 115-116, 144-145. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | -- Product self-models retain the actual initial-fiber metric topology. |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set |
| 19 | open scoped Manifold ContDiff Bundle |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.M14 |
| 24 | |
| 25 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 26 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 27 | {T : ℝ} {x : G.Point} |
| 28 | |
| 29 | /-- A physical survival-and-capture interval gives the genuine smooth |
| 30 | closed square-time family in its fixed gauge, Lemma 6.22, |
| 31 | pp. 115-116. -/ |
| 32 | theorem smallTimeCandidate_family_smooth (E : M14ExponentialFamily G T x) |
| 33 | {U : Set (G.Horizontal x)} {O : Set G.Point} {η : ℝ} (hη : 0 ≤ η) |
| 34 | (hcapture : ∀ W ∈ U, ∀ σ ∈ Icc 0 η, |
| 35 | (W, Real.sqrt σ) ∈ E.domain ∧ E.gamma W (Real.sqrt σ) ∈ O) : |
| 36 | let metric := G.spacetime.horizontalMetric.toRiemannianMetric |
| 37 | letI : NormedAddCommGroup (G.Horizontal x) := |
| 38 | (metric.toCore x).toNormedAddCommGroupOfTopology |
| 39 | (metric.continuousAt x) (metric.isVonNBounded x) |
| 40 | letI : InnerProductSpace ℝ (G.Horizontal x) := |
| 41 | .ofCoreOfTopology (metric.toCore x) (metric.continuousAt x) (metric.isVonNBounded x) |
| 42 | ContMDiffOn ((𝓘(ℝ, ℝ)).prod 𝓘(ℝ, G.Horizontal x)) (spacetimeModel n) ∞ |
| 43 | (fun z : ℝ × G.Horizontal x => E.gamma z.2 z.1) (Icc 0 (Real.sqrt η) ×ˢ U) ∧ |
| 44 | ∀ W ∈ U, ∀ s ∈ Icc 0 (Real.sqrt η), |
| 45 | (W, s) ∈ E.domain ∧ E.gamma W s ∈ O := by |
| 46 | let metric := G.spacetime.horizontalMetric.toRiemannianMetric |
| 47 | let : NormedAddCommGroup (G.Horizontal x) := |
| 48 | (metric.toCore x).toNormedAddCommGroupOfTopology |
| 49 | (metric.continuousAt x) (metric.isVonNBounded x) |
| 50 | let : InnerProductSpace ℝ (G.Horizontal x) := |
| 51 | .ofCoreOfTopology (metric.toCore x) (metric.continuousAt x) (metric.isVonNBounded x) |
| 52 | let : Bundle.RiemannianBundle (G.Horizontal : G.Point → Type _) := ⟨metric⟩ |
| 53 | have hmap (W : G.Horizontal x) (hW : W ∈ U) (s : ℝ) |
| 54 | (hs : s ∈ Icc 0 (Real.sqrt η)) : (W, s) ∈ E.domain ∧ E.gamma W s ∈ O := by |
| 55 | have hsη : s ^ 2 ≤ η := ((sq_le_sq₀ hs.1 (Real.sqrt_nonneg η)).mpr hs.2).trans_eq |
| 56 | (Real.sq_sqrt hη) |
| 57 | simpa only [Real.sqrt_sq hs.1] using hcapture W hW (s ^ 2) ⟨sq_nonneg s, hsη⟩ |
| 58 | have hE : ContMDiffOn ((𝓘(ℝ, G.Horizontal x)).prod (𝓘(ℝ, ℝ))) |
| 59 | (spacetimeModel n) ∞ (fun z => E.gamma z.1 z.2) E.domain := E.family_smooth |
| 60 | exact ⟨hE.comp (contMDiff_snd.prodMk contMDiff_fst).contMDiffOn |
| 61 | (fun z hz => (hmap z.2 hz.2 z.1 hz.1).1), hmap⟩ |
| 62 | |
| 63 | /-- One compact initial set has a uniform bound for the actual |
| 64 | coordinate within derivative on the full common square interval, |
| 65 | Corollary 6.79, pp. 144-145. -/ |
| 66 | theorem exists_smallTimeCandidate_coordinate_bound (E : M14ExponentialFamily G T x) |
| 67 | (b : G.gaugeCover.index) |
| 68 | (lift : G.Point → (G.timeIntervals.interval (G.gaugeCover.interval b)).Point × |
| 69 | G.gaugeCover.spatial b) |
| 70 | {U K : Set (G.Horizontal x)} (hU : IsOpen U) (hK : IsCompact K) (hKU : K ⊆ U) |
| 71 | {O : Set G.Point} (hlift : ContMDiffOn (spacetimeModel n) (spacetimeModel n) ∞ lift O) |
| 72 | {η : ℝ} (hη : 0 < η) |
| 73 | (hcapture : ∀ W ∈ U, ∀ σ ∈ Icc 0 η, |
| 74 | (W, Real.sqrt σ) ∈ E.domain ∧ E.gamma W (Real.sqrt σ) ∈ O) : |
| 75 | let metric := G.spacetime.horizontalMetric.toRiemannianMetric |
| 76 | letI : NormedAddCommGroup (G.Horizontal x) := |
| 77 | (metric.toCore x).toNormedAddCommGroupOfTopology |
| 78 | (metric.continuousAt x) (metric.isVonNBounded x) |
| 79 | letI : InnerProductSpace ℝ (G.Horizontal x) := |
| 80 | .ofCoreOfTopology (metric.toCore x) (metric.continuousAt x) (metric.isVonNBounded x) |
| 81 | ContDiffOn ℝ ∞ (fun z : ℝ × G.Horizontal x => (lift (E.gamma z.2 z.1)).2.val) |
| 82 | (Icc 0 (Real.sqrt η) ×ˢ U) ∧ |
| 83 | ∃ M : ℝ, 0 ≤ M ∧ ∀ W ∈ K, ∀ s ∈ Icc 0 (Real.sqrt η), |
| 84 | ‖derivWithin (fun r => (lift (E.gamma W r)).2.val) (Icc 0 (Real.sqrt η)) s‖ ≤ M := by |
| 85 | let metric := G.spacetime.horizontalMetric.toRiemannianMetric |
| 86 | let : NormedAddCommGroup (G.Horizontal x) := |
| 87 | (metric.toCore x).toNormedAddCommGroupOfTopology |
| 88 | (metric.continuousAt x) (metric.isVonNBounded x) |
| 89 | let : InnerProductSpace ℝ (G.Horizontal x) := |
| 90 | .ofCoreOfTopology (metric.toCore x) (metric.continuousAt x) (metric.isVonNBounded x) |
| 91 | let : Bundle.RiemannianBundle (G.Horizontal : G.Point → Type _) := ⟨metric⟩ |
| 92 | obtain ⟨hγ, hmap⟩ := smallTimeCandidate_family_smooth E hη.le hcapture |
| 93 | have hL := hlift.comp hγ (fun z hz => (hmap z.2 hz.2 z.1 hz.1).2) |
| 94 | have hv : ContMDiff (𝓡 n) (𝓡 n) ∞ |
| 95 | (Subtype.val : G.gaugeCover.spatial b → EuclideanSpace ℝ (Fin n)) := |
| 96 | contMDiff_subtype_val |
| 97 | have hcoord : ContDiffOn ℝ ∞ |
| 98 | (fun z : ℝ × G.Horizontal x => (lift (E.gamma z.2 z.1)).2.val) |
| 99 | (Icc 0 (Real.sqrt η) ×ˢ U) := by |
| 100 | have h := hv.comp_contMDiffOn (fun z hz => (hL z hz).snd) |
| 101 | rw [← modelWithCornersSelf_prod, chartedSpaceSelf_prod] at h |
| 102 | exact h.contDiffOn |
| 103 | exact ⟨hcoord, hcoord.exists_uniform_derivWithin_bound_fst |
| 104 | (uniqueDiffOn_Icc (Real.sqrt_pos.mpr hη)) isCompact_Icc hU hK hKU⟩ |
| 105 | |
| 106 | /-- The actual square-action density has one nonnegative upper bound |
| 107 | on a compact initial family and closed square interval. Its value at |
| 108 | zero is the smooth density, never the arbitrary `E.action` convention, |
| 109 | equation (6.2) and Corollary 6.79, pp. 106, 144-145. -/ |
| 110 | theorem exists_smallTimeCandidate_density_bound |
| 111 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) (E : M14ExponentialFamily G T x) |
| 112 | {U K : Set (G.Horizontal x)} (hU : IsOpen U) (hK : IsCompact K) (hKU : K ⊆ U) |
| 113 | {O : Set G.Point} {η : ℝ} (hη : 0 < η) |
| 114 | (hcapture : ∀ W ∈ U, ∀ σ ∈ Icc 0 η, |
| 115 | (W, Real.sqrt σ) ∈ E.domain ∧ E.gamma W (Real.sqrt σ) ∈ O) : |
| 116 | ∃ A : ℝ, 0 ≤ A ∧ ∀ W ∈ K, ∀ s ∈ Icc 0 (Real.sqrt η), |
| 117 | squareCurveDensity G (E.gamma W) (Icc 0 (Real.sqrt η)) s ≤ A := by |
| 118 | let metric := G.spacetime.horizontalMetric.toRiemannianMetric |
| 119 | let : NormedAddCommGroup (G.Horizontal x) := |
| 120 | (metric.toCore x).toNormedAddCommGroupOfTopology |
| 121 | (metric.continuousAt x) (metric.isVonNBounded x) |
| 122 | let : InnerProductSpace ℝ (G.Horizontal x) := |
| 123 | .ofCoreOfTopology (metric.toCore x) (metric.continuousAt x) (metric.isVonNBounded x) |
| 124 | let : Bundle.RiemannianBundle (G.Horizontal : G.Point → Type _) := ⟨metric⟩ |
| 125 | have hγ := (smallTimeCandidate_family_smooth E hη.le hcapture).1 |
| 126 | have hd := squareFamilyDensity_contDiffOn hM12 |
| 127 | (uniqueDiffOn_Icc (Real.sqrt_pos.mpr hη)) hU hγ |
| 128 | obtain ⟨A, hA⟩ := (isCompact_Icc.prod hK).exists_bound_of_continuousOn |
| 129 | (hd.continuousOn.mono (fun _ hz => ⟨hz.1, hKU hz.2⟩)) |
| 130 | refine ⟨max A 0, le_max_right _ _, ?_⟩ |
| 131 | intro W hW s hs |
| 132 | have h := hA (s, W) ⟨hs, hW⟩ |
| 133 | rw [Real.norm_eq_abs] at h |
| 134 | exact (le_abs_self _).trans (h.trans (le_max_left _ _)) |
| 135 | |
| 136 | end PoincareMT.M14 |