Let denote a given principal ideal domain.
Definition. Two matrices in will be called equivalent if there exist matrices and such . To indicate that and are equivalent one may write .
Observe that the ideal in generated by the entries of and the ideal generated by the entries of are the same when and are equivalent. Since is a principal ideal domain, it follows that the entries of and the entries of share the same greatest common divisors inasmuch as these greatest common divisors serve as single generators for these ideals.
By rank of a matrix in one understands the rank of when it is regarded as a matrix in the fraction field of .
Proof. The case where they share a row is the transpose of the case where they share a column. If they share a column one may narrow the scope to that column and the two rows that are involved, i.e., it is essentially a question about the case . If , then one may choose such that . If and , then
Proof. Let . Use induction on . The result is trivially true if or if the given matrix . Assume . Among the non-zero entries in all of the matrices equivalent to there is an entry in one of those matrices having the minimum number of prime factors occuring among those entries. Let be an entry having the said minimum number of prime factors, and replace , if necessary, by an equivalent matrix in which is an entry. Since any entry may be moved to position using row and column operations, replacing again, if necessary, by an equivalent matrix, one may assume that is the entry of . By the lemma, in view of the choice of , must divide all entries in the first row and the first column of . For each entry in the first column of other than the in position , performing an elementary row operation on , hence replacing by an equivalent matrix, will zero that entry. Likewise elementary column operations will zero entries in the first row of beyond the position. Thus, one may assume that the in position is the only non-zero entry in either the first row or the first column of . By the inductive hypothesis the matrix formed by deleting the first row and the first column of satisfies where the only non-zero entries in are successively divisible elements in positions of . Taking one obtains with the only non-zero entries being , , …, . There is still, however, the question of whether divides . Let be a greatest common divisor of and , and let . Replacing the first row of with the sum of itself and the second row multiplied by and then replacing the second column of that by the sum of itself and the first column multiplied by yields a matrix equivalent to , hence equivalent to , having the entry . Since divides but, in view of the choice of , has no fewer prime factors than , one sees that is the product of a unit in with . Therefore, divides since divides .