Let fg denote the function composition f∘g (where f,g∈F), and let (i1,i2,…,ip) denote the function f:S→S defined by f(ij)=ij+1 for j=1,p−1, f(ip)=i1, and f(x)=x for x=i1,…,ip (where i1,…,ip are p≥2 distinct elements of S).
a) We use an inductive approach. For n=3, B={a,a2,b,b2,ab,ba}.
Now, we suppose the property holds for some n≥3 and we show that it also holds for n+1. Let f:S∪{n+1}→S∪{n+1}, f(n+1)=m, and let a′,b′:S∪{n+1}→S∪{n+1} be analogous to a and b. Then ((b′)n−m+1f)(n+1)=n+1, so the restriction of g=(b′)n−m+1f to S can be written as a composition of a and b; we have f=(b′)mg (1).
We have (b′a′)(n+1)=n+1 and the restriction of b′a′ to S is b. Moreover, ((b′)na′b′)(n+1)=n+1 and the restriction of (b′)na′b′ to S is a. Then from (1), it follows that f can be written as a composition of a′ and b′.
b) We show that if G is a generating set for F, then ∣G∣≥3.
If G has at most two elements f and g, then:
* If both f and g are bijective, then G can only generate bijective functions.
* If both f and g are not bijective, then they are not surjective, so G can only generate non-surjective functions.
* If, for example, f is bijective and g is not bijective, then the bijective functions generated by G are fn, n∈N∗. In this case, G cannot generate both a and b because ab=ba, while fmfp=fpfm for all m,p∈N∗.
We show that a generating set for F is G={a,b,c}, where c:S→S, c(k)=k for k∈S∖{n}, and c(n)=n−1. We prove that any f∈F can be written as a composition of a,b, and c by descending induction on the number of elements in the image of f. If ∣Im f∣=n, then f is bijective and we use (a).
We assume that the statement is true for any f with ∣Imf∣=k, where 1<k≤n, and we prove it for an arbitrary g with ∣Img∣=k−1. Since g is not injective, there exist u,v∈S, u=v, and a bijective function r such that Imgr={1,2,…,k−1} and (gr)(u)=(gr)(v)=k−1. Let s:S→S be defined such that s(n−1)=u, s(n)=v, and s(x)=x for x=u,v. We consider the function h:S→S defined as h(x)=(grs)(x) for x≤n−1 and h(n)=k. Then ∣Imh∣=k, so h can be expressed as a composition of the functions a,b,c, and grs=hc. Thus, g=hcs−1r−1 can be expressed as a composition of the functions a,b,c.