feat(library/rename): add notation for rename
This commit is contained in:
parent
a311f05add
commit
f7deabfd19
2 changed files with 11 additions and 1 deletions
|
@ -58,6 +58,8 @@ opaque definition unfold (e : expr) : tactic := builtin
|
||||||
opaque definition exact (e : expr) : tactic := builtin
|
opaque definition exact (e : expr) : tactic := builtin
|
||||||
opaque definition trace (s : string) : tactic := builtin
|
opaque definition trace (s : string) : tactic := builtin
|
||||||
|
|
||||||
|
notation a `↦` b := rename a b
|
||||||
|
|
||||||
inductive expr_list : Type :=
|
inductive expr_list : Type :=
|
||||||
nil : expr_list,
|
nil : expr_list,
|
||||||
cons : expr → expr_list → expr_list
|
cons : expr → expr_list → expr_list
|
||||||
|
|
|
@ -1,10 +1,18 @@
|
||||||
import tools.tactic logic
|
import tools.tactic logic
|
||||||
open tactic
|
open tactic
|
||||||
|
|
||||||
theorem foo (A : Type) (a b c : A) (Hab : a = b) (Hbc : b = c) : a = c :=
|
theorem foo1 (A : Type) (a b c : A) (Hab : a = b) (Hbc : b = c) : a = c :=
|
||||||
begin
|
begin
|
||||||
apply eq.trans,
|
apply eq.trans,
|
||||||
rename Hab Foo,
|
rename Hab Foo,
|
||||||
apply Foo,
|
apply Foo,
|
||||||
apply Hbc,
|
apply Hbc,
|
||||||
end
|
end
|
||||||
|
|
||||||
|
theorem foo2 (A : Type) (a b c : A) (Hab : a = b) (Hbc : b = c) : a = c :=
|
||||||
|
begin
|
||||||
|
apply eq.trans,
|
||||||
|
Hab ↦ Foo,
|
||||||
|
apply Foo,
|
||||||
|
apply Hbc,
|
||||||
|
end
|
||||||
|
|
Loading…
Reference in a new issue