compactness theorem