Skip to content

Mathematics · Ch 1 — Sets, Relations and Functions

Operations on Functions

1.6.4

Operations on Functions

Composition. Given f:X→Yf:X\to Y and g:Y→Zg:Y\to Z, define h:X→Zh:X\to Z by first applying ff, then gg: h(x)=g(f(x))h(x)=g(f(x)). This hh is the composition of ff with gg, written g∘fg\circ f (read "ff composite with gg", applied right-to-left: do ff first, then gg).

More generally, g∘fg\circ f can be defined whenever the range of ff is contained in the domain of gg -- ff's co-domain need not literally equal gg's domain, as long as it fits inside it.

Worked examples.

  • f={(1,2),(3,4),(2,2)}, g={(2,1),(3,1),(4,2)}f=\{(1,2),(3,4),(2,2)\},\ g=\{(2,1),(3,1),(4,2)\}: range of f={2,4}⊆f=\{2,4\}\subseteq domain of g={2,3,4}g=\{2,3,4\}, so g∘fg\circ f exists: g∘f={(1,1),(2,1),(3,2)}g\circ f=\{(1,1),(2,1),(3,2)\}. Also range of g={1,2}⊆g=\{1,2\}\subseteq domain of f={1,2,3}f=\{1,2,3\}, so f∘g={(2,2),(3,2),(4,2)}f\circ g=\{(2,2),(3,2),(4,2)\} exists too -- and f∘g≠g∘ff\circ g\ne g\circ f as sets, illustrating non-commutativity.
  • f={(1,4),(2,5),(3,5)}, g={(4,1),(5,2),(6,4)}f=\{(1,4),(2,5),(3,5)\},\ g=\{(4,1),(5,2),(6,4)\}: g∘f={(1,1),(2,2),(3,2)}g\circ f=\{(1,1),(2,2),(3,2)\} exists, but f∘gf\circ g does not exist, since range of g={1,2,4}⊈g=\{1,2,4\}\not\subseteq domain of f={1,2,3}f=\{1,2,3\}.
  • f(x)=3x−4, g(x)=x2+3f(x)=3x-4,\ g(x)=x^2+3 on RR: (g∘f)(x)=(3x−4)2+3=9x2−24x+19(g\circ f)(x)=(3x-4)^2+3=9x^2-24x+19, while (f∘g)(x)=3(x2+3)−4=3x2+5(f\circ g)(x)=3(x^2+3)-4=3x^2+5 -- different, confirming composition is generally not commutative.

Theorem. If f:A→Bf:A\to B and g:B→Cg:B\to C are both one-to-one, then g∘fg\circ f is one-to-one. Proof: if x≠yx\ne y in AA, injectivity of ff gives f(x)≠f(y)f(x)\ne f(y), and injectivity of gg then gives g(f(x))≠g(f(y))g(f(x))\ne g(f(y)), i.e. (g∘f)(x)≠(g∘f)(y)(g\circ f)(x)\ne(g\circ f)(y). ■\blacksquare …