/-
Copyright 2026 The Formal Conjectures Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-/modulepublicimportMathlib.Algebra.Category.ModuleCat.Ext.HasExtpublicimportFormalConjecturesForMathlib.Algebra.Homology.DerivedCategory.Ext.GradedAlgebrapublicimportFormalConjecturesForMathlib.RingTheory.Bialgebra.TrivialModule@[expose]publicnoncomputablesection
Cohomology of a bialgebra
Let A be a bialgebra over a field k, and let k be the trivial A-module through the counit
(Bialgebra.trivialModuleCat k A). We define
Bialgebra.cohomologyRing k A: the cohomology ring H^*(A, k) = ⨁ n, Ext^n_A(k, k), a graded
k-algebra under the Yoneda product;
Bialgebra.cohomology k A M: the cohomology H^*(A, M) = ⨁ n, Ext^n_A(k, M) with coefficients
in an A-module M, a graded module over H^*(A, k).
Here Ext is taken in ModuleCat A, the category of all A-modules, and not in the category of
finite-dimensional ones. When A is finite-dimensional over a field the two give the same groups
on finite-dimensional modules: such a module admits a resolution by finitely generated free
A-modules, which are again finite-dimensional and are projective in both categories, and Ext
is computed from that single resolution either way. So cohomologyRing k A is the cohomology of
the finite tensor category of finite-dimensional A-modules, which is what the literature means
by H^*(A, k).
Two k-structures on ModuleCat A are involved, and only one of them is scoped.
ModuleCat.linearOverField, giving Linear k (ModuleCat A), is a global instance, so the
k-algebra structure on cohomologyRing k A registered below needs no open scoped. The
k-module structure on an individual object, ModuleCat.moduleOfAlgebraModule, is a scoped
instance; in both, k acts through algebraMap k A. A file that mentions FiniteDimensional k M
for M : ModuleCat A therefore does have to open scoped ModuleCat.Algebra.
The cohomology ring H^*(A, k) = ⨁ n, Ext^n_A(k, k) of the bialgebra A over k, where k
is the trivial A-module through the counit and Ext is taken in ModuleCat A. It is a graded
k-algebra under the Yoneda product.
The cohomology H^*(A, M) = ⨁ n, Ext^n_A(k, M) of the bialgebra A over k with
coefficients in the A-module M. It is a graded module over cohomologyRing k A under the
Yoneda product.
The cohomology ring is not the zero ring: its degree-zero part contains the identity of the
trivial module. In particular a finiteness statement about cohomologyRing k A is not vacuous.