mathematical logic lecture 1: introduction and background

116
1 Mathematical Logic Lecture 1: Introduction and background Ashutosh Gupta TIFR, India Compile date: 2015-08-10

Upload: others

Post on 06-May-2022

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Mathematical Logic Lecture 1: Introduction and background

1

Mathematical Logic

Lecture 1: Introduction and background

Ashutosh Gupta

TIFR, India

Compile date: 2015-08-10

Page 2: Mathematical Logic Lecture 1: Introduction and background

2

Section 1.1

What is logic?

Page 3: Mathematical Logic Lecture 1: Introduction and background

3

What is logic?

I Have you ever said to someone “be logical”?

I whatever your intuition was that is logic

I Mathematization/Formalization of the intuition is mathematical logic

I Two streams of studying logicI use of logic : logic as a tool to study something elseI properties of logic: since logic is itself has mathematical structure, we may

study its mathematical properties

Self reference will haunt us!!

Page 4: Mathematical Logic Lecture 1: Introduction and background

3

What is logic?

I Have you ever said to someone “be logical”?I whatever your intuition was that is logic

I Mathematization/Formalization of the intuition is mathematical logic

I Two streams of studying logicI use of logic : logic as a tool to study something elseI properties of logic: since logic is itself has mathematical structure, we may

study its mathematical properties

Self reference will haunt us!!

Page 5: Mathematical Logic Lecture 1: Introduction and background

3

What is logic?

I Have you ever said to someone “be logical”?I whatever your intuition was that is logic

I Mathematization/Formalization of the intuition is mathematical logic

I Two streams of studying logicI use of logic : logic as a tool to study something elseI properties of logic: since logic is itself has mathematical structure, we may

study its mathematical properties

Self reference will haunt us!!

Page 6: Mathematical Logic Lecture 1: Introduction and background

3

What is logic?

I Have you ever said to someone “be logical”?I whatever your intuition was that is logic

I Mathematization/Formalization of the intuition is mathematical logic

I Two streams of studying logicI use of logic : logic as a tool to study something else

I properties of logic: since logic is itself has mathematical structure, we maystudy its mathematical properties

Self reference will haunt us!!

Page 7: Mathematical Logic Lecture 1: Introduction and background

3

What is logic?

I Have you ever said to someone “be logical”?I whatever your intuition was that is logic

I Mathematization/Formalization of the intuition is mathematical logic

I Two streams of studying logicI use of logic : logic as a tool to study something elseI properties of logic: since logic is itself has mathematical structure, we may

study its mathematical properties

Self reference will haunt us!!

Page 8: Mathematical Logic Lecture 1: Introduction and background

3

What is logic?

I Have you ever said to someone “be logical”?I whatever your intuition was that is logic

I Mathematization/Formalization of the intuition is mathematical logic

I Two streams of studying logicI use of logic : logic as a tool to study something elseI properties of logic: since logic is itself has mathematical structure, we may

study its mathematical properties

Self reference will haunt us!!

Page 9: Mathematical Logic Lecture 1: Introduction and background

4

Why study logic?

Differential equationsare the calculus of

Electrical engineering

Logicis the calculus ofComputer science

Logic provides tools to define/manipulate computational objects

Page 10: Mathematical Logic Lecture 1: Introduction and background

4

Why study logic?

Differential equationsare the calculus of

Electrical engineering

Logicis the calculus ofComputer science

Logic provides tools to define/manipulate computational objects

Page 11: Mathematical Logic Lecture 1: Introduction and background

4

Why study logic?

Differential equationsare the calculus of

Electrical engineering

Logicis the calculus ofComputer science

Logic provides tools to define/manipulate computational objects

Page 12: Mathematical Logic Lecture 1: Introduction and background

5

Defining logic

Logic is about inferring conclusions from given premises

Example 1.1

1. Humans are mortal

2. Socrates is a human

3

Socrates is mortal

Intuitive Pattern:

1. αs are β

2. γ is an α

γ is βwhere α and γ are noun andβ is adjective

1. Apostles are twelve

2. Peter is an apostle

7

Peter is twelveWhat wentwrong here?

Very easy to ill-define.Logic needs rigorous definitions!!

Page 13: Mathematical Logic Lecture 1: Introduction and background

5

Defining logic

Logic is about inferring conclusions from given premises

Example 1.1

1. Humans are mortal

2. Socrates is a human

3

Socrates is mortal

Intuitive Pattern:

1. αs are β

2. γ is an α

γ is βwhere α and γ are noun andβ is adjective

1. Apostles are twelve

2. Peter is an apostle

7

Peter is twelveWhat wentwrong here?

Very easy to ill-define.Logic needs rigorous definitions!!

Page 14: Mathematical Logic Lecture 1: Introduction and background

5

Defining logic

Logic is about inferring conclusions from given premises

Example 1.1

1. Humans are mortal

2. Socrates is a human

3

Socrates is mortal

Intuitive Pattern:

1. αs are β

2. γ is an α

γ is βwhere α and γ are noun andβ is adjective

1. Apostles are twelve

2. Peter is an apostle

7

Peter is twelveWhat wentwrong here?

Very easy to ill-define.Logic needs rigorous definitions!!

Page 15: Mathematical Logic Lecture 1: Introduction and background

5

Defining logic

Logic is about inferring conclusions from given premises

Example 1.1

1. Humans are mortal

2. Socrates is a human

3

Socrates is mortal

Intuitive Pattern:

1. αs are β

2. γ is an α

γ is βwhere α and γ are noun andβ is adjective

1. Apostles are twelve

2. Peter is an apostle

7

Peter is twelve

What wentwrong here?

Very easy to ill-define.Logic needs rigorous definitions!!

Page 16: Mathematical Logic Lecture 1: Introduction and background

5

Defining logic

Logic is about inferring conclusions from given premises

Example 1.1

1. Humans are mortal

2. Socrates is a human3

Socrates is mortal

Intuitive Pattern:

1. αs are β

2. γ is an α

γ is βwhere α and γ are noun andβ is adjective

1. Apostles are twelve

2. Peter is an apostle7

Peter is twelveWhat wentwrong here?

Very easy to ill-define.Logic needs rigorous definitions!!

Page 17: Mathematical Logic Lecture 1: Introduction and background

5

Defining logic

Logic is about inferring conclusions from given premises

Example 1.1

1. Humans are mortal

2. Socrates is a human3

Socrates is mortal

Intuitive Pattern:

1. αs are β

2. γ is an α

γ is βwhere α and γ are noun andβ is adjective

1. Apostles are twelve

2. Peter is an apostle7

Peter is twelveWhat wentwrong here?

Very easy to ill-define.Logic needs rigorous definitions!!

Page 18: Mathematical Logic Lecture 1: Introduction and background

6

Section 1.2

Course contents

Page 19: Mathematical Logic Lecture 1: Introduction and background

7

The course

We will study the following topics

I Propositional logic

I First order logic

I Logical theories

I Incompleteness results

Page 20: Mathematical Logic Lecture 1: Introduction and background

8

Propositional logic (PL)Propositional logic

I deals with propositions,I only infers from the structure over propositions, andI does not look inside propositions.

Example 1.2

Is the following argument valid?If the seed catalog is correct then if seeds are planted in April then theflowers bloom in July. The flowers do not bloom in July. Therefore, if seedsare planted in April then the seed catalog is not correct.

Let us symbolize our problemIf c then if s then f . not f . Therefore, if s then not c.

I c = the seed catalogue is correct

I s = seeds are planted in April

I f = the flowers bloom in July

PL reasons over propositionalsymbols and logical connectives

Page 21: Mathematical Logic Lecture 1: Introduction and background

8

Propositional logic (PL)Propositional logic

I deals with propositions,I only infers from the structure over propositions, andI does not look inside propositions.

Example 1.2

Is the following argument valid?If the seed catalog is correct then if seeds are planted in April then theflowers bloom in July. The flowers do not bloom in July. Therefore, if seedsare planted in April then the seed catalog is not correct.

Let us symbolize our problemIf c then if s then f . not f . Therefore, if s then not c.

I c = the seed catalogue is correct

I s = seeds are planted in April

I f = the flowers bloom in July

PL reasons over propositionalsymbols and logical connectives

Page 22: Mathematical Logic Lecture 1: Introduction and background

8

Propositional logic (PL)Propositional logic

I deals with propositions,I only infers from the structure over propositions, andI does not look inside propositions.

Example 1.2

Is the following argument valid?If the seed catalog is correct then if seeds are planted in April then theflowers bloom in July. The flowers do not bloom in July. Therefore, if seedsare planted in April then the seed catalog is not correct.

Let us symbolize our problemIf c then if s then f . not f . Therefore, if s then not c.

I c = the seed catalogue is correct

I s = seeds are planted in April

I f = the flowers bloom in July

PL reasons over propositionalsymbols and logical connectives

Page 23: Mathematical Logic Lecture 1: Introduction and background

8

Propositional logic (PL)Propositional logic

I deals with propositions,I only infers from the structure over propositions, andI does not look inside propositions.

Example 1.2

Is the following argument valid?If the seed catalog is correct then if seeds are planted in April then theflowers bloom in July. The flowers do not bloom in July. Therefore, if seedsare planted in April then the seed catalog is not correct.

Let us symbolize our problemIf c then if s then f . not f . Therefore, if s then not c.

I c = the seed catalogue is correct

I s = seeds are planted in April

I f = the flowers bloom in July

PL reasons over propositionalsymbols and logical connectives

Page 24: Mathematical Logic Lecture 1: Introduction and background

8

Propositional logic (PL)Propositional logic

I deals with propositions,I only infers from the structure over propositions, andI does not look inside propositions.

Example 1.2

Is the following argument valid?If the seed catalog is correct then if seeds are planted in April then theflowers bloom in July. The flowers do not bloom in July. Therefore, if seedsare planted in April then the seed catalog is not correct.

Let us symbolize our problemIf c then if s then f . not f . Therefore, if s then not c.

I c = the seed catalogue is correct

I s = seeds are planted in April

I f = the flowers bloom in July

PL reasons over propositionalsymbols and logical connectives

Page 25: Mathematical Logic Lecture 1: Introduction and background

9

PL topics

We will study

I definition of PL

I proof systems for PL

I Normal forms

I Soundness, completeness, and other results

I PL solvers called, SAT solvers

I some other stuff..

Page 26: Mathematical Logic Lecture 1: Introduction and background

10

First order logic (FOL)

First order logic

I looks inside the propositions,

I much more expressive,

I deals with quantifiers, parameterized propositions, and quantifiers, and

I can express lots of interesting math.

Example 1.3

Is the following argument valid?Humans are mortal. Socrates is a human. Therefore, Socrates is mortal.

In symbolic form,For all x if H(x) then M(x). H(s). Therefore, M(s).

I H(x) = x is a human

I M(x) = x is mortal

I s = Socrates FOL is not the most general logic.Many arguments can not be expressed in FOL

Page 27: Mathematical Logic Lecture 1: Introduction and background

10

First order logic (FOL)

First order logic

I looks inside the propositions,

I much more expressive,

I deals with quantifiers, parameterized propositions, and quantifiers, and

I can express lots of interesting math.

Example 1.3

Is the following argument valid?Humans are mortal. Socrates is a human. Therefore, Socrates is mortal.

In symbolic form,For all x if H(x) then M(x). H(s). Therefore, M(s).

I H(x) = x is a human

I M(x) = x is mortal

I s = Socrates FOL is not the most general logic.Many arguments can not be expressed in FOL

Page 28: Mathematical Logic Lecture 1: Introduction and background

10

First order logic (FOL)

First order logic

I looks inside the propositions,

I much more expressive,

I deals with quantifiers, parameterized propositions, and quantifiers, and

I can express lots of interesting math.

Example 1.3

Is the following argument valid?Humans are mortal. Socrates is a human. Therefore, Socrates is mortal.

In symbolic form,For all x if H(x) then M(x). H(s). Therefore, M(s).

I H(x) = x is a human

I M(x) = x is mortal

I s = Socrates

FOL is not the most general logic.Many arguments can not be expressed in FOL

Page 29: Mathematical Logic Lecture 1: Introduction and background

10

First order logic (FOL)

First order logic

I looks inside the propositions,

I much more expressive,

I deals with quantifiers, parameterized propositions, and quantifiers, and

I can express lots of interesting math.

Example 1.3

Is the following argument valid?Humans are mortal. Socrates is a human. Therefore, Socrates is mortal.

In symbolic form,For all x if H(x) then M(x). H(s). Therefore, M(s).

I H(x) = x is a human

I M(x) = x is mortal

I s = Socrates FOL is not the most general logic.Many arguments can not be expressed in FOL

Page 30: Mathematical Logic Lecture 1: Introduction and background

11

FOL topics

We will study

I definition of FOL

I proof systems for FOL

I Normal forms

I Soundness, completeness, and other results

I First order theorem provers

I some other stuff..

Page 31: Mathematical Logic Lecture 1: Introduction and background

12

Logical theories

In a theory, we study validity of FOL arguments under some specializedassumptions (called axioms).

Example 1.4

Number theory uses symbols 0, 1, . . . , <, +,· with some special meaning(usually defined by some axioms)

The following sentence makes little sense until we assign the specialmeanings to > and ·.

∀x∃p.(p > x ∧ (∀v1. (v1 > 1⇒ ∀v2. p 6= v1 · v2)))

Under the meanings it says that there are arbitrarily large prime numbers.

In the previous example, we had a vague understanding of predicatex is human (H(x)). Here we precisely know what is predicate x < y .

Page 32: Mathematical Logic Lecture 1: Introduction and background

12

Logical theories

In a theory, we study validity of FOL arguments under some specializedassumptions (called axioms).

Example 1.4

Number theory uses symbols 0, 1, . . . , <, +,· with some special meaning(usually defined by some axioms)

The following sentence makes little sense until we assign the specialmeanings to > and ·.

∀x∃p.(p > x ∧ (∀v1. (v1 > 1⇒ ∀v2. p 6= v1 · v2)))

Under the meanings it says that there are arbitrarily large prime numbers.

In the previous example, we had a vague understanding of predicatex is human (H(x)). Here we precisely know what is predicate x < y .

Page 33: Mathematical Logic Lecture 1: Introduction and background

12

Logical theories

In a theory, we study validity of FOL arguments under some specializedassumptions (called axioms).

Example 1.4

Number theory uses symbols 0, 1, . . . , <, +,· with some special meaning(usually defined by some axioms)

The following sentence makes little sense until we assign the specialmeanings to > and ·.

∀x∃p.(p > x ∧ (∀v1. (v1 > 1⇒ ∀v2. p 6= v1 · v2)))

Under the meanings it says that there are arbitrarily large prime numbers.

In the previous example, we had a vague understanding of predicatex is human (H(x)). Here we precisely know what is predicate x < y .

Page 34: Mathematical Logic Lecture 1: Introduction and background

12

Logical theories

In a theory, we study validity of FOL arguments under some specializedassumptions (called axioms).

Example 1.4

Number theory uses symbols 0, 1, . . . , <, +,· with some special meaning(usually defined by some axioms)

The following sentence makes little sense until we assign the specialmeanings to > and ·.

∀x∃p.(p > x ∧ (∀v1. (v1 > 1⇒ ∀v2. p 6= v1 · v2)))

Under the meanings it says that there are arbitrarily large prime numbers.

In the previous example, we had a vague understanding of predicatex is human (H(x)). Here we precisely know what is predicate x < y .

Page 35: Mathematical Logic Lecture 1: Introduction and background

12

Logical theories

In a theory, we study validity of FOL arguments under some specializedassumptions (called axioms).

Example 1.4

Number theory uses symbols 0, 1, . . . , <, +,· with some special meaning(usually defined by some axioms)

The following sentence makes little sense until we assign the specialmeanings to > and ·.

∀x∃p.(p > x ∧ (∀v1. (v1 > 1⇒ ∀v2. p 6= v1 · v2)))

Under the meanings it says that there are arbitrarily large prime numbers.

In the previous example, we had a vague understanding of predicatex is human (H(x)). Here we precisely know what is predicate x < y .

Page 36: Mathematical Logic Lecture 1: Introduction and background

13

Logical theories II

The logical theories are useful in studying specialized domains.

Logic was thought to be immensely useful general purpose tool in studyingproperties of various mathematical domains.

Page 37: Mathematical Logic Lecture 1: Introduction and background

13

Logical theories II

The logical theories are useful in studying specialized domains.

Logic was thought to be immensely useful general purpose tool in studyingproperties of various mathematical domains.

Page 38: Mathematical Logic Lecture 1: Introduction and background

14

Incompleteness results

But sadly, one can prove that

Theorem 1.1 (Godel’s incompleteness)

There are theories whose assumptions can not be listed.

Proof sketch.The proof proceeds by showing that if there is such a list for number theorythen the list can prove a theorem that “the list cannot prove the theorem”.Contradiction.

The incompleteness was considered epic failure of logic as a tool to do math.

From the ashes of logic, rose computer science.

Page 39: Mathematical Logic Lecture 1: Introduction and background

14

Incompleteness results

But sadly, one can prove that

Theorem 1.1 (Godel’s incompleteness)

There are theories whose assumptions can not be listed.

Proof sketch.The proof proceeds by showing that if there is such a list for number theorythen the list can prove a theorem that “the list cannot prove the theorem”.Contradiction.

The incompleteness was considered epic failure of logic as a tool to do math.

From the ashes of logic, rose computer science.

Page 40: Mathematical Logic Lecture 1: Introduction and background

14

Incompleteness results

But sadly, one can prove that

Theorem 1.1 (Godel’s incompleteness)

There are theories whose assumptions can not be listed.

Proof sketch.The proof proceeds by showing that if there is such a list for number theorythen the list can prove a theorem that “the list cannot prove the theorem”.Contradiction.

The incompleteness was considered epic failure of logic as a tool to do math.

From the ashes of logic, rose computer science.

Page 41: Mathematical Logic Lecture 1: Introduction and background

14

Incompleteness results

But sadly, one can prove that

Theorem 1.1 (Godel’s incompleteness)

There are theories whose assumptions can not be listed.

Proof sketch.The proof proceeds by showing that if there is such a list for number theorythen the list can prove a theorem that “the list cannot prove the theorem”.Contradiction.

The incompleteness was considered epic failure of logic as a tool to do math.

From the ashes of logic, rose computer science.

Page 42: Mathematical Logic Lecture 1: Introduction and background

15

Section 1.3

Course Logistics

Page 43: Mathematical Logic Lecture 1: Introduction and background

16

Evaluation

I Assignments : 25%, 5% each (strict deadlines!)

I Midterm : 20% (1 hour)

I Presentation: 15% (15 min)

I Final: 40% (2 hour)

Page 44: Mathematical Logic Lecture 1: Introduction and background

17

Website

Look at the following website for the further information

http://www.tcs.tifr.res.in/~agupta/courses/2015-logic

All the assignments and slides will be posted at the website.

Page 45: Mathematical Logic Lecture 1: Introduction and background

18

A puzzle that melt the internet!!To warm up your logic skills, solve the following puzzle:

Sanjay and Salman just become friends with Madhuri, and they want toknow when her birthday is. Madhuri gives them a list of possible dates.March 14, March 15, March 18,April 16, April 17,May 13, May 15,June 13, June 14, June 16

Madhuri then tells Sanjay and Salman separately the month and the day ofher birthday respectively.

Sanjay: I don’t know when her birthday is, but I know that Salman doesn’tknow too.Salman: At first I don’t know when her birthday is, but I know now.Sanjay: Then I also know when her birthday is.

So when is Madhuri’s birthday?

5 min break!

Page 46: Mathematical Logic Lecture 1: Introduction and background

18

A puzzle that melt the internet!!To warm up your logic skills, solve the following puzzle:

Sanjay and Salman just become friends with Madhuri, and they want toknow when her birthday is. Madhuri gives them a list of possible dates.March 14, March 15, March 18,April 16, April 17,May 13, May 15,June 13, June 14, June 16

Madhuri then tells Sanjay and Salman separately the month and the day ofher birthday respectively.

Sanjay: I don’t know when her birthday is, but I know that Salman doesn’tknow too.Salman: At first I don’t know when her birthday is, but I know now.Sanjay: Then I also know when her birthday is.

So when is Madhuri’s birthday? 5 min break!

Page 47: Mathematical Logic Lecture 1: Introduction and background

19

Section 1.4

Tuples,Sets,Vectors,Functions,Relations

Page 48: Mathematical Logic Lecture 1: Introduction and background

20

Tuples

A tuple is a finite ordered list of elements. e.g., (a1, . . . , an) is an n-tuple.

Typical usage,

I immutable

I Access entries by assigning distinct names or by ith-component

I used to represent objects that are built using a known small finitenumber of components. e.g., automata, etc.

I In particular, (a, b) denotes a pair, (a, b, c) denotes a triple

Page 49: Mathematical Logic Lecture 1: Introduction and background

20

Tuples

A tuple is a finite ordered list of elements. e.g., (a1, . . . , an) is an n-tuple.

Typical usage,

I immutable

I Access entries by assigning distinct names or by ith-component

I used to represent objects that are built using a known small finitenumber of components. e.g., automata, etc.

I In particular, (a, b) denotes a pair, (a, b, c) denotes a triple

Page 50: Mathematical Logic Lecture 1: Introduction and background

20

Tuples

A tuple is a finite ordered list of elements. e.g., (a1, . . . , an) is an n-tuple.

Typical usage,

I immutable

I Access entries by assigning distinct names or by ith-component

I used to represent objects that are built using a known small finitenumber of components. e.g., automata, etc.

I In particular, (a, b) denotes a pair, (a, b, c) denotes a triple

Page 51: Mathematical Logic Lecture 1: Introduction and background

21

Sets

I A set is a collection of things. e. g., S = {a, b, c}

I a ∈ S denotes a is an element of set S

I d /∈ S denotes d is not an element of set S

I ∅ denotes a set without any element (Note: ∅ 6= {∅})I {x |P(x)} denotes the set of elements that satisfy predicate P

I A ⊆ B denotes B contains all the elements of A.

I A ⊂ B denotes B ⊆ A and B 6= A.

I 2A := {B|B ⊆ A}I |A| denotes carnality (or size) of A.

Exercise 1.1

I {f (x)|P(x)} =

{y |there is x such that y = f (x) and P(x)}

I {x ∈ D|P(x)} =?

I {x}∪{f (x , y)|P(x , y)} =?

I {3|3 < 0} =?

Page 52: Mathematical Logic Lecture 1: Introduction and background

21

Sets

I A set is a collection of things. e. g., S = {a, b, c}I a ∈ S denotes a is an element of set S

I d /∈ S denotes d is not an element of set S

I ∅ denotes a set without any element (Note: ∅ 6= {∅})I {x |P(x)} denotes the set of elements that satisfy predicate P

I A ⊆ B denotes B contains all the elements of A.

I A ⊂ B denotes B ⊆ A and B 6= A.

I 2A := {B|B ⊆ A}I |A| denotes carnality (or size) of A.

Exercise 1.1

I {f (x)|P(x)} =

{y |there is x such that y = f (x) and P(x)}

I {x ∈ D|P(x)} =?

I {x}∪{f (x , y)|P(x , y)} =?

I {3|3 < 0} =?

Page 53: Mathematical Logic Lecture 1: Introduction and background

21

Sets

I A set is a collection of things. e. g., S = {a, b, c}I a ∈ S denotes a is an element of set S

I d /∈ S denotes d is not an element of set S

I ∅ denotes a set without any element (Note: ∅ 6= {∅})

I {x |P(x)} denotes the set of elements that satisfy predicate P

I A ⊆ B denotes B contains all the elements of A.

I A ⊂ B denotes B ⊆ A and B 6= A.

I 2A := {B|B ⊆ A}I |A| denotes carnality (or size) of A.

Exercise 1.1

I {f (x)|P(x)} =

{y |there is x such that y = f (x) and P(x)}

I {x ∈ D|P(x)} =?

I {x}∪{f (x , y)|P(x , y)} =?

I {3|3 < 0} =?

Page 54: Mathematical Logic Lecture 1: Introduction and background

21

Sets

I A set is a collection of things. e. g., S = {a, b, c}I a ∈ S denotes a is an element of set S

I d /∈ S denotes d is not an element of set S

I ∅ denotes a set without any element (Note: ∅ 6= {∅})I {x |P(x)} denotes the set of elements that satisfy predicate P

I A ⊆ B denotes B contains all the elements of A.

I A ⊂ B denotes B ⊆ A and B 6= A.

I 2A := {B|B ⊆ A}I |A| denotes carnality (or size) of A.

Exercise 1.1

I {f (x)|P(x)} =

{y |there is x such that y = f (x) and P(x)}

I {x ∈ D|P(x)} =?

I {x}∪{f (x , y)|P(x , y)} =?

I {3|3 < 0} =?

Page 55: Mathematical Logic Lecture 1: Introduction and background

21

Sets

I A set is a collection of things. e. g., S = {a, b, c}I a ∈ S denotes a is an element of set S

I d /∈ S denotes d is not an element of set S

I ∅ denotes a set without any element (Note: ∅ 6= {∅})I {x |P(x)} denotes the set of elements that satisfy predicate P

I A ⊆ B denotes B contains all the elements of A.

I A ⊂ B denotes B ⊆ A and B 6= A.

I 2A := {B|B ⊆ A}I |A| denotes carnality (or size) of A.

Exercise 1.1

I {f (x)|P(x)} =

{y |there is x such that y = f (x) and P(x)}

I {x ∈ D|P(x)} =?

I {x}∪{f (x , y)|P(x , y)} =?

I {3|3 < 0} =?

Page 56: Mathematical Logic Lecture 1: Introduction and background

21

Sets

I A set is a collection of things. e. g., S = {a, b, c}I a ∈ S denotes a is an element of set S

I d /∈ S denotes d is not an element of set S

I ∅ denotes a set without any element (Note: ∅ 6= {∅})I {x |P(x)} denotes the set of elements that satisfy predicate P

I A ⊆ B denotes B contains all the elements of A.

I A ⊂ B denotes B ⊆ A and B 6= A.

I 2A := {B|B ⊆ A}I |A| denotes carnality (or size) of A.

Exercise 1.1

I {f (x)|P(x)} =

{y |there is x such that y = f (x) and P(x)}

I {x ∈ D|P(x)} =?

I {x}∪{f (x , y)|P(x , y)} =?

I {3|3 < 0} =?

Page 57: Mathematical Logic Lecture 1: Introduction and background

21

Sets

I A set is a collection of things. e. g., S = {a, b, c}I a ∈ S denotes a is an element of set S

I d /∈ S denotes d is not an element of set S

I ∅ denotes a set without any element (Note: ∅ 6= {∅})I {x |P(x)} denotes the set of elements that satisfy predicate P

I A ⊆ B denotes B contains all the elements of A.

I A ⊂ B denotes B ⊆ A and B 6= A.

I 2A := {B|B ⊆ A}I |A| denotes carnality (or size) of A.

Exercise 1.1

I {f (x)|P(x)} =

{y |there is x such that y = f (x) and P(x)}

I {x ∈ D|P(x)} =?

I {x}∪{f (x , y)|P(x , y)} =?

I {3|3 < 0} =?

Page 58: Mathematical Logic Lecture 1: Introduction and background

21

Sets

I A set is a collection of things. e. g., S = {a, b, c}I a ∈ S denotes a is an element of set S

I d /∈ S denotes d is not an element of set S

I ∅ denotes a set without any element (Note: ∅ 6= {∅})I {x |P(x)} denotes the set of elements that satisfy predicate P

I A ⊆ B denotes B contains all the elements of A.

I A ⊂ B denotes B ⊆ A and B 6= A.

I 2A := {B|B ⊆ A}I |A| denotes carnality (or size) of A.

Exercise 1.1

I {f (x)|P(x)} = {y |there is x such that y = f (x) and P(x)}I {x ∈ D|P(x)} =?

I {x}∪{f (x , y)|P(x , y)} =?

I {3|3 < 0} =?

Page 59: Mathematical Logic Lecture 1: Introduction and background

22

Set operations

I A∪B := {x |x ∈ A or x ∈ B}I A∩B := {x |x ∈ A and x ∈ B}I A \ B := {x |x ∈ A and x /∈ B}

I ∪ and ∩ are reflexive, symmetric, and transitive

I A∪∅ = A, A∩∅ = ∅, A∪A = A, and A∩A = A

I (A∩B)∪C = (A∪C )∩(B∪C ), and (A∪B)∩C = (A∩C )∪(B∩C )

I For some set U (known as universal set), A := U \ A

I (A∪B) = (A∪B) and (A∩B) = (A∩B)

I A∪A = U and A∩A = ∅I For n > 1, and sets A1,. . . , An,

A1 × · · · × An := {(a1, . . . , an)|for each i ∈ 1..n, ai ∈ Ai}

Page 60: Mathematical Logic Lecture 1: Introduction and background

22

Set operations

I A∪B := {x |x ∈ A or x ∈ B}I A∩B := {x |x ∈ A and x ∈ B}I A \ B := {x |x ∈ A and x /∈ B}I ∪ and ∩ are reflexive, symmetric, and transitive

I A∪∅ = A, A∩∅ = ∅, A∪A = A, and A∩A = A

I (A∩B)∪C = (A∪C )∩(B∪C ), and (A∪B)∩C = (A∩C )∪(B∩C )

I For some set U (known as universal set), A := U \ A

I (A∪B) = (A∪B) and (A∩B) = (A∩B)

I A∪A = U and A∩A = ∅I For n > 1, and sets A1,. . . , An,

A1 × · · · × An := {(a1, . . . , an)|for each i ∈ 1..n, ai ∈ Ai}

Page 61: Mathematical Logic Lecture 1: Introduction and background

22

Set operations

I A∪B := {x |x ∈ A or x ∈ B}I A∩B := {x |x ∈ A and x ∈ B}I A \ B := {x |x ∈ A and x /∈ B}I ∪ and ∩ are reflexive, symmetric, and transitive

I A∪∅ = A, A∩∅ = ∅, A∪A = A, and A∩A = A

I (A∩B)∪C = (A∪C )∩(B∪C ), and (A∪B)∩C = (A∩C )∪(B∩C )

I For some set U (known as universal set), A := U \ A

I (A∪B) = (A∪B) and (A∩B) = (A∩B)

I A∪A = U and A∩A = ∅I For n > 1, and sets A1,. . . , An,

A1 × · · · × An := {(a1, . . . , an)|for each i ∈ 1..n, ai ∈ Ai}

Page 62: Mathematical Logic Lecture 1: Introduction and background

22

Set operations

I A∪B := {x |x ∈ A or x ∈ B}I A∩B := {x |x ∈ A and x ∈ B}I A \ B := {x |x ∈ A and x /∈ B}I ∪ and ∩ are reflexive, symmetric, and transitive

I A∪∅ = A, A∩∅ = ∅, A∪A = A, and A∩A = A

I (A∩B)∪C = (A∪C )∩(B∪C ), and (A∪B)∩C = (A∩C )∪(B∩C )

I For some set U (known as universal set), A := U \ A

I (A∪B) = (A∪B) and (A∩B) = (A∩B)

I A∪A = U and A∩A = ∅

I For n > 1, and sets A1,. . . , An,

A1 × · · · × An := {(a1, . . . , an)|for each i ∈ 1..n, ai ∈ Ai}

Page 63: Mathematical Logic Lecture 1: Introduction and background

22

Set operations

I A∪B := {x |x ∈ A or x ∈ B}I A∩B := {x |x ∈ A and x ∈ B}I A \ B := {x |x ∈ A and x /∈ B}I ∪ and ∩ are reflexive, symmetric, and transitive

I A∪∅ = A, A∩∅ = ∅, A∪A = A, and A∩A = A

I (A∩B)∪C = (A∪C )∩(B∪C ), and (A∪B)∩C = (A∩C )∪(B∩C )

I For some set U (known as universal set), A := U \ A

I (A∪B) = (A∪B) and (A∩B) = (A∩B)

I A∪A = U and A∩A = ∅I For n > 1, and sets A1,. . . , An,

A1 × · · · × An := {(a1, . . . , an)|for each i ∈ 1..n, ai ∈ Ai}

Page 64: Mathematical Logic Lecture 1: Introduction and background

23

More set notations

I Let S be a set of sets,⋃S := {x | there is A s.t. x ∈ A and A ∈ S}∗

I Let S be a function from N to sets,⋃i∈J

S(i) :=⋃{S(i)|i ∈ J}

I Analogous notations for⋂

∗s.t. stands for “such that”

Page 65: Mathematical Logic Lecture 1: Introduction and background

23

More set notations

I Let S be a set of sets,⋃S := {x | there is A s.t. x ∈ A and A ∈ S}∗

I Let S be a function from N to sets,⋃i∈J

S(i) :=⋃{S(i)|i ∈ J}

I Analogous notations for⋂

∗s.t. stands for “such that”

Page 66: Mathematical Logic Lecture 1: Introduction and background

23

More set notations

I Let S be a set of sets,⋃S := {x | there is A s.t. x ∈ A and A ∈ S}∗

I Let S be a function from N to sets,⋃i∈J

S(i) :=⋃{S(i)|i ∈ J}

I Analogous notations for⋂

∗s.t. stands for “such that”

Page 67: Mathematical Logic Lecture 1: Introduction and background

24

Relations

I A relation R between A and B is R ⊆ A× B

I ∆A := {(x , x)|x ∈ A} and R−1 = {(y , x)|(x , y) ∈ R}I R◦S := {(x , z)| there is y s.t. (x , y) ∈ R and (y , z) ∈ S}I dom(R) := {x |(x , y) ∈ R} and range(R) := {y |(x , y) ∈ R}I (A,R) often viewed as a directed graph

Page 68: Mathematical Logic Lecture 1: Introduction and background

24

Relations

I A relation R between A and B is R ⊆ A× B

I ∆A := {(x , x)|x ∈ A} and R−1 = {(y , x)|(x , y) ∈ R}

I R◦S := {(x , z)| there is y s.t. (x , y) ∈ R and (y , z) ∈ S}I dom(R) := {x |(x , y) ∈ R} and range(R) := {y |(x , y) ∈ R}I (A,R) often viewed as a directed graph

Page 69: Mathematical Logic Lecture 1: Introduction and background

24

Relations

I A relation R between A and B is R ⊆ A× B

I ∆A := {(x , x)|x ∈ A} and R−1 = {(y , x)|(x , y) ∈ R}I R◦S := {(x , z)| there is y s.t. (x , y) ∈ R and (y , z) ∈ S}

I dom(R) := {x |(x , y) ∈ R} and range(R) := {y |(x , y) ∈ R}I (A,R) often viewed as a directed graph

Page 70: Mathematical Logic Lecture 1: Introduction and background

24

Relations

I A relation R between A and B is R ⊆ A× B

I ∆A := {(x , x)|x ∈ A} and R−1 = {(y , x)|(x , y) ∈ R}I R◦S := {(x , z)| there is y s.t. (x , y) ∈ R and (y , z) ∈ S}I dom(R) := {x |(x , y) ∈ R} and range(R) := {y |(x , y) ∈ R}I (A,R) often viewed as a directed graph

Page 71: Mathematical Logic Lecture 1: Introduction and background

25

Transtive closure

Let R ⊆ A× A

I R0 := ∆A and Rn+1 := R◦Rn

I Transitive closure R∗ :=⋃

n≥0Rn

I Lemma: R∗ is the least relation S that satisfies

∆A∪(R◦S) ⊆ S

I In other words, R∗ is least fixed point(lfp) of f (S) := ∆A∪(R◦S)

I Let R+ :=⋃

n>0Rn

Exercise 1.2R+ is lfp of ? Is the lfp unique ?

Page 72: Mathematical Logic Lecture 1: Introduction and background

25

Transtive closure

Let R ⊆ A× A

I R0 := ∆A and Rn+1 := R◦Rn

I Transitive closure R∗ :=⋃

n≥0Rn

I Lemma: R∗ is the least relation S that satisfies

∆A∪(R◦S) ⊆ S

I In other words, R∗ is least fixed point(lfp) of f (S) := ∆A∪(R◦S)

I Let R+ :=⋃

n>0Rn

Exercise 1.2R+ is lfp of ? Is the lfp unique ?

Page 73: Mathematical Logic Lecture 1: Introduction and background

25

Transtive closure

Let R ⊆ A× A

I R0 := ∆A and Rn+1 := R◦Rn

I Transitive closure R∗ :=⋃

n≥0Rn

I Lemma: R∗ is the least relation S that satisfies

∆A∪(R◦S) ⊆ S

I In other words, R∗ is least fixed point(lfp) of f (S) := ∆A∪(R◦S)

I Let R+ :=⋃

n>0Rn

Exercise 1.2R+ is lfp of ? Is the lfp unique ?

Page 74: Mathematical Logic Lecture 1: Introduction and background

25

Transtive closure

Let R ⊆ A× A

I R0 := ∆A and Rn+1 := R◦Rn

I Transitive closure R∗ :=⋃

n≥0Rn

I Lemma: R∗ is the least relation S that satisfies

∆A∪(R◦S) ⊆ S

I In other words, R∗ is least fixed point(lfp) of f (S) := ∆A∪(R◦S)

I Let R+ :=⋃

n>0Rn

Exercise 1.2R+ is lfp of ? Is the lfp unique ?

Page 75: Mathematical Logic Lecture 1: Introduction and background

25

Transtive closure

Let R ⊆ A× A

I R0 := ∆A and Rn+1 := R◦Rn

I Transitive closure R∗ :=⋃

n≥0Rn

I Lemma: R∗ is the least relation S that satisfies

∆A∪(R◦S) ⊆ S

I In other words, R∗ is least fixed point(lfp) of f (S) := ∆A∪(R◦S)

I Let R+ :=⋃

n>0Rn

Exercise 1.2R+ is lfp of ? Is the lfp unique ?

Page 76: Mathematical Logic Lecture 1: Introduction and background

25

Transtive closure

Let R ⊆ A× A

I R0 := ∆A and Rn+1 := R◦Rn

I Transitive closure R∗ :=⋃

n≥0Rn

I Lemma: R∗ is the least relation S that satisfies

∆A∪(R◦S) ⊆ S

I In other words, R∗ is least fixed point(lfp) of f (S) := ∆A∪(R◦S)

I Let R+ :=⋃

n>0Rn

Exercise 1.2R+ is lfp of ? Is the lfp unique ?

Page 77: Mathematical Logic Lecture 1: Introduction and background

26

Some equivalences

I (R1◦R2)◦R3 = R1◦(R2◦R3)

I (R1◦R2)−1 = R−12 ◦R−11

I (R1∪R2)◦R3 = (R1◦R2)∪(R2◦R3)

I R∗−1 = R−1∗

Page 78: Mathematical Logic Lecture 1: Introduction and background

27

Equivalence Relation

E ⊆ A× A is an equivalence relation if

I reflexive: ∆A ⊆ E

I symmetric: E = E−1

I transitive: E◦E ⊆ E

E defines a collection of sets that are partitions of A

A/E = {{y |(x , y) ∈ E}|x ∈ A}

Page 79: Mathematical Logic Lecture 1: Introduction and background

28

Functions

f ⊆ A× B is a function if

I dom(f ) = A

I For each x , y , and z , if (x , y) ∈ f and (x , z) ∈ f then y = z

Let A→ B denote set of all functions from A to B,and f : A→ B denote that f is in A→ B.

Function update: f [x 7→ y ] creates a new function such that

f [x 7→ y ](z) :=

{y if z = x

f (z) if otherwise.

For set A′ ⊆ A, let f |A′ denote a function in A′ → B and for each x ∈ A′,f |A′(x) = f (x) one-to-one: for each x and y in A, if x 6= y then f (x) 6= f (y)onto : for each x ∈ A there is a y ∈ B such that x = f (y)

Page 80: Mathematical Logic Lecture 1: Introduction and background

28

Functions

f ⊆ A× B is a function if

I dom(f ) = A

I For each x , y , and z , if (x , y) ∈ f and (x , z) ∈ f then y = z

Let A→ B denote set of all functions from A to B,and f : A→ B denote that f is in A→ B.

Function update: f [x 7→ y ] creates a new function such that

f [x 7→ y ](z) :=

{y if z = x

f (z) if otherwise.

For set A′ ⊆ A, let f |A′ denote a function in A′ → B and for each x ∈ A′,f |A′(x) = f (x) one-to-one: for each x and y in A, if x 6= y then f (x) 6= f (y)onto : for each x ∈ A there is a y ∈ B such that x = f (y)

Page 81: Mathematical Logic Lecture 1: Introduction and background

28

Functions

f ⊆ A× B is a function if

I dom(f ) = A

I For each x , y , and z , if (x , y) ∈ f and (x , z) ∈ f then y = z

Let A→ B denote set of all functions from A to B,and f : A→ B denote that f is in A→ B.

Function update: f [x 7→ y ] creates a new function such that

f [x 7→ y ](z) :=

{y if z = x

f (z) if otherwise.

For set A′ ⊆ A, let f |A′ denote a function in A′ → B and for each x ∈ A′,f |A′(x) = f (x)

one-to-one: for each x and y in A, if x 6= y then f (x) 6= f (y)onto : for each x ∈ A there is a y ∈ B such that x = f (y)

Page 82: Mathematical Logic Lecture 1: Introduction and background

28

Functions

f ⊆ A× B is a function if

I dom(f ) = A

I For each x , y , and z , if (x , y) ∈ f and (x , z) ∈ f then y = z

Let A→ B denote set of all functions from A to B,and f : A→ B denote that f is in A→ B.

Function update: f [x 7→ y ] creates a new function such that

f [x 7→ y ](z) :=

{y if z = x

f (z) if otherwise.

For set A′ ⊆ A, let f |A′ denote a function in A′ → B and for each x ∈ A′,f |A′(x) = f (x) one-to-one: for each x and y in A, if x 6= y then f (x) 6= f (y)onto : for each x ∈ A there is a y ∈ B such that x = f (y)

Page 83: Mathematical Logic Lecture 1: Introduction and background

29

Partial function

f ⊆ A× B is a function if

I dom(f ) = A

I For each x , y , and z , if (x , y) ∈ f and (x , z) ∈ f then y = z

Let A ↪→ B denote set of all partial functions from A to B,and f : A ↪→ B denote that f is in A ↪→ B.

Page 84: Mathematical Logic Lecture 1: Introduction and background

30

Relation as functions

Let R ⊆ A× B, we can view R as a function of type A→ 2B .

R(a) ::= {b|(a, b) ∈ R}

We can also view R as a function of type 2A → 2B .

R(S) :=⋃{R(a)|a ∈ S}

We will use the above notations interchangeably.

Page 85: Mathematical Logic Lecture 1: Introduction and background

31

Strings or Sequences

Let Σ be a set of symbols.

For si ∈ Σ, s1 . . . sn be a finite string/word/sequence of symbols from Σ

Let Σ∗ be the set of finite strings from Σ

Let ε denote the empty string

For v ∈ Σ∗ and w ∈ Σ∗, let vw denote the concatenation of v and w

We say u is a prefix of w if uv = w for some v .

We say u is a proper prefix of w if uv = w for some non-empty v .

Page 86: Mathematical Logic Lecture 1: Introduction and background

31

Strings or Sequences

Let Σ be a set of symbols.

For si ∈ Σ, s1 . . . sn be a finite string/word/sequence of symbols from Σ

Let Σ∗ be the set of finite strings from Σ

Let ε denote the empty string

For v ∈ Σ∗ and w ∈ Σ∗, let vw denote the concatenation of v and w

We say u is a prefix of w if uv = w for some v .

We say u is a proper prefix of w if uv = w for some non-empty v .

Page 87: Mathematical Logic Lecture 1: Introduction and background

31

Strings or Sequences

Let Σ be a set of symbols.

For si ∈ Σ, s1 . . . sn be a finite string/word/sequence of symbols from Σ

Let Σ∗ be the set of finite strings from Σ

Let ε denote the empty string

For v ∈ Σ∗ and w ∈ Σ∗, let vw denote the concatenation of v and w

We say u is a prefix of w if uv = w for some v .

We say u is a proper prefix of w if uv = w for some non-empty v .

Page 88: Mathematical Logic Lecture 1: Introduction and background

31

Strings or Sequences

Let Σ be a set of symbols.

For si ∈ Σ, s1 . . . sn be a finite string/word/sequence of symbols from Σ

Let Σ∗ be the set of finite strings from Σ

Let ε denote the empty string

For v ∈ Σ∗ and w ∈ Σ∗, let vw denote the concatenation of v and w

We say u is a prefix of w if uv = w for some v .

We say u is a proper prefix of w if uv = w for some non-empty v .

Page 89: Mathematical Logic Lecture 1: Introduction and background

31

Strings or Sequences

Let Σ be a set of symbols.

For si ∈ Σ, s1 . . . sn be a finite string/word/sequence of symbols from Σ

Let Σ∗ be the set of finite strings from Σ

Let ε denote the empty string

For v ∈ Σ∗ and w ∈ Σ∗, let vw denote the concatenation of v and w

We say u is a prefix of w if uv = w for some v .

We say u is a proper prefix of w if uv = w for some non-empty v .

Page 90: Mathematical Logic Lecture 1: Introduction and background

31

Strings or Sequences

Let Σ be a set of symbols.

For si ∈ Σ, s1 . . . sn be a finite string/word/sequence of symbols from Σ

Let Σ∗ be the set of finite strings from Σ

Let ε denote the empty string

For v ∈ Σ∗ and w ∈ Σ∗, let vw denote the concatenation of v and w

We say u is a prefix of w if uv = w for some v .

We say u is a proper prefix of w if uv = w for some non-empty v .

Page 91: Mathematical Logic Lecture 1: Introduction and background

32

Homomorphism

We call two sets isomorphic if we can demonstrate that there is atransformation from one to another preserving the key properties of interest.

For example, Consider two sets A and B. Let the properties of interest are

PA ⊆ A× · · · × A︸ ︷︷ ︸n

and PB ⊆ B × · · · × B︸ ︷︷ ︸n

.

Definition 1.1A function h : A→ B is a homomorphism w.r.t. properties PA and PB if

(a1, . . . , an) ∈ PA iff (h(a1), . . . , h(an)) ∈ PB

Page 92: Mathematical Logic Lecture 1: Introduction and background

32

Homomorphism

We call two sets isomorphic if we can demonstrate that there is atransformation from one to another preserving the key properties of interest.

For example, Consider two sets A and B. Let the properties of interest are

PA ⊆ A× · · · × A︸ ︷︷ ︸n

and PB ⊆ B × · · · × B︸ ︷︷ ︸n

.

Definition 1.1A function h : A→ B is a homomorphism w.r.t. properties PA and PB if

(a1, . . . , an) ∈ PA iff (h(a1), . . . , h(an)) ∈ PB

Page 93: Mathematical Logic Lecture 1: Introduction and background

32

Homomorphism

We call two sets isomorphic if we can demonstrate that there is atransformation from one to another preserving the key properties of interest.

For example, Consider two sets A and B. Let the properties of interest are

PA ⊆ A× · · · × A︸ ︷︷ ︸n

and PB ⊆ B × · · · × B︸ ︷︷ ︸n

.

Definition 1.1A function h : A→ B is a homomorphism w.r.t. properties PA and PB if

(a1, . . . , an) ∈ PA iff (h(a1), . . . , h(an)) ∈ PB

Page 94: Mathematical Logic Lecture 1: Introduction and background

33

Isomorphism/isomorphic

Definition 1.2If h is one-to-one then it is called an isomorphism.If h is also onto then A and B are considered isomorphic.

Exercise 1.3Prove A→ (B → C ) is isomorphic to A× B → C .

Page 95: Mathematical Logic Lecture 1: Introduction and background

33

Isomorphism/isomorphic

Definition 1.2If h is one-to-one then it is called an isomorphism.If h is also onto then A and B are considered isomorphic.

Exercise 1.3Prove A→ (B → C ) is isomorphic to A× B → C .

Page 96: Mathematical Logic Lecture 1: Introduction and background

34

Section 1.5

Cardinality

Page 97: Mathematical Logic Lecture 1: Introduction and background

35

Comparing sizes of sets

Cordiality is a measure of the number of elements of the set, which isdenoted by |A| for set A. Non-trivial to understand if |A| is not finite.

Definition 1.3|A| ≤ |B| if there is a one-to-one f : A→ B

Theorem 1.2If f is also onto then |A| = |B|.

Exercise 1.4Prove theorem 1.2

Page 98: Mathematical Logic Lecture 1: Introduction and background

35

Comparing sizes of sets

Cordiality is a measure of the number of elements of the set, which isdenoted by |A| for set A. Non-trivial to understand if |A| is not finite.

Definition 1.3|A| ≤ |B| if there is a one-to-one f : A→ B

Theorem 1.2If f is also onto then |A| = |B|.

Exercise 1.4Prove theorem 1.2

Page 99: Mathematical Logic Lecture 1: Introduction and background

35

Comparing sizes of sets

Cordiality is a measure of the number of elements of the set, which isdenoted by |A| for set A. Non-trivial to understand if |A| is not finite.

Definition 1.3|A| ≤ |B| if there is a one-to-one f : A→ B

Theorem 1.2If f is also onto then |A| = |B|.

Exercise 1.4Prove theorem 1.2

Page 100: Mathematical Logic Lecture 1: Introduction and background

36

Countable/uncountable

Definition 1.4A is countable if |A| ≤ |N|

Definition 1.5A is uncountable if |A| > |N|

Page 101: Mathematical Logic Lecture 1: Introduction and background

36

Countable/uncountable

Definition 1.4A is countable if |A| ≤ |N|

Definition 1.5A is uncountable if |A| > |N|

Page 102: Mathematical Logic Lecture 1: Introduction and background

37

Countable finite words

Theorem 1.3If Σ is countable, then Σ∗ is countable

Proof.Since Σ is countable there exists one-to-one f : Σ→ N.We need to find a one-to-one h : Σ∗ → N.

Let pi be the ith prime. Our choice of h is

h(a1 . . . an) = Πi∈1..npf (ai )i .

Exercise 1.5Show h is one-to-one.

How to prove?Find a one-to-one map to N

Page 103: Mathematical Logic Lecture 1: Introduction and background

37

Countable finite words

Theorem 1.3If Σ is countable, then Σ∗ is countable

Proof.Since Σ is countable there exists one-to-one f : Σ→ N.We need to find a one-to-one h : Σ∗ → N.

Let pi be the ith prime. Our choice of h is

h(a1 . . . an) = Πi∈1..npf (ai )i .

Exercise 1.5Show h is one-to-one.

How to prove?Find a one-to-one map to N

Page 104: Mathematical Logic Lecture 1: Introduction and background

37

Countable finite words

Theorem 1.3If Σ is countable, then Σ∗ is countable

Proof.Since Σ is countable there exists one-to-one f : Σ→ N.We need to find a one-to-one h : Σ∗ → N.

Let pi be the ith prime. Our choice of h is

h(a1 . . . an) = Πi∈1..npf (ai )i .

Exercise 1.5Show h is one-to-one.

How to prove?Find a one-to-one map to N

Page 105: Mathematical Logic Lecture 1: Introduction and background

37

Countable finite words

Theorem 1.3If Σ is countable, then Σ∗ is countable

Proof.Since Σ is countable there exists one-to-one f : Σ→ N.We need to find a one-to-one h : Σ∗ → N.

Let pi be the ith prime. Our choice of h is

h(a1 . . . an) = Πi∈1..npf (ai )i .

Exercise 1.5Show h is one-to-one.

How to prove?Find a one-to-one map to N

Page 106: Mathematical Logic Lecture 1: Introduction and background

38

Cantor’s theorem

Theorem 1.4|A| < |2A|

Proof.Consider function h(a) = {a}. h is one-to-one function.There is a one-to-one function in A→ 2A, therefore |A| ≤ |2A|.

To show strictness, we need to show that there is no one-to-one and ontofunction in A→ 2A.

Let us suppose f : A→ 2A is one-to-one and onto.Consider, S = {a|a 6∈ f (a)}. Since f is onto, there is a b s.t. f (b) = S .Case b ∈ S : Therefore, b ∈ f (b). Due to def. S , b /∈ S . Contradiction.Case b /∈ S : Therefore, b /∈ f (b). Due to def. S , b ∈ S . Contradiction.

Page 107: Mathematical Logic Lecture 1: Introduction and background

38

Cantor’s theorem

Theorem 1.4|A| < |2A|

Proof.Consider function h(a) = {a}. h is one-to-one function.There is a one-to-one function in A→ 2A, therefore |A| ≤ |2A|.

To show strictness, we need to show that there is no one-to-one and ontofunction in A→ 2A.

Let us suppose f : A→ 2A is one-to-one and onto.Consider, S = {a|a 6∈ f (a)}. Since f is onto, there is a b s.t. f (b) = S .Case b ∈ S : Therefore, b ∈ f (b). Due to def. S , b /∈ S . Contradiction.Case b /∈ S : Therefore, b /∈ f (b). Due to def. S , b ∈ S . Contradiction.

Page 108: Mathematical Logic Lecture 1: Introduction and background

38

Cantor’s theorem

Theorem 1.4|A| < |2A|

Proof.Consider function h(a) = {a}. h is one-to-one function.There is a one-to-one function in A→ 2A, therefore |A| ≤ |2A|.

To show strictness, we need to show that there is no one-to-one and ontofunction in A→ 2A.

Let us suppose f : A→ 2A is one-to-one and onto.Consider, S = {a|a 6∈ f (a)}. Since f is onto, there is a b s.t. f (b) = S .Case b ∈ S : Therefore, b ∈ f (b). Due to def. S , b /∈ S . Contradiction.Case b /∈ S : Therefore, b /∈ f (b). Due to def. S , b ∈ S . Contradiction.

Page 109: Mathematical Logic Lecture 1: Introduction and background

38

Cantor’s theorem

Theorem 1.4|A| < |2A|

Proof.Consider function h(a) = {a}. h is one-to-one function.There is a one-to-one function in A→ 2A, therefore |A| ≤ |2A|.

To show strictness, we need to show that there is no one-to-one and ontofunction in A→ 2A.

Let us suppose f : A→ 2A is one-to-one and onto.

Consider, S = {a|a 6∈ f (a)}. Since f is onto, there is a b s.t. f (b) = S .Case b ∈ S : Therefore, b ∈ f (b). Due to def. S , b /∈ S . Contradiction.Case b /∈ S : Therefore, b /∈ f (b). Due to def. S , b ∈ S . Contradiction.

Page 110: Mathematical Logic Lecture 1: Introduction and background

38

Cantor’s theorem

Theorem 1.4|A| < |2A|

Proof.Consider function h(a) = {a}. h is one-to-one function.There is a one-to-one function in A→ 2A, therefore |A| ≤ |2A|.

To show strictness, we need to show that there is no one-to-one and ontofunction in A→ 2A.

Let us suppose f : A→ 2A is one-to-one and onto.Consider, S = {a|a 6∈ f (a)}. Since f is onto, there is a b s.t. f (b) = S .

Case b ∈ S : Therefore, b ∈ f (b). Due to def. S , b /∈ S . Contradiction.Case b /∈ S : Therefore, b /∈ f (b). Due to def. S , b ∈ S . Contradiction.

Page 111: Mathematical Logic Lecture 1: Introduction and background

38

Cantor’s theorem

Theorem 1.4|A| < |2A|

Proof.Consider function h(a) = {a}. h is one-to-one function.There is a one-to-one function in A→ 2A, therefore |A| ≤ |2A|.

To show strictness, we need to show that there is no one-to-one and ontofunction in A→ 2A.

Let us suppose f : A→ 2A is one-to-one and onto.Consider, S = {a|a 6∈ f (a)}. Since f is onto, there is a b s.t. f (b) = S .Case b ∈ S :

Therefore, b ∈ f (b). Due to def. S , b /∈ S . Contradiction.Case b /∈ S : Therefore, b /∈ f (b). Due to def. S , b ∈ S . Contradiction.

Page 112: Mathematical Logic Lecture 1: Introduction and background

38

Cantor’s theorem

Theorem 1.4|A| < |2A|

Proof.Consider function h(a) = {a}. h is one-to-one function.There is a one-to-one function in A→ 2A, therefore |A| ≤ |2A|.

To show strictness, we need to show that there is no one-to-one and ontofunction in A→ 2A.

Let us suppose f : A→ 2A is one-to-one and onto.Consider, S = {a|a 6∈ f (a)}. Since f is onto, there is a b s.t. f (b) = S .Case b ∈ S : Therefore, b ∈ f (b).

Due to def. S , b /∈ S . Contradiction.Case b /∈ S : Therefore, b /∈ f (b). Due to def. S , b ∈ S . Contradiction.

Page 113: Mathematical Logic Lecture 1: Introduction and background

38

Cantor’s theorem

Theorem 1.4|A| < |2A|

Proof.Consider function h(a) = {a}. h is one-to-one function.There is a one-to-one function in A→ 2A, therefore |A| ≤ |2A|.

To show strictness, we need to show that there is no one-to-one and ontofunction in A→ 2A.

Let us suppose f : A→ 2A is one-to-one and onto.Consider, S = {a|a 6∈ f (a)}. Since f is onto, there is a b s.t. f (b) = S .Case b ∈ S : Therefore, b ∈ f (b). Due to def. S , b /∈ S .

Contradiction.Case b /∈ S : Therefore, b /∈ f (b). Due to def. S , b ∈ S . Contradiction.

Page 114: Mathematical Logic Lecture 1: Introduction and background

38

Cantor’s theorem

Theorem 1.4|A| < |2A|

Proof.Consider function h(a) = {a}. h is one-to-one function.There is a one-to-one function in A→ 2A, therefore |A| ≤ |2A|.

To show strictness, we need to show that there is no one-to-one and ontofunction in A→ 2A.

Let us suppose f : A→ 2A is one-to-one and onto.Consider, S = {a|a 6∈ f (a)}. Since f is onto, there is a b s.t. f (b) = S .Case b ∈ S : Therefore, b ∈ f (b). Due to def. S , b /∈ S . Contradiction.

Case b /∈ S : Therefore, b /∈ f (b). Due to def. S , b ∈ S . Contradiction.

Page 115: Mathematical Logic Lecture 1: Introduction and background

38

Cantor’s theorem

Theorem 1.4|A| < |2A|

Proof.Consider function h(a) = {a}. h is one-to-one function.There is a one-to-one function in A→ 2A, therefore |A| ≤ |2A|.

To show strictness, we need to show that there is no one-to-one and ontofunction in A→ 2A.

Let us suppose f : A→ 2A is one-to-one and onto.Consider, S = {a|a 6∈ f (a)}. Since f is onto, there is a b s.t. f (b) = S .Case b ∈ S : Therefore, b ∈ f (b). Due to def. S , b /∈ S . Contradiction.Case b /∈ S : Therefore, b /∈ f (b). Due to def. S , b ∈ S . Contradiction.

Page 116: Mathematical Logic Lecture 1: Introduction and background

End of Lecture 1

39