logoalt Hacker News

troetheyesterday at 9:53 PM2 repliesview on HN

While the proposed fix of requiring "either that A be inhabited or that B be uninhabited" works, it seems tacked on just to solve this particular edge-case.

I think a more elegant solution would be to soften the definition of a left inverse from a function `g: B -> A` to a function `g: f(A) -> A` where `f(A)` is the subset of elements in `B`, that actually get mapped to by `f` or in the words of the book's function definition, the set of "right" elements in `f`.

This solves the edge-case too, as `f(A) = f({}) = {}` and there exists (exactly one) function `g: {} -> {}`, which also trivially is a left inverse of `f`.

The real problem here was, that the statement `g: B -> A` needlessly required `g` to map back elements in B to A, that couldn't even be produced by `f` and should therefore be irrelevant for a left inverse.


Replies

ndriscollyesterday at 10:03 PM

That's basically saying you'll just take all functions to be surjective though, and it's stronger than you really need; the non-surjective case works fine for non-empty A.

You could of course interpret some of these basic theorems as saying "well I'd might as well take my function to be surjective since the 'meat' is that case." Much like you could just take all functions to be injective by modding out the kernel since that's the real "meat." And indeed one might interpret the first isomorphism theorem as saying exactly those two things: the isomorphism A/ker f = im f is "the real substance of the map f."

show 1 reply
ajkjkyesterday at 10:37 PM

I think a slightly better fix is to change definitions to allow g = { (1, {}) } to be regarded as a left-inverse to g, that is, to allow left-inverses to be partial functions, rather than full functions. The definition still requires they be defined on the image of f, but no choices have to be made on the complement of the image. Probably this breaks some other definitions but it seems intuitively correct to me. It keeps the structure that function B->A could be a left inverse and then only some of them are, rather than limiting them to the functions which are defined only on image(f).

This is kinda nice also because it means that for e.g. the function (a,b) -> (1, 2) given by f(a) = 1, f(b) = 1, you don't need its left inverse to specify that g(2) = a or b, but instead you can have g(2) = {} which doesn't require making any non-canonical choices.

(I'm too sleepy atm to think through this in detail. I might regret this proposal after a nap)

show 1 reply