Skip to content

Commit bc9477f

Browse files
committed
sup and inf from realtype
1 parent 953d96a commit bc9477f

File tree

1 file changed

+31
-99
lines changed

1 file changed

+31
-99
lines changed

theories/hahn_banach_theorem.v

Lines changed: 31 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -27,37 +27,10 @@ Import Order.TTheory GRing.Theory Num.Def Num.Theory.
2727

2828
Local Open Scope ring_scope.
2929
Local Open Scope convex_scope.
30+
Local Open Scope real_scope.
3031
Import GRing.Theory.
3132
Import Num.Theory.
3233

33-
Section SetPredRels.
34-
35-
Variables T U : Type.
36-
Implicit Types f g : T -> U -> Prop.
37-
(* Functional (possibly empty or partial) graphs *)
38-
Definition functional f :=
39-
forall v r1 r2, f v r1 -> f v r2 -> r1 = r2.
40-
41-
End SetPredRels.
42-
43-
44-
Section OrderRels.
45-
46-
Variable (R : numDomainType).
47-
48-
(* Upper bound *)
49-
Definition ubd (s : set R) (a : R) := forall x, s x -> x <= a.
50-
51-
(* Lower bound *)
52-
Definition ibd (s : set R) (a : R) := forall x, s x -> a <= x.
53-
54-
(* the intension is that f is the graph of a function bounded by p *)
55-
Definition maj_by T p (f : T -> R -> Prop) :=
56-
forall v r, f v r -> r <= p v.
57-
58-
End OrderRels.
59-
60-
6134
Section LinAndCvx.
6235

6336
Variables (R : numDomainType) (V : lmodType R).
@@ -103,7 +76,7 @@ Section OrderRels.
10376

10477
Section HBPreparation.
10578

106-
Variables (R : realFieldType) (V : lmodType R).
79+
Variables (R : realType) (V : lmodType R).
10780

10881
Variables (F : set V) (phi : V -> R) (p : V -> R).
10982

@@ -122,18 +95,13 @@ Qed.
12295
About convex_function.
12396
Hypothesis p_cvx : (@convex_function R V [set: V] p).
12497

125-
Hypothesis sup : forall (A : set R) (a m : R),
126-
A a -> ubd A m ->
127-
{s : R | ubd A s /\ forall u, ubd A u -> s <= u}.
128-
129-
Hypothesis inf : forall (A : set R) (a m : R),
130-
A a -> ibd A m ->
131-
{s : R | ibd A s /\ forall u, ibd A u -> u <= s}.
98+
Definition prol f := forall v, F v -> f v (phi v).
13299

133-
(* f is a subset of (V x R), if v is in pi_1 f, then (v, phi v) is in f.
134-
Otherwise said, the graph of phi restructed to pi_1 f is included in f*)
100+
Definition maj_by T p (f : T -> R -> Prop) :=
101+
forall v r, f v r -> r <= p v.
135102

136-
Definition prol f := forall v, F v -> f v (phi v).
103+
Definition functional f :=
104+
forall v r1 r2, f v r1 -> f v r2 -> r1 = r2.
137105

138106
Definition spec (f : V -> R -> Prop) :=
139107
[/\ functional f, linear_rel f, maj_by p f & prol f].
@@ -269,13 +237,21 @@ Hypothesis p_cvx : (@convex_function R V [set: V] p).
269237
[/\ c x1 r1, 0 < s1 & r = a x1 r1 s1].
270238
pose Pb : set R := fun r => exists x1, exists r1, exists s1,
271239
[/\ c x1 r1, 0 < s1 & r = b x1 r1 s1].
272-
have exPa : Pa (a 0 0 1) by exists 0; exists 0; exists 1; split.
273-
have exPb : Pb (b 0 0 1) by exists 0; exists 0; exists 1; split.
274-
have majPa x : Pa x -> x <= b 0 0 1.
275-
move=> [y [r [s [cry lt0s ->]]]]; apply: le_a_b => //; exact: ltr01.
276-
have minPb x : Pb x -> a 0 0 1 <= x.
277-
move=> [y [r [s [cry lt0s ->]]]]; apply: le_a_b => //; exact: ltr01.
278-
have [sa [ubdP saP]]:= sup exPa majPa; have [ib [ibdP ibP]]:= inf exPb minPb.
240+
(* have exPb : Pb (b 0 0 1) by exists 0; exists 0; exists 1; split. *)
241+
(* have minPb x : Pb x -> a 0 0 1 <= x. *)
242+
(* move=> [y [r [s [cry lt0s ->]]]]; apply: le_a_b => //; exact: ltr01. *)
243+
(* have [ib [ibdP ibP]]:= inf exPb minPb. (*To be deleted*) *)
244+
pose sa := reals.sup Pa. (* This is why we need realTypes, we need P with values in a realType *)
245+
have Pax : Pa !=set0 by exists (a 0 0 1); exists 0; exists 0; exists 1; split.
246+
have ubdP : ubound Pa sa.
247+
apply: sup_upper_bound; split => //=.
248+
exists (b 0 0 1) =>/= x [y [r [s [cry lt0s ->]]]]; apply: le_a_b => //; exact: ltr01.
249+
have saP: forall u : R, ubound Pa u -> sa <= u by move=> u; apply: ge_sup.
250+
pose ib := reals.inf Pb. (* This is why we need realTypes, we need P with values in a realType *)
251+
have Pbx : Pb !=set0 by exists (b 0 0 1); exists 0; exists 0; exists 1; split.
252+
have ibdP : lbound Pb ib.
253+
by apply: ge_inf; exists (a 0 0 1) =>/= x [y [r [s [cry lt0s ->]]]]; apply: le_a_b => //; exact: ltr01.
254+
have ibP: forall u : R, lbound Pb u -> u <= ib by move=> u; apply: lb_le_inf Pbx.
279255
have le_sa_ib : sa <= ib.
280256
apply: saP=> r' [y [r [l [cry lt0l -> {r'}]]]].
281257
apply: ibP=> s' [z [s [m [crz lt0m -> {s'}]]]]; exact: le_a_b.
@@ -356,18 +332,10 @@ Qed.
356332
on R. We do not make use of the 'vector' interface as the latter enforces
357333
finite dimension. *)
358334

359-
Variables (R : realFieldType) (V : lmodType R).
335+
Variables (R : realType) (V : lmodType R) (f: V -> R).
360336

361-
Hypothesis sup : forall (A : set R) (a m : R),
362-
A a -> ubd A m ->
363-
{s : R | ubd A s /\ forall u, ubd A u -> s <= u}.
364-
365-
(* This could be obtained from sup but we are lazy here *)
366-
Hypothesis inf : forall (A : set R) (a m : R),
367-
A a -> ibd A m ->
368-
{s : R | ibd A s /\ forall u, ibd A u -> u <= s}.
337+
Variables (F : set V) (phi : V -> R) (p : V -> R).
369338

370-
Variables (F : pred V) (f : V -> R) (p : V -> R).
371339

372340
(* MathComp seems to lack of an interface for submodules of V, so for now
373341
we state "by hand" that F is closed under linear combinations. *)
@@ -389,13 +357,12 @@ have lin_graphF : linear_rel graphF.
389357
move=> v1 v2 l r1 r2 [Fv1 ->] [Fv2 ->]; split; first exact: linF.
390358
by rewrite linfF.
391359
have maj_graphF : maj_by p graphF by move=> v r [Fv ->]; exact: f_bounded_by_p.
392-
393360
have prol_graphF : prol F f graphF by move=> v Fv; split.
394361
have graphFP : spec F f p graphF by split.
395362
have [z zmax]:= zorn_rel_ex graphFP.
396363
pose FP v : Prop := F v.
397364
have FP0 : FP 0 by [].
398-
have [g gP]:= (hb_witness linfF FP0 p_cvx sup inf zmax).
365+
have [g gP]:= (hb_witness linfF FP0 p_cvx zmax).
399366
have scalg : linear_for *%R g.
400367
case: z {zmax} gP=> [c [_ ls1 _ _]] /= gP.
401368
have addg : additive g.
@@ -432,16 +399,7 @@ Section HahnBanachnew.
432399
on R. We do not make use of the 'vector' interface as the latter enforces
433400
finite dimension. *)
434401

435-
Variables (R : realFieldType) (V : lmodType R).
436-
437-
Hypothesis sup : forall (A : set R) (a m : R),
438-
A a -> ubd A m ->
439-
{s : R | ubd A s /\ forall u, ubd A u -> s <= u}.
440-
441-
(* This could be obtained from sup but we are lazy here *)
442-
Hypothesis inf : forall (A : set R) (a m : R),
443-
A a -> ibd A m ->
444-
{s : R | ibd A s /\ forall u, ibd A u -> u <= s}.
402+
Variables (R : realType) (V : lmodType R).
445403

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

@@ -463,7 +421,7 @@ have [z zmax]:= zorn_rel_ex graphFP.
463421
*)
464422
pose FP v : Prop := F v.
465423
have FP0 : FP 0 by [].
466-
have [g gP]:= hb_witness linfF FP0 p_cvx sup inf zmax.
424+
have [g gP]:= hb_witness linfF FP0 p_cvx inf zmax.
467425
have scalg : linear_for *%R g.
468426
case: z {zmax} gP=> [c [_ ls1 _ _]] /= gP.
469427
have addg : additive g.
@@ -495,6 +453,7 @@ End HahnBanachnew.
495453

496454

497455
Section HBGeom.
456+
(* TODO : make R : realFieldtype *)
498457
Variable (R : realType) (V : normedModType R) (F : pred V) (f : V -> R) (F0 : F 0).
499458

500459
Hypothesis linF : forall (v1 v2 : V) (l : R), F v1 -> F v2 -> F (v1 + l *: v2).
@@ -553,34 +512,8 @@ Proof.
553512
by rewrite add0r.
554513
Qed.
555514

556-
Lemma mymysup : forall (A : set R) (a m : R),
557-
A a -> ubound A m ->
558-
{s : R | ubound A s /\ forall u, ubound A u -> s <= u}.
559-
Proof.
560-
move => A a m Aa majAm.
561-
have [A0 Aub]: has_sup A. split; first by exists a.
562-
by exists m => x; apply majAm.
563-
exists (reals.sup A).
564-
split.
565-
by apply: sup_upper_bound.
566-
by move => x; apply: sup_le_ub.
567-
Qed.
568-
569-
(*TODO: should be lb_le_inf: *)
570-
Lemma mymyinf : forall (A : set R) (a m : R),
571-
A a -> lbound A m ->
572-
{s : R | lbound A s /\ forall u, lbound A u -> u <= s}.
573-
move => A a m Aa minAm.
574-
have [A0 Alb]: has_inf A. split; first by exists a.
575-
by exists m => x; apply minAm.
576-
exists (reals.inf A).
577-
split.
578-
exact: ge_inf.
579-
by move => x; apply: lb_le_inf.
580-
Qed.
581-
582515
Notation myHB :=
583-
(HahnBanachold mymysup mymyinf F0 linF linfF).
516+
(HahnBanachold F0 linF linfF).
584517

585518
Theorem HB_geom_normed :
586519
continuousR_on_at F 0 f ->
@@ -594,9 +527,8 @@ Proof.
594527
apply: le_trans.
595528
have H : `|l%:num *: v1 + (l%:num).~ *: v2| <= `|l%:num *: v1| + `|(l%:num).~ *: v2|.
596529
by apply: ler_normD.
597-
by apply: (@ler_pM _ _ _ r r _ _ H) => //; apply: ltW.
598-
rewrite mulrDl !normrZ -mulr_algl -[X in _ <= _ + X]mulr_algl !scaler1.
599-
(* where is the lemma combining mulr_algl and scaler1, easier to search *)
530+
by apply: (@ler_pM _ _ _ r r _ _ H) => //; apply: ltW.
531+
rewrite mulrDl !normrZ -![_ *: _]/(_ * _).
600532
have -> : `|l%:num| = l%:num by apply/normr_idP.
601533
have -> : `|(l%:num).~| = (l%:num).~ by apply/normr_idP; apply: onem_ge0.
602534
by rewrite !mulrA.

0 commit comments

Comments
 (0)