TITLE: Where is the mistake in this "proof" of the inconsistency of ZFC?
QUESTION [10 upvotes]: This is a "proof" that ZFC is inconsistent, but I haven't found the mistake yet. 

Let $\{\varphi_n \colon n <\omega\}$ be an enumeration of all formulas in $L_{\in}$ with exactly one free variable. Consider the formula
  $$\psi(x) \equiv x \in \omega \land \lnot \varphi_x(x) \, .$$
  Since $\psi$ is a formula with one free variable, then $\psi$ is $\varphi_k$ for some $k$. But then, 
  $$\mathrm{ZFC} \vdash \varphi_k(k) \leftrightarrow \psi(k) \leftrightarrow \lnot \varphi_k(k)$$

I have been giving this a lot of time, but I still cannot figure out the error on the fake proof here. Can anyone give me a clue?

REPLY [11 votes]: "ZFC" is a red herring.
$
\def\eq{\Leftrightarrow}
\def\nn{\mathbb{N}}
$
Take any first-order theory $S$, and any $2$-parameter sentence $P$ over $S$. Let $Q(x) :\equiv \neg P(x,x)$. Then $Q$ is a $1$-parameter sentence and $S$ trivially proves "$\forall y \exists z ( \neg Q(z) \eq P(y,z) )$". Now observe that if $S$ has a countable language and also has a countable set $T$ of provably distinct terms, then all $1$-parameter sentences over $S$ can be enumerated and put in bijection with the interpretation of $T$ in any model of $S$. However, the above fact shows that no $2$-parameter sentence over $S$ can capture any such enumeration, despite $T$ appearing to provide sufficiently many objects!
For example, no $2$-parameter sentence $P$ over PA represents (in the above sense) an enumeration of all $1$-parameter sentences $X$ over PA, despite there being a concrete bijection between the terms $N = \{``$1$", ``$1+1$", ``$1+1+1$", \cdots \}$ and $X$. Furthermore, there is a computable bijection $r$ from $N$ to $X$, and hence we can in fact explicitly construct a $2$-parameter sentence $R$ over PA such that for every $t \in N$ and $Q \in X$ we have that $\text{PA} \vdash R(c(t),c(Q))$ if $r(t) = Q$ and $\text{PA} \vdash \neg R(c(t),c(Q))$ if $r(t) \ne Q$. What we do not have is a $2$-parameter sentence over PA that attains the truth values of an enumeration of $X$.
I call this phenomenon a syntactic version of Cantor's theorem, because Cantor's theorem says there is no countable enumeration of functions from $\nn$ to booleans, and here we have proven that there is no 'syntactic' enumeration of predicates over $S$.