Thomas–Reiche–Kuhn (TRK) sum rule for interacting photons