Corollary 3
Tag 074A, permanent. Cite it as [Bourbaki, Tag 074A].
Algebra, chapter VII, § 4. Finitely generated modules over a principal ideal domain
— *Let L and M be two free -modules of rank n, let be a basis for L and a basis for M (), let u be a homomorphism from L into M, and let U be its matrix with respect to the bases and . Then is finite if and only if , and then . By changing bases in L and M if necessary, we may assume that U has the form described in VII, p. 22, Cor. 1 to Prop. 5 (where the are in this case integers); the corollary then becomes obvious, since the order of a direct sum of -modules () is infinite if one of the is zero, and is equal to otherwise.
Bourbaki puts the proof directly after the statement, so what is above is the statement and its proof together.