Hall's theorem and extending partial latinized rectangles

We generalize a theorem of M. Hall Jr., that an r × n Latin rectangle on n symbols can be extended to an n × n Latin square on the same n symbols. Let p, n, ? 1 , ? 2 , ? , ? n be positive integers such that 1 ? ? i ? p ( 1 ? i ? n ) and ? i = 1 n ? i = p 2 . Call an r × p matrix on n symbols ? 1 , ? 2 , ? , ? n an r × p ( ? 1 , ? 2 , ? , ? n ) -latinized rectangle if no symbol occurs more than once in any row or column, and if the symbol ? i occurs at most ? i times altogether ( 1 ? i ? n ) . We give a necessary and sufficient condition for an r × p ( ? 1 , ? 2 , ? , ? n ) -latinized rectangle to be extendible to a p × p ( ? 1 , ? 2 , ? , ? n ) -latinized square. The condition is a generalization of P. Hall's condition for the existence of a system of distinct representatives, and will be called Hall's ( ? 1 , ? 2 , ? , ? n ) -Constrained Condition. We then use our main result to give two further sets of necessary and sufficient conditions. Finally we use our results to show that, given p, n, ? 1 , ? 2 , ? , ? n such that 1 ? ? i ? p , ? i = 1 n ? i = p 2 , then a p × p ( ? 1 , ? 2 , ? , ? n ) -latinized square exists.