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.Coordinates.BilinearPullbackJetBound |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Existence.Analysis.Coordinates.NeckBilinearSmooth |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Existence.Analysis.Coordinates.FiniteJetNormBounds |
| 4 | |
| 5 | /-! |
| 6 | # Pointwise finite jets from a genuine Hessian germ |
| 7 | |
| 8 | Only the source and target connection jets at the tested centers enter |
| 9 | the bound. The neighborhoods on which the actual Hessian identity holds |
| 10 | may vary with the map. This is the finite inner-end estimate for |
| 11 | Morgan--Tian Proposition 9.79(3), p. 234, and Theorem 12.28, pp. 323-324; |
| 12 | cap-persistence-implementation.md, section 3. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | -- The source Hessian term uses five nested continuous-linear-map spaces. |
| 17 | set_option maxSynthPendingDepth 12 |
| 18 | |
| 19 | open Filter |
| 20 | open scoped ContDiff Topology |
| 21 | open Poincare.Analysis.Calculus |
| 22 | |
| 23 | section |
| 24 | |
| 25 | variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 26 | [NormedAddCommGroup F] [NormedSpace ℝ F] |
| 27 | |
| 28 | private theorem exists_hessian_germ_step_bound (m : ℕ) {K : ℝ} (hK : 1 ≤ K) : |
| 29 | ∃ C : ℝ, 1 ≤ C ∧ ∀ (f : E → F) (A : E → E →L[ℝ] E →L[ℝ] E) |
| 30 | (B : F → F →L[ℝ] F →L[ℝ] F) (x : E), |
| 31 | ContDiffAt ℝ ∞ f x → ContDiffAt ℝ ∞ A x → ContDiffAt ℝ ∞ B (f x) → |
| 32 | (∀ᶠ y in 𝓝 x, ∀ v w, |
| 33 | fderiv ℝ (fderiv ℝ f) y v w = fderiv ℝ f y (A y v w) - |
| 34 | B (f y) (fderiv ℝ f y v) (fderiv ℝ f y w)) → |
| 35 | (∀ j ≤ m + 1, ‖iteratedFDeriv ℝ j f x‖ ≤ K) → |
| 36 | (∀ j ≤ m, ‖iteratedFDeriv ℝ j A x‖ ≤ K) → |
| 37 | (∀ j ≤ m, ‖iteratedFDeriv ℝ j B (f x)‖ ≤ K) → |
| 38 | ‖iteratedFDeriv ℝ (m + 2) f x‖ ≤ C := by |
| 39 | let op : (E →L[ℝ] F) →L[ℝ] |
| 40 | (E →L[ℝ] E →L[ℝ] E) →L[ℝ] E →L[ℝ] E →L[ℝ] F := |
| 41 | (ContinuousLinearMap.compL ℝ E (E →L[ℝ] E) (E →L[ℝ] F)).comp |
| 42 | (ContinuousLinearMap.compL ℝ E E F) |
| 43 | obtain ⟨D, hD, hDb⟩ := |
| 44 | exists_bilinear_pullback_jet_bound (E := E) (F := F) (G := F) m hK |
| 45 | refine ⟨max 1 (‖op‖ * (2 : ℝ) ^ m * K * K + D * K), le_max_left _ _, ?_⟩ |
| 46 | intro f A B x hf hA hB hEq hfj hAj hBj |
| 47 | have hd : ContDiffAt ℝ ∞ (fderiv ℝ f) x := hf.fderiv_right (by simp) |
| 48 | have hs : ContDiffAt ℝ ∞ (fun y => op (fderiv ℝ f y) (A y)) x := |
| 49 | op.isBoundedBilinearMap.contDiff.contDiffAt.comp x (hd.prodMk hA) |
| 50 | have ht := hf.bilinearPullback hB |
| 51 | have hsbound := norm_iteratedFDeriv_bilinear_le_of_jet_bounds op hd hA m |
| 52 | (zero_le_one.trans hK) |
| 53 | (fun j hj => by rw [norm_iteratedFDeriv_fderiv]; exact hfj _ (by omega)) hAj |
| 54 | have htbound := hDb f B x hf hB hfj K (zero_le_one.trans hK) hBj |
| 55 | have heq : (fderiv ℝ (fderiv ℝ f)) =ᶠ[𝓝 x] |
| 56 | (fun y => op (fderiv ℝ f y) (A y) - |
| 57 | (B (f y)).bilinearComp (fderiv ℝ f y) (fderiv ℝ f y)) := by |
| 58 | filter_upwards [hEq] with y hy |
| 59 | ext v w |
| 60 | exact hy v w |
| 61 | calc |
| 62 | _ = ‖iteratedFDeriv ℝ m (fderiv ℝ (fderiv ℝ f)) x‖ := by |
| 63 | rw [norm_iteratedFDeriv_fderiv, norm_iteratedFDeriv_fderiv] |
| 64 | _ = ‖iteratedFDeriv ℝ m (fun y => op (fderiv ℝ f y) (A y) - |
| 65 | (B (f y)).bilinearComp (fderiv ℝ f y) (fderiv ℝ f y)) x‖ := |
| 66 | congrArg norm ((heq.iteratedFDeriv ℝ m).self_of_nhds) |
| 67 | _ ≤ _ := (norm_iteratedFDeriv_sub_le_of_contDiffAt m |
| 68 | (hs.of_le (by exact_mod_cast le_top)) |
| 69 | (ht.of_le (by exact_mod_cast le_top))).trans |
| 70 | ((add_le_add hsbound htbound).trans (le_max_right _ _)) |
| 71 | |
| 72 | /-- Finite connection jets and the genuine local Hessian identity bound |
| 73 | all map jets through two additional orders. The constant is independent |
| 74 | of the map, the evaluation point and the neighborhood on which the |
| 75 | identity holds; the source and target normed spaces may differ. -/ |
| 76 | theorem exists_finite_hessian_germ_jet_bound (N : ℕ) {K : ℝ} (hK : 1 ≤ K) : |
| 77 | ∃ C : ℝ, 1 ≤ C ∧ ∀ (f : E → F) (A : E → E →L[ℝ] E →L[ℝ] E) |
| 78 | (B : F → F →L[ℝ] F →L[ℝ] F) (x : E), |
| 79 | ContDiffAt ℝ ∞ f x → ContDiffAt ℝ ∞ A x → ContDiffAt ℝ ∞ B (f x) → |
| 80 | (∀ᶠ y in 𝓝 x, ∀ v w, |
| 81 | fderiv ℝ (fderiv ℝ f) y v w = fderiv ℝ f y (A y v w) - |
| 82 | B (f y) (fderiv ℝ f y v) (fderiv ℝ f y w)) → |
| 83 | ‖f x‖ ≤ K → ‖fderiv ℝ f x‖ ≤ K → |
| 84 | (∀ j ≤ N, ‖iteratedFDeriv ℝ j A x‖ ≤ K) → |
| 85 | (∀ j ≤ N, ‖iteratedFDeriv ℝ j B (f x)‖ ≤ K) → |
| 86 | ∀ j ≤ N + 2, ‖iteratedFDeriv ℝ j f x‖ ≤ C := by |
| 87 | induction N with |
| 88 | | zero => |
| 89 | obtain ⟨C, hC, hCb⟩ := exists_hessian_germ_step_bound (E := E) (F := F) 0 hK |
| 90 | refine ⟨max K C, hK.trans (le_max_left _ _), ?_⟩ |
| 91 | intro f A B x hf hA hB hEq hzero hfirst hAj hBj j hj |
| 92 | have hlow (l : ℕ) (hl : l ≤ 1) : ‖iteratedFDeriv ℝ l f x‖ ≤ K := by |
| 93 | interval_cases l |
| 94 | · simpa only [norm_iteratedFDeriv_zero] using hzero |
| 95 | · simpa only [norm_iteratedFDeriv_one] using hfirst |
| 96 | by_cases hle : j ≤ 1 |
| 97 | · exact (hlow j hle).trans (le_max_left _ _) |
| 98 | · have he : j = 2 := by omega |
| 99 | subst j |
| 100 | exact (hCb f A B x hf hA hB hEq hlow hAj hBj).trans (le_max_right _ _) |
| 101 | | succ N ih => |
| 102 | obtain ⟨C, hC, hCb⟩ := ih |
| 103 | let K' := max K C |
| 104 | have hK' : 1 ≤ K' := hK.trans (le_max_left _ _) |
| 105 | obtain ⟨D, hD, hDb⟩ := exists_hessian_germ_step_bound |
| 106 | (E := E) (F := F) (N + 1) hK' |
| 107 | refine ⟨max C D, hC.trans (le_max_left _ _), ?_⟩ |
| 108 | intro f A B x hf hA hB hEq hzero hfirst hAj hBj j hj |
| 109 | have hprev : ∀ l ≤ N + 2, ‖iteratedFDeriv ℝ l f x‖ ≤ C := |
| 110 | hCb f A B x hf hA hB hEq hzero hfirst |
| 111 | (fun l hl => hAj l (by omega)) (fun l hl => hBj l (by omega)) |
| 112 | by_cases hle : j ≤ N + 2 |
| 113 | · exact (hprev j hle).trans (le_max_left _ _) |
| 114 | · have he : j = (N + 1) + 2 := by omega |
| 115 | subst j |
| 116 | apply (hDb f A B x hf hA hB hEq |
| 117 | (fun l hl => (hprev l (by omega)).trans (le_max_right _ _)) |
| 118 | (fun l hl => (hAj l hl).trans (le_max_left _ _)) |
| 119 | (fun l hl => (hBj l hl).trans (le_max_left _ _))).trans (le_max_right _ _) |
| 120 | |
| 121 | end |