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.TerminalSourcePhysicalStage |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Terminal.Source.TerminalSourceNormalAmbientCharts |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Terminal.Source.TerminalSourceComponentCharts |
| 4 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Terminal.Source.TerminalSourceCountableScale |
| 5 | |
| 6 | /-! |
| 7 | # The same finite source charts in the physical base component |
| 8 | |
| 9 | The actual terminal map transfers the whole source ball and every |
| 10 | compact chart core. Only the codomain is restricted to the genuine |
| 11 | physical component; all maps, distances and metric slots are retained. |
| 12 | MT Theorem 5.11; terminal-source-physical-stage.md, G10b. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set |
| 19 | open scoped Manifold ContDiff Bundle ENNReal Topology |
| 20 | |
| 21 | universe u v |
| 22 | |
| 23 | namespace PoincareMT.M47 |
| 24 | |
| 25 | local notation "E" => EuclideanSpace ℝ (Fin 3) |
| 26 | |
| 27 | variable {M : Type u} {N : Type v} [TopologicalSpace M] [TopologicalSpace N] |
| 28 | [ChartedSpace E M] [ChartedSpace E N] |
| 29 | [IsManifold (𝓡 3) ∞ M] [IsManifold (𝓡 3) ∞ N] [T3Space M] [T3Space N] |
| 30 | |
| 31 | /-- An actual indexed source cover gives based physical component maps |
| 32 | with exact metric readouts, uniform distances and the same compact cores. -/ |
| 33 | theorem terminalSource_exists_physical_stage_maps |
| 34 | (g : RiemannianMetric 3 M) (h : RiemannianMetric 3 N) |
| 35 | (j : PartialDiffeomorph (𝓡 3) (𝓡 3) M N ∞) (hsource : j.source = univ) |
| 36 | (hmetric : ∀ x (v w : TangentSpace (𝓡 3) x), |
| 37 | g.inner x v w = h.inner (j x) |
| 38 | (mfderiv (𝓡 3) (𝓡 3) j x v) (mfderiv (𝓡 3) (𝓡 3) j x w)) |
| 39 | (p0 : M) {A Rbig R rho : ℝ} {m : ℕ} |
| 40 | (cover : TerminalSourceIndexedChartCover g p0 A R rho m) |
| 41 | (hA : 0 < A) (hAR : A ≤ Rbig) (hRR : R ≤ Rbig) |
| 42 | (hrho : 0 < rho) (hrhoR : 2 * rho < R) |
| 43 | (hcover : h.ball (j p0) (6 * Rbig) ⊆ j.target) |
| 44 | (hbound : ∀ i, ∀ x ∈ Metric.closedBall (0 : E) (2 * rho), ∀ v, |
| 45 | (1 / 4 : ℝ) * ‖v‖ ^ 2 ≤ g.pullbackCoefficients (cover.chart i).chart x v v ∧ |
| 46 | g.pullbackCoefficients (cover.chart i).chart x v v ≤ (9 / 4 : ℝ) * ‖v‖ ^ 2) : |
| 47 | let W := terminalSourceCountableDomain rho |
| 48 | let C := Poincare.connectedComponentOpens E (j p0) |
| 49 | let p : C := ⟨j p0, mem_connectedComponent⟩ |
| 50 | letI := terminalSourceComponentMetricSpace h (j p0) |
| 51 | ∃ e : Fin (m + 1) → W → C, |
| 52 | (∀ i x, (e i x).val = j ((cover.chart i).chart x.val)) ∧ |
| 53 | e 0 (terminalSourceCountableZero hrho) = p ∧ |
| 54 | (∀ i, Topology.IsOpenEmbedding (e i) ∧ |
| 55 | IsLocalDiffeomorph (𝓡 3) (𝓡 3) ∞ (e i)) ∧ |
| 56 | (∀ i x y, (1 / 2 : ℝ) * dist x y ≤ dist (e i x) (e i y) ∧ |
| 57 | dist (e i x) (e i y) ≤ (3 / 2 : ℝ) * dist x y) ∧ |
| 58 | (∀ i x, dist p (e i x) ≤ A + R) ∧ |
| 59 | (∀ i (x : W) (v w : TangentSpace (𝓡 3) x), |
| 60 | (h.connectedComponentMetric (j p0)).inner (e i x) |
| 61 | (mfderiv (𝓡 3) (𝓡 3) (e i) x v) (mfderiv (𝓡 3) (𝓡 3) (e i) x w) = |
| 62 | g.inner ((cover.chart i).chart x.val) |
| 63 | (mfderiv (𝓡 3) (𝓡 3) (fun y : W => (cover.chart i).chart y.val) x v) |
| 64 | (mfderiv (𝓡 3) (𝓡 3) (fun y : W => (cover.chart i).chart y.val) x w)) ∧ |
| 65 | ∃ core : Set W, IsCompact core ∧ |
| 66 | (∀ x : W, x ∈ core ↔ x.val ∈ Metric.closedBall (0 : E) (rho / 4)) ∧ |
| 67 | Metric.ball p A ⊆ ⋃ i, e i '' core := by |
| 68 | let W := terminalSourceCountableDomain rho |
| 69 | let C := Poincare.connectedComponentOpens E (j p0) |
| 70 | let p : C := ⟨j p0, mem_connectedComponent⟩ |
| 71 | let : MetricSpace C := terminalSourceComponentMetricSpace h (j p0) |
| 72 | let phi := fun (i : Fin (m + 1)) (x : W) => (cover.chart i).chart x.val |
| 73 | let f := fun (i : Fin (m + 1)) (x : W) => j (phi i x) |
| 74 | have hxSource (i : Fin (m + 1)) (x : W) : x.val ∈ (cover.chart i).chart.source := by |
| 75 | rw [(cover.chart i).source] |
| 76 | exact Metric.ball_subset_ball (by linarith : rho / 2 ≤ R) x.property |
| 77 | have hphi (i : Fin (m + 1)) : IsLocalDiffeomorph (𝓡 3) (𝓡 3) ∞ (phi i) := by |
| 78 | intro x |
| 79 | exact (Poincare.isLocalDiffeomorph_opensSubtypeVal (𝓡 3) W x).comp (𝓡 3) M |
| 80 | ((cover.chart i).chart.isLocalDiffeomorphAt (𝓡 3) (𝓡 3) ∞ (hxSource i x)) |
| 81 | have hj : IsLocalDiffeomorph (𝓡 3) (𝓡 3) ∞ j := by |
| 82 | intro x |
| 83 | exact j.isLocalDiffeomorphAt (𝓡 3) (𝓡 3) ∞ (hsource.symm ▸ mem_univ x) |
| 84 | have hf (i : Fin (m + 1)) : IsLocalDiffeomorph (𝓡 3) (𝓡 3) ∞ (f i) := by |
| 85 | intro x |
| 86 | exact (hphi i x).comp (𝓡 3) N (hj (phi i x)) |
| 87 | have hfOpen (i : Fin (m + 1)) : Topology.IsOpenEmbedding (f i) := by |
| 88 | apply Topology.IsOpenEmbedding.of_continuous_injective_isOpenMap |
| 89 | (hf i).contMDiff.continuous _ (hf i).isOpenMap |
| 90 | intro x y hxy |
| 91 | apply Subtype.ext |
| 92 | exact (cover.chart i).chart.injOn (hxSource i x) (hxSource i y) |
| 93 | (j.injOn (hsource.symm ▸ mem_univ _) (hsource.symm ▸ mem_univ _) hxy) |
| 94 | have hball (i : Fin (m + 1)) (x : W) : f i x ∈ h.ball (j p0) (A + R) := by |
| 95 | apply (terminalSourceNormal_ambient_chart_readouts g h j hsource hmetric p0 |
| 96 | (cover.chart i) hA hAR hRR hrho hrhoR (cover.centre_mem i) hcover).1 |
| 97 | exact Metric.ball_subset_closedBall (Metric.ball_subset_ball (by linarith) x.property) |
| 98 | let e := fun i => terminalSourceComponentMap h (j p0) (f i) (hball i) |
| 99 | refine ⟨e, fun _ _ => rfl, ?_, ?_, ?_, ?_, ?_, ?_⟩ |
| 100 | · apply Subtype.ext |
| 101 | change j ((cover.chart 0).chart 0) = j p0 |
| 102 | rw [(cover.chart 0).zero, cover.centre_zero] |
| 103 | · intro i |
| 104 | exact terminalSourceComponentMap_geometry h (j p0) (f i) (hball i) (hfOpen i) (hf i) |
| 105 | · intro i x y |
| 106 | rw [(terminalSourceComponentMap_distances h (j p0) (f i) (hball i) x y).2] |
| 107 | exact terminalSourceNormal_ambient_chart_distance_bounds g h j hsource hmetric p0 |
| 108 | (cover.chart i) hA hAR hRR hrho hrhoR (cover.centre_mem i) hcover |
| 109 | (hbound i) x.property y.property |
| 110 | · intro i x |
| 111 | rw [(terminalSourceComponent_distances h (j p0) p (e i x)).2] |
| 112 | exact (ENNReal.toReal_lt_of_lt_ofReal (hball i x)).le |
| 113 | · intro i x v w |
| 114 | rw [terminalSourceComponentMap_metric h (j p0) (f i) (hball i) (hf i)] |
| 115 | have hchain := mfderiv_comp x (hj.mdifferentiable (by simp) (phi i x)) |
| 116 | ((hphi i).mdifferentiable (by simp) x) |
| 117 | change mfderiv (𝓡 3) (𝓡 3) (f i) x = |
| 118 | (mfderiv (𝓡 3) (𝓡 3) j (phi i x)).comp |
| 119 | (mfderiv (𝓡 3) (𝓡 3) (phi i) x) at hchain |
| 120 | rw [hchain] |
| 121 | exact (hmetric (phi i x) (mfderiv (𝓡 3) (𝓡 3) (phi i) x v) |
| 122 | (mfderiv (𝓡 3) (𝓡 3) (phi i) x w)).symm |
| 123 | · let core : Set W := (Subtype.val : W → E) ⁻¹' Metric.closedBall 0 (rho / 4) |
| 124 | have hcoreBall : Metric.closedBall (0 : E) (rho / 4) ⊆ Metric.ball 0 (rho / 2) := |
| 125 | Metric.closedBall_subset_ball (by linarith) |
| 126 | have hcompact : IsCompact core := |
| 127 | W.isOpen.isOpenEmbedding_subtypeVal.isEmbedding.isInducing.isCompact_preimage' |
| 128 | (isCompact_closedBall (0 : E) (rho / 4)) |
| 129 | (fun z hz => ⟨⟨z, hcoreBall hz⟩, rfl⟩) |
| 130 | refine ⟨core, hcompact, fun _ => Iff.rfl, ?_⟩ |
| 131 | intro y hy |
| 132 | have hphys : y.val ∈ h.ball (j p0) A := by |
| 133 | have himage : y.val ∈ (Subtype.val : C → N) '' Metric.ball p A := ⟨y, hy, rfl⟩ |
| 134 | rwa [(terminalSourceComponent_balls h (j p0) p A).2.1] at himage |
| 135 | have hsmallCover : h.ball (j p0) A ⊆ j.target := by |
| 136 | intro z hz |
| 137 | exact hcover (hz.trans_le (ENNReal.ofReal_le_ofReal (by linarith))) |
| 138 | rw [← terminalSourceNormal_ball_image g h j hsource hmetric p0 A hsmallCover] at hphys |
| 139 | obtain ⟨z, hz, hzy⟩ := hphys |
| 140 | obtain ⟨i, w, hw, hwz⟩ := mem_iUnion.mp (cover.cover hz) |
| 141 | let x : W := ⟨w, hcoreBall hw⟩ |
| 142 | refine mem_iUnion.mpr ⟨i, x, hw, ?_⟩ |
| 143 | apply Subtype.ext |
| 144 | exact (congrArg j hwz).trans hzy |
| 145 | |
| 146 | end PoincareMT.M47 |