next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
Complexes :: complex

complex -- make a chain or cochain complex

Synopsis

Description

A complex is a sequence of objects (e.g. modules), connected by maps called differentials. The composition of any two consecutive maps is zero.

The same data type is used for both chain and cochain complexes. If C is a complex, then we have Ci = C-i.

We construct the Koszul complex on the generators for the ideal of the twisted cubic curve.

i1 : S = ZZ/101[a..d]

o1 = S

o1 : PolynomialRing
i2 : I = ideal(b^2-a*c, b*c-a*d, c^2-b*d)

             2                    2
o2 = ideal (b  - a*c, b*c - a*d, c  - b*d)

o2 : Ideal of S
i3 : F1 = map(S^1,,matrix{{I_0, I_1, I_2}})

o3 = | b2-ac bc-ad c2-bd |

             1       3
o3 : Matrix S  <--- S
i4 : F2 = map(source F1,,matrix{
         {0, I_2, -I_1},
         {-I_2, 0, I_0},
         {I_1, -I_0, 0}
         })

o4 = {2} | 0      c2-bd  -bc+ad |
     {2} | -c2+bd 0      b2-ac  |
     {2} | bc-ad  -b2+ac 0      |

             3       3
o4 : Matrix S  <--- S
i5 : F3 = map(source F2,,matrix{{I_0}, {I_1}, {I_2}})

o5 = {4} | b2-ac |
     {4} | bc-ad |
     {4} | c2-bd |

             3       1
o5 : Matrix S  <--- S
i6 : C = complex hashTable{1 => F1, 2 => F2, 3 => F3}

      1      3      3      1
o6 = S  <-- S  <-- S  <-- S
                           
     0      1      2      3

o6 : Complex
i7 : isWellDefined C

o7 = true

Having constructed this complex, we can access individual terms and maps.

i8 : C_2

      3
o8 = S

o8 : S-module, free, degrees {3:4}
i9 : C^(-1)

      3
o9 = S

o9 : S-module, free, degrees {3:2}
i10 : C^(-1) == C_1

o10 = true
i11 : C_7

o11 = 0

o11 : S-module
i12 : dd^C

           1                             3
o12 = 0 : S  <------------------------- S  : 1
                | b2-ac bc-ad c2-bd |

           3                                    3
      1 : S  <-------------------------------- S  : 2
                {2} | 0      c2-bd  -bc+ad |
                {2} | -c2+bd 0      b2-ac  |
                {2} | bc-ad  -b2+ac 0      |

           3                     1
      2 : S  <----------------- S  : 3
                {4} | b2-ac |
                {4} | bc-ad |
                {4} | c2-bd |

o12 : ComplexMap
i13 : dd^C_2

o13 = {2} | 0      c2-bd  -bc+ad |
      {2} | -c2+bd 0      b2-ac  |
      {2} | bc-ad  -b2+ac 0      |

              3       3
o13 : Matrix S  <--- S
i14 : length C

o14 = 3

Often, a complex is most easily described by giving a list of consecutive maps which form the differential.

i15 : C1 = complex{F1,F2,F3}

       1      3      3      1
o15 = S  <-- S  <-- S  <-- S
                            
      0      1      2      3

o15 : Complex
i16 : isWellDefined C1

o16 = true
i17 : C1 == C

o17 = true
i18 : C2 = complex({F1,F2,F3}, Base => 3)

       1      3      3      1
o18 = S  <-- S  <-- S  <-- S
                            
      3      4      5      6

o18 : Complex

By computing the homology of this complex, we see that these generators do not form a regular sequence, because H1(C) is non-zero.

i19 : HH C

o19 = cokernel | b2-ac bc-ad c2-bd | <-- subquotient ({2} | d  c  |, {2} | 0      c2-bd  -bc+ad |) <-- subquotient ({4} | b2-ac |, {4} | b2-ac |) <-- image 0
                                                      {2} | -c -b |  {2} | -c2+bd 0      b2-ac  |                   {4} | bc-ad |  {4} | bc-ad |       
      0                                               {2} | b  a  |  {2} | bc-ad  -b2+ac 0      |                   {4} | c2-bd |  {4} | c2-bd |      3
                                                                                                        
                                         1                                                             2

o19 : Complex
i20 : prune HH C

o20 = cokernel | c2-bd bc-ad b2-ac | <-- cokernel {3} | c  b  a  |
                                                  {3} | -d -c -b |
      0                                   
                                         1

o20 : Complex
i21 : prune HH_1 C

o21 = cokernel {3} | c  b  a  |
               {3} | -d -c -b |

                             2
o21 : S-module, quotient of S

Caveat

This constructor minimizes computation and does very little error checking. To verify that a complex is well constructed, use isWellDefined(Complex).

See also

Ways to use complex :