[Math] Help translating some sentences into predicate logic

logiclogic-translationpredicate-logicpropositional-calculus

Consider a language of predicate logic with a constant sybol $1$, with unary predicate symbols $prime$, $odd$ and $even$, and with a binary predicate symbol $|$.

The intended domain of discourse is the set of non-negative integers, and the intended interpretation of the predicate and constant symbols is what their names suggest. e.g. $prime(x)$ means that $x$ is a prime number, and the binary predicate symbols $|$ represents the "divides" relation, written in infix notation, so $x|y$ means that $y$ can be divided by $x$ without reminder.

Am I correct in my translations of the following sentences into predicate logic with equality, using only the above predicate and constant symbols?

a) One is an odd number.

My attempt: $odd(1)$

b) All prime numbers are odd or even.

My attempt: $\forall x (prime(x) → (odd(x) ∨ even(x)))$

c) No prime number is both odd and even.

My attempt: $ \neg\exists x (prime(x) ∧ (odd(x) ∧ even(x))$

d) Some even numbers can be divided by an odd number without remainder.

My attempt: $ \exists x \exists y (even(x)|odd(y))$

e) Prime numbers can only be divided by one and by themselves without remainder

My attempt: $ \forall x (prime(x) → prime(x)|1 ∨ prime(x)|prime(x)))$


Second attempt at d)
$ \exists x \exists y (even(x) ∧ odd(y) ∧ y|x)$

Second attempt at e) $\neg \exists x \exists y (prime(x) ∧ y|x) $ where $y \ne 1$ or $y \ne x$


Fourth attempt at e)

$\neg \exists x \exists y (prime(x) ∧ y|x ∧ y \ne 1 ∧ y \ne x)$

Best Answer

a,b,c are correct. Issues with d. First, odd and even are switched ($x|y$ means $x$ divides evenly into $y$, not the other way around). Second, more importantly, it should be $\exists x\exists y(even(x)\wedge odd(y) \wedge y|x)$ ($odd(x)|even(y)$ has no meaning).

Same two issues with e. You can't use $1|prime(x)$ to mean "x is prime and 1 divides x". For that you need to say $prime(x)\wedge 1|x.$

There is a more important issue with $e.$ What you're going for says that any prime number is divisible by one and itself. That's true of any number and not what you're asked to say. You need to say that it's divisible only by one and itself.