# Path calculus

## Introduction

This section will introduce **path calculus**. Path calculus is the simple formalism that extends the so-called **calculus of finite differences** to the setting of functions defined on the vertices of quivers. In the subsequent section, we will explain how to generalize path calculus into the realm of **path algebra**, where finite differences become linear operators on a vector space of paths. But for now, the constructions will be elementary and straightforward.

How do we set up calculus on cardinal quivers? Before beginning, it is obvious that we should expect something that looks more like the **calculus of finite differences** than the more familiar **infinitesimal calculus** employed for continuous functions. Philosophically, the individual edges of a lattice quiver *are* the equivalent of infinitesimals from a suitably “zoomed out” perspective.

All the following examples will be hosted on a relatively simple lattice quivers. We’ll start with the one-dimensional line lattice, and move later to the square and triangular lattices to illustrate the generalization to multiple cardinals and hence dimensions.

## One dimensional lattices

To start, our base lattice will be **line lattice**, written \(\quiver{L}\), which has the attractive pedagogical property that it will act like the discrete equivalent of the *real number line* on which continuous one-dimensional functions are usually defined.

We’ve labeled the vertices with integers, with 0 for the origin vertex. We’ll refer to the vertices of \(\quiver{L}\) as \(\vertices{\quiver{L}} = \vertexList(\quiver{L})\).

## Vertex fields

A **vertex field** on \(\quiver{L}\) is a function \(\functionSignature{\function{\vertexField{f}}}{\vertices{\quiver{L}}}{\baseField{K}}\), where \(\baseField{K}\) is a field (or commutative ring). We write the space of all vertex fields \(\functionSpace{\vertices{}}{\baseField{K}}\).

The word *field* here is serving two different roles, of course: the *field* in “vertex field” is analogous to a scalar field in physics: a single value at each point in space, whereas the *field* in “\(\baseField{K}\) is a field*”* refers to a field of scalar values in the sense of algebraic ring with inverses. Of course, vertex fields form a field in their own right under pointwise multiplication, addition, and inversion, so the pun is in some sense accurate.

We’ll initially consider only *finite* fields \(\baseField{K} = \finiteField{p}\), which will allow us to visualize vertex fields as colorings of vertices. For \(\sym{p}=2\) we’ll use white for 0 and black for 1, and for \(\sym{p}=3\) we’ll use white for 0, red for 1, and blue for −1. For \(\sym{p}>3\), the cyclic property of these finite fields will be represented with colors that cycle through the visible spectrum.

Here are two vertex fields \(\vertexField{u}\) and \(\vertexField{v}\) we’ll use to illustrate various operations:

We can form sums and products of these vertex fields, defined vertex-wise:

## Translation operator

We now introduce the **translation** operator \(\pathTranslate{}{\vertexField{u}}\), which translates the vertex field \(\vertexField{u}\) along the cardinal \(\card{x}\). Later we’ll define this operation for quivers with more than one cardinal, and generalize it to allow translation along arbitrary paths.

Notice that the vertex fields \(\vertexField{u}\) and \(\vertexField{v}\) have been “shifted over” to the right. Similarly we can define the **backward translation** operator \(\pathBackwardTranslate{}{\vertexField{u}}\):

## Finite differences

We can use these translation operators to define the **forward finite difference** of a vertex field \(\vertexField{u}\), written \(\forwardDifference{}\,\vertexField{u}\).

The operation \(\forwardDifference{}\,\vertexField{u}\) is defined to be \(\forwardDifference{}\,\vertexField{u} = \vertexField{u} - \pathTranslate{}{\vertexField{u}}\), and can be thought of as *comparing* the translated and untranslated versions of \(\vertexField{u}\):

The single red vertex in the center indicates that the vertex field \(\vertexField{u} = \list{\ellipsis ,0,0,1,1,1,\ellipsis }\) has a “step change”, yielding \(\forwardDifference{}\,\vertexField{u} = \list{\ellipsis ,0,0,1,0,0,\ellipsis }\). In terms of 1D discrete functions, the picture is:

Similarly we can define the **backward finite difference** to be \(\backwardDifference{}\,\vertexField{u} = \pathBackwardTranslate{}{\vertexField{u}} - \vertexField{u}\), illustrated below:

The worked calculation is shown below:

We can again visualize this as a finite difference of a 1D discrete function:

Finally we can define the **central difference** \(\centralDifference{}\,\vertexField{u} = \forwardDifference{}\,\vertexField{u} + \backwardDifference{}\,\vertexField{u}\), which simplifies to \(\pathBackwardTranslate{}{\vertexField{u}} - \pathTranslate{}{\vertexField{u}}\)

The 1D discrete function interpretation:

### Second order differences

It is perfectly well defined to apply the \(\centralDifference{}\) operators multiple times, which we’ll write as \(\centralDifference{}\,\centralDifference{} = \centralDifference{}_2\), etc.

Let’s visualize the behavior of the second order forms of the three operators:

### Liebniz’s rule

In traditional calculus, we have the famous **Leibniz** (or **product**) **rule**: \(\partialdof{\function{f} \, \function{g}} = \function{f} \, \partialdof{\function{g}} + \function{g} \, \partialdof{\function{f}}\).

Does the same rule hold for the finite difference of a product \(\vertexField{u} \, \vertexField{w}\) of vertices fields \(\vertexField{u}\), \(\vertexField{w}\) on the line lattice? The following table illustrates on the first row example vertex fields \(\vertexField{u}\), \(\vertexField{w}\) and their product \(\vertexField{u} \, \vertexField{w}\), on the second row the central finite difference of them individually, and of their product, and on the third row the two terms of the ordinary product rule, and their sum.

As we can see, the two bolded expressions are different, so the “naive” form of the Leibniz rule does not hold.

Luckily, it is straightforward to derive a modified form of the Leibniz rule, involving translations of one or both of the products. There are in fact *two, equivalent* versions of this modified form for each derivative, which one might call the ‘forward’ and ‘backward’ forms:

Again, notice that the naive Leibniz rule does not give the true derivative for each of the three cases, whereas both the left and right forms of the modified Leibniz rule *do*.

It is intuitive that in the “continuum limit” of slowly changing vertex fields on very large lattices, the effect of the infinitesimal translations like \(\pathTranslate{}{\vertexField{w}}\) can be ignored and replaced with the untranslated fields \(\vertexField{w}\). Doing this to the above modified Liebniz rules we pass to the classical Liebnitz rule, so for example in the case of the central difference:

\[ \pathTranslate{}{\vertexField{w}} \, \centralDifference{}\,\vertexField{u} + \pathBackwardTranslate{}{\vertexField{u}} \, \centralDifference{}\,\vertexField{w}\approxEqualSymbol \pathBackwardTranslate{}{\vertexField{w}} \, \centralDifference{}\,\vertexField{u} + \pathTranslate{}{\vertexField{u}} \, \centralDifference{}\,\vertexField{w}\approxEqualSymbol \vertexField{w} \, \centralDifference{}\,\vertexField{u} + \vertexField{u} \, \centralDifference{}\,\vertexField{w} \]## Two dimensional lattices

To continue our recapitulation of calculus, we next move to *multivariable calculus*. Taking the place of continuous functions of two real variables, we will have vertex fields on lattices with two cardinals.

Let’s start with the most intuitive, the **square lattice**:

This time, we will take finite difference separately in the two cardinals directions \(\rbform{\card{x}}\) and \(\gbform{\card{y}}\), with the cardinal writtein subscript form: e.g. for the central finite differences

z | z | z | z |
---|---|---|---|

difference along \(\rbform{\card{x}}\) | \(\pathCentralDifference{\card{x}}\) | \(\pathForwardDifference{\card{x}}\) | \(\pathBackwardDifference{\card{x}}\) |

difference along \(\gbform{\card{y}}\) | \(\pathCentralDifference{\card{y}}\) | \(\pathForwardDifference{\card{y}}\) | \(\pathBackwardDifference{\card{y}}\) |

These are defined as before, except now we use per-cardinal forward and backward translations:

z | z | z |
---|---|---|

translation along \(\rbform{\card{x}}\) | \(\pathLeftTranslate{\card{x}}\) | \(\pathLeftBackwardTranslate{\card{x}}\) |

translation along \(\gbform{\card{y}}\) | \(\pathLeftTranslate{\card{y}}\) | \(\pathLeftBackwardTranslate{\card{y}}\) |

Here we show the finite differences of three simple vertex fields \(\vertexField{u}\), \(\vertexField{v}\), \(\vertexField{w}\), shown on successive rows:

We can also take second order differences in multiple ways, show here in terms of the central difference applied to \(\vertexField{u}\). Note that we define second order differences to act in the order they appear in the subscript, so that e.g. \(\pathCentralDifference{\card{x},\card{y}} = \pathCentralDifference{\card{y}}\,\pathCentralDifference{\card{x}}\).

Notice that \(\pathCentralDifference{\card{y},\card{x}}\,\vertexField{u} = \pathCentralDifference{\card{x},\card{y}}\,\vertexField{u}\). In fact, this identity is true for all vertex fields. This is a consequence of the path relation \(\word{\rbform{\card{x}}}{\gbform{\card{y}}}\pathIso \word{\gbform{\card{y}}}{\rbform{\card{x}}}\), which implies that the translations \(\pathLeftTranslate{\card{x}}\) and \(\pathLeftTranslate{\card{y}}\) commute, which makes the proof of the identity elementary:

\[ \begin{aligned} \pathCentralDifference{\rbform{\card{x}},\gbform{\card{y}}}\,\vertexField{u} &= \pathBackwardTranslate{\rbform{\card{x}}}{\paren{\pathCentralDifference{\gbform{\card{y}}}\,\vertexField{u}}} - \pathTranslate{\rbform{\card{x}}}{\paren{\pathCentralDifference{\gbform{\card{y}}}\,\vertexField{u}}} \\ &= \pathBackwardTranslate{\rbform{\card{x}}}{\pathBackwardTranslate{\gbform{\card{y}}}{\vertexField{u}}} - \pathBackwardTranslate{\rbform{\card{x}}}{\pathTranslate{\gbform{\card{y}}}{\vertexField{u}}} - \pathTranslate{\rbform{\card{x}}}{\pathBackwardTranslate{\gbform{\card{y}}}{\vertexField{u}}} + \pathTranslate{\rbform{\card{x}}}{\pathTranslate{\gbform{\card{y}}}{\vertexField{u}}} \\ &= \pathBackwardTranslate{\gbform{\card{y}}}{\pathBackwardTranslate{\rbform{\card{x}}}{\vertexField{u}}} - \pathBackwardTranslate{\gbform{\card{y}}}{\pathTranslate{\rbform{\card{x}}}{\vertexField{u}}} - \pathTranslate{\gbform{\card{y}}}{\pathBackwardTranslate{\rbform{\card{x}}}{\vertexField{u}}} + \pathTranslate{\gbform{\card{y}}}{\pathTranslate{\rbform{\card{x}}}{\vertexField{u}}} \\ &= \pathBackwardTranslate{\gbform{\card{y}}}{\paren{\pathCentralDifference{\rbform{\card{x}}}\,\vertexField{u}}} - \pathTranslate{\gbform{\card{y}}}{\paren{\pathCentralDifference{\rbform{\card{x}}}\,\vertexField{u}}} &= \pathCentralDifference{\gbform{\card{y}},\rbform{\card{x}}}\,\vertexField{u}\\ \end{aligned} \]## Edge fields

Next, we are going to consider **edge fields** on the square lattice quiver \(\quiver{S}\), constructed similarly to the vertex fields \(\functionSpace{\vertices{}}{\baseField{K}}\).

An **edge field** on \(\quiver{S}\) is a function \(\functionSignature{\function{\edgeField{h}}}{\edges{\quiver{S}}}{\baseField{K}}\), where again \(\baseField{K}\) is a field or commutative ring, and \(\edges{\quiver{S}}\) is the set of edges of \(\quiver{S}\). We write the space of all edge fields as \(\functionSpace{\edges{}}{\baseField{K}}\).

#### Orientation

It's important that we consider these edges in a *directed* sense: an edge field is a *single* value associated with a given edge \(\elemOf{\edge{e}}{\edges{}}\), namely \(\edgeField{h}(\edge{e})\), but if we consider that edge in its negated oriention, we negate the corresponding value of the edge field: \(\edgeField{h}(\negated{\edge{e}}) = \minus{\edgeField{h}(\edge{e})}\). This interpretation is natural if we regard the edge field as representing a **flow** of some quantity, since the flow *along* a given edge will be negated if choose to measure it in the opposite orientation. We'll be on a firmer footing when we consider path algebra, so don't worry if this point seems vague right now.

#### Visualization

We will visualize edge fields using colored edges in the same fashion we used for vertex fields. Because they are naturally oriented by the orientation of the corresponding cardinals, a positive weight on an edge will be represented visually as a doubled-headed arrow in which the arrowhead in the forward direction is colored red, and the arrowhead in the backward direction is colored blue. The opposite applies when drawing a negative weight.

Here's an example of an edge field in which only two edges have non-zero weight: the horizontal edge has weight 1, and the vertical edge has weight -1. Alongside it is the original lattice quiver \(\quiver{S}\) to allow comparison with the orientation of the corresponding cardinals.

### Gradient

We can generate an edge field from a vertex field \(\functionSignature{\function{\vertexField{u}}}{\vertices{\quiver{S}}}{\baseField{K}}\) using the **gradient operator**, written \(\grad\). Formally, \(\grad\) is a map from the space of vertex fields to the space of edge fields, in other words \(\functionSignature{\function{\grad }}{\functionSpace{\vertices{}}{\baseField{K}}}{\functionSpace{\edges{}}{\baseField{K}}}\). It is defined edgewise as follows:

In other words, the gradient operator *measures the difference* between the value of \(\vertexField{u}\) at the head and tail of each edge.

Let's visualize the behavior of the gradient operator on some simple vertex fields:

### Divergence

Next we'll introduce the **divergence operator**, which is a kind of complementary operator to the gradient operator. The divergence operator is written \(\div\). The divergence operator operates on an edge field \(\functionSignature{\edgeField{h}}{\edges{}}{\baseField{K}}\) and produces a vertex field \(\functionSignature{\function{\div \,\edgeField{h}}}{\vertices{}}{\baseField{K}}\), in othe words we have \(\functionSignature{\function{\div }}{\functionSpace{\edges{}}{\baseField{K}}}{\functionSpace{\vertices{}}{\baseField{K}}}\).

It is defined vertexwise as follows:

\[ \function{\paren{\div \,\edgeField{h}}}(\vert{v}) = \indexSum{\edgeField{h}(\edge{e})}{\headVertex(\edge{e}) = \vert{v}}{} - \indexSum{\edgeField{h}(\edge{e})}{\tailVertex(\edge{e}) = \vert{v}}{} \]We can define it more elegantly using the **path Kronecker**, \(\functionSignature{\function{ \Xi }}{\tuple{\edges{},\vertices{}}}{\baseField{K}}\), defined as:

Using \(\function{ \Xi }\) we can express \(\div\) vertexwise as a kind of **convolution**:

Let's apply the divergence operator to some example edge fields:

### Laplacian

An interesting quantity is the divergence of the gradient, \(\laplacian = \div \,\grad\), called the **Laplacian**. Let's evaluate it on a simple vertex field:

The weights for vertex field \(\laplacianOf{\vertexField{u}}\) are \(+4\) for the central red vertex and \(-1\) for the surrounding blue vertices. This can be explained by counting the number of incident edges for the central vertex you can see in \(\gradOf{\vertexField{u}}\): there are 4. There is only one incident edge for the outer vertices.

We will have more to say about this at a later stage, particular in its connection with vertex colorings of lattices.

### Curl

The operator analogous to **curl** in vector calculus will have to wait until we have the machinery of path algebra to guide us. This is largely due to the fact that curl itself is just the tip of the iceberg, more generically handled using the idea of the **exterior calculus** (or, largely equivalently, **geometric algebra**). We will therefore leave this topic aside for now, although we'll see hints of it below.

## Integration

We've covered some basic territory in terms of finite-differential calculus. What about integration?

The staring point here is the notion of the **path integral** of an edge field \(\elemOf{\edgeField{h}}{\functionSpace{\edges{}}{\baseField{K}}}\) along a path \(\path{P}\), written \(\pathIntegral{\path{P}}{\edgeField{h}}\).

Let's visualize this idea for an arbitrary \(\edgeField{h}\) and \(\path{P}\):

We first "split" \(\path{P}\) into its constituent edges (each edge having weight one), and then multiply them edgewise with \(\edgeField{h}\):

The summed weight of this product vector is the result of the integral, in this case, the sum of three negative weights and one positive weight.

We can write this succintly in the following way:

\[ \pathIntegral{\path{P}}{\edgeField{h}} = \pathDot{\split(\path{P})}{\edgeField{h}} \]Here, the **dot product** or **inner product** between two edge fields is the map \(\functionSignature{\function{\pathDotSymbol{}}}{\tuple{\functionSpace{\edges{}}{\baseField{K}},\functionSpace{\edges{}}{\baseField{K}}}}{\baseField{K}}\) defined to be the sum of products of their edge weights:

### Fundamental theorem of discrete calculus

We can now make a rather trivial observation about the gradient edge field of a vertex field \(\vertexField{u}\). Let's calculate the result of a path integral on \(\gradOf{\vertexField{u}}\):

\[ \begin{aligned} \pathIntegral{\path{P}}{\paren{\gradOf{\vertexField{u}}}} &= \pathDot{\split(\path{P})}{\paren{\gradOf{\vertexField{u}}}}\\ &= \indexSum{\suchThat{\function{\paren{\gradOf{\vertexField{u}}}}(\edge{e})}{\elemOf{\edge{e}}{\path{P}}}}{\edge{e}}{}\\ &= \indexSum{\suchThat{\vertexField{u}(\vert{y}) - \vertexField{u}(\vert{x})}{\elemOf{\de{\vert{x}}{\vert{y}}}{\path{P}}}}{\vert{x},\vert{y}}{}\\ \end{aligned} \]In other words, the integral is the sum of differences of values of \(\vertexField{u}\) along the edges of the path \(\path{P}\). But these will cancel in pairs, since:

\[ \support(\path{P}) = \list{\de{\vert{x_1}}{\vert{x_2}},\de{\vert{x_2}}{\vert{x_3}},\ellipsis ,\de{\vert{x_{\sym{n} - 1}}}{\vert{x_{\sym{n}}}}} \]And hence the integral is determined by the difference between the value of \(\vertexField{u}\) at the head and tail of \(\path{P}\).

\[ \pathIntegral{\path{P}}{\paren{\gradOf{\vertexField{u}}}} = \vertexField{u}(\headVertex(\path{P})) - \vertexField{u}(\tailVertex(\path{P})) \]This rather banal calculation amounts to a discrete version of the **fundamental theorem of calculus** for a function of one variable. Note the important consequence that if \(\path{P}\) is a closed path, then by definition \(\headVertex(\path{P}) = \tailVertex(\path{P})\), and the integral is zero.

You may have noticed that we have played a little fast and loose here: in particular, the operation \(\split\) seemed to produce an edge field that didn't have the customary double arrowheads, and this feature was reflected by the product of it with the integrand edge field. There is good reason for this, and to understand what is going on we will have to develop path algebra. This will then allow us to formulate an appropriate discrete version of the **generalized Stoke's theorem**, an important milestone in "multicardinal calculus".