{{Short description|Mathematical set formed from two given sets}} {{Use mdy dates|date=August 2017}} {{Redirect|Cartesian square|Cartesian squares in category theory|Cartesian square (category theory)}} thumb|Cartesian product of the sets {''x'',''y'',''z''} and {1,2,3}

In mathematics, specifically set theory, the '''Cartesian product''' of two sets {{mvar|A}} and {{mvar|B}}, denoted {{math|''A'' × ''B''}}, is the set of all ordered pairs {{math|(''a'', ''b'')}} where {{mvar|a}} is an element of {{mvar|A}} and {{mvar|b}} is an element of {{mvar|B}}.<ref name=":1">{{MathWorld |id=CartesianProduct |title=Cartesian Product |access-date=2020-09-05}}</ref> In terms of set-builder notation, that is <math display=block>A\times B = \{(a,b)\mid a \in A \ \mbox{ and } \ b \in B\}.</math><ref>{{cite book |last=Warner |first=S. |title=Modern Algebra |page=6 |publisher=Dover Publications |date=1990}}</ref><ref>{{cite web |last=Nykamp |first=Duane |title=Cartesian product definition |url=https://mathinsight.org/definition/cartesian_product |access-date=September 5, 2020 |website=Math Insight}}</ref>

A table can be created by taking the Cartesian product of a set of rows and a set of columns. If the Cartesian product {{nowrap|''rows'' × ''columns''}} is taken, the cells of the table contain ordered pairs of the form {{nowrap|(row value, column value)}}.<ref name=":2">{{cite web |title=Cartesian Product |url=http://web.mnstate.edu/peil/MDEV102/U1/S7/Cartesian4.htm |access-date=2020-09-05 |website=web.mnstate.edu |archive-date=July 18, 2020 |archive-url=https://web.archive.org/web/20200718035119/http://web.mnstate.edu/peil/MDEV102/U1/S7/Cartesian4.htm |url-status=dead}}</ref>

One can similarly define the Cartesian product of {{mvar|n}} sets, also known as an '''{{mvar|n}}-fold Cartesian product''', which can be represented by an {{mvar|n}}-dimensional array, where each element is an {{mvar|n}}-tuple. An ordered pair is a 2-tuple or couple. More generally still, one can define the Cartesian product of an indexed family of sets.

The Cartesian product is named after René Descartes,<ref>{{cite web |title=Cartesian |date=2009 |website=Merriam-Webster.com |access-date=December 1, 2009 |url=https://www.merriam-webster.com/dictionary/Cartesian}}</ref> whose formulation of analytic geometry gave rise to the concept, which is further generalized in terms of direct product.

== Set-theoretic definition == A rigorous definition of the Cartesian product requires a domain to be specified in the set-builder notation. In this case the domain would have to contain the Cartesian product itself. For defining the Cartesian product of the sets <math>A</math> and <math>B</math>, with the typical Kuratowski's definition of a pair <math>(a,b)</math> as <math>\{\{a\},\{a,b\}\}</math>, an appropriate domain is the set <math>\mathcal{P}(\mathcal{P}(A\cup B))</math> where <math>\mathcal{P}</math> denotes the power set. Then the Cartesian product of the sets <math>A</math> and <math>B</math> would be defined as<ref>{{cite web |last=Corry |first=S. |title=A Sketch of the Rudiments of Set Theory |access-date=May 5, 2023 |url=https://www2.lawrence.edu/fast/corrys/Math300/SetTheory.pdf}}</ref> <math display=block>A\times B=\{x\in\mathcal{P}(\mathcal{P}(A\cup B))\mid\exists a\in A\ \exists b\in B:x=(a,b)\}.</math>

== Examples ==

=== A deck of cards === thumb|Standard 52-card deck

An illustrative example is the standard 52-card deck. The standard playing card ranks {A, K, Q, J, 10, 9, 8, 7, 6, 5, 4, 3, 2} form a 13-element set. The card suits {{nowrap|{♠, {{color|#c00000|♥}}, {{color|#c00000|♦}}, ♣}}} form a four-element set. The Cartesian product of these sets returns a 52-element set consisting of 52 ordered pairs, which correspond to all 52 possible playing cards.

{{nowrap|''Ranks'' × ''Suits''}} returns a set of the form {(A,&nbsp;♠), (A,&nbsp;{{color|#c00000|♥}}), (A,&nbsp;{{color|#c00000|♦}}), (A,&nbsp;♣), (K,&nbsp;♠), ..., (3,&nbsp;♣), (2,&nbsp;♠), (2,&nbsp;{{color|#c00000|♥}}), (2,&nbsp;{{color|#c00000|♦}}), (2,&nbsp;♣)}.

{{nowrap|''Suits'' × ''Ranks''}} returns a set of the form {(♠,&nbsp;A), (♠,&nbsp;K), (♠,&nbsp;Q), (♠,&nbsp;J), (♠,&nbsp;10), ..., (♣,&nbsp;6), (♣,&nbsp;5), (♣,&nbsp;4), (♣,&nbsp;3), (♣,&nbsp;2)}.

These two sets are distinct, even disjoint, but there is a natural bijection between them, under which (3,&nbsp;♣) corresponds to (♣,&nbsp;3) and so on.

=== A two-dimensional coordinate system === thumb|Cartesian coordinates of example points

The main historical example is the Cartesian plane in analytic geometry. In order to represent geometrical shapes in a numerical way, and extract numerical information from shapes' numerical representations, René Descartes assigned to each point in the plane a pair of real numbers, called its coordinates. Usually, such a pair's first and second components are called its {{mvar|x}} and {{mvar|y}} coordinates, respectively (see picture). The set of all such pairs (i.e., the Cartesian product <math>\R\times\R</math>, with <math>\R</math> denoting the real numbers) is thus assigned to the set of all points in the plane.<ref>{{cite book|title=Probability: An Introduction|series=Dover Books on Mathematics|first=Samuel|last=Goldberg|publisher=Courier Corporation|year=1986|isbn=9780486652528|page=41|url=https://books.google.com/books?id=CmzFx9rB_FcC&pg=PA41}}</ref>

== Most common implementation (set theory) == {{Main article|Implementation of mathematics in set theory}}

A formal definition of the Cartesian product from set-theoretical principles follows from a definition of ordered pair. The most common definition of ordered pairs, Kuratowski's definition, is <math>(x, y) = \{\{x\},\{x, y\}\}</math>. Under this definition, <math>(x, y)</math> is an element of <math>\mathcal{P}(\mathcal{P}(X \cup Y))</math>, and <math>X\times Y</math> is a subset of that set, where <math>\mathcal{P}</math> represents the power set operator. Therefore, the existence of the Cartesian product of any two sets in ZFC follows from the axioms of pairing, union, power set, and specification. Since functions are usually defined as a special case of relations, and relations are usually defined as subsets of the Cartesian product, the definition of the two-set Cartesian product is necessarily prior to most other definitions.

=== Non-commutativity and non-associativity === Let {{mvar|A}}, {{mvar|B}}, and {{mvar|C}} be sets.

The Cartesian product {{math|''A'' × ''B''}} is not commutative, <math display=block>A \times B \neq B \times A,</math><ref name=":2"/> because the ordered pairs are reversed unless at least one of the following conditions is satisfied:<ref name="cnx"/> * {{mvar|A}} is equal to {{mvar|B}}, or * {{mvar|A}} or {{mvar|B}} is the empty set.

For example: : {{math|1=''A'' = {{mset|1,2}}}}; {{math|1=''B'' = {{mset|3,4}}}} :: {{math|1=''A'' × ''B'' = {{mset|1,2}} × {{mset|3,4}} = {{mset|(1,3), (1,4), (2,3), (2,4)}}}} :: {{math|1=''B'' × ''A'' = {{mset|3,4}} × {{mset|1,2}} = {{mset|(3,1), (3,2), (4,1), (4,2)}}}}

: {{math|1=''A'' = ''B'' = {{mset|1,2}}}} :: {{math|1=''A'' × ''B'' = ''B'' × ''A'' = {{mset|1,2}} × {{mset|1,2}} = {{mset|(1,1), (1,2), (2,1), (2,2)}}}}

: {{math|1=''A'' = {{mset|1,2}}; ''B'' = ∅}} :: {{math|1=''A'' × ''B'' = {{mset|1,2}} × ∅ = ∅}} :: {{math|1=''B'' × ''A'' = ∅ × {{mset|1,2}} = ∅}}

Strictly speaking, the Cartesian product is not associative (unless one of the involved sets is empty). <math display=block>(A\times B)\times C \neq A \times (B \times C)</math> If for example {{math|1=''A'' = {{mset|1}}}}, then {{math|1=(''A'' × ''A'') × ''A'' = {{mset|((1, 1), 1)}} ≠}} {{math|1={{mset|(1, (1, 1))}} = ''A'' × (''A'' × ''A'')}}.

=== Intersections, unions, and subsets === {{See also|List of set identities and relations}} {{multiple image |align=center | total_width = 750 |image1=CartDistr_svg.svg |caption1=Example sets<br/> {{math|1={{color|#0000c0|''A''}} = [1,4]}}, {{math|1={{color|#c00000|''B''}} = [2,5]}}, and<br/> {{math|1={{color|#00c000|''C''}} = [4,7]}}, demonstrating<br/> {{math|1={{highlight|''A'' × (''B''∩''C'')|#FCFCC6}} = ({{highlight|''A''×''B''|#FCC6C6}}) ∩ ({{highlight|''A''×''C''|#C6FCC6}})}},<br/> {{math|1=''A'' × (''B''∪''C'') = ({{highlight|''A''×''B''|#FCC6C6}}) ∪ ({{highlight|''A''×''C''|#C6FCC6}})}}, and<br/> {{math|1=''A'' × (''B''{{hsp}}\{{hsp}}''C'') = ({{highlight|''A''×''B''|#FCC6C6}}) \ ({{highlight|''A''×''C''|#C6FCC6}})}} |image2=CartInts_svg.svg |caption2=Example sets<br/> {{math|1={{color|#c00000|''A''}} = [2,5]}}, {{math|1={{color|#00c000|''B''}} = [3,7]}}, {{math|1={{color|#c00000|''C''}} = [1,3]}},<br/> {{math|1={{color|#00c000|''D''}} = [2,4]}}, demonstrating<br/> {{math|1={{highlight|(''A''∩''B'') × (''C''∩''D'')|#FCFCC6}} = ({{highlight|''A''×''C''|#FCC6C6}}) ∩ ({{highlight|''B''×''D''|#C6FCC6}})}}. |image3=CartUnion_svg.svg |caption3={{math|1={{highlight|(''A''∪''B'') × (''C''∪''D'')|#E0E0FC}} ≠ ({{highlight|''A''×''C''|#FCC6C6}}) ∪ ({{highlight|''B''×''D''|#C6FCC6}})}} can be seen from the same example. }}

The Cartesian product satisfies the following property with respect to intersections (see middle picture). <math display=block>(A \cap B) \times (C \cap D) = (A \times C) \cap (B \times D)</math>

In most cases, the above statement is not true if we replace intersection with union (see rightmost picture). <math display=block>(A \cup B) \times (C \cup D) \neq (A \times C) \cup (B \times D)</math>

In fact, we have that: <math display=block>(A \times C) \cup (B \times D) = [(A \setminus B) \times C] \cup [(A \cap B) \times (C \cup D)] \cup [(B \setminus A) \times D]</math>

For the set difference, we also have the following identity: <math display=block>(A \times C) \setminus (B \times D) = [A \times (C \setminus D)] \cup [(A \setminus B) \times C]</math>

Here are some rules demonstrating distributivity with other operators (see leftmost picture):<ref name="cnx">Singh, S. (August 27, 2009). ''Cartesian product''. Retrieved from the Connexions Web site: http://cnx.org/content/m15207/1.5/</ref> <math display=block>\begin{align} A \times (B \cap C) &= (A \times B) \cap (A \times C), \\ A \times (B \cup C) &= (A \times B) \cup (A \times C), \\ A \times (B \setminus C) &= (A \times B) \setminus (A \times C), \end{align}</math> <math display=block>(A \times B)^\complement = \left(A^\complement \times B^\complement\right) \cup \left(A^\complement \times B\right) \cup \left(A \times B^\complement\right)\!,</math> where <math>A^\complement</math> denotes the absolute complement of {{mvar|A}}.

Other properties related with subsets are: : <math display=block>\text{if } A \subseteq B \text{, then } A \times C \subseteq B \times C;</math> <math display=block>\text{if both } A,B \neq \emptyset \text{, then } A \times B \subseteq C \times D \!\iff\! A \subseteq C \text{ and } B \subseteq D.</math><ref>Cartesian Product of Subsets. (February 15, 2011). ''ProofWiki''. Retrieved 05:06, August 1, 2011 from https://proofwiki.org/w/index.php?title=Cartesian_Product_of_Subsets&oldid=45868 {{Webarchive|url=https://web.archive.org/web/20231011035531/https://proofwiki.org/w/index.php?title=Cartesian_Product_of_Subsets&oldid=45868 |date=October 11, 2023 }}</ref><!-- Better replace citation with a non-wiki site. -->

=== Cardinality === {{See also|Cardinal arithmetic}}

The cardinality of a set is the number of elements of the set. For example, defining two sets: {{math|1=''A'' = {{mset|a, b}}}} and {{math|1=''B'' = {{mset|5, 6}}}}. Both set {{mvar|A}} and set {{mvar|B}} consist of two elements each. Their Cartesian product, written as {{math|''A'' × ''B''}}, results in a new set which has the following elements: : {{math|1=''A'' × ''B'' = {{mset|(a,5), (a,6), (b,5), (b,6)}}}}.

where each element of {{mvar|A}} is paired with each element of {{mvar|B}}, and where each pair makes up one element of the output set. The number of values in each element of the resulting set is equal to the number of sets whose Cartesian product is being taken; 2 in this case. The cardinality of the output set is equal to the product of the cardinalities of all the input sets. That is, : {{math|1={{abs|''A'' × ''B''}} = {{abs|''A''}} · {{abs|''B''}}}}.<ref name=":2"/> In this case, {{math|1={{abs|''A'' × ''B''}} = 4}}

Similarly, : {{math|1={{abs|''A'' × ''B'' × ''C''}} = {{abs|''A''}} · {{abs|''B''}} · {{abs|''C''}}}} and so on.

The set {{math|''A'' × ''B''}} is infinite if either {{mvar|A}} or {{mvar|B}} is infinite, and the other set is not the empty set.<ref>Peter S. (1998). A Crash Course in the Mathematics of Infinite Sets. ''St. John's Review, 44''(2), 35–59. Retrieved August 1, 2011, from http://www.mathpath.org/concepts/infinity.htm</ref>

== Cartesian products of several sets ==

=== ''n''-ary Cartesian product === The Cartesian product can be generalized to the '''{{mvar|n}}-ary Cartesian product''' over {{mvar|n}} sets {{math|1=''X''<sub>1</sub>, ..., ''X''<sub>''n''</sub>}} as the set <math display=block>X_1\times\cdots\times X_n = \{(x_1, \ldots, x_n) \mid x_i \in X_i \ \text{for every} \ i \in \{1, \ldots, n\} \}</math>

of {{mvar|n}}-tuples. If tuples are defined as nested ordered pairs, it can be identified with {{math|(''X''<sub>1</sub> × ... × ''X''<sub>''n''−1</sub>) × ''X<sub>n</sub>''}}. If a tuple is defined as a function on {{math|{1, 2, ..., ''n''}}} that takes its value at {{mvar|i}} to be the {{mvar|i}}-th element of the tuple, then the Cartesian product {{math|''X''<sub>1</sub> × ... × ''X''<sub>''n''</sub>}} is the set of functions <math display=block>\{ x:\{1,\ldots,n\}\to X_1\cup\cdots\cup X_n \ | \ x(i)\in X_i \ \text{for every} \ i \in \{1, \ldots, n\} \}.</math>

=== Cartesian ''n''th power === {{anchor|n-ary Cartesian power}} The '''Cartesian square''' of a set {{mvar|X}} is the Cartesian product {{math|1=''X''<sup>2</sup> = ''X'' × ''X''}}. An example is the 2-dimensional plane {{math|1='''R'''<sup>2</sup> = '''R''' × '''R'''}} where {{math|'''R'''}} is the set of real numbers:<ref name=":1"/> {{math|'''R'''<sup>2</sup>}} is the set of all points {{math|(''x'',''y'')}} where {{mvar|x}} and {{mvar|y}} are real numbers (see the Cartesian coordinate system).

The '''Cartesian {{mvar|n}}th power ''' of a set {{mvar|X}}, denoted <math>X^n</math>, can be defined as <math display=block> X^n = \underbrace{ X \times X \times \cdots \times X}_{n}= \{ (x_1,\ldots,x_n) \ | \ x_i \in X \ \text{for every} \ i \in \{1, \ldots, n\} \}.</math>

An example of this is {{math|1='''R'''<sup>3</sup> = '''R''' × '''R''' × '''R'''}}, with {{math|'''R'''}} again the set of real numbers,<ref name=":1"/> and more generally {{math|'''R'''<sup>''n''</sup>}}.

The Cartesian {{mvar|n}}th power of a set {{mvar|X}} may be identified with the set of the functions mapping to {{mvar|X}} the {{mvar|n}}-tuples of elements of {{mvar|X}}. As a special case, the Cartesian 0th power of {{mvar|X}} is the singleton set, that has the empty function with codomain {{mvar|X}} as its unique element.

=== Intersections, unions, complements and subsets === Let Cartesian products be given <math>A = A_1 \times \dots \times A_n</math> and <math>B = B_1 \times \dots \times B_n</math>. Then # <math> A \sube B</math>, if and only if <math> A_i \sube B_i</math> for all <math> i = 1, 2,\ldots, n</math>;<ref name=":3">{{cite book |last= Bourbaki |first=N. |author-link=Nicolas Bourbaki |title= Théorie des ensembles |pages=E II.34– E II.38 |publisher=Springer |date=2006|url=https://thelib.net/1442498-theorie-des-ensembles.html?ysclid=m7h7w9w1ck807082965}}</ref> # <math> A \cap B = (A_1 \cap B_1) \times \dots \times (A_n \cap B_n)</math>, at the same time, if there exists at least one <math>i</math> such that <math>A_i \cap B_i = \varnothing</math>, then <math>A \cap B = \varnothing</math>;<ref name=":3"/> # <math> A \cup B \sube (A_1 \cup B_1) \times \dots \times (A_n \cup B_n)</math>, moreover, equality is possible only in the following cases:<ref name=":4">{{cite book | last1 =Kulik | first1 = B.| last2 =Fridman | first2 = A.| title = Complicated Methods of Logical Analysis Based on Simple Mathematics | publisher = Cambridge Scholars Publishing| year = 2022 | isbn = 978-1-5275-8014-5 |url=https://www.cambridgescholars.com/product/978-1-5275-8014-5}}</ref> ## <math> A \sube B</math> or <math> B \sube A</math>; ## for all <math> i = 1, 2,\ldots, n \quad A_i = B_i \quad </math> except for one from <math>i</math>. #The complement of a Cartesian product <math>A = A_1 \times \dots \times A_n</math> can be calculated,<ref name=":4"/> if a ''universe'' is defined <math>U = X_1 \times \dots \times X_n</math>. To simplify the expressions, we introduce the following notation. Let us denote the Cartesian product as a tuple bounded by square brackets; this tuple includes the sets from which the Cartesian product is formed, e.g.: : <math>A = A_1 \times A_2 \times \dots \times A_n =[A_1\quad A_2\quad \dots \quad A_n] </math>.

In ''n-tuple algebra'' (NTA),<ref name=":4"/> such a matrix-like representation of Cartesian products is called a ''C-n-tuple''.

With this in mind, the union of some Cartesian products given in the same universe can be expressed as a matrix bounded by square brackets, in which the rows represent the Cartesian products involved in the union: : <math> A \cup B = (A_1 \times A_2 \times \dots \times A_n) \cup (B_1 \times B_2 \times \dots \times B_n) = \left [\begin{array} {cccc} A_1 & A_2 & \dots & A_n\\ B_1 & B_2 & \dots & B_n \end{array}\right ] </math>.

Such a structure is called a ''C-system'' in NTA.

Then the complement of the Cartesian product <math> A</math> will look like the following ''C''-system expressed as a matrix of the dimension <math> n \times n </math>: : <math>A^\complement =\left [\begin{array} {ccccc} A_1^\complement & X_2 & \dots & X_{n-1} & X_n \\ X_1 & A_2^\complement & \dots & X_{n-1} & X_n \\ \dots & \dots & \dots & \dots & \dots \\ X_1 & X_2 & \dots & A_{n-1}^\complement & X_n \\ X_1 & X_2 & \dots & X_{n-1} & A_n^\complement \end{array}\right ] </math>.

The diagonal components of this matrix <math>A_i^\complement </math> are equal correspondingly to <math>X_i \setminus A_i</math>.

In NTA, a diagonal ''C''-system <math>A^\complement </math>, that represents the complement of a ''C-n''-tuple <math> A</math>, can be written concisely as a tuple of diagonal components bounded by inverted square brackets: : <math>A^\complement = ] A_1^\complement \quad A_2^\complement \quad \dots \quad A_n^\complement [ </math>.

This structure is called a ''D-n-tuple''. Then the complement of the ''C''-system <math> R</math> is a structure <math> R^\complement </math>, represented by a matrix of the same dimension and bounded by inverted square brackets, in which all components are equal to the complements of the components of the initial matrix <math> R</math>. Such a structure is called a ''D''-system and is calculated, if necessary, as the intersection of the ''D-n''-tuples contained in it. For instance, if the following ''C''-system is given: : <math> R_1 = \left [\begin{array} {cccc} A_1 & A_2 & \dots & A_n\\ B_1 & B_2 & \dots & B_n \end{array}\right ] </math>,

then its complement will be the ''D''-system

: <math> R_1^\complement = \left ]\begin{array} {cccc} A_1^\complement & A_2^\complement & \dots & A_n^\complement \\ B_1^\complement & B_2^\complement & \dots & B_n^\complement \end{array}\right [ </math>.

Let us consider some new relations for structures with Cartesian products obtained in the process of studying the properties of NTA.<ref name=":4"/> The structures defined in the same universe are called ''homotypic'' ones. # ''The intersection of C-systems''. Assume the homotypic ''C''-systems are given <math>P</math> and <math>Q</math>. Their intersection will yield a ''C''-system containing all non-empty intersections of each ''C-n''-tuple from <math>P</math> with each ''C-n''-tuple from <math>Q</math>. # ''Checking the inclusion of a C-n-tuple into a D-n-tuple''. For the ''C-n''-tuple <math>P = [P_1 \quad P_2 \quad \cdots \quad P_N]</math> and the ''D-n''-tuple <math>Q = ]Q_1 \quad Q_2 \quad \cdots \quad Q_N[</math> holds <math>P \sube Q</math>, if and only if, at least for one <math>i</math> holds <math>P_i \sube Q_i</math>. # ''Checking the inclusion of a C-n-tuple into a D-system''. For the ''C-n''-tuple <math>P</math> and the ''D''-system <math>Q</math> is true <math>P \sube Q</math>, if and only if, for every ''D-n''-tuple <math>Q_i</math> from <math>Q</math> holds <math>P \sube Q_i</math>. === Infinite Cartesian products === {{Main|Direct product}}

It is possible to define the Cartesian product of an arbitrary (possibly infinite) indexed family of sets. If {{mvar|I}} is any index set, and <math>\{X_i\}_{i\in I}</math> is a family of sets indexed by {{mvar|I}}, then the Cartesian product of the sets in <math>\{X_i\}_{i\in I}</math> is defined to be <math display=block>\prod_{i \in I} X_i = \left\{\left. f: I \to \bigcup_{i \in I} X_i\ \right|\ \forall i\in I.\ f(i) \in X_i\right\},</math> that is, the set of all functions defined on the index set {{mvar|I}} such that the value of the function at a particular index {{mvar|i}} is an element of ''X<sub>i</sub>''. Even if each of the ''X<sub>i</sub>'' is nonempty, the Cartesian product may be empty if the axiom of choice, which is equivalent to the statement that every such product is nonempty, is not assumed. <math>\prod_{i\in I}X_i</math> may also be denoted <math>\mathsf{X}</math><math>{}_{i\in I}X_i</math>.<ref>F. R. Drake, ''Set Theory: An Introduction to Large Cardinals'', p. 24. Studies in Logic and the Foundations of Mathematics, vol. 76 (1978). ISBN 0-7204-2200-0.</ref>

For each {{mvar|j}} in {{mvar|I}}, the function <math display=block>\pi_{j}: \prod_{i \in I} X_i \to X_{j},</math> defined by <math>\pi_{j}(f) = f(j)</math> is called the '''{{mvar|j}}-th projection map'''.

'''Cartesian power''' is a Cartesian product where all the factors ''X<sub>i</sub>'' are the same set {{mvar|X}}. In this case, <math display=block>\prod_{i \in I} X_i = \prod_{i \in I} X</math> is the set of all functions from {{mvar|I}} to {{mvar|X}}, and is frequently denoted ''X<sup>I</sup>''. This case is important in the study of cardinal exponentiation. An important special case is when the index set is <math>\mathbb{N}</math>, the natural numbers: this Cartesian product is the set of all infinite sequences with the {{mvar|i}}-th term in its corresponding set ''X<sub>i</sub>''. For example, each element of <math display=block>\prod_{n = 1}^\infty \mathbb R = \mathbb R \times \mathbb R \times \cdots</math> can be visualized as a vector with countably infinite real number components. This set is frequently denoted <math>\mathbb{R}^\omega</math>, or <math>\mathbb{R}^{\mathbb{N}}</math>.

== Other forms ==

=== Abbreviated form === If several sets are being multiplied together (e.g., {{math|1=''X''<sub>1</sub>, ''X''<sub>2</sub>, ''X''<sub>3</sub>, ...}}), then some authors<ref>Osborne, M., and Rubinstein, A., 1994. ''A Course in Game Theory''. MIT Press.</ref> choose to abbreviate the Cartesian product as simply {{math|<big>×</big>''X''<sub>''i''</sub>}}.

=== Cartesian product of functions === If {{mvar|f}} is a function from {{mvar|X}} to {{mvar|A}} and {{mvar|g}} is a function from {{mvar|Y}} to {{mvar|B}}, then their Cartesian product {{math|''f'' × ''g''}} is a function from {{math|''X'' × ''Y''}} to {{math|''A'' × ''B''}} with <math display=block>(f\times g)(x, y) = (f(x), g(y)).</math>

This can be extended to tuples and infinite collections of functions. This is different from the standard Cartesian product of functions considered as sets.

=== Cylinder === Let <math>A</math> be a set and <math>B \subseteq A</math>. Then the ''cylinder'' of <math>B</math> with respect to <math>A</math> is the Cartesian product <math>B \times A</math> of <math>B</math> and <math>A</math>.

Normally, <math>A</math> is considered to be the universe of the context and is left away. For example, if <math>B</math> is a subset of the natural numbers <math>\mathbb{N}</math>, then the cylinder of <math>B</math> is <math>B \times \mathbb{N}</math>.

== Definitions outside set theory ==

=== Category theory === Although the Cartesian product is traditionally applied to sets, category theory provides a more general interpretation of the product of mathematical structures. Product is the simplest example of categorical limit, where the indexing category is discrete. As category of sets can be identified with discrete categories and embedded this way as full subcategory of <math>\operatorname{Cat}</math> the diagrams indexing products can be reduced to indexing sets matching the set-theoretic definition.

=== Graph theory === In graph theory, the Cartesian product of two graphs {{mvar|G}} and {{mvar|H}} is the graph denoted by {{math|''G'' × ''H''}}, whose vertex set is the (ordinary) Cartesian product {{math|''V''(''G'') × ''V''(''H'')}} and such that two vertices {{math|(''u'',''v'')}} and {{math|1=(''u''′,''v''′)}} are adjacent in {{math|''G'' × ''H''}}, if and only if {{math|1=''u'' = ''u''′}} and {{mvar|v}} is adjacent with {{mvar|v}}′ in {{mvar|H}}, ''or'' {{math|1=''v'' = ''v''′}} and {{mvar|u}} is adjacent with {{mvar|u}}′ in {{mvar|G}}. The Cartesian product of graphs is not a product in the sense of category theory. Instead, the categorical product is known as the tensor product of graphs.

== See also == * Axiom of power set (to prove the existence of the Cartesian product) * Direct product * Empty product * Finitary relation * Join (SQL) § Cross join * Orders on the Cartesian product of totally ordered sets * Outer product * Product (category theory) * Product topology * Product type

== References == {{reflist}}

== External links == * [https://www.apronus.com/provenmath/cartesian.htm Cartesian Product at ProvenMath] * {{SpringerEOM|title=Direct product|id=p/d032730}} * [https://study.com/academy/lesson/how-to-find-the-cartesian-product.html How to find the Cartesian Product, Education Portal Academy]

{{Set theory}} {{Mathematical logic}}

Category:Axiom of choice Category:Operations on sets