algebraic_checks.py

back to table · edit · history · where entries came from · files · download

713 bytes, as of the version from 2026-11-09 14:49 (current). Recorded here, not run.

"""Universal local-factor identities used in the prose of T690.
Run: sage -python algebraic_checks.py
"""
import numberdb.sage as numberdb
from sage.rings.integer_ring import ZZ
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
R=PolynomialRing(ZZ, names=('u','v','T'))
u,v,T=R.gens()
a=u+v;B=u*v;A=a*a-B
P=(1-u*u*T)*(1-B*T)*(1-v*v*T)
assert P==1-A*T+B*A*T*T-B**3*T**3
assert P*(1-B*T)==(1-u*u*T)*(1-u*v*T)**2*(1-v*v*T)
# Clear denominators in P(T/B) and in (1-(u/v)T)(1-T)(1-(v/u)T).
assert ((B-u*u*T)*(B-B*T)*(B-v*v*T)
        == B**2*(v-u*T)*(1-T)*(u-v*T))
print('Universal symmetric-square cubic, tensor-square factorization and adjoint shift: exact polynomial identities passed.')