**Question:** If I had a container, full with air, and I suddenly decreased the volume of the container, forcing the air into a smaller volume, will it be considered as compression, will it result in an increase in temperature, and why?

**Answer on Stack Exchange by Luboš Motl:** Yes, it is compression and yes, it will heat up the gas.

If there’s no heat exchange between the gas and the container (or the environment), we call it an adiabatic process. For an adiabatic process involving an ideal gas (which is a very good approximation for most common gases), pV^{γ} is constant where γ is an exponent such as 5/3. Because the temperature is equal to T=pV/nR and pV/pV^{γ}=V^{1−γ} is a decreasing function of V, the temperature will increase when the volume decreases.

Macroscopically, the heating is inevitable because one needs to perform work p|dV| to do the compression, the energy has to be preserved, and the only place where it can go is the interior of the gas given by a formula similar to (3/2)nRT.