Zulip Chat Archive

Stream: general

Topic: fin find


Michael Howes (Jun 20 2019 at 04:24):

Suppose that I have a set s : set (fin n) and I know that s is non-empty and that s is a decidable predicate on fin n. Is there a way to produce the least element of s? I was hoping to find something similar to nat.find for fin but haven't come across it yet.

Scott Morrison (Jun 20 2019 at 04:37):

Convert it to a finset, then use finset.sorted to produce a list, then take the head? I don't know of an existing function.

Michael Howes (Jun 20 2019 at 04:51):

How do I do the first conversion?

Johan Commelin (Jun 20 2019 at 04:52):

finset.univ.filter (\lam x, x \in s)??

Michael Howes (Jun 20 2019 at 04:56):

Thanks!

Michael Howes (Jun 21 2019 at 08:03):

I ended up using finset.min'


Last updated: Dec 20 2023 at 11:08 UTC