[Math] How to convert this sentence into a first order logic well formed formula

logic

I am trying to convert the following sentence to a well formed formula using first-order logic(Predicate logic).

All towers are of the same color.

I have defined the following predicates:

Tower(x) :: x is a tower.

Color(x, y) :: x is of color y

I am not able to convert the aforementioned sentence into a well formed formula using the above predicates. Is it possible to convert it using the above predicates or some new predicate should be required. Please advise.

Best Answer

I'd suggest first rephrasing it in English as a sentence that uses more and more of the formal logic expressions: something like

"For any towers x and y, x and y have the same color"

(Here I'm taking advantage of the fact that it is equivalent to say that a whole class of elements shares a property and to say that every pair of elements in that class shares the property).

then we can further rephrase this as

"For any towers x and y, x has color c if and only if y has color c"

and finally

"For any towers x and y, any c is the color of x if and only if it is the color of y"

Then we need to write that symbolically, remembering that quantifying over certain types of things (towers in our case) can be written as quantification over an implication:

"For all x and y, if x and y are towers, then any c is the color of x if and only if it is the color of y"

$\forall x \forall y \left ( \left ( \operatorname{Tower}(x) \& \operatorname{Tower}(y) \right ) \longrightarrow \forall c \left ( \operatorname{Color}(x,c)\leftrightarrow \operatorname{Color}(y,c) \right ) \right )$

If you want, you can pull the quantification over the $c$ variable out front:

$\forall x \forall y \forall c \left ( \left ( \operatorname{Tower}(x)\& \operatorname{Tower}(y) \right ) \longrightarrow \left ( \operatorname{Color}(x,c)\leftrightarrow \operatorname{Color}(y,c)\right ) \right )$

Related Question