# Bimodules

## Introduction

For a field $K$ and groups $G$ and $H$, a $(KG,\ KH)$-bimodule is a vector space over $K$ equipped with a left $G$-action and a right $H$-action.

In the Magma implementation, $(KG,KH)$-bimodules are regarded as being equivalent to standard right $K(G \times H)$-modules, where

- the right action of $H$ in the bimodule is the same as the right action of $H$ in the equivalent $K(G \times H)$-module; and

- the left action of $G$ in the bimodule is related to the right action of $G$ in the equivalent $K(G \times H)$-module by $g^{-1}*v = v*g$ for all $g \in G$ and $v$ in the common underlying $K$-vector space.

Most of the functionality for standard right $KG$-modules, such as forming sub- and quotient modules, defining homomorphisms, etc, should also work for $(KG,KH)$-modules, where results are calculated using the equivalent $K(G \times H)$-module. But note that there is no requirement for the groups $G$ and $H$ to have the same type.

## Construction

### `Bimodule(M, N): ModGrp, ModGrp -> LRModGrp`

Inputs $M$ and $N$ should be $KG$- and $KH$-modules of the same dimension, such that the actions of $G$ and $H$ commute; i.e. $(v * g) * h = (v * h) * g$ for all $g \in G$, $h \in H$, and $v$ in the common underlying $K$-vector space $V$ of $M$ and $N$. An error will result if this condition is not satisfied.

The corresponding bimodule is returned in which $g^{-1} * v = v * g$ for all $g \in G$ and $v \in V$.

### `Example: Small Bimodule (ex-31c812)`

```magma
> G:=Sym(3);
> H:=CyclicGroup(2);
> M:=PermutationModule(G,GF(3));
> S:=ScalarMatrix(3, GF(3)!2);
> N:=GModule(H,[S]);
> B:=Bimodule(M,N);
> B;
Bimodule B of dimension 3 over GF(3)
> M.1 * G.1;
M: (0 1 0)
> G.1^-1 * B.1;
B: (0 1 0)
> GHom(B,B);
KMatrixSpace of 3 by 3 matrices and dimension 2 over GF(3)
> #Submodules(B);
4

```

It is often more convenient to construct a bimodule directly from the equivalent $K(G~\times~H)$-module.

### `Bimodule(G, H, M): Grp, Grp, ModGrp -> LRModGrp`

Inputs $G$ and $H$ should be groups, and $M$ should be a $(G \times H)$-module. The equivalent $(KG,KH)$-bimodule is constructed.

### `Example: Dp Bimodule (ex-5e5954)`

```magma
> X := DirectProduct(Sym(4), Alt(5));
> I := IrreducibleModules(X, GF(3));
> M12 := I[9];
> M12;
GModule M12 of dimension 12 over GF(3)
> B := Bimodule(Sym(4), Alt(5), M12);
> B;
Bimodule B of dimension 12 over GF(3)
> IsIrreducible(B);
true

```

### `LeftBimodule(M): ModGrp -> LRModGrp`

$M$ should be a $KG$-module. The corresponding $(KG,KT)$-bimodule is returned in which $T$ is the trivial group and $g^{-1} * v = v * g$ for all $g \in G$ and $v \in V$.

### `RightBimodule(M): ModGrp -> LRModGrp`

$M$ should be a $KH$-module. The corresponding $(KT,KH)$-bimodule is returned in which $T$ is the trivial group.

## Extracting the Left and Right Modules From a Bimodule

### `LeftOppositeModule(B): LRModGrp -> ModGrp`

Extract the equivalent right $KG$-module $M$ from the $(KG,KH)$-bimodule $B$, where $g^{-1} * v = v * g$ for $g \in G$, and $v$ in the common $K$-vector space $V$ of $B$ and $M$.

### `RightModule(B): LRModGrp -> ModGrp`

Extract the equivalent right $KH$-module $M$ from the $(KG,KH)$-bimodule $B$.

### `Example: Dp Bimodule Cont (ex-022d8f)`

We continue with the previous example, and check the property $g^{-1} * v = v * g$ for all $g \in G$ and $v \in V$.

```magma
> ML := LeftOppositeModule(B);
> ML;
GModule ML of dimension 12 over GF(3)
> G := Group(ML);
> G;
Symmetric group G acting on a set of cardinality 4
Order = 24 = 2^3 * 3
    (1, 2, 3, 4)
    (1, 2)
> V := VectorSpace(B);
> forall{<i,j> : i in [1..2], j in [1..12] |
>                                V!(G.i^-1*B.j) eq V!(ML.j*G.i)};
true

```

## Permutation Bimodules

### `PermutationBimodule(G, H, m, K): Grp, Grp, Map, Fld -> LRModGrp`

The last argument $K$ should be a field, $G$ and $H$ should be groups, and $m$ should be a homomorphism from a subgroup $A$ of $G$ to $H$.

Let $Y$ be the subgroup $\{ (a,m(a)) : a \in A\}$ of $G \times H$, and let $M$ be the $K(G \times H)$-permutation module defined by the image of the action of $G \times H$ on the right cosets of $Y$. The $(KG,KH)$-bimodule corresponding to $M$ is returned.

### `Example: permbimodule (ex-791051)`

```magma
> G := Sym(3);
> H := CyclicGroup(6);
> PG := Sylow(G,3);
> PH := Sylow(H,3);
> m := hom<PG -> PH | [PH.1] >;
> K := GF(3);
> B := PermutationBimodule(G,H,m,K);
> B;
Bimodule B of dimension 12 over GF(3)
> GHom(B,B);
KMatrixSpace of 12 by 12 matrices and dimension 8 over GF(3)

```

## Tensor Products of Bimodules

### `TensorProduct(B1, B2): LRModGrp, LRModGrp -> LRModGrp`

The arguments $B_1$ and $B_2$ are, respectively, $(KG,KH)$- and $(KH,KJ)$-bimodules for the groups $G,H,J$. The $(KG,KJ)$-bimodule $B_1 \otimes_{KH} B_2$ is returned.

### `Example: induction (ex-f17ecc)`

Let $H$ be a subgroup of a group $G$, and $M$ be a right $KH$-module. Then $M \otimes_{KH} KG$ is (by definition) equal to the induced module $M^G$.

This is not a sensible way to construct induced modules in practice, but we can use it as an example of the use of the tensor product of bimodules. We regard $M$ as a $(KT,KH)$-bimodule, where $T$ is the trivial group, and $KH$ as a $(KH,KG)$-bimodule.

```magma
>  G := Sym(5);
>  H := Stabiliser(G,5);
>  K := GF(5);
>  M := IrreducibleModules(H,K)[4];
>  M;
GModule M of dimension 3 over GF(5)
>  B1 := RightBimodule(M);
>  //make KG as right G-module
>  eG := [ g: g in G ];
>  mats := [];
>  for i in [1..Ngens(G)] do
>    perm := Sym(#G)![Position(eG, g*G.i) : g in eG ];
>    Append(~mats, PermutationMatrix(K,perm));
>  end for;
>  RM := GModule(G,mats);
>  //and as left H-module
>  mats := [];
>  for i in [1..Ngens(H)] do
>    perm := Sym(#G)![Position(eG, H.i*g) : g in eG ];
>    Append(~mats, PermutationMatrix(K,perm)^-1);
>  end for;
>  LM := GModule(H,mats);
>  B2 := Bimodule(LM,RM);
>  T := TensorProduct(B1,B2);
>  T;
Bimodule T of dimension 15 over GF(5)
>  IsIsomorphic(RightModule(T), Induction(M,G));
true

```
