ETH Zürich – Student Seminar in Combinatorics: Mathema:cal So<ware Polynomials and Gröbner Bases -‐ Alice Feldmann – 16.12.2014
Polynomials and Gröbner Bases
Alice Feldmann 16th December 2014
ETH Zürich Student Seminar in Combinatorics:
Mathema:cal So<ware Prof. K. Fukuda
Autumn Semester 2014
ETH Zürich – Student Seminar in Combinatorics: Mathema:cal So<ware Polynomials and Gröbner Bases -‐ Alice Feldmann – 16.12.2014
Talk Outline
I. Introduc:on: Computa:onal Algebra II. Polynomials and Gröbner Bases
a. Algebraic Background b. Gröbner Bases c. Buchberger‘s Algorithm
III. Mathema:cal So<ware for Problems in Computa:onal Algebra a. Singular b. CoCoA c. Gfan
IV. Implementa:on: Buchberger‘s Algorithm in Singular V. References
ETH Zürich – Student Seminar in Combinatorics: Mathema:cal So<ware Polynomials and Gröbner Bases -‐ Alice Feldmann – 16.12.2014
Introduc9on: Computa9onal Algebra
Tackling problems with algebraic methods using the computer... For example...
I. Solving inhomogeneous Systems of Linear Equa9ons Everybody knows the Gauss algorithm for solving systems of linear equa:ons! Use matrices as algebraic tool and an appropriate so<ware (for example MATLAB) to analyse whether there exists a unique solu:on for an inhomogeneous system (which happens if and only if det(M)≠0).
II. Gröbner Bases ... provide solu:ons to basic problems in ring theory, for example: “Let R be a ring and I be an ideal in R . Given r ∊ R , is r ∊ I ?“ Membership Problem ... provide an approach for solving systems of non-‐linear equa:ons (reduc:on of number of variables)
Introduc:on: Computa:onal Algebra Polynomials and Gröbner Bases Mathema:cal So<ware for Problems in Computa:onal Algebra Implementa:on: Buchberger‘s Algorithm in Singular
ETH Zürich – Student Seminar in Combinatorics: Mathema:cal So<ware Polynomials and Gröbner Bases -‐ Alice Feldmann – 16.12.2014
Polynomials and Gröbner Bases Algebraic Background
Let‘s remember some basic algebraic defini:ons and concepts...
I. Monomial over a collec:on of variables
II. Total degree of a monomial
III. Term: product of nonzero element c of a field F and a monomial. IV. Polynomial p in n variables: sum of a finite number of terms with coefficients in F
for
Introduc:on: Computa:onal Algebra Polynomials and Gröbner Bases Mathema:cal So<ware for Problems in Computa:onal Algebra Implementa:on: Buchberger‘s Algorithm in Singular
Algebraic Background Gröbner Bases Buchberger‘s Algorithm
ETH Zürich – Student Seminar in Combinatorics: Mathema:cal So<ware Polynomials and Gröbner Bases -‐ Alice Feldmann – 16.12.2014
V. Polynomial Ring: set of all polynomials in n variables with coefficients in F
VI. Field of Ra9onal Func9ons:
VII. Ideal: non-‐empty subset of field F, such that a. for and b. For for an arbitrary polynomial
VIII. Ideal generated by polynomials Remark: is the smallest ideal, which contains
Introduc:on: Computa:onal Algebra Polynomials and Gröbner Bases Mathema:cal So<ware for Problems in Computa:onal Algebra Implementa:on: Buchberger‘s Algorithm in Singular
Algebraic Background Gröbner Bases Buchberger‘s Algorithm
ETH Zürich – Student Seminar in Combinatorics: Mathema:cal So<ware Polynomials and Gröbner Bases -‐ Alice Feldmann – 16.12.2014
Example
Consider the polynomials:
Observe:
Conclude:
Introduc:on: Computa:onal Algebra Polynomials and Gröbner Bases Mathema:cal So<ware for Problems in Computa:onal Algebra Implementa:on: Buchberger‘s Algorithm in Singular
Algebraic Background Gröbner Bases Buchberger‘s Algorithm
ETH Zürich – Student Seminar in Combinatorics: Mathema:cal So<ware Polynomials and Gröbner Bases -‐ Alice Feldmann – 16.12.2014
Remarks
I. Hilbert Basis Theorem Every ideal I in has a finite genera:ng set. This means, for any given ideal I , there exists a finite set of polynomials such that .
II. Division Algorithm in Given two polynomials , we can divide f by g, producing a unique quo:ent q and remainder r such that
and it is either r = 0 , or r has degree strictly smaller than the degree of g.
If there exists a division algorithm for polynomials in just one variable, is there one for polynomials in many variables?
Introduc:on: Computa:onal Algebra Polynomials and Gröbner Bases Mathema:cal So<ware for Problems in Computa:onal Algebra Implementa:on: Buchberger‘s Algorithm in Singular
Algebraic Background Gröbner Bases Buchberger‘s Algorithm
ETH Zürich – Student Seminar in Combinatorics: Mathema:cal So<ware Polynomials and Gröbner Bases -‐ Alice Feldmann – 16.12.2014
Monomial Orders
Formal defini9on: A monomial order on is any rela:on > on the set of monomials in sa:sfying: I. > is a total (linear) ordering rela:on. II. > is compa4ble with mul4plica4on in . III. > is a well-‐ordering, i.e. every non-‐empty collec:on of monomials has a smallest
element under >.
Examples: I. Lexicographic Order II. Graded Reverse Lexicographic Order
Introduc:on: Computa:onal Algebra Polynomials and Gröbner Bases Mathema:cal So<ware for Problems in Computa:onal Algebra Implementa:on: Buchberger‘s Algorithm in Singular
Algebraic Background Gröbner Bases Buchberger‘s Algorithm
ETH Zürich – Student Seminar in Combinatorics: Mathema:cal So<ware Polynomials and Gröbner Bases -‐ Alice Feldmann – 16.12.2014
Examples
I. Lexicographic Order Let and be monomials in . We say , if in the difference the le<-‐most nonzero entry is posi:ve.
Example I: For , we have , because the le<-‐most entry of the difference vector must be posi:ve: .
Example II: We have , because .
II. Graded Reverse Lexicographic Order Let and be monomials in . We say , if either , or in case the sums are equal, the right-‐most entry is
nega:ve in the difference .
Example I: We have , because the of the total degrees. Example II: We have , because the right-‐most entry of the difference vector must be nega:ve: .
Introduc:on: Computa:onal Algebra Polynomials and Gröbner Bases Mathema:cal So<ware for Problems in Computa:onal Algebra Implementa:on: Buchberger‘s Algorithm in Singular
Algebraic Background Gröbner Bases Buchberger‘s Algorithm
ETH Zürich – Student Seminar in Combinatorics: Mathema:cal So<ware Polynomials and Gröbner Bases -‐ Alice Feldmann – 16.12.2014
Leading Term of a Polynomial
Let be a polynomial in . Fix any monomial order >.
The leading term of f with respect to > is the product , where is the largest monomial appearing in in the ordering >. Denote the leading term by .
Example: Consider .
For the lexicographic order, we have: .
However, for the Graded Reverse Lexicographic Order, we have: .
Introduc:on: Computa:onal Algebra Polynomials and Gröbner Bases Mathema:cal So<ware for Problems in Computa:onal Algebra Implementa:on: Buchberger‘s Algorithm in Singular
Algebraic Background Gröbner Bases Buchberger‘s Algorithm
ETH Zürich – Student Seminar in Combinatorics: Mathema:cal So<ware Polynomials and Gröbner Bases -‐ Alice Feldmann – 16.12.2014
Division Algorithm in
Fix any monomial order > in and let be an ordered s-‐tuple of polynomials in . Then every can be wriien as
where , and either r = 0 , or r is a linear combina:on of monomials, of which none is divisible by any of .
Remarks:
I. r is called the remainder of f on division by F and is some:mes denoted by . II. The division algorithm allows to divide f by an s-‐tuple of polynomials. III. The outcome of the division depends on the choice of the monomial order.
Introduc:on: Computa:onal Algebra Polynomials and Gröbner Bases Mathema:cal So<ware for Problems in Computa:onal Algebra Implementa:on: Buchberger‘s Algorithm in Singular
Algebraic Background Gröbner Bases Buchberger‘s Algorithm
ETH Zürich – Student Seminar in Combinatorics: Mathema:cal So<ware Polynomials and Gröbner Bases -‐ Alice Feldmann – 16.12.2014
Introduc:on: Computa:onal Algebra Polynomials and Gröbner Bases Mathema:cal So<ware for Problems in Computa:onal Algebra Implementa:on: Buchberger‘s Algorithm in Singular
Algebraic Background Gröbner Bases Buchberger‘s Algorithm
Gröbner Bases
Mo9va9on By applying the division algorithm, one can decide whether a given is a member of a given ideal .
If the remainder of f on division by F is zero, then we have , and by defini:on .
Recall on of our previous examples, where we defined . We have already showed, that
,
but if we divide p by using our division algorithm, we obtain a nonzero remainder: . The reason is that none of the leading terms of or divides the leading term of p.
ETH Zürich – Student Seminar in Combinatorics: Mathema:cal So<ware Polynomials and Gröbner Bases -‐ Alice Feldmann – 16.12.2014
Introduc:on: Computa:onal Algebra Polynomials and Gröbner Bases Mathema:cal So<ware for Problems in Computa:onal Algebra Implementa:on: Buchberger‘s Algorithm in Singular
Algebraic Background Gröbner Bases Buchberger‘s Algorithm
Defini9on
Fix a monomial order > on and let be an ideal. A Gröbner Basis for I (with respect to >) is a finite collec:on of polynomials
with the property that for every nonzero polynomial is divisible by for some i.
A Gröbner Basis G for an ideal I is called • reduced, if for all dis:nct , no monomial appearing in is a mul:ple of . • monic, if it is reduced and if the leading coefficient of all polynomials is 1.
Remarks I. A Gröbner Basis G is indeed a basis for I , i.e. II. Let G be a Gröbner Basis for I and then the remainder of f divided by G is
zero, i.e. III. The remainder obtained through division by polynomials of a Gröbner Basis for an
ideal is unique.
ETH Zürich – Student Seminar in Combinatorics: Mathema:cal So<ware Polynomials and Gröbner Bases -‐ Alice Feldmann – 16.12.2014
Introduc:on: Computa:onal Algebra Polynomials and Gröbner Bases Mathema:cal So<ware for Problems in Computa:onal Algebra Implementa:on: Buchberger‘s Algorithm in Singular
Algebraic Background Gröbner Bases Buchberger‘s Algorithm
Buchberger‘s Algorithm
Mo9va9on Takes an arbitrary genera:ng set for an ideal I and produces a Gröbner Basis G for I from it.
How does it work? Let be nonzero polynomials . Fix a monomial order and let
and , where Furthermore, define as the least common mul:ple of the leading terms.
Now define the S-‐polynomial of f and g as:
(Observe: )
Apply Buchberger‘s Criterion: A finite set is a Gröbner Basis of I if and only if for all pairs .
ETH Zürich – Student Seminar in Combinatorics: Mathema:cal So<ware Polynomials and Gröbner Bases -‐ Alice Feldmann – 16.12.2014
Introduc:on: Computa:onal Algebra Polynomials and Gröbner Bases Mathema:cal So<ware for Problems in Computa:onal Algebra Implementa:on: Buchberger‘s Algorithm in Singular
Algebraic Background Gröbner Bases Buchberger‘s Algorithm
Buchberger‘s Algorithm
Input: Output: a Gröbner Basis for with
REPEAT
FOR each pair in G‘ DO
IF THEN UNTIL
ETH Zürich – Student Seminar in Combinatorics: Mathema:cal So<ware Polynomials and Gröbner Bases -‐ Alice Feldmann – 16.12.2014
Introduc:on: Computa:onal Algebra Polynomials and Gröbner Bases Mathema:cal So<ware for Problems in Computa:onal Algebra Implementa:on: Buchberger‘s Algorithm in Singular
Algebraic Background Gröbner Bases Buchberger‘s Algorithm
Example
Consider the polynomials and . Fix the monomial ordering to be the lexicographic ordering . We have that , which yields
.
Let‘s divide the S-‐polynomial by : we obtain the remainder
.
Note that the leading term is not divisible by the leading terms of f and g . Hence, adjoin to our set of polynomials F and consider the two new S-‐polynomials and . Con:nue with this procedure and adjoin the remainders of further divisions if there are nonzero.
ETH Zürich – Student Seminar in Combinatorics: Mathema:cal So<ware Polynomials and Gröbner Bases -‐ Alice Feldmann – 16.12.2014
Mathema9cal SoRware for Computa9onal Algebra
Introduc9on • there exist a lot of possibili:es for execu:ng computa:onal algebra see list on wikipedia: hip://en.wikipedia.org/wiki/List_of_computer_algebra_systems
(not complete...)
Examples: Singular CoCoA Gfan
Introduc:on: Computa:onal Algebra Polynomials and Gröbner Bases Mathema:cal So<ware for Problems in Computa:onal Algebra Implementa:on: Buchberger‘s Algorithm in Singular
Singular CoCoA Gfan
ETH Zürich – Student Seminar in Combinatorics: Mathema:cal So<ware Polynomials and Gröbner Bases -‐ Alice Feldmann – 16.12.2014
SINGULAR
• computer algebra system for polynomial computa:ons • emphasis on commuta4ve algebra, algebraic geometry and singularity theory • started in 1984 (Berlin), now: seiled at the University of Kaiserslautern • free and open-‐source so<ware under the GNU General Public Licence • main objects: ideals and modules in polynomial rings over fields or quo:ent rings • features: computa:on of Gröbner bases (Buchberger‘s and Mora‘s Algorithm), polynomial factoriza:on, resultants, characteris:c sets and gcd opera:ons, classifica:on of singulari:es • wriien in C
Introduc:on: Computa:onal Algebra Polynomials and Gröbner Bases Mathema:cal So<ware for Problems in Computa:onal Algebra Implementa:on: Buchberger‘s Algorithm in Singular
Singular CoCoA Gfan
ETH Zürich – Student Seminar in Combinatorics: Mathema:cal So<ware Polynomials and Gröbner Bases -‐ Alice Feldmann – 16.12.2014
CoCoA
• Computa:ons in Commuta:ve Algebra • emphasis on computa:ons in mul4variate polynomial rings over ra:onal integers and on their ideals and modules • ini:ated in 1987 to perform calcula:ons using Buchberger‘s algorithm (Genova) • free so<ware – features CoCoALib (open-‐source C++ GPL library) • libraries available for applica:ons in various areas (sta:s:cs, integer programming, ...) • kernel is wriien in C, user writes in Pascal-‐like syntax • features efficient calcula:ons with very big integers and ra:onal numbers and implementa:ons of Buchberger‘s algorithm using different orderings
Introduc:on: Computa:onal Algebra Polynomials and Gröbner Bases Mathema:cal So<ware for Problems in Computa:onal Algebra Implementa:on: Buchberger‘s Algorithm in Singular
Singular CoCoA Gfan
ETH Zürich – Student Seminar in Combinatorics: Mathema:cal So<ware Polynomials and Gröbner Bases -‐ Alice Feldmann – 16.12.2014
Gfan
• so<ware package for compu:ng Gröbner fans of polynomial ideals in and tropical varie4es based on Buchberger‘s algorithm • emphasis on tropical and polyhedral geometry using algebraic methods • started in 2003, wriien by A. N. Jensen (University of Aarhus, Denmark), supported by Prof. Fukuda • wriien in C++ • high performance (calcula:ng 3000 reduced Gröbner bases in 12s) • various subprograms enable fast computa:ons and easy handling
Introduc:on: Computa:onal Algebra Polynomials and Gröbner Bases Mathema:cal So<ware for Problems in Computa:onal Algebra Implementa:on: Buchberger‘s Algorithm in Singular
Singular CoCoA Gfan
ETH Zürich – Student Seminar in Combinatorics: Mathema:cal So<ware Polynomials and Gröbner Bases -‐ Alice Feldmann – 16.12.2014
Implementa9on: Buchberger‘s Algorithm in Singular
Programming Basics • language very similar to C/C++ (all inputs must be terminated by ; , types for variables, loops, func:ons etc.) • non-‐trivial algorithms always require the defini:on of a ring at the beginning! ring syntax: ring name = (coefficients), (name of ring variables), (ordering) ; • implemented algorithms for opera:ons on ideals, polynomials, etc. for example: factoriza:on of polynomials into irreducible factors (Cantor-‐Zassenhaus Algorithm), compu:ng the determinant of a square matrix, calcula:ng the greatest common divisor of polynomials • most interes:ng feature: computa:on of Gröbner bases • standard features like characteriza:on-‐func:on (typeof), type conversion, ... • include libraries with LIB “library name“; • various orderings: grevlex ordering dp, lex ordering lp, block ordering • possibility of execu:ng the division algorithm, returns quo:ent and remainder
Introduc:on: Computa:onal Algebra Polynomials and Gröbner Bases Mathema:cal So<ware for Problems in Computa:onal Algebra Implementa:on: Buchberger‘s Algorithm in Singular
ETH Zürich – Student Seminar in Combinatorics: Mathema:cal So<ware Polynomials and Gröbner Bases -‐ Alice Feldmann – 16.12.2014
References
Computa9onal Algebra K. G. Fischer, P. Loustaunau, J. Shapiro, E. L. Green, D. Farkas: Lecture Notes in Pure and Applied Mathema:cs – Computa:onal Algebra (1994)
Algebraic Background: David A. Cox, John Liile, Donal O‘Shea: Graduate Texts in Mathema:cs -‐ Using Algebraic Geometry (2005) Ralf Fröberg: An Introduc:on to Gröbner Bases (1997)
SoRware: hip://www.singular.uni-‐kl.de hip://cocoa.dima.unige.it/flyer4.html hip://home.math.au.dk/jensen/so<ware/gfan/gfan.html hip://en.wikipedia.org/wiki/List_of_computer_algebra_systems
Implementa9on: Groebner Bases – Sta:s:cs and So<ware Systems. Takayuki Hibi, Springer Japan, 2013 Singular Manual (online)