Notes for viewing
The interactive examples in this post require installing Wolfram CDF player, which is free and works on most desktop computers using Firefox, Safari and Internet Explorer, but not Chrome. The source code is the Mathematica Notebook associative.nb, which is available for free use under a Creative Commons Attribution-ShareAlike 2.5 License. The notebook can be read by CDF Player if you cannot make the embedded versions in this post work.
Monads in Abstracting Algebra
I've been working on first drafts (topic posts) of several sections of my proposed book Abstracting algebra (AbAl), concentrating on the ideas leading up to monads. This is going slowly because I want the book to be full of illustrations and interactive demos. I am writing the demos in Mathematica simultaneously with writing the text, and designing demos is very s l o w work. It occurred to me that I should write an outline of the path leading up to monads, using some of the demos I have already produced. This is the first of probably two posts about the thread.
- AbAl is intended to give people with a solid high school math background a mental picture of or way of thinking about the various levels of abstraction of high school algebra.
- This outline is not a "Topic post" as described in the AbAl page. In particular, it is not aimed at high school students! It is a guided tour of my current thoughts about a particular thread through the book.
- The AbAl page has a brief outline of the topics to be covered in the whole book. Perhaps it should also have a list of threads like this post.
Associativity
AbAl will have sections introducing functions and binary operations using pictures and demos (not outlined in this thread). The section on binary operations will introduce infix, prefix and postfix notation but will use trees (illustrated below) as the main display method. Then it will introduce associativity, using demos such as this one:
Using this computingscienceish tree notation makes it much easier to visualize what is happening (see Visible Algebra II), compared to, for example, \[(ab)(cd)=a(b(cd))=a((bc)d)=((ab)c)d=(a(bc))d\] In this equation, the abstract structure is hidden. You have to visualize doing the operation starting with the innermost parentheses and moving out. With the trees you can see the computation going up the tree.
I will give examples of associative functions that are not commutative using $2\times2$ matrices and endofunctions on finite sets such as the one below, which gives all the functions from a two element set to itself.
- Note that each function is shown by a diagram, not by an arbitrary name such as "id" or "sw", which would add a burden to the memory for an example that occurs in one place in the book. (See structural notation in the Handbook.)
- The section on composition of functions will also look in some depth at permutations of a three-element set, anticipating a section on groups.
By introducing a mechanism for transforming trees of associative binary operations, you can demonstrate (as in the demo below) that any associative binary operation is defined on any list of two or more elements of its domain.
For example, applying addition to three numbers $a$, $b$ and $c$ is uniquely defined. This sort of demo gives an understanding of why you get that unique definition but it is not a proof, which requires formal induction. AbAl is not concerned with showing the reader how to prove math statements.
In this section I will also introduce the oneidentity concept: the value of an associative binary operation on a an element $a$ is $a$. Thus applying addition or multiplication to $a$ gives $a$. (The reason for this is that you want an associative binary operation to be a unique quotient of the free associative binary operation. That will come up after we talk about some examples of monads.)
The oneidentity property also implies that for an associative binary operation with identity element, applying the operation to the empty set gives the identity element. Now we can say:
An associative binary operation with identity element is uniquely defined on any finite list of elements of its domain.
Thus, in prefix notation,$+(2,3)=5$, $+(2,3,5)=10$, $+(2)=2$ and $+()=0$. Similarly $\times(2)=2$ and $\times()=1$.
This fact suggests that the natural definition of addition, multiplication, and other associative binary operations is as functions from lists of elements of the domain to elements of the domain. This fits with our early intuition of addition from grade school, not to mention from Excel: Addition is something you do to lists. That feeling (for me) is not so strong for multiplication; for many common business applications you generally multiply two things like price and number sold. That's because multiplication is usually for things of different data types, but you usually add things of the same data type (not apples and oranges?).
That raises the question: Does every function taking lists to elements come from an associative binary operation? I will give an example that says no. But the next thing is to introduce joining lists (concatenation), where we discover that joining lists is an associative binary operation. So it is really an operation on lists of lists. This will turn out to give us a systematic way to define all associative binary operations by one mechanism, because it is an example of a monad. That is for the second installment of this outline.
Send to Kindle
4 thoughts on “Monads for high school I”