lean4-htt/tests
Joachim Breitner a3ca15d2b2
refactor: back rfl tactic primarily via apply_rfl (#3718)
building upon #3714, this (almost) implements the second half of #3302.

The main effect is that we now get a better error message when `rfl`
fails. For
```lean
example : n+1+m = n + (1+m) := by rfl
```
instead of the wall of text
```
The rfl tactic failed. Possible reasons:
- The goal is not a reflexive relation (neither `=` nor a relation with a @[refl] lemma).
- The arguments of the relation are not equal.
Try using the reflexivity lemma for your relation explicitly, e.g. `exact Eq.refl _` or
`exact HEq.rfl` etc.
n m : Nat
⊢ n + 1 + m = n + (1 + m)
```
we now get
```
error: tactic 'rfl' failed, the left-hand side
  n + 1 + m
is not definitionally equal to the right-hand side
  n + (1 + m)
n m : Nat
⊢ n + 1 + m = n + (1 + m)
```

Unfortunately, because of very subtle differences in semantics (which
transparency setting is used when reducing the goal and whether the
“implicit lambda” feature applies) I could not make this simply the only
`rfl` implementation. So `rfl` remains a macro and is still expanded to
`eq_refl` (difference transparency setting) and `exact Iff.rfl` and
`exact HEq.rfl` (implicit lambda) to not break existing code. This can
be revised later, so this still closes: #3302.

A user might still be puzzled *why* to terms are not defeq. Explaining
that better (“reduced to… and reduces to… etc.”) would also be great,
but that’s not specific to `rfl`, so better left for some other time.
2024-09-25 10:34:42 +00:00
..
bench chore: notation ^^ for Bool.xor (#5332) 2024-09-18 08:59:11 +00:00
compiler chore: fix spelling mistakes in tests (#5439) 2024-09-24 03:22:53 +00:00
elabissues
ir
lean refactor: back rfl tactic primarily via apply_rfl (#3718) 2024-09-25 10:34:42 +00:00
pkg chore: fix spelling mistakes in tests (#5439) 2024-09-24 03:22:53 +00:00
playground chore: fix spelling mistakes in tests (#5439) 2024-09-24 03:22:53 +00:00
plugin chore: when a linter crashes, prefix its name (#4967) 2024-08-12 02:36:42 +00:00
simpperf
.gitignore
common.sh
lean-toolchain