Macaulay2 » Documentation
Packages » Complexes :: arithmetic with complex maps
next | previous | forward | backward | up | index | toc

arithmetic with complex maps -- perform arithmetic operations on complex maps

Synopsis

The set of complex maps forms a module over the underlying ring. These methods implement the basic operations of addition, subtraction, and scalar multiplication.

i1 : R = ZZ/101[a..d];
i2 : C = freeResolution coker matrix{{a*b, a*c^2, b*c*d^3, a^3}}

      1      4      4      1
o2 = R  <-- R  <-- R  <-- R
                           
     0      1      2      3

o2 : Complex
i3 : D = freeResolution coker matrix{{a*b, a*c^2, b*c*d^3, a^3, a*c*d}}

      1      5      7      4      1
o3 = R  <-- R  <-- R  <-- R  <-- R
                                  
     0      1      2      3      4

o3 : Complex
i4 : f = randomComplexMap(D, C, Cycle => true)

          1               1
o4 = 0 : R  <----------- R  : 0
               | -47 |

          5                                                                                          4
     1 : R  <-------------------------------------------------------------------------------------- R  : 1
               {2} | -47 0   0   24a3-36a2b-30a2c+19ac2+19bc2-10c3-29a2d-8acd-22bcd+43c2d-24cd2 |
               {3} | 0   -47 0   -24ab+36b2+30bc+18c2+29bd+15cd                                 |
               {3} | 0   0   -47 -18a2-19ab-19b2+10bc-8ad-5bd-19cd+47d2                         |
               {3} | 0   0   0   -15a2+8ab+22b2+8ac-38bc+19c2+24bd-47cd                         |
               {5} | 0   0   0   -47                                                            |

          7                                                                     4
     2 : R  <----------------------------------------------------------------- R  : 2
               {4} | -47 0   0    -24a2+36ab+30ac+39c2+29ad+43cd           |
               {4} | 0   -47 -28d 43a2-19ab+10ac+29ad-38bd-16cd+39d2       |
               {4} | 0   0   28c  -35a2+22ab+29ac+38bc+16c2+24ad-39cd-47d2 |
               {4} | 0   0   -28b 21a2+34ab-38b2+19ac-16bc-47ad+39bd       |
               {5} | 0   0   -47  -18a+39b+13d                             |
               {5} | 0   0   0    -15a+43b-13c                             |
               {6} | 0   0   0    -47                                      |

          4                    1
     3 : R  <---------------- R  : 3
               {5} | -28b |
               {6} | -47  |
               {6} | 0    |
               {6} | 0    |

o4 : ComplexMap
i5 : g = randomComplexMap(D, C, Boundary => true)

          1         1
o5 = 0 : R  <----- R  : 0
               0

          5                                                                                    4
     1 : R  <-------------------------------------------------------------------------------- R  : 1
               {2} | 0 0 0 -38a3-2a2b-16a2c-45ac2+34bc2+48c3-22a2d-47acd-19bcd-38c2d-7cd2 |
               {3} | 0 0 0 38ab+2b2+16bc+17c2+22bd+11cd                                   |
               {3} | 0 0 0 -17a2+45ab-34b2-48bc-15ad-24bd-39cd-43d2                       |
               {3} | 0 0 0 -11a2+47ab+19b2+15ac-39bc+39c2+7bd+43cd                        |
               {5} | 0 0 0 0                                                              |

          7                                                            4
     2 : R  <-------------------------------------------------------- R  : 2
               {4} | 0 0 0    38a2+2ab+16ac-38c2+22ad+33cd        |
               {4} | 0 0 48d  -18a2-34ab-48ac-47ad+36bd+35cd+11d2 |
               {4} | 0 0 -48c 14a2+19ab-16ac-36bc-35c2+7ad-11cd   |
               {4} | 0 0 48b  -25a2-23ab+36b2+39ac+35bc+43ad+11bd |
               {5} | 0 0 0    -17a-38b-40d                        |
               {5} | 0 0 0    -11a+33b+40c                        |
               {6} | 0 0 0    0                                   |

          4                   1
     3 : R  <--------------- R  : 3
               {5} | 48b |
               {6} | 0   |
               {6} | 0   |
               {6} | 0   |

o5 : ComplexMap
i6 : f+g

          1               1
o6 = 0 : R  <----------- R  : 0
               | -47 |

          5                                                                                           4
     1 : R  <--------------------------------------------------------------------------------------- R  : 1
               {2} | -47 0   0   -14a3-38a2b-46a2c-26ac2-48bc2+38c3+50a2d+46acd-41bcd+5c2d-31cd2 |
               {3} | 0   -47 0   14ab+38b2+46bc+35c2-50bd+26cd                                   |
               {3} | 0   0   -47 -35a2+26ab+48b2-38bc-23ad-29bd+43cd+4d2                         |
               {3} | 0   0   0   -26a2-46ab+41b2+23ac+24bc-43c2+31bd-4cd                         |
               {5} | 0   0   0   -47                                                             |

          7                                                                    4
     2 : R  <---------------------------------------------------------------- R  : 2
               {4} | -47 0   0    14a2+38ab+46ac+c2-50ad-25cd             |
               {4} | 0   -47 20d  25a2+48ab-38ac-18ad-2bd+19cd+50d2       |
               {4} | 0   0   -20c -21a2+41ab+13ac+2bc-19c2+31ad-50cd-47d2 |
               {4} | 0   0   20b  -4a2+11ab-2b2-43ac+19bc-4ad+50bd        |
               {5} | 0   0   -47  -35a+b-27d                              |
               {5} | 0   0   0    -26a-25b+27c                            |
               {6} | 0   0   0    -47                                     |

          4                   1
     3 : R  <--------------- R  : 3
               {5} | 20b |
               {6} | -47 |
               {6} | 0   |
               {6} | 0   |

o6 : ComplexMap
i7 : f-g

          1               1
o7 = 0 : R  <----------- R  : 0
               | -47 |

          5                                                                                          4
     1 : R  <-------------------------------------------------------------------------------------- R  : 1
               {2} | -47 0   0   -39a3-34a2b-14a2c-37ac2-15bc2+43c3-7a2d+39acd-3bcd-20c2d-17cd2 |
               {3} | 0   -47 0   39ab+34b2+14bc+c2+7bd+4cd                                      |
               {3} | 0   0   -47 -a2+37ab+15b2-43bc+7ad+19bd+20cd-11d2                          |
               {3} | 0   0   0   -4a2-39ab+3b2-7ac+bc-20c2+17bd+11cd                            |
               {5} | 0   0   0   -47                                                            |

          7                                                                    4
     2 : R  <---------------------------------------------------------------- R  : 2
               {4} | -47 0   0    39a2+34ab+14ac-24c2+7ad+10cd            |
               {4} | 0   -47 25d  -40a2+15ab-43ac-25ad+27bd+50cd+28d2     |
               {4} | 0   0   -25c -49a2+3ab+45ac-27bc-50c2+17ad-28cd-47d2 |
               {4} | 0   0   25b  46a2-44ab+27b2-20ac+50bc+11ad+28bd      |
               {5} | 0   0   -47  -a-24b-48d                              |
               {5} | 0   0   0    -4a+10b+48c                             |
               {6} | 0   0   0    -47                                     |

          4                   1
     3 : R  <--------------- R  : 3
               {5} | 25b |
               {6} | -47 |
               {6} | 0   |
               {6} | 0   |

o7 : ComplexMap
i8 : -f

          1              1
o8 = 0 : R  <---------- R  : 0
               | 47 |

          5                                                                                        4
     1 : R  <------------------------------------------------------------------------------------ R  : 1
               {2} | 47 0  0  -24a3+36a2b+30a2c-19ac2-19bc2+10c3+29a2d+8acd+22bcd-43c2d+24cd2 |
               {3} | 0  47 0  24ab-36b2-30bc-18c2-29bd-15cd                                   |
               {3} | 0  0  47 18a2+19ab+19b2-10bc+8ad+5bd+19cd-47d2                           |
               {3} | 0  0  0  15a2-8ab-22b2-8ac+38bc-19c2-24bd+47cd                           |
               {5} | 0  0  0  47                                                              |

          7                                                                  4
     2 : R  <-------------------------------------------------------------- R  : 2
               {4} | 47 0  0    24a2-36ab-30ac-39c2-29ad-43cd           |
               {4} | 0  47 28d  -43a2+19ab-10ac-29ad+38bd+16cd-39d2     |
               {4} | 0  0  -28c 35a2-22ab-29ac-38bc-16c2-24ad+39cd+47d2 |
               {4} | 0  0  28b  -21a2-34ab+38b2-19ac+16bc+47ad-39bd     |
               {5} | 0  0  47   18a-39b-13d                             |
               {5} | 0  0  0    15a-43b+13c                             |
               {6} | 0  0  0    47                                      |

          4                   1
     3 : R  <--------------- R  : 3
               {5} | 28b |
               {6} | 47  |
               {6} | 0   |
               {6} | 0   |

o8 : ComplexMap
i9 : 3*f

          1               1
o9 = 0 : R  <----------- R  : 0
               | -40 |

          5                                                                                           4
     1 : R  <--------------------------------------------------------------------------------------- R  : 1
               {2} | -40 0   0   -29a3-7a2b+11a2c-44ac2-44bc2-30c3+14a2d-24acd+35bcd+28c2d+29cd2 |
               {3} | 0   -40 0   29ab+7b2-11bc-47c2-14bd+45cd                                    |
               {3} | 0   0   -40 47a2+44ab+44b2+30bc-24ad-15bd+44cd+40d2                         |
               {3} | 0   0   0   -45a2+24ab-35b2+24ac-13bc-44c2-29bd-40cd                        |
               {5} | 0   0   0   -40                                                             |

          7                                                                    4
     2 : R  <---------------------------------------------------------------- R  : 2
               {4} | -40 0   0    29a2+7ab-11ac+16c2-14ad+28cd            |
               {4} | 0   -40 17d  28a2+44ab+30ac-14ad-13bd-48cd+16d2      |
               {4} | 0   0   -17c -4a2-35ab-14ac+13bc+48c2-29ad-16cd-40d2 |
               {4} | 0   0   17b  -38a2+ab-13b2-44ac-48bc-40ad+16bd       |
               {5} | 0   0   -40  47a+16b+39d                             |
               {5} | 0   0   0    -45a+28b-39c                            |
               {6} | 0   0   0    -40                                     |

          4                   1
     3 : R  <--------------- R  : 3
               {5} | 17b |
               {6} | -40 |
               {6} | 0   |
               {6} | 0   |

o9 : ComplexMap
i10 : 0*f

o10 = 0

o10 : ComplexMap
i11 : a*f

           1                1
o11 = 0 : R  <------------ R  : 0
                | -47a |

           5                                                                                                    4
      1 : R  <------------------------------------------------------------------------------------------------ R  : 1
                {2} | -47a 0    0    24a4-36a3b-30a3c+19a2c2+19abc2-10ac3-29a3d-8a2cd-22abcd+43ac2d-24acd2 |
                {3} | 0    -47a 0    -24a2b+36ab2+30abc+18ac2+29abd+15acd                                  |
                {3} | 0    0    -47a -18a3-19a2b-19ab2+10abc-8a2d-5abd-19acd+47ad2                         |
                {3} | 0    0    0    -15a3+8a2b+22ab2+8a2c-38abc+19ac2+24abd-47acd                         |
                {5} | 0    0    0    -47a                                                                  |

           7                                                                               4
      2 : R  <--------------------------------------------------------------------------- R  : 2
                {4} | -47a 0    0     -24a3+36a2b+30a2c+39ac2+29a2d+43acd             |
                {4} | 0    -47a -28ad 43a3-19a2b+10a2c+29a2d-38abd-16acd+39ad2        |
                {4} | 0    0    28ac  -35a3+22a2b+29a2c+38abc+16ac2+24a2d-39acd-47ad2 |
                {4} | 0    0    -28ab 21a3+34a2b-38ab2+19a2c-16abc-47a2d+39abd        |
                {5} | 0    0    -47a  -18a2+39ab+13ad                                 |
                {5} | 0    0    0     -15a2+43ab-13ac                                 |
                {6} | 0    0    0     -47a                                            |

           4                     1
      3 : R  <----------------- R  : 3
                {5} | -28ab |
                {6} | -47a  |
                {6} | 0     |
                {6} | 0     |

o11 : ComplexMap
i12 : assert(0*f == 0)
i13 : assert(1*f == f)
i14 : assert((-1)*f == -f)
i15 : assert(-(f-g) == g-f)
i16 : assert((a+b)*f == a*f + b*f)
i17 : assert(a*(f+g) == a*f + a*g)
i18 : assert isComplexMorphism (f+g)

Adding or subtracting a scalar is the same as adding or subtracting the scalar multiple of the identity. In particular, the source and target must be equal.

i19 : h = randomComplexMap(C, C)

           1              1
o19 = 0 : R  <---------- R  : 0
                | 11 |

           4                                                                                                                                                              4
      1 : R  <---------------------------------------------------------------------------------------------------------------------------------------------------------- R  : 1
                {2} | 46 -28a+b-3c+22d -7a+2b+29c-47d -13a3-10a2b+39ab2-20b3+30a2c+27abc+24b2c+32ac2-48bc2-18a2d-22abd-30b2d-9acd-15bcd+33c2d-32ad2+39bd2-49cd2-33d3 |
                {3} | 0  -47           15             -19a2+17ab-39b2-20ac+36bc-39c2+44ad+9bd+4cd+13d2                                                               |
                {3} | 0  -23           -37            -26a2+22ab-8b2-49ac+43bc+36c2-11ad-8bd-3cd-22d2                                                                |
                {5} | 0  0             0              -30                                                                                                            |

           4                                                                                        4
      2 : R  <------------------------------------------------------------------------------------ R  : 2
                {4} | 41 -28 35a-9b-35c+6d  -41a2-49ab+30b2-13ac-47bc-40c2+4ad+27bd+37cd-35d2  |
                {4} | 16 -6  40a+3b-31c+25d -31a2-39ab-29b2-31ac-48bc-37c2-48ad+30bd+47cd-49d2 |
                {5} | 0  0   -2             28a-18b+46c+d                                      |
                {6} | 0  0   0              40                                                 |

           1                   1
      3 : R  <--------------- R  : 3
                {6} | -22 |

o19 : ComplexMap
i20 : h+1

           1              1
o20 = 0 : R  <---------- R  : 0
                | 12 |

           4                                                                                                                                                              4
      1 : R  <---------------------------------------------------------------------------------------------------------------------------------------------------------- R  : 1
                {2} | 47 -28a+b-3c+22d -7a+2b+29c-47d -13a3-10a2b+39ab2-20b3+30a2c+27abc+24b2c+32ac2-48bc2-18a2d-22abd-30b2d-9acd-15bcd+33c2d-32ad2+39bd2-49cd2-33d3 |
                {3} | 0  -46           15             -19a2+17ab-39b2-20ac+36bc-39c2+44ad+9bd+4cd+13d2                                                               |
                {3} | 0  -23           -36            -26a2+22ab-8b2-49ac+43bc+36c2-11ad-8bd-3cd-22d2                                                                |
                {5} | 0  0             0              -29                                                                                                            |

           4                                                                                        4
      2 : R  <------------------------------------------------------------------------------------ R  : 2
                {4} | 42 -28 35a-9b-35c+6d  -41a2-49ab+30b2-13ac-47bc-40c2+4ad+27bd+37cd-35d2  |
                {4} | 16 -5  40a+3b-31c+25d -31a2-39ab-29b2-31ac-48bc-37c2-48ad+30bd+47cd-49d2 |
                {5} | 0  0   -1             28a-18b+46c+d                                      |
                {6} | 0  0   0              41                                                 |

           1                   1
      3 : R  <--------------- R  : 3
                {6} | -21 |

o20 : ComplexMap
i21 : assert(h+1 == h + id_C)
i22 : assert(h+a == h + a*id_C)
i23 : assert(1-h == id_C - h)
i24 : assert(b-c*h == -c*h + b*id_C)
i25 : assert(b-h*c == -h*c + id_C*b)

Arithmetic on differentials can be a useful method for constructing new chain complexes.

i26 : E = complex(-dd^C)

       1      4      4      1
o26 = R  <-- R  <-- R  <-- R
                            
      0      1      2      3

o26 : Complex
i27 : isWellDefined E

o27 = true
i28 : assert(dd^E == map(E, E, -dd^C))

See also