Edit: Adding the task condition: Write in explicit form, choosing a suitable representation, all functions f that are:
a) injections b) surjections c) bijections
and have the following domain and codomain:
- $f:\{1,2,3,4\} \to \{a,b\}$
- $f:\{1,2\} \to \{a,b,c\}$
My struggle comes from not knowing if my solution is right. Here is the injection solution:
$f(1) = a \to (f(2) = b$ or $f(3) = b$ or $f(4) = b)$ or f(1) = b -> (f(2) = a or f(3) = a or f(4) = a)
f(2) = a -> (f(1) = b or f(3) = b or f(4) = b) or f(2) = b -> (f(1) = a or f(3) = a or f(4) = a)
f(3) = a -> (f(1) = b or f(2) = b or f(4) = b) or f(3) = b -> (f(1) = a or f(2) = a or f(4) = a)
f(4) = a -> (f(1) = b or f(2) = b or f(3) = b) or f(4) = b -> (f(1) = a or f(2) = a or f(3) = a)
Wouldn't the surjection solution be the same with the pair of domain and codomain?
You have not listed functions, you have listed conditions that the functions must obey. You should give your functions as ordered pairs or lists of function values. Your solution is for surjective functions, not injective ones, so you should review the definitions. For the first pair there are not many injective ones. One of the surjective ones for the first might be $\{(1,a),(2,b),(3,b),(4,b)\}$