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.CurveShortening.Ramp.LocalFlow.Periodic.GaussianDeriv |
| 2 | |
| 3 | /-! |
| 4 | # Actual first and second circle derivatives under Gaussian averaging |
| 5 | |
| 6 | The derivatives of C2 periodic data descend to continuous circle functions. |
| 7 | Gaussian averaging retains their actual derivative identities. MT2007 |
| 8 | Claim 19.1, p. 437; contract block 8 and |
| 9 | `2026-09-21-periodic-gaussian-initial-trace.md`, statement 12. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open scoped ContDiff |
| 15 | |
| 16 | namespace PoincareMT.M63 |
| 17 | |
| 18 | variable {L : ℝ} [Fact (0 < L)] |
| 19 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] |
| 20 | |
| 21 | /-- The actual first two derivatives of C2 circle data remain its actual |
| 22 | first two derivatives after Gaussian averaging. MT2007 Claim 19.1, p. 437; |
| 23 | Gaussian trace derivation, statement 12. -/ |
| 24 | theorem exists_periodicGaussian_c2_jets (f : C(AddCircle L, E)) |
| 25 | (hf : ContDiff ℝ 2 (fun x : ℝ => f (x : AddCircle L))) : |
| 26 | ∃ f1 f2 : C(AddCircle L, E), |
| 27 | (∀ x : ℝ, HasDerivAt (fun y : ℝ => f (y : AddCircle L)) (f1 (x : AddCircle L)) x) ∧ |
| 28 | (∀ x : ℝ, HasDerivAt (fun y : ℝ => f1 (y : AddCircle L)) (f2 (x : AddCircle L)) x) ∧ |
| 29 | ∀ t : ℝ, ContDiff ℝ 2 (fun x : ℝ => periodicGaussianHeat t f (x : AddCircle L)) ∧ |
| 30 | (∀ x : ℝ, HasDerivAt (fun y : ℝ => periodicGaussianHeat t f (y : AddCircle L)) |
| 31 | (periodicGaussianHeat t f1 (x : AddCircle L)) x) ∧ |
| 32 | (∀ x : ℝ, HasDerivAt (fun y : ℝ => periodicGaussianHeat t f1 (y : AddCircle L)) |
| 33 | (periodicGaussianHeat t f2 (x : AddCircle L)) x) := by |
| 34 | let u := fun x : ℝ => f (x : AddCircle L) |
| 35 | have hu : Differentiable ℝ u := hf.differentiable (by norm_num) |
| 36 | have hu1 : ContDiff ℝ 1 (deriv u) := hf.deriv' (n := 1) |
| 37 | have hd1 : Differentiable ℝ (deriv u) := hu1.differentiable (by norm_num) |
| 38 | have hp : Function.Periodic u L := by |
| 39 | intro x |
| 40 | simp only [u, AddCircle.coe_add_period] |
| 41 | have hp1 : Function.Periodic (deriv u) L := by |
| 42 | intro x |
| 43 | have h : HasDerivAt (fun y => u (y + L)) (deriv u (x + L)) x := by |
| 44 | simpa only [Function.comp_def, one_smul, id_eq] using |
| 45 | (hu (x + L)).hasDerivAt.scomp x ((hasDerivAt_id x).add_const L) |
| 46 | rw [show (fun y => u (y + L)) = u from funext hp] at h |
| 47 | exact h.unique (hu x).hasDerivAt |
| 48 | have hp2 : Function.Periodic (deriv (deriv u)) L := by |
| 49 | intro x |
| 50 | have h : HasDerivAt (fun y => deriv u (y + L)) (deriv (deriv u) (x + L)) x := by |
| 51 | simpa only [Function.comp_def, one_smul, id_eq] using |
| 52 | (hd1 (x + L)).hasDerivAt.scomp x ((hasDerivAt_id x).add_const L) |
| 53 | rw [show (fun y => deriv u (y + L)) = deriv u from funext hp1] at h |
| 54 | exact h.unique (hd1 x).hasDerivAt |
| 55 | let f1 : C(AddCircle L, E) := ⟨hp1.lift, |
| 56 | (QuotientAddGroup.isQuotientMap_mk (AddSubgroup.zmultiples L)).continuous_iff.mpr |
| 57 | hu1.continuous⟩ |
| 58 | let f2 : C(AddCircle L, E) := ⟨hp2.lift, |
| 59 | (QuotientAddGroup.isQuotientMap_mk (AddSubgroup.zmultiples L)).continuous_iff.mpr |
| 60 | hu1.continuous_deriv_one⟩ |
| 61 | have h1 (x : ℝ) : HasDerivAt (fun y : ℝ => f (y : AddCircle L)) (f1 (x : AddCircle L)) x := |
| 62 | (hu x).hasDerivAt |
| 63 | have h2 (x : ℝ) : HasDerivAt (fun y : ℝ => f1 (y : AddCircle L)) (f2 (x : AddCircle L)) x := |
| 64 | (hd1 x).hasDerivAt |
| 65 | refine ⟨f1, f2, h1, h2, fun t => ?_⟩ |
| 66 | have hG1 := hasDerivAt_periodicGaussianHeat t f f1 h1 |
| 67 | have hG2 := hasDerivAt_periodicGaussianHeat t f1 f2 h2 |
| 68 | have heq1 : deriv (fun x : ℝ => periodicGaussianHeat t f (x : AddCircle L)) = |
| 69 | fun x : ℝ => periodicGaussianHeat t f1 (x : AddCircle L) := |
| 70 | funext (fun x => (hG1 x).deriv) |
| 71 | have heq2 : deriv (fun x : ℝ => periodicGaussianHeat t f1 (x : AddCircle L)) = |
| 72 | fun x : ℝ => periodicGaussianHeat t f2 (x : AddCircle L) := |
| 73 | funext (fun x => (hG2 x).deriv) |
| 74 | refine ⟨?_, hG1, hG2⟩ |
| 75 | rw [show (2 : ℕ∞ω) = 1 + 1 by norm_num, contDiff_succ_iff_deriv] |
| 76 | refine ⟨fun x => (hG1 x).differentiableAt, by norm_num, ?_⟩ |
| 77 | rw [heq1, contDiff_one_iff_deriv] |
| 78 | refine ⟨fun x => (hG2 x).differentiableAt, ?_⟩ |
| 79 | rw [heq2] |
| 80 | exact (periodicGaussianHeat t f2).continuous.comp (AddCircle.continuous_mk' L) |
| 81 | |
| 82 | end PoincareMT.M63 |