eliminate



The eliminate function has some features that I don't like.
I especially don't like the way eliminate sometimes calls solve
(see 'd'). Would it be OK to replace eliminate with a
function that doesn't (try) to solve the last equation? Yes that
could break code.

Also, eliminate uses the first expression that isn't free of the
variable as the 'pivot' (that's linear algebra terminology). I'm
guessing, but it seems that a better method is to choose the pivot
to have the least nonzero degree (in the elimination variable).
I assume there is a great deal known about this ...Also:

(a) eliminate([],[]) signals an error. I think [] is a better answer.
Similarly, eliminate([], [x1, ..., xn]) signals an error; again, I think []
is
a better answer.

(b) Eliminating from a single equation always signals an error; I think
that's
not right:

(%i2) eliminate([a],[b]);
Can't eliminate from only one equation

But you can trick eliminate

(%i3) eliminate([a,a],[b]);
(%o3) [a,a]

(c) eliminate always signals an error when the number
of variables exceeds the number of equations. For
eliminate([x+y,x-y+1],[x,a,b,c,d]) I think [1 - 2 *y]
is a better answer than is

(%i4) eliminate([x+y,x-y+1],[x,a,b,c,d]);
More variables then equations

(d) I'm not in love with the call to solve when the number of equations
equals the number of variables. One objection is that for no good reason,
eliminate returns the last solution -- why not all of them?  Also:

(%i6) trace(solve)$
(%i7) eliminate([x^14+x+1,y+1],[y,x]), solveexplicit  : false;
 1 Enter solve [x^14+x+1,x]
 1 Exit  solve
 [x=-(sqrt(3)*%i+1)/2,x=(sqrt(3)*%i-1)/2,0=x^12-x^11+x^9-x^8+x^6-x^5+x^3-x^2+1]
(%o7) [x^12-x^11+x^9-x^8+x^6-x^5+x^3-x^2+1]

(%i8) eliminate([x^14+x+1,y+1],[y,x]), solveexplicit  : true;
 1 Enter solve [x^14+x+1,x]
 1 Exit  solve [x=-(sqrt(3)*%i+1)/2,x=(sqrt(3)*%i-1)/2]
(%o8) [(sqrt(3)*%i-1)/2]

It's confusing that (%o7) and (%o8) aren't the same.

Barton