A ‘Fermat theory’ is a Lawvere theory that extends the usual theory of commutative rings by permitting differentiation.
The term Fermat theory seems to have been introduced in (Kock 09) based on (Dubuc-Kock 84). But as the name suggests, it has its roots in an old observation of Fermat. Namely: if $f \;\colon\; \mathbb{R} \longrightarrow \mathbb{R}$ is a polynomial function, then
for a unique polynomial function $\tilde{f} \colon \mathbb{R}^2 \to \mathbb{R}$. Clearly
for $y \ne 0$, but the interesting thing is that
So, the function $\tilde{f}$ knows about the derivative of $f$! (This can be done for polynomials over any commutative ring, although Fermat wasn't working in that generality.)
Later Jacques Hadamard generalized this observation from a polynomial function $f$ to a continuously differentiable function $f$, where now $\tilde{f}$ is unique if required to be continuous. This is the statement of the Hadamard lemma. (For a merely differentiable function $f$, require $\tilde{f}$ to be continuous in $y$ alone.) The function $\tilde{f}$ is thus called a Hadamard quotient. If $\tilde{f}$ is to be the same class of function as $f$, then we need smooth functions, and that will be our motivating context from now on.
If we take $\tilde{f}(x,0) = f'(x)$ as a definition of the derivative, we can derive many of the basic rules for derivatives from the formula
using just algebra — no limits! As an exercise, the reader should check these rules:
These ideas continue to work if $f$ is a smooth function from $\mathbb{R}^n$ to $\mathbb{R}$; focussing on one variable and treating the others as parameter?s, we have partial differentiation.
The above observations suggest defining the following kind of Lawvere theory. A Fermat theory is an extension of the algebraic theory of commutative rings, such that for any $(n+1)$-ary operation $f$ there is a unique $(n+2)$-ary operation $\tilde{f}$ such that
where $\vec{z}$ is a list of $n$ variables which act as parameters. (Here we are abusing language by writing the operations $f$ and $\tilde{f}$ as if they were functions, to avoid unintuitive commutative diagrams.)
There is a Lawvere theory called the theory of $C^\infty$-rings, whose $n$-ary operations are the smooth maps $f: \mathbb{R}^n \to \mathbb{R}$,
with composition of operations defined in the obvious way. An algebra of this Lawvere theory is called a C^∞-ring.
The theory of $C^\infty$-rings is a Fermat theory. For any smooth manifold $M$, the algebra of smooth real-valued functions $C^\infty(M)$ is a $C^\infty$ ring. More generally, if $M$ is any diffeological space, Chen space or Frolicher space, we can define $C^\infty(M)$, and this will be a $C^\infty$-ring.
In formulas, and even more generally: for any generalized space given by a presheaf $X$ on CartSp, the corresponding $C^\infty$-ring is the copresheaf
that sends each object $\mathbb{R}^n \in CartSp$ to the hom-set in the functor category $[CartSp^{op},Set]$ from $X$ to the presheaf represented by $\mathbb{R}^n$ under the Yoneda embedding. By the canonical right exactness of the hom-functor, this preserves limits and hence in particular products in CartSp.
Let $T$ be a Fermat theory and let $f$ be an $(n+1)$-ary operation, then we may define an operation $\partial_1 f$
by
This acts like the partial derivative of $f$ with respect to its first argument. With a bit of more work we get a list of $n$-ary operations $\partial_i f$. So, if $T(n)$ denotes the set of $n$-ary operations in the algebraic theory $T$, we get maps
for $1 \le i \le n$.
Now $T(n)$ is automatically an algebra of $T$ (this is true for any Lawvere theory: it is the free algebra on $n$ generators), whence $T(n)$ is a commutative ring. One can check that each map
is a derivation of this ring — this is really just the chain rule.
Let $T$ be a Fermat theory, and let $A$ be a $T$-algebra. A module $N$ over $A$ is simply a module for the underlying ring of $A$.
But the notion of derivation $\delta : A \to N$ of such modules depends on the $T$-structure:
To motivate the concept, let first $A$ be an ordinary ring and $N$ an ordinary module. Then the three axioms of an ordinary derivation $\delta : A \to N$
$\delta(a + b ) = \delta(a) + \delta(b)$
$\delta(\lambda a) = \lambda \delta(a)$
$\delta(a \cdot b) = a \delta(a) + b \delta(b)$
are equivalent to the condition that for any polynomial $p \in \mathbb{R}[x_1, \cdots, x_n]$ and ring elements $a_i$ we have
(It is immediate that the first three axioms imply this one. To see the converse, apply the latter to the polynomials $p_1(x,y) = x + y$, $p_2(x) = \lambda a$ and $p_3(x,y) = x y$.)
The definition of derivations for general $T$-algebras now follows the last expression, using the notion of partial derivatives from above:
For $T$ a Fermat theory, $A$ a $T$-algebra and $N$ an $A$-module, a derivation $\delta : A \to N$ is a map such that for each $f \in T(n)$ and elements $(a_i \in A)$ we have
Notice that in particular such a derivation of a $T$-algebra $A$ is a derivation of the underlying ring. (This follows again by using the above three polynomials and remembering that by definition $T(n)$ at least contains all polynomials.)
The sets $T(n)$ for $n \in \mathbb{N}$ canonically have the structures of modules over $T(n)$.
The map
obtained from the partial derivatives is the universal $T$-derivation of $T(n,1)$.
This means that if $N$ is a module of $T(n)$ and $\delta : T(n) \to N$ is a derivation in the above sense, then $\delta$ factors uniquely through the map $\langle \partial_1, \dots, \partial_n \rangle$.
The point of this theorem is that it gives us a version of Kähler differentials for $T(n)$.
We may think of an element $(f_i) \in \prod_{i = 1}^{n} T(n)$ as the Kähler differential 1-form $f_1 d x^1 + f_2 d x^2 + \cdots + f_n d x^n$ and of the derivation $d := \langle \partial_1, \dots, \partial_n \rangle$ as the operation
Indeed, when the Fermat theory is that of C-infinity rings, then this notion of Kähler differentials does coincide with the ordinary notion of smooth 1-form. The same is not true, in general, if one instead forms ring-theoretic Kähler differentials.
The original reference is
Parts of the above material are a summary of the following talk:
For more, see:
and the comments on this blog entry.
Refinement to supergeometry and extension to a notion of super Fermat theory is discussed in
Something similar appears in def. 1.1, 1.2 of
For more on this see at synthetic differential supergeometry.