Zulip Chat Archive

Stream: general

Topic: subtypes v sets


view this post on Zulip Kevin Buzzard (Mar 04 2018 at 00:59):

I have U : set alpha and I want to make a Pi type which morally is \Pi P : U, (some function of P)

view this post on Zulip Kevin Buzzard (Mar 04 2018 at 01:00):

I went for \Pi P : {u : alpha // U u}, ...

view this post on Zulip Kevin Buzzard (Mar 04 2018 at 01:01):

and now I am constantly running into v \in U which I want to do my Pi
stuff to

view this post on Zulip Kevin Buzzard (Mar 04 2018 at 01:05):

meh I guess I just shouldn't be considering "elements of U" I should just be avoiding the set notation completely now

view this post on Zulip Andrew Ashworth (Mar 04 2018 at 01:37):

if you want to stay with sets, you could use the set image lemmas

view this post on Zulip Andrew Ashworth (Mar 04 2018 at 01:40):

but definitely type theory notation is more natural to work in

view this post on Zulip Mario Carneiro (Mar 04 2018 at 06:56):

I have U : set alpha and I want to make a Pi type which morally is \Pi P : U, (some function of P)

Did you actually try \Pi P : U, (some function of P)? That should work because of coercions

view this post on Zulip Kevin Buzzard (Mar 04 2018 at 12:17):

No I didn't :-) I know that if I'd tried this, I would have ended up not knowing what the type of P actually was, at least initially. Probably what you're saying is that if I'd tried it, it would have unfolded into what I actually used. More and more I am deciding not to use coercions or type classes because I realise that rather than using them and then struggling later it is easier for me to just do all the work myself. I guess what I'm saying is that initially things like coercions and the type class system were complete mysteries to me and I could see them working in simple cases and failing in more complex ones and didn't really understand enough to know how to make them work for me. Now I've decided to do all coercions myself, and of course now I understand what's going on much better. The next phrase will be me attempting to use these tools again, but this time knowing how to use them properly.

view this post on Zulip Chris Hughes (Mar 04 2018 at 14:38):

@Kevin Buzzard I just wrote some docs about this, which I PRed to your WIP docs.

view this post on Zulip Patrick Massot (Mar 04 2018 at 17:33):

@Chris Hughes your doc on set-like stuff is awesome. I added some comments (but I guess Kevin needs to allow them before you can see them). Then I think this should go straight to mathlib in the theories folder (with a link in https://github.com/leanprover/mathlib/blob/master/docs/theories.md)

view this post on Zulip Chris Hughes (Mar 04 2018 at 19:11):

The main downside I can see to the Pi version, is if you ever wanted to prove the function is injective or has an inverse. No idea if you'd ever want to do that.

view this post on Zulip Kevin Buzzard (Mar 04 2018 at 20:45):

In my context I don't think I'll ever want to do this.


Last updated: May 13 2021 at 21:12 UTC