What is the difference between $$ \forall x \in X (P(x) \iff \exists y \in X \ (D(x,y))) $$
and
$$ \forall x \in X, \exists y \in X , (P(x) \iff D(x,y)) $$
I'm a bit confused, wouldn't they end up meaning the same thing once you expand it out? Or am I totally wrong?
If they are equivalent then, comparing the formulas after the first quantification we must have $$ (P(x) \leftrightarrow\exists y \in X \ : \,D(x,y)) \iff \exists y \in X : (P(x) \leftrightarrow D(x,y)) $$ the last equivalence you can check here that t is false.