# Cohomology

## `CohomologyRingGenerators(P): Rec -> Rec`

Given a compact projective resolution $P$ for a simple module $S$ over a basic algebra $A$, the function returns the chain maps in compact form of a minimal set of generators for the cohomology $\hbox{Ext}_A^*(S, S)$, as well as some other information. The record that is returned has the following fields:

**(a)**
The list of maps in compact form for the chain map of the generators (field name `ChainMapRecord`).

**(b)**
The sequence of degrees of cohomology generators (field name `ChainDegrees`).

**(c)**
The tops of the chain maps (maps on modules modulo radicals) for the purposes of computing products (field name `TopsOfCohomologyGenerators`).

**(d)**
The tops of the chain maps representing monomials in the generators (field name `TopsOfCohomologyChainMaps`).

**(e)**
The original compact projective resolution (field name `ProjectiveResolution`).

## `CohomologyRightModuleGenerators(P, Q, CQ): Rec, Rec, Rec -> Rec`

Given projective resolutions $P$ and $Q$ for simple modules $S$ and $T$ over a basic algebra $A$ and the cohomology generators $CQ$ for $T$ associated to the resolution $Q$, the function returns the chain maps in compact form of the minimal generators for the cohomology $\hbox{Ext}_A^*(S, T)$ as a right module over the cohomology ring $\hbox{Ext}_A^*(T,T)$. The function returns a record consisting of the following fields.

**(a)**
The list of maps in compact form for the chain map of each cohomology generator (field name `ChainMapRecord`).

**(b)**
The sequence of degrees of cohomology generators (field name `ChainDegrees`).

**(c)**
The tops of the chain maps (maps on modules module radicals) for the purposes of computing products (field name `TopsOfCohomologyGenerators`).

## `CohomologyLeftModuleGenerators(P, CP, Q): Tup, Tup, Tup -> Tup`

Given projective resolutions $P$ and $Q$ for simple modules $S$ and $T$ over a basic algebra $A$ and the cohomology generators $CP$ for $T$ associated to the resolution $Q$, the function returns the chain maps in compact form of the minimal generators for the cohomology $\hbox{Ext}_A^*(S, T)$ as a left module over the cohomology ring $\hbox{Ext}_A^*(S, S)$. The function returns a record consisting of the following fields.

**(a)**
The list of maps in compact form for the chain map of each cohomology generator (field name `ChainMapRecord`).

**(b)**
The sequence of degrees of cohomology generators (field name `ChainDegrees`).

**(c)**
The tops of the chain maps (maps on modules module radicals) for the purposes of computing products (field name `TopsOfCohomologyGenerators`).

## `DegreesOfCohomologyGenerators(C): Rec -> SeqEnum`

Given the generators $C$ for cohomology, as either module generators or as ring generators, the function returns the list of degrees of the minimal generators.

## `CohomologyGeneratorToChainMap(P, Q, C, n): ModCpx, ModCpx, Rec, RngIntElt -> MapChn`

Given the projective resolutions $P$ and $Q$ of two modules $M$ and $N$ and the cohomology generators $C$ of the cohomology module, ${\rm Ext}_B^*(M,N)$, the function returns the chain map from $P$ to $Q$ that lifts the $n^{th}$ generator of the cohomology module and has degree equal to the degree of that generator.

## `CohomologyGeneratorToChainMap(P, C, n): ModCpx, Tup, RngIntElt -> MapChn`

Given the projective resolution $P$ of a module and the cohomology generators $C$ of the cohomology ring of that module, the function returns the chain map from $P$ to $P$ that lifts the $n^{th}$ generator of the cohomology ring and has degree equal to the degree of that generator.

## `Example: Cohomology 2 (ex-6a7d27)`

We create the Basic algebra for the principal block of the sporadic simple group $M_{11}$ in characteristic 2. The block algebra has three simple modules of dimension 1, 44, and 10. The basic algebra has dimension 22.

```magma
> ff := GF(2);
> VV8 := VectorSpace(ff,8);
> BB8 := Basis(VV8);
> MM8 := MatrixAlgebra(ff,8);
> e11 := MM8!0;
> e12 := MM8!0;
> e13 := MM8!0;
> e11[1]  := BB8[1];
> e11[4]  := BB8[4];
> e11[5]  := BB8[5];
> e11[8]  := BB8[8];
> e12[2]  := BB8[2];
> e12[7]  := BB8[7];
> e13[3]  := BB8[3];
> e13[6]  := BB8[6];
> a1 := MM8!0;
> b1 := MM8!0;
> c1 := MM8!0;
> d1 := MM8!0;
> e1 := MM8!0;
> f1 := MM8!0;
> a1[1] :=  BB8[2];
> a1[5] :=  BB8[7];
> b1[1] :=  BB8[3];
> b1[4] :=  BB8[6];
> c1[2] :=  BB8[4];
> c1[7] :=  BB8[8];
> e1[3] :=  BB8[5];
> e1[6] :=  BB8[8];
> f1[3] :=  BB8[6];
> A1 := sub< MM8 | [e11, e12, e13, a1, b1, c1, d1, e1, f1] >;
> T1 := [ <1,1>,<1,4>,<1,5>,<2,6>,<3,8>,<4,5>,<5,4>,<6,8>];
> VV6 := VectorSpace(ff,6);
> BB6 := Basis(VV6);
> MM6 := MatrixAlgebra(ff,6);
> e21 := MM6!0;
> e22 := MM6!0;
> e23 := MM6!0;
> e22[1]  := BB6[1];
> e22[5]  := BB6[5];
> e22[6]  := BB6[6];
> e21[2]  := BB6[2];
> e21[4]  := BB6[4];
> e23[3]  := BB6[3];
> a2 := MM6!0;
> b2 := MM6!0;
> c2 := MM6!0;
> d2 := MM6!0;
> e2 := MM6!0;
> f2 := MM6!0;
> a2[4] := BB6[6];
> b2[2] := BB6[3];
> c2[1] := BB6[2];
> d2[1] := BB6[5];
> d2[5] := BB6[6];
> e2[3] := BB6[4];
> A2 := sub< MM6 | [e21, e22, e23, a2, b2, c2, d2, e2, f2]>;
> T2 := [ <1,2>, <1,6>, <2,5>, <3,8>, <1,7>, <5,7> ];
> VV8 := VectorSpace(ff,8);
> BB8 := Basis(VV8);
> MM8 := MatrixAlgebra(ff,8);
> e31 := MM8!0;
> e32 := MM8!0;
> e33 := MM8!0;
> e31[2]  := BB8[2];
> e31[6]  := BB8[6];
> e32[4]  := BB8[4];
> e33[1]  := BB8[1];
> e33[3]  := BB8[3];
> e33[5]  := BB8[5];
> e33[7]  := BB8[7];
> e33[8]  := BB8[8];
> a3 := MM8!0;
> b3 := MM8!0;
> c3 := MM8!0;
> d3 := MM8!0;
> e3 := MM8!0;
> f3 := MM8!0;a3[2] :=  BB8[4];
> b3[6] :=  BB8[8];
> b3[2] :=  BB8[7];
> c3[4] :=  BB8[6];
> e3[1] :=  BB8[2];
> e3[3] :=  BB8[6];
> f3[1] :=  BB8[3];
> f3[3] :=  BB8[5];
> f3[5] :=  BB8[7];
> f3[7] :=  BB8[8];
> A3 := sub< MM8 | [e31, e32, e33, a3, b3, c3, d3, e3, f3] >;
> T3 := [ <1,3>,<1,8>,<1,9>,<2,4>,<3,9>,<4,6>,<5,9>,<6,5>];
>
> m11 := BasicAlgebra( [<A1, T1>, <A2, T2>, <A3, T3>] );
> m11;
Basic algebra of dimension 22 over GF(2)
Number of projective modules: 3
Number of generators: 9
> s1 := SimpleModule(m11,1);
> s2 := SimpleModule(m11,2);

```

Now we compute the projective resolutions of the first and second simple modules. Then we find the degrees of their cohomology ring generators.

```magma
> prj1 := CompactProjectiveResolution(s1,20);
> prj2 := CompactProjectiveResolution(s2,20);
> CR1 := CohomologyRingGenerators(prj1);
> CR2 := CohomologyRingGenerators(prj2);
> DegreesOfCohomologyGenerators(CR1);
[ 3, 4, 5 ]
> DegreesOfCohomologyGenerators(CR2);
[ 1, 2 ]

```

Finally we look at the cohomology $\hbox{Ext}(\hbox{\tt s2},\hbox{\tt s1})$ as a left module over the cohomology ring of `s1` and as a right module over the cohomology ring of `s2`.

```magma
> CR12 := CohomologyLeftModuleGenerators(prj1,CR1,prj2);
> DegreesOfCohomologyGenerators(CR12);
[ 1, 2, 3, 4 ]
> CR12 := CohomologyRightModuleGenerators(prj1,prj2,CR2);
> DegreesOfCohomologyGenerators(CR12);
[ 1 ]

```

So as a module over the cohomology ring of `s1` it is generated by 4 elements. But as a module over the cohomology ring of `s2` it is generated by a single element.

Next we get the chain complex for the projective resolution of the first simple module and the chain map for the third generator of the cohomology ring of the first simple module.

```magma
> pj1 := ProjectiveResolution(s1,20);
> pj1;
Basic algebra complex with terms of degree 20 down to 0
Dimensions of terms: 74 66 68 68 60 54 54 54 48 40 40 42 34 26 28 28 20 14 14
   14 8
> gen113 := CohomologyGeneratorToChainMap(pj1,CR1,3);
> gen113;
Basic algebra chain map of degree -5

```

We can compose this with itself.

```magma
> gen113*gen113;
Basic algebra chain map of degree -10

```

Now compute the kernel and the dimensions of the homology of the kernel.

```magma
> Ker, phi := Kernel(gen113);
> Ker, phi;
Basic algebra complex with terms of degree 20 down to 0
Dimensions of terms: 20 15 19 20 20 17 17 20 22 15 17 22 20 15 19 20 20 14 14
14 8
Basic algebra chain map of degree 0
> DimensionsOfHomology(Ker);
[ 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0 ]

```

We apply the same procedure in the case of the cokernel.

```magma
> Cok, mu := Cokernel(gen113);
> Cok, mu;
Basic algebra complex with terms of degree 20 down to 0
Dimensions of terms: 74 66 68 68 60 0 3 5 0 0 3 5 0 0 3 5 0 0 3 5 0
Basic algebra chain map of degree 0
> DimensionsOfHomology(Cok);
[ 0, 0, 0, 27, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2 ]

```

We can also check the image.

```magma
> Imm, theta, gamma := Image(gen113);
> Imm;
Basic algebra complex with terms of degree 20 down to 0
Dimensions of terms: 0 0 0 0 0 54 51 49 48 40 37 37 34 26 25 23 20 14 11 9 8
> DimensionsOfHomology(Imm);
[ 0, 0, 0, 0, 27, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0 ]

```

We can check that certain things make sense.

```magma
> IsChainMap(theta);
true
> IsChainMap(gamma);
true

```

## Ext-Algebras

The ext-algebra of an algebra $B$ is the algebra $Ext_B^*(S,S)$ for $S = S_1 \oplus \dots \oplus S_n$ where $S_1, \dots, S_n$ are all of the simple $B$-modules. In the event that the algebra $B$ had finite global dimension, this is a finite dimensional algebra and we can form its basic algebra.

### `ExtAlgebra(A, n): AlgBas, RngIntElt -> Rec`

The function computes the information on the ext-algebra $B$ of the basic algebra $A$ where the projective resolutions and cohomology have been computed to degree $n$. The function returns a record carrying the data:

**(i)**
A free algebra $F$,

**(ii)**
A list of relations in the elements of $F$, such that the ext-algebra is the quotient $F/I$ where $I$ is the ideal generated by the relations,

**(iii)**
The sequence of chain maps of the generators. Each chain map goes from the projective resolution of one simple module to that of another.

**(iv)**
The sequence of degrees of the generators.

**(v)**
A sequence of sequences of sequences of basis element such the $j^{th}$ element of the $i^{th}$ sequence is a basis of in $Ext^*_A(S_i,S_j)$ where $S_i$ is the $i^{th}$ simple module.

**(vi)**
A basis of the entire ext-algebra, the concatenation of the previous sequences.

**(vii)**
The number of steps of the cohomology that were computed.

**(viii)**
The global dimension that has been computed. This number is smaller than the number of steps only in the case that the global dimension of $A$ is less than $n$, meaning that the $n^{th}$ step in the projective resolution of any simple module is the zero module.

### `BasicAlgebraOfExtAlgebra(ext): Rec -> AlgBas`

The function creates the basic algebra from a computed ext-algebra. The input is the output of the `ExtAlgebra` function. If the ext-algebra is not verified to be finite dimensional by the computation, then an error is returned.

### `BasicAlgebraOfExtAlgebra(A): AlgBas -> AlgBas`

The function forms the basic algebra from a computed ext-algebra of the basic algebra $A$. If no ext-algebra for $A$ has been computed or if the ext-algebra is not verified to be finite dimensional then an error is returned.

### `BasicAlgebraOfExtAlgebra(A, n): AlgBas, RngIntElt -> AlgBas`

The function creates the basic algebra for the ext-algebra of $A$ computed to $n$ steps. If no ext-algebra for $A$ to $n$ steps has been computed then it computes one. If the ext-algebra is not verified to be finite dimensional by the computation, then an error is returned.

### `SumOfBettiNumbersOfSimpleModules(A, n): AlgBas, RngIntElt -> RngIntElt`

This function computes the Betti numbers of all of simple $A$-modules out to degree $n$. This is the dimension of the ext-algebra of $A$ computed to degree $n$.

### `Example: Ext Algebra (ex-0c2786)`

We construct the basic algebra of the algebra $B$ of lower triangular matrices over the field with 5 elements. Note that because the identity element of $B$ is the sum of primitive idempotents of rank 1, $B$ is actually isomorphic to its basic algebra.

```magma
> A := MatrixAlgebra(GF(5),10);
> U := A!0;
> ElementaryMatrix := function(i,j);
>     W := U;
>     W[i,j] := 1;
>     return W;
> end function;
> S := &cat[[ElementaryMatrix(i,j): i in [j .. 10]]:j in [1 .. 10]];
> B := sub<A|S>;
> B;
Matrix Algebra of degree 10 with 55 generators over GF(5)
> C := BasicAlgebra(B);
> C;
Basic algebra of dimension 55 over GF(5)
Number of projective modules: 10
Number of generators: 19

```

Note that $C$ has the same dimension as $B$. The two are isomorphic, though they have different types.

```magma
> SumOfBettiNumbersOfSimpleModules(C,9);
19
> SumOfBettiNumbersOfSimpleModules(C,10);
19

```

From the above we see that $C$ has global dimension at most 9. Consequently, we can compute the basic algebra of its ext-algebra.

```magma
> D:= ExtAlgebra(C,10);
> E := BasicAlgebraOfExtAlgebra(D);
> E;
Basic algebra of dimension 19 over GF(5)
Number of projective modules: 10
Number of generators: 19
> SumOfBettiNumbersOfSimpleModules(E,8);
54
> SumOfBettiNumbersOfSimpleModules(E,9);
55
> SumOfBettiNumbersOfSimpleModules(E,10);
55

```

Here we see that $E$ has global dimension 9. So we compute the basic algebra of its ext-algebra.

```magma
> F := BasicAlgebraOfExtAlgebra(E,10);
> F;
Basic algebra of dimension 55 over GF(5)
Number of projective modules: 10
Number of generators: 19
> G := BasicAlgebraOfExtAlgebra(F,10);
> G;
Basic algebra of dimension 19 over GF(5)
Number of projective modules: 10
Number of generators: 19

```

So it would appear that $C$ and $F$ are isomorphic as well as $E$ and $G$.
