Math foundation for namespace problem TLDR;
What is the mathematics foundation for the namespace problem? Can I reduce namespace problem to set theory or other math concepts/objects (lambda calculus, category theory)?  

I'm doing an essay on concepts like namespaces, packages and modules in programming languages. Among other topics, I'm studing how to avoid names collitions and in particular how programming languages solve the problem. For example:

Given any programming language, suppose that we have following user defined functions (or other language specific "object") named $a$ and $b$:

function a () {
  // do something
} 

function b () {
  // do something
} 


And a function called $c$ that uses above functions:

function c () {
  a();
  b();
} 


If in the "context" above we defined another function called $a$, we would have a collision in function $c$ because it doesn't know what $a$-function implementation must use.

So to avoid name collisions a programming languages can implement namespace/package/module systems and let the programmer doing something like the following: 

module alpha{
  function a () {
    // do something
  }
  function b () {
    // do something
  }
} 

module beta{
  function a () {
    // do something
  }
} 


And then doing:

function c () {
  alpha.a();
  alpha.b();
}


or

function c () {
  beta.a();
  alpha.b();
}


Thanks.
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.