# betti(Complex) -- display of degrees in a complex

## Synopsis

• Function: betti
• Usage:
betti C
• Inputs:
• C, ,
• Optional inputs:
• Weights => a list, default value null, a list of integers whose dot product with the multidegree of a basis element is enumerated in the display returned. The default is the heft vector of the ring. See heft.
• Minimize => ..., default value false,
• Outputs:
• , a diagram showing the degrees of the generators of the components in C

## Description

Column $j$ of the top row of the diagram gives the rank of the $j$-th component $C_j$ of the complex $C$. The entry in column $j$ in the row labelled $i$ is the number of basis elements of (weighted) degree $i+j$ in $C_j$. When the complex is the free resolution of a module the entries are the total and the graded Betti numbers of the module.

As a first example, we consider the ideal in 18 variables which cuts out the variety of commuting 3 by 3 matrices.

 i1 : S = ZZ/101[vars(0..17)] o1 = S o1 : PolynomialRing i2 : m1 = genericMatrix(S,a,3,3) o2 = | a d g | | b e h | | c f i | 3 3 o2 : Matrix S <--- S i3 : m2 = genericMatrix(S,j,3,3) o3 = | j m p | | k n q | | l o r | 3 3 o3 : Matrix S <--- S i4 : J = ideal(m1*m2-m2*m1) o4 = ideal (d*k + g*l - b*m - c*p, b*j - a*k + e*k + h*l - b*n - c*q, c*j + ------------------------------------------------------------------------ f*k - a*l + i*l - b*o - c*r, - d*j + a*m - e*m + d*n + g*o - f*p, - d*k ------------------------------------------------------------------------ + b*m + h*o - f*q, - d*l + c*m + f*n - e*o + i*o - f*r, - g*j - h*m + ------------------------------------------------------------------------ a*p - i*p + d*q + g*r, - g*k - h*n + b*p + e*q - i*q + h*r, - g*l - h*o ------------------------------------------------------------------------ + c*p + f*q) o4 : Ideal of S i5 : C0 = freeResolution J 1 8 33 60 61 32 5 o5 = S <-- S <-- S <-- S <-- S <-- S <-- S 0 1 2 3 4 5 6 o5 : Complex i6 : betti C0 0 1 2 3 4 5 6 o6 = total: 1 8 33 60 61 32 5 0: 1 . . . . . . 1: . 8 2 . . . . 2: . . 31 32 3 . . 3: . . . 28 58 32 4 4: . . . . . . 1 o6 : BettiTally

From the display, we see that $J$ has 8 minimal generators, all in degree 2, and that there are 2 linear syzygies on these generators, and 31 quadratic syzygies. Since this complex is the free resolution of $S/J$, the projective dimension is 6, the index of the last column, and the regularity of $S/J$ is 4, the index of the last row in the diagram.

 i7 : length C0 o7 = 6 i8 : pdim betti C0 o8 = 6 i9 : regularity betti C0 o9 = 4

The betti display still makes sense if the complex is not a free resolution.

 i10 : betti dual C0 -6 -5 -4 -3 -2 -1 0 o10 = total: 5 32 61 60 33 8 1 -4: 1 . . . . . . -3: 4 32 58 28 . . . -2: . . 3 32 31 . . -1: . . . . 2 8 . 0: . . . . . . 1 o10 : BettiTally i11 : C1 = Hom(C0, image matrix{{a,b}}); i12 : betti C1 -6 -5 -4 -3 -2 -1 0 o12 = total: 10 64 122 120 66 16 2 -3: 2 . . . . . . -2: 8 64 116 56 . . . -1: . . 6 64 62 . . 0: . . . . 4 16 . 1: . . . . . . 2 o12 : BettiTally i13 : C1_-6 o13 = image {-9} | 0 0 b a 0 0 0 0 0 0 | {-9} | 0 0 0 0 b a 0 0 0 0 | {-9} | 0 0 0 0 0 0 b a 0 0 | {-9} | 0 0 0 0 0 0 0 0 b a | {-10} | b a 0 0 0 0 0 0 0 0 | 5 o13 : S-module, submodule of S

This module has 10 generators, 2 in degree $-9=(-6)+(-3)$, and 8 in degree $-8=(-6)+(-2)$.

In the multi-graded case, the heft vector is used, by default, as the weight vector for weighting the components of the degree vectors of basis elements.

The following example is a nonstandard $\mathbb{Z}$-graded polynomial ring.

 i14 : R = ZZ/101[a,b,c,Degrees=>{-1,-2,-3}]; i15 : heft R o15 = {-1} o15 : List i16 : C2 = freeResolution coker vars R 1 3 3 1 o16 = R <-- R <-- R <-- R 0 1 2 3 o16 : Complex i17 : betti C2 0 1 2 3 o17 = total: 1 3 3 1 0: 1 1 . . 1: . 1 1 . 2: . 1 1 . 3: . . 1 1 o17 : BettiTally i18 : betti(C2, Weights => {1}) 0 1 2 3 o18 = total: 1 3 3 1 -9: . . . 1 -8: . . . . -7: . . 1 . -6: . . 1 . -5: . . 1 . -4: . 1 . . -3: . 1 . . -2: . 1 . . -1: . . . . 0: 1 . . . o18 : BettiTally

The following example is the Cox ring of the second Hirzebruch surface, and the complex is the free resolution of the irrelevant ideal.

 i19 : T = QQ[a,b,c,d,Degrees=>{{1,0},{-2,1},{1,0},{0,1}}]; i20 : B = intersect(ideal(a,c),ideal(b,d)) o20 = ideal (b*c, a*b, c*d, a*d) o20 : Ideal of T i21 : C3 = freeResolution B 1 4 4 1 o21 = T <-- T <-- T <-- T 0 1 2 3 o21 : Complex i22 : dd^C3 1 4 o22 = 0 : T <------------------- T : 1 | ab bc ad cd | 4 4 1 : T <--------------------------- T : 2 {-1, 1} | -c -d 0 0 | {-1, 1} | a 0 0 -d | {1, 1} | 0 b -c 0 | {1, 1} | 0 0 a b | 4 1 2 : T <------------------ T : 3 {0, 1} | d | {-1, 2} | -c | {2, 1} | -b | {-1, 2} | a | o22 : ComplexMap i23 : heft T o23 = {1, 3} o23 : List i24 : betti C3 0 1 2 3 o24 = total: 1 4 4 1 0: 1 . . . 1: . 2 1 . 2: . . . . 3: . 2 3 1 o24 : BettiTally i25 : betti(C3, Weights => {1,0}) 0 1 2 3 o25 = total: 1 4 4 1 -3: . . 2 1 -2: . 2 1 . -1: . . . . 0: 1 2 1 . o25 : BettiTally i26 : betti(C3, Weights => {0,1}) 0 1 2 3 o26 = total: 1 4 4 1 -1: . . 2 1 0: 1 4 2 . o26 : BettiTally i27 : degrees C3_1 o27 = {{-1, 1}, {-1, 1}, {1, 1}, {1, 1}} o27 : List