# intersect(List) -- compute an intersection of ideals or modules

## Synopsis

• Function: intersect
• Usage:
intersect(M, N, ..., P)
• Inputs:
• a list, a list or , containing modules that are submodules of the same module or ideals in the same ring
• Optional inputs:
• Strategy => , default value null, specifies the algorithm
• MinimalGenerators => , default value true, indicates whether the output should be trimmed
• Outputs:
• an ideal or , the intersection of the objects given

## Description

This function calculates the intersection of submodules of the same free module, or of ideals in the same ring.

The following example computes the intersection of a sequence of ideals.

 i1 : R = ZZ/101[a..d]; i2 : I = intersect(ideal(a, b), ideal(b, c), ideal(c, d), ideal(d, a)) o2 = ideal (b*d, a*c) o2 : Ideal of R

The following example computes the intersection of a list of modules.

 i3 : R=ZZ[x, y, z]; i4 : M=image matrix{{3*x}, {3*x}}; i5 : N=image matrix{{5*y}, {5*y}}; i6 : P=image matrix{{7*z}, {7*z}}; i7 : intersect{M, N, P} o7 = image | 105xyz | | 105xyz | 2 o7 : R-module, submodule of R

The command intersect does not accept subrings. To intersect an ideal with a subring, use selectInSubring along with the elimination ordering, see Eliminate.

Multiple strategies are implemented via hooks and can be listed using the function hooks. More strategies may be added using addHook.

 i8 : hooks(intersect, Ideal, Ideal) o8 = {0 => (intersect, Ideal, Ideal, Strategy => Default) } {1 => (intersect, Ideal, Ideal, Strategy => Elimination)} {2 => (intersect, Ideal, Ideal, Strategy => Monomial) } o8 : NumberedVerticalList i9 : hooks(intersect, Module, Module) o9 = {0 => (intersect, Module, Module, Strategy => Default)} o9 : NumberedVerticalList

By default, the strategies are attempted in the reverse order in which the were added, until one is successful. To run a specific strategy instead, use the optional argument Strategy.

 i10 : intersect(ideal(x, y), (ideal(x, y, z))^2, Strategy => Monomial) 2 2 o10 = ideal (y*z, x*z, y , x*y, x ) o10 : Ideal of R