I have been taught that the an engine running on the Carnot's cycle has the maximum energy among the maximum efficiency, however I never found a convincing proof for it. Wherever I have put this question up, everyone just said pit it up against any engine and it will come out with a higher efficiency.
I would like to know if there is any way to prove mathematically that the Carnot's cycle has the maximum efficiency among any cycle?
Also, I have the belief that the second law of thermodynamics is a consequence of the fact that the Carnot's cycle has the maximum efficiency among any cycle. Because the Carnot's cycle has come before the second law of thermodynamics, I suppose that the former points to the latter. Is it actually true that the second law of thermodynamics comes from Carnot's theorem, and is it possible to prove that a Carnot's cycle would have the maximum efficiency for a particular amount of heat given in?