\section{Flat and  projectively flat connections}\label{section:projflat}
A central notion of this article is that of a  flat  projective connection. 
Although it enters the scene much later in the paper, some of the work done in the first part is motivated 
by the particular way this notion appears here. So we  start with a brief section discussing it.

We begin with  recalling some basic facts. Let $\Hcal$ be a rank $r$ vector bundle over a smooth base $S$ (in other words, is a locally a free  ${\mathcal O}_S$-module of  rank $r$).  Then the  Lie algebra ${\mathcal D}_1(\Hcal)$ of first order differential operators 
$\Hcal\to\Hcal$  fits in an exact sequence of coherent sheaves of Lie algebras
\[
0\to \Ecal nd(\Hcal)\to{\mathcal D}_1(\Hcal){\buildrel sb\over\longrightarrow} \theta_S\otimes_{{\mathcal O}_S} \Ecal nd(\Hcal)\to 0,
\]
where $sb$ is the symbol map which assigns to $D\in{\mathcal D}_1(\Hcal)$ the $k$-derivation 
$\phi\in{\mathcal O}_S\mapsto [D,\phi] \in {\mathcal O}_S$.  The local sections of  ${\mathcal D}_1(\Hcal)$ whose symbol land in $\theta_S\otimes 1_\Hcal\cong \theta_S$ make up a coherent  subsheaf of Lie subalgebras $sb^{-1}(\theta_S)\subset {\mathcal D}_1(\Hcal)$ so that we have
an exact sequence of coherent sheaves of Lie algebras
\[
0\to \Ecal nd(\Hcal)\to sb^{-1}(\theta_S)\to \theta_S\to 0.
\]
A connection on $\Hcal$ is then simply a section $X\in\theta_S\mapsto \nabla_X\in sb^{-1}(\theta_S)$ of   $sb^{-1}(\theta_S)\to \theta_S$ and it is flat precisely if this section is a Lie homomorphism.
This suggests that we define a flat connection on the associated projective space bundle ${\mathbb P}_S(\Hcal)$ as a Lie subalgebra $\hat{\mathcal D}\subset {\mathcal D}_1(\Hcal)$ with $sb(\hat{\mathcal D})=\theta_S$ and $\hat{\mathcal D}\cap \Ecal nd(\Hcal)={\mathcal O}_S\otimes 1_\Hcal\cong {\mathcal O}_S$ so that
we have an exact subsequence
\[
0\to {\mathcal O}_S\to\hat{\mathcal D}\to \theta_S\to 0
\]
 of the one displayed above. That this is a sensible definition follows from the observation that an ${\mathcal O}_S$-linear section $\nabla$ of $\hat{\mathcal D}\to \theta_S$ 
defines a connection  on $\Hcal$ whose curvature form $R(\nabla)$ is a closed  $2$-form on $S$.   Any other section $\nabla'$ differs from
$\nabla$ by an ${\mathcal O}_S$-linear map $\theta_S\to {\mathcal O}_S$, in other words, by a differential $\omega$, 
and we have  $R(\nabla')=R(\nabla)+d\omega$. So this indeed gives rise to a flat connection in  
${\mathbb P}_S(\Hcal)$ and it is easily seen that this connection is independent of the choice of the section. 
Locally on $S$,  $R(\nabla)$ is exact, and so we can always choose $\nabla$  to be flat as a connection. Any other such local section that is flat is necessarily of the form 
$\nabla +d\phi$ with $\phi\in {\mathcal O}$ and conversely, any such local section has that property. The Lie algebra sheaf  
$\hat{\mathcal D}$ itself does not determine a connection on $\Hcal$; this is most evident  when $\Hcal$ is a line bundle, 
for then we must have $\hat{\mathcal D}(\Hcal)={\mathcal D}_1(\Hcal)$. 


In the above situation  we let $\hat{\mathcal D}$ act on the  determinant bundle $\det (\Hcal)=\wedge^r_{{\mathcal O}_S}\Hcal$ by means of the formula
\[
\hat D(e_1\wedge\cdots\wedge e_r):=\sum_{i=1}^r e_1\wedge\cdots\wedge \hat D(e_i)\wedge\cdots\wedge e_r.
\]
This is indeed well-defined, and identifies $\hat{\mathcal D}$ as a Lie algebra with the Lie algebra of first order differential operators 
${\mathcal D}_1(\det (\Hcal))$. Notice however that this identification makes  $f\in {\mathcal O}_S\subset \hat{\mathcal D}$ act on $\det (\Hcal)$  as multiplication by $rf$.  

Let us next observe that if $\lambda$ is a line bundle on $S$ and $N$ is a positive integer, then a similar formula identifies 
${\mathcal D}_1(\lambda)$ with ${\mathcal D}_1(\lambda^{\otimes N})$ (both as ${\mathcal O}_S$-modules and as $k$-Lie algebras), but  
induces multiplication by $N$ on ${\mathcal O}_S$.  This leads us to make the following

\begin{definition}\label{def:lambdaflat} 
Let be given a smooth base variety $S$ over which we are given a line bundle $\lambda$ and  a locally free 
${\mathcal O}_S$-module $\Hcal$ of finite rank.  A \emph{$\lambda$-flat connection}  on $\Hcal$ is  homomorphism  of 
${\mathcal O}_S$-modules  $u:{\mathcal D}_1(\lambda)\to  {\mathcal D}_1(\Hcal)$ that is also a Lie homomorphism over $k$,  commutes 
with the symbol maps (so these must  land in $\theta_S$) and takes scalars to scalars: ${\mathcal O}_S\subset {\mathcal D}_1(\lambda)$ is mapped to
${\mathcal O}_S\subset{\mathcal D}_1(\Hcal)$.
\end{definition}

It follows from the preceding that such a homomorphism $u$ determines
a flat connection on the projectivization of $\Hcal$. The map $u$ preserves  ${\mathcal O}_S$ and 
since this restriction is ${\mathcal O}_S$-linear, it is given by multiplication by some regular function $w$ on $S$.
If  $D\in\theta_S$ is lifted to $\hat D\in{\mathcal D}_1(\lambda)$, then $u(\hat D)\in  {\mathcal D}_1(\Hcal)$ is also a lift of $D$ and so
$D(w)= [u(\hat D), u(1)]=u([\hat D,1])=0$. 
This shows that $w$ must be locally constant;  we call this  the \emph{weight} of $u$. So in the above discussion, 
$\hat{\mathcal D}$ comes with  $\det (\Hcal)$-flat connection of weight $r^{-1}$.

It is clear that if the weight of $u$ is constant zero, then $u$ factors through $\theta_S$, so that we get a flat 
connection in $\Hcal$. This is also the case when $\lambda={\mathcal O}_S$, for then ${\mathcal D}_1({\mathcal O}_S)$ contains 
$\theta_S$  canonically  as a direct summand (both as ${\mathcal O}_S$-module and as a sheaf of $k$-Lie algebras) 
and the flat connection is then given by the action of $\theta_S$. This has an interesting consequence: if
$\pi: \Lambda^\times\to S$ is the geometric realization of the  $\GG_m$-bundle defined by 
$\lambda$, then  $\pi^*\lambda$
has a `tautological' generating section and thus gets identified with ${\mathcal O}_{\Lambda^\times}$. Hence
a  $\lambda$-flat connection on $\Hcal$ defines an ordinary  flat connection on $\pi^*\Hcal$. One checks that if $w$ is the 
weight of $u$, then the connection is homogeneous of degree $w$ along the fibers. So in case  $k=\CC$,  $s\in S$ and 
$\tilde s\in \Lambda^\times$ lies over $s\in S$, then  the multivalued map 
$(z, h)\in\CC^\times\times H_s \mapsto (z\tilde s, z^wh)\in \Lambda^\times_s\times H_s$  is flat,  and so the 
monodromy of the connection in $\Lambda^\times_s$  is scalar multiplication by $e^{2\pi\sqrt{-1}w}$.


We will also encounter a logarithmic version. Here we are given a closed subvariety $\Delta\subset S$ of lower dimension
(usually a normal crossing hypersurface). Then  the $\theta_S$-stabilizer of the ideal defining $\Delta$, denoted  
$\theta_S(\log\Delta)$, is  a coherent ${\mathcal O}_S$-submodule of $\theta_S$ closed under the Lie bracket.  If
in Definition \ref{def:lambdaflat} we have $u$  only  defined on the preimage of $\theta_S(\log\Delta)\subset \theta_S$ in 
${\mathcal D}_1(\lambda)$  (which we denote here by ${\mathcal D}_1(\lambda)(\log \Delta)$), then we say that we have  a  
\emph{logarithmic $\lambda$-flat connection relative to $\Delta$}  on $\Hcal$.


\section{The Virasoro algebra and its basic representation}\label{section:vir} 

Much of the material exposed in this section is a conversion of certain standard constructions
(as can be found for instance in \cite{kacraina}) 
into a coordinate invariant and relative setting. But the way we introduce the Virasoro algebra is less standard and may be even new. A similar remark applies to part of the last subsection (in particular, Corollary \ref{cor:twistedfock}), which is devoted to the Fock module attached to a symplectic local system.
\\

In this section we fix an $R$-algebra ${\mathcal O}$ isomorphic to the formal power series ring $R[[t]]$.
In other words, ${\mathcal O}$  comes with a principal ideal $\mathfrak{m}$
so that ${\mathcal O}$ is complete for the $\mathfrak{m}$-adic topology and the associated graded $R$-algebra
$\oplus_{j=0}^\infty \mathfrak{m}^j/\mathfrak{m}^{j+1}$ is a polynomial ring over $R$ in one variable.
The choice of a generator $t$ of the ideal $\mathfrak{m}$ identifies ${\mathcal O}$ with $R[[t]]$. We denote by
$L$ the localization of ${\mathcal O}$ obtained by inverting a generator of $\mathfrak{m}$.
For $N\in\ZZ$, $\mathfrak{m}^N$ has the obvious meaning
as an ${\mathcal O}$-submodule of $L$. The \emph{$\mathfrak{m}$-adic topology} on $L$ is the topology that has the 
collection of cosets $\{ f+\mathfrak{m}^N\}_{f\in L,N\in
\ZZ}$ as a basis of open subsets. We sometimes write $F^NL$ for $\mathfrak{m}^{N}$. We further denote by
$\theta$ the $L$-module of continuous $R$-derivations from $L$ into $L$
and by $\omega$ the $L$-dual of $\theta$. These $L$-modules 
come with filtrations (making them principal filtered $L$-modules): $F^N\theta$ consists of the derivations that take 
$\mathfrak{m}$ to 
$\mathfrak{m}^{N+1}$ and $F^N\omega$ consists of the $L$-homomorphisms $\theta\to L$ that take  
$F^0\theta$ to $\mathfrak{m}^N$.
So in terms of the generator $t$ above, $L=R((t))$, $\theta=R((t))\frac{d}{dt}$, 
$F^N\theta=R[[t]]t^{N+1}\frac{d}{dt}$,  $\omega =R((t))dt$ and $F^N\omega=R[[t]]t^{N-1}dt$. 

The residue map
$\res: \omega\to R$ which assigns to an element of $R((t))dt$ the coefficient of $t^{-1}dt$
is canonical, i.e., is independent of the choice of $t$. The $R$-bilinear map
\[
r: L\times \omega \to R,\quad  (f,\alpha)\mapsto \res (f\alpha)
\]
is a topologically perfect pairing of filtered $R$-modules: we have $r(t^k, t^{-l-1}dt)=\delta_{k,l}$ and 
so any $R$-linear  $\phi: L\to R$  which is continuous (i.e., $\phi$ zero on $\mathfrak{m}^N$ for some $N$) 
is definable by an element of $\omega$
(namely by $\sum_{k>N} \phi (t^{-k})t^{k-1}dt$) and likewise
for an $R$-linear continuous map $\omega\to R$.

\subsection*{A trivial Lie algebra}
If we think of of the multiplicative group $L^\times$ of $L$ as an algebraic group over $R$ (or rather, as a group object
in a category of ind schemes over $R$), then
its Lie algebra, denoted here by $\mathfrak{l}$, is $L$,  regarded as a $R$-module with trivial Lie bracket. 
It comes with a decreasing filtration $F^{\scriptscriptstyle\bullet}\mathfrak{l}$ (as a Lie algebra) defined by the valuation. 
The universal enveloping algebra $U\mathfrak{l}$ is clearly the symmetric algebra of $\mathfrak{l}$ as an $R$-module, 
$\sym_R^{\scriptscriptstyle\bullet} (\mathfrak{l})$. 
The ideal $U_+\mathfrak{l}\subset U\mathfrak{l}$ generated by $\mathfrak{l}$
is also a right  ${\mathcal O}$-module (since $\mathfrak{l}$ is). We complete it $\mathfrak{m}$-adically:
given an integer $N\ge 0$, then an $R$-basis of the truncation
$U_+\mathfrak{l}/(U\mathfrak{l}\circ F^N\mathfrak{l})$ 
is the collection $t^{k_1}\circ\cdots\circ t^{k_r}$ with 
$k_1\le k_2\le \cdots \le k_r<N$. So elements of the  completion 
\[
U_+\mathfrak{l}\to {\overline{U}}_+\mathfrak{l}:=\varprojlim_N U_+\mathfrak{l}/U\mathfrak{l}\circ F^N\mathfrak{l}
\]
are series of the form 
$\sum_{i=1}^\infty r_i t^{k_{i,1}}\circ\cdots\circ t^{k_{i,r_i}}$
with $r_i\in R$, $c\le k_{1,i}\le k_{2,i}\le\cdots \le k_{i,r_i}$ for some constant $c$. 
We put ${\overline{U}}\mathfrak{l}:= R\oplus {\overline{U}}_+\mathfrak{l}$, which we could  of course 
have  defined just as well directly as
 \[
U\mathfrak{l}\to {\overline{U}}\mathfrak{l}:=\varprojlim_N U\mathfrak{l}/U\mathfrak{l}\circ F^N\mathfrak{l}.
\]
We will refer to this construction as the \emph{$\mathfrak{m}$-adic completion on the right}, although
in the present case there is no difference with the analogously defined $\mathfrak{m}$-adic completion 
on the left,  as  $\mathfrak{l}$ is commutative.

Any  continuous derivation $D\in\theta$ defines an $R$-linear map $\omega\to L$ which is 
self-adjoint relative the residue pairing: $r(\langle D,\alpha \rangle,\beta)=r(\alpha,\langle D,\beta\rangle)$.
We use that pairing to identify $D$ with an
element of the closure of $\sym^2\mathfrak{l}$ in ${\overline{U}}\mathfrak{l}$. Let $C(D)$ be half this element, 
so that in terms of the above topological basis,
\[
C(D)={\tfrac{1}{2}} \sum_{i,j\in\ZZ} r(\langle D, t^{-i-1}dt\rangle, t^{-j-1}dt) t^i\circ t^j.
\]
In particular for $D=D_k=t^{k+1}\frac{d}{dt}$, $C(D_k)={\tfrac{1}{2}} \sum_{i+j=k} t^i\circ t^j$. Observe 
that the map  $C: \theta\to{\overline{U}}\mathfrak{l}$ is continuous. 

\subsection*{Oscillator and Virasoro algebra}
The residue map defines a central extension of $\mathfrak{l}$, the 
\emph{oscillator algebra} $\hat{\mathfrak{l}}$, which as an $R$-module is 
simply $\mathfrak{l}\oplus R$. If we denote the generator of the second summand by $\hbar$, then the Lie bracket is given by 
\[
[f +\hbar r ,g+\hbar s ]:=\res (g\, df)\hbar.
\]
So $[t^{k},t^{-l}]=k\delta_{k,l}\hbar $ and the center of  $\hat{\mathfrak{l}}$ is 
$Re\oplus R\hbar$, where $e=t^0$ denotes the unit element of $L$ viewed as an element of $\mathfrak{l}$.  
It follows that $U\hat{\mathfrak{l}}$ is an $R[e, \hbar ]$-algebra.  As an $R[\hbar]$-algebra it is obtained as follows: 
take  the tensor algebra of 
$\mathfrak{l}$ (over $R$) tensored with $R[\hbar]$, $\otimes^{\scriptscriptstyle\bullet}_R \mathfrak{l} \otimes_R R[\hbar]$, and divide that out 
by the two-sided ideal generated by the elements $f\otimes g-g\otimes f-
\res (gdf)\hbar$.  The obvious surjection 
$\pi: U\hat{\mathfrak{l}}\to U\mathfrak{l}=\sym_R^{\scriptscriptstyle\bullet} (\mathfrak{l})$ is the reduction modulo $\hbar$.
 
We filter $\hat{\mathfrak{l}}$ by letting $F^N\hat{\mathfrak{l}}$ be $F^N\mathfrak{l}$ for $N>0$
and $F^N\mathfrak{l} +R\hbar$ for $N\le 0$. This filtration is used to complete 
$U\hat{\mathfrak{l}}$ $\mathfrak{m}$-adically on the right:
\[
U\hat{\mathfrak{l}}\to {\overline{U}}\hat{\mathfrak{l}}:=\varprojlim_N U\hat{\mathfrak{l}} /U\hat{\mathfrak{l}}\circ F^N\mathfrak{l}.
\]
Notice that this completion has the collection 
$t^{k_1}\circ\cdots\circ t^{k_r}$ with $r\ge 0$, $k_1\le k_2\le \cdots \le k_r$,
as topological $R[\hbar]$-basis.  Since $\hat\mathfrak{l}$ is not abelian, the left and  right
$\mathfrak{m}$-adic topologies now  differ. For instance, 
$\sum_{k\ge 1} t^k\circ t^{-k}$ does not converge in ${\overline{U}}\hat{\mathfrak{l}}$, whereas 
$\sum_{k\ge 1} t^{-k}\circ t^k$ does. The obvious surjection 
$\pi: {\overline{U}}\hat{\mathfrak{l}}\to {\overline{U}}\mathfrak{l}$ is still given by reduction modulo $\hbar$.
We also observe that the filtrations of $\mathfrak{l}$ and $\hat\mathfrak{l}$ determine decreasing 
filtrations of  their (completed) universal enveloping algebras, e.g.,
$F^NU\hat\mathfrak{l}=\sum_{r\ge 0}\sum_{n_1+\cdots +n_r\ge N} 
F^{n_1}\hat\mathfrak{l}\circ\cdots \circ F^{n_r}\hat\mathfrak{l}$.

Let us denote by $\mathfrak{l}_2$ the image of 
$\mathfrak{l}\otimes_R\mathfrak{l}\subset\hat{\mathfrak{l}}\otimes_R\hat{\mathfrak{l}}\to U\hat{\mathfrak{l}}$.
Under the reduction modulo $\hbar$,  $\mathfrak{l}_2$ maps onto $\sym^2_R(\mathfrak{l})\subset U\mathfrak{l}$ with kernel $R\hbar$.
Its  closure $\bar \mathfrak{l}_2$ in ${\overline{U}}\hat{\mathfrak{l}}$ maps onto the closure of 
$\sym^2_R(\mathfrak{l})$ in ${\overline{U}} \mathfrak{l}$ with the same kernel. 

The generator $t$ defines a  continuous $R$-linear map $D\in\theta\mapsto  \hat C(D)\in \bar \mathfrak{l}_2$ 
characterized by 
\[
\hat C(D_k):= {\tfrac{1}{2}}\sum_{i+j=k} : t^i\circ t^j:\; .
\]
We here adhered to the \emph{normal ordering convention}, which prescribes that the factor with the 
highest index comes last and hence acts first (here the exponent serves as index). So $: t^i\circ t^j:$ equals
$t^i\circ t^j$ if $i\le j$ and $t^j\circ t^i$ if $i> j$.
This map is clearly a  lift of $C: \theta\to \sym^2\mathfrak{l}$, but is otherwise non-canonical.

\begin{lemma}\label{lemma:chat}
We have
\begin{enumerate}
\item[(i)] $[\hat C(D),f]= -\hbar D(f)$ as an identity  in ${\overline{U}} \hat{\mathfrak{l}}$ 
(where $f\in\mathfrak{l}\subset\hat\mathfrak{l}$) and
\item[(ii)] $[\hat C(D_k), \hat C(D_l)]=-\hbar(l-k)  
\hat C(D_{k+l})+\hbar^2\frac{1}{12}(k^3-k)\delta_{k+l,0}$.
\end{enumerate}
\end{lemma}
\begin{proof}
For the first statement we compute $[\hat C( D_k), t^l]$. If we substitute
$\hat C(D_k)={\tfrac{1}{2}}\sum_{i+j=k} : t^i\circ t^j:$, then we see that only terms of the
form $[t^{k+l}\circ t^{-l}, t^l]$  or $[t^{-l}\circ t^{k+l}, t^l]$ (depending on whether $k+2l\le 0$ or $k+2l\ge 0$) 
can make a contribution
and then have coefficient 
${\tfrac{1}{2}}$ if $k+2l= 0$ and $1$ otherwise. In all cases the result is 
$-\hbar lt^{k+l}= -\hbar D_k(t^l)$.
 
Formula (i) implies that 
\begin{multline*}
[\hat C(D_k), \hat C(D_l)]=
\lim_{N\to\infty}\sum_{|i|\le N} {\tfrac{1}{2}}\left( D_k(t^i)\circ t^{l-i}+ t^i\circ D_k(t^{l-i})\right)\\
=-\hbar \lim_{N\to\infty}\sum_{|i|\le N} 
\left( it^{k+i}\circ t^{l-i}+ t^i\circ (l-i)t^{k+l-i}\right).
\end{multline*}
This is up to a reordering equal to $ -\hbar (l-k)\hat C(D_{k+l})$.
The terms which do not commute and are in the wrong order are those
for which $0<k+i=-(l-i)$ (with coefficient $i$) and for which
$0<i=-(k+l-i)$ (with coefficient $(l-i)$). This accounts for
the extra term $\hbar^2\frac{1}{12}(k^3-k)\delta_{k+l,0}$.
\end{proof}

This lemma shows that $-\hbar^{-1}\hat C$ behaves better than $\hat C$ (but requires us of course  
to assume that $\hbar$ be invertible). In fact, it suggests to consider  the set $\hat\theta$  of  pairs 
$(D, u)\in\theta\times \hbar^{-1}\bar\mathfrak{l}_2$  for which $C(D)\in\sym^2\mathfrak{l}$ is the mod $\hbar$ 
reduction of $-\hbar u$, so that we have an exact sequence
\[
0\to R \to \hat\theta \to \theta \to 0
\]
of $R$-modules.  Then a non-canonical section of $\hat\theta \to \theta$ is given by $D\mapsto \hat D:= (D, -\hbar^{-1}\hat C(D))$.
In order to avoid confusion, we denote the generator of the copy of $R$ by $c_0$.

\begin{cordef}\label{def:virasoro} 
This defines a central extension of Lie algebras, called the \emph{Virasoro algebra} (of the $R$-algebra $L$). 
Precisely,  if $T:  \hat\theta\to {\overline{U}}\hat{\mathfrak{l}} [\tfrac{1}{\hbar}]$ is given by the second component, then  
$T$ is injective, maps $\hat\theta$ onto a Lie subalgebra of 
${\overline{U}}\hat{\mathfrak{l}}[\frac{1}{\hbar}]$  and sends $c_0$ to $1$. If we transfer the Lie bracket on ${\overline{U}}\hat{\mathfrak{l}}[\frac{1}{\hbar}]$ to $\hat\theta$, 
then in terms of  our non-canonical section, 
\[
[\hat D_k, \hat D_l]= (l-k)\hat D_{k+l}+\frac{k^3-k}{12}\delta_{k+l,0}c_0. 
\]
Moreover, $\ad_{T(\hat D)}$ leaves $\mathfrak{l}$ 
invariant (as a subspace of ${\overline{U}}\hat\mathfrak{l}$) and acts on that subspace by derivation with respect to $D\in\theta$.
\end{cordef} 

\begin{remark}
An alternative coordinate free definition of the Virasoro algebra, based on the algebra of
pseudo-differential operators on $L$, can be found in \cite{bms}.
\end{remark} 

\subsection*{Fock representation}
It is clear that $F^0\hat{\mathfrak{l}}=R\hbar\oplus {\mathcal O}$ is an abelian
subalgebra of $\hat{\mathfrak{l}}$. We let $F^0\hat{\mathfrak{l}} ={\mathcal O} \oplus R\hbar$ act on a free rank one module $Rv_o$ by 
letting ${\mathcal O}$ act trivially and $\hbar$ as the identity. The induced representation of $\hat{\mathfrak{l}}$ over $R$,
\[
\FF:= U\hat{\mathfrak{l}} \otimes_{U\hat{\mathfrak{l}}\circ F^0\hat{\mathfrak{l}}}Rv_o,
\]
will be regarded as a $U\mathfrak{l}[\hbar^{-1}]$-module.
It comes with an increasing PBW (Poincar\'e-Birkhoff-Witt) filtration  $W_{\scriptscriptstyle\bullet}\FF$ by $R$-submodules,  
with $W_r\FF$ being the image of  $\oplus_{s\le r}\hat{\mathfrak{l}}^{\otimes s}\otimes Rv_o$. 
Since the scalars $R\subset\mathfrak{l}$ are central in $\hat\mathfrak{l}$ and kill $\FF$ (because 
$R\subset {\mathcal O}$), they act trivially in all of $\FF$. 
As an $R$-module, $\FF$ is free with basis  the collection $t^{-k_r}\circ\cdots\circ t^{-k_1}\otimes v_o$, 
where  $r\ge 0$ and $1\le k_1\le k_2\le \cdots\le k_r$ (for $r=0$, read $v_o$). (In fact,  
$\Gr^W_{\scriptscriptstyle\bullet}\FF$ can be identified as a graded $R$-module with the symmetric algebra 
$\sym^{\scriptscriptstyle\bullet} (\mathfrak{l}/F^0\mathfrak{l})$.) This also shows that 
$\FF$ is even a ${\overline{U}}\hat{\mathfrak{l}}[\hbar^{-1}]$-module. Thus $\FF$ affords a representation 
of $\hat\theta$ over $R$, called its 
\emph{Fock representation}.  

It follows from Lemma \ref{lemma:chat} that for any $D\in\theta$ with lift $\hat D\in\hat\theta$, 
\begin{multline*}
T(\hat D)t^{-k_r}\circ\cdots \circ t^{-k_1}\otimes v_o=\\
=\left(\sum_{i=1}^r t^{-k_r}\circ\cdots\circ
D(t^{-k_i})\circ\cdots \circ t^{-k_1}\right) \otimes v_o+t^{-k_r}\circ\cdots \circ t^{-k_1}\circ T(\hat D) v_o.
\end{multline*}
Since $T(\hat D)v_o=0$ when $D\in F^0\theta$, it follows that
$F^0\theta$ acts on $\FF$
by coefficient-wise derivation.
This observation has an interesting consequence. Consider the module of  $k$-derivations $R\to R$ (denoted here simply 
by $\theta_{R}$ instead of the more accurate $\theta_{R/k}$)
and the module $\theta_{L,R}$ of $k$-derivations of $L$ that are continuous for the
$\mathfrak{m}$-adic topology and  preserve $R\subset L$.
Since $L\cong R((t))$ as an $R$-algebra, every $k$-derivation 
$R\to R$ extends to  one from $L$ to $L$. So we have an exact sequence
\[
0\to \theta \to \theta_{L,R}\to \theta_R\to 0.
\]
The following corollary essentially says that we have defined in the $L$-module $\FF$ a Lie algebra 
$\hat\theta_{L,R}$ of first order ($k$-linear) differential operators  which contains $R$ as the degree zero 
operators and for which the  symbol map (which is just the formation of the degree one quotient) has image 
$\theta_{L,R}$.


\begin{corollary}\label{cor:derivevir}
The actions on $\FF$ of $F^0\theta_{L,R}=\mathfrak{m}\theta_{{\mathcal O},R}\subset\theta_{L,R}$  (given by 
coefficient-wise derivation,  killing the generator $v_o$) and  $\hat\theta$ coincide on $F^0\theta$ and 
generate a central extension of Lie algebras $\hat\theta_{L,R}\to \theta_{L,R}$ by $Rc_o$. Its defining representation on 
$\FF$ (still denoted $T$)  is faithful and has the property that for every lift $\hat D\in\hat \theta_{L,R}$ of 
$D\in\theta_{L,R}$ and $f\in \mathfrak{l}$ we have $[T(\hat D),f]=Df$ (in particular, it preserves every $U\hat\mathfrak{l}$-submodule 
of $\FF$).
\end{corollary}
\begin{proof}
The generator $t$ can be used to define a section of $\theta_{L,R}\to \theta_R$:
the set of elements of $\theta_{L,R}$ which kill $t$ is a $k$-Lie subalgebra
of  $\theta_{L,R}$ which projects isomorphically onto $\theta_R$.
Now if $D\in \theta_{L,R}$, write $D=D_{\rm vert}+D_{\rm hor}$ with $D_{\rm vert}\in \theta$ and 
$D_{\rm hor} (t)=0$ and define an $R$-linear operator
$\hat D$ in $\FF$ as the sum of $T(\hat D_{\rm vert})$ 
and  coefficient-wise derivation by $D_{\rm hor}$. This map clearly has the
properties mentioned. 

As to its  dependence on $t$: another choice yields a decomposition of the form $D=(D_{\rm hor}+D_0) +(D_{\rm vert} -D_0)$  with 
$D_0\in F^0\theta$ and in view of the above $\hat D_0$ acts in $\FF$ by coefficient-wise derivation.
\end{proof}


\subsection*{The Fock representation for a symplectic local system}

In Section \ref{section:wzw} we shall run into  a particular type of finite rank subquotient of the Fock representation 
and it seems best to discuss the resulting structure  here. We  start out from the following data:
\begin{enumerate}
\item[(i)] a free $R$-module $H$ of finite rank endowed with a symplectic form $\langle\; ,\;\rangle :H\otimes_RH\to R$, which is 
nondegenerate in the sense that the induced map $H\to H^*$, $a\mapsto \langle\; ,a\rangle$ is an isomorphism of $R$-modules, 
\item[(ii)] an $R$-submodule  $\mathfrak{D}\subset\theta_R$ closed under the Lie bracket for which the inclusion is  an equality 
over the generic point and a Lie action $D\mapsto \nabla_D$ of  $\mathfrak{D}$ on $H$ by $k$-derivations which preserves the 
symplectic form,
\item[(iii)] a Lagrangian $R$-submodule $F\subset H$.
\end{enumerate}
Property (ii) means that  $D\in\mathfrak{D}\mapsto \nabla_D\in \operatorname{End}_k(H)$ is $R$-linear, obeys the Leibniz rule: 
$\nabla_D(ra)=r\nabla_D(a)+D(r)a$ and satisfies $\langle \nabla_Da,b\rangle +\langle a, \nabla_Db\rangle = D\langle a,b\rangle$. 
In the cases of interest,  $\mathfrak{D}$  will be the $\theta_R$-stabilizer of a principal ideal in $R$ (and often be all 
of $\theta_{R}$).  One might think of $\nabla$ as a flat meromorphic connection on the symplectic  bundle represented by $H$.

In this setting, a Heisenberg algebra  is defined in an obvious manner:  it is $\hat H:=H\oplus R\hbar $  endowed 
with the bracket $[a+R\hbar, b+R\hbar]=\langle a,b\rangle\hbar$.  We also have defined a Fock representation $\FF (H,F)$ of 
$\hat H$ as the induced module of the rank one representation of  $\hat F=F +R\hbar$ on $R$ given by the coefficient 
of $\hbar$. Notice that if we grade $\FF (H,F)$ with respect to the PBW filtration, we get a copy of the symmetric 
algebra of $H/F$ over $R$. We aim to define a projective Lie action of $\mathfrak{D}$ on $\FF (H,F)$.

We begin with extending the $\mathfrak{D}$-action to $\hat H$ by stipulating that it kills $\hbar$. This action clearly 
preserves the Lie bracket and hence determines one of $\mathfrak{D}$ on the universal enveloping algebra $U\hat H$. 
This does not however induce one in $\FF (H,F)$, as $\nabla_D$ will not respect the right ideal in $U\hat H$ 
generated by $\hbar-1$ and  $F$.  We will remedy this by means of a `twist'. 

We shall use the isomorphism  $\sigma :H\otimes_RH\cong \operatorname{End}_R (H)$ of $R$-modules defined by  associating to 
$a\otimes b$ the endomorphism $\sigma (a\otimes b): x\in H\mapsto a\langle b,x\rangle\in H$. If we agree to identify an 
element in the tensor algebra of $H$, in particular, an element of $H$, as the operator in $U\hat H$ or $\FF(H,F)$ 
given  by left multiplication, then it is ready checked that for $x\in H$, 
\[
[a\circ b, x]=\sigma (a\otimes b+b\otimes a)(x).
\]
We choose a Lagrangian supplement of $F$ in $H$, i.e.,  a Lagrangian $R$-submodule $F'\subset H$ that is also a 
section of $H\to H/F$. Since $F'$ is an abelian Lie subalgebra  of 
$\hat H$, we have a natural map  $\sym^{\scriptscriptstyle\bullet}_R (F')\to \FF (H,F)$. It is clearly an isomorphism of 
$\sym^{\scriptscriptstyle\bullet}_R (F')$-modules.
 Now write $\nabla_D$ according to the Lagrangian decomposition $H=F'\oplus F$:
\[
\nabla_D=\begin{pmatrix} \nabla^{F'}_D & \sigma'_{D}\\
\sigma_D & \nabla^F_D
\end{pmatrix}.
\]
Here the diagonal entries represent the induced connections on $F'$ and $F$, whereas $\sigma_D\in \Hom_R(F',F)$ and 
$\sigma'_{D}\in \Hom_R(F,F')$. Since $\sigma$ identifies $F\otimes_R F$ resp.\  $F'\otimes_R F'$ with 
$\Hom_R(F',F)$ resp.\ $\Hom_R(F,F')$, we can write $\sigma_D=\sigma (s_D)$ with $s_D\in F\otimes_RF$ and 
$\sigma'_{D}=\sigma(s'_D)$ and $s'_D\in F'\otimes_R F'$. These tensors are symmetric and represent the 
second fundamental form of $F'\subset H$ resp.\ $F\subset H$. 
Notice that if $a\in F$, then 
\[
[\nabla_D, a]=\nabla_D(a)=\nabla^F_D(a) +\sigma^F_{F'}(a)=\nabla^F_D(a)+{\tfrac{1}{2}} [s'_D,a]
\]
and  similarly,  if $a'\in F'$, then $[\nabla_D, a']=\nabla^{F'}_D(a')+{\tfrac{1}{2}} [s_D,a']$. This suggests we should assign to
$D\in\mathfrak{D}$ the first order differential operator $T_{F'}(D)$ in $\FF(H,F)\cong\sym^{\scriptscriptstyle\bullet} F'$ defined by
\[
T_{F'}(D):= \nabla^{F'}_D+{\tfrac{1}{2}} s_D+{\tfrac{1}{2}} s'_D. 
\]

\begin{proposition}\label{propdef:connection}
The map $T_{F'}:\mathfrak{D}\to \operatorname{End}_k(\sym^{\scriptscriptstyle\bullet} F')$ is $R$-linear and has the property that $[T_{F'}(D),a]=\nabla_D(a)$ 
for every $D\in\mathfrak{D}$ and $a\in \hat H$. Any other map $\mathfrak{D}\to \operatorname{End}_k(\sym^{\scriptscriptstyle\bullet} F')$ enjoying these properties  
differs from $T_{F'}$ by a multiple of the identity operator, in other words, is of the form
$D\mapsto T_{F'}(D)+\eta (D)$ for some $\eta\in\Hom_R(\mathfrak{D}, R)$. 
\end{proposition}
\begin{proof}
That $T_{F'}(D)$ has the stated property follows from the preceding. Let $\eta:\mathfrak{D}\to \operatorname{End}_k(\sym^{\scriptscriptstyle\bullet} F')$ 
be the difference of two such maps. Then for every $D\in\mathfrak{D}$,  $\eta(D)\in\operatorname{End}_R(\FF(H,F))$ commutes with all 
elements of $\hat H$. Since $\FF(H,F)$ is irreducible as a representation of $\hat H$, it follows that $\eta(D)$ is a scalar 
in $R$.
\end{proof}\index{\footnote{}}

Notice that if $u_1,\dots ,u_r\in \hat H$, then
\begin{multline*}
T_{F'}(D)(u_r\circ\cdots\circ u_1\otimes v_o)=\\=
\left(\sum_{i=1}^r u_r\circ\cdots \circ \nabla_D(u_i)\circ\cdots\circ u_1+ u_r\circ\cdots\circ u_1\circ {\tfrac{1}{2}} s'_D\right)\otimes v_o.
\end{multline*}
So this looks  like the operator $T_{\hat D}$ acting in $\FF$  with $s'_D$ playing the role of $-\hat C(D)$. 
Here is the key result about the `curvature' of $T_{F'}$.

\begin{lemma}
Given $D,E\in\mathfrak{D}$, then  $[T_{F'}(D),T_{F'}(E)]-T_{F'}([D,E])$ is scalar multiplication by $1/2$ times the value on 
 of the $\nabla^F$-curvature on $\det (F)$ on the pair $(D,E)$. 
\end{lemma}
\begin{proof}
The fact that $\nabla$ preserves the Lie bracket is expressed by the following identities:
\begin{align*}
\nabla^{F}_D\nabla^{F}_E-\nabla^{F}_E\nabla^{F}_D-\nabla^{F}_{[D,E]}&=\sigma_E\sigma'_D-\sigma_D\sigma'_E,\\
\nabla^{F'}_D\nabla^{F'}_E-\nabla^{F'}_E\nabla^{F'}_D-\nabla^{F'}_{[D,E]}&=\sigma'_E\sigma_D-\sigma'_D\sigma_E,\\
\nabla^{\Hom(F',F)}_D(\sigma_E)-\nabla^{\Hom(F',F)}_E(\sigma_D)&=\sigma_{[D,E]},\\
\nabla^{\Hom(F,F')}_D(\sigma'_E)-\nabla^{\Hom(F,F')}_E(\sigma'_D)&=\sigma'_{[D,E]}.
\end{align*}
The first two give the curvature of $\nabla^F$ and $\nabla^{F'}$ on the pair $(D,E)$. 
The last two can also be written  as operator identities in $\sym^{\scriptscriptstyle\bullet} F'$:
\begin{align*}
[\nabla^{F'}_D,s_E]-[\nabla^{F'}_E,s_D]&=s_{[D,E]},\\
[\nabla^{F'}_D,s'_E]-[\nabla^{F'}_E,s'_D]&=s'_{[D,E]}.
\end{align*}
If we feed these identities in:
\begin{multline*}
[T_{F'}(D),T_{F'}(E)]-T_{F'}([D,E])=\\=
 [\nabla^{F'}_D+{\tfrac{1}{2}} s_D+{\tfrac{1}{2}} s'_D, \nabla^{F'}_E+{\tfrac{1}{2}} s_E+{\tfrac{1}{2}} s'_E]- (\nabla^{F'}_{[D,E]}+{\tfrac{1}{2}} s_{[D,E]}+
 {\tfrac{1}{2}} s'_{[D,E]})=\\
=\big([\nabla^{F'}_D,\nabla^{F'}_E]-\nabla^{F'}_{[D,E]}\big)
+{\tfrac{1}{2}} \big([\nabla^{F'}_D,s_E]-[\nabla^{F'}_E,s_D]-s_{[D,E]})\big)\\
+{\tfrac{1}{2}} \big([\nabla^{F'}_D,s'_E]-[\nabla^{F'}_E,s'_D]-s'_{[D,E]})\big)
+\tfrac{1}{4}\big([s_D,s'_E]-[s_{E},s'_D]\big)
\end{multline*}
(where we identified $\FF (H,F)$ with $\sym^{\scriptscriptstyle\bullet} F'$), we obtain
\[
[T_{F'}(D),T_{F'}(E)]-T_{F'}([D,E])=
\big(\sigma'_E\sigma_D+\tfrac{1}{4}[s_D,s_E'])-\big(\sigma'_D\sigma_E +\tfrac{1}{4}[s_{D'},s_E]\big).
\]
We must show that the right hand side is equal to ${\tfrac{1}{2}}\Tr (\sigma_E\sigma'_D-\sigma_D\sigma'_E)$,
or perhaps more specifically, that  $\sigma'_E\sigma_D+\tfrac{1}{4}[s_D,s_E']=- {\tfrac{1}{2}}\Tr (\sigma_D\sigma'_E)$ (and 
similarly if we exchange $D$ and $E$).
This reduces to the following identity in linear algebra: if $a\in F$ and $\beta\in F'$, then in $\sym^{\scriptscriptstyle\bullet} F'$ we have
\[
\sigma(\beta\otimes\beta)\sigma (a\otimes a)+\tfrac{1}{4}[a\circ a,\beta\circ\beta]=-{\tfrac{1}{2}}
\Tr_{F'}(\sigma_{a\otimes a}\sigma_{\beta\otimes\beta}),
\]
Indeed, a straightforward computation shows that
\[
[a\circ a,\beta\circ\beta]=2\langle a,\beta\rangle (a\circ\beta+\beta\circ a)=4\langle a,\beta\rangle\beta\circ a+2\langle a,\beta\rangle^2.
\]
If we interpret $\langle a,\beta\rangle\beta\circ a$ as an operator in $\sym^{\scriptscriptstyle\bullet} F'$, then applying it to  
 $x\in F'$ yields $\langle a,\beta\rangle\beta\langle a, x\rangle=-\sigma(\beta\otimes\beta)\sigma (a\otimes a)(x)$. We also find that 
$\langle a,\beta\rangle^2=-\Tr_{F'}(\sigma(a\otimes a)\sigma(\beta\otimes\beta)$.
\end{proof}

If $N$ is a free $R$-module of rank one, then by a \emph{square root of $N$} we mean a free $R$-module 
$\Theta$ of rank one together with an  isomorphism of $\Theta\otimes_R\Theta$ onto $N$.

\begin{corollary}\label{cor:twistedfock}
Let  $\Theta$ be a square root of $\det_R(F)$.  Then the twisted Fock module 
$\Hom_R (\Theta, \FF(H,F))$ comes with a natural action of $\mathfrak{D}$ by derivations.
\end{corollary}
\begin{proof}
Given the Lagrangian supplement $F'$ of $F$ in $H$, then endow $\Theta$ with the unique 
$\mathfrak{D}$-module structure that makes the given isomorphism $\Theta\otimes_R\Theta\cong \det_R(F)$ 
one of  $\mathfrak{D}$-modules: if $w\in \Theta$ is a generator and $\nabla^{\det F}_D(w\otimes w)=rw\otimes w$, 
then $\nabla^\Theta_D(w)={\tfrac{1}{2}} rw$.
This ensures that the $\mathfrak{D}$-action on  $\Hom_R(\Theta, \sym^{\scriptscriptstyle\bullet} F')$ preserves the Lie bracket. It remains to 
show that this action is independent of $F'$. This can be verified by a computation, but rather than carrying this out, 
we give an abstract argument that avoids this. It is based on the well-known fact that if $H_o$ is a 
fixed symplectic  $k$-vector space of finite dimension $2g$, and  $F_o\subset H_o$ is  Lagrangian, then the set 
of  Lagrangian supplements of $F_o$ in $H_o$ form in the Grassmannian of $H_o$ an affine space over 
$\sym^2_kF_o$ (and hence is simply connected). Now by doing the preceding construction universally over 
the corresponding affine space over 
$\sym^2_R F$, we see that the flatness on the universal example immediately gives the independence. 
\end{proof}


\begin{remark}\label{rem:twistedfock}
We will use this corollary mainly via the following  reformulation. First we observe that
the Lie algebra of first order $k$-linear differential operators $\Theta\to \Theta$ projects to $\theta_{R}$ 
(this is the symbol map) with kernel the scalars $R$. Denote by $\mathfrak{D}(\Theta)$ the preimage of $\mathfrak{D}$. 
This is clearly a Lie subalgebra. Then the above corollary can be understood as saying that there is a natural 
Lie action of $\mathfrak{D}(\Theta)$ on $\FF (H,F)$ by first order differential operators, acting, in the terminology of 
Section \ref{section:projflat}, with weight $1$. The image in $\operatorname{End}_k(\FF (H,F))$ is the $R$-submodule of 
$\operatorname{End}_k(\FF (H,F))$ generated by the $T_{F'}(D)$ and the identity operator.  
We may also use $\mathfrak{D}(\det_R(F))$ instead, although then the weight will be ${\tfrac{1}{2}}$.
Note that our discussion of projectively flat connections in Section 1 now suggests a formulation in more 
geometric terms, namely that the pull-back of $\FF (H,F)$ to the geometric realization of the $\GG_m$-bundle 
over $\spec (R)$ defined by  $\det_R(F)$ acquires a flat meromorphic connection with fiber monodromy 
minus the identity. 
\end{remark}

\begin{remark}
 The preceding follows the presentation of Boer-Looijenga \cite{bl} rather closely. The quadratic terms that enter in the definition of $T_{F'}$ are in a way a relict of the heat operator of which the theta functions associated to this symplectic local system are solutions (flat sections are expansions of theta functions relative to an unspecified lattice).
\end{remark}


\section{The Sugawara construction}\label{section:sugawara}

In this section we show how the Virasoro algebra acts in the standard representions
of a centrally extended loop algebra. This construction goes back to the physicist H.~Sugawara (in 1968), but it was probably Graeme Segal who first noticed its relevance for the present context.  

Most of the material below can for instance be found in \cite{kacraina} (Lecture 10) and   \cite{kac} (Ch.\ 12), but our presentation slightly deviates from the standard sources in substance as well in form: we approach the Sugawara construction via the construction discussed in the previous section and put it in the (coordinate free) setting that makes it appropriate for the application we have in mind. 
\\


In this section, we fix a simple Lie algebra $\mathfrak{g}$ over $k$ of finite dimension. 
We retain the data and the notation of Section \ref{section:vir}.

\subsection*{Loop algebras} We identify  $\mathfrak{g}\otimes\mathfrak{g}$ with the space of  bilinear forms $\mathfrak{g}^*\times\mathfrak{g}^*\to k$, where  $\mathfrak{g}^*$ denotes  the $k$-dual of $\mathfrak{g}$, as usual. We form its space of $\mathfrak{g}$-covariants (relative to the 
adjoint action on both factors):
\[
q:\mathfrak{g}\otimes\mathfrak{g}\to (\mathfrak{g}\otimes\mathfrak{g})_\mathfrak{g}=:\mathfrak{c}.
\]
This space is known to be of dimension one and to consist of symmetric tensors. 
It has a canonical generator which is characterized by the 
property that it is represented by a $\mathfrak{g}$-invariant symmetric tensor $c\in \mathfrak{g}\otimes\mathfrak{g}$ with the property that
$c(\theta\otimes\theta)=2$ if $\theta\in\mathfrak{g}^*$ is a long root (relative to a choice of Cartan subalgebra $\mathfrak{h}$ of 
$\mathfrak{g}$; the roots then lie in the zero eigenspace of $\mathfrak{h}$ in $\mathfrak{g}^*$). This element is in fact  invariant under 
the full  automorphism group of the Lie algebra $\mathfrak{g}$, not just the inner ones. It is nondegenerate when viewed 
as a symmetric bilinear form  on $\mathfrak{g}^*$  and so the inverse form on  $\mathfrak{g}$ is defined. If we denote the latter by 
$\check{c}$,  then the equivariant projection $q:\mathfrak{g}\otimes\mathfrak{g}\to \mathfrak{c}$ is given by 
$X\otimes Y\mapsto \check{c}(X,Y)c$.

It is well-known and easy to prove that $c$ maps to the center of $U\mathfrak{g}$. This implies that
$c$ acts in any irreducible representation  of $\mathfrak{g}$ by a scalar.
In the case of the adjoint representation half this scalar is called the \emph{dual Coxeter number} of $\mathfrak{g}$  
and is denoted by $\check{h}$. So if we choose an orthonormal basis $\{ X_\kappa\}_\kappa$ 
of $\mathfrak{g}$ relative to $\check{c}$ so that $c$  takes the form $\sum_\kappa X_\kappa\otimes X_\kappa$, then 
\[
\sum_\kappa [X_\kappa ,[X_\kappa, Y]]=2\check{h}Y\quad \text{for all $Y\in\mathfrak{g}$.}
\]

Let $L\mathfrak{g}$ stand for $\mathfrak{g}\otimes_k L$, but considered as a filtered $R$-Lie algebra (so we restrict the scalars to 
$R$) with $F^N L\mathfrak{g}= \mathfrak{g}\otimes_k \mathfrak{m}^N$.
An argument similar to the one we used to prove that the pairing $r$ is  topologically  perfect shows that the pairing
\[
r_\mathfrak{g} : (\mathfrak{g}\otimes_k L)\times (\mathfrak{g}\otimes_k\omega)\to \mathfrak{c}\otimes_k R=:\mathfrak{c}_R
\]
which sends $(Xf,Y\alpha)$ to $q(X\otimes Y)\res (f\alpha)$ is topologically perfect
(the basis dual to  $(X_\kappa t^l)_{\kappa,l}$ is $(X_\kappa t^{-l-1}dt\otimes c)_{\kappa,l}$). 

For an integer $N\ge 0$, the
quotient $U L\mathfrak{g}/U L\mathfrak{g}\circ F^NL\mathfrak{g}$ is a free $R$-module  (a set of generators is 
$X_{\kappa_1}t^{k_1}\circ\cdots\circ X_{\kappa_r}t^{k_r}$, $k_1\le\cdots\le k_r<N$). 
We complete $U L\mathfrak{g}$  $\mathfrak{m}$-adically on the right: 
\[
{\overline{U}} L\mathfrak{g}:= \varprojlim_N  U L\mathfrak{g}/
U L\mathfrak{g}\circ  F^NL\mathfrak{g}.
\]
A central extension of Lie algebras
\[
0\to\mathfrak{c}_R\to \widehat{L\mathfrak{g}}\to L {\mathfrak{g}}\to 0
\]
is defined by endowing the sum $L\mathfrak{g}\oplus \mathfrak{c}_R$ with the Lie bracket
\[
[Xf+c r ,Yg+c s ]:=[X,Y]fg +r_\mathfrak{g} (Yg, Xdf).
\]
Since the residue is zero on ${\mathcal O}$, the inclusion of 
${\mathcal O}\mathfrak{g}$ in $\widehat{L\mathfrak{g}}$ is a homomorphism of Lie algebras. In fact, this is a  canonical (and even unique)
Lie section of the central extension over ${\mathcal O}\mathfrak{g}$, for it is just the derived Lie algebra of the preimage
of ${\mathcal O}\mathfrak{g}$ in $\widehat{L\mathfrak{g}}$. The $\aut (\mathfrak{g})$-invariance of $c$ implies
that the tautological action of $\aut (\mathfrak{g})$ on $\mathfrak{g}$ extends to $\widehat{L\mathfrak{g}}$.

We filter $\widehat{L\mathfrak{g}}$ by setting  
$F^N\widehat{L\mathfrak{g}}=F^NL {\mathfrak{g}}$ for $N>0$ and  $F^N\widehat{L\mathfrak{g}}=F^NL {\mathfrak{g}} +\mathfrak{c}_R$ for $N\le 0$.
Then $U \widehat{L\mathfrak{g}}$ is a filtered $R[c]$-algebra whose reduction modulo $c$ is 
$U L \mathfrak{g}$. The $\mathfrak{m}$-adic completion on the right
\[
{\overline{U}} \widehat{L\mathfrak{g}}:= \varprojlim_N  
U \widehat{L\mathfrak{g}}/(U \widehat{L\mathfrak{g}}\circ F^NL {\mathfrak{g}})
\]
is still an $R[c]$-algebra and the obvious surjection 
${\overline{U}}\widehat{L\mathfrak{g}}\to {\overline{U}} L\mathfrak{g}$ is the reduction modulo $c$.
These (completed) enveloping algebras not only come with the (increasing) Poincar\'e-Birkhoff-Witt filtration, 
but also inherit a (decreasing)  filtration from $L$. 

\subsection*{Segal-Sugawara representation}
Tensoring with $c\in \mathfrak{g}\otimes_k\mathfrak{g}$ defines the $R$-linear map
\[
\mathfrak{l}\otimes_R\mathfrak{l}\to L {\mathfrak{g}}\otimes_R L {\mathfrak{g}},\quad
f\otimes g\mapsto c\cdot f\otimes g=\sum_{\kappa}X_\kappa f\otimes X_{\kappa}g,
\]
which, when composed with $L {\mathfrak{g}}\otimes_R L {\mathfrak{g}}\subset \widehat{L\mathfrak{g}}\otimes_R \widehat{L\mathfrak{g}}\to U\widehat{L\mathfrak{g}}$, yields a map 
$\gamma: \mathfrak{l}\otimes_R\mathfrak{l}\to U\widehat{L\mathfrak{g}}$. Since 
$\gamma (f\otimes g-g\otimes f)=\sum_\kappa [X_\kappa f,X_\kappa g]=c\dim\mathfrak{g} \res (g df)$,  $\gamma$  
drops and extends naturally to an $R$-module homomorphism  
$\hat\gamma: \mathfrak{l}_2\to U\widehat{L\mathfrak{g}} $ which sends $\hbar$ to  $c\dim\mathfrak{g}$.
This, in turn, extends continuously to a map from the closure $\bar\mathfrak{l}_2$ of
$\mathfrak{l}_2$ in ${\overline{U}} \hat\mathfrak{l}$ to ${\overline{U}}\widehat{L\mathfrak{g}}$.
As $\bar\mathfrak{l}_2$ contains the image of $\hat C:\theta\to {\overline{U}}\hat\mathfrak{l}$, and since $c$ is 
$\aut (\mathfrak{g})$-invariant, we get a $R$-homomorphism 
\[
\hat C_\mathfrak{g}:=\hat\gamma\hat C :\theta\to ({\overline{U}} \widehat{L\mathfrak{g}})^{\aut (\mathfrak{g})}.
\]
We may  also describe $\hat C_\mathfrak{g}$ in the spirit of Section 
\ref{section:vir}: given $D\in \theta$, then the $R$-linear  map
\[
1\otimes D:  \mathfrak{g}\otimes_k\omega \to  \mathfrak{g}\otimes_k L
\]
is continuous and self-adjoint relative to $r_\mathfrak{g}$ and the perfect pairing 
$r_\mathfrak{g}$ allows us to identify it with an element of ${\overline{U}} L\mathfrak{g}$; this element
produces  our $\hat C_\mathfrak{g}(D)$. Thus the choice of the parameter $t$ yields
\[
\hat C_\mathfrak{g}(D_k)={\tfrac{1}{2}}\sum_{\kappa, l}: X_\kappa t^{k-l}\circ 
X_\kappa t^l:\quad.
\]
This formula can be used to define  $\hat C_\mathfrak{g}$, but this approach does  not exhibit its naturality.

\begin{lemma}
For $X\in\mathfrak{g}$ and $f\in L$ we have
\[
[\hat C_\mathfrak{g}(D_k), Xf]= -(c+\check{h} )XD_k(f)
\]
(an identity in ${\overline{U}} \widehat{L\mathfrak{g}}$) and upon a choice of a parameter $t$, then
with the preceding notation
\[
[\hat C_\mathfrak{g}(D_k), \hat C_\mathfrak{g}(D_l)]=(c+\check{h})
(k-l)\hat C_\mathfrak{g}(D_{k+l})+c(c+\check{h})\delta_{k+l,0} \frac{k^3-k}{12}\dim \mathfrak{g}.
\]
\end{lemma}

For the proof (which  is  a bit  tricky, but not very deep), we refer to Lecture 10 of 
\cite{kacraina} (our  $C_\mathfrak{g}(\hat D_k)$ is their $T_k$). This formula suggests that we make the
central element  $c+\check{h}$ of ${\overline{U}} \widehat{L\mathfrak{g}}$ invertible (its inverse might be viewed  as a 
rational function on $\mathfrak{c}^*$), so that we can state this lemma  in a more natural manner as follows. 

\begin{corollary}[Sugawara representation]\label{cor:sugawara}
The map $\hat D_k\mapsto \frac{-1}{c+\check{h}}\hat C_\mathfrak{g}(D_k)$ induces a natural 
homomorphism of $R$-Lie algebras
\[
T_\mathfrak{g}: \hat\theta\to \big({\overline{U}}\widehat{L\mathfrak{g}} [ \tfrac{1}{c+\check{h}}]\big)^{\aut(\mathfrak{g})}
\]
which  sends the central element $c_0\in \hat\theta$ to $c(c+\check{h})^{-1}\dim \mathfrak{g}$. Moreover, if 
$\hat D\in\hat\theta$, then 
$\ad_{T_\mathfrak{g}(\hat D)}$ leaves $L {\mathfrak{g}}$ 
invariant (as a subspace of ${\overline{U}}\widehat{L\mathfrak{g}}$) and acts on that subspace by derivation with respect to the image of 
$\hat D$ in $\theta$.
\end{corollary}

\subsection*{A representation for $\widehat{L\mathfrak{g}}$} 
We fix $\ell\in k$ with $\ell\not= -\check{h}$. Let $F^1L {\mathfrak{g}}\oplus \mathfrak{c}_R$ act on the free $R$-module of rank one 
$Rv_\ell$ via the projection onto the second factor $\mathfrak{c}_R=Rc$ with
$c$ acting as multiplication by $\ell$. We regard  $F^1L {\mathfrak{g}}\oplus \mathfrak{c}_R$ as a subalgebra of $U\widehat{L\mathfrak{g}}$ so that we can 
form the induced module 
\[
\FF_\ell(\mathfrak{g},L):=U\widehat{L\mathfrak{g}} \otimes_{U(F^1L {\mathfrak{g}}\oplus \mathfrak{c}_R)} Rv_\ell,
\]
which we often simply denote by  $\FF_\ell(\mathfrak{g})$.
We  use $v_\ell$ also to denote its image in this module. As  an $R$-module $\FF_\ell(\mathfrak{g})$ is generated by
$X_{\kappa_r}t^{-k_r}\circ\cdots \circ X_{\kappa_1}t^{-k_1}\otimes v_\ell$, where $r\ge 0$, 
$0\le k_1\le k_2\le \cdots \le k_r$ and
where $(X_{\kappa})_\kappa$ is a given $k$-basis of  $\mathfrak{g}$.
If we let $\hat\theta$ act on  $\FF_\ell(\mathfrak{g})$ via $T_\mathfrak{g}$, then 
it follows from Corollary \ref{cor:sugawara} that if $\hat D\in \hat\theta$ lifts $D\in\theta$, then
\begin{multline*}
T_\mathfrak{g}(\hat D)X_{\kappa_r}t^{-k_r}\circ\cdots \circ X_{\kappa_1}t^{-k_1}\otimes v_\ell=\\
=\sum_{i=1}^r X_{\kappa_r}t^{-k_r}\circ\cdots
X_{\kappa_i}D(t^{-k_i})\circ\cdots \circ X_{\kappa_1}t^{-k_1}\otimes v_\ell+\\
+X_{\kappa_r}t^{-k_r}\circ\cdots \circ X_{\kappa_1}t^{-k_1}\circ T_\mathfrak{g}(\hat D) v_\ell.
\end{multline*}
Thus $\hat\theta$ is  faithfully represented as a Lie algebra 
of $R$-linear endomorphisms of $\FF_\ell(\mathfrak{g})$.
If $D\in F^0\theta$, then clearly $T_\mathfrak{g}(\hat D)v_\ell=0$ and hence
we have the following counterpart of Corollary \ref{cor:derivevir} (with
the same proof). It tells us that $\hat\theta_{L,R}$ acts in  $\FF_\ell(\mathfrak{g})$ as  a Lie algebra 
of first order differential operators, but with its degree zero part $R$ acting with weight $(c+\check{h})^{-1}c\dim \mathfrak{g}$:

\begin{corollary}\label{cor:derive}
The Sugawara representation $T_\mathfrak{g}$ of $\hat\theta$ on  $\FF_\ell(\mathfrak{g})$ 
extends to $\hat\theta_{L,R}$ in such  a manner that $F^0\theta_{L,R}$ acts by coefficientwise derivation 
(killing the generator $v_\ell$),  $[T_{\mathfrak{g}}(\hat D),Xf]=X(Df)$ for $X\in\mathfrak{g}$, $f\in L$ and $T_{\mathfrak{g}}(\hat D)$ is 
$\aut (\mathfrak{g})$-invariant. In particular, this action preserves every  $U\widehat{L\mathfrak{g}}$-submodule of $\FF_\ell(\mathfrak{g})$.
\end{corollary}

\subsection*{Semi-local case}
This refers to the situation where we allow the $R$-algebra $L$ to be a finite direct sum of $R$-algebras isomorphic 
to $R((t))$: $L=\oplus_{i\in I} L_i$, where $I$ is a nonempty finite index set and $L_i$ as before. 
We then extend  the notation employed earlier in the most natural fashion.
For instance, ${\mathcal O}$, $\mathfrak{m}$, $\omega$, $\mathfrak{l}$ are now the direct sums over $I$ (as filtered objects)  
of the items suggested by the notation.
If $r: L\times\omega\to R$ denotes the sum of the residue pairings of 
the summands, then $r$ is still topologically perfect. However, we take for 
the oscillator algebra $\hat\mathfrak{l}$ not  the direct sum of the $\hat\mathfrak{l}_i$, but rather
the quotient of  $\oplus_i\hat\mathfrak{l}_i$ that identifies the central generators 
of the summands with a single $\hbar$. We thus get a Virasoro extension
$\hat\theta$ of $\theta$ by $c_0 R$ and a (faithful) oscillator representation of
$\hat\theta$ in ${\overline{U}}\hat\mathfrak{l}$. The decreasing filtrations are the obvious
ones. We shall denote by $\FF$ the Fock representation $\FF$ of $\hat{\mathfrak{l}}$ 
that ensures that the unit of every summand ${\mathcal O}_i$ acts  the identity; it is then the induced
representation of the rank one representation of $F^0\hat{\mathfrak{l}}={\mathcal O}\oplus R\hbar$ in 
$Rv_o$.

In likewise manner we define $\widehat{L\mathfrak{g}}$ (a central extension of 
$\oplus_{i\in I} L\mathfrak{g}_i$ by $\mathfrak{c}_R$) and construct  the associated Sugawara representation.
The representation $\FF_\ell(\mathfrak{g})$ of  $\widehat{L\mathfrak{g}}$ is as before. We have defined  $\hat\theta_{L,R}$
and Corollaries \ref{cor:sugawara} and  \ref{cor:derive} continue to hold.



\section{The WZW connection: algebraic aspects}\label{section:wzw}

From now on we place ourselves in the semi-local case, so $L=\oplus_{i\in I}L_i$  with $I$ nonempty and finite 
and $L_i\cong R((t))$.  For the sake of transparency, we  begin with an abstract discussion that will lead us to the 
Fock representation of a symplectic local system.

\subsection*{Abstract spaces of covacua I}
Let  $A$  be a $R$-subalgebra of $L$ and let $\theta_{A/R}$ have the usual meaning
as the Lie algebra of $R$-derivations $A\to A$. We denote by $A^\perp\subset L$ the annihilator of $A$ 
relative to the residue pairing.
We assume that:
\begin{enumerate}
\item[($A_1$)] as an $R$-algebra, $A$ is flat and of finite type and $A\cap {\mathcal O} =R$,
\item[($A_2$)] the $R$-modules $L/(A+{\mathcal O})$ and $F: =A^\perp\cap{\mathcal O} $ are 
free of finite rank and the residue pairing induces a perfect pairing $L/(A+{\mathcal O})\otimes_R F\to R$.
\item[($A_3$)] the universal continuous $R$-derivation  $d: L\to \omega$ maps $A$ to $A^\perp$ and the $A$-dual of the 
resulting $A$-homomorphism  $\Omega_{A/R}\to A^\perp$  is an $R$-isomorphism 
$\Hom_A(A^\perp,A)\cong\theta_{A/R}$.
\end{enumerate}


\begin{remark}\label{rem:}
The example to keep in mind is  the following. Since $R$ is regular local $k$-algebra, it represents a smooth germ 
$(S,o)$. Suppose we are given a family  $\pi: {\mathcal C}\to S$ of smooth projective curves of genus $g$ over this 
germ, endowed with pairwise disjoint sections $(x_i)_{i\in I}$. We let  ${\mathcal O}_i$ be  is the formal completion of 
${\mathcal O}_{{\mathcal C}}$ along $x_i$, let $L_i$ be obtained from ${\mathcal O}_i$ by inverting a generator for the ideal defining 
$x_i(S)$, and take for  $A$ the $R$-algebra of regular functions on 
${\mathcal C}^\circ:={\mathcal C}-\cup_i x_i(S)$ (or rather its isomorphic image in $L=\oplus_i L_i$). It is a classical fact that the 
three properties $A_1,A_2,A_3$ are then satisfied. For instance, $L/(A+{\mathcal O})$ has according to Weil the interpretation 
of $R^1\pi_*{\mathcal O}_{\mathcal C}$ and hence is free of rank $g$. It is also classical that the annihilator of $A$ in $\omega$ 
is precisely the image of the space relative rational differentials on ${\mathcal C}/S$ that are regular on ${\mathcal C}^\circ$ 
(so in this case  $\Omega_{A/R}\to A^\perp$ is already an isomorphism before dualizing).
\end{remark}


We put $H:= A^\perp/A$. It follows from properties ($A_1$) and  ($A_2$), that the natural map $F\to H$ is an 
embedding with image a Lagrangian subspace.  Recall that $\theta_{A,R}$ denotes  the Lie algebra of 
$k$-derivations $A\to A$  which preserve $R$. The kernel of the natural map $\theta_{A,R}\to \theta_R$ is 
$\theta_{A/R}$ and its image,  is by definition the $R$-submodule  of $k$-derivations  $R\to R$ that extend to one 
of $A$. We denote this image by $\theta_R^A\subset \theta_R$ and  refer to it as the module of 
\emph{liftable derivations}. This module is clearly closed under the Lie bracket. We shall assume that we have 
equality in the generic point,
so that $\theta_R^A$ is as our $\mathfrak{D}$. According to ($A_3$) any element of 
$\theta_{A/R}$ induces the zero map in $H$ and so $\theta_{A,R}$ acts in $H$ (as a  $k$-Lie algebra) through $\theta_{A,R}$.  It is clear that  $\theta_{A,R}\subset \theta_{L,R}$. 

(In the above example, $H$ would represent the first De Rham cohomology module of ${\mathcal C}/S$, $F$ the 
module of relative regular differentials, and we would have  $\theta_R^A=\theta_R$, as every vector field 
germ on $(S,o)$ lifts to rational vector field on ${\mathcal C}$ that is regular on  ${\mathcal C}^\circ$. The Lie action is 
then 
that of covariant derivation of relative cohomology classes. The reason for us to allow $\theta_R^A\not=\theta_R$ 
is because we want to admit the central  fibers of ${\mathcal C}\to S$ to have modest singularities; in that case 
$\theta_R^A$ is the $\theta_R$-stabilizer of  a principal ideal in $R$, the 
\emph{discriminant} ideal of $\pi$.) 

We write $\hat\theta_{A,R}$ for
the preimage of  $\theta_{A,R}$ in $\hat\theta_{L,R}$ and by
$\hat\theta_R^A$ the quotient $\hat\theta_{A,R}/\theta_{A/R}$. 
These are  extensions of $\theta_{A,R}$ resp.\ $\theta_R^A$ 
by $c_0R$. They can be split, but not canonically so. 

Since $A d(A)\subset A^\perp$,
the residue pairing vanishes on $A\times A d(A)$ and hence  $A$ is contained in $\hat{\mathfrak{l}}$ as an abelian Lie subalgebra. 
Let $\FF_A:= \FF /A\FF$ denote the space of $A$-covariants. 

\begin{theorem}\label{thm:A}
The following properties hold:
\begin{enumerate}
\item[(i)] The space of covariants $\FF_A$ is naturally identified with the Fock representation $\FF(H,F)$,
\item[(ii)] for  every  $D\in\theta_{A/R}$ there exists a lift $\hat D\in\hat\theta_{A/R}$ such that 
$T(\hat D)$ lies in the closure of 
$A \circ\hat{\mathfrak{l}}$ in ${\overline{U}}\hat{\mathfrak{l}}$,
\item[(iii)] the  representation of the Lie algebra $\hat\theta_{A,R}$ on 
$\FF$ preserves the submodule $A \FF$ and $\hat\theta_{A,R}$ acts in  $\FF_A$ through 
$\hat\theta_R^A$ by differential operators of degree $\le 1$ (with $c_0$ acting as the identity), 
\item[(iv)] if $\Theta$ is a square root of $\det_R(F)$, then the image of  this action on  $\FF_A$ is  equal to 
the image of the Lie algebra of first order differential operators $\theta_R^A(\Theta)$ (as described in Remark \ref{rem:twistedfock}).
\end{enumerate}
\end{theorem}
\begin{proof}
The proof of the first assertion is straightforward and left to the reader.

Since $L/(A+{\mathcal O})$ is finitely generated as a $R$-module, we can choose a finite subset
$M\subset L$ such that $L=A +\sum_{f\in M} Rf +{\mathcal O}$.

Now let $D\in \theta_{A/R}$. According to ($A_3$), we may view $D$ as 
a $L$-linear map $\omega\to L$ which maps $A^\perp$ to $A$. This implies that
$\hat C (\hat D)$ lies in the closure of the image of 
$A\otimes_R \hat{\mathfrak{l}}+ \hat{\mathfrak{l}}\otimes_R A$ 
in ${\overline{U}} \hat{\mathfrak{l}}$. It follows that  $\hat C (\hat D)$ has the form
$\hbar r+\sum_{n\ge 1} f_n\circ g_n$ with $r\in R$, one of $f_n,  g_n\in L$  
being in $A$ and the order of $f_n$ smaller than that of
$g_n$ for almost all $n$. In view of the fact that the nonzero elements of $A$ 
are of lower order than those of ${\mathcal O}$ and $f_n\circ g_n\equiv
g_n\circ f_n \pmod{\hbar R}$, we can assume
that all $f_n$ lie in $A$ and so we can arrange that 
$\hat C (\hat D)$ lies in the closure of $A\circ \hat{\mathfrak{l}}$. 

For  (iii)  we observe that if $D\in \theta_{A,R}$ and 
$f\in A$, then  $[D,f]=Df$ lies in $A$. 
This shows that $T(\hat D)$ preserves  $A\FF$ and hence acts in $\FF_A$. When $D\in \theta_{A/R}$ and if we choose
$\hat D\in\hat\theta_{A/R}$ as in (ii), then $T(\hat D)$ is clearly zero in $\FF_A$. 
Thus $\hat\theta_{A,R}$ acts in $\FF_A$ through  $\hat\theta_R^A$.

Property (iv) follows from the observation that the action of $\hat\theta_{A,R}$ on $\FF_A\cong\FF (H,F)$ 
evidently has the properties described in  Proposition-Definition \ref{propdef:connection}.
\end{proof}
 

\subsection*{Abstract spaces of covacua II}
We continue with the setting of the previous subsection. With $\mathfrak{g}$ as before we have defined $\FF_\ell(\mathfrak{g})$.
We first consider   the space of 
$A\mathfrak{g}$-covariants in $\FF_\ell(\mathfrak{g})$, 
\[
\FF_\ell(\mathfrak{g})_{A\mathfrak{g}}:=\FF_\ell(\mathfrak{g})/A\mathfrak{g} \FF_\ell(\mathfrak{g}).
\] 

\begin{proposition}\label{prop:B}
For  $\hat D\in \hat\theta_{A/R}$, $T_\mathfrak{g}(\hat D)$ lies in the closure of 
$A\mathfrak{g}\circ\widehat{L\mathfrak{g}}$ in ${\overline{U}}\widehat{L\mathfrak{g}}$. The Sugawara representation of the Lie algebra 
$\hat\theta_{A,R}$ on 
$\FF_\ell(\mathfrak{g}) $ preserves the submodule $A\mathfrak{g} \FF_\ell(\mathfrak{g})\subset \FF_\ell(\mathfrak{g})$ and
acts in the space of $A\mathfrak{g}$-covariants in $\FF_\ell(\mathfrak{g})$, $\FF_\ell(\mathfrak{g})_{A\mathfrak{g}}$, 
via $\hat\theta_R^A$; this representation is one by differential operators of degree $\le 1$ 
(with $c_0$ acting as multiplication by  $(c+\check{h})^{-1}c\dim\mathfrak{g}$).  
\end{proposition}
\begin{proof} The proof is similar to the arguments used to prove Theorem \ref{thm:A}.
Since $D$ maps $A^\perp$ to $A\subset L$,
$1\otimes D$ maps the submodule $\mathfrak{g}\otimes A^\perp$ of 
$\mathfrak{g}\otimes\omega$ to the submodule $\mathfrak{g}\otimes A=A\mathfrak{g}$ of 
$\mathfrak{g}\otimes L =L\mathfrak{g}$. It is clear that  
$\mathfrak{g}\otimes A^\perp$ and $A\mathfrak{g}$ are each others 
annihilator relative to the pairing $r_\mathfrak{g}$. This implies that
$\hat C (\hat D)$ lies in the closure of the image of 
$A\mathfrak{g}\otimes_k L {\mathfrak{g}}+ L {\mathfrak{g}}\otimes_k A\mathfrak{g}$ 
in ${\overline{U}} \widehat{L\mathfrak{g}}$. It follows that  $\hat C (\hat D)$ has the form
$cr+\sum_\kappa\sum_{n\ge 1} X_\kappa f_{\kappa,n}\circ X_\kappa g_{\kappa,n}$ with $r\in R$, one of 
$f_{\kappa_n},  g_{\kappa,n}\in L$  
being in $A$ and the order of $f_{\kappa_n}$ smaller than that of
$g_{\kappa,n}$ for almost all $\kappa, n$. Since the elements of $A$ have 
order $\le 0$ and $X_\kappa f_{\kappa,n}\circ X_\kappa g_{\kappa,n}\equiv
X_\kappa g_{\kappa,n}\circ X_\kappa f_{\kappa,n}\pmod{cR}$, we can assume
that all $f_{\kappa, n}$ lie in $ A$ and so the first assertion follows.

If $D\in \theta_{A,R}$, then for 
$X\in \mathfrak{g}$ and $f\in A$, we have $[D,Xf]=X(Df)$, which is an element
of $A\mathfrak{g}$ (since $Df\in A$). This shows that $T_\mathfrak{g}(\hat D)$ 
preserves $A\mathfrak{g}\FF_\ell(\mathfrak{g})$. If $D\in \theta_{A/R}$, then it follows from the proven part  that 
$T_\mathfrak{g}(\hat D)$ maps 
$\FF_\ell(\mathfrak{g})$ to $A\mathfrak{g}\FF_\ell(\mathfrak{g})$ and hence induces the zero
map in $\FF_\ell(\mathfrak{g})_{A\mathfrak{g}}$. So $\hat\theta_{A,R}$ acts on $\FF_\ell(\mathfrak{g})_{A\mathfrak{g}}$ via $\hat\theta_R^A$.
\end{proof}


For what follows we need to briefly review from \cite{kac} the theory of highest weight representations of a 
loop algebra such as $\widehat{L\mathfrak{g}}$. According to that  theory, the natural analogues  for 
$\widehat{L\mathfrak{g}}$ of the finite dimensional  irreducible representations  of the  finite dimensional semi-simple 
Lie algebras are obtained as follows, assuming that $I$ is a singleton.
Fix an integer $\ell\ge 0$ and let $V$ be a finite dimensional irreducible representation of $\mathfrak{g}$.  
Make $V$ a $k$-representation of  $F^0L {\mathfrak{g}}$ by letting $c$ act as multiplication by  $\ell$ and by letting 
$\mathfrak{g}\otimes_k{\mathcal O}$ act via its projection onto $\mathfrak{g}$. If we induce this up to $\widehat{L\mathfrak{g}}$ we get  a representation 
$\widetilde{{\mathbb H}}_\ell (V)$ of $\widehat{L\mathfrak{g}}$  which clearly is a quotient of $\FF_\ell(\mathfrak{g})$.  Its irreducible quotient is denoted 
by ${\mathbb H}_\ell(V)$. This is integrable as an  $\widehat{L\mathfrak{g}}$-module: if $Y\in\mathfrak{g}$ is nilpotent and $f\in L$, then $Y f$ acts 
locally nilpotently  in ${\mathbb H}_\ell(V)$ (which means that the latter is a union of finite dimensional $Yf$-invariant 
subspaces in which $Yf$ acts nilpotently). We can be more precise if we fix  a Cartan subalgebra  
$\mathfrak{h}\subset\mathfrak{g}$ and a system of positive roots $(\alpha_1,\dots ,\alpha_r)$ in  $\mathfrak{h}^*$. Let 
$\theta\in\mathfrak{h}^*$  the highest root, $\check{\theta}\in\mathfrak{h}$ the corresponding coroot and $X\in\mathfrak{g}$ a generator of the root space  $\mathfrak{g}_\theta$.

\begin{lemma}\label{lemma:}
If $\lambda\in\mathfrak{h}^*$ be the highest weight of $V$, then ${\mathbb H}_\ell (V)$ is zero unless $\lambda (\check{\theta})\le \ell$.
Assuming this inequality, then ${\mathbb H}_\ell (V)$ can be obtained as the quotient of $U\widehat{L\mathfrak{g}}$ by the left ideal generated by  $\mathfrak{g}\otimes_k\mathfrak{m}$, $c-\ell$ and $(Xf)^{1+\ell-\lambda (\check{\theta})}$, where we can take for $f$ any ${\mathcal O}$-generator of $F^{-1}\mathfrak{l}$. In fact, the image of $V$ in ${\mathbb H}_\ell (V)$ (which generates  ${\mathbb H}_\ell (V)$ as a 
$\widehat{L\mathfrak{g}}$-representation) is annihilated by all expressions of the form 
$Xf_N\circ\cdots\circ Xf_1$ with $f_k\in F^{-1}\mathfrak{l}$ and $N>\ell-\lambda (\check{\theta})$.
\end{lemma}
\begin{proof}
The first assertion is in the literature in the form of an Exercise (12.12 of \cite{kac}). As to the second statement: 
choose variables $u_1,\dots ,u_N$ and observe that $f_u:=f+\sum_k u_kf_k$ is an ${\mathcal O}$-generator of $F^{-1}\mathfrak{l}$ for generic $u$. So $V$ is killed by $(Xf_u)^N$ for generic $u$ and hence for all $u$.   By taking the coefficient of $u_1\cdots u_N$ (and using that the $Xf_k$'s commute with each other), we find that $Xf_N\circ\cdots\circ Xf_1$ annihilates $V$.
\end{proof}

Let us call the $k$-span of an $X$ as above  a \emph{highest root line}.
Since the Cartan subalgebras of $\mathfrak{g}$ are all conjugate under the adjoint representation, the same is true for 
the highest root lines.

\begin{definition}\label{def:level}
The \emph{level} of a finite dimensional  representation $V$ of $\mathfrak{g}$ is the smallest integer $\ell$ for which 
some (or equivalently, any) highest root line $\mathfrak{n}$  has the property that $\mathfrak{n}^{\ell +1}\subset U\mathfrak{g}$ kills $V$.
We denote it by $\ell (V)$.
\end{definition}

It is clear that in terms of the above root data, the set $P_\ell$ of equivalence 
classes of irreducible representations of level $\le \ell$ can be identified with the set of integral weights in a simplex, 
hence is finite. Notice  that  $P_\ell$  is invariant under dualization and more generally, under all outer 
automorphisms of  $\mathfrak{g}$. 

Returning to the general case in which $I$ need not be a singleton, we put
${\mathbb H}_\ell (V):=\otimes_{i\in I} {\mathbb H}_\ell (V_i)$. So this is zero unless every $V_i$ is of level $\le\ell$. Inspired by the physicists terminology,  
the $R$-module  ${\mathbb H}_\ell(V)_{A\mathfrak{g}}$ is called 
the space of \emph{covacua} attached to $A$. The following proposition says 
that it is of finite rank and describes  the WZW-connection.

\begin{proposition}[Finiteness]\label{prop:finiterank}
The space ${\mathbb H}_\ell (V)$ is finitely generated as a $U\! A\mathfrak{g}$-module
(so that ${\mathbb H}_\ell (V) _{A\mathfrak{g}}$ is a finitely generated $R$-module).
The Lie algebra $\hat\theta_R^A$ acts on ${\mathbb H}_\ell (V) _{A\mathfrak{g}}$
via the Sugawara representation with  
$c_0$ acting as multiplication by $\frac{\ell}{\ell+\check{h}}\dim\mathfrak{g}$. 
\end{proposition}
\begin{proof}
Choose a generator $t_i$ of $\mathfrak{m}_i$. The issue being local on $\spec (R)$, we may assume that after localizing $R$,
there exists a finite set 
$\Phi$ of \emph{negative} powers of these generators mapping to an $R$-basis set of $L/({\mathcal O} +A)$. 
The nilpotent elements of $\mathfrak{g}$ span a nontrivial subspace that is invariant under the adjoint action
and hence span all of $\mathfrak{g}$. Let $\Xi\subset\mathfrak{g}$ be a $k$-basis of $\mathfrak{g}$ consisting of nilpotent elements.
Then for a pair $(X,f)\in\Xi\times\Phi$, $Xf$ acts locally nilpotently in ${\mathbb H}_\ell(V)$ and so there exists
a positive integer $N$ such that the $N$th power of any such element kills the image of 
$\otimes_{i\in I} V_i$ in ${\mathbb H}_\ell(V)$.

A PBW type of argument then shows that ${\mathbb H}_\ell (V)$ is the sum of the subspaces
\[
A\mathfrak{g} \circ (X_rf_r)^{\circ n_r}\circ \cdots \circ  (X_1f_1)^{\circ n_1}\otimes(\otimes_{i\in I} V_i)\subset {\mathbb H}_\ell (V)
\]
with  $(X_i,f_i)\in\Xi\times \Phi$ pairwise distinct for $i=1,\dots ,r$, and  $n_1\ge \cdots \ge n_r\ge 0$. 
Since we get a nonzero element only when  $n_1<N$, we thus obtain a finite
collection of $R$-module generators of ${\mathbb H}_\ell (V)_{A\mathfrak{g}}$.
The remaining statements follow from \ref{prop:B}.
\end{proof}


\begin{remark}
We expect the $R$-module ${\mathbb H}_\ell (V) _{A\mathfrak{g}}$ to be flat as well and 
this to be a consequence of a related property for the $UA\mathfrak{g}$-module ${\mathbb H}_\ell (V)$. 
Such a result, or rather an algebraic proof of it, might simplify the argument 
in \cite{tuy} (see Section \ref{section:doublept}  for our version) which shows that the sheaf of covacua attached 
to a degenerating family of pointed curves is locally free.
\end{remark}

\begin{remark}
It is clear from the definition that a system of $\mathfrak{g}$-equivariant isomorphisms 
$(\phi_i:V_i\cong V'_i)_{i\in I}$  of finite dimensional irreducible representations induces an 
isomorphism $\phi_*: {\mathbb H}_\ell (V)_{A\mathfrak{g}}\cong {\mathbb H}_\ell (V')_{A\mathfrak{g}}$.  
By Schur's lemma, each $\phi_i$ is unique up to scalar in $k$ and hence the same is true for $\phi_*$. 
We may rigidify the situation by fixing in each representation $V_i$ and $V'_i$ involved  a highest weight 
orbit for the closed connected subgroup of linear transformations whose Lie algebra is the image of $\mathfrak{g}$: 
if we require that every $\phi_i$ respects these orbits, then $\phi_i$ is unique.  

We can also say something if we are given a  $\sigma\in \aut(\mathfrak{g})$. This turns every 
representation $V$ of $\mathfrak{g}$ into another one (denoted  ${}^\sigma\!V$) that has  the same underlying 
vector space $V$, by letting $X\in\mathfrak{g}$ act as $\sigma (X)$ on $V$. The extension $\hat\sigma$ of $\sigma$ to 
$\widehat{L\mathfrak{g}}$ does the same with ${\mathbb H}_\ell (V)$. It follows that we have an identification of $\widehat{L\mathfrak{g}}$-modules:
\begin{multline*}
Y_rf_r\circ\cdots \circ Y_1f_1 {}^\sigma\!\!\!\otimes(\otimes_{i\in I} v_i)\in{\mathbb H}_\ell ({}^\sigma\!V) \mapsto\\ 
\sigma(Y_r)f_r\circ\cdots \circ\sigma(Y_1)f_1\otimes(\otimes_{i\in I} v_i)\in {}^{\hat\sigma}\!{\mathbb H}_\ell (V).
\end{multline*}
Since $\sigma$ preserves $A\mathfrak{g}$, this descends to an identification 
${\mathbb H}_\ell (V^\sigma) _{A\mathfrak{g}}\cong{\mathbb H}_\ell (V)_{A\mathfrak{g}}$ of $R$-modules. It is clear from the definition  above  that
this is also equivariant for the Segal-Sugawara representation and hence is an isomorphism of 
$\hat\theta_R^A$-modules.
\end{remark}


\subsection*{Propagation principle} 
The following proposition is a bare version of what is known as the 
\emph{propagation of vacua}; it essentially shows that trivial representations
may be ignored (as long as some representations remain: if all are trivial, then
we can get rid of all but one of them). If we do not care
about the WZW-connection, then this is even true for nontrivial representations 
(a fact that can be found in Beauville \cite{beauville}) so that  
we then essentially reduce the discussion to the case where $I$ is a singleton.

\begin{proposition}\label{prop:singleton}
Let $J\subsetneq I$ be such that  $A$ maps onto $\oplus_{j\in J} L_j/{\mathcal O}_j$. Denote by  
$B\subset A$  the kernel of the map $A\to \oplus_{j\in J} L_j/\mathfrak{m}_j\cong R^J$ (evidently an ideal) so that we have a 
surjective Lie homomorphism  $B\mathfrak{g}\to(R\otimes_k\mathfrak{g})^{J}$ via 
which $B\mathfrak{g}$ acts on $R\otimes_k(\otimes_{j\in J} V_j)$. Then the map of $B\mathfrak{g}$-modules 
${\mathbb H} _\ell (V|I-J)\otimes_k(\otimes_{j\in J}V_j)\to {\mathbb H} _\ell (V)$
induces an isomorphism  on covariants:
\[\begin{CD}
\left({\mathbb H}_\ell (V|I-J)\otimes_k (\otimes_{j\in J}V_j)\right)_{B\mathfrak{g}}@>\cong>> 
{\mathbb H}_\ell (V)_{A\mathfrak{g}}.
\end{CD}\]
If $\theta^{A,B}_R\subset \theta_R^A$ denotes the module of $k$-derivations $R\to R$ that lift to 
$k$-derivations $A\to A$ which preserve $B$ (or equivalently,  $\oplus_{j\in J} \mathfrak{m}_j$),  and 
$\hat\theta^{A,B}_R\subset \hat\theta^{A}_R$ stands for the corresponding  extension, then  
the above isomorphism of covariants is compatible with the action of $\hat\theta^{A,B}_R$ on both sides, 
provided that the representations $V_j$ are trivial for $j\in J$.
\end{proposition}
\begin{proof} For the first assertion
it suffices to do the case when $J$ is a singleton $\{ o\}$. The hypotheses clearly imply  that 
${\mathbb H} _\ell (V|I-\{ o\})\otimes V_o\to {\mathbb H}_\ell (V)_{A\mathfrak{g}}$ is onto. 
The kernel is easily shown to be $B\mathfrak{g}({\mathbb H} _\ell (V|I-\{ o\})\otimes V_o)$. 

The second assertion follows in a straightforward manner from our definitions:
if $\bar D\in  \hat\theta^{A,B}_R$, then lift $\bar D$ to a $k$-derivation  $D: A\to A$ which preserves $B$. This implies that $D$ preserves each ${\mathcal O}_j$, $j\in J$. If we choose
a parameter $t_j$ for ${\mathcal O}_j$ so that ${\mathcal O}_j=R((t_j))$,  then $D$ takes in 
${\mathcal O}_j$ the form $D^{(j)}_{\rm hor}+D^{(j)}_{\rm vert}$, with $D^{(j)}_{\rm hor}$ the extension of $\bar D$ which kills $t_j$ and
$D^{(j)}_{\rm vert}=c^{(j)} \partial /\partial t_j$ plus higher order terms with $c^{(j)}\in R$. 
The Sugawara action
of $D^{(j)}_{\rm vert}$ on the subspace $V_j\subset {\mathbb H}_\ell (V_j)$  is up to a factor in $R$
given by $\sum_\kappa t_j^{-1}X_\kappa\circ X_\kappa$. But if $V_j$  is the trivial
representation, then this is evidently zero. The second assertion now follows.
\end{proof}

\begin{remark}
Our discussion of the genus zero case will  show that  the isomorphism
of covariants generally  fails to be compatible relative to the $\hat\theta^{A,B}_R$-action. 
\end{remark}

\begin{remark}
Proposition \ref{prop:singleton}
 is sometimes used in the opposite direction:
if $\mathfrak{m}_o\subset A$ is a principal ideal with the property that for a generator $t\in\mathfrak{m}_o$, 
the  $\mathfrak{m}_o$-adic completion of $A$ gets identified with $R((t))$, then let $\tilde I$ be the disjoint union of 
$I$ and  $\{ o\}$, $\tilde V$ the extension
of $V$ to  $\tilde I$ which assigns to $o$ the trivial representation and  $\tilde A:=A[t^{-1}]$. 
With $(\tilde I,\{o\})$ taking the role of $(I,J)$, we  then find that 
${\mathbb H} _\ell (V)_{A\mathfrak{g}}\cong {\mathbb H} _\ell (\tilde V)_{\tilde A\mathfrak{g}}$.
\end{remark}


\section{Bundles of covacua}\label{section:cfb}



\subsection*{Spaces of covacua in families}

We specialize the discussion of Section \ref{section:wzw} to a more concrete geometric situation. 
This leads us to sheafify many of the notions we
introduced earlier and  in such cases we shall modify our notation (or its meaning) accordingly. 
Suppose given a proper and  flat morphism between 
$k$-varieties $\pi :{\mathcal C}\to S$ whose base $S$ is smooth and connected and 
whose fibers are 
reduced connected curves that have complete intersection
singularities only (but we do not assume that ${\mathcal C}$ is smooth over $k$).  
Since the family is flat, the arithmetic genus of the fibers is locally constant,
hence constant, say equal to $g$.
We also suppose given disjoint sections $x_i$ of $\pi$, indexed by the 
finite nonempty set $I$  whose union $\cup_{i\in I} x_i(S)$ lies in the smooth part of ${\mathcal C}$ and meets every irreducible component of a 
fiber. The last condition ensures that if $j:{\mathcal C}^\circ:={\mathcal C}-\cup_{i\in I} 
x_i(S)\subset{\mathcal C}$ is the inclusion, then $\pi j$ is an affine morphism.  

We denote by $({\mathcal O}_i,\mathfrak{m}_i)$ the formal completion of ${\mathcal O}_{\mathcal C}$ along $x_i(S)$, by ${\mathcal L}_i$  the subsheaf of fractions of ${\mathcal O}_i$ with denominator a local generator of  $\mathfrak{m}_i$ and by ${\mathcal O}$, $\mathfrak{m}$ and ${\mathcal L}$  
the corresponding direct sums. But we keep on using $\omega$, $\theta$, $\hat\theta$ etc.\ for their 
sheafified counterparts.  So these are now all ${\mathcal O}_S$-modules and the residue pairing is also one of 
${\mathcal O}_S$-modules: $r: {\mathcal L}\times \omega\to{\mathcal O}_S$. 
We write ${\mathcal A}$ for $\pi_*j_*j^*{\mathcal O}_{{\mathcal C}}$ (a sheaf of ${\mathcal O}_S$-algebras that is also equal to 
the direct image of ${\mathcal O}_{{\mathcal C}^\circ}$ on $S$)
and often identify this with its image in ${\mathcal L}$. We denote by $\theta_{{\mathcal A}/S}$
the sheaf of ${\mathcal O}_S$-derivations ${\mathcal A}\to {\mathcal A}$ and by $\omega_{{\mathcal A}/S}$
for the sheaf $\pi_*j_*j^*\omega_{{\mathcal C}/S}$ (which is also the 
direct image on $S$ of  the relative dualizing sheaf of ${\mathcal C}^\circ/S$;  
if ${\mathcal C}^\circ$ is smooth, this is simply the sheaf of relative differentials). So  $\omega_{{\mathcal A}/S}$
is torsion free and embeds therefore  in $\omega$.

\begin{lemma}
The properties  $A_1$, $A_2$ and $A_3$ hold for the sheaf ${\mathcal A}$. Precisely,
\begin{enumerate}
\item[(${\mathcal A}_1$)] ${\mathcal A}$ is as a sheaf of ${\mathcal O}_S$-algebras flat and of finite type, 
\item[(${\mathcal A}_2$)] ${\mathcal A}\cap{\mathcal O}={\mathcal O}_S$ and $R^1\pi_*{\mathcal O}_{\mathcal C}={\mathcal L}/({\mathcal A}+{\mathcal O})$ is locally free of rank $g$,
\item[(${\mathcal A}_3$)] we have $\theta_{{\mathcal A}/S}=\Hom_{{\mathcal A}}(\omega_{{\mathcal A}/S},{\mathcal A})$ and $\omega_{{\mathcal A}/S}$ is the annihilator of ${\mathcal A}$ with respect to the residue pairing.
\end{enumerate}
\end{lemma} 
\begin{proof} Property ${\mathcal A}_1$ is clear. It is also clear that
${\mathcal O}_S=\pi_*{\mathcal O}_{{\mathcal C}}\to {\mathcal A}\cap {\mathcal O}$ is an isomorphism. 
The long exact sequence defined by the functor $\pi_*$ applied to 
the short exact sequence
\[
0\to {\mathcal O}_{\mathcal C}\to j_*j^*{\mathcal O}_{{\mathcal C}} \to {\mathcal L}/{\mathcal O}\to 0
\]
tells us that $R^1\pi_*{\mathcal O}_{\mathcal C}={\mathcal L}/({\mathcal A}+{\mathcal O})$; in particular,  
the latter is locally free of rank $g$. Hence ${\mathcal A}_2$ holds as well.

In order to verify ${\mathcal A}_3$, we note that
$\pi_*\omega_{{\mathcal C}/S}$ is the ${\mathcal O}_S$-dual of 
$R^1\pi_*{\mathcal O}_S$, and hence is locally free of rank $g$.
The first part of ${\mathcal A}_3$ follows from the corresponding local property
$\theta_{{\mathcal C}/S}=\Hom_{{\mathcal O}_{\mathcal C}}(\omega_{{\mathcal C}/S},{\mathcal O}_{\mathcal C})$  by applying
$\pi_*j^*$ to either side. This local property is known to hold for families
of curves with complete intersection singularities. (A proof 
under the assumption that ${\mathcal C}$ is smooth---which does not affect the
generality, since $\pi$ is locally the restriction of that case and both sides
are compatible with base change---runs as follows:
if $j':{\mathcal C}'\subset {\mathcal C}$ denotes the locus where $\pi$ is smooth, then
its complement is of codimension $\ge 2$ everywhere.
Clearly, $\theta_{{\mathcal C}/S}$ is the ${\mathcal O}_{{\mathcal C}}$-dual of 
$\omega_{{\mathcal C}/S}$ on ${\mathcal C}'$ and since both are inert under $j'_*j'{}^*$, 
they are equal everywhere.) 

The last assertion  essentially restates the well-known fact that
the polar part of a rational section of $\omega_{{\mathcal C}/S}$
must have zero residue sum, but can otherwise be arbitrary. More precisely, 
the image of $\omega_{{\mathcal A}/S}$ in $\omega/F^1\omega$ is the 
kernel of the residue map $\omega/F^1\omega\to {\mathcal O}_S$. 
The intersection $\omega_{{\mathcal A}/S}\cap F^1\omega$ is $\pi_*\omega_{{\mathcal C}/S}$ 
and is hence  locally free of rank $g$.
Since $(F^1\omega)^\perp={\mathcal O}$, it follows that 
$(\omega_{{\mathcal A}/S})^\perp\cap {\mathcal O}$ and ${\mathcal L}/((\omega_{{\mathcal A}/S})^\perp+{\mathcal O})$ 
are locally free of rank 1 and  $g$ respectively. Since ${\mathcal A}$ has these properties also 
and is contained in $(\omega_{{\mathcal A}/S})^\perp$, we must have 
${\mathcal A}=(\omega_{{\mathcal A}/S})^\perp$.
\end{proof}

For what follows one usually supposes 
that the fibers are stable $I$-pointed curves (meaning that  every fiber of $\pi j$
has  only ordinary double points as singularities and has finite 
automorphism group) and is versal (so that the discriminant $\Delta_\pi$ of 
$\pi$ is a reduced normal crossing divisor), but we shall not make these 
assumptions yet. Instead, we assume the considerable weaker property that 
the sections of the sheaf $\theta_S(\log \Delta_\pi)$ of vector fields on $S$ 
tangent to $\Delta_\pi$ lift locally on $S$ to vector fields on ${\mathcal C}$. 
(This is for instance the case  if ${\mathcal C}$ is smooth and $\pi$ is multi-transversal with respect 
to the (Thom) stratification of $\Hom (T{\mathcal C},\pi^*TS)$ by rank
\cite{looij:book}.) Notice that we have a restriction homomorphism
$\theta_S(\log \Delta_\pi)\otimes {\mathcal O}_{\Delta_\pi}\to \theta_{\Delta_\pi}$.

Let $\theta_{{\mathcal C}, S}\subset\theta_{\mathcal C}$ 
denote the sheaf of derivations which preserve $\pi^*{\mathcal O}_S$.
If we apply $\pi_*j_*j^*$ to the exact sequence 
$0\to\theta_{{\mathcal C}/S}\to\theta_{{\mathcal C}, S}\to 
\theta_{{\mathcal C}, S}/\theta_{{\mathcal C}/S}\to 0$ 
and use our liftability assumption and the fact that $\pi j$ is affine, we get the exact sequence
\[
0\to \theta_{{\mathcal A}}\to\theta_{{\mathcal A}, S}\to \theta_S(\log \Delta_\pi)\to 0.
\] 
We defined $\hat\theta_{{\mathcal A},S}$ as the preimage of  
$\theta_{{\mathcal A},S}$ in $\hat\theta_{{\mathcal L},S}$ and 
$\hat\theta_S(\log \Delta_\pi)$ as the quotient 
$\hat\theta_{{\mathcal L} ,S}/\theta_{\mathcal A}$. 
These extend $\theta_{{\mathcal A},S}$  and  
$\theta_S$ by $c_0 {\mathcal O}_S$. If we denote the \emph{Hodge bundle}
\[
\lambda:=\lambda({\mathcal C}/S):= \det (\pi_*\omega_{{\mathcal C}/S}),
\]
then we see that $\hat\theta_S(\log \Delta_\pi)$
may be identified with  the Lie sheaf ${\mathcal D}_1(\lambda)(\log \Delta_\pi)$ of first order differential operators
$\lambda\to\lambda$ which preserve the subsheaf of sections vanishing on $\Delta_\pi$.

Observe that ${\mathcal L}\mathfrak{g}=\mathfrak{g}\otimes_k{\mathcal L}$ is now a sheaf of 
Lie algebras over  ${\mathcal O}_S$. The same applies to $\hat\mathfrak{l}$ and so we have a Virasoro 
extension $\hat\theta_S$ of $\theta_S$ by $c_0{\mathcal O}_S$. We have also defined
${{\mathcal A}\mathfrak{g}}= \mathfrak{g}\otimes_k {\mathcal A}$, which is  a Lie subsheaf of 
${\mathcal L}\mathfrak{g}$ as well as of $\widehat{\Lcal\mathfrak{g}}$ and the Fock type $\widehat{\Lcal\mathfrak{g}}$-module
$\Fcal_\ell(\mathfrak{g})$. The will also consider the 
sheaf of ${{\mathcal A}\mathfrak{g}}$-covariants in the latter, 
\[
\Fcal_\ell(\mathfrak{g})_{{\mathcal C}/S} :=\Fcal_\ell(\mathfrak{g})_{{\mathcal A}\mathfrak{g}}= {{\mathcal A}\mathfrak{g}}\Fcal_\ell(\mathfrak{g})\backslash\Fcal_\ell(\mathfrak{g}).
\]
From Proposition \ref{prop:B} we get:


\begin{corollary}\label{cor:thetaaction}
The representation of the Lie algebra $\hat\theta_{{\mathcal A},S}$ on 
$\Fcal_\ell(\mathfrak{g})$ preserves  ${{\mathcal A}\mathfrak{g}}\Fcal_\ell(\mathfrak{g}) $
and acts on $\Fcal_\ell(\mathfrak{g}) _{{\mathcal C}/S}$  via $\hat\theta(\log \Delta_\pi)$  with $c_0$ acting as multiplication by 
$(\ell+\check{h})^{-1}\ell\dim\mathfrak{g}$. This construction has a base change property
along any smooth part $S'$ of the discriminant in the  sense
that the residual action of $\hat\theta(\log \Delta_\pi)$ on
$\Fcal_\ell(\mathfrak{g}) _{{\mathcal C}_{S'}/S'}\cong \Fcal_\ell(\mathfrak{g}) _{{\mathcal C}/S} \otimes{\mathcal O}_{S'}$ factors through 
$\hat\theta_{S'}$.
\end{corollary}

The bundle of integrable representations $\Hcal_\ell (V)$ over $S$ is 
defined in the expected manner: it is obtained as a quotient of 
$\Fcal_\ell(\mathfrak{g})$ in the way ${\mathbb H}_\ell (V)$ is obtained from $\FF_\ell(\widehat{L\mathfrak{g}})$.
We write $\Hcal_\ell(V)_{{\mathcal C}/S} $ for $\Hcal_\ell(V)_{{\mathcal A}\mathfrak{g}}$. 
The following theorem, which is  mostly a summary of what  we have done so far, is one of the main results of the theory. 

\begin{theorem}[WZW-connection]\label{thm:wzwconn}
The ${\mathcal O}_S$-module $\Hcal_\ell(V)_{{\mathcal C}/S} $ is of finite rank;  
it is also locally free over $S-\Delta_\pi$ and the Lie action of 
${\mathcal D}_1(\lambda)(\log \Delta_\pi)$  on  $\Hcal_\ell (V)_{{\mathcal C}/S} $ 
defines a logarithmic $\lambda$-flat connection relative to $\Delta_\pi$ of weight $\frac{\ell}{2(\ell +\check{h})}\dim\mathfrak{g}$. 
 The same base  change property holds along the smooth part of the  discriminant as 
in Corollary \ref{cor:thetaaction}.
Furthermore, any $\sigma\in\aut(\mathfrak{g})$ determines an isomorphism of ${\mathcal D}_1(\lambda)(\log \Delta_\pi)$-modules 
$\Hcal_\ell({}^\sigma\!V)_{{\mathcal C}/S} \cong \Hcal_\ell(V)_{{\mathcal C}/S} $. 
\end{theorem}  
\begin{proof}
The first assertion follows from \ref{prop:finiterank}. The action of $\hat\theta$ factors (locally) through 
${\mathcal D}_1(\sqrt{\lambda})(\log \Delta_\pi)$ for some square root $\sqrt{\lambda}$ of $\lambda$ and has then weight 
$(\ell+\check{h})^{-1}\ell\dim\mathfrak{g}$. This amounts to an action of ${\mathcal D}_1(\lambda)(\log \Delta_\pi)$ of half that weight. 
The last assertion follows from Corollary \ref{cor:derive}.
The rest is clear except perhaps the  local freeness of $\Hcal_\ell(V)_{{\mathcal C}/S} $ on $S-\Delta_\pi$. But this follows 
from the local existence of a connection in the ${\mathcal O}_S$-module $\Hcal_\ell(V)_{{{\mathcal C}}}$.      
\end{proof}

So if $\Lambda^\times\to S$ denotes the $\GG_m$-bundle  that is associated to $\lambda$, then
we have a flat connection on the pull-back of $\Hcal_\ell (V)_{{\mathcal C}/S}$ to 
$\Lambda^\times|S-\Delta_\pi$ with fiber monodromy scalar multiplication by a root of unity of order 
$\frac{\ell}{2(\ell +\check{h})}\dim\mathfrak{g}$.


\subsection*{Propagation principle continued} In the preceding subsection we made the 
assumption throughout that a union of sections of ${\mathcal C}\to S$ is given
to ensure that its complement is affine over $S$. However, the propagation principle
permits us to abandon that assumption. In fact, this leads us to let $\VV$ stand for any 
map which  assigns to every $S$-valued point $x$ of ${\mathcal C}$ an irreducible $\mathfrak{g}$-representation 
$\VV_x$ of level $\le \ell$, subject to the condition  that  its \emph{support}, 
$\supp (\VV)$ (i.e., the union of the $x(S)$ for which $\VV_x$  is generically not the trivial representation),  
is a trivial finite cover over $S$ and contained in the locus where $\pi: {\mathcal C}\to S$ is smooth. 
We then might write $\Hcal_\ell (\VV)$ for $\Hcal_\ell(\VV|_{\supp (\VV)})$, but  
since  ${\mathcal C}-\supp (\VV)$ need not be  affine over $S$, this does not yield the right notion of conformal block. 
We can find however, at least locally over $S$, additional pairwise disjoint sections 
of  ${\mathcal C}\to S$ so that the complement ${\mathcal C}^\circ$ of their support and that of $\VV$ 
is affine over $S$. Then we can form $\Hcal_\ell(\VV|{\mathcal C}-{\mathcal C}^\circ)$ and 
Proposition  \ref{prop:singleton}  shows that the resulting  bundle of covacua
$\Hcal_\ell(\VV|{\mathcal C}-{\mathcal C}^\circ)_{(\pi_*{\mathcal O}_{{\mathcal C}^\circ})\mathfrak{g}}$ with the 
projective connection is independent of the choices made.  This suggests that we let 
$\Hcal_\ell(\VV)$ resp.\  $\Hcal_\ell (\VV)_{{\mathcal C}/S} $
stand for the sheaf associated to the presheaf
\[
S\supset U\mapsto \varinjlim_{\tilde S} \Hcal_\ell(\VV|_{\tilde S}) \text{  resp.\  }
\varinjlim_{\tilde S} \Hcal_\ell(\VV|_{\tilde S})_{{\mathcal C} _U/U}, 
\]
where $\tilde S$ runs over the unions of pairwise disjoint sections as above.  The latter, when twisted with the dual of $\det ({\mathcal C}/S)$,  has, being 
a limit of presheaves with flat connections,  a flat connection as well. It is clear that in this set-up 
there is also no need anymore to insist 
that the fibers of $\pi$ be connected. 


\subsection*{The genus zero case and the KZ-connection}
We here assume $C$ to be isomorphic to ${\mathbb P}^1$. Let $x_1,\dots ,x_n\in C$ be distinct
and  contain $\supp (\VV)$.  Choose an affine  coordinate  $z$ on $C$ (which identifies $C$ with ${\mathbb P}^1$)
whose domain contains the $x_i$'s and write $z_i$ for $z(x_i)$. 
Notice that $t_\infty:=z^{-1}$ may serve as a parameter for the local field at  $z=\infty$. 
So if ${\mathbb H}_\ell(k)$ denotes the representation of $\widehat{\mathfrak{g}((z^{-1}))}$ attached to 
the trivial representation $k$ of $\widehat{\mathfrak{g}((z^{-1}))}$, then by the propagation principle \ref{prop:singleton} we have 
${\mathbb H}_\ell (\VV)_C=(V_1\otimes\cdots\otimes V_n\otimes {\mathbb H}_\ell(k))_{\mathfrak{g}[z]}$, 
where $\mathfrak{g}[z]$ acts on $V_i$ for $i\le n$ via its evaluation at $z_i$. 
According to \cite{kac}, the $\mathfrak{g}[z]$-homomorphism 
$U(\mathfrak{g}[z]) \to {\mathbb H}_\ell(k)$ is surjective and its kernel is the 
left ideal generated by $(zX)^{1+\ell}$,  where $X\in\mathfrak{g}$ generates a highest root line.
This implies that ${\mathbb H}_\ell (\VV)_{{\mathbb P}^1}$ can be identified with 
a quotient of the space of $\mathfrak{g}$-covariants 
$(V_1\otimes\cdots\otimes V_n)_{\mathfrak{g}}$, namely its biggest quotient 
on which  $(\sum_{i=1}^n z_iX^{(i)})^{1+\ell}$ acts trivially (where $X^{(i)}$ acts on
$V_i$ as $X$ and on the other tensor factors $V_j$, $j\not= i$, as the identity).
Now regard $z_1,\dots ,z_n$ as variables. Our first observation is that
a translation in $\CC$ does not affect ${\mathbb H}_\ell (\VV)_C$: if $a\in\CC$, then
the actions of $\sum_{i=1}^n (z_i+a)X^{(i)}$ and $\sum_{i=1}^n z_iX^{(i)}$ on
$V_1\otimes\cdots\otimes V_n$ differ the action of $aX\in\mathfrak{g}$. So we always arrange that $z_1+\cdots +z_n=0$.
Consider  in $\CC^n$ the hyperplane $S_{n-1}$ defined by $z_1+\cdots +z_n=0$ and  
denote by $S_{n-1}^\circ$ the open subset of pairwise distinct $n$-tuples. Then
the trivial family over $S_{n-1}^\circ$,  ${\mathcal C}:={\mathbb P}^1\times S_{n-1}^\circ$, comes with $n+1$ 
`tautological' sections (including the one at infinity) so that we also have defined
${\mathcal C}^\circ$. This determines a sheaf 
$\Hcal_\ell (\VV)_{{\mathcal C}/S_{n-1}^\circ}$ over $S_{n-1}^\circ$. According to the preceding, we have an exact sequence
\[
(V_1\otimes\cdots\otimes V_{n})_{\mathfrak{g}}\otimes_k{\mathcal O}_{S_{n-1}^\circ} \to 
(V_1\otimes\cdots\otimes V_{n})_{\mathfrak{g}}\otimes_k{\mathcal O}_S \to \Hcal_\ell (\VV)_{{\mathcal C}/S_{n-1}^\circ} \to 0,
\]
where the first map is given by $(\sum_{i=1}^n z_iX^{(i)})^{1+\ell}$.
We  identify  its WZW connection, or rather, a natural lift of that connection to
$V_1\otimes\cdots\otimes V_{n}\otimes_k{\mathcal O}_{S_{n-1}^\circ}$. 
In order to compute the covariant derivative with respect to the vector field 
$\partial_i:=\frac{\partial}{\partial z_i}$ on ${S_{n-1}^\circ}$, we follow our recipe and lift it
to $C\times {S_{n-1}^\circ}$ in the obvious way (with zero component along $C$). 
We continue to denote that lift by $\partial_i$ and determine its (Sugawara) action on  $\Hcal_\ell (\VV)$.
We first observe that $\partial_i$ is tangent to all the sections, except the $i$th. 
Near that section we decompose it as $(\frac{\partial}{\partial z}+\partial_i)-\frac{\partial}{\partial z}$, where the first term
is tangent to the $i$th section and the second term is vertical. 
The action of the former is easily understood: its lift to $V_1\otimes\cdots\otimes V_{n}\otimes_k{\mathcal O}_{S_{n-1}^\circ}$ 
acts as derivation with respect to $z_i$. The vertical term, $-\frac{\partial}{\partial z}$, acts via
the Sugawara representation, that is, it acts on the $i$th slot as 
$-\frac{1}{\ell +\check{h}}\sum_\kappa X_\kappa(z-z_i)^{-1}\circ X_\kappa$
and  as the identity on the others, in other words, acts as 
$-\frac{1}{\ell +\check{h}}\sum_\kappa X^{(i)}_\kappa(z-z_i)^{-1}\circ X^{(i)}_\kappa$.
This action does not induce one in 
$V_1\otimes\cdots\otimes V_{n}\otimes_k{\mathcal O}_{S_{n-1}^\circ}$. 
To make it so, we add to this the action by an element of $\mathfrak{g}[{\mathcal C}^\circ]U\widehat{\Lcal\mathfrak{g}}$ 
(which of course will act trivially in $\Hcal_\ell (\VV)_{{\mathcal C}/S_{n-1}^\circ} $), namely 
\[
\frac{1}{\ell +\check{h}}\sum_\kappa X_\kappa (z-z_i)^{-1}\circ X^{(i)}_\kappa 
=\frac{1}{\ell +\check{h}}\sum_{j,\kappa} \frac{1}{z-z_i}X_\kappa^{(j)}\circ X_\kappa^{(i)}.
\]
Doing this for every $i$, then the modification acts in $V_1\otimes\cdots\otimes V_{n}\otimes_k{\mathcal O}_{S_{n-1}^\circ}$ as 
\[
\frac{1}{\ell+\check{h}}\sum_{j\not=i} \frac{1}{z_j-z_i}X_\kappa^{(j)}X_\kappa^{(i)}.
\]
Let us regard the Casimir element $c$ as an element  of $\mathfrak{g}\otimes_k\mathfrak{g}$, 
and denote by $c^{(i,j)}$ its action in $V_1\otimes\cdots\otimes V_{n}$ on the $i$th and 
$j$th factor (since $c$ is symmetric, we have $c^{(i,j)}=c^{(j,i)}$, so  that we need not worry about the order here).
We conclude that the WZW-connection is induced by the connection
on $V_1\otimes\cdots\otimes V_{n}\otimes_k{\mathcal O}_{S_{n-1}^\circ}$ whose connection form is
\[
\frac{1}{\ell+\check{h}}\sum_{i=1}^n \sum_{j\not=i} \frac{dz_i}{z_j-z_i}c^{(i,j)}=
-\frac{1}{\ell+\check{h}}\sum_{1\le i<j\le n} \frac{d(z_i-z_j)}{z_i-z_j}c^{(i,j)}.
\]
It commutes with the Lie action of  $\mathfrak{g}$ on $V_1\otimes\cdots\otimes V_{n}$ and so the connection passes to one on 
$(V_1\otimes\cdots\otimes V_{n})_\mathfrak{g} \otimes_k{\mathcal O}_{S_{n-1}^\circ}$.
This lift of the WZW-connection  is known as the \emph{Knizhnik-Zamolodchikov connection}. 
It is not difficult to verify that it is flat (see for instance \cite{kohno}), so that we have not just a projectively flat 
connection, but a genuine one.

\begin{proposition}\label{prop:buildingblocks}
The map 
$(V_1\otimes\cdots\otimes V_{n})_\mathfrak{g}\otimes_k{\mathcal O}_{S_{n-1}^\circ}\to \Hcal_\ell(\VV)_{{\mathcal C}/S_{n-1}^\circ}$ 
is an isomorphism for $n=1,2$. Hence for $n=1$ (resp.\ $n=2$),  $\Hcal_\ell(\VV)_{{\mathcal C}/S_{n-1}^\circ}$ is zero unless 
$V_0$ is the trivial representation (resp.\ $V_0$ and $V_1$ are each others dual), in which case 
it can be identified with ${\mathcal O}_{S_{n-1}^\circ}$.
\end{proposition}
\begin{proof}
For $n=1$ this is clear. For $n=2$, the stalk of $\Hcal_\ell(\VV)_{{\mathcal C}/S_{1}^\circ}$  at $(z,-z)$, 
$z\not=0$, can be identified with the image in $(V_1\otimes V_2)_\mathfrak{g}$ of the kernel of 
$(zX^{(1)}-zX^{(2)})^{1+\ell}$ acting in 
$V_1\otimes V_2$. Since $X^{(1)}+X^{(2)}$ is zero in $(V_1\otimes V_2)_\mathfrak{g}$
and $(X^{(1)})^{1+\ell}$ is zero in $V_1$, this  $(V_1\otimes V_2)_\mathfrak{g}$.
\end{proof}

\begin{remark}\label{rem:3holes}
A $3$-pointed genus zero curve $(C\cong{\mathbb P}^1; x_1,x_2,x_3)$ has no moduli, and so we expect  in this case an  
identification of ${\mathbb H}_\ell (\VV)_C$ also. Indeed, as is shown in \cite{beauville}, if $V_1,V_2, V_3$ are the associated irreducible $\mathfrak{g}$-representations of level $\le \ell$, then ${\mathbb H}_\ell (\VV)_C$ is naturally identified with the biggest quotient of $V_1\otimes V_2\otimes V_3$ on which both $\mathfrak{g}$ and the endomorphisms 
$(z_1X^{(1)}+z_2 X^{(2)}+z_3 X^{(3)})^{1+\ell}$ act trivially for \emph{all} values of $(z_1,z_2,z_3)$. This last  condition is of course equivalent to requiring that $X^p\otimes X^q\otimes X^r$ induces the zero map  whenever $p+q+r>\ell$.
\end{remark}

 


\section{Factorization}\label{section:doublept}

In this section we consider the case when we are given a family $\pi_o :{\mathcal C}_o\to S_o$ of pointed curves of genus $g$  
with a smooth base germ $S_o=\spec(R_o)$ (so $R_o$ is a regular local ring) and for which 
we are given a section $x_0$ along which $\pi_o$ has an ordinary double point. We
assume that the fibers have no other singularities, in other words, that $\pi_o$ is smooth outside $x_0$.
After possibly making an \'etale base change of degree two we find a partial  normalization 
$\nu: \tilde{\mathcal C}_o\to{\mathcal C}_o$ which separates the branches in the (strong) sense
that $\nu$ is an isomorphism over the complement of $x_0(S_o)$ 
and $x_0$ has two disjoint lifts  to ${\mathcal C}_o$ (which we shall denote by $x_+$ and $x_-$). 
In what follows we simply assume this to be already the case. There are two basic cases:
the \emph{nonseparating case}, where $\tilde{\mathcal C}_o/S_o$ is connected---in that case the fibers have  genus 
$g-1$---and the \emph{separating case}, where $x_+$ and $x_-$ take values in different components 
$\tilde{\mathcal C}_\pm$ of $\tilde C_o$ such that the fiber genera $g_\pm$ of $\tilde C_\pm/S_o$ add up to $g$.
Since the natural base of the WZW-connection is the $\GG_m$-bundle defined by a determinant bundle
(or a fractional power thereof), let us first recall what we get in the present case. The bundle of which 
we take the determinant is the direct image of the relative dualizing sheaf 
$\pi_{o*}\omega_{{\mathcal C}_o/S_o}$. This bundle contains the direct image of $\omega_{\tilde{\mathcal C}_o/S_o}$ 
and the two differ only at $x_o$: an element of   
$\omega_{\tilde{\mathcal C}_o/S_o,x_o}$ when pulled back under $\nu$ may have a simple pole at $x_+$ and 
$x_-$ whose residues add up to zero. So we have a natural exact sequence
\[
0\to \nu_*\omega_{\tilde {\mathcal C}_o/S_o}\to \omega_{{\mathcal C}_o/S_o}\to {\mathcal O}_{S_o}\to 0,
\]
where the last map is defined by taking the residue at $x_+$. If we take the direct image under $\pi_o$, 
we see that we have a natural injection $(\pi_o\nu)_*\omega_{\tilde {\mathcal C}_o/S_o}\to \pi_{o*}\omega_{{\mathcal C}_o/S_o}$. 
It is in fact an isomorphism in the separating case, whereas it has a cokernel naturally isomorphic to 
$R_o$ in the nonseparating case. So after taking determinants we get in either case that 
$\lambda({\mathcal C}_o/S_o)= \lambda(\tilde{\mathcal C}_o/S_o)$, where it
is understood that in the separating case the right hand side equals $\lambda(\tilde{\mathcal C}_+/S_o)\otimes\lambda(\tilde{\mathcal C}_-/S_o)$.  


We now also assume given a representation valued map $\VV_o$ on the smooth part of 
${\mathcal C}_o$ whose support is contained in a finite union of sections $S_o$ so that  we have defined  
$\Hcal_\ell (\VV_o)_{{\mathcal C}_o/S_o}$. 
A coarse version of the \emph{factorization principle} expresses  this $R_o$-module in  terms of 
a space of covacua attached to the normalization $\tilde{\mathcal C}_o/S_o$. The  more refined
form  describes it as a residue of a module of covacua on a smoothing of $\pi_o$ and takes into account 
the flat connection.




Throughout this section $\Sigma_o\subset {\mathcal C}_o$ is a finite union of sections of ${\mathcal C}_o/S_o$ contained in the smooth part of ${\mathcal C}_o$, 
which contains the support of $\VV_o$ and has the additional property that
its complement ${\mathcal C}^\circ_o:= {\mathcal C}_o-\Sigma_o$ is affine over $S_o$ (this can always be arranged 
by adding some `dummy' sections to the support of $\VV_o$).  We often identify $\Sigma_o$  with its preimage
in $\tilde{\mathcal C}_o$.  Notice that $\tilde{\mathcal C}^\circ_o:=\nu^{-1}{\mathcal C}^\circ_o=\tilde{\mathcal C}_o-\Sigma_o$ is also 
affine over $S_o$, being the normalization of an affine $S_o$-scheme. 
We write $A_o$ resp.\  $\tilde A_o$ for their (coordinate) $R_o$-algebras.

\subsection*{Coarse version of the factorization property} 

Recall that $P_\ell$ denotes 
the set of isomorphism classes of irreducible representations of  $\mathfrak{g}$
of level $\le \ell$ and is invariant under dualization: if 
$\mu\in P_\ell$, then $\mu^*\in P_\ell$. 
Let  $V_\mu$  be a $\mathfrak{g}$-representation in the equivalence class 
$\mu\in P_\ell$ and choose  $\mathfrak{g}$-equivariant dualities 
\[
b_\mu:V_\mu\otimes V_{\mu^*}\to k,
\]
where we assume that $b_{\mu^*}$ is the transpose of $b_\mu$.
Its transpose inverse $\check{b}_\mu\in V_\mu\otimes V_{\mu^*}$ then 
spans the line of $\mathfrak{g}$-invariants in $V_\mu\otimes V_{\mu^*}$.

 
\begin{proposition}\label{prop:fact}
Let $\tilde \VV_{\mu,\mu^*}$  be the representation valued map on $\tilde{\mathcal C}_o$ which is constant equal to 
$V_\mu$ resp.\ $V_{\mu^*}$ on $x_+$  resp.\ $x_-$ and is elsewhere equal to $\VV_o$ 
(via the obvious identification defined by $\nu$). Then the contractions 
$b_\mu:V_\mu\otimes V_{\mu^*}\to k$ define an isomorphism
\[
\begin{CD}
\oplus_{\mu\in P_\ell} {\mathbb H}_\ell (\tilde \VV_{\mu,\mu^*})_{\tilde {\mathcal C}_o/S_o}
@>\cong>>{\mathbb H}_\ell (\VV_o)_{{\mathcal C}_o/S_o} .
\end{CD}
\]
\end{proposition}

This is almost a formal consequence of:

\begin{lemma}\label{lemma:bilevel}
Let $M$ be a finite dimensional representation of $\mathfrak{g}\times\mathfrak{g}$
which is  of level $\le \ell$ relative to both factors. If $M^\delta$ denotes 
that same space viewed as $\mathfrak{g}$-module with respect to the 
diagonal embedding $\delta: \mathfrak{g}\to\mathfrak{g}\times\mathfrak{g}$, then the 
contraction $\oplus _{\mu\in P_\ell} M\otimes (V_\mu\boxtimes V_\mu^*)\to M$ 
that on each summand is defined  by $b_\mu$ (the symbol $\boxtimes$ 
stands for the exterior tensor product of representations) 
induces an isomorphism between  covariants: 
\[
\begin{CD}
\oplus _{\mu\in P_\ell} \left(M\otimes (V_\mu\boxtimes 
V_\mu^*)\right)_{\mathfrak{g}\times\mathfrak{g}}@>\cong>> M^\delta_\mathfrak{g}.
\end{CD}
\]
\end{lemma}
\begin{proof}
Without loss of generality we may assume that $M$ is irreducible, or more precisely, 
equal to  $V_\lambda\boxtimes V_{\lambda'}$ for some $\lambda,\lambda'\in P_\ell$.
Then $M^\delta=V_\lambda\otimes V_{\lambda'}$. By Schur's lemma, $M^\delta_\mathfrak{g}$ is one-dimensional  if 
$\lambda'=\lambda^*$ and trivial otherwise. That same lemma applied
to $\mathfrak{g}\times\mathfrak{g}$ shows that 
$(M\otimes (V_\mu\boxtimes V^*_{\mu}))_{\mathfrak{g}\times\mathfrak{g}}$  
is zero unless $(\lambda,\lambda')=(\mu^*,\mu)$, in which case it is one-dimensional and maps isomorphically to
$M^\delta$.
\end{proof}


\begin{proof}[Proof of \ref{prop:fact}]   Evaluation in $x_0$ resp.\ 
$x_+,x_-$ define epimorphisms $A_o\to R_o$ resp.\ $\tilde A_o\to R_o\oplus R_o$ whose kernels may be 
identified by means  of $\nu$. We denote that common kernel by $\Ical$ and by $B$ the algebra of regular 
functions on the smooth part of ${\mathcal C}^\circ_o$. This is also the algebra of regular functions on the 
complement of the two sections $x_\pm$ 
$\tilde {\mathcal C}^\circ_o$. If $\Ical\mathfrak{g}$ has the evident 
meaning, then the argument used to prove Proposition \ref{prop:finiterank} 
shows that $M:={\mathbb H}_\ell (\VV_o|\Sigma_o)_{\Ical\mathfrak{g}}$ is an $R_o$-module of finite rank. 
It underlies a representation of 
$\mathfrak{g}\times \mathfrak{g}$ of level $\le \ell$ relative to both factors and is such that 
$M^\delta_\mathfrak{g}={\mathbb H}_{\ell}(\VV_o)_{A_o\mathfrak{g}} =\Hcal _\ell (\VV_o)_{{\mathcal C}_o/S_o} $. The assertion now follows from
Lemma \ref{lemma:bilevel} and the argument used for the propagation principle which shows that  
$(M\otimes (V_\mu\boxtimes 
V_\mu^*))_{R_o\mathfrak{g}\times R_o\mathfrak{g}}={\mathbb H} (\tilde \VV_{\mu, \mu^*})_{B\mathfrak{g}}=
\Hcal _\ell (\tilde \VV_{\mu,\mu^*})_{\tilde {\mathcal C}_o/S_o}$.
\end{proof}

\subsection*{A smoothing construction}
In order to motivate the algebraic discussion that will follow, we choose generators 
$t_{\pm}$ of the  ideals of the completed local $R_o$-algebras of $\tilde{\mathcal C}_o$ at  $x_{\pm}$ and explain 
how they determine a \emph{smoothing} of ${\mathcal C}_o/S_o$, that is, a way of making 
${\mathcal C}_o$ the restriction over $S_o\times \{ o\}$ of a flat morphism ${\mathcal C}\to S$, with 
$S:= S_o\times_k\Delta$  (the spectrum of  $R:=R_o[[\tau]]$) which is smooth over $S-S_o$. 
The construction goes as follows:
 in the product $\tilde {\mathcal C}_o\times \Delta$, blow up 
$x_{\pm}\times\{o\}$ and let $\tilde{\mathcal C}$ be the formal neighborhood of the strict transform of $\tilde {\mathcal C}_o\times\{ o\}$. 
So at the preimage of  $x_{\pm}\times\{o\}$ we have on the strict transform of 
$\tilde {\mathcal C}\times\{ o\}$ the formal  $S_o$-chart $(t_{\pm}, \tau/t_{\pm})$. Now let ${\mathcal C}$ be the quotient of 
$\tilde{\mathcal C}$ obtained by identifying these formal $S_o$-charts up to order: 
$(t_+, \tau/t_+)=(\tau/t_{-},t_-)$, so that $(s_+,s_-):=(t_+,t_-)$ is now a formal $S_o$-chart  of ${\mathcal C}$ on which we have 
$\tau=s_+s_-$ (in either domain  $\tau$ represents the same regular function).  We thus have defined a flat morphism 
${\mathcal C}\to S_o\times\Delta=S$ (with $\tau$ as second component) with the stated properties.  

\begin{remark}\label{rem:dehntwist}
If we were to work in the complex  analytic category, then we could take for $\Delta$ the complex unit disk.  The fiber of 
${\mathcal C}/S$ over $(s,\tau)\in S_o\times\Delta$ is then obtained by removing from $C_s$ the union of the two 
disks defined by $|t_{\pm}|\le |\tau|$, followed by identification of the two closed  annuli 
$|\tau|< |t_{\pm}|< 1$ by imposing the identity $t_+t_-=\tau$. 

With a view toward a later application---namely, of extracting a topological quantum 
field theory from the WZW model---we note that there is even a limit if $\tau$ tends to zero if we 
keep its argument fixed. To see this, let us first observe that for $|\tau|<{\tfrac{1}{2}}$, the fiber is also obtained 
by removal  of the union of the two open disks defined by $|t_{\pm}|< \sqrt{|\tau/2|}$, followed by the above identification of the two closed  annuli  $\sqrt{|\tau/2|}\le  |t_{\pm}|\le \sqrt{|2\tau|}$. Now do a real oriented blow up 
$\hat C_s\to \tilde C_s$ 
of the points $x_\pm (s)\in\tilde C_s$. This means that the polar coordinates associated to $t_\pm$ 
are to be viewed as coordinates for the preimage of its domain on $\hat C_s$: $t_\pm=r_\pm\zeta_\pm$ 
with $|\zeta_\pm|=1$ and $r_\pm\ge 0$  such that the exceptional set $\partial\hat C_s$ is defined by $r_\pm=0$. Notice that $\partial\hat C_s$ is indeed the boundary of a surface; it has two components, each of which comes with a natural principal $U(1)$-action.
If we write $\tau=\varepsilon \zeta$ accordingly with $|\zeta|=1$ 
and $\varepsilon>0$,  then for  $\sqrt{\varepsilon/2}\le r_{\pm} \le \sqrt{2\varepsilon}$, $(r_+,\zeta_+)$ 
must be identified with $(r_-,\zeta_-)$ precisely when $r_+r_-=\varepsilon$ and $\zeta_+\zeta_-=\zeta$. 
This has indeed a continuous extension over $\varepsilon=0$, for then we just identify the two boundary 
circles corresponding to $r_\pm=0$  by insisting that $\zeta_+\zeta_-=\zeta$. We thus obtain a  family 
$\hat{\mathcal C}\to\hat \Delta$ over the real oriented blow up $\hat \Delta\to \Delta$ of $\Delta$ at its origin 
and whose fibers over $\partial\hat\Delta$ are as just described. The  dependence of 
$\hat{\mathcal C} |\partial\hat\Delta$  is a priori on the coordinates $t_\pm$, but it is clear from the construction this 
dependence is in fact only via the (real) ray in $T_{x_+}\hat C_s\otimes T_{x_-}\hat C_s$ defined by 
$\frac{\partial}{\partial t_+}\big |_{x_+}\otimes_\CC\frac{\partial}{\partial t_-}\big |_{x_-}$. The fibers of this family just differ 
by the way we identified the boundary circles and we thus see that the monodromy of the family is a positive Dehn twist 
defined by the welding circle. For later use we note that this construction  takes place in the $C^1$-category: 
$\hat{\mathcal C}$ has a natural $C^1$-structure such that the projection to $\hat\Delta$ is $C^1$. 
 

We should perhaps add that this  has an algebro-geometric incarnation in terms of log structures
and that  $T_{x_+}\tilde C_s\otimes T_{x_-}\tilde C_s$ can be understood as the tangent space of the  
semi-universal deformation of the singular germ $(C_s, x(s))$ (equivalently, our data define a smooth point of the boundary divisor 
of some moduli stack $\overline{\text{M}}_{g,n}$ and $T_{x_+}\tilde C_s\otimes T_{x_-}\tilde C_s$ can be identified 
with its normal space). 
\end{remark}

We will denote by $\Sigma$ the image of $\Sigma_o\times\Delta$ in both ${\mathcal C}$ and $\tilde{\mathcal C}$. In either case
it is a union of sections over $S$. The representation valued map $\VV_o$ on ${\mathcal C}_o$ is 
extended to ${\mathcal C}$ in the obvious way (so that its support is contained in $\Sigma$) and we  
denote this extension by $\VV$. We let $A$ stand for $R$-algebra of regular functions on ${\mathcal C}^o:={\mathcal C}-\Sigma$. Notice  
that $A_o= A/(\tau A)$ and that $A$ embeds in $\tilde A_o[[\tau]]$.


\subsection*{The glueing tensor}
Suppose that in the regular local algebra $R$ we are  given a subalgebra $R_o$ and an element $\tau$ in the  
maximal ideal of $R$ such that $R= R_o[[\tau]]$.  Let $L_+$ and $L_-$ be $R$-algebras, both isomorphic to $R((t))$.  
The `ideal' in $L_\pm$ corresponding to $ tR[[t]]$ is denoted by $\mathfrak{m}_\pm$. Let $L:=L_+\oplus L_-$ the direct sum as 
$R$-algebras. We assume given a closed $R$-subalgebra ${\mathcal O}_0\subset L$ with the property that it can 
be topologically generated as a $R_o$-algebra by two generators $s_+, s_-$ of the following type: there exist  
generators $t_\pm$ of $\mathfrak{m}_\pm$ such that $s_+=(t_+,\tau/t_-)$ and $s_-=(\tau/t_+,t_-)$.  So an element of 
${\mathcal O}_0$ will then have the form
\begin{multline*}
\sum_{m\ge 0,n\ge 0}a_{m,n}s_+^m s_-^n= \sum_{m\ge 0,n\ge 0}a_{m,n}(t_+^{m-n}\tau^n,t_-^{n-m}\tau^m)=\\=
\sum_{k\ge 0} \Big(\sum_{m\ge 0} a_{m,k}t_+^{m-k}, \sum_{n\ge 0} a_{k,n}t_-^{n-k}\Big)\tau^k=\\=
\sum_{n>m\ge 0} a_{n,m}\tau^n s_+^{m-n}+\sum_{m\ge 0} a_{m,m}\tau^m+\sum_{m>n\ge 0} a_{n,m}\tau^ms_-^{n-m},
\end{multline*}
with $a_{n,m}\in R_o$. Clearly, the coefficients $a_{m,n}$ can be arbitrary in $R_o$ and the element in question is 
zero only when all $a_{m,n}$ are. So ${\mathcal O}_0$ is a copy of $R_o[[s_+,s_-]]$. 
The last identity shows that ${\mathcal O}_0$ is contained in the $R$-submodule generated by nonpositive powers of 
$s_+$ and $s_-$. A similar argument yields 
the following lemma and so the proof is left as an exercise.

\begin{lemma}\label{lemma:expansion}
Any  continuous $R_o$-derivation of ${\mathcal O}_0$  which preserves $\tau\in{\mathcal O}_0$
extends uniquely to one of $L$. If we let $D^\pm_{k}$ stand for $t_\pm ^{k+1}\frac{\partial}{\partial t_\pm}$, 
then it has there the form
\[
(D^+_{0}, 0) +\sum_{k\ge 0} \tau^k\Big(\sum_{m\ge 0} a_{m,k}D^+_{m-k},
\sum_{n\ge 0} a_{k,n}D^-_{n-k}\Big),
\]
with $a_{m,n}\in R_o$.
\end{lemma}

We have defined $L\mathfrak{g}$ and its central extension $\widehat{L\mathfrak{g}}$. For $\mu\in P_\ell$,
let ${\mathbb H}^{\pm}_\ell(V_\mu)$ denote the 
representation attached to $V_\mu$ of the central extension $\widehat{L_\pm\mathfrak{g}}$
of $L_\pm\mathfrak{g}$, so that  the $R$-module
${\mathbb H}^+_\ell(V_\mu)\otimes_R {\mathbb H}^-_\ell(V_{\mu^*})$
is one of $\widehat{L\mathfrak{g}}$. These representations are defined over
$R_o$ (over $k$ even) and so arise from a base change: 
${\mathbb H}^\pm_\ell(V_\mu)=R\otimes_{R_o}{\mathbb H}^\pm_{o,\ell}(V_\mu)$ and likewise for their tensor product. 
The Casimir element $c$ acts in 
$V_\mu$ as a scalar, a scalar we shall denote by 
$c_\mu$. Observe that $c_{\mu^*}=c_\mu$. Its value is best expressed (and computed) in terms of a
Cartan subalgebra $\mathfrak{h}\subset \mathfrak{g}$ and a system of positive roots relative to $\mathfrak{h}$: if we  
identify $\mu$ with its highest weight in $\mathfrak{h}^*$, then 
\[
c_\mu=c(\mu , \mu+2\rho),
\]
where $\rho$ has the customary meaning as the half the sum  of the positive roots. In particular,  $c_\mu$ is a positive rational number (the denominator is in fact at most 3). 

\begin{lemma}\label{lemma:invariant}
There exists a series $\varepsilon^\mu=\sum_{d=0}^\infty \varepsilon^\mu_d\tau^d\in {\mathbb H}^+_\ell(V_\mu)\otimes_{R_o} 
{\mathbb H}^-_\ell(V_{\mu^*})[[\tau]]$ (the \emph{glueing tensor}) with constant term 
$\varepsilon^\mu_0=\check{b}_\mu$ that
is annihilated by the image of ${\mathcal O}_0\mathfrak{g}$ in $\widehat{L\mathfrak{g}}$.  Moreover, any continuous $R$-derivation 
$D$ of ${\mathcal O}_0$ which preserves $\tau$ determines a $\hat D\in\hat \theta$ (relative to the Fock 
construction on the $R$-algebra $L$) with the property that  $\varepsilon^\mu$ is an eigenvector
of $T_\mathfrak{g}(\hat D)$ with eigenvalue $-\frac{c_\mu}{2(\ell+\check{h})}$.
\end{lemma}
\begin{proof}
We first observe the generators $t_\pm$ of $\mathfrak{m}_\pm$ define 
a grading on all the relevant objects on which we have defined the associated
filtration $F$
(e.g., the degree zero summand of   ${\mathbb H}_\ell (V_\mu)$ is $R\otimes_kV_\mu$). It is known 
(\cite{kac}, \S\ 9.4) that the  pairing $b_\mu: V_\mu\times V_{\mu^*}\to k$ extends (in fact, in 
a unique manner) to a perfect $R$-pairing
\[
b_\mu : {\mathbb H}^+_{\ell}(V_\mu)\times
{\mathbb H}^-_{\ell}(V_{\mu^*})\to R
\]
with the property that 
$b_\mu(Xt_+^n u,u')+b_\mu(u,Xt_-^{-n} u')=0$ for all $X\in\mathfrak{g}$ 
and $n\in\ZZ$. This formula implies that the restriction of
$b_\mu$ to  
${\mathbb H}^+_\ell(V_\mu)_{-d}\times {\mathbb H}^-_\ell(V_{\mu^*})_{-d'}$ is zero 
when $d\not= d'$ and is perfect when $d=d'$.  So if $\varepsilon^\mu_d\in
{\mathbb H}^+_\ell(V_\mu)_{-d}\otimes {\mathbb H}^-_\ell(V_{\mu^*})_{-d}$ denotes the latter's transpose inverse, 
then we have for all $n\in\ZZ$, $X\in\mathfrak{g}$ the following identity in
${\mathbb H}^+_\ell(V_\mu)_d\times {\mathbb H}^-_\ell(V_{\mu^*})_{-d-n}$:
\[
(Xt_+^n\otimes 1)\varepsilon^\mu_{d+n} +(1\otimes Xt_-^{-n})\varepsilon^\mu_{d}=0.
\]
This just says that $(Xt_+^n\otimes 1)+\tau^n(1\otimes Xt_-^{-n})$ kills 
$\varepsilon^\mu:=\sum_{d\ge 0} \varepsilon^\mu_d\tau^d$. Since  $s_+^n=(t_+^n, \tau^nt_-^{-n})$,  this 
amounts to  saying that  $Xs_+^n\in {\mathcal O}_0\mathfrak{g}\subset\widehat{L\mathfrak{g}}$ kills $\varepsilon^\mu$. 
Likewise for $Xs_-^n$. Since  any element of ${\mathcal O}_0$ lies in the $R$-submodule generated by the 
nonpositive powers of $s_+$ and $s_-$, it follows that $\varepsilon^\mu$ is killed by all of 
${\mathcal O}_0\mathfrak{g}$.

The second statement is proved by a direct computation. If we use Lemma \ref{lemma:expansion} to 
write  $D$ as an operator in $L$, then we find that it suffices to prove: 
 \begin{enumerate}
\item[(i)] $\tau^nT_\mathfrak{g}(\hat D^+_{m-n})
-\tau^mT_\mathfrak{g}(\hat D^-_{n-m})$ kills $\varepsilon^\mu$ for all $m,n\ge 0$, and
\item[(ii)] $T_\mathfrak{g} (\hat D^+_{0})(\varepsilon^\mu)=
-\frac{c_\mu}{2(\ell+\check{h})}\varepsilon^\mu$.
 \end{enumerate} 
As to (i), if we substitute 
\[
T_\mathfrak{g}(\hat D^+_{m-n})=-\frac{1}{2(\ell+\check{h})}
\sum_{j\in\ZZ}\sum_\kappa :X_\kappa t_+^{m-n-j}\circ X_\kappa t_+^j:
\]
and do likewise
for $T_\mathfrak{g}(\hat D^-_{n-m})$, then this assertion follows easily. 

For (ii) we first observe that $T_\mathfrak{g} (\hat D^+_{0})$ 
preserves the grading of
${\mathbb H}^+_\ell(V_\mu)$ and acts on ${\mathbb H}^+_\ell(V_\mu)_0=R\otimes_kV_{\mu}$ as 
$-(2\ell+2\check{h})^{-1}\sum_\kappa X_\kappa\circ X_\kappa$. This is just 
multiplication by $-\frac{c_\mu}{2(\ell+\check{h})}$. 
For an element $u\in {\mathbb H}^+_\ell(V_\mu)_{-d}$ of the form
$u=Y_rt_+^{-k_r}\circ\cdots\circ Y_1t_+^{-k_1}\circ v$ with $v\in V_\mu$, and 
$Y_\rho\in \mathfrak{g}$ (so that $d=k_r+\cdots +k_1$), we have 
\[
T_\mathfrak{g} (\hat D^+_{0})(u)=-du+Y_rt_+^{-k_r}\circ\cdots\circ Y_1t_+^{-k_1}\circ
T_\mathfrak{g} (\hat D^+_{0})(v)=(-d-\frac{c_\mu}{2(\ell+\check{h})})u.
\]
Since $D^+_{0}(\tau^d)=d\tau^d$, it follows that $\varepsilon^\mu_d\tau^d$ is an eigenvector
of  $T_\mathfrak{g} (\hat D^+_{0})$ with eigenvalue $-\frac{c_\mu}{2(\ell+\check{h})}$.
\end{proof}

\subsection*{Finer version of the factorization property}
It is clear that our smoothing  identifies the $R$-module ${\mathbb H}_\ell (\VV)$ with ${\mathbb H}_\ell (\VV_o)[[\tau]]$. 
According to Proposition \ref{prop:finiterank},  
$\Hcal_\ell (\VV)_{{\mathcal C}/S} ={\mathbb H}_\ell (\VV)_{A\mathfrak{g}}$
is a finitely generated $R$-module. Since $A_o=A/\tau A$, the reduction of ${\mathbb H}_\ell (\VV)_{A\mathfrak{g}}$
modulo $\tau$ yields ${\mathbb H}_\ell (\VV_o)_{A_o\mathfrak{g}}=\Hcal_\ell (\VV_o)_{{\mathcal C}_o/S_o}$. 
Proposition \ref{prop:fact} identifies the latter with 
$\oplus_{\mu\in P_\ell} \Hcal_\ell (\tilde \VV_{\mu,\mu^*})_{\tilde{\mathcal C}_o/S_o}$.
It is our goal to extend this identification to one of the space of  covacua
$\Hcal_\ell (\VV)_{{\mathcal C}/S}$ with the pull-back  of 
$\oplus_{\mu\in P_\ell} \Hcal_\ell (\tilde \VV_{\mu,\mu^*})_{{\mathcal C}_o/S_o}$ along 
the projection $\pi_{S_o}:S\to S_o$ and to identify the connection on that pull-back. 
This will imply among other things that 
$\Hcal_\ell (\VV)_{{\mathcal C}/S}$  is a free $R$-module. 



\begin{theorem}\label{thm:doublept}
The $R$-homomorphism  defined by  tensoring with the glueing tensor,
\begin{gather*}
E=(E_\mu)_\mu : {\mathbb H}_\ell (\VV)\to
\oplus_{\mu\in P_l} {\mathbb H}_\ell (\tilde \VV_{\mu,\mu^*})[[\tau]],\\
U=\sum_{k\ge 0} u_k\tau^k\mapsto \Big(U\hat\otimes_R \varepsilon^\mu =\sum_{k,d\ge 0} 
u_k\otimes \varepsilon_d^\mu\tau^{k+d}\Big)_{\mu},
\end{gather*}
is also a map of $A\mathfrak{g}$-representations if we let $A\mathfrak{g}$ act on the
right hand side via the inclusion
$A\subset \tilde A_o[[\tau]]$. The resulting  $R$-homomorphism of covariants,
\[
E_{{\mathcal C}/S}\!  :{\mathbb H}_\ell (\VV)_{A\mathfrak{g}} \to
\oplus_{\mu\in P_l} {\mathbb H}_\ell (\tilde \VV_{\mu,\mu^*})_{\tilde A_o\mathfrak{g}}[[\tau]],
\]
is an isomorphism (so that ${\mathbb H}_\ell (\VV)_{A\mathfrak{g}}$  is a free 
$R$-module). It is compatible with covariant differentiation with respect to 
$\theta_{S}(\log S_o)=R[[\tau]]\otimes_{R_o}\theta_{R_o}+R[[\tau]]\tau\frac{d}{d\tau}$ 
relative to the lift to $\hat\theta_{S}(\log S_o)$  of Lemma \ref{lemma:invariant}: 
it commutes with the action on $\theta_{R_o}$, whereas
$\tau\frac{d}{d\tau}$ respects each summand  
$H_\ell (\tilde \VV_{\mu,\mu^*})_{\tilde A\mathfrak{g}}[[\tau]]$ 
and acts there as the first order differential operator 
$\tau\frac{d}{d\tau}+\frac{c_\mu}{2(\ell+\check{h})}$.
\end{theorem}
\begin{proof}
The first statement is immediate from Lemma \ref{lemma:invariant}.
So the map on covariants is defined and is  $R$-linear. If we reduce 
$E_{{\mathcal C}/S}$ modulo $\tau$,  we  get the map 
\[
{\mathbb H}_\ell (\VV_o)_{A_o\mathfrak{g}}\to 
\oplus_{\mu\in P_l} {\mathbb H}_\ell (\tilde \VV_{\mu,\mu^*})_{\tilde A_o\mathfrak{g}},
\quad 
u\mapsto \sum_{\mu\in P_\ell} u\otimes \varepsilon_0^\mu,
\]
and observe that this is just the inverse of the isomorphism of Proposition \ref{prop:fact}. 
Since the range of $E_{{\mathcal C}/S}  $ is a free $R$-module, this implies that  $E_{{\mathcal C}/S}$ is an isomorphism.

The commutativity  with the action of $\theta_{R_o}$ is clear.
According to Corollary \ref{cor:derive} covariant derivation with respect to $\tau\frac{d}{d\tau}$ in 
${\mathbb H}_\ell (\VV)_{{\mathcal C}/S}  $
is defined by means of a $k$-derivation $D$ of  $A$ which lifts $\tau\frac{d}{d\tau}$:
 if we write $D=\tau\frac{d}{d\tau}+\sum_{n\ge 0}\tau^n D^{(n)}$, where $D^{(n)}$ is a vector field on the 
 smooth part of ${\mathcal C}/S$, then the covariant derivative is induced by $T_\mathfrak{g}(\hat D)=\tau\frac{d}{d\tau}+
\sum_{n\ge 0}\tau^n T_\mathfrak{g}(D^{(n)})$ acting on ${\mathbb H}_\ell (\VV_o)[[\tau]]$. From the last clause of 
Lemma \ref{lemma:invariant} we get
that when $U\in {\mathbb H}_\ell (\VV_o)[[\tau]]$,  
\begin{multline*}
T_\mathfrak{g}(D) E_\mu(U)=T_\mathfrak{g}(D)(U\varepsilon^\mu)=\\
=T_\mathfrak{g}(D)(U) \varepsilon^\mu  -\frac{c_\mu}{2(\ell+\check{h})}U \varepsilon^\mu  
=E_\mu T_\mathfrak{g}(D)(U)-\frac{c_\mu}{2(\ell+\check{h})}E_\mu(U).
\end{multline*}
Since $T_\mathfrak{g}(D)$ acts on ${\mathbb H}_\ell (\tilde \VV_{\mu,\mu^*})_{\tilde A_o\mathfrak{g}}[[\tau]]$ as  
derivation by $\tau\frac{d}{d\tau}$, the last clause follows.
\end{proof}

\begin{corollary}\label{cor:doublept}
The monodromy of the WZW connection acting on $\Hcal_\ell (\VV)_{{\mathcal C}/S}$
has finite order and acts in the summand 
$\Hcal _\ell (\tilde \VV_{\mu,\mu^*})_{\tilde C/S_o}[[\tau]]$ as 
multiplication by the root of unity $\exp(-\pi\sqrt{-1}\frac{c_\mu}{\ell+\check{h}})$. 
\end{corollary}
\begin{proof}
The multivalued  flat sections of $\Hcal_\ell (\VV)_{{\mathcal C}/\Delta}  $
decompose under $E_{{\mathcal C}/\Delta}  $ as a direct sum labeled by $P_\ell$. The summand
corresponding to $\mu$ is the set of solutions of the differential equation
$\tau\frac{d}{d\tau}U+\frac{c_\mu}{2(\ell+\check{h})}U=0$. These are clearly
of the form $u\tau^{-c_\mu/2(\ell+\check{h})}$  with $u\in 
{\mathbb H} _\ell (\tilde \VV_{\mu,\mu^*})_{\tilde A_o\mathfrak{g}}$. If we let $\tau$ run over
the unit circle, then we see that the monodromy is as asserted. Since
$\frac{c_\mu}{\ell+\check{h}}\in\QQ$, it has finite order.
\end{proof}

\begin{remark}\label{rem:pioneconvention}
We use here the convention that the monodromy of the multivalued function $z^\alpha$ is $\exp(2\pi\alpha\sqrt{-1})$
(rather than  $\exp(-2\pi\alpha\sqrt{-1})$). More pedantically: for us the monodromy is a \emph{covariant} rather than a contra-variant functor from the fundamental groupoid to a linear category.
\end{remark}


\section{The modular functor attached to the WZW model}\label{section:modular}

We show here that the results of Section \ref{section:doublept} lead to topological counterparts that take the form of  (what is called) a modular functor in topological  quantum field theory. 

\subsection*{Defining the functor}

For what follows, the most natural setting would probably be that of quasi-conformal surfaces, but we have chosen to work with the more familiar notion of $C^1$-surfaces. This forced us however to introduce the auxiliary notion of an infinitesimal collar below.

The  main objects will be \emph{compact oriented} 
surfaces endowed with a $C^1$-structure, possibly with boundary, but where we assume that each 
boundary component comes with a principal action of the unit circle $U(1)$ that is compatible with the orientation it receives from the surface. In the rest of this paper, we will simply refer to such an object as a \emph{surface}.

An \emph{infinitesimal collar} of a surface is a  inward pointing (nowhere zero) vector field defined on the boundary only with the property that it is locally trivial in the sense that we can find local $C^1$-diffeomorphism $(r,u)$ of a neighborhood of the boundary onto  $[0,\varepsilon)\times U(1)$  which is compatible with the $U(1)$-action on the boundary and takes  the vector field to 
$\partial /\partial r\vert_{\{0\}\times U(1)}$. The choice of such a vector field determines a basis for each tangent space (the second tangent vector field 
being the derivative of the $U(1)$-action) and so we may  think of this as a first order extension of the given $U(1)$ action.
Suppose given such an infinitesimally 
collared surface $\Sigma$ and two of its boundary components  $B_+, B_-$. Let us call a \emph{glueing map} for this pair
an \emph{anti-isomorphism} $\phi: B_-\to B_+$, that is,   a $C^1$-diffeomorphism with the property that $\phi (ub)=u^{-1}\phi (b)$ for all $b\in B_-$ and $u\in U(1)$. We call it thus, because if we use it to identify $B_-$ with $B_+$, 
then we get a new (infinitesimally collared) surface $\Sigma_\phi$ without the need of making any further choices: 
the $C^1$-structure must be such that the  normal vector fields become each others antipode. 
Similarly, the topological quotient $\check{\Sigma}$ of $\Sigma$  obtained by contracting each of its 
boundary components also acquires a $C^1$-structure: a function on $\check{\Sigma}$  is 
differentiable precisely when its lift to $\Sigma$ is $C^1$ and is such that its derivative evaluated on the infinitesimal 
collar of a boundary component  is the representation of a linear map in polar coordinates.  



\begin{definition}
We call a conformal structure on the interior of the infinitesimally collared surface 
$\Sigma$  \emph{admissible} if it is compatible with the given $C^1$-structure as well as with the infinitesimal 
collaring: for every boundary component either  the conformal structure extends to the boundary or extends across its image in $\check{\Sigma}$ and we demand  that in the first case the infinitesimal collaring be perpendicular to the boundary, and that in the second (cuspidal) case it maps to a $U(1)$-orbit in the tangent space. 
\end{definition}

This somewhat unconventional definition is in part motivated by the following observation. A conformal structure on a 
manifold is just a Riemann metric given up to multiplication by a continuous function. More precisely, it is a section of  the 
bundle of positive quadratic forms modulo positive scalars on the tangent bundle. As the fibers of this bundle have a 
convex structure, so has its space of sections. This also holds in the present case with the given boundary conditions, in 
particular the space of  admissible conformal structures  is contractible. And this is still true if we restrict ourselves to the 
admissible conformal structures that are cuspidal at a prescribed union of boundary components. 
This makes it a tractable notion from the point of view of homotopy. 


\begin{definition}
A \emph{$\mathfrak{g}$-marking}  of a surface  $\Sigma$ consists of giving a map $V$ that assigns to every boundary component of $\Sigma$ a finite dimensional irreducible represention of $\mathfrak{g}$  . We then denote the resulting set of data by 
$(\Sigma,V)$. We say that the $\mathfrak{g}$-marking is of level $\le \ell$ if $V$ takes values 
in representations of level $\le \ell$.
\end{definition}

Let $(\Sigma,V)$ be $\mathfrak{g}$-marked surface. We first suppose $\Sigma$ endowed with an infinitesimal  collaring. Choose an admissible purely cuspidal conformal structure $C$ with respect to this infinitesimal  collaring. Then $\check{\Sigma}$  acquires a conformal structure and hence (since $\check{\Sigma}$ is oriented) the structure of a compact Riemann surface, or equivalently, a nonsingular complex projective curve. We hope the reader forgives us for denoting that curve by $C$ as well. It comes with an injection $\pi_0(\partial\Sigma)\to C$.   If $V$ takes values in representations of level $\le \ell$, then we have defined the space of 
covacua ${\mathbb H}_\ell(\VV)_C$; otherwise we set ${\mathbb H}_\ell(\VV)_C=0$. 
For another  choice  of purely cuspidal admissible conformal structure $C'$, we can find a path of such structures $(C_t)_{0\le t\le 1}$ connecting $C$ with $C'$. The projectively flat  connection can be used to identify the corresponding 
projective spaces, and this identification is independent of the choice of path since they belong to the same homotopy class. 

In order to lift this to the actual vector spaces, we need a `rigging' of $\Sigma$ as follows.
Put $g:=\dim H_1(\check{\Sigma};{\mathbb R})$ and denote by ${\mathcal L} (\Sigma)\subset \wedge^g H_1(\check{\Sigma};{\mathbb R})$ the 
set of $I\in \wedge^g H_1(\check{\Sigma};{\mathbb R})$ for which 
$L(I):=\ker(\wedge I: H_1(\check{\Sigma};{\mathbb R})\to \wedge^{g+1}H_1(\check{\Sigma};{\mathbb R}))$ is a Lagrangian subspace (so that
$I$ is a generator of $\wedge^gL(I)$). Let us first assume that $\Sigma$ is connected. It is known that if $g>0$, then ${\mathcal L}(\Sigma)$ is connected, has infinite cyclic fundamental group with a canonical generator
and is an orbit of the symplectic group $\Sp (H_1(\check{\Sigma};{\mathbb R}))$. For example, if $g=1$, then ${\mathcal L}(\Sigma)=H_1(\check{\Sigma};{\mathbb R})-\{ 0\}\cong {\mathbb R}^2-\{ 0\}$. (If $g=0$, then $\wedge^g H_1(\check{\Sigma};{\mathbb R})={\mathbb R}$ and so ${\mathcal L}(\Sigma)$ is canonically identified with ${\mathbb R}-\{ 0\}$.) An element of ${\mathcal L} (\Sigma)$ may arise if $\check{\Sigma}$ is given as the boundary of a compact oriented $3$-manifold $W$: then the kernel of $H_1(\check{\Sigma};{\mathbb R})\to H_1(W;{\mathbb R})$ is a Lagrangian sublattice and so an orientation of it yields an element of ${\mathcal L} (\Sigma)$.
 
Let $I\in {\mathcal L}(\Sigma)$. We note that every regular differential on $C$ defines by integration a linear map $L(I)\to \CC$ and the basic theory or Riemann surfaces tells us that we thus obtain a complex-linear isomorphism $H^0(C,\omega_{C})\cong \Hom (L(I),\CC)$. Since this induces an isomorphism between $\det H^0(C,\omega_{C})$ and $\Hom_{\mathbb R} (\det_{\mathbb R} L(I),\CC)$, the linear form that takes the value $1$ in $I\in \det_{\mathbb R} L(I)$ yields a generator $I(C)$ of  $\det H^0(C,\omega_{C})$. 
For similar reasons,  the arc $(C_t)_{0\le t\le 1}$  lifts to a section  $t\in [0,1]\mapsto I(C_t)\in\det H^0(C_t,\omega_{C_t})$ of the  determinant bundle and this in turn yields via Theorem \ref{thm:wzwconn} an identification  of  ${\mathbb H}_\ell(\VV)_C$ with  
${\mathbb H}_\ell(\VV)_{C'}$. As this identification is canonical, we now have attached to the  triple $(\Sigma, V, I)$ and the infinitesimal  collaring of $\Sigma$  a well-defined finite dimensional complex vector space $H_\ell(\Sigma, V,I)$.  Actually, the infinitesimal collaring is irrelevant, for the infinitesimal collarings  make up an affine space over the vector space of vector fields on $\partial\Sigma$ and hence form a contractible set. 

For $g=0$, we shall always take for $I\in {\mathcal L} (\Sigma)$ the canonical element that corresponds to $1$ under the identification
${\mathcal L} (\Sigma)\cong {\mathbb R}-\{0\}$ so that we then have a well-defined vector space $H_\ell (\Sigma, V)$.
Proposition \ref{prop:buildingblocks} tells us what we get in some simple cases:

\begin{proposition}\label{prop:diskcylinder}
For $\Sigma$ a disk (resp.\  a cylinder), $H_\ell(\Sigma, V)$ is zero unless $V$ is the trivial representation (resp.\ the two representations attached to the boundary  are each other's contra-gradient), in which case it is canonically equal to $\CC$. 
\end{proposition}


Now drop the assumption that $\Sigma$ be connected and let $\Sigma_1,\dots ,\Sigma_r$ enumerate its distinct connected components. If $I\in {\mathcal L} (\Sigma)$ corresponds to $I_1\otimes_{\mathbb R}\cdots \otimes_{\mathbb R} I_r$ with $I_k\in {\mathcal L} (\Sigma_k)$, then the tensor product $H_\ell(\Sigma_1, V_1,I_1)\otimes_\CC\cdots\otimes_\CC H_\ell(\Sigma_r, V_r,I_r)$
only depends on $I_1\otimes_{\mathbb R}\cdots \otimes_{\mathbb R} I_r$ and so the preceding generalizes  if we
let $H_\ell(\Sigma, V,I)$  be this tensor product. We thus find:

\begin{theorem}\label{thm:modfunctor}
Let $(\Sigma,V)$ be a $\mathfrak{g}$-marked surface of level $\le \ell$. Then we have naturally defined on the Lagrangian manifold ${\mathcal L} (\Sigma)$ a local system ${\mathbb H}_\ell(\Sigma,V)$ whose stalk at $I\in {\mathcal L} (\Sigma)$ is $H_\ell(\Sigma, V,I)$. This construction is functorial with respect to automorphisms of $\mathfrak{g}$ so that for every $\sigma\in\aut(\mathfrak{g})$ we have a natural isomorphism 
${\mathbb H}_\ell(\Sigma, {}^\sigma\!V)\cong {\mathbb H}_\ell(\Sigma,V)$.
\end{theorem}
\begin{proof}
The last assertion follows from the last clause of Theorem \ref{thm:wzwconn}, the rest is clear from the preceding discussion.
\end{proof}

\begin{remark}\label{rem:duality}
The natural involution of $\mathfrak{g}$ with respect to a choice of root data takes every finite dimensional $\mathfrak{g}$-representation  into one equivalent to its contra-gradient. So for such an involution $\sigma$ we obtain an isomorphism between $H_\ell(\Sigma, V^*,I)$ and $H_\ell(\Sigma, V,I)$, but beware that this  involution is only unique up to inner automorphism. However, one expects that there exists  a canonical perfect pairing (which therefore does not involve a choice of $\sigma$) $H_\ell(\overline{\Sigma}, V^*,I)\otimes H_\ell(\Sigma, V,I)\to \CC$, where $\overline{\Sigma}$ stands for
$\Sigma$ with the opposite orientation.
\end{remark}


\subsection*{Action of the centrally extended  mapping class group}
Let  $\Gamma (\Sigma)$ denote  the  group of orientation preserving isotopies of $\Sigma$ which leave each of its  components and each boundary component invariant (but not necessarily point-wise). This is isomorphic to the usual mapping class group of the pair
consisting of $\check{\Sigma}$ and the finite subset of $\check{\Sigma}$ that appears as the image of $\pi_0(\partial\Sigma)$. 
The above lemma shows that if $(\Sigma, V)$ is a $\mathfrak{g}$-marked surface, then for every $I\in{\mathcal L} (\Sigma)$, the mapping class $\phi\in\Gamma (\Sigma)$ gives rise an isomorphism  $\phi_\#: H_\ell(\Sigma, V,I)\to H_\ell(\Sigma, V,\phi_*I)$. In other words, $\phi$ induces an automorphism of the local system ${\mathbb H}_\ell (\Sigma,V)$.

Assume $\Sigma$ connected and $g>0$ so that ${\mathcal L} (\Sigma)$ has infinite cyclic fundamental group.
Fix a universal cover $\tilde {\mathcal L} (\Sigma)\to {\mathcal L} (\Sigma)$ and denote by $\tilde H_\ell(\Sigma,V)$ the space of sections of the pull-back of ${\mathbb H}(\Sigma,V)$ to this cover.
The pairs $(\phi, \tilde \phi_\#)$ with $\phi$ a mapping class and $\tilde \phi_\#\in \aut (\tilde {\mathcal L} (\Sigma))$  a lift of $\phi_\#$ define a central  
extension $\tilde\Gamma (\Sigma)\to \Gamma (\Sigma)$ of the mapping class group by 
$\ZZ$. We have arranged things in such a manner that this extension acts on 
$\tilde H_\ell(\Sigma,V)$ with the central element $2(\ell +\check{h})\in\ZZ$ acting trivially. The central extension  is clearly one that already lives 
on the automorphism group  of $H_1(\check{\Sigma})$ (an integral symplectic group of genus $g$). 
The latter is known to  produce the universal central extension of the symplectic group. It has an abstract  description in terms of a $2$-cocyle, known as the Maslov index. 



\subsection*{The glueing property}

Let $B_+$ and $B_-$ be distinct boundary components of $\Sigma$ and $\phi: B_+\to B_-$ a glueing map so that we have an associated quotient surface $\Sigma_\phi$. We show that there is a natural embedding
of ${\mathcal L} (\Sigma_\phi)$ in ${\mathcal L} (\Sigma)$. If $B_+$ and $B_-$ lie on distinct components, then
we have a natural identification between the symplectic lattices $H_1(\check\Sigma)$ and $H_1((\Sigma_\phi)\check{})$ and so we also have a natural identification of ${\mathcal L}(\Sigma)$ with ${\mathcal L}(\Sigma_\phi)$. If $B_+$ and $B_-$ lie on the same component, then their common image 
$B$ in $\Sigma_\phi$ has the property that the image $\langle B\rangle $ of $H_1(B)\to H_1((\Sigma_\phi)\check{})$ is a primitive rank one sublattice. If we denote by $\langle B\rangle ^\perp$ the annihilator  of $\langle B\rangle$ with respect to the intersection pairing, then $\langle B\rangle\subset \langle B\rangle^\perp$ and the symplectic lattice $\langle B\rangle ^\perp/\langle B\rangle $ is naturally identified with $H_1(\check\Sigma)$. Since the intersection pairing identifies $H_1((\Sigma_\phi)\check{})/\langle B\rangle ^\perp$ with the dual of $\langle B\rangle $, we see that we have a natural embedding of ${\mathcal L} (\Sigma_\phi)$ in ${\mathcal L} (\Sigma)$.  

If we now combine the discussion in Remark \ref{rem:dehntwist} with Theorem \ref{thm:doublept}, we obtain

\begin{theorem}[Glueing property]\label{thm:sew}
Suppose we have endowed $\Sigma_\phi$ with a $\mathfrak{g}$-marking, i.e., a map $V:\pi_0(\partial\Sigma_{\phi})=\pi_0(\partial\Sigma)-\{\{B_+\},\{B_-\}\}\to P_\ell$. 
For $\mu\in P_\ell$, denote by $V_{\mu,\mu^*}: \pi_0(\partial\Sigma)\to P_\ell$ the extension of $V$ to a $\mathfrak{g}$-marking of $\Sigma$ which assigns to $B_+$ resp.\ $B_-$ the value $\lambda$ resp.\ $\lambda^*$. Then 
the local system ${\mathbb H}_\ell (\Sigma_{\phi},V)$ on ${\mathcal L} (\Sigma_\phi)$ can be naturally identified with the restriction of $\oplus_{\lambda\in P_\ell} {\mathbb H}_\ell (\Sigma,V_{\mu,\mu^*})$ with respect to the
embedding of ${\mathcal L} (\Sigma_\phi)$ in ${\mathcal L} (\Sigma)$ defined above. 
Under this identification, the mapping class of $\Sigma_{\phi}$ obtained by the glueing maps
$\{\zeta\phi\}_{\zeta\in U(1)}$ (a Dehn twist) acts on the summand  $H_\ell (\Sigma,V_{\mu,\mu^*})$ as scalar multiplication by $\exp\big(-\frac{\pi \sqrt{-1}c_\mu}{\ell +\check{h}}\big)$.
\end{theorem}

 
By repeated application of Theorem \ref{thm:sew} in the opposite direction we can thus completely recover ${\mathbb H}_\ell (\Sigma, V)$ from a pair of pants decomposition of $\Sigma$: such a decomposition has a 3-holed sphere (a pair of pants) as its basic building block, a case that is taken care of by Remark \ref{rem:3holes}. In particular we obtain a formula, at least in principle, for its dimension, known as the \emph{Verlinde formula}.  This process is nicely formalized by the notion of a fusion ring (see \cite{beauville}). But if we wish to deal with the modular functor itself, then we are led to the representation theory of quantum groups.  As we mentioned in the introduction, this has applications in knot theory via a threedimensional topological quantum field theory. For most of this we refer to the monograph of Turaev 
\cite{turaev}.
\\




