3 ms·
Certainly the author is correct in the sense of "1 to 1" that just means "function" (`map` is a function, in the sense that `map f = map g` whenever `f = g`); a
by JadeNB 7y ago
Certainly the author is correct in the sense of "1 to 1" that just means "function" (`map` is a function, in the sense that `map f = map g` whenever `f = g`); and even in the sense of "1 to 1" that means "injective" (if `map f = map g`, then `f = g`, at least extensionally), so there's no formal sense in which the author is wrong; but I still think that the sense in which the author is right is not the intended sense.
Namely, consider, to take a silly example, a function like `f x = [x, x^2 + 3]`. (I'll use Haskell notation throughout, since I'm comfortable with it.) In the formal sense this is still a function, since it produces one output, which happens to be a length-2 list, for each input; but one may also informally regard it as a one-to-two relation, in the sense that `x` is left-related to `x` but also to `x^2 + 3`.
OK, so still it is true that `length $ map f [1, 2, 3] == 3`; but there's also a sense in which `map f [1, 2, 3]`, which equals `[[1, 4], [2, 7], [3, 12]]`, wants to have length 6. This is so in the sense that `concatMap f [1, 2, 3]`, which equals `[1, 4, 2, 7, 3, 12]`, does have length 6.
Thus, although, again, there is no technical sense in which it is wrong to say what the author does, nonetheless, in the informal and intuitive sense, I think it is better to say that the "1-to-1-ness" (which I would prefer to call "function-ness") of `map f` is a property of `f`, or at least of how we choose to use `f`, not of `map` itself. But, again, I emphasise that I think this; though I have made a case for it, a big chunk of that case is personal preference, and so cannot, I think, be regarded as conclusively right or conclusively wrong—although I think it makes it easier to communicate with mathematicians, for whatever that's worth.