Theory of lattice thermal conductivity