-- A line starting with two hyphens "--" is a "comment". -- This is invisible to the computer program, -- but useful to any human readers! -- The following rings are important: -- ZZ: the integers -- QQ: the rational numbers -- RR: the real numbers (really just approximations) -- CC: the complex numbers (really just approximations) -- the imaginary number i is denoted by "ii" -- Here are some examples: (4+3^2)*(2-4)^2 1024/368 2-3*ii (4-2*ii)/(4-5*ii) -- You can make new -- Semicolons at the end of a command suppress output and -- allow multiple commands on one line. a = 2; b = 3; c = a/b c_RR -- Before constructing polynomials, you need to define the polynomial -- ring in which they lie: R = QQ[x,y] f = x^2 + y^2 g = (x-y)^2 f - g h = 2*f + x^3*g^2 -- Use "toString" if you want to copy and paste things toString h -- You can even divide polynomials to get rational functions. q = (x^6-y^3)/(x^4-y^2) -- Be careful, though since this may no longer be a polynomial! -- Here is how to build ideals. I = ideal(x,y) J = ideal(x,y^2) K = ideal(x^2,x*y,y^2) L = ideal(x^3-x) -- It is *not* easy to work out which elements are inside an ideal: -- working out how to determine this will be a major part of the course! -- However, Macaulay2 already knows how to do this. -- Here we cheat and use the algorithms before learning them. isSubset(I,J) isSubset(J,I) I == J isSubset(K,I) isSubset(L,I) -- Here are some more examples I = ideal(x^2 + y^2 - 1) J = ideal(x^2 + y^2 - 1, (1-2*x)^2+(20-20*y+x)^2-1, 16*(4*x^2-x*y-x)+y^2+2*y+1) K = ideal(x + 8*y - 8, 26*x + 13*y - 19) isSubset(I,J) isSubset(J,I) I == J -- This is maybe a little surprising! J == K -- Here is a partial explanation: J == ideal(x-16/65, y-63/65) K == ideal(x-16/65, y-63/65)