4.2 Recursive definitions [274]

Theorem 134

[08Z]

Let \(A\) be a non-empty set; suppose that \(a∈ A\) is fixed, and functions \(g_ n:A→ A\) are given, one for each \(n∈ℕ\). Then there exists an unique function \(f:ℕ→ A\) such that

  • \(f(0)=a\), and

  • for every \(n∈ℕ\) we have \(f(S(n))=g_ n(f(n))\).

We will say that the function \(f\) is defined by recurrence by the two previous conditions.

Proof

[090] Trace of proof. Note that the proof only uses Peano’s axioms and induction. Given \(m∈ℕ,m≠ 0\) we recall that \(S^{-1}(m)\) is the predecessor, see 131 (using the arithmetic we may write

\[ S^{-1}(m)=m-1 ~ ~ ,~ ~ S(k) = k+1 \]

but this theorem is needed to define the arithmetic...) For any given \(R⊆ ℕ× A\) we define the projection on the first component

\[ 𝜋(R)=\{ n∈ℕ,∃ x∈ A, (n,x)∈ R \} ~ . \]

Consider the family \({\mathcal F}\) of relations \(R⊆ ℕ× A\) that satisfy

\begin{equation} (0,a)∈ R \tag {*} \end{equation}
135

\begin{equation} ∀ n≥ 0,∀ y∈ A,~ ~ (n,y)∈ R⇒ (S(n),g_ n(y))∈ R \tag {**} \end{equation}
136

We show that under these conditions \(𝜋(R)=ℕ\); we know that \(0∈ 𝜋(R)\); if \(m\in 𝜋(R)\), then there exists \(x∈ A\) for which \((m,x)∈ R\) from which for ** follows \((S(m),g_{m}(x))∈ R\), and we obtain \(S(m)∈ 𝜋(R)\).

The family \({\mathcal F}\) is not empty because \(ℕ× A∈ {\mathcal F}\). Let then \(T\) be the intersection of all relations in \({\mathcal F}\). \(T\) is therefore the least relation in \({\mathcal F}\).

It is possible to verify that \(T\) satisfies the previous * and ** properties. In particular \(𝜋(T)=ℕ\).

We must now show that \(T\) is the graph of a function (which is the desired \(f\) function), that is, that for every \(n\) there is a single \(x∈ A\) for which \((n,x)∈ T\).

Let \(A_ n=\{ x∈ A, (n,x)∈ T \} \); we write \(|A_ n|\) to denote the number of elements in \(A_ n\); since \(𝜋(T)=ℕ\) then \(|A_ n|≥ 1\) for every \(n\). We will show that \(|A_ n|=1\) for each \(n\). We will prove it by induction. Let

\[ P(n) \doteq |A_ n| = 1\quad . \]

Let’s see the induction step.

Suppose by contradiction that \(|A_{m}|=1\) but \(|A_{Sm}|≥ 2\); morally at \(m\) the graph of the function \(f\) ”forks” and the function becomes ”multivalued”. We define for convenience \(w=g_{m}(x),k=Sm\); we may remove some elements to \(T\) (those that do not have a ”predecessor” according to the relation **) defining

\[ \tilde T=T⧵ \{ (k,y) : y∈ A, y≠ w \} \]

it is possible to show that \(\tilde T\) satisfies * and **, but \(\tilde T\) would be smaller than \(T\), against the minimality of \(T\). To prove that \(P(0)\) holds, we define \(k=0,w=a\) and proceed in the same way.

The previous reasoning also shows that the function is unique, because if the graph \(G\) of any function satisfying to * and ** must contain \(T\), then \(T=G\).

More generally given \(g_ n:A^{n+1}→ A\), an unique function \(f:ℕ→ A\) exists, such that \(f(0)=a\) and for every \(n∈ℕ\) \(f(S(n))=g_ n(f(0),f(1),\ldots f(n))\).

E136

[1X7]Prerequisites:134.Adapt the exercise 134 to define the Fibonacci sequence, which satisfies the rule

\[ a_ 0=1\quad ,\quad a_ 1=1\quad ,\quad a_ n=a_{n-1}+a_{n-2} \]

for \(n≥ 2\).

Hint. You don’t have to rewrite the whole proof of 134, rather choose \(A=ℕ^ 2\) and choose \(g\) with cunning.

Hidden solution: [UNACCESSIBLE UUID ’1X8’]

E136

[294]Define the interval

\[ I_ n = \{ 0,\ldots n\} \]

of natural numbers using a recursive definition (without using the order relation).

Hidden solution: [UNACCESSIBLE UUID ’295’]