In CLRS, an approach has been given to prove the optimal substructure and the correctness of the greedy algorithm for the activity selection problem. In the Lecture Hall assignment problem, we sort the classes according to their starting times and assign them lecture halls accordingly, choosing a new lecture hall if the timings of the class conflict with all the existing lecture halls. Is there a way to prove the optimal substructure in this problem? Why do we only sort the lectures according to their starting times and not according to their finishing times? How can we prove that there is always an optimal solution which makes the greedy choice?