Macaulay2 » Documentation
Packages » FastMinors :: regularInCodimension
next | previous | forward | backward | up | index | toc

# regularInCodimension -- attempts to show that the ring is regular in codimension n

- Usage:
    `regularInCodimension(n, R)`
- Inputs:
  - n, an integer,
  - R, a ring,
- Optional inputs:
  - Modulus => a number, default value 0, work modulo the given prime modulus
  - PairLimit => a number, default value 100, passed to isCodimAtLeast
  - SPairsFunction => a function, default value FunctionClosure[../FastMinors.m2:169:23-169:42], passed to isCodimAtLeast
  - UseOnlyFastCodim => a Boolean value, default value false, tell the function not to use the built in dim command and only use isCodimAtLeast
  - MinMinorsFunction => a function, default value FunctionClosure[../FastMinors.m2:164:26-164:40], control how many minors are computed before computing codim
  - MaxMinors => a function, default value FunctionClosure[../FastMinors.m2:159:18-159:50], how many minors to consider before giving up
  - CodimCheckFunction => a function, default value FunctionClosure[../FastMinors.m2:165:27-165:46], control how many minors to compute in between calls to codim
  - DetStrategy => ..., default value Cofactor, DetStrategy is a strategy for allowing the user to choose how determinants (or rank), is computed
  - PointOptions => ..., default value {Strategy => Default, Homogeneous => false, Replacement => Binomial, ExtendField => true, PointCheckAttempts => 0, DecompositionStrategy => Decompose, NumThreadsToUse => 1, DimensionFunction => dim, Verbose => false}, options to pass to functions in the package RandomPoints
  - Strategy => ..., default value new OptionTable from {Points => 0, Random => 16, GRevLexLargest => 0, LexSmallestTerm => 16, LexLargest => 0, LexSmallest => 16, GRevLexSmallestTerm => 16, RandomNonzero => 16, GRevLexSmallest => 16}, strategies for choosing submatrices
  - Verbose => ..., default value false
- Outputs:
  - true, if the ring is regular in codimension n, false if it determines it is not, and null if no determination is made

## Description

This function returns true if R is regular in codimension n, false if it is not, and null if it did not make a determination. It considers interesting minors of the jacobian matrix to try to verify that the ring is regular in codimension n. It is frequently much faster at giving an affirmative answer than computing the dimension of the ideal of all minors of the Jacobian. We begin with a simple example which is R1, but not R2.

    i1 : R = QQ[x, y, z]/ideal(x*y-z^2);

    i2 : regularInCodimension(1, R)

    o2 = true

    i3 : regularInCodimension(2, R)

Next we consider a more interesting example that is R1 but not R2, and highlight the speed differences. Note that regularInCodimension(2, R) returns nothing, as the function did not determine whether the ring was regular in codimension n.

    i4 : T = ZZ/101[x1,x2,x3,x4,x5,x6,x7];

    i5 : I =  ideal(x5*x6-x4*x7,x1*x6-x2*x7,x5^2-x1*x7,x4*x5-x2*x7,x4^2-x2*x6,x1*x4-x2*x5,x2*x3^3*x5+3*x2*x3^2*x7+8*x2^2*x5+3*x3*x4*x7-8*x4*x7+x6*x7,x1*x3^3*x5+3*x1*x3^2*x7+8*x1*x2*x5+3*x3*x5*x7-8*x5*x7+x7^2,x2*x3^3*x4+3*x2*x3^2*x6+8*x2^2*x4+3*x3*x4*x6-8*x4*x6+x6^2,x2^2*x3^3+3*x2*x3^2*x4+8*x2^3+3*x2*x3*x6-8*x2*x6+x4*x6,x1*x2*x3^3+3*x2*x3^2*x5+8*x1*x2^2+3*x2*x3*x7-8*x2*x7+x4*x7,x1^2*x3^3+3*x1*x3^2*x5+8*x1^2*x2+3*x1*x3*x7-8*x1*x7+x5*x7);

    o5 : Ideal of T

    i6 : S = T/I;

    i7 : dim S

    o7 = 3

    i8 : time regularInCodimension(1, S)
     -- used 0.614294s (cpu); 0.511804s (thread); 0s (gc)

    o8 = true

    i9 : time regularInCodimension(2, S)
     -- used 5.97098s (cpu); 4.9268s (thread); 0s (gc)

There are numerous examples where regularInCodimension is several orders of magnitude faster that calls of dim singularLocus.

The following is a (pruned) affine chart on an Abelian surface obtained as a product of two elliptic curves. It is nonsingular, as our function verifies. If one does not prune it, then the dim singularLocus call takes an enormous amount of time, otherwise the running times of dim singularLocus and our function are frequently about the same.

    i10 : R = QQ[c, f, g, h]/ideal(g^3+h^3+1,f*g^3+f*h^3+f,c*g^3+c*h^3+c,f^2*g^3+f^2*h^3+f^2,c*f*g^3+c*f*h^3+c*f,c^2*g^3+c^2*h^3+c^2,f^3*g^3+f^3*h^3+f^3,c*f^2*g^3+c*f^2*h^3+c*f^2,c^2*f*g^3+c^2*f*h^3+c^2*f,c^3-f^2-c,c^3*h-f^2*h-c*h,c^3*g-f^2*g-c*g,c^3*h^2-f^2*h^2-c*h^2,c^3*g*h-f^2*g*h-c*g*h,c^3*g^2-f^2*g^2-c*g^2,c^3*h^3-f^2*h^3-c*h^3,c^3*g*h^2-f^2*g*h^2-c*g*h^2,c^3*g^2*h-f^2*g^2*h-c*g^2*h,c^3*g^3+f^2*h^3+c*h^3+f^2+c);

    i11 : dim(R)

    o11 = 2

    i12 : time (dim singularLocus (R))
     -- used 0.0190011s (cpu); 0.0191402s (thread); 0s (gc)

    o12 = -1

    i13 : time regularInCodimension(2, R)
     -- used 0.162633s (cpu); 0.139603s (thread); 0s (gc)

    o13 = true

    i14 : time regularInCodimension(2, R)
     -- used 0.789225s (cpu); 0.57871s (thread); 0s (gc)

    o14 = true

    i15 : time regularInCodimension(2, R)
     -- used 1.13825s (cpu); 0.878753s (thread); 0s (gc)

    o15 = true

The function works by choosing interesting looking submatrices, computing their determinants, and periodically (based on a logarithmic growth setting), computing the dimension of a subideal of the Jacobian. The option Verbose can be used to see this in action.

    i16 : time regularInCodimension(2, S, Verbose=>true)
    regularInCodimension: ring dimension =3, there are 17325 possible 4 by 4 minors, we will compute up to 327.599 of them.
    regularInCodimension: About to enter loop
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing RandomNonZero
    regularInCodimension:  Loop step, about to compute dimension.  Submatrices considered: 9, and computed = 9
    regularInCodimension:  isCodimAtLeast failed, computing codim.
    regularInCodimension:  partial singular locus dimension computed, = 2
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing LexSmallestTerm
    regularInCodimension:  Loop step, about to compute dimension.  Submatrices considered: 11, and computed = 10
    regularInCodimension:  isCodimAtLeast failed, computing codim.
    regularInCodimension:  partial singular locus dimension computed, = 2
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing RandomNonZero
    regularInCodimension:  Loop step, about to compute dimension.  Submatrices considered: 15, and computed = 13
    regularInCodimension:  isCodimAtLeast failed, computing codim.
    regularInCodimension:  partial singular locus dimension computed, = 2
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing LexSmallest
    regularInCodimension:  Loop step, about to compute dimension.  Submatrices considered: 21, and computed = 18
    regularInCodimension:  isCodimAtLeast failed, computing codim.
    regularInCodimension:  partial singular locus dimension computed, = 1
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing GRevLexSmallestTerm
    regularInCodimension:  Loop step, about to compute dimension.  Submatrices considered: 28, and computed = 23
    regularInCodimension:  isCodimAtLeast failed, computing codim.
    regularInCodimension:  partial singular locus dimension computed, = 1
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing GRevLexSmallestTerm
    regularInCodimension:  Loop step, about to compute dimension.  Submatrices considered: 37, and computed = 30
    regularInCodimension:  isCodimAtLeast failed, computing codim.
    regularInCodimension:  partial singular locus dimension computed, = 1
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing LexSmallest
    regularInCodimension:  Loop step, about to compute dimension.  Submatrices considered: 49, and computed = 36
    regularInCodimension:  isCodimAtLeast failed, computing codim.
    regularInCodimension:  partial singular locus dimension computed, = 1
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing GRevLexSmallestTerm
    regularInCodimension:  Loop step, about to compute dimension.  Submatrices considered: 64, and computed = 44
    regularInCodimension:  isCodimAtLeast failed, computing codim.
    regularInCodimension:  partial singular locus dimension computed, = 1
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing GRevLexSmallestTerm
    regularInCodimension:  Loop step, about to compute dimension.  Submatrices considered: 84, and computed = 56
    regularInCodimension:  isCodimAtLeast failed, computing codim.
    regularInCodimension:  partial singular locus dimension computed, = 1
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing GRevLexSmallest
    regularInCodimension:  Loop step, about to compute dimension.  Submatrices considered: 110, and computed = 69
    regularInCodimension:  isCodimAtLeast failed, computing codim.
    regularInCodimension:  partial singular locus dimension computed, = 1
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing Random
    regularInCodimension:  Loop step, about to compute dimension.  Submatrices considered: 144, and computed = 83
    regularInCodimension:  isCodimAtLeast failed, computing codim.
    regularInCodimension:  partial singular locus dimension computed, = 1
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing LexSmallestTerm
    regularInCodimension:  Loop step, about to compute dimension.  Submatrices considered: 188, and computed = 105
    regularInCodimension:  isCodimAtLeast failed, computing codim.
    regularInCodimension:  partial singular locus dimension computed, = 1
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing LexSmallestTerm
    regularInCodimension:  Loop step, about to compute dimension.  Submatrices considered: 245, and computed = 135
    regularInCodimension:  isCodimAtLeast failed, computing codim.
    regularInCodimension:  partial singular locus dimension computed, = 1
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Ch -- used 6.15316s (cpu); 5.11895s (thread); 0s (gc)
    oosing GRevLexSmallestTerm
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing RandomNonZero
    regularInCodimension:  Loop step, about to compute dimension.  Submatrices considered: 319, and computed = 175
    regularInCodimension:  isCodimAtLeast failed, computing codim.
    regularInCodimension:  partial singular locus dimension computed, = 1
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing Random
    regularInCodimension:  Loop step, about to compute dimension.  Submatrices considered: 328, and computed = 180
    regularInCodimension:  isCodimAtLeast failed, computing codim.
    regularInCodimension:  partial singular locus dimension computed, = 1
    regularInCodimension:  Loop completed, submatrices considered = 328, and computed = 180.  singular locus dimension appears to be = 1

The maximum number of minors considered can be controlled by the option MaxMinors. Alternatively, it can be controlled in a more precise way by passing a function to the option MaxMinors. This function should have two inputs; the first is minimum number of minors needed to determine whether the ring is regular in codimension n, and the second is the total number of minors available in the Jacobian. The function regularInCodimension does not recompute determinants, so MaxMinors or is only an upper bound on the number of minors computed.

    i17 : time regularInCodimension(2, S, Verbose=>true, MaxMinors=>30)
     -- used 1.27427s (cpu); 1.06602s (thread); 0s (gc)
    regularInCodimension: ring dimension =3, there are 17325 possible 4 by 4 minors, we will compute up to 30 of them.
    regularInCodimension: About to enter loop
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing RandomNonZero
    regularInCodimension:  Loop step, about to compute dimension.  Submatrices considered: 9, and computed = 7
    regularInCodimension:  isCodimAtLeast failed, computing codim.
    regularInCodimension:  partial singular locus dimension computed, = 2
    internalChooseMinor: Choosing Random
    internalChooseMinor: Choosing GRevLexSmallest
    regularInCodimension:  Loop step, about to compute dimension.  Submatrices considered: 11, and computed = 9
    regularInCodimension:  isCodimAtLeast failed, computing codim.
    regularInCodimension:  partial singular locus dimension computed, = 2
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing RandomNonZero
    regularInCodimension:  Loop step, about to compute dimension.  Submatrices considered: 15, and computed = 11
    regularInCodimension:  isCodimAtLeast failed, computing codim.
    regularInCodimension:  partial singular locus dimension computed, = 1
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallestTerm
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing RandomNonZero
    regularInCodimension:  Loop step, about to compute dimension.  Submatrices considered: 21, and computed = 16
    regularInCodimension:  isCodimAtLeast failed, computing codim.
    regularInCodimension:  partial singular locus dimension computed, = 1
    internalChooseMinor: Choosing RandomNonZero
    internalChooseMinor: Choosing LexSmallest
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing GRevLexSmallestTerm
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing GRevLexSmallest
    regularInCodimension:  Loop step, about to compute dimension.  Submatrices considered: 28, and computed = 22
    regularInCodimension:  isCodimAtLeast failed, computing codim.
    regularInCodimension:  partial singular locus dimension computed, = 1
    internalChooseMinor: Choosing GRevLexSmallest
    internalChooseMinor: Choosing GRevLexSmallestTerm
    regularInCodimension:  Loop step, about to compute dimension.  Submatrices considered: 30, and computed = 23
    regularInCodimension:  isCodimAtLeast failed, computing codim.
    regularInCodimension:  partial singular locus dimension computed, = 1
    regularInCodimension:  Loop completed, submatrices considered = 30, and computed = 23.  singular locus dimension appears to be = 1

This function has many options which allow you to fine tune the strategy used to find interesting minors. You can pass it a HashTable specifying the strategy via the option Strategy. See LexSmallest for how to construct this HashTable. The default strategy is StrategyDefault, which seems to work well on the examples we have explored. However, caution must be exercised, because, even in the examples above, certain strategies work well while others do not. In the Abelian surface example, LexSmallest works very well, while LexSmallestTerm does not even typically correctly identify the ring as nonsingular (this is because there are a small number of entries with nonzero constant terms, which are selected repeatedly). However, in our first example, the LexSmallestTerm is much faster, and Random does not perform well at all.

    i18 : StrategyCurrent#Random = 0;

    i19 : StrategyCurrent#LexSmallest = 100;

    i20 : StrategyCurrent#LexSmallestTerm = 0;

    i21 : time regularInCodimension(2, R, Strategy=>StrategyCurrent)
     -- used 0.265423s (cpu); 0.202159s (thread); 0s (gc)

    o21 = true

    i22 : time regularInCodimension(2, R, Strategy=>StrategyCurrent)
     -- used 0.0974872s (cpu); 0.0689309s (thread); 0s (gc)

    o22 = true

    i23 : time regularInCodimension(1, S, Strategy=>StrategyCurrent)
     -- used 0.331922s (cpu); 0.262809s (thread); 0s (gc)

    o23 = true

    i24 : time regularInCodimension(1, S, Strategy=>StrategyCurrent)
     -- used 1.47682s (cpu); 1.24876s (thread); 0s (gc)

    o24 = true

    i25 : StrategyCurrent#LexSmallest = 0;

    i26 : StrategyCurrent#LexSmallestTerm = 100;

    i27 : time regularInCodimension(2, R, Strategy=>StrategyCurrent)
     -- used 2.15913s (cpu); 1.71941s (thread); 0s (gc)

    i28 : time regularInCodimension(2, R, Strategy=>StrategyCurrent)
     -- used 2.05611s (cpu); 1.62292s (thread); 0s (gc)

    o28 = true

    i29 : time regularInCodimension(1, S, Strategy=>StrategyCurrent)
     -- used 0.328853s (cpu); 0.302962s (thread); 0s (gc)

    o29 = true

    i30 : time regularInCodimension(1, S, Strategy=>StrategyCurrent)
     -- used 0.733425s (cpu); 0.596678s (thread); 0s (gc)

    o30 = true

    i31 : time regularInCodimension(1, S, Strategy=>StrategyRandom)
     -- used 0.926295s (cpu); 0.809719s (thread); 0s (gc)

    o31 = true

    i32 : time regularInCodimension(1, S, Strategy=>StrategyRandom)
     -- used 1.50309s (cpu); 1.30184s (thread); 0s (gc)

    o32 = true

The minimum number of minors computed before checking the codimension can also be controlled by an option MinMinorsFunction. This is should be a function of a single variable, the number of minors computed. Finally, via the option CodimCheckFunction, you can pass the regularInCodimension a function which controls how frequently the codimension of the partial Jacobian ideal is computed. By default this is the floor of 1.3^k. Finally, passing the option Modulus => p will do the computation after changing the coefficient ring to ZZ/p.

The options PairLimit and SPairsFunction are passed directly to isCodimAtLeast. You can turn off internal calls to codim/dim, and only use isCodimAtLeast by setting UseOnlyFastCodim => true.

## See also

- isCodimAtLeast -- returns true if we can quickly see whether the codim is at least a given number

## Ways to use regularInCodimension:

- `regularInCodimension(ZZ,Ring)`

## For the programmer

The object regularInCodimension is a method function with options.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/FastMinors.m2:1906:0.