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.l2Space |
| 2 | import Mathlib.Analysis.InnerProductSpace.PiL2 |
| 3 | import Mathlib.Analysis.InnerProductSpace.Spectrum |
| 4 | |
| 5 | /-! |
| 6 | # Hilbert eigenbases of compact injective self-adjoint operators |
| 7 | |
| 8 | We choose a finite orthonormal basis in each nonzero eigenspace. Distinct |
| 9 | eigenspaces are orthogonal, and the compact spectral theorem and injectivity |
| 10 | show that the resulting family is complete. |
| 11 | |
| 12 | Adapted from Chow--Liao--Qin, `Analysis/Spectral/Scalar/EigenBasis.lean`, |
| 13 | revision `1b535dd102b94cc42b107cca27059687888f08b3` (Apache-2.0). |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | |
| 18 | noncomputable section |
| 19 | |
| 20 | namespace Poincare.Analysis.Dirichlet.CompactSpectral |
| 21 | |
| 22 | open Module.End |
| 23 | open scoped InnerProductSpace |
| 24 | |
| 25 | variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℝ H] [CompleteSpace H] |
| 26 | |
| 27 | /-- The nonzero eigenvalues of an operator, without multiplicity. -/ |
| 28 | def NonzeroEigenvalue (T : H →L[ℝ] H) := |
| 29 | { μ : ℝ // μ ≠ 0 ∧ HasEigenvalue T.toLinearMap μ } |
| 30 | |
| 31 | /-- Each nonzero eigenvalue is indexed according to its finite multiplicity. -/ |
| 32 | def BasisIndex (T : H →L[ℝ] H) := |
| 33 | Σ μ : NonzeroEigenvalue T, Fin (Module.finrank ℝ (eigenspace T.toLinearMap μ.1)) |
| 34 | |
| 35 | /-- Compactness constructs a finite orthonormal basis of each nonzero eigenspace. -/ |
| 36 | def eigenspaceBasis (T : H →L[ℝ] H) (hT : IsCompactOperator T) |
| 37 | (μ : NonzeroEigenvalue T) : |
| 38 | OrthonormalBasis (Fin (Module.finrank ℝ (eigenspace T.toLinearMap μ.1))) |
| 39 | ℝ (eigenspace T.toLinearMap μ.1) := by |
| 40 | letI := ContinuousLinearMap.finite_dimensional_eigenspace hT μ.1 μ.2.1 |
| 41 | exact stdOrthonormalBasis ℝ (eigenspace T.toLinearMap μ.1) |
| 42 | |
| 43 | /-- Regard the union of the eigenspace bases as vectors in the ambient space. -/ |
| 44 | def basisVector (T : H →L[ℝ] H) (hT : IsCompactOperator T) (i : BasisIndex T) : H := |
| 45 | eigenspaceBasis T hT i.1 i.2 |
| 46 | |
| 47 | theorem basisVector_mem (T : H →L[ℝ] H) (hT : IsCompactOperator T) (i : BasisIndex T) : |
| 48 | basisVector T hT i ∈ eigenspace T.toLinearMap i.1.1 := |
| 49 | (eigenspaceBasis T hT i.1 i.2).property |
| 50 | |
| 51 | theorem basisVector_orthonormal (T : H →L[ℝ] H) (hT : IsCompactOperator T) |
| 52 | (hself : IsSelfAdjoint T) : Orthonormal ℝ (basisVector T hT) := by |
| 53 | have hsym := (ContinuousLinearMap.isSelfAdjoint_iff_isSymmetric).mp hself |
| 54 | have hfamily := hsym.orthogonalFamily_eigenspaces.comp |
| 55 | (fun μ ν h => (Subtype.ext h : (μ : NonzeroEigenvalue T) = ν)) |
| 56 | exact hfamily.orthonormal_sigma_orthonormal (fun μ => (eigenspaceBasis T hT μ).orthonormal) |
| 57 | |
| 58 | theorem eigenspace_le_span_basisVector (T : H →L[ℝ] H) (hT : IsCompactOperator T) |
| 59 | (μ : NonzeroEigenvalue T) : |
| 60 | eigenspace T.toLinearMap μ.1 ≤ Submodule.span ℝ (Set.range (basisVector T hT)) := by |
| 61 | intro x hx |
| 62 | have hsum := congrArg (eigenspace T.toLinearMap μ.1).subtype |
| 63 | ((eigenspaceBasis T hT μ).sum_repr ⟨x, hx⟩) |
| 64 | simp only [map_sum, map_smul] at hsum |
| 65 | change _ = x at hsum |
| 66 | rw [← hsum] |
| 67 | apply Submodule.sum_mem |
| 68 | intro k hk |
| 69 | apply Submodule.smul_mem |
| 70 | exact Submodule.subset_span ⟨⟨μ, k⟩, rfl⟩ |
| 71 | |
| 72 | theorem span_basisVector_eq_iSup (T : H →L[ℝ] H) (hT : IsCompactOperator T) : |
| 73 | Submodule.span ℝ (Set.range (basisVector T hT)) = |
| 74 | ⨆ μ : NonzeroEigenvalue T, eigenspace T.toLinearMap μ.1 := by |
| 75 | apply le_antisymm |
| 76 | · rw [Submodule.span_le] |
| 77 | rintro x ⟨i, rfl⟩ |
| 78 | exact Submodule.mem_iSup_of_mem i.1 (basisVector_mem T hT i) |
| 79 | · exact iSup_le (eigenspace_le_span_basisVector T hT) |
| 80 | |
| 81 | omit [CompleteSpace H] in |
| 82 | theorem nonzero_eigenspaces_eq_iSup (T : H →L[ℝ] H) (hinj : Function.Injective T) : |
| 83 | (⨆ μ : NonzeroEigenvalue T, eigenspace T.toLinearMap μ.1) = |
| 84 | ⨆ μ : ℝ, eigenspace T.toLinearMap μ := by |
| 85 | apply le_antisymm |
| 86 | · exact iSup_le fun μ => le_iSup (fun ν : ℝ => eigenspace T.toLinearMap ν) μ.1 |
| 87 | · refine iSup_le fun μ => ?_ |
| 88 | by_cases hzero : μ = 0 |
| 89 | · rw [hzero, eigenspace_zero, LinearMap.ker_eq_bot.mpr hinj] |
| 90 | exact bot_le |
| 91 | · by_cases heigen : HasEigenvalue T.toLinearMap μ |
| 92 | · exact le_iSup (fun ν : NonzeroEigenvalue T => eigenspace T.toLinearMap ν.1) |
| 93 | ⟨μ, hzero, heigen⟩ |
| 94 | · rw [hasEigenvalue_iff, not_not] at heigen |
| 95 | rw [heigen] |
| 96 | exact bot_le |
| 97 | |
| 98 | theorem span_basisVector_orthogonal_eq_bot (T : H →L[ℝ] H) (hT : IsCompactOperator T) |
| 99 | (hself : IsSelfAdjoint T) (hinj : Function.Injective T) : |
| 100 | (Submodule.span ℝ (Set.range (basisVector T hT)))ᗮ = ⊥ := by |
| 101 | rw [span_basisVector_eq_iSup, nonzero_eigenspaces_eq_iSup T hinj] |
| 102 | exact ContinuousLinearMap.orthogonalComplement_iSup_eigenspaces_eq_bot hT |
| 103 | ((ContinuousLinearMap.isSelfAdjoint_iff_isSymmetric).mp hself) |
| 104 | |
| 105 | /-- The Hilbert eigenbasis constructed from finite bases of the nonzero eigenspaces. -/ |
| 106 | def hilbertBasis (T : H →L[ℝ] H) (hT : IsCompactOperator T) |
| 107 | (hself : IsSelfAdjoint T) (hinj : Function.Injective T) : |
| 108 | HilbertBasis (BasisIndex T) ℝ H := |
| 109 | HilbertBasis.mkOfOrthogonalEqBot (basisVector_orthonormal T hT hself) |
| 110 | (span_basisVector_orthogonal_eq_bot T hT hself hinj) |
| 111 | |
| 112 | @[simp] theorem hilbertBasis_apply (T : H →L[ℝ] H) (hT : IsCompactOperator T) |
| 113 | (hself : IsSelfAdjoint T) (hinj : Function.Injective T) (i : BasisIndex T) : |
| 114 | hilbertBasis T hT hself hinj i = basisVector T hT i := |
| 115 | congrFun (HilbertBasis.coe_mkOfOrthogonalEqBot _ _) i |
| 116 | |
| 117 | theorem apply_hilbertBasis (T : H →L[ℝ] H) (hT : IsCompactOperator T) |
| 118 | (hself : IsSelfAdjoint T) (hinj : Function.Injective T) (i : BasisIndex T) : |
| 119 | T (hilbertBasis T hT hself hinj i) = i.1.1 • hilbertBasis T hT hself hinj i := by |
| 120 | rw [hilbertBasis_apply] |
| 121 | exact (mem_eigenspace_iff).mp (basisVector_mem T hT i) |
| 122 | |
| 123 | theorem hilbertBasis_dense (T : H →L[ℝ] H) (hT : IsCompactOperator T) |
| 124 | (hself : IsSelfAdjoint T) (hinj : Function.Injective T) : |
| 125 | Dense (Submodule.span ℝ (Set.range (hilbertBasis T hT hself hinj)) : Set H) := by |
| 126 | rw [dense_iff_closure_eq, ← Submodule.topologicalClosure_coe, |
| 127 | (hilbertBasis T hT hself hinj).dense_span] |
| 128 | rfl |
| 129 | |
| 130 | end Poincare.Analysis.Dirichlet.CompactSpectral |