While studying first-order theories (or logic in general) I often encountered the phrase that "it was not possible to show that a function $f$ is total" (i.e. defined everywhere) and hence I deduced that there is a need to show this everytime when I deal with a function.
But what does this even mean? Why should a function not be total? Wikipedia states that total function is just a synonym for function.
So when the language $L$ of my first-order theory $T$ contains a function symbol $f$, does "showing totallity" mean that I have to prove $(\forall x)[(\exists y)[f(x)=y]]$? Answers to my other question suggested that this is indeed not necessary as this can be proven from the usual axioms and deduction rules:
Let $f$ be a function symbol. Then $f(u)$ is a term. Using the reflexivity of $=$, we can deduce $f(u)=f(u)$. This allows to deduce $(\exists y)[f(u)=y]$ and finally by introduction of universal quantification also $(\forall x)[(\exists y)[f(x)=y]]$.
So my question is: what does it exactly mean to prove that a function is total and why is there a need to do so? I ask this question because the totallity of a function was mentioned several times while discussing this other question of mine.
Let $L=\{+,\cdot, 1, 0\}$ be the language of arithmetic, i.e. $+,\cdot$ are binary function symbols and $0,1$ are constant symbols. Consider the Gödelization $\overline\bullet:\mathbb{N}\to T^L$ which assigns to a natural number $n$ the $L$-Term $\underbrace{1+\dots+1}_{n\text{ times}}$
Let $\Phi$ be a set of $L$-sentences and $f:\mathbb{N}\to\mathbb{N}$ be a function. We say that $\Phi$ represents $f$ if there is a $L$-formula $\varphi_f(x,y)$ s.t. $$f(n)=m \qquad\text{iff}\qquad\Phi\models\varphi_f(\overline n, \overline m)$$
In particular, if $\Phi$ represents $f$, then for all $n$ there is $m$ s.t. $\Phi\models\varphi_f(\overline n, \overline m)$. This does however not imply that $\Phi\models\forall x \exists y \varphi_f(x,y)$. If the later holds, we say that $\Phi$ proves that $f$ is total.
For illustration let us look at the following results:
Theorem: Let $\Phi=PA$ be the theory of Peano Arithmetic, then $\Phi$ represents every computable function $f:\mathbb{N}\to\mathbb{N}$.
So in particular it represents the Goodstein Fuction $G$ by a formula $\varphi_G$, however we have
Kirby Paris Theorem: $PA$ does not prove that $G$ is total, i.e $$PA\not\models\forall x \exists y \varphi_G(x,y)$$