%\input{preamble.tex}
\unittitle{Formalism of differential algebra}

In this lecture, we set up some formalism for dealing with differential 
equations. These can be used for the start of an
axiomatic treatment of \emph{differential algebra}, but I will only
introduce the minimum for my needs.

Convention: My rings are commutative and unital unless otherwise specified.
When I say  ``noncommutative ring'', I really mean ``not necessarily
commutative ring''.

\section{Differential modules}

A \emph{differential ring} is a ring $R$ 
equipped with a derivation $d: R
\to R$, i.e., an additive map satisfying the Leibniz rule
\[
d(ab) = ad(b) + bd(a) \qquad (a,b \in R).
\]
We expressly allow $d = 0$ unless otherwise specified; this will come in 
handy in some situations.
A differential ring which is also a domain, field, etc., will be called 
a \emph{differential domain, field}, etc.

A \emph{differential module} over a differential ring $(R,d)$
is a module $M$ equipped with an additive map $D: M \to M$ satisfying
\[
D(am) = aD(m) + d(a)m;
\]
such a $D$ will also be called a \emph{differential operator} on $M$
relative to $d$.
For example, $(R,d)$ is a differential module over itself; any differential
module isomorphic to a direct sum of copies of $(R,d)$ is said to be
\emph{trivial}. (If we refer to ``the'' trivial differential module, though,
we mean $(R,d)$ itself.)
A \emph{differential ideal} of $R$ is a differential submodule of $R$
itself, i.e., an ideal stable under $d$.

The kernel of the derivation $d$ on $R$ is a subring of $R$; if $R$
is a field, then $\ker(d)$ is a subfield. We call this the \emph{constant
subring/subfield}. For $(M,D)$ a differential module, 
an element of $\ker(D)$ is said to be \emph{horizontal}. (This 
terminology makes sense if you consider \emph{connections} in differential
geometry, where the differential operator is measuring the extent to which
a section of a vector bundle deviates from some prescribed ``horizontal''
direction identifying points on one fibre with points on its neighbors.)

For $(M,D)$ a differential module, define
\[
H^0(M) = \ker(D), \qquad H^1(M) = \coker(D) = M/D(M).
\]
The latter computes Yoneda extensions; see Lemma~\ref{L:ext} below.

Convention: I will sometimes refer to the pair $(R,d)$ as a differential ring,
but in some cases I will call $R$ itself a differential ring when
$d$ is either evident from context or not relevant. Similarly for differential
modules.

\section{Differential modules and differential systems}

Let $R$ be a differential ring, and let $M$ be a finite
free differential module of rank $n$ over $R$. Let $e_1, \dots, e_n$ be
a basis of $M$. Then for any $v \in M$, we can write
$v = v_1 e_1 + \cdots + v_n e_n$ for some $v_1,\dots,v_n \in R$, 
and then compute
\[
D(v) = v_1 D(e_1) + \cdots + v_n D(e_n) + 
d(v_1)e_1 + \cdots + d(v_n)e_n.
\]
If we define the $n \times n$ matrix $N$ over $R$ by the formula
\[
D(e_j) = \sum_{i=1}^n D_{ij} e_i,
\]
we then have
\[
D(v) = \sum_{i=1}^n \left( d(v_i) + \sum_j N_{ij} v_j \right) e_i.
\]
That is, if we identify $v$ with the column vector $\bv = [v_1, \dots, v_n]$,
then
\[
D(\bv) = N\bv + d(\bv).
\]
Conversely, it is clear that given the underlying finite free $R$-module,
any differential module structure is given by such an equation.

In other words, differential modules are a coordinate-free version of
differential systems. If you are a geometer, you may wish to go further
and think of \emph{differential bundles}, i.e., vector bundles equipped
with a differential operator. A differential operator on a vector bundle is
usually called a \emph{connection}.

\section{Operations on differential modules}

Differential modules over a fixed differential ring $R$ form a category
in which the morphisms (or \emph{homomorphisms}) from $M_1$ to $M_2$
are additive maps $f: M_1 \to M_2$ satisfying $D(f(m)) = f(D(m))$.
This category admits certain functors corresponding to some familiar functors
on the category of modules over an ordinary ring.
(Beware that in the following notations,
the subscripted $R$ in the above notations will often be
suppressed when it is unambiguous.)

Given two differential modules $M_1, M_2$, the tensor product 
$M_1 \otimes_R M_2$ in the category of rings may be viewed as a differential
module via the formula
\[
D(m_1 \otimes m_2) = D(m_1) \otimes m_2 + m_1 \otimes D(m_2).
\]
Similarly, the exterior power $\wedge^n_R M$ may be viewed as a differential
module via the formula
\[
D(m_1 \wedge \cdots \wedge m_n)
= \sum_{i=1}^n m_1 \wedge \cdots \wedge m_{i-1} \wedge D(m_i) 
\wedge m_{i+1} \wedge \cdots \wedge m_n;
\]
likewise for the symmetric power $\Sym^n_R M$. The module of $R$-homomorphisms
$\Hom_R(M_1, M_2)$ may be viewed as a differential module via the formula
\[
D(f)(m) = D(f(m)) - f(D(m));
\]
the homomorphisms from $M_1$ to $M_2$ as differential modules are precisely
the horizontal elements of $\Hom_R(M_1, M_2)$. If $M_2 \cong R$ is trivial,
we write $R^\dual$ for $\Hom_R(M_1,R)$ and call it the \emph{dual} of $M_1$;
if $M_1$ is finite projective (which is the same as finite locally free
if $R$ is a noetherian ring),
then $\Hom_R(M_1,M_2) \cong M_1^\dual \otimes M_2$
and the natural map $M_1 \to (M_1^\dual)^\dual$ is an isomorphism.

\begin{lemma} \label{L:ext}
Let $M,N$ be differential modules with $M$ finite projective.
Then the group $H^1(M^\dual \otimes N)$ is canonically isomorphic to the
Yoneda extension group $\Ext(M,N)$.
\end{lemma}
\begin{proof}
The group $\Ext(M,N)$ consists of equivalence classes of exact sequences
$0 \to N \to P \to M \to 0$ under the relation that this sequence
is equivalent to a second sequence $0 \to N \to P' \to M \to 0$ if
there is an isomorphism $P \cong P'$ that induces the identity maps on
$M$ and $N$. The addition is to take two such sequences and return the
\emph{Baer sum} $0 \to N \to (P \oplus P')/\Delta \to M \to 0$,
where $\Delta = \{(n,-n): n \in N\}$. The identity element is the
split sequence $0 \to N \to M \oplus N \to M \to 0$. The inverse
of a sequence $0 \to N \to P \to M \to 0$ is the sequence
$0 \to N \to P \to M \to 0$ with the map $N \to P$ negated.

Given an extension $0 \to N \to P \to M \to 0$, tensor with
$M^\dual$ to get $0 \to M^\dual \otimes N \to M^\dual \otimes P \to M^\dual
\otimes P \to 0$, and apply the connecting homomorphism $H^0(M^\dual \otimes M)
\to H^1(M^\dual \otimes N)$ from the snake lemma to the trace 
(the element of $M^\dual \otimes M$ corresponding to the identity map
in $\Hom(M,M)$) to get an element of $H^1(M^\dual \otimes N)$.
This is the desired map $\Ext(M,N) \to H^1(M^\dual \otimes N)$.
To construct its inverse, given an element $H^1(M^\dual \otimes N)$ represented by
$x \in M^\dual \otimes N$, form the sequence
\[
0 \to N \to \frac{M \oplus N}{(m, \langle m,x \rangle)} \to M \to 0
\]
where $\langle \cdot,\cdot \rangle$ represents the natural map
$M \times (M^\dual \otimes N) \to N$.
\end{proof}

\section{Cyclic vectors}

Let $R$ be a differential ring, and let $M$ be a finite free
differential module of rank $n$ over $R$.
A \emph{cyclic vector} for $M$ is an element $m \in M$ such that
$m, D(m), \dots, D^{n - 1}(m)$ form a basis of $M$.

\begin{theorem}[Cyclic vector theorem]
Let $R$ be a differential field of characteristic zero with nonzero
derivation. Then every finite differential module over $R$ has a cyclic vector.
\end{theorem}
For a comment on characteristic $p$, see the exercises.
\begin{proof}
This is a folklore result, that is, it is old enough that giving a proper
attribution is difficult. Many proofs are possible;
here is the proof from [DGS, Theorem III.4.2].

We start by normalizing the derivation. For $u \in R^\times$, given one differential
module $(M,D)$ over $(R,d)$, we get another differential module $(M,uD)$
over $(R,ud)$, and $m$ is a cyclic vector for one if and only if it is
a cyclic vector for the other (because the image of $m$ under $(uD)^j$ is
in the span of $u, D(u), \dots, D^j(u)$). We may thus assume 
(thanks to the assumption that the derivation is nontrivial)
that there exists
an element $x \in R$ such that $d(x) = x$.

Let $M$ be a differential module of dimension $n$, 
and choose $m \in M$ so that the dimension $\mu$ of the span of $m, D(m), \dots$
is as large as possible. We  derive a contradiction under the
hypothesis $\mu < n$.

For $z \in M$ and $\lambda \in \QQ$, we now have
\[
(m+ \lambda z) \wedge D(m+ \lambda z) \wedge \cdots + D^{\mu}(m+ \lambda z) = 0
\]
in the exterior power $\wedge^{\mu+1}M$. If we write this
expression as a polynomial in $\lambda$, it vanishes for infinitely many
values, so must be identically zero. Hence each coefficient must vanish
separately, including the coefficient of $\lambda^1$, which is
\begin{equation} \label{eq:cyclic vector}
\sum_{i=0}^\mu m \wedge \cdots \wedge D^{i-1}(m)
\wedge D^i(z) \wedge D^{i+1}(m) \cdots \wedge D^\mu(m).
\end{equation}
Pick $s \in \ZZ$, 
substitute $x^s z$ for $z$ in \eqref{eq:cyclic vector},
divide by
$x^s$, and set equal to zero. We get
\begin{equation} \label{eq:cyclic vector2}
\sum_{i=0}^{\mu} s^i \Lambda_i(m,z) = 0 \qquad (s \in \ZZ)
\end{equation}
for
\[
\Lambda_i(m,z) = \sum_{j=0}^{\mu-i} \binom{i+j}{i} m \wedge
\cdots \wedge D^{i+j-1}(m) \wedge D^{j}(z) \wedge D^{i+j+1}(m)
\wedge \cdots \wedge D^\mu(m).
\]
Again because we are in characteristic zero, we may conclude that
\eqref{eq:cyclic vector2}, viewed as a polynomial in $s$, has all
coefficients equal to zero; that is, $\Lambda_i(m,z) = 0$ for all $m,z \in M$.

We now take $i = \mu$ to obtain
\[
(m \wedge \cdots \wedge D^{\mu-1}(m)) \wedge z = 0
\qquad (m,z \in M);
\]
since $\mu < n$, we may use this to deduce
\[
m \wedge \cdots  \wedge D^{\mu-1}(m) = 0 \qquad (m \in M).
\]
But that means that the dimension of the span of $m, D(m), \dots$ is always
at most $\mu-1$, contradicting the definition of $\mu$.
\end{proof}

If $R$ is not a field, then one obstruction to having a cyclic vector 
is that $M$ itself might not be a finite free $R$-module. But even if it is,
there is no reason to expect in general that cyclic vectors exist; this
will create complications for us later.

\section{Differential polynomials}

Let $(R,d)$ be a differential ring. The \emph{ring of twisted polynomials}
$R\{T\}$
over $R$ in the variable $T$ is the additive group 
\[
R \oplus (R \cdot T) \oplus (R \cdot T^2) \oplus \cdots,
\]
with noncommuting multiplication given by the formula
\[
\left( \sum_{i=0}^\infty a_i T^i \right) \left( \sum_{j=0}^\infty 
b_j T^j \right)
= \sum_{i,j=0}^\infty \sum_{h=0}^j \binom{j}{h} a_i d^h(b_j) T^{i+j-h}.
\]
In other words, you impose the relation
\[
Ta = aT + d(a) \qquad (a \in R)
\]
and check that you get a sensible noncommutative ring.

We define the \emph{degree} of a twisted polynomial in the usual way,
as the exponent of the largest power of $T$ with a nonzero coefficient.
(Pick your favorite convention for the degree of the zero polynomial.)

\begin{prop}[Ore] \label{P:division}
For $R$ a differential field,
the ring $R\{T\}$ admits a left division algorithm. That is,
if $f,g \in R\{T\}$ and $g \neq 0$, then there exist unique $q,r \in R\{T\}$
with $\deg(r) < \deg(g)$ and $f = gq + r$. (There is also a right division
algorithm.)
\end{prop}
\begin{proof}
Exercise.
\end{proof}
Using the Euclidean algorithm, this yields the following consequence
as in the untwisted case.
\begin{theorem}[Ore]
Let $R$ be a differential field. Then $R\{T\}$ is both left principal
and right principal; that is, any left ideal (resp.\ right ideal)
has the form $R\{T\}f$ (resp.\ $f R\{T\}$) for some $f \in R\{T\}$.
\end{theorem}

Note that the opposite ring to $R\{T\}$, i.e., the ring with left and right
reversed, is again a twisted polynomial ring, but for the derivation $-d$.
Given $f \in R\{T\}$, we define the \emph{formal adjoint} of $f$ as the
element $f$ in the opposite ring. This operation looks a bit less formal if
you also push the coefficients over to the other side,
giving what we will call the \emph{adjoint form} of $f$. For instance,
the adjoint form of $T^3 + aT^2 + bT + c$ is
\[
T^3 + T^2a + T(b - 2d(a))+ d(d(a)) - d(b) + c.
\]

The twisted polynomial ring is rigged up precisely so that for any differential
module $M$ over $R$, we get an action of $R\{T\}$ on $M$ under which $T$
acts like $D$. In particular, $R\{T\}$ acts on $R$ itself with $T$ acting
like $d$. In fact, the category of differential modules over $R$ is equivalent
to the category of left $R\{T\}$-modules. Moreover, if $M$ is a differential
module, any cyclic vector $m \in M$ corresponds to an isomorphism
$M \cong R\{T\}/R\{T\}f$ for some monic twisted polynomial $f$,
where the isomorphism carries $m$ to the class of 1. (You might want to
think of $f$ as a sort of ``characteristic polynomial'' for $M$, except
that it depends strongly on the choice of the cyclic vector.)

\section{Differential equations}

You may have been wondering when differential equations will appear, those
supposedly being the objects of study of this course. If so, your wait is over.

A \emph{differential equation of order $n$} 
over the differential ring $(R,d)$ is 
an equation of the form
\[
(a_n d^n + \cdots + a_1 d + a_0) y = b,
\]
with $a_0, \dots, a_n, b \in R$, and $y$ indeterminate. 
We say the equation is \emph{homogeneous}
if $b=0$ and \emph{inhomogeneous} otherwise.

Using our setup, we may write this equation as $f(d) y = b$ for some
$f \in R\{T\}$. Similarly, we may view systems of differential equations
as being equations of the form $f(D) y = b$ where $b$ lives in some
differential module $(M,D)$. By the usual method (of introducing
extra variables corresponding to derivatives of $y$), we can convert any
differential system into a first-order system $Dy = b$. We can also
convert an inhomogeneous system into a homogeneous one by adding an extra
variable, with the understanding that we would like the value of that last
variable to be 1 in order to get back a solution of the original equation.

Here is a more explicit relationship between adjoint polynomials and
solving differential equations.
Say you start with the cyclic differential module $M \cong R\{T\}/R\{T\}f$
and you want to find a horizontal element. That means that you want to
find some $g \in R\{T\}$ such that $Tg \in R\{T\}f$; we may as well
assume that $\deg(g) < \deg(f)$. Then by comparing degrees, we see that
in fact $Tg = r f$ for some $r \in R$. Write $f$ in adjoint form as
$f_0 + T f_1 + \cdots + T^n$; then
\[
rf \equiv rf_0 -d(r)f_1 + d^2(r)f_2 -\cdots \pm d^n(f)
\mod{T R\{T\}}.
\]
In this manner, finding a horizontal element becomes equivalent to solving a 
differential equation.

\section{Cyclic vectors: a mixed blessing}

The reader may at this point be wondering why so many points of view
are necessary, since the cyclic vector theorem can be used to transform
any differential module into a differential equation, and ultimately
differential equations are the things one writes down and wants to solve.
Permit me to interject here a countervailing opinion.

In ordinary linear algebra (or in other words, when considering differential
modules for the trivial derivation), one can pass freely between
linear transformations on a vector space and square matrices if one is
willing to choose a basis. The merits of doing this depend on the situation,
so it is valuable to have both the matricial and coordinate-free viewpoints
well in hand. One can then pass to the characteristic polynomial, but not
all information is retained (one loses information about nilpotency),
and even information that in principle is retained is sometimes not so
conveniently accessed. In short, no one would seriously argue that one
can dispense with studying matrices because of the existence of the
characteristic polynomial.

The situation is not so different in the differential case. The difference
between a differential module and a differential system is merely the
choice of a basis, and again it is valuable to have both points of view
in mind. However, the cyclic vector theorem may seduce one into thinking that
collapsing a differential system into a differential polynomial is an
operation without drawbacks, and this is far from the case. For instance,
determining whether two differential polynomials correspond to the same
differential system is not straightforward.

More seriously for our purposes, the cyclic vector theorem only applies over
a differential field. Many differential modules are more naturally defined
over some ring which is not a field, e.g., those coming from geometry which
should be defined over some sort of ring of functions on some sort of
geometric space. Working with differential modules instead of differential
polynomials has a tremendously clarifying effect over rings.

We find it unfortunate that much of the literature on complex
ordinary differential equations, and nearly all of the literature on
$p$-adic ordinary differential equations, is mired in the language of
differential polynomials. By instead switching between differential modules
and differential polynomials as appropriate, we will be able to demonstrate
strategies that lead to a more systematic development of the $p$-adic 
theory.

\section{Taylor series}

Let $R$ be a \emph{topological} differential ring, i.e., a ring equipped
with a topology and a derivation such that all operations are continuous.
Assume also that $R$ is a $\QQ$-algebra.
Let $M$ be a topological differential module over $R$, i.e., a differential
module such that all operations are continuous.

For $r \in R$ and $m \in M$, we define the \emph{Taylor series} $T(r,m)$
as the infinite sum
\[
\sum_{i=0}^\infty \frac{r^i}{i!} D^i(m)
\]
whenever the sum converges absolutely (i.e., all rearrangements converge to the
same value). This map is \emph{de facto} additive: if
$m_1, m_2 \in M$, then
\[
T(r,m_1) + T(r,m_2) = T(r,m_1+m_2)
\]
whenever all three terms make sense.
Also, the map $T(r,\cdot): R \to R$ is \emph{de facto} a ring homomorphism:
if $s_1, s_2 \in R$, then (by the Leibniz rule)
\[
T(r,s_1) T(r,s_2) = T(r,s_1s_2)
\]
whenever all three terms make sense. (Key example: if $R$ is a
completion of a rational function field $F(t)$ and $d = d/dt$, then
this ring homomorphism is the substitution $t \mapsto t + r$.)
More generally, the map $T(r, \cdot)$ on $M$ is \emph{de facto}
semilinear for the ring homomorphism $T(r,\cdot)$ on $R$:
if $s \in R$, $m \in M$, then
\[
T(r,s) T(r,m) = T(r,sm)
\]
whenever all three terms make sense.

Another use for Taylor series is to construct horizontal sections.
Note that
\begin{align*}
D(T(r,m)) &= 
\sum_{i=1}^\infty d(r) \frac{r^{i-1}}{(i-1)!} D^{i}(m) +
\sum_{i=0}^\infty \frac{r^i}{i!} D^{i+1}(m) \\
&= (1 + d(r)) T(r,m)
\end{align*}
if everything converges absolutely.
In particular, if $d(r) = -1$, then $T(r,m)$ is horizontal.

\notes

The subject of differential algebra is rather well-developed;
a classic treatment, if somewhat dry, is the book of Ritt [Rit50]. 
As in abstract algebra in general, development of differential algebra
was partly driven by \emph{differential Galois theory}, i.e., the study
of when solutions of differential equations can be expressed in terms of
solutions to ostensibly simpler differential equations. A relatively
lively introduction
to the latter is [SvdP03].

Twisted polynomials were introduced by Ore [Ore33]. They are actually
somewhat more general than we have discussed; for instance, one can also
twist by an endomorphism $\tau: R \to R$ by imposing the relation
$Ta = \tau(a)T$. (This enters the realm of the analogue of differential algebra
called \emph{difference algebra}, which we will treat in a later unit.)
Moreover, one can twist by both an endomorphism and
a derivation if they are compatible in an appropriate way, and one can
even study differential/difference Galois theory in this setting.
A unifying framework for doing so, which is also suitable for
considering multiple derivations and automorphisms, 
is given by Andr\'e [And01].

Differential algebra in positive characteristic has a rather different
flavor than in characteristic 0; for instance, the $p$-th power of the
derivation $d/dt$ on $\FF_p(t)$ is the zero map. A brief discussion
of the characteristic $p$ situation is given in [DGS, \S III.1].

\exercises

\begin{enumerate}
\item
Prove that if $M$ is a locally free differential module over $R$
of rank 1, then $M^\dual \otimes M$ is trivial (as a differential module).
\item
Check that in characteristic $p>0$, the cyclic vector theorem holds for
modules of rank less than $p$, but may fail for modules of rank $p$.
\item
Give a counterexample to the cyclic vector theorem for a differential
field of characteristic zero with trivial derivation.
\item
Verify that $R\{T\}$ is indeed a noncommutative ring; the content
in this is to check associativity of multiplication.
\item
Prove the division algorithm (Proposition~\ref{P:division}).
\end{enumerate}

%\end{document}
