Sets and Logic · Hierarchy

In first-order logic, statements about objects are written as strings of symbols with variables and quantifiers. A formula is every such string that is built by the rules of the language, such as $x > 3$ or $\forall x \, (x^2 \geq 0)$, and the variables in a formula can be free or bound by quantifiers. A sentence is a formula in which a quantifier binds every variable, so a sentence is true or false once its symbols are interpreted, without assigning values to variables.

sentence ⊂ formula

Definitions

Missing definition: formula_logic

sentence

Undergraduate (first-order logic)

Consider a formula of first-order logic, such as $\forall x \, (x^2 \geq 0)$ or $x > 3$. The formula is a sentence if it has no free variables: every variable in it is bound by a quantifier.

Examples
Non-examples
  • “$7$ is prime”
    “$7$ is prime” is not a sentence of first-order logic, because “$7$ is prime” is written in English, not as a string of symbols of a formal language.
  • “$x > 3$”
    “$x > 3$” is not a sentence, because $x$ is a free variable.
  • $\exists y \, (y > x)$
    $\exists y \, (y > x)$ is not a sentence, although $\exists y \, (y > x)$ has a quantifier: the quantifier binds $y$, but $x$ is free, so the truth of $\exists y \, (y > x)$ depends on the value of $x$ (for example, if $x$ and $y$ range over the natural numbers, then the formula is true for every $x$, and if $x$ and $y$ range over $\setdef{1, 2, 3}$, then the formula is false for $x = 3$).
  • $p \land \neg q$
    $p \land \neg q$ is not a sentence of first-order logic, because the variables $p$ and $q$ stand for whole statements, not for objects such as numbers, and $p \land \neg q$ has no quantifiers; a sentence such as $\forall x \, (x^2 \geq 0)$ has variables that stand for objects, and a quantifier binds each of those variables.
Properties
  • Once its symbols are interpreted in a structure (such as $\reals$ with its usual operations), a sentence is true or false, so it expresses a proposition.
  • A formula with free variables, such as $x > 3$, expresses a predicate. Quantifying every free variable turns it into a sentence.

Examples

Example formula_logic sentence Why
“$x > 3$” ✓✗ “$x > 3$” is a formula but not a sentence, because its variable $x$ is free.
$\exists y \, (y > x)$ ✓✗ $\exists y \, (y > x)$ shows that a formula with a quantifier can still fail to be a sentence: the quantifier binds $y$ but leaves $x$ free.
$\forall x \, (x^2 \geq 0)$, with $x$ ranging over $\reals$ ✓✓
Missing example: x_squared_plus_1_as_an_expression

Notes

  • Quantifying every free variable of a formula gives a sentence: $\forall x \, (x > 3)$ and $\exists x \, (x > 3)$ are sentences.
  • A formula with free variables expresses a predicate, and a sentence expresses a proposition once its symbols are interpreted.

See also

All distinctions · All definitions