Sei sulla pagina 1di 12

Diskrete Mathematik HS 13 Definition 2.5.

(i) The negation (logical NOT) of a proposition A, denoted


Zusammenfassung as ¬A, is true iff A is false.
(ii) The conjunction (logical AND) of two propositions A
and B, denoted A ∧ B, is true iff both A and B are true.
(iii) The disjunction (logical OR) of two propositions A and
2. Mathematical Reasoning, Proofs, and a B, denoted A ∨ B, is true iff A or B (or both) are true.
First Approach to Logic Definition 2.6. A correctly formed expression involving
propositional symbols (like A, B, C, . . .) and logical operators
2.1 What is a Proof? is called a formula (of propositional logic).

Definition 2.1. (Informal.) A proof of a statement S is a se- We introduce a new, derived logical operator: implication,
quence of simple, easily verifiable, consecutive steps. The denoted as A → B and defined by2 A → B :⇐⇒ ¬A ∨ B.
proof starts from a set of axioms (things postulated to be true) Two-sided implication, denoted A ↔ B, is defined as follows:
and known (previously proved) facts. Each step corresponds A ↔ B :⇐⇒ (A → B) ∧ (B → A).
to the application of a derivation rule to a few already proven There are also priority rules for logical operators which allow
statements, resulting in a newly proved statement, until the us to simplify the notation, in the same sense as in algebra one
final step proves S. can write ab + c (rather than (a · b) + c). Namely, ∧ and ∨ bind
stronger than → and ↔. Also, ¬ binds stronger than ∧ and ∨.
2.2 Propositions and Logical Formulas Definition 2.7. The symbol > denotes the function that is the
constant 1 (true), and ⊥ denotes the function that is constant
Definition 2.2. A proposition [Aussage] is a (mathematical) 0 (false).
statement that is either true or false.
Definition 2.8. Two formulas F and G (in propositional logic)
Definition 2.3. A true proposition is often called a theorem, a are called equivalent, denoted as F ⇐⇒ G (or also as F ≡ G),
lemma, or a corollary.1 if they correspond to the same function (table).
Definition 2.9. A formula F (in propositional logic) is called
Definition 2.4. The logical values (constants) “true” and a tautology [Tautologie] if it is true for all truth assignments
“false” are usually denoted as 1 and 0, respectively. of the involved propositional symbols.
1 In mathematical texts one sometimes calls a true statement a proposition 2 The symbol :⇐⇒ simply means that the left side (here A → B) is defined

(instead of a theorem). In practice this will not be confusing. to mean the right side (here ¬A ∨ B).
1 2

Definition 2.10. A formula F (in propositional logic) is called 2.4 Some Proof Patterns and Techniques
satisfiable [erfüllbar] if it is true for at least one truth assign-
ment of the involved propositional symbols, and it is called Theorem 2.3. If F and F → G are tautologies, then G is also a
unsatisfiable otherwise. tautology.
Definition 2.14. A direct proof of an implication F → G
Lemma 2.1. F is a tautology iff ¬F is unsatisfiable. works by assuming F and then deriving G (from F ), where
the derivation can possibly involve several proof steps.
Definition 2.11. One writes F =⇒ G (or F ⇒ G) to say that Definition 2.15. An indirect proof of an implication F → G
F implies G, i.e., that F → G is a tautology. works by assuming ¬G and deriving ¬F , i.e., by proving
¬G → ¬F .
Theorem 2.2. Implication is transitive: If F =⇒ G and G =⇒ H,
then F =⇒ H. Theorem 2.4. If ¬F → G and ¬G are tautologies, then F is
also a tautology.
2.3 Quantifiers and Predicate Logic Definition 2.16. An existence proof is the proof of a statement
of the form ∃x P (x).
Let us consider a set U as the universe in which we want to
reason. Definition 2.17. An inexistence proof is a proof of a statement
of the form ¬∃x P (x).
Definition 2.12. A k-ary predicate [Prädikat] P on U is a func- Definition 2.18. A proof by counterexample is a proof of a
tion U k → {0, 1}. statement of the form ¬∀x P (x) for some fixed predicate P ,
using ¬∀x P (x) ⇐⇒ ∃x ¬P (x). An a for which ¬P (a) is
Definition 2.13. For a universe U and predicate P (x) we de- true is called a counterexample.
fine the following logical statements:3
A proof by induction consists of two steps:
∀x P (x) is the statement that P (x) is true for all x ∈ U . Proof by induction:
1. Basis step. Prove P (0).
∃x P (x) is the statement that P (x) is true for some x ∈
2. Induction step. Prove ∀n (P (n) → P (n + 1)).
U , i.e., there exists an x ∈ U for which P (x) is true.

Theorem 2.5. For every predicate P on N we have P (0) ∧


3 Inthe literature one also finds the notations ∀x : P (x) and ∀x. P (x) ∀n (P (n) → P (n + 1)) =⇒ ∀n P (n).
instead of ∀x P (x), and similarly for ∃.
3 4
3. Sets, Relations, and Functions Definition 3.5. The power set of a set A, denoted P(A) , is the
set of all subsets of A: P(A) := {S| S ⊆ A}.
3.1 Sets and Operations on Sets
Definition 3.6. The union of two sets A and B is defined as2
Definition 3.1. A = B :⇐⇒ ∀x (x ∈ A ↔ x ∈ B).
A ∪ B := {x| x ∈ A ∨ x ∈ B}, and their intersection is defined
Definition 3.2. The number of elements of a finite set A is as A ∩ B := {x| x ∈ A ∧ x ∈ B}.
called its cardinality and is denoted |A|.
Let A be a set of sets. Then we define the union of all sets in
A set can also be described by a defining property of its ele- A as the set
S of all x that are an element of at least one of the
ments. If A is a set and P is a predicate defined on A, then sets in A: A := {x| ∃A ∈ A : x ∈ A}. Similarly, we define
{x ∈ A| P (x)} (or alternatively {x ∈ A : P (x)}) denotes the the intersection of all sets T
in A as the set of all x that are an
set of elements of A having property P . element of every set in A: A := {x| ∀A ∈ A : x ∈ A}.
For the operation of forming an ordered pair of two objects a Definition 3.7. For a given universe of discourse, U , the com-
and b, denoted (a, b), we have (a, b) = (c, d) :⇔ a = c ∧ b = d. plement of a set A, denoted A is A := {x ∈ U | x ∈ / A} or
Definition 3.3. The set A is a subset of the set B, denoted simply A = {x| x ∈/ A}.3
A ⊆ B, if every element of A is also an element of B, i.e., Definition 3.8. The difference of sets B and A, denoted B − A
A ⊆ B :⇐⇒ ∀x (x ∈ A → x ∈ B). (or sometimes B \ A) is the complement of A, relative to B:
B − A := {x ∈ B| x ∈ / A}.
It follows directly from the definition of set equality that
A = B ⇐⇒ (A ⊆ B) ∧ (B ⊆ A). Theorem 3.3. For any sets A, B, and C, and a universe U , the
following laws hold:
Idempotent: A ∩ A = A and A ∪ A = A;
Definition 3.4. The empty set, denoted ∅ or {}, is the set with Commutative: A ∩ B = B ∩ A and A ∪ B = B ∪ A;
no elements, i.e., ∀x (x 6∈ ∅).1 Associative: A ∩ (B ∩ C) = (A ∩ B) ∩ C and
A ∪ (B ∪ C) = (A ∪ B) ∪ C;
Lemma 3.1. The empty set is a subset of every set, i.e., ∀A (∅ ⊆ A)
Absorption: A ∩ (A ∪ B) = A and A ∪ (A ∩ B) = A;
Lemma 3.2. The empty set is unique.
2 This definition could also be written as ∀x (x ∈ A ∪ B ↔ x ∈ A ∨ x ∈
B).
1 One can consider ∀x (x ∈
/ ∅) as the definition of ∅. 3 The complement of A is sometimes also denoted as Ac .
5 6

Distributive: A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C); Lemma 3.4. The composition of relations is associative, i.e., we


A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C); have ρ(σφ) = (ρσ)φ.
Complementarity: A ∩ A = ∅ and A ∪ A = U ;
Lemma 3.5. Let ρ be a relation from A to B and let σ be a relation
Consistency: A ⊆ B ⇐⇒ A ∩ B = A ⇐⇒ A ∪ B = B.
from B to C. Then the inverse ρc
σ of ρσ is the relation σ
bρb.

Definition 3.9. The Cartesian product A×B of two sets A and Definition 3.14. A relation ρ on a set A is called reflexive if
B is the set of all ordered pairs with the first component from a ρ a for every a ∈ A, i.e., if id ⊆ ρ.
A and the second component from B: A × B = {(a, b)| a ∈
A ∧ b ∈ B}. Definition 3.15. A relation ρ on a set A is called irreflexive if
a6 ρ a for all a ∈ A.
More generally, the Cartesian product of k sets A1 , . . . , Ak is
the set of all lists of length k with the ith component from Ai : Definition 3.16. A relation ρ on a set A is called symmetric if
ρ = ρb, i.e., if a ρ b ⇐⇒ b ρ a.
× k
i=1 Ai = {(a1 , . . . , ak )| ai ∈ Ai for 1 ≤ i ≤ k}
Definition 3.17. A relation ρ on a set A is called antisymmet-
3.2 Relations ric if ρ ∩ ρb ⊆ id, i.e., a ρ b ∧ b ρ a =⇒ a = b.

Definition 3.10. A (binary) relation ρ from a set A to a set B Definition 3.18. A relation ρ on a set A is called transitive if
is a subset of A × B. If A = B, then ρ is called a relation on A. a ρ b ∧ b ρ c =⇒ a ρ c.

Instead of (a, b) ∈ ρ one usually writes a ρ b, Lemma 3.6. A relation ρ is transitive iff ρ2 ⊆ ρ.

Definition 3.11. For any set A, the identity relation on A, de- Definition 3.19. The transitive
S∞ closure of a relation ρ on a set
noted id, is the relation id = {(a, a)| a ∈ A}. A, denoted ρ∗ , is ρ∗ = n=1 ρn .

3.3 Equivalence Relations


Definition 3.12. The inverse of a relation ρ from A to B is the
relation ρb from B to A such that a ρ b ⇐⇒ b ρb a. Definition 3.20. An equivalence relation is a relation that is
reflexive, symmetric, and transitive.
Definition 3.13. Let ρ be a relation from A to B and let σ be
a relation from B to C. Then the composition of ρ and σ, de- Definition 3.21. For an equivalence relation θ on a set A and
noted ρσ (or also ρ ◦ σ), is the relation from A to C where for a ∈ A, the set of elements of A that are equivalent to a is
a ρσ c :⇐⇒ ∃b ∈ B : (a ρ b ∧ b σ c). The n-fold composi- called the equivalence class of a and is denoted as [a]θ : [a]θ :=
tion of a relation ρ on a set A is denoted ρn . {b ∈ A| b θ a}.
7 8
Lemma 3.7. The intersection of two equivalence relations is an Definition 3.28. In a poset (A; ) an element b is said to cover
equivalence relation. [überdecken] an element a if a ≺ b and there exists no c with
a ≺ c and c ≺ b (i.e., between a and b).
Definition 3.22. A partition of a set A is a set {Si ⊆ A}i∈I
of mutually disjoint
S subsets of A that cover A, i.e., Si ∩ Sj = Definition 3.29. The Hasse diagram of a (finite) poset (A; )
∅ for i 6= j and i∈I Si = A. is the directed graph whose vertices are labeled with the ele-
Definition 3.23. The set of equivalence classes of an equiva- ments of A and where there is an edge from a to b iff b covers
lence relation θ, denoted by A/θ := {[a]θ | a ∈ A}, is called the a.
quotient set of A by θ, or simply A modulo θ, or A mod θ. The Hasse diagram is a graph with directed edges. It is usu-
Theorem 3.8. The set A/θ of equivalence classes of an equivalence ally drawn such that whenever a ≺ b, then b is placed higher
relation θ on A is a partition of A. than a. This means that all arrows are directed upwards and
therefore can be omitted.
3.4 Partial Order Relations
Theorem 3.9. For given posets (A; ) and (B; v), the relation ≤
Definition 3.24. A partial order on a set A is a relation that defined on A×B by (a1 , b1 ) ≤ (a2 , b2 ) :⇐⇒ a1  a2 ∧ b1 v b2
is reflexive, antisymmetric, and transitive. A set A together is a partial order relation.
with a partial order  on A is called a partially ordered set Theorem 3.10. For given posets (A; ) and (B; v), the relation
(or simply poset) and is denoted as (A; ). ≤lex defined on A × B by (a1 , b1 ) ≤lex (a2 , b2 ) :⇐⇒ a1 ≺
For a partial order relation  we can define the relation a ≺ b a2 ∨ (a1 = a2 ∧ b1 v b2 ) is a partial order relation.
similar to how the relation < is obtained from ≤: a ≺ b :⇐⇒ Definition 3.32. Let (A; ) be a poset, and let S ⊆ A be some
a  b ∧ a 6= b. subset of A. Then
Definition 3.25. For a poset (A; ), two elements a and b are 1. a ∈ S is a minimal (maximal) element of S if there exists
called comparable [vergleichbar] if a  b or b  a; otherwise no b ∈ S with b ≺ a (b  a).
they are called incomparable. 2. a ∈ S is the least (greatest) element of S if a  b (a  b)
Definition 3.26. If any two elements of a poset (A; ) are for all b ∈ S.
comparable, then A is called totally ordered (or linearly or- 3. a ∈ A is a lower (upper) bound [untere (obere) Schranke]
dered) by . of S if a  b (a  b) for all b ∈ S.
Definition 3.27. A poset (A; ) is well-ordered [wohlgeord- 4. a ∈ A is the greatest lower bound (least upper bound) of
net] if it is totally ordered and if every non-empty subset of A S if a is the greatest (least) element of the set of all lower
has a least element. (upper) bounds of S.
9 10

Definition 3.33. Let (A; ) be a poset. If a and b (i.e., the set Definition 3.39. The subset f (A) of B is called the image (or
{a, b} ⊆ A) have a greatest lower bound, then it is called the range) of f and is also denoted Im(f ).
meet of a and b, often denoted a ∧ b. If a and b have a least up-
per bound, then it is called the join of a and b, often denoted Definition 3.40. For a subset T of B, the inverse image (or
a ∨ b. preimage) [Urbild] of T , denoted f −1 (T ), is the set of values
in A that map into T : f −1 (T ) := {a ∈ A| f (a) ∈ T }.
Definition 3.34. A poset (A; ) in which every pair of ele-
ments has a meet and a join is called a lattice [Verband]. Definition 3.41. A function f : A → B is called

3.5 Functions 1. injective if a 6= b ⇒ f (a) 6= f (b), i.e., no two distinct


values are mapped to the same function value (there are
Definition 3.35. A function f : A → B from a domain [Def- no “collisions”).
initionsbereich] A to a codomain [Bildbereich, Wertebereich]
B is a relation on A × B, i.e., a subset f ⊆ A × B, with the 2. surjective (or onto) if for every b ∈ B, b = f (a) for some
special properties (using the relation notation a f b): a ∈ A, i.e., if f (A) = B (every value in the codomain is
taken on for some argument).
1. ∀a ∈ A ∃b ∈ B a f b (f is totally defined),
3. bijective if it is both injective and surjective.
2. a f b ∧ a f b0 ⇒ b = b0 (f is well-defined).
Definition 3.42. The composition of a function f : A → B
The set of all functions A → B is denoted as B A . and a function g : B → C, denoted by g ◦ f or simply gf , is
Definition 3.36. A partial function is a relation on A×B such defined by g ◦ f (a) = g(f (a)).
that condition 2. above holds.
Lemma 3.11. Function composition is associative, i.e., (h◦g)◦f =
Definition 3.37. Two (partial) functions with common do- h ◦ (g ◦ f ).
main A and codomain B are equal if they are equal as rela-
tions (i.e., as sets).

f = g is equivalent to saying that the function values of f


and g agree for all arguments (including, in case of partial
functions, whether or not it is defined).
Definition 3.38. For a function f : A → B and a subset S
of A, the image [Bild] of S under f , denoted f (S), is the set
f (S) := {f (a) | a ∈ S}.
11 12
4. Combinatorics and Counting Ordered Unordered
With n+k−1
nk
4.1 Basic Counting Principles repetition   k
Without n! n n!
:=
The cardinality of the union of n disjoint sets repetition (n−k)! k k! (n − k)!
A1 , . . . , An is equal to the sum of the cardinal-
ities. This is known as the addition principle: Table 4.1: Drawing k from n elements.
∀i,
Pn j, 1 ≤ i < j ≤ n : Ai ∩ Aj = ∅ =⇒ |A1 ∪ · · · ∪ An | =
i=1 |A i |.
Consider the problem of counting a subset S of A × B . We
The multiplication principle for finite sets states the ob- can count S in two different ways, either by determining for
vious fact that |AQ× B| = |A| · |B| and, more generally, each a ∈ A the number ma of b ∈ B such that (a, b) ∈ S, or by
n
|A1 × · · · × An | = i=1 |Ai |. determining for each bP∈ B the number
P nb of a ∈ A such that
(a, b) ∈ S. Then |S| = a∈A ma = b∈B nb . This is known as
the double-counting principle.
Bijection principle: If there is a bijection (or one-to-one cor-
respondence) between the finite sets A and B, then |A| = |B|. Theorem 4.3. If a set of n objects is partitioned into k < n sets,
then at least one of these sets contains at least d nk e objects.
Theorem 4.1. For any finite sets A1 , . . . , An ,
n
X X
4.2 Binomial Coefficients
|A1 ∪ · · · ∪ An | = |Ai | − |Ai1 ∩ Ai2 |  
n n
i=1 1≤i1 <i2 ≤n Lemma 4.4. k = n−k .
X
+ |Ai1 ∩ Ai2 ∩ Ai3 |   
n n−1 n−1
1≤i1 <i2 <i3 ≤n Lemma 4.5. For n > 0, k = k−1 + k .
n−1
− · · · + (−1) |A1 ∩ · · · ∩ An |.
Theorem 4.6. For any real (or complex)
Pn numbers
 x and y and for
n n−k k
n
X X every integer n ≥ 0, (x + y)n = k=0 k x y .
Theorem 4.2. |A1 ∪ · · · ∪ An | ≥ |Ai | − |Ai1 ∩ Ai2 |.
i=1 1≤i1 <i2 ≤n
Corollary 4.8. Let k, m, n ≥ 0 be integers with m + n > 0. Then,
m+n
 Pk m
 n  2n
 Pn 
n 2
We recall that k! = 1 · 2 · 3 · · · (k − 1) · k (k! is called “k k = i=0 i k−i . In particular, n = k=0 k .
factorial”).
13 14

4.4 Countable and Uncountable Sets Corollary 4.14. The direct product A × B of two countable sets A
and B is countable, i.e., A  N ∧ B  N =⇒ A × B  N.
Definition 4.2.
(i) Two sets A and B have the same cardinality, denoted Corollary 4.15. The rational numbers Q are countable.
A ∼ B, if there exists a bijection A → B.
Theorem 4.16. Let A and A1 , A2 , . . . be countable sets.
(ii) The cardinality of B is at least the cardinality of A, de-
(i) For any n ∈ N, the set An of n-tuples over A is countable.
noted A  B, if A ∼ C for some subset C ⊆ B.
(iii) B dominates A, denoted A ≺ B, if A  B and A 6∼ B. (ii) The union A1 ∪ A2 ∪ · · · of a countable list of countable sets
is countable.
(iv) A set A is called countable [abzählbar] if A  N, and
uncountable [überabzählbar] otherwise. (iii) The set A∗ of finite sequences over A is countable.

Definition 4.3. Let {0, 1}∞ denote the set of semi-infinite bi-
Lemma 4.10. nary sequences.
(i) The relation ∼ is an equivalence relation.1 Theorem 4.17. The set {0, 1}∞ is uncountable.
(ii) The relation  is transitive: A  B ∧ B  C =⇒ A  C.
Lemma 4.19. If A is uncountable and A  B, then B is uncount-
(iii) A ⊆ B =⇒ A  B. able, i.e., A 6 N ∧ A  B =⇒ B 6 N. In particular, if a subset
(iv) A subset of a countable set is also countable: A ⊆ B ∧ B  of a set B is uncountable, then so is B.
N =⇒ A  N.
Lemma 4.20. If A is uncountable and B is countable, then A − B
(v) A  B ∧ B  A =⇒ A ∼ B. is uncountable.
(vi) For two sets A and B, exactly one of A ≺ B, A ∼ B, and
B ≺ A holds. Theorem 4.21. The set R of real numbers is uncountable.

Theorem 4.11. A set A is countable iff it is finite or if A ∼ N. Lemma 4.22. The interval [0, 1) of the real numbers is uncount-
able.
Theorem 4.12. The set {0, 1}∗ := {, 0, 1, 00, 01, 10, 11, 000, . . .}
of finite binary sequences is countable.2
Theorem 4.13. The set N × N (= N2 ) of ordered pairs of natural
numbers is countable.
1 Here ∼ and  should be understood as relations on a set of sets.
2 Here  denotes the empty string.
15 16
5. Graph Theory Definition 5.5. A graph G = (V, E) is a subgraph [Teilgraph]
of a graph H = (V 0 , E 0 ), sometimes denoted G v H, if V ⊆ V 0
5.2 Basic Concepts and E ⊆ E 0 .
Definition 5.6. The union of two graphs G = (V, E) and H =
Definition 5.1. A (simple) graph G = (V, 
E) consists of a finite
(V 0 , E 0 ) is the graph G ∪ H := (V ∪ V 0 , E ∪ E 0 ).
set V of vertices [Knoten] and a set E ⊆ {u, v} ⊆ V | u 6= v
of edges [Kanten]. The complement G of a graph G = (V, E) is the graph G =
(V, E) where E consist of all possible edges that are not in E.
An edge {u, v} ∈ E is said to connect the vertices u and v. Definition 5.7. A graph G = (V, E) is called bipartite if V can
Vertices connected by an edge are also called adjacent [be- be split into two disjoint sets V1 and V2 of vertices, V = V1 ∪V2 ,
nachbart] (or neighbors). such that no edge connects two vertices in the same subset Vi
Definition 5.2. The neighborhood of a vertex v is the set (i = 1, 2).
Γ(v) := {u ∈ V | {u, v} ∈ E} of vertices adjacent to v. The
degree deg(v) of a vertex v is the number of edges (or ver- Definition 5.8. The adjacency matrix AG = [aij ] of an undi-
tices) connected to v, i.e., deg(v) := |Γ(v)|. A graph is called rected graph G = (V, E) with
 V = {v1 , . . . , vn } is the binary
k-regular if deg(v) = k for all v ∈ V . 1 if {vi , vj } ∈ E
n × n matrix where ai,j =
0 otherwise.
An important extension of the graph concept is obtained For a directed graph, the condition {vi , vj } ∈ E must be re-
when the edges are directed, i.e., they are ordered pairs (u, v) placed by (vi , vj ) ∈ E.
(rather than sets {u, v}) where u and v are often called the
source and the destination, respectively, of the edge. Definition 5.9. Two graphs G = (V, E) and H = (V 0 , E 0 ) are
isomorphic, denoted G ∼ = H, if there exists a bijection π : V →
Definition 5.3. A directed graph G = (V, E) consists of a finite V 0 such that renaming the vertices of G according to π results
set V of vertices and a set E ⊆ V × V of (directed) edges. in H, i.e., if {u, v} ∈ E ⇐⇒ {π(u), π(v)} ∈ E 0 .
Definition 5.4. The in-degree deg− (v) of a vertex v is the num-
For directed graphs the definition is similar, except that {u, v}
ber of edges entering v, and the out-degree deg+ (v) of v is the
and {π(u), π(v)} must be replaced by (u, v) and (π(u), π(v)),
number of edges leaving v.
respectively.
P
Lemma 5.1. In a directed graph, v∈V deg− (v) = Definition 5.10. A graph G = (V, E) is contained in a graph
P + P
v∈V deg (v) = |E|. In an undirected graph, v∈V deg(v) = H = (V 0 , E 0 ), denoted G  H, if there exists a subgraph K of
2|E|. H that is isomorphic to G: G  H :⇔ ∃K (G ∼ = K ∧ K v H).
17 18

The complete graph on n vertices, denoted Kn , is a simple 5.3 Paths and Cycles
graph with n vertices in which any pair of vertices is con-
nected. The complement of Kn is the empty graph (with no Definition 5.16. A walk [Weg] (from u to v) of length n in
edges). a graph or directed graph G is a sequence (u, v1 , . . . , vn−1 , v)
of vertices such that consecutive vertices are connected. If all
Definition 5.11. An (m, n)-mesh [Gittergraph] is a graph vertices are distinct, then a walk is called a path, and if all
Mm,n on mn vertices with V = {(i, j) | 1 ≤ i ≤ m, 1 ≤ j ≤ the edges (but not necessarily the vertices) in the walk are dis-
n} and where (i, j) and (i0 , j 0 ) are connected iff i = i0 and tinct, it is called a tour [Tour]. When the starting and endpoint
|j − j 0 | = 1 or j = j 0 and |i − i0 | = 1. are identical (i.e., u = v), then a path of length ≥ 3 is called a
cycle and a tour is called a circuit [Schleife].
Definition 5.12. A path [Pfad] Pn consists of n + 1 ver-
tices connected like a chain, i.e., V = {v0 , . . . , vn } and Definition 5.17. An undirected graph G is connected [zusam-
E = {{v0 , v1 }, {v1 , v2 }, {v2 , v3 }, . . . , {vn−1 , vn }}. A directed menhängend] if any two vertices are connected by a path.
The maximal connected subgraphs of a graph G are called the
path P~n is like Pn , but it is directed, i.e., E = {(v0 , v1 ),
components of G.
(v1 , v2 ), (v2 , v3 ), . . . , (vn−1 , vn )}.

Definition 5.13. A cycle [Kreis] Cn (for n ≥ 3) consists of n


Definition 5.18. A cycle in a (directed or undirected) graph
vertices connected cyclically, i.e., V = {v1 , . . . , vn } and E =
G is called Hamiltonian if it visits all vertices. If such a cycle
{{v1 , v2 }, {v2 , v3 }, . . . , {vn , v1 }}. A directed cycle C~ n is like Cn ,
exists, the graph G is called Hamiltonian.
but it is directed, i.e., E = {(v1 , v2 ), (v2 , v3 ), . . . , (vn , v1 )}.
Theorem 5.2. A graph G = (V, E) for which |V | ≥ 3 and
Definition 5.14. A d-dimensional hypercube Qd is a graph on deg(u)+deg(v) ≥ |V | for every non-adjacent pair (u, v) of vertices
V = {0, 1}d with {u, v} ∈ E iff u and v differ in exactly one (i.e., {u, v} ∈
/ E), is Hamiltonian. In particular, if deg(v) ≥ |V |/2
bit. for all v ∈ V , then G is Hamiltonian.

Definition 5.15. The complete bipartite graph Km,n is a graph


on m + n vertices obtained by taking two vertex subsets B Theorem 5.3. The hypercube Qd is Hamiltonian for d ≥ 2.
and W (for black and white) of sizes m and n, respectively,
and connecting each vertex in B with every vertex in W , i.e., Definition 5.19. A Hamiltonian cycle in a hypercube is called
Km,n = (V, E) with V = B∪W , B∩W = ∅, |B| = m, |W | = n, a Gray code.
and E = {{u, v} | u ∈ B ∧ v ∈ W }.
19 20
5.4 Trees Definition 5.28. A drawing of a planar graph divides the
plane into disjoint regions, one of which is infinite. The degree
Definition 5.24. A tree is an undirected connected graph with of a region is the number of edges one encounters in a walk
no cycles. A forest is an undirected graph with no cycles. i.e., around the region’s boundary. (An edge is counted twice if
the union of several trees with disjoint vertex sets. A leaf is a the edge is a bridge.1 )
vertex with degree 1.
Theorem 5.8 (Euler’s formula). A plane drawing of a connected
Lemma 5.6. A tree with n ≥ 2 vertices has at least 2 leaves. plane graph G = (V, E) divides the plane into r := |E| − |V | + 2
regions.
Theorem 5.7. For a graph G with n vertices, the following state-
ments are equivalent: Lemma 5.9. For any connected plane graph G = (V, E), the sum
of the degrees of the regions is equal to 2|E|.
(a) G is a tree.
(b) G has n − 1 edges and no cycles. Theorem 5.10. Every connected planar graph G = (V, E) with
|V | ≥ 3 satisfies |E| ≤ 3|V |−6. If G is bipartite, then the following
(c) G has n − 1 edges and is connected.
stronger inequality holds: |E| ≤ 2|V | − 4.
Definition 5.25. A spanning tree [Spannbaum] of a connected Corollary 5.11. Kn is planar iff n ≤ 4.
graph G is a subgraph of G which is a tree and contains all
vertices of G. Corollary 5.12. K3,3 is not planar.

Definition 5.26. A rooted tree is a tree with a distinguished We can define three operations on a graph:
vertex, the root. There is a unique path from the root to every
(1) deletion of edges,
vertex v; its length is the distance of v from the root. The
height or depth of the tree is the maximal distance of a leaf (2) deletion of singleton vertices, and
from the root. The vertices on the path from the root to v are (3) merging neighboring vertices, i.e., deleting the edge be-
called ancestors of v. The ancestor which is a neighbor of v is tween them, replacing the two vertices by a single ver-
called the parent, and v is called a child of the parent. A rooted tex and maintaining all edges from the two (merged)
tree is a d-ary tree if every vertex has at most d children. vertices.
Lemma 5.13. If a sequence of these three operations is performed
5.5 Planar Graphs on a graph G and the resulting graph H is non-planar, then also G
Definition 5.27. A graph is planar if it can be drawn in the is non-planar.
plane with no edges crossing. 1 A bridge in a graph is an edge which, when removed, makes the graph

disconnected. A dangling edge is also a bridge.


21 22

Definition 5.30. A polyhedron is a solid bounded by a finite 6. Number Theory


number of (plane) polygon faces. The vertices and edges of
these polygons are the vertices and edges of the polyhedron. 6.2 Divisors and Division
A polyhedron is convex if the straight line segment connect-
ing any two points lies entirely within it. A polyhedron is Definition 6.1. For integers a and b with a 6= 0 we say that
regular if for some m, n ≥ 3 each vertex meets exactly m faces a divides b, denoted a | b, if there exists an integer c such that
(and hence m edges) and each face is a regular n-gon. b = ac. In this case, a is called a divisor [Teiler] or factor
of b and b is called a multiple [Vielfaches] of a. The (unique)
Theorem 5.16. There are exactly five regular polyhedra, where integer c is called the quotient when b is divided by a, and we
(m, n) is either (3, 3), (3, 4), (4, 3), (3, 5), or (5, 3). write c = ab or c = b/a. We write a6 | b if a does not divide b.

Theorem 6.1 (Euclid). For all integers a and d 6= 0 there exist


unique integers q and r satisfying a = dq + r and 0 ≤ r < |d|.

Here a is called the dividend, d is called the divisor, q is called


the quotient, and r is called the remainder. The remainder r
is often denoted as Rd (a) or sometimes as a mod d.

Definition 6.2. For integers a and b (not both 0), an integer


d is called a greatest common divisor of a and b if d divides
both a and b and if every common divisor of a and b divides
d, i.e., d | a, d | b, and c | a ∧ c | b =⇒ c | d.

Definition 6.3. For a, b ∈ Z (not both 0) one denotes the


unique positive greatest common divisor by gcd(a, b) and
usually calls it the greatest common divisor. If gcd(a, b) = 1,
then a and b are called relatively prime [teilerfremd].

Definition 6.4. For a, b ∈ Z, the ideal generated by a and


b [durch a und b erzeugtes Ideal], denoted (a, b), is the set
(a, b) := {ua + vb | u, v ∈ Z}. Similarly, the ideal generated by
a single integer a is (a) := {ua | u ∈ Z}.
23 24
Lemma 6.2. For a, b ∈ Z there exists d ∈ Z such that (a, b) = (d). Lemma 6.6. If p is a prime which divides the product x1 x2 · · · xn
of some integers x1 , . . . , xn , then p divides one of them, i.e., p | xi
Lemma 6.3. Let a, b ∈ Z (not both 0). If (a, b) = (d), then d is a
for some i ∈ {1, . . . , n}.
greatest common divisor of a and b.
Corollary 6.4. For a, b ∈ Z (not both 0), there exist u, v ∈ Z such Theorem 6.7. Every positive integer can be written uniquely (up
that gcd(a, b) = ua + vb. to the order in which factors are listed) as the product of primes.

Theorem 6.8. n is irrational unless n is a square (n = c2 for
σ1 := a; σ2 := b; some c ∈ Z).
u1 := 1; u2 := 0;
v1 := 0; v2 := 1; Definition 6.6. The least common multiple l of two positive
while σ2 > 0 do begin integers a and b, denoted l = lcm(a, b), is the common multi-
q := σ1 div σ2 ; ple of a and b which divides every common multiple of a and
r := σ1 − qσ2 ; b, i.e., a | l, b | l, l > 0, and a | l0 ∧ b | l0 =⇒ l | l0 .
σ1 := σ2 ; σ2 := r;
t := u2 ; u2 := u1 − qu2 ; u1 := t;
t := v2 ; v2 := v1 − qv2 ; v1 := t; 6.5 Congruences and Modular Arithmetic
end;
Definition 6.8. For a, b, m ∈ Z with m ≥ 1, we say that a is
d := σ1 ; u = u1 ; v := v1 ;
congruent to b modulo m if m divides a − b. We write a ≡
b (mod m) or simply a ≡m b, i.e., a ≡m b :⇐⇒ m | (a − b).
Figure 6.1: Extended gcd-algorithm (Euclid).
Lemma 6.13. For any m ≥ 1, ≡m is an equivalence relation on Z.
Theorem 6.5. The algorithm described in Figure 6.1 computes, for Lemma 6.14. If a ≡m b and c ≡m d, then a + c ≡m b +
given nonnegative integers a and b with a ≥ b (not both 0), the d and ac ≡m bd.
integers d = gcd(a, b), as well as u and v satisfying ua + vb = Corollary 6.15. Let f (x1 , . . . , xk ) be a multi-variate polynomial
gcd(a, b). in k variables with integer coefficients, and let m ≥ 1. If ai ≡m bi
for 1 ≤ i ≤ k, then f (a1 , . . . , ak ) ≡m f (b1 , . . . , bk ).
6.3 Factorization into Primes
There are m equivalence classes of the equivalence relation
Definition 6.5. A positive integer p > 1 is called prime if the ≡m , namely [0], [1], . . . , [m − 1]. Each equivalence class [a]
only positive divisors of p are 1 and p. An integer greater than has a natural representative Rm (a) ∈ [a] in the set Zm :=
1 that is not a prime is called composite [zusammengesetzt]. {0, . . . , m − 1} of remainders modulo m.
25 26

Lemma 6.16. For any a, b, m ∈ Z with m ≥ 1, 7. Algebra


(i) a ≡m Rm (a).
7.1 Introduction
(ii) a ≡m b ⇐⇒ Rm (a) = Rm (b).
Definition 7.1. An operation on a set S is a function S n → S,
Lemma 6.17. For any a, b, m ∈ Z with m ≥ 1, where n ≥ 0 is called the “arity” of the operation.
(i) Rm (a + b) = Rm (Rm (a) + Rm (b)). Definition 7.2. An algebra (or algebraic system or Ω-algebra)
(ii) Rm (ab) = Rm (Rm (a) · Rm (b)). is a pair hS; Ωi where S is a set (the carrier [Trägermenge] of
the algebra) and Ω = (ω1 , . . . , ωn ) is a list of operations on S.1
Lemma 6.18. The congruence equation ax ≡m 1 has a solution
x ∈ Zm iff gcd(a, m) = 1. The solution is unique. 7.2 Semigroups, Monoids, Groups
Definition 6.9. If gcd(a, m) = 1, the unique solution x ∈ Zm Definition 7.3. A left [right] neutral element (or identity el-
to the congruence equation ax ≡m 1 is called the multi- ement) of an algebra hS; ∗i is an element e ∈ S such that
plicative inverse of a modulo m. One also uses the notation e ∗ a = a [a ∗ e = a] for all a ∈ S. If e ∗ a = a ∗ e = a for
x ≡m a−1 or x ≡m 1/a. all a ∈ S, then e is simply called neutral element.

Theorem 6.20. Let m Lemma 7.1. If hS; ∗i has both a left and a right neutral element,
Q1r, m2 , . . . , mr be pairwise relatively prime then they are equal. In particular hS; ∗i can have at most one neu-
integers and let M = i=1 mi . For every list a1 , . . . , ar with 0 ≤
ai < mi for 1 ≤ i ≤ r, the system of congruence equations tral element.

x ≡m1 a1 Definition 7.4. A binary operation ∗ on a set S is associative


x ≡m2 a2 if a ∗ (b ∗ c) = (a ∗ b) ∗ c for all a, b, c, ∈ S.
... Definition 7.5. A semigroup [Halbgruppe] is an algebra hS; ∗i
x ≡mr ar where ∗ is associative.

for x has a unique solution x satisfying 0 ≤ x < M . Definition 7.6. A monoid is an algebra hM ; ∗, ei where ∗ is
associative and e is the neutral element.
Pr
This unique solution is x = RM ( i=1 ai Mi Ni ) with Mi = 1 This definition, though very general, does not capture all algebraic sys-

M/mi and Ni ≡mi Mi−1 . tems one might be interested in. A more general type of algebraic system,
called heterogeneous algebraic systems, can have several carrier sets.
27 28
Definition 7.7. A left [right] inverse element of an element 7.3 Homomorphisms and Isomorphisms
a in an algebra hS; ∗, ei with neutral element e is an element
b ∈ S such that b ∗ a = e [a ∗ b = e]. If b ∗ a = a ∗ b = e, then b Definition 7.10. For two compatible2 algebras hS; Ωi and
is simply called an inverse of a. hS 0 ; Ω0 i, a function ψ : S → S 0 is called a homomorphism
from hS; Ωi to hS 0 ; Ω0 i if for every ω ∈ Ω (of arity n) and
Lemma 7.2. In a monoid hM ; ∗, ei, if a ∈ M has a left and a right corresponding ω 0 ∈ Ω0 (also of arity n), ψ (ω(a1 , . . . , an )) =
inverse, then they are equal. In particular, a has at most one inverse. ω 0 (ψ(a1 ), . . . , ψ(an )) for every a1 , . . . , an ∈ S.

Definition 7.8. A group is an algebra hG; ∗i satisfying the fol- A mapping ψ from a group hG; ∗,b, ei to a group hG0 ; ?,b, e0 i is,
lowing axioms: by definition, a homomorphism if

1. ψ(e) = e0 ,
G1 ∗ is associative.
2. ψ(b d for all a, and
a) = ψ(a)
G2 There exists a (neutral) element e such that a∗e = e∗a =
a for all a ∈ G. 3. ψ(a ∗ b) = ψ(a) ? ψ(b) for all a and b.
G3 Every a ∈ G has an inverse element b
a, i.e., a ∗ b a∗a =
a=b Definition 7.11. A bijective homomorphism ψ from hS; Ωi to
e. hS 0 ; Ω0 i is called an isomorphism, and hS; Ωi and hS 0 ; Ω0 i are
called isomorphic, denoted hS; Ωi ∼ = hS 0 ; Ω0 i, if such an iso-
Definition 7.9. A group hG; ∗i (or monoid or semigroup) is morphism exists.
called commutative or abelian if a ∗ b = b ∗ a for all a, b ∈ G.

Lemma 7.3. For a group hG; ∗,b, ei, we have for all a, b, c ∈ G: 7.4 The Structure of Groups
c
(i) (b
a) = a. Definition 7.12. The direct product of n groups
hG1 ; ∗1 i , . . . , hGn ; ∗n i is the algebra
(ii) ad
∗ b = bb ∗ b
a. hG1 × · · · × Gn ; ?i, where the operation ? is component-wise:
(a1 , . . . , an ) ? (b1 , . . . , bn ) = (a1 ∗1 b1 , . . . , an ∗n bn ).
(iii) Left cancellation law: a ∗ b = a ∗ c ⇒ b = c.
Lemma 7.4. hG1 × · · · × Gn ; ?i is a group, where the neutral ele-
(iv) Right cancellation law: b ∗ a = c ∗ a ⇒ b = c.
ment and the inversion operation are component-wise in the respec-
(v) The equation a ∗ x = b has a unique solution x for any a and tive groups.
b. So does the equation x ∗ a = b. 2 Two algebras are compatible if there is a one-to-one correspondence be-

tween their operations, where corresponding operations have the same arity.
29 30

Definition 7.13. A subset H of a group hG; ∗,b, ei is called a Corollary 7.9. For a finite group G, the order of every elements
subgroup of G, denoted H ≤ G, if hH; ∗,b, ei is a group, i.e., if divides the group order, i.e., ord(a) divides |G| for every a ∈ G.
H is closed with respect to all operations:
Corollary 7.10. Let G be a finite group. Then a|G| = e for every
(1) a ∗ b ∈ H for all a, b ∈ H,
a ∈ G.
(2) e ∈ H, and
(3) b
a ∈ H for all a ∈ H. Corollary 7.11. Every group of prime order is cyclic, and in such
a group every element except the neutral element is a generator.
Definition 7.14. Let G be a group and let a be an element
of G. The order [Ordnung] of a, denoted ord(a), is the least
Definition 7.19. Z∗m := {a ∈ Zm | gcd(a, m) = 1}.
m ≥ 1 such that am = e, if such an m exists, and ord(a) = ∞
otherwise. Definition 7.20. The Euler function ϕ : Z+ → Z+ is defined
Definition 7.15. For a finite group G, |G| is called the order of as the cardinality of Z∗m : ϕ(m) = |Z∗m |.
G. Qr Qr
Lemma 7.12. if m = i=1 pei i , then ϕ(m) = i=1 (pi − 1)pei i −1 .
Lemma 7.5. In a finite group G, every element has a finite order.
Theorem 7.13. hZ∗m ; ,−1 , 1i is a group.
If G is a group and a ∈ G has finite order, then for any m ∈ Z
we have am = aRord(a) (m) . Corollary 7.14 (Fermat, Euler). For all m ≥ 2 and all a with
gcd(a, m) = 1, aϕ(m) ≡m 1. In particular, for every prime p and
Definition 7.16. The smallest subgroup of a group G contain-
every a not divisible by p, ap−1 ≡p 1.
ing the element a ∈ G is called the group generated by a, de-
noted hai, is defined as hai := {an | n ∈ Z}. Theorem 7.15. The group Z∗m is cyclic iff m = 2, m = 4, m = pe ,
Definition 7.17. A group G = hgi generated by an element or m = 2pe , where p is an odd prime and e ≥ 1.
g ∈ G is called cyclic, and g is called a generator of G.
Theorem 7.6. A cyclic group of order n is isomorphic to hZn , ⊕i Theorem 7.17. Let G be some finite group (multiplicatively writ-
(and hence abelian). ten), and let e ∈ Z be a given exponent relatively prime to |G| (i.e.
gcd(e, |G|) = 1). The (unique) e-th root of y ∈ G, namely x ∈ G
Theorem 7.8 (Lagrange). Let G be a finite group and let H be a satisfying xe = y, can be computed according to x = y d , where d is
subgroup of G. Then the order of H divides the order of G, i.e., |H| the multiplicative inverse of e modulo |G|, i.e., d ≡|G| e−1 .
divides |G|.
31 32
7.5 Rings and Fields (iii) If a | b and a | c, then a | (b + c).

Definition 7.21. A ring hR; +, −, 0, ·, 1i is an algebraic system Definition 7.24. An element a 6= 0 of a commutative ring R is
for which called a zerodivisor [Nullteiler] if ab = 0 for some b 6= 0 in R.
(i) hR; +, −, 0i is an abelian group.
Definition 7.25. An element u of a ring R is called a unit [Ein-
(ii) hR; ·, 1i is a monoid. heit] if u is invertible, i.e., uv = vu = 1 for some v ∈ R (we
(iii) a(b+c) = ab+ac and (b+c)a = ba+ca for all a, b, c ∈ R write v = u−1 ). The set of units of R is denoted by R∗ .
(left and right distributive laws).
A ring is called commutative if multiplication is commutative Lemma 7.20. For a ring R, R∗ is a multiplicative group (the group
(ab = ba). of units of R).

Lemma 7.18. For any ring hR; +, −, 0, ·, 1i, Definition 7.26. An integral domain [Integritätsbereich] is a
nontrivial commutative ring without zerodivisors: ab = 0 ⇒
(i) 0a = a0 = 0 for all a ∈ R.
a = 0 ∨ b = 0.
(ii) (−a)b = −ab.
(iii) (−a)(−b) = ab. Lemma 7.21. In an integral domain, if a | b, then c with b = ac is
unique (and is denoted by c = ab or c = b/a).3
(iv) If R is non-trivial (i.e., if it has more than one element), then
1 6= 0. Definition 7.27. A polynomial a(x) over a ring R in the in-
determinate x is a formal expression of the form a(x) =
Definition 7.22. The characteristic of a ring is the order of 1 Pd
ad xd + ad−1 xd−1 + · · · + a1 x + a0 = i=0 ai x . for some
i
in the additive group, but we define it to be 0 if the order of 1
is infinite. non-negative integer d. The degree deg(a(x)) of a(x) is the
greatest i for which ai 6= 0. The special polynomial 0 (i.e., all
the ai are 0) is defined to have degree “minus infinity”. Let
Definition 7.23. Let R be a commutative ring. For a, b ∈ R
R[x] denote the set of polynomials (in x) over R.
with a 6= 0 we say that a divides b, denoted a | b, if there exists
c ∈ R such that b = ac. In this case, a is called a divisor [Teiler] Theorem 7.22. R[x] is a ring.
or factor of b and b is called a multiple [Vielfaches] of a.
Lemma 7.23. If D is an integral domain, then so is D[x]. The
Lemma 7.19. In any commutative ring, units of D[x] are the constant polynomials which are units of D,
i.e., D[x]∗ = D∗ .
(i) If a | b and b | c, then a | c, i.e., the relation | is transitive.
(ii) If a | b, then a | bc for all c. 3 Note that the terms b
a
(or b/a) are defined only if a | b.
33 34

Definition 7.28. A field [Körper] is a nontrivial commutative Lemma 7.31. For a field F , α ∈ F is a root of a(x) iff x−α divides
ring F in which every nonzero element is a unit, i.e., F ∗ = a(x).
F − {0}.
Corollary 7.32. A polynomial a(x) of degree 2 or 3 over a field F
Theorem 7.24. Zp is a field iff p is prime. is irreducible iff it has no root.4
Definition 7.36. If α is a root of a(x), then its multiplicity is
Theorem 7.25. A field is an integral domain.
the highest power of x − α dividing a(x).
Theorem 7.26. A finite integral domain is a field.
Theorem 7.33. For an integral domain D, a nonzero polynomial
a(x) ∈ D[x] of degree d has at most d roots, counting multiplicities.
7.6 Polynomials over a Field
Definition 7.29. A polynomial a(x) ∈ F [x] is called monic Lemma 7.34. A polynomial a(x) ∈ F [x] of degree d is uniquely
[monisch, normiert] if the leading coefficient is 1. determined by any d + 1 values of a(x), i.e., by a(α1 ), . . . , a(αd+1 )
for any distinct α1 , . . . , αd+1 ∈ F .
Definition 7.30. A polynomial a(x) ∈ F [x] with degree at
Pd+1
least 1 is called irreducible if it is divisible only by constant This polynomial is then given by a(x) = i=1 βi ui (x), with
polynomials and by constant multiples of a(x). βi = a(αi ) and ui (x) = (α(x−α 1 )···(x−αi−1 )(x−αi+1 )···(x−αd+1 )
.
i −α1 )···(αi −αi−1 )(αi −αi+1 )···(αi −αd+1 )

Definition 7.31. For polynomials a(x) and b(x) in F [x] (not


both 0), a polynomial d(x) is called a greatest common divisor 7.7 Finite Fields
of a(x) and b(x) if d(x) | a(x) and d(x) | b(x) and if every Let Rm(x) (a(x)) denote the (unique) remainder when a(x) is
common divisor of a(x) and b(x) divides d(x). Moreover, the divided by m(x). The concept of congruence modulo m(x)
monic polynomial g(x) of largest degree such that g(x) | a(x) is defined like congruence modulo m. For a(x), b(x) ∈ F [x],
and g(x) | b(x) is called the greatest common divisor of a(x) a(x) ≡m(x) b(x) :⇐⇒ m(x) | (a(x) − b(x)).
and b(x), denoted gcd(a(x), b(x)).
Lemma 7.35. Congruence modulo m(x) is an equivalence relation
Theorem 7.28. Let F be a field. For any a(x) and b(x) 6= 0 in F [x] on F [x], and each equivalence class has a unique representative of
there exist unique q(x) (the quotient) and r(x) (the remainder) such degree less than deg(m(x)).
that a(x) = b(x) · q(x) + r(x) and deg(r(x)) < deg(b(x)).
Definition 7.37. Let m(x) be a polynomial of degree
d over F .
Then F [x]m(x) := a(x) ∈ F [x] | deg(a(x)) < d .
Definition 7.35. Let a(x) ∈ R[x]. An element α ∈ R for which
a(α) = 0 is called a root [Nullstelle oder Wurzel] of a(x). 4 Note that this statement is not true for polynomials of degree ≥ 4.
35 36
Lemma 7.36. Let F be a finite field with q elements and let m(x) symbols a0 , . . . , ak−1 ∈ A and encodes them into a list
be a polynomial of degree d over F . Then |F [x]m(x) | = q d . [c0 , . . . , cn−1 ] of n > k symbols in A (the codeword): E :
Ak → An : [a0 , . . . , ak−1 ] 7→ E(a0 , . . . , ak−1 ) = [c0 , . . . , cn−1 ].
Lemma 7.37. F [x]m(x) is a ring with respect to addition and mul-
tiplication modulo m(x). Definition 7.40. An (n, k)-error-correcting code (or simply
(n, k)-code) C over the alphabet A with |A| = q is a subset
Lemma 7.38. The congruence equation a(x)b(x) ≡m(x) 1 (for a of cardinality q k of An .
given a(x)) has a solution b(x) ∈ F [x]m(x) iff gcd(a(x), m(x))
 =
1. The solution is unique.5 In other words, F [x]∗m(x) = a(x) ∈ Definition 7.41. The Hamming distance between two code-
words is the number of positions at which the two codewords
F [x]m(x) | gcd(a(x), m(x)) = 1 .
differ.
Theorem 7.39. The ring F [x]m(x) is a field iff m(x) is irreducible.6 Definition 7.42. The minimum distance of an error-correcting
code C is the minimum of the Hamming distance between any
two codewords.
7.8 Some Applications of Finite Fields
Definition 7.38. A (t, n)-secret sharing scheme for a finite do- Definition 7.43. A decoding function D for an (n, k)-error-
main S is a method for sharing a secret value s ∈ S among correcting code is a function D : An → Ak .
n parties P1 , . . . , Pn such that any t of the parties can recon-
struct s, but no t − 1 (or fewer) parties have any information Definition 7.44. A code C can correct t errors if there exists
about s. a decoding function D such that when [r0 , . . . , rn−1 ] is ob-
tained from an arbitrary codeword [c0 , . . . , cn−1 ] by chang-
Theorem 7.43. Let n < q and let each party Pi be (publicly) ing at most arbitrary t positions, then E (D([r0 , . . . , rn−1 ])) =
assigned a unique element αi of GF(q). If a1 , . . . , at−1 are cho- [c0 , . . . , cn−1 ].
sen uniformly at random from GF(q) and each party Pi gets the
share a(αi ), where the polynomial a(x) ∈ GF(x) is defined by Theorem 7.44. A code C with minimum distance d can correct t
a(x) := at−1 xt−1 +· · ·+a1 x+s, then this is a (t, n)-secret sharing errors iff d ≥ 2t + 1.
scheme. Theorem 7.45. Let A = GF(q) and let α0 , . . . , αn−1 be arbi-
Definition 7.39. The encoding function E of an error- trary distinct elements of GF(q). Consider the encoding function
correcting code for some alphabet A takes k information E(a0 , . . . , ak−1 ) = [a(α0 ), . . . , a(αn−1 )], where a(x) is the poly-
nomial a(x) := ak−1 xk−1 +· · ·+a1 x+a0 . This code has minimum
5 This b(x) (if it exists) is called the inverse of a(x) modulo m(x). distance n − k + 1.
6 F [x] is called an extension field of F .
m(x)
37 38

8. Logic Definition 8.5. A formula generally contains certain variable


parts which are not determined (by the formula) and can take
8.1 Elementary Concepts in Logic on values in certain domains. A particular choice of these
variable parts is called a structure.
Let S be the set of (syntactic representations of) mathematical
Definition 8.6. A structure is suitable [passend] for a formula
statements. Every statement s ∈ S is either true or false. The
F if all variable elements of F are defined (i.e., fixed), i.e., if it
function τ : S → {0, 1} assigning to each s ∈ S its truth
makes the formula true or false.1
value τ (s) and can be called the truth function. This function
defines the meaning, called the semantics, of objects in S. Definition 8.7. The semantics of a logic is a function σ as-
Let P be the set of proofs, for example strings over some al- signing to each formula F and each structure A suitable for F
phabet. A proof p for a statement s is relative to a verification a truth value σ(F, A) in {0, 1}.
function φ : S ×P → {0, 1}, where φ(s, p) = 1 means that the Definition 8.8. A (suitable) structure A for which a formula
proof is accepted (by the function φ). The function φ defines F is true is called a model for F , and one writes A |= F. More
what is a proof for statement s. generally, for a set M of formulas, a (suitable) structure for
which all formulas in M are true is called a model for M , de-
Definition 8.1. A proof system is a quadruple Π =
noted as A |= M . If A is not a model for M one writes A 6|= M .
(S, P, τ, φ), as above.
Definition 8.9. A formula F (or set M of formulas) is called
Definition 8.2. A proof system Π = (S, P, τ, φ) is sound if no satisfiable [erfüllbar] if there exists a model for F (or M ), and
false statement has a proof, i.e., if for all s ∈ S for which there unsatisfiable otherwise. The symbol ⊥ is used for an unsatis-
exists p ∈ P with φ(s, p) = 1, we have τ (s) = 1. fiable formula.
Definition 8.3. A proof system Π = (S, P, τ, φ) is complete Definition 8.10. A formula F is called a tautology [Tautolo-
if every true statement has a proof, i.e., if for all s ∈ S with gie] or valid [gültig, allgemeingültig] if it is true for every suit-
τ (s) = 1, there exists p ∈ P with φ(s, p) = 1. able structure. The symbol > is used for a tautology.
In addition, one requires that the function φ be efficiently Definition 8.11. A formula G is a logical consequence [(lo-
computable (for some notion of efficiency) and that every true gische) Folgerung] of a formula F (or a set M of formulas),
statement has a reasonably short proof. denoted F |= G (or M |= G ), if every structure suitable for
both F (or M ) and G, which is a model for F (for M ), is also a
Definition 8.4. The syntax of a logic defines an alphabet (of model for G.
allowed symbols) and specifies which strings (over the alpha- 1 A suitable structure can also define more variable elements then those
bet) are (syntactically) correct formulas. appearing in F .
39 40
Definition 8.12. Two formulas F and G are equivalent, de- One writes `K F if F can be derived from the empty set of
noted F ≡ G (or also F ⇐⇒ G), if every structure suitable for formulas.
both F and G yields the same truth value for F and G, i.e., if
each is logical consequence of the other: F ≡ G :⇐⇒ F |= Lemma 8.1. If F `K G for a sound calculus, then |= (F → G).
G and G |= F .
8.3 Propositional Logic
8.2 Logical Calculi Definition 8.18. (Syntax.) An atomic formula is of the form
Ai with i ∈ N.2 A formula is defined inductively: An atomic
Definition 8.13. A derivation rule [Schlussregel] is a rule for formula is a formula, and if F and G are formulas, then also
deriving a formula from a set of formulas (called the precon- ¬F , (F ∧ G), and (F ∨ G) are formulas.
dition). We write {F1 , . . . , Fk } `R G if G can be derived
from the set {F1 , . . . , Fk } by rule R. A formula of the form (F ∧ G) is called a conjunction, and a
formula of the form (F ∨ G) is called a disjunction.
Definition 8.14. A (logical) calculus [Kalkül] K is a finite set
of derivation rules: K = {R1 , . . . , Rm }. Definition 8.19. (Semantics.) For a set M of atomic formulas,
a truth assignment [(Wahrheits-)Belegung] is a function A :
Definition 8.15. A derivation [Herleitung] of a formula G
M → {0, 1}. Let M c be the set of formulas built from atomic
from a set M of formulas in a calculus K is a finite sequence
formulas in M . We extend the domain of A to M c, as follows:
(of some length n) of applications of rules in K, leading to G.
More precisely, we have M0 := M , Mi := Mi−1 ∪ {Gi } for
1 ≤ i ≤ n, where N `Ri Gi for some N ⊆ Mi−1 and for some A((F ∧ G)) = 1 if and only if A(F ) = 1 and A(G) = 1;
Ri ∈ K, and where Gn = G. We write M `K G if there is a A((F ∨ G)) = 1 if and only if A(F ) = 1 or A(G) = 1;
derivation of G from M in the calculus K.
A(¬F ) = 1 if and only if A(F ) = 0.
Definition 8.16. A derivation rule R is correct if for every set
M of formulas and every formula F , M `R F =⇒ M |= F . Lemma 8.2. For any formulas F , G, and H we have
Definition 8.17. A calculus K is sound [widerspruchsfrei] or 1) F ∧ F ≡ F and F ∨ F ≡ F (idempotence);
correct if for every set M of formulas and every formula F , if
F can be derived from M then F is also a logical consequence 2) F ∧ G ≡ G ∧ F and F ∨ G ≡ G ∨ F (commutativity);
of M : M `K F =⇒ M |= F , and K is complete [vollständig] 2 A is usually not used. This definition guarantees an unbounded sup-
0
if for every M and F , if F is a logical consequence of M , then ply of atomic formulas, but as a notational convention we can also write
F can also be derived from M : M |= F =⇒ M `K F . A, B, C, . . . instead of A1 , A2 , A3 , . . ..
41 42

3) (F ∧G)∧H ≡ F ∧(G∧H) and (F ∨G)∨H ≡ F ∨(G∨H) Definition 8.24. The set of clauses associated to a for-
(associativity); mula F = (L11 ∨ · · · ∨ L1m1 ) ∧ · · · ∧ (Ln1 ∨ · · · ∨
4) F ∧ (F ∨ G) ≡ F and F ∨ (F ∧ G) ≡ F (absorption); L
 nmn ) in CNF, denoted as K(F ), is the set K(F ) :=
{L11 , . . . , L1m1 } , . . . , {Ln1 , . . . , Lnmn } . The set of clauses
5) F ∧ (G ∨ H) ≡ (F ∧ G) ∨ (F ∧ H) (distributive law); associated with a set M = {F1 , . . . , Fk } of formulas is the
Sk
6) F ∨ (G ∧ H) ≡ (F ∨ G) ∧ (F ∨ H) (distributive law); union of their clause sets: K(M ) := i=1 K(Fi ).
7) ¬¬F ≡ F (double negation);
Definition 8.25. A clause K is a resolvent of clauses K1 and
8) ¬(F ∧ G) ≡ ¬F ∨ ¬G and ¬(F ∨ G) ≡ ¬F ∧ ¬G
K2 if there is a literal L such that L ∈ K1 , ¬L ∈ K2 , and3
(de Morgan’s rules);
9) F ∨ > ≡ > and F ∧ > ≡ F (tautology rules);
K = (K1 − {L}) ∪ (K2 − {¬L}). (8.1)
10) F ∨ ⊥ ≡ F and F ∧ ⊥ ≡ ⊥ (unsatisfiability rules).
11) F ∨ ¬F ≡ > and F ∧ ¬F ≡ ⊥.
Given a set K of clauses, a resolution step takes two clauses
Definition 8.20. A literal is an atomic formula or the negation K1 ∈ K and K2 ∈ K, computes a resolvent K, and adds K to
of an atomic formula. K. To be consistent with Section 8.2.2, one can write the reso-
lution rule as {K1 , K2 } `res K, where equation (8.1) must
Definition 8.21. A formula F is in conjunctive normal form be satisfied.The resolution calculus, denoted Res, consists of a
(CNF) if it is a conjunction of disjunctions of literals, i.e., if it single rule: Res = {res}.
is of the form F = (L11 ∨ · · · ∨ L1m1 ) ∧ · · · ∧ (Ln1 ∨ · · · ∨ Lnmn )
for some literals Lij .
Lemma 8.4. The resolution calculus is sound, i.e., if K `Res K
Definition 8.22. A formula F is in disjunctive normal form then K |= K.
(DNF) if it is a disjunction of conjunctions of literals, i.e., if it
is of the form F = (L11 ∧ · · · ∧ L1m1 ) ∨ · · · ∨ (Ln1 ∧ · · · ∧ Lnmn ) Theorem 8.5. A set M of formulas is unsatisfiable iff
for some literals Lij . K(M ) `Res ∅.

Theorem 8.3. Every formula is equivalent to a formula in CNF


and also to a formula in DNF.
3 For a literal L, ¬L is the negation of L, for example if L = ¬A, then

Definition 8.23. A clause is a set of literals. ¬L = A.


43 44
8.4 Predicate Logic Definition 8.28. For a formula F , a variable x and a term t,
F [x/t] denotes the formula obtained from F by substituting
Definition 8.26. (Syntax of predicate logic.) every free occurrence of x by t.

• A variable is of the form xi with i ∈ N.4 Definition 8.29. A structure is a tuple A = (U, φ, ψ, ξ) where
(k)
• A function symbol is of the form fi with i, k ∈ N, • U is a non-empty set, the so-called universe,
where k denotes the number of arguments of the func-
tion. Function symbols for k = 0 are called constants. • φ is a function assigning to each function symbol (in a
certain subset of all function symbols) a function, where
(k)
• A predicate symbol is of the form Pi with i, k ∈ N, for a k-ary function symbol f , φ(f ) is a function U k →
where k denotes the number of arguments of the predi- U.
cate. • ψ is a function assigning to each predicate symbol (in
• A term is defined inductively: A variable is a term, and a certain subset of all predicate symbols) a function,
(k)
if t1 , . . . , tk are terms, then fi (t1 , . . . , tk ) is a term. For where for a k-ary function symbol P , ψ(P ) is a func-
k = 0 one writes no parentheses. tion U k → {0, 1}, and where

• A formula is defined inductively: • ξ is a function assigning to each variable symbol (in a


certain subset of all variable symbols) a value in U .
(k)
– If t1 , . . . , tk are terms, then Pi (t1 , . . . , tk ) is a for-
Definition 8.30. (Semantics.) For a structure A = (U, φ, ψ, ξ),
mula, called an atomic formula.
we define the value (in U ) of terms and the truth value of
– If F and G are formulas, then also ¬F , (F ∧ G), and formulas under that structure.
(F ∨ G) are formulas.
– ∀xi F and ∃xi F are also formulas. • The value A(t) of a term t is defined recursively as follows:

Definition 8.27. Every occurrence of a variable in a formula is – If t is a variable, then A(t) = ξ(t).
either bound or free. If a variable x occurs in a (sub-)formula – If t is of the form f (t1 , . . . , tk ) for terms t1 , . . . , tk
of the form ∀x G or ∃x G, then it is bound, otherwise it is free.5 and a k-ary function symbol f , then A(t) =
A formula is closed if it contains no free variables. φ(f )(A(t1 ), . . . , A(tk )).

• The truth value of a formula F is defined recursively as


4x is usually not used.
0 follows:
5 The occurrence of a variable x immediately following a quantifier is also

bound. – A((F ∧G)) = 1 if and only if A(F ) = 1 and A(G) = 1;


45 46

– A((F ∨ G)) = 1 if and only if A(F ) = 1 or A(G) = 1; Lemma 8.7. If one replaces a subformula G of a formula F by an
– A(¬F ) = 1 if and only if A(F ) = 0. equivalent (to G) formula H, then the resulting formula is equiva-
– If F is of the form F = P (t1 , . . . , tk ) for terms lent to F .
t1 , . . . , tk and a k-ary predicate symbol P , then Lemma 8.8. For a formula G in which x occurs only free and in
A(F ) = ψ(P )(A(t1 ), . . . , A(tk )). which y does not occur, ∀x G ≡ ∀y G[x/y] and ∃x G ≡
– If F is of the form ∀x G or ∃x G, then let A[x→u] be the ∃y G[x/y].
same structure as A except that ξ(x) is overwritten by
u (i.e., ξ(x) = u): By appropriately renaming quantified variables one can
 transform any formula into an equivalent formula in which
1 if A[x→u] (G) = 1 for all u ∈ U
A(∀x G) = no variable appears both as a bound and a free variable and
0 else
 such that all variables appearing after the quantifiers are dis-
1 if A[x→u] (G) = 1 for some u ∈ U tinct. Such a formula is said to be in rectified [bereinigt] form.
A(∃x G) =
0 else.
Definition 8.31. A formula of the form
Q1 x1 Q2 x2 · · · Qn xn G, where the Qi are arbitrary quantifiers
Lemma 8.6. Any equivalence that holds in propositional logic also (∀ or ∃) and G is a formula free of quantifiers, is said to be in
holds in predicate logic. Moreover, for any formulas F , G, and H, prenex form [Pränexform].
where H does not contain the variable x, we have

1) ¬(∀x F ) ≡ ∃x ¬F ; Theorem 8.9. ¬∃x∀y P (y, x) ↔ ¬P (y, y) .
2) ¬(∃x F ) ≡ ∀x ¬F ; Corollary 8.10. There exists no set that contains all sets S that do
3) (∀x F ) ∧ (∀x G) ≡ ∀x (F ∧ G); not contain themselves, i.e., {S| S 6∈ S} is not a set.
4) (∃x F ) ∨ (∃x G) ≡ ∃x (F ∨ G);
Corollary 8.11. The set {0, 1}∞ is not countable.
5) ∀x ∀y F ≡ ∀y ∀x F ;
6) ∃x ∃y F ≡ ∃y ∃x F ; Corollary 8.12. There are functions N → {0, 1} that are not com-
puted by any program.
7) (∀x F ) ∧ H ≡ ∀x (F ∧ H);
8) (∀x F ) ∨ H ≡ ∀x (F ∨ H);
9) (∃x F ) ∧ H ≡ ∃x (F ∧ H);
10) (∃x F ) ∨ H ≡ ∃x (F ∨ H).
47 48

Potrebbero piacerti anche