<<

Tutorial

Andreas Steenpass

TU Kaiserslautern

Workshop on Computational Commutative Algebra IPM, Tehran, Iran July 2-7, 2011 Table of Contents

1 Getting started with Singular by examples

Andreas Steenpass Singular Tutorial Table of Contents

1 Getting started with Singular by examples

2 Basic concepts of the mathematical background

Andreas Steenpass Singular Tutorial Table of Contents

1 Getting started with Singular by examples

2 Basic concepts of the mathematical background

3 Singular as a Software: Ressources and the Singular Community

Andreas Steenpass Singular Tutorial Table of Contents

1 Getting started with Singular by examples

2 Basic concepts of the mathematical background

3 Singular as a Software: Ressources and the Singular Community

4 Challenges in Computer Algebra

Andreas Steenpass Singular Tutorial Table of Contents

1 Getting started with Singular by examples

2 Basic concepts of the mathematical background

3 Singular as a Software: Ressources and the Singular Community

4 Challenges in Computer Algebra

5 Singular’s modstd.lib

Andreas Steenpass Singular Tutorial Table of Contents

1 Getting started with Singular by examples

2 Basic concepts of the mathematical background

3 Singular as a Software: Ressources and the Singular Community

4 Challenges in Computer Algebra

5 Singular’s modstd.lib

6 Schreyer’s Algorithm for Syzygies

Andreas Steenpass Singular Tutorial Table of Contents

1 Getting started with Singular by examples

2 Basic concepts of the mathematical background

3 Singular as a Software: Ressources and the Singular Community

4 Challenges in Computer Algebra

5 Singular’s modstd.lib

6 Schreyer’s Algorithm for Syzygies

7 Sudoku

Andreas Steenpass Singular Tutorial Table of Contents

1 Getting started with Singular by examples

2 Basic concepts of the mathematical background

3 Singular as a Software: Ressources and the Singular Community

4 Challenges in Computer Algebra

5 Singular’s modstd.lib

6 Schreyer’s Algorithm for Syzygies

7 Sudoku

8 Primary Decomposition with Singular

Andreas Steenpass Singular Tutorial Table of Contents

1 Getting started with Singular by examples

2 Basic concepts of the mathematical background

3 Singular as a Software: Ressources and the Singular Community

4 Challenges in Computer Algebra

5 Singular’s modstd.lib

6 Schreyer’s Algorithm for Syzygies

7 Sudoku

8 Primary Decomposition with Singular

Andreas Steenpass Singular Tutorial A first Singular session

Let’s assume that you have installed Singular successfully and that you can start a Singular session:

SINGULAR / Development A for Polynomial Computations / version 3-1-3 0< by: W. Decker, G.-M. Greuel, G. Pfister, H. Schoenemann \ March 2011 FB Mathematik der Universitaet, D-67653 Kaiserslautern \ // ** executing /home/steenpas/Singular/trunk/Singular/LIB/.singularrc >

Andreas Steenpass Singular Tutorial Rings and Ideals

Almost all Singular functions are ring-dependend, so first of all, Singular needs to know which ring you want to compute in. For Q[x, y, z] with the lexicographic ordering, simply type

> ring R = 0, (x,y,z), lp;

Andreas Steenpass Singular Tutorial Rings and Ideals

Almost all Singular functions are ring-dependend, so first of all, Singular needs to know which ring you want to compute in. For Q[x, y, z] with the lexicographic ordering, simply type

> ring R = 0, (x,y,z), lp;

An ideal in Singular is given by its generators, so for x + y + z − 1, x2+ y2+ z2 − 1, x3+ y3+ z3 − 1⊂ Q[x, y, z] we type

> ideal I = x+y+z-1, x2+y2+z2-1, x3+y3+z3-1;

Andreas Steenpass Singular Tutorial The groebner command

Now compute a Groebner basis of this ideal:

> groebner(I); _[1]=z3-z2 _[2]=y2+yz-y+z2-z _[3]=x+y+z-1

Andreas Steenpass Singular Tutorial The groebner command

Now compute a Groebner basis of this ideal:

> groebner(I); _[1]=z3-z2 _[2]=y2+yz-y+z2-z _[3]=x+y+z-1

In the first equation of the new system, the variables x and y are eliminated. In the second equation, x is eliminated. As a consequence, the solutions can, now, be directly read off:

(1, 0, 0), (0, 1, 0), (0, 0, 1).

Andreas Steenpass Singular Tutorial The groebner command

Now compute a Groebner basis of this ideal:

> groebner(I); _[1]=z3-z2 _[2]=y2+yz-y+z2-z _[3]=x+y+z-1

In the first equation of the new system, the variables x and y are eliminated. In the second equation, x is eliminated. As a consequence, the solutions can, now, be directly read off:

(1, 0, 0), (0, 1, 0), (0, 0, 1).

Note: Groebner bases computations can produce unexpectedly large output!

Andreas Steenpass Singular Tutorial intersect

Many other computations in modern computer algebra rely on Groebner bases and their several generalisations. An example is intersect:

> ring R = 0, (x,y,z), dp; > ideal I1 = x, y; > ideal I2 = y2, z; > intersect(I1, I2); _[1]=yz _[2]=xz _[3]=y2

Andreas Steenpass Singular Tutorial factorize

Other algorithms such as factorization do not depend on Groebner bases. We use Singular to factorize a polynomial in Q[x, y, z]. The second entry of the output indicates the multiplicities of the factors:

> ring R = 0, (x,y,z), dp; > poly f = x5y4-x4y5+2x3y6-2x2y7+xy8-y9+x8z-2x6y2z-7x4y4z-4x2y6z . +2x3y4z2-2x2y5z2+2xy6z2-2y7z2+2x6z3-6x4y2z3-8x2y4z3+xy4z4-y5z4 . +x4z5-4x2y2z5; > factorize(f); [1]: _[1]=1 _[2]=xy4-y5+x4z-4x2y2z _[3]=x2+y2+z2 [2]: 1,1,2

Andreas Steenpass Singular Tutorial factorize

Other algorithms such as factorization do not depend on Groebner bases. We use Singular to factorize a polynomial in Q[x, y, z]. The second entry of the output indicates the multiplicities of the factors:

> ring R = 0, (x,y,z), dp; > poly f = x5y4-x4y5+2x3y6-2x2y7+xy8-y9+x8z-2x6y2z-7x4y4z-4x2y6z . +2x3y4z2-2x2y5z2+2xy6z2-2y7z2+2x6z3-6x4y2z3-8x2y4z3+xy4z4-y5z4 . +x4z5-4x2y2z5; > factorize(f); [1]: _[1]=1 _[2]=xy4-y5+x4z-4x2y2z _[3]=x2+y2+z2 [2]: 1,1,2

Note: factorize does not even depend on the monomial ordering.

Andreas Steenpass Singular Tutorial Ideal Membership

Given an ideal I and a polynomial f , Groebner (or more general: standard) bases can be used to decide wether or not it f is contained in I .

Andreas Steenpass Singular Tutorial Ideal Membership

Given an ideal I and a polynomial f , Groebner (or more general: standard) bases can be used to decide wether or not it f is contained in I . In terms of Singular code, the following holds: The polynomial f is contained in I if and only if NF(f, std(I)); evaluates to 0.

Andreas Steenpass Singular Tutorial Ideal Membership

Given an ideal I and a polynomial f , Groebner (or more general: standard) bases can be used to decide wether or not it f is contained in I . In terms of Singular code, the following holds: The polynomial f is contained in I if and only if NF(f, std(I)); evaluates to 0.

> ring R = 0, (x, y), dp; > ideal I = x10+x9y2, y8-x2y7; > ideal J = std(I); > poly f = x2y7+y14; > poly g = xy13+y12; > NF(f, J); -xy12+y8 // f is not in I > NF(g, J); 0 // g is in I

Andreas Steenpass Singular Tutorial Table of Contents

1 Getting started with Singular by examples

2 Basic concepts of the mathematical background

3 Singular as a Software: Ressources and the Singular Community

4 Challenges in Computer Algebra

5 Singular’s modstd.lib

6 Schreyer’s Algorithm for Syzygies

7 Sudoku

8 Primary Decomposition with Singular

Andreas Steenpass Singular Tutorial Groebner Bases

What is a Groebner Basis?

Andreas Steenpass Singular Tutorial Groebner Bases

What is a Groebner Basis?

Use monomial orders on K[x1,..., xn] which are well-orders.

Andreas Steenpass Singular Tutorial Groebner Bases

What is a Groebner Basis?

Use monomial orders on K[x1,..., xn] which are well-orders. For instance:

α β x >lp x ⇐⇒ the first nonzero entry of α − β is positive

(lexicographic order).

Andreas Steenpass Singular Tutorial Groebner Bases

What is a Groebner Basis?

Use monomial orders on K[x1,..., xn] which are well-orders. For instance:

α β x >lp x ⇐⇒ the first nonzero entry of α − β is positive

(lexicographic order). Or:

α β α β α β x >dp x ⇐⇒ deg x > deg x , or (deg x = deg x and the last nonzero entry of α − β ∈ Zn is negative).

(degree reverse lexicographic order).

Andreas Steenpass Singular Tutorial Groebner Bases

Given a monomial order on K[x1,..., xn], the terms of every polynomial f ∈ K[x1,..., xn] are sorted accordingly.

Andreas Steenpass Singular Tutorial Groebner Bases

Given a monomial order on K[x1,..., xn], the terms of every polynomial f ∈ K[x1,..., xn] are sorted accordingly. For instance:

f = xz + y 2 + yz (lp) or f = y 2 + xz + yz. (dp) We can, then, speak of the leading term L(f ).

Andreas Steenpass Singular Tutorial Groebner Bases

Given a monomial order on K[x1,..., xn], the terms of every polynomial f ∈ K[x1,..., xn] are sorted accordingly. For instance:

f = xz + y 2 + yz (lp) or f = y 2 + xz + yz. (dp) We can, then, speak of the leading term L(f ). Given an ideal r I = f1,..., fr = gi fi | gi ∈ K[x1,..., xn] , i =1 we have the leading ideal L(I ) := L(f ) f ∈ I .

Andreas Steenpass Singular Tutorial Groebner Bases

A set g1,..., gs ∈ I of polynomials is called a Groebner basis for I if the leading terms L(gi ) generate L(I ).

Andreas Steenpass Singular Tutorial Groebner Bases

A set g1,..., gs ∈ I of polynomials is called a Groebner basis for I if the leading terms L(gi ) generate L(I ). The use made of Groebner bases relies on the following two ”facts”:

Andreas Steenpass Singular Tutorial Groebner Bases

A set g1,..., gs ∈ I of polynomials is called a Groebner basis for I if the leading terms L(gi ) generate L(I ). The use made of Groebner bases relies on the following two ”facts”: L(I ) carries plenty of information on I .

Andreas Steenpass Singular Tutorial Groebner Bases

A set g1,..., gs ∈ I of polynomials is called a Groebner basis for I if the leading terms L(gi ) generate L(I ). The use made of Groebner bases relies on the following two ”facts”: L(I ) carries plenty of information on I . Information on I is typically obtained by purely combinatorial means.

Andreas Steenpass Singular Tutorial Groebner Bases

A set g1,..., gs ∈ I of polynomials is called a Groebner basis for I if the leading terms L(gi ) generate L(I ). The use made of Groebner bases relies on the following two ”facts”: L(I ) carries plenty of information on I . Information on I is typically obtained by purely combinatorial means. For instance, due to a classical result of Macaulay, the monomials not contained in L(I ) define a K-basis of the quotient ring K[x1,..., xn]/I .

Andreas Steenpass Singular Tutorial Buchberger’s criterion

Definition

Let f , g ∈ K[x1,..., xn] be polynomials and let lcm be the least common multiple of their leading monomials LM(f ) and LM(g). We define the s-polynomial of f and g to be

lcm LC(f ) lcm spoly(f , g) := f − g . LM(f ) LC(g) LM(g)

Andreas Steenpass Singular Tutorial Buchberger’s criterion

Definition

Let f , g ∈ K[x1,..., xn] be polynomials and let lcm be the least common multiple of their leading monomials LM(f ) and LM(g). We define the s-polynomial of f and g to be

lcm LC(f ) lcm spoly(f , g) := f − g . LM(f ) LC(g) LM(g)

Theorem (Buchberger)

F := (f1,..., fm) ⊂ K[x1,..., xn] \ {0} is a Groebner basis of the ideal I := f1,..., fm iff all s-polynomials spoly(fi , fj ) reduce to 0 w. r. t. F .

Andreas Steenpass Singular Tutorial Buchberger’s criterion

Definition

Let f , g ∈ K[x1,..., xn] be polynomials and let lcm be the least common multiple of their leading monomials LM(f ) and LM(g). We define the s-polynomial of f and g to be

lcm LC(f ) lcm spoly(f , g) := f − g . LM(f ) LC(g) LM(g)

Theorem (Buchberger)

F := (f1,..., fm) ⊂ K[x1,..., xn] \ {0} is a Groebner basis of the ideal I := f1,..., fm iff all s-polynomials spoly(fi , fj ) reduce to 0 w. r. t. F. (i. e. their remainder is 0 when divided by F .)

Andreas Steenpass Singular Tutorial Buchberger’s algorithm

Based on Buchberger’s criterion, there is an rather obvious algorithm to compute Groebner bases:

Andreas Steenpass Singular Tutorial Buchberger’s algorithm

Based on Buchberger’s criterion, there is an rather obvious algorithm to compute Groebner bases: Algorithm

Input: A set F := (f1,..., fm) ⊂ K[x1,..., xn] \ {0} of polys.

Andreas Steenpass Singular Tutorial Buchberger’s algorithm

Based on Buchberger’s criterion, there is an rather obvious algorithm to compute Groebner bases: Algorithm

Input: A set F := (f1,..., fm) ⊂ K[x1,..., xn] \ {0} of polys. Output: A Groebner basis G = (f1,..., fm, fm+1,..., fr ) of the ideal I := f1,..., fm.

Andreas Steenpass Singular Tutorial Buchberger’s algorithm

Based on Buchberger’s criterion, there is an rather obvious algorithm to compute Groebner bases: Algorithm

Input: A set F := (f1,..., fm) ⊂ K[x1,..., xn] \ {0} of polys. Output: A Groebner basis G = (f1,..., fm, fm+1,..., fr ) of the ideal I := f1,..., fm.

1 Compute all s-polynomials spoly(fi , fj ) for fi , fj ∈ F .

Andreas Steenpass Singular Tutorial Buchberger’s algorithm

Based on Buchberger’s criterion, there is an rather obvious algorithm to compute Groebner bases: Algorithm

Input: A set F := (f1,..., fm) ⊂ K[x1,..., xn] \ {0} of polys. Output: A Groebner basis G = (f1,..., fm, fm+1,..., fr ) of the ideal I := f1,..., fm.

1 Compute all s-polynomials spoly(fi , fj ) for fi , fj ∈ F . 2 Compute the remainders of these s-polys when divided by F.

Andreas Steenpass Singular Tutorial Buchberger’s algorithm

Based on Buchberger’s criterion, there is an rather obvious algorithm to compute Groebner bases: Algorithm

Input: A set F := (f1,..., fm) ⊂ K[x1,..., xn] \ {0} of polys. Output: A Groebner basis G = (f1,..., fm, fm+1,..., fr ) of the ideal I := f1,..., fm.

1 Compute all s-polynomials spoly(fi , fj ) for fi , fj ∈ F . 2 Compute the remainders of these s-polys when divided by F. 3 If there are non-zero remainders, set F := F ∪ {non-zero remainders} and continue with step 1.

Andreas Steenpass Singular Tutorial Buchberger’s algorithm

Based on Buchberger’s criterion, there is an rather obvious algorithm to compute Groebner bases: Algorithm

Input: A set F := (f1,..., fm) ⊂ K[x1,..., xn] \ {0} of polys. Output: A Groebner basis G = (f1,..., fm, fm+1,..., fr ) of the ideal I := f1,..., fm.

1 Compute all s-polynomials spoly(fi , fj ) for fi , fj ∈ F . 2 Compute the remainders of these s-polys when divided by F. 3 If there are non-zero remainders, set F := F ∪ {non-zero remainders} and continue with step 1. 4 If all the s-polynomials reduce to zero, set G := F .

Andreas Steenpass Singular Tutorial Buchberger’s algorithm

Based on Buchberger’s criterion, there is an rather obvious algorithm to compute Groebner bases: Algorithm

Input: A set F := (f1,..., fm) ⊂ K[x1,..., xn] \ {0} of polys. Output: A Groebner basis G = (f1,..., fm, fm+1,..., fr ) of the ideal I := f1,..., fm.

1 Compute all s-polynomials spoly(fi , fj ) for fi , fj ∈ F . 2 Compute the remainders of these s-polys when divided by F. 3 If there are non-zero remainders, set F := F ∪ {non-zero remainders} and continue with step 1. 4 If all the s-polynomials reduce to zero, set G := F .

This process stops due to K[x1,..., xn] being Noetherian.

Andreas Steenpass Singular Tutorial Normal forms

When dividing a polynomial f by a set of polynomials F as above, the remainder is in general not uniquely determined.

Andreas Steenpass Singular Tutorial Normal forms

When dividing a polynomial f by a set of polynomials F as above, the remainder is in general not uniquely determined. Groebner bases can help us to overcome this issue: Proposition

Let I ⊂ K[x1,..., xn] be an ideal and let F = (f1,..., fm) ⊂ K[x1,..., xn] be a Groebner basis of I. Then for any polynomial f ∈ K[x1,..., xn], division by F yields a uniquely determined remainder r ∈ K[x1,..., xn] with f − r ∈ I.

Andreas Steenpass Singular Tutorial Normal Forms

Definition

Let R := K[x1,..., xn] and let G be the set of all finite sets G ⊂ R.

Andreas Steenpass Singular Tutorial Normal Forms

Definition

Let R := K[x1,..., xn] and let G be the set of all finite sets G ⊂ R.

NF : R ×G→ R, (f , G) → NF(f |G) , is called a normal form on R if, for all f ∈ R and all G ∈ G,

Andreas Steenpass Singular Tutorial Normal Forms

Definition

Let R := K[x1,..., xn] and let G be the set of all finite sets G ⊂ R.

NF : R ×G→ R, (f , G) → NF(f |G) , is called a normal form on R if, for all f ∈ R and all G ∈ G,

1 NF(0|G) = 0,

Andreas Steenpass Singular Tutorial Normal Forms

Definition

Let R := K[x1,..., xn] and let G be the set of all finite sets G ⊂ R.

NF : R ×G→ R, (f , G) → NF(f |G) , is called a normal form on R if, for all f ∈ R and all G ∈ G,

1 NF(0|G) = 0, 2 NF(f |G) = 0 ⇒ LM(NF(f |G)) ∈/ L(G).

Andreas Steenpass Singular Tutorial Normal Forms

Definition

Let R := K[x1,..., xn] and let G be the set of all finite sets G ⊂ R.

NF : R ×G→ R, (f , G) → NF(f |G) , is called a normal form on R if, for all f ∈ R and all G ∈ G,

1 NF(0|G) = 0, 2 NF(f |G) = 0 ⇒ LM(NF(f |G)) ∈/ L(G).

3 If G = {g1,..., gs }, then f − NF(f |G) has a standard representation with respect to G, that is,

s f − NF(f |G)= ai gi , ai ∈ R, s ≥ 0 , i =1

Andreas Steenpass Singular Tutorial Normal Forms

Definition

Let R := K[x1,..., xn] and let G be the set of all finite sets G ⊂ R.

NF : R ×G→ R, (f , G) → NF(f |G) , is called a normal form on R if, for all f ∈ R and all G ∈ G,

1 NF(0|G) = 0, 2 NF(f |G) = 0 ⇒ LM(NF(f |G)) ∈/ L(G).

3 If G = {g1,..., gs }, then f − NF(f |G) has a standard representation with respect to G, that is,

s f − NF(f |G)= ai gi , ai ∈ R, s ≥ 0 , i =1 s satisfying LM( i=1 ai gi ) ≥ LM(ai gi ) for all i with ai gi = 0. Andreas Steenpass Singular Tutorial Normal Forms

Thus in the above definition, the remainder r is a normal form of f on R.

Andreas Steenpass Singular Tutorial Normal Forms

Thus in the above definition, the remainder r is a normal form of f on R. Note, however, that in general there do exist several normal forms on R.

Andreas Steenpass Singular Tutorial Normal Forms

Thus in the above definition, the remainder r is a normal form of f on R. Note, however, that in general there do exist several normal forms on R. Corollary It follows directly from the definition that for any Groebner basis G it holds f ∈ G ⇔ NF(f |G) = 0.

Andreas Steenpass Singular Tutorial Normal Forms

Thus in the above definition, the remainder r is a normal form of f on R. Note, however, that in general there do exist several normal forms on R. Corollary It follows directly from the definition that for any Groebner basis G it holds f ∈ G ⇔ NF(f |G) = 0.

We have thus solved the ideal membership problem.

Andreas Steenpass Singular Tutorial Table of Contents

1 Getting started with Singular by examples

2 Basic concepts of the mathematical background

3 Singular as a Software: Ressources and the Singular Community

4 Challenges in Computer Algebra

5 Singular’s modstd.lib

6 Schreyer’s Algorithm for Syzygies

7 Sudoku

8 Primary Decomposition with Singular

Andreas Steenpass Singular Tutorial Singular: Basic Facts

Singular is a computer algebra system for polynomial computations, with special emphasis on commutative and non-commutative algebra, , and singularity theory.

Andreas Steenpass Singular Tutorial Singular: Basic Facts

Singular is a computer algebra system for polynomial computations, with special emphasis on commutative and non-commutative algebra, algebraic geometry, and singularity theory. It is free and open-source under the GNU General Public Licence.

Andreas Steenpass Singular Tutorial Singular: Basic Facts

Singular is a computer algebra system for polynomial computations, with special emphasis on commutative and non-commutative algebra, algebraic geometry, and singularity theory. It is free and open-source under the GNU General Public Licence. Singular consists of a kernel, written in /C++, and containing the core algorithms,

Andreas Steenpass Singular Tutorial Singular: Basic Facts

Singular is a computer algebra system for polynomial computations, with special emphasis on commutative and non-commutative algebra, algebraic geometry, and singularity theory. It is free and open-source under the GNU General Public Licence. Singular consists of a kernel, written in C/C++, and containing the core algorithms, libraries, written in Singular’s programming language with C-like syntax,

Andreas Steenpass Singular Tutorial Singular: Basic Facts

Singular is a computer algebra system for polynomial computations, with special emphasis on commutative and non-commutative algebra, algebraic geometry, and singularity theory. It is free and open-source under the GNU General Public Licence. Singular consists of a kernel, written in C/C++, and containing the core algorithms, libraries, written in Singular’s programming language with C-like syntax, which have greatly augmented the kernel functionality, and which make Singular user-extendible,

Andreas Steenpass Singular Tutorial Singular: Basic Facts

Singular is a computer algebra system for polynomial computations, with special emphasis on commutative and non-commutative algebra, algebraic geometry, and singularity theory. It is free and open-source under the GNU General Public Licence. Singular consists of a kernel, written in C/C++, and containing the core algorithms, libraries, written in Singular’s programming language with C-like syntax, which have greatly augmented the kernel functionality, and which make Singular user-extendible, a comprehensive online manual and help function.

Andreas Steenpass Singular Tutorial Singular: Capabilities

Singular’s main computational objects are ideals and modules over a large number of baserings. These include polynomial rings over various ground fields and a few rings (including the integers),

Andreas Steenpass Singular Tutorial Singular: Capabilities

Singular’s main computational objects are ideals and modules over a large number of baserings. These include polynomial rings over various ground fields and a few rings (including the integers), localizations of the above,

Andreas Steenpass Singular Tutorial Singular: Capabilities

Singular’s main computational objects are ideals and modules over a large number of baserings. These include polynomial rings over various ground fields and a few rings (including the integers), localizations of the above, a very general class of non-commutative algebras (including the exterior algebra and the Weyl algebra),

Andreas Steenpass Singular Tutorial Singular: Capabilities

Singular’s main computational objects are ideals and modules over a large number of baserings. These include polynomial rings over various ground fields and a few rings (including the integers), localizations of the above, a very general class of non-commutative algebras (including the exterior algebra and the Weyl algebra), quotient rings of the above.

Andreas Steenpass Singular Tutorial Singular Developer Teams

Andreas Steenpass Singular Tutorial Table of Contents

1 Getting started with Singular by examples

2 Basic concepts of the mathematical background

3 Singular as a Software: Ressources and the Singular Community

4 Challenges in Computer Algebra

5 Singular’s modstd.lib

6 Schreyer’s Algorithm for Syzygies

7 Sudoku

8 Primary Decomposition with Singular

Andreas Steenpass Singular Tutorial Computer Algebra

Computer algebra systems such as CoCoA or Singular can be, and in fact they are, used quite successfully for theoretical mathematical research.

Andreas Steenpass Singular Tutorial Computer Algebra

Computer algebra systems such as CoCoA or Singular can be, and in fact they are, used quite successfully for theoretical mathematical research. There are also a lot of other scientific disciplines which make use of computational algebra such as e.g. phylogenetics, computer chip design, or cryptography.

Andreas Steenpass Singular Tutorial Computer Algebra

Computer algebra systems such as CoCoA or Singular can be, and in fact they are, used quite successfully for theoretical mathematical research. There are also a lot of other scientific disciplines which make use of computational algebra such as e.g. phylogenetics, computer chip design, or cryptography. The computational problems which arise from these areas can be quite challenging; some of them even could not yet be solved by any software on any computer.

Andreas Steenpass Singular Tutorial Computer Algebra

What is needed to tackle these challenges are not (only) more powerful computers and more involved implementations of the same algorithms, but new, more advanced (mathematical) algorithms. This makes computer algebra a branch of mathematics itself.

Andreas Steenpass Singular Tutorial Computer Algebra

What is needed to tackle these challenges are not (only) more powerful computers and more involved implementations of the same algorithms, but new, more advanced (mathematical) algorithms. This makes computer algebra a branch of mathematics itself. E.g., in order to make use of computer clusters or modern processors which typically contain of several cores, we have to design parallel algorithms. In the important case of Groebner bases, this is not at all a trivial task because parallel implementations of Buchberger’s algorithm are quite inefficient.

Andreas Steenpass Singular Tutorial Computer Algebra

What is needed to tackle these challenges are not (only) more powerful computers and more involved implementations of the same algorithms, but new, more advanced (mathematical) algorithms. This makes computer algebra a branch of mathematics itself. E.g., in order to make use of computer clusters or modern processors which typically contain of several cores, we have to design parallel algorithms. In the important case of Groebner bases, this is not at all a trivial task because parallel implementations of Buchberger’s algorithm are quite inefficient. One possible way to overcome this problem is to use modular techniques. If we want to compute a Groebner basis in characteristic 0, we can compute it modulo several primes first and then lift the result via chinese remaindering.

Andreas Steenpass Singular Tutorial Table of Contents

1 Getting started with Singular by examples

2 Basic concepts of the mathematical background

3 Singular as a Software: Ressources and the Singular Community

4 Challenges in Computer Algebra

5 Singular’s modstd.lib

6 Schreyer’s Algorithm for Syzygies

7 Sudoku

8 Primary Decomposition with Singular

Andreas Steenpass Singular Tutorial Modular Standard Bases

Idea of modStd to compute a standard basis G of an ideal I :

1 compute standard bases Gp modulo several primes p

Andreas Steenpass Singular Tutorial Modular Standard Bases

Idea of modStd to compute a standard basis G of an ideal I :

1 compute standard bases Gp modulo several primes p 2 delete unlucky primes: delete p if LM(Ip) = LM(Iq) for most primes q = p

Andreas Steenpass Singular Tutorial Modular Standard Bases

Idea of modStd to compute a standard basis G of an ideal I :

1 compute standard bases Gp modulo several primes p 2 delete unlucky primes: delete p if LM(Ip) = LM(Iq) for most primes q = p 3 lift the result via Chinese remainder algorithm and Farey rational map: obtain G

Andreas Steenpass Singular Tutorial Modular Standard Bases

Idea of modStd to compute a standard basis G of an ideal I :

1 compute standard bases Gp modulo several primes p 2 delete unlucky primes: delete p if LM(Ip) = LM(Iq) for most primes q = p 3 lift the result via Chinese remainder algorithm and Farey rational map: obtain G 4 pTestSB: test if (G mod p) is a s.b. of Ip for a new random prime p

Andreas Steenpass Singular Tutorial Modular Standard Bases

Idea of modStd to compute a standard basis G of an ideal I :

1 compute standard bases Gp modulo several primes p 2 delete unlucky primes: delete p if LM(Ip) = LM(Iq) for most primes q = p 3 lift the result via Chinese remainder algorithm and Farey rational map: obtain G 4 pTestSB: test if (G mod p) is a s.b. of Ip for a new random prime p 5 final verification tests: G is a standard basis of G and I ⊆ G

Andreas Steenpass Singular Tutorial Modular Standard Bases

Idea of modStd to compute a standard basis G of an ideal I :

1 compute standard bases Gp modulo several primes p 2 delete unlucky primes: delete p if LM(Ip) = LM(Iq) for most primes q = p 3 lift the result via Chinese remainder algorithm and Farey rational map: obtain G 4 pTestSB: test if (G mod p) is a s.b. of Ip for a new random prime p 5 final verification tests: G is a standard basis of G and I ⊆ G 6 reiterate with further new primes if verification fails

Andreas Steenpass Singular Tutorial Modular Standard Bases

Verification is the hardest part of the algorithm. Singular’s method for this task is due to the following result.

Andreas Steenpass Singular Tutorial Modular Standard Bases

Verification is the hardest part of the algorithm. Singular’s method for this task is due to the following result.

Theorem (Arnold (homogeneous)/ Idrees, Pfister, Steidel (general for global & local orderings)) Let G ⊆ Q[X ] be a set of polynomials such that

Andreas Steenpass Singular Tutorial Modular Standard Bases

Verification is the hardest part of the algorithm. Singular’s method for this task is due to the following result.

Theorem (Arnold (homogeneous)/ Idrees, Pfister, Steidel (general for global & local orderings)) Let G ⊆ Q[X ] be a set of polynomials such that

LM(G) = LM(Gp) where Gp is a standard basis of Ip for some prime number p,

Andreas Steenpass Singular Tutorial Modular Standard Bases

Verification is the hardest part of the algorithm. Singular’s method for this task is due to the following result.

Theorem (Arnold (homogeneous)/ Idrees, Pfister, Steidel (general for global & local orderings)) Let G ⊆ Q[X ] be a set of polynomials such that

LM(G) = LM(Gp) where Gp is a standard basis of Ip for some prime number p, G is a standard basis of G,

Andreas Steenpass Singular Tutorial Modular Standard Bases

Verification is the hardest part of the algorithm. Singular’s method for this task is due to the following result.

Theorem (Arnold (homogeneous)/ Idrees, Pfister, Steidel (general for global & local orderings)) Let G ⊆ Q[X ] be a set of polynomials such that

LM(G) = LM(Gp) where Gp is a standard basis of Ip for some prime number p, G is a standard basis of G, I ⊆ G.

Andreas Steenpass Singular Tutorial Modular Standard Bases

Verification is the hardest part of the algorithm. Singular’s method for this task is due to the following result.

Theorem (Arnold (homogeneous)/ Idrees, Pfister, Steidel (general for global & local orderings)) Let G ⊆ Q[X ] be a set of polynomials such that

LM(G) = LM(Gp) where Gp is a standard basis of Ip for some prime number p, G is a standard basis of G, I ⊆ G. Then I = G.

Andreas Steenpass Singular Tutorial Modular Standard Bases and Parallel Computing

Remark The algorithm modStd can be parallelized in the following way:

Andreas Steenpass Singular Tutorial Modular Standard Bases and Parallel Computing

Remark The algorithm modStd can be parallelized in the following way:

1 Compute the standard bases Gp in parallel.

Andreas Steenpass Singular Tutorial Modular Standard Bases and Parallel Computing

Remark The algorithm modStd can be parallelized in the following way:

1 Compute the standard bases Gp in parallel. 2 Parallelize the final verification tests:

Andreas Steenpass Singular Tutorial Modular Standard Bases and Parallel Computing

Remark The algorithm modStd can be parallelized in the following way:

1 Compute the standard bases Gp in parallel. 2 Parallelize the final verification tests: Check if I ⊆ G by checking if f ∈ G for each generator.

Andreas Steenpass Singular Tutorial Modular Standard Bases and Parallel Computing

Remark The algorithm modStd can be parallelized in the following way:

1 Compute the standard bases Gp in parallel. 2 Parallelize the final verification tests: Check if I ⊆ G by checking if f ∈ G for each generator. Check if G is a standard basis of G by checking if every s–polynomial not excluded by well-known criteria, vanishes by reduction w.r.t. G.

Andreas Steenpass Singular Tutorial Modular Standard Bases and Parallel Computing

∗ ∗ Example std modStd modStd4 modStd9 cyclic8 - 8271 4120 2927 Paris.ilias13 37734 1159 676 580 homog.cyclic7 3343 3436 886 408 - 6 3 3

Table: Total running times (in sec) for computing a standard basis of examples chosen from The SymbolicData Project (H.-G. Gr¨abe) via std, ∗ modStd and its parallelized variant modStdn for n =4, 9.

Andreas Steenpass Singular Tutorial Modular Standard Bases and Parallel Computing

∗ ∗ Example std modStd modStd4 modStd9 cyclic8 - 8271 4120 2927 Paris.ilias13 37734 1159 676 580 homog.cyclic7 3343 3436 886 408 - 6 3 3

Table: Total running times (in sec) for computing a standard basis of examples chosen from The SymbolicData Project (H.-G. Gr¨abe) via std, ∗ modStd and its parallelized variant modStdn for n =4, 9.

Ref.: N. Idrees, G. Pfister, S. Steidel: Parallelization of Modular Algorithms. Journal of Symbolic Computation 46, 672-684 (2011).

Andreas Steenpass Singular Tutorial Table of Contents

1 Getting started with Singular by examples

2 Basic concepts of the mathematical background

3 Singular as a Software: Ressources and the Singular Community

4 Challenges in Computer Algebra

5 Singular’s modstd.lib

6 Schreyer’s Algorithm for Syzygies

7 Sudoku

8 Primary Decomposition with Singular

Andreas Steenpass Singular Tutorial Syzygies: Known Facts and Definitions

Given any ring R and elements f1,..., fr of an R-module M, a syzygy on f1,..., fr is a relation

g1f1 + + gr fr = 0 ∈ M,

with g1,..., gr ∈ R. We think of such a relation as a column t r vector (g1,..., gr ) ∈ R :

Andreas Steenpass Singular Tutorial Syzygies: Known Facts and Definitions

Given any ring R and elements f1,..., fr of an R-module M, a syzygy on f1,..., fr is a relation

g1f1 + + gr fr = 0 ∈ M,

with g1,..., gr ∈ R. We think of such a relation as a column t r vector (g1,..., gr ) ∈ R : Definition. Let R be a ring, let M be an R-module, and let f1,..., fr ∈ M.A syzygy on f1,..., fr is an element of the kernel of the homomorphism r φ : R → M, ǫi → fi , r where {ǫ1,...,ǫr } is the canonical basis of R . We call ker φ the (first) syzygy module of f1,..., fr , written

Syz(f1,..., fr ) = ker φ.

Andreas Steenpass Singular Tutorial Syzygies: Known Facts and Definitions

If Syz(f1,..., fr ) is finitely generated, we regard the elements of a given finite set of generators for it as the columns of a matrix which we call a syzygy matrix of f1,..., fr .

Andreas Steenpass Singular Tutorial Syzygies: Known Facts and Definitions

If Syz(f1,..., fr ) is finitely generated, we regard the elements of a given finite set of generators for it as the columns of a matrix which we call a syzygy matrix of f1,..., fr . Note that if R is Noetherian, then every submodule of a finitely generated R-module is finitely generated again.

Andreas Steenpass Singular Tutorial Syzygies: Known Facts and Definitions

If Syz(f1,..., fr ) is finitely generated, we regard the elements of a given finite set of generators for it as the columns of a matrix which we call a syzygy matrix of f1,..., fr . Note that if R is Noetherian, then every submodule of a finitely generated R-module is finitely generated again. Problem. Determine a syzygy matrix of x, y, z ∈ K[x, y, z].

Andreas Steenpass Singular Tutorial Syzygies: Known Facts and Definitions

If Syz(f1,..., fr ) is finitely generated, we regard the elements of a given finite set of generators for it as the columns of a matrix which we call a syzygy matrix of f1,..., fr . Note that if R is Noetherian, then every submodule of a finitely generated R-module is finitely generated again. Problem. Determine a syzygy matrix of x, y, z ∈ K[x, y, z]. To handle syzygies over polynomial rings, one has to extend the concept of Gr¨obner bases to free modules. In what follows, let s R = K[x1,..., xn], and let F be we the free R-module F = R with its canonical basis e1,..., es .

Andreas Steenpass Singular Tutorial Syzygies: Known Facts and Definitions

Definition. A monomial in F is a monomial in R times a basis α vector of F , that is, an element of the form x ei .

Andreas Steenpass Singular Tutorial Syzygies: Known Facts and Definitions

Definition. A monomial in F is a monomial in R times a basis α vector of F , that is, an element of the form x ei .A term in F is a α monomial in F times a scalar, that is, an element of type ax ei , where a ∈ K.

Andreas Steenpass Singular Tutorial Syzygies: Known Facts and Definitions

Definition. A monomial in F is a monomial in R times a basis α vector of F , that is, an element of the form x ei .A term in F is a α monomial in F times a scalar, that is, an element of type ax ei , where a ∈ K. A submodule of F which is generated by monomials is called a monomial submodule.

Andreas Steenpass Singular Tutorial Syzygies: Known Facts and Definitions

Definition. A monomial in F is a monomial in R times a basis α vector of F , that is, an element of the form x ei .A term in F is a α monomial in F times a scalar, that is, an element of type ax ei , where a ∈ K. A submodule of F which is generated by monomials is called a monomial submodule.A monomial order on F may be defined in the same way as a monomial ordering on R. That is, it is a total order > on the set of monomials in F satisfying

α β γ α γ β n x ei > x ej =⇒ x x ei > x x ej for each γ ∈ N .

Andreas Steenpass Singular Tutorial Syzygies: Known Facts and Definitions

Definition. A monomial in F is a monomial in R times a basis α vector of F , that is, an element of the form x ei .A term in F is a α monomial in F times a scalar, that is, an element of type ax ei , where a ∈ K. A submodule of F which is generated by monomials is called a monomial submodule.A monomial order on F may be defined in the same way as a monomial ordering on R. That is, it is a total order > on the set of monomials in F satisfying

α β γ α γ β n x ei > x ej =⇒ x x ei > x x ej for each γ ∈ N . We require in addition that

α β α β x ei > x ei ⇐⇒ x ej > x ej , for all i, j = 1,..., s.

Andreas Steenpass Singular Tutorial Syzygies: Known Facts and Definitions

Definition. A monomial in F is a monomial in R times a basis α vector of F , that is, an element of the form x ei .A term in F is a α monomial in F times a scalar, that is, an element of type ax ei , where a ∈ K. A submodule of F which is generated by monomials is called a monomial submodule.A monomial order on F may be defined in the same way as a monomial ordering on R. That is, it is a total order > on the set of monomials in F satisfying

α β γ α γ β n x ei > x ej =⇒ x x ei > x x ej for each γ ∈ N . We require in addition that

α β α β x ei > x ei ⇐⇒ x ej > x ej , for all i, j = 1,..., s. In this way, each monomial ordering on F induces a unique monomial ordering on R and notions like global and local carry over to monomial orderings on free modules. Andreas Steenpass Singular Tutorial Syzygies: Known Facts and Definitions

Finally, given a monomial order on F , we define the leading term, the leading coefficient, the leading monomial, and the tail of an element of F in the same way as for a polynomial in R.

Andreas Steenpass Singular Tutorial Syzygies: Known Facts and Definitions

Finally, given a monomial order on F , we define the leading term, the leading coefficient, the leading monomial, and the tail of an element of F in the same way as for a polynomial in R. With this basic notation, the whole concept of Gr¨obner bases including its fundamental algorithms extend.

Andreas Steenpass Singular Tutorial Computing Syzygies

Suppose now that G = {g1,,..., gt } is a Gr¨obner Basis for an ideal of R (in a similar way, what we will do works for submodules of a free R-module F ).

Andreas Steenpass Singular Tutorial Computing Syzygies

Suppose now that G = {g1,,..., gt } is a Gr¨obner Basis for an ideal of R (in a similar way, what we will do works for submodules of a free R-module F ). Then, if we have standard expressions

t spoly(gi , gj ) − NF(spoly(gi , gj ) | G)= ai gi , ai ∈ R , i =1 all remainders NF(spoly(gi , gj ) | G) are zero by Buchberger’s criterion.

Andreas Steenpass Singular Tutorial Computing Syzygies

Suppose now that G = {g1,,..., gt } is a Gr¨obner Basis for an ideal of R (in a similar way, what we will do works for submodules of a free R-module F ). Then, if we have standard expressions

t spoly(gi , gj ) − NF(spoly(gi , gj ) | G)= ai gi , ai ∈ R , i =1 all remainders NF(spoly(gi , gj ) | G) are zero by Buchberger’s (ij) criterion. We, thus, get syzygies G on g1,..., gt .

Andreas Steenpass Singular Tutorial Computing Syzygies

Suppose now that G = {g1,,..., gt } is a Gr¨obner Basis for an ideal of R (in a similar way, what we will do works for submodules of a free R-module F ). Then, if we have standard expressions

t spoly(gi , gj ) − NF(spoly(gi , gj ) | G)= ai gi , ai ∈ R , i =1 all remainders NF(spoly(gi , gj ) | G) are zero by Buchberger’s (ij) criterion. We, thus, get syzygies G on g1,..., gt . It turns out, that these syzygies generate all the syzygies on g1,,..., gt .

Andreas Steenpass Singular Tutorial Computing Syzygies

Suppose now that G = {g1,,..., gt } is a Gr¨obner Basis for an ideal of R (in a similar way, what we will do works for submodules of a free R-module F ). Then, if we have standard expressions

t spoly(gi , gj ) − NF(spoly(gi , gj ) | G)= ai gi , ai ∈ R , i =1 all remainders NF(spoly(gi , gj ) | G) are zero by Buchberger’s (ij) criterion. We, thus, get syzygies G on g1,..., gt . It turns out, that these syzygies generate all the syzygies on g1,,..., gt . In fact, we can say more.

Andreas Steenpass Singular Tutorial Syzygies: Schreyer ordering

In the situation above, starting from a global monomial ordering t on the free R-module F , consider the free R-module F0 = R with its canonical basis ǫ1,...,ǫt .

Andreas Steenpass Singular Tutorial Syzygies: Schreyer ordering

In the situation above, starting from a global monomial ordering t on the free R-module F , consider the free R-module F0 = R with its canonical basis ǫ1,...,ǫt . On F0, consider the induced monomial ordering defined as

α β α β x ǫi >0 x ǫj :⇐⇒ x LM(fi ) > x LM(fj ), or α β x LM(fi )= x LM(fj ) and i > j . Then >0 is a global monomial ordering on F0.

Andreas Steenpass Singular Tutorial Syzygies: Schreyer ordering

In the situation above, starting from a global monomial ordering t on the free R-module F , consider the free R-module F0 = R with its canonical basis ǫ1,...,ǫt . On F0, consider the induced monomial ordering defined as

α β α β x ǫi >0 x ǫj :⇐⇒ x LM(fi ) > x LM(fj ), or α β x LM(fi )= x LM(fj ) and i > j . Then >0 is a global monomial ordering on F0. The syzygies G (ij) and the induced monomial ordering are the key ingredients in Schreyer’s proof of Buchberger’s criterion. This proof also yields the following result:

Andreas Steenpass Singular Tutorial Syzygies: Schreyer’s Algorithm

Theorem (Schreyer). Let g1,..., gt ∈ F \ {0} form a Gr¨obner basis with respect to a global monomial ordering >. The syzygies (ij) G ∈ F0 arising from Buchberger’s criterion form a Gr¨obner basis for the syzygies on g1,..., gt with respect to the induced (ij) monomial ordering on F0. In particular, the G generate all syzygies on g1,..., gt .

Andreas Steenpass Singular Tutorial Syzygies: Schreyer’s Algorithm

Theorem (Schreyer). Let g1,..., gt ∈ F \ {0} form a Gr¨obner basis with respect to a global monomial ordering >. The syzygies (ij) G ∈ F0 arising from Buchberger’s criterion form a Gr¨obner basis for the syzygies on g1,..., gt with respect to the induced (ij) monomial ordering on F0. In particular, the G generate all syzygies on g1,..., gt .

If we start from an arbitrary set of generators f1,..., fr and compute a Gr¨obner basis f1,..., fr , fr+1,..., ft using Buchberger’s algorithm, the syzygies G (ij) either arise from a division with remainder zero or from a division leading to a new Gr¨obner basis element.

Andreas Steenpass Singular Tutorial Syzygies: Schreyer’s Algorithm

Theorem (Schreyer). Let g1,..., gt ∈ F \ {0} form a Gr¨obner basis with respect to a global monomial ordering >. The syzygies (ij) G ∈ F0 arising from Buchberger’s criterion form a Gr¨obner basis for the syzygies on g1,..., gt with respect to the induced (ij) monomial ordering on F0. In particular, the G generate all syzygies on g1,..., gt .

If we start from an arbitrary set of generators f1,..., fr and compute a Gr¨obner basis f1,..., fr , fr+1,..., ft using Buchberger’s algorithm, the syzygies G (ij) either arise from a division with remainder zero or from a division leading to a new Gr¨obner basis element. From the G (ij), the syzygies on the original generators are obtained by means of linear algebra.

Andreas Steenpass Singular Tutorial Syzygies: Example

Example.

> ring R = 0, (x,y,z), dp; > ideal I = x,y,z; > print(syz(I)); 0, -y,-z, -z,x, 0, y, 0, x

By iterating the process of computing syzygies, starting from a finitely generated R-module M, we get a free resolution of M:

o o ϕ0 o ϕ1 o o o ϕi oϕi+1 o 0 M F0 F1 . . . Fi−1 Fi Fi+1 . . .

Andreas Steenpass Singular Tutorial Syzygies: Example

We continue with our example:

> resolution FI = res(I, 0); > print(FI); [1]: _[1]=z _[2]=y _[3]=x [2]: _[1]=-y*gen(1)+z*gen(2) _[2]=-x*gen(1)+z*gen(3) _[3]=-x*gen(2)+y*gen(3) [3]: _[1]=x*gen(1)-y*gen(2)+z*gen(3)

Andreas Steenpass Singular Tutorial Syzygies: Example

> print(FI[2]); -y,-x,0, z, 0, -x, 0, z, y > print(FI[3]); x, -y, z

Andreas Steenpass Singular Tutorial Ideal Intersections via Syzygies

Syzygies can also be used to compute ideal intersections and ideal quotients.

Andreas Steenpass Singular Tutorial Ideal Intersections via Syzygies

Syzygies can also be used to compute ideal intersections and ideal quotients.

Given ideals I = f1,..., fr and J = g1,..., gs of K[x1,..., xn], compute the syzygies on the columns of the matrix

1 f . . . f 0 . . . 0 1 r . 1 0 . . . 0 g . . . g 1 s The entries of the first row of the resulting syzygy matrix generate I ∩ J.

Andreas Steenpass Singular Tutorial Quotient Ideals Syzygies

In the same way, we get generators for I : J from the matrix

g1 f1 . . . fr 0 ...... 0 g2 0 . . . 0 f1 . . . fr 0 . . . 0  . .  . . ..   gs 0 ...... 0 f . . . fr   1   

Andreas Steenpass Singular Tutorial Table of Contents

1 Getting started with Singular by examples

2 Basic concepts of the mathematical background

3 Singular as a Software: Ressources and the Singular Community

4 Challenges in Computer Algebra

5 Singular’s modstd.lib

6 Schreyer’s Algorithm for Syzygies

7 Sudoku

8 Primary Decomposition with Singular

Andreas Steenpass Singular Tutorial Sudoku

5 8 6 2 5 6 4 7 7 9 6 52 61 3 6 4 3 7 4 1 5 8 6 1

Andreas Steenpass Singular Tutorial Sudoku

To solve Sudokos, we proceed as follows:

Andreas Steenpass Singular Tutorial Sudoku

To solve Sudokos, we proceed as follows:

Associate to the places in a Sudoku the variables x1,..., x81 9 and to each variable xi the polynomial Fi (xi )= j=1(xi − j).

Andreas Steenpass Singular Tutorial Sudoku

To solve Sudokos, we proceed as follows:

Associate to the places in a Sudoku the variables x1,..., x81 9 and to each variable xi the polynomial Fi (xi )= j=1(xi − j). Let E = {(i, j) | i < j and (i, j) corresponds to a place in the same row, column or 3 × 3 − box}.

Andreas Steenpass Singular Tutorial Sudoku

To solve Sudokos, we proceed as follows:

Associate to the places in a Sudoku the variables x1,..., x81 9 and to each variable xi the polynomial Fi (xi )= j=1(xi − j). Let E = {(i, j) | i < j and (i, j) corresponds to a place in the same row, column or 3 × 3 − box}.

Fi −Fj For (i, j) ∈ E, let Gi j = . , xi −xj

Andreas Steenpass Singular Tutorial Sudoku

To solve Sudokos, we proceed as follows:

Associate to the places in a Sudoku the variables x1,..., x81 9 and to each variable xi the polynomial Fi (xi )= j=1(xi − j). Let E = {(i, j) | i < j and (i, j) corresponds to a place in the same row, column or 3 × 3 − box}.

Fi −Fj For (i, j) ∈ E, let Gi j = . , xi −xj Let I ⊂ Q[x1,..., x81] be the ideal generated by the 891 polynomials {Gi,j }(i,j)∈E and {Fi }i=1,...,9.

Andreas Steenpass Singular Tutorial Sudoku

To solve Sudokos, we proceed as follows:

Associate to the places in a Sudoku the variables x1,..., x81 9 and to each variable xi the polynomial Fi (xi )= j=1(xi − j). Let E = {(i, j) | i < j and (i, j) corresponds to a place in the same row, column or 3 × 3 − box}.

Fi −Fj For (i, j) ∈ E, let Gi j = . , xi −xj Let I ⊂ Q[x1,..., x81] be the ideal generated by the 891 polynomials {Gi,j }(i,j)∈E and {Fi }i=1,...,9.

Then a = (a1,..., a81) ∈ V (I ) iff ai ∈ {1,..., 9} and ai = aj for (i, j) ∈ E.

Andreas Steenpass Singular Tutorial Sudoku

A well posed Sudoku has a unique solution.

Andreas Steenpass Singular Tutorial Sudoku

A well posed Sudoku has a unique solution. Let L ⊂ {1,..., 81} be the set of pre-assigned places, and let {ai }i∈L be the corresponding numbers of an explicit Sudoku S.

Andreas Steenpass Singular Tutorial Sudoku

A well posed Sudoku has a unique solution. Let L ⊂ {1,..., 81} be the set of pre-assigned places, and let {ai }i∈L be the corresponding numbers of an explicit Sudoku S.

Then IS = I + {xi − ai }i∈L is the ideal associated to the Sudoku S.

Andreas Steenpass Singular Tutorial Sudoku

A well posed Sudoku has a unique solution. Let L ⊂ {1,..., 81} be the set of pre-assigned places, and let {ai }i∈L be the corresponding numbers of an explicit Sudoku S.

Then IS = I + {xi − ai }i∈L is the ideal associated to the Sudoku S.

The reduced Gr¨obner basis of IS with respect to the lexicographical ordering has the shape x1 − a1,..., x81 − a81, and (a1,..., a81) is the solution of the Sudoku.

Andreas Steenpass Singular Tutorial Table of Contents

1 Getting started with Singular by examples

2 Basic concepts of the mathematical background

3 Singular as a Software: Ressources and the Singular Community

4 Challenges in Computer Algebra

5 Singular’s modstd.lib

6 Schreyer’s Algorithm for Syzygies

7 Sudoku

8 Primary Decomposition with Singular

Andreas Steenpass Singular Tutorial Primary Decomposition

Definition. A proper ideal Q of a ring R is said to be primary if f , g ∈ R, fg ∈ Q and f ∈ Q implies g ∈ rad Q. In this case, P = rad Q is a prime ideal, and Q is also said to be a P-primary ideal. Given any ideal I of R, a primary decomposition of I is an expression of I as an intersection of finitely many primary ideals.

Andreas Steenpass Singular Tutorial Primary Decomposition

Definition. A proper ideal Q of a ring R is said to be primary if f , g ∈ R, fg ∈ Q and f ∈ Q implies g ∈ rad Q. In this case, P = rad Q is a prime ideal, and Q is also said to be a P-primary ideal. Given any ideal I of R, a primary decomposition of I is an expression of I as an intersection of finitely many primary ideals. Now suppose that R is Noetherian. Then every proper ideal I of R has a primary decomposition. We can always achieve that such a r decomposition I = i=1 Qi is minimal. That is, the prime ideals Pi = rad Qi are all distinct and none of the Qi can be left out. In this case, the Pi are uniquely determined by I and are referred to as the associated primes of I . If Pi is minimal among P1,..., Pr with respect to inclusion, it is called a minimal associated prime of I .

Andreas Steenpass Singular Tutorial Primary Decomposition

The minimal associated primes of I are precisely the minimal prime ideals containing I . Their intersection is equal to rad I . Every primary ideal occuring in a minimal primary decomposition of I is called a primary component of I . The component is said to be isolated if its radical is a minimal associated prime of I . Otherwise, it is said to be embedded. The isolated components are uniquely determined by I , the others are far from being unique.

Andreas Steenpass Singular Tutorial Primary Decomposition

The minimal associated primes of I are precisely the minimal prime ideals containing I . Their intersection is equal to rad I . Every primary ideal occuring in a minimal primary decomposition of I is called a primary component of I . The component is said to be isolated if its radical is a minimal associated prime of I . Otherwise, it is said to be embedded. The isolated components are uniquely determined by I , the others are far from being unique. From the definitions, it is clear that there is a number of different tasks coming with primary decomposition.

Andreas Steenpass Singular Tutorial Primary Decomposition

The minimal associated primes of I are precisely the minimal prime ideals containing I . Their intersection is equal to rad I . Every primary ideal occuring in a minimal primary decomposition of I is called a primary component of I . The component is said to be isolated if its radical is a minimal associated prime of I . Otherwise, it is said to be embedded. The isolated components are uniquely determined by I , the others are far from being unique. From the definitions, it is clear that there is a number of different tasks coming with primary decomposition. These range from computing radicals via computing the minimal associated primes to computing a full primary decomposition.

Andreas Steenpass Singular Tutorial Primary Decomposition

The minimal associated primes of I are precisely the minimal prime ideals containing I . Their intersection is equal to rad I . Every primary ideal occuring in a minimal primary decomposition of I is called a primary component of I . The component is said to be isolated if its radical is a minimal associated prime of I . Otherwise, it is said to be embedded. The isolated components are uniquely determined by I , the others are far from being unique. From the definitions, it is clear that there is a number of different tasks coming with primary decomposition. These range from computing radicals via computing the minimal associated primes to computing a full primary decomposition. A variety of corresponding algorithms is implemented in the Singular library primdec.lib.

Andreas Steenpass Singular Tutorial Primary Decomposition

The minimal associated primes of I are precisely the minimal prime ideals containing I . Their intersection is equal to rad I . Every primary ideal occuring in a minimal primary decomposition of I is called a primary component of I . The component is said to be isolated if its radical is a minimal associated prime of I . Otherwise, it is said to be embedded. The isolated components are uniquely determined by I , the others are far from being unique. From the definitions, it is clear that there is a number of different tasks coming with primary decomposition. These range from computing radicals via computing the minimal associated primes to computing a full primary decomposition. A variety of corresponding algorithms is implemented in the Singular library primdec.lib. The two main algorithms for computing a full primary decomposition are primdecSY and primdecGTZ.

Andreas Steenpass Singular Tutorial Primary Decomposition

The starting point of the GTZ-algorithm is the following simple observation:

Andreas Steenpass Singular Tutorial Primary Decomposition

The starting point of the GTZ-algorithm is the following simple observation:

Lemma (Splitting Tool). If I ⊂ K[x1,..., xn] is an ideal, if h ∈ K[x1,..., xn] is a polynomial, and if m ≥ 1 is an integer such that I : h∞ = I : hm, then

I = I : hm ∩ I , hm .

Andreas Steenpass Singular Tutorial Primary Decomposition

The starting point of the GTZ-algorithm is the following simple observation:

Lemma (Splitting Tool). If I ⊂ K[x1,..., xn] is an ideal, if h ∈ K[x1,..., xn] is a polynomial, and if m ≥ 1 is an integer such that I : h∞ = I : hm, then

I = I : hm ∩ I , hm . The key result on which the algorithm is based specifies which polynomials h are considered:

Andreas Steenpass Singular Tutorial Primary Decomposition

Proposition Let I K[x]= K[x1,..., xn] be a proper ideal, and let u ⊂ x be a subset of maximal cardinality such that I ∩ K[u]= {0}. Then: The ideal I K(u)[x \u] ⊂ K(u)[x\u] is zero-dimensional.

Let > = (>x\u ,>u) be a global product ordering on K[x], and let G be a Gr¨obner basis for I with respect to >. Then G is a Gr¨obner basis for I K(u)[x\u] with respect to the monomial ordering obtained by restricting > to the monomials in K[x\u]. Further, if h ∈ K[u] is the least common multiple of the leading coefficients of the elements of G (regarded as polynomials in K(u)[x\u]), then

I K(u)[x\u] ∩ K[x]= I : h∞ .

Andreas Steenpass Singular Tutorial Primary Decomposition

All primary components of the ideal I K(u)[x \u] ∩ K[x] have the same dimension, namely dim I . Further, if I K(u)[x\u]= Q1 ∩ . . . ∩ Qr is the minimal primary decomposition, then

I K(u)[x\u] ∩ K[x] = (Q1 ∩ K[x]) ∩ . . . ∩ (Qr ∩ K[x])

is the minimal primary decomposition, too.

Andreas Steenpass Singular Tutorial Primary Decomposition

All primary components of the ideal I K(u)[x \u] ∩ K[x] have the same dimension, namely dim I . Further, if I K(u)[x\u]= Q1 ∩ . . . ∩ Qr is the minimal primary decomposition, then

I K(u)[x\u] ∩ K[x] = (Q1 ∩ K[x]) ∩ . . . ∩ (Qr ∩ K[x])

is the minimal primary decomposition, too.

Note that if > is a global monomial ordering on K[x], then every subset u ⊂ x of maximal cardinality satisfying LM>(I ) ∩ K[u]= {0} is also a subset of maximal cardinality such that I ∩ K[u]= {0}.

Andreas Steenpass Singular Tutorial Primary Decomposition

By recursion, the proposition allows us to reduce the general case of primary decomposition to the zero-dimensional case. In turn, if I ⊂ K[x] is a zero-dimensional ideal “in general position” (with respect to the lexicographic order satisfying x1 > > xn), and if hn is a generator for I ∩ K[xn], the minimal primary decomposition of I is obtained by factorizing hn. In characteristic zero, the condition that I is in general position can be achieved by means of a generic linear coordinate transformation

Andreas Steenpass Singular Tutorial