Zulip Chat Archive
Stream: Is there code for X?
Topic: Subset relation for Finmap
Ka Wing Li (Jul 21 2025 at 06:30):
Is there any relation like for finite map ?
Kenny Lau (Jul 21 2025 at 06:32):
@Ka Wing Li there are only 117 declarations about Finmap, and i'm afraid none of them is about an ordering - but you can define one easily!
Kenny Lau (Jul 21 2025 at 06:37):
import Mathlib.Data.Finmap
namespace Finmap
variable {α : Type*} {i : α → Type*}
instance : PartialOrder (Finmap i) :=
PartialOrder.lift entries fun _ _ ↦ ext
lemma le_def (x y : Finmap i) : x ≤ y ↔ x.entries ⊆ y.entries :=
Multiset.le_iff_subset x.nodup_entries
end Finmap
Ka Wing Li (Jul 21 2025 at 15:38):
Thanks! I get the idea of how to define relations.
Last updated: Dec 20 2025 at 21:32 UTC