Zulip Chat Archive
Stream: lean4
Topic: Eq.ndrec vs Eq.rec
François G. Dorais (Sep 09 2021 at 08:13):
I just noticed that both Eq.ndrec and Eq.rec unexpand to "▸" notation:
So it's impossible to tell them apart without disabling the "▸" notation. Is there a way to disable a single notation? Disabling all notations works but it can be hard to read very long terms that way. Is there any other way to tell Eq.ndrec from Eq.rec?
Leonardo de Moura (Sep 09 2021 at 21:36):
I added support for temporarily erasing keyed attributes. It includes appUnexpander, termElab, commandElab, tactic, etc. Example:
theorem ex {i j : Fin n} (h : i = j) : i.val = j.val :=
h ▸ rfl
attribute [-appUnexpander] unexpandEqNDRec
#print ex
/-
theorem ex : ∀ {n : Nat} {i j : Fin n}, i = j → i.val = j.val :=
fun {n} {i j} h => Eq.ndrec rfl h
-/
Last updated: May 02 2025 at 03:31 UTC