I was doing this exercise and didn't understand why it specifically defined a ordered n-tuple as a surjective function rather than just a function or injective function?
The answer of this question mentioned this definition too, but I'm not sure whether I understood what this answer said.
Ordered Pairs (Ordering multiple elements)

Why ordered n-tuple can be defined as a surjective function?
534 Views Asked by user533661 https://math.techqa.club/user/user533661/detail AtThere are 5 best solutions below
On
It's a little subtle. The key is that $X$ can vary. For example, the ordered triple of integers we write informally as $(4, 6, 4)$ would be represented using this definition as a surjective function from the set $\{1, 2, 3\}$ to the set $\{4,6\}$ in the obvious way.
Can you finish the exercise now?
On
The 3-tuple $(17,42,\text{duck})$ could be viewed as the function $\{1,2,3\}\to \{\text{duck},\text{goose},\pi\}\cup \Bbb Z$ or (equally validly) as the function $\{1,2,3\}\to \{\text{duck},17,42\}$. However, only the latter function is surjective. Viewed as functions, we distinguish between these two cases (how else could we say that one is surjective and one is not?) even though their graphs are the same set of pairs. So in order to pick the function representing our tuple, we need to make a choice. The most natural choice is the surjective one, in particular because we cannot a priori restrict the range otherwise (who would have thought that a duck occurs in the 3-tuple?)
On
It's not a lucky formulation, indeed.
In short, they simply take all functions $\{1,2,\dots n\} \to X$ as $n$-tuples.
The point is that every function $f:A\to B$ can be regarded as a surjective function $A\to\mathcal R(f)$ where $\mathcal R(f)$ is the range of $f$.
This point of view is taken here, as implicitly indicated by the note
(so different ordered $n$-tuples are allowed to have different ranges)
On
I know that this topic is 5 years old, but I didn't find any of the answers particularly explicit, so I wanted to add my own. The fact that ordered pairs are defined as surjective (onto) functions is to make the following partial proof valid:
Theorem: $(x_i)_{(1\le i\le n)}=(y_i)_{(1\le i\le n)}\Leftrightarrow x_i=y_i$ for all $1\le i\le n$, where $n$ and $i$ are natural numbers.
Proof (Right to left): Let $i,n\in\mathbb{N}$ and assume that for all $1\le i\le n$, $x_i=y_i$. The ordered n-tuples in question are, by definition, surjective functions: $$(x_i)_{1\le i \le n}:\{1,...n\} \rightarrow X$$ $$(y_i)_{1\le i \le n}:\{1,...n\} \rightarrow Y$$
with the property that $x(i)=x_i$ and $y(i)=y_i$. At the present moment, $X$ and $Y$ are some sets. For the two functions to be equal, they must have the same domain, codomain, and values across the domain.
Indeed, their domains are both equal to $\{1,...,n\}$ and are thus equal to each other. The function values are the same across the shared domain, since $x(i)=x_i=y_i=y(i)$ for all $i \in \{1,...,n\}$ by assumption. It remains to show that the two functions must have the same codomain.
Note that the image of a surjective function's domain is its codomain (Example 3.4.4). Let $\gamma$ represent the domain of both functions in question. It follows that $(x_i)_{1\le i \le n}(\gamma)=X$ and $(y_i)_{1\le i \le n}(\gamma)=Y$. Using the definition of a function's image, we see that
$$(x_i)_{1\le i \le n}(\gamma)=X=\{x(i) : 1\le i \le n\}$$ $$(y_i)_{1\le i \le n}(\gamma)=Y=\{y(i) : 1\le i \le n\}=\{x(i) : 1\le i \le n\}=X$$
where we have used the fact that $x_i=y_i$ again. Thus the two functions are equal, as desired.
I bet this author defines a function $f$ to be a triple $(S,A,B)$ where $A$ and $B$ are sets and $S$ is a subset of $A \times B$ that satisfies certain properties. The set $B$ is called the codomain of $f$. You could define a new function $\hat f$ by enlarging $B$ while leaving $S$ and $A$ unaltered. The only difference between $f$ and $\hat f$ is that $\hat f$ has a larger codomain.
Given this definition of a function, if we try to define an ordered $n$-tuple to be a function $f$ with domain $\{i \in \mathbb N \mid 1 \leq i \leq N \}$, we have to worry that by enlarging the codomain of $f$ we would obtain a new function $\hat f$ that represents the same $n$-tuple. The functions $f$ and $\hat f$ satisfy $f(i) = \hat f(i)$ for $i = 1,\ldots,N$, and yet $f \neq \hat f$. This is a problem, because $n$-tuples are supposed to be equal if and only if their corresponding components are equal.
Thus, the author avoids that problem by insisting that $f$ must be surjective.