Problem: "Let A be an infinite set. Let us consider the set of functions and the operation of function composition. Do they form a semigroup? A monoid? A group? Does the right cancellation law hold? What about the left cancellation law? And what happens if we consider the set of all function from A to A instead of the set of surjective functions?"
a) To prove that the set is a semigroup, we must show that associativity takes place, so:
Let's transform both sides to prove it.
b) Monoid is a semigroup with an indentity element.
The identity element is a function because for all functions
c) Group
This set is not a group because there exist functions with no inverse element. For example, let us consider quadratic function:
Function g can be the inverse element only if f is bijective.
d) Left cancellation property
Definition: An element a in a magma (M,*) has the left cancellation property (or is left-cancellative) if for all b and c in M, a * b = a * c always implies b = c.
Let us consider
The counterexample here is again the quadratic function
For all arguments f(g(x)) = f(h(x)) but it does not imply g(x) = h(x)
d) Right cancellation property
Definition: An element a in a magma (M,*) has the right cancellation property (or is right-cancellative) if for all b and c in M, b *a = c * a always implies b = c.
This is true.
e)
If we consider a set of all function from A to A, the right cancellation property does not hold: