inf - inf = 0 ??



--------------------------------------------------
From: "Viktor T. Toth" <vttoth at vttoth.com>
Sent: Tuesday, September 07, 2010 10:40 PM
To: "'Richard Fateman'" <fateman at cs.berkeley.edu>; "'Jean Pellegri'" 
<jean.pellegri at alice.it>; "'maxima List'" <maxima at math.utexas.edu>
Subject: Re: [Maxima] inf - inf = 0 ??

> Right now (testing with 5.21.0 and the current CVS), we have
>
> (%i3) limit(2/x-1/x,x,0);
> (%o3)                              infinity
>
> but
>
> (%i6) limit(2/x,x,0)-limit(1/x,x,0);
> (%o6)                                  0
>
> That just does not smell right.
>
> Shouldn't we have
>
> inf + inf = inf (NOT 2 inf),
> inf - inf = und (NOT 0),
> minf + minf = minf (NOT 2 minf),
> minf - minf = und,
> inf - minf = inf,
> minf - inf = minf,
> infinity + inf = infinity + minf = infinity + infinity = und,
> infinity - inf = infinity - minf = infinity - infinity = und?

No, inf and minf are not numbers, so they cannot consistently be treated as 
numbers.  I have in pw.mac a function called pwdelta() which is not really a 
function but it looks like one to the user.  I have been able to handle this 
special case of pwdelta() correctly in code.  It is like diracdelta().
pwint(pwdelta()^2,x)= integrate(pwdelta(x)^2,x).
pwint(pwdelta(x-a)*x,x,minf,inf)= a.

Why do you insist that inf can be added, subtracted, multiplied and 
exponentialized (or squared).  It is not a number, don't apply the "numbers 
only" simplifiers to it.

inf - inf = inf - inf
inf + inf = inf + inf,
inf - inf = inf - inf
minf + minf = minf + minf
minf - minf = minf - minf
inf - minf = inf - minf
minf - inf = minf - inf
infinity + inf = infinity + inf

Just leave it as is.  For very large sums or products you would get large 
output but that is okay by me.
sum(a[i],i,1,1000) = long answer but still correct.

An advantage to this programmers including me would like is

mapatom(limit(1/x^2,x,0)-limit(1/x^2,x,0)) = false

safe_op(limit(1/x^2,x,0)-limit(1/x^2,x,0)) = "+"

This would be a good way to tell if the answer is well defined.  It makes 
extending limit easier too.

Rich

>
> Multiplication can also be a problem; e.g., we have
>
> (%i12) infinity/infinity;
> (%o12)                                 1
>
> but
>
> (%i13) limit(infinity/inf,x,0);
> (%o13)                             infinity
>
> but in both cases, I think und would be the only valid answer.
>
No,

(%i1) infinity/infinity;
(%o1)  infinity/infinity;


> On the other hand, I realize that some simplifications may (for better or
> for worse) rely on the current behavior.
>
> Also, I noticed that the example for und (type ? und) is one that actually
> yields infinity.
>
>
> Viktor
>
>
> -----Original Message-----
> From: maxima-bounces at math.utexas.edu 
> [mailto:maxima-bounces at math.utexas.edu]
> On Behalf Of Richard Fateman
> Sent: Tuesday, September 07, 2010 5:29 PM
> To: Jean Pellegri; maxima List
> Subject: Re: [Maxima] inf - inf = 0 ??
>
> On 9/7/2010 1:49 PM, Jean Pellegri wrote:
>
> Salut
>
>
>
> Maxima says :
>
>
>
> (%i)   inf - inf;
>
>
>
> (%o)  0
>
>
>
> This is obviously incorrect
>
>
>
>
>
> not if they are the SAME inf.   e.g.  limit(x-x,x,inf).
>
> More seriously, what would you like to see?   There are various proposals,
> e.g.
> here's one.
>
> each use of inf is labeled.   then inf[1]-inf[2]    is different from
> inf[1]-inf[1].
>
> With interval arithmetic, you have similar problems.  e.g.  if  -1<x<1  is
> represented by interval(-1,1),
> what is interval(-1,1) - interval(-1,1)?   maxima says zero, but it should
> be interval(-2,2).
>
> unless they are the SAME interval.
>
> RJF
>
>
>
>
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>