The negation of $\exists x \forall y \neg \forall z(P(x,y) \iff Q(x,y) \land R(x,y,z))$

logic

I am trying to understand the negation of
$\exists x \forall y \neg \forall z(P(x,y) \iff Q(x,y) \land R(x,y,z))$

As a side example if I have a statement
$\neg \forall x P(x)$, then this is equivalent to $\exists x \neg P(x)$ where the negation is $\forall x P(x)$, motivating what I think is the answer to my overall question.

Then I believe the answer should be:
$\forall x \exists y \forall z(P(x,y) \iff Q(x,y) \land R(x,y,z))$ (i.e simply remove the $\neg$ from the $\forall z$)

but I am a bit paranoid that the answer could be:
$\forall x \exists y \forall z(P(x,y) \iff \neg Q(x,y) \lor \neg R(x,y,z))$, passing the negation through to the inner bracket.

Any insights which is correct appreciated.

Best Answer

Your initial feeling is right:$$\neg\exists x\forall y\neg\forall z\phi(x,\,y,\,z)\iff\forall x\neg\forall y\neg\forall z\phi(x,\,y,\,z)\iff\forall x\exists y\forall z\phi(x,\,y,\,z).$$Alternatively,$$\neg\exists x\forall y\neg\forall z\phi(x,\,y,\,z)\iff\neg\exists x\neg\exists y\exists z\phi(x,\,y,\,z)\iff\forall x\exists y\forall z\phi(x,\,y,\,z).$$

Related Question