Content
3: Sets & more
Functions

Functions

Definition

A function f:A→Bf: A \to B is a special type of relation from AA to BB; intuitively speaking, a totally and well-defined function must have a single output for each input, i.e. f(a)f(a) is a single element for all a∈Aa \in A. In general, we are only interested in such functions.

Image

For some function f:A→Bf: A \to B, the image of A′⊆AA' \subseteq A are all elements that are "reached" from A′A', i.e. f(A′)={b∈B  ∣  ∃a∈A′(f(a′)=b)}f(A') = \{ b \in B \; \vert \; \exists a \in A' (f(a') = b) \}

Preimage

The preimage of B′⊆BB' \subseteq B under f:A→Bf: A \to B are all elements in AA that map to some element in B′B', i.e. f−1(B′)={a∈A  ∣  f(a)∈B′}f^{-1}(B') = \{ a \in A \; \vert \; f(a) \in B' \}.

💡

While the inverse f−1f^{-1} might not be defined, the preimage is always defined.

Note: The inverse exists if the preimage relation is a function.

Special Properties

A function f:A→Bf: A \to B can have "special" properties:

  • A function is injective, if any two distinct input elements map to two different outputs (∀a∀a′[a≠a′→f(a)≠f(a′)]\forall a \forall a' \left[ a \ne a' \to f(a) \ne f(a') \right]). For "finite" functions (the relation ff is finite), this is equivalent to ∣A∣=∣f(A)∣|A| = |f(A)|.
  • A function is surjective if for every element in BB there exists some element aa in AA such that f(a)=bf(a) = b, or equivalently, that f(A)=Bf(A) = B
  • A function is bijective if it is injective and surjective.

Exercises

Preimage relationSource:  Max Obreiter

Show that for every f:A→Bf: A \to B and B′⊆BB' \subseteq B, the following holds:

{(f(a),a)∈B′×A}=idB′∘f^ \{ (f(a), a) \in B' \times A \} = \text{id}_{B'} \circ \hat{f}

If we "removed" the first element from the tuple of the LHS (but retaining the condition that f(a)∈B′f(a) \in B'), we would get the definition of the preimage. This definition is a bit more powerful since we also know which elements map to what.

No bijection to Powerset (Cantor's Theorem)Source:  Max Obreiter

Prove that for any set AA and any function f:A→P(A)f: A \to \mathcal P(A), ff is not bijective.

(This exercise is quite difficult and the first step might appear "random"; with Hint 1 the exercise should be rather easy.)