Content
3: Sets & more
Functions

Functions

Definition

A function f:ABf: 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 aAa \in A. In general, we are only interested in such functions.

Image

For some function f:ABf: A \to B, the image of AAA' \subseteq A are all elements that are "reached" from AA', i.e. f(A)={bB    aA(f(a)=b)}f(A') = \{ b \in B \; \vert \; \exists a \in A' (f(a') = b) \}

Preimage

The preimage of BBB' \subseteq B under f:ABf: A \to B are all elements in AA that map to some element in BB', i.e. f1(B)={aA    f(a)B}f^{-1}(B') = \{ a \in A \; \vert \; f(a) \in B' \}.

💡

While the inverse f1f^{-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:ABf: A \to B can have "special" properties:

  • A function is injective, if any two distinct input elements map to two different outputs (aa[aaf(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:ABf: A \to B and BBB' \subseteq B, the following holds:

{(f(a),a)B×A}=idBf^ \{ (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)Bf(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:AP(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.)