A **function** $f$ maps [[Element of a Set|elements]] from a [[Set|set]] $A$, the *domain*, to a [[Set|set]] $B$, the *codomain*. It is a [[Subset|subset]] of the [[Cartesian Product]] that contains a unique $(x,y)$ for each $x\in A$.
$(f:A\rightarrow B)\ni(x,y) \implies \forall x\in A \exists!(x,y) \in A\times B$
$A=\set{x_n : n\in\mathbb{N}}, \quad(f:A\rightarrow B):=\set{(x_n,y) : x_i\neq x_j \quad \forall i\neq j}$
Given $(x,y)\in f$ we write $f(x)=y$
The domain and range of $f$ can be written as functions
$D(f):=A$
$R(f):=\set{y \in B: (\exists x : f(x)=y)}$