





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






A binary relation between A and B is a subset of A × B. A is called the domain ; B is called the codomain.
Equivalently, a binary relation is a predicate with two free variables.
IsTaking (x, y) Ancestor (a, b) a ≤ b a = b^3 x = y k divides n x^2 + y is a multiple of 17 A ⊂ B |A| < |B| A ∩ B = ∅ x ∈ A p → q p ∧ q W ≡ X p = IsAlive (x) ( BeatsAtChess (x, Kasparov ) ∧ ¬ SmellsLike (y, Roses )) ∨ Eats (x, y)
A relation between A and B is a function if and only if each element of A is related to exactly one element of B.
A function f from A to B is an assignment of exactly one element f (a) ∈ B to each element a ∈ A. This is written f : A → B.
For example:
Small Brewery Bottled Beer Anchor Steam - San Francisco, CA ....................................4. Bavik Premium Pils - Belgium ...........................................4. Blue Moon - white ale, Colorado ...................................... 3. Carlsberg Beer - lager from Denmark ...............................4. Chimay Blue Cap - Belgium; 18 proof ..............................7. Delirium Tremens - Belgian ale; 17 proof .........................8. Founders Red’s Rye - red ale brewed w/rye ...................4. Founders DIRTY BASTARD - Scottish ale brewed with ten varieties of imported malts, a bold and powerful ale...$4. Goose Island - India Pale Ale, A hop lover’s dream! ....$4. Grolsch Lager - swingtop bottle.........................................5. Konig Ludwig - Royal Bavarian Hefe-Weizen ................4. La Fin Du Monde - Belgian style golden ale ....................5. Harp Lager - Ireland ............................................................4. Hoegaarden - Belgium, sweet and sour, gently bitter ....5. HofBrau - original, from Germany ....................................4. Left Hand JUJU Ginger - pale ale brewed with ginger, from Colorado ....................................................................$4. Lindeman’s Framboise - lambic style ale with real raspberries added! .............................................................$8. Newcastle Brown Ale - England ........................................4. Pilsner Urquell - Czech Republic .......................................4. Paulaner Thomas Brau - German N/A lager.................. 3. Samuel Adams - lager from Boston...................................4. Sterken’s White Ale - Belgian White Ale ..........................4. Sierra Nevada Pale Ale - from CA.....................................4. Staropramen - pilsner from Prague ...................................4. Strongbow - dry English cider ...........................................4. Steinlager - lager from New Zealand ................................4. Theakston Old Peculiar - English dark brown complex ale ..5. Tucher Light Hefe Weizen - Germany ..............................5. Warsteiner Dunkel - German dark ....................................4. Wolaver’s Brown Ale - organic! .........................................4. Wolaver’s IPA - organic! .....................................................4. Xingu - black beer from Brazil ...........................................4. Big Brewery Bottled Beer Amstel Light .........................................................................3. Bud Light/Budweiser/Bud Select.....................................3. Coor’s Light ..........................................................................3. Corona Extra .........................................................................3. Heineken ...............................................................................3. Michelob Ultra/Michelob Ultra Amber ...........................3. Miller High Life ....................................................................2. Miller Lite ..............................................................................3. Pabst Blue Ribbon ................................................................2. Red Stripe ..............................................................................3. Rolling Rock ..........................................................................3.
2
range(f ) = {f (a) | a ∈ A} = {b ∈ B | ∃a ∈ A : f (a) = b}
f (S) = {f (a) | a ∈ S}
In particular, range(f ) = f (A).
f −^1 (b) = {a | f (a) = b}
f −^1 (T ) = {a | f (a) ∈ S}
domain A codomain B
f
a
f ( a )
f ( S )
S A image of^ S
b
f -1( b )
preimage of b
Two things to prove
Examples (all functions f : ZZ → ZZ):
b c is the floor function: round down to the nearest integer. b 2 c = 2 bπc = 3 b−πc = − 4
x + 2 if x is divisible by 3 x − 1 if x is not divisible by 3
More Examples:
Composition
The composition of two functions f : A → B and g : B → C is the function g ◦ f : A → C where
(g ◦ f )(x) = g(f (x))
(f ◦ g)(x) = f (g(x)) = (3x − 2)^2 + 5 = 9x^2 − 12 x + 9
6 = (g ◦ f )(x) = g(f (x)) = 3(x^2 + 5) − 2 = 3x^2 + 13
1 2 3 4
a b c δ
α β γ 1 2 3
4 δ
α β γ
1 2 3
a b c
α β γ d 1 2 3
α β γ
f : { 1 , 2 , 3 , 4 } → {a, b, c} f : { 1 , 2 , 3 } → {a, b, c, d} g : {a, b, c} → {α, β, γ, δ} g : {a, b, c, d} → {α, β, γ} g ◦ f : { 1 , 2 , 3 , 4 } → {α, β, γ, δ} g ◦ f : { 1 , 2 , 3 } → {α, β, γ}