This post has been turned into a page on WordPress, accessible in the upper right corner of the screen. The page will be referred to by all topic posts for Abstracting Algebra.
Send to Kindle
This post has been turned into a page on WordPress, accessible in the upper right corner of the screen. The page will be referred to by all topic posts for Abstracting Algebra.
Send to KindleThe entire contents of the 3rd edition of Category theory for computing science, by Michael Barr and Charles Wells, is now available online at either of these addresses:
http://www.abstractmath.org/CTCS/ctcs.pdf
ftp.math.mcgill.ca/barr/pdffiles/ctcs.pdf
We have submitted it to be published by Theory and Application of Categories in their reprint series. That is where Triples, Toposes and Theories is published.
There are two distinct versions of parts of CTCS already available on the internet. Neither of them contain all the material in the book, nor do they contain answers to all the exercises, as the copy available above does.
Send to KindleThis is the first in a series of articles about how algebra could be implemented without using the standard language of algebra that so many people find difficult. The code for the graphs are in the Mathematica notebook Algebra1.nb.

Suppose you are designing a window that is in the shape of a rectangle surmounted by a semicircle, shown above for the window with width 2 and rectangle height 3.
This example occurs in a tiresomely familiar calculus problem where you put a constraint on the perimeter of the window, thus turning it into a one-variable problem, then finding the values of the width and height that give the maximum area. In this post, I am not going to get that far. All I will do is come up with a calculation for the area. I will describe a way you might do it on a laptop five or ten years from now.
You have an algebra application that shows a screen with some operations that you may select to paste into your calculation. The ones we use are called plus, times, power, value and input. You choose a function called value, and label it "Area of window". You recognize that the answer is the sum of the areas of the rectangle and the area of the semicircle, so you choose plus and attach to it two inputs which you label "area of rectangle" and "area of semicircle", like this:
The notational metaphor is that the computation starts at the bottom and goes upward, performing the operations indicated.
You know (or are told by the system) that the area of a rectangle is the product of its width and height, so you replace the value called "area of rectangle" with a times button and attach two values called $w$ and $h$:
You also determine that the area under the semicircle is half the area of a circle of radius $r$ (where $r$ must be calculated).
You have a function for the area of a circle of radius $r$, so you attach that:

Finally, you use the fact that you know that the semicircle has a radius which is half the width of the rectangle.

Now, to make the calculation operational, you attach two inputs named "width" and "height" and feed them into the values $w$ and $h$. When you type numbers into these buttons, the calculation will proceed upward and finally show the area of the window at the top.
In a later post I will produce a live version of this diagram. (Added 2012-09-08: the live version is here.) Right now I want to get this post out before I leave for MathFest. (I might even produce the live version at MathFest, depending on how boring the talks are.)
You can see an example of a live calculation resembling this in my post A visualization of a computation in tree form.
Send to KindleThe Mystery of the Prime Numbers: Secrets of Creation v. 1, Matthew Watkins (Author), Matt Tweed (Illustrator). Inamorata Press, 2010.
The author and illustrator describe some of the mysteries of the distribution of primes, ending with Riemann's harmonic decomposition of the distribution. (If you don't understand what all that means, you will if you read the book and concentrate a lot). It is the first part of a trilogy which the author promises will culminate in a connection with quantum theory. I can't wait.
The most remarkable thing about this book is the presentation. You do not have to understand symbolic math. The ideas are communicated using many, many pictures and metaphors. For example, you have a number of apples and you can't arrange them into a rectangle (a row doesn't count as a rectangle) then the number is a prime. Technical terminology is avoided, especially when the terminology consists of ordinary English words with new meanings. So a prime factorization of a number is a "cluster" — and of course it really is since the order the primes occur in is irrelevant. On other occasions he will use the technical term (for example "distribution of primes" but warn you against your understanding being contaminated by the everyday meaning such as "distribute two pencils to each student").
The author is not afraid of saying the same thing several times, using different metaphors and rewording. He will notice that some ideas will make you uncomfortable, such as the prime number theorem which "ought" to tell you the exact number of primes less than a number instead of merely estimate it. (How many of your teachers ever admitted that an idea may make you uncomfortable and this is why it does…) His explanation of functions and graphs is pictorial (using the endograph — arrows from one place to another on the real line) and kinetic (a ball rising from the x axis, hitting the graph, and being knocked horizontally to the y axis).
This makes me believe a reader who finds algebraic equations hard to understand and the nomenclature baffling can still get a reasonable mental picture of what primes are and what the Prime Number Theorem and Riemann's theorem on the distribution are actually saying. It won't be easy: such a reader will have to concentrate and stop and think a lot (and I hope doodle pictures) and at times it will be slow going. But this book makes it possible for someone who has no self-confidence in their ability to understand math to understand some deep stuff that many mathematicians find as astonishing as anything in math.
If we had a hundred authors writing books like this about different parts of math we would (in the long run) have fewer people who hate math or claim it all sounds like gibberish.
The long time reader of Gyre & Gimble will note that I have been saying for years that math should be explained like this. So naturally I am pleased to recommend this book. (Even so, all the times I taught primes I never thought of defining a prime number by saying you can't arrange your trinkets into a rectangle. Oh, the chagrin…)
Send to KindleThe 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 Live evaluation of expressions in TreeForm 3, which is available for free use under a Creative Commons Attribution-ShareAlike 2.5 License. The code is ad-hoc. It might be worthwhile for someone to design a package that produces this sort of tree for any expression. The notebook can be read by CDF Player if you cannot make the embedded versions in this post work.
This demonstration shows the step by step computation of the value of the expression $3x^2+2(1+y)$ shown as a tree. By moving the first slider from right to left, you go through the six steps of the computation. You may select the values of $x$ and $y$ with the second and third sliders. If you click on the plus sign next to a slide, a menu opens up that allows you to make the slider move automatically, shows the values, and other things.
Note that subtrees on the same level are evaluate left to right. Parallel processing would save two steps.
A previous post related to this post is Making visible the abstraction in algebraic notation.
Send to KindleMaya Incaand commented on my post Definition of "function":
Why did you decide against "two inequivalent descriptions in common use"? Is it no longer true?
This question concerns [1], which is a draft article. I have not promoted it to the standard article in abstractmath because I am not satisfied with some things in it.
More specifically, there really are two inequivalent descriptions in common use. This is stated by the article, buried in the text, but if you read the beginning, you get the impression that there is only one specification. I waffled, in other words, and I expect to rewrite the beginning to make things clearer.
Below are the two main definitions you see in university courses taken by math majors and grad students. A functional relation has the property that no two distinct ordered pairs have the same first element.
Strict definition: A function consists of a functional relation with specified codomain (the domain is then defined to be the set of first elements of pairs in the relation). Thus if $A$ and $B$ are sets and $A\subseteq B$, then the identity function $1_A:A\to A$ and the inclusion function $i:A\to B$ are two different functions.
Relational definition: A function is a functional relation. Then the identity and inclusion functions are the same function. This means that a function and its graph are the same thing (discussed in the draft article).
These definitions are subject to variations:
Variations in the strict definition: Some authors use "range" for "codomain" in the definition, and some don't make it clear that two functions with the same functional relation but different codomains are different functions.
Variations in the relational definition: Most such definitions state explicitly that the domain and range are determined by the relation (the set of first coordinates and the set of second coordinates).
There are many other variations in the formalism used in the definition. For example, the strict definition can be formalized (as in Wikipedia) as an ordered triple $(A, B, f)$ where $A$ and $B$ are sets and $f$ is a functional relation with the property thar every element of $A$ is the first element of an ordered pair in the relation.
You could of course talk about an ordered triple $(A,f,B)$ blah blah. Such definitions introduce arbitrary constructions that have properties irrelevant to the concept of function. Would you ever say that the second element of the function $f(x)=x+1$ on the reals is the set of real numbers? (Of course, if you used the formalism $(A,f,B)$ you would have to say the second element of the function is its graph! )
It is that kind of thing that led me to use a specification instead of a definition. If you pay attention to such irrelevant formalism there seems to be many definitions of function. In fact, at the university level there are only two, the strict definition and the relational definition. The usage varies by discipline and age. Younger mathematicians are more likely to use the strict definition. Topologists use the strict definition more often than analysts (I think).
There is also variation in usage.
Below are some definitions of function that appear on the web. I have excluded most definitions aimed at calculus students or below; they often assume you are talking about numbers and formulas. I have not surveyed textbooks and research papers. That would have to be done for a proper scholarly article about mathematical usage of "function". But most younger people get their knowledge from the web anyway.
Send to KindleIn my previous post I wrote about the idea of offloading abstraction, the sort of things we do with geometric figures, diagrams (that post emphasized manipulable diagrams), drawing the tree of an algebraic expression, and so on. This post describes a way to offload chunking.
I am talking about chunking in the sense of encapsulation, as some math ed. people use it. I wrote about it briefly in [1], and [2] describes the general idea. I don't have a good math ed reference for it, but I will include references if readers supply them.
Chunking for some educators means breaking a complicated problem down into pieces and concentrating on them one by one. That is not really the same thing as what I am writing about. Chunking as I mean it enables you to think more coherently and efficiently about a complicated mathematical structure by objectifying some of the data in the structure.
This project an example of how chunking could be made visible in interactive diagrams, so that the reader grasps the idea of chunking. I guess I am chunking chunking.
Here is a short version of an example of chunking worked out in ridiculous detail in reference [1].
Let \[f(x)=.0002{{\left( \frac{{{x}^{3}}-10}{3{{e}^{-x}}+1} \right)}^{6}}\] How do I know it is never negative? Well, because it has the form (a positive number)(times)(something)$^6$. Now (something)$^6$ is ((something)$^3)^2$ and a square is always nonnegative, so the function is (positive)(times)(nonnegative), so it has to be nonnegative.
I recognized a salient fact about .0002, namely that it was positive: I grayed out (in my mind) its exact value, which is irrelevant. I also noticed a salient fact about \[{{\left( \frac{{{x}^{3}}-10}{3{{e}^{-x}}+1} \right)}^{6}}\] namely that it was (a big mess that I grayed out)(to the 6th power). And proceeded from there. (And my chunking was inefficient; for example, it is more to the point that .0002 is nonnegative).
I believe you could make a movie of chunking like this using Mathematica CDF. You would start with the formula, and then as the voiceover said "what's really important is that .0002 is nonnegative" the number would turn into a gray cloud with a thought balloon aimed at it saying "nonnegative". The other part would turn into a gray cloud to the sixth, then the six would break into 3 times 2 as the voice comments on what is happening.
It would take a considerable amount of work to carry this out. Lots of decisions would need to be made.
One problem is that Mathematica doesn't provide a way to do voiceovers directly (as far as I know). Perhaps you could make a screen movie using screenshot software in real time while you talked and (offscreen) pushed buttons that made the various changes happen.
You could also do it with print instead of voiceover, as I did in the example in this post. In this case you need to arrange to have the printed part and the diagram simultaneously visible.
I may someday try my hand at this. But I would encourage others to attack this project if it interests them. This whole blog is covered by the Creative Commons Attribution – ShareAlike 3.0 License", which means you may use, adapt and distribute the work freely provided you follow the requirements of the license.
I have other projects in mind that I will post separately.
Send to KindleA sketch of a mathematical structure is a collection of objects and arrows that make up a digraph (directed graph), together with some specified cones, cocones and diagrams in the digraph. A model of the sketch is a digraph morphism from the digraph to some category that takes the cones to limit cones, the cocones to colimit cocones, and the diagrams to commutative diagrams. A morphism of models of a sketch from one model to another in the same category is a natural transformation. Sketches can be used to define all kinds of algebraic structures in the sense of universal algebra, and many other types of structures (including many types of categories).
There are many structures that sketches cannot sketch. Forms were first defined in [4]. They can define anything a sketch can define and lots of other things. [5] gives a leisurely description of forms suitable for people who have a little bit of knowledge of categories and [1] gives a more thorough description.
An idempotent is a very simple kind of algebraic structure. Here I will describe both a sketch and a form for idempotents. In another post I will do the same for binops (magmas).
An idempotent is a unary operation $u$ for which $u^2=u$.
Any idempotent $u$ makes the following diagram commute
and that diagram can be taken as the definition of idempotent in any category.

The sketch for idempotents contains a digraph with one object and one arrow from that object to itself (above left) and one diagram (above right). It has no cones or cocones. So this is an almost trivial example. When being expository (well, I can hardly say "when you are exposing") your first example should not be trivial, but it should be easy. Let's call the sketch $\mathcal{S}$.
The definition of sketch says that every diagram in the official list of diagrams of a given sketch must become a commutative diagram in a model. This use of the word "become" means in this case that a model must be a digraph morphism $M:\mathcal{S}\to\mathcal{C}$ for some category $\mathcal{C}$ for which the diagram below commutes.
You can sketch categories with a sketch CatSk containing diagrams and cones, but no cocones. This is done in detail in [3]. The resulting theory $\text{Th}(\mathbf{CatSk})$ is required to be the least category-with-finite-limits generated by $\mathcal{S}$ with the diagrams becoming commutative diagrams and the cones becoming limit cones. This theory is the FL-Theory for categories, which I will call ThCat (suppressing mention of FL).
In general the theory of a particular kind of structure contains a parameter that denotes its doctrine. The sketch $\mathcal{S}$ for idempotents didn't require cones, but you can construct theories $\text{Th}(\mathcal{S})$, $\text{Th} (\text{FP},\mathcal{S})$ and $\text{Th}(\text{FL},\mathcal{S})$ for idempotents (FP means it is a category with finite products).
In a strong sense, all these theories have the same models, namely idempotents, but the doctrine of the theory allows you to use more mechanisms for proving properties of idempotents. (The doctrine for $\text{Th}(\mathcal{S})$ provides for equational proofs for unary operations only, a doctrine which has no common name such as FP or FS.) The paper [1] is devoted to explicating proof in the context of forms, using graphs and diagrams instead of formulas that are strings of symbols.
The form for any type of structure is constructed using the FL theory for some type of category, for example category with all limits, cartesian closed category, topos, and so on. The form for idempotents can be constructed in ThCat (no extra structure needed). The form for reflexive function spaces (for example) needs the FL theory for cartesian closed categories (see [5]).
Such an FL theory must contain objects $\text{ob}$ and $\text{ar}$ that become the set of objects and the set of arrows of the category that a model produces. (Since FL theories have models in any category with finite limits, I could have said "object of objects" and "object of arrows". But in this post I will talk about only models in Set.)
ThCat contains an object $\text{ar}_2$ that represents composable pairs of arrows. That requires a cone to define it:
This must become a limit cone in a model.
This cone is a graph-based description of the object of composable arrows in a category (as opposed to a linguistic or string-based description).
Now an idempotent must be an endomorphism, so we provide a cone describing the object of endomorphisms in a category. This cone already exists in the FL theory for categories.
This particular purple cone is the limit cone defining $\text{endo}$ just defined. Now $\text{diag}$ is a specific arrow in the FL theory for categories. In a model of the theory (which is a category in Set or in some other category) takes an endomorphism to the corresponding pair of composable arrows.
Now using these arrows we can define the object $\text{idm}$ of idempotents using the diagram below. See Note [3].
Idm is an object in ThCat. In any category, in other words in any model of ThCat, idm becomes the set of idempotent arrows in that category.
In the terminology of [5], the object idm is the form for idempotents, and the cone it is the limit of is the description of idempotent.
Now take ThCat and adjoin an arrow $g:1\to\text{idm}$. You get a new FL category I will call the FL-theory of the form for idempotents. A model of the theory of the form in Set is a category with a specified idempotent. A particular example of a model of the form idm in the category of real linear vector spaces is the map $u(x,y):=(-x,0)$ of the (set of points of) the real plane to itself (it is an idempotent endomorphism of $\textbf{R}^2$).
This example is typical of forms and their models, except in one way: Idempotents are also sketchable, as I described above. Many mathematical structures can be perceived as models of forms, but not models of sketches, such as reflexive function spaces as in [5].
[1] The diagrams shown in this post were drawn in Mathematica. The code for them is shown in the notebook SketchFormExamples.nb . I am in the early stages of developing a package for drawing categorical diagrams in Mathematica, so this notebook shows the diagrams defined in very primitive machine-code-like Mathematica. The package will not rival xypic for TeX any time soon. I am doing it so I can produce diagrams (including 3D diagrams) you can manipulate.
[2] In practice I would refer to the names of the objects and arrows in the sketch rather than using the M notation: I might write $f\circ f=f$ instead of $M(f)\circ M(f)=M(f)$ for example. Of course this confuses syntax with semantics, which sounds like a Grievous Sin, but it is similar to what we do all the time in writing math: "In a semigroup, $x$ is an idempotent if $xx=x$." We use same notation for the binary operation for any semigroup and we use $x$ as an arbitrary element of most anything. Actually, if I write $f\circ f=f$ I can claim I am talking in the generic model, since any statement true in the generic model is true in any model. So there.
[3] In the Mathematica notebook SketchFormExamples.nb in which I drew these diagrams, this diagram is plotted in Euclidean 3-space and can be viewed from different viewpoints by running your cursor over it.
[1] Atish Bagchi and Charles Wells, Graph-Base Logic and Sketches, draft, September 2008, on ArXiv.
[2] Michael Barr and Charles Wells, Category Theory for Computing Science (1999). Les Publications CRM, Montreal (publication PM023).
[3] Michael Barr and Charles Wells, Toposes, Triples and Theories (2005). Reprints in Theory and Applications of Categories 1.
[4] Charles Wells, A generalization of the concept of sketch, Theoretical Computer Science 70, 1990
[5] Charles Wells, An Introduction to forms.
Send to KindleSue Van Hattum wrote in response to a recent post:
I’d like to know what you think of my ‘abuse of terminology’. I teach at a community college, and I sometimes use incorrect terms (and tell the students I’m doing so), because they feel more aligned with common sense.
To me, and to most students, the phrase “whole numbers” sounds like it refers to anything that doesn’t need fractions to represent it, and should include negative numbers. (It then, of course, would mean the same thing that the word integers does.) So I try to avoid the phrase, mostly. But I sometimes say we’ll use it with the common sense meaning, not the official math meaning.
Her comments brought up a couple of things I want to blather about.
There is no such thing as an "official math meaning". Mathematical notation has no governing authority and research mathematicians are too ornery to go along with one anyway. There is a good reason for that attitude: Mathematical research constantly causes us to rethink the relationship among different mathematical ideas, which can make us want to use names that show our new view of the ideas. An excellent example of that is the evolution of the concept of "function" over the past 150 years, traced in the Wikipedia article.
What some "authorities" say about "whole number":
Mathematicians think about and talk any particular kind of math object using images and metaphors. Sometimes (not very often) the name they give to a math object embodies a metaphor. Examples:
Unfortunately, much of the time the name of a kind of object contains a suggestive metaphor that is bad, meaning that it suggests an erroneous picture or idea of what the object is like.
Sue's idea that the "common sense" meaning of "whole number" is "integer" refers, I think, to the built-in metaphor of the phrase "whole number" (unbroken number).
I urge math teachers to do these things:
Send to KindleThere is a proposal under way to create a Stack Exchange site for Mathematica. It needs a few more people to sign up and it will go into beta. (You have to sign up to get access to the beta.) Click on the link above to endorse the proposal.
Send to Kindle