Model Theoretic Localization This is a re-post on a previous question I asked. My first question was too vague to warrant detailed responses. Really, I have two specific questions to ask. 
1) Let $\sigma = (A; \{0,1\}; +, \times)$ be a signature. Form the language $L(\sigma)$ over $\sigma$. Let $T$ be the theory of commutative rings and let $M$ be a model of this theory. We can realize localization in the model $M$ by specifying a class of formulas in our language $$K = \{s_x \ \mid \  x \in A - (0)\}, \quad  \mbox{where}\  s_x = [\exists x, \ x = x]$$ and then  for each $x$ defining a formula $s_{x}^{-1} = \exists y, xy = 1$. Adding $s_{x}^{-1}$ to our theory $T$, call it $T_x$ and then taking a model $N$ of $T_x$ with the property that there is a monomorphism $M \rightarrow N$ will realize $N$ as a localization of $M$. 
My first question is whether or not this is right way, for a logician to think about localization of a commutative ring?
2) It seems to me that it should be possible to extend this construction to other languages by specifying an appropriate class $K$ and formula's $s_{x}^{-1}$. In particular, this should work for non-commutative rings. 
In summary, what can be said about localization in a first order language?
Edit Actually, in 1), I still have a problem. Specifying a monomorphism $M \rightarrow N$ is not accurate because $M$ may not be integral. Actually, I need to specify a map $M \rightarrow N$ by a universal property.
 A: EDIT: At the bottom, I'll explain how, if you have a ring $R$ and a subset $A$ of $R$, how you can construct a theory such that any model of that theory contains a copy of $R$ such that the copies of elements of $A$ are units.
First, let me comment on a couple issues with the approach you're taking.  Then I'll try to resolve these issues by answering your question, but since I'm not 100% sure what your question is I'll give two answers.
Some technical issues: The formula $\exists x, x = x$ doesn't say anything, it just says "there's something which is equal to itself," which essentially just says "there is something."  Furthermore, this formula is only well-formed when $x$, is a variable, it doesn't make sense to say it when you're picking $x$ to be some element of your ring, it would be like saying $\exists 4, 4 = 4$.  Also, this formula doesn't depend on $x$ the way I think you expect it to.  The formulas $\exists x, x = x$ and $\exists y, y = y$ are essentially the same, much like how $\int f(x) dx$ and $\int f(y) dy$ are the same.
I understand what you're trying to do with your theory $T_x$ (or $T_f$ in the comments), it's supposed to be a theory such that any model has an inverse for all the $x \in A \setminus${$0$}.  The theory you've constructed won't work for various reasons, some of which can be fixed and some can't.  One problem is there's nothing to ensure that a model of $T_x$ has a copy of your original $M$, but this can be fixed.  Another problem is that there's no guarantee that $T_x$ has a model at all.  Or rather, there is a guarantee, and that guarantee comes from the already known fact in commutative ring theory that localizations exists, but model theory is not doing any work for you here.  Similarly, model theory does nothing to guarantee that any resulting model will satisfy the desired universal property.
Now here's how we might try to salvage your approach, and use model theory to "construct" the localization.  I won't go into full detail here since I'm not sure this is what you want to know, but if you want more details just ask and I'll edit my post accordingly (edit: I've added some details at the end).  The vague outline is this: Forget the universal property for now.  Pick an appropriate signature, and theory in this signature, such that a model of this theory would give you the desired object - in this case a commutative ring $N$ into which $M$ embeds such that the image of $A$ under this embedding is contained in the set of units of $N$.  Then, show that every finite subset of this theory has a model, which will essentially amount to showing that you can produce a localization (minus the universal property) for any finite subset of $A$.  At this point, the Compactness Theorem will give a model of your entire theory, and you'll have your $N$ (and implicitly, your embedding).
There's a couple problems here.  First, how would you tackle the stage where you need to be able to show that you can produce a localization (minus the univ. prop.) for finite subsets of $A$?  I would use one of the standard ring-theoretic proofs of the existence of the localization.  But these proofs are sufficiently general that it's just as easy to apply them to the whole of $A$ as it is to apply them to any finite subset of $A$.  In other words, if you're going to have to use a ring-theoretic proof of the existence of localizations at some point in a model-theoretic construction of the localization, why do any of the model theory in the first place and apply your ring-theoretic proof directly to $A$?
More crucially, we have a problem with the universal property.  There's no way to express the universal property in first-order language in such a way that the result of applying the Compactness Theorem has the desired universal property.  If we are working in a much richer structure (e.g. a model of ZFC) where we can talk about rings and the elements of rings both as objects in our universe, then we can express, in a first-order way, that $N$ is the localization $A^{-1}M$, including saying everything we need to about the universal property.  This is just an instance of the fact that most math can be expressed in ZFC.  But if we're trying to do something like in the previous paragraph, where we use model theory, especially Compactness, to produce a localization, then we want to work in the language of rings.  In this case, our universe has to pretty much be just a ring, thus its elements will be objects of a ring, and so we don't have as objects all rings, and all morphisms between rings, etc, i.e. we don't have enough expressive power to talk about the universal property.  And since we can't express the universal property, applying Compactness has no way of guaranteeing us that the resulting object satisfies the universal property.
So to summarize, if you're trying to construct the localization using model theory, you can get all of it except the universal property, but even then, in order to get it you have to make heavy use of ring theory to the point that the model theory isn't doing any of the work for you.
If you merely want to express or axiomatize what it means for something to be the localization of something else, it depends on how rich a structure you want to work in.  If you want to work in ZFC, of course you can express pretty much everything.  If you want to work in the language of rings, you can express everything except the universal property (and again, I can give details of this if you'd like).
EDIT: Consider the following signature:
$\sigma = (0, 1, +, \times, c_r (r\in R))$
Here, $0, 1$ and each $c_r$ are constant symbols, and the other two symbols are binary function symbols.  Let $\mathrm{diag}^+(R, 0, 1, +, \times)$, the so-called positive diagram of $R$, consist of all true atomic formulas in the structure $(R, 0, 1, +, \times, r (r\in R))$ regarded as a $\sigma$-structure.  Now consider the $\sigma$ theory which is the union of the following theories:


*

*$\mathrm{diag}^+(R, \dots , \times)$

*$\{c_r \neq c_s\ |\ r, s\in R,\ r\neq s\}$

*$\{$the commutative ring axioms$\}$

*$\{\exists x (x \times c_a = 1)\ |\ a \in A\}$


The first two will guarantee that we have a copy of $R$ sitting inside our resulting structure, the third guarantees that this structure is a commutative ring, and the last guarantees that everything in $A$ has a unit.
A: General first-order model theory may be too general for treating localizations and analogous concepts.  As Amit explained, one can express the notion of "a ring that contains a copy of $R$ and inverses for all members of $A$", but the universal property of localizations is not expressible in first-order logic.  Nevertheless, concepts like localization are studied, by methods very close to those of model theory, in the case of equational theories, i.e., theories axiomatized by universally quantified equations.  (The study of such theories is part of universal algebra, located at the boundary between logic and algebra.)  Specifically, such theories always have initial models (in fact, free models on any prescribed set of generators --- the initial model is free on $\emptyset$).  The localization of a ring $R$ at a subset $A$ can be described as the initial model of the equational theory given by  


*

*the positive diagram of $R$ (as in Amit's answer),

*the axioms for commutative rings,

*additional constant symbols $d_a$ for each $a\in A$, and 

*axioms $c_a\times d_a=1$.


Exactly analogous constructions can be done for similar algebraic situations, including the case of non-commutative rings (just omit the commutativity in the second bullet item and add in the fourth item that $d_a\times c_a$ is also 1).  The initial model in all such cases can be described as the set of terms (built from the theory's function and constant symbols) modulo the equivalence relation of "equality provable, from instances of the axioms of the theory, by substituting equals for equals and substituting arbitrary terms for variables".  Of course it may take considerable work to understand this provable-equality relation; in particular, it may take considerable work to see that no unwanted identifications result.  Among such "no unwanted identifications" results are injectivity of the canonical map of a Lie algebra into its universal enveloping algebra (a consequence of the Poincare-Birkhoff-Witt theorem) and the theorem that, when you form an amalgamated product of two groups, each of the original groups is embedded in the amalgamation.  Such results are by no means automatic, since the general construction of initial models also includes things like abelianization of groups, where identifications usually do occur.
