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.Limit.Retained.RetainedTimeJets |
| 2 | import PoincareLib.Geometry.RicciFlow.Harnack.Regularity |
| 3 | import Mathlib.Order.Interval.Set.Infinite |
| 4 | |
| 5 | /-! |
| 6 | # Joint Ricci smoothness on the actual retained interior |
| 7 | |
| 8 | The actual retained coordinate family is jointly smooth and satisfies |
| 9 | the Ricci equation also at surgery. All continuity inputs come from |
| 10 | the primitive event limit and the future ordinary flow. |
| 11 | Morgan--Tian, Proposition 16.5, pp. 374-375; see M44 derivation 51. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set Filter |
| 18 | open scoped Manifold ContDiff Topology |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.M44 |
| 23 | |
| 24 | local notation "E" => EuclideanSpace ℝ (Fin 3) |
| 25 | |
| 26 | attribute [local instance] normedAddCommGroupTangentSpaceVectorSpace |
| 27 | normedSpaceTangentSpaceVectorSpace |
| 28 | |
| 29 | variable {g0 : StandardInitialMetric} {K : MetricSurgeryConstants} {P : SurgeryParameters} |
| 30 | {slice : ℝ → GeneralizedSliceCarrier.{u}} |
| 31 | {metric : ∀ t, RiemannianMetric 3 (slice t).carrier} {T b : ℝ} |
| 32 | |
| 33 | /-- The actual retained inverse chart has invertible differential |
| 34 | everywhere in its retained coordinate domain. Source: Proposition |
| 35 | 16.5, pp. 374-375; M44 derivation 51. -/ |
| 36 | theorem retained_inverse_coordinates_invertible |
| 37 | (event : SurgeryEventData g0 K P slice metric T) |
| 38 | (q : (slice event.tMinus).carrier) {U : Set E} |
| 39 | (hchart : U ⊆ (extChartAt (𝓡 3) q).target) |
| 40 | (hret : (extChartAt (𝓡 3) q).symm '' U ⊆ interior event.retained_pre) |
| 41 | {x : E} (hx : x ∈ U) : |
| 42 | (mfderiv (𝓡 3) (𝓡 3) |
| 43 | (event.retention.map ∘ (extChartAt (𝓡 3) q).symm) x).IsInvertible := by |
| 44 | have hc := (contMDiffOn_extChartAt_symm (I := 𝓡 3) (n := ∞) q).contMDiffAt |
| 45 | ((isOpen_extChartAt_target q).mem_nhds (hchart hx)) |
| 46 | have hretx := hret (mem_image_of_mem _ hx) |
| 47 | have hr := event.retention.map_smooth.contMDiffAt |
| 48 | (mem_interior_iff_mem_nhds.mp hretx) |
| 49 | have hi : (mfderiv (𝓡 3) (𝓡 3) (extChartAt (𝓡 3) q).symm x).IsInvertible := by |
| 50 | simpa only [ModelWithCorners.range_eq_univ, mfderivWithin_univ] using |
| 51 | isInvertible_mfderivWithin_extChartAt_symm (hchart hx) |
| 52 | have hl := (regionEquivalenceInteriorChart event.retention).isLocalDiffeomorphAt |
| 53 | (𝓡 3) (𝓡 3) ∞ hretx |
| 54 | have hj : (mfderiv (𝓡 3) (𝓡 3) event.retention.map |
| 55 | ((extChartAt (𝓡 3) q).symm x)).IsInvertible := |
| 56 | ⟨hl.mfderivToContinuousLinearEquiv (by simp), rfl⟩ |
| 57 | rw [mfderiv_comp x (hr.mdifferentiableAt (by simp)) (hc.mdifferentiableAt (by simp))] |
| 58 | exact hj.comp hi |
| 59 | |
| 60 | /-- The ordinary equations on the two sides are the same native |
| 61 | coordinate Ricci equation for the joined retained family. Source: |
| 62 | Proposition 16.5, pp. 374-375; M44 derivation 51. -/ |
| 63 | theorem retainedChartCoefficients_equation_away |
| 64 | (event : SurgeryEventData g0 K P slice metric T) |
| 65 | (G : RicciFlow 3 (slice T).carrier (Icc T b)) (hTb : T < b) |
| 66 | (q : (slice event.tMinus).carrier) {U : Set E} (hU : IsOpen U) |
| 67 | (hchart : U ⊆ (extChartAt (𝓡 3) q).target) |
| 68 | (hret : (extChartAt (𝓡 3) q).symm '' U ⊆ interior event.retained_pre) |
| 69 | {t : ℝ} (ht : t ∈ Ioo event.tMinus b) (hne : t ≠ T) |
| 70 | {x : E} (hx : x ∈ U) : |
| 71 | HasDerivAt (fun s => retainedChartCoefficients event G q (s, x)) |
| 72 | (SpacetimeBounds.ricciFlowOperator 3 (SpacetimeBounds.metricTwoJet |
| 73 | (fun y => retainedChartCoefficients event G q (t, y)) x)) t := by |
| 74 | rcases lt_or_gt_of_ne hne with hlt | hgt |
| 75 | · let F := Poincare.Geometry.RicciFlow.Harnack.restrictFlow event.pre_flow |
| 76 | Ioo_subset_Ico_self ordConnected_Ioo (Ioo_infinite event.tMinus_lt).nontrivial |
| 77 | have hi (y : E) (hy : y ∈ U) : |
| 78 | (mfderiv (𝓡 3) (𝓡 3) (extChartAt (𝓡 3) q).symm y).IsInvertible := by |
| 79 | simpa only [ModelWithCorners.range_eq_univ, mfderivWithin_univ] using |
| 80 | isInvertible_mfderivWithin_extChartAt_symm (hchart hy) |
| 81 | have hd := hasDerivAt_pullbackCoefficients_ricci F isOpen_Ioo hU |
| 82 | ((contMDiffOn_extChartAt_symm q).mono hchart) hi ⟨ht.1, hlt⟩ hx |
| 83 | have heq : (fun s => retainedChartCoefficients event G q (s, x)) =ᶠ[𝓝 t] |
| 84 | (fun s => (F.metric s).pullbackCoefficients (extChartAt (𝓡 3) q).symm x) := by |
| 85 | filter_upwards [Iio_mem_nhds hlt] with s hs |
| 86 | change s < T at hs |
| 87 | simp only [retainedChartCoefficients, if_pos hs, F, |
| 88 | Poincare.Geometry.RicciFlow.Harnack.restrictFlow] |
| 89 | simpa only [retainedChartCoefficients, if_pos hlt, F, |
| 90 | Poincare.Geometry.RicciFlow.Harnack.restrictFlow] using |
| 91 | hd.congr_of_eventuallyEq heq |
| 92 | · let F := Poincare.Geometry.RicciFlow.Harnack.restrictFlow G |
| 93 | Ioo_subset_Icc_self ordConnected_Ioo (Ioo_infinite hTb).nontrivial |
| 94 | have he := retained_inverse_coordinates_smooth event q hchart hret |
| 95 | have hi := fun y hy => retained_inverse_coordinates_invertible event q hchart hret |
| 96 | (x := y) hy |
| 97 | have hd := hasDerivAt_pullbackCoefficients_ricci F isOpen_Ioo hU he hi ⟨hgt, ht.2⟩ hx |
| 98 | have heq : (fun s => retainedChartCoefficients event G q (s, x)) =ᶠ[𝓝 t] |
| 99 | (fun s => (F.metric s).pullbackCoefficients |
| 100 | (event.retention.map ∘ (extChartAt (𝓡 3) q).symm) x) := by |
| 101 | filter_upwards [Ioi_mem_nhds hgt] with s hs |
| 102 | change T < s at hs |
| 103 | simp only [retainedChartCoefficients, if_neg (not_lt_of_gt hs), F, |
| 104 | Poincare.Geometry.RicciFlow.Harnack.restrictFlow] |
| 105 | simpa only [retainedChartCoefficients, if_neg (not_lt_of_gt hgt), F, |
| 106 | Poincare.Geometry.RicciFlow.Harnack.restrictFlow] using |
| 107 | hd.congr_of_eventuallyEq heq |
| 108 | |
| 109 | /-- The joined actual coefficients are invertible on their whole |
| 110 | retained coordinate domain. Source: Proposition 16.5; |
| 111 | M44 derivation 51. -/ |
| 112 | theorem retainedChartCoefficients_invertible |
| 113 | (event : SurgeryEventData g0 K P slice metric T) |
| 114 | (G : RicciFlow 3 (slice T).carrier (Icc T b)) |
| 115 | (q : (slice event.tMinus).carrier) {U : Set E} |
| 116 | (hchart : U ⊆ (extChartAt (𝓡 3) q).target) |
| 117 | (hret : (extChartAt (𝓡 3) q).symm '' U ⊆ interior event.retained_pre) |
| 118 | (t : ℝ) {x : E} (hx : x ∈ U) : |
| 119 | (retainedChartCoefficients event G q (t, x)).IsInvertible := by |
| 120 | unfold retainedChartCoefficients |
| 121 | split_ifs |
| 122 | · exact (event.pre_flow.metric t).isInvertible_chartCoefficients q (hchart hx) |
| 123 | · exact (G.metric t).isInvertible_pullbackCoefficients |
| 124 | (retained_inverse_coordinates_invertible event q hchart hret hx).injective |
| 125 | |
| 126 | /-- Actual retained coefficients are jointly smooth through the |
| 127 | surgery and satisfy the Ricci equation there. Source: Proposition |
| 128 | 16.5, pp. 374-375; M44 derivation 51. -/ |
| 129 | theorem retainedChartCoefficients_smooth_ricci |
| 130 | (event : SurgeryEventData g0 K P slice metric T) |
| 131 | (G : RicciFlow 3 (slice T).carrier (Icc T b)) (hTb : T < b) |
| 132 | (hbirth : G.metric T = metric T) |
| 133 | (q : (slice event.tMinus).carrier) (hq : q ∈ interior event.retained_pre) |
| 134 | {U : Set E} (hU : IsOpen U) (hchart : U ⊆ (extChartAt (𝓡 3) q).target) |
| 135 | (hret : (extChartAt (𝓡 3) q).symm '' U ⊆ interior event.retained_pre) : |
| 136 | ContDiffOn ℝ ∞ (retainedChartCoefficients event G q) (Ioo event.tMinus b ×ˢ U) ∧ |
| 137 | ∀ t ∈ Ioo event.tMinus b, ∀ x ∈ U, |
| 138 | HasDerivAt (fun s => retainedChartCoefficients event G q (s, x)) |
| 139 | (SpacetimeBounds.ricciFlowOperator 3 (SpacetimeBounds.metricTwoJet |
| 140 | (fun y => retainedChartCoefficients event G q (t, y)) x)) t := by |
| 141 | have hjets := retainedChartCoefficients_continuous_spatialJets |
| 142 | event G hTb hbirth q hq hU hchart hret |
| 143 | have hsides : ContDiffOn ℝ ∞ (retainedChartCoefficients event G q) |
| 144 | ((Ioo event.tMinus b \ {T}) ×ˢ U) := by |
| 145 | rintro ⟨t, x⟩ ⟨ht, hx⟩ |
| 146 | have hne : t ≠ T := by simpa only [mem_singleton_iff] using ht.2 |
| 147 | rcases lt_or_gt_of_ne hne with hlt | hgt |
| 148 | · exact ((retainedChartCoefficients_smooth_before event G q hU hchart).contDiffAt |
| 149 | ((isOpen_Ioo.prod hU).mem_nhds ⟨⟨ht.1.1, hlt⟩, hx⟩)).contDiffWithinAt |
| 150 | · have hs := (retainedChartCoefficients_smooth_after event G q hU hchart hret).mono |
| 151 | (prod_mono Ioo_subset_Ico_self Subset.rfl) |
| 152 | exact (hs.contDiffAt |
| 153 | ((isOpen_Ioo.prod hU).mem_nhds ⟨⟨hgt, ht.1.2⟩, hx⟩)).contDiffWithinAt |
| 154 | have hinv : ∀ p ∈ Ioo event.tMinus b ×ˢ U, |
| 155 | (retainedChartCoefficients event G q p).IsInvertible := |
| 156 | fun p hp => retainedChartCoefficients_invertible event G q hchart hret p.1 hp.2 |
| 157 | have hevol : ∀ t ∈ Ioo event.tMinus b, t ∉ ({T} : Set ℝ) → ∀ x ∈ U, |
| 158 | HasDerivAt (fun s => retainedChartCoefficients event G q (s, x)) |
| 159 | (SpacetimeBounds.ricciFlowOperator 3 (SpacetimeBounds.metricTwoJet |
| 160 | (fun y => retainedChartCoefficients event G q (t, y)) x)) t := by |
| 161 | intro t ht hnot x hx |
| 162 | exact retainedChartCoefficients_equation_away event G hTb q hU hchart hret ht |
| 163 | (by simpa only [mem_singleton_iff] using hnot) hx |
| 164 | have hs := contDiffOn_ricci_coefficients_off_finite isOpen_Ioo hU (finite_singleton T) |
| 165 | hsides (fun t _ => retainedChartCoefficients_spatial_smooth event G q hU hchart hret t) |
| 166 | hjets hinv hevol |
| 167 | refine ⟨hs, ?_⟩ |
| 168 | intro t ht x hx |
| 169 | exact hasDerivAt_ricci_coefficients_off_finite isOpen_Ioo (finite_singleton T) |
| 170 | hs.continuousOn hjets hinv hevol ht hx |
| 171 | |
| 172 | end PoincareMT.M44 |