Hodge conjecture: the CM case in Lean, read and discussed
OpenAI's Lean proof of the Hodge conjecture for CM abelian varieties: rerun it, read its statement, and keep the open questions with their sources. The conjecture is open

| 1 | import Mathlib |
| 2 | |
| 3 | /-! # Constant Points -/ |
| 4 | |
| 5 | namespace OAI.AlgebraicGeometry.GroupSchemes.ConstantPoints.FiniteEtale |
| 6 | |
| 7 | noncomputable section |
| 8 | |
| 9 | /-! Finite constant schemes on every affine algebra, using clopen partitions and idempotents. -/ |
| 10 | |
| 11 | open _root_.TopologicalSpace |
| 12 | |
| 13 | universe u v |
| 14 | variable {R : Type u} [CommRing R] |
| 15 | variable {ι : Type v} [Fintype ι] |
| 16 | |
| 17 | /-- A complete orthogonal idempotent family selects exactly one member at every prime. -/ |
| 18 | theorem existsUnique_index {e : ι → R} (he : CompleteOrthogonalIdempotents e) |
| 19 | (P : PrimeSpectrum R) : ∃! i, e i ∉ P.asIdeal := by |
| 20 | have hex : ∃ i, e i ∉ P.asIdeal := by |
| 21 | by_contra h |
| 22 | push Not at h |
| 23 | have hs : ∑ i, e i ∈ P.asIdeal := Ideal.sum_mem _ fun i _ => h i |
| 24 | rw [he.complete] at hs |
| 25 | exact P.isPrime.one_notMem hs |
| 26 | obtain ⟨i, hi⟩ := hex |
| 27 | refine ⟨i, hi, ?_⟩ |
| 28 | intro j hj |
| 29 | by_contra hji |
| 30 | have hz : e j * e i ∈ P.asIdeal := (he.ortho hji).symm ▸ P.asIdeal.zero_mem |
| 31 | exact hi ((P.isPrime.mem_or_mem hz).resolve_left hj) |
| 32 | |
| 33 | /-- The index chosen by a complete orthogonal idempotent family. -/ |
| 34 | def partitionIndex {e : ι → R} (he : CompleteOrthogonalIdempotents e) |
| 35 | (P : PrimeSpectrum R) : ι := Classical.choose (existsUnique_index he P) |
| 36 | |
| 37 | theorem partitionIndex_eq_iff {e : ι → R} (he : CompleteOrthogonalIdempotents e) |
| 38 | (P : PrimeSpectrum R) (i : ι) : partitionIndex he P = i ↔ e i ∉ P.asIdeal := by |
| 39 | have h := Classical.choose_spec (existsUnique_index he P) |
| 40 | exact ⟨fun hi => hi ▸ h.1, fun hi => (h.2 i hi).symm⟩ |
| 41 | |
| 42 | /-- The selected index is locally constant, even when the affine ring is nonreduced. -/ |
| 43 | def partitionFunction {e : ι → R} (he : CompleteOrthogonalIdempotents e) : |
| 44 | LocallyConstant (PrimeSpectrum R) ι where |
| 45 | toFun := partitionIndex he |
| 46 | isLocallyConstant := by |
| 47 | apply IsLocallyConstant.iff_isOpen_fiber.mpr |
| 48 | intro i |
| 49 | change IsOpen {P | partitionIndex he P = i} |
| 50 | have hset : {P | partitionIndex he P = i} = (PrimeSpectrum.basicOpen (e i) : Set _) := by |
| 51 | ext P |
| 52 | exact partitionIndex_eq_iff he P i |
| 53 | rw [hset] |
| 54 | exact (PrimeSpectrum.basicOpen (e i)).isOpen |
| 55 | |
| 56 | /-- The clopen fiber of a locally constant finite-index map. -/ |
| 57 | def fiberClopen (f : LocallyConstant (PrimeSpectrum R) ι) (i : ι) : Clopens (PrimeSpectrum R) := |
| 58 | ⟨{P | f P = i}, f.isLocallyConstant.isClopen_fiber i⟩ |
| 59 | |
| 60 | /-- The unique idempotent cutting out a clopen fiber. -/ |
| 61 | def fiberIdempotent (f : LocallyConstant (PrimeSpectrum R) ι) (i : ι) : R := |
| 62 | (PrimeSpectrum.isIdempotentElemEquivClopens.symm (fiberClopen f i)).val |
| 63 | |
| 64 | omit [Fintype ι] in |
| 65 | theorem fiberIdempotent_idem (f : LocallyConstant (PrimeSpectrum R) ι) (i : ι) : |
| 66 | IsIdempotentElem (fiberIdempotent f i) := |
| 67 | (PrimeSpectrum.isIdempotentElemEquivClopens.symm (fiberClopen f i)).property |
| 68 | |
| 69 | omit [Fintype ι] in |
| 70 | theorem fiberIdempotent_basicOpen (f : LocallyConstant (PrimeSpectrum R) ι) (i : ι) : |
| 71 | PrimeSpectrum.basicOpen (fiberIdempotent f i) = (fiberClopen f i).toOpens := |
| 72 | PrimeSpectrum.basicOpen_isIdempotentElemEquivClopens_symm _ |
| 73 | |
| 74 | omit [Fintype ι] in |
| 75 | theorem fiberIdempotent_ortho (f : LocallyConstant (PrimeSpectrum R) ι) : |
| 76 | OrthogonalIdempotents (fiberIdempotent f) := by |
| 77 | refine ⟨fiberIdempotent_idem f, ?_⟩ |
| 78 | intro i j hij |
| 79 | apply PrimeSpectrum.basicOpen_injOn_isIdempotentElem |
| 80 | ((fiberIdempotent_idem f i).mul (fiberIdempotent_idem f j)) IsIdempotentElem.zero |
| 81 | rw [PrimeSpectrum.basicOpen_mul, fiberIdempotent_basicOpen, fiberIdempotent_basicOpen, |
| 82 | PrimeSpectrum.basicOpen_zero] |
| 83 | ext P |
| 84 | change (f P = i ∧ f P = j) ↔ False |
| 85 | exact ⟨fun h => hij (h.1.symm.trans h.2), False.elim⟩ |
| 86 | |
| 87 | /-- The clopen fibers give a complete orthogonal idempotent family. -/ |
| 88 | theorem fiberIdempotent_complete (f : LocallyConstant (PrimeSpectrum R) ι) : |
| 89 | CompleteOrthogonalIdempotents (fiberIdempotent f) := by |
| 90 | classical |
| 91 | refine ⟨fiberIdempotent_ortho f, ?_⟩ |
| 92 | apply PrimeSpectrum.basicOpen_injOn_isIdempotentElem |
| 93 | (fiberIdempotent_ortho f).isIdempotentElem_sum IsIdempotentElem.one |
| 94 | ext P |
| 95 | change (∑ i, fiberIdempotent f i) ∉ P.asIdeal ↔ (1 : R) ∉ P.asIdeal |
| 96 | refine ⟨fun _ => P.isPrime.one_notMem, fun _ hsum => ?_⟩ |
| 97 | have hi : fiberIdempotent f (f P) ∉ P.asIdeal := by |
| 98 | change P ∈ PrimeSpectrum.basicOpen (fiberIdempotent f (f P)) |
| 99 | rw [fiberIdempotent_basicOpen] |
| 100 | rfl |
| 101 | apply hi |
| 102 | rw [← (fiberIdempotent_ortho f).mul_sum_of_mem (Finset.mem_univ (f P))] |
| 103 | exact P.asIdeal.mul_mem_left _ hsum |
| 104 | |
| 105 | /-- Recovering the clopen fibers of a partition recovers its idempotents. -/ |
| 106 | theorem fiberIdempotent_partitionFunction {e : ι → R} |
| 107 | (he : CompleteOrthogonalIdempotents e) (i : ι) : |
| 108 | fiberIdempotent (partitionFunction he) i = e i := by |
| 109 | apply PrimeSpectrum.basicOpen_injOn_isIdempotentElem |
| 110 | (fiberIdempotent_idem _ _) (he.idem i) |
| 111 | rw [fiberIdempotent_basicOpen] |
| 112 | ext P |
| 113 | exact partitionIndex_eq_iff he P i |
| 114 | |
| 115 | variable (k : Type*) [CommRing k] [Algebra k R] |
| 116 | |
| 117 | /-- A complete orthogonal partition defines evaluation of a finite product algebra. -/ |
| 118 | def partitionAlgHom {e : ι → R} (he : CompleteOrthogonalIdempotents e) : |
| 119 | (ι → k) →ₐ[k] R where |
| 120 | toFun a := ∑ i, algebraMap k R (a i) * e i |
| 121 | map_one' := by simpa only [Pi.one_apply, map_one, one_mul] using he.complete |
| 122 | map_zero' := by simp |
| 123 | map_add' a b := by simp [add_mul, Finset.sum_add_distrib] |
| 124 | map_mul' a b := by |
| 125 | classical |
| 126 | simp only [Pi.mul_apply, map_mul] |
| 127 | symm |
| 128 | calc |
| 129 | (∑ i, algebraMap k R (a i) * e i) * (∑ j, algebraMap k R (b j) * e j) = |
| 130 | ∑ i, ∑ j, (algebraMap k R (a i) * algebraMap k R (b j)) * (e i * e j) := by |
| 131 | rw [Finset.sum_mul] |
| 132 | simp only [Finset.mul_sum] |
| 133 | apply Finset.sum_congr rfl |
| 134 | intro i _ |
| 135 | apply Finset.sum_congr rfl |
| 136 | intro j _ |
| 137 | ring |
| 138 | _ = ∑ i, algebraMap k R (a i) * algebraMap k R (b i) * e i := by |
| 139 | simp only [he.mul_eq, mul_ite, mul_zero, Finset.sum_ite_eq, Finset.mem_univ, ite_true] |
| 140 | commutes' c := by |
| 141 | change (∑ i, algebraMap k R c * e i) = _ |
| 142 | rw [← Finset.mul_sum, he.complete, mul_one] |
| 143 | |
| 144 | theorem partitionAlgHom_single {e : ι → R} (he : CompleteOrthogonalIdempotents e) |
| 145 | [DecidableEq ι] (i : ι) : partitionAlgHom k he (Pi.single i 1) = e i := by |
| 146 | simp [partitionAlgHom, Pi.single_apply] |
| 147 | |
| 148 | /-- An algebra map from a finite product defines a complete orthogonal partition. -/ |
| 149 | theorem algHom_partition [DecidableEq ι] (f : (ι → k) →ₐ[k] R) : |
| 150 | CompleteOrthogonalIdempotents (fun i => f (Pi.single i 1)) := |
| 151 | (CompleteOrthogonalIdempotents.single (fun _ : ι => k)).map f.toRingHom |
| 152 | |
| 153 | /-- Maps from a finite product algebra are determined by its coordinate idempotents. -/ |
| 154 | theorem algHom_ext_single [DecidableEq ι] {f g : (ι → k) →ₐ[k] R} |
| 155 | (h : ∀ i, f (Pi.single i 1) = g (Pi.single i 1)) : f = g := by |
| 156 | apply AlgHom.toLinearMap_injective |
| 157 | apply (Pi.basisFun k ι).ext |
| 158 | intro i |
| 159 | change f ((Pi.basisFun k ι) i) = g ((Pi.basisFun k ι) i) |
| 160 | rw [Pi.basisFun_apply] |
| 161 | exact h i |
| 162 | |
| 163 | /-- Points of a finite constant affine scheme are locally constant functions on the spectrum. -/ |
| 164 | def constantPointsEquiv : ((ι → k) →ₐ[k] R) ≃ LocallyConstant (PrimeSpectrum R) ι := by |
| 165 | classical |
| 166 | exact { |
| 167 | toFun := fun f => partitionFunction (algHom_partition k f) |
| 168 | invFun := fun f => partitionAlgHom k (fiberIdempotent_complete f) |
| 169 | left_inv := fun f => by |
| 170 | apply algHom_ext_single k |
| 171 | intro i |
| 172 | rw [partitionAlgHom_single, fiberIdempotent_partitionFunction] |
| 173 | right_inv := fun f => by |
| 174 | ext P |
| 175 | apply (partitionIndex_eq_iff (algHom_partition k |
| 176 | (partitionAlgHom k (fiberIdempotent_complete f))) P (f P)).mpr |
| 177 | rw [partitionAlgHom_single] |
| 178 | change P ∈ PrimeSpectrum.basicOpen (fiberIdempotent f (f P)) |
| 179 | rw [fiberIdempotent_basicOpen] |
| 180 | rfl } |
| 181 | |
| 182 | /-- The locally constant value is characterized by the corresponding idempotent at the prime. -/ |
| 183 | theorem constantPointsEquiv_eq_iff (f : (ι → k) →ₐ[k] R) |
| 184 | (P : PrimeSpectrum R) (i : ι) : |
| 185 | letI : DecidableEq ι := Classical.decEq ι |
| 186 | constantPointsEquiv k f P = i ↔ f (Pi.single i 1) ∉ P.asIdeal := by |
| 187 | classical |
| 188 | change partitionIndex (algHom_partition k f) P = i ↔ _ |
| 189 | exact partitionIndex_eq_iff (algHom_partition k f) P i |
| 190 | |
| 191 | /-- The finite-constant-scheme equivalence is natural in arbitrary test algebras. -/ |
| 192 | theorem constantPointsEquiv_naturality {S : Type*} [CommRing S] [Algebra k S] |
| 193 | (a : R →ₐ[k] S) (f : (ι → k) →ₐ[k] R) : |
| 194 | constantPointsEquiv k (a.comp f) = |
| 195 | (constantPointsEquiv k f).comap |
| 196 | ⟨PrimeSpectrum.comap a.toRingHom, PrimeSpectrum.continuous_comap _⟩ := by |
| 197 | classical |
| 198 | ext P |
| 199 | apply (constantPointsEquiv_eq_iff k (a.comp f) P _).mpr |
| 200 | have h := (constantPointsEquiv_eq_iff k f (PrimeSpectrum.comap a.toRingHom P) |
| 201 | (constantPointsEquiv k f (PrimeSpectrum.comap a.toRingHom P))).mp rfl |
| 202 | exact h |
| 203 | |
| 204 | end |
| 205 | |
| 206 | end OAI.AlgebraicGeometry.GroupSchemes.ConstantPoints.FiniteEtale |