Zulip Chat Archive
Stream: Is there code for X?
Topic: pi.nonempty
Yaël Dillies (Apr 26 2022 at 20:56):
Do we really not have this?
instance {α : Type*} {β : α → Type*} [Π a, nonempty (β a)] : nonempty (Π a, β a) :=
⟨λ _, classical.arbitrary _⟩
instance pi.nonempty_of_empty {α : Type*} {β : α → Type*} [is_empty α] : nonempty (Π a, β a) :=
⟨is_empty_elim⟩
Mario Carneiro (Apr 26 2022 at 20:58):
I thought something like that was in the classical file
Yaël Dillies (Apr 26 2022 at 20:58):
Ah! docs#classical.nonempty_pi
Yaël Dillies (Apr 26 2022 at 20:59):
Why is it not an instance? Performance reasons?
Eric Wieser (Apr 26 2022 at 22:00):
It's probably not there because a stronger statement is possible, docs#pi.unique_of_is_empty?
Yaël Dillies (Apr 26 2022 at 22:02):
Oh right. But why is the first one not an instance?
Mario Carneiro (Apr 26 2022 at 23:41):
it might be undesirable to use choice totally implicitly like this
Mario Carneiro (Apr 26 2022 at 23:41):
we don't do it for classical.prop_decidable either
Eric Wieser (Apr 26 2022 at 23:43):
prop_decidable
would be a lot more contentious as it's not only choice
but noncomputable
Eric Wieser (Apr 26 2022 at 23:44):
But I agree, that probably is the reason
Mario Carneiro (Apr 26 2022 at 23:45):
nonempty (decidable p)
would be pretty similar
Last updated: Dec 20 2023 at 11:08 UTC