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.Tensor.TraceDerivative |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Tensor.PositiveForm |
| 3 | import Mathlib.Analysis.InnerProductSpace.Trace |
| 4 | import Mathlib.Analysis.InnerProductSpace.Adjoint |
| 5 | import Mathlib.Analysis.Normed.Operator.Banach |
| 6 | |
| 7 | /-! |
| 8 | # Metric traces in a fixed fiber |
| 9 | |
| 10 | Inverse Riesz representation turns bilinear forms into endomorphisms. An |
| 11 | inverse metric trace agrees with the selected orthonormal-basis trace and |
| 12 | its derivative cancels the connection contributions. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option maxSynthPendingDepth 3 |
| 17 | |
| 18 | open scoped BigOperators RealInnerProductSpace |
| 19 | |
| 20 | namespace PoincareMT.ReducedLength |
| 21 | |
| 22 | variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] |
| 23 | [FiniteDimensional ℝ E] |
| 24 | |
| 25 | noncomputable def formOperator : (E →L[ℝ] E →L[ℝ] ℝ) →L[ℝ] (E →L[ℝ] E) := |
| 26 | ContinuousLinearMap.compL ℝ E (E →L[ℝ] ℝ) E |
| 27 | (InnerProductSpace.toDual ℝ E).symm.toContinuousLinearEquiv.toContinuousLinearMap |
| 28 | |
| 29 | theorem formOperator_pairing (B : E →L[ℝ] E →L[ℝ] ℝ) (v w : E) : |
| 30 | ⟪formOperator B v, w⟫ = B v w := |
| 31 | InnerProductSpace.continuousLinearMapOfBilin_apply B v w |
| 32 | |
| 33 | theorem continuousTrace_formOperator {K : Type*} [Fintype K] |
| 34 | (B : E →L[ℝ] E →L[ℝ] ℝ) (b : OrthonormalBasis K ℝ E) : |
| 35 | continuousTrace (formOperator B) = ∑ i, B (b i) (b i) := by |
| 36 | rw [continuousTrace_apply, LinearMap.trace_eq_sum_inner _ b] |
| 37 | apply Finset.sum_congr rfl |
| 38 | intro i _ |
| 39 | rw [real_inner_comm] |
| 40 | exact formOperator_pairing B (b i) (b i) |
| 41 | |
| 42 | theorem formOperator_isUnit_of_positive (G : E →L[ℝ] E →L[ℝ] ℝ) |
| 43 | (hG : ∀ v : E, v ≠ 0 → 0 < G v v) : IsUnit (formOperator G) := by |
| 44 | obtain ⟨e, he⟩ := positiveForm_isInvertible G hG |
| 45 | apply ContinuousLinearMap.isUnit_iff_bijective.mpr |
| 46 | change Function.Bijective (fun v ↦ (InnerProductSpace.toDual ℝ E).symm (G v)) |
| 47 | rw [← he] |
| 48 | exact (InnerProductSpace.toDual ℝ E).symm.bijective.comp e.bijective |
| 49 | |
| 50 | noncomputable def metricFormTrace (G B : E →L[ℝ] E →L[ℝ] ℝ) : ℝ := |
| 51 | continuousTrace (Ring.inverse (formOperator G) * formOperator B) |
| 52 | |
| 53 | theorem metricFormTrace_pullback |
| 54 | {V K : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] |
| 55 | [FiniteDimensional ℝ V] [Fintype K] |
| 56 | (e : E ≃L[ℝ] V) (G : E →L[ℝ] E →L[ℝ] ℝ) |
| 57 | (hG : ∀ v w : E, G v w = ⟪e v, e w⟫) |
| 58 | (B : V →L[ℝ] V →L[ℝ] ℝ) (b : OrthonormalBasis K ℝ V) : |
| 59 | metricFormTrace G (B.bilinearComp e.toContinuousLinearMap e.toContinuousLinearMap) = |
| 60 | ∑ i, B (b i) (b i) := by |
| 61 | have hunit : IsUnit (formOperator G) := formOperator_isUnit_of_positive G (by |
| 62 | intro v hv |
| 63 | rw [hG] |
| 64 | exact real_inner_self_pos.mpr (e.map_eq_zero_iff.not.mpr hv)) |
| 65 | have hcancel (z : E) : formOperator G (Ring.inverse (formOperator G) z) = z := by |
| 66 | obtain ⟨a, ha⟩ := hunit |
| 67 | have h : formOperator G * Ring.inverse (formOperator G) = 1 := by |
| 68 | rw [← ha, Ring.inverse_unit] |
| 69 | exact a.mul_inv |
| 70 | exact congrArg (fun L : E →L[ℝ] E ↦ L z) h |
| 71 | have hintertwine (v : E) : |
| 72 | e (Ring.inverse (formOperator G) |
| 73 | (formOperator (B.bilinearComp e.toContinuousLinearMap e.toContinuousLinearMap) v)) = |
| 74 | formOperator B (e v) := by |
| 75 | apply ext_inner_right ℝ |
| 76 | intro w |
| 77 | obtain ⟨z, rfl⟩ := e.surjective w |
| 78 | rw [← hG, ← formOperator_pairing, hcancel, formOperator_pairing, |
| 79 | ContinuousLinearMap.bilinearComp_apply, formOperator_pairing] |
| 80 | rfl |
| 81 | have hconj : e.toLinearEquiv.conj |
| 82 | (Ring.inverse (formOperator G) * |
| 83 | formOperator (B.bilinearComp e.toContinuousLinearMap e.toContinuousLinearMap)).toLinearMap = |
| 84 | (formOperator B).toLinearMap := by |
| 85 | ext w |
| 86 | change e (Ring.inverse (formOperator G) |
| 87 | (formOperator (B.bilinearComp e.toContinuousLinearMap e.toContinuousLinearMap) |
| 88 | (e.symm w))) = formOperator B w |
| 89 | simpa using hintertwine (e.symm w) |
| 90 | unfold metricFormTrace |
| 91 | rw [continuousTrace_apply, ← LinearMap.trace_conj' _ e.toLinearEquiv, hconj] |
| 92 | exact continuousTrace_formOperator B b |
| 93 | |
| 94 | theorem metricFormTrace_hasDerivAt |
| 95 | (G B : ℝ → E →L[ℝ] E →L[ℝ] ℝ) (G' B' : E →L[ℝ] E →L[ℝ] ℝ) |
| 96 | (t : ℝ) (hG : HasDerivAt G G' t) (hB : HasDerivAt B B' t) |
| 97 | (hunit : IsUnit (formOperator (G t))) (P : E →L[ℝ] E) |
| 98 | (C : E →L[ℝ] E →L[ℝ] ℝ) |
| 99 | (hG' : ∀ v w, G' v w = G t (P v) w + G t v (P w)) |
| 100 | (hB' : ∀ v w, B' v w = B t (P v) w + B t v (P w) + C v w) : |
| 101 | HasDerivAt (fun s ↦ metricFormTrace (G s) (B s)) (metricFormTrace (G t) C) t := by |
| 102 | have hGO : HasDerivAt (fun s ↦ formOperator (G s)) (formOperator G') t := by |
| 103 | simpa only [Function.comp_def] using! |
| 104 | ((formOperator (E := E)).hasFDerivAt (x := G t)).comp_hasDerivAt t hG |
| 105 | have hBO : HasDerivAt (fun s ↦ formOperator (B s)) (formOperator B') t := by |
| 106 | simpa only [Function.comp_def] using! |
| 107 | ((formOperator (E := E)).hasFDerivAt (x := B t)).comp_hasDerivAt t hB |
| 108 | apply inverseMetricTrace_hasDerivAt _ _ _ _ t hGO hBO hunit P P.adjoint (formOperator C) |
| 109 | · ext v |
| 110 | apply ext_inner_right ℝ |
| 111 | intro w |
| 112 | simpa only [add_apply, mul_apply_eq_comp, |
| 113 | inner_add_left, ContinuousLinearMap.adjoint_inner_left, formOperator_pairing] using hG' v w |
| 114 | · ext v |
| 115 | apply ext_inner_right ℝ |
| 116 | intro w |
| 117 | simpa only [add_apply, mul_apply_eq_comp, |
| 118 | inner_add_left, ContinuousLinearMap.adjoint_inner_left, formOperator_pairing] using hB' v w |
| 119 | |
| 120 | end PoincareMT.ReducedLength |