The 2nd law of thermodynamics as explained by University Physics states that
"It is impossible for any process to have its sole result the transfer of heat from a colder to a hotter body."
Now my question is simple, in reverse refrigeration or inverter Air Conditioner, heat flows from a colder (outside) to a hotter (inside) body. Work done is often 1/3rd of what is transferred depending on coefficient of performance. So let's suppose a 2kW (electrical energy) inverter is delivering 6kW of heat inside. The net transfer is 4kW of heat from a colder to a hotter body. How is that not violating the 2nd law of thermodynamics?