Meaning of $X$ in $f\colon X\to Y$

214 Views Asked by At

From the Wikipedia article on Function (mathematics):

A function is a process or a relation that associates each element $x$ of a set $X$, the domain of the function, to a single element $y$ of another set $Y$ (possibly the same set), the codomain of the function. (...) The domain and codomain are not always explicitly given when a function is defined, and, without some (possibly difficult) computation, one knows only that the domain is contained in a larger set. Typically, this occurs in mathematical analysis, where "a function from $X$ to $Y$" often refers to a function that may have a proper subset of $X$ as domain. For example, a "function from the reals to the reals" may refer to a real-valued function of a real variable, and this phrase does not mean that the domain of the function is the whole set of the real numbers, but only that the domain is a set of real numbers that contains a non-empty open interval; such a function is then called a partial function.

From the Wikipedia article on Partial function:

In real and complex analysis, a partial function is generally called simply a function.

From the Wikipedia article on Domain of a function:

Given a function $f\colon X\to Y$, the set $X$ is the domain of $f$; the set $Y$ is the codomain of $f$. (...) The image of $f$ can be the same set as the codomain or it can be a proper subset of it; it is the whole codomain if and only if $f$ is a surjective function, and otherwise it is smaller.

Sentence 1: A function is a process or a relation that associates each element $x$ of a set $X$, the domain of the function, to a single element $y$ of another set $Y$ (possibly the same set), the codomain of the function.

Sentence 2: A function from $X$ to $Y$ often refers to a function that may have a proper subset of $X$ as domain.

Doesn't sentence 1 contradict sentence 2?

Using sentence 1, $$\tan\colon\mathbb{R}\to\mathbb{R}$$ is nonsecial, since $\frac{\pi}{2}\in\mathbb{R}$ and $\tan\frac{\pi}{2}\notin\mathbb{R}$, but using sentence 2, it makes sense, as the domain of $\tan$ (when viewed as a function to $\mathbb{R}$) is a subset of $\mathbb{R}$.

Since the image can be a proper or improper subset of the codomain, is there a mathematical term for a proper subset of the domain? Because this is exactly what is needed to get rid of the ambiguity.

Also, notice the word "open" in

(...) the domain is a set of real numbers that contains a non-empty open interval (...)

in the first paragraph of this post. Why does it have to be open? And how would one even go about open intervals in case of functions acting on some natural numbers only?