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.ContDiff.Comp |
| 2 | |
| 3 | /-! |
| 4 | # Spatial jets on an included time domain |
| 5 | |
| 6 | Only the spatial variable is differentiated in this induction. The |
| 7 | time set remains arbitrary and may contain its terminal endpoint. |
| 8 | Source: MT Proposition 5.14, pp. 90-91; |
| 9 | derivations/terminal-germs-closed-jets.md, Stage A5f. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set |
| 15 | open scoped ContDiff |
| 16 | |
| 17 | namespace PoincareMT.M47 |
| 18 | |
| 19 | /-- Joint within smoothness gives smooth actual spatial jets, without |
| 20 | requiring the time domain to be open. -/ |
| 21 | theorem terminalGerms_contDiffOn_spatial_jets |
| 22 | {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 23 | [NormedAddCommGroup F] [NormedSpace ℝ F] |
| 24 | {J : Set ℝ} {U : Set E} (hU : IsOpen U) |
| 25 | {f : ℝ × E → F} (hf : ContDiffOn ℝ ∞ f (J ×ˢ U)) (m : ℕ) : |
| 26 | ContDiffOn ℝ ∞ |
| 27 | (fun p : ℝ × E => iteratedFDeriv ℝ m (fun y => f (p.1, y)) p.2) (J ×ˢ U) := by |
| 28 | induction m with |
| 29 | | zero => |
| 30 | exact (continuousMultilinearCurryFin0 ℝ E F).symm.contDiff.comp_contDiffOn hf |
| 31 | | succ m ih => |
| 32 | have hpartial : ContDiffOn ℝ ∞ |
| 33 | (fun p : ℝ × E => fderivWithin ℝ |
| 34 | (fun y => iteratedFDeriv ℝ m (fun z => f (p.1, z)) y) U p.2) (J ×ˢ U) := by |
| 35 | intro p hp |
| 36 | have hmap : ContDiff ℝ ∞ |
| 37 | (fun q : (ℝ × E) × E => (q.1.1, q.2)) := |
| 38 | (contDiff_fst.fst).prodMk contDiff_snd |
| 39 | have hc := (ih p hp).comp (p, p.2) hmap.contDiffWithinAt |
| 40 | (show MapsTo (fun q : (ℝ × E) × E => (q.1.1, q.2)) |
| 41 | ((J ×ˢ U) ×ˢ U) (J ×ˢ U) from fun q hq => ⟨hq.1.1, hq.2⟩) |
| 42 | exact ContDiffWithinAt.fderivWithin |
| 43 | (f := fun (q : ℝ × E) y => iteratedFDeriv ℝ m (fun z => f (q.1, z)) y) |
| 44 | (g := Prod.snd) hc contDiffWithinAt_snd hU.uniqueDiffOn (by simp) hp |
| 45 | (fun q hq => hq.2) |
| 46 | have hnext := (continuousMultilinearCurryLeftEquiv ℝ |
| 47 | (fun _ : Fin (m + 1) => E) F).symm.contDiff.comp_contDiffOn hpartial |
| 48 | apply hnext.congr |
| 49 | intro p hp |
| 50 | change iteratedFDeriv ℝ (m + 1) (fun z => f (p.1, z)) p.2 = |
| 51 | (continuousMultilinearCurryLeftEquiv ℝ (fun _ : Fin (m + 1) => E) F).symm |
| 52 | (fderivWithin ℝ (iteratedFDeriv ℝ m (fun z => f (p.1, z))) U p.2) |
| 53 | rw [fderivWithin_of_mem_nhds (hU.mem_nhds hp.2)] |
| 54 | exact congrFun iteratedFDeriv_succ_eq_comp_left p.2 |
| 55 | |
| 56 | end PoincareMT.M47 |