KR2.3
Functions
Definition: let A and B be nonempty sets. A function f from A to B, denoted A→B is an assignment of each element of A to exaclty one element of B.
- we write f(a)=b if b is the unique element of B assigned by the ffunction f to the element a of A.
Terminology
- f is mapping from A to B
- A is called the domain of f.
- B is called the codomain of f.
- If f(a)=b
- b is called the image of a under f
- a is called the preimage of b
- The range of f is the set of all images of points in A under f. We denote it by f(A).
- Two functions are equal when they have the same domain, the same codomain, and mapeach element of the domainto the same element of the codomain
- can be specified explicitly (words), as a formula (numbers), or as a program (code)
Injections
Definition: A function f is said to be one-to-one, or injective, if and only if f(a) = f(b) implies that a=b for all a and b in the domain of f
- visual example
- every element in a is assigned to only one element in b, no b has more than one a
Surjections
Definiton: A function f from A to B is called onto or surjective, if and only if for every element b∈B there is an element a∈A with f(a)=b
- visual example
- every element in b is assigned an element in a
Bijections
Definition: A function f is a one-to-one correspondence, or a bijeciton, if it is both one-to-one and onto (i.e. both surjective and injective)