  We generalize the theory of Koszul complexes and Koszul algebras (in
particular, Koszul duality between symmetric and exterior algebras) to
symmetric tensor categories. In characteristic $p\ge 5$, this theory exhibits
peculiar effects, not observed in the classical theory. In particular, we show
that the symmetric and exterior algebras of a non-invertible simple object in
the Verlinde category ${\rm Ver}_p$ are almost Koszul (although not Koszul),
and show how this gives examples of $(r,s)$-Koszul algebras with any $r,s\ge
2$. We also develop a theory of Lie algebras in symmetric tensor categories. We
show that the PBW theorem may fail in ${\rm Ver}_p$, but it holds if one
assumes a certain identity of degree $p$ which we call the $p$-Jacobi identity.
This identity is a generalization to $p\ge 5$ of the identity $[x,x]=0$
required for Lie algebras in characteristic $2$ and the identity $[[x,x],x]=0$
for odd $x$ required for Lie superalgebras in characteristic $3$.
