lean4-htt/src/Lean/Meta/Match
Joachim Breitner 445c8f2ee0
feat: FunInd: more equalities in context, more careful cleanup (#5364)
A round of clean-up for the context of the functional induction
principle cases.

* Already previously, with `match e with | p => …`, functional induction
would ensure that `h : e = p` is in scope, but it wouldn’t work in
dependent cases. Now it introduces heterogeneous equality where needed
(fixes #4146)
* These equalities are now added always (previously we omitted them when
the discriminant was a variable that occurred in the goal, on the
grounds that the goal gets refined through the match, but it’s more
consistent to introduce the equality in any case)
* We no longer use `MVarId.cleanup` to clean up the goal; it was
sometimes too aggressive (fixes #5347)
* Instead, we clean up more carefully and with a custom strategy:
* First, we substitute all variables without a user-accessible name, if
we can.
  * Then, we substitute all variable, if we can, outside in.
* As we do that, we look for `HEq`s that we can turn into `Eq`s to
substitute some more
  * We substitute unused `let`s.
  
**Breaking change**: In some cases leads to a different functional
induction principle (different names and order of assumptions, for
example).
2024-09-16 12:30:12 +00:00
..
MatcherApp feat: FunInd: more equalities in context, more careful cleanup (#5364) 2024-09-16 12:30:12 +00:00
Basic.lean fix: match literal pattern support 2024-02-24 16:08:07 -08:00
CaseArraySizes.lean chore: missing double backticks (#3587) 2024-03-04 03:02:35 +00:00
CaseValues.lean fix: match literal pattern support 2024-02-24 16:08:07 -08:00
Match.lean chore: switch to Std.HashMap and Std.HashSet almost everywhere 2024-08-07 18:24:42 +02:00
MatchEqs.lean chore: switch to Std.HashMap and Std.HashSet almost everywhere 2024-08-07 18:24:42 +02:00
MatchEqsExt.lean fix: do not include internal match equational theorems at simp trace (#4274) 2024-05-25 17:16:19 +00:00
MatcherApp.lean refactor: module MatcherApp.Transform (#3439) 2024-02-22 16:16:26 +00:00
MatcherInfo.lean refactor: generalize addMatcherInfo (#5068) 2024-08-16 06:24:32 +00:00
MatchPatternAttr.lean perf: add prelude to all Lean modules 2024-02-18 14:55:17 -08:00
MVarRenaming.lean perf: add prelude to all Lean modules 2024-02-18 14:55:17 -08:00
Value.lean fix: match literal pattern support 2024-02-24 16:08:07 -08:00