Skip to content

Commit d9e4f68

Browse files
committed
mv convex
1 parent 66bbe24 commit d9e4f68

4 files changed

Lines changed: 66 additions & 29 deletions

File tree

CHANGELOG_UNRELEASED.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@
7070
- in `derive.v`:
7171
+ lemmas `compact_EVT_max`, `compact_EVT_min`, `EVT_max_rV`, `EVT_min_rV`
7272

73+
- in `convex.v`:
74+
+ lemma `convexW`
75+
7376
### Changed
7477

7578
- in `constructive_ereal.v`: fixed the infamous `%E` scope bug.
@@ -220,6 +223,8 @@
220223
- in `normed_module.v`, turned into `Let`'s:
221224
+ local lemmas `add_continuous`, `scale_continuous`, `locally_convex`
222225

226+
- moved from `tvs.v` to `convex.v`
227+
+ definition `convex`
223228

224229
### Renamed
225230

theories/convex.v

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,22 @@ Proof. by move=> ab; rewrite in_itv/= -lerN2 convN convC !conv_le ?lerN2. Qed.
220220

221221
End conv_numDomainType.
222222

223+
Definition convex (R : numDomainType) (M : lmodType R)
224+
(A : set (convex_lmodType M)) :=
225+
forall x y lambda, x \in A -> y \in A -> x <| lambda |> y \in A.
226+
227+
Lemma convexW (R : numDomainType) (M : lmodType R) (A : set (convex_lmodType M)) :
228+
convex A <->
229+
{in A &, forall x y (k : {i01 R}), 0 < k%:num -> k%:num < 1 -> x <| k |> y \in A}.
230+
Proof.
231+
split => [cA x y xA yA k k0 k1|cA x y l xA yA].
232+
by have /(_ k) := cA _ _ _ xA yA.
233+
have [->|l0] := eqVneq l 0%:i01; first by rewrite conv0.
234+
have [->|l1] := eqVneq l 1%:i01; first by rewrite conv1.
235+
apply: cA => //.
236+
- by rewrite lt_neqAle eq_sym l0 ge0.
237+
- by rewrite lt_neqAle l1 le1.
238+
Qed.
223239

224240
Definition convex_function (R : numFieldType) (E : lmodType R) (E' := convex_lmodType E) (D : set E') (f : E' -> R^o) :=
225241
forall (t : {i01 R}),

theories/normedtype_theory/normed_module.v

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ From mathcomp Require Import interval_inference fieldext falgebra.
77
From mathcomp Require Import unstable.
88
From mathcomp Require Import boolp classical_sets filter functions cardinality.
99
From mathcomp Require Import set_interval ereal reals topology real_interval.
10-
From mathcomp Require Import prodnormedzmodule tvs num_normedtype.
10+
From mathcomp Require Import convex prodnormedzmodule tvs num_normedtype.
1111
From mathcomp Require Import ereal_normedtype pseudometric_normed_Zmodule.
1212

1313
(**md**************************************************************************)
@@ -111,21 +111,27 @@ rewrite (@le_lt_trans _ _ (`|k - l| * M)) ?ler_wpM2l -?ltr_pdivlMr//.
111111
by near: l; apply: cvgr_dist_lt; rewrite // divr_gt0.
112112
Unshelve. all: by end_near. Qed.
113113

114+
Local Open Scope convex_scope.
115+
114116
(** NB: we have almost the same proof in `tvs.v` *)
115117
Let locally_convex :
116-
exists2 B : set (set V), (forall b, b \in B -> convex b) & basis B.
117-
Proof.
118-
exists [set B | exists x r, B = ball x r].
119-
move=> b; rewrite inE /= => [[x]] [r] -> z y l.
120-
rewrite !inE -!ball_normE /= => zx yx l0; rewrite -subr_gt0 => l1.
121-
have -> : x = l *: x + (1 - l) *: x by rewrite addrC scalerBl subrK scale1r.
122-
rewrite [X in `|X|](_ : _ = l *: (x - z) + (1 - l) *: (x - y)); last first.
118+
exists2 B : set (set (convex_lmodType V)), (forall b, b \in B -> convex b) & basis B.
119+
Proof.
120+
exists [set B | exists (x : convex_lmodType V) r, B = ball x r].
121+
move=> b; rewrite inE => [[x]] [r] ->.
122+
apply/convexW => z y; rewrite !inE -!ball_normE /= => zx yx l l0 l1.
123+
have -> : x = x <| l |> x by rewrite convmm. (*TODO: this looks superfluous *)
124+
rewrite /ball_/= inE/=.
125+
rewrite [X in `|X|](_ : _ = (x - z : convex_lmodType V) <| l |>
126+
(x - y : convex_lmodType V)); last first.
123127
by rewrite opprD addrACA -scalerBr -scalerBr.
124-
rewrite (@le_lt_trans _ _ (`|l| * `|x - z| + `|1 - l| * `|x - y|))//.
128+
rewrite (@le_lt_trans _ _ ((l%:num) * `|x - z| + l%:num.~ * `|x - y|))//.
129+
rewrite -[in X in _ <= X + _](@ger0_norm _ l%:num)//.
130+
rewrite -[in X in _ <= _ + X](@ger0_norm _ l%:num.~) ?subr_ge0//.
125131
by rewrite -!normrZ ler_normD.
126-
rewrite (@lt_le_trans _ _ (`|l| * r + `|1 - l| * r ))//.
127-
by rewrite ltr_leD// lter_pM2l// ?normrE ?gt_eqF// ltW.
128-
by rewrite !gtr0_norm// -mulrDl addrC subrK mul1r.
132+
rewrite (@lt_le_trans _ _ (l%:num * r + l%:num.~ * r ))//.
133+
by rewrite ltr_leD// lter_pM2l// ?normrE ?gt_eqF ?ltW// subr_gt0.
134+
by rewrite -mulrDl addrC subrK mul1r.
129135
split.
130136
move=> B [x] [r] ->.
131137
rewrite openE/= -ball_normE/= /interior => y /= bxy; rewrite -nbhs_ballE.

theories/normedtype_theory/tvs.v

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
From HB Require Import structures.
33
From mathcomp Require Import all_ssreflect_compat ssralg ssrnum vector.
44
From mathcomp Require Import interval_inference.
5+
#[warning="-warn-library-file-internal-analysis"]
6+
From mathcomp Require Import unstable.
57
From mathcomp Require Import boolp classical_sets functions cardinality.
6-
From mathcomp Require Import set_interval reals topology num_normedtype.
8+
From mathcomp Require Import convex set_interval reals topology num_normedtype.
79
From mathcomp Require Import pseudometric_normed_Zmodule.
810

911
(**md**************************************************************************)
@@ -306,10 +308,6 @@ HB.instance Definition _ :=
306308

307309
HB.end.
308310

309-
Definition convex (R : numDomainType) (M : lmodType R) (A : set M) :=
310-
forall x y (lambda : R), x \in A -> y \in A ->
311-
0 < lambda -> lambda < 1 -> lambda *: x + (1 - lambda) *: y \in A.
312-
313311
HB.mixin Record Uniform_isTvs (R : numDomainType) E
314312
& Uniform E & GRing.Lmodule R E := {
315313
locally_convex : exists2 B : set (set E),
@@ -511,20 +509,30 @@ rewrite (@le_lt_trans _ _ (`|k - l| * M)) ?ler_wpM2l -?ltr_pdivlMr//.
511509
by near: l; apply: cvgr_dist_lt; rewrite // divr_gt0.
512510
Unshelve. all: by end_near. Qed.
513511

512+
Local Open Scope convex_scope.
513+
514514
Let standard_locally_convex :
515515
exists2 B : set (set R^o), (forall b, b \in B -> convex b) & basis B.
516516
Proof.
517517
exists [set B | exists x r, B = ball x r].
518-
move=> b; rewrite inE /= => [[x]] [r] -> z y l.
519-
rewrite !inE -!ball_normE /= => zx yx l0; rewrite -subr_gt0 => l1.
520-
have -> : x = l *: x + (1 - l) *: x by rewrite addrC scalerBl subrK scale1r.
521-
rewrite [X in `|X|](_ : _ = l *: (x - z) + (1 - l) *: (x - y)); last first.
522-
by rewrite opprD addrACA -scalerBr -scalerBr.
523-
rewrite (@le_lt_trans _ _ (`|l| * `|x - z| + `|1 - l| * `|x - y|))//.
524-
by rewrite -!normrM ler_normD.
525-
rewrite (@lt_le_trans _ _ (`|l| * r + `|1 - l| * r ))//.
526-
by rewrite ltr_leD// lter_pM2l// ?normrE ?gt_eqF// ltW.
527-
by rewrite !gtr0_norm// -mulrDl addrC subrK mul1r.
518+
move=> b/= /[!inE]/= [[x]] [r] ->.
519+
apply/convexW => z y; rewrite /ball/= !inE/= => zx yx l /[!inE]/= l0 l1.
520+
(* conv lemma? *)
521+
have -> : x = x <| l |> x by rewrite convmm. (*TODO: this looks superfluous *)
522+
rewrite [X in `|X|](_ : _ = (x - z) <| l |> (x - y)); last first.
523+
by rewrite opprD addrACA -mulrBr -mulrBr.
524+
rewrite (@le_lt_trans _ _ ((`|x - z| : R^o) <| l |> `|x - y|))//.
525+
rewrite -[in X in _ <= X + _](@ger0_norm _ l%:num)//.
526+
rewrite -[in X in _ <= _ + X](@ger0_norm _ l%:num.~) ?subr_ge0//.
527+
rewrite [X in `|X| <= _](_ : _ = l%:num * (x - z) + l%:num.~ * (x - y))//.
528+
rewrite -[X in _ <= X + _]normrM.
529+
rewrite -[X in _ <= _ + X]normrM.
530+
by rewrite ler_normD.
531+
rewrite (@lt_le_trans _ _ ((r : R^o) <| l |> r))//.
532+
rewrite ltr_leD//.
533+
by rewrite ltr_pM2l// normr_gt0// gt_eqF.
534+
by rewrite ler_wpM2l// ?subr_ge0// ltW.
535+
by rewrite convmm.
528536
split.
529537
move=> B [x] [r] ->.
530538
rewrite openE/= -ball_normE/= /interior => y /= bxy; rewrite -nbhs_ballE.
@@ -587,8 +595,10 @@ have : basis B.
587595
rewrite !nbhsE /=; split; first by exists a => //; split => //; exact: Beo.
588596
by exists b => //; split => // []; exact: Bfo.
589597
exists B => // => b; rewrite inE /= => [[]] bo [] be [] bf Bee [] Bff <-.
590-
move => [x1 y1] [x2 y2] l /[!inE] /= -[xe1 yf1] [xe2 yf2] l0 l1.
591-
by split; rewrite -inE; [apply: Bcb; rewrite ?inE|apply: Bcf; rewrite ?inE].
598+
move => [x1 y1] [x2 y2] l /[!inE] /= -[xe1 yf1] [xe2 yf2].
599+
split.
600+
by apply/set_mem/Bcb; [exact/mem_set|exact/mem_set|exact/mem_set].
601+
by apply/set_mem/Bcf; [exact/mem_set|exact/mem_set|exact/mem_set].
592602
Qed.
593603

594604
HB.instance Definition _ := PreTopologicalNmodule_isTopologicalNmodule.Build

0 commit comments

Comments
 (0)