--==================================================================-- -- Tutorial 3: Length and Some Exact Sequences -- --==================================================================-- -- Use C-x 2 to get a horizontally split window or -- Use C-x 3 to get a vertically split window. -- Select the lower (or right) window and Hit F12 to start M2. -- Hit F11 to send code from this screen to M2. -- for help with M2 type (works in version 1.1) viewHelp ---------------------------------------------------------------------- -- Length and Homogenous Modules -- ---------------------------------------------------------------------- -- In Macaulay 2, length is often computed with the command degree: viewHelp (degree, Module) -- However, the command will not work correctly unless a sufficiently -- nice module is being used. To start, the module needs to be over a -- polynomial ring with coefficients in a field, or a quotient of a -- polynomial ring with coefficients in a field. Finally, the module -- must be of finite length, else Macaulay 2 will give an erroneous -- answer. -- Check this out: Given a module M, you can recover the ring with the -- following command: A = QQ[x,y] M = A^1 ring M -- How can you get Macaulay 2 to tell you if the ring of a module -- contains a field? -- In order for the command degree to compute length, the module in -- question also needs to be homogeneous. Macaulay 2 has a nice -- command that will help you figure out if a module is homogeneous: viewHelp isHomogeneous -- Experiment (or confirm your memory) to find out what it means for a -- polynomial to be homogeneous. When you are done, give a definition -- based on your experiments. A = ZZ/101[x,y,z,w] isHomogeneous(x^2) -- A module is homogeneous if it is generated by homogeneous -- polynomials. A future exercise will show that if one quotients by -- a homogeneous polynomial, then the module will be be generated by -- homogeneous elements. A = ZZ/101[x,y,z,w] isHomogeneous(A^1/ideal(x^2)) isHomogeneous(A^1/ideal(x^2+1)) -- You may wonder why doesn't Macaulay 2 just call "degree" by the -- name "length." In fact, there is a length command: viewHelp (length,Module) -- However, Macaulay 2 is a little confused about how it works: A = ZZ/101[x,y,z,w] M = A^1/(x^2,y^2,z^2,w^2) degree M length M -- D'oh! Let's see if we can figure out what is wrong with Macaulay -- 2's length command. To do this we are going to look at the code. code(length,Module) -- Let's dissect this code a bit: -- The comments just tell you what the snippet is supposed to do and -- where it is actually located on your computer. -- The next line is how you start functions. "length" is the name of -- the function, and "Module" is telling Macaulay 2 what sort of thing -- the input should be. -- The next line is trying to see if M is homogeneous. -- The line after that is checking to see if length is infinite. -- Macaulay 2 does this the command "dim" which computes the Krull -- dimension of a ring or module. Unfortunately, we probably will not -- have time to discuss Krull dimension. -- The final line just uses degree like we were doing above. -- Let's make a new function based on the code above called "l" which -- actually works. Here I've simplified the first line of code (it is -- still correct) and just copied the remaining lines. Run the code -- below: l = M -> ( if not isHomogeneous then notImplemented(); if dim M > 0 then return infinity; degree M) -- Now try: l M -- You should get the same error you got before. Fix the code above -- so that we get a function l which will compute the length of a -- module. -- Think about what restriction are needed to use degree to compute -- length. Add some more lines to your code above to make your l -- function more user-friendly. -- Show off your l function by trying it out on some examples. -- Using your l function, can you start to predict which modules will -- have finite length? ---------------------------------------------------------------------- -- Exact Sequences -- ---------------------------------------------------------------------- -- Run the following code: A = ZZ/101[x,y,z] m = ideal vars A C = res m -- What we have here is sequence of A-modules and A-module -- homomorphisms. We can extract the maps via this code: C.dd_1 -- gives the map from 1 to 0 C.dd_2 -- gives the map from 2 to 1 C.dd_3 -- gives the map from 3 to 2 C.dd_4 -- gives the map from 4 to 3 -- Each of the above maps is a matrix. Verify that the above sequence -- is exact at all positions except position 0. -- Could you extend the sequence, by adding another module and module -- homomorphism, so that the sequence is exact at position 0? Hint: viewHelp chainComplex --==================================================================-- -- FIN -- --==================================================================--