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.Analysis.Calculus.FDeriv.Extend |
| 2 | import Mathlib.Analysis.Calculus.ContDiff.Defs |
| 3 | |
| 4 | /-! |
| 5 | # Included boundary derivatives of the actual limiting jets |
| 6 | |
| 7 | Interior derivative identities and continuous closure jets give every |
| 8 | within derivative at the terminal boundary. Source: MT Theorem 5.11 |
| 9 | and Proposition 5.14, pp. 89-91; |
| 10 | derivations/terminal-germs-closed-jets.md, Stage A5a. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set Filter |
| 16 | open scoped ContDiff Topology |
| 17 | |
| 18 | namespace PoincareMT.M47 |
| 19 | |
| 20 | /-- Continuous formal jets on a convex closure, with their actual |
| 21 | interior derivative identities, form a smooth Taylor field on that |
| 22 | closure. No ambient derivative outside the closed domain is used. -/ |
| 23 | theorem terminalGerms_closed_taylor_jets |
| 24 | {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 25 | [NormedAddCommGroup F] [NormedSpace ℝ F] |
| 26 | {U : Set E} (hU : IsOpen U) (hconvex : Convex ℝ U) |
| 27 | (f : E → F) (P : E → FormalMultilinearSeries ℝ E F) |
| 28 | (hzero : ∀ x ∈ closure U, (P x 0).curry0 = f x) |
| 29 | (hcontinuous : ∀ m : ℕ, ContinuousOn (fun x => P x m) (closure U)) |
| 30 | (hderiv : ∀ m : ℕ, ∀ x ∈ U, |
| 31 | HasFDerivAt (fun y => P y m) (P x (m + 1)).curryLeft x) : |
| 32 | HasFTaylorSeriesUpToOn ∞ f P (closure U) ∧ ContDiffOn ℝ ∞ f (closure U) := by |
| 33 | have hwithin (m : ℕ) (x : E) (hx : x ∈ closure U) : |
| 34 | HasFDerivWithinAt (fun y => P y m) (P x (m + 1)).curryLeft (closure U) x := by |
| 35 | have hlimit : Tendsto (fun y => fderiv ℝ (fun z => P z m) y) |
| 36 | (𝓝[U] x) (𝓝 (P x (m + 1)).curryLeft) := by |
| 37 | have hc := ((continuousMultilinearCurryLeftEquiv ℝ |
| 38 | (fun _ : Fin (m + 1) => E) F).continuous.tendsto (P x (m + 1))).comp |
| 39 | ((hcontinuous (m + 1) x hx).mono subset_closure) |
| 40 | apply hc.congr' |
| 41 | filter_upwards [self_mem_nhdsWithin] with y hy |
| 42 | exact (hderiv m y hy).fderiv.symm |
| 43 | exact hasFDerivWithinAt_closure_of_tendsto_fderiv |
| 44 | (fun y hy => (hderiv m y hy).differentiableAt.differentiableWithinAt) |
| 45 | hconvex hU (fun y hy => (hcontinuous m y hy).mono subset_closure) hlimit |
| 46 | have hseries : HasFTaylorSeriesUpToOn ∞ f P (closure U) := |
| 47 | ⟨hzero, fun m _ x hx => hwithin m x hx, fun m _ => hcontinuous m⟩ |
| 48 | exact ⟨hseries, hseries.contDiffOn⟩ |
| 49 | |
| 50 | end PoincareMT.M47 |