Skip to content

Commit 70d5c47

Browse files
authored
Merge pull request #242 from math-comp/uniform_spaces
Insert a structure of uniform space
2 parents 93084ac + be176e2 commit 70d5c47

8 files changed

Lines changed: 1075 additions & 349 deletions

File tree

CHANGELOG_UNRELEASED.md

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,24 @@
77
- in `boolp.v`, new lemma `andC`
88
- in `topology.v`:
99
+ new lemma `open_nbhsE`
10+
+ `uniformType` a structure for uniform spaces based on entourages
11+
(`entourage`)
12+
+ `uniformType` structure on products, matrices, function spaces
13+
+ definitions `nbhs_`, `topologyOfEntourageMixin`, `split_ent`, `nbhsP`,
14+
`entourage_set`, `entourage_`, `uniformityOfBallMixin`, `nbhs_ball`
15+
+ lemmas `nbhs_E`, `nbhs_entourageE`, `filter_from_entourageE`,
16+
`entourage_refl`, `entourage_filter`, `entourageT`, `entourage_inv`,
17+
`entourage_split_ex`, `split_entP`, `entourage_split_ent`,
18+
`subset_split_ent`, `entourage_split`, `nbhs_entourage`, `cvg_entourageP`,
19+
`cvg_entourage`, `cvg_app_entourageP`, `cvg_mx_entourageP`,
20+
`cvg_fct_entourageP`, `entourage_E`, `entourage_ballE`,
21+
`entourage_from_ballE`, `entourage_ball`, `entourage_proper_filter`
22+
+ `completePseudoMetricType` structure
23+
+ `completePseudoMetricType` structure on matrices and function spaces
1024
- in `classical_sets.v`:
1125
+ lemmas `setICr`, `setUidPl`, `subsets_disjoint`, `disjoints_subset`, `setDidPl`,
12-
`setIidPl`, `setIS`, `setSI`, `setISS`, `bigcup_recl`, `bigcup_distrr`
26+
`setIidPl`, `setIS`, `setSI`, `setISS`, `bigcup_recl`, `bigcup_distrr`,
27+
`setMT`
1328
- in `ereal.v`:
1429
+ notation `\+` (`ereal_scope`) for function addition
1530
+ notations `>` and `>=` for comparison of extended real numbers
@@ -19,7 +34,9 @@
1934
+ arithmetic lemmas: `oppeD`, `subre_ge0`, `suber_ge0`, `lee_add2lE`, `lte_add2lE`,
2035
`lte_add`, `lte_addl`, `lte_le_add`, `lte_subl_addl`, `lee_subr_addr`,
2136
`lee_subl_addr`, `lte_spaddr`
22-
- in `normedtype.v`, lemmas `natmul_continuous`, `cvgMn` and `is_cvgMn`.
37+
- in `normedtype.v`:
38+
+ lemmas `natmul_continuous`, `cvgMn` and `is_cvgMn`.
39+
+ `uniformType` structure for `ereal`
2340
- in `sequences.v`:
2441
+ definitions `arithmetic`, `geometric`, `geometric_invn`
2542
+ lemmas `increasing_series`, `cvg_shiftS`, `mulrn_arithmetic`,
@@ -33,6 +50,13 @@
3350
- moved from `normedtype.v` to `boolp.v` and renamed:
3451
+ `forallN` -> `forallNE`
3552
+ `existsN` -> `existsNE`
53+
- `topology.v`:
54+
+ `unif_continuous` uses `entourage`
55+
+ `pseudoMetricType` inherits from `uniformType`
56+
+ `generic_source_filter` and `set_filter_source` use entourages
57+
+ `cauchy` is based on entourages and its former version is renamed
58+
`cauchy_ball`
59+
+ `completeType` inherits from `uniformType` and not from `pseudoMetricType`
3660

3761
### Renamed
3862

@@ -78,22 +102,22 @@
78102
+ `Canonical locally'_filter_on` -> `Canonical nbhs'_filter_on`
79103
+ `locally_locally'` -> `nbhs_nbhs'`
80104
+ `Global Instance within_locally_proper` -> `Global Instance within_nbhs_proper`
81-
+ `locallyP` -> `nbhsP`
82-
+ `locally_ball` -> `nbhs_ball`
105+
+ `locallyP` -> `nbhs_ballP`
106+
+ `locally_ball` -> `nbhsx_ballx`
83107
+ `neigh_ball` -> `open_nbhs_ball`
84108
+ `mx_locally` -> `mx_nbhs`
85109
+ `prod_locally` -> `prod_nbhs`
86110
+ `Filtered.locally_op` -> `Filtered.nbhs_op`
87111
+ `locally_of` -> `nbhs_of`
88112
+ `open_of_locally` -> `open_of_nhbs`
89113
+ `locally_of_open` -> `nbhs_of_open`
90-
+ `locally_` -> `nbhs_`
91-
+ lemma `locally_E` -> `nbhs_E`
114+
+ `locally_` -> `nbhs_ball`
92115
+ lemma `locally_ballE` -> `nbhs_ballE`
93116
+ `locallyW` -> `nearW`
94117
+ `nearW` -> `near_skip_subproof`
95118
+ `locally_infty_gt` -> `nbhs_infty_gt`
96119
+ `locally_infty_ge` -> `nbhs_infty_ge`
120+
+ `cauchy_entouragesP` -> `cauchy_ballP`
97121
- in `normedtype.v`:
98122
+ `locallyN` -> `nbhsN`
99123
+ `locallyC` -> `nbhsC`
@@ -169,6 +193,10 @@
169193

170194
### Removed
171195

196+
- in `topology.v`:
197+
+ definitions `entourages`, `topologyOfBallMixin`, `ball_set`
198+
+ lemmas `locally_E`, `entourages_filter`, `cvg_cauchy_ex`
199+
172200
### Infrastructure
173201

174202
### Misc

theories/classical_sets.v

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,9 @@ rewrite predeqE => t; split => [capU|cupU i _].
539539
by rewrite -(setCK (U i)) => CU; apply cupU; exists i.
540540
Qed.
541541

542+
Lemma setMT {A B} : (@setT A) `*` (@setT B) = setT.
543+
Proof. by rewrite predeqE. Qed.
544+
542545
Definition is_subset1 {A} (X : set A) := forall x y, X x -> X y -> x = y.
543546
Definition is_fun {A B} (f : A -> B -> Prop) := Logic.all (is_subset1 \o f).
544547
Definition is_total {A B} (f : A -> B -> Prop) := Logic.all (nonempty \o f).

theories/derive.v

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ move=> /diff_locallyP [dfc]; rewrite -addrA.
170170
rewrite (littleo_bigO_eqo (cst (1 : R^o))); last first.
171171
apply/eqOP; near=> k; rewrite /cst [`|1 : R^o|]normr1 mulr1.
172172
near=> y; rewrite ltW //; near: y; apply/nbhs_normP.
173-
by exists k; [near: k; exists 0; rewrite real0|move=> ? /=; rewrite sub0r normrN].
173+
exists k; first by near: k; exists 0; rewrite real0.
174+
by move=> ? /=; rewrite -ball_normE /= sub0r normrN.
174175
rewrite addfo; first by move=> /eqolim; rewrite cvg_shift add0r.
175176
by apply/eqolim0P; apply: (cvg_trans (dfc 0)); rewrite linear0.
176177
Grab Existential Variables. all: end_near. Qed.
@@ -303,15 +304,15 @@ pose g2 : R -> W := fun h : R => h^-1 *: k (h *: v ).
303304
rewrite (_ : g = g1 + g2) ?funeqE // -(addr0 (_ _ v)); apply: (@cvgD _ _ [topologicalType of R^o]).
304305
rewrite -(scale1r (_ _ v)); apply: cvgZl => /= X [e e0].
305306
rewrite /ball_ /= => eX.
306-
apply/nbhsP; rewrite nbhs_E.
307+
apply/nbhs_ballP.
307308
by exists e => //= x _ x0; apply eX; rewrite mulVr // ?unitfE // subrr normr0.
308309
rewrite /g2.
309310
have [/eqP ->|v0] := boolP (v == 0).
310311
rewrite (_ : (fun _ => _) = cst 0); first exact: cvg_cst.
311312
by rewrite funeqE => ?; rewrite scaler0 /k littleo_lim0 // scaler0.
312313
apply/cvg_distP => e e0.
313-
rewrite nearE /=; apply/nbhsP; rewrite nbhs_E.
314-
have /(littleoP [littleo of k]) /nbhsP[i i0 Hi] : 0 < e / (2 * `|v|).
314+
rewrite nearE /=; apply/nbhs_ballP.
315+
have /(littleoP [littleo of k]) /nbhs_ballP[i i0 Hi] : 0 < e / (2 * `|v|).
315316
by rewrite divr_gt0 // pmulr_rgt0 // normr_gt0.
316317
exists (i / `|v|); first by rewrite divr_gt0 // normr_gt0.
317318
move=> /= j; rewrite /ball /= /ball_ add0r normrN.
@@ -447,13 +448,13 @@ Proof.
447448
apply/eqoP => _ /posnumP[e].
448449
have /bigO_exP [_ /posnumP[k]] := bigOP [bigO of [O_ (0 : U) id of f]].
449450
have := littleoP [littleo of [o_ (0 : V') id of g]].
450-
move=> /(_ (e%:num / k%:num)) /(_ _) /nbhsP [//|_ /posnumP[d] hd].
451+
move=> /(_ (e%:num / k%:num)) /(_ _) /nbhs_ballP [//|_ /posnumP[d] hd].
451452
apply: filter_app; near=> x => leOxkx; apply: le_trans (hd _ _) _; last first.
452453
rewrite -ler_pdivl_mull //; apply: le_trans leOxkx _.
453454
by rewrite invf_div mulrA -[_ / _ * _]mulrA mulVf // mulr1.
454455
rewrite -ball_normE /= distrC subr0 (le_lt_trans leOxkx) //.
455456
rewrite -ltr_pdivl_mull //; near: x; rewrite /= !nbhs_simpl.
456-
apply/nbhsP; exists (k%:num ^-1 * d%:num)=> // x.
457+
apply/nbhs_ballP; exists (k%:num ^-1 * d%:num)=> // x.
457458
by rewrite -ball_normE /= distrC subr0.
458459
Grab Existential Variables. all: end_near. Qed.
459460

@@ -469,14 +470,14 @@ Lemma compOo_eqo (U V' W' : normedModType R) (f : U -> V')
469470
Proof.
470471
apply/eqoP => _ /posnumP[e].
471472
have /bigO_exP [_ /posnumP[k]] := bigOP [bigO of [O_ (0 : V') id of g]].
472-
move=> /nbhsP [_ /posnumP[d] hd].
473+
move=> /nbhs_ballP [_ /posnumP[d] hd].
473474
have ekgt0 : e%:num / k%:num > 0 by [].
474475
have /(_ _ ekgt0) := littleoP [littleo of [o_ (0 : U) id of f]].
475476
apply: filter_app; near=> x => leoxekx; apply: le_trans (hd _ _) _; last first.
476477
by rewrite -ler_pdivl_mull // mulrA [_^-1 * _]mulrC.
477478
rewrite -ball_normE /= distrC subr0; apply: le_lt_trans leoxekx _.
478479
rewrite -ltr_pdivl_mull //; near: x; rewrite /= nbhs_simpl.
479-
apply/nbhsP; exists ((e%:num / k%:num) ^-1 * d%:num)=> // x.
480+
apply/nbhs_ballP; exists ((e%:num / k%:num) ^-1 * d%:num)=> // x.
480481
by rewrite -ball_normE /= distrC subr0.
481482
Grab Existential Variables. all: end_near. Qed.
482483

@@ -493,7 +494,7 @@ rewrite funeqE => x; apply/eqP; case: (ler0P `|x|) => [|xn0].
493494
by rewrite normr_le0 => /eqP ->; rewrite linear0.
494495
rewrite -normr_le0 -(mul0r `|x|) -ler_pdivr_mulr //.
495496
apply/ler0_addgt0P => _ /posnumP[e]; rewrite ler_pdivr_mulr //.
496-
have /oid /nbhsP [_ /posnumP[d] dfe] := posnum_gt0 e.
497+
have /oid /nbhs_ballP [_ /posnumP[d] dfe] := posnum_gt0 e.
497498
set k := ((d%:num / 2) / (PosNum xn0)%:num)^-1.
498499
rewrite -{1}(@scalerKV _ _ k _ x) // linearZZ normmZ.
499500
rewrite -ler_pdivl_mull; last by rewrite gtr0_norm.
@@ -675,8 +676,8 @@ Qed.
675676
Lemma linear_lipschitz (V' W' : normedModType R) (f : {linear V' -> W'}) :
676677
continuous f -> exists2 k, k > 0 & forall x, `|f x| <= k * `|x|.
677678
Proof.
678-
move=> /(_ 0); rewrite linear0 => /(_ _ (nbhs_ball 0 1%:pos)).
679-
move=> /nbhsP [_ /posnumP[e] he]; exists (2 / e%:num) => // x.
679+
move=> /(_ 0); rewrite linear0 => /(_ _ (nbhsx_ballx 0 1%:pos)).
680+
move=> /nbhs_ballP [_ /posnumP[e] he]; exists (2 / e%:num) => // x.
680681
case: (lerP `|x| 0) => [|xn0].
681682
by rewrite normr_le0 => /eqP->; rewrite linear0 !normr0 mulr0.
682683
set k := 2 / e%:num * (PosNum xn0)%:num.
@@ -744,8 +745,8 @@ Lemma bilinear_schwarz (U V' W' : normedModType R)
744745
(f : {bilinear U -> V' -> W'}) : continuous (fun p => f p.1 p.2) ->
745746
exists2 k, k > 0 & forall u v, `|f u v| <= k * `|u| * `|v|.
746747
Proof.
747-
move=> /(_ 0); rewrite linear0r => /(_ _ (nbhs_ball 0 1%:pos)).
748-
move=> /nbhsP [_ /posnumP[e] he]; exists ((2 / e%:num) ^+2) => // u v.
748+
move=> /(_ 0); rewrite linear0r => /(_ _ (nbhsx_ballx 0 1%:pos)).
749+
move=> /nbhs_ballP [_ /posnumP[e] he]; exists ((2 / e%:num) ^+2) => // u v.
749750
case: (lerP `|u| 0) => [|un0].
750751
by rewrite normr_le0 => /eqP->; rewrite linear0l !normr0 mulr0 mul0r.
751752
case: (lerP `|v| 0) => [|vn0].
@@ -780,7 +781,7 @@ rewrite ler_pmul ?pmulr_rge0 //; last by rewrite nng_le_maxr /= lexx orbT.
780781
rewrite -ler_pdivl_mull //.
781782
suff : `|x| <= k%:num ^-1 * e%:num by apply: le_trans; rewrite nng_le_maxr /= lexx.
782783
near: x; rewrite !near_simpl; apply/nbhs_le_nbhs_norm.
783-
by exists (k%:num ^-1 * e%:num) => // ? /=; rewrite distrC subr0 => /ltW.
784+
by exists (k%:num ^-1 * e%:num) => // ? /=; rewrite -ball_normE /= distrC subr0 => /ltW.
784785
Grab Existential Variables. all: end_near. Qed.
785786

786787
Fact dbilin (U V' W' : normedModType R) (f : {bilinear U -> V' -> W'}) p :
@@ -791,8 +792,8 @@ Fact dbilin (U V' W' : normedModType R) (f : {bilinear U -> V' -> W'}) p :
791792
Proof.
792793
move=> fc; split=> [q|].
793794
by apply: (@continuousD _ _ _ (fun q => f p.1 q.2) (fun q => f q.1 p.2));
794-
move=> A /(fc (_.1, _.2)) /= /nbhsP [_ /posnumP[e] fpqe_A];
795-
apply/nbhsP; exists e%:num => // r [??]; exact: (fpqe_A (_.1, _.2)).
795+
move=> A /(fc (_.1, _.2)) /= /nbhs_ballP [_ /posnumP[e] fpqe_A];
796+
apply/nbhs_ballP; exists e%:num => // r [??]; exact: (fpqe_A (_.1, _.2)).
796797
apply/eqaddoE; rewrite funeqE => q /=.
797798
rewrite linearDl !linearDr addrA addrC.
798799
rewrite -[f q.1 _ + _ + _]addrA [f q.1 _ + _]addrC addrA [f q.1 _ + _]addrC.
@@ -933,7 +934,7 @@ rewrite mulrA mulf_div mulr1.
933934
have hDx_neq0 : h + x != 0.
934935
near: h; rewrite !nbhs_simpl; apply/nbhs_normP.
935936
exists `|x|; first by rewrite normr_gt0.
936-
move=> h /=; rewrite distrC subr0 -subr_gt0 => lthx.
937+
move=> h /=; rewrite -ball_normE /= distrC subr0 -subr_gt0 => lthx.
937938
rewrite -(normr_gt0 (h + x : R^o)) addrC -[h]opprK.
938939
apply: lt_le_trans (ler_dist_dist _ _).
939940
by rewrite ger0_norm normrN //; apply: ltW.
@@ -1357,7 +1358,7 @@ Proof.
13571358
move=> cvfx; apply/Logic.eq_sym.
13581359
(* should be inferred *)
13591360
have atrF := at_right_proper_filter x.
1360-
apply: (@cvg_map_lim _ _ _ (at_right _)) => // A /cvfx /nbhsP [_ /posnumP[e] xe_A].
1361+
apply: (@cvg_map_lim _ _ _ (at_right _)) => // A /cvfx /nbhs_ballP [_ /posnumP[e] xe_A].
13611362
by exists e%:num => // y xe_y; rewrite lt_def => /andP [xney _]; apply: xe_A.
13621363
Qed.
13631364

@@ -1367,7 +1368,7 @@ Proof.
13671368
move=> cvfx; apply/Logic.eq_sym.
13681369
(* should be inferred *)
13691370
have atrF := at_left_proper_filter x.
1370-
apply: (@cvg_map_lim _ _ _ (at_left _)) => // A /cvfx /nbhsP [_ /posnumP[e] xe_A].
1371+
apply: (@cvg_map_lim _ _ _ (at_left _)) => // A /cvfx /nbhs_ballP [_ /posnumP[e] xe_A].
13711372
exists e%:num => // y xe_y; rewrite lt_def => /andP [xney _].
13721373
by apply: xe_A => //; rewrite eq_sym.
13731374
Qed.

theories/landau.v

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,11 +1118,11 @@ Lemma near_shift {K : numDomainType} {R : normedModType K}
11181118
(\near x, P x) = (\forall z \near y, (P \o shift (x - y)) z).
11191119
Proof.
11201120
rewrite propeqE; split=> /= /nbhs_normP [_/posnumP[e] ye];
1121-
apply/nbhs_normP; exists e%:num => // t /= et.
1122-
apply: ye; rewrite /= !opprD addrA addrACA subrr add0r.
1121+
apply/nbhs_normP; exists e%:num => // t; rewrite -ball_normE /= => et.
1122+
apply: ye; rewrite -ball_normE /= !opprD addrA addrACA subrr add0r.
11231123
by rewrite opprK addrC.
11241124
have /= := ye (t - (x - y)); rewrite addrNK; apply.
1125-
by rewrite opprB addrCA opprD addrA subrr add0r opprB.
1125+
by rewrite -ball_normE /= opprB addrCA opprD addrA subrr add0r opprB.
11261126
Qed.
11271127

11281128
Lemma cvg_shift {T : Type} {K : numDomainType} {R : normedModType K}
@@ -1157,7 +1157,7 @@ suff flip : \forall k \near +oo, forall x, `|f x| <= k * `|x|.
11571157
near +oo => k; near=> y.
11581158
rewrite (le_lt_trans (near flip k _ _)) // -ltr_pdivl_mull; last by near: k; exists 0; rewrite real0.
11591159
near: y; apply/nbhs_normP.
1160-
eexists; last by move=> ?; rewrite /= sub0r normrN; apply.
1160+
eexists; last by move=> ?; rewrite -ball_normE /= sub0r normrN; apply.
11611161
by rewrite mulr_gt0 // invr_gt0; near: k; exists 0; rewrite real0.
11621162
have /nbhs_normP [_/posnumP[d]] := Of1.
11631163
rewrite /cst [X in _ * X]normr1 mulr1 => fk; near=> k => y.
@@ -1169,7 +1169,7 @@ rewrite -[X in _ <= X]mulr1 -ler_pdivr_mull ?pmulr_rgt0 //; last by near: k; exi
11691169
rewrite -(ler_pmul2l [gt0 of k0%:num]) mulr1 mulrA -[_ / _]ger0_norm //.
11701170
rewrite -normm_s.
11711171
have <- : GRing.Scale.op s_law =2 s by rewrite GRing.Scale.opE.
1172-
rewrite -linearZ fk //= distrC subr0 normmZ ger0_norm //.
1172+
rewrite -linearZ fk //= -ball_normE /= distrC subr0 normmZ ger0_norm //.
11731173
rewrite invfM mulrA mulfVK ?lt0r_neq0 // ltr_pdivr_mulr //; last by near: k; exists 0; rewrite real0.
11741174
rewrite mulrC -ltr_pdivr_mulr //; near: k; apply: nbhs_pinfty_gt.
11751175
Grab Existential Variables. all: end_near. Qed.

theories/misc/uniform_bigO.v

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
(* mathcomp analysis (c) 2017 Inria and AIST. License: CeCILL-C. *)
22
Require Import Reals.
33
From Coq Require Import ssreflect ssrfun ssrbool.
4-
From mathcomp Require Import ssrnat eqtype choice fintype bigop ssralg ssrnum.
4+
From mathcomp Require Import ssrnat eqtype choice fintype bigop order ssralg ssrnum.
55
Require Import boolp reals Rstruct Rbar.
66
Require Import classical_sets posnum topology normedtype landau.
77

88
Set Implicit Arguments.
99
Unset Strict Implicit.
1010
Unset Printing Implicit Defensive.
11-
Import GRing.Theory Num.Def Num.Theory.
11+
Import Order.TTheory GRing.Theory Num.Def Num.Theory.
12+
13+
Local Open Scope ring_scope.
1214

1315
Section UniformBigO.
1416

@@ -36,22 +38,25 @@ Definition OuP (f : A -> R * R -> R) (g : R * R -> R) :=
3638

3739
(* first we replace sig with ex and the l^2 norm with the l^oo norm *)
3840

41+
Let normedR2 := [normedModType _ of (R^o * R^o)].
42+
3943
Definition OuPex (f : A -> R * R -> R^o) (g : R * R -> R^o) :=
4044
exists2 alp, 0 < alp & exists2 C, 0 < C &
41-
forall X, forall dX : R^o * R^o, `|[dX]| < alp -> P dX ->
42-
`|[f X dX]| <= C * `|[g dX]|.
45+
forall X, forall dX : normedR2,
46+
`|dX| < alp -> P dX -> `|f X dX| <= C * `|g dX|.
4347

44-
Lemma ler_norm2 (x : R^o * R^o) :
45-
`|[x]| <= sqrt (Rsqr (fst x) + Rsqr (snd x)) <= Num.sqrt 2 * `|[x]|.
48+
Lemma ler_norm2 (x : normedR2) :
49+
`|x| <= sqrt (Rsqr (fst x) + Rsqr (snd x)) <= Num.sqrt 2 * `|x|.
4650
Proof.
4751
rewrite RsqrtE; last by rewrite addr_ge0 //; apply/RleP/Rle_0_sqr.
4852
rewrite !Rsqr_pow2 !RpowE; apply/andP; split.
49-
by rewrite ler_maxl; apply/andP; split;
50-
rewrite -[`|[_]|]sqrtr_sqr ler_wsqrtr // (ler_addl, ler_addr) sqr_ge0.
53+
by rewrite le_maxl; apply/andP; split;
54+
rewrite -[`|_|]sqrtr_sqr ler_wsqrtr // (ler_addl, ler_addr) sqr_ge0.
5155
wlog lex12 : x / (`|x.1| <= `|x.2|).
52-
move=> ler_norm; case: (lerP `|x.1| `|x.2|) => [/ler_norm|/ltrW lex21] //.
53-
by rewrite addrC [`|[_]|]maxrC (ler_norm (x.2, x.1)).
54-
rewrite [`|[_]|]maxr_r // [`|[_]|]absRE -[X in X * _]ger0_norm // -normrM.
56+
move=> ler_norm; case: (lerP `|x.1| `|x.2|) => [/ler_norm|] //.
57+
rewrite lt_leAnge => /andP [lex21 _].
58+
by rewrite addrC [`|_|]maxC (ler_norm (x.2, x.1)).
59+
rewrite [`|_|]max_r // -[X in X * _]ger0_norm // -normrM.
5560
rewrite -sqrtr_sqr ler_wsqrtr // exprMn sqr_sqrtr // mulr_natl mulr2n ler_add2r.
5661
rewrite -[_ ^+ 2]ger0_norm ?sqr_ge0 // -[X in _ <=X]ger0_norm ?sqr_ge0 //.
5762
by rewrite !normrX ler_expn2r // nnegrE normr_ge0.
@@ -61,7 +66,7 @@ Lemma OuP_to_ex f g : OuP f g -> OuPex f g.
6166
Proof.
6267
move=> [_ [_ [/posnumP[a] [/posnumP[C] fOg]]]].
6368
exists (a%:num / Num.sqrt 2) => //; exists C%:num => // x dx ltdxa Pdx.
64-
apply: fOg; move: ltdxa; rewrite ltr_pdivl_mulr //; apply: ler_lt_trans.
69+
apply: fOg; move: ltdxa; rewrite ltr_pdivl_mulr //; apply: le_lt_trans.
6570
by rewrite mulrC; have /andP[] := ler_norm2 dx.
6671
Qed.
6772

@@ -70,7 +75,7 @@ Proof.
7075
move=> /exists2P /getPex; set Q := fun a => _ /\ _ => - [lt0getQ].
7176
move=> /exists2P /getPex; set R := fun C => _ /\ _ => - [lt0getR fOg].
7277
apply: existT (get Q) _; apply: exist (get R) _; split=> //; split => //.
73-
move=> x dx ltdxgetQ; apply: fOg; apply: ler_lt_trans ltdxgetQ.
78+
move=> x dx ltdxgetQ; apply: fOg; apply: le_lt_trans ltdxgetQ.
7479
by have /andP [] := ler_norm2 dx.
7580
Qed.
7681

@@ -83,26 +88,27 @@ Definition OuO (f : A -> R * R -> R^o) (g : R * R -> R^o) :=
8388
Lemma OuP_to_O f g : OuP f g -> OuO f g.
8489
Proof.
8590
move=> /OuP_to_ex [_/posnumP[a] [_/posnumP[C] fOg]].
86-
apply/eqOP; near=> k; near=> x; apply: ler_trans (fOg _ _ _ _) _; last 2 first.
91+
apply/eqOP; near=> k; near=> x; apply: le_trans (fOg _ _ _ _) _; last 2 first.
8792
- by near: x; exists (setT, P); [split=> //=; apply: withinT|move=> ? []].
88-
- by rewrite ler_pmul => //; near: k; exists C%:num => ? /ltrW.
93+
- rewrite ler_pmul => //; near: k; exists C%:num; split.
94+
exact: posnum_real.
95+
by move=> ?; rewrite lt_leAnge => /andP[].
8996
- near: x; exists (setT, ball (0 : R^o * R^o) a%:num).
90-
by split=> //=; rewrite /within; near=> x =>_; near: x; apply: locally_ball.
91-
move=> x [_ [/=]]; rewrite -ball_normE /= normmB subr0 normmB subr0.
92-
by move=> ??; rewrite ltr_maxl; apply/andP.
97+
by split=> //=; rewrite /within; near=> x =>_; near: x; apply: nbhsx_ballx.
98+
move=> x [_ [/=]]; rewrite -ball_normE /= distrC subr0 distrC subr0.
99+
by move=> ??; rewrite lt_maxl; apply/andP.
93100
Grab Existential Variables. all: end_near. Qed.
94101

95102
Lemma OuO_to_P f g : OuO f g -> OuP f g.
96103
Proof.
97-
move=> fOg; apply/Ouex_to_P; move: fOg => /eqOP [k hk].
98-
have /hk [Q [->]] : k < maxr 1 (k + 1) by rewrite ltr_maxr ltr_addl orbC ltr01.
104+
move=> fOg; apply/Ouex_to_P; move: fOg => /eqOP [k [kreal hk]].
105+
have /hk [Q [->]] : k < maxr 1 (k + 1) by rewrite lt_maxr ltr_addl orbC ltr01.
99106
move=> [R [[_/posnumP[e1] Re1] [_/posnumP[e2] Re2]] sRQ] fOg.
100107
exists (minr e1%:num e2%:num) => //.
101-
exists (maxr 1 (k + 1)); first by rewrite ltr_maxr ltr01.
108+
exists (maxr 1 (k + 1)); first by rewrite lt_maxr ltr01.
102109
move=> x dx dxe Pdx; apply: (fOg (x, dx)); split=> //=.
103-
move: dxe; rewrite ltr_maxl !ltr_minr => /andP[/andP [dxe11 _] /andP [_ dxe22]].
104-
by apply/sRQ => //; split; [apply/Re1|apply/Re2];
105-
rewrite /AbsRing_ball /= absrB subr0.
110+
move: dxe; rewrite lt_maxl !lt_minr => /andP[/andP [dxe11 _] /andP [_ dxe22]].
111+
by apply/sRQ => //; split; [apply/Re1|apply/Re2]; rewrite /= distrC subr0.
106112
Qed.
107113

108-
End UniformBigO.
114+
End UniformBigO.

0 commit comments

Comments
 (0)