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.LinearAlgebra.FreeModule.Finite.Quotient |
| 2 | import Mathlib.LinearAlgebra.Determinant |
| 3 | import Mathlib.RingTheory.OrderOfVanishing.Basic |
| 4 | import Mathlib.RingTheory.KrullDimension.PID |
| 5 | import Mathlib.Data.ENat.BigOperators |
| 6 | |
| 7 | /-! # Smith Determinant -/ |
| 8 | |
| 9 | namespace OAI.AlgebraicGeometry.IntersectionTheory.ProjectionFormula.SmithDeterminant |
| 10 | |
| 11 | noncomputable section |
| 12 | |
| 13 | /-! The length of a full-rank lattice quotient is the order of the |
| 14 | determinant of its inclusion, first in the actual Smith normal form bases. -/ |
| 15 | |
| 16 | open _root_.Module |
| 17 | open scoped Classical |
| 18 | |
| 19 | universe u v w |
| 20 | |
| 21 | variable (R : Type u) [CommRing R] [IsDomain R] [IsPrincipalIdealRing R] |
| 22 | {M : Type v} [AddCommGroup M] [Module R M] {ι : Type w} [Fintype ι] |
| 23 | |
| 24 | omit [IsPrincipalIdealRing R] [Fintype ι] in |
| 25 | theorem ord_prod (s : Finset ι) (a : ι → R) (ha : ∀ i ∈ s, a i ≠ 0) : |
| 26 | Ring.ord R (∏ i ∈ s, a i) = ∑ i ∈ s, Ring.ord R (a i) := by |
| 27 | induction s using Finset.induction_on with |
| 28 | | empty => simp |
| 29 | | @insert i s hi ih => |
| 30 | rw [Finset.prod_insert hi, Finset.sum_insert hi, |
| 31 | Ring.ord_mul R (mem_nonZeroDivisors_of_ne_zero |
| 32 | (Finset.prod_ne_zero_iff.mpr (fun j hj => ha j (Finset.mem_insert_of_mem hj)))), |
| 33 | ih (fun j hj => ha j (Finset.mem_insert_of_mem hj))] |
| 34 | |
| 35 | theorem quotient_length (N : Submodule R M) (b : Basis ι R M) |
| 36 | (h : Module.finrank R N = Module.finrank R M) : |
| 37 | Module.length R (M ⧸ N) = ∑ i, Ring.ord R (Submodule.smithNormalFormCoeffs b h i) := by |
| 38 | rw [(N.quotientEquivPiSpan b h).length_eq, Module.length_pi_of_fintype] |
| 39 | rfl |
| 40 | |
| 41 | theorem smith_matrix (N : Submodule R M) (b : Basis ι R M) |
| 42 | (h : Module.finrank R N = Module.finrank R M) : |
| 43 | LinearMap.toMatrix (Submodule.smithNormalFormBotBasis b h) |
| 44 | (Submodule.smithNormalFormTopBasis b h) N.subtype = |
| 45 | Matrix.diagonal (Submodule.smithNormalFormCoeffs b h) := by |
| 46 | ext i j |
| 47 | simp only [LinearMap.toMatrix_apply, Submodule.subtype_apply, |
| 48 | Submodule.smithNormalFormBotBasis_def, map_smul, Finsupp.smul_apply, Basis.repr_self] |
| 49 | by_cases hij : i = j |
| 50 | · subst j |
| 51 | simp |
| 52 | · simp [hij] |
| 53 | |
| 54 | theorem quotient_length_smith_det (N : Submodule R M) (b : Basis ι R M) |
| 55 | (h : Module.finrank R N = Module.finrank R M) : |
| 56 | Module.length R (M ⧸ N) = Ring.ord R |
| 57 | (LinearMap.toMatrix (Submodule.smithNormalFormBotBasis b h) |
| 58 | (Submodule.smithNormalFormTopBasis b h) N.subtype).det := by |
| 59 | rw [smith_matrix R N b h, Matrix.det_diagonal, ord_prod, |
| 60 | quotient_length R N b h] |
| 61 | intro i _ |
| 62 | exact Submodule.smithNormalFormCoeffs_ne_zero b h i |
| 63 | |
| 64 | omit [IsDomain R] [IsPrincipalIdealRing R] in |
| 65 | theorem ord_matrix_basis_change {N : Type*} [AddCommGroup N] [Module R N] |
| 66 | (b b' : Basis ι R M) (c c' : Basis ι R N) (f : M →ₗ[R] N) : |
| 67 | Ring.ord R (LinearMap.toMatrix b c f).det = |
| 68 | Ring.ord R (LinearMap.toMatrix b' c' f).det := by |
| 69 | have h : LinearMap.toMatrix b c f = |
| 70 | LinearMap.toMatrix c' c (LinearMap.id : N →ₗ[R] N) * |
| 71 | LinearMap.toMatrix b' c' f * |
| 72 | LinearMap.toMatrix b b' (LinearMap.id : M →ₗ[R] M) := by |
| 73 | rw [← LinearMap.toMatrix_comp, ← LinearMap.toMatrix_comp] |
| 74 | simp |
| 75 | have hb : IsUnit (LinearMap.toMatrix b b' (LinearMap.id : M →ₗ[R] M)).det := |
| 76 | (LinearEquiv.refl R M).isUnit_det b b' |
| 77 | have hc : IsUnit (LinearMap.toMatrix c' c (LinearMap.id : N →ₗ[R] N)).det := |
| 78 | (LinearEquiv.refl R N).isUnit_det c' c |
| 79 | rw [h, Matrix.det_mul, Matrix.det_mul, |
| 80 | Ring.ord_mul_of_isUnit_right hb, Ring.ord_mul_of_isUnit_left hc] |
| 81 | |
| 82 | theorem quotient_length_det (N : Submodule R M) (b : Basis ι R M) |
| 83 | (c : Basis ι R N) : |
| 84 | Module.length R (M ⧸ N) = Ring.ord R (LinearMap.toMatrix c b N.subtype).det := by |
| 85 | have h : Module.finrank R N = Module.finrank R M := by |
| 86 | rw [Module.finrank_eq_card_basis c, Module.finrank_eq_card_basis b] |
| 87 | rw [quotient_length_smith_det R N b h, |
| 88 | ord_matrix_basis_change R (Submodule.smithNormalFormBotBasis b h) c |
| 89 | (Submodule.smithNormalFormTopBasis b h) b] |
| 90 | |
| 91 | theorem cokernel_length_matrix {N : Type*} [AddCommGroup N] [Module R N] |
| 92 | (b : Basis ι R M) (c : Basis ι R N) (f : M →ₗ[R] N) |
| 93 | (hf : Function.Injective f) : |
| 94 | Module.length R (N ⧸ f.range) = Ring.ord R (LinearMap.toMatrix b c f).det := by |
| 95 | let e := LinearEquiv.ofInjective f hf |
| 96 | let b' := b.map e |
| 97 | have he : LinearMap.toMatrix b' c f.range.subtype = LinearMap.toMatrix b c f := by |
| 98 | ext i j |
| 99 | simp [LinearMap.toMatrix_apply, b', e] |
| 100 | rw [quotient_length_det R f.range c b', he] |
| 101 | |
| 102 | theorem cokernel_length_det (b : Basis ι R M) (f : M →ₗ[R] M) |
| 103 | (hf : Function.Injective f) : |
| 104 | Module.length R (M ⧸ f.range) = Ring.ord R f.det := by |
| 105 | rw [cokernel_length_matrix R b b f hf, LinearMap.det_toMatrix] |
| 106 | |
| 107 | theorem quotient_length_ne_top (N : Submodule R M) (b : Basis ι R M) |
| 108 | (c : Basis ι R N) : Module.length R (M ⧸ N) ≠ ⊤ := by |
| 109 | have h : Module.finrank R N = Module.finrank R M := by |
| 110 | rw [Module.finrank_eq_card_basis c, Module.finrank_eq_card_basis b] |
| 111 | rw [quotient_length R N b h] |
| 112 | apply ENat.sum_ne_top.mpr |
| 113 | intro i _ |
| 114 | exact Ring.ord_ne_top (mem_nonZeroDivisors_of_ne_zero |
| 115 | (Submodule.smithNormalFormCoeffs_ne_zero b h i)) |
| 116 | |
| 117 | theorem cokernel_length_ne_top {N : Type*} [AddCommGroup N] [Module R N] |
| 118 | (b : Basis ι R M) (c : Basis ι R N) (f : M →ₗ[R] N) |
| 119 | (hf : Function.Injective f) : Module.length R (N ⧸ f.range) ≠ ⊤ := |
| 120 | quotient_length_ne_top R f.range c (b.map (LinearEquiv.ofInjective f hf)) |
| 121 | |
| 122 | end |
| 123 | |
| 124 | end OAI.AlgebraicGeometry.IntersectionTheory.ProjectionFormula.SmithDeterminant |