Recall that a Cartesian productA×B is defined by a set of pairs {(a1,b1),(a1,b2),...,(a1,bm),...,(ak,bm)}.
A Cartesian product defines a product set, or a set of all ordered arrangements of elements in sets in the Cartesian product.
Binary relations:
If A={1,2} and B={a,b,c}, then:
A×B={⟨1,a⟩,⟨1,b⟩,⟨1,c⟩,⟨2,a⟩,⟨2,b⟩,⟨2,c⟩}
A binary relationR from A to B is a subset of A×B
If ⟨a,b⟩∈R, then we can write Rab or aRb.
The former is typically preferred, since it allows us an easy convention for notating relationships with >2 relata, e.g. Rabc, and to notate the negation ¬Rab, using our logical vocabulary.
The inverse relationR−1 is the relation from B to A which consists of the ordered pairs, which, when reversed, belong to R. In symbolic notation: R−1={⟨b,a⟩∣⟨a,b⟩∈R}
Relations can be depicted by graphs. Draw a graph for the following relation R. R={⟨1,2⟩,⟨2,2⟩,⟨2,4⟩,⟨3,2⟩,⟨3,4⟩,⟨4,1⟩,⟨4,3⟩}
What does the inverse R−1 look like?
Relations can also be represented as a table or two dimensional array. What would that look like? Construct one for R.
Relation Composition or product:
Suppose that we have three sets A, B, and C, a relation R defined from A to B, and a relation S defined from B to C. We can define a composition of R and S, written (R∣S) (but sometimes S∘R), as follows. If a is an element of A and c is an element of C, then (R∣S)ac iff there exists some element b in B such that Rab and Sbc. So we have a relation R∣S from a to c iff a is R related to b and b is S related to c.
Let A = {1, 2, 3, 4}, R = {(1, 2), (1, 2), (2, 4), (3, 2)} ----- using () as angle brackets
and S = {(1, 4), (1, 3), (2, 3), (3, 1), (4, 1)}
Find R∣S.
Relations have many interesting properties. Some that we're interested in include: reflexivity, symmetry, antisymmetry, transitivity, equivalence, and partial and total order.
Relationship Properties
Let's come up with examples for each.
Empty Relation: A relation R on a set A is called Empty if the set A is empty set.
Full Relation: A binary relation R on a set A and B is called full if A×B.
Reflexive Relation: A relation R on a set A is called reflexive if (a,a)∈R holds for every element a∈A, e.g. if set A={a,b} then R={(a,a),(b,b)} is reflexive relation.
Irreflexive relation: A relation R on a set A is called reflexive if no (a,a)∈R holds for every element a∈A, e.g. if set A={a,b} then R={(a,b),(b,a)} is irreflexive relation.
Symmetric Relation: A relation R on a set A is called symmetric if (b,a)∈R holds when (a,b)∈R, e.g. The relation R={(4,5),(5,4),(6,5),(5,6)} on set A={4,5,6} is symmetric.
Anti-Symmetric Relation: A relation R on a set A is called anti-symmetric if (a,b)∈R and (b,a)∈R then a=b is called antisymmetric, e.g. The relation R={(a,b)→R∣a≤b} is anti-symmetric since a≤b and b≤a implies a=b.
Transitive Relation: A relation R on a set A is called transitive if (a,b)∈R and (b,c)∈R then (a,c)∈R for all a,b,c∈A, e.g. Relation R={(1,2),(2,3),(1,3)} on set A={1,2,3} is transitive.
Equivalence Relation: A relation is an Equivalence Relation if it is reflexive, symmetric, and transitive. E.g. relation R={(1,1),(2,2),(3,3),(1,2),(2,1),(2,3),(3,2),(1,3),(3,1)} on set A={1,2,3} is equivalence relation as it is reflexive, symmetric, and transitive.
Asymmetric Relation: Asymmetric relation is opposite of symmetric relation. A relation R on a set A is called asymmetric if no (b,a)∈R when (a,b)∈R.
Construct or name an example for each property.
Consider the following relations on the set A = {1, 2, 3}. R = {(1, 1), (1, 2), (1, 3), (3, 3)} S = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 3)} T = {(1, 1), (1, 2), (2, 2), (2, 3)} ∅ = empty relation A×A = universal relation on A
Determine whether or not each of the relations is (a) reflexive, (b) symmetric, (c) transitive, and (d) antisymmetric.
Consider the following relations:
Relation ≤ (less than or equal) on the set Z of integers.
Set inclusion ⊆ on a collection C of sets.
Relation ⊥ (perpendicular) on the set L of lines in the plane.
Relation ∥ (parallel) on the set L of lines in the plane.
Relation ∣ of divisibility on the set N of positive integers. (Recall x∣y if there exists z such that xz=y.)
Which of the relations are reflexive.
Which of these are symmetric?
Which are transitive and which not?
Consider the following relations on the set A = {1, 2, 3, 4}:
R1={(1,1),(1,2),(2,3),(1,3),(4,4)}
R2={(1,1)(1,2),(2,1),(2,2),(3,3),(4,4)}
R3={(1,3),(2,1)}
R4=∅, the empty relation
R5=A×A, the universal relation
Which of the relations are reflexive.
Which of these are symmetric?
Functions Examples and Exercises
Some definitions first.
Functions are ordinarily denoted by symbols. Suppose that for each element of a set A, the domain, we assign a unique element of a set B, the codomain. The collection of these assignments is called a function from A to B. Let f denote that function. We write:
f:A→B
We can also say that fmapsA to B.
Functions are often expressed by means of a mathematical formula. For example, consider the function which maps each real number to its square. We can denote this function by writing
f(x)=x2
x↦x2
y=x2
In the first notation, x is called a variable or argument and the letter f denotes the function.
In the second, the barred arrow ↦ is read "goes to" or "maps to". (The LaTeX command is \mapsto).
In the last, x is called the independent variable and y is called the dependent variable since the value of y depends on the value of x.
Exercises:
Find the domain D of each of the following real-valued functions of a real variable:
(a) f(x)=x−21
(b) f(x)=x2−3x−4
(c) f(x)=25−x2
Functions as Relations
Every function f:A→B defines a relation from A to B called the graph of f
Graph of f={⟨a,b⟩∣a∈A,f(a)=b∈B}
Two functions f:A→B and g:A→B are equal if for every a∈A, f(a)=g(a), i.e. they have the same graph.
Exercise: Map the function f(x)=x2−2x−3
Classes of Functions
A function is injective (one-to-one) if each element of the codomain is mapped to by at most one element of the domain.
That is, for all x,x′∈A, f(x)=f(x′)→x=x′
A function is surjective (onto) if each element of the codomain is mapped to by at least one element of the domain.
That is, for all y∈B, there exists an x∈A such that f(x)=y
A function is bijective (one-to-one and onto or one-to-one correspondence) if each element of the codomain is mapped to by exactly one element of the domain.
Exercises:
Consider functions f:A→B and g:B→C.
Prove the following:
(a) if f and g are injective (one-to-one), then the composition function g∘f is injective (one-to-one)$.
Proof:
Suppose (g∘f)(x)=(g∘f)(y), then g(f(x))=g(f(y)). So f(x)=f(y) because g is injective. Further, x=y since f is injective. Thus, g∘f is injective.
(b) if f and g are surjective (onto) functions, then g∘f is an surjective (onto) function.
Proof:
Let c be an arbitrary element of C. Since g is surjective, there exists a b∈B such that g(b)=c. Since f is surjective, there exists an a∈A such that f(a)=b. But also (g∘f)(a)=g(f(a))=g(b)=c. Hence, each c∈C is the mapping of some element a∈A. Therefore, g∘f is a surjective function.
Determine if each function is injective (one-to-one):
(c) To each person on the earth, assign the number which corresponds to her or his age.
(d) To each country in the world, assign the latitude and longitude of its capital.
(e) To each book written by only one author, assign the author.
(f) To each country in the world which has a prime minister, assign its prime minister.
Answers:
no, yes, no, yes
Problem: Show that if f is bijective, an inverse g of f exists. (define such a g show that it is a function, and show that it is an inverse of f.)
Proof:
Let f:A→B be bijective. We'll define a function g:A→B = f−1 as follows. Let b∈B. since f is surjective, there exists a∈A such that f(a)=b. Let g(b)=a. Since f is injective, this a is unique, so g is a well-defined function.
Next, we show that g is the inverse of f. First, we show that g∘f=idA.
First, let a∈A. Let b=f(a). Then by definition g(b)=a. then g∘f(a)=g(f(a))=g(b)=a.
Second, show that f∘g=idB. Let b∈B and f−1(b)=g(b)=a. By definition, f(a)=b. It follows that f∘g(b)=f(g(b))=f(a)=b.