# inverse of composition of functions

###### Theorem.

Let $f$ and $g$ be invertible functions such that their composition $f\circ g$ is well defined. Then $f\circ g$ is invertible and

 $(f\circ g)^{-1}=g^{-1}\circ f^{-1}.$

Before proving this theorem, it should be noted that some students encounter this result long before they are introduced to formal proof. Fortunately, there is an intuitive way to think about this theorem: Think of the function $g$ as putting on one’s socks and the function $f$ as putting on one’s shoes. Then $f\circ g$ denotes the process of putting one one’s socks, then putting on one’s shoes. (Recall that function composition works from right to left.) Note that $(f\circ g)^{-1}$ refers to the reverse process of $f\circ g$, which is taking off one’s shoes (which is $f^{-1}$) followed by taking off one’s socks (which is $g^{-1}$).

Due to the intuitive argument given above, the theorem is referred to as the socks and shoes rule. This name is a mnemonic device which reminds people that, in order to obtain the inverse of a composition of functions, the original functions have to be undone in the opposite order.

Now for the formal proof.

###### Proof.

Let $A$, $B$, and $C$ be sets such that $g\colon A\to B$ and $f\colon B\to C$. Then the following two equations must be shown to hold:

 $\displaystyle(g^{-1}\circ f^{-1})\circ(f\circ g)=\hbox{id}_{A}$ (1)
 $\displaystyle(f\circ g)\circ(g^{-1}\circ f^{-1})=\hbox{id}_{C}$ (2)

Note that $\hbox{id}_{X}$ denotes the identity function on the set $X$.

The two equations given above follow easily from the fact that function composition is associative.

 $\displaystyle(g^{-1}\circ f^{-1})\circ(f\circ g)$ $\displaystyle=g^{-1}\circ((f^{-1}\circ f)\circ g)$ $\displaystyle=g^{-1}\circ(\hbox{id}_{B}\circ g)$ $\displaystyle=g^{-1}\circ g$ $\displaystyle=\hbox{id}_{A}$
 $\displaystyle(f\circ g)\circ(g^{-1}\circ f^{-1})$ $\displaystyle=f\circ((g\circ g^{-1})\circ f^{-1})$ $\displaystyle=f\circ(\hbox{id}_{B}\circ f^{-1})$ $\displaystyle=f\circ f^{-1}$ $\displaystyle=\hbox{id}_{C}\qed$

The socks and shoes rule has a natural generalization:

###### Corollary.

Let $n$ be a positive integer and $f_{1},\dots,f_{n}$ be invertible functions such that their composition $f_{1}\circ\dots\circ f_{n}$ is well defined. Then $f_{1}\circ\dots\circ f_{n}$ is invertible and

 $(f_{1}\circ\dots\circ f_{n})^{-1}={f_{n}}^{-1}\circ\dots\circ{f_{1}}^{-1}.$

A sketch of a proof is as follows: Using induction on $n$, the socks and shoes rule can be applied with $f=f_{1}\circ\dots\circ f_{n-1}$ and $g=f_{n}$.

Title inverse of composition of functions InverseOfCompositionOfFunctions 2013-03-22 17:47:47 2013-03-22 17:47:47 Wkbj79 (1863) Wkbj79 (1863) 8 Wkbj79 (1863) Theorem msc 03-00 msc 03E20 msc 97D40 socks and shoes rule Function InverseFormingInProportionToGroupOperation