p; q;
subst(Y/X,X,x)
substvec(x+y,[x,y],[1,x])

\\ #1321
v = [p + w*q, w*p + q] * Mod(1, w + 1);
substvec(x+y, [x, y], v)
\\ #1447
subst(O(x^2),x,0*x)
subst(x+O(x^2),x,Mod(1,3))
subst(x+O(x^2),x,Mod(0,3))
subst(1/x+O(x^2),x,Mod(0,3))
subst(2+x+O(x^2),x,Mod(0,3))
subst(Pol(0),x,Mod(1,3))
subst(Pol(0),x,Mod(1,3)*matid(2))
subst(Pol(1),x,Mod(1,3))
subst(Pol(1),x,Mod(1,3)*matid(2))
subst(y+1,x,Mod(1,3)*matid(2))
subst(1+y+O(y^2),x,Mod(1,3)*matid(2))
subst(1,x,Mod(1,3)*matid(2))
subst(0,x,Mod(1,3)*matid(2))
subst(Pol(0),x,Mat(Mod(1,3)))
subst(Pol(1),x,Mat(Mod(1,3)))
subst(1,x,Mat(Mod(1,3)))
subst(0,x,Mat(Mod(1,3)))

type(subst(Pol(0),'y,1))
type(subst(Pol(0),'x,1))
type(subst(Pol(0),'y,Mod(1,3)))
type(subst('u^0,u,x))
type(subst('x^0,'y,1))
type(subst('x*'y,'y,0))

subst(x+1, x, [2,3])
subst(x+1, x, [2,3]~)
substpol(x,1/x,y)
substpol(Mod(x*y^2, y^3*x^2+1), y^2,y)
substpol(x*y^2/(y^3*x^2+1), y^2,y)
substpol(List(), y^2,y)
substpol(List(x^2*y^2), y^2,y)
substpol(x^2+y^3*x^3+O(x^4),y^2, y)
variables(substpol(x,1/x,t))
variables(substpol(x+1+1/x,x+1/x,t))

subst(1,x,[;])
subst(1,x,Mat([1,2]))
subst(x^2+x^3+O(x^4),x, 2*y+O(y^2))

substpol(1+O(x^2),x^2,x)
substpol(x^2+O(x^4),x^2,x)
substpol(x+O(x^4),x^2,x)
substpol(1,x^2,x)

\\#1727
substvec(1+x+y+x*y+O(x^2), [x,y],[x,y])

subst(Mod(1/z,y),z,x)
\\#1988
subst(Mod(-a,a^2-2),z,0)

subst(((-6*t^2-t)*u^4+(t^2)*u^3+(P)*t^3*u)/u^2,t,0)
