pw.mac



"Do you mean "function" or do you mean "expression"? Given a function: ie
a black box that you pass an argument and get a value out, it is not
possible to tell whether it is continuous."

Sorry, I meant an expression like  continuousp(x^2,x,2,5) -> true or 
continuousp(x^2*signum(x),x,-2,5) -> true;

"Given an expression like "x+1" or "x/(x+1)" or "if is(x<0) then 1 else
0", this is obviously possible for some forms. Your function should
probably be able to return 'unknown too, then you can just implement
support for types of expressions you need."

Probably that idea of returning unknown was what I was missing.  I care 
about all cases but that is impossible.

"Quick thoughts: For a rational expression, you could try to find the
roots of the denominator. Of course, that's not always going to be
possible (if the denominator is of high degree). For other things, maybe
you can appeal to limit(). If you can find a finite set of points where
things *might* go wrong, you could just find the limit from the left and
right and compare them."

A polynomial * signum(2*x+3)  is continuous if -3/2 is a root (which is easy 
to test unless the polynomial has unknown coefficients).

Appealing to limit was my first idea.

continuousp(expr,x,a,b):=if 
simp_given(limit(expr,x,_c,'plus)-limit(expr,x,_c,'minus), _c<b,_c>a) = 0 
then true else false$
continuousp(x^2*signum(x-4),x,-8,10);
true

You can't do it that way. I actually thought that might work. I am assuming 
nothing about _c except that it is in the interval (a,b).

Rich