 
 
 
 
 
 
Re: Unprotect Plus, no automatic collection
- To: mathgroup at smc.vnet.net
- Subject: [mg39434] Re: Unprotect Plus, no automatic collection
- From: Paul Abbott <paul at physics.uwa.edu.au>
- Date: Sat, 15 Feb 2003 01:41:58 -0500 (EST)
- Organization: The University of Western Australia
- References: <b184d4$kqb$1@smc.vnet.net> <b1afsn$ph0$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
In article <b1afsn$ph0$1 at smc.vnet.net>,
 Friedrich Laher <mathefritz at schmieder-laher.de> wrote:
> Friedrich Laher schrieb:
> > when Unprotect[Plus]; Plus[w1,w2] = -1 is commanded
> > and then the expanding of a product gives a*w1 + a*w2 + ...
> > that is not collapsed to -a + ... automatically, even
> > if selecting that a*w1 + a*w1 and
> > the applying Simplify to it from al palette, does it.  What
> > can be done to automize it?
> > 
> >
> I got a direct answer from Mihaijlo Vanevic,
> suggesting
> using a rul w2 -> -1-w2
> but
> what when there is w1+w2+w3+... = -1
> ?
PolynomialReduce is designed for this. For example,
   Last[PolynomialReduce[a*w1 + a*w2, {w1 + w2 + 1},{a}]]
The generalization is clear. For example,
  Simplify[Last[PolynomialReduce[a*w1 + a*w2, {w1 + w2 + w3 + 1},{a}]]]
Cheers,
Paul

