# Koszul complex

In mathematics, the Koszul complex was first introduced to define a cohomology theory for Lie algebras, by Jean-Louis Koszul (see Lie algebra cohomology). It turned out to be a useful general construction in homological algebra. As a tool, its homology can be used to tell when a set of elements of a (local) ring is an M-regular sequence, and hence it can be used to prove basic facts about the depth of a module or ideal which is an algebraic notion of dimension that is related to but different from the geometric notion of Krull dimension. Moreover, in certain circumstances, the complex is the complex of syzygies, that is, it tells you the relations between generators of a module, the relations between these relations, and so forth.

## Definition

Let A be a commutative ring and s: A$^r$ → A an A-linear map. Its Koszul complex K$_s$ is
    $\bigwedge ^{r}A^{r}\ \to \ \bigwedge ^{r-1}A^{r}\ \to \ \cdots \ \to \ \bigwedge ^{1}A^{r}\ \to \ \bigwedge ^{0}A^{r}\simeq A$
where the maps send
    $\alpha _{1}\wedge \cdots \wedge \alpha _{k}\ \mapsto \ \sum _{i=1}^{k}(-1)^{i+1}s(\alpha _{i})\ \alpha _{1}\wedge \cdots \wedge {\hat {\alpha }}_{i}\wedge \cdots \wedge \alpha _{k}$
where ${\hat {\ }}$ means the term is omitted and $\wedge$ means the wedge product. One may replace $A^{r}$ with any A-module.

## Motivating example

Let M be a manifold, variety, scheme, ..., and A be the ring of functions on it, denoted ${\mathcal {O}}(M)$.
The map $s\colon A^{r}\to A$ corresponds to picking r functions $f_{1},...,f_{r}$. When r = 1, the Koszul complex is
    ${\mathcal {O}}(M)\ {\stackrel {\cdot f}{\to }}\ {\mathcal {O}}(M)$
whose cokernel is the ring of functions on the zero locus f = 0. In general, the Koszul complex is
    ${\mathcal {O}}(M)\ {\stackrel {\cdot (f_{1},...,f_{r})}{\to }}\ {\mathcal {O}}(M)^{r}\ \to \ \cdots \ \to \ {\mathcal {O}}(M)^{r}\ {\stackrel {\cdot (f_{1},\dots ,f_{r})}{\to }}\ {\mathcal {O}}(M).$
The cokernel of the last map is again functions on the zero locus $f_{1}=\cdots =f_{r}=0$. It is the tensor product of the r many Koszul complexes for $f_{i}=0$, so its dimensions are given by binomial coefficients.
In pictures: given functions $s_{i}$, how do we define the locus where they all vanish?
In algebraic geometry, the ring of functions of the zero locus is $A/(s_{1},\dots ,s_{r})$. In derived algebraic geometry, the dg ring of functions is the Koszul complex. If the loci $s_{i}=0$ intersect transversely, these are equivalent.
Thus: Koszul complexes are derived intersections of zero loci.

## Properties
### Algebra structure

First, the Koszul complex K$_s$ of (A,s) is a chain complex: the composition of any two maps is zero. Second, the map
    $K_{s}\otimes K_{s}\ \to \ K_{s}\ \ \ \,\ \ \ \,\ \ \ \,\ \ \ (\alpha _{1}\wedge \cdots \wedge \alpha _{k})\otimes (\beta _{1}\wedge \cdots \wedge \beta _{\ell })\ \mapsto \ \alpha _{1}\wedge \cdots \wedge \alpha _{k}\wedge \beta _{1}\wedge \cdots \wedge \beta _{\ell }$
makes it into a dg algebra.

### As a tensor product

The Koszul complex is a tensor product: if $s=(s_{1},\dots ,s_{r})$, then
    $K_{s}\ \simeq \ K_{s_{1}}\otimes \cdots \otimes K_{s_{r}}$
where $\otimes$ denotes the derived tensor product of chain complexes of A-modules.

### Vanishing in regular case

When $s_{1},\dots ,s_{r}$ form a regular sequence, the map $K_{s}\to A/(s_{1},\dots ,s_{r})$ is a quasi-isomorphism, i.e.
    $\operatorname {H} ^{i}(K_{s})\ =\ 0,\qquad i\neq 0,$
and as for any s, $H^{0}(K_{s})=A/(s_{1},\dots ,s_{r})$.

## History

The Koszul complex was first introduced to define a cohomology theory for Lie algebras, by Jean-Louis Koszul (see Lie algebra cohomology). It turned out to be a useful general construction in homological algebra. As a tool, its homology can be used to tell when a set of elements of a (local) ring is an M-regular sequence, and hence it can be used to prove basic facts about the depth of a module or ideal which is an algebraic notion of dimension that is related to but different from the geometric notion of Krull dimension. Moreover, in certain circumstances, the complex is the complex of syzygies, that is, it tells you the relations between generators of a module, the relations between these relations, and so forth.

## Detailed Definition

Let R be a commutative ring and E a free module of finite rank r over R. We write $\bigwedge ^{i}E$ for the i-th exterior power of E. Then, given an R-linear map $s\colon E\to R$, the Koszul complex associated to s is the chain complex of R-modules:
    $K_{\bullet }(s)\colon 0\to \bigwedge ^{r}E{\overset {d_{r}}{\to }}\bigwedge ^{r-1}E\to \cdots \to \bigwedge ^{1}E{\overset {d_{1}}{\to }}R\to 0$,
where the differential $d_{k}$ is given by: for any $e_{i}$ in E,
    $d_{k}(e_{1}\wedge \dots \wedge e_{k})=\sum _{i=1}^{k}(-1)^{i+1}s(e_{i})e_{1}\wedge \cdots \wedge {\widehat {e_{i}}}\wedge \cdots \wedge e_{k}$.
The superscript ${\widehat {\cdot }}$ means the term is omitted. To show that $d_{k}\circ d_{k+1}=0$, use the self-duality of a Koszul complex.
Note that $\bigwedge ^{1}E=E$ and $d_{1}=s$. Note also that $\bigwedge ^{r}E\simeq R$; this isomorphism is not canonical (for example, a choice of a volume form in differential geometry provides an example of such an isomorphism).
If $E=R^{r}$ (i.e., an ordered basis is chosen), then, giving an R-linear map $s\colon R^{r}\to R$ amounts to giving a finite sequence $s_{1},\dots ,s_{r}$ of elements in R (namely, a row vector) and then one sets $K_{\bullet }(s_{1},\dots ,s_{r})=K_{\bullet }(s).$
If M is a finitely generated R-module, then one sets:
    $K_{\bullet }(s,M)=K_{\bullet }(s)\otimes _{R}M$,
which is again a chain complex with the induced differential $(d\otimes 1_{M})(v\otimes m)=d(v)\otimes m$.
The i-th homology of the Koszul complex
    $\operatorname {H} _{i}(K_{\bullet }(s,M))=\operatorname {ker} (d_{i}\otimes 1_{M})/\operatorname {im} (d_{i+1}\otimes 1_{M})$
is called the i-th Koszul homology. For example, if $E=R^{r}$ and $s=[s_{1}\cdots s_{r}]$ is a row vector with entries in R, then $d_{1}\otimes 1_{M}$ is
    $s\colon M^{r}\to M,\,(m_{1},\dots ,m_{r})\mapsto s_{1}m_{1}+\dots +s_{r}m_{r}$
and so
    $\operatorname {H} _{0}(K_{\bullet }(s,M))=M/(s_{1},\dots ,s_{r})M=R/(s_{1},\dots ,s_{r})\otimes _{R}M.$
Similarly,
    $\operatorname {H} _{r}(K_{\bullet }(s,M))=\{m\in M:s_{1}m=s_{2}m=\dots =s_{r}m=0\}=\operatorname {Hom} _{R}(R/(s_{1},\dots ,s_{r}),M).$

### Koszul complexes in low dimensions

Given a commutative ring R, an element x in R, and an R-module M, the multiplication by x yields a homomorphism of R-modules,
    $M\to M.$
Considering this as a chain complex (by putting them in degree 1 and 0, and adding zeros elsewhere), it is denoted by $K(x,M)$. By construction, the homologies are
    $H_{0}(K(x,M))=M/xM,H_{1}(K(x,M))=\operatorname {Ann} _{M}(x)=\{m\in M,xm=0\},$
the annihilator of x in M. Thus, the Koszul complex and its homology encode fundamental properties of the multiplication by x. This chain complex $K_{\bullet }(x)$ is called the Koszul complex of R with respect to x, as in #Definition.
The Koszul complex for a pair $(x,y)\in R^{2}$ is
    $0\to R{\xrightarrow {\ d_{2}\ }}R^{2}{\xrightarrow {\ d_{1}\ }}R\to 0,$
with the matrices $d_{1}$ and $d_{2}$ given by
    $d_{1}={\begin{bmatrix}x\\y\end{bmatrix}}$ and
    $d_{2}={\begin{bmatrix}-y&x\end{bmatrix}}.$
Note that $d_{i}$ is applied on the right. The cycles in degree 1 are then exactly the linear relations on the elements x and y, while the boundaries are the trivial relations. The first Koszul homology $H_{1}(K_{\bullet }(x,y))$ therefore measures exactly the relations mod the trivial relations. With more elements the higher-dimensional Koszul homologies measure the higher-level versions of this.
In the case that the elements $x_{1},x_{2},\dots ,x_{n}$ form a regular sequence, the higher homology modules of the Koszul complex are all zero.

## Example

If k is a field and $X_{1},X_{2},\dots ,X_{d}$ are indeterminates and R is the polynomial ring $k[X_{1},X_{2},\dots ,X_{d}]$, the Koszul complex $K_{\bullet }(X_{i})$ on the $X_{i}$'s forms a concrete free R-resolution of k.

## Properties of a Koszul homology

Let E be a finite-rank free module over R, let $s\colon E\to R$ be an R-linear map, and let t be an element of R. Let $K(s,t)$ be the Koszul complex of $(s,t)\colon E\oplus R\to R$.
Using $\bigwedge ^{k}(E\oplus R)=\oplus _{i=0}^{k}\bigwedge ^{k-i}E\otimes \bigwedge ^{i}R=\bigwedge ^{k}E\oplus \bigwedge ^{k-1}E$, there is the exact sequence of complexes:
    $0\to K(s)\to K(s,t)\to K(s)[-1]\to 0$,
where $[-1]$ signifies the degree shift by $-1$ and $d_{K(s)[-1]}=-d_{K(s)}$. One notes: for $(x,y)$ in $\bigwedge ^{k}E\oplus \bigwedge ^{k-1}E$,
    $d_{K(s,t)}((x,y))=(d_{K(s)}x+ty,d_{K(s)[-1]}y).$
In the language of homological algebra, the above means that $K(s,t)$ is the mapping cone of $t\colon K(s)\to K(s)$.
Taking the long exact sequence of homologies, we obtain:
    $\cdots \to \operatorname {H} _{i}(K(s)){\overset {t}{\to }}\operatorname {H} _{i}(K(s))\to \operatorname {H} _{i}(K(s,t))\to \operatorname {H} _{i-1}(K(s)){\overset {t}{\to }}\cdots .$
Here, the connecting homomorphism
    $\delta :\operatorname {H} _{i+1}(K(s)[-1])=\operatorname {H} _{i}(K(s))\to \operatorname {H} _{i}(K(s))$
is computed as follows. By definition, $\delta ([x])=[d_{K(s,t)}(y)]$ where y is an element of $K(s,t)$ that maps to x. Since $K(s,t)$ is a direct sum, we can simply take y to be (0, x). Then the early formula for $d_{K(s,t)}$ gives $\delta ([x])=t[x]$.
The above exact sequence can be used to prove the following.
Theorem — Let R be a ring and M a module over it. If a sequence $x_{1},x_{2},\cdots ,x_{r}$ of elements of R is a regular sequence on M, then
    $\operatorname {H} _{i}(K(x_{1},\dots ,x_{r})\otimes M)=0$
for all $i\geq 1$. In particular, when M = R, this is to say
    $0\to \bigwedge ^{r}R^{r}{\overset {d_{r}}{\to }}\bigwedge ^{r-1}R^{r}\to \cdots \to \bigwedge ^{2}R^{r}{\overset {d_{2}}{\to }}R^{r}{\overset {[x_{1}\cdots x_{r}]}{\to }}R\to R/(x_{1},\cdots ,x_{r})\to 0$
is exact; i.e., $K(x_{1},\dots ,x_{r})$ is an R-free resolution of $R/(x_{1},\dots ,x_{r})$.
Proof by induction on r. If $r=1$, then $\operatorname {H} _{1}(K(x_{1};M))=\operatorname {Ann} _{M}(x_{1})=0$. Next, assume the assertion is true for r - 1. Then, using the above exact sequence, one sees $\operatorname {H} _{i}(K(x_{1},\dots ,x_{r};M))=0$ for any $i\geq 2$. The vanishing is also valid for $i=1$, since $x_{r}$ is a nonzerodivisor on $\operatorname {H} _{0}(K(x_{1},\dots ,x_{r-1};M))=M/(x_{1},\dots ,x_{r-1})M.$ $\square$
Corollary — Let R, M be as above and $x_{1},x_{2},\cdots ,x_{n}$ a sequence of elements of R. Suppose there are a ring S, an S-regular sequence $y_{1},y_{2},\cdots ,y_{n}$ in S and a ring homomorphism S → R that maps $y_{i}$ to $x_{i}$. (For example, one can take $S=\mathbb {Z} [y_{1},\cdots ,y_{n}]$.) Then
    $\operatorname {H} _{i}(K(x_{1},\dots ,x_{n})\otimes _{R}M)=\operatorname {Tor} _{i}^{S}(S/(y_{1},\dots ,y_{n}),M).$
where Tor denotes the Tor functor and M is an S-module through $S\to R$.
Proof: By the theorem applied to S and S as an S-module, we see that $K(y_{1},\dots ,y_{n})$ is an S-free resolution of $S/(y_{1},\dots ,y_{n})$. So, by definition, the i-th homology of $K(y_{1},\dots ,y_{n})\otimes _{S}M$ is the right-hand side of the above. On the other hand, $K(y_{1},\dots ,y_{n})\otimes _{S}M=K(x_{1},\dots ,x_{n})\otimes _{R}M$ by the definition of the S-module structure on M. $\square$
Corollary — Let R, M be as above and $x_{1},x_{2},\cdots ,x_{n}$ a sequence of elements of R. Then both the ideal $I=(x_{1},x_{2},\cdots ,x_{n})$ and the annihilator of M annihilate
    $\operatorname {H} _{i}(K(x_{1},\dots ,x_{n})\otimes M)$
for all i.
Proof: Let S = R[y$_1$, ..., y$_n$]. Turn M into an S-module through the ring homomorphism S → R, y$_i$ → x$_i$ and R an S-module through y$_i$ → 0. By the preceding corollary, $\operatorname {H} _{i}(K(x_{1},\dots ,x_{n})\otimes M)=\operatorname {Tor} _{i}^{S}(R,M)$ and then
    $\operatorname {Ann} _{S}\left(\operatorname {Tor} _{i}^{S}(R,M)\right)\supset \operatorname {Ann} _{S}(R)+\operatorname {Ann} _{S}(M)\supset (y_{1},\dots ,y_{n})+\operatorname {Ann} _{R}(M)+(y_{1}-x_{1},...,y_{n}-x_{n}).$ $\square$
For a local ring, the converse of the theorem holds. More generally,
Theorem — Let R be a ring and M a nonzero finitely generated module over R . If $x_{1},x_{2},\dots ,x_{r}$ are elements of the Jacobson radical of R, then the following are equivalent:
* The sequence $x_{1},\dots ,x_{r}$ is a regular sequence on M,
* $\operatorname {H} _{1}(K(x_{1},\dots ,x_{r})\otimes M)=0$,
* $\operatorname {H} _{i}(K(x_{1},\dots ,x_{r})\otimes M)=0$ for all i ≥ 1.
Proof: We only need to show 2. implies 1., the rest being clear. We argue by induction on r. The case r = 1 is already known. Let x' denote x$_1$, ..., x$_{r-1}$. Consider
    $\cdots \to \operatorname {H} _{1}(K(x';M)){\overset {x_{r}}{\to }}\operatorname {H} _{1}(K(x';M))\to \operatorname {H} _{1}(K(x_{1},\dots ,x_{r};M))=0\to M/x'M{\overset {x_{r}}{\to }}\cdots .$
Since the first $x_{r}$ is surjective, $N=x_{r}N$ with $N=\operatorname {H} _{1}(K(x';M))$. By Nakayama's lemma, $N=0$ and so x' is a regular sequence by the inductive hypothesis. Since the second $x_{r}$ is injective (i.e., is a nonzerodivisor), $x_{1},\dots ,x_{r}$ is a regular sequence. (Note: by Nakayama's lemma, the requirement $M/(x_{1},\dots ,x_{r})M\neq 0$ is automatic.) $\square$

## Tensor products of Koszul complexes

In general, if C, D are chain complexes, then their tensor product $C\otimes D$ is the chain complex given by
    $(C\otimes D)_{n}=\sum _{i+j=n}C_{i}\otimes D_{j}$
with the differential: for any homogeneous elements x, y,
    $d_{C\otimes D}(x\otimes y)=d_{C}(x)\otimes y+(-1)^{|x|}x\otimes d_{D}(y)$
where |x| is the degree of x.
This construction applies in particular to Koszul complexes. Let E, F be finite-rank free modules, and let $s\colon E\to R$ and $t\colon F\to R$ be two R-linear maps. Let $K(s,t)$ be the Koszul complex of the linear map $(s,t)\colon E\oplus F\to R$. Then, as complexes,
    $K(s,t)\simeq K(s)\otimes K(t).$
To see this, it is more convenient to work with an exterior algebra (as opposed to exterior powers). Define the graded derivation of degree $-1$
    $d_{s}:\wedge E\to \wedge E$
by requiring: for any homogeneous elements x, y in ΛE,
* $d_{s}(x)=s(x)$ when $|x|=1$
* $d_{s}(x\wedge y)=d_{s}(x)\wedge y+(-1)^{|x|}x\wedge d_{s}(y)$
One easily sees that $d_{s}\circ d_{s}=0$ (induction on degree) and that the action of $d_{s}$ on homogeneous elements agrees with the differentials in #Definition.
Now, we have $\wedge (E\oplus F)=\wedge E\otimes \wedge F$ as graded R-modules. Also, by the definition of a tensor product mentioned in the beginning,
    $d_{K(s)\otimes K(t)}(e\otimes 1+1\otimes f)=d_{K(s)}(e)\otimes 1+1\otimes d_{K(t)}(f)=s(e)+t(f)=d_{K(s,t)}(e+f).$
Since $d_{K(s)\otimes K(t)}$ and $d_{K(s,t)}$ are derivations of the same type, this implies $d_{K(s)\otimes K(t)}=d_{K(s,t)}.$
Note, in particular,
    $K(x_{1},x_{2},\dots ,x_{r})\simeq K(x_{1})\otimes K(x_{2})\otimes \cdots \otimes K(x_{r})$.
The next proposition shows how the Koszul complex of elements encodes some information about sequences in the ideal generated by them.
Proposition — Let R be a ring and I = (x$_1$, ..., x$_n$) an ideal generated by some n-elements. Then, for any R-module M and any elements y$_1$, ..., y$_r$ in I,
    $\operatorname {H} _{i}(K(x_{1},\dots ,x_{n},y_{1},\dots ,y_{r};M))\simeq \bigoplus _{i=j+k}\operatorname {H} _{j}(K(x_{1},\dots ,x_{n};M))\otimes \wedge ^{k}R^{r}.$
where $\wedge ^{k}R^{r}$ is viewed as a complex with zero differential. (In fact, the decomposition holds on the chain-level).
Proof: (Easy but omitted for now)
As an application, we can show the depth-sensitivity of a Koszul homology. Given a finitely generated module M over a ring R, by (one) definition, the depth of M with respect to an ideal I is the supremum of the lengths of all regular sequences of elements of I on M. It is denoted by $\operatorname {depth} (I,M)$. Recall that an M-regular sequence x$_1$, ..., x$_n$ in an ideal I is maximal if I contains no nonzerodivisor on $M/(x_{1},\dots ,x_{n})M$.
The Koszul homology gives a very useful characterization of a depth.
Theorem (depth-sensitivity) — Let R be a Noetherian ring, x$_1$, ..., x$_n$ elements of R and I = (x$_1$, ..., x$_n$) the ideal generated by them. For a finitely generated module M over R, if, for some integer m,
    $\operatorname {H} _{i}(K(x_{1},\dots ,x_{n})\otimes M)=0$ for all i > m,
while
    $\operatorname {H} _{m}(K(x_{1},\dots ,x_{n})\otimes M)\neq 0,$
then every maximal M-regular sequence in I has length n - m (in particular, they all have the same length). As a consequence,
    $\operatorname {depth} (I,M)=n-m$.
Proof: To lighten the notations, we write H(-) for H(K(-)). Let y$_1$, ..., y$_s$ be a maximal M-regular sequence in the ideal I; we denote this sequence by ${\underline {y}}$. First we show, by induction on $l$, the claim that $\operatorname {H} _{i}({\underline {y}},x_{1},\dots ,x_{l};M)$ is $\operatorname {Ann} _{M/{\underline {y}}M}(x_{1},\dots ,x_{l})$ if $i=l$ and is zero if $i>l$. The basic case $l=0$ is clear from #Properties of a Koszul homology. From the long exact sequence of Koszul homologies and the inductive hypothesis,
    $\operatorname {H} _{l}\left({\underline {y}},x_{1},\dots ,x_{l};M\right)=\operatorname {ker} \left(x_{l}:\operatorname {Ann} _{M/{\underline {y}}M}(x_{1},\dots ,x_{l-1})\to \operatorname {Ann} _{M/{\underline {y}}M}(x_{1},\dots ,x_{l-1})\right)$,
which is $\operatorname {Ann} _{M/{\underline {y}}M}(x_{1},\dots ,x_{l}).$ Also, by the same argument, the vanishing holds for $i>l$. This completes the proof of the claim.
Now, it follows from the claim and the early proposition that $\operatorname {H} _{i}(x_{1},\dots ,x_{n};M)=0$ for all i > n - s. To conclude n - s = m, it remains to show that it is nonzero if i = n - s. Since ${\underline {y}}$ is a maximal M-regular sequence in I, the ideal I is contained in the set of all zerodivisors on $M/{\underline {y}}M$, the finite union of the associated primes of the module. Thus, by prime avoidance, there is some nonzero v in $M/{\underline {y}}M$ such that $I\subset {\mathfrak {p}}=\operatorname {Ann} _{R}(v)$, which is to say,
    $0\neq v\in \operatorname {Ann} _{M/{\underline {y}}M}(I)\simeq \operatorname {H} _{n}\left(x_{1},\dots ,x_{n},{\underline {y}};M\right)=\operatorname {H} _{n-s}(x_{1},\dots ,x_{n};M)\otimes \wedge ^{s}R^{s}.$ $\square$

## Self-duality

There is an approach to a Koszul complex that uses a cochain complex instead of a chain complex. As it turns out, this results essentially in the same complex (the fact known as the self-duality of a Koszul complex).
Let E be a free module of finite rank r over a ring R. Then each element e of E gives rise to the exterior left-multiplication by e:
    $l_{e}:\wedge ^{k}E\to \wedge ^{k+1}E,\,x\mapsto e\wedge x.$
Since $e\wedge e=0$, we have: $l_{e}\circ l_{e}=0$; that is,
    $0\to R{\overset {1\mapsto e}{\to }}\wedge ^{1}E{\overset {l_{e}}{\to }}\wedge ^{2}E\to \cdots \to \wedge ^{r}E\to 0$
is a cochain complex of free modules. This complex, also called a Koszul complex, is a complex used in (Eisenbud 1995). Taking the dual, there is the complex:
    $0\to (\wedge ^{r}E)^{*}\to (\wedge ^{r-1}E)^{*}\to \cdots \to (\wedge ^{2}E)^{*}\to (\wedge ^{1}E)^{*}\to R\to 0$.
Using an isomorphism $\wedge ^{k}E\simeq (\wedge ^{r-k}E)^{*}\simeq \wedge ^{r-k}(E^{*})$, the complex $(\wedge E,l_{e})$ coincides with the Koszul complex in the definition.

## Use

The Koszul complex is essential in defining the joint spectrum of a tuple of commuting bounded linear operators in a Banach space.