# cokernel(ComplexMap) -- make the cokernel of a map of complexes

## Synopsis

• Function: cokernel
• Usage:
cokernel f
coker f
• Inputs:
• f, ,
• Outputs:
• ,

## Description

If $f : C \to D$ is a map of chain complexes of degree $d$, then the cokernel is the complex $E$ whose $i-th$ is $cokernel(f_{i-d})$, and whose differential is induced from the differential on the target.

In the following example, we first construct a random complex morphism $f : C \to D$. We consider the exact sequence $0 \to D \to cone(f) \to C[-1] \to 0$. For the maps $g : D \to cone(f)$ and $h : cone(f) \to C[-1]$, we compute the kernel.

 i1 : S = ZZ/101[a,b,c,d]; i2 : C = freeResolution ideal(b^2-a*c, b*c-a*d, c^2-b*d) 1 3 2 o2 = S <-- S <-- S 0 1 2 o2 : Complex i3 : D = freeResolution ideal(a,b,c) 1 3 3 1 o3 = S <-- S <-- S <-- S 0 1 2 3 o3 : Complex i4 : f = randomComplexMap(D, C, Cycle => true, InternalDegree => 0) 1 1 o4 = 0 : S <----------- S : 0 | -22 | 3 3 1 : S <------------------------------------------------ S : 1 {1} | 36b+3c 30b-19c+22d -29b-10c | {1} | -36a-22b+29c -30a-14c 29a+29c+22d | {1} | 19a-29b 19a-8b 10a-29b-22c | 3 2 2 : S <--------------------------------------------- S : 2 {2} | -29a-30b+31c-22d 29b+6c-36d | {2} | -10a+24b+3c 34b-19c+19d | {2} | 24a-8b+29c -24a-29b-14c-29d | o4 : ComplexMap i5 : Cf = cone f 1 4 6 3 o5 = S <-- S <-- S <-- S 0 1 2 3 o5 : Complex i6 : g = canonicalMap(Cf, D) 1 1 o6 = 0 : S <--------- S : 0 | 1 | 4 3 1 : S <----------------- S : 1 {0} | 0 0 0 | {1} | 1 0 0 | {1} | 0 1 0 | {1} | 0 0 1 | 6 3 2 : S <----------------- S : 2 {2} | 0 0 0 | {2} | 0 0 0 | {2} | 0 0 0 | {2} | 1 0 0 | {2} | 0 1 0 | {2} | 0 0 1 | 3 1 3 : S <------------- S : 3 {3} | 0 | {3} | 0 | {3} | 1 | o6 : ComplexMap i7 : h = canonicalMap(C[-1], Cf) 1 4 o7 = 1 : S <--------------- S : 1 | 1 0 0 0 | 3 6 2 : S <----------------------- S : 2 {2} | 1 0 0 0 0 0 | {2} | 0 1 0 0 0 0 | {2} | 0 0 1 0 0 0 | 2 3 3 : S <----------------- S : 3 {3} | 1 0 0 | {3} | 0 1 0 | o7 : ComplexMap i8 : prune coker g == C[-1] o8 = true i9 : coker h == 0 o9 = true

There is a canonical map of complexes from the target to the cokernel.

 i10 : g1 = canonicalMap(coker g, target g) 1 o10 = 0 : cokernel | 1 | <----- S : 0 0 4 1 : cokernel {0} | 0 0 0 | <------------------- S : 1 {1} | 1 0 0 | {0} | 1 0 0 0 | {1} | 0 1 0 | {1} | 0 0 0 0 | {1} | 0 0 1 | {1} | 0 0 0 0 | {1} | 0 0 0 0 | 6 2 : cokernel {2} | 0 0 0 | <----------------------- S : 2 {2} | 0 0 0 | {2} | 1 0 0 0 0 0 | {2} | 0 0 0 | {2} | 0 1 0 0 0 0 | {2} | 1 0 0 | {2} | 0 0 1 0 0 0 | {2} | 0 1 0 | {2} | 0 0 0 0 0 0 | {2} | 0 0 1 | {2} | 0 0 0 0 0 0 | {2} | 0 0 0 0 0 0 | 3 3 : cokernel {3} | 0 | <----------------- S : 3 {3} | 0 | {3} | 1 0 0 | {3} | 1 | {3} | 0 1 0 | {3} | 0 0 0 | o10 : ComplexMap i11 : coker g == image g1 o11 = true i12 : coker g1 == 0 o12 = true