The lhs represents the Training set, and the rhs represents the query set, so m_k should be less than the number of training set vectors, rather than less than query set vectors.