Module mathcomp.analysis.topology_theory.uniform_metrizable
From HB Require Import structures.From mathcomp Require Import boot order algebra interval_inference finmap.
From mathcomp Require Import boolp classical_sets functions wochoice.
From mathcomp Require Import cardinality fsbigop set_interval filter reals.
From mathcomp Require Import topology_structure uniform_structure
pseudometric_structure supremum_topology.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Import Order.TTheory GRing.Theory Num.Theory.
Local Open Scope classical_set_scope.
Local Open Scope ring_scope.
Local Open Scope relation_scope.
Context {RSource code : archiRealFieldType} {dSource code} {TSource code : uniformType d}.
Hypothesis cnt_unifSource code : @countable_uniformity _ T.
Let f_Source code := projT1 (cid2 (iffLR countable_uniformityP cnt_unif)).
Local Lemma countableBaseSource code : forall ASource code, entourage A -> exists NSource code, f_ N `<=` A.
Proof.
Let entFSource code : forall nSource code, entourage (f_ n).
Proof.
Local Fixpoint g_
countable_uniform.g_ not a defined object.
Source code nSource code : set (T * T) :=
if n is n.+1 then let WSource code := split_ent (split_ent (g_ n)) `&` f_ n in W `&` W^-1
else [set: T*T].
Let entGSource code nSource code : entourage (g_ n).
Proof.
by move=> n entg; apply/entourage_invI; exact: filterI.
Qed.
Local Lemma symGSource code nSource code : (g_ n)^-1 = g_ n.
Local Lemma descendG1Source code nSource code : g_ n.+1 `<=` g_ n.
Proof.
by apply: split_ent_subset; exact: entourage_split_ent.
by apply: subset_trans; last exact: split_ent_subset.
Qed.
Local Lemma descendGSource code nSource code mSource code : (m <= n)%N -> g_ n `<=` g_ m.
Proof.
Local Lemma splitG3Source code nSource code : g_ n.+1 \; g_ n.+1 \; g_ n.+1 `<=` g_ n.
Proof.
apply: subset_trans; last exact: subset_split_ent (entG n).
apply: set_compose_subset (g2split); rewrite -[_ n.+1]set_compose_diag.
apply: subset_trans g2split; apply: set_compose_subset => //.
by move=> [_ _] [z _] [<- <-]; exact: entourage_refl.
apply: subset_trans; last exact: subset_split_ent.
by apply: set_compose_subset; apply: subIset; left; apply: subIset; left.
Qed.
Local Lemma gsubfSource code nSource code : g_ n.+1 `<=` f_ n.
Local Lemma countableBaseGSource code ASource code : entourage A -> exists NSource code, g_ N `<=` A.
Proof.
Local Definition distN
countable_uniform.distN not a defined object.
Source code (eSource code : R) : nat := Num.truncn e^-1.
Local Lemma distN0Source code : distN 0 = 0%N.
Local Lemma distN_natSource code (nSource code : nat) : distN n%:R^-1 = n.
Local Lemma distN_leSource code e1Source code e2Source code : e1 > 0 -> e1 <= e2 -> (distN e2 <= distN e1)%N.
Proof.
Local Fixpoint n_step_ball
countable_uniform.n_step_ball not a defined object.
Source code nSource code xSource code eSource code zSource code :=
if n is n.+1 then exists ySource code d1Source code d2Source code,
[/\ n_step_ball n x d1 y,
0 < d1,
0 < d2,
g_ (distN d2) (y, z) &
d1 + d2 = e]
else e > 0 /\ g_ (distN e) (x, z).
Local Definition step_ball
countable_uniform.step_ball not a defined object.
Source code xSource code eSource code zSource code := exists iSource code, (n_step_ball i x e z).
Local Lemma n_step_ball_posSource code nSource code xSource code eSource code zSource code : n_step_ball n x e z -> 0 < e.
Proof.
Local Lemma step_ball_posSource code xSource code eSource code zSource code : step_ball x e z -> 0 < e.
Proof.
Local Lemma entourage_nballSource code eSource code :
0 < e -> entourage [set xySource code | step_ball xy.1 e xy.2].
Local Lemma n_step_ball_centerSource code xSource code eSource code : 0 < e -> n_step_ball 0 x e x.
Proof.
Local Lemma step_ball_centerSource code xSource code eSource code : 0 < e -> step_ball x e x.
Proof.
Local Lemma n_step_ball_triangleSource code nSource code mSource code xSource code ySource code zSource code d1Source code d2Source code :
n_step_ball n x d1 y ->
n_step_ball m y d2 z ->
n_step_ball (n + m).+1 x (d1 + d2) z.
Proof.
by exists y, d1, d2; split; rewrite ?addn0 // (n_step_ball_pos Nxy).
move=> [w] [e1] [e2] [Oyw ? ? ? <-].
exists w, (d1 + e1), e2; rewrite addnS addrA.
split => //; last by rewrite addr_gt0//; exact: n_step_ball_pos Oxy.
by case: (IH m w e1 Oxy Oyw) => t [e3] [e4] [] Oxt ? ? ? <-; exists t, e3, e4.
Qed.
Local Lemma step_ball_triangleSource code xSource code ySource code zSource code d1Source code d2Source code :
step_ball x d1 y -> step_ball y d2 z -> step_ball x (d1 + d2) z.
Proof.
Local Lemma n_step_ball_symSource code nSource code xSource code ySource code eSource code :
n_step_ball n x e y -> n_step_ball n y e x.
Proof.
move=> n IH x y e [t] [d1] [d2] [] /IH Oty ? ?.
rewrite addrC -symG -[n]add0n => gty <-; apply: (n_step_ball_triangle _ Oty).
by split => //; exact: gty.
Qed.
Local Lemma step_ball_symSource code xSource code ySource code eSource code : step_ball x e y -> step_ball y e x.
Proof.
Local Lemma n_step_ball_leSource code nSource code xSource code e1Source code e2Source code :
e1 <= e2 -> n_step_ball n x e1 `<=` n_step_ball n x e2.
Proof.
move=> x e1 e2 e1e2 y [?] gxy; split; first exact: lt_le_trans e1e2.
by apply: descendG gxy; exact: distN_le.
move=> n IH x e1 e2 e1e2 z [y] [d1] [d2] [] /IH P d1pos d2pos gyz d1d2e1.
exists y, (e2 - d2), d2; split => //.
- by apply: P; rewrite lerBrDr d1d2e1.
- by rewrite (lt_le_trans d1pos)// lerBrDr d1d2e1.
- by rewrite subrK.
Qed.
Local Lemma step_ball_leSource code xSource code e1Source code e2Source code :
e1 <= e2 -> step_ball x e1 `<=` step_ball x e2.
Proof.
Local Open Scope ring_scope.
Local Lemma distN_halfSource code (nSource code : nat) : n.+1%:R^-1 / (2:R) <= n.+2%:R^-1.
Proof.
Local Lemma split_n_step_ballSource code nSource code xSource code e1Source code e2Source code zSource code :
0 < e1 -> 0 < e2 -> n_step_ball n.+1 x (e1 + e2) z ->
exists t1Source code t2Source code aSource code bSource code,
[/\
n_step_ball a x e1 t1,
n_step_ball 0 t1 (e1 + e2) t2,
n_step_ball b t2 e2 z &
(a + b = n)%N
].
Proof.
move=> e1 e2 x z e1pos e2pos [y] [d1] [d2] [] Oxy ? ? gd2yz deE.
have [e1d1|e1d1] := leP e1 d1.
exists x, y, 0%N, 0%N; split.
- exact: n_step_ball_center.
- apply: n_step_ball_le; last exact: Oxy.
by rewrite -deE lerDl; apply: ltW.
- by apply: (@n_step_ball_le _ _ d2); rewrite // -(lerD2l e1) -deE lerD.
- by rewrite addn0.
exists y, z, 0%N, 0%N; split.
- by apply: n_step_ball_le; last (exact: Oxy); exact: ltW.
- by apply: (@n_step_ball_le _ _ d2); rewrite // -deE lerDr ltW.
- exact: n_step_ball_center.
- by rewrite addn0.
move=> n IH e1 e2 x z e1pos e2pos [y] [d1] [d2] [] Od1xy d1pos d2pos gd2yz deE.
have [e2d2|d2lee2] := leP e2 d2.
exists y, z, n.+1, 0%N; split.
- by apply: (@n_step_ball_le _ _ d1); rewrite // -(lerD2r e2) -deE lerD.
- by apply: (@n_step_ball_le _ _ d2); rewrite // -deE lerDr; exact: ltW.
- exact: n_step_ball_center.
- by rewrite addn0.
have d1E' : d1 = e1 + (e2 - d2) by rewrite addrA -deE addrK.
case: (IH e1 (e2 - d2) x y); rewrite ?subr_gt0 // -d1E' //.
move=> t1 [t2] [c1] [c2] [] Oxy1 gt1t2 t2y <-.
exists t1, t2, c1, c2.+1; split => //.
- by apply: (@n_step_ball_le _ _ d1); rewrite -?deE // ?lerDl; exact: ltW.
- by exists y, (e2 - d2), d2; rewrite // ?subr_gt0// subrK.
- by rewrite addnS.
Qed.
Local Lemma n_step_ball_le_gSource code xSource code nSource code :
n_step_ball 0 x n%:R^-1 `<=` [set ySource code | g_ n (x,y)].
Proof.
Local Lemma subset_n_step_ballSource code nSource code xSource code NSource code :
n_step_ball n x N.+1%:R^-1 `<=` [set ySource code | (g_ N) (x, y)].
Proof.
rewrite leqn0 => /eqP -> N x; apply: subset_trans.
exact: n_step_ball_le_g.
by move=> y ?; exact: descendG.
move=> IH1 + + N x1 x4; case.
by move=> ? [?] P; apply: descendG _ P; rewrite distN_nat.
move=> l ln1 Ox1x4.
case: (@split_n_step_ball l x1 (N.+1%:R^-1/2) (N.+1%:R^-1/2) x4) => //.
by rewrite -splitr.
move=> x2 [x3] [l1] [l2] [] P1 [? +] P3 l1l2; rewrite -splitr distN_nat => ?.
have l1n : (l1 <= n)%N by rewrite (leq_trans (leq_addr l2 l1))// l1l2 -ltnS.
have l2n : (l2 <= n)%N by rewrite (leq_trans (leq_addl l1 l2))// l1l2 -ltnS.
apply: splitG3; exists x3; [exists x2 => //|].
by move/(n_step_ball_le (distN_half N))/(IH1 _ l1n) : P1.
by move/(n_step_ball_le (distN_half N))/(IH1 _ l2n) : P3.
Qed.
Local Lemma subset_step_ballSource code xSource code NSource code :
step_ball x N.+1%:R^-1 `<=` [set ySource code | (g_ N) (x, y)].
Proof.
Local Lemma step_ball_entourageSource code : entourage = entourage_ step_ball.
Proof.
by case=> e /= epos /filterS; apply; exact: entourage_nball.
move=> entE; have [N fN] := countableBase entE.
exists N.+2%:R^-1; first by rewrite /= invr_gt0.
apply: subset_trans fN; apply: subset_trans; last exact: gsubf.
by case=> x y /= N1ball; exact: (@subset_step_ball x N.+1).
Qed.
Definition type
countable_uniform.type : forall {d : filter.filter_display} {T : uniformType d}, countable_uniformity T -> Type countable_uniform.type is not universe polymorphic Arguments countable_uniform.type {d}%_fdisp_scope {T} cnt_unif countable_uniform.type is transparent Expands to: Constant mathcomp.analysis.topology_theory.uniform_metrizable.countable_uniform.type Declared in library mathcomp.analysis.topology_theory.uniform_metrizable, line 324, characters 11-15
Source code : Type := let _ := countableBase in let _ := entF in T.
#[export]Source code HBSource code.instanceSource code DefinitionSource code _Source code :=Source code UniformSource code.on type.
#[export]Source code HBSource code.instanceSource code DefinitionSource code _Source code :=Source code Uniform_isPseudoMetricSource code.Build d R type
step_ball_center step_ball_sym step_ball_triangle step_ball_entourage.
#[export]Source code HBSource code.instanceSource code DefinitionSource code _Source code {qSource code :Source code PointedSource code T} :=
Pointed.copy type (Pointed.Pack q).
Lemma countable_uniform_boundedUsed by
- mathcomp.analysis.normedtype_theory.urysohn
Source code (xSource code ySource code : T) : @ball _ _ type x 2 y.
Proof.
End countable_uniform.
End countable_uniform.
Notation countable_uniformSource code := countable_uniform.type.
Definition sup_pseudometric
sup_pseudometric : forall [Ii : Type] [d : Ii -> filter.filter_display] [R : archiRealFieldType] [T : Type], (forall i : Ii, PseudoMetric.axioms_ (d i) R T) -> countable (T:=Ii) [set: Ii] -> Type sup_pseudometric is not universe polymorphic Arguments sup_pseudometric [Ii]%_type_scope [d]%_function_scope [R] [T]%_type_scope Tc%_function_scope Icnt sup_pseudometric is transparent Expands to: Constant mathcomp.analysis.topology_theory.uniform_metrizable.sup_pseudometric Declared in library mathcomp.analysis.topology_theory.uniform_metrizable, line 347, characters 11-27
Used by
- mathcomp.analysis.topology_theory.function_spaces
Source code (IiSource code : Type) (dSource code : Ii -> _) (RSource code : archiRealFieldType)
(TSource code : Type) (TcSource code : forall iSource code, PseudoMetric (d i) R T)
(IcntSource code : countable [set: Ii]) : Type := T.
Context {IiSource code : Type} {dSource code : Ii -> _} {RSource code : archiRealFieldType} {TSource code : choiceType}
(TcSource code : forall iSource code, PseudoMetric (d i) R T).
Hypothesis IcntSource code : countable [set: Ii].
Local Notation SSource code := (sup_pseudometric Tc Icnt).
Let TSSource code := fun iSource code => PseudoMetric.Pack (Tc i).
Let countable_uniformityTSource code := @countable_sup_ent Ii d T Tc Icnt
(fun iSource code => @countable_uniformity_metric _ _ (TS i)).
HBSource code.instanceSource code DefinitionSource code _Source code :Source code PseudoMetricSource code _ R S :=
PseudoMetric.on (countable_uniform countable_uniformityT).
End sup_pseudometric.
Local Open Scope relation_scope.
Let split_symSource code {dSource code} {TSource code : uniformType d} (WSource code : set (T * T)) :=
(split_ent W) `&` (split_ent W)^-1.
Context {dSource code} {TSource code : uniformType d} (ESource code : set (T * T)) (entESource code : entourage E).
Definition gauge
gauge.gauge : forall {d : filter.filter_display} {T : uniformType d}, set (T * T) -> set_system (T * T) gauge.gauge is not universe polymorphic Arguments gauge.gauge {d}%_fdisp_scope {T} E%_classical_set_scope _ gauge.gauge is transparent Expands to: Constant mathcomp.analysis.topology_theory.uniform_metrizable.gauge.gauge Declared in library mathcomp.analysis.topology_theory.uniform_metrizable, line 379, characters 11-16
Source code :=
filter_from [set: nat] (fun nSource code => iter n split_sym (E `&` E^-1)).
Lemma iter_split_entSource code jSource code : entourage (iter j split_sym (E `&` E^-1)).
Proof.
Lemma gauge_entUsed by
- mathcomp.analysis.normedtype_theory.urysohn
Source code ASource code : gauge A -> entourage A.
Proof.
by move=> n ? A _ /filterS; apply; apply: filterI; have ? := iter_split_ent n.
Qed.
Lemma gauge_filterSource code : Filter gauge.
Proof.
move=> i j _ _; wlog ilej : i j / (i <= j)%N.
by move=> WH; have [|/ltnW] := leqP i j;
[|rewrite (setIC (iter _ _ _))]; exact: WH.
exists j => //; rewrite subsetI; split => //; elim: j i ilej => [i|j IH i].
by rewrite leqn0 => /eqP ->.
rewrite leq_eqVlt => /predU1P[<-//|/ltnSE/IH]; apply: subset_trans.
by move=> x/= [jx _]; apply: split_ent_subset => //; exact: iter_split_ent.
Qed.
Lemma gauge_reflSource code ASource code : gauge A -> diagonal `<=` A.
Proof.
by apply: entourage_refl; exact: iter_split_ent.
Qed.
Lemma gauge_invSource code ASource code : gauge A -> gauge A^-1.
Proof.
Lemma gauge_splitSource code ASource code : gauge A -> exists2 BSource code, gauge B & B \; B `<=` A.
Proof.
apply: subset_trans EA; apply: subset_trans; first last.
by apply: subset_split_ent; exact: iter_split_ent.
by case=> a c [b] [] ? ? [] ? ?; exists b.
Qed.
Let gaugedSource code : Type := T.
HBSource code.instanceSource code DefinitionSource code _Source code :=Source code ChoiceSource code.on gauged.
HBSource code.instanceSource code DefinitionSource code _Source code :=Source code
@isUniformSource code.Build default_fdisp
gauged gauge gauge_filter gauge_refl gauge_inv gauge_split.
Lemma gauge_countable_uniformitySource code : countable_uniformity gauged.
Proof.
Definition type
gauge.type : forall {d : filter.filter_display} {T : uniformType d} [E : set (T * T)], entourage E -> Type gauge.type is not universe polymorphic Arguments gauge.type {d}%_fdisp_scope {T} [E]%_classical_set_scope entE gauge.type is transparent Expands to: Constant mathcomp.analysis.topology_theory.uniform_metrizable.gauge.type Declared in library mathcomp.analysis.topology_theory.uniform_metrizable, line 439, characters 11-15
Used by
- mathcomp.analysis.normedtype_theory.urysohn
Source code := countable_uniform.type gauge_countable_uniformity.
End entourage_gauge.
End gauge.
Lemma uniform_pseudometric_supSource code {dSource code} {RSource code : archiRealFieldType} {TSource code : puniformType d} :
@entourage _ T =
@sup_ent {ESource code : set (T * T) | @entourage _ T E} _ _
(fun eSource code => Uniform.class (@gauge.type _ T (projT1 e) (projT2 e))).
Proof.
exists E => //=.
pose pe : {classic {E0Source code : set (T * T) | _}} * _ := (exist _ E entE, E).
have entPE : `[< @entourage _ (gauge.type entE) E >].
by apply/asboolP; exists 0%N => // ? [].
exists (fset1 (exist _ pe entPE)) => //=; first by move=> ?; rewrite in_setE.
by rewrite set_fset1 bigcap_set1.
case=> W /= [/= J] _ <- /filterS; apply; apply: filter_bigI => -[] [] [] /= D.
move=> entD G /[dup] /asboolP [n _ + _ _] => /filterS; apply.
exact: gauge.iter_split_ent.
Qed.