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.Induction.EpochExtension.Terminal.SingularInput |
| 2 | |
| 3 | /-! |
| 4 | # The retained reference in M33's terminal bridge |
| 5 | |
| 6 | Theorem 11.19 and Definition 11.27, pp. 279--283. Both reference and core |
| 7 | use the actual last-slab carrier. No connection representative is reselected. |
| 8 | -/ |
| 9 | |
| 10 | set_option autoImplicit false |
| 11 | set_option backward.isDefEq.respectTransparency false |
| 12 | |
| 13 | open Set |
| 14 | open scoped Manifold ContDiff |
| 15 | |
| 16 | universe u |
| 17 | |
| 18 | namespace PoincareMT |
| 19 | |
| 20 | private theorem scalar_family_eq (M : GeneralizedSliceCarrier.{u}) |
| 21 | {g h : ℝ → RiemannianMetric 3 M.carrier} |
| 22 | (D : ∀ t, LeviCivitaData (g t)) (E : ∀ t, LeviCivitaData (h t)) |
| 23 | (hg : g = h) (hD : HEq D E) : |
| 24 | (fun t x => (D t).scalarCurvature x) = fun t x => (E t).scalarCurvature x := by |
| 25 | cases hg |
| 26 | cases hD |
| 27 | rfl |
| 28 | |
| 29 | namespace M48RegularReferenceData |
| 30 | |
| 31 | variable {F : SurgeryFlowData.{u}} {T : ℝ} |
| 32 | {L : RepairedPreterminalSlab F T} {R : M33RegularHistoryData L.regularHistoryWindow} |
| 33 | (D : M48RegularReferenceData L R) |
| 34 | |
| 35 | /-- Scalar equality follows from the retained metric and connection families. -/ |
| 36 | theorem scalar_eq (t : ℝ) (x : (F.slice L.start).carrier) : |
| 37 | (D.reference.flow.connection t).scalarCurvature x = |
| 38 | (L.flow.connection t).scalarCurvature x := |
| 39 | congrFun (congrFun (scalar_family_eq (F.slice L.start) |
| 40 | D.reference.flow.connection L.flow.connection D.metric_eq D.connection_eq) t) x |
| 41 | |
| 42 | /-- Identify the actual time slice with the fixed old reference carrier. -/ |
| 43 | noncomputable def identify (t : Ico D.reference.tMinus T) : |
| 44 | Diffeomorph (𝓡 3) (𝓡 3) (F.slice t.1).carrier (F.slice L.start).carrier ∞ := |
| 45 | (L.identify ⟨t.1, D.start_inside.le.trans t.2.1, t.2.2⟩).symm |
| 46 | |
| 47 | theorem identify_slab (t : Ico D.reference.tMinus T) (x : (F.slice L.start).carrier) : |
| 48 | D.identify t (L.identify ⟨t.1, D.start_inside.le.trans t.2.1, t.2.2⟩ x) = x := |
| 49 | (L.identify _).symm_apply_apply x |
| 50 | |
| 51 | theorem history_identify (t : Ico D.reference.tMinus T) (x : (F.slice L.start).carrier) : |
| 52 | R.history.forward t.1 (D.reference.window_subset t.2) |
| 53 | (D.reference.forward t.1 t.2 x) = (D.identify t).symm x := |
| 54 | D.history_eq t.1 t.2 x |
| 55 | |
| 56 | /-- Differentiating the inverse composition keeps the actual inner product. -/ |
| 57 | theorem metric_pullback (t : Ico D.reference.tMinus T) |
| 58 | (x : (F.slice L.start).carrier) (v w : TangentSpace (𝓡 3) x) : |
| 59 | let s : Ico L.start T := ⟨t.1, D.start_inside.le.trans t.2.1, t.2.2⟩ |
| 60 | (D.reference.flow.metric t.1).inner (D.identify t (L.identify s x)) |
| 61 | (mfderiv (𝓡 3) (𝓡 3) (D.identify t) (L.identify s x) |
| 62 | (mfderiv (𝓡 3) (𝓡 3) (L.identify s) x v)) |
| 63 | (mfderiv (𝓡 3) (𝓡 3) (D.identify t) (L.identify s x) |
| 64 | (mfderiv (𝓡 3) (𝓡 3) (L.identify s) x w)) = |
| 65 | (L.flow.metric t.1).inner x v w := by |
| 66 | let e := L.identify ⟨t.1, D.start_inside.le.trans t.2.1, t.2.2⟩ |
| 67 | have hcomp : e.symm ∘ e = id := by funext y; exact e.symm_apply_apply y |
| 68 | have hd : (mfderiv (𝓡 3) (𝓡 3) e.symm (e x)).comp |
| 69 | (mfderiv (𝓡 3) (𝓡 3) e x) = ContinuousLinearMap.id ℝ _ := by |
| 70 | rw [← mfderiv_comp x (e.symm.contMDiff.mdifferentiable (by simp) _) |
| 71 | (e.contMDiff.mdifferentiable (by simp) _), hcomp, mfderiv_id] |
| 72 | have hv (z : TangentSpace (𝓡 3) x) : |
| 73 | mfderiv (𝓡 3) (𝓡 3) e.symm (e x) (mfderiv (𝓡 3) (𝓡 3) e x z) = z := |
| 74 | congrArg (fun f => f z) hd |
| 75 | change (D.reference.flow.metric t.1).inner (e.symm (e x)) |
| 76 | (mfderiv (𝓡 3) (𝓡 3) e.symm (e x) (mfderiv (𝓡 3) (𝓡 3) e x v)) |
| 77 | (mfderiv (𝓡 3) (𝓡 3) e.symm (e x) (mfderiv (𝓡 3) (𝓡 3) e x w)) = _ |
| 78 | rw [hv, hv, e.symm_apply_apply, congrFun D.metric_eq t.1] |
| 79 | |
| 80 | theorem scalar_pullback (t : Ico D.reference.tMinus T) (x : (F.slice L.start).carrier) : |
| 81 | let s : Ico L.start T := ⟨t.1, D.start_inside.le.trans t.2.1, t.2.2⟩ |
| 82 | (D.reference.flow.connection t.1).scalarCurvature (D.identify t (L.identify s x)) = |
| 83 | (L.flow.connection t.1).scalarCurvature x := by |
| 84 | dsimp only |
| 85 | rw [D.identify_slab] |
| 86 | exact D.scalar_eq _ _ |
| 87 | |
| 88 | theorem transport_compatibility (a b : ℝ) (hab : a < b) |
| 89 | (hJ : Icc a b ⊆ F.time_domain) (habs : Disjoint F.surgery_times (Ioc a b)) |
| 90 | (s t : ℝ) (hs : s ∈ Icc a b) (ht : t ∈ Icc a b) |
| 91 | (hs' : s ∈ Ico D.reference.tMinus T) (ht' : t ∈ Ico D.reference.tMinus T) |
| 92 | (x : (F.slice s).carrier) : |
| 93 | D.identify ⟨t, ht'⟩ |
| 94 | ((F.regular_slabs a b hab hJ habs).transport ⟨s, hs⟩ ⟨t, ht⟩ x) = |
| 95 | D.identify ⟨s, hs'⟩ x := by |
| 96 | let s' : Ico L.start T := ⟨s, D.start_inside.le.trans hs'.1, hs'.2⟩ |
| 97 | let t' : Ico L.start T := ⟨t, D.start_inside.le.trans ht'.1, ht'.2⟩ |
| 98 | have h := L.transport_compatibility a b hab hJ habs s t hs ht s'.2 t'.2 |
| 99 | ((L.identify s').symm x) |
| 100 | simpa only [s', t', identify, Diffeomorph.apply_symm_apply, |
| 101 | Diffeomorph.symm_apply_apply] using |
| 102 | congrArg (L.identify t').symm h |
| 103 | |
| 104 | end M48RegularReferenceData |
| 105 | |
| 106 | end PoincareMT |