元组

来自GSXAB的知识库
元组
术语名称 元组
英语名称 tuple
别名
元素
术语名称 元素
英语名称 element

元组(tuple)表示一组有限、有序的对象构成的数学对象。元组中元素顺序固定,且可以重复。

定义

由一组有限个数学对象按照特定顺序排列构成的数学对象叫做元组(tuple), 元组中的每个对象称为该元组的元素(element)。 元组中元素的个数称为元组的长度(length),长度为 [math]\displaystyle{ n }[/math] 的元组被称为 [math]\displaystyle{ n }[/math]-元组([math]\displaystyle{ n }[/math]-tuple)。

特别地,长度为 2 的元组称为二元组,长度为 3 的元组称为三元组,以此类推。使用中文大写数字,或使用阿拉伯数字并加连字符都是常见表述。

在命名中,元组通常简称为,特别是在其中元素来自于同一类数学对象时。如数的元组称为数组

有序对

有序对
术语名称 有序对
英语名称 ordered pair
别名 对, 有序偶, 序偶

特别地,二元组也被称为有序对(ordered pair)。

在命名中,有序对通常简称为,特别是在其中元素来自于同一类数学对象时。如数的有序对称为数对,点的有序对称为点对

说明

在标准数学体系中,元组通过递归方式定义:先定义二元组,即“有序对”,然后基于二元组定义更高维度的元组,如“形式化定义”一节所示。

在本 wiki 中,为统一术语使用,若上下文对任意长度元组均生效,总是使用“元组”一词,而作为特例的有序对也表达为“二元组”。仅在“数对”、“点对”等这些复合名称中保留“对”的用法。

特征

元组具有以下基本特征:

  • 有序性:元组中的元素按特定顺序排列,存在先后关系。改变元素序列得到的是不同的元组。
  • 可重复:元组中的元素可以重复。
  • 可索引:元组中的元素都有确定的位置,与自然数的子集 [math]\displaystyle{ \{0,1,2,\cdots,n-1\} }[/math] 一一对应。通常从 1 开始编号,计算机科学也有使用 0 开始的惯例。

两个元组相等当且仅当它们长度相同,且每个对应位置上的元素相等。

表示

[math]\displaystyle{ a_1,a_2,\dots,a_n }[/math] 构成的 [math]\displaystyle{ n }[/math] 元组通常记为 [math]\displaystyle{ (a_1,a_2,\dots,a_n) }[/math] ,也有人记作 [math]\displaystyle{ \langle a_1, a_2, \dots, a_n \rangle }[/math]

注:虽然有时也使用尖括号,但为保持一致性,本 wiki 统一使用圆括号表示元组(包括有序对)。

形式化定义

一般将由元素 [math]\displaystyle{ a,b }[/math] 构成的二元组 [math]\displaystyle{ (a,b) }[/math] 形式化地定义为集合 [math]\displaystyle{ \{\{a\}, \{a, b\}\} }[/math] 。(称为 Kuratowski 定义)另一种较少使用的二元组定义是 Wiener 定义 [math]\displaystyle{ \{\{\{a\},\varnothing\},\{\{b\}\}\} }[/math] 。其他构造也存在。

元组通常定义为有序对的递归,即将三元组 [math]\displaystyle{ (a,b,c) }[/math] 定义为 [math]\displaystyle{ ((a, b), c) }[/math] 、四元组 [math]\displaystyle{ (a,b,c,d) }[/math] 定义为 [math]\displaystyle{ (((a,b),c),d) }[/math] ,以此类推。也有文献定义为 [math]\displaystyle{ (a, (b, c)) }[/math][math]\displaystyle{ (a, (b, (c,d))) }[/math] 并以此类推。


元组
特殊元组 0-元组 [math]\displaystyle{ () }[/math]
生成 笛卡尔积、多元谓词、多元映射、多元函数
运算 投影映射 [math]\displaystyle{ \operatorname{proj} }[/math]
相等关系 [math]\displaystyle{ = }[/math]
集合
特殊集合 空集 [math]\displaystyle{ \varnothing }[/math]全集
关系 成员关系/属于 [math]\displaystyle{ \in }[/math]
包含关系/子集/超集 [math]\displaystyle{ \subseteq }[/math]、真包含关系/真子集/真超集 [math]\displaystyle{ \subset }[/math]相等关系 [math]\displaystyle{ = }[/math]
运算 基础运算 交集 [math]\displaystyle{ \cap }[/math]并集 [math]\displaystyle{ \cup }[/math]补集 [math]\displaystyle{ \bullet^\complement }[/math]差集 [math]\displaystyle{ \setminus }[/math]
复合运算 对称差集 [math]\displaystyle{ \triangle }[/math]
笛卡尔积运算 笛卡尔积 [math]\displaystyle{ \times }[/math]、笛卡尔幂 [math]\displaystyle{ \bullet^n }[/math]幂集 [math]\displaystyle{ \mathcal{P}(\bullet) }[/math]/[math]\displaystyle{ 2^\bullet }[/math]映射的集合 [math]\displaystyle{ \bullet^\bullet }[/math]
不交并运算 不相交并集 [math]\displaystyle{ \sqcup }[/math]
商运算 商集 [math]\displaystyle{ \bullet/\sim }[/math]