Set theory, relations, functions and lattices notes — Unit 1
Free unit-wise study notes on set theory, relations, functions and lattices for Discrete Structures and Theory of Logic, Semester 3 of B.Tech — Computer Science & Engineering — key concepts, examples, important questions and a revision checklist for semester exams.
An exhaustive exploration of Set Theory, Relations, Functions, Partially Ordered Sets (POSETs), and Lattices. Forms the mathematical foundation for databases and algorithm analysis.
Notebook — 14 pages
Page 1
Wink Notes
B.Tech CSE — 3rd Semester
Discrete Structures and Theory of Logic
— Unit - 1 —
1. Introduction to Set Theory
A Set is a well-defined collection of distinct objects, considered as an object in its own right. The objects in a set are called its elements or members.
⇒1.1 Representation of Sets
Roster (Tabular) Form: Listing all elements inside braces. e.g., A={1,2,3,4}
Set-Builder Form: Stating the properties that its members must satisfy. e.g., A={x∣x is an even integer and 0<x<10}
⇒1.2 Types of Sets
Null/Empty Set: A set with no elements. Denoted by ∅ or {}.
Singleton Set: A set with exactly one element.
Finite and Infinite Sets: Sets with a countable vs uncountable number of elements.
Universal Set: The set containing all objects or elements and of which all other sets are subsets. Denoted by U or S.
Power Set: The set of all subsets of a set A, denoted by P(A). If ∣A∣=n, then ∣P(A)∣=2n.
Page 2
Wink Notes
B.Tech CSE — 3rd Semester
Discrete Structures and Theory of Logic
— Unit - 1 —
2. Set Operations
Fundamental operations can be performed on sets to construct new sets.
⇒2.1 Basic Operations
Union (A∪B): The set of all elements that are in A, or in B, or in both.
Intersection (A∩B): The set of all elements that are in both A and B.
Difference (A−B): The set of all elements that are in A but not in B. Note that A−B=B−A.
Symmetric Difference (A⊕B or A△B): The set of elements that are in A or B, but not in both. (A−B)∪(B−A).
Complement (A′ or Ac): The set of all elements in the universal set U that are not in A.
⇒2.2 Laws of Set Algebra
Sets obey specific algebraic laws, which are heavily used in proofs:
Idempotent Laws:A∪A=A and A∩A=A
Commutative Laws:A∪B=B∪A and A∩B=B∩A
Associative Laws:(A∪B)∪C=A∪(B∪C)
Distributive Laws:A∪(B∩C)=(A∪B)∩(A∪C)
De Morgan's Laws:(A∪B)′=A′∩B′ and (A∩B)′=A′∪B′
Page 3
Wink Notes
B.Tech CSE — 3rd Semester
Discrete Structures and Theory of Logic
— Unit - 1 —
3. Cartesian Product and Relations
The Cartesian Product of two sets A and B, denoted by A×B, is the set of all ordered pairs (a,b) where a∈A and b∈B.
A×B={(a,b)∣a∈A and b∈B}
⇒3.1 Definition of a Relation
A RelationR from set A to set B is a subset of the Cartesian product A×B. If (a,b)∈R, we say that a is related to b under R, denoted as aRb.
⇒3.2 Domain and Range
Domain: The set of all first elements of the ordered pairs in a relation R.
Range: The set of all second elements of the ordered pairs in a relation R.
Inverse Relation (R−1): If R is a relation from A to B, then R−1 is a relation from B to A defined by R−1={(b,a)∣(a,b)∈R}.
Page 4
Wink Notes
B.Tech CSE — 3rd Semester
Discrete Structures and Theory of Logic
— Unit - 1 —
4. Properties of Relations
A relation R defined on a single set A (i.e., R⊆A×A) can have the following properties:
Reflexive: Every element is related to itself. For all a∈A, (a,a)∈R.
Irreflexive: No element is related to itself. For all a∈A, (a,a)∈/R.
Symmetric: If a is related to b, then b is related to a. If (a,b)∈R, then (b,a)∈R.
Asymmetric: If (a,b)∈R, then (b,a)∈/R.
Antisymmetric: If (a,b)∈R and (b,a)∈R, then it must be that a=b.
Transitive: If (a,b)∈R and (b,c)∈R, then (a,c)∈R.
⇒4.1 Equivalence Relation
A relation R on a set A is an Equivalence Relation if it is strictly:
1. Reflexive
2. Symmetric
3. Transitive
Example: The relation "is equal to" (=) on the set of real numbers.
Page 5
Wink Notes
B.Tech CSE — 3rd Semester
Discrete Structures and Theory of Logic
— Unit - 1 —
5. Equivalence Classes and Partitions
⇒5.1 Equivalence Classes
Let R be an equivalence relation on a set A. The equivalence class of an element a∈A, denoted by [a], is the set of all elements in A that are related to a by R.
[a]={x∈A∣(x,a)∈R}
⇒5.2 Partitions of a Set
A Partition of a set A is a collection of mutually disjoint, non-empty subsets of A whose union is exactly A.
Fundamental Theorem of Equivalence Relations: An equivalence relation on a set partitions the set into disjoint equivalence classes. Conversely, any partition of a set induces an equivalence relation.
Page 6
Wink Notes
B.Tech CSE — 3rd Semester
Discrete Structures and Theory of Logic
— Unit - 1 —
6. Functions (Mappings)
A Functionf from set A to set B is a special type of relation where every element in A is assigned to exactly one element in B.
Domain: Set A.
Codomain: Set B.
Image: If f(a)=b, then b is the image of a.
Pre-image:a is the pre-image of b.
Range: The set of all actual images. Range ⊆ Codomain.
⇒6.1 Types of Functions
Injective (One-to-One): Every element in the codomain is mapped to by at most one element in the domain. If f(x)=f(y), then x=y.
Surjective (Onto): Every element in the codomain is mapped to by at least one element in the domain. Range = Codomain.
Bijective (One-to-One and Onto): A function that is both injective and surjective. Only bijective functions have an inverse.
Page 7
Wink Notes
B.Tech CSE — 3rd Semester
Discrete Structures and Theory of Logic
— Unit - 1 —
7. Composition of Functions
Let f:A→B and g:B→C be two functions. The Composition of f and g, denoted by g∘f, is the function from A to C defined by:
(g∘f)(x)=g(f(x)) for all x∈A.
⇒7.1 Properties of Composition
Composition is not commutative: generally, f∘g=g∘f.
Composition is associative: (f∘g)∘h=f∘(g∘h).
If f and g are both injective, then g∘f is injective.
If f and g are both surjective, then g∘f is surjective.
If f and g are both bijective, then g∘f is bijective.
⇒7.2 Inverse Functions
If f:A→B is bijective, its inverse f−1:B→A exists such that f−1(b)=a if and only if f(a)=b. Note that (f−1)−1=f, and (g∘f)−1=f−1∘g−1.
Page 8
Wink Notes
B.Tech CSE — 3rd Semester
Discrete Structures and Theory of Logic
— Unit - 1 —
8. Partially Ordered Sets (POSETs)
A relation R on a set A is a Partial Order if it is:
1. Reflexive
2. Antisymmetric
3. Transitive
A set A together with a partial order relation ≤ is called a Partially Ordered Set or POSET, denoted as (A,≤).
⇒8.1 Why 'Partial'?
It is called 'partial' because not every pair of elements in the set needs to be comparable. If a≤b or b≤a, they are comparable. If neither is true, they are incomparable.
Example: The set of positive integers under the relation "divides" (a∣b). 2∣4, so 2 and 4 are comparable. However, neither 2∣3 nor 3∣2 is true, so 2 and 3 are incomparable.
Page 9
Wink Notes
B.Tech CSE — 3rd Semester
Discrete Structures and Theory of Logic
— Unit - 1 —
9. Hasse Diagrams
A Hasse Diagram is a graphical representation of a finite POSET that strips away redundant information (reflexivity and transitivity) to make the hierarchy clear.
⇒9.1 How to construct a Hasse Diagram
Start with the directed graph of the relation.
Remove all self-loops (because reflexivity is implied).
Remove all transitive edges (if A→B and B→C, remove the direct edge A→C).
Arrange the nodes so that if A≤B, node B is placed physically higher than node A.
Remove the arrows (direction is implied to be upwards).
The Hasse Diagram is critical for visually identifying the maximal, minimal, greatest, and least elements of a POSET.
Page 10
Wink Notes
B.Tech CSE — 3rd Semester
Discrete Structures and Theory of Logic
— Unit - 1 —
10. Extremal Elements of POSETs
By analysing the Hasse diagram, we can identify various extremal elements.
Maximal Element: An element a in A is maximal if there is no x∈A such that a<x. (It is at the top of a chain in the Hasse diagram).
Minimal Element: An element a in A is minimal if there is no x∈A such that x<a. (It is at the bottom of a chain).
Greatest Element (Maximum): An element a is the greatest element if x≤a for allx∈A. There can be at most one greatest element.
Least Element (Minimum): An element a is the least element if a≤x for allx∈A. There can be at most one least element.
Note: A POSET can have multiple maximal/minimal elements, but it can have at most one greatest/least element. If a greatest element exists, it is the unique maximal element.
Page 11
Wink Notes
B.Tech CSE — 3rd Semester
Discrete Structures and Theory of Logic
— Unit - 1 —
11. Upper and Lower Bounds
Let S be a subset of a POSET (A,≤).
⇒11.1 Upper Bound and Supremum (LUB)
Upper Bound: An element u∈A is an upper bound of S if x≤u for all x∈S.
Least Upper Bound (LUB) / Supremum: The smallest of all the upper bounds of S. If it exists, it is unique.
⇒11.2 Lower Bound and Infimum (GLB)
Lower Bound: An element l∈A is a lower bound of S if l≤x for all x∈S.
Greatest Lower Bound (GLB) / Infimum: The largest of all the lower bounds of S. If it exists, it is unique.
Page 12
Wink Notes
B.Tech CSE — 3rd Semester
Discrete Structures and Theory of Logic
— Unit - 1 —
12. Introduction to Lattices
A Lattice is a specific type of POSET in which every pair of elements has a unique Least Upper Bound (LUB) and a unique Greatest Lower Bound (GLB).
Notation:
⇒12.1 Properties of Lattices
Because a Lattice is an algebraic structure, the Join and Meet operations satisfy several laws:
Commutative:a∨b=b∨a and a∧b=b∧a
Associative:a∨(b∨c)=(a∨b)∨c and a∧(b∧c)=(a∧b)∧c
Absorption:a∨(a∧b)=a and a∧(a∨b)=a
Idempotent:a∨a=a and a∧a=a
Page 13
Wink Notes
B.Tech CSE — 3rd Semester
Discrete Structures and Theory of Logic
— Unit - 1 —
13. Types of Lattices
⇒13.1 Bounded Lattice
A lattice that has both a greatest element (denoted by I or 1) and a least element (denoted by O or 0). Every finite lattice is a bounded lattice.
⇒13.2 Distributive Lattice
A lattice is distributive if the operations of Join and Meet distribute over each other. a∨(b∧c)=(a∨b)∧(a∨c)
⇒13.3 Complemented Lattice
A bounded lattice where every element a has at least one complement a′, such that: a∨a′=I (Join is the greatest element) a∧a′=O (Meet is the least element)
⇒13.4 Boolean Algebra (Boolean Lattice)
A lattice that is both Distributive and Complemented is called a Boolean Lattice or Boolean Algebra. In a Boolean Lattice, the complement of every element is unique.
Page 14
Wink Notes
B.Tech CSE — 3rd Semester
Discrete Structures and Theory of Logic
— Unit - 1 —
14. Summary & Review Checklist
Set theory and Lattices form the structural backbone of Discrete Mathematics.
⇒14.1 University Exam Checklist
Prove De Morgan’s laws using set builder notation and Venn diagrams.
Define an Equivalence Relation and prove that a given relation is an equivalence relation.
Explain the difference between Injective, Surjective, and Bijective functions.
Given a relation matrix or set of pairs, draw the corresponding Hasse Diagram.
From a Hasse Diagram, identify the maximal, minimal, greatest, and least elements.
Define a Lattice. State the absorption laws of a lattice.
⇒14.2 Technical Interview & Application Focus
How do Equivalence Classes relate to consistent hashing in distributed systems?
How are POSETs and Hasse Diagrams used to model dependency resolution (e.g., package managers like npm/pip)?
Why is a Boolean Lattice significant in the design of digital logic circuits?