Zulip Chat Archive
Stream: Is there code for X?
Topic: Inhabited Field
Bolton Bailey (Sep 29 2023 at 17:03):
import Mathlib.FieldTheory.SplittingField.Construction
lemma foo (F) [Field F] (l : List F) : F := l.get! 0
-- failed to synthesize instance Inhabited F
Where can I find an instance of inhabited for Field?
Adam Topaz (Sep 29 2023 at 17:05):
import Mathlib
variable (F : Type*) [Field F]
#synth (Inhabited F)
comes up short for me!
Adam Topaz (Sep 29 2023 at 17:07):
I suppose you could use docs#List.getD instead
Eric Wieser (Sep 29 2023 at 17:17):
I think it would probably be safe to add this, but it wouldn't be safe for Monoid
or AddMonoid
Eric Wieser (Sep 29 2023 at 17:18):
(as if we had both there would be a diamond for Ring
)
Last updated: Dec 20 2023 at 11:08 UTC