Linear operators on matrices: The invariance of rank-k matrices