Leonardo de Moura
09ddf76029
feat: simp_all now uses dependent hypotheses for simplification
...
However, it does not simplify them.
closes #1194
2022-06-06 18:31:34 -07:00
Leonardo de Moura
5055855637
feat: improve default simp discharge method
...
closes #1193
2022-06-06 17:29:12 -07:00
Leonardo de Moura
c9c9b8d835
chore: avoid code duplication
2022-06-06 15:53:40 -07:00
Leonardo de Moura
9d6b67eae2
fix: remove check from Simp.synthesizeArgs
...
Some `simp` dischargers can handle metavariables (e.g,
`assumption`). See new test.
closes #1184
2022-06-03 07:40:30 -07:00
Leonardo de Moura
3be437cad3
fix: make sure register_simp_attr declares an simp-like attribute parser for user simp attributes
...
closes #1164
2022-05-26 19:49:33 -07:00
Leonardo de Moura
eac83586c6
chore: remove leftover
2022-04-29 09:10:27 -07:00
Leonardo de Moura
c959c80310
chore: reset local context at correct place
2022-04-29 09:08:44 -07:00
Leonardo de Moura
47b379e1bc
feat: dsimp! tactic
2022-04-23 18:41:04 -07:00
Leonardo de Moura
342a26a023
feat: dsimp tactic
2022-04-23 18:05:18 -07:00
Leonardo de Moura
13bcbe91cd
fix: regression reported at issue #1113
...
see issue #1113
2022-04-23 15:39:04 -07:00
Leonardo de Moura
875bf9bf34
fix: apply dsimp at lambda binders
...
This fixes another regression reported at #1113
2022-04-22 13:10:21 -07:00
Leonardo de Moura
c13ed7c0de
fix: regression reported at #1113
...
See #1113
2022-04-22 11:43:58 -07:00
Leonardo de Moura
d1f10a2e71
feat: apply rfl theorems at dsimp
...
closes #1113
2022-04-21 16:26:57 -07:00
Leonardo de Moura
2a0dc1804b
feat: improve isRflProof and isRflTheorem
...
The `Eq.symm` of a `rfl` theorem is a `rfl` theorem, the application
of `rfl` theorem too.
2022-04-21 15:40:38 -07:00
Leonardo de Moura
57c3114875
fix: simpAll and tests
...
We need another `update stage0` to remove workaround at `AC.lean`
2022-04-21 15:00:07 -07:00
Leonardo de Moura
da33347e9d
fix: use defauld reducibility setting at mkImpDepCongrCtx and mkImpCongrCtx
2022-04-21 14:55:29 -07:00
Leonardo de Moura
f891c5724d
feat: track rfl simp theorems
...
See issue #1113
We need update stage0 before closing the issue.
2022-04-21 13:42:04 -07:00
Leonardo de Moura
4848ad4869
feat: implement autoUnfold at simp
...
Right now, it only supports the following kind of definitions
- Recursive definitions that support smart unfolding.
- Non-recursive definitions where the body is a match-expression. This
kind of definition is only unfolded if the match can be reduced.
2022-04-18 16:51:52 -07:00
Leonardo de Moura
e49179c807
fix: simp at local declaration should not create an auxiliary declaration when result is definitionally equal
2022-04-11 07:54:15 -07:00
Leonardo de Moura
fb64a4ccc0
fix: unfold should not create an auxiliary declaration when result is definitionally equal
...
This commit fixes an issue reported on Zulip
https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/Unfolding.20the.20type.20of.20a.20variable.20creates.20a.20new.20variable
2022-04-11 07:54:15 -07:00
Leonardo de Moura
099fba43d3
chore: remove trace[Meta.debug] leftovers
2022-04-08 06:49:09 -07:00
Leonardo de Moura
a06cd40e29
feat: improve match expression support at simp
2022-03-28 17:17:01 -07:00
Leonardo de Moura
321d6b0e67
feat: support for user-defined simp attributes in the simp tactic.
...
See `RELEASES.md`
TODO: make sure `-thm` also removes `thm` from user-defined simp attributes.
2022-03-20 18:45:57 -07:00
Leonardo de Moura
38a1675c72
fix: dicrimination tree getMatchWithExtra
...
It was buggy when the input argument could be reduced `e`.
fixes #1048
2022-03-17 16:44:38 -07:00
Leonardo de Moura
86fc089e07
fix: tryAutoCongrTheorem? may still use dsimp for fixed arguments
...
Reviewed-by: Leonardo de Moura <leonardo@microsoft.com>
2022-03-14 14:04:28 -07:00
Leonardo de Moura
272dd5533f
chore: style use · instead of . for lambda dot notation
...
We are considering removing `.` as an alternative for `·` in the
lambda dot notation (e.g., `(·+·)`).
Reasons:
- `.` is not a perfect replacement for `·` (e.g., `(·.insert ·)`)
- `.` is too overloaded: `(f.x)` and `(f .x)` and `(f . x)`. We want to keep the first two.
2022-03-11 07:49:03 -08:00
Leonardo de Moura
f306c9b69b
fix: split tactic
...
`unreachable!` assertions at `simpIfLocalDecl` and
`simpTargetLocalDecl` were reachable.
2022-03-03 18:13:34 -08:00
Leonardo de Moura
4e310ac63d
feat: improve SimpTheorem preprocessor
2022-02-28 18:27:36 -08:00
Leonardo de Moura
89f88b1caa
feat: simplify nested arith expressions
2022-02-27 09:01:52 -08:00
Leonardo de Moura
ff76958959
feat: basic support for linear Nat arithmetic at simp
2022-02-26 08:58:32 -08:00
Leonardo de Moura
0681d818ec
chore: add helper function for simp
2022-02-25 16:42:41 -08:00
Leonardo de Moura
43c2169f78
fix: when performing contextual simplification, and arrow may become a dependent arrow
...
fixes #1024
2022-02-23 18:43:32 -08:00
Leonardo de Moura
07d1ec1926
fix: simp_all was "self-simplifying" simplified hypotheses
...
fixes #1027
2022-02-23 16:48:28 -08:00
Leonardo de Moura
33b1d2fd98
fix: preserve arrow binder names and info at simp
...
We use the idiom `revert; simp; ...; intro` in a few places. Some of
the reverted hypotheses manifest themselves as arrows in the target.
Before this commit, `simp` would lose the binder names and info when
simplifying an arrow, and we would get inaccessible names when
reintroducing them.
2022-02-20 16:27:40 -08:00
Leonardo de Moura
c1777c17e3
feat: add simpTargetStar
2022-02-08 11:43:45 -08:00
Leonardo de Moura
824d0aa8a5
chore: remove leftover
2022-02-08 11:43:45 -08:00
Leonardo de Moura
a9bb646d4f
chore: cleanup
2022-02-07 17:35:07 -08:00
Leonardo de Moura
8d7f0ea2f2
feat: add removeUnnecessaryCasts
...
see #988
2022-02-07 17:24:32 -08:00
Leonardo de Moura
9d34d9bc5a
feat: cache and optimize mkCongrSimp? at simp
...
see #988
2022-02-07 17:01:21 -08:00
Leonardo de Moura
007f0e1d71
feat: use mkCongrSimp? at simp
...
TODO: cache auto generated congr theorems, and `removeUnnecessaryCasts`
see #988
2022-02-07 16:45:01 -08:00
Leonardo de Moura
93bd4a7f88
chore: lemma => thm
2022-02-07 13:55:23 -08:00
Leonardo de Moura
9c2942c36d
chore: "simp lemma" => "simp theorem"
2022-02-06 09:15:39 -08:00
Leonardo de Moura
d6dc077c86
refactor: CongrLemma => SimpCongrTheorem
2022-02-06 09:15:39 -08:00
Leonardo de Moura
96bae46045
refactor: SimpLemma => SimpTheorem
2022-02-06 09:15:39 -08:00
Leonardo de Moura
12e2a79170
chore: fix codebase after removing auto pure
2022-02-03 18:08:14 -08:00
Leonardo de Moura
c30380e2fa
feat: lift the restriction in congr theorems that all function arguments on the lhs must be free variables
...
see #988
2022-02-02 18:23:18 -08:00
Leonardo de Moura
101fc12b54
feat: partially applied user congruence lemmas
...
see #988
2022-02-02 17:41:21 -08:00
Leonardo de Moura
cb4a86ac68
fix: do not validate local eq theorems
...
see #973
2022-01-27 11:50:20 -08:00
Leonardo de Moura
a63163e992
feat: do not try to discharge hypotheses at simp when type contains assignable metavariables
...
closes #973
see https://github.com/leanprover-community/mathport/issues/70
2022-01-26 17:57:52 -08:00
Leonardo de Moura
8db923e010
feat: generate error message for simp theorems that are equivalent to x = x
...
see #973
see https://github.com/leanprover-community/mathport/issues/70
2022-01-26 11:16:31 -08:00