Relations and Properties of Relations
Relations (Chapter 8)
Two-Place Predicates
Two-place predicates, like where is the brother of , are fundamental in mathematics.
They help describe basic concepts.
Examples:
: is greater than or equal to (magnitude comparison).
: has the same parity as (parity comparison of integers).
: has square equal to (relates a value to its square).
What are Relations?
Two-place predicates are also called relations.
Definition: If is a two-place predicate with domain of discourse for and for , then is a relation from to .
is called the domain of the relation.
is called the codomain of the relation.
Specifying Relations
Verbal Description: Providing a verbal description (e.g., : The word ends with the letter ).
Domain: Words in English.
Codomain: Letters of the alphabet.
Example: (cat, t) satisfies , but (dog, w) does not.
Listing Ordered Pairs: Explicitly listing the ordered pairs that satisfy the relation.
Example: If and , a relation from to could be .
Notation: is often used in place of .
For example, is true, or , or .
Representing Relations with Graphs
Relations can be represented using graphs.
Bipartite Graph: A diagram with vertices (dots) and edges (lines).
Create a column of dots for elements of and label them.
Create a column of dots for elements of and label them.
Connect vertex to vertex with an edge if .
Example 8.1: Let , , and . A bipartite graph represents .
Relations on a Set
If is a relation from to , then is a relation on .
Relations on a set can be represented using a digraph.
Digraph (Directed Graph): Edges have a direction indicated by an arrowhead.
Each element of labels a single point.
An arrow connects vertex to vertex if .
An edge of the form is called a loop.
Example 8.2: Let and . A digraph visually represents .
Representing Relations with Matrices
A 0-1 matrix is used to represent a relation, handy for computer encoding.
An matrix is a rectangular array with rows and columns.
Entries are indexed by row and column: or represents the entry in the row and column.
For finite sets and with and elements respectively, use elements of and to index rows and columns.
Matrix of R, : The entry in the row labeled by and the column labeled by is 1 if and 0 otherwise.
Example 8.3: Let and , and .
The 0-1 matrix representing is:
The matrix appearance depends on the order of elements in and .
Set Operations on Relations
Relations as sets of ordered pairs allow set operations.
Bit-wise operations on 0-1 matrices represent these operations.
means that wherever has a 0 entry, also has a 0.
means the same as .
Inverse of a Relation
Reversing all ordered pairs in gives the inverse relation, denoted .
The bipartite graph for is obtained by interchanging columns of vertices with edges.
The matrix for is the transpose of the matrix for .
Composition of Relations
If is a relation from to and is a relation from to , then the composition of by is .
Example 8.4: Let , , and . Further, let and .
Since and , it follows that .
.
Composition can be determined using bipartite graphs: has a two-edge path from to .
Boolean Product of Matrices
If is the matrix of and is the matrix of , then the matrix represents the composition.
The Boolean product of and is the matrix of the composition.
Given an 0-1 matrix and a 0-1 matrix , is an 0-1 matrix where the entry is .
The ordinary matrix product is computed the same way as the boolean product where multiplication and addition have been replaced with and and or, respectively.
Example: For the relations in the example above:
Properties of Relations (Chapter 9)
Reflexive Relations
A relation on is reflexive if for all , .
Every element in the domain is related to itself.
Example: : is even on the set of integers.
Symbolic logic:
Digraph: Has a loop at every vertex.
Matrix: All entries on the main diagonal are 1s.
Irreflexive Relations
A relation on is irreflexive if is false for all .
No element of is related to itself.
Digraph: Contains no loops.
Matrix: All 0s on the main diagonal.
Symbolic logic:
Domain Specificity
Whether a relation is reflexive or irreflexive depends on the domain.
Example: : The square of is greater than or equal to .
Reflexive on (natural numbers), as for all .
Not reflexive on (real numbers), as \left( \frac{1}{2} \right)^2 = \frac{1}{4} < \frac{1}{2}.
Symmetric Relations
A relation on is symmetric if .
If is related to , then is related to .
Digraph: Every non-loop has a return edge.
Matrix: (symmetric about the main diagonal).
Symbolic logic:
Antisymmetric Relations
A relation on is antisymmetric if whenever and , then .
The only objects related to each other are the same object.
Example: The relation for integers.
Digraph: All streets one-way except loops.
Matrix: If and , then .
Symbolic logic:
Transitive Relations
A relation on is transitive if whenever and , then .
.
Example: The relation on .
Digraph: If there's a directed path of length two from to through , there's a direct link from to .
Matrix: .
Symbolic logic:
Examples
Example 9.1: The "lives within one mile of" relation is reflexive, symmetric, but not antisymmetric or transitive.
Example 9.2: is reflexive, transitive, and antisymmetric (an ordering relation).
Example 9.3: aRb \iff a < b is irreflexive and transitive.
Example 9.4: A reflexive, symmetric, and transitive relation on .
Example 9.5: A relation that is not reflexive, irreflexive, symmetric, or transitive but is antisymmetric.
Equivalence Relations (Chapter 10)
Concept of Equivalence
Equivalence captures the notion of "same kind".
Properties:
(1) Reflexive: Every object is equivalent to itself.
(2) Symmetric: If is equivalent to , then is equivalent to .
(3) Transitive: If is equivalent to and is equivalent to , then is equivalent to .
Definition of Equivalence Relation
A relation on a set is an equivalence relation if it is reflexive, symmetric, and transitive.
If , then and are considered to be of the same kind.
Equivalence Class
The equivalence class of (denoted as ) is the set of all elements in that are equivalent to .
Partitioning
Equivalence classes partition the set into separate pieces.
Example: Considering cards with the same rank splits a deck into 13 equivalence classes.
Examples of Equivalence Relations
Example 10.1: Equality on . .
Example 10.2: Logical equivalence on logical propositions. .
Example 10.3: Same age on people. and are the same age.
Example 10.4: Given by a matrix (from exercise 3, part a) of chapter 9).
Example 10.5: Same parity on integers. and are both even or both odd.
Example 10.6: The equivalence class of 2 for the same parity relation is the set of all even integers. .
Theorem 10.7
Let be an equivalence relation on a set , and let . Then there is exactly one equivalence class to which belongs.
Proof: is reflexive, so , and thus is true. If then .
Need to show: If , then , and if , then .
Direct proof (part 2): If , then . Since , , and by symmetry, . By transitivity, , meaning .
Definition 10.8
A partition of a set A is a collection of nonempty, pairwise disjoint subsets of A, so that A is the union of the subsets in the collection.
A partition of a set is a collection of nonempty, pairwise disjoint subsets of , such that is the union of the subsets in the collection.
Digraph and Matrix Representation
Digraph: Every vertex in an equivalence class is connected to every other vertex in that class (including itself).
Matrix: Can be arranged in block diagonal form with all-1s matrices on the diagonal.