Calculus and Category Theory – Exploring the Connection

calculuscategory-theory

Quick question:

Is it possible to differentiate a function with respect to another function, or is it limited to a particular variable?

I tried thinking around how to make this question make sense, but I can't figure it out!

I mean, $\frac{\mathrm{d}}{\mathrm{d}x}$ is a function which accepts a function, and returns a function (the derivative of the original function). However, $\frac{\mathrm{d}}{\mathrm{d}x}$ is not equal to $\frac{\mathrm{d}}{\mathrm{d}y}$, and not equal to $\frac{\mathrm{d}}{\mathrm{d}z}$, so it appears that the function for differentiation would be:

derivative :: (real -> real) -> variable with respect to which you are differentiating -> (real -> real)

so, why can't I do:
$$
\begin{align}
\text{let }f(x) &= \sin(x)\\
\text{let }g(x) &= \cos(x)\\
\frac{\mathrm{d}}{\mathrm{d}g} f(x) &=\ ???
\end{align}
$$
and if I can, what is this called and where can I read more about this?

Sorry for badly formulating the question, but I am really curious on how to understand this idea, as I feel like I huge gap in understanding…

I would formulate this better, but the books on Calculus are so focused on applications and proofs, rather than explaining what it is, and when they try to explain what it is, they still do not explain it in terms that are useful to me. I am trying to understand how Calculus can be visualized under Category Theory, so that I can model it better in Haskell other programming languages.

Thanks!
~Dmitry

Best Answer

To answer the part of your question about a categorical point of view of calculus, Bill Lawvere developed an axiomatization of differential geometry in a smooth topos, which unifies many operations in both differential geometry (hence classical calculus) and algebraic geometry. This beautiful theory is called synthetic differential geometry, and is in many ways much simpler than the usual approach to calculus via limits.

In synthetic differential geometry the total derivative is the internal hom functor $(-)^D$, where $D := \{ d \in R : d^2 = 0\}$ is the "walking tangent vector". Here, $R$ is the line object in the smooth topos, which is like the classical real line but augmented with nilpotent elements.

To be more precise the above definition is an axiomatization of the tangent functor from classical differential geometry, so unlike the single-variable classical calculus derivative (which is a special case of the exterior derivative or Darboux derivative) it keeps track of the base points in the space. The classical derivative of a map between vector spaces can be obtained from the tangent map by projecting to the typical fibre of the tangent bundle, which is trivial in this case.

I apologize if this is a bit over your head, but check out John Bell's A Primer of Infinitesimal Analysis for an undergrad-level introduction, or Anders Kock's freely available text for a slightly more advanced but more comprehensive introduction.