This is QuaternaryQuartics.info, produced by Macaulay2, version 1.25.05

QuaternaryQuartics -- code to support the paper 'Quaternary Quartic Forms and Gorenstein Rings'
***********************************************************************************************

Description
===========

This package contains code and examples for the paper [QQ],
Quaternary Quartic Forms and Gorenstein Rings, by Grzegorz Kapustka, Michal
Kapustka, Kristian Ranestad, Hal Schenck, Mike Stillman and Beihui Yuan,
referenced below.

We study the space of quartic forms in four variables, interleaving the notions
of: rank, border rank, annihilator of the quartic form, Betti tables, and
Calabi-Yau varieties of codimension 4.

Section 1: Generating the Betti tables
======================================

  * Finding the 16 betti tables possible for quartic forms in 4 variables, and examples
    -- Material from Table 6 and 7 of
    Appendix 1

Section 2: Basic constructions
==============================

  * Doubling Examples -- Doubling of each type of set
    of points
  * Doubling Examples for ideals of 6 points
    -- For an ideal $I_{\Gamma}$ of six points we compute
    possible doublings of $I_{\Gamma}$. See Example 2.16 in [QQ] for details
  * Example Type [300a] -- An example of an apolar
    ideal of a quartic that cannot be obtained as a doubling of it's apolar set
  * Example Type [300b] -- An example of doubling
    construction
  * Example Type [300c] -- The third family of type
    [300]

Section 3: betti tables for points in P^3 with given geometry
=============================================================

  * Finding the possible betti tables for points in P^3 with given geometry
    -- Material from Section 3 of [QQ]

Section 4: the quadratic part of the apolar ideal
=================================================

  * Finding all possible betti tables for quadratic component of inverse system for quartics in 4 variables,
    --
    Material from Section 4 of [QQ]

Section 5: VSP(F,9) for a general quadric form of rank 9
========================================================

  * VSP(F_Q,9) -- Computation appearing in the proof
    of Theorem 5.16 in [QQ]

Section 6: Stratification of the space of quaternary quartics
=============================================================

  * Finding the Betti stratum of a given quartic
    -- the 19 Betti strata
  * Noether-Lefschetz examples -- examples
    from Section 6.2 in [QQ]

Section 7: Codimension three varieties in quadrics
==================================================

  * Pfaffians on quadrics -- compute the quartic
    and betti table corresponding to a pfaffian ideal in a quadric

Section 8: Irreducible liftings
===============================

  * Type [000], CY of degree 20, --
    lifting to a 3-fold with two singular points
  * Singularities of lifting of type [300b]
    -- The lifting of [300b] defined by biliaison acquires
    singularities in dimension 3
  * Half canonical degree 20 -- Computation
    which supports the proof of Proposition 8.4

Section 9: Construction and lifting of AG varieties
===================================================

  * Type [210], CY of degree 18 via linkage
    -- lifting to a 3-fold with components of degrees 11, 6, 1
  * Type [310], CY of degree 17 via linkage
    -- lifting to a 3-fold with components of degrees 11, 6
  * Type [331], CY of degree 17 via linkage
    -- lifting to a 3-fold with components of degrees 13 and 4
  * Type [420], CY of degree 16 via linkage
    -- lifting to an irreducible 3-fold
  * Type [430], CY of degree 16 via linkage
    -- lifting to a 3-fold with components of degrees 10, 6
  * Type [441a], CY of degree 16, --
    lifting to a 3-fold with components of degrees 12, 4
  * Type [441b], CY of degree 16, --
    lifting to a 3-fold with components of degrees 8, 8
  * Type [551], CY of degree 15 via linkage
    -- lifting to a 3-fold with components of degrees 11 and 4
  * Type [562] with lifting of type I, a CY of degree 15 via linkage,
    --
    lifting to a 3-fold with components of degree 8, 7
  * Type [562] with a lifting of type II, a CY of degree 15 via linkage,
    --
    lifting to a 3-fold with components of degrees 7, 4, 4

Appendix 2: Components of the Betti table loci in Hilbert schemes of points
===========================================================================

  * Hilbert scheme of 6 points in projective 3-space
    -- Betti table loci

References
==========

See [QQ], Quaternary Quartic Forms and Gorenstein Rings, by Grzegorz
Kapustka, Michal Kapustka, Kristian Ranestad, Hal Schenck, Mike Stillman and
Beihui Yuan. (arxiv:2111.05817) 2021.

Authors
=======

  * Gregorz Kapustka
  * Michal Kapustka
  * Kristian Ranestad
  * Hal Schenck
  * Mike Stillman (see http://www.math.cornell.edu/~mike )
    <mike@math.cornell.edu>
  * Beihui Yuan

Version
=======

This documentation describes version 0.99 of QuaternaryQuartics.

Citation
========

If you have used this package in your research, please cite it as follows:

+-----------------------------------------------------------------------------+
|@misc{QuaternaryQuarticsSource,                                              |
|  title = {{QuaternaryQuartics: A \emph{Macaulay2} package. Version~0.99}},  |
|  author = {Gregorz Kapustka and Michal Kapustka and Kristian Ranestad and Ha|
|  howpublished = {A \emph{Macaulay2} package available at                    |
|    \url{https://github.com/Macaulay2/M2/tree/master/M2/Macaulay2/packages}} |
|}                                                                            |
|-----------------------------------------------------------------------------|
|l Schenck and Mike Stillman and Beihui Yuan},                                |
+-----------------------------------------------------------------------------+

Exports
=======

  * Functions and commands
      * bettiStrataExamples -- a hash table
        consisting of examples for each of the 19 Betti strata
      * doubling -- implement the doubling construction
      * nondegenerateBorels -- construct all
        nondegenerate strongly stable ideals of given length
      * pointsIdeal -- create an ideal of points
      * quartic -- a quartic given by power sums of linear
        forms
      * "quarticType" -- see quarticType(RingElement),
        -- the Betti stratum a specific quartic
        lies on
      * randomBlockMatrix -- create a block matrix
        with zero, identity and random blocks
      * randomHomomorphism -- create a random
        homomorphism between graded modules
      * randomPoints -- create a matrix whose columns are
        random points
      * smallerBettiTables -- Find all (potentially)
        smaller Betti tables that could degenerate to given table
  * Methods
      * "bettiStrataExamples(Ring)" -- see bettiStrataExamples,
        -- a hash table consisting of examples for each of
        the 19 Betti strata
      * "doubling(ZZ,Ideal)" -- see doubling, -- implement the
        doubling construction
      * "nondegenerateBorels(ZZ,Ring)" -- see nondegenerateBorels,
        -- construct all nondegenerate strongly stable
        ideals of given length
      * "pointsIdeal(Matrix)" -- see pointsIdeal, -- create
        an ideal of points
      * "pointsIdeal(Ring,Matrix)" -- see pointsIdeal, --
        create an ideal of points
      * "quartic(Matrix)" -- see quartic, -- a quartic given by
        power sums of linear forms
      * "quartic(Matrix,Ring)" -- see quartic, -- a quartic
        given by power sums of linear forms
      * quarticType(RingElement) -- the
        Betti stratum a specific quartic lies on
      * "randomBlockMatrix(List,List,List)" -- see randomBlockMatrix,
        -- create a block matrix with zero, identity and
        random blocks
      * "randomHomomorphism(List,Module,Module)" -- see
        randomHomomorphism, -- create a random homomorphism
        between graded modules
      * "randomHomomorphism(ZZ,Module,Module)" -- see randomHomomorphism,
        -- create a random homomorphism between graded
        modules
      * "randomPoints(Ring,ZZ)" -- see randomPoints, --
        create a matrix whose columns are random points
      * "randomPoints(Ring,ZZ,ZZ)" -- see randomPoints, --
        create a matrix whose columns are random points
      * "smallerBettiTables(BettiTally)" -- see smallerBettiTables,
        -- Find all (potentially) smaller Betti tables that
        could degenerate to given table
  * Symbols
      * Count -- an option name
      * Normalize -- an option name

For the programmer
==================

The object QuaternaryQuartics, is a package (Macaulay2Doc),
defined in QuaternaryQuartics.m2, with auxiliary files
in QuaternaryQuartics/.

-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics.m2:379:0.

[QQ] -- Quaternary Quartic Forms and Gorenstein rings (Kapustka, Kapustka, Ranestad, Schenck, Stillman, Yuan, 2021)
*******************************************************************************************************************

[QQ] Quaternary Quartic Forms and Gorenstein Rings (see
https://arxiv.org/abs/2111.05817 ) by Grzegorz Kapustka, Michal Kapustka,
Kristian Ranestad, Hal Schenck, Mike Stillman and Beihui Yuan, 2021.

-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics.m2:392:0.

bettiStrataExamples -- a hash table consisting of examples for each of the 19 Betti strata
******************************************************************************************

  * Usage:
        bettiStrataExamples S
  * Inputs:
      * S, a ring (Macaulay2Doc), a polynomial ring with 4
        variables
  * Outputs:
      * a hash table (Macaulay2Doc), Whose keys are strings
        representing each Betti table strata, and whose values are matrices of
        scalars over the ring $S$

Description
===========

The result is a hash table whose keys are the names of the 19 Betti table
strata for quaternary quartics.  For each, the value is a matrix whose columns
represent points.  The quartic corresponding to this matrix is the sum of the
4th powers of the corresponding linear forms.

+-----------------------------------------------------------------------------+
|i1 : S = ZZ/101[a..d]                                                        |
|                                                                             |
|o1 = S                                                                       |
|                                                                             |
|o1 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i2 : bettiStrataExamples S                                                   |
|                                                                             |
|o2 = HashTable{"[000]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[100]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[200]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[210]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[300a]" => {| 1 1  1                                         |
|                            | 2 2  2                                         |
|                            | 3 3  -                                         |
|                            | 1 -1 1                                         |
|               "[300b]" => {| 1 0 0                                          |
|                            | 0 1 0                                          |
|                            | 0 0 1                                          |
|                            | 0 0 0                                          |
|               "[300c]" => {| 1 0 1                                          |
|                            | 0 1 1                                          |
|                            | 0 0 0                                          |
|                            | 0 0 0                                          |
|               "[310]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[320]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[331]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[420]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[430]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[441a]" => {| 1 0 0                                          |
|                            | 0 1 0                                          |
|                            | 0 0 1                                          |
|                            | 0 0 0                                          |
|               "[441b]" => {| 1 0 0                                          |
|                            | 0 1 0                                          |
|                            | 0 0 1                                          |
|                            | 0 0 0                                          |
|               "[550]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[551]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[562]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[683]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|                                                                             |
|o2 : HashTable                                                               |
|-----------------------------------------------------------------------------|
| 1 22  2   -37 -18 32  |, 10 general points}                                 |
| 1 -47 29  -13 39  -9  |                                                     |
| 1 -23 -47 -10 27  -32 |                                                     |
| 1 -7  15  30  -22 -20 |                                                     |
| 1 39  48 -38 46  |, 9 general points}                                       |
| 1 43  36 33  -28 |                                                          |
| 1 -17 35 40  1   |                                                          |
| 1 -11 11 11  -3  |                                                          |
| 1 16  -48 -16 |, 8 general points}                                          |
| 1 22  -47 7   |                                                             |
| 1 45  47  15  |                                                             |
| 1 -34 19  -23 |                                                             |
| 1 1 0 1 |, 8 points with 6 in a plane, or five in a plane and three in a    |
| 1 0 1 1 |                                                                   |
| 0 1 1 1 |                                                                   |
| 0 0 0 1 |                                                                   |
|  1  1  1  1  1  |, 8 points which forms a CI}                               |
|  2  -2 -2 -2 -2 |                                                           |
|3 -3 3  3  -3 -3 |                                                           |
|  -1 1  -1 1  -1 |                                                           |
|0 1 19  -8  |, 7 general points}                                             |
|0 1 19  -22 |                                                                |
|0 1 -10 -29 |                                                                |
|1 1 -29 -24 |                                                                |
|-38 34  -18 -28 |, 7 points, 3 on a line}                                    |
|-16 19  -13 -47 |                                                            |
|39  -47 -43 38  |                                                            |
|21  -39 -15 2   |                                                            |
| 1 1 1 |, 7 points with 5 on a plane}                                        |
| 1 1 0 |                                                                     |
| 1 1 0 |                                                                     |
| 0 1 1 |                                                                     |
| 1 1 1 |, 7 points on a twisted cubic curve}                                 |
| 1 0 0 |                                                                     |
| 0 1 0 |                                                                     |
| 0 0 1 |                                                                     |
| 24  -15 33  |, 7 points with 6 on a plane}                                  |
| -30 39  -49 |                                                               |
| -48 0   -33 |                                                               |
| 0   0   0   |                                                               |
| 1 24  |, 6 general points}                                                  |
| 1 -36 |                                                                     |
| 1 -30 |                                                                     |
| 1 -29 |                                                                     |
| 1 1 |, 6 points, 3 on a line}                                               |
| 1 0 |                                                                       |
| 0 1 |                                                                       |
| 0 1 |                                                                       |
|0 1 1 |, 6 points, 5 on a plane}                                             |
|0 1 0 |                                                                      |
|0 0 1 |                                                                      |
|1 0 0 |                                                                      |
|0 1 0 |, 6 points, 3 each on 2 skew lines}                                   |
|0 1 0 |                                                                      |
|0 0 1 |                                                                      |
|1 0 1 |                                                                      |
| 1 |, 5 general points}                                                      |
| 1 |                                                                         |
| 1 |                                                                         |
| 1 |                                                                         |
| 1 |, 5 points, 4 on a plane}                                                |
| 1 |                                                                         |
| 1 |                                                                         |
| 0 |                                                                         |
| 1 |, 5 points, 3 on a line}                                                 |
| 1 |                                                                         |
| 0 |                                                                         |
| 0 |                                                                         |
| |, 4 general points}                                                        |
| |                                                                           |
| |                                                                           |
| |                                                                           |
|-----------------------------------------------------------------------------|
|     }                                                                       |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|line}                                                                        |
+-----------------------------------------------------------------------------+

Caveat
======

Ways to use bettiStrataExamples:
================================

  * "bettiStrataExamples(Ring)"

For the programmer
==================

The object bettiStrataExamples, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics.m2:421:0.

Computation of a doubling for each Betti table type -- See Proposition 2.18 in [QQ]
***********************************************************************************

We take point sets $\Gamma$ in the Hash table coming from
bettiStrataExamples, and make a doubling of each
$I_{\Gamma}$.

+--------------------------------------------------+
|i1 : kk = ZZ/101;                                 |
+--------------------------------------------------+
|i2 : R = kk[x_0..x_3];                            |
+--------------------------------------------------+
|i3 : HT = bettiStrataExamples R;                  |
+--------------------------------------------------+
|i4 : netList for k in keys HT list (              |
|         IGamma = pointsIdeal((HT#k)_0);          |
|         J = doubling(8, IGamma);                 |
|         {k, betti res IGamma, betti res J}       |
|         )                                        |
|                                                  |
|     +------+----------------+-------------------+|
|     |      |       0 1 2 3  |       0 1  2 3 4  ||
|o4 = |[310] |total: 1 5 7 3  |total: 1 8 14 8 1  ||
|     |      |    0: 1 . . .  |    0: 1 .  . . .  ||
|     |      |    1: . 3 1 .  |    1: . 3  1 . .  ||
|     |      |    2: . 2 6 3  |    2: . 5 12 5 .  ||
|     |      |                |    3: . .  1 3 .  ||
|     |      |                |    4: . .  . . 1  ||
|     +------+----------------+-------------------+|
|     |      |       0 1 2 3  |       0 1  2 3 4  ||
|     |[420] |total: 1 4 5 2  |total: 1 6 10 6 1  ||
|     |      |    0: 1 . . .  |    0: 1 .  . . .  ||
|     |      |    1: . 4 2 .  |    1: . 4  2 . .  ||
|     |      |    2: . . 3 2  |    2: . 2  6 2 .  ||
|     |      |                |    3: . .  2 4 .  ||
|     |      |                |    4: . .  . . 1  ||
|     +------+----------------+-------------------+|
|     |      |       0 1 2 3  |       0  1  2  3 4||
|     |[200] |total: 1 6 9 4  |total: 1 10 18 10 1||
|     |      |    0: 1 . . .  |    0: 1  .  .  . .||
|     |      |    1: . 2 . .  |    1: .  2  .  . .||
|     |      |    2: . 4 9 4  |    2: .  8 18  8 .||
|     |      |                |    3: .  .  .  2 .||
|     |      |                |    4: .  .  .  . 1||
|     +------+----------------+-------------------+|
|     |      |       0 1  2 3 |       0  1  2  3 4||
|     |[210] |total: 1 7 10 4 |total: 1 11 20 11 1||
|     |      |    0: 1 .  . . |    0: 1  .  .  . .||
|     |      |    1: . 2  1 . |    1: .  2  1  . .||
|     |      |    2: . 5  9 4 |    2: .  9 18  9 .||
|     |      |                |    3: .  .  1  2 .||
|     |      |                |    4: .  .  .  . 1||
|     +------+----------------+-------------------+|
|     |      |       0 1  2 3 |       0  1  2  3 4||
|     |[331] |total: 1 7 10 4 |total: 1 11 20 11 1||
|     |      |    0: 1 .  . . |    0: 1  .  .  . .||
|     |      |    1: . 3  3 1 |    1: .  3  3  1 .||
|     |      |    2: . 4  7 3 |    2: .  7 14  7 .||
|     |      |                |    3: .  1  3  3 .||
|     |      |                |    4: .  .  .  . 1||
|     +------+----------------+-------------------+|
|     |      |       0 1 2 3  |       0 1  2 3 4  ||
|     |[320] |total: 1 6 8 3  |total: 1 9 16 9 1  ||
|     |      |    0: 1 . . .  |    0: 1 .  . . .  ||
|     |      |    1: . 3 2 .  |    1: . 3  2 . .  ||
|     |      |    2: . 3 6 3  |    2: . 6 12 6 .  ||
|     |      |                |    3: . .  2 3 .  ||
|     |      |                |    4: . .  . . 1  ||
|     +------+----------------+-------------------+|
|     |      |       0 1 2 3  |       0 1  2 3 4  ||
|     |[683] |total: 1 6 8 3  |total: 1 9 16 9 1  ||
|     |      |    0: 1 . . .  |    0: 1 .  . . .  ||
|     |      |    1: . 6 8 3  |    1: . 6  8 3 .  ||
|     |      |                |    2: . .  . . .  ||
|     |      |                |    3: . 3  8 6 .  ||
|     |      |                |    4: . .  . . 1  ||
|     +------+----------------+-------------------+|
|     |      |       0 1  2 3 |       0  1  2  3 4||
|     |[100] |total: 1 8 12 5 |total: 1 13 24 13 1||
|     |      |    0: 1 .  . . |    0: 1  .  .  . .||
|     |      |    1: . 1  . . |    1: .  1  .  . .||
|     |      |    2: . 7 12 5 |    2: . 12 24 12 .||
|     |      |                |    3: .  .  .  1 .||
|     |      |                |    4: .  .  .  . 1||
|     +------+----------------+-------------------+|
|     |      |       0 1 2 3  |       0 1  2 3 4  ||
|     |[562] |total: 1 6 8 3  |total: 1 9 16 9 1  ||
|     |      |    0: 1 . . .  |    0: 1 .  . . .  ||
|     |      |    1: . 5 6 2  |    1: . 5  6 2 .  ||
|     |      |    2: . 1 2 1  |    2: . 2  4 2 .  ||
|     |      |                |    3: . 2  6 5 .  ||
|     |      |                |    4: . .  . . 1  ||
|     +------+----------------+-------------------+|
|     |      |       0 1 2 3  |       0 1  2 3 4  ||
|     |[551] |total: 1 5 6 2  |total: 1 7 12 7 1  ||
|     |      |    0: 1 . . .  |    0: 1 .  . . .  ||
|     |      |    1: . 5 5 1  |    1: . 5  5 1 .  ||
|     |      |    2: . . 1 1  |    2: . 1  2 1 .  ||
|     |      |                |    3: . 1  5 5 .  ||
|     |      |                |    4: . .  . . 1  ||
|     +------+----------------+-------------------+|
|     |      |       0 1 2 3  |       0 1  2 3 4  ||
|     |[430] |total: 1 5 6 2  |total: 1 7 12 7 1  ||
|     |      |    0: 1 . . .  |    0: 1 .  . . .  ||
|     |      |    1: . 4 3 .  |    1: . 4  3 . .  ||
|     |      |    2: . 1 3 2  |    2: . 3  6 3 .  ||
|     |      |                |    3: . .  3 4 .  ||
|     |      |                |    4: . .  . . 1  ||
|     +------+----------------+-------------------+|
|     |      |       0 1 2 3  |       0 1  2 3 4  ||
|     |[550] |total: 1 5 5 1  |total: 1 6 10 6 1  ||
|     |      |    0: 1 . . .  |    0: 1 .  . . .  ||
|     |      |    1: . 5 5 .  |    1: . 5  5 . .  ||
|     |      |    2: . . . 1  |    2: . 1  . 1 .  ||
|     |      |                |    3: . .  5 5 .  ||
|     |      |                |    4: . .  . . 1  ||
|     +------+----------------+-------------------+|
|     |      |       0  1  2 3|       0  1  2  3 4||
|     |[000] |total: 1 10 15 6|total: 1 16 30 16 1||
|     |      |    0: 1  .  . .|    0: 1  .  .  . .||
|     |      |    1: .  .  . .|    1: .  .  .  . .||
|     |      |    2: . 10 15 6|    2: . 16 30 16 .||
|     |      |                |    3: .  .  .  . .||
|     |      |                |    4: .  .  .  . 1||
|     +------+----------------+-------------------+|
|     |      |       0 1 2 3  |       0 1  2 3 4  ||
|     |[441b]|total: 1 6 8 3  |total: 1 9 16 9 1  ||
|     |      |    0: 1 . . .  |    0: 1 .  . . .  ||
|     |      |    1: . 4 4 1  |    1: . 4  4 1 .  ||
|     |      |    2: . 2 4 2  |    2: . 4  8 4 .  ||
|     |      |                |    3: . 1  4 4 .  ||
|     |      |                |    4: . .  . . 1  ||
|     +------+----------------+-------------------+|
|     |      |       0 1 2 3  |       0 1  2 3 4  ||
|     |[441a]|total: 1 6 8 3  |total: 1 9 16 9 1  ||
|     |      |    0: 1 . . .  |    0: 1 .  . . .  ||
|     |      |    1: . 4 4 1  |    1: . 4  4 1 .  ||
|     |      |    2: . 2 4 2  |    2: . 4  8 4 .  ||
|     |      |                |    3: . 1  4 4 .  ||
|     |      |                |    4: . .  . . 1  ||
|     +------+----------------+-------------------+|
|     |      |       0 1 2 3  |       0 1  2 3 4  ||
|     |[300c]|total: 1 4 6 3  |total: 1 7 12 7 1  ||
|     |      |    0: 1 . . .  |    0: 1 .  . . .  ||
|     |      |    1: . 3 . .  |    1: . 3  . . .  ||
|     |      |    2: . 1 6 3  |    2: . 4 12 4 .  ||
|     |      |                |    3: . .  . 3 .  ||
|     |      |                |    4: . .  . . 1  ||
|     +------+----------------+-------------------+|
|     |      |       0 1 2 3  |       0 1  2 3 4  ||
|     |[300b]|total: 1 4 6 3  |total: 1 7 12 7 1  ||
|     |      |    0: 1 . . .  |    0: 1 .  . . .  ||
|     |      |    1: . 3 . .  |    1: . 3  . . .  ||
|     |      |    2: . 1 6 3  |    2: . 4 12 4 .  ||
|     |      |                |    3: . .  . 3 .  ||
|     |      |                |    4: . .  . . 1  ||
|     +------+----------------+-------------------+|
|     |      |       0 1 2 3  |       0 1 2 3 4   ||
|     |[300a]|total: 1 3 3 1  |total: 1 4 6 4 1   ||
|     |      |    0: 1 . . .  |    0: 1 . . . .   ||
|     |      |    1: . 3 . .  |    1: . 4 . . .   ||
|     |      |    2: . . 3 .  |    2: . . 6 . .   ||
|     |      |    3: . . . 1  |    3: . . . 4 .   ||
|     |      |                |    4: . . . . 1   ||
|     +------+----------------+-------------------+|
+--------------------------------------------------+

See also
========

  * [QQ] -- Quaternary Quartic Forms and Gorenstein rings
    (Kapustka, Kapustka, Ranestad, Schenck, Stillman, Yuan, 2021)
-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics/Section2Doc.m2:93:0.

Count -- an option name
***********************

Description
===========

Used in doubling.

Functions with optional argument named Count:
=============================================

  * "doubling(...,Count=>...)" -- see doubling, -- implement
    the doubling construction

For the programmer
==================

The object Count, is a symbol (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics.m2:947:0.

doubling -- implement the doubling construction
***********************************************

  * Usage:
        doubling(d, I)
  * Inputs:
      * d, an integer (Macaulay2Doc), the degree of the map
      * I, an ideal (Macaulay2Doc), homogeneous, in a singly
        graded polynomial ring $S$
  * Optional inputs (Macaulay2Doc),:
      * Count => an integer (Macaulay2Doc), default value 10, number
        of random maps to generate before giving up and returning null
  * Outputs:
      * an ideal (Macaulay2Doc), an ideal $J$ containing $I$ such
        that the canonical module of $S/I$ is $J/I \otimes S(-d)$, or null, if
        either one doesn't exist or one cannot be found

Description
===========

Let $R = S/I$, and $w_R = \operatorname{Ext}^c(R, S^{-n-1})$, where $c$ is the
codimension of $I$ and $n+1$ is the number of variables of the polynomial ring
$S$.

If there exists an injective  homomorphism $f \colon w_R \to R$ of degree $d$,
this function returns the ideal defining the cokernel of a random such map.  If
none exist, null is returned.  If after trying the number of trials given by
the optional argument Count, none that are injective can be found (this is very
unlikely), null is also returned. Setting the global variable debugLevel (Macaulay2Doc),
to a positive value will let you know how many times
it took to find one (if it didn't find it right away).

If $S/I$ is arithmetically Cohen-Macaulay of codimension $c$, then the cokernel
of $f$ will be arithmetically Gorenstein of codimension $c+1$.

See section 2.5 of [QQ], for more details and references.

+-----------------------------------------------------------------------------+
|i1 : S = ZZ/101[a..d];                                                       |
+-----------------------------------------------------------------------------+
|i2 : I = pointsIdeal randomPoints(S, 6)                                      |
|                                                                             |
|                             2                              2   2            |
|o2 = ideal (a*c - 14b*c + 43c  + 31a*d - 28b*d - 17c*d + 28d , b  + 11b*c +  |
|     ------------------------------------------------------------------------|
|        2                              2                   2                 |
|     37c  - 40a*d - 45b*d - 10c*d - 23d , a*b + 35b*c - 18c  - 31a*d - 38b*d |
|     ------------------------------------------------------------------------|
|                 2   2              2                            2           |
|     + 7c*d - 35d , a  + 49b*c + 40c  - 4a*d - 22b*d - 45c*d - 5d )          |
|                                                                             |
|o2 : Ideal of S                                                              |
+-----------------------------------------------------------------------------+
|i3 : betti res I                                                             |
|                                                                             |
|            0 1 2 3                                                          |
|o3 = total: 1 4 5 2                                                          |
|         0: 1 . . .                                                          |
|         1: . 4 2 .                                                          |
|         2: . . 3 2                                                          |
|                                                                             |
|o3 : BettiTally                                                              |
+-----------------------------------------------------------------------------+
|i4 : doubling(5, I)                                                          |
+-----------------------------------------------------------------------------+
|i5 : J = doubling(8, I)                                                      |
|                                                                             |
|                             2                              2   2            |
|o5 = ideal (a*c - 14b*c + 43c  + 31a*d - 28b*d - 17c*d + 28d , b  + 11b*c +  |
|     ------------------------------------------------------------------------|
|        2                              2                   2                 |
|     37c  - 40a*d - 45b*d - 10c*d - 23d , a*b + 35b*c - 18c  - 31a*d - 38b*d |
|     ------------------------------------------------------------------------|
|                 2   2              2                            2   2       |
|     + 7c*d - 35d , a  + 49b*c + 40c  - 4a*d - 22b*d - 45c*d - 5d , c d -    |
|     ------------------------------------------------------------------------|
|          2       2        2      3               2        2        2    3   |
|     28a*d  + 9b*d  + 50c*d  + 50d , b*c*d - 15a*d  + 39b*d  - 26c*d  - d )  |
|                                                                             |
|o5 : Ideal of S                                                              |
+-----------------------------------------------------------------------------+
|i6 : betti res J                                                             |
|                                                                             |
|            0 1  2 3 4                                                       |
|o6 = total: 1 6 10 6 1                                                       |
|         0: 1 .  . . .                                                       |
|         1: . 4  2 . .                                                       |
|         2: . 2  6 2 .                                                       |
|         3: . .  2 4 .                                                       |
|         4: . .  . . 1                                                       |
|                                                                             |
|o6 : BettiTally                                                              |
+-----------------------------------------------------------------------------+

Here are some doublings of the Veronese surface

+-----------------------------------------------------------------------------+
|i7 : S = ZZ/101[x_0..x_5];                                                   |
+-----------------------------------------------------------------------------+
|i8 : M = genericSymmetricMatrix(S, 3)                                        |
|                                                                             |
|o8 = | x_0 x_1 x_2 |                                                         |
|     | x_1 x_3 x_4 |                                                         |
|     | x_2 x_4 x_5 |                                                         |
|                                                                             |
|             3      3                                                        |
|o8 : Matrix S  <-- S                                                         |
+-----------------------------------------------------------------------------+
|i9 : I = trim minors(2, M)                                                   |
|                                                                             |
|             2                                    2                       2  |
|o9 = ideal (x  - x x , x x  - x x , x x  - x x , x  - x x , x x  - x x , x  -|
|             4    3 5   2 4    1 5   2 3    1 4   2    0 5   1 2    0 4   1  |
|     ------------------------------------------------------------------------|
|     x x )                                                                   |
|      0 3                                                                    |
|                                                                             |
|o9 : Ideal of S                                                              |
+-----------------------------------------------------------------------------+
|i10 : doubling(4, I) -- no such map exists                                   |
+-----------------------------------------------------------------------------+
|i11 : betti res doubling(6,I)                                                |
|                                                                             |
|             0 1  2 3 4                                                      |
|o11 = total: 1 9 16 9 1                                                      |
|          0: 1 .  . . .                                                      |
|          1: . 9 16 9 .                                                      |
|          2: . .  . . 1                                                      |
|                                                                             |
|o11 : BettiTally                                                             |
+-----------------------------------------------------------------------------+
|i12 : betti res doubling(7,I)                                                |
|                                                                             |
|             0 1  2 3 4                                                      |
|o12 = total: 1 9 16 9 1                                                      |
|          0: 1 .  . . .                                                      |
|          1: . 6  8 3 .                                                      |
|          2: . 3  8 6 .                                                      |
|          3: . .  . . 1                                                      |
|                                                                             |
|o12 : BettiTally                                                             |
+-----------------------------------------------------------------------------+
|i13 : betti res doubling(8,I)                                                |
|                                                                             |
|             0 1  2 3 4                                                      |
|o13 = total: 1 9 16 9 1                                                      |
|          0: 1 .  . . .                                                      |
|          1: . 6  8 3 .                                                      |
|          2: . .  . . .                                                      |
|          3: . 3  8 6 .                                                      |
|          4: . .  . . 1                                                      |
|                                                                             |
|o13 : BettiTally                                                             |
+-----------------------------------------------------------------------------+
|i14 : J = doubling(8, I);                                                    |
|                                                                             |
|o14 : Ideal of S                                                             |
+-----------------------------------------------------------------------------+
|i15 : (dim J, degree J)                                                      |
|                                                                             |
|o15 = (2, 14)                                                                |
|                                                                             |
|o15 : Sequence                                                               |
+-----------------------------------------------------------------------------+
|i16 : (dim I, degree I)                                                      |
|                                                                             |
|o16 = (3, 4)                                                                 |
|                                                                             |
|o16 : Sequence                                                               |
+-----------------------------------------------------------------------------+
+-----------------------------------------------------------------------------+
|i17 : S = ZZ/101[x_0..x_8];                                                  |
+-----------------------------------------------------------------------------+
|i18 : M = genericMatrix(S, 3, 3)                                             |
|                                                                             |
|o18 = | x_0 x_3 x_6 |                                                        |
|      | x_1 x_4 x_7 |                                                        |
|      | x_2 x_5 x_8 |                                                        |
|                                                                             |
|              3      3                                                       |
|o18 : Matrix S  <-- S                                                        |
+-----------------------------------------------------------------------------+
|i19 : I = trim minors(2, M)                                                  |
|                                                                             |
|o19 = ideal (x x  - x x , x x  - x x , x x  - x x , x x  - x x , x x  - x x ,|
|              5 7    4 8   2 7    1 8   5 6    3 8   4 6    3 7   2 6    0 8 |
|      -----------------------------------------------------------------------|
|      x x  - x x , x x  - x x , x x  - x x , x x  - x x )                    |
|       1 6    0 7   2 4    1 5   2 3    0 5   1 3    0 4                     |
|                                                                             |
|o19 : Ideal of S                                                             |
+-----------------------------------------------------------------------------+
|i20 : betti res doubling(8,I)                                                |
|                                                                             |
|             0  1  2  3  4 5                                                 |
|o20 = total: 1 10 25 25 10 1                                                 |
|          0: 1  .  .  .  . .                                                 |
|          1: . 10 16  9  . .                                                 |
|          2: .  .  9 16 10 .                                                 |
|          3: .  .  .  .  . 1                                                 |
|                                                                             |
|o20 : BettiTally                                                             |
+-----------------------------------------------------------------------------+
|i21 : J = doubling(8, I);                                                    |
|                                                                             |
|o21 : Ideal of S                                                             |
+-----------------------------------------------------------------------------+
|i22 : (dim J, degree J)                                                      |
|                                                                             |
|o22 = (4, 12)                                                                |
|                                                                             |
|o22 : Sequence                                                               |
+-----------------------------------------------------------------------------+
|i23 : (dim I, degree I)                                                      |
|                                                                             |
|o23 = (5, 6)                                                                 |
|                                                                             |
|o23 : Sequence                                                               |
+-----------------------------------------------------------------------------+

See also
========

  * randomHomomorphism -- create a random
    homomorphism between graded modules

Ways to use doubling:
=====================

  * "doubling(ZZ,Ideal)"

For the programmer
==================

The object doubling, is a method function with options (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics.m2:817:0.

Doubling Examples -- Doubling of each type of set of points
***********************************************************

For each of the 19 strata, take a set of points computing the rank of a general
quartic on that stratum.  From these, we have two ways of obtaining an Artinian
Gorenstein algebra of codimension and regularity both 4: we can take the
inverse system of the quartic, and we can take the doubling of the ideal of
points.  These match in all but one stratum: case [300a], see Example Type [300a],
for more details about this case.

+-------------------------------------------------------------------------+
|i1 : kk = ZZ/101;                                                        |
+-------------------------------------------------------------------------+
|i2 : R = kk[x_0..x_3];                                                   |
+-------------------------------------------------------------------------+
|i3 : HT = bettiStrataExamples R;                                         |
+-------------------------------------------------------------------------+
|i4 : netList prepend(                                                    |
|         {"type", "I = ideal of points", "Fperp", "doubling of points"}, |
|         sort for k in keys HT list (                                    |
|         I := pointsIdeal((HT#k)_0);                                     |
|         F := quartic (HT#k)_0;                                          |
|         {k, minimalBetti I,                                             |
|             minimalBetti inverseSystem F,                               |
|             minimalBetti doubling(8, I)}                                |
|         ))                                                              |
|                                                                         |
|     +------+-------------------+-------------------+-------------------+|
|o4 = |type  |I = ideal of points|Fperp              |doubling of points ||
|     +------+-------------------+-------------------+-------------------+|
|     |      |       0  1  2 3   |       0  1  2  3 4|       0  1  2  3 4||
|     |[000] |total: 1 10 15 6   |total: 1 16 30 16 1|total: 1 16 30 16 1||
|     |      |    0: 1  .  . .   |    0: 1  .  .  . .|    0: 1  .  .  . .||
|     |      |    1: .  .  . .   |    1: .  .  .  . .|    1: .  .  .  . .||
|     |      |    2: . 10 15 6   |    2: . 16 30 16 .|    2: . 16 30 16 .||
|     |      |                   |    3: .  .  .  . .|    3: .  .  .  . .||
|     |      |                   |    4: .  .  .  . 1|    4: .  .  .  . 1||
|     +------+-------------------+-------------------+-------------------+|
|     |      |       0 1  2 3    |       0  1  2  3 4|       0  1  2  3 4||
|     |[100] |total: 1 8 12 5    |total: 1 13 24 13 1|total: 1 13 24 13 1||
|     |      |    0: 1 .  . .    |    0: 1  .  .  . .|    0: 1  .  .  . .||
|     |      |    1: . 1  . .    |    1: .  1  .  . .|    1: .  1  .  . .||
|     |      |    2: . 7 12 5    |    2: . 12 24 12 .|    2: . 12 24 12 .||
|     |      |                   |    3: .  .  .  1 .|    3: .  .  .  1 .||
|     |      |                   |    4: .  .  .  . 1|    4: .  .  .  . 1||
|     +------+-------------------+-------------------+-------------------+|
|     |      |       0 1 2 3     |       0  1  2  3 4|       0  1  2  3 4||
|     |[200] |total: 1 6 9 4     |total: 1 10 18 10 1|total: 1 10 18 10 1||
|     |      |    0: 1 . . .     |    0: 1  .  .  . .|    0: 1  .  .  . .||
|     |      |    1: . 2 . .     |    1: .  2  .  . .|    1: .  2  .  . .||
|     |      |    2: . 4 9 4     |    2: .  8 18  8 .|    2: .  8 18  8 .||
|     |      |                   |    3: .  .  .  2 .|    3: .  .  .  2 .||
|     |      |                   |    4: .  .  .  . 1|    4: .  .  .  . 1||
|     +------+-------------------+-------------------+-------------------+|
|     |      |       0 1  2 3    |       0  1  2  3 4|       0  1  2  3 4||
|     |[210] |total: 1 7 10 4    |total: 1 11 20 11 1|total: 1 11 20 11 1||
|     |      |    0: 1 .  . .    |    0: 1  .  .  . .|    0: 1  .  .  . .||
|     |      |    1: . 2  1 .    |    1: .  2  1  . .|    1: .  2  1  . .||
|     |      |    2: . 5  9 4    |    2: .  9 18  9 .|    2: .  9 18  9 .||
|     |      |                   |    3: .  .  1  2 .|    3: .  .  1  2 .||
|     |      |                   |    4: .  .  .  . 1|    4: .  .  .  . 1||
|     +------+-------------------+-------------------+-------------------+|
|     |      |       0 1 2 3     |       0 1  2 3 4  |       0 1 2 3 4   ||
|     |[300a]|total: 1 3 3 1     |total: 1 7 12 7 1  |total: 1 4 6 4 1   ||
|     |      |    0: 1 . . .     |    0: 1 .  . . .  |    0: 1 . . . .   ||
|     |      |    1: . 3 . .     |    1: . 3  . . .  |    1: . 4 . . .   ||
|     |      |    2: . . 3 .     |    2: . 4 12 4 .  |    2: . . 6 . .   ||
|     |      |    3: . . . 1     |    3: . .  . 3 .  |    3: . . . 4 .   ||
|     |      |                   |    4: . .  . . 1  |    4: . . . . 1   ||
|     +------+-------------------+-------------------+-------------------+|
|     |      |       0 1 2 3     |       0 1  2 3 4  |       0 1  2 3 4  ||
|     |[300b]|total: 1 4 6 3     |total: 1 7 12 7 1  |total: 1 7 12 7 1  ||
|     |      |    0: 1 . . .     |    0: 1 .  . . .  |    0: 1 .  . . .  ||
|     |      |    1: . 3 . .     |    1: . 3  . . .  |    1: . 3  . . .  ||
|     |      |    2: . 1 6 3     |    2: . 4 12 4 .  |    2: . 4 12 4 .  ||
|     |      |                   |    3: . .  . 3 .  |    3: . .  . 3 .  ||
|     |      |                   |    4: . .  . . 1  |    4: . .  . . 1  ||
|     +------+-------------------+-------------------+-------------------+|
|     |      |       0 1 2 3     |       0 1  2 3 4  |       0 1  2 3 4  ||
|     |[300c]|total: 1 4 6 3     |total: 1 7 12 7 1  |total: 1 7 12 7 1  ||
|     |      |    0: 1 . . .     |    0: 1 .  . . .  |    0: 1 .  . . .  ||
|     |      |    1: . 3 . .     |    1: . 3  . . .  |    1: . 3  . . .  ||
|     |      |    2: . 1 6 3     |    2: . 4 12 4 .  |    2: . 4 12 4 .  ||
|     |      |                   |    3: . .  . 3 .  |    3: . .  . 3 .  ||
|     |      |                   |    4: . .  . . 1  |    4: . .  . . 1  ||
|     +------+-------------------+-------------------+-------------------+|
|     |      |       0 1 2 3     |       0 1  2 3 4  |       0 1  2 3 4  ||
|     |[310] |total: 1 5 7 3     |total: 1 8 14 8 1  |total: 1 8 14 8 1  ||
|     |      |    0: 1 . . .     |    0: 1 .  . . .  |    0: 1 .  . . .  ||
|     |      |    1: . 3 1 .     |    1: . 3  1 . .  |    1: . 3  1 . .  ||
|     |      |    2: . 2 6 3     |    2: . 5 12 5 .  |    2: . 5 12 5 .  ||
|     |      |                   |    3: . .  1 3 .  |    3: . .  1 3 .  ||
|     |      |                   |    4: . .  . . 1  |    4: . .  . . 1  ||
|     +------+-------------------+-------------------+-------------------+|
|     |      |       0 1 2 3     |       0 1  2 3 4  |       0 1  2 3 4  ||
|     |[320] |total: 1 6 8 3     |total: 1 9 16 9 1  |total: 1 9 16 9 1  ||
|     |      |    0: 1 . . .     |    0: 1 .  . . .  |    0: 1 .  . . .  ||
|     |      |    1: . 3 2 .     |    1: . 3  2 . .  |    1: . 3  2 . .  ||
|     |      |    2: . 3 6 3     |    2: . 6 12 6 .  |    2: . 6 12 6 .  ||
|     |      |                   |    3: . .  2 3 .  |    3: . .  2 3 .  ||
|     |      |                   |    4: . .  . . 1  |    4: . .  . . 1  ||
|     +------+-------------------+-------------------+-------------------+|
|     |      |       0 1  2 3    |       0  1  2  3 4|       0  1  2  3 4||
|     |[331] |total: 1 7 10 4    |total: 1 11 20 11 1|total: 1 11 20 11 1||
|     |      |    0: 1 .  . .    |    0: 1  .  .  . .|    0: 1  .  .  . .||
|     |      |    1: . 3  3 1    |    1: .  3  3  1 .|    1: .  3  3  1 .||
|     |      |    2: . 4  7 3    |    2: .  7 14  7 .|    2: .  7 14  7 .||
|     |      |                   |    3: .  1  3  3 .|    3: .  1  3  3 .||
|     |      |                   |    4: .  .  .  . 1|    4: .  .  .  . 1||
|     +------+-------------------+-------------------+-------------------+|
|     |      |       0 1 2 3     |       0 1  2 3 4  |       0 1  2 3 4  ||
|     |[420] |total: 1 4 5 2     |total: 1 6 10 6 1  |total: 1 6 10 6 1  ||
|     |      |    0: 1 . . .     |    0: 1 .  . . .  |    0: 1 .  . . .  ||
|     |      |    1: . 4 2 .     |    1: . 4  2 . .  |    1: . 4  2 . .  ||
|     |      |    2: . . 3 2     |    2: . 2  6 2 .  |    2: . 2  6 2 .  ||
|     |      |                   |    3: . .  2 4 .  |    3: . .  2 4 .  ||
|     |      |                   |    4: . .  . . 1  |    4: . .  . . 1  ||
|     +------+-------------------+-------------------+-------------------+|
|     |      |       0 1 2 3     |       0 1  2 3 4  |       0 1  2 3 4  ||
|     |[430] |total: 1 5 6 2     |total: 1 7 12 7 1  |total: 1 7 12 7 1  ||
|     |      |    0: 1 . . .     |    0: 1 .  . . .  |    0: 1 .  . . .  ||
|     |      |    1: . 4 3 .     |    1: . 4  3 . .  |    1: . 4  3 . .  ||
|     |      |    2: . 1 3 2     |    2: . 3  6 3 .  |    2: . 3  6 3 .  ||
|     |      |                   |    3: . .  3 4 .  |    3: . .  3 4 .  ||
|     |      |                   |    4: . .  . . 1  |    4: . .  . . 1  ||
|     +------+-------------------+-------------------+-------------------+|
|     |      |       0 1 2 3     |       0 1  2 3 4  |       0 1  2 3 4  ||
|     |[441a]|total: 1 6 8 3     |total: 1 9 16 9 1  |total: 1 9 16 9 1  ||
|     |      |    0: 1 . . .     |    0: 1 .  . . .  |    0: 1 .  . . .  ||
|     |      |    1: . 4 4 1     |    1: . 4  4 1 .  |    1: . 4  4 1 .  ||
|     |      |    2: . 2 4 2     |    2: . 4  8 4 .  |    2: . 4  8 4 .  ||
|     |      |                   |    3: . 1  4 4 .  |    3: . 1  4 4 .  ||
|     |      |                   |    4: . .  . . 1  |    4: . .  . . 1  ||
|     +------+-------------------+-------------------+-------------------+|
|     |      |       0 1 2 3     |       0 1  2 3 4  |       0 1  2 3 4  ||
|     |[441b]|total: 1 6 8 3     |total: 1 9 16 9 1  |total: 1 9 16 9 1  ||
|     |      |    0: 1 . . .     |    0: 1 .  . . .  |    0: 1 .  . . .  ||
|     |      |    1: . 4 4 1     |    1: . 4  4 1 .  |    1: . 4  4 1 .  ||
|     |      |    2: . 2 4 2     |    2: . 4  8 4 .  |    2: . 4  8 4 .  ||
|     |      |                   |    3: . 1  4 4 .  |    3: . 1  4 4 .  ||
|     |      |                   |    4: . .  . . 1  |    4: . .  . . 1  ||
|     +------+-------------------+-------------------+-------------------+|
|     |      |       0 1 2 3     |       0 1  2 3 4  |       0 1  2 3 4  ||
|     |[550] |total: 1 5 5 1     |total: 1 6 10 6 1  |total: 1 6 10 6 1  ||
|     |      |    0: 1 . . .     |    0: 1 .  . . .  |    0: 1 .  . . .  ||
|     |      |    1: . 5 5 .     |    1: . 5  5 . .  |    1: . 5  5 . .  ||
|     |      |    2: . . . 1     |    2: . 1  . 1 .  |    2: . 1  . 1 .  ||
|     |      |                   |    3: . .  5 5 .  |    3: . .  5 5 .  ||
|     |      |                   |    4: . .  . . 1  |    4: . .  . . 1  ||
|     +------+-------------------+-------------------+-------------------+|
|     |      |       0 1 2 3     |       0 1  2 3 4  |       0 1  2 3 4  ||
|     |[551] |total: 1 5 6 2     |total: 1 7 12 7 1  |total: 1 7 12 7 1  ||
|     |      |    0: 1 . . .     |    0: 1 .  . . .  |    0: 1 .  . . .  ||
|     |      |    1: . 5 5 1     |    1: . 5  5 1 .  |    1: . 5  5 1 .  ||
|     |      |    2: . . 1 1     |    2: . 1  2 1 .  |    2: . 1  2 1 .  ||
|     |      |                   |    3: . 1  5 5 .  |    3: . 1  5 5 .  ||
|     |      |                   |    4: . .  . . 1  |    4: . .  . . 1  ||
|     +------+-------------------+-------------------+-------------------+|
|     |      |       0 1 2 3     |       0 1  2 3 4  |       0 1  2 3 4  ||
|     |[562] |total: 1 6 8 3     |total: 1 9 16 9 1  |total: 1 9 16 9 1  ||
|     |      |    0: 1 . . .     |    0: 1 .  . . .  |    0: 1 .  . . .  ||
|     |      |    1: . 5 6 2     |    1: . 5  6 2 .  |    1: . 5  6 2 .  ||
|     |      |    2: . 1 2 1     |    2: . 2  4 2 .  |    2: . 2  4 2 .  ||
|     |      |                   |    3: . 2  6 5 .  |    3: . 2  6 5 .  ||
|     |      |                   |    4: . .  . . 1  |    4: . .  . . 1  ||
|     +------+-------------------+-------------------+-------------------+|
|     |      |       0 1 2 3     |       0 1  2 3 4  |       0 1  2 3 4  ||
|     |[683] |total: 1 6 8 3     |total: 1 9 16 9 1  |total: 1 9 16 9 1  ||
|     |      |    0: 1 . . .     |    0: 1 .  . . .  |    0: 1 .  . . .  ||
|     |      |    1: . 6 8 3     |    1: . 6  8 3 .  |    1: . 6  8 3 .  ||
|     |      |                   |    2: . .  . . .  |    2: . .  . . .  ||
|     |      |                   |    3: . 3  8 6 .  |    3: . 3  8 6 .  ||
|     |      |                   |    4: . .  . . 1  |    4: . .  . . 1  ||
|     +------+-------------------+-------------------+-------------------+|
+-------------------------------------------------------------------------+

See also
========

  * [QQ] -- Quaternary Quartic Forms and Gorenstein rings
    (Kapustka, Kapustka, Ranestad, Schenck, Stillman, Yuan, 2021)
-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics/Section2Doc.m2:30:0.

Doubling Examples for ideals of 6 points -- For an ideal $I_{\Gamma}$ of six points we compute possible doublings of $I_{\Gamma}$. See Example 2.16 in [QQ] for details
***********************************************************************************************************************************************************************

If $\Gamma$ does not contain four collinear points, then $S/I_{\Gamma}$ has
regularity $2$.  The following computation shows that a random element of
$Hom(\omega(-4),R/I_{\Gamma})$ is injective. Therefore Corollary 2.15 gives the
corresponding doublings.

+---------------------------------------------------------------------+
|i1 : kk = ZZ/101;                                                    |
+---------------------------------------------------------------------+
|i2 : R = kk[x_0..x_3];                                               |
+---------------------------------------------------------------------+
|i3 : HT = bettiStrataExamples R;                                     |
+---------------------------------------------------------------------+
|i4 : netList for k in {"[420]","[430]","[441a]","[441b]"} list (     |
|             if doubling(8,pointsIdeal((HT#k)_0))===null then        |
|             {k, betti res pointsIdeal((HT#k)_0), "No injective map"}|
|         else                                                        |
|             {k, betti res pointsIdeal((HT#k)_0),                    |
|                 betti res doubling(8,pointsIdeal((HT#k)_0))}        |
|         )                                                           |
|                                                                     |
|     +------+--------------+-----------------+                       |
|     |      |       0 1 2 3|       0 1  2 3 4|                       |
|o4 = |[420] |total: 1 4 5 2|total: 1 6 10 6 1|                       |
|     |      |    0: 1 . . .|    0: 1 .  . . .|                       |
|     |      |    1: . 4 2 .|    1: . 4  2 . .|                       |
|     |      |    2: . . 3 2|    2: . 2  6 2 .|                       |
|     |      |              |    3: . .  2 4 .|                       |
|     |      |              |    4: . .  . . 1|                       |
|     +------+--------------+-----------------+                       |
|     |      |       0 1 2 3|       0 1  2 3 4|                       |
|     |[430] |total: 1 5 6 2|total: 1 7 12 7 1|                       |
|     |      |    0: 1 . . .|    0: 1 .  . . .|                       |
|     |      |    1: . 4 3 .|    1: . 4  3 . .|                       |
|     |      |    2: . 1 3 2|    2: . 3  6 3 .|                       |
|     |      |              |    3: . .  3 4 .|                       |
|     |      |              |    4: . .  . . 1|                       |
|     +------+--------------+-----------------+                       |
|     |      |       0 1 2 3|       0 1  2 3 4|                       |
|     |[441a]|total: 1 6 8 3|total: 1 9 16 9 1|                       |
|     |      |    0: 1 . . .|    0: 1 .  . . .|                       |
|     |      |    1: . 4 4 1|    1: . 4  4 1 .|                       |
|     |      |    2: . 2 4 2|    2: . 4  8 4 .|                       |
|     |      |              |    3: . 1  4 4 .|                       |
|     |      |              |    4: . .  . . 1|                       |
|     +------+--------------+-----------------+                       |
|     |      |       0 1 2 3|       0 1  2 3 4|                       |
|     |[441b]|total: 1 6 8 3|total: 1 9 16 9 1|                       |
|     |      |    0: 1 . . .|    0: 1 .  . . .|                       |
|     |      |    1: . 4 4 1|    1: . 4  4 1 .|                       |
|     |      |    2: . 2 4 2|    2: . 4  8 4 .|                       |
|     |      |              |    3: . 1  4 4 .|                       |
|     |      |              |    4: . .  . . 1|                       |
|     +------+--------------+-----------------+                       |
+---------------------------------------------------------------------+

Next, suppose $\Gamma$ is the set of six points span $\mathbb{P}^{3}$ and four
are collinear. We first check that a random element of $Hom(\omega(-\gamma),
R/I_{\Gamma})$ is not injective for $\gamma = 2$. When $\gamma\geq 3$, a
general element is injective and we compute the Betti table of doubling of
$I_{\Gamma}$ with a general element for $\gamma=3,4,5,6$.

+-----------------------------------------------------------------------------+
|i5 : Mpts = randomPoints(R,4,2)|(randomPoints(R,2,4)||(randomPoints(R,2,4)*0 |
|                                                                             |
|             4      6                                                        |
|o5 : Matrix R  <-- R                                                         |
|-----------------------------------------------------------------------------|
|));                                                                          |
+-----------------------------------------------------------------------------+
|i6 : IGamma = pointsIdeal(Mpts);                                             |
|                                                                             |
|o6 : Ideal of R                                                              |
+-----------------------------------------------------------------------------+
|i7 : betti res IGamma                                                        |
|                                                                             |
|            0 1 2 3                                                          |
|o7 = total: 1 6 8 3                                                          |
|         0: 1 . . .                                                          |
|         1: . 5 6 2                                                          |
|         2: . . . .                                                          |
|         3: . 1 2 1                                                          |
|                                                                             |
|o7 : BettiTally                                                              |
+-----------------------------------------------------------------------------+
|i8 : netList for k in {2,3,4,5,6} list (                                     |
|         if doubling(k+4,IGamma)===null then {k, "No injective map"}         |
|         else {k, betti res doubling(k+4,IGamma)})                           |
|                                                                             |
|     +-+-----------------+                                                   |
|o8 = |2|No injective map |                                                   |
|     +-+-----------------+                                                   |
|     | |       0 1  2 3 4|                                                   |
|     |3|total: 1 6 10 6 1|                                                   |
|     | |    0: 1 1  . . .|                                                   |
|     | |    1: . 3  5 2 .|                                                   |
|     | |    2: . 2  5 3 .|                                                   |
|     | |    3: . .  . 1 1|                                                   |
|     +-+-----------------+                                                   |
|     | |       0 1  2 3 4|                                                   |
|     |4|total: 1 9 16 9 1|                                                   |
|     | |    0: 1 .  . . .|                                                   |
|     | |    1: . 6  8 3 .|                                                   |
|     | |    2: . .  . . .|                                                   |
|     | |    3: . 3  8 6 .|                                                   |
|     | |    4: . .  . . 1|                                                   |
|     +-+-----------------+                                                   |
|     | |       0 1  2 3 4|                                                   |
|     |5|total: 1 9 16 9 1|                                                   |
|     | |    0: 1 .  . . .|                                                   |
|     | |    1: . 5  6 2 .|                                                   |
|     | |    2: . 1  2 1 .|                                                   |
|     | |    3: . 1  2 1 .|                                                   |
|     | |    4: . 2  6 5 .|                                                   |
|     | |    5: . .  . . 1|                                                   |
|     +-+-----------------+                                                   |
|     | |       0 1  2 3 4|                                                   |
|     |6|total: 1 9 16 9 1|                                                   |
|     | |    0: 1 .  . . .|                                                   |
|     | |    1: . 5  6 2 .|                                                   |
|     | |    2: . .  . . .|                                                   |
|     | |    3: . 2  4 2 .|                                                   |
|     | |    4: . .  . . .|                                                   |
|     | |    5: . 2  6 5 .|                                                   |
|     | |    6: . .  . . 1|                                                   |
|     +-+-----------------+                                                   |
+-----------------------------------------------------------------------------+

See also
========

  * [QQ] -- Quaternary Quartic Forms and Gorenstein rings
    (Kapustka, Kapustka, Ranestad, Schenck, Stillman, Yuan, 2021)
-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics/Section2Doc.m2:71:0.

Example Type [300a] -- An example of an apolar ideal of a quartic that cannot be obtained as a doubling of it's apolar set
**************************************************************************************************************************

To get a quartic form $F$ of type [300a], we start with a point set $\Gamma$
which is a complete intersection of three quadric forms. Then we let $F$ be a
general element in the space spanned by $v_{4}(\Gamma)\subset\mathbb{P}^{34}$.

+-----------------------------------------------------------------------------+
|i1 : kk = ZZ/101;                                                            |
+-----------------------------------------------------------------------------+
|i2 : R = kk[x_0..x_3];                                                       |
+-----------------------------------------------------------------------------+
|i3 : HT = bettiStrataExamples(R);                                            |
+-----------------------------------------------------------------------------+
|i4 : MGamma = (HT#"[300a]")_0                                                |
|                                                                             |
|o4 = | 1 1  1  1  1  1  1  1  |                                              |
|     | 2 2  2  2  -2 -2 -2 -2 |                                              |
|     | 3 3  -3 -3 3  3  -3 -3 |                                              |
|     | 1 -1 1  -1 1  -1 1  -1 |                                              |
|                                                                             |
|             4      8                                                        |
|o4 : Matrix R  <-- R                                                         |
+-----------------------------------------------------------------------------+
|i5 : linforms = flatten entries((vars R) * MGamma);                          |
+-----------------------------------------------------------------------------+
|i6 : F = sum for ell in linforms list random(kk)*ell^4                       |
|                                                                             |
|          4      3        2 2        3      4      3        2            2   |
|o6 = - 11x  + 36x x  + 39x x  + 43x x  + 26x  + 12x x  + 22x x x  + 43x x x  |
|          0      0 1      0 1      0 1      1      0 2      0 1 2      0 1 2 |
|     ------------------------------------------------------------------------|
|          3        2 2          2      2 2       3        3      4     3     |
|     - 38x x  + 12x x  - 38x x x  + 48x x  + 7x x  - 35x x  + 18x  - 3x x  - |
|          1 2      0 2      0 1 2      1 2     0 2      1 2      2     0 3   |
|     ------------------------------------------------------------------------|
|        2            2        3        2                       2             |
|     35x x x  - 36x x x  - 13x x  + 14x x x  + 29x x x x  - 45x x x  +       |
|        0 1 3      0 1 3      1 3      0 2 3      0 1 2 3      1 2 3         |
|     ------------------------------------------------------------------------|
|          2          2        3        2 2         2      2 2          2     |
|     20x x x  - 12x x x  + 42x x  + 35x x  + 7x x x  + 39x x  + 36x x x  +   |
|        0 2 3      1 2 3      2 3      0 3     0 1 3      1 3      0 2 3     |
|     ------------------------------------------------------------------------|
|            2      2 2       3        3        3      4                      |
|     22x x x  + 12x x  - 3x x  + 22x x  - 29x x  - 11x                       |
|        1 2 3      2 3     0 3      1 3      2 3      3                      |
|                                                                             |
|o6 : R                                                                       |
+-----------------------------------------------------------------------------+

We check the Betti table of $F^\perp$.

+-----------------------------+
|i7 : Fperp = inverseSystem F;|
|                             |
|o7 : Ideal of R              |
+-----------------------------+
|i8 : betti res Fperp         |
|                             |
|            0 1  2 3 4       |
|o8 = total: 1 7 12 7 1       |
|         0: 1 .  . . .       |
|         1: . 3  . . .       |
|         2: . 4 12 4 .       |
|         3: . .  . 3 .       |
|         4: . .  . . 1       |
|                             |
|o8 : BettiTally              |
+-----------------------------+

Let $Q$ be the quadratic part of $F^{\perp}$. We check that $Q=I_{\Gamma}$.

+------------------------------------+
|i9 : Q = ideal super basis(2,Fperp);|
|                                    |
|o9 : Ideal of R                     |
+------------------------------------+
|i10 : Q == pointsIdeal(MGamma)      |
|                                    |
|o10 = true                          |
+------------------------------------+

We know that $\Gamma$ is a minimal apolar set to $F$. The doubling of
$I_{\Gamma}$ is always a complete intersection. Therefore, $F^{\perp}$ cannot
be obtained as a doubling of $I_{\Gamma}$ in this case.

-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics/Section2Doc.m2:123:0.

Example Type [300b] -- An example of doubling construction
**********************************************************

To get a quartic form $F$ of type [300b], we start with a set of $7$ points and
let $F$ be power sum of them.

+---------------------------------+
|i1 : kk = ZZ/101;                |
+---------------------------------+
|i2 : R = kk[x_0..x_3];           |
+---------------------------------+
|i3 : HT = bettiStrataExamples(R);|
+---------------------------------+
|i4 : MGamma = (HT#"[300b]")_0    |
|                                 |
|o4 = | 1 0 0 0 1 19  -8  |       |
|     | 0 1 0 0 1 19  -22 |       |
|     | 0 0 1 0 1 -10 -29 |       |
|     | 0 0 0 1 1 -29 -24 |       |
|                                 |
|             4      7            |
|o4 : Matrix R  <-- R             |
+---------------------------------+
|i5 : F = quartic MGamma;         |
+---------------------------------+

We check the type of $F$.

+------------------+
|i6 : quarticType F|
|                  |
|o6 = [300ab]      |
+------------------+

The function quarticType, cannot
distinguish between type [300a] and [300b]. However, given MGamma, we now check
that $F$ is of type [300b].  Let $I_{\Gamma}$ be the ideal defining the $7$
points.

+-----------------------------------------------------------------------------+
|i7 : Fperp = inverseSystem F;                                                |
|                                                                             |
|o7 : Ideal of R                                                              |
+-----------------------------------------------------------------------------+
|i8 : betti res Fperp                                                         |
|                                                                             |
|            0 1  2 3 4                                                       |
|o8 = total: 1 7 12 7 1                                                       |
|         0: 1 .  . . .                                                       |
|         1: . 3  . . .                                                       |
|         2: . 4 12 4 .                                                       |
|         3: . .  . 3 .                                                       |
|         4: . .  . . 1                                                       |
|                                                                             |
|o8 : BettiTally                                                              |
+-----------------------------------------------------------------------------+
|i9 : IGamma = pointsIdeal MGamma;                                            |
|                                                                             |
|o9 : Ideal of R                                                              |
+-----------------------------------------------------------------------------+
|i10 : degree IGamma                                                          |
|                                                                             |
|o10 = 7                                                                      |
+-----------------------------------------------------------------------------+
|i11 : decompose IGamma -- 7 points, therefore the rank is at most 7          |
|                                                                             |
|o11 = {ideal (x , x , x ), ideal (x , x , x ), ideal (x , x , x ), ideal (x ,|
|               3   2   1           3   2   0           3   1   0           2 |
|      -----------------------------------------------------------------------|
|      x , x ), ideal (x  - x , x  - x , x  - x ), ideal (x  + 31x , x  +     |
|       1   0           2    3   1    3   0    3           2      3   1       |
|      -----------------------------------------------------------------------|
|      32x , x  + 32x ), ideal (x  + 3x , x  - 43x , x  - 34x )}              |
|         3   0      3           2     3   1      3   0      3                |
|                                                                             |
|o11 : List                                                                   |
+-----------------------------------------------------------------------------+
|i12 : betti res IGamma                                                       |
|                                                                             |
|             0 1 2 3                                                         |
|o12 = total: 1 4 6 3                                                         |
|          0: 1 . . .                                                         |
|          1: . 3 . .                                                         |
|          2: . 1 6 3                                                         |
|                                                                             |
|o12 : BettiTally                                                             |
+-----------------------------------------------------------------------------+

Let $Q$ be the quadratic part of $I_{\Gamma}$. We check that $Q$ is a complete
intersection. Performing Construction 2.17, we obtain a doubling of
$I_{\Gamma}$, which equals $F^{\perp}$.

+--------------------------------------+
|i13 : Q = ideal super basis(2,IGamma);|
|                                      |
|o13 : Ideal of R                      |
+--------------------------------------+
|i14 : betti res Q                     |
|                                      |
|             0 1 2 3                  |
|o14 = total: 1 3 3 1                  |
|          0: 1 . . .                  |
|          1: . 3 . .                  |
|          2: . . 3 .                  |
|          3: . . . 1                  |
|                                      |
|o14 : BettiTally                      |
+--------------------------------------+
|i15 : Ip = Q:IGamma;                  |
|                                      |
|o15 : Ideal of R                      |
+--------------------------------------+
|i16 : betti res Ip                    |
|                                      |
|             0 1 2 3                  |
|o16 = total: 1 3 3 1                  |
|          0: 1 3 3 1                  |
|                                      |
|o16 : BettiTally                      |
+--------------------------------------+
|i17 : v = random(2,(Fperp:Ip));       |
+--------------------------------------+
|i18 : Fperp == IGamma + v*Ip          |
|                                      |
|o18 = true                            |
+--------------------------------------+

See also
========

  * [QQ] -- Quaternary Quartic Forms and Gorenstein rings
    (Kapustka, Kapustka, Ranestad, Schenck, Stillman, Yuan, 2021)
-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics/Section2Doc.m2:169:0.

Example Type [300c] -- The third family of type [300]
*****************************************************

To get a quartic form $F$ of type [300c], we start with a set of $7$ points,
with $3$ of them in a line, and let $F$ be their power sum.

+---------------------------------+
|i1 : kk = ZZ/101;                |
+---------------------------------+
|i2 : R = kk[x_0..x_3];           |
+---------------------------------+
|i3 : HT = bettiStrataExamples(R);|
+---------------------------------+
|i4 : MGamma = (HT#"[300c]")_0    |
|                                 |
|o4 = | 1 0 1 -38 34  -18 -28 |   |
|     | 0 1 1 -16 19  -13 -47 |   |
|     | 0 0 0 39  -47 -43 38  |   |
|     | 0 0 0 21  -39 -15 2   |   |
|                                 |
|             4      7            |
|o4 : Matrix R  <-- R             |
+---------------------------------+
|i5 : IGamma = pointsIdeal MGamma;|
|                                 |
|o5 : Ideal of R                  |
+---------------------------------+
|i6 : F = quartic MGamma;         |
+---------------------------------+

We check the type of $F^{\perp}$ and see that the quadratic part $Q$ of
$F^{\perp}$ is not a complete intersection.

+------------------+
|i7 : quarticType F|
|                  |
|o7 = [300c]       |
+------------------+
+--------------------------------------+
|i8 : Fperp = inverseSystem F;         |
|                                      |
|o8 : Ideal of R                       |
+--------------------------------------+
|i9 : betti res Fperp                  |
|                                      |
|            0 1  2 3 4                |
|o9 = total: 1 7 12 7 1                |
|         0: 1 .  . . .                |
|         1: . 3  . . .                |
|         2: . 4 12 4 .                |
|         3: . .  . 3 .                |
|         4: . .  . . 1                |
|                                      |
|o9 : BettiTally                       |
+--------------------------------------+
|i10 : Q = ideal super basis (2,Fperp);|
|                                      |
|o10 : Ideal of R                      |
+--------------------------------------+
|i11 : betti res Q                     |
|                                      |
|             0 1 2 3                  |
|o11 = total: 1 3 4 2                  |
|          0: 1 . . .                  |
|          1: . 3 . .                  |
|          2: . . 4 2                  |
|                                      |
|o11 : BettiTally                      |
+--------------------------------------+

Now we construct a doubling of $I_{\Gamma}$, which is not necessary the same as
$F^{\perp}$, but is of type [300c].

Let $J$ be a subideal of $I_{\Gamma}$ which is a $(2,2,3)$ complete
intersection.

+--------------------------------------------------------------------+
|i12 : J = ideal(random(2,IGamma),random(2,IGamma),random(3,IGamma));|
|                                                                    |
|o12 : Ideal of R                                                    |
+--------------------------------------------------------------------+
|i13 : betti res J                                                   |
|                                                                    |
|             0 1 2 3                                                |
|o13 = total: 1 3 3 1                                                |
|          0: 1 . . .                                                |
|          1: . 2 . .                                                |
|          2: . 1 1 .                                                |
|          3: . . 2 .                                                |
|          4: . . . 1                                                |
|                                                                    |
|o13 : BettiTally                                                    |
+--------------------------------------------------------------------+

The colon ideal $I_{p}=J:I_{\Gamma}$ is a set of $5$ points. Performing
Construction 2.17, we can find a doubling of $I_{\Gamma}$, which is of type
[300c].

+-----------------------------------------------------------------------------+
|i14 : Ip = J : IGamma                                                        |
|                                                                             |
|                       2                                 2            2      |
|o14 = ideal (x x  - 18x  + 14x x  + 49x x  - 39x x  + 44x , x x  + 21x  -    |
|              1 2      2      0 3      1 3      2 3      3   0 2      2      |
|      -----------------------------------------------------------------------|
|                                    2   2      2                             |
|      43x x  - 50x x  + 14x x  + 35x , x  - 42x  - 29x x  - 32x x  - 36x x  +|
|         0 3      1 3      2 3      3   1      2      0 3      1 3      2 3  |
|      -----------------------------------------------------------------------|
|         2            2                                 2   2     2          |
|      14x , x x  + 19x  + 44x x  - 36x x  - 23x x  - 35x , x  + 2x  - 23x x  |
|         3   0 1      2      0 3      1 3      2 3      3   0     2      0 3 |
|      -----------------------------------------------------------------------|
|                             2                                               |
|      - 32x x  - 18x x  - 31x )                                              |
|           1 3      2 3      3                                               |
|                                                                             |
|o14 : Ideal of R                                                             |
+-----------------------------------------------------------------------------+
|i15 : betti res (Fperp:Ip)                                                   |
|                                                                             |
|             0 1  2 3 4                                                      |
|o15 = total: 1 7 11 8 3                                                      |
|          0: 1 .  . . .                                                      |
|          1: . 7  8 . .                                                      |
|          2: . .  3 8 3                                                      |
|                                                                             |
|o15 : BettiTally                                                             |
+-----------------------------------------------------------------------------+
|i16 : l = random(1,R);                                                       |
+-----------------------------------------------------------------------------+
|i17 : betti res (IGamma+l*Ip)                                                |
|                                                                             |
|             0 1  2 3 4                                                      |
|o17 = total: 1 7 12 7 1                                                      |
|          0: 1 .  . . .                                                      |
|          1: . 3  . . .                                                      |
|          2: . 4 12 4 .                                                      |
|          3: . .  . 3 .                                                      |
|          4: . .  . . 1                                                      |
|                                                                             |
|o17 : BettiTally                                                             |
+-----------------------------------------------------------------------------+

See also
========

  * [QQ] -- Quaternary Quartic Forms and Gorenstein rings
    (Kapustka, Kapustka, Ranestad, Schenck, Stillman, Yuan, 2021)
-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics/Section2Doc.m2:212:0.

Finding all possible betti tables for quadratic component of inverse system for quartics in 4 variables -- Material from Section 4 of [QQ]
******************************************************************************************************************************************

The following code is a slight modification of the code to find the 16 possible
betti tables. Simply go thru all the tables, but only resolve the quadratic
terms.

+-----------------------------------------------------------------------------+
|i1 : GetQuads = (d,k,n)->(                                                   |
|         R=ZZ/2[x_1..x_k];                                                   |
|         quartics=super basis(d,R);                                          |
|         MonList=apply(rank source quartics, i->quartics_(0,i));             |
|         L=subsets(MonList,n);                                               |
|         J=apply(L, j->(F=gens ideal sum j;                                  |
|         InvSysF=fromDual F;                                                 |
|         Idegs=degrees source mingens ideal InvSysF;                         |
|         if (not ((member({1},Idegs)))) then minimalBetti coker super        |
|         Jlist =drop(unique J,1);                                            |
|         netList pack(4,Jlist))                                              |
|                                                                             |
|o1 = GetQuads                                                                |
|                                                                             |
|o1 : FunctionClosure                                                         |
|-----------------------------------------------------------------------------|
|basis(2, ideal InvSysF)));                                                   |
+-----------------------------------------------------------------------------+
+--------------------------------------------------------------------+
|i2 : GetQuads(4,4,2)                                                |
|                                                                    |
|     +--------------+--------------+--------------+----------------+|
|     |       0 1 2 3|       0 1 2 3|       0 1 2 3|       0 1 2 3  ||
|o2 = |total: 1 6 8 3|total: 1 5 5 1|total: 1 4 4 1|total: 1 4 4 1  ||
|     |    0: 1 . . .|    0: 1 . . .|    0: 1 . . .|    0: 1 . . .  ||
|     |    1: . 6 8 3|    1: . 5 5 .|    1: . 4 3 .|    1: . 4 4 1  ||
|     |              |    2: . . . 1|    2: . . 1 1|                ||
|     +--------------+--------------+--------------+----------------+|
|     |       0 1 2 3|       0 1 2  |       0 1 2 3|       0 1 2 3 4||
|     |total: 1 4 5 2|total: 1 3 2  |total: 1 3 3 1|total: 1 4 6 4 1||
|     |    0: 1 . . .|    0: 1 . .  |    0: 1 . . .|    0: 1 . . . .||
|     |    1: . 4 2 .|    1: . 3 2  |    1: . 3 . .|    1: . 4 . . .||
|     |    2: . . 3 2|              |    2: . . 3 .|    2: . . 6 . .||
|     |              |              |    3: . . . 1|    3: . . . 4 .||
|     |              |              |              |    4: . . . . 1||
|     +--------------+--------------+--------------+----------------+|
|     |       0 1 2  |       0 1 2 3|       0 1 2 3|                ||
|     |total: 1 2 1  |total: 1 5 6 2|total: 1 5 6 2|                ||
|     |    0: 1 . .  |    0: 1 . . .|    0: 1 . . .|                ||
|     |    1: . 2 .  |    1: . 5 5 1|    1: . 5 6 2|                ||
|     |    2: . . 1  |    2: . . 1 1|              |                ||
|     +--------------+--------------+--------------+----------------+|
+--------------------------------------------------------------------+

See also
========

  * [QQ] -- Quaternary Quartic Forms and Gorenstein rings
    (Kapustka, Kapustka, Ranestad, Schenck, Stillman, Yuan, 2021)
-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics/Section4Doc.m2:27:0.

Finding the 16 betti tables possible for quartic forms in 4 variables, and examples -- Material from Table 6 and 7 of Appendix 1
********************************************************************************************************************************

The following code finds the 16 possible betti tables.

+-----------------------------------------------------------------------------+
|i1 : GetInv = (d,k,n)->(R=ZZ/2[x_1..x_k];                                    |
|         quartics=super basis(d,R);                                          |
|         MonList=first entries quartics;                                     |
|         L=subsets(MonList,n);                                               |
|         J=apply(L, j->(F=sum j;                                             |
|                    InvSysF=ideal fromDual F;                                |
|                    Idegs=degrees source mingens InvSysF;                    |
|                         if (not ((member({1},Idegs)))) then minimalBetti    |
|         Jlist = drop(unique J,1);  --get unique betti table, drop empty     |
|         netList pack(4,Jlist))    --format output to look nice              |
|                                                                             |
|o1 = GetInv                                                                  |
|                                                                             |
|o1 : FunctionClosure                                                         |
|-----------------------------------------------------------------------------|
| InvSysF));                                                                  |
|table from list                                                              |
+-----------------------------------------------------------------------------+
|i2 : GetInv(4,4,2)                                                           |
|                                                                             |
|     +-------------------+-----------------+-----------------+---------------|
|     |       0 1  2 3 4  |       0 1  2 3 4|       0 1  2 3 4|       0 1  2 3|
|o2 = |total: 1 9 16 9 1  |total: 1 6 10 6 1|total: 1 7 12 7 1|total: 1 9 16 9|
|     |    0: 1 .  . . .  |    0: 1 .  . . .|    0: 1 .  . . .|    0: 1 .  . .|
|     |    1: . 6  8 3 .  |    1: . 5  5 . .|    1: . 4  3 . .|    1: . 4  4 1|
|     |    2: . .  . . .  |    2: . 1  . 1 .|    2: . 3  6 3 .|    2: . 4  8 4|
|     |    3: . 3  8 6 .  |    3: . .  5 5 .|    3: . .  3 4 .|    3: . 1  4 4|
|     |    4: . .  . . 1  |    4: . .  . . 1|    4: . .  . . 1|    4: . .  . .|
|     +-------------------+-----------------+-----------------+---------------|
|     |       0 1  2 3 4  |       0 1  2 3 4|       0 1  2 3 4|       0 1 2 3 |
|     |total: 1 6 10 6 1  |total: 1 9 16 9 1|total: 1 7 12 7 1|total: 1 4 6 4 |
|     |    0: 1 .  . . .  |    0: 1 .  . . .|    0: 1 .  . . .|    0: 1 . . . |
|     |    1: . 4  2 . .  |    1: . 3  2 . .|    1: . 3  . . .|    1: . 4 . . |
|     |    2: . 2  6 2 .  |    2: . 6 12 6 .|    2: . 4 12 4 .|    2: . . 6 . |
|     |    3: . .  2 4 .  |    3: . .  2 3 .|    3: . .  . 3 .|    3: . . . 4 |
|     |    4: . .  . . 1  |    4: . .  . . 1|    4: . .  . . 1|    4: . . . . |
|     +-------------------+-----------------+-----------------+---------------|
|     |       0  1  2  3 4|       0 1  2 3 4|       0 1  2 3 4|               |
|     |total: 1 10 18 10 1|total: 1 7 12 7 1|total: 1 9 16 9 1|               |
|     |    0: 1  .  .  . .|    0: 1 .  . . .|    0: 1 .  . . .|               |
|     |    1: .  2  .  . .|    1: . 5  5 1 .|    1: . 5  6 2 .|               |
|     |    2: .  8 18  8 .|    2: . 1  2 1 .|    2: . 2  4 2 .|               |
|     |    3: .  .  .  2 .|    3: . 1  5 5 .|    3: . 2  6 5 .|               |
|     |    4: .  .  .  . 1|    4: . .  . . 1|    4: . .  . . 1|               |
|     +-------------------+-----------------+-----------------+---------------|
|-----------------------------------------------------------------------------|
|--+                                                                          |
| 4|                                                                          |
| 1|                                                                          |
| .|                                                                          |
| .|                                                                          |
| .|                                                                          |
| .|                                                                          |
| 1|                                                                          |
|--+                                                                          |
|4 |                                                                          |
|1 |                                                                          |
|. |                                                                          |
|. |                                                                          |
|. |                                                                          |
|. |                                                                          |
|1 |                                                                          |
|--+                                                                          |
|  |                                                                          |
|  |                                                                          |
|  |                                                                          |
|  |                                                                          |
|  |                                                                          |
|  |                                                                          |
|  |                                                                          |
|--+                                                                          |
+-----------------------------------------------------------------------------+

Get inverse system of all degree d polynomials in k variables, by taking sums
of n monomials. By taking sufficiently many monomials we'll get everything.
Work over Z/2 for speed, experiments suggest that even over Z/2 we get all
betti tables. If inverse system has a linear generator, ignore it. Pack results
using netlist for pretty display. For k=4=d, we get 16 betti tables by using
n=4 terms.

A stable of 16 examples, one for each of the betti tables

+-----------------------------------------------------------------------------+
|i3 : R=ZZ/101[x_1..x_4];                                                     |
+-----------------------------------------------------------------------------+
|i4 : IdealList={                                                             |
|       {x_2*x_4, x_1*x_4, x_1*x_2^2+x_3*x_4^2-x_4^3, x_1^2, x_2^3, x_3^2},   |
|       {x_2*x_3, x_1*x_3, x_2*x_4^2, x_1*x_4^2, x_1*x_2^2-x_3*x_4^2, x_3*x_4^|
|       {x_2*x_4, x_1*x_4, x_3^2*x_4, x_1*x_2*x_3+x_3*x_4^2-x_4^3, x_1^2, x_2^|
|       {x_2*x_4^2, x_1*x_4^2, x_1*x_2*x_4+x_3*x_4^2-x_4^3, x_1*x_2*x_3-x_3*x_|
|       {x_2*x_3, x_1*x_3, x_1*x_2-x_3*x_4, x_3*x_4^3-x_4^4, x_2*x_4^3, x_1*x_|
|       {x_2*x_4, x_1*x_4, x_2*x_3, x_1*x_3, x_3*x_4^3-x_4^4, x_1^2*x_2^2-x_4^|
|       {x_2*x_3, x_1*x_3, x_2*x_4^2, x_1*x_4^2, x_3^2*x_4-x_4^3, x_1*x_2^2-x_|
|       {x_2*x_4^2, x_1*x_4^2, x_3^2*x_4-x_4^3, x_1*x_2*x_4-x_3*x_4^2, x_2*x_3|
|       {x_2*x_3, x_1*x_3, x_1*x_2-x_3^2, x_3^2*x_4-x_4^3, x_1^2, x_2^2, x_3^3|
|       {x_3*x_4, x_2*x_4, x_1*x_4, x_1*x_2*x_3-x_3^3, x_3^4-x_4^4, x_1^2, x_2|
|       {x_1*x_4, x_3^2*x_4, x_2*x_3*x_4-x_4^3, x_1*x_3^2-x_3*x_4^2, x_1*x_2*x|
|       {x_1*x_4, x_1*x_3, x_3*x_4^2, x_2*x_4^2, x_2^2*x_4, x_2*x_3^2-x_4^3, x|
|       {x_3*x_4, x_2^2*x_4, x_1^2*x_4, x_2*x_3^2, x_1*x_3^2-x_2*x_4^2, x_2^2*|
|       {x_3*x_4 , x_2^2*x_4, x_3^3-x_1*x_2*x_4, x_2*x_3^2, x_2^2*x_3-x_1^2*x_|
|       {x_3*x_4^2, x_2*x_4^2, x_1*x_4^2, x_3^2*x_4,x_2^2*x_4, x_1^2*x_4, x_3^|
|       {x_1^2,x_2^2,x_3^2,x_4^2}};                                           |
|-----------------------------------------------------------------------------|
|3-x_4^4, x_1^2, x_2^3, x_3^2},                                               |
|2, x_3^3},                                                                   |
|4^2, x_1^2, x_2^2, x_3^2},                                                   |
|4^3, x_1^2, x_2^2, x_3^2},                                                   |
|4, x_1^3, x_2^3, x_3^2},                                                     |
|4^3, x_1^2, x_2^3, x_3^3},                                                   |
|^2, x_1*x_3^2, x_1*x_2*x_3-x_4^3, x_1^2, x_2^2, x_3^3},                      |
|},                                                                           |
|^2},                                                                         |
|_3-x_2*x_4^2, x_1^2, x_2^2, x_3^3},                                          |
|_2^2*x_3, x_1*x_2^2-x_3^2*x_4, x_1^2, x_2^4, x_3^3},                         |
|x_3-x_1*x_4^2, x_1*x_2*x_3, x_2^3-x_1^2*x_3, x_1*x_2^2, x_1^2*x_2, x_1^3, x_2|
|4, x_1*x_2*x_3, x_1^2*x_3, x_2^3-x_1*x_3^2, x_1*x_2^2, x_1^3, x_2^4, x_3^4, x|
|3-x_1*x_2*x_4, x_2*x_3^2, x_1*x_3^2, x_2^2*x_3, x_1*x_2*x_3-x_4^3, x_1^2*x_3,|
|-----------------------------------------------------------------------------|
|^4, x_3^3, x_4^3},                                                           |
|_4^2},                                                                       |
| x_2^3-x_1*x_3*x_4, x_1*x_2^2, x_1^2*x_2,x_1^3-x_2*x_3*x_4},                 |
+-----------------------------------------------------------------------------+

Display in a nice format

+-----------------------------------------------------------------------------+
|i5 : netList(pack(4,apply(IdealList,i->minimalBetti ideal i)))               |
|                                                                             |
|     +-------------------+-------------------+-------------------+-----------|
|     |       0 1  2 3 4  |       0 1  2 3 4  |       0 1  2 3 4  |       0 1 |
|o5 = |total: 1 6 10 6 1  |total: 1 9 16 9 1  |total: 1 7 12 7 1  |total: 1 7 |
|     |    0: 1 .  . . .  |    0: 1 .  . . .  |    0: 1 .  . . .  |    0: 1 . |
|     |    1: . 4  2 . .  |    1: . 4  4 1 .  |    1: . 4  3 . .  |    1: . 3 |
|     |    2: . 2  6 2 .  |    2: . 4  8 4 .  |    2: . 3  6 3 .  |    2: . 4 |
|     |    3: . .  2 4 .  |    3: . 1  4 4 .  |    3: . .  3 4 .  |    3: . . |
|     |    4: . .  . . 1  |    4: . .  . . 1  |    4: . .  . . 1  |    4: . . |
|     +-------------------+-------------------+-------------------+-----------|
|     |       0 1  2 3 4  |       0 1  2 3 4  |       0 1  2 3 4  |       0  1|
|     |total: 1 9 16 9 1  |total: 1 9 16 9 1  |total: 1 9 16 9 1  |total: 1 10|
|     |    0: 1 .  . . .  |    0: 1 .  . . .  |    0: 1 .  . . .  |    0: 1  .|
|     |    1: . 6  8 3 .  |    1: . 5  6 2 .  |    1: . 3  2 . .  |    1: .  2|
|     |    2: . .  . . .  |    2: . 2  4 2 .  |    2: . 6 12 6 .  |    2: .  8|
|     |    3: . 3  8 6 .  |    3: . 2  6 5 .  |    3: . .  2 3 .  |    3: .  .|
|     |    4: . .  . . 1  |    4: . .  . . 1  |    4: . .  . . 1  |    4: .  .|
|     +-------------------+-------------------+-------------------+-----------|
|     |       0 1  2 3 4  |       0 1  2 3 4  |       0 1  2 3 4  |       0  1|
|     |total: 1 6 10 6 1  |total: 1 7 12 7 1  |total: 1 8 14 8 1  |total: 1 11|
|     |    0: 1 .  . . .  |    0: 1 .  . . .  |    0: 1 .  . . .  |    0: 1  .|
|     |    1: . 5  5 . .  |    1: . 5  5 1 .  |    1: . 3  1 . .  |    1: .  3|
|     |    2: . 1  . 1 .  |    2: . 1  2 1 .  |    2: . 5 12 5 .  |    2: .  7|
|     |    3: . .  5 5 .  |    3: . 1  5 5 .  |    3: . .  1 3 .  |    3: .  1|
|     |    4: . .  . . 1  |    4: . .  . . 1  |    4: . .  . . 1  |    4: .  .|
|     +-------------------+-------------------+-------------------+-----------|
|     |       0  1  2  3 4|       0  1  2  3 4|       0  1  2  3 4|       0 1 |
|     |total: 1 13 24 13 1|total: 1 11 20 11 1|total: 1 16 30 16 1|total: 1 4 |
|     |    0: 1  .  .  . .|    0: 1  .  .  . .|    0: 1  .  .  . .|    0: 1 . |
|     |    1: .  1  .  . .|    1: .  2  1  . .|    1: .  .  .  . .|    1: . 4 |
|     |    2: . 12 24 12 .|    2: .  9 18  9 .|    2: . 16 30 16 .|    2: . . |
|     |    3: .  .  .  1 .|    3: .  .  1  2 .|    3: .  .  .  . .|    3: . . |
|     |    4: .  .  .  . 1|    4: .  .  .  . 1|    4: .  .  .  . 1|    4: . . |
|     +-------------------+-------------------+-------------------+-----------|
|-----------------------------------------------------------------------------|
|--------+                                                                    |
| 2 3 4  |                                                                    |
|12 7 1  |                                                                    |
| . . .  |                                                                    |
| . . .  |                                                                    |
|12 4 .  |                                                                    |
| . 3 .  |                                                                    |
| . . 1  |                                                                    |
|--------+                                                                    |
|  2  3 4|                                                                    |
| 18 10 1|                                                                    |
|  .  . .|                                                                    |
|  .  . .|                                                                    |
| 18  8 .|                                                                    |
|  .  2 .|                                                                    |
|  .  . 1|                                                                    |
|--------+                                                                    |
|  2  3 4|                                                                    |
| 20 11 1|                                                                    |
|  .  . .|                                                                    |
|  3  1 .|                                                                    |
| 14  7 .|                                                                    |
|  3  3 .|                                                                    |
|  .  . 1|                                                                    |
|--------+                                                                    |
|2 3 4   |                                                                    |
|6 4 1   |                                                                    |
|. . .   |                                                                    |
|. . .   |                                                                    |
|6 . .   |                                                                    |
|. 4 .   |                                                                    |
|. . 1   |                                                                    |
|--------+                                                                    |
+-----------------------------------------------------------------------------+
+-----------------------------------------------------------------------------+
|i6 : Qs = apply(IdealList, I -> first flatten entries inverseSystem(5, ideal |
|                                                                             |
|             2          3      4         2          3      4           2     |
|o6 = {- 50x x x  + 17x x  - 21x , - 50x x x  + 17x x  - 21x , - 50x x x  +   |
|           1 2 3      3 4      4       1 2 4      3 4      4       1 2 3     |
|     ------------------------------------------------------------------------|
|          3      4                  3      4           2        3      4     |
|     17x x  - 21x , x x x x  + 17x x  - 21x , - 50x x x  + 17x x  - 21x , -  |
|        3 4      4   1 2 3 4      3 4      4       1 2 4      3 4      4     |
|     ------------------------------------------------------------------------|
|        2 2        3      4         2        2 2      4                2 2   |
|     25x x  + 17x x  - 21x , - 50x x x  - 25x x  - 21x , x x x x  - 25x x  - |
|        1 2      3 4      4       1 2 4      3 4      4   1 2 3 4      3 4   |
|     ------------------------------------------------------------------------|
|        4           2      2 2      4           2      4      4           2  |
|     21x , - 50x x x  - 25x x  - 21x , - 50x x x  - 21x  - 21x , - 50x x x  -|
|        4       1 2 4      3 4      4       1 2 3      3      4       1 2 3  |
|     ------------------------------------------------------------------------|
|            2      4       3        2        4     3        2 2          2   |
|     50x x x  - 21x , 17x x  - 50x x x  - 21x , 17x x  - 25x x  - 50x x x ,  |
|        2 3 4      4     1 2      2 3 4      4     2 3      1 3      1 2 4   |
|     ------------------------------------------------------------------------|
|        3          3      2           4      4      4                 4      |
|     17x x  + 17x x  - 50x x x , - 21x  - 21x  - 21x  + x x x x  - 21x ,     |
|        2 3      1 3      1 2 4       1      2      3    1 2 3 4      4      |
|     ------------------------------------------------------------------------|
|     x x x x }                                                               |
|      1 2 3 4                                                                |
|                                                                             |
|o6 : List                                                                    |
|-----------------------------------------------------------------------------|
|I))                                                                          |
+-----------------------------------------------------------------------------+
|i7 : for F in Qs list quarticType F                                          |
|                                                                             |
|o7 = {[420], [441a], [430], [300ab], [683], [562], [320], [200], [550],      |
|     ------------------------------------------------------------------------|
|     [551], [310], [331], [100], [210], [000], [400]}                        |
|                                                                             |
|o7 : List                                                                    |
+-----------------------------------------------------------------------------+

See also
========

  * inverseSystem(RingElement) (InverseSystems) -- Inverse
    systems with equivariance
  * quarticType(RingElement) -- the Betti
    stratum a specific quartic lies on
  * [QQ] -- Quaternary Quartic Forms and Gorenstein rings
    (Kapustka, Kapustka, Ranestad, Schenck, Stillman, Yuan, 2021)
-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics/Section1Doc.m2:61:0.

Finding the Betti stratum of a given quartic -- the 19 Betti strata
*******************************************************************

There are 19 Betti strata of quartics forms in four variables. Given a quartic,
the stratum that it lives on is determined by the Betti diagram of the ideal of
quadrics in the inverse system, except for [300] and [441].  The function
quarticType(RingElement), uses this information,
together with a finer analysis to determine which stratum those cases live on.
The cases [300a] and [300b] are more difficult to separate, as it depends on
the exact rank of the quartic.  So this function returns [300ab] in this case.

In any case, if we know a set of points which compute the rank, then that ideal
and the quadratic part completely determine which stratum the quartic is on.

+-----------------------------------------------------------------------------+
|i1 : kk = ZZ/101;                                                            |
+-----------------------------------------------------------------------------+
|i2 : R = kk[x_0..x_3];                                                       |
+-----------------------------------------------------------------------------+
|i3 : HT = bettiStrataExamples R;                                             |
+-----------------------------------------------------------------------------+
|i4 : netList prepend(                                                        |
|         {"type", "I = ideal of points", "quadrics in I", "Fperp", "doubling |
|         sort for k in keys HT list (                                        |
|         I := pointsIdeal((HT#k)_0);                                         |
|         Q := ideal super basis(2, I);                                       |
|         F := quartic (HT#k)_0;                                              |
|         {k, minimalBetti I,                                                 |
|             minimalBetti Q,                                                 |
|             minimalBetti inverseSystem F,                                   |
|             minimalBetti doubling(8, I)}                                    |
|         ))                                                                  |
|                                                                             |
|     +------+-------------------+--------------+-------------------+---------|
|o4 = |type  |I = ideal of points|quadrics in I |Fperp              |doubling |
|     +------+-------------------+--------------+-------------------+---------|
|     |      |       0  1  2 3   |       0      |       0  1  2  3 4|       0 |
|     |[000] |total: 1 10 15 6   |total: 1      |total: 1 16 30 16 1|total: 1 |
|     |      |    0: 1  .  . .   |    0: 1      |    0: 1  .  .  . .|    0: 1 |
|     |      |    1: .  .  . .   |              |    1: .  .  .  . .|    1: . |
|     |      |    2: . 10 15 6   |              |    2: . 16 30 16 .|    2: . |
|     |      |                   |              |    3: .  .  .  . .|    3: . |
|     |      |                   |              |    4: .  .  .  . 1|    4: . |
|     +------+-------------------+--------------+-------------------+---------|
|     |      |       0 1  2 3    |       0 1    |       0  1  2  3 4|       0 |
|     |[100] |total: 1 8 12 5    |total: 1 1    |total: 1 13 24 13 1|total: 1 |
|     |      |    0: 1 .  . .    |    0: 1 .    |    0: 1  .  .  . .|    0: 1 |
|     |      |    1: . 1  . .    |    1: . 1    |    1: .  1  .  . .|    1: . |
|     |      |    2: . 7 12 5    |              |    2: . 12 24 12 .|    2: . |
|     |      |                   |              |    3: .  .  .  1 .|    3: . |
|     |      |                   |              |    4: .  .  .  . 1|    4: . |
|     +------+-------------------+--------------+-------------------+---------|
|     |      |       0 1 2 3     |       0 1 2  |       0  1  2  3 4|       0 |
|     |[200] |total: 1 6 9 4     |total: 1 2 1  |total: 1 10 18 10 1|total: 1 |
|     |      |    0: 1 . . .     |    0: 1 . .  |    0: 1  .  .  . .|    0: 1 |
|     |      |    1: . 2 . .     |    1: . 2 .  |    1: .  2  .  . .|    1: . |
|     |      |    2: . 4 9 4     |    2: . . 1  |    2: .  8 18  8 .|    2: . |
|     |      |                   |              |    3: .  .  .  2 .|    3: . |
|     |      |                   |              |    4: .  .  .  . 1|    4: . |
|     +------+-------------------+--------------+-------------------+---------|
|     |      |       0 1  2 3    |       0 1 2  |       0  1  2  3 4|       0 |
|     |[210] |total: 1 7 10 4    |total: 1 2 1  |total: 1 11 20 11 1|total: 1 |
|     |      |    0: 1 .  . .    |    0: 1 . .  |    0: 1  .  .  . .|    0: 1 |
|     |      |    1: . 2  1 .    |    1: . 2 1  |    1: .  2  1  . .|    1: . |
|     |      |    2: . 5  9 4    |              |    2: .  9 18  9 .|    2: . |
|     |      |                   |              |    3: .  .  1  2 .|    3: . |
|     |      |                   |              |    4: .  .  .  . 1|    4: . |
|     +------+-------------------+--------------+-------------------+---------|
|     |      |       0 1 2 3     |       0 1 2 3|       0 1  2 3 4  |       0 |
|     |[300a]|total: 1 3 3 1     |total: 1 3 3 1|total: 1 7 12 7 1  |total: 1 |
|     |      |    0: 1 . . .     |    0: 1 . . .|    0: 1 .  . . .  |    0: 1 |
|     |      |    1: . 3 . .     |    1: . 3 . .|    1: . 3  . . .  |    1: . |
|     |      |    2: . . 3 .     |    2: . . 3 .|    2: . 4 12 4 .  |    2: . |
|     |      |    3: . . . 1     |    3: . . . 1|    3: . .  . 3 .  |    3: . |
|     |      |                   |              |    4: . .  . . 1  |    4: . |
|     +------+-------------------+--------------+-------------------+---------|
|     |      |       0 1 2 3     |       0 1 2 3|       0 1  2 3 4  |       0 |
|     |[300b]|total: 1 4 6 3     |total: 1 3 3 1|total: 1 7 12 7 1  |total: 1 |
|     |      |    0: 1 . . .     |    0: 1 . . .|    0: 1 .  . . .  |    0: 1 |
|     |      |    1: . 3 . .     |    1: . 3 . .|    1: . 3  . . .  |    1: . |
|     |      |    2: . 1 6 3     |    2: . . 3 .|    2: . 4 12 4 .  |    2: . |
|     |      |                   |    3: . . . 1|    3: . .  . 3 .  |    3: . |
|     |      |                   |              |    4: . .  . . 1  |    4: . |
|     +------+-------------------+--------------+-------------------+---------|
|     |      |       0 1 2 3     |       0 1 2 3|       0 1  2 3 4  |       0 |
|     |[300c]|total: 1 4 6 3     |total: 1 3 4 2|total: 1 7 12 7 1  |total: 1 |
|     |      |    0: 1 . . .     |    0: 1 . . .|    0: 1 .  . . .  |    0: 1 |
|     |      |    1: . 3 . .     |    1: . 3 . .|    1: . 3  . . .  |    1: . |
|     |      |    2: . 1 6 3     |    2: . . 4 2|    2: . 4 12 4 .  |    2: . |
|     |      |                   |              |    3: . .  . 3 .  |    3: . |
|     |      |                   |              |    4: . .  . . 1  |    4: . |
|     +------+-------------------+--------------+-------------------+---------|
|     |      |       0 1 2 3     |       0 1 2 3|       0 1  2 3 4  |       0 |
|     |[310] |total: 1 5 7 3     |total: 1 3 3 1|total: 1 8 14 8 1  |total: 1 |
|     |      |    0: 1 . . .     |    0: 1 . . .|    0: 1 .  . . .  |    0: 1 |
|     |      |    1: . 3 1 .     |    1: . 3 1 .|    1: . 3  1 . .  |    1: . |
|     |      |    2: . 2 6 3     |    2: . . 2 1|    2: . 5 12 5 .  |    2: . |
|     |      |                   |              |    3: . .  1 3 .  |    3: . |
|     |      |                   |              |    4: . .  . . 1  |    4: . |
|     +------+-------------------+--------------+-------------------+---------|
|     |      |       0 1 2 3     |       0 1 2  |       0 1  2 3 4  |       0 |
|     |[320] |total: 1 6 8 3     |total: 1 3 2  |total: 1 9 16 9 1  |total: 1 |
|     |      |    0: 1 . . .     |    0: 1 . .  |    0: 1 .  . . .  |    0: 1 |
|     |      |    1: . 3 2 .     |    1: . 3 2  |    1: . 3  2 . .  |    1: . |
|     |      |    2: . 3 6 3     |              |    2: . 6 12 6 .  |    2: . |
|     |      |                   |              |    3: . .  2 3 .  |    3: . |
|     |      |                   |              |    4: . .  . . 1  |    4: . |
|     +------+-------------------+--------------+-------------------+---------|
|     |      |       0 1  2 3    |       0 1 2 3|       0  1  2  3 4|       0 |
|     |[331] |total: 1 7 10 4    |total: 1 3 3 1|total: 1 11 20 11 1|total: 1 |
|     |      |    0: 1 .  . .    |    0: 1 . . .|    0: 1  .  .  . .|    0: 1 |
|     |      |    1: . 3  3 1    |    1: . 3 3 1|    1: .  3  3  1 .|    1: . |
|     |      |    2: . 4  7 3    |              |    2: .  7 14  7 .|    2: . |
|     |      |                   |              |    3: .  1  3  3 .|    3: . |
|     |      |                   |              |    4: .  .  .  . 1|    4: . |
|     +------+-------------------+--------------+-------------------+---------|
|     |      |       0 1 2 3     |       0 1 2 3|       0 1  2 3 4  |       0 |
|     |[420] |total: 1 4 5 2     |total: 1 4 5 2|total: 1 6 10 6 1  |total: 1 |
|     |      |    0: 1 . . .     |    0: 1 . . .|    0: 1 .  . . .  |    0: 1 |
|     |      |    1: . 4 2 .     |    1: . 4 2 .|    1: . 4  2 . .  |    1: . |
|     |      |    2: . . 3 2     |    2: . . 3 2|    2: . 2  6 2 .  |    2: . |
|     |      |                   |              |    3: . .  2 4 .  |    3: . |
|     |      |                   |              |    4: . .  . . 1  |    4: . |
|     +------+-------------------+--------------+-------------------+---------|
|     |      |       0 1 2 3     |       0 1 2 3|       0 1  2 3 4  |       0 |
|     |[430] |total: 1 5 6 2     |total: 1 4 4 1|total: 1 7 12 7 1  |total: 1 |
|     |      |    0: 1 . . .     |    0: 1 . . .|    0: 1 .  . . .  |    0: 1 |
|     |      |    1: . 4 3 .     |    1: . 4 3 .|    1: . 4  3 . .  |    1: . |
|     |      |    2: . 1 3 2     |    2: . . 1 1|    2: . 3  6 3 .  |    2: . |
|     |      |                   |              |    3: . .  3 4 .  |    3: . |
|     |      |                   |              |    4: . .  . . 1  |    4: . |
|     +------+-------------------+--------------+-------------------+---------|
|     |      |       0 1 2 3     |       0 1 2 3|       0 1  2 3 4  |       0 |
|     |[441a]|total: 1 6 8 3     |total: 1 4 4 1|total: 1 9 16 9 1  |total: 1 |
|     |      |    0: 1 . . .     |    0: 1 . . .|    0: 1 .  . . .  |    0: 1 |
|     |      |    1: . 4 4 1     |    1: . 4 4 1|    1: . 4  4 1 .  |    1: . |
|     |      |    2: . 2 4 2     |              |    2: . 4  8 4 .  |    2: . |
|     |      |                   |              |    3: . 1  4 4 .  |    3: . |
|     |      |                   |              |    4: . .  . . 1  |    4: . |
|     +------+-------------------+--------------+-------------------+---------|
|     |      |       0 1 2 3     |       0 1 2 3|       0 1  2 3 4  |       0 |
|     |[441b]|total: 1 6 8 3     |total: 1 4 4 1|total: 1 9 16 9 1  |total: 1 |
|     |      |    0: 1 . . .     |    0: 1 . . .|    0: 1 .  . . .  |    0: 1 |
|     |      |    1: . 4 4 1     |    1: . 4 4 1|    1: . 4  4 1 .  |    1: . |
|     |      |    2: . 2 4 2     |              |    2: . 4  8 4 .  |    2: . |
|     |      |                   |              |    3: . 1  4 4 .  |    3: . |
|     |      |                   |              |    4: . .  . . 1  |    4: . |
|     +------+-------------------+--------------+-------------------+---------|
|     |      |       0 1 2 3     |       0 1 2 3|       0 1  2 3 4  |       0 |
|     |[550] |total: 1 5 5 1     |total: 1 5 5 1|total: 1 6 10 6 1  |total: 1 |
|     |      |    0: 1 . . .     |    0: 1 . . .|    0: 1 .  . . .  |    0: 1 |
|     |      |    1: . 5 5 .     |    1: . 5 5 .|    1: . 5  5 . .  |    1: . |
|     |      |    2: . . . 1     |    2: . . . 1|    2: . 1  . 1 .  |    2: . |
|     |      |                   |              |    3: . .  5 5 .  |    3: . |
|     |      |                   |              |    4: . .  . . 1  |    4: . |
|     +------+-------------------+--------------+-------------------+---------|
|     |      |       0 1 2 3     |       0 1 2 3|       0 1  2 3 4  |       0 |
|     |[551] |total: 1 5 6 2     |total: 1 5 6 2|total: 1 7 12 7 1  |total: 1 |
|     |      |    0: 1 . . .     |    0: 1 . . .|    0: 1 .  . . .  |    0: 1 |
|     |      |    1: . 5 5 1     |    1: . 5 5 1|    1: . 5  5 1 .  |    1: . |
|     |      |    2: . . 1 1     |    2: . . 1 1|    2: . 1  2 1 .  |    2: . |
|     |      |                   |              |    3: . 1  5 5 .  |    3: . |
|     |      |                   |              |    4: . .  . . 1  |    4: . |
|     +------+-------------------+--------------+-------------------+---------|
|     |      |       0 1 2 3     |       0 1 2 3|       0 1  2 3 4  |       0 |
|     |[562] |total: 1 6 8 3     |total: 1 5 6 2|total: 1 9 16 9 1  |total: 1 |
|     |      |    0: 1 . . .     |    0: 1 . . .|    0: 1 .  . . .  |    0: 1 |
|     |      |    1: . 5 6 2     |    1: . 5 6 2|    1: . 5  6 2 .  |    1: . |
|     |      |    2: . 1 2 1     |              |    2: . 2  4 2 .  |    2: . |
|     |      |                   |              |    3: . 2  6 5 .  |    3: . |
|     |      |                   |              |    4: . .  . . 1  |    4: . |
|     +------+-------------------+--------------+-------------------+---------|
|     |      |       0 1 2 3     |       0 1 2 3|       0 1  2 3 4  |       0 |
|     |[683] |total: 1 6 8 3     |total: 1 6 8 3|total: 1 9 16 9 1  |total: 1 |
|     |      |    0: 1 . . .     |    0: 1 . . .|    0: 1 .  . . .  |    0: 1 |
|     |      |    1: . 6 8 3     |    1: . 6 8 3|    1: . 6  8 3 .  |    1: . |
|     |      |                   |              |    2: . .  . . .  |    2: . |
|     |      |                   |              |    3: . 3  8 6 .  |    3: . |
|     |      |                   |              |    4: . .  . . 1  |    4: . |
|     +------+-------------------+--------------+-------------------+---------|
|-----------------------------------------------------------------------------|
|of points"},                                                                 |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|----------+                                                                  |
|of points |                                                                  |
|----------+                                                                  |
| 1  2  3 4|                                                                  |
|16 30 16 1|                                                                  |
| .  .  . .|                                                                  |
| .  .  . .|                                                                  |
|16 30 16 .|                                                                  |
| .  .  . .|                                                                  |
| .  .  . 1|                                                                  |
|----------+                                                                  |
| 1  2  3 4|                                                                  |
|13 24 13 1|                                                                  |
| .  .  . .|                                                                  |
| 1  .  . .|                                                                  |
|12 24 12 .|                                                                  |
| .  .  1 .|                                                                  |
| .  .  . 1|                                                                  |
|----------+                                                                  |
| 1  2  3 4|                                                                  |
|10 18 10 1|                                                                  |
| .  .  . .|                                                                  |
| 2  .  . .|                                                                  |
| 8 18  8 .|                                                                  |
| .  .  2 .|                                                                  |
| .  .  . 1|                                                                  |
|----------+                                                                  |
| 1  2  3 4|                                                                  |
|11 20 11 1|                                                                  |
| .  .  . .|                                                                  |
| 2  1  . .|                                                                  |
| 9 18  9 .|                                                                  |
| .  1  2 .|                                                                  |
| .  .  . 1|                                                                  |
|----------+                                                                  |
|1 2 3 4   |                                                                  |
|4 6 4 1   |                                                                  |
|. . . .   |                                                                  |
|4 . . .   |                                                                  |
|. 6 . .   |                                                                  |
|. . 4 .   |                                                                  |
|. . . 1   |                                                                  |
|----------+                                                                  |
|1  2 3 4  |                                                                  |
|7 12 7 1  |                                                                  |
|.  . . .  |                                                                  |
|3  . . .  |                                                                  |
|4 12 4 .  |                                                                  |
|.  . 3 .  |                                                                  |
|.  . . 1  |                                                                  |
|----------+                                                                  |
|1  2 3 4  |                                                                  |
|7 12 7 1  |                                                                  |
|.  . . .  |                                                                  |
|3  . . .  |                                                                  |
|4 12 4 .  |                                                                  |
|.  . 3 .  |                                                                  |
|.  . . 1  |                                                                  |
|----------+                                                                  |
|1  2 3 4  |                                                                  |
|8 14 8 1  |                                                                  |
|.  . . .  |                                                                  |
|3  1 . .  |                                                                  |
|5 12 5 .  |                                                                  |
|.  1 3 .  |                                                                  |
|.  . . 1  |                                                                  |
|----------+                                                                  |
|1  2 3 4  |                                                                  |
|9 16 9 1  |                                                                  |
|.  . . .  |                                                                  |
|3  2 . .  |                                                                  |
|6 12 6 .  |                                                                  |
|.  2 3 .  |                                                                  |
|.  . . 1  |                                                                  |
|----------+                                                                  |
| 1  2  3 4|                                                                  |
|11 20 11 1|                                                                  |
| .  .  . .|                                                                  |
| 3  3  1 .|                                                                  |
| 7 14  7 .|                                                                  |
| 1  3  3 .|                                                                  |
| .  .  . 1|                                                                  |
|----------+                                                                  |
|1  2 3 4  |                                                                  |
|6 10 6 1  |                                                                  |
|.  . . .  |                                                                  |
|4  2 . .  |                                                                  |
|2  6 2 .  |                                                                  |
|.  2 4 .  |                                                                  |
|.  . . 1  |                                                                  |
|----------+                                                                  |
|1  2 3 4  |                                                                  |
|7 12 7 1  |                                                                  |
|.  . . .  |                                                                  |
|4  3 . .  |                                                                  |
|3  6 3 .  |                                                                  |
|.  3 4 .  |                                                                  |
|.  . . 1  |                                                                  |
|----------+                                                                  |
|1  2 3 4  |                                                                  |
|9 16 9 1  |                                                                  |
|.  . . .  |                                                                  |
|4  4 1 .  |                                                                  |
|4  8 4 .  |                                                                  |
|1  4 4 .  |                                                                  |
|.  . . 1  |                                                                  |
|----------+                                                                  |
|1  2 3 4  |                                                                  |
|9 16 9 1  |                                                                  |
|.  . . .  |                                                                  |
|4  4 1 .  |                                                                  |
|4  8 4 .  |                                                                  |
|1  4 4 .  |                                                                  |
|.  . . 1  |                                                                  |
|----------+                                                                  |
|1  2 3 4  |                                                                  |
|6 10 6 1  |                                                                  |
|.  . . .  |                                                                  |
|5  5 . .  |                                                                  |
|1  . 1 .  |                                                                  |
|.  5 5 .  |                                                                  |
|.  . . 1  |                                                                  |
|----------+                                                                  |
|1  2 3 4  |                                                                  |
|7 12 7 1  |                                                                  |
|.  . . .  |                                                                  |
|5  5 1 .  |                                                                  |
|1  2 1 .  |                                                                  |
|1  5 5 .  |                                                                  |
|.  . . 1  |                                                                  |
|----------+                                                                  |
|1  2 3 4  |                                                                  |
|9 16 9 1  |                                                                  |
|.  . . .  |                                                                  |
|5  6 2 .  |                                                                  |
|2  4 2 .  |                                                                  |
|2  6 5 .  |                                                                  |
|.  . . 1  |                                                                  |
|----------+                                                                  |
|1  2 3 4  |                                                                  |
|9 16 9 1  |                                                                  |
|.  . . .  |                                                                  |
|6  8 3 .  |                                                                  |
|.  . . .  |                                                                  |
|3  8 6 .  |                                                                  |
|.  . . 1  |                                                                  |
|----------+                                                                  |
+-----------------------------------------------------------------------------+

See also
========

  * [QQ] -- Quaternary Quartic Forms and Gorenstein rings
    (Kapustka, Kapustka, Ranestad, Schenck, Stillman, Yuan, 2021)
  * quarticType(RingElement) -- the Betti
    stratum a specific quartic lies on
  * inverseSystem (InverseSystems) -- Inverse systems with
    equivariance
  * minimalBetti (Macaulay2Doc) -- minimal betti numbers of
    (the minimal free resolution of) a homogeneous ideal or module
-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics/Section6Doc.m2:39:0.

Finding the possible betti tables for points in P^3 with given geometry -- Material from Section 3 of [QQ]
**********************************************************************************************************

The following code finds the ideal and betti table for a point configuration.
The point configuration is given by a matrix whose column vectors are the
coordinates of the points. The command pointideal does this for a single point,
and pointsideal does it for several points

+---------------------+
|i1 : K = ZZ/101;     |
+---------------------+
|i2 : R = K[x_0..x_3];|
+---------------------+

We check this for some special configurations in P^3, first for a set of six
points consisting of two sets of three collinear points, and second for seven
points on a twisted cubic

+-----------------------------------------------------------------------------+
|i3 : TwoSets3Points=transpose                                                |
|                                                                             |
|o3 = | 1 0 1 0 0 0 |                                                         |
|     | 0 1 1 0 0 0 |                                                         |
|     | 0 0 0 1 1 0 |                                                         |
|     | 0 0 0 1 0 1 |                                                         |
|                                                                             |
|             4      6                                                        |
|o3 : Matrix R  <-- R                                                         |
|-----------------------------------------------------------------------------|
|matrix{{1,0,0,0},{0,1,0,0},{1,1,0,0},{0,0,1,1},{0,0,1,0},{0,0,0,1}}**R       |
+-----------------------------------------------------------------------------+
|i4 : I = pointsIdeal TwoSets3Points                                          |
|                                                                             |
|                                     2        2   2        2                 |
|o4 = ideal (x x , x x , x x , x x , x x  - x x , x x  - x x )                |
|             1 3   0 3   1 2   0 2   2 3    2 3   0 1    0 1                 |
|                                                                             |
|o4 : Ideal of R                                                              |
+-----------------------------------------------------------------------------+
|i5 : minimalBetti I                                                          |
|                                                                             |
|            0 1 2 3                                                          |
|o5 = total: 1 6 8 3                                                          |
|         0: 1 . . .                                                          |
|         1: . 4 4 1                                                          |
|         2: . 2 4 2                                                          |
|                                                                             |
|o5 : BettiTally                                                              |
+-----------------------------------------------------------------------------+
|i6 : SevenPointsOnTC=transpose                                               |
|                                                                             |
|o6 = | 1 1 1  1   1  1  1  |                                                 |
|     | 1 2 3  4   5  6  7  |                                                 |
|     | 1 4 9  16  25 36 49 |                                                 |
|     | 1 8 27 -37 24 14 40 |                                                 |
|                                                                             |
|             4      7                                                        |
|o6 : Matrix R  <-- R                                                         |
|-----------------------------------------------------------------------------|
|matrix{{1,1,1,1},{1,2,4,8},{1,3,9,27},{1,4,16,64},{1,5,25,125},{1,6,36,216},{|
|-----------------------------------------------------------------------------|
|1,7,49,343}}**R                                                              |
+-----------------------------------------------------------------------------+
|i7 : J = pointsIdeal SevenPointsOnTC                                         |
|                                                                             |
|             2                       2          2        2                   |
|o7 = ideal (x  - x x , x x  - x x , x  - x x , x x  + 14x x  + 20x x x  -    |
|             2    1 3   1 2    0 3   1    0 2   0 2      0 3      0 1 3      |
|     ------------------------------------------------------------------------|
|                    2        2        2      3   2        2                  |
|     20x x x  + 6x x  + 12x x  - 23x x  - 10x , x x  + 26x x  + 3x x x  -    |
|        0 2 3     0 3      1 3      2 3      3   0 1      0 3     0 1 3      |
|     ------------------------------------------------------------------------|
|                     2        2       2      3   3      2                    |
|     17x x x  + 29x x  + 11x x  + 9x x  + 39x , x  + 43x x  - 32x x x  +     |
|        0 2 3      0 3      1 3     2 3      3   0      0 3      0 1 3       |
|     ------------------------------------------------------------------------|
|                     2        2      3                                       |
|     44x x x  - 44x x  + 31x x  - 43x )                                      |
|        0 2 3      0 3      2 3      3                                       |
|                                                                             |
|o7 : Ideal of R                                                              |
+-----------------------------------------------------------------------------+
|i8 : minimalBetti J                                                          |
|                                                                             |
|            0 1 2 3                                                          |
|o8 = total: 1 6 8 3                                                          |
|         0: 1 . . .                                                          |
|         1: . 3 2 .                                                          |
|         2: . 3 6 3                                                          |
|                                                                             |
|o8 : BettiTally                                                              |
+-----------------------------------------------------------------------------+

Finally we check configurations of 3 to 10 generic points in P^3, note 3 points
will have a linear form

+-----------------------------------------------------------------------------+
|i9 : netList(pack(2,apply({3,4,5,6,7,8,9,10},i->(minimalBetti pointsIdeal    |
|                                                                             |
|     +---------------+----------------+                                      |
|     |       0 1 2 3 |       0 1 2 3  |                                      |
|o9 = |total: 1 4 5 2 |total: 1 6 8 3  |                                      |
|     |    0: 1 1 . . |    0: 1 . . .  |                                      |
|     |    1: . 3 5 2 |    1: . 6 8 3  |                                      |
|     +---------------+----------------+                                      |
|     |       0 1 2 3 |       0 1 2 3  |                                      |
|     |total: 1 5 5 1 |total: 1 4 5 2  |                                      |
|     |    0: 1 . . . |    0: 1 . . .  |                                      |
|     |    1: . 5 5 . |    1: . 4 2 .  |                                      |
|     |    2: . . . 1 |    2: . . 3 2  |                                      |
|     +---------------+----------------+                                      |
|     |       0 1 2 3 |       0 1 2 3  |                                      |
|     |total: 1 4 6 3 |total: 1 6 9 4  |                                      |
|     |    0: 1 . . . |    0: 1 . . .  |                                      |
|     |    1: . 3 . . |    1: . 2 . .  |                                      |
|     |    2: . 1 6 3 |    2: . 4 9 4  |                                      |
|     +---------------+----------------+                                      |
|     |       0 1  2 3|       0  1  2 3|                                      |
|     |total: 1 8 12 5|total: 1 10 15 6|                                      |
|     |    0: 1 .  . .|    0: 1  .  . .|                                      |
|     |    1: . 1  . .|    1: .  .  . .|                                      |
|     |    2: . 7 12 5|    2: . 10 15 6|                                      |
|     +---------------+----------------+                                      |
|-----------------------------------------------------------------------------|
|random(R^4,R^i)))))                                                          |
+-----------------------------------------------------------------------------+

See also
========

  * [QQ] -- Quaternary Quartic Forms and Gorenstein rings
    (Kapustka, Kapustka, Ranestad, Schenck, Stillman, Yuan, 2021)
-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics/Section3Doc.m2:32:0.

Half canonical degree 20 -- Computation which supports the proof of Proposition 8.4
***********************************************************************************

In the proof Proposition 8.4 we need to show that if Z is fifteen points in the
plane defined by the (5x5)-minors of a general (5x6) matrix of linear forms,
then there are no curves of degree 8, singular along Z.

+-----------------------------------------------------------------------------+
|i1 : kk=ZZ/101                                                               |
|                                                                             |
|o1 = kk                                                                      |
|                                                                             |
|o1 : QuotientRing                                                            |
+-----------------------------------------------------------------------------+
|i2 : S=kk[x0,x1,x2]                                                          |
|                                                                             |
|o2 = S                                                                       |
|                                                                             |
|o2 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i3 : M=random(S^5,S^{6:-1});--a random (5x6) matrix linear forms in P2       |
|                                                                             |
|             5      6                                                        |
|o3 : Matrix S  <-- S                                                         |
+-----------------------------------------------------------------------------+
|i4 : m5=minors(5,M);--the ideal of 15 points                                 |
|                                                                             |
|o4 : Ideal of S                                                              |
+-----------------------------------------------------------------------------+
|i5 : m52=saturate m5^2;--the square of the ideal of 15 points, saturated,    |
|                                                                             |
|o5 : Ideal of S                                                              |
|-----------------------------------------------------------------------------|
|with no forms of degree 8.                                                   |
+-----------------------------------------------------------------------------+
|i6 : betti res m52                                                           |
|                                                                             |
|            0  1 2                                                           |
|o6 = total: 1 10 9                                                           |
|         0: 1  . .                                                           |
|         1: .  . .                                                           |
|         2: .  . .                                                           |
|         3: .  . .                                                           |
|         4: .  . .                                                           |
|         5: .  . .                                                           |
|         6: .  . .                                                           |
|         7: .  . .                                                           |
|         8: . 10 9                                                           |
|                                                                             |
|o6 : BettiTally                                                              |
+-----------------------------------------------------------------------------+

In Y, a smooth 4-fold in $\mathbb{P}^7$ defined as the rank 2 locus of (3x5)
matrix M of linear forms, let S1 be the 3-fold scroll defined as the rank 1
locus of the submatrix M12 of M consisting of its two first rows, and let S2 be
the 3-fold scroll defined as the rank 1 locus of the submatrix M23 of M
consisting of its two last rows Then we show that every cubic hypersurface that
contains both S1 and S2, contains all of Y. Hence this is the case for any
divisor on Y equivalent to S1+S2.

+-----------------------------------------------------------------------------+
|i7 : kk=ZZ/101                                                               |
|                                                                             |
|o7 = kk                                                                      |
|                                                                             |
|o7 : QuotientRing                                                            |
+-----------------------------------------------------------------------------+
|i8 : S=kk[x0,x1,x2,x3,x4,x5,x6,x7];                                          |
+-----------------------------------------------------------------------------+
|i9 : M=random(S^3,S^{5:-1});--a random (3x5) matrix linear forms in P7       |
|                                                                             |
|             3      5                                                        |
|o9 : Matrix S  <-- S                                                         |
+-----------------------------------------------------------------------------+
|i10 : m3=minors(3,M);--the ideal of a 4-fold Y,                              |
|                                                                             |
|o10 : Ideal of S                                                             |
+-----------------------------------------------------------------------------+
|i11 : M12=submatrix (M, {0,1},{0,1,2,3,4});                                  |
|                                                                             |
|              2      5                                                       |
|o11 : Matrix S  <-- S                                                        |
+-----------------------------------------------------------------------------+
|i12 : M23=submatrix (M, {1,2},{0,1,2,3,4});                                  |
|                                                                             |
|              2      5                                                       |
|o12 : Matrix S  <-- S                                                        |
+-----------------------------------------------------------------------------+
|i13 : S1=minors (2,M12);-- a divisor in Y of degree 5                        |
|                                                                             |
|o13 : Ideal of S                                                             |
+-----------------------------------------------------------------------------+
|i14 : S2=minors (2,M23);-- another divisor equivalent to S1                  |
|                                                                             |
|o14 : Ideal of S                                                             |
+-----------------------------------------------------------------------------+
|i15 : S12=saturate intersect(S1,S2);--the divisor S1+S2 on Y                 |
|                                                                             |
|o15 : Ideal of S                                                             |
+-----------------------------------------------------------------------------+
|i16 : betti res S12 --the ten cubics are the same as the ones in the ideal of|
|                                                                             |
|             0  1   2   3   4   5  6  7                                      |
|o16 = total: 1 60 240 426 420 240 75 10                                      |
|          0: 1  .   .   .   .   .  .  .                                      |
|          1: .  .   .   .   .   .  .  .                                      |
|          2: . 10  15   6   .   .  .  .                                      |
|          3: . 50 225 420 420 240 75 10                                      |
|                                                                             |
|o16 : BettiTally                                                             |
|-----------------------------------------------------------------------------|
|Y                                                                            |
+-----------------------------------------------------------------------------+

See also
========

  * [QQ] -- Quaternary Quartic Forms and Gorenstein rings
    (Kapustka, Kapustka, Ranestad, Schenck, Stillman, Yuan, 2021)
-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics/Section8Doc.m2:171:0.

Hilbert scheme of 6 points in projective 3-space -- Betti table loci
********************************************************************

In this section, we use strongly stable ideals (Borel fixed ideals), generic
initial ideals, Groebner strata, and Schreyer's algorithm for computing free
resolutions, to find the components in the Hilbert scheme of 6 points, of the
various Batti table loci.

Let's assume for simplicity that the field $\mathbb{k}$ has characteristic
zero. This is slightly too strong an assumption for what we are doing, but if
the characteristic is finite but not so small, everything we say here will hold
in that case too. Let $S = \mathbb{k}[x_0, \ldots, x_n]$.

We work over a large finite field, one whose characteristic is large enough so
that the subtleties of Borels over finite characteristic don't appear.  We use
such a finite field, instead of $\mathbb{Q}$, so that the coefficients in the
ideal aren't huge. This doesn't change the answers, but we need to check that
afterwards.

+-------------------------------------+
|i1 : setRandomSeed 4332367823        |
| -- setting random seed to 4332367823|
|                                     |
|o1 = 4332367823                      |
+-------------------------------------+
|i2 : kk = ZZ/101                     |
|                                     |
|o2 = kk                              |
|                                     |
|o2 : QuotientRing                    |
+-------------------------------------+
|i3 : S = kk[a,b,c,d];                |
+-------------------------------------+

Strongly stable ideals with a given Hilbert polynomial
======================================================

A strongly stable monomial ideal is a monomial ideal $J$ such that if $x_i m$
is in $J$, then $x_j m$ is in $J$, for all $j < i$.  In characteristic zero,
this coincides with the notion of an ideal being fixed under the Borel action
of upper triangular matrices.  There is a more complicated combinatorial
description of Borel fixed ideals in positive characteristic, this is why we
simplify here to characteristic zero.

There are only finitely many saturated Borel fixed monomial ideals of a given
Hilbert polynomial (this is folklore, but D. Maclagan has a nice general paper
which proves a sweeping generalization of this).  Alyson Reeves gave an
algorithm in her Cornell thesis to compute all of the saturated Borels, with a
given Hilbert polynomial. Moore and Nagel, and separately Albarelli-Lella
(arxiv 1406.6924) have papers improving this construction, and the latter have
implemented a Macaulay2 package which computes these.

As our running example computation, we consider the Hilbert scheme of 6 points
in $\PP^3$. Here are all of the strongly stable ideals with Hilbert polynomial
$p(z) = 6$ in $\PP^3$.  We use the package StronglyStableIdeals written by
Albarelli and Lella.

+-----------------------------------------------------------------------------+
|i4 : B6 = stronglyStableIdeals(6, S)                                         |
|                                                                             |
|                    6                   2   5              2     2   4       |
|o4 = {ideal (b, a, c ), ideal (a, b*c, b , c ), ideal (a, b , b*c , c ),     |
|     ------------------------------------------------------------------------|
|                3     2   2    3                     2        2   4          |
|     ideal (a, c , b*c , b c, b ), ideal (b*c, a*c, b , a*b, a , c ), ideal  |
|     ------------------------------------------------------------------------|
|            2        2   3     2                                             |
|     (a*c, b , a*b, a , c , b*c )}                                           |
|                                                                             |
|o4 : List                                                                    |
+-----------------------------------------------------------------------------+
|i5 : B6 = nondegenerateBorels(6, S)                                          |
|                                                                             |
|                        2        2   4                2        2   3     2   |
|o5 = {ideal (b*c, a*c, b , a*b, a , c ), ideal (a*c, b , a*b, a , c , b*c )} |
|                                                                             |
|o5 : List                                                                    |
+-----------------------------------------------------------------------------+
|i6 : B6/minimalBetti                                                         |
|                                                                             |
|             0 1 2 3         0 1 2 3                                         |
|o6 = {total: 1 6 8 3, total: 1 6 8 3}                                        |
|          0: 1 . . .      0: 1 . . .                                         |
|          1: . 5 6 2      1: . 4 4 1                                         |
|          2: . . . .      2: . 2 4 2                                         |
|          3: . 1 2 1                                                         |
|                                                                             |
|o6 : List                                                                    |
+-----------------------------------------------------------------------------+
+------------------------------------------------------------------+
|i7 : matrix for J in B6 list for d to 6 list hilbertFunction(d, J)|
|                                                                  |
|o7 = | 1 4 5 6 6 6 6 |                                            |
|     | 1 4 6 6 6 6 6 |                                            |
|                                                                  |
|              2       7                                           |
|o7 : Matrix ZZ  <-- ZZ                                            |
+------------------------------------------------------------------+

Notice that each saturated Borel fixed ideal with this Hilbert polynomial has a
different Hilbert function.

Generic initial ideals
======================

There are two key theorems (see Eisenbud's commutative algebra book, for an
exposition) that we use here:

Theorem(Galligo, Bayer-Stillman) After a general change of coordinates, the
initial ideal $J = in(g.I)$, under any term order, is Borel fixed (and hence,
in characteristic zero, is strongly stable).

Theorem(Bayer-Stillman) The initial ideal $J = in(g.I)$, under graded reverse
lex order, has the same depth, projective dimension and regularity as $I$. In
characteristic zero, the regularity of $I$ is precisely the maximal degree of a
Groebner basis generator of $g.I$.

In particular, after a general, or sufficiently random, change of coordinates,
the initial ideal $J$ is saturated, Borel fixed, and has the same regularity
and projective dimension as $I$.

For example, if we take a random set of points, the resulting initial ideal in
graded reverse lex order is strongly stable (it is strongly stable for any
order).

+-----------------------------------------------------------------------------+
|i8 : I = pointsIdeal randomPoints(S, 6)                                      |
|                                                                             |
|                             2                              2   2            |
|o8 = ideal (a*c - 33b*c - 37c  + 48a*d + 41b*d - 12c*d - 25d , b  + 44b*c -  |
|     ------------------------------------------------------------------------|
|        2                              2                   2                 |
|     17c  + 15a*d - 41b*d - 49c*d + 42d , a*b + 49b*c + 11c  - 17a*d + 17b*d |
|     ------------------------------------------------------------------------|
|                  2   2              2                              2        |
|     + 47c*d + 47d , a  - 35b*c + 13c  - 19a*d - 20b*d + 37c*d + 18d )       |
|                                                                             |
|o8 : Ideal of S                                                              |
+-----------------------------------------------------------------------------+
|i9 : degree I                                                                |
|                                                                             |
|o9 = 6                                                                       |
+-----------------------------------------------------------------------------+
|i10 : hilbertPolynomial(I, Projective => false)                              |
|                                                                             |
|o10 = 6                                                                      |
|                                                                             |
|o10 : QQ[i]                                                                  |
+-----------------------------------------------------------------------------+
|i11 : J = monomialIdeal leadTerm I                                           |
|                                                                             |
|                      2        2          2   3                              |
|o11 = monomialIdeal (a , a*b, b , a*c, b*c , c )                             |
|                                                                             |
|o11 : MonomialIdeal of S                                                     |
+-----------------------------------------------------------------------------+
|i12 : isBorel J                                                              |
|                                                                             |
|o12 = true                                                                   |
+-----------------------------------------------------------------------------+
|i13 : betti res I                                                            |
|                                                                             |
|             0 1 2 3                                                         |
|o13 = total: 1 4 5 2                                                         |
|          0: 1 . . .                                                         |
|          1: . 4 2 .                                                         |
|          2: . . 3 2                                                         |
|                                                                             |
|o13 : BettiTally                                                             |
+-----------------------------------------------------------------------------+

The Groebner family of an initial ideal
=======================================

Given a monomial ideal $J$, and a term order (we generally always take the
graded reverse lex order), we can form a parameter space of ideals having
initial ideal $J$. For each minimal generator $x^\alpha$ of $J$, consider the
set $x^\gamma$ of monomials of the same degree, not in $J$.  For each such
$\alpha$, form a polynomial

$\phantom{WWWWW} F_\alpha = x^\alpha + \sum_\gamma t_{\alpha, \gamma} x^\gamma
$

Let $U = T[x_0, \ldots, x_n]$, where $T = \mathbb{k}[t_{\alpha, \gamma}]$ is
the polynomial ring generated by all variables of the form $t_{\alpha, \gamma}$
as above. Let $F$ be the ideal in $U$ generated by the $F_\alpha$. $F =
(F_\alpha)$ is called the Groebner family of $J$.

Any term order $>$ on the monomials of $S$, on a finite set $M$ of monomials,
is given by a weight vector $w \in \mathbb{Z}^{n+1}$: for $x^\alpha, x^\beta
\in M$, $x^\alpha > x^\beta$ if and only if $w \cdot \alpha > w \cdot \beta$.
If we let the weight of $t_{\alpha, \gamma}$ be $w \cdot (\alpha - \gamma)$,
then with this grading, $F_\alpha$ is homogeneous of weight $w \cdot \alpha$.
This grading is useful for performance reasons: computing with homogeneous
ideals is much more efficient than with arbitrary ideals.  Additionally, we can
order the variables $t_{\alpha, \gamma}$ by refining the weight degree by any
term order on $T$: if the weight of $t_{\alpha, \gamma}$ is greater than
$t_{\alpha', \gamma'}$ then $t_{\alpha, \gamma} > t_{\alpha', \gamma'}$ in this
term order. weight.

The Groebner stratum of an initial ideal
========================================

If we consider a minimal set of syzygies of the minimal generators $x^\alpha$
of $J$, and we apply this syzygy to the $F_\alpha$, then take the remainder
upon division with the $F_\alpha$, and let $L$ be the ideal generated by all of
the coefficients in $T$ of these resulting polynomials, then $L$ is called the
Groebner stratum of $J$, and $F = (F_\alpha)$ is called the Groebner family of
$J$.

Over $\mathbb{V}(L)$, $F$ defines a flat family all of whose fibers have
initial ideal $J$, and consequently defines via representability of the Hilbert
scheme, a closed subscheme of $Hilb$. These families, over all saturated
monomial ideals, cover the Hilbert scheme.

+-----------------------------------------------------------------------------+
|i14 : needsPackage "GroebnerStrata"                                          |
|                                                                             |
|o14 = GroebnerStrata                                                         |
|                                                                             |
|o14 : Package                                                                |
+-----------------------------------------------------------------------------+
|i15 : J = B6_1                                                               |
|                                                                             |
|                   2        2   3     2                                      |
|o15 = ideal (a*c, b , a*b, a , c , b*c )                                     |
|                                                                             |
|o15 : Ideal of S                                                             |
+-----------------------------------------------------------------------------+
|i16 : J = ideal(a^2,a*b,b^2,a*c,b*c^2,c^3)                                   |
|                                                                             |
|              2        2          2   3                                      |
|o16 = ideal (a , a*b, b , a*c, b*c , c )                                     |
|                                                                             |
|o16 : Ideal of S                                                             |
+-----------------------------------------------------------------------------+
|i17 : F = groebnerFamily J                                                   |
|                                                                             |
|              2                      2                      2                |
|o17 = ideal (a  + t b*c + t a*d + t c  + t b*d + t c*d + t d , a*b + t b*c + |
|                   1       3       2      4       5       6           7      |
|      -----------------------------------------------------------------------|
|                 2                         2   2                         2   |
|      t a*d + t c  + t  b*d + t  c*d + t  d , b  + t  b*c + t  a*d + t  c  + |
|       9       8      10       11       12          13       15       14     |
|      -----------------------------------------------------------------------|
|                            2                              2                 |
|      t  b*d + t  c*d + t  d , a*c + t  b*c + t  a*d + t  c  + t  b*d +      |
|       16       17       18           19       21       20      22           |
|      -----------------------------------------------------------------------|
|                   2     2                    2       2          2         2 |
|      t  c*d + t  d , b*c  + t  b*c*d + t  a*d  + t  c d + t  b*d  + t  c*d  |
|       23       24            25         27        26       28        29     |
|      -----------------------------------------------------------------------|
|            3   3                    2       2          2         2       3  |
|      + t  d , c  + t  b*c*d + t  a*d  + t  c d + t  b*d  + t  c*d  + t  d ) |
|         30          31         33        32       34        35        36    |
|                                                                             |
|o17 : Ideal of kk[t , t  , t , t  , t  , t , t  , t  , t  , t , t  , t , t  ,|
|                   6   12   5   30   24   4   18   36   11   2   29   3   10 |
|-----------------------------------------------------------------------------|
|t  , t , t  , t  , t  , t , t  , t , t  , t  , t  , t , t  , t  , t  , t  ,  |
| 23   1   17   28   35   8   22   9   16   26   34   7   20   27   14   21   |
|-----------------------------------------------------------------------------|
|t  , t  , t  , t  , t  , t  , t  ][a..d]                                     |
| 25   32   19   15   33   13   31                                            |
+-----------------------------------------------------------------------------+
|i18 : U = ring F;                                                            |
+-----------------------------------------------------------------------------+
|i19 : T = coefficientRing U                                                  |
|                                                                             |
|o19 = T                                                                      |
|                                                                             |
|o19 : PolynomialRing                                                         |
+-----------------------------------------------------------------------------+
|i20 : netList F_*                                                            |
|                                                                             |
|      +--------------------------------------------------------------+       |
|      | 2                      2                      2              |       |
|o20 = |a  + t b*c + t a*d + t c  + t b*d + t c*d + t d               |       |
|      |      1       3       2      4       5       6                |       |
|      +--------------------------------------------------------------+       |
|      |                         2                         2          |       |
|      |a*b + t b*c + t a*d + t c  + t  b*d + t  c*d + t  d           |       |
|      |       7       9       8      10       11       12            |       |
|      +--------------------------------------------------------------+       |
|      | 2                         2                         2        |       |
|      |b  + t  b*c + t  a*d + t  c  + t  b*d + t  c*d + t  d         |       |
|      |      13       15       14      16       17       18          |       |
|      +--------------------------------------------------------------+       |
|      |                            2                         2       |       |
|      |a*c + t  b*c + t  a*d + t  c  + t  b*d + t  c*d + t  d        |       |
|      |       19       21       20      22       23       24         |       |
|      +--------------------------------------------------------------+       |
|      |   2                    2       2          2         2       3|       |
|      |b*c  + t  b*c*d + t  a*d  + t  c d + t  b*d  + t  c*d  + t  d |       |
|      |        25         27        26       28        29        30  |       |
|      +--------------------------------------------------------------+       |
|      | 3                    2       2          2         2       3  |       |
|      |c  + t  b*c*d + t  a*d  + t  c d + t  b*d  + t  c*d  + t  d   |       |
|      |      31         33        32       34        35        36    |       |
|      +--------------------------------------------------------------+       |
+-----------------------------------------------------------------------------+
|i21 : L = trim groebnerStratum F;                                            |
|                                                                             |
|o21 : Ideal of T                                                             |
+-----------------------------------------------------------------------------+
|i22 : assert(dim L == 18)                                                    |
+-----------------------------------------------------------------------------+
|i23 : elapsedTime isPrime L                                                  |
| -- 5.17539s elapsed                                                         |
|                                                                             |
|o23 = true                                                                   |
+-----------------------------------------------------------------------------+

The Schreyer resolution and minimal Betti numbers
=================================================

Schreyer's construction of a nonminimal free resolution starts with a Groebner
basis. First, one constructs the Schreyer frame (see La Scala, Stillman).  This
is determined solely from the initial ideal $J$ and its minimal generators (but
depends on some choices of ordering, but otherwise is combinatorial).  This
consists of the lead monomials of the Groebner bases of the syzygy modules of
the initial ideal $J$ (in the so-called induces, or Schreyer order).

One then fills in the rest of each column of each matrix in this non minimal
resolution by computing the image of the monomial, and taking its remainder
with respect to all the lead terms at the previous homological degree (except
the monomial we used).  This gives a nonminimal free resolution, and after the
frame is made, the only operations needed in the coefficient ring are
subtraction and multiplication.

By linear algebra, a non minimal free resolution can be made minimal by the
following process: find a non-zero scalar entry at, say, the $(i,j)$ entry of
the $\partial_k : C_k \to C_{k-1}$. By column operations, make all the other
entries in the $i$-th row 0, then remove the $i$-th row, and $j$-th column of
this matrix, changing the two adjacent matrices in the process.

In the standard grading on $S$, the minimal free resolution will be homogeneous
(with the $t$ variables all having degree 0). For each degree $d$, there is a
submatrix of the map $\partial^C_i \colon C_i \to C_{i-1}$, let's call it
$\rho_{i,d}$.  This is a matrix defined over the base field.  The ranks of
these matrices determine the Betti table of the minimal free resolution of
$S/I$.

Similarly, one can compute the non-minimal resolution of $F$, over the ring
$T/L$. For any specialization to a point, the specialization of the complex is
a non-minimal free resolution of the specialized point.

There are only two Borel fixed ideals for 6 points.  Notice that in this
particular case, the Hilbert function and generic initial ideal is determined
by the number of quadrics in the saturated ideal: If there are 5 quadrics in
the ideal, it has the first gin, and if there are 4 quadrics, it has the second
gin.

This means that we can partition the entire Hilbert scheme into 2 parts: The
generic initial ideal is one of these two.

Let $H$ be the Hilbert scheme of 6 points in ${\mathbb P}^3$.  $H$ has one
component, is rational, and has dimension 18.  A general set of 6 points has
regularity 2, and its free resolution is shown in the next example.

+-----------------------------------------------------------------------------+
|i24 : I = pointsIdeal randomPoints(S, 6)                                     |
|                                                                             |
|                             2                              2   2            |
|o24 = ideal (a*c - 7b*c - 49c  + 40a*d - 42b*d + 12c*d + 28d , b  - 36b*c -  |
|      -----------------------------------------------------------------------|
|         2                              2                  2                 |
|      18c  - 22a*d + 20b*d + 37c*d - 18d , a*b - 8b*c - 28c  + 6a*d + 20b*d -|
|      -----------------------------------------------------------------------|
|         2   2             2                             2                   |
|      26d , a  - 18b*c - 3c  + 15a*d - 4b*d - 21c*d + 30d )                  |
|                                                                             |
|o24 : Ideal of S                                                             |
+-----------------------------------------------------------------------------+
|i25 : degree I                                                               |
|                                                                             |
|o25 = 6                                                                      |
+-----------------------------------------------------------------------------+
|i26 : radical I == I                                                         |
|                                                                             |
|o26 = true                                                                   |
+-----------------------------------------------------------------------------+
|i27 : betti res I                                                            |
|                                                                             |
|             0 1 2 3                                                         |
|o27 = total: 1 4 5 2                                                         |
|          0: 1 . . .                                                         |
|          1: . 4 2 .                                                         |
|          2: . . 3 2                                                         |
|                                                                             |
|o27 : BettiTally                                                             |
+-----------------------------------------------------------------------------+

If an ideal $I$ has initial ideal $J$, we can construct a (nonminimal in
general) free resolution of $I$ with the same Betti table as $J$.  The Betti
table of (the minimal free resolution of) $I$ is determined by the ranks of the
degree 0 maps in this non-minimal resolution.

+-----------------------------------------------------------------------------+
|i28 : (CF, H) = nonminimalMaps F;                                            |
+-----------------------------------------------------------------------------+
|i29 : U = ring CF                                                            |
|                                                                             |
|o29 = U                                                                      |
|                                                                             |
|o29 : PolynomialRing                                                         |
+-----------------------------------------------------------------------------+
|i30 : CF                                                                     |
|                                                                             |
|       1      6      10      6      1                                        |
|o30 = U  <-- U  <-- U   <-- U  <-- U                                         |
|                                                                             |
|      0      1      2       3      4                                         |
|                                                                             |
|o30 : ChainComplex                                                           |
+-----------------------------------------------------------------------------+
|i31 : betti(CF, Weights=>{1}) -- alas, it is a poor non-minimal resolution   |
|                                                                             |
|             0 1  2 3 4                                                      |
|o31 = total: 1 6 10 6 1                                                      |
|          0: 1 .  . . .                                                      |
|          1: . 4  4 2 .                                                      |
|          2: . 2  5 3 1                                                      |
|          3: . .  1 1 .                                                      |
|                                                                             |
|o31 : BettiTally                                                             |
+-----------------------------------------------------------------------------+
|i32 : assert isHomogeneous CF -- but it is homogeneous, as it needs to be.   |
+-----------------------------------------------------------------------------+
|i33 : keys H                                                                 |
|                                                                             |
|o33 = {(3, 4), (3, 5), (4, 6), (2, 3)}                                       |
|                                                                             |
|o33 : List                                                                   |
+-----------------------------------------------------------------------------+
|i34 : M1 = H#(2,3) -- rank is 0, 1, or 2.                                    |
|                                                                             |
|o34 = {3} | -t_8-t_14t_19      t_7t_14-t_20t_14+t_14t_19t_13                 |
|      {3} | -t_7+t_20-t_19t_13 -t_8-t_14t_19+t_7t_13-t_20t_13+t_19t_13^2     |
|      -----------------------------------------------------------------------|
|      -t_2-t_20^2+t_14t_19^2    -t_8t_20+t_1t_14+t_7t_14t_19             |   |
|      -t_1-2t_20t_19+t_19^2t_13 -t_2-t_7t_20-t_8t_19+t_1t_13+t_7t_19t_13 |   |
|                                                                             |
|              2      4                                                       |
|o34 : Matrix T  <-- T                                                        |
+-----------------------------------------------------------------------------+
|i35 : M2 = H#(3,4) -- rank is 1 or 2                                         |
|                                                                             |
|o35 = {4} | -t_14                                                            |
|      {4} | -1                                                               |
|      {4} | t_8+t_14t_19-t_7t_13+t_20t_13-t_19t_13^2                         |
|      {4} | -t_7+t_20-t_19t_13                                               |
|      {4} | 0                                                                |
|      -----------------------------------------------------------------------|
|      -t_8                                    |                              |
|      t_19                                    |                              |
|      t_2+t_7t_20+t_8t_19-t_1t_13-t_7t_19t_13 |                              |
|      -t_1-2t_20t_19+t_19^2t_13               |                              |
|      t_7-t_20+t_19t_13                       |                              |
|                                                                             |
|              5      2                                                       |
|o35 : Matrix T  <-- T                                                        |
+-----------------------------------------------------------------------------+
|i36 : M3 = H#(3,5) -- maximal rank, can ignore                               |
|                                                                             |
|o36 = {5} | -1 t_19 -t_20 |                                                  |
|                                                                             |
|              1      3                                                       |
|o36 : Matrix T  <-- T                                                        |
+-----------------------------------------------------------------------------+
|i37 : M4 = H#(4,6) -- maximal rank, can ignore                               |
|                                                                             |
|o37 = {6} | -1 |                                                             |
|                                                                             |
|              1      1                                                       |
|o37 : Matrix T  <-- T                                                        |
+-----------------------------------------------------------------------------+

What are the possible ranks of M1, M2?  (M3, M4 are full rank). We check: M1 is
rank 0 (on the relevant points of the parameter space) if and only if M2 has
rank 1 (the smallest possible). So we need to check: (rank M1, rank M2) = (0,
1), (0,2), (1,1), (1,2), (2,1), (2,2)). Of these,

+-------------------------------+
|i38 : ideal M1 == minors(2, M2)|
|                               |
|o38 = true                     |
+-------------------------------+

Therefore the following cannot happen: (0, 2), (1, 1), (2, 1). Therefore the
possible ranks are: (0, 1), (1,2), (2,2). The last one means there is maximal
cancellation: this happens for an open set of the Hilbert scheme of 6 points.
(0,1) means: no cancellation, whereas (1,2) means

$\phantom{WWWW} \begin{matrix} &0&1&2&3\\ \text{total:}&1&6&8&3\\
\text{0:}&1&\text{.}&\text{.}&\text{.}\\ \text{1:}&\text{.}&4&4&1\\
\text{2:}&\text{.}&2&4&2\\ \end{matrix},\quad \begin{matrix} &0&1&2&3\\
\text{total:}&1&5&6&2\\ \text{0:}&1&\text{.}&\text{.}&\text{.}\\
\text{1:}&\text{.}&4&3&\text{.}\\ \text{2:}&\text{.}&1&3&2\\ \end{matrix},\quad
\begin{matrix} &0&1&2&3\\ \text{total:}&1&4&5&2\\
\text{0:}&1&\text{.}&\text{.}&\text{.}\\ \text{1:}&\text{.}&4&2&\text{.}\\
\text{2:}&\text{.}&\text{.}&3&2\\ \end{matrix} $

We now compute the locus in $V(L)$ where the Betti diagram has no cancellation.
This is a closed subscheme of $V(L)$, which is a closed subscheme of the
Hilbert scheme. Notice that there are two components.

+---------------------------------------------------------------+
|i39 : L441 = trim(L + ideal M1);                               |
|                                                               |
|o39 : Ideal of T                                               |
+---------------------------------------------------------------+
|i40 : elapsedTime compsL441 = decompose L441;                  |
| -- 3.4439s elapsed                                            |
+---------------------------------------------------------------+
|i41 : #compsL441                                               |
|                                                               |
|o41 = 2                                                        |
+---------------------------------------------------------------+
|i42 : compsL441/dim -- two components, of dimensions 14 and 16.|
|                                                               |
|o42 = {16, 14}                                                 |
|                                                               |
|o42 : List                                                     |
+---------------------------------------------------------------+
|i43 : compsL441/dim == {16, 14}                                |
|                                                               |
|o43 = true                                                     |
+---------------------------------------------------------------+

Both components are rational, and here are random points, one on each
component:

+-----------------------------------------------------------------------------+
|i44 : pta = randomPointOnRationalVariety compsL441_0                         |
|                                                                             |
|o44 = | 22 -10 -8 -1 34 44 -21 -1 25 -41 6 -11 -50 -50 43 -28 -6 45 -28 22 42|
|      -----------------------------------------------------------------------|
|      -29 -32 -28 5 -10 34 15 19 37 26 49 19 5 10 18 |                       |
|                                                                             |
|               1       36                                                    |
|o44 : Matrix kk  <-- kk                                                      |
+-----------------------------------------------------------------------------+
|i45 : Fa = sub(F, (vars S) | pta)                                            |
|                                                                             |
|              2              2                             2                 |
|o45 = ideal (a  + 43b*c - 41c  - 11a*d + 44b*d - 8c*d + 22d , a*b + 5b*c -   |
|      -----------------------------------------------------------------------|
|         2                              2   2              2                 |
|      28c  + 42a*d - 50b*d + 25c*d - 10d , b  + 10b*c + 15c  + 19a*d - 29b*d |
|      -----------------------------------------------------------------------|
|                   2                   2                              2     2|
|      - 28c*d - 21d , a*c + 49b*c - 10c  + 19a*d + 22b*d - 50c*d + 34d , b*c |
|      -----------------------------------------------------------------------|
|                     2         2       2       2    3   3                2   |
|      + 37b*c*d - 32c d + 34a*d  - 6b*d  + 6c*d  - d , c  + 18b*c*d + 26c d +|
|      -----------------------------------------------------------------------|
|          2        2        2    3                                           |
|      5a*d  - 28b*d  + 45c*d  - d )                                          |
|                                                                             |
|o45 : Ideal of S                                                             |
+-----------------------------------------------------------------------------+
|i46 : betti res Fa                                                           |
|                                                                             |
|             0 1 2 3                                                         |
|o46 = total: 1 6 8 3                                                         |
|          0: 1 . . .                                                         |
|          1: . 4 4 1                                                         |
|          2: . 2 4 2                                                         |
|                                                                             |
|o46 : BettiTally                                                             |
+-----------------------------------------------------------------------------+
|i47 : netList decompose Fa -- this one is 5 points on a plane, and another po|
|                                                                             |
|      +----------------------------------------------------------------------|
|o47 = |ideal (c + 19d, b - 37d, a)                                           |
|      +----------------------------------------------------------------------|
|      |                             2              2                      2  |
|      |ideal (a + 49b - 10c + 39d, b  + 10b*c + 15c  + 50b*d - 40c*d + 46d , |
|      +----------------------------------------------------------------------|
|-----------------------------------------------------------------------------|
|int                                                                          |
|                                                                             |
|-----------------------------------------------------------------------------|
|                                                                             |
|-----------------------------------------------------------------------------|
| 3                2         2       2     3     2                2         2 |
|c  + 18b*c*d + 26c d + 30b*d  - 6c*d  + 6d , b*c  + 37b*c*d - 32c d + 45b*d  |
|-----------------------------------------------------------------------------|
|-----------------------------------------------------------------------------|
|----------------+                                                            |
|                |                                                            |
|----------------+                                                            |
|       2      3 |                                                            |
|+ 43c*d  - 14d )|                                                            |
|----------------+                                                            |
+-----------------------------------------------------------------------------+
|i48 : CFa = minimalPrimes Fa                                                 |
|                                                                             |
|                                                                 2           |
|o48 = {ideal (c + 19d, b - 37d, a), ideal (a + 49b - 10c + 39d, b  + 10b*c + |
|      -----------------------------------------------------------------------|
|         2                      2   3                2         2       2     |
|      15c  + 50b*d - 40c*d + 46d , c  + 18b*c*d + 26c d + 30b*d  - 6c*d  +   |
|      -----------------------------------------------------------------------|
|        3     2                2         2        2      3                   |
|      6d , b*c  + 37b*c*d - 32c d + 45b*d  + 43c*d  - 14d )}                 |
|                                                                             |
|o48 : List                                                                   |
+-----------------------------------------------------------------------------+
|i49 : lin = CFa_1_0 -- a linear form, defining a plane.                      |
|                                                                             |
|o49 = a + 49b - 10c + 39d                                                    |
|                                                                             |
|o49 : S                                                                      |
+-----------------------------------------------------------------------------+
|i50 : CFa/degree                                                             |
|                                                                             |
|o50 = {1, 5}                                                                 |
|                                                                             |
|o50 : List                                                                   |
+-----------------------------------------------------------------------------+
|i51 : CFa/(I -> lin % I == 0) -- so 5 points on the plane.                   |
|                                                                             |
|o51 = {false, true}                                                          |
|                                                                             |
|o51 : List                                                                   |
+-----------------------------------------------------------------------------+
|i52 : degree(Fa : (Fa : lin))  -- somewhat simpler(?) way to see the ideal of|
|                                                                             |
|o52 = 5                                                                      |
|-----------------------------------------------------------------------------|
|the 5 points                                                                 |
+-----------------------------------------------------------------------------+
+-----------------------------------------------------------------------------+
|i53 : ptb = randomPointOnRationalVariety compsL441_1                         |
|                                                                             |
|o53 = | 27 12 -34 9 -19 -43 -32 27 40 45 -13 29 -41 -13 22 -49 -4 -4 9 -23 43|
|      -----------------------------------------------------------------------|
|      18 -9 -47 43 21 38 17 -20 21 -29 47 0 2 -37 9 |                        |
|                                                                             |
|               1       36                                                    |
|o53 : Matrix kk  <-- kk                                                      |
+-----------------------------------------------------------------------------+
|i54 : Fb = sub(F, (vars S) | ptb)                                            |
|                                                                             |
|              2              2                              2                |
|o54 = ideal (a  + 22b*c + 45c  + 29a*d - 43b*d - 34c*d + 27d , a*b + 43b*c + |
|      -----------------------------------------------------------------------|
|        2                              2   2              2                  |
|      9c  + 43a*d - 41b*d + 40c*d + 12d , b  - 37b*c + 17c  + 18b*d - 49c*d -|
|      -----------------------------------------------------------------------|
|         2                   2                              2     2          |
|      32d , a*c + 47b*c + 21c  - 20a*d - 23b*d - 13c*d - 19d , b*c  + 21b*c*d|
|      -----------------------------------------------------------------------|
|          2         2       2        2     3   3               2        2    |
|      - 9c d + 38a*d  - 4b*d  - 13c*d  + 9d , c  + 9b*c*d - 29c d + 2a*d  -  |
|      -----------------------------------------------------------------------|
|           2       2      3                                                  |
|      47b*d  - 4c*d  + 27d )                                                 |
|                                                                             |
|o54 : Ideal of S                                                             |
+-----------------------------------------------------------------------------+
|i55 : betti res Fb                                                           |
|                                                                             |
|             0 1 2 3                                                         |
|o55 = total: 1 6 8 3                                                         |
|          0: 1 . . .                                                         |
|          1: . 4 4 1                                                         |
|          2: . 2 4 2                                                         |
|                                                                             |
|o55 : BettiTally                                                             |
+-----------------------------------------------------------------------------+
|i56 : netList decompose Fb --                                                |
|                                                                             |
|      +----------------------------------------------------------------------|
|      |                                      2              2                |
|o56 = |ideal (b - 50c - 43d, a + 15c - 46d, c  + 12c*d - 37d )               |
|      +----------------------------------------------------------------------|
|      |        2                             2                               |
|      |ideal (c  + 46a*d - 39b*d + 2c*d - 24d , b*c - 9a*d + 16b*d + 2c*d + 2|
|      +----------------------------------------------------------------------|
|-----------------------------------------------------------------------------|
|-----------------------------------------------------------------------------|
|                                                                             |
|                                                                             |
|-----------------------------------------------------------------------------|
|  2                                   2   2                            2     |
|7d , a*c + 43a*d + 44b*d - 48c*d + 24d , b  - 4a*d - 40b*d - 9c*d - 39d , a*b|
|-----------------------------------------------------------------------------|
|-----------------------------------------------------------------------------|
|------------------------------------------------------------------+          |
|                                                                  |          |
|                                                                  |          |
|------------------------------------------------------------------+          |
|                              2   2                             2 |          |
| + 16a*d + 26b*d + 37c*d - 24d , a  - 25a*d + 47b*d + 34c*d + 8d )|          |
|------------------------------------------------------------------+          |
+-----------------------------------------------------------------------------+
|i57 : netList for x in subsets(decompose Fb, 3) list intersect(x#0, x#1, x#2)|
|                                                                             |
|o57 = ++                                                                     |
|      ++                                                                     |
+-----------------------------------------------------------------------------+
+-----------------------------------------------------------------------------+
|i58 : pt0 = randomPointOnRationalVariety(compsL441_0)                        |
|                                                                             |
|o58 = | 32 -46 33 -7 -2 -29 -20 10 -23 -26 5 -16 1 -18 -3 46 13 -21 5 -22 17 |
|      -----------------------------------------------------------------------|
|      15 -33 46 -2 -29 -23 18 -42 -2 -13 39 8 -40 -24 -22 |                  |
|                                                                             |
|               1       36                                                    |
|o58 : Matrix kk  <-- kk                                                      |
+-----------------------------------------------------------------------------+
|i59 : pt1 = randomPointOnRationalVariety(compsL441_1)                        |
|                                                                             |
|o59 = | -8 41 28 -44 50 33 -38 33 -23 1 -2 -47 32 46 30 -22 -2 -14 27 37 15  |
|      -----------------------------------------------------------------------|
|      -25 -15 33 -23 3 21 -18 -9 3 10 -49 0 -35 -50 32 |                     |
|                                                                             |
|               1       36                                                    |
|o59 : Matrix kk  <-- kk                                                      |
+-----------------------------------------------------------------------------+

We compute the ideal of the corresponding zero dimensional scheme with length
6, corresponding to the points pt0, pt1 in Hilb.

+-----------------------------------------------------------------------------+
|i60 : I0 = sub(sub(F, (vars ring F) | sub(pt0, ring F)), S)                  |
|                                                                             |
|              2             2                              2                 |
|o60 = ideal (a  - 3b*c - 26c  - 16a*d - 29b*d + 33c*d + 32d , a*b - 2b*c +   |
|      -----------------------------------------------------------------------|
|        2                            2   2              2                    |
|      5c  + 17a*d + b*d - 23c*d - 46d , b  - 24b*c + 18c  + 8a*d + 15b*d +   |
|      -----------------------------------------------------------------------|
|                 2                   2                             2     2   |
|      46c*d - 20d , a*c + 39b*c - 29c  - 42a*d - 22b*d - 18c*d - 2d , b*c  - |
|      -----------------------------------------------------------------------|
|                  2         2        2       2     3   3                2    |
|      2b*c*d - 33c d - 23a*d  + 13b*d  + 5c*d  - 7d , c  - 22b*c*d - 13c d - |
|      -----------------------------------------------------------------------|
|           2        2        2      3                                        |
|      40a*d  + 46b*d  - 21c*d  + 10d )                                       |
|                                                                             |
|o60 : Ideal of S                                                             |
+-----------------------------------------------------------------------------+
|i61 : I1 = sub(sub(F, (vars ring F) | sub(pt1, ring F)), S)                  |
|                                                                             |
|              2            2                             2                   |
|o61 = ideal (a  + 30b*c + c  - 47a*d + 33b*d + 28c*d - 8d , a*b - 23b*c +    |
|      -----------------------------------------------------------------------|
|         2                              2   2              2                 |
|      27c  + 15a*d + 32b*d - 23c*d + 41d , b  - 50b*c - 18c  - 25b*d - 22c*d |
|      -----------------------------------------------------------------------|
|           2                  2                             2     2          |
|      - 38d , a*c - 49b*c + 3c  - 9a*d + 37b*d + 46c*d + 50d , b*c  + 3b*c*d |
|      -----------------------------------------------------------------------|
|           2         2       2       2      3   3                2         2 |
|      - 15c d + 21a*d  - 2b*d  - 2c*d  - 44d , c  + 32b*c*d + 10c d - 35a*d  |
|      -----------------------------------------------------------------------|
|             2        2      3                                               |
|      + 33b*d  - 14c*d  + 33d )                                              |
|                                                                             |
|o61 : Ideal of S                                                             |
+-----------------------------------------------------------------------------+
|i62 : betti res I0                                                           |
|                                                                             |
|             0 1 2 3                                                         |
|o62 = total: 1 6 8 3                                                         |
|          0: 1 . . .                                                         |
|          1: . 4 4 1                                                         |
|          2: . 2 4 2                                                         |
|                                                                             |
|o62 : BettiTally                                                             |
+-----------------------------------------------------------------------------+
|i63 : betti res I1                                                           |
|                                                                             |
|             0 1 2 3                                                         |
|o63 = total: 1 6 8 3                                                         |
|          0: 1 . . .                                                         |
|          1: . 4 4 1                                                         |
|          2: . 2 4 2                                                         |
|                                                                             |
|o63 : BettiTally                                                             |
+-----------------------------------------------------------------------------+
+-----------------------------------------------------------------------------+
|i64 : netList decompose I0                                                   |
|                                                                             |
|      +----------------------------------------------------------------------|
|o64 = |ideal (c - 42d, b + 26d, a - 30d)                                     |
|      +----------------------------------------------------------------------|
|      |ideal (c - 47d, b + 7d, a - 44d)                                      |
|      +----------------------------------------------------------------------|
|      |                                     2                      2   2     |
|      |ideal (a + 39b - 29c - 24d, b*c - 15c  - 29b*d - 38c*d + 16d , b  - 39|
|      +----------------------------------------------------------------------|
|-----------------------------------------------------------------------------|
|--------------------------+                                                  |
|                          |                                                  |
|--------------------------+                                                  |
|                          |                                                  |
|--------------------------+                                                  |
| 2                      2 |                                                  |
|c  + 17b*d - 28c*d - 50d )|                                                  |
|--------------------------+                                                  |
+-----------------------------------------------------------------------------+
|i65 : netList decompose I1                                                   |
|                                                                             |
|      +---------------------------------+                                    |
|o65 = |ideal (c - 9d, b + 15d, a + 27d) |                                    |
|      +---------------------------------+                                    |
|      |ideal (c + 48d, b + 11d, a - 37d)|                                    |
|      +---------------------------------+                                    |
|      |ideal (c + 29d, b + 46d, a + 18d)|                                    |
|      +---------------------------------+                                    |
|      |ideal (c + 24d, b + 46d, a + 33d)|                                    |
|      +---------------------------------+                                    |
|      |ideal (c + 22d, b + 38d, a - 50d)|                                    |
|      +---------------------------------+                                    |
+-----------------------------------------------------------------------------+
+------------------------------------------------------+
|i66 : L430 = (trim minors(2, M1)) + groebnerStratum F;|
|                                                      |
|o66 : Ideal of T                                      |
+------------------------------------------------------+
+-----------------------------------------------+
|i67 : C = res(I, FastNonminimal => true)       |
|                                               |
|       1      4      5      2                  |
|o67 = S  <-- S  <-- S  <-- S  <-- 0            |
|                                               |
|      0      1      2      3      4            |
|                                               |
|o67 : ChainComplex                             |
+-----------------------------------------------+
|i68 : betti C                                  |
|                                               |
|             0 1 2 3                           |
|o68 = total: 1 4 5 2                           |
|          0: 1 . . .                           |
|          1: . 4 2 .                           |
|          2: . . 3 2                           |
|                                               |
|o68 : BettiTally                               |
+-----------------------------------------------+
|i69 : m1 = submatrixByDegrees(C.dd_2, {3}, {3})|
|                                               |
|o69 = 0                                        |
|                                               |
|                    2                          |
|o69 : Matrix 0 <-- S                           |
+-----------------------------------------------+
|i70 : m2 = submatrixByDegrees(C.dd_3, {4}, {4})|
|                                               |
|o70 = 0                                        |
|                                               |
|              3                                |
|o70 : Matrix S  <-- 0                          |
+-----------------------------------------------+

In this example, m1 and m2 both have full rank, and therefore we can cancel
adjacent numbers to get a minimal resolution (it must be minimal, as by
homogeneity, there are no non-zero elements of degree 0 in the resulting
resolution.

+--------------------+
|i71 : minimalBetti I|
|                    |
|             0 1 2 3|
|o71 = total: 1 4 5 2|
|          0: 1 . . .|
|          1: . 4 2 .|
|          2: . . 3 2|
|                    |
|o71 : BettiTally    |
+--------------------+

Schreyer's algorithm implies that if we have a Groebner basis of an ideal with
gin $B$, then we can construct a nonminimal resolution of $S/I$ whose Betti
table matches that of $B$.  This will be nonminimal, therefore can be pruned to
a free resolution by taking any non-zero scalars that appear as entries in the
resolution, and performing linear algebra to remove that entry, its row and
column, and the corresponding column in the previous matrix then we still have
a free resolution.  Continuing in this way, we obtain a minimal resolution.

-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics/Appendix2.m2:304:0.

Noether-Lefschetz examples -- examples from Section 6.2 in [QQ]
***************************************************************

We give examples of specific quartics interesting in Noether-Lefschetz loci for
K3 surfaces, and where they fit in the Betti classification.

+----------------------+
|i1 : kk = ZZ/101;     |
+----------------------+
|i2 : R = kk[x_0..x_3];|
+----------------------+

The first example illustrates Corollary 6.18.

+--------------------------------------------------------------------------+
|i3 : Q618 = (x_0^2+x_1^2+x_2^2+x_3^2)^2+x_0^4+x_1^4+x_2^4+x_3^4           |
|                                                                          |
|       4     2 2     4     2 2     2 2     4     2 2     2 2     2 2     4|
|o3 = 2x  + 2x x  + 2x  + 2x x  + 2x x  + 2x  + 2x x  + 2x x  + 2x x  + 2x |
|       0     0 1     1     0 2     1 2     2     0 3     1 3     2 3     3|
|                                                                          |
|o3 : R                                                                    |
+--------------------------------------------------------------------------+
|i4 : minimalBetti inverseSystem Q618                                      |
|                                                                          |
|            0  1  2  3 4                                                  |
|o4 = total: 1 16 30 16 1                                                  |
|         0: 1  .  .  . .                                                  |
|         1: .  .  .  . .                                                  |
|         2: . 16 30 16 .                                                  |
|         3: .  .  .  . .                                                  |
|         4: .  .  .  . 1                                                  |
|                                                                          |
|o4 : BettiTally                                                           |
+--------------------------------------------------------------------------+
|i5 : quarticType Q618                                                     |
|                                                                          |
|o5 = [000]                                                                |
+--------------------------------------------------------------------------+

We illustrate Remark 6.19, considering a double quadric:

+----------------------------------------------------------------------+
|i6 : Q619 = (x_0^2+x_1^2+x_2^2+x_3^2)^2                               |
|                                                                      |
|      4     2 2    4     2 2     2 2    4     2 2     2 2     2 2    4|
|o6 = x  + 2x x  + x  + 2x x  + 2x x  + x  + 2x x  + 2x x  + 2x x  + x |
|      0     0 1    1     0 2     1 2    2     0 3     1 3     2 3    3|
|                                                                      |
|o6 : R                                                                |
+----------------------------------------------------------------------+
|i7 : minimalBetti inverseSystem Q619                                  |
|                                                                      |
|            0  1  2  3 4                                              |
|o7 = total: 1 16 30 16 1                                              |
|         0: 1  .  .  . .                                              |
|         1: .  .  .  . .                                              |
|         2: . 16 30 16 .                                              |
|         3: .  .  .  . .                                              |
|         4: .  .  .  . 1                                              |
|                                                                      |
|o7 : BettiTally                                                       |
+----------------------------------------------------------------------+

Next, we illustrate Remark 6.20. The first example is that of the Vinberg most
singular K3 surface.  This is of type [331].

+--------------------------------------------+
|i8 : Q620V = x_0^4-x_1*x_2*x_3*(x_1+x_2+x_3)|
|                                            |
|      4    2          2          2          |
|o8 = x  - x x x  - x x x  - x x x           |
|      0    1 2 3    1 2 3    1 2 3          |
|                                            |
|o8 : R                                      |
+--------------------------------------------+
|i9 : minimalBetti inverseSystem Q620V       |
|                                            |
|            0  1  2  3 4                    |
|o9 = total: 1 11 20 11 1                    |
|         0: 1  .  .  . .                    |
|         1: .  3  3  1 .                    |
|         2: .  7 14  7 .                    |
|         3: .  1  3  3 .                    |
|         4: .  .  .  . 1                    |
|                                            |
|o9 : BettiTally                             |
+--------------------------------------------+
|i10 : quarticType Q620V                     |
|                                            |
|o10 = [331]                                 |
+--------------------------------------------+

The second example illustrating Remark 6.20 is that a general element of the
Dwork pencil has type [000].

+-------------------------------------------------------+
|i11 : Q620D = x_0^4+x_1^4+x_2^4+x_3^4-8*x_0*x_1*x_2*x_3|
|                                                       |
|       4    4    4                4                    |
|o11 = x  + x  + x  - 8x x x x  + x                     |
|       0    1    2     0 1 2 3    3                    |
|                                                       |
|o11 : R                                                |
+-------------------------------------------------------+
|i12 : minimalBetti inverseSystem Q620D                 |
|                                                       |
|             0  1  2  3 4                              |
|o12 = total: 1 16 30 16 1                              |
|          0: 1  .  .  . .                              |
|          1: .  .  .  . .                              |
|          2: . 16 30 16 .                              |
|          3: .  .  .  . .                              |
|          4: .  .  .  . 1                              |
|                                                       |
|o12 : BettiTally                                       |
+-------------------------------------------------------+
|i13 : quarticType Q620D                                |
|                                                       |
|o13 = [000]                                            |
+-------------------------------------------------------+

The third example illustrating Remark 6.20 is that the K3 quartics
$S_{t}\subset \mathbb{P}^{5}$ given by $$
x_{1}^{4}+\dots+x_{5}^{4}-t(x_{1}^{2}+\dots+x_{5}^{2})^{2}=x_{1}+\dots+x_{5}=
0$$ for general $t$ are of type [000]. However, $S_{0}$ is of type [550].

+-----------------------------------------------------------------------------+
|i14 : x5=x_0+x_1+x_2+x_3                                                     |
|                                                                             |
|o14 = x  + x  + x  + x                                                       |
|       0    1    2    3                                                      |
|                                                                             |
|o14 : R                                                                      |
+-----------------------------------------------------------------------------+
|i15 : Q = x_0^4+x_1^4+x_2^4+x_3^4+x5^4-random(kk)*(x_0^2+x_1^2+x_2^2+x_3^2+x5|
|-----------------------------------------------------------------------------|
|^2)^2;                                                                       |
+-----------------------------------------------------------------------------+
|i16 : minimalBetti inverseSystem Q                                           |
|                                                                             |
|             0  1  2  3 4                                                    |
|o16 = total: 1 16 30 16 1                                                    |
|          0: 1  .  .  . .                                                    |
|          1: .  .  .  . .                                                    |
|          2: . 16 30 16 .                                                    |
|          3: .  .  .  . .                                                    |
|          4: .  .  .  . 1                                                    |
|                                                                             |
|o16 : BettiTally                                                             |
+-----------------------------------------------------------------------------+
|i17 : Q = x_0^4+x_1^4+x_2^4+x_3^4+x5^4;                                      |
+-----------------------------------------------------------------------------+
|i18 : minimalBetti inverseSystem Q                                           |
|                                                                             |
|             0 1  2 3 4                                                      |
|o18 = total: 1 6 10 6 1                                                      |
|          0: 1 .  . . .                                                      |
|          1: . 5  5 . .                                                      |
|          2: . 1  . 1 .                                                      |
|          3: . .  5 5 .                                                      |
|          4: . .  . . 1                                                      |
|                                                                             |
|o18 : BettiTally                                                             |
+-----------------------------------------------------------------------------+
|i19 : quarticType Q                                                          |
|                                                                             |
|o19 = [550]                                                                  |
+-----------------------------------------------------------------------------+

See also
========

  * [QQ] -- Quaternary Quartic Forms and Gorenstein rings
    (Kapustka, Kapustka, Ranestad, Schenck, Stillman, Yuan, 2021)
  * quarticType(RingElement) -- the Betti
    stratum a specific quartic lies on
  * inverseSystem (InverseSystems) -- Inverse systems with
    equivariance
  * minimalBetti (Macaulay2Doc) -- minimal betti numbers of
    (the minimal free resolution of) a homogeneous ideal or module
-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics/Section6Doc.m2:94:0.

nondegenerateBorels -- construct all nondegenerate strongly stable ideals of given length
*****************************************************************************************

  * Usage:
        nondegenerateBorels(d, S)
  * Inputs:
      * d, an integer (Macaulay2Doc), the length of the desired
        ideals in S$
      * S, a ring (Macaulay2Doc), a polynomial ring
  * Optional inputs (Macaulay2Doc),:
      * Sort => a Boolean value (Macaulay2Doc), default value
        false, whether to sort the generators of each ideal in a slightly more
        natural way
  * Outputs:
      * a list (Macaulay2Doc), of all strongly stable ideals in $S$
        which are saturated, are (affine) dimension one, have degree $d$, and
        have no linear forms in their ideal

Description
===========

This is a simplified interface to the stronglyStableIdeals (StronglyStableIdeals),
function.

For example, the following are all of the strongly stable ideals with degree 7,
and their Betti tables.

+-------------------------------------------------------------------+
|i1 : S = ZZ/101[a..d];                                             |
+-------------------------------------------------------------------+
|i2 : Bs = nondegenerateBorels(7, S);                               |
+-------------------------------------------------------------------+
|i3 : netList Bs                                                    |
|                                                                   |
|     +---------------------------------------+                     |
|     |                  2        2   5       |                     |
|o3 = |ideal (b*c, a*c, b , a*b, a , c )      |                     |
|     +---------------------------------------+                     |
|     |             2        2     2   4      |                     |
|     |ideal (a*c, b , a*b, a , b*c , c )     |                     |
|     +---------------------------------------+                     |
|     |                  2   3     2   2    3 |                     |
|     |ideal (a*c, a*b, a , c , b*c , b c, b )|                     |
|     +---------------------------------------+                     |
|     |        2        2   3     2     2     |                     |
|     |ideal (b , a*b, a , c , b*c , a*c )    |                     |
|     +---------------------------------------+                     |
+-------------------------------------------------------------------+
|i4 : netList pack(4, Bs/minimalBetti)                              |
|                                                                   |
|     +--------------+--------------+---------------+--------------+|
|     |       0 1 2 3|       0 1 2 3|       0 1  2 3|       0 1 2 3||
|o4 = |total: 1 6 8 3|total: 1 6 8 3|total: 1 7 10 4|total: 1 6 8 3||
|     |    0: 1 . . .|    0: 1 . . .|    0: 1 .  . .|    0: 1 . . .||
|     |    1: . 5 6 2|    1: . 4 4 1|    1: . 3  3 1|    1: . 3 2 .||
|     |    2: . . . .|    2: . 1 2 1|    2: . 4  7 3|    2: . 3 6 3||
|     |    3: . . . .|    3: . 1 2 1|               |              ||
|     |    4: . 1 2 1|              |               |              ||
|     +--------------+--------------+---------------+--------------+|
+-------------------------------------------------------------------+

Using the Sort option as follows gives a somewhat more natural ordering.
Sometimes computations involving the groebnerSratum ideal will be either much
faster or slower with this option.  But it is often worth trying it both ways,
if your computations are slow.

+---------------------------------------------------+
|i5 : Bs2 = nondegenerateBorels(7, S, Sort => true);|
+---------------------------------------------------+
|i6 : netList Bs2                                   |
|                                                   |
|     +---------------------------------------+     |
|     |        2        2             5       |     |
|o6 = |ideal (a , a*b, b , a*c, b*c, c )      |     |
|     +---------------------------------------+     |
|     |        2        2          2   4      |     |
|     |ideal (a , a*b, b , a*c, b*c , c )     |     |
|     +---------------------------------------+     |
|     |        2             3   2      2   3 |     |
|     |ideal (a , a*b, a*c, b , b c, b*c , c )|     |
|     +---------------------------------------+     |
|     |        2        2     2     2   3     |     |
|     |ideal (a , a*b, b , a*c , b*c , c )    |     |
|     +---------------------------------------+     |
+---------------------------------------------------+

This is a convenience function.  Here is the simple code:

+-----------------------------------------------------------------------------+
|i7 : code methods nondegenerateBorels                                        |
|                                                                             |
|o7 = -- code for method: nondegenerateBorels(ZZ,Ring)                        |
|     ${prefix}/share/Macaulay2/QuaternaryQuartics.m2:117:                    |
|     41-123:5: --source code:                                                |
|     nondegenerateBorels(ZZ, Ring) := List => opts -> (d, S) -> (            |
|         Bs := stronglyStableIdeals(d, S);                                   |
|         Bs = select(Bs, i -> all(i_*, f -> degree f =!= {1}));              |
|         if opts.Sort then                                                   |
|           Bs = Bs/(i -> ideal sort(gens i, MonomialOrder => Descending,     |
|         Bs                                                                  |
|         )                                                                   |
|-----------------------------------------------------------------------------|
|DegreeOrder => Ascending));                                                  |
+-----------------------------------------------------------------------------+

See also
========

  * random (Macaulay2Doc) -- get a random object
  * randomBlockMatrix -- create a block matrix with
    zero, identity and random blocks
  * randomHomomorphism -- create a random
    homomorphism between graded modules
  * randomPoints -- create a matrix whose columns are
    random points

Ways to use nondegenerateBorels:
================================

  * "nondegenerateBorels(ZZ,Ring)"

For the programmer
==================

The object nondegenerateBorels, is a method function with options (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics.m2:704:0.

Normalize -- an option name
***************************

Description
===========

Used in randomPoints.

Functions with optional argument named Normalize:
=================================================

  * "randomPoints(...,Normalize=>...)" -- see randomPoints,
    -- create a matrix whose columns are random points

For the programmer
==================

The object Normalize, is a symbol (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics.m2:937:0.

Pfaffians on quadrics -- compute the quartic and betti table corresponding to a pfaffian ideal in a quadric
***********************************************************************************************************

Having a skew-symmetric map between a bundle and its dual from Proposition 7.2
we determine the Pfaffian ideal I in the ring of the quadric, the corresponding
quartic $F$ to which I is fully apolar and the betti table of $F^{\perp}$ .

+-----------------------------------------------------+
|i1 : R=QQ[x,y,z,t,Degrees=>{{1,0},{1,0},{0,1},{0,1}}]|
|                                                     |
|o1 = R                                               |
|                                                     |
|o1 : PolynomialRing                                  |
+-----------------------------------------------------+
|i2 : Q=QQ[a,b,c,d]                                   |
|                                                     |
|o2 = Q                                               |
|                                                     |
|o2 : PolynomialRing                                  |
+-----------------------------------------------------+
|i3 : seg=map(R,Q, gens (ideal {x,y}* ideal (z,t)))   |
|                                                     |
|o3 = map (R, Q, {x*z, x*t, y*z, y*t})                |
|                                                     |
|o3 : RingMap R <-- Q                                 |
+-----------------------------------------------------+

We choose a random map between suitable vector bundles as in the list below

+-----------------------------------------------------------------------------+
|i4 : NTypes = hashTable{                                                     |
|         N100 => random(R^{3:{0,1}, 3                                        |
|         N683 => random(R^{{2,1}, {2,                                        |
|         N550 => random(R^{{2,1}, {1,                                        |
|         N400 => random(R^{{1,1}, {1,                                        |
|         N300a => random(R^{{1,0}, {0                                        |
|         N300b => randomBlockMatrix({                                        |
|         N300c => randomBlockMatrix({                                        |
|         N310 => randomBlockMatrix({R                                        |
|         N430 => randomBlockMatrix({R                                        |
|         N320 => random(R^{{1,0}, 2:{                                        |
|         N200 => random(R^{2:{1,0}, 2                                        |
|         N420 => randomBlockMatrix({R                                        |
|         N441a => random(R^{{1,2}, {2                                        |
|         N441b => random(R^{{1,0}, {1                                        |
|         N551 => randomBlockMatrix({R                                        |
|         N562 => randomBlockMatrix({R                                        |
|         };                                                                  |
|-----------------------------------------------------------------------------|
|:{1,0}, {0,0}}, R^{3:{0,-1}, 3:{-1,0}, {0,0}}),                              |
|1}, {-1,1}}, R^{{-2,-1}, {-2,-1}, {1,-1}}),                                  |
|2}, {0,0}}, R^{{-2,-1}, {-1,-2}, {0,0}}),                                    |
|1}, {1,1}}, R^{{-1,-1}, {-1,-1}, {-1,-1}}),                                  |
|,1}, 2:{1,1},{0,0}}, R^{{-1,0}, {0,-1}, 2:{-1,-1}, {0,0}}),                  |
|R^{{1,0},{0,0}},  R^{{0,1}, 2:{1,1}}},{R^{{-1,0},{0,0}},  R^{{0,-            |
|R^{{0,1}},R^{{0,0},{1,0}}, R^{ 2:{1,1}}},{R^{{0,-1}},R^{{0,0},{-1            |
|^{{0,0}},R^{{0,1},{1,0}}, R^{ 2:{1,1}}},{R^{{0,0}},R^{{0,-1},{-1,            |
|^{{0,1}},R^{{0,0}},  R^{{0,0}}, R^{{1,1},{2,1}}},{R^{{0,-1}},R^{{            |
|0,1}, {2,1},{0,0}}, R^{{-1,0}, 2:{0,-1}, {-2,-1}, {0,0}}),                   |
|:{0,1}, {1,1}}, R^{2:{-1,0}, 2:{0,-1}, {-1,-1}}),                            |
|^{3:{1,1}},R^{2:{0,0}}},{ R^{3:{-1,-1}},R^{ 2:{0,0}}}, {{random,             |
|,1}, {0,1},{1,0},{-1,-1}}, R^{{-1,-2}, {-2,-1}, {0,-1},{-1,0}, {1            |
|,0}, {1,3}}, R^{{-1,0}, {-1,0}, {-1,-3}}),                                   |
|^{{1,2}, {2,1},{0,0}}, R^{{1,1},{-1,-1}}},{ R^{{-1,-2}, {-2,-1},{            |
|^{{1,2}, {2,1},{0,0}},R^{{0,1},{0,-1}}},{ R^{{-1,-2}, {-2,-1},{0,            |
|-----------------------------------------------------------------------------|
|1}, 2:{-1,-1}}}, {{0,random},{random,random}}),                              |
|,0}}, R^{ 2:{-1,-1}}}, {{0,0,random},{0,random, random},{random,             |
|0}}, R^{ 2:{-1,-1}}}, {{0,0,random},{0,random, random},{random,              |
|0,0}},  R^{{0,0}},R^{ {-1,-1},{-2,-1}}}, {{0,0,random, random},{             |
|                                                                             |
|                                                                             |
|random},{random,0}}),                                                        |
|,1}}),                                                                       |
|                                                                             |
|0,0}},R^{{-1,-1},{1,1}}},{{random, random},{random,0}} ),                    |
|0}}, R^{{0,-1},{0,1}}},{{random, random},{random,0}}),                       |
|-----------------------------------------------------------------------------|
| random, random}}),                                                          |
|random, random}}),                                                           |
|0,0,0,random},{random,0,random,random},{random, random, random, random}}),   |
+-----------------------------------------------------------------------------+

We define the function BettiPfaffian returning the Betti table of $F^{\perp}$
for $F$ the quartic to which the Pfaffian ideal for a random skewsymmetric map
of prescribed shape is fully apolar

+-----------------------------------------------------------------------------+
|i5 : BettiPfaffian= N->(                                                     |
|         NN=N-transpose N; -- NN will be a random skew-matrix of the         |
|         K=pfaffians(numrows NN-1,NN);                                       |
|         I=preimage (seg, K);                                                |
|         Quartic=(inverseSystem (super basis(4,I)))_0; -- compute the        |
|         Betti=betti resolution inverseSystem Quartic;                       |
|         return Betti)                                                       |
|                                                                             |
|o5 = BettiPfaffian                                                           |
|                                                                             |
|o5 : FunctionClosure                                                         |
|-----------------------------------------------------------------------------|
|given shape                                                                  |
|                                                                             |
|                                                                             |
| quartic                                                                     |
+-----------------------------------------------------------------------------+
|i6 : netList for typeN in keys(NTypes) list {typeN,                          |
|                                                                             |
|     +-----+-------------------+                                             |
|     |     |       0 1  2 3 4  |                                             |
|o6 = |N300a|total: 1 7 12 7 1  |                                             |
|     |     |    0: 1 .  . . .  |                                             |
|     |     |    1: . 3  . . .  |                                             |
|     |     |    2: . 4 12 4 .  |                                             |
|     |     |    3: . .  . 3 .  |                                             |
|     |     |    4: . .  . . 1  |                                             |
|     +-----+-------------------+                                             |
|     |     |       0 1  2 3 4  |                                             |
|     |N300b|total: 1 7 12 7 1  |                                             |
|     |     |    0: 1 .  . . .  |                                             |
|     |     |    1: . 3  . . .  |                                             |
|     |     |    2: . 4 12 4 .  |                                             |
|     |     |    3: . .  . 3 .  |                                             |
|     |     |    4: . .  . . 1  |                                             |
|     +-----+-------------------+                                             |
|     |     |       0 1  2 3 4  |                                             |
|     |N441a|total: 1 9 16 9 1  |                                             |
|     |     |    0: 1 .  . . .  |                                             |
|     |     |    1: . 4  4 1 .  |                                             |
|     |     |    2: . 4  8 4 .  |                                             |
|     |     |    3: . 1  4 4 .  |                                             |
|     |     |    4: . .  . . 1  |                                             |
|     +-----+-------------------+                                             |
|     |     |       0 1  2 3 4  |                                             |
|     |N300c|total: 1 7 12 7 1  |                                             |
|     |     |    0: 1 .  . . .  |                                             |
|     |     |    1: . 3  . . .  |                                             |
|     |     |    2: . 4 12 4 .  |                                             |
|     |     |    3: . .  . 3 .  |                                             |
|     |     |    4: . .  . . 1  |                                             |
|     +-----+-------------------+                                             |
|     |     |       0 1  2 3 4  |                                             |
|     |N441b|total: 1 9 16 9 1  |                                             |
|     |     |    0: 1 .  . . .  |                                             |
|     |     |    1: . 4  4 1 .  |                                             |
|     |     |    2: . 4  8 4 .  |                                             |
|     |     |    3: . 1  4 4 .  |                                             |
|     |     |    4: . .  . . 1  |                                             |
|     +-----+-------------------+                                             |
|     |     |       0 1  2 3 4  |                                             |
|     |N550 |total: 1 6 10 6 1  |                                             |
|     |     |    0: 1 .  . . .  |                                             |
|     |     |    1: . 5  5 . .  |                                             |
|     |     |    2: . 1  . 1 .  |                                             |
|     |     |    3: . .  5 5 .  |                                             |
|     |     |    4: . .  . . 1  |                                             |
|     +-----+-------------------+                                             |
|     |     |       0 1  2 3 4  |                                             |
|     |N562 |total: 1 9 16 9 1  |                                             |
|     |     |    0: 1 .  . . .  |                                             |
|     |     |    1: . 5  6 2 .  |                                             |
|     |     |    2: . 2  4 2 .  |                                             |
|     |     |    3: . 2  6 5 .  |                                             |
|     |     |    4: . .  . . 1  |                                             |
|     +-----+-------------------+                                             |
|     |     |       0 1  2 3 4  |                                             |
|     |N551 |total: 1 7 12 7 1  |                                             |
|     |     |    0: 1 .  . . .  |                                             |
|     |     |    1: . 5  5 1 .  |                                             |
|     |     |    2: . 1  2 1 .  |                                             |
|     |     |    3: . 1  5 5 .  |                                             |
|     |     |    4: . .  . . 1  |                                             |
|     +-----+-------------------+                                             |
|     |     |       0  1  2  3 4|                                             |
|     |N100 |total: 1 13 24 13 1|                                             |
|     |     |    0: 1  .  .  . .|                                             |
|     |     |    1: .  1  .  . .|                                             |
|     |     |    2: . 12 24 12 .|                                             |
|     |     |    3: .  .  .  1 .|                                             |
|     |     |    4: .  .  .  . 1|                                             |
|     +-----+-------------------+                                             |
|     |     |       0 1  2 3 4  |                                             |
|     |N683 |total: 1 9 16 9 1  |                                             |
|     |     |    0: 1 .  . . .  |                                             |
|     |     |    1: . 6  8 3 .  |                                             |
|     |     |    2: . .  . . .  |                                             |
|     |     |    3: . 3  8 6 .  |                                             |
|     |     |    4: . .  . . 1  |                                             |
|     +-----+-------------------+                                             |
|     |     |       0 1  2 3 4  |                                             |
|     |N430 |total: 1 7 12 7 1  |                                             |
|     |     |    0: 1 .  . . .  |                                             |
|     |     |    1: . 4  3 . .  |                                             |
|     |     |    2: . 3  6 3 .  |                                             |
|     |     |    3: . .  3 4 .  |                                             |
|     |     |    4: . .  . . 1  |                                             |
|     +-----+-------------------+                                             |
|     |     |       0 1  2 3 4  |                                             |
|     |N320 |total: 1 9 16 9 1  |                                             |
|     |     |    0: 1 .  . . .  |                                             |
|     |     |    1: . 3  2 . .  |                                             |
|     |     |    2: . 6 12 6 .  |                                             |
|     |     |    3: . .  2 3 .  |                                             |
|     |     |    4: . .  . . 1  |                                             |
|     +-----+-------------------+                                             |
|     |     |       0 1  2 3 4  |                                             |
|     |N310 |total: 1 8 14 8 1  |                                             |
|     |     |    0: 1 .  . . .  |                                             |
|     |     |    1: . 3  1 . .  |                                             |
|     |     |    2: . 5 12 5 .  |                                             |
|     |     |    3: . .  1 3 .  |                                             |
|     |     |    4: . .  . . 1  |                                             |
|     +-----+-------------------+                                             |
|     |     |       0  1  2  3 4|                                             |
|     |N200 |total: 1 10 18 10 1|                                             |
|     |     |    0: 1  .  .  . .|                                             |
|     |     |    1: .  2  .  . .|                                             |
|     |     |    2: .  8 18  8 .|                                             |
|     |     |    3: .  .  .  2 .|                                             |
|     |     |    4: .  .  .  . 1|                                             |
|     +-----+-------------------+                                             |
|     |     |       0 1  2 3 4  |                                             |
|     |N420 |total: 1 6 10 6 1  |                                             |
|     |     |    0: 1 .  . . .  |                                             |
|     |     |    1: . 4  2 . .  |                                             |
|     |     |    2: . 2  6 2 .  |                                             |
|     |     |    3: . .  2 4 .  |                                             |
|     |     |    4: . .  . . 1  |                                             |
|     +-----+-------------------+                                             |
|     |     |       0 1 2 3 4   |                                             |
|     |N400 |total: 1 4 6 4 1   |                                             |
|     |     |    0: 1 . . . .   |                                             |
|     |     |    1: . 4 . . .   |                                             |
|     |     |    2: . . 6 . .   |                                             |
|     |     |    3: . . . 4 .   |                                             |
|     |     |    4: . . . . 1   |                                             |
|     +-----+-------------------+                                             |
|-----------------------------------------------------------------------------|
|BettiPfaffian(NTypes#typeN)}                                                 |
+-----------------------------------------------------------------------------+

See also
========

  * [QQ] -- Quaternary Quartic Forms and Gorenstein rings
    (Kapustka, Kapustka, Ranestad, Schenck, Stillman, Yuan, 2021)
-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics/Section7Doc.m2:51:0.

pointsIdeal -- create an ideal of points
****************************************

  * Usage:
        pointsIdeal M
        pointsIdeal(R, M)
  * Inputs:
      * M, a matrix (Macaulay2Doc), of size $m \times n$, either
        over the coefficient ring of $R$, or a polynomial ring $R$ with $m$
        variables
      * R, a ring (Macaulay2Doc), either the ring of $M$, or a
        polynomial ring with $m$ variables with coefficient ring the ring of
        $M$
  * Outputs:
      * an ideal (Macaulay2Doc), the homogeneous ideal in $R$ of
        the points which are the columns of $M$

Description
===========

In this example, we find the ideal of 6 general points in $\PP^3$.  Since they
are general, we can set the first 5 points to be in standard position (the
coordinate points, and the point with all coordinates being 1).

+-----------------------------------------------------------------------------+
|i1 : S = ZZ/32003[a..d]                                                      |
|                                                                             |
|o1 = S                                                                       |
|                                                                             |
|o1 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i2 : M = randomPoints(S, 6, Normalize => true)                               |
|                                                                             |
|o2 = | 1 0 0 0 1 107   |                                                     |
|     | 0 1 0 0 1 4376  |                                                     |
|     | 0 0 1 0 1 -5570 |                                                     |
|     | 0 0 0 1 1 3187  |                                                     |
|                                                                             |
|             4      6                                                        |
|o2 : Matrix S  <-- S                                                         |
+-----------------------------------------------------------------------------+
|i3 : I = pointsIdeal M                                                       |
|                                                                             |
|o3 = ideal (a*d + 13356b*d - 13357c*d, b*c + 9278b*d - 9279c*d, a*c -        |
|     ------------------------------------------------------------------------|
|     15663b*d + 15662c*d, a*b - 4105b*d + 4104c*d)                           |
|                                                                             |
|o3 : Ideal of S                                                              |
+-----------------------------------------------------------------------------+
|i4 : betti res I                                                             |
|                                                                             |
|            0 1 2 3                                                          |
|o4 = total: 1 4 5 2                                                          |
|         0: 1 . . .                                                          |
|         1: . 4 2 .                                                          |
|         2: . . 3 2                                                          |
|                                                                             |
|o4 : BettiTally                                                              |
+-----------------------------------------------------------------------------+

See also
========

  * randomPoints -- create a matrix whose columns are
    random points

Ways to use pointsIdeal:
========================

  * "pointsIdeal(Matrix)"
  * "pointsIdeal(Ring,Matrix)"

For the programmer
==================

The object pointsIdeal, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics.m2:497:0.

quartic -- a quartic given by power sums of linear forms
********************************************************

  * Usage:
        quartic M
        quartic(M, S)
  * Inputs:
      * M, a matrix (Macaulay2Doc), A matrix of scalars, over a
        ring $S$, or a field
      * S, a ring (Macaulay2Doc), A polynomial ring with the same
        number of variables as the number of rows of $M$. If not given, $S$ is
        taken to be the ring of $M$.
  * Outputs:
      * a ring element (Macaulay2Doc), A homogeneous quartic
        polynomial in $S$

Description
===========

One useful way to generate quartic polynomials is as a sum of 4th powers of
linear forms.  This function creates an linear form from each column of the
matrix $M$, and then sums their 4th powers.

+----------------------------------------------------+
|i1 : S = ZZ/101[a..d]                               |
|                                                    |
|o1 = S                                              |
|                                                    |
|o1 : PolynomialRing                                 |
+----------------------------------------------------+
|i2 : M = transpose matrix(S, {{1,0,0,0}, {0,1,0,0}})|
|                                                    |
|o2 = | 1 0 |                                        |
|     | 0 1 |                                        |
|     | 0 0 |                                        |
|     | 0 0 |                                        |
|                                                    |
|             4      2                               |
|o2 : Matrix S  <-- S                                |
+----------------------------------------------------+
|i3 : quartic M                                      |
|                                                    |
|      4    4                                        |
|o3 = a  + b                                         |
|                                                    |
|o3 : S                                              |
+----------------------------------------------------+
+-----------------------------------------------------------------------------+
|i4 : H = bettiStrataExamples S                                               |
|                                                                             |
|o4 = HashTable{"[000]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[100]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[200]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[210]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[300a]" => {| 1 1  1                                         |
|                            | 2 2  2                                         |
|                            | 3 3  -                                         |
|                            | 1 -1 1                                         |
|               "[300b]" => {| 1 0 0                                          |
|                            | 0 1 0                                          |
|                            | 0 0 1                                          |
|                            | 0 0 0                                          |
|               "[300c]" => {| 1 0 1                                          |
|                            | 0 1 1                                          |
|                            | 0 0 0                                          |
|                            | 0 0 0                                          |
|               "[310]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[320]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[331]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[420]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[430]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[441a]" => {| 1 0 0                                          |
|                            | 0 1 0                                          |
|                            | 0 0 1                                          |
|                            | 0 0 0                                          |
|               "[441b]" => {| 1 0 0                                          |
|                            | 0 1 0                                          |
|                            | 0 0 1                                          |
|                            | 0 0 0                                          |
|               "[550]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[551]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[562]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[683]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|                                                                             |
|o4 : HashTable                                                               |
|-----------------------------------------------------------------------------|
| 1 22  2   -37 -18 32  |, 10 general points}                                 |
| 1 -47 29  -13 39  -9  |                                                     |
| 1 -23 -47 -10 27  -32 |                                                     |
| 1 -7  15  30  -22 -20 |                                                     |
| 1 39  48 -38 46  |, 9 general points}                                       |
| 1 43  36 33  -28 |                                                          |
| 1 -17 35 40  1   |                                                          |
| 1 -11 11 11  -3  |                                                          |
| 1 16  -48 -16 |, 8 general points}                                          |
| 1 22  -47 7   |                                                             |
| 1 45  47  15  |                                                             |
| 1 -34 19  -23 |                                                             |
| 1 1 0 1 |, 8 points with 6 in a plane, or five in a plane and three in a    |
| 1 0 1 1 |                                                                   |
| 0 1 1 1 |                                                                   |
| 0 0 0 1 |                                                                   |
|  1  1  1  1  1  |, 8 points which forms a CI}                               |
|  2  -2 -2 -2 -2 |                                                           |
|3 -3 3  3  -3 -3 |                                                           |
|  -1 1  -1 1  -1 |                                                           |
|0 1 19  -8  |, 7 general points}                                             |
|0 1 19  -22 |                                                                |
|0 1 -10 -29 |                                                                |
|1 1 -29 -24 |                                                                |
|-38 34  -18 -28 |, 7 points, 3 on a line}                                    |
|-16 19  -13 -47 |                                                            |
|39  -47 -43 38  |                                                            |
|21  -39 -15 2   |                                                            |
| 1 1 1 |, 7 points with 5 on a plane}                                        |
| 1 1 0 |                                                                     |
| 1 1 0 |                                                                     |
| 0 1 1 |                                                                     |
| 1 1 1 |, 7 points on a twisted cubic curve}                                 |
| 1 0 0 |                                                                     |
| 0 1 0 |                                                                     |
| 0 0 1 |                                                                     |
| 24  -15 33  |, 7 points with 6 on a plane}                                  |
| -30 39  -49 |                                                               |
| -48 0   -33 |                                                               |
| 0   0   0   |                                                               |
| 1 24  |, 6 general points}                                                  |
| 1 -36 |                                                                     |
| 1 -30 |                                                                     |
| 1 -29 |                                                                     |
| 1 1 |, 6 points, 3 on a line}                                               |
| 1 0 |                                                                       |
| 0 1 |                                                                       |
| 0 1 |                                                                       |
|0 1 1 |, 6 points, 5 on a plane}                                             |
|0 1 0 |                                                                      |
|0 0 1 |                                                                      |
|1 0 0 |                                                                      |
|0 1 0 |, 6 points, 3 each on 2 skew lines}                                   |
|0 1 0 |                                                                      |
|0 0 1 |                                                                      |
|1 0 1 |                                                                      |
| 1 |, 5 general points}                                                      |
| 1 |                                                                         |
| 1 |                                                                         |
| 1 |                                                                         |
| 1 |, 5 points, 4 on a plane}                                                |
| 1 |                                                                         |
| 1 |                                                                         |
| 0 |                                                                         |
| 1 |, 5 points, 3 on a line}                                                 |
| 1 |                                                                         |
| 0 |                                                                         |
| 0 |                                                                         |
| |, 4 general points}                                                        |
| |                                                                           |
| |                                                                           |
| |                                                                           |
|-----------------------------------------------------------------------------|
|     }                                                                       |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|line}                                                                        |
+-----------------------------------------------------------------------------+
|i5 : keys H                                                                  |
|                                                                             |
|o5 = {[310], [420], [200], [210], [331], [320], [683], [100], [562], [551],  |
|     ------------------------------------------------------------------------|
|     [430], [550], [000], [441b], [441a], [300c], [300b], [300a]}            |
|                                                                             |
|o5 : List                                                                    |
+-----------------------------------------------------------------------------+
|i6 : M = first H#"[420]"                                                     |
|                                                                             |
|o6 = | 1 0 0 0 1 24  |                                                       |
|     | 0 1 0 0 1 -36 |                                                       |
|     | 0 0 1 0 1 -30 |                                                       |
|     | 0 0 0 1 1 -29 |                                                       |
|                                                                             |
|             4      6                                                        |
|o6 : Matrix S  <-- S                                                         |
+-----------------------------------------------------------------------------+
|i7 : F = quartic M                                                           |
|                                                                             |
|         4      3       2 2        3      4      3       2           2       |
|o7 = - 7a  - 43a b + 36a b  - 26a*b  - 12b  + 49a c - 39a b*c + 38a*b c -    |
|     ------------------------------------------------------------------------|
|       3       2 2      2 2        3       3      4     3      2           2 |
|     9b c + 10a c  + 15b c  - 33a*c  + 9b*c  - 18c  - 3a d - 7a b*d - 10a*b d|
|     ------------------------------------------------------------------------|
|          3       2                     2           2         2      3       |
|     + 15b d + 13a c*d + 21a*b*c*d - 11b c*d + 36a*c d - 24b*c d - 6c d +    |
|     ------------------------------------------------------------------------|
|        2 2          2      2 2          2          2      2 2        3      |
|     25a d  - 45a*b*d  - 27b d  + 15a*c*d  - 43b*c*d  + 42c d  + 42a*d  +    |
|     ------------------------------------------------------------------------|
|          3       3      4                                                   |
|     48b*d  + 7c*d  - 20d                                                    |
|                                                                             |
|o7 : S                                                                       |
+-----------------------------------------------------------------------------+

This is a convenience function.  This is basically short hand for the following
(which computes the linear forms corresponding to each column of $M$, and then
sums their 4th powers.

+-----------------------------------------------------------------------------+
|i8 : lins := flatten entries((vars S) * M)                                   |
|                                                                             |
|o8 = {a, b, c, d, a + b + c + d, 24a - 36b - 30c - 29d}                      |
|                                                                             |
|o8 : List                                                                    |
+-----------------------------------------------------------------------------+
|i9 : F1 = sum for g in lins list g^4                                         |
|                                                                             |
|         4      3       2 2        3      4      3       2           2       |
|o9 = - 7a  - 43a b + 36a b  - 26a*b  - 12b  + 49a c - 39a b*c + 38a*b c -    |
|     ------------------------------------------------------------------------|
|       3       2 2      2 2        3       3      4     3      2           2 |
|     9b c + 10a c  + 15b c  - 33a*c  + 9b*c  - 18c  - 3a d - 7a b*d - 10a*b d|
|     ------------------------------------------------------------------------|
|          3       2                     2           2         2      3       |
|     + 15b d + 13a c*d + 21a*b*c*d - 11b c*d + 36a*c d - 24b*c d - 6c d +    |
|     ------------------------------------------------------------------------|
|        2 2          2      2 2          2          2      2 2        3      |
|     25a d  - 45a*b*d  - 27b d  + 15a*c*d  - 43b*c*d  + 42c d  + 42a*d  +    |
|     ------------------------------------------------------------------------|
|          3       3      4                                                   |
|     48b*d  + 7c*d  - 20d                                                    |
|                                                                             |
|o9 : S                                                                       |
+-----------------------------------------------------------------------------+
|i10 : F1 == F                                                                |
|                                                                             |
|o10 = true                                                                   |
+-----------------------------------------------------------------------------+
+-----------------------------------------------------------------------------+
|i11 : I = inverseSystem F                                                    |
|                                                                             |
|                                                                             |
|o11 = ideal (a*d + 9b*d - 10c*d, b*c - 43b*d + 42c*d, a*c + 37b*d - 38c*d,   |
|      -----------------------------------------------------------------------|
|                          3      3        2        2      3   3      3       |
|      a*b + 3b*d - 4c*d, b  + 11c  - 21b*d  - 31c*d  - 21d , a  - 10c  -     |
|      -----------------------------------------------------------------------|
|           2        2      3                                                 |
|      33b*d  - 21c*d  + 22d )                                                |
|                                                                             |
|o11 : Ideal of S                                                             |
+-----------------------------------------------------------------------------+
|i12 : (degree I, codim I, regularity(S^1/I))                                 |
|                                                                             |
|o12 = (16, 4, 4)                                                             |
|                                                                             |
|o12 : Sequence                                                               |
+-----------------------------------------------------------------------------+
|i13 : minimalBetti I                                                         |
|                                                                             |
|             0 1  2 3 4                                                      |
|o13 = total: 1 6 10 6 1                                                      |
|          0: 1 .  . . .                                                      |
|          1: . 4  2 . .                                                      |
|          2: . 2  6 2 .                                                      |
|          3: . .  2 4 .                                                      |
|          4: . .  . . 1                                                      |
|                                                                             |
|o13 : BettiTally                                                             |
+-----------------------------------------------------------------------------+

See also
========

  * inverseSystem(RingElement) (InverseSystems) -- Inverse
    systems with equivariance
  * bettiStrataExamples -- a hash table consisting
    of examples for each of the 19 Betti strata

Ways to use quartic:
====================

  * "quartic(Matrix)"
  * "quartic(Matrix,Ring)"

For the programmer
==================

The object quartic, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics.m2:927:0.

quarticType(RingElement) -- the Betti stratum a specific quartic lies on
************************************************************************

  * Function: quarticType,
  * Usage:
        quarticType F
  * Inputs:
      * F, a ring element (Macaulay2Doc), A homogeneous
        quartic polynomial in a polynomial ring $S$ in 4 variables (over a
        field)
  * Outputs:
      * a string (Macaulay2Doc), one of the strings: [has linear
        form], [000], [100], [200], [210], [300ab], [300c], [310], [320],
        [331], [420], [430], [441a], [441b], [550], [551], [562], [683].

Description
===========

If the inverse system $F^\perp$ of $F$ contains a linear form, then [has linear
forms] is returned. There are 19 strata for $F$ which do not have a linear form
in their inverse system.  This function determines which one of these 19 strata
the quartic lives on.  However, it cannot distinguish easily between [300a] and
[300b], so instead it returns [300ab] in this case. Note that the function can
detect [300c], as this is the situation when the 3 quadrics are not a complete
intersection (instead, they form the ideal of a length 7 subscheme of $\PP^3$).

All other cases can be determined by the free resolution of the ideal of
quadrics in the inverse system $F^\perp$, although in cases [300abc] and
[441ab], a slightly finer analysis must be made, which depends on the syzygies
of the quadratic ideal.

See section 6 of [QQ] for the inclusion relations on the closures of these
strata, and their dimensions.

The 2 cases that cannot be determined easily are [300a] and [300b]. The inverse
system $F^\perp$ has 3 quadric generators in each case. However, in one case
the quartic has rank 7 (this is the case [300b], and the other case [300a], the
quadric generally has rank 8). This is subtle information, which we do not try
to compute here.

+-----------------------------------------------------------------------------+
|i1 : S = ZZ/101[a..d]                                                        |
|                                                                             |
|o1 = S                                                                       |
|                                                                             |
|o1 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i2 : H = bettiStrataExamples S                                               |
|                                                                             |
|o2 = HashTable{"[000]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[100]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[200]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[210]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[300a]" => {| 1 1  1                                         |
|                            | 2 2  2                                         |
|                            | 3 3  -                                         |
|                            | 1 -1 1                                         |
|               "[300b]" => {| 1 0 0                                          |
|                            | 0 1 0                                          |
|                            | 0 0 1                                          |
|                            | 0 0 0                                          |
|               "[300c]" => {| 1 0 1                                          |
|                            | 0 1 1                                          |
|                            | 0 0 0                                          |
|                            | 0 0 0                                          |
|               "[310]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[320]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[331]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[420]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[430]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[441a]" => {| 1 0 0                                          |
|                            | 0 1 0                                          |
|                            | 0 0 1                                          |
|                            | 0 0 0                                          |
|               "[441b]" => {| 1 0 0                                          |
|                            | 0 1 0                                          |
|                            | 0 0 1                                          |
|                            | 0 0 0                                          |
|               "[550]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[551]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[562]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|               "[683]" => {| 1 0 0 0                                         |
|                           | 0 1 0 0                                         |
|                           | 0 0 1 0                                         |
|                           | 0 0 0 1                                         |
|                                                                             |
|o2 : HashTable                                                               |
|-----------------------------------------------------------------------------|
| 1 22  2   -37 -18 32  |, 10 general points}                                 |
| 1 -47 29  -13 39  -9  |                                                     |
| 1 -23 -47 -10 27  -32 |                                                     |
| 1 -7  15  30  -22 -20 |                                                     |
| 1 39  48 -38 46  |, 9 general points}                                       |
| 1 43  36 33  -28 |                                                          |
| 1 -17 35 40  1   |                                                          |
| 1 -11 11 11  -3  |                                                          |
| 1 16  -48 -16 |, 8 general points}                                          |
| 1 22  -47 7   |                                                             |
| 1 45  47  15  |                                                             |
| 1 -34 19  -23 |                                                             |
| 1 1 0 1 |, 8 points with 6 in a plane, or five in a plane and three in a    |
| 1 0 1 1 |                                                                   |
| 0 1 1 1 |                                                                   |
| 0 0 0 1 |                                                                   |
|  1  1  1  1  1  |, 8 points which forms a CI}                               |
|  2  -2 -2 -2 -2 |                                                           |
|3 -3 3  3  -3 -3 |                                                           |
|  -1 1  -1 1  -1 |                                                           |
|0 1 19  -8  |, 7 general points}                                             |
|0 1 19  -22 |                                                                |
|0 1 -10 -29 |                                                                |
|1 1 -29 -24 |                                                                |
|-38 34  -18 -28 |, 7 points, 3 on a line}                                    |
|-16 19  -13 -47 |                                                            |
|39  -47 -43 38  |                                                            |
|21  -39 -15 2   |                                                            |
| 1 1 1 |, 7 points with 5 on a plane}                                        |
| 1 1 0 |                                                                     |
| 1 1 0 |                                                                     |
| 0 1 1 |                                                                     |
| 1 1 1 |, 7 points on a twisted cubic curve}                                 |
| 1 0 0 |                                                                     |
| 0 1 0 |                                                                     |
| 0 0 1 |                                                                     |
| 24  -15 33  |, 7 points with 6 on a plane}                                  |
| -30 39  -49 |                                                               |
| -48 0   -33 |                                                               |
| 0   0   0   |                                                               |
| 1 24  |, 6 general points}                                                  |
| 1 -36 |                                                                     |
| 1 -30 |                                                                     |
| 1 -29 |                                                                     |
| 1 1 |, 6 points, 3 on a line}                                               |
| 1 0 |                                                                       |
| 0 1 |                                                                       |
| 0 1 |                                                                       |
|0 1 1 |, 6 points, 5 on a plane}                                             |
|0 1 0 |                                                                      |
|0 0 1 |                                                                      |
|1 0 0 |                                                                      |
|0 1 0 |, 6 points, 3 each on 2 skew lines}                                   |
|0 1 0 |                                                                      |
|0 0 1 |                                                                      |
|1 0 1 |                                                                      |
| 1 |, 5 general points}                                                      |
| 1 |                                                                         |
| 1 |                                                                         |
| 1 |                                                                         |
| 1 |, 5 points, 4 on a plane}                                                |
| 1 |                                                                         |
| 1 |                                                                         |
| 0 |                                                                         |
| 1 |, 5 points, 3 on a line}                                                 |
| 1 |                                                                         |
| 0 |                                                                         |
| 0 |                                                                         |
| |, 4 general points}                                                        |
| |                                                                           |
| |                                                                           |
| |                                                                           |
|-----------------------------------------------------------------------------|
|     }                                                                       |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|line}                                                                        |
+-----------------------------------------------------------------------------+
|i3 : keys H                                                                  |
|                                                                             |
|o3 = {[310], [420], [200], [210], [331], [320], [683], [100], [562], [551],  |
|     ------------------------------------------------------------------------|
|     [430], [550], [000], [441b], [441a], [300c], [300b], [300a]}            |
|                                                                             |
|o3 : List                                                                    |
+-----------------------------------------------------------------------------+
|i4 : netList for k in sort keys H list (                                     |
|         F := quartic first H#k;                                             |
|         {k, minimalBetti inverseSystem F, quarticType F}                    |
|         )                                                                   |
|                                                                             |
|     +------+-------------------+-------+                                    |
|     |      |       0  1  2  3 4|       |                                    |
|o4 = |[000] |total: 1 16 30 16 1|[000]  |                                    |
|     |      |    0: 1  .  .  . .|       |                                    |
|     |      |    1: .  .  .  . .|       |                                    |
|     |      |    2: . 16 30 16 .|       |                                    |
|     |      |    3: .  .  .  . .|       |                                    |
|     |      |    4: .  .  .  . 1|       |                                    |
|     +------+-------------------+-------+                                    |
|     |      |       0  1  2  3 4|       |                                    |
|     |[100] |total: 1 13 24 13 1|[100]  |                                    |
|     |      |    0: 1  .  .  . .|       |                                    |
|     |      |    1: .  1  .  . .|       |                                    |
|     |      |    2: . 12 24 12 .|       |                                    |
|     |      |    3: .  .  .  1 .|       |                                    |
|     |      |    4: .  .  .  . 1|       |                                    |
|     +------+-------------------+-------+                                    |
|     |      |       0  1  2  3 4|       |                                    |
|     |[200] |total: 1 10 18 10 1|[200]  |                                    |
|     |      |    0: 1  .  .  . .|       |                                    |
|     |      |    1: .  2  .  . .|       |                                    |
|     |      |    2: .  8 18  8 .|       |                                    |
|     |      |    3: .  .  .  2 .|       |                                    |
|     |      |    4: .  .  .  . 1|       |                                    |
|     +------+-------------------+-------+                                    |
|     |      |       0  1  2  3 4|       |                                    |
|     |[210] |total: 1 11 20 11 1|[210]  |                                    |
|     |      |    0: 1  .  .  . .|       |                                    |
|     |      |    1: .  2  1  . .|       |                                    |
|     |      |    2: .  9 18  9 .|       |                                    |
|     |      |    3: .  .  1  2 .|       |                                    |
|     |      |    4: .  .  .  . 1|       |                                    |
|     +------+-------------------+-------+                                    |
|     |      |       0 1  2 3 4  |       |                                    |
|     |[300a]|total: 1 7 12 7 1  |[300ab]|                                    |
|     |      |    0: 1 .  . . .  |       |                                    |
|     |      |    1: . 3  . . .  |       |                                    |
|     |      |    2: . 4 12 4 .  |       |                                    |
|     |      |    3: . .  . 3 .  |       |                                    |
|     |      |    4: . .  . . 1  |       |                                    |
|     +------+-------------------+-------+                                    |
|     |      |       0 1  2 3 4  |       |                                    |
|     |[300b]|total: 1 7 12 7 1  |[300ab]|                                    |
|     |      |    0: 1 .  . . .  |       |                                    |
|     |      |    1: . 3  . . .  |       |                                    |
|     |      |    2: . 4 12 4 .  |       |                                    |
|     |      |    3: . .  . 3 .  |       |                                    |
|     |      |    4: . .  . . 1  |       |                                    |
|     +------+-------------------+-------+                                    |
|     |      |       0 1  2 3 4  |       |                                    |
|     |[300c]|total: 1 7 12 7 1  |[300c] |                                    |
|     |      |    0: 1 .  . . .  |       |                                    |
|     |      |    1: . 3  . . .  |       |                                    |
|     |      |    2: . 4 12 4 .  |       |                                    |
|     |      |    3: . .  . 3 .  |       |                                    |
|     |      |    4: . .  . . 1  |       |                                    |
|     +------+-------------------+-------+                                    |
|     |      |       0 1  2 3 4  |       |                                    |
|     |[310] |total: 1 8 14 8 1  |[310]  |                                    |
|     |      |    0: 1 .  . . .  |       |                                    |
|     |      |    1: . 3  1 . .  |       |                                    |
|     |      |    2: . 5 12 5 .  |       |                                    |
|     |      |    3: . .  1 3 .  |       |                                    |
|     |      |    4: . .  . . 1  |       |                                    |
|     +------+-------------------+-------+                                    |
|     |      |       0 1  2 3 4  |       |                                    |
|     |[320] |total: 1 9 16 9 1  |[320]  |                                    |
|     |      |    0: 1 .  . . .  |       |                                    |
|     |      |    1: . 3  2 . .  |       |                                    |
|     |      |    2: . 6 12 6 .  |       |                                    |
|     |      |    3: . .  2 3 .  |       |                                    |
|     |      |    4: . .  . . 1  |       |                                    |
|     +------+-------------------+-------+                                    |
|     |      |       0  1  2  3 4|       |                                    |
|     |[331] |total: 1 11 20 11 1|[331]  |                                    |
|     |      |    0: 1  .  .  . .|       |                                    |
|     |      |    1: .  3  3  1 .|       |                                    |
|     |      |    2: .  7 14  7 .|       |                                    |
|     |      |    3: .  1  3  3 .|       |                                    |
|     |      |    4: .  .  .  . 1|       |                                    |
|     +------+-------------------+-------+                                    |
|     |      |       0 1  2 3 4  |       |                                    |
|     |[420] |total: 1 6 10 6 1  |[420]  |                                    |
|     |      |    0: 1 .  . . .  |       |                                    |
|     |      |    1: . 4  2 . .  |       |                                    |
|     |      |    2: . 2  6 2 .  |       |                                    |
|     |      |    3: . .  2 4 .  |       |                                    |
|     |      |    4: . .  . . 1  |       |                                    |
|     +------+-------------------+-------+                                    |
|     |      |       0 1  2 3 4  |       |                                    |
|     |[430] |total: 1 7 12 7 1  |[430]  |                                    |
|     |      |    0: 1 .  . . .  |       |                                    |
|     |      |    1: . 4  3 . .  |       |                                    |
|     |      |    2: . 3  6 3 .  |       |                                    |
|     |      |    3: . .  3 4 .  |       |                                    |
|     |      |    4: . .  . . 1  |       |                                    |
|     +------+-------------------+-------+                                    |
|     |      |       0 1  2 3 4  |       |                                    |
|     |[441a]|total: 1 9 16 9 1  |[441a] |                                    |
|     |      |    0: 1 .  . . .  |       |                                    |
|     |      |    1: . 4  4 1 .  |       |                                    |
|     |      |    2: . 4  8 4 .  |       |                                    |
|     |      |    3: . 1  4 4 .  |       |                                    |
|     |      |    4: . .  . . 1  |       |                                    |
|     +------+-------------------+-------+                                    |
|     |      |       0 1  2 3 4  |       |                                    |
|     |[441b]|total: 1 9 16 9 1  |[441b] |                                    |
|     |      |    0: 1 .  . . .  |       |                                    |
|     |      |    1: . 4  4 1 .  |       |                                    |
|     |      |    2: . 4  8 4 .  |       |                                    |
|     |      |    3: . 1  4 4 .  |       |                                    |
|     |      |    4: . .  . . 1  |       |                                    |
|     +------+-------------------+-------+                                    |
|     |      |       0 1  2 3 4  |       |                                    |
|     |[550] |total: 1 6 10 6 1  |[550]  |                                    |
|     |      |    0: 1 .  . . .  |       |                                    |
|     |      |    1: . 5  5 . .  |       |                                    |
|     |      |    2: . 1  . 1 .  |       |                                    |
|     |      |    3: . .  5 5 .  |       |                                    |
|     |      |    4: . .  . . 1  |       |                                    |
|     +------+-------------------+-------+                                    |
|     |      |       0 1  2 3 4  |       |                                    |
|     |[551] |total: 1 7 12 7 1  |[551]  |                                    |
|     |      |    0: 1 .  . . .  |       |                                    |
|     |      |    1: . 5  5 1 .  |       |                                    |
|     |      |    2: . 1  2 1 .  |       |                                    |
|     |      |    3: . 1  5 5 .  |       |                                    |
|     |      |    4: . .  . . 1  |       |                                    |
|     +------+-------------------+-------+                                    |
|     |      |       0 1  2 3 4  |       |                                    |
|     |[562] |total: 1 9 16 9 1  |[562]  |                                    |
|     |      |    0: 1 .  . . .  |       |                                    |
|     |      |    1: . 5  6 2 .  |       |                                    |
|     |      |    2: . 2  4 2 .  |       |                                    |
|     |      |    3: . 2  6 5 .  |       |                                    |
|     |      |    4: . .  . . 1  |       |                                    |
|     +------+-------------------+-------+                                    |
|     |      |       0 1  2 3 4  |       |                                    |
|     |[683] |total: 1 9 16 9 1  |[683]  |                                    |
|     |      |    0: 1 .  . . .  |       |                                    |
|     |      |    1: . 6  8 3 .  |       |                                    |
|     |      |    2: . .  . . .  |       |                                    |
|     |      |    3: . 3  8 6 .  |       |                                    |
|     |      |    4: . .  . . 1  |       |                                    |
|     +------+-------------------+-------+                                    |
+-----------------------------------------------------------------------------+
|i5 : quarticType(a^4 + b^4 + c^4 + d^4 - 3*a*b*c*d)                          |
|                                                                             |
|o5 = [000]                                                                   |
+-----------------------------------------------------------------------------+
|i6 : quarticType(a*b*c*d)                                                    |
|                                                                             |
|o6 = [400]                                                                   |
+-----------------------------------------------------------------------------+

See also
========

  * bettiStrataExamples -- a hash table consisting
    of examples for each of the 19 Betti strata
  * quartic -- a quartic given by power sums of linear forms

Ways to use this method:
========================

  * quarticType(RingElement) -- the Betti
    stratum a specific quartic lies on
-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics.m2:876:0.

random(List,Ideal) -- a random ring element of a given degree
*************************************************************

  * Function: random (Macaulay2Doc),
  * Usage:
        random(d, I)
  * Inputs:
      * d, a list (Macaulay2Doc), or an integer (Macaulay2Doc),
        if the ring of $I$ is singly graded
      * I, an ideal (Macaulay2Doc), homogeneous
  * Optional inputs (Macaulay2Doc),:
      * Density (Macaulay2Doc), => ...,
        default value 1,
      * Height (Macaulay2Doc), => ..., default
        value 10,
      * MaximalRank (Macaulay2Doc), => ...,
        default value false,
      * UpperTriangular (Macaulay2Doc), =>
        ..., default value false,
  * Outputs:
      * a ring element (Macaulay2Doc), a random element in
        the ideal of the given degree

Description
===========

This function should probably be in the Core of Macaulay2.

+----------------------------------------------------------------------+
|i1 : S = ZZ/101[a..d]                                                 |
|                                                                      |
|o1 = S                                                                |
|                                                                      |
|o1 : PolynomialRing                                                   |
+----------------------------------------------------------------------+
|i2 : I = ideal(a^2, a*b^3, c*d)                                       |
|                                                                      |
|             2     3                                                  |
|o2 = ideal (a , a*b , c*d)                                            |
|                                                                      |
|o2 : Ideal of S                                                       |
+----------------------------------------------------------------------+
|i3 : f = random(3, I)                                                 |
|                                                                      |
|        3      2       2       2                           2         2|
|o3 = 24a  - 36a b - 30a c - 29a d + 19a*c*d + 19b*c*d - 10c d - 29c*d |
|                                                                      |
|o3 : S                                                                |
+----------------------------------------------------------------------+
|i4 : f % I == 0 -- so f is in the ideal I                             |
|                                                                      |
|o4 = true                                                             |
+----------------------------------------------------------------------+
|i5 : degree f == {3}                                                  |
|                                                                      |
|o5 = true                                                             |
+----------------------------------------------------------------------+

See also
========

  * random (Macaulay2Doc) -- get a random object
  * randomBlockMatrix -- create a block matrix with
    zero, identity and random blocks
  * randomHomomorphism -- create a random
    homomorphism between graded modules
  * randomPoints -- create a matrix whose columns are
    random points
-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics.m2:653:0.

randomBlockMatrix -- create a block matrix with zero, identity and random blocks
********************************************************************************

  * Usage:
        randomBlockMatrix(tarList, srcList, mats)
  * Inputs:
      * tarList, a list (Macaulay2Doc), a non-empty list of modules
        over a ring $R$
      * srcList, a list (Macaulay2Doc), a non-empty list of modules
        over the same ring $R$
      * mats, a list (Macaulay2Doc), of lists, of length = number
        of elements in the tarList, and each list has #srcList entries
  * Outputs:
      * a matrix (Macaulay2Doc),

Description
===========

This function creates a block matrix with the block sizes (and degrees)
determined by the modules in tarList and srcList. Each entry in the mats matrix
indicates what should be placed at that block of the matrix: mats#r#c
corresponds to a matrix with target tarList#r, and source srcList#c.

Each entry can be: random (giving a block which is random), the number 0 (a
zero block), the number 1 (an identity block), or an actual matrix.

+--------------------------------------------------------------------------+
|i1 : S = ZZ/101[a..d]                                                     |
|                                                                          |
|o1 = S                                                                    |
|                                                                          |
|o1 : PolynomialRing                                                       |
+--------------------------------------------------------------------------+
|i2 : randomBlockMatrix({S^3, S^1}, {S^3, S^1}, {{random, random}, {0, 1}})|
|                                                                          |
|o2 = | 24  -29 -10 -22 |                                                  |
|     | -36 19  -29 -29 |                                                  |
|     | -30 19  -8  -24 |                                                  |
|     | 0   0   0   1   |                                                  |
|                                                                          |
|             4      4                                                     |
|o2 : Matrix S  <-- S                                                      |
+--------------------------------------------------------------------------+
+-----------------------------------------------------------------------------+
|i3 : S = ZZ/101[a..d]                                                        |
|                                                                             |
|o3 = S                                                                       |
|                                                                             |
|o3 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i4 : randomBlockMatrix({S^3, S^2}, {S^3, S^2, S^{2:-1}}, {{random, random,   |
|                                                                             |
|o4 = | -38 21 -47 -13 -28 0                0                |                |
|     | -16 34 -39 -43 -47 0                0                |                |
|     | 39  19 -18 -15 38  0                0                |                |
|     | 0   0  0   1   0   2a+16b+22c+45d   19a-16b+7c+15d   |                |
|     | 0   0  0   0   1   -34a-48b-47c+47d -23a+39b+43c-17d |                |
|                                                                             |
|             5      7                                                        |
|o4 : Matrix S  <-- S                                                         |
|-----------------------------------------------------------------------------|
|0}, {0, 1, random}})                                                         |
+-----------------------------------------------------------------------------+

See also
========

  * random(Module,Module) (Macaulay2Doc), --
    get a random map of module

Ways to use randomBlockMatrix:
==============================

  * "randomBlockMatrix(List,List,List)"

For the programmer
==================

The object randomBlockMatrix, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics.m2:459:0.

randomHomomorphism -- create a random homomorphism between graded modules
*************************************************************************

  * Usage:
        randomHomomorphism(d, N, M)
  * Inputs:
      * d, a list (Macaulay2Doc), or an integer, if the common ring
        $R$ of $M$ and $N$ is singly graded
      * N, a module (Macaulay2Doc), the target module
      * M, a module (Macaulay2Doc), the source module
  * Outputs:
      * a matrix (Macaulay2Doc), a random $R$-module homomorphism
        from $M$ to $N$ of degree $d$

Description
===========

This function can be useful to find isomorphisms between modules (since if
there is an isomorphism, a random map between them will be such an
isomorphism), as well as writing the canonical module as an ideal (up to degree
shift) in the ring.

We start with a simpler application: duplicating the work of the simpler
function random(ZZ,Ideal) (Macaulay2Doc).  Here
are two ways to get a random element of degree 4 in the ideal $I$.

+-----------------------------------------------------------------------------+
|i1 : S = ZZ/101[a..d]                                                        |
|                                                                             |
|o1 = S                                                                       |
|                                                                             |
|o1 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i2 : I = monomialCurveIdeal(S, {2,5,9})                                      |
|                                                                             |
|             2     2    4        2     3    3    5    3 2                    |
|o2 = ideal (b c - a d, c  - a*b*d , a*c  - b d, b  - a c )                   |
|                                                                             |
|o2 : Ideal of S                                                              |
+-----------------------------------------------------------------------------+
|i3 : g = randomHomomorphism({4}, module I, S^1)                              |
|                                                                             |
|o3 = {3} | 24a-36b-30c-29d |                                                 |
|     {4} | 19              |                                                 |
|     {4} | 19              |                                                 |
|     {5} | 0               |                                                 |
|                                                                             |
|o3 : Matrix                                                                  |
+-----------------------------------------------------------------------------+
|i4 : isWellDefined g                                                         |
|                                                                             |
|o4 = true                                                                    |
+-----------------------------------------------------------------------------+
|i5 : super g                                                                 |
|                                                                             |
|o5 = | 24ab2c-36b3c-30b2c2+19ac3+19c4-24a3d+36a2bd-19b3d+30a2cd-29b2cd+29a2d2|
|     ------------------------------------------------------------------------|
|     -19abd2 |                                                               |
|                                                                             |
|             1      1                                                        |
|o5 : Matrix S  <-- S                                                         |
+-----------------------------------------------------------------------------+
|i6 : J = ideal image g                                                       |
|                                                                             |
|                2       3       2 2        3      4      3       2         3 |
|o6 = ideal(24a*b c - 36b c - 30b c  + 19a*c  + 19c  - 24a d + 36a b*d - 19b d|
|     ------------------------------------------------------------------------|
|          2         2         2 2          2                                 |
|     + 30a c*d - 29b c*d + 29a d  - 19a*b*d )                                |
|                                                                             |
|o6 : Ideal of S                                                              |
+-----------------------------------------------------------------------------+
|i7 : random(4, I)                                                            |
|                                                                             |
|            2       3      2 2        3      4      3       2         3      |
|o7 = - 10a*b c - 29b c - 8b c  - 24a*c  - 29c  + 10a d + 29a b*d + 24b d +   |
|     ------------------------------------------------------------------------|
|       2         2         2 2          2                                    |
|     8a c*d - 22b c*d + 22a d  + 29a*b*d                                     |
|                                                                             |
|o7 : S                                                                       |
+-----------------------------------------------------------------------------+

One important application of this function is to find an isomorphism of the
canonical module of $R = S/I$ with an ideal $J \subset R$, up to a degree
twist. See doubling, for a function which uses this method.

+-----------------------------------------------------------------------------+
|i8 : R = S/I                                                                 |
|                                                                             |
|o8 = R                                                                       |
|                                                                             |
|o8 : QuotientRing                                                            |
+-----------------------------------------------------------------------------+
|i9 : E = Ext^2(comodule I, S^{{-4}})                                         |
|                                                                             |
|o9 = cokernel {-1} | c a2 ad 0  b2 |                                         |
|              {-1} | d b2 0  c2 0  |                                         |
|              {0}  | 0 0  -c b  -a |                                         |
|                                                                             |
|                            3                                                |
|o9 : S-module, quotient of S                                                 |
+-----------------------------------------------------------------------------+
|i10 : ER = E ** R                                                            |
|                                                                             |
|o10 = cokernel {-1} | c a2 ad 0  b2 |                                        |
|               {-1} | d b2 0  c2 0  |                                        |
|               {0}  | 0 0  -c b  -a |                                        |
|                                                                             |
|                             3                                               |
|o10 : R-module, quotient of R                                                |
+-----------------------------------------------------------------------------+
|i11 : isHomogeneous ER                                                       |
|                                                                             |
|o11 = true                                                                   |
+-----------------------------------------------------------------------------+
|i12 : f = randomHomomorphism(3, R^1, ER)                                     |
|                                                                             |
|o12 = | -16ad+39bd-38cd 16ac-39bc+38c2 39c3-16b2d-38ad2 |                    |
|                                                                             |
|              1                                                              |
|o12 : Matrix R  <-- ER                                                       |
+-----------------------------------------------------------------------------+
|i13 : isWellDefined f                                                        |
|                                                                             |
|o13 = true                                                                   |
+-----------------------------------------------------------------------------+
|i14 : source f == ER                                                         |
|                                                                             |
|o14 = true                                                                   |
+-----------------------------------------------------------------------------+
|i15 : target f == R^1                                                        |
|                                                                             |
|o15 = true                                                                   |
+-----------------------------------------------------------------------------+
|i16 : degree f == {3}                                                        |
|                                                                             |
|o16 = true                                                                   |
+-----------------------------------------------------------------------------+
|i17 : ker f == 0                                                             |
|                                                                             |
|o17 = true                                                                   |
+-----------------------------------------------------------------------------+
|i18 : J = ideal image f                                                      |
|                                                                             |
|                                                         2     3      2      |
|o18 = ideal (- 16a*d + 39b*d - 38c*d, 16a*c - 39b*c + 38c , 39c  - 16b d -   |
|      -----------------------------------------------------------------------|
|           2                                                                 |
|      38a*d )                                                                |
|                                                                             |
|o18 : Ideal of R                                                             |
+-----------------------------------------------------------------------------+

See also
========

  * random (Macaulay2Doc) -- get a random object
  * random(ZZ,Ideal) (Macaulay2Doc) -- get a
    random homogeneous element from a graded ideal
  * randomBlockMatrix -- create a block matrix with
    zero, identity and random blocks
  * randomPoints -- create a matrix whose columns are
    random points

Ways to use randomHomomorphism:
===============================

  * "randomHomomorphism(List,Module,Module)"
  * "randomHomomorphism(ZZ,Module,Module)"

For the programmer
==================

The object randomHomomorphism, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics.m2:621:0.

randomPoints -- create a matrix whose columns are random points
***************************************************************

  * Usage:
        randomPoints(kk, m, n)
        randomPoints(S, n)
  * Inputs:
      * S, a ring (Macaulay2Doc), with $m$ variables
      * kk, a ring (Macaulay2Doc), a field
      * m, an integer (Macaulay2Doc), number of variables (rows)
      * n, an integer (Macaulay2Doc), the number of points (columns)
  * Optional inputs (Macaulay2Doc),:
      * Normalize => a Boolean value (Macaulay2Doc), default
        value false, whether to set the first $m+1$ to be the coordinate points
        and the point whose coordinates are all one
  * Outputs:
      * M, a matrix (Macaulay2Doc), of size $(m \times n)$ over
        the ring $S$ or $kk$ consisting of (random scalars)

Description
===========

There are two usages of this function. The first creates a matrix over a base
field. This is not much different from using random(kk^m, kk^n), unless the
Normalize option is given, in which case the first set of points are normalized
to be the coordinate points and the point each of whose coordinates are 1.

+------------------------------------------------+
|i1 : kk = ZZ/101;                               |
+------------------------------------------------+
|i2 : randomPoints(kk, 5, 10)                    |
|                                                |
|o2 = | 24  19  -29 21  -18 -47 45  19  39  36  ||
|     | -36 -10 -24 34  -13 38  -34 -16 43  35  ||
|     | -30 -29 -38 19  -43 2   -48 7   -17 11  ||
|     | -29 -8  -16 -47 -15 16  -47 15  -11 -38 ||
|     | 19  -22 39  -39 -28 22  47  -23 48  33  ||
|                                                |
|              5       10                        |
|o2 : Matrix kk  <-- kk                          |
+------------------------------------------------+
|i3 : randomPoints(kk, 5, 10, Normalize => true) |
|                                                |
|o3 = | 1 0 0 0 0 1 40  -3  2   -13 |            |
|     | 0 1 0 0 0 1 11  22  29  -10 |            |
|     | 0 0 1 0 0 1 46  -47 -47 30  |            |
|     | 0 0 0 1 0 1 -28 -23 15  -18 |            |
|     | 0 0 0 0 1 1 1   -7  -37 39  |            |
|                                                |
|              5       10                        |
|o3 : Matrix kk  <-- kk                          |
+------------------------------------------------+

The second version is perhaps used the most in this package. One can leave out
the number of variables/rows if the ring given is a polynomial ring.

+-----------------------------------------------------------------------------+
|i4 : S = kk[a..d];                                                           |
+-----------------------------------------------------------------------------+
|i5 : M1 = randomPoints(S, 10)                                                |
|                                                                             |
|o5 = | 27  -32 -48 33  17  36  13  -11 36  41  |                             |
|     | -22 -20 -15 -49 -20 9   -26 -8  -3  16  |                             |
|     | 32  24  39  -33 44  -39 22  43  -22 -28 |                             |
|     | -9  -30 0   -19 -39 4   -49 -8  -30 -6  |                             |
|                                                                             |
|             4      10                                                       |
|o5 : Matrix S  <-- S                                                         |
+-----------------------------------------------------------------------------+
|i6 : M2 = randomPoints(S, 6, Normalize=>true)                                |
|                                                                             |
|o6 = | 1 0 0 0 1 35  |                                                       |
|     | 0 1 0 0 1 -9  |                                                       |
|     | 0 0 1 0 1 -35 |                                                       |
|     | 0 0 0 1 1 6   |                                                       |
|                                                                             |
|             4      6                                                        |
|o6 : Matrix S  <-- S                                                         |
+-----------------------------------------------------------------------------+
|i7 : pointsIdeal M1                                                          |
|                                                                             |
|             2               2                          2         2        2 |
|o7 = ideal (a d + 4a*b*d + 2b d + 9a*c*d - 49b*c*d + 19c d - 33a*d  - 28b*d  |
|     ------------------------------------------------------------------------|
|            2      3     2      3                2                           |
|     - 27c*d  + 30d , b*c  + 47c  + 43a*b*d + 11b d + 17a*c*d - 31b*c*d -    |
|     ------------------------------------------------------------------------|
|        2         2        2       2      3     2     3                2     |
|     22c d - 48a*d  + 40b*d  - 7c*d  + 10d , a*c  + 9c  - 46a*b*d + 23b d +  |
|     ------------------------------------------------------------------------|
|                            2        2        2        2     3   2       3   |
|     45a*c*d + 37b*c*d - 19c d - 3a*d  - 39b*d  - 26c*d  - 9d , b c + 13c  + |
|     ------------------------------------------------------------------------|
|                  2                          2         2        2        2   |
|     43a*b*d - 24b d + 2a*c*d + 42b*c*d + 32c d + 32a*d  - 30b*d  + 38c*d  - |
|     ------------------------------------------------------------------------|
|        3             3                                    2         2       |
|     44d , a*b*c - 19c  - 27a*b*d - 13a*c*d - 49b*c*d - 21c d - 37a*d  +     |
|     ------------------------------------------------------------------------|
|          2        2     3   2       3                2                      |
|     36b*d  + 39c*d  + 5d , a c + 20c  - 49a*b*d - 35b d - 11a*c*d - 25b*c*d |
|     ------------------------------------------------------------------------|
|          2         2        2        2     3   3     3                2     |
|     - 48c d + 47a*d  + 46b*d  + 33c*d  - 9d , b  - 5c  + 48a*b*d - 28b d +  |
|     ------------------------------------------------------------------------|
|                            2         2        2        2     2      3       |
|     20a*c*d - 15b*c*d - 10c d - 16a*d  - 34b*d  + 35c*d , a*b  - 16c  +     |
|     ------------------------------------------------------------------------|
|                  2                           2         2        2      2    |
|     47a*b*d - 35b d - 30a*c*d + 25b*c*d + 45c d - 37a*d  - 20b*d  - c*d  +  |
|     ------------------------------------------------------------------------|
|        3   2       3               2                        2        2      |
|     21d , a b - 31c  + 22a*b*d + 7b d - a*c*d - 49b*c*d - 4c d - 8a*d  +    |
|     ------------------------------------------------------------------------|
|          2        2     3   3      3                2                       |
|     40b*d  - 46c*d  + 4d , a  + 22c  + 12a*b*d - 16b d - 3a*c*d - 39b*c*d - |
|     ------------------------------------------------------------------------|
|       2         2        2        2      3                                  |
|     3c d + 11a*d  - 29b*d  + 24c*d  - 11d )                                 |
|                                                                             |
|o7 : Ideal of S                                                              |
+-----------------------------------------------------------------------------+
|i8 : pointsIdeal M2                                                          |
|                                                                             |
|o8 = ideal (a*d - 26b*d + 25c*d, b*c + 18b*d - 19c*d, a*c + 46b*d - 47c*d,   |
|     ------------------------------------------------------------------------|
|     a*b - 44b*d + 43c*d)                                                    |
|                                                                             |
|o8 : Ideal of S                                                              |
+-----------------------------------------------------------------------------+

Another useful way to generate a matrix of points is to use
randomBlockMatrix.

For example, the following creates the ideal of 6 points, 3 on one line and 3
on a skew line.

+-----------------------------------------------------------------------------+
|i9 : M3 = randomBlockMatrix({S^2, S^2}, {S^3, S^3}, {{random, 0}, {0,        |
|                                                                             |
|o9 = | 40 -31 -2  0   0  0   |                                               |
|     | 3  25  -41 0   0  0   |                                               |
|     | 0  0   0   -49 4  -47 |                                               |
|     | 0  0   0   -13 30 27  |                                               |
|                                                                             |
|             4      6                                                        |
|o9 : Matrix S  <-- S                                                         |
|-----------------------------------------------------------------------------|
|random}})                                                                    |
+-----------------------------------------------------------------------------+
|i10 : pointsIdeal M3                                                         |
|                                                                             |
|                                  3      2         2      3   3     2        |
|o10 = ideal (b*d, a*d, b*c, a*c, c  + 49c d - 15c*d  + 28d , a  - 6a b +     |
|      -----------------------------------------------------------------------|
|           2    3                                                            |
|      35a*b  - b )                                                           |
|                                                                             |
|o10 : Ideal of S                                                             |
+-----------------------------------------------------------------------------+

See also
========

  * pointsIdeal -- create an ideal of points
  * random (Macaulay2Doc) -- get a random object
  * random(List,Ideal) (Macaulay2Doc) -- get a
    random homogeneous element from a graded ideal
  * randomBlockMatrix -- create a block matrix with
    zero, identity and random blocks
  * randomHomomorphism -- create a random
    homomorphism between graded modules

Ways to use randomPoints:
=========================

  * "randomPoints(Ring,ZZ)"
  * "randomPoints(Ring,ZZ,ZZ)"

For the programmer
==================

The object randomPoints, is a method function with options (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics.m2:559:0.

Singularities of lifting of type [300b] -- The lifting of [300b] defined by biliaison acquires singularities in dimension 3
***************************************************************************************************************************

We describe a way of lifting case [300b] by performing a biliaison
construction. Let $X$  be a degree 7 residual component of an intersection of
three quadrics containing a linear space of codimension 3.

+--------------------------------------------+
|i1 : loadPackage "RandomIdeals"             |
|                                            |
|o1 = RandomIdeals                           |
|                                            |
|o1 : Package                                |
+--------------------------------------------+
|i2 : kk = ZZ/101;                           |
+--------------------------------------------+
|i3 : R = kk[x_0..x_7];                      |
+--------------------------------------------+
|i4 : T = random(R^1,R^{-1,-1,-1});          |
|                                            |
|             1      3                       |
|o4 : Matrix R  <-- R                        |
+--------------------------------------------+
|i5 : I = ideal(T);                          |
|                                            |
|o5 : Ideal of R                             |
+--------------------------------------------+
|i6 : J = randomElementsFromIdeal({2,2,2},I);|
|                                            |
|o6 : Ideal of R                             |
+--------------------------------------------+
|i7 : X=J:I;                                 |
|                                            |
|o7 : Ideal of R                             |
+--------------------------------------------+

Consider $SS$ the intersection of the two components of the complete
intersection

+-----------------------------------------------------+
|i8 : SS=X+I;                                         |
|                                                     |
|o8 : Ideal of R                                      |
+-----------------------------------------------------+
|i9 : SingSS= radical ideal singularLocus saturate SS;|
|                                                     |
|o9 : Ideal of R                                      |
+-----------------------------------------------------+
|i10 : degree SingSS                                  |
|                                                     |
|o10 = 6                                              |
+-----------------------------------------------------+
|i11 : dim SingSS                                     |
|                                                     |
|o11 = 1                                              |
+-----------------------------------------------------+

Perform a biliaison uo by degree 2 of $SS$ in $X$ and get $BT$ an AG variety of
degree 17 and type [300b]

+-------------------------------------------+
|i12 : JJ = randomElementsFromIdeal({3},SS);|
|                                           |
|o12 : Ideal of R                           |
+-------------------------------------------+
|i13 : IDD=X+JJ;                            |
|                                           |
|o13 : Ideal of R                           |
+-------------------------------------------+
|i14 : PP=IDD:SS;                           |
|                                           |
|o14 : Ideal of R                           |
+-------------------------------------------+
|i15 : BB= randomElementsFromIdeal({5},PP); |
|                                           |
|o15 : Ideal of R                           |
+-------------------------------------------+
|i16 : BU=BB+X;                             |
|                                           |
|o16 : Ideal of R                           |
+-------------------------------------------+
|i17 : BT=BU:PP;                            |
|                                           |
|o17 : Ideal of R                           |
+-------------------------------------------+
|i18 : degree BT                            |
|                                           |
|o18 = 17                                   |
+-------------------------------------------+

We look for singularities of $BT$. Since the computation of singular locus is
too long, we just check the rank of the jacobian matrix in one of the
components of $SingSS$ and get that $BT$ is singular in that locus.

+-----------------------------------------------------------------------------+
|i19 : minors(4,(map(R/(decompose SingSS)_0,R)) (jacobian BT))                |
|                                                                             |
|o19 = ideal ()                                                               |
|                                                                             |
|                                                    R                        |
|o19 : Ideal of --------------------------------------------------------------|
|               (x  + 4x , x  + 24x , x  + 10x , x  + 5x , x  + 44x , x  - 37x|
|                 6     7   5      7   4      7   3     7   2      7   1      |
|-----------------------------------------------------------------------------|
|-------------                                                                |
| , x  + 38x )                                                                |
|7   0      7                                                                 |
+-----------------------------------------------------------------------------+

See also
========

  * [QQ] -- Quaternary Quartic Forms and Gorenstein rings
    (Kapustka, Kapustka, Ranestad, Schenck, Stillman, Yuan, 2021)
-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics/Section8Doc.m2:137:0.

smallerBettiTables -- Find all (potentially) smaller Betti tables that could degenerate to given table
******************************************************************************************************

  * Usage:
        smallerBettiTables B
  * Inputs:
      * B, a Betti tally (Macaulay2Doc), a possible table of
        some (singly) graded module
  * Outputs:
      * a list (Macaulay2Doc), a list of all Betti tables where
        cancellation could possibly occur

Description
===========

Given a complex over a graded ring, with Betti table $B$, whenever there is an
entry of degree zero, if that entry is nonzero, then one can use that as a
pivot, and cancel that row and column creating a smaller complex.  This
function returns the Betti tables of all possible such cancellations that may
be able to occur.  Some of these might not be valid for actual complexes, as
one might obtain a complex with no non-zero scalar entries. But, the list of
every smaller Betti table that could possibly be the minimal Betti diagram of
such a module is returned.

+-----------------------------------------------------------------------------+
|i1 : S = ZZ/101[a..d]                                                        |
|                                                                             |
|o1 = S                                                                       |
|                                                                             |
|o1 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i2 : I = ideal(a*c, a*b, a^2, c^3, b*c^2, b^2*c, b^3)                        |
|                                                                             |
|                       2   3     2   2    3                                  |
|o2 = ideal (a*c, a*b, a , c , b*c , b c, b )                                 |
|                                                                             |
|o2 : Ideal of S                                                              |
+-----------------------------------------------------------------------------+
|i3 : B = betti res I                                                         |
|                                                                             |
|            0 1  2 3                                                         |
|o3 = total: 1 7 10 4                                                         |
|         0: 1 .  . .                                                         |
|         1: . 3  3 1                                                         |
|         2: . 4  7 3                                                         |
|                                                                             |
|o3 : BettiTally                                                              |
+-----------------------------------------------------------------------------+
|i4 : smallerBettiTables B                                                    |
|                                                                             |
|             0 1  2 3         0 1 2 3         0 1 2 3         0 1 2 3        |
|o4 = {total: 1 7 10 4, total: 1 7 9 3, total: 1 6 9 4, total: 1 6 8 3, total:|
|          0: 1 .  . .      0: 1 . . .      0: 1 . . .      0: 1 . . .      0:|
|          1: . 3  3 1      1: . 3 3 .      1: . 3 2 1      1: . 3 2 .      1:|
|          2: . 4  7 3      2: . 4 6 3      2: . 3 7 3      2: . 3 6 3      2:|
|     ------------------------------------------------------------------------|
|     0 1 2 3         0 1 2 3         0 1 2 3         0 1 2 3                 |
|     1 5 8 4, total: 1 5 7 3, total: 1 4 7 4, total: 1 4 6 3}                |
|     1 . . .      0: 1 . . .      0: 1 . . .      0: 1 . . .                 |
|     . 3 1 1      1: . 3 1 .      1: . 3 . 1      1: . 3 . .                 |
|     . 2 7 3      2: . 2 6 3      2: . 1 7 3      2: . 1 6 3                 |
|                                                                             |
|o4 : List                                                                    |
+-----------------------------------------------------------------------------+
|i5 : netList pack(4, oo)                                                     |
|                                                                             |
|     +---------------+--------------+--------------+--------------+          |
|     |       0 1  2 3|       0 1 2 3|       0 1 2 3|       0 1 2 3|          |
|o5 = |total: 1 7 10 4|total: 1 7 9 3|total: 1 6 9 4|total: 1 6 8 3|          |
|     |    0: 1 .  . .|    0: 1 . . .|    0: 1 . . .|    0: 1 . . .|          |
|     |    1: . 3  3 1|    1: . 3 3 .|    1: . 3 2 1|    1: . 3 2 .|          |
|     |    2: . 4  7 3|    2: . 4 6 3|    2: . 3 7 3|    2: . 3 6 3|          |
|     +---------------+--------------+--------------+--------------+          |
|     |       0 1 2 3 |       0 1 2 3|       0 1 2 3|       0 1 2 3|          |
|     |total: 1 5 8 4 |total: 1 5 7 3|total: 1 4 7 4|total: 1 4 6 3|          |
|     |    0: 1 . . . |    0: 1 . . .|    0: 1 . . .|    0: 1 . . .|          |
|     |    1: . 3 1 1 |    1: . 3 1 .|    1: . 3 . 1|    1: . 3 . .|          |
|     |    2: . 2 7 3 |    2: . 2 6 3|    2: . 1 7 3|    2: . 1 6 3|          |
|     +---------------+--------------+--------------+--------------+          |
+-----------------------------------------------------------------------------+

Note that from the Betti table there are 2 maps of degree 0.  The first is a $4
\times 3$ matrix, and the second is a $7 \times 1$ matrix.  There are 4
possible ranks for the first matrix, and 2 for the second, giving 8 Betti
tables in the result.  No further knowledge is used to remove possible tables
from the output list.

All actual Betti diagrams of ideals with $I$ as its initial ideal will be among
this list. Clearly, some of these cannot occur.  The ones indexed 2, 4 and 6
cannot occur. One can use the package GroebnerStrata,
to help determine which can possibly occur.

See also
========

  * nondegenerateBorels -- construct all
    nondegenerate strongly stable ideals of given length
  * GroebnerStrata -- a package for creating
    families of ideals with the same initial ideal

Ways to use smallerBettiTables:
===============================

  * "smallerBettiTables(BettiTally)"

For the programmer
==================

The object smallerBettiTables, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics.m2:748:0.

Type [000], CY of degree 20 -- lifting to a 3-fold with two singular points
***************************************************************************

We construct a singular Calabi-Yau of dimension 3 with 2 nodes, of codimension
4, of degree 20.  This example cannot be smoothed.  However, there is the
example of the determinantal ($3 \times 3$ minors of a $4 \times 4$ matrix of
linear forms, which is a smooth Calabi-Yau 3-fold of degree 20.

+------------------------------------------------------------------+
|i1 : kk = ZZ/31                                                   |
|                                                                  |
|o1 = kk                                                           |
|                                                                  |
|o1 : QuotientRing                                                 |
+------------------------------------------------------------------+
|i2 : U = kk[y0,y1,y2,y3,y4,y5,y6,y7];                             |
+------------------------------------------------------------------+
|i3 : setRandomSeed 8327432                                        |
| -- setting random seed to 8327432                                |
|                                                                  |
|o3 = 8327432                                                      |
+------------------------------------------------------------------+
|i4 : U1 = vars U                                                  |
|                                                                  |
|o4 = | y0 y1 y2 y3 y4 y5 y6 y7 |                                  |
|                                                                  |
|             1      8                                             |
|o4 : Matrix U  <-- U                                              |
+------------------------------------------------------------------+
|i5 : P6 = matrix{{y1,y2,y3,y4,y5,y6,y7}} -- The hyperplane y0 == 0|
|                                                                  |
|o5 = | y1 y2 y3 y4 y5 y6 y7 |                                     |
|                                                                  |
|             1      7                                             |
|o5 : Matrix U  <-- U                                              |
+------------------------------------------------------------------+

The original example code

+-----------------------------------------------------------------------------+
|i6 : F1 = P6 * random(kk^7,kk^5);                                            |
|                                                                             |
|             1      5                                                        |
|o6 : Matrix U  <-- U                                                         |
+-----------------------------------------------------------------------------+
|i7 : F2 = P6 * random(kk^7,kk^5);                                            |
|                                                                             |
|             1      5                                                        |
|o7 : Matrix U  <-- U                                                         |
+-----------------------------------------------------------------------------+
|i8 : F3 = P6 * random(kk^7,kk^5);                                            |
|                                                                             |
|             1      5                                                        |
|o8 : Matrix U  <-- U                                                         |
+-----------------------------------------------------------------------------+
|i9 : fg = transpose F1 | transpose F2 | transpose F3 ;                       |
|                                                                             |
|             5      3                                                        |
|o9 : Matrix U  <-- U                                                         |
+-----------------------------------------------------------------------------+
|i10 : ff = matrix{{y0,0,0,0,0},{0,0,0,0,0},{0,0,0,0,0}};                     |
|                                                                             |
|              3      5                                                       |
|o10 : Matrix U  <-- U                                                        |
+-----------------------------------------------------------------------------+
|i11 : fg = transpose fg + ff;    --3x5 matrix of rank 1 at (1:0:..:0), of    |
|                                                                             |
|              3      5                                                       |
|o11 : Matrix U  <-- U                                                        |
|-----------------------------------------------------------------------------|
|rank 2 on fourfold Y                                                         |
+-----------------------------------------------------------------------------+
|i12 : Y = fg3 = minors(3,fg);                                                |
|                                                                             |
|o12 : Ideal of U                                                             |
+-----------------------------------------------------------------------------+
|i13 : fg2 = minors(2,fg);                                                    |
|                                                                             |
|o13 : Ideal of U                                                             |
+-----------------------------------------------------------------------------+
|i14 : codim fg3                                                              |
|                                                                             |
|o14 = 3                                                                      |
+-----------------------------------------------------------------------------+
|i15 : codim fg2, degree fg2                                                  |
|                                                                             |
|o15 = (7, 1)                                                                 |
|                                                                             |
|o15 : Sequence                                                               |
+-----------------------------------------------------------------------------+
|i16 : saturate fg2                                                           |
|                                                                             |
|o16 = ideal (y7, y6, y5, y4, y3, y2, y1)                                     |
|                                                                             |
|o16 : Ideal of U                                                             |
+-----------------------------------------------------------------------------+
|i17 : sf1 = fg^{0,1}                                                         |
|                                                                             |
|o17 = | y0+12y1+3y2+7y3+4y4+13y5+5y6-y7 -13y1+3y2-9y3-3y4-y5+2y6-2y7         |
|      | 9y1-7y2-13y3-15y4-2y5+8y6+15y7  -9y1-8y2+14y3-3y4-5y5+4y6+15y7       |
|      -----------------------------------------------------------------------|
|      7y1+5y3-y4-6y5+5y6-6y7       -7y1-3y2+3y3-11y4-3y5-y6-5y7              |
|      7y1+9y2-5y3-2y4+6y5+15y6+6y7 14y1+12y2+5y3-6y4+15y5+13y6+4y7           |
|      -----------------------------------------------------------------------|
|      9y1+4y2-5y3+3y4+4y5-14y6-13y7    |                                     |
|      -4y1+8y2+12y3+14y4-13y5+3y6-10y7 |                                     |
|                                                                             |
|              2      5                                                       |
|o17 : Matrix U  <-- U                                                        |
+-----------------------------------------------------------------------------+
|i18 : sf2 = fg^{0,2}                                                         |
|                                                                             |
|o18 = | y0+12y1+3y2+7y3+4y4+13y5+5y6-y7 -13y1+3y2-9y3-3y4-y5+2y6-2y7         |
|      | -6y1-7y2+14y3-7y4-9y5+2y6+9y7   9y1+9y2-2y3+12y4+7y5-2y6             |
|      -----------------------------------------------------------------------|
|      7y1+5y3-y4-6y5+5y6-6y7        -7y1-3y2+3y3-11y4-3y5-y6-5y7             |
|      -7y1+8y2+12y3+6y4-15y5+5y6-y7 8y1-10y2+5y3-11y4+9y5-11y6+3y7           |
|      -----------------------------------------------------------------------|
|      9y1+4y2-5y3+3y4+4y5-14y6-13y7  |                                       |
|      -5y1-15y2-8y3-4y4+5y5-12y6+3y7 |                                       |
|                                                                             |
|              2      5                                                       |
|o18 : Matrix U  <-- U                                                        |
+-----------------------------------------------------------------------------+
|i19 : Z1 = sf12 = minors(2,sf1);--threefold rational scroll of degree 5 in Y |
|                                                                             |
|o19 : Ideal of U                                                             |
+-----------------------------------------------------------------------------+
|i20 : Z2 = sf22 = minors(2,sf2);--threefold rational scroll of degree 5 in Y |
|                                                                             |
|o20 : Ideal of U                                                             |
+-----------------------------------------------------------------------------+
|i21 : sf = trim intersect(Z1, Z2);-- threefold rational scroll over reducible|
|                                                                             |
|o21 : Ideal of U                                                             |
|-----------------------------------------------------------------------------|
|conic of degree 10 in Y                                                      |
+-----------------------------------------------------------------------------+
|i22 : (dim Z1, degree Z1)                                                    |
|                                                                             |
|o22 = (4, 5)                                                                 |
|                                                                             |
|o22 : Sequence                                                               |
+-----------------------------------------------------------------------------+
|i23 : betti sf  --in 11 cubics, so sf is in a cubic hypersurface section of Y|
|                                                                             |
|             0  1                                                            |
|o23 = total: 1 54                                                            |
|          0: 1  .                                                            |
|          1: .  .                                                            |
|          2: . 11                                                            |
|          3: . 43                                                            |
|                                                                             |
|o23 : BettiTally                                                             |
+-----------------------------------------------------------------------------+
|i24 : k3 = ideal select(sf_*, f -> degree f == {3}); -- the cubics in the    |
|                                                                             |
|o24 : Ideal of U                                                             |
|-----------------------------------------------------------------------------|
|ideal                                                                        |
+-----------------------------------------------------------------------------+
|i25 : k3=submatrix(gens sf,{0,1,2,3,4,5,6,7,8,9,10});  --the cubics in the   |
|                                                                             |
|              1      11                                                      |
|o25 : Matrix U  <-- U                                                        |
|-----------------------------------------------------------------------------|
|ideal of sf                                                                  |
+-----------------------------------------------------------------------------+
|i26 : k3=ideal flatten k3;                                                   |
|                                                                             |
|o26 : Ideal of U                                                             |
+-----------------------------------------------------------------------------+
|i27 : X = cy = (k3:Z1):Z2; --the CY threefold, residual to sf in a cubic     |
|                                                                             |
|o27 : Ideal of U                                                             |
|-----------------------------------------------------------------------------|
|hypersurface section                                                         |
+-----------------------------------------------------------------------------+
|i28 : betti X                                                                |
|                                                                             |
|             0  1                                                            |
|o28 = total: 1 16                                                            |
|          0: 1  .                                                            |
|          1: .  .                                                            |
|          2: . 16                                                            |
|                                                                             |
|o28 : BettiTally                                                             |
+-----------------------------------------------------------------------------+
|i29 : betti res X                                                            |
|                                                                             |
|             0  1  2  3 4                                                    |
|o29 = total: 1 16 30 16 1                                                    |
|          0: 1  .  .  . .                                                    |
|          1: .  .  .  . .                                                    |
|          2: . 16 30 16 .                                                    |
|          3: .  .  .  . .                                                    |
|          4: .  .  .  . 1                                                    |
|                                                                             |
|o29 : BettiTally                                                             |
+-----------------------------------------------------------------------------+
|i30 : (dim X, degree X)                                                      |
|                                                                             |
|o30 = (4, 20)                                                                |
|                                                                             |
|o30 : Sequence                                                               |
+-----------------------------------------------------------------------------+

Now we analyze the singularities of this Calabi-Yau. First, note that $X$ is
singular at the point$(1, 0, \ldots, 0)$.

+------------------------------------------------------------+
|i31 : J = jacobian X;                                       |
|                                                            |
|              8      16                                     |
|o31 : Matrix U  <-- U                                       |
+------------------------------------------------------------+
|i32 : minors(4, sub(J, matrix{{1_kk,0,0,0,0,0,0,0}})) == 0  |
|                                                            |
|o32 = true                                                  |
+------------------------------------------------------------+
|i33 : sub(X, matrix{{1_kk,0,0,0,0,0,0,0}})                  |
|                                                            |
|o33 = ideal (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)|
|                                                            |
|o33 : Ideal of kk                                           |
+------------------------------------------------------------+

Now we find other singular points.  We would like to just compute the singular
locus as the $4 \time 4$ minors of the $8 \times 16$ Jacobian matrix, which is
$127,400$ determinants, but this is pretty large.

We find that there is exactly one more singular point, and that it is of
multiplicity 2.

+-----------------------------------------------------------------------+
|needsPackage "FastMinors" -- "FastLinAlg" in versions of M2 before 1.19|
|setRandomSeed 500                                                      |
|elapsedTime chooseGoodMinors(200, 4, J);                               |
|J1 = cy + oo;                                                          |
|elapsedTime gbJ1 = groebnerBasis(J1, Strategy => "F4");                |
|inJ1 = monomialIdeal leadTerm gbJ1;                                    |
|codim inJ1 == 7 -- so singular locus is finite                         |
|degree inJ1 == 2                                                       |
|(L1, d) = divideByVariable(gbJ1, U_7);                                 |
|L1 = ideal L1;                                                         |
|pt2 = trim L1                                                          |
+-----------------------------------------------------------------------+

This implies that the singular locus is a finite set of points, and is at most
2 points, and we know one of the points, and the other pointis off of the
hyperplane $x_7 = 0$.

However, we must check that this point is singular on $X$, as our ideal is only
a subset of the ideal of the singular locus.

+-----------------------+
|isSubset(cy, pt2)      |
|minors(4, J % pt2) == 0|
+-----------------------+

We now know that the singular locus consists of these 2 points, as the degree
of $J_1$ is 2, so there can be no other components of dimension 0.

See also
========

  * [QQ] -- Quaternary Quartic Forms and Gorenstein rings
    (Kapustka, Kapustka, Ranestad, Schenck, Stillman, Yuan, 2021)
-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics/Section8Doc.m2:96:0.

Type [210], CY of degree 18 via linkage -- lifting to a 3-fold with components of degrees 11, 6, 1
**************************************************************************************************

We construct via linkage an arithmetically Gorenstein 3-fold $X = X_{11} \cup
X_1 \cup X_6 \subset \bf{P}^7$, of degree 17, having Betti table of type [210]:
For an artinian reduction $A_F$, the quadratic part of the ideal $F^\perp$ is
the ideal of a plane and a line, and $F^\perp$ contains pencils of ideals of
five points on a conic in the plane and three points on the line, and a
3-dimensional family of ideals of six points in the plane and two points on the
line.  In particular, $F^\perp$ contains the ideal of the intersection point of
the line and the plane in addition to five points in the plane and two points
on the line.

We construct $X_{11}$ in a quadric in a P6,  $X_{6}$ in a quadric in a P5 and
$X_{1}$ in the P4 of intersection of P5 and P6. In the construction the
intersection $X\cup X'$ of a component $X$ with the other is an anticanonical
divisor on $X$.

$\phantom{WWWW} \begin{matrix} &0&1&2&3&4\\\text{total:}&1&11&20&11&1\\
\text{0:}&1&\text{.}&\text{.}&\text{.}&\text{.}\\
\text{1:}&\text{.}&2&1&\text{.}&\text{.}\\ \text{2:}&\text{.}&9&18&9&\text{.}\\
\text{3:}&\text{.}&\text{.}&1&2&\text{.}\\
\text{4:}&\text{.}&\text{.}&\text{.}&\text{.}&1\\ \end{matrix} $

+-------------------------------------------------------+
|i1 : kk = QQ;                                          |
+-------------------------------------------------------+
|i2 : U=kk[y0,y1,y2,y3,y4,y5,y6,y7];                    |
+-------------------------------------------------------+
|i3 : X1 = ideal(y0,y5,y6,y7); -- the component X1, a P3|
|                                                       |
|o3 : Ideal of U                                        |
+-------------------------------------------------------+
|i4 : P3a = ideal(y0,y1,y2,y3); --another  P3           |
|                                                       |
|o4 : Ideal of U                                        |
+-------------------------------------------------------+
|i5 : P4 = ideal(y0,y6,y7); --a P4                      |
|                                                       |
|o5 : Ideal of U                                        |
+-------------------------------------------------------+
|i6 : P5 = ideal(y6,y7); --a P5                         |
|                                                       |
|o6 : Ideal of U                                        |
+-------------------------------------------------------+
|i7 : P6 = ideal(y0); -- a P6                           |
|                                                       |
|o7 : Ideal of U                                        |
+-------------------------------------------------------+

Construct a $(2,2)$ complete intersection in $X_1$:

+----------------------------------------------------+
|i8 : CI22 = X1 + ideal(random(2,P3a),random(2,P3a));|
|                                                    |
|o8 : Ideal of U                                     |
+----------------------------------------------------+

Compute the ideal of the union of $CI_{22}$ and the other $\PP^3$. Then compute
a complete intersection of type $(1,2,2,2)$ which contains $\PP^3_a$ and
$CI_{22}$.

+---------------------------------------------------------------+
|i9 : CIP3 = intersect(CI22,P3a);  --the union of CI22 and P3a  |
|                                                               |
|o9 : Ideal of U                                                |
+---------------------------------------------------------------+
|i10 : CI1222 = trim(                                           |
|          ideal(y0) +                                          |
|          ideal(random(2,CIP3),random(2,CIP3),random(2,CIP3)));|
|                                                               |
|o10 : Ideal of U                                               |
+---------------------------------------------------------------+

We take the residual in this complete intersection of the $\PP^3_a$.

+----------------------------------------------------------------+
|i11 : X7 = CI1222:P3a;   -- the 3-fold X7 linked (1,2,2,2) to PL|
|                                                                |
|o11 : Ideal of U                                                |
+----------------------------------------------------------------+
|i12 : (dim X7, degree X7)                                       |
|                                                                |
|o12 = (4, 7)                                                    |
|                                                                |
|o12 : Sequence                                                  |
+----------------------------------------------------------------+
+------------------------------------------------------------------------+
|i13 : QX7 = ideal random(2,X7);--a quadric hypersurface that contains X7|
|                                                                        |
|o13 : Ideal of U                                                        |
+------------------------------------------------------------------------+
|i14 : Z2a = X1 + QX7;-- quadric that contain X7 intersected with X1     |
|                                                                        |
|o14 : Ideal of U                                                        |
+------------------------------------------------------------------------+
|i15 : X7Z2 = intersect(Z2a,X7);-- the union of  Z2 and X7               |
|                                                                        |
|o15 : Ideal of U                                                        |
+------------------------------------------------------------------------+
+-----------------------------------------------------------------------------+
|i16 : Z6 = P4 + QX7 + ideal(random(3,X7Z2));--a complete intersection 2,3 in |
|                                                                             |
|o16 : Ideal of U                                                             |
|-----------------------------------------------------------------------------|
|P4                                                                           |
+-----------------------------------------------------------------------------+
|i17 : X7Z6 = intersect(X7,Z6);  --the union of X7 and the complete           |
|                                                                             |
|o17 : Ideal of U                                                             |
|-----------------------------------------------------------------------------|
|intersection 2,3 in P4                                                       |
+-----------------------------------------------------------------------------+
|i18 : CI1233 = P6 + QX7 + ideal(random(3,X7Z6),random(3,X7Z6));--complete    |
|                                                                             |
|o18 : Ideal of U                                                             |
|-----------------------------------------------------------------------------|
|intersection 1233 containing  Z2a and a hyperplane section of X7             |
+-----------------------------------------------------------------------------+
|i19 : X11 = CI1233:X7;  --a 3-fold of degree 11.                             |
|                                                                             |
|o19 : Ideal of U                                                             |
+-----------------------------------------------------------------------------+
|i20 : Z4 = Z6:Z2a;--a Del Pezzo surface in P4                                |
|                                                                             |
|o20 : Ideal of U                                                             |
+-----------------------------------------------------------------------------+
|i21 : Y2 = P5+ideal(random(2,Z4));--a quadric 4-fold in P5 that contain Z4   |
|                                                                             |
|o21 : Ideal of U                                                             |
+-----------------------------------------------------------------------------+
|i22 : Z2b = X1+Y2;-- another quadric surface in X1                           |
|                                                                             |
|o22 : Ideal of U                                                             |
+-----------------------------------------------------------------------------+
|i23 : Z6b = intersect(Z4,Z2b);-- a complete intersection 2,3 different from  |
|                                                                             |
|o23 : Ideal of U                                                             |
|-----------------------------------------------------------------------------|
|Z6a, the union of Z4 and Z2b                                                 |
+-----------------------------------------------------------------------------+
|i24 : Y3 = P5 + ideal(random(3,Z6b));--a cubic 4-fold in P5 that contain Z6b |
|                                                                             |
|o24 : Ideal of U                                                             |
+-----------------------------------------------------------------------------+
|i25 : X6 = Y2 + Y3;                                                          |
|                                                                             |
|o25 : Ideal of U                                                             |
+-----------------------------------------------------------------------------+
|i26 : X18 = intersect(X11,X6,X1);--a AG 3-fold of degree 18, with betti table|
|                                                                             |
|o26 : Ideal of U                                                             |
|-----------------------------------------------------------------------------|
|of type 210.                                                                 |
+-----------------------------------------------------------------------------+
+---------------------------+
|i27 : (dim X18, degree X18)|
|                           |
|o27 = (4, 18)              |
|                           |
|o27 : Sequence             |
+---------------------------+
|i28 : betti res X18        |
|                           |
|             0  1  2  3 4  |
|o28 = total: 1 11 20 11 1  |
|          0: 1  .  .  . .  |
|          1: .  2  1  . .  |
|          2: .  9 18  9 .  |
|          3: .  .  1  2 .  |
|          4: .  .  .  . 1  |
|                           |
|o28 : BettiTally           |
+---------------------------+

See also
========

  * [QQ] -- Quaternary Quartic Forms and Gorenstein rings
    (Kapustka, Kapustka, Ranestad, Schenck, Stillman, Yuan, 2021)
-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics/Section9Doc.m2:79:0.

Type [310], CY of degree 17 via linkage -- lifting to a 3-fold with components of degrees 11, 6
***********************************************************************************************

We construct via linkage an arithmetically Gorenstein 3-fold $X = X_{6} \cup
X_{11} \subset \bf{P}^7$, of degree 17, having Betti table of type [310]. For
an artinian reduction $A_F$, the quadratic part of the ideal $F^\perp$ is the
ideal of a conic and two independent points $p_1,p_2$, and $F^\perp$ contains a
pencil of ideals of five points on the conic and the two fixed points
$p_1,p_2$. We construct $X_{11}$ in a quadric in a P6, and $X_{6}$ in a quadric
in a P5. In the construction the intersection $X\cup X'$ of a component $X$
with the other is an anticanonical divisor on $X$.

The Betti table is

$\phantom{WWWW} \begin{matrix} &0&1&2&3&4\\ \text{total:}&1&8&14&8&1\\
\text{0:}&1&\text{.}&\text{.}&\text{.}&\text{.}\\
\text{1:}&\text{.}&3&1&\text{.}&\text{.}\\ \text{2:}&\text{.}&5&12&5&\text{.}\\
\text{3:}&\text{.}&\text{.}&1&3&\text{.}\\
\text{4:}&\text{.}&\text{.}&\text{.}&\text{.}&1\\ \end{matrix} $

+---------------------------------------------+
|i1 : kk = QQ;                                |
+---------------------------------------------+
|i2 : U = kk[y0,y1,y2,y3,y4,y5,y6,y7];        |
+---------------------------------------------+
|i3 : P4a = ideal(y0,y1,y2); --a P4           |
|                                             |
|o3 : Ideal of U                              |
+---------------------------------------------+
|i4 : P4b = ideal(y4,y5,y6); --another P4     |
|                                             |
|o4 : Ideal of U                              |
+---------------------------------------------+
|i5 : P5 = ideal(y4,y5);-- a P5 containing P4b|
|                                             |
|o5 : Ideal of U                              |
+---------------------------------------------+
|i6 : P6 = ideal(y6);--a P6 containing P4b    |
|                                             |
|o6 : Ideal of U                              |
+---------------------------------------------+
+-----------------------------------------------------------------------------+
|i7 : CI222 = ideal(random(2,P4a),random(2,P4a),random(2,P4a));--a complete   |
|                                                                             |
|o7 : Ideal of U                                                              |
|-----------------------------------------------------------------------------|
|intersection (2,2,2) containing P4a                                          |
+-----------------------------------------------------------------------------+
|i8 : Y7 = CI222:P4a; -- a 4-fold of degree 7 linked (2,2,2) to a P4a         |
|                                                                             |
|o8 : Ideal of U                                                              |
+-----------------------------------------------------------------------------+
|i9 : CI23 = ideal(random(2,Y7),random(3,Y7));--a complete intersection (2,3) |
|                                                                             |
|o9 : Ideal of U                                                              |
|-----------------------------------------------------------------------------|
|that contains Y7                                                             |
+-----------------------------------------------------------------------------+
|i10 : Z6 = P4b + CI23; --a complete intersection (2,3) in P4b that contain   |
|                                                                             |
|o10 : Ideal of U                                                             |
|-----------------------------------------------------------------------------|
|the intersection of P4b and Y7                                               |
+-----------------------------------------------------------------------------+
|i11 : X6 = P5 + ideal(random(2,Z6),random(3,Z6));-- a complete intersection  |
|                                                                             |
|o11 : Ideal of U                                                             |
|-----------------------------------------------------------------------------|
|(2,3) in P5 with hyperplane section Z6                                       |
+-----------------------------------------------------------------------------+
|i12 : Y67 = intersect(Y7,Z6);--the union of the 4-fold Y7 and the Z6         |
|                                                                             |
|o12 : Ideal of U                                                             |
+-----------------------------------------------------------------------------+
|i13 : Y18 = CI23 + random(3,Y67);--a complete intersection (2,3,3) that      |
|                                                                             |
|o13 : Ideal of U                                                             |
|-----------------------------------------------------------------------------|
|contains Y7 and Z6                                                           |
+-----------------------------------------------------------------------------+
|i14 : Y11 = Y18:Y7;-- a 4-fold of degree 11 that contains Z6                 |
|                                                                             |
|o14 : Ideal of U                                                             |
+-----------------------------------------------------------------------------+
|i15 : X11 = P6 + Y11; --a 3-fold of degree 11 that contains Z6               |
|                                                                             |
|o15 : Ideal of U                                                             |
+-----------------------------------------------------------------------------+
|i16 : X17 = intersect(X11,X6); -- a AG 3-fold in P7 of type (310)            |
|                                                                             |
|o16 : Ideal of U                                                             |
+-----------------------------------------------------------------------------+
+---------------------------+
|i17 : (dim X17, degree X17)|
|                           |
|o17 = (4, 17)              |
|                           |
|o17 : Sequence             |
+---------------------------+
|i18 : betti res X17        |
|                           |
|             0 1  2 3 4    |
|o18 = total: 1 8 14 8 1    |
|          0: 1 .  . . .    |
|          1: . 3  1 . .    |
|          2: . 5 12 5 .    |
|          3: . .  1 3 .    |
|          4: . .  . . 1    |
|                           |
|o18 : BettiTally           |
+---------------------------+

See also
========

  * [QQ] -- Quaternary Quartic Forms and Gorenstein rings
    (Kapustka, Kapustka, Ranestad, Schenck, Stillman, Yuan, 2021)
-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics/Section9Doc.m2:133:0.

Type [331], CY of degree 17 via linkage -- lifting to a 3-fold with components of degrees 13 and 4
**************************************************************************************************

We construct via linkage a 3-fold $X = X_{13} \cup X_4 \subset \bf{P}^7$, which
is an arithmetically Gorenstein Calabi-Yau 3-fold of degree 17 in $\PP^7$. For
an artinian reduction $A_F$, the quadratic part of the ideal $F^\perp$ is the
ideal of a plane and a point $p$, and $F^\perp$ contains a family of ideals of
six points in the plane and the fixed point $p$. We construct $X_{13}$ in a web
of cubics in a P6, and $X_{4}$ as a quartic in a P4. In the construction the
intersection $X\cup X'$ of a component $X$ with the other is an anticanonical
divisor on $X$.

The Betti table is

$\phantom{WWWW} \begin{matrix}
&0&1&2&3&4\\\text{total:}&1&11&20&11&1\\\text{0:}&1&\text{.}&\text{.}&\text
{.}&\text{.}\\ \text{1:}&\text{.}&3&3&1&\text{.}\\\text{2:}&\text{.}&7&14&7&\
text{.}\\\text{3:}&\text{.}&1&3&
3&\text{.}\\\text{4:}&\text{.}&\text{.}&\text{.}&\text{.}&1\\ \end{matrix} $

This variety $X \subset \PP^7$ has two components, $X_{13}$ in a $\PP^6$ linked
to a $\PP^3$ in the cubic pfaffians of a 7x7 skew matrix, and $X_4$, a quartic
3-fold in a $\PP^4$.  $X_{13}$ and $X_4$ intersect in a hyperplane section of
$X_4$.

+-------------------------------------+
|i1 : kk = QQ;                        |
+-------------------------------------+
|i2 : U = kk[y0,y1,y2,y3,y4,y5,y6,y7];|
+-------------------------------------+
|i3 : u7 = ideal vars U;              |
|                                     |
|o3 : Ideal of U                      |
+-------------------------------------+
|i4 : P6 = ideal(y0); -- a P6         |
|                                     |
|o4 : Ideal of U                      |
+-------------------------------------+
|i5 : P4 = ideal(y1,y2,y3); --a P4    |
|                                     |
|o5 : Ideal of U                      |
+-------------------------------------+

We now choose a skew symmetric  $7 \times 7$ matrix of linear forms in $U$
whose cubic pfaffians contain a $\PP^4$.

+--------------------------------------------------------------------+
|i6 : q1=(gens u7)*random(kk^8,kk^7);                                |
|                                                                    |
|             1      7                                               |
|o6 : Matrix U  <-- U                                                |
+--------------------------------------------------------------------+
|i7 : q2=(gens u7)*random(kk^8,kk^7);                                |
|                                                                    |
|             1      7                                               |
|o7 : Matrix U  <-- U                                                |
+--------------------------------------------------------------------+
|i8 : q3=(gens P4)*random(kk^3,kk^7);                                |
|                                                                    |
|             1      7                                               |
|o8 : Matrix U  <-- U                                                |
+--------------------------------------------------------------------+
|i9 : q4=(gens P4)*random(kk^3,kk^7);                                |
|                                                                    |
|             1      7                                               |
|o9 : Matrix U  <-- U                                                |
+--------------------------------------------------------------------+
|i10 : q5=(gens P4)*random(kk^3,kk^7);                               |
|                                                                    |
|              1      7                                              |
|o10 : Matrix U  <-- U                                               |
+--------------------------------------------------------------------+
|i11 : q6=(gens P4)*random(kk^3,kk^7);                               |
|                                                                    |
|              1      7                                              |
|o11 : Matrix U  <-- U                                               |
+--------------------------------------------------------------------+
|i12 : q7=(gens P4)*random(kk^3,kk^7);                               |
|                                                                    |
|              1      7                                              |
|o12 : Matrix U  <-- U                                               |
+--------------------------------------------------------------------+
|i13 : F1=transpose q1|transpose q2|transpose q3|transpose q4|       |
|         transpose q5|transpose q6|transpose q7;                    |
|                                                                    |
|              7      7                                              |
|o13 : Matrix U  <-- U                                               |
+--------------------------------------------------------------------+
|i14 : F = F1-transpose F1;--a skew symmetric 7x7 matrix ;           |
|                                                                    |
|              7      7                                              |
|o14 : Matrix U  <-- U                                               |
+--------------------------------------------------------------------+
|i15 : Y14 = pfaffians (6,F); --a 4-fold of degree 14 that contain P4|
|                                                                    |
|o15 : Ideal of U                                                    |
+--------------------------------------------------------------------+

The variety defined by the cubic pfaffians is a 4-fold, has degree 14, and
contains the $\PP^4$.

+---------------------------+
|i16 : (dim Y14, degree Y14)|
|                           |
|o16 = (5, 14)              |
|                           |
|o16 : Sequence             |
+---------------------------+
|i17 : isSubset(Y14, P4)    |
|                           |
|o17 = true                 |
+---------------------------+

We take the residual of the $\PP^4$ in $Y_{14}$.  This is a 4-fold of degree
13.

+------------------------------------------+
|i18 : Y13 = Y14:P4;--a 4-fold of degree 13|
|                                          |
|o18 : Ideal of U                          |
+------------------------------------------+
|i19 : dim Y13                             |
|                                          |
|o19 = 5                                   |
+------------------------------------------+
|i20 : degree Y13                          |
|                                          |
|o20 = 13                                  |
+------------------------------------------+

We intersect this variety with the $\PP^4$, obtaining a quartic hypersurface
$X_4$ in $\PP^4$.

+--------------------------+
|i21 : X4 = trim(Y13 + P4);|
|                          |
|o21 : Ideal of U          |
+--------------------------+

Let $X_{13}$ be the 3-fold which is the intersection of $Y_{13}$ with the
hyperplane $y_0 = 0$.

+-----------------------------------------------------------+
|i22 : X13 = trim(P6 + Y13);--  A 3-fold of degree 13 in  P6|
|                                                           |
|o22 : Ideal of U                                           |
+-----------------------------------------------------------+
|i23 : dim X13                                              |
|                                                           |
|o23 = 4                                                    |
+-----------------------------------------------------------+
|i24 : degree X13                                           |
|                                                           |
|o24 = 13                                                   |
+-----------------------------------------------------------+

The union $X$ of $X_{13}$ and $X_4$ is a 3-fold of degree 17 in $\PP^7$, with
Betti table of type [331]

+-----------------------------------------------------------------------------+
|i25 : X = intersect (X4,X13);  --A 3-fold of degree 17 in P7, the union of   |
|                                                                             |
|o25 : Ideal of U                                                             |
|-----------------------------------------------------------------------------|
|X13 and X4, with betti table of type 331                                     |
+-----------------------------------------------------------------------------+
|i26 : dim X                                                                  |
|                                                                             |
|o26 = 4                                                                      |
+-----------------------------------------------------------------------------+
|i27 : degree X                                                               |
|                                                                             |
|o27 = 17                                                                     |
+-----------------------------------------------------------------------------+
|i28 : betti res X                                                            |
|                                                                             |
|             0  1  2  3 4                                                    |
|o28 = total: 1 11 20 11 1                                                    |
|          0: 1  .  .  . .                                                    |
|          1: .  3  3  1 .                                                    |
|          2: .  7 14  7 .                                                    |
|          3: .  1  3  3 .                                                    |
|          4: .  .  .  . 1                                                    |
|                                                                             |
|o28 : BettiTally                                                             |
+-----------------------------------------------------------------------------+

The intersection of $X_4$ and $X_{13}$ is a quartic surface in a $\PP^3$, which
is a hyperplane section of $X_4$.

+---------------------------------------------------------+
|i29 : Z = trim(X13 + X4);                                |
|                                                         |
|o29 : Ideal of U                                         |
+---------------------------------------------------------+
|i30 : dim Z -- 3, therefore a surface in projective space|
|                                                         |
|o30 = 3                                                  |
+---------------------------------------------------------+
|i31 : degree Z                                           |
|                                                         |
|o31 = 4                                                  |
+---------------------------------------------------------+
|i32 : dim X4                                             |
|                                                         |
|o32 = 4                                                  |
+---------------------------------------------------------+
|i33 : X4 + ideal(y0) == Z                                |
|                                                         |
|o33 = true                                               |
+---------------------------------------------------------+

See also
========

  * [QQ] -- Quaternary Quartic Forms and Gorenstein rings
    (Kapustka, Kapustka, Ranestad, Schenck, Stillman, Yuan, 2021)
-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics/Section9Doc.m2:228:0.

Type [420], CY of degree 16 via linkage -- lifting to an irreducible 3-fold
***************************************************************************

We construct via linkage an arithmetically Gorenstein irreducible 3-fold $X =
X_{16} \bf{P}^7$, of degree 16, having Betti table of type [420]. For an
artinian reduction $A_F$, the quadratic part of the ideal $F^\perp$ is the
ideal of six points on a twisted cubic curve. We construct $X_{16}$ as an
anticanonical divisor in the fourfold intersection of a cubic scroll and
quadric.

The betti table is $\phantom{WWWW} \begin{matrix} &0&1&2&3&4\\
\text{total:}&1&6&10&6&1\\ \text{0:}&1&\text{.}&\text{.}&\text{.}&\text{.}\\
\text{1:}&\text{.}&4&2&\text{.}&\text{.}\\ \text{2:}&\text{.}&2&6&2&\text{.}\\
\text{3:}&\text{.}&\text{.}&2&4&\text{.}\\
\text{4:}&\text{.}&\text{.}&\text{.}&\text{.}&1\\ \end{matrix} $

+-----------------------------------------------------------------------------+
|i1 : kk=QQ;                                                                  |
+-----------------------------------------------------------------------------+
|i2 : U=kk[y0,y1,y2,y3,y4,y5,y6,y7];                                          |
+-----------------------------------------------------------------------------+
|i3 : P4=ideal(y0,y1,y2);--a P4                                               |
|                                                                             |
|o3 : Ideal of U                                                              |
+-----------------------------------------------------------------------------+
|i4 : T3=minors(2,matrix{{y0,y1,y2},{y3,y4,y5}});--a cubic 5-fold scroll with |
|                                                                             |
|o4 : Ideal of U                                                              |
|-----------------------------------------------------------------------------|
|P4 as a ruling                                                               |
+-----------------------------------------------------------------------------+
|i5 : X2=P4+ideal(random(2,U));-- a quadric 3-fold in T3                      |
|                                                                             |
|o5 : Ideal of U                                                              |
+-----------------------------------------------------------------------------+
|i6 : X18=T3+ideal(random(2,X2),random(3,X2));--a 3-fold of degree 18 in T3   |
|                                                                             |
|o6 : Ideal of U                                                              |
|-----------------------------------------------------------------------------|
|that contains X2                                                             |
+-----------------------------------------------------------------------------+
|i7 : X16=X18:X2;--a 3-fold of degree 16 in T3 with betti table of type 420   |
|                                                                             |
|o7 : Ideal of U                                                              |
+-----------------------------------------------------------------------------+
+--------------------------+
|i8 : (dim X16, degree X16)|
|                          |
|o8 = (4, 16)              |
|                          |
|o8 : Sequence             |
+--------------------------+
|i9 : betti res X16        |
|                          |
|            0 1  2 3 4    |
|o9 = total: 1 6 10 6 1    |
|         0: 1 .  . . .    |
|         1: . 4  2 . .    |
|         2: . 2  6 2 .    |
|         3: . .  2 4 .    |
|         4: . .  . . 1    |
|                          |
|o9 : BettiTally           |
+--------------------------+

See also
========

  * [QQ] -- Quaternary Quartic Forms and Gorenstein rings
    (Kapustka, Kapustka, Ranestad, Schenck, Stillman, Yuan, 2021)
-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics/Section9Doc.m2:272:0.

Type [430], CY of degree 16 via linkage -- lifting to a 3-fold with components of degrees 10, 6
***********************************************************************************************

We construct via linkage an arithmetically Gorenstein 3-fold $X = X_{10} \cup
X_{6} \subset \bf{P}^7$, of degree 16, having Betti table of type [430]. For an
artinian reduction $A_F$, the quadratic part of the ideal $F^\perp$ is the
ideal of a line and three independent points $p_1,p_2,p_3$, and $F^\perp$
contains pencils of ideals of three points on the line and the three fixed
points $p_i$. In the pencil we find an ideal of four points in a plane and two
on an independent line passing though one of the four points. We construct
$X_{10}$ in a pencil of quadrics in a P6, and $X_{6}$ as a complete
intersection in a P5. In the construction the intersection $X\cup X'$ of a
component $X$ with the other is an anticanonical divisor on $X$.

The Betti table is $\phantom{WWWW} \begin{matrix} &0&1&2&3&4\\
\text{total:}&1&7&12&7&1\\ \text{0:}&1&\text{.}&\text{.}&\text{.}&\text{.}\\
\text{1:}&\text{.}&4&3&\text{.}&\text{.}\\ \text{2:}&\text{.}&3&6&3&\text{.}\\
\text{3:}&\text{.}&\text{.}&3&4&\text{.}\\
\text{4:}&\text{.}&\text{.}&\text{.}&\text{.}&1\\ \end{matrix} $

+-----------------------------------------------------------------------------+
|i1 : kk=QQ;                                                                  |
+-----------------------------------------------------------------------------+
|i2 : U=kk[y0,y1,y2,y3,y4,y5,y6,y7];                                          |
+-----------------------------------------------------------------------------+
|i3 : P4=ideal(y0,y1,y2);--a P4                                               |
|                                                                             |
|o3 : Ideal of U                                                              |
+-----------------------------------------------------------------------------+
|i4 : P5=ideal(y1,y2);--a P5                                                  |
|                                                                             |
|o4 : Ideal of U                                                              |
+-----------------------------------------------------------------------------+
|i5 : X2=P4+ideal(random(2,U));--a quadric 3-fold in P4                       |
|                                                                             |
|o5 : Ideal of U                                                              |
+-----------------------------------------------------------------------------+
|i6 : CI1223=ideal(y0)+ideal(random(2,P4),random(2,P4),random(3,X2)); --a     |
|                                                                             |
|o6 : Ideal of U                                                              |
|-----------------------------------------------------------------------------|
|complete intersection (1,2,2,3) that intersects  P4 in X2 and X1, a P3.      |
+-----------------------------------------------------------------------------+
|i7 : X10=CI1223:X2;  --a reducible 3-fold X10 of degree 10 linked to the     |
|                                                                             |
|o7 : Ideal of U                                                              |
|-----------------------------------------------------------------------------|
|quadric threefold X2.  X10 is the union of X1 and  3-fold X9 of degree 9.    |
+-----------------------------------------------------------------------------+
|i8 : Z6=X10+X2;----a complete intersection (1,1,1,2,3) surface  contained in |
|                                                                             |
|o8 : Ideal of U                                                              |
|-----------------------------------------------------------------------------|
|X10                                                                          |
+-----------------------------------------------------------------------------+
|i9 : X6=P5+ideal(random(2,Z6),random(3,Z6));-- X6 is a complete intersection |
|                                                                             |
|o9 : Ideal of U                                                              |
|-----------------------------------------------------------------------------|
|(1,1,2,3) that intersects s10 in a hyperplane section of X6                  |
+-----------------------------------------------------------------------------+
|i10 : X16=intersect(X6,X10);--a 3-fold of degree 16 in P7 with betti table of|
|                                                                             |
|o10 : Ideal of U                                                             |
|-----------------------------------------------------------------------------|
|type 430.  X16 is the union of X6, X1 and X9                                 |
+-----------------------------------------------------------------------------+
|i11 : betti res X16                                                          |
|                                                                             |
|             0 1  2 3 4                                                      |
|o11 = total: 1 7 12 7 1                                                      |
|          0: 1 .  . . .                                                      |
|          1: . 4  3 . .                                                      |
|          2: . 3  6 3 .                                                      |
|          3: . .  3 4 .                                                      |
|          4: . .  . . 1                                                      |
|                                                                             |
|o11 : BettiTally                                                             |
+-----------------------------------------------------------------------------+

See also
========

  * [QQ] -- Quaternary Quartic Forms and Gorenstein rings
    (Kapustka, Kapustka, Ranestad, Schenck, Stillman, Yuan, 2021)
-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics/Section9Doc.m2:319:0.

Type [441a], CY of degree 16 -- lifting to a 3-fold with components of degrees 12, 4
************************************************************************************

We construct via linkage an arithmetically Gorenstein 3-fold $X = X_{12} \cup
X_{4} \subset \bf{P}^7$, of degree 16, having Betti table of type [441], and is
on component [441a]. For an artinian reduction $A_F$, the quadratic part of the
ideal $F^\perp$ is the ideal of a conic and an independent point p, and
$F^\perp$ contains pencils of ideals of five points on the conic and the point
p. So we construct $X_{12}$ in a pencil of codimension 3 varieties of degree 5
in a quadric in a P6, and $X_{4}$ in an independent P4. In the construction the
intersection $X\cup X'$ of a component $X$ with the other is an anticanonical
divisor on $X$.

The Betti table is $\phantom{WWWW} \begin{matrix} &0&1&2&3&4\\
\text{total:}&1&9&16&9&1\\ \text{0:}&1&\text{.}&\text{.}&\text{.}&\text{.}\\
\text{1:}&\text{.}&4&4&1&\text{.}\\ \text{2:}&\text{.}&4&8&4&\text{.}\\
\text{3:}&\text{.}&1&4&4&\text{.}\\
\text{4:}&\text{.}&\text{.}&\text{.}&\text{.}&1\\ \end{matrix} $

+-----------------------------------------------------------------------------+
|i1 : kk=QQ;                                                                  |
+-----------------------------------------------------------------------------+
|i2 : U=kk[y0,y1,y2,y3,y4,y5,y6,y7];                                          |
+-----------------------------------------------------------------------------+
|i3 : P3=ideal(y0,y1,y2,y3);--a P3                                            |
|                                                                             |
|o3 : Ideal of U                                                              |
+-----------------------------------------------------------------------------+
|i4 : P4=ideal(y1,y2,y3);--a P4                                               |
|                                                                             |
|o4 : Ideal of U                                                              |
+-----------------------------------------------------------------------------+
|i5 : P6=ideal(y0);--a P6                                                     |
|                                                                             |
|o5 : Ideal of U                                                              |
+-----------------------------------------------------------------------------+
|i6 : M24=matrix{{y1,y2,random(2,U),random(2,U)},{y2,y3,random(2,U),random(2,U|
|                                                                             |
|             2      4                                                        |
|o6 : Matrix U  <-- U                                                         |
|-----------------------------------------------------------------------------|
|)}};--a 2x4 matrix with two columns of linear and two of quadratic forms     |
+-----------------------------------------------------------------------------+
|i7 : X12=P6+minors(2,M24);--a 3-fold of degree 12 in P6                      |
|                                                                             |
|o7 : Ideal of U                                                              |
+-----------------------------------------------------------------------------+
|i8 : Z4=P3+X12;--a quartic surface in X12                                    |
|                                                                             |
|o8 : Ideal of U                                                              |
+-----------------------------------------------------------------------------+
|i9 : X4=P4+ideal(random(4,Z4));--a quartic 3-fold                            |
|                                                                             |
|o9 : Ideal of U                                                              |
+-----------------------------------------------------------------------------+
|i10 : X16=intersect(X12,X4);-- a 3-fold of degree 16 in P7 with betti table  |
|                                                                             |
|o10 : Ideal of U                                                             |
|-----------------------------------------------------------------------------|
|of type 441                                                                  |
+-----------------------------------------------------------------------------+
|i11 : betti res X16                                                          |
|                                                                             |
|             0 1  2 3 4                                                      |
|o11 = total: 1 9 16 9 1                                                      |
|          0: 1 .  . . .                                                      |
|          1: . 4  4 1 .                                                      |
|          2: . 4  8 4 .                                                      |
|          3: . 1  4 4 .                                                      |
|          4: . .  . . 1                                                      |
|                                                                             |
|o11 : BettiTally                                                             |
+-----------------------------------------------------------------------------+

See also
========

  * [QQ] -- Quaternary Quartic Forms and Gorenstein rings
    (Kapustka, Kapustka, Ranestad, Schenck, Stillman, Yuan, 2021)
-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics/Section9Doc.m2:365:0.

Type [441b], CY of degree 16 -- lifting to a 3-fold with components of degrees 8, 8
***********************************************************************************

We construct via linkage an arithmetically Gorenstein 3-fold $X = X_{8} \cup
X_{8}' \subset \bf{P}^7$, of degree 16, having Betti table of type [441], on
component [441b]. For an artinian reduction $A_F$, the quadratic part of the
ideal $F^\perp$ is the ideal of two skew lines, and $F^\perp$ contains pencils
of ideals of three points on one line and three fix points on the other. So we
construct $X_{8}$ in the intersection of two cubics in a P5 and $X_{8}'$ in the
intersection of two cubics in another P5. In the construction the intersection
$X\cup X'$ of a component $X$ with the other is an anticanonical divisor on
$X$.

The Betti table is $\phantom{WWWW} \begin{matrix} &0&1&2&3&4\\
\text{total:}&1&9&16&9&1\\ \text{0:}&1&\text{.}&\text{.}&\text{.}&\text{.}\\
\text{1:}&\text{.}&4&4&1&\text{.}\\ \text{2:}&\text{.}&4&8&4&\text{.}\\
\text{3:}&\text{.}&1&4&4&\text{.}\\
\text{4:}&\text{.}&\text{.}&\text{.}&\text{.}&1\\ \end{matrix} $

+-----------------------------------------------------------------------------+
|i1 : kk=QQ;                                                                  |
+-----------------------------------------------------------------------------+
|i2 : U=kk[y0,y1,y2,y3,y4,y5,y6,y7];                                          |
+-----------------------------------------------------------------------------+
|i3 : P5a=ideal(y0,y1);--a P5 containing P3c                                  |
|                                                                             |
|o3 : Ideal of U                                                              |
+-----------------------------------------------------------------------------+
|i4 : P5b=ideal(y2,y3);--another P5 containing P3c                            |
|                                                                             |
|o4 : Ideal of U                                                              |
+-----------------------------------------------------------------------------+
|i5 : P3=P5a+P5b;--the common P3 of P5a and P5b                               |
|                                                                             |
|o5 : Ideal of U                                                              |
+-----------------------------------------------------------------------------+
|i6 : F0=matrix{{random(2,U),random(2,U)},{random(2,U),random(2,U)}};--a 2x2  |
|                                                                             |
|             2      2                                                        |
|o6 : Matrix U  <-- U                                                         |
|-----------------------------------------------------------------------------|
|matrix of quadrics,                                                          |
+-----------------------------------------------------------------------------+
|i7 : F1=matrix{{y2},{y3}}|F0;--a 2x3 matrix, one columns of linear forms, and|
|                                                                             |
|             2      3                                                        |
|o7 : Matrix U  <-- U                                                         |
|-----------------------------------------------------------------------------|
|two of quadrics,                                                             |
+-----------------------------------------------------------------------------+
|i8 : X8a=P5a+minors(2,F1);--a 3-fold of degree 8 in P5a linked (1,1,3,3) to  |
|                                                                             |
|o8 : Ideal of U                                                              |
|-----------------------------------------------------------------------------|
|P3                                                                           |
+-----------------------------------------------------------------------------+
|i9 : F2=matrix{{y0},{y1}}|F0;--a 2x3 matrix, one columns of linear forms, and|
|                                                                             |
|             2      3                                                        |
|o9 : Matrix U  <-- U                                                         |
|-----------------------------------------------------------------------------|
|two of quadrics,                                                             |
+-----------------------------------------------------------------------------+
|i10 : X8b=P5b+minors(2,F2);--a 3-fold of degree 8 in P5b linked  (1,1,3,3) to|
|                                                                             |
|o10 : Ideal of U                                                             |
|-----------------------------------------------------------------------------|
|P3                                                                           |
+-----------------------------------------------------------------------------+
|i11 : X16=intersect(X8a,X8b);-- a 3-fold of degree 16 in P7 with betti table |
|                                                                             |
|o11 : Ideal of U                                                             |
|-----------------------------------------------------------------------------|
|of type 441b                                                                 |
+-----------------------------------------------------------------------------+
|i12 : betti res X16                                                          |
|                                                                             |
|             0 1  2 3 4                                                      |
|o12 = total: 1 9 16 9 1                                                      |
|          0: 1 .  . . .                                                      |
|          1: . 4  4 1 .                                                      |
|          2: . 4  8 4 .                                                      |
|          3: . 1  4 4 .                                                      |
|          4: . .  . . 1                                                      |
|                                                                             |
|o12 : BettiTally                                                             |
+-----------------------------------------------------------------------------+

See also
========

  * [QQ] -- Quaternary Quartic Forms and Gorenstein rings
    (Kapustka, Kapustka, Ranestad, Schenck, Stillman, Yuan, 2021)
-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics/Section9Doc.m2:414:0.

Type [551], CY of degree 15 via linkage -- lifting to a 3-fold with components of degrees 11 and 4
**************************************************************************************************

We construct via linkage a variety $X = X_{15} = X_{11} \cup X_{4} \subset
\PP^7$, with Betti table

$\phantom{WWWW} \begin{matrix}
&0&1&2&3&4\\\text{total:}&1&7&12&7&1\\\text{0:}&1&\text{.}&\text{.}&\text{.}&\
text{.}\\\text{1:}&\text{.}&5&5&1&\text{.}\\\text{2:}&\text
{.}&1&2&1&\text{.}\\\text{3:}&\text{.}&1&5&5&\text{.}\\\text{4:}&\text{.}&\text
{.}&\text{.}&\text{.}&1\\ \end{matrix} $

For an artinian reduction $A_F$, the quadratic part of the ideal $F^\perp$ is
the ideal of $\Gamma=\Gamma_4\cup p$, the union of a four points in a plane and
one point outside. So we construct $X_{11}$ in the intersection of two quadrics
in a P6 and $X_4$ in an independent P4. In the construction the intersection
$X\cup X'$ of a component $X$ with the other is an anticanonical divisor on
$X$.

We start with a linear $\mathbb{P}^3 \subset \mathbb{P}^7$, take the linked
ideal via a $(1,2,2,3)$ complete intersection containing the $\mathbb{P}^3$.

+-----------------------------------------------------------------------------+
|i1 : kk = QQ;                                                                |
+-----------------------------------------------------------------------------+
|i2 : U = kk[y0,y1,y2,y3,y4,y5,y6,y7];                                        |
+-----------------------------------------------------------------------------+
|i3 : P3 = ideal(y0,y1,y2,y3); --a P3                                         |
|                                                                             |
|o3 : Ideal of U                                                              |
+-----------------------------------------------------------------------------+
|i4 : CI = ideal(y0, random(2, P3), random(2, P3), random(3, P3));            |
|                                                                             |
|o4 : Ideal of U                                                              |
+-----------------------------------------------------------------------------+
|i5 : X11 = CI : P3; -- degree 11, codim 4.                                   |
|                                                                             |
|o5 : Ideal of U                                                              |
+-----------------------------------------------------------------------------+
|i6 : (codim X11, degree X11)                                                 |
|                                                                             |
|o6 = (4, 11)                                                                 |
|                                                                             |
|o6 : Sequence                                                                |
+-----------------------------------------------------------------------------+
|i7 : s114 = X11 + P3; -- intersect X11 with the P3.  Take a random quartic in|
|                                                                             |
|o7 : Ideal of U                                                              |
|-----------------------------------------------------------------------------|
|this ideal.                                                                  |
+-----------------------------------------------------------------------------+
|i8 : X4 = ideal(y1,y2,y3, random(4, s114));                                  |
|                                                                             |
|o8 : Ideal of U                                                              |
+-----------------------------------------------------------------------------+
|i9 : X15 = intersect(X4, X11);                                               |
|                                                                             |
|o9 : Ideal of U                                                              |
+-----------------------------------------------------------------------------+
|i10 : assert isPrime(X4 + X15) -- a quartic in P^3.                          |
+-----------------------------------------------------------------------------+
|i11 : (dim X15, degree X15)                                                  |
|                                                                             |
|o11 = (4, 15)                                                                |
|                                                                             |
|o11 : Sequence                                                               |
+-----------------------------------------------------------------------------+
|i12 : betti resolution X15                                                   |
|                                                                             |
|             0 1  2 3 4                                                      |
|o12 = total: 1 7 12 7 1                                                      |
|          0: 1 .  . . .                                                      |
|          1: . 5  5 1 .                                                      |
|          2: . 1  2 1 .                                                      |
|          3: . 1  5 5 .                                                      |
|          4: . .  . . 1                                                      |
|                                                                             |
|o12 : BettiTally                                                             |
+-----------------------------------------------------------------------------+

See also
========

  * [QQ] -- Quaternary Quartic Forms and Gorenstein rings
    (Kapustka, Kapustka, Ranestad, Schenck, Stillman, Yuan, 2021)
-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics/Section9Doc.m2:454:0.

Type [562] with a lifting of type II, a CY of degree 15 via linkage -- lifting to a 3-fold with components of degrees 7, 4, 4
*****************************************************************************************************************************

We construct via linkage an arithmetically Gorenstein 3-fold $X = X_7& \cup
X_{4} \cup X_{4}' \subset \bf{P}^7$, of degree 15, with components of degrees
$7, 4, 4$, having Betti table of type [562]. For an artinian reduction $A_F$,
the ideal $F^\perp$ contains a pencil of ideals $I_\Gamma$, where
$\Gamma=\Gamma_3\cup p_1\cup p_2$, the union of a three points in a fixed line
and two independent points outside the line. So we construct $X_7$ in the
intersection of two cubics in a P5 and $X_4$ and $X_4'$ as quartics in an
independent P4s. In the construction the intersection $X\cup (X'\cap X'')$ of a
component $X$ with the two others is an anticanonical divisor on $X$.

The betti table is $\phantom{WWWW} \begin{matrix} &0&1&2&3&4\\
\text{total:}&1&9&16&9&1\\ \text{0:}&1&\text{.}&\text{.}&\text{.}&\text{.}\\
\text{1:}&\text{.}&5&6&2&\text{.}\\ \text{2:}&\text{.}&2&4&2&\text{.}\\
\text{3:}&\text{.}&2&6&5&\text{.}\\
\text{4:}&\text{.}&\text{.}&\text{.}&\text{.}&1\\ \end{matrix} $

$X_7$ is linked to a reducible quadric 3-fold $Y$ in a complete intersection
$(1,1,3,3)$.  $X_4$ and $X_4'$ are quartic 3-folds that each intersect $X_7$ in
a cubic surface, while they intersect each other in a plane.  The cubic
surfaces are the intersection of $X_7$ with the components of $Y$, and the
plane is the intersection of these components.

+-----------------------------------------------------------------------------+
|i1 : kk=QQ;                                                                  |
+-----------------------------------------------------------------------------+
|i2 : U=kk[y0,y1,y2,y3,y4,y5,y6,y7];                                          |
+-----------------------------------------------------------------------------+
|i3 : P5=ideal(y0,y1);--a P5                                                  |
|                                                                             |
|o3 : Ideal of U                                                              |
+-----------------------------------------------------------------------------+
|i4 : P3a=ideal(y0,y1,y2,y3);-- a P3                                          |
|                                                                             |
|o4 : Ideal of U                                                              |
+-----------------------------------------------------------------------------+
|i5 : P3b=ideal(y0,y1,y2,y4);-- another P3                                    |
|                                                                             |
|o5 : Ideal of U                                                              |
+-----------------------------------------------------------------------------+
|i6 : P4a=ideal(y0,y2,y3);-- a P4                                             |
|                                                                             |
|o6 : Ideal of U                                                              |
+-----------------------------------------------------------------------------+
|i7 : P4b=ideal(y1,y2,y4);-- a P4                                             |
|                                                                             |
|o7 : Ideal of U                                                              |
+-----------------------------------------------------------------------------+
|i8 : X2=ideal(y0,y1,y2,y3*y4);--a reducible quadric                          |
|                                                                             |
|o8 : Ideal of U                                                              |
+-----------------------------------------------------------------------------+
|i9 : CI1133=P5+ideal(random(3,X2),random(3,X2));--a complete intersection    |
|                                                                             |
|o9 : Ideal of U                                                              |
|-----------------------------------------------------------------------------|
|(1,1,3,3) that contain X2.                                                   |
+-----------------------------------------------------------------------------+
|i10 : X7=CI1133:X2;  -- a 3-fold of degree 7, linked (1,1,3,3) to X2         |
|                                                                             |
|o10 : Ideal of U                                                             |
+-----------------------------------------------------------------------------+
+-------------------------+
|i11 : (dim X7, degree X7)|
|                         |
|o11 = (4, 7)             |
|                         |
|o11 : Sequence           |
+-------------------------+
+-----------------------------------------------------------------------------+
|i12 : Z3a=P3a+X7; -- a cubic surface                                         |
|                                                                             |
|o12 : Ideal of U                                                             |
+-----------------------------------------------------------------------------+
|i13 : Z4a=intersect(Z3a,P3b);-- the union of Z3a and P3b                     |
|                                                                             |
|o13 : Ideal of U                                                             |
+-----------------------------------------------------------------------------+
|i14 : X4a=P4a+ideal(random(4,Z4a));-- a quartic 3-fold in P4 that contains a |
|                                                                             |
|o14 : Ideal of U                                                             |
|-----------------------------------------------------------------------------|
|plane in P3b and the cubic surface Z3                                        |
+-----------------------------------------------------------------------------+
+---------------------------+
|i15 : (dim X4a, degree X4a)|
|                           |
|o15 = (4, 4)               |
|                           |
|o15 : Sequence             |
+---------------------------+
+-----------------------------------------------------------------------------+
|i16 : Z3b=X7+P3b;-- a cubic surface                                          |
|                                                                             |
|o16 : Ideal of U                                                             |
+-----------------------------------------------------------------------------+
|i17 : Z4b=intersect(Z3b,P3a);-- the union of Z3b and P3b                     |
|                                                                             |
|o17 : Ideal of U                                                             |
+-----------------------------------------------------------------------------+
|i18 : X4b=P4b+ideal(random(4,Z4b));-- a quartic 3-fold in P4 that contains a |
|                                                                             |
|o18 : Ideal of U                                                             |
|-----------------------------------------------------------------------------|
|plane in P3b and the cubic surface Z3                                        |
+-----------------------------------------------------------------------------+
+---------------------------+
|i19 : (dim X4b, degree X4b)|
|                           |
|o19 = (4, 4)               |
|                           |
|o19 : Sequence             |
+---------------------------+

The union $X = X_7 \cup X_4 \cup X_4' \subset \PP^7$ has Betti table [562].

+-----------------------------------------------------------------------------+
|i20 : X15=intersect(X7,X4a,X4b);--a 3-fold of degree 15, with betti table of |
|                                                                             |
|o20 : Ideal of U                                                             |
|-----------------------------------------------------------------------------|
|type [562], with three components, X7 of degree 7, and X4a and X4b of degree |
|-----------------------------------------------------------------------------|
|4.                                                                           |
+-----------------------------------------------------------------------------+
|i21 : (dim X15, degree X15)                                                  |
|                                                                             |
|o21 = (4, 15)                                                                |
|                                                                             |
|o21 : Sequence                                                               |
+-----------------------------------------------------------------------------+
|i22 : betti res X15                                                          |
|                                                                             |
|             0 1  2 3 4                                                      |
|o22 = total: 1 9 16 9 1                                                      |
|          0: 1 .  . . .                                                      |
|          1: . 5  6 2 .                                                      |
|          2: . 2  4 2 .                                                      |
|          3: . 2  6 5 .                                                      |
|          4: . .  . . 1                                                      |
|                                                                             |
|o22 : BettiTally                                                             |
+-----------------------------------------------------------------------------+

See also
========

  * [QQ] -- Quaternary Quartic Forms and Gorenstein rings
    (Kapustka, Kapustka, Ranestad, Schenck, Stillman, Yuan, 2021)
-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics/Section9Doc.m2:592:0.

Type [562] with lifting of type I, a CY of degree 15 via linkage -- lifting to a 3-fold with components of degree 8, 7
**********************************************************************************************************************

We construct via linkage an arithmetically Gorenstein 3-fold $X = X_{8} \cup
X_{7} \subset \bf{P}^7$, of degree 15, with two components of degrees 7 and 8,
having Betti table of type [562].   For an artinian reduction $A_F$, the ideal
$F^\perp$ contains a pencil of ideals $I_\Gamma$, where
$\Gamma=\Gamma_3\cup\Gamma_2$, the union of a three points in a line $L$ and
two fixed points on a line $L'$ skew to $L$ . So we construct $X_8$ in the
complete intersection of two cubics in a P5 and $X_7$ in a complete
intersection $(2,4)$ in another P5. In the construction the intersection $X\cup
X'$ of a component $X$ with the other is an anticanonical divisor on $X$.

The betti table is $\phantom{WWWW} \begin{matrix} &0&1&2&3&4\\
\text{total:}&1&9&16&9&1\\ \text{0:}&1&\text{.}&\text{.}&\text{.}&\text{.}\\
\text{1:}&\text{.}&5&6&2&\text{.}\\ \text{2:}&\text{.}&2&4&2&\text{.}\\
\text{3:}&\text{.}&2&6&5&\text{.}\\
\text{4:}&\text{.}&\text{.}&\text{.}&\text{.}&1\\ \end{matrix} $

$X_{7}$ is a 3-fold of degree 7 linked via a $(2,4)$ complete intersection to a
$\PP^3$ in a $\PP^5$.  The other component $X_8$ of $X$ is a 3-fold of degree 8
linked via a $(3,3)$ complete intersection to another $\PP^3$ in another
$\PP^5$. These are constructed do that $X_7$ and $X_8$ intersect in a quartic
surface $Z_4$ in the $\PP^3$ which is the intersection of the span of $X_7$ and
$X_8$.

+---------------------------------------------------------------------------+
|i1 : kk=QQ;                                                                |
+---------------------------------------------------------------------------+
|i2 : U=kk[y0,y1,y2,y3,y4,y5,y6,y7];                                        |
+---------------------------------------------------------------------------+
|i3 : P5c=ideal(y0,y1);  -- a P5                                            |
|                                                                           |
|o3 : Ideal of U                                                            |
+---------------------------------------------------------------------------+
|i4 : P5a=ideal(y2,y3);  --P5 of S8                                         |
|                                                                           |
|o4 : Ideal of U                                                            |
+---------------------------------------------------------------------------+
|i5 : P5b=ideal(y4,y5);   --P5 of S7                                        |
|                                                                           |
|o5 : Ideal of U                                                            |
+---------------------------------------------------------------------------+
|i6 : P3ac=P5a+P5c;-- P3 intersection of P5a and P5c                        |
|                                                                           |
|o6 : Ideal of U                                                            |
+---------------------------------------------------------------------------+
|i7 : P3bc=P5b+P5c;                                                         |
|                                                                           |
|o7 : Ideal of U                                                            |
+---------------------------------------------------------------------------+
|i8 : P1=P5a+P5b+P5c; --a line L, the intersection of all three P5s         |
|                                                                           |
|o8 : Ideal of U                                                            |
+---------------------------------------------------------------------------+
|i9 : F=matrix{{y0,random(2,U),random(2,P1)},{y1,random(2,U),random(2,P1)}};|
|                                                                           |
|             2      3                                                      |
|o9 : Matrix U  <-- U                                                       |
+---------------------------------------------------------------------------+
+-----------------------------------------------------------------------------+
|i10 : X8=P5a+minors(2,F);-- a 3-fold of degree 8 in P5a                      |
|                                                                             |
|o10 : Ideal of U                                                             |
+-----------------------------------------------------------------------------+
|i11 : Z4=P5c+X8; -- a quartic surface in P3ac that contains L                |
|                                                                             |
|o11 : Ideal of U                                                             |
+-----------------------------------------------------------------------------+
|i12 : XY=P5c+ideal(random(2,intersect(P5a,P5b)),random(4,intersect(Z4,P5b)));|
|                                                                             |
|o12 : Ideal of U                                                             |
+-----------------------------------------------------------------------------+
+----------------------------------------------+
|i13 : X7=XY:P3bc;--a 3-fold of degree 7 in P5b|
|                                              |
|o13 : Ideal of U                              |
+----------------------------------------------+
|i14 : (dim X7, degree X7)                     |
|                                              |
|o14 = (4, 7)                                  |
|                                              |
|o14 : Sequence                                |
+----------------------------------------------+
|i15 : betti res X7                            |
|                                              |
|             0 1 2 3 4                        |
|o15 = total: 1 5 9 7 2                        |
|          0: 1 2 1 . .                        |
|          1: . 1 2 1 .                        |
|          2: . . . . .                        |
|          3: . 2 6 6 2                        |
|                                              |
|o15 : BettiTally                              |
+----------------------------------------------+
+-----------------------------------------------------------------------------+
|i16 : X15=intersect(X7,X8);--a 3-fold of degree 15 in P7 with betti table of |
|                                                                             |
|o16 : Ideal of U                                                             |
|-----------------------------------------------------------------------------|
|type [562],  the union of X7 and X8.                                         |
+-----------------------------------------------------------------------------+
|i17 : (dim X15, degree X15)                                                  |
|                                                                             |
|o17 = (4, 15)                                                                |
|                                                                             |
|o17 : Sequence                                                               |
+-----------------------------------------------------------------------------+
|i18 : betti res X15                                                          |
|                                                                             |
|             0 1  2 3 4                                                      |
|o18 = total: 1 9 16 9 1                                                      |
|          0: 1 .  . . .                                                      |
|          1: . 5  6 2 .                                                      |
|          2: . 2  4 2 .                                                      |
|          3: . 2  6 5 .                                                      |
|          4: . .  . . 1                                                      |
|                                                                             |
|o18 : BettiTally                                                             |
+-----------------------------------------------------------------------------+

See also
========

  * [QQ] -- Quaternary Quartic Forms and Gorenstein rings
    (Kapustka, Kapustka, Ranestad, Schenck, Stillman, Yuan, 2021)
-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics/Section9Doc.m2:521:0.

VSP(F_Q,9) -- Computation appearing in the proof of Theorem 5.16 in [QQ]
************************************************************************

Let S be the ring $S$ and SQ be $S_{Q}$.

+-----------------------------------------------------------------------------+
|i1 : S=QQ[h_1..h_4];                                                         |
+-----------------------------------------------------------------------------+
|i2 : SQ=QQ[x0,x1,y0,y1, Degrees=>{{1,0},{1,0},{0,1},{0,1}}];--quadric surface|
|-----------------------------------------------------------------------------|
|in PP^3                                                                      |
+-----------------------------------------------------------------------------+
|i3 : A=gens kernel matrix{{h_1,h_2,h_3,h_4}};                                |
|                                                                             |
|             4      6                                                        |
|o3 : Matrix S  <-- S                                                         |
+-----------------------------------------------------------------------------+
|i4 : B=A++A++A++A++A++A;-- this gives a resolution of 6U                     |
|                                                                             |
|             24      36                                                      |
|o4 : Matrix S   <-- S                                                        |
+-----------------------------------------------------------------------------+

Let $F_Q$ be a (4,4)-form, the restriction of a quartic form $F$ of type [100].
IS23 is the matrix of generators of $F_Q^{\perp}(2,3)$. The big matrix ZX
represents the multiplication map $\rho$ from the resolution of $U\otimes
F^{\perp}(2,3) \to S(3,4)$.

+-----------------------------------------------------------------------------+
|i5 : F_{Q}=x0^4*y0^4+x1^4*y0^4+x0^3*x1*y0*y1^3+x0^2*x1^2*y0^2*y1^2+x1^4*y1^4 |
|                                                                             |
|       4  4     4  4     2  2  2  2     3        3     4  4                  |
|o5 = x0 y0  + x1 y0  + x0 x1 y0 y1  + x0 x1*y0*y1  + x1 y1                   |
|                                                                             |
|o5 : SQ                                                                      |
+-----------------------------------------------------------------------------+
|i6 : IS23=((gens intersect(inverseSystem(F_{Q}),                             |
|                                                                             |
|              1       6                                                      |
|o6 : Matrix SQ  <-- SQ                                                       |
|-----------------------------------------------------------------------------|
|((ideal(x0,x1))^2*(ideal(y0,y1))^3)))); --F_{Q}^\perp(2,3)                   |
+-----------------------------------------------------------------------------+
|i7 : ZX=sub((coefficients(                                                   |
|         IS23**matrix{{x0*y0,x1*y0,x0*y1,x1*y1}}                             |
|         ,  Monomials=>gens  ((ideal(x0,x1))^3*(ideal(y0,y1))^4)))_1, S)*B;--|
|                                                                             |
|             20      36                                                      |
|o7 : Matrix S   <-- S                                                        |
|-----------------------------------------------------------------------------|
|the big matrix representing the multiplication map from the resolution of    |
|-----------------------------------------------------------------------------|
|U\otimes F^{\perp}(2,3) to S(3,4)                                            |
+-----------------------------------------------------------------------------+
|i8 : Z1=submatrix(ZX,{0,1,2,3,4,5,6,7,8,9,10,11,13,14,15,16,17,18},{1,2,4,6,8|
|                                                                             |
|             18      18                                                      |
|o8 : Matrix S   <-- S                                                        |
|-----------------------------------------------------------------------------|
|,10,13,15,17,19,22,23,25,28,29,32,34,35});                                   |
+-----------------------------------------------------------------------------+

Compute the ideal X that defines $VSP(F_{Q}, 9)$.

+-----------------------------------------------------------------------------+
|i9 : D1=ideal det Z1;--rank <= 17 locus                                      |
|                                                                             |
|o9 : Ideal of S                                                              |
+-----------------------------------------------------------------------------+
|i10 : X1=decompose D1                                                        |
|                                                                             |
|                                                                             |
|o10 = {ideal h , ideal h , ideal h , ideal h , ideal(h h  - h h ),           |
|              4         3         2         1         2 3    1 4             |
|      -----------------------------------------------------------------------|
|                   4           4             3               2 2             |
|      ideal(949968h  - 6713280h  - 540372420h h  + 481656096h h  -           |
|                   1           2             2 3             2 3             |
|      -----------------------------------------------------------------------|
|                  3            4                  2                          |
|      214742080h h  + 47738880h  - 100117184265h h h  + 44496901348h h h h  -|
|                2 3            3                1 2 4               1 2 3 4  |
|      -----------------------------------------------------------------------|
|              2              2 2          4                                  |
|      82880h h h  - 34412740h h  + 949968h )}                                |
|            1 3 4            1 4          4                                  |
|                                                                             |
|o10 : List                                                                   |
+-----------------------------------------------------------------------------+
|i11 : X=(X1)_5--the ideal generated by X(F_{Q})                              |
|                                                                             |
|                   4           4             3               2 2             |
|o11 = ideal(949968h  - 6713280h  - 540372420h h  + 481656096h h  -           |
|                   1           2             2 3             2 3             |
|      -----------------------------------------------------------------------|
|                  3            4                  2                          |
|      214742080h h  + 47738880h  - 100117184265h h h  + 44496901348h h h h  -|
|                2 3            3                1 2 4               1 2 3 4  |
|      -----------------------------------------------------------------------|
|              2              2 2          4                                  |
|      82880h h h  - 34412740h h  + 949968h )                                 |
|            1 3 4            1 4          4                                  |
|                                                                             |
|o11 : Ideal of S                                                             |
+-----------------------------------------------------------------------------+

We check that $VSP(F_{Q}, 9)$ is smooth.

+----------------------------------+
|i12 : JX=ideal flatten jacobian X;|
|                                  |
|o12 : Ideal of S                  |
+----------------------------------+
|i13 : JX=ideal mingens JX;        |
|                                  |
|o13 : Ideal of S                  |
+----------------------------------+
|i14 : codim JX                    |
|                                  |
|o14 = 4                           |
+----------------------------------+

We check that the quartic form which defines $VSP(F_{Q})$ is of type [000].

+-------------------------+
|i15 : IX=inverseSystem X;|
|                         |
|o15 : Ideal of S         |
+-------------------------+
|i16 : betti res IX       |
|                         |
|             0  1  2  3 4|
|o16 = total: 1 16 30 16 1|
|          0: 1  .  .  . .|
|          1: .  .  .  . .|
|          2: . 16 30 16 .|
|          3: .  .  .  . .|
|          4: .  .  .  . 1|
|                         |
|o16 : BettiTally         |
+-------------------------+

There is a function that gives us the type directly too.

+---------------------+
|i17 : quarticType X_0|
|                     |
|o17 = [000]          |
+---------------------+

See also
========

  * quarticType(RingElement) -- the Betti
    stratum a specific quartic lies on
  * [QQ] -- Quaternary Quartic Forms and Gorenstein rings
    (Kapustka, Kapustka, Ranestad, Schenck, Stillman, Yuan, 2021)
-------------------------------------------------------------------------------

The source of this document is in QuaternaryQuartics/Section5Doc.m2:51:0.