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.VectorField.Pullback |
| 2 | |
| 3 | /-! |
| 4 | # Smooth inverse tangent maps applied to fields along maps |
| 5 | |
| 6 | The bundle-coordinate inverse argument from Mathlib's vector-field |
| 7 | pullback theorem also applies to fields with an independent parameter. |
| 8 | This supplies the gauge pullback regularity needed in Morgan-Tian |
| 9 | Definition 3.36 and Proposition 6.33, pp. 60-61, 120-121. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | -- Tangent fibers and their fixed model spaces share the derivative coordinates. |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set Filter Bundle ContinuousLinearMap |
| 17 | open scoped Manifold ContDiff Topology |
| 18 | |
| 19 | variable {𝕜 E H M E' H' N EP HP P : Type*} [NontriviallyNormedField 𝕜] |
| 20 | [NormedAddCommGroup E] [NormedSpace 𝕜 E] [CompleteSpace E] |
| 21 | [TopologicalSpace H] {I : ModelWithCorners 𝕜 E H} |
| 22 | [TopologicalSpace M] [ChartedSpace H M] [IsManifold I 1 M] |
| 23 | [NormedAddCommGroup E'] [NormedSpace 𝕜 E'] |
| 24 | [TopologicalSpace H'] {J : ModelWithCorners 𝕜 E' H'} |
| 25 | [TopologicalSpace N] [ChartedSpace H' N] [IsManifold J 1 N] |
| 26 | [NormedAddCommGroup EP] [NormedSpace 𝕜 EP] |
| 27 | [TopologicalSpace HP] {L : ModelWithCorners 𝕜 EP HP} |
| 28 | [TopologicalSpace P] [ChartedSpace HP P] |
| 29 | {m n : ℕ∞ω} {f : M → N} {x : M} |
| 30 | |
| 31 | /-- Inverse differentials are smooth in bundle coordinates wherever the |
| 32 | actual differential is invertible; the inverse-map step in the gauge |
| 33 | calculus of Definition 3.36, pp. 60-61. -/ |
| 34 | theorem ContMDiffAt.inverse_mfderiv_const |
| 35 | (hf : ContMDiffAt I J n f x) (hinv : (mfderiv I J f x).IsInvertible) |
| 36 | (hmn : m + 1 ≤ n) : |
| 37 | ContMDiffAt I 𝓘(𝕜, E' →L[𝕜] E) m |
| 38 | (fun y => inCoordinates E' (TangentSpace J : N → Type _) E |
| 39 | (TangentSpace I : M → Type _) (f x) (f y) x y (mfderiv I J f y).inverse) x := by |
| 40 | have hd : ContMDiffAt I 𝓘(𝕜, E →L[𝕜] E') m |
| 41 | (fun y => inCoordinates E (TangentSpace I : M → Type _) E' |
| 42 | (TangentSpace J : N → Type _) x y (f x) (f y) (mfderiv I J f y)) x := |
| 43 | hf.mfderiv_const hmn |
| 44 | have hi : ContMDiffAt I 𝓘(𝕜, E' →L[𝕜] E) m |
| 45 | (ContinuousLinearMap.inverse ∘ (fun y => inCoordinates E |
| 46 | (TangentSpace I : M → Type _) E' (TangentSpace J : N → Type _) |
| 47 | x y (f x) (f y) (mfderiv I J f y))) x := by |
| 48 | apply ContMDiffAt.comp x _ hd |
| 49 | apply ContDiffAt.contMDiffAt |
| 50 | apply IsInvertible.contDiffAt_map_inverse |
| 51 | rw [inCoordinates_eq (FiberBundle.mem_baseSet_trivializationAt' x) |
| 52 | (FiberBundle.mem_baseSet_trivializationAt' (f x))] |
| 53 | exact isInvertible_equiv.comp (hinv.comp isInvertible_equiv) |
| 54 | apply hi.congr_of_eventuallyEq |
| 55 | have hsrc := (trivializationAt E (TangentSpace I : M → Type _) x).open_baseSet.mem_nhds |
| 56 | (FiberBundle.mem_baseSet_trivializationAt' x) |
| 57 | have htgt := hf.continuousAt.preimage_mem_nhds |
| 58 | ((trivializationAt E' (TangentSpace J : N → Type _) (f x)).open_baseSet.mem_nhds |
| 59 | (FiberBundle.mem_baseSet_trivializationAt' (f x))) |
| 60 | filter_upwards [hsrc, htgt] with y hy hfy |
| 61 | simp only [Function.comp_apply] |
| 62 | rw [inCoordinates_eq hfy hy, inCoordinates_eq hy hfy] |
| 63 | simp only [inverse_equiv_comp, inverse_comp_equiv, ContinuousLinearEquiv.symm_symm] |
| 64 | rfl |
| 65 | |
| 66 | /-- Apply the actual inverse tangent map to a smooth field with arbitrary |
| 67 | parameter dependence, within its parameter set; Proposition 6.33, |
| 68 | pp. 120-121. The field need not come from a stationary target section. -/ |
| 69 | theorem ContMDiffWithinAt.inverse_mfderiv_apply |
| 70 | {b : P → M} {Y : ∀ z, TangentSpace J (f (b z))} {S : Set P} {z : P} |
| 71 | (hY : ContMDiffWithinAt L J.tangent m |
| 72 | (fun w => TotalSpace.mk' E' (f (b w)) (Y w)) S z) |
| 73 | (hb : ContMDiffWithinAt L I m b S z) (hf : ContMDiffAt I J n f (b z)) |
| 74 | (hinv : (mfderiv I J f (b z)).IsInvertible) (hmn : m + 1 ≤ n) : |
| 75 | ContMDiffWithinAt L I.tangent m |
| 76 | (fun w => TotalSpace.mk' E (b w) ((mfderiv I J f (b w)).inverse (Y w))) S z := by |
| 77 | have hi := (hf.inverse_mfderiv_const hinv hmn).comp_contMDiffWithinAt z hb |
| 78 | exact hi.clm_apply_of_inCoordinates hY hb |