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.CanonicalInduction.Terminal.Source.TerminalSourceActualOverlap |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Terminal.Germs.TerminalGermsOverlapLimits |
| 3 | |
| 4 | /-! |
| 5 | # Actual coefficient identities on the original source overlaps |
| 6 | |
| 7 | Distance confinement supplies a fixed neighborhood where the original |
| 8 | inverse is defined. The terminal map identity there and the actual |
| 9 | same-clock cylinders preserve both metric slots at a common included time. |
| 10 | MT Proposition 5.14; terminal-source-countable-finite-germs.md, B. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set Filter Metric TopologicalSpace Poincare.Gluing |
| 17 | open scoped Manifold ContDiff Bundle Topology NNReal |
| 18 | |
| 19 | universe u v |
| 20 | |
| 21 | namespace PoincareMT.M47 |
| 22 | |
| 23 | open ChartDistance |
| 24 | |
| 25 | local notation "E" => EuclideanSpace ℝ (Fin 3) |
| 26 | local notation "V" => E →L[ℝ] E →L[ℝ] ℝ |
| 27 | |
| 28 | /-- On a genuine common source tail, the actual terminal inverse |
| 29 | transition gives the full coefficient identity at every included time. -/ |
| 30 | theorem terminalSourceCountable_source_overlap |
| 31 | (U : ℕ → Set E) (hU : ∀ n, IsOpen (U n)) [∀ n, Nonempty (Piece U n)] |
| 32 | {M : ℕ → Type v} [∀ k, MetricSpace (M k)] [∀ k, ChartedSpace E (M k)] |
| 33 | [∀ k, IsManifold (𝓡 3) ∞ (M k)] |
| 34 | (maps : ∀ k n, Piece U n → M k) |
| 35 | (D : ∀ n n', C(Piece U n × Piece U n', ℝ)) |
| 36 | (hD : ∀ n n' x y, Tendsto (fun k => dist (maps k n x) (maps k n' y)) atTop |
| 37 | (𝓝 (D n n' (x, y)))) |
| 38 | (L : ℕ → ℝ≥0) (he : ∀ k n, LipschitzWith (L n) (maps k n)) |
| 39 | (c : ℕ → ℝ) (hc : ∀ n, 0 < c n) |
| 40 | (hlower : ∀ k n x y, c n * dist x y ≤ dist (maps k n x) (maps k n y)) |
| 41 | (hopen : ∀ k n, Topology.IsOpenEmbedding (maps k n)) |
| 42 | (hconn : ∀ k (x : M k) r, IsPreconnected (ball x r)) |
| 43 | (hsmooth : letI : ∀ n, ChartedSpace E (Piece U n) := |
| 44 | fun n => (hU n).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 45 | ∀ k n, IsLocalDiffeomorph (𝓡 3) (𝓡 3) ∞ (maps k n)) |
| 46 | (i j : ℕ) (raw : ℕ → SurgeryFlowData.{u}) (origin Q : ℕ → ℝ) |
| 47 | (C1 C2 : ℕ → GeneralizedSliceCarrier.{u}) |
| 48 | (V1 : ∀ k, Opens (C1 k).carrier) (V2 : ∀ k, Opens (C2 k).carrier) |
| 49 | {tau1 tau2 s : ℝ} (htau1 : 0 < tau1) (htau2 : 0 < tau2) |
| 50 | (hs1 : s ∈ Icc (-tau1) 0) (hs2 : s ∈ Icc (-tau2) 0) |
| 51 | (e1 : ∀ k, SurgeryFlowCylinder (raw k) (C1 k) (origin k) (Q k) |
| 52 | (Icc (-tau1) 0) (V1 k)) |
| 53 | (e2 : ∀ k, SurgeryFlowCylinder (raw k) (C2 k) (origin k) (Q k) |
| 54 | (Icc (-tau2) 0) (V2 k)) |
| 55 | (g1 : ∀ k, RiemannianMetric 3 (V1 k)) (g2 : ∀ k, RiemannianMetric 3 (V2 k)) |
| 56 | (hmetric1 : ∀ k (y : V1 k) (a b : TangentSpace (𝓡 3) y), |
| 57 | (g1 k).inner y a b = (e1 k).pullbackInner s hs1 y.val |
| 58 | (mfderiv (𝓡 3) (𝓡 3) (Subtype.val : V1 k → (C1 k).carrier) y a) |
| 59 | (mfderiv (𝓡 3) (𝓡 3) (Subtype.val : V1 k → (C1 k).carrier) y b)) |
| 60 | (hmetric2 : ∀ k (y : V2 k) (a b : TangentSpace (𝓡 3) y), |
| 61 | (g2 k).inner y a b = (e2 k).pullbackInner s hs2 y.val |
| 62 | (mfderiv (𝓡 3) (𝓡 3) (Subtype.val : V2 k → (C2 k).carrier) y a) |
| 63 | (mfderiv (𝓡 3) (𝓡 3) (Subtype.val : V2 k → (C2 k).carrier) y b)) |
| 64 | (phi1 : ∀ k, E → V1 k) (phi2 : ∀ k, E → V2 k) |
| 65 | (hphi1 : ∀ k, ContMDiffOn (𝓡 3) (𝓡 3) ∞ (phi1 k) (U i)) |
| 66 | (hphi2 : ∀ k, ContMDiffOn (𝓡 3) (𝓡 3) ∞ (phi2 k) (U j)) |
| 67 | (physical : ∀ k, M k → ((raw k).slice (origin k + 0 / Q k)).carrier) |
| 68 | (hterminal1 : ∀ k (x : Piece U i), physical k (maps k i x) = |
| 69 | (e1 k).forward 0 ⟨neg_nonpos.mpr htau1.le, le_rfl⟩ (phi1 k x.val).val) |
| 70 | (hterminal2 : ∀ k (x : Piece U j), physical k (maps k j x) = |
| 71 | (e2 k).forward 0 ⟨neg_nonpos.mpr htau2.le, le_rfl⟩ (phi2 k x.val).val) |
| 72 | (Aseq Bseq : ℕ → E → V) |
| 73 | (hA : ∀ k, EqOn (Aseq k) ((g1 k).pullbackCoefficients (phi1 k)) (U i)) |
| 74 | (hB : ∀ k, EqOn (Bseq k) ((g2 k).pullbackCoefficients (phi2 k)) (U j)) : |
| 75 | ∀ x ∈ Subtype.val '' overlap (fun n n' => D n n') i j, |
| 76 | ∀ᶠ k in atTop, ∀ v w, |
| 77 | let T := coordinateRepresentative U hU |
| 78 | (fun y => Function.invFun (maps k j) (maps k i y)) |
| 79 | Bseq k (T x) (fderiv ℝ T x v) (fderiv ℝ T x w) = Aseq k x v w := by |
| 80 | let : ∀ n, ChartedSpace E (Piece U n) := |
| 81 | fun n => (hU n).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 82 | let : ∀ n, IsManifold (𝓡 3) ∞ (Piece U n) := |
| 83 | fun n => (hU n).isOpenEmbedding_subtypeVal.isManifold_singleton |
| 84 | let : ∀ n, LocallyCompactSpace (Piece U n) := fun n => (hU n).locallyCompactSpace |
| 85 | rintro _ ⟨x, hx, rfl⟩ |
| 86 | obtain ⟨W, hW, hxW, K, _hK, hrep⟩ := |
| 87 | exists_source_transition_neighborhood hD L he c hc hlower hopen hconn hx |
| 88 | filter_upwards [hrep] with k hk v w |
| 89 | let T := coordinateRepresentative U hU |
| 90 | (fun y => Function.invFun (maps k j) (maps k i y)) |
| 91 | have hWcoord : IsOpen (Subtype.val '' W) := |
| 92 | (hU i).isOpenEmbedding_subtypeVal.isOpenMap _ hW |
| 93 | have hWUi : Subtype.val '' W ⊆ U i := by |
| 94 | rintro _ ⟨y, _, rfl⟩ |
| 95 | exact y.property |
| 96 | have hT : ContDiffOn ℝ ∞ T (Subtype.val '' W) := by |
| 97 | apply contDiffOn_coordinateRepresentative |
| 98 | exact (contMDiffOn_invFun_of_localDiffeomorph (hsmooth k j) |
| 99 | (hopen k j).injective).comp (hsmooth k i).contMDiff.contMDiffOn |
| 100 | (fun y hy => image_subset_range _ _ (hk y hy).1) |
| 101 | have hTU : MapsTo T (Subtype.val '' W) (U j) := by |
| 102 | rintro _ ⟨y, _hy, rfl⟩ |
| 103 | dsimp only [T] |
| 104 | rw [coordinateRepresentative_apply] |
| 105 | exact (Function.invFun (maps k j) (maps k i y)).property |
| 106 | have hterminal : ∀ y ∈ Subtype.val '' W, |
| 107 | (e1 k).forward 0 ⟨neg_nonpos.mpr htau1.le, le_rfl⟩ (phi1 k y).val = |
| 108 | (e2 k).forward 0 ⟨neg_nonpos.mpr htau2.le, le_rfl⟩ (phi2 k (T y)).val := by |
| 109 | rintro _ ⟨y, hy, rfl⟩ |
| 110 | have hinverse : maps k j (Function.invFun (maps k j) (maps k i y)) = maps k i y := |
| 111 | Function.invFun_eq (image_subset_range _ _ (hk y hy).1) |
| 112 | rw [← hterminal1 k y] |
| 113 | dsimp only [T] |
| 114 | rw [coordinateRepresentative_apply, ← hterminal2] |
| 115 | exact congrArg (physical k) hinverse.symm |
| 116 | have hI : Icc s 0 ⊆ Icc (-tau1) 0 := fun _ ht => ⟨hs1.1.trans ht.1, ht.2⟩ |
| 117 | have hJ : Icc s 0 ⊆ Icc (-tau2) 0 := fun _ ht => ⟨hs2.1.trans ht.1, ht.2⟩ |
| 118 | have hxcoord : x.val ∈ Subtype.val '' W := mem_image_of_mem _ hxW |
| 119 | change Bseq k (T x.val) (fderiv ℝ T x.val v) (fderiv ℝ T x.val w) = Aseq k x.val v w |
| 120 | rw [hB k (hTU hxcoord), hA k x.property] |
| 121 | exact terminalSource_actual_overlap_coefficients (V1 k) (V2 k) (e1 k) (e2 k) |
| 122 | hs1.2 hI hJ (g1 k) (g2 k) (hmetric1 k) (hmetric2 k) hWcoord (hU j) |
| 123 | (phi1 k) (phi2 k) T ((hphi1 k).mono hWUi) (hphi2 k) hT hTU hterminal hxcoord v w |
| 124 | |
| 125 | end PoincareMT.M47 |