Zulip Chat Archive
Stream: general
Topic: Noob meta question
Chris Hughes (Sep 11 2018 at 12:12):
What's the "correct" way to efficiently implement finitely supported functions in Lean meta. Currently I'm using list (α × β) as α →₀ β, but this seems totally wrong. By finitely supported, I mean functions for which I only care about the result for finitely many α
Reid Barton (Sep 11 2018 at 12:13):
data.rbmap?
Reid Barton (Sep 11 2018 at 12:14):
that's the best way I know of
Sean Leather (Sep 11 2018 at 12:15):
https://github.com/spl/lean-finmap ?
Chris Hughes (Sep 11 2018 at 12:38):
rbmap looks about right. Thanks.
Chris Hughes (Sep 11 2018 at 13:14):
Is there a decidable instance for mem in rbmap anywhere. This seems like something so fundamental that I feel like I must be doing something wrong by trying to use it.
Sean Leather (Sep 11 2018 at 13:15):
I don't think the rbmap theorem collection is very extensive.
Chris Hughes (Sep 11 2018 at 14:08):
I see there's contains, which I assume is the same thing.
Chris Hughes (Sep 11 2018 at 14:15):
There doesn't seem to be an erase either.
Chris Hughes (Sep 11 2018 at 14:49):
Is rbtree α isomorphic to finset α, and is rbmap α β isomorphic to Σ s : finset α, Π x, x ∈ s → β
Last updated: May 02 2025 at 03:31 UTC