MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Parametrized assumptions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg107843] Re: Parametrized assumptions
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Sun, 28 Feb 2010 04:54:06 -0500 (EST)
  • Reply-to: hanlonr at cox.net

Using TagSet

Clear[q]

q /: q[L_, 1]^2 = q[L, 0]^2 - 1;

q /: q[L_, 1] r[L_, 1] = q[L, 0] r[L, 0] - t[L];

q[w, 0]^2 - q[w, 1]^2

1

However, you will never have q[w, 1]^2

q[w, 1]^2

q[w, 0]^2 - 1

q[w, 0] r[w, 0] - q[w, 1] r[w, 1]

t[w]

Similarly, you will never have q[w, 1] r[w, 1]

q[w, 1] r[w, 1]

q[w, 0]*r[w, 0] - t[w]

Or using rules (with the same limitations)

Clear[q]

sub = {q[L_, 1]^2 :> q[L, 0]^2 - 1,
   q[L_, 1] r[L_, 1] :> q[L, 0] r[L, 0] - t[L]};

q[w, 0]^2 - q[w, 1]^2 /. sub

1

q[w, 0] r[w, 0] - q[w, 1] r[w, 1] /. sub

t[w]


Bob Hanlon

---- Torsten Schoenfeld <kaffeetisch at gmx.de> wrote: 

=============
I'm having trouble using parametrized assumptions consistently.  I have 
two objects, q and r, both having a label and an index.  Now, I want 
that the following holds for any label L:

   q[L, 0]^2 - q[L, 1]^2 == 1
   q[L, 0] r[L, 0] - q[L, 1] r[L, 1] == t[L]

For the first condition, I find that the following works

   Assuming[1 == HoldPattern[q[l_, 0]^2 - q[l_, 1]^2],
     q[w, 0]^2 - q[w, 1]^2 // Simplify]
   -> 1

The HoldPattern[] is, apparently, necessary, and it also needs to be 
only on the right hand side.  However, I can't find a way to realize the 
second condition.  My attempts include

   Assuming[t[l_] == HoldPattern[q[l_, 0] r[l_, 0] - q[l_, 1] r[l_, 1]],
     q[w, 0] r[w, 0] - q[w, 1] r[w, 1] // Simplify]

   Assuming[HoldPattern[t[l_] == q[l_, 0] r[l_, 0] - q[l_, 1] r[l_, 1]],
     q[w, 0] r[w, 0] - q[w, 1] r[w, 1] // Simplify]

   Assuming[0 == HoldPattern[q[l_, 0] r[l_, 0] - q[l_, 1] r[l_, 1] - t[l_]],
     q[w, 0] r[w, 0] - q[w, 1] r[w, 1] // Simplify]

None of these work.  I assume part of the problem is that I don't 
understand why this doesn't work:

   q[w, 0] r[w, 0] - q[w, 1] r[w, 1] /.
     HoldPattern[q[l_, 0] r[l_, 0] - q[l_, 1] r[l_, 1]] -> a

Whereas this works:

   q[w, 0] r[w, 0] - q[w, 1] r[w, 1] /.
     q[l_, 0] r[l_, 0] - q[l_, 1] r[l_, 1] -> a

So, how do I go about implementing these kinds of parametrized assumptions?



  • Prev by Date: Re: Problems with ChoiceDialog inside a Dynamic: Bug
  • Next by Date: Re: Transition to Wolfram Workbench
  • Previous by thread: Parametrized assumptions
  • Next by thread: Identity from Erdelyi et al.