Skip to content

Commit 99d840c

Browse files
committed
linting
1 parent 3e76ee7 commit 99d840c

1 file changed

Lines changed: 71 additions & 122 deletions

File tree

theories/normedtype_theory/normed_module.v

Lines changed: 71 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -2088,9 +2088,10 @@ Qed.
20882088
End Closed_Ball_normedModType.
20892089

20902090
Section InfiniteNorm.
2091-
Variables (R : numFieldType) (V : vectType R) (B : (\dim (@fullv _ V)).-tuple V).
2091+
Variables (R : numFieldType) (V : vectType R).
20922092
Let V' := @fullv _ V.
2093-
Hypothesis (Bbasis : basis_of V' B).
2093+
Variable B : (\dim V').-tuple V.
2094+
Hypothesis Bbasis : basis_of V' B.
20942095

20952096
Definition oo_norm x := \big[Order.max/0]_(i < \dim V') `|coord B i x|.
20962097

@@ -2103,40 +2104,31 @@ HB.instance Definition _ := Pointed.copy oo_space V^o.
21032104
Lemma oo_norm_ge0 x : 0 <= oo_norm x.
21042105
Proof.
21052106
rewrite /oo_norm.
2106-
elim: (index_enum _) => /=; first by rewrite big_nil.
2107-
by move=> i l IHl; rewrite big_cons /Order.max/=; case: ifP.
2107+
by elim/big_ind : _ => //= ? ? ? ?; rewrite /Order.max; case: ifP.
21082108
Qed.
21092109

21102110
Lemma le_coord_oo_norm x i : `|coord B i x| <= oo_norm x.
21112111
Proof.
21122112
rewrite /oo_norm; elim: (index_enum _) (mem_index_enum i) => //= j l IHl.
2113-
rewrite inE big_cons /Order.max/= => /orP[/eqP <-|/IHl {}IHl];
2114-
case: ifP => [/ltW|]//.
2115-
move=> /negP/negP.
2116-
have bR: \big[Order.max/0]_(i <- l) `|coord B i x| \is Num.real.
2117-
exact: bigmax_real.
2118-
move: (real_comparable bR (normr_real (coord B j x))).
2119-
by move=> /comparable_leNgt <- /(le_trans IHl).
2113+
rewrite inE big_cons [X in _ <= X _ _]/Order.max/= => /predU1P[<-|/IHl {}IHl];
2114+
case: ifP => [/ltW|]// /negbT.
2115+
set b := (X in _ < X); have bR : b \is Num.real by exact: bigmax_real.
2116+
have /comparable_leNgt <- := real_comparable bR (normr_real (coord B j x)).
2117+
by move=> /(le_trans IHl).
21202118
Qed.
21212119

21222120
Lemma ler_oo_normD x y : oo_norm (x + y) <= oo_norm x + oo_norm y.
21232121
Proof.
2124-
apply: bigmax_le => [|/= i _].
2125-
by apply: addr_ge0; apply: oo_norm_ge0.
2126-
rewrite raddfD/=.
2127-
by apply/(le_trans (ler_normD _ _))/lerD; apply: le_coord_oo_norm.
2122+
apply: bigmax_le => [|/= i _]; first by rewrite addr_ge0// oo_norm_ge0.
2123+
by rewrite raddfD/= (le_trans (ler_normD _ _))// lerD// le_coord_oo_norm.
21282124
Qed.
21292125

21302126
Lemma oo_norm0_eq0 x : oo_norm x = 0 -> x = 0.
21312127
Proof.
2132-
move=> x0.
2133-
rewrite (coord_basis Bbasis (memvf x)).
2128+
move=> x0; rewrite (coord_basis Bbasis (memvf x)).
21342129
suff: forall i, coord B i x = 0.
2135-
move=> {}x0.
2136-
under eq_bigr do rewrite x0.
2137-
by rewrite -scaler_sumr scale0r.
2138-
move=> i; apply/normr0_eq0/le_anti/andP; split; last exact: normr_ge0.
2139-
by rewrite -x0; apply: le_coord_oo_norm.
2130+
by move=> {}x0; rewrite big1//= => j _; rewrite x0 scale0r.
2131+
by move=> i; apply/normr0_eq0/le_anti; rewrite normr_ge0 -x0 le_coord_oo_norm.
21402132
Qed.
21412133

21422134
Lemma oo_normZ r x : oo_norm (r *: x) = `|r| * oo_norm x.
@@ -2174,124 +2166,85 @@ Let Voo := oo_space (vbasisP (@fullv _ V)).
21742166
(* N.B. Get Trocq to prove the continuity part automatically. *)
21752167
Lemma oo_closed_ball_compact : compact (closed_ball (0 : Voo) 1).
21762168
Proof.
2177-
rewrite closed_ballE/closed_ball_//=.
2169+
rewrite closed_ballE// /closed_ball_.
21782170
under eq_set do rewrite sub0r normrN.
21792171
rewrite -[forall x, _]/(compact _).
2180-
pose f (X : {ptws 'I_(\dim V') -> R^o}) : Voo :=
2181-
\sum_(i < \dim V') (X i) *: (vbasis V')`_i.
2182-
have -> :
2183-
[set x : Voo | `|x| <= 1] = f @` [set X | forall i, `[-1, 1]%classic (X i)].
2184-
apply/seteqP; split=> x/=.
2185-
move=> x1; exists (fun i => coord (vbasis V') i x); last first.
2172+
pose f (X : {ptws 'I_(\dim V') -> R}) : Voo :=
2173+
\sum_(i < \dim V') X i *: (vbasis V')`_i.
2174+
have -> : [set x : Voo | `|x| <= 1] =
2175+
f @` [set X | forall i, `[-1, 1]%classic (X i)].
2176+
apply/seteqP; split=> [x/= x1|x/= [X X1 <-]].
2177+
- exists (coord (vbasis V') ^~ x); last first.
21862178
exact/esym/(@coord_vbasis _ _ (x : V))/memvf.
2187-
move=> i; rewrite in_itv/= -ler_norml.
2188-
apply: (le_trans _ x1).
2189-
exact: le_coord_oo_norm.
2190-
move=> [X] X1 <-.
2191-
rewrite /normr/=/oo_norm.
2192-
apply: bigmax_le => //= i _.
2193-
rewrite coord_sum_free; last exact/basis_free/vbasisP.
2194-
rewrite ler_norml.
2195-
exact: X1.
2196-
apply: (@continuous_compact _ _ f); last first.
2197-
apply: (@tychonoff 'I_(\dim V') (fun=> R^o) (fun=> `[-1, 1 : R^o]%classic)).
2198-
move=> _.
2179+
by move=> i; rewrite in_itv/= -ler_norml (le_trans _ x1)// le_coord_oo_norm.
2180+
- rewrite /normr/= /oo_norm bigmax_le => //= i _.
2181+
by rewrite coord_sum_free ?ler_norml; [exact: X1|exact/basis_free/vbasisP].
2182+
apply: (@continuous_compact _ _ f).
2183+
- apply/continuous_subspaceT/sum_continuous => /= i _ x.
2184+
exact/continuousZr_tmp/proj_continuous.
2185+
- apply: (@tychonoff 'I_(\dim V') (fun=> R^o) (fun=> `[-1, 1]%classic)) => _.
21992186
exact: segment_compact.
2200-
apply/continuous_subspaceT/sum_continuous => i _/= x.
2201-
exact/continuousZl/proj_continuous.
22022187
Qed.
22032188

22042189
Lemma equivalence_norms (N : V -> R) :
22052190
N 0 = 0 -> (forall x, 0 <= N x) -> (forall x, N x = 0 -> x = 0) ->
22062191
(forall x y, N (x + y) <= N x + N y) ->
22072192
(forall r x, N (r *: x) = `|r| * N x) ->
2208-
exists M, 0 < M /\ forall x : Voo, `|x| <= M * N x /\ N x <= M * `|x|.
2193+
exists2 M, 0 < M & forall x : Voo, `|x| <= M * N x /\ N x <= M * `|x|.
22092194
Proof.
22102195
move=> N0 N_ge0 N0_eq0 ND NZ.
22112196
set M0 := 1 + \sum_(i < \dim V') N (vbasis V')`_i.
2212-
have N_sum (I : Type) (r : seq I) (F : I -> V):
2213-
N (\sum_(i <- r) F i) <= \sum_(i <- r) N (F i).
2214-
elim: r => [|x r IHr]; first by rewrite !big_nil N0.
2215-
by rewrite !big_cons; apply/(le_trans (ND _ _))/lerD.
2216-
have leNoo: forall x : Voo, N x <= M0 * `|x|.
2217-
move=> x.
2218-
rewrite [in leLHS](coord_vbasis (memvf (x : V))).
2219-
apply: (le_trans (N_sum _ _ _)).
2220-
rewrite mulrDl mul1r mulr_suml -[leLHS]add0r.
2221-
apply: lerD => //.
2222-
apply: ler_sum => /= i _.
2223-
rewrite NZ mulrC; apply: ler_pM => //.
2224-
exact: le_coord_oo_norm.
2225-
have M00 : 0 < M0.
2226-
rewrite -[ltLHS]addr0.
2227-
by apply: ltr_leD => //; apply: sumr_ge0.
2197+
have M00 : 0 < M0 by rewrite ltr_pwDl// sumr_ge0.
2198+
have N_sum (I : Type) (r : seq I) (F : I -> V) :
2199+
N (\sum_(i <- r) F i) <= \sum_(i <- r) N (F i).
2200+
by elim/big_ind2 : _ => *; rewrite ?N0// (le_trans (ND _ _))// lerD.
2201+
have leNoo (x : Voo) : N x <= M0 * `|x|.
2202+
rewrite [in leLHS](coord_vbasis (memvf (x : V))) (le_trans (N_sum _ _ _))//.
2203+
rewrite mulrDl mul1r mulr_suml ler_wpDl// ler_sum => //= i _.
2204+
by rewrite NZ mulrC ler_pM// le_coord_oo_norm.
2205+
have NZN a : N (- a) = N a by rewrite -scaleN1r NZ normrN1 mul1r.
22282206
have NC0 : continuous (N : Voo -> R).
2229-
move=> /= x.
2230-
rewrite /continuous_at.
2207+
move=> /= x; rewrite /continuous_at.
22312208
apply: cvg_zero; first exact: nbhs_filter.
22322209
apply/cvgr0Pnorm_le; first exact: nbhs_filter.
22332210
move=> /= e e0.
22342211
near=> y.
2235-
rewrite -[_ y]/(N y - N x).
2236-
apply: (@le_trans _ _ (N (y - x))).
2237-
apply/real_ler_normlP.
2238-
by apply: realB; apply: ger0_real.
2239-
have NB a b : N a <= N b + N (a - b).
2240-
by rewrite -[a in N a]addr0 -(subrr b) addrCA ND.
2241-
rewrite opprB !lerBlDl; split; last exact: NB.
2242-
by rewrite -opprB -scaleN1r NZ normrN1 mul1r NB.
2243-
apply: (le_trans (leNoo _)).
2244-
rewrite mulrC -ler_pdivlMr// -opprB normrN.
2245-
near: y; apply: cvgr_dist_le; first exact: cvg_id.
2246-
exact: divr_gt0.
2212+
rewrite -[_ y]/(N y - N x) (@le_trans _ _ (N (y - x)))//.
2213+
apply/ler_normlP.
2214+
have NB a b : N a <= N b + N (a - b).
2215+
by rewrite (le_trans _ (ND _ _)) ?subrKC.
2216+
by rewrite opprB !lerBlDl NB -opprB NZN NB.
2217+
rewrite (le_trans (leNoo _))// mulrC -ler_pdivlMr// -opprB normrN.
2218+
by near: y; apply: cvgr_dist_le; [exact: cvg_id|exact: divr_gt0].
22472219
have: compact [set x : Voo | `|x| = 1].
2248-
apply: (subclosed_compact _ oo_closed_ball_compact); last first.
2249-
apply/subsetP => x.
2250-
rewrite closed_ballE// !inE/=.
2251-
by rewrite /closed_ball_/= sub0r normrN => ->.
2252-
apply: (@closed_comp _ _ _ [set 1 : R]); last exact: closed_eq.
2253-
by rewrite /prop_in1 => + _; apply: norm_continuous.
2220+
apply: (subclosed_compact _ oo_closed_ball_compact).
2221+
- apply: (@closed_comp _ _ _ [set 1 : R]); last exact: closed_eq.
2222+
by move=> *; exact: norm_continuous.
2223+
- by move => x/=; rewrite closed_ballE// /closed_ball_/= sub0r normrN => ->.
22542224
move=> /(@continuous_compact _ _ (N : Voo -> R)) -/(_ _)/wrap[].
22552225
exact: continuous_subspaceT.
22562226
move=> /(@continuous_compact _ _ (@GRing.inv R)) -/(_ _)/wrap[].
2257-
move=> /= x.
2258-
rewrite /continuous_at.
2227+
move=> /= x; rewrite /continuous_at.
22592228
apply: (@continuous_in_subspaceT _ _
22602229
[set N x | x in [set x : Voo | `|x| = 1]] (@GRing.inv R)).
2261-
move=> r /set_mem/=[] y y1 <-.
2230+
move=> /= r /set_mem/= [y y1 <-].
22622231
apply: inv_continuous.
2263-
apply/negP => /eqP/N0_eq0 y0.
2264-
move: y1; rewrite y0 normr0 => /esym.
2265-
by move: (@oner_neq0 R) => /eqP.
2266-
move=> /compact_bounded[] M1 [] M1R /(_ (1 + M1)).
2267-
rewrite -subr_gt0 -addrA subrr addr0 => /(_ ltr01).
2232+
by apply: contra_eq_neq y1 => /N0_eq0 ->; rewrite normr0 eq_sym oner_eq0.
2233+
move=> /compact_bounded[M1 [M1R /(_ (1 + M1))]] /(_ (ltr_pwDl ltr01 (lexx _))).
22682234
rewrite /globally/= => M1N.
2269-
exists (maxr M0 (1 + M1)).
2270-
split=> [|x]; first by apply: (lt_le_trans M00); rewrite le_max lexx.
2271-
split; last first.
2272-
apply/(le_trans (leNoo x))/ler_pM => //; first exact/ltW.
2273-
by rewrite /maxr; case: ifP => // /ltW.
2235+
exists (maxr M0 (1 + M1)) => [|x]; first by rewrite lt_max M00.
2236+
split; last by rewrite (le_trans (leNoo x))// ler_wpM2r// le_max lexx.
22742237
have [->|x0] := eqVneq x 0; first by rewrite normr0 N0 mulr0.
2275-
have Nx0: 0 < N x.
2276-
rewrite lt0r N_ge0 andbT.
2277-
by move: x0; apply: contra => /eqP/N0_eq0/eqP.
2278-
have normx0 : 0 < `|x|.
2279-
move: (lt_le_trans Nx0 (leNoo x)).
2280-
by rewrite pmulr_rgt0.
2238+
have Nx0 : 0 < N x.
2239+
by rewrite lt0r N_ge0 andbT; move: x0; apply: contra_neq => /N0_eq0.
2240+
have normx0 : 0 < `|x| by rewrite normr_gt0.
22812241
move: M1N => /(_ (`|x| / N x)) -/(_ _)/wrap[].
22822242
exists (N x / `|x|); last by rewrite invf_div.
2283-
exists (`|x|^-1 *: x); last first.
2284-
by rewrite NZ mulrC ger0_norm.
2285-
rewrite normrZ mulrC ger0_norm.
2286-
by rewrite divrr//; apply: unitf_gt0.
2287-
by rewrite invr_ge0; apply: ltW.
2288-
rewrite ger0_norm; last exact: divr_ge0.
2289-
rewrite ler_pdivrMr// => xle.
2290-
apply: (le_trans xle).
2291-
rewrite -subr_ge0 -mulrBl pmulr_lge0// subr_ge0.
2292-
by rewrite le_max lexx orbT.
2293-
Unshelve. all: by end_near.
2294-
Qed.
2243+
exists (`|x|^-1 *: x); last by rewrite NZ mulrC ger0_norm.
2244+
by rewrite normrZ normfV normr_id mulVf// gt_eqF.
2245+
rewrite ger0_norm ?divr_ge0// ler_pdivrMr// => /le_trans; apply.
2246+
by rewrite ler_pM2r// le_max lexx orbT.
2247+
Unshelve. all: by end_near. Qed.
22952248

22962249
End EquivalenceNorms.
22972250

@@ -2301,26 +2254,22 @@ Variables (R : realType) (V : normedVectType R) (W : normedModType R).
23012254
Lemma linear_findim_continuous (f : {linear V -> W}) : continuous f.
23022255
Proof.
23032256
set V' := @fullv _ V.
2304-
set B := vbasis V' => /= x.
2305-
rewrite /continuous_at.
2257+
set B := vbasis V'.
2258+
move=> /= x; rewrite /continuous_at.
23062259
rewrite [x in f x](coord_vbasis (memvf x)) raddf_sum.
23072260
rewrite (@eq_cvg _ _ _ _ (fun y => \sum_(i < \dim V') coord B i y *: f B`_i));
23082261
last first.
23092262
move=> y; rewrite [y in LHS](coord_vbasis (memvf y)) raddf_sum.
23102263
by apply: eq_big => // i _; apply: linearZ.
23112264
apply: cvg_sum => i _.
23122265
rewrite [X in _ --> X]linearZ/= -/B.
2313-
apply: cvgZl.
2266+
apply: cvgZr_tmp.
23142267
move: x; apply/linear_bounded_continuous/bounded_funP => r/=.
2315-
have := @equivalence_norms R V (@normr R V) (@normr0 _ _) (@normr_ge0 _ _)
2316-
(@normr0_eq0 _ _) (@ler_normD _ _) (@normrZ _ _).
2317-
move=> [] M [] M0 MP.
2268+
have [M M0 MP] := @equivalence_norms R V (@normr R V) (@normr0 _ _)
2269+
(@normr_ge0 _ _) (@normr0_eq0 _ _) (@ler_normD _ _) (@normrZ _ _).
23182270
exists (M * r) => x.
2319-
move: MP => /(_ x)[] Mx Mx' xr.
2320-
apply/(le_trans (le_coord_oo_norm _ _ _))/(le_trans Mx).
2321-
rewrite -subr_ge0 -mulrBr; apply: mulr_ge0; first exact: ltW.
2322-
by rewrite subr_ge0.
2271+
move: MP => /(_ x) [Mx _] xr.
2272+
by rewrite (le_trans (le_coord_oo_norm _ _ _))// (le_trans Mx) ?ler_wpM2l// ltW.
23232273
Qed.
23242274

23252275
End LinearContinuous.
2326-

0 commit comments

Comments
 (0)