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.Algebra.MvPolynomial.Degrees |
| 2 | import Mathlib.Data.Finsupp.ToDFinsupp |
| 3 | import Mathlib.Algebra.BigOperators.Ring.Finset |
| 4 | |
| 5 | /-! # Laurent Exponents -/ |
| 6 | |
| 7 | namespace OAI.AlgebraicGeometry.HilbertScheme.Presentations.LaurentExponents.ProjectiveCech |
| 8 | |
| 9 | noncomputable section |
| 10 | |
| 11 | /-! |
| 12 | Exponent bookkeeping for principal polynomial localizations. Negative |
| 13 | exponents are allowed precisely in the inverted variables, and a common |
| 14 | power of their product clears every denominator. |
| 15 | -/ |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | variable {σ : Type u} [Fintype σ] [DecidableEq σ] |
| 20 | |
| 21 | def inversionExponent (s : Finset σ) : σ →₀ ℕ := ∑ i ∈ s, Finsupp.single i 1 |
| 22 | |
| 23 | omit [Fintype σ] in |
| 24 | theorem inversionExponent_apply (s : Finset σ) (i : σ) : |
| 25 | inversionExponent s i = if i ∈ s then 1 else 0 := by |
| 26 | classical |
| 27 | simp [inversionExponent, Finsupp.single_apply] |
| 28 | |
| 29 | abbrev LaurentExponent (s : Finset σ) := {a : σ → ℤ // ∀ i ∉ s, 0 ≤ a i} |
| 30 | |
| 31 | def denominatorBound {s : Finset σ} (a : LaurentExponent s) : ℕ := ∑ i, (-a.val i).toNat |
| 32 | |
| 33 | omit [DecidableEq σ] in |
| 34 | theorem neg_exponent_le_bound {s : Finset σ} (a : LaurentExponent s) (i : σ) : |
| 35 | -a.val i ≤ (denominatorBound a : ℤ) := by |
| 36 | have h : (-a.val i).toNat ≤ denominatorBound a := by |
| 37 | change (-a.val i).toNat ≤ ∑ j, (-a.val j).toNat |
| 38 | exact Finset.single_le_sum (f := fun j : σ => (-a.val j).toNat) |
| 39 | (fun _ _ => Nat.zero_le _) (Finset.mem_univ i) |
| 40 | have h' : ((-a.val i).toNat : ℤ) ≤ (denominatorBound a : ℤ) := by exact_mod_cast h |
| 41 | omega |
| 42 | |
| 43 | theorem clearedExponent_nonnegative {s : Finset σ} (a : LaurentExponent s) |
| 44 | (k : ℕ) (hk : denominatorBound a ≤ k) (i : σ) : |
| 45 | 0 ≤ a.val i + (k : ℤ) * (inversionExponent s i : ℤ) := by |
| 46 | rw [inversionExponent_apply] |
| 47 | by_cases hi : i ∈ s |
| 48 | · simp only [ite_eq_left hi, Nat.cast_one, mul_one] |
| 49 | have h := neg_exponent_le_bound a i |
| 50 | have hk' : (denominatorBound a : ℤ) ≤ k := by exact_mod_cast hk |
| 51 | omega |
| 52 | · simpa only [ite_eq_right hi, Nat.cast_zero, mul_zero, add_zero] using a.property i hi |
| 53 | |
| 54 | def numeratorExponent {s : Finset σ} (a : LaurentExponent s) (k : ℕ) : σ →₀ ℕ := |
| 55 | Finsupp.equivFunOnFinite.symm (fun i => (a.val i + (k : ℤ) * (inversionExponent s i : ℤ)).toNat) |
| 56 | |
| 57 | omit [DecidableEq σ] in |
| 58 | theorem numeratorExponent_cast_of_nonnegative {s : Finset σ} (a : LaurentExponent s) (k : ℕ) |
| 59 | (hk : ∀ i, 0 ≤ a.val i + (k : ℤ) * (inversionExponent s i : ℤ)) (i : σ) : |
| 60 | (numeratorExponent a k i : ℤ) = a.val i + (k : ℤ) * (inversionExponent s i : ℤ) := |
| 61 | Int.toNat_of_nonneg (hk i) |
| 62 | |
| 63 | theorem numeratorExponent_cast {s : Finset σ} (a : LaurentExponent s) (k : ℕ) |
| 64 | (hk : denominatorBound a ≤ k) (i : σ) : |
| 65 | (numeratorExponent a k i : ℤ) = a.val i + (k : ℤ) * (inversionExponent s i : ℤ) := |
| 66 | Int.toNat_of_nonneg (clearedExponent_nonnegative a k hk i) |
| 67 | |
| 68 | omit [DecidableEq σ] in |
| 69 | theorem numeratorExponent_balance_of_nonnegative {s : Finset σ} (a : LaurentExponent s) |
| 70 | (k l : ℕ) |
| 71 | (hk : ∀ i, 0 ≤ a.val i + (k : ℤ) * (inversionExponent s i : ℤ)) |
| 72 | (hl : ∀ i, 0 ≤ a.val i + (l : ℤ) * (inversionExponent s i : ℤ)) : |
| 73 | numeratorExponent a k + l • inversionExponent s = numeratorExponent a l + k • inversionExponent s := by |
| 74 | ext i |
| 75 | simp only [Finsupp.add_apply, Finsupp.smul_apply, smul_eq_mul] |
| 76 | have h : (numeratorExponent a k i : ℤ) + (l : ℤ) * (inversionExponent s i : ℤ) = |
| 77 | (numeratorExponent a l i : ℤ) + (k : ℤ) * (inversionExponent s i : ℤ) := by |
| 78 | rw [numeratorExponent_cast_of_nonnegative a k hk, numeratorExponent_cast_of_nonnegative a l hl] |
| 79 | ring |
| 80 | exact_mod_cast h |
| 81 | |
| 82 | theorem numeratorExponent_balance {s : Finset σ} (a : LaurentExponent s) |
| 83 | (k l : ℕ) (hk : denominatorBound a ≤ k) (hl : denominatorBound a ≤ l) : |
| 84 | numeratorExponent a k + l • inversionExponent s = numeratorExponent a l + k • inversionExponent s := by |
| 85 | ext i |
| 86 | simp only [Finsupp.add_apply, Finsupp.smul_apply, smul_eq_mul] |
| 87 | have h : (numeratorExponent a k i : ℤ) + (l : ℤ) * (inversionExponent s i : ℤ) = |
| 88 | (numeratorExponent a l i : ℤ) + (k : ℤ) * (inversionExponent s i : ℤ) := by |
| 89 | rw [numeratorExponent_cast a k hk, numeratorExponent_cast a l hl] |
| 90 | ring |
| 91 | exact_mod_cast h |
| 92 | |
| 93 | theorem numeratorExponent_injective {s : Finset σ} (a b : LaurentExponent s) |
| 94 | (k : ℕ) (ha : denominatorBound a ≤ k) (hb : denominatorBound b ≤ k) |
| 95 | (h : numeratorExponent a k = numeratorExponent b k) : a = b := by |
| 96 | apply Subtype.ext |
| 97 | funext i |
| 98 | have hi := congrArg (fun f : σ →₀ ℕ => (f i : ℤ)) h |
| 99 | rw [numeratorExponent_cast a k ha, numeratorExponent_cast b k hb] at hi |
| 100 | exact add_right_cancel hi |
| 101 | |
| 102 | def exponentOfNumerator (s : Finset σ) (d : σ →₀ ℕ) (k : ℕ) : LaurentExponent s := |
| 103 | ⟨fun i => (d i : ℤ) - (k : ℤ) * (inversionExponent s i : ℤ), by |
| 104 | intro i hi |
| 105 | change 0 ≤ (d i : ℤ) - (k : ℤ) * (inversionExponent s i : ℤ) |
| 106 | rw [inversionExponent_apply, ite_eq_right hi, Nat.cast_zero, mul_zero, sub_zero] |
| 107 | exact Int.natCast_nonneg _⟩ |
| 108 | |
| 109 | omit [Fintype σ] in |
| 110 | theorem exponentOfNumerator_clear (s : Finset σ) (d : σ →₀ ℕ) (k : ℕ) (i : σ) : |
| 111 | 0 ≤ (exponentOfNumerator s d k).val i + (k : ℤ) * (inversionExponent s i : ℤ) := by |
| 112 | change 0 ≤ (d i : ℤ) - (k : ℤ) * (inversionExponent s i : ℤ) + |
| 113 | (k : ℤ) * (inversionExponent s i : ℤ) |
| 114 | rw [sub_add_cancel] |
| 115 | exact Int.natCast_nonneg _ |
| 116 | |
| 117 | theorem numeratorExponent_exponentOfNumerator (s : Finset σ) (d : σ →₀ ℕ) (k : ℕ) : |
| 118 | numeratorExponent (exponentOfNumerator s d k) k = d := by |
| 119 | ext i |
| 120 | change Int.toNat ((d i : ℤ) - (k : ℤ) * (inversionExponent s i : ℤ) + |
| 121 | (k : ℤ) * (inversionExponent s i : ℤ)) = d i |
| 122 | rw [sub_add_cancel, Int.toNat_natCast] |
| 123 | |
| 124 | end |
| 125 | |
| 126 | end OAI.AlgebraicGeometry.HilbertScheme.Presentations.LaurentExponents.ProjectiveCech |