I have been trying to find some similar questions but couldn't find one.
My question is the following predicate: $\forall$x$\forall$yP(x,y).
Suppose P(x, y):x has written an email to y, my question in this case that I am not sure if the domain of subject is shared between x and y. In my opinion, if we understand nested quantifiers somehow similar to nested loops in CS, I personally think then in this case, x should also have written an email to itself right?
Confused about this concecpt, hope someone can help. Thanks. :)
Yes indeed. If we have $\forall x \forall y P(x,y)$, then we do have $P(x,x)$, so $x$ does send an email to itself in your example.
The statement means ‘for all $x$ and for all $y$, $P(x,y)$ is true’, so it is true for any pair of $x$ and $y$—including when the two are equal.
Nested quantifiers are kind of similar to nested loops, as you say. We can write your statement as $\forall x [\forall y P(x,y)]$ and then you can indeed view this as asserting $P(x,y)$ for each $y$, for each $x$ just like two nested for loops.