diff options
Diffstat (limited to 'src/Util/CaseUtil.v')
-rw-r--r-- | src/Util/CaseUtil.v | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Util/CaseUtil.v b/src/Util/CaseUtil.v new file mode 100644 index 000000000..35f207ffc --- /dev/null +++ b/src/Util/CaseUtil.v @@ -0,0 +1,12 @@ +Require Import Arith. + +Ltac case_max := + match goal with [ |- context[max ?x ?y] ] => + destruct (le_dec x y); + match goal with + | [ H : (?x <= ?y)%nat |- context[max ?x ?y] ] => rewrite Max.max_r by + (exact H) + | [ H : ~ (?x <= ?y)%nat |- context[max ?x ?y] ] => rewrite Max.max_l by + (exact (le_Sn_le _ _ (not_le _ _ H))) + end + end. |