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.Flow.Basic |
| 2 | |
| 3 | /-! |
| 4 | # Equality transport for rebuilding old surgery events |
| 5 | |
| 6 | Adapted from `PoincareMT/Proofs/M51/EmptyEventCopy.lean` at upstream commit |
| 7 | `117c0a267a0f7cf105397c586e1df2f92dbee2bf`. The index is a slice together with its |
| 8 | metric, so this transport also applies when a continuation changes the later |
| 9 | slice family. See Morgan--Tian, Definition 15.8, p. 362. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open scoped Manifold ContDiff Bundle |
| 15 | |
| 16 | universe u v |
| 17 | |
| 18 | namespace PoincareMT.SurgeryEventRebuild |
| 19 | |
| 20 | /-- The dependent slice and metric data at a single time. -/ |
| 21 | abbrev SliceMetric := (S : GeneralizedSliceCarrier.{u}) × RiemannianMetric 3 S.carrier |
| 22 | |
| 23 | theorem sliceMetric_eq {A B : SliceMetric.{u}} (hS : A.1 = B.1) |
| 24 | (hg : HEq A.2 B.2) : A = B := Sigma.ext hS hg |
| 25 | |
| 26 | def relabel {C : SliceMetric.{u} → Sort v} {s t : SliceMetric.{u}} |
| 27 | (h : s = t) (x : C s) : C t := h ▸ x |
| 28 | |
| 29 | theorem relabel_heq {C : SliceMetric.{u} → Sort v} {s t : SliceMetric.{u}} |
| 30 | (h : s = t) (x : C s) : HEq (relabel h x) x := by |
| 31 | subst t |
| 32 | rfl |
| 33 | |
| 34 | /-- Equality of slice and metric pairs gives the literal smooth identification. -/ |
| 35 | noncomputable def identify (s t : SliceMetric.{u}) (h : s = t) : |
| 36 | Diffeomorph (𝓡 3) (𝓡 3) s.1.carrier t.1.carrier ∞ := by |
| 37 | subst t |
| 38 | exact Diffeomorph.refl (𝓡 3) s.1.carrier ∞ |
| 39 | |
| 40 | theorem identify_apply_heq {s t : SliceMetric.{u}} (h : s = t) (x : s.1.carrier) : |
| 41 | HEq (identify s t h x) x := by |
| 42 | subst t |
| 43 | rfl |
| 44 | |
| 45 | theorem relabel_set_image {s t : SliceMetric.{u}} (h : s = t) |
| 46 | (U : Set s.1.carrier) : |
| 47 | identify s t h '' U = relabel (C := fun r => Set r.1.carrier) h U := by |
| 48 | subst t |
| 49 | exact Set.image_id _ |
| 50 | |
| 51 | def regionSource {s t : SliceMetric.{u}} (h : s = t) |
| 52 | (B : GeneralizedSliceCarrier.{u}) (U : Set s.1.carrier) (V : Set B.carrier) |
| 53 | (e : SurgeryRegionEquivalence s.1 B U V) : |
| 54 | SurgeryRegionEquivalence t.1 B |
| 55 | (relabel (C := fun r => Set r.1.carrier) h U) V := by |
| 56 | subst t |
| 57 | exact e |
| 58 | |
| 59 | theorem regionSource_map {s t : SliceMetric.{u}} (h : s = t) |
| 60 | (B : GeneralizedSliceCarrier.{u}) (U : Set s.1.carrier) (V : Set B.carrier) |
| 61 | (e : SurgeryRegionEquivalence s.1 B U V) (x : s.1.carrier) : |
| 62 | (regionSource h B U V e).map (identify s t h x) = e.map x := by |
| 63 | subst t |
| 64 | rfl |
| 65 | |
| 66 | def region {s s' t t' : SliceMetric.{u}} (hs : s = s') (ht : t = t') |
| 67 | (U : Set s.1.carrier) (V : Set t.1.carrier) |
| 68 | (e : SurgeryRegionEquivalence s.1 t.1 U V) : |
| 69 | SurgeryRegionEquivalence s'.1 t'.1 |
| 70 | (relabel (C := fun r => Set r.1.carrier) hs U) |
| 71 | (relabel (C := fun r => Set r.1.carrier) ht V) := by |
| 72 | subst s' |
| 73 | subst t' |
| 74 | exact e |
| 75 | |
| 76 | theorem region_map {s s' t t' : SliceMetric.{u}} (hs : s = s') (ht : t = t') |
| 77 | (U : Set s.1.carrier) (V : Set t.1.carrier) |
| 78 | (e : SurgeryRegionEquivalence s.1 t.1 U V) (x : s.1.carrier) : |
| 79 | (region hs ht U V e).map (identify s s' hs x) = |
| 80 | identify t t' ht (e.map x) := by |
| 81 | subst s' |
| 82 | subst t' |
| 83 | rfl |
| 84 | |
| 85 | noncomputable def diffeomorph {s s' t t' : SliceMetric.{u}} |
| 86 | (hs : s = s') (ht : t = t') |
| 87 | (f : Diffeomorph (𝓡 3) (𝓡 3) s.1.carrier t.1.carrier ∞) : |
| 88 | Diffeomorph (𝓡 3) (𝓡 3) s'.1.carrier t'.1.carrier ∞ := by |
| 89 | subst s' |
| 90 | subst t' |
| 91 | exact f |
| 92 | |
| 93 | theorem diffeomorph_apply {s s' t t' : SliceMetric.{u}} |
| 94 | (hs : s = s') (ht : t = t') |
| 95 | (f : Diffeomorph (𝓡 3) (𝓡 3) s.1.carrier t.1.carrier ∞) (x : s.1.carrier) : |
| 96 | diffeomorph hs ht f (identify s s' hs x) = identify t t' ht (f x) := by |
| 97 | subst s' |
| 98 | subst t' |
| 99 | rfl |
| 100 | |
| 101 | /-- The ordinary pre-flow keeps its physical time and all its geometric data. -/ |
| 102 | noncomputable def flow {s t : SliceMetric.{u}} (h : s = t) {J : Set ℝ} |
| 103 | (B : RicciFlow 3 s.1.carrier J) : RicciFlow 3 t.1.carrier J := h ▸ B |
| 104 | |
| 105 | theorem flow_heq {s t : SliceMetric.{u}} (h : s = t) {J : Set ℝ} |
| 106 | (B : RicciFlow 3 s.1.carrier J) : HEq (flow h B) B := by |
| 107 | subst t |
| 108 | rfl |
| 109 | |
| 110 | theorem diffeomorph_flow_metric_pullback {s s' t t' : SliceMetric.{u}} |
| 111 | (hs : s = s') (ht : t = t') {J : Set ℝ} |
| 112 | (B : RicciFlow 3 s.1.carrier J) (r : ℝ) |
| 113 | (f : Diffeomorph (𝓡 3) (𝓡 3) s.1.carrier t.1.carrier ∞) |
| 114 | (h : ∀ x v w, t.2.inner (f x) |
| 115 | (mfderiv (𝓡 3) (𝓡 3) f x v) (mfderiv (𝓡 3) (𝓡 3) f x w) = |
| 116 | (B.metric r).inner x v w) : |
| 117 | ∀ x v w, t'.2.inner (diffeomorph hs ht f x) |
| 118 | (mfderiv (𝓡 3) (𝓡 3) (diffeomorph hs ht f) x v) |
| 119 | (mfderiv (𝓡 3) (𝓡 3) (diffeomorph hs ht f) x w) = |
| 120 | ((flow hs B).metric r).inner x v w := by |
| 121 | subst s' |
| 122 | subst t' |
| 123 | exact h |
| 124 | |
| 125 | end PoincareMT.SurgeryEventRebuild |