ConceptComplete

Composition and Function Spaces

The composition of functions and the structure of function spaces are central to modern mathematics. These concepts allow us to treat functions themselves as mathematical objects, leading to powerful abstract constructions.

DefinitionComposition of Functions

Let f:Aβ†’Bf: A \to B and g:Bβ†’Cg: B \to C be functions. The composition of gg and ff, denoted g∘fg \circ f (read "g after f" or "g composed with f"), is the function (g∘f):Aβ†’C(g \circ f): A \to C defined by:

(g∘f)(a)=g(f(a))for all a∈A(g \circ f)(a) = g(f(a)) \quad \text{for all } a \in A

As a set of ordered pairs: g∘f={(a,c):βˆƒb∈B((a,b)∈f∧(b,c)∈g)}g \circ f = \{(a, c) : \exists b \in B((a, b) \in f \land (b, c) \in g)\}.

Composition captures the idea of applying functions sequentially. The output of ff becomes the input to gg, producing a new function from AA to CC. Note that the order matters: g∘fg \circ f means "first ff, then gg," which may seem backwards from the notation.

ExampleFunction Composition Examples
  1. If f:R→Rf: \mathbb{R} \to \mathbb{R} is f(x)=x2f(x) = x^2 and g:R→Rg: \mathbb{R} \to \mathbb{R} is g(x)=x+1g(x) = x + 1, then:

    • (g∘f)(x)=g(f(x))=g(x2)=x2+1(g \circ f)(x) = g(f(x)) = g(x^2) = x^2 + 1
    • (f∘g)(x)=f(g(x))=f(x+1)=(x+1)2=x2+2x+1(f \circ g)(x) = f(g(x)) = f(x + 1) = (x + 1)^2 = x^2 + 2x + 1

    Note that g∘fβ‰ f∘gg \circ f \neq f \circ g in general!

  2. For any function f:A→Bf: A \to B:

    • f∘idA=ff \circ \text{id}_A = f (identity on the left)
    • idB∘f=f\text{id}_B \circ f = f (identity on the right)
  3. If f:Aβ†’Bf: A \to B is bijective with inverse fβˆ’1:Bβ†’Af^{-1}: B \to A, then:

    • fβˆ’1∘f=idAf^{-1} \circ f = \text{id}_A
    • f∘fβˆ’1=idBf \circ f^{-1} = \text{id}_B
TheoremAssociativity of Composition

Composition of functions is associative. For functions f:A→Bf: A \to B, g:B→Cg: B \to C, and h:C→Dh: C \to D:

h∘(g∘f)=(h∘g)∘fh \circ (g \circ f) = (h \circ g) \circ f

Thus we can write h∘g∘fh \circ g \circ f without ambiguity.

Proof

Both sides are functions from AA to DD. For any a∈Aa \in A:

[h∘(g∘f)](a)=h((g∘f)(a))=h(g(f(a)))[(h∘g)∘f](a)=(h∘g)(f(a))=h(g(f(a)))\begin{align*} [h \circ (g \circ f)](a) &= h((g \circ f)(a)) = h(g(f(a))) \\ [(h \circ g) \circ f](a) &= (h \circ g)(f(a)) = h(g(f(a))) \end{align*}

Since both give the same result for every a∈Aa \in A, the functions are equal.

β– 
DefinitionFunction Space

Given sets AA and BB, the function space (or set of all functions) from AA to BB is denoted:

BA={f:fΒ isΒ aΒ functionΒ fromΒ AΒ toΒ B}B^A = \{f : f \text{ is a function from } A \text{ to } B\}

This notation suggests exponentiation, and indeed, when AA and BB are finite, ∣BA∣=∣B∣∣A∣|B^A| = |B|^{|A|}.

The function space BAB^A is itself a set (by the axioms of ZFC), which allows us to consider functions between function spaces, leading to higher-order functions and functional analysis.

ExampleFinite Function Spaces
  1. If A={1,2}A = \{1, 2\} and B={a,b,c}B = \{a, b, c\}, then ∣BA∣=32=9|B^A| = 3^2 = 9. The nine functions are all possible ways to assign elements of BB to elements of AA:

    {1↦a,2↦a},{1↦a,2↦b},…,{1↦c,2↦c}\{1 \mapsto a, 2 \mapsto a\}, \{1 \mapsto a, 2 \mapsto b\}, \ldots, \{1 \mapsto c, 2 \mapsto c\}
  2. The set 2A={0,1}A2^A = \{0, 1\}^A is the set of all functions from AA to {0,1}\{0, 1\}. This is naturally bijective with P(A)\mathcal{P}(A) via characteristic functions:

    Ο‡:P(A)β†’2A,S↦χS\chi: \mathcal{P}(A) \to 2^A, \quad S \mapsto \chi_S

    where Ο‡S(a)=1\chi_S(a) = 1 if a∈Sa \in S and Ο‡S(a)=0\chi_S(a) = 0 if aβˆ‰Sa \notin S.

  3. For infinite sets, RN\mathbb{R}^\mathbb{N} is the set of all sequences of real numbers, while RR\mathbb{R}^\mathbb{R} is the (much larger) set of all functions from R\mathbb{R} to R\mathbb{R}.

DefinitionRestriction and Extension

Let f:Aβ†’Bf: A \to B be a function and CβŠ†AC \subseteq A.

The restriction of ff to CC is the function f∣C:Cβ†’Bf|_C: C \to B defined by:

f∣C=f∩(CΓ—B)={(c,b)∈f:c∈C}f|_C = f \cap (C \times B) = \{(c, b) \in f : c \in C\}

Conversely, if g:Cβ†’Bg: C \to B and f:Aβ†’Bf: A \to B satisfy g=f∣Cg = f|_C, we say ff is an extension of gg to AA.

Remark

Restrictions always exist (by comprehension), but extensions may not be unique. Given g:C→Bg: C \to B, there are typically many ways to extend it to a function f:A→Bf: A \to B, unless additional constraints are imposed.

DefinitionProduct and Coproduct

Given families of functions {fi:Aβ†’Bi}i∈I\{f_i: A \to B_i\}_{i \in I}, the product function is:

∏i∈Ifi:Aβ†’βˆi∈IBi,a↦(fi(a))i∈I\prod_{i \in I} f_i: A \to \prod_{i \in I} B_i, \quad a \mapsto (f_i(a))_{i \in I}

Given families {fi:Aiβ†’B}i∈I\{f_i: A_i \to B\}_{i \in I} with disjoint domains, the coproduct function is:

∐i∈Ifi:∐i∈IAiβ†’B,(i,a)↦fi(a)\coprod_{i \in I} f_i: \coprod_{i \in I} A_i \to B, \quad (i, a) \mapsto f_i(a)

These constructions are fundamental in category theory and universal algebra.

ExampleCurry-Howard Correspondence

In type theory and logic, there is a deep correspondence:

  • Types correspond to sets
  • Terms correspond to elements
  • Function types Aβ†’BA \to B correspond to function spaces BAB^A
  • Composition corresponds to modus ponens
  • The identity corresponds to axioms of identity

This Curry-Howard correspondence connects set theory, type theory, and logic, showing that:

Propositions↔Types↔Sets\text{Propositions} \leftrightarrow \text{Types} \leftrightarrow \text{Sets}Proofs↔Programs↔Functions\text{Proofs} \leftrightarrow \text{Programs} \leftrightarrow \text{Functions}
TheoremExponential Laws

For sets AA, BB, CC:

  1. (B×C)A≅BA×CA(B \times C)^A \cong B^A \times C^A (distributivity over products)
  2. (BC)A≅BC×A(B^C)^A \cong B^{C \times A} (currying)
  3. BA+C≅BA×BCB^{A + C} \cong B^A \times B^C where A+CA + C denotes disjoint union
  4. (BA)C≅BA×C(B^A)^C \cong B^{A \times C} (uncurrying)

These isomorphisms explain why function space notation uses exponents.

The study of function spaces leads naturally to functional analysis, where we consider infinite-dimensional spaces of functions with topological and algebraic structure. Understanding composition, restriction, and these exponential laws provides the foundation for advanced mathematical constructions throughout pure and applied mathematics.