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 Mathlib.Geometry.Manifold.ContMDiffMFDeriv |
| 2 | |
| 3 | /-! Differential of an open-submanifold inclusion. Adapted from LeeRiemannian, |
| 4 | `LeeLib/Geometry/OpenSubmanifold.lean`, revision f47f76169b0f914d07661d052117fba97bd9852a. -/ |
| 5 | |
| 6 | set_option backward.isDefEq.respectTransparency false |
| 7 | |
| 8 | open Set Function Manifold Metric TopologicalSpace |
| 9 | open scoped Manifold Topology ContDiff |
| 10 | |
| 11 | namespace Poincare.Geometry.Manifold.RegularLevel |
| 12 | |
| 13 | noncomputable section |
| 14 | |
| 15 | /-! ## The inclusion of an open submanifold of an arbitrary manifold -/ |
| 16 | |
| 17 | section General |
| 18 | |
| 19 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 20 | {H : Type*} [TopologicalSpace H] {I : ModelWithCorners ℝ E H} |
| 21 | {M : Type*} [TopologicalSpace M] [ChartedSpace H M] |
| 22 | |
| 23 | /-- **The chart representation of an open-submanifold inclusion is the identity** |
| 24 | on the chart's target. |
| 25 | |
| 26 | `U`'s chart at `x` is `M`'s chart at `↑x` restricted, so |
| 27 | `writtenInExtChartAt I I x ι` is definitionally `extChartAt I x ∘ (extChartAt I x).symm`; |
| 28 | the claim is then just `PartialEquiv.right_inv`. The filter is `𝓝[range I]`, not |
| 29 | `𝓝`: off `range I` the chart's inverse is not a right inverse, so the unrestricted |
| 30 | statement is false in general (it holds for boundaryless `I`, where `range I = univ`). -/ |
| 31 | theorem writtenInExtChartAt_opens_subtypeVal (U : Opens M) (x : U) : |
| 32 | writtenInExtChartAt I I x (fun y : U => (y : M)) |
| 33 | =ᶠ[𝓝[range I] (extChartAt I x x)] id := by |
| 34 | filter_upwards [extChartAt_target_mem_nhdsWithin (I := I) x] with z hz |
| 35 | exact (extChartAt I x).right_inv hz |
| 36 | |
| 37 | /-- **The inclusion of an open submanifold has the identity as its differential.** |
| 38 | |
| 39 | Both `T_x U` and `T_{↑x} M` are `E`, and `U`'s charts are `M`'s charts restricted, |
| 40 | so the chart representation of `ι` is the identity where it is defined. -/ |
| 41 | theorem hasMFDerivAt_opens_subtypeVal (U : Opens M) (x : U) : |
| 42 | HasMFDerivAt I I (fun y : U => (y : M)) x (ContinuousLinearMap.id ℝ E) := by |
| 43 | refine ⟨continuous_subtype_val.continuousAt, ?_⟩ |
| 44 | refine (hasFDerivWithinAt_id _ _).congr_of_eventuallyEq |
| 45 | (writtenInExtChartAt_opens_subtypeVal U x) ?_ |
| 46 | exact (extChartAt I x).right_inv (mem_extChartAt_target x) |
| 47 | |
| 48 | /-- `dι_x = id` for the inclusion `ι : U ↪ M` of an open submanifold. -/ |
| 49 | theorem mfderiv_opens_subtypeVal (U : Opens M) (x : U) : |
| 50 | mfderiv I I (fun y : U => (y : M)) x = ContinuousLinearMap.id ℝ E := |
| 51 | (hasMFDerivAt_opens_subtypeVal U x).mfderiv |
| 52 | |
| 53 | /-- `dι_x v = v`: the pointwise form of `mfderiv_opens_subtypeVal`, which is the |
| 54 | shape in which the computation is actually used. -/ |
| 55 | @[simp] theorem mfderiv_opens_subtypeVal_apply (U : Opens M) (x : U) (v : TangentSpace I x) : |
| 56 | (mfderiv I I (fun y : U => (y : M)) x) v = (show E from v) := by |
| 57 | rw [mfderiv_opens_subtypeVal]; rfl |
| 58 | |
| 59 | /-- The inclusion of an open submanifold is an immersion — immediate from |
| 60 | `mfderiv_opens_subtypeVal`, and the hypothesis `pullbackMetric` needs. -/ |
| 61 | theorem injective_mfderiv_opens_subtypeVal (U : Opens M) (x : U) : |
| 62 | Function.Injective (mfderiv I I (fun y : U => (y : M)) x) := by |
| 63 | intro v w h |
| 64 | simpa using h |
| 65 | |
| 66 | variable {E' : Type*} [NormedAddCommGroup E'] [NormedSpace ℝ E'] |
| 67 | {H' : Type*} [TopologicalSpace H'] {I' : ModelWithCorners ℝ E' H'} |
| 68 | {M' : Type*} [TopologicalSpace M'] [ChartedSpace H' M'] |
| 69 | |
| 70 | /-- **Restricting a map to an open submanifold does not change its differential.** |
| 71 | |
| 72 | `d(F ∘ ι)_x = dF_{↑x} ∘ dι_x = dF_{↑x}`, since `dι_x = id`. This is the step that |
| 73 | lets a statement about `F` on an open subset be read off from the statement about |
| 74 | `F` on the whole manifold — in particular it is what makes `c` a *regular value* |
| 75 | of `f|_ℛ` on the regular set `ℛ` of `f`, by construction rather than by |
| 76 | hypothesis. -/ |
| 77 | theorem mfderiv_opens_restrict (U : Opens M) (F : M → M') {x : U} |
| 78 | (hF : MDifferentiableAt I I' F ↑x) : |
| 79 | mfderiv I I' (fun y : U => F ↑y) x = mfderiv I I' F ↑x := by |
| 80 | have hcomp : mfderiv I I' ((fun z : M => F z) ∘ (fun y : U => (y : M))) x |
| 81 | = (mfderiv I I' F ↑x).comp (mfderiv I I (fun y : U => (y : M)) x) := |
| 82 | mfderiv_comp x hF (hasMFDerivAt_opens_subtypeVal U x).mdifferentiableAt |
| 83 | rw [Function.comp_def] at hcomp |
| 84 | rw [hcomp, mfderiv_opens_subtypeVal] |
| 85 | ext v |
| 86 | rfl |
| 87 | |
| 88 | end General |
| 89 | |
| 90 | end |
| 91 | |
| 92 | end Poincare.Geometry.Manifold.RegularLevel |