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.Existence.Analysis.CanonicalGeometry.CapPersistenceHessianGerm |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Existence.Geometry.Coordinates.MetricChristoffelGermBounds |
| 3 | import PoincareLib.Geometry.Riemannian.Coordinates.Transition.Hessian |
| 4 | import PoincareLib.Geometry.Riemannian.Coordinates.TransitionBounds |
| 5 | |
| 6 | /-! |
| 7 | # Pointwise finite jets of actual local metric isometries |
| 8 | |
| 9 | The metric identity derives both the first derivative bound and the |
| 10 | genuine Hessian equation. Only finite metric jets and coercivity at the |
| 11 | tested centers enter the constant; smooth neighborhoods may vary. |
| 12 | Source: Morgan--Tian Proposition 9.79(3), p. 234, and Theorem 12.28, |
| 13 | pp. 323-324; cap-persistence-implementation.md, section 3. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set Filter |
| 20 | open scoped ContDiff Topology |
| 21 | |
| 22 | namespace PoincareMT.CoordinateTransition |
| 23 | |
| 24 | variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] |
| 25 | [FiniteDimensional ℝ E] |
| 26 | |
| 27 | /-- Actual local isometries have bounded finite jets from pointwise |
| 28 | coefficient bounds. The constant precedes all fields, maps, centers and |
| 29 | open neighborhoods, including neighborhoods of different radii |
| 30 | (Proposition 9.79(3), p. 234). -/ |
| 31 | theorem exists_local_isometry_germ_jet_bound (n : ℕ) {a K : ℝ} |
| 32 | (ha : 0 < a) (hK : 1 ≤ K) : |
| 33 | ∃ C : ℝ, 1 ≤ C ∧ ∀ (A B : E → E →L[ℝ] E →L[ℝ] ℝ) |
| 34 | (f : E → E) (U V : Set E) (x : E), |
| 35 | IsOpen U → IsOpen V → x ∈ U → |
| 36 | ContDiffOn ℝ ∞ A U → ContDiffOn ℝ ∞ B V → ContDiffOn ℝ ∞ f U → |
| 37 | (∀ y ∈ U, (A y).IsInvertible) → (∀ y ∈ V, (B y).IsInvertible) → |
| 38 | (∀ y ∈ V, ∀ v w, B y v w = B y w v) → MapsTo f U V → |
| 39 | (∀ y ∈ U, ∀ v w, |
| 40 | A y v w = B (f y) (fderiv ℝ f y v) (fderiv ℝ f y w)) → |
| 41 | ‖f x‖ ≤ K → |
| 42 | (∀ j ≤ n + 1, ‖iteratedFDeriv ℝ j A x‖ ≤ K) → |
| 43 | (∀ j ≤ n + 1, ‖iteratedFDeriv ℝ j B (f x)‖ ≤ K) → |
| 44 | (∀ v, a * ‖v‖ ^ 2 ≤ A x v v) → |
| 45 | (∀ v, a * ‖v‖ ^ 2 ≤ B (f x) v v) → |
| 46 | ∀ j ≤ n + 2, ‖iteratedFDeriv ℝ j f x‖ ≤ C := by |
| 47 | obtain ⟨G, hG, hGb⟩ := exists_christoffel_germ_jet_bound (E := E) n ha hK |
| 48 | let K1 := max K (max G (Real.sqrt (K / a))) |
| 49 | have hK1 : 1 ≤ K1 := hK.trans (le_max_left _ _) |
| 50 | obtain ⟨C, hC, hCb⟩ := exists_finite_hessian_germ_jet_bound |
| 51 | (E := E) (F := E) n hK1 |
| 52 | refine ⟨C, hC, ?_⟩ |
| 53 | intro A B f U V x hU hV hx hA hB hf hAi hBi hsymm hmap hmetric |
| 54 | hzero hAj hBj hAlow hBlow |
| 55 | have hA0 := hA.contDiffAt (hU.mem_nhds hx) |
| 56 | have hB0 := hB.contDiffAt (hV.mem_nhds (hmap hx)) |
| 57 | have hf0 := hf.contDiffAt (hU.mem_nhds hx) |
| 58 | have hfirst : ‖fderiv ℝ f x‖ ≤ Real.sqrt (K / a) := by |
| 59 | apply norm_le_of_pullback_quadratic_bounds (A x) (B (f x)) (fderiv ℝ f x) |
| 60 | ha (zero_le_one.trans hK) (fun v => ?_) hBlow |
| 61 | (fun v w => (hmetric x hx v w).symm) |
| 62 | have hnorm : ‖A x‖ ≤ K := by |
| 63 | simpa only [norm_iteratedFDeriv_zero] using hAj 0 (Nat.zero_le _) |
| 64 | calc |
| 65 | A x v v ≤ ‖A x v v‖ := le_abs_self _ |
| 66 | _ ≤ ‖A x‖ * (‖v‖ * ‖v‖) := by |
| 67 | simpa only [mul_assoc] using (A x).le_opNorm₂ v v |
| 68 | _ ≤ K * (‖v‖ * ‖v‖) := |
| 69 | mul_le_mul_of_nonneg_right hnorm (by positivity) |
| 70 | _ = K * ‖v‖ ^ 2 := by rw [pow_two] |
| 71 | have hΓA := CoordinateExponential.contDiffAt_christoffelBilinear hA0 (hAi x hx) |
| 72 | have hΓB := CoordinateExponential.contDiffAt_christoffelBilinear |
| 73 | hB0 (hBi (f x) (hmap hx)) |
| 74 | have hH : ∀ᶠ y in 𝓝 x, ∀ v w, |
| 75 | fderiv ℝ (fderiv ℝ f) y v w = |
| 76 | fderiv ℝ f y (CoordinateExponential.christoffelBilinear A y v w) - |
| 77 | CoordinateExponential.christoffelBilinear B (f y) |
| 78 | (fderiv ℝ f y v) (fderiv ℝ f y w) := by |
| 79 | filter_upwards [hU.mem_nhds hx] with y hy |
| 80 | intro v w |
| 81 | have he := fderiv_fderiv_eq_transitionHessianPolynomial_on hU hV hA hB |
| 82 | hAi hBi hsymm hf hmap |
| 83 | (fun z hz => surjective_of_pullback_isInvertible (hAi z hz) (hmetric z hz)) |
| 84 | hmetric hy |
| 85 | simpa only [transitionHessianPolynomial_apply] using congrArg (fun L => L v w) he |
| 86 | apply hCb f (CoordinateExponential.christoffelBilinear A) |
| 87 | (CoordinateExponential.christoffelBilinear B) x hf0 hΓA hΓB hH |
| 88 | (hzero.trans (le_max_left _ _)) |
| 89 | (hfirst.trans ((le_max_right _ _).trans (le_max_right _ _))) |
| 90 | · intro j hj |
| 91 | exact (hGb A x hA0 hAj hAlow j hj).trans |
| 92 | ((le_max_left _ _).trans (le_max_right _ _)) |
| 93 | · intro j hj |
| 94 | exact (hGb B (f x) hB0 hBj hBlow j hj).trans |
| 95 | ((le_max_left _ _).trans (le_max_right _ _)) |
| 96 | |
| 97 | end PoincareMT.CoordinateTransition |