feat: add byCases tactic

This commit is contained in:
Leonardo de Moura 2021-02-17 12:44:59 -08:00
parent 08927f1e66
commit 79a4aebf96
2 changed files with 5 additions and 5 deletions

View file

@ -127,4 +127,9 @@ theorem byCases {p q : Prop} (hpq : p → q) (hnpq : ¬p → q) : q :=
theorem byContradiction {p : Prop} (h : ¬p → False) : p :=
Decidable.byContradiction (dec := propDecidable _) h
macro "byCases" h:ident ":" e:term : tactic =>
`(cases em $e:term with
| Or.inl $h:ident => _
| Or.inr $h:ident => _)
end Classical

View file

@ -104,11 +104,6 @@ def mkExpr : List Nat → Expr
| [i] => Expr.var i
| i::is => Expr.op (Expr.var i) (mkExpr is)
macro "byCases" h:ident ":" e:term : tactic =>
`(cases Decidable.em $e:term with
| Or.inl $h:ident => _
| Or.inr $h:ident => _)
theorem Expr.denote_sort (ctx : Context α) (e : Expr) : denote ctx (sort e) = denote ctx e := by
apply denote_loop
where