-- -*- M2 -*-

-- The degree of the zero ring element is -infinity, but each vector has
-- an integer degree, so for lack of anything better to do, the degree of
-- 0*Fxx is the same as the degree of Fxx, namely, 0.  If you would write
-- 2*(x*Fxx) instead of 2*x*Fxx (parsing of multiplication is left-to-
-- right), it would "remember" the degree of the zero vector.

-- One way to fix M2 so it works on your code would be to be more serious
-- about R being a graded ring, and to let there be distinct 0-elements
-- of each degree.  Then 2*x would become the 0-element of degree 1.
-- Then we'd have to think about whether r===s and r==s would return the
-- same thing for 0-elements of different degrees.  Feedback on that idea
-- would be welcome.


R = ZZ/2[x,y,z];
F = R^6;
Fzz = F_0;
Fxx = F_1;
Fxy = F_2;
Fxz = F_3;
Fyy = F_4;
Fyz = F_5;
Isym = R*(x*Fxx+y*Fxy+z*Fxz)+R*(x*Fxy+y*Fyy+z*Fyz)+R*(x*Fxz+y*Fyz+z*Fzz);
Idiv = R*(2*x*Fxx+y*Fxy+z*Fxz)+R*(x*Fxy+2*y*Fyy+z*Fyz)+R*(x*Fxz+y*Fyz+2*z*Fzz);
Sym = sheaf (F/Isym);
Div = sheaf (F/Idiv);
