Reading preferences

Optional display controls need JavaScript. All reading content and navigation work without it.

How to use Read

This page follows Syntax of First-Order Logic in source order. Equations are native, unflattened MathML, and every source coordinate is available offline.

Introduction

In order to develop the theory and metatheory of first-order logic, we must first define the syntax and semantics of its expressions. The expressions of first-order logic are terms and formulas. Terms are formed from variables, constants, and functions. Formulas, in turn, are formed from predicates together with terms (these form the smallest, “atomic” formulas), and then from atomic formulas we can form more complex ones using logical connectives and quantifiers. There are many different ways to set down the formation rules; we give just one possible one. Other systems will chose different symbols, will select different sets of connectives as primitive, will use parentheses differently (or even not at all, as in the case of so-called Polish notation). What all approaches have in common, though, is that the formation rules define the set of terms and formulas inductively. If done properly, every expression can result essentially in only one way according to the formation rules. The inductive definition resulting in expressions that are uniquely readable means we can give meanings to these expressions using the same method—inductive definition.

First-Order Languages

Expressions of first-order logic are built up from a basic vocabulary containing variables, constants, predicates and sometimes functions. From them, together with logical connectives, quantifiers, and punctuation symbols such as parentheses and commas, terms and formulas are formed.

In the general case, we make use of the following symbols in first-order logic:

  1. Logical symbols

    1. Logical connectives: ¬source 39 (negation), source 40 (conjunction), source 41 (disjunction), source 42 (conditional)

      source 44 (universal quantifier), source 45 (existential quantifier). The propositional constant for falsity source 46.

    2. The two-place identity =source 48.

    3. A denumerables set of variables: v0source 49, v1source 49, v2source 49, …

  2. Non-logical symbols, making up the standard language of first-order logic

    1. A denumerables set of nsource 55-place predicates for each n>0source 55: An0source 55, An1source 56, An2source 56, …

    2. A denumerables set of constants: c0source 57, c1source 57, c2source 57, ….

    3. A denumerables set of nsource 59-place functions for each n>0source 59: fn0source 60, fn1source 60, fn2source 60, …

  3. Punctuation marks: (, ), and the comma.

Most of our definitions and results will be formulated for the full standard language of first-order logic. However, depending on the application, we may also restrict the language to only a few predicates, constants, and functions.

Arithmetic language example

The language LAsource 71 of arithmetic contains a single two-place predicate <source 72, a single constant 0source 72, one one-place function source 73, and two two-place functions +source 73 and ×source 73.

source 70

Set-theory language example

The language of set theory LZsource 77 contains only the single two-place predicate source 78.

source 76

Order language example

The language of orders Lsource 82 contains only the two-place predicate source 83.

source 81

Again, these are conventions: officially, these are just aliases, e.g., <source 87, source 87, and source 87 are aliases for A20source 87, 0source 87 for c0source 88, source 88 for f10source 88, +source 88 for f20source 88, ×source 88 for f21source 89.

In addition to the primitive connectives and quantifiers introduced above, we also use the following defined symbols:

source 100 (biconditional)

Truth source 104.

Terms and formula

Once a first-order language Lsource 13 is given, we can define expressions built up from the basic vocabulary of Lsource 14. These include in particular terms and formulas.

Inductive definition of first-order terms

The set of terms Trm(L)source 19 of Lsource 19 is defined inductively by:

  1. Every variable is a term.

  2. Every constant of Lsource 23 is a term.

  3. If fsource 24 is an nsource 24-place function and t1source 24, …, tnsource 24 are terms, then f(t1,,tn)source 25 is a term.

    Nothing else is a term.

A term containing no variables is a closed term.

source 17

Inductive definition of first-order formulas

The set of formulas Frm(L)source 43 of the language Lsource 43 is defined inductively as follows:

source 46 is an atomic formula.

  1. If Rsource 50 is an nsource 50-place predicate of Lsource 50 and t1source 50, …, tnsource 51 are terms of Lsource 51, then R(t1,,tn)source 51 is an atomic formula.

  2. If t1source 54 and t2source 54 are terms of Lsource 54, then =(t1,t2)source 54 is an atomic formula.

    If Asource 57 is a formula, then ¬Asource 57 is a formula.

    If Asource 60 and Bsource 60 are formulas, then (AB)source 60 is a formula.

    If Asource 63 and Bsource 63 are formulas, then (AB)source 63 is a formula.

    If Asource 66 and Bsource 66 are formulas, then (AB)source 66 is a formula.

    If Asource 72 is a formula and xsource 72 is a variable, then xAsource 73 is a formula.

    If Asource 75 is a formula and xsource 75 is a variable, then xAsource 76 is a formula.

    Nothing else is a formula.

source 41

By convention, we write =source 102 between its arguments and leave out the parentheses: t1=t2source 103 is an abbreviation for =(t1,t2)source 104. Moreover, ¬=(t1,t2)source 104 is abbreviated as t1t2source 105. When writing a formula (BC)source 105 constructed from Bsource 106, Csource 106 using a two-place connective source 106, we will often leave out the outermost pair of parentheses and write simply BCsource 108.

Definitions of derived logical operators

Formulas constructed using the defined operators are to be understood as follows:

source 129 abbreviates ¬source 130.

ABsource 150 abbreviates (AB)(BA)source 150.

source 123

If we work in a language for a specific application, we will often write two-place predicates and functions between the respective terms, e.g., t1<t2source 162 and (t1+t2)source 162 in the language of arithmetic and t1t2source 163 in the language of set theory. The successor function in the language of arithmetic is even written conventionally after its argument: t'source 165. Officially, however, these are just conventional abbreviations for A20(t1,t2)source 166, f20(t1,t2)source 167, A20(t1,t2)source 167 and f10(t)source 167, respectively.

Definition of syntactic identity

The symbol source 171 expresses syntactic identity between strings of symbols, i.e., ABsource 172 iff Asource 172 and Bsource 172 are strings of symbols of the same length and which contain the same symbol in each place.

source 170

The source 176 symbol may be flanked by strings obtained by concatenation, e.g., A(BC)source 177 means: the string of symbols Asource 178 is the same string as the one obtained by concatenating an opening parenthesis, the string Bsource 179, the source 179 symbol, the string Csource 180, and a closing parenthesis, in this order. If this is the case, then we know that the first symbol of Asource 181 is an opening parenthesis, Asource 182 contains Bsource 182 as a substring (starting at the second symbol), that substring is followed by source 183, etc.

As terms and formulas are built up from basic elements via inductive definitions, we can use the following induction principles to prove things about them.

Principle of induction on terms

Let Lsource 191 be a first-order language. If some property Psource 192 is such that

  1. it holds for every variable vsource 195,

  2. it holds for every constant asource 197 of Lsource 197, and

  3. it holds for f(t1,,tn)source 199 whenever it holds for t1source 200, …, tnsource 200 and fsource 200 is an nsource 200-place function of Lsource 201

(assuming t1source 203, …, tnsource 203 are terms of Lsource 203), then Psource 204 holds for every term in Trm(L)source 204.

source 189

Exercise on induction for terms

Unsolved exercise. The source supplies the prompt only; no solution is added.

Prove Principle of induction on terms.

source 207

Principle of induction on formulas

Let Lsource 213 be a first-order language. If some property Psource 214 holds for all the atomic formulas and is such that

it holds for ¬Asource 218 whenever it holds for Asource 219; it holds for (AB)source 220 whenever it holds for Asource 221 and Bsource 221; it holds for (AB)source 222 whenever it holds for Asource 223 and Bsource 223; it holds for (AB)source 224 whenever it holds for Asource 225 and Bsource 225;

it holds for xAsource 228 whenever it holds for Asource 229; it holds for xAsource 230 whenever it holds for Asource 231;

(assuming Asource 233 and Bsource 233 are formulas of Lsource 233), then Psource 234 holds for all formulas in Frm(L)source 234.

source 211

Unique Readability

Balanced-parentheses lemma for formulas

The number of left and right parentheses in a formula Asource 57 are equal.

source 56

Proof

We prove this by induction on the way Asource 62 is constructed. This requires two things: (a) We have to prove first that all atomic formulas have the property in question (the induction basis). (b) Then we have to prove that when we construct new formulas out of given formulas, the new formulas have the property provided the old ones do.

Let l(A)source 68 be the number of left parentheses, and r(A)source 68 the number of right parentheses in Asource 69, and l(t)source 69 and r(t)source 69 similarly the number of left and right parentheses in a term tsource 70.

Exercise on parentheses in terms

Unsolved exercise. The source supplies the prompt only; no solution is added.

Prove that for any term tsource 73, l(t)=r(t)source 73.

source 72

Case: Asource 77 has 0source 77 left and 0source 77 right parentheses.

  1. Case: l(A)=1+l(t1)++l(tn)=1+r(t1)++r(tn)=r(A)source 83. Here we make use of the fact, left as an exercise, that l(t)=r(t)source 85 for any term tsource 86.

  2. Case: l(A)=l(t1)+l(t2)=r(t1)+r(t2)=r(A)source 88.

    Case: By induction hypothesis, l(B)=r(B)source 92. Thus l(A)=l(B)=r(B)=r(A)source 92.

  3. Case: By induction hypothesis, l(B)=r(B)source 95 and l(C)=r(C)source 96. Thus l(A)=1+l(B)+l(C)=1+r(B)+r(C)=r(A)source 96.

    Case: By induction hypothesis, l(B)=r(B)source 100. Thus, l(A)=l(B)=r(B)=r(A)source 100.

    Case: Similarly.

End of proof.

Definition of proper prefix

A string of symbols Bsource 114 is a proper prefix of a string of symbols Asource 114 if concatenating Bsource 115 and a non-empty string of symbols yields Asource 115.

source 113

No-formula-prefix lemma

If Asource 119 is a formula, and Bsource 119 is a proper prefix of Asource 119, then Bsource 120 is not a formula.

source 118

Proof

Exercise.

End of proof.

Exercise on the no-formula-prefix lemma

Unsolved exercise. The source supplies the prompt only; no solution is added.

Prove No-formula-prefix lemma.

source 127

Unique form of atomic formulas

If Asource 133 is an atomic formula, then it satisfies one, and only one of the following conditions.

Asource 136.

  1. AR(t1,,tn)source 138 where Rsource 138 is an nsource 138-place predicate, t1source 139, …, tnsource 139 are terms, and each of Rsource 139, t1source 140, …, tnsource 140 is uniquely determined.

  2. At1=t2source 141 where t1source 141 and t2source 141 are uniquely determined terms.

source 131

Proof

Exercise.

End of proof.

Exercise on unique atomic form

Unsolved exercise. The source supplies the prompt only; no solution is added.

Prove Unique form of atomic formulas (Hint: Formulate and prove a version of No-formula-prefix lemma for terms.)

source 150

Unique readability proposition

Every formula satisfies one, and only one of the following conditions.

  1. Asource 158 is atomic.

    Asource 160 is of the form ¬Bsource 160.

    Asource 162 is of the form (BC)source 162.

    Asource 164 is of the form (BC)source 164.

    Asource 166 is of the form (BC)source 166.

    Asource 170 is of the form xBsource 170.

    Asource 172 is of the form xBsource 172.

Moreover, in each case Bsource 174, or Bsource 174 and Csource 174, are uniquely determined. This means that, e.g., there are no different pairs Bsource 175, Csource 176 and B'source 176, C'source 176 so that Asource 176 is both of the form (BC)source 177 and (B'C')source 177.

source 155

Proof

The formation rules require that if a formula is not atomic, it must start with an opening parenthesis (, ¬source 184, or a quantifier. On the other hand, every formula that starts with one of the following symbols must be atomic: a predicate, a function, a constant, source 186.

So we really only have to show that if Asource 188 is of the form (BC)source 188 and also of the form (B''C')source 189, then BB'source 189, CC'source 190, and ='source 190.

So suppose both A(BC)source 192 and A(B''C')source 192. Then either BB'source 193 or not. If it is, clearly ='source 194 and CC'source 194, since they then are substrings of Asource 195 that begin in the same place and are of the same length. The other case is BB'source 196. Since Bsource 196 and B'source 197 are both substrings of Asource 197 that begin at the same place, one must be a proper prefix of the other. But this is impossible by No-formula-prefix lemma.

End of proof.

main operator of a Formula

Definition of a formula's main operator

The main operator of a formula Asource 24 is defined as follows:

  1. Case: Asource 27 has no main operator.

    Case: the main operator of Asource 29 is ¬source 30.

    Case: the main operator of Asource 33 is source 33.

    Case: the main operator of Asource 36 is source 36.

    Case: the main operator of Asource 39 is source 39.

    Case: the main operator of Asource 45 is source 45.

    Case: the main operator of Asource 48 is source 48.

source 22

In each case, we intend the specific indicated occurrence of the main operator in the formula. For instance, since the formula ((DE)(ED))source 54 is of the form (BC)source 54 where Bsource 55 is (DE)source 55 and Csource 55 is (ED)source 55, the second occurrence of source 56 is the main operator.

We call formulas by the names in Table of main operators and formula types depending on which symbol their main operator is. Recall, however, that defined operators do not officially appear in formulas. They are just abbreviations, so officially they cannot be the main operator of a formula. In proofs about all formulas they therefore do not have to be treated separately.

Table of main operators and formula types

The table pairs each outer operator with its formula type and an example.

Main operators, formula types, and examples
Main operatorType of formulaExample
NoneAtomic formulasource 85; R(t1,,tn)source 87; t1=t2source 88
¬source 89Negation¬Asource 89
source 90Conjunction(AB)source 90 (Reader correction: The source table places the closing parenthesis outside the math delimiter. The reader rendering includes it in the displayed conjunction)
source 91Disjunction(AB)source 91 (Reader correction: The source table places the closing parenthesis outside the math delimiter. The reader rendering includes it in the displayed disjunction)
source 92Conditional(AB)source 92 (Reader correction: The source table places the closing parenthesis outside the math delimiter. The reader rendering includes it in the displayed conditional)
source 93Biconditional(AB)source 93
source 94Universal formulaxAsource 94
source 95Existential formulaxAsource 95

Source: content/first-order-logic/syntax-and-semantics/main-operator.tex, line 81.

subformula

Definition of immediate subformulas

If Asource 21 is a formula, the immediate subformulas of Asource 22 are defined inductively as follows:

  1. Atomic formulas have no immediate subformulas.

    Case: The only immediate subformula of Asource 27 is Bsource 27.

  2. Case: The immediate subformulas of Asource 30 are Bsource 30 and Csource 30 (source 30 is any one of the two-place connectives).

    Case: The only immediate subformula of Asource 34 is Bsource 34.

    Case: The only immediate subformula of Asource 37 is Bsource 37.

source 20

Definition of proper subformulas

If Asource 42 is a formula, the proper subformulas of Asource 43 are defined recursively as follows:

  1. Atomic formulas have no proper subformulas.

    Case: The proper subformulas of Asource 48 are Bsource 48 together with all proper subformulas of Bsource 49.

  2. Case: The proper subformulas of Asource 52 are Bsource 52, Csource 52, together with all proper subformulas of Bsource 53 and those of Csource 53.

    Case: The proper subformulas of Asource 56 are Bsource 56 together with all proper subformulas of Bsource 57.

    Case: The proper subformulas of Asource 60 are Bsource 60 together with all proper subformulas of Bsource 61.

source 41

Definition of subformula

The subformulas of Asource 66 are Asource 66 itself together with all its proper subformulas.

source 65

Transitivity of the subformula relation

Suppose Bsource 92 is a subformula of Asource 92 and Csource 92 is a subformula of Bsource 92. Then Csource 93 is a subformula of Asource 93. In other words, the subformula relation is transitive.

source 90

Exercise on subformula transitivity

Unsolved exercise. The source supplies the prompt only; no solution is added.

Prove Transitivity of the subformula relation.

source 97

Upper bound on the number of subformulas

Suppose Asource 103 is a formula with nsource 103 connectives and quantifiers. Then Asource 104 has at most 2n+1source 104 subformulas.

source 101

Exercise on counting subformulas

Unsolved exercise. The source supplies the prompt only; no solution is added.

Prove Upper bound on the number of subformulas.

source 107

Formation Sequences

Defining formulas via an inductive definition, and the complementary technique of proving properties of formulas via induction, is an elegant and efficient approach. However, it can also be useful to consider a more bottom-up, step-by-step approach to the construction of formulas, which we do here using the notion of a formation sequence.

To show how terms and formulas can be introduced in this way without needing to refer to their inductive definitions, we first introduce the notion of an arbitrary string of symbols drawn from some language Lsource 23.

Definition of language strings

Suppose Lsource 27 is a first-order language. An Lsource 27-string is a finite sequence of symbols of Lsource 28. Where the language Lsource 29 is clearly fixed by the context, we will often refer to a Lsource 30-string simply as a string.

source 25

Example of a string that is not a formula

For any first-order language Lsource 34, all Lsource 35-formulas are Lsource 35-strings, but not conversely. For example, )(v0source 36 is an Lsource 37-string but not an Lsource 37-formula.

source 33

Definition of term formation sequence

A finite sequence of Lsource 42-strings t0,,tnsource 42 is a formation sequence for a term tsource 43 if ttnsource 43 and for all insource 44, either tisource 44 is a variable or a constant, or Lsource 44 contains a ksource 45-ary function fsource 45 (Reader correction: The source uses k both as the declared arity and as the final zero-based argument index, which displays k plus one arguments. The reader preserves and explicitly flags this mismatch) and there exist m0,,mk<isource 46 (Reader correction: The displayed index range contains k plus one argument positions, although the preceding source calls the function k-ary. The reader preserves and explicitly flags this mismatch) such that tif(tm0,,tmk)source 46 (Reader correction: The source calls f k-ary but displays arguments indexed from m sub zero through m sub k, which is k plus one displayed arguments. The reader preserves that source mismatch and does not silently choose a correction). When it is necessary to distinguish, we will refer to formation sequences for terms as term formation sequences.

source 40

Examples of term formation sequences

The sequence c0,v0,f20(c0,v0),f10(f20(c0,v0))source 53 is a formation sequence for the term f10(f20(c0,v0))source 56, as is v0,c0,f20(c0,v0),f10(f20(c0,v0)).source 58

source 51

Definition of formula formation sequence

A finite sequence of Lsource 65-strings A0,,Ansource 65 is a formation sequence for Asource 66 if AAnsource 66 and for all insource 67, either Aisource 67 is an atomic formula or there exist j,k<isource 68 and a variable xsource 68 such that one of the following holds:

Ai¬Ajsource 71. Ai(AjAk)source 72. Ai(AjAk)source 73. Ai(AjAk)source 74.

AixAjsource 76. AixAjsource 77.

When it is necessary to distinguish, we will refer to formation sequences for formulas as formula formation sequences.

source 63

Examples of formula formation sequences

A10(v0),A11(c1),(A11(c1)A10(v0)),v0(A11(c1)A10(v0))source 84 is a formation sequence of v0(A11(c1)A10(v0))source 92, as is Displayed redundant formula formation sequence A10(v0),A11(c1),(A11(c1)A10(v0)),A11(c1),v1A10(v0),v0(A11(c1)A10(v0)).source 94

As can be seen from the second example, formation sequences may contain “junk”: formulas which are redundant or do not contribute to the construction.

source 83

Existence of formula formation sequences

Every formula Asource 111 in Frm(L)source 111 has a formation sequence.

source 110

Proof

Suppose Asource 115 is atomic. Then the sequence Asource 115 is a formation sequence for Asource 116.

Now suppose that Bsource 118 and Csource 118 have formation sequences B0,,Bnsource 119 and C0,,Cmsource 119 respectively.

If A¬Bsource 123, then B0,,Bn,¬Bnsource 124 is a formation sequence for Asource 125. If A(BC)source 126, then B0,,Bn,C0,,Cm,(BnCm)source 127 is a formation sequence for Asource 128. If A(BC)source 129, then B0,,Bn,C0,,Cm,(BnCm)source 130 is a formation sequence for Asource 131. If A(BC)source 132, then B0,,Bn,C0,,Cm,(BnCm)source 133 is a formation sequence for Asource 134.

If AxBsource 138, then B0,,Bn,xBnsource 139 is a formation sequence for Asource 140. If AxBsource 141, then B0,,Bn,xBnsource 142 is a formation sequence for Asource 143.

By the principle of induction on formulas, every formula has a formation sequence.

End of proof.

We can also prove the converse. This is important because it shows that our two ways of defining formulas are equivalent: they give the same results. It also means that we can prove theorems about formulas by using ordinary induction on the length of formation sequences.

Initial-subsequence lemma

Suppose that A0,,Ansource 157 is a formation sequence for Ansource 158, and that knsource 158. Then A0,,Aksource 158 is a formation sequence for Aksource 159.

source 155

Proof

Exercise.

End of proof.

Exercise on initial formation subsequences

Unsolved exercise. The source supplies the prompt only; no solution is added.

Prove Initial-subsequence lemma.

source 166

Equivalence of formula definitions

Frm(L)source 172 is the set of all Lsource 172-strings Asource 172 such that there exists a formula formation sequence for Asource 173.

source 170

Proof

Let Fsource 177 be the set of all strings of symbols in the language Lsource 177 that have a formation sequence. We have seen in Existence of formula formation sequences that Frm(L)Fsource 179, so now we prove the converse.

Suppose Asource 182 has a formation sequence A0,,Ansource 182. We prove that AFrm(L)source 183 by strong induction on nsource 183 (Reader correction: The reader interprets n as the final sequence index. The source calls the following m a length, but a sequence indexed zero through n has length n plus one). Our induction hypothesis is that every string of symbols with a formation sequence of length m<nsource 185 (Reader correction: The source calls m a sequence length while inducting on the final index n. Since a sequence indexed from zero through n has n plus one entries, the literal length statement is off by one. The reader treats m and n as final indices; equivalently, the proof may induct on length n plus one and use all shorter lengths) is in Frm(L)source 185. By the definition of a formation sequence, either AAnsource 186 (Reader correction: The printed sentence has a garden-path construction: 'either A is syntactically identical to A sub n is atomic.' The reader supplies appositive wording so the intended claim is that A, identical to the final entry A sub n, is atomic) is atomic or there must exist j,k<nsource 187 such that one of the following is the case:

A¬Ajsource 190. A(AjAk)source 191. A(AjAk)source 192. A(AjAk)source 193.

AxAjsource 195. AxAjsource 196.

Now we reason by cases. If Asource 198 is atomic then AnFrm(L)source 199 (Reader correction: The source prints the undefined language L sub zero here, although this theorem fixes the first-order language L. The reader uses L and preserves the printed source in the source view). Suppose instead that A(AjAk)source 200 (Reader correction: The source prints material-equivalence notation in this proof case, while the formation clauses and the argument require syntactic identity. The reader uses syntactic identity and preserves the printed source in the source view). By Initial-subsequence lemma, A0,,Ajsource 202 and A0,,Aksource 202 are formation sequences for Ajsource 203 and Aksource 203, respectively. Since these are proper initial subsequences of the formation sequence for Asource 205, they both have length less than nsource 205 (Reader correction: The source says the proper initial sequences have length less than n. The correct final-index statement is that they end at indices less than n; equivalently their lengths are less than n plus one). Therefore by the induction hypothesis, Ajsource 206 and Aksource 206 are in Frm(L)source 206 (Reader correction: The source again prints the undefined language L sub zero here. The theorem concerns the fixed first-order language L, which the reader uses while preserving the printed source in the source view), and by the definition of a formula, so is (AjAk)source 208. The other cases follow by parallel reasoning.

End of proof.

Formation sequences for terms have similar properties to those for formulas.

Equivalence for term formation sequences

Trm(L)source 217 is the set of all Lsource 217-strings tsource 217 such that there exists a term formation sequence for tsource 218.

source 215

Proof

Exercise.

End of proof.

Exercise on term formation sequences

Unsolved exercise. The source supplies the prompt only; no solution is added.

Prove Equivalence for term formation sequences. Hint: use a similar strategy to that used in the proof of Equivalence of formula definitions.

source 225

There are two types of “junk” that can appear in formation sequences: repeated elements, and elements that are irrelevant to the construction of the formation or term. We can eliminate both by looking at minimal formation sequences.

Definition of minimal formation sequence

A formation sequence A0,,Ansource 238 for a formula Asource 239 is a minimal formation sequence for Asource 239 if for every other formation sequence ssource 240 for Asource 240, the length of ssource 241 is greater than or equal to n+1source 241.

Similarly, a formation sequence t0,,tnsource 243 for a term tsource 244 is a minimal formation sequence for tsource 245 if for every other formation sequence ssource 245 for tsource 245, the length of ssource 246 is greater than or equal to n+1source 246.

source 236

Note that a formula or term can have more than one minimal formation sequence, but they will contain exactly the same strings.

Formation-sequence characterization of subformulas

The following are equivalent:

  1. Bsource 257 is a sub-formula of Asource 257.

  2. Bsource 258 occurs in every formation sequence of Asource 258.

  3. Bsource 259 occurs in a minimal formation sequence of Asource 259.

source 253

Proof

Exercise.

End of proof.

Exercise on subformulas and formation sequences

Unsolved exercise. The source supplies the prompt only; no solution is added.

Prove Formation-sequence characterization of subformulas.

source 267

Free variable and sentence

Definition of free variable occurrences

The free occurrences of a variable in a formula are defined inductively as follows:

  1. Case: Asource 18 is atomic: all variable occurrences in Asource 19 are free.

    Case: the free variable occurrences of Asource 22 are exactly those of Bsource 22.

  2. Case: the free variable occurrences of Asource 25 are those in Bsource 25 together with those in Csource 26.

    Case: the free variable occurrences in Asource 29 are all of those in Bsource 29 except for occurrences of xsource 30.

    Case: the free variable occurrences in Asource 33 are all of those in Bsource 33 except for occurrences of xsource 34.

source 13

Definition of bound variable occurrence

An occurrence of a variable in a formula Asource 39 is bound if it is not free.

source 38

Exercise on bound variable occurrences

Unsolved exercise. The source supplies the prompt only; no solution is added.

Give an inductive definition of the bound variable occurrences along the lines of Definition of free variable occurrences.

source 43

Definition of quantifier scope and binding

If xBsource 49 is an occurrence of a subformula in a formula Asource 50, then the corresponding occurrence of Bsource 50 in Asource 50 is called the scope of the corresponding occurrence of xsource 52. Similarly for xsource 52.

If Bsource 58 is the scope of a quantifier occurrence xsource 59 or xsource 60 in Asource 60, then the free occurrences of xsource 61 in Bsource 61 are bound in xBsource 61 and xBsource 62. We say that these occurrences are bound by the mentioned quantifier occurrence.

source 48

Examples of scope, binding, and free variables

Consider the following formula: v0A20(v0,v1)Bsource 69. Bsource 72 represents the scope of v0source 72. The quantifier binds the occurrence of v0source 73 in Bsource 73, but does not bind the occurrence of v1source 74. So v1source 74 is a free variable in this case.

We can now see how this might work in a more complicated formula Asource 79: v0(A10(v0)A20(v0,v1))Bv1(A21(v0,v1)v0¬A11(v0)D)Csource 80. Bsource 85 is the scope of the first v0source 85, Csource 85 is the scope of v1source 86, and Dsource 86 is the scope of the second v0source 87. The first v0source 87 binds the occurrences of v0source 88 in Bsource 88, v1source 88 binds the occurrence of v1source 89 in Csource 89, and the second v0source 89 binds the occurrence of v0source 90 in Dsource 90. The first occurrence of v1source 90 and the fourth occurrence of v0source 91 are free in Asource 91. The last occurrence of v0source 92 is free in Dsource 92, but bound in Csource 92 and Asource 92.

source 67

Definition of sentence

A formula Asource 96 is a sentence iff it contains no free occurrences of variables.

source 95

Substitution

Recursive definition of substitution in a term

We define s[t/x]source 14, the result of substituting tsource 14 for every occurrence of xsource 15 in ssource 15, recursively:

  1. Case: s[t/x]source 17 is just ssource 17.

  2. Case: s[t/x]source 19 is also just ssource 19, provided ysource 20 is a variable and yxsource 20.

  3. Case: s[t/x]source 22 is tsource 22.

  4. Case: s[t/x]source 24 is f(t1[t/x],,tn[t/x])source 25.

source 13

Definition of a term being free for a variable

A term tsource 30 is free for xsource 30 in Asource 30 if none of the free occurrences of xsource 31 in Asource 31 occur in the scope of a quantifier that binds a variable in tsource 32.

source 29

Examples of terms free and not free for substitution

  1. v8source 37 is free for v1source 37 in v3A24(v3,v1)source 37

  2. f21(v1,v2)source 40 is not free for v0source 40 in v2A24(v0,v2)source 41

source 35

Recursive definition of substitution in a formula

If Asource 46 is a formula, xsource 46 is a variable, and tsource 46 is a term free for xsource 47 in Asource 47, then A[t/x]source 47 is the result of substituting tsource 48 for all free occurrences of xsource 48 in Asource 48.

Case: A[t/x]source 50 is source 51.

  1. Case: A[t/x]source 57 is P(t1[t/x],,tn[t/x])source 57.

  2. Case: A[t/x]source 60 is t1[t/x]=t2[t/x]source 61.

    Case: A[t/x]source 63 is ¬B[t/x]source 64.

    Case: A[t/x]source 67 is (B[t/x]C[t/x])source 67.

    Case: A[t/x]source 71 is (B[t/x]C[t/x])source 71.

    Case: A[t/x]source 75 is (B[t/x]C[t/x])source 75.

    Case: A[t/x]source 83 is yB[t/x]source 84, provided ysource 84 is a variable other than xsource 85; otherwise A[t/x]source 85 is just Asource 86.

    Case: A[t/x]source 89 is yB[t/x]source 90, provided ysource 90 is a variable other than xsource 91; otherwise A[t/x]source 91 is just Asource 92.

source 45

We often use the following convention to avoid cumbersome notation: If Asource 117 is a formula which may contain the variable xsource 117 free, we also write A(x)source 118 to indicate this. When it is clear which Asource 118 and xsource 119 we have in mind, and tsource 119 is a term (assumed to be free for xsource 119 in A(x)source 120), then we write A(t)source 120 as short for A[t/x]source 120. So for instance, we might say, “we call A(t)source 121 an instance of xA(x)source 122.” By this we mean that if Asource 122 is any formula, xsource 123 a variable, and tsource 123 a term that's free for xsource 123 in Asource 124, then A[t/x]source 124 is an instance of xAsource 124.