I'm studying (independently) mathematical logic and in investigating self-referential statements I developed a result which I don't know how to interpret. I'll use the notation from Enderton's "A mathematical introduction to logic" (p 266-267):
Let $T$ be any sufficiently strong recursively axiomizable theory (PA or ZF will do) and let $\sf Prb_T \sigma$ (Here $\sf Prb_T$ abbreviates "provable in $T$") express that $\sigma$ has a deductive proof in $T$. (i.e. $\sf Prb_T \sigma$ means $T \vdash \sigma$). Let $\sf Cons T$ be a sentence expressing that $T$ is consistent (such as $\neg \sf Prb_T (0=1))$. Then using the fixed-point lemma we can get a sentence $\sigma$ such that:
$$T \vdash (\sigma \leftrightarrow \sf Prb_T (\sf Cons T \rightarrow \neg \sf Prb_T \sigma))$$
Now either $T \vdash \sigma$ or $T \nvdash \sigma$. I will show that we cannot have either assuming $T$ is consistent.
If $T \vdash \sigma$ then by our definition of $\sigma$ we have that $T \vdash \sf Prb_T (\sf Cons T \rightarrow \neg \sf Prb_T \sigma)$. This implies that $T \vdash (\sf Cons T \rightarrow \neg \sf Prb_T \sigma)$ But this means that we have a proof of $T$ being consistent implies $T \nvdash \sigma$ which contradicts this initial hypothesis of $T \vdash \sigma$. Therefore, assuming $T$ is consistent, we must have $T \nvdash \sigma$. But this too also leads to a contradiction, for by our construction of $\sigma$ we now have $T \nvdash \sf Prb_T (\sf Cons T \rightarrow \neg \sf Prb_T \sigma)$. This means that there is no proof of $T$ being consistent implying that $T \nvdash \sigma$. However, we just provided a proof (albeit meta-mathematical in nature) testifying to this fact.
So what should I logically conclude from this? I figure that this implies that $T$ is inconsistent. I guess there is another possibility: That this whole result/proof cannot be formalized thus removing the contradiction (or maybe not because then we might have a contradiction with the Completeness Theorem for first-order logic). I know that by Godel's Second Incompleteness Theorem assuming $T$ is consistent then $T \nvdash \sf Cons T$. However $T$ can still prove some facts about implications involving $\sf Cons T$ (In fact, Enderton gives one such example on the bottom of page 267). My understanding is that most meta-mathematical results such as Godel's incompleteness theorem and Tarski's undefinability theorem can be represented and proven in the deductive calculus. Am I wrong on this? If I'm not then what makes this result any different?