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.RetainedRicciEquation |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Persistence.Limit.Exponential.GeodesicTransport |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Persistence.Charts.SmoothLocalFactorization |
| 4 | |
| 5 | /-! |
| 6 | # Retained Ricci smoothness in a fixed reference pullback |
| 7 | |
| 8 | The actual retained family is jointly smooth after every fixed |
| 9 | smooth coordinate pullback, including the surgery time itself. |
| 10 | Morgan--Tian, Lemma 16.8 and Proposition 16.5, pp. 372-375; |
| 11 | see derivation 61. |
| 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 | local notation "Bilin" => E →L[ℝ] E →L[ℝ] ℝ |
| 26 | |
| 27 | noncomputable local instance retainedPullbackBilinearNorm : NormedAddCommGroup Bilin := |
| 28 | ContinuousLinearMap.toNormedAddCommGroup |
| 29 | |
| 30 | noncomputable local instance retainedPullbackBilinearSpace : NormedSpace ℝ Bilin := |
| 31 | ContinuousLinearMap.toNormedSpace |
| 32 | |
| 33 | variable {g0 : StandardInitialMetric} {K : MetricSurgeryConstants} {P : SurgeryParameters} |
| 34 | {slice : ℝ → GeneralizedSliceCarrier.{u}} |
| 35 | {metric : ∀ t, RiemannianMetric 3 (slice t).carrier} {T b : ℝ} |
| 36 | |
| 37 | /-- The actual two-piece retained metric in a fixed preterminal |
| 38 | reference map. Source: Proposition 16.5; M44 derivation 61. -/ |
| 39 | noncomputable def retainedPullbackCoefficients |
| 40 | (event : SurgeryEventData g0 K P slice metric T) |
| 41 | (G : RicciFlow 3 (slice T).carrier (Icc T b)) |
| 42 | (A : E → (slice event.tMinus).carrier) (p : ℝ × E) : Bilin := |
| 43 | if p.1 < T then (event.pre_flow.metric p.1).pullbackCoefficients A p.2 |
| 44 | else (G.metric p.1).pullbackCoefficients (event.retention.map ∘ A) p.2 |
| 45 | |
| 46 | /-- A smooth fixed factorization through an actual retained |
| 47 | coordinate chart gives joint smoothness of the physical pullback. |
| 48 | Source: Proposition 16.5, pp. 374-375; M44 derivation 61. -/ |
| 49 | theorem retainedPullbackCoefficients_smooth_of_factorization |
| 50 | (event : SurgeryEventData g0 K P slice metric T) |
| 51 | (G : RicciFlow 3 (slice T).carrier (Icc T b)) (hTb : T < b) |
| 52 | (hbirth : G.metric T = metric T) |
| 53 | (q : (slice event.tMinus).carrier) (hq : q ∈ interior event.retained_pre) |
| 54 | {U V : Set E} (hU : IsOpen U) (hV : IsOpen V) |
| 55 | (hchart : U ⊆ (extChartAt (𝓡 3) q).target) |
| 56 | (hret : (extChartAt (𝓡 3) q).symm '' U ⊆ interior event.retained_pre) |
| 57 | {A : E → (slice event.tMinus).carrier} {k : E → E} |
| 58 | (hk : ContDiffOn ℝ ∞ k V) (hmap : MapsTo k V U) |
| 59 | (hfactor : ∀ x ∈ V, A x = (extChartAt (𝓡 3) q).symm (k x)) : |
| 60 | ContDiffOn ℝ ∞ (retainedPullbackCoefficients event G A) (Ioo event.tMinus b ×ˢ V) := by |
| 61 | have hB := (retainedChartCoefficients_smooth_ricci event G hTb hbirth q hq hU hchart hret).1 |
| 62 | have hkprod : ContDiffOn ℝ ∞ (fun p : ℝ × E => (p.1, k p.2)) |
| 63 | (Ioo event.tMinus b ×ˢ V) := |
| 64 | contDiffOn_fst.prodMk (hk.comp contDiffOn_snd (fun _ hp => hp.2)) |
| 65 | have hbase : ContDiffOn ℝ ∞ |
| 66 | (fun p : ℝ × E => retainedChartCoefficients event G q (p.1, k p.2)) |
| 67 | (Ioo event.tMinus b ×ˢ V) := |
| 68 | hB.comp hkprod (fun _ hp => ⟨hp.1, hmap hp.2⟩) |
| 69 | have hd : ContDiffOn ℝ ∞ (fun p : ℝ × E => fderiv ℝ k p.2) |
| 70 | (Ioo event.tMinus b ×ˢ V) := |
| 71 | (hk.fderiv_of_isOpen hV (by simp)).comp contDiffOn_snd (fun _ hp => hp.2) |
| 72 | have hflip : ContDiff ℝ ∞ (fun L : Bilin => L.flip) := |
| 73 | (ContinuousLinearMap.flipₗᵢ ℝ E E ℝ).contDiff |
| 74 | have hpull : ContDiffOn ℝ ∞ (fun p : ℝ × E => |
| 75 | (retainedChartCoefficients event G q (p.1, k p.2)).bilinearComp |
| 76 | (fderiv ℝ k p.2) (fderiv ℝ k p.2)) (Ioo event.tMinus b ×ˢ V) := by |
| 77 | simpa only [ContinuousLinearMap.bilinearComp, Function.comp_def] using |
| 78 | hflip.comp_contDiffOn ((hflip.comp_contDiffOn (hbase.clm_comp hd)).clm_comp hd) |
| 79 | apply hpull.congr |
| 80 | intro p hp |
| 81 | have hkx := (hk.contDiffAt (hV.mem_nhds hp.2)).differentiableAt (by simp) |
| 82 | have heq : (extChartAt (𝓡 3) q).symm ∘ k =ᶠ[𝓝 p.2] A := by |
| 83 | filter_upwards [hV.mem_nhds hp.2] with y hy |
| 84 | exact (hfactor y hy).symm |
| 85 | ext v w |
| 86 | by_cases ht : p.1 < T |
| 87 | · have he := (contMDiffOn_extChartAt_symm (I := 𝓡 3) (n := ∞) q).contMDiffAt |
| 88 | ((isOpen_extChartAt_target q).mem_nhds (hchart (hmap hp.2))) |
| 89 | simpa only [retainedPullbackCoefficients, retainedChartCoefficients, if_pos ht, |
| 90 | ContinuousLinearMap.bilinearComp_apply] using |
| 91 | (event.pre_flow.metric p.1).pullbackCoefficients_eq_of_comp_germ |
| 92 | (he.mdifferentiableAt (by simp)) hkx heq v w |
| 93 | · have he := (retained_inverse_coordinates_smooth event q hchart hret).contMDiffAt |
| 94 | (hU.mem_nhds (hmap hp.2)) |
| 95 | have heq' : (event.retention.map ∘ (extChartAt (𝓡 3) q).symm) ∘ k =ᶠ[𝓝 p.2] |
| 96 | event.retention.map ∘ A := by |
| 97 | filter_upwards [heq] with y hy |
| 98 | exact congrArg event.retention.map hy |
| 99 | simpa only [retainedPullbackCoefficients, retainedChartCoefficients, if_neg ht, |
| 100 | ContinuousLinearMap.bilinearComp_apply] using |
| 101 | (G.metric p.1).pullbackCoefficients_eq_of_comp_germ |
| 102 | (he.mdifferentiableAt (by simp)) hkx heq' v w |
| 103 | |
| 104 | /- The factorization is used on a neighborhood of each source point, |
| 105 | so no global chart on the retained region is required. -/ |
| 106 | /-- Every smooth fixed reference map into the retained interior |
| 107 | gives a jointly smooth actual two-piece pullback through surgery. |
| 108 | Source: Proposition 16.5, pp. 374-375; M44 derivation 61. -/ |
| 109 | theorem retainedPullbackCoefficients_smooth |
| 110 | (event : SurgeryEventData g0 K P slice metric T) |
| 111 | (G : RicciFlow 3 (slice T).carrier (Icc T b)) (hTb : T < b) |
| 112 | (hbirth : G.metric T = metric T) |
| 113 | {V : Set E} (hV : IsOpen V) {A : E → (slice event.tMinus).carrier} |
| 114 | (hA : ContMDiffOn (𝓡 3) (𝓡 3) ∞ A V) |
| 115 | (hret : MapsTo A V (interior event.retained_pre)) : |
| 116 | ContDiffOn ℝ ∞ (retainedPullbackCoefficients event G A) (Ioo event.tMinus b ×ˢ V) := by |
| 117 | rintro ⟨t, x⟩ ⟨ht, hx⟩ |
| 118 | obtain ⟨U, W, hU, hW, hxW, _, hchart, hinside, k, hk, hmap, hfactor⟩ := |
| 119 | Poincare.exists_smooth_local_chart_factorization hV isOpen_interior hA hret hx |
| 120 | have hs := retainedPullbackCoefficients_smooth_of_factorization event G hTb hbirth |
| 121 | (A x) (hret hx) hU hW hchart hinside hk hmap hfactor |
| 122 | exact (hs.contDiffAt ((isOpen_Ioo.prod hW).mem_nhds ⟨ht, hxW⟩)).contDiffWithinAt |
| 123 | |
| 124 | end PoincareMT.M44 |