Skip to content

Commit 2937360

Browse files
committed
clean
1 parent fe680db commit 2937360

File tree

1 file changed

+79
-97
lines changed

1 file changed

+79
-97
lines changed

theories/hahn_banach_theorem.v

Lines changed: 79 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,12 @@ From mathcomp Require Import filter reals normedtype convex.
66
Import numFieldNormedType.Exports.
77
Local Open Scope classical_set_scope.
88

9-
(* Marie's proposal: encode the "partial" properties by reasoning on
10-
the graph of functions. The other option would be to study a partial
11-
order defined on subsets of the ambiant space V, on which it is possible
12-
to obtain a bounded lineEar form extending f. But this options seems much
13-
less convenient, in particular when establishing that one can extend f
14-
on a space with one more dimension. Indeed, exhibiting a term of type
15-
V -> R requires a case ternary analysis on F, the new line, and an
16-
explicit direct sum to ensure the definition is exhaustive. Working with
17-
graphs allows to leave this argument completely implicit. *)
18-
19-
209
Set Implicit Arguments.
2110
Unset Strict Implicit.
2211
Unset Printing Implicit Defensive.
2312
Import Order.TTheory GRing.Theory Num.Def Num.Theory.
2413

2514

26-
27-
2815
Local Open Scope ring_scope.
2916
Local Open Scope convex_scope.
3017
Local Open Scope real_scope.
@@ -46,24 +33,24 @@ Variable f : graph.
4633
Hypothesis lrf : linear_graph f.
4734

4835
Lemma lingraph_00 x r : f x r -> f 0 0.
49-
Proof.
50-
suff -> : f 0 0 = f (x + (-1) *: x) (r + (-1) * r) by move=> h; apply: lrf.
51-
by rewrite scaleNr mulNr mul1r scale1r !subrr.
52-
Qed.
36+
Proof.
37+
suff -> : f 0 0 = f (x + (-1) *: x) (r + (-1) * r) by move=> h; apply: lrf.
38+
by rewrite scaleNr mulNr mul1r scale1r !subrr.
39+
Qed.
5340

54-
Lemma lingraph_scale x r l : f x r -> f (l *: x) (l * r).
55-
Proof.
56-
move=> fxr.
57-
have -> : f (l *: x) (l * r) = f (0 + l *: x) (0 + l * r) by rewrite !add0r.
58-
by apply: lrf=> //; apply: lingraph_00 fxr.
59-
Qed.
41+
Lemma lingraph_scale x r l : f x r -> f (l *: x) (l * r).
42+
Proof.
43+
move=> fxr.
44+
have -> : f (l *: x) (l * r) = f (0 + l *: x) (0 + l * r) by rewrite !add0r.
45+
by apply: lrf=> //; exact: lingraph_00 fxr.
46+
Qed.
6047

61-
Lemma lingraph_add x1 x2 r1 r2 : f x1 r1 -> f x2 r2 -> f (x1 - x2)(r1 - r2).
62-
Proof.
63-
have -> : x1 - x2 = x1 + (-1) *: x2 by rewrite scaleNr scale1r.
64-
have -> : r1 - r2 = r1 + (-1) * r2 by rewrite mulNr mul1r.
65-
by apply: lrf.
66-
Qed.
48+
Lemma lingraph_add x1 x2 r1 r2 : f x1 r1 -> f x2 r2 -> f (x1 - x2)(r1 - r2).
49+
Proof.
50+
have -> : x1 - x2 = x1 + (-1) *: x2 by rewrite scaleNr scale1r.
51+
have -> : r1 - r2 = r1 + (-1) * r2 by rewrite mulNr mul1r.
52+
by exact: lrf.
53+
Qed.
6754

6855

6956
Definition add_line f w a := fun v r =>
@@ -73,6 +60,32 @@ Lemma lingraph_00 x r : f x r -> f 0 0.
7360
End Lingraphsec.
7461
End Lingraph.
7562

63+
Section pos_quotient.
64+
Variable (R : realType).
65+
66+
(* auxiliary lemmas that could be moved elsewhere *)
67+
68+
Lemma divDl_ge0 (s t : R) (s0 : 0 <= s) (t0 : 0 <= t) : 0 <= s / (s +t).
69+
by apply: divr_ge0 => //; apply: addr_ge0.
70+
Qed.
71+
72+
Lemma divDl_le1 (s t : R) (s0 : 0 <= s) (t0 : 0 <= t) : s / (s +t) <= 1.
73+
move: s0; rewrite le0r => /orP []; first by move => /eqP ->; rewrite mul0r //.
74+
move: t0; rewrite le0r => /orP [].
75+
by move => /eqP -> s0; rewrite addr0 divff //=; apply: lt0r_neq0.
76+
by move=> t0 s0; rewrite ler_pdivrMr ?mul1r ?addr_gt0 // lerDl ltW.
77+
Qed.
78+
79+
Lemma divD_onem (s t : R) (s0 : 0 < s) (t0 : 0 < t): (s / (s + t)).~ = t / (s + t).
80+
rewrite /(_).~.
81+
suff -> : 1 = (s + t)/(s + t) by rewrite -mulrBl -addrAC subrr add0r.
82+
rewrite divff // /eqP addr_eq0; apply/negbT/eqP => H.
83+
by move: s0; rewrite H oppr_gt0 ltNge; move/negP; apply; rewrite ltW.
84+
Qed.
85+
86+
87+
End pos_quotient.
88+
7689

7790
Section HBPreparation.
7891
Import Lingraph.
@@ -167,30 +180,13 @@ Definition zornS (z1 z2 : zorn_type):=
167180
Qed.
168181

169182

170-
Variable g : zorn_type.
183+
Variable g : zorn_type.
171184

172-
Hypothesis gP : forall z, zornS g z -> z = g.
185+
Hypothesis gP : forall z, zornS g z -> z = g.
173186

174-
(*The next lemma proves that when z is of zorn_type, it can be extended on any
175-
real line directed by an arbitrary vector v *)
187+
(*The next lemma proves that when z is of zorn_type, it can be extended on any
188+
real line directed by an arbitrary vector v *)
176189

177-
Lemma divDl_ge0 (s t : R) (s0 : 0 <= s) (t0 : 0 <= t) : 0 <= s / (s +t).
178-
by apply: divr_ge0 => //; apply: addr_ge0.
179-
Qed.
180-
181-
Lemma divDl_le1 (s t : R) (s0 : 0 <= s) (t0 : 0 <= t) : s / (s +t) <= 1.
182-
move: s0; rewrite le0r => /orP []; first by move => /eqP ->; rewrite mul0r //.
183-
move: t0; rewrite le0r => /orP [].
184-
by move => /eqP -> s0; rewrite addr0 divff //=; apply: lt0r_neq0.
185-
by move=> t0 s0; rewrite ler_pdivrMr ?mul1r ?addr_gt0 // lerDl ltW.
186-
Qed.
187-
188-
Lemma divD_onem (s t : R) (s0 : 0 < s) (t0 : 0 < t): (s / (s + t)).~ = t / (s + t).
189-
rewrite /(_).~.
190-
suff -> : 1 = (s + t)/(s + t) by rewrite -mulrBl -addrAC subrr add0r.
191-
rewrite divff // /eqP addr_eq0; apply/negbT/eqP => H.
192-
by move: s0; rewrite H oppr_gt0 ltNge; move/negP; apply; rewrite ltW.
193-
Qed.
194190

195191
Lemma domain_extend (z : zorn_type) v :
196192
exists2 ze : zorn_type, (zornS z ze) & (exists r, (carrier ze) v r).
@@ -201,12 +197,9 @@ Definition zornS (z1 z2 : zorn_type):=
201197
have c00 : c 0 0.
202198
have <- : phi 0 = 0 by rewrite linear0.
203199
by move: ps1; rewrite /extend_graph /= => /(_ 0) /=; rewrite GRing.val0; apply.
204-
have [a aP] : exists a, forall (x : V) (r lambda : R),
205-
c x r -> r + lambda * a <= p (x + lambda *: v).
206-
suff [a aP] : exists a, forall (x : V) (r lambda : R),
207-
c x r -> 0 < lambda ->
208-
r + lambda * a <= p (x + lambda *: v) /\
209-
r - lambda * a <= p (x - lambda *: v).
200+
have [a aP] : exists a, forall (x : V) (r lambda : R), c x r -> r + lambda * a <= p (x + lambda *: v).
201+
suff [a aP] : exists a, forall (x : V) (r lambda : R), c x r -> 0 < lambda ->
202+
r + lambda * a <= p (x + lambda *: v) /\ r - lambda * a <= p (x - lambda *: v).
210203
exists a=> x r lambda cxr.
211204
have {aP} aP := aP _ _ _ cxr.
212205
case: (ltrgt0P lambda) ; [by case/aP | move=> ltl0 | move->]; last first.
@@ -216,8 +209,7 @@ Definition zornS (z1 z2 : zorn_type):=
216209
done.
217210
pose b (x : V) r lambda : R := (p (x + lambda *: v) - r) / lambda.
218211
pose a (x : V) r lambda : R := (r - p (x - lambda *: v)) / lambda.
219-
have le_a_b x1 x2 r1 r2 s t : c x1 r1 -> c x2 r2 -> 0 < s -> 0 < t ->
220-
a x1 r1 s <= b x2 r2 t.
212+
have le_a_b x1 x2 r1 r2 s t : c x1 r1 -> c x2 r2 -> 0 < s -> 0 < t -> a x1 r1 s <= b x2 r2 t.
221213
move=> cxr1 cxr2 lt0s lt0t; rewrite /a /b.
222214
rewrite ler_pdivlMr // mulrAC ler_pdivrMr // mulrC [_ * s]mulrC.
223215
rewrite !mulrDr !mulrN lerBlDr addrAC lerBrDr.
@@ -260,67 +252,58 @@ Definition zornS (z1 z2 : zorn_type):=
260252
pose alpha := ((sa + ib) / 2%:R).
261253
have le_alpha_ib : alpha <= ib by rewrite /alpha midf_le.
262254
have le_sa_alpha : sa <= alpha by rewrite /alpha midf_le.
263-
exists alpha => x r l cxr lt0l; split.
255+
exists alpha => x r l cxr lt0l; split.
264256
- suff : alpha <= b x r l.
265257
by rewrite /b; move/ler_pdivlMr: lt0l->; rewrite lerBrDl mulrC.
266258
by apply: le_trans le_alpha_ib _; apply: ibdP; exists x; exists r; exists l.
267259
- suff : a x r l <= alpha.
268-
rewrite /a. move/ler_pdivrMr: lt0l->.
269-
by rewrite lerBlDl -lerBlDr mulrC.
270-
by apply: le_trans le_sa_alpha; apply: ubdP; exists x; exists r; exists l.
271-
pose z' := fun k r =>
272-
exists v' : V, exists r' : R, exists lambda : R,
273-
[/\ c v' r', k = v' + lambda *: v & r = r' + lambda * a].
274-
have z'_extends : forall v r, c v r -> z' v r.
275-
move=> x r cxr; exists x; exists r; exists 0; split=> //.
276-
- by rewrite scale0r addr0.
277-
- by rewrite mul0r addr0.
278-
have z'_prol : extend_graph z'.
279-
move=> x; exists (val x); exists (phi x); exists 0; split=> //.
280-
- by rewrite scale0r addr0.
281-
- by rewrite mul0r addr0.
282-
- have z'_maj_by_p : le_graph p z'.
283-
by move=> x r [w [s [l [cws -> ->]]]]; apply: aP.
284-
- have z'_lin : linear_graph z'.
260+
by rewrite /a; move/ler_pdivrMr: lt0l-> ; rewrite lerBlDl -lerBlDr mulrC.
261+
by apply: le_trans le_sa_alpha; apply: ubdP; exists x; exists r; exists l.
262+
pose z' := fun k r => exists v' : V, exists r' : R, exists lambda : R,
263+
[/\ c v' r', k = v' + lambda *: v & r = r' + lambda * a].
264+
have z'_extends : forall v r, c v r -> z' v r.
265+
by move=> x r cxr; exists x; exists r; exists 0; split; rewrite // ?scale0r ?mul0r !addr0.
266+
have z'_prol : extend_graph z'.
267+
by move=> x; exists (val x); exists (phi x); exists 0; split; rewrite // ?scale0r ?mul0r !addr0.
268+
have z'_maj_by_p : le_graph p z' by move=> x r [w [s [l [cws -> ->]]]]; apply: aP.
269+
have z'_lin : linear_graph z'.
285270
move=> x1 x2 l r1 r2 [w1 [s1 [m1 [cws1 -> ->]]]] [w2 [s2 [m2 [cws2 -> ->]]]].
286271
set w := (X in z' X _); set s := (X in z' _ X).
287272
have {w} -> : w = w1 + l *: w2 + (m1 + l * m2) *: v.
288273
by rewrite /w !scalerDr !scalerDl scalerA -!addrA [X in _ + X]addrCA.
289274
have {s} -> : s = s1 + l * s2 + (m1 + l * m2) * a.
290275
by rewrite /s !mulrDr !mulrDl mulrA -!addrA [X in _ + X]addrCA.
291276
exists (w1 + l *: w2); exists (s1 + l * s2); exists (m1 + l * m2); split=> //.
292-
exact: ls1.
293-
- have z'_functional : functional_graph z'.
294-
move=> w r1 r2 [w1 [s1 [m1 [cws1 -> ->]]]] [w2 [s2 [m2 [cws2 e1 ->]]]].
295-
have h1 (x : V) (r l : R) : x = l *: v -> c x r -> x = 0 /\ l = 0.
296-
move=> -> cxr; case: (l =P 0) => [-> | /eqP ln0]; first by rewrite scale0r.
277+
by exact: ls1.
278+
have z'_functional : functional_graph z'.
279+
move=> w r1 r2 [w1 [s1 [m1 [cws1 -> ->]]]] [w2 [s2 [m2 [cws2 e1 ->]]]].
280+
have h1 (x : V) (r l : R) : x = l *: v -> c x r -> x = 0 /\ l = 0.
281+
move=> -> cxr; case: (l =P 0) => [-> | /eqP ln0]; first by rewrite scale0r.
297282
suff cvs: c v (l^-1 * r) by elim:nzv; exists (l^-1 * r).
298283
suff -> : v = l ^-1 *: (l *: v).
299-
have -> :
300-
c ( l ^-1 *: (l *: v)) (l^-1 * r) =
301-
c (0 + l ^-1 *: (l *: v)) (0 + l^-1 * r) by rewrite !add0r.
284+
have -> : c(l^-1*:(l*:v))(l^-1*r) = c(0 + l^-1*:(l*:v))(0+l^-1*r) by rewrite !add0r.
302285
by apply: ls1=> //; apply: linrel_00 fxr.
303286
by rewrite scalerA mulVf ?scale1r.
304287
have [rw12 erw12] : exists r, c (w1 - w2) r.
305-
exists (s1 + (-1) * s2).
288+
exists (s1+(-1)*s2).
306289
have -> : w1 - w2 = w1 + (-1) *: w2 by rewrite scaleNr scale1r.
307290
by apply: ls1.
308291
have [ew12 /eqP]: w1 - w2 = 0 /\ (m2 - m1 = 0).
309292
apply: h1 erw12; rewrite scalerBl; apply/eqP; rewrite subr_eq addrC addrA.
310293
by rewrite -subr_eq opprK e1.
311294
suff -> : s1 = s2 by rewrite subr_eq0=> /eqP->.
312295
by apply: fs1 cws2; move/eqP: ew12; rewrite subr_eq0=> /eqP<-.
313-
have z'_spec : le_extend_graph z' by split.
314-
pose zz' := ZornType z'_spec.
315-
exists zz'; rewrite /zornS => //=; exists a; exists 0; exists 0; exists 1.
316-
by rewrite add0r mul1r scale1r add0r; split.
317-
Qed.
296+
have z'_spec : le_extend_graph z' by split.
297+
pose zz' := ZornType z'_spec.
298+
exists zz'; rewrite /zornS => //=; exists a; exists 0; exists 0; exists 1.
299+
by rewrite add0r mul1r scale1r add0r; split.
300+
Qed.
318301

319-
Let tot_g v : exists r, carrier g v r.
320-
Proof.
321-
have [z /gP sgz [r zr]]:= domain_extend g v.
322-
by exists r; rewrite -sgz.
323-
Qed.
302+
Let tot_g v : exists r, carrier g v r.
303+
Proof.
304+
have [z /gP sgz [r zr]]:= domain_extend g v.
305+
by exists r; rewrite -sgz.
306+
Qed.
324307

325308

326309
Lemma hb_witness : exists h : V -> R, forall v r, carrier g v r <-> (h v = r).
@@ -331,7 +314,7 @@ by have -> // := fg v r (h v).
331314
Qed.
332315

333316

334-
End HBPreparation.
317+
End HBPreparation.
335318

336319

337320
Section HahnBanach.
@@ -436,7 +419,6 @@ have contg: (continuous (g : V -> R)).
436419
by rewrite /p -[X in _ <= X]mul1r; apply: ler_pM; rewrite ?normr_ge0 ?ltW //=.
437420
- apply: (le_trans (majgp (y))); rewrite /p -[X in _ <= X]mul1r -normrN.
438421
apply: ler_pM; rewrite ?normr_ge0 ?ltW //=.
439-
(* TODO : build g with HB.build and HB.pack *)
440422
pose Hg := isLinearContinuous.Build _ _ _ _ g ling contg.
441423
pose g': {linear_continuous V -> R | *%R} := HB.pack (g : V -> R) Hg.
442424
by exists g'.

0 commit comments

Comments
 (0)