next | previous | forward | backward | up | top | index | toc | Macaulay2 website
Divisor :: embedAsIdeal

embedAsIdeal -- embed a module as an ideal of a ring



Tries to embed the module $M$ as an ideal in $R$. It will make several automatic tries followed by MTries => n attempts (the default n value is 10). Parts of this function were based on code originally written in the Macaulay2 Divisor tutorial and also based on code by Mordechai Katzman, see the canonicalIdeal function in

i1 : R = QQ[x,y]

o1 = R

o1 : PolynomialRing
i2 : M = (ideal(x^2,x*y))*R^1

o2 = image | x2 xy |

o2 : R-module, submodule of R
i3 : embedAsIdeal(M)

o3 = ideal (y, x)

o3 : Ideal of R

It also works for non-domains

i4 : R = QQ[x,y]/ideal(x*y);
i5 : M = (ideal(x^3, y^5))*R^1;
i6 : embedAsIdeal(M)

o6 = ideal (y, x)

o6 : Ideal of R
i7 : N = (ideal(x,y))*R^1;
i8 : embedAsIdeal(N)

o8 = ideal (y, x)

o8 : Ideal of R

Note that the answer is right even if you don't recognize it at first. Next, consider the IsGraded option. If this is set to true, then the system returns the degree as well (as you can see in the example below). The default value for the option IsGraded is false.

i9 : R = QQ[x,y];
i10 : M = R^{-3};
i11 : embedAsIdeal(M, IsGraded=>true)

o11 = {ideal 1, {-3}}

o11 : List

Next consider the ReturnMap option. What this does is also return the map from M to R^1 of which the map is based upon. Note that if both IsGraded and ReturnMap are enabled, then the map comes after the degree.

i12 : R = QQ[x,y];
i13 : M = ideal(x^2, x*y)*R^1;
i14 : L = embedAsIdeal(M, ReturnMap=>true)

o14 = {ideal (y, x), | x y |}

o14 : List
i15 : target L#1

o15 = R

o15 : R-module, free
i16 : source L#1

o16 = image | x2 xy |

o16 : R-module, submodule of R

Alternately, instead of passing an ideal you can pass embedAsIdeal a Matrix, where the source is a free module of rank one and the target is the module you wish to embed. (This can also be accomplished by passing the same matrix via the Section option). In this case, the first output will be a ring element corresponding to the section.

i17 : R = QQ[x,y];
i18 : M = (ideal(x^2,x*y))*R^1;
i19 : mat = map(M, R^1, {{1}, {1}});

o19 : Matrix
i20 : embedAsIdeal(mat)

o20 = {x + y, ideal (y, x)}

o20 : List
i21 : embedAsIdeal(M, Section=>mat)

o21 = {x + y, ideal (y, x)}

o21 : List

Ways to use embedAsIdeal :

For the programmer

The object embedAsIdeal is a method function with options.