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 |
|---|---|---|---|---|---|---|
real_ceil_floorx : x \is real_num ->
ceil x = floor x + (x \isn't a int_num).
Proof.
case Ix: (x \is a int_num) => Rx /=.
by apply/eqP; rewrite addr0 ceilNfloor eqr_oppLR floorN.
apply/ceil_def; rewrite addrK; move: (real_floor_itv Rx).
by rewrite le_eqVlt -intrEfloor Ix /= => /andP[-> /ltW].
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
real_ceil_floor
| |
truncn_floorx : truncn x = if 0 <= x then `|floor x|%N else 0%N.
Proof.
move: (floorP x); rewrite truncEfloor realE.
have [/le_floor|_]/= := boolP (0 <= x); first by rewrite floor0; case: floor.
by case: ifP => [/le_floor|_ /eqP->//]; rewrite floor0; case: floor => [[]|].
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
truncn_floor
| |
truncn_itvx : 0 <= x -> (truncn x)%:R <= x < (truncn x).+1%:R.
Proof. by move=> x_ge0; move: (truncnP x); rewrite x_ge0. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
truncn_itv
| |
truncn_lex : (truncn x)%:R <= x = (0 <= x).
Proof. by case: ifP (truncnP x) => [+ /andP[] | + /eqP->//]. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
truncn_le
| |
real_truncnS_gtx : x \is real_num -> x < (truncn x).+1%:R.
Proof. by move/real_ge0P => [/truncn_itv/andP[]|/lt_le_trans->]. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
real_truncnS_gt
| |
truncn_defx n : n%:R <= x < n.+1%:R -> truncn x = n.
Proof.
case/andP=> lemx ltxm1; apply/eqP; rewrite eqn_leq -ltnS -[(n <= _)%N]ltnS.
have/truncn_itv/andP[lefx ltxf1]: 0 <= x by apply: le_trans lemx; apply: ler0n.
by rewrite -!(ltr_nat R) 2?(@le_lt_trans _ _ x).
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
truncn_def
| |
truncn_ge_natx n : 0 <= x -> (n <= truncn x)%N = (n%:R <= x).
Proof.
move=> /truncn_itv /andP[letx ltxt1]; apply/idP/idP => lenx.
by apply: le_trans letx; rewrite ler_nat.
by rewrite -ltnS -(ltr_nat R); apply: le_lt_trans ltxt1.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
truncn_ge_nat
| |
truncn_gt_natx n : (n < truncn x)%N = (n.+1%:R <= x).
Proof.
case: ifP (truncnP x) => [x0 _ | x0 /eqP->]; first by rewrite truncn_ge_nat.
by rewrite ltn0; apply/esym/(contraFF _ x0)/le_trans.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
truncn_gt_nat
| |
truncn_lt_natx n : 0 <= x -> (truncn x < n)%N = (x < n%:R).
Proof. by move=> ?; rewrite real_ltNge ?ger0_real// ltnNge truncn_ge_nat. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
truncn_lt_nat
| |
real_truncn_le_natx n :
x \is real_num -> (truncn x <= n)%N = (x < n.+1%:R).
Proof. by move=> ?; rewrite real_ltNge// leqNgt truncn_gt_nat. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
real_truncn_le_nat
| |
truncn_eqx n : 0 <= x -> (truncn x == n) = (n%:R <= x < n.+1%:R).
Proof.
by move=> xr; apply/eqP/idP => [<-|]; [exact: truncn_itv|exact: truncn_def].
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
truncn_eq
| |
le_truncn: {homo truncn : x y / x <= y >-> (x <= y)%N}.
Proof.
move=> x y lexy; move: (truncnP x) (truncnP y).
case: ifP => [x0 /andP[letx _] | x0 /eqP->//].
case: ifP => [y0 /andP[_] | y0 /eqP->]; [|by rewrite (le_trans x0 lexy) in y0].
by move=> /(le_lt_trans lexy) /(le_lt_trans letx); rewrite ltr_nat ltnS.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
le_truncn
| |
natrK: cancel (GRing.natmul 1) truncn.
Proof. by move=> m; apply: truncn_def; rewrite ler_nat ltr_nat ltnS leqnn. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
natrK
| |
natrEtruncnx : (x \is a nat_num) = ((truncn x)%:R == x).
Proof.
by apply/natrP/eqP => [[n ->]|<-]; [rewrite natrK | exists (truncn x)].
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
natrEtruncn
| |
archi_boundPx : 0 <= x -> x < (bound x)%:R.
Proof.
move=> x_ge0; case/truncn_itv/andP: (normr_ge0 x) => _.
exact/le_lt_trans/real_ler_norm/ger0_real.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
archi_boundP
| |
truncnK: {in nat_num, cancel truncn (GRing.natmul 1)}.
Proof. by move=> x; rewrite natrEtruncn => /eqP. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
truncnK
| |
truncn0: truncn 0 = 0%N. Proof. exact: natrK 0%N. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
truncn0
| |
truncn1: truncn 1 = 1%N. Proof. exact: natrK 1%N. Qed.
#[local] Hint Resolve truncn0 truncn1 : core.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
truncn1
| |
truncnD:
{in nat_num & nneg_num, {morph truncn : x y / x + y >-> (x + y)%N}}.
Proof.
move=> _ y /natrP[n ->] y_ge0; apply: truncn_def.
by rewrite -addnS !natrD !natrK lerD2l ltrD2l truncn_itv.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
truncnD
| |
truncnM: {in nat_num &, {morph truncn : x y / x * y >-> (x * y)%N}}.
Proof. by move=> _ _ /natrP[n1 ->] /natrP[n2 ->]; rewrite -natrM !natrK. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
truncnM
| |
truncnXn : {in nat_num, {morph truncn : x / x ^+ n >-> (x ^ n)%N}}.
Proof. by move=> _ /natrP[n1 ->]; rewrite -natrX !natrK. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
truncnX
| |
truncn_gt0x : (0 < truncn x)%N = (1 <= x).
Proof.
case: ifP (truncnP x) => [x0 | x0 /eqP<-]; first by rewrite truncn_ge_nat.
by rewrite ltnn; apply/esym/(contraFF _ x0)/le_trans.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
truncn_gt0
| |
truncn0Pnx : reflect (truncn x = 0%N) (~~ (1 <= x)).
Proof. by rewrite -truncn_gt0 -eqn0Ngt; apply: eqP. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
truncn0Pn
| |
sum_truncnKI r (P : pred I) F : (forall i, P i -> F i \is a nat_num) ->
(\sum_(i <- r | P i) truncn (F i))%:R = \sum_(i <- r | P i) F i.
Proof. by rewrite natr_sum => natr; apply: eq_bigr => i /natr /truncnK. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
sum_truncnK
| |
prod_truncnKI r (P : pred I) F : (forall i, P i -> F i \is a nat_num) ->
(\prod_(i <- r | P i) truncn (F i))%:R = \prod_(i <- r | P i) F i.
Proof. by rewrite natr_prod => natr; apply: eq_bigr => i /natr /truncnK. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
prod_truncnK
| |
natr_sum_eq1(I : finType) (P : pred I) (F : I -> R) :
(forall i, P i -> F i \is a nat_num) -> \sum_(i | P i) F i = 1 ->
{i : I | [/\ P i, F i = 1 & forall j, j != i -> P j -> F j = 0]}.
Proof.
move=> natF /eqP; rewrite -sum_truncnK// -[1]/1%:R eqr_nat => /sum_nat_eq1 exi.
have [i /and3P[Pi /eqP f1 /forallP a]] : {i : I | [&& P i, truncn (F i) == 1
& [forall j : I, ((j != i) ==> P j ==> (truncn (F j) == 0))]]}.
apply/sigW; have [i [Pi /eqP f1 a]] := exi; exists i; apply/and3P; split=> //.
by apply/forallP => j; apply/implyP => ji; apply/implyP => Pj; apply/eqP/a.
exists i; split=> [//||j ji Pj]; rewrite -[LHS]truncnK ?natF ?f1//; apply/eqP.
by rewrite -[0]/0%:R eqr_nat; apply: implyP Pj; apply: implyP ji; apply: a.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
natr_sum_eq1
| |
natr_mul_eq1x y :
x \is a nat_num -> y \is a nat_num -> (x * y == 1) = (x == 1) && (y == 1).
Proof. by do 2!move/truncnK <-; rewrite -natrM !pnatr_eq1 muln_eq1. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
natr_mul_eq1
| |
natr_prod_eq1(I : finType) (P : pred I) (F : I -> R) :
(forall i, P i -> F i \is a nat_num) -> \prod_(i | P i) F i = 1 ->
forall i, P i -> F i = 1.
Proof.
move=> natF /eqP; rewrite -prod_truncnK// -[1]/1%:R eqr_nat prod_nat_seq_eq1.
move/allP => a i Pi; apply/eqP; rewrite -[F i]truncnK ?natF// eqr_nat.
by apply: implyP Pi; apply: a; apply: mem_index_enum.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
natr_prod_eq1
| |
raddfZ_nata u : a \is a nat_num -> f (a *: u) = a *: f u.
Proof. by move=> /natrP[n ->]; apply: raddfZnat. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
raddfZ_nat
| |
rpredZ_nat(S : addrClosed V) :
{in nat_num & S, forall z u, z *: u \in S}.
Proof. by move=> _ u /natrP[n ->]; apply: rpredZnat. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
rpredZ_nat
| |
raddfZ_inta u : a \is a int_num -> f (a *: u) = a *: f u.
Proof. by move=> /intrP[m ->]; rewrite !scaler_int raddfMz. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
raddfZ_int
| |
rpredZ_int(S : zmodClosed V) :
{in int_num & S, forall z u, z *: u \in S}.
Proof. by move=> _ u /intrP[m ->] ?; rewrite scaler_int rpredMz. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
rpredZ_int
| |
aut_natrnu : {in nat_num, nu =1 id}.
Proof. by move=> _ /natrP[n ->]; apply: rmorph_nat. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
aut_natr
| |
aut_intrnu : {in int_num, nu =1 id}.
Proof. by move=> _ /intrP[m ->]; apply: rmorph_int. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
aut_intr
| |
trunc_itv:= truncn_itv.
#[deprecated(since="mathcomp 2.4.0", note="Renamed to truncn_def.")]
|
Notation
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
trunc_itv
| |
trunc_def:= truncn_def.
#[deprecated(since="mathcomp 2.4.0", note="Renamed to truncnK.")]
|
Notation
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
trunc_def
| |
truncK:= truncnK.
#[deprecated(since="mathcomp 2.4.0", note="Renamed to truncn0.")]
|
Notation
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
truncK
| |
trunc0:= truncn0.
#[deprecated(since="mathcomp 2.4.0", note="Renamed to truncn1.")]
|
Notation
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
trunc0
| |
trunc1:= truncn1.
#[deprecated(since="mathcomp 2.4.0", note="Renamed to truncnD.")]
|
Notation
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
trunc1
| |
truncD:= truncnD.
#[deprecated(since="mathcomp 2.4.0", note="Renamed to truncnM.")]
|
Notation
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
truncD
| |
truncM:= truncnM.
#[deprecated(since="mathcomp 2.4.0", note="Renamed to truncnX.")]
|
Notation
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
truncM
| |
truncX:= truncnX.
#[deprecated(since="mathcomp 2.4.0", note="Renamed to truncn_gt0.")]
|
Notation
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
truncX
| |
trunc_gt0:= truncn_gt0.
#[deprecated(since="mathcomp 2.4.0", note="Renamed to truncn0Pn.")]
|
Notation
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
trunc_gt0
| |
trunc0Pn:= truncn0Pn.
#[deprecated(since="mathcomp 2.4.0", note="Renamed to sum_truncnK.")]
|
Notation
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
trunc0Pn
| |
sum_truncK:= sum_truncnK.
#[deprecated(since="mathcomp 2.4.0", note="Renamed to prod_truncnK.")]
|
Notation
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
sum_truncK
| |
prod_truncK:= prod_truncnK.
#[deprecated(since="mathcomp 2.4.0", note="Renamed to truncn_floor.")]
|
Notation
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
prod_truncK
| |
trunc_floor:= truncn_floor.
#[deprecated(since="mathcomp 2.4.0", note="Renamed to real_floor_le.")]
|
Notation
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
trunc_floor
| |
real_ge_floor:= real_floor_le.
#[deprecated(since="mathcomp 2.4.0", note="Renamed to real_floorD1_gt.")]
|
Notation
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
real_ge_floor
| |
real_lt_succ_floor:= real_floorD1_gt.
#[deprecated(since="mathcomp 2.4.0", note="Renamed to real_ceilB1_lt.")]
|
Notation
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
real_lt_succ_floor
| |
real_gt_pred_ceil:= real_floorD1_gt.
#[deprecated(since="mathcomp 2.4.0", note="Renamed to real_ceil_ge.")]
|
Notation
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
real_gt_pred_ceil
| |
real_le_ceil:= real_ceil_ge.
#[deprecated(since="mathcomp 2.4.0", note="Renamed to le_ceil.")]
|
Notation
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
real_le_ceil
| |
ceil_le:= le_ceil.
#[deprecated(since="mathcomp 2.4.0", note="Renamed to natrEtruncn.")]
|
Notation
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
ceil_le
| |
natrE:= natrEtruncn.
#[deprecated(since="mathcomp 2.5.0", note="Renamed to le_ceil.")]
|
Notation
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
natrE
| |
le_ceil_tmp:= le_ceil.
#[deprecated(since="mathcomp 2.5.0", note="Renamed to real_floor_ge_int.")]
|
Notation
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
le_ceil_tmp
| |
real_floor_ge_int_tmp:= real_floor_ge_int (only parsing).
#[deprecated(since="mathcomp 2.5.0", note="Renamed to real_ceil_le_int.")]
|
Notation
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
real_floor_ge_int_tmp
| |
real_ceil_le_int_tmp:= real_ceil_le_int (only parsing).
Arguments natrK {R} _%_N.
Arguments intrKfloor {R}.
Arguments intrKceil {R}.
Arguments natrP {R x}.
Arguments intrP {R x}.
#[global] Hint Resolve truncn0 truncn1 : core.
#[global] Hint Resolve floor0 floor1 : core.
#[global] Hint Resolve ceil0 ceil1 : core.
#[global] Hint Extern 0 (is_true (_%:R \is a nat_num)) => apply: natr_nat : core.
#[global] Hint Extern 0 (is_true (_%:R \in nat_num_subdef)) => apply: natr_nat : core.
#[global] Hint Extern 0 (is_true (_%:~R \is a int_num)) => apply: intr_int : core.
#[global] Hint Extern 0 (is_true (_%:~R \in int_num_subdef)) => apply: intr_int : core.
#[global] Hint Extern 0 (is_true (_%:R \is a int_num)) => apply: natr_int : core.
#[global] Hint Extern 0 (is_true (_%:R \in int_num_subdef)) => apply: natr_int : core.
#[global] Hint Extern 0 (is_true (0 \is a nat_num)) => apply: nat_num0 : core.
#[global] Hint Extern 0 (is_true (0 \in nat_num_subdef)) => apply: nat_num0 : core.
#[global] Hint Extern 0 (is_true (1 \is a nat_num)) => apply: nat_num1 : core.
#[global] Hint Extern 0 (is_true (1 \in int_num_subdef)) => apply: nat_num1 : core.
#[global] Hint Extern 0 (is_true (0 \is a int_num)) => apply: int_num0 : core.
#[global] Hint Extern 0 (is_true (0 \in int_num_subdef)) => apply: int_num0 : core.
#[global] Hint Extern 0 (is_true (1 \is a int_num)) => apply: int_num1 : core.
#[global] Hint Extern 0 (is_true (1 \in int_num_subdef)) => apply: int_num1 : core.
|
Notation
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
real_ceil_le_int_tmp
| |
upper_nthrootPx i : (bound x <= i)%N -> x < 2%:R ^+ i.
Proof.
case/truncn_itv/andP: (normr_ge0 x) => _ /ltr_normlW xlt le_b_i.
by rewrite (lt_le_trans xlt) // -natrX ler_nat (ltn_trans le_b_i) // ltn_expl.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
upper_nthrootP
| |
truncnS_gtx : x < (truncn x).+1%:R.
Proof. exact: real_truncnS_gt. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
truncnS_gt
| |
truncn_le_natx n : (truncn x <= n)%N = (x < n.+1%:R).
Proof. exact: real_truncn_le_nat. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
truncn_le_nat
| |
floor_itvx : (floor x)%:~R <= x < (floor x + 1)%:~R.
Proof. exact: real_floor_itv. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
floor_itv
| |
floor_lex : (floor x)%:~R <= x. Proof. exact: real_floor_le. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
floor_le
| |
floorD1_gtx : x < (floor x + 1)%:~R.
Proof. exact: real_floorD1_gt. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
floorD1_gt
| |
floor_ge_intx n : (n <= floor x) = (n%:~R <= x).
Proof. exact: real_floor_ge_int. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
floor_ge_int
| |
floor_lt_intx n : (floor x < n) = (x < n%:~R).
Proof. exact: real_floor_lt_int. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
floor_lt_int
| |
floor_eqx n : (floor x == n) = (n%:~R <= x < (n + 1)%:~R).
Proof. exact: real_floor_eq. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
floor_eq
| |
floorDzr: {in @int_num R, {morph floor : x y / x + y}}.
Proof. by move=> x xz y; apply/real_floorDzr/num_real. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
floorDzr
| |
floorDrzx y : y \is a int_num -> floor (x + y) = floor x + floor y.
Proof. by move=> yz; apply/real_floorDrz/yz/num_real. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
floorDrz
| |
floor_ge0x : (0 <= floor x) = (0 <= x).
Proof. exact: real_floor_ge0. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
floor_ge0
| |
floor_le0x : (floor x <= 0) = (x < 1).
Proof. exact: real_floor_le0. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
floor_le0
| |
ceil_itvx : (ceil x - 1)%:~R < x <= (ceil x)%:~R.
Proof. exact: real_ceil_itv. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
ceil_itv
| |
ceilB1_ltx : (ceil x - 1)%:~R < x.
Proof. exact: real_ceilB1_lt. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
ceilB1_lt
| |
ceil_gex : x <= (ceil x)%:~R. Proof. exact: real_ceil_ge. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
ceil_ge
| |
ceil_le_intx n : (ceil x <= n) = (x <= n%:~R).
Proof. exact: real_ceil_le_int. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
ceil_le_int
| |
ceil_gt_intx n : (n < ceil x) = (n%:~R < x).
Proof. exact: real_ceil_gt_int. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
ceil_gt_int
| |
ceil_eqx n : (ceil x == n) = ((n - 1)%:~R < x <= n%:~R).
Proof. exact: real_ceil_eq. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
ceil_eq
| |
ceilDzr: {in @int_num R, {morph ceil : x y / x + y}}.
Proof. by move=> x xz y; apply/real_ceilDzr/num_real. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
ceilDzr
| |
ceilDrzx y : y \is a int_num -> ceil (x + y) = ceil x + ceil y.
Proof. by move=> yz; apply/real_ceilDrz/yz/num_real. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
ceilDrz
| |
ceil_ge0x : (0 <= ceil x) = (-1 < x).
Proof. exact: real_ceil_ge0. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
ceil_ge0
| |
ceil_le0x : (ceil x <= 0) = (x <= 0).
Proof. exact: real_ceil_le0. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
ceil_le0
| |
ceil_floorx : ceil x = floor x + (x \isn't a int_num).
Proof. exact: real_ceil_floor. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
ceil_floor
| |
ge_floor:= floor_le.
#[deprecated(since="mathcomp 2.4.0", note="Renamed to floorD1_gt.")]
|
Notation
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
ge_floor
| |
lt_succ_floor:= floorD1_gt.
#[deprecated(since="mathcomp 2.4.0", note="Renamed to ceilB1_lt.")]
|
Notation
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
lt_succ_floor
| |
gt_pred_ceil:= ceilB1_lt.
#[deprecated(since="mathcomp 2.5.0", note="Renamed to floor_le.")]
|
Notation
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
gt_pred_ceil
| |
floor_le_tmp:= floor_le.
#[deprecated(since="mathcomp 2.5.0", note="Renamed to floor_ge_int.")]
|
Notation
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
floor_le_tmp
| |
floor_ge_int_tmp:= floor_ge_int.
#[deprecated(since="mathcomp 2.5.0", note="Renamed to ceil_le_int.")]
|
Notation
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
floor_ge_int_tmp
| |
ceil_le_int_tmp:= ceil_le_int.
|
Notation
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
ceil_le_int_tmp
| |
natr_autx : (nu x \is a nat_num) = (x \is a nat_num).
Proof. by apply/idP/idP=> /[dup] ? /(aut_natr nu) => [/fmorph_inj <-| ->]. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
natr_aut
| |
intr_autx : (nu x \is a int_num) = (x \is a int_num).
Proof. by rewrite !intrE -rmorphN !natr_aut. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
intr_aut
| |
conj_natrx : x \is a nat_num -> x^* = x.
Proof. by move/Rreal_nat/CrealP. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
conj_natr
| |
conj_intrx : x \is a int_num -> x^* = x.
Proof. by move/Rreal_int/CrealP. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
conj_intr
| |
Znat_def(n : int) : (n \is a nat_num) = (0 <= n).
Proof. by []. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
Znat_def
| |
ZnatP(m : int) : reflect (exists n : nat, m = n) (m \is a nat_num).
Proof. by case: m => m; constructor; [exists m | case]. Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
ZnatP
| |
RecordNumDomain_hasTruncn R of Num.NumDomain R := {
trunc : R -> nat;
nat_num : pred R;
int_num : pred R;
truncP : forall x,
if 0 <= x then (trunc x)%:R <= x < (trunc x).+1%:R else trunc x == 0;
natrE : forall x, nat_num x = ((trunc x)%:R == x);
intrE : forall x, int_num x = nat_num x || nat_num (- x);
}.
#[deprecated(since="mathcomp 2.4.0",
note="Use NumDomain_hasTruncn instead.")]
|
HB.factory
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
Record
| |
NumDomain_isArchimedeanR := (NumDomain_hasTruncn R) (only parsing).
|
Notation
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
NumDomain_isArchimedean
| |
BuildT U := (NumDomain_hasTruncn.Build T U) (only parsing).
|
Notation
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
Build
| |
floor(x : R) : int :=
if 0 <= x then Posz (trunc x)
else if x < 0 then - Posz (trunc (- x) + ~~ int_num x) else 0.
Fact floorP x :
if x \is real_num then (floor x)%:~R <= x < (floor x + 1)%:~R else floor x == 0.
Proof.
rewrite /floor intrE !natrE negb_or realE.
case: (comparableP x 0) (@trunc_itv x) => //=;
try by rewrite -PoszD addn1 -pmulrn => _ ->.
move=> x_lt0 _; move: (truncP x); rewrite lt_geF // => /eqP ->.
rewrite gt_eqF //=; move: x_lt0.
rewrite [_ + 1]addrC -opprB !intrN lerNl ltrNr andbC -oppr_gt0.
move: {x}(- x) => x x_gt0; rewrite PoszD -addrA -PoszD.
have ->: Posz ((trunc x)%:R != x) - 1 = - Posz ((trunc x)%:R == x) by case: eqP.
have := trunc_itv (ltW x_gt0); rewrite le_eqVlt.
case: eqVneq => /=; last first.
by rewrite subr0 addn1 -!pmulrn => _ /andP[-> /ltW ->].
by rewrite intrB mulr1z addn0 -!pmulrn => -> _; rewrite gtrBl lexx andbT.
Qed.
Fact truncE x : trunc x = if floor x is Posz n then n else 0.
Proof.
rewrite /floor.
case: (comparableP x 0) (truncP x) => [+ /eqP ->| |_ /eqP ->|] //=.
by case: (_ + _)%N.
Qed.
Fact trunc_def x n : n%:R <= x < n.+1%:R -> trunc x = n.
Proof.
case/andP=> lemx ltxm1; apply/eqP; rewrite eqn_leq -ltnS -[(n <= _)%N]ltnS.
have/trunc_itv/andP[lefx ltxf1]: 0 <= x by apply: le_trans lemx; apply: ler0n.
by rewrite -!(ltr_nat R) 2?(@le_lt_trans _ _ x).
Qed.
Fact natrK : cancel (GRing.natmul 1) trunc.
Proof. by move=> m; apply: trunc_def; rewrite ler_nat ltr_nat ltnS leqnn. Qed.
Fact intrP x : reflect (exists n, x = n%:~R) (int_num
...
|
Definition
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
floor
| |
boundx := sval (sigW (archi_bound_subproof x)).
|
Definition
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
bound
| |
boundPx : 0 <= x -> x < (bound x)%:R.
Proof. by move/ger0_norm=> {1}<-; rewrite /bound; case: (sigW _). Qed.
Fact truncn_subproof x : {m | 0 <= x -> m%:R <= x < m.+1%:R }.
Proof.
have [Rx | _] := boolP (0 <= x); last by exists 0%N.
have/ex_minnP[n lt_x_n1 min_n]: exists n, x < n.+1%:R.
by exists (bound x); rewrite (lt_trans (boundP Rx)) ?ltr_nat.
exists n => _; rewrite {}lt_x_n1 andbT; case: n min_n => //= n min_n.
rewrite real_leNgt ?rpred_nat ?ger0_real //; apply/negP => /min_n.
by rewrite ltnn.
Qed.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
boundP
| |
truncnx := if 0 <= x then sval (truncn_subproof x) else 0%N.
|
Definition
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
truncn
| |
truncnPx :
if 0 <= x then (truncn x)%:R <= x < (truncn x).+1%:R else truncn x == 0%N.
Proof.
rewrite /truncn; case: truncn_subproof => // n hn.
by case: ifP => x_ge0; rewrite ?(ifT _ _ x_ge0) ?(ifF _ _ x_ge0) // hn.
Qed.
HB.instance Definition _ := NumDomain_hasTruncn.Build R
truncnP (fun => erefl) (fun => erefl).
HB.end.
|
Lemma
|
algebra
|
[
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice",
"From mathcomp Require Import fintype bigop order ssralg poly ssrnum ssrint"
] |
algebra/archimedean.v
|
truncnP
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.