Group Abstract Group Abstract

Message Boards Message Boards

Eliminate produced redundant equations?

Posted 9 years ago
POSTED BY: Daniel Huber
18 Replies

That rewrite requires that the a and b variables be regarded as parameters rather than algebraic variables. Which might or might not be what was intended.

POSTED BY: Daniel Lichtblau

Yes! a and b are regarded as the coefficients!

But Eliminate does not know which are to be regarded as coefficients and which as variables. So this matrix approach is not a faithful representation of the actual elimination.

POSTED BY: Daniel Lichtblau
Posted 9 years ago

Can you explain this in more details. The rank of this matrix is 5. If we use up 3 equation by the elimination we are left with 2 not 3.

POSTED BY: Daniel Huber

I apologize for being so late.

The rank of the matrix is 5.

In[35]:= MatrixRank[{{1, 0, 0, -1, 0, 0}, {0, 1, 0, 0, -1, 0}, {0, 0, 
   1, 0, 0, -1}, {a1, a2, a3, 0, 0, 0}, {b1, b2, b3, 0, 0, 0}}]

Out[35]= 5

Excellent! This gives an explanation that the dimension of the set of solutions of eq2 is equal to 1 (6-5 : the number of variables minus the rank of the matrix).

So we can apply now eliminate:

In[36]:= Eliminate[eq2, {z1, z2, z3, u3}]

Out[36]= a3 b1 u1 + a3 b2 u2 - a2 b3 u2 == a1 b3 u1

More the more, we can apply Solve[]:

In[37]:= Solve[eq2, {u1, u2, u3, z1, z2, z3}]

During evaluation of In[36]:= Solve::svars: Equations may not give solutions for all "solve" variables.

Out[37]= {{u2 -> -(((a3 b1 - a1 b3) u1)/(a3 b2 - a2 b3)), 
  u3 -> -1 - ((-a2 b1 + a1 b2) u1)/(a3 b2 - a2 b3), z1 -> u1, 
  z2 -> -(((a3 b1 - a1 b3) u1)/(a3 b2 - a2 b3)), 
  z3 -> -(((-a2 b1 + a1 b2) u1)/(a3 b2 - a2 b3))}}

Both from Eliminate[] and Solve[] we obtain the same result relative to the dimension of the set of the solutions. It's equal to 1.

Additionally, we can apply Solve[] to the initial system:

In[38]:= Solve[{a1 u1 + a2 u2 + a3 (1 + u3) == 0, 
  b1 u1 + b2 u2 + b3 (1 + u3) == 0}, {u1, u2, u3}]

During evaluation of In[38]:= Solve::svars: Equations may not give solutions for all "solve" variables.

Out[38]= {{u2 -> -(((a3 b1 - a1 b3) u1)/(a3 b2 - a2 b3)), 
  u3 -> -1 - ((-a2 b1 + a1 b2) u1)/(a3 b2 - a2 b3)}}

Evidently, this system and eq2 has the same solution set. So, we must admit that the transformations are equivalent!

Posted 9 years ago
POSTED BY: Daniel Huber
POSTED BY: Daniel Lichtblau
Posted 9 years ago

Thank you Daniel, the " Cox, Little, and O'Shea" seems to be digestible.

POSTED BY: Daniel Huber
Posted 9 years ago

Hello Daniel, I am busily reading Cox, Little, and O'Shea. It is hard work, but well spent and not only "digestible" but even delicious. Here is what I found so far ( hopefully I understood everything o.k. and am not barking up the wrong tree):

Lets start with the equation from Eliminate (from above):

a3+a1 u1+a2 u2+a3 u3==0 &&
b3+b1 u1+b2 u2+b3 u3==0 &&
a1 (b3+b2 u2+b3 u3)==b1 (a3+a2 u2+a3 u3)

I claim that this set is linear dependent. As you pointed out, I wrongly claimed that the third equation is dependent on the first two. Because you said this, I stopped thinking (intimidation-by-expert-spell!) and it took me some time to get over it and realize that the set IS linear dependent. You can e.g. express the first one by the remaining ones:

eq= {a3+a1 u1+a2 u2+a3 u3,
b3+b1 u1+b2 u2+b3 u3,
a1 (b3+b2 u2+b3 u3)-(b1 (a3+a2 u2+a3 u3)) };

{a1/b1,-1/b1} . eq[[2;;3]] == eq[[1]] //Simplify
True

Well, why does "Eliminate " give linear dependent answers? Let's look what "Groebner Basis" has to tell. We start with eq2, rewritten from equation to polynomial form and calculate the Groebner basis (using lexicographical ordering. Remember z and u are variables, a and b parameters):

eq2a={
z1-u1,
z2-u2,
z3-1-u3,
a1 u1+a2 u2+a3 (1+u3),
b1 u1+b2 u2+b3 (1+u3)};

vars={z1,z2,z3,u1,u2,u3};
GroebnerBasis[eq2a,vars]

{-a3 b1+a1 b3-a2 b1 u2+a1 b2 u2-a3 b1 u3+a1 b3 u3,
b3+b1 u1+b2 u2+b3 u3,
a3+a1 u1+a2 u2+a3 u3,
-1-u3+z3,
-u2+z2,
-u1+z1}

I claim that this is not a reduced Groebner basis and therefor not minimal. To be a reduced basis, no monomial term of any basis polynomial can lie in the affine variety of the leading terms of the remaining polynomials. (Whow quite a mouth full!)

We need only look at the leading terms. The leading terms are:
{(-a2 b1+a1 b2) u2, b1 u1, a1 u1, z3, z2,z1}

it is quite obvious that the second and third term are dependent. I think this is the reason that "Eliminate" gives linear dependent solution sets.

POSTED BY: Daniel Huber

Daniel,

GroebnerBasis by default treats all indeterminates as "variables". To get the ones not listed to be seen as "parameters", use CoefficientDomain->RationalFunctions.

eq2a = {z1 - u1, z2 - u2, z3 - 1 - u3, a1 u1 + a2 u2 + a3 (1 + u3), 
   b1 u1 + b2 u2 + b3 (1 + u3)};
vars = {z1, z2, z3, u1, u2, u3};
gb = GroebnerBasis[eq2a, vars, CoefficientDomain -> RationalFunctions]

(* Out[1198]= {a3 b1 - 
  a1 b3 + (a2 b1 - a1 b2) u2 + (a3 b1 - a1 b3) u3, -a3 b2 + 
  a2 b3 + (a2 b1 - a1 b2) u1 + (-a3 b2 + a2 b3) u3, -1 - u3 + z3, 
 a3 b1 - a1 b3 + (a3 b1 - a1 b3) u3 + (a2 b1 - a1 b2) z2, -a3 b2 + 
  a2 b3 + (-a3 b2 + a2 b3) u3 + (a2 b1 - a1 b2) z1} *)

Here we show that no lead term divides another in Q(a,b).

leadterms = 
 GroebnerBasis`DistributedTermsList[gb, vars, 
   CoefficientDomain -> RationalFunctions][[1, All, 1]]

(* Out[1199]= {{{0, 0, 0, 0, 1, 0}, a2 b1 - a1 b2}, {{0, 0, 0, 1, 0, 0}, 
  a2 b1 - a1 b2}, {{0, 0, 1, 0, 0, 0}, 1}, {{0, 1, 0, 0, 0, 0}, 
  a2 b1 - a1 b2}, {{1, 0, 0, 0, 0, 0}, a2 b1 - a1 b2}} *)

There are a couple of important things to keep in mind. One is that Eliminate is based on ancient design and code. It has no concept of "parameters" and every indeterminate is either a variable to be eliminated or one to be retained (I made a comment to this effect a few days ago in this thread). The other, as noted above, is that GroebnerBasis has a default setting and it might not be the one that is what you implicitly have in mind.

POSTED BY: Daniel Lichtblau
Posted 9 years ago

Daniel, thanks a lot. The hint about "CoefficientDomain" really helps, I do not think I would have realized this myself.

Now the problem with "Eliminate". Is it too naive an approach to simply test the output of Eliminate for linear dependencies and eliminate if necessary. Or is the problem more subtle?

POSTED BY: Daniel Huber

If you have in mind that certain unknowns are coefficients rather than variables, then it will be tricky to use results from Eliminate no matter how you post-process. Offhand I do not know if Gaussian elimination will work for this purpose although it seems at least plausible.

There were a pair of papers from 1987, by Michael Kalkbrenner (Solving systems of algebraic equations using Gr\"obner bases) and Patrizia Gianni (Properties of Gr\"obner bases under specialization) respectively. They appeared one after the other in the Proceedings of the 1987 European Conference on Computer Algebra (EuroCAL). They show more or less how to handle this situation provided that the "parameter" indeterminates are ordered lexically lower than the "variable" indeterminates. If you do not specifiy certain indeterminates then Eliminate will in fact order them last, so this result could I guess be useful. But the details of how to use it are not so straightforward.

What I would advocate in any case is just using GroebnerBasis with CoefficientDomain -> RationalFunctions and also, for improved computational efficiency, MonomialOrder->EliminationOrder and Sort->True.

POSTED BY: Daniel Lichtblau
Posted 9 years ago

O.k. I take your advice. GroebnerBasis seems to be the way to go. And it also has a nice psychological aspect by using a new technique just learned. thank's for all, Daniel

POSTED BY: Daniel Huber

I don't see the linear dependency of a1 (b3+b2 u2+b3 u3)==b1 (a3+a2 u2+a3 u3) on the set

{a3+a1 u1+a2 u2+a3 u3==0,
b3+b1 u1+b2 u2+b3 u3==0}
POSTED BY: Daniel Lichtblau
Posted 9 years ago

You are right, I must have made a mistake when checking for dependency. However, now it is even worse,the third equation is additional information. Where does it coming from?

POSTED BY: Daniel Huber

The full result comes from a Groebner basis computation with a term ordering that eliminates the variables requested.

POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard