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.TerminalSourcePhysicalComponent |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Terminal.Germs.TerminalGermsOpenCharts |
| 3 | |
| 4 | /-! |
| 5 | # Original physical chart maps into their actual base component |
| 6 | |
| 7 | Finite base-ball capture restricts only the codomain of the same map. |
| 8 | The literal inclusion square retains its differential and both metric |
| 9 | slots; the actual component metric retains every distance. |
| 10 | MT Theorem 5.11; terminal-source-physical-component.md, G9b. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff Bundle ENNReal Topology |
| 18 | |
| 19 | universe u v |
| 20 | |
| 21 | namespace PoincareMT.M47 |
| 22 | |
| 23 | local notation "E" => EuclideanSpace ℝ (Fin 3) |
| 24 | |
| 25 | variable {M : Type u} {N : Type v} [TopologicalSpace M] [TopologicalSpace N] |
| 26 | [ChartedSpace E M] [ChartedSpace E N] |
| 27 | [IsManifold (𝓡 3) ∞ N] [T3Space N] |
| 28 | |
| 29 | /-- The given physical map, with only its codomain restricted. -/ |
| 30 | def terminalSourceComponentMap (g : RiemannianMetric 3 N) (p : N) |
| 31 | (f : M → N) {B : ℝ} (hball : ∀ x, f x ∈ g.ball p B) : |
| 32 | M → Poincare.connectedComponentOpens E p := |
| 33 | fun x => ⟨f x, RiemannianMetric.mem_of_edist_lt_top |
| 34 | (U := Poincare.connectedComponentOpens E p) isClosed_connectedComponent g |
| 35 | mem_connectedComponent ((hball x).trans_le le_top)⟩ |
| 36 | |
| 37 | omit [T3Space N] in |
| 38 | /-- The literal restriction retains the original open embedding and |
| 39 | local diffeomorphism, with no new chart or source choice. -/ |
| 40 | theorem terminalSourceComponentMap_geometry |
| 41 | (g : RiemannianMetric 3 N) (p : N) (f : M → N) {B : ℝ} |
| 42 | (hball : ∀ x, f x ∈ g.ball p B) (hopen : Topology.IsOpenEmbedding f) |
| 43 | (hsmooth : IsLocalDiffeomorph (𝓡 3) (𝓡 3) ∞ f) : |
| 44 | Topology.IsOpenEmbedding (terminalSourceComponentMap g p f hball) ∧ |
| 45 | IsLocalDiffeomorph (𝓡 3) (𝓡 3) ∞ (terminalSourceComponentMap g p f hball) := by |
| 46 | let C := Poincare.connectedComponentOpens E p |
| 47 | refine ⟨?_, ?_⟩ |
| 48 | · exact Topology.IsOpenEmbedding.of_comp _ C.isOpen.isOpenEmbedding_subtypeVal hopen |
| 49 | · exact terminalGerms_open_codomain_localDiffeomorph C hsmooth |
| 50 | |
| 51 | omit [T3Space N] in |
| 52 | /-- The differentiated actual inclusion square preserves both physical |
| 53 | metric slots on every point of the original chart domain. -/ |
| 54 | theorem terminalSourceComponentMap_metric |
| 55 | (g : RiemannianMetric 3 N) (p : N) (f : M → N) {B : ℝ} |
| 56 | (hball : ∀ x, f x ∈ g.ball p B) |
| 57 | (hsmooth : IsLocalDiffeomorph (𝓡 3) (𝓡 3) ∞ f) |
| 58 | (x : M) (v w : TangentSpace (𝓡 3) x) : |
| 59 | let fC := terminalSourceComponentMap g p f hball |
| 60 | (g.connectedComponentMetric p).inner (fC x) |
| 61 | (mfderiv (𝓡 3) (𝓡 3) fC x v) (mfderiv (𝓡 3) (𝓡 3) fC x w) = |
| 62 | g.inner (f x) (mfderiv (𝓡 3) (𝓡 3) f x v) (mfderiv (𝓡 3) (𝓡 3) f x w) := by |
| 63 | let C := Poincare.connectedComponentOpens E p |
| 64 | let fC := terminalSourceComponentMap g p f hball |
| 65 | have hfC : IsLocalDiffeomorph (𝓡 3) (𝓡 3) ∞ fC := |
| 66 | terminalGerms_open_codomain_localDiffeomorph C hsmooth |
| 67 | have hchain := mfderiv_comp x |
| 68 | ((Poincare.isLocalDiffeomorph_opensSubtypeVal (𝓡 3) C).mdifferentiable (by simp) (fC x)) |
| 69 | (hfC.mdifferentiable (by simp) x) |
| 70 | change mfderiv (𝓡 3) (𝓡 3) f x = |
| 71 | (mfderiv (𝓡 3) (𝓡 3) (Subtype.val : C → N) (fC x)).comp |
| 72 | (mfderiv (𝓡 3) (𝓡 3) fC x) at hchain |
| 73 | change g.inner (f x) |
| 74 | (mfderiv (𝓡 3) (𝓡 3) (Subtype.val : C → N) (fC x) |
| 75 | (mfderiv (𝓡 3) (𝓡 3) fC x v)) |
| 76 | (mfderiv (𝓡 3) (𝓡 3) (Subtype.val : C → N) (fC x) |
| 77 | (mfderiv (𝓡 3) (𝓡 3) fC x w)) = _ |
| 78 | exact congrArg₂ (fun a b : E => g.inner (f x) a b) |
| 79 | (congrArg (fun A => A v) hchain).symm (congrArg (fun A => A w) hchain).symm |
| 80 | |
| 81 | omit [TopologicalSpace M] [ChartedSpace E M] in |
| 82 | /-- Original chart distances are exactly unchanged by the actual |
| 83 | component restriction and its finite metric-space structure. -/ |
| 84 | theorem terminalSourceComponentMap_distances |
| 85 | (g : RiemannianMetric 3 N) (p : N) (f : M → N) {B : ℝ} |
| 86 | (hball : ∀ x, f x ∈ g.ball p B) : |
| 87 | letI := terminalSourceComponentMetricSpace g p |
| 88 | ∀ x y, edist (terminalSourceComponentMap g p f hball x) |
| 89 | (terminalSourceComponentMap g p f hball y) = g.edist (f x) (f y) ∧ |
| 90 | dist (terminalSourceComponentMap g p f hball x) |
| 91 | (terminalSourceComponentMap g p f hball y) = (g.edist (f x) (f y)).toReal := by |
| 92 | let : MetricSpace (Poincare.connectedComponentOpens E p) := terminalSourceComponentMetricSpace g p |
| 93 | intro x y |
| 94 | exact terminalSourceComponent_distances g p _ _ |
| 95 | |
| 96 | end PoincareMT.M47 |