Potential contribution from the Gemini and Claude AI about matrices modulo composites

12 views
Skip to first unread message

Georgi Guninski

unread,
8:56 AM (5 hours ago) 8:56 AM
to sage-...@googlegroups.com
Potential contribution from the Gemini and Claude AI about matrices
modulo composites

In our short note [1] I searched for matrix permanent congruences
modulo composites.
Then me and the AIs suspected that derogatory matrices might spoil
automatic identity searches.

Gemini AI suggested testing
`M.characteristic_polynomial()==M.minimal_polynomial()`.
The problem with the methods above are not defined in composite characteristic.

The Gemini AI and the Claude AI suggested two solutions modulo
composites, do they make sense?

```
# If M is defined over Integers(n)
M_ZZ = M.change_ring(ZZ)
# Compute characteristic polynomial over ZZ, then map to Integers(n)
charpoly_mod_n = M_ZZ.characteristic_polynomial().change_ring(Integers(n))
```

```
def is_non_derogatory(M, n=None):
"""
Returns True if matrix M (with integer entries) is non-derogatory.
If a modulus n is provided, it checks modulo the prime factors of n.
"""
if n is not None:
# Get the unique prime factors of your composite modulus
(e.g., [2, 3] for 24)
prime_factors = [p for p, _ in factor(n)]
for p in prime_factors:
M_p = M.change_ring(GF(p))
# Over GF(p) these methods are fully supported
if M_p.minimal_polynomial() != M_p.characteristic_polynomial():
return False
return True
else:
# Fallback: check over the Rational Field QQ
M_QQ = M.change_ring(QQ)
return M_QQ.minimal_polynomial() == M_QQ.characteristic_polynomial()
```

[1] Congruences for the matrix permanent mod 3,4,6
https://www.researchgate.net/publication/408715928_Congruences_for_the_matrix_permanent_mod_3_4_6
Reply all
Reply to author
Forward
0 new messages