\section*{Introduction}

The many applications of Beilinson-Bernsteins's localization theory to representation theory are well known. Classically, the focus lies on representations on ${\rm\bf C}$-vector spaces. More recently, arithmetic applications such as in \cite{harris2013,harder2014,zagier2010,januszewskirationality,januszewskiperiods1,januszewskiperiods2} have underlined the interest in considering more general bases than the complex numbers.

The present paper grew out of an attempt to understand Michael Harris' sketch of a Beilinson-Bernstein localization theory over ${\rm\bf Q}$ in \cite{harris2013}, which since then has been amended by \cite{harris2013erratum}. That such a theory exists over arbitrary algebraically closed field of characteristic $0$ has been known to Beilinson, Bernstein and others since a long time (cf.\ Beilinson 1983 ICM address \cite{beilinson1983}). However, a proper discussion of such a theory even over ${\rm\bf Q}$ is still lacking in the literature, and we attempt to fill this gap here.

Due to its geometric nature, the general algebro-geometric language of schemes provides the proper framework to formulate a general theory of $\mathcal D$-modules, which allows for even further generalizations. Consequently, we aim at the largest reasonable generality which still allows us to give essentially full proofs or refer to appropriate standard references. For large parts we work over an arbitrary noetherian or an arbitrary locally finitely presented base scheme $S.$

Harder constructed in \cite{harder2014} models for certain irreducible $({\mathfrak {g}},K)$-modules over ${\rm\bf Z}$. Subsequently Hayashi gave in \cite{hayashi2018} a general construction of models of irreducible $({\mathfrak {g}},K)$-modules over the integers. The general theory we develop here yields also such models and it remains an interesting problem to relate the different constructions.

While we were preparing this manuscript, Bernstein, Higson and Subag worked out an elementary example of a contraction family for forms of $\SL_2({\rm\bf C})$ over ${\rm\bf P}^1$ in \cite{bernsteinetal1,bernsteinetal2}. Tan, Yao and Yu studied in \cite{tanetal2016} deformations of $D$-modules in the case of $\SL(2,{\rm\bf R})$ without providing formal justifications for the formalism they apply.

We hope that our work helps to unify these different approaches. In the notion of families of Harish-Chandra pairs from Bernstein, Higson and Subag corresponds to modules over $S={\rm\bf A}^1$ and $S={\rm\bf P}^1$ respectively. However, we need not assume that the ground field is ${\rm\bf C}.$ With the theory we develop here, we may even work over the affine or projective line over ${\rm\bf Z}.$

We suppose a fluent understanding of modern scheme theoretic language. Throughout the paper we make frequent use of results from Grothendieck-Dieudonn\'e's EGA I--IV \cite{ega1,ega2,ega31,ega32,ega42,ega44} and occasionally to SGA \cite{sga1,sga3}. On the $\mathcal D$-module side we content us mostly with \cite{hottaetal2008}.

The outline of the paper is as follows. In the first section we recall and summarize basic statements on Sheaves of differential operators, connections, and $\mathcal D$-modules. For most statements, the only reference available seems to be EGA IV \cite{ega42,ega44}, where the results are scattered through a number of technical statements. The second section is devoted to the study of $\mathcal D$-modules, $\mathcal D$-affineness, different notions of coherence and existence of flat resolutions. In the third section we study functorial properties of $\mathcal D$-modules: We establish a flat base change theorem (Theorem \ref{thm:flatDmodulebasechange}) and show that the property of being $\mathcal D$-affine is local in the $fpqc$-topology (Theorem \ref{thm:Daffinefpqclocal}). Subsequently we prove the faithfully flat base change theorem for $\mathcal D$-modules (Theorem \ref{thm:fpqcDmoduledescent}). derived inverse and direct images and their relation to base change. In section 4 we discuss twisted sheaves of differential operators, group actions and equivariant sheaves. In section 5 we summarize our results in the special case where the base is a field, and which is sufficient for the applications in \cite{harris2013}.

{\em Acknowledgements.} The author thanks Leticia Barchini, Michael Harris and Takuma Hayashi for helpful remarks on a preliminary version of this manuscript.

\subsection*{Notation}

We work over an arbitrary base scheme $S.$ For us a scheme is simply a \lq{}pr\'esch\'ema\rq{} in \cite{ega1}. For applications we will specialize to $S=\Spec{\rm\bf Z}$, $S=\Spec{\rm\bf Q}$ or $S=\Spec{\rm\bf C}$, etc. We write $\mathcal O_S$ for the structure sheaf of $S$, and also $S$ for the underlying topological space.

For a morphism $s:S\to S'$ of schemes, we adopt the notation of \cite{ega1}, i.e.\ $s$ is a pair $(\psi,\theta)$, where $\psi:S\to S'$ is a continuous map of topological spaces and $\theta:\mathcal O_{S'}\to \psi_*\mathcal O_S$ is a morphism of sheaves of rings subject to the conditition that locally $(\psi,\theta)$ arises from classical maps between affine spaces (induced by ring homomorphisms). In particular, $s$ is a morphism of locally ringed spaces but not every such morphism is a morphism of schemes. We write $\theta^\#:\psi^*\mathcal O_{S'}\to\mathcal O_S$ for the morphism corresponding to $s$ under the standard adjunction.

While $\theta$ turns $\psi_*\mathcal O_S$ into an $\mathcal O_{S'}$-module, we remark that $\psi^*\mathcal O_{S'}$ is not an $\mathcal O_S$-module. Hence the pushforward $\psi_*\mathcal F$ of any $\mathcal O_S$-module $\mathcal F$ is automatically an $\mathcal O_{S'}$-module. However if we depart from an $\mathcal O_{S'}$-module $\mathcal G$, we need to consider $\mathcal O_S\otimes_{\psi^*\mathcal O_{S'}}\psi^*\mathcal G$ in order to obtain an $\mathcal O_S$-module.

To add to the confusion, we denote this $\mathcal O_S$-module by $s^*\mathcal G$, and also adopt the notation $s_*\mathcal G$ for $\psi_*\mathcal G$. It will be clear from the context when which notion of pull back is at work.

A scheme $X$ over $S$ is a morphism of schemes $x:X\to S$ and a morphism of schemes $x:X\to S$, $y:Y\to S$ over $S$ is a morphism of schemes $f:X\to Y$ with the property that the obvious triangle commutes (i.e.\ $x=y\circ f$).

The functor $\mathcal F\to x_* \mathcal F$ of sheaves on $X$ to sheaves on $S$ is left exact and its right derived functors $R^*x_*$ are the appropriate generalization for ordinary sheaf cohomology of $\mathcal F$ in the relative situation. We naturally obtain cohomology {\em sheaves} ($R^qx_*\mathcal F$ is a sheaf of $\mathcal O_S$-modules on $S$), and it makes conceptually sense to consider all categories of sheaves {\em enriched} over themselves, i.e.\ for sheaves $\mathcal F,\mathcal G$ on $X$ we consider the internal hom $\iHom(\mathcal F,\mathcal G)$ which is again a sheaf on $X$. Likewise, if $\mathcal F,\mathcal G$ are $\mathcal O_X$-modules, we consider $\iHom(\mathcal F,\mathcal G)$ as an $\mathcal O_X$-module via the $\mathcal O_X$-module structure on $\mathcal G$, and we also have the sheaf $\iHom_{\mathcal O_X}(\mathcal F,\mathcal G)$ of $\mathcal O_X$-module homomorphisms.

For $X$ a scheme and an $\mathcal O_X$-algebra $\mathcal A$, we write $\Mod(\mathcal A)$ for the category of left $\mathcal A$-modules on $X$. We let $\Mod_{\rm qc}(\D_{X/S})$ denote the full subcategory of $\mathcal O_X$-quasi-coherent $\mathcal A$-modules.

The following definition is borrowed from \cite{hottaetal2008}.

\begin{definition}
An $\mathcal A$-module $\mathcal M$ is called $\mathcal A$-{\em coherent} if $\mathcal M$ is a locally finitely generated $\mathcal A$-module and if for {\em every} open $U\subseteq X$, every locally finitely generated submodule of $\mathcal M|_U$ is a locally finitely presented $\mathcal A_U$-module.
\end{definition}

\section{Generalities on Sheaves of differential operators}

We begin with a review of sheaves of differential operators in the scheme theoretic language.

\subsection{Sheaves of differential operators}

We follow \cite[\textsection 16]{ega44}. For a scheme $x:X\to S$ over $S$ we consider the diagonal embedding
$$
\Delta_X:\quad X\to X\times_S X.
$$
Writing $\Delta_X=(\psi,\theta)$ we have a short exact sequence
$$
0\to\mathcal I_X\to\psi^*\mathcal O_{X\times_S X}\to\mathcal O_X\to 0
$$
of sheaves on $X$.

\subsection{Differentials}

We have the sheaf
$$
\Omega_{X/S}\;:=\;\mathcal I_X/\mathcal I_X^2,
$$
of (relative) $1$-differentials on $X$ (with respect to $S$). It has a natural $\mathcal O_X$-module structure induced by the inverse of the natural isomorphism
$$
\psi^*(\mathcal O_{X\times_S X})/\mathcal I_X\;\cong\;\mathcal O_X.
$$
As usual, $\Omega_{X/S}$ represents derivations, externally and internally:
\begin{equation}
\iHom_{\mathcal O_X}(\Omega_{X/S},\mathcal F)\;\cong\;\Der_S(\mathcal O_X,\mathcal F),
\label{eq:omegaxderivations}
\end{equation}
$$
u\;\mapsto\;u\circ d_{X/S},
$$
where $d_{X/S}$ is defined below (cf. Corollaire (16.5.5) in \cite{ega44}). Taking global sections gives the external representability.

The (relative) tangent sheaf of $X\to S$ is by definition
$$
{\Der}_S(\mathcal O_X,\mathcal O_X),
$$
canonically identified with the $\mathcal O_X$-dual of $\Omega_{X/S}$ via \eqref{eq:omegaxderivations}.

We set $\Omega_{X/S}^k:=\bigwedge^k\Omega_{X/S}$ and write $d:\Omega_{X/S}^k\to\Omega_{X/S}^{k+1}$ for the exterior differential, which extends the differential $d_{X/S}$ recalled below (cf.\ Th\'eor\`eme (16.6.2) in loc.\ cit.).

\subsection{Sheaves of principal parts}

Following D\'efinition (16.3.1) in \cite{ega44} we set for every $n\geq 0$
$$
\Pp_{X/S}^n\;:=\;\psi^*(\mathcal O_{X\times_S X})/\mathcal I_X^{n+1}.
$$
For $n>0$ this is not a sheaf of $\mathcal O_X$-modules in a canonical way (if $\Omega_{X/S}\neq0$, we need to make a choice, see below) but a sheaf of algebras {\em augmented} over $\mathcal O_X$. Then $\Pp_{X/S}^n$ is the {\em sheaf of principal parts of order $n$}. It comes with a natural increasing filtration induced by the quotients
$$
\mathcal I_X^{m}/\mathcal I_X^{1+n},
$$
for $0\leq m\leq n$. The associated graded sheaf $\Gr(\Pp^n_{X/S})$ admits the sheaf $\Omega_{X/S}^1$ of $1$-differentials as $\Gr_1(\Pp^n_{X/S})$. The sheaves of principal parts form a projective system of sheaves with projective limit denoted $\Pp_{X/S}^\infty$.

Now the projections $p_i:X\otimes_S X\to X$ induce two $\mathcal O_X$-module (and a fortiori two $\mathcal O_X$-algebra) structures on $\psi^*(\mathcal O_{X\times_S X})$ which descend to two different $\mathcal O_X$-module structures on $\Pp_{X/S}^n$. The standard $\mathcal O_X$-module structure is the one resulting from $p_1$. To distinguish the second module structure, we let
$$
d_{X/S}^n:\quad\mathcal O_X\to\Pp_{X/S}^n
$$
denote the $\mathcal O_X$-algebra structure resulting from $p_2$. Then, for any section $t\in\Gamma(U,\mathcal O_X)$, we have its {\em differential}
$$
dt\;:=\;d_{X/S}t\;:=\;d_{X/S}^1t - t\;\in\;\Gamma(U,\Omega_{X/S}).
$$
This notion generalizes to a map
$$
\delta^n:\quad \mathcal O_X(U)\to\Gamma(U,\Pp_{X/S}^n),
\quad t\;\mapsto\;d^nt-t.
$$
We remark that these maps are compatible with the canonical projections $\Pp_{X/S}^m\to\Pp_{X/S}^n$, $m\geq n$.

Finally, we have for any $\mathcal O_X$-module $\mathcal F$ the $\Pp_{X/S}^n$-module
$$
\Pp_{X/S}^n(\mathcal F)\;:=\;\Pp_{X/S}^n\otimes_{\mathcal O_X}\mathcal F.
$$

\subsection{Differential operators}\label{sec:differentialoperators}

For each pair of $\mathcal O_X$-modules $\mathcal F,\mathcal G$ and each $n\in{\rm\bf N}_{0}\cup\{\infty\}$, we have a morphism of sheaves
$$
\delta_{X/S}^n:\quad \iHom_{\mathcal O_X}(\Pp_{X/S}^n(\mathcal F),\mathcal G)\;\to\;\iHom(\mathcal F,\mathcal G),
$$
$$
u\;\mapsto\;u\circ d_{X/S}^n
$$
whose (sheaf theoretic image) we denote by $\Diff_{X/S}^n(\mathcal F,\mathcal G)$. We emphasize that in the codomain of $\delta_{X/S}^n$ we are considering additive morphisms of sheaves. Then $\Diff_{X/S}^n(\mathcal F,\mathcal G)$ is the sheaf of differential operators $D:\mathcal F\to\mathcal G$ of order $n$. By construction, those are $\psi^*(\mathcal O_S)$-linear.

Another characterization of $\Diff_{X/S}^n(\mathcal F,\mathcal G)$ for $n<\infty$ is the following. We have on $\iHom_{\psi^*\mathcal O_S}(\mathcal F,\mathcal G)$ an $\psi^*(\mathcal O_{X\times_S X})$-module structure coming from the two $\mathcal O_X$-module structures on $\iHom_{\psi^*\mathcal O_S}(\mathcal F,\mathcal G)$ (we may act on the argument and on the range). Then $\Diff_{X/S}^n(\mathcal F,\mathcal G)$ is (by definition) the subsheaf of $\iHom_{\psi^*\mathcal O_S}(\mathcal F,\mathcal G)$ annihilated by $\mathcal J_X^{n+1}$.

We refer to Proposition (16.8.8) of \cite{ega44} for yet another explicit characterization of differential operators.

The map $\delta_{X/S}^n$ induces a canonical isomorphism
\begin{equation}
\iHom_{\mathcal O_X}(\Pp_{X/S}^n(\mathcal F),\mathcal G)\;\cong\;\Diff_{X/S}^n(\mathcal F,\mathcal G).
\label{eq:Phomdiffiso}
\end{equation}
of sheaves of abelian groups (cf.\ Proposition (16.8.4) of loc.\ cit.).

We set $\Diff_{X/S}(\mathcal F,\mathcal G):=\Diff_{X/S}^\infty(\mathcal F,\mathcal G)$. Then {\em locally} every section $D$ of $\Diff_{X/S}(\mathcal F,\mathcal G)$ has an order, which, by definition, is the least integer $n$ such that $D$ occurs (locally) in the image of
$$
\Diff_{X/S}^n(\mathcal F,\mathcal G)\;\to\;
\Diff_{X/S}(\mathcal F,\mathcal G).
$$
By definition the (global) order of $D$ is the supremum of all local orders. It may be infinite if $X$ is not quasi-compact (which never happens in our applications). For quasi-compact $X$, $\Diff_{X/S}(\mathcal F,\mathcal G)$ is the presheaf colimit of the $\Diff_{X/S}^n(\mathcal F,\mathcal G)$, $n\in{\rm\bf N}_0$. In general, $\Diff_{X/S}(\mathcal F,\mathcal G)$ is the corresponding colimit in the category of sheaves.

By Proposition (16.8.9) \cite{ega44}, composition of morphisms of sheaves induces a well defined morphism
$$
\Diff_{X/S}^m(\mathcal G,\mathcal H)\otimes_{\mathcal O_X} \Diff_{X/S}^n(\mathcal F,\mathcal G)\;\to\;\Diff_{X/S}^{m+n}(\mathcal F,\mathcal H),
$$
$$
D\otimes D'\;\mapsto\;D\circ D'.
$$
In particular,
$$
\D_{X/S}\;:=\;
\Diff_{X/S}(\mathcal O_X,\mathcal O_X)
$$
carries a natural ring structure. It comes with a natural left and a natural right $\mathcal O_X$-module structure, and an increasing filtration given by
$$
\D_S^n(X)\;:=\;
\Diff_{X/S}^n(\mathcal O_X,\mathcal O_X).
$$
If $X\to S$ is locally of finite presentation, then $\D_S^n(X)$ for all $n\in{\rm\bf N}_0\cup\{\infty\}$ is a quasi-coherent $\mathcal O_X$-module for both module structures (cf.\ Proposition (16.8.6) in loc.\ cit.).

\subsection{The smooth case}\label{sec:smooth}

Recall that for $n\geq1$, the graded sheaf $\Gr(\Pp^n_{X/S})$ admits the sheaf $\Omega_{X/S}^1$ of $1$-differentials as $\Gr_1(\Pp^n_{X/S})$. The aim of this section is to recall how $\Omega_{X/S}^1$ \lq{}generates\rq{} $\D_{X/S}$. Recall the canonical isomorphism \eqref{eq:omegaxderivations}. Then if $x:X\to S$ is locally of finite presentation, and if $\mathcal F$ is quasi-coherent, so is $\Der_S(\mathcal O_X,\mathcal F)$. If, additionally, $S$ is locally noetherian and $\mathcal F$ is coherent, then $\Der_S(\mathcal O_X,\mathcal F)$ is coherent \cite[Corollaire (16.5.6)]{ega44}. We obtain the important special case
\begin{proposition}
If $S$ is locally noetherian and $X\to S$ locally of finite type\footnote{hence also locally of finite presentation}, then
$$
\Der_S(X)\;:=\;
\Der_{S}(\mathcal O_X,\mathcal O_X)
$$
is a coherent $\mathcal O_X$-module.
\end{proposition}

With the usual Lie bracket $[-,-]$, $\Der_S(X)$ carries the structure of an $x^*\mathcal O_S$-Lie algebra.

Recall that a morphism $x:X\to S$ is {\em smooth}, if it is locally of finite presentation and formally smooth. Furthermore, every smooth morphism is differentially smooth, cf.\ Proposition (17.12.4) in \cite{ega44}. An important consequence of the differential smoothness of a smooth $X/S$ is that the canonical morphism
$$
{\bf S}^\bullet_{\mathcal O_X}(\Omega_{X/S}^1)\;\to\;\Gr_\bullet(\Pp_{X/S})
$$
is an isomorphism. Furthermore, we have

\begin{proposition}[Propositions (17.2.3) and (17.12.4) in \cite{ega44}]
Let $x:X\to S$ be a smooth morphism. Then $\Omega_{X/S}^1$ is locally free of (locally) finite rank. Furthermore, the same conclusion applies to $\Pp_{X/S}^n$ and $\Gr_n(\Pp_{X/S})$.
\end{proposition}

\begin{corollary}\label{cor:smoothnesstoflatness}
If $X\to S$ is smooth\footnote{we need not assume $S$ to be locally noetherian in this particular case. Finite presentation is implicit in smooth and suffices to guarantee that the sheaf under consideration is quasi-coherent, which with the previous Proposition is enough.}, then $\Der_{S}(X)$ is locally free of finite rank, and for each $n\geq 0$, $\D_{X/S}^n$ is locally free of finite rank. In particular, $\D_{X/S}$ is locally free and therefore a flat $\mathcal O_X$-module.
\end{corollary}

\begin{remark}\label{rmk:smoothdifferentialoperators}
Assume $X/S$ smooth. Then, for any sufficiently small open affine $U\subseteq X$, $\Omega_{X/S}^1|_U$ is a free $\mathcal O_X|_U$-module, of rank $n$ say. For any $p\in U$, we find sections $s_1,\dots,s_n\in\Gamma(\mathcal O_X,U)$ with the property that the canonical images of the collection $ds_1,\dots,ds_n$ form a $k(p)$-basis of $\Omega_{X/S}^1\otimes_{\mathcal O_X}k(p)$. Therefore, by Nakayama's Lemma, the stalks $(ds_1)_p,\dots,(ds_n)_p$ form a basis of $\Omega_{X/S,p}^1$. Hence, if we assume $U$ small enough, $ds_1,\dots,ds_n$ form a basis of $\Gamma(U,\Omega_{X/S}^1)$. Let
$
\frac{\partial}{\partial s_1},\dots,\frac{\partial}{\partial s_n},
$
denote the dual basis in $\Gamma(U,\Der_S(X))$. Then any $\Gamma(S,\mathcal O_S)$-derivation $D$ of $\Gamma(U,\mathcal O_X)$ may be written uniquely as
$$
D\;=\;\sum_{i=1}^n a_i\cdot \frac{\partial}{\partial s_i},\quad a_1,\dots, a_n\in\Gamma(U,\mathcal O_X).
$$
For a multi-exponent ${\bf n}\in{\rm\bf N}_0^n$, we set
$$
D^{\bf n}\;:=\;\left(\frac{\partial}{\partial s_1}\right)^{{\bf n}_1}\cdots\;\;\left(\frac{\partial}{\partial s_n}\right)^{{\bf n}_n}.
$$
Then the collection of the $D^{\bf n}$, $|{\bf n}|\leq m$, is a basis of the $\mathcal O_X(U)$-module $\Gamma(U,\D_{X/S}^m)$, cf.\ Th\'eor\`eme (16.11.2) in \cite{ega44}.

In particular, we conclude that $\Gamma(U,\D_{X/S})$ is the $x^*\mathcal O_S(U)$-algebra generated by elements $\tilde{f},\tilde{\theta}$, where $f\in\mathcal O_X(U)$ and $\theta\in\Gamma(U,\Der_S(X))$, subject to the relations
\begin{itemize}
\item[(1)] $\tilde{f}_1+\tilde{f}_2\;=\;\widetilde{f_1+f_2}$,
\item[(2)] $\tilde{f}_1\tilde{f}_2\;=\;\widetilde{f_1f_2}$,
\item[(3)] $\tilde{\theta}_1+\tilde{\theta}_2\;=\;\widetilde{\theta_1+\theta_2}$,
\item[(4)] $[\tilde{\theta}_1,\tilde{\theta}_2]\;=\;\widetilde{[\theta_1,\theta_2]}$,
\item[(5)] $\tilde{f}\tilde{\theta}\;=\;\widetilde{f\theta}$,
\item[(6)] $[\tilde{\theta},\tilde{f}]\;=\;\widetilde{\theta(f)}$,
\end{itemize}
with elements drawn from the obvious sets of sections.
\end{remark}

\begin{remark}
In general, without any smoothness assumptions, it is easy to see that, if $s_1,\dots,s_n$ generate $\Omega_{X/S}|_U$, then dually the products of all $\delta^ks_1,\dots,\delta^ks_n$, of degree at most $m$, generate $\Pp_{X/S}^m|_U$, and that a differential operator $D$ on $U$ of degree $\leq m$ is determined by its values on the collection of these generators.
\end{remark}

\subsection{Flat connections}

\begin{definition}
Let $x:X\to S$ be a scheme over $S$ and $\mathcal M$ an $\mathcal O_X$-module. A {\em flat connection} on $\mathcal M$ is an $x^*\mathcal O_S$-linear morphism
$$
\nabla:\quad\Der_S(X)\to\iEnd_{x^*\mathcal O_S}(\mathcal M),\quad \theta\mapsto\nabla_\theta,
$$
satisfying for every\footnote{A collection of open subschemes $U$ which constitutes a base of the Zariski topology on $X$ is sufficient, in particular a collection of affine open $U\subseteq X$ covering $X$ is already enough.} open $U\subseteq X$ the following three conditions:
\begin{itemize}
\item[(i)] $\nabla_{f\theta}\;=\;f\nabla_\theta,\quad f\in\mathcal O_X(U),\,\theta\in\Gamma(U,\Der_S(X))$,
\item[(ii)] $\nabla_{\theta}(fs)\;=\;\theta(f)s+f\nabla_\theta(s),\;\; f\in\mathcal O_X(U),\,\theta\in\Gamma(U,\Der_S(X)),\,s\in\Gamma(U,\mathcal M)$,
\item[(iii)] $\nabla_{[\theta_1,\theta_2]}\;=\;[\nabla_{\theta_1},\nabla_{\theta_2}],\quad \theta_1,\theta_2\in\Gamma(U,\Der_S(X))$.
\end{itemize}
\end{definition}

Without any smoothness assumptions on $X/S$, each $\D_{X/S}$-module structure on $\mathcal M$ gives rise to a flat connection $\nabla$. Conversely, for $X\to S$ smooth, remark \ref{rmk:smoothdifferentialoperators} shows that each flat connection $\nabla$ as above gives rise to a unique left-$\D_X$-module structure on $\mathcal M$ via the rule
$$
\theta\cdot s\;:=\;\nabla_\theta(s),\quad\theta\in\Gamma(U,\Der_S(X)),\,s\in\Gamma(U,\mathcal M).
$$
This induces a natural $1$-to-$1$ correspondence between flat connections and $\D_{X/S}$-module structures on $\mathcal M$.

In the non-smooth case, a flat connection need not extend to an action of $\D_{X/S}$.

\subsection{Left and right $\mathcal D$-modules}\label{sec:leftright}

For smooth $X/S$, we define the canonical line bundle $\omega_{X/S}$ as the invertible sheaf on $X$ given locally on sufficiently small $U\subseteq X$ by $\bigwedge^{\dim_S U}\Omega_{U/S}^1$. For equidimensional $X$ (for example connected $X$), we have $\omega_{X/S}=\bigwedge^n\Omega_{X/S}$ for $n=\dim_SX$.

Now $\omega_{X/S}$ carries a natural right $\D_{X/S}$-module structure, and therefore, $\omega_{X/S}^{\otimes-1}=\Hom_{\mathcal O_X}(\omega_{X/S},\mathcal O_X)$ is a left $\D_{X/S}$-module. Writing $\D_{X/S}^{\rm op}$ for the $\mathcal O_X$-algebra opposite to $\D_{X/S}$, we have a canonical isomorphism
$$
\D_{X/S}^{\rm op}\;\cong\;\omega_{X/S}\otimes_{\mathcal O_X}\D_{X/S}\otimes_{\mathcal O_X}\omega_{X/S}^{\otimes-1}.
$$
of $\mathcal O_X$-algebras, as in the classical case. We remark that the category $\Mod(\D_{X/S}^{\rm op})$ of left $\D_{X/S}^{\rm op}$-modules, and the category of right $\D_{X/S}$-modules, and likewise $\Mod(\D_{X/S})$ and the category of right $\D_{X/S}^{\rm op}$-modules, are canonically isomorphic. Additionally, we have an equivalence
$$
\omega_{X/S}\otimes_{\mathcal O_X}(-):\quad \Mod(\D_{X/S})\;\to\;
\Mod(\D_{X/S}^{\rm op}),
$$
with quasi-inverse
$$
\omega_{X/S}^{\otimes-1}\otimes_{\mathcal O_X}(-):\quad \Mod(\D_{X/S}^{\rm op})\;\to\;
\Mod(\D_{X/S}).
$$
Therefore, the categories of left $\D_{X/S}$-modules and right $\D_{X/S}$-modules are equivalent. All these functors preserve $\mathcal O_X$-(quasi-)coherence.

\subsection{Base Change properties}

By Proposition (16.4.5) of \cite{ega44}, we have for any morphism of schemes $S'\to S$ a canonical isomorphism
$$
\psi^*\Omega_{X/S}\otimes_{\psi^*\mathcal O_X}\mathcal O_{X'}\;\cong\;\Omega_{X'/S'}
$$
where $(\psi,\theta):X':=X\times_S S'\to X$. Furthermore, without any assumption on $S'\to S$,
\begin{equation}
\psi^*\Pp_{X/S}^n\otimes_{\psi^*\mathcal O_X}\mathcal O_{X'}\;\to\;\Pp_{X'/S'}^n,
\label{eq:Pnbasechange}
\end{equation}
is always an isomorphism by Proposition (16.4.5) of loc.\ cit.

More generally, for every $n\in{\rm\bf N}_0$ the natural map
\begin{equation}
\psi^*\Gr_n(\Pp_{X/S}^\infty)\otimes_{\psi^*\mathcal O_X}\mathcal O_{X'}\;\to\;\Gr_n(\Pp_{X'/S'}^\infty),
\label{eq:grbasechange}
\end{equation}
is surjective. If $S'\to S$ is flat or $\Gr_n(\Pp_{X/S}^\infty)$ is flat, then \eqref{eq:grbasechange} is known to be an isomorphism by Corollaire (16.4.6) in loc.\ cit. The latter is the case if $X\to S$ is smooth, since then $\Gr_n(\Pp_{X/S}^\infty)$ (and also $\Pp_{X/S}^n$, $n<\infty$) is locally free of finite type (cf.\ Proposition (17.12.4) in loc.\ cit.).

We show

\begin{proposition}
Let $X$ be locally of finite presentation over an arbitrary base $S$. Then for every flat\footnote{It seems to me that one may replace the hypothesis on $S'/S$ by smoothness of $X/S$ and a suitable hypothesis on $\mathcal F$ and $\mathcal G$, i.e.\ coherent and locally free for $\mathcal F$ and quasi-coherent for $\mathcal G$ should be enough, cf.\ \cite{ega1}, Chap.\ 0, (4.3.3.1) and Bourbaki, Alg\`ebre, Chap.\ II, \S 4.2, Prop.\ 2, (ii).} morphism $S'\to S$ of schemes we have for every $n\in{\rm\bf N}_0$, every $\mathcal O_X$-module $\mathcal F$ of finite presentation and every $\mathcal O_X$-module $\mathcal G$ a natural isomorphism
$$
\psi^*\Diff_{X/S}^n(\mathcal F,\mathcal G)\otimes_{\psi^*\mathcal O_X}\mathcal O_{X'}\;\to\;
\Diff_{X'/S'}^n(\psi^*\mathcal F\otimes_{\psi^*\mathcal O_X}\mathcal O_{X'},\mathcal G\otimes_{\psi^*\mathcal O_X}\mathcal O_{X'}),
$$
where $(\psi,\theta):X':=X\times_S S'\to X$.
The same conclusions also hold for $n=\infty$.
\end{proposition}

\begin{proof}
We assume first that $n<\infty$. For readability we set
$$
\mathcal F'\;:=\;\psi^*\mathcal F\otimes_{\psi^*\mathcal O_X}\mathcal O_{X'}
$$
and likewise for $\mathcal G$.

Since $X/S$ is locally of finite presentation, Corollaire (16.4.22) of loc.\ cit.\ tells us that $\Pp_{X/S}^n$ is quasi-coherent of finite presentation. Therefore, by \cite{ega1}, Chap.\ 0, (6.7.6.1), (4.3.3.1), and \eqref{eq:Pnbasechange} we have a natural isomorphism
\begin{equation}
\psi^*\iHom_{\mathcal O_X}(\Pp_{X/S}^n\otimes_{\mathcal O_X}\mathcal F,\mathcal G)\otimes_{\psi^*\mathcal O_X}\mathcal O_{X'}
\;\cong\;
\iHom_{\mathcal O_{X'}}(\Pp_{X'/S'}^n\otimes_{\mathcal O_{X'}}\mathcal F',\mathcal G').
\label{eq:firsthomtensoriso}
\end{equation}
The claim for finite $n$ follows with \eqref{eq:Phomdiffiso}.

For infinite $n$,
we have
$$
\varinjlim_m\Diff_{X/S}^m(\mathcal F,\mathcal G)
\;=\;\Diff_{X/S}^\infty(\mathcal F,\mathcal G),
$$
and likewise for $X'/S'$. Now the functor $-\otimes_{\psi^*\mathcal O_X}\mathcal O_{X'}$ commutes with direct limits (cf.\ \cite{ega1}, Chap.\ 0, (4.3.2)), hence the claim follows.
\end{proof}

\begin{corollary}\label{cor:dbasechange}
If $X/S$ is of locally of finite presentation and $S'\to S$ is a flat morphism, we have for every $n\in{\rm\bf N}_0\cup\{\infty\}$ a canonical isomorphism
\begin{equation}
\psi^*\D_{X/S}^n\otimes_{\psi^*\mathcal O_X}\mathcal O_{X'}
\;\to\;
\D_{X'/S'}^n.
\label{eq:Dbasechange}
\end{equation}
\end{corollary}

\section{Generalities on $\mathcal D$-modules}\label{sec:Dmodules}

Let $S$ be any scheme and $X\to S$ locally of finite presentation. Recall that we write $\Mod_{\rm qc}(\D_{X/S})$ for the category of $\mathcal O_X$-quasi-coherent (left) $\D_{X/S}$-modules on $X$.

\subsection{$\mathcal D$-affine schemes}

\begin{definition}
We say that a scheme $x:X\to S$ is {\em $\mathcal D$-affine}, if it is locally of finite presentation and if the following two conditions are satisfied:
\begin{itemize}
\item[(i)] $x_*:\Mod(\mathcal O_X)\to\Mod(\mathcal O_S)$ sends quasi-coherent modules to quasi-coherent modules.
\item[(ii)] For every $\mathcal M\in\Mod_{\rm qc}(\D_{X/S})$
\begin{equation}
\forall q>0:\quad R^qx_*(\mathcal M)\;=\;0.
\label{eq:affinecohomologyvanishing}
\end{equation}
\item[(iii)] For every $\mathcal M\in\Mod_{\rm qc}(\D_{X/S})$ we have an equivalence
$$
\mathcal M\;=\;0\quad\Leftrightarrow\quad x_*\mathcal M\;=\;0.
$$
\end{itemize}
\end{definition}

\begin{remark}
Obviously ${\bf1}_X:X\to X$ is $\mathcal D$-affine. More generally, any affine morphism $x:X\to S$ of finite presentation is $\mathcal D$-affine by Corollaire (1.3.2) in \cite{ega31}.
\end{remark}

\begin{remark}\label{rmk:onDaffinei}
Sufficient conditions on $x:X\to S$ to satisfy condition (i) are (cf.\ \cite[Corollaire 9.2.2]{ega1} for (b), (c) and (d)):
\begin{itemize}
\item[(a)] $S$ is affine.
\item[(b)] $x$ is (quasi-)separated and quasi-compact.
\item[(c)] $x$ is separated and of finite type.
\item[(d)] $x$ is quasi-compact and $X$ is locally noetherian.
\item[(e)] $x$ is of finite type and $S$ is locally noetherian\footnote{this implies that $X$ is locally noetherian and that $x$ is of finite presentation. In our basic case $S=\Spec k$, $S$ is even noetherian and we may study any $X$ of finite type over $S$.}.
\end{itemize}
\end{remark}

\begin{remark}
In the case of $S=\Spec k$ for $k$ a field (or more generally a noetherian ring), any scheme $X\to S$ of finite type is of finite presentation and quasi-compact. Furthermore, in that case, and more generally if $S$ is affine, the pushforward functor $x_*(-)$ may be identified with the functor $\Gamma(X,-)$ of global sections, hence (i) is automatically satisfied in this case and the derived functors in (ii) correspond to sheaf cohomology $H^q(X,-)$.
\end{remark}

\begin{proposition}\label{prop:Daffinezariskilocal}
Let $S$ be a scheme. The property of being a $\mathcal D$-affine $S$-scheme is local in the Zariski topology: If $x:X\to S$ is a scheme over $S$, then $x$ is $\mathcal D$-affine if and only if for some (equivalently, all) open cover $(V_j)_j$ of $S$, the collection of the schemes $x^{-1}(V_j)\to V_j$ is $\mathcal D$-affine.
\end{proposition}

We will see in Theorem \ref{thm:Daffinefpqclocal} below that being $\mathcal D$-affine is local in the $fpqc$ topology.

\begin{proof}
Properties (i) and (iii) are Zariski local by definition. As for (ii), it suffices to observe that $R^qx_*(\mathcal M)$ is the sheaf associated to the presheaf $
V\mapsto H^q(x^{-1}(V),\mathcal M).
$
\end{proof}

\subsection{Quasi-coherent $\mathcal D$-modules}

\begin{proposition}\label{prop:firstequivalenceovergeneralbase}
Assume that $X$ is a $\mathcal D$-affine scheme over a scheme $S$. Then
\begin{itemize}
\item[(i)] Every $\mathcal M\in\Mod_{\rm qc}(\D_{X/S})$ is generated by its relative sections over $S$ as a $\D_{X/S}$-module.
\item[(ii)] The functor
$$
x_*:\quad
\Mod_{\rm qc}(\D_{X/S})\to
\Mod_{\rm qc}(x_*\D_{X/S})
$$
is an equivalence of categories.
\end{itemize}
\end{proposition}

\begin{proof}
The proof proceeds as in the classical case with only minor modifications. We sketch the argument.

For (i), consider the image $\mathcal N$ of the canonical map
$$
\D_{X/S}\otimes_{\mathcal O_X}x^*x_*\mathcal M
\;\to\;
\mathcal M,
$$
induced by the counit $x^*x_*\to{\bf1}$, which, by definition, is the submodule generated by the relative sections. We obtain a short exact sequence
$$
\begin{CD}
0@>>>\mathcal N@>>>\mathcal M@>>>\mathcal M/\mathcal N@>>> 0.
\end{CD}
$$
Since $X$ is $\mathcal D$-affine, application of $x_*(-)$ yields a short exact sequence
$$
\begin{CD}
0@>>>x_*\mathcal N@>i>>x_*\mathcal M@>>>x_*(\mathcal M/\mathcal N)@>>> 0.
\end{CD}
$$
Now $i$ is surjective, since the canonical map
$$
x_*x^*x_*\mathcal M\to x_*\mathcal M
$$
is already surjective for formal reasons. Whence the cokernel of $i$ vanishes, and consequently $\mathcal M/\mathcal N$ vanishes since $X$ is $\mathcal D$-affine.

As for statement (ii), observe first that $\mathcal C:=x_*\D_{X/S}$ is quasi-coherent, because $\D_{X/S}$ is quasi-coherent and $X$ is $\mathcal D$-affine. Now $\D_{X/S}$ is a right $x^*\mathcal C$-module, and every $\mathcal O_S$-quasi-coherent left $\mathcal C$-module $M$ gives rise to an $\mathcal O_X$-quasi-coherent left $x^*\mathcal C$-module $x^*M$ (cf.\ \cite[Prop.\ (9.1.4)]{ega1}). Therefore, we have a functor
$$
\D_{X/S}\otimes_{x^*\mathcal C}x^*(-):\quad
\Mod_{\rm qc}(x_*\D_{X/S})\to
\Mod_{\rm qc}(\D_{X/S}).
$$
We claim that this is a quasi-inverse of $x_*$. By construction, $\D_{X/S}\otimes_{x^*\mathcal C}x^*(-)$ is a left adjoint of $x_*$. Whence it suffices to prove that the unit and counit of the adjunction are isomorphisms.

Since $\mathcal C$ is a quasi-coherent $\mathcal O_S$-module, locally any $\mathcal O_S$-quasi-coherent $\mathcal C$-module $\mathcal M$ admits a presentation
$$
\begin{CD}
\mathcal C^{(n)}|_U@>>> \mathcal C^{(m)}|_U@>>> \mathcal M|_U@>>> 0,
\end{CD}
$$
where $m$ and $n$ are cardinal numbers and $\mathcal C^{(n)}$ denotes the direct sum of $n$ copies of $\mathcal C$ (any affine $U\subseteq S$ does the job). We write $x|_U:x^{-1}U\to U$ for the restriction of $x:X\to S$ to $x^{-1}U$. We remark that
$$
\D_{X/S}|_{x^{-1}U}\;=\;\D_U(x^{-1}U).
$$
Therefore, $x|_U:x^{-1}U\to U$ is $\mathcal D$-affine. Since $(x|_U)_*$ is exact, $\D_U(x^{-1})\otimes_{x^*\mathcal C|_U}((x|_U)^*(-))$ is right exact, and we obtain with the canonical isomorphism
$$
(x_*\D_{X/S}\otimes_{x^*\mathcal C}x^* {\mathcal M})|_U\;=\;
\D_U(x^{-1}U)\otimes_{x^*\mathcal C|_{x^{-1}U}} {\mathcal M}|_U.
$$
the diagram
$$
\begin{CD}
\mathcal C^{(n)}|_U@>>> \mathcal C^{(m)}|_U@>>> \mathcal M|_U@>>> 0\\
@| @| @VV\varepsilon_{\mathcal M}|_U V @|\\
\mathcal C^{(n)}|_U@>>> \mathcal C^{(m)}|_U@>>> x_*(\D_{X/S}\otimes_{x^*\mathcal C}x^*{\mathcal M})|_U
@>>> 0
\end{CD}
$$
with exact rows. We conclude that locally, and hence a fortiori globally, the unit $\varepsilon_\bullet$ of the adjunction is an isomorphism.

As for the counit
$$
\delta_{\mathcal M}:\quad
\D_{X/S}\otimes_{x^*\mathcal C}x^*x_*\mathcal M\to\mathcal M,
$$
we already know by (i) that it is surjective, i.e.\ we obtain a short exact sequence
$$
\begin{CD}
0@>>>\mathcal N@>>>
\D_{X/S}\otimes_{x^*\mathcal C}x^*x_*\mathcal M@>>>\mathcal M@>>>0,
\end{CD}
$$
where $\mathcal N$ denotes the kernel of the counit. Since $\varepsilon_{x_*\mathcal M}$ is an isomorphism, application of $x_*$ yields a short exact sequence
$$
\begin{CD}
0@>>>x_*\mathcal N@>>>
x_*\mathcal M@>>>x_*\mathcal M@>>>0,
\end{CD}
$$
whence $x_*\mathcal N$ vanishes. Since $\mathcal N$ is quasi-coherent, the fact that $X$ is $\mathcal D$-affine shows $\mathcal N=0$.
\end{proof}

\begin{proposition}\label{prop:injectiveobjects}
For $X/S$ arbitrary with $X$ quasi-compact, and $\mathcal A$ an $\mathcal O_X$-flat $\mathcal O_X$-quasi-coherent $\mathcal O_X$-algebra. Then each $\mathcal M\in\Mod_{\rm qc}(\mathcal A)$ embeds into an injective object $\mathcal I\in\Mod_{\rm qc}(\mathcal A)$, which we may assume to be injective in $\Mod(\mathcal O_X)$.
\end{proposition}

We emphasize that $\mathcal I$ needs not be injective within the category of all $\mathcal A$-modules.

\begin{proof}
The proof proceeds mutatis mutandis as the proof of Proposition 1.4.14 in \cite{hottaetal2008}.
\end{proof}

\begin{corollary}\label{cor:injectiveobjects}
For $X/S$ smooth, $S$ quasi-compact, each $\mathcal M\in\Mod_{\rm qc}(\D_{X/S})$ embeds into an injective object $\mathcal I\in\Mod_{\rm qc}(\D_{X/S})$, which we may assume to be flabby.
\end{corollary}

\begin{proof}
By Corollary \ref{cor:smoothnesstoflatness}, $\D_{X/S}$ is a flat $\mathcal O_X$-module, whence the claim.
\end{proof}

\begin{remark}\label{rmk:sufficientcondition2}
Corollary \ref{cor:injectiveobjects} tells us that for $x:X\to S$ smooth and $S$ quasi-compact the category $\Mod_{\rm qc}(\D_{X/S})$ contains enough injectives. They are $x_*(-)$-acyclic and in the case at hand, condition (ii) in definition of $\mathcal D$-affineness becomes equivalent to $x_*(-)$ being exact on $\mathcal O_X$-quasi-coherent $\D_{X/S}$-modules.
\end{remark}

\subsection{Coherent $\mathcal D$-modules}

We begin with an easy observation in

\begin{proposition}\label{prop:coherentDgenerators}
Assume $X\to S$ of finite type and $S$ noetherian. Then a coherent $\D_{X/S}$-module $\mathcal M$ is generated by an $\mathcal O_X$-coherent $\mathcal O_X$-submodule.
\end{proposition}

The last statement is to be understood that there is a coherent $\mathcal O_X$-submodule $\mathcal F$ of $\mathcal M$ with the property that the canonical map
$$
\D_{X/S}\otimes_{\mathcal O_X}\mathcal F\to\mathcal M
$$
be an epimorphism of sheaves.

\begin{proof}
Since $\mathcal M$ is locally finitely generated, we find a finite affine covering $U_i$, $i\in I$, of $X$ with the property that on each $U_i$, $\mathcal M|_{U_i}$ is a finitely generated $\D_{U_i/S}$-module. This is the same to say that there is a coherent $\mathcal O_{U_i}$-submodule $\mathcal F_i$ in $\mathcal M|_{U_i}$ which generates $\mathcal M|_{U_i}$ as $\D_{U_i/S}$-module. Now each $\mathcal F_i$ canonically extends to a coherent $\mathcal O_X$-submodule $\mathcal G_i$ of $\mathcal M$ (cf.\ Th\'eor\`eme (9.4.7) in \cite{ega1}), and the finite sum $\mathcal G$ of the modules $\mathcal G_i$, $i\in I$, is a coherent $\mathcal O_X$-submodule of $\mathcal M$ which generates $\mathcal M$.
\end{proof}

If $X\to S$ is locally of finite presentation, we saw in section \ref{sec:differentialoperators} that $\D_{X/S}=\Diff_{X/S}^\infty(\mathcal O_X,\mathcal O_X)$ is naturally equipped with the structure of a filtered $\mathcal O_X$-algebra. The finite filtration steps $\D_{X/S}^n$ are quasi-coherent $\mathcal O_X$-modules.

Later in this section, we will restrict our attention to the case where $X/S$ is smooth. Then, by Corollary \ref{cor:smoothnesstoflatness}, $\D_{X/S}$ is locally free and all filtration steps are locally free of finite rank. We will also assume that $S$ be noetherian.

Before we proceed to this case, we recall and generalize some essential facts about {\em good filtrations}. In the case of rings, all of the following statements are contained in Appendix D.1 of \cite{hottaetal2008}.

\begin{proposition}\label{prop:affinegoodfiltration}
For a filtered (not necessarily commutative) ring $A$ and an $A$-module $M$ the following are equivalent:
\begin{itemize}
\item[(i)] $M$ is a finitely generated $A$-module.
\item[(ii)] $M$ admits a filtration such that $\Gr(M)$ is a finitely generated $\Gr(A)$-module.
\end{itemize}
\end{proposition}

If $M$ is finitely generated, we call a filtration as in (ii) {\em good}. Every finitely generated module admits good filtrations by the above Proposition.

\begin{proposition}\label{prop:affinenoetheriancriterion}
If for a filtered ring $A$, $\Gr(A)$ is left / right noetherian, then so is $A$.
\end{proposition}

The the sheaf theoretic analogues of these notions are the following. If $\mathcal M$ is a quasi-coherent $\mathcal O_X$-module over a scheme $X$, then a filtration $\mathcal F_i$, $i\in I$, of $\mathcal M$ is always assumed to consist of quasi-coherent $\mathcal O_X$-modules $\mathcal F_i$. Then  $\Gr_\bullet(\mathcal M)$ is quasi-coherent as well. Furthermore, if $\mathcal M$ is an $\mathcal O_X$-algbera (with unit), we assume that locally on affine opens $U\subseteq X$ all filtrations statisfy the conditions (a)-(e) from Appendix D.1 in \cite{hottaetal2008}.

We remark that we only suppose that
$$
\varinjlim_{i\in I}\mathcal F_i\;=\;\mathcal M
$$
as {\em sheaves}. In particular, we only know locally for open affine\footnote{or more generally quasi-compact} $U\subseteq X$, that
$$
\bigcup_{i\in I}\Gamma(U,\mathcal F_i)\;=\;\Gamma(U,\mathcal M).
$$

\begin{proposition}\label{prop:schemegoodfiltration}
 Let $X$ be a noetherian scheme and $\mathcal A$ a filtered quasi-coherent $\mathcal O_X$-algebra (always with unit). Assume that $\Gr_\bullet(\mathcal M)$ is quasi-coherent. Let $\mathcal M$ be a quasi-coherent $\mathcal A$-module. Then the following are equivalent:
\begin{itemize}
\item[(i)] $\mathcal M$ is a (locally) finitely generated $\mathcal A$-module.
\item[(ii)] $\mathcal M$ admits a filtration such that $\Gr_\bullet(\mathcal M)$ is quasi-coherent and $\Gr(\mathcal M)$ is a finitely generated $\Gr(\mathcal A)$-module.
\end{itemize}
\end{proposition}

\begin{proof}
Cover $X$ with finitely many affine open subsets $U_1,\dots,U_r$. For every such affine open $U_j$, statements (i) and (ii) are equivalent to statements (i) and (ii) in Proposition \ref{prop:affinegoodfiltration} for $B_j=\Gamma(U_i,\mathcal A)$ and $M_j=\Gamma(U_j,\mathcal M)$. Therefore, $\mathcal M$ is locally finitely generated, and by Th\'eor\`eme (9.4.7) in \cite{ega1} it is also globally finitely generated. The implication (ii) $\Rightarrow$ (i) follows.

Assuming (i), i.e.\ that $\mathcal M$ is locally finitely generated, we first conclude with Th\'eor\`eme (9.4.7) of loc.\ cit.\ that we find an $\mathcal O_X$-coherent submodule $\mathcal M_0\subseteq\mathcal M$ together with an epimorphism
$$
s:\quad\mathcal A\otimes_{\mathcal O_X}\mathcal M_0\to\mathcal M.
$$
The canonical images of $\mathcal A_i\otimes\mathcal M_0$ under $s$ then define a filtration $\mathcal M_i$ on $\mathcal M$ with the desired properties.
\end{proof}

Again we call a filtration of $\mathcal M$ satisfying (ii) {\em good}.

\begin{proposition}\label{prop:schemenoetheriancriterion}
Assume $X$ is a noetherian scheme. A filtered quasi-coherent $\mathcal O_X$-algebra $\mathcal A$ is locally left / right noetherian if $\Gr(\mathcal A)$ is locally left / right noetherian.
\end{proposition}

We remark that this is only really meaningful if $\mathcal O_X$ itself is locally noetherian.

\begin{proof}
The claim reduces to Proposition \ref{prop:affinenoetheriancriterion} in the same way like Proposition \ref{prop:schemegoodfiltration} reduces to Proposition \ref{prop:affinegoodfiltration}.
\end{proof}

\begin{proposition}\label{prop:Dnoetherian}
Assume $X/S$ smooth and $S$ locally noetherian.
Then  $\D_{X/S}$ is locally left and right noetherian. In particular, for every affine open $U\subseteq X$, the $\mathcal O_X|_U$-algebra $\D_{X/S}|_U$ is left and right noetherian. Furthermore, for any $p\in X$, the $\mathcal O_{X,p}$-algebra $\D_{X/S,p}$ is left and right noetherian.
\end{proposition}

\begin{proof}
The hypothesis on $X\to S$ implies that that $X$ is locally noetherian and also that $\D_{X/S}$ is a quasi-coherent (even locally free) filtered $\mathcal O_X$-module with each filtration step locally free of finite rank by Corollary \ref{cor:smoothnesstoflatness}. More precisely, we know by Remark \ref{rmk:smoothdifferentialoperators} that locally, for sufficient affine open $U\subseteq X$, we obtain a polynomial algebra
$$
\Gr(\D_{U/S})\;=\;\mathcal O_X(U)[D_1,\dots,D_n].
$$
Since $\mathcal O_X(U)$ is noetherian, this algebra is noetherian, and whence by Proposition \ref{prop:schemenoetheriancriterion}, $\D_{U/S}$ is locally left and right noetherian. A foriori, we conclude that for every affine open $U\subseteq X$, $\D_{X/S}|_U=\D_{U/S}$ is left and right noetherian. The claim about the stalks follows by a similar argument.
\end{proof}

\begin{corollary}\label{cor:Dnoetherian}
If $X\to S$ is smooth and $S$ noetherian, then $\D_{X/S}$ is a left and right noetherian $\mathcal O_X$-algebra.
\end{corollary}

\begin{proposition}\label{prop:coherentDmodules}
For smooth $X\to S$ and $S$ locally noetherian, a $\D_{X/S}$-module $\mathcal M$ is $\D_{X/S}$-coherent if and only if $\mathcal M$ is a $\mathcal O_X$-quasi-coherent and locally finitely generated $\D_{X/S}$-module.
\end{proposition}

\begin{proof}
The proof proceeds as in the classical case. Assume $\mathcal M$ to be $\D_{X/S}$-coherent. Then, by definition, $\mathcal M$ is locally finitely generated as $\D_{X/S}$-module. We need to show that $\mathcal M$ is $\mathcal O_X$-quasi-coherent.

For every open $U\subseteq X$ such that $\mathcal M|_U$ is finitely generated, we obtain an exact sequence
$$
\begin{CD}
(\D_{U/S})^n@>>>
(\D_{U/S})^m@>>>\mathcal M|_U@>>>0
\end{CD}
$$
with finite $m,n\geq 0$, by the definition of $\D_{X/S}$-coherence. Now we already know that $\D_{U/S}$ is $\mathcal O_U$-quasi-coherent, and the claim follows.

Assume converely that $\mathcal M$ is an $\mathcal O_X$-quasi-coherent locally finitely generated $\D_{X/S}$-module. Choose any open $U\subseteq X$ and consider for any $m\geq 0$ the exact sequence
$$
\begin{CD}
0@>>>\mathcal K@>>>
(\D_{U/S})^m@>>>\mathcal M|_U
\end{CD}
$$
of $\mathcal O_U$-modules. We need to show that $\mathcal K$ is a locally finitely generated $\D_{U/S}$-module. Hence, without loss of generality, we may assume $U$ affine. Then, because $\mathcal M$ is $\mathcal O_X$-quasi-coherent, $\mathcal K$ is quasi-coherent as well, and the above exact sequence is the same as the exact squence
$$
\begin{CD}
0@>>>\Gamma(U,\mathcal K)@>>>
\Gamma(U,\D_{X/S})^m@>>> \Gamma(U,\mathcal M)
\end{CD}
$$
of $\mathcal O_X(U)$-modules. Now by Proposition \ref{prop:Dnoetherian}, $\Gamma(U,\D_{X/S})$ is a left noetherian ring and therefore $\Gamma(U,\mathcal K)$ is a finitely generated $\Gamma(U,\D_{X/S})$-module. We conclude that every locally finitely generated submodule of $\mathcal M|_U$ is a locally finitely presentated $\D_{U/S}$-module. This concludes the proof.
\end{proof}

\begin{corollary}
For $X\to S$ smooth and $S$ locally noetherian, $\D_{X/S}$ is a $\D_{X/S}$-coherent $\D_{X/S}$-module.
\end{corollary}

\begin{theorem}
Let $X\to S$ be smooth and $S$ locally noetherian. Then a $\D_{X/S}$-module $\mathcal M$ is $\mathcal O_X$-coherent if and only if $\mathcal M$ is a locally free $\mathcal O_X$-module of finite rank.
\end{theorem}

\begin{proof}
If $\mathcal M$ is locally free, then $\mathcal M$ is quasi-coherent and $\mathcal O_X$-coherent because $X$ is locally noetherian.

For the other implication, assume that $\mathcal M$ is coherent as $\mathcal O_X$-module. It suffices to see that for each $x\in X$, the stalk $\mathcal M_x$ is free. The proof of this claim proceeds as the proof of Theorem 1.4.10 in \cite{hottaetal2008}.
\end{proof}

\begin{corollary}
For $X/S$ smooth and $S$ locally noetherian, the category $\Mod_{\rm c}(\D_{X/S})$ of $\D_{X/S}$-coherent $\D_{X/S}$-modules is a thick abelian subcategory of $\Mod_{\rm qc}(\D_{X/S})$. In particular, the category of integrable connections on $X$ (i.e.\ the category of pairs $(\mathcal M,\nabla)$, with $\mathcal M$ a locally free $\mathcal O_X$-module of finite rank and $\nabla$ a flat connection on $\mathcal M$), is abelian.
\end{corollary}

\begin{proposition}\label{prop:coherentequivalenceovergeneralbase}
Assume $X/S$ smooth and $\mathcal D$-affine and $S$ locally noetherian. Then, under the equivalence in Proposition \ref{prop:firstequivalenceovergeneralbase}, $\Mod_{\rm c}(\D_{X/S})$ corresponds to locally finitely generated $x_*(\D_{X/S})$-modules.
\end{proposition}

\begin{proof}
By restricting to an affine open $V\subseteq S$, we may assume that $S$ is affine without loss of generality (cf.\ Proposition \ref{prop:Daffinezariskilocal}). In this case the proof proceeds as the proof of Proposition 1.4.13 in \cite{hottaetal2008}.
\end{proof}

\subsection{Locally free resolutions}

Recall that if $S$ is noetherian, an $S$-scheme $X$ is {\em projective} if the structural morphism $X\to S$ factors as $X\to\mathbb P_S^n\to S$, where the first map is assumed to be a closed immersion, and the second is the canonical structural morphism. With this terminology $X$ is called {\em quasi-projective}, if $X\to S$ factors into an open immersion $X\to Y$ of finite type and a projective map $Y\to S$ (cf.\ Corollaire (5.3.3) in \cite{ega2}).

\begin{theorem}\label{thm:freeresolutions}
Assume that $X\to S$ is smooth and quasi-projective and $S$ noetherian. Then:
\begin{itemize}
\item[(i)] For any $\mathcal O_X$-quasi-coherent $\D_{X/S}$-module $\mathcal M$ we find a locally free\footnote{both as $\mathcal O_X$ and as $\D_{X/S}$-module at once since we are supposing $X/S$ smooth; without this assumption only locally free as $\D_{X/S}$-module.} $\D_{X/S}$-module $\mathcal F$ which admits $\mathcal M$ as homomorphic image.
\item[(ii)] If
$\mathcal M$ is $\D_{X/S}$-coherent, then $\mathcal F$ in (i) may be chosen of finite rank over $\D_{X/S}$.
\end{itemize}
\end{theorem}

\begin{proof}
Choose a quasi-coherent $\mathcal O_X$-submodule $\mathcal F_0$ of $\mathcal M$ which generates $\mathcal M$. If $\mathcal M$ is $\D_{X/S}$-coherent, we may suppose $\mathcal F_0$ locally free of finite rank by Proposition \ref{prop:coherentDgenerators}, because $X$ is quasi-compact.

It is a standard fact that $\mathcal F_0$ is an epimorphic image of a locally free $\mathcal O_X$-module $\mathcal G$, of finite rank if $\mathcal F_0$ is of finite rank.

Indeed, fix an immersion $i:X\to\mathbb P_S^n$, which realizes $X$ as a quasi-projective scheme. Since $S$ is noetherian, so is $X$, and we recall that therefore every $\mathcal O_X$-quasi-coherent $\mathcal O_X$-module $\mathcal F_0$ is an inductive limit of coherent submodules (cf.\ Corollaire (9.4.9) in \cite{ega1}. Therefore, we may assume without loss of generality that $\mathcal F_0$ is coherent.

By Proposition (4.5.5) d) in \cite{ega2}, there are $n,r\geq 0$ and an epimorphism
$$
\mathcal O(-n)^{r}\;\to\;i_*(\mathcal F_0),
$$
where the domain is locally free of finite rank. Therefore, the composition
$$
\mathcal F:=i^*(\mathcal O(-n)^{r})\;\to\;i^*i_*(\mathcal F_0)\;\to\;\mathcal F_0
$$
is surjective, with domain again locally free of finite rank, and the standard fact follows.

From this we deduce an epimorphism $
\D_{X/S}\otimes_{\mathcal O_X}\mathcal F\to\mathcal M
$
of $\D_{X/S}$-modules, and the claim follows because $\D_{X/S}$ is locally free by Corollary \ref{cor:smoothnesstoflatness}.
\end{proof}

We conclude that for $X/S$ smooth and quasi-projective and $S$ noetherian, every quasi-coherent $\D_{X/S}$-module admits a locally free resolution. In order to bound the resolution, we need to recall a few facts about dimensions.

The relative dimension of $x:X\to S$ at a $p\in X$ is by definition the dimension $\dim_p X_p$ of the fiber at $p$, where the latter is the infimum of the dimensions of open subschemes $U\subseteq X_p$ containing $p$. In general the dimension is only upper semi-continuous in $p\in X$.

If $x:X\to S$ is smooth, then for each $p\in X$, we have
$$
\dim_p x\;=\;\rank_{\mathcal O_{X,p}}\Omega_{X/S,p}^1
$$
and in particular the dimension is a continuous function in $p\in X$ (cf.\ Proposition (17.10.2) \cite{ega44}). The relative dimension of $X/S$ is by definition the supremum of all relative dimensions at all $p\in X$.

In remark \ref{rmk:smoothdifferentialoperators} we have seen that $\rank_{\mathcal O_{X,p}}\Omega_{X/S,p}^1$ equals the relative dimension of the ring $\Gr(\D_{U/S})$ over $\mathcal O_{U}$ for a sufficiently small affine open $U\subseteq X$ containing $p$.

If $S$ is noetherian we therefore obtain for every $p\in X$ for the absolute dimension the formula
$$
\dim \Gr(\D_{X/S,p})\;=\;2\dim_p X+\dim_{x(p)}S.
$$
This function is only upper semi-continuous in general. Likewise, we obtain for any affine open $U\subseteq X$,
$$
\dim \Gr(\D_{U/S})\;\leq\;2\dim U+\dim S.
$$
With Theorem D.2.6 in \cite{hottaetal2008} we conclude

\begin{theorem}\label{thm:existenceofboundedcomplexes}
Assume $X/S$ smooth and $S$ noetherian. Then the left (resp.\ right) global dimension of $\D_{X/S}$ is bounded by $2\dim X+\dim S$.
\end{theorem}

\begin{remark}\label{rmk:locallyprojectiveresolutions}
In particular, under the hypothesis of the Theorem \ref{thm:freeresolutions}, we see that every $\mathcal M\in\Mod_{\rm qc}(\D_{X/S})$ admits a locally projective resolution of length $\leq 2\dim X+\dim S$, which in all degrees may be chosen finitely generated if $\mathcal M$ is $\D_{X/S}$-quasi-coherent.
\end{remark}

\begin{remark}\label{rmk:flatresolutions}
For a not necessarily $\mathcal O_X$-quasi-coherent $\D_{X/S}$-module, Proposition \ref{prop:Dnoetherian} implies the existence of bounded flat resolutions (under the assumptions of Theorem \ref{thm:existenceofboundedcomplexes}).
\end{remark}

\section{Operations with $\mathcal D$-modules}\label{sec:operationswithDmodules}

We first recall several statements about base change for quasi-coherent sheaves and then discuss applications.

\subsection{Review of base change}

We recall that if $x:X\to S$ is a morphism of schemes and $\mathcal F$ is an $\mathcal O_X$-module, then $\mathcal F$ is called flat over $S$ if for every $p\in X$ the module $\mathcal F_p$ is a flat $\mathcal O_{S,x(p)}$-module. If $S=\Spec k$ is the spectrum of a field, then every $\mathcal F$ is flat over $S$.

We recall the following results from \cite{ega31, ega32}.

\begin{theorem}[{Flat base change I, \cite[Proposition (1.4.15)]{ega31}}]\label{thm:flatbasechange1}
Let $x:X\to S$ be separated of finite type, and $\mathcal F$ a quasi-coherent $\mathcal O_X$-module. Then we have for every flat morphism $s:S'\to S$ and every degree $q$ a canonical isomorphism
$$
R^qx'_*(y^*\mathcal F)
\;\cong\;
s^*R^qx_*(\mathcal F)
$$
where $x':X'=X\times_S S'\to S'$ and $y:X'\to X$ is the canonical projection.
\end{theorem}

\begin{theorem}[Flat base change II]\label{thm:flatbasechange2}
Let $x:X\to S$ be separated quasi-compact, and $\mathcal F$ a quasi-coherent $\mathcal O_X$-module, flat over $S$, and assume that for all degrees $q$ the modules $R^qx_*(\mathcal F)$ are flat over $S$. Then we have for every $s:S'\to S$ and every degree $q$ a canonical isomorphism
$$
R^qx'_*(y^*\mathcal F)
\;\cong\;
s^*R^qx_*(\mathcal F)
$$
with the notation as in Theorem \ref{thm:flatbasechange1}.
\end{theorem}

\begin{proof}
This is a special case of Corollaire (6.9.9), \'equation (6.9.9.2), \cite{ega32}, where the complex $\Pp^\bullet$ in the statement of loc.\ cit.\ is given by $\mathcal F$ concentrated in degree $0$.
\end{proof}

\subsection{Flat base change for $\mathcal D$-modules}

We put ourselves in the following general situation. Let $S$ be an arbitrary scheme, $x:X\to S$ locally of finite presentation, and $s:S'\to S$ flat. We let $x'=X\times_S S'$ and write $x':X'\to S'$ and $y:X'\to X$ for the canonical projections.

These are precisely the hypotheses of Corollary \ref{cor:dbasechange}, and we see that the canonical map
\begin{equation}
y^*\D_{X/S}\;\to\;\D_{X'/S'}.
\label{eq:Dringbasechange}
\end{equation}
is an isomorphism. Therefore, for any $\mathcal M\in\Mod_{\rm qc}(\D_{X/S})$, the quasi-coherent $\mathcal O_{X'}$-module $y^*\mathcal M$ carries a natural $\D_{X'/S'}$-module structure. More precisely we obtain

\begin{theorem}\label{thm:flatDmodulebasechange}
Let $S$ be a scheme, $x:X\to S$ locally of finite presentation, $s:S'\to S$ flat, and $X'=X\times_S S'$, with the remaining notation as before. Then
\begin{itemize}
\item[(i)] Pullback along $y$ induces an exact functor
$$
y^*:\quad
\Mod_{\rm qc}(\D_{X/S})\to \Mod_{\rm qc}(\D_{X'/S'}).
$$
\item[(ii)] The functor $y^*$ preserves the following properties of $\mathcal M$:
\begin{itemize}
\item[(a)] (local) finite generation,
\item[(b)] (local) finite presentation,
\item[(c)] $\mathcal O_X$-coherence,
\item[(d)] $\mathcal O_X$-local freeness.
\end{itemize}
\item[(iii)] We have in each degree $q$ for every $\mathcal M\in\Mod_{\rm qc}(\D_{X/S})$ a canonical map
$$
s^*(R^qx_*\mathcal M)\;\to\;(R^qx'_*)y^*\mathcal M,
$$
which is an isomorphism whenever $x:X\to S$ is separated of finite type.
\item[(iv)] For $x:X\to S$ is separated of finite presentation, the following diagram commutes stricly:
$$
\begin{CD}
\Mod_{\rm qc}(\D_{X'/S'})@>x'_*>>
\Mod(x'_*\D_{X'/S'})\\
@Ay^*AA @AAs^*A\\
\Mod_{\rm qc}(\D_{X/S})@>x_*>>
\Mod(x_*\D_{X/S})
\end{CD}
$$
Here $s^*$ is exact as well.
\end{itemize}
\item[(v)] If $x:X\to S$ is separated of finite presentation and $s:S'\to S$ faithfully flat, then $y^*$ is faithful and we have for every $\mathcal M\in\Mod_{\rm qc}(\D_{X/S})$ and every degree $q$,
$$
R^qx_*\mathcal M=0\quad\Leftrightarrow\quad(R^qx'_*)y^*\mathcal M=0.
$$
\end{theorem}

\begin{proof}
Statement (i) is clear. With the isomorphism \eqref{eq:Dringbasechange} and the exactness of $y^*$, statements (ii), (a), (b) follow readily. Statements (c) and (d) follow from $y^*\mathcal O_X=\mathcal O_{X'}$ and the fact that $y^*$ commutes with arbitrary direct sums. Statement (iii) is well known. Statement (iv) follows from Theorem \ref{thm:flatbasechange1}. Statement (v) is a consequence of (iv) and the faithfulness of $s^*$.
\end{proof}

\begin{corollary}\label{cor:flatDmodulebasechange}
Under the general hypotheses of Theorem \ref{thm:flatDmodulebasechange}, if additionally $X\to S$ is smooth and $S$ locally noetherian, then the exact functor $y^*$ preserves $\mathcal D$-coherence.
\end{corollary}

\begin{proof}
This follows from Theorem \ref{thm:flatDmodulebasechange} (ii), (a) together with Proposition \ref{prop:coherentDmodules}.
\end{proof}

The first elementary consequence of faithfully flat descent is

\begin{corollary}\label{cor:Daffinenessdescent}
Let $x:X\to S$ be separated of finite presentation and $s:S'\to S$ faithfully flat and quasi-compact. Then, if $X'/S'$ is $\mathcal D$-affine, then $X/S$ is $\mathcal D$-affine.
\end{corollary}

\begin{proof}
Let $\mathcal M$ be in $\Mod_{\rm qc}(\D_{X/S})$. By faithfully flat descent, $x_*\mathcal M$ is quasi-coherent, because $s^*x_*\mathcal M=x'_*y^*\mathcal M$ is quasi-coherent. The higher direct images
$$
R^qx_*\mathcal M\;=\;0
$$
vanish for $q>0$, because they do so after application of the faithful functor $s^*$. Likewise, if $x_*\mathcal M$ vanishes, then $x'_*y^*\mathcal M$ vanishes, hence $y^*\mathcal M$ vanishes and since $y^*$ is faithful, this implies the vanishing of $\mathcal M$.
\end{proof}

We remark that if $x:X\to S$ is additionally quasi-compact, then all higher direct images $R^qx_*$, $q\geq 0$, always preserve quasi-coherence. This holds more generally for quasi-separated quasi-compact $X/S$, cf.\ Remark \ref{rmk:onDaffinei}.

\begin{theorem}\label{thm:Daffinefpqclocal}
For $x:S\to S$ separated of finite presentation being $\mathcal D$-affine is local in the $fpqc$ topology.
\end{theorem}

\begin{proof}
Using Corollary \ref{cor:Daffinenessdescent}, the proof proceeds as in the case of the Zariski topology (cf.\ Proposition \ref{prop:Daffinezariskilocal}).
\end{proof}

\subsection{Faithfully flat descent for $\mathcal D$-modules}

Here are more interesting consequences of faithfully flat descent. Set $S'':=S'\times_S S'$, and consider the commutative square
$$
\begin{CD}
S'' @>\pi_2>> S'\\
@V\pi_1VV @VVsV\\
S' @>>x> S\\
\end{CD}
$$
where $\pi_i:S''\to S'$ denotes the $i$-th projection. We set $X''=X\times_S S''$ and denote $z:X''\to X$ the canonical projection.

By \eqref{eq:Dbasechange}, we may define a descent datum for $\mathcal D$-modules is defined mutatis mutandis like a descent datum for $\mathcal O_X$-modules, replacing all $\mathcal O_X$-linear maps by $\D_{X/S}$-linear maps.

\begin{theorem}\label{thm:fpqcDmoduledescent}
Let $x:X\to S$ be separated of finite presentation and $s:S'\to S$ faithfully flat and quasi-compact. For any quasi-coherent $\D_{X/S}$-modules $\mathcal M,\mathcal N$ we have:
\begin{itemize}
\item[(i)] A $\mathcal O_X$-linear morphism $f:\mathcal M\to\mathcal N$ is $\D_{X/S}$-linear if and only if the induced morphism
$$
y^*f:\quad y^*\mathcal M\to y^*\mathcal N
$$
is $\D_{X'/S'}$-linear.
\item[(ii)] For $S''=S'\times_S S'$, $X''=X\times_SS''$, the sequence of abelian groups
\begin{equation}
\begin{CD}
\Hom_{\D_{X/S}}(\mathcal M,\mathcal N)@>y^*>>
\Hom_{\D_{X'/S'}}(y^*\mathcal M,y^*\mathcal N)@>\pi_1^*>>
\Hom_{\D_{X''/S''}}(z^*\mathcal M,z^*\mathcal N)\vspace*{-1.5em}
\\
@. @>>\pi_2^*>
\end{CD}
\label{eq:fpqcmorphismdescent}
\end{equation}
is exact.
\item[(iii)] $y^*$ induces a natural equivalence between the category $\Mod_{\rm qc}(\D_{X/S})$ and the category of quasi-coherent $\D_{X'/S'}$-modules with descent data.
\item[(iv)] The following properties are local in the $fpqc$ topology, i.e.
$$
\mathcal M\;\text{satisfies property (P)}\quad\Leftrightarrow\quad
y^*\mathcal M\;\text{satisfies property (P)},
$$
where (P) is:
\begin{itemize}
\item[(a)] (local) finite generation,
\item[(b)] (local) finite presentation,
\item[(c)] $\mathcal O_X$-flatness,
\item[(d)] $\mathcal O_X$-local freeness of finite type,
\item[(e)] $\mathcal O_X$-local freeness of finite rank $n$,
\item[(f)] $\mathcal D$-coherence.
\end{itemize}
\end{itemize}
\end{theorem}

\begin{remark}
Statement (ii) (\lq{}$fpqc$ descent for morphisms of $\mathcal D$-modules\rq{}) may be restated as follows. A morphism $f:y^*\mathcal M\to y^*\mathcal N$ of $\D_{X'/S'}$-modules is of the form $f=y^*g$ for some morphism $g:\mathcal M\to \mathcal N$ of $\D_{X/S}$-modules if and only if
$$
\pi_1^*f\;=\;
\pi_2^*f.
$$
Statement (iii) has a similar but more involved explicit formulation. A special case of (ii) and (iii) is Galois descent for $\mathcal D$-modules in the case $S=\Spec k$ and $S'=\Spec k'$, $k'/k$ a Galois extension of fields.  In particular, properties (a) - (f) over $k$ may be checked over an algebraic closure $k'$.
\end{remark}

\begin{remark}
In the situation of a finite Galois extension $k'/k$ with Galois group $\Gal(k'/k)$, statements (ii) and (iii) are equivalent to saying that the category of $\D_{X/S}$-modules is equivalent to the category of $\D_{X'/S'}$-modules with a semi-linear action of $\Gal(k'/k)$.

From this perspective, the proof of Theorem 5.12 in \cite{januszewskirationality} amounts to establishing that there is such a Galois action in the case at hand if and only if said symmetric bilinear forms exist.
\end{remark}

\begin{proof}
Statement (i) is an elementary consequence of (ii).

For statement (ii), we observe that, by $fpqc$ descent for morphisms, we know that
$$
\begin{CD}
\Hom_{\mathcal O_{X}}(\mathcal M,\mathcal N)@>y^*>>
\Hom_{\mathcal O_{X'}}(y^*\mathcal M,y^*\mathcal N)@>\pi_1^*>>
\Hom_{\mathcal O_{X''}}(z^*\mathcal M,z^*\mathcal N)\vspace*{-1.5em}
\\
@. @>>\pi_2^*>
\end{CD}
$$
is exact. By (i) we deduce from this the diagram \eqref{eq:fpqcmorphismdescent}, which remains exact because the functor of $\D_{X/S}$-invariants is left exact.

Statement (iii) follows from $fpqc$ descent for quasi-coherent sheaves, observing that the functor $\D_{-/-}$ is an $fpqc$ sheaf by means of \eqref{eq:Dbasechange}.

Let us prove statement (iv).

First we observe that properties (a), (b) and (f) are all local properties in the Zariski topology and that $U\subseteq X$ is open if and only if $y^{-1}U\subseteq X'$ is open, and likewise on $S$. Therefore, we may assume without loss of generality that $X$ and $S$ are affine. By Corollaire (2.2.12) in \cite{ega42} we may assume without loss of generality that also $S'$ and hence $X'$ are both affine. This reduces us to the situation of modules over the rings $\Gamma(X,\D_{X/S})$ and $\Gamma(X,\D_{X'/S'})$, where the second is faithfully flat over the first. Therefore, properties (a) and (b) are $fpqc$ local by \cite[Proposition 11, Chap.\ I, \S 3, no.\ 6]{bourbaki}. The statement for property (f) reduces to properties (a) and (b) by the definition of $\mathcal D$-coherence.

Properties (c), (d) and (e), may be verified within the category of quasi-coherent $\mathcal O_X$-modules, where the statements follow from Proposition (2.5.1) and Proposition (2.5.2), (iii) and (iv), in \cite{ega42}.
\end{proof}

\subsection{Inverse and direct images}

Let $f:Y\to X$ be a morphism of $S$-schemes, $X$ and $Y$ both smooth over $S$. We recall that then, for each $n\geq 0$, $\Pp^n_{X/S}$ and $\Pp^n_{Y/S}$ are both locally free of (locally) finite rank. Therefore, we have
\begin{equation}
f^*\iHom_{\mathcal O_X}(\Pp_{X/S}^n,\mathcal O_X)\;=\;
\iHom_{\mathcal O_Y}(f^*\Pp_{X/S}^n,\mathcal O_Y),
\label{eq:Dnsmoothbigbasechange}
\end{equation}
which follows readily stalk wise.

From $f$ we obtain an induced morphism
of augmented $\mathcal O_Y$-algebras
$
f^*\Pp_{X/S}^n\to\Pp^n_{Y/S},
$
cf.\ Proposition (16.4.18) \cite{ega44}. This in turn induces by \eqref{eq:Dnsmoothbigbasechange} a canonical map
$
\D_{Y/S}^n\to
f^*\D_{X/S}^n
$
of sheaves of rings, whose colimit gives us a canonical map
\begin{equation}
\D_{Y/S}\to
f^*\D_{X/S}
\label{eq:canonicalpullbackmap}
\end{equation}
of filtered sheaves of rings. Therefore, we obtain a right exact functor
$$
f^*:\quad\Mod_{\rm qc}(\D_{X/S})\to
\Mod_{\rm qc}(\D_{Y/S}),
$$
which is classically called the {\em inverse image functor}. In the literature $f^*\D_{X/S}$ is often denoted $\D_{Y\to X}$.

We also have an induced exact sequence
$$
f^*\Omega_{X/S}^1\to\Omega_{Y/S}^1\to\Omega_{Y/X}^1\to 0
$$
of quasi-coherent $\mathcal O_Y$-modules (cf.\ Corollaire (16.4.9) in \cite{ega44}), which, if $f$ is also smooth, extends to a short exact sequence
\begin{equation}
0\to f^*\Omega_{X/S}^1\to\Omega_{Y/S}^1\to\Omega_{Y/X}^1\to 0,
\label{eq:smoothexactsequence}
\end{equation}
cf.\ Proposition (17.2.3) \cite{ega44}.

Back in the general situation of an $S$-morphism $f:Y\to X$, we deduce from the canonical map $f^*\Omega_{X/S}^1\to\Omega_{Y/S}^1$ a morphism
$
\Der_S(Y)\to f^*\Der_S(X),
$
and the operation $f^*$ is compatible with the passage from $\mathcal D$-modules to connections.

The {\em direct image} of a {\em right} $\D_{Y/S}$-module $\mathcal M$ is defined as
$$
f_*(\mathcal M\otimes_{\D_{Y/S}}f^*\D_{X/S}).
$$
For left modules $\mathcal M$ this translates to
\begin{equation}
\omega_{X/S}^{\otimes-1}\otimes_{\mathcal O_X}f_*\left(f^*\D_{X/S}\otimes_{\D_{Y/S}}\left(\omega_{Y/S}\otimes_{\mathcal O_Y}\mathcal M\right)\right),
\label{eq:explicitdirectimage}
\end{equation}
cf.\ section \ref{sec:leftright}. This formula simplifies if we define the {\em
  transfer bimodule}
$$
\D_{X\leftarrow Y/S}\;:=\;\omega_{Y/S}\otimes_{\mathcal O_Y}f^*\D_{X/S}\otimes_{f^*\mathcal O_X}f^*\left(\omega_{X/S}^{\otimes-1}\right).
$$
This is an $(f^*\D_{X/S},\D_{Y/S})$-bimodule, and \eqref{eq:explicitdirectimage} takes the simpler form
$
f_*(\D_{X\leftarrow Y/S}\otimes_{\D_{Y/S}}\mathcal M).
$

\subsection{Derived inverse and direct images}

We assume as before that $f:Y\to X$ is a morphism of smooth $S$-schemes, with $S$ locally noetherian.

For a sheaf of rings $\mathcal R$ on $X$ (or $Y$), we write $D^{\rm b}(\mathcal R)$ for the (locally) bounded derived category of $\mathcal R$-modules, i.e.\ we assume that for each $p\in X$ exists an open neighborhood $U\subseteq X$ of $p$ with the property that the restriction of the complex under consideration is bounded in the classical sense. If $X$ is quasi-compact, then this notion reduces to the classical notion of bounded complexes.

For $\bullet\in\{-,\rm qc,\rm c\}$, we let $D^{\rm b}_{\bullet}(\mathcal R)$ denote the full (triangulated) subcategory of complexes whose cohomology lies degree-wise in $\Mod_\bullet(\mathcal R)$.

Remark \ref{rmk:flatresolutions} translates to the fact that every $\mathcal K\in D^{\rm b}(\D_{X/S})$ may be represented by a (locally) bounded complex of flat $\D_{X/S}$-modules. If $\mathcal K$ lies in $D^{\rm b}_{\rm qc}(\D_{X/S})$, then we always find bounded locally projective resolutions (cf.\ Remark \ref{rmk:locallyprojectiveresolutions}).

Define the derived preimage as the left derived functor of $f^*$, i.e.\ it is given by
$$
Lf^*:\quad D^{\rm b}_{\bullet}(\D_{X/S})\to D_{\bullet}^{\rm b}(\D_{Y/S}),\quad \bullet\in\{-,\rm qc\}.
$$
Explicitly, if $f=(\psi,\theta)$, then $Lf^*(\mathcal M^\bullet)$ is given by
$$
\mathcal O_Y\otimes_{\psi^*\mathcal O_X}\psi^*\mathcal M^\bullet\;=\;
f^*\D_{X/S}\otimes_{\psi^*\D_{X/S}}\psi^{*}\mathcal M^\bullet.
$$
It is clear that $Lf^*$ preserves complexes of $\mathcal O_X$-quasi-coherent modules. It does not necessarily perserve $\mathcal D$-coherent modules.

\begin{proposition}\label{prop:smoothpreimage}
Assume $f:Y\to X$ is a smooth morphism between smooth $S$-schemes, $S$ locally noetherian. Then
\begin{itemize}
\item[(i)] For any degree $q> 0$, and any $\mathcal M\in\Mod(\D_{X/S})$, we have
$$
L_qf^*(\mathcal M)\;=\;0.
$$
\item[(ii)] $f^*$ (and $Lf^*$) preserves $\mathcal D$-coherent modules.
\end{itemize}
\end{proposition}

\begin{proof}
As for (i), observe that smooth morphisms are flat, whence the claim follows.

By (i), it suffices to observe that the canonical map \eqref{eq:canonicalpullbackmap} is surjective. By the exactness of the sequence \eqref{eq:smoothexactsequence}, this follows with Remark \ref{rmk:smoothdifferentialoperators}.
\end{proof}

The definition of the derived direct image for left $\D_{Y/S}$-modules is explicitly given by
$$
\int_f: \quad D^{\rm b}(\D_{Y/S})\to D^{\rm b}(\D_{X/S}),
$$
$$
\mathcal M^\bullet\mapsto
Rf_*(\D_{X\leftarrow Y/S}\otimes^L_{\D_{Y/S}}\mathcal M^\bullet).
$$
Here $Rf_*$ is understood as the restriction of the derived functor
$$
Rf_*:\quad D^{\rm b}(\mathcal O_{Y})\to
D^{\rm b}(\mathcal O_{X}),
$$
to
$$
Rf_*:\quad
D^{\rm b}(f^*\D_{X/S})\to
D^{\rm b}(\D_{X/S}),
$$
and the inner functor is a left derived functor, which on the level of $\mathcal D$-modules is given by
\begin{equation}
\D_{X\leftarrow Y/S}\otimes^L_{\D_{Y/S}}(-):
\quad D^{\rm b}(\D_{Y/S})\to
D^{\rm b}(f^*\D_{X/S}).
\label{eq:leftderiveddirectimage}
\end{equation}

\begin{proposition}\label{prop:basechangefordirectimages1}
Let $f:Y\to X$ be a morphism of smooth $S$-schemes, $S$ locally noetherian. Assume that $s:S'\to S$ is flat. Denote by $f':Y'\to X'$ the base change of $f$ to $S'$. Then we have a canonical commuting square
$$
\begin{CD}
D^{\rm b}(\D_{Y'/S'})
@>\D_{X'\leftarrow Y'/S'}\otimes^L_{\D_{Y'/S'}}(-)>>
D^{\rm b}({f'}^*\D_{X'/S'})\\
@Ay^*AA @AAy^*A\\
D^{\rm b}(\D_{Y/S})
@>>\D_{X\leftarrow Y/S}\otimes^L_{\D_{Y/S}}(-)>
D^{\rm b}(f^*\D_{X/S})
\end{CD}
$$
\end{proposition}

\begin{proof}
The proof is an elementary degenerate instance of the Grothendieck spectral sequence. Since the passage from left $\mathcal D$-modules to right $\mathcal D$-modules commutes with flat base change, we may consider the equivalent diagram
$$
\begin{CD}
D^{\rm b}(\D_{Y'/S'}^{\rm op})
@>(-)\otimes^L_{\D_{Y'/S'}}{f'}^*\D_{X'/S'}>>
D^{\rm b}({f'}^*\D_{X'/S'}^{\rm op})\\
@Ay^*AA @AAy^*A\\
D^{\rm b}(\D_{Y/S}^{\rm op})
@>>(-)\otimes^L_{\D_{Y/S}}f^*\D_{X/S}>
D^{\rm b}(f^*\D_{X/S}^{\rm op})
\end{CD}
$$
Then by the flatness of $s:S'\to S$, the canonical maps $y^*\D_{Y/S}\to \D_{Y'/S'}$ and $y^*\D_{X/S}\to \D_{X'/S'}$ are isomorphisms (cf.\ Corollary \ref{cor:dbasechange}). In particular, we conclude (with \cite[(4.3.3.1), Chap.\ 0]{ega1}), that for every right $\D_{Y/S}$-module $\mathcal M$ we have a canonical isomorphism
\begin{equation}
y^*(\mathcal M)
\otimes_{\D_{Y'/S'}}
{f'}^*\D_{X'/S'}
=
y^*\left(
\mathcal M
\otimes_{\D_{Y'/S'}}
f^*\D_{X/S}
\right).
\label{eq:preimagecommutativity}
\end{equation}

For every object $\mathcal K$ in $D^{\rm b}(\D_{Y/S}^{\rm op})$ we find a bounded complex $\mathcal M^\bullet$ of $\D_{Y/S}$-flat right modules representing it. Furthermore, the base change of a $\D_{Y/S}$-flat right module is $\D_{Y'/S'}$-flat, hence $y^*(\mathcal M^\bullet)$ is a flat complex representing $y^*\mathcal K$. This shows that
$
y^*(\mathcal K)
\otimes^L_{\D_{Y'/S'}}
{f'}^*\D_{X'/S'}
$
is represented by the complex
\begin{equation}
y^*(\mathcal M^\bullet).
\otimes_{\D_{Y'/S'}}
{f'}^*\D_{X'/S'}
\label{eq:fprimeycomplex}
\end{equation}
The functor
$
(-)\otimes_{\D_{Y/S}}f^*\D_{X/S}
$
preserves flatness as well, and we concude that
$
y^*\left(
\mathcal K
\otimes^L_{\D_{Y/S}}
{f}^*\D_{X/S}
\right)
$
is represented by the complex
\begin{equation}
y^*\left(
\mathcal M^\bullet
\otimes_{\D_{Y/S}}
f^*\D_{X/S}
\right).
\label{eq:yfcomplex}
\end{equation}
The canonical isomorphism \eqref{eq:preimagecommutativity} shows that the complexes \eqref{eq:yfcomplex} and \eqref{eq:fprimeycomplex} are canonically isomorphic.
\end{proof}

\begin{proposition}\label{prop:basechangefordirectimages2}
Let $f:Y\to X$ be a morphism of smooth $S$-schemes, $S$ noetherian. Assume that $s:S'\to S$ is flat. Denote by $f':Y'\to X'$ the base change of $f$ to $S'$. Then we have a canonical commuting square
$$
\begin{CD}
D_{\rm qc}^{\rm b}(\D_{X'\leftarrow Y'/S'})
@>Rf'_*>>
D^{\rm b}_{\rm qc}(\D_{X/S})\\
@Ay^*AA @AAy^*A\\
D_{\rm qc}^{\rm b}(\D_{X\leftarrow Y/S})
@>>Rf_*>
D_{\rm qc}^{\rm b}(\D_{X/S})
\end{CD}
$$
\end{proposition}

\begin{proof}

This is a special case of Theorem \ref{thm:flatbasechange1}.
\end{proof}

\begin{theorem}[Base change for direct images]\label{thm:basechangefordirectimages}
Let $f:Y\to X$ be a morphism of smooth $S$-schemes, $X\to S$ separated and $S$ locally noetherian. Assume that $s:S'\to S$ is flat. Denote by $f':Y'\to X'$ the base change of $f$ to $S'$. Then we have a canonical commuting square
$$
\begin{CD}
D^{\rm b}_{\rm qc}(\D_{Y'/S'})
@>\int_{f'}>>
D^{\rm b}_{\rm qc}(\D_{X'/S'})\\
@Ay^*AA @AAy^*A\\
D^{\rm b}_{\rm qc}(\D_{Y/S})
@>>\int_f>
D^{\rm b}_{\rm qc}(\D_{X/S})
\end{CD}
$$
\end{theorem}

\begin{proof}
By Propositions \ref{prop:basechangefordirectimages1} and \ref{prop:basechangefordirectimages2} it suffices to prove that the functor \eqref{eq:leftderiveddirectimage} preserves $\mathcal O_X$-quasi-coherent modules. This will be achieved in Proposition \ref{prop:preservationofqcmodules} below.
\end{proof}

\begin{lemma}\label{lem:directimageforclosedimmersions}
Assume $S$ locally noetherian and $j:Y\to X$ a closed immersion of smooth $S$-schemes. Then the functor \eqref{eq:leftderiveddirectimage} for $f=j$ preserves $\mathcal O_X$-quasi-coherent modules, i.e.\ it induces a functor
$$
\D_{X\leftarrow Y/S}\otimes^L_{\D_{Y/S}}(-):
\quad D^{\rm b}_{\rm qc}(\D_{Y/S})\to
D^{\rm b}_{\rm qc}(j^*\D_{X/S}),
$$
and satisfies
$$
\forall q\neq 0:\quad H^q\left(\D_{X\leftarrow Y/S}\otimes^L_{\D_{Y/S}}(\mathcal M)\right)\;=\;0
$$
for any complex $\mathcal M$ of $\D_{Y/S}$-modules concentrated in degree $0$.
\end{lemma}

\begin{proof}
We pass again to right $\mathcal D$-modules, for which it suffices to show that we obtain a well defined functor.
$$
(-)\otimes^L_{\D_{Y/S}}j^*\D_{X/S}:
\quad D^{\rm b}_{\rm qc}(\D_{Y/S}^{\rm op})\to
 D^{\rm b}_{\rm qc}(j^*\D_{X/S}^{\rm op}).
$$
This is implied by the second claim, translated to right modules.

We first remark that the morphism
$$
j^*\Pp_{X/S}^n\to\Pp^n_{Y/S},
$$
is known to be surjective (cf.\ Proposition (16.4.20) \cite{ega44}), and hence, dually
$$
\D_{Y/S}\to
j^*\D_{X/S}
$$
is a monomorphism.

Furthermore, we have a short exact sequence
$$
0\to \mathcal N_{Y/X}\to j^*(\Omega_{X/S}^1)\to\Omega_{Y/S}^1\to 0,
$$
which is locally split (cf.\ Proposition (17.2.5) \cite{ega44}). Assume $p\in Y$ arbitrary and $U\subseteq Y$ a sufficiently small open containing $p$, such that we obtain a splitting
\begin{equation}
j^*(\Omega_{X/S}^1)|_U = \mathcal N_{Y/X}|_U\oplus\Omega_{Y/S}^1|_U,
\label{eq:Omegasplitting}
\end{equation}
and such that $j^*(\Omega_{X/S}^1)$ and $\Omega_{Y/S}^1$ are both free. We conclude that $\mathcal N_{Y/X}|_U$ is a finitely generated projective $\mathcal O_Y$-module, hence locally free, and, after possibly shrinking $U$ further, finite free.

Hence, locally, we have an isomorphism
\begin{equation}
j^*\D_{X/S}|_U\;=\;
\D_{Y/S}|_U\otimes_{\mathcal O_U}{\rm S}_{\mathcal O_U}(\mathcal N_{Y/X}|_U),
\end{equation}\label{eq:dsymmetriciso}
where ${\rm S}_{\mathcal O_U}(\mathcal N_{Y/X}|_U)$ denotes the symmetric $\mathcal O_U$-algebra generated by $\mathcal N_{Y/X}|_U$. Therefore, $j^*\D_{X/S}|_U$ is a locally free left $\D_{Y/S}$-module, and the claim follows.
\end{proof}

\begin{remark}
The isomorphism \eqref{eq:dsymmetriciso} has the following explicit description. For sufficiently small affine open $U\subseteq Y$ and $V\subseteq X$ containing $p$ and $f(p)$, we find sections $s_1,\dots,s_n$ in $\Gamma(V,\mathcal O_X)$ such that $ds_1,\dots,ds_n$ form a basis of $\Gamma(V,\Omega_{X/S}^1)$, and for which the first $m$ components $ds_1,\dots,ds_m$ originate from a basis of $\mathcal N_{Y/X}|_U$ and the last $n-m$ components from a basis of $\Omega_{Y/S}^1|_U$ respectively via the splitting \eqref{eq:Omegasplitting}. Following Remark \ref{rmk:smoothdifferentialoperators}, we obtain, locally on $U$,
$$
j^*\D_{X/S}|_U\;=\;
\D_{Y/S}|_U\otimes_{\mathcal O_U}\mathcal O_U\left[\left(\frac{\partial}{\partial s_i}\right)_{1\leq i\leq n}\right].
$$
\end{remark}

\begin{lemma}\label{lem:directimageforprojections}
Assume $S$ locally noetherian and $X$ and $Y$ smooth $S$-schemes, and write $p:Y\times_S X\to Y$ for the canonical projection. Then the functor \eqref{eq:leftderiveddirectimage} for $f=p$ preserves $\mathcal O_X$-quasi-coherent modules, i.e.\ it induces a functor
$$
\D_{Y\leftarrow Y\times_S X/S}\otimes^L_{\D_{Y/S}}(-):
\quad D^{\rm b}_{\rm qc}(\D_{Y/S})\to
D^{\rm b}_{\rm qc}(p^*\D_{X/S}).
$$
\end{lemma}

\begin{proof}
We consider the Spencer resolution
$$
\cdots
\to\Omega_{X/S}^{{\bf n}-1}\otimes_{\mathcal O_X}\D_{X/S}
\to\Omega_{X/S}^{\bf n}\otimes_{\mathcal O_X}\D_{X/S}
\to\omega_{X/S}\to 0
$$
of the right $\D_{X/S}$-module $\omega_{X/S}$, which is concentrated in degree $0$, and where locally ${\bf n}$ is the dimension, i.e.\ for equidimensional $U\subseteq X$ of relative dimension $n$, the Spencer resolution is explicitly given by
$$
\cdots
\to\bigwedge^{n-1}\Omega_{X/S}|_U\otimes_{\mathcal O_U}\D_{X/S}|_U
\to\bigwedge^{n}\Omega_{X/S}|_U\otimes_{\mathcal O_U}\D_{X/S}|_U
\to\omega_{X/S}|_U\to 0.
$$
Hence the Spencer resolution is a (locally) bounded complex $\mathcal S_{X/S}^\bullet$: Its restriction to $U$ vanishes in degrees $<-(n+1)=-(\dim_S U+1)$.

Its differential is explicitly given for local coordinates in \cite[Lemma 1.5.27]{hottaetal2008}. The proof in loc.\ cit.\ applies to our general situation as well and shows that the Spencer resolution is acyclic. It is obviously locally free over $\mathcal O_X$.

Now consider the outer tensor product
$
\D_{Y/S}\boxtimes\,\mathcal S_{X/S}^\bullet
$
on $Y\times_S X$, which is a resolution of $\D_{Y\leftarrow Y\times_S X/S}\boxtimes\,\omega_{X/S}$, and a straightforward computation with the Spencer complex shows that for every $\mathcal M\in\Mod_{\rm qc}(\D_{Y\times_SX/S})$, the $p^*\D_{Y/S}$-module
$
\D_{Y\leftarrow Y\times_SX/S}\otimes_{\D_{Y\times_SX/S}}^L\mathcal M
$
is represented by the quasi-coherent relative de Rham complex
$
\Omega_{Y\times_SX/Y}^{\bullet-{\bf n}}\otimes_{\mathcal O_{Y\times_SX}}\mathcal M,
$
with ${\bf n}$ as before. This concludes the proof.
\end{proof}

\begin{proposition}\label{prop:preservationofqcmodules}
Assume $S$ noetherian and $f:Y\to X$ a morphism of smooth $S$-schemes, with $X\to S$ separated. Then the functor \eqref{eq:leftderiveddirectimage} preserves $\mathcal O_X$-quasi-coherent modules, i.e.\ it induces a functor
$$
f^*\D_{X/S}\otimes^L_{\D_{Y/S}}(-):
\quad D^{\rm b}_{\rm qc}(\D_{Y/S})\to
 D^{\rm b}_{\rm qc}(f^*\D_{X/S}).
$$
\end{proposition}

\begin{proof}
Since $X/S$ is separated, the graph
$
F:Y\to Y\times_SX
$
is a closed immersion, and we have $f=p\circ F$ in the notation of Lemma \ref{lem:directimageforprojections}. The claim follows from Lemmas \ref{lem:directimageforclosedimmersions} and \ref{lem:directimageforprojections}.
\end{proof}

\section{Twisted sheaves of differential operators}

We briefly recall relevant notions and properties of twisted sheaves of differential operators.

\subsection{Sheaves of differential operators of higher rank}

Let $\mathcal M$ denote a quasi-coherent $\mathcal O_X$-module on $X$. Attached to $\mathcal M$ is an $\mathcal O_X$-quasi-coherent ring of differential operators
$$
\D_{X/S}^{\mathcal M}\;:=\;\Diff_{X/S}({\mathcal M},{\mathcal M}).
$$
For $\mathcal M$ locally free of finite rank we obtain for every $n\in{\rm\bf N}_0$ canonical isomorphism
\begin{eqnarray*}
\Diff_{X/S}^n({\mathcal M},{\mathcal M})
&=&
\iHom_{\mathcal O_X}(\Pp_{X/S}^n({\mathcal M}),{\mathcal M})\\
&=&
\iHom_{\mathcal O_X}(\Pp_{X/S}^n\otimes_{\mathcal O_X}{\mathcal M},\mathcal O_X)\otimes_{\mathcal O_X}{\mathcal M}\\
&\cong&
{\mathcal M}^\vee\otimes_{\mathcal O_X}
\iHom_{\mathcal O_X}(\Pp_{X/S}^n,\mathcal O_X)\otimes_{\mathcal O_X}{\mathcal M}\\
&=&
{\mathcal M}^\vee\otimes_{\mathcal O_X}
\D_{X/S}^n\otimes_{\mathcal O_X}{\mathcal M},
\end{eqnarray*}
where
$
{\mathcal M}^\vee:=
\iHom_{\mathcal O_X}({\mathcal M},\mathcal O_X)
$
denotes the dual module. Passing to the inductive limit shows
\begin{equation}
\D_{X/S}^{\mathcal M}\;\cong\;
{\mathcal M}^\vee\otimes_{\mathcal O_X}
\D_{X/S}\otimes_{\mathcal O_X}{\mathcal M},
\label{eq:twistedDtountwistedD}
\end{equation}
canonically as $\mathcal O_X$-algebras. In particular, we see that $\D_{X/S}^{\mathcal M}$ is locally isomorphic to a finite direct sum of copies of $\D_{X/S}$ and comes with a canonical filtration. We remark that Corollary \ref{cor:dbasechange} remains valid for $\D_{X/S}^{\mathcal M}$ replacing $\mathcal D_{X/S}$.

\subsection{Twisted sheaves of differential operators}

Since in our applications we are working in the context of (families of) algebraic groups, we content us with the following definition. For an approach to a more general definition (in the rank $1$ case) we refer to \S2 of \cite{kashiwara1989}.
\begin{definition}
Let $X/S$ be an $S$-scheme locally of finite presentation. A {\em twisted sheaf of differential operators on $X$} is an $\mathcal O_X$-module $\mathcal A$ on $X$ which is locally isomorphic to $\mathcal D_{X/S}^{\mathcal M}$ for a locally free $\mathcal O_X$-module $\mathcal M$ of finite rank. We call the (local) rank of $\mathcal M$ the {\em rank} of $\mathcal A$.
\end{definition}
We remark that being a twisted sheaf of differential operators is a local property on $X$ but not on the base. Furthermore, in the above definition we may replace the Zariski topology by a finer topology to obtain different notions of twisting.

The results from sections \ref{sec:Dmodules} and \ref{sec:operationswithDmodules} carry over without modification to rings of twisted differential operators $\mathcal A$. In particular we have a notion of $\mathcal A$-affine schemes, which is again a local property in the $fpqc$ topology, and likewise the statements on $\mathcal D$-modules, base change properties, etc.\ generalize to $\mathcal A$-modules.

\subsection{Group actions and quotients}

Let $G$ be a group scheme over a base scheme $S$ and $X$ a scheme over $S$. Then a right action of $G$ on $X$ is a morphism $\mu:X\times_S G\to X$ of $S$-schemes satisfying the categorification of the usual two axioms of a group action (associativity and trivial action of the unit section of $G$), which are enforced by the commutativity of the the obvious corresponding diagrams in the category of $S$-schemes.

A notorious difficulty in computing quotients in the category of schemes is that for arbitrary $S$-schemes $A$ we do in general {\em not} have an equality
\begin{equation}
(X/G)(A)\;=\;X(A)/G(A).
\label{eq:quotients}
\end{equation}
The reason is the following. If we embed the category of $S$ schemes into the category of contravariant functors of $S$-schemes to sets, associating to an $S$-scheme $Y$ the functor $Y:A\mapsto Y(A):=\Hom_S(A,Y)$ of $A$-valued points, then the right hand side of \eqref{eq:quotients} corresponds to the the quotient of $X$ by the action of $G$ in this larger category of functors, which is too large for our purpose.

Still one may construct the left hand side \eqref{eq:quotients} by embedding $S$-schemes into a larger category. A reasonable choice is the category of $fppf$ sheaves\footnote{The category of sheaves for every subcanonical topology does the job; for smooth groups and smooth actions the \'etale topology is often also useful to compute the left hand side of \eqref{eq:quotients}; over a field $S=\Spec k$, if $A$ is given by a separable extension of $k$, the computation of $X(A)/G(A)$ directly relates to Galois cohomology; however the coarser the underlying topology, the fewer quotients do exist, because the canonical map to the quotient must be a covering in the considered topology.} over $S$.

The $fppf$ sheaf associated to the quotient one wants to study is (under suitable assumptions) the sheaf associated to the presheave given by the right hand side of \eqref{eq:quotients} for $A$ running through the (elements of) $fppf$ coverings. The notion of {\em $fppf$ quotient} commutes with arbitrary base change.

An axiomatic definition of a {\em (universal) categorical quotient} $X/G$ is the following. We have the action $\mu$ and also the canonical projection
$$
\pi_1:\quad X\times_S G\to X.
$$
Then a map $f:X\to Y$ of $S$-schemes is {\em constant on $G$-orbits}, if
\begin{equation}
f\circ\mu\;=\;f\circ \pi_1
\label{eq:constantorbitcondition}
\end{equation}
Then the quotient $X/G$ is characterized by the fact that the canonical projection $\pi:X\to X/G$ that comes along with it, is universal among all maps $f:X\to Y$ which are constant on $G$-orbits: each such map is supposed to factor uniquely over $\pi$.

In other words $\pi:X\to X/G$ is universal among all $G$-equivariant maps where the codomain has trivial $G$-action.

In general the quotient $X/G$ does not exist in the category of $S$-schemes. Worse, if it exists, it needs not commute with arbitrary base change in general.

If $X/G$ exists as an $fppf$ quotient and is representable by an $S$-scheme $X/G$, then $X/G$ is a (universal) geometric\footnote{A {\em geometric quotient} is a quotient in the category of ringed spaces.} and in particular a (universal) categorical quotient \cite{raynaud1967}. There is also a converse to this statement.

If $G$ acts freely on $X$, and if furthermore the $fppf$ quotient $(X/G)_{fppf}$ is representable by an $S$-scheme $X/G$, then the canonical projection $X\to X/G$ is an $fppf$ covering and turns $X$ into a $G$-torsor over $Y$ in the $fppf$ topology, trivialized by the covering $X\to X/G$.

Left actions and their quotients are defined similarly.

For the existence of quotients we quote
\begin{theorem}[{\cite[Expos\'e 5, \S 7]{sga3}}]
Let $S$ be locally notherian and $G$ be a proper flat $S$-group scheme of finite type. Then
\begin{itemize}
\item[(i)] If $\mu_X:X\times_SG\to X$ is a strictly free\footnote{A free action is one for which $X\times_SG \to X\times_S X, (x,g)\mapsto (x,xg)$ is a monomorphism in the category of $S$-schemes; the action is strictly free if this map is an immersion.} $G$-action on a quasi-projective $S$-scheme $X$, then the $fppf$ quotient $X/G$ is representable by an $S$-scheme.
\item[(ii)]
If $G$ is quasi-projective over $S$ and $H\subseteq G$ is a closed subgroup scheme which is proper and flat, then the $fppf$ quotients $G/H$ and $H\backslash G$ are representable. If $H$ is normal in $G$, then $G/H$ is an $S$-group and the canonical projection $G\to G/H$ is a morphism of $S$-groups.
\end{itemize}
\end{theorem}

Remark that statement (ii) is a consequence of statement (i).

\subsection{Group actions on sheaves}

Assume as before that $G$ is an $S$-group scheme. Let $\mu_X:X\times_S G\to X$ be a right action of $G$ on an $S$-scheme $X$. For a coherent $\mathcal O_X$-module $\mathcal F$ we define a {\em right $G$-action} on $\mathcal F$ (compatible with $\mu_X$) as an isomorphism $\mu_{\mathcal F}:\pi_1^*\mathcal F\to\mu_X^*\mathcal F$, where $\pi_1:X\times_S G\to X$ is the canonical projection, subject to the commutativity of the diagrams (4.4.2) and (4.4.3) in \cite{kashiwara1989} (appropriately modified for right actions). We also say that $\mathcal F$ is a {\em (right) $G$-equivariant sheaf}.

A consequence of faithfully flat descent \cite[Expos\'e VIII, Corollaire 1.3]{sga1} is
\begin{proposition}\label{prop:equivariantsheaves}
Let $G$ be an $S$-group scheme, acting via $\mu_X:X\times_S G\to X$ on an $S$-scheme $X$. Assume that the $fppf$ quotient $X/G$ exists and is representable by an $S$-scheme $Y=X/G$, let $\pi:X\to Y$ denote the canonical projection and $\mathcal G$ be a (quasi-)coherent $\mathcal O_Y$-module.

Then the canonical isomorphism $\mu_{\pi^*\mathcal G}:\pi_1^*\pi^*\mathcal G\to\mu_X^*\pi^*\mathcal G$ defines a right $G$-action on the (quasi-)coherent $\mathcal O_X$-module $\pi^*\mathcal G$.

This correspondence induces an equivalence between the categories of (quasi-)coherent (resp.\ finite locally free) $\mathcal O_Y$-modules $\mathcal G$ and (quasi-)coherent (resp.\ finite locally free) $\mathcal O_X$-modules $\mathcal F$ with right $G$-actions (and $G$-equivariant morphisms of sheaves).
\end{proposition}

Geometrically, we have the following interpretation of a $G$-action on a quasi-coherent $\mathcal O_X$-module $\mathcal F$. If $v_{\mathcal F}:{\mathbb V}(\mathcal F^\vee)\to X$ denotes the \lq{}algebraic\rq{} vector bundle (cf.\ \cite[D\'efinition (1.7.8)]{ega2}) associated to $\mathcal F^\vee$, i.e.\ the $S$-scheme ${\mathbb V}(\mathcal F^\vee)$ over $X$ such that $\mathcal F$ coincides with the sheaf of sections of $v_{\mathcal F}$, a $G$-action $\mu_{\mathcal F}$ on $\mathcal F$ is the same as a $G$-action on ${\mathbb V}(\mathcal F^\vee)$, for which the morphism $v_{\mathcal F}$ is $G$-equivariant, and which is linear in each fibre, i.e.\ for each $S$-scheme $A$, every $g\in G(A)$, and every $x\in X(A)$, the induced isomorphism $g:{\mathbb V}(\mathcal F^\vee)_x\to {\mathbb V}(\mathcal F^\vee)_{xg}$ is linear.

Another correspondence between sheaves and modules arises as follows. Assume $\mathcal M$ is a rational representation of $G$ over $S$, i.e.\ $\mathcal M$ is a (quasi-)coherent sheaf of $\mathcal O_S$-modules, together with a right $\mathcal O_G$-comodule structure
$$
\mathcal M\to \mathcal M\otimes_{\mathcal O_S}\psi_*\mathcal O_G
$$
in the category of sheaves on $S$. As above we may associate to $\mathcal M$ an algebraic vector bundle ${\mathbb V}(\mathcal M)$ over $S$ with a scheme theoretic right action of $G$. Assume that $G$ acts freely on $X$ on the right, and that the $fppf$ quotient $X/G$ exists as a scheme.

If $\pi:X\to X/G$ denotes the canonical projection, we may set for each Zariski open $U\subseteq X/G$,
$$
\mathcal L_{\mathcal M}(U)\;:=\;\{f\in\Hom_S(\pi^{-1}U,{\mathbb V}(\mathcal M))\mid f\;\text{is $G$-equivariant}\}
$$
In the case of a locally noetherian base $S$, a direct computation shows that this is a (quasi-)coherent sheaf of $\mathcal O_{X/G}$-modules, and $\mathcal M\to\mathcal L_{\mathcal M}$ is from exact functor from the category of quasi-coherent $G$-modules on $S$ to the category of quasi-coherent sheaves on $X/G$, which preserves coherence.

\subsection{$G$-equivariant sheaves of differential operators}

As before $G/S$ denotes a group scheme. Write $e:S\to G$ for the unit section. We identify the Lie algebra of $G$ with the $\mathcal O_S$-module
$$
\underline{{\mathfrak {g}}}_S\;=\;e^*\Der_{S}(G).
$$
$G$ acts on $\underline{{\mathfrak {g}}}_S$ via the adjoint representation.

Assume that a smooth $S$-group scheme $G$ acts on $X$ from the left. The differential of the action of $G$ on $X$ induces a morphism
\begin{equation}
\underline{{\mathfrak {g}}}_S\;\to\;x_*\Der_{S}(X)
\label{eq:liegtotangentX}
\end{equation}
of $\mathcal O_S$-Lie algebras. We denote by $U(\underline{{\mathfrak {g}}}_S)$ the sheaf of universal enveloping algebras of $\underline{{\mathfrak {g}}}_S$ on $S$, and set
$$
\underline{U}_X(\underline{{\mathfrak {g}}})\;:=\;x^*U(\underline{{\mathfrak {g}}}_S),
$$
and furnish it with the following ring structure. Let $x=(\psi,\theta)$. Then since $G$ acts on $X$, we have a canonical action of $\psi^*\underline{{\mathfrak {g}}}_S$ on $\mathcal O_X$, which induces a diagonal action of $\psi^*\underline{{\mathfrak {g}}}_S$ on
$$
\underline{U}_X(\underline{{\mathfrak {g}}})\;=\;\mathcal O_X\otimes_{\psi^*\mathcal O_S}\psi^*U(\underline{{\mathfrak {g}}}_S),
$$
which in turn extends to a diagonal action of $\psi^*U(\underline{{\mathfrak {g}}}_S)$. We let $\mathcal O_X$ act on $\underline{U}_X(\underline{{\mathfrak {g}}})$ via the first factor. This induces on $\underline{U}_X(\underline{{\mathfrak {g}}})$ the structure of an $\mathcal O_X$-algebra satisfying the three compatibility conditions (4.2.1)-(4.2.3) in \cite{kashiwara1989}. In particular, this action is compatible with \eqref{eq:liegtotangentX}.

Then any $G$-equivariant $\mathcal O_X$-module $\mathcal M$ comes with a canonical action of $\underline{U}_X(\underline{{\mathfrak {g}}})$.

We say that a twisted sheaf of differential operators $\mathcal A$ on $X/S$ is $G$-equivariant if it is equipped with a $G$-action that satisfies the conditions (4.6.1) and (4.6.2) in \cite{kashiwara1989}. This allows us to extend the notion of $G$-equivariance to $\mathcal A$-modules as in \S4.7 in loc.\ cit.

\section{The case of fields}

In this section we assume that $k\subseteq k'$ is an extension of fields\footnote{or more generally a faithfully flat extension of rings.} (not necessarily of characteristic $0$) and we specialize the previous situation to $S:=\Spec k$ and $S':=\Spec k'$. Then $s:S'\to S$ is fixed as well and is a flat morphism of schemes.

In the sequel $x:X\to S$ is a scheme of finite type, $X'=X\times_S S'$ denotes its base change to $S'$, $y:X'\to X$ the canonical projection. We remark that $X\to S$ is automatically of finite presentation\footnote{since $k$ is a field and in particular noetherian.}, and $X$ is quasi-compact and quasi-separated because $S$ enjoys these properties as a (noetherian\footnote{only necessary for quasi-separatedness}) affine scheme.

\subsection{$\mathcal D$-modules over fields}

We remark that since $S$ is affine, pushforward $x_*$ may be identified with the global sections functor, that we interpret as a left exact functor
$$
\Gamma(X,-):\quad
\Mod_{\rm qc}(\D_{X/S})\to
\Mod(\Gamma(X,\D_{X/S})).
$$
By Corollary \ref{cor:dbasechange} we see\footnote{Recall that $X$ was of finite presentation over an affine scheme and therefore quasi-compact} that we have a canonical isomorphism $y^*\D_{X/S}\cong\D_{X'/S'}$, and since we know that $\D_{X/S}$ is $\mathcal O_X$-quasi-coherent, and every quasi-coherent $\mathcal O_S$-module is flat over $S$, we obtain with the flat base change Theorem \ref{thm:flatbasechange2} a canonical isomorphism
\begin{equation}
\Gamma(X,\D_{X/S})\otimes_k k'\cong \Gamma(X',\D_{X'/S'}).
\label{eq:Dglobalsectionsbasechange}
\end{equation}
In particular, the base change $y^*\mathcal M$ of any $\mathcal M\in\Mod_{\rm qc}(\D_{X/S})$ carries a natural $\D_{X'/S'}$-module structure. To be more precise, we have

\begin{theorem}\label{thm:Dmodulebasechangek}
Let $s:S'=\Spec k'\to S=\Spec k$ be an extension of fields\footnote{or more generally a faithfully flat extension of rings.}, $x:X\to S$ is an $S$-scheme of finite type, $X'=X\times_S S'$ its base change and $y:X'\to X$ the canonical projection. Then we have a well defined functor\footnote{In general it seems that one needs to consider the composite of $y^*(-)$ with $\D_{X'/S'}\otimes_{y^*\D_{X/S}}(-)$.}
$$
y^*(-):\quad \Mod_{\rm qc}(\D_{X/S})\to\Mod_{\rm qc}(\D_{X'/S'}).
$$
It enjoys the following properties:
\begin{itemize}
\item[(i)] The following diagram of functors commutes (strictly):
$$
\begin{CD}
\Mod_{\rm qc}(\D_{X/S})@>\Gamma(X,-)>>
\Mod(\Gamma(X,\D_{X/S}))\\
@Vy^*VV @VVs^*V\\
\Mod_{\rm qc}(\D_{X'/S'})@>>\Gamma(X',-)>
\Mod(\Gamma(X',\D_{X'/S'}))
\end{CD}
$$
\item[(ii)] $s^*(-)$ and $y^*(-)$ are exact and faithful.
\item[(iii)] A module $\mathcal M\in\Mod_{\rm qc}(\D_{X/S})$ is $\mathcal O_X$-coherent, if and only if $y^*\mathcal M$ is $\mathcal O_{X'}$-coherent.
\item[(iv)] For every $\mathcal M\in\Mod_{\rm qc}(\D_{X/S})$ and every degree $q\geq 0$ a natural isomorphism
\begin{equation}
H^q(X,\mathcal M)\otimes_k k'\;\cong\;H^q(X',y^*\mathcal M).
\label{eq:cohomologyiso}
\end{equation}
\item[(v)] For every $\mathcal M\in\Mod_{\rm qc}(\D_{X/S})$ and every degree $q\geq 0$ we have an equivalence
\begin{equation}
H^q(X,\mathcal M)\;=\;0\quad\Leftrightarrow\quad H^q(X',y^*\mathcal M)\;=\;0.
\label{eq:vanishingequivalence}
\end{equation}
\end{itemize}
\end{theorem}

\begin{proof}
We already saw that $y^*$ is well defined and that the diagram in (i) commutes. Since $s:S'\to S$ is faithfully flat, $y:X'\to X$ is faithfully flat, and therefore $y^*$ is exact and faithful, this shows (ii) and (iii). By the flat base change Theorem \ref{thm:flatbasechange2} (iv) follows. Statement (v) is a consequence of (iv) and the faithfulness of $S'\to S$.
\end{proof}

\begin{proposition}\label{prop:daffinegeometric}
For any scheme $X$ of finite type over a field $k$, being $\mathcal D$-affine is a {\em geometric property} of $X$, in the sense that $X$ is $\mathcal D$-affine, if and only if $X'$ is $\mathcal D$-affine for one (or for all) field extensions $k'/k$.
\end{proposition}

\begin{proof}
By Theorem \ref{thm:Dmodulebasechangek}, (v), condition (i) for being $\mathcal D$-affine is independent of the base field $k$. By statement (iv) of the same Proposition the vanishing of global sections in condition (ii) is independent of the base field, and since field extensions yield faithfully flat morphisms of schemes, the vanishing condition on the left hand side is also independent of the base field.
\end{proof}

\begin{proposition}
Let $G$ be a linear reductive group over a field $k$ of characteristic $0$, and $\mathcal B$ its flag variety of Borel subalgebras of $G$, considered as $k$-scheme. Then $\mathcal B$ is $\mathcal D$-affine over $k.$
\end{proposition}

\begin{proof}
By our previous discussion this reduces to the case of algebraically closed $k$, where the statement is known.
\end{proof}

We recall that for $X/S$ smooth, $\D_{X/S}$ is a left and right noetherian module by Corollary \ref{cor:Dnoetherian}.

A special case of Propositions \ref{prop:firstequivalenceovergeneralbase} and \ref{prop:coherentequivalenceovergeneralbase} is

\begin{proposition}\label{prop:firstequivalenceoverfields}
Assume that $X$ is a $\mathcal D$-affine scheme over a field $S=\Spec k$. Then
\begin{itemize}
\item[(i)] Every $\mathcal M\in\Mod_{\rm qc}(\D_{X/S})$ is generated by its global sections as $\D_{X/S}$-module.
\item[(ii)] The functor
$$
\Gamma(X,-):\quad
\Mod_{\rm qc}(\D_{X/S})\to
\Mod(\Gamma(X,\D_{X/S}))
$$
is an equivalence of categories.
\item[(iii)] If $X/S$ is smooth, then $\Gamma(X,-)$ induces an equivalence between $\D_{X/S}$-coherent modules and finitely generated $\Gamma(X,\D_{X/S})$-modules.
\end{itemize}
\end{proposition}

Proposition \ref{prop:firstequivalenceoverfields} provides another proof for the statement of Corollary \ref{cor:injectiveobjects} in the particular case at hand.

\addcontentsline{toc}{section}{References}
\bibliographystyle{plain}