Skip to content

Commit a8204e5

Browse files
committed
started uniformity defined by a collection of pseudometrics
1 parent 7c5cd63 commit a8204e5

8 files changed

+247
-5
lines changed

IsarMathLib/FinOrd_ZF_1.thy

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
This file is a part of IsarMathLib -
33
a library of formalized mathematics for Isabelle/Isar.
44
5-
Copyright (C) 2008-2025 Slawomir Kolodynski
5+
Copyright (C) 2025 Slawomir Kolodynski
66
77
This program is free software; Redistribution and use in source and binary forms,
88
with or without modification, are permitted provided that the following conditions are met:

IsarMathLib/MetricSpace_ZF.thy

+2-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ text\<open>A disk is defined as set of points located less than the radius from
6565

6666
definition "Disk(X,d,r,c,R) \<equiv> {x\<in>X. \<langle>d`\<langle>c,x\<rangle>,R\<rangle> \<in> StrictVersion(r)}"
6767

68-
text\<open>We define \<open>metric topology\<close> as consisting of unions of open disks.\<close>
68+
text\<open>We define \<open>metric topology\<close> as consisting of unions of open disks.
69+
Note the same definition is used for the topology generated by a pseudometric.\<close>
6970

7071
definition
7172
"MetricTopology(X,L,A,r,d) \<equiv> {\<Union>\<A>. \<A> \<in> Pow(\<Union>c\<in>X. {Disk(X,d,r,c,R). R\<in>PositiveSet(L,A,r)})}"

IsarMathLib/MetricUniform_ZF.thy

+194
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
(*
2+
This file is a part of IsarMathLib -
3+
a library of formalized mathematics for Isabelle/Isar.
4+
5+
Copyright (C) 2025 Slawomir Kolodynski
6+
7+
This program is free software; Redistribution and use in source and binary forms,
8+
with or without modification, are permitted provided that the following conditions are met:
9+
10+
1. Redistributions of source code must retain the above copyright notice,
11+
this list of conditions and the following disclaimer.
12+
2. Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation and/or
14+
other materials provided with the distribution.
15+
3. The name of the author may not be used to endorse or promote products
16+
derived from this software without specific prior written permission.
17+
18+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
19+
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21+
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
24+
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25+
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26+
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
29+
*)
30+
31+
section\<open>Uniformity defined by a a collection of pseudometrics\<close>
32+
33+
theory MetricUniform_ZF imports FinOrd_ZF_1 MetricSpace_ZF
34+
35+
begin
36+
37+
text\<open>In the \<open>MetricSpace_ZF\<close> we show how a single (ordered loop valued) pseudometric
38+
defines a uniformity. In this theory we extend this to the situation where we have
39+
an arbitrary collection of pseudometrics, all defined on the the same set $X$ and valued
40+
in an ordered loop $L$. Since real numbers form an ordered loop all the results proven in
41+
this theory are true for the standard real-valued pseudometrics. \<close>
42+
43+
subsection\<open>Definitions and notation\<close>
44+
45+
text\<open>Suppose $\mathcal{M}$ is a collection of (an ordered loop valued) pseudometrics on $X$,
46+
i.e. $d:X\times X\rightarrow L^+$ is a pseudometric for every $d\in \mathcal{M}$.
47+
Then, for each $d\in \mathcal{M}$ the sets $\{ d^{-1}(\{c\in L^+: c\leq b\}): b \in L_+ \}$
48+
form a fundamental system of entourages (see \<open>MetricSpace_ZF\<close>). \<close>
49+
50+
text\<open>The next two definitions describe the way a common fundamental system of entourages
51+
for $\mathcal{M}$ is constructed. First we take finite subset $M$ of $\mathcal{M}$.
52+
Then we choose $f:M\rightarrow L_+$. This way for each $d\in M$
53+
the value $f(d)$ is a positive element of $L$ and
54+
$\{d^{-1}(\{c\in L^+: c\leq f(d)\}): d\in M\}$ is a finite collection of
55+
subsets of $X\times X$. Then we take intersections of such finite
56+
collections as $M$ varies over $\mathcal{M}$ and $f$ varies over all possible function mapping
57+
$M$ to $L_+$. To simplify notation for this construction we split it into two steps.
58+
In the first step we define a collection of finite intersections resulting from
59+
choosing a finite set of pseudometrics $M$, $f:M\rightarrow L_+$ and varying
60+
the selector function $f$ over the space of functions mapping $M$ to the set of
61+
positive elements of $L$. \<close>
62+
63+
definition
64+
"UniformGaugeSets(X,L,A,r,M) \<equiv>
65+
{(\<Inter>d\<in>M. d-``({c\<in>Nonnegative(L,A,r). \<langle>c,f`(d)\<rangle> \<in> r})). f\<in>M\<rightarrow>PositiveSet(L,A,r)}"
66+
67+
text\<open>In the second step we collect all uniform gauge sets defined above
68+
as parameter $M$ vary over all nonempty finite subsets of $\mathcal{M}$.
69+
This is the collection of sets that we will show forms a fundamental system of entourages.\<close>
70+
71+
definition
72+
"UniformGauges(X,L,A,r,\<M>) \<equiv> \<Union>M\<in>FinPow(\<M>)\<setminus>{\<emptyset>}. UniformGaugeSets(X,L,A,r,M)"
73+
74+
text\<open>The context \<open>muliple_pmetric\<close> is very similar to the \<open>pmetric_space\<close> context
75+
except that rather than fixing a single pseudometric $d$ we fix a
76+
collection of pseudometrics $\mathcal{M}$. That forces the notation for
77+
\<open>disk\<close>, topology, interior and closure to depend on the pseudometric $d$. \<close>
78+
79+
locale muliple_pmetric = loop1 +
80+
fixes \<M> and X
81+
assumes mpmetricAssm: "\<forall>d\<in>\<M>. IsApseudoMetric(d,X,L,A,r)"
82+
fixes disk
83+
defines disk_def [simp]: "disk(d,c,R) \<equiv> Disk(X,d,r,c,R)"
84+
fixes pmettop ("\<tau>")
85+
defines pmettop [simp]: "\<tau>(d) \<equiv> MetricTopology(X,L,A,r,d)"
86+
fixes interior ("int")
87+
defines interior_def [simp]: "int(d,D) \<equiv> Interior(D,\<tau>(d))"
88+
fixes cl
89+
defines cl_def [simp]: "cl(d,D) \<equiv> Closure(D,\<tau>(d))"
90+
91+
text\<open>Analogously what is done in the \<open>pmetric_space\<close> context
92+
we will write \<open>UniformGauges(X,L,A,r,\<M>)\<close> as \<open>\<BB>\<close> in the \<open>muliple_pmetric\<close> context.\<close>
93+
94+
abbreviation (in muliple_pmetric) mgauge ("\<BB>") where "\<BB> \<equiv> UniformGauges(X,L,A,r,\<M>)"
95+
96+
text\<open>The next lemma just shows the definition of $\mathfrak{B}$ in notation
97+
used in the \<open>muliple_pmetric\<close>. \<close>
98+
99+
lemma (in muliple_pmetric) mgauge_def_alt: shows
100+
"UniformGaugeSets(X,L,A,r,M) = {(\<Inter>d\<in>M. d-``({c\<in>L\<^sup>+. c\<lsq>f`(d)})). f\<in>M\<rightarrow>L\<^sub>+}"
101+
"\<BB> = (\<Union>M\<in>FinPow(\<M>)\<setminus>{\<emptyset>}. {(\<Inter>d\<in>M. d-``({c\<in>L\<^sup>+. c\<lsq>f`(d)})). f\<in>M\<rightarrow>L\<^sub>+})"
102+
unfolding UniformGaugeSets_def UniformGauges_def by simp_all
103+
104+
text\<open>If $d$ is one of the pseudometrics from $\mathcal{M}$ then theorems
105+
proven in \<open>pmetric_space\<close> can are valid. \<close>
106+
107+
lemma (in muliple_pmetric) pmetric_space_valid_in_mpm:
108+
assumes "d\<in>\<M>" shows "pmetric_space(L,A,r,d,X)"
109+
proof
110+
from assms mpmetricAssm show "IsApseudoMetric(d,X,L,A,r)" by simp
111+
qed
112+
113+
text\<open>If $d$ is member of any finite subset of $\mathcal{M}$ then
114+
$d$ maps $X\times X$ to the nonnegative set of the ordered loop $L$.\<close>
115+
116+
lemma (in muliple_pmetric) each_pmetric_map:
117+
assumes "M\<in>FinPow(\<M>)" and "d\<in>M" shows "d: X\<times>X \<rightarrow> L\<^sup>+"
118+
using assms pmetric_space_valid_in_mpm pmetric_space.pmetric_properties(1)
119+
unfolding FinPow_def by auto
120+
121+
text\<open>Members of the uniform gauge defined by multiple pseudometrics
122+
are subsets of $X\times X$ i.e. relations on $X$. \<close>
123+
124+
lemma (in muliple_pmetric) muniform_gauge_relations:
125+
assumes "B\<in>\<BB>" shows "B\<subseteq>X\<times>X"
126+
proof -
127+
from assms obtain M f where "M\<in>FinPow(\<M>)" and
128+
I: "B = (\<Inter>d\<in>M. d-``({c\<in>L\<^sup>+. c\<lsq>f`(d)}))"
129+
using mgauge_def_alt by auto
130+
{ fix d assume "d\<in>M"
131+
with \<open>M\<in>FinPow(\<M>)\<close> have "d: X\<times>X \<rightarrow> L\<^sup>+"
132+
using each_pmetric_map by simp
133+
then have "d-``({c\<in>L\<^sup>+. c\<lsq>f`(d)}) \<subseteq> X\<times>X" using func1_1_L15 by auto
134+
} with I show ?thesis using inter_subsets_subset by simp
135+
qed
136+
137+
text\<open>Suppose $M_1$ is a subset of $M$ and $\mathcal{M}$.
138+
$f_1,f$ map $M_1$ and $M$, resp. to $L_+$ and $f\leq f_1$ on $M_1$.
139+
Then the set $\bigcap_{d\in M} d^{-1}(\{y \in L_+: y\leq f(d)\})$
140+
is included in the set $\bigcap_{d\in M_1} d^{-1}(\{y \in L_+: y\leq f_1(d)\})$. \<close>
141+
142+
lemma (in muliple_pmetric) fun_inter_vimage_mono:
143+
assumes "M\<^sub>1\<subseteq>\<M>" "M\<^sub>1\<subseteq>M" "M\<^sub>1\<noteq>\<emptyset>" "f\<^sub>1:M\<^sub>1\<rightarrow>L\<^sub>+" "f:M\<rightarrow>L\<^sub>+" and
144+
"\<forall>d\<in>M\<^sub>1. f`(d)\<lsq>f\<^sub>1`(d)"
145+
shows
146+
"(\<Inter>d\<in>M. d-``({c\<in>L\<^sup>+. c\<lsq>f`(d)})) \<subseteq> (\<Inter>d\<in>M\<^sub>1. d-``({c\<in>L\<^sup>+. c\<lsq>f\<^sub>1`(d)}))"
147+
proof -
148+
let ?L = "(\<Inter>d\<in>M. d-``({c\<in>L\<^sup>+. c\<lsq>f`(d)}))"
149+
let ?R = "(\<Inter>d\<in>M\<^sub>1. d-``({c\<in>L\<^sup>+. c\<lsq>f\<^sub>1`(d)}))"
150+
from assms(2,3) have I: "?L \<subseteq> (\<Inter>d\<in>M\<^sub>1. d-``({c\<in>L\<^sup>+. c\<lsq>f`(d)}))"
151+
using inter_index_mono by simp
152+
from assms(1,6) have
153+
"\<forall>d\<in>M\<^sub>1. (d-``({c\<in>L\<^sup>+. c\<lsq>f`(d)})) \<subseteq> d-``({c\<in>L\<^sup>+. c\<lsq>f\<^sub>1`(d)})"
154+
using pmetric_space_valid_in_mpm pmetric_space.uniform_gauge_mono
155+
by force
156+
with assms(2) have "(\<Inter>d\<in>M\<^sub>1. d-``({c\<in>L\<^sup>+. c\<lsq>f`(d)})) \<subseteq> ?R" by force
157+
with I show "?L\<subseteq>?R" by (rule subset_trans)
158+
qed
159+
160+
text\<open>For any two sets $B_1,B_2$ in $\mathcal{B}$ there exist a third one
161+
that is contained in both. \<close>
162+
163+
lemma (in muliple_pmetric) mgauge_1st_cond:
164+
assumes "r {down-directs} L\<^sub>+" "B\<^sub>1\<in>\<BB>" "B\<^sub>2\<in>\<BB>"
165+
shows "\<exists>B\<in>\<BB>. B\<subseteq>B\<^sub>1\<inter>B\<^sub>2"
166+
proof -
167+
from assms(2,3) obtain M\<^sub>1 f\<^sub>1 M\<^sub>2 f\<^sub>2 where "M\<^sub>1\<noteq>\<emptyset>" "M\<^sub>2\<noteq>\<emptyset>" and
168+
I: "M\<^sub>1\<in>FinPow(\<M>)" "M\<^sub>2\<in>FinPow(\<M>)" "f\<^sub>1:M\<^sub>1\<rightarrow>L\<^sub>+" "f\<^sub>2:M\<^sub>2\<rightarrow>L\<^sub>+" and
169+
II: "B\<^sub>1 = (\<Inter>d\<in>M\<^sub>1. d-``({c\<in>L\<^sup>+. c\<lsq>f\<^sub>1`(d)}))" "B\<^sub>2 = (\<Inter>d\<in>M\<^sub>2. d-``({c\<in>L\<^sup>+. c\<lsq>f\<^sub>2`(d)}))"
170+
using mgauge_def_alt by auto
171+
let ?M\<^sub>3 = "M\<^sub>1\<union>M\<^sub>2"
172+
from assms(1) have "IsDownDirectedSet(L\<^sub>+,r)" using down_directs_directed
173+
by simp
174+
with I have
175+
"\<exists>f\<^sub>3\<in>?M\<^sub>3\<rightarrow>L\<^sub>+. (\<forall>d\<in>M\<^sub>1. \<langle>f\<^sub>3`(d),f\<^sub>1`(d)\<rangle>\<in>r) \<and> (\<forall>d\<in>M\<^sub>2. \<langle>f\<^sub>3`(d),f\<^sub>2`(d)\<rangle>\<in>r)"
176+
using two_fun_low_bound by simp
177+
then obtain f\<^sub>3 where "f\<^sub>3:?M\<^sub>3\<rightarrow>L\<^sub>+" and
178+
III: "\<forall>d\<in>M\<^sub>1. f\<^sub>3`(d)\<lsq>f\<^sub>1`(d)" "\<forall>d\<in>M\<^sub>2. f\<^sub>3`(d)\<lsq>f\<^sub>2`(d)"
179+
by auto
180+
let ?B\<^sub>3 = "\<Inter>d\<in>?M\<^sub>3. d-``({c\<in>L\<^sup>+. c\<lsq>f\<^sub>3`(d)})"
181+
from I(1,2) \<open>M\<^sub>1\<noteq>\<emptyset>\<close> \<open>f\<^sub>3:?M\<^sub>3\<rightarrow>L\<^sub>+\<close> have "?B\<^sub>3\<in>\<BB>"
182+
using union_finpow mgauge_def_alt(2) by auto
183+
moreover have "?B\<^sub>3\<subseteq>B\<^sub>1\<inter>B\<^sub>2"
184+
proof -
185+
from I(1,2) have "M\<^sub>1\<subseteq>\<M>" "M\<^sub>1\<subseteq>?M\<^sub>3" "M\<^sub>2\<subseteq>\<M>" "M\<^sub>2\<subseteq>?M\<^sub>3"
186+
unfolding FinPow_def by auto
187+
with \<open>M\<^sub>1\<noteq>\<emptyset>\<close> \<open>M\<^sub>2\<noteq>\<emptyset>\<close> I(3,4) II \<open>f\<^sub>3:?M\<^sub>3\<rightarrow>L\<^sub>+\<close> III
188+
have "?B\<^sub>3\<subseteq>B\<^sub>1" and "?B\<^sub>3\<subseteq>B\<^sub>2" using fun_inter_vimage_mono by simp_all
189+
thus "?B\<^sub>3\<subseteq>B\<^sub>1\<inter>B\<^sub>2" by auto
190+
qed
191+
ultimately show "\<exists>B\<in>\<BB>. B\<subseteq>B\<^sub>1\<inter>B\<^sub>2" by (rule witness_exists)
192+
qed
193+
194+
end

IsarMathLib/Order_ZF.thy

+16
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,12 @@ lemma part_ord_restr: assumes "IsPartOrder(X,r)"
254254
shows "IsPartOrder(X,r \<inter> X\<times>X)"
255255
using assms unfolding IsPartOrder_def refl_def antisym_def trans_def by auto
256256

257+
text\<open>Partial order on a set implies partial order on a subset.\<close>
258+
259+
lemma part_ord_subset: assumes "IsPartOrder(X,r)" and "A\<subseteq>X"
260+
shows "IsPartOrder(A,r)"
261+
using assms unfolding IsPartOrder_def refl_def by auto
262+
257263
text\<open> We can restrict a total order relation to the domain. \<close>
258264

259265
lemma total_ord_restr: assumes "r {is total on} X"
@@ -272,6 +278,16 @@ proof -
272278
then show "IsLinOrder(A,r \<inter> A\<times>A)" using Order_ZF_1_L3 by simp
273279
qed
274280

281+
text\<open>If a relation is a partial order on $X$ and it down-directs a subset of $X$
282+
then that is is a down-directed set.\<close>
283+
284+
lemma down_directs_subset:
285+
assumes "r {down-directs} A" "IsPartOrder(X,r)" "A\<subseteq>X"
286+
shows "IsDownDirectedSet(A,r)"
287+
using assms part_ord_subset
288+
unfolding IsPartOrder_def IsPreorder_def IsDownDirectedSet_def
289+
by simp
290+
275291
text\<open>If the relation is total, then every set is a union of those elements
276292
that are nongreater than a given one and nonsmaller than a given one.\<close>
277293

IsarMathLib/OrderedLoop_ZF.thy

+10-1
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,15 @@ proof -
392392
from assms(1) \<open>x\<ra>\<zero> \<ls> x\<ra>y\<close> \<open>\<zero>\<ra>x \<ls> y\<ra>x\<close>
393393
show "x \<ls> x\<ra>y" "x \<ls> y\<ra>x"
394394
using neut_props_loop(2) by simp_all
395-
qed
395+
qed
396+
397+
text\<open>In ordered loop if the order relation down-directs the set of positive elements $L_+$
398+
then $L_+$ is a down-directed set (see \<open>Order_ZF\<close> for definitions of those related but different
399+
notions).\<close>
400+
401+
lemma (in loop1) down_directs_directed: assumes "r {down-directs} L\<^sub>+"
402+
shows "IsDownDirectedSet(L\<^sub>+,r)"
403+
using ordLoopAssum assms positive_subset down_directs_subset
404+
unfolding IsAnOrdLoop_def by auto
396405

397406
end

IsarMathLib/ROOT

+3-2
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,12 @@ session "IsarMathLib" = "ZF" +
8989
Topology_ZF_11
9090
Topology_ZF_properties_2
9191
Topology_ZF_properties_3
92-
MetricSpace_ZF
93-
MetricSpace_ZF_1
9492
UniformSpace_ZF
9593
UniformSpace_ZF_1
9694
UniformSpace_ZF_2
95+
MetricSpace_ZF
96+
MetricSpace_ZF_1
97+
MetricUniform_ZF
9798
TopologicalGroup_ZF
9899
TopologicalGroup_ZF_1
99100
TopologicalGroup_Uniformity_ZF

IsarMathLib/ZF1.thy

+20
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,26 @@ proof -
221221
thus "( \<Inter>i\<in>I. P(i) ) \<subseteq> X" by auto
222222
qed
223223

224+
text\<open>A stronger version of \<open>ZF1_1_L7\<close> without the assumption
225+
that the collection of subsets is nonempty.\<close>
226+
227+
lemma inter_subsets_subset: assumes "\<forall>i\<in>I. P(i) \<subseteq> X"
228+
shows "(\<Inter>i\<in>I. P(i)) \<subseteq> X"
229+
proof -
230+
{ assume "I=\<emptyset>"
231+
hence "(\<Inter>i\<in>I. P(i)) = \<emptyset>" by auto
232+
hence ?thesis by simp
233+
}
234+
with assms show ?thesis using ZF1_1_L7 by blast
235+
qed
236+
237+
text\<open>Intersection of a smaller (but nonempty) collection of sets is larger.
238+
Note the assumption that the smaller collection is nonepty in necessary here.\<close>
239+
240+
lemma inter_index_mono: assumes "I\<subseteq>M" "I\<noteq>\<emptyset>"
241+
shows "(\<Inter>i\<in>M. P(i)) \<subseteq> (\<Inter>i\<in>I. P(i))"
242+
using assms by auto
243+
224244
text\<open>Isabelle/ZF has a "THE" construct that allows to define an element
225245
if there is only one such that is satisfies given predicate.
226246
In pure ZF we can express something similar using the indentity proven below.\<close>

isar2html2.0/theories.conf

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ UniformSpace_ZF_1
7676
UniformSpace_ZF_2
7777
MetricSpace_ZF
7878
MetricSpace_ZF_1
79+
MetricUniform_ZF
7980
TopologicalGroup_ZF
8081
TopologicalGroup_Uniformity_ZF
8182
MMI_prelude

0 commit comments

Comments
 (0)