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.Curvature.Calculus |
| 2 | import PoincareLib.Geometry.RicciFlow.Harnack.Noncompact.DirectionEvaluation |
| 3 | import PoincareLib.Geometry.RicciFlow.Harnack.Matrix.Positivity.StrictContact |
| 4 | |
| 5 | /-! # Ordinary time derivatives on Hamilton frame parameters -/ |
| 6 | |
| 7 | set_option autoImplicit false |
| 8 | set_option backward.isDefEq.respectTransparency false |
| 9 | |
| 10 | open Set |
| 11 | open scoped Manifold ContDiff Bundle BigOperators Topology |
| 12 | |
| 13 | universe u |
| 14 | |
| 15 | namespace Poincare.RicciFlow.Harnack |
| 16 | |
| 17 | open PoincareMT Poincare.VectorBundle |
| 18 | |
| 19 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 20 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 21 | {J : Set ℝ} |
| 22 | |
| 23 | /-- Fixed frame parameters give an ordinary differentiable time curve of |
| 24 | perturbed quadratics at every positive elapsed interior time. -/ |
| 25 | lemma differentiableAt_perturbedHamiltonDirectionQuadratic |
| 26 | (hC : RicciFlowCurvatureCalculus.{u}) (F : RicciFlow n M J) (T₀ : ℝ) |
| 27 | {t : ℝ} (ht : t ∈ interior J) (hτ : t - T₀ ≠ 0) |
| 28 | (q : HamiltonDirection n M) {φ : ℝ × M → ℝ} {ψ : ℝ → ℝ} |
| 29 | (hφ : DifferentiableAt ℝ (fun s => φ (s, q.1.val.1)) t) |
| 30 | (hψ : DifferentiableAt ℝ ψ t) : |
| 31 | DifferentiableAt ℝ (fun s => perturbedHamiltonDirectionQuadratic F T₀ φ ψ s q) t := by |
| 32 | let x := q.1.val.1 |
| 33 | let e := FiberFamily.vector q.1 |
| 34 | let U := fun a b => q.2 (Sum.inl (a, b)) |
| 35 | let W := fun a => q.2 (Sum.inr a) |
| 36 | have hg (a b : Fin n) : DifferentiableAt ℝ |
| 37 | (fun s => (F.metric s).inner x (e a) (e b)) t := |
| 38 | ((F.equation t (interior_subset ht) x (e a) (e b)).hasDerivAt |
| 39 | (mem_interior_iff_mem_nhds.mp ht)).differentiableAt |
| 40 | have hi (a b c d : Fin n) : DifferentiableAt ℝ |
| 41 | (fun s => metricTwoFormIdentity (F.metric s) x ![e a, e b, e c, e d]) t := |
| 42 | (((hg a c).mul (hg b d)).sub ((hg a d).mul (hg b c))).div_const 2 |
| 43 | have hm := DifferentiableAt.fun_sum (u := Finset.univ) fun a _ => |
| 44 | DifferentiableAt.fun_sum (u := Finset.univ) fun b _ => |
| 45 | ((differentiableAt_hamiltonM hC F T₀ ht hτ x (e a) (e b)).mul_const (W a)).mul_const (W b) |
| 46 | have hp := DifferentiableAt.fun_sum (u := Finset.univ) fun a _ => |
| 47 | DifferentiableAt.fun_sum (u := Finset.univ) fun b _ => |
| 48 | DifferentiableAt.fun_sum (u := Finset.univ) fun c _ => |
| 49 | (((hasDerivAt_hamiltonP_evolution hC F ht x (e a) (e b) (e c)).differentiableAt.mul_const |
| 50 | (U a b)).mul_const (W c)) |
| 51 | have hr := DifferentiableAt.fun_sum (u := Finset.univ) fun a _ => |
| 52 | DifferentiableAt.fun_sum (u := Finset.univ) fun b _ => |
| 53 | DifferentiableAt.fun_sum (u := Finset.univ) fun c _ => |
| 54 | DifferentiableAt.fun_sum (u := Finset.univ) fun d _ => |
| 55 | ((((hC.curvature_evolution n M J F t (interior_subset ht) x |
| 56 | (e a) (e b) (e c) (e d)).hasDerivAt |
| 57 | (mem_interior_iff_mem_nhds.mp ht)).differentiableAt.mul_const (U a b)).mul_const (U c d)) |
| 58 | have hgs := DifferentiableAt.fun_sum (u := Finset.univ) fun a _ => |
| 59 | DifferentiableAt.fun_sum (u := Finset.univ) fun b _ => |
| 60 | ((hg a b).mul_const (W a)).mul_const (W b) |
| 61 | have his := DifferentiableAt.fun_sum (u := Finset.univ) fun a _ => |
| 62 | DifferentiableAt.fun_sum (u := Finset.univ) fun b _ => |
| 63 | DifferentiableAt.fun_sum (u := Finset.univ) fun c _ => |
| 64 | DifferentiableAt.fun_sum (u := Finset.univ) fun d _ => |
| 65 | ((hi a b c d).mul_const (U a b)).mul_const (U c d) |
| 66 | exact ((((hm.add (hp.const_mul 2)).add hr).add (hφ.mul hgs)).add (hψ.mul his)) |
| 67 | |
| 68 | end Poincare.RicciFlow.Harnack |