aboutsummaryrefslogtreecommitdiff
path: root/src/Util/ZRange/BasicLemmas.v
diff options
context:
space:
mode:
authorGravatar Jason Gross <jagro@google.com>2018-08-13 21:35:43 -0400
committerGravatar Jason Gross <jagro@google.com>2018-08-13 21:43:50 -0400
commit66d064774f532066e43bbbaf27a1fa7fb3e06dfc (patch)
treef5e64cbbe73a6cc828dc18853e085b7b39b6b82d /src/Util/ZRange/BasicLemmas.v
parente17a3a7b01fb2a61836db85daa6f7c4887635ac3 (diff)
Fix some bounds analysis
Diffstat (limited to 'src/Util/ZRange/BasicLemmas.v')
-rw-r--r--src/Util/ZRange/BasicLemmas.v14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/Util/ZRange/BasicLemmas.v b/src/Util/ZRange/BasicLemmas.v
index 6b5a430c4..1245bfe3f 100644
--- a/src/Util/ZRange/BasicLemmas.v
+++ b/src/Util/ZRange/BasicLemmas.v
@@ -89,16 +89,22 @@ Module ZRange.
rewrite ?Bool.andb_true_iff, ?Z.leb_le_iff in *; repeat apply conj; etransitivity; destruct_head'_and; eassumption.
Qed.
- Lemma is_bounded_by_bool_Proper_if_sumbool_union {A B} (b : sumbool A B) x y rx ry
- : is_bounded_by_bool x rx = true
- -> is_bounded_by_bool y ry = true
+ Lemma is_bounded_by_bool_Proper_if_sumbool_union_dep {A B} (b : sumbool A B) x y rx ry
+ : (A -> is_bounded_by_bool x rx = true)
+ -> (B -> is_bounded_by_bool y ry = true)
-> is_bounded_by_bool (if b then x else y) (Operations.ZRange.union rx ry) = true.
Proof.
destruct b; cbv [Operations.ZRange.union is_bounded_by_bool];
- intros; Bool.split_andb; rewrite Bool.andb_true_iff; split; Z.ltb_to_lt; cbn [lower upper] in *; split_min_max.
+ intros; specialize_by_assumption; Bool.split_andb; rewrite Bool.andb_true_iff; split; Z.ltb_to_lt; cbn [lower upper] in *; split_min_max.
all: lia.
Qed.
+ Lemma is_bounded_by_bool_Proper_if_sumbool_union {A B} (b : sumbool A B) 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_sumbool_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;