Zulip Chat Archive
Stream: general
Topic: show struct equality
Leonard Wiechmann (Nov 17 2021 at 14:29):
sorry, this seems super simple, but I can't figure out how to show struct (prod) equality.
surely it's just field-wise equality. split doesn't work.
how do I split the goal from a = b
into a.fst = b.fst ∧ a.snd = b.snd
?
Alex J. Best (Nov 17 2021 at 14:32):
Normally we just use an (autogenerated) lemma for this, e.g. docs#prod.ext_iff
Alex J. Best (Nov 17 2021 at 14:34):
(ok maybe its not autogenerated as often as I thought!)
Leonard Wiechmann (Nov 17 2021 at 14:37):
I suspected that it might be prod.ext
, but got an unknown identifier error.
adding import data.prod
fixed it :face_palm:🏻♀️ thanks!
Floris van Doorn (Nov 17 2021 at 14:44):
tactic#ext is also useful.
Floris van Doorn (Nov 17 2021 at 14:45):
link that works: https://leanprover-community.github.io/mathlib_docs/tactics.html#ext1%20/%20ext
Last updated: Dec 20 2023 at 11:08 UTC