26
EECS 20 Lecture 2 (January 19, 2001) Tom Henzinger Mathematical Language

EECS 20 Lecture 2 (January 19, 2001) Tom Henzinger Mathematical Language

  • View
    221

  • Download
    1

Embed Size (px)

Citation preview

Page 1: EECS 20 Lecture 2 (January 19, 2001) Tom Henzinger Mathematical Language

EECS 20

Lecture 2 (January 19, 2001)

Tom Henzinger

Mathematical Language

Page 2: EECS 20 Lecture 2 (January 19, 2001) Tom Henzinger Mathematical Language

Mathematical Language

Let Evens = { x | ( y, y Nats x = 2· y ) } .

Page 3: EECS 20 Lecture 2 (January 19, 2001) Tom Henzinger Mathematical Language

Mathematical Language

Let Evens = { x | ( y, y Nats x = 2· y ) } .

Constants

Page 4: EECS 20 Lecture 2 (January 19, 2001) Tom Henzinger Mathematical Language

Mathematical Language

Let Evens = { x | ( y, y Nats x = 2· y ) } .

Constants

Variables

Page 5: EECS 20 Lecture 2 (January 19, 2001) Tom Henzinger Mathematical Language

Mathematical Language

Let Evens = { x | ( y, y Nats x = 2· y ) } .

Constants

Variables

Operators

Page 6: EECS 20 Lecture 2 (January 19, 2001) Tom Henzinger Mathematical Language

Mathematical Language

Let Evens = { x | ( y, y Nats x = 2· y ) } .

Constants

Variables

Operators

Quantifiers

Page 7: EECS 20 Lecture 2 (January 19, 2001) Tom Henzinger Mathematical Language

Mathematical Language

Let Evens = { x | ( y, y Nats x = 2· y ) } .

Constants

Variables

Operators

Quantifiers

Definition

Page 8: EECS 20 Lecture 2 (January 19, 2001) Tom Henzinger Mathematical Language

Mathematical Language

Let Evens = { x | ( y, y Nats x = 2· y ) } .

Constants

Variables

Operators

Quantifiers

Definition

Page 9: EECS 20 Lecture 2 (January 19, 2001) Tom Henzinger Mathematical Language

Constants have meaning

20 a certain number

Berkeley a certain city

false a certain truth value

Page 10: EECS 20 Lecture 2 (January 19, 2001) Tom Henzinger Mathematical Language

Variables have no meaning

x

y0

z’

Page 11: EECS 20 Lecture 2 (January 19, 2001) Tom Henzinger Mathematical Language

Operators on numbers

number + number Result: number

number ! number

number = number truth value

number number truth value

Page 12: EECS 20 Lecture 2 (January 19, 2001) Tom Henzinger Mathematical Language

Operators on cities

merge ( city, city ) Result: city

population-of ( city ) number

has-a-university ( city ) truth value

Page 13: EECS 20 Lecture 2 (January 19, 2001) Tom Henzinger Mathematical Language

Operators on truth values

truth value truth value Result: truth value

truth value truth value truth value

¬ truth value truth value

truth value truth value truth value

truth value truth value truth value

Page 14: EECS 20 Lecture 2 (January 19, 2001) Tom Henzinger Mathematical Language

Expressions on constants have meaning

3 + 20 Result: 23

(3! + 2) · 4 32

4 population-of ( Berkeley ) true

4 · 20 4 + 20 false

true false false

true ( 4 + 20 ) not well-formed

Page 15: EECS 20 Lecture 2 (January 19, 2001) Tom Henzinger Mathematical Language

Implication

true true Result: true

true false false

false true true

false false true

Page 16: EECS 20 Lecture 2 (January 19, 2001) Tom Henzinger Mathematical Language

Expressions on variables have no meaning

x + 20

(3! + y) · 4

x y

Free variables: x

y

x, y

Page 17: EECS 20 Lecture 2 (January 19, 2001) Tom Henzinger Mathematical Language

Quantifiers remove free variables from expressions

x = 0

x, x = 0

x, x = 0

y, x + 1 = y

x, y, x + 1 = y

x, y, x y

x, x + 7

Result: free x

true

false

free x

true

true

not well-formed

Page 18: EECS 20 Lecture 2 (January 19, 2001) Tom Henzinger Mathematical Language

Every mathematical expression

1. is not well-formed (“type mismatch”), or

2. contains free variables, or

3. is a definition, or

4. has a meaning (e.g., 20, Berkeley, false).

Page 19: EECS 20 Lecture 2 (January 19, 2001) Tom Henzinger Mathematical Language

SETS

Page 20: EECS 20 Lecture 2 (January 19, 2001) Tom Henzinger Mathematical Language

Set constants

{ 1, 2, 3 }

{ Atlanta, Berkeley, Chicago, Detroit }

{ 1, 2, 3, 4, … }

Page 21: EECS 20 Lecture 2 (January 19, 2001) Tom Henzinger Mathematical Language

Set operator

anything set Result: truth value

2 { 1, 2, 3 } true

2 { Atlanta, Berkeley } false

Page 22: EECS 20 Lecture 2 (January 19, 2001) Tom Henzinger Mathematical Language

Set quantifier

( x, truth value ) Result: truth value

( x, truth value ) truth value

{ x | truth value } set

Page 23: EECS 20 Lecture 2 (January 19, 2001) Tom Henzinger Mathematical Language

Quantifiers remove free variables from expressions

{ x | x y }

{ x | x = 1 x = 2 }

{ x | y, x = 2· y }

{ x | x + 7 }

Result: free y

{ 1, 2 }

{ 2, 4, 6, 8, … }

not well-formed

Page 24: EECS 20 Lecture 2 (January 19, 2001) Tom Henzinger Mathematical Language

Bounded quantification

( x set, truth value ) Result: truth value

( x set, truth value ) truth value

{ x set | truth value } set

Page 25: EECS 20 Lecture 2 (January 19, 2001) Tom Henzinger Mathematical Language

Meaning of constants can be defined

Let Nats = { 1, 2, 3, 4, … } .

Let Bools = { true, false } .

Define Cities = { Atlanta, Chicago, Berkeley, Detroit } .

Define Ø = { } .

Page 26: EECS 20 Lecture 2 (January 19, 2001) Tom Henzinger Mathematical Language

Let Evens = { x Nats | y Nats, x = 2· y } .

Let Evens be the set of all x Nats such that

x = 2· y for some y Nats.