Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add refl attribute to Eq.refl #3773

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Init/Prelude.lean
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ inductive Eq : α → α → Prop where
equality type. See also `rfl`, which is usually used instead. -/
| refl (a : α) : Eq a a

attribute [refl] Eq.refl

/-- Non-dependent recursor for the equality type. -/
@[simp] abbrev Eq.ndrec.{u1, u2} {α : Sort u2} {a : α} {motive : α → Sort u1} (m : motive a) {b : α} (h : Eq a b) : motive b :=
h.rec m
Expand Down Expand Up @@ -320,7 +322,7 @@ Because this is in the `Eq` namespace, if you have a variable `h : a = b`,

For more information: [Equality](https://lean-lang.org/theorem_proving_in_lean4/quantifiers_and_equality.html#equality)
-/
theorem Eq.symm {α : Sort u} {a b : α} (h : Eq a b) : Eq b a :=
@[symm] theorem Eq.symm {α : Sort u} {a b : α} (h : Eq a b) : Eq b a :=
h ▸ rfl

/--
Expand Down
2 changes: 0 additions & 2 deletions tests/lean/run/rewrites.lean
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
attribute [refl] Eq.refl

private axiom test_sorry : ∀ {α}, α

-- To see the (sorted) list of lemmas that `rw?` will try rewriting by, use:
Expand Down
Loading