Skip to content

Commit b86a7c6

Browse files
committed
mv
1 parent b0c014e commit b86a7c6

3 files changed

Lines changed: 60 additions & 65 deletions

File tree

CHANGELOG_UNRELEASED.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,17 +242,20 @@
242242
`ae_eq_Radon_Nikodym_SigmaFinite`, `Radon_Nikodym_change_of_variables`,
243243
`Radon_Nikodym_cscale`, `Radon_Nikodym_cadd`, `Radon_Nikodym_chain_rule`
244244
- in `realsum.v`:
245+
+ now use `funrpos` and `funrneg`:
246+
* definition `sum`
247+
* lemmas `summable_funrpos`, `summable_funrneg`
248+
+ lemma `sum0` (now uses `cst`)
249+
250+
- moved from `realsum` to `numfun.v`:
245251
+ now use `funrpos` and `funrneg`:
246252
* lemmas `eq_funrpos`, `eq_funrneg`
247253
* lemma `fpos0` (renamed to `funrpos_cst0`)
248254
* lemma `fneg0` (renamed to `funrneg_cst0`)
249255
* lemmas `funrposZ`, `funrnegZ`
250256
* lemmas `funrpos_natrM`, `funrneg_natrM`
251257
* lemmas `ge0_funrneg`, `ge0_funrpos`
252-
* lemmas `le_funrpos_norm`, `funrpos_le`
253-
* definition `sum`
254-
* lemmas `summable_funrpos`, `summable_funrneg`
255-
+ lemma `sum0` (now uses `cst`)
258+
* lemmas `le_funrpos_norm`
256259

257260
- moved from `numfun.v` to `unstable.v`:
258261
+ notations `nondecreasing_fun`, `nonincreasing_fun`,
@@ -346,6 +349,7 @@
346349
+ lemmas `fnegN`, `fposN`
347350
+ lemmas `ge0_pos`, `ge0_neg`
348351
+ lemma `fposBfneg`
352+
+ lemma `funrpos_le`
349353

350354
### Infrastructure
351355

experimental_reals/realsum.v

Lines changed: 7 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -42,68 +42,13 @@ by have := h fset0; rewrite big_pred0 // => -[x]; rewrite in_fset0.
4242
Qed.
4343
End Summable.
4444

45-
(* -------------------------------------------------------------------- *)
46-
Section Sum.
47-
Context {R : realType} {T : choiceType}.
48-
Implicit Types f g : T -> R.
49-
50-
(* TODO: move to numfun.v *)
51-
Lemma eq_funrpos f g : f =1 g -> f^\+ =1 g^\+.
52-
Proof. by move=> eq_fg x; rewrite /funrpos eq_fg. Qed.
53-
54-
Lemma eq_funrneg f g : f =1 g -> f^\- =1 g^\-.
55-
Proof. by move=> eq_fg x; rewrite /funrneg eq_fg. Qed.
56-
57-
Lemma funrpos_cst0 x : (fun _ : T => 0)^\+ x = 0 :> R.
58-
Proof. by rewrite /funrpos maxxx. Qed.
59-
60-
Lemma funrneg_cst0 x : (fun _ : T => 0)^\- x = 0 :> R.
61-
Proof. by rewrite /funrneg oppr0 maxxx. Qed.
62-
63-
Lemma funrposZ f c : 0 <= c -> (c \*o f)^\+ =1 c \*o f^\+.
64-
Proof. by move=> ge0_c x; rewrite /= ge0_funrposM. Qed.
65-
66-
Lemma funrnegZ f c : 0 <= c -> (c \*o f)^\- =1 c \*o f^\-.
67-
Proof.
68-
move=> ge0_c x; rewrite /= -!funrposN; have /= <- := funrposZ (- f) ge0_c x.
69-
by apply/eq_funrpos=> y /=; rewrite mulrN.
70-
Qed.
71-
72-
Lemma funrpos_natrM f (n : T -> nat) x :
73-
(fun x => (n x)%:R * f x)^\+ x = (n x)%:R * f^\+ x.
74-
Proof.
75-
by rewrite /funrpos -[in RHS]normr_nat maxr_pMr// mulr0 ger0_norm.
76-
Qed.
77-
78-
Lemma funrneg_natrM f (n : T -> nat) x :
79-
(fun x => (n x)%:R * f x)^\- x = (n x)%:R * f^\- x.
80-
Proof.
81-
rewrite -[in RHS]funrposN -funrpos_natrM -funrposN.
82-
by apply/eq_funrpos=> y; rewrite mulrN.
83-
Qed.
84-
85-
Lemma ge0_funrneg f x : (forall x, 0 <= f x) -> f^\- x = 0.
86-
Proof. by move=> ?; rewrite /funrneg max_r// oppr_le0. Qed.
87-
88-
Lemma ge0_funrpos f x : (forall x, 0 <= f x) -> f^\+ x = f x.
89-
Proof. by move=> ?; rewrite /funrpos max_l. Qed.
90-
91-
Lemma le_funrpos_norm f x : f^\+ x <= `|f x|.
92-
Proof.
93-
by rewrite -/((Num.Def.normr \o f) x) -funrposDneg lerDl funrneg_ge0.
94-
Qed.
95-
96-
Lemma funrpos_le f1 f2 : f1 <=1 f2 -> f1^\+ <=1 f2^\+.
97-
Proof. by move=> le_f x; rewrite (@funrpos_le _ _ setT)// in_setT. Qed.
98-
99-
Definition psum f : R :=
45+
Definition psum {R : realType} {T : choiceType} (f : T -> R) : R :=
10046
(* We need some ticked `image` operator *)
10147
let S := [set x | exists J : {fset T}, x = \sum_(x : J) `|f (val x)| ]%classic in
10248
if `[<summable f>] then sup S else 0.
10349

104-
Definition sum f : R := psum f^\+ - psum f^\-.
105-
106-
End Sum.
50+
Definition sum {R : realType} {T : choiceType} (f : T -> R) : R :=
51+
psum f^\+ - psum f^\-.
10752

10853
(* -------------------------------------------------------------------- *)
10954
Section SummableCountable.
@@ -1158,15 +1103,16 @@ Lemma le_sum S1 S2 : summable S1 -> summable S2 -> S1 <=1 S2 ->
11581103
Proof.
11591104
move=> smS1 smS2 leS; rewrite /sum lerB //.
11601105
- apply/le_psum/summable_funrpos => // x.
1161-
by rewrite funrpos_ge0/= funrpos_le.
1106+
by rewrite funrpos_ge0/= (@funrpos_le _ _ setT)//= in_setE.
11621107
- apply/le_psum/summable_funrneg => // x.
1163-
rewrite -!funrposN funrpos_ge0 funrpos_le // => y.
1108+
rewrite -!funrposN funrpos_ge0 (@funrpos_le _ _ setT) ?in_setE//= => y _.
11641109
by rewrite lerN2.
11651110
Qed.
11661111

11671112
Lemma sum0 : sum (@cst T _ 0) = 0 :> R.
11681113
Proof.
1169-
by rewrite /sum !(eq_psum funrpos_cst0, eq_psum funrneg_cst0) !psum0 subr0.
1114+
rewrite /sum !(eq_psum (@funrpos_cst0 _ _), eq_psum (@funrneg_cst0 _ _)).
1115+
by rewrite !psum0 subr0.
11701116
Qed.
11711117

11721118
Lemma sumN S : sum (- S) = - sum S.

theories/numfun.v

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,51 @@ move=> fg x Dx; rewrite /funrneg /Num.max; case: ifPn => gx; case: ifPn => fx//.
793793
- by rewrite lerN2; exact: fg.
794794
Qed.
795795

796+
Lemma eq_funrpos f g : f =1 g -> f^\+ =1 g^\+.
797+
Proof. by move=> eq_fg x; rewrite /funrpos eq_fg. Qed.
798+
799+
Lemma eq_funrneg f g : f =1 g -> f^\- =1 g^\-.
800+
Proof. by move=> eq_fg x; rewrite /funrneg eq_fg. Qed.
801+
802+
Lemma funrpos_cst0 x : (fun _ : T => 0)^\+ x = 0 :> R.
803+
Proof. by rewrite /funrpos maxxx. Qed.
804+
805+
Lemma funrneg_cst0 x : (fun _ : T => 0)^\- x = 0 :> R.
806+
Proof. by rewrite /funrneg oppr0 maxxx. Qed.
807+
808+
Lemma funrposZ f c : 0 <= c -> (c \*o f)^\+ =1 c \*o f^\+.
809+
Proof. by move=> ge0_c x; rewrite /= ge0_funrposM. Qed.
810+
811+
Lemma funrnegZ f c : 0 <= c -> (c \*o f)^\- =1 c \*o f^\-.
812+
Proof.
813+
move=> ge0_c x; rewrite /= -!funrposN; have /= <- := funrposZ (- f) ge0_c x.
814+
by apply/eq_funrpos=> y /=; rewrite mulrN.
815+
Qed.
816+
817+
Lemma funrpos_natrM f (n : T -> nat) x :
818+
(fun x => (n x)%:R * f x)^\+ x = (n x)%:R * f^\+ x.
819+
Proof.
820+
by rewrite /funrpos -[in RHS]normr_nat maxr_pMr// mulr0 ger0_norm.
821+
Qed.
822+
823+
Lemma funrneg_natrM f (n : T -> nat) x :
824+
(fun x => (n x)%:R * f x)^\- x = (n x)%:R * f^\- x.
825+
Proof.
826+
rewrite -[in RHS]funrposN -funrpos_natrM -funrposN.
827+
by apply/eq_funrpos=> y; rewrite mulrN.
828+
Qed.
829+
830+
Lemma ge0_funrneg f x : (forall x, 0 <= f x) -> f^\- x = 0.
831+
Proof. by move=> ?; rewrite /funrneg max_r// oppr_le0. Qed.
832+
833+
Lemma ge0_funrpos f x : (forall x, 0 <= f x) -> f^\+ x = f x.
834+
Proof. by move=> ?; rewrite /funrpos max_l. Qed.
835+
836+
Lemma le_funrpos_norm f x : f^\+ x <= `|f x|.
837+
Proof.
838+
by rewrite -/((Num.Def.normr \o f) x) -funrposDneg lerDl funrneg_ge0.
839+
Qed.
840+
796841
End funrposneg_lemmas.
797842
#[global]
798843
Hint Extern 0 (is_true (0%R <= _ ^\+ _)%R) => solve [apply: funrpos_ge0] : core.

0 commit comments

Comments
 (0)