fact
stringlengths
8
1.54k
type
stringclasses
19 values
library
stringclasses
8 values
imports
listlengths
1
10
filename
stringclasses
98 values
symbolic_name
stringlengths
1
42
docstring
stringclasses
1 value
predC_itvra : [predC Interval a +oo] =i Interval -oo a. Proof. by move=> y; rewrite inE/= -predC_itvl negbK. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import div fintype bigop order ssralg finset fingroup", "From mathcomp Require Import ssrnum" ]
algebra/interval.v
predC_itvr
predC_itvi : [predC i] =i [predU Interval -oo i.1 & Interval i.2 +oo]. Proof. case: i => [a a']; move=> x; rewrite inE/= itv_splitI negb_and. by symmetry; rewrite inE/= -predC_itvl -predC_itvr. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import div fintype bigop order ssralg finset fingroup", "From mathcomp Require Import ssrnum" ]
algebra/interval.v
predC_itv
real_BSide_minb x y : x \in Num.real -> y \in Num.real -> BSide b (Order.min x y) = Order.min (BSide b x) (BSide b y). Proof. by move=> xr yr; apply/comparable_BSide_min/real_comparable. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import div fintype bigop order ssralg finset fingroup", "From mathcomp Require Import ssrnum" ]
algebra/interval.v
real_BSide_min
real_BSide_maxb x y : x \in Num.real -> y \in Num.real -> BSide b (Order.max x y) = Order.max (BSide b x) (BSide b y). Proof. by move=> xr yr; apply/comparable_BSide_max/real_comparable. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import div fintype bigop order ssralg finset fingroup", "From mathcomp Require Import ssrnum" ]
algebra/interval.v
real_BSide_max
mem0_itvcc_xNxx : (0 \in `[- x, x]) = (0 <= x). Proof. by rewrite itv_boundlr [in LHS]/<=%O /= oppr_le0 andbb. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import div fintype bigop order ssralg finset fingroup", "From mathcomp Require Import ssrnum" ]
algebra/interval.v
mem0_itvcc_xNx
mem0_itvoo_xNxx : 0 \in `]- x, x[ = (0 < x). Proof. by rewrite itv_boundlr [in LHS]/<=%O /= oppr_lt0 andbb. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import div fintype bigop order ssralg finset fingroup", "From mathcomp Require Import ssrnum" ]
algebra/interval.v
mem0_itvoo_xNx
oppr_itvba bb (xa xb x : R) : (- x \in Interval (BSide ba xa) (BSide bb xb)) = (x \in Interval (BSide (~~ bb) (- xb)) (BSide (~~ ba) (- xa))). Proof. by rewrite !itv_boundlr /<=%O /= !implybF negbK andbC lteifNl lteifNr. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import div fintype bigop order ssralg finset fingroup", "From mathcomp Require Import ssrnum" ]
algebra/interval.v
oppr_itv
oppr_itvoo(a b x : R) : (- x \in `]a, b[) = (x \in `]- b, - a[). Proof. exact: oppr_itv. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import div fintype bigop order ssralg finset fingroup", "From mathcomp Require Import ssrnum" ]
algebra/interval.v
oppr_itvoo
oppr_itvco(a b x : R) : (- x \in `[a, b[) = (x \in `]- b, - a]). Proof. exact: oppr_itv. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import div fintype bigop order ssralg finset fingroup", "From mathcomp Require Import ssrnum" ]
algebra/interval.v
oppr_itvco
oppr_itvoc(a b x : R) : (- x \in `]a, b]) = (x \in `[- b, - a[). Proof. exact: oppr_itv. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import div fintype bigop order ssralg finset fingroup", "From mathcomp Require Import ssrnum" ]
algebra/interval.v
oppr_itvoc
oppr_itvcc(a b x : R) : (- x \in `[a, b]) = (x \in `[- b, - a]). Proof. exact: oppr_itv. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import div fintype bigop order ssralg finset fingroup", "From mathcomp Require Import ssrnum" ]
algebra/interval.v
oppr_itvcc
miditv(R : numDomainType) (i : interval R) : R := match i with | Interval (BSide _ a) (BSide _ b) => (a + b) / 2%:R | Interval -oo%O (BSide _ b) => b - 1 | Interval (BSide _ a) +oo%O => a + 1 | Interval -oo%O +oo%O => 0 | _ => 0 end.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import div fintype bigop order ssralg finset fingroup", "From mathcomp Require Import ssrnum" ]
algebra/interval.v
miditv
mid_in_itv: forall ba bb (xa xb : R), xa < xb ?<= if ba && ~~ bb -> mid xa xb \in Interval (BSide ba xa) (BSide bb xb). Proof. by move=> [] [] xa xb /= ?; apply/itv_dec; rewrite /= ?midf_lte // ?ltW. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import div fintype bigop order ssralg finset fingroup", "From mathcomp Require Import ssrnum" ]
algebra/interval.v
mid_in_itv
mid_in_itvoo: forall (xa xb : R), xa < xb -> mid xa xb \in `]xa, xb[. Proof. by move=> xa xb ?; apply: mid_in_itv. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import div fintype bigop order ssralg finset fingroup", "From mathcomp Require Import ssrnum" ]
algebra/interval.v
mid_in_itvoo
mid_in_itvcc: forall (xa xb : R), xa <= xb -> mid xa xb \in `[xa, xb]. Proof. by move=> xa xb ?; apply: mid_in_itv. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import div fintype bigop order ssralg finset fingroup", "From mathcomp Require Import ssrnum" ]
algebra/interval.v
mid_in_itvcc
mem_miditvi : (i.1 < i.2)%O -> miditv i \in i. Proof. move: i => [[ba a|[]] [bb b|[]]] //= ab; first exact: mid_in_itv. by rewrite !in_itv -lteifBlDl subrr lteif01. by rewrite !in_itv lteifBlDr -lteifBlDl subrr lteif01. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import div fintype bigop order ssralg finset fingroup", "From mathcomp Require Import ssrnum" ]
algebra/interval.v
mem_miditv
miditv_le_lefti b : (i.1 < i.2)%O -> (BSide b (miditv i) <= i.2)%O. Proof. case: i => [x y] lti; have := mem_miditv lti; rewrite inE => /andP[_ ]. by apply: le_trans; rewrite !bnd_simp. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import div fintype bigop order ssralg finset fingroup", "From mathcomp Require Import ssrnum" ]
algebra/interval.v
miditv_le_left
miditv_ge_righti b : (i.1 < i.2)%O -> (i.1 <= BSide b (miditv i))%O. Proof. case: i => [x y] lti; have := mem_miditv lti; rewrite inE => /andP[+ _]. by move=> /le_trans; apply; rewrite !bnd_simp. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import div fintype bigop order ssralg finset fingroup", "From mathcomp Require Import ssrnum" ]
algebra/interval.v
miditv_ge_right
in_segmentDgt0Prx y z : reflect (forall e, e > 0 -> y \in `[x - e, z + e]) (y \in `[x, z]). Proof. apply/(iffP idP)=> [xyz e /[dup] e_gt0 /ltW e_ge0 | xyz_e]. by rewrite in_itv /= lerBDr !ler_wpDr// (itvP xyz). by rewrite in_itv /= ; apply/andP; split; apply/ler_addgt0Pr => ? /xyz_e; rewrite in_itv /= lerBDr => /andP []. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import div fintype bigop order ssralg finset fingroup", "From mathcomp Require Import ssrnum" ]
algebra/interval.v
in_segmentDgt0Pr
in_segmentDgt0Plx y z : reflect (forall e, e > 0 -> y \in `[- e + x, e + z]) (y \in `[x, z]). Proof. apply/(equivP (in_segmentDgt0Pr x y z)). by split=> zxy e /zxy; rewrite [z + _]addrC [_ + x]addrC. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice", "From mathcomp Require Import div fintype bigop order ssralg finset fingroup", "From mathcomp Require Import ssrnum" ]
algebra/interval.v
in_segmentDgt0Pl
map_itv_boundS T (f : S -> T) (b : itv_bound S) : itv_bound T := match b with | BSide b x => BSide b (f x) | BInfty b => BInfty _ b end.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
map_itv_bound
map_itv_bound_compS T U (f : T -> S) (g : U -> T) (b : itv_bound U) : map_itv_bound (f \o g) b = map_itv_bound f (map_itv_bound g b). Proof. by case: b. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
map_itv_bound_comp
map_itvS T (f : S -> T) (i : interval S) : interval T := let 'Interval l u := i in Interval (map_itv_bound f l) (map_itv_bound f u).
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
map_itv
map_itv_compS T U (f : T -> S) (g : U -> T) (i : interval U) : map_itv (f \o g) i = map_itv f (map_itv g i). Proof. by case: i => l u /=; rewrite -!map_itv_bound_comp. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
map_itv_comp
opp_boundb := match b with | BSide b x => BSide (~~ b) (intZmod.oppz x) | BInfty b => BInfty _ (~~ b) end.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
opp_bound
opp_bound_ge0b : (BLeft 0%R <= opp_bound b)%O = (b <= BRight 0%R)%O. Proof. by case: b => [[] b | []//]; rewrite /= !bnd_simp oppr_ge0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
opp_bound_ge0
opp_bound_gt0b : (BRight 0%R <= opp_bound b)%O = (b <= BLeft 0%R)%O. Proof. by case: b => [[] b | []//]; rewrite /= !bnd_simp ?oppr_ge0 ?oppr_gt0. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
opp_bound_gt0
oppi := let: Interval l u := i in Interval (opp_bound u) (opp_bound l). Arguments opp /.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
opp
add_boundlb1 b2 := match b1, b2 with | BSide b1 x1, BSide b2 x2 => BSide (b1 && b2) (intZmod.addz x1 x2) | _, _ => BInfty _ true end.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
add_boundl
add_boundrb1 b2 := match b1, b2 with | BSide b1 x1, BSide b2 x2 => BSide (b1 || b2) (intZmod.addz x1 x2) | _, _ => BInfty _ false end.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
add_boundr
addi1 i2 := let: Interval l1 u1 := i1 in let: Interval l2 u2 := i2 in Interval (add_boundl l1 l2) (add_boundr u1 u2). Arguments add /.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
add
signb:= EqZero | NonNeg | NonPos.
Variant
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
signb
sign_boundlb := let: b0 := BLeft 0%Z in if b == b0 then EqZero else if (b <= b0)%O then NonPos else NonNeg.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
sign_boundl
sign_boundrb := let: b0 := BRight 0%Z in if b == b0 then EqZero else if (b <= b0)%O then NonPos else NonNeg.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
sign_boundr
signi:= Known of signb | Unknown | Empty.
Variant
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
signi
signi : signi := let: Interval l u := i in match sign_boundl l, sign_boundr u with | EqZero, NonPos | NonNeg, EqZero | NonNeg, NonPos => Empty | EqZero, EqZero => Known EqZero | NonPos, EqZero | NonPos, NonPos => Known NonPos | EqZero, NonNeg | NonNeg, NonNeg => Known NonNeg | NonPos, NonNeg => Unknown end.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
sign
mul_boundlb1 b2 := match b1, b2 with | BInfty _, _ | _, BInfty _ | BLeft 0%Z, _ | _, BLeft 0%Z => BLeft 0%Z | BSide b1 x1, BSide b2 x2 => BSide (b1 && b2) (intRing.mulz x1 x2) end.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
mul_boundl
mul_boundrb1 b2 := match b1, b2 with | BLeft 0%Z, _ | _, BLeft 0%Z => BLeft 0%Z | BRight 0%Z, _ | _, BRight 0%Z => BRight 0%Z | BSide b1 x1, BSide b2 x2 => BSide (b1 || b2) (intRing.mulz x1 x2) | _, BInfty _ | BInfty _, _ => +oo%O end.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
mul_boundr
mul_boundrCb1 b2 : mul_boundr b1 b2 = mul_boundr b2 b1. Proof. by move: b1 b2 => [[] [[|?]|?] | []] [[] [[|?]|?] | []] //=; rewrite mulnC. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
mul_boundrC
mul_boundr_gt0b1 b2 : (BRight 0%Z <= b1 -> BRight 0%Z <= b2 -> BRight 0%Z <= mul_boundr b1 b2)%O. Proof. case: b1 b2 => [b1b b1 | []] [b2b b2 | []]//=. - by case: b1b b2b => -[]; case: b1 b2 => [[|b1] | b1] [[|b2] | b2]. - by case: b1b b1 => -[[] |]. - by case: b2b b2 => -[[] |]. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
mul_boundr_gt0
muli1 i2 := let: Interval l1 u1 := i1 in let: Interval l2 u2 := i2 in let: opp := opp_bound in let: mull := mul_boundl in let: mulr := mul_boundr in match sign i1, sign i2 with | Empty, _ | _, Empty => `[1, 0] | Known EqZero, _ | _, Known EqZero => `[0, 0] | Known NonNeg, Known NonNeg => Interval (mull l1 l2) (mulr u1 u2) | Known NonPos, Known NonPos => Interval (mull (opp u1) (opp u2)) (mulr (opp l1) (opp l2)) | Known NonNeg, Known NonPos => Interval (opp (mulr u1 (opp l2))) (opp (mull l1 (opp u2))) | Known NonPos, Known NonNeg => Interval (opp (mulr (opp l1) u2)) (opp (mull (opp u1) l2)) | Known NonNeg, Unknown => Interval (opp (mulr u1 (opp l2))) (mulr u1 u2) | Known NonPos, Unknown => Interval (opp (mulr (opp l1) u2)) (mulr (opp l1) (opp l2)) | Unknown, Known NonNeg => Interval (opp (mulr (opp l1) u2)) (mulr u1 u2) | Unknown, Known NonPos => Interval (opp (mulr u1 (opp l2))) (mulr (opp l1) (opp l2)) | Unknown, Unknown => Interval (Order.min (opp (mulr (opp l1) u2)) (opp (mulr u1 (opp l2)))) (Order.max (mulr (opp l1) (opp l2)) (mulr u1 u2)) end. Arguments mul /.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
mul
mini j := let: Interval li ui := i in let: Interval lj uj := j in Interval (Order.min li lj) (Order.min ui uj). Arguments min /.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
min
maxi j := let: Interval li ui := i in let: Interval lj uj := j in Interval (Order.max li lj) (Order.max ui uj). Arguments max /.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
max
keep_nonneg_boundb := match b with | BSide _ (Posz _) => BLeft 0%Z | BSide _ (Negz _) => -oo%O | BInfty _ => -oo%O end. Arguments keep_nonneg_bound /.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
keep_nonneg_bound
keep_pos_boundb := match b with | BSide b 0%Z => BSide b 0%Z | BSide _ (Posz (S _)) => BRight 0%Z | BSide _ (Negz _) => -oo | BInfty _ => -oo end. Arguments keep_pos_bound /.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
keep_pos_bound
keep_nonpos_boundb := match b with | BSide _ (Negz _) | BSide _ (Posz 0) => BRight 0%Z | BSide _ (Posz (S _)) => +oo%O | BInfty _ => +oo%O end. Arguments keep_nonpos_bound /.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
keep_nonpos_bound
keep_neg_boundb := match b with | BSide b 0%Z => BSide b 0%Z | BSide _ (Negz _) => BLeft 0%Z | BSide _ (Posz _) => +oo | BInfty _ => +oo end. Arguments keep_neg_bound /.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
keep_neg_bound
invi := let: Interval l u := i in Interval (keep_pos_bound l) (keep_neg_bound u). Arguments inv /.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
inv
exprn_le1_boundb1 b2 := if b2 isn't BSide _ 1%Z then +oo else if (BLeft (-1)%Z <= b1)%O then BRight 1%Z else +oo. Arguments exprn_le1_bound /.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
exprn_le1_bound
exprni := let: Interval l u := i in Interval (keep_pos_bound l) (exprn_le1_bound l u). Arguments exprn /.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
exprn
exprzi1 i2 := let: Interval l2 _ := i2 in if l2 is BSide _ (Posz _) then exprn i1 else let: Interval l u := i1 in Interval (keep_pos_bound l) +oo. Arguments exprz /.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
exprz
keep_signi := let: Interval l u := i in Interval (keep_nonneg_bound l) (keep_nonpos_bound u).
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
keep_sign
keep_nonposi := let 'Interval l u := i in Interval -oo%O (keep_nonpos_bound u). Arguments keep_nonpos /.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
keep_nonpos
keep_nonnegi := let 'Interval l u := i in Interval (keep_nonneg_bound l) +oo%O. Arguments keep_nonneg /.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
keep_nonneg
t:= Top | Real of interval int.
Variant
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
t
sub(x y : t) := match x, y with | _, Top => true | Top, Real _ => false | Real xi, Real yi => subitv xi yi end.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
sub
spec(i : t) (x : T) := if i is Real i then sem i x else true.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
spec
def(i : t) := Def { r : T; #[canonical=no] P : spec i r }.
Record
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
def
typi := Typ { sort : Type; #[canonical=no] sort_sem : interval int -> sort -> bool; #[canonical=no] allP : forall x : sort, spec sort_sem i x }.
Record
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
typ
mk{T f} i x P : @def T f i := @Def T f i x P.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
mk
from{T f i} {x : @def T f i} (phx : phantom T (r x)) := x.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
from
fromP{T f i} {x : @def T f i} (phx : phantom T (r x)) := P x.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
fromP
num_sem(R : numDomainType) (i : interval int) (x : R) : bool := (x \in Num.real) && (x \in map_itv intr i).
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
num_sem
nat_sem(i : interval int) (x : nat) : bool := Posz x \in i.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
nat_sem
posnum(R : numDomainType) of phant R := def (@num_sem R) (Real `]0, +oo[).
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
posnum
nonneg(R : numDomainType) of phant R := def (@num_sem R) (Real `[0, +oo[).
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
nonneg
real1(op1 : interval int -> interval int) (x : Itv.t) : Itv.t := match x with Itv.Top => Itv.Top | Itv.Real x => Itv.Real (op1 x) end.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
real1
real2(op2 : interval int -> interval int -> interval int) (x y : Itv.t) : Itv.t := match x, y with | Itv.Top, _ | _, Itv.Top => Itv.Top | Itv.Real x, Itv.Real y => Itv.Real (op2 x y) end.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
real2
spec_real1T f (op1 : T -> T) (op1i : interval int -> interval int) : forall (x : T), (forall xi, f xi x = true -> f (op1i xi) (op1 x) = true) -> forall xi, spec f xi x -> spec f (real1 op1i xi) (op1 x). Proof. by move=> x + [//| xi]; apply. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
spec_real1
spec_real2T f (op2 : T -> T -> T) (op2i : interval int -> interval int -> interval int) (x y : T) : (forall xi yi, f xi x = true -> f yi y = true -> f (op2i xi yi) (op2 x y) = true) -> forall xi yi, spec f xi x -> spec f yi y -> spec f (real2 op2i xi yi) (op2 x y). Proof. by move=> + [//| xi] [//| yi]; apply. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
spec_real2
num:= r.
Notation
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
num
Definition_ := [isSub for @Itv.r T f i]. HB.instance Definition _ : Order.POrder d itv := [POrder of itv by <:].
HB.instance
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
Definition
itv_le_total_subproof: total (<=%O : rel nR). Proof. move=> x y; apply: real_comparable. - by case: x => [x /=/andP[]]. - by case: y => [y /=/andP[]]. Qed. HB.instance Definition _ := Order.POrder_isTotal.Build ring_display nR itv_le_total_subproof.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
itv_le_total_subproof
top_typ_specT f (x : T) : Itv.spec f Itv.Top x. Proof. by []. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
top_typ_spec
top_typT f := Itv.Typ (@top_typ_spec T f).
Canonical
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
top_typ
real_domain_typ_spec(R : realDomainType) (x : R) : num_spec (Itv.Real `]-oo, +oo[) x. Proof. by rewrite /Itv.num_sem/= num_real. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
real_domain_typ_spec
real_domain_typ(R : realDomainType) := Itv.Typ (@real_domain_typ_spec R).
Canonical
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
real_domain_typ
real_field_typ_spec(R : realFieldType) (x : R) : num_spec (Itv.Real `]-oo, +oo[) x. Proof. exact: real_domain_typ_spec. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
real_field_typ_spec
real_field_typ(R : realFieldType) := Itv.Typ (@real_field_typ_spec R).
Canonical
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
real_field_typ
nat_typ_spec(x : nat) : nat_spec (Itv.Real `[0, +oo[) x. Proof. by []. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
nat_typ_spec
nat_typ:= Itv.Typ nat_typ_spec.
Canonical
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
nat_typ
typ_inum_spec(i : Itv.t) (xt : Itv.typ i) (x : Itv.sort xt) : Itv.spec (@Itv.sort_sem _ xt) i x. Proof. by move: xt x => []. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
typ_inum_spec
typ_inum(i : Itv.t) (xt : Itv.typ i) (x : Itv.sort xt) := Itv.mk (typ_inum_spec x).
Canonical
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
typ_inum
unify{T} f (x y : T) := Unify : f x y = true. #[export] Hint Mode unify + + + + : typeclass_instances.
Class
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
unify
unify'{T} f (x y : T) := Unify' : f x y = true. #[export] Instance unify'P {T} f (x y : T) : unify' f x y -> unify f x y := id. #[export] Hint Extern 0 (unify' _ _ _) => vm_compute; reflexivity : typeclass_instances.
Class
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
unify'
unify_itvix iy := (unify Itv.sub ix iy). #[export] Instance top_wider_anything i : unify_itv i Itv.Top. Proof. by case: i. Qed. #[export] Instance real_wider_anyreal i : unify_itv (Itv.Real i) (Itv.Real `]-oo, +oo[). Proof. by case: i => [l u]; apply/andP; rewrite !bnd_simp. Qed.
Notation
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
unify_itv
le_num_itv_bound(x y : itv_bound int) : (num_itv_bound R x <= num_itv_bound R y)%O = (x <= y)%O. Proof. by case: x y => [[] x | x] [[] y | y]//=; rewrite !bnd_simp ?ler_int ?ltr_int. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
le_num_itv_bound
num_itv_bound_le_BLeft(x : itv_bound int) (y : int) : (num_itv_bound R x <= BLeft (y%:~R : R))%O = (x <= BLeft y)%O. Proof. rewrite -[BLeft y%:~R]/(map_itv_bound intr (BLeft y)). by rewrite le_num_itv_bound. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
num_itv_bound_le_BLeft
BRight_le_num_itv_bound(x : int) (y : itv_bound int) : (BRight (x%:~R : R) <= num_itv_bound R y)%O = (BRight x <= y)%O. Proof. rewrite -[BRight x%:~R]/(map_itv_bound intr (BRight x)). by rewrite le_num_itv_bound. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
BRight_le_num_itv_bound
num_spec_sub(x y : Itv.t) : Itv.sub x y -> forall z : R, num_spec x z -> num_spec y z. Proof. case: x y => [| x] [| y] //= x_sub_y z /andP[rz]; rewrite /Itv.num_sem rz/=. move: x y x_sub_y => [lx ux] [ly uy] /andP[lel leu] /=. move=> /andP[lxz zux]; apply/andP; split. - by apply: le_trans lxz; rewrite le_num_itv_bound. - by apply: le_trans zux _; rewrite le_num_itv_bound. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
num_spec_sub
empty_itv:= Itv.Real `[1, 0]%Z.
Definition
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
empty_itv
bottomx : ~ unify_itv i empty_itv. Proof. case: x => x /= /[swap] /num_spec_sub /[apply] /andP[_] /=. by rewrite in_itv/= => /andP[] /le_trans /[apply]; rewrite ler10. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
bottom
gt0x : unify_itv i (Itv.Real `]0%Z, +oo[) -> 0 < x%:num :> R. Proof. case: x => x /= /[swap] /num_spec_sub /[apply] /andP[_]. by rewrite /= in_itv/= andbT. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
gt0
le0Fx : unify_itv i (Itv.Real `]0%Z, +oo[) -> x%:num <= 0 :> R = false. Proof. case: x => x /= /[swap] /num_spec_sub /[apply] /andP[_] /=. by rewrite in_itv/= andbT => /lt_geF. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
le0F
lt0x : unify_itv i (Itv.Real `]-oo, 0%Z[) -> x%:num < 0 :> R. Proof. by case: x => x /= /[swap] /num_spec_sub /[apply] /andP[_] /=; rewrite in_itv. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
lt0
ge0Fx : unify_itv i (Itv.Real `]-oo, 0%Z[) -> 0 <= x%:num :> R = false. Proof. case: x => x /= /[swap] /num_spec_sub /[apply] /andP[_] /=. by rewrite in_itv/= => /lt_geF. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
ge0F
ge0x : unify_itv i (Itv.Real `[0%Z, +oo[) -> 0 <= x%:num :> R. Proof. case: x => x /= /[swap] /num_spec_sub /[apply] /andP[_] /=. by rewrite in_itv/= andbT. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
ge0
lt0Fx : unify_itv i (Itv.Real `[0%Z, +oo[) -> x%:num < 0 :> R = false. Proof. case: x => x /= /[swap] /num_spec_sub /[apply] /andP[_] /=. by rewrite in_itv/= andbT => /le_gtF. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
lt0F
le0x : unify_itv i (Itv.Real `]-oo, 0%Z]) -> x%:num <= 0 :> R. Proof. by case: x => x /= /[swap] /num_spec_sub /[apply] /andP[_] /=; rewrite in_itv. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
le0
gt0Fx : unify_itv i (Itv.Real `]-oo, 0%Z]) -> 0 < x%:num :> R = false. Proof. case: x => x /= /[swap] /num_spec_sub /[apply] /andP[_] /=. by rewrite in_itv/= => /le_gtF. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype choice", "From mathcomp Require Import order ssralg ssrnum ssrint interval" ]
algebra/interval_inference.v
gt0F