0% found this document useful (0 votes)
3 views

cs208

Uploaded by

Sake Anila
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

cs208

Uploaded by

Sake Anila
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

CS208

Jinesh Machchhar

1 Fundamental structures
Basic structures such as sets, functions and relations are discussed here.

Lecture 1
Definition 1. A set is an unordered collection of objects, called the ele-
ments of the set. We write a ∈ A to denote that a is an element of the set
A. Likewise, we write a ∈
/ A to denote that a is not an element of the set A.

A commonly used notation for sets: A = {a, b, c, d}. Examples: natural


numbers N. Integers Z. Rationals Q. Reals R. The set of all classrooms
in the building A11. The set of all districts in the state of Himachal. More
examples from the class.

Definition 2. Two sets A and B are said to be equal if they have the same
elements, i.e., A = B if ∀x, x ∈ A ⇔ x ∈ B.

Definition 3. The empty set is the set with no elements and is denoted
either by ∅ or by {}. A set with one element is called a singleton set.

Examples.

Definition 4. A Venn diagram is a graphical representation of sets. Here,


the universal set U , which contains all the elements under consideration, is
represented by a rectangle. Within this rectangle, other sets under consider-
ation are represeted using other geometrical shapes such as circles.

Examples: Naturals. Odd naturals. Even naturals. Naturals less than 10.
More examples from the class.

1
Definition 5. A set A is a subset of another set B if every element of A is
also an element of B, i.e, ∀x, x ∈ A ⇒ x ∈ B. Denoted by A ⊆ B.

Examples: The set of all odd natural numbers is a subset of the set of all
natural numbers. The set of female students enrolled in CS208 is a subset
of the set of all students enrolled in CS208. More examples from the class.
Representation using Venn diagrams.

Theorem 6. For every set A, ∅ ⊆ A and A ⊆ A.

Definition 7. A set A is said to be a proper subset of B if A ⊆ B and


A ̸= B. Denoted by A ⊂ B. In other words.

Examples.

2
Lecture 2
Definition 8. The complement of a set A is the set of all the elements in
the universal set U which are not in A. Denoted by A. In other words.
Illustrate using Venn diagrams. Examples.
Definition 9. An ordered n-tuple (a1 , a2 , . . . , an ) is the ordered collection
with ai as the ith element.
Two ordered n-tuples are equal if each corresponding pair of elements are
equal. Examples: A database table. More examples from class.
Definition 10. The Cartesian product of sets A1 , . . . , An is the set of or-
dered n-tuples (a1 , . . . , an ), where ai ∈ Ai , i.e., A1 ×. . .×An = {(a1 , . . . , an )|ai ∈
Ai }.
Examples: the Cartesian product of A = {0, 1}, B = {a, b}, C = {α, β}.
Rationals as a subset of Z × Z. Compare A × B with B × A. More examples
from class.
Definition 11. For nonempty sets A, B a function f from A to B is an
assignment of exactly one element of B to each element of A. We write
f : A → B and f (a) = b. A and B are called the domain and the codomain
of f . If f (a) = b then b is called the image of a and a is called the preimage
of b. The range of f is set of all images of all the elements of f , i.e., f (A).
Functions may be specified by other ways, for instance by formulas or rules.
2 1
√ f : R → R, f (x) = x . f : R → R : f (x) = x ? f : R → R :
Examples:
f (x) = x? f from the set of students to R, f (x) is the CGPA of x. More
examples from class.
Two functions are equal when they have the same domain, the same codomain
and map each element of their common domain to the same element in their
common codomain. Examples.
Definition 12. A function f is said to be injective or one-to-one if f (a) =
f (b) ⇒ a = b for all a, b in the domain of f . A function f is said to be
surjective or onto if each element in the codomain of f has a preimage
in the domain of f . In other words. A function is bijective if it is both,
injective and surjective.
Examples: Using graphical representation. f : R → R, f (x) = x2 . f : R →
R, f (x) = sin x. f : R → R, f (x) = x3 . f : R → R, f (x) = x + 1. More
examples of injective, surjective and bijective functions from class.

3
Lecture 3
Definition 13. Given a bijective function f : A → B, the inverse function
f −1 : B → A maps each element b ∈ B to the unique preimage a of b under
f , i.e., f −1 (b) = a such that f (a) = b.

Highlight why the conditions of being injective and surjective are necessary
and sufficient for a function to have an inverse. Examples: Graphical exam-
ples. f : Z → Z : f (x) = x + 1. f : R → R, f (x) = x4 ? More examples from
class.

Definition 14. Let f : A → B and g : B → C. The composition of g and


f , denoted by g ◦ f is defined as g ◦ f : A → C, g ◦ f (a) = g(f (a)).

Examples: Graphical examples. f, g : Z → Z, f (x) = x + 1, g(y) = 2y − 3.


f ◦ f −1 is identity. More examples from class.

Definition 15. Two sets A, B are said to have the same cardinality if there
exists a bijection between them. Denoted as |A| = |B|. If there exists an
injection from A to B then |A| ≤ |B|. If there exists a surjection from A to
B then |A| ≥ |B|.

Examples: Odd naturals and even naturals, odd naturals and naturals, nat-
urals and prime naturals, two closed intervals in real line, a closed interval
and the reals, an open interval and the reals. More examples from class.

4
Lecture 4
Definition 16. A set that is either finite or has the same cardinality as N
is said to be countable. A set that is not countable is called uncountable.

Lemma 17. A subset of a countable set is countable.

Proof: Let A be countable — enumerate A — B ⊆ A inherits enumeration


of A. Examples.
Examples of countable sets: the set of odd positive integers, the set of all
integers. Proof. More examples from the class.

Lemma 18. The Cartesian product of finitely many countable sets is count-
able.

Proof: First prove the statement for Cartesian product of two sets using the
zig-zag ordering — then prove for a fixed prefix of a tuple coming from a
general Cartesian product. Examples.

Lemma 19. Q is countable.

Proof: Use the above lemma to prove that all positive rationals are countable
— similarly all negative rationals are countable.

Lemma 20. Any finite union of countable sets is countable.

Proof: Let A1 , . . . , An be all countable sets — enumerate the elements of the


union as A11 , A21 , . . . , An1 , A12 , A22 , . . . , An2 , . . . Examples.

Lemma 21. Union of countably many countable sets is countable.

Proof: Let A, B, C, . . . be the countably many countable sets. Enumerate the


elements of the union as A1 , A2 , B1 , A3 , B2 , C1 , A4 , B3 , C2 , D1 , . . . Examples.

5
Lecture 5
Lemma 22. The set of all finite-length sequences of natural numbers is
countable.

Proof: This set is the union of the length-1 sequences, the length-2 sequences,
the length-3 sequences, . . . , the length-n sequences. Each of these is a count-
able set (finite Cartesian product), hence we have a countable union of count-
abley many sets.

Lemma 23. The set of all finite subsets of natural numbers is countable.

Proof: Each finite subset may be arranged as a sequence — now use the
previous lemma. Examples.

Lemma 24. The power-set of natural numbers is uncountable.

Proof: Suppose that P(N) is countable — enumerate it — if n ∈ N is mapped


to a subset S ⊆ N, call n selfish if n ∈ S and non-selfish otherwise — let B
be the set of all non-selfish natural numbers — suppose b ∈ N maps to B —
contradiction.

Lemma 25. The set of all infinite sequences of 0’s and 1’s is uncountable.

Proof: Cantor’s diagonal argument.

Lemma 26. The set of real numbers is uncountable.

Proof: Construct an injection from T : the set of infinite sequences of 0’s and
1’s into R — map t ∈ T to the decimal 0.t ∈ R.

6
Lecture 6
Definition 27. Given any two sets A, B, a binary relation from A to B
is a subset of A × B.

Examples: A: set of students in IIT Mandi, B: the set of hostels in IIT


Mandi, R is the relation consisting of pairs (a, b), a ∈ A, b ∈ B, where student
a resides in hostel b. Database tables. Explicit examples. More examples
from the class. Relations generalize the notion of functions.

Definition 28. A relation R on a set A is called reflexive if (a, a) ∈ R for


all a ∈ A.

Examples: the relation “is equal to” on the set of any kind of numbers,
“divides” on natural numbers, “is contained in” on set of all subsets of a set.
Explicit examples. More examples from class.

Definition 29. A relation R on a set A is called symmetric if (a, b) ∈ R ⇒


(b, a) ∈ R for all a, b ∈ A. A relation R on A such that for all a, b ∈ A
(a, b) ∈ R, (b, a) ∈ R ⇒ a = b is called antisymmetric. In other words.

Examples: “is sibling” on set of people. Explicit examples. More examples


from class.

Definition 30. A relation R on A is called transitive if (a, b) ∈ R, (b, c) ∈


R ⇒ (a, c) ∈ R, for all a, b, c ∈ A. In other words.

Examples: From previous defns, explicit examples. More examples from


class.

7
Lecture 7
Definition 31. A relation R on A is called an equivalence relation if it
is reflexive, symmetric and transitive.

Examples: (Z, R), aRb iff a = b or a = −b. (R, R), aRb iff a − b is an integer.
Congruence modulo m: m > 1, m ∈ Z, R = {(a, b)|a ≡ b( mod m)}. R on
set of strings of English letters such that aRb iff l(a) = l(b). More examples
from class.

Definition 32. Let R be an equivalence relation of a set A. The set of all


elements that are related to an element a ∈ A is called the equivalence
class of a. Denoted [a]R .

Theorem 33. An equivalence relation partitions the set, i.e. the following
are equivalent (i) aRb, (ii) [a] = [b], (iii) [a]∩[b] ̸= ∅. Conversely, a partition
of a set leads to an equivalence relation on that set.

Proof: Show that (i) =⇒ (ii), (ii) =⇒ (iii) and (iii) =⇒ (i). For
the converse, construct the relation by relating every element in a particular
subset C of the partition with every other element in C. Thus, each subset
of the partition acts as an equivalence class of the relation.

Definition 34. A relation R on as set S is called a partial order if it is


reflexive, antisymmetric and transitive. (S, R) is called a partially ordered
set or poset.

Examples: The set of integers Z with the relation ≤. The divisibility relation
on the set of positive integers. The inclusion relation ⊆ on the power set of
a set S. More examples from the class.

Definition 35. Given two equivalence relations (S, R1 ), (S, R2 ), R1 is said


to be finer than R2 if for all a, b ∈ S, aR1 b =⇒ aR2 b. Let E be the set
of all equivalence relations on a set S. Define the relation on E such that
R1 ∼ R2 if R1 is finer that R2 .

Lemma 36. The relation (E, ∼) is a poset.

Proof

8
Lecture 8
Definition 37. Elements a, b of a poset (S, ≼) are called comparable if
either a ≼ b, or b ≼ a. Else they are called incomparable.

Examples from previous definition. More examples from class.

Definition 38. If (S, ≼) is a poset and every two elements of S are compa-
rable, the S is called a totally ordered or a linearly ordered set and ≼
is called a total order or a linear order.

Examples: (Z, ≤) is totally ordered while (Z, |) is not. More examples from
class.

Definition 39. Given two posets (S, ≤) and (T, ≼), a function f : S → T
is called order-preserving or monotone if for all x, y ∈ S, x ≤ y =⇒
f (x) ≼ f (y).

Examples.

Lemma 40. Given posets (S, ≼1 ), (T, ≼2 ), (U, ≼3 ), if both f : S → T and


g : T → U are order-preserving then the composition g ◦ f : S → U is
order-preserving.

Proof.

Definition 41. Given two posets (S, ≼1 ) and (T, ≼2 ), a function f : S → T


is called order-reflecting if for all x, y ∈ S, f (x) ≼2 f (y) =⇒ x ≼1 y.

Lemma 42. Given posets (S, ≼1 ), (T, ≼2 ), if f : S → T is order-reflecting


then f is an injection.

Proof.

9
2 Computational geometry
Lecture 9
Definition 43. A subset S of Rn is convex if given any two points in S,
the entire line-segment connecting the two points is also contained in S.
Equivalently, a convex set is a subset of Rn whose intersection with every
line in Rn is a single (possibly empty) line-segment.

A point on the line-segment connecting two points p, q ∈ Rn may be


expressed as rp + (1 − r)q, r ∈ [0, 1]. Examples of convex and non-convex
sets.

Definition 44. Given k points pP 1 , . . . , pk in a convex set S, and


Pk k non-
k
negative reals r1 , . . . , rk such that i=1 ri = 1, the combination i=1 ri pi is
called a convex combination of the points p1 , . . . , pk .

Lemma 45. Given k points p1 , . . . , pk in a convex set S, every convex com-


bination of the points p1 , . . . , pk lies in S.

Proof: Use induction on the number of points,


Pk+1 k. The Pbasis step is easy to
show. For the induction step, express x = i=1 ri pi as ki=1 ri pi + rk+1 pk+1 .
Since rk+1 = 1 − ki=1 ri , we have,
P

k
! k ! k
!
X X ri X
x= rj Pk pi + 1 − ri pk+1
j=1 i=1 j=1 rj i=1

Thus, x is expressed as a convex combination of two points in S. □

Definition 46. A convex hull of a given set of points S ⊆ Rn , denoted


Conv(S) is defined as:

1. The (unique) minimal convex set containing S

2. The intersection of all convex sets containing S

3. The set of all convex combinations of the points in S

Proof for equivalence of above three definitions. Examples.

10
Lecture 10
d
Lemma 47. If S = {q1 , . . . , qN } ∈ R P then ∀x ∈ Conv(S), there exist
w1 , . . . , wN , all non-negative, s.t. x = n wn qn , and at most d of them are
nonzero.

Proof: Trivial for N ≤ d. We shall prove it for N = d + 1 and the case of


N > d + 1 is left as an exercise. The case of N = d + 1 is proved using
induction on d. The basis step of d = 1, N = 2 is straightforward. Now
for the induction step. If x ∈ Conv(S), then express x as d+1
P
n=1 n n . If
w q
some wn = 0, then the proof is over, so assume that all wn > 0. If the set
{q1 , . . . , qd } is l.d., its span is a space of dimension less than d and we may
useP induction hypothesis on its span to eliminate at least one non zero term
d wn
Pd+1
in n=1 w1 +...+wn qn , and thus eliminate the same term in x = n=1 wn qn as
well and the proof is over.
If the set {q1 , . . . , qd } is not l.d., then we may express qd+1 as dn=1 un qn
P
for some (u1 , . . . , un ) ∈ Rd . Then, we may express qd+1 as

qd+1 = (1 − θ)qd+1 + θqd+1


d
X
= (1 − θ)qd+1 + θ u n qn
n=1

for any θ ∈ [0, 1] and further express x as

d
X d
X
x= wn qn + wd+1 (1 − θ)qd+1 + wd+1 θ u n qn
n=1 n=1
Xd
= (wn + θwd+1 un )qn + (1 − θ)wd+1 qd+1
n=1

If wn + wd+1 un > 0 for all n = 1, . . . , d then set θ = 1, otherwise let θ


be the smallest θ such that one of wn + θwd+1 un = 0. In that case, all the
remaining wn + θwd+1 un will be non-negative. □

Theorem 48. Let S = {q1 , . . . , qN } ⊂ Rd . If x ∈ Conv(S), then x is the


convex combination of at most d + 1 points of S.

11
Proof: Identify Rd with the subset {p ∈ Rd+1 |pd+1 = 1}, i.e., with the d + 1th
coordinate equal to 1. This induces an embedding ofPS into S × {1} ⊂ Rd+1 .
Any x ∈ Conv(S) may be represented as (x, 1) = N n=1P wn (qn , 1) where at
most d + 1 of wn are non-zero by Lemma 47. Thus, x = N n=1 wn qn with at
PN
most d + 1 of wn non-zero and n=1 wn = 1. □

12
3 Graph theory
Lecture 11
Definition 49. A graph G = (V, E) consists of a non-empty set of vertices
V , and a set of edges E. Each edge has a vertex associated with each of
its endpoints. Directed graph. A graph in which each edge connects two
different vertices and no two edges connect the same pair of vertices is called
a simple graph.

Examples: Explicit examples. Computer networks. Social networks. Trans-


portation networks. More examples from class.

Theorem 50. Let G = (V, E) be an undirected graph with |E| = m. Then


P
v∈V deg(v) = 2m.

Proof. Examples: From previous definition.

Theorem 51. An undirected graph has an even number of vertices of odd


degree.

Proof. Examples: From previous definition.

Definition 52. A graph may be represented using an adjacency list wherein,


for each vertex v, a list of vertex adjacent to v is maintained. A graph may
also be represented using an adjacency matrix wherein, a matrix of size
|V | × |V | is maintained. An entry (i, j) is 1 if there exists an edge (vi , vj ) in
the graph, otherwise 0.

Examples from previous definition. Complete graphs. Cycles. Bipartite


graphs. How to determine if a graph is bipartite: it should be two-colorable.
Trade-offs between adj. lists and adj. matrices: For sparse graphs, lists
are preferred. Also compare with respect to add/delete vertex/edge and
traversing.

13
Lecture 12
Definition 53. Two simple graphs G1 = (V1 , E1 ) and G2 = (V2 , E2 ) are
isomorphic if there exists a bijection f : V1 → V2 such that a, b are adjacent
in G1 iff f (a), f (b) are adjacent in G2 .

Examples: Explicit examples. Applications in fields such as chemistry when


discovering new compounds, a molecule represented by a graph, with vertices
and edges for atoms and bonds; in field of electronic circuits it is used for
verification of a given layout against the original schematic. More examples
from class.

Definition 54. A path of length n ≥ 0 from u to v in an undirected graph


G is a sequence of n edges e1 , . . . , en of G for which there exist a sequence
x0 = u, x1 , . . . , xn = v of vertices such that ei has endpoints xi−1 , xi . The
path is a circuit if u = v.

Explicit examples. Paths in social networks, computer networks, transport


networks. Similarly in directed graphs.

Definition 55. An undirected graph G is called connected if there is a


path between every pair of distinct vertices of G. Otherwise disconnected.

Explicit examples.

Definition 56. A subset V ′ of the vertex set V of G is a vertex cut if


G − V ′ is disconnected. The vertex connectivity of a noncomplete graph
G, denoted by κ(G), is the minimum number of vertices in a vertex cut of
G.

Explicit examples.

14
Lecture 13
Definition 57. A subset E ′ of edges of E of G is a edge cut if the graph
G − E ′ is disconnected. The edge connectivity of a graph G, denoted by
λ(G), is the minimum number of edges in an edge cut of G.

Explicit examples.

Theorem 58. κ(G) ≤ λ(G) ≤ minv∈V deg(v).

Explicit examples.

Definition 59. A coloring of a simple graph is the assignment of a color


to each vertex of the graph so that no two adjacent vertices are assigned the
same color. The chromatic number of a graph G is the least number of
colors needed for a coloring of G. Denoted by χ(G).

Explicit examples. Applications in scheduling, e.g., for exams so that no


student has two exams at the same time, vertices representing courses and
an edge between two vertices if there is a common student in the two courses,
each time-slot is represented by a different color. Frequency assignment,
television channels 2 to 10 are assigned stations so that no two stations
within 100 kms can operate on the same channel, each vertex is a station
and two vertices are connected by an edge if they are located within 100 kms,
a color represents a channel.

15
Lecture 14
Definition 60. A graph homomorphism from a graph G1 (V1 , E1 ) to a
graph G2 (V2 , E2 ), denoted G1 → G2 , is a map f : V1 → V2 such that for all
a, b ∈ V1 , (a, b) ∈ E1 =⇒ (f (a), f (b)) ∈ E2 . In this case, G1 is said to be
homomorphic to G2 .
In other words, a graph homomorphism is a mapping which preserves the
graph structure. A graph homomorphism is a generalization of the concept
of a graph homomorphism. A graph homomorphism can be used to pull-back
the coloring of G2 to G1 as follows: for each vertex v ∈ V2 assign the color of
v to the pre-image of v through f in G1 . This is called G2 -coloring of G1 .
Examples.
Lemma 61. Given graphs G1 (v1 , E1 ), G2 (V2 , E2 ), a graph homomorphism
f : V1 → V2 and a coloring K of G2 , the pull-back of K from G2 to G1 is a
coloring of G1 .
Proof. Examples.
The composition of two graph homomorphisms G1 → G2 , G2 → G3 is
a graph homomorphism G1 → G3 . In other words, the relation of graph
homomorphism defined on the set of graphs is transitive. It is also trivially
reflexive.
Definition 62. Given a graph G(V, E), a subgraph of G is another graph
H(V ′ , E ′ ) such that V ′ ⊆ V and E ′ ⊆ E. We require that whenever an edge
(a, b) is present in E ′ then its incident vertices a, b be present in V ′ .
Examples.
Lemma 63. There exists an injective graph homomorphism from G1 to G2
iff G1 is isomorphic to a subgraph of G2 .
Proof. Examples.
Lemma 64. A k-coloring of G corresponds to a graph homomorphism from
G to the complete graph Kk .
Proof. Examples.
Lemma 65. If there exists a graph homomorphism from G to H then χ(G) ≤
χ(H).
Proof. Examples.

16
Lecture 15
Definition 66. A tree is a connected undirected graph with no simple cir-
cuits. A rooted tree is a tree in which one vertex has been designated as
the root. A leaf of a tree is a vertex with degree 1. Vertices which are not
leaves are called internal vertices.
Explicit examples.
Theorem 67. An undirected graph is a tree iff there is a unique simple path
between any two of its vertices.
Definition 68. Let T be a rooted tree. If v is a vertex of T other than the
root, then the parent of v in T is the unique vertex u adjacent to v on the
path between v and the root. Here, v is called the child of u. Vertices with
the same parent are called siblings. The ancestors of v are all the vertices
in the path from the root to v. The descendants of v are all the vertices
that have v as an ancestor.
Explicit examples.
Definition 69. A rooted tree is called an m-ary tree if every internal node
has no more than m children. An m-ary tree with m = 2 is called a binary
tree. An ordered rooted tree is one in which the children of each vertex are
ordered.
Explicit examples. Applications in modeling hierarchical structures, e.g.,
family tree, organizations, computer file systems.
Theorem 70. A tree with n vertices has n − 1 edges.
Theorem 71. A full m-ary tree with i internal vertices contains mi + 1
vertices.
Applications of trees: Binary search trees, explicit examples. Decision trees,
explicit examples.
Definition 72. Let T be an ordered rooted tree with root r and suppose
T1 , . . . , Tn are the subtrees at r in that order. The preorder traversal of T
begins by visiting r and thereafter traversing T1 , . . . , Tn all in preorder. The
inorder traversal of T begins by traversing T1 in inorder, then visiting r and
continues by traversing T2 , . . . Tn all in inorder. The postorder traversal of
T begins by traversing T1 , . . . , Tn all in postorder and finally visiting r.
Explicit examples. Application in infix, prefix and postfix notation.

17
4 Logic
Lecture 16
The rules of logic help impart meaning to mathematical statements. Logic
also forms the basis for mathematical reasoning, or proofs.

Definition 73. A proposition is a declarative statement (it declares a fact)


that is either true or false, but not both. We will use letters to represent
propositions which are called propositional variables.

Examples: Shimla is the capital of Himachal. 1 + 1 = 2. 1 + 1 = 4. God is


great. How are you? More examples from class.

Definition 74. Let p be a proposition. The negation of p, denoted by ¬p


or p, is the statement “it is not the case that p”.

Examples from previous defn. Truth table.

Definition 75. Let p and q be propositions. The conjunction of p and q,


denoted by p ∧ q, is the proposition “p and q”. The disjunction of p and q,
denoted by p ∨ q, is the proposition “p or q”. The exclusive or of p and q,
denoted by p ⊕ q, is the proposition that is true when exactly one of p and
q is true and false otherwise.

Examples in English. Truth table.

Definition 76. Let p and q be propositions. The conditional statement


p ⇒ q is the proposition “if p, then q”. The statement p ⇒ q is false when
p is true and q is false, and true otherwise. The proposition q ⇒ p is called
the converse of p ⇒ q. The contrapositive of p ⇒ q is the proposition
¬q ⇒ ¬p. The inverse of p ⇒ q is ¬p ⇒ ¬q. Two compound propositions
are said to be equivalent if they always have the same truth value.

Truth table. Examples in English.

18
Lecture 17
Definition 77. An inference is a list of propositions, the last of which
follows from - or is implied by - the rest.

Examples:

((p ⇒ q) ∧ p) ⊢ q
((p ⇒ q) ∧ ¬q) ⊢ ¬p
((p ⇒ q) ∧ (q ⇒ r) ⊢ (p ⇒ r)
((p ∨ q) ∧ ¬p) ⊢ q
p ⊢ (p ∨ q)
(p ∧ q) ⊢ p
¬(p ∧ q) ⊢ (¬p ∨ ¬q)
¬(p ∨ q) ⊢ (¬p ∧ ¬q)

19
Lecture 18
Definition 78. Propositions with variables leads to predicate logic. A
statement P (x) has two parts: the variables and the predicate.

Examples: P (x) :: x = 1, P (0) = false, P (1) = true. Q(x, y) :: x = y + 1.


R(x, y, z) :: x = y + z. More examples from class.

Definition 79. The universal quantification of P (x) is the statement


“P (x) for all values of x in the domain”. Denoted ∀xP (x). The existential
quantification of P (x) is the statement “There exists an x in the domain
such that P (x)”. Denoted ∃xP (x). The quantifiers ∀ and ∃ have higher
precedence than all the logical operators from propositional logic.

Examples: ∀xP (x), P (x) :: x + 1 > x, x ∈ Z, true. ∀xP (x), P (x) :: x2 >
x, x ∈ R, false. ∃xP (x), P (x) :: x2 = 2, x ∈ Z, false. More examples from
class.

Definition 80. Statements involving predicates and quantifiers are logically


equivalent if they have the same truth value irrespective of which predicates
are substituted into these statements and which domain of discourse is used
for the variables. We write S ≡ T to indicate that statements S and T are
equivalent.

Examples.

Definition 81. De Morgan’s Laws for quantifiers:


¬∃xP (x) ≡ ∀x¬P (x).
¬∀xP (x) ≡ ∃x¬P (x).

20
5 Counting arguments
Combinatorics is the study of arrangement of objects and among other con-
cepts, involves enumeration, i.e., counting of objects with certain properties.

Lecture 19
Theorem 82. Product rule: Suppose that a procedure can be divided into
a sequence of two tasks. If there are n1 ways to do the first task and for each
of these ways, there are n2 ways to do the second task, then there are n1 n2
ways to do the procedure.

Examples: A student may score from 0-9 in two subjects. Total number
of possible scores are 10 * 10 = 100. A four lettered word using English
alphabet may be formed in total 264 ways. A seat number in a movie theater
comprises of an English alphabet followed by a number from 0-19, giving a
total of 26*20 different seat numbers. The total number of functions from a
set with m elements to a set with n elements is nm . The number of injections
is n ∗ (n − 1) ∗ (n − 2) ∗ · · · ∗ (n − m + 1). The number of subsets of a set
with n elements is 2n . More examples from class.
Can be stated in terms of sets: |A1 × · · · × An | = |A1 | · · · · · |An |.

Theorem 83. Sum rule: If a task can be done either in one of n1 ways or
in one of n2 ways, where none of the set of n1 ways is same as any of the
set of n2 ways, then there are n1 + n2 ways to do the task.

Examples: In a class has 23 boys and 32 girls, there are 23+32 ways of
choosing a representative. A student may choose an MTP project either
from CS topics, 10 in all, or EE topics, 15 in all, so total 10+15 topics to
choose from. A password may be of length 3 to 5 and each character may
be an upper case letter or a digit, so in all 363 + 364 + 365 . More examples
from class.
Can be stated in terms of sets: |A1 ∪ · · · ∪ An | = |A1 | + · · · + |An | where
Ai ∩ Aj = ∅ for all i, j.

21
Theorem 84. Principle of inclusion-exclusion: If a task can be done in
either n1 ways or n2 ways, then the number of ways to do the task is n1 + n2
minus the number of ways to do the task that are common to the two different
ways.

Examples: The number of bit-strings of length seven which either start with
0 or end with 10 is 26 + 25 − 24 . In a class of 100 students, 70 have attended
CS101, 70 have attended CS201 and 50 have attended both, then the number
who have attended neither is 100 − (70 + 70 − 50). More examples from class.
Can be stated in terms of sets: |A1 ∪ A2 | = |A1 | + |A2 | − |A1 ∩ A2 |.

Theorem 85. The pigeonhole principle: If k is a positive integer and


k + 1 or more objects are placed into k containers, then there is at least one
container having two or more of the objects.

Examples: A function from a set with k + 1 elements to a set with k elements


cannot be injective. In a group with 367 students, there must be at least two
with the same birthday. In a set of 27 English words, there must be at least
two that begin with the same letter. For every n ∈ Z+ , there is a multiple
of n that has only 0’s and 1’s in its decimal expansion (look at the n + 1
numbers 1, 11, . . . , 111 . . . 1). More examples from class.

22
Lecture 20
Theorem 86. The generalized pigeonhole principle: If N objects are
placed into k containers, then there is at least one container with at least
⌈N/k⌉ objects.

Examples: Among any set of 21 single-digit decimal numbers, at least three


must be identical. Among a group of 100 people, there are at least ⌈100/12⌉
who were born in the same month. The number of students required in a
class to ensure that at least 6 will receive the same grades from (A, B, C, D,
E) is N such that ⌈N/5⌉ = 6, i.e., 26. More examples from class.

23
6 Abstract algebra
Lecture 21
Motivation: Many problems in diverse areas such as geometry, physics, num-
ber theory, algebraic equations used similar techniques for finding solutions.
The common and interesting ideas were abstracted and put together.

Definition 87. A group is an ordered pair (G, ∗) where ∗ is a binary oper-


ation on G satisfying the following axioms:

1. (a ∗ b) ∗ c = a ∗ (b ∗ c), ∀a, b, c ∈ G

2. ∃e ∈ G such that ∀a ∈ G, a ∗ e = e ∗ a = a

3. ∀a ∈ G, ∃a−1 ∈ G such that a ∗ a−1 = a−1 ∗ a = e

The group (G, ∗) is called abelian (or commutative) if ∀a, b ∈ G, a ∗ b =


b ∗ a.

Examples: Z, Q, R, C under +; Q − {0}, Q+ , R+ under ×, a vector space


(V, +) is abelian, for n ∈ Z+ , Z\nZ is abelian under +, if (A, ∗), (B, ◦) are
groups then A × B with (a1 , b1 )(a2 , b2 ) = (a1 ∗ a2 , b1 ◦ b2 )

Proposition 88. If G is a group under ∗ then

1. the identity of G is unique

2. ∀a ∈ G, a−1 is uniquely determined

3. ∀a ∈ G, (a−1 )−1 = a

4. (a ∗ b)−1 = (b−1 ) ∗ (a−1 )

Example: Dihedral group D2n

24
Lecture 22
Proposition 89. Let G be a group and let a, b ∈ G. The equations ax = b
and ya = b have unique solutions for x, y ∈ G. In particular, the left and
right cancellation laws hold in G, i.e.,

ˆ if au = av then u = v

ˆ if ub = vb then u = v

A consequence of above if that if a ∈ G and for some b ∈ G, ab = e or


ba = e then b = a−1 . Also if for some b ∈ G, ab = a or ba = a then b must
be e.

Definition 90. For x ∈ G, the order of x is the smallest positive integer n


such that xn = 1, denoted by |x|. If no positive power of x is e, the order is
defined to be infinity.

Examples: a ∈ G has order 1 iff a = e, in groups Z, Q, R, C, every non-


identity element has infinite order, in multiplicative groups R−{0} or Q−{0}
the element −1 has order 2 and all other non-identity elements has infinity
order, in the additive group Z\9Z the element 6̄ has order 3.

25
Lecture 23
Definition 91. Let A be any nonempty set. The set SA of all bijections
from A to itself forms a group under function composition and is called the
symmetric group on the set A.

Examples: For A = {1, 2, . . . , n}, SA is denoted by Sn . Order of Sn is n!,


symmetries of regular polygons, polyhedrons.

Definition 92. A cycle is a string of integers which represents the element


of Sn which cyclically permutes these integers, while fixing the rest. For each
σ ∈ Sn the numbers from 1 to n can be grouped into k cycles which gives
the cycle decomposition of σ.

Examples. Algorithm for computing cycle decomposition. Composing two


elements of Sn .

Definition 93. A field is a set F together with two binary operations + and
. on F such that (F, +) is an abelian group (with identity 0) and (F − {0}, .)
is also an abelian group and a.(b + c) = (a.b) + (a.c) ∀a, b, c ∈ F .

Examples, Q, R, C.

Definition 94. For each n ∈ Z+ , let GLn (F ) be the set of all n × n matrices
whose entries come from F and whose determinant is non-zero. GLn (F )
forms a group under matrix multiplication.

26
Lecture 24
Definition 95. Let (G, ∗) and (H, ·) be groups. A map ϕ : G → H such
that ϕ(x ∗ y) = ϕ(x) · ϕ(y) for all x, y ∈ G is called a homomorphism.

A map between groups is a homomorphism is it respects the group structures


of it domain and its codomain.

Definition 96. A map ϕ : G → H is called an isomorphism and G and


H are called isomorphic, denoted G ∼
= H, if ϕ is a homomorphism and a
bijection.

Examples: for any group G, G ∼ = G, the map f (x) = ex from (R, +) to


(R , ×), for any two sets A, B with same cardinality, SA ∼
+
= SB .

Lemma 97. If two groups G, H are isomorphic, then

1. |G| = |H|

2. G is abelian iff H is abelian

3. for all x ∈ G, |x| = |ϕ(x)|

27
Lecture 25
Definition 98. Let G be a group. A subset H of G is a subgroup of G if
H is nonempty and is closed under products and inverses. Denoted H ⩽ G.

Subgroups of G are simply subsets of G which are groups themselves with


respect to the operation defined in G. Hence, the operation on H is the
operation on G restricted to H, the identity of G is the identity of H. The
inverse of an element x ∈ H is the same as the inverse of x when considered
as an element of G.
Examples: Z ⊆ Q and Q ⊆ R with the operation of addition. Every group
G has two trivial subgroups, viz. G and {e}. The set of even integers is a
subgroup of the set of all integer under addition.

Proposition 99. A subset H of G is a subgroup iff H ̸= ∅ and for all


x, y ∈ H, xy −1 ∈ H.

28
Lecture 26
Definition 100. A group H is cyclic if H can be generated by a single
element, i.e., there is some x ∈ H such that H = {xn |n ∈ Z} (multiplicative
notation) or H = {nx|n ∈ Z} (additive notation). Denoted H = ⟨x⟩.

A cyclic group may have more than one generator. For example, if H = ⟨x⟩
then also H = ⟨x−1 ⟩. Examples: For H = Z, H = ⟨1⟩, and also H = ⟨−1⟩.

Proposition 101. If H = ⟨x⟩, then |H| = |x|. More specifically,

1. if |H| = n < ∞, then xn = 1 and 1, x, x2 , . . . , xn−1 are all distinct

2. if |H| = ∞, then xn ̸= 1 for all n ̸= 0 and xa ̸= xb for all a ̸= b in Z.

Proof: Let |x| = n. Consider first the case where n < ∞. The elements
1, x, x2 , . . . , xn−1 are all distinct because if xa = xb , with say 0 ≤ a < b < n
then xb−a = x0 = 1, a contradiction. Thus H has at least n elements. Now
to show that these are all the elements of H. For any power of x, xt , write
t = nq + k, 0 ≤ k < n. So, xt = xk ∈ {1, x, . . . , xn−1 }.
Now suppose |x| = ∞. If xa = xb then xb−1 = 1, a contradiction. Hence
|H| = ∞.

Proposition 102. Let G be a group, x ∈ G and let m, n ∈ Z. If xn = 1 and


xm = 1, then xd = 1, where d is the greatest common divisor of m, n. Also,
if xm = 1 for some m ∈ Z then |x| divides m.

Proof: By Bezout’s identity, there exist integers r, s, s.t. d = mr + ns, where


d = gcd(m, n). Thus xd = 1.
Now let xm = 1 and |x| = n. Case of m = 0 trivial, so suppose m ̸= 0.
Clearly n < ∞. Let d = gcd(m, n). By previous result, xd = 1. Since
0 < d ≤ n and n is the smallest positive power of x which gives 1, it must
be that d = n, i.e., n|m.

Theorem 103. Two cyclic groups of the same order are isomorphic.

Proof: Suppose ⟨x⟩ and ⟨y⟩ are both cyclic with order n < ∞. Let ϕ :
⟨x⟩ → ⟨y⟩ be defined as ϕ(xk ) = y k . First show that ϕ is well defined, i.e., if
xr = xs , then ϕ(xr ) = ϕ(xs ). This is indeed the case as: since xr−s = 1, by
above proposition, n|r − s. Write r = tn + s, so ϕ(xr ) = ϕ(xtn+s ) = y rn+s =
(y n )t y s = y s = ϕ(xs ).

29
It is easy to see that ϕ is a homomorphism and is surjective. Since
order of ⟨x⟩ and ⟨y⟩ are of the same order, it is also an injection. Thus, an
isomorphism.
Now consider the case where ⟨x⟩ is an infinite cyclic group. Let ϕ : Z →
⟨x⟩ be defined by ϕ(k) = xk . Well defined and an isomorphism.

30
Lecture 27
Definition 104. If ϕ : G → H is a group homomorphism, the kernel of ϕ
is the set {g ∈ G|ϕ(g) = 1}. Denoted by ker ϕ.

Proposition 105. Let ϕ : G → H be a group homomorphism.

1. ϕ(1G ) = 1H , i.e., identity of G is mapped to the identity of H

2. ϕ(g −1 ) = ϕ(g)−1 for all g ∈ G

3. ϕ(g n ) = ϕ(g)n for all g ∈ G

4. ker ϕ is a subgroup of G

5. im ϕ, the image of G under ϕ is a subgroup of H.

Definition 106. Let ϕ : G → H be a group homomorphism with kernel K.


The quotient group, denoted G/K, is the group whose elements are the
fibers of ϕ with group operation defined as follows: if X is the fiber above a
and Y is the fiber above b then the product of X with Y is defined to be the
fiber above the product ab.

Example: Let G = Z and H = Zn = ⟨x⟩, define ϕ : Z → Zn by ϕ(a) = xa ,


then ϕ(a + b) = ϕ(a)ϕ(b). ϕ−1 (xa ) = {m ∈ Z|xm = xa } = {m ∈ Z|m ≡
a(mod n)} = ā. Multiplication in Zn is xa xb = xa+b . Corresponding fibres
are ā, b̄, a + b.

Proposition 107. Let ϕ : G → H be a homomorphism with kernel K. Let


X ∈ G/K be the fiber above a, i.e., X = ϕ−1 (a). Then

1. For any u ∈ X, X = {uk|k ∈ K}

2. For any u ∈ X, X = {ku|k ∈ K}

31
Lecture 28
Definition 108. For any N ⩽ G and any g ∈ G, the left and right cosets
of N in G are gN = {gn|n ∈ N } and N g = {ng|n ∈ N }. Alternate notations:
g + N and N + g. Any element of a coset is a representative for the coset.
Fibres of homomorphism are the left cosets of the kernel and also right cosets
of the kernel. Example.
Theorem 109. Let G be a group and K be the kernel of some homomorphism
from G to another group. Then the set whose elements are the left cosets of
K in G with operation defined by uK ∗ vK = (uv)K forms a group, G/K.
Proof: Let X, Y ∈ G/K and let Z = XY in G/K. Hence, X, Y, Z are
left-cosets of K where K is the kernel of some homomorphism ϕ : G → H.
So X = ϕ−1 (a), Y = ϕ−1 (b) and Z = ϕ−1 (ab) for some a, b ∈ H. Let
u ∈ X, v ∈ Y so that X = uK, Y = vK. To show that Z = uvK, we first
show that uv ∈ Z. uv ∈ Z ⇔ uv ∈ ϕ−1 (ab) ⇔ ϕ(uv) = ab ⇔ ϕ(u)ϕ(v) = ab.
Now to show that any element z ∈ Z can be written as uv for some
u ∈ X, v ∈ Y . Fix some u ∈ X and let z be some element in Z. To show
that there exists some v ∈ Y such that uv = z. ϕ(u−1 z) = ϕ(u−1 )ϕ(z) =
ϕ(u)−1 ϕ(z) = a−1 ab = b. Hence u−1 z ∈ Y . □
Examples: ϕ : Z → Zn is homomorphism with fibres the left (and also the
right) cosets a + nZ of the kernel nZ. These cosets form a group under
addition of representatives, viz., Z/nZ. Z/nZ ∼
= Zn . ϕ : R2 → R, ϕ(x, y) = x
is a homomorphism. Kernel is the y-axis. Left (and also right) cosets are
(a, 0) + y-axis.
Proposition 110. Let N ⩽ G. The set of left cosets of N in G form a
partition of G. Further, ∀u, v ∈ G, uN = vN iff v −1 u ∈ N and in particular
uN = vN iff u and v are the representatives of the same coset.
Proof:
S Since N ≤ G, 1 ∈ N . Thus g = g.1 ∈ gN for all g ∈ G, hence
G = g∈G gN . To show that distinct cosets have empty intersection, suppose
uN ∩vN ̸= ∅. To show that uN = vN . Let x ∈ uN ∩vN . Write x = un = vm
for some n, m ∈ N . Hence u = vmn−1 = vm1 , where m1 = mn−1 ∈ N . Now
for any element ut ∈ uN (t ∈ N ), ut = vm1 t ∈ vN . This proves that
uN ⊆ vN . We may show that vN ⊆ uN by interchanging the roles of u, v.
Hence, uN = vN iff u ∈ vN iff u = vn for some n ∈ N iff v −1 u ∈ N .
Finally, v ∈ uN is equivalent to saying that v is a representative for uN ,
hence uN = vN iff u and v represent the same coset. □

32
Lecture 29
Proposition 111. Let N ≤ G.

1. The operation on the set of left cosets of N in G given by uN ∗ vN =


(uv)N is well-defined iff gng −1 ∈ N, ∀g ∈ G, n ∈ N .

2. If the above operation is well-defined, then it makes the left cosets of N


in G into a group. The identity of this group is 1N and the inverse of
gN is the coset g −1 N .

Proof: To prove 1. First assume that the operation is well-defined, i.e. for
all u, v ∈ G, if u, u1 ∈ uN, v, v1 ∈ vN then uvN = u1 v1 N . Let g ∈ G and
n ∈ N . Let u = 1, u1 = n, v = v1 = g −1 , then substituting these in the above
equation we get g −1 N = ng −1 N . Thus ng −1 ∈ g −1 N , i.e., ng −1 = g −1 n1
for some n1 ∈ N . Thus, gng −1 ∈ N . Now to show the converse. Assume
gng −1 ∈ N for all g ∈ G, n ∈ N . Let u, u1 ∈ uN and v, v1 ∈ vN . Thus
we may write u1 = un and v1 = vm for some n, m ∈ N . To show that
u1 v1 ∈ uvN : u1 v1 = (un)(vm) = u(vv −1 )nvm = (uv)(v −1 nv)m = (uv)(n1 m)
where n = v −1 nv ∈ N .
Proof of 2 is straightforward. □

Definition 112. The element gng −1 is called the conjugate of n ∈ N by


g. The set gN g −1 = {gng −1 |n ∈ N } is called the conjugate of N by g. A
subgroup N of G is said to be normal if gN g −1 = N for all g ∈ G, denoted
N ⊴ G.

Definition 113. Let gAg −1 = {gag −1 |a ∈ A}. The normalizer of A in G


is the set {g ∈ G|gAg −1 = A}, denoted NG (A).

Example: Let G = D8 and let A = {1, r, r2 , r3 }. ND8 (A) = D8 .

33
Lecture 30
Theorem 114. Let N be a subgroup of G. The following are equivalent.

1. N ⊴ G

2. NG (N ) = G

3. gN = N g for all g ∈ G

4. the operation on left cosets of N in G described in Proposition 111


makes the left cosets into a group

5. gN g −1 ⊆ N for all g ∈ G

34

You might also like