I'm reading Godel incompleteness theorem from Mathematical introduction to logic by Enderton. There is something about recursive functions I don't get. In the text it first says:
"DEFINITION. A relation R on the natural numbers is recursive iff it is representable in some consistent finitely axiomatizable theory"
Theorem: Any recursive relation is representable in Cn A$_E$.
PROOF. Recall that the relation R is recursive iff there is some finite consistent set A of sentences such that some formula ρ represents R in CnA. (There is no loss of generality in assuming that the language has only finitely many parameters: those in the finite set A, those in ρ, and 0, S, and ∀.) In the case of a unary relation R, we have that a ∈ R iff the least D which is a deduction from A of either ρ(S$^a$0) or ¬ ρ(S$^a$0) is, in fact, a deduction of the former. More formally, a ∈ R iff the last component of f(a) is ρ(S$^a$0),where
f (a) = the least d such that d is in the set of item 18 and the last component of d is either ρ(S$^a$0) or¬ ρ(S$^a$0). For this (fixed) ρ, there always is such a d.
Can you explain why defining f as it is proves the representability of R?