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.StandardCap.Existence.Analysis.Coordinates.OpenDomainCoordinates |
| 2 | |
| 3 | /-! |
| 4 | # Maps between canonical open domains |
| 5 | |
| 6 | A total inverse chart turns an ambient map into a map between open |
| 7 | subtypes. At points whose ambient images belong to the target, its value, |
| 8 | smoothness and differential are the actual ambient ones. Values outside |
| 9 | that valid locus are not used. These adapters serve the overlap argument |
| 10 | in Morgan-Tian Section 12.5, pp. 309-319. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff |
| 18 | |
| 19 | variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] |
| 20 | {E F : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] |
| 21 | [NormedAddCommGroup F] [NormedSpace 𝕜 F] |
| 22 | {U : Set E} {V : Set F} (hU : IsOpen U) (hV : IsOpen V) [Nonempty U] [Nonempty V] |
| 23 | |
| 24 | omit [NormedAddCommGroup E] [NormedSpace 𝕜 E] [Nonempty U] in |
| 25 | /-- The lifted map has its true ambient value wherever that value is in |
| 26 | the open target (Section 12.5, pp. 309-319). -/ |
| 27 | theorem canonicalOpen_map_coe (f : E → F) : |
| 28 | letI := hV.isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 29 | ∀ (p : V) (x : U), f x ∈ V → |
| 30 | (((extChartAt 𝓘(𝕜, F) p).symm (f x) : V) : F) = f x := by |
| 31 | let := hV.isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 32 | intro p x hx |
| 33 | simpa only [extChartAt_coe_symm, modelWithCornersSelf_coe_symm, |
| 34 | Function.comp_apply, id_eq] using canonicalOpen_chart_coe_symm hV p (f x) hx |
| 35 | |
| 36 | /-- Smooth ambient maps induce smooth maps between canonical open subtypes |
| 37 | at every point in the valid target locus (Section 12.5, pp. 309-319). -/ |
| 38 | theorem canonicalOpen_map_contMDiffAt {f : E → F} {x : U} |
| 39 | (hf : ContMDiffAt 𝓘(𝕜, E) 𝓘(𝕜, F) ∞ f (x : E)) (hx : f x ∈ V) : |
| 40 | letI := hU.isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 41 | letI := hV.isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 42 | letI := hU.isOpenEmbedding_subtypeVal.isManifold_singleton (I := 𝓘(𝕜, E)) (n := ∞) |
| 43 | letI := hV.isOpenEmbedding_subtypeVal.isManifold_singleton (I := 𝓘(𝕜, F)) (n := ∞) |
| 44 | ∀ p : V, ContMDiffAt 𝓘(𝕜, E) 𝓘(𝕜, F) ∞ |
| 45 | (fun y : U => (extChartAt 𝓘(𝕜, F) p).symm (f y)) x := by |
| 46 | let := hU.isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 47 | let := hV.isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 48 | let := hU.isOpenEmbedding_subtypeVal.isManifold_singleton (I := 𝓘(𝕜, E)) (n := ∞) |
| 49 | let := hV.isOpenEmbedding_subtypeVal.isManifold_singleton (I := 𝓘(𝕜, F)) (n := ∞) |
| 50 | intro p |
| 51 | have hi : ContMDiffAt 𝓘(𝕜, E) 𝓘(𝕜, E) ∞ (Subtype.val : U → E) x := |
| 52 | (contMDiff_isOpenEmbedding (I := 𝓘(𝕜, E)) (n := ∞) |
| 53 | hU.isOpenEmbedding_subtypeVal).contMDiffAt |
| 54 | exact (canonicalOpen_contMDiffAt_symm hV p (f x) hx).comp x (hf.comp x hi) |
| 55 | |
| 56 | /-- The lifted map has the actual ambient differential on its valid locus |
| 57 | (Section 12.5, pp. 309-319). -/ |
| 58 | theorem canonicalOpen_map_mfderiv {f : E → F} {x : U} |
| 59 | (hf : MDifferentiableAt 𝓘(𝕜, E) 𝓘(𝕜, F) f (x : E)) (hx : f x ∈ V) : |
| 60 | letI := hU.isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 61 | letI := hV.isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 62 | letI := hU.isOpenEmbedding_subtypeVal.isManifold_singleton (I := 𝓘(𝕜, E)) (n := ∞) |
| 63 | letI := hV.isOpenEmbedding_subtypeVal.isManifold_singleton (I := 𝓘(𝕜, F)) (n := ∞) |
| 64 | ∀ p : V, mfderiv 𝓘(𝕜, E) 𝓘(𝕜, F) |
| 65 | (fun y : U => (extChartAt 𝓘(𝕜, F) p).symm (f y)) x = |
| 66 | mfderiv 𝓘(𝕜, E) 𝓘(𝕜, F) f (x : E) := by |
| 67 | let := hU.isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 68 | let := hV.isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 69 | let := hU.isOpenEmbedding_subtypeVal.isManifold_singleton (I := 𝓘(𝕜, E)) (n := ∞) |
| 70 | let := hV.isOpenEmbedding_subtypeVal.isManifold_singleton (I := 𝓘(𝕜, F)) (n := ∞) |
| 71 | intro p |
| 72 | have hi : MDifferentiableAt 𝓘(𝕜, E) 𝓘(𝕜, E) (Subtype.val : U → E) x := |
| 73 | (contMDiff_isOpenEmbedding (I := 𝓘(𝕜, E)) (n := ∞) |
| 74 | hU.isOpenEmbedding_subtypeVal).mdifferentiable (by simp) x |
| 75 | have hr := (canonicalOpen_contMDiffAt_symm (𝕜 := 𝕜) hV p (f x) hx).mdifferentiableAt |
| 76 | (by simp) |
| 77 | have hh := mfderiv_comp x hr (hf.comp x hi) |
| 78 | erw [canonicalOpen_mfderiv_symm (𝕜 := 𝕜) hV p (f x) hx, |
| 79 | canonicalOpen_mfderiv_restrict hU 𝓘(𝕜, F) hf] at hh |
| 80 | apply ContinuousLinearMap.ext |
| 81 | intro v |
| 82 | exact congrArg (fun L => L v) hh |