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.Persistence.SourceNames.Metric |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Persistence.Limit.Coordinates.AmbientBalls |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Persistence.Limit.Initial.InitialChart |
| 4 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Persistence.Comparison.Initial.AdjustedComparison |
| 5 | |
| 6 | /-! |
| 7 | # Initial comparison charts on the actual physical surgery ball |
| 8 | |
| 9 | The exact-ball local comparison passes through the event's actual |
| 10 | metric-preserving local embedding. The resulting initial chart has |
| 11 | the frozen local metric link and the exact physical ball image. |
| 12 | Morgan--Tian, Claim 16.6 and Corollary 16.7, pp. 371-372; |
| 13 | see derivations 23 and 24. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set |
| 20 | open scoped Manifold ContDiff Topology ENNReal |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | namespace PoincareMT |
| 25 | |
| 26 | /-- A compact buffered standard ball has compact image closure under |
| 27 | the actual M36 comparison. Source: Claim 16.6, pp. 371-372. -/ |
| 28 | theorem SurgeryCapClose.isCompact_closure_image_ball |
| 29 | {g₀ : StandardInitialMetric} {S : GeneralizedSliceCarrier.{u}} |
| 30 | {g : RiemannianMetric 3 S.carrier} {tip : S.carrier} {scale eta : ℝ} |
| 31 | (Q : SurgeryCapClose g₀ S g tip scale eta) |
| 32 | {r : ℝ} (hr : 0 < r) (hrEta : r < eta⁻¹) : |
| 33 | IsCompact (closure (Q.map '' g₀.metric.ball 0 r)) := by |
| 34 | rw [Q.closure_image_ball hr hrEta] |
| 35 | apply (M36.standard_closed_ball_compact g₀ hr.le).image_of_continuousOn |
| 36 | apply Q.map_smooth.continuousOn.mono |
| 37 | intro x hx |
| 38 | exact hx.trans_lt ((ENNReal.ofReal_lt_ofReal_iff (inv_pos.mpr Q.eta_pos)).mpr hrEta) |
| 39 | |
| 40 | /-- The actual event embedding takes every precompact local-result |
| 41 | ball to the corresponding post-surgery metric ball. |
| 42 | Source: Claim 16.6, pp. 371-372. -/ |
| 43 | theorem local_result_ball_image |
| 44 | (F : SurgeryFlowData.{u}) (t : ℝ) (hT : t ∈ F.surgery_times) |
| 45 | [Nonempty (F.slice t).carrier] (i : Fin (F.event t hT).cap_count) |
| 46 | {r : ℝ} (hr : 0 < r) |
| 47 | (hcompact : IsCompact (closure (((F.event t hT).local_result i).metric.ball |
| 48 | ((F.event t hT).local_result i).tip r))) : |
| 49 | (F.event t hT).local_embed i '' ((F.event t hT).local_result i).metric.ball |
| 50 | ((F.event t hT).local_result i).tip r = |
| 51 | (F.metric t).ball ((F.event t hT).caps i).tip r := by |
| 52 | let E := F.event t hT |
| 53 | let : Nonempty (E.local_result i).output.carrier := ⟨(E.local_result i).tip⟩ |
| 54 | have h := (E.local_result i).metric.image_ball_of_precompact_pullback (F.metric t) |
| 55 | (E.local_embed_smooth i) (E.local_embed_injective i) (E.local_metric i) |
| 56 | (E.local_result i).tip hr hcompact |
| 57 | simpa only [E.local_tip i] using h |
| 58 | |
| 59 | /-- An exact-ball local comparison produces the frozen initial chart |
| 60 | with its exact actual physical ball image. The strict source buffer |
| 61 | supplies the compactness needed for ambient ball transport. |
| 62 | Source: Corollary 16.7, p. 372. -/ |
| 63 | theorem initial_cap_chart_of_exact_comparison |
| 64 | (F : SurgeryFlowData.{u}) (t : ℝ) (hT : t ∈ F.surgery_times) |
| 65 | [Nonempty (F.slice t).carrier] (i : Fin (F.event t hT).cap_count) |
| 66 | {A eta : ℝ} (hA : 0 < A) (hAeta : A < eta⁻¹) |
| 67 | (Q : SurgeryCapClose F.standard_initial |
| 68 | ((F.event t hT).local_result i).output |
| 69 | ((F.event t hT).local_result i).metric |
| 70 | ((F.event t hT).local_result i).tip |
| 71 | (((F.event t hT).necks i).neck.scale) eta) |
| 72 | (hdelta : ((F.event t hT).necks i).neck.epsilon ≤ |
| 73 | F.local_constants.comparison_delta eta) |
| 74 | (hball : Q.map '' F.standard_initial.metric.ball 0 A = |
| 75 | ((F.event t hT).local_result i).metric.ball ((F.event t hT).local_result i).tip |
| 76 | (((F.event t hT).necks i).neck.scale * A)) : |
| 77 | ∃ initial : SurgeryCapInitialComparison F t hT i A, |
| 78 | initial.chart '' F.standard_initial.metric.ball 0 A = |
| 79 | (F.metric t).ball ((F.event t hT).caps i).tip (A * F.parameters.h t) := by |
| 80 | have hcompact := Q.isCompact_closure_image_ball hA hAeta |
| 81 | rw [hball] at hcompact |
| 82 | obtain ⟨initial, himage⟩ := initial_cap_chart_of_comparison F t hT i hA hAeta.le Q hdelta |
| 83 | refine ⟨initial, ?_⟩ |
| 84 | rw [himage, ← image_image, hball, |
| 85 | local_result_ball_image F t hT i (mul_pos Q.scale_pos hA) hcompact, |
| 86 | (F.event t hT).neck_scale i, mul_comm] |
| 87 | |
| 88 | end PoincareMT |