  We formulate $U(1)_k$ Chern-Simons theory on a Euclidean spacetime lattice
using the modified Villain approach. Various familiar aspects of continuum
Chern-Simons theory such as level quantization, framing, the discrete 1-form
symmetry and its 't Hooft anomaly, as well as the electric charge of monopole
operators are manifest in our construction. The key technical ingredient is the
cup product and its higher generalizations on the (hyper-)cubic lattice, which
recently appeared in the literature. All unframed Wilson loops are projected
out by a peculiar subsystem symmetry, leaving topological, ribbon-like Wilson
loops which have the correct correlation functions and topological spins
expected from the continuum theory. Our action can be obtained from a new
definition of the theta term in four dimensions which improves upon previous
constructions within the modified Villain approach. This bulk action coupled to
background fields for the 1-form symmetry is given by the Pontryagin square,
which provides anomaly inflow directly on the lattice.
