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.ReducedGeometry.ReducedLength.Calculus.PathSpaceCalculus |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Calculus.PathPrimitive |
| 3 | import Mathlib.Analysis.Calculus.ImplicitContDiff |
| 4 | |
| 5 | /-! |
| 6 | # A smooth family solving the scaled Picard equation |
| 7 | |
| 8 | The derivative in the path variable at zero elapsed time is the identity. |
| 9 | The Banach implicit-function theorem therefore constructs integral paths |
| 10 | smoothly in the initial point and time scale. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open scoped ContDiff Topology |
| 16 | open Set Filter |
| 17 | |
| 18 | namespace PoincareMT.ReducedLength |
| 19 | |
| 20 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 21 | [FiniteDimensional ℝ E] |
| 22 | |
| 23 | noncomputable def scaledPicardResidual (f : C(E, E)) |
| 24 | (z : (E × ℝ) × C(Set.Icc (-1 : ℝ) 1, E)) : C(Set.Icc (-1 : ℝ) 1, E) := |
| 25 | z.2 - ContinuousMap.const _ z.1.1 - z.1.2 • pathPrimitive (f.comp z.2) |
| 26 | |
| 27 | theorem scaledPicardResidual_smooth (f : C(E, E)) (hf : ContDiff ℝ ∞ f) : |
| 28 | ContDiff ℝ ∞ (scaledPicardResidual f) := by |
| 29 | have hc : ContDiff ℝ ∞ (fun z : (E × ℝ) × C(Set.Icc (-1 : ℝ) 1, E) ↦ |
| 30 | ContinuousMap.const (Set.Icc (-1 : ℝ) 1) z.1.1) := |
| 31 | (ContinuousLinearMap.const (R := ℝ) (M := E) (Set.Icc (-1 : ℝ) 1)).contDiff.comp |
| 32 | (contDiff_fst.comp contDiff_fst) |
| 33 | have hp : ContDiff ℝ ∞ (fun z : (E × ℝ) × C(Set.Icc (-1 : ℝ) 1, E) ↦ |
| 34 | pathPrimitive (f.comp z.2)) := |
| 35 | (pathPrimitive (E := E)).contDiff.comp |
| 36 | ((contDiff_postcomp_smooth (K := Set.Icc (-1 : ℝ) 1) f hf).comp contDiff_snd) |
| 37 | exact (contDiff_snd.sub hc).sub ((contDiff_snd.comp contDiff_fst).smul hp) |
| 38 | |
| 39 | @[simp] theorem scaledPicardResidual_at_zero (f : C(E, E)) (x : E) : |
| 40 | scaledPicardResidual f ((x, 0), ContinuousMap.const _ x) = 0 := by |
| 41 | simp only [scaledPicardResidual, zero_smul, sub_self] |
| 42 | |
| 43 | theorem scaledPicardResidual_partial (f : C(E, E)) (hf : ContDiff ℝ ∞ f) (x : E) : |
| 44 | (fderiv ℝ (scaledPicardResidual f) ((x, 0), ContinuousMap.const _ x)).comp |
| 45 | (ContinuousLinearMap.inr ℝ (E × ℝ) C(Set.Icc (-1 : ℝ) 1, E)) = |
| 46 | ContinuousLinearMap.id ℝ C(Set.Icc (-1 : ℝ) 1, E) := by |
| 47 | have hfull := ((scaledPicardResidual_smooth f hf).differentiable (by simp) |
| 48 | ((x, 0), ContinuousMap.const _ x)).hasFDerivAt |
| 49 | have hcomp := hfull.comp (ContinuousMap.const (Set.Icc (-1 : ℝ) 1) x) |
| 50 | (hasFDerivAt_prodMk_right (x, (0 : ℝ)) (ContinuousMap.const _ x)) |
| 51 | have hrestriction : HasFDerivAt |
| 52 | (fun v : C(Set.Icc (-1 : ℝ) 1, E) ↦ scaledPicardResidual f ((x, 0), v)) |
| 53 | (ContinuousLinearMap.id ℝ C(Set.Icc (-1 : ℝ) 1, E)) (ContinuousMap.const _ x) := by |
| 54 | convert! (hasFDerivAt_id (𝕜 := ℝ) (ContinuousMap.const (Set.Icc (-1 : ℝ) 1) x)).sub_const |
| 55 | (ContinuousMap.const _ x) using 1 |
| 56 | simp only [scaledPicardResidual, zero_smul, sub_zero, id_eq] |
| 57 | exact hcomp.unique hrestriction |
| 58 | |
| 59 | theorem exists_scaledPicard (f : C(E, E)) (hf : ContDiff ℝ ∞ f) (x0 : E) : |
| 60 | ∃ sigma : E × ℝ → C(Set.Icc (-1 : ℝ) 1, E), |
| 61 | sigma (x0, 0) = ContinuousMap.const _ x0 ∧ |
| 62 | ContDiffAt ℝ ∞ sigma (x0, 0) ∧ |
| 63 | ∀ᶠ p in 𝓝 (x0, (0 : ℝ)), |
| 64 | sigma p = ContinuousMap.const _ p.1 + p.2 • pathPrimitive (f.comp (sigma p)) := by |
| 65 | let z0 : (E × ℝ) × C(Set.Icc (-1 : ℝ) 1, E) := |
| 66 | ((x0, 0), ContinuousMap.const _ x0) |
| 67 | have hc : ContDiffAt ℝ ∞ (scaledPicardResidual f) z0 := |
| 68 | (scaledPicardResidual_smooth f hf).contDiffAt |
| 69 | have hi : ((fderiv ℝ (scaledPicardResidual f) z0).comp |
| 70 | (ContinuousLinearMap.inr ℝ (E × ℝ) C(Set.Icc (-1 : ℝ) 1, E))).IsInvertible := by |
| 71 | rw [scaledPicardResidual_partial f hf x0] |
| 72 | exact ⟨ContinuousLinearEquiv.refl ℝ _, rfl⟩ |
| 73 | have hn : (∞ : ℕ∞ω) ≠ 0 := by simp |
| 74 | refine ⟨hc.implicitFunction hn hi, hc.implicitFunction_apply_self hn hi, |
| 75 | hc.contDiffAt_implicitFunction hn hi, ?_⟩ |
| 76 | filter_upwards [hc.eventually_apply_implicitFunction hn hi] with p hp |
| 77 | rw [scaledPicardResidual_at_zero] at hp |
| 78 | exact sub_eq_zero.mp (by simpa only [scaledPicardResidual, sub_sub] using hp) |
| 79 | |
| 80 | end PoincareMT.ReducedLength |