Zulip Chat Archive
Stream: general
Topic: Tactic for simplifying equations involving constructors
Jannis Limperg (May 13 2020 at 20:23):
I'm currently working on a reimplementation of induction
in Lean with some additional features. As part of the implementation, I'll need a tactic that simplifies equations involving constructors of inductive types. For instance:
- For
h : x = y
wherex
andy
are defeq: clearh
. - For
h : x = y
wherex
is a variable: substituteh
(and similar wheny
is a variable). - For
h : C x1 ... xn = C y1 ... yn
whereC
is a constructor: apply injectivity ofC
. - For
h : C ... = D ...
whereC
andD
are different constructors: apply no-confusion. - For
h : x == y
where the types ofx
andy
are defeq: concludex = y
.
Is there already something like this? (This could also be interesting for the dependent congr
discussion.)
Kenny Lau (May 13 2020 at 20:27):
cases
Jannis Limperg (May 13 2020 at 20:32):
Sure. I'll have to check what exactly cases
does in each of these cases. But I probably can't blindly cases
on just any equation, right?
Kenny Lau (May 13 2020 at 20:37):
it pretty much does all 5 of your requirements
Mario Carneiro (May 13 2020 at 20:37):
cases
indeed does most of these things
Jannis Limperg (May 13 2020 at 20:44):
Okay nice, then I'll just have to scan for hypotheses of these forms. This may be easier than anticipated. Thanks!
Last updated: Dec 20 2023 at 11:08 UTC