Zulip Chat Archive

Stream: Is there code for X?

Topic: finite domain -> finsupp


Joseph Hua (Dec 16 2021 at 12:49):

I'm wondering if there's already something for

/-- converts map from fin n to same map with finite support -/
def finsupp_of_fin_dom {A : Type*} [has_zero A] {n : }
  (f : fin n  A) :
  fin n →₀ A :=
finsupp.on_finset finset.univ f (λ a h, finset.mem_univ _)

I guess his could be more generally for a map from a fintype?

Eric Wieser (Dec 16 2021 at 12:56):

docs#finsupp.equiv_fun_on_fintype

Joseph Hua (Dec 16 2021 at 13:22):

yay thanks!


Last updated: Dec 20 2023 at 11:08 UTC