This is PolyominoIdeals.info, produced by Macaulay2, version 1.22

PolyominoIdeals -- a package to work with binomial ideals associated with collections of cells
**********************************************************************************************

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

PolyominoIdeals is a package for making several computations with the inner
2-minor ideals attached to collections of  cells.

In [AAQ2012] Ayesha Asloob Qureshi establishes a connection between
Combinatorial Commutiative Algebra and collection of cells, assigning to every
collection of cells the binomial ideal of its inner $2$-minors.

 Consider the natural partial order on $\NN^2$ and let $a,b \in \N^2$ with
$a\leq b$. The set $[a, b] = \{c \in \NN^2 : a \leq c \leq b\}$ is called an
interval of $\NN^2$; moreover, if $b=a+(1,1)$, then $[a,b]$ is called a cell of
$\NN^2$. An interval $C=[a, b]$, where $a = (i, j)$ and $b = (k, l)$, is said
to be a proper interval if $i < k$ and $j < l$. The elements $a, b$ are said
the diagonal corners of $C$ and  $c = (k, j)$ and $d = (i, l)$ the
anti-diagonal ones. If $C$ is a cell, then $V(C)=\{a,a+(1,1),a+(0,1),a+(1,0)\}$
is the set of the corners of $C$.
 To each collection of cells $\mathcal{P}$, we attach an ideal
$I_{\mathcal{P}}$ as following. Let $K$ be a field and $S=K[x_a: a \in V
(\mathcal{P})$, where $V (\mathcal{P})$ is the union of the vertices sets of
all cells of $\mathcal{P}$. A proper interval $[a, b]$ is called an inner
interval of $\mathcal{P}$ if all cells of $[a, b]$ belong to $\mathcal{P}$. The
binomial $f= x_ax_b − x_c x_d$ , where $c$ and $d$ are the anti-diagonal
corners of $[a, b]$, is called an inner 2-minor of $\mathcal{P}$, if $[a, b]$
is an inner interval of $\mathcal{P}$. We denote by $I_{\mathcal{P}}$ the ideal
generated in $S$ by the inner 2-minors of $\mathcal{P}$ and by $K
[\mathcal{P}]$ the quotient ring $S/I_{\mathcal{P}}$, called the coordinate
ring of $\mathcal{P}$.
 The class of ideals attached to a collection of cells includes, for example,
the ideals of 2-minors of two-sided ladders, but it is much more general.
Interesting classes of collections of cells are the so-called polyominoes that
are well studied in various combinatorial contexts. A collection of cells
$\mathcal{P}$ is called a polyomino if for any two cells $A, B \in \mathcal{P}$
there exists a sequence of cells $A=C_1,\dots, C_m=B$ of $\mathcal{P}$ such
that  $C_i$ and $C_{i+1}$ have an edge in common. In such a case,
$I_{\mathcal{P}}$ is called polyomino ideal of $\mathcal{P}$.

The aim of this package is to provide several tools to help mathematicians in
the study of polyomino ideals. Every contribution is very welcome.

Literature
  * [AAQ2012] Ideals generated by 2-minors, collections of cells and stack
    polyominoes (A. A. Qureshi, 2012,  J. Algebra).

Authors
=======

  * Carmelo Cisto <ccisto@unime.it>
  * Francesco Navarra <fnavarra@unime.it>
  * Rizwan Jahangir (see https://myweb.sabanciuniv.edu/rizwan )
    <rizwan@sabanciuniv.edu>

Version
=======

This documentation describes version 1.0 of PolyominoIdeals.

Source code
===========

The source code from which this documentation is derived is in the file
PolyominoIdeals.m2 (see common/share/Macaulay2/PolyominoIdeals.m2 ).

Exports
=======

  * Functions and commands
      * polyoIdeal -- Ideal of inner 2-minors of a
        collection of cells
      * polyoMatrix -- Matrix attached to a collection of
        cells
      * polyoToric -- Toric ideal of a polyomino
  * Methods
      * "polyoIdeal(List)" -- see polyoIdeal, -- Ideal of
        inner 2-minors of a collection of cells
      * "polyoMatrix(List)" -- see polyoMatrix, -- Matrix
        attached to a collection of cells
      * "polyoToric(List,List)" -- see polyoToric, -- Toric
        ideal of a polyomino
  * Symbols
      * Field -- optional argument for polyoIdeal
      * RingChoice -- optional argument for polyoIdeal
      * TermOrder -- optional argument for polyoIdeal

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

The object PolyominoIdeals, is a package (Macaulay2Doc).

polyoIdeal -- Ideal of inner 2-minors of a collection of cells
**************************************************************

Synopsis
========

  * Usage:
        polyoIdeal Q
  * Inputs:
      * Q, a list of lists whose elements are the lists of diagonal corners of
        each cell.
  * Optional inputs (Macaulay2Doc),:
      * Field, => ..., default value QQ, optional argument for
        polyoIdeal
      * RingChoice, => ..., default value 1, optional
        argument for polyoIdeal
      * TermOrder, => ..., default value Lex, optional
        argument for polyoIdeal
  * Outputs:
      * The inner 2-minors ideal of the collection of cells encoding by Q

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

Let $\mathcal{P}$ be a collection of cells. This routine returns the ideal
$I_{\mathcal{P}}$ of the inner 2-minors of $\mathcal{P}$.
Moreover, if $\mathcal{P}$ is a polyomino, then it returns the polyomino ideal
of $\mathcal{P}$.

If Q does not encod a collection of cells, that is in a list of Q the
difference between the first sublist and the second one is different from
{1,1}, then we get an error.

+-----------------------------------------------------------------------------+
|i1 : Q={{{1,1},{2,2}},{{2,1},{3,2}},{{2,2},{3,3}}}                           |
|                                                                             |
|o1 = {{{1, 1}, {2, 2}}, {{2, 1}, {3, 2}}, {{2, 2}, {3, 3}}}                  |
|                                                                             |
|o1 : List                                                                    |
+-----------------------------------------------------------------------------+
|i2 : I = polyoIdeal Q                                                        |
|                                                                             |
|o2 = ideal (x   x    - x   x   , x   x    - x   x   , x   x    - x   x   ,   |
|             2,2 1,1    2,1 1,2   3,3 2,2    3,2 2,3   3,2 1,1    3,1 1,2    |
|     ------------------------------------------------------------------------|
|     x   x    - x   x   , x   x    - x   x   )                               |
|      3,3 2,1    3,1 2,3   3,2 2,1    3,1 2,2                                |
|                                                                             |
|o2 : Ideal of QQ[x   , x   , x   , x   , x   , x   , x   , x   ]             |
|                  3,3   3,2   3,1   2,3   2,2   2,1   1,2   1,1              |
+-----------------------------------------------------------------------------+

+-----------------------------------------------------------------------------+
|i3 : Q={{{1, 1}, {2, 2}}, {{2, 1}, {3, 2}}, {{3, 1}, {4, 2}}, {{3, 2}, {4,   |
|-----------------------------------------------------------------------------|
|3}}, {{3, 3}, {4, 4}}, {{2, 3}, {3, 4}}, {{1, 3}, {2, 4}}, {{1, 2}, {2, 3}}};|
+-----------------------------------------------------------------------------+
|i4 : I = polyoIdeal Q                                                        |
|                                                                             |
|o4 = ideal (x   x    - x   x   , x   x    - x   x   , x   x    - x   x   ,   |
|             2,3 1,1    2,1 1,3   4,3 3,1    4,1 3,3   4,4 1,3    4,3 1,4    |
|     ------------------------------------------------------------------------|
|     x   x    - x   x   , x   x    - x   x   , x   x    - x   x   , x   x    |
|      3,4 2,3    3,3 2,4   4,2 2,1    4,1 2,2   2,3 1,2    2,2 1,3   2,4 1,1 |
|     ------------------------------------------------------------------------|
|     - x   x   , x   x    - x   x   , x   x    - x   x   , x   x    -        |
|        2,1 1,4   4,4 3,1    4,1 3,4   4,3 3,2    4,2 3,3   3,4 1,3          |
|     ------------------------------------------------------------------------|
|     x   x   , x   x    - x   x   , x   x    - x   x   , x   x    - x   x   ,|
|      3,3 1,4   3,2 2,1    3,1 2,2   4,2 1,1    4,1 1,2   2,4 1,2    2,2 1,4 |
|     ------------------------------------------------------------------------|
|     x   x    - x   x   , x   x    - x   x   , x   x    - x   x   , x   x    |
|      4,4 3,2    4,2 3,4   2,4 1,3    2,3 1,4   4,4 3,3    4,3 3,4   3,2 1,1 |
|     ------------------------------------------------------------------------|
|     - x   x   , x   x    - x   x   , x   x    - x   x   , x   x    -        |
|        3,1 1,2   4,4 2,3    4,3 2,4   2,2 1,1    2,1 1,2   4,2 3,1          |
|     ------------------------------------------------------------------------|
|     x   x   )                                                               |
|      4,1 3,2                                                                |
|                                                                             |
|o4 : Ideal of QQ[x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , |
|                  4,4   4,3   4,2   4,1   3,4   3,3   3,2   3,1   2,4   2,3  |
|-----------------------------------------------------------------------------|
|x   , x   , x   , x   , x   , x   ]                                          |
| 2,2   2,1   1,4   1,3   1,2   1,1                                           |
+-----------------------------------------------------------------------------+

Ways to use polyoIdeal :
========================

  * "polyoIdeal(List)"

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

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

polyoToric -- Toric ideal of a polyomino
****************************************

Synopsis
========

  * Usage:
        polyoToric(Q,H)
  * Inputs:
      * Q, a list of lists whose elements are the lists of diagonal corners of
        each cell.
      * H, a list of the lower left corners of the holes.
  * Outputs:
      * A toric ideal attached to the polyomino encoded by Q.

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

Let $\mathcal{P}$ be a polyomino. A finite collection $\mathcal{H}$ of cells
not in $\mathcal{P}$ is called a hole of $\mathcal{P}$, if any two cells in
$\mathcal{H}$ are connected by a path of cells in $\mathcal{H}$ and
$\mathcal{H}$ is maximal with respect to the set inclusion. Consider the
following total order on $V(\mathcal{P})$: $a=(i,j)>b=(k, l)$, if $i > k$, or
$i = k$ and $j > l$. If $\mathcal{H}$ is a hole of $\mathcal{P}$, then we call
lower left corner $e$ of $\mathcal{H}$ the minimum, with respect to <, of the
vertices of $\mathcal{H}$.     Let $\mathcal{H}_1,\dots, \mathcal{H}_r$ be the
holes of $\mathcal{P}$ and $e_k = (i_k, j_k)$ be the lower left corner of
$\mathcal{H}_k$. For $k \in K =[r]$, we define the following subset $F_k =
\{(i, j) \in V (\mathcal{P}) : i \leq i_k, j \leq j_k\}$. Denote by
$\{V_i\}_{i\in I}$ the set of all the maximal vertical edge intervals of
$\mathcal{P}$, and by $\{H_j \}_{j\in J}$ the set of all the maximal horizontal
edge intervals of $\mathcal{P}$. Let $\{v_i\}_{i\in I}$, $\{H_j\}_{j\in J}$ ,
and $\{w_k\}_{k∈K}$ be three sets of variables. We consider the map $$\alpha :
V (\mathcal{P}) \rightarrow K[{h_i, v_j , w_k } : i \in I, j \in J, k \in K]$$
$$a \rightarrow \prod_{a\in H_i \cap V_j} h_iv_j \prod_{a\in F_k} w_k$$ The
toric ring $T_{\mathcal{P}}$ associated to $\mathcal{P}$ is defined as
$T_{\mathcal{P}} = K[\alpha(a):a \in V (\mathcal{P})]$. The homomorphism $\psi
: S \rightarrow T_{\mathcal{P}}$ with $x_a \rightarrow \alpha(a)$ is surjective
and the toric ideal $J_{\mathcal{P}}$ is the kernel of $\psi$.
Note that the homomorphism $\psi$ defined before is a natural generalization of
that given in [QSS2017] for simple polyominoes.

Given the polyomino encoded by Q and the list H of the lower left corners of
each hole of the polyomino, the function polyoToric returns the toric ideal
$J_{\mathcal{P}}$ defined before.

Literature
  * [QSS2017] Simple polyominoes are prime (A.A. Qureshi, T. Shibuta, A.
    Shikama, 2017, J. Commut. Algebra 9(3), 413-422).
  * [MRR2020] Primality of multiply connected polyominoes (C. Mascia, G.
    Rinaldo, F. Romeo, 2020, Illinois J. Math. 64(3), 291-304).
  * [CNU2022] Primality of weakly connected collections of cells and weakly
    closed path polyominoes (C. Cisto, F. Navarra, R. Utano, 2022, Illinois J.
    Math. 66(4), 545-563).

Examples

+-----------------------------------------------------------------------------+
|i1 : Q={{{1, 1}, {2, 2}}, {{2, 1}, {3, 2}}, {{3, 1}, {4, 2}}, {{3, 2}, {4,   |
|-----------------------------------------------------------------------------|
|3}}, {{3, 3}, {4, 4}}, {{2, 3}, {3, 4}}, {{1, 3}, {2, 4}}, {{1, 2}, {2, 3}}};|
+-----------------------------------------------------------------------------+
|i2 : J=polyoToric(Q,{{2,2}})                                                 |
|                                                                             |
|o2 = ideal (- x   x    + x   x   , - x   x    + x   x   , - x   x    +       |
|               2,2 1,1    2,1 1,2     3,2 1,1    3,1 1,2     4,2 1,1         |
|     ------------------------------------------------------------------------|
|     x   x   , - x   x    + x   x   , - x   x    + x   x   , - x   x    +    |
|      4,1 1,2     2,3 1,1    2,1 1,3     2,3 1,2    2,2 1,3     2,4 1,1      |
|     ------------------------------------------------------------------------|
|     x   x   , - x   x    + x   x   , - x   x    + x   x   , - x   x    +    |
|      2,1 1,4     2,4 1,2    2,2 1,4     2,4 1,3    2,3 1,4     3,4 1,3      |
|     ------------------------------------------------------------------------|
|     x   x   , - x   x    + x   x   , - x   x    + x   x   , - x   x    +    |
|      3,3 1,4     4,4 1,3    4,3 1,4     3,2 2,1    3,1 2,2     4,2 2,1      |
|     ------------------------------------------------------------------------|
|     x   x   , - x   x    + x   x   , - x   x    + x   x   , - x   x    +    |
|      4,1 2,2     3,4 2,3    3,3 2,4     4,4 2,3    4,3 2,4     4,2 3,1      |
|     ------------------------------------------------------------------------|
|     x   x   , - x   x    + x   x   , - x   x    + x   x   , - x   x    +    |
|      4,1 3,2     4,3 3,1    4,1 3,3     4,3 3,2    4,2 3,3     4,4 3,1      |
|     ------------------------------------------------------------------------|
|     x   x   , - x   x    + x   x   , - x   x    + x   x   )                 |
|      4,1 3,4     4,4 3,2    4,2 3,4     4,4 3,3    4,3 3,4                  |
|                                                                             |
|o2 : Ideal of QQ[x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , |
|                  4,4   4,3   4,2   4,1   3,4   3,3   3,2   3,1   2,4   2,3  |
|-----------------------------------------------------------------------------|
|x   , x   , x   , x   , x   , x   ]                                          |
| 2,2   2,1   1,4   1,3   1,2   1,1                                           |
+-----------------------------------------------------------------------------+

+-----------------------------------------------------------------------------+
|i3 : Q={{{3, 1}, {4, 2}}, {{4, 1}, {5, 2}}, {{5, 1}, {6, 2}}, {{5, 2}, {6,   |
|-----------------------------------------------------------------------------|
|3}}, {{5, 3}, {6, 4}}, {{5, 4}, {6, 5}}, {{5, 5}, {6, 6}}, {{4, 5}, {5, 6}}, |
|-----------------------------------------------------------------------------|
|{{3, 2}, {4, 3}}, {{3, 3}, {4, 4}}, {{2, 3}, {3, 4}}, {{1, 3}, {2, 4}}, {{1, |
|-----------------------------------------------------------------------------|
|4}, {2, 5}}, {{1, 5}, {2, 6}}, {{2, 5}, {3, 6}}, {{3, 5}, {4, 6}}};          |
+-----------------------------------------------------------------------------+
|i4 : I=polyoIdeal(Q);                                                        |
|                                                                             |
|o4 : Ideal of QQ[x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , |
|                  6,6   6,5   6,4   6,3   6,2   6,1   5,6   5,5   5,4   5,3  |
|-----------------------------------------------------------------------------|
|x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , x   ,|
| 5,2   5,1   4,6   4,5   4,4   4,3   4,2   4,1   3,6   3,5   3,4   3,3   3,2 |
|-----------------------------------------------------------------------------|
|x   , x   , x   , x   , x   , x   , x   , x   , x   ]                        |
| 3,1   2,6   2,5   2,4   2,3   1,6   1,5   1,4   1,3                         |
+-----------------------------------------------------------------------------+
|i5 : J=polyoToric(Q,{{2,4}});                                                |
|                                                                             |
|o5 : Ideal of QQ[x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , |
|                  6,6   6,5   6,4   6,3   6,2   6,1   5,6   5,5   5,4   5,3  |
|-----------------------------------------------------------------------------|
|x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , x   ,|
| 5,2   5,1   4,6   4,5   4,4   4,3   4,2   4,1   3,6   3,5   3,4   3,3   3,2 |
|-----------------------------------------------------------------------------|
|x   , x   , x   , x   , x   , x   , x   , x   , x   ]                        |
| 3,1   2,6   2,5   2,4   2,3   1,6   1,5   1,4   1,3                         |
+-----------------------------------------------------------------------------+
|i6 : R=ring I                                                                |
|                                                                             |
|o6 = R                                                                       |
|                                                                             |
|o6 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i7 : J=substitute(J,R);                                                      |
|                                                                             |
|o7 : Ideal of R                                                              |
+-----------------------------------------------------------------------------+
|i8 : J==I                                                                    |
|                                                                             |
|o8 = true                                                                    |
+-----------------------------------------------------------------------------+

Morevover, if $\mathcal{P}$ is a simple polyomino, that is it has not any hole,
then the function polyoToric works setting H={} and it returns the polyomino
ideal of $\mathcal{P}$ in according to [QSS2017].

+-----------------------------------------------------------------------------+
|i9 : Q={{{2, 1}, {3, 2}}, {{3, 1}, {4, 2}}, {{2, 2}, {3, 3}}, {{1, 2}, {2,   |
|-----------------------------------------------------------------------------|
|3}}, {{3, 2}, {4, 3}}, {{2, 3}, {3, 4}}};                                    |
+-----------------------------------------------------------------------------+
|i10 : I=polyoIdeal(Q);                                                       |
|                                                                             |
|o10 : Ideal of QQ[x   , x   , x   , x   , x   , x   , x   , x   , x   , x   ,|
|                   4,3   4,2   4,1   3,4   3,3   3,2   3,1   2,4   2,3   2,2 |
|-----------------------------------------------------------------------------|
|x   , x   , x   ]                                                            |
| 2,1   1,3   1,2                                                             |
+-----------------------------------------------------------------------------+
|i11 : J=polyoToric(Q,{});                                                    |
|                                                                             |
|o11 : Ideal of QQ[x   , x   , x   , x   , x   , x   , x   , x   , x   , x   ,|
|                   4,3   4,2   4,1   3,4   3,3   3,2   3,1   2,4   2,3   2,2 |
|-----------------------------------------------------------------------------|
|x   , x   , x   ]                                                            |
| 2,1   1,3   1,2                                                             |
+-----------------------------------------------------------------------------+
|i12 : R=ring I                                                               |
|                                                                             |
|o12 = R                                                                      |
|                                                                             |
|o12 : PolynomialRing                                                         |
+-----------------------------------------------------------------------------+
|i13 : J=substitute(J,R);                                                     |
|                                                                             |
|o13 : Ideal of R                                                             |
+-----------------------------------------------------------------------------+
|i14 : J==I                                                                   |
|                                                                             |
|o14 = true                                                                   |
+-----------------------------------------------------------------------------+

In general, the function polyoToric works also for weakly connected collection
of cells. If $\mathcal{P}$ is the non-simple collections of cells in Figure (A)
of the Remark 3.4 in [CNU2022], we know that the inner 2-minor ideal of
$\mathcal{P}$ is not prime.

+-----------------------------------------------------------------------------+
|i15 : Q={{{2, 1}, {3, 2}}, {{3, 2}, {4, 3}}, {{1, 2}, {2, 3}}, {{2, 3}, {3,  |
|-----------------------------------------------------------------------------|
|4}}};                                                                        |
+-----------------------------------------------------------------------------+
|i16 : I=polyoIdeal(Q);                                                       |
|                                                                             |
|o16 : Ideal of QQ[x   , x   , x   , x   , x   , x   , x   , x   , x   , x   ,|
|                   4,3   4,2   3,4   3,3   3,2   3,1   2,4   2,3   2,2   2,1 |
|-----------------------------------------------------------------------------|
|x   , x   ]                                                                  |
| 1,3   1,2                                                                   |
+-----------------------------------------------------------------------------+
|i17 : J=polyoToric(Q,{{2,2}});                                               |
|                                                                             |
|o17 : Ideal of QQ[x   , x   , x   , x   , x   , x   , x   , x   , x   , x   ,|
|                   4,3   4,2   3,4   3,3   3,2   3,1   2,4   2,3   2,2   2,1 |
|-----------------------------------------------------------------------------|
|x   , x   ]                                                                  |
| 1,3   1,2                                                                   |
+-----------------------------------------------------------------------------+
|i18 : R=ring I                                                               |
|                                                                             |
|o18 = R                                                                      |
|                                                                             |
|o18 : PolynomialRing                                                         |
+-----------------------------------------------------------------------------+
|i19 : J=substitute(J,R);                                                     |
|                                                                             |
|o19 : Ideal of R                                                             |
+-----------------------------------------------------------------------------+
|i20 : J==I                                                                   |
|                                                                             |
|o20 = false                                                                  |
+-----------------------------------------------------------------------------+
|i21 : select(first entries gens J,f->first degree f>=3)                      |
|                                                                             |
|o21 = {x   x   x    - x   x   x   , x   x   x    - x   x   x   , -           |
|        3,2 2,1 1,3    3,1 2,3 1,2   4,3 3,2 2,4    4,2 3,4 2,3              |
|      -----------------------------------------------------------------------|
|      x   x   x   x    + x   x   x   x   }                                   |
|       4,3 3,1 2,4 1,2    4,2 3,4 2,1 1,3                                    |
|                                                                             |
|o21 : List                                                                   |
+-----------------------------------------------------------------------------+

Ways to use polyoToric :
========================

  * "polyoToric(List,List)"

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

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

polyoMatrix -- Matrix attached to a collection of cells
*******************************************************

Synopsis
========

  * Usage:
        polyoMatrix Q
  * Inputs:
      * Q, a list of lists whose elements are the lists of diagonal corners of
        each cell.
  * Outputs:
      * The matrix attached to the collection of cells encoding by Q.

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

Let $\mathcal{P}$ be a collection of cells and $[(p,q),(r,s)]$ be the smallest
interval of $\NN^2$ containing $\mathcal{P}$. The matrix $M(\mathcal{P})$ is a
matrix having $s-q$ rows and $r-q$ columns with
$M(\mathcal{P})_{i,j}=x_{(i,j)}$ if $(i,j)$ is a vertex of $\mathcal{P}$,
otherwise it is zero.
This routine returns the matrix of the collection of cells encoding by Q. In
the next example we assume for simplicity that the smallest interval containing
$\mathcal{P}$ is $[(1,1),(r,s)]$.

+-----------------------------------------------------------------------------+
|i1 : Q={{{1,1},{2,2}},{{2,1},{3,2}},{{2,2},{3,3}}}                           |
|                                                                             |
|o1 = {{{1, 1}, {2, 2}}, {{2, 1}, {3, 2}}, {{2, 2}, {3, 3}}}                  |
|                                                                             |
|o1 : List                                                                    |
+-----------------------------------------------------------------------------+
|i2 : M = polyoMatrix Q                                                       |
|                                                                             |
|o2 = | 0       x_(2,3) x_(3,3) |                                             |
|     | x_(1,2) x_(2,2) x_(3,2) |                                             |
|     | x_(1,1) x_(2,1) x_(3,1) |                                             |
|                                                                             |
|                                                                3            |
|o2 : Matrix (QQ[x   , x   , x   , x   , x   , x   , x   , x   ])  <---       |
|                 3,3   3,2   3,1   2,3   2,2   2,1   1,2   1,1               |
|-----------------------------------------------------------------------------|
|                                                    3                        |
|(QQ[x   , x   , x   , x   , x   , x   , x   , x   ])                         |
|     3,3   3,2   3,1   2,3   2,2   2,1   1,2   1,1                           |
+-----------------------------------------------------------------------------+

+-----------------------------------------------------------------------------+
|i3 : Q={{{1, 3}, {2, 4}}, {{2, 2}, {3, 3}}, {{3, 1}, {4, 2}}, {{2, 4}, {3,   |
|-----------------------------------------------------------------------------|
|5}}, {{3, 5}, {4, 6}}, {{4, 4}, {5, 5}}, {{5, 3}, {6, 4}}, {{4, 2}, {5, 3}}, |
|-----------------------------------------------------------------------------|
|{{6, 4}, {7, 5}}, {{5, 1}, {6, 2}}, {{7, 5}, {8, 6}}, {{7, 1}, {8, 2}}, {{4, |
|-----------------------------------------------------------------------------|
|6}, {5, 7}}, {{5, 7}, {6, 8}}, {{6, 6}, {7, 7}}};                            |
+-----------------------------------------------------------------------------+
|i4 : M = polyoMatrix Q                                                       |
|                                                                             |
|o4 = | 0       0       0       0       x_(5,8) x_(6,8) 0       0       |     |
|     | 0       0       0       x_(4,7) x_(5,7) x_(6,7) x_(7,7) 0       |     |
|     | 0       0       x_(3,6) x_(4,6) x_(5,6) x_(6,6) x_(7,6) x_(8,6) |     |
|     | 0       x_(2,5) x_(3,5) x_(4,5) x_(5,5) x_(6,5) x_(7,5) x_(8,5) |     |
|     | x_(1,4) x_(2,4) x_(3,4) x_(4,4) x_(5,4) x_(6,4) x_(7,4) 0       |     |
|     | x_(1,3) x_(2,3) x_(3,3) x_(4,3) x_(5,3) x_(6,3) 0       0       |     |
|     | 0       x_(2,2) x_(3,2) x_(4,2) x_(5,2) x_(6,2) x_(7,2) x_(8,2) |     |
|     | 0       0       x_(3,1) x_(4,1) x_(5,1) x_(6,1) x_(7,1) x_(8,1) |     |
|                                                                             |
|                                                                             |
|o4 : Matrix (QQ[x   , x   , x   , x   , x   , x   , x   , x   , x   , x   ,  |
|                 8,6   8,5   8,2   8,1   7,7   7,6   7,5   7,4   7,2   7,1   |
|-----------------------------------------------------------------------------|
|                                                                             |
|x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , x   ,|
| 6,8   6,7   6,6   6,5   6,4   6,3   6,2   6,1   5,8   5,7   5,6   5,5   5,4 |
|-----------------------------------------------------------------------------|
|                                                                             |
|x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , x   ,|
| 5,3   5,2   5,1   4,7   4,6   4,5   4,4   4,3   4,2   4,1   3,6   3,5   3,4 |
|-----------------------------------------------------------------------------|
|                                                      8                      |
|x   , x   , x   , x   , x   , x   , x   , x   , x   ])  <--- (QQ[x   , x   , |
| 3,3   3,2   3,1   2,5   2,4   2,3   2,2   1,4   1,3              8,6   8,5  |
|-----------------------------------------------------------------------------|
|                                                                             |
|x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , x   ,|
| 8,2   8,1   7,7   7,6   7,5   7,4   7,2   7,1   6,8   6,7   6,6   6,5   6,4 |
|-----------------------------------------------------------------------------|
|                                                                             |
|x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , x   ,|
| 6,3   6,2   6,1   5,8   5,7   5,6   5,5   5,4   5,3   5,2   5,1   4,7   4,6 |
|-----------------------------------------------------------------------------|
|                                                                             |
|x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , x   ,|
| 4,5   4,4   4,3   4,2   4,1   3,6   3,5   3,4   3,3   3,2   3,1   2,5   2,4 |
|-----------------------------------------------------------------------------|
|                        8                                                    |
|x   , x   , x   , x   ])                                                     |
| 2,3   2,2   1,4   1,3                                                       |
+-----------------------------------------------------------------------------+

+-----------------------------------------------------------------------------+
|i5 : Q={{{1, 1}, {2, 2}}, {{2, 2}, {3, 3}}, {{3, 3}, {4, 4}}, {{4, 3}, {5,   |
|-----------------------------------------------------------------------------|
|4}}};                                                                        |
+-----------------------------------------------------------------------------+
|i6 : M = polyoMatrix Q                                                       |
|                                                                             |
|o6 = | 0       0       x_(3,4) x_(4,4) x_(5,4) |                             |
|     | 0       x_(2,3) x_(3,3) x_(4,3) x_(5,3) |                             |
|     | x_(1,2) x_(2,2) x_(3,2) 0       0       |                             |
|     | x_(1,1) x_(2,1) 0       0       0       |                             |
|                                                                             |
|                                                                             |
|o6 : Matrix (QQ[x   , x   , x   , x   , x   , x   , x   , x   , x   , x   ,  |
|                 5,4   5,3   4,4   4,3   3,4   3,3   3,2   2,3   2,2   2,1   |
|-----------------------------------------------------------------------------|
|            4                                                                |
|x   , x   ])  <--- (QQ[x   , x   , x   , x   , x   , x   , x   , x   , x   , |
| 1,2   1,1              5,4   5,3   4,4   4,3   3,4   3,3   3,2   2,3   2,2  |
|-----------------------------------------------------------------------------|
|                  5                                                          |
|x   , x   , x   ])                                                           |
| 2,1   1,2   1,1                                                             |
+-----------------------------------------------------------------------------+

Ways to use polyoMatrix :
=========================

  * "polyoMatrix(List)"

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

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

Field -- optional argument for polyoIdeal
*****************************************

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

Change the base field for the ambient ring of the ideal returned by polyoIdeal.

+-----------------------------------------------------------------------------+
|i1 : F = GF(81,Variable=>a)                                                  |
|                                                                             |
|o1 = F                                                                       |
|                                                                             |
|o1 : GaloisField                                                             |
+-----------------------------------------------------------------------------+
|i2 : Q={{{1,1},{2,2}},{{2,1},{3,2}},{{2,2},{3,3}}};                          |
+-----------------------------------------------------------------------------+
|i3 : I = polyoIdeal(Q,Field=> F,RingChoice=>1,TermOrder=> GRevLex)           |
|                                                                             |
|o3 = ideal (- x   x    + x   x   , - x   x    + x   x   , - x   x    +       |
|               3,1 2,3    3,3 2,1     2,1 1,2    2,2 1,1     3,1 1,2         |
|     ------------------------------------------------------------------------|
|     x   x   , - x   x    + x   x   , - x   x    + x   x   )                 |
|      3,2 1,1     3,2 2,3    3,3 2,2     3,1 2,2    3,2 2,1                  |
|                                                                             |
|o3 : Ideal of F[x   , x   , x   , x   , x   , x   , x   , x   ]              |
|                 3,3   3,2   3,1   2,3   2,2   2,1   1,2   1,1               |
+-----------------------------------------------------------------------------+

See also
========

  * polyoIdeal -- Ideal of inner 2-minors of a collection of
    cells

Functions with optional argument named Field :
==============================================

  * "polyoIdeal(...,Field=>...)"

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

The object Field, is a symbol (Macaulay2Doc).

TermOrder -- optional argument for polyoIdeal
*********************************************

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

Change the term order for the ambient ring returned by polyoIdeal in the case
that the option RingChoice is equal to 1.
This option can be used just when RingChoice => 1.

+-----------------------------------------------------------------------------+
|i1 : Q={{{1,1},{2,2}},{{2,2},{3,3}},{{3,3},{4,4}}};                          |
+-----------------------------------------------------------------------------+
|i2 : I = polyoIdeal(Q,RingChoice=>1,TermOrder=> GRevLex);                    |
|                                                                             |
|o2 : Ideal of QQ[x   , x   , x   , x   , x   , x   , x   , x   , x   , x   ] |
|                  4,4   4,3   3,4   3,3   3,2   2,3   2,2   2,1   1,2   1,1  |
+-----------------------------------------------------------------------------+
|i3 : R=ring I;                                                               |
+-----------------------------------------------------------------------------+
|i4 : describe R                                                              |
|                                                                             |
|o4 = QQ[x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , Degrees  |
|         4,4   4,3   3,4   3,3   3,2   2,3   2,2   2,1   1,2   1,1           |
|-----------------------------------------------------------------------------|
|=> {10:1}, Heft => {1}]                                                      |
+-----------------------------------------------------------------------------+

See also
========

  * polyoIdeal -- Ideal of inner 2-minors of a collection of
    cells
  * RingChoice -- optional argument for polyoIdeal

Functions with optional argument named TermOrder :
==================================================

  * "polyoIdeal(...,TermOrder=>...)"

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

The object TermOrder, is a symbol (Macaulay2Doc).

RingChoice -- optional argument for polyoIdeal
**********************************************

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

Let $\mathcal{P}$ be a collection of cells and $[(1,1),(m,n)]$ be the smallest
interval of $\NN^2$ containing $\mathcal{P}$. Then we attach to $\mathcal{P}$
the following polynomial ring $S_{\mathcal{P}}=K[x_a:a\in V(\mathcal{P})$,
where $K$ is a field.
Whether it is 1 or by default it returns the ideal computed by polyoIdeal in
the ambient ring given by polyoRingDefault. With a value different by 1 it
returns the ideal in the ambient ring given by polyoRingConvex.

Here we describe the using of the two options polyoRingDefault and
polyoRingConvex.

PolyoRingDefault

This option gives the ideal $I_{\mathcal{P}}$ in the polynomial ring
$S_{\mathcal{P}}$ where the monomial order is defined by Term order induced by
the following order of the variables: $x_a > x_b$ with $a=(i,j)$ and $b=(k,
l)$, if $i > k$, or $i = k$ and $j > l$.

Examples

+-----------------------------------------------------------------------------+
|i1 : Q={{{1,1},{2,2}},{{2,1},{3,2}},{{2,2},{3,3}}};                          |
+-----------------------------------------------------------------------------+
|i2 : I = polyoIdeal(Q);                                                      |
|                                                                             |
|o2 : Ideal of QQ[x   , x   , x   , x   , x   , x   , x   , x   ]             |
|                  3,3   3,2   3,1   2,3   2,2   2,1   1,2   1,1              |
+-----------------------------------------------------------------------------+
|i3 : R=ring I;                                                               |
+-----------------------------------------------------------------------------+
|i4 : describe R                                                              |
|                                                                             |
|o4 = QQ[x   , x   , x   , x   , x   , x   , x   , x   , Degrees => {8:1},    |
|         3,3   3,2   3,1   2,3   2,2   2,1   1,2   1,1                       |
|                                                                             |
|-----------------------------------------------------------------------------|
|Heft => {1}, MonomialOrder => {MonomialSize => 32}]                          |
|                              {Lex => 8          }                           |
|                              {Position => Up    }                           |
+-----------------------------------------------------------------------------+

+-----------------------------------------------------------------------------+
|i5 : Q={{{1,1},{2,2}},{{2,1},{3,2}},{{2,2},{3,3}}};                          |
+-----------------------------------------------------------------------------+
|i6 : I = polyoIdeal(Q,RingChoice=>1);                                        |
|                                                                             |
|o6 : Ideal of QQ[x   , x   , x   , x   , x   , x   , x   , x   ]             |
|                  3,3   3,2   3,1   2,3   2,2   2,1   1,2   1,1              |
+-----------------------------------------------------------------------------+
|i7 : R=ring I;                                                               |
+-----------------------------------------------------------------------------+
|i8 : describe R                                                              |
|                                                                             |
|o8 = QQ[x   , x   , x   , x   , x   , x   , x   , x   , Degrees => {8:1},    |
|         3,3   3,2   3,1   2,3   2,2   2,1   1,2   1,1                       |
|                                                                             |
|-----------------------------------------------------------------------------|
|Heft => {1}, MonomialOrder => {MonomialSize => 32}]                          |
|                              {Lex => 8          }                           |
|                              {Position => Up    }                           |
+-----------------------------------------------------------------------------+

+-----------------------------------------------------------------------------+
|i9 : Q={{{1,1},{2,2}},{{2,1},{3,2}},{{2,2},{3,3}}};                          |
+-----------------------------------------------------------------------------+
|i10 : I = polyoIdeal(Q,RingChoice=>1,TermOrder=> GRevLex);                   |
|                                                                             |
|o10 : Ideal of QQ[x   , x   , x   , x   , x   , x   , x   , x   ]            |
|                   3,3   3,2   3,1   2,3   2,2   2,1   1,2   1,1             |
+-----------------------------------------------------------------------------+
|i11 : R=ring I;                                                              |
+-----------------------------------------------------------------------------+
|i12 : describe R                                                             |
|                                                                             |
|o12 = QQ[x   , x   , x   , x   , x   , x   , x   , x   , Degrees => {8:1},   |
|          3,3   3,2   3,1   2,3   2,2   2,1   1,2   1,1                      |
|-----------------------------------------------------------------------------|
|Heft => {1}]                                                                 |
+-----------------------------------------------------------------------------+

PolyoRingConvex

A very interesting class of collections of cells which are studied from a
combinatorial point of view is given by the weakly connected and convex ones.
Let $\mathcal{P}$ be a collection of cells. We say that $\mathcal{P}$ is weakly
connected if for any two cells $C$ and $D$ of $\mathcal{P}$, there exist a
sequence of cells of $\mathcal{P}$ as $C = C_1,\dots, C_m = D$ such that $C_i
\cap C_{i+1} \neq \emptyset$, for $i = 1,\dots, m − 1$. Observe trivially that
every polyomino is a weakly connected collection of cells. We say that a weakly
connected collection $\mathcal{P}$ of cells is row convex, if the horizontal
cell interval $[A, B]$ is contained in $\mathcal{P}$ for any two cells $A$ and
$B$ of $\mathcal{P}$ whose lower left corners are in horizontal position.
Similarly one defines column convex. Hence $\mathcal{P}$ is called convex if it
is row and column convex.
Assume that the smallest interval containing $\mathcal{P}$ is $[(1,1),(m,n)]$.
Consider the edge ring $R = K[s_it_j: (i, j) \in V (\mathcal{P})]$ associated
to the bipartite graph $G$ with vertex set $\{s_1,\dots, s_m\} \cup\{t_1,\dots,
t_n\}$ to $\mathcal{P}$ such that each vertex $(i, j) \in V (\mathcal{P})$
determines the edge $\{s_i,t_j \}$ in $G$. Let $S=K[x_a:a\in V(\mathcal{P})$
and $\phi : S \rightarrow R$ be the $K$-algebra homomorphism defined by
$\phi(x_{ij} ) = s_it_j$, for all $(i, j) \in V (\mathcal{P})$ and set
$J_\mathcal{P} = ker(\phi)$. From Theorem 2.1 of [AAQ2012], we know that
$I_{\mathcal{P}}=J_{\mathcal{P}}$, if $\mathcal{P}$ is a weakly connected and
convex collection of cells. In such a case, from [OH1999] we get that the
generators of $I_{\mathcal{P}}$ forms the reduced Groebner basis with respect
to a suitable order <, and in particular the initial ideal
$\mathrm{in}_<(I_{\mathcal{P}})$ is squarefree and generated in degree two.
Following the proof in [OH1999], this routine implements an algorithm which
gives the polynomial ring where the monomial order is <.

If $\mathcal{P}$ is a weakly connected and convex collection of cells (or in
particular a convex polyomino), then the function polyoRingConvex returns the
polynomial ring attached to $\mathcal{P}$ whose monomial order $<$ is such that
$\mathrm{in}_<(I_{\mathcal{P}})$ is squarefree and generated in degree two.

Literature
  * [AAQ2012] Ideals generated by 2-minors, collections of cells and stack
    polyominoes (A. A. Qureshi, 2012,  J. Algebra).
  * [OH1999] Koszul bipartite graphs (H. Ohsugi and T. Hibi, 1999, Adv. Appl.
    Math. 22,  25-28).

Examples

+-----------------------------------------------------------------------------+
|i13 : Q={{{1, 2}, {2, 3}}, {{2, 2}, {3, 3}}, {{1, 3}, {2, 4}}, {{2, 3}, {3,  |
|-----------------------------------------------------------------------------|
|4}}, {{2, 4}, {3, 5}}, {{3, 2}, {4, 3}}, {{3, 1}, {4, 2}}};                  |
+-----------------------------------------------------------------------------+
|i14 : I = polyoIdeal(Q,RingChoice=>2);                                       |
|                                                                             |
|o14 : Ideal of QQ[x   , x   , x   , x   , x   , x   , x   , x   , x   , x   ,|
|                   2,5   3,5   1,4   2,4   3,4   4,1   3,1   1,2   2,2   4,2 |
|-----------------------------------------------------------------------------|
|x   , x   , x   , x   , x   ]                                                |
| 3,2   1,3   2,3   4,3   3,3                                                 |
+-----------------------------------------------------------------------------+
|i15 : R=ring I;                                                              |
+-----------------------------------------------------------------------------+
|i16 : describe R                                                             |
|                                                                             |
|o16 = QQ[x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , x   ,   |
|          2,5   3,5   1,4   2,4   3,4   4,1   3,1   1,2   2,2   4,2   3,2    |
|                                                                             |
|-----------------------------------------------------------------------------|
|x   , x   , x   , x   , Degrees => {15:1}, Heft => {1}, MonomialOrder =>     |
| 1,3   2,3   4,3   3,3                                                       |
|                                                                             |
|-----------------------------------------------------------------------------|
|{MonomialSize => 32}, Global => false]                                       |
|{RevLex => 15      }                                                         |
|{Position => Up    }                                                         |
+-----------------------------------------------------------------------------+

+-----------------------------------------------------------------------------+
|i17 : Q={{{1, 3}, {2, 4}}, {{2, 2}, {3, 3}}, {{2, 3}, {3, 4}}, {{2, 4}, {3,  |
|-----------------------------------------------------------------------------|
|5}}, {{3, 4}, {4, 5}}, {{3, 3}, {4, 4}}, {{3, 2}, {4, 3}}, {{3, 1}, {4, 2}}, |
|-----------------------------------------------------------------------------|
|{{3, 5}, {4, 6}}, {{4, 4}, {5, 5}}, {{4, 3}, {5, 4}}, {{5, 4}, {6, 5}}};     |
+-----------------------------------------------------------------------------+
|i18 : I = polyoIdeal(Q,RingChoice=>2);                                       |
|                                                                             |
|o18 : Ideal of QQ[x   , x   , x   , x   , x   , x   , x   , x   , x   , x   ,|
|                   3,6   4,6   3,1   4,1   2,2   3,2   4,2   1,3   5,3   2,3 |
|-----------------------------------------------------------------------------|
|x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , x   ]|
| 3,3   4,3   6,5   5,5   2,5   3,5   4,5   1,4   6,4   5,4   2,4   3,4   4,4 |
+-----------------------------------------------------------------------------+
|i19 : In= monomialIdeal(leadTerm(I))                                         |
|                                                                             |
|o19 = monomialIdeal (x   x   , x   x   , x   x   , x   x   , x   x   ,       |
|                      4,6 3,1   4,6 3,2   4,1 3,2   3,2 2,3   4,2 2,3        |
|      -----------------------------------------------------------------------|
|      x   x   , x   x   , x   x   , x   x   , x   x   , x   x   , x   x   ,  |
|       4,6 3,3   4,1 3,3   4,2 3,3   2,3 5,5   3,3 5,5   4,3 5,5   3,2 2,5   |
|      -----------------------------------------------------------------------|
|      x   x   , x   x   , x   x   , x   x   , x   x   , x   x   , x   x   ,  |
|       4,2 2,5   3,3 2,5   4,3 2,5   4,6 3,5   4,1 3,5   4,2 3,5   4,3 3,5   |
|      -----------------------------------------------------------------------|
|      x   x   , x   x   , x   x   , x   x   , x   x   , x   x   , x   x   ,  |
|       5,3 1,4   2,3 1,4   3,3 1,4   4,3 1,4   5,5 6,4   2,5 6,4   3,5 6,4   |
|      -----------------------------------------------------------------------|
|      x   x   , x   x   , x   x   , x   x   , x   x   , x   x   , x   x   ,  |
|       4,5 6,4   2,3 5,4   3,3 5,4   4,3 5,4   2,5 5,4   3,5 5,4   4,5 5,4   |
|      -----------------------------------------------------------------------|
|      x   x   , x   x   , x   x   , x   x   , x   x   , x   x   , x   x   ,  |
|       3,2 2,4   4,2 2,4   3,3 2,4   4,3 2,4   3,5 2,4   4,5 2,4   4,6 3,4   |
|      -----------------------------------------------------------------------|
|      x   x   , x   x   , x   x   , x   x   )                                |
|       4,1 3,4   4,2 3,4   4,3 3,4   4,5 3,4                                 |
|                                                                             |
|o19 : MonomialIdeal of QQ[x   , x   , x   , x   , x   , x   , x   , x   , x  |
|                           3,6   4,6   3,1   4,1   2,2   3,2   4,2   1,3   5,|
|-----------------------------------------------------------------------------|
| , x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , x   , x   ,   |
|3   2,3   3,3   4,3   6,5   5,5   2,5   3,5   4,5   1,4   6,4   5,4   2,4    |
|-----------------------------------------------------------------------------|
|x   , x   ]                                                                  |
| 3,4   4,4                                                                   |
+-----------------------------------------------------------------------------+

See also
========

  * polyoIdeal -- Ideal of inner 2-minors of a collection of
    cells

Functions with optional argument named RingChoice :
===================================================

  * "polyoIdeal(...,RingChoice=>...)"

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

The object RingChoice, is a symbol (Macaulay2Doc).