a plus f x + x times y * x
=
(a(plus(f(x)))) + (x(times(y)) * x) -- That's not confusing... at all.
3 4 + 5 + 6 -- Doesn't evaluate because 3(4) is not well defined.
=
(3(4) + (5)) + (6)
2^2^2^2
=
2^(2^(2^2))
Problem 2.
Let be functions such that for some sets Define
The domain of is the domain of , which in turn is the domain of , which is equal to . Similarly, the domain of is equal to the domain of , which is . So and share domains.
The codomain of is equal to the codomain of , which is . Similarly, the codomain of is equal to the codomain of , which is equal to the codomain of , which is equal to . So and share codomains.
Then, let us consider an element and where and send it.
As such, and composition is associative.
Problem 3.
Define as the concat operator. This is associative, which follows from an inductive proof. Consider to be lists, and induct on the length of . It is not commutative since , and its identity element is equal to the empty list . This does not have a zero element. In this way concatenation over a consistent type forms a free monoid.
Problem 4.
map double [3, 7, 4, 2] = [6, 14, 8, 4]
map (double.double) [3, 7, 4, 2] = [12, 28, 16, 8]
map double [] = [].
sum . map double = double . sum -- True, as the integers are a commutative ring
sum . map sum = sum . concat -- True, assuming type [[Integer]]
sum . sort = sum -- True as addition is commutative in the integers