`fmap = liftM`

where
```
```liftM :: Monad m => (a -> b) -> m a -> m b
liftM f ma = do a <- ma
return (f a)

In fact, parametricity guarantees that `fmap = liftM`

; it’s a free theorem. There is another law relating Functor and Monad, `ma >>= f = join (fmap f ma)`

. This law is particularly interesting because if you define a Monad the way mathematicians do using `join`

instead of `(>>=)`

then you *must* have Functor as a superclass in order to define `(>>=)`

. So it seems very natural for Functor to be a superclass of Monad.

However, it’s not so obvious to me why Applicative should be a superclass of Monad. It’s true that every Monad can be made an Applicative with `(<*>) = ap`

where

```
```ap :: Monad m => m (a -> b) -> m a -> m b
ap mf ma = do a <- ma
f <- mf
return (f a)

One should naturally expect that `(<*>) = ap`

is a law when Applicative is a superclass of Monad. But, `(<*>)`

, unlike `fmap`

, is not uniquely determined. A type constructor may have more than one instance. For example, lists have two useful instances.

```
```ap :: [a -> b] -> [a] -> [b]
ap fs as = [f a | a <- as, f <- fs]
zap :: [a -> b] -> [a] -> [b]
zap [] _ = []
zap _ [] = []
zap (f:fs) (a:as) = (f a) : zap fs as

`ap`

delivers a list of all functions in the first list applied to all values in the second list while `zap`

goes down the lists applying functions to values at the same index. So which do you choose? Well, `ap`

is the one which is compatible with the Monad instance on lists, so it wins. `zap`

is used as the Applicative instance for a newtype on lists, the ZipList. Interestingly, there is no compatible Monad instance on ZipLists.

The ambiguity for lists resolves nicely enough. But in creating data types for concurrency, one runs into cases where you might want Applicative and Monad instances where `(<*>) /= ap`

. A really good example can be found in the Haxl paper. Haxl is a library developed by Facebook to manage data requests in a way to maximize concurrency for the sake of efficiency. In section 4 of the paper, we find out that for the type constructor `Fetch`

,

```
```Blocked (Done (+1)) <*> Blocked (Done 1) = Blocked (Done 2)
Blocked (Done (+1)) `ap` Blocked (Done 1) = Blocked (Blocked (Done 2))

I won’t go over the details here but the takeaway is that the Applicative can take advantage of looking at both arguments of `(<*>)`

which are both in Fetch while the Monad cannot because it must use `(>>=)`

the second argument of which is a function with pure input. So here we have an example of a law breaking Applicative/Monad. As with ZipList, there is no Monad instance which is compatible with the Applicative instance. So why not newtype? The motivation is that we want to be able to use concurrencly *implicitly* without the overhead of having to wrap and unwrap a newtype. Whether that justifies breaking the law is a judgment call. Notice however that the law breaks in a well defined way, that is `(<*>)`

is equal to `ap`

up to idempotency of `Block`

, the relation that ` Block . Block = Block `

.

I want to work through another example that was inspired by concurrency in Purescript.

First lets take care of the imports.

```
```import Control.Applicative
import Control.Concurrent
import Control.Concurrent.Async
import Control.Concurrent.MVar
import Control.Monad.IO.Class
import Data.Traversable
import Prelude hiding (mapM)
import System.Random

Annoyingly we have to hide either the `mapM`

from `Prelude`

or `Data.Traversable`

but this should be fixed by the Foldable/Traversable in Prelude proposal. The type constructor we’ll work with is for callbacks.

```
```newtype Callback a = Callback {runCallback :: (a -> IO ()) -> IO ()}

You should recognize that `Callback`

is isomorphic to `ContT () IO`

, so we can just crib the definitions of Functor and Monad instances from your favorite source. We’ll also give a MonadIO instance.

```
```instance Functor Callback where
fmap f c = Callback (\k -> runCallback c (k . f))
instance Monad Callback where
return a = Callback (\k -> k a)
c >>= f = Callback (\k -> runCallback c (\a -> runCallback (f a) k))
instance MonadIO Callback where
liftIO io = Callback (\k -> io >>= k)

For the Applicative instance we want to take advantage of the ability to do our IO side effects concurrently. Let’s see how this works.

```
```instance Applicative Callback where
pure a = Callback (\k -> k a)
cf <*> ca = Callback $ \k -> do
vf <- newEmptyMVar
va <- newEmptyMVar
let finish = do f <- takeMVar vf
a <- takeMVar va
k (f a)
race_ (runCallback cf (putMVar vf) >> finish)
(runCallback ca (putMVar va) >> finish)

Ok, so what’s going on the definition of `(<*>)`

? Well first we create new empty mutable variables in which we will store a function `f`

and a value `a`

to apply it to, but which we must perform some IO effects to get. `finish`

is where we perform the callback on the result. `finish`

looks a whole lot like `ap`

. The magic happens in the function `race_`

which is from Simon Marlow’s delightful async package. It runs two IO actions concurrently, canceling the loser. Because `finish`

blocks when either `vf`

or `va`

are empty, both callbacks are run concurrently with a `putMVar`

as the callback, filling up the variables. Then `finish`

will unblock and the first branch to complete it wins the race.

Let’s see the difference in performance between the Applicative and Monad instances on an example.

```
```square :: Int -> Callback Int
square n = do liftIO $ do let second = 10^6
random <- randomRIO (0 , second)
threadDelay random
let time = fromIntegral random / fromIntegral second
putStrLn $ "Squaring "
++ show n ++ " after "
++ show time ++ " seconds."
return (n^2)
main = do putStrLn "Traversing [1..10] using Monad"
runCallback (mapM square [1..10]) print
putStrLn "Traversing [1..10] using Applicative"
runCallback (traverse square [1..10]) print

And here’s an example of what the output looks like.

```
```Traversing [1..10] using Monad

Squaring 1 after 0.723773 seconds.

Squaring 2 after 0.603614 seconds.

Squaring 3 after 0.203097 seconds.

Squaring 4 after 0.535666 seconds.

Squaring 5 after 0.414605 seconds.

Squaring 6 after 0.807218 seconds.

Squaring 7 after 0.580662 seconds.

Squaring 8 after 0.715894 seconds.

Squaring 9 after 0.641902 seconds.

Squaring 10 after 0.180422 seconds.

[1,4,9,16,25,36,49,64,81,100]

Traversing [1..10] using Applicative

Squaring 4 after 4.8804e-2 seconds.

Squaring 5 after 0.140811 seconds.

Squaring 3 after 0.142185 seconds.

Squaring 7 after 0.373733 seconds.

Squaring 9 after 0.386626 seconds.

Squaring 8 after 0.393645 seconds.

Squaring 1 after 0.417399 seconds.

Squaring 6 after 0.780407 seconds.

Squaring 2 after 0.803894 seconds.

Squaring 10 after 0.96637 seconds.

[1,4,9,16,25,36,49,64,81,100]

The Monad is forced to perform the effects consecutively, taking up to 10 seconds (ignoring the time it takes to get a random number and to print). The Applicative performs the effects concurrently, taking only up to 1 second. So here’s another example where `(<*>) /= ap`

and we may be somewhat justified by the desire for implicit concurrency. Notice that it’s just the effects that are different, not the result. Said another way, if we bind `x <- mf <*> ma `

and `y <- mf `ap` ma`

then we have that `x = y`

so we’re breaking the law but not flagrantly.

curry :: ((a , b) -> c) -> (a -> b -> c)

uncurry :: (a -> b -> c) -> ((a , b) -> c)

But CCCs have another important property, they are endowed with a “terminal object”, that is an object t such that there is a unique function f :: a -> t for any a. In Haskell, the terminal object is (), called unit, and it has only one value, also (), and hence only one (polymorphic) function to it, the constant function \ x -> (). If you think about Cartesian products with any number n of factors (a1 , a2 , .. , an), you can think of () as the special case with 0 factors. And just like we can generalize currying to functions with any number n > 2 of arguments, we can think about “zurrying” functions with 0 arguments.

zurry :: (() -> a) -> a

unzurry :: a -> (() -> a)

zurry f = f ()

unzurry x = \ () -> x

What does that give us? Well, nothing, but it lets us recognize that function evaluation is really just a zurried form of function composition.

unzurry (f x) = f . (unzurry x)

So function evaluation isn’t really first class, and since this is Functional Programming, maybe we should think of everything as a function, by unzurrying if necessary!

P.S. When working with a monad, you work in its Kleisli category which is another example of a CCC. The above discussion relating function evaluation to function composition, would then relate Kleisli evaluation (>>=) to Kleisli composition (>=>).

]]>data Zipper a = Zipper [a] a [a]

(List) zippers are a way of looking at lists with a focus at a particular element. It should be obvious that we might want to get or set that focus, so that zippers come naturally adorned with lenses.

get :: Zipper a -> a

set :: Zipper a -> a -> Zipper a

lens :: Zipper a -> (a , a -> Zipper a)

get Zipper ls x rs = x

set (Zipper ls x rs) y = Zipper ls y rs

lens z = (get z , set z)

The other natural operations on zippers is list traversal. The zipper had three parts, the part of list to the left, the focus, and the part of the list to the right. (Clowns to the left of me, jokers to the right.) The left part is assumed to be in reverse order, so that its head is next to the focus.

toList :: Zipper a -> [a]

goLeft :: Zipper a -> Zipper a

goRight :: Zipper a -> Zipper a

toList Zipper ls x rs = (reverse ls) ++ (x:rs)

goLeft Zipper ls x rs = Zipper (tail ls) (head ls) (x:rs)

goRight Zipper ls x rs = Zipper (x:ls) (head rs) (tail rs)

So, how are zippers an example of a comonad? Define extract (coreturn) and duplicate (cojoin) like so.

extract :: Zipper a -> a

duplicate :: Zipper a -> Zipper Zipper a

extract = get

duplicate z = Zipper (tail $ iterate goLeft z) z (tail $ iterate goRight z)

What is duplicate of a zipper? Its focus is the zipper itself, but its other parts are all the other possible zippers for the underlying list, with their foci shifted according to their distance from the focus zipper. Maybe a better word for “duplicate” would be “diagonal”, since you can visualize it by putting copies of the list next to each other, then drawing a diagonal line through their foci. Indeed, this is closely related to various morphisms in topology and algebra that all go by the name “diagonal map”.

Nota bene: Zippers only really make sense for infinite lists, because in a finite list you can’t go left or right indefinitely, so for finite lists you have to work around with Maybes or special cases. I’m sure this has something to do with the distinction between data and codata. Finite lists are data and form a monad (the familiar one) while infinite lists (streams) are codata and form a comonad.

]]>Consider planar diagrams, that is curves in the plane. These are like tangle diagrams only without self-intersections, i.e. no crossings. Just like tangles, they form a monoidal category since we can place them side by side or atop each other. Also just like tangles they have duality cups and caps.

Inspired by the definition of the Kauffman bracket, we extend the category of planar diagrams by linear combinations with coefficients polynomials in and mod out by the circle relation:

This gives a braiding and twist as in the calculations for the Kauffman bracket.

The resulting ribbon category is called the Temperley-Lieb category, named for mathematicians who studied its implications in the context of statistical mechanics.

Now we have two examples of ribbon categories, the category of tangles and the Temperley-Lieb category. How else can we generate examples of ribbon categories? Recall that the category of finite dimensional vector spaces and linear maps formed a monoidal category with duals. We consider the subcategory of representations of an algebra .

An algebra is a vector space in which we have a multiplication and unit with the familiar properties of associativity and unitality. For example, given a vector space the space of endomorphisms of , that is linear maps , forms an algebra where our multiplication is composition of linear maps and our unit is the identity map . is a representation of iff there is a linear map which preserves multiplication and unit.

A Hopf algebra, in addition to having a multiplication and unit, also has maps called comultiplication, counit which are coassociative, and counital where is the field of scalars. This guarantees that the category of finite dimensional representations of is monoidal since we can define representations and . We also require a map called the antipode which switches the order of multiplication and is the convolution inverse to the identity. This guarantees that has left duals with .

If there are elements such that is a braiding, where is the swap map and where is a twist, then we call a ribbon Hopf algebra. Clearly then is a ribbon category.

Surprisingly, ribbon Hopf algebras turn up in the study of Lie algebras. One may “quantize” a Lie algebra, deforming it by a formal parameter meant to mimic Plank’s constant and the result is a ribbon Hopf algebra. This discovery led to a whole slew of new invariants and a new understanding of old invariants. For instance the Jones’ polynomial and the Kauffman bracket are related to the quantization of the most basic Lie algebra . Invariants of tangles derived from quantized Lie algebras are called Reshetikhin-Turaev invariants or simply quantum invariants. When applied to links they give polynomials in a variable .

]]>To begin to understand this deep statement we must start with the definition of a category. A category is a set of objects along with a class (for technical reasons a class, not a set) of morphisms . Each morphism has a source object and a target object so that we can think of a morphism as an arrow . There is a composition operation of morphisms which is defined only if the source of is the target of . There is also an identity morphism for every object whose source and target are both . Finally we require that composition be associative and unital .

Tangles form morphisms in a category. Just let the objects be points in a plane; then clearly tangles form morphisms with their bottom endpoints as source and their top endpoints as target (or vice versa, it’s just a convention). We can compose tangles by placing them one atop the other, so long as their sources and targets match up. Identity tangles are simply a bunch of vertical lines connecting matching top and bottom endpoints. Clearly, associativity and unitality hold so tangles do indeed form a category.

We can form a category of tangles with a completely different composition however. Instead of placing tangles atop each other, we can place them side by side. Now the empty tangle is the identity. Also, in this category there is only 1 object since we can always place tangles next to each other; there’s nothing to match up! Something with 2 different categorical structures like this is called, logically enough, a 2-category. But, as we said, the second category structure has a unique object. These kinds of 2-categories are so common they get their own name, monoidal categories. Thus, tangles form the morphisms of a monoidal category.

Actually, that’s not the end of the story! We could put the tangles side by side in different ways, since the endpoints live in planes, we have 2 dimensions to work with. The two independent ways of placing tangles next to each other in addition to the standard composition of placing them atop each other turn tangles into a 3-category. Since both ways of putting tangles next to each other can be done without worrying about matching this is a special kind of 3-category called a doubly monoidal category. Doubly monoidal categories always have a way of transforming the monoidal product (side-by-side placement) into its opposite (side-by side placement but in the reverse order). This comes from the fact that the 2 monoidal structures are essentially the same. Try to think about why this is true for tangles.

Let’s think about how to transform two points sitting side by side into the same two points sitting in the opposite order. As we transform in two dimensions rotating one around the other, we trace out the familiar crossing. Of course we can rotate them in the other direction and get the other crossing.

In general, this sort of thing is called a braiding, and doubly monoidal categories always have them. For this reason, they’re also called braided monoidal categories.

Orientation means that the endpoints of our tangle are more than just points. They have directions associated with them, either up or down. We call this a dual structure, since the dual of up is down. This is familiar from linear algebra where to each vector space we can associate a dual vector space of linear maps from to the field of scalars. The important structure relating vector spaces and their duals are the evaluation and coevalutation maps. Evaluation takes a dual vector and a vector and evaluates to the scalar . Coevaluation makes use of the isomorphism where is the space of endomorphisms of . The coevaluation takes a scalar to that scalar multiple of the identity. Now, we have the same sort of structure morphisms in the category of tangles, the caps and cups. This makes the category of tangles a monoidal category with duals, just like the category of linear transformations of vector spaces.

Since cups and caps may be oriented in 2 different ways, we have 2 dual structures, a left and a right dual. The same can be said of the category of vector spaces but there, one simply identifies left and right duals. In the category of tangles it’s not so easy. Instead one must build a natural isomorphism between left and right duals and for this you need a twist. A twist is what it sounds like, take your endpoints and twist them around 360 degrees. This is where framing comes into play. If you do this to a single endpoint, you get a ribbon with a full twist in it. This has a blackboard diagram that looks like either side of the framed Reidemeister 1 move.

What if you had 2 endpoints? Think about this for a bit, you get 2 crossings between 2 ribbons each of which has a full twist in it. Luckily this is the compatibility condition between the braiding and the twist that is required of a so-called ribbon category.

To recap, a ribbon category is a braided monoidal category with duals and a twist. All of these may be defined algebraically but have intuitive topological definitions in the category of tangles. The fact that algebra may be thought about topologically can be rigorously summed up in the statement of Shum’s theorem given at the beginning of the post: framed, oriented tangles form the morphisms of a free ribbon category on a single generator.

]]>Before I learned about Mekentosj Papers, I used to organize papers by bookmarking their arxiv webpages. I also downloaded the pdfs haphazardly into my file system, usually renaming them from cryptic things like 012345.pdf to lastnames-title.pdf. My “system” was not simple, scalable or searchable. I downloaded the trial of Papers on recommendation from a colleague and imported all of my pdfs into the program with a simple drag and drop. Then I immediately used what is probably the coolest feature of Papers, matching the pdfs with their appropriate metadata. Papers has the ability to search the arxiv, download metadata, and then link it to your papers. You can then organize your papers easily by titles, authors, journals, or dates and you can view the abstracts easily. When matching a paper with its metadata, the program has a very pleasant animation and sound effect and stupid though it may be, this is what sold me on Papers. It feels like an Apple program (in a good way). It’s supposed to be like iTunes for your pdfs but I hate iTunes. Papers is way better.

Papers costs $40 but you can get a student discount about $14 off. There are frequent updates removing bugs and adding features. One of the coolest features that was added subsequent to my initial conversion is an iPhone companion app. The app cost me $10 but it was worth it, even though I usually don’t pay more than $1 for an app. It replicates most of the features of the desktop app. It even wirelessly syncs with the desktop application; iTunes eat your heart out. I now have 87 papers which I organize and read in Papers, at home or on the go.

For me, LyX is to writing math what Papers is to reading math. I know how to typeset LaTeX. You pretty much can’t do math these days without knowing. But even if you don’t know, you can still use LyX, a wysiwym program for generating LaTeX documents. Wysiwym stands for “what you see is what you mean”, a play on the usual wysiwig (“get” vs. “mean”) paradigm. With LyX you get the features of LaTeX, namely being able to generate content without over-worrying about presentation, along with instant preview, i.e. no need to compile the LaTeX file and generate a pdf. You can use the menu items to write mathematical notation or you can directly type LaTeX commands which instantly compile inline! This is about a million times better than compiling every couple of lines to check that you haven’t introduced any bugs in your code and you can also use the menu items when you inevitably forget some code. LyX has most of the features you find in LaTeX. For instance, I use the plugin Xy-pic a lot and it works just fine in LyX with instant previews and everything.

LyX is free as in speech or beer, which is a huge plus, even though I’d be willing to pay for it. It works on any platform (Windows, or Unices) but still integrates well in OS X. The developers are active and updates quash bugs.

In this post I want to talk about two applications I use which are critical to my workflow, Mekentosj Papers and LyX. Papers is an organizer for your academic papers and is only available for Mac OS X. LyX is a wysiwyg LaTeX editor and is available for pretty much any platform.

Before I learned about Mekentosj Papers, I used to organize papers by bookmarking their arxiv webpages. I also downloaded the pdfs haphazardly into my file system, usually renaming them from cryptic things like 012345.pdf to lastnames-title.pdf. My “system” was not simple, scalable or searchable. I downloaded the trial of Papers on recommendation from a colleague and imported all of my pdfs into the program with a simple drag and drop. Then I immediately used what is probably the coolest feature of Papers, matching the pdfs with their appropriate metadata. Papers has the ability to search the arxiv, download metadata, and then link it to your papers. You can then organize your papers easily by titles, authors, journals, or dates and you can view the abstracts easily. When matching a paper with its metadata, the program has a very pleasant animation and sound effect and stupid though it may be, this is what sold me on Papers. It feels like an Apple program (in a good way). It’s supposed to be like iTunes for your pdfs but I hate iTunes. Papers is way better.

Papers costs $40 but you can get a student discount about $14 off. There are frequent updates removing bugs and adding features. One of the coolest features that was added subsequent to my initial conversion is an iPhone companion app. The app cost me $10 but it was worth it, even though I usually don’t pay more than $1 for an app. It replicates most of the features of the desktop app. It even wirelessly syncs with the desktop application; iTunes eat your heart out. I now have 87 papers which I organize and read in Papers, at home or on the go.

For me, LyX is to writing math what Papers is to reading math. I know how to typeset LaTeX. You pretty much can’t do math these days without knowing. But even if you don’t know, you can still use LyX, a wysiwym program for generating LaTeX documents. Wysiwym stands for “what you see is what you mean”, a play on the usual wysiwig (“get” vs. “mean”) paradigm. With LyX you get the features of LaTeX, namely being able to generate content without over-worrying about presentation, along with instant preview, i.e. no need to compile the LaTeX file and generate a pdf. You can use the menu items to write mathematical notation or you can directly type LaTeX commands which instantly compile inline! This is about a million times better than compiling every couple of lines to check that you haven’t introduced any bugs in your code and you can also use the menu items when you inevitably forget some code. LyX has most of the features you find in LaTeX. For instance, I use the plugin Xy-pic a lot and it works just fine in LyX with instant previews and everything.

LyX is free as in speech or beer, which is a huge plus, even though I’d be willing to pay for it. It works on any platform (Windows, or Unices) but still integrates well in OS X. The developers are active and updates quash bugs.

Finally, let me say that I have issues with both programs. They’re not perfect. Nevertheless, they make my life so much easier and they are both pleasures to use.

]]>The Lie algebra is just the set of imaginary numbers with trivial Lie bracket . The local potential is a real-valued 1-form defined by . The local field strength is defined by .

A change of gauge is given by with . We see that local connections are related by , so that local potentials are related by . Local curvatures are related by , so that local field strengths are related by . This means that the field strength is globally defined on .

By the Bianchi identity we have so , so the homogeneous Maxwell equation comes along for free. We can get the inhomogeneous Maxwell equation by requiring that .

Now, consider the action on given by multiplication . Associated to our principal bundle we get a vector bundle with fiber with an induced connection locally given by . We will write sections of the associated bundle as . We can define the d’Alembert operator . If we require the Klein-Gordon equation, , then we have a theory of a charged spin-0 particle coupled to electromagnetism.

In order to couple electromagnetism to more interesting particles like Dirac’s electron, we need to incorporate spin somehow.

Consider the matrix group , i.e. matrices such that where , or equivalently for any events in Minkowski spacetime. This group has 4 connected components coming from and or . The component containing the identity is called the proper, orthochronous Lorentz group . Physically it contains all rotations, and boosts (Lorentz tranformations) and so .

We can cover by the simply connected group , i.e. complex matrices with . First we identify Minkowski spacetime with the space of Hermitian matrices, i.e. matrices such that , in such a way that if is the Hermitian matrix identified with the event then . Then we can define a covering map by identifying with . We have that since

. It can be shown that is a 2-1 homomorphism of Lie groups.

Now, there are two important irreducible representations for on , the “spin ” representations given by multiplication and multiplication by the adjoint . The Dirac representation is the direct sum of these representations .

Let be the orthonormal frame bundle for spacetime. Its fibers are ordered orthonormal bases of , or equivalently isometries . There is a right action of given by right composition which makes the frame bundle an -bundle. We say that is space and time orientable iff has 4 components and a choice of component is a space and time orientation. Then the restriction is an -bundle.

The solder form is an -valued 1-form on given by . The torsion of a connection on is . It turns out that there is a unique connection whose torsion is . This is the Levi-Civita connection .

A spin structure on is a manifold and a smooth map such that is an -bundle with . We can define a connection on by where is the isomorphism of Lie algebras induced by .

Now consider sections of the vector bundle associated to by the Dirac representation. Dirac’s idea was to introduce an operator such that , i.e. the Dirac operator is the “square root” of the d’Alembert operator. A full understanding of the Dirac operator requires Clifford algebras, i.e the algebra generated over Minkowski space modulo . It turns out that the smallest representation of this Clifford algebra is 4-dimensional which is why we need a 4-dimensional representation of as well. Then we can define the Dirac operator as where is the connection associated to and we inner product them somehow.

In more detail for the d’Alembertian on Minkowski spacetime, , define

We can work out that .

Then we demand that the Dirac equation holds, . This gives us a theory of a spin- particle, an electron or positron, but we have not yet coupled it to electromagnetism.

Right now, our notion of an electron is that it is a field which takes its values in a representation of the spin group . In order to couple to the electromagnetic field, we will rather think of the electron taking its values in a representation of the charged spin group .

We can splice a -bundle with a -bundle . Define and by . This is a -bundle with . Given connections on , we can define a connection on by with given by .

Splice together our -bundle with and also splice with . Consider the representation of on given by combining the Dirac representation with multiplication by . This structure is -invariant so defines a -bundle. We get an associated vector bundle with an associated connection and Dirac operator . A charged electron coupled to electromagnetism is then a section for which the Dirac equation holds.

]]>Maxwell’s equations in relativistically covariant form are

Since we can define a 2-form . We can also define a 1-form . Then we can re-express Maxwell’s equations using exterior differentiation and the Hodge star.

The continuity equation then follows from the inhomogeneous Maxwell equation. We expect from the homogeneous Maxwell equation that . In fact this is only true **locally**. This means that for every event in our spacetime there is an open set with and a 1-form on with . This follows from Poincare’s lemma.

We cannot say the exists globally. For instance if , the area form of the unit sphere in spherical coordinates, then since by antisymmetry of wedge product of 1-forms. Also, taking to be the unit sphere, we know that . However, by Stokes’ Theorem, if then . So, we cannot have globally.

Physically we interpret this as a magnetic monopole with magnetic charge and worldline, the time axis, . Mathematically, what is happening is that the complement of the time axis has nontrivial topology. Specifically its second de Rham cohomology is nontrivial. Intuitively, there is a kind of 2-dimensional, spherical “hole” in the complement of the time axis.

In addition to being nonglobal, the potential is defined only up to addition of a closed 1-form since . We would like to find a global mathematical object corresponding to the potential which doesn’t depend on our “choice of gauge”. This is our motivation for understanding connections on principal bundles.

We will assume is a group of matrices. A principal -bundle is a smooth surjection of manifolds with a free transitive right action of on such that and for any there is an open set with and a diffeomorphism called a “local trivialization” such that . Local trivializations correspond to the physical notion of “choice of gauge”.

Intuitively, is a manifold composed of copies of the group parametrized by the base space . A good example is the boundary of the Mobius strip which can be thought of as a -bundle over .

A useful notion is that of a local section with an open set with such that . It can be shown that there is a canonical 1-1 correspondence between local sections and local trivializations .

Define transition functions by where . This is well defined since . Transition functions correspond to the physical notion of “change of gauge”. We can relate any two local sections by .

Let be the Lie algebra for . A connection is a -valued 1-form on such that if If and is the tangent field on given by , then . Also we require that .

We define local connections on by . Local connections are related by .

We define curvature meaning . We can define local curvature by . Local curvatures are then related by . The Bianchi identity says .

We are now in a position to define electrodynamics on a principal bundle.

]]>For a given crossing, we can perform an operation called resolving or smoothing the crossing. We can do this in two ways.

Let us suppose that there is a polynomial invariant of links in variables so that concentrating on a neighborhood of a crossing in a diagram for , we have that the following relation, called the skein relation, holds.

Performing smoothings on all crossings reduces a link diagram to some number of circles in the plane. Let’s require that adding a circle to a link diagram gives . Finally we require a normalization, that for the empty link . From this we can deduce that the bracket of circles is .

We need to check invariance under Reidemeister moves. Let’s start with Reidemeister 2.

Thus, in order for the bracket to be invariant we must have and . Solving for in terms of , we get .

The nice thing now is that Reidemeister 3 comes along for free by using invariance under Reidemeister 2.

Performing Reidemeister 1 on the other hand does not leave the bracket invariant. However, we can see that opposite Reidemeister 1 moves cancel so that the bracket is invariant under the framed Reidemeister 1 move.

Consequently, the bracket is an invariant of framed links whose values are polynomials in and . To calculate it, take a blackboard diagram for the framed link and apply the skein relation, the circle relation and the normalization relation until you reach the answer.

The bracket was introduced by Kauffman as an elementary way to define Jones’ polynomial, an invariant of oriented links which was originally derived using some difficult algebra. We can define the Jones’ polynomial by . Here, the total writhe is the sum of signs of all crossings in the diagram and it is this factor which makes now invariant under Reidemeister 1 moves.

The Kauffman bracket and Jones’ polynomial are very closely related, in a similar way to how the writhe and linking numbers are closely related. Following the discovery of the Jones’ polynomial, there was a great deal of interest in knot theory. The Jones’ polynomial showed new connections between topology on the one hand and representation theory and quantum physics on the other.

]]>An invariant is some mathematical object, like a number or a polynomial that we can associate to tangles (or links, or knots) that depends only on the tangle-type. For instance the component number of a tangle doesn’t change when the strings move about or are stretched. Therefore, it is an invariant.

The component number is rather a blunt invariant. What if we want to tell the difference between tangles with the same component number? Let’s define an invariant for links with component number 2. We will call it the linking number. The linking number is actually an invariant for “oriented” links with component number 2. Oriented means that each string in the tangle comes with a preferred direction. We indicate this in a diagram by drawing an arrow on each string.

Whenever two different strings cross we can use the right hand rule to assign a positive or negative value to the crossing. Put your thumb in the direction (according to the orientation) of the over-strand and your fingers in the direction of the under-strand. If your palm is facing up (away from the screen) then it is a positive crossing and if your palm is facing down (towards the screen) then it is a negative crossing.

Now think of our link as having components (strings) called A and B. The linking number Lk(A,B) is the sum of the signs of the crossings in which A crosses over B. In order to see that the linking number is an invariant we need to analyze its behavior under Reidemeister moves.

Consider the first Reidemeister move. The left part of the equation has a crossing, but it comes from only 1 component, so it contributes 0 to the linking number. The same applies to the right part of the equation. The middle part of the equation has no crossings and so it contributes 0 to the linking number. Thus the linking number is invariant under Reidemeister 1.

Consider the second Reidemeister move. There are two cases, either the strands come from the same component or different components. In the first case, the left side of the equation contributes 0 to the linking number. In the second case, no matter which orientation there is on the strands, the two crossings have opposite signs and so contributes 0 to the linking number. In either case, the right side of the equation has no crossings and so contributes 0 to the linking number. Thus the linking number is invariant under Reidemeister 2.

Consider Reidemeister 3. Notice that each pair of strands cross in the same way but in different places on each side of the equation. Thus, no matter which components the strands belong to, nor which orientation we give them, each side contributes the same to the linking number. Thus the linking number is invariant under Reidemeister 3.

Thus, the linking number Lk(A,B) is an invariant of 2 component oriented links. Even better, it’s symmetric Lk(A,B)=Lk(B,A). So we can calculate it by summing the signs of the crossings where B crosses over A.

We can easily calculate the linking number for the oriented Hopf link pictured above, Lk(A,B)=-1.

What happens if we try to calculate the self-linking number of a knot Lk(K,K). Unfortunately it is no longer invariant under Reidemeister 1, since the argument we had used to prove invariance required that we were calculating linking number Lk(A,B) between different components A and B. You can see that the arguments for Reidemeister 2 and 3 did not require that the components were different so that the self-linking number, which we shall call the writhe Wr(K)=Lk(K,K), is invariant under Reidemeister 2 and 3. Furthermore, it does not depend on the orientation, since switching the orientation will not change the sign of a crossing (the orientation switches on both strands, so the sign is preserved).

In order to remedy the problem of non-invariance of the writhe under Reidemeister 1, we introduce a new property of tangles, “framing”. If orientation can be thought of as arrows going parallel to the tangle, then framing can be thought of as arrows going perpendicular to the tangle. If we extend the tangle along these arrows we obtain a “ribbon”, that is a tangle whose components are 2-dimensional surfaces. Now the self-linking number makes sense, as the linking number of the two edges of the ribbon.

We can project framed tangles in such a way that the ribbon is flattened in the projection. Then we need only draw the ribbon using a string as before and we can extend that string perpendicularly in the plane of projection. The resulting framing is called the “blackboard framing”. Such diagrams represent equivalent tangles if and only if they are connected by a sequence of Reidemeister 2 & 3 moves and the framed Reidemeister 1 move.

Notice that no matter what orientation is chosen, both sides have negative crossings. Since the sign of the crossing cannot change, the writhe is invariant under framed Reidemeister 1. Thus, the writhe, Wr(K), is an invariant of framed knots.

We have introduced two interesting new invariants, the linking number Lk(A,B) and the writhe Wr(K) but in order to do so we had to add more structure to tangles, orientation and framing. That these structures are natural as well as closely related is hinted at by our study of invariants. The linking number is sensitive to orientation but not framing and the writhe is sensitive to framing but not orientation. We will have more to say about these features of tangles in the future.

]]>