-- Examples from the M2 session during the workshop.
-- For general information on, downloading and the documentation of
-- Macaulay2, visit http://www.math.uiuc.edu/Macaulay2/
-- (Two dashes in a line declares that the rest of the line is a comment.)
kk = ZZ/32749 -- setting up notation.
-- Example 1. Koszul complex on the variables
S = kk[x,y,z]
mS = ideal vars S
K = resolution mS
K.dd
betti K
regularity mS
regularity K
-- Example 2. Three points in P^2 in general position
restart
S = kk[x,y,z]
I = ideal "xy, yz, xz"
F = resolution I
F.dd
betti F
regularity I
regularity F
-- Example 3. 2x3 maximal minors
restart
S = kk[x_(0,0)..x_(1,2)]
apply(2, i -> apply(3, j -> x_(i,j)))
M = matrix oo
I = minors(2, M)
F = resolution I
F.dd
betti F
regularity I
regularity F
-- Example 4. 3x3 minors of a 4x5 matrix
restart
S = kk[x_(0,0)..x_(3,4)]
M = matrix apply(4, i -> apply(5, j -> x_(i,j)))
I = minors(3, M)
F = resolution I
-- F.dd (Not a good idea!)
betti F
regularity I
regularity F
-- Example 5. Hilbert functions, Hilbert series and Hilbert polynomials
restart
S = kk[x,y,z]
I = ideal "xy, yz, xz"
hilbertSeries I -- numerator is the alternating sum obtained from the Betti table
HS = reduceHilbert hilbertSeries I
hilbertPolynomial I
-- Example 6. Mapping cones
restart
S = kk[x..z]
I = ideal "xy, yz, xz"
F = resolution I
G = resolution (S^{-1}/(I:x))
phi = extend(F,G, map(F_0, G_0, matrix{{x}}))
C = cone phi
minPres HH C
-- Example 7. A coherent sheaf on P^3
restart
S = kk[w..z]
P3 = Proj S
F = sheaf cokernel random(S^{4:1}, S^1) -- Do you know which sheaf this is?
loadPackage "BGG" -- for cohomologyTable
cohomologyTable (F, -5, 10)
-- Example 8. on P^3.
restart
S = kk[w..z]
P3 = Proj S
-- C = twisted cubic in P3
IC = kernel map (kk[s,t], S, matrix{{s^3, s^2*t, s*t^2, t^3}})
OC = sheaf (S/IC)
J = intersect (IC, power(ideal vars S, 3))
G = sheaf (S^1/J)
HH^0(OC(>=-3))
HH^0(G(>=-3))
loadPackage "BGG" -- for cohomologyTable
cohomologyTable (sheaf module OC, -5, 10) -- cohomologyTable applies to only CoherentSheaf (as O_P3-module) and not to SheafOfRings
cohomologyTable (G, -5, 10)
regularity (S^1/IC)
regularity (S^1/J)
-- Example 8. Complete intersection of two quadrics in P^3
restart
S = kk[w..z]
P3 = Proj S
OC = sheaf coker random(S^1, S^{2:-2}) -- define OC directly as a CoherentSheaf (as O_P3 module) and not as SheafOfRings.
HH^0(OC(>=-3))
loadPackage "BGG" -- for cohomologyTable
cohomologyTable (OC, -5, 10)