Skip to content

Commit 5d61806

Browse files
committed
convex function generalization wip
1 parent d382cf7 commit 5d61806

2 files changed

Lines changed: 40 additions & 33 deletions

File tree

CHANGELOG_UNRELEASED.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@
226226
- moved from `tvs.v` to `convex.v`
227227
+ definition `convex`
228228

229+
- in convex.v
230+
+ definition `convex_function` generalized from a realspace as domain to a lmodType as domain
231+
229232
### Renamed
230233

231234
- in `topology_structure.v`

theories/hahn_banach_theorem.v

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
From HB Require Import structures.
22
From mathcomp Require Import all_ssreflect all_algebra.
33
From mathcomp Require Import interval_inference.
4-
From mathcomp Require Import wochoice boolp classical_sets topology reals.
5-
From mathcomp Require Import filter reals normedtype.
4+
From mathcomp Require Import unstable wochoice boolp classical_sets topology reals.
5+
From mathcomp Require Import filter reals normedtype convex.
66
Import numFieldNormedType.Exports.
77
Local Open Scope classical_set_scope.
88

@@ -25,7 +25,8 @@ Import Order.TTheory GRing.Theory Num.Def Num.Theory.
2525

2626

2727

28-
Local Open Scope ring_scope.
28+
Local Open Scope ring_scope.
29+
Local Open Scope convex_scope.
2930
Import GRing.Theory.
3031
Import Num.Theory.
3132

@@ -60,10 +61,12 @@ Section OrderRels.
6061
Section LinAndCvx.
6162

6263
Variables (R : numDomainType) (V : lmodType R).
63-
64-
Definition convex_fun (p : V -> R) := forall v1 v2 l m,
64+
(*
65+
Check convex_function.
66+
Definition convex_function (p : V -> R) := forall v1 v2 l m,
6567
( 0 <= l /\ 0 <= m) -> l + m = 1 -> p (l *: v1 + m *: v2) <= l * (p v1) + m * (p v2).
66-
68+
*)
69+
6770
Definition linear_rel (f : V -> R -> Prop) :=
6871
forall v1 v2 l r1 r2, f v1 r1 -> f v2 r2 -> f (v1 + l *: v2) (r1 + l * r2).
6972

@@ -102,22 +105,22 @@ Section OrderRels.
102105

103106
Variables (R : realFieldType) (V : lmodType R).
104107

105-
Variables (F G : set V) (phi : V -> R) (p : V -> R).
108+
Variables (F : set V) (phi : V -> R) (p : V -> R).
106109

107110
Hypothesis linphiF : forall v1 v2 l, F v1 -> F v2 ->
108111
phi (v1 + l *: v2) = phi v1 + l * (phi v2).
109-
110112
Implicit Types (f g : V -> R -> Prop).
111113

112-
Hypothesis F0 : F 0.
114+
Hypothesis F0 : F 0.
113115

114116
Fact phi0 : phi 0 = 0.
115117
Proof.
116118
have -> : 0 = 0 + (-1) *: 0 :> V by rewrite scaler0 addr0.
117119
by rewrite linphiF // mulN1r addrN.
118120
Qed.
119121

120-
Hypothesis p_cvx : convex_fun p.
122+
About convex_function.
123+
Hypothesis p_cvx : (@convex_function R V [set: V] p).
121124

122125
Hypothesis sup : forall (A : set R) (a m : R),
123126
A a -> ubd A m ->
@@ -198,6 +201,15 @@ Qed.
198201
(*The next lemma proves that when z is of zorn_type, it can be extended on any
199202
real line directed by an arbitrary vector v *)
200203

204+
Lemma divDl_ge0 (s t : R) (s0 : 0 <= s) (t0 : 0 <= t) : 0 <= s / (s +t).
205+
Admitted.
206+
207+
Lemma divDl_le1 (s t : R) (s0 : 0 <= s) (t0 : 0 <= t) : s / (s +t) <= 1.
208+
Admitted.
209+
210+
Lemma divD_onem (s t : R) : (s / (s + t)).~ = t / (s + t).
211+
Admitted.
212+
201213
Lemma domain_extend (z : zorn_type) v :
202214
exists2 ze : zorn_type, (zorn_rel z ze) & (exists r, (carrier ze) v r).
203215
Proof.
@@ -229,16 +241,11 @@ Qed.
229241
have /ler_pM2r <- : 0 < (s + t) ^-1 by rewrite invr_gt0 addr_gt0.
230242
set y1 : V := _ + _ *: _; set y2 : V := _ - _ *: _.
231243
set rhs := (X in _ <= X).
232-
have step1 : p (s / (s + t) *: y1 + t / (s + t) *: y2) <= rhs.
233-
rewrite /rhs !mulrDl ![_ * _ / _]mulrAC; apply: p_cvx.
234-
split.
235-
rewrite divr_ge0 //=.
236-
by apply : ltW.
237-
by rewrite addr_ge0 //= ; apply: ltW.
238-
rewrite divr_ge0 //=.
239-
by apply : ltW.
240-
by rewrite addr_ge0 //= ; apply: ltW.
241-
by rewrite -mulrDl mulfV //; apply: lt0r_neq0; rewrite addr_gt0.
244+
have step1 : p (s / (s + t) *: y1 + t / (s + t) *: y2) <= rhs.
245+
rewrite /rhs !mulrDl ![_ * _ / _]mulrAC.
246+
pose st := Itv01 (divDl_ge0 (ltW lt0s) (ltW lt0t)) ((divDl_le1 (ltW lt0s) (ltW lt0t))).
247+
move: (p_cvx st (in_setT y1) (in_setT y2)).
248+
by rewrite /conv /= [X in ((_ <= X)-> _)]/conv /= divD_onem /=.
242249
apply: le_trans step1 => {rhs}.
243250
set u : V := (X in p X).
244251
have {u y1 y2} -> : u = t / (s + t) *: x1 + s / (s + t) *: x2.
@@ -351,9 +358,7 @@ Hypothesis inf : forall (A : set R) (a m : R),
351358
A a -> ibd A m ->
352359
{s : R | ibd A s /\ forall u, ibd A u -> u <= s}.
353360

354-
(* F and G are of type V -> bool, as required by the Mathematical Components
355-
interfaces. f is a linear application from (the entire) V to R. *)
356-
Variables (F G : pred V) (f : V -> R) (p : V -> R).
361+
Variables (F : pred V) (f : V -> R) (p : V -> R).
357362

358363
(* MathComp seems to lack of an interface for submodules of V, so for now
359364
we state "by hand" that F is closed under linear combinations. *)
@@ -363,10 +368,7 @@ Hypothesis linF : forall v1 v2 l, F v1 -> F v2 -> F (v1 + l *: v2).
363368
Hypothesis linfF : forall v1 v2 l, F v1 -> F v2 ->
364369
f (v1 + l *: v2) = f v1 + l * (f v2).
365370

366-
(* In fact we do not need G to be a superset of F *)
367-
(* Hypothesis sFG : subpred F G. *)
368-
369-
Hypothesis p_cvx : convex_fun p.
371+
Hypothesis p_cvx : (@convex_function R V [set: V] p).
370372

371373
Hypothesis f_bounded_by_p : forall x, F x -> f x <= p x.
372374

@@ -384,7 +386,7 @@ have graphFP : spec F f p graphF by split.
384386
have [z zmax]:= zorn_rel_ex graphFP.
385387
pose FP v : Prop := F v.
386388
have FP0 : FP 0 by [].
387-
have [g gP]:= hb_witness linfF FP0 p_cvx sup inf zmax.
389+
have [g gP]:= (hb_witness linfF FP0 p_cvx sup inf graphFP zmax).
388390
have scalg : linear_for *%R g.
389391
case: z {zmax} gP=> [c [_ ls1 _ _]] /= gP.
390392
have addg : additive g.
@@ -434,7 +436,7 @@ Hypothesis inf : forall (A : set R) (a m : R),
434436

435437
Variables (F : subLmodType V) (f : {linear F -> R}) (p : V -> R).
436438

437-
Hypothesis p_cvx : convex_fun p.
439+
Hypothesis p_cvx : (@convex_function R V [set: V] p).
438440

439441
Hypothesis f_bounded_by_p : forall x : F, (f x) <= (p (val x)).
440442

@@ -490,12 +492,12 @@ Hypothesis linF : forall (v1 v2 : V) (l : R), F v1 -> F v2 -> F (v1 + l *: v2).
490492
Hypothesis linfF : forall v1 v2 l, F v1 -> F v2 -> f (v1 + l *: v2) = f v1 + l * (f v2).
491493

492494
(*Looked a long time for within *)
493-
Definition continuousR_on ( G : set V ) (g : V -> R) :=
495+
Definition continuousR_on (G : set V) (g : V -> R) :=
494496
{within G, continuous g}.
495497
(* (forall x, (g @ (within G (nbhs x))) --> g x).*)
496498

497499
(*Do we need to have F x ?*)
498-
Definition continuousR_on_at (G : set V ) (x : V ) (g : V -> R) :=
500+
Definition continuousR_on_at (G : set V) (x : V) (g : V -> R) :=
499501
g @ (within G (nbhs x)) --> (g x).
500502

501503
Lemma continuousR_scalar_on_bounded :
@@ -577,8 +579,10 @@ Theorem HB_geom_normed :
577579
Proof.
578580
move=> H; move: (continuousR_scalar_on_bounded H) => [r [ltr0 fxrx]] {H}.
579581
pose p:= fun x : V => `|x|*r.
580-
have convp: convex_fun p.
581-
move=> v1 v2 l m [lt0l lt0m] addlm1 //= ; rewrite !/( p _) !mulrA -mulrDl.
582+
have convp: (@convex_function _ _ [set: V] p).
583+
rewrite /convex_function /conv => l v1 v2 _ _ /=.
584+
rewrite [X in (_ <= X)]/conv /=.
585+
move => v1 v2 l m [lt0l lt0m] addlm1 //= ; rewrite !/( p _) !mulrA -mulrDl.
582586
suff: `|l *: v1 + m *: v2| <= (l * `|v1| + m * `|v2|).
583587
move => h; apply : ler_pM; last by [].
584588
by apply : normr_ge0.

0 commit comments

Comments
 (0)