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.Surgery.StandardCap.Persistence.Scalar.Calculus.ScalarFourJet |
| 2 | |
| 3 | /-! |
| 4 | # The native scalar Laplacian of a spatially constant scalar field |
| 5 | |
| 6 | The first and second chain rules identify the literal four-jet operator |
| 7 | with derivatives of the scalar two-jet composition. Source: |
| 8 | Morgan--Tian equation (3.7), p. 41, and Proposition 15.2, pp. 353-354. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | set_option backward.isDefEq.respectTransparency false |
| 13 | -- The two-jet composition uses the native nested continuous-linear spaces. |
| 14 | set_option maxSynthPendingDepth 16 |
| 15 | |
| 16 | open scoped ContDiff Topology BigOperators |
| 17 | |
| 18 | namespace PoincareMT.M45 |
| 19 | |
| 20 | open M44 SpacetimeBounds |
| 21 | |
| 22 | local notation "E" n:max => EuclideanSpace ℝ (Fin n) |
| 23 | |
| 24 | noncomputable local instance constantScalarCoefficientNormedGroup (n : ℕ) : |
| 25 | NormedAddCommGroup (MetricCoefficient n) := ContinuousLinearMap.toNormedAddCommGroup |
| 26 | |
| 27 | noncomputable local instance constantScalarCoefficientNormedSpace (n : ℕ) : |
| 28 | NormedSpace ℝ (MetricCoefficient n) := ContinuousLinearMap.toNormedSpace |
| 29 | |
| 30 | noncomputable local instance constantScalarTwoJetNormedGroup (n : ℕ) : |
| 31 | NormedAddCommGroup (MetricTwoJet n) := Prod.normedAddCommGroup |
| 32 | |
| 33 | noncomputable local instance constantScalarTwoJetNormedSpace (n : ℕ) : |
| 34 | NormedSpace ℝ (MetricTwoJet n) := Prod.normedSpace |
| 35 | |
| 36 | set_option maxHeartbeats 800000 in |
| 37 | -- The second chain rule identifies the nested native two-jet derivatives. |
| 38 | /-- Spatial constancy of the scalar two-jet composition annihilates the |
| 39 | literal scalar four-jet Laplacian. Source: equation (3.7), p. 41. -/ |
| 40 | theorem model_jetScalarLaplacian_eq_zero_of_const {n : ℕ} |
| 41 | (B : E n → MetricCoefficient n) (x : E n) (hB : ContDiffAt ℝ ∞ B x) |
| 42 | (hinv : (B x).IsInvertible) (c : ℝ) |
| 43 | (hscalar : jetScalarCurvature ∘ metricTwoJet B = fun _ => c) : |
| 44 | jetScalarLaplacian (scalarMetricFourJet B x) = 0 := by |
| 45 | have hJ := contDiffAt_metricTwoJet hB |
| 46 | have hS := contDiffAt_jetScalarCurvature (J := metricTwoJet B x) hinv |
| 47 | have hfirst (i : Fin n) : jetScalarFirst (scalarMetricFourJet B x) i = 0 := by |
| 48 | have h := congrArg (fun L : E n →L[ℝ] ℝ => |
| 49 | L (EuclideanSpace.basisFun (Fin n) ℝ i)) |
| 50 | (fderiv_comp x (hS.differentiableAt (by simp)) (hJ.differentiableAt (by simp))) |
| 51 | rw [hscalar] at h |
| 52 | simpa only [fderiv_const_apply, zero_apply, ContinuousLinearMap.comp_apply, |
| 53 | jetScalarFirst, scalarMetricFourJet] using h.symm |
| 54 | have hsecond (i j : Fin n) : jetScalarSecond (scalarMetricFourJet B x) i j = 0 := by |
| 55 | have h := second_fderiv_comp_of_contDiffAt hJ hS |
| 56 | (EuclideanSpace.basisFun (Fin n) ℝ i) (EuclideanSpace.basisFun (Fin n) ℝ j) |
| 57 | rw [hscalar] at h |
| 58 | have hconst : fderiv ℝ (fun _ : E n => c) = fun _ => 0 := |
| 59 | funext fun y => fderiv_const_apply (x := y) c |
| 60 | rw [hconst] at h |
| 61 | simpa only [fderiv_const_apply, zero_apply, jetScalarSecond, scalarMetricFourJet] |
| 62 | using h.symm |
| 63 | change (∑ i, ∑ j, |
| 64 | EuclideanSpace.proj j ((B x).inverse (EuclideanSpace.proj i)) * |
| 65 | jetScalarSecond (scalarMetricFourJet B x) i j) - |
| 66 | (∑ i, EuclideanSpace.proj i |
| 67 | (jetContractedChristoffel (scalarMetricFourJet B x).1) * |
| 68 | jetScalarFirst (scalarMetricFourJet B x) i) = 0 |
| 69 | simp only [hfirst, hsecond, mul_zero, Finset.sum_const_zero, sub_self] |
| 70 | |
| 71 | end PoincareMT.M45 |