lean4-htt/tests/lean/run/simplifier_canonize_instances.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

27 lines
1,003 B
Text

open tactic
set_option simplify.theory false
set_option pp.implicit true
meta_definition simplify_goal_force : tactic unit :=
do (new_target, Heq) ← target >>= simplify failed [],
assert `Htarget new_target, swap,
Ht ← get_local `Htarget,
mk_app `eq.mpr [Heq, Ht] >>= apply_core transparency.all ff tt,
try reflexivity
universe l
constants (group : Type → Type.{1})
attribute group [class]
constants (f₁ : Π (X : Type) (X_grp : group X), X)
constants (f₂ : Π (X : Type) [X_grp : group X], X)
constants (A : Type.{l}) (A_grp₁ : group A)
attribute [irreducible] definition A_grp₂ : group A := A_grp₁
attribute [irreducible] definition A_grp₃ (t : true) : group A := A_grp₁
set_option simplify.canonize_instances_fixed_point true
example : @f₂ A A_grp₁ = @f₂ A A_grp₂ := by simplify_goal_force
example : @f₂ A (A_grp₃ trivial) = @f₂ A A_grp₂ := by simplify_goal_force
example : @f₂ A (A_grp₃ trivial) = @f₂ A A_grp₂ := by simplify_goal_force