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 OAI.AlgebraicGeometry.HilbertScheme.Presentations.Hilbert.MonomialBasis |
| 2 | import Mathlib.Data.Finsupp.Multiset |
| 3 | import Mathlib.Data.Sym.NatCard |
| 4 | import Mathlib.Combinatorics.Enumerative.InclusionExclusion |
| 5 | import Mathlib.RingTheory.Polynomial.HilbertPoly |
| 6 | |
| 7 | /-! # Existence -/ |
| 8 | |
| 9 | namespace OAI.AlgebraicGeometry.HilbertScheme.Presentations.Hilbert.Existence.GradedHilbert |
| 10 | |
| 11 | noncomputable section |
| 12 | |
| 13 | /-! |
| 14 | Existence of Hilbert polynomials for the graded coordinate quotients. |
| 15 | For a monomial ideal, inclusion-exclusion counts the standard monomials |
| 16 | using the least common multiples of subsets of the generators. The |
| 17 | initial-ideal comparison extends this to every homogeneous ideal. |
| 18 | -/ |
| 19 | |
| 20 | open _root_.MvPolynomial |
| 21 | open scoped BigOperators |
| 22 | |
| 23 | universe u |
| 24 | |
| 25 | abbrev DegreeExponents (n d : ℕ) := {a : Fin (n + 1) →₀ ℕ // a.degree = d} |
| 26 | |
| 27 | theorem card_degreeExponents (n d : ℕ) : |
| 28 | Nat.card (DegreeExponents n d) = (d + n).choose n := by |
| 29 | have e : Sym (Fin (n + 1)) d ≃ DegreeExponents n d := Sym.equivNatSum _ _ |
| 30 | rw [← Nat.card_congr e, Sym.natCard_sym_eq_choose, Nat.card_fin] |
| 31 | have hnum : n + 1 + d - 1 = d + n := by omega |
| 32 | rw [hnum] |
| 33 | simpa only [Nat.add_sub_cancel_right] using Nat.choose_symm (Nat.le_add_left n d) |
| 34 | |
| 35 | def degreeConeEquiv (n d : ℕ) (b : Fin (n + 1) →₀ ℕ) (hb : b.degree ≤ d) : |
| 36 | {a : Fin (n + 1) →₀ ℕ // a.degree = d ∧ b ≤ a} ≃ DegreeExponents n (d - b.degree) where |
| 37 | toFun a := ⟨a.val - b, by |
| 38 | have h := congrArg Finsupp.degree (tsub_add_cancel_of_le a.property.2) |
| 39 | rw [map_add, a.property.1] at h |
| 40 | omega⟩ |
| 41 | invFun c := ⟨c.val + b, by |
| 42 | rw [map_add, c.property] |
| 43 | exact Nat.sub_add_cancel hb, le_add_self⟩ |
| 44 | left_inv a := Subtype.ext (tsub_add_cancel_of_le a.property.2) |
| 45 | right_inv c := Subtype.ext (add_tsub_cancel_right c.val b) |
| 46 | |
| 47 | theorem card_degreeCone (n d : ℕ) (b : Fin (n + 1) →₀ ℕ) (hb : b.degree ≤ d) : |
| 48 | Nat.card {a : Fin (n + 1) →₀ ℕ // a.degree = d ∧ b ≤ a} = |
| 49 | (d - b.degree + n).choose n := by |
| 50 | rw [Nat.card_congr (degreeConeEquiv n d b hb), card_degreeExponents] |
| 51 | |
| 52 | theorem card_degree_finset {n d : ℕ} (F : Finset (DegreeExponents n d)) |
| 53 | (p : (Fin (n + 1) →₀ ℕ) → Prop) (hF : ∀ a : DegreeExponents n d, a ∈ F ↔ p a.val) : |
| 54 | F.card = Nat.card {a : Fin (n + 1) →₀ ℕ // a.degree = d ∧ p a} := by |
| 55 | let e : F ≃ {a : Fin (n + 1) →₀ ℕ // a.degree = d ∧ p a} := |
| 56 | { toFun a := ⟨a.val.val, a.val.property, (hF a.val).mp a.property⟩ |
| 57 | invFun a := ⟨⟨a.val, a.property.1⟩, (hF _).mpr a.property.2⟩ |
| 58 | left_inv _ := rfl |
| 59 | right_inv _ := rfl } |
| 60 | simpa only [Nat.card_eq_fintype_card, Fintype.card_coe] using Nat.card_congr e |
| 61 | |
| 62 | def monomialHilbertPolynomial {n : ℕ} (G : Finset (Fin (n + 1) →₀ ℕ)) : Polynomial ℚ := |
| 63 | ∑ t ∈ G.powerset, (-1 : ℚ) ^ t.card • Polynomial.preHilbertPoly ℚ n (t.sup id).degree |
| 64 | |
| 65 | theorem card_standard_eventually_polynomial {n : ℕ} |
| 66 | (G : Finset (Fin (n + 1) →₀ ℕ)) (d : ℕ) (hd : (G.sup id).degree ≤ d) : |
| 67 | (Nat.card {a : Fin (n + 1) →₀ ℕ // a.degree = d ∧ ∀ b ∈ G, ¬ b ≤ a} : ℚ) = |
| 68 | (monomialHilbertPolynomial G).eval (d : ℚ) := by |
| 69 | classical |
| 70 | let : Fintype (DegreeExponents n d) := (Finsupp.finite_of_degree_eq (σ := Fin (n + 1)) d).fintype |
| 71 | let C (b : Fin (n + 1) →₀ ℕ) : Finset (DegreeExponents n d) := |
| 72 | Finset.univ.filter (fun a => b ≤ a.val) |
| 73 | have havoid : (G.inf (fun b => (C b)ᶜ)).card = |
| 74 | Nat.card {a : Fin (n + 1) →₀ ℕ // a.degree = d ∧ ∀ b ∈ G, ¬ b ≤ a} := by |
| 75 | apply card_degree_finset |
| 76 | intro a |
| 77 | simp [C, Finset.mem_inf] |
| 78 | have hcone (t : Finset (Fin (n + 1) →₀ ℕ)) : (t.inf C).card = |
| 79 | Nat.card {a : Fin (n + 1) →₀ ℕ // a.degree = d ∧ t.sup id ≤ a} := by |
| 80 | apply card_degree_finset |
| 81 | intro a |
| 82 | simp [C, Finset.mem_inf, Finset.sup_le_iff] |
| 83 | have hbound (t : Finset (Fin (n + 1) →₀ ℕ)) (ht : t ∈ G.powerset) : |
| 84 | (t.sup id).degree ≤ d := by |
| 85 | apply le_trans (Finsupp.degree_mono ?_) hd |
| 86 | apply Finset.sup_le |
| 87 | intro a ha |
| 88 | exact Finset.le_sup (f := id) ((Finset.mem_powerset.mp ht) ha) |
| 89 | have hie : (Nat.card {a : Fin (n + 1) →₀ ℕ // |
| 90 | a.degree = d ∧ ∀ b ∈ G, ¬ b ≤ a} : ℚ) = |
| 91 | ∑ t ∈ G.powerset, (-1 : ℚ) ^ t.card * ((t.inf C).card : ℚ) := by |
| 92 | rw [← havoid] |
| 93 | exact_mod_cast Finset.inclusion_exclusion_card_inf_compl G C |
| 94 | rw [hie] |
| 95 | simp only [monomialHilbertPolynomial, Polynomial.eval_finsetSum, Polynomial.eval_smul, |
| 96 | smul_eq_mul] |
| 97 | apply Finset.sum_congr rfl |
| 98 | intro t ht |
| 99 | rw [hcone, card_degreeCone n d (t.sup id) (hbound t ht), |
| 100 | Polynomial.preHilbertPoly_eq_choose_add_sub ℚ n ((hbound t ht).trans (Nat.le_add_right d n))] |
| 101 | rw [Nat.sub_add_comm (hbound t ht)] |
| 102 | |
| 103 | theorem monomialSpan_hasHilbertPolynomial {K : Type u} [Field K] {n : ℕ} |
| 104 | (G : Finset (Fin (n + 1) →₀ ℕ)) : |
| 105 | Hilbert.Polynomial.GradedHilbert.HasHilbertPolynomial (MonomialBasis.GradedHilbert.monomialSpan K (G : Set (Fin (n + 1) →₀ ℕ))).toIdeal |
| 106 | (monomialHilbertPolynomial G) := by |
| 107 | refine ⟨(G.sup id).degree, fun d hd => ?_⟩ |
| 108 | rw [MonomialBasis.GradedHilbert.hilbertFunction_monomialSpan] |
| 109 | exact card_standard_eventually_polynomial G d hd |
| 110 | |
| 111 | /-- Every homogeneous coordinate ideal has a Hilbert polynomial, defined |
| 112 | using the actual dimensions of its graded quotients. -/ |
| 113 | theorem exists_hilbertPolynomial {K : Type u} [Field K] {n : ℕ} |
| 114 | (I : HomogeneousIdeal (Hilbert.Polynomial.GradedHilbert.grading K n)) : |
| 115 | ∃ P : Polynomial ℚ, Hilbert.Polynomial.GradedHilbert.HasHilbertPolynomial I.toIdeal P := by |
| 116 | let m : MonomialOrder (Fin (n + 1)) := MonomialOrder.lex |
| 117 | obtain ⟨G, hG⟩ := (InitialIdeal.GradedHilbert.initialIdeal_isMonomial m I.toIdeal).finite_generators |
| 118 | refine ⟨monomialHilbertPolynomial G, (InitialIdeal.GradedHilbert.hasHilbertPolynomial_initialIdeal_iff m I _).mp ?_⟩ |
| 119 | rw [hG] |
| 120 | exact monomialSpan_hasHilbertPolynomial G |
| 121 | |
| 122 | theorem existsUnique_hilbertPolynomial {K : Type u} [Field K] {n : ℕ} |
| 123 | (I : HomogeneousIdeal (Hilbert.Polynomial.GradedHilbert.grading K n)) : |
| 124 | ∃! P : Polynomial ℚ, Hilbert.Polynomial.GradedHilbert.HasHilbertPolynomial I.toIdeal P := by |
| 125 | obtain ⟨P, hP⟩ := exists_hilbertPolynomial I |
| 126 | exact ⟨P, hP, fun _ hQ => Hilbert.Polynomial.GradedHilbert.hilbertPolynomial_unique hQ hP⟩ |
| 127 | |
| 128 | end |
| 129 | |
| 130 | end OAI.AlgebraicGeometry.HilbertScheme.Presentations.Hilbert.Existence.GradedHilbert |