![Page 1: EECS 20 Lecture 3 (January 22, 2001) Tom Henzinger Sets, Tuples, Functions](https://reader036.vdocuments.mx/reader036/viewer/2022062714/56649d545503460f94a30d28/html5/thumbnails/1.jpg)
EECS 20
Lecture 3 (January 22, 2001)
Tom Henzinger
Sets, Tuples, Functions
![Page 2: EECS 20 Lecture 3 (January 22, 2001) Tom Henzinger Sets, Tuples, Functions](https://reader036.vdocuments.mx/reader036/viewer/2022062714/56649d545503460f94a30d28/html5/thumbnails/2.jpg)
1 Sets (unordered collections)
2 Tuples (ordered collections)
3 Functions
Important Mathematical Objects
![Page 3: EECS 20 Lecture 3 (January 22, 2001) Tom Henzinger Sets, Tuples, Functions](https://reader036.vdocuments.mx/reader036/viewer/2022062714/56649d545503460f94a30d28/html5/thumbnails/3.jpg)
SETS
![Page 4: EECS 20 Lecture 3 (January 22, 2001) Tom Henzinger Sets, Tuples, Functions](https://reader036.vdocuments.mx/reader036/viewer/2022062714/56649d545503460f94a30d28/html5/thumbnails/4.jpg)
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.
![Page 5: EECS 20 Lecture 3 (January 22, 2001) Tom Henzinger Sets, Tuples, Functions](https://reader036.vdocuments.mx/reader036/viewer/2022062714/56649d545503460f94a30d28/html5/thumbnails/5.jpg)
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.
Constants Variables Operators Quantifiers Definition
![Page 6: EECS 20 Lecture 3 (January 22, 2001) Tom Henzinger Sets, Tuples, Functions](https://reader036.vdocuments.mx/reader036/viewer/2022062714/56649d545503460f94a30d28/html5/thumbnails/6.jpg)
SETS
Set constants : e.g. {1, 2, 3}
Set operator :
Set quantifier : { x | … }
Additional constants can be defined: e.g. Nats
![Page 7: EECS 20 Lecture 3 (January 22, 2001) Tom Henzinger Sets, Tuples, Functions](https://reader036.vdocuments.mx/reader036/viewer/2022062714/56649d545503460f94a30d28/html5/thumbnails/7.jpg)
Additional operators on sets
set set Result: set
set set set
set \ set set
set set truth value
set = set truth value
P ( set ) set
![Page 8: EECS 20 Lecture 3 (January 22, 2001) Tom Henzinger Sets, Tuples, Functions](https://reader036.vdocuments.mx/reader036/viewer/2022062714/56649d545503460f94a30d28/html5/thumbnails/8.jpg)
Meaning of additional operators can be defined
set x, set y, let x y = { z | z X z Y } .
set x, set y, let x y = { z | z x z y } .
set x, set y, let x \ y = { z | z x z y } .
set x, set y, let x y ( z | z x z y ) .
set x, set y, let x = y x y y x .
set x, let P ( x ) = { y | y x } .
![Page 9: EECS 20 Lecture 3 (January 22, 2001) Tom Henzinger Sets, Tuples, Functions](https://reader036.vdocuments.mx/reader036/viewer/2022062714/56649d545503460f94a30d28/html5/thumbnails/9.jpg)
TUPLES
![Page 10: EECS 20 Lecture 3 (January 22, 2001) Tom Henzinger Sets, Tuples, Functions](https://reader036.vdocuments.mx/reader036/viewer/2022062714/56649d545503460f94a30d28/html5/thumbnails/10.jpg)
Tuple constants
( 2, 7 ) 2-tuple (or “pair”)
( 2, 7, 1 ) 3-tuple (or “triple”)
( b, e, r, k, e, l, e, y ) 8-tupleNote: { 2, 7 } = { 7, 2 }
( 2, 7 ) ( 7, 2 )
![Page 11: EECS 20 Lecture 3 (January 22, 2001) Tom Henzinger Sets, Tuples, Functions](https://reader036.vdocuments.mx/reader036/viewer/2022062714/56649d545503460f94a30d28/html5/thumbnails/11.jpg)
Tuple operators
( anything , anything ) Result: pair
( any , any , any ) triple
tuple number any
Examples: ( 2, 7 , 1 ) 2 = 7
pair x, x = ( x1 , x2 )
![Page 12: EECS 20 Lecture 3 (January 22, 2001) Tom Henzinger Sets, Tuples, Functions](https://reader036.vdocuments.mx/reader036/viewer/2022062714/56649d545503460f94a30d28/html5/thumbnails/12.jpg)
Additional operators on tuples
pair = pair Result: truth value
triple = triple truth value
pair x, pair y, let x = y x1 = y1 x2 = y2 .
triple x, triple y, let x = y x1 = y1
x2 = y2 x3 = y3 .
![Page 13: EECS 20 Lecture 3 (January 22, 2001) Tom Henzinger Sets, Tuples, Functions](https://reader036.vdocuments.mx/reader036/viewer/2022062714/56649d545503460f94a30d28/html5/thumbnails/13.jpg)
Additional operators on sets
set set Result: set of pairs
set set set set of triples
set x, y, let x y = { u | v, w, u = (v,w) v x w y }
= { (v,w) | v x w y } .
set x, y, z, let x y z = { (u,v,w) | u x v y
w z } .
![Page 14: EECS 20 Lecture 3 (January 22, 2001) Tom Henzinger Sets, Tuples, Functions](https://reader036.vdocuments.mx/reader036/viewer/2022062714/56649d545503460f94a30d28/html5/thumbnails/14.jpg)
FUNCTIONS
![Page 15: EECS 20 Lecture 3 (January 22, 2001) Tom Henzinger Sets, Tuples, Functions](https://reader036.vdocuments.mx/reader036/viewer/2022062714/56649d545503460f94a30d28/html5/thumbnails/15.jpg)
Each function has three things:
1 the domain ( a set )
2 the range ( a set )
3 the graph ( for every domain element, a range element )
![Page 16: EECS 20 Lecture 3 (January 22, 2001) Tom Henzinger Sets, Tuples, Functions](https://reader036.vdocuments.mx/reader036/viewer/2022062714/56649d545503460f94a30d28/html5/thumbnails/16.jpg)
Function constants
sin, cos
1 Domain : Reals .
2 Range : [-1,1] = { x Reals | -1 x 1 } .
3 Graph : for each real x, the real sin (x) [-1,1] .
![Page 17: EECS 20 Lecture 3 (January 22, 2001) Tom Henzinger Sets, Tuples, Functions](https://reader036.vdocuments.mx/reader036/viewer/2022062714/56649d545503460f94a30d28/html5/thumbnails/17.jpg)
Formally, the graph of a function can be thought of as a set of pairs :
{ (x,y) ( Reals [-1,1] ) | y = sin ( x ) }
= { … , (0,0) , … , (/2, 1) , … , (,0), … , (3/2,-1), … } .
1
-1
0
![Page 18: EECS 20 Lecture 3 (January 22, 2001) Tom Henzinger Sets, Tuples, Functions](https://reader036.vdocuments.mx/reader036/viewer/2022062714/56649d545503460f94a30d28/html5/thumbnails/18.jpg)
All operators are really function constants
!
Domain : Nats .
Range: Nats .
Graph: { ( x , y ) Nats Nats | y = x! }
= { (1,1), (2,2), (3,6), (4, 24), … } .
![Page 19: EECS 20 Lecture 3 (January 22, 2001) Tom Henzinger Sets, Tuples, Functions](https://reader036.vdocuments.mx/reader036/viewer/2022062714/56649d545503460f94a30d28/html5/thumbnails/19.jpg)
+
Domain : Nats2 = Nats Nats .
Range: Nats .
Graph: { ( (x,y) , z ) Nats2 Nats | z = x + y }
= { ( (1,1), 2 ), ( (1,2), 3 ), … , ( (7,5), 12), … } .
All operators are really function constants
![Page 20: EECS 20 Lecture 3 (January 22, 2001) Tom Henzinger Sets, Tuples, Functions](https://reader036.vdocuments.mx/reader036/viewer/2022062714/56649d545503460f94a30d28/html5/thumbnails/20.jpg)
Domain : Bools2 .
Range: Bools .
Graph: { ( (true, true), true ), ( (true, false), false),
( (false, true), false), ( (false, false), false) } .
All operators are really function constants
![Page 21: EECS 20 Lecture 3 (January 22, 2001) Tom Henzinger Sets, Tuples, Functions](https://reader036.vdocuments.mx/reader036/viewer/2022062714/56649d545503460f94a30d28/html5/thumbnails/21.jpg)
If domain and range of a function are finite, then the graph can be given by a table :
true true true
true false false
false true false
false false false
x y f(x,y)
![Page 22: EECS 20 Lecture 3 (January 22, 2001) Tom Henzinger Sets, Tuples, Functions](https://reader036.vdocuments.mx/reader036/viewer/2022062714/56649d545503460f94a30d28/html5/thumbnails/22.jpg)
Operators on functions
domain ( function ) Result: set
range ( function ) set
graph ( function ) set of pairs
function ( domain element ) range element
Examples: domain ( sin ) = Reals
range ( sin ) = [-1,1]
sin ( ) = 0
![Page 23: EECS 20 Lecture 3 (January 22, 2001) Tom Henzinger Sets, Tuples, Functions](https://reader036.vdocuments.mx/reader036/viewer/2022062714/56649d545503460f94a30d28/html5/thumbnails/23.jpg)
Function definition
Let f : Domain Range such that
x Domain, f ( x ) = …
![Page 24: EECS 20 Lecture 3 (January 22, 2001) Tom Henzinger Sets, Tuples, Functions](https://reader036.vdocuments.mx/reader036/viewer/2022062714/56649d545503460f94a30d28/html5/thumbnails/24.jpg)
Let double : Nats Nats such that
x Nats, double ( x ) = 2· x .
domain ( double ) = Nats
range ( double ) = Nats
graph ( double ) = { (1,2), (2,4), (3,6), (4,8), … }
![Page 25: EECS 20 Lecture 3 (January 22, 2001) Tom Henzinger Sets, Tuples, Functions](https://reader036.vdocuments.mx/reader036/viewer/2022062714/56649d545503460f94a30d28/html5/thumbnails/25.jpg)
Let exp : Nats2 Nats such that
x , y Nats, exp ( x , y ) = x y .
domain ( exp ) = Nats2
range ( exp ) = Nats
graph ( exp ) = { ( (1,1) , 1 ), … , ( (2,3) , 8 ), … }
![Page 26: EECS 20 Lecture 3 (January 22, 2001) Tom Henzinger Sets, Tuples, Functions](https://reader036.vdocuments.mx/reader036/viewer/2022062714/56649d545503460f94a30d28/html5/thumbnails/26.jpg)
Additional operators on functions
[ set set ] Result: set of functions
function function function
one-to-one ( function ) truth value
onto ( function ) truth value
![Page 27: EECS 20 Lecture 3 (January 22, 2001) Tom Henzinger Sets, Tuples, Functions](https://reader036.vdocuments.mx/reader036/viewer/2022062714/56649d545503460f94a30d28/html5/thumbnails/27.jpg)
Meaning of additional operators
set x, y, let
[ x y ] = { f | domain ( f ) = x range ( f ) = y } .
set x, y, z, f [ x y ] , g [ y z ] , let
g f : x z such that
u x, ( g f ) ( u ) = g ( f ( u ) ) .
![Page 28: EECS 20 Lecture 3 (January 22, 2001) Tom Henzinger Sets, Tuples, Functions](https://reader036.vdocuments.mx/reader036/viewer/2022062714/56649d545503460f94a30d28/html5/thumbnails/28.jpg)
Meaning of additional operators
function f , let
one-to-one ( f )
x, y domain(f), if x y then f(x) f(y) .
function f , let
onto ( f )
x range(f), y domain(f), x = f(y) .