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.
#[warning="-warn-library-file-internal-analysis"]
From mathcomp Require Import unstable.
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.
.
(nbhs_ball_ (ball_ (fun => `|x|))).
Module
Section TopologicalNumDomainType.
Context { : numDomainType}.
Lemma
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
Lemma
Proof.
End TopologicalNumDomainType.
End TopologicalNumDomainType.
.
(@TopologicalNumDomainType.nbhs_filter R)
(@TopologicalNumDomainType.nbhs_singleton R)
(@TopologicalNumDomainType.nbhs_nbhs R).
.
nbhs_ball_normE ball_norm_center ball_norm_symmetric ball_norm_triangle erefl.
.
Uniform_isPseudoMetric.Build R R^o
ball_norm_center ball_norm_symmetric ball_norm_triangle erefl.
Lemma
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
.
.
.
.
.
PseudoPointedMetric.copy R R^o.
.
.
Order_isNbhs.Build _ R (@real_order_nbhsE R).
.
Order_isNbhs.Build _ R (@real_order_nbhsE R).
Module
- mathcomp.analysis.topology_theory.separation_axioms
- mathcomp.analysis.normedtype_theory.normed_module
Source code
End numFieldTopology.
Import numFieldTopology.Exports.
Lemma
Proof.
Lemma
- mathcomp.analysis.ftc
Source code
( : T) :
(f \o -%R) x @[ --> a] --> l <-> f x @[ --> (- a)] --> l.
Proof.
Lemma
- mathcomp.analysis.normedtype_theory.pseudometric_normed_Zmodule
Source code
within A (nbhs (- r)) = - x @[ --> within (-%R @` A) (nbhs r)].
Proof.
Lemma
- mathcomp.analysis.normedtype_theory.pseudometric_normed_Zmodule
Source code
(\forall \near - x, P y) <-> \near , P (- x).
Proof.
Lemma
nbhs (- x) = [set -%R @` A | in nbhs x].
Proof.
Lemma
Proof.
Lemma
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
- mathcomp.analysis.normedtype_theory.normed_module
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
Used by
- mathcomp.analysis.derive
- mathcomp.analysis.normedtype_theory.pseudometric_normed_Zmodule
Source code
Definition
Used by
- mathcomp.analysis.derive
- mathcomp.analysis.lebesgue_stieltjes_measure
- mathcomp.analysis.normedtype_theory.pseudometric_normed_Zmodule
Source code
Local Notation
Local Notation
Global Instance
- mathcomp.analysis.realfun
- mathcomp.analysis.ftc
- mathcomp.analysis.normedtype_theory.pseudometric_normed_Zmodule
- mathcomp.analysis.normedtype_theory.num_normedtype
Source code
Proof.
Global Instance
- mathcomp.analysis.ftc
- mathcomp.analysis.normedtype_theory.pseudometric_normed_Zmodule
- mathcomp.analysis.normedtype_theory.num_normedtype
Source code
Proof.
Lemma
- mathcomp.analysis.realfun
Source code
f x @[ --> p^'] --> l -> f x @[ --> p^'+] --> l.
Proof.
Lemma
- mathcomp.analysis.realfun
Source code
f x @[ --> p^'] --> l -> f x @[ --> p^'-] --> l.
Proof.
Lemma
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_differentiation
- mathcomp.analysis.topology_theory.metric_structure
- mathcomp.analysis.realfun
- mathcomp.analysis.ftc
- mathcomp.analysis.normedtype_theory.pseudometric_normed_Zmodule
Source code
Proof.
Lemma
- mathcomp.analysis.normedtype_theory.pseudometric_normed_Zmodule
Source code
Proof.
Lemma
- mathcomp.analysis.normedtype_theory.pseudometric_normed_Zmodule
Source code
Proof.
Lemma
- mathcomp.analysis.normedtype_theory.pseudometric_normed_Zmodule
Source code
Proof.
Lemma
- mathcomp.analysis.realfun
- mathcomp.analysis.normedtype_theory.pseudometric_normed_Zmodule
Source code
Proof.
Lemma
- mathcomp.analysis.normedtype_theory.pseudometric_normed_Zmodule
Source code
Proof.
Lemma
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_differentiation
- mathcomp.analysis.probability_theory.normal_distribution
- mathcomp.analysis.topology_theory.metric_structure
- mathcomp.analysis.realfun
- mathcomp.analysis.normedtype_theory.normed_module
- mathcomp.analysis.normedtype_theory.pseudometric_normed_Zmodule
Source code
Proof.
Lemma
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_differentiation
- mathcomp.analysis.ftc
Source code
Proof.
Lemma
- mathcomp.analysis.realfun
- mathcomp.analysis.ftc
Source code
Proof.
by apply: nbhs_right_lt; rewrite ltrDr.
Unshelve. all: by end_near. Qed.
Lemma
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_differentiation
- mathcomp.analysis.exp
- mathcomp.analysis.topology_theory.metric_structure
- mathcomp.analysis.realfun
- mathcomp.analysis.ftc
- mathcomp.analysis.normedtype_theory.normed_module
- mathcomp.analysis.normedtype_theory.pseudometric_normed_Zmodule
Source code
Proof.
Lemma
- mathcomp.analysis.normedtype_theory.pseudometric_normed_Zmodule
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
Proof.
Lemma
Proof.
Lemma
(\forall \near (x + a)^'+, P y) = (\forall \near x^'+, P (y + a)).
Lemma
(\forall \near (x + a)^'-, P y) = (\forall \near x^'-, P (y + a)).
Lemma
(f @ (x + a)^'-) = (f (y + a) @[ --> x^'-]).
Proof.
Lemma
- mathcomp.analysis.normedtype_theory.pseudometric_normed_Zmodule
Source code
(f @ (x + a)^'+) = (f (y + a) @[ --> x^'+]).
Proof.
Context { : topologicalType} ( : R -> V) ( : R).
Lemma
- mathcomp.analysis.pi_irrational
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_differentiation
- mathcomp.analysis.exp
- mathcomp.analysis.probability_theory.normal_distribution
- mathcomp.analysis.probability_theory.beta_distribution
- mathcomp.analysis.probability_theory.exponential_distribution
- mathcomp.analysis.gauss_integral
- mathcomp.analysis.realfun
- mathcomp.analysis.ftc
- mathcomp.analysis.elementary_functions.trigonometry_integral
Source code
f z @[ --> x] --> l -> f z @[ --> x^'+] --> l.
Proof.
Lemma
- mathcomp.analysis.pi_irrational
- mathcomp.analysis.exp
- mathcomp.analysis.probability_theory.normal_distribution
- mathcomp.analysis.probability_theory.beta_distribution
- mathcomp.analysis.probability_theory.exponential_distribution
- mathcomp.analysis.gauss_integral
- mathcomp.analysis.realfun
- mathcomp.analysis.ftc
- mathcomp.analysis.elementary_functions.trigonometry_integral
Source code
f z @[ --> x] --> l -> f z @[ --> x^'-] --> l.
Proof.
Lemma
- mathcomp.analysis.realfun
- mathcomp.analysis.ftc
- mathcomp.analysis.normedtype_theory.num_normedtype
Source code
f x @[ --> within (fun => x <= u) (nbhs x)] --> f x.
Proof.
by move/predU1P => [<-|]; [exact: nbhs_singleton | near: z; exact: fxr].
Unshelve. all: by end_near. Qed.
Lemma
- mathcomp.analysis.realfun
- mathcomp.analysis.ftc
- mathcomp.analysis.normedtype_theory.num_normedtype
Source code
f x @[ --> within (fun => u <= x) (nbhs x)] --> f x.
Proof.
by move/predU1P => [->|]; [exact: nbhs_singleton | near: z; exact: fxr].
Unshelve. all: by end_near. Qed.
End at_left_right.
#[global] Typeclasses Opaque at_left at_right.
Notation
Notation
#[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
- mathcomp.analysis.realfun
- mathcomp.analysis.ftc
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
- mathcomp.analysis.realfun
- mathcomp.analysis.ftc
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
- mathcomp.analysis.normedtype_theory.normed_module
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
- mathcomp.analysis.normedtype_theory.num_normedtype
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
- mathcomp.analysis.normedtype_theory.num_normedtype
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
- mathcomp.analysis.ftc
- mathcomp.analysis.normedtype_theory.num_normedtype
Source code
( : interval T) ( : T -> U) :
{in i, continuous f} <-> {in [set` i], continuous f}.
Lemma
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_differentiation
Source code
\forall \near nbhs (0%R:R), (r <= x)%R.
Proof.
Lemma
\forall \near nbhs (0%R:R), (r < x)%R.
Proof.
Lemma
- mathcomp.analysis.probability_theory.normal_distribution
Source code
\forall \near nbhs x, y < a.
Proof.
Lemma
x < t -> \forall \near nbhs x, y <= t.
Lemma
- mathcomp.analysis.ftc
Source code
- x < a -> \forall \near nbhs x, - y < a.
Proof.
Lemma
- mathcomp.analysis.realfun
Source code
(\forall \near a^'+, {in `]a, b[, forall , P x})
<-> {near a^'+, forall , P x}.
Proof.
- exists (r%:num / 2) => [//=|x /= /ltr_distlCDr xar2 ax].
apply: (arP (a + r%:num / 2)) => /=.
+ by rewrite opprD addNKr normrN gtr0_norm// gtr_pMr// invf_lt1// ltr1n.
+ by rewrite ltrDl.
+ by rewrite in_itv/= ax.
- exists r => // x /= /ltr_distlCDr xar ax y /[!in_itv]/= /andP[ay yx].
apply: arP => //=.
by rewrite distrC gtr0_norm ?subr_gt0// ltrBlDl (lt_trans _ xar).
Qed.
Lemma
(\forall \near b^'-, {in `]a, b[, forall , P x})
<-> {near b^'-, forall , P x}.
Proof.
- exists (r%:num / 2) => [//=|x /= /ltr_distlDr bxr xb].
apply: (brP (b - r%:num / 2)) => /=.
+ rewrite subKr gtr0_norm ?divr_gt0//.
by rewrite gtr_pMr// invf_plt ?posrE// invr1 ltrDl.
+ by rewrite gtrBl divr_gt0.
+ by rewrite in_itv/= xb andbT ltrBlDr.
- exists r => // x /= /ltr_distlDr bxr xb y /[!in_itv]/= /andP[xy yb].
apply: brP => //=.
by rewrite gtr0_norm ?subr_gt0// ltrBlDl (lt_trans bxr)// ltrD2r.
Qed.
Section nbhs_lt_le.
Context { : numFieldType}.
Implicit Types x z : R.
Lemma
Proof.
Lemma
- mathcomp.analysis.ftc
Source code
Proof.
End nbhs_lt_le.
Lemma
- mathcomp.analysis.exp
- mathcomp.analysis.probability_theory.normal_distribution
- mathcomp.analysis.probability_theory.exponential_distribution
- mathcomp.analysis.realfun
Source code
\forall \near z, a < x.
Proof.
Lemma
t < x -> \forall \near nbhs x, t <= y.
Lemma
~ (\forall \near p, P x) <->
forall : set T, nbhs p V -> exists2 , V x & ~ P x.
Proof.
Lemma
( : M) ( : set M) :
~ (\forall \near p, P x) <->
forall ( : {posnum R}), exists2 , ball p e%:num x & ~ P x.
Proof.
- by move=> + e; apply; exact: nbhsx_ballx.
- rewrite -nbhs_ballE => + V [/= e e0 beV].
by move=> /(_ (PosNum e0))[x /beV ? ?]; exists x.
Qed.
Global Instance
ProperFilter x^'.
Proof.
Global Instance
- mathcomp.analysis.ereal
Source code
ProperFilter x^'.
Proof.
Lemma
- mathcomp.analysis.borel_hierarchy
- mathcomp.analysis.normedtype_theory.normed_module
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
- mathcomp.analysis.normedtype_theory.vitali_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
- mathcomp.analysis.derive
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
- mathcomp.analysis.derive
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.
Import unstable.EndlessDense.
Section theory.
Local Open Scope order_scope.
Local Open Scope classical_set_scope.
Context {} { : orderTopologicalType d}.
Implicit Types (x y : T) (i : interval T).
Lemma
open [set` i] -> itv_open_ends i.
Proof.
case: i => l r /neitv_lt_bnd/= lr.
rewrite openE /interior/=.
(under [X in X -> _]eq_forall do rewrite itv_nbhsE/=) => i_open.
apply/negbNE/negP; case/(itv_open_endsPn lr) => x lrx.
have: x \in Interval l r.
move: lr; case: lrx => ->; rewrite itv_boundlr lexx ?leBRight_ltBLeft//.
by rewrite ltBRight_leBLeft => ->.
case/i_open => -[l' r'] [] + xj; rewrite -subset_itvP => /[swap].
have := xj; rewrite itv_boundlr => /andP[l'x xr'].
rewrite -subitvP//; first exact: xj.
rewrite subitvE => /andP[] ll' r'r.
apply/negP/itv_open_endsPn; [exact: (itv_boundlr_lt xj) | exists x].
move: l'x xr' ll' r'r.
by case: lrx => <-; [left|right]; apply/le_anti/andP; split.
Qed.
Lemma
closed [set` i] -> itv_closed_ends i.
Proof.
case: i => l r /neitv_lt_bnd/= lr.
rewrite closedE/= /prop_near1/=.
(under [X in X -> _]eq_forall do rewrite itv_nbhsE/=) => i_closed.
apply/negbNE/negP; case/(itv_closed_endsPn lr) => x lrx.
have: ~ (x \in Interval l r).
by case: lrx => ->; rewrite itv_boundlr !bnd_simp// andbF.
apply; apply: i_closed => -[[l' r'][]] /itv_open_ends_boundlr -> /andP[] l'x xr'.
move: lr; case: lrx => -> => [xr|lx].
have : BRight x < Order.min r r' by rewrite lt_min xr xr'.
case/itv_bound_half_dense => // y /andP[] xy yr /(_ y); apply.
rewrite /= itv_boundlr.
have := yr; rewrite lt_min -!leBRight_ltBLeft => /andP[] _ ->.
by rewrite andbT (le_trans _ xy)// ltW// ltBRight_leBLeft ltW.
rewrite itv_boundlr xy/= leBRight_ltBLeft.
by have := yr; rewrite lt_min => /andP[].
have : Order.max l l' < BLeft x by rewrite gt_max lx l'x.
case/itv_bound_half_dense => // y /andP[] ly yx /(_ y); apply.
rewrite /= itv_boundlr.
have := ly; rewrite ge_max => /andP[] _ -> /=.
by rewrite leBRight_ltBLeft (lt_trans yx)// -leBRight_ltBLeft ltW.
rewrite itv_boundlr leBRight_ltBLeft yx andbT.
by have := ly; rewrite ge_max => /andP[].
Qed.
Let
closure `]x, y[ = `[x, y].
Proof.
have ineq0 bb1 bb2 : neitv (Interval (BSide bb1 x) (BSide bb2 y)).
have[z /andP[xz zy]]:= T_dense x y xy.
apply/set0P; exists z; rewrite /= in_itv/=.
by case: bb1; case: bb2; apply/andP; split; rewrite /= ?ltW.
have subcc : `]x, y[ `<=` `[x, y] by apply: subset_itv; rewrite !bnd_simp.
apply/seteqP; split.
by rewrite (closure_id `[x, y]).1; [exact: itv_closed|exact: closureS].
rewrite (closureEbigcap_itvcc `[x, y])//; first exact: itv_closed.
rewrite setorder_itv_setDl_image// setDitvoo//.
rewrite powerset2 !image_setU !image_set1 setD0 setDitv1l setDitv1r setDitv_set2.
rewrite setIC !setIUl => /= z ? i -[[[]|]|] []->// ci.
all: exfalso; move/closed_itv_closed_ends: ci.
all: cbn; rewrite falseE; apply => //; exact: ineq0.
Qed.
Lemma
neitv (Interval (BSide b1 x) (BSide b2 y)) ->
closure [set` Interval (BSide b1 x) (BSide b2 y)] = `[x, y].
Proof.
have : x <= y by move: bxy; case: b1; case: b2; rewrite bnd_simp// => /ltW.
rewrite le_eqVlt => /orP[/eqP xy| xy].
move: b1 b2 bxy; rewrite xy => -[][]; rewrite !bnd_simp// => _.
by rewrite -((closure_id `[y,y]).1)//; exact: itv_closed.
apply/seteqP; split.
rewrite (closure_id `[x, y]).1; first exact: itv_closed.
by apply/closureS/subset_itv; rewrite !bnd_simp.
rewrite -itvoo_closureE//; last first.
by apply/closureS/subset_itv; rewrite !bnd_simp.
have[z /andP[xz zy]]:= T_dense x y xy.
by apply/set0P; exists z; rewrite /= in_itv/= xz zy.
Qed.
Let
closure `]x, +oo[ = `[x, +oo[.
Proof.
have subcy : `]x, +oo[ `<=` `[x, +oo[.
by apply: subset_itv => //; rewrite !bnd_simp.
apply/seteqP; split.
rewrite (closure_id `[x, +oo[).1; last exact: closureS.
exact: rray_closed.
rewrite (closureEbigcap_itvcc `[x, +oo[)//; first exact: rray_closed.
rewrite setorder_itv_setDl_image// setDitvoy.
by apply/set0P; exists x; rewrite /= in_itv/= lexx.
rewrite powerset1 image_setU !image_set1 setD0 setDitv1l setIC setIUl.
move=> /= z/= zx /= i [] [] -> // ci; exfalso.
move/closed_itv_closed_ends: ci; cbn; rewrite falseE; apply => //.
have[_ [y xy]]:= T_endless x.
by apply/set0P; exists y; rewrite /= in_itv/= xy.
Qed.
Lemma
closure [set` Interval (BSide b x) +oo] = `[x, +oo[.
Proof.
have subcy: [set` Interval (BSide b x) +oo] `<=` `[x, +oo[.
by apply: subset_itv => //; rewrite !bnd_simp.
apply/seteqP; split.
rewrite (closure_id `[x, +oo[).1; last exact: closureS.
exact: rray_closed.
rewrite -itvoy_closureE//.
by apply/closureS/subset_itv => //; rewrite !bnd_simp.
Qed.
Let
closure `]-oo, x[ = `]-oo, x].
Proof.
have subcy : `]-oo, x[ `<=` `]-oo, x].
by apply: subset_itv => //; rewrite !bnd_simp.
apply/seteqP; split.
rewrite (closure_id `]-oo, x]).1; last exact: closureS.
exact: lray_closed.
rewrite (closureEbigcap_itvcc `]-oo, x])//; first exact: lray_closed.
rewrite setorder_itv_setDl_image// setDitvNyo.
by apply/set0P; exists x; rewrite /= in_itv/= lexx.
rewrite powerset1 image_setU !image_set1 setD0 setDitv1r setIC setIUl.
move=> /= z/= zx /= i [] [] -> // ci; exfalso.
move/closed_itv_closed_ends: ci; cbn; rewrite falseE; apply => //.
have[[y yx] _]:= T_endless x.
by apply/set0P; exists y; rewrite /= in_itv/= yx.
Qed.
Lemma
closure [set` Interval -oo (BSide b x)] = `]-oo, x].
Proof.
have subNyc: [set` Interval -oo (BSide b x)] `<=` `]-oo, x].
by apply: subset_itv => //; rewrite !bnd_simp.
apply/seteqP; split.
rewrite (closure_id `]-oo, x]).1; last exact: closureS.
exact: lray_closed.
rewrite -itvNyo_closureE//.
by apply/closureS/subset_itv => //; rewrite !bnd_simp.
Qed.
Lemma
[set` Interval (BSide b x) +oo]° = `]x, +oo[.
Proof.
Lemma
[set` Interval -oo (BSide b x)]° = `]-oo, x[.
Proof.
Lemma
[set` Interval (BSide b1 x) (BSide b2 y)]° = `]x, y[.
Proof.
apply: setC_inj.
rewrite -closureC !setCitv/= closureU.
by rewrite linfty_itv_closureE// rinfty_itv_closureE.
Qed.
Lemma
is_endless T -> is_dense T -> neitv (Interval l r) ->
closure [set` Interval l r] =
[set` Interval (match l with BSide _ x => BLeft x | _ => l end)
(match r with BSide _ y => BRight y | _ => r end)].
Proof.
move: l r => [[|] x | [|]] [[|] y | [|]] ineq0.
all: rewrite ?set_itv_infty_set0 ?closure0//.
all: rewrite ?set_itvNyy ?closureT//.
all: by rewrite (fin_itv_closureE, rinfty_itv_closureE, linfty_itv_closureE).
Qed.
Lemma
[set` Interval l r]° =
[set` Interval (match l with BSide _ x => BRight x | _ => l end)
(match r with BSide _ y => BLeft y | _ => r end)].
Proof.
move: l r => [[|] x | [|]] [[|] y | [|]].
all: rewrite ?set_itv_infty_set0 ?interior0//.
all: rewrite ?set_itvNyy ?interiorT//.
all: by rewrite (fin_itv_interiorE, rinfty_itv_interiorE, linfty_itv_interiorE).
Qed.
End theory.
End EndlessDenseTopology.
Section realField_topology.
Context { : realFieldType}.
Implicit Type i : interval R.
Local Open Scope order_scope.
Let
Let
Lemma
Proof.
Lemma
Proof.
Lemma
- mathcomp.analysis.ftc
Source code
closure [set` Interval l r] =
[set` Interval (match l with BSide _ x => BLeft x | _ => l end)
(match r with BSide _ y => BRight y | _ => r end)].
Proof.
Lemma
[set` Interval l r]° =
[set` Interval (match l with BSide _ x => BRight x | _ => l end)
(match r with BSide _ y => BLeft y | _ => r end)].
Proof.
End realField_topology.