Let $k$ be a field, and $A$ a finitely generated $k$-algebra. Let $X$ be the space of maximal ideals of $A$ in the Zariski topology. For $D$ a basic open set in $X$, let $$S_D = \{f \in A : f \not\in \mathfrak m, \textrm{ for all } \mathfrak m \in D \}$$ If $D = D(g)$, there is a natural identification of $k$-algebras $A_g = S_D^{-1}A$. J.S. Milne writes (Algebraic Groups, pg. 492), There is a unique sheaf of $k$-algebra on $X$ such that $\mathcal O_X(D) = S_D^{-1}A$ for all basic open subsets $D$, and restriction $\mathcal O_X(D') \rightarrow \mathcal O_X(D)$ is the natural map $S_{D'}^{-1}A \rightarrow S_D^{-1}A$ for $D \subseteq D'$.
Milne then refers to any ringed space which is isomorphic to $(X,\mathcal O_X)$ as an affine $k$-scheme. I was wondering whether this notion is the same as the one given in Borel or Hartshorne:
Borel (in Linear Algebraic Groups) defines $S_D$ in the same way as above, except for $D$ open, not necessarily basic, and then defines an affine $k$-scheme to be $X$ together with a sheafification of the presheaf of $k$-algebras $U \mapsto S_D^{-1}A$.
Hartshorne (in Algebraic Geometry) does not use the same definition of a scheme, since he (like most people I guess) considers all prime ideals rather than just maximal ideals. My naive guess as to how to carry over Hartshorne's notion of an affine scheme would be to define $\mathcal O_X(U)$, for $U$ open in $X$ (remember I'm saying that $X$ here is the space of maximal ideals, not the space of prime ideals), to be the $k$-algebra of functions $s$ from $U$ into the disjoint union $\bigcup\limits_{\mathfrak m \in U} A_{\mathfrak m}$, such that $U$ is covered by open sets $U_i$, such that for each $i$, there exist $a \in A, b \in S_{U_i}$, such that $s(\mathfrak m) = \frac{a}{b}$ for all $\mathfrak m \in U$.
I haven't yet made a serious attempt at proving these three characterizations of "affine $k$-scheme" are equivalent. But would anyone be able to tell, at a glance, whether Milne, Borel, and (the modification of Hartshorne) really are talking about the same thing?
They are not the same thing. Milne's Algebraic Groups is clear from the outset that it only wants to work with objects of finite type over a field; these are the hypotheses that allow you to work only with maximal ideals and to ignore prime ideals, so his definitions are nonstandard.
With the correct definition, the category of affine $k$-schemes is the opposite of the category of commutative $k$-algebras (no finite generation hypothesis). One way to describe this category is to describe its essential image in all $k$-schemes, hence the need to work with locally ringed spaces and so forth. Hartshorne's definition is the standard one here.