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.StandardCap.Existence.RotationInvariance.CompatibleEndIntegral |
| 2 | import Mathlib.Algebra.BigOperators.Fin |
| 3 | |
| 4 | /-! |
| 5 | # Three-neighbor control for compatible indexed end flows |
| 6 | |
| 7 | The three fixed slabs cover the cutoff support. Each source integral |
| 8 | is transported to its neighboring plateau using the actual metric |
| 9 | compatibilities at the tested included time. One constant precedes both |
| 10 | indexed families. This is Section 12.5, pp. 309-319 and Proposition 12.7, |
| 11 | pp. 298-299; see compatible-reference-energy.md. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | set_option maxSynthPendingDepth 8 |
| 17 | |
| 18 | open Set MeasureTheory |
| 19 | open scoped Manifold ContDiff BigOperators |
| 20 | |
| 21 | namespace PoincareMT.M34 |
| 22 | |
| 23 | open DifferenceEnergy |
| 24 | |
| 25 | /-- Actual compatible flow families satisfy one uniform three-neighbor |
| 26 | support-integral estimate (Section 12.5, pp. 309-319). -/ |
| 27 | theorem exists_compatibleEnd_neighbor_bound |
| 28 | {g : RiemannianMetric 3 StandardCapSpace} (e : StandardCylindricalEnd g) |
| 29 | {dH dA dS : ℕ} (qH : FH 3 ≃L[ℝ] EuclideanSpace ℝ (Fin dH)) |
| 30 | (qA : FA 3 ≃L[ℝ] EuclideanSpace ℝ (Fin dA)) |
| 31 | (qS : FS 3 ≃L[ℝ] EuclideanSpace ℝ (Fin dS)) : |
| 32 | letI := (endReferenceRegion_isOpen e).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 33 | letI := (endReferenceRegion_isOpen e).isOpenEmbedding_subtypeVal.isManifold_singleton |
| 34 | (I := 𝓡 3) (n := ∞) |
| 35 | letI : MeasurableSpace StandardCapSpace := borel _ |
| 36 | letI : BorelSpace StandardCapSpace := ⟨rfl⟩ |
| 37 | ∃ C : ℝ, 0 ≤ C ∧ ∀ {J J' : Set ℝ} |
| 38 | (F : ℕ → RicciFlow 3 (endReferenceRegion e) J) |
| 39 | (F' : ℕ → RicciFlow 3 (endReferenceRegion e) J') |
| 40 | (p : endReferenceRegion e) {t : ℝ}, t ∈ J ∩ J' → |
| 41 | (∀ (i j : ℕ) (r : ℝ), (r = -1 ∨ r = 0 ∨ r = 1) → (i : ℝ) = r + (j : ℝ) → |
| 42 | ∀ y ∈ endReferenceOverlap e r, ∀ u v : TangentSpace (𝓡 3) y, |
| 43 | ((F i).metric t).inner y u v = |
| 44 | ((F j).metric t).inner (endReferenceTransition e p r y) |
| 45 | (mfderiv (𝓡 3) (𝓡 3) (endReferenceTransition e p r) y u) |
| 46 | (mfderiv (𝓡 3) (𝓡 3) (endReferenceTransition e p r) y v)) → |
| 47 | (∀ (i j : ℕ) (r : ℝ), (r = -1 ∨ r = 0 ∨ r = 1) → (i : ℝ) = r + (j : ℝ) → |
| 48 | ∀ y ∈ endReferenceOverlap e r, ∀ u v : TangentSpace (𝓡 3) y, |
| 49 | ((F' i).metric t).inner y u v = |
| 50 | ((F' j).metric t).inner (endReferenceTransition e p r y) |
| 51 | (mfderiv (𝓡 3) (𝓡 3) (endReferenceTransition e p r) y u) |
| 52 | (mfderiv (𝓡 3) (𝓡 3) (endReferenceTransition e p r) y v)) → |
| 53 | let rho := fun j : ℕ => canonicalDifferenceDensity |
| 54 | (endReferenceRegion e) (endReferenceRegion_isOpen e) qH qA qS (F j) (F' j) p t |
| 55 | ∀ j : ℕ, (∫ x in tsupport (endEnergyCutoff e), rho (j + 1) x) ≤ |
| 56 | C * ((∫ x, endEnergyCutoff e x ^ 2 * rho j x) + |
| 57 | (∫ x, endEnergyCutoff e x ^ 2 * rho (j + 1) x) + |
| 58 | (∫ x, endEnergyCutoff e x ^ 2 * rho (j + 2) x)) := by |
| 59 | let := (endReferenceRegion_isOpen e).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 60 | let := (endReferenceRegion_isOpen e).isOpenEmbedding_subtypeVal.isManifold_singleton |
| 61 | (I := 𝓡 3) (n := ∞) |
| 62 | let : MeasurableSpace StandardCapSpace := borel _ |
| 63 | let : BorelSpace StandardCapSpace := ⟨rfl⟩ |
| 64 | let K := endClosedSlab e (31 / 10) (49 / 10) |
| 65 | have hK : IsCompact K := endClosedSlab_isCompact e (by norm_num) |
| 66 | have hKU : K ⊆ endReferenceRegion e := |
| 67 | endClosedSlab_subset_reference e (by norm_num) (by norm_num) |
| 68 | have himLow : endAxialTranslation e (-(1 : ℝ)) '' endClosedSlab e (41 / 10) (23 / 5) = |
| 69 | endClosedSlab e (31 / 10) (18 / 5) := by |
| 70 | convert endClosedSlab_translation e (a := 41 / 10) (b := 23 / 5) (by norm_num) (-1) using 1 |
| 71 | norm_num |
| 72 | have himMid : endAxialTranslation e (-(0 : ℝ)) '' endClosedSlab e (17 / 5) (23 / 5) = |
| 73 | endClosedSlab e (17 / 5) (23 / 5) := by |
| 74 | simpa using endClosedSlab_translation e (a := 17 / 5) (b := 23 / 5) (by norm_num) 0 |
| 75 | have himHigh : endAxialTranslation e (-(-1 : ℝ)) '' endClosedSlab e (17 / 5) (39 / 10) = |
| 76 | endClosedSlab e (22 / 5) (49 / 10) := by |
| 77 | convert endClosedSlab_translation e (a := 17 / 5) (b := 39 / 10) (by norm_num) 1 using 1 <;> |
| 78 | norm_num |
| 79 | obtain ⟨Cl, hCl, hl⟩ := exists_compatibleEnd_integral_bound e qH qA qS hK hKU |
| 80 | (endClosedSlab_isCompact e (a := 41 / 10) (b := 23 / 5) (by norm_num)) |
| 81 | (endClosedSlab_mono e (by norm_num) (by norm_num)) |
| 82 | (r := 1) (Or.inr (Or.inr rfl)) |
| 83 | (by rw [himLow]; exact endClosedSlab_mono e le_rfl (by norm_num)) |
| 84 | (fun x hx => endEnergyCutoff_eq_one_on_slab e |
| 85 | (endClosedSlab_mono e (by norm_num) le_rfl hx)) |
| 86 | obtain ⟨Cm, hCm, hm⟩ := exists_compatibleEnd_integral_bound e qH qA qS hK hKU |
| 87 | (endClosedSlab_isCompact e (a := 17 / 5) (b := 23 / 5) (by norm_num)) |
| 88 | (endClosedSlab_mono e (by norm_num) (by norm_num)) |
| 89 | (r := 0) (Or.inr (Or.inl rfl)) |
| 90 | (by rw [himMid]; exact endClosedSlab_mono e (by norm_num) (by norm_num)) |
| 91 | (fun x hx => endEnergyCutoff_eq_one_on_slab e hx) |
| 92 | obtain ⟨Ch, hCh, hh⟩ := exists_compatibleEnd_integral_bound e qH qA qS hK hKU |
| 93 | (endClosedSlab_isCompact e (a := 17 / 5) (b := 39 / 10) (by norm_num)) |
| 94 | (endClosedSlab_mono e (by norm_num) (by norm_num)) |
| 95 | (r := -1) (Or.inl rfl) |
| 96 | (by rw [himHigh]; exact endClosedSlab_mono e (by norm_num) le_rfl) |
| 97 | (fun x hx => endEnergyCutoff_eq_one_on_slab e |
| 98 | (endClosedSlab_mono e le_rfl (by norm_num) hx)) |
| 99 | let C := max Cl (max Cm Ch) |
| 100 | have hClC : Cl ≤ C := le_max_left _ _ |
| 101 | have hCmC : Cm ≤ C := (le_max_left _ _).trans (le_max_right _ _) |
| 102 | have hChC : Ch ≤ C := (le_max_right _ _).trans (le_max_right _ _) |
| 103 | refine ⟨C, hCl.trans hClC, ?_⟩ |
| 104 | intro J J' F F' p t ht hF hF' rho j |
| 105 | have hli : ((j + 1 : ℕ) : ℝ) = 1 + (j : ℝ) := by push_cast; ring |
| 106 | have hmi : ((j + 1 : ℕ) : ℝ) = 0 + ((j + 1 : ℕ) : ℝ) := by rw [zero_add] |
| 107 | have hhi : ((j + 1 : ℕ) : ℝ) = -1 + ((j + 2 : ℕ) : ℝ) := by push_cast; ring |
| 108 | have hlow := hl (F (j + 1)) (F' (j + 1)) (F j) (F' j) p ht ht |
| 109 | (hF (j + 1) j 1 (Or.inr (Or.inr rfl)) hli) |
| 110 | (hF' (j + 1) j 1 (Or.inr (Or.inr rfl)) hli) |
| 111 | have hmid := hm (F (j + 1)) (F' (j + 1)) (F (j + 1)) (F' (j + 1)) p ht ht |
| 112 | (hF (j + 1) (j + 1) 0 (Or.inr (Or.inl rfl)) hmi) |
| 113 | (hF' (j + 1) (j + 1) 0 (Or.inr (Or.inl rfl)) hmi) |
| 114 | have hhigh := hh (F (j + 1)) (F' (j + 1)) (F (j + 2)) (F' (j + 2)) p ht ht |
| 115 | (hF (j + 1) (j + 2) (-1) (Or.inl rfl) hhi) |
| 116 | (hF' (j + 1) (j + 2) (-1) (Or.inl rfl) hhi) |
| 117 | rw [himLow] at hlow |
| 118 | rw [himMid] at hmid |
| 119 | rw [himHigh] at hhigh |
| 120 | let W : Fin 3 → Set StandardCapSpace := ![endClosedSlab e (31 / 10) (18 / 5), |
| 121 | endClosedSlab e (17 / 5) (23 / 5), endClosedSlab e (22 / 5) (49 / 10)] |
| 122 | have hW (i : Fin 3) : IsCompact (W i) := by |
| 123 | fin_cases i <;> exact endClosedSlab_isCompact e (by norm_num) |
| 124 | have hWU (i : Fin 3) : W i ⊆ endReferenceRegion e := by |
| 125 | fin_cases i <;> exact endClosedSlab_subset_reference e (by norm_num) (by norm_num) |
| 126 | have hc : ContinuousOn (rho (j + 1)) (endReferenceRegion e) := |
| 127 | canonicalDifferenceDensity_continuousOn_slice _ _ qH qA qS _ _ p ht |
| 128 | have h0 (k : ℕ) (x : StandardCapSpace) : 0 ≤ rho k x := |
| 129 | canonicalDifferenceDensity_nonneg _ _ qH qA qS _ _ p t x |
| 130 | have hcover : tsupport (endEnergyCutoff e) ⊆ ⋃ i ∈ (Finset.univ : Finset (Fin 3)), W i := by |
| 131 | intro x hx |
| 132 | rcases endEnergyCutoff_tsupport_subset_three_slabs e hx with (hlow | hmid) | hhigh |
| 133 | · exact mem_iUnion.mpr ⟨0, mem_iUnion.mpr ⟨Finset.mem_univ _, hlow⟩⟩ |
| 134 | · exact mem_iUnion.mpr ⟨1, mem_iUnion.mpr ⟨Finset.mem_univ _, hmid⟩⟩ |
| 135 | · exact mem_iUnion.mpr ⟨2, mem_iUnion.mpr ⟨Finset.mem_univ _, hhigh⟩⟩ |
| 136 | have hsum := setIntegral_le_finsetSum_of_cover (μ := volume) Finset.univ |
| 137 | (isClosed_tsupport (endEnergyCutoff e)).measurableSet (fun i _ => (hW i).measurableSet) |
| 138 | (ContinuousOn.integrableOn_compact (energyCutoffs_hasCompactSupport e).1 |
| 139 | (hc.mono (endEnergyCutoff_tsupport_subset_region e))) |
| 140 | (fun i _ => ContinuousOn.integrableOn_compact (hW i) (hc.mono (hWU i))) (h0 (j + 1)) hcover |
| 141 | have hsupport : (∫ x in tsupport (endEnergyCutoff e), rho (j + 1) x) ≤ |
| 142 | (∫ x in W 0, rho (j + 1) x) + (∫ x in W 1, rho (j + 1) x) + |
| 143 | (∫ x in W 2, rho (j + 1) x) := by |
| 144 | simpa only [Fin.sum_univ_three] using hsum |
| 145 | have hE (k : ℕ) : 0 ≤ ∫ x, endEnergyCutoff e x ^ 2 * rho k x := |
| 146 | integral_nonneg (fun x => mul_nonneg (sq_nonneg _) (h0 k x)) |
| 147 | calc |
| 148 | _ ≤ (∫ x in W 0, rho (j + 1) x) + (∫ x in W 1, rho (j + 1) x) + |
| 149 | (∫ x in W 2, rho (j + 1) x) := hsupport |
| 150 | _ ≤ Cl * (∫ x, endEnergyCutoff e x ^ 2 * rho j x) + |
| 151 | Cm * (∫ x, endEnergyCutoff e x ^ 2 * rho (j + 1) x) + |
| 152 | Ch * (∫ x, endEnergyCutoff e x ^ 2 * rho (j + 2) x) := |
| 153 | add_le_add (add_le_add hlow hmid) hhigh |
| 154 | _ ≤ C * (∫ x, endEnergyCutoff e x ^ 2 * rho j x) + |
| 155 | C * (∫ x, endEnergyCutoff e x ^ 2 * rho (j + 1) x) + |
| 156 | C * (∫ x, endEnergyCutoff e x ^ 2 * rho (j + 2) x) := |
| 157 | add_le_add (add_le_add (mul_le_mul_of_nonneg_right hClC (hE j)) |
| 158 | (mul_le_mul_of_nonneg_right hCmC (hE (j + 1)))) |
| 159 | (mul_le_mul_of_nonneg_right hChC (hE (j + 2))) |
| 160 | _ = _ := by ring |
| 161 | |
| 162 | end PoincareMT.M34 |