When you compress a gas, say within a deodorant can, it temporarily heats up, but then cools to room temperature whilst in the can. It will then cool down to below room temperature once decompressed.
It seems like the gas equation doesn't apply when the gas is cooling down within the can and the pressure remains the same. Does the equation only apply at the instant of compression? It does not apply to liquids, but exactly why does it apply to gases? Also, I have learnt that gases are harder to increase in temperature (require more heat) at high pressures. I can't fully understand why.
Also, can't this concept be used to create a perfect stirling engine? I mean if the gas within the can cools back down to exactly room temperature?
So the question in summary:
1) when and where does this gas law apply and show a proof explaining why
2) why are gases harder to increase in temperature at high pressure, does the same work vice versa?
3) could this in principal make a 100% efficient engine?