Message Boards Message Boards

Avoid old issue with Limit[Abs[Sign[x*Sin[1/x]]],x->0] = 1 ?

GROUPS:

BTW, this bug is still present in Mathematica 11.2, i.e. it claims that

Limit[Abs[Sign[x*Sin[1/x]]],x->0] 

is equal to 1. But Maxima 5.41.0 correctly says that it is "undefined", i.e. doesn't exist. As for REDUCE, it cannot calculate this limit at all (and it fails to calculate correctly many other simple limits, like abs(sign(x)) when x->0).

The fundamental problem here is that Mathematica may be assuming that if a function f(x) (x->x0) has a limit y0 and function g(y) (y->y0) has a limit g0, then their composition g(f(x)) also has a limit when (x->x0) and it is equal to g0. But this is not true and the above quote from Zorich's textbook is a good counter-example. I think this is worth fixing in the future versions of the best symbolic manipulation software on this planet, which Mathematica certainly is.

POSTED BY: Tigran Aivazian
Answer
4 months ago

How are you defining "Limit" ?

POSTED BY: Frank Kampas
Answer
4 months ago

I am not defining "Limit" --- it is a built-in Mathematica function which was introduced in 1988 (Mathematica v1.0). It is documented here:

Limit[] function documentation at wolfram.com

POSTED BY: Tigran Aivazian
Answer
4 months ago

The value of Abs[Sign[x*Sin[1/x]]] is 1 for any value of x except 0, where it is undefined. Therefore the limit as x -> 0 is 1.

POSTED BY: Frank Kampas
Answer
4 months ago

The given limit would be right if Abs[0]=1, which is a common assumption. Unfortunately, Mathematica assumes that Abs[0]=0. The value of Abs[Sign[x*Sin[1/x]]] is zero for countably many values of x, that accumulate at 0:

Reduce[Abs[Sign[x*Sin[1/x]]] == 0, x, Reals]

This limit seems to be wrong too, or at least inaccurate:

In[4]:= Limit[Sign[x*Sin[1/x]], x -> 0]

Out[4]= Interval[{-\[Infinity], \[Infinity]}]

which is curious, because these are right:

In[11]:= MaxLimit[Sign[x*Sin[1/x]], x -> 0]

Out[11]= 1

In[12]:= MinLimit[Sign[x*Sin[1/x]], x -> 0]

Out[12]= -1
POSTED BY: Gianluca Gorni
Answer
4 months ago

No, the above assertion (by Frank Kampas) is not true. Please see the proof (of its negation) in the page which I quoted in the original message. Btw, where is that message? Why am I seeing only the second of my messages and not the original one? Please include it in this thread (I don't know how to do it short of retyping the thing and re-including the image I gave). Thank you.

Just in case if you don't know how to do that, I'll retype the proof anyway, here it is (as an image facsimile of page 134 of volume I of Mathematical Analysis by V. Zorich, Springer 2004 edition):

enter image description here

Basically, the hole in your "proof" is that you missed the fact that there are zeros of the function Sin[1/x] in any deleted neighbourhood of x=0 and therefore the function Abs[Sign[x*Sin[1/x]]] assumes BOTH the value 1 and the value 0 in any such neighbourhood. Therefore it cannot have a limit. (Here "deleted" means "excepting the point x=0 itself").

POSTED BY: Tigran Aivazian
Answer
4 months ago

so you're saying the limit doesn't exist because the function is is discontinuous?

POSTED BY: Frank Kampas
Answer
4 months ago

The usual epsilon-delta definition of limit requires that f(x) be close to the limit for ALL x in a suitable delta-neighbourhood of x0. In our case this will never be satisfied for ALL x, because f(x) is far away from 1 for countably many x.

There is an alternative definition of limit ("essential limit") that only requires ALMOST ALL x to verify the condition. Almost all in the sense of Lebesgue measure, usually. With this modified definition the limit is indeed 1. Somehow I don't think Wolfram had this in mind.

POSTED BY: Gianluca Gorni
Answer
4 months ago

No, Frank, I am not saying that at all. It is a bit more subtle than that. I am saying that the limit does not exist, because the conditions of Theorem 5 about the limit of a composite function (see page 133 of the book I quoted) are NOT satisfied in this particular case. I would have included the page with the Theorem 5 for your convenience, but it assumes the knowledge of other concepts (like the oscillation of a function, a base etc) and all these would require several pages to be included.

Now, as I said in the second message (the first one in this thread), if a function y = f(x) has a limit y0 (x->x0) and function g = g(y) has a limit g0 (y->y0) it does NOT imply that the composite function g(f(x)) has a limit g0 (x->x0). You need all of the conditions of the Theorem 5 to be satisfied for this to be the case.

Specifically, in the example under consideration, what prevents the conditions of Theorem 5 to be satisfied is the fact that the function Abs[Sign[x*Sin[1/x]]] has countably many zeros in the deleted neighbourhood of the point x=0:

In[1]:= Reduce[Abs[Sign[x*Sin[1/x]]] == 0, x, Reals]                                                                                 

                                                       1                   1                                    1
Out[1]= C[1] ∈ Integers && ((C[1] <= -1 && (x == --------- || x == --------------)) || (C[1] >= 1 && x == ---------) || 
                                                   2 Pi C[1]         Pi + 2 Pi C[1]                         2 Pi C[1]

                                1
>      (C[1] >= 0 && x == --------------))
                          Pi + 2 Pi C[1]

Btw, why does the Subject of this thread have a prefix "Avoid " in it?

POSTED BY: Tigran Aivazian
Answer
4 months ago

It seems that Mathematica's Limit function will give the correct answer in non-pathological situations.

POSTED BY: Frank Kampas
Answer
4 months ago

Yes, I too find that Mathematica's Limit function is extremely powerful, i.e. able to handle almost anything I throw at it. It is more powerful than all the other systems that I ever worked with (Maxima, REDUCE, MuPAD).

But it would be nice if it was also capable of handling such pathological situations as presented in this thread. Then it would be perfect! :)

POSTED BY: Tigran Aivazian
Answer
4 months ago

This is a bug and it seems to have been addressed for a future release. Suffice it to say that this type of function, with infinitely many discontinuities in every neighborhood of the point being approached, is tricky to get right.

POSTED BY: Daniel Lichtblau
Answer
4 months ago

Group Abstract Group Abstract