structure in context of ultraproduct Ultraproduct is defined as $$\prod_{i \in I} M_i $$
I know that structure is usually of form $(A, \sigma, I)$, but in this context, what exactly is structure, and how do we get the cartesian product?
Edit: so $M_i$ is structure here according to the definition of ultraproduct, but how can structures be combined to form cartesian product?
 A: We give a fairly formal description, followed by more informal remarks at the end. 
Ordinarily, the $M_i$ are $L$-structures for a first-order language $L$.
Denote the underlying set of $M_i$ by $|M_i|$.
Let $D$ be an ultrafilter on $I$. 
Consider the product $\prod_{i\in I} |M_i|$. This is the set of all functions $f$ from $I$ to the union of the $|M_i|$ such that $f(i)\in |M_i|$ for all $i$. 
If $f$ and $g$ are in $\prod_{i\in I} |M_i|$, we say that $f$ and $g$ are equivalent modulo $D$ if $\{i|f(i)=g(i)\} \in D$. This is an equivalence relation. 
The underlying set of the ultraproduct $(\prod_{i\in I} M_i)/D$ is the set of equivalence classes of $\prod_{i\in I} |M_i|$ under the above equivalence relation. Let |U|$ be this set of equivalence classes.
Now it remains to define  the right structure $U$ with underlying set $|U|$ as described above. So we have to give interpretations for all the constant symbols, function symbols, and relation symbols of $L$.
Constant symbols are the simplest. Let $c$ be a constant symbol of $L$. Then $c$ has an interpretation $c_i$ in $M_i$. We interpret $c$ in $U$ to be the equivalence class of the function $f$ such that $f(i)=c_i$.
Now suppose that $F$ is a say binary function symbol of $L$. We want to interpret $F$ in $U$. Let $F_i$ be the interpretation of $F$ in $M_i$. We will describe the interpretation $F_U$ of $F$ in $U$.
Let $\bar{f}$ and $\bar{g}$ be elements of $|U|$, that is, equivalence classes of functions. Then $F_U(\bar{f},\bar{g})$ is the equivalence class of the function $h$ such that $h(i)=F_i(f(i),g(i))$ for all $i$. We do need to check that this definition, which appears to depend on our choice of representatives for $\bar{f}$ and $\bar{g}$, is in fact independent of the choice of representatives.
Interpretations of relation symbols are handled in a similar way.
Remark: Think of elements of the product as "sequences" such that the $i$-th entry is in $|M_i|$. If we have two such sequences, we say they are equivalent if the set of $i$ on which they agree is in $D$, informally that the set on which they agree is "large." Think of sets in the ultrafilter as having measure $1$, and their complements as having measure $0$. "Measure" is kind of stretching terminology, since we almost always only have finite additivity. But it is useful to think of $f$ equivalent to $g$ if they agree "almost everywhere."
Then the structure on the ultraproduct is obtained in the natural way, "pointwise."  Except, of course, that we identify sequences that are equal almost everywhere. Constructions of this type are also quite common in analysis.  
An important special case is the ultrapower $M^I/d$, where all the $M_i$ are the same. Take or example the structure $ \mathbb{Z}^I/D$, where $I$ is the set of natural numbers, and $D$ is a non-principal ulrafilter. The elements of the ultrapower are just equivalence classes of integer-valued sequences. We add, multiply equivalence classes of sequences essentially by pointwise addition and multiplication, except that two sequences that are equal almost everywhere are considered the same. This is crucial for the preservation of properties. For example, under pointwise multiplication, the product $\mathbb{Z}$ has plenty of non-trivial zero-divisors. But the ultrapower $\mathbb{Z}^I/D$ doesn't. 
A: In the most general sense, suppose we have a family $\{ \mathfrak{A}_i \}_{i \in I}$ of structures over the same first-order language/signature, and an ultrafilter $\mathcal{U}$ on the index set $I$.  The ultraproduct of this family with respect to the ultrafilter $\mathcal{U}$ is defined according to the follow steps:


*

*Define an equivalence relation $\sim$ on $\prod_{i \in I} A_i$ (where $A_i$ is the universe of the structure $\mathfrak{A}_i$) by $$( x_i )_{i \in I} \sim ( y_i )_{i \in I} \; \Leftrightarrow \; \{ i \in I : x_i = y_i \} \in \mathcal{U};$$

*The universe of the ultraproduct $\mathfrak{A} = ( \prod_{i \in I} \mathfrak{A}_i ) / \mathcal{U}$ is then $( \prod_{i \in I} A_i ) / \mathord{\sim}$, the family of all $\sim$-equivalence classes.

*For each $n$-ary function $f$ in the signature, the function $f^{\mathfrak{A}}$ is defined according to $$f^{\mathfrak{A}} ( [ x^1 ]_{\sim} , \ldots , [ x^n ]_\sim ) = [ y ]_\sim \; \Leftrightarrow \; \{ i \in I : f^{\mathfrak{A}_i} ( x^1_i , \ldots , x^n_i ) = y_i ) \} \in \mathcal{U};$$

*For each $m$-ary relation $R$ in the signature, the relation $R^{\mathfrak{A}}$ is defined according to $$R^{\mathfrak{A}} ( [ x^1 ]_\sim , \ldots , [ x^m ]_\sim ) \; \Leftrightarrow \; \{ i \in I : R^{\mathfrak{A}_i} ( x^1_i , \ldots , x^m_i ) \} \in \mathcal{U}.$$


Of course we have to show that the results of (3) and (4) above are actually well-defined, but this is not too difficult.
