How to explain mathematical concepts in a way that students can understand

# Is composition of functions associative?

Posted on April 1, 2012

Is composition of functions associative?

Well, of course it is.

[Notes in italics added 30/7/12: In spite of the date of this post, it is not intended to be a joke (except in as much as my concerns here may appear amusing!). However, the title of the post might be somewhat misleading. I am not suggesting that there is actually any doubt about the truth of these standard results, namely that composition of functions is associative, and that evaluation of expressions with nested brackets is unambiguous. What I am really asking is whether the standard proof of the fact that composition of functions is associative is a fully convincing one.]

I’m sure you have seen the standard proof that composition of functions is associative, but let me remind you how it goes.

Let $W,X,Y$ and $Z$ be sets, and suppose that we are given functions

$h:W \to X$, $g:X \to Y$ and $f:Y \to Z$

We show that $(f \circ g) \circ h = f \circ (g \circ h)$ as follows.

Let $w \in W$. Then

$((f \circ g) \circ h)(w) = (f \circ g)(h(w)) = f(g(h(w)))$

and

$(f \circ (g \circ h))(w) = f( (g\circ h)(w)) = f(g(h(w)))$.

Since $((f \circ g) \circ h)(w) = (f \circ (g \circ h))(w)$

for all $w\in W$, we have

$(f \circ g) \circ h = f \circ (g \circ h)\,.$

Now perhaps it is just me, but I suspect that seeing so many brackets around here might make for some initial confusion for the students. But is there more to it than that? As mathematicians, we know how to evaluate expressions involving lots of brackets. In fact we all learned how to prioritize brackets over the other mathematical operations when we were at school. But somewhere implicit in this is a confidence that we know how to evaluate expressions involving nested brackets and that these expressions are unambiguous.

But how do we know that evaluating expressions with nested brackets is unambiguous? Are we assuming here that composition of functions is associative? [Or maybe we need, at some earlier stage, to perform a check that is essentially equivalent to proving that composition of functions is associative?] That would then lead to circularity in the argument above. [Or at least it might render the standard proof less satisfactory?]

Here is my suggestion for breaking out of this possible problem.

First of all, how else could we define the function $f\circ g$. Perhaps we are happy at least with the definition $(f \circ g)(x) = f(g(x))$: after all, there doesn’t seem to be any ambiguity there. Still, let’s see this another way.

Given $x \in X$, set $y = g(x) \in Y$, and then set $z = f(y) \in Z$. Then the function $f \circ g$ is the function $x \mapsto z$, where $z$ is defined in terms of $x$ as above.

How can this possibly help? Well, if we return to the composition of functions, let’s see what the new definitions of

$(f \circ g) \circ h$ and $f \circ (g \circ h)$

look like.

Let $w \in W$. Set $x=h(w) \in X$, set $y=g(x) \in Y$ and set $z=f(y) \in Z$.

Examining our definitions above, we discover that

$z= (f \circ g)(x)$ where $x=h(w)$, and so

$z = ((f\circ g)\circ h)(w)$

(and you could rewrite this in longhand in English if you want to avoid some of the brackets round the functions!)

Similarly

$y = (g\circ h)(w)$ and $z = f(y)$, giving us

$z= (f \circ (g\circ h))(w)$

(and again, we can rewrite everything in English to avoid some of the brackets round the functions).

The rest of the proof is as before.

I’m not really sure whether this helps, or hinders in general! But perhaps there are a few more people like me out there who might be glad to see that there isn’t really any circularity in the proof after all. That is, if I haven’t introduced some new problems above …

[Feedback so far suggests that I may be in a minority of one with my concerns about the standard proof!]

### Like this:

This entry was posted in Mathematics, Teaching. Bookmark the permalink.

### 8 Responses to Is composition of functions associative?

1. Pingback: Composition of Functions is Associative | New Math Done Right

2. Toby Bailey

There is no question of associativity in interpreting an expression formed from brackets, and therefore, as far as I can see no possibility of circularity.

More to the point, *if* you seriously think that there is something to say about interpreting multiply bracketed expressions that your students do not already know, then surely you need to say it far earlier since this can hardly be the only place that they occur. Indeed, a similar complication of brackets is easily obtained in basic algebra.

• Toby Bailey

Just noticed the date of posting of the original article. As a joke, it’s a bit too similar to a lot of maths teaching.

3. Joel

Toby, it wasn’t a joke.
It was a personal response to the issue, and one which made me feel a bit happier about it! Some might find my comments helpful, others irrelevant.
Let me ask: why do you think that there is no issue involved in evaluating nested brackets? I don’t claim to have resolved that issue here, except perhaps in the very special case which corresponds to function composition. Presumably the general case is discussed elsewhere?
Joel

• Toby Bailey

I still don’t see what you are worrying about. Brackets are a means of writing unambiguous instructions to carry out multiple binary operations (or function evaluations of course). Associativity is about whether two different bracketed expressions are in fact equal as a consequence of the properties of the particular binary operation. There is not even the scope for circularity.

I quite see that there is an issue to think about as to whether bracketed expressions do define a calculation to be done unambiguously, and doubtless somebody has written on this although it strikes me as obvious that they do. And, as I said before, if we are in any doubt about this then we should sort it out far earlier since it would affect every reasonably complicated calculation we ever do.

I certainly have not experienced a failure to understand brackets as being an issue with UG maths teaching – although of course they are often used (or more often, not used) rather carelessly.

But students will certainly find the associativity of function composition statement and proof difficult, but not, I would claim, because of imagining an ambiguity with brackets. I would suggest that the issue is probably in understanding the statement and the need for a proof. On the first, we are probably dealing with what has often been referred to as a “process-object” difficulty: the huge cognitive step from thinking of a given function as a process to be applied to an argument to thinking of a function as an object itself to which operations can be applied. One sees this at a more elementary level when students have difficulty reasoning about an abstract function about which only some properties are known, compared with a concrete one which can be evaluated on a calculator.

Secondly, there is the related difficulty with students not realising that the “rules of algebra” change according to the properties of the objects and operations. Having dealt at High School almost entirely with numbers, they are inclined to think of a(bc)=(ab)c as an absolute truth of mathematics rather than as a law that may or may not hold. I only realised that this may be a related problem as I wrote this: I suspect that the process-object difficulty causes students to fall back on using the “usual rules of algebra” because they are not yet equipped with the necessary schema to work with the functions as objects.

• Joel

The mathematics required to explain what it actually means to evaluate a mathematical expression is standard enough, but involves an inductive construction which I suspect would be somewhat tricky for a typical first-year mathematics undergraduate. So I doubt that this would be covered rigorously before students have to meet composition of functions. That means that students are taking certain things on trust at this point.
When you take standard facts on trust (like the fact that you can evaluate mathematical expressions unambiguously), you don’t necessarily know which results are used/assumed when people actually give rigorous proofs of those facts.
What I hope my post does is to give a short cut for those who, like me, might otherwise need to look at the full details involved in the inductive construction, and check that there is no hidden use of the associativity of composition of functions there.
I suspect that I am, and will remain, in a vanishingly small minority in having had any concerns at all! I have certainly never come across a student with this concern, and I may never meet one.

4. Joel

Somewhat related to my concerns here is a more advanced fact.
If a Banach space $E$ is reflexive then so is its topological dual $E^*$.
Some of my students asked me whether the following argument was acceptable:

“Since $E$ is reflexive, identification allows us to write
$E = E^{**}$
and so, taking $*$ of both sides gives
$E^* = E^{***}\,,$
from which $E^*$ is also reflexive.”

That attempted argument is definitely dubious!
It is this type of concern that brought me back to wondering whether there is an issue.
Perhaps there really is nothing to it. If you are not worried then please feel free to ignore this post.
Part of the point of the post is to convince the rare concerned reader (someone like myself) that there really is no circularity after all here.

5. Neil

Hey. Thanks for the post. I was confusing myself with this today. It was one of those ‘I know this is stupid but something doesn’t feel right’ moments. I also thought I would be the only one with an issue but apparently not.

My confusion was also due to me wandering whether the fact that
fg(x) = f(g(x)) comes before or after associativity.

I’ve worked on it a bit and this is my present understanding. Which may be of some help. Take functions to be defined by their source, target and graph. Ie, ordered pairs with elements from given sets. Then this definition implies that composition is associative and it implies that fg(x) = f(g(x)). But now apparently fg(x) = f(g(x)) also implies associativity. Which is sort of weird:

Definition implies associative
Definition implies fg(x) = f(g(x))
fg(x) = f(g(x)) implies associativity

Maybe I should just reproduce the set theoretic proof of associativity. Which is:
(x,y) in f(gh)
= There exists z such that (x,z) in gh and (z,y) in f
= There exists z and w such that (x,w) in h and (w,z) in g and (z,y) in f
= There exists w and z such that (x,w) in h and (w,z) in g and (z,y) in f
= There exists w such that (x,w) in h and (w,y) in fg
= (x,y) in (fg)h

And the proof that fg(x) = f(g(x))

Recall that fg(x) is the unique element y such that (x,y) in fg. Or, formally stated:
{ fg(x) } = { y | (x,y) is in fg }
so then
{ fg(x) } = { y | There is a z | (x,z) is in g and (z,y) is in f }
But since { g(x) } = { y | (x,y) is in g }
we have { g(x) } = { z }
so z = g(x)
so { fg(x) } = { y | (x,g(x)) is in g and (g(x),y) is in f }
but again we find that if (g(x), y) is in f then y = f(g(x))
So { fg(x) } = { f(g(x))}
and finally fg(x) = f(g(x))

So really the question is how best to define function composition and how best to prove associativity. It seems we can keep both associativity and that fg(x) = f(g(x)) by dropping the set theoretic definition and just defining fg to be all pairs (x,f(g(x))). This will lose a lot in other places though. As for the proof: Is it possible that we can have and operation * on functions where f*g(x) =f(g(x)) but * is not associative? Seems the answer is no. Is it possible that we can have an operation * on functions such that * is associative but f*g(x) is not f(g(x))? We have not shown otherwise. (normal addition of functions an example?) How should we prove associativity? Personally I prefer the proof straight from the set theoretic definition. I don’t think you should use theorems where definitions and axioms will do.

)

• ### Blog Stats

• 89,203 hits
Cancel
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 40, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 5, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.959630012512207, "perplexity_flag": "middle"}