Show that axiom of replacement implies from the Axiom of Specification [Proof Verification] 
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. 
 A: Your argument isn't quite correct. But it's on the way.
You are given a property $P$ and you want to separate a subset of $A$ which is specified by the property $P$.
For this, you need to find a property $Q(x,y)$ for which if $x\in A$, then there is at most a single $y$ such that $Q(x,y)$ holds, and you need to choose $Q$ in such a way that you get exactly the subset of $A$ specified by $P$.

The obvious solution, of course, is $Q(x,y)$ to be $x=y\land P(x)$. I will leave you to prove that it satisfies the conditions needed to apply Replacement on $Q$, and of course $\{y\mid Q(x,y)\text{ holds for some }x\in A\}$ is exactly—by the definition of $Q$—the same $\{x\in A\mid x=x\land P(x)\}$ which in turn is exactly $\{x\in A\mid P(x)\}$.
A: Informal talk:
Axiom of the specification allows you to build smaller sets from the given set. The sets you build from the axiom of specification always contain the elements of the set you started with.
Axiom of replacement allows you to build totally different sets (of equal or less cardinality) from the given set. It may be that the sets you built with the axiom of replacement contain no element of the set you started with.
In this sense, the axiom of replacement allows you to build more sets than the axiom of the specification does. Can we build all the sets that we built from the axiom of specification from the axiom of replacement?
Let's try:
We need to restrict ourselves to the starting set. For each element of the starting set, we can find at most one object which will be in our newly constructed set. We better demand that this new element be the same as the element we started with. But only including this condition will add too many elements, some of which may not follow the restricting property of the set we built from the axiom of specification. Hence we also demand that this new element follow that property.
Formally:
If A is a set, we can build {$x: P(x), x\in A$} from the axiom of specification. To build the same set from the axiom of replacement, Choose the property $Q(x,y): y = x$ and $P(y)$. Then the constructed set will be  {$y : Q(x,y), x\in A$}
Try to prove that these two sets are equal from the definition of equality of sets. You also need to show that there is atmost one $y$ for each $x$ for property $Q$ to be well defined.
Your proof is incorrect because

*

*You never defined what the property $P(x,y)$ is. You cannot simply replace y with x in the definition. In the book's notation, y denotes the elements that are in the set. You misunderstood what the symbols mean. Your idea is correct that we need to restrict $y$'s to $x$'s.

