An ideal $I$ in a ring $S$ is said to satisfy the condition $G_m$ if, for every prime ideal $P$ of codimension $0<k<m$, the ideal $I_P$ in $S_P$ can be generated by at most $k$ elements.
The command whichGm I returns the largest $m$ such that $I$ satisfies $G_m$, or infinity if $I$ satisfies $G_m$ for every $m$.
This condition arises frequently in work of Vasconcelos and Ulrich and their schools on Rees algebras and powers of ideals. See for example Morey, Susan; Ulrich, Bernd: Rees algebras of ideals with low codimension. Proc. Amer. Math. Soc. 124 (1996), no. 12, 3653–3661.
i1 : kk=ZZ/101; |
i2 : S=kk[a..c]; |
i3 : m=ideal vars S o3 = ideal (a, b, c) o3 : Ideal of S |
i4 : i=(ideal"a,b")*m+ideal"c3" 2 2 3 o4 = ideal (a , a*b, a*c, a*b, b , b*c, c ) o4 : Ideal of S |
i5 : whichGm i o5 = 3 |
The object whichGm is a method function.