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.Generalized.ReducedGeometry.SourceNames.Realization |
| 2 | import PoincareLib.Geometry.Spacetime.Realization.Box.Spatial.Calculus |
| 3 | import Mathlib.Geometry.Manifold.MFDeriv.SpecificFunctions |
| 4 | |
| 5 | /-! |
| 6 | # Actual charts of open Euclidean subsets |
| 7 | |
| 8 | The spatial coordinate argument in Morgan-Tian Definition 3.38 and |
| 9 | Lemma 6.4, pp. 61, 107-108, retains the given open-subset chart. |
| 10 | Its source, target, values and inverse differential are identified here. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | -- The chart and inverse-chart tangent fibers use the ambient vector model. |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set Filter |
| 18 | open scoped Manifold ContDiff Topology |
| 19 | |
| 20 | namespace TopologicalSpace.Opens |
| 21 | |
| 22 | variable {E : Type*} [NormedAddCommGroup E] (U : Opens E) |
| 23 | |
| 24 | /-- Every selected chart of an open Euclidean subset is its actual |
| 25 | inclusion, the spatial coordinates in Definition 3.38, p. 61. -/ |
| 26 | theorem chartAt_apply_eq_val (x y : U) : chartAt E x y = y.val := rfl |
| 27 | |
| 28 | /-- An open Euclidean subset's selected charts have the whole subtype |
| 29 | as source, Definition 3.38 and Lemma 6.4, pp. 61, 107-108. -/ |
| 30 | theorem chartAt_source_eq_univ (x : U) : (chartAt E x).source = univ := by |
| 31 | simp only [chartAt_eq, chartAt_self_eq, OpenPartialHomeomorph.subtypeRestr_source, |
| 32 | OpenPartialHomeomorph.refl_source, preimage_univ] |
| 33 | |
| 34 | /-- The selected chart inverse recovers each actual included spatial |
| 35 | point, Definition 3.38 and Lemma 6.4, pp. 61, 107-108. -/ |
| 36 | theorem chartAt_symm_apply_val (x y : U) : (chartAt E x).symm y.val = y := by |
| 37 | rw [← U.chartAt_apply_eq_val x y] |
| 38 | exact (chartAt E x).left_inv (by rw [U.chartAt_source_eq_univ]; exact mem_univ y) |
| 39 | |
| 40 | /-- The chart target is exactly the original open spatial subset, |
| 41 | Definition 3.38 and Lemma 6.4, pp. 61, 107-108. -/ |
| 42 | theorem chartAt_target_eq (x : U) : (chartAt E x).target = (U : Set E) := by |
| 43 | ext z |
| 44 | constructor |
| 45 | · intro hz |
| 46 | have hval := (chartAt E x).right_inv hz |
| 47 | rw [U.chartAt_apply_eq_val] at hval |
| 48 | exact hval ▸ ((chartAt E x).symm z).property |
| 49 | · intro hz |
| 50 | have hmem : (⟨z, hz⟩ : U) ∈ (chartAt E x).source := by |
| 51 | rw [U.chartAt_source_eq_univ] |
| 52 | exact mem_univ _ |
| 53 | exact (chartAt E x).map_source hmem |
| 54 | |
| 55 | variable [NormedSpace ℝ E] |
| 56 | |
| 57 | /-- The inverse chart has the actual identity differential on its |
| 58 | spatial target, so it does not alter the metric coefficients in the |
| 59 | coordinate calculation of Lemma 6.4, pp. 107-108. -/ |
| 60 | theorem mfderiv_chartAt_symm_val (x y : U) : |
| 61 | mfderiv (𝓘(ℝ, E)) (𝓘(ℝ, E)) (chartAt E x).symm y.val = ContinuousLinearMap.id ℝ E := by |
| 62 | have hy : y.val ∈ (chartAt E x).target := by |
| 63 | rw [U.chartAt_target_eq] |
| 64 | exact y.property |
| 65 | have hs : MDifferentiableAt (𝓘(ℝ, E)) (𝓘(ℝ, E)) (chartAt E x).symm y.val := |
| 66 | ((contMDiffOn_chart_symm (n := ∞) y.val hy).contMDiffAt |
| 67 | ((chartAt E x).open_target.mem_nhds hy)).mdifferentiableAt (by simp) |
| 68 | have hi : MDifferentiableAt (𝓘(ℝ, E)) (𝓘(ℝ, E)) (Subtype.val : U → E) |
| 69 | ((chartAt E x).symm y.val) := |
| 70 | contMDiff_subtype_val.mdifferentiableAt (n := ∞) (by simp) |
| 71 | have heq : (Subtype.val ∘ (chartAt E x).symm) =ᶠ[𝓝 y.val] (id : E → E) := by |
| 72 | filter_upwards [(chartAt E x).open_target.mem_nhds hy] with z hz |
| 73 | exact (chartAt E x).right_inv hz |
| 74 | have hd := heq.mfderiv_eq (I := 𝓘(ℝ, E)) (I' := 𝓘(ℝ, E)) |
| 75 | rw [mfderiv_comp y.val hi hs, PoincareMT.Proofs.M11.mfderiv_openSubtype_val, |
| 76 | mfderiv_id] at hd |
| 77 | exact hd |
| 78 | |
| 79 | end TopologicalSpace.Opens |