Iteration of a partial function (source code)

= Iteration of a partial function
{title2=$D_{n+1}=\{x\in D_n:f^n(x)\in D\}$}

For a <partial function> $f:D\to X$ with $D\subseteq X$, its $n$th <iterated function> is defined only when each intermediate application is defined. Put $D_0=X$, $f^0=\operatorname{id}_X$, and use the displayed recursion for the <domain of a function>. Simplifying an algebraic expression for $f^n$ does not restore points excluded by an intermediate application. For example, $f(x)=1/x$ has $f^2(x)=x$ on $\mathbb R\setminus\{0\}$; the simplified expression $x$ has a larger natural <domain of a function>.