Mathematical Guarantees of Near-Optimal Cross-Entropy Loss through Neural Collapse