-- -*- M2-comint -*- hash: 15969085493113187541

i1 : R = QQ[a..f];

i2 : m = matrix{{a,b,d,e},{b,c,e,f}}

o2 = | a b d e |
     | b c e f |

             2      4
o2 : Matrix R  <-- R

i3 : M = coker m

o3 = cokernel | a b d e |
              | b c e f |

                            2
o3 : R-module, quotient of R

i4 : N = image m

o4 = image | a b d e |
           | b c e f |

                             2
o4 : R-module, submodule of R

i5 : K = kernel m

o5 = image {1} | cd-be  0      e2-df  ce-bf  |
           {1} | -bd+ae e2-df  0      -be+af |
           {1} | b2-ac  -ce+bf -be+af 0      |
           {1} | 0      cd-be  bd-ae  b2-ac  |

                             4
o5 : R-module, submodule of R

i6 : presentation M -- this is just the original matrix

o6 = | a b d e |
     | b c e f |

             2      4
o6 : Matrix R  <-- R

i7 : presentation N -- this one requires computation

o7 = {1} | cd-be  0      e2-df  ce-bf  |
     {1} | -bd+ae e2-df  0      -be+af |
     {1} | b2-ac  -ce+bf -be+af 0      |
     {1} | 0      cd-be  bd-ae  b2-ac  |

             4      4
o7 : Matrix R  <-- R

i8 : ideal(a,b)*N

o8 = image | a2 ab ad ae ab b2 bd be |
           | ab ac ae af b2 bc be bf |

                             2
o8 : R-module, submodule of R

i9 : a*N + b*N

o9 = image | a2 ab ad ae ab b2 bd be |
           | ab ac ae af b2 bc be bf |

                             2
o9 : R-module, submodule of R

i10 : N0 = image (a**N_{1}|N_{2}-N_{3})

o10 = image | ab d-e |
            | ac e-f |

                              2
o10 : R-module, submodule of R

i11 : N_{1}

o11 = {1} | 0 |
      {1} | 1 |
      {1} | 0 |
      {1} | 0 |

                    1
o11 : Matrix N <-- R

i12 : a ** N_{1}

o12 = {1} | 0 |
      {1} | a |
      {1} | 0 |
      {1} | 0 |

                    1
o12 : Matrix N <-- R

i13 : a ** N_{1} | N_{2}-N_{3}

o13 = {1} | 0 0  |
      {1} | a 0  |
      {1} | 0 1  |
      {1} | 0 -1 |

                    2
o13 : Matrix N <-- R

i14 : N0 = image(a ** N_{1} | N_{2}-N_{3})

o14 = image | ab d-e |
            | ac e-f |

                              2
o14 : R-module, submodule of R

i15 : isHomogeneous N0

o15 = true

i16 : Nbar = N/N0

o16 = subquotient (| a b d e |, | ab d-e |)
                   | b c e f |  | ac e-f |

                                2
o16 : R-module, subquotient of R

i17 : I = ideal(a^2, a*b, c^2)

              2        2
o17 = ideal (a , a*b, c )

o17 : Ideal of R

i18 : J = module I

o18 = image | a2 ab c2 |

                              1
o18 : R-module, submodule of R

i19 : I == ideal J

o19 = true

i20 : codim I

o20 = 2

i21 : codim J

o21 = 0

i22 : C = res I

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

o22 : ChainComplex

i23 : C.dd

           1                    3
o23 = 0 : R  <---------------- R  : 1
                | a2 ab c2 |

           3                          3
      1 : R  <---------------------- R  : 2
                {2} | -b -c2 0   |
                {2} | a  0   -c2 |
                {2} | 0  a2  ab  |

           3                  1
      2 : R  <-------------- R  : 3
                {3} | c2 |
                {4} | -b |
                {4} | a  |

           1
      3 : R  <----- 0 : 4
                0

o23 : ChainComplexMap

i24 : betti C

             0 1 2 3
o24 = total: 1 3 3 1
          0: 1 . . .
          1: . 3 1 .
          2: . . 2 1

o24 : BettiTally

i25 : C = res Nbar

       4      6      2
o25 = R  <-- R  <-- R  <-- 0
                            
      0      1      2      3

o25 : ChainComplex

i26 : betti C

             0 1 2
o26 = total: 4 6 2
          0: . 1 .
          1: 4 1 .
          2: . 4 2

o26 : BettiTally

i27 : C.dd

           4                                                               6
o27 = 0 : R  <----------------------------------------------------------- R  : 1
                {1} | 0  0 ce-bf -cd+be+ce-bf e2-df       0           |
                {1} | 0  a -be   bd-be        0           e2-df       |
                {1} | -1 0 b2-ac 0            bd-ae-be+af cd-be-ce+bf |
                {1} | 1  0 0     0            0           0           |

           6                         2
      1 : R  <--------------------- R  : 2
                {1} | 0     0   |
                {2} | e2-df 0   |
                {3} | -d+e  e-f |
                {3} | -e    f   |
                {3} | b     -c  |
                {3} | -a    b   |

           2
      2 : R  <----- 0 : 3
                0

o27 : ChainComplexMap

i28 : R = QQ[a..h];

i29 : J = ideal(a*c+b*d,a*e+b*f,a*g+b*h)

o29 = ideal (a*c + b*d, a*e + b*f, a*g + b*h)

o29 : Ideal of R

i30 : betti res J

             0 1 2 3
o30 = total: 1 3 4 2
          0: 1 . . .
          1: . 3 . .
          2: . . 4 2

o30 : BettiTally

i31 : use ring M

o31 = QQ[a..f]

o31 : PolynomialRing

i32 : M

o32 = cokernel | a b d e |
               | b c e f |

                                             2
o32 : QQ[a..f]-module, quotient of (QQ[a..f])

i33 : N = a*M

o33 = subquotient (| a 0 |, | a b d e |)
                   | 0 a |  | b c e f |

                                                2
o33 : QQ[a..f]-module, subquotient of (QQ[a..f])

i34 : M/N

o34 = cokernel | a 0 a b d e |
               | 0 a b c e f |

                                             2
o34 : QQ[a..f]-module, quotient of (QQ[a..f])

i35 : generators N

o35 = | a 0 |
      | 0 a |

                       2               2
o35 : Matrix (QQ[a..f])  <-- (QQ[a..f])

i36 : relations N

o36 = | a b d e |
      | b c e f |

                       2               4
o36 : Matrix (QQ[a..f])  <-- (QQ[a..f])

i37 : presentation N

o37 = {1} | e d b a |
      {1} | f e c b |

                       2               4
o37 : Matrix (QQ[a..f])  <-- (QQ[a..f])

i38 : trim N

o38 = subquotient (| a 0 |, | e d b a |)
                   | 0 a |  | f e c b |

                                                2
o38 : QQ[a..f]-module, subquotient of (QQ[a..f])

i39 : minimalPresentation N

o39 = cokernel {1} | e d b a |
               {1} | f e c b |

                                             2
o39 : QQ[a..f]-module, quotient of (QQ[a..f])

i40 : prune N

o40 = cokernel {1} | e d b a |
               {1} | f e c b |

                                             2
o40 : QQ[a..f]-module, quotient of (QQ[a..f])

i41 : ambient N

                2
o41 = (QQ[a..f])

o41 : QQ[a..f]-module, free

i42 : ambient N == target generators N

o42 = true

i43 : ambient N == target relations N

o43 = true

i44 : super N

o44 = cokernel | a b d e |
               | b c e f |

                                             2
o44 : QQ[a..f]-module, quotient of (QQ[a..f])

i45 : super N == coker relations N

o45 = true

i46 : cover N

                2
o46 = (QQ[a..f])

o46 : QQ[a..f]-module, free, degrees {2:1}

i47 : cover N == source generators N

o47 = true

i48 : A = QQ[x,y]/(y^2-x^3)

o48 = A

o48 : QuotientRing

i49 : M = module ideal(x,y)

o49 = image | x y |

                              1
o49 : A-module, submodule of A

i50 : F = map(A^1,M,matrix{{y,x^2}})

o50 = | y x2 |

              1
o50 : Matrix A  <-- M

i51 : source F == M

o51 = true

i52 : target F == A^1

o52 = true

i53 : matrix F

o53 = | y x2 |

              1      2
o53 : Matrix A  <-- A

i54 : inducedMap(A^1,M)

o54 = | x y |

              1
o54 : Matrix A  <-- M

i55 : G = F // inducedMap(A^1,M)

o55 = {1} | 0 x |
      {1} | 1 0 |

o55 : Matrix M <-- M

i56 : source G

o56 = image | x y |

                              1
o56 : A-module, submodule of A

i57 : target G

o57 = image | x y |

                              1
o57 : A-module, submodule of A

i58 : isWellDefined G

o58 = true

i59 : R = QQ[x,y,z,w]

o59 = R

o59 : PolynomialRing

i60 : M = ideal(x,y,z)/ideal(x^2,y^2,z*w)

o60 = subquotient (| x y z |, | x2 y2 zw |)

                                1
o60 : R-module, subquotient of R

i61 : N = z*M

o61 = subquotient (| xz yz z2 |, | x2 y2 zw |)

                                1
o61 : R-module, subquotient of R

i62 : M/N

o62 = subquotient (| x y z |, | xz yz z2 x2 y2 zw |)

                                1
o62 : R-module, subquotient of R

i63 : M

o63 = subquotient (| x y z |, | x2 y2 zw |)

                                1
o63 : R-module, subquotient of R

i64 : ambient M

       1
o64 = R

o64 : R-module, free

i65 : N = z*M

o65 = subquotient (| xz yz z2 |, | x2 y2 zw |)

                                1
o65 : R-module, subquotient of R

i66 : ambient(M/N)

       1
o66 = R

o66 : R-module, free

i67 : super M

o67 = cokernel | x2 y2 zw |

                             1
o67 : R-module, quotient of R

i68 : super N

o68 = cokernel | x2 y2 zw |

                             1
o68 : R-module, quotient of R

i69 : image generators M

o69 = image | x y z |

                              1
o69 : R-module, submodule of R

i70 : inducedMap(M,M) == id_M

o70 = true

i71 : inducedMap(super M,M) == map(super id_M) -- the map $(P+Q)/Q \to R^n/Q$, where $M=(P+Q)/Q$.

o71 = true

i72 : inducedMap(super M,ambient M) -- the quotient map $R^n \to R^n/Q$

o72 = | 1 |

o72 : Matrix

i73 : inducedMap(M,N) -- the inclusion map

o73 = {1} | z 0 0 |
      {1} | 0 z 0 |
      {1} | 0 0 z |

o73 : Matrix M <-- N

i74 : inducedMap(M/N,M) -- the projection map

o74 = {1} | 1 0 0 |
      {1} | 0 1 0 |
      {1} | 0 0 1 |

o74 : Matrix

i75 : inducedMap(M/N,N) -- the zero map

o75 = 0

o75 : Matrix

i76 : inducedMap(M,M/N,Verify => false)

o76 = {1} | 1 0 0 |
      {1} | 0 1 0 |
      {1} | 0 0 1 |

o76 : Matrix

i77 : inducedMap(M/N,x*M)

o77 = {1} | 0 y 0 |
      {1} | 0 0 0 |
      {1} | 0 0 0 |

o77 : Matrix

i78 : inducedMap(M/N,M) * inducedMap(M,x*M) == inducedMap(M/N,x*M)

o78 = true

i79 : A = QQ[x,y,Degrees=>{2,3}]/(y^2-x^3)

o79 = A

o79 : QuotientRing

i80 : M = module ideal(x,y)

o80 = image | x y |

                              1
o80 : A-module, submodule of A

i81 : H = Hom(M,M)

o81 = image {-2} | x y  |
            {-3} | y x2 |

                              2
o81 : A-module, submodule of A

i82 : F = homomorphism(H_{0})

o82 = {2} | 1 0 |
      {3} | 0 1 |

o82 : Matrix M <-- M

i83 : G = homomorphism(H_{1})

o83 = {2} | 0 x |
      {3} | 1 0 |

o83 : Matrix M <-- M

i84 : source F == M

o84 = true

i85 : target F == M

o85 = true

i86 : ker F

o86 = image 0

                              1
o86 : A-module, submodule of A

i87 : coker F

o87 = subquotient (| x y |, | x y |)

                                1
o87 : A-module, subquotient of A

i88 : m = matrix{{x,y},{y,x}}

o88 = | x y |
      | y x |

              2      2
o88 : Matrix A  <-- A

i89 : Hom(m,A^2)

o89 = {-3} | x 0 y 0 |
      {-3} | 0 x 0 y |
      {-3} | y 0 x 0 |
      {-3} | 0 y 0 x |

              4      4
o89 : Matrix A  <-- A

i90 : Hom(A^2,m)

o90 = | x y 0 0 |
      | y x 0 0 |
      | 0 0 x y |
      | 0 0 y x |

              4      4
o90 : Matrix A  <-- A

i91 : m ** m

o91 = | x2 xy xy y2 |
      | xy x2 y2 xy |
      | xy y2 x2 xy |
      | y2 xy xy x2 |

              4      4
o91 : Matrix A  <-- A

i92 : (coker m) ** (coker m)

o92 = cokernel | x y 0 0 x y 0 0 |
               | y x 0 0 0 0 x y |
               | 0 0 x y y x 0 0 |
               | 0 0 y x 0 0 y x |

                             4
o92 : A-module, quotient of A

i93 : M = coker m

o93 = cokernel | x y |
               | y x |

                             2
o93 : A-module, quotient of A

i94 : M2 = prune(M ** M)

o94 = cokernel | 0  -x y x x 0 |
               | -x 0  x y 0 x |
               | x  0  0 0 y 0 |
               | 0  x  0 0 0 y |

                             4
o94 : A-module, quotient of A

i95 : A = QQ[a,b,c]

o95 = A

o95 : PolynomialRing

i96 : A ** A

o96 = QQ[a , b , c , a , b , c ]
          0   0   0   1   1   1

o96 : PolynomialRing

i97 : tensor(A,A,Variables=>{a,b,c,d,e,f})

o97 = QQ[a..f]

o97 : PolynomialRing

i98 : 
