lean4-htt/tests/lean/run/simp_subgoals.lean
Leonardo de Moura 4604d7fd5a feat(library/init/meta): allow users to specify tactic for discharging subgoals in the simp tactic family
@dselsam @Armael: this feature may be useful for you.
The doc/changes.md describes many other new features.
2017-07-01 15:35:33 -07:00

22 lines
506 B
Text

axiom DivS (x : nat) : x ≠ 0 → x / x = 1
open tactic
example (x : nat) (h : x ≠ 0) : x / x = 1 :=
begin
simp[DivS, h]
end
example (x : nat) (h : x ≠ 0) : x / x = 1 :=
begin
fail_if_success {simp [DivS]},
simp [DivS] {discharger := assumption}
end
constant f : nat → nat → nat
axiom flemma : ∀ a b, b ≠ 0 → a ≠ 0 → f a b = 0
example (x : nat) (h : x ≠ 0) : f 1 x = 0 :=
begin
simp [flemma] {discharger := trace "subgoal" >> trace_state >> (assumption <|> comp_val)}
end