Let XX and YY be sets and P(x,y)P(x,y) be a predicate on X×YX \times Y such that for every x∈Xx \in X there is exactly one y∈Yy \in Y for which P(x,y)P(x,y) is true. The function f:X→Yf : X \rightarrow Y defined by P(x,y)P(x,y) is the rule that maps each input x∈Xx \in X to the unique output f(x)∈Yf(x) \in Y for which P(x,f(x))P(x,f(x)) is true.

y=f(x)⇔P(x,y)y=f(x) \Leftrightarrow P(x,y)

Let f:X→Yf : X \rightarrow Y be a function. The set XX is the domain of ff and the set YY is the codomain of f.f.

Let f:X→Yf : X \rightarrow Y be a function and S⊆X.S \subseteq X. The image of SS under f,f, written f(S),f(S), is the set of elements of YY that are mapped from elements of S.S.

f(S):={f(x)∈Y:x∈S}f(S) := \{f(x) \in Y : x \in S\}

Let f:X→Yf : X \rightarrow Y be a function and S⊆Y.S \subseteq Y. The inverse image of SS under f,f, written f−1(S),f^{-1}(S), is the set of elements of XX that are mapped into SS by f.f.

f−1(S):={x∈X:f(x)∈S}f^{-1}(S) := \{x \in X : f(x) \in S\}

Let f:X→Yf : X \rightarrow Y be a function. The range of ff is the image f(X)f(X) of the domain. The term range is sometimes used for the codomain instead.

Let f:X→Yf : X \rightarrow Y and g:X→Yg : X \rightarrow Y be functions with the same domain and codomain. The functions ff and gg are equal, written f=g,f=g, if and only if f(x)=g(x)f(x)=g(x) for all x∈X.x \in X.

Let f:X→Yf : X \rightarrow Y and g:Y→Zg : Y \rightarrow Z be functions such that the codomain of ff is the domain of g.g. The composition of ff and g,g, written g∘f:X→Z,g \circ f : X \rightarrow Z, is the function that maps each x∈Xx \in X to the output of gg at the input f(x).f(x).

(g∘f)(x):=g(f(x))(g \circ f)(x) := g\left(f(x)\right)

If the codomain of ff is not the domain of gg then the composition g∘fg \circ f is undefined.

Let f:X→Yf: X \rightarrow Y be a function. The function ff is injective, or one-to-one, if and only if distinct elements of XX are mapped to distinct elements of Y.Y.

x≠x′⇒f(x)≠f(x′)x \neq x' \Rightarrow f(x) \neq f(x')

Let f:X→Yf: X \rightarrow Y be a function. The function ff is surjective, or onto, if and only if every element of YY is the image of at least one element of X.X.

∀y∈Y ∃x∈X:f(x)=y\forall y \in Y \, \exists x \in X : f(x) = y

Let f:X→Yf: X \rightarrow Y be a function. The function ff is bijective if and only if it is both injective and surjective. A bijective function is also called a bijection.

Let f:X→Yf: X \rightarrow Y be a bijection. The inverse function of f,f, written f−1:Y→X,f^{-1} : Y \rightarrow X, is the function that maps each y∈Yy \in Y to the unique x∈Xx \in X with f(x)=y.f(x)=y. A bijective function is also called invertible.

Let XX and YY be sets. The sets XX and YY have equal cardinality if and only if there exists a bijection f:X→Y.f : X \rightarrow Y.

The set of natural numbers is N={0,1,2,…}.\mathbb{N} = \{0, 1, 2, \ldots\}.

Let XX be a set and n∈N.n \in \mathbb{N}. The set XX has cardinality nn if and only if XX has equal cardinality with the set {i∈N:i<n}.\{i \in \mathbb{N} : i < n\}. A set with cardinality nn has nn elements.

Let XX be a set. The set XX is finite if and only if XX has cardinality nn for some n∈N.n \in \mathbb{N}. Otherwise XX is infinite.

Let XX be a set. The set XX is countably infinite if and only if XX has equal cardinality with N.\mathbb{N}. The set XX is countable if and only if XX is finite or countably infinite. The set XX is uncountable if and only if XX is not countable.