From 1cacfb8f5dd8307adbc48b67474055ce455a168d Mon Sep 17 00:00:00 2001 From: Reynald Affeldt Date: Sat, 12 Sep 2020 17:02:00 +0900 Subject: lemma used in mathcomp-analysis Co-authored-by: Cyril Cohen Co-authored-by: Kazuhiko Sakaguchi --- mathcomp/algebra/ssrnum.v | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'mathcomp/algebra') diff --git a/mathcomp/algebra/ssrnum.v b/mathcomp/algebra/ssrnum.v index 2eefe8e..c28aec2 100644 --- a/mathcomp/algebra/ssrnum.v +++ b/mathcomp/algebra/ssrnum.v @@ -1779,6 +1779,26 @@ move=> hx; rewrite -[X in `|X|]subr0; case: (@real_ltgtP 0 x); by rewrite ?subr0 ?sub0r //; constructor. Qed. +Lemma max_real : {in real &, forall x y, max x y \is real}. +Proof. by move=> x y ? ?; case: real_leP. Qed. + +Lemma min_real : {in real &, forall x y, min x y \is real}. +Proof. by move=> x y ? ?; case: real_leP. Qed. + +Lemma bigmax_real I x0 (r : seq I) (P : pred I) (f : I -> R): + x0 \is real -> {in P, forall t : I, f t \is real} -> + \big[max/x0]_(t <- r | P t) f t \is real. +Proof. +by move=> x0r Pr; elim/big_rec : _ => // i x Pi xr; rewrite max_real ?Pr. +Qed. + +Lemma bigmin_real I x0 (r : seq I) (P : pred I) (f : I -> R): + x0 \is real -> {in P, forall t : I, f t \is real} -> + \big[min/x0]_(t <- r | P t) f t \is real. +Proof. +by move=> x0r Pr; elim/big_rec : _ => // i x Pi xr; rewrite min_real ?Pr. +Qed. + Lemma real_neqr_lt : {in real &, forall x y, (x != y) = (x < y) || (y < x)}. Proof. by move=> * /=; case: real_ltgtP. Qed. -- cgit v1.2.3 From e2fb620d4a2bb6da26d344b69f22befdde09b1d0 Mon Sep 17 00:00:00 2001 From: Reynald Affeldt Date: Wed, 16 Sep 2020 01:33:27 +0900 Subject: comparable_big lemma in order.v --- mathcomp/algebra/ssrnum.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mathcomp/algebra') diff --git a/mathcomp/algebra/ssrnum.v b/mathcomp/algebra/ssrnum.v index c28aec2..36498b3 100644 --- a/mathcomp/algebra/ssrnum.v +++ b/mathcomp/algebra/ssrnum.v @@ -1786,8 +1786,8 @@ Lemma min_real : {in real &, forall x y, min x y \is real}. Proof. by move=> x y ? ?; case: real_leP. Qed. Lemma bigmax_real I x0 (r : seq I) (P : pred I) (f : I -> R): - x0 \is real -> {in P, forall t : I, f t \is real} -> - \big[max/x0]_(t <- r | P t) f t \is real. + x0 \is real -> {in P, forall i : I, f i \is real} -> + \big[max/x0]_(i <- r | P i) f i \is real. Proof. by move=> x0r Pr; elim/big_rec : _ => // i x Pi xr; rewrite max_real ?Pr. Qed. -- cgit v1.2.3 From bf736cf6aaec0bca0d0202b8686d253123bf4af2 Mon Sep 17 00:00:00 2001 From: Cyril Cohen Date: Sat, 26 Sep 2020 23:52:48 +0200 Subject: Reorganizing relation between comparability/real and big --- mathcomp/algebra/ssrnum.v | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'mathcomp/algebra') diff --git a/mathcomp/algebra/ssrnum.v b/mathcomp/algebra/ssrnum.v index 36498b3..3c88ef0 100644 --- a/mathcomp/algebra/ssrnum.v +++ b/mathcomp/algebra/ssrnum.v @@ -1479,6 +1479,19 @@ rewrite sqrf_eq1 => /orP[/eqP //|]; rewrite -ger0_def le0r oppr_eq0 oner_eq0. by move/(addr_gt0 ltr01); rewrite subrr ltxx. Qed. +Lemma big_real x0 op I (P : pred I) F (s : seq I) : + {in real &, forall x y, op x y \is real} -> x0 \is real -> + {in P, forall i, F i \is real} -> \big[op/x0]_(i <- s | P i) F i \is real. +Proof. exact: comparable_bigr. Qed. + +Lemma sum_real I (P : pred I) (F : I -> R) (s : seq I) : + {in P, forall i, F i \is real} -> \sum_(i <- s | P i) F i \is real. +Proof. by apply/big_real; [apply: rpredD | apply: rpred0]. Qed. + +Lemma prod_real I (P : pred I) (F : I -> R) (s : seq I) : + {in P, forall i, F i \is real} -> \prod_(i <- s | P i) F i \is real. +Proof. by apply/big_real; [apply: rpredM | apply: rpred1]. Qed. + Section NormedZmoduleTheory. Variable V : normedZmodType R. @@ -1780,24 +1793,20 @@ by rewrite ?subr0 ?sub0r //; constructor. Qed. Lemma max_real : {in real &, forall x y, max x y \is real}. -Proof. by move=> x y ? ?; case: real_leP. Qed. +Proof. exact: comparable_maxr. Qed. Lemma min_real : {in real &, forall x y, min x y \is real}. -Proof. by move=> x y ? ?; case: real_leP. Qed. +Proof. exact: comparable_minr. Qed. Lemma bigmax_real I x0 (r : seq I) (P : pred I) (f : I -> R): x0 \is real -> {in P, forall i : I, f i \is real} -> \big[max/x0]_(i <- r | P i) f i \is real. -Proof. -by move=> x0r Pr; elim/big_rec : _ => // i x Pi xr; rewrite max_real ?Pr. -Qed. +Proof. exact/big_real/max_real. Qed. Lemma bigmin_real I x0 (r : seq I) (P : pred I) (f : I -> R): - x0 \is real -> {in P, forall t : I, f t \is real} -> - \big[min/x0]_(t <- r | P t) f t \is real. -Proof. -by move=> x0r Pr; elim/big_rec : _ => // i x Pi xr; rewrite min_real ?Pr. -Qed. + x0 \is real -> {in P, forall i : I, f i \is real} -> + \big[min/x0]_(i <- r | P i) f i \is real. +Proof. exact/big_real/min_real. Qed. Lemma real_neqr_lt : {in real &, forall x y, (x != y) = (x < y) || (y < x)}. Proof. by move=> * /=; case: real_ltgtP. Qed. -- cgit v1.2.3 From d02fbd82f7bfe06c37dfe5edb05d0ed36a82811b Mon Sep 17 00:00:00 2001 From: Reynald Affeldt Date: Mon, 12 Oct 2020 12:55:06 +0900 Subject: fix the >=< notation in ssrnum as well --- mathcomp/algebra/ssrnum.v | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'mathcomp/algebra') diff --git a/mathcomp/algebra/ssrnum.v b/mathcomp/algebra/ssrnum.v index 3c88ef0..0244891 100644 --- a/mathcomp/algebra/ssrnum.v +++ b/mathcomp/algebra/ssrnum.v @@ -464,9 +464,6 @@ Notation "< y :> T" := (< (y : T)) (only parsing) : ring_scope. Notation "> y" := (lt y) : ring_scope. Notation "> y :> T" := (> (y : T)) (only parsing) : ring_scope. -Notation ">=< y" := (comparable y) : ring_scope. -Notation ">=< y :> T" := (>=< (y : T)) (only parsing) : ring_scope. - Notation "x <= y" := (le x y) : ring_scope. Notation "x <= y :> T" := ((x : T) <= (y : T)) (only parsing) : ring_scope. Notation "x >= y" := (y <= x) (only parsing) : ring_scope. @@ -490,12 +487,12 @@ Notation "x < y ?<= 'if' C" := (lterif x y C) : ring_scope. Notation "x < y ?<= 'if' C :> R" := ((x : R) < (y : R) ?<= if C) (only parsing) : ring_scope. -Notation ">=< x" := (comparable x) : ring_scope. -Notation ">=< x :> T" := (>=< (x : T)) (only parsing) : ring_scope. +Notation ">=< y" := [pred x | comparable x y] : ring_scope. +Notation ">=< y :> T" := (>=< (y : T)) (only parsing) : ring_scope. Notation "x >=< y" := (comparable x y) : ring_scope. -Notation ">< x" := (fun y => ~~ (comparable x y)) : ring_scope. -Notation ">< x :> T" := (>< (x : T)) (only parsing) : ring_scope. +Notation ">< y" := [pred x | ~~ comparable x y] : ring_scope. +Notation ">< y :> T" := (>< (y : T)) (only parsing) : ring_scope. Notation "x >< y" := (~~ (comparable x y)) : ring_scope. Canonical Rpos_keyed. -- cgit v1.2.3