Zulip Chat Archive

Stream: Is there code for X?

Topic: s equiv s.to_finset


Eric Rodriguez (Apr 28 2022 at 10:05):

do we really not have:

example {a} {s : set a} [fintype s] : s.to_finset  s

Yaël Dillies (Apr 28 2022 at 10:10):

The correct thing to ask for is

def finset.coe_equiv {α : Type*} (s : finset α) : (s : set α)  s := equiv.refl _

Eric Rodriguez (Apr 28 2022 at 10:12):

but I want to make an equiv from docs#simple_graph.edge_finset to its edge_set

Yaël Dillies (Apr 28 2022 at 10:15):

Then you can compose that with docs#equiv.subtype_equiv_prop (whose name is very hard to guess :thinking:)

example {a} {s : set a} [fintype s] : s.to_finset  s :=
(finset.coe_equiv _).symm.trans $ equiv.subtype_equiv_prop s.coe_to_finset

Yaël Dillies (Apr 28 2022 at 10:15):

Because finset.coe_equiv is refl, I guess you can use equiv.subtype_equiv_prop s.coe_to_finset directly.


Last updated: Dec 20 2023 at 11:08 UTC