This PR refactors the 'ext' attribute and implements the following features: - The 'local' and 'scoped' attribute kinds are now usable. - The attribute realizes the `ext`/`ext_iff` lemmas when they do not already exist, rather than always generating them. This is useful in conjunction with `@[local ext]`. - Adding `@[ext]` to a user ext lemma now realizes an `ext_iff` lemma as well; formerly this was only for structures. The name of the generated `ext_iff` theorem for a user `ext` theorem named `A.B.myext` is `A.B.myext_iff`. If this process leads to an error, the user can write `@[ext (iff := false)]` to disable this feature. Breaking changes: - Now the "x" and "y" term arguments to the realized `ext` and `ext_iff` lemmas are implicit. - Now the realized `ext` and `ext_iff` lemmas are protected. Bootstrapping notes: - There are a few `ext_iff` lemmas to address after the next stage0 update. Closes https://github.com/leanprover/lean4/issues/3643 Suggested by Floris [on Zulip](https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/.22Missing.20Tactics.22.20list/near/446267660).
7 lines
191 B
Text
7 lines
191 B
Text
example (h : m = n) : (Fin.mk m h₁ : Fin k) = Fin.mk n h₂ := by
|
|
apply (Fin.ext_iff ..).2
|
|
exact h
|
|
|
|
example (h : m = n) : (Fin.mk m h₁ : Fin k) = Fin.mk n h₂ := by
|
|
simp
|
|
exact h
|