There are two statements to the second law of thermodynamics
Kelvin-Planck statement: It is impossible for any device that operates on a cycle to receive heat from a single reservoir and produce a net amount of work.
Clausius statement: It is impossible to construct a device that operates in a cycle and produces no effect other than the transfer of heat from a lower-temperature body to a higher-temperature body.
There are two statements of the second law of thermodynamics that relates to Heat engines and refrigeration/heat pump systems respectively. That is Kelvin-Planck's statement relates to work producing thermodynamic cycles such as heat engines and Clausius's statement relates to work consuming thermodynamic cycles such as heat pumps and refrigeration cycles. Even though there are two statements to the second law, violating any one of the statements automatically violates another statement and it can be proved.