  Si Li and author suggested in that, in some cases, the AdS/CFT correspondence
can be formulated in terms of the algebraic operation of Koszul duality. In
this paper this suggestion is checked explicitly for $M2$ branes in an
$\Omega$-background. The algebra of supersymmetric operators on a stack of $K$
$M2$ branes is shown to be Koszul dual, in large $K$, to the algebra of
supersymmetric operators of $11$-dimensional supergravity in an
$\Omega$-background (using the formulation of supergravity in an
$\Omega$-background presented in arXiv:1610.04144).
  The twisted form of supergravity that is used here can be quantized to all
orders in perturbation theory. We find that the Koszul duality result holds to
all orders in perturbation theory, in both the gravitational theory and the
theory on the $M2$. (However, there is a certain non-linear identification of
the coupling constants on each side which I was unable to determine
explicitly).
  It is also shown that the algebra of operators on $K$ $M2$ branes, as $K \to
\infty$, is a quantum double-loop algebra (a two-variable analog of the
Yangian). This algebra is also the Koszul dual of the algebra of operators on
the gravitational theory. An explicit presentation for this algebra is
presented, and it is shown that this algebra is the unique quantization of its
classical limit. Some conjectural applications to enumerative geometry of
Calabi-Yau threefolds are also presented.
