TITLE: Is the 'variable' in 'let $y=f(x)$' free, bound, or neither?
QUESTION [13 upvotes]: Consider the string 'Let $y = f(x)$."  Suppose that it occurs in some elementary context, such as when graphing the function $f$ using $x$/$y$ coordinates.  How is this to be understood in predicate logic?  We can't have either $x$ or $y$ be free variables, for consider the following:
Let $f:\mathbb{R}\rightarrow \mathbb{R}, \forall x,\ f(x)=2x$
Let $g:\mathbb{R}→\mathbb{R}, \forall x,\ g(x)=x+x$
Let $y = f(x)$
Let $z = g(x)$
$\therefore y = z$
Here the last line is clearly true, but would lack a truth value if either variable were a free variable.
However, if both variables are bound, we're stuck with permutations of quantifiers that mean the wrong things:
$\forall x,\forall y,y=f(x)$   [says the universe has cardinality 1]
$\forall x,\exists y,y=f(x)$   [says f's domain is the universe]
$\exists y,\forall x,y=f(x)$   [says f is a constant function]
$\exists x,\forall y,y=f(x)$   [says the universe has cardinality 1 and f is nonempty]
$\forall y,\exists x,y=f(x)$   [says f is onto the universe]
$\exists x,\exists y,y=f(x)$   [says f is not the empty function]

REPLY [2 votes]: First, recall that a function is a set of ordered pairs, and the statement $y = f(x)$ is shorthand for $(x,y)\in f$. This is a perfectly good formula, where we make the usual assumption that the variables $x$, $y$ and $f$ represent sets as opposed to proper classes. The main observation is that if we take a formula $\varphi$ with free variables, then we shouldn't expect that sentences resulting from binding the free variables should necessarily be true.  
For example, if $\phi$ is $x=y$, then $\forall x,  \forall y, \varphi(x,y)$ is false, whereas $\forall x, \exists y, \varphi(x,y)$ is true. The ones you obtain above that "say the wrong things" are false. Moreover, if $\forall x$ is replaced with $\forall x\in A$ for some set $A$, then the proper class problems go away. (Same for $ \forall y$.)