Zulip Chat Archive

Stream: new members

Topic: HInv?


Ben Selfridge (Mar 07 2025 at 18:49):

Is there a heterogeneous inverse type? I expected to find HInv along with HPow, but I could not find one.

Yakov Pechersky (Mar 07 2025 at 18:52):

How would that work, given that inv is a unary function? What would be heterogenous about it?

Aaron Liu (Mar 07 2025 at 18:55):

Takes an α, returns a β

Yakov Pechersky (Mar 07 2025 at 18:57):

And the return type would be inferred from the context? I think even for HFoo binary functions, the return type is usually constrained by the two input types.

Ben Selfridge (Mar 07 2025 at 19:01):

Ah, that makes sense. I figured if it didn't exist, there would have to be a reason.

Ben Selfridge (Mar 07 2025 at 19:03):

It could work if there were a way to encode functional dependencies or open type families in Lean, but I'm not sure if there is.

Yakov Pechersky (Mar 07 2025 at 19:14):

Functional dependencies is approximated by outParam

Yakov Pechersky (Mar 07 2025 at 19:14):

but then you might as well have a plain Inv X and then Coe X Y

Ben Selfridge (Mar 07 2025 at 19:24):

Oh, maybe I will try that then. I just want nice notation for the inverse of an isomorphism.

Ben Selfridge (Mar 07 2025 at 19:26):

(with an isomorphism type i'm custom defining for my own purposes)

Eric Wieser (Mar 07 2025 at 19:31):

That's a nice example where a Coe wouldn't work

Ben Selfridge (Mar 07 2025 at 19:48):

Why wouldn't that work?


Last updated: May 02 2025 at 03:31 UTC