IsarMathLib

Proofs by humans, for humans, formally verified by Isabelle/ZF proof assistant

theory MetricUniform_ZF imports FinOrd_ZF_1 MetricSpace_ZF UniformityLattice_ZF
begin

In the MetricSpace_ZF we show how a single (ordered loop valued) pseudometric defines a uniformity. In this theory we extend this to the situation where we have an arbitrary collection of pseudometrics, all defined on the the same set \(X\) and valued in an ordered loop \(L\). Since real numbers form an ordered loop all results proven in this theory are true for the standard real-valued pseudometrics.

Uniformity defined by a collection of pseudometrics

Suppose \(\mathcal{M}\) is a collection of (an ordered loop valued) pseudometrics on \(X\), i.e. \(d:X\times X\rightarrow L^+\) is a pseudometric for every \(d\in \mathcal{M}\). Then, for each \(d\in \mathcal{M}\) the collection of sets \(\mathfrak{B} = \{ d^{-1}(\{c\in L^+: c\leq b\}): b \in L_+ \}\) forms a fundamental system of entourages. Consequently, by taking supersets of \(\mathfrak{B}\) we can get a uniformity defined by the pseudometric (see theorem metric_gauge_base in the MetricSpace_ZF theory. Repeating this process for each \(d\in \mathcal{M}\) we obtain a collection of uniformities on \(X\). Since all uniformities on \(X\) ordered by inclusion form a complete lattice (see theorem uniformities_compl_latt in the UniformityLattice_ZF) there exists the smallest (coarsest) uniformity that contains all uniformities defined by the pseudometrics in \(\mathcal{M}\).

To shorten the main definition let's define the uniformity derived from a single pseudometric as UnifFromPseudometric. In the definition below \(X\) is the underlying set, \(L,A,r\) are the carrier, binary operation and the order relation, resp., of the ordered loop where the pseudometrics takes its values and \(d\) is the pseudometrics.

definition

\( \text{UnifFromPseudometric}(X,L,A,r,d) \equiv \text{Supersets}(X\times X, \text{UniformGauge}(X,L,A,r,d)) \)

We construct the uniformity from a collection of pseudometrics \(\mathcal{M}\) by taking the supremumum (i.e. the least upper upper bound) of the collection of uniformities defined by each pseudometric from \(\mathcal{M}\).

definition

\( \text{UnifFromPseudometrics}(X,L,A,r,\mathcal{M} ) \equiv \text{LUB_Unif}(X,\{ \text{UnifFromPseudometric}(X,L,A,r,d).\ d\in \mathcal{M} \}) \)

The context muliple_pmetric is very similar to the pmetric_space context except that rather than fixing a single pseudometric \(d\) we fix a nonempty collection of pseudometrics \(\mathcal{M}\). That forces the notation for disk, topology, interior and closure to depend on the pseudometric \(d\). The \(\mathcal{U}\) symbol will denote the collection of uniformities generated by \(\mathcal{M}\). We also assume that the positive cone \(L_+\) of the loop is nonempty, \(r\) down-directs \(L_+\) (see Order_ZF for definition) and that the (positive cone of the) ordered loop is halfable (see \( MetricSpace\_ZF) \)). In short, we assume what we need for ordered loop valued pseudometrics to generate uniformities.

locale muliple_pmetric = loop1 +

assumes nemptyX: \( X\neq \emptyset \)

assumes nemptyLp: \( L_+\neq \emptyset \)

assumes downdir: \( r \text{ down-directs } L_+ \)

assumes halfable: \( \text{IsHalfable}(L,A,r) \)

assumes nemptyM: \( \mathcal{M} \neq \emptyset \)

assumes mpmetricAssm: \( \forall d\in \mathcal{M} .\ \text{IsApseudoMetric}(d,X,L,A,r) \)

defines \( \mathcal{U} \equiv \{ \text{UnifFromPseudometric}(X,L,A,r,d).\ d\in \mathcal{M} \} \)

defines \( disk(d,c,R) \equiv \text{Disk}(X,d,r,c,R) \)

defines \( \tau (d) \equiv \text{MetricTopology}(X,L,A,r,d) \)

defines \( int(d,D) \equiv \text{Interior}(D,\tau (d)) \)

defines \( cl(d,D) \equiv \text{Closure}(D,\tau (d)) \)

If \(d\) is one of the pseudometrics from \(\mathcal{M}\) then theorems proven in the pmetric_space context are valid as applied to \(d\).

lemma (in muliple_pmetric) pmetric_space_valid_in_mpm:

assumes \( d\in \mathcal{M} \)

shows \( pmetric\_space(L,A,r,d,X) \)proof
from assms, mpmetricAssm show \( \text{IsApseudoMetric}(d,X,L,A,r) \)
qed

In the muliple_pmetric context each element of \(\mathcal{U}\) is a uniformity.

lemma (in muliple_pmetric) each_gen_unif_unif:

shows \( \mathcal{U} \subseteq \text{Uniformities}(X) \)proof
fix \( \Phi \)
assume \( \Phi \in \mathcal{U} \)
then obtain \( d \) where \( d\in \mathcal{M} \) and \( \Phi = \text{UnifFromPseudometric}(X,L,A,r,d) \)
with nemptyX, nemptyLp, downdir, halfable show \( \Phi \in \text{Uniformities}(X) \) using pmetric_space_valid_in_mpm, metric_gauge_base(2), unif_in_unifs unfolding UnifFromPseudometric_def
qed

The uniformity generated by a family of pseudometrics \(\mathcal{M}\) is indeed a uniformity which is the supremum of uniformities in \(\mathcal{U}\).

lemma (in muliple_pmetric) gen_unif_unif:

shows \( \text{UnifFromPseudometrics}(X,L,A,r,\mathcal{M} ) \text{ is a uniformity on } X \), \( \text{UnifFromPseudometrics}(X,L,A,r,\mathcal{M} ) = \text{Supremum}( \text{OrderOnUniformities}(X),\mathcal{U} ) \) using nemptyX, nemptyM, each_gen_unif_unif, lub_unif_sup(2,3) unfolding UnifFromPseudometrics_def

The uniformity generated by a family of pseudometrics contains all uniformities generated by the pseudometrics in \(\mathcal{M}\).

lemma (in muliple_pmetric) gen_unif_contains_unifs:

assumes \( \Phi \in \mathcal{U} \)

shows \( \Phi \subseteq \text{UnifFromPseudometrics}(X,L,A,r,\mathcal{M} ) \) using nemptyX, assms, each_gen_unif_unif, lub_unif_upper_bound unfolding OrderOnUniformities_def, InclusionOn_def, UnifFromPseudometrics_def

If a uniformity contains all uniformities generated by the pseudometrics in \(\mathcal{M}\) then it contains the uniformity generated by that family of pseudometrics.

lemma (in muliple_pmetric) gen_unif_LUB:

assumes \( \Psi \text{ is a uniformity on } X \) and \( \forall \Phi \in \mathcal{U} .\ \Phi \subseteq \Psi \)

shows \( \text{UnifFromPseudometrics}(X,L,A,r,\mathcal{M} ) \subseteq \Psi \)proof
from assms have \( \forall \Phi \in \mathcal{U} .\ \langle \Phi ,\Psi \rangle \in \text{OrderOnUniformities}(X) \) using each_gen_unif_unif, unif_in_unifs unfolding OrderOnUniformities_def, InclusionOn_def
with nemptyX, nemptyM show \( thesis \) using each_gen_unif_unif, lub_unif_lub unfolding OrderOnUniformities_def, InclusionOn_def, UnifFromPseudometrics_def
qed

The uniformity generated by the collection of pseudometrics \(\mathcal{M}\) contains all inverse images of the initial segments of the positive cone of \(L\), (i.e. sets of the form \(d^{-1}(\{c\in l: 0 \leq c \leq y \})\) for \(d\in \mathcal{M}\) and \(y\) from the positive cone \(L_+\) of \(L\)).

lemma (in muliple_pmetric) gen_unif_contains_gauges:

assumes \( d\in \mathcal{M} \), \( y\in L_+ \)

shows \( d^{-1}(\{c\in L^+.\ \langle c,y\rangle \in r\}) \in \text{UnifFromPseudometrics}(X,L,A,r,\mathcal{M} ) \)proof
let \( g = d^{-1}(\{c\in L^+.\ \langle c,y\rangle \in r\}) \)
from assms(2) have \( g \in \text{UniformGauge}(X,L,A,r,d) \) unfolding UniformGauge_def
with mpmetricAssm, assms(1) have \( g \in \text{UnifFromPseudometric}(X,L,A,r,d) \) unfolding IsApseudoMetric_def, UnifFromPseudometric_def using func1_1_L3, superset_gen
with assms(1) show \( thesis \) using gen_unif_contains_unifs
qed

The uniformity generated by the collection of pseudometrics \(\mathcal{M}\) is the coarsest uniformity that contains all inverse images of the initial segments of the positive cone of \(L\) with respect to all \(d\in\mathcal{M}\).

theorem (in muliple_pmetric) gen_unif_corsest:

assumes \( \Psi \text{ is a uniformity on } X \) and \( \forall d\in \mathcal{M} .\ \forall y\in L_+.\ d^{-1}(\{c\in L^+.\ \langle c,y\rangle \in r\}) \in \Psi \)

shows \( \text{UnifFromPseudometrics}(X,L,A,r,\mathcal{M} ) \subseteq \Psi \)proof
{
fix \( d \)
assume \( d\in \mathcal{M} \)
with assms(2) have \( \text{UniformGauge}(X,L,A,r,d) \subseteq \Psi \) unfolding UniformGauge_def
with assms(1) have \( \text{UnifFromPseudometric}(X,L,A,r,d) \subseteq \Psi \) unfolding IsUniformity_def, UnifFromPseudometric_def using filter_superset_closed
}
hence \( \forall \Phi \in \mathcal{U} .\ \Phi \subseteq \Psi \)
with assms(1) show \( thesis \) using gen_unif_LUB
qed

Uniformity defined by a collection of pseudometrics - an alternative approach

This section presents an alternative, more direct approach to defining a uniformity generated by a collection of pseudometric. This approach is probably equivalent to the one presented in the previous section, but more complicated and hence obsolete.

The next two definitions describe the way a common fundamental system of entourages for \(\mathcal{M}\) is constructed. First we take finite subset \(M\) of \(\mathcal{M}\). Then we choose \(f:M\rightarrow L_+\). This way for each \(d\in M\) the value \(f(d)\) is a positive element of \(L\) and \(\{d^{-1}(\{c\in L^+: c\leq f(d)\}): d\in M\}\) is a finite collection of subsets of \(X\times X\). Then we take intersections of such finite collections as \(M\) varies over \(\mathcal{M}\) and \(f\) varies over all possible functions mapping \(M\) to \(L_+\). To simplify notation for this construction we split it into two steps. In the first step we define a collection of finite intersections resulting from choosing a finite set of pseudometrics \(M\), \(f:M\rightarrow L_+\) and varying the selector function \(f\) over the space of functions mapping \(M\) to the set of positive elements of \(L\).

definition

\( \text{UniformGaugeSets}(X,L,A,r,M) \equiv \) \( \{(\bigcap d\in M.\ d^{-1}(\{c\in \text{Nonnegative}(L,A,r).\ \langle c,f(d)\rangle \in r\})).\ f\in M\rightarrow \text{PositiveSet}(L,A,r)\} \)

In the second step we collect all uniform gauge sets defined above as parameter \(M\) vary over all nonempty finite subsets of \(\mathcal{M}\). This is the collection of sets that we will show forms a fundamental system of entourages.

definition

\( \text{UniformGauges}(X,L,A,r,\mathcal{M} ) \equiv \bigcup M\in \text{FinPow}(\mathcal{M} )\setminus \{\emptyset \}.\ \text{UniformGaugeSets}(X,L,A,r,M) \)

Analogously what is done in the pmetric_space context we will write \( \text{UniformGauges}(X,L,A,r,\mathcal{M} ) \) as \( \mathfrak{B} \) in the muliple_pmetric context.

abbreviation (in muliple_pmetric)

\( \mathfrak{B} \equiv \text{UniformGauges}(X,L,A,r,\mathcal{M} ) \)

The next lemma just shows the definition of \(\mathfrak{B}\) in notation used in the muliple_pmetric.

lemma (in muliple_pmetric) mgauge_def_alt:

shows \( \mathfrak{B} = (\bigcup M\in \text{FinPow}(\mathcal{M} )\setminus \{\emptyset \}.\ \{(\bigcap d\in M.\ d^{-1}(\{c\in L^+.\ c\leq f(d)\})).\ f\in M\rightarrow L_+\}) \) unfolding UniformGaugeSets_def, UniformGauges_def

\(\mathfrak{B}\) consists of (finite) intersections of sets of the form \(d^{-1}(\{c\in L^+:c\leq f(d)\})\) where \(f:M\rightarrow L_+\) some finite subset \(M\subseteq \mathcal{M}\). More precisely, if \(M\) is a nonempty finite subset of \(\mathcal{M}\) and \(f\) maps \(M\) to the positive set of the loop \(L\), then the set \(\bigcap_{d\in M} d^{-1}(\{c\in L^+:c\leq f(d)\}\) is in \(\mathfrak{B}\).

lemma (in muliple_pmetric) mgauge_finset_fun:

assumes \( M\in \text{FinPow}(\mathcal{M} ) \), \( M\neq \emptyset \), \( f:M\rightarrow L_+ \)

shows \( (\bigcap d\in M.\ d^{-1}(\{c\in L^+.\ c\leq f(d)\})) \in \mathfrak{B} \) using assms, mgauge_def_alt

If \(d\) is member of any finite subset of \(\mathcal{M}\) then \(d\) maps \(X\times X\) to the nonnegative set of the ordered loop \(L\).

lemma (in muliple_pmetric) each_pmetric_map:

assumes \( M\in \text{FinPow}(\mathcal{M} ) \) and \( d\in M \)

shows \( d: X\times X \rightarrow L^+ \) using assms, pmetric_space_valid_in_mpm, pmetric_properties(1) unfolding FinPow_def

Members of the uniform gauge defined by multiple pseudometrics are subsets of \(X\times X\) i.e. relations on \(X\).

lemma (in muliple_pmetric) muniform_gauge_relations:

assumes \( B\in \mathfrak{B} \)

shows \( B\subseteq X\times X \)proof
from assms obtain \( M \) \( f \) where \( M\in \text{FinPow}(\mathcal{M} ) \) and I: \( B = (\bigcap d\in M.\ d^{-1}(\{c\in L^+.\ c\leq f(d)\})) \) using mgauge_def_alt
{
fix \( d \)
assume \( d\in M \)
with \( M\in \text{FinPow}(\mathcal{M} ) \) have \( d: X\times X \rightarrow L^+ \) using each_pmetric_map
then have \( d^{-1}(\{c\in L^+.\ c\leq f(d)\}) \subseteq X\times X \) using func1_1_L15
}
with I show \( thesis \) using inter_subsets_subset
qed

Suppose \(M_1\) is a subset of \(M\) and \(\mathcal{M}\). \(f_1,f\) map \(M_1\) and \(M\), resp. to \(L_+\) and \(f\leq f_1\) on \(M_1\). Then the set \(\bigcap_{d\in M} d^{-1}(\{y \in L_+: y\leq f(d)\})\) is included in the set \(\bigcap_{d\in M_1} d^{-1}(\{y \in L_+: y\leq f_1(d)\})\).

lemma (in muliple_pmetric) fun_inter_vimage_mono:

assumes \( M_1\subseteq \mathcal{M} \), \( M_1\subseteq M \), \( M_1\neq \emptyset \), \( f_1:M_1\rightarrow L_+ \), \( f:M\rightarrow L_+ \) and \( \forall d\in M_1.\ f(d)\leq f_1(d) \)

shows \( (\bigcap d\in M.\ d^{-1}(\{c\in L^+.\ c\leq f(d)\})) \subseteq (\bigcap d\in M_1.\ d^{-1}(\{c\in L^+.\ c\leq f_1(d)\})) \)proof
let \( L = (\bigcap d\in M.\ d^{-1}(\{c\in L^+.\ c\leq f(d)\})) \)
let \( R = (\bigcap d\in M_1.\ d^{-1}(\{c\in L^+.\ c\leq f_1(d)\})) \)
from assms(2,3) have I: \( L \subseteq (\bigcap d\in M_1.\ d^{-1}(\{c\in L^+.\ c\leq f(d)\})) \) using inter_index_mono
from assms(1,6) have \( \forall d\in M_1.\ (d^{-1}(\{c\in L^+.\ c\leq f(d)\})) \subseteq d^{-1}(\{c\in L^+.\ c\leq f_1(d)\}) \) using pmetric_space_valid_in_mpm, uniform_gauge_mono
with assms(2) have \( (\bigcap d\in M_1.\ d^{-1}(\{c\in L^+.\ c\leq f(d)\})) \subseteq R \)
with I show \( L\subseteq R \) by (rule subset_trans )
qed

For any two sets \(B_1,B_2\) in \(\mathfrak{B}\) there exist a third one that is contained in both.

lemma (in muliple_pmetric) mgauge_1st_cond:

assumes \( B_1\in \mathfrak{B} \), \( B_2\in \mathfrak{B} \)

shows \( \exists B\in \mathfrak{B} .\ B\subseteq B_1\cap B_2 \)proof
from assms(1,2) obtain \( M_1 \) \( f_1 \) \( M_2 \) \( f_2 \) where \( M_1\neq \emptyset \), \( M_2\neq \emptyset \) and I: \( M_1\in \text{FinPow}(\mathcal{M} ) \), \( M_2\in \text{FinPow}(\mathcal{M} ) \), \( f_1:M_1\rightarrow L_+ \), \( f_2:M_2\rightarrow L_+ \) and II: \( B_1 = (\bigcap d\in M_1.\ d^{-1}(\{c\in L^+.\ c\leq f_1(d)\})) \), \( B_2 = (\bigcap d\in M_2.\ d^{-1}(\{c\in L^+.\ c\leq f_2(d)\})) \) using mgauge_def_alt
let \( M_3 = M_1\cup M_2 \)
from downdir have \( \text{IsDownDirectedSet}(L_+,r) \) using down_directs_directed
with I have \( \exists f_3\in M_3\rightarrow L_+.\ (\forall d\in M_1.\ \langle f_3(d),f_1(d)\rangle \in r) \wedge (\forall d\in M_2.\ \langle f_3(d),f_2(d)\rangle \in r) \) using two_fun_low_bound
then obtain \( f_3 \) where \( f_3:M_3\rightarrow L_+ \) and III: \( \forall d\in M_1.\ f_3(d)\leq f_1(d) \), \( \forall d\in M_2.\ f_3(d)\leq f_2(d) \)
let \( B_3 = \bigcap d\in M_3.\ d^{-1}(\{c\in L^+.\ c\leq f_3(d)\}) \)
from I(1,2), \( M_1\neq \emptyset \), \( f_3:M_3\rightarrow L_+ \) have \( B_3\in \mathfrak{B} \) using union_finpow, mgauge_def_alt
moreover
have \( B_3\subseteq B_1\cap B_2 \)proof
from I(1,2) have \( M_1\subseteq \mathcal{M} \), \( M_1\subseteq M_3 \), \( M_2\subseteq \mathcal{M} \), \( M_2\subseteq M_3 \) unfolding FinPow_def
with \( M_1\neq \emptyset \), \( M_2\neq \emptyset \), I(3,4), II, \( f_3:M_3\rightarrow L_+ \), III have \( B_3\subseteq B_1 \) and \( B_3\subseteq B_2 \) using fun_inter_vimage_mono
thus \( B_3\subseteq B_1\cap B_2 \)
qed
ultimately show \( \exists B\in \mathfrak{B} .\ B\subseteq B_1\cap B_2 \) by (rule witness_exists )
qed

Sets in \(\mathfrak{B}\) contain the diagonal and are symmetric, hence contain a symmetric subset from \(\mathfrak{B}\).

lemma (in muliple_pmetric) mgauge_2nd_and_3rd_cond:

assumes \( B\in \mathfrak{B} \)

shows \( id(X)\subseteq B \), \( B = converse(B) \), \( \exists B_2\in \mathfrak{B} .\ B_2 \subseteq converse(B) \)proof
from assms obtain \( M \) \( f \) where \( M\in \text{FinPow}(\mathcal{M} ) \), \( M\neq \emptyset \), \( f:M\rightarrow L_+ \) and I: \( B = (\bigcap d\in M.\ d^{-1}(\{c\in L^+.\ c\leq f(d)\})) \) using mgauge_def_alt
{
fix \( d \)
assume \( d\in M \)
let \( B_d = d^{-1}(\{c\in L^+.\ c\leq f(d)\}) \)
from \( d\in M \), \( f:M\rightarrow L_+ \), \( M\in \text{FinPow}(\mathcal{M} ) \) have \( pmetric\_space(L,A,r,d,X) \) and \( B_d \in \text{UniformGauge}(X,L,A,r,d) \) unfolding FinPow_def, UniformGauge_def using apply_funtype, pmetric_space_valid_in_mpm
then have \( id(X)\subseteq B_d \) and \( B_d = converse(B_d) \) using gauge_2nd_cond, gauge_symmetric
}
with I, \( M\neq \emptyset \) show \( id(X)\subseteq B \) and \( B = converse(B) \)
from assms, \( B = converse(B) \) show \( \exists B_2\in \mathfrak{B} .\ B_2 \subseteq converse(B) \)
qed

\(\mathfrak{B}\) is a subset of the power set of \(X\times X\).

lemma (in muliple_pmetric) mgauge_5thCond:

shows \( \mathfrak{B} \subseteq Pow(X\times X) \) using muniform_gauge_relations

If \(\mathcal{M}\) and \(L_+\) are nonempty then \(\mathfrak{B}\) is also nonempty.

lemma (in muliple_pmetric) mgauge_6thCond:

shows \( \mathfrak{B} \neq \emptyset \)proof
from nemptyLp, nemptyM obtain \( M \) \( y \) where \( M\in \text{FinPow}(\mathcal{M} ) \), \( M\neq \emptyset \) and \( y\in L_+ \) using finpow_nempty_nempty
from \( y\in L_+ \) have \( \text{ConstantFunction}(M,y):M\rightarrow L_+ \) using func1_3_L1
with \( M\in \text{FinPow}(\mathcal{M} ) \), \( M\neq \emptyset \) show \( \mathfrak{B} \neq \emptyset \) using mgauge_finset_fun
qed

If the loop order is halfable then for every set \(B_1\in \mathfrak{B}\) there is another set \(B_2\in \mathfrak{B}\) such that \(B_2\circ B_2 \subseteq B_1\).

lemma (in muliple_pmetric) mgauge_4thCond:

assumes \( B_1\in \mathfrak{B} \)

shows \( \exists B_2\in \mathfrak{B} .\ B_2\circ B_2 \subseteq B_1 \)proof
from assms(1) obtain \( M \) \( f_1 \) where \( M\in \text{FinPow}(\mathcal{M} ) \), \( M\neq \emptyset \), \( f_1:M\rightarrow L_+ \) and I: \( B_1 = (\bigcap d\in M.\ d^{-1}(\{c\in L^+.\ c\leq f_1(d)\})) \) using mgauge_def_alt
from halfable, \( f_1:M\rightarrow L_+ \) have \( \forall d\in M.\ \exists b_2\in L_+.\ b_2 + b_2 \leq f_1(d) \) using apply_funtype unfolding IsHalfable_def
with \( M\in \text{FinPow}(\mathcal{M} ) \) have \( \exists f_2\in M\rightarrow L_+.\ \forall d\in M.\ f_2(d) + f_2(d) \leq f_1(d) \) unfolding FinPow_def using finite_choice_fun
then obtain \( f_2 \) where \( f_2\in M\rightarrow L_+ \) and II: \( \forall d\in M.\ f_2(d) + f_2(d) \leq f_1(d) \)
let \( B_2 = \bigcap d\in M.\ d^{-1}(\{c\in L^+.\ c\leq f_2(d)\}) \)
{
fix \( d \)
assume \( d\in M \)
let \( A_2 = d^{-1}(\{c\in L^+.\ c\leq f_2(d)\}) \)
from \( d\in M \), \( M\in \text{FinPow}(\mathcal{M} ) \) have \( pmetric\_space(L,A,r,d,X) \) unfolding FinPow_def using pmetric_space_valid_in_mpm
with \( f_2\in M\rightarrow L_+ \), \( d\in M \), II have \( A_2\circ A_2 \subseteq d^{-1}(\{c\in L^+.\ c\leq f_1(d)\}) \) using apply_funtype, half_vimage_square
}
with \( M\neq \emptyset \), I have \( B_2\circ B_2 \subseteq B_1 \) using square_incl_product
with \( M\in \text{FinPow}(\mathcal{M} ) \), \( M\neq \emptyset \), \( f_2\in M\rightarrow L_+ \) show \( thesis \) using mgauge_finset_fun
qed

If \(\mathcal{M}\) is a nonempty collection of pseudometrics on a nonempty set \(X\) valued in loop \(L\) partially ordered by relation \(r\) such that the set of positive elements \(L_+\) is nonempty, \(r\) down directs \(L_+\) and \(r\) is halfable on \(L\),then \(\mathfrak{B}\) is a fundamental system of entourages in \(X\) hence its supersets form a uniformity on \(X\) and hence those supersets define a topology on \(X\)

lemma (in muliple_pmetric) mmetric_gauge_base:

shows \( \mathfrak{B} \text{ is a uniform base on } X \), \( \text{Supersets}(X\times X,\mathfrak{B} ) \text{ is a uniformity on } X \), \( \text{UniformTopology}( \text{Supersets}(X\times X,\mathfrak{B} ),X) \text{ is a topology } \), \( \bigcup \text{UniformTopology}( \text{Supersets}(X\times X,\mathfrak{B} ),X) = X \) using nemptyX, mgauge_1st_cond, mgauge_2nd_and_3rd_cond, mgauge_4thCond, mgauge_5thCond, mgauge_6thCond, uniformity_base_is_base, uniform_top_is_top unfolding IsUniformityBaseOn_def

Halving sequences of entourages

The notion of uniformity can be defined in several ways. Our primary definition in the UniformSpace_ZF theory is based on the concept of entourages. In UniformSpace_ZF_2 we consider the an alternative definition based on uniform covers. The third possible definition is based on families of pseudometrics. "The significance of defining a uniformity by means of a family of pseudometrics lies in the fact that all unifomities can be so obtained." (from Bourbaki: General Topology Chapter IX par. 1.4). In this section we formalize a part of the material that is needed to prove this statement that can be done without the Axiom of Choice and in the general setting of ordered-loop valued pseudometrics.

The definition of a uniformity requires that for each entourage \(U\) there is another one \(V\) such that \(V\circ V\subseteq U\). Furthermore, lemma half_size_symm shows that we can assume \(V\) is symmetric. In some propositions in this section we will assume that we are given a function say \(h\) that provides those half-size entourages, i.e. maps a uniformity \(\Phi\) into itself and for each entourage \(U\in\Phi\) we have \(h(U)\circ h(U)\subseteq V\).

The existence of such function follows from the Axiom of Choice, but we don't want to use AC in this theory.

The next definition lists the desired properties of such halving function for shorter references in theorem assumptions.

definition

\( h \text{ is a halving function for } \Phi \equiv \) \( h:\Phi \rightarrow \Phi \wedge (\forall U\in \Phi .\ h(U) = converse(h(U)) \wedge h(U)\circ h(U) \subseteq U) \)

Let \(\Phi\) be a uniformity on \(X\), \(U\in\Phi\) and \(h\) is a halving function for \(\Phi\). This function then defines inductively a sequence \(\{ H_n\}_{n\in\mathbb{N}}\) of entourages such that \(H_0 = U\) and \(H_{n+1}\circ H_{n+1}\subseteq H_n\). The next lemma shows that \(H\) is a \(\Phi\)-valued sequence which starts at \(U\).

lemma halving_seq_start:

assumes \( U\in \Phi \), \( h \text{ is a halving function for } \Phi \)

defines \( H \equiv \text{InductiveSequence}(U,h) \)

shows \( H:nat\rightarrow \Phi \) and \( H(0) = U \) using assms, indseq_seq, indseq_valat0 unfolding IsHalvingFunction_def

For the inductively defined sequence of halving entourages \(H\) starting from \(U\) and a natural number \(n\) we indeed have \(H_{n+1} \circ H_{n+1} \subseteq H_n\).

lemma halving_seq_halves:

assumes \( U\in \Phi \), \( h \text{ is a halving function for } \Phi \), \( n\in nat \)

defines \( H \equiv \text{InductiveSequence}(U,h) \)

shows \( H(n + 1) = converse(H(n + 1)) \) and \( H(n + 1)\circ H(n + 1) \subseteq H(n) \)proof
from assms have \( H(n + 1) = h(H(n)) \) unfolding IsHalvingFunction_def using indseq_vals, succ_add_one(1)
from assms have \( H(n)\in \Phi \) using halving_seq_start(1), apply_funtype
with assms(2), \( H(n + 1) = h(H(n)) \) show \( H(n + 1) = converse(H(n + 1)) \) and \( H(n + 1)\circ H(n + 1) \subseteq H(n) \) unfolding IsHalvingFunction_def
qed

A halving sequence in \(\Phi\) is decreasing in the inclusion order on \(\Phi\), hence the inclusion order on \(\Phi\) is total on the sequence's image of the natural numbers, hence total on the sequence's image of positive natural numbers. We need that fact about positive natural numbers because we plan to prove that the image of the sequence on the positive natural numbers forms a fundamental system of symmetric entourages. and the first element of the sequence (at index \(0\)) does not have to be symmetric.

lemma halving_seq_decr:

assumes \( \Phi \text{ is a uniformity on } X \), \( U\in \Phi \), \( h \text{ is a halving function for } \Phi \)

defines \( H \equiv \text{InductiveSequence}(U,h) \)

shows \( \text{IsDecreasingSeq}(\Phi , \text{InclusionOn}(\Phi ),H) \), \( \text{InclusionOn}(\Phi ) \text{ is total on } (H(nat)) \), \( \text{InclusionOn}(\Phi ) \text{ is total on } (H(nat\setminus \{0\})) \)proof
from assms(2,3,4) have \( H:nat\rightarrow \Phi \) using halving_seq_start(1)
let \( r = \text{InclusionOn}(\Phi ) \)
{
fix \( n \)
assume \( n\in nat \)
with \( H:nat\rightarrow \Phi \) have \( H(n) \in \Phi \) and \( H(n + 1) \in \Phi \) using apply_funtype
with assms(1) have \( H(n) \subseteq X\times X \), \( H(n + 1) \subseteq X\times X \) and \( id(X) \subseteq H(n + 1) \) using uni_domain(1) unfolding IsUniformity_def
then have \( H(n + 1) \subseteq H(n + 1)\circ H(n + 1) \) using refl_square_greater
with assms(2,3,4), \( n\in nat \), \( H(n + 1) \in \Phi \), \( H(n) \in \Phi \) have \( \langle H(n + 1),H(n)\rangle \in r \) using halving_seq_halves(2) unfolding InclusionOn_def
}
hence \( \forall n\in nat.\ \langle H(n + 1),H(n)\rangle \in r \)
with \( H:nat\rightarrow \Phi \) show \( \text{IsDecreasingSeq}(\Phi , \text{InclusionOn}(\Phi ),H) \) unfolding IsDecreasingSeq_def
then show \( r \text{ is total on } H(nat) \) using incl_is_partorder, decr_seq_total unfolding IsPartOrder_def, IsPreorder_def
then show \( \text{InclusionOn}(\Phi ) \text{ is total on } (H(nat\setminus \{0\})) \) unfolding IsTotal_def
qed

We aim at showing that the a halving sequence image is a uniform base. The next lemma shows the first condition in the uniform base definition: for two sets in a halving sequence image there is a third one that is contained in both.

lemma halving_seq_base_1st_cond:

assumes \( \Phi \text{ is a uniformity on } X \), \( U\in \Phi \), \( h \text{ is a halving function for } \Phi \)

defines \( H \equiv \text{InductiveSequence}(U,h) \)

assumes \( B_1\in H(nat\setminus \{0\}) \), \( B_2\in H(nat\setminus \{0\}) \)

shows \( \exists B\in H(nat\setminus \{0\}).\ B\subseteq B_1\cap B_2 \)proof
let \( r = \text{InclusionOn}(\Phi ) \)
from assms have \( \langle B_1,B_2\rangle \in r \vee \langle B_2,B_1\rangle \in r \) using halving_seq_decr(3) unfolding IsTotal_def
with assms(5,6) show \( thesis \) unfolding InclusionOn_def
qed

Sets in the halving sequence image of positive naturals contain the diagonal, are symmetric and for every such set \(B\) there is another one contained in the converse of the first one and another one \(B_2\) such that \(B_2\circ B_2\subseteq B_1\). Note the symmetry of the sets is not required in the definition of a fundamental system of entourages, but it's good to have as we plan to construct a pseudometric that generates that halving sequence image of positive naturals.

lemma halving_seq_base_2_3_4_conds:

assumes \( \Phi \text{ is a uniformity on } X \), \( U\in \Phi \), \( h \text{ is a halving function for } \Phi \)

defines \( H \equiv \text{InductiveSequence}(U,h) \)

assumes \( B\in H(nat\setminus \{0\}) \)

shows \( id(X)\subseteq B \), \( B = converse(B) \), \( \exists B_1\in H(nat\setminus \{0\}).\ B_1 \subseteq converse(B) \), \( \exists B_2\in H(nat\setminus \{0\}).\ B_2\circ B_2 \subseteq B \)proof
from assms(2,3,4) have \( H:nat\rightarrow \Phi \) using halving_seq_start(1)
with assms(1,5) show \( id(X)\subseteq B \) using entourage_props(2), func1_1_L6(2)
have \( nat\setminus \{0\}\subseteq nat \)
with assms(5), \( H:nat\rightarrow \Phi \) obtain \( n \) where \( n\in nat \), \( n\neq 0 \) and \( B=H(n) \) using func_imagedef
from \( n\in nat \), \( n\neq 0 \) obtain \( k \) where \( k\in nat \), \( n = k + 1 \) using nat_not0_succ
from assms(2,3,4), \( k\in nat \) have \( H(k + 1) = converse(H(k + 1)) \) using halving_seq_halves(1)
with assms(5), \( n = k + 1 \), \( B=H(n) \) show \( B = converse(B) \) and \( \exists B_1\in H(nat\setminus \{0\}).\ B_1 \subseteq converse(B) \)
from \( n\in nat \), \( H:nat\rightarrow \Phi \), \( nat\setminus \{0\}\subseteq nat \) have \( H(n + 1) \in H(nat\setminus \{0\}) \) using func_imagedef
from assms(2,3,4), \( n\in nat \) have \( H(n + 1)\circ H(n + 1) \subseteq H(n) \) using halving_seq_halves(2)
with \( B=H(n) \), \( H(n + 1) \in H(nat\setminus \{0\}) \) show \( \exists B_2\in H(nat\setminus \{0\}).\ B_2\circ B_2 \subseteq B \)
qed

The halving sequence image of positive naturals is contained in the powerset of \(X\times X\) and is not empty.

lemma halving_seq_base_5_and_6th_cond:

assumes \( \Phi \text{ is a uniformity on } X \), \( U\in \Phi \), \( h \text{ is a halving function for } \Phi \)

defines \( H \equiv \text{InductiveSequence}(U,h) \)

shows \( H(nat\setminus \{0\}) \subseteq Pow(X\times X) \) and \( H(nat\setminus \{0\}) \neq \emptyset \)proof
from assms(2,3,4) have \( H:nat\rightarrow \Phi \) using halving_seq_start(1)
then have \( H(nat\setminus \{0\}) \subseteq \Phi \) using func1_1_L6(2)
with assms(1) show \( H(nat\setminus \{0\}) \subseteq Pow(X\times X) \) using unif_filter unfolding IsFilter_def
have \( nat\setminus \{0\} \subseteq nat \)
with \( H:nat\rightarrow \Phi \) show \( H(nat\setminus \{0\}) \neq \emptyset \) using func_imagedef
qed

If \(\Phi\) is a uniformity, \(h\) is a halving function for it and \(U\in \Phi\) then the image of the halving sequence defined inductively as \(H_0=U, H_{n+1} = h(H(n))\) on the positive naturals is a fundamental system of entourages.

theorem halving_seq_base:

assumes \( \Phi \text{ is a uniformity on } X \), \( U\in \Phi \), \( h \text{ is a halving function for } \Phi \)

defines \( H \equiv \text{InductiveSequence}(U,h) \)

shows \( (H(nat\setminus \{0\})) \text{ is a uniform base on } X \) using assms, halving_seq_base_1st_cond, halving_seq_base_2_3_4_conds, halving_seq_base_5_and_6th_cond unfolding IsUniformityBaseOn_def

Theorem halving_seq_base shows that given a halving function \(h\) for a uniformity \(\Phi\) each entourage \(U\in\Phi\) defines a uniformity that has a countable base consisting of symmetric entourages and (as we show later) contains that entourage. The next definition summarizes the construction of this coarser uniformity.

definition

\( \text{CountBaseUnif}(X,h,U) \equiv \text{Supersets}(X\times X, \text{InductiveSequence}(U,h)(nat\setminus \{0\})) \)

If \(\Phi\) is a uniformity, \(h\) is a halving function for it and \(U\in\Phi\) then \( \text{CountBaseUnif}(X,h,U) \) is a uniformity on \(X\) that contains \(U\) (as a member) and is contained in \(\Phi\).

lemma unif_count_base_unif:

assumes \( X\neq \emptyset \), \( \Phi \text{ is a uniformity on } X \), \( U\in \Phi \), \( h \text{ is a halving function for } \Phi \)

shows \( \text{CountBaseUnif}(X,h,U) \text{ is a uniformity on } X \) and \( U\in \text{CountBaseUnif}(X,h,U) \), \( \text{CountBaseUnif}(X,h,U) \subseteq \Phi \)proof
let \( H = \text{InductiveSequence}(U,h) \)
let \( \Psi _U = \text{CountBaseUnif}(X,h,U) \)
from assms show \( \Psi _U \text{ is a uniformity on } X \) using halving_seq_base, uniformity_base_is_base unfolding CountBaseUnif_def
from assms(2,3) have \( U\subseteq X\times X \) using entourage_props(1)
from assms(2,3,4) have \( H:nat\rightarrow \Phi \) using halving_seq_start(1)
with assms(2) have \( H(1) \subseteq X\times X \) using apply_funtype, entourage_props(1)
from assms(2,3,4) have \( H(1) \subseteq U \) using halving_seq_decr(1), halving_seq_start(2) unfolding IsDecreasingSeq_def, InclusionOn_def
have \( 1\in nat\setminus \{0\} \), \( nat\setminus \{0\} \subseteq nat \)
with \( H:nat\rightarrow \Phi \) have \( H(1) \in H(nat\setminus \{0\}) \) using func_imagedef
with \( H(1) \subseteq X\times X \) have \( H(1) \in \Psi _U \) using superset_gen unfolding CountBaseUnif_def
with \( \Psi _U \text{ is a uniformity on } X \), \( U\subseteq X\times X \), \( H(1) \subseteq U \) show \( U\in \Psi _U \) using unif_filter unfolding IsFilter_def
{
fix \( V \)
assume \( V\in \Psi _U \)
then obtain \( W \) where \( W\subseteq X\times X \), \( W \in H(nat\setminus \{0\}) \) and \( W\subseteq V \) unfolding CountBaseUnif_def, Supersets_def
from \( \Psi _U \text{ is a uniformity on } X \), \( V\in \Psi _U \) have \( V\subseteq X\times X \) using entourage_props(1)
from \( H:nat\rightarrow \Phi \), \( W\in H(nat\setminus \{0\}) \) have \( W\in \Phi \) using func1_1_L6(2)
with assms(2), \( V\subseteq X\times X \), \( W\subseteq V \) have \( V\in \Phi \) using unif_filter unfolding IsFilter_def
}
thus \( \Psi _U \subseteq \Phi \)
qed

If \(\Phi\) is a uniformity on a nonempty set \(X\) and admits a halving function \(h\) then \(\Phi\) is the supremum of the collection of uniformities \(\{\Psi_U: U\in\Phi\}\) in the inclusion order relation, where \(\Psi_U = \)\( \text{CountBaseUnif}(X,h,U) \). Since \(\Psi_U\) has a countable base this shows that every uniformity (that admits a halving function) is a union and a supremum of some collection of uniformities each of which has a countable base.

theorem sup_count_base_unifs:

assumes \( X\neq \emptyset \), \( \Phi \text{ is a uniformity on } X \), \( h \text{ is a halving function for } \Phi \)

shows \( \Phi = \bigcup \{ \text{CountBaseUnif}(X,h,U).\ U\in \Phi \} \), \( \Phi = \text{Supremum}( \text{OrderOnUniformities}(X),\{ \text{CountBaseUnif}(X,h,U).\ U\in \Phi \}) \)proof
let \( \mathcal{U} = \{ \text{CountBaseUnif}(X,h,U).\ U\in \Phi \} \)
show \( \Phi = \bigcup \mathcal{U} \)proof
from assms show \( \bigcup \mathcal{U} \subseteq \Phi \) using unif_count_base_unif(3)
from assms show \( \Phi \subseteq \bigcup \mathcal{U} \) using unif_count_base_unif(2)
qed
from assms have \( \mathcal{U} \neq \emptyset \) and \( \mathcal{U} \subseteq \text{Uniformities}(X) \) using uniformity_non_empty, unif_count_base_unif(1), unif_in_unifs
with assms(1,2), \( \Phi =\bigcup \mathcal{U} \) show \( \Phi = \text{Supremum}( \text{OrderOnUniformities}(X),\mathcal{U} ) \) using union_unif_sup
qed
end
lemma (in muliple_pmetric) pmetric_space_valid_in_mpm:

assumes \( d\in \mathcal{M} \)

shows \( pmetric\_space(L,A,r,d,X) \)
theorem (in rpmetric_space) metric_gauge_base:

assumes \( X\neq \emptyset \)

shows \( \mathfrak{U} \text{ is a uniform base on } X \), \( \text{Supersets}(X\times X,\mathfrak{U} ) \text{ is a uniformity on } X \), \( \text{UniformTopology}( \text{Supersets}(X\times X,\mathfrak{U} ),X) \text{ is a topology } \), \( \bigcup \text{UniformTopology}( \text{Supersets}(X\times X,\mathfrak{U} ),X) = X \)
lemma unif_in_unifs:

assumes \( \Phi \text{ is a uniformity on } X \)

shows \( \Phi \in \text{Uniformities}(X) \)
Definition of UnifFromPseudometric: \( \text{UnifFromPseudometric}(X,L,A,r,d) \equiv \text{Supersets}(X\times X, \text{UniformGauge}(X,L,A,r,d)) \)
lemma (in muliple_pmetric) each_gen_unif_unif: shows \( \mathcal{U} \subseteq \text{Uniformities}(X) \)
theorem lub_unif_sup:

assumes \( X\neq \emptyset \), \( \mathcal{U} \subseteq \text{Uniformities}(X) \), \( \mathcal{U} \neq \emptyset \)

shows \( \text{HasAsupremum}( \text{OrderOnUniformities}(X),\mathcal{U} ) \), \( \text{LUB_Unif}(X,\mathcal{U} ) = \text{Supremum}( \text{OrderOnUniformities}(X),\mathcal{U} ) \), \( \text{Supremum}( \text{OrderOnUniformities}(X),\mathcal{U} ) \text{ is a uniformity on } X \)
Definition of UnifFromPseudometrics: \( \text{UnifFromPseudometrics}(X,L,A,r,\mathcal{M} ) \equiv \text{LUB_Unif}(X,\{ \text{UnifFromPseudometric}(X,L,A,r,d).\ d\in \mathcal{M} \}) \)
lemma lub_unif_upper_bound:

assumes \( X\neq \emptyset \), \( \mathcal{U} \subseteq \text{Uniformities}(X) \), \( \Phi \in \mathcal{U} \)

shows \( \langle \Phi ,\text{LUB_Unif}(X,\mathcal{U} )\rangle \in \text{OrderOnUniformities}(X) \)
Definition of OrderOnUniformities: \( \text{OrderOnUniformities}(X) \equiv \text{InclusionOn}( \text{Uniformities}(X)) \)
Definition of InclusionOn: \( \text{InclusionOn}(X) \equiv \{p\in X\times X.\ \text{fst}(p) \subseteq \text{snd}(p)\} \)
lemma lub_unif_lub:

assumes \( X\neq \emptyset \), \( \mathcal{U} \subseteq \text{Uniformities}(X) \), \( \mathcal{U} \neq \emptyset \) and \( \forall \Phi \in \mathcal{U} .\ \langle \Phi ,\Psi \rangle \in \text{OrderOnUniformities}(X) \)

shows \( \langle \text{LUB_Unif}(X,\mathcal{U} ),\Psi \rangle \in \text{OrderOnUniformities}(X) \)
Definition of UniformGauge: \( \text{UniformGauge}(X,L,A,r,d) \equiv \{d^{-1}(\{c\in \text{Nonnegative}(L,A,r).\ \langle c,b\rangle \in r\}).\ b\in \text{PositiveSet}(L,A,r)\} \)
Definition of IsApseudoMetric: \( \text{IsApseudoMetric}(d,X,G,A,r) \equiv d:X\times X \rightarrow \text{Nonnegative}(G,A,r) \) \( \wedge (\forall x\in X.\ d\langle x,x\rangle = \text{ TheNeutralElement}(G,A))\) \( \wedge (\forall x\in X.\ \forall y\in X.\ d\langle x,y\rangle = d\langle y,x\rangle )\) \( \wedge (\forall x\in X.\ \forall y\in X.\ \forall z\in X.\ \langle d\langle x,z\rangle , A\langle d\langle x,y\rangle ,d\langle y,z\rangle \rangle \rangle \in r) \)
lemma func1_1_L3:

assumes \( f:X\rightarrow Y \)

shows \( f^{-1}(D) \subseteq X \)
lemma superset_gen:

assumes \( A\subseteq X \), \( A\in \mathcal{A} \)

shows \( A \in \text{Supersets}(X,\mathcal{A} ) \)
lemma (in muliple_pmetric) gen_unif_contains_unifs:

assumes \( \Phi \in \mathcal{U} \)

shows \( \Phi \subseteq \text{UnifFromPseudometrics}(X,L,A,r,\mathcal{M} ) \)
Definition of IsUniformity: \( \Phi \text{ is a uniformity on } X \equiv (\Phi \text{ is a filter on } (X\times X))\) \( \wedge (\forall U\in \Phi .\ id(X) \subseteq U \wedge (\exists V\in \Phi .\ V\circ V \subseteq U) \wedge converse(U) \in \Phi ) \)
lemma filter_superset_closed:

assumes \( \mathfrak{F} \text{ is a filter on } X \), \( \mathcal{A} \subseteq \mathfrak{F} \)

shows \( \text{Supersets}(X,\mathcal{A} ) \subseteq \mathfrak{F} \)
lemma (in muliple_pmetric) gen_unif_LUB:

assumes \( \Psi \text{ is a uniformity on } X \) and \( \forall \Phi \in \mathcal{U} .\ \Phi \subseteq \Psi \)

shows \( \text{UnifFromPseudometrics}(X,L,A,r,\mathcal{M} ) \subseteq \Psi \)
Definition of UniformGaugeSets: \( \text{UniformGaugeSets}(X,L,A,r,M) \equiv \) \( \{(\bigcap d\in M.\ d^{-1}(\{c\in \text{Nonnegative}(L,A,r).\ \langle c,f(d)\rangle \in r\})).\ f\in M\rightarrow \text{PositiveSet}(L,A,r)\} \)
Definition of UniformGauges: \( \text{UniformGauges}(X,L,A,r,\mathcal{M} ) \equiv \bigcup M\in \text{FinPow}(\mathcal{M} )\setminus \{\emptyset \}.\ \text{UniformGaugeSets}(X,L,A,r,M) \)
lemma (in muliple_pmetric) mgauge_def_alt: shows \( \mathfrak{B} = (\bigcup M\in \text{FinPow}(\mathcal{M} )\setminus \{\emptyset \}.\ \{(\bigcap d\in M.\ d^{-1}(\{c\in L^+.\ c\leq f(d)\})).\ f\in M\rightarrow L_+\}) \)
lemma (in pmetric_space) pmetric_properties: shows \( d: X\times X \rightarrow L^+ \), \( \forall x\in X.\ d\langle x,x\rangle = 0 \), \( \forall x\in X.\ \forall y\in X.\ d\langle x,y\rangle = d\langle y,x\rangle \), \( \forall x\in X.\ \forall y\in X.\ \forall z\in X.\ d\langle x,z\rangle \leq d\langle x,y\rangle + d\langle y,z\rangle \)
Definition of FinPow: \( \text{FinPow}(X) \equiv \{A \in Pow(X).\ Finite(A)\} \)
lemma (in muliple_pmetric) each_pmetric_map:

assumes \( M\in \text{FinPow}(\mathcal{M} ) \) and \( d\in M \)

shows \( d: X\times X \rightarrow L^+ \)
lemma func1_1_L15:

assumes \( f:X\rightarrow Y \)

shows \( f^{-1}(A) = \{x\in X.\ f(x) \in A\} \)
lemma inter_subsets_subset:

assumes \( \forall i\in I.\ P(i) \subseteq X \)

shows \( (\bigcap i\in I.\ P(i)) \subseteq X \)
lemma inter_index_mono:

assumes \( I\subseteq M \), \( I\neq \emptyset \)

shows \( (\bigcap i\in M.\ P(i)) \subseteq (\bigcap i\in I.\ P(i)) \)
lemma (in pmetric_space) uniform_gauge_mono:

assumes \( b_1\leq b_2 \)

shows \( d^{-1}(\{c\in L^+.\ c\leq b_1\}) \subseteq d^{-1}(\{c\in L^+.\ c\leq b_2\}) \)
lemma (in loop1) down_directs_directed:

assumes \( r \text{ down-directs } L_+ \)

shows \( \text{IsDownDirectedSet}(L_+,r) \)
lemma two_fun_low_bound:

assumes \( \text{IsDownDirectedSet}(Y,r) \), \( A\in \text{FinPow}(X) \), \( B\in \text{FinPow}(X) \), \( f:A\rightarrow Y \), \( g:B\rightarrow Y \)

shows \( \exists h\in A\cup B\rightarrow Y.\ (\forall x\in A.\ \langle h(x),f(x)\rangle \in r) \wedge (\forall x\in B.\ \langle h(x),g(x)\rangle \in r) \)
lemma union_finpow:

assumes \( A \in \text{FinPow}(X) \) and \( B \in \text{FinPow}(X) \)

shows \( A \cup B \in \text{FinPow}(X) \)
lemma (in muliple_pmetric) fun_inter_vimage_mono:

assumes \( M_1\subseteq \mathcal{M} \), \( M_1\subseteq M \), \( M_1\neq \emptyset \), \( f_1:M_1\rightarrow L_+ \), \( f:M\rightarrow L_+ \) and \( \forall d\in M_1.\ f(d)\leq f_1(d) \)

shows \( (\bigcap d\in M.\ d^{-1}(\{c\in L^+.\ c\leq f(d)\})) \subseteq (\bigcap d\in M_1.\ d^{-1}(\{c\in L^+.\ c\leq f_1(d)\})) \)
lemma witness_exists:

assumes \( x\in X \) and \( \phi (x) \)

shows \( \exists x\in X.\ \phi (x) \)
lemma (in pmetric_space) gauge_2nd_cond:

assumes \( B\in \mathfrak{B} \)

shows \( id(X)\subseteq B \)
lemma (in pmetric_space) gauge_symmetric:

assumes \( B\in \mathfrak{B} \)

shows \( B = converse(B) \)
lemma (in muliple_pmetric) muniform_gauge_relations:

assumes \( B\in \mathfrak{B} \)

shows \( B\subseteq X\times X \)
lemma finpow_nempty_nempty:

assumes \( X\neq \emptyset \)

shows \( \text{FinPow}(X)\setminus \{\emptyset \} \neq \emptyset \)
lemma func1_3_L1:

assumes \( c\in Y \)

shows \( \text{ConstantFunction}(X,c) : X\rightarrow Y \)
lemma (in muliple_pmetric) mgauge_finset_fun:

assumes \( M\in \text{FinPow}(\mathcal{M} ) \), \( M\neq \emptyset \), \( f:M\rightarrow L_+ \)

shows \( (\bigcap d\in M.\ d^{-1}(\{c\in L^+.\ c\leq f(d)\})) \in \mathfrak{B} \)
Definition of IsHalfable: \( \text{IsHalfable}(L,A,r) \equiv \forall b_1\in \text{PositiveSet}(L,A,r).\ \exists b_2\in \text{PositiveSet}(L,A,r).\ \langle A\langle b_2,b_2\rangle ,b_1\rangle \in r \)
lemma finite_choice_fun:

assumes \( Finite(X) \), \( \forall x\in X.\ \exists y\in Y.\ P(x,y) \)

shows \( \exists f\in X\rightarrow Y.\ \forall x\in X.\ P(x,f(x)) \)
lemma (in pmetric_space) half_vimage_square:

assumes \( b_2\in L_+ \) and \( b_2 + b_2 \leq b_1 \)

defines \( B_1 \equiv d^{-1}(\{c\in L^+.\ c\leq b_1\}) \) and \( B_2 \equiv d^{-1}(\{c\in L^+.\ c\leq b_2\}) \)

shows \( B_2\circ B_2 \subseteq B_1 \)
lemma square_incl_product:

assumes \( I\neq \emptyset \), \( \forall i\in I.\ A(i)\circ A(i) \subseteq B(i) \)

shows \( (\bigcap i\in I.\ A(i))\circ (\bigcap i\in I.\ A(i)) \subseteq (\bigcap i\in I.\ B(i)) \)
lemma (in muliple_pmetric) mgauge_1st_cond:

assumes \( B_1\in \mathfrak{B} \), \( B_2\in \mathfrak{B} \)

shows \( \exists B\in \mathfrak{B} .\ B\subseteq B_1\cap B_2 \)
lemma (in muliple_pmetric) mgauge_2nd_and_3rd_cond:

assumes \( B\in \mathfrak{B} \)

shows \( id(X)\subseteq B \), \( B = converse(B) \), \( \exists B_2\in \mathfrak{B} .\ B_2 \subseteq converse(B) \)
lemma (in muliple_pmetric) mgauge_4thCond:

assumes \( B_1\in \mathfrak{B} \)

shows \( \exists B_2\in \mathfrak{B} .\ B_2\circ B_2 \subseteq B_1 \)
lemma (in muliple_pmetric) mgauge_5thCond: shows \( \mathfrak{B} \subseteq Pow(X\times X) \)
lemma (in muliple_pmetric) mgauge_6thCond: shows \( \mathfrak{B} \neq \emptyset \)
theorem uniformity_base_is_base:

assumes \( X\neq \emptyset \) and \( \mathfrak{B} \text{ is a uniform base on } X \)

shows \( \text{Supersets}(X\times X,\mathfrak{B} ) \text{ is a uniformity on } X \)
theorem uniform_top_is_top:

assumes \( \Phi \text{ is a uniformity on } X \)

shows \( \text{UniformTopology}(\Phi ,X) \text{ is a topology } \) and \( \bigcup \text{UniformTopology}(\Phi ,X) = X \)
Definition of IsUniformityBaseOn: \( \mathfrak{B} \text{ is a uniform base on } X \equiv \) \( (\forall B_1\in \mathfrak{B} .\ \forall B_2\in \mathfrak{B} .\ \exists B_3\in \mathfrak{B} .\ B_3\subseteq B_1\cap B_2) \wedge (\forall B\in \mathfrak{B} .\ id(X)\subseteq B) \wedge \) \( (\forall B_1\in \mathfrak{B} .\ \exists B_2\in \mathfrak{B} .\ B_2 \subseteq converse(B_1)) \wedge (\forall B_1\in \mathfrak{B} .\ \exists B_2\in \mathfrak{B} .\ B_2\circ B_2 \subseteq B_1) \wedge \) \( \mathfrak{B} \subseteq Pow(X\times X) \wedge \mathfrak{B} \neq \emptyset \)
theorem indseq_seq:

assumes \( f: X\rightarrow X \) and \( x\in X \)

shows \( \text{InductiveSequence}(x,f) : nat \rightarrow X \)
theorem indseq_valat0:

assumes \( f: X\rightarrow X \) and \( x\in X \)

shows \( \text{InductiveSequence}(x,f)(0) = x \)
Definition of IsHalvingFunction: \( h \text{ is a halving function for } \Phi \equiv \) \( h:\Phi \rightarrow \Phi \wedge (\forall U\in \Phi .\ h(U) = converse(h(U)) \wedge h(U)\circ h(U) \subseteq U) \)
theorem indseq_vals:

assumes \( f: X\rightarrow X \) and \( x\in X \) and \( n \in nat \)

shows \( \text{InductiveSequence}(x,f)(succ(n)) = f( \text{InductiveSequence}(x,f)(n)) \)
lemma succ_add_one:

assumes \( n\in nat \)

shows \( n + 1 = succ(n) \), \( n + 1 \in nat \), \( \{0\} + n = succ(n) \), \( n + \{0\} = succ(n) \), \( succ(n) \in nat \), \( 0 \in n + 1 \), \( n \subseteq n + 1 \)
lemma halving_seq_start:

assumes \( U\in \Phi \), \( h \text{ is a halving function for } \Phi \)

defines \( H \equiv \text{InductiveSequence}(U,h) \)

shows \( H:nat\rightarrow \Phi \) and \( H(0) = U \)
lemma uni_domain:

assumes \( \Phi \text{ is a uniformity on } X \), \( W\in \Phi \)

shows \( W \subseteq X\times X \) and \( domain(W) = X \)
lemma refl_square_greater:

assumes \( r \subseteq X\times X \), \( id(X) \subseteq r \)

shows \( r \subseteq r\circ r \)
lemma halving_seq_halves:

assumes \( U\in \Phi \), \( h \text{ is a halving function for } \Phi \), \( n\in nat \)

defines \( H \equiv \text{InductiveSequence}(U,h) \)

shows \( H(n + 1) = converse(H(n + 1)) \) and \( H(n + 1)\circ H(n + 1) \subseteq H(n) \)
Definition of IsDecreasingSeq: \( \text{IsDecreasingSeq}(X,r,s) \equiv s:nat\rightarrow X \wedge (\forall n\in nat.\ \langle s(n + 1),s(n)\rangle \in r) \)
lemma incl_is_partorder: shows \( \text{IsPartOrder}(X, \text{InclusionOn}(X)) \)
lemma decr_seq_total:

assumes \( \text{IsPreorder}(X,r) \), \( \text{IsDecreasingSeq}(X,r,s) \)

shows \( r \text{ is total on } s(nat) \)
Definition of IsPartOrder: \( \text{IsPartOrder}(X,r) \equiv \text{refl}(X,r) \wedge \text{antisym}(r) \wedge \text{trans}(r) \)
Definition of IsPreorder: \( \text{IsPreorder}(X,r) \equiv \text{refl}(X,r) \wedge \text{trans}(r) \)
Definition of IsTotal: \( r \text{ is total on } X \equiv (\forall a\in X.\ \forall b\in X.\ \langle a,b\rangle \in r \vee \langle b,a\rangle \in r) \)
lemma halving_seq_decr:

assumes \( \Phi \text{ is a uniformity on } X \), \( U\in \Phi \), \( h \text{ is a halving function for } \Phi \)

defines \( H \equiv \text{InductiveSequence}(U,h) \)

shows \( \text{IsDecreasingSeq}(\Phi , \text{InclusionOn}(\Phi ),H) \), \( \text{InclusionOn}(\Phi ) \text{ is total on } (H(nat)) \), \( \text{InclusionOn}(\Phi ) \text{ is total on } (H(nat\setminus \{0\})) \)
lemma entourage_props:

assumes \( \Phi \text{ is a uniformity on } X \) and \( A\in \Phi \)

shows \( A \subseteq X\times X \), \( id(X) \subseteq A \), \( \exists V\in \Phi .\ V\circ V \subseteq A \), \( converse(A) \in \Phi \)
lemma func1_1_L6:

assumes \( f:X\rightarrow Y \)

shows \( f(B) \subseteq \text{range}(f) \) and \( f(B) \subseteq Y \)
lemma func_imagedef:

assumes \( f:X\rightarrow Y \) and \( A\subseteq X \)

shows \( f(A) = \{f(x).\ x \in A\} \)
lemma nat_not0_succ:

assumes \( n\in nat \), \( n\neq 0 \)

shows \( \exists m\in nat.\ n = m + 1 \)
lemma halving_seq_halves:

assumes \( U\in \Phi \), \( h \text{ is a halving function for } \Phi \), \( n\in nat \)

defines \( H \equiv \text{InductiveSequence}(U,h) \)

shows \( H(n + 1) = converse(H(n + 1)) \) and \( H(n + 1)\circ H(n + 1) \subseteq H(n) \)
lemma unif_filter:

assumes \( \Phi \text{ is a uniformity on } X \)

shows \( \Phi \text{ is a filter on } (X\times X) \)
Definition of IsFilter: \( \mathfrak{F} \text{ is a filter on } X \equiv (\emptyset \notin \mathfrak{F} ) \wedge (X\in \mathfrak{F} ) \wedge \mathfrak{F} \subseteq Pow(X) \wedge \) \( (\forall A\in \mathfrak{F} .\ \forall B\in \mathfrak{F} .\ A\cap B\in \mathfrak{F} ) \wedge (\forall B\in \mathfrak{F} .\ \forall C\in Pow(X).\ B\subseteq C \longrightarrow C\in \mathfrak{F} ) \)
lemma halving_seq_base_1st_cond:

assumes \( \Phi \text{ is a uniformity on } X \), \( U\in \Phi \), \( h \text{ is a halving function for } \Phi \)

defines \( H \equiv \text{InductiveSequence}(U,h) \)

assumes \( B_1\in H(nat\setminus \{0\}) \), \( B_2\in H(nat\setminus \{0\}) \)

shows \( \exists B\in H(nat\setminus \{0\}).\ B\subseteq B_1\cap B_2 \)
lemma halving_seq_base_2_3_4_conds:

assumes \( \Phi \text{ is a uniformity on } X \), \( U\in \Phi \), \( h \text{ is a halving function for } \Phi \)

defines \( H \equiv \text{InductiveSequence}(U,h) \)

assumes \( B\in H(nat\setminus \{0\}) \)

shows \( id(X)\subseteq B \), \( B = converse(B) \), \( \exists B_1\in H(nat\setminus \{0\}).\ B_1 \subseteq converse(B) \), \( \exists B_2\in H(nat\setminus \{0\}).\ B_2\circ B_2 \subseteq B \)
lemma halving_seq_base_5_and_6th_cond:

assumes \( \Phi \text{ is a uniformity on } X \), \( U\in \Phi \), \( h \text{ is a halving function for } \Phi \)

defines \( H \equiv \text{InductiveSequence}(U,h) \)

shows \( H(nat\setminus \{0\}) \subseteq Pow(X\times X) \) and \( H(nat\setminus \{0\}) \neq \emptyset \)
theorem halving_seq_base:

assumes \( \Phi \text{ is a uniformity on } X \), \( U\in \Phi \), \( h \text{ is a halving function for } \Phi \)

defines \( H \equiv \text{InductiveSequence}(U,h) \)

shows \( (H(nat\setminus \{0\})) \text{ is a uniform base on } X \)
Definition of CountBaseUnif: \( \text{CountBaseUnif}(X,h,U) \equiv \text{Supersets}(X\times X, \text{InductiveSequence}(U,h)(nat\setminus \{0\})) \)
lemma entourage_props:

assumes \( \Phi \text{ is a uniformity on } X \) and \( A\in \Phi \)

shows \( A \subseteq X\times X \), \( id(X) \subseteq A \), \( \exists V\in \Phi .\ V\circ V \subseteq A \), \( converse(A) \in \Phi \)
lemma halving_seq_decr:

assumes \( \Phi \text{ is a uniformity on } X \), \( U\in \Phi \), \( h \text{ is a halving function for } \Phi \)

defines \( H \equiv \text{InductiveSequence}(U,h) \)

shows \( \text{IsDecreasingSeq}(\Phi , \text{InclusionOn}(\Phi ),H) \), \( \text{InclusionOn}(\Phi ) \text{ is total on } (H(nat)) \), \( \text{InclusionOn}(\Phi ) \text{ is total on } (H(nat\setminus \{0\})) \)
lemma halving_seq_start:

assumes \( U\in \Phi \), \( h \text{ is a halving function for } \Phi \)

defines \( H \equiv \text{InductiveSequence}(U,h) \)

shows \( H:nat\rightarrow \Phi \) and \( H(0) = U \)
Definition of Supersets: \( \text{Supersets}(X,\mathcal{A} ) \equiv \{B\in Pow(X).\ \exists A\in \mathcal{A} .\ A\subseteq B\} \)
lemma unif_count_base_unif:

assumes \( X\neq \emptyset \), \( \Phi \text{ is a uniformity on } X \), \( U\in \Phi \), \( h \text{ is a halving function for } \Phi \)

shows \( \text{CountBaseUnif}(X,h,U) \text{ is a uniformity on } X \) and \( U\in \text{CountBaseUnif}(X,h,U) \), \( \text{CountBaseUnif}(X,h,U) \subseteq \Phi \)
lemma unif_count_base_unif:

assumes \( X\neq \emptyset \), \( \Phi \text{ is a uniformity on } X \), \( U\in \Phi \), \( h \text{ is a halving function for } \Phi \)

shows \( \text{CountBaseUnif}(X,h,U) \text{ is a uniformity on } X \) and \( U\in \text{CountBaseUnif}(X,h,U) \), \( \text{CountBaseUnif}(X,h,U) \subseteq \Phi \)
lemma uniformity_non_empty:

assumes \( \Phi \text{ is a uniformity on } X \)

shows \( \Phi \neq \emptyset \)
lemma unif_count_base_unif:

assumes \( X\neq \emptyset \), \( \Phi \text{ is a uniformity on } X \), \( U\in \Phi \), \( h \text{ is a halving function for } \Phi \)

shows \( \text{CountBaseUnif}(X,h,U) \text{ is a uniformity on } X \) and \( U\in \text{CountBaseUnif}(X,h,U) \), \( \text{CountBaseUnif}(X,h,U) \subseteq \Phi \)
lemma union_unif_sup:

assumes \( X\neq \emptyset \), \( \mathcal{U} \subseteq \text{Uniformities}(X) \), \( \mathcal{U} \neq \emptyset \), \( (\bigcup \mathcal{U} ) \text{ is a uniformity on } X \)

shows \( \bigcup \mathcal{U} = \text{Supremum}( \text{OrderOnUniformities}(X),\mathcal{U} ) \)