Theory of chemical fluctuations in thermal explosions