Definition (Peano systems). Suppose $P$ is a set, $1 \in P$, and $S: P \to P$ is a function. The triple $(P, S, 1)$ is a Peano system if the following conditions hold.
(P1) $\forall x (1 \neq S(x))$,
(P2) $\forall x \forall y (x \neq y \implies S(x) \neq S(y))$,
(P3) $\forall A ([A \subseteq P \land 1 \in A \land \forall x (x \in A \implies S(x) \in A)] \implies P = A)$.
Theorem 1 (Iteration Theorem). Let $(P, S, 1)$ be a Peano system. Suppose $W$ is an arbitrary set, $c \in W$, and $g: P \to W$ is a function. Then, there exists a unique function $f: P \to W$ such that
(i) $f(1) = c$,
(ii) $\forall x (f(S(x)) = g(f(x)))$.
Lemma 1. There exists a unique function $f_x : P \to P$, determined by $x \in P$, such that
(i) $f_x(1) = S(x)$,
(ii) $\forall u (f_x(S(u)) = S(f_x(u)))$.
Proof. Take an arbitrary $x \in P$. Take $W = P$, $c = S(x)$ and $g = S$ in Theorem $1$. $\square$
Lemma 2. Let $x \in P$. $\forall u (f_{S(x)}(u) = S(f_x(u)))$.
Proof. Let $A = \{u: u \in P \land f_{S(x)}(u) = S(f_x(u))\}$. Clearly, $A \subseteq P$. $1 \in A$ since $f_{S(x)}(1) = S(S(x)) = S(f_x(1))$. Assume $u \in A$. Then, $f_{S(x)}(u) = S(f_x(u))$. Thus, $f_{S(x)}(S(u)) = S(f_{S(x)}(u)) = S(S(f_x(u))) = S(f_x(S(u)))$. Therefore, $S(u) \in A$. Hence, by (P3), $P = A$. $\square$
Lemma 3. $\forall u (1 \neq f_1(u))$.
Proof. Let $A = \{u: u \in P \land 1 \neq f_1(u)\}$. Clearly, $A \subseteq P$. $1 \in A$, since, by (P1), $1 \neq S(1) = f_1(1)$. Assume $u \in P$. Then, $1 \neq f_1(u)$. $f_1(u) \in P$ since $f_1(P) = P$. Thus, by (P1), $1 \neq S(f_1(u)) = f_1(S(u))$. Therefore, $S(u) \in A$. Hence, by (P3), $P = A$. $\square$
Theorem 2. There are no loops in a Peano system. That is, $\forall x \forall u (x \neq f_x(u))$.
Proof. Let $A = \{x: x \in P \land \forall u (x \neq f_x(u))\}$. Clearly, $A \subseteq P$. $1 \in A$, by Lemma $3$. Assume $x \in A$. Then, $\forall u (x \neq f_x(u))$. For all $u \in P$, by (P2) and Lemma $2$, $S(x) \neq S(f_x(u)) = f_{S(x)} (u)$. Thus, $S(x) \in A$. Hence, by (P3), $P = A$. $\square$