99. Idempotent functions

99.1 Definition: Idempotent function

A function $F\colon A \to A$ is idempotent if $F \circ F = F$.

99.1.1 How to think about idempotent functions $F$ is idempotent if doing $F$ twice is the same as doing it once: If you do $F$, then do it again, the second time nothing happens.

99.1.2 Example The function $\langle x,y\rangle \mapsto \langle x,0\rangle\colon \mathrm{R} \times \mathrm{R} \to \mathrm{R} \times \mathrm{R}$ is idempotent. Note the close connection between this function and the first coordinate function $p_{1}\colon \mathrm{R} \times \mathrm{R} \to \mathrm{R}$.

99.1.3 Example Let $S$ be a set of files that contains a sorted version of every file in the set. Then “sort” is a function that takes each file in the set to a possibly different file. Sorting a file that is already sorted does not change it (that is true of many sorting functions found on computers, but not all). Thus sorting and then sorting again is the same as sorting once, so sorting is idempotent.

99.1.4 Usage Following Example 99.1.2, the word “projection” is used in some branches of mathematics to mean “idempotent function”. In other brances, “projection” means “coordinate function”.)

99.1.5 Exercise Let $A = \{1,2,3\}$. Give an example of an idempotent function $F\colon A \to A$ that is not $\mathrm{id}_{A}$. (Answer on page 248.)

99.1.6 Exercise Show that if $F\colon A \to A$ is injective and idempotent, then $F = \mathrm{id}_{A}$.

99.2 Definition: Fixed point

Let $F\colon A \to A$ be any function. An element $x \in A$ is a fixed point of $F$ if $F(x) = x$.

This is the fundamental theorem on idempotent functions:

99.3 Theorem

A function $F\colon A \to A$ is idempotent if and only if every element of $\operatorname{Im}F$ is a fixed point of $F$.

99.3.1 Exercise Prove Theorem 99.3.

99.3.2 Exercise Use Theorem 99.3 to show that if $F\colon A \to A$ is surjective and idempotent, then $F = \mathrm{id}_{A}$.

Page 143 of the book (PDF).