The ultraproduct is a mathematical construction that appears mainly in abstract algebra and in model theory, a branch of mathematical logic. An ultraproduct is a quotient of the direct product of a family of structures. All factors need to have the same signature. The ultrapower is the special case of this construction in which all factors are equal.
Some striking applications of ultraproducts include very elegant proofs of the compactness theorem and the completeness theorem, Keisler's ultrapower theorem, which gives an algebraic characterization of the semantic notion of elementary equivalence, and the Robinson-Zakon presentation of the use of superstructures and their monomorphisms to construct nonstandard models of analysis, leading to the growth of the area of non-standard analysis, which was pioneered (as an application of the compactness theorem) by Abraham Robinson.
The general method for getting ultraproducts uses an index set I, a structure Mi for each element i of I (all of the same signature), and an ultrafilter U on I. The usual choice is for I to be infinite and U to contain all cofinite subsets of I. Otherwise the ultrafilter is principal, and the ultraproduct is isomorphic to one of the factors.
Algebraic operations on the Cartesian product
are defined in the usual way (for example, for a binary function +, (a + b) i = ai + bi ), and an equivalence relation is defined by a ~ b if and only if
and the ultraproduct is the quotient set with respect to ~. The ultraproduct is therefore sometimes denoted by
One may define a finitely additive measure m on the index set I by saying m(A) = 1 if A ∈ U and = 0 otherwise. Then two members of the Cartesian product are equivalent precisely if they are equal almost everywhere on the index set. The ultraproduct is the set of equivalence classes thus generated.
Other relations can be extended the same way:
where [a] denotes the equivalence class of a with respect to ~.
In particular, if every Mi is an ordered field, then so is the ultraproduct.
An ultrapower is an ultraproduct for which all the factors Mi are equal:
More generally, the construction above can be carried out whenever U is a filter on I; the resulting model is then called a reduced product.
The hyperreal numbers are the ultraproduct of one copy of the real numbers for every natural number, with regard to an ultrafilter over the natural numbers containing all cofinite sets. Their order is the extension of the order of the real numbers. For example, the sequence ω given by ωi = i defines an equivalence class representing a hyperreal number that is greater than any real number.
As an example of the carrying over of relations into the ultraproduct, consider the sequence ψ defined by ψi = 2i. Because ψi > ωi = i for all i, it follows that the equivalence class of ψi = 2i is greater than the equivalence class of ωi = i, so that it can be interpreted as an infinite number which is greater than the one originally constructed. However, let χi = i for i not equal to 7, but χ7 = 8. The set of indices on which ω and χ agree is a member of any ultrafilter (because ω and χ agree almost everywhere), so ω and χ belong to the same equivalence class.
In the theory of large cardinals, a standard construction is to take the ultraproduct of the whole set-theoretic universe with respect to some carefully chosen ultrafilter U. Properties of this ultrafilter U have a strong influence on (higher order) properties of the ultraproduct; for example, if U is σ-complete, then the ultraproduct will again be well-founded. (See measurable cardinal for the prototypical example.)
Łoś's theorem 
Łoś's theorem, also called the fundamental theorem of ultraproducts, is due to Jerzy Łoś (the surname is pronounced [ˈwɔɕ], approximately "wash"). It states that any first-order formula is true in the ultraproduct if and only if the set of indices i such that the formula is true in Mi is a member of U. More precisely:
Let σ be a signature, an ultrafilter over a set , and for each let be a σ-structure. Let be the ultraproduct of the with respect to , that is, Then, for each , where , and for every σ-formula ,
The theorem is proved by induction on the complexity of the formula . The fact that is an ultrafilter (and not just a filter) is used in the negation clause, and the axiom of choice is needed at the existential quantifier step. As an application, one obtains the transfer theorem for hyperreal fields.
Let R be a unary relation in the structure M, and form the ultrapower of M. Then the set has an analog *S in the ultrapower, and first-order formulas involving S are also valid for *S. For example, let M be the reals, and let Rx hold if x is a rational number. Then in M we can say that for any pair of rationals x and y, there exists another number z such that z is not rational, and x < z < y. Since this can be translated into a first-order logical formula in the relevant formal language, Łoś's theorem implies that *S has the same property. That is, we can define a notion of the hyperrational numbers, which are a subset of the hyperreals, and they have the same first-order properties as the rationals.
Consider, however, the Archimedean property of the reals, which states that there is no real number x such that x > 1, x > 1 +1 , x > 1 + 1 + 1, ... for every inequality in the infinite list. Łoś's theorem does not apply to the Archimedean property, because the Archimedean property cannot be stated in first-order logic. In fact, the Archimedean property is false for the hyperreals, as shown by the construction of the hyperreal number ω above.
- For the ultraproduct of a sequence of metric spaces, see Ultralimit.
Beginning with a structure, A0, and an ultrafilter, D0, form an ultrapower, A1. Then repeat the process to form A2, and so forth. For each n there is a canonical diagonal embedding . At limit stages, such as Aω, form the direct limit of earlier stages. One may continue into the transfinite.