Sheaf of algebras

In algebraic geometry, a sheaf of algebras on a ringed space "X" is a sheaf of commutative rings on "X" that is also a sheaf of formula_1-modules. It is quasi-coherent if it is so as a module.
When "X" is a scheme, just like a ring, one can take the global Spec of a quasi-coherent sheaf of algebras: this results in the contravariant functor formula_2 from the category of quasi-coherent (sheaves of) formula_1-algebras on "X" to the category of schemes that are affine over "X" (defined below). Moreover, it is an equivalence: the quasi-inverse is given by sending an affine morphism formula_4 to formula_5
Affine morphism.
A morphism of schemes formula_6 is called affine if formula_7 has an open affine cover formula_8's such that formula_9 are affine. For example, a finite morphism is affine. An affine morphism is quasi-compact and separated; in particular, the direct image of a quasi-coherent sheaf along an affine morphism is quasi-coherent.
The base change of an affine morphism is affine. 
Let formula_6 be an affine morphism between schemes and formula_11 a locally ringed space together with a map formula_12. Then the natural map between the sets:
is bijective.
The formation of direct images.
Given a ringed space "S", there is the category formula_23 of pairs formula_24 consisting of a ringed space morphism formula_25 and an formula_1-module formula_27. Then the formation of direct images determines the contravariant functor from formula_23 to the category of pairs consisting of an formula_29-algebra "A" and an "A"-module "M" that sends each pair formula_24 to the pair formula_31.
Now assume "S" is a scheme and then let formula_32 be the subcategory consisting of pairs formula_33 such that formula_34 is an affine morphism between schemes and formula_27 a quasi-coherent sheaf on formula_36. Then the above functor determines the equivalence between formula_37 and the category of pairs formula_38 consisting of an formula_29-algebra "A" and a quasi-coherent formula_40-module formula_27.
The above equivalence can be used (among other things) to do the following construction. As before, given a scheme "S", let "A" be a quasi-coherent formula_29-algebra and then take its global Spec: formula_43. Then, for each quasi-coherent "A"-module "M", there is a corresponding quasi-coherent formula_1-module formula_45 such that formula_46 called the sheaf associated to "M". Put in another way, formula_47 determines an equivalence between the category of quasi-coherent formula_1-modules and the quasi-coherent formula_40-modules.