Discrete Mathematics Lecture: Functions and Relations
Fundamentals of Relations
A relation from set to set is defined as a set of ordered pairs in which elements of set are associated with elements of set .
Mathematically, a relation is any subset of the Cartesian product of and , denoted as .
If an ordered pair belongs to the relation , it is said that is -related to , written as .
If an ordered pair does not belong to the relation , then is not -related to , written as .
The domain of a relation is the set of all first elements from the ordered pairs within .
The range of a relation is the set of all second elements from the ordered pairs within .
Example of a relation:
Let and .
A valid relation is .
Inverse Relations
Let be any relation from set to set .
The inverse of , denoted by , is a relation from set to set containing ordered pairs that belong to when reversed.
Formal definition: .
Example of an inverse relation:
Let and .
If , then .
Properties and Types of Relations
Reflexive Relations:
A relation on a set is reflexive if for every element .
Equivalently, must hold for all .
Example: For , the relation is reflexive because every element is related to itself.
Note: Reflexivity depends only on whether every element is related to itself; additional pairs like do not affect this property.
Symmetric Relations:
A relation is symmetric if whenever , then .
A relation is not symmetric (antisymmetric) if there exist elements such that but .
Example: is symmetric because the reverse of is , and diagonal pairs are their own reverses.
Transitive Relations:
A relation on set is transitive if whenever and , then .
A relation is not transitive if there exist elements such that but .
Example: is transitive because and are in , and their chain result is also in .
Equivalence Relations:
A relation on a set is an equivalence relation if it satisfies three conditions: it must be reflexive, symmetric, and transitive for all .
Example Verification: Let and .
Reflexive: .
Symmetric: and .
Transitive: and .
Matrix Representation of Relations
Properties of a relation can be checked using its matrix :
Reflexive: Check if all diagonal entries for all .
Symmetric: Check if the matrix is equal to its transpose, , meaning .
Transitive: Check if the square of the matrix is less than or equal to the matrix itself, .
Example Matrix: .
Introduction to Functions
Definition: Let and be nonempty sets. A function from to is an assignment of exactly one element of to each element of .
Notation: If is a function from to , it is written as .
Terminology: Functions are also referred to as mappings or transformations.
Mapping Notation: For an ordered pair where and , the mapping is written as .
Domains and Codomains:
The set is the domain of the function.
The set is the target set or codomain.
If , is the image of , and is a preimage of .
The range of is the set of all images of elements of .
Equality of Functions
Two functions are considered equal if they meet three specific criteria:
They share the same domain.
They share the same codomain.
They assign the identical output to every input within the domain.
Mathematically: if and only if for all , given and .
Example of Equality: and defined on are equal because their formulas expand to the same values for all .
Example of Inequality: with and with . Although the formulas are the same, the domains differ (), so .
Arithmetic Operations on Functions
A function is real-valued if its codomain is the set of real numbers .
A function is integer-valued if its codomain is the set of integers .
Addition and multiplication of two functions ( and ) from to are defined as:
Sum: .
Product: .
Numerical Example:
If and from to , then:
.
.
One-to-One and Onto Functions
One-to-One (Injective) Functions
A function is one-to-one or injective if different elements of the domain have different images.
Formal Definition: is one-to-one if and only if for all in the domain.
Contrapositive Definition: is one-to-one if .
Quantifier Notation: or .
Proving injectivity: Assume and solve to show .
Example: For , assuming leads to , which implies . Thus, it is injective.
Onto (Surjective) Functions
A function is onto or surjective if every element of the codomain is the image of at least one element of .
Formal Definition: such that .
Proving surjectivity: Let be an arbitrary element of the codomain, solve the equation for , and confirm that exists in the domain for every possible .
Example 1: Show such that is onto.
. Since for any , the function is onto.
Example 2: Show such that is surjective.
. Since , is a real number, so preimages exist for all in the codomain.
Example 3: Show such that is onto.
. Since cube roots of all real numbers are real, a preimage always exists.
Bijective Functions and One-to-One Correspondence
A function is bijective (or a one-to-one correspondence) if it is both injective and surjective.
Example: Show is bijective.
Case I (Injective): .
Case II (Onto): Let , then . Preimage exists for all .
Conclusion: Since both conditions are satisfied, is a bijection.
Increasing and Decreasing Functions
Let be a function with domain and codomain as subsets of the set of real numbers.
Increasing: whenever .
Strictly Increasing: whenever .
Decreasing: whenever .
Strictly Decreasing: whenever .
Derivative Test:
If for all in the domain, then is an increasing function.
If for all in the domain, then is a decreasing function.
Example: Prove is increasing.
Proof by comparison: If , then , and , so .
Proof by derivative: . Since for all , is increasing.
Inverse Functions
Let be a bijective function.
The inverse function, denoted , is defined from such that:
.
A function is invertible if it is a one-to-one correspondence.
If a function is not bijective (either not one-to-one or not onto), an inverse cannot be defined.
If not one-to-one: An element in the codomain might mapping back to multiple elements in the domain.
If not onto: Some element in the codomain might have no corresponding element in the domain.
Example 1: Let . Since it is a bijection, exists: , , and .
Example 2: For where , solve for , resulting in . Swap variables to get .
Composition of Functions
Let and .
The composition of and , written as , is a function from .
Calculation rule: .
Example: Let and for .
.
.
.
.
Key Note: in general.
Floor and Ceiling Functions
Floor Function (): The greatest integer less than or equal to .
Examples: , , .
Ceiling Function (): The smallest integer greater than or equal to .
Examples: , , .
Solving Equations:
.
.
.
Questions & Discussion
Quiz (Relation on Integers): Define a relation on the set of integers by . Determine whether is reflexive, symmetric, or transitive.
Quiz (One-to-One): Determine whether , is one-to-one.
Quiz (One-to-One): Show that , is injective.
Quiz (Onto): Let such that . Show that is onto.
Quiz (Onto): Show that , is onto.
Quiz (Arithmetic): Determine the value of .
Quiz (Ceiling Equation): Find all integers such that .