A function is a special kind of relation. More precisely... A function f from A to B is a relation on A B such that. f (x) = y

Similar documents
MATH 220 (all sections) Homework #12 not to be turned in posted Friday, November 24, 2017

Topics in Logic, Set Theory and Computability

MATH 22 FUNCTIONS: COMPOSITION & INVERSES. Lecture N: 10/16/2003. Mad world! mad kings! mad composition! Shakespeare, King John, II:1

Math 300 Introduction to Mathematical Reasoning Autumn 2017 Inverse Functions

REVIEW FOR THIRD 3200 MIDTERM

CITS2211 Discrete Structures (2017) Cardinality and Countability

Solutions for Chapter Solutions for Chapter 17. Section 17.1 Exercises

Principles of Real Analysis I Fall I. The Real Number System

Functions Functions and Modeling A UTeach/TNT Course

Selected problems from past exams

Introduction to Functions

0 Sets and Induction. Sets

Definition: Let S and T be sets. A binary relation on SxT is any subset of SxT. A binary relation on S is any subset of SxS.

Functions as Relations

Foundations of Mathematics

Math 13, Spring 2013, Lecture B: Midterm

Postulate 2 [Order Axioms] in WRW the usual rules for inequalities

MATH 2200 Final Review

Introduction to Mathematical Analysis I. Second Edition. Beatriz Lafferriere Gerardo Lafferriere Nguyen Mau Nam

Week Some Warm-up Questions

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

Section 0. Sets and Relations

Name (print): Question 4. exercise 1.24 (compute the union, then the intersection of two sets)

CSCE 222 Discrete Structures for Computing

Sets and Functions. (As we will see, in describing a set the order in which elements are listed is irrelevant).

General Notation. Exercises and Problems

2 Truth Tables, Equivalences and the Contrapositive

Lecture Notes in Real Analysis Anant R. Shastri Department of Mathematics Indian Institute of Technology Bombay

S15 MA 274: Exam 3 Study Questions

Reading 11 : Relations and Functions

FOUNDATIONS & PROOF LECTURE NOTES by Dr Lynne Walling

9/21/17. Functions. CS 220: Discrete Structures and their Applications. Functions. Chapter 5 in zybooks. definition. definition

CS 220: Discrete Structures and their Applications. Functions Chapter 5 in zybooks

3 FUNCTIONS. 3.1 Definition and Basic Properties. c Dr Oksana Shatalov, Fall

(So SamID 1 ( ) = Ken W. Smith.)

Solutions to Homework Set 1

xy xyy 1 = ey 1 = y 1 i.e.

Chapter 1. Sets and Mappings

Section 1.7 Proof Methods and Strategy. Existence Proofs. xp(x). Constructive existence proof:

COM S 330 Homework 05 Solutions. Type your answers to the following questions and submit a PDF file to Blackboard. One page per problem.

1 Basic Combinatorics

Today s Topics. Methods of proof Relationships to logical equivalences. Important definitions Relationships to sets, relations Special functions

Abstract Algebra I. Randall R. Holmes Auburn University. Copyright c 2012 by Randall R. Holmes Last revision: November 11, 2016

About This Document. MTH299 - Examples Weeks 1-6; updated on January 5, 2018

2.1 Sets. Definition 1 A set is an unordered collection of objects. Important sets: N, Z, Z +, Q, R.

Notes on Satisfiability-Based Problem Solving. First Order Logic. David Mitchell October 23, 2013

9 FUNCTIONS. 9.1 The Definition of Function. c Dr Oksana Shatalov, Fall

x 9 or x > 10 Name: Class: Date: 1 How many natural numbers are between 1.5 and 4.5 on the number line?

Cartesian Products and Relations

DIHEDRAL GROUPS II KEITH CONRAD

MAT115A-21 COMPLETE LECTURE NOTES

2 Functions. 2.1 What is a function?

Definition: A binary relation R from a set A to a set B is a subset R A B. Example:

Seminaar Abstrakte Wiskunde Seminar in Abstract Mathematics Lecture notes in progress (27 March 2010)

Background for Discrete Mathematics

Discussion Summary 10/16/2018

Solved Examples. Given are two sets A {1, 2, -2, 3} and B = {1, 2, 3, 5}. Is the function f(x) = 2x - 1 defined from A to B?


= 1 2x. x 2 a ) 0 (mod p n ), (x 2 + 2a + a2. x a ) 2

COMPUTER SCIENCE TRIPOS

Section Summary. Relations and Functions Properties of Relations. Combining Relations

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

Practice Exam 1 CIS/CSE 607, Spring 2009

LGIC 310/MATH 570/PHIL 006 Fall, 2010 Scott Weinstein 9

MATH 3300 Test 1. Name: Student Id:

Meta-logic derivation rules

Chapter 0. Introduction: Prerequisites and Preliminaries

CHAPTER THREE: RELATIONS AND FUNCTIONS

Mathematics Course 111: Algebra I Part I: Algebraic Structures, Sets and Permutations

Notes on ordinals and cardinals

COMP9020 Lecture 3 Session 2, 2016 Sets, Functions, and Sequences. Revision: 1.3

Section 7.2: One-to-One, Onto and Inverse Functions

3 FUNCTIONS. 3.1 Definition and Basic Properties. c Dr Oksana Shatalov, Spring

Context-free grammars and languages

Counting. Mukulika Ghosh. Fall Based on slides by Dr. Hyunyoung Lee

Notes on Algebraic Structures. Peter J. Cameron

4.1 Real-valued functions of a real variable

Exercises for Unit VI (Infinite constructions in set theory)

9/21/2018. Properties of Functions. Properties of Functions. Properties of Functions. Properties of Functions. Properties of Functions

Math 4603: Advanced Calculus I, Summer 2016 University of Minnesota Notes on Cardinality of Sets

mcs 2015/5/18 1:43 page 87 #95

3 FUNCTIONS. 3.1 Definition and Basic Properties. c Dr Oksana Shatalov, Fall

To get horizontal and slant asymptotes algebraically we need to know about end behaviour for rational functions.

Name (please print) Mathematics Final Examination December 14, 2005 I. (4)

MATH 201 Solutions: TEST 3-A (in class)

Introduction to Automata

Section 4.4 Functions. CS 130 Discrete Structures

2 Lecture 2: Logical statements and proof by contradiction Lecture 10: More on Permutations, Group Homomorphisms 31

1.4 Cardinality. Tom Lewis. Fall Term Tom Lewis () 1.4 Cardinality Fall Term / 9

MATH 3330 ABSTRACT ALGEBRA SPRING Definition. A statement is a declarative sentence that is either true or false.

MTH 299 In Class and Recitation Problems SUMMER 2016

Relations, Functions & Binary Operations

Prof. Ila Varma HW 8 Solutions MATH 109. A B, h(i) := g(i n) if i > n. h : Z + f((i + 1)/2) if i is odd, g(i/2) if i is even.

MAT 570 REAL ANALYSIS LECTURE NOTES. Contents. 1. Sets Functions Countability Axiom of choice Equivalence relations 9

Finite and Infinite Sets

Lecture 10: Everything Else

Functions If (x, y 1 ), (x, y 2 ) S, then y 1 = y 2

EE 229B ERROR CONTROL CODING Spring 2005

Notes on Sets, Relations and Functions

Elementary Recursive Function Theory

Transcription:

Functions A function is a special kind of relation. More precisely... A function f from A to B is a relation on A B such that for all x A, there is exactly one y B s.t. (x, y) f. The set A is called the domain of f, and B the codomain of f. We say that a function f from A to B has type A B, and we write f : A B. In such a function f, there is a unique y B for each x A, so the standard functional notation is well-defined and convenient. f (x) = y We call x the argument of f, and y is called the value of f at x. If A and B are nonempty finite sets, how many functions of type A B?

Multi-argument functions It may seem that we have given a definition of a function that is suitable only for unary functions (that is, functions that take one argument). But there is an easy, standard way to incorporate multi-argument functions in this framework... If the domain of a function f is a Cartesian product A 1 A n we say f has arity n and that f takes n arguments. Moreover, for each (x 1,..., x n) A 1 A n, we write f (x 1,..., x n) to denote the value of f at (x 1,..., x n). Of course functions that take two arguments are called binary functions. And those that take three arguments are called ternary.

Range, image and pre-image Let f be a function from A to B... The range of f is defined as follows. Notice that range(f ) B. range(f ) = { f (x) x A } For any S A, the image of S (under f ) is Notice that f (A) = range(f ). f (S) = { f (x) x S }. Notice also that this notation also allows us to think of f as a function from power(a) to power(b). (Don t let this confuse you.) For any T B, the pre-image of T (under f ) is f 1 (T ) = { x A f (x) T }. Notice that f 1 (B) = A. (Do you see why?) Notice also that this notation also allows us to think of f 1 as a function from power(b) to power(a).

Total functions vs partial functions Recall: A (total) function f from A to B is a relation on A B such that for all x A, there is exactly one y B s.t. (x, y) f. A standard alternative definition allows functions to be undefined on some elements of the domain... A partial function f from A to B is a relation on A B such that for all x A, there is at most one y B s.t. (x, y) f. A familiar example is real division. We will typically be interested in total functions. If A and B are nonempty finite sets, how many partial functions of type A B?

Equality of functions For functions to be the same (that is, equal), they must have the same type and they must agree on all values. So, functions f and g from A to B are equal if for all x A, f (x) = g(x). Consider the following two functions from N to N : nx i Are they equal? i=0 n(n + 1) 2 How about the following functions of type (where A is an alphabet)? A A power(a ) f (x, y) = {xx, xy, yx, yy} g(x, y) = { zw (z, w) {x, y} {x, y} }

Injective functions A function f : A B is injective if for all x, y A, if x y, then f (x) f (y). Or, in words: distinct domain elements get distinct values. Let f : Z Z be s.t. f (x) = 2x. Is this injective? Let f : Z Z be s.t. f (x) = x 2. Is this injective? How about the following function from Z to N? j 2x, if x 0 f (x) = 2x 1, otherwise How about the following function from N N to N? (Cantor s pairing function, p. 124) f (x, y) = (x + y)2 + 3x + y 2

Surjective functions A function f : A B is surjective if range(f ) = B. That is, if for every y B there is an x A s.t. f (x) = y. Or, in words: every codomain element is the value of some domain element. Let f : N Z + be the function such that Is f surjective? f (x) = x + 1. What if we take f instead to be the function of type N N that satisfies the above equation (for all natural numbers x)? How about this function (from the previous page) from Z to N? j 2x, if x 0 f (x) = 2x 1, otherwise

Claim. If A is a nonempty set, then there is an injection from A to B iff there is a surjection from B to A. [See textbook for proof, preferably after you ve first tried to prove it yourself. (Notice that the text doesn t mention nonemptiness of A in the statement of the theorem, but if you look carefully you will see that nonemptiness is needed, and used, in the proof. (Do you see where? It is easy to miss.))] Proof idea...

Bijections A function is bijective if it is injective and surjective. A bijective function is called a bijection or a one-to-one correspondence. Observe that f : A B is injective iff for all y B there is at most one x A s.t. f (x) = y. Similarly, f : A B is surjective iff for all y B there is at least one x A s.t. f (x) = y. Therefore: a function f : A B is bijective iff for all y B there is exactly one x A s.t. f (x) = y. The function f : N Z + defined by f (x) = x + 1 is a bijection. The function f from even integers to odd integers defined by f (x) = x + 1 is also a bijection. What if f instead has type N N? Z Z?

Consider the conditions that a relation R on A B must satisfy in order to be a bijection: R is a function from A to B iff for all x A there is exactly one y B s.t. (x, y) R a function R : A B is bijective iff for all y B there is exactly one x A s.t. (x, y) R So it is clear why a bijection is also called a one-to-one correspondence : it is a relation that establishes a one-to-one correspondence between the elements of sets A and B.

Let (0, 1) = { x R 0 < x < 1 }. (So here (0, 1) denotes a set of reals.) Claim: The function f : (0, 1) R + defined below is bijective. f (x) = x 1 x Proof. To show that f is injective, assume that f (x) = f (y). (So what is our obligation now?) Then x 1 x = y 1 y, so x xy = y yx which shows that x = y. To show that f is surjective, take any y R +. (What is our obligation now?) So we need an x (0, 1) s.t. f (x) = y. That is, we want x 1 x = y. Solving for x: x = y xy x + xy = y x(y + 1) = y x = y y + 1 It remains only to notice that since y > 0, 0 < x < 1.

Inverse of a bijection Claim: If f : A B is a bijection, then there is a unique function g : B A such that, for all y B and x A, g(y) = x iff f (x) = y. This function is called the inverse of f, and is denoted by f 1. The function f 1 too is bijective, and its inverse is f. The definition of inverse of a bijection relies on the claim: if f is a bijection, then such an inverse exists and unique. How hard is it to check that this claim holds?...

First let s check that every bijection has an inverse. Consider the alternative characterization of a bijection: A function f : A B is bijective iff for all y B there is exactly one x A s.t. f (x) = y. Notice that this is precisely to say that the relation R = { (y, x) y B, x A, f (x) = y } is a function from B to A: that is, for every y B there is exactly one x A such that (y, x) R. And what about uniqueness of the inverse? First notice that if g is an inverse of f : A B, then for all x A, and for all y B g(f (x)) = x f (g(y)) = y. Now, let g and h be inverses of f : A B. Then for any y B we have g(y) = g(f (h(y))) (h is an inverse of f ) = h(y) (g is an inverse of f )

Function composition For g : A B and f : C D, with B C, we define the composition of f and g, denoted f g, as the function from A D s.t. (f g)(x) = f (g(x)). For example, if f and g are functions of type N N s.t. f (x) = x + 1 and g(x) = 2 x then f g is the function of type N N s.t. (f g)(x) = 2 x + 1 and g f is the function of type N N s.t. (g f )(x) = 2 x+1.

Notice that for all bijections f : A B, (f 1 f )(x) = x for all x A, and for all y B. (f f 1 )(y) = y That is to say, and f 1 f = { (x, x) x A } f f 1 = { (y, y) y B }.

Claim. Consider any f : A B and g : C D, with B C. If f and g are injective, then g f is injective. Let s prove this... Assume f and g are injective. [What is our obligation now?] Take any x, y A s.t. x y. [What is our obligation now?] Since f is injective, it follows that f (x) f (y). And since g is also injective, we have g(f (x)) g(f (y)). That is to say, (g f )(x) (g f )(y). Claim. Consider any f : A B and g : B C. If f and g are surjective, then g f is surjective. If f and g are bijective, then g f is bijective. Can you prove this?

Pigeonhole principle For finite sets A, B, if A > B, then there is no injective function from A to B. Clearly this holds if B =. (Can you explain why?) And if A > B > 0, then for any function f : A B, there are x, y A s.t. x y and f (x) = f (y). Example: Any set of 17 nonempty strings over {a, b, c, d} includes two different strings whose first symbols agree and whose last symbols also agree. Let A be a set of 17 nonempty strings over {a, b, c, d}. Let B = {a, b, c, d} {a, b, c, d}. Let f be the function from A to B s.t. f (x) = (s, t) iff x begins with s and ends with t. This function is not injective. How do we know? Notice that A = 17 and B = 16. Thus, by the pigeonhole principle, no function from A to B is injective.