Next-Token Prediction Task Assumes Optimal Data Ordering for LLM Training in Proof Generation