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.TerminalCloseness |
| 2 | |
| 3 | /-! |
| 4 | # Actual terminal necks from a buffered raw cylinder limit |
| 5 | |
| 6 | The produced necks use the original time-zero source metrics, connections, |
| 7 | basepoints, and stored spatial maps. In an escaping homothety sequence these |
| 8 | all belong to one fixed slice of the original unrescaled flow. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | set_option backward.isDefEq.respectTransparency false |
| 13 | set_option maxSynthPendingDepth 12 |
| 14 | set_option maxHeartbeats 800000 |
| 15 | |
| 16 | open Set Filter |
| 17 | open scoped Manifold ContDiff Bundle ENNReal Topology |
| 18 | |
| 19 | namespace PoincareMT.RawAncientSequence |
| 20 | |
| 21 | attribute [local instance] FlowCarrier.topologicalSpace FlowCarrier.measurableSpace |
| 22 | FlowCarrier.borelSpace FlowCarrier.chartedSpace FlowCarrier.isManifold |
| 23 | FlowCarrier.t2Space FlowCarrier.t3Space FlowCarrier.secondCountable |
| 24 | |
| 25 | variable (C : ℕ → FlowCarrier.{0} 3) |
| 26 | (F : ∀ k, RicciFlow 3 (C k).carrier (Iic 0)) (p : ∀ k, (C k).carrier) |
| 27 | |
| 28 | /-- Actual scale-one epsilon-necks at terminal source time zero retain the |
| 29 | subsequence, embeddings, connections, and centers of the raw limit. -/ |
| 30 | theorem exists_terminal_epsilonNeck_threshold |
| 31 | (P : M23NormalizedKappaCompactnessPredecessors) |
| 32 | (hc : ∀ k t, t ≤ 0 → MetricComplete ((F k).metric t)) |
| 33 | (hop : ∀ k t, t ≤ 0 → ∀ x, ((F k).connection t).NonnegativeCurvatureOperator x) |
| 34 | (radius : ℕ → ℝ) (hradius : Tendsto radius atTop atTop) |
| 35 | (hbound : ∀ k t, t ≤ 0 → ∀ x ∈ ((F k).metric 0).ball (p k) (radius k), |
| 36 | |((F k).connection t).curvatureTensorNorm x| ≤ 4) |
| 37 | (hnormalized : ∀ k, ((F k).connection 0).scalarCurvature (p k) = 1) |
| 38 | (hbase : ∀ k t, t ≤ 0 → ((F k).connection t).scalarCurvature (p k) ≤ 1) |
| 39 | {ε : ℝ} (hε : 0 < ε) (hεhalf : ε < 1 / 2) : |
| 40 | ∃ η : ℝ, 0 < η ∧ ∀ {δ : ℝ}, 0 < δ → δ ≤ 1 → δ ≤ η → |
| 41 | ∀ G : AncientPointedGeometricConvergence C (fun k t => (F k).metric (t - δ)) p δ, |
| 42 | G.limitCarrier.metricComplete (G.limitFlow.metric 0) → |
| 43 | (1 / 2 : ℝ) ≤ (G.limitFlow.connection 0).scalarCurvature G.base → |
| 44 | ∀ (Φ : RoundCylinderSpace ≃ₘ⟮(𝓡 2).prod 𝓘(ℝ, ℝ), 𝓡 3⟯ G.limitCarrier.carrier) |
| 45 | (q : UnitTwoSphere), Φ (q, 0) = G.base → |
| 46 | (fun z v w => (G.limitFlow.connection 0).scalarCurvature G.base * |
| 47 | roundCylinderPullback (G.limitFlow.metric 0) Φ z v w) = EvolvingRoundCylinderMetric 0 → |
| 48 | ∀ᶠ i in atTop, ∃ N : EpsilonNeck ((F (G.subsequence i)).metric 0), |
| 49 | N.epsilon = ε ∧ N.scale = 1 ∧ N.center = p (G.subsequence i) ∧ |
| 50 | N.connection = (F (G.subsequence i)).connection 0 ∧ |
| 51 | N.coordinate_map = (fun z => G.embedding i (Φ z)) := by |
| 52 | obtain ⟨η, hη, hclose⟩ := exists_terminal_cylinder_closeness_threshold C F p P |
| 53 | hc hop radius hradius hbound hnormalized hbase hε |
| 54 | refine ⟨η, hη, ?_⟩ |
| 55 | intro δ hδ hδone hδη G hcomplete hs Φ q hq hround |
| 56 | have hcl := hclose hδ hδone hδη G hcomplete hs Φ hround |
| 57 | let Fseq (k : ℕ) := (F k).bufferedExpandingFlow δ |
| 58 | have hab : (-1 : ℝ) < δ / 2 := by linarith |
| 59 | have hbδ : δ / 2 ≤ δ := by linarith |
| 60 | have hsub : ∀ k : ℕ, Ioo (-1) (δ / 2) ⊆ (fun t : ℝ => t - δ) ⁻¹' Iic 0 := by |
| 61 | intro k t ht |
| 62 | change t - δ ≤ 0 |
| 63 | linarith [ht.2] |
| 64 | let W := G.window Fseq hab hbδ 0 hsub |
| 65 | have hzero : (-1 : ℝ) < 0 ∧ 0 < δ / 2 := ⟨by norm_num, by linarith⟩ |
| 66 | filter_upwards [hcl, W.eventually_cylinderSlabEmbedding hzero Φ hε] with i hclose he |
| 67 | let e := W.cylinderSlabEmbedding hzero Φ ε i |
| 68 | have hemap : (e : RoundCylinderSpace → (C (G.subsequence i)).carrier) = |
| 69 | (fun z => G.embedding i (Φ z)) := rfl |
| 70 | obtain ⟨hsource, hsmooth, hinverse, _⟩ := he |
| 71 | have hcentral : e '' (univ ×ˢ ({0} : Set ℝ)) ⊆ e.target := by |
| 72 | rintro _ ⟨z, hz, rfl⟩ |
| 73 | apply e.map_source |
| 74 | rw [hsource] |
| 75 | have hpos := inv_pos.mpr hε |
| 76 | exact ⟨hz.1, by simpa only [mem_singleton_iff.mp hz.2] using |
| 77 | (show (0 : ℝ) ∈ Ioo (-ε⁻¹) ε⁻¹ from ⟨neg_neg_of_pos hpos, hpos⟩)⟩ |
| 78 | refine ⟨{ |
| 79 | epsilon := ε |
| 80 | epsilon_pos := hε |
| 81 | epsilon_lt_half := hεhalf |
| 82 | scale := 1 |
| 83 | scale_pos := zero_lt_one |
| 84 | center := p (G.subsequence i) |
| 85 | connection := (F (G.subsequence i)).connection 0 |
| 86 | scalar_center_pos := by rw [hnormalized]; exact zero_lt_one |
| 87 | scale_eq_scalar := by rw [hnormalized, Real.one_rpow] |
| 88 | carrier := e.target |
| 89 | carrier_open := e.open_target |
| 90 | coordinate := neckDomainCoordinates e hsource |
| 91 | coordinate_map := e |
| 92 | coordinate_map_eq := fun z => rfl |
| 93 | coordinate_map_smooth := hsmooth |
| 94 | coordinate_inverse := e.symm |
| 95 | coordinate_inverse_mem := fun x hx => neckDomainCoordinates_inverse_mem e hsource hx |
| 96 | coordinate_inverse_left := neckDomainCoordinates_inverse_left e hsource |
| 97 | coordinate_inverse_right := neckDomainCoordinates_inverse_right e hsource |
| 98 | coordinate_inverse_smooth := hinverse |
| 99 | central_sphere := e '' (univ ×ˢ ({0} : Set ℝ)) |
| 100 | central_sphere_eq := rfl |
| 101 | center_on_central_sphere := ?_ |
| 102 | central_sphere_subset := hcentral |
| 103 | metric_comparison := ⟨by |
| 104 | simpa only [inv_one, one_pow, one_mul, hemap] using hclose⟩ |
| 105 | }, rfl, rfl, rfl, rfl, hemap⟩ |
| 106 | refine ⟨(q, 0), ⟨mem_univ _, mem_singleton _⟩, ?_⟩ |
| 107 | change G.embedding i (Φ (q, 0)) = p (G.subsequence i) |
| 108 | rw [hq, G.base_preserving] |
| 109 | |
| 110 | end PoincareMT.RawAncientSequence |