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. (概念所代表的
    对象)

ExtensionExtension AxiomAxiom : The two sets AA and BB are equal (A=BA = B) if and only if AA and BB have the same members.

1.3 Definition 定义

Denote φ(x)φ(x) as a propertry of xx, then {xφ(x)}\{x| φ(x)\} represents a set that all x have this propertry.

For more:

  • {xxx}=\{x | x \neq x\} = \emptyset
  • {XXX}=\{X | X \notin X\} = \emptyset

(can be proof by contradiction)

Set remains the same whatever you change the order of elements or repeat them.

{a,b}={a,a,b}={a,b,a}\{a, b\} = \{a, a, b\} = \{a, b, a\}

1.4 Subset 子集

If for any xx in AA satisfying xBx \in B, then ABA \subseteq B.

1.4.1 Proper Subset 真子集

there exists at least one element of B which is not an element of AA ,then AA is a proper (or strict) subset of BB, denoted by ABA \subseteq B.

We say \emptyset is a proper subset of any except itself.

1.5 Power Set 幂集

If AA is a set, {XXA}\{X | X \subseteq A\} is the power set of AA, denoted as P(A)\mathcal{P}(A).

  • P()={}\mathcal{P}(\emptyset) = \{\emptyset\}
  • P({})={,{}}\mathcal{P}(\{\emptyset\}) = \{\emptyset, \{\emptyset\}\}

1.6 Set Operations 集合操作

  • Union(并集): AB={xxA or xB}A \cup B = \{x |x \in A \ or \ x \in B \}
  • Intersection(交集): AB={xxA and xB}A \cap B = \{x | x \in A \ and \ x \in B\}
  • Difference(差集): AB={xxA and xB}A - B = \{x | x \in A \ and \ x \notin B\}

2. Relations 关系

2.1 Tuples 有序元组

An ordered element sequece <x1,x2,,xn>(xiN)<x_1,x_2,\dots,x_n> (x_i \in \mathbb{N}) is denoted as n-tuple.

2.1.1 Properties 有序n元组的性质

  • We say <x1,x2,,xm> = <y1,y2,,yn><x_1,x_2,\dots,x_m> \ = \ <y_1,y_2,\dots,y_n> when m=n and x1=y1,,xn=ynm=n \ and \ x_1=y_1, \dots, x_n=y_n
  • 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 笛卡尔积

A×BA \times B denotes the Cartesian product: {<x,y>xA and yB}\{<x,y>|x \in A \ and \ y \in B\}.

2.2 Binary Relations 二元关系

A binary relation RR over sets XX and YY is a subset of A×BA \times B denoted as RA×BR \subseteq A \times B

<x,y> R<x,y> \ \in R means xx is RR-related to yy, denoted as R(x,y)R(x,y) or xRyxRy.

Specially when X=YX = Y, we call relation RR is over XX (denoted as xRxxRx).

e.g << is a binary relation over N,Z\mathbb{N},\mathbb{Z}.

2.3 n-ary Relation 多元关系

n-ary Cartesian product: A1×A2×A3×An={<x1,x2,x3,,xn>x1A1,x2A2,,xnAn}A_1 \times A_2 \times A_3 \times \dots A_n = \{<x_1,x_2,x_3,\dots,x_n>|x_1 \in A_1, x_2 \in A_2,\dots,x_n \in A_n\}

Iff RAnR \subseteq A^n, RR is denoted as n-ary relation over A.

2.4 Equivalence Relation 等价关系

When RR is a binary relation on set AA and RR is a equivalence relation, RR has following properties:

  • R is Reflexive(自反) meaning for all xAx \in A, xRxxRx.
  • R is Symmetric(对称) meaning for all x,yAx, y \in A, if xRyxRy then yRxyRx.
  • R is Transitive(可传递) meaning for all x,y,zAx, y, z \in A, if xRyxRy and yRzyRz, then xRzxRz.

e.g. “=” is an equivalence relation on N\mathbb{N}.

2.5 Equivalence Class 等价类

Given an equivalence relation RR over a set AA, for any xAx \in A, the equivalence class of x in the set

[x]R={yA  xRy}[x]_R = \{y \in A \ | \ xRy\}

Theorem 11 :
If RR is an equivalence relation over AA, then for all aAa \in A belongs to a equivalence class.

Theorem 22 :
Given an equivalence relation on set AA, the collection of equivalence classes forms a partition of set AA.

eg. Define a equivalence relation RR over Z\mathbb{Z} by:

aRba mod 3=b mod 3aRb \Leftrightarrow a \text{ mod } 3 = b \text{ mod } 3

All the equivalence classes of RR are:

[0]R={nZn mod 3=0}=3Z[1]R={nZn mod 3=1}=3Z+1[2]R={nZn mod 3=2}=3Z+2\begin{aligned} [0]_R &= \{n \in Z | n \text{ mod } 3 = 0\} = 3\mathbb{Z} \\ [1]_R &= \{n \in Z | n \text{ mod } 3 = 1\} = 3\mathbb{Z} + 1 \\ [2]_R &= \{n \in Z | n \text{ mod } 3 = 2\} = 3\mathbb{Z} + 2 \end{aligned}

2.6 Partial Order Relation 偏序关系

A binary relation RR is a partial order when satisfying RR is:

  • Reflective
  • Antisymmetric
  • Transitive

Minimal element: for xAx \in A there doesn’t exist another yAy \in A such that yRxyRx, then xx is the minimal element.

Maximal element: for xAx \in A there doesn’t exist another yAy \in A such that xRyxRy, then xx is the maximal element.

2.7 Total Order Relation 全序关系

If RR is a partial order relation and for any x,yAx, y \in A there exists xRyxRy or yRxyRx, then RR is a total order relation over AA

e.g. \subseteq is a total order on P(N)\mathcal{P}(\mathbb{N}), \emptyset is the minimal element and N\mathbb{N} is the maximal element.

3. Function 函数

A function from XX to YY is a binary relation RR that satisfies:

  • For all xXx \in X, there exists yYy \in Y such that xRyxRy.
  • If y,zy,z \in Y such that xRyxRy and xRzxRz, then y=zy=z.

3.1 Notation 记法

We typically use f,g,hf,g,h to represent functions

f:ABf: A \to B

expresses that ff is a function from set AA to BB.

  • Domain(定义域): the set of input values (AA for ff).
  • Codomain(陪域): the set of possible output values(BB for ff).
  • Range(值域): the set of actual output values (subset of BB for ff).

3.2 n-ary Function 多元函数

f:A1×A2××AnBf: A_1 \times A_2 \times \dots \times A_n \to B 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 f:XYf: X \to Y:

  • Injective: a,bX,f(a)=f(b)a=b\forall a,b \in X, f(a)=f(b)\Rightarrow a=b
    injective

  • Surjective: yY,xX,f(x)=y\forall y \in Y,\exist x \in X, f(x) = y
    surjective

  • Bijective: xX,g:YX,g(f(x))=x\forall x \in X ,\exist g: Y \to X, g(f(x)) = x, or, ff is both injective and surjective.
    bijective

3.4 Composition Function 复合函数

Given f:XYf: X \to Y, g:YZg: Y \to Z, function gf:XZg \circ f: X \to Z denotes as a composition function on X,Y,ZX,Y,Z


Mathematical logic (1) Set, Relation and function 集合,关系与函数
http://example.com/2024/06/10/mml-1/
作者
Zaddle
发布于
2024年6月10日
更新于
2024年6月11日
许可协议