# Is “taking a limit” a function? Is it a procedure? A ternary operation?

I was sitting in analysis yesterday and, naturally, we took the limit of some expression. It occurred to me that “taking the limit” of some expression abides the rules of a linear transformation
$$limx→k c(f(x)+g(x))=climx→kf(x)+c limx→kg(x),\lim_{x \rightarrow k}\ c(f(x)+g(x)) = c \lim_{x \rightarrow k} f(x) + c\ \lim_{x \rightarrow k} g(x),$$
and (my group theory is virtually non existent) appears also to be a homomorphism:
$$limx→k(fg)(x)=limx→kf(x)g(x),\lim_{x \rightarrow k} (fg)(x) = \lim_{x \rightarrow k} f(x)g(x),$$
etc.

Anyway, my real question is, what mathematical construct is the limit?

In general, let $$X,YX, Y$$ be topological spaces, and $$x0x_0$$ a non-isolated point of $$XX$$. Then strictly speaking, “$$limx→x0f(x)=L\lim_{x\to x_0} f(x) = L$$” is a relation between functions $$f:X→Yf : X \to Y$$ and points $$L∈YL \in Y$$ (the equality notation being misleading in general).
Now, if $$YY$$ is a Hausdorff topological space, it happens that this relation is what is known as a partial function: for any $$f:X→Yf : X \to Y$$, there is at most one $$L∈YL \in Y$$ such that $$limx→x0f(x)=L\lim_{x\to x_0} f(x) = L$$. Now, for any relation $$R⊆(X→Y)×YR \subseteq (X \to Y) \times Y$$ which is a partial function, we can define a corresponding function $${f∈(X→Y)∣∃y∈Y,(f,y)∈R}→Y\{ f \in (X \to Y) \mid \exists y \in Y, (f, y) \in R \} \to Y$$ by sending $$ff$$ satisfying this condition to the unique $$yy$$ with $$(f,y)∈R(f, y) \in R$$. Then that somewhat justifies the “equality” in the notation $$limx→x0f(x)=L\lim_{x\to x_0} f(x) = L$$, though you still need to keep in mind that it is a partial function where $$limx→x0f(x)\lim_{x\to x_0} f(x)$$ is not defined for all $$ff$$. (This part relates to the answer by José Carlos Santos.)
Building on top of this, in the special case of $$Y=RY = \mathbb{R}$$, we can put a ring structure on $$X→YX \to Y$$ by pointwise addition, pointwise multiplication, etc. Then $${f:X→R∣∃L∈R,limx→x0f(x)=L}\{ f : X \to \mathbb{R} \mid \exists L \in \mathbb{R}, \lim_{x\to x_0} f(x) = L \}$$ turns out to be a subring of $$X→RX \to \mathbb{R}$$, and the induced function from this subring to $$R\mathbb{R}$$ is a ring homomorphism. (More generally, this will work if $$YY$$ is a topological ring. Similarly, if $$YY$$ is a topological vector space, then the set of $$ff$$ with a limit at $$x0x_0$$ is a linear subspace of $$X→YX \to Y$$ and the limit gives a linear transformation; if $$YY$$ is a topological group, you get a subgroup of $$X→YX \to Y$$ and a group homomorphism; and so on.)