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.Compactness.CylinderCompactnessFeedData |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Persistence.Cylinder.InitialCylinder |
| 4 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Persistence.Cylinder.Stopping.MaximalCylinder |
| 5 | |
| 6 | /-! |
| 7 | # Actual maximal-cylinder samples |
| 8 | |
| 9 | An exact M36 birth comparison supplies an actual compactness sample |
| 10 | on its maximal physical cylinder, preserving the chosen comparison |
| 11 | map when the radius changes. Morgan--Tian, Proposition 16.5 and |
| 12 | Claim 16.6, pp. 371-374; M44 derivation 100. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set TopologicalSpace |
| 19 | open scoped Manifold ContDiff Topology ENNReal |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.M44 |
| 24 | |
| 25 | /-- An actual sample on the maximal cylinder of its physical birth |
| 26 | ball below the assigned duration. Source: Proposition 16.5, p. 374; |
| 27 | M44 derivation 100. -/ |
| 28 | structure MaximalCapSample (g0 : StandardInitialMetric) |
| 29 | (F : SurgeryFlowData.{u}) (a : ℝ) (ha : a ∈ F.surgery_times) |
| 30 | [Nonempty (F.slice a).carrier] (i : Fin (F.event a ha).cap_count) (B : ℝ) |
| 31 | extends CylinderCompactnessSample g0 F a ha i where |
| 32 | /-- The chart covers precisely the tracked region. -/ |
| 33 | target_eq : chart.target = region |
| 34 | /-- The tracked region is the actual physical birth ball. -/ |
| 35 | region_eq : region = |
| 36 | (F.metric a).ball ((F.event a ha).caps i).tip (F.parameters.h a * radius) |
| 37 | /-- The maximal cylinder remains below its assigned duration. -/ |
| 38 | lifetime_le : lifetime ≤ B |
| 39 | /-- No based cylinder on this ball extends past its lifetime below B. -/ |
| 40 | maximal : ∀ d : ℝ, lifetime < d → d ≤ B → |
| 41 | ¬ ∃ e : SurgeryFlowCylinder F (F.slice a) a ((F.parameters.h a)⁻¹ ^ 2) |
| 42 | (Ico 0 d) region, ∀ hs x, x ∈ region → HEq (e.forward 0 hs x) x |
| 43 | |
| 44 | namespace MaximalCapSample |
| 45 | |
| 46 | variable {g0 : StandardInitialMetric} {F : SurgeryFlowData.{u}} {a B : ℝ} |
| 47 | {ha : a ∈ F.surgery_times} [Nonempty (F.slice a).carrier] |
| 48 | {i : Fin (F.event a ha).cap_count} |
| 49 | |
| 50 | /-- The actual maximal sample tracks an open region. Source: |
| 51 | Proposition 16.5, p. 374; M44 derivation 100. -/ |
| 52 | theorem region_open (D : MaximalCapSample g0 F a ha i B) : IsOpen D.region := |
| 53 | D.target_eq ▸ D.chart.open_target |
| 54 | |
| 55 | /-- The actual maximal sample tracks a nonempty ball. Source: |
| 56 | Proposition 16.5, p. 374; M44 derivation 100. -/ |
| 57 | theorem region_nonempty (D : MaximalCapSample g0 F a ha i B) : D.region.Nonempty := by |
| 58 | rw [← D.target_eq] |
| 59 | exact ⟨D.target_point.1, D.target_point.2⟩ |
| 60 | |
| 61 | end MaximalCapSample |
| 62 | |
| 63 | /-- Every supplied exact M36 comparison gives a maximal sample on |
| 64 | any strictly buffered positive radius, without changing its comparison |
| 65 | map. Source: Proposition 16.5 and Claim 16.6, pp. 371-374; |
| 66 | M44 derivation 100. -/ |
| 67 | theorem exists_maximal_cap_sample |
| 68 | (P : M44CapPersistencePredecessors.{u}) |
| 69 | {g0 : StandardInitialMetric} (F : SurgeryFlowData.{u}) |
| 70 | (a : ℝ) (ha : a ∈ F.surgery_times) [Nonempty (F.slice a).carrier] |
| 71 | (i : Fin (F.event a ha).cap_count) (hg0 : F.standard_initial = g0) |
| 72 | (hpinch : SurgeryFlowPinched F) |
| 73 | {B R eta : ℝ} (hB : 0 < B) (hR : 0 < R) (hfit : R < eta⁻¹) |
| 74 | (htime : ∀ s ∈ Ico 0 B, |
| 75 | a + s / ((F.parameters.h a)⁻¹ ^ 2) ∈ F.time_domain) |
| 76 | (Q : SurgeryCapClose F.standard_initial |
| 77 | ((F.event a ha).local_result i).output ((F.event a ha).local_result i).metric |
| 78 | ((F.event a ha).local_result i).tip (((F.event a ha).necks i).neck.scale) eta) |
| 79 | (hballs : ∀ r : ℝ, 0 < r → r ≤ eta⁻¹ → |
| 80 | Q.map '' F.standard_initial.metric.ball 0 r = |
| 81 | ((F.event a ha).local_result i).metric.ball ((F.event a ha).local_result i).tip |
| 82 | (((F.event a ha).necks i).neck.scale * r)) : |
| 83 | ∃ D : MaximalCapSample g0 F a ha i B, |
| 84 | D.radius = R ∧ D.eta = eta ∧ D.comparison.map = Q.map := by |
| 85 | have hh := F.parameters.h_pos a (F.time_domain_nonnegative (F.surgery_times_subset ha)) |
| 86 | have hscale : 0 < (F.parameters.h a)⁻¹ ^ 2 := sq_pos_of_pos (inv_pos.mpr hh) |
| 87 | obtain ⟨chart, hsource, hmap, htarget, _hconnected⟩ := |
| 88 | exists_physical_birth_chart F a ha i hR hfit Q (hballs R hR hfit.le) |
| 89 | let U := (F.metric a).ball ((F.event a ha).caps i).tip (F.parameters.h a * R) |
| 90 | have hU : IsOpen U := by |
| 91 | simpa only [U, ← htarget] using chart.open_target |
| 92 | obtain ⟨b0, hb0, hb0B, e0, he0⟩ := exists_initial_based_cylinder F hscale hB htime U |
| 93 | obtain ⟨c, hc, hcB, e, he, _hagree, hmax⟩ := |
| 94 | exists_maximal_based_cylinder e0 hb0 hb0B.le he0 |
| 95 | have hmapU : chart.target ⊆ U := htarget ▸ Subset.rfl |
| 96 | obtain ⟨G⟩ := exists_cylinderRicciFlow P hpinch e hU hc chart hmapU |
| 97 | have hzero : (0 : StandardCapSpace) ∈ chart.source := by |
| 98 | rw [hsource, M36.standard_ball_eq_euclidean F.standard_initial hR] |
| 99 | exact Metric.mem_ball_self |
| 100 | ((M36.radialEuclideanRadius_pos_iff F.standard_initial R).mpr hR) |
| 101 | let point : (⟨chart.target, chart.open_target⟩ : Opens (F.slice a).carrier) := |
| 102 | ⟨chart 0, chart.map_source hzero⟩ |
| 103 | let D : MaximalCapSample g0 F a ha i B := |
| 104 | { standard_initial_eq := hg0 |
| 105 | radius := R |
| 106 | radius_pos := hR |
| 107 | eta := eta |
| 108 | radius_lt := hfit |
| 109 | lifetime := c |
| 110 | lifetime_pos := hc |
| 111 | comparison := Q |
| 112 | image_ball := hballs |
| 113 | chart := chart |
| 114 | chart_source := hsource |
| 115 | chart_eq := hmap |
| 116 | region := U |
| 117 | cylinder := e |
| 118 | chart_target_subset := hmapU |
| 119 | birth_identity := he |
| 120 | ordinary := G |
| 121 | target_point := point |
| 122 | target_eq := htarget |
| 123 | region_eq := rfl |
| 124 | lifetime_le := hcB |
| 125 | maximal := hmax } |
| 126 | exact ⟨D, rfl, rfl, rfl⟩ |
| 127 | |
| 128 | end PoincareMT.M44 |