aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Jason Gross <jagro@google.com>2018-08-24 21:40:18 -0400
committerGravatar Jason Gross <jagro@google.com>2018-08-24 21:40:18 -0400
commitb26e2433f516f047850434cd2227ba9105c3bf4a (patch)
treea82b3f6c1b65b46346f696bee4b67f82f5fbe08f /src
parentd2712446da700450239dd5556431b0d40a446dde (diff)
Add some basic ZRange lemmas
Diffstat (limited to 'src')
-rw-r--r--src/Util/ZRange/BasicLemmas.v12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Util/ZRange/BasicLemmas.v b/src/Util/ZRange/BasicLemmas.v
index d48c89011..6cfdaaff8 100644
--- a/src/Util/ZRange/BasicLemmas.v
+++ b/src/Util/ZRange/BasicLemmas.v
@@ -108,6 +108,18 @@ Module ZRange.
-> is_bounded_by_bool (if b then x else y) (Operations.ZRange.union rx ry) = true.
Proof. intros; apply is_bounded_by_bool_Proper_if_sumbool_union_dep; auto. Qed.
+ Lemma is_bounded_by_bool_Proper_if_bool_union_dep (b : bool) x y rx ry
+ : (b = true -> is_bounded_by_bool x rx = true)
+ -> (b = false -> is_bounded_by_bool y ry = true)
+ -> is_bounded_by_bool (if b then x else y) (Operations.ZRange.union rx ry) = true.
+ Proof. pose proof (is_bounded_by_bool_Proper_if_sumbool_union_dep (Sumbool.sumbool_of_bool b) x y rx ry); destruct b; assumption. Qed.
+
+ Lemma is_bounded_by_bool_Proper_if_bool_union (b : bool) x y rx ry
+ : is_bounded_by_bool x rx = true
+ -> is_bounded_by_bool y ry = true
+ -> is_bounded_by_bool (if b then x else y) (Operations.ZRange.union rx ry) = true.
+ Proof. intros; apply is_bounded_by_bool_Proper_if_bool_union_dep; auto. Qed.
+
Lemma is_bounded_by_bool_opp x r : is_bounded_by_bool (Z.opp x) (ZRange.opp r) = is_bounded_by_bool x r.
Proof.
cbv [is_bounded_by_bool andb opp]; cbn [lower upper]; break_match; Z.ltb_to_lt; break_match; Z.ltb_to_lt;