离散数学基础
Set Theory & Logic
Naive Set Theory
The cardinality of a (finite and infinite) set
Definition. Given 2 sets
-
|S|\le |T|$ iff there exists an injection $f:S\hookrightarrow T -
|S|=|T|$ iff there exists an bijection $f:S\to T -
Property. Given a set
Obviously
S\hookrightarrow 2^S ,s\mapsto\delta_s gives a injection.If there exists a bijection, then there exists a surjection
f:S\twoheadrightarrow 2^S as bijections are surjections.Consider the projection
g:S\to\{0,1\} mappings\mapsto 1-f(s)(s) , theng differs from anyf(s) and lands in2^S . Therefore there does not exist such bijection. That is,|S|<|2^S| holds.
Theorem. Given 2 sets
Consider injections as edges, then for each
s\in S andt\in T , the out degree of each node is exactly 1 while the in degree is at most 1.Consider all paths of the graph. There are 2 types of paths:
- Those with a starting point. We pick the edges with the same direction as the first edge.
- Those without a starting point. We pick all edges from
S toT .Each node is paired exactly once, hence there exists a bijection.
Here are some examples:
-
|2^\N|=|\R| -
|\N|=|\N^2|=|\mathbb Q| -
|\R^\N|=|\R|
Theorem (Continuum Hypothesis). The following statement is independent from ZFC:
- There exists a set
S holding|\N|<|S|<|\R| .
There are some non-trival proporties of cardinities over infinite sets. By acknowledging the Axiom of Choise (AC), the following statements all holds.
Definition: A set
Poposition. A non-empty set is Dedekind-finite iff it is finite.
Poposition. For 2 arbitary sets
Poposition. For an infinite set
Many of the statments above are equivlant to the Well-Ordering Theorem, which is equivlant to the Axiom of Choise.
Theorem (Well-Ordering Theorem): Every set
-
a\le a -
a\le b$, $b\le c$ $\implies$ $a\le c -
a\le b$, $b\le a$ $\implies$ $a=b - either
a\le b orb\le a holds - for all non-empty set
T\subseteq S , there existsa\in S such that\forall b\in S ,a\le b
Well-order is kind of like the order of natural numbers. A well-order over
Proposition Logic (谓词逻辑)
Sementics
Proposition
Alphabets in proposition logic:
- Propositions:
P,Q,P_1,P_2,\ldots - Connectivities:
\rightarrow (implies),\land (and),\lor (or),\leftrightarrow (iff),\lnot (not),\perp (false) - Auxiliaries: ( and ) (brackets)
-
- PROP
\subseteq\Sigma^* : the set of all valide sentences defined recursively as follow:- Any atomic propositions
P_i, \perp\in PROP - Valied sentences connected by connectivities, like
(\psi\lor \varphi) ,\lnot \varphi ,(\varphi\rightarrow\psi)\in PROP, where\varphi, \psi\in PROP
- Any atomic propositions
We can define some kind of "isomorphism"
Now we can define an evaluation as a "isomorphism"
-
v((\varphi\land\psi))=\min\{v(\varphi), v(\psi)\} -
v((\varphi\lor\psi))=\max\{v(\varphi), v(\psi)\} -
v((\varphi\rightarrow\psi))=1-v(\varphi)(1-v(\psi)) -
v((\varphi\leftarrow\psi))=1-v(\psi)(1-v(\varphi)) -
v(\lnot\varphi)=1-v(\varphi) -
v(\perp)=0
The following are some appearent rules.
-
\dfrac{\varphi\,\varphi\rightarrow\psi}{\psi}(\to E) -
-
\dfrac{\varphi\land\psi}{\varphi}(\to E) -
\dfrac{\frac{[\not\varphi]}{\perp}}{\varphi}(\to RAA)
Example. Proof
System K
A different system.
System K is based on "possibility". The syntax
The system is "better" than natural deduction because it no longer depend on big steps (as natural deduction uses deduction itself as steps), in the contrary, it can store mass information on
Another important proporty is that by applying axioms in the system, the length of the statement only increases. Therefore there exists an algorithm that only use finite time to decide whether a statement holds.
Syntax and Semantic
One can observe the similarity between
We care about 2 things between the systems:
- Soundness. This is to say
\Gamma\vdash\varphi\implies\Gamma\vDash\varphi . - Completeness. This is to say
\Gamma\vDash\varphi\implies\Gamma\vdash\varphi .
Soundness is trival while completeness is more interesting.
Lemma. if
By applying the lemma recursively over all atomic propositions. We need to prove
If
If
It all boils down to "evaluate" a proposition in proposition logic.
Lemma. Let
We proof this using reduction.
Appearentally the statement holds for all atomic propositions (including
As semantics are consistant, Natural Deduction is also consistant.
In the section above we treat ors (
Intuitionistic Logic and Kripke model
Intuitionistic Logic, or Constructive Logic, is a different system that does not acknowledge RAA (or its equivlent form, such as law of excluded middle).
It is not easy to prove that some propositions cannot be applied without RAA until the emergence of Pripke model.
Definition. A Kripke model is a partially-ordered set
- For
w_1,w_0\in W ,w_1\ge w_0 holds iffV(w_1,P_i)\ge V(w_0,P_i) for all atomic propositionP_i . -
V(w,\perp)=0
The evaluation of a statement
Theorem. Intuitionistic logic is consistent with the Kripke model.
Type Theory
胡振江最喜欢的。
Dependent Type Theory 和程序性证明。
Preidcate Logic
Alphabet:
- Constants
- Variables:
x,y,z,\ldots orx_1,x_2,\ldots - Functions:
f,g,h,\ldots orf_1,f_2,\ldots - Predicates:
\perp ,= ,P,Q,\ldots orP_1,P_2,\ldots - Connectives:
\land, \lor, \lnot, \rightarrow, \leftrightarrow - Auxillaries:
( ,) and, - Quantifier:
\forall, \exists
Definition: TERM is the set that describes all "valid" value sentences generated by the alphabet as the rules following:
- for any constants
c and variablex ,c,x\in TERM - if
t_1,t_2,\ldots,t_n\in TERM, given any functionf that acceptsn variables,f(t_1,t_2,\ldots,t_n)\in TERM
Definition: FORM is the set that describes all "valid" formulas generated by the following ruls:
- for any
n termst_1,t_2,\ldots and any predicateP that acceptsn terms,P(t_1,\ldots,t_n)\in FORM - for any
\varphi, \psi\in FORM,\lnot\varphi,\varphi\circ\psi\in FORM, where\circ is a binary connective. - for any formula
\varphi\in FORM any variablex ,\forall x\, \varphi\in FORM and\exists x\,\varphi\in FORM.
Note the subtle difference between the
Note: a variable is free iff there is no quantifier to describe it.
Definition. A structure is a tuple of the following:
- a universe (a set
\Omega ), - functions (each defined over
\Omega^n\to\Omega ) - predicates (a
n -nary relationshipP\subset\Omega^n ) - constants (
c_1,\ldots,c_n\in\Omega
A structure is written as
In real life, one have to "fill in the blanks", that is, use predicates, functions and variables with "real" meanings.
An example is the structure
Note: we use a overlined symbol to indicate the character in FOR and TERM like
Definition: An evaluation of a structure
- for
t\in TERM:-
[[\overline c]]_{\mathfrak A}=c -
[[\overline x]]_{\mathfrak A}=x -
[[\overline f(t_1,t_2)]]=f([[t_1]]_{\mathfrak A},[[t_2]]_{\mathfrak A})
-
- for
\varphi\in FOR:-
[[\overline P(t_1,t_2)]]=P([[t_1]]_{\mathfrak A},[[t_2]]_{\mathfrak A}) -
[[\varphi\rightarrow\psi]]_{\mathfrak A}=\max\{1-[[\varphi]]_{\mathfrak A}, [[\psi]]_{\mathfrak A}\} - ... (other connectives)
-
[[\forall x\,\varphi(x)]]_{\mathfrak A}=\min_{c\in\Omega}[[\varphi]]_{\mathfrak A|_{x=c}} -
[[\exists x\,\varphi(x)]]_{\mathfrak A}=\max_{c\in\Omega}[[\varphi]]_{\mathfrak A|_{x=c}}
-
Definition. let
Natural Deduction over Predicate Logic
Peano Axioms
- Functions:
+ ,\cdot ,S . - Constant: 0
Axioms:
-
\forall x$ $\lnot(S(x))=0 -
\forall x\forall y$ $(S(x)=S(y))\to (x=y) -
\forall x$ $x+0=x -
x+S(y)=S(x+y) -
\forall x$ $x\cdot 0=x -
\forall x\forall y$ $x\cdot S(y)=xy+x -
\varphi(0)\land(\forall x$ $(\varphi(x)\to\varphi(S(x)))\to\forall x$ $\varphi(x)
Consistency
Given a set of axioms
Theorems
-
T\vdash (\exists\varphi(x)\to\varphi(y))\to\psi -
-
T\vdash\exists y(\exists\varphi(x)\to\varphi(y)) -
which appearentally holds.
Back to consistency. If
Extend
This can be given where
This might cause problem when neither
By applying Zorn's Lemma or by lining up and examing sentences one at a time, one can get
There will be more problems with "=". We say
We mainly talk about countable sentences. An interesting fact about this is that almost all real numbers cannot be described(as languages are countable).
ZFC set theory
- Axiom of extensionality(外延公理):
\forall x\forall y(\forall z z\in x\leftrightarrow z\in y)\to x=y - Axiom of schema of specification(分离公理)
\forall x,w_1,\ldots,w_t \exists y \forall z(z\in y\leftrightarrow (z\in x\land\varphi(z,w_1,\ldots,w_t))) ; This gives empty set and intersection of sets. - Axiom of pairing(配对公理):
\forall x,y \exists z(x\in z\land y\in z) - Axiom of union(并集公理):
\forall x\exists y\forall z,w(z\in x\land w\in z\to w\in y) - Axiom of power set(幂集公理):
\forall x\exists y\forall z(z\subset x\to z\in y) (herex\subset y\iff \forall z(z\in x\to z\in y) ) - Axiom of infinity(无穷公理):
\exists N (\emptyset\in N\land(\exists y,y\in N\to y\cup\{y\}\in N) - Axiom schema of replacement(替换公理):
\forall A, w_1,\ldots,w_t(\forall x x\in A\to\exists!y \varphi(y,x,w_1,\ldots,w_t))\to\exists y(\forall x (x\in A)\to\exists y \varphi(y,x,w_1,\ldots,w_t)\land y\in B - Axiom of regularity(正则公理):
\forall x (x\neq\emptyset\to\exists y(y\in x\land x\cap y=\emptyset)) - Axiom of choise(选择公理): For any set of sets
S , there exists a projectionf:S\to\cup S wheref(a)\in a holds for alla\in S
Cartesian product: for all sets
Given the cartesian product, we can define a relationship
However, ZFC is incomplete, meaning some true statements cannot be proved.
Imcomplete theorem
We can encode statements (which are finite strings) into integers as there will only be finite variables in a statement.
Note that ZFC is strong enough to hold natural numbers(or Peano Axioms).
Consider a statement that decides whether a encoded sentence is a TERM
Discrete Fourier Transform
Get
Its easy to see that
We claim
Note that
Consider
Therefore,