# Is an order necessary in a finite or infinite cartesian product?

The elements of $$\displaystyle \prod_{i\in I}X_i$$ are usually represented by tuples. For this cartesian product to be defined, is it necessary for $$I$$ to be an ordered set?

I guess the answer is no because by definition, the product is just the set of all functions $$f: I \to \bigcup_{i \in I} X_i$$ such that $$f(i)\in X_i$$ for each $$i\in I.$$
Remark: how do we know that this product is not empty? If $$X$$ is a set, then the Axiom of Choice says that for each $$x\in X$$, there is a function $$f$$ that maps $$x$$ into $$\bigcup X$$, such that $$f(x)\in x.$$ Now, if $$X=\{X_i\}_{i\in I}$$ this means that for each $$X_i\in X,$$ there is a function $$f$$ that sends $$X_i$$ to an element of $$X_i$$, and therefore, the composition $$f\circ g:I\to \bigcup_{i \in I} X_i$$, satisfies the definition of the product, where $$g(i)=X_i.$$ That is, the product is not empty.
No. Paraphrasing from the nLab to match your notation, the product $$\prod_{i \in I} X_i$$ is the set of functions $$f$$ with domain $$I$$ where $$f(i) \in X_i$$ for each $$i \in I$$.
If you want an explicit codomain for $$f$$, you can take it to be $$\bigsqcup_{i \in I} A_i$$. This notation assumes that the $$A_i$$ are disjoint, which you can achieve by replacing $$A_i$$ with $$\{ i \} \times A_i$$, then dropping the first coordinate after you apply $$f$$. Note that, again following the same nLab page, I've used (very special) binary Cartesian products in that argument, so you might want to pick your favourite way to define those, as a base case.