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

## Synopsis

• Usage:
I = embedAsIdeal(R, M, MTries=>n, IsGraded=>false)
L = embedAsIdeal(R, M, MTries=>n, IsGraded=>true)
L = embedAsIdeal(R, M, MTries=>n, ReturnMap=>true)
L = embedAsIdeal(R, M, MTries=>n, ReturnMap=>true, IsGraded=>true)
• Inputs:
• Optional inputs:
• MTries => an integer, default value 10, how many times random attempts to embed the module should be attempted if the first attempt fails
• IsGraded => , default value false, specify that the module is graded and instruct the function to return the degree shift of the embedding
• ReturnMap => , default value false, specify that the function should also return a map from the module to R^1, identifying the embedding
• Section => , default value null, used to specify that the function will keep track of a certain element
• Outputs:
• I, an ideal, the module embedded as an ideal
• L, a list, if IsGraded is true, then this function returns the degree shift of the embedding as a second entry in a list. Further if ReturnMap is true, then a map from the module to the ring is also returned as another entry in this list. Finally, if a matrix defining is passed to the function, then the first entry in the list is this ring element.

## Description

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 http://katzman.staff.shef.ac.uk/FSplitting/ParameterTestIdeals.m2

 i1 : R = QQ[x,y] o1 = R o1 : PolynomialRing i2 : M = (ideal(x^2,x*y))*R^1 o2 = image | x2 xy | 1 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 1 o15 = R o15 : R-module, free i16 : source L#1 o16 = image | x2 xy | 1 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 :

• "embedAsIdeal(Matrix)"
• "embedAsIdeal(Module)"
• "embedAsIdeal(Ring,Matrix)"
• "embedAsIdeal(Ring,Module)"

## For the programmer

The object embedAsIdeal is .