lean4-htt/tests/lean/run/simplifier_assoc.lean
Daniel Selsam 4f8db64e23 refactor(simplifier): many fixes, extensions, and tests
fix(simplifier): missing simp rule in prop simplifier
fix(library/unfold_macros): do not look for untrusted macros when using sufficient trust level
2016-08-19 14:57:03 -07:00

29 lines
822 B
Text

open tactic
constants (A : Type.{1}) (a b c d e f g h : A) (op : A → A → A) (op_assoc : is_associative op)
attribute op_assoc [instance]
infixr `%%` := op
namespace pat2
constant (H : a %% b = f)
local attribute H [simp]
example : a %% b = f := by simp
example : c %% a %% b = c %% f := by simp
example : a %% b %% c = f %% c := by simp
example : c %% a %% b %% d = c %% f %% d := by simp
example : c %% d %% a %% b %% c %% d = c %% d %% f %% c %% d := by simp
end pat2
namespace pat3
constant (H : (a %% b) %% g = f)
attribute H [simp]
example : a %% b %% g = f := by simp
example : c %% a %% b %% g = c %% f := by simp
example : a %% b %% g %% c = f %% c := by simp
example : c %% a %% b %% g %% d = c %% f %% d := by simp
example : c %% d %% a %% b %% g %% c %% d = c %% d %% f %% c %% d := by simp
end pat3