Zulip Chat Archive

Stream: Is there code for X?

Topic: list map mem eq injective


Kayla Thomas (Oct 07 2023 at 19:08):

I think it should be possible to prove this

a2: List.map (openVar k v) xs = List.map (openVar k v) xs'
 xs = xs'

given that

lemma OpenVarCloseVarComp
  (x : Var)
  (v : String)
  (k : )
  (h1 : Var.lc_at k x) :
  (openVar k v  closeVar k v) x = x

because OpenVarCloseVarComp implies that openVar k v is injective in a sense, but I'm not sure of the best way to show this. Is there a lemma relating injective functions and maps that would help?

Notification Bot (Oct 07 2023 at 19:09):

This topic was moved here from #Is there code for X? > list map mem eq by Kayla Thomas.

Ruben Van de Velde (Oct 07 2023 at 19:12):

@loogle List.map, Function.Injective

loogle (Oct 07 2023 at 19:12):

:search: List.map_diff, List.map_erase, and 7 more

Ruben Van de Velde (Oct 07 2023 at 19:14):

docs#List.map_injective_iff seems useful

Kayla Thomas (Oct 07 2023 at 19:15):

Thank you.

Kayla Thomas (Oct 07 2023 at 22:38):

Are there any definitions/lemmas in mathlib about a function only being injective under conditions on its domain?

Ruben Van de Velde (Oct 07 2023 at 22:38):

Perhaps docs#Set.InjOn

Kayla Thomas (Oct 07 2023 at 22:41):

Nice. Thank you.


Last updated: Dec 20 2023 at 11:08 UTC