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 Mathlib.Analysis.InnerProductSpace.Dual |
| 2 | import Mathlib.Analysis.Normed.Module.FiniteDimension |
| 3 | import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas |
| 4 | |
| 5 | /-! |
| 6 | # Invertibility of a positive coordinate metric |
| 7 | |
| 8 | Diagonal positivity gives injectivity into the continuous dual. Equal |
| 9 | finite dimensions then give a continuous linear inverse. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | namespace PoincareMT.ReducedLength |
| 15 | |
| 16 | variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] |
| 17 | [FiniteDimensional ℝ E] |
| 18 | |
| 19 | theorem positiveForm_isInvertible (B : E →L[ℝ] E →L[ℝ] ℝ) |
| 20 | (hB : ∀ v : E, v ≠ 0 → 0 < B v v) : B.IsInvertible := by |
| 21 | have hinj : Function.Injective B := by |
| 22 | intro v w h |
| 23 | have hz : B (v - w) = 0 := by rw [map_sub, h, sub_self] |
| 24 | have hvw : v - w = 0 := by |
| 25 | by_contra hn |
| 26 | have hp := hB (v - w) hn |
| 27 | have hzero : B (v - w) (v - w) = 0 := by rw [hz]; rfl |
| 28 | linarith |
| 29 | exact sub_eq_zero.mp hvw |
| 30 | have hdim : Module.finrank ℝ E = Module.finrank ℝ (E →L[ℝ] ℝ) := |
| 31 | (InnerProductSpace.toDual ℝ E).toLinearEquiv.finrank_eq |
| 32 | have hsurj : Function.Surjective B := |
| 33 | (LinearMap.injective_iff_surjective_of_finrank_eq_finrank hdim |
| 34 | (f := B.toLinearMap)).mp hinj |
| 35 | let e := (LinearEquiv.ofBijective B.toLinearMap ⟨hinj, hsurj⟩).toContinuousLinearEquiv |
| 36 | exact ⟨e, rfl⟩ |
| 37 | |
| 38 | end PoincareMT.ReducedLength |