Commit graph

25 commits

Author SHA1 Message Date
Joachim Breitner
b181fd83ef
feat: in conv tactic, use try with_reducibe rfl (#3763)
The `conv` tactic tries to close “trivial” goals after itself. As of
now, it uses
`try rfl`, which means it can close goals that are only trivial after
reducing with
default transparency. This is suboptimal

* this can require a fair amount of unfolding, and possibly slow down
the proof
   a lot. And the user cannot even prevent it.
* it does not match what `rw` does, and a user might expect the two to
behave the
   same.

So this PR changes it to `with_reducible rfl`, matching `rw`’s behavior.

I considered `with_reducible eq_refl` to only solve trivial goals that
involve equality,
but not other relations (e.g. `Perm xs xs`), but a discussion on mathlib
pointed out
that it’s expected and desirable to solve more general reflexive goals:


https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/Closing.20after.20.60rw.60.2C.20.60conv.60.3A.20.60eq_refl.60.20instead.20of.20.60rfl.60/near/429851605
2024-03-29 11:59:45 +00:00
Joachim Breitner
17c7cb0e1c
feat: conv => fun (#3240)
Given a target
```
| f a b
```
the new conv tactic
```
conv => fun
```
turns it into
```
| f a
```
and `arg 0` turns it into
```
| f
```

Fixes #3239
2024-02-18 12:02:25 +00:00
Mario Carneiro
8b0699cd3b fix: disable memoize in pattern conv 2022-12-19 06:21:54 -08:00
Mario Carneiro
52d00e8944
test: macro scopes in Conv.congr (#1955) 2022-12-14 16:43:26 +00:00
Mario Carneiro
1c992fde37 chore: add some tests 2022-09-28 14:24:44 -07:00
Mario Carneiro
b6a58d13e1 fix: LHS goals should be pre-whnf'd 2022-09-28 14:24:44 -07:00
Mario Carneiro
9b9998f5c8 feat: pattern (occs := ...) conv 2022-09-25 19:52:56 -07:00
Sebastian Ullrich
e81ba951c6 fix: Core.transform API and uses 2022-08-25 19:07:42 -07:00
Mario Carneiro
5f39370d94 chore: rename skip conv to rfl and add no-op skip 2022-08-01 13:54:36 -07:00
Jakob von Raumer
d7cb93e9e4 feat: allow conv mode's arg command to access implicit arguments 2022-06-14 16:15:38 -07:00
Jakob von Raumer
033618ad5e fix: indices in conv arg now count arguments with forward dependencies 2022-06-10 18:25:34 -07:00
Leonardo de Moura
04b7924154 chore: fix tests 2021-09-16 10:29:38 -07:00
Leonardo de Moura
d3c487ddbf feat: change lhs and rhs conv tactic semantics
They can now be applied to non binary applications.
2021-09-05 09:29:40 -07:00
Leonardo de Moura
41cfef5bc4 feat: add pattern conv tactic 2021-09-04 18:02:46 -07:00
Leonardo de Moura
53a3831fd5 feat: add apply conv macro 2021-09-03 20:23:15 -07:00
Leonardo de Moura
94bc386fb4 feat: remark goals as conv goals at the end of nested tactic block 2021-09-03 19:52:51 -07:00
Leonardo de Moura
6988560177 feat: apply allGoals (try rfl) at end of conv nested blocks 2021-09-03 19:21:34 -07:00
Leonardo de Moura
e6c9da0fcc feat: add support for implication at congr conv tactic 2021-09-03 18:50:19 -07:00
Leonardo de Moura
44e7033c27 feat: add support for forall_congr at conv 2021-09-03 16:57:15 -07:00
Leonardo de Moura
8a249bddd2 feat: add try rfl at end of convTarget 2021-09-03 08:14:47 -07:00
Leonardo de Moura
18bcc458d0 feat: add 'enter' conv tactic macro 2021-09-03 08:11:37 -07:00
Leonardo de Moura
b5b5ef6fdf feat: add funext conv tactic 2021-09-03 08:00:37 -07:00
Leonardo de Moura
7b8ee8f9d8 feat: add 'change' conv tactic 2021-09-02 19:26:25 -07:00
Leonardo de Moura
4d32f8eb9d feat: add arg conv tactic 2021-09-02 17:43:43 -07:00
Leonardo de Moura
4df9983843 feat: lhs and rhs conv tactics 2021-09-02 15:05:51 -07:00