feat(library/init/meta/contradiction_tactic): make it more robust

This commit is contained in:
Leonardo de Moura 2017-02-16 21:43:34 -08:00
parent c4542d5987
commit efcebc60f7
2 changed files with 6 additions and 1 deletions

View file

@ -34,7 +34,7 @@ private meta def contra_false : list expr → tactic unit
private meta def contra_not_a_refl_rel_a : list expr → tactic unit
| [] := failed
| (H :: Hs) :=
do t ← infer_type H,
do t ← infer_type H >>= beta,
(do (lhs, rhs) ← match_ne t,
unify lhs rhs,
tgt ← target,

View file

@ -0,0 +1,5 @@
open tactic
def hd {α} : {l : list α // l ≠ []} → α
| ⟨[], h⟩ := by contradiction
| ⟨a::l, h⟩ := a