Blog Archive

Sunday, July 5, 2026

The Free Smooth Ring Monad and Codifferential Category

Codifferential Categories: Definition, Axioms, and the Free Smooth Ring Monad

This is a learning note on codifferential categories.

The goal is to understand the definition first, including the axiom diagrams, and then to see why the free C-ring monad gives a central example.

The basic slogan is:

A codifferential category is a categorical setting for function algebras and their differentials.

More concretely, it is a category equipped with a monad S such that SA behaves like an algebra of functions on A, together with a natural operation

dA:SASAA.

This operation should be read as

fdf.

The axioms say that this abstract operation satisfies the ordinary rules of calculus: constants have zero derivative, products satisfy the Leibniz rule, linear functions have constant derivative, substitution satisfies the chain rule, and second derivatives commute.


The Ambient Category

A codifferential category begins with an additive symmetric monoidal category

(C,,k,σ).

Here:

  • is the tensor product;

  • k is the monoidal unit;

  • σA,B:ABBA is the symmetry;

  • each hom-set C(A,B) is a commutative monoid;

  • composition and tensoring preserve addition.

In this context, “additive” does not necessarily mean abelian. It means that morphisms can be added and that zero morphisms exist.

This matters because the product rule has a sum in it:

d(fg)=fdg+gdf.

Categorically, that sum is a sum of morphisms.


Algebra Modalities

The next ingredient is an algebra modality.

An algebra modality is a monad

S:CC

with unit and multiplication

ηA:ASA,
μA:SSASA,

such that every object SA carries a natural commutative monoid structure

mA:SASASA,
uA:kSA.

The intended interpretation is:

SA=the algebra of functions on A.

Under this interpretation:

  • mA is multiplication of functions;

  • uA picks out the constant function 1;

  • ηA inserts linear functions;

  • μA performs substitution of functions into functions.

The monad laws are:

SSSAμSASSAμASA=SSSAS(μA)SSAμASA

and

SAηSASSAμASA=1SA=SAS(ηA)SSAμASA.

The commutative monoid structure on SA means that the following diagrams commute.

Associativity:

SASASAmA1SASAmASA=SASASA1mASASAmASA.

Unitality:

kSAuA1SASAmASA=kSASA

and

SAk1uASASAmASA=SAkSA.

Commutativity:

SASAσSA,SASASAmASA=SASAmASA.

Finally, the monad multiplication μA:SSASA must preserve the commutative monoid structure.

Multiplication preservation:

SSASSAmSASSAμASA=SSASSAμAμASASAmASA.

Unit preservation:

kuSASSAμASA=kuASA.

So an algebra modality is not merely a monad. It is a monad whose free algebras SA naturally behave like commutative algebras.


The Deriving Transformation

A deriving transformation on an algebra modality S is a natural transformation

dA:SASAA.

The intended meaning is:

dA(f)=df.

In ordinary differential calculus, if A=Rn, then SA should be some space of smooth functions on Rn, and SAA should behave like the space of 1-forms.

For example, one should have

d(f)=i=1nfxiei.

Naturality of d means that for every morphism h:AB, the following diagram commutes:

SAShSBdBSBB=SAdASAAShhSBB.

This says that differentiation is compatible with change of variables along maps in the base category.


Definition of a Codifferential Category

A codifferential category is an additive symmetric monoidal category

(C,,k,σ)

equipped with:

  1. an algebra modality

(S,μ,η,m,u);
  1. a deriving transformation

dA:SASAA;
  1. five axioms corresponding to the ordinary rules of differential calculus.

The five axioms are:

AxiomCategorical nameCalculus meaning
[d.1]Constant ruled(c)=0
[d.2]Product ruled(fg)=fdg+gdf
[d.3]Linear ruled(xi)=dxi
[d.4]Chain ruled(g(f))=g(f)df
[d.5]Interchange ruleMixed partials commute

Now we write these axioms as diagrams.

Throughout the diagrams, tensor associativity and unit isomorphisms are suppressed.


Axiom [d.1]: Derivative of a Constant

The unit map

uA:kSA

selects the constant function 1.

The axiom says that constants have zero derivative:

dAuA=0.

Diagrammatically:

kuASAdASAA=k0SAA.

This is the categorical form of

d(c)=0.

Axiom [d.2]: Leibniz Rule

The multiplication

mA:SASASA

is multiplication of functions.

The derivative of a product can be computed in two ways.

First multiply, then differentiate:

SASAmASAdASAA.

Second, differentiate the right factor and multiply:

SASA1dASASAAmA1SAA.

Third, differentiate the left factor and multiply:

SASAdA1SAASA1σA,SASASAAmA1SAA.

The Leibniz rule says that the first composite is the sum of the second and third composites:

SASAmASAdASAA=SASA1dASASAAmA1SAA+SASAdA1SAASA1σA,SASASAAmA1SAA.

This is the categorical form of

d(fg)=fdg+gdf.

Axiom [d.3]: Derivative of a Linear Function

The monad unit

ηA:ASA

inserts linear functions into the algebra of functions.

The axiom says that the derivative of a linear function is the corresponding constant differential:

dAηA=uA1A.

Diagrammatically:

AηASAdASAA=AkAuA1ASAA.

In coordinates, this says:

d(xi)=1ei.

If 1ei is written as dxi, then this is simply

d(xi)=dxi.

Axiom [d.4]: Chain Rule

The monad multiplication

μA:SSASA

encodes substitution.

Intuitively, an element of SSA is a function whose variables are themselves functions on A. Applying μA substitutes those inner functions into the outer function.

The chain rule compares two ways of differentiating a substituted function.

First substitute, then differentiate:

SSAμASAdASAA.

Second, differentiate the outer function first:

SSAdSASSASA.

Then substitute the coefficient part and differentiate the inner function part:

SSASAμAdASASAA.

Finally multiply the two SA factors:

SASAAmA1SAA.

The chain rule axiom is:

SSAμASAdASAA=SSAdSASSASAμAdASASAAmA1SAA.

This is the categorical form of the ordinary chain rule.

For smooth functions, if

gC(Rm)

and

f1,,fmC(Rn),

then

d(g(f1,,fm))=j=1mgyj(f1,,fm)dfj.

The monad multiplication μ is substitution, and the chain rule says that differentiation is compatible with substitution.


Axiom [d.5]: Interchange Rule

The interchange rule says that second derivatives are symmetric.

First differentiate once:

SAdASAA.

Then differentiate the SA component again:

SAAdA1SAAA.

This gives a second derivative object. The interchange axiom says that swapping the two A-directions gives the same result:

SAdASAAdA1SAAA=SAdASAAdA1SAAA1σA,ASAAA.

This is the categorical form of

2fxixj=2fxjxi.

Thus the deriving transformation behaves like a genuine differential operator, not merely an arbitrary derivation-like map.


Why Is It Called “Codifferential”?

The prefix “co” comes from the comparison with differential categories.

A differential category usually uses a coalgebra modality, often written as

!

and the deriving transformation has the shape

!AA!A.

A codifferential category uses an algebra modality S, and the deriving transformation has the dual-looking shape

SASAA.

So the conceptual shift is:

differential categorynonlinear maps and directional differentiation

versus

codifferential categoryfunction algebras and differentials

The codifferential viewpoint is close to the algebraic geometry intuition:

study a space through its algebra of functions.

In this perspective, SA is the function algebra, and dA:SASAA sends a function to its differential.


The Free Smooth Ring Monad

Now we come to the main example.

Let

C=R-Vec

with its usual tensor product

R

and monoidal unit

R.

There is a monad

S:R-VecR-Vec

called the free C-ring monad.

For finite-dimensional vector spaces,

S(Rn)=C(Rn).

Thus S(Rn) is the vector space of smooth real-valued functions on Rn.

The algebra structure

mRn:S(Rn)S(Rn)S(Rn)

is pointwise multiplication:

mRn(fg)=fg.

The unit

uRn:RS(Rn)

sends a scalar to the corresponding constant function.

The deriving transformation is the usual differential:

dRn:C(Rn)C(Rn)Rn

given by

dRn(f)=i=1nfxiei.

If one writes

dxi=1ei,

then this becomes the familiar formula

df=i=1nfxidxi.

So the abstract deriving transformation is exactly ordinary differentiation in this example.


The Lawvere Theory Source of the Monad

The free smooth ring monad can be obtained from Lawvere theories.

There is a Lawvere theory of real vector spaces, denoted here by

LinR.

There is also a Lawvere theory of smooth rings, denoted here by

Smooth.

There is an inclusion

LinRSmooth,

because every linear operation is a smooth operation.

Passing to models gives a forgetful functor

U:C-RingR-Vec.

This functor forgets the smooth operations and remembers only the underlying real vector space.

It has a left adjoint

F:R-VecC-Ring.

Therefore it gives a monad

S=UF

on R-Vec.

This is the free C-ring monad.

So the sequence of ideas is:

LinRSmoothC-RingR-VecS=UF

The codifferential structure is extra structure on this monad: the monad gives smooth functions and substitution, while the deriving transformation gives differentiation.


How the Axioms Look in the Smooth Example

For the free smooth ring monad, the five codifferential axioms become ordinary facts from calculus.

The constant rule says:

d(c)=0.

The product rule says:

d(fg)=fdg+gdf.

The linear rule says:

d(xi)=dxi.

The chain rule says:

d(g(f1,,fm))=j=1mgyj(f1,,fm)dfj.

The interchange rule says:

2fxixj=2fxjxi.

Thus the abstract diagrams are not arbitrary. They are exactly the usual laws of smooth differential calculus, written in a form that makes sense in an additive symmetric monoidal category.


Comparison with the Polynomial Monad

It is useful to compare S with the symmetric algebra monad.

The symmetric algebra monad

Sym:R-VecR-Vec

satisfies

Sym(Rn)=R[x1,,xn].

It is the free commutative algebra monad.

The free smooth ring monad satisfies

S(Rn)=C(Rn).

So one may think of S as a smooth enhancement of Sym:

R[x1,,xn]C(Rn).

The polynomial monad captures polynomial functions and polynomial substitution. The smooth monad captures smooth functions and smooth substitution.

Both admit a differential operation of the form

d(f)=ifxiei.

The smooth case is the one closest to ordinary calculus.

 

No comments:

Post a Comment

Popular Posts