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.RetainedPullback |
| 2 | |
| 3 | /-! |
| 4 | # The Ricci equation in every fixed retained reference chart |
| 5 | |
| 6 | The actual retained pullback satisfies the native coordinate |
| 7 | equation through surgery when its differential is invertible. |
| 8 | Morgan--Tian, Proposition 16.5, pp. 374-375; |
| 9 | see M44 derivation 62. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | open Set Filter |
| 16 | open scoped Manifold ContDiff Topology |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.M44 |
| 21 | |
| 22 | local notation "E" => EuclideanSpace ℝ (Fin 3) |
| 23 | |
| 24 | variable {g0 : StandardInitialMetric} {K : MetricSurgeryConstants} {P : SurgeryParameters} |
| 25 | {slice : ℝ → GeneralizedSliceCarrier.{u}} |
| 26 | {metric : ∀ t, RiemannianMetric 3 (slice t).carrier} {T b : ℝ} |
| 27 | |
| 28 | /-- Composing an actual local reference chart with retention |
| 29 | preserves its invertible differential. Source: Proposition 16.5, |
| 30 | pp. 374-375; M44 derivation 62. -/ |
| 31 | theorem retained_composition_invertible |
| 32 | (event : SurgeryEventData g0 K P slice metric T) |
| 33 | {V : Set E} (hV : IsOpen V) {A : E → (slice event.tMinus).carrier} |
| 34 | (hA : ContMDiffOn (𝓡 3) (𝓡 3) ∞ A V) |
| 35 | (hret : MapsTo A V (interior event.retained_pre)) |
| 36 | (hi : ∀ x ∈ V, (mfderiv (𝓡 3) (𝓡 3) A x).IsInvertible) |
| 37 | {x : E} (hx : x ∈ V) : |
| 38 | (mfderiv (𝓡 3) (𝓡 3) (event.retention.map ∘ A) x).IsInvertible := by |
| 39 | have hlocal := (regionEquivalenceInteriorChart event.retention).isLocalDiffeomorphAt |
| 40 | (𝓡 3) (𝓡 3) ∞ (hret hx) |
| 41 | have hri : (mfderiv (𝓡 3) (𝓡 3) event.retention.map (A x)).IsInvertible := |
| 42 | ⟨hlocal.mfderivToContinuousLinearEquiv (by simp), rfl⟩ |
| 43 | have hr := event.retention.map_smooth.contMDiffAt |
| 44 | (mem_interior_iff_mem_nhds.mp (hret hx)) |
| 45 | rw [mfderiv_comp x (hr.mdifferentiableAt (by simp)) |
| 46 | ((hA.contMDiffAt (hV.mem_nhds hx)).mdifferentiableAt (by simp))] |
| 47 | exact hri.comp (hi x hx) |
| 48 | |
| 49 | /-- In every fixed retained local chart the joined actual metric |
| 50 | satisfies the Ricci equation before, at and after surgery. |
| 51 | Source: Proposition 16.5, pp. 374-375; M44 derivation 62. -/ |
| 52 | theorem retainedPullbackCoefficients_ricci |
| 53 | (event : SurgeryEventData g0 K P slice metric T) |
| 54 | (G : RicciFlow 3 (slice T).carrier (Icc T b)) (hTb : T < b) |
| 55 | (hbirth : G.metric T = metric T) |
| 56 | {V : Set E} (hV : IsOpen V) {A : E → (slice event.tMinus).carrier} |
| 57 | (hA : ContMDiffOn (𝓡 3) (𝓡 3) ∞ A V) |
| 58 | (hret : MapsTo A V (interior event.retained_pre)) |
| 59 | (hi : ∀ x ∈ V, (mfderiv (𝓡 3) (𝓡 3) A x).IsInvertible) |
| 60 | {t : ℝ} (ht : t ∈ Ioo event.tMinus b) {x : E} (hx : x ∈ V) : |
| 61 | HasDerivAt (fun s => retainedPullbackCoefficients event G A (s, x)) |
| 62 | (SpacetimeBounds.ricciFlowOperator 3 (SpacetimeBounds.metricTwoJet |
| 63 | (fun y => retainedPullbackCoefficients event G A (t, y)) x)) t := by |
| 64 | have hsmooth := retainedPullbackCoefficients_smooth event G hTb hbirth hV hA hret |
| 65 | have hjets (m : ℕ) := (contDiffOn_spatialJet_within hsmooth |
| 66 | isOpen_Ioo.uniqueDiffOn hV m).continuousOn |
| 67 | have hAr : ContMDiffOn (𝓡 3) (𝓡 3) ∞ (event.retention.map ∘ A) V := |
| 68 | (event.retention.map_smooth.mono interior_subset).comp hA hret |
| 69 | have hir := fun y hy => retained_composition_invertible event hV hA hret hi (x := y) hy |
| 70 | have hinv : ∀ p ∈ Ioo event.tMinus b ×ˢ V, |
| 71 | (retainedPullbackCoefficients event G A p).IsInvertible := by |
| 72 | intro p hp |
| 73 | unfold retainedPullbackCoefficients |
| 74 | split_ifs |
| 75 | · exact (event.pre_flow.metric p.1).isInvertible_pullbackCoefficients (hi p.2 hp.2).injective |
| 76 | · exact (G.metric p.1).isInvertible_pullbackCoefficients (hir p.2 hp.2).injective |
| 77 | apply hasDerivAt_ricci_coefficients_off_finite isOpen_Ioo (finite_singleton T) |
| 78 | hsmooth.continuousOn hjets hinv _ ht hx |
| 79 | intro s hs hnot y hy |
| 80 | have hne : s ≠ T := by simpa only [mem_singleton_iff] using hnot |
| 81 | rcases lt_or_gt_of_ne hne with hlt | hgt |
| 82 | · let H := Poincare.Geometry.RicciFlow.Harnack.restrictFlow event.pre_flow |
| 83 | Ioo_subset_Ico_self ordConnected_Ioo (Ioo_infinite event.tMinus_lt).nontrivial |
| 84 | have hd := hasDerivAt_pullbackCoefficients_ricci H isOpen_Ioo hV hA hi ⟨hs.1, hlt⟩ hy |
| 85 | have heq : (fun r => retainedPullbackCoefficients event G A (r, y)) =ᶠ[𝓝 s] |
| 86 | (fun r => (H.metric r).pullbackCoefficients A y) := by |
| 87 | filter_upwards [Iio_mem_nhds hlt] with r hr |
| 88 | change r < T at hr |
| 89 | simp only [retainedPullbackCoefficients, if_pos hr, H, |
| 90 | Poincare.Geometry.RicciFlow.Harnack.restrictFlow] |
| 91 | simpa only [retainedPullbackCoefficients, if_pos hlt, H, |
| 92 | Poincare.Geometry.RicciFlow.Harnack.restrictFlow] using |
| 93 | hd.congr_of_eventuallyEq heq |
| 94 | · let H := Poincare.Geometry.RicciFlow.Harnack.restrictFlow G |
| 95 | Ioo_subset_Icc_self ordConnected_Ioo (Ioo_infinite hTb).nontrivial |
| 96 | have hd := hasDerivAt_pullbackCoefficients_ricci H isOpen_Ioo hV hAr hir ⟨hgt, hs.2⟩ hy |
| 97 | have heq : (fun r => retainedPullbackCoefficients event G A (r, y)) =ᶠ[𝓝 s] |
| 98 | (fun r => (H.metric r).pullbackCoefficients (event.retention.map ∘ A) y) := by |
| 99 | filter_upwards [Ioi_mem_nhds hgt] with r hr |
| 100 | change T < r at hr |
| 101 | simp only [retainedPullbackCoefficients, if_neg (not_lt_of_gt hr), H, |
| 102 | Poincare.Geometry.RicciFlow.Harnack.restrictFlow] |
| 103 | simpa only [retainedPullbackCoefficients, if_neg (not_lt_of_gt hgt), H, |
| 104 | Poincare.Geometry.RicciFlow.Harnack.restrictFlow] using |
| 105 | hd.congr_of_eventuallyEq heq |
| 106 | |
| 107 | end PoincareMT.M44 |