  We give a detailed account of the cyclic $L_\infty$-algebra formulation of
general relativity with cosmological constant in the Einstein-Cartan-Palatini
formalism on spacetimes of arbitrary dimension and signature, which encompasses
all symmetries, field equations and Noether identities of gravity without
matter fields. We present a local formulation as well as a global covariant
framework, and an explicit isomorphism between the two $L_\infty$-algebras in
the case of parallelizable spacetimes. By duality, we show that our
$L_\infty$-algebras describe the complete BV-BRST formulation of
Einstein-Cartan-Palatini gravity. We give a general description of how to
extend on-shell redundant symmetries in topological gauge theories to off-shell
correspondences between symmetries in terms of quasi-isomorphisms of
$L_\infty$-algebras. We use this to extend the on-shell equivalence between
gravity and Chern-Simons theory in three dimensions to an explicit
$L_\infty$-quasi-isomorphism between differential graded Lie algebras which
applies off-shell and for degenerate dynamical metrics. In contrast, we show
that there is no morphism between the $L_\infty$-algebra underlying gravity and
the differential graded Lie algebra governing $BF$ theory in four dimensions.
