Sum rules and electrodynamics of high-T c cuprates in the pseudogap state