First-order logic (source code)

= First-order logic
{wiki}

<First-order logic> builds assertions using variables, <logical connectives>, and quantifiers over elements of a structure. A chosen <first-order language> supplies constants, function symbols, and relation symbols. The quantifiers range over elements, rather than arbitrary subsets or predicates.

For example, $\forall x\,\exists y\,(x<y)$ says that an ordered domain has no greatest element. It is true in the <integers> but false in a nonempty finite <total order>. A formal proof manipulates formulas syntactically, while a <model of a first-order theory> supplies their meanings. <Gödel's completeness theorem> links these viewpoints: semantic consequence from a theory agrees with formal derivability.