The **ultraproduct** is a mathematical construction that appears mainly in abstract algebra and mathematical logic, in particular in model theory and set theory. 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.

For example, ultrapowers can be used to construct new fields from given ones. The hyperreal numbers, an ultrapower of the real numbers, are a special case of this.

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 nonstandard 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 *M*_{i} for each element *i* of *I* (all of the same signature), and an ultrafilter *U* on *I*. One usually considers this in the case that *I* to be infinite and *U* contains all cofinite subsets of *I*, i.e. *U* is not a principal ultrafilter. In the principal case the ultraproduct is isomorphic to one of the factors.

Algebraic operations on the Cartesian product

are defined pointwise (for example, if is a binary function then ), and an equivalence relation is defined by if

and hence compares components only relative to the ultrafilter *U*. The **ultraproduct** is the quotient set with respect to The ultraproduct is therefore sometimes denoted by

and acts as a filter product space where elements are equal if they are equal only at the filtered components(non-filtered components are ignored under the equivalence). 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 *M*_{i} is an ordered field, then so is the ultraproduct.

An **ultrapower** is an ultraproduct for which all the factors *M*_{i} 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.

Analogously, one can define nonstandard integers, nonstandard complex numbers, etc., by taking the ultraproduct of copies of the corresponding structures.

As an example of the carrying over of relations into the ultraproduct, consider the sequence *ψ* defined by *ψ*_{i} = 2*i*. Because *ψ*_{i} > *ω*_{i} = *i* for all *i*, it follows that the equivalence class of *ψ*_{i} = 2*i* 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, 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 *M*_{i} 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

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

In model theory and set theory, the direct limit of a sequence of ultrapowers is often considered. In model theory, this construction can be referred to as an **ultralimit** or **limiting ultrapower**.

Beginning with a structure, *A*_{0}, and an ultrafilter, *D*_{0}, form an ultrapower, *A*_{1}. Then repeat the process to form *A*_{2}, 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.