lean4-htt/src/Init
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
..
Control feat: adjust simp attributes on monad lemmas (#5464) 2024-09-25 10:21:18 +00:00
Data feat: adjust simp attributes on monad lemmas (#5464) 2024-09-25 10:21:18 +00:00
Grind feat: add grind core module (#4249) 2024-05-22 03:50:36 +00:00
Omega chore: update copyrights (#5449) 2024-09-24 05:27:53 +00:00
System feat: support for secure temporary files (#5125) 2024-08-22 13:01:40 +00:00
BinderPredicates.lean chore: upstream set notation (#3339) 2024-02-15 02:08:45 +00:00
ByCases.lean chore: cleaning up redundant simp lemmas (#5381) 2024-09-18 10:06:29 +00:00
Classical.lean chore: fix spelling mistakes in src/Init/ (#5427) 2024-09-23 21:09:58 +00:00
Coe.lean fix: make Lean.Internal.liftCoeM and Lean.Internal.coeM unfold (#3404) 2024-02-27 22:17:46 +00:00
Control.lean
Conv.lean feat: let unfold do zeta-delta reduction of local definitions (#4834) 2024-09-07 21:48:08 +00:00
Core.lean refactor: back rfl tactic primarily via apply_rfl (#3718) 2024-09-25 10:34:42 +00:00
Data.lean chore: remove (syntactically) duplicate imports (#5437) 2024-09-23 23:07:56 +00:00
Dynamic.lean chore: snake-case attributes (part 2) 2022-10-19 09:28:08 -07:00
Ext.lean feat: add [ext] attribute to Array.ext (#4970) 2024-08-09 12:40:39 +00:00
GetElem.lean fix: must not reduce ite in the discriminant of match-expression when reducibility setting is .reducible (#5419) 2024-09-23 12:26:53 +00:00
Grind.lean feat: add grind core module (#4249) 2024-05-22 03:50:36 +00:00
Guard.lean feat: upstream guard_expr (#3297) 2024-02-11 23:25:04 +00:00
Hints.lean
MacroTrace.lean chore: reorganising to reduce imports (#3790) 2024-03-27 11:15:01 +00:00
Meta.lean chore: remove repeated words (#5438) 2024-09-24 03:40:11 +00:00
MetaTypes.lean feat: expose index option to dsimp tactic (#5071) 2024-08-19 07:57:16 +00:00
Notation.lean chore: cleanup after export Bool.and/or/not/xor 2024-09-16 12:45:51 +10:00
NotationExtra.lean feat: PProd syntax (part 3) (#4756) 2024-07-16 21:06:04 +00:00
Omega.lean chore: update copyrights (#5449) 2024-09-24 05:27:53 +00:00
Prelude.lean chore: cleanup of Array docstrings after refactor (#5458) 2024-09-24 23:16:49 +00:00
PropLemmas.lean feat: more List.findIdx theorems (#5300) 2024-09-11 04:53:59 +00:00
RCases.lean doc: typo in rcases docs (#3796) 2024-03-28 07:31:01 +00:00
ShareCommon.lean refactor: sharecommon (#4887) 2024-07-31 19:13:12 +00:00
SimpLemmas.lean chore: cleaning up redundant simp lemmas (#5381) 2024-09-18 10:06:29 +00:00
Simproc.lean chore: fix simproc doc-string (#3800) 2024-03-28 17:54:52 +00:00
SizeOf.lean doc: documentation for Init.SizeOf 2022-08-17 14:48:10 -07:00
SizeOfLemmas.lean chore: don't use simp_arith when simp will do (#5256) 2024-09-04 07:56:25 +00:00
System.lean feat: Mutex, Condvar 2022-09-05 08:52:46 -07:00
Tactics.lean refactor: back rfl tactic primarily via apply_rfl (#3718) 2024-09-25 10:34:42 +00:00
TacticsExtra.lean feat: incremental next and tactic if (#4459) 2024-06-18 12:36:59 +00:00
Util.lean feat: add some low level helper APIs (#4778) 2024-07-17 20:12:05 +00:00
WF.lean chore: variables appearing on both sides of an iff should be implicit (#5254) 2024-09-04 08:33:24 +00:00
WFTactics.lean chore: fix spelling mistakes in src/Init/ (#5427) 2024-09-23 21:09:58 +00:00