Definition · applies to sets · also called identity map, $\operatorname{id}_X$

High school

Consider a set $X$. The identity function on $X$ is the function from $X$ to $X$ that sends each element of $X$ to itself.

Undergraduate

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.

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$.

All definitions · All distinctions · All examples