Definition1: A function f:AB from a domain A to a codomain B is a set of pairs (x,y):xA,yB, each xA appears in exactly one pair. e.g.

{(x,x2)R2xR}

is a formal description of the square function.

Definition2: A function f:AB from a domain A to a codomain B is a relation from A to B with the special properties (using the relation notation a f b):

  1. aA bB a f b (f is totally defined)
  2. aA b,bB(a f ba f bb=b) (f is well defined)

The first property means there’s always a b in B that a can map to. The second property means there’s only one b that a can map to.

How many functions are possible from a set of x elements to set of y elements?

n(f)=y×y×y...×y=yx

Injective (one-to-one)

If x1x2, then f(x1)f(x2),i.e., not two distinct values are mapped to the same function value (there are no “collisions”).

Example: Let f:ZQ be defined by f(n)=n/1. Then f is one-to-one but not onto.

How many injective functions are possible from a set of x elements to set of y elements?

n(f)=y×(y1)×(y2)...(y(x1))=ypx

If x=y, then n(f)=n!

Surjective (onto)

Let f:XY

f is surjective iff yY,xX such that f(x)=y (every value in the codomain is taken on for some argument).

Example: Define g:QZ by g(p/q)=p where p/q is a rational number expressed in its lowest terms with a positive denominator. The function g is onto but not one-to-one.

Bijective (one-to-one and onto)

If it is both injective and surjective.

Let f:AB,g:BC, andh:CD. Then

  1. The composition of mapping is associative: that is, (hg)f=h(gf);
  2. If f and g are both one-to-one, then the mapping gf is one-to-one;
  3. If f and g are both onto, then the mapping gf is onto;
  4. If f and g are bijective, then so is gf.