Compactness in a group