I think the framework you are looking for may be found in thinking about the "logic" of mathematics in terms of a "formal language." See the articles on formal languages in the Encyclopedia of MathematicsEncyclopedia of Mathematics and in MathWorld and Wikipedia.