Zulip Chat Archive

Stream: Is there code for X?

Topic: Something like List.forall_unattach


Will Bradley (Mar 13 2025 at 19:28):

Would it be helpful if I added this lemma to Mathlib?

lemma List.forall_unattach {α: Type u} {p: α  Prop} {l: List { x // p x }}:  x  l.unattach, p x := by
  simp [List.unattach, -List.map_subtype]
  intros
  assumption

Or does it already exist somewhere under a different name?

Kim Morrison (Mar 13 2025 at 21:25):

Doesn't seem unreasonable. When I introduced unattach, however, I was hoping that people wouldn't use it! It's meant to be an intermediate form that is always simplified away.

Kim Morrison (Mar 13 2025 at 21:25):

May we need more vigorous warnings in the doc-strings...

Martin Dvořák (Mar 13 2025 at 22:13):

BTW try simp? so that you can replace the nonterminal simp by something more concrete.


Last updated: May 02 2025 at 03:31 UTC