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.AbelianScheme.TateComparison.PadicResidueLimit |
| 2 | import Mathlib.LinearAlgebra.Matrix.ToLinearEquiv |
| 3 | import Mathlib.LinearAlgebra.PerfectPairing.Basic |
| 4 | |
| 5 | /-! # Padic Pairing Perfection -/ |
| 6 | |
| 7 | namespace OAI.AlgebraicGeometry.AbelianScheme.TateComparison.PadicPairingPerfection |
| 8 | |
| 9 | noncomputable section |
| 10 | |
| 11 | section |
| 12 | |
| 13 | /-! A finite free integral p-adic pairing is perfect once its matrix |
| 14 | is nonsingular modulo p. This lifts finite-level perfection without |
| 15 | assuming an integral dual-lattice identity. -/ |
| 16 | |
| 17 | variable (q : ℕ) [Fact q.Prime] |
| 18 | |
| 19 | theorem padic_isUnit_of_residue_ne_zero (x : ℤ_[q]) (hx : PadicInt.toZMod x ≠ 0) : IsUnit x := by |
| 20 | by_contra h |
| 21 | apply hx |
| 22 | apply RingHom.mem_ker.mp |
| 23 | rw [PadicInt.ker_toZMod, IsLocalRing.mem_maximalIdeal, mem_nonunits_iff] |
| 24 | exact h |
| 25 | |
| 26 | variable {I : Type*} [Fintype I] [DecidableEq I] |
| 27 | |
| 28 | theorem padic_matrix_det_unit_of_residue (M : Matrix I I ℤ_[q]) |
| 29 | (h : ((PadicInt.toZMod (p := q)).mapMatrix M).det ≠ 0) : IsUnit M.det := by |
| 30 | apply padic_isUnit_of_residue_ne_zero q |
| 31 | exact (PadicInt.toZMod (p := q)).map_det M ▸ h |
| 32 | |
| 33 | section LinearMap |
| 34 | variable {R V W : Type*} [CommRing R] |
| 35 | [AddCommGroup V] [Module R V] [AddCommGroup W] [Module R W] |
| 36 | |
| 37 | theorem linearMap_bijective_of_unit_matrix |
| 38 | (bV : Module.Basis I R V) (bW : Module.Basis I R W) (f : V →ₗ[R] W) |
| 39 | (hf : IsUnit (LinearMap.toMatrix bV bW f).det) : Function.Bijective f := by |
| 40 | let M := LinearMap.toMatrix bV bW f |
| 41 | let g := Matrix.toLin bW bV M⁻¹ |
| 42 | have hfg : f.comp g = LinearMap.id := by |
| 43 | rw [← Matrix.toLin_toMatrix bV bW f] |
| 44 | change (Matrix.toLin bV bW M).comp (Matrix.toLin bW bV M⁻¹) = _ |
| 45 | rw [← Matrix.toLin_mul bW bV bW, Matrix.mul_nonsing_inv M hf, Matrix.toLin_one] |
| 46 | have hgf : g.comp f = LinearMap.id := by |
| 47 | rw [← Matrix.toLin_toMatrix bV bW f] |
| 48 | change (Matrix.toLin bW bV M⁻¹).comp (Matrix.toLin bV bW M) = _ |
| 49 | rw [← Matrix.toLin_mul bV bW bV, Matrix.nonsing_inv_mul M hf, Matrix.toLin_one] |
| 50 | have hleft : Function.LeftInverse g f := fun x => LinearMap.congr_fun hgf x |
| 51 | have hright : Function.RightInverse g f := fun x => LinearMap.congr_fun hfg x |
| 52 | exact ⟨hleft.injective, hright.surjective⟩ |
| 53 | |
| 54 | end LinearMap |
| 55 | |
| 56 | variable {V W : Type*} [AddCommGroup V] [Module ℤ_[q] V] |
| 57 | [AddCommGroup W] [Module ℤ_[q] W] |
| 58 | |
| 59 | theorem padic_pairing_perfect_of_residue_det |
| 60 | (bV : Module.Basis I ℤ_[q] V) (bW : Module.Basis I ℤ_[q] W) |
| 61 | (B : V →ₗ[ℤ_[q]] W →ₗ[ℤ_[q]] ℤ_[q]) |
| 62 | (h : ((PadicInt.toZMod (p := q)).mapMatrix (LinearMap.toMatrix bV bW.dualBasis B)).det ≠ 0) : |
| 63 | B.IsPerfPair := by |
| 64 | have : Module.Free ℤ_[q] W := Module.Free.of_basis bW |
| 65 | have : Module.Finite ℤ_[q] W := Module.Finite.of_basis bW |
| 66 | exact LinearMap.IsPerfPair.of_bijective B |
| 67 | (linearMap_bijective_of_unit_matrix bV bW.dualBasis B |
| 68 | (padic_matrix_det_unit_of_residue q _ h)) |
| 69 | |
| 70 | end |
| 71 | |
| 72 | /-! Detection modulo q forces a square integral p-adic pairing matrix |
| 73 | to have unit determinant, hence gives an actual perfect pairing. -/ |
| 74 | |
| 75 | open scoped BigOperators |
| 76 | |
| 77 | variable (q : ℕ) [Fact q.Prime] {I : Type*} [Fintype I] [DecidableEq I] |
| 78 | {V W : Type*} [AddCommGroup V] [Module ℤ_[q] V] [AddCommGroup W] [Module ℤ_[q] W] |
| 79 | |
| 80 | theorem padic_matrix_residue_det_ne_zero_of_kernel |
| 81 | (bV : Module.Basis I ℤ_[q] V) (bW : Module.Basis I ℤ_[q] W) (f : V →ₗ[ℤ_[q]] W) |
| 82 | (hf : ∀ x, (∀ i, PadicInt.toZMod (bW.repr (f x) i) = 0) → ∃ y, (q : ℤ_[q]) • y = x) : |
| 83 | ((PadicInt.toZMod (p := q)).mapMatrix (LinearMap.toMatrix bV bW f)).det ≠ 0 := by |
| 84 | intro hdet |
| 85 | let M := LinearMap.toMatrix bV bW f |
| 86 | let r := PadicInt.toZMod (p := q) |
| 87 | obtain ⟨a, ha, hMa⟩ := (Matrix.exists_mulVec_eq_zero_iff (M := r.mapMatrix M)).mpr hdet |
| 88 | let c : I → ℤ_[q] := fun i => (a i).val |
| 89 | have hc (i : I) : r (c i) = a i := by |
| 90 | exact (map_natCast r (a i).val).trans (ZMod.natCast_zmod_val (a i)) |
| 91 | let x := bV.equivFun.symm c |
| 92 | have hx : (bV.repr x : I → ℤ_[q]) = c := bV.equivFun.apply_symm_apply c |
| 93 | have hfx : (bW.repr (f x) : I → ℤ_[q]) = M.mulVec c := by |
| 94 | rw [← LinearMap.toMatrix_mulVec_repr bV bW f x, hx] |
| 95 | have hzero (i : I) : r (bW.repr (f x) i) = 0 := by |
| 96 | rw [congrFun hfx i, RingHom.map_mulVec] |
| 97 | have hrc : r ∘ c = a := funext hc |
| 98 | rw [hrc] |
| 99 | exact congrFun hMa i |
| 100 | obtain ⟨y, hy⟩ := hf x hzero |
| 101 | apply ha |
| 102 | funext i |
| 103 | have hci : c i = (q : ℤ_[q]) * bV.repr y i := by |
| 104 | rw [← congrFun hx i, ← hy, map_smul] |
| 105 | rfl |
| 106 | exact (hc i).symm.trans (by |
| 107 | rw [hci, map_mul, map_natCast, ZMod.natCast_self, zero_mul] |
| 108 | rfl) |
| 109 | |
| 110 | theorem padic_pairing_perfect_of_reduction_detection |
| 111 | (bV : Module.Basis I ℤ_[q] V) (bW : Module.Basis I ℤ_[q] W) |
| 112 | (B : V →ₗ[ℤ_[q]] W →ₗ[ℤ_[q]] ℤ_[q]) |
| 113 | (hB : ∀ x, (∀ y, PadicInt.toZMod (B x y) = 0) → ∃ z, (q : ℤ_[q]) • z = x) : |
| 114 | B.IsPerfPair := by |
| 115 | apply padic_pairing_perfect_of_residue_det q bV bW B |
| 116 | apply padic_matrix_residue_det_ne_zero_of_kernel q bV bW.dualBasis B |
| 117 | intro x hx |
| 118 | apply hB x |
| 119 | intro y |
| 120 | have hbase (i : I) : PadicInt.toZMod (B x (bW i)) = 0 := by |
| 121 | simpa only [Module.Basis.dualBasis_repr] using hx i |
| 122 | rw [← bW.sum_repr y, map_sum, map_sum] |
| 123 | apply Finset.sum_eq_zero |
| 124 | intro i _ |
| 125 | rw [map_smul] |
| 126 | change PadicInt.toZMod (bW.repr y i * B x (bW i)) = 0 |
| 127 | rw [map_mul, hbase, mul_zero] |
| 128 | |
| 129 | end |
| 130 | |
| 131 | end OAI.AlgebraicGeometry.AbelianScheme.TateComparison.PadicPairingPerfection |