Processing math: 100%

Functions and Relations

Last update: Thursday, 6 October 2022.

Functions

Functions are the language of higher mathematics!

Let A and B be sets. A function f:AB is a relation fA×B such that for all aA there is a unique bB such that (a,b)f. The set A is called the source or domain of f, written dom(f)=A. The set B is called the target or codomain of f, written cod(f)=B.

Usually we will write f(a)=b rather than (a,b)f or afb.

For every set A there is an identity function idA:AA having idA(a)=a for all aA.

Functions f and g with the same domain and codomain are equal when f(x)=g(x) for all xdom(f).

As relations, functions are special; functions take an input and produce a unique output for that input.

Given two compatible functions, we can get another function from them!

Functions f:AB and g:BC have composition gf:AC,  xg(f(x)).

For all f:AB, g:BC, and h:CD we have h(gf)=(hg)f.

For all xdom(f) we have the following equalities, completing the proof.

(h(gf))(x)=h((gf)(x))=h(g(f(x)))=(hg)(f(x))=((hg)f)(x).

Let f:AB be a function.

  1. The preimage of a set SB under f is the set f1(S)={xA:f(x)S}.
  2. The image of a set TA under f is the set f(T)={f(x)B:xT}.

The next several propositions are straightforward applications of the definitions presented here. The proofs are left to you as a method of checking your understanding.

Let f:AB be a function.

  1. If STA, then f(S)f(T).
  2. If STB, then f1(S)f1(T).

Let f:AB be a function.

  1. For all SA we have Sf1(f(S)).
  2. For all TB we have f(f1(T))T.

Let f:AB be a function and S,TA. The following all hold:

  1. f(ST)=f(S)f(T)
  2. f(ST)f(S)f(T)
  3. f(ST)f(S)f(T)

Find examples of functions and subsets for which the above subset relations are strict.

The following proposition makes a nice exercise.

Let f:AB be a function and S,TB. The following all hold.

  1. f1(ST)=f1(S)f1(T)
  2. f1(ST)=f1(S)f1(T)
  3. f1(ST)=f1(S)f1(T)

Let f:AB be a function.

  1. Function f is injective or into when for all a,aA we have f(a)=f(a) implies a=a.
  2. Function f is surjective or onto when for all bB there exists an aA such that f(a)=b.
  3. Function f is bijective or a one-to-one correspondence when f is both injective and surjective.

The identity function idA:AA is bijective.

Write down examples of functions which are injective, surjective, and bijective. Can you write down a function which is injective but not surjective? How about one which is surjective but not injective?

If f is injective, can you strengthen Proposition 1? What if f is surjective?

In Calculus, you may have studied some inverse functions (the Inverse Function Theorem needs them!).

Let f:AB be a function.

  1. A left inverse of f is a function g:BA such that gf=idA.
  2. A right inverse of f is a function g:BA such that fg=idB.
  3. An inverse of f is a function g:BA such that g is both a left inverse of f and a right inverse of f.

The function idA is its own inverse.

Find functions that have a left inverse but no right inverse and vice-versa.

The following proposition gives the relationship between invertibility and the properties above.

Let f:AB be a function with A.

  1. Function f has a left inverse if and only if f is injective.
  2. Function f has a right inverse if and only if f is surjective.
  3. Function f has an inverse if and only if f is bijective.

Let f:AB be a function.

Part 1: Supposing f has a left inverse g, then (gf)(a)=a for all aA. Thus g(f(a))=a for all aA. If f(a)=f(a) for some a,aA, then a=g(f(a))=g(f(a))=a; hence f is injective. Supposing f is injective, fix an element a0A (this is why we need A) and define

g(x)={aif x=f(a) for some aAa0otherwise

for all xB. If f(a)=f(a), then a=a by injectivity; thus g is well-defined. Moreover (gf)(x)=g(f(x))=x for all xA; hence gf=idA and g is a left inverse of f.

Part 2: Supposing f has a right inverse g, then (fg)(b)=b for all bB. Thus for all bB one has g(b)A and f(g(b))=b; hence f is surjective. Supposing f is surjective, we fix for all bB an element abA with f(ab)=b.\footnote{This is possible by an abstract axiom of set theory (called the Axiom of Choice). Mathematicians argued for a long time over whether or not this is a good axiom because it has a lot of weird consequences. To learn more, email me…} Now define g:BA by g(b)=ab; note that this is well-defined by surjectivity of f. Moreover (fg)(x)=f(g(x))=f(ax)=x for all xB; hence fg=idB and g is a right inverse of f.

Part 3: Supposing f has an inverse, f has both a left and right inverse; hence by Part 1 and Part 2, f is both injective and surjective, and thus bijective. If f is bijective, then f is injective and surjective by definition; thus by Part 1 and Part 2 f has a left inverse g and a right inverse g. Now g=gidB=g(fg)=(gf)g=idAg=g and hence g is both a left and right invere for f.

Let f:AB be a function.

  1. If f is injective, then for all Sdom(f) we have f1(f(S))=S.
  2. If f is surjective, then for all Tcod(f) we have f(f1(S))=S.

Exercise (HINT: you can use the preceeding proposition).