Identity function
Consider a set $X$. The identity function on $X$ is the function from $X$ to $X$ that sends each element of $X$ to itself.
Consider a set $X$. The identity function on $X$ is the function $\operatorname{id}_X : X \to X$ defined by
\[\operatorname{id}_X(x) = x \quad \text{for all } x \in X.\]Examples
Examples
-
The function $f : \reals \to \reals$ defined by $f(x) = x$
High school
The function $f : \reals \to \reals$ defined by $f(x) = x$ is the identity function on $\reals$, because $f$ sends each real number to itself, and its domain and codomain are both $\reals$.
-
The function $g : [0, 1] \to [0, 1]$ defined by $g(x) = x$
High school
The function $g : [0, 1] \to [0, 1]$ defined by $g(x) = x$ is the identity function on $[0, 1]$, because $g$ sends each point of $[0, 1]$ to itself and its codomain is its domain. It is a different function from the identity function on $\reals$, because its domain is different.
Non-examples
Things that may be mistaken for examples.
-
The function $\iota : \mathbb{Z} \to \reals$ defined by $\iota(n) = n$
High school
The function $\iota : \mathbb{Z} \to \reals$ defined by $\iota(n) = n$ is not an identity function, because its codomain $\reals$ is different from its domain $\mathbb{Z}$. For example, no integer is sent to $1/2$.
-
The map from the unit circle $S^1$ to $\reals^2$ that sends each point of $S^1$ to itself
Undergraduate
The map from the unit circle $S^1$ to $\reals^2$ that sends each point to itself is not an identity function, because its codomain $\reals^2$ is larger than its domain $S^1$.
Properties
- The identity function $\operatorname{id}_X$ is the identity element of function composition on the functions from $X$ to $X$: for every function $f : X \to X$, \(f \circ \operatorname{id}_X = \operatorname{id}_X \circ f = f.\) More generally, for every function $f : X \to Y$, $f \circ \operatorname{id}_X = f$ and $\operatorname{id}_Y \circ f = f$.
- The identity function on $X$ is bijective, and $\operatorname{id}_X$ is its own inverse.
- The domain and the codomain of an identity function are the same set.
- The identity function on $X$ is the inclusion map of $X$ into itself.
Notes
The identity function on $X$ depends on the set $X$: the identity function on $[0, 1]$ and the identity function on $\reals$ are different functions, even though both are written $x \mapsto x$.
The identity function is different from an identity element of an operation, such as $0$ for addition, though the identity function on $X$ is the identity element of composition of functions from $X$ to $X$.
The identity function is also different from an identity equation, such as $(x + 1)^2 = x^2 + 2x + 1$.