Electric polarization as a nonquantized topological response and boundary Luttinger theorem