  In a granular solid, mechanical equilibrium requires a delicate balance of
forces at the disordered grain scale. To understand how macroscopic rigidity
can emerge in this amorphous solid, it is crucial that we understand how
Newton's laws pass from the disordered grain scale to the laboratory scale. In
this work, we introduce an exact discrete calculus, in which Newton's laws
appear as differential relations at the scale of a single grain. Using this
calculus, we introduce gauge variables which describe identically force- and
torque-balanced configurations. In a first, intrinsic formulation, we use the
topology of the contact network, but not its geometry. In a second, extrinsic
formulation, we introduce geometry with the Delaunay triangulation. These
formulations show, with exact methods, how topology and geometry in a
disordered medium are related by constraints. In particular, we derive Airy's
expression for a divergence-free, symmetric stress tensor in two and three
dimensions.
