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.Calculus.Differential.RectanglePartialTangent |
| 2 | |
| 3 | /-! |
| 4 | # Actual first partial tangent on an open-by-closed rectangle |
| 5 | |
| 6 | The parameter-field regularity in Morgan-Tian Lemmas 6.4 and 6.18, |
| 7 | pp. 107-108, 113-114. Openness of the first factor identifies its |
| 8 | within derivative with the actual unrestricted derivative. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | open scoped Manifold ContDiff Bundle |
| 14 | |
| 15 | variable {𝕜 E F E' H M : Type*} [NontriviallyNormedField 𝕜] |
| 16 | [NormedAddCommGroup E] [NormedSpace 𝕜 E] |
| 17 | [NormedAddCommGroup F] [NormedSpace 𝕜 F] |
| 18 | [NormedAddCommGroup E'] [NormedSpace 𝕜 E'] |
| 19 | [TopologicalSpace H] {I : ModelWithCorners 𝕜 E' H} |
| 20 | [TopologicalSpace M] [ChartedSpace H M] |
| 21 | {U : Set E} {C : Set F} {α : E × F → M} {m k : ℕ∞ω} |
| 22 | |
| 23 | /-- The actual first partial tangent is smooth on an open-by-unique- |
| 24 | derivative rectangle, including boundary points of the second factor, |
| 25 | as required in Morgan-Tian Lemma 6.18, pp. 113-114. -/ |
| 26 | theorem ContMDiffOn.contMDiffOn_partialTangent_fst_prod |
| 27 | [IsManifold I 1 M] |
| 28 | (hα : ContMDiffOn ((𝓘(𝕜, E)).prod (𝓘(𝕜, F))) I m α (U ×ˢ C)) |
| 29 | (hU : IsOpen U) (hC : UniqueDiffOn 𝕜 C) (v : E) (hkm : k + 1 ≤ m) : |
| 30 | ContMDiffOn ((𝓘(𝕜, E)).prod (𝓘(𝕜, F))) I.tangent k |
| 31 | (fun z => Bundle.TotalSpace.mk' E' (α z) |
| 32 | (mfderiv (𝓘(𝕜, E)) I (fun r => α (r, z.2)) z.1 v)) (U ×ˢ C) := by |
| 33 | apply (hα.contMDiffOn_partialTangentWithin_fst_prod hU.uniqueDiffOn hC v hkm).congr |
| 34 | intro z hz |
| 35 | rw [mfderivWithin_of_mem_nhds (hU.mem_nhds hz.1)] |