Zulip Chat Archive

Stream: general

Topic: subset of a subtype


Scott Morrison (Sep 03 2019 at 10:42):

Does anyone know if this is already in the library?

/-- A subset of a subtype can be thought of as a subset of the type. -/
def set_of_subtype_set {α : Type*} {P : α → Prop} (x : set {a : α // P a}) : set α :=
{a : α | ∃ (h : P a), (⟨a,h⟩ : {a : α // P a}) ∈ x}

Sebastien Gouezel (Sep 03 2019 at 10:46):

Isn't it just subtype.val '' x?

Chris Hughes (Sep 03 2019 at 10:46):

subtype.val '' x is what I write when I want that thing. Not the most obvious way of thinking about it.

Chris Hughes (Sep 03 2019 at 10:46):

But it is automatically a subgroup or whatever else you might want.

Scott Morrison (Sep 03 2019 at 10:50):

Thank you! :-) :embarrassed:


Last updated: Dec 20 2023 at 11:08 UTC