Homomorphisms

Throughout this part of the chapter, when discussing the set of all R-homomorphisms from the R-module M into the R-module N, it will be assumed that R is a commutative ring. We further assume that M and N are free R-modules and that bases for these modules are present. The module HomR(M, N) will be identified with the module of m x n matrices over R. Thus, an element of HomR(M, N) is represented as a matrix relative to the bases of the generic modules corresponding to M and N. For this reason, we will refer to these modules as matrix modules.

We remind the reader that submodules of HomR(M, N) are always presented in embedded form. If the user wishes to have submodules presented in reduced form then he/she should use the natural isomorphism between R(m x n) and R(mn).

It should be noted that essentially operation defined for tuple modules, their elements and submodules applies to matrix modules. Thus, all of the operations discussed earlier in this chapter apply to matrix modules.

The modules M and N may themselves be matrix modules. In this case, the resulting matrix module has either a right or left action and an element belonging to it transforms a (homomorphism) element of M into a (homomorphism) element of N.

The function Reduce may be used to construct for a matrix module H the matrix module H' equivalent to H whose elements are with respect to the actual bases of the domain and codomain of elements of H (not the generic bases of the domain and codomain).

Contents

HomR(M, N) for R-modules

Hom(M, N) : ModTupRng, ModTupRng -> ModMatRng
If M is the tuple module R(m) and N is the tuple module R(n), create the module HomR(M, N) as the (R, R)-bimodule R(m x n), represented as the set of all m x n matrices over R. The module is created with the standard basis, {Eij | i = 1 ..., m, j = 1 ..., n}, where Eij is the matrix having a 1 in the (i, j)-th position and zeros elsewhere.
RMatrixSpace(R, m, n) : Rng, RngIntElt, RngIntElt -> ModMatRng
Given a ring R and positive integers m and n, construct H = Hom(M, N), where M = R(m) and N = R(n), as the free (R, R)-bimodule R(m x n), consisting of all m x n matrices over R. The module is created with the standard basis, {Eij | i = 1 ..., m, j = 1 ..., m}. Note that the modules M and N are created by this function and may be accessed as Domain(H) and Codomain(H), respectively.

Example ModRng_Create (H59E5)

We construct the vector spaces V and W of dimensions 3 and 4, respectively, over the field of two elements and then define M to be the module of homomorphisms from V into W.
> F2 := GaloisField(2);
> V  := VectorSpace(F2, 3);
> W  := VectorSpace(F2, 4);
> M  := Hom(V, W);
> M;
Full KMatrixSpace of 3 by 4 matrices over GF(2)

HomR(M, N) for Matrix Modules

Hom(M, N, "right") : ModMatRng, ModMatRng, MonStgElt -> ModMatRng
Suppose M is a matrix module over the coefficient ring R whose elements are a by b matrices and have domain D and codomain C. Suppose also that N is a matrix module over the coefficient ring R whose elements are a by c matrices and have domain D and codomain C'. Then the homomorphism module H = Hom(M, N) with right multiplication action exists and consists of all b by c matrices over R which multiply an element of M on the right to yield an element of N. This function constructs H explicitly. The domain of elements of H is then M and the codomain of elements of H is N and the elements are b by c matrices over R which multiply an element of M on the right to yield an element of N. Note that if M and N are proper submodules of their respective generic modules, then H may be a proper submodule of its generic module, and the correct basis of H will be explicitly constructed.
Hom(M, N, "left") : ModMatRng, ModMatRng, MonStgElt -> ModMatRng
Suppose M is a matrix module over the coefficient ring R whose elements are a by c matrices and have domain D and codomain C. Suppose also that N is a matrix module over the coefficient ring R whose elements are b by c and have domain D' and codomain C. Then the homomorphism module H = Hom(M, N) with left multiplication action exists and consists of all b by a matrices over R which multiply an element of M on the left to yield an element of N. This function constructs H explicitly. The domain of elements of H is then M and the codomain of elements of H is N and the elements are b by a matrices over R which multiply an element of M on the right to yield an element of N. Note that if M and N are proper submodules of their respective generic modules, then H may be a proper submodule of its generic module, and the correct basis of H will be explicitly constructed.

Example ModRng_CreateHom (H59E6)

We construct two homomorphism modules H1 and H2 over Q and then the homomorphism module H = Hom(H1, H2) with right matrix action.
> Q := RationalField();
> H1 := sub<RMatrixSpace(Q, 2, 3) | [1,2,3, 4,5,6], [0,0,1, 1,3,3]>;
> H2 := sub<RMatrixSpace(Q, 2, 4) | [6,5,7,1, 15,14,16,4], [0,0,0,0, 1,2,3,4]>;
> H := Hom(H1, H2, "right");
> H: Maximal;
KMatrixSpace of 3 by 4 matrices and dimension 1 over Rational Field
Echelonized basis:
[   1    2    3    4]
[-1/2   -1 -3/2   -2]
[   0    0    0    0]
> H1.1 * H.1;
[  0   0   0   0]
[3/2   3 9/2   6]
> H1.1 * H.1 in H2;
true
> Image(H.1): Maximal;
KMatrixSpace of 2 by 4 matrices and dimension 1 over Rational Field
Echelonized basis:
[0 0 0 0]
[1 2 3 4]
> Kernel(H.1): Maximal;
KMatrixSpace of 2 by 3 matrices and dimension 1 over Rational Field
Echelonized basis:
[ 1  2  6]
[ 7 14 15]
> H1 := sub<RMatrixSpace(Q,2,3) | [1,2,3, 4,5,6]>;
> H2 := sub<RMatrixSpace(Q,3,3) | [1,2,3, 5,7,9, 4,5,6]>;
> H := Hom(H1, H2, "left");
> H: Maximal;
KMatrixSpace of 3 by 2 matrices and dimension 1 over Rational Field
Echelonized basis:
[1 0]
[1 1]
[0 1]
> Image(H.1);
KMatrixSpace of 3 by 3 matrices and dimension 1 over Rational Field
> Kernel(H.1);
KMatrixSpace of 2 by 3 matrices and dimension 0 over Rational Field

Modules HomR(M, N) with Given Basis

RMatrixSpaceWithBasis(Q) : [ ModMatRngElt ] -> ModMatRng
Given a sequence Q of k independent matrices each lying in a matrix space H = Hom(M, N), where M = R(m) and N = R(n), construct the subspace of H of dimension k whose basis is Q. The basis is echelonized internally but all functions which depend on the basis of the matrix space (e.g. Coordinates) will use the given basis Q.
KMatrixSpaceWithBasis(Q) : [ ModMatRngElt ] -> ModMatRng
Given a sequence Q of k independent matrices each lying in a matrix space H = Hom(M, N), where M = K(m) and N = K(n), with K a field, construct the subspace of H of dimension k whose basis is Q. The basis is echelonized internally but all functions which depend on the basis of the matrix space (e.g. Coordinates) will use the given basis Q.

The Endomorphism Ring

EndomorphismAlgebra(M) : ModTupRng -> AlgMat
If M is the free R-module R(m), create the matrix algebra Matm(R). The algebra is created with the standard basis, {Eij | i = 1 ..., m, j = 1 ..., m}, where Eij is the matrix having a 1 in the (i, j)-th position and zeros elsewhere.

Example ModRng_CreateHom (H59E7)

We construct the endomorphism ring of the 4-dimensional vector space over the rational field.
> Q  := RationalField();
> R4 := RModule(Q, 4);
> M  := EndomorphismAlgebra(R4);
> M;
Full Matrix Algebra of degree 4 over Rational Field

The Reduced Form of a Matrix Module

Reduce(H) : ModMatRng -> ModMatRng, Map
Suppose H is a matrix module whose elements have domain A and codomain B. Suppose first that A and B are tuple modules (R-spaces, R-modules, or RG-modules) and that A has degree a and dimension d while B has degree b and dimension e. (For the reduced cases (R-modules or RG-modules), a equals d and b equals e). The elements of H have the natural representation with respect to the standard embedded basis of the generic modules of A and B. Thus H has degree a by b. So one can multiply a 1 by a vector of A directly by an element h of H (in the natural matrix way) to get a 1 by b vector of B. Now suppose A and B are in the embedded form (R-space) and h is in H. Then h is an a by b matrix but there is a corresponding d by e matrix h' which gives the same transformation of h from A to B but is with respect to the bases of A and B. We call h' the reduced form of h. Also, there is the reduced module H' corresponding to H. This function constructs the reduced module H' corresponding to H, together with the epimorphism f from H onto H'. Note that if A and B are in reduced form, then H' is the same as H.

Suppose secondly that A and B are matrix modules themselves. Suppose A = Hom(D1, C1), B = Hom(D1, C2), and H = Hom(A, B) with the right multiplication action. Suppose also that A has degree r by s and dimension d while B has degree r by t, and dimension e. Then H would have degree s by t so an element h of H would be s by t and would multiply a r by s element of A on the right to yield an r by t element of B. Then the reduced matrix h' corresponding to a matrix h of H would be a d by e matrix corresponding to the bases of A and B. This function similarly constructs the reduced module H' corresponding to H, together with the epimorphism f from H onto H'. Note also that in this case the domain and codomains of H' are the generic R-spaces (tuple modules) corresponding to A (of dimension d) and B (of dimension e). Similarly, for the left multiplication action there is the corresponding reduced module constructed in the obvious way.

Note also that the kernel of the epimorphism f is the submodule of H which consists of all matrices which transform all elements of A to the zero element of B.

Example ModRng_Reduce (H59E8)

We demonstrate the function Reduce for a homomorphism module from one vector space to another.
> V1 := sub<VectorSpace(GF(3), 3) | [1,0,1], [0,1,2]>;
> V2 := sub<VectorSpace(GF(3), 4) | [1,1,0,2], [0,0,1,2]>;
> H := Hom(V1, V2);
> H;
KMatrixSpace of 3 by 4 matrices and dimension 8 over GF(3)
> R, f := Reduce(H);
> R;
Full KMatrixSpace of 2 by 2 matrices over GF(3)
> H.1;
[1 0 0 0]
[0 1 0 2]
[0 1 0 2]
> f(H.1);
[1 0]
[0 0]
> V1.1;
(1 0 1)
> V1.1 * H.1;
(1 1 0 2)
> Coordinates(V2, V1.1 * H.1);
[ 1, 0 ]
> Coordinates(V2, V1.2 * H.1);
[ 0, 0 ]
> Kernel(f): Maximal;
KMatrixSpace of 3 by 4 matrices and dimension 4 over GF(3)
Echelonized basis:
[1 0 0 0]
[2 0 0 0]
[2 0 0 0]
[0 1 0 0]
[0 2 0 0]
[0 2 0 0]
[0 0 1 0]
[0 0 2 0]
[0 0 2 0]
[0 0 0 1]
[0 0 0 2]
[0 0 0 2]
> R.1@@f;
[1 0 0 0]
[0 1 0 2]
[0 1 0 2]

Example ModRng_ReduceHom (H59E9)

We demonstrate the function Reduce for a homomorphism module from one homomorphism module to another. Note that the reduced module has the same dimension as the original module but larger degrees!
> V1 := VectorSpace(GF(3), 2);
> V2 := VectorSpace(GF(3), 3);
> V3 := VectorSpace(GF(3), 4);
> H1 := Hom(V1, V2);
> H2 := Hom(V1, V3);
> H := Hom(H1, H2, "right");
> H1;
Full KMatrixSpace of 2 by 3 matrices over GF(3)
> H2;
Full KMatrixSpace of 2 by 4 matrices over GF(3)
> H;
Full KMatrixSpace of 3 by 4 matrices over GF(3)
> R,f := Reduce(H);
> R;
KMatrixSpace of 6 by 8 matrices and dimension 12 over GF(3)
> X := H.1;
> X;
[1 0 0 0]
[0 0 0 0]
[0 0 0 0]
> f(X);
[1 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0]
[0 0 0 0 1 0 0 0]
[0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0]
> Domain(X);
Full KMatrixSpace of 2 by 3 matrices over GF(3)
> Domain(f(X));
Full Vector space of degree 6 over GF(3)
> Image(X): Maximal;
KMatrixSpace of 2 by 4 matrices and dimension 2 over GF(3)
Echelonized basis:
[1 0 0 0]
[0 0 0 0]
[0 0 0 0]
[1 0 0 0]
> Image(f(X));
Vector space of degree 8, dimension 2 over GF(3)
Echelonized basis:
(1 0 0 0 0 0 0 0)
(0 0 0 0 1 0 0 0)
> Kernel(X): Maximal;
KMatrixSpace of 2 by 3 matrices and dimension 4 over GF(3)
Echelonized basis:
[0 1 0]
[0 0 0]
[0 0 1]
[0 0 0]
[0 0 0]
[0 1 0]
[0 0 0]
[0 0 1]
> Kernel(f(X)): Maximal;
Vector space of degree 6, dimension 4 over GF(3)
Echelonized basis:
(0 1 0 0 0 0)
(0 0 1 0 0 0)
(0 0 0 0 1 0)
(0 0 0 0 0 1)

Construction of a Matrix

M ! Q : ModMatRng, [RngElt] -> ModMatRngElt
Given the matrix bimodule M over the ring R, and the sequence Q = [a11, ..., a1n, a21, ..., a2n, ..., am1, ..., amn] whose terms are elements of the ring R, construct the m x n matrix
   [ a_11  a_12 ... a_1n ]
   [ a_21  a_22 ... a_2n ]
   [       ...           ]
   [       ...           ]
   [ a_m1  a_m2 ... a_mn ]
as an element of M. In the context of the sub or quo constructors the coercion clause M ! may be omitted.

Example ModRng_Matrix (H59E10)

We create the 4 x 4 Hilbert matrix h4 as an element of the endomorphism ring of the 4-dimensional vector space over the rational field.
> Q  := RationalField();
> R4 := RModule(Q, 4);
> M  := EndomorphismAlgebra(R4);
> h4 := M ! [ 1/i : i in [1 .. 16 ] ];
> h4;
[   1  1/2  1/3  1/4]
[ 1/5  1/6  1/7  1/8]
[ 1/9 1/10 1/11 1/12]
[1/13 1/14 1/15 1/16]

Element Operations

All operations that apply to elements of tuple modules also apply to elements of matrix modules. Here, we confine our discussion to those operations which are special to matrix modules.

Throughout this section, M is a submodule of R(m), N is a submodule of R(n) and a is a homomorphism belonging to HomR(M, N), where R is a Euclidean Domain.

See also the chapter on general matrices for many other functions applicable to matrices (e.g., EchelonForm).

u * a : ModTupRngElt, ModMatRngElt -> ModTupRngElt
a(u) : ModTupRngElt, ModMatRngElt -> ModTupRngElt
Given an element u belonging to the module M, return the image of u under the homomorphism a as an element of the module N.
a * b : ModMatRngElt, ModMatRngElt -> ModMatRngElt
Given a homomorphism a belonging to a submodule of Hom(M, N), and a homomorphism b belonging to a submodule of Hom(N, P), return the composition of the homomorphisms a and b as an element of Hom(M, P). Note that if Hom(M, P) does not already exist, it will be created.
a ^ -1 : ModMatRngElt, RngIntElt -> ModMatRngElt
Given a homomorphism a belonging to a submodule of Hom(M, N) with M and N having the same dimension, return the inverse of a as an element of Hom(N, M).
Codomain(S) : ModMatRng -> ModTupRng
Given a submodule S of the module Hom(M, N), return the module N.
Codomain(a) : ModMatRngElt -> ModTupRng
The codomain N of the homomorphism a belonging to Hom(M, N).
Cokernel(a) : ModMatRngElt -> ModTupRng
The cokernel for the homomorphism a belonging to the module Hom(M, N).
Domain(S) : ModMatRng -> ModTupRng
The domain M of the submodule S belonging to the module Hom(M, N).
Domain(a) : ModMatRngElt -> ModTupRng
The domain M of the homomorphism a belonging to the module Hom(M, N).
Image(a) : ModMatRngElt -> ModTupRng
The image of the homomorphism a belonging to the module H =Hom(M, N), returned as a submodule of N. Note that if the domain and codomain of a are matrix modules themselves, the image will be with respect to the appropriate action (right or left).
Kernel(a) : ModMatRngElt -> ModTupRng
NullSpace(a) : ModMatRngElt -> ModTupRng
The kernel of the homomorphism a belonging to the module Hom(M, N), returned as a submodule of M. Note that if the domain and codomain of a are matrix modules themselves, the kernel will be with respect to the appropriate action (right or left).
Morphism(M, N) : ModTupRng, ModTupRng -> ModMatRngElt
Assuming the R-module M was created as a submodule of the module N, return the matrix defining the inclusion homomorphism φ : M -> N as an element of HomR(M, N). Thus φ gives the correspondence between elements of M (represented with respect to the standard basis of M) and elements for N.
Rank(a) : ModMatRngElt -> RngIntElt
The dimension of the image of the homomorphism a, i.e. the rank of a.
IsBijective(a) : ModMatRngElt -> BoolElt
Returns true if the homomorphism a belonging to the module Hom(M, N) is a bijective mapping.
IsInjective(a) : ModMatRngElt -> BoolElt
Returns true if the homomorphism a belonging to the module Hom(M, N) is an injective mapping.
IsSurjective(a) : ModMatRngElt -> BoolElt
Returns true if the homomorphism a belonging to the module HomR(M, N) is a surjective mapping.

Example ModRng_Operations (H59E11)

We illustrate some of these operations in the context of the module HomR(M, N), where M and N are, respectively, the 4-dimensional and 3-dimensional vector spaces over GF(8).
> K<w> := GaloisField(8);
> V3 := VectorSpace(K, 3);
> V4 := VectorSpace(K, 4);
> M := Hom(V4, V3);
> A := M ! [1, w, w^5, 0,  w^3, w^4, w, 1,  w^6, w^3, 1, w^4 ];
> A;
[  1   w w^5]
[  0 w^3 w^4]
[  w   1 w^6]
[w^3   1 w^4]
> Rank(A);
3
> Image(A);
Full Vector space of degree 3 over GF(2^3)
> Kernel(A);
Vector space of degree 4, dimension 1 over GF(2^3)
Echelonized basis:
(  1 w^5   1   1)
> Cokernel(A);
Vector space of degree 3, dimension 0 over GF(2^3)
V2.28, 13 July 2023