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.IndexedEnergy |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Existence.RotationInvariance.BoundarySupportIntegral |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Existence.RotationInvariance.EndNeighborIntegral |
| 4 | |
| 5 | /-! |
| 6 | # Support integrals for the actual indexed energies |
| 7 | |
| 8 | The two exceptional rows use the fixed core band. Every later row uses |
| 9 | the three actual neighboring translated energies. This is Morgan-Tian |
| 10 | Section 12.5, pp. 309-319 and core-energy-comparison-api.md. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | -- Actual curvature takes values in three nested Hom spaces. |
| 16 | set_option maxSynthPendingDepth 8 |
| 17 | |
| 18 | open Set MeasureTheory |
| 19 | open scoped Manifold ContDiff |
| 20 | |
| 21 | namespace PoincareMT.M34 |
| 22 | |
| 23 | open DifferenceEnergy |
| 24 | |
| 25 | variable {g : RiemannianMetric 3 StandardCapSpace} (e : StandardCylindricalEnd g) |
| 26 | {dH dA dS : ℕ} (qH : FH 3 ≃L[ℝ] EuclideanSpace ℝ (Fin dH)) |
| 27 | (qA : FA 3 ≃L[ℝ] EuclideanSpace ℝ (Fin dA)) |
| 28 | (qS : FS 3 ≃L[ℝ] EuclideanSpace ℝ (Fin dS)) |
| 29 | |
| 30 | /-- The unweighted actual density integral on each cutoff support |
| 31 | (Section 12.5, pp. 309-319). -/ |
| 32 | noncomputable def capDifferenceSupportIntegral {J J' : Set ℝ} |
| 33 | (F : RicciFlow 3 StandardCapSpace J) (F' : RicciFlow 3 StandardCapSpace J') |
| 34 | (p : endReferenceRegion e) : ℕ → ℝ → ℝ := |
| 35 | letI := (endReferenceRegion_isOpen e).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 36 | letI := (endReferenceRegion_isOpen e).isOpenEmbedding_subtypeVal.isManifold_singleton |
| 37 | (I := 𝓡 3) (n := ∞) |
| 38 | letI : MeasurableSpace StandardCapSpace := borel _ |
| 39 | letI : BorelSpace StandardCapSpace := ⟨rfl⟩ |
| 40 | fun i t => match i with |
| 41 | | 0 => ∫ x in tsupport (coreEnergyCutoff e), |
| 42 | actualDifferenceEnergyDensity qH qA qS (F.connection t) (F'.connection t) x |
| 43 | | j + 1 => ∫ x in tsupport (endEnergyCutoff e), |
| 44 | canonicalDifferenceDensity (endReferenceRegion e) (endReferenceRegion_isOpen e) qH qA qS |
| 45 | (endPullbackFlow e F j (by have := Nat.cast_nonneg (α := ℝ) j; linarith)) |
| 46 | (endPullbackFlow e F' j (by have := Nat.cast_nonneg (α := ℝ) j; linarith)) p t x |
| 47 | |
| 48 | /-- Each actual support integral is nonnegative at every total time |
| 49 | (Section 12.5, pp. 309-319). -/ |
| 50 | theorem capDifferenceSupportIntegral_nonneg {J J' : Set ℝ} |
| 51 | (F : RicciFlow 3 StandardCapSpace J) (F' : RicciFlow 3 StandardCapSpace J') |
| 52 | (p : endReferenceRegion e) (i : ℕ) (t : ℝ) : |
| 53 | 0 ≤ capDifferenceSupportIntegral e qH qA qS F F' p i t := by |
| 54 | cases i with |
| 55 | | zero => exact integral_nonneg (actualDifferenceEnergyDensity_nonneg qH qA qS _ _) |
| 56 | | succ j => exact integral_nonneg (canonicalDifferenceDensity_nonneg _ _ qH qA qS _ _ p t) |
| 57 | |
| 58 | /-- One geometric constant controls both boundary rows and all interior |
| 59 | rows of the actual support integrals (Section 12.5, pp. 309-319). -/ |
| 60 | theorem exists_capDifferenceSupportIntegral_bound : |
| 61 | ∃ C : ℝ, 0 ≤ C ∧ ∀ {J J' : Set ℝ} |
| 62 | (F : RicciFlow 3 StandardCapSpace J) (F' : RicciFlow 3 StandardCapSpace J') |
| 63 | (p : endReferenceRegion e) {t : ℝ}, t ∈ J ∩ J' → |
| 64 | let E := capDifferenceEnergy e qH qA qS F F' p |
| 65 | let S := capDifferenceSupportIntegral e qH qA qS F F' p |
| 66 | S 0 t ≤ C * (E 0 t + E 1 t + E 2 t) ∧ |
| 67 | S 1 t ≤ C * (E 0 t + E 1 t + E 2 t) ∧ |
| 68 | ∀ j : ℕ, S (j + 2) t ≤ C * (E (j + 1) t + E (j + 2) t + E (j + 3) t) := by |
| 69 | let := (isOpen_univ : IsOpen (univ : Set (V 3))).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 70 | let := (isOpen_univ : IsOpen (univ : Set (V 3))).isOpenEmbedding_subtypeVal.isManifold_singleton |
| 71 | (I := 𝓡 3) (n := ∞) |
| 72 | let := (endReferenceRegion_isOpen e).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 73 | let := (endReferenceRegion_isOpen e).isOpenEmbedding_subtypeVal.isManifold_singleton |
| 74 | (I := 𝓡 3) (n := ∞) |
| 75 | let : MeasurableSpace StandardCapSpace := borel _ |
| 76 | let : BorelSpace StandardCapSpace := ⟨rfl⟩ |
| 77 | obtain ⟨Cb, hCb, hb⟩ := exists_boundarySupport_integral_bound e qH qA qS |
| 78 | obtain ⟨Cn, _hCn, hn⟩ := exists_endNeighbor_integral_bound e qH qA qS |
| 79 | refine ⟨max Cb Cn, hCb.trans (le_max_left _ _), ?_⟩ |
| 80 | intro J J' F F' p t ht E S |
| 81 | have hE (i) : 0 ≤ E i t := capDifferenceEnergy_nonneg e qH qA qS F F' p i t |
| 82 | have hboundary : S 0 t ≤ Cb * (E 0 t + E 1 t + E 2 t) ∧ |
| 83 | S 1 t ≤ Cb * (E 0 t + E 1 t + E 2 t) := by |
| 84 | simpa only [S, E, capDifferenceSupportIntegral, capDifferenceEnergy, |
| 85 | canonicalDifferenceEnergy, canonicalCoreFlow_chart_density] using hb F F' p ht |
| 86 | have hnbr (j : ℕ) : S (j + 2) t ≤ Cn * (E (j + 1) t + E (j + 2) t + E (j + 3) t) := by |
| 87 | simpa only [S, E, capDifferenceSupportIntegral, capDifferenceEnergy, |
| 88 | canonicalDifferenceEnergy] using hn F F' p ht j |
| 89 | have hB : 0 ≤ E 0 t + E 1 t + E 2 t := add_nonneg (add_nonneg (hE 0) (hE 1)) (hE 2) |
| 90 | exact ⟨hboundary.1.trans (mul_le_mul_of_nonneg_right (le_max_left _ _) hB), |
| 91 | hboundary.2.trans (mul_le_mul_of_nonneg_right (le_max_left _ _) hB), |
| 92 | fun j => (hnbr j).trans (mul_le_mul_of_nonneg_right (le_max_right _ _) |
| 93 | (add_nonneg (add_nonneg (hE (j + 1)) (hE (j + 2))) (hE (j + 3))))⟩ |
| 94 | |
| 95 | end PoincareMT.M34 |