next | previous | forward | backward | up | top | index | toc | home

support -- list of variables occuring in a polynomial

Synopsis

Description

i1 : R = QQ[a..g]

o1 = R

o1 : PolynomialRing
i2 : f = a^3+b^2*c+3*f^10*d-1+e-e

         10    3    2
o2 = 3d*f   + a  + b c - 1

o2 : R
i3 : support f

o3 = {a, b, c, d, f}

o3 : List
If the ring is a polynomial ring over another polynomial ring, then the support contains all of the variables, even the ones in the coefficient ring. The ring of each of these is the ring of f.
i4 : A = ZZ[a,b]; B = A[r,s,t]; C = B[x,y,z,w];
i7 : f = (a+r+z+1)^2+y

      2                         2                2
o7 = z  + y + (2r + 2a + 2)z + r  + (2a + 2)r + a  + 2a + 1

o7 : C
i8 : S = support f

o8 = {y, z, r, a}

o8 : List
i9 : ring S_2 === ring f

o9 = true
Here is one way to select only the top level variables.
i10 : select(S, x -> index x < numgens C)

o10 = {y, z}

o10 : List
To obtain a list of the integer indices of the variables one can use either indices(RingElement) or apply index to each variable.
i11 : indices f

o11 = {1, 2, 4, 7}

o11 : List
i12 : apply(support f, index)

o12 = {1, 2, 4, 7}

o12 : List

See also

Ways to use support :