Math foundation for namespace problem
Looking around on google, I couldn't find much on this topic at all. However, I did find this thesis on arxiv, which I believe addresses this problem, albeit in a semi-roundabout way. As the author states in the conclusion


  The goal of this work was to discover namespaces in mathematical notation
  given a collection of documents with mathematical formulae. This
  problem could not be performed manually: this task it too time consuming
  and requires a lot of effort. 
  To achieve the goal we proposed an automatic method based on cluster
  analysis. We noted that document representation in terms of identifiers is
  similar to the classic Vector Space Model. This allowed us to apply traditional document clustering techniques to the namespace discovery problem.


So cluster analysis seems to be something to look into here.

Hope this helps; I'll keep looking around for other resources.