  The purpose of this article is to study the correspondence between
$3d$-gravity and the Chern-Simons field theory from the perspective of
geometric mechanics, specifically in the case where the structure group is the
general affine group. To accomplish this, the paper discusses a variational
problem of the Chern-Simons type on a principal fiber bundle with this group as
its structure group. The connection to the usual Chern-Simons theory is
established by utilizing a generalization, in the context of Cartan
connections, of the notion of extension and reduction of connections.
