# Difference between if-then and iff in predicate logic

Let C(x,y) be student x is in class y. Where the domain for x is all the students in my school and domain of y is the set of all classes in my school.

Given ∃x,y ∀z((x≠y)∧(C(x,z)↔C(y,z))) , the answer given to me is there are exactly 2 students that take the same classes z. Why there can't be more than 2?

Given ∃x,y ∀z((x≠y)∧(C(x,z)->C(y,z))), the answer for this is that there are at least 2 students that take the same classes

-
Do you mean $\exists x,y~\forall z\Big((x\ne y)\land \big(C(x,z)\leftrightarrow C(y,z)\big)\Big)$? That says that there are two students who take exactly the same classes. There may also be other students who take exactly the same set of classes. Your title doesn’t really seem to describe your question, though. – Brian M. Scott Oct 25 '12 at 3:44
Thank you, I have made the appropriate changes.I think that for the first statement, there can be more than 2 students taking the same classes. However my professor insist its exactly 2. – user1050548 Oct 25 '12 at 3:59
For the second, the given answer is not right either. The sentence says there are (at least) two students, say Xavier and Yolande, such that whenever Xavier is in a class, so is Yolande. But Yolande might be taking more classes than Xavier. – André Nicolas Oct 25 '12 at 3:59

What you were told is incorrect: neither sentence means what you were told. The sentence

$$\exists x,y~\forall z\Big((x\ne y)\land\big(C(x,z)\leftrightarrow C(y,z)\big)\Big)$$

says that there are (at least) two distinct students who take exactly the same classes: $x$ takes class $z$ if and only if $y$ takes class $z$. There may be any number of other students who also take exactly this set of classes; nothing in the sentence excludes that possibility.

The sentence

$$\exists x,y~\forall z\Big((x\ne y)\land\big(C(x,z)\to C(y,z)\big)\Big)$$

says that there are students $x$ and $y$ who are not the same student and who are such that if $x$ takes a class, $y$ also takes that class. In other words, $y$ takes every class that $x$ takes, and possibly (but not necessarily) some that $x$ doesn’t take. This means, for instance, that we could not have just three students, $a,b$, and $c$, and three classes, $C_1,C_2$, and $C_3$, such that $a$ takes $C_1$ and $C_2$, $b$ takes $C_2$ and $C_3$, and $c$ takes $C_3$ and $C_1$: in that setup no student takes all of the classes that some other student takes.

-
Just to emphasize what's implicit in your answer and contrary to the interpretations cited in the question: The second sentence can be true even if no two students take exactly the same classes. – Andreas Blass 15 hours ago