Top source

Module mathcomp.analysis.normedtype_theory.tvs

From HB Require Import structures.
From mathcomp Require Import boot order ssralg ssrnum vector.
From mathcomp Require Import interval_inference.
#[warning="-warn-library-file-internal-analysis"]
From mathcomp Require Import unstable.
From mathcomp Require Import boolp classical_sets functions cardinality.
From mathcomp Require Import convex set_interval reals topology num_normedtype.
From mathcomp Require Import pseudometric_normed_Zmodule.

# Topological vector spaces This file introduces locally convex topological vector spaces. ``` NbhsNmodule == HB class, join of Nbhs and Nmodule NbhsZmodule == HB class, join of Nbhs and Zmodule NbhsLmodule K == HB class, join of Nbhs and Lmodule over K K is a numDomainType. PreTopologicalNmodule == HB class, join of Topological and Nmodule TopologicalNmodule == HB class, PreTopologicalNmodule with a continuous addition PreTopologicalZmodule == HB class, join of Topological and Zmodule topologicalZmodType == topological abelian group TopologicalZmodule == HB class, join of TopologicalNmodule and Zmodule with a continuous opposite operator preTopologicalLmodType K == topological space and Lmodule over K K is a numDomainType The HB class is PreTopologicalLmodule. topologicalLmodType K == topologicalNmodule and Lmodule over K with a continuous scaling operation The HB class is TopologicalLmodule. PreUniformNmodule == HB class, join of Uniform and Nmodule UniformNmodule == HB class, join of Uniform and Nmodule with a uniformly continuous addition PreUniformZmodule == HB class, join of Uniform and Zmodule UniformZmodule == HB class, join of UniformNmodule and Zmodule with uniformly continuous opposite operator PreUniformLmodule K == HB class, join of Uniform and Lmodule over K K is a numDomainType. UniformLmodule K == HB class, join of UniformNmodule and Lmodule with a uniformly continuous scaling operation K is a numFieldType. convexTvsType R == interface type for a locally convex tvs on a numDomain R A convex tvs is constructed over a uniform space. The HB class is ConvexTvs. subConvexTvsType R V S == join of subTopologicalType, convexTvsType, and subLmoduleType The HB class is SubConvexTvs. Instance: in particular, it is shown that a sub-Lmodule is a sub-convex TVS. PreTopologicalLmod_isConvexTvs == factory allowing the construction of a convex tvs from an Lmodule which is also a topological space {linear_continuous E -> F} == the type of all linear and continuous functions between E and F, where E is a NbhsLmodule.type and F a NbhsZmodule.type over a numDomainType R The HB class is called LinearContinuous. The notation {linear_continuous E -> F | s} also exists. lcfun E F s == membership predicate for linear continuous functions of type E -> F with scalar operator s : K -> F -> F E and F have type convexTvsType K. This is used in particular to attach a type of lmodType to {linear_continuous E -> F | s}. lcfun_spec f == specification for membership of the linear continuous function f ``` HB instances: - The type R^o (R : numFieldType) is endowed with the structure of ConvexTvs. - The product of two Tvs is endowed with the structure of ConvexTvs. - {linear_continuous E-> F} is endowed with a lmodType structure when E and F are convexTvs.

Reserved Notation "'{' 'linear_continuous' U '->' V '|' s '}'"
  (at level 0, U at level 98, V at level 99,
   format "{ 'linear_continuous' U -> V | s }").
Reserved Notation "'{' 'linear_continuous' U '->' V '}'"
  (at level 0, U at level 98, V at level 99,
    format "{ 'linear_continuous' U -> V }").

Unset SsrOldRewriteGoalsOrder.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.

Import Order.TTheory GRing.Theory Num.Def Num.Theory.
Import numFieldTopology.Exports.

Local Open Scope classical_set_scope.
Local Open Scope ring_scope.


.
structure
Source code
Definition
Source code
NbhsLmodule
Source code
(
numDomainType
Source code
) :=
  { of Nbhs M & GRing.Lmodule K M}.

.
PreTopologicalNmodule_isTopologicalNmodule
Source code

    
PreTopologicalNmodule
Source code
M := {
  add_continuous : continuous (fun : M * M => x.1 + x.2) ;
}.

.
structure
Source code
Definition
Source code
TopologicalNmodule
Source code

  { of PreTopologicalNmodule M & PreTopologicalNmodule_isTopologicalNmodule M}.

Section TopologicalNmodule_theory.
Variable ( : topologicalType) ( : TopologicalNmodule.type) ( : set_system E).

TODO: We have observed one thing: `pseudometric_normedZmodType` is morally a `topologicalNmodule` but `topologicalNmodule` is defined later in `tvs.v` (which imports `pseudometric_normed_zmodule.v`). We think that it should be defined at the beginning of `pseudometric_normed_zmodule.v` and that `pseudometric_normedZmodType` should be defined using `topologicalNmodule`. We have realized this because of the lemmas such as `cvgD/fun_cvgD` that we needed to duplicate.
Lemma
fun_cvgD
Source code
{ : Filter U} ( : E -> F) :
  f @ U --> a -> g @ U --> b -> (f \+ g) @ U --> a + b.
Proof.
move=> fa ga.
by apply: continuous2_cvg; [exact: (add_continuous (a, b))|by []..].
Qed.

Lemma ( : Type) ( : seq I) ( : pred I)
    ( : I -> E -> F) ( : I -> F) :
  Filter U -> (forall , P i -> Ff i x @[ --> U] --> Fa i) ->
  \sum_( <- r | P i) Ff i x @[ --> U] --> \sum_( <- r| P i) Fa i.
Proof.
by move=> FF Ffa; apply: cvg_big => //; apply: add_continuous. Qed.

Lemma
sum_continuous
Source code
( : Type) ( : seq I) ( : pred I) ( : I -> E -> F) :
  (forall : I, P i -> continuous (f i)) ->
  continuous (fun : E => \sum_( <- r | P i) f i x1).
Proof.
by move=> FC0; apply: continuous_big => //; apply: add_continuous. Qed.

End TopologicalNmodule_theory.

.
TopologicalNmodule_isTopologicalZmodule
Source code

    
Topological
Source code
M & GRing.Zmodule M := {
  opp_continuous : continuous (-%R : M -> M) ;
}.

(
"topologicalZmodType"
Source code
)
.
structure
Source code
Definition
Source code
TopologicalZmodule
Source code

  { of TopologicalNmodule M & GRing.Zmodule M
        & TopologicalNmodule_isTopologicalZmodule M}.

Section TopologicalZmoduleTheory.
Variables ( : topologicalZmodType).

Lemma
sub_continuous
Source code
: continuous (fun : M * M => x.1 - x.2).
Proof.
move=> x; apply: (@continuous_comp _ _ _ (fun => (x.1, - x.2))
  (fun : M * M => x.1 + x.2)); last exact: add_continuous.
apply: cvg_pair; first exact: cvg_fst.
by apply: continuous_comp; [exact: cvg_snd|exact: opp_continuous].
Qed.

Lemma
fun_cvgN
Source code
( : topologicalZmodType) ( : set_system M) { : Filter U}
    ( : M -> F) :
  f @ U --> a -> \- f @ U --> - a.
Proof.
by move=> ?; apply: continuous_cvg => //; exact: opp_continuous. Qed.

End TopologicalZmoduleTheory.

.
PreTopologicalNmodule_isTopologicalZmodule
Source code

    
Topological
Source code
M & GRing.Zmodule M := {
  sub_continuous : continuous (fun : M * M => x.1 - x.2) ;
}.

.
builders
Source code
Context
Source code
PreTopologicalNmodule_isTopologicalZmodule
Source code
M.

Let
opp_continuous
Source code
: continuous (-%R : M -> M).
Proof.
move=> x; rewrite /continuous_at.
rewrite -(@eq_cvg _ _ _ (fun => 0 - x)); first by move=> y; exact: add0r.
rewrite -[- x]add0r.
apply: (@continuous_comp _ _ _ (fun => (0, x)) (fun : M * M => x.1 - x.2)).
  by apply: cvg_pair => /=; [exact: cvg_cst|exact: cvg_id].
exact: sub_continuous.
Qed.

Let
add_continuous
Source code
: continuous (fun : M * M => x.1 + x.2).
Proof.
move=> x; rewrite /continuous_at.
rewrite -(@eq_cvg _ _ _ (fun => x.1 - (- x.2))).
  by move=> y; rewrite opprK.
rewrite -[in x.1 + _](opprK x.2).
apply: (@continuous_comp _ _ _ (fun => (x.1, - x.2)) (fun => x.1 - x.2)).
  apply: cvg_pair; first exact: cvg_fst.
  by apply: continuous_comp; [exact: cvg_snd|exact: opp_continuous].
exact: sub_continuous.
Qed.

.
instance
Source code
Definition
Source code

  PreTopologicalNmodule_isTopologicalNmodule.Build M add_continuous.

.
instance
Source code
Definition
Source code

  TopologicalNmodule_isTopologicalZmodule.Build M opp_continuous.

..

(
"preTopologicalLmodType"
Source code
)
.
structure
Source code
Definition
Source code
PreTopologicalLmodule
Source code
(
numDomainType
Source code
) :=
  { of Topological M & GRing.Lmodule K M}.

.
TopologicalZmodule_isTopologicalLmodule
Source code
(
numDomainType
Source code
) M
    & Topological M & GRing.Lmodule R M := {
  scale_continuous : continuous (fun : R^o * M => z.1 *: z.2) ;
}.

(
"topologicalLmodType"
Source code
)
.
structure
Source code
Definition
Source code
TopologicalLmodule
Source code
(
numDomainType
Source code
) :=
  { of TopologicalZmodule M & GRing.Lmodule K M
        & TopologicalZmodule_isTopologicalLmodule K M}.

Section TopologicalLmodule_theory.
Variables ( : numFieldType) ( : topologicalType) ( : topologicalLmodType R).

Lemma
fun_cvgZ
Source code
( : set_system E) { : Filter U} ( : E -> R) ( : E -> F)
    ( : R) :
  l @ U --> r -> f @ U --> a ->
  l x *: f x @[ --> U] --> r *: a.
Proof.
by move=> *; apply: continuous2_cvg => //; exact: (scale_continuous (_, _)).
Qed.

Lemma
fun_cvgZr
Source code
( : set_system E) { : Filter U} ( : E -> F) :
  f @ U --> a -> k \*: f @ U --> k *: a.
Proof.
by apply: fun_cvgZ => //; exact: cvg_cst. Qed.

End TopologicalLmodule_theory.

.
TopologicalNmodule_isTopologicalLmodule
Source code
(
numDomainType
Source code
) M
    & Topological M & GRing.Lmodule R M := {
  scale_continuous : continuous (fun : R^o * M => z.1 *: z.2) ;
}.

.
builders
Source code
Context
Source code
TopologicalNmodule_isTopologicalLmodule
Source code
R M.

Let
opp_continuous
Source code
: continuous (-%R : M -> M).
Proof.
move=> x; rewrite /continuous_at.
rewrite -(@eq_cvg _ _ _ (fun => -1 *: x)); first by move=> y; rewrite scaleN1r.
rewrite -[- x]scaleN1r.
apply: (@continuous_comp M (R^o * M)%type M (fun => (-1, x))
  (fun => x.1 *: x.2)); last exact: scale_continuous.
by apply: (@cvg_pair _ _ _ _ (nbhs (-1 : R^o))); [exact: cvg_cst|exact: cvg_id].
Qed.

#[warning=
Source code
"-HB.no-new-instance"
Source code

.
instance
Source code
Definition
Source code

  TopologicalNmodule_isTopologicalZmodule.Build M opp_continuous.
.
instance
Source code
Definition
Source code

  TopologicalZmodule_isTopologicalLmodule.Build R M scale_continuous.

..

.
PreUniformNmodule_isUniformNmodule
Source code
PreUniformNmodule
Source code
M := {
  add_unif_continuous : unif_continuous (fun : M * M => x.1 + x.2)
}.

.
structure
Source code
Definition
Source code
UniformNmodule
Source code

  { of PreUniformNmodule M & PreUniformNmodule_isUniformNmodule M}.

.
UniformNmodule_isUniformZmodule
Source code

    
Uniform
Source code
M & GRing.Zmodule M := {
  opp_unif_continuous : unif_continuous (-%R : M -> M)
}.

.
structure
Source code
Definition
Source code
UniformZmodule
Source code

  { of UniformNmodule M & GRing.Zmodule M & UniformNmodule_isUniformZmodule M}.

.
PreUniformNmodule_isUniformZmodule
Source code

    
Uniform
Source code
M & GRing.Zmodule M := {
  sub_unif_continuous : unif_continuous (fun : M * M => x.1 - x.2)
}.

.
builders
Source code
Context
Source code
PreUniformNmodule_isUniformZmodule
Source code
M.

Lemma
opp_unif_continuous
Source code
: unif_continuous (-%R : M -> M).
Proof.
have unif : unif_continuous (fun => (0, x) : M * M).
  move=> /= U [[]] /= U1 U2 [] U1e U2e /subsetP U12.
  apply: filterS U2e => x xU2/=.
  have /U12 : ((0, 0), x) \in U1 `*` U2.
    by rewrite in_setX/= (mem_set xU2) andbT inE; exact: entourage_refl.
  by rewrite inE/= => -[[[a1 a2] [b1 b2]]]/= /[swap]-[] -> -> <-.
move=> /= U /sub_unif_continuous /unif /=.
rewrite -comp_preimage/= /comp/= /nbhs/=.
by congr entourage => /=; rewrite eqEsubset; split=> x /=; rewrite !sub0r.
Qed.

Lemma
add_unif_continuous
Source code
: unif_continuous (fun : M * M => x.1 + x.2).
Proof.
have unif: unif_continuous (fun => (x.1, -x.2) : M * M).
  move=> /= U [[]]/= U1 U2 [] U1e /opp_unif_continuous.
  rewrite /nbhs/= => U2e /subsetP U12.
  apply: (@filterS _ _ entourage_filter
      ((fun => (xy.1.1, xy.2.1, (-xy.1.2, -xy.2.2))) @^-1` (U1 `*` U2))).
    move=> /= [] [] a1 a2 [] b1 b2/= [] ab1 ab2.
    have /U12 : (a1, b1, (-a2, -b2)) \in U1 `*` U2 by rewrite !inE.
    by rewrite inE/= => [] [] [] [] c1 c2 [] d1 d2/= cd [] <- <- <- <-.
  exists (U1, ((fun : M * M => (- xy.1, - xy.2)) @^-1` U2)); first by split.
  by move=> /= [] [] a1 a2 [] b1 b2/= [] aU bU; exists (a1, b1, (a2, b2)).
move=> /= U /sub_unif_continuous/unif; rewrite /nbhs/=.
rewrite -comp_preimage/=/comp/=.
by congr entourage; rewrite eqEsubset; split=> x /=; rewrite !opprK.
Qed.

.
instance
Source code
Definition
Source code

  PreUniformNmodule_isUniformNmodule.Build M add_unif_continuous.
.
instance
Source code
Definition
Source code

  UniformNmodule_isUniformZmodule.Build M opp_unif_continuous.

..

Section UniformZmoduleTheory.
Variables ( : UniformZmodule.type).

Lemma
sub_unif_continuous
Source code
: unif_continuous (fun : M * M => x.1 - x.2).
Proof.
suff unif: unif_continuous (fun => (x.1, - x.2) : M * M).
  by move=> /= U /add_unif_continuous/unif; rewrite /nbhs/= -comp_preimage.
move=> /= U [[]]/= U1 U2 [] U1e /opp_unif_continuous.
rewrite /nbhs/= => U2e /subsetP U12.
apply: (@filterS _ _ entourage_filter
    ((fun => (xy.1.1, xy.2.1, (- xy.1.2, - xy.2.2))) @^-1` (U1 `*` U2))).
  move=> /= [] [] a1 a2 [] b1 b2/= [] ab1 ab2.
  have /U12 : (a1, b1, (-a2, -b2)) \in U1 `*` U2 by rewrite !inE.
  by rewrite inE/= => [] [] [] [] c1 c2 [] d1 d2/= cd [] <- <- <- <-.
exists (U1, ((fun : M * M => (- xy.1, - xy.2)) @^-1` U2)); first by split.
by move=> /= [] [] a1 a2 [] b1 b2/= [] aU bU; exists (a1, b1, (a2, b2)).
Qed.

End UniformZmoduleTheory.

.
structure
Source code
Definition
Source code
PreUniformLmodule
Source code
(
numDomainType
Source code
) :=
  { of Uniform M & GRing.Lmodule K M}.

.
PreUniformLmodule_isUniformLmodule
Source code
(
numFieldType
Source code
) M
    & PreUniformLmodule R M := {
  scale_unif_continuous : unif_continuous (fun : R^o * M => z.1 *: z.2) ;
}.

.
structure
Source code
Definition
Source code
UniformLmodule
Source code
(
numFieldType
Source code
) :=
  { of UniformZmodule M & GRing.Lmodule R M
        & PreUniformLmodule_isUniformLmodule R M}.

.
UniformNmodule_isUniformLmodule
Source code
(
numFieldType
Source code
) M
    & PreUniformLmodule R M := {
  scale_unif_continuous : unif_continuous (fun : R^o * M => z.1 *: z.2) ;
}.

.
builders
Source code
Context
Source code
UniformNmodule_isUniformLmodule
Source code
R M.

Lemma
opp_unif_continuous
Source code
: unif_continuous (-%R : M -> M).
Proof.
have unif: unif_continuous (fun => (-1, x) : R^o * M).
  move=> /= U [[]] /= U1 U2 [] U1e U2e /subsetP U12.
  rewrite /nbhs/=.
  apply: filterS U2e => x xU2/=.
  have /U12 : ((-1, -1), x) \in U1 `*` U2.
    rewrite in_setX/= (mem_set xU2) andbT.
    by apply/mem_set; exact: entourage_refl.
  by rewrite inE/= => [[[]]] [] a1 a2 [] b1 b2/= abU [] {2}<- <- <-/=.
move=> /= U /scale_unif_continuous/unif/=.
rewrite /nbhs/=.
rewrite -comp_preimage/=/comp/=.
by congr entourage; rewrite eqEsubset; split=> x /=; rewrite !scaleN1r.
Qed.

#[warning=
Source code
"-HB.no-new-instance"
Source code

.
instance
Source code
Definition
Source code

  UniformNmodule_isUniformZmodule.Build M opp_unif_continuous.
.
instance
Source code
Definition
Source code

  PreUniformLmodule_isUniformLmodule.Build R M scale_unif_continuous.

..

.
Uniform_isConvexTvs
Source code
(
numDomainType
Source code
) E
    & Uniform E & GRing.Lmodule R E := {
  locally_convex : exists2 : set_system E,
    (forall , b \in B -> convex_set b) & basis B
}.

(
"convexTvsType"
Source code
)
.
structure
Source code
Definition
Source code
ConvexTvs
Source code
(
numDomainType
Source code
) :=
  { of Uniform_isConvexTvs R E & Uniform E & TopologicalLmodule R E}.

(
"subConvexTvsType"
Source code
)
.
structure
Source code
Definition
Source code
SubConvexTvs
Source code
(
numDomainType
Source code
) (V : convexTvsType R)
    (S : pred V) :=
  { of SubTopological V S U & ConvexTvs R U & @GRing.SubLmodule R V S U }.

Section SubLmodule_isSubConvexTvs.
Context ( : numFieldType) ( : convexTvsType R) ( : pred V) ( : subLmodType S).

Local Notation
sub_init_topo
Source code
:= (sub_initial_topology U).
.
instance
Source code
Definition
Source code
Uniform
Source code
.on sub_init_topo.
.
instance
Source code
Definition
Source code
.Lmodule.on sub_init_topo.

Let : continuous (fun : sub_init_topo * sub_init_topo => x.1 + x.2).
Proof.
apply: continuous_comp_initial => -[/= x y].
pose h := fun : U * U => (\val xy.1, \val xy.2).
pose g := fun : V * V => xy.1 + xy.2.
rewrite (_ : _ \o _ = g \o h).
  by apply/funext => i /=; rewrite GRing.valD.
apply: continuous_comp; last exact: add_continuous.
apply: cvg_pair => //=.
- apply: (cvg_comp _ _ cvg_fst).
  exact: (continuous_valE (x : sub_init_topo)).
- apply: (cvg_comp _ _ cvg_snd).
  exact: (continuous_valE (y : sub_init_topo)).
Qed.

.
instance
Source code
Definition
Source code

  
@PreTopologicalNmodule_isTopologicalNmodule
Source code
.Build sub_init_topo add_sub.

Let : continuous (-%R : sub_init_topo -> sub_init_topo).
Proof.
apply: continuous_comp_initial => x.
rewrite (_ : _ \o _ = -%R \o \val).
  by apply/funext=> i /=; rewrite GRing.valN.
apply: continuous_comp; first exact: continuous_valE.
exact: opp_continuous.
Qed.

.
instance
Source code
Definition
Source code

  TopologicalNmodule_isTopologicalZmodule.Build sub_init_topo opp_sub.

Let
scale_sub
Source code
: continuous (fun : R^o * sub_init_topo => z.1 *: z.2).
Proof.
apply: continuous_comp_initial => - [] /= x /= y.
pose h := fun : R * U => (xy.1, \val xy.2).
pose g := fun : R * V => xy.1 *: xy.2.
rewrite (_ : _ \o _ = g \o h); first by apply/funext=> i /=; rewrite GRing.valZ.
apply: continuous_comp; last exact: scale_continuous.
move=> /= A [/= [/= B C]] [[r/= r0 xrB]].
move/(continuous_valE (y : sub_init_topo)) => [/= C' [woC' C'y C'C] BCA].
apply: filterS; first exact: BCA.
exists (ball x r, C') => /=.
  by split; [exact: nbhsx_ballx|exists C'; split].
by move=> su/= [xru C'u]; split; [exact: xrB|exact: C'C].
Qed.

.
instance
Source code
Definition
Source code

  TopologicalZmodule_isTopologicalLmodule.Build R sub_init_topo scale_sub.

Local Open Scope convex_scope.

Let
locally_convex_sub
Source code
: exists2 : set_system sub_init_topo,
  (forall , b \in B -> convex_set b) & basis B.
Proof.
have [B convexB [openB/= genB]] := @locally_convex R V.
exists [set | exists2 , B b & \val @^-1` b = a].
  move=> a /[!inE]/= -[b Bb ba] r s l ra sa.
  suff : \val (r <|l|> s) \in b by rewrite !inE /= -ba.
  rewrite !GRing.valD !GRing.valZ convexB//; first exact: mem_set.
  - by move: ra; rewrite -ba !inE.
  - by move: sa; rewrite -ba !inE.
split => /=.
  move=> a/= [b Bb <-]; rewrite /open/= /initial_open/=; exists b => //.
  exact: openB.
move=> x a [/= b [[/=c openc] cb bx ba]].
rewrite /nbhs/= /filter_from/=.
have : nbhs (val x) c.
 rewrite nbhsE /=; exists c => //; split => //.
 by move: bx; rewrite -cb.
move/genB => [d [Bd dx dc]].
exists (\val @^-1` d); first by split => //; exists d.
by move=> y dy; apply: ba; rewrite -cb; exact: dc.
Qed.

Local Close Scope convex_scope.

.
instance
Source code
Definition
Source code

  
@Uniform_isConvexTvs
Source code
.Build R sub_init_topo locally_convex_sub.
.
instance
Source code
Definition
Source code
.SubLmodule.on sub_init_topo.

End SubLmodule_isSubConvexTvs.

Section properties_of_topologicalLmodule.
Context ( : numDomainType) ( : preTopologicalLmodType R) ( : set E).

Lemma
nbhsN_subproof
Source code
( : continuous (fun : R^o * E => z.1 *: z.2)) ( : E) :
  nbhs x U -> nbhs (-x) (-%R @` U).
Proof.
move=> Ux; move: (f (-1, -x) U); rewrite /= scaleN1r opprK => /(_ Ux) [] /=.
move=> [B] B12 [B1 B2] BU; near=> y; exists (- y); rewrite ?opprK// -scaleN1r//.
apply: (BU (-1, y)); split => /=; last by near: y.
by move: B1 => [] ? ?; apply => /=; rewrite subrr normr0.
Unshelve. all: by end_near. Qed.

Lemma
nbhs0N_subproof
Source code
( : continuous (fun : R^o * E => z.1 *: z.2)) :
  nbhs 0 U -> nbhs 0 (-%R @` U).
Proof.
by move => Ux; rewrite -oppr0; exact: nbhsN_subproof. Qed.

Lemma
nbhsT_subproof
Source code
( : continuous (fun : E * E => x.1 + x.2)) ( : E) :
  nbhs 0 U -> nbhs x (+%R x @` U).
Proof.
move => U0; have /= := f (x, -x) U; rewrite subrr => /(_ U0).
move=> [B] [B1 B2] BU; near=> x0.
exists (x0 - x); last by rewrite addrC subrK.
by apply: (BU (x0, -x)); split; [near: x0; rewrite nearE|exact: nbhs_singleton].
Unshelve. all: by end_near. Qed.

Lemma
nbhsB_subproof
Source code
( : continuous (fun : E * E => x.1 + x.2)) ( : E) :
  nbhs z U -> nbhs (x + z) (+%R x @` U).
Proof.
move=> U0; have /= := f (x + z, -x) U; rewrite [x + z]addrC addrK.
move=> /(_ U0)[B] [B1 B2] BU; near=> x0.
exists (x0 - x); last by rewrite addrC subrK.
by apply: (BU (x0, -x)); split; [near: x0; rewrite nearE|exact: nbhs_singleton].
Unshelve. all: by end_near. Qed.

End properties_of_topologicalLmodule.

.
PreTopologicalLmod_isConvexTvs
Source code
(
numDomainType
Source code
) E
    & Topological E & GRing.Lmodule R E := {
  add_continuous : continuous (fun : E * E => x.1 + x.2) ;
  scale_continuous : continuous (fun : R^o * E => z.1 *: z.2) ;
  locally_convex : exists2 : set_system E,
    (forall , b \in B -> convex_set b) & basis B
  }.

.
builders
Source code
Context
Source code
PreTopologicalLmod_isConvexTvs
Source code
R E.

Definition
entourage

OpenSetDisjointItvs.lt_disjoint : forall {R : realType}, set R -> (rat -> nat) -> set rat OpenSetDisjointItvs.lt_disjoint is not universe polymorphic Arguments OpenSetDisjointItvs.lt_disjoint {R} U%_classical_set_scope f%_function_scope _ OpenSetDisjointItvs.lt_disjoint is transparent Expands to: Constant mathcomp.analysis.normedtype_theory.normed_module.OpenSetDisjointItvs.lt_disjoint Declared in library mathcomp.analysis.normedtype_theory.normed_module, line 2378, characters 11-22 OpenSetDisjointItvs.lt_disjoint_rat_seq : forall {R : realType}, set R -> (rat -> nat) -> rat -> set R OpenSetDisjointItvs.lt_disjoint_rat_seq is not universe polymorphic Arguments OpenSetDisjointItvs.lt_disjoint_rat_seq {R} U%_classical_set_scope f%_function_scope q%_ring_scope _ OpenSetDisjointItvs.lt_disjoint_rat_seq is transparent Expands to: Constant mathcomp.analysis.normedtype_theory.normed_module.OpenSetDisjointItvs.lt_disjoint_rat_seq Declared in library mathcomp.analysis.normedtype_theory.normed_module, line 2482, characters 11-30 open_disjoint_itv : forall {R : realType} [U : set R], open U -> nat -> set R open_disjoint_itv is not universe polymorphic Arguments open_disjoint_itv {R} [U]%_classical_set_scope oU _%_nat_scope _ open_disjoint_itv is transparent Expands to: Constant mathcomp.analysis.normedtype_theory.normed_module.open_disjoint_itv Declared in library mathcomp.analysis.normedtype_theory.normed_module, line 2541, characters 11-28


Source code
: set_system (E * E) :=
  fun => exists ( : set E), nbhs (0 : E) U /\
                     (forall : E * E, (xy.1 - xy.2) \in U -> xy \in P).

Let ( : set E) : nbhs (0 : E) U -> nbhs (0 : E) (-%R @` U).
Proof.

Lemma ( : set E) ( : E) : nbhs x U -> nbhs (-x) (-%R @` U).
Proof.

Let ( : set E) ( : E) : nbhs (0 : E) U -> nbhs x (+%R x @`U).
Proof.

Let ( : set E) ( : E) : nbhs z U -> nbhs (x + z) (+%R x @`U).
Proof.

Lemma
entourage_filter
Source code
: Filter entourage.
Proof.
split; first by exists [set: E]; split; first exact: filter_nbhsT.
  move=> P Q; rewrite /entourage nbhsE /=.
  move=> [U [[B B0] BU Bxy]] [V [[C C0] CV Cxy]].
  exists (U `&` V); split => [|xy].
    by exists (B `&` C); [exact: open_nbhsI|exact: setISS].
  by rewrite !in_setI => /andP[/Bxy-> /Cxy->].
by move=> P Q PQ [U [HU Hxy]]; exists U; split=> [|xy /Hxy /[!inE] /PQ].
Qed.

Local Lemma
entourage_refl
Source code
( : set (E * E)) :
  entourage A -> [set | xy.1 = xy.2] `<=` A.
Proof.
move=> [U [U0 Uxy]] xy eq_xy; apply/set_mem/Uxy; rewrite eq_xy subrr.
apply/mem_set; exact: nbhs_singleton.
Qed.

Local Lemma
entourage_inv
Source code
( : set (E * E)) :
  entourage A -> entourage A^-1%relation.
Proof.
move=> [/= U [U0 Uxy]]; exists (-%R @` U); split; first exact: nbhs0N.
move=> xy /set_mem /=; rewrite -opprB => [[yx] Uyx] /oppr_inj yxE.
by apply/Uxy/mem_set; rewrite /= -yxE.
Qed.

Local Lemma
entourage_split_ex
Source code
( : set (E * E)) : entourage A ->
  exists2 : set (E * E), entourage B & (B \; B)%relation `<=` A.
Proof.
move=> [/= U] [U0 Uxy]; rewrite /entourage /=.
have := @add_continuous (0, 0); rewrite /continuous_at/= addr0 => /(_ U U0)[]/=.
move=> [W1 W2] []; rewrite nbhsE/= => [[U1 nU1 UW1] [U2 nU2 UW2]] Wadd.
exists [set | (W1 `&` W2) (w.1 - w.2)].
  exists (W1 `&` W2); split; last by [].
  exists (U1 `&` U2); first exact: open_nbhsI.
  by move=> t [U1t U2t]; split; [exact: UW1|exact: UW2].
move => xy /= [z [H1 _] [_ H2]]; apply/set_mem/(Uxy xy)/mem_set.
rewrite [_ - _](_ : _ = (xy.1 - z) + (z - xy.2)); first by rewrite addrA subrK.
exact: (Wadd (xy.1 - z,z - xy.2)).
Qed.

Local Lemma : nbhs = nbhs_ entourage.
Proof.
have lem : -1 != 0 :> R by rewrite oppr_eq0 oner_eq0.
rewrite /nbhs_ /=; apply/funext => x; rewrite /filter_from/=.
apply/funext => U; apply/propext => /=; rewrite /entourage /=; split.
- pose V : set E := [set | x - v \in U].
  move=> nU; exists [set | xy.1 - xy.2 \in V]; last first.
    by move=> y /xsectionP; rewrite /V /= !inE /= opprB addrC subrK inE.
  exists V; split; last by move=> xy; rewrite !inE /= inE.
  have /= := nbhsB x (nbhsN nU); rewrite subrr /= /V.
  rewrite [X in nbhs _ X -> _](_ : _ = [set | x - v \in U])//.
  apply/funext => /= v /=; rewrite inE; apply/propext; split.
    by move=> [x0 [x1]] Ux1 <- <-; rewrite opprB addrC subrK.
  move=> Uxy; exists (v - x); last by rewrite addrC subrK.
  by exists (x - v); rewrite ?opprB.
- move=> [A [U0 [nU UA]] H]; near=> z; apply: H; apply/xsectionP/set_mem/UA.
  near: z; rewrite nearE; have := nbhsT x (nbhs0N nU).
  rewrite [X in nbhs _ X -> _](_ : _ = [set | x - v \in U0])//.
  apply/funext => /= z /=; apply/propext; split.
    by move=> [x0] [x1 Ux1 <-] <-; rewrite opprB addrC subrK inE.
  rewrite inE => Uxz; exists (z - x); last by rewrite addrC subrK.
  by exists (x - z); rewrite ?opprB.
Unshelve. all: by end_near. Qed.

.
instance
Source code
Definition
Source code
Nbhs_isUniform_mixin
Source code
.Build E
    entourage_filter entourage_refl
    entourage_inv entourage_split_ex
    nbhsE.


.
instance
Source code
Definition
Source code
PreTopologicalNmodule_isTopologicalNmodule
Source code
.Build E add_continuous.

.
instance
Source code
Definition
Source code
TopologicalNmodule_isTopologicalLmodule
Source code
.Build R E scale_continuous.

.
instance
Source code
Definition
Source code
Uniform_isConvexTvs
Source code
.Build R E locally_convex.

..

Section ConvexTvs_numDomain.
Context ( : numDomainType) ( : convexTvsType R) ( : set E).

Lemma : nbhs 0 U -> nbhs 0 (-%R @` U).
Proof.

Lemma ( :E) : nbhs 0 U -> nbhs x (+%R x @` U).
Proof.

Lemma ( : E) : nbhs z U -> nbhs (x + z) (+%R x @` U).
Proof.

End ConvexTvs_numDomain.

Section ConvexTvs_numField.

Lemma ( : numFieldType) ( : convexTvsType R) ( : set E) ( : R) :
  r != 0 -> nbhs 0 U -> nbhs 0 ( *:%R r @` U ).
Proof.
move=> r0 U0; have /= := scale_continuous (r^-1, 0) U.
rewrite scaler0 => /(_ U0)[]/= B [B1 B2] BU.
near=> x => //=; exists (r^-1 *: x); last by rewrite scalerA divff// scale1r.
by apply: (BU (r^-1, x)); split => //=;[exact: nbhs_singleton|near: x].
Unshelve. all: by end_near. Qed.

Lemma ( : numFieldType) ( : convexTvsType R) ( : set E) ( : R) ( :E) :
  r != 0 -> nbhs x U -> nbhs (r *:x) ( *:%R r @` U ).
Proof.
move=> r0 U0; have /= := scale_continuous ((r^-1, r *: x)) U.
rewrite scalerA mulVf// scale1r =>/(_ U0)[] /= B [B1 B2] BU.
near=> z; exists (r^-1 *: z); last by rewrite scalerA divff// scale1r.
by apply: (BU (r^-1,z)); split; [exact: nbhs_singleton|near: z].
Unshelve. all: by end_near. Qed.

End ConvexTvs_numField.

Section standard_topology.
Variable : numFieldType.

NB: we have almost the same proof in `pseudometric_normed_Zmodule.v`
Let
standard_add_continuous
Source code
: continuous (fun : R^o * R^o => x.1 + x.2).
Proof.
move=> [/= x y]; apply/cvgrPdist_lt=> _/posnumP[e]; near=> a b => /=.
by rewrite opprD addrACA normm_lt_split.
Unshelve. all: by end_near. Qed.

Let
standard_scale_continuous
Source code
: continuous (fun : R^o * R^o => z.1 *: z.2).
Proof.
move=> [/= k x]; apply/cvgrPdist_lt => _/posnumP[e]; near +oo_R => M.
near=> l z => /=; have M0 : 0 < M by [].
rewrite (@distm_lt_split _ _ (k *: z)) // -?(scalerBr, scalerBl) normrM.
  rewrite (@le_lt_trans _ _ (M * `|x - z|)) ?ler_wpM2r -?ltr_pdivlMl//.
  by near: z; apply: cvgr_dist_lt; rewrite // mulr_gt0 ?invr_gt0.
rewrite (@le_lt_trans _ _ (`|k - l| * M)) ?ler_wpM2l -?ltr_pdivlMr//.
  by near: z; near: M; exact: (@cvg_bounded _ R^o _ _ _ _ _ (@cvg_refl _ _)).
by near: l; apply: cvgr_dist_lt; rewrite // divr_gt0.
Unshelve. all: by end_near. Qed.

Local Open Scope convex_scope.

Let
standard_ball_convex_set
Source code
( : R^o) ( : R) : convex_set (ball x r).
Proof.
apply/convex_setW => z y; rewrite !inE -!ball_normE /= => zx yx l l0 l1.
rewrite inE/=.
rewrite [X in `|X|](_ : _ = (x - z : convex_lmodType _) <| l |>
                            (x - y : convex_lmodType _)).
  by rewrite opprD -[in LHS](convmm l x) addrACA -scalerBr -scalerBr.
rewrite (le_lt_trans (ler_normD _ _))// !normrM.
rewrite (@ger0_norm _ l%:num)// (@ger0_norm _ l%:num.~) ?onem_ge0//.
rewrite -[ltRHS]mul1r -(add_onemK l%:num) [ltRHS]mulrDl.
by rewrite ltrD// ltr_pM2l// onem_gt0.
Qed.

Let
standard_locally_convex_set
Source code
:
  exists2 : set_system R^o, (forall , b \in B -> convex_set b) & basis B.
Proof.
exists [set | exists , B = ball x r].
  by move=> B/= /[!inE]/= [[x]] [r] ->; exact: standard_ball_convex_set.
split; first by move=> B [x] [r] ->; exact: ball_open.
move=> x B; rewrite -nbhs_ballE/= => -[r] r0 Bxr /=.
by exists (ball x r) => //=; split; [exists x, r|exact: ballxx].
Qed.

.
instance
Source code
Definition
Source code

  PreTopologicalNmodule_isTopologicalNmodule.Build R^o standard_add_continuous.
.
instance
Source code
Definition
Source code

  TopologicalNmodule_isTopologicalLmodule.Build R R^o standard_scale_continuous.
.
instance
Source code
Definition
Source code

  Uniform_isConvexTvs.Build R R^o standard_locally_convex_set.

End standard_topology.

Section prod_ConvexTvs.
Context ( : numFieldType) ( : convexTvsType K).

Local Lemma
prod_add_continuous
Source code
:
  continuous (fun : (E * F) * (E * F) => x.1 + x.2).
Proof.
move => [/= xy1 xy2] /= U /= [] [A B] /= [nA nB] nU.
have [/= A0 [A01 A02] nA1] := @add_continuous E (xy1.1, xy2.1) _ nA.
have [/= B0 [B01 B02] nB1] := @add_continuous F (xy1.2, xy2.2) _ nB.
exists ([set | A0.1 xy.1 /\ B0.1 xy.2], [set | A0.2 xy.1 /\ B0.2 xy.2]).
  by split; [exists (A0.1, B0.1)|exists (A0.2, B0.2)].
move => [[x1 y1][x2 y2]] /= [] [] a1 b1 [] a2 b2.
by apply: nU; split; [exact: (nA1 (x1, x2))|exact: (nB1 (y1, y2))].
Qed.

Local Lemma
prod_scale_continuous
Source code
:
  continuous (fun : K^o * (E * F) => z.1 *: z.2).
Proof.
move => [/= r [x y]] /= U /= []/= [A B] /= [nA nB] nU.
have [/= A0 [A01 A02] nA1] := @scale_continuous K E (r, x) _ nA.
have [/= B0 [B01 B02] nB1] := @scale_continuous K F (r, y) _ nB .
exists (A0.1 `&` B0.1, A0.2 `*` B0.2).
  by split; [exact: filterI|exists (A0.2,B0.2)].
by move=> [l [e f]] /= [] [Al Bl] [] Ae Be; apply: nU; split;
  [exact: (nA1 (l, e))|exact: (nB1 (l, f))].
Qed.

Local Lemma
prod_locally_convex
Source code
:
  exists2 : set_system (E * F), (forall , b \in B -> convex_set b) & basis B.
Proof.
have [Be Bcb Beb] := @locally_convex K E.
have [Bf Bcf Bfb] := @locally_convex K F.
pose B := [set : set (E * F) | open ef /\
  exists , exists2 , Be be & Bf bf /\ be `*` bf = ef].
have : basis B.
  rewrite /basis/=; split; first by move=> b => [] [].
  move=> /= [x y] ef [[ne nf]] /= [Ne Nf] Nef.
  case: Beb => Beo /(_ x ne Ne) /= -[a] [] Bea ax ea.
  case: Bfb => Bfo /(_ y nf Nf) /= -[b] [] Beb yb fb.
  exists [set | a z.1 /\ b z.2]; last first.
    by apply: subset_trans Nef => -[zx zy] /= [] /ea + /fb.
  split=> //=; split; last by exists a, b.
  rewrite openE => [[z z'] /= [az bz]]; exists (a, b) => /=; last by [].
  rewrite !nbhsE /=; split; first by exists a => //; split => //; exact: Beo.
  by exists b => //; split => // []; exact: Bfo.
exists B => // => b; rewrite inE /= => [[]] bo [] be [] bf Bee [] Bff <-.
move => [x1 y1] [x2 y2] l /[!inE] /= -[xe1 yf1] [xe2 yf2].
split.
  by apply/set_mem/Bcb; [exact/mem_set|exact/mem_set|exact/mem_set].
by apply/set_mem/Bcf; [exact/mem_set|exact/mem_set|exact/mem_set].
Qed.

.
instance
Source code
Definition
Source code
PreTopologicalNmodule_isTopologicalNmodule
Source code
.Build
  (E * F)%type prod_add_continuous.
.
instance
Source code
Definition
Source code
TopologicalNmodule_isTopologicalLmodule
Source code
.Build
  K (E * F)%type prod_scale_continuous.
.
instance
Source code
Definition
Source code

  Uniform_isConvexTvs.Build K (E * F)%type prod_locally_convex.

End prod_ConvexTvs.

.
structure
Source code
Definition
Source code
LinearContinuous
Source code
(
numDomainType
Source code
) (E : NbhsLmodule.type K)
  (F : NbhsZmodule.type) (s : K -> F -> F) :=
  { of @GRing.Linear K E F s f & @Continuous E F f }.

.
Structure
Source code
isLinearContinuous
Source code
(
numDomainType
Source code
) (E : NbhsLmodule.type K)
  (F : NbhsZmodule.type) (s : GRing.Scale.law K F) (f : E -> F) := {
    linearP : linear_for s f ;
    continuousP : continuous f
  }.

.
builders
Source code
Context
Source code
@isLinearContinuous
Source code
K E F s f.

.
instance
Source code
Definition
Source code
.isLinear.Build K E F s f linearP.
.
instance
Source code
Definition
Source code
isContinuous
Source code
.Build E F f continuousP.

..

Section lcfun_pred.
Context { : numDomainType} { : NbhsLmodule.type K} { : NbhsZmodule.type}
  { : K -> F -> F}.

Definition
lcfun

max_space : forall [R : realType], vectType R -> Type max_space is not universe polymorphic Arguments max_space [R] V max_space is transparent Expands to: Constant mathcomp.analysis.normedtype_theory.normed_module.max_space Declared in library mathcomp.analysis.normedtype_theory.normed_module, line 2567, characters 11-20


Source code
: {pred E -> F} :=
  mem [set | linear_for s f /\ continuous f ].

Definition
lcfun_key
Source code
: pred_key lcfun
Proof.
exact. Qed.

Canonical
lcfun_keyed
Source code
:= KeyedPred lcfun_key.

End lcfun_pred.

Notation
"{ 'linear_continuous' U -> V | s }"
Source code
:=
  (@LinearContinuous.type _ U%type V%type s) : type_scope.
Notation
"{ 'linear_continuous' U -> V }"
Source code
:=
  {linear_continuous U%type -> V%type | *:%R} : type_scope.

Section lcfun.
Context { : numDomainType} { : NbhsLmodule.type R}
  { : NbhsZmodule.type} { : GRing.Scale.law R F}.

Notation := {linear_continuous E -> F | s}.

Notation := (@lcfun _ E F s).

Section Sub.
Context ( : E -> F) ( : f \in lcfun).

#[local] Definition
lcfun_Sub_subproof
Source code
:=
  @isLinearContinuous.Build _ E F s f (proj1 (set_mem fP)) (proj2 (set_mem fP)).

#[local]
Source code
.
instance
Source code
Definition
Source code
lcfun_Sub_subproof
Source code
.

Definition
lcfun_Sub
Source code
: {linear_continuous _ -> _ | _ } := f.

End Sub.

Let
lcfun_rect
Source code
( : T -> Type) :
  (forall ( : f \in lcfun), K (lcfun_Sub Pf)) -> forall : T, K u.
Proof.
move=> Ksub [f [[Pf1] [Pf2] [Pf3]]].
set G := (G in K G).
have Pf : f \in lcfun.
  by rewrite inE /=; split => // x u v; rewrite Pf1 Pf2.
suff -> : G = lcfun_Sub Pf by apply: Ksub.
rewrite {}/G.
congr (LinearContinuous.Pack (LinearContinuous.Class _ _ _)).
- by congr GRing.isNmodMorphism.Axioms_; exact: Prop_irrelevance.
- by congr GRing.isScalable.Axioms_; exact: Prop_irrelevance.
- by congr isContinuous.Axioms_; exact: Prop_irrelevance.
Qed.

Let
lcfun_valP
Source code
( : f \in lcfun) : lcfun_Sub Pf = f :> (_ -> _).
Proof.
by []. Qed.

.
instance
Source code
Definition
Source code
.Build _ _ T lcfun_rect lcfun_valP.

Lemma
lcfun_eqP
Source code
( : {linear_continuous E -> F | s}) : f = g <-> f =1 g.
Proof.
by split=> [->//|fg]; exact/val_inj/funext. Qed.

.
instance
Source code
Definition
Source code
[Choice
Source code
of {linear_continuous E -> F | s} by <:].

Variant
lcfun_spec
Source code
( : E -> F) : (E -> F) -> bool -> Type :=
| ( : {linear_continuous E -> F | s}) : lcfun_spec f l true.

Lemma ( : E -> F) : f \in lcfun -> lcfun_spec f f (f \in lcfun).
Proof.
move=> /[dup] f_lc ->.
have {2}-> : f = lcfun_Sub f_lc by rewrite lcfun_valP.
by constructor.
Qed.

End lcfun.

Section lcfun_comp.
Context { : numDomainType} { : NbhsLmodule.type R}
  { : NbhsZmodule.type} { : GRing.Scale.law R S}
  ( : {linear_continuous E -> F}) ( : {linear_continuous F -> S | s}).

#[local] Lemma
lcfun_comp_subproof1
Source code
: linear_for s (g \o f).
Proof.
by move=> *; move=> *; rewrite !linearP. Qed.

#[local] Lemma
lcfun_comp_subproof2
Source code
: continuous (g \o f).
Proof.
by move=> x; apply: continuous_comp; exact/continuous_fun. Qed.

.
instance
Source code
Definition
Source code
@isLinearContinuous
Source code
.Build R E S s (g \o f)
  lcfun_comp_subproof1 lcfun_comp_subproof2.

End lcfun_comp.

Section lcfun_lmodtype.
Import GRing.Theory.
Context { : numFieldType} { : convexTvsType R}.
Implicit Types (r : R) (f g : {linear_continuous E -> F}).

Lemma
null_fun_continuous
Source code
: continuous (\0 : E -> F).
Proof.
by apply: cst_continuous. Qed.

.
instance
Source code
Definition
Source code
isContinuous
Source code
.Build E F \0 null_fun_continuous.

#[local] Lemma
lcfun_continuousD
Source code
: continuous (f \+ g).
Proof.
by move=> /= x; apply: fun_cvgD; exact: continuous_fun. Qed.

.
instance
Source code
Definition
Source code

  isContinuous.Build E F (f \+ g) (@lcfun_continuousD f g).

#[local] Lemma
lcfun_continuousN
Source code
: continuous (\- f).
Proof.
by move=> /= x; apply: fun_cvgN; exact: continuous_fun. Qed.

.
instance
Source code
Definition
Source code

  isContinuous.Build E F (\- f) (@lcfun_continuousN f).

#[local] Lemma
lcfun_continuousM
Source code
: continuous (r \*: g).
Proof.
by move=> /= x; apply: fun_cvgZr; exact: continuous_fun. Qed.

.
instance
Source code
Definition
Source code

  isContinuous.Build E F (r \*: g) (@lcfun_continuousM r g).

#[local] Lemma
lcfun_submod_closed
Source code
: submod_closed (@lcfun R E F *:%R).
Proof.
split; first by rewrite inE; split; first apply/linearP; exact: cst_continuous.
move=> r /= _ _ /lcfunP[f] /lcfunP[g].
by rewrite inE /=; split; [exact: linearP | exact: lcfun_continuousD].
Qed.

.
instance
Source code
Definition
Source code

  .isSubmodClosed.Build _ _ lcfun lcfun_submod_closed.

.
instance
Source code
Definition
Source code

  [SubChoice_isSubLmodule of {linear_continuous E -> F } by <:].

End lcfun_lmodtype.

Section lcfunproperties.
Context { : numDomainType} { : NbhsLmodule.type R}
  ( : {linear_continuous E -> F}).

#[warn(note="Consider using `continuous_fun` instead.",cats="discoverability")]
Lemma
lcfun_continuous
Source code
: continuous f.
Proof.
exact: continuous_fun. Qed.

#[warn(note="Consider using `linearP` instead.",cats="discoverability")]
Lemma
lcfun_linear
Source code
: linear f.
Proof.
move => *; exact: linearP. Qed.

End lcfunproperties.