TITLE: Axiom schema of specification (formula arguments)
QUESTION [9 upvotes]: Some sources define the formula like this:
$$
\forall w_1,\ldots,w_n \, \forall A \, \exists B \, \forall x \, ( x \in B \Leftrightarrow [ x \in A \wedge \varphi(x, w_1, \ldots, w_n , A) ] )
$$
Why are all the w* arguments necessary? My logic tells me that this is equivalent:
$$
\forall A \, \exists B \, \forall x \, ( x \in B \Leftrightarrow [ x \in A \wedge \varphi(x) ] )
$$
EDIT: I'll clarify what I'm asking.
If we have a formula of 2 variables, then for a given value of one of them we can always express it as a formula of 1 variable. 
So in the first schema we have one instance for the formula
$$
\varphi(x, z) = \exists{u}(x \in u \wedge u \in z)
$$
and this allows us to construct certain sets. The same sets can be constructed with the second schema if we have one instance for each of the formulas
$$
\varphi_z(x) = \exists{u}(x \in u \wedge u \in z)
$$
there are as many formulas as there are values of z.
So each set defined using the first schema can be defined using only one-variable formulas. Then we don't need the more complex definition. Am I wrong?

REPLY [6 votes]: You do not need parameters. 
Ralf Schindler wrote a short note where you can see the details (and Ralf and I discussed it last year around May). Eventually we found an early reference, that proves an even stronger theorem. See

Azriel Levy, Parameters in the comprehension axiom schemas of set theory, in Proceedings of the Tarski symposium, Proceedings of Symposia in Pure Mathematics, vol. 25, American Mathematical Society, Providence, RI, pp. 309–324. 

(See also Akihiro Kanamori's In praise of replacement for further discussion and additional references.)
The theorem in Ralf's note is stronger than you are asking: We can formulate $\mathsf{ZFC}$ without requiring parameters in either comprehension (specification) or replacement. 
As you can see, the argument is less than a page long. Let me give a quick summary: Note first that we can prove the existence of $0$ and $1$, and therefore of ordered pairs of the form $(a,0)$ or $(a,1)$ for any $a$. From (an instance of parameter-free) replacement, we get that $a\times\{0\}$ and $a\times\{1\}$ exist for any $a$. Also, for any $a$ and $b$, $(a\times\{0\})\cup\{(b,1)\}$ exists. From this we can prove that $$\{((u,0),(b,1))\mid u\in a\}$$ exists for any $a$ and $b$: First, $d=\mathcal P(\mathcal P((a\times\{0\})\cup\{(b,1)\}))$ exists, and the set we want is $$\{x\in d\mid \exists u\,\exists v\,(x=((u,0),(b,1)))\},$$ which exists by applying an instance of parameter-free specification.
We can now prove specification with parameters. For this, note that using pairing, we can code finitely many parameters into a single one, so it is enough to show the result for formulas with one parameter, say $\phi(x,v)$. That is, given $a,b$, we must show that $$\{x\in a\mid \phi(x,b)\}$$ exists.
We use the parameter-free instance of replacement given by the class function $F$ defined by $F(x)=0$ unless $x$ has the form $((u,0),(c,1))$ for some $u,c$, in which case we set $F(x)=u$. We see that 
 $$ F''\{((u,0),(b,1))\mid u\in a\}= \{x\in a\mid \phi(x,b)\}\cup\{0\}, $$
and from this your question follows (by applying a parameter-free instance of specification to remove $0$ from the set, if needed). 
To conclude, we prove replacement for formulas with one parameter (which again, by pairing, is enough). Accordingly, let $\phi(x,y,v)$ be a formula, let $b$ be a set, and suppose that for every $x$ there is a unique $y$ such that $\phi(x,y,b)$. We must show that, for any $a$, $$ \{y\mid\exists x\in a\,(\phi(x,y,b))\} $$ exists.
We use the parameter-free instance of replacement given by the class function $F$ defined by $F(z)=0$ unless there are $x,c$ with $z=((x,0),(c,1))$, and there is a unique $y$ such that $\phi(x,y,c)$ holds, in which case we set $F(z)=y$. We then see that 
 $$ F''\{((x,0),(b,1))\mid x\in a\}=\{y\mid\exists  x\in a\,(\phi(x,y,b))\}\cup\{0\} $$
and, as before, we are done by a last appeal to a (parameter-free) instance of specification, if removing $0$ from the set is needed.