Mathematical logic (1) Set, Relation and function 集合,关系与函数
本文最后更新于 2024年6月11日 凌晨
1. Set 集合
1.1 Primary 初步知识
A collection of elements is called set
- Element of set: the object
1.2 Intension & Extension 内涵与外延
- Intension(内涵): The intension of a set is its description or defining properties, i.e.,
what is true about members of a set. (对概念的定义) - Extension(外延): The extension of a set is its members or contents. (概念所代表的
对象)
: The two sets and are equal () if and only if and have the same members.
1.3 Definition 定义
Denote as a propertry of , then represents a set that all x have this propertry.
For more:
(can be proof by contradiction)
Set remains the same whatever you change the order of elements or repeat them.
1.4 Subset 子集
If for any in satisfying , then .
1.4.1 Proper Subset 真子集
there exists at least one element of B which is not an element of ,then is a proper (or strict) subset of , denoted by .
We say is a proper subset of any except itself.
1.5 Power Set 幂集
If is a set, is the power set of , denoted as .
1.6 Set Operations 集合操作
- Union(并集):
- Intersection(交集):
- Difference(差集):
2. Relations 关系
2.1 Tuples 有序元组
An ordered element sequece is denoted as n-tuple.
2.1.1 Properties 有序n元组的性质
- We say when
- A tuple can contain mutiple instances of the same element
- A tuple has a finite number while a set may not.
2.1.2 Cartesian Product 笛卡尔积
denotes the Cartesian product: .
2.2 Binary Relations 二元关系
A binary relation over sets and is a subset of denoted as
means is -related to , denoted as or .
Specially when , we call relation is over (denoted as ).
e.g is a binary relation over .
2.3 n-ary Relation 多元关系
n-ary Cartesian product:
Iff , is denoted as n-ary relation over A.
2.4 Equivalence Relation 等价关系
When is a binary relation on set and is a equivalence relation, has following properties:
- R is Reflexive(自反) meaning for all , .
- R is Symmetric(对称) meaning for all , if then .
- R is Transitive(可传递) meaning for all , if and , then .
e.g. “=” is an equivalence relation on .
2.5 Equivalence Class 等价类
Given an equivalence relation over a set , for any , the equivalence class of x in the set
Theorem :
If is an equivalence relation over , then for all belongs to a equivalence class.
Theorem :
Given an equivalence relation on set , the collection of equivalence classes forms a partition of set .
eg. Define a equivalence relation over by:
All the equivalence classes of are:
2.6 Partial Order Relation 偏序关系
A binary relation is a partial order when satisfying is:
- Reflective
- Antisymmetric
- Transitive
Minimal element: for there doesn’t exist another such that , then is the minimal element.
Maximal element: for there doesn’t exist another such that , then is the maximal element.
2.7 Total Order Relation 全序关系
If is a partial order relation and for any there exists or , then is a total order relation over
e.g. is a total order on , is the minimal element and is the maximal element.
3. Function 函数
A function from to is a binary relation that satisfies:
- For all , there exists such that .
- If \in Y such that and , then .
3.1 Notation 记法
We typically use to represent functions
expresses that is a function from set to .
- Domain(定义域): the set of input values ( for ).
- Codomain(陪域): the set of possible output values( for ).
- Range(值域): the set of actual output values (subset of for ).
3.2 n-ary Function 多元函数
is called an n-ary function
An n-ary function maps ordered n-tuples from its domain to elements in its codomain.
3.3 Injective, Surjective and Bijective Functions 单射,满射与双射函数
Given a function :
-
Injective:
-
Surjective:
-
Bijective: , or, is both injective and surjective.
3.4 Composition Function 复合函数
Given , , function denotes as a composition function on