Tag Archives: Lawvere theory

Visible Algebra I

This 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.

An algebra problem

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.

Remarks

Who

  • This calculation might be a typical exercise for a student part way along learning basic algebra. 
  • College students and scientists and engineers would have a system with a lot more built-in functions, including some they built themselves.

Syntax

  • Once you have grasped the idea that the calculation proceed upward from the inputs, carrying out the operations shown, this picture is completely self-explanatory.
    • Well, you have to know what the operations do.
    • The syntax for standard algebra is much more difficult to learn (more later about this).
  • The syntax actually used in later years may not look like mine.
    • For one thing, the flow might run top down or left to right instead of bottom up. 
    • Or something very different might be used. What works best will be discovered by using different approaches.
  • The syntax is fully two-dimensional, which makes it simple to understand (because it uses the most powerful tool our brain has: the visual system).
    • The usual algebraic code was developed because people used pencil and paper. 
    • I would guess that the usual code has fractional dimension about 1.2. 
    • The tree syntax would require too much writing with pencil and paper.  That is alleviated on a computer by using menus.
    • Once you construct the computation and input some data it evaluates automatically.
  • It may be worthwhile to use 3D syntax.  I have an experiment with this in my post Showing categorical diagrams in 3D.

Later posts will cover related topics:

  • The difficulties with standard algebraic notation.  They are not trivial.
  • Solving equations in tree form.
  • Using properties such as associativity and commutativity in tree form.
  • Using this syntax with calculus.
  • The deep connection with Lawvere theories and sketches.

References

Send to Kindle

Models of forms explicated, a little bit

Some miscellaneous notes about the concept of form, which I sketched (ahem) in  a series of posts TDMO1TDMO2TDMO3TDMO4,TDMO5TDMO6, TDMO7, TDMO8, and TDMO9. This series builds up to an explanation of the concept of form in the paper Graph-Based Logic and Sketches by Atish Bagchi and me.  I am now embarking on a series of posts with further explanations and comments.

More about a model of a form

For any constructor space \text{C} (which will be the sketch for a kind of category, a special case of a doctrine), take any object F in the FL Cattheory of \text{C}   and adjoin a new arrow f:1\to F where 1 is the terminal object.  f is what we call a C-form and the enhanced category is denoted by \text{C}_f.  In TDMO9 I described the node \text{rfs} for reflexive function spaces in a cartesian closed category; it is an example of a CCC-form.

A model of a \text{C}-form f  “in a C-category \text{K}” means that \text{K} is a model of \text{C}_f . In particular, in  \text{K}, M(F) is nonempty.

The connection with sketches is this:  If you have a sketch in some doctrine \text{C}, the sketch consists of a graph with some diagrams, cones and cocones.  There is a node F in the FL Cattheory of \text{C} each of whose elements in a model of \text{C} (in other words in a \text{C}-category) will be such a sketch.

Example: The FP sketch for magmas

A magma is a set with a binary operation defined on it (Note 1).  It does not have to be associative or commutative or anything.  In the FP doctrine its sketch consists of one diagram

(Diagram1)

and one cone

(Cone1)

and nothing else.  The FP-Cattheory for this sketch is (equivalent to) the Lawvere theory of magmas.

The FL-Cattheory \text{FP} for FP categories, described in some detail in TDMO8, contains a node whose inhabitants in any model of \text{FP} (in other words in any FP-category) are all such sketches (the diagram and the cone).   This means that the FP sketch for magmas corresponds to an FP-form.  In this way you can see that all sketches in Ehresmann’s sense are forms in my sense.

This node can be constructed as the limit F of a cone over a diagram in \text{FP} as was done in previous posts.  You have to make the diagram become a description of the diagram and cone above, using the arrows in the constructor space \text{FP}, for example \text{ob}, \text{ar}, \text{prod}:\text{ob}\times\text{ob}\rightarrow\text{cone} and others, and including formally commutative diagrams that say for example that Cone1’s projections go to the same object (using \text{lproj} and \text{rproj}).   Maybe someday I will produce this diagram in a post but right now I have a cold.  (Excuses, excuses…)

Adjoining a global element to this limit node will result in an FL-sketch \text{FP}_fwhich contains the FL-Cattheory for \text{FP} along with that global element.

So a model of the form for magmas in an FP category \cal{B} is a model of \text{FP}_f for which the model of the underlying cattheory \text{FP} is \cal{B}; in other words it is the category \cal{B} with a distinguished element f of the node F.  That distinguished element is a particular diagram and cone like the ones shown above for a particular object A (because the projections onto F include a particular projection to \text{ob}).  That object A with the arrows corresponding to m, p_1 and p_2 is a particular magma, a model of the sketch for magmas given above.

Notes

Note 1  “Magma” was the term used by Bourbaki for this structure.  As far as I know, very few people ever used the word until it was published in [1].  When I was a grad student in 1962-65 it was called a “groupoid”, which means something else now (something much more important than a magma in my opinion).  Now the name occurs in examples all over Wikipedia.

References

[1] M. Hazewinkel (2001), “Magma“, in Hazewinkel, Michiel, Encyclopaedia of Mathematics, Kluwer Academic Publishers, ISBN 978-1556080104

Send to Kindle