Expressing “Every student has passed at least one class” in FOL

first-order-logiclogic-translationpredicate-logic

My question:

Express this phrase in first-order language: "Every student has passed at least one class".

This is my teacher's answer:

We define $S(x)$ as "object $x$ is a student" , $C(x)$ as "object $x$ is
a class" and $P(x,y)$ as a predicate logic – symbol which translates to
"student $x$ has passed class $y$". So we have:

$\forall x (S(x) \rightarrow \exists y [C(y) \land P(x,y)])$.

My question is what about : "$\forall x S(x) \exists y ( C(y) \land P(x,y))$". Why the second one is wrong?

Best Answer

Perhaps you've read somewhere something like

$\forall x \in \mathbb{N} P(x)$

and try to apply the same pattern to the sentence in question with $x \in \mathbb{N}$ corresponding to $S(x)$ and $P(x)$ to $\exists y ...$.

But the above is not strictly speaking a first-order formula, but just an abbrevation for

$\forall x (x \in \mathbb{N} \to P(x))$

and is normally only used with set membership statements $x \in Y$, not predicates like $S(x)$.

If you are asserting two formulas $S(x)$, $\exists y ...$ then by the syntax of predicate logic, you must have a connective in between them so the whole thing becomes another formula, and that's missing in your proposal.


Besides, as mentioned in the comments,

$\forall x S(x) \to \exists y (C(y) \land P(x,y))$

is not the correct solution. Your teacher probably wrote

$\forall x (S(x) \to \exists y (C(y) \land P(x,y)))$

-- the $\forall x$ must range over the implication, not just the $S(x)$.

Related Question