Skip to content

Commit 33b3ec6

Browse files
authored
matrix topology for all dimensions (#1742)
* redefine mx_ball, NormedModule for matrices for all dimensions * fix convention; generalize lemma mx_normZ
1 parent 26b3ef0 commit 33b3ec6

3 files changed

Lines changed: 52 additions & 30 deletions

File tree

CHANGELOG_UNRELEASED.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,9 @@
324324
+ definition `poisson_pmf`, lemmas `poisson_pmf_ge0`, `measurable_poisson_pmf`,
325325
+ definition `poisson_prob`
326326

327+
- in `matrix_topology.v`:
328+
+ definition `mx_ball`
329+
327330
### Renamed
328331

329332
- in `reals.v`:
@@ -367,6 +370,11 @@
367370
+ generalized from `numDomainType` to `pzRingType`:
368371
+ definition `onem`, lemmas `onme0`, `onem1`, `add_onemK`, `onemD`, `onemMr`, `onemM`
369372

373+
- in `matrix_normedtype.v`:
374+
+ lemmas `rV_compact`, `mx_norm_ball`, `bounded_closed_compact`,
375+
`mx_normZ`
376+
+ example `matrix_triangle`
377+
370378
### Deprecated
371379

372380
### Removed

theories/normedtype_theory/matrix_normedtype.v

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ Lemma coord_continuous {K : numFieldType} m n i j :
3737
continuous (fun M : 'M[K]_(m, n) => M i j).
3838
Proof.
3939
move=> /= M s /= /(nbhs_ballP (M i j)) [e e0 es].
40-
apply/nbhs_ballP; exists e => //= N MN; exact/es/MN.
40+
by apply/nbhs_ballP; exists e => //= N [_ MN]; exact/es/MN.
4141
Qed.
4242

43-
Lemma rV_compact (T : ptopologicalType) n (A : 'I_n.+1 -> set T) :
43+
#[local]Lemma rV_compact_nondegenerate (T : ptopologicalType) n
44+
(A : 'I_n.+1 -> set T) :
4445
(forall i, compact (A i)) ->
4546
compact [ set v : 'rV[T]_n.+1 | forall i, A i (v ord0 i)].
4647
Proof.
@@ -97,6 +98,17 @@ have GC : G [set g | C (\row_j g j)] by exists C.
9798
by have [g []] := clGf _ _ GC f_D; exists (\row_j (g j : T)).
9899
Qed.
99100

101+
Lemma rV_compact (T : ptopologicalType) n (A : 'I_n -> set T) :
102+
(forall i, compact (A i)) ->
103+
compact [ set v : 'rV[T]_n | forall i, A i (v ord0 i)].
104+
Proof.
105+
case: n A => [A _ | ]; last exact: rV_compact_nondegenerate.
106+
have P0 : #|{: 'I_1 * 'I_0}| = 0 by rewrite card_prod/= !card_ord muln0.
107+
pose v0 := Matrix (ffun0 P0 : {ffun 'I_1 * 'I_0 -> T}).
108+
rewrite (_ : mkset _ = [set v0]); first exact: compact_set1.
109+
by rewrite predeqE => x /=; split => [ _ | _ []//]; apply/rowP => -[].
110+
Qed.
111+
100112
Section mx_norm.
101113
Variables (K : numDomainType) (m n : nat).
102114
Implicit Types x y : 'M[K]_(m, n).
@@ -177,7 +189,7 @@ HB.instance Definition _ (K : numDomainType) (m n : nat) :=
177189
Section example_of_sharing.
178190
Variables (K : numDomainType).
179191

180-
Example matrix_triangle m n (M N : 'M[K]_(m.+1, n.+1)) :
192+
Example matrix_triangle m n (M N : 'M[K]_(m, n)) :
181193
`|M + N| <= `|M| + `|N|.
182194
Proof. exact: ler_normD. Qed.
183195

@@ -189,57 +201,57 @@ End example_of_sharing.
189201
Section matrix_pseudoMetricNormedZmod.
190202
Variables (K : numFieldType) (m n : nat).
191203

192-
Local Lemma ball_gt0 (x y : 'M[K]_(m.+1, n.+1)) e : ball x e y -> 0 < e.
193-
Proof. by move/(_ ord0 ord0); apply: le_lt_trans. Qed.
204+
Local Lemma ball_gt0 (x y : 'M[K]_(m, n)) e : ball x e y -> 0 < e.
205+
Proof. by case. Qed.
194206

195-
Lemma mx_norm_ball : @ball _ 'M[K]_(m.+1, n.+1) = ball_ (fun x => `| x |).
207+
Lemma mx_norm_ball : @ball _ 'M[K]_(m, n) = ball_ (fun x => `| x |).
196208
Proof.
197-
rewrite /normr /ball_ predeq3E => x e y /=; rewrite mx_normE; split => xey.
198-
- have e_gt0 : 0 < e := ball_gt0 xey.
199-
move: e_gt0 (e_gt0) xey => /ltW/nonnegP[{}e] e_gt0 xey.
209+
rewrite /normr /ball_ predeq3E => x e y/= /[!mx_normE]; split=> [[]|xey].
210+
- move=> /[dup] => /ltW/nonnegP[{}e] e_gt0 xey.
200211
rewrite num_lt; apply/bigmax_ltP => /=.
201212
by rewrite -num_lt /=; split => // -[? ?] _; rewrite !mxE; exact: xey.
202213
- have e_gt0 : 0 < e by rewrite (le_lt_trans _ xey).
203214
move: e_gt0 (e_gt0) xey => /ltW/nonnegP[{}e] e_gt0.
204-
move=> /(bigmax_ltP _ _ _ (fun _ => _%:itv)) /= [e0 xey] i j.
215+
move=> /(bigmax_ltP _ _ _ (fun=> _%:itv)) /= [e0 xey].
216+
split=> // i j.
205217
by move: (xey (i, j)); rewrite !mxE; exact.
206218
Qed.
207219

208220
HB.instance Definition _ :=
209-
NormedZmod_PseudoMetric_eq.Build K 'M[K]_(m.+1, n.+1) mx_norm_ball.
221+
NormedZmod_PseudoMetric_eq.Build K 'M[K]_(m, n) mx_norm_ball.
210222

211223
End matrix_pseudoMetricNormedZmod.
212224

213-
Lemma bounded_closed_compact (R : realType) n (A : set 'rV[R]_n.+1) :
225+
Lemma bounded_closed_compact (R : realType) n (A : set 'rV[R]_n) :
214226
bounded_set A -> closed A -> compact A.
215227
Proof.
216228
move=> [M [Mreal normAltM]] Acl.
217229
have Mnco : compact
218-
[set v : 'rV[R]_n.+1 | forall i, v ord0 i \in `[(- (M + 1)), (M + 1)]].
219-
apply: (@rV_compact _ _ (fun _ => `[(- (M + 1)), (M + 1)]%classic)).
230+
[set v : 'rV[R]_n | forall i, v ord0 i \in `[(- (M + 1)), (M + 1)]].
231+
apply: (@rV_compact _ _ (fun=> `[(- (M + 1)), (M + 1)]%classic)).
220232
by move=> _; apply: segment_compact.
221233
apply: subclosed_compact Acl Mnco _ => v /normAltM normvleM i.
222234
suff : `|v ord0 i : R| <= M + 1 by rewrite ler_norml.
223235
apply: le_trans (normvleM _ _); last by rewrite ltrDl.
224-
have /mapP[j Hj ->] : `|v ord0 i| \in [seq `|v x.1 x.2| | x : 'I_1 * 'I_n.+1].
236+
have /mapP[j Hj ->] : `|v ord0 i| \in [seq `|v x.1 x.2| | x : 'I_1 * 'I_n].
225237
by apply/mapP; exists (ord0, i) => //=; rewrite mem_enum.
226238
by rewrite [leRHS]/normr /= mx_normrE; apply/bigmax_geP; right => /=; exists j.
227239
Qed.
228240

229241
Section matrix_NormedModule.
230-
Variables (K : numFieldType) (m n : nat).
231242

232-
Lemma mx_normZ (l : K) (x : 'M[K]_(m.+1, n.+1)) : `| l *: x | = `| l | * `| x |.
243+
Lemma mx_normZ (K : numDomainType) m n (l : K) (x : 'M[K]_(m, n)) :
244+
`| l *: x | = `| l | * `| x |.
233245
Proof.
234246
rewrite {1 3}/normr /= !mx_normE
235-
(eq_bigr (fun i => (`|l| * `|x i.1 i.2|)%:nng)); last first.
247+
(eq_bigr (fun i => (`|l| * `|x i.1 i.2|)%:nng)); last first.
236248
by move=> i _; rewrite mxE //=; apply/eqP; rewrite -num_eq /= normrM.
237249
elim/big_ind2 : _ => // [|a b c d bE dE]; first by rewrite mulr0.
238250
by rewrite !num_max bE dE maxr_pMr.
239251
Qed.
240252

241-
HB.instance Definition _ :=
242-
PseudoMetricNormedZmod_Lmodule_isNormedModule.Build K 'M[K]_(m.+1, n.+1)
243-
mx_normZ.
253+
HB.instance Definition _ (K : numFieldType) m n :=
254+
PseudoMetricNormedZmod_Lmodule_isNormedModule.Build K 'M[K]_(m, n)
255+
(@mx_normZ K m n).
244256

245257
End matrix_NormedModule.

theories/topology_theory/matrix_topology.v

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ From mathcomp Require Import uniform_structure pseudometric_structure.
66
(**md**************************************************************************)
77
(* # Matrix topology *)
88
(* ``` *)
9-
(* mx_ent m n A == entourages for the m x n matrices *)
10-
(* mx_ball m n A == balls for the m x n matrices *)
9+
(* @mx_ent m n T == entourages for the m x n matrices with *)
10+
(* coefficients of type T *)
11+
(* mx_ball A == balls for the matrix A *)
1112
(* ``` *)
1213
(* Matrices `'M[T]_(m, n)` are endowed with the structures of: *)
1314
(* - topology *)
@@ -183,30 +184,32 @@ Section matrix_PseudoMetric.
183184
Variables (m n : nat) (R : numDomainType) (T : pseudoMetricType R).
184185
Implicit Types (x y : 'M[T]_(m, n)) (e : R).
185186

186-
Definition mx_ball x e y := forall i j, ball (x i j) e (y i j).
187+
Definition mx_ball x e y := 0 < e /\ forall i j, ball (x i j) e (y i j).
187188

188189
Local Lemma mx_ball_center x e : 0 < e -> mx_ball x e x.
189-
Proof. by move=> ? ? ?; exact: ballxx. Qed.
190+
Proof. by move=> ?; split=> [//|? ?]; exact: ballxx. Qed.
190191

191192
Local Lemma mx_ball_sym x y e : mx_ball x e y -> mx_ball y e x.
192-
Proof. by move=> xe_y ? ?; apply/ball_sym/xe_y. Qed.
193+
Proof. by move=> [e0 xe_y]; split=>[//|? ?]; apply/ball_sym/xe_y. Qed.
193194

194195
Local Lemma mx_ball_triangle x y z e1 e2 :
195196
mx_ball x e1 y -> mx_ball y e2 z -> mx_ball x (e1 + e2) z.
196197
Proof.
197-
by move=> xe1_y ye2_z ??; apply: ball_triangle; [exact: xe1_y|exact: ye2_z].
198+
move=> [e10 xe1_y] [e20 ye2_z]; split; first exact: addr_gt0.
199+
by move=> i j; apply: ball_triangle; [exact: xe1_y|exact: ye2_z].
198200
Qed.
199201

200202
Local Lemma mx_entourage : entourage = entourage_ mx_ball.
201203
Proof.
202204
rewrite predeqE=> A; split; last first.
203205
move=> [_/posnumP[e] sbeA].
204-
exists (fun _ _ => [set xy | ball xy.1 e%:num xy.2]) => //= _ _.
206+
exists (fun _ _ => [set xy | ball xy.1 e%:num xy.2]) => //=.
207+
by move=> [] ? ? /= P; exact: sbeA.
205208
move=> [P]; rewrite -entourage_ballE => entP sPA.
206209
set diag := fun e : {posnum R} => [set xy : T * T | ball xy.1 e%:num xy.2].
207210
exists (\big[Num.min/1%:pos]_i \big[Num.min/1%:pos]_j xget 1%:pos
208211
(fun e : {posnum R} => diag e `<=` P i j))%:num => //=.
209-
move=> MN MN_min; apply: sPA => i j.
212+
move=> MN/= [] _ MN_min; apply: sPA => i j.
210213
have /(xgetPex 1%:pos): exists e : {posnum R}, diag e `<=` P i j.
211214
by have [_/posnumP[e]] := entP i j; exists e.
212215
apply; apply: le_ball (MN_min i j).
@@ -220,4 +223,3 @@ End matrix_PseudoMetric.
220223

221224
HB.instance Definition _ (R : numFieldType) (T : completePseudoMetricType R)
222225
(m n : nat) := Uniform_isComplete.Build 'M[T]_(m, n) cauchy_cvg.
223-

0 commit comments

Comments
 (0)