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.





The object whichGm is a method function.