Zulip Chat Archive

Stream: Is there code for X?

Topic: appended lists equal of length equal


Joseph Hua (Apr 06 2022 at 14:44):

Does this exist? I want this and the other case too, when the lengths all of them are equal

lemma list.eq_of_eq_append_left {α} (l1 l2 l3 l4: list α) (h12 : l1.length = l2.length)
  (heq : l1.append l3 = l2.append l4) : l1 = l2 := sorry

Yaël Dillies (Apr 06 2022 at 14:45):

docs#list.append_right_cancel should help.

Eric Wieser (Apr 06 2022 at 14:45):

Something like docs#list.append_inj?

Eric Wieser (Apr 06 2022 at 14:46):

Wow, naming convention really pulled through there

Eric Wieser (Apr 06 2022 at 14:47):

docs#list.append_inj_left is precisely your statement, but the one I mention above might be what you actually want

Joseph Hua (Apr 06 2022 at 14:50):

ah perfect, thanks yall

Eric Wieser (Apr 06 2022 at 14:51):

Out of curiosity; would library_search have found this?

Joseph Hua (Apr 06 2022 at 14:56):

library_search timed out on what I wrote

Eric Wieser (Apr 06 2022 at 14:57):

With what imports?

Eric Wieser (Apr 06 2022 at 14:57):

Library search is faster (but less successful) the fewer imports you have

Joseph Hua (Apr 06 2022 at 15:02):

ah makes sense, yeah I have tons of imports and my computer is slowing down even without library search


Last updated: Dec 20 2023 at 11:08 UTC