Skip to content

Commit fa3fa31

Browse files
mkerjeanaffeldt-aistMarie Kerjean
authored
convex_function generalized (#1887)
* generalization --------- Co-authored-by: Reynald Affeldt <reynald.affeldt@aist.go.jp> Co-authored-by: Marie Kerjean <marie.kerjean@cnrs.fr>
1 parent 641ac09 commit fa3fa31

File tree

5 files changed

+93
-49
lines changed

5 files changed

+93
-49
lines changed

CHANGELOG_UNRELEASED.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@
8383

8484
- in `separation_axioms.v`:
8585
+ lemmas `limit_point_closed`
86+
- in `convex.v`:
87+
+ lemma `convex_setW`
8688

8789
### Changed
8890

@@ -241,6 +243,9 @@
241243
+ lemma `cvg_comp_shift`
242244
+ lemma `ball_open_nbhs`
243245

246+
- moved from `tvs.v` to `convex.v`
247+
+ definition `convex`, renamed to `convex_set`
248+
244249
### Renamed
245250

246251
- in `topology_structure.v`
@@ -291,6 +296,8 @@
291296

292297
- in `exp.v`:
293298
+ lemma `derivable_powR`
299+
- in `convex.v`:
300+
+ definition `convex_function` (from a realType as domain to a convex_lmodType as domain)
294301

295302
### Deprecated
296303

theories/convex.v

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

221221
End conv_numDomainType.
222222

223-
Definition convex_function (R : realType) (D : set R) (f : R -> R^o) :=
223+
Definition convex_set (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 convex_setW (R : numDomainType) (M : lmodType R)
228+
(A : set (convex_lmodType M)) :
229+
convex_set A <->
230+
{in A &, forall x y (k : {i01 R}),
231+
0 < k%:num -> k%:num < 1 -> x <| k |> y \in A}.
232+
Proof.
233+
split => [cA x y xA yA k k0 k1|cA x y l xA yA].
234+
by have /(_ k) := cA _ _ _ xA yA.
235+
have [->|l0] := eqVneq l 0%:i01; first by rewrite conv0.
236+
have [->|l1] := eqVneq l 1%:i01; first by rewrite conv1.
237+
apply: cA => //.
238+
- by rewrite lt_neqAle eq_sym l0 ge0.
239+
- by rewrite lt_neqAle l1 le1.
240+
Qed.
241+
242+
Definition convex_function (R : numFieldType) (E : lmodType R)
243+
(E' := convex_lmodType E) (D : set E') (f : E' -> R^o) :=
224244
forall (t : {i01 R}),
225-
{in D &, forall (x y : R^o), (f (x <| t |> y) <= f x <| t |> f y)%R}.
245+
{in D &, forall (x y : E'), (f (x <| t |> y) <= f x <| t |> f y)%R}.
226246
(* TODO: generalize to convTypes once we have ordered convTypes (mathcomp 2) *)

theories/hoelder.v

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -532,13 +532,14 @@ End hoelder2.
532532
Section convex_powR.
533533
Context {R : realType}.
534534
Local Open Scope ring_scope.
535+
Local Open Scope convex_scope.
535536

536537
Lemma convex_powR p : 1 <= p ->
537-
convex_function `[0, +oo[%classic (@powR R ^~ p).
538+
convex_function (`[0, +oo[%classic : set R) (@powR R ^~ p).
538539
Proof.
539540
move=> p1 t x y /[!inE] /= /[!in_itv] /= /[!andbT] x_ge0 y_ge0.
540-
have p0 : 0 < p by rewrite (lt_le_trans _ p1).
541-
rewrite !convRE; set w1 := t%:num; set w2 := t%:inum.~.
541+
have p0 : 0 < p by rewrite (lt_le_trans _ p1).
542+
rewrite convRE [X in X `^ _ <= _]convRE; set w1 := t%:num; set w2 := t%:inum.~.
542543
have [->|w20] := eqVneq w2 0.
543544
rewrite !mul0r !addr0; have [->|w10] := eqVneq w1 0.
544545
by rewrite !mul0r powR0// gt_eqF.

theories/normedtype_theory/normed_module.v

Lines changed: 23 additions & 16 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,28 @@ 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+
116+
Let ball_convex_set (x : convex_lmodType V) (r : K) : convex_set (ball x r).
117+
Proof.
118+
apply/convex_setW => z y; rewrite !inE -!ball_normE /= => zx yx l l0 l1.
119+
rewrite inE/=.
120+
rewrite [X in `|X|](_ : _ = (x - z : convex_lmodType _) <| l |>
121+
(x - y : convex_lmodType _)); last first.
122+
by rewrite opprD -[in LHS](convmm l x) addrACA -scalerBr -scalerBr.
123+
rewrite (le_lt_trans (ler_normD _ _))// !normrZ.
124+
rewrite (@ger0_norm _ l%:num)// (@ger0_norm _ l%:num.~) ?onem_ge0//.
125+
rewrite -[ltRHS]mul1r -(add_onemK l%:num) [ltRHS]mulrDl.
126+
by rewrite ltrD// ltr_pM2l// onem_gt0.
127+
Qed.
128+
114129
(** NB: we have almost the same proof in `tvs.v` *)
115-
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.
123-
by rewrite opprD addrACA -scalerBr -scalerBr.
124-
rewrite (@le_lt_trans _ _ (`|l| * `|x - z| + `|1 - l| * `|x - y|))//.
125-
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.
130+
Let locally_convex_set :
131+
exists2 B : set_system (convex_lmodType V),
132+
(forall b, b \in B -> convex_set b) & basis B.
133+
Proof.
134+
exists [set B | exists (x : convex_lmodType V) r, B = ball x r].
135+
by move=> b; rewrite inE => [[x]] [r] ->; exact: ball_convex_set.
129136
split; first by move=> B [x] [r] ->; exact: ball_open.
130137
move=> x B; rewrite -nbhs_ballE/= => -[r] r0 Bxr /=.
131138
by exists (ball x r) => //; split; [exists x, r|exact: ballxx].
@@ -135,7 +142,7 @@ HB.instance Definition _ :=
135142
PreTopologicalNmodule_isTopologicalNmodule.Build V add_continuous.
136143
HB.instance Definition _ :=
137144
TopologicalNmodule_isTopologicalLmodule.Build K V scale_continuous.
138-
HB.instance Definition _ := Uniform_isTvs.Build K V locally_convex.
145+
HB.instance Definition _ := Uniform_isTvs.Build K V locally_convex_set.
139146
HB.instance Definition _ :=
140147
PseudoMetricNormedZmod_Tvs_isNormedModule.Build K V normrZ.
141148

theories/normedtype_theory/tvs.v

Lines changed: 37 additions & 28 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,14 +308,10 @@ 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 := {
315-
locally_convex : exists2 B : set (set E),
316-
(forall b, b \in B -> convex b) & basis B
313+
locally_convex : exists2 B : set_system E,
314+
(forall b, b \in B -> convex_set b) & basis B
317315
}.
318316

319317
#[short(type="tvsType")]
@@ -360,8 +358,8 @@ HB.factory Record PreTopologicalLmod_isTvs (R : numDomainType) E
360358
& Topological E & GRing.Lmodule R E := {
361359
add_continuous : continuous (fun x : E * E => x.1 + x.2) ;
362360
scale_continuous : continuous (fun z : R^o * E => z.1 *: z.2) ;
363-
locally_convex : exists2 B : set (set E),
364-
(forall b, b \in B -> convex b) & basis B
361+
locally_convex : exists2 B : set_system E,
362+
(forall b, b \in B -> convex_set b) & basis B
365363
}.
366364

367365
HB.builders Context R E & PreTopologicalLmod_isTvs R E.
@@ -511,37 +509,45 @@ 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

514-
Let standard_locally_convex :
515-
exists2 B : set (set R^o), (forall b, b \in B -> convex b) & basis B.
512+
Local Open Scope convex_scope.
513+
514+
Let standard_ball_convex_set (x : R^o) (r : R) : convex_set (ball x r).
515+
Proof.
516+
apply/convex_setW => z y; rewrite !inE -!ball_normE /= => zx yx l l0 l1.
517+
rewrite inE/=.
518+
rewrite [X in `|X|](_ : _ = (x - z : convex_lmodType _) <| l |>
519+
(x - y : convex_lmodType _)); last first.
520+
by rewrite opprD -[in LHS](convmm l x) addrACA -scalerBr -scalerBr.
521+
rewrite (le_lt_trans (ler_normD _ _))// !normrM.
522+
rewrite (@ger0_norm _ l%:num)// (@ger0_norm _ l%:num.~) ?onem_ge0//.
523+
rewrite -[ltRHS]mul1r -(add_onemK l%:num) [ltRHS]mulrDl.
524+
by rewrite ltrD// ltr_pM2l// onem_gt0.
525+
Qed.
526+
527+
Let standard_locally_convex_set :
528+
exists2 B : set_system R^o, (forall b, b \in B -> convex_set b) & basis B.
516529
Proof.
517530
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.
531+
by move=> B/= /[!inE]/= [[x]] [r] ->; exact: standard_ball_convex_set.
528532
split; first by move=> B [x] [r] ->; exact: ball_open.
529533
move=> x B; rewrite -nbhs_ballE/= => -[r] r0 Bxr /=.
530-
by exists (ball x r) => //; split; [exists x, r|exact: ballxx].
534+
by exists (ball x r) => //=; split; [exists x, r|exact: ballxx].
531535
Qed.
532536

533537
HB.instance Definition _ :=
534538
PreTopologicalNmodule_isTopologicalNmodule.Build R^o standard_add_continuous.
535539
HB.instance Definition _ :=
536540
TopologicalNmodule_isTopologicalLmodule.Build R R^o standard_scale_continuous.
537-
HB.instance Definition _ := Uniform_isTvs.Build R R^o standard_locally_convex.
541+
HB.instance Definition _ :=
542+
Uniform_isTvs.Build R R^o standard_locally_convex_set.
538543

539544
End standard_topology.
540545

541546
Section prod_Tvs.
542547
Context (K : numFieldType) (E F : tvsType K).
543548

544-
Local Lemma prod_add_continuous : continuous (fun x : (E * F) * (E * F) => x.1 + x.2).
549+
Local Lemma prod_add_continuous :
550+
continuous (fun x : (E * F) * (E * F) => x.1 + x.2).
545551
Proof.
546552
move => [/= xy1 xy2] /= U /= [] [A B] /= [nA nB] nU.
547553
have [/= A0 [A01 A02] nA1] := @add_continuous E (xy1.1, xy2.1) _ nA.
@@ -552,7 +558,8 @@ move => [[x1 y1][x2 y2]] /= [] [] a1 b1 [] a2 b2.
552558
by apply: nU; split; [exact: (nA1 (x1, x2))|exact: (nB1 (y1, y2))].
553559
Qed.
554560

555-
Local Lemma prod_scale_continuous : continuous (fun z : K^o * (E * F) => z.1 *: z.2).
561+
Local Lemma prod_scale_continuous :
562+
continuous (fun z : K^o * (E * F) => z.1 *: z.2).
556563
Proof.
557564
move => [/= r [x y]] /= U /= []/= [A B] /= [nA nB] nU.
558565
have [/= A0 [A01 A02] nA1] := @scale_continuous K E (r, x) _ nA.
@@ -564,7 +571,7 @@ by move=> [l [e f]] /= [] [Al Bl] [] Ae Be; apply: nU; split;
564571
Qed.
565572

566573
Local Lemma prod_locally_convex :
567-
exists2 B : set (set (E * F)), (forall b, b \in B -> convex b) & basis B.
574+
exists2 B : set_system (E * F), (forall b, b \in B -> convex_set b) & basis B.
568575
Proof.
569576
have [Be Bcb Beb] := @locally_convex K E.
570577
have [Bf Bcf Bfb] := @locally_convex K F.
@@ -582,8 +589,10 @@ have : basis B.
582589
rewrite !nbhsE /=; split; first by exists a => //; split => //; exact: Beo.
583590
by exists b => //; split => // []; exact: Bfo.
584591
exists B => // => b; rewrite inE /= => [[]] bo [] be [] bf Bee [] Bff <-.
585-
move => [x1 y1] [x2 y2] l /[!inE] /= -[xe1 yf1] [xe2 yf2] l0 l1.
586-
by split; rewrite -inE; [apply: Bcb; rewrite ?inE|apply: Bcf; rewrite ?inE].
592+
move => [x1 y1] [x2 y2] l /[!inE] /= -[xe1 yf1] [xe2 yf2].
593+
split.
594+
by apply/set_mem/Bcb; [exact/mem_set|exact/mem_set|exact/mem_set].
595+
by apply/set_mem/Bcf; [exact/mem_set|exact/mem_set|exact/mem_set].
587596
Qed.
588597

589598
HB.instance Definition _ := PreTopologicalNmodule_isTopologicalNmodule.Build

0 commit comments

Comments
 (0)