Definition of limits in metric spaces Tao's Analysis II In the third edition of Tao's Analysis II he gives the following definition of limiting value of a function:

Let $(X,d_X)$ and $(Y,d_Y)$ be metric spaces, let $E$ be a subset of $X$, and let $f:X\rightarrow Y$ be a function. If $x_0\in X$ is an adherent point of $E$, and $L\in Y$, we say that $f(x)$ converges to $L$ in $Y$ as $x$ converges to $x_0
$ in $E$, or write $\lim_{x\to x_0 ; x\in E} f(x) =L$, if for every $\epsilon > 0$ there exists a $\delta > 0$ such that $d_Y(f(x),L)< \epsilon$ for all $x\in E$ such that $d_X(x,x_0) < \delta$

But in the corrected third edition he changes the definition slightly:

Let $(X,d_X)$ and $(Y,d_Y)$ be metric spaces, let $E$ be a subset of $X$, and let $f:E\rightarrow Y$ be a function. If $x_0\in X$ is an adherent point of $E$, and $L\in Y$, we say that $f(x)$ converges to $L$ in $Y$ as $x$ converges to $x_0$ in $E$, or write $\lim_{x\to x_0 ; x\in E} f(x) =L$, if for every $\epsilon > 0$ there exists a $\delta > 0$ such that $d_Y(f(x),L)< \epsilon$ for all $x\in E$ such that $d_X(x,x_0) < \delta$

Basically he changes the domain of $f$, my question is: what is the motivation in this change? The first definition looks more useful to me, since the idea of taking a subset $E$ of $X$ and the notation $\lim_{x\to x_0 ; x\in E} f(x) =L$ is to be able of taking limits in subsets of $X$, also we could perform this idea with the second definition, if we have a function $f:X\rightarrow Y$ and a subset $E$ of $X$ is enought to take the restriction $f|_E$, but we can perform the same idea with the first definition with no need of these "extra steps".
 A: As you say, the difference between both definition is that two distinct classes of functions are considered: The class of all functions $f : X \to Y$ in the "old" definition and the class of all functions $f : E \to Y$ in the "new" definition.
You may regard the new definition as more general because you can always consider the restriction $f \mid_E$. In other words, a function $f : X \to Y$ has the property $\lim_{x\to x_0 ; x\in E} f(x) =L$ (in the sense of the old definition) iff $\lim_{x\to x_0 ; x\in E} f\mid_E(x) =L$ (in the sense of the new definition).
Conversely, you may extend any $g : E \to Y$ to a function $\tilde g : X \to Y$. Then you have again $\lim_{x\to x_0 ; x\in E}g(x) =L$ (in the sense of the new definition) iff $\lim_{x\to x_0 ; x\in E} \tilde g
(x) =L$ (in the sense of the old definition). The only "problem" is that you have to make arbitrary choices to extend functions of $E$ to functions on $X$. But whichever choice you make, the extension does not play any role in $\lim_{x\to x_0 ; x\in E} \tilde g(x) =L$.
In my opinion this shows that the new definition is superior because it makes clear that it is completely irrelevant what happens outside of $E$; it is not even necessary to have $f$ defined on $X \setminus E$ to consider the question whether $f(x)$ converges to $L$ as $x$ converges to $x_0$ in $E$.
If you know some complex analysis, you certainly also know the concept of an isolated singularity of a holomorphic function $f : U \to \mathbb C$. This is a point $x_0 \notin U$ such that $U_\epsilon(x_0) \setminus \{x_0\} \subset U$ for some $\epsilon > 0$. The point $x_0$ is said to be a removable singularity if $\lim_{x\to x_0 ; x\in U} f(x)$ exists. In this case $f$ is not defined in $x_0$ and it does not make much sense to choose an arbitrary value for $f(x_0)$ just to obtain an extension of $f$ to $U \cup \{x_0\}$ in order to apply Tao's old definition. The better approach is to work with the new definition and, if the limit exists, to define $f(x_0) = \lim_{x\to x_0 ; x\in U} f(x)$.
A: You are right that if $f: X \rightarrow Y$, then it is sufficient to take restriction $f|_E$. However, there are certain functions (such as $f(x) = \frac{1}{x}$ on $\mathbb R - \{0\})$ that you want to remove some "unwanted" points on the function and then carry out limit operation on the remaining set.
Most importantly, you are only considering $\lim_{x \rightarrow x_0; x \in E}$, so it is sufficient to assume that function $f$ has domain $E$ rather than the entire space $X$.
