22From HB Require Import structures.
33From mathcomp Require Import all_ssreflect finmap ssralg ssrnum ssrint.
44From mathcomp Require Import archimedean rat interval zmodp vector.
5- From mathcomp Require Import fieldext falgebra.
5+ From mathcomp Require Import fieldext falgebra mathcomp_extra .
66#[warning="-warn-library-file-internal-analysis"]
77From mathcomp Require Import unstable.
88From mathcomp Require Import boolp classical_sets filter functions cardinality.
@@ -381,6 +381,9 @@ Unshelve. all: by end_near. Qed.
381381Lemma ball_open_nbhs (x : V) (r : K) : 0 < r -> open_nbhs x (ball x r).
382382Proof . by move=> e0; split; [exact: ball_open|exact: ballxx]. Qed .
383383
384+ HB.instance Definition _ := Norm.isNorm.Build K V (@Num.norm K V) (normr0 V)
385+ (@normr_ge0 _ V) (@normr0_eq0 _ V) (@ler_normD _ V) (@normrZ _ V).
386+
384387End NormedModule_numDomainType.
385388
386389Definition self_sub (K : numDomainType) (V W : normedModType K)
@@ -2477,68 +2480,15 @@ Let V' := @fullv _ V.
24772480Variable B : (\dim V').-tuple V.
24782481Hypothesis Bbasis : basis_of V' B.
24792482
2480- Definition max_norm x := \big[Order.max/0]_(i < \dim V') `|coord B i x|.
2481-
2482- Definition max_space : Type := (fun=> V) Bbasis.
2483-
2484- HB.instance Definition _ := Vector.on max_space.
2485-
2486- HB.instance Definition _ := Pointed.copy max_space V^o.
2487-
2488- Lemma max_norm_ge0 x : 0 <= max_norm x.
2489- Proof .
2490- rewrite /max_norm.
2491- by elim/big_ind : _ => //= ? ? ? ?; rewrite /Order.max; case: ifP.
2492- Qed .
2493-
2494- Lemma le_coord_max_norm x i : `|coord B i x| <= max_norm x.
2495- Proof .
2496- rewrite /max_norm; elim: (index_enum _) (mem_index_enum i) => //= j l IHl.
2497- rewrite inE big_cons [X in _ <= X _ _]/Order.max/= => /predU1P[<-|/IHl {}IHl];
2498- case: ifP => [/ltW|]// /negbT.
2499- set b := (X in _ < X); have bR : b \is Num.real by exact: bigmax_real.
2500- have /comparable_leNgt <- := real_comparable bR (normr_real (coord B j x)).
2501- by move=> /(le_trans IHl).
2502- Qed .
2503-
2504- Lemma ler_max_normD x y : max_norm (x + y) <= max_norm x + max_norm y.
2505- Proof .
2506- apply: bigmax_le => [|/= i _]; first by rewrite addr_ge0// max_norm_ge0.
2507- by rewrite raddfD/= (le_trans (ler_normD _ _))// lerD// le_coord_max_norm.
2508- Qed .
2509-
2510- Lemma max_norm0_eq0 x : max_norm x = 0 -> x = 0.
2511- Proof .
2512- move=> x0; rewrite (coord_basis Bbasis (memvf x)).
2513- suff: forall i, coord B i x = 0.
2514- by move=> {}x0; rewrite big1//= => j _; rewrite x0 scale0r.
2515- by move=> i; apply/normr0_eq0/le_anti; rewrite normr_ge0 -x0 le_coord_max_norm.
2516- Qed .
2517-
2518- Lemma max_normZ r x : max_norm (r *: x) = `|r| * max_norm x.
2519- Proof .
2520- rewrite /max_norm.
2521- under eq_bigr do rewrite linearZ normrZ/=.
2522- elim: (index_enum _) => [|i l IHl]; first by rewrite !big_nil mulr0.
2523- by rewrite !big_cons IHl maxr_pMr.
2524- Qed .
2525-
2526- Lemma max_normMn x n : max_norm (x *+ n) = max_norm x *+ n.
2527- Proof . by rewrite -scaler_nat max_normZ normr_nat mulr_natl. Qed .
2528-
2529- Lemma max_normN x : max_norm (- x) = max_norm x.
2530- Proof . by rewrite -scaleN1r max_normZ normrN1 mul1r. Qed .
2531-
2532- HB.instance Definition _ := Num.Zmodule_isNormed.Build R
2533- max_space ler_max_normD max_norm0_eq0 max_normMn max_normN.
2483+ HB.instance Definition _ := Pointed.copy (max_space Bbasis) V^o.
25342484
25352485HB.instance Definition _ :=
2536- PseudoMetric.copy max_space (pseudoMetric_normed max_space).
2486+ PseudoMetric.copy ( max_space Bbasis) (pseudoMetric_normed ( max_space Bbasis) ).
25372487
2538- HB.instance Definition _ := NormedZmod_PseudoMetric_eq.Build R max_space erefl.
2488+ HB.instance Definition _ := NormedZmod_PseudoMetric_eq.Build R ( max_space Bbasis) erefl.
25392489
25402490HB.instance Definition _ :=
2541- PseudoMetricNormedZmod_Lmodule_isNormedModule.Build R max_space max_normZ.
2491+ PseudoMetricNormedZmod_Lmodule_isNormedModule.Build R ( max_space Bbasis) ( max_normZ B) .
25422492
25432493End InfiniteNorm.
25442494
@@ -2570,23 +2520,16 @@ apply: (@continuous_compact _ _ f).
25702520 exact: segment_compact.
25712521Qed .
25722522
2573- Lemma equivalence_norms (N : V -> R) :
2574- N 0 = 0 -> (forall x, 0 <= N x) -> (forall x, N x = 0 -> x = 0) ->
2575- (forall x y, N (x + y) <= N x + N y) ->
2576- (forall r x, N (r *: x) = `|r| * N x) ->
2523+ Lemma equivalence_norms (N : Norm.Norm.type V) :
25772524 exists2 M, 0 < M & forall x : Voo, `|x| <= M * N x /\ N x <= M * `|x|.
25782525Proof .
2579- move=> N0 N_ge0 N0_eq0 ND NZ.
25802526set M0 := 1 + \sum_(i < \dim V') N (vbasis V')`_i.
2581- have M00 : 0 < M0 by rewrite ltr_pwDl// sumr_ge0.
2582- have N_sum (I : Type) (r : seq I) (F : I -> V) :
2583- N (\sum_(i <- r) F i) <= \sum_(i <- r) N (F i).
2584- by elim/big_ind2 : _ => *; rewrite ?N0// (le_trans (ND _ _))// lerD.
2527+ have M00 : 0 < M0 by rewrite ltr_pwDl// sumr_ge0// => ? _; apply: Norm.norm_ge0.
25852528have leNoo (x : Voo) : N x <= M0 * `|x|.
2586- rewrite [in leLHS](coord_vbasis (memvf (x : V))) (le_trans (N_sum _ _ _))//.
2529+ rewrite [in leLHS](coord_vbasis (memvf (x : V))).
2530+ rewrite (le_trans (Norm.Theory.ler_norm_sum _ _ _))//.
25872531 rewrite mulrDl mul1r mulr_suml ler_wpDl// ler_sum => //= i _.
2588- by rewrite NZ mulrC ler_pM// le_coord_max_norm.
2589- have NZN a : N (- a) = N a by rewrite -scaleN1r NZ normrN1 mul1r.
2532+ by rewrite Norm.normZ mulrC ler_pM// ?le_coord_max_norm// Norm.norm_ge0.
25902533have NC0 : continuous (N : Voo -> R).
25912534 move=> /= x; rewrite /continuous_at.
25922535 apply: cvg_zero; first exact: nbhs_filter.
@@ -2596,8 +2539,8 @@ have NC0 : continuous (N : Voo -> R).
25962539 rewrite -[_ y]/(N y - N x) (@le_trans _ _ (N (y - x)))//.
25972540 apply/ler_normlP.
25982541 have NB a b : N a <= N b + N (a - b).
2599- by rewrite (le_trans _ (ND _ _)) ? subrKC.
2600- by rewrite opprB !lerBlDl NB -opprB NZN NB.
2542+ by rewrite (le_trans _ (Norm.ler_normD _ _))// subrKC.
2543+ by rewrite opprB !lerBlDl NB -opprB Norm.Theory.normN NB.
26012544 rewrite (le_trans (leNoo _))// mulrC -ler_pdivlMr// -opprB normrN.
26022545 by near: y; apply: cvgr_dist_le; [exact: cvg_id|exact: divr_gt0].
26032546have: compact [set x : Voo | `|x| = 1].
@@ -2613,20 +2556,23 @@ move=> /(@continuous_compact _ _ (@GRing.inv R)) -/(_ _)/wrap[].
26132556 [set N x | x in [set x : Voo | `|x| = 1]] (@GRing.inv R)).
26142557 move=> /= r /set_mem/= [y y1 <-].
26152558 apply: inv_continuous.
2616- by apply: contra_eq_neq y1 => /N0_eq0 ->; rewrite normr0 eq_sym oner_eq0.
2559+ apply: contra_eq_neq y1 => /Norm.norm0_eq0 ->.
2560+ by rewrite normr0 eq_sym oner_eq0.
26172561move=> /compact_bounded[M1 [M1R /(_ (1 + M1))]] /(_ (ltr_pwDl ltr01 (lexx _))).
26182562rewrite /globally/= => M1N.
26192563exists (maxr M0 (1 + M1)) => [|x]; first by rewrite lt_max M00.
26202564split; last by rewrite (le_trans (leNoo x))// ler_wpM2r// le_max lexx.
2621- have [->|x0] := eqVneq x 0; first by rewrite normr0 N0 mulr0.
2565+ have [->|x0] := eqVneq x 0; first by rewrite normr0 Norm.norm0 mulr0.
26222566have Nx0 : 0 < N x.
2623- by rewrite lt0r N_ge0 andbT; move: x0; apply: contra_neq => /N0_eq0.
2567+ rewrite lt0r Norm.norm_ge0 andbT.
2568+ by move: x0; apply: contra_neq => /Norm.norm0_eq0.
26242569have normx0 : 0 < `|x| by rewrite normr_gt0.
26252570move: M1N => /(_ (`|x| / N x)) -/(_ _)/wrap[].
26262571 exists (N x / `|x|); last by rewrite invf_div.
2627- exists (`|x|^-1 *: x); last by rewrite NZ mulrC ger0_norm.
2572+ exists (`|x|^-1 *: x); last by rewrite Norm.normZ mulrC ger0_norm.
26282573 by rewrite normrZ normfV normr_id mulVf// gt_eqF.
2629- rewrite ger0_norm ?divr_ge0// ler_pdivrMr// => /le_trans; apply.
2574+ rewrite ger0_norm; last by rewrite divr_ge0// Norm.norm_ge0.
2575+ rewrite ler_pdivrMr// => /le_trans; apply.
26302576by rewrite ler_pM2r// le_max lexx orbT.
26312577Unshelve. all: by end_near. Qed .
26322578
@@ -2649,8 +2595,7 @@ apply: cvg_sum => i _.
26492595rewrite [X in _ --> X]linearZ/= -/B.
26502596apply: cvgZr_tmp.
26512597move: x; apply/linear_bounded_continuous/bounded_funP => r/=.
2652- have [M M0 MP] := @equivalence_norms R V (@normr R V) (@normr0 _ _)
2653- (@normr_ge0 _ _) (@normr0_eq0 _ _) (@ler_normD _ _) (@normrZ _ _).
2598+ have [M M0 MP] := equivalence_norms (@Num.norm _ V).
26542599exists (M * r) => x.
26552600move: MP => /(_ x) [Mx _] xr.
26562601by rewrite (le_trans (le_coord_max_norm _ _ _))// (le_trans Mx) ?ler_wpM2l// ltW.
0 commit comments