Module mathcomp.analysis.topology_theory.num_topology
From HB Require Import structures.From mathcomp Require Import boot order algebra all_classical.
From mathcomp Require Import interval_inference reals topology_structure.
From mathcomp Require Import uniform_structure pseudometric_structure.
From mathcomp Require Import order_topology matrix_topology.
Reserved Notation "x ^'+" (at level 3, left associativity, format "x ^'+").
Reserved Notation "x ^'-" (at level 3, left associativity, format "x ^'-").
Import Order.TTheory GRing.Theory Num.Theory.
Unset SsrOldRewriteGoalsOrder.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Local Open Scope classical_set_scope.
Local Open Scope ring_scope.
.
Source code
Source code
Source code
(nbhs_ball_ (ball_ (fun => `|x|))).
Module
Source code
Section TopologicalNumDomainType.
Variable ( : numDomainType).
Lemma
Source code
Proof.
by move=> [] e e0 /subsetP/(_ p); rewrite !in_setE/= subrr normr0.
split=> [|P Q|P Q].
- by exists 1; [exact: ltr01|exact: subsetT].
- move=> [] /= e e0 /subsetP eP [] /= f f0 /subsetP fQ.
exists (Order.min e f) => /=.
by rewrite [Num.min e f]/(Order.min e f); case: ifP.
apply/subsetP => x.
rewrite in_setE in_setI/= => pef.
apply/andP; split.
apply/eP/mem_set/(lt_le_trans pef).
by case: (@real_ltP _ e f) => //; exact: gtr0_real.
apply/fQ/mem_set/(lt_le_trans pef).
by case: (@real_ltP _ f e) => //; exact: gtr0_real.
- move=> PQ [] /= e e0 eP.
by exists e => //; exact: (subset_trans eP).
Qed.
Lemma
Source code
Lemma
Source code
Proof.
End TopologicalNumDomainType.
End TopologicalNumDomainType.
.
Source code
Source code
Source code
(@TopologicalNumDomainType.nbhs_filter R)
(@TopologicalNumDomainType.nbhs_singleton R)
(@TopologicalNumDomainType.nbhs_nbhs R).
.
Source code
Source code
Source code
nbhs_ball_normE ball_norm_center ball_norm_symmetric ball_norm_triangle erefl.
.
Source code
Source code
Source code
Uniform_isPseudoMetric.Build R R^o
ball_norm_center ball_norm_symmetric ball_norm_triangle erefl.
Lemma
Source code
filter_from (fun => itv_open_ends i /\ x \in i) (fun => [set` i]).
Proof.
case => _ /posnumP[e] xeU.
exists (`]x - e%:num, x + e%:num[); first split => //.
by rewrite in_itv/= -lter_distl subrr normr0.
apply: subset_trans xeU => z /=.
by rewrite in_itv /= -lter_distl distrC.
case => [][[[]l|[]]] [[]r|[]] []//= _.
- move=> xlr lrU; exists (Order.min (x - l) (r - x)).
by rewrite /= lt_min ?lterBDr ?add0r ?(itvP xlr).
apply/(subset_trans _ lrU)/subset_ball_prop_in_itv.
suff : (`]x - Order.min (x - l) (r - x), x + Order.min (x - l) (r - x)[
<= `]l, r[)%O by move/subitvP => H ? ?; exact: H.
rewrite subitvE 2!lteBSide/=.
by rewrite lerBrDl [_ + l]addrC -2!lerBrDl 2!ge_min 2!lexx orbT.
- move=> xl lU; exists (x - l) => /=; first by rewrite lterBDr add0r (itvP xl).
apply/(subset_trans _ lU)/subset_ball_prop_in_itv.
suff : (`]x - (x - l), x + (x - l)[ <= `]l, +oo[)%O.
by move/subitvP => + ?; exact.
by rewrite subitvE lteBSide/= subKr lexx.
- move=> xr rU; exists (r - x) => /=; first by rewrite lterBDr add0r (itvP xr).
apply/(subset_trans _ rU)/subset_ball_prop_in_itv.
suff : (`]x - (r - x), x + (r - x)[ <= `]-oo, r[)%O.
by move/subitvP => + ?; exact.
by rewrite subitvE lteBSide/= addrC subrK.
- by move=> _; rewrite set_itvE subTset => ->; exists 1 => /=.
Qed.
Module
Source code
Source code
Source code
.
Source code
Source code
Source code
Source code
Source code
.
Source code
Source code
Source code
Source code
Source code
.
Source code
Source code
Source code
Source code
Source code
.
Source code
Source code
Source code
Source code
Source code
.
Source code
Source code
Source code
PseudoPointedMetric.copy R R^o.
Source code
Source code
.
Source code
Source code
Source code
Source code
Source code
.
Source code
Source code
Source code
Order_isNbhs.Build _ R (@real_order_nbhsE R).
Source code
Source code
.
Source code
Source code
Source code
Order_isNbhs.Build _ R (@real_order_nbhsE R).
Module
Source code
End numFieldTopology.
Import numFieldTopology.Exports.
Lemma
Source code
Proof.
Lemma
Source code
( : T) :
(f \o -%R) x @[ --> a] --> l <-> f x @[ --> (- a)] --> l.
Proof.
Lemma
Source code
within A (nbhs (- r)) = - x @[ --> within (-%R @` A) (nbhs r)].
Proof.
Lemma
Source code
(\forall \near - x, P y) <-> \near , P (- x).
Proof.
Lemma
Source code
nbhs (- x) = [set -%R @` A | in nbhs x].
Proof.
Lemma
Source code
Proof.
Lemma
Source code
closed A -> closed [set - x | in A].
Proof.
suff /Acl : closure A (- x) by exists (- x)=> //; rewrite opprK.
move=> B oppx_B; have : [set - x | in A] `&` [set - x | in B] !=set0.
by apply: clNAx; rewrite -[x]opprK nbhsNimage; exists B.
move=> [y [[z Az oppzey] [t Bt opptey]]]; exists (- y).
by split; [rewrite -oppzey opprK|rewrite -opptey opprK].
Qed.
Lemma
Source code
(- r)%R^' = (fun => -%R @` A) @` r^'.
Proof.
exists (-%R @` A).
exists e => // x/= rxe xr; exists (- x)%R; rewrite ?opprK//.
by apply: reA; rewrite ?eqr_opp//= opprK addrC distrC.
rewrite image_comp (_ : _ \o _ = idfun) ?image_id// funeqE => x/=.
by rewrite opprK.
exists e => //= x/=; rewrite -opprD normrN => axe xa.
exists (- x)%R; rewrite ?opprK//; apply: reA; rewrite ?eqr_oppLR//=.
by rewrite opprK.
Qed.
Section at_left_right.
Context { : numFieldType}.
Definition
sup_pseudometric : forall [R : realType] [T Ii : Type], (Ii -> PseudoMetric.axioms_ R T) -> countable (T:=Ii) [set: Ii] -> Type sup_pseudometric is not universe polymorphic Arguments sup_pseudometric [R] [T Ii]%_type_scope Tc%_function_scope Icnt sup_pseudometric is transparent Expands to: Constant mathcomp.analysis.topology_theory.separation_axioms.sup_pseudometric Declared in library mathcomp.analysis.topology_theory.separation_axioms, line 978, characters 11-27
Source code
Definition
gauge.gauge : forall {T : uniformType}, set (T * T) -> set_system (T * T) gauge.gauge is not universe polymorphic Arguments gauge.gauge {T} E%_classical_set_scope _ gauge.gauge is transparent Expands to: Constant mathcomp.analysis.topology_theory.separation_axioms.gauge.gauge Declared in library mathcomp.analysis.topology_theory.separation_axioms, line 1009, characters 11-16
Source code
Local Notation
Source code
Local Notation
Source code
Global Instance
Source code
Proof.
Global Instance
Source code
Proof.
Lemma
Source code
f x @[ --> p^'] --> l -> f x @[ --> p^'+] --> l.
Proof.
Lemma
Source code
f x @[ --> p^'] --> l -> f x @[ --> p^'-] --> l.
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
by apply: nbhs_right_lt; rewrite ltrDr.
Unshelve. all: by end_near. Qed.
Lemma
Source code
Proof.
Lemma
Source code
~ (\forall \near p^'+, P x) <->
forall : {posnum R}, exists2 , p < x < p + e%:num & ~ P x.
Proof.
- apply: contrapT => /forallPNP peP; apply: pPf; near=> t.
apply: contrapT; apply: peP; apply/andP; split.
+ by near: t; exact: nbhs_right_gt.
+ by near: t; apply: nbhs_right_lt; rewrite ltrDl.
- rewrite /at_right near_withinE nearE.
rewrite -filter_from_ballE /filter_from/= -forallPNP => _ /posnumP[d].
have [x /andP[px xpd] notPx] := ex_notPx d; rewrite -existsNP; exists x => /=.
apply: contra_not notPx; apply => //.
by rewrite /ball/= ltr0_norm ?subr_lt0// opprB ltrBlDl.
Unshelve. all: by end_near. Qed.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
(\forall \near (x + a)^'+, P y) = (\forall \near x^'+, P (y + a)).
Lemma
Source code
(\forall \near (x + a)^'-, P y) = (\forall \near x^'-, P (y + a)).
Lemma
Source code
(f @ (x + a)^'-) = (f (y + a) @[ --> x^'-]).
Proof.
Lemma
Source code
(f @ (x + a)^'+) = (f (y + a) @[ --> x^'+]).
Proof.
End at_left_right.
#[global] Typeclasses Opaque at_left at_right.
Notation
Source code
Notation
Source code
#[global] Hint Extern 0 (Filter (nbhs _^'+)) =>
(apply: at_right_proper_filter) : typeclass_instances.
#[global] Hint Extern 0 (Filter (nbhs _^'-)) =>
(apply: at_left_proper_filter) : typeclass_instances.
Lemma
Source code
( : R -> T) ( : R) ( : T) :
f x @[ --> p^'+] --> l -> f x @[ --> p^'-] --> l -> f x @[ --> p^'] --> l.
Proof.
rewrite !near_withinE !near_nbhs => lf rf.
apply: filter_app lf; apply: filter_app rf.
by near=> t => xlt xgt /lt_total/orP[|].
Unshelve. all: by end_near. Qed.
Lemma
Source code
( : R -> T) :
f @ x^'- --> f x /\ f @ x^'+ --> f x <-> f @ x --> f x.
Proof.
move=> [+ +] U /= Uz => /(_ U Uz) + /(_ U Uz); near_simpl.
rewrite !near_withinE => lf rf; apply: filter_app lf; apply: filter_app rf.
near=> t => xlt xgt; have := @real_leVge R x t; rewrite !num_real.
move=> /(_ isT isT) /orP; rewrite !le_eqVlt => -[|] /predU1P[|//].
- by move=> <-; exact: nbhs_singleton.
- by move=> ->; exact: nbhs_singleton.
Unshelve. all: by end_near. Qed.
Lemma
Source code
A !=set0 -> has_ubound A -> closure A (sup A).
Proof.
rewrite closure_isolated_limit_point.
right => U /nbhs_ballP[_ /posnumP[e]] supAeU.
suff [x [Ax /andP[sAex xsA]]] : exists , A x /\ sup A - e%:num < x < sup A.
exists x; split => //; first by rewrite lt_eqF.
apply supAeU; rewrite /ball /= ltr_distl (addrC x e%:num) -ltrBlDl sAex.
by rewrite andbT (le_lt_trans _ xsA) // lerBlDl lerDr.
apply: contrapT => /forallNP Ax.
suff /(ge_sup A0) : ubound A (sup A - e%:num).
by rewrite leNgt => /negP; apply; rewrite ltrBlDl ltrDr.
move=> y Ay; have /not_andP[//|/negP] := Ax y.
rewrite negb_and leNgt => /orP[//|]; apply: contra => sAey.
rewrite lt_neqAle sup_upper_bound // andbT.
by apply: contra_not_neq AsupA => <-.
Qed.
Lemma
Source code
has_ubound X -> X° `<=` [set | r < sup X].
Proof.
rewrite le_eqVlt => /orP[/eqP supXr|]; last first.
by apply/negP; rewrite -leNgt ub_le_sup//; exact: interior_subset.
suff : ~ X° (sup X) by rewrite supXr.
case/nbhs_ballP => _/posnumP[e] supXeX.
have [f XsupXf] : exists : {posnum R}, X (sup X + f%:num).
exists (e%:num / 2)%:pos; apply supXeX; rewrite /ball /= opprD addNKr normrN.
by rewrite gtr0_norm // ltr_pdivrMr // ltr_pMr // ltr1n.
have : sup X + f%:num <= sup X by exact: ub_le_sup.
by apply/negP; rewrite -ltNge; rewrite ltrDl.
Qed.
Lemma
Source code
has_lbound X -> X° `<=` [set | inf X < r].
Proof.
rewrite le_eqVlt => /orP[/eqP rinfX|]; last first.
by apply/negP; rewrite -leNgt ge_inf//; exact: interior_subset.
suff : ~ X° (inf X) by rewrite -rinfX.
case/nbhs_ballP => _/posnumP[e] supXeX.
have [f XsupXf] : exists : {posnum R}, X (inf X - f%:num).
exists (e%:num / 2)%:pos; apply supXeX; rewrite /ball /= opprB addrC subrK.
by rewrite gtr0_norm // ltr_pdivrMr // ltr_pMr // ltr1n.
have : inf X <= inf X - f%:num by exact: ge_inf.
by apply/negP; rewrite -ltNge; rewrite ltrBlDr ltrDl.
Qed.
Lemma
Source code
( : interval T) ( : T -> U) :
{in i, continuous f} <-> {in [set` i], continuous f}.
Lemma
Source code
\forall \near nbhs (0%R:R), (r <= x)%R.
Proof.
Lemma
Source code
\forall \near nbhs (0%R:R), (r < x)%R.
Proof.
Lemma
Source code
\forall \near nbhs x, y < a.
Proof.
Lemma
Source code
x < t -> \forall \near nbhs x, y <= t.
Lemma
Source code
- x < a -> \forall \near nbhs x, - y < a.
Proof.
Section nbhs_lt_le.
Context { : numFieldType}.
Implicit Types x z : R.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
End nbhs_lt_le.
Lemma
Source code
\forall \near z, a < x.
Proof.
Lemma
Source code
t < x -> \forall \near nbhs x, t <= y.
Global Instance
Source code
ProperFilter x^'.
Proof.
Global Instance
Source code
ProperFilter x^'.
Proof.
Lemma
Source code
Proof.
have /rat_in_itvoo[q /itvP qre] : r < r + e%:num by rewrite ltrDl.
exists (ratr q) => //; split; last by exists q.
apply: reA; rewrite /ball /= distrC ltr_distl qre andbT.
by rewrite (@le_lt_trans _ _ r)// ?qre// lerBlDl lerDr ltW.
Qed.
Lemma
Source code
{ : realType} ( : Type) ( : I -> set R) ( : set I) :
(forall , open (B i)) -> (forall , B i !=set0) ->
trivIset D B -> countable D.
Proof.
{ : I -> rat & forall , D i -> B i (ratr (f i))}.
apply: (@choice _ _ (fun => D x -> B x (ratr y))) => i.
have [r [Bir [q _ qr]]] := dense_rat (B0 _) (oB i).
by exists q => Di; rewrite qr.
have inj_f : {in D &, injective f}.
move=> i j /[!inE] Di Dj /(congr1 ratr) ratrij.
have ? : (B i `&` B j) (ratr (f i)).
by split => //; [exact: fB|rewrite ratrij; exact: fB].
by apply/(tB _ _ Di Dj); exists (ratr (f i)).
apply/pcard_injP; have /card_bijP/cid[g bijg] := card_rat.
pose nat_of_rat ( : rat) : nat := set_val (g (to_setT q)).
have inj_nat_of_rat : injective nat_of_rat.
rewrite /nat_of_rat; apply: inj_comp => //; apply: inj_comp => //.
exact/bij_inj.
by exists (nat_of_rat \o f) => i j Di Dj /inj_nat_of_rat/inj_f; exact.
Qed.
Lemma
Source code
continuous (rsubmx : 'M[R]_(m, n1 + n2) -> 'M[R]_(m, n2)).
Proof.
apply/nbhs_ballP; exists e => //= v [_ uv]; apply: eA; split => // i j.
by apply: (le_lt_trans _ (uv i (rshift n1 j))); rewrite !mxE.
Qed.
Lemma
Source code
continuous (lsubmx : 'M[R]_(m, n1 + n2) -> 'M[R]_(m, n1)).
Proof.
apply/nbhs_ballP; exists e => //= v [_ uv]; apply: eA; split => // i j.
by apply: (le_lt_trans _ (uv i (lshift n2 j))); rewrite !mxE.
Qed.