Prove that the associative property works when composing functions

411 Views Asked by At

How do I show that if $h,g,f$ are functions, then $h\circ (g\circ f) = (h\circ g) \circ f$??

3

There are 3 best solutions below

0
On BEST ANSWER

If you mean associativity, then it is mostly just writing down the definition of composition. $$h((g \circ f)(x)) = h(g(f(x))) = (h \circ g)(f(x))$$

0
On

Let $x$ be arbitrary. Let $f(x) =w$ which is distinct. Let $g(w) = y$ and $h(y) = z$.

Then $(h\circ (g\circ f))(x) =h ((g\circ f)(x))=h (g(f(x)) = h (g(w))= h(y) = z$

And $z = h(y) = h(g(y)) = (h\circ g)(y) = (h\circ g)(f(x)) = ((h\circ g)\circ f)(x)$

So $(h\circ (g\circ f))(x)= ((h\circ g)\circ f)(x)$

0
On

First, observe that $g\circ f$ exists iff the image of $f$ is a subset of the domain of $g$, an then the domain of $g\circ f$ is the domain of $f$, and the image of $g\circ f$ is a subset of the image of $g$. In particular, assume that $(h\circ g)\circ f$ exists. Then obviously $h\circ g$ exists, and furthermore the image of $f$ is a subset of the domain of $h\circ g$. But the domain of $h\circ g$ is the domain of $g$, and therefore we get that $g\circ f$ exists. Now the image of $g\circ f$ is a subset of the image of $g$, which as we've seen is a subset of the domain of $h$. Therefore, since the subset relation is transitive, the image of $g\circ f$ is a subset of the domain of $h$, and thus $h\circ(g\circ f)$ exists and has the same domain.

An analogous argument shows that if $h\circ(g\circ f)$ exists, then so does $(h\circ g)\circ f$ with the same domain. What remains is to show that the function values are equal for all elements of that domain.

By definition, $(g\circ f)(x) = g(f(x))$ for all $x\in \mathrm{dom}(f)$. Therefore for any such $x$, we have $$(h\circ(g\circ f))(x) = h((g\circ f)(x)) = h(g(f(x))) = (h\circ g)(f(x)) = ((h\circ g)\circ f)(x)$$

This concludes the proof.