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.AncientKappa.Compactness.Boundedness.Projective.Selected |
| 2 | import PoincareLib.Geometry.RicciFlow.AncientKappa.Compactness.Boundedness.Projective.Cover |
| 3 | import PoincareLib.Geometry.RicciFlow.AncientKappa.Compactness.Boundedness.Projective.Diameter |
| 4 | |
| 5 | /-! |
| 6 | # Actual spherical or projective neck alternatives |
| 7 | |
| 8 | The common time buffer is chosen below both terminal thresholds. The actual |
| 9 | M19 certificate then produces one of the two geometric alternatives on the |
| 10 | original terminal slice, retaining the same subsequence and embedding maps. |
| 11 | -/ |
| 12 | |
| 13 | noncomputable section |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | set_option maxSynthPendingDepth 12 |
| 17 | set_option maxHeartbeats 800000 |
| 18 | |
| 19 | open Set Filter |
| 20 | open scoped Manifold ContDiff Bundle ENNReal Topology |
| 21 | |
| 22 | namespace PoincareMT.RicciFlow |
| 23 | |
| 24 | attribute [local instance] FlowCarrier.topologicalSpace FlowCarrier.measurableSpace |
| 25 | FlowCarrier.borelSpace FlowCarrier.chartedSpace FlowCarrier.isManifold |
| 26 | FlowCarrier.t2Space FlowCarrier.t3Space FlowCarrier.secondCountable |
| 27 | |
| 28 | local instance projectiveAlternativeCarrierConnected {n : ℕ} (C : FlowCarrier n) : |
| 29 | ConnectedSpace C.carrier := connectedSpace_iff_univ.mpr C.connected |
| 30 | |
| 31 | variable {M : Type} [TopologicalSpace M] [T2Space M] [T3Space M] |
| 32 | [SecondCountableTopology M] [ConnectedSpace M] [MeasurableSpace M] [BorelSpace M] |
| 33 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 34 | |
| 35 | namespace SelectedAncientRescalings |
| 36 | |
| 37 | variable {b κ : ℝ} {F : RicciFlow 3 M (Iic b)} {p : M} |
| 38 | (S : SelectedAncientRescalings F κ p) |
| 39 | |
| 40 | /-- The actual round factor produces either spherical necks or projective |
| 41 | neck coverings in the original terminal metric. Both branches retain the |
| 42 | selected rescaling centers, scalar factors, and limit embeddings. -/ |
| 43 | theorem exists_terminal_round_or_projective_necks |
| 44 | (P : M23NormalizedKappaCompactnessPredecessors) (hκ : 0 < κ) |
| 45 | (hc : MetricComplete (F.metric b)) |
| 46 | (hop : ∀ x, (F.connection b).NonnegativeCurvatureOperator x) |
| 47 | (hmono : ∀ s t, s ≤ t → t ≤ b → ∀ x, |
| 48 | (F.connection s).scalarCurvature x ≤ (F.connection t).scalarCurvature x) |
| 49 | {ε : ℝ} (hε : 0 < ε) (hεhalf : ε < 1 / 2) : |
| 50 | ∃ δ, 0 < δ ∧ δ < 1 ∧ ∃ B : RoundProductBlowup S δ, |
| 51 | ((∃ (Φ : RoundCylinderSpace ≃ₘ⟮(𝓡 2).prod 𝓘(ℝ, ℝ), 𝓡 3⟯ |
| 52 | B.convergence.limitCarrier.carrier) (x : UnitTwoSphere), |
| 53 | Φ (x, 0) = B.convergence.base ∧ |
| 54 | ∀ᶠ i in atTop, ∃ N : EpsilonNeck (F.metric b), |
| 55 | N.epsilon = ε ∧ |
| 56 | N.scale = 1 / Real.sqrt ((F.connection b).scalarCurvature |
| 57 | (S.center (B.convergence.subsequence i))) ∧ |
| 58 | N.center = S.center (B.convergence.subsequence i) ∧ |
| 59 | N.coordinate_map = (fun z => B.convergence.embedding i (Φ z))) ∨ |
| 60 | ∃ (Φ : RoundCylinderSpace → B.convergence.limitCarrier.carrier) |
| 61 | (x : UnitTwoSphere), |
| 62 | IsLocalDiffeomorph ((𝓡 2).prod 𝓘(ℝ, ℝ)) (𝓡 3) ∞ Φ ∧ |
| 63 | Function.Surjective Φ ∧ Φ (x, 0) = B.convergence.base ∧ |
| 64 | (∀ z w, Φ z = Φ w ↔ w = z ∨ w = (-z.1, z.2)) ∧ |
| 65 | ∀ᶠ i in atTop, |
| 66 | IsLocalDiffeomorphOn ((𝓡 2).prod 𝓘(ℝ, ℝ)) (𝓡 3) ∞ |
| 67 | (B.convergence.embedding i ∘ Φ) (univ ×ˢ Ioo (-ε⁻¹) ε⁻¹) ∧ |
| 68 | (∀ z ∈ univ ×ˢ Icc (-ε⁻¹) ε⁻¹, ∀ w ∈ univ ×ˢ Icc (-ε⁻¹) ε⁻¹, |
| 69 | B.convergence.embedding i (Φ z) = B.convergence.embedding i (Φ w) ↔ |
| 70 | w = z ∨ w = (-z.1, z.2)) ∧ |
| 71 | B.convergence.embedding i (Φ (x, 0)) = S.center (B.convergence.subsequence i) ∧ |
| 72 | RoundCylinderClose ε 0 (fun z v w => |
| 73 | (F.connection b).scalarCurvature (S.center (B.convergence.subsequence i)) * |
| 74 | roundCylinderPullback (F.metric b) (B.convergence.embedding i ∘ Φ) z v w) ∧ |
| 75 | (∃ e : RealProjectiveTwo ≃ₜ Set.range (fun q : UnitTwoSphere => |
| 76 | B.convergence.embedding i (Φ (q, 0))), |
| 77 | ∀ q : UnitTwoSphere, (e (Quotient.mk realProjectiveTwoSetoid q)).val = |
| 78 | B.convergence.embedding i (Φ (q, 0))) ∧ |
| 79 | ∀ q r : UnitTwoSphere, |
| 80 | (F.metric b).edist (B.convergence.embedding i (Φ (q, 0))) |
| 81 | (B.convergence.embedding i (Φ (r, 0))) ≤ |
| 82 | ENNReal.ofReal (Real.sqrt ((1 + ε) * 2 / |
| 83 | (F.connection b).scalarCurvature (S.center (B.convergence.subsequence i))) * |
| 84 | Real.pi)) := by |
| 85 | obtain ⟨ηs, hηs, hsphere⟩ := S.exists_terminal_epsilonNeck_threshold P hε hεhalf |
| 86 | obtain ⟨ηp, hηp, hprojective⟩ := S.exists_terminal_projectiveNeck_threshold P hε |
| 87 | obtain ⟨δ, hδ, hδone, hδη, ⟨B⟩⟩ := |
| 88 | S.exists_roundProductBlowup P hκ hc hop hmono (min ηs ηp) (lt_min hηs hηp) |
| 89 | refine ⟨δ, hδ, hδone, B, ?_⟩ |
| 90 | obtain ⟨_, hmodel⟩ := B.round.roundCylinder_or_projective_cover |
| 91 | (B.convergence.limitFlow.metric 0) (B.convergence.limitFlow.connection 0) |
| 92 | B.product (B.product_metric 0 le_rfl) B.convergence.base |
| 93 | rcases hmodel with ⟨Φ, x, hx, hround⟩ | ⟨Φ, x, hΦ, hsurj, hx, hfiber, hround⟩ |
| 94 | · left |
| 95 | refine ⟨Φ, x, hx, ?_⟩ |
| 96 | filter_upwards [hsphere hδ hδone.le (hδη.trans (min_le_left _ _)) |
| 97 | B.convergence (B.complete 0 hδ) B.scalar_base_ge Φ x hx hround] with i hi |
| 98 | obtain ⟨N, hNε, hNs, hNcenter, _, hNmap⟩ := hi |
| 99 | obtain ⟨A, hAε, hAs, hAcenter, _, hAmap, _, _⟩ := |
| 100 | S.exists_originalSliceNeck (B.convergence.subsequence i) N hNs |
| 101 | exact ⟨A, hAε.trans hNε, hAs, hAcenter.trans hNcenter, hAmap.trans hNmap⟩ |
| 102 | · right |
| 103 | refine ⟨Φ, x, hΦ, hsurj, hx, hfiber, ?_⟩ |
| 104 | filter_upwards [hprojective hδ hδone.le (hδη.trans (min_le_right _ _)) |
| 105 | B Φ x hΦ hx hfiber hround] with i hi |
| 106 | refine ⟨hi.1, hi.2.1, hi.2.2.1, hi.2.2.2.1, hi.2.2.2.2, ?_⟩ |
| 107 | intro q r |
| 108 | apply edist_cylinderCover_slice_le (F.metric b) (B.convergence.embedding i ∘ Φ) |
| 109 | hε (S.scalar_pos _) hi.1.contMDiffOn hi.2.2.2.1 q r |
| 110 | exact ⟨neg_neg_of_pos (inv_pos.mpr hε), inv_pos.mpr hε⟩ |
| 111 | |
| 112 | end SelectedAncientRescalings |
| 113 | |
| 114 | end PoincareMT.RicciFlow |