Hermite normal form: Computation and applications

Similar documents
Lattices and Hermite normal form

ANALYTICAL MATHEMATICS FOR APPLICATIONS 2018 LECTURE NOTES 3

Lecture 2: Lattices and Bases

1: Introduction to Lattices

CSE 206A: Lattice Algorithms and Applications Spring Basic Algorithms. Instructor: Daniele Micciancio

CSE 206A: Lattice Algorithms and Applications Winter The dual lattice. Instructor: Daniele Micciancio

CS412: Lecture #17. Mridul Aanjaneya. March 19, 2015

Math 121 Homework 5: Notes on Selected Problems

Math 240 Calculus III

Definition 2.3. We define addition and multiplication of matrices as follows.

Preliminaries and Complexity Theory

Bricklaying and the Hermite Normal Form

The Dual Lattice, Integer Linear Systems and Hermite Normal Form

1 Last time: least-squares problems

1 Shortest Vector Problem

30.3. LU Decomposition. Introduction. Prerequisites. Learning Outcomes

Econ Slides from Lecture 7

Intermediate Math Circles February 29, 2012 Linear Diophantine Equations I

Digital Workbook for GRA 6035 Mathematics

MODEL ANSWERS TO THE THIRD HOMEWORK

Matrix Operations: Determinant

Homework #2 solutions Due: June 15, 2012

SOLUTIONS: ASSIGNMENT Use Gaussian elimination to find the determinant of the matrix. = det. = det = 1 ( 2) 3 6 = 36. v 4.

MODEL ANSWERS TO THE FIRST QUIZ. 1. (18pts) (i) Give the definition of a m n matrix. A m n matrix with entries in a field F is a function

Lecture 18: The Rank of a Matrix and Consistency of Linear Systems

Chapter 1: Systems of Linear Equations

Math 109 HW 9 Solutions

( 3) ( ) ( ) ( ) ( ) ( )

Primitive sets in a lattice

The Solution of Linear Systems AX = B

Numerical Analysis Lecture Notes

Lecture 10 February 4, 2013

3. Vector spaces 3.1 Linear dependence and independence 3.2 Basis and dimension. 5. Extreme points and basic feasible solutions

EXERCISE SET 5.1. = (kx + kx + k, ky + ky + k ) = (kx + kx + 1, ky + ky + 1) = ((k + )x + 1, (k + )y + 1)

(1) for all (2) for all and all

Polynomials, Ideals, and Gröbner Bases

Chapter 3, Operations Research (OR)

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 1 x 2. x n 8 (4) 3 4 2

3.3 Easy ILP problems and totally unimodular matrices

Letting be a field, e.g., of the real numbers, the complex numbers, the rational numbers, the rational functions W(s) of a complex variable s, etc.

Calculation in the special cases n = 2 and n = 3:

To hand in: (a) Prove that a group G is abelian (= commutative) if and only if (xy) 2 = x 2 y 2 for all x, y G.

G1110 & 852G1 Numerical Linear Algebra

1 Last time: linear systems and row operations

Computational Methods. Systems of Linear Equations

(17) (18)

CME 302: NUMERICAL LINEAR ALGEBRA FALL 2005/06 LECTURE 6

9. The determinant. Notation: Also: A matrix, det(a) = A IR determinant of A. Calculation in the special cases n = 2 and n = 3:

Review for Exam Find all a for which the following linear system has no solutions, one solution, and infinitely many solutions.

This can be accomplished by left matrix multiplication as follows: I

CSL361 Problem set 4: Basic linear algebra

Intermediate Math Circles February 26, 2014 Diophantine Equations I

47-831: Advanced Integer Programming Lecturer: Amitabh Basu Lecture 2 Date: 03/18/2010

Eigenvalues and Eigenvectors

Math 61CM - Solutions to homework 2

3. Linear Programming and Polyhedral Combinatorics

Linear Systems and Matrices

Lecture 1: Systems of linear equations and their solutions

Midterm for Introduction to Numerical Analysis I, AMSC/CMSC 466, on 10/29/2015

Advanced Engineering Mathematics Prof. Pratima Panigrahi Department of Mathematics Indian Institute of Technology, Kharagpur

Determinants. Recall that the 2 2 matrix a b c d. is invertible if

Problem Set # 1 Solution, 18.06

1 The linear algebra of linear programs (March 15 and 22, 2015)

Chapter 4. Solving Systems of Equations. Chapter 4

(Inv) Computing Invariant Factors Math 683L (Summer 2003)

2 b 3 b 4. c c 2 c 3 c 4

Matrix Factorization and Analysis

LEGENDRE S THEOREM, LEGRANGE S DESCENT

A STUDY ON THE CONCEPT OF DIOPHANTINE EQUATIONS

MATH FINAL EXAM REVIEW HINTS

Airo International Research Journal September, 2016 Volume VII, ISSN:

Solving Systems of Linear Equations

Normal Forms for General Polynomial Matrices

Gaussian Elimination and Back Substitution

= W z1 + W z2 and W z1 z 2

The Shortest Vector Problem (Lattice Reduction Algorithms)

Two Lectures on the Ellipsoid Method for Solving Linear Programs

A strongly polynomial algorithm for linear systems having a binary solution

Lecture 7: Introduction to linear systems

Linear Algebra. Matrices Operations. Consider, for example, a system of equations such as x + 2y z + 4w = 0, 3x 4y + 2z 6w = 0, x 3y 2z + w = 0.

Math1a Set 1 Solutions

Normal Forms for General Polynomial Matrices

Part IB - Easter Term 2003 Numerical Analysis I

A = , A 32 = n ( 1) i +j a i j det(a i j). (1) j=1

5.6. PSEUDOINVERSES 101. A H w.

Conceptual Questions for Review

Determinants Chapter 3 of Lay

Direct Methods for Solving Linear Systems. Matrix Factorization

CSE 206A: Lattice Algorithms and Applications Spring Basis Reduction. Instructor: Daniele Micciancio

1111: Linear Algebra I

x y B =. v u Note that the determinant of B is xu + yv = 1. Thus B is invertible, with inverse u y v x On the other hand, d BA = va + ub 2

Algebraic Methods in Combinatorics

ORIE 6300 Mathematical Programming I August 25, Recitation 1

Math Computation Test 1 September 26 th, 2016 Debate: Computation vs. Theory Whatever wins, it ll be Huuuge!

Lattices and the Shortest Vector Problem

5.7 Cramer's Rule 1. Using Determinants to Solve Systems Assumes the system of two equations in two unknowns

7.6 The Inverse of a Square Matrix

MATH 3511 Lecture 1. Solving Linear Systems 1


Math Camp Lecture 4: Linear Algebra. Xiao Yu Wang. Aug 2010 MIT. Xiao Yu Wang (MIT) Math Camp /10 1 / 88

Transcription:

Integer Points in Polyhedra Gennady Shmonin Hermite normal form: Computation and applications February 24, 2009 1 Uniqueness of Hermite normal form In the last lecture, we showed that if B is a rational matrix of full row rank, then there is a unimodular matrix U such that [ H 0 = BU is a matrix in Hermite normal form. In particular, Λ(B) = Λ(H), and consequently, every group generated by rational vectors has a basis in Hermite normal form, and therefore, is a lattice. Now, we prove that this basis H is actually unique. We shall need the following simple observation: If H = [ h 1,h 2,...,h n is a matrix in Hermite normal form and b Λ(H) is a vector with first i 1 components equal to zero, then h = n n x j h j = x j h j j =1 for some integers x i. Indeed, suppose that i > 1; since h 1 is the only vector with non-zero first component, we necessarily have x 1 = 0, and proceeding by induction we can show that x 1 = x 2 =... = x i 1 = 0. Theorem 1 (Uniqueness of Hermite normal form). Let B be a rational matrix of full row rank. Then there is a unique matrix H in Hermite normal form such that Λ(H) = Λ(B). Proof. Existence of such a matrix H was shown in the previous lecture. For uniqueness, suppose that H = [ h i j and H = [ h i j are two matrices in Hermite normal form and Λ = Λ(H) = Λ(H ) (we drop all-zero columns and assume that H and H are square non-singular matrices). Yet, suppose that H H and choose i and j such that h i j h and i is as small as possible; without i j loss of generality, we assume that h i j > h i j. The j -th column of H, say h j, and the j -th column of H, say h j, both belong to Λ, and therefore, h j h j Λ. Therefore, h j h can be expressed as j an integral linear combination of columns of H. By the choice of i, the vector h j h has zeros j in its first i 1 components. Thus, it is actually an integral linear combination of the columns i,i +1,... of H. But among these columns, only the i -th column has a non-zero entry in the i -th component, which implies h i j h i j = zh ii for some integer z. But h i j < h ii and h i j < h ii < h ii, whence h i j h i j < h ii. It follows that z must be zero, which is a contradiction. j =i 2 Linear Diophantine equations Hermite normal form appears to be very useful for solving systems of linear Diophantine equations. Let A be a matrix and b a vector, and consider the problem of finding an integral vector x satisfying the system Ax = b. In fact, we may assume that A has full row rank; otherwise, we may remove redundant equations from the system. Yet, we assume all input data to be rational. 1

We can find a unimodular matrix U such that [ H 0 = AU is a matrix in Hermite normal form. Now, we can apply a standard trick to transform a system of linear equations (and actually, a system of linear inequalities, too) into a more suitable form: Ax = b is equivalent to (AU )(U 1 x) = b, and therefore, [ H 0 z = b, where z = U 1 x is integral if and only if x is integral. We can observe that the last components of z may take arbitrary values, while feasibility of the system [ H 0 z = b, and therefore, of Ax = b, depends only on whether the vector H 1 b is integral. Now, we can derive the following condition for a system of linear Diophantine equations to have a solution. Theorem 2. Let A be a rational matrix of full row rank and let b be a rational vector. Then the system Ax = b has an integral solution x if and only if y T b is an integer for each rational vector y, for which the matrix y T A is integral. Proof. If x is an integral vector such that Ax = b and y is a rational vector such that y T A is integral, then y T b = (y T A)x is clearly an integer. For the converse, we apply a unimodular transformation to obtain the equivalent system [ H 0 z = b, where [ H 0 is a matrix in Hermite normal form, z = U 1 x (z is integral if and only if x is integral). Yet, y T A is integral if and only if y T[ H 0 = (y T A)U is integral. Since H 1[ H 0 = [ I 0 is an integral matrix, H 1 b must be an integral vector. But then [ H 1 b z 0 = 0 is an integral solution of the system Bz = b. This completes the proof. Suppose that there is an integral solution, i.e., the vector [ H 1 b z 0 =, 0 which is the unique solution of the system H z = b, is integral. Then the whole set of solutions has the form { } z0 + αm+1em+1 + αm+2em+2 +... + αnen : αm+1,αm+2,...,αn Z, where m is the rank of H (since we assumed A to have full row rank, this is just the number of equations in the system), e m+1,e m+2,...,e n are the unit vectors corresponding to the zero columns in [ H 0. Since z = U 1 x, U is unimodular, the set of solutions in the original space of x-variables is { } x0 + αm+1xm+1 + αm+2xm+2 +... + αnxn : αm+1,αm+2,...,αn Z, where x 0 = Uz 0 is a solution of the system Ax = b and x i = Uz i (i = m + 1,m + 2,...,n) form a basis of the lattice of solutions of the system Ax = 0. Theorem 3. Let A be a rational m n-matrix of full row rank and let b be a rational m-vector. If the system Ax = b has an integral solution, then the whole set of integral solutions has the form { } x 0 + α m+1 x m+1 + α m+2 x m+2 +... + α n x n : α m+1,α m+2,...,α n Z, where x 0 is a solution of the system Ax = b, x i s are some linearly independent integral vectors satisfying Ax = 0. 2

3 Polynomial algorithm for Hermite normal form In the last lecture, we proved that every rational matrix can be brought into Hermite normal form by a sequence of elementary column operations, to which we include (1) swapping two columns, (2) multiplying a column by 1, and (3) adding an integer multiple of a column to another column. The proof was essentially algorithmic but we have not analyzed its running time yet. First, we remind the algorithm. Given a n m-matrix B of full row rank, we construct a sequence of matrices B 1,B 2,...,B n, where B k has the form [ Hk 0 B k =, C k D k with H k being a square non-negative lower-triangular matrix of order k, where each row has the unique maximal entry, which is located on the main diagonal. In order to derive the matrix B k+1, we first eliminate all but one non-zero entries in the first row of D k. For this, we essentially execute the Euclidean algorithm: after multiplying, when needed, columns by 1, we may assume that all entries in the first row of D k are non-negative. Now, if d i > d j are two non-zero entries in the first row of D k, we add d i /d j times the j -th column to the i -th column; particularly, we assign d i := d i d i /d j d j. If d i is still non-zero, we repeat the process (but now b j > b i, thus we add d j /d i times the i -th column to the j -th column). From the running time analysis of the Euclidean algorithm, we know that after O(size(d i )size(d j )) iterations, one of the numbers becomes zero. We apply the same procedure to ensure that all but one entries in the first row of D k became zero and the only non-zero entry, say d, can be located on the main diagonal by swapping the columns. Finally, we need to ensure that d is the largest number in the (k +1)-th row: for this purpose, we add appropriate multiples of the (k +1)-th column to the other columns (division with remainder). It is clear that the algorithm would be (weakly) polynomial if we could guarantee that all entries appearing during the execution of the algorithm have polynomial size. How can we do this? First, we need to check that the answer (i.e., Hermite normal form of a matrix) itself has a polynomial size. Let B be an integral matrix of full row rank and let [ H 0 be its Hermite normal form. Observe that in the above procedure, d is actually the greatest common divisor of the elements in the first row of D k. This observation can easily be extended by induction to show that if h 11,h 22,...,h nn are the diagonal entries of H, then their product is the greatest common divisor of all subdeterminants of B of order n. All other entries in i -th row of H are non-negative and smaller than h ii, and hence, also bounded by a polynomial in the size of B. Thus, the size of the Hermite normal form of B is indeed polynomial in the size of B. Lemma 4. Let B be a rational matrix of full row rank and let [ H 0 be its Hermite normal form. Then the size of H is bounded by a polynomial in the size of B. 3

Recall that if Λ is a sublattice of a lattice Λ, then DΛ Λ Λ, (1) where D is the index of Λ in Λ. We assume that B is an integral matrix (otherwise, we can find the least common multiple of all denominators in B, say δ, and proceed with the matrix δb) with n rows. Let B be a square non-singular submatrix of B of order n and consider the lattices Λ = Z n and Λ = Λ(B ). Clearly, Λ is a sublattice of Λ and the index of Λ in Λ is equal to D = det(λ ) = det(b ). Then inclusion (1) states that DZ n Λ(B ). In other words, adding the columns De 1,De 2,...,De n to the matrix B does not change the lattice Λ(B) (all of these vectors can be expressed as integral linear combinations of columns from B ), and therefore, does not change the Hermite normal form of B, except of adding extra zero columns to it. Now, we can run our algorithm on the matrix [ B DI. If, at some step of the algorithm, an entry b i j grows to much, we can add an appropriate multiple of the i -th column in the matrix DI to the j -th column in the matrix B, to make b i j lie between 0 and D. Thus, we can keep the size of any entry bounded by O(size(D)), which is polynomial in the input size. Consequently, the whole algorithm runs in polynomial time. Theorem 5. The Hermite normal form of a rational matrix B of full row rank can be computed in polynomial time. Similarly, we can find a unimodular matrix U such that BU is in Hermite normal form. Theorem 6. There is a polynomial algorithm that, provided a rational matrix B of full row rank, computes a unimodular matrix U such that BU is in Hermite normal form. Proof. Again, let B be a square non-singular submatrix of B; without loss of generality, we may assume that B has the form B = [ B B. Let [ H 0 be the Hermite normal form of B. We need to find a unimodular matrix U such that [ H 0 = [ B B U. If B was a square matrix, computation would be straight-forward. But we can make it square by adding extra rows: it is easy to see that the Hermite normal form of the matrix [ B B 0 I has the form [ H 0 H H for some H and H. By Lemma 4 the size of the latter matrix is bounded by a polynomial in the size of the first, and therefore, in the size of B. Consequently, the matrix can be computed in polynomial time. [ B B 1 [ H 0 U = 0 I H H 4

4 Algorithm for linear Diophantine equations It is rather straight-forward now to derive a polynomial algorithm to solve a system of linear Diophantine equations. Let A be a rational matrix and b be a rational vector, and consider the system Ax = b. By exploiting the Gaussian elimination algorithm, we can remove in polynomial time redundant rows and assume that A has full row rank (of course, if the system Ax = b has no fractional solution, it does not have an integral solution as well). Now, we can compute in polynomial time a unimodular matrix U such that AU = [ H 0 is a matrix in Hermite normal form, and construct an equivalent system [ H 0 y = b, where y = U 1 b. It remains to solve the system H y = b, which can be done by Gaussian elimination, and apply the unimodular transformation to transform the solution to the original x-variables: very similar to what we have done in Section 2. This yields the following theorem. Theorem 7. A system of linear Diophantine equations Ax = b can be solved in polynomial time. We may return the whole set of solutions in the form, as given in Theorem 3. 5