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.ReducedGeometry.ReducedLength.Calculus.CompactInitialJet |
| 2 | import Mathlib.Analysis.Normed.Module.FiniteDimension |
| 3 | |
| 4 | /-! |
| 5 | # Uniform injectivity from the actual initial jet |
| 6 | |
| 7 | The inverse-operator norm estimate works also in dimension zero. A convex |
| 8 | mean-value bound proves injectivity on the whole compact set. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | set_option maxSynthPendingDepth 3 |
| 13 | |
| 14 | open scoped ContDiff |
| 15 | |
| 16 | namespace PoincareMT.ReducedLength |
| 17 | |
| 18 | variable {E V : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 19 | [NormedAddCommGroup V] [NormedSpace ℝ V] |
| 20 | |
| 21 | theorem eq_zero_of_scaled_equiv_bound (L : E ≃L[ℝ] V) (ε s : ℝ) |
| 22 | (hε : ‖(L.symm : V →L[ℝ] E)‖ * ε < 1) (hs : 0 < s) (v : E) |
| 23 | (hv : ‖s • L v‖ ≤ ε * s * ‖v‖) : v = 0 := by |
| 24 | have hLv : ‖L v‖ ≤ ε * ‖v‖ := by |
| 25 | apply (mul_le_mul_iff_right₀ hs).mp |
| 26 | calc |
| 27 | s * ‖L v‖ = ‖s • L v‖ := by rw [norm_smul, Real.norm_eq_abs, abs_of_pos hs] |
| 28 | _ ≤ ε * s * ‖v‖ := hv |
| 29 | _ = s * (ε * ‖v‖) := by ring |
| 30 | have hi : ‖v‖ ≤ ‖(L.symm : V →L[ℝ] E)‖ * ‖L v‖ := by |
| 31 | simpa only [ContinuousLinearEquiv.coe_coe, L.symm_apply_apply] using |
| 32 | (L.symm : V →L[ℝ] E).le_opNorm (L v) |
| 33 | have hfinal : ‖v‖ ≤ (‖(L.symm : V →L[ℝ] E)‖ * ε) * ‖v‖ := by |
| 34 | simpa only [mul_assoc] using hi.trans |
| 35 | (mul_le_mul_of_nonneg_left hLv (norm_nonneg (L.symm : V →L[ℝ] E))) |
| 36 | by_contra hv0 |
| 37 | have hp := mul_lt_mul_of_pos_right hε (norm_pos_iff.mpr hv0) |
| 38 | rw [one_mul] at hp |
| 39 | exact (not_lt_of_ge hfinal) hp |
| 40 | |
| 41 | theorem exists_uniform_smallTime_injective [FiniteDimensional ℝ E] [FiniteDimensional ℝ V] |
| 42 | (f : E × ℝ → V) (U : Set (E × ℝ)) (hU : IsOpen U) (hf : ContDiffOn ℝ ∞ f U) |
| 43 | (hzeroU : ∀ x, (x, (0 : ℝ)) ∈ U) (q : V) (hzero : ∀ x, f (x, 0) = q) |
| 44 | (L : E ≃L[ℝ] V) (hjet : ∀ x, HasDerivAt (fun t ↦ f (x, t)) (L x) 0) |
| 45 | (K : Set E) (hK : IsCompact K) (hconv : Convex ℝ K) : |
| 46 | ∃ δ : ℝ, 0 < δ ∧ ∀ s, 0 < s → s < δ → |
| 47 | Set.InjOn (fun x ↦ f (x, s)) K ∧ ∀ x ∈ K, |
| 48 | (x, s) ∈ U ∧ Function.Bijective (fderiv ℝ (fun y ↦ f (y, s)) x) := by |
| 49 | let a := ‖(L.symm : V →L[ℝ] E)‖ |
| 50 | let ε := 1 / (2 * (a + 1)) |
| 51 | have ha : 0 ≤ a := norm_nonneg _ |
| 52 | have hε : 0 < ε := by dsimp [ε]; positivity |
| 53 | have hεsmall : a * ε < 1 := by |
| 54 | have he : ε * (2 * (a + 1)) = 1 := div_mul_cancel₀ 1 (by positivity) |
| 55 | nlinarith |
| 56 | obtain ⟨δ, hδ, hbound⟩ := exists_uniform_initialSlice_fderiv_bound f U hU hf |
| 57 | hzeroU q hzero (L : E →L[ℝ] V) hjet K hK ε hε |
| 58 | refine ⟨δ, hδ, ?_⟩ |
| 59 | intro s hs hsδ |
| 60 | have hd (x : E) (hx : x ∈ K) : |
| 61 | HasFDerivAt (fun y ↦ f (y, s)) (fderiv ℝ (fun y ↦ f (y, s)) x) x := |
| 62 | (((hf.contDiffAt (hU.mem_nhds (hbound x hx s hs.le hsδ).1)).comp x |
| 63 | (contDiffAt_id.prodMk contDiffAt_const)).differentiableAt (by simp)).hasFDerivAt |
| 64 | have herror (x : E) (hx : x ∈ K) : |
| 65 | ‖fderiv ℝ (fun y ↦ f (y, s)) x - s • (L : E →L[ℝ] V)‖ ≤ ε * s := |
| 66 | (hbound x hx s hs.le hsδ).2 |
| 67 | constructor |
| 68 | · intro x hx y hy heq |
| 69 | have hm := hconv.norm_image_sub_le_of_norm_hasFDerivWithin_le' |
| 70 | (fun z hz ↦ (hd z hz).hasFDerivWithinAt) herror hx hy |
| 71 | have hz : y - x = 0 := eq_zero_of_scaled_equiv_bound L ε s hεsmall hs (y - x) (by |
| 72 | simpa only [heq, sub_self, zero_sub, norm_neg, smul_apply, |
| 73 | ContinuousLinearEquiv.coe_coe] using hm) |
| 74 | exact (sub_eq_zero.mp hz).symm |
| 75 | · intro x hx |
| 76 | refine ⟨(hbound x hx s hs.le hsδ).1, ?_⟩ |
| 77 | let D := fderiv ℝ (fun y ↦ f (y, s)) x |
| 78 | have hinj : Function.Injective D := by |
| 79 | intro v w hvw |
| 80 | have hzeroD : D (v - w) = 0 := by rw [map_sub, hvw, sub_self] |
| 81 | have hnorm := ((D - s • (L : E →L[ℝ] V)).le_opNorm (v - w)).trans |
| 82 | (mul_le_mul_of_nonneg_right (herror x hx) (norm_nonneg (v - w))) |
| 83 | have hz : v - w = 0 := eq_zero_of_scaled_equiv_bound L ε s hεsmall hs (v - w) (by |
| 84 | simpa only [sub_apply, hzeroD, zero_sub, norm_neg, smul_apply, |
| 85 | ContinuousLinearEquiv.coe_coe] using hnorm) |
| 86 | exact sub_eq_zero.mp hz |
| 87 | exact ⟨hinj, (LinearMap.injective_iff_surjective_of_finrank_eq_finrank |
| 88 | (f := D.toLinearMap) L.toLinearEquiv.finrank_eq).mp hinj⟩ |
| 89 | |
| 90 | end PoincareMT.ReducedLength |