In Proof and Types by Girard et alii. Section 7.4.2, I think that the authors want to show that:
(1) The set of functions definable in System T coincides with the set of recursive functions whose termination is provable in Peano arithmetic
I don't understand the arguments given to support this thesis.
In particular, if t is a closed term of type $Int \to Int$ of T, it induces a function $|t|:\mathbb{N} \to \mathbb{N}$ defined by:
$|t|(n) = m$ iff $t \overline{n} \leadsto \overline{m}$ $[\ldots]$
The functions $|t|$ are clearly calculable: the normalization algorithm gives $|t|(n)$ as a function of $n$. So those functions representable in T are recursive. Can we characterize the class of such functions?
This is how I read this parragraph:
Regarding calculability of $|t|$: using the iff one computes $|t|(n)$ by computing $t \overline{n} \leadsto \overline{m}$. Then $\overline{m}$ syntax can be more complex that an integer and in order to obtain $m$ one has to rewrite it into a normal form (which should be an integer by the term's type).
Regarding recursivity: I believe that they stress that the normalization begins with term $t \overline{n}$ and thus $|t|$ is indirectly "recursive" in its argument.
The next parragraph seems to confirm this view:
$[\ldots]$ Seen as a partial algorithm, $|t|$ amounts to looking for the normal form, and, in the case where this succeeds, writing it. The normalization theorem is thus a proof of program guaranteeing termination of all algorithms obtained from $T$.
From here I get the idea that every function written in $T$ is terminating. The next parragraph comes as a surprise though:
Now, what are the mathematical principles necessary to prove the reducibility of a fixed term t?
to be able to express the reducibility of t and of its subterms: one must be able to write a finite number of reducibilities, which can be done in Peano arithmetic (PA)
to be able to reason by mathematical induction on this finite number of reduciblity predicates; that can again be done in PA, modulo some awful coding without significant interest (Godel numbering).
Summing up, the termination is provable in arithmetic: we say that $|t|$ is provably total in PA.
If every function was terminating in System T why would one want to prove in PA specifically?
My question is if you can solve the doubts I presented or if you have your own way of showing statement (1)?