Composition of functions
f : A -> B
is an injective function (1:1), so it doesn't cover the whole codomain (an injection that does is a bijection).
A
B
C
g β f
_
1
x
a
2
x
a βΌ x
b
3
y
b βΌ y
_
4
y
g : B -> C
is a surjection (onto), so it covers the while codomain but it is not 1:1, i.e. some elements in codomain are associated with more then one domain element, { 0 βΌ w, 1 βΌ w, 3 βΌ y, 4 βΌ y }.
However, the composition of f
and g
is bijective.
f : A -> B
is injective, g : B -> C
is surjective, but their composition g β f : A -> C
is bijective. Composition ignores some mappings from the common (middle) set B
. Namely, it ignores { 1 βΌ x, 4 βΌ y }
, i.e. these 2 mappings are excluded.
Composition
p ------> a ----g---> y ----h---> z
a -------> 1 ------> x b -------> 2 ------> y c -------> 3 ------> y
a -------> 1 ------> x b -------> 2 ------> y c -------> 3 ------> y
Composability
Composition of functions is possible when the codomain of one function is the same as the domain of another, cod(f) = dom(g)
=> βh. h = g β f
Associativity
Composition is associative: h β (g β f)
= (h β g) β f
= h β g β f
```dot {engine="dot"} digraph { D [label="d"] A [label="a"] C [label="c"] B [label="b"] A -> B [label="f", constraint=false] B -> C [label="g", constraint=true] C -> D [label="h", constraint=false] A -> C [label="g.f", constraint=false] A -> D [label="h.g.f", constraint=true] }
```
Last updated
Was this helpful?