# compose -- composition as a pairing on Hom-modules

## Synopsis

• Usage:
compose(M, N, P)
• Inputs:
• M, ,
• N, ,
• P, ,
• Outputs:
• , the composition map of homomorphism modules $\mathrm{Hom}(M,N)$ and $\mathrm{Hom}(N,P)$

## Description

In the following example we check that the map does implement the composition map $$\mathrm{Hom}(M,N) \otimes \mathrm{Hom}(N,P) \to \mathrm{Hom}(M,P).$$

 i1 : R = QQ[x,y] o1 = R o1 : PolynomialRing i2 : M = image vars R ++ R^2 o2 = image | x y 0 0 | | 0 0 1 0 | | 0 0 0 1 | 3 o2 : R-module, submodule of R i3 : f = compose(M,M,M); o3 : Matrix i4 : H = Hom(M,M); i5 : g = H_{0} o5 = {0} | 1 | {0} | 0 | {0} | 0 | {0} | 0 | {0} | 0 | {0} | 0 | {0} | 0 | {1} | 0 | {1} | 0 | {1} | 0 | {1} | 0 | 1 o5 : Matrix H <-- R i6 : h = homomorphism g o6 = {1} | 1 0 0 0 | {1} | 0 1 0 0 | {0} | 0 0 0 0 | {0} | 0 0 0 0 | o6 : Matrix M <-- M i7 : f * (g ** g) o7 = {0} | 1 | {0} | 0 | {0} | 0 | {0} | 0 | {0} | 0 | {0} | 0 | {0} | 0 | {1} | 0 | {1} | 0 | {1} | 0 | {1} | 0 | 1 o7 : Matrix H <-- R i8 : h' = homomorphism oo o8 = {1} | 1 0 0 0 | {1} | 0 1 0 0 | {0} | 0 0 0 0 | {0} | 0 0 0 0 | o8 : Matrix M <-- M i9 : h' === h * h o9 = true i10 : assert oo

The modules should be defined over the same ring.

• Hom -- module of homomorphisms
• homomorphism -- get the homomorphism from element of Hom
• homomorphism' -- get the element of Hom from a homomorphism