Symbolic LogicRelations and Identity

At Least, At Most and Exactly

With identity we can count: "at least two F" is ∃x∃y(Fx ∧ Fy ∧ x ≠ y); "at most one" and "exactly one" follow the same pattern.

Not started Jump to practice

Identity (Identity) lets logic count, without any numbers. "At least two", "at most one" and "exactly one" can all be written with quantifiers, $=$ and $\neq$.

Counting with identity.
EnglishSymbols
At least one thing is $F$.$\exists x Fx$
At least two things are $F$.$\exists x\exists y((Fx \land Fy) \land x \ne y)$
At most one thing is $F$.$\forall x\forall y((Fx \land Fy) \to x = y)$
Exactly one thing is $F$.$\exists x(Fx \land \forall y(Fy \to y = x))$

Key idea

"At least two" needs two variables and $x \neq y$ to make them different. "At most one" says any two $F$ things are identical. "Exactly one" is at least one and at most one: something is $F$, and anything $F$ is that thing.

Why it works

Two variables do not have to name two different things. $\exists x\exists y(Fx \land Fy)$ is true in a world with a single $F$ object: let $x$ and $y$ both be that object. So to say "two", you must say the two are distinct, which is what $x \neq y$ does. In the other direction, "at most one" cannot list the objects; instead it says that whenever you find $F$ things, they turn out to be one and the same.
Two red shapes and one square. Edit the colors and watch the counts change.

Worked examples

Worked example: At least two

Let $Sx$: $x$ is a square. Translate "There are at least two squares."
  1. Two variables, both squares, and different from each other.

Answer: $\exists x\exists y((Sx \land Sy) \land x \ne y)$

Worked example: At most one

Translate "There is at most one square."
  1. Any two squares are the same square.

Answer: $\forall x\forall y((Sx \land Sy) \to x = y)$

Worked example: Exactly one

Translate "There is exactly one square." Is it true in the world above?
  1. Something is a square, and any square is that thing.
  2. In the world, $b$ is the only square.

Answer: $\exists x(Sx \land \forall y(Sy \to y = x))$; true.

Common mistake

Writing $\exists x\exists y(Fx \land Fy)$ for "at least two". Without $x \neq y$, both variables can be the same object, so the formula says only "at least one". Whenever you mean "two different things", add the $\neq$.

These formulas can be checked in a world like the one above. For "at least two red shapes", look for two different red objects: $a$ and $b$ will do. For "at most one", look for two different objects with the property; finding them makes the sentence false. For "exactly one", find one and check there is no second.

The pattern extends to any number. "At least three" needs three variables, all pairwise different: $x \neq y$, $x \neq z$ and $y \neq z$. It gets long, but it shows something remarkable: counting, which seems to need numbers, can be done with logic alone.

"At most one" is true when nothing is $F$ at all, since then there are no two $F$ things to compare. That is why "exactly one" adds $\exists x Fx$ to it.

Practice

Pass with 3 right answers, the last 2 in a row. Each right answer earns 3 XP.

Loading practice…

Builds on

Leads to

Sources and further reading

  • Patrick J. Hurley and Lori Watson, A Concise Introduction to Logic, 13th ed., section 8.7, numerical statements
  • forall x: Calgary, an open introduction to formal logic (P. D. Magnus, Tim Button and others; Open Logic Project), chapter on identity, counting
@teddyrookbook GitHub