Set TheoryTopic #14 of 40

Functions

Injective, surjective, bijective functions, composition, inverse functions, and function growth.

Definition

A function ff from AA to BB, written f:A→Bf: A \to B, is a relation where each element of AA is related to exactly one element of BB.

  • Domain: AA (input set)
  • Codomain: BB (output set)
  • Range/Image: {f(a)∣a∈A}⊆B\{f(a) \mid a \in A\} \subseteq B (actual outputs)

Notation

  • f(a)=bf(a) = b means ff maps aa to bb
  • a↦f(a)a \mapsto f(a) describes the mapping

Types of Functions

Injective (One-to-One)

Different inputs give different outputs: ∀a1,a2∈A:f(a1)=f(a2)→a1=a2\forall a_1, a_2 \in A: f(a_1) = f(a_2) \rightarrow a_1 = a_2

Equivalently: ∀a1,a2∈A:a1≠a2→f(a1)≠f(a2)\forall a_1, a_2 \in A: a_1 \neq a_2 \rightarrow f(a_1) \neq f(a_2)

Example: f(x)=2xf(x) = 2x on R\mathbb{R} is injective. Non-example: f(x)=x2f(x) = x^2 on R\mathbb{R} is not injective (f(−1)=f(1)f(-1) = f(1)).

Surjective (Onto)

Every element in the codomain is mapped to: ∀b∈B:∃a∈A:f(a)=b\forall b \in B: \exists a \in A: f(a) = b

Equivalently: range(f)=B\text{range}(f) = B

Example: f(x)=x3f(x) = x^3 from R\mathbb{R} to R\mathbb{R} is surjective. Non-example: f(x)=x2f(x) = x^2 from R\mathbb{R} to R\mathbb{R} is not surjective (−1-1 is not in range).

Bijective (One-to-One Correspondence)

Both injective AND surjective.

f:A→B is bijective  ⟺  ∣A∣=∣B∣ and f is injectivef: A \to B \text{ is bijective} \iff |A| = |B| \text{ and } f \text{ is injective}

Example: f(x)=2x+1f(x) = 2x + 1 from R\mathbb{R} to R\mathbb{R} is bijective.

Cardinality Conditions

For finite sets AA and BB with ∣A∣=m|A| = m and ∣B∣=n|B| = n:

ConditionPossible if
f:A→Bf: A \to B injectivem≤nm \leq n
f:A→Bf: A \to B surjectivem≥nm \geq n
f:A→Bf: A \to B bijectivem=nm = n

Counting Functions

TypeCount
All functions A→BA \to Bnmn^m
Injective functionsn(n−1)(n−2)⋯(n−m+1)=n!(n−m)!n(n-1)(n-2)\cdots(n-m+1) = \frac{n!}{(n-m)!}
Bijective functionsn!n! (when m=nm = n)

Function Composition

If f:A→Bf: A \to B and g:B→Cg: B \to C, then g∘f:A→Cg \circ f: A \to C: (g∘f)(a)=g(f(a))(g \circ f)(a) = g(f(a))

Properties

  • Associative: (h∘g)∘f=h∘(g∘f)(h \circ g) \circ f = h \circ (g \circ f)
  • NOT commutative: g∘f≠f∘gg \circ f \neq f \circ g in general
  • f∘gf \circ g injective ⇒\Rightarrow gg injective
  • f∘gf \circ g surjective ⇒\Rightarrow ff surjective
  • f,gf, g bijective ⇒\Rightarrow g∘fg \circ f bijective

Inverse Functions

If f:A→Bf: A \to B is bijective, its inverse f−1:B→Af^{-1}: B \to A satisfies: f−1(f(a))=a for all a∈Af^{-1}(f(a)) = a \text{ for all } a \in A f(f−1(b))=b for all b∈Bf(f^{-1}(b)) = b \text{ for all } b \in B

Properties

  • (f−1)−1=f(f^{-1})^{-1} = f
  • (g∘f)−1=f−1∘g−1(g \circ f)^{-1} = f^{-1} \circ g^{-1}
  • f∘f−1=IBf \circ f^{-1} = I_B and f−1∘f=IAf^{-1} \circ f = I_A

Identity Function

IA:A→A,IA(a)=aI_A: A \to A, \quad I_A(a) = a

For any f:A→Bf: A \to B: f∘IA=f=IB∘ff \circ I_A = f = I_B \circ f

Important Functions

Floor and Ceiling

⌊x⌋=largest integer ≤x\lfloor x \rfloor = \text{largest integer } \leq x ⌈x⌉=smallest integer ≥x\lceil x \rceil = \text{smallest integer } \geq x

Properties:

  • ⌊x⌋≤x<⌊x⌋+1\lfloor x \rfloor \leq x < \lfloor x \rfloor + 1
  • ⌈x⌉−1<x≤⌈x⌉\lceil x \rceil - 1 < x \leq \lceil x \rceil
  • ⌊x⌋=⌈x⌉\lfloor x \rfloor = \lceil x \rceil iff x∈Zx \in \mathbb{Z}
  • ⌊−x⌋=−⌈x⌉\lfloor -x \rfloor = -\lceil x \rceil

Modulo Function

amod  n=a−n⌊a/n⌋a \mod n = a - n\lfloor a/n \rfloor

The remainder when aa is divided by nn.

Function Growth

Big-O Notation

f(n)=O(g(n))f(n) = O(g(n)) if there exist constants c>0c > 0 and n0n_0 such that: ∣f(n)∣≤c⋅∣g(n)∣ for all n≥n0|f(n)| \leq c \cdot |g(n)| \text{ for all } n \geq n_0

Common Growth Rates

O(1)<O(log⁡n)<O(n)<O(nlog⁡n)<O(n2)<O(n3)<O(2n)<O(n!)O(1) < O(\log n) < O(n) < O(n \log n) < O(n^2) < O(n^3) < O(2^n) < O(n!)

Other Notations

  • f(n)=Ω(g(n))f(n) = \Omega(g(n)): ff grows at least as fast as gg
  • f(n)=Θ(g(n))f(n) = \Theta(g(n)): ff grows at the same rate as gg
  • f(n)=o(g(n))f(n) = o(g(n)): ff grows strictly slower than gg

Cardinality of Infinite Sets

Two sets have the same cardinality if there exists a bijection between them.

  • Countably infinite: Same cardinality as N\mathbb{N} (e.g., Z\mathbb{Z}, Q\mathbb{Q})
  • Uncountable: Larger than N\mathbb{N} (e.g., R\mathbb{R}, P(N)\mathcal{P}(\mathbb{N}))

∣N∣=∣Z∣=∣Q∣=ℵ0|\mathbb{N}| = |\mathbb{Z}| = |\mathbb{Q}| = \aleph_0 ∣R∣=∣P(N)∣=2ℵ0=c|\mathbb{R}| = |\mathcal{P}(\mathbb{N})| = 2^{\aleph_0} = \mathfrak{c}