A FUNCTIONAL AND LAGRANGIAN FORMULATION OF TWO DIMENSIONAL TOPOLOGICAL GRAVITY