55
A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural numbers. R := set of real numbers. x y := x is an element of set y. {true, false} := set of truth values. := connective “and”. := connective “or”. ¬ := connective “not”. := connective “implication”. := quantifier “for all” or “every”. := quantifier “there exists” or “some”. Propositional variable := variable whose possible values are the truth values. Propositional formula := either a propositional variable or A B, A B, A B, ¬A, where A, B are propositional formulas. Tautology := propositional formulas which is true under every interpretation (for example, A ∨¬A) Universe := set of elements where we interpret the constants, the function symbols and the relation symbols. x := for all elements x, where x ranges over the elements of the universe. X := for all subsets X , where X ranges over the subsets of the universe. Term := an expression denoting an element of the universe when we interpret the variables 1

A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

  • Upload
    lethien

  • View
    219

  • Download
    0

Embed Size (px)

Citation preview

Page 1: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

A course in Mathematical Logic

Antonino Salibra

November 12, 2015

1 Notations

N := set of natural numbers.

R := set of real numbers.

x ∈ y := x is an element of set y.

{true, false} := set of truth values.

∧ := connective “and”.

∨ := connective “or”.

¬ := connective “not”.

→ := connective “implication”.

∀ := quantifier “for all” or “every”.

∃ := quantifier “there exists” or “some”.

Propositional variable := variable whose possible values are the truth values.

Propositional formula := either a propositional variable or A ∧B, A ∨B, A→ B,¬A, where A,B are propositional formulas.

Tautology := propositional formulas which is true under every interpretation (forexample, A ∨ ¬A)

Universe := set of elements where we interpret the constants, the function symbolsand the relation symbols.

∀x := for all elements x, where x ranges over the elements of the universe.

∀X := for all subsets X, where X ranges over the subsets of the universe.

Term := an expression denoting an element of the universe when we interpret thevariables

1

Page 2: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

Atomic formula := An n-ary relation symbol applied to n terms

First-order formula := either an atomic formula or φ ∧ ψ, φ ∨ ψ, φ→ ψ, ¬φ, ∀xφ,∃xφ where φ, ψ are first-order formulas. The quantification ∃x and ∀x is restrictedto the elements of the universe.

x, y, . . . := sequences of indeterminate length.

xn := sequence x1, . . . , xn; and similarly, for xk, xm, yn, yk, ym.

z ∈ x := z is an element of the sequence x.

x ∩ y = ∅ := sequences x and y do not have common elements.

X ⊆f Y := X is a finite subset of Y .

1 := true

0 := false

2 The language of mathematics

In mathematics we prove sentences (= theorems or propositions or lemmas) ex-pressing properties of mathematical objects. The sentences are usually expressed inthe natural language. The mathematical objects can be of different type: integers,reals, matrices, sequences, continuous functions, groups, etc. When we providea proof of a sentence φ, we express a judgment of truth: the sentence φ is truebecause of its proof. In such a case, the sentence ¬φ is false. No other truth valueis allowed in classical mathematics. In the real life the situation is different.

Mathematical logic is a branch of mathematics, where sentences and proofs areformalized in a formal language. In this way sentences, proofs, and theories be-come mathematical objects as integers or groups, so that we can prove sentencesexpressing properties of formal sentences, proofs and theories.

2.1 Predicate symbols, terms and atomic formulas

In the language of mathematics atomic sentences are constructed by relating math-ematical objects. Mathematical objects are denoted by terms (or expressions),where variables may occur. For example, in algebra the terms may denote the ele-ments of a group (or a ring, vector space, etc.), while in analysis they may denotereals or continuous functions. It is also possible to consider terms for sets of objects(for example, subgroups, vector subspaces, etc.).

• Terms or expressions denote mathematical objects:

2

Page 3: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

– 3 denotes (= is a name for) the natural number three

– III denotes (= is a name for) the natural number three in the romanrepresentation

– 5 + 6 denotes (= is a name for) the natural number eleven

– 0.3147 denotes (= is a name for) the real number 3/10+1/100+4/1000+7/10000

– {3, 6, 7} denotes (= is a name for) the set whose elements are 3, 6, 7

– “The author of Romeo and Juliet” is a term denoting (= a name for)Shakespeare

– “The father of Antonino Salibra” is a term denoting (= a name for)Luigi Salibra

• Terms or expressions with variables denote mathematical objects after inter-pretation of the variables in the universe:

– x denotes a generic element of the universe

– 5 +x, where x ranges over the set of natural numbers, denotes a genericnatural number greater than 5

– 0.3xy7 denotes a generic real number of the form 3/10+x/100+y/1000+7/10000

– {x, y, z} denotes a generic set of at most three elements

– “The author of x” denotes a generic writer

• An atomic formula denotes a truth value:

– 3 divides 21

– 121 is a multiple of 11

– 3 = 5 + 6

– 11 + 6 is a prime number

– 5 is odd

– 3 ∈ {3, 6, 7}– {3} ⊆ {3, 6, 7}– John loves Mary

– John is father of Mary

– P (5)

– Q(dog, cat, dogcat)

3

Page 4: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

The words “divides”, “is a multiple of”, “=”, “⊆”, “loves” and “is a father of”are binary relations (or predicates). They relate pairs of elements of the universeof elements we are speaking or writing about. The words “is odd”, “is a primenumber” and “P” are unary predicates (or “properties” of the elements of theuniverse we are writing about). The binary predicate “∈” relates elements andsets. The ternary predicate “Q” relates triple of elements of the universe.

• An atomic formula with occurrences of variables denotes a truth value afterthe interpretation of the variables in the universe:

– x divides 122

– x+ y = y + x

– 3+5 = 5+3 (it is a particular instance of the atomic formula x+y = y+x,where x = 3 and y = 5)

– x is a prime number

– x is odd

– 3 ∈ X– X ⊆ Y

– {3} ⊆ {3, 6, 7} (it is a particular instance of the atomic formula X ⊆ Y ,where X = {3} and Y = {3, 6, 7})

– John loves X

– P (x)

– Q(dog, x, y)

– A

The symbol “A” represents a predicate of arity 0, in other words a propositionalvariable. “A” can be either true or false.

3 Propositional Logic: syntax and semantics

More complex formulas can be obtained by the atomic formulas applying the propo-sitional connectives “and”, “or”, “not”, ‘implies”, “if and only if”. Formally,

∧ (and); ∨ (or); ¬ (not); → (if-then); ↔ (iff),

• 2 divides 122 and 3 + 5 = 5 + 3 (true)

4

Page 5: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

• John likes Mary or Mary likes John

Definition 1. (Definition of the propositional formulas) Let P = {A,B,C, . . . } bea set of propositional variables. The set PF of propositional formulas is defined byinduction as follows:

1. Every propositional variable is a propositional formula;

2. If φ, ψ are propositional formulas, then φ ∧ ψ, φ ∨ ψ, φ→ ψ, φ↔ ψ and ¬φare propositional formulas;

3. Nothing else is a propositional formula.

Notation: To save parenthesis, we define the following priorities among the logicalsymbols:

1 : ¬; 2 : ∧,∨; 3 : →,↔ .

For example,

1. A ∧B → C ∨ ¬D stands for (A ∧B)→ (C ∨ (¬D)).

2. A→ B ∧ C ∨ ¬D is a wrong formula! We need parenthesis.

3. A→ (B ∧ C) ∨ ¬D stands for A→ ((B ∧ C) ∨ (¬D)).

We will write

A→ B → C → D for A→ (B → (C → D)).

The classical semantics of the propositional connectives is given by the truth tables.

1. A ∧B is true ⇔ A is true and B is true;

2. A ∨B is false ⇔ A is false and B is false;

3. ¬A is true ⇔ A is false;

4. A→ B is false ⇔ A is true and B is false.

5. A↔ B is true ⇔ A,B are both true or A,B are both false.

5

Page 6: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

To know the truth value of the propositional formula (A ∧ B) → C, we need toknow the truth values of the propositional variables A,B,C. For example, if A,Care true and B is false, then (A ∧ B) → C is true. The formula A ∧ B is falsebecause B is false, and any implication, whose premises is false, is true.

Then a model for a propositional language is just an interpretation of the proposi-tional variables into the set of truth values. We compute the truth value of morecomplex propositional formulas by using the above semantics of the connectives.

We give the formal definition of interpretation. We recall that

Definition 2. Let ρ : V → {true, false} be a function, called evaluation of thepropositional variables. Then we extend ρ to a map | − |ρ : PF → {true, false} ofinterpretation of the propositional formulas as follows:

1. |A|ρ = ρ(A) for every propositional variable A;

2. |φ ∧ ψ|ρ = true iff |φ|ρ = true and |ψ|ρ = true. Similarly for the otherconnectives.

Definition 3. 1. A propositional formula is a tautology if it is true for everyinterpretation of its propositional variables.

2. Two propositional formulas φ and ψ are logically equivalent iff φ ↔ ψ is atautology iff |φ|ρ = |ψ|ρ for every evaluation ρ.

The following formulas are tautologies:

• A→ A;

• Tertium non datur: A ∨ ¬A;

• Peirce Law: ((A→ B)→ A)→ A;

• ¬(A ∧ ¬A);

• Axiom K: A→ B → A.

• Axiom S: (A→ B → C)→ (A→ B)→ A→ C.

The following pairs of formulas are logically equivalent:

• De Morgan Law: ¬(A ∧B) and ¬A ∨ ¬B;

• De Morgan Law: ¬(A ∨B) and ¬A ∧ ¬B;

6

Page 7: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

• Idempotent Law: A ∧ A and A;

• Idempotent Law: A ∨ A and A;

• Commutative Law: A ∧B and B ∧ A;

• Commutative Law: A ∨B and B ∨ A;

• Distributive Law: A ∧ (B ∨ C) and (A ∧B) ∨ (A ∧ C).

• Distributive Law: A ∨ (B ∧ C) and (A ∨B) ∧ (A ∨ C).

Remark 1. Another possible interpretation of the propositional formulas is givenby using the Boolean algebra of the subsets of a set X. The emptyset correspondsto the truth value “false”, and the truth value “true” correspondes to the full setX. The propositional variables are interpreted by subsets of X, the connective ∧becomes the intersection, the ∨ the union, the ¬ the complement with respect to X.And the implication →?

x ∈ (A→ B) iff x ∈ A → x ∈ B iff either x ∈ B or x /∈ A.Then A→ B is true (i.e., A→ B = X) iff A ⊆ B.

4 First-order Logic: syntax and semantics

Starting from atomic formulas, more complex formulas can be written by using thepropositional connectives, the universal quantifier

∀ (Every)

and the existential quantifier∃ (Some).

Another idiomatic expression for the universal quantifier is “for all” and for theexistential quantifier is “there exists”.

Example 1. Some examples in the natural language:

• Every man likes some book.

• Some odd natural number divides 122.

• John likes every woman.

• Every triangle admits an acute angle.

7

Page 8: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

The same examples in the formal language of mathematics:

• ∀x(Man(x)→ ∃y(Book(y) ∧ x likes y))

• ∃x(Odd(x) ∧ x divides 122)

• ∀x(woman(x)→ John likes x).

• ∀x(triangle(x)→ ∃y(acute-angle(y) ∧ y angle-of x)).

The strings Man(x), Book(y), x likes y, Odd(x) etc. represent atomic formulas.

The semantics of propositional connectives is given by the truth tables. The seman-tics of the quantifiers is more complex. Consider, for example, a unary predicate Pand a model M of universe M = {a1, a2, . . . , an, . . . }, where this predicate shouldbe interpreted (see below for the formal definition of a model).

1. The formula ∀xP (x) is true in the model M if, and only if, the formula (oflength infinite if M is infinite) is true:

P (a1) ∧ P (a2) ∧ · · · ∧ P (an) ∧ . . .

In other words, “Every element satisfies the property P” if and only if (a1satisfies P ) and (a2 satisfies P ) and (a3 satisfies P ) and . . . (an satisfies P ),. . . etc.

2. The formulas ∃xP (x) is true in the model M if, and only if, the followingformula (of length infinite if M is infinite) is true:

P (a1) ∨ P (a2) ∨ · · · ∨ P (an) ∨ . . .

In other words, “some element satisfies the property P” if and only if (a1 satisfiesP ) or (a2 satisfies P ) or (a3 satisfies P ) or . . . (an satisfies P ), . . . etc.

Every sentence is either true or false in a model. Assuming that the universe ofthe model M is recursively enumerable, we have two algorithms. The first onesemidecides whether ∀xP (x) is false, while the second one semidecides whether∃xP (x) is true. In the following two algorithms, if the value of the variable x is anthen S(x) denotes an+1.

x := a1;while P (x) is true do x := S(x);Output(∀xP (x) is false)

x := a1;while P (x) is false do x := S(x);Output(∃xP (x) is true)

8

Page 9: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

• To check that ∀xP (x) is true in the model M requires an infinite time, be-cause we have to check that each formula in the infinite sequence P (a1),P (a2), . . . , P (an), . . . is true.

• To check that ∃xP (x) is false in the model M requires an infinite time, be-cause we have to check that each formula in the infinite sequence P (a1),P (a2), . . . , P (an), . . . is false.

This is the reason why we need proofs. A proof of the formula ∀xP (x) gives us,in a finite time, the information that ∀xP (x) is true. We pay the price to find theright proof in the infinite set of all possible proofs.

Example 2. Consider the sentence φ(x) ≡ A(x) → ¬∃yB(x, y). Let M be amodel of universe {0, 1, 2, 3} such that A(0), A(2), B(0, 3) and B(2, 1) are true; inall other cases A(x) and B(x, y) are false. We now evaluate the truth value of thesentence ∀xφ(x):

1. ∀xφ(x) is true in M iff the formulas φ(0), φ(1), φ(2) and φ(3) are all true inM.

2. We show that φ(0) ≡ A(0) → ¬∃yB(0, y) is false, because A(0) is true and¬∃yB(0, y) is false. Since B(0, 3) is true, then ∃yB(0, y) is true, so that¬∃yB(0, y) is false.

3. Since φ(0) is false in the modelM, then ∀xφ(x) is also false in the modelM.

We can compute the truth value of ∀xφ(x) by semantical methods (without a proof)because the universe of M is finite.

4.1 Terms and formulas

A language L is given by a family of function symbols and a family of relationsymbols. Each symbol has an arity, which is a natural number.

Function symbols of arity 0 are called constants. Relation symbols of arity 0 arecalled propositional variables.

Example 3. The language of arithmetics is given by two function symbols +, ∗of arity 2 and two relation symbols =, < of arity 2. The following are examples offormulas in the language of the arithmetics (see below for the formal definition ofa term and of a formula):

(i) ∀x(x+ 0 = x);

9

Page 10: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

(ii) ∀x∃y(x < y);

(iii) ∀x∀y∀z(x ∗ (y + z) = (x ∗ y) + (x ∗ z)).

Terms (or expressions) and formulas are defined by induction according to thefollowing definition.

Definition 4. (Definition of a term (or expression)) Let L be a language andV = {x, y, z, . . . , } be an infinite set of individual variables.

1. Every individual variable is a term;

2. Every constant of L is a term;

3. If f ∈ L is a function symbol of arity n and t1, . . . , tn are terms, thenf(t1, . . . , tn) is a term;

4. Nothing else is a term.

FV(t) denotes the set of individual variables occurring in a term t. For example,FV(5 + 3) = ∅ while FV(3 + x) = {x} and FV(3 + x+ y) = {x, y}.

Definition 5. (Definition of a formula) Let L be a language and V = {x, y, z, . . . , }be an infinite set of individual variables.

1. Every propositional variable (i.e., relation symbol of arity 0) is an atomicformula;

2. If P ∈ L is a relation symbol of arity n and t1, . . . , tn are terms, thenP (t1, . . . , tn) is an atomic formula;

3. Every atomic formula is a formula;

4. If φ, ψ are formulas, then φ ∧ ψ, φ ∨ ψ, φ→ ψ and ¬φ are formulas;

5. If φ is a formula and x ∈ V is an individual variable, then ∀xφ and ∃φ areformulas;

6. Nothing else is a formula.

Notation: To save parenthesis, we define the following priorities among the logicalsymbols:

1 : ¬,∀,∃; 2 : ∧,∨; 3 : → .

10

Page 11: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

For example, we write

∀xA(x) ∧B → C ∨ ¬D for ((∀xA(x)) ∧B)→ (C ∨ (¬D)).

Consider an occurrence of the individual variable x in a formula φ. We say thatthe occurrence of x is bound if x is under the scope of a quantifier (either ∀x or∃x).

Example 4. We have two occurrences of x In the formula ∀xR(x, y) ∨ P (x) : thefirst one is bound, and the second one is free. The underlined occurrence of x in∀xR(x, y)∨ P (x) is under the scope of ∀x, while the underlined occurrence of x in∀xR(x, y)∨P (x) is free. Recall that by our priority conventions, ∀xR(x, y)∨P (x)stands for (∀xR(x, y)) ∨ P (x).

We do not care about the name of bound variables. For example, the syllogism“Every man is mortal” is formalised as: ∀x(Man(x) → Mortal(x)), which is log-ically equivalent to ∀y(Man(y) → Mortal(y)), which is logically equivalent to∀z(Man(z)→Mortal(z)), etc.

If φ(x) is a formula and t is a term, then the formula φ(t) (or φ[t/x]) is the formulaobtained by substituting t for every free occurrence of the variable x in φ(x).WARNING: NO FREE VARIABLE OF t MUST BECOME BOUND IN φ(t) AF-TER THE SUBSTITUTION.

Example 5. if φ(y) ≡ ∀xR(x, y) and t ≡ x + y, then φ(x + y) ≡ ∀xR(x, x + y)is a WRONG substitution because the underlined variable x of t ≡ x + y becomebound. For the right substitution we need to chang name to the bound variable xin ∀xR(x, y). The result is φ(x+ y) ≡ ∀zR(z, x+ y).

Definition 6. The set of all individual variables occurring free in a formula isdefined by induction as follows:

• FV(P (t1, . . . , tn)) = FV(t1) ∪ · · · ∪ FV(tn);

• FV(φ ∗ ψ) = FV(φ) ∪ FV(ψ) for ∗ = ∧,∨,→;

• FV(¬φ) = FV(φ);

• FV(∀xφ) = FV(∃xφ) = FV(φ) \ {x}.

Definition 7. A formula φ is called a sentence if FV(φ) = ∅.

For example, the formula ∀x∃yR(x, y) is a sentence, but ∀xR(x, y) is not.

If φ is a formula, then we write φ ≡ φ(x1, . . . , xn) if FV(φ) ⊆ {x1, . . . , xn}.

11

Page 12: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

4.2 Models

Terms and formulas are interpreted in a model.

Definition 8. (Definition of a model) Let L be a language. An L-model M isgiven by a set M of elements (called the universe of the model) and

1. For every function symbol f ∈ L of arity n, a function fM : Mn →M ;

2. For every relation symbol R ∈ L of arity n, a relation RM ⊆Mn.

A unary predicate P is interpreted in the model M by a subset PM ⊆ M of theuniverse M , a binary predicate R as a binary relation RM ⊆M ×M , i.e. a set ofpairs of elements of M , etc.

If a ∈ PM then the sentence P (a) is true in the model; If a /∈ PM then the sentenceP (a) is false in the model. If (a, b) ∈ RM then the sentence R(a, b) is true in themodel; If (a, b) /∈ RM then the sentence R(a, b) is false in the model.

Example 6. (The model NAr of arithmetics) The universe of the model is the setN of natural numbers. The operations are the usual arithmetical operations of sum+N : N× N→ N and product ∗N : N× N→ N. We have (a) a binary relation =N

of equality such that n =N k iff n and k are the same natural number; (b) a binaryrelation <N such that n <N k iff there exists i ∈ N \ {0} such that n+N i = k.We can express the truth values of the following sentences:

(i) “3 divides 21” is true in the model because 21 =N 3 ∗N 7.

(ii) “121 is a multiple of 11” is true because 121 =N 11 ∗N 11

(iii) “3 = 5 + 6” is false because 5 +N 6 =N 11 and 3 =N 11 is false

(iv) “3 < 5 + 6” is true because 5 + 6 =N 11 and 11 =N 3 +N 8

Notice that the predicates “divides”, “ is a multiple of ” and ‘less or equal”‘are notprimitive in the model. They can be defined in terms +, ∗ and equality:

x divides y iff there exists z such that y = z ∗ x

Formally,x divides y iff ∃z(y = z ∗ x).

For the other predicates we have:

x is a multiple of y iff there exists z such that x = y ∗ z iff ∃z(x = y ∗ z)

12

Page 13: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

x < y iff there exists z ∈ N \ {0} such that y = x+ z iff ∃z(y = x+ z ∧ ¬(z = 0)).

The atomic formula “x divides 122” is neither true neither false in the model.Before giving a judgment of truth we need to give a value to the variable x. Thesame for the formulas “x is a prime number” and “x is odd”.

Example 7. (The model BAr of truth values for the language of arithmetics) Theuniverse of the model is the set {true, false} of truth values. The operation symbolsare interpreted as follows: +B = the propositional connective “or”; ∗B = thepropositional connective “and”; 0B = false; 1B = true; 0 <B 1. Then the sentence1 + 1 = 1 is true in BAr but not in NAr.

Example 8. The language of set theory is given by a function symbol ∅ of arity 0and a binary relation symbol ∈ of arity 2. The following are examples of formulasin the language of set theory:

(i) ∀x¬(x ∈ ∅);

(ii) ∀x∃y∀z(z ∈ x→ z ∈ y).

We now give the formal definition of interpretation of terms and formulas in amodel.

If V is the set of individual variables and M is a model of universe M , then afunction ρ : V → M is called environment of interpretation of the terms andformulas.

Definition 9. Let L be a language, M be a L-model and ρ : V → M be anenvironment.Interpretation of the terms:

(i) If x ∈ V , then xM = ρ(x);

(ii) If c ∈ L is a constant, then cM is the interpretation of the constant c;

(iii) f(t1, . . . , tn)Mρ = fM((t1)Mρ , . . . , (tn)Mρ ).

Interpretation of the formulas:

(i) R(t1, . . . , tn)Mρ is true iff ((t1)Mρ , . . . , (tn)Mρ ) ∈ RM;

(ii) ∀xφ(x)Mρ is true iff φ(a)Mρ is true for all elements a ∈M ;

(iii) ∃xφ(x)Mρ is true iff φ(a)Mρ is true for some element a ∈M ;

(iv) (φ∧ψ)Mρ is true iff φMρ , ψMρ are both true; similarly for the other connectives.

13

Page 14: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

The interpretation of a formula in a model depends only on the interpretation ofits free variables.

Proposition 1. If φ ≡ φ(x1, . . . , xn) and ρ, σ are two environments such thatρ(xi) = σ(xi) for every 1 ≤ i ≤ n, then φMρ = φMσ .

If a formula φ is a sentence, then its truth value in M does not depend on theenvironment ρ. Then we we will write φM for φMρ .

Definition 10. (i) A model M satisfies a sentence φ, and we write M |= φ, ifφM = true.

(ii) The theory of a model M is the set

Th(M) = {φ : φ is a sentence and M |= φ}.

Notice that φ ∈ Th(M) iff ¬φ /∈ Th(M); φ ∧ ψ ∈ Th(M) iff φ, ψ ∈ Th(M) andso on. Moreover, ∀xφ(x) ∈ Th(M) (resp. ∃xφ(x) ∈ Th(M)) iff φ(x)Mρ = true forall (some) environment ρ.

Example 9. Consider a language with a unary predicate P , a binary predicate Rand two constants a and b. We provide a model M for this language.

• Universe M = N, the set of natural numbers;

• aM = 4 and bM = 3;

• PM(x) iff “x is a prime number”, i.e., PM = {2, 3, 5, 7, 11, 13, 17, 19, 23, . . . };

• RM(x, y) iff “x divides y”, i.e., RM = {(k, n) : (∃y) n = y ∗ k}.

The following is an example of environment ρ:

x 7→ρ 5 (i.e. ρ(x) = 5); y 7→ρ 0; z 7→ρ 3; u 7→ρ 28; . . .

The interpretation of the formula φ(x, u) ≡ R(x, b) ∧ P (u) w.r.t. the environmentρ means

5 divides 3 and 28 is prime.

We have that φ(x, u)Mρ = false.The sentence R(a, b)∨P (b) means “4 divides 3 or 3 is prime”, is true in the model.The sentence ∀x∃yR(x, y) is true in the model. Why?

Example 10. (The model of naive sets) The universe of the modelM is the classSET of all sets and elements. We have the binary predicate “=” of equality andthe binary predicate “∈” such tha x ∈ y iff x is an element of set y.

14

Page 15: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

• 3 ∈ {3, 6, 7} is trivially true

• “{3} ⊆ {3, 6, 7}” is true because the unique element of set {3} is also elementof {3, 6, 7}. However, the predicate ⊆ is not primitive. It must be defined:

x ⊆ y iff ∀z(z ∈ x→ z ∈ y).

• {3} ∈ x can be formalized as follows: ∃z(z ∈ x ∧ ∀y(y ∈ z → y = 3)).

• “There exists the empty set” can be written as follows: ∃x∀z(¬(z ∈ x)), thatis, there is a set without elements. The symbol ¬ is the logical connective ofnegation.

• “There is an infinite set” can be expressed as follows: ∃x(∃z(z ∈ x)∧∀y(y ∈x→ {y} ∈ x)). Why is x infinite? if z ∈ x then {z}, {{z}}, {{{z}}}, . . . areelements of x.

If φ is a formula, the closure of φ is the formula ∀x1 . . . ∀xnφ such that FV(φ) ={x1, . . . xn}.

Definition 11. 1. A sentence φ is a logical truth, and we write |= φ, if, forevery model M, we have that φM = true. A formula ψ is a logical truth ifits closure is such.

2. Two sentences φ and ψ are logically equivalent iff, for every modelM, φM =ψM (that can be written |= φ↔ ψ).

The following sentences are logical truths:

• Every (propositional) tautology is a logical truth;

• ∀x(P (x) ∨ ¬P (x))

The following pairs of sentences are logically equivalent. The symbol ∗ represents∗ ≡ ∧,∨ and the symbol Q represents Q ≡ ∀,∃.

(P1) Qxφ(x)↔ Qyφ(y).WARNING: The formula ∀x∃yR(x, y) is not logically equivalent to ∀y∃yR(y, y).First we must rename the bound variable y: ∀x∃yR(x, y) is logically equiva-lent to ∀y∃zR(y, z).

(P2) ¬∀xφ↔ ∃x¬φ.

(P3) ¬∃xφ↔ ∀x¬φ.

15

Page 16: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

(P4) Qx(φ ∗ ψ)↔ (Qxφ ∗Qxψ).

(P5) (ψ ∗Qxφ)↔ Qx(ψ ∗ φ) if x /∈ FV(ψ).

(P6) (φ→ Qxψ)↔ Qx(φ→ ψ) if x /∈ FV(φ).

(P7) If x /∈ FV(ψ), then (∀xφ → ψ) ↔ ∃x(ψ → ψ) and (∃xφ → ψ) ↔ ∀x(ψ →ψ).

Definition 12. A formula is in prenex form if all its quantifiers are at the begin-ning of the formula.

The formula ∀x∃y∀z(P (x)→ Q(y, z)) is in prenex form, while the formula ∀x∀z(P (x)→∃yQ(y, z)) is not.

Proposition 2. Every formula is logically equivalent to a formula in prenex form.

Proof. Use the logical equivalences before the definition of a prenex form. Wemust carefully change the name of some bound variables to avoid mismatch ofvariables.

Example 11.

16

Page 17: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

5 Axiomatic Systems

Mathematicians prove sentences from a set of axioms which they assume “true”(for example, the axioms of euclidean geometry or to the axioms of set theory). Inthis section we provide a certain number of axiomatic systems.

Example 12. Consider a language with two binary predicates ≤,= and a constant0. A partially ordered set with minimum element is any model of the followingaxioms:

1. ∀x(x ≤ x)

2. ∀xyz(x ≤ y ∧ y ≤ z → x ≤ z)

3. ∀xy(x ≤ y ∧ y ≤ x→ x = y)

4. ∀x(0 ≤ x).

The theory of posets with minimum element is the set of all sentences provablefrom the above axioms.

Example 13. Consider a language with a binary operator +, a constant 0 and thebinary predicate of equality. A group is any model of the following axioms:

1. ∀xyz(x+ (y + z) = (x+ y) + z)

2. ∀x(x+ 0 = x = 0 + x)

3. ∀x∃y(x+ y = y + x = 0)

The set of integer numbers with the usual operation of addition constitutes a group.

The set of bijective maps from a set A onto A constitutes a group with respectto the composition of functions (in other words, the symbol + is interpreted asthe composition). In this case the constant 0 is interpreted as the identity mapId : A→ A. We recall that any bijective map is invertible: f◦f−1 = f−1◦f = Id.

The theory of groups is the set of all sentences provable from the axioms of a group.

17

Page 18: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

5.1 ZFC: Zermelo-Franklin set theory

The intuitive set theory is contradictory by Russel’s paradox. The property “x /∈ x”does not define a set. At the beginning of last century Zermelo and Franklinintroduced an axiomatic system for set theory. The language of ZFC is constitutedby two binary predicate ∈,=. The formule x ∈ y means “the set x is an elementof the set y”. All mathematics (numbers, functions, etc.) can be described withinZFC.

We do not know whether ZFC is consistent!

The axioms of ZFC are the following:

1. Extensionality: Two sets are equal iff they have the same elements.

∀xy(∀z(z ∈ x↔ z ∈ y)→ x = y)

2. Empty set: There exists the empty set.

∃x∀y(¬y ∈ x)

The set x, whose existence is assumed in this axiom, is denoted by the con-stant ∅. In other words, we have:

∀y(¬y ∈ ∅)

3. Pair: given two sets x and y, we can build the set {x, y}.

∀xy∃z∀t(t ∈ z ↔ t = x ∨ t = y)

The set z, whose existence is assumed in this axiom, is denoted by {x, y}. Inother words, we have:

∀xyt(t ∈ {x, y} ↔ t = x ∨ t = y).

The symbol {−,−} is a symbol function of arity 2.

4. Union:∀x∃y∀z(z ∈ y ↔ ∃t(t ∈ x ∧ z ∈ t))

The set y, whose existence is assumed in this axiom, is denoted by ∪x.

For example, if x = {{∅}, {2, {5}, 7}} then ∪x = {∅, 2, {5}, 7}.

18

Page 19: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

5. Power set∀x∃y∀z(z ∈ y ↔ z ⊆ x)

where z ⊆ x is an abbreviation of the formula ∀u(u ∈ z → u ∈ x). The sety, whose existence is assumed in this axiom, is denoted by P(x).

For example, if x = {3, 5} then P(x) = {∅, {3}, {5}, {3, 5}}.

Remark 2. For short, we will use the following further abbreviations:

• {x} stands for {x, x}• x ∪ y stands for ∪{x, y}

Notice that we can express a formula, where abbreviations occur, directly inthe language of ZF. For example, the formula ∅ ∈ {x, y} becomes

∃tz[∀u(¬u ∈ t) ∧ ∀u(u ∈ z ↔ u = x ∨ u = y) ∧ t ∈ z].

6. Axiom of infiniteThere exists an infinite set.

∃x(∅ ∈ x ∧ ∀y(y ∈ x→ y ∪ {y} ∈ x))

In other words, the following infinite chain of sets are elements of x:

∅, {∅}, {∅, {∅}}, {∅, {∅}, {∅, {∅}}}, . . .

We codify the natural numbers with these elements. Then

0 = ∅, 1 = {∅}, 2 = {∅, {∅}}, 3 = {∅, {∅}, {∅, {∅}}}, . . .

7. Schema of separationIf φ(x) is a first order formula with one free variable (i.e., a formula in thelanguage of set theory with quantification over sets) and a is a set, then thereexists the set b of all elements of a satisfying φ(x).

∀a∃b∀y(y ∈ b↔ y ∈ a ∧ φ(y)).

Warning: the “collection” {x : φ(x)} does not define a set. It is in generaltoo big! For example, the universe, defined by the collection {x : x = x}, isnot a set; similarly {x : x /∈ x} is not a set because of Russel’s paradox.

8. Schema of replacementIf the first-order formula φ(x, y) with two free variables is a function (i.e.,φ(x, y)∧φ(x, z)→ y = z), then, for every set a of inputs, there exists the setb of the corresponding outputs:

∀a[∀xyz(φ(x, y) ∧ φ(x, z)→ y = z)→ ∃b∀y(y ∈ b↔ ∃x(x ∈ a ∧ φ(x, y)))]

19

Page 20: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

9. Foundation axiom

∀x(x 6= ∅ → ∃y(y ∈ x ∧ y ∩ x = ∅))

Foundation axiom forbids self-reference. For example, there is no set x suchthat x = {x} and there is no infinite decreasing chain of memberships:

. . . yn ∈ yn−1 ∈ . . . ∈ y2 ∈ y1 ∈ y0

Foundation axiom is equivalent to the following induction principle, whereφ(x) is any formula in the language of set theory:

∀y[∀x(x ∈ y → φ(x))→ φ(y)]→ ∀yφ(y)

In other words, the property φ holds for all sets if the empty set satisfiesφ and any set y satisfies φ whenever every element of y satisfies φ. Thisprinciple implicitly say us that sets are built in a cumulative way.

10. Choice AxiomA set X is well-ordered by a strict total order if every non-empty subset ofX has a least element under the ordering. Zermelo has shown the followingtheorem:

Theorem 1. (Zermelo’s Theorem) For every set x, there exists a well-orderingon x.

Zermelo’s theorem cannot be proven in ZF set theory and it is equivalentto a choice principle independent of ZF set theory. This principle is non-constructive and it is now accepted by the community of mathematicians.The axiomatic set theory with choice axiom is denoted by ZFC:

∀x(∅ /∈ x→ ∃f(f is a function from x to⋃

x ∧ ∀y(y ∈ x→ f(y) ∈ y)),

where⋃x = {z : (∃y) y ∈ x ∧ z ∈ y}.

5.1.1 Ordinal numbers

Ordinal numbers extend the natural numbers to transfinite. We should think tothe natural numbers as the sets defined by induction as follows:

0 = ∅; n+ 1 = n ∪ {n}.

The following definition generalises the natural numbers.

20

Page 21: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

Definition 13. A set o is an ordinal number if o is strictly well-ordered withrespect to set membership and every element of o is also a subset of o.

For example, the number 4 = {0, 1, 2, 3} is an ordinal because 0 ∈ 1 ∈ 2 ∈ 3 is awell-ordering and 0 = ∅ ⊆ 4, 1 = {0} ⊆ 4, 2 = {0, 1} ⊆ 4 and 3 = {0, 1, 2} ⊆ 4.The set ω =

⋃n∈N n is an ordinal, but also ω + 1 = ω ∪ {ω} is an ordinal.

The successor of an ordinal α is defined as the ordinal α∪{α}. An ordinal is calleda limit ordinal if it is not the successor of another ordinal. For example, ω is alimit ordinal.

Ordinals are well-ordered by the relation ∈. A limit ordinal α is the union of allordinals < α, i.e., α =

⋃β<α β.

The collection Ord of all ordinals is NOT a set, because otherwise Ord ∈ Ordagainst foundation axiom.

A cardinal number is a limit ordinal number α such that α is not in bijectivecorrespondence with any β < α.

The first-order formula ord(x) can be defined as follows:

ord(x) ≡ (x,∈) is a strict well-ordering ∧ ∀y(y ∈ x→ y ⊆ x).

Remark 3. There are three operations we define over the class of ordinals: ad-dition, multiplication and exponentiation. The definitions are given by transfiniteinduction.

1. α + 0 = α;

2. α + (β + 1) = (α + β) + 1;

3. If β is a limit ordinal, α + β =⋃γ<β(α + γ).

Using this definition, ω+3 can be seen to be a successor ordinal (it is the successorof ω + 2), whereas 3 + ω is a limit ordinal, namely, the limit of 3 + 0 = 3, 3 + 1 =4, 3 + 2 = 5, etc., which is just ω.

Zero is the neutral element α + 0 = 0 + α = α. Addition is associative, and isstrictly increasing and continuous in the right argument:

α < β ⇒ γ + α < γ + β,

but the analogous relation does not hold for the left argument; instead we only have:

α < β ⇒ α + γ ≤ β + γ.

21

Page 22: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

Ordinal addition is left-cancellative: if α + β = α + γ, then β = γ. On the otherhand, right cancellation does not work: 3 + ω = 0 + ω = ω but 3 6= 0.

The multiplication α · β is defined as the well-ordered set obtained by β, replacingevery element of β by a copy of α. For example, ω · 2 is the set

0 < 1 < 2 < 3 < · · · < 0′ < 2′ < 3′ < . . .

which is the ordinal ω + ω. However, the ordinal 3 · ω is the ordinal

0 < 1 < 2 < 0′ < 1′ < 2′ < 0′′ < 1′′ < 3′′ < . . .

which is just ω. The multiplication is associative but not commutative.

The multiplication can be also defined by transfinite induction:

1. α · 0 = 0;

2. α · (β + 1) = (α · β) + α;

3. If β is a limit ordinal, α · β =⋃γ<β(α · γ).

5.1.2 The models of set theory

The ZF set theory defines a cumulative hierarchy of sets starting from the empty set.Since ZF is defined by first-order axioms we have infinite different models of ZF. Inthis section we define two models. The first one is the cumulative hierarchy of setsintroduced by von Neumann and Zermelo. It is defined by transfinite induction:

• V0 = ∅;

• Vα+1 = P(Vα) (powerset of Vα);

• Vα =⋃β<α Vβ if α is a limit ordinal;

• V =⋃α∈Ord Vα.

(V,∈) is a model of ZFC, but V is not a set. The axiom of foundation can beproven equivalent to this statement:

Every set belongs to Vα for some ordinal α.

Define Godel’s constructible universe L as follows:

Def(X) := {u ⊆ X : ∃z1, . . . , zn ∈ X∀y(y ∈ u→ (X,∈) |= φ(y, z1, . . . , zn)}.

The class L of constructible sets is defined by transfinite recursion as follows:

22

Page 23: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

• L0 := ∅;

• Lα+1 := Def(Lα);

• If λ is a limit ordinal, then Lλ :=⋃α<λ Lα;

• L :=⋃α∈Ord Lα.

Here Ord denotes the class of all ordinals.

The elements of L are called “constructible” sets. (L,∈) is a model of ZFC, whereit holds the continuum hypothesis CH (i.e., there are no cardinal numbers betweenthe cardinal ω and the cardinal of the power set of ω).

In sixties Cohen, by using a new technique of forcing, was able to construct a modelof ZFC where the negation of CH holds. Then CH is independent of ZFC.

5.2 Peano Arithmetics

Second-order Peano Arithmetic (PA2) is constituted by all sentences in the lan-guage of arithmetics provable from the following four axioms (PA1)-(PA2)-(PA3)-(FI):

(PA1) “The function successor is injective and 0 is not the successor of any othernumber”:

∀x¬(0 = x+ 1); ∀xy(x+ 1 = y + 1→ x = y)

(PA2) “The function ‘+’ is defined by induction:

∀x(x+ 0 = x); ∀xy(x+ (y + 1) = (x+ y) + 1)

(PA3) “The function ‘∗’ is defined by induction:

∀x(x ∗ 0 = 0); ∀xy(x ∗ (y + 1) = (x ∗ y) + x)

The full induction principle:

(FI) Full Induction: ∀P (P (0) ∧ ∀x(P (x)→ P (x+ 1))→ ∀xP (x)).

Remark 4. In full induction principle (FI) we have a quantification over all subsets(predicates) of the universe. What is the difference between a quantification oversubsets and over elements of the universe? Consider the following sentences:

• Every natural number is the sum of two prime numbers:∀n∃x∃y(n = x+ y ∧ Prime(x) ∧ Prime(y)).

23

Page 24: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

• Every set of natural numbers has minimum element:∀X(Xnon-empty→ Xhas-minimum).

• Full Induction (FI)

• Every continuous function is derivable.

The variable n ranges over “atomic” elements (in this case, natural numbers) whichdo not have an “inner” structure. Each natural number has a meaning thanks tothe relations connecting it to the other natural numbers. These relations are createdby the operations of addition and multiplication and the predicate of equality.

Subsets, continuous functions and properties have an inner structure. For example,we can apply the induction principle to an arbitrary predicate expressed in an arbi-trary language. There is no linguistic restriction to the ways to describe predicates,continuous functions and subsets.

Peano considers a restriction of the full induction principle to all first-order de-finable subsets of the universe. This means that (PA4) below is an infinite set ofaxioms, one for each first-order formula φ(x) in the language of arithmetic.

(PA4) First-order Induction: φ(0) ∧ ∀x(φ(x)→ φ(x+ 1))→ ∀xφ(x)

For example, the first-order induction principle for the formula Even(x) =def

∃y(x = 2 ∗ y) is expressed by the following formula:

Even(0) ∧ ∀x(Even(x)→ Even(x+ 1))→ ∀xEven(x)

that is,

∃y(0 = 2 ∗ y) ∧ ∀x(∃y(x = 2 ∗ y)→ ∃y(x+ 1 = 2 ∗ y))→ ∀x∃y(x = 2 ∗ y).

Definition 14. Peano arithmetic PA is the theory axiomatized by the axioms PA1-PA4, while PA2 is the theory axiomatized by the axioms PA1-PA3 and the fullinduction principle (FI).

It is obvious that the axioms PA1-PA4 are true in the standard model of naturalnumbers, because the standard model satisfies the full induction principle.

5.3 A comparison of PA and PA2

Definition 15. Two models M and P are isomorphic if there exists a bijectivemap h : M → P satisfying the following conditions, for all a1, . . . , an ∈ M , allfunction symbols f and all relation symbols R:

24

Page 25: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

(i) h(fM(a1, . . . , an)) = fP(h(a1), . . . , h(an));

(ii) (a1, . . . , an) ∈ RM iff (h(a1), . . . , h(an)) ∈ RP .

Proposition 3. Two isomorphic modelsM and P satisfy the same sentences (thatis, Th(M) = Th(P)).

We show that all the models of PA2 are isomorphic to the standard model NAr ofthe arithmetic.

Proposition 4. PA2 is categorical, i.e., all the models are isomorphic to the stan-dard model of the arithmetic NAr.

Proof. Assume thatM is a model of PA2. We define by induction a map f : N→M having the set N of natural numbers as domain:

f(0N) = 0M; f(x+N 1N) = f(x) +M 1M, for every natural number x ∈ N.

f is well-defined by the induction principle. Then the conclusion follows from thefollowing considerations.

1. Every model of second-order arithmetics satisfies ∀x(x 6= 0→ ∃y(x = y+ 1))and the associative property for the addition and multiplication. These prop-erties can be proven by induction. As an exercise we prove the associativityof addition:

∀xyz((x+ (y + z) = (x+ y) + z).

The proof is by induction over z. If z = 0, then x+(y+0) = x+y = (x+y)+0by PA2. Assume that x+ (y + z) = (x+ y) + z. Then we have:

(x+ y) + (z + 1) = ((x+ y) + z) + 1 by PA2

= (x+ (y + z)) + 1 by induction hyp.= x+ ((y + z) + 1) by PA2

= x+ (y + (z + 1)) by PA2

2. f is injective, that is, ∀xy(f(x) = f(y)→ x = y). The proof is by inductionover the parameter x ∈ N.

• x = 0: If y 6= 0 then by the above item (1) y = n+ 1 for some n, so thatf(y) = f(n + 1) = f(n) +M 1. If f(0) = f(y) then 0M = f(n) +M 1,but this contradicts PA1.

25

Page 26: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

• Assume by induction hypothesis that f(x) = f(y) implies x = y. Letf(x + 1) = f(x) +M 1 = f(y), so that y 6= 0. Then y = n + 1 andf(x) +M 1 = f(n) +M 1. By PA1 we obtain f(x) = f(n). By theinduction hypothesis x = n, then x+ 1 = n+ 1 = y.

3. f is onto, that is, ∀y∃x(y = f(x)). In this case we do not apply the usualinduction principle satisfied by of the natural numbers. We apply the fullinduction principle (FI), satisfied by the model M, to the predicate P (y) ≡∃x ∈ N(f(x) = y).

• Base of induction: P (0M) is true because f(0) = 0M by definition of f .

• Assume by induction hypothesis that P (y) is true. Then we proveP (y +M 1). Since P (y) is true, then there exists a natural numberx such that f(x) = y. Then we have:

y +M 1 = f(x) +M 1 by induction hyp.= f(x+ 1) by def of f .

The full induction principle for M allows us to conclude that ∀yP (y), i.e.,the map f is onto.

4. f is a homomorphism with respect to the sum: f(x + y) = f(x) + f(y). Wehave:

f(x+ 0) = f(x) = f(x) +M 0M = f(x) +M f(0).

Assume by induction hypothesis that f(x + y) = f(x) +M f(y). Then wehave:

f(x+ (y + 1)) = f((x+ y) + 1) by PA2= f(x+ y) +M 1 by def of f= (f(x) +M f(y)) +M 1 by induction hyp.= f(x) +M (f(y) +M 1) by associativity of +M

= f(x) +M f(y + 1) by def of f

5. f is a homomorphism with respect to the product : f(x ∗ y) = f(x) ∗ f(y). Asabove.

The first-order theory PA is not categorical, that is, it admits non-isomorphicmodels. Why does the proof of Prop. 4 fail for PA? Assume thatM is a model of

26

Page 27: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

PA. As in Prop. 4, we define by induction a map f : N → M having the set N ofnatural numbers as domain:

f(0) = 0M; f(x+ 1) = f(x) +M 1, for every natural number x ∈ N.

As in the proof of Prop. 4, we can prove that f is injective, f is a homomorphismwith respect to the sum and product, because the full induction principle holds forthe standard model of arithmetic. But we cannot prove that f is onto because inthis case we should use the first-order induction principle for the property P = {y ∈M : (∃x ∈ N) f(x) = y} of the model M. But we do not know whether the aboveproperty is definable with a first-order formula in the language of arithmetics, wherequantification is over individuals. It is possible to prove that there exist models ofPA, the so called non-standard models of arithmetic, for which P is not first-orderdefinable.

Proposition 5. PA is not categorical, i.e., there are models of PA that are notisomorphic to the standard model of natural numbers.

Proof. The existence of non-standard models of arithmetic can be demonstratedby an application of the Compactness Theorem 1.

We define a set of axioms in a language including the language of Peano arithmetictogether with a new constant symbol “c”. The axioms PA* consist of the axiomsof Peano arithmetic PA together with another infinite set of axioms: 0 < c, 1 < c,2 < c, 3 < c, 4 < c, . . . . In other words, for each standard natural number n, theaxiom c > n is included. Any finite subset X of PA* contains only a finite numberof the new axioms n < c. Then there exists a largest natural number n0 such thatn0 < c belongs to X.Then the axioms in X are satisfied by a model which is thestandard model of arithmetic plus c interpreted as n0+1. Thus by the compactnesstheorem there is a model M satisfying all the axioms PA*. Since any model ofPA* is a model of PA (a model of a set of axioms is obviously also a model of anysubset of that set of axioms), we have that our extended model is also a model ofthe Peano axioms. The element of this model M corresponding to “c” cannot bea standard number as it is greater than any standard natural number.

6 Compactness and Lowenheim-Skolem theorems

If Σ is a set of sentences and φ is a sentence, then we say that φ is a semanticalconsequence of Σ, and we write Σ |= φ, if, for every model M,

∀ψ ∈ Σ(M |= ψ)⇒M |= φ.

27

Page 28: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

We also write M |= Σ for ∀ψ ∈ Σ(M |= ψ).

A set Σ of sentences is satisfiable if there exists a model M such that M |= φ forevery formula φ ∈ Σ..

A set Σ of sentences is finitely satisfiable if, for every finite subset Γ of Σ thereexists a modelM such thatM |= φ for every formula φ ∈ Γ. Note that the modelM depends on the choice of the finite set Γ.

Theorem 2. (Compactness Theorem) A set Σ of first-order sentences (where thequantification is restricted to individuals) admits a model if, and only if every finitesubset of Σ admits a model.

Proof. The proof is divided in lemmas.

Lemma 1. Let Σ be a finitely satisfiable set of L-sentences. Then, for everysentence φ, either Σ ∪ {φ} or Σ ∪ {¬φ} is finitely satisfiable.

Proof. Assume that Σ ∪ {φ} is not finitely satisfiable. Then there exists Γ ⊆fin Σsuch that Γ∪ {φ} is unsatisfiable. By hypothesis Γ has models. Then we have, forevery model M:

M |= Γ⇒M |= ¬φ. (1)

We now show that Σ ∪ {¬φ} is finitely satisfiable. Let Ψ ⊆fin Σ be an arbitraryfinite subset of Σ. Then by hypothesis Γ ∪Ψ is a finite satisfiable subset of Σ. By(1) a model of Γ ∪Ψ is also a model of ¬φ, and we get the conclusion.

Lemma 2. Let Σ be a finitely satisfiable set of L-sentences, φ(x) be a formula andc a constant neither occurring in Σ nor in φ(x). Then, Σ ∪ {∃xφ(x)} is finitelysatisfiable iff Σ ∪ {φ(c)} is finitely satisfiable.

Proof. Given a model satisfying ∃xφ(x), we interpret c as an element making∃xφ(x) true.

Lemma 3. Let Σ be a finitely satisfiable set of L-sentences. Then there exists alanguage L′ ⊃ L and a set Σ′ ⊃ Σ of L′-sentences with the following properties:

(i) Σ′ is finitely satisfiable;

(ii) For every sentence φ of L′, either φ ∈ Σ′ or ¬φ ∈ Σ′, but not both;

(iii) If ∃xφ(x) ∈ Σ′ then there exists a constant c of L′ such that φ(c) ∈ Σ′;

(iv) |L′|+ ω = |L|+ ω.

28

Page 29: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

Proof. Without loss of generality, we assume the language L to be countable. Letc0, c1, . . . , cn, . . . be a countable set of new constants. Let L′ = L∪{c0, c1, . . . , cn, . . . }.Let φ0, φ1, . . . , φn, . . . be an enumeration of all L′-sentences. Define a sequence offinitely satisfiable sets of L′-sentences by putting Σ0 = Σ. Assuming that Σn isfinitely satisfiable, we put:

• If Σn∪{φn} is not finitely satisfiable, then by Lemma 1 Σn∪{¬φn} is finitelysatisfiable and then we define Σn+1 = Σn ∪ {¬φn}.

• If Σn ∪ {φn} is finitely satisfiable, then

– if φn is not an existential formula, define Σn+1 = Σn ∪ {φn};– if φn ≡ ∃xψ(x) is an existential formula, then Σn+1 = Σn ∪ {φn, ψ(cj)},

where cj ∈ L′ is a new constant.

At the end define Σ′ ≡⋃n∈N Σn.

Lemma 4. The set Σ′ is satisfiable, so that Σ is also satisfiable.

Proof. Recall that the new language L′ is defined as L′ = L ∪ {c0, c1, . . . , cn, . . . }.Define a modelM of Σ′ as follows. The universe ofM is the setM = {c0, c1, . . . , cn, . . . }of the new constants. The relation symbols are defined as follows:

(ci1 , . . . , cin) ∈ RM iff R(ci1 , . . . , cin) ∈ Σ′.

The definition is well done because, for every formula φ, either φ ∈ Σ′ or ¬φ ∈ Σ′.Then we prove by induction over the complexity of the formulas φ that Th(M) =Σ′. If φ = φ1 ∧ φ2 ∈ Σ′, then M |= φ iff M |= φ1 and M |= φ2 iff, by induction,φ1, φ2 ∈ Σ′. Similarly, for the other formulas.

This concludes the proof of the compactness theorem.

Corollary 1. Let Σ be a set of first-order sentences. If Σ |= φ then there exists afinite subset Σ0 of Σ such that Σ0 |= φ.

Proof. Assume that for every finite subset Γ of Σ we have that Γ ∪ {¬φ} is satis-fiable (We are negating the conclusion of the corollary). The by the compactenesstheorem the set Σ ∪ {¬φ} is satisfiable, contradicting the hypothesis.

Theorem 3. (Upward Lowenheim-Skolem Theorem) Let Σ be a set of sentences.If Σ has either (a finite model of cardinality n for every n > 0) or (an infinitemodel), then for every cardinal κ ≥ |L|+ ω, Σ has a model of cardinality κ.

29

Page 30: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

Proof. Consider a set C of new constants of cardinality κ and the language L′ =L∪C. Let Σ′ be the theory axiomatised by Σ and the axioms c 6= d for all distinctc, d ∈ C. The theory Σ′ is finitely satisfiable. Then by compactness Σ′ has a modelwhich has cardinality |L′|+ ω = κ.

30

Page 31: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

7 Proofs in natural deduction

Proof theory, in contraposition to truth value interpretation of logic, gives a newinterpretation to the formulas. To assert the formula A means “there is a proof ofA”, while to assert the formula ¬A means “A is contradictory (= from A it followsa contradiction)”.

Classical logic believes that the Boolean logic of truth values “not true = false” and“not false = true” is the same of the logic of proofs: “not provable = contradictory”and “not contradictory = provable”. Every sentence A is either “true = provable”or “false = contradictory”. This explains the law of excluded middle: for anysentence A, there exists a proof of either A or ¬A.

Intuitionistic logic refutes the law of excluded middle: may be, there are sentenceB such that B is neither provable nor contradictory.

We use the new symbol ` with the following interpretation:

A1, . . . , Ak ` B

iff from the assumption that proofs of A1, . . . , Ak exist we prove B (by applyingthe logical rules of deducibility). “A1, . . . , Ak ` B” is called a sequent.

In the context of proof theory, the word “theorem” is used as a sinonimo of “prov-able sentence”.

A mathematician proves sentences. A computer scientist programs problems (tofind algorithmic solutions to the problems). A sentence with its proof and a problemwith its program are the result of a creative act. It is difficult to be a goodmathematician as a good programmer.

A sentence may not have a proof, a problem may not have a program (for example,the halting problem). There are different reasons for a sentence without a proof: (i)it is false in the standard (i.e., intended) model (for example, 0 = 1 in arithmetic);(ii) it is not provable from the axioms; (iii) it is independent from the axioms (forexample, the continuum hypothesis in Zermelo-Franklin set theory).

Let φ be a sentence, T be a set of sentences and M be a model. We denote by `the notion of provability (to be defined below). We prove only true sentences, thatis, if T ` φ (φ is provable from T ) then T |= φ (φ is a semantical consequence ofT ).

Proofs from semantics Proofs from syntax|= φ (logical truth) ` φ (provable from the empty set of axioms)T |= φ (φ is a semantical consequence of T ) T ` φ (φ is provable from T )M |= φ (i.e., φ ∈ Th(M)) T ` φ where T is a complete theory

31

Page 32: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

7.1 Deduction rules for propositional connectives

We introduce the simple rules of natural deduction of propositional logic. We startwith an example of informal proof.

Proofs in intuitionistic logic will be labeled by (IL), the other ones by (CL).

Example 14. (IL) This example is from [?]. Consider the following sentence:

(A→ B)→ (A→ (B → C))→ A→ C.

It is a tautology by the truth values interpretation of the propositional variables.However, in mathematics the above sentence would be proven as follows: AssumeA → B, A → (B → C) and A. We would like to show C. From A and A → Bwe deduce B. From A and A→ (B → C) we obtain B → C. Finally, from B andB → C we get C.

(∧e) (read: and elimination) From a proof of A ∧ B we can construct a proofof A and a proof of B. Formally,

A ∧B ` A; A ∧B ` B.

Another way to write the rule in tree notation:

A ∧B[∧e]

A

A ∧B[∧e]

B

(∧i) (read: and introduction) From a proof of A and a proof of B we constructa proof of A ∧B. Formally,

A,B ` A ∧B.

Another way to write the rule in tree notation:

A B[∧i]

A ∧B

(→i) (read: arrow introduction) A→ B is provable if from the assumption Awe can construct a proof of B. Formally,

If A ` B then ` A→ B

The assumption A is discharged.

32

Page 33: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

The rule in tree notation:

[A]···B

[→i]A→ B

The assumption A is discharged.

(→e) (read: arrow elimination or Modus Ponens (MP))

A,A→ B ` B

The rule in tree notation:

A→ B A[→e]

B

(∨i) (read: or introduction)

A ` A ∨B; B ` A ∨B

The rule in tree notation:

A[∨i]

A ∨B

B[∨i]

A ∨BRemark 5. (See [?]) The meaning of the rules ∨i is not evident, because nobodyseems to have an interest to prove A ∨ B, when we already have, for example, aproof of A. However, in some cases we need to prove A∨B. For example, assumethat we have shown the following sentence: ∀x(A(x) ∨ B(x) → C(x)) concerningnatural numbers, and we would like to prove ∀xC(x). Then it is sufficient to proveA(n) ∨ B(n) for every natural number n, that is, to prove A(n) or B(n) for everyn; may be, we are able to prove A(n) for every even n, and B(k) for every odd k.

Example 15. (IL) (See [?, Example 2.1]) We prove A ∧ B,B ∧ A→ C ` C ∨D.We write the proof as a tree (written bottom-up) whose root is labeled by C ∨Dand whose leaves are labeled by the assumptions.

33

Page 34: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

A ∧B[∧e]

B

A ∧B[∧e]

A[∧i]

B ∧ A B ∧ A→ C[→e]

C[∨i]

C ∨D

We now analyze the other logical rules.

(∨e) (read: or elimination) Consider the rule of and-introduction: A,B ` A∧B.If we reverse the rule by “applying” the ∗ map introduced at the beginning of thissection we get: ¬A ∨ ¬B ` either ¬A or ¬B. If we put A for ¬A and B for ¬B,we have:

A ∨B ` either A or B

with the obvious meaning: from the assumption that a proof of A ∨ B exists itfollows that either a proof of A or a proof of B exists. However, this is not adeduction rule because we do not conclude with a proof of something! However, ifwe are able to prove a formula C by assuming either A or B then we get the rightdeduction rule for or-elimination:

(∨e) If A ` C and B ` C then A ∨B ` C

The assumptions A and B are discharged.

The rule in tree notation:

A ∨B

[A]···C

[B]···C

[∨e]C

The assumptions A and B are discharged.

(⊥e) (read: false elimination) We denote the “false” or the “absurd” with ⊥.

⊥ ` A

If have a proof of the absurd then we can prove anything.

The rule in tree notation:

34

Page 35: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

⊥[⊥]

A

(¬e) (read: not elimination) The right proof-theoretical interpretation of theformula ¬A is the following:

a proof of ¬A iff from the assumption A we prove the absurd ⊥

In other words,` ¬A iff ` A→ ⊥

Then the rule of (¬e):A,¬A ` ⊥

The rule in tree notation:

¬A A[¬e]

(¬i) (read: not introduction)

If A ` ⊥ then ` ¬A

The assumption A is discharged.

The rule in tree notation:

[A]···⊥

[¬i]¬A

Example 16. (IL) We show that the formulas ¬A and A → ⊥ are logicallyequivalent. This result can be obtained by using (MP), (→i), ¬i and ¬e. We donot use (RRA).

[A]∗ ¬A[¬e]

⊥[→i; ∗]

A→ ⊥

[A]∗ A→ ⊥[→e]

⊥[¬i; ∗]

¬ABy the definition ¬A ≡ A→ ⊥, the rules (¬i) and (¬e) are particular cases of →i

and →e.

35

Page 36: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

Example 17. (IL) To prove (¬A ∧ ¬B) → ¬(A ∨ B) we must prove ¬(A ∨ B)from the assumption ¬A ∧ ¬B.

[A ∨B]∗∗

[¬A ∧ ¬B]∗∗∗

[∧e]¬A [A]∗

[¬e]⊥

[¬A ∧ ¬B]∗∗∗

[∧e]¬B [B]∗

[¬e]⊥

[∨e;∗ ]⊥

[¬i;∗∗ ]¬(A ∨B)

[→i;∗∗∗ ]

(¬A ∧ ¬B)→ ¬(A ∨B)

Example 18. (IL) A proof of A→ ¬¬A:

[A]∗∗ [¬A]∗

[¬e]⊥

[¬i; ∗]¬¬A

[→i; ∗∗]A→ ¬¬A

(RRA)] (proof by contradiction) A constructive logic has two main properties:

• the disjunction property - Γ ` A ∨B iff either Γ ` A or Γ ` B

• the witness property - Γ ` ∃x.A(x) iff Γ ` A(t) for some witness t

Intuitionistic logic (IL) is constructive, but classical logic (CL) not (ex: A ∨ ¬Aand ∃x(Ax→ ∀yAy)). The rule RRA makes non constructive classical logic.

If ¬A ` ⊥ then ` A.

The assumption ¬A is discharged.

The rule in tree notation:

[¬A]···⊥

[RRA]A

This rule implies, for example, the tertium non datur A ∨ ¬A of classical logic.

36

Page 37: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

Example 19. (CL) (Tertium non datur) We get a proof of A ∨ ¬A by (RRA) ifwe prove ⊥ from the assumption ¬(A ∨ ¬A).

(1) We prove ¬(A∨¬A) ` ⊥. Assume ¬(A∨¬A). This is the principal assump-tion that we can use in all steps (1) of the proof.

(1.1) We prove A ` ⊥. Assume A (this assumption can be used only in step(1.1) of the proof); then A `∨i A ∨ ¬A. Since we can use the principalassumption ¬(A ∨ ¬A), then we have A ∨ ¬A,¬(A ∨ ¬A) `¬e ⊥. Inconclusion, we have a proof of ⊥ from A.

(1.2) ` ¬A by (1.1) and the rule (¬i).(1.3) ¬A `∨i A ∨ ¬A.

(1.4) A∨¬A,¬(A∨¬A) `¬e ⊥ (we use the proven formula A∨¬A and againthe principal assumption)

(1.5) In conclusion, we have a proof ⊥ from ¬(A ∨ ¬A) ` ⊥.

(2) ` A ∨ ¬A by (1) and the rule (RRA).

The proof can be written in tree notation:

[A]∗

[∨i]A ∨ ¬A [¬(A ∨ ¬A)]∗∗

[¬e]⊥

[¬i;∗ ]¬A

[∨i]A ∨ ¬A [¬(A ∨ ¬A)]∗∗

[¬e]⊥

[RRA;∗∗ ]A ∨ ¬A

The assumption A is discharged (and this is written by including the assump-tion within square bracket) by (¬i), while the principal assumption ¬(A ∨ ¬A) isdischarged by RRA.

37

Page 38: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

Example 20. (CL) The Peirce law

[A]∗∗ [A→ ⊥]∗∗∗

[→e]⊥

[⊥]B

[→i;∗∗ ]

A→ B [(A→ B)→ A]∗

A [A→ ⊥]∗∗∗

[→e]⊥

[RRA;∗∗∗ ]A

[→i;∗ ]

((A→ B)→ A)→ A

The intuitionistic version of Peirce law:

[A]∗∗ [A→ ⊥]∗∗∗

[→e]⊥

[⊥]B

[→i;∗∗ ]

A→ B [(A→ B)→ A]∗

A [A→ ⊥]∗∗∗

[→e]⊥

[¬i;∗∗∗ ]¬¬A

[→i;∗ ]

((A→ B)→ A)→ ¬¬A

38

Page 39: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

Example 21. We prove the formula (A→ B) ∨ (B → A):

[A]∗

[A → ⊥]∗∗

[→e]

[⊥]

B

[→i;∗ ]

A → B

[∨i]

(A → B) ∨ (B → A) [(A → B) ∨ (B → A) → ⊥]2

[→e]

[→i;∗∗ ]

(A → ⊥) → ⊥

[B]3

[A]1

[→i;3 ]

B → A

[∨i]

(A → B) ∨ (B → A) [(A → B) ∨ (B → A) → ⊥]2

[→e]

[→i;1 ]

A → ⊥

[→e]

[RRA;2 ]

(A → B) ∨ (B → A)

7.1.1 RRA and other equivalent rules

Consider the following rule of double negation elimination:

¬¬A[⊥c]

A

Proposition 6. Assuming the other rules of natural deduction, (RRA) and (⊥c)are equivalent.

Proof.

¬¬A [¬A]∗

[¬e]⊥

[RRA;∗ ]A

[¬A]∗···⊥

[¬i;∗ ]¬¬A

[⊥c]A

The Peirce law ((A → B) → A) → A is very important for classical logic (seebelow). If we transform this law in a rule, then we get the so-called Peirce rule:

39

Page 40: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

[A→ B]···A

[Peirce]A

Proposition 7. Assuming the other rules of natural deduction, (RRA) is equiva-lent to the (⊥)+(Peirce) rules.

Proof. Assume the rule (RRA).

(⊥):

···⊥ [¬A]∗

⊥[RRA;∗ ]

ARecall that we can always add useless hypotheses to a proof.

We now prove the Peirce rule:

[A→ B]∗···A [A→ ⊥]∗∗∗

[→e]⊥

[→i;∗ ]

¬(A→ B)

[A]∗∗ [A→ ⊥]∗∗∗

[→e]⊥

[⊥]B

[→i;∗∗ ]

A→ B[→e]

⊥[RRA;∗∗∗ ]

A

Conversely, assume (⊥) and (Peirce). We now show the RRA rule:

[A→ ⊥]∗···⊥

[⊥]A

[Peirce;∗ ]A

40

Page 41: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

7.2 Deduction rules for quantifiers

(∃i) (read: “there exists” introduction) An existential statement ∃xP (x) canbe proven in two different ways. The first one is a constructive method: we providesan element a satisfying P (a):

P (a) ` ∃xP (x)

In tree notation:P (a)

[∃i]∃xP (x)

The second method is not constructive: we assume that there exists a proof of¬∃xP (x); then, we use a reasoning to get a contradiction (for example, 0 = 1).Then there is no proof of ¬∃xP (x). In classical logic it holds the law of excludedmiddle: for any sentenceA, eitherA is provable, or ¬A is provable. Then in classicallogic we can conclude that there exists a proof of ∃xP (x), without providing anelement which satisfies property P . In intuitionist logic the fact that there is noproof of ¬∃xP (x) does not imply that there exists a proof of ∃xP (x).

Example 22. 1. The sentence ∃xPrime(x) is true because Prime(2) is true.

2. We would like to show by contradiction that there exist two irrational num-bers a and b such that ab is rational. Assume, by the way of contradiction,that the sentence is false. It is well known that

√2, that is the length

of the diagonal of the unitary square, was shown irrational by Pitagora.

Then, by using our hypothesis√

2√2

and (√

2√2)√2 are both irrational. But

(√

2√2)√2 =√

2√2∗√2

=√

22

= 2. Contradiction. Then the original sentenceis true. By the proof we have the further information that at least one of the

following pairs a =√

2, b =√

2 or a =√

2√2, b =

√2 is a pair of irrationals

satisfying ab rational. We do not know whether the first pair is irrational orwhether the second pair is irrational.

(∀i) (read: “ for all” introduction) In order to show a universal statement∀xP (x) either we give a schema of proof (starting as follows: “Let x be....”) byusing the general properties of the variable x, or we assume that there is no proofof ∀xP (x) and we get a contradiction. This second type of reasoning only holds inclassical logic.

41

Page 42: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

P (x)[∀i;x not free in the hypotheses of the proof of P (x)]

∀xP (x)

It is fundamental to require that x not free in the hypotheses of the proof of P (x).Here is an example of wrong application of the ∀i-rule.

[x is a prime number]∗

[∀i; (wrong application)]∀x(x is a prime number)

[→i;∗ ]

(x is a prime number) → ∀x(x is a prime number)[∀i; (right application)]

∀x[(x is a prime number) → ∀x(x is a prime number)]

But the above sentence is false. If the sentence holds for all x, then we can choosex = 3. Then the assumption “3 is a prime number” is true. This implies that theconclusion “∀x(x is a prime number)” is also true: every natural number is prime!

Example 23. The statement ∀x(x2 + 7x+ 12 is even) is true. Let x be a naturalnumber. Then we have two cases: x even and x odd. If x is even, then x2 +7x+12is sum of even numbers, so that it is even. If x is odd, then x2 is odd and 7x isalso odd, so that x2 + 7x is even. Finally, x2 + 7x + 12 = (x2 + 7x) + 12 is evenbecause sum of two even numbers.

(∀e) (read: “for all” elimination)

∀xP (x)[∀e]

P (a)

For example, the following is a proof:

∀x(x2 + 7x+ 12 is even)[∀e]

32 + (7× 3) + 12 is even[after evaluation of the expression]

42 is even

Example 24. In order to show ¬∀xP (x) either we give a counter-example (i.e., anelement a such that P (a) is false) or we assume that there exists a proof of ∀xP (x)and we get a contradiction. In this second case, we conclude that there is no proofof ∀xP (x), which is a proof of ¬∀xP (x).

42

Page 43: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

The statement ∀n(n2 + 3n + 4 is a perfect square) is false because we have acounter-example: n = 1. Formally,

[∀n(n2 + 3n+ 4 is a perfect square)]∗

[∀e]12 + (3× 1) + 4 is a perfect square

[evaluation]8 is a perfect square

[by arithmetics]8 is not a perfect square

[¬e]⊥

[¬i;∗ ]¬∀n(n2 + 3n+ 4 is a perfect square)

(∃e) (read: “there exists” elimination)

∃xP (x)

[P (x)]···C

[x not free in hypotheses of the proof of ∃xP (x) and (except P (x)) of C]C

This deduction rule is often used to show ¬∃xP (x): give a schema of proof (startingas follows: “Let x be such that P (x) is true....” by using the general properties ofthe variable x.

[∃xP (x)]∗∗

[P (x)]∗···⊥

[∃e;∗ ]⊥

[¬i;∗∗ ]¬∃xP (x)

Example 25.

[∃x(P (x) ∧ ¬P (x))]∗∗

[P (x) ∧ ¬P (x)]∗···⊥

[∃e;∗ ]⊥

[¬i;∗∗ ]¬∃x(P (x) ∧ ¬P (x))

because we have:

P (x) ∧ ¬P (x)[∧e]

P (x)

P (x) ∧ ¬P (x)[∧e]

¬P (x)[¬e]

43

Page 44: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

Lemma 5. We have the following logical equivalences:

• ¬∀xφ(x)⇔ ∃x¬φ(x).

• ¬∃xφ(x)⇔ ∀x¬φ(x).

Proof.

∃x¬φ(x)

[¬φ(x)]∗

[∀xφ(x)]∗∗

φ(x)

⊥[∃e;∗ ]

⊥[¬i;∗∗ ]

¬∀xφ(x)

[∃xφ(x)]∗∗

[φ(x)]∗

∀x¬φ(x)

¬φ(x)

⊥[∃e;∗ ]

⊥[¬i;∗∗ ]

¬∃xφ(x)

Example 26. (Proofs by contradiction) We prove by contradiction that there existinfinite prime numbers. Assume, by contradiction, that there exists only a finitenumber of prime numbers: p0 < p1 < · · · < pn. Let n = (p0 ∗ · · · ∗ pn) + 1. Whenwe divide n by pi we have a remainder of 1, so n is not a multiple of any of theseprime numbers pi. Then it must exist a prime greater than pn. Contradiction.

Example 27. (Proofs by contrapositive) We prove the following statement: Ifx ≥ 4 is a prime number, then x+ 1 is not a perfect square. It is sufficient to provethat, if x+ 1 is a perfect square, then x is not a prime. In fact, if x+ 1 = k2 thenx = k2 − 1 = (k + 1)(k − 1) is factorable if k 6= 2 (i.e., x ≥ 4).

8 The completeness theorem

If Σ is a set of sentences and φ is a sentence, then we say that φ is a provable fromΣ, and we write

Σ ` φ,

if there exists a proof of φ in natural deduction with assumptions in Σ.

44

Page 45: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

Σ is a theory if it is closed under derivablity, i.e.,

Σ ` φ⇒ φ ∈ Σ.

We write Σ ` Γ for ∀ψ ∈ Γ(Σ ` ψ).

Recall that a set Γ of sentence is consistent if Γ 6` ⊥.

Theorem 4. (Godel’s Completeness Theorem) Let Σ be a set of sentences.

(i) Σ is consistent iff Σ has a model.

(ii) Σ ` φ iff Σ |= φ.

Proof. (i) (⇐) Since the deduction rules preserve the truth, if Σ has a model, thenΣ is consistent, otherwise ⊥ would have a model!

(i) (⇒) Assume Σ to be consistent. The proof is divided in lemmas.

Lemma 6. Let Γ be a consistent set of L-sentences. Then, for every sentence φ,either Γ ∪ {φ} or Γ ∪ {¬φ} is consistent.

Proof. Assume that Γ∪{φ} is inconsistent. Then there exists a proof of ⊥ assumingΓ ∪ {φ}. An application of (¬i) provides a proof of ¬φ from Γ, that is Γ ` ¬φ. Itfollows that Γ ∪ {¬φ} is consistent, otherwise Γ would be inconsistent.

Lemma 7. Let Σ be a consistent set of L-sentences, φ(x) be a formula and c aconstant neither occurring in Σ nor in φ(x). Then, Σ ∪ {∃xφ(x)} is consistent iffΣ ∪ {φ(c)} is consistent.

Proof. If Σ∪{φ(c)} is consistent then Σ∪{∃xφ(x)} is also consistent. By the rule(∃i) and by the assumption φ(c) we can deduce ∃xφ(x).

For the converse, assume by contrapostion that Σ ∪ {φ(c)} is inconsistent. Thenwe have a proof of ⊥ from φ(c) (and Σ). By applying the rule (¬i) we get a proofof ¬φ(c) from Σ. Since c is a new constant occurring only in φ(c), we can considerit as a variable. We then apply the rule (∀i) to get a proof of ∀c¬φ(c) from Σ.Since ∀c¬φ(c) is logically equivalent to ¬∃xφ(x), this contradicts the hypothesisthat Σ ∪ {∃xφ(x)} is consistent.

Lemma 8. Let Σ be a consistent set of L-sentences. Then there exists a languageL′ ⊃ L and a set Σ′ ⊃ Σ of L′-sentences with the following properties:

(i) Σ′ is consistent;

(ii) For every sentence φ of L′, either φ ∈ Σ′ or ¬φ ∈ Σ′, but not both;

45

Page 46: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

(iii) If ∃xφ(x) ∈ Σ′ then there exists a constant c of L′ such that φ(c) ∈ Σ′.

Proof. Without loss of generality, we assume the language L to be countable. Letc0, c1, . . . , cn, . . . be a countable set of new constants. Let L′ = L∪{c0, c1, . . . , cn, . . . }.Let φ0, φ1, . . . , φn, . . . be an enumeration of all L′-sentences. Define a sequence ofconsistent sets of L′-sentences by putting Σ0 = Σ. Assuming that Σn is consistent,we put:

• If Σn∪{φn} is not consistent, then by Lemma 1 Σn∪{¬φn} is consistent andthen we define Σn+1 = Σn ∪ {¬φn}.

• If Σn ∪ {φn} is consistent, then

– if φn is not an existential formula, define Σn+1 = Σn ∪ {φn};– if φn ≡ ∃xψ(x) is an existential formula, then Σn+1 = Σn ∪ {φn, ψ(cj)},

where cj ∈ L′ is a new constant.

At the end define Σ′ ≡⋃n∈N Σn. If Σ′ ` ⊥, then there exists a finite subset Σ′0 ⊆ Σ′

such that Σ′0 ` ⊥. By the inductive definition of Σ′, there is n such that Σ′0 ⊆ Σn.This contradicts the consistency of Σn. Then Σ′ is consistent.

Lemma 9. The set Σ′ is satisfiable.

Proof. Recall that the new language L′ is defined as L′ = L ∪ {c0, c1, . . . , cn, . . . }.Define a modelM of Σ′ as follows. The universe ofM is the setM = {c0, c1, . . . , cn, . . . }of the new constants. The relation symbols are defined as follows:

(ci1 , . . . , cin) ∈ RM iff R(ci1 , . . . , cin) ∈ Σ′.

The definition is well done because, for every formula φ, either φ ∈ Σ′ or ¬φ ∈ Σ′.Then we prove by induction over the complexity of the formulas φ that Th(M) =Σ′. If φ = φ1 ∧ φ2 ∈ Σ′, then M |= φ iff M |= φ1 and M |= φ2 iff, by induction,φ1, φ2 ∈ Σ′. Similarly, for the other formulas.

This concludes the proof of Item (i) of the completeness theorem.

(ii) Σ 6` φ iff Σ∪{¬φ} is consistent iff (by (i)) Σ∪{¬φ} is satisfiable iff Σ 6|= φ.

9 Godel’s Incompleteness Theorem

In this section Form denotes a set of formulas (non necessarily first-order formulas).If φ ∈ Form, then we write φ = φ(x1, . . . , xn) if x1, . . . , xn are all variables occurring

46

Page 47: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

free in φ. A model M is a set M together with an n-ary relation φM ⊆ Mn forevery formula φ(x1, . . . , xn).

Definition 16. Let M be a model. A relation R ⊆Mn is definable in M if thereexists a formula φ(x1, . . . , xn) such that M |= φ(a1, . . . , an) iff (a1, . . . , an) ∈ R.

A modelM is complemented if an n-ary relation R is definable inM iff Mn \R isdefinable in M.

Lemma 10. (Diagonalization lemma) Let M be a set and R ⊆M×M be a binaryrelation. Then there exist no element m0 ∈M satisfying the following condition:

∀x ∈M [(m0, x) ∈ R iff (x, x) /∈ R].

Intuitive meaning: each element b ∈ M codifies (is a name of) the unary relation{x ∈M : (b, x) ∈ R}. The unary relation {x ∈M : (m,m) /∈ R} has no name.

Theorem 5. (Tarski’s theorem on undefinability of truth) Let M be a model forwhich there exists a bijective map

d e : Form1 −→M (Godel numbering)

φ(x) ∈ Form1 7→ dφ(x)e ∈M

from the set of unary formulas onto the universe M of M. Then,

(i) The complement of Truth = {(dϕ(x)e,m) :M |= φ(m)} is not definable inM.

(ii) IfM is complemented neither Truth nor the complement of Truth is definablein M.

Proof. Assume, by contradiction, the complement of Truth to be definable in Mby a formula false(x, y). Then the unary formula ∆(x) = false(x, x) satisfies forevery m ∈M :

(d∆(x)e,m) ∈ Truth iff (m,m) /∈ Truth.

contradicting the diagonalization lemma.

Corollary 2. IfM is an L-structure of domain N, where all semidecidable sets aredefinable (for example, the standard model of PA), then Truth is not semidecidable.

Corollary 3. The Halting Problem is not decidable.

47

Page 48: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

Proof. Consider the set of formulas Pn, where P is a program and n ≥ 1 is anatural number. We define a model for this logical language as follows:

Universe: the set P of all programs.

Interpretation: PPn = {(Q1, . . . , Qn) : P ↓(Q1, . . . , Qn)}.Then Truth = {(P1, Q) : P ↓Q} is not decidable and the complement of Truth isnot semidecidable.

Theorem 6. (Godel’s first incompleteness theorem) Let ` be a notion of provabilityof formulas. LetM be a complemented model such that there exists a bijective map

p q : FORM1 −→M (Godel numbering).

If Prov = {(pψ(x)q, a) : ` ψ(a)} is definable in M, then there exists a formulaϕ(x) such that

1. M |= ϕ(pϕq) iff 6` ϕ(pϕq) (intuitive meaning: ϕ(pϕq) says ‘I am not prov-able’) so that Prov 6= Truth.

2. If the system ` is consistent (that is, we can prove only true sentences:Prov ⊆ Truth), thenM |= ϕ(pϕq) and ϕ(pϕq) is not provable. The formula¬ϕ(pϕq), which says ‘ϕ(pϕq) is provable’, is also not provable.

Proof. Let Prov(x, y) be a formula such that

M |= Prov(pψ(x)q, a) iff ` ψ(a).

Define ϕ ≡ ¬Prov(x, x). Then we have:

M |= ϕ(pϕq) iff 6` ϕ(pϕq).

The formula (0 = 1) is false. Then the consistency of provability ` can be expressedby the formula

Cons ≡ ¬Prov(p(0 = x)q, 1).

Theorem 7. (Godel’s second incompleteness theorem) Let M be a complementedmodel of a logic ` such that there exists a Godel numbering

p q : FORM1 −→M

and Prov = {(pψ(x)q, a) : ` ψ(a)} is definable in M.

If the system ` can internalise the proof of the first incompleteness theorem

` Cons→ ϕ(pϕq),

then 6` Cons (where ϕ(pϕq) means ‘I am not provable’).

Proof. If ` Cons and ` Cons → ϕ(pϕq) then by Modus Ponens ` ϕ(pϕq). Thiscontradicts First Incompleteness Theorem.

48

Page 49: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

10 Exercises: formalization

In algebra we may write formulas to express that a binary operation is commutativeor that a vector sub-space has dimension 3; in analysis, formulas to express thata sequence is convergent or that a function is continuous; in set theory, formulasto express the inclusion of two sets. We now provide examples of sentences andformulas.

Remark 6. The sentences “Every professor is...”, “Every multiple of 3 is...”, ingeneral, ”Every P is...” are translated formally as follows:

∀x(P (x)→ ....)

The sentences “Some professor is ...”, “There is a multiple of 3 such that...”, ingeneral, ”Some P is...” are translated as follows:

∃x(P (x) ∧ . . . ).

10.1 Formalization of the natural language

The language of human beings contains:

• Constants: Mario, Maria, Giovanni, . . .

• Unary functions: “The-father-of”, “The-mother-of”, . . .

• Predicates: =, love, eat, like, . . .

The following are examples of terms: The-father-of(Maria), The-mother-of(Maria),while the sentence “The father of Maria eats” is formalized as Eat(The-father-of(Maria)).

Example 28. Consider a binary predicate A, a unary predicate P and a constantj, with the following intuitive meaning:

A(x, y) ≡ x likes y; P (x) ≡ x is a professor; j ≡ John

1. John likes every professor : ∀x(Px→ A(j, x)).

2. John likes some professor : ∃x(Px ∧ A(j, x)).

49

Page 50: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

3. John likes only the professors. The above sentence is logicalle equivalent to:John likes all professors and does not like the other people. Formally,

∀x(Px→ A(j, x)) ∧ ∀x(¬Px→ ¬A(j, x)),

which is logically equivalent to

(∗) ∀x[(Px→ A(j, x)) ∧ (¬Px→ ¬A(j, x))].

because it holds the following logical equivalence (Q ed R are arbitrary unarypredicates):

∀x(Qx ∧Rx)↔ (∀xQx ∧ ∀xRx).

Another way to write the sentence is the following. We have the followinglogical equivalence:

(A→ B) ↔ (¬B → ¬A).

Then, (*) becomes

∀x[(Px→ A(j, x)) ∧ (A(j, x)→ P (x))],

that is,∀x(Px↔ A(j, x)).

4. Only one professor likes Mary: ∃x(Px∧A(x,m)∧∀z(Pz∧A(z,m)→ z = x)).

We have the following logical equivalences:

• ¬∀xRx↔ ∃x¬Rx;

• ¬∃xRx↔ ∀x¬Rx;

• (A→ B)↔ (¬A ∨B);

• (¬A ∨ ¬B)↔ ¬(A ∧B).

Then,

∀z(Pz ∧ A(z,m)→ z = x) ↔ ∀z(¬(Pz ∧ A(z,m)) ∨ z = x)↔ ∀z(¬(Pz ∧ A(z,m)) ∨ ¬¬(z = x))↔ ∀z¬(Pz ∧ A(z,m) ∧ ¬(z = x))↔ ¬∃z(Pz ∧ A(z,m) ∧ ¬(z = x))

Then the formula formalizing “Only one professor likes Mary” can be writtenas follows:

∃x(Px ∧ A(x,m) ∧ ¬∃z(Pz ∧ A(z,m) ∧ ¬(z = x)).

50

Page 51: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

5. Two professors like Mary: ∃xy(Px∧Py ∧ x 6= y ∧A(x,m)∧A(y,m)), wherex 6= y stands for ¬(x = y).

6. Only two professors like Mary: ∃xy(Px ∧ Py ∧ x 6= y ∧ A(x,m) ∧ A(y,m) ∧¬∃z(Pz ∧ z 6= x ∧ z 6= y ∧ A(z,m))).

Example 29. Consider a binary predicate B and two unary predicates C and Swith the following intuitive meaning:

B(x, y) ≡ x likes y; Px ≡ x is a university course; Sx ≡ x is a student

1. No student likes every course: ¬∃x(Sx ∧ ∀y(Cy → B(x, y)))

2. No course is loved by all students : ¬∃x(Cx ∧ ∀y(Sy → B(y, x)))

10.2 Formalization of mathematical sentences

10.2.1 The language of arithmetic

• Constants: 0, 1, 2, 3, . . . , n, . . .

• Binary function symbols: +, ∗

• Binary relation symbol: =

The standard (or intended) model of arithmetics has the set N of natural numbersas universe and the arithmetical interpretation of the above symbols.

Example 30. Every multiple of 6 is a multiple of 3. Formally:

1. x multiple-of y iff ∃k(x = y ∗ k)

2. y divides x iff ∃k(x = y ∗ k)

3. ∀x(x multiple-of 6→ x multiple-of 3).

Example 31. The predecessor of a multiple of 4 is a prime number. Formally:

1. Prime(z) ≡ ¬(z = 0) ∧ ¬(z = 1) ∧ ∀x(x divides z → x = 1 ∨ x = z)

2. ∀x(x multiple-of 4 → ∃z(Prime(z) ∧ x− 1 = z)).

Example 32. The sum + is commutative. Formally: ∀x∀y(x+ y = y + x).

Example 33. Existential sentences :

51

Page 52: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

• There is a number n such that n2 = 543. Formally: ∃n(n2 = 543).

• There are natural numbers a, b, c such that a2+b2 = c2. Formally: ∃a∃b∃c(a2+b2 = c2).

We cannot express in the language of arithmetics the induction principle becausewe have a universal quantification over the subsets of N (or all unary predicates onN):

∀Y (Y (0) ∧ ∀x(Y (x)→ Y (x+ 1))→ ∀xY (x)).

First-order logic only admits quantification over individual variables. See Section5.2 below.

10.2.2 The language of set theory

We admit quantification over sets if sets become the elements of the intended model.For example, in set theory we have the following language.

• Constants: ∅ (empty set), N (the set of natural numbers), R (the set of realnumbers), etc.

• Function symbols of arity 2: ∪ (union), ∩ (intersection), \ (complementation)

• Relation symbols of arity 2: = (equality), ∈ (belonging to), ⊂ (containedwithin), ⊆ (contained within or equal to)

The following strings x, ∅, x∪(x∩y), x∩∅, x\y, . . . are terms, while the followingis a formula expressing De Morgan’s law:

∀x∀y[(z \ (x ∪ y) = (z \ x) ∩ (z \ y)].

Example 34. We express the sentence “The set X has infinite elements” with aunique sentence:

∃y(y ∈ X) ∧ ∀z(z ∈ X → ∃x(x ∈ X ∧ ∀y(y ∈ x↔ y = z))).

In other words, X is nonempty and, whenever z ∈ X, then {z} ∈ X. Thus, ifz ∈ X, then {z}, {{z}}, {{{z}}}, . . . ∈ X.

Example 35. We introduce a binary predicate B and we formalize the sentence“B is an injective but not surjective function”.

• B is a function: ∀xyz(B(x, y) ∧B(x, z)→ y = z)

52

Page 53: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

• B is a total function: ∀xyz(B(x, y) ∧B(x, z)→ y = z) ∧ ∀x∃yB(x, y)

• B is a total injective function:B is a total function ∧ ∀xyz(B(x, z) ∧B(y, z)→ x = y)

• B is an injective but not surjective function:B is a total injective function ∧ ∃y∀x¬B(x, y).

Example 36. Let N be the set of natural numbers. We formalize the sentenceEvery nonempty subset of natural numbers has minimum element. The above sen-tence is equivalent to induction principle. Formally:

1. X has-minimum iff ∃x(x ∈ X ∧ ∀z(z ∈ X → x ≤ z))

2. ∀X(X ⊆ N ∧Xnon-empty→ X has-minimum).

10.2.3 The language L of real analysis

• Constants: 0, 1, e, π, . . .

• Function symbols of arity 2: + (addition), ∗ (product) , − (subtraction), etc.

• Function symbols of arity 1: | | (absolute value), sin, cos, ln (natural loga-rithm), and other function symbols: f, g, h etc.

• Relation symbols of arity 1: N (to be a natural number), Z (to be an integer),etc.

• Relation symbols of arity 2: = (equality), ≤ (less than or equal to), < (lessthan), > (greater than), ≥ (greater than or equal to)

The standard (or intended) model of the above language has the set R of realnumbers as universe and the usual interpretation of the above symbols in realanalysis.

Example 37. The following strings 0, 1, 0 + 1, x+ 0, sin(x+ 0), . . . are terms,while the sentence “the function f is continuous” is formalized by

∀x0∀ε(ε > 0→ ∃α(α > 0 ∧ ∀x(|x− x0| < α→ |f(x)− f(x0)| < ε)).

Example 38. We recall that if (A,≤) is partially ordered set and X ⊆ A, then Xhas an upper bound if there exists z ∈ A such that ∀x(x ∈ X → x ≤ z). The leastupper bound of X, when it exists, is the least upper bound w.r.t. ≤.

53

Page 54: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

Let R be the set of real numbers and ≤ be the usual partial ordering on R. Theaxiom of continuity of the real line can be expressed as follows:

Every nonempty upper bounded set of real numbers has least upper bound .

It cannot be formalised in the language L, whose function symbols and relationsymbols are defined at the beginning of this section. We have a quantification overall subsets of R. Then we need the language of set theory.

1. X non-empty iff ∃x(x ∈ X);

2. y upper-bound-of X iff ∀x(x ∈ X → x ≤ y);

3. X upper-bounded iff ∃y(y upper-bound-of X) iff ∃y∀x(x ∈ X → x ≤ y);

4. X has-lub iff ∃z(z upper-bound-of X ∧ ∀y(y upper-bound-of X → z ≤ y)

5. ∀X(X ⊆ R ∧X non-empty ∧ X upper-bounded → X has-lub).

Example 39. We recall that a Cauchy sequence is a sequence (f(n) : n ∈ N) ofreal numbers such that for every ε > 0 there exists k such that |f(i) − f(j)| < εfor all i, j > k. We formalise the sentence: Every Cauchy succession is convergent.

Formally:

1. Cauchy(f) ⇔ ∀ε∃k(N(n) ∧ N(m) ∧ n > k ∧m > k → |f(n)− f(m)| < ε)

2. ∀f(Cauchy(f)→ ∃x∀ε∃k(N(k) ∧ N(n) ∧ (n > k → |x− an| < ε))).

The last sentence is outside first-order logic, because the quantification is not overthe element of the universe.

10.2.4 The language of plane geometry

• Constants: p1, . . . , pn (points), r1, . . . , rk (lines)

• Unary predicates: P (to be a point), L (to be a line),

• Binary predicates: =, ∈ (a point belongs to a line), I (a line intersects anotherline)

• Ternary predicate: B (a point is between two other points)

We formalize the following sentences:

54

Page 55: A course in Mathematical Logic - Univesalibra/programma-dettagliato-logica.pdf · A course in Mathematical Logic Antonino Salibra November 12, 2015 1 Notations N := set of natural

1. “Two points belong exactly to a line”

∀xy(P (x) ∧ P (y) ∧ x 6= y → ∃!z(L(z) ∧ x ∈ z ∧ y ∈ z))

2. “Every line contains at least two points”

∀x(L(x)→ ∃yz(P (y) ∧ P (z) ∧ y ∈ x ∧ z ∈ x ∧ y 6= z))

3. • “x, y, z points and x, y, z /∈ line u”

P (x) ∧ P (y) ∧ P (z) ∧ L(u) ∧ x /∈ u ∧ y /∈ u ∧ z /∈ u

• “There exists at least three points which do not belong to a line”

∃xyz∀u(x, y, z points and x, y, z /∈ line u)

4. “If a point y is between a point x and z, then x, y, z are three distinct pointsof a line and y is also between z and x”

P (x) ∧ P (y) ∧ P (z) ∧B(y, x, z)→

B(y, z, x) ∧ x 6= y ∧ x 6= z ∧ y 6= z ∧ ∃u(L(u) ∧ x, y, z ∈ u)

5. “For every line and every point not in the line, there exists a line containingthe point which is parallel to the given line”:

∀x∀y(L(x) ∧ P (y)) ∧ ¬(y ∈ x)→ ∃z(L(z) ∧ ¬I(x, z)))

6. “Given a line and a point not in the line, there exists a unique line containingthe point which is “perpendicolare” to the given line”

∀x∀y(L(x) ∧ P (y)) ∧ ¬(y ∈ x)→ ∃z!(L(z) ∧ y ∈ z ∧ z perpendicolare x)))

7. “Let x, y, z be three points not in the same line and a be a line such thatx, y, z are not in a. If the line a crosses the segment xy then a crosses eitherthe segment xz or the segment yz.”

• T (x, y, z) ≡def x, y, z are three points not in the same line

P (x) ∧ P (y) ∧ P (z) ∧ ¬(B(x, y, z) ∨B(y, x, z) ∨B(z, x, y))

• x, y, z /∈ a ≡def x /∈ a ∧ y /∈ a ∧ z /∈ a• T (x, y, z)∧x, y, z /∈ a∧∃z(z ∈ a∧B(z, x, y))→ ∃u(u ∈ a∧ (B(u, x, z)∨B(u, y, z)).

55