Relaxation of an atom and a cavity mode in an entangled environment