In the works of A. Achúcarro and P. K. Townsend and also by E. Witten, a duality between threedimensional Chern-Simons gauge theories and gravity was established. First (Achúcarro and Townsend), by considering an Inönü-Wigner contraction from a superconformal gauge theory to an Anti-de Sitter supergravity. Then, Witten was able to obtain, from Chern-Simons theory (in two cases: Poincaré and de Sitter gauge theories), an Einstein-Hilbert gravity by mapping the gauge symmetry in local isometries and diffeomorphisms. In all cases, the results made use of the field equations. Latter, we were capable to generalize Witten's work (in Euclidean spacetime) to the off-shell cases, as well as to four dimensional Yang-Mills theory with de Sitter gauge symmetry. The price we paid is that curvature and torsion must obey some constraints under the action of the interior derivative. These constraints implied on the partial breaking of diffeomorphism invariance. In the present work, we, first, formalize our early results in terms of fiber bundle theory by establishing the formal aspects of the map between a principal bundle (gauge theory) and a coframe bundle (gravity) with partial breaking of diffeomorphism invariance. Then, we study the effect of the constraints on the homology defined by the interior derivative. The result being the emergence of a nontrivial homology in Riemann-Cartan manifolds.