# Is the definition of limits valid when talking about discret functions

This question is related to this other one I just made here. Let's consider for example the function $f:\mathbb{Q}\longrightarrow \mathbb{R}$ such that $f(x)=x$. Intuitively $\lim_{x\to 0 }f=0$.

Now my problem is that I don't understand the domain of a function so I can talk about the definition of limit. According to the definition here, the funciton $f$ needs to be of the form $f:I\longrightarrow \mathbb{R}$, where $I$ is an open interval. Then my function defined above doesn't have limit.

According to spivak's book, see here for the definition, I understand that there's no need for the function to be defined on an interval $I$ but there should exist $\delta>0$ to apply the conditions of $\lim$, namely $\lim_{x\to c}f=l$ if and only if $\forall\epsilon>0\exists\delta>0\forall x(0<|x-c|<\delta\longrightarrow |f(x)-l|<\epsilon)$. So in this case I think my function above has limit, though it's still not very clear to me because Spivak says this as a comment.

Questions: Does this function have limit at all its rational values? What are the conditions on the domain of $f$ so I can apply the defintion of limit?

EDIT: I'd like to add this to my question. Let's consider the example above. The definition says that:

$\lim_{x\to c}f=c$ if and only if $\forall\epsilon>0\exists\delta>0\forall x(0<|x-c|<\delta\longrightarrow |f(x)-l|<\epsilon)$

Translated to my example I would say that:

$\lim_{x\to 0}f=0$ if and only if $\forall\epsilon>0\exists\delta>0\forall x(0<|x-0|<\delta\longrightarrow |f(x)-0|<\epsilon)$

Question: what is the domain of $x$? if the domain of $x$ is $\mathbb{R}$ then the conditions in the definition are never satisfied because for all $\delta>0$ there is always an irrational number $x$ such $|x-0|<\delta$ but $|f(x)-l|<\epsilon$ does not hold because $f$ is only defined for rational numbers. If the domain of $x$ is $Dom(f)$ then the conditions are satisfied and it seems that $lim_{x\to 0}=0$.

-

The $\epsilon-\delta$ definition of limits is best understood in the context of metric spaces, rather than the context of the particular metric space $\mathbb R$ with its metric given by $d(x,y)=|x-y|$. A metric space is a pair $(X,d)$ where $X$ is a set and $d:\times X\times X\to \mathbb R$ is a function satisfying $d(x,y)=0\iff x=y$, $d(x,y)=d(y,x)$, and $d(x,z)\le d(x,y)+d(y,z)$, for all $x,y,z\in X$.

Then, if $X$ and $Y$ are metric spaces (each with its own $d$), a $f:X\to Y$ is a function then $f$ is said to have the limit $L\in Y$ at the point $x\in X$ if for all $\epsilon >0$ there exists $\delta >0$ such that for all $x'\in X$ with $x\ne x'$, if $d(x,x')<\delta$, then $d(f(x),L)<\epsilon$.

In particular, $\mathbb R$ with $d(x,y)=|x-y|$ is a metric space and $\mathbb Q$ with $d(x,y)=|x-y|$ is also a metric space. The notion of limits for functions $f:\mathbb R\to \mathbb R$ is the same whether you consider the definition you refer to in your question, or if you think of the domain and codomain as metric spaces. Now, the case of functions $f:\mathbb Q \to \mathbb R$ can simply be treated, for limit purposes, as functions between metric spaces. In particular, the function you mention above does satisfy $\lim_{x\to 0}f(x)=0$.

So, the function you mention does have a limit at all of its points of definition. In fact, the function is continuous. Further, as the above would indicate, to speak of the $\epsilon-\delta$ notion of limits, the domain and codomain of the function can be any two metric spaces.

Answer to the EDIT: The domain of the $x$, in the context of real analysis (that is, when the metric spaces in question are subspaces of $\mathbb R$, the domain where $x$ is allowed to come from is usually assumed to be some given interval of the point $x$ where the limit is computed. The reason is that most theorem of the calculus that relate to differentiability require the function to be nice enough in an interval. Otherwise, annoying pathologies may pop up.

It is healthy to think of it all in terms of germs. Without getting technical, germs allow for the following observation to become a rigorous. The limit of a function $f$ at a point $x$, does not depend at all on the value $f(x)$. Moreover, the limit also does not depend at all on what happens with the function outside an interval $(x-t,x+t)$, no matter how small $t>0$ is. So, it would seem that the limit of a function doesn't depend on any particular value of the function. This apparent paradoxical situation is something that is good to ponder about. The rigorous solution is given in the forms of the germ of the function at $x$. But even without googling what that is, it's a good idea to come to grips with this observation.

-
In my example, what if I remove all $p\in \mathbb{Q}$ such that $p=1/(2n), n\in \mathbb{N}$. Does the limit at $0$ still exist?. This is the same as saying that in each interval of the form $(-\delta, \delta)$ I could remove an infinte number of points. –  Daniela Diaz Jul 26 '13 at 7:08
Also if you could check my edit I'll be very grateful, and thanks so much as always. –  Daniela Diaz Jul 26 '13 at 8:08
@DanielaDiaz if you remove all those points $p$, then you are just changing the domain metric space a bit. The function will still have limits and be continuous. Your edit is ok, except that you got the inequality signs reversed. The answer to the question in the edit is given in the edit to my answer. –  Ittay Weiss Jul 26 '13 at 9:22
I just made the corrections of the inequalities, thanks. Now, I still don't understand and I think I'm missing something. What is the right definition to my example?. If $\phi(x):=(0<|x-0|<\delta\longrightarrow |f(x)-0|<\epsilon)$ then which is wright?: 1) $\forall\epsilon>0\exists\delta>0\forall x\in \mathbb{R}(\phi(x))$, 2) $\forall\epsilon>0\exists\delta>0\forall x\in \mathbb{Q}(\phi(x))$, 3) it depends, ... –  Daniela Diaz Jul 26 '13 at 10:03
Spivak is concerned with real analysis, so he doesn't care about the situation where the domain is not an interval. He dismisses all such functions as not having limits, essentially saying that for a function to have a limit at $x$ it must be defined on some interval containing $x$. So, with that definition, your function from the rationals does not have any limits at any point. But, as I explained, this is a common perspective in real analysis, but it is not strictly required. –  Ittay Weiss Jul 26 '13 at 18:40

Yes the function has limit at all its rational values. Parsing through the definition, fix a rational number $q$ also equal to $f(q)$ if you choose any small positive $\epsilon$ and a rational number $y$ such that $| f(y)-q| < \epsilon$ then you can choose $\delta = \epsilon$ (because your function $f$ takes a number to itself) and that choice of $\delta$ works.

If your function were $f(x) = x^{3}$, your choice of $\delta$ will be somewhat different.

All this works because the rational numbers are dense in the reals that is any real number is a limit of rational numbers, so no matter how small $\delta$ is you can always find a rational number nearby (to $c$).

EDIT:To clarify, "All this works..." is meant to imply that given a function $f: \mathbb{R} \rightarrow \mathbb{R}$ you can check the continuity of $f$ at a rational point $x$ (which is zero in your case) by restricting yourself to the (restricted) function $f: \mathbb{Q} \rightarrow \mathbb{R}$ and using the epsilon delta definition of Spivak. However given a function $f: \mathbb{R} \rightarrow \mathbb{R}$, you cannot check continuity at $0$ by restricting the function to $f:\mathbb{N} \rightarrow \mathbb{R}$ (and this is where density of rationals is important).

I hope that clarifies my last comment.

-
the density of the rationals does not play a role here. It's the fact that the rationals, just like the reals, form a metric space. The notion of limit, in its $\epsilon- \delta$ form, is a concept of metric spaces. –  Ittay Weiss Jul 26 '13 at 6:36
I agree with Ittay Weiss. This answer is misleading. A function can be defined on a discrete space, which in an extreme case reduces to a single point, and still be continuous. There is no need for the density property of the rationals. (PS: Actually, what is misleading is the last remark, beginning with "All this works...", not the whole answer) –  Giuseppe Negro Jul 26 '13 at 9:35
@Giuseppe: Indeed, a function defined on a discrete space must be continuous! –  Brian M. Scott Jul 26 '13 at 9:43