The definition of a sub-compact is a car of length < 4191mm. The cars in questions are of greater length.
Other ways of defining a compact is a wheel base of 100in - 105in; Both cars fall in this category
These are set standards which are set out by powers greater than you and I; I am just reproducing them here.
Finally Google is your friend. Current Gen city and Corolla are both defined as compacts.