{
  "id": "cartesian-product",
  "title": "Cartesian Product",
  "lang": "en",
  "source_lang": "en",
  "summary": "The Cartesian product forms a set of ordered combinations by taking one element from each of several sets.",
  "category": "mathematics",
  "subcategory": "discrete-logic",
  "type": "concept",
  "aliases": [
    "Cartesian set product",
    "Product of sets"
  ],
  "generated_at": "2026-10-04",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/cartesian-product/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/cartesian-product/",
      "json": "https://aiwiki.page/zh/cartesian-product.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "The Cartesian product is a construction in set theory that combines sets by forming all ordered selections of their elements. For two sets \\(A\\) and \\(B\\), it is written \\(A\\times B\\) and consists of every ordered pair \\((a,b)\\) with \\(a\\in A\\) and \\(b\\in B\\). The construction extends to finite lists and arbitrary indexed families of sets. Unlike numerical multiplication, its result is a set whose elements retain their coordinate positions. (homepages.ucl.ac.uk)"
    },
    {
      "heading": "Definition and examples",
      "text": "Formally,\n\n\\[A\\times B=\\{(a,b)\\mid a\\in A,\\ b\\in B\\}.\\]\n\nThe defining property of ordered pairs is\n\n\\[(a,b)=(c,d)\\quad\\Longleftrightarrow\\quad a=c\\text{ and }b=d.\\]\n\nThus order matters within each pair, although the order in which the pairs are listed does not matter. Coordinates may be numbers, symbols, sets, or other mathematical objects. (homepages.ucl.ac.uk)\n\nFor example, if \\(A=\\{1,2\\}\\) and \\(B=\\{x,y,z\\}\\), then\n\n\\[A\\times B= \\{(1,x),(1,y),(1,z),(2,x),(2,y),(2,z)\\}.\\]\n\nEach element of \\(A\\) is paired with every element of \\(B\\), so the product has six elements. The factors need not be disjoint, and repeated coordinates are permitted: \\((1,1)\\) belongs to \\(\\{1,2\\}\\times\\{1,2\\}\\). (math.libretexts.org)\n\nIn geometry, the product of the real numbers with themselves,\n\n\\[\\mathbb R^2=\\mathbb R\\times\\mathbb R,\\]\n\nprovides the coordinate representation of the plane. More generally, \\(\\mathbb R^n\\), equipped with its usual geometric structure, represents \\(n\\)-dimensional Euclidean space. (math.libretexts.org)"
    },
    {
      "heading": "Basic properties",
      "text": "If either factor is the empty set, the product is empty:\n\n\\[A\\times\\varnothing=\\varnothing\\times A=\\varnothing.\\]\n\nConversely, two nonempty factors have a nonempty product, since choosing one element from each produces an ordered pair. (math.unm.edu)\n\nCartesian products are not generally commutative as literal sets: \\(A\\times B\\) need not equal \\(B\\times A\\). Nevertheless, coordinate reversal,\n\n\\[(a,b)\\longmapsto(b,a),\\]\n\nis a bijection between them. Similarly, \\((A\\times B)\\times C\\) and \\(A\\times(B\\times C)\\) contain differently nested pairs, but the reassociation map\n\n\\[((a,b),c)\\longmapsto(a,(b,c))\\]\n\nis a natural bijection. Mathematical notation often suppresses these distinctions by identifying both with ordered triples. (math.cmu.edu)\n\nProducts distribute over union and intersection in either coordinate. For example,\n\n\\[A\\times(B\\cup C)=(A\\times B)\\cup(A\\times C),\\]\n\n\\[A\\times(B\\cap C)=(A\\times B)\\cap(A\\times C).\\]\n\nThese identities follow by checking coordinate membership. (math.libretexts.org)\n\nFor finite sets, the cardinality satisfies\n\n\\[|A\\times B|=|A|\\,|B|.\\]\n\nThere are \\(|B|\\) possible second coordinates for each of the \\(|A|\\) first coordinates. This is an instance of the multiplication principle in combinatorics. (homepages.ucl.ac.uk)"
    },
    {
      "heading": "Finite and indexed products",
      "text": "For sets \\(A_1,\\ldots,A_n\\), the finite product is\n\n\\[\\prod_{i=1}^{n}A_i =\\{(a_1,\\ldots,a_n)\\mid a_i\\in A_i\\text{ for every }i\\}.\\]\n\nIts elements are ordered tuples. When all factors are the same set \\(A\\), the notation \\(A^n\\) is customary. If the factors are finite, their cardinalities multiply. (math.unm.edu)\n\nFor an arbitrary index set \\(I\\), a product element is described as a function selecting one coordinate from each factor:\n\n\\[\\prod_{i\\in I}A_i = \\left\\{ f:I\\to\\bigcup_{i\\in I}A_i \\ \\middle|\\ f(i)\\in A_i\\text{ for every }i \\right\\}.\\]\n\nThis definition accommodates infinite families without requiring a finite tuple notation. When \\(I\\) is empty, there is exactly one such function—the empty function—so the empty product is a singleton. (public.csusm.edu)\n\nA finite product of nonempty sets is nonempty without any additional choice principle. For arbitrary families, the assertion that every product of nonempty sets is nonempty is equivalent, in Zermelo–Fraenkel set theory, to the axiom of choice. (math.uwaterloo.ca)"
    },
    {
      "heading": "Relations, functions, and projections",
      "text": "A binary relation from \\(A\\) to \\(B\\) is a subset of \\(A\\times B\\): it specifies which pairs satisfy a particular condition. A function \\(f:A\\to B\\) has a graph\n\n\\[\\{(a,f(a))\\mid a\\in A\\}\\subseteq A\\times B,\\]\n\nwith exactly one output paired with each input. Cartesian products therefore supply the ambient sets used to describe relations and function graphs. (math.cmu.edu)\n\nThe coordinate projections are\n\n\\[\\pi_A(a,b)=a,\\qquad \\pi_B(a,b)=b.\\]\n\nThey express a universal property: given functions \\(f:X\\to A\\) and \\(g:X\\to B\\), there is a unique function\n\n\\[h:X\\to A\\times B,\\qquad h(x)=(f(x),g(x)),\\]\n\nsuch that \\(\\pi_A\\circ h=f\\) and \\(\\pi_B\\circ h=g\\), where \\(\\circ\\) denotes function composition. This characterizes the product through its relationship with maps into the factors. (public.csusm.edu)"
    },
    {
      "heading": "Additional structures and computing",
      "text": "For topological spaces, the Cartesian product of the underlying sets carries the product topology. In a finite product, products of open sets form a basis. For an infinite product, basic open sets restrict only finitely many coordinates, leaving every other coordinate unrestricted. The underlying set construction and the topology placed on it are distinct ingredients. (public.csusm.edu)\n\nIn a relational database, a cross join implements a Cartesian product of rows. An SQL expression such as T1 CROSS JOIN T2 combines every row of the first table with every row of the second, retaining the columns from both. If the tables contain \\(m\\) and \\(n\\) rows, the result contains \\(mn\\) rows before filtering. SQL tables may retain duplicate rows, so this operation follows SQL’s row semantics rather than necessarily behaving as a duplicate-free mathematical set. (postgresql.org)"
    }
  ],
  "links": [
    "set-theory",
    "ordered-pair",
    "geometry",
    "real-number",
    "euclidean-space",
    "empty-set",
    "bijective-function",
    "cardinality",
    "combinatorics",
    "tuple",
    "mathematical-function",
    "zermelo-fraenkel-set-theory",
    "axiom-of-choice",
    "binary-relation",
    "universal-property",
    "function-composition",
    "topological-space",
    "product-topology",
    "open-set",
    "relational-database"
  ],
  "sources": [
    {
      "title": "homepages.ucl.ac.uk/~ucahmto/0005_2021/Ch2.S5.html",
      "url": "https://www.homepages.ucl.ac.uk/~ucahmto/0005_2021/Ch2.S5.html"
    },
    {
      "title": "math.libretexts.org/Bookshelves/Combinatorics_and_Discrete_Mathematics/A_Spiral…",
      "url": "https://math.libretexts.org/Bookshelves/Combinatorics_and_Discrete_Mathematics/A_Spiral_Workbook_for_Discrete_Mathematics_%28Kwong%29/04%3A_Sets/4.04%3A_Cartesian_Products"
    },
    {
      "title": "math.libretexts.org/Bookshelves/Mathematical_Logic_and_Proof/Proofs_and_Concept…",
      "url": "https://math.libretexts.org/Bookshelves/Mathematical_Logic_and_Proof/Proofs_and_Concepts_-_The_Fundamentals_of_Abstract_Mathematics_%28Morris_and_Morris%29/06%3A_Functions/6.01%3A_Cartesian_product"
    },
    {
      "title": "math.unm.edu/~crisp/courses/math401/tao.pdf",
      "url": "https://www.math.unm.edu/~crisp/courses/math401/tao.pdf"
    },
    {
      "title": "math.cmu.edu/users/math/math/jmackey/summer/bws_book.pdf",
      "url": "https://www.math.cmu.edu/users/math/math/jmackey/summer/bws_book.pdf"
    },
    {
      "title": "public.csusm.edu/aitken_html/Essays/Topology/products.pdf",
      "url": "https://public.csusm.edu/aitken_html/Essays/Topology/products.pdf"
    },
    {
      "title": "math.uwaterloo.ca/~nspronk/math453/AofC.pdf",
      "url": "https://www.math.uwaterloo.ca/~nspronk/math453/AofC.pdf"
    },
    {
      "title": "postgresql.org/docs/current/queries-table-expressions.html",
      "url": "https://www.postgresql.org/docs/current/queries-table-expressions.html"
    }
  ],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}