Question: How to replace h251, h252 etc with 0 in this complicated case

g1 := [0, y, x];g2 := [0, y^2-x-y, 0]; g3 := [x, x+y, 0]; g4 := [y, -y, 0]; g5 := [0, x*y+x/2+y/2, 0]; g6 := [0, x^2-x/4-y/4, 0];

g1 := 0; g2 := 0; g3 := x; g4 := y; g5 := 0; g6 := 0;

restart; with(Groebner):

IsNullZero := proc(tau) if assigned(tau) then return tau else return 0 end if end proc;

DoExist := proc(tau, n) if nops(tau) >= n then return tau(n) else return 0 end if end proc;

g1 := y; g2 := y^2-x-y; g3 := x+y; g4 := -y; g5 := x*y+x/2+y/2; g6 := x^2-x/4-y/4;

X1 := `*`(LeadingTerm(g1, tdeg(x, y))); X2 := `*`(LeadingTerm(g2, tdeg(x, y))); X3 := `*`(LeadingTerm(g3, tdeg(x, y))); X4 := `*`(LeadingTerm(g4, tdeg(x, y))); X5 := `*`(LeadingTerm(g5, tdeg(x, y))); X6 := `*`(LeadingTerm(g6, tdeg(x, y)));

X12 := lcm(X1,X2); X13 := lcm(X1,X3); X14 := lcm(X1,X4); X15 := lcm(X1,X5); X16 := lcm(X1,X6); X23 := lcm(X2,X3); X24 := lcm(X2,X4); X25 := lcm(X2,X5); X26 := lcm(X2,X6); X34 := lcm(X3,X4); X35 := lcm(X3,X5); X36 := lcm(X3,X6); X45 := lcm(X4,X5); X46 := lcm(X4,X6); X56 := lcm(X5,X6);

S12 := SPolynomial(g1, g2, lexdeg([x, y])); S13 := SPolynomial(g1, g3, lexdeg([x, y])); S14 := SPolynomial(g1, g4, lexdeg([x, y])); S15 := SPolynomial(g1, g5, lexdeg([x, y])); S16 := SPolynomial(g1, g6, lexdeg([x, y])); S23 := SPolynomial(g2, g3, lexdeg([x, y])); S24 := SPolynomial(g2, g4, lexdeg([x, y])); S25 := SPolynomial(g2, g5, lexdeg([x, y])); S26 := SPolynomial(g2, g6, lexdeg([x, y])); S34 := SPolynomial(g3, g4, lexdeg([x, y])); S35 := SPolynomial(g3, g5, lexdeg([x, y])); S36 := SPolynomial(g3, g6, lexdeg([x, y])); S45 := SPolynomial(g4, g5, lexdeg([x, y])); S46 := SPolynomial(g4, g6, lexdeg([x, y])); S56 := SPolynomial(g5, g6, lexdeg([x, y]));

e1 := Vector([1,0,0,0,0,0]); e2 := Vector([0,1,0,0,0,0]); e3 := Vector([0,0,1,0,0,0]); e4 := Vector([0,0,0,1,0,0]); e5 := Vector([0,0,0,0,1,0]); e6 := Vector([0,0,0,0,0,1]); ***************

eq1:= S25 - expand(h251*g1 + h252*g2 + h253*g3 + h254*g4 + h255*g5 + h256*g6);

NormalForm(eq1, Basis([g1, g2, g3, g4, g5, g6], tdeg(x, y, h251, h252, h253, h254, h255, h256)), tdeg(x, y, h251, h252, h253, h254, h255, h256), 'Q');

s25 := X25/X2*e2-X25/X5*e5-Vector([DoExist(Q,6)+IsNullZero(h251), DoExist(Q,5)+IsNullZero(h252), DoExist(Q,4)+IsNullZero(h253), DoExist(Q,3)+IsNullZero(h254), DoExist(Q,2)+IsNullZero(h255), DoExist(Q,1)+IsNullZero(h256)]); > DoExist(Q, 1); [ 3 1 [-h252(1) y(1) - h255(1) x(1) - - x(1) - - y(1) - h251(1) [ 2 2 1 1 + h252(1) - h253(1) + h254(1) - - h255(1) + - h256(1), 2 4 1 1 -h256(1) x(1) - x(1) + h252(1) - h253(1) - - h255(1) + - h256(1) 2 4 ] ] ] *********** actually h256 etc do not exist or assigned from previous command how to replace them with 0

Please Wait...