Deduction of $(\exists x Px \rightarrow \forall y Qy)\rightarrow \forall z(Pz \rightarrow Qz)$
My try: There exists a deduction as follows. The Deduction and Generalization Theorems together imply that it suffices to show $\{\exists xPx\rightarrow \forall yQy, Pz\}\vdash Qz$.
Now, I received a hint that the following statement in quotes is true, but I can't figure out why.
Moreover, by axiom, modus ponens (MP) and contraposition, it suffices to show $\{Pz, \neg\forall yQy\}\vdash \neg(\exists xPx\rightarrow \forall yQy)$.
The rest follows as so, I believe:
By MP and contraposition, we get $Pz\vdash \exists xPx$, noting that $\vdash \forall x \neg Px\rightarrow \neg Pz$ is an axiom. Now, by A1, we get $\vdash \exists x Px \rightarrow \neg\forall y Qy \rightarrow \neg(\exists xPx\rightarrow \forall yQy)$. Applying MP, we conclude that $\{Pz, \neg\forall yQy\}\vdash \neg(\exists xPx\rightarrow \forall yQy)$, as desired.
Could someone please explain the quoted part?
If we have :
by Deduction Theorem: $Pz \vdash ¬∀yQy \to ¬(∃xPx→∀yQy)$ and by Contraposition:
Thus, by Modus Ponens:
But; $\vdash ∀yQy \to Qz$, and thus:
Then, by Deduction Th again, followed by Generalization Th: