逻辑的表达方式在使用集合论的程度上有所不同。有些表达方式大量使用集合论。尽管大多数表达方式不是这样,但几乎不可能完全避免它。集合论不会成为本书的重点,但我们会在本书中不时使用一些集合论词汇。本节介绍所使用的词汇和符号。
数学家使用“集合”作为未定义的原始术语。一些作者求助于近义词,如“收集”。
一个集合有元素。“元素”在集合论中也是未定义的。我们说一个元素是一个集合的成员,这也是一个未定义的表达式。以下是同义词:
- x是y的成员
- x包含于y
- x包含在y中
- y包含x
- y包含x
可以用大括号将集合的成员括起来来指定集合。

是包含 1、2 和 3 作为成员的集合。大括号表示法可以扩展为使用成员规则来指定集合。
(所有x的集合,其中x = 1 或x = 2 或x = 3)
再次是包含 1、2 和 3 作为成员的集合。
和

都指定了包含 1、2、3 等等的集合。
使用修改后的 epsilon 表示集合成员关系。因此

表示“x是y的成员”。我们也可以用这种方式说“x不是y的成员”

集合由其成员唯一地识别。表达式



都指定了同一个集合,即使偶数素数的概念与正平方根的概念不同。在指定集合时,成员的重复是无关紧要的。表达式



都指定了同一个集合。
集合是无序的。表达式



都指定了同一个集合。
集合可以包含其他集合作为成员。例如,存在集合

如上所述,集合由其成员定义。然而,一些集合被赋予名称以方便引用它们。
没有成员的集合称为空集。表达式



都指定了空集。空集也可以表达矛盾(“四边形三角形”或“具有放射对称性的鸟类”)和事实上的不存在(“1994 年捷克斯洛伐克国王”)。
只有一个成员的集合称为单元素集。恰好有两个成员的集合称为对。因此 {1} 是单元素集,而 {1, 2} 是对。
ω 是自然数的集合,{0, 1, 2, ...}。
如果集合s 的每个成员都是集合a 的成员,则集合s 是集合a 的子集。我们使用马蹄形符号来表示子集。表达式

表示 {1, 2} 是 {1, 2, 3} 的子集。空集是每个集合的子集。每个集合都是它自身的子集。a 的真子集是a 的子集,但与a 不相同。表达式

表示{1, 2} 是 {1, 2, 3} 的真子集。
一个集合的幂集 是其所有子集的集合。用脚本 'P' 表示幂集。

两个集合a 和 b 的并集,写成 a ∪ b,是指包含a 中所有元素和b 中所有元素的集合(并且不包含其他元素)。也就是说,

举个例子,

两个集合a 和 b 的交集,写成 a ∩ b,是指包含a 和b 中所有元素的集合(并且不包含其他元素)。也就是说,

举个例子,

b 中a 的相对补集,写成 b \ a(或 b − a),是指包含b 中所有不属于a 的元素的集合。也就是说,

举个例子,

我们将不时使用有序集、关系和函数的直观概念。出于我们的目的,直观的数学概念是最重要的。但是,这些直观的概念可以用集合来定义。
首先,我们来看看有序集。我们说集合是无序的

但我们可以从有序对开始定义有序集。为此,我们使用尖括号表示法

事实上,

任何给出⟨a, b⟩这个最后一个性质的集合论定义都将起作用。有序对⟨a, b⟩的标准定义如下

这意味着我们在对有序对进行操作时可以使用后一种表示法。
还有更大的有序集。有序三元组⟨a, b, c⟩是有序对⟨⟨a, b⟩, c⟩。有序四元组⟨a, b, c, d⟩是有序对⟨⟨a, b, c⟩, d⟩。反过来,这又是有序三元组⟨⟨⟨a, b⟩, c⟩, d⟩。一般来说,有序 n 元组⟨a1, a2, ..., an⟩,其中n大于1,是有序对⟨⟨a1, a2, ..., an-1⟩, an⟩。
定义有序 1 元组也很有用:⟨a⟩ = a。
这些定义在某种程度上是任意的,但对于n元组,n ⟩ 2,作为n-1 元组,甚至作为有序对,仍然很方便。使它们能够作为有序集服务的关键属性是

现在我们转向关系。直观地,以下是关系
- x < y
- x 是 y 的平方根
- x 是 y 的兄弟
- x 在 y 和 z 之间
前三个是二元或二元关系;第四个是三元或三元关系。一般来说,我们谈论n元关系或n元关系。
首先考虑二元关系。二元关系是一组有序对。小于关系的成员中将有⟨1, 2⟩、⟨1, 3⟩、⟨16, 127⟩等。事实上,定义在自然数ω上的小于关系是

直观地,如果x < y,则⟨x, y⟩是小于关系的成员。在集合论中,我们不担心关系是否与小于这样的直观概念匹配。相反,任何有序对集都是二元关系。
我们还可以将三元关系定义为一组三元组,将四元关系定义为一组四元组,等等。我们只为n ≥ 2定义n元关系。据说n元关系具有n的元数。以下示例是一个三元关系。

因为所有n元组,其中n > 1,也是有序对,所以所有n元关系也是二元关系。
最后,我们来看函数。直观地,函数是将值分配给参数的一种映射,使得每个参数最多被分配一个值。因此,+ 2 函数将数值参数 x 映射到值 x + 2。如果我们把这个函数称为 f,那么我们说 f(x) = x + 2。以下定义了一些具体的函数。




注意,当 x = 0 时,f3 是未定义的。根据圣经传统,当 x = 亚当或 x = 夏娃时,f4 是未定义的。以下不是函数的定义。


这两个定义都没有为参数分配唯一的值。对于每个正数 x,都有两个平方根,一个正数和一个负数,因此 f5 不是函数。对于许多 x 而言,x 将有多个儿子,因此 f6 不是函数。如果 f6 被分配了值 x 的儿子,那么语言规则就暗示了唯一的值,因此 f6 将是一个函数。
一个 函数 f 是一种二元关系,如果 ⟨x, y⟩ 和 ⟨x, z⟩ 都是 f 的成员,那么 y = z。
我们可以定义多位函数。直观地,以下是特定多位函数的定义。


因此,⟨4, 7, 11⟩ 是 2 位函数 f7 的成员。⟨3, 4, 5, 35⟩ 是 3 位函数 f8 的成员。
所有 n 元组 (n ≥ 2) 都是有序对 (因此所有 n 元关系都是二元关系) 的事实,在这里变得很方便。对于 n ≥ 1,n 位函数是 n+1 位关系,它是一个 1 位函数。因此,对于 2 位函数 f,
