First of all, we took irreversible engine and carnot engine. we stated that irreversible is more efficient than carnot one. then we disproved it by contradicting 2nd law. all fine now.
Not so fine. That the Carnot engine is the most efficient one was actually the initial version (prototype) of the second law of thermodynamics. Carnot deduced it from the premise
"Heat is an indestructible substance (caloric) that cannot be converted into work by the heat engine"
which then turned out to be false. Carnot discovered the falsehood and was going to abandon the (prototype of the) second law of thermodynamics but died prematurely. The proofs that you cite are logically correct but morally incorrect - the initial version of the second law is deduced from a later (Kelvin-Planck) one.
Here are Carnot's qualms:
REFLECTIONS ON THE MOTIVE POWER OF HEAT, Sadi Carnot: p. 225: "Heat is simply motive power, or rather motion which has changed form. It is a movement among the particles of bodies. Wherever there is destruction of motive power there is, at the same time, production of heat in quantity exactly proportional to the quantity of motive power destroyed. Reciprocally, wherever there is destruction of heat, there is production of motive power." p. 222: "Could a motion (that of radiating heat) produce matter (caloric)? No, undoubtedly; it can only produce a motion. Heat is then the result of a motion. Then it is plain that it could be produced by the consumption of motive power, and that it could produce this power. All the other phenomena - composition and decomposition of bodies, passage to the gaseous state, specific heat, equilibrium of heat, its more or less easy transmission, its constancy in experiments with the calorimeter - could be explained by this hypothesis. But it would be DIFFICULT TO EXPLAIN WHY, IN THE DEVELOPMENT OF MOTIVE POWER BY HEAT, A COLD BODY IS NECESSARY; why, in consuming the heat of a warm body, motion cannot be produced."