We use Chen iterated line integrals to construct a topological algebra
A(p) of separating functions on the group of loops LM(p). A(p) has a
Hopf algebra structure which allows the construction of a group struct
ure on its spectrum. We call this topological group the group of gener
alized loops LM(p). Then we develop a loop calculus, based on the end
point and area derivative operators, providing a rigorous mathematical
treatment of the early heuristic ideas of Gambini, Trias and also Man
delstam, Makeenko and Migdal. Finally, we define a natural action of t
he ''pointed'' diffeomorphism group Diff(p)(M) on LM(p), and consider
a variational derivative which allows the construction of homotopy inv
ariants. This formalism is useful for constructing a mathematical theo
ry of loop representation of gauge theories and quantum gravity.