  We consider the problem of defining localized subsystems in gauge theory and
gravity. Such systems are associated to spacelike hypersurfaces with boundaries
and provide the natural setting for studying entanglement entropy of regions of
space. We present a general formalism to associate a gauge-invariant classical
phase space to a spatial slice with boundary by introducing new degrees of
freedom on the boundary. In Yang-Mills theory the new degrees of freedom are a
choice of gauge on the boundary, transformations of which are generated by the
normal component of the nonabelian electric field. In general relativity the
new degrees of freedom are the location of a codimension-2 surface and a choice
of conformal normal frame. These degrees of freedom transform under a group of
surface symmetries, consisting of diffeomorphisms of the codimension-2
boundary, and position-dependent linear deformations of its normal plane. We
find the observables which generate these symmetries, consisting of the
conformal normal metric and curvature of the normal connection. We discuss the
implications for the problem of defining entanglement entropy in quantum
gravity. Our work suggests that the Bekenstein-Hawking entropy may arise from
the different ways of gluing together two partial Cauchy surfaces at a
cross-section of the horizon.
