Show that axiom of replacement implies from the Axiom of Specification

Axiom $3.6$ (Replacement). Let $A$ be a set. For any object $x \in A$ and any
object $y$, suppose we have a statement $P(x, y)$ pertaining to $x$ and $y$,
such that for each $x\in A$ there is at most one $y$ for which $P(x,y)$ is
true. Then there exists a set $\{y: P(x, y) \text{ is true for some } x \in A\}$
such that for апy object $z$, $$ z\in \{y : P(x, y)\text{ is true for some } x \in A\} \iff P(x,z)\text{ is true for some } x \in A.$$

Axiom $3.5$ (Specification). Let $A$ be a set, and for each x$\in$ $A$, let $P(x)$ be a property pertaining to $x$ (i.e., $P(x)$ is either a
true statement or a false statement). Then there exists a set, called
$\{x \in A : P(x) \text{ is true}\}$ (or simply $\{x \in A : P(x) \text{ for short}\}$), whose elements are precisely the elements $x$ in $A$ for which $P(x)$ is true. In other words, for any object $y$, $$у \in \{x \in A: P(x)\text{ is true}\} \iff (y \in A \text{ and } P(y)\text{ is true}).$$

I have to show that $3.6\implies 3.5.$

Proof: By $(3.6)$ we can assume the following set $$\{x:P(x,x)\text{ is true for some }x\in A\}.$$ Let $Q(x)=P(x,x)$ then we get the set $$\{x\in A:Q(x) \text{ is true for some }x\},$$
which is what $(3.5)$ wants. Is this proof correct?

PS. I have read other answers to this question on MSE, but none of them use this formulation of the axiom and I guess use more formal notation. I am learning from Tao’s Analysis book and so I’ve not been introduced to such notation.

Solutions Collecting From Web of "Show that axiom of replacement implies from the Axiom of Specification"

Not exactly…

From (3.6) :

$y ∈ \{ z \mid \exists x (x \in A \text { and } P(x,z)) \} \Leftrightarrow \text P(x,y) \text { holds for some } x \in A$.

You have to recall that: $y \in \{ z \mid \phi(z) \} \Leftrightarrow \phi(y)$.

Thus the LHS is: $\exists x (x \in A \text { and } P(x,z))$ and it is the same as the RHS.

But the LHS can be rewritten also as :

$y ∈ \{ z \in A \mid \exists x (P(x,z)) \}$

that is : $y ∈ \{ z \in A \mid Q(z) \}$ and again:

$y ∈ \{ z \in A \mid Q(z) \} \Leftrightarrow y \in A \text { and } Q(y) \text { holds }$.