Functions onto, one-one, bijections, pigeonhole principle

Functions
onto, one‐one, bijections, pigeonhole principle
Boats with Sand
Van Gogh
Discrete Structures (CS 173)
Madhusudan Parthasarathy, University of Illinois
1
What is a function?
Function: maps each input element to exactly one output element
Every function has
1) a type signature that defines what inputs and outputs are possible
2) an assignment or mapping that specifies which output goes with each input
:
domain
→ suchthat
co-domain
⋯
What is not a function?
Not a valid function if
1. No type signature
2. Some input is not mapped to an output
3. Some input is mapped to two outputs
When are functions equal?
Functions are equal if 1.
2.
They have the same type signature
The mapping is the same
Equal functions may not necessarily have the same description/closed form!
Onto
image: set of values produced when a function is applied to all inputs
onto: the image is the co‐domain (every possible output is assigned to at least one input)
: → , ∀ ∈ , ∃ ∈ , suchthat
Proof of onto
Claim: : → ,
Definition: : → ,
1 is onto. isontoiff ∀ ∈ , ∃ ∈ , suchthat
Proof of onto
Claim: : 2 → ,
,
is onto. Definition: : → ,
isontoiff ∀ ∈ , ∃ ∈ , suchthat
Onto functions to a finite set
• Let f: A ‐> B and B have n elements.
• How many elements can A have?
‐ Less than n?
‐ Equal to n?
‐ Greater than n but finite?
‐ Infinite?
Can there be an onto function from to ?! if x is odd
0 ‐> 0 1‐>‐1 2‐>1 3‐> ‐2 4‐> 2 …
Disproof of onto
Disprove: : → ,
Definition: : → ,
2 is onto. isontoiff ∀ ∈ , ∃ ∈ , suchthat
Composition
What is wrong with
for : → , : → ,
∘
”
Proof with composition
Claim: For sets , , andfunctions : → , : → , if and are onto, then ∘ is also onto. Definition: : → ,
isontoiff ∀ ∈ , ∃ ∈ , suchthat
One‐to‐one
is a preimage of if
.
One‐to‐one:notwoinputsmaptothesameoutput nooutput
hasmorethanonepreimage
: → ,∀ , ∈ ,
→
contrapositive?
15
Proof of one‐to‐one
Claim: : → ,
Definition: : → ,
2
1 is one‐to‐one. isone‐to‐oneiff ∀ ,
∈ ,
→
16
Proof that one‐to‐one is compositional
Claim: For any sets , , and functions : → , g: B → , if and are one‐
to‐one, then ∘ is also one‐to‐one.
Definition: : → ,
isone‐to‐oneiff ∀ , ∈ ,
→
17
18
19
Bijection and inversion
A function is bijective if it is onto and one‐to‐one.
Inverse function if : → ,
:
, then ∀ ∈ ,
:
→ ,
.
→ is also a bijection.
overhead
20
Proof with one‐to‐one
Let A, B be subsets of reals.
Claim: Any strictly increasing function from A to B is one‐to‐one.
Definition: : → isone‐to‐one iff ∀ , ∈ ,
→
Definition: : → ,
isstrictlyincreasing iff ∀ , ∈ ,
→
overhead
21