
In
mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and their changes (cal ...
, specifically
set theory
Set theory is the branch of mathematical logic that studies Set (mathematics), sets, which can be informally described as collections of objects. Although objects of any kind can be collected into a set, set theory, as a branch of mathematics, i ...
, the Cartesian product of two
sets ''A'' and ''B'', denoted ''A''×''B'',
is the set of all
ordered pair
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It h ...

s where ''a'' is in ''A'' and ''b'' is in ''B''.
In terms of
set-builder notation
In set theory
illustrating the intersection (set theory), intersection of two set (mathematics), sets.
Set theory is a branch of mathematical logic that studies Set (mathematics), sets, which informally are collections of objects. Although any ...
, that is
:
A table can be created by taking the Cartesian product of a set of rows and a set of columns. If the Cartesian product is taken, the cells of the table contain ordered pairs of the form .
One can similarly define the Cartesian product of ''n'' sets, also known as an ''n''-fold Cartesian product, which can be represented by an ''n''-dimensional array, where each element is an ''n''-
tuple
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). ...
. An ordered pair is a
2-tuple or couple. More generally still, one can define the Cartesian product of an
indexed family
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It h ...
of sets.
The Cartesian product is named after
René Descartes
René Descartes ( or ; ; Latinisation of names, Latinized: Renatus Cartesius; 31 March 1596 – 11 February 1650) was a French philosopher, Mathematics, mathematician, and scientist who invented analytic geometry, linking the previously sep ...

, whose formulation of
analytic geometry
In classical mathematics, analytic geometry, also known as coordinate geometry or Cartesian geometry, is the study of geometry
Geometry (from the grc, γεωμετρία; ''wikt:γῆ, geo-'' "earth", ''wikt:μέτρον, -metron'' "measur ...
gave rise to the concept, which is further generalized in terms of
direct productIn mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It ha ...
.
Examples
A deck of cards

An illustrative example is the
standard 52-card deck
The standard 52-card deck of French-suited playing cards
French-suited playing cards or French-suited cards are playing cards, cards that use the French Suit (cards), suits of (clovers or clubs ), (tiles or diamonds ), (hearts ) ...
. The
standard playing card ranks form a 13-element set. The card suits 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.
returns a set of the form .
returns a set of the form .
These two sets are distinct, even disjoint.
A two-dimensional coordinate system

The main historical example is the
Cartesian plane
A Cartesian coordinate system (, ) in a plane
Plane or planes may refer to:
* Airplane or aeroplane or informally plane, a powered, fixed-wing aircraft
Arts, entertainment and media
*Plane (Dungeons & Dragons), Plane (''Dungeons & Dragons'') ...

in
analytic geometry
In classical mathematics, analytic geometry, also known as coordinate geometry or Cartesian geometry, is the study of geometry
Geometry (from the grc, γεωμετρία; ''wikt:γῆ, geo-'' "earth", ''wikt:μέτρον, -metron'' "measur ...
. In order to represent geometrical shapes in a numerical way, and extract numerical information from shapes' numerical representations,
René Descartes
René Descartes ( or ; ; Latinisation of names, Latinized: Renatus Cartesius; 31 March 1596 – 11 February 1650) was a French philosopher, Mathematics, mathematician, and scientist who invented analytic geometry, linking the previously sep ...

assigned to each point in the plane a pair of
real number
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers ( and ), formulas and related structures (), shapes and spaces in which they are contained (), and quantities and their changes ( and ). There is no g ...
s, called its
coordinates
In geometry
Geometry (from the grc, γεωμετρία; ''wikt:γῆ, geo-'' "earth", ''wikt:μέτρον, -metron'' "measurement") is, with arithmetic, one of the oldest branches of mathematics. It is concerned with properties of space t ...

. Usually, such a pair's first and second components are called its ''x'' and ''y'' coordinates, respectively (see picture). The set of all such pairs (i.e., the Cartesian product , with ℝ denoting the real numbers) is thus assigned to the set of all points in the plane.
Most common implementation (set theory)
A formal definition of the Cartesian product from
set-theoretical principles follows from a definition of
ordered pair
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It h ...

. The most common definition of ordered pairs,
Kuratowski's definition, is
. Under this definition,
is an element of
, and
is a subset of that set, where
represents the
power set
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities an ...
operator. Therefore, the existence of the Cartesian product of any two sets in
follows from the axioms of
pairing
In mathematics, a pairing is an ''R''-Bilinear map#Modules, bilinear map from the Cartesian product of two ''R''-Module (mathematics), modules, where the underlying Ring (mathematics), ring ''R'' is Commutative ring, commutative.
Definition
Let ''R ...
,
union,
power set
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities an ...
, and
specification
A specification often refers to a set of documented requirements to be satisfied by a material, design, product, or service. A specification is often a type of technical standard
A technical standard is an established norm (social), norm or require ...
. Since
functions
Function or functionality may refer to:
Computing
* Function key
A function key is a key on a computer
A computer is a machine that can be programmed to carry out sequences of arithmetic or logical operations automatically. Modern comp ...
are usually defined as a special case of
relations
Relation or relations may refer to:
General uses
*International relations, the study of interconnection of politics, economics, and law on a global level
*Interpersonal relationship, association or acquaintance between two or more people
*Public ...
, 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 ''A'', ''B'', ''C'', and ''D'' be sets.
The Cartesian product is not
commutative
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers ( and ), formulas and related structures (), shapes and spaces in which they are contained (), and quantities and their changes ( and ). There is no ge ...
,
:
because the
ordered pair
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It h ...

s are reversed unless at least one of the following conditions is satisfied:
* ''A'' is equal to ''B'', or
* ''A'' or ''B'' is the
empty set #REDIRECT Empty set #REDIRECT Empty set#REDIRECT Empty set
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry ...

.
For example:
: ''A'' = ; ''B'' =
:: ''A'' × ''B'' = × =
:: ''B'' × ''A'' = × =
: ''A'' = ''B'' =
:: ''A'' × ''B'' = ''B'' × ''A'' = × =
: ''A'' = ; ''B'' = ∅
:: ''A'' × ''B'' = × ∅ = ∅
:: ''B'' × ''A'' = ∅ × = ∅
Strictly speaking, the Cartesian product is not
associative
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). ...
(unless one of the involved sets is empty).
:
If for example ''A'' = , then .
Intersections, unions, and subsets
The Cartesian product satisfies the following property with respect to
intersections (see middle picture).
:
In most cases, the above statement is not true if we replace intersection with
union (see rightmost picture).
:
In fact, we have that:
: