42.01.03 · mathematical-logic / first-order-logic-completeness

First-Order Languages: Syntax and Unique Readability

shipped3 tiersLean: none

Anchor (Master): Enderton 2001 *A Mathematical Introduction to Logic* 2e Ch. 2 (the full first-order syntax with and without equality, the term algebra, prenex normal form); Shoenfield 1967 *Mathematical Logic* (Addison-Wesley) Ch. 2 §2.1-2.6; Hodges 1993 *Model Theory* (Cambridge) Ch. 1 (signatures, terms, the term algebra as the absolutely free algebra, formulas); Frege 1879 *Begriffsschrift* (the first formal quantificational syntax)

Intuition Beginner

Propositional logic has one kind of atom: a bare statement that is either true or false, like "it is raining." That is too coarse for mathematics. We want to talk about objects — numbers, points, sets — and say things about them and between them: this number is even, that point lies on this line, every number has a successor. First-order logic is the grammar built for exactly this. It adds names for objects, ways to combine names into bigger names, statements about those names, and the two phrases "for-all" and "there-exists."

Think of it as setting up a small formal vocabulary before you say anything. You list your raw materials. Some symbols name fixed objects, like the symbol for zero. Some symbols are operations that take objects and return a new object, like "add" or "successor." Some symbols are relations that take objects and report true or false, like "is less than." Once the vocabulary is fixed, two kinds of expression can be built. A term is a name for an object, built by stacking operations on top of variables and constants. A formula is a statement, built from relations applied to terms and then glued together with "and," "not," "if-then," and the two quantifiers.

The whole point of this unit is to pin down those building rules so precisely that a formula becomes a definite object, with no ambiguity about how it was put together. That precision is what later lets us say what a formula means and what counts as a proof of it. This unit is pure grammar: no truth, no meaning yet — only what counts as a legal sentence.

Visual Beginner

A term is a name built like an arithmetic expression, and it has a tree showing how it was assembled. In the language of arithmetic, with a symbol for "successor" (add one), the term "successor of (successor of zero)" names the number two. Its tree stacks the operations.

   Term:  S( S( 0 ) )      names the number 2

   Build tree (outermost operation on top):

              S
              |
              S
              |
              0

   A formula puts a relation on top of terms:

   Formula:  ( S(0) < S(S(0)) )      says  1 < 2

                 <
                /  \
              S      S
              |      |
              0      S
                     |
                     0

Read each tree from the bottom. The leaves are constants or variables — here the constant . Each step up applies one operation symbol. The term tree on the left builds a name and never produces a true-or-false statement. The formula tree on the right puts the relation symbol "" on top of two finished terms, and only at that top step does it become a statement that could be true or false.

expression kind what it is
term names a fixed object
term names "one more than zero"
formula says one object is below another
formula a statement about every object

Terms name; formulas claim. Keeping the two apart is the first discipline of the subject.

Worked example Beginner

We work inside the language of arithmetic, whose vocabulary has a constant , a one-place operation ("successor"), a two-place operation , and a two-place relation . The task: build the statement "for every number, that number is less than its successor," step by step, and identify which pieces are terms and which is the final formula.

Step 1. Pick a variable to stand for "every number." Use . A lone variable is the simplest term — it is a name (for an as-yet-unspecified object).

Step 2. Build the successor of . Apply the operation to the term , getting the term . This is again a term: a name for "one more than ."

Step 3. Make a statement comparing the two terms. Apply the relation to the terms and . This gives the atomic formula — the smallest kind of statement, a relation applied to finished names.

Step 4. Quantify. We want this to hold for every number, so attach the for-all quantifier binding : the formula becomes "for-all , ."

Step 5. Check what each piece is. The names and are terms. The comparison is a formula. Putting "for-all " in front keeps it a formula, now one that mentions no leftover unspecified object.

What this tells us: every legal statement bottoms out in terms (names) fed into a relation, then wrapped with connectives and quantifiers. The variable started out free — a genuine blank — and the quantifier "for-all " closed that blank, turning the statement into one with a fixed meaning. The next sections make "free," "bound," and "the reach of a quantifier" exact.

Check your understanding Beginner

Formal definition Intermediate+

A first-order language (signature, vocabulary) is given by its parameters: a set of constant symbols ; for each a set of -place function symbols ; and for each a set of -place relation (predicate) symbols . The logical symbols, common to every language, are a countable supply of variables , the connectives and (with defined), the universal quantifier , the parentheses, and — for a language with equality — the binary relation symbol counted as logical [Enderton §2.1]. The arity function recording each symbol's number of places is part of the data; we write for the language of arithmetic, for groups, for set theory, and for ordered fields, each with the indicated arities.

The terms of form the smallest set of strings containing every variable and every constant symbol and closed under: for each -place function symbol and terms , the string is a term. Equivalently with the variables and constants and adjoining all -images of members of . A term is closed (a ground term) if no variable occurs in it. The atomic formulas are the strings (when has equality) and for an -place relation symbol and terms . The well-formed formulas (wffs) form the smallest set containing the atomic formulas and closed under $$ \mathcal{E}{\neg}(\alpha) = (\neg \alpha), \qquad \mathcal{E}{\rightarrow}(\alpha,\beta) = (\alpha \rightarrow \beta), \qquad \mathcal{Q}_i(\alpha) = (\forall v_i, \alpha). $$ The existential quantifier is the abbreviation [Enderton §2.1].

An occurrence of a variable in a wff is bound if it lies within (the scope of) a quantifier — formally, the scope of the quantifier in is the subformula , and an occurrence is bound iff it sits inside the scope of some quantifier on that same variable; otherwise it is free. A wff with no free occurrences of any variable is a sentence (closed formula); only sentences acquire a truth value once a structure is fixed, which is the business of the semantics unit. The substitution replaces every free occurrence of in by the term , defined by recursion on . The term is substitutable for in (Shoenfield: free for) when, for every variable occurring in , no free occurrence of in lies inside the scope of a quantifier [Shoenfield §2.4]. This side condition is what stops variable capture below.

Counterexamples to common slips Intermediate+

  • "A term and a formula are the same kind of object." They are disjoint. A term names an object and never carries a truth value; a formula makes a claim. In the language of arithmetic, is a term, while is a formula. The grammar keeps the two sorts separate, and the parsing theorems are proved separately for each.

  • "Substituting a term for a free variable is always harmless." Substitute for in — "some object exceeds ." The naive replacement yields , "some object exceeds itself," changing a satisfiable claim into an unsatisfiable one. The variable of was captured by the quantifier . Here is not substitutable for in , so is not formed; one first renames the bound .

  • "Free and bound is a property of the variable." It is a property of each occurrence. In the same variable occurs free in the antecedent and bound in the consequent. Freeness is read occurrence by occurrence against the quantifiers whose scope encloses it.

  • "Dropping parentheses is innocent." Without the convention that each quantifier and connective wraps in parentheses, the string is ambiguous between and . The official grammar's parentheses are exactly what unique readability needs; informal omissions are licensed only by a fixed precedence convention.

Key theorem with proof Intermediate+

The signature theorem of the syntax layer is unique readability: the inductive definitions of terms and of formulas are genuine definitions by recursion, because every compound term and every compound formula decomposes in exactly one way. Without it, the free-variable function, the substitution operation, and — downstream — the satisfaction relation would be ill-defined.

Theorem (Unique readability for terms and formulas). Each term is exactly one of: a variable; a constant symbol; or for a unique -place function symbol and unique terms . Each wff is exactly one of: an atomic formula or with the symbol and terms unique; for a unique wff ; for unique wffs ; or for a unique variable and unique wff . In every case no term (resp. wff) is a proper initial segment of another, and the leading symbol together with its constituents is determined by the string alone [Enderton §2.2].

Proof. Take terms first. Use the polish (prefix) presentation with no parentheses, and assign to each symbol a weight: a variable or constant counts , an -place function symbol counts . Define the weight of a string as the sum of its symbols' weights. A first induction on the construction of terms shows every term has weight , and every proper nonempty initial segment of a term has weight . The base case is immediate: a variable or constant is a single symbol of weight with no proper nonempty initial segment. For the step, has weight ; reading left to right, after the leading the running weight is , and it climbs back to only after the last symbol of , because each completed contributes and a proper segment stops inside some with the earlier completed, giving a running total .

This weight invariant gives the no-segment claim: a term has weight , so it cannot be a proper initial segment of another term, whose proper initial segments have weight . For uniqueness, a compound term begins with a function symbol of some arity , and the constituents are recovered greedily: is the shortest initial segment of the remainder having weight (a complete term), then the next such segment, and so on; the weight invariant shows each is determined and that exactly of them are consumed. Hence and are unique.

For formulas, atomic formulas inherit the term result: and parse uniquely because the leading relation symbol fixes the arity and the term-parsing recovers the arguments. For compound wffs, run the parenthesis-balance argument of the propositional case 42.01.01 pending: each left parenthesis counts , each right parenthesis , all other symbols ; every wff has total balance while every proper nonempty initial segment has balance . A non-atomic wff therefore begins with "(", and the symbol immediately after the "(" is , the matrix of an arrow, or , exclusively. For the variable is the symbol after and is the wff filling up to the matching ")"; for the substring is the shortest balanced wff after the opening "(", which marks the connective and leaves . Each constituent is determined, so the decomposition is unique.

Corollary (recursion on terms and formulas). Given target data — a value on variables and constants and an operation per function symbol — there is a unique function on terms respecting them; likewise on formulas with clauses for atomic formulas, , , and . This is what makes the free-variable function , the substitution , and the satisfaction relation of the next unit well defined.

Bridge. Unique readability is the foundational reason every syntactic operation on terms and formulas is well defined, and this is exactly the parsing fact that lets the satisfaction relation be built by recursion in the semantics unit. It builds toward the term algebra of the Master tier, where the same uniqueness reappears as the statement that the algebra of terms is absolutely free on the variables, so a variable assignment extends uniquely to a homomorphism — this is exactly the recursion corollary read algebraically. The argument generalises the propositional balance lemma of 42.01.01 pending from connectives alone to a full signature of function and relation symbols with arities, and it appears again wherever an inductively presented syntax must support definition by recursion. The central insight is that an inductive syntax admits recursion precisely when its constructors are injective with pairwise-disjoint ranges; unique readability is that condition made concrete for first-order terms and formulas. Putting these together, the syntax fixed here is the common substrate on which the Tarskian semantics 42.01.04 pending and the deductive calculus 42.01.05 pending are both defined, and the substitutability condition introduced above is the single hinge on which the soundness of the quantifier rules will turn.

Exercises Intermediate+

Advanced results Master

The syntax fixed in the Formal definition supports three developments: a universal property exhibiting terms as a free algebra, a normal form trading quantifier nesting for a quantifier prefix, and the precise capture-avoidance calculus on which the deductive rules rest.

Theorem 1 (the term algebra is absolutely free). Fix a signature and a set of variables. The set of terms carries an -algebra structure: each -place function symbol acts by and each constant by itself. This algebra is absolutely free on : for every -structure and every assignment of the variables into the carrier , there is a unique homomorphism extending and commuting with all function symbols [Hodges Ch. 1]. Existence is the recursion corollary of unique readability; uniqueness is its injectivity-with-disjoint-ranges content. This universal property is unique readability, restated categorically, and it is precisely the recursive clause that the next unit promotes to the term-evaluation half of Tarski's satisfaction definition.

Theorem 2 (prenex normal form). Every wff is logically equivalent (in the deductive calculus of 42.01.05 pending, and under every structure in 42.01.04 pending) to a prenex wff with each and quantifier-free [Enderton Ch. 2]. The prenex operations push quantifiers outward across connectives, governed by the freeness side conditions: and ; and when is not free in the stationary side, achieved after renaming bound variables apart. The matrix is unique up to propositional equivalence; the quantifier prefix is not unique, but its alternation pattern controls the quantifier-complexity classification ( of the arithmetical hierarchy) used downstream in definability and computability.

Theorem 3 (capture-avoiding substitution and the renaming lemma). For any wff , variable , and term , there is a wff obtained from by renaming bound variables (an alphabetic variant, ) such that is substitutable for in ; the capture-avoiding substitution is well defined up to alphabetic variance [Shoenfield §2.4]. Alphabetic variants are logically indistinguishable: implies is valid and provable. The substitutability condition is exactly the hypothesis under which the quantifier-instantiation axiom is sound; without it the axiom fails, as the capture example shows. This is the single syntactic hinge that makes the quantifier rules of 42.01.05 pending correct.

Theorem 4 (induction and recursion on the syntax). Unique readability yields two reasoning principles used pervasively. Induction on terms (resp. formulas): a property holding of variables and constants (resp. atomic formulas) and preserved by each function symbol (resp. by , , ) holds of all terms (resp. formulas). Recursion on terms (resp. formulas): a function is determined by its values on the base cases and a rule per constructor. The free-variable function , the height function, substitution , the Gödel numbering used in incompleteness 42.01.08 pending, and the satisfaction relation of 42.01.04 pending are all defined by this recursion, and their basic laws are proved by this induction.

Synthesis. The unique-readability theorem is the foundational reason the entire apparatus is well posed, and putting these together it controls all four downstream developments: it is exactly the freeness of the term algebra, so that a variable assignment extends uniquely to a homomorphism — the central insight that becomes term evaluation in Tarski's satisfaction definition 42.01.04 pending; it underwrites the induction and recursion principles that define , substitution, and Gödel numbering; and it makes the substitutability condition statable, which is the bridge from pure grammar to the soundness of the quantifier instantiation axiom in the deductive calculus 42.01.05 pending. The prenex normal form generalises the propositional normal forms of 42.01.01 pending to the quantified setting and is dual, across the negation laws , to the alternation that the arithmetical hierarchy will measure. This is exactly the architecture promised at the Beginner tier: a grammar so precisely fixed that meaning and proof can both be defined on top of it without ambiguity, with semantics and deduction as the two parallel theories built next over this one shared syntax.

Full proof set Master

Proposition 1 (unique readability for terms). Every term is a variable, a constant symbol, or for a unique -place function symbol and a unique sequence of terms ; and no term is a proper initial segment of another.

Proof. Weight a variable or constant and an -place function symbol ; the weight of a string is the sum over its symbols. By induction on the construction of terms, every term has weight : a variable/constant is a single symbol; and has weight . Next, every proper nonempty initial segment of a term has weight . For a variable/constant there is no such segment. For , a proper initial segment is followed by in full and a proper initial segment of (possibly empty), with the remaining absent. Its weight is where, by a sub-induction, for a proper initial segment and otherwise; since and , the total is in the boundary case and throughout. Thus proper initial segments have weight while complete terms have weight , so no term is a proper initial segment of another. Uniqueness of the decomposition follows: a compound term starts with a unique function symbol of known arity ; reading the remainder, is the unique shortest initial segment of weight (the first complete subterm), and inductively are determined, consuming the string exactly.

Proposition 2 (unique readability for formulas). Every wff is, exclusively, an atomic formula with unique relation symbol (or ) and unique argument terms, or , , or with unique constituents.

Proof. Atomic case: an atomic formula begins with a relation symbol of arity (or with ), and the arguments are (resp. ) consecutive terms, each parsed uniquely by Proposition 1; the leading symbol fixes which clause applies and the term-parsing fixes the arguments. Compound case: assign parenthesis-balance weights ( to "(", to ")", otherwise). By induction every wff has balance , while every proper nonempty initial segment has balance : atomic formulas carry no parentheses, while , , each open with "(" raising the balance to , closed only by the final ")". A compound wff thus begins with "(", and the next symbol is , , or the start of in an arrow. If : the remainder up to the matching ")" is the unique . If : the next symbol is the unique bound variable and the rest up to ")" is the unique . Otherwise it is : scanning after the opening "(", the first point at which the running balance returns to ends the unique wff , whereupon and the wff are forced. Exclusivity holds because the symbol after "(" cannot belong to two of the distinct classes , , leading-symbol-of-a-wff at once.

Proposition 3 (the recursion principle on formulas). Let be a set, a function on atomic formulas, and , , . There is a unique with , , , and .

Proof. Define by recursion on the height of a wff (the length of the longest construction branch), which is well defined because by Proposition 2 each non-atomic wff has uniquely determined immediate constituents of strictly smaller height. Set on atomic formulas to ; given on all wffs of height , extend to a height- wff by applying the clause matching 's unique outermost constructor to the already-defined values on its constituents. This yields a total function. For uniqueness, suppose both satisfy the clauses; a structural induction on (legitimate by Proposition 2, which supplies the unique decomposition at each step) gives : equal on atomic formulas by , and equal on each compound by the matching clause applied to equal constituent values. Hence is the unique such function. Applying this with the appropriate and clauses defines , the substitution , and (in 42.01.04 pending) the satisfaction relation.

Proposition 4 (the substitutability condition blocks capture). If is substitutable for in , then in no occurrence of a variable of introduced by the substitution is bound by a quantifier of ; if is not substitutable, some such capture occurs.

Proof. Induct on . For atomic there are no quantifiers, so every introduced occurrence of a variable of is free — no capture, and substitutability is vacuous. The connective cases and follow from the inductive hypothesis, as quantifiers and free occurrences distribute over them. For : if , then has no free occurrence in , the substitution is vacuous, and there is nothing to capture. If and , then by definition is substitutable for in iff and is substitutable for in . Under this hypothesis the introduced occurrences of variables of are those produced inside , none of which is the variable (since ), so the quantifier binds none of them; by the inductive hypothesis no quantifier inside captures them either. Conversely, if is not substitutable, the failure occurs at some quantifier with enclosing a free occurrence of ; substituting places that inside the scope of , a capture.

Connections Master

  • Propositional logic as a formal system 42.01.01 pending is the warm-up whose architecture this unit lifts to quantifiers. The parenthesis-balance argument proving unique readability for sentential formulas is re-run here, extended to a full signature of function and relation symbols with arities (the polish-notation weight argument for terms) and to the quantifier constructor . The propositional unit owns the connective layer and its recursion principle; this unit owns terms, atomic formulas, quantifiers, free and bound variables, and substitution, on which the first-order semantics and deduction are defined.

  • The semantics of first-order logic — Tarskian satisfaction in a structure — is co-produced as 42.01.04 pending and is defined by recursion on the syntax fixed here. The term-algebra universal property (Theorem 1) becomes term evaluation , the atomic clause reads off the interpreted relations, and the recursion principle (Proposition 3) supplies the satisfaction clauses for . The substitution lemma of this unit is exactly what makes Tarski's quantifier clause agree with substitution of witnesses. Without unique readability the satisfaction relation would not be well defined.

  • The deductive calculus for first-order logic is co-produced as 42.01.05 pending and is likewise defined over this syntax. Its quantifier-instantiation axiom is sound precisely when is substitutable for in (Theorem 3, Proposition 4), so the substitutability condition introduced here is the single hinge of the quantifier rules; the completeness theorem 42.01.06 pending then matches this calculus to the semantics of 42.01.04 pending.

  • Axiomatic set theory 42.03.01 is presented in the first-order language defined by this unit's grammar: the ZFC axioms are sentences of that language, the Separation and Replacement schemas are infinite families indexed by the formulas defined here, and the proper-class notation is read off the free-variable apparatus. Likewise the Gödel numbering of incompleteness 42.01.08 pending is a recursion on exactly this syntax.

Historical & philosophical context Master

Quantificational syntax begins with Gottlob Frege's Begriffsschrift (1879), the first formal language with nested quantifiers and bound variables, in which generality was expressed by a notation for "for all" governing a scope — the conceptual ancestor of the constructor and of the free/bound distinction [Frege 1879]. Charles Sanders Peirce and his student Oscar Howard Mitchell independently developed quantifier notation in the 1880s, and Giuseppe Peano's notation (1889) supplied the and -style symbols that, refined by Russell and Whitehead in Principia Mathematica (1910-13), became standard.

The separation of a language (a signature of symbols) from its interpretations is due to the model-theoretic tradition: Leopold Löwenheim (1915) and Thoralf Skolem (1920) treated first-order formulas as syntactic objects evaluated in varying domains, and David Hilbert and Wilhelm Ackermann's Grundzüge der theoretischen Logik (1928) codified the engere Funktionenkalkül (the restricted, i.e. first-order, predicate calculus) with its precise formation rules. The unique-readability theorem and the induction/recursion principles it licenses were made explicit in the textbook tradition — Stephen Cole Kleene's Introduction to Metamathematics (1952), Joseph Shoenfield's Mathematical Logic (1967) [Shoenfield §2.1], and Herbert Enderton's text [Enderton §2.2]. The capture problem in substitution, and the free for condition that resolves it, were isolated as the soundness-critical side condition for the quantifier axioms; the term algebra as the absolutely free algebra on its variables is the universal-algebra and model-theoretic reading given by Wilfrid Hodges [Hodges Ch. 1] and traced to Birkhoff's free-algebra constructions.

Bibliography Master

@book{enderton2001logic,
  author    = {Enderton, Herbert B.},
  title     = {A Mathematical Introduction to Logic},
  edition   = {2},
  publisher = {Harcourt/Academic Press},
  year      = {2001}
}

@book{shoenfield1967logic,
  author    = {Shoenfield, Joseph R.},
  title     = {Mathematical Logic},
  publisher = {Addison-Wesley},
  year      = {1967}
}

@book{hodges1993modeltheory,
  author    = {Hodges, Wilfrid},
  title     = {Model Theory},
  series    = {Encyclopedia of Mathematics and its Applications},
  volume    = {42},
  publisher = {Cambridge University Press},
  year      = {1993}
}

@book{frege1879begriffsschrift,
  author    = {Frege, Gottlob},
  title     = {Begriffsschrift, eine der arithmetischen nachgebildete Formelsprache des reinen Denkens},
  publisher = {Louis Nebert, Halle},
  year      = {1879}
}

@book{hilbertackermann1928,
  author    = {Hilbert, David and Ackermann, Wilhelm},
  title     = {Grundz\"{u}ge der theoretischen Logik},
  publisher = {Springer},
  year      = {1928}
}

@book{kleene1952metamathematics,
  author    = {Kleene, Stephen Cole},
  title     = {Introduction to Metamathematics},
  publisher = {North-Holland},
  year      = {1952}
}

@article{skolem1920,
  author  = {Skolem, Thoralf},
  title   = {Logisch-kombinatorische Untersuchungen \"{u}ber die Erf\"{u}llbarkeit oder Beweisbarkeit mathematischer S\"{a}tze},
  journal = {Skrifter utgit av Videnskapsselskapet i Kristiania},
  year    = {1920}
}

@article{lowenheim1915,
  author  = {L\"{o}wenheim, Leopold},
  title   = {\"{U}ber M\"{o}glichkeiten im Relativkalk\"{u}l},
  journal = {Mathematische Annalen},
  volume  = {76},
  year    = {1915},
  pages   = {447--470}
}