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 |
|---|---|---|---|---|---|---|
cmp0x : unify_itv i (Itv.Real `]-oo, +oo[) -> 0 >=< x%:num.
Proof. by case: i x => [//| i' [x /=/andP[]]]. 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
|
cmp0
| |
neq0x :
unify (fun ix iy => ~~ Itv.sub ix iy) (Itv.Real `[0%Z, 0%Z]) i ->
x%:num != 0 :> R.
Proof.
case: i x => [//| [l u] [x /= Px]]; apply: contra => /eqP x0 /=.
move: Px; rewrite x0 => /and3P[_ /= l0 u0]; apply/andP; split.
- by case: l l0 => [[] l /= |//]; rewrite !bnd_simp ?lerz0 ?ltrz0.
- by case: u u0 => [[] u /= |//]; rewrite !bnd_simp ?ler0z ?ltr0z.
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
|
neq0
| |
eq0Fx :
unify (fun ix iy => ~~ Itv.sub ix iy) (Itv.Real `[0%Z, 0%Z]) i ->
x%:num == 0 :> R = false.
Proof. by move=> u; apply/negbTE/neq0. 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
|
eq0F
| |
lt1x : unify_itv i (Itv.Real `]-oo, 1%Z[) -> x%:num < 1 :> 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
|
lt1
| |
ge1Fx : unify_itv i (Itv.Real `]-oo, 1%Z[) -> 1 <= 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
|
ge1F
| |
le1x : unify_itv i (Itv.Real `]-oo, 1%Z]) -> x%:num <= 1 :> 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
|
le1
| |
gt1Fx : unify_itv i (Itv.Real `]-oo, 1%Z]) -> 1 < 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
|
gt1F
| |
widen_itv_subproofx i' : Itv.sub i i' -> num_spec i' x%:num.
Proof. by case: x => x /= /[swap] /num_spec_sub; 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
|
widen_itv_subproof
| |
widen_itvx i' (uni : unify_itv i i') :=
Itv.mk (widen_itv_subproof x uni).
|
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
|
widen_itv
| |
widen_itvEx (uni : unify_itv i i) : @widen_itv x i uni = x.
Proof. exact/val_inj. 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
|
widen_itvE
| |
posEx (uni : unify_itv i (Itv.Real `]0%Z, +oo[)) :
(widen_itv x%:num%:itv uni)%:num = x%:num.
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
|
posE
| |
nngEx (uni : unify_itv i (Itv.Real `[0%Z, +oo[)) :
(widen_itv x%:num%:itv uni)%:num = x%:num.
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
|
nngE
| |
num_spec_zero: num_spec (Itv.Real `[0, 0]) (0 : R).
Proof. by apply/andP; split; [exact: real0 | rewrite /= in_itv/= lexx]. 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_zero
| |
zero_inum:= Itv.mk num_spec_zero.
|
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
|
zero_inum
| |
num_spec_one: num_spec (Itv.Real `[1, 1]) (1 : R).
Proof. by apply/andP; split; [exact: real1 | rewrite /= in_itv/= lexx]. 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_one
| |
one_inum:= Itv.mk num_spec_one.
|
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
|
one_inum
| |
opp_boundr(x : R) b :
(BRight (- x)%R <= num_itv_bound R (opp_bound b))%O
= (num_itv_bound R b <= BLeft x)%O.
Proof.
by case: b => [[] b | []//]; rewrite /= !bnd_simp mulrNz ?lerN2 // ltrN2.
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_boundr
| |
opp_boundl(x : R) b :
(num_itv_bound R (opp_bound b) <= BLeft (- x)%R)%O
= (BRight x <= num_itv_bound R b)%O.
Proof.
by case: b => [[] b | []//]; rewrite /= !bnd_simp mulrNz ?lerN2 // ltrN2.
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_boundl
| |
num_spec_opp(i : Itv.t) (x : num_def R i) (r := Itv.real1 opp i) :
num_spec r (- x%:num).
Proof.
apply: Itv.spec_real1 (Itv.P x).
case: x => x /= _ [l u] /and3P[xr lx xu].
rewrite /Itv.num_sem/= realN xr/=; apply/andP.
by rewrite opp_boundl opp_boundr.
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_opp
| |
opp_inum(i : Itv.t) (x : num_def R i) := Itv.mk (num_spec_opp 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
|
opp_inum
| |
num_itv_add_boundl(x1 x2 : R) b1 b2 :
(num_itv_bound R b1 <= BLeft x1)%O -> (num_itv_bound R b2 <= BLeft x2)%O ->
(num_itv_bound R (add_boundl b1 b2) <= BLeft (x1 + x2)%R)%O.
Proof.
case: b1 b2 => [bb1 b1 |//] [bb2 b2 |//].
case: bb1; case: bb2; rewrite /= !bnd_simp mulrzDr.
- exact: lerD.
- exact: ler_ltD.
- exact: ltr_leD.
- exact: ltrD.
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_add_boundl
| |
num_itv_add_boundr(x1 x2 : R) b1 b2 :
(BRight x1 <= num_itv_bound R b1)%O -> (BRight x2 <= num_itv_bound R b2)%O ->
(BRight (x1 + x2)%R <= num_itv_bound R (add_boundr b1 b2))%O.
Proof.
case: b1 b2 => [bb1 b1 |//] [bb2 b2 |//].
case: bb1; case: bb2; rewrite /= !bnd_simp mulrzDr.
- exact: ltrD.
- exact: ltr_leD.
- exact: ler_ltD.
- exact: lerD.
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_add_boundr
| |
num_spec_add(xi yi : Itv.t) (x : num_def R xi) (y : num_def R yi)
(r := Itv.real2 add xi yi) :
num_spec r (x%:num + y%:num).
Proof.
apply: Itv.spec_real2 (Itv.P x) (Itv.P y).
case: x y => [x /= _] [y /= _] => {xi yi r} -[lx ux] [ly uy]/=.
move=> /andP[xr /=/andP[lxx xux]] /andP[yr /=/andP[lyy yuy]].
rewrite /Itv.num_sem realD//=; apply/andP.
by rewrite num_itv_add_boundl ?num_itv_add_boundr.
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_add
| |
add_inum(xi yi : Itv.t) (x : num_def R xi) (y : num_def R yi) :=
Itv.mk (num_spec_add x y).
|
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
|
add_inum
| |
sign_spec(l u : itv_bound int) (x : R) : signi -> Set :=
| ISignEqZero : l = BLeft 0 -> u = BRight 0 -> x = 0 ->
sign_spec l u x (Known EqZero)
| ISignNonNeg : (BLeft 0%:Z <= l)%O -> (BRight 0%:Z < u)%O -> 0 <= x ->
sign_spec l u x (Known NonNeg)
| ISignNonPos : (l < BLeft 0%:Z)%O -> (u <= BRight 0%:Z)%O -> x <= 0 ->
sign_spec l u x (Known NonPos)
| ISignBoth : (l < BLeft 0%:Z)%O -> (BRight 0%:Z < u)%O -> x \in Num.real ->
sign_spec l u x Unknown.
|
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
|
sign_spec
| |
signP(l u : itv_bound int) (x : R) :
(num_itv_bound R l <= BLeft x)%O -> (BRight x <= num_itv_bound R u)%O ->
x \in Num.real ->
sign_spec l u x (sign (Interval l u)).
Proof.
move=> + + xr; rewrite /sign/sign_boundl/sign_boundr.
have [lneg|lpos|->] := ltgtP l; have [uneg|upos|->] := ltgtP u => lx xu.
- apply: ISignNonPos => //; first exact: ltW.
have:= le_trans xu (eqbRL (le_num_itv_bound _ _) (ltW uneg)).
by rewrite bnd_simp.
- exact: ISignBoth.
- exact: ISignNonPos.
- have:= @ltxx _ _ (num_itv_bound R l).
rewrite (le_lt_trans lx) -?leBRight_ltBLeft ?(le_trans xu)//.
by rewrite le_num_itv_bound (le_trans (ltW uneg)).
- apply: ISignNonNeg => //; first exact: ltW.
have:= le_trans (eqbRL (le_num_itv_bound _ _) (ltW lpos)) lx.
by rewrite bnd_simp.
- have:= @ltxx _ _ (num_itv_bound R l).
rewrite (le_lt_trans lx) -?leBRight_ltBLeft ?(le_trans xu)//.
by rewrite le_num_itv_bound ?leBRight_ltBLeft.
- have:= @ltxx _ _ (num_itv_bound R (BLeft 0%Z)).
rewrite (le_lt_trans lx) -?leBRight_ltBLeft ?(le_trans xu)//.
by rewrite le_num_itv_bound -?ltBRight_leBLeft.
- exact: ISignNonNeg.
- apply: ISignEqZero => //.
by apply/le_anti/andP; move: lx xu; rewrite !bnd_simp.
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
|
signP
| |
num_itv_mul_boundlb1 b2 (x1 x2 : R) :
(BLeft 0%:Z <= b1 -> BLeft 0%:Z <= b2 ->
num_itv_bound R b1 <= BLeft x1 ->
num_itv_bound R b2 <= BLeft x2 ->
num_itv_bound R (mul_boundl b1 b2) <= BLeft (x1 * x2))%O.
Proof.
move: b1 b2 => [[] b1 | []//] [[] b2 | []//] /=; rewrite 4!bnd_simp.
- set bl := match b1 with 0%Z => _ | _ => _ end.
have -> : bl = BLeft (b1 * b2).
rewrite {}/bl; move: b1 b2 => [[|p1]|p1] [[|p2]|p2]; congr BLeft.
by rewrite mulr0.
by rewrite bnd_simp intrM -2!(ler0z R); apply: ler_pM.
- case: b1 => [[|b1] | b1]; rewrite !bnd_simp// => b1p b2p sx1 sx2.
+ by rewrite mulr_ge0 ?(le_trans _ (ltW sx2)) ?ler0z.
+ rewrite intrM (@lt_le_trans _ _ (b1.+1%:~R * x2)) ?ltr_pM2l//.
by rewrite ler_pM2r// (le_lt_trans _ sx2) ?ler0z.
- case: b2 => [[|b2] | b2]; rewrite !bnd_simp// => b1p b2p sx1 sx2.
+ by rewrite mulr_ge0 ?(le_trans _ (ltW sx1)) ?ler0z.
+ rewrite intrM (@le_lt_trans _ _ (b1%:~R * x2)) ?ler_wpM2l ?ler0z//.
by rewrite ltr_pM2r ?(lt_le_trans _ sx2).
- by rewrite -2!(ler0z R) bnd_simp intrM; apply: ltr_pM.
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_mul_boundl
| |
num_itv_mul_boundrb1 b2 (x1 x2 : R) :
(0 <= x1 -> 0 <= x2 ->
BRight x1 <= num_itv_bound R b1 ->
BRight x2 <= num_itv_bound R b2 ->
BRight (x1 * x2) <= num_itv_bound R (mul_boundr b1 b2))%O.
Proof.
case: b1 b2 => [b1b b1 | []] [b2b b2 | []] //= x1p x2p; last first.
- case: b2b b2 => -[[|//] | //] _ x20.
+ have:= @ltxx _ (itv_bound R) (BLeft 0%:~R).
by rewrite (lt_le_trans _ x20).
+ have -> : x2 = 0 by apply/le_anti/andP.
by rewrite mulr0.
- case: b1b b1 => -[[|//] |//] x10 _.
+ have:= @ltxx _ (itv_bound R) (BLeft 0%Z%:~R).
by rewrite (lt_le_trans _ x10).
+ by have -> : x1 = 0; [apply/le_anti/andP | rewrite mul0r].
case: b1b b2b => -[]; rewrite -[intRing.mulz]/GRing.mul.
- case: b1 => [[|b1] | b1]; rewrite !bnd_simp => x1b x2b.
+ by have:= @ltxx _ R 0; rewrite (le_lt_trans x1p x1b).
+ case: b2 x2b => [[| b2] | b2] => x2b; rewrite bnd_simp.
* by have:= @ltxx _ R 0; rewrite (le_lt_trans x2p x2b).
* by rewrite intrM ltr_pM.
* have:= @ltxx _ R 0; rewrite (le_lt_trans x2p)//.
by rewrite (lt_le_trans x2b) ?lerz0.
+ have:= @ltxx _ R 0; rewrite (le_lt_trans x1p)//.
by rewrite (lt_le_trans x1b) ?lerz0.
- case: b1 => [[|b1] | b1]; rewrite !bnd_simp => x1b x2b.
+ by have:= @ltxx _ R 0; rewrite (le_lt_trans x1p x1b).
+ case: b2 x2b => [[| b2] | b2] x2b; rewrite bnd_simp.
* exact: mulr_ge0_le0.
* by rewrite intrM (le_lt_trans (ler_wpM2l x1p x2b)) ?ltr_pM2r.
* have:= @ltxx _ _ x2.
by rewrite (le_lt_trans x2b) ?(lt_le_trans _ x2p)
...
|
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_mul_boundr
| |
BRight_le_mul_boundrb1 b2 (x1 x2 : R) :
(0 <= x1 -> x2 \in Num.real -> BRight 0%Z <= b2 ->
BRight x1 <= num_itv_bound R b1 ->
BRight x2 <= num_itv_bound R b2 ->
BRight (x1 * x2) <= num_itv_bound R (mul_boundr b1 b2))%O.
Proof.
move=> x1ge0 x2r b2ge0 lex1b1 lex2b2.
have /orP[x2ge0 | x2le0] := x2r; first exact: num_itv_mul_boundr.
have lem0 : (BRight (x1 * x2) <= BRight 0%R)%O.
by rewrite bnd_simp mulr_ge0_le0 // ltW.
apply: le_trans lem0 _.
rewrite -(mulr0z 1) BRight_le_num_itv_bound.
apply: mul_boundr_gt0 => //.
by rewrite -(@BRight_le_num_itv_bound R) (le_trans _ lex1b1).
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_mul_boundr
| |
comparable_num_itv_bound(x y : itv_bound int) :
(num_itv_bound R x >=< num_itv_bound R y)%O.
Proof.
by case: x y => [[] x | []] [[] y | []]//; apply/orP;
rewrite !bnd_simp ?ler_int ?ltr_int;
case: leP => xy; apply/orP => //; rewrite ltW ?orbT.
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
|
comparable_num_itv_bound
| |
num_itv_bound_min(x y : itv_bound int) :
num_itv_bound R (Order.min x y)
= Order.min (num_itv_bound R x) (num_itv_bound R y).
Proof.
have [lexy | ltyx] := leP x y; [by rewrite !minEle le_num_itv_bound lexy|].
rewrite minElt -if_neg -comparable_leNgt ?le_num_itv_bound ?ltW//.
exact: comparable_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_min
| |
num_itv_bound_max(x y : itv_bound int) :
num_itv_bound R (Order.max x y)
= Order.max (num_itv_bound R x) (num_itv_bound R y).
Proof.
have [lexy | ltyx] := leP x y; [by rewrite !maxEle le_num_itv_bound lexy|].
rewrite maxElt -if_neg -comparable_leNgt ?le_num_itv_bound ?ltW//.
exact: comparable_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_max
| |
num_spec_mul(xi yi : Itv.t) (x : num_def R xi) (y : num_def R yi)
(r := Itv.real2 mul xi yi) :
num_spec r (x%:num * y%:num).
Proof.
rewrite {}/r; case: xi yi x y => [//| [xl xu]] [//| [yl yu]].
case=> [x /=/and3P[xr /= xlx xxu]] [y /=/and3P[yr /= yly yyu]].
rewrite -/(sign (Interval xl xu)) -/(sign (Interval yl yu)).
have ns000 : @Itv.num_sem R `[0, 0] 0 by apply/and3P.
have xyr : x * y \in Num.real by exact: realM.
case: (signP xlx xxu xr) => xlb xub xs.
- by rewrite xs mul0r; case: (signP yly yyu yr).
- case: (signP yly yyu yr) => ylb yub ys.
+ by rewrite ys mulr0.
+ apply/and3P; split=> //=.
* exact: num_itv_mul_boundl xlx yly.
* exact: num_itv_mul_boundr xxu yyu.
+ apply/and3P; split=> //=; rewrite -[x * y]opprK -mulrN.
* by rewrite opp_boundl num_itv_mul_boundr ?oppr_ge0// opp_boundr.
* by rewrite opp_boundr num_itv_mul_boundl ?opp_boundl// opp_bound_ge0.
+ apply/and3P; split=> //=.
* rewrite -[x * y]opprK -mulrN opp_boundl.
by rewrite BRight_le_mul_boundr ?realN ?opp_boundr// opp_bound_gt0 ltW.
* by rewrite BRight_le_mul_boundr// ltW.
- case: (signP yly yyu yr) => ylb yub ys.
+ by rewrite ys mulr0.
+ apply/and3P; split=> //=; rewrite -[x * y]opprK -mulNr.
* rewrite opp_boundl.
by rewrite num_itv_mul_boundr ?oppr_ge0 ?opp_boundr.
* by rewrite opp_boundr num_itv_mul_boundl ?opp_boundl// opp_bound_ge0.
+ apply/and3P; split=> //=; rewrite -mulrNN.
* by rewrite num_itv_mul_boundl ?opp_bound_ge0 ?opp_boundl.
* by re
...
|
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_mul
| |
mul_inum(xi yi : Itv.t) (x : num_def R xi) (y : num_def R yi) :=
Itv.mk (num_spec_mul x y).
|
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
|
mul_inum
| |
num_spec_min(xi yi : Itv.t) (x : num_def R xi) (y : num_def R yi)
(r := Itv.real2 min xi yi) :
num_spec r (Order.min x%:num y%:num).
Proof.
apply: Itv.spec_real2 (Itv.P x) (Itv.P y).
case: x y => [x /= _] [y /= _] => {xi yi r} -[lx ux] [ly uy]/=.
move=> /andP[xr /=/andP[lxx xux]] /andP[yr /=/andP[lyy yuy]].
apply/and3P; split; rewrite ?min_real//= num_itv_bound_min real_BSide_min//.
- apply: (comparable_le_min2 (comparable_num_itv_bound _ _)) => //.
exact: real_comparable.
- apply: (comparable_le_min2 _ (comparable_num_itv_bound _ _)) => //.
exact: real_comparable.
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_min
| |
num_spec_max(xi yi : Itv.t) (x : num_def R xi) (y : num_def R yi)
(r := Itv.real2 max xi yi) :
num_spec r (Order.max x%:num y%:num).
Proof.
apply: Itv.spec_real2 (Itv.P x) (Itv.P y).
case: x y => [x /= _] [y /= _] => {xi yi r} -[lx ux] [ly uy]/=.
move=> /andP[xr /=/andP[lxx xux]] /andP[yr /=/andP[lyy yuy]].
apply/and3P; split; rewrite ?max_real//= num_itv_bound_max real_BSide_max//.
- apply: (comparable_le_max2 (comparable_num_itv_bound _ _)) => //.
exact: real_comparable.
- apply: (comparable_le_max2 _ (comparable_num_itv_bound _ _)) => //.
exact: real_comparable.
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_max
| |
min_max_typd := MinMaxTyp {
min_max_sort : porderType d;
#[canonical=no]
min_max_sem : interval int -> min_max_sort -> bool;
#[canonical=no]
min_max_minP : forall (xi yi : Itv.t) (x : Itv.def min_max_sem xi)
(y : Itv.def min_max_sem yi),
let: r := Itv.real2 min xi yi in
Itv.spec min_max_sem r (Order.min x%:num y%:num);
#[canonical=no]
min_max_maxP : forall (xi yi : Itv.t) (x : Itv.def min_max_sem xi)
(y : Itv.def min_max_sem yi),
let: r := Itv.real2 max xi yi in
Itv.spec min_max_sem r (Order.max x%:num y%:num);
}.
|
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
|
min_max_typ
| |
min_typ_inumd (t : min_max_typ d) (xi yi : Itv.t)
(x : Itv.def (@min_max_sem d t) xi) (y : Itv.def (@min_max_sem d t) yi)
(r := Itv.real2 min xi yi) :=
Itv.mk (min_max_minP x y).
|
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
|
min_typ_inum
| |
max_typ_inumd (t : min_max_typ d) (xi yi : Itv.t)
(x : Itv.def (@min_max_sem d t) xi) (y : Itv.def (@min_max_sem d t) yi)
(r := Itv.real2 min xi yi) :=
Itv.mk (min_max_maxP x y).
|
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
|
max_typ_inum
| |
num_min_max_typ:= MinMaxTyp num_spec_min num_spec_max.
|
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
|
num_min_max_typ
| |
nat_num_spec(i : Itv.t) (n : nat) : nat_spec i n = num_spec i (n%:R : R).
Proof.
case: i => [//| [l u]]; rewrite /= /Itv.num_sem realn/=; congr (_ && _).
- by case: l => [[] l |//]; rewrite !bnd_simp ?pmulrn ?ler_int ?ltr_int.
- by case: u => [[] u |//]; rewrite !bnd_simp ?pmulrn ?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
|
nat_num_spec
| |
natmul_itv(i1 i2 : Itv.t) : Itv.t :=
match i1, i2 with
| Itv.Top, _ => Itv.Top
| _, Itv.Top => Itv.Real `]-oo, +oo[
| Itv.Real i1, Itv.Real i2 => Itv.Real (mul i1 i2)
end.
Arguments natmul_itv /.
|
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
|
natmul_itv
| |
num_spec_natmul(xi ni : Itv.t) (x : num_def R xi) (n : nat_def ni)
(r := natmul_itv xi ni) :
num_spec r (x%:num *+ n%:num).
Proof.
rewrite {}/r; case: xi x ni n => [//| xi] x [| ni] n.
by apply/and3P; case: n%:num => [|?]; rewrite ?mulr0n ?realrMn.
have Pn : num_spec (Itv.Real ni) (n%:num%:R : R).
by case: n => /= n; rewrite [Itv.nat_sem ni n](nat_num_spec (Itv.Real ni)).
rewrite -mulr_natr -[n%:num%:R]/((Itv.Def Pn)%:num).
by rewrite (@num_spec_mul (Itv.Real xi) (Itv.Real ni)).
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_natmul
| |
natmul_inum(xi ni : Itv.t) (x : num_def R xi) (n : nat_def ni) :=
Itv.mk (num_spec_natmul x n).
|
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
|
natmul_inum
| |
num_spec_int(i : Itv.t) (n : int) :
num_spec i n = num_spec i (n%:~R : R).
Proof.
case: i => [//| [l u]]; rewrite /= /Itv.num_sem num_real realz/=.
congr (andb _ _).
- by case: l => [[] l |//]; rewrite !bnd_simp intz ?ler_int ?ltr_int.
- by case: u => [[] u |//]; rewrite !bnd_simp intz ?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
|
num_spec_int
| |
num_spec_intmul(xi ii : Itv.t) (x : num_def R xi) (i : num_def int ii)
(r := natmul_itv xi ii) :
num_spec r (x%:num *~ i%:num).
Proof.
rewrite {}/r; case: xi x ii i => [//| xi] x [| ii] i.
by apply/and3P; case: i%:inum => [[|n] | n]; rewrite ?mulr0z ?realN ?realrMn.
have Pi : num_spec (Itv.Real ii) (i%:num%:~R : R).
by case: i => /= i; rewrite [Itv.num_sem ii i](num_spec_int (Itv.Real ii)).
rewrite -mulrzr -[i%:num%:~R]/((Itv.Def Pi)%:num).
by rewrite (@num_spec_mul (Itv.Real xi) (Itv.Real ii)).
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_intmul
| |
intmul_inum(xi ni : Itv.t) (x : num_def R xi) (n : num_def int ni) :=
Itv.mk (num_spec_intmul x n).
|
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
|
intmul_inum
| |
num_itv_bound_keep_pos(op : R -> R) (x : R) b :
{homo op : x / 0 <= x} -> {homo op : x / 0 < x} ->
(num_itv_bound R b <= BLeft x)%O ->
(num_itv_bound R (keep_pos_bound b) <= BLeft (op x))%O.
Proof.
case: b => [[] [] [| b] // | []//] hle hlt; rewrite !bnd_simp.
- exact: hle.
- by move=> blex; apply: le_lt_trans (hlt _ _) => //; apply: lt_le_trans blex.
- exact: hlt.
- by move=> bltx; apply: le_lt_trans (hlt _ _) => //; apply: le_lt_trans bltx.
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_keep_pos
| |
num_itv_bound_keep_neg(op : R -> R) (x : R) b :
{homo op : x / x <= 0} -> {homo op : x / x < 0} ->
(BRight x <= num_itv_bound R b)%O ->
(BRight (op x) <= num_itv_bound R (keep_neg_bound b))%O.
Proof.
case: b => [[] [[|//] | b] | []//] hge hgt; rewrite !bnd_simp.
- exact: hgt.
- by move=> xltb; apply: hgt; apply: lt_le_trans xltb _; rewrite lerz0.
- exact: hge.
- by move=> xleb; apply: hgt; apply: le_lt_trans xleb _; rewrite ltrz0.
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_keep_neg
| |
num_spec_inv(i : Itv.t) (x : num_def R i) (r := Itv.real1 inv i) :
num_spec r (x%:num^-1).
Proof.
apply: Itv.spec_real1 (Itv.P x).
case: x => x /= _ [l u] /and3P[xr /= lx xu].
rewrite /Itv.num_sem/= realV xr/=; apply/andP; split.
- apply: num_itv_bound_keep_pos lx.
+ by move=> ?; rewrite invr_ge0.
+ by move=> ?; rewrite invr_gt0.
- apply: num_itv_bound_keep_neg xu.
+ by move=> ?; rewrite invr_le0.
+ by move=> ?; rewrite invr_lt0.
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_inv
| |
inv_inum(i : Itv.t) (x : num_def R i) := Itv.mk (num_spec_inv 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
|
inv_inum
| |
num_itv_bound_exprn_le1(x : R) n l u :
(num_itv_bound R l <= BLeft x)%O ->
(BRight x <= num_itv_bound R u)%O ->
(BRight (x ^+ n) <= num_itv_bound R (exprn_le1_bound l u))%O.
Proof.
case: u => [bu [[//|[|//]] |//] | []//].
rewrite /exprn_le1_bound; case: (leP _ l) => [lge1 /= |//] lx xu.
rewrite bnd_simp; case: n => [| n]; rewrite ?expr0//.
have xN1 : -1 <= x.
case: l lge1 lx => [[] l | []//]; rewrite !bnd_simp -(@ler_int R).
- exact: le_trans.
- by move=> + /ltW; apply: le_trans.
have x1 : x <= 1 by case: bu xu; rewrite bnd_simp// => /ltW.
have xr : x \is Num.real by exact: ler1_real.
case: (real_ge0P xr) => x0; first by rewrite expr_le1.
rewrite -[x]opprK exprNn; apply: le_trans (ler_piMl _ _) _.
- by rewrite exprn_ge0 ?oppr_ge0 1?ltW.
- suff: -1 <= (-1) ^+ n.+1 :> R /\ (-1) ^+ n.+1 <= 1 :> R => [[]//|].
elim: n => [|n [IHn1 IHn2]]; rewrite ?expr1// ![_ ^+ n.+2]exprS !mulN1r.
by rewrite lerNl opprK lerNl.
- by rewrite expr_le1 ?oppr_ge0 1?lerNl// ltW.
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_exprn_le1
| |
num_spec_exprn(i : Itv.t) (x : num_def R i) n (r := Itv.real1 exprn i) :
num_spec r (x%:num ^+ n).
Proof.
apply: (@Itv.spec_real1 _ _ (fun x => x^+n) _ _ _ _ (Itv.P x)).
case: x => x /= _ [l u] /and3P[xr /= lx xu].
rewrite /Itv.num_sem realX//=; apply/andP; split.
- apply: (@num_itv_bound_keep_pos (fun x => x^+n)) lx.
+ exact: exprn_ge0.
+ exact: exprn_gt0.
- exact: num_itv_bound_exprn_le1 lx xu.
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_exprn
| |
exprn_inum(i : Itv.t) (x : num_def R i) n :=
Itv.mk (num_spec_exprn x n).
|
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
|
exprn_inum
| |
num_spec_exprz(xi ki : Itv.t) (x : num_def R xi) (k : num_def int ki)
(r := Itv.real2 exprz xi ki) :
num_spec r (x%:num ^ k%:num).
Proof.
rewrite {}/r; case: ki k => [|[lk uk]] k; first by case: xi x.
case: xi x => [//|xi x]; rewrite /Itv.real2.
have P : Itv.num_sem
(let 'Interval l _ := xi in Interval (keep_pos_bound l) +oo)
(x%:num ^ k%:num).
case: xi x => lx ux x; apply/and3P; split=> [||//].
have xr : x%:num \is Num.real by case: x => x /=/andP[].
by case: k%:num => n; rewrite ?realV realX.
apply: (@num_itv_bound_keep_pos (fun x => x ^ k%:num));
[exact: exprz_ge0 | exact: exprz_gt0 |].
by case: x => x /=/and3P[].
case: lk k P => [slk [lk | lk] | slk] k P; [|exact: P..].
case: k P => -[k | k] /= => [_ _|]; rewrite -/(exprn xi); last first.
by move=> /and3P[_ /=]; case: slk; rewrite bnd_simp -pmulrn natz.
exact: (@num_spec_exprn (Itv.Real xi)).
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_exprz
| |
exprz_inum(xi ki : Itv.t) (x : num_def R xi) (k : num_def int ki) :=
Itv.mk (num_spec_exprz x k).
|
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
|
exprz_inum
| |
num_spec_norm{V : normedZmodType R} (x : V) :
num_spec (Itv.Real `[0, +oo[) `|x|.
Proof. by apply/and3P; split; rewrite //= ?normr_real ?bnd_simp ?normr_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
|
num_spec_norm
| |
norm_inum{V : normedZmodType R} (x : V) := Itv.mk (num_spec_norm 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
|
norm_inum
| |
sqrt_itv(i : Itv.t) : Itv.t :=
match i with
| Itv.Top => Itv.Real `[0%Z, +oo[
| Itv.Real (Interval l u) =>
match l with
| BSide b 0%Z => Itv.Real (Interval (BSide b 0%Z) +oo)
| BSide b (Posz (S _)) => Itv.Real `]0%Z, +oo[
| _ => Itv.Real `[0, +oo[
end
end.
Arguments sqrt_itv /.
|
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
|
sqrt_itv
| |
num_spec_sqrt(i : Itv.t) (x : num_def R i) (r := sqrt_itv i) :
num_spec r (Num.sqrt x%:num).
Proof.
have: Itv.num_sem `[0%Z, +oo[ (Num.sqrt x%:num).
by apply/and3P; rewrite /= num_real !bnd_simp sqrtr_ge0.
rewrite {}/r; case: i x => [//| [[bl [l |//] |//] u]] [x /= +] _.
case: bl l => -[| l] /and3P[xr /= bx _]; apply/and3P; split=> //=;
move: bx; rewrite !bnd_simp ?sqrtr_ge0// sqrtr_gt0;
[exact: lt_le_trans | exact: le_lt_trans..].
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_sqrt
| |
sqrt_inum(i : Itv.t) (x : num_def R i) := Itv.mk (num_spec_sqrt 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
|
sqrt_inum
| |
sqrtC_itv(i : Itv.t) : Itv.t :=
match i with
| Itv.Top => Itv.Top
| Itv.Real (Interval l u) =>
match l with
| BSide b (Posz _) => Itv.Real (Interval (BSide b 0%Z) +oo)
| _ => Itv.Top
end
end.
Arguments sqrtC_itv /.
|
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
|
sqrtC_itv
| |
num_spec_sqrtC(i : Itv.t) (x : num_def R i) (r := sqrtC_itv i) :
num_spec r (sqrtC x%:num).
Proof.
rewrite {}/r; case: i x => [//| [l u] [x /=/and3P[xr /= lx xu]]].
case: l lx => [bl [l |//] |[]//] lx; apply/and3P; split=> //=.
by apply: sqrtC_real; case: bl lx => /[!bnd_simp] [|/ltW]; apply: le_trans.
case: bl lx => /[!bnd_simp] lx.
- by rewrite sqrtC_ge0; apply: le_trans lx.
- by rewrite sqrtC_gt0; apply: le_lt_trans lx.
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_sqrtC
| |
sqrtC_inum(i : Itv.t) (x : num_def R i) := Itv.mk (num_spec_sqrtC 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
|
sqrtC_inum
| |
nat_spec_zero: nat_spec (Itv.Real `[0, 0]%Z) 0. 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_spec_zero
| |
zeron_inum:= Itv.mk nat_spec_zero.
|
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
|
zeron_inum
| |
nat_spec_add(xi yi : Itv.t) (x : nat_def xi) (y : nat_def yi)
(r := Itv.real2 add xi yi) :
nat_spec r (x%:num + y%:num).
Proof.
have Px : num_spec xi (x%:num%:R : int).
by case: x => /= x; rewrite (@nat_num_spec int).
have Py : num_spec yi (y%:num%:R : int).
by case: y => /= y; rewrite (@nat_num_spec int).
rewrite (@nat_num_spec int) natrD.
rewrite -[x%:num%:R]/((Itv.Def Px)%:num) -[y%:num%:R]/((Itv.Def Py)%:num).
exact: num_spec_add.
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_spec_add
| |
addn_inum(xi yi : Itv.t) (x : nat_def xi) (y : nat_def yi) :=
Itv.mk (nat_spec_add x y).
|
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
|
addn_inum
| |
nat_spec_succ(i : Itv.t) (n : nat_def i)
(r := Itv.real2 add i (Itv.Real `[1, 1]%Z)) :
nat_spec r (S n%:num).
Proof.
pose i1 := Itv.Real `[1, 1]%Z; have P1 : nat_spec i1 1 by [].
by rewrite -addn1 -[1%N]/((Itv.Def P1)%:num); apply: nat_spec_add.
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_spec_succ
| |
succn_inum(i : Itv.t) (n : nat_def i) := Itv.mk (nat_spec_succ n).
|
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
|
succn_inum
| |
nat_spec_double(i : Itv.t) (n : nat_def i) (r := Itv.real2 add i i) :
nat_spec r (n%:num.*2).
Proof. by rewrite -addnn nat_spec_add. 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_spec_double
| |
double_inum(i : Itv.t) (x : nat_def i) := Itv.mk (nat_spec_double 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
|
double_inum
| |
nat_spec_mul(xi yi : Itv.t) (x : nat_def xi) (y : nat_def yi)
(r := Itv.real2 mul xi yi) :
nat_spec r (x%:num * y%:num).
Proof.
have Px : num_spec xi (x%:num%:R : int).
by case: x => /= x; rewrite (@nat_num_spec int).
have Py : num_spec yi (y%:num%:R : int).
by case: y => /= y; rewrite (@nat_num_spec int).
rewrite (@nat_num_spec int) natrM.
rewrite -[x%:num%:R]/((Itv.Def Px)%:num) -[y%:num%:R]/((Itv.Def Py)%:num).
exact: num_spec_mul.
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_spec_mul
| |
muln_inum(xi yi : Itv.t) (x : nat_def xi) (y : nat_def yi) :=
Itv.mk (nat_spec_mul x y).
|
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
|
muln_inum
| |
nat_spec_exp(i : Itv.t) (x : nat_def i) n (r := Itv.real1 exprn i) :
nat_spec r (x%:num ^ n).
Proof.
have Px : num_spec i (x%:num%:R : int).
by case: x => /= x; rewrite (@nat_num_spec int).
rewrite (@nat_num_spec int) natrX -[x%:num%:R]/((Itv.Def Px)%:num).
exact: num_spec_exprn.
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_spec_exp
| |
expn_inum(i : Itv.t) (x : nat_def i) n := Itv.mk (nat_spec_exp x n).
|
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
|
expn_inum
| |
nat_spec_min(xi yi : Itv.t) (x : nat_def xi) (y : nat_def yi)
(r := Itv.real2 min xi yi) :
nat_spec r (minn x%:num y%:num).
Proof.
have Px : num_spec xi (x%:num%:R : int).
by case: x => /= x; rewrite (@nat_num_spec int).
have Py : num_spec yi (y%:num%:R : int).
by case: y => /= y; rewrite (@nat_num_spec int).
rewrite (@nat_num_spec int) -minEnat natr_min.
rewrite -[x%:num%:R]/((Itv.Def Px)%:num) -[y%:num%:R]/((Itv.Def Py)%:num).
exact: num_spec_min.
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_spec_min
| |
minn_inum(xi yi : Itv.t) (x : nat_def xi) (y : nat_def yi) :=
Itv.mk (nat_spec_min x y).
|
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
|
minn_inum
| |
nat_spec_max(xi yi : Itv.t) (x : nat_def xi) (y : nat_def yi)
(r := Itv.real2 max xi yi) :
nat_spec r (maxn x%:num y%:num).
Proof.
have Px : num_spec xi (x%:num%:R : int).
by case: x => /= x; rewrite (@nat_num_spec int).
have Py : num_spec yi (y%:num%:R : int).
by case: y => /= y; rewrite (@nat_num_spec int).
rewrite (@nat_num_spec int) -maxEnat natr_max.
rewrite -[x%:num%:R]/((Itv.Def Px)%:num) -[y%:num%:R]/((Itv.Def Py)%:num).
exact: num_spec_max.
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_spec_max
| |
maxn_inum(xi yi : Itv.t) (x : nat_def xi) (y : nat_def yi) :=
Itv.mk (nat_spec_max x y).
|
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
|
maxn_inum
| |
nat_min_max_typ:= MinMaxTyp nat_spec_min nat_spec_max.
|
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_min_max_typ
| |
nat_spec_factorial(n : nat) : nat_spec (Itv.Real `[1%Z, +oo[) n`!.
Proof. by apply/andP; rewrite bnd_simp lez_nat fact_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
|
nat_spec_factorial
| |
factorial_inumn := Itv.mk (nat_spec_factorial n).
|
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
|
factorial_inum
| |
num_spec_Poszn : num_spec (Itv.Real `[0, +oo[) (Posz n).
Proof. by apply/and3P; rewrite /= num_real !bnd_simp. 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_Posz
| |
Posz_inumn := Itv.mk (num_spec_Posz n).
|
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
|
Posz_inum
| |
num_spec_Negzn : num_spec (Itv.Real `]-oo, (-1)]) (Negz n).
Proof. by apply/and3P; rewrite /= num_real !bnd_simp. 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_Negz
| |
Negz_inumn := Itv.mk (num_spec_Negz n).
|
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
|
Negz_inum
| |
num_eq: {mono num : x y / x == y}. 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
|
num_eq
| |
num_le: {mono num : x y / (x <= y)%O}. 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
|
num_le
| |
num_lt: {mono num : x y / (x < y)%O}. 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
|
num_lt
| |
num_min: {morph num : x y / Order.min x y}.
Proof. by move=> x y; rewrite !minEle num_le -fun_if. 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_min
| |
num_max: {morph num : x y / Order.max x y}.
Proof. by move=> x y; rewrite !maxEle num_le -fun_if. 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_max
| |
num_abs_eq0(a : R) : (`|a|%:nng == 0%:nng) = (a == 0).
Proof. by rewrite -normr_eq0. 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_abs_eq0
| |
num_le_maxa x y :
a <= Num.max x%:num y%:num = (a <= x%:num) || (a <= y%:num).
Proof. by rewrite -comparable_le_max// real_comparable. 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_le_max
| |
num_ge_maxa x y :
Num.max x%:num y%:num <= a = (x%:num <= a) && (y%:num <= a).
Proof. by rewrite -comparable_ge_max// real_comparable. 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_ge_max
| |
num_le_mina x y :
a <= Num.min x%:num y%:num = (a <= x%:num) && (a <= y%:num).
Proof. by rewrite -comparable_le_min// real_comparable. 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_le_min
| |
num_ge_mina x y :
Num.min x%:num y%:num <= a = (x%:num <= a) || (y%:num <= a).
Proof. by rewrite -comparable_ge_min// real_comparable. 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_ge_min
| |
num_lt_maxa x y :
a < Num.max x%:num y%:num = (a < x%:num) || (a < y%:num).
Proof. by rewrite -comparable_lt_max// real_comparable. 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_lt_max
| |
num_gt_maxa x y :
Num.max x%:num y%:num < a = (x%:num < a) && (y%:num < a).
Proof. by rewrite -comparable_gt_max// real_comparable. 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_gt_max
| |
num_lt_mina x y :
a < Num.min x%:num y%:num = (a < x%:num) && (a < y%:num).
Proof. by rewrite -comparable_lt_min// real_comparable. 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_lt_min
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.