Module mathcomp.analysis.normedtype_theory.num_normedtype
From mathcomp Require Import boot order finmap ssralg ssrnum ssrint.From mathcomp Require Import interval interval_inference archimedean rat.
#[warning="-warn-library-file-internal-analysis"]
From mathcomp Require Import unstable.
From mathcomp Require Import mathcomp_extra boolp classical_sets functions.
From mathcomp Require Import cardinality set_interval reals real_interval.
From mathcomp Require Import topology prodnormedzmodule.
# Preliminaries for norm-related notions
This file contains various definitions and lemmas about topological
notions of numeric types that are useful to develop the theory of normed
modules in this directory.
```
pinfty_nbhs == filter for +oo (for a numFieldType)
Notation: +oo (ring_scope)
ninfty_nbhs == filter for -oo (for a numFieldType)
Notation: -oo (ring_scope)
is_interval E == the set E is an interval
bigcup_ointsub U q == union of open real intervals included
in U and that contain the rational
number q
```
```
f @`[ a , b ], f @`] a , b [ == notations for images of intervals,
intended for continuous, monotonous
functions, defined in ring_scope and
classical_set_scope respectively as:
f @`[ a , b ] := `[minr (f a) (f b), maxr (f a) (f b)]%O
f @`] a , b [ := `]minr (f a) (f b), maxr (f a) (f b)[%O
f @`[ a , b ] := `[minr (f a) (f b),
maxr (f a) (f b)]%classic
f @`] a , b [ := `]minr (f a) (f b),
maxr (f a) (f b)[%classic
```
Reserved Notation "f @`[ a , b ]" (format "f @`[ a , b ]").
Reserved Notation "f @`] a , b [" (format "f @`] a , b [").
Reserved Notation "+oo_ R" (at level 3, left associativity, format "+oo_ R").
Reserved Notation "-oo_ R" (at level 3, left associativity, format "-oo_ R").
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.
Lemma
bound_itvE
Source code
( : numDomainType) ( : R) :Source code
((a \in `[a, b]) = (a <= b)) *
((b \in `[a, b]) = (a <= b)) *
((a \in `[a, b[) = (a < b)) *
((b \in `]a, b]) = (a < b)) *
(a \in `[a, +oo[) *
(a \in `]-oo, a]).
Proof.
Notation
"f @`[ a , b ]"
Source code
:=Source code
(`[minr (f a) (f b), maxr (f a) (f b)]) : ring_scope.
Notation
"f @`[ a , b ]"
Source code
:=Source code
(`[minr (f a) (f b), maxr (f a) (f b)]%classic) : classical_set_scope.
Notation
"f @`] a , b ["
Source code
:=Source code
(`](minr (f a) (f b)), (maxr (f a) (f b))[) : ring_scope.
Notation
"f @`] a , b ["
Source code
:=Source code
(`](minr (f a) (f b)), (maxr (f a) (f b))[%classic) : classical_set_scope.
Section image_interval.
Variable : realDomainType.
Implicit Types (a b : R) (f : R -> R).
Lemma
mono_mem_image_segment
Source code
: monotonic `[a, b] f ->Source code
{homo f : / x \in `[a, b] >-> x \in f @`[a, b]}.
Proof.
Lemma
mono_mem_image_itvoo
Source code
: strict_monotonic `[a, b] f ->Source code
{homo f : / x \in `]a, b[ >-> x \in f @`]a, b[}.
Proof.
move=> []/[dup] => [/le_mono_in|/le_nmono_in] flt fle x xab;
have ltab : a < b by rewrite (itvP xab).
have: f a <= f b by rewrite flt ?bound_itvE ltW.
by case: leP => // fafb _; rewrite in_itv/= !fle ?in_itv/= ?(itvP xab, lexx).
have: f a >= f b by rewrite flt ?bound_itvE ?ltW.
by case: leP => // fafb _; rewrite in_itv/= !fle ?in_itv/= ?(itvP xab, lexx).
Qed.
have ltab : a < b by rewrite (itvP xab).
have: f a <= f b by rewrite flt ?bound_itvE ltW.
by case: leP => // fafb _; rewrite in_itv/= !fle ?in_itv/= ?(itvP xab, lexx).
have: f a >= f b by rewrite flt ?bound_itvE ?ltW.
by case: leP => // fafb _; rewrite in_itv/= !fle ?in_itv/= ?(itvP xab, lexx).
Qed.
Lemma
mono_surj_image_segment
Source code
: a <= b ->Source code
monotonic `[a, b] f -> set_surj `[a, b] (f @`[a, b]) f ->
(f @` `[a, b] = f @`[a, b])%classic.
Proof.
Lemma
inc_segment_image
Source code
: f a <= f b -> f @`[a, b] = `[f a, f b].Source code
Proof.
Lemma
dec_segment_image
Source code
: f b <= f a -> f @`[a, b] = `[f b, f a].Source code
Proof.
Lemma
inc_surj_image_segment
Source code
: a <= b ->Source code
{in `[a, b] &, {homo f : / x <= y}} ->
set_surj `[a, b] `[f a, f b] f ->
f @` `[a, b] = `[f a, f b]%classic.
Proof.
move=> leab fle f_surj; have fafb : f a <= f b by rewrite fle ?bound_itvE.
by rewrite mono_surj_image_segment ?inc_segment_image//; left.
Qed.
by rewrite mono_surj_image_segment ?inc_segment_image//; left.
Qed.
Lemma
dec_surj_image_segment
Source code
: a <= b ->Source code
{in `[a, b] &, {homo f : /~ x <= y}} ->
set_surj `[a, b] `[f b, f a] f ->
f @` `[a, b] = `[f b, f a]%classic.
Proof.
move=> leab fge f_surj; have fafb : f b <= f a by rewrite fge ?bound_itvE.
by rewrite mono_surj_image_segment ?dec_segment_image//; right.
Qed.
by rewrite mono_surj_image_segment ?dec_segment_image//; right.
Qed.
Lemma
inc_surj_image_segmentP
Source code
: a <= b ->Source code
{in `[a, b] &, {homo f : / x <= y}} ->
set_surj `[a, b] `[f a, f b] f ->
forall , reflect (exists2 , x \in `[a, b] & f x = y) (y \in `[f a, f b]).
Proof.
Lemma
dec_surj_image_segmentP
Source code
: a <= b ->Source code
{in `[a, b] &, {homo f : /~ x <= y}} ->
set_surj `[a, b] `[f b, f a] f ->
forall , reflect (exists2 , x \in `[a, b] & f x = y) (y \in `[f b, f a]).
Proof.
Lemma
mono_surj_image_segmentP
Source code
: a <= b ->Source code
monotonic `[a, b] f -> set_surj `[a, b] (f @`[a, b]) f ->
forall , reflect (exists2 , x \in `[a, b] & f x = y) (y \in f @`[a, b]).
Proof.
End image_interval.
Lemma
bigcup_ballT
Source code
{ : realType} : \bigcup_ ball (0%R : R) n%:R = setT.Source code
Proof.
Section nbhs_pseudoMetricType.
Context { : numDomainType} { : pseudoMetricType R}.
Lemma
ex_ball_sig
Source code
( : T) ( : set T) :Source code
~ (forall
eps
Source code
: {posnum R}, ~ (ball x eps%:num `<=` ~` P)) ->Source code
{ : {posnum R} | ball x d%:num `<=` ~` P}.
Proof.
Lemma
nbhsC
Source code
( : T) ( : set T) :Source code
~ (forall
eps
Source code
: {posnum R}, ~ (ball x eps%:num `<=` ~` P)) ->Source code
nbhs x (~` P).
Proof.
Lemma
nbhsC_ball
Source code
( : T) ( : set T) :Source code
nbhs x (~` P) -> { : {posnum R} | ball x d%:num `<=` ~` P}.
Proof.
Lemma
nbhs_ex
Source code
( : T) ( : T -> Prop) : nbhs x P ->Source code
{ : {posnum R} | forall , ball x d%:num y -> P y}.
Proof.
End nbhs_pseudoMetricType.
Global Instance
Proper_dnbhs_numFieldType
Source code
( : numFieldType) ( : R) :Source code
ProperFilter x^'.
Proof.
#[global] Hint Extern 0 (ProperFilter _^') =>
solve[apply: Proper_dnbhs_numFieldType] : typeclass_instances.
Definition
pinfty_nbhs
Source code
( : numFieldType) : set_system R :=Source code
fun => exists , M \is Num.real /\ forall , M < x -> P x.
Arguments pinfty_nbhs R : clear implicits.
Definition
ninfty_nbhs
Source code
( : numFieldType) : set_system R :=Source code
fun => exists , M \is Num.real /\ forall , x < M -> P x.
Arguments ninfty_nbhs R : clear implicits.
Notation
"+oo_ R"
Source code
:= (pinfty_nbhs R) (only parsing) : ring_scope.Source code
Notation
"-oo_ R"
Source code
:= (ninfty_nbhs R) (only parsing) : ring_scope.Source code
Notation
"+oo"
Source code
:= (pinfty_nbhs _) : ring_scope.Source code
Notation
"-oo"
Source code
:= (ninfty_nbhs _) : ring_scope.Source code
Lemma
ninftyN
Source code
{ : numFieldType} : (- x : R)%R @[ --> -oo] = +oo.Source code
Proof.
Lemma
ninfty
Source code
{ : numFieldType} : (- x : R)%R @[ --> +oo] = -oo.Source code
Proof.
Section infty_nbhs_instances.
Context { : numFieldType}.
Implicit Types r : R.
Global Instance
proper_pinfty_nbhs
Source code
: ProperFilter (pinfty_nbhs R).Source code
Proof.
apply Build_ProperFilter_ex.
by move=> P [M [Mreal MP]]; exists (M + 1); apply MP; rewrite ltrDl.
split=> /= [|P Q [MP [MPr gtMP]] [MQ [MQr gtMQ]] |P Q sPQ [M [Mr gtM]]].
- by exists 0.
- exists (maxr MP MQ); split=> [|x]; first exact: max_real.
by rewrite comparable_gt_max ?real_comparable // => /andP[/gtMP ? /gtMQ].
- by exists M; split => // ? /gtM /sPQ.
Qed.
by move=> P [M [Mreal MP]]; exists (M + 1); apply MP; rewrite ltrDl.
split=> /= [|P Q [MP [MPr gtMP]] [MQ [MQr gtMQ]] |P Q sPQ [M [Mr gtM]]].
- by exists 0.
- exists (maxr MP MQ); split=> [|x]; first exact: max_real.
by rewrite comparable_gt_max ?real_comparable // => /andP[/gtMP ? /gtMQ].
- by exists M; split => // ? /gtM /sPQ.
Qed.
Global Instance
proper_ninfty_nbhs
Source code
: ProperFilter (ninfty_nbhs R).Source code
Proof.
apply Build_ProperFilter_ex.
move=> P [M [Mr ltMP]]; exists (M - 1).
by apply: ltMP; rewrite gtrDl oppr_lt0.
split=> /= [|P Q [MP [MPr ltMP]] [MQ [MQr ltMQ]] |P Q sPQ [M [Mr ltM]]].
- by exists 0.
- exists (minr MP MQ); split=> [|x]; first exact: min_real.
by rewrite comparable_lt_min ?real_comparable // => /andP[/ltMP ? /ltMQ].
- by exists M; split => // x /ltM /sPQ.
Qed.
move=> P [M [Mr ltMP]]; exists (M - 1).
by apply: ltMP; rewrite gtrDl oppr_lt0.
split=> /= [|P Q [MP [MPr ltMP]] [MQ [MQr ltMQ]] |P Q sPQ [M [Mr ltM]]].
- by exists 0.
- exists (minr MP MQ); split=> [|x]; first exact: min_real.
by rewrite comparable_lt_min ?real_comparable // => /andP[/ltMP ? /ltMQ].
- by exists M; split => // x /ltM /sPQ.
Qed.
Lemma
nbhs_pinfty_gt
Source code
: r \is Num.real -> \forall \near +oo, r < x.Source code
Proof.
by exists r. Qed.
Lemma
nbhs_pinfty_ge
Source code
: r \is Num.real -> \forall \near +oo, r <= x.Source code
Proof.
Lemma
nbhs_ninfty_lt
Source code
: r \is Num.real -> \forall \near -oo, r > x.Source code
Proof.
by exists r. Qed.
Lemma
nbhs_ninfty_le
Source code
: r \is Num.real -> \forall \near -oo, r >= x.Source code
Proof.
Lemma
nbhs_pinfty_real
Source code
: \forall \near +oo, x \is @Num.real R.Source code
Proof.
Lemma
nbhs_ninfty_real
Source code
: \forall \near -oo, x \is @Num.real R.Source code
Proof.
Lemma
pinfty_ex_gt
Source code
( : R) ( : set R) : m \is Num.real ->Source code
(\forall \near +oo, A k) -> exists2 , m < M & A M.
Proof.
move=> m_real Agt; near (pinfty_nbhs R) => M.
by exists M; near: M => //; apply: nbhs_pinfty_gt.
Unshelve. all: by end_near. Qed.
by exists M; near: M => //; apply: nbhs_pinfty_gt.
Unshelve. all: by end_near. Qed.
Lemma
pinfty_ex_ge
Source code
( : R) ( : set R) : m \is Num.real ->Source code
(\forall \near +oo, A k) -> exists2 , m <= M & A M.
Proof.
move=> m_real Agt; near (pinfty_nbhs R) => M.
by exists M; near: M => //; apply: nbhs_pinfty_ge.
Unshelve. all: by end_near. Qed.
by exists M; near: M => //; apply: nbhs_pinfty_ge.
Unshelve. all: by end_near. Qed.
Lemma
pinfty_ex_gt0
Source code
( : set R) :Source code
(\forall \near +oo, A k) -> exists2 , M > 0 & A M.
Proof.
Lemma
near_pinfty_div2
Source code
( : set R) :Source code
(\forall \near +oo, A k) -> (\forall \near +oo, A (k / 2)).
Proof.
move=> [M [Mreal AM]]; exists (M * 2); split; first by rewrite realM.
by move=> x; rewrite -ltr_pdivlMr //; exact: AM.
Qed.
by move=> x; rewrite -ltr_pdivlMr //; exact: AM.
Qed.
Lemma
not_near_inftyP
Source code
( : pred R) :Source code
~ (\forall \near +oo, P x) <->
forall : R, M \is Num.real -> exists2 , M < x & ~ P x.
Proof.
Lemma
not_near_ninftyP
Source code
( : pred R):Source code
~ (\forall \near -oo, P x) <->
forall : R, M \is Num.real -> exists2 , x < M & ~ P x.
Proof.
End infty_nbhs_instances.
#[global] Hint Extern 0 (is_true (_ < ?x)) => match goal with
H : x \is_near _ |- _ => solve[near: x; now apply: nbhs_pinfty_gt] end : core.
#[global] Hint Extern 0 (is_true (_ <= ?x)) => match goal with
H : x \is_near _ |- _ => solve[near: x; now apply: nbhs_pinfty_ge] end : core.
#[global] Hint Extern 0 (is_true (_ > ?x)) => match goal with
H : x \is_near _ |- _ => solve[near: x; now apply: nbhs_ninfty_lt] end : core.
#[global] Hint Extern 0 (is_true (_ >= ?x)) => match goal with
H : x \is_near _ |- _ => solve[near: x; now apply: nbhs_ninfty_le] end : core.
#[global] Hint Extern 0 (is_true (?x \is Num.real)) => match goal with
H : x \is_near _ |- _ => solve[near: x; now apply: nbhs_pinfty_real] end : core.
#[global] Hint Extern 0 (is_true (?x \is Num.real)) => match goal with
H : x \is_near _ |- _ => solve[near: x; now apply: nbhs_ninfty_real] end : core.
Section cvg_infty_numField.
Context { : numFieldType}.
Let
cvgryPnum
Source code
{ : set_system R} { : Filter F} : [<->Source code
F --> +oo;
forall , A \is Num.real -> \forall \near F, A <= x;
forall , A \is Num.real -> \forall \near F, A < x;
\forall \near +oo, \forall \near F, A < x;
\forall \near +oo, \forall \near F, A <= x ].
Proof.
tfae; first by move=> Foo A Areal; apply: Foo; apply: nbhs_pinfty_ge.
- move=> AF A Areal; near +oo_R => B.
by near do apply: (@lt_le_trans _ _ B) => //=; apply: AF.
- by move=> Foo; near do apply: Foo => //.
- by apply: filterS => ?; apply: filterS => ?; apply: ltW.
case=> [A [AR AF]] P [x [xR Px]]; near +oo_R => B.
by near do [apply: Px; apply: (@lt_le_trans _ _ B) => //]; apply: AF.
Unshelve. all: by end_near. Qed.
- move=> AF A Areal; near +oo_R => B.
by near do apply: (@lt_le_trans _ _ B) => //=; apply: AF.
- by move=> Foo; near do apply: Foo => //.
- by apply: filterS => ?; apply: filterS => ?; apply: ltW.
case=> [A [AR AF]] P [x [xR Px]]; near +oo_R => B.
by near do [apply: Px; apply: (@lt_le_trans _ _ B) => //]; apply: AF.
Unshelve. all: by end_near. Qed.
Let
cvgrNyPnum
Source code
{ : set_system R} { : Filter F} : [<->Source code
F --> -oo;
forall , A \is Num.real -> \forall \near F, A >= x;
forall , A \is Num.real -> \forall \near F, A > x;
\forall \near -oo, \forall \near F, A > x;
\forall \near -oo, \forall \near F, A >= x ].
Proof.
tfae; first by move=> Foo A Areal; apply: Foo; apply: nbhs_ninfty_le.
- move=> AF A Areal; near -oo_R => B.
by near do apply: (@le_lt_trans _ _ B) => //; apply: AF.
- by move=> Foo; near do apply: Foo => //.
- by apply: filterS => ?; apply: filterS => ?; apply: ltW.
case=> [A [AR AF]] P [x [xR Px]]; near -oo_R => B.
by near do [apply: Px; apply: (@le_lt_trans _ _ B) => //]; apply: AF.
Unshelve. all: end_near. Qed.
- move=> AF A Areal; near -oo_R => B.
by near do apply: (@le_lt_trans _ _ B) => //; apply: AF.
- by move=> Foo; near do apply: Foo => //.
- by apply: filterS => ?; apply: filterS => ?; apply: ltW.
case=> [A [AR AF]] P [x [xR Px]]; near -oo_R => B.
by near do [apply: Px; apply: (@le_lt_trans _ _ B) => //]; apply: AF.
Unshelve. all: end_near. Qed.
Context {} { : set_system T} { : Filter F}.
Implicit Types f : T -> R.
Lemma
cvgryPger
Source code
:Source code
f @ F --> +oo <-> forall , A \is Num.real -> \forall \near F, A <= f x.
Proof.
Lemma
cvgryPgtr
Source code
:Source code
f @ F --> +oo <-> forall , A \is Num.real -> \forall \near F, A < f x.
Proof.
Lemma
cvgryPgty
Source code
:Source code
f @ F --> +oo <-> \forall \near +oo, \forall \near F, A < f x.
Proof.
Lemma
cvgryPgey
Source code
:Source code
f @ F --> +oo <-> \forall \near +oo, \forall \near F, A <= f x.
Proof.
Lemma
cvgrNyPler
Source code
:Source code
f @ F --> -oo <-> forall , A \is Num.real -> \forall \near F, A >= f x.
Proof.
Lemma
cvgrNyPltr
Source code
:Source code
f @ F --> -oo <-> forall , A \is Num.real -> \forall \near F, A > f x.
Proof.
Lemma
cvgrNyPltNy
Source code
:Source code
f @ F --> -oo <-> \forall \near -oo, \forall \near F, A > f x.
Proof.
Lemma
cvgrNyPleNy
Source code
:Source code
f @ F --> -oo <-> \forall \near -oo, \forall \near F, A >= f x.
Proof.
Lemma
cvgry_ger
Source code
:Source code
f @ F --> +oo -> forall , A \is Num.real -> \forall \near F, A <= f x.
Proof.
Lemma
cvgry_gtr
Source code
:Source code
f @ F --> +oo -> forall , A \is Num.real -> \forall \near F, A < f x.
Proof.
Lemma
cvgrNy_ler
Source code
:Source code
f @ F --> -oo -> forall , A \is Num.real -> \forall \near F, A >= f x.
Proof.
Lemma
cvgrNy_ltr
Source code
:Source code
f @ F --> -oo -> forall , A \is Num.real -> \forall \near F, A > f x.
Proof.
Lemma
cvgNry
Source code
: (- f @ F --> +oo) <-> (f @ F --> -oo).Source code
Proof.
rewrite cvgrNyPler cvgryPger; split=> Foo A Areal;
by near do rewrite -lerN2 ?opprK; apply: Foo; rewrite rpredN.
Unshelve. all: end_near. Qed.
by near do rewrite -lerN2 ?opprK; apply: Foo; rewrite rpredN.
Unshelve. all: end_near. Qed.
Lemma
cvgNrNy
Source code
: (- f @ F --> -oo) <-> (f @ F --> +oo).Source code
End cvg_infty_numField.
Section cvg_infty_realField.
Context { : realFieldType}.
Context {} { : set_system T} { : Filter F} ( : T -> R).
Lemma
cvgryPge
Source code
: f @ F --> +oo <-> forall , \forall \near F, A <= f x.Source code
Lemma
cvgryPgt
Source code
: f @ F --> +oo <-> forall , \forall \near F, A < f x.Source code
Lemma
cvgrNyPle
Source code
: f @ F --> -oo <-> forall , \forall \near F, A >= f x.Source code
Proof.
Lemma
cvgrNyPlt
Source code
: f @ F --> -oo <-> forall , \forall \near F, A > f x.Source code
Proof.
Lemma
cvgry_ge
Source code
: f @ F --> +oo -> forall , \forall \near F, A <= f x.Source code
Proof.
Lemma
cvgry_gt
Source code
: f @ F --> +oo -> forall , \forall \near F, A < f x.Source code
Proof.
Lemma
cvgrNy_le
Source code
: f @ F --> -oo -> forall , \forall \near F, A >= f x.Source code
Proof.
Lemma
cvgrNy_lt
Source code
: f @ F --> -oo -> forall , \forall \near F, A > f x.Source code
Proof.
End cvg_infty_realField.
Lemma
cvgr_expr2
Source code
{ : realFieldType} : (x ^+ 2 : R) @[ --> +oo] --> +oo.Source code
Proof.
Lemma
cvgr_idn
Source code
{ : realType} : (n%:R : R) @[ --> \oo] --> +oo.Source code
Proof.
Lemma
cvgrnyP
Source code
{ : realType} {} { : set_system T} { : Filter F} ( : T -> nat) :Source code
(((f n)%:R : R) @[ --> F] --> +oo) <-> (f @ F --> \oo).
Proof.
Section gt0_cvg.
Context { : realFieldType} { : set_system R} { : Filter F}.
Variables ( : R) ( : R -> R).
Hypothesis : 0 < M.
Lemma
gt0_cvgMlNy
Source code
: (f r) @[ --> F] --> -oo -> (f r * M)%R @[ --> F] --> -oo.Source code
Proof.
Lemma
gt0_cvgMrNy
Source code
: (f r) @[ --> F] --> -oo -> (M * f r)%R @[ --> F] --> -oo.Source code
Proof.
Lemma
gt0_cvgMly
Source code
: f r @[ --> F] --> +oo -> (f r * M)%R @[ --> F] --> +oo.Source code
Proof.
Lemma
gt0_cvgMry
Source code
: f r @[ --> F] --> +oo -> (M * f r)%R @[ --> F] --> +oo.Source code
Proof.
End gt0_cvg.
Lemma
cvgNy_compNP
Source code
{ : topologicalType} { : numFieldType} ( : R -> T)Source code
( : set_system T) :
f x @[ --> -oo] --> l <-> (f \o -%R) x @[ --> +oo] --> l.
Proof.
Notation
cvgyNP
Source code
:= cvgNy_compNP (only parsing).Source code
Lemma
cvgy_compNP
Source code
{ : topologicalType} { : numFieldType} ( : R -> T)Source code
( : set_system T) :
f x @[ --> +oo] --> l <-> (f \o -%R) x @[ --> -oo] --> l.
Proof.
Section monotonic_itv_bigcup.
Context { : realType}.
Implicit Types (F : R -> R) (a : R).
Lemma
decreasing_itvNyo_bigcup
Source code
:Source code
{in `[a, +oo[ &, {homo F : /~ x < y}} ->
F x @[ --> +oo] --> -oo ->
(`]-oo, F a[ = \bigcup_ `]F (a + i.+1%:R), F a[)%classic.
Proof.
move=> dF nyF; rewrite itvNy_bnd_bigcup_BLeft eqEsubset; split.
- move=> y/= [n _]/=; rewrite in_itv/= => /andP[Fany yFa].
have [i iFan] : exists , F (a + i.+1%:R) < F a - n%:R.
move/cvgrNy_lt : nyF.
move/(_ (F a - n%:R)) => [z [zreal zFan]].
by exists (truncn (z - a)); rewrite zFan// -ltrBlDl truncnS_gt.
by exists i => //=; rewrite in_itv/= yFa (lt_le_trans _ Fany).
- move=> z/= [n _ /=]; rewrite in_itv/= => /andP[Fanz zFa].
exists (truncn (F a - F (a + n.+1%:R))).+1 => //=.
rewrite in_itv/= zFa andbT lerBlDr -lerBlDl ltW//.
by rewrite -truncn_le_nat le_truncn// lerB// ltW.
Qed.
- move=> y/= [n _]/=; rewrite in_itv/= => /andP[Fany yFa].
have [i iFan] : exists , F (a + i.+1%:R) < F a - n%:R.
move/cvgrNy_lt : nyF.
move/(_ (F a - n%:R)) => [z [zreal zFan]].
by exists (truncn (z - a)); rewrite zFan// -ltrBlDl truncnS_gt.
by exists i => //=; rewrite in_itv/= yFa (lt_le_trans _ Fany).
- move=> z/= [n _ /=]; rewrite in_itv/= => /andP[Fanz zFa].
exists (truncn (F a - F (a + n.+1%:R))).+1 => //=.
rewrite in_itv/= zFa andbT lerBlDr -lerBlDl ltW//.
by rewrite -truncn_le_nat le_truncn// lerB// ltW.
Qed.
Lemma
decreasing_itvoo_bigcup
Source code
:Source code
{in `[a, +oo[ &, {homo F : /~ x < y}} ->
(`]F (a + n%:R), F a[ = \bigcup_( < n) `]F (a + i.+1%:R), F a[)%classic.
Proof.
move=> decrF; rewrite eqEsubset; split.
- move: n => [|n]; first by rewrite addr0 set_itvoo0.
by apply: (@bigcup_sup _ _ n) => /=.
- apply: bigcup_sub => k/= kn; apply: subset_itvr; rewrite bnd_simp.
move: kn; rewrite leq_eqVlt => /predU1P[<-//|kn].
by rewrite ltW// decrF ?in_itv/= ?andbT ?lerDl//= ltrD2l ltr_nat.
Qed.
- move: n => [|n]; first by rewrite addr0 set_itvoo0.
by apply: (@bigcup_sup _ _ n) => /=.
- apply: bigcup_sub => k/= kn; apply: subset_itvr; rewrite bnd_simp.
move: kn; rewrite leq_eqVlt => /predU1P[<-//|kn].
by rewrite ltW// decrF ?in_itv/= ?andbT ?lerDl//= ltrD2l ltr_nat.
Qed.
Lemma
increasing_itvNyo_bigcup
Source code
:Source code
{in `]-oo, a] &, {homo F : / x < y}} ->
F x @[ --> -oo] --> -oo ->
(`]-oo, F a] = \bigcup_ `]F (a - i.+1%:R), F a])%classic.
Proof.
move=> dF nyF; rewrite itvNy_bnd_bigcup_BLeft eqEsubset; split.
- move=> y/= [n _]/=; rewrite in_itv/= => /andP[Fany yFa].
have [i iFan] : exists , F (a - i.+1%:R) < F a - n%:R.
move/cvgrNy_lt : nyF => /(_ (F a - n%:R))[z [zreal zFan]].
exists (truncn (a - z)).
by rewrite zFan// ltrBlDr -ltrBlDl -truncn_le_nat.
by exists i => //=; rewrite in_itv/= yFa andbT (lt_le_trans _ Fany).
- move=> z/= [n _ /=]; rewrite in_itv/= => /andP[Fanz zFa].
exists (truncn (F a - F (a - n.+1%:R))).+1 => //=.
rewrite in_itv/= zFa andbT lerBlDr -lerBlDl ltW//.
by rewrite -truncn_le_nat le_truncn// lerB// ltW.
Qed.
- move=> y/= [n _]/=; rewrite in_itv/= => /andP[Fany yFa].
have [i iFan] : exists , F (a - i.+1%:R) < F a - n%:R.
move/cvgrNy_lt : nyF => /(_ (F a - n%:R))[z [zreal zFan]].
exists (truncn (a - z)).
by rewrite zFan// ltrBlDr -ltrBlDl -truncn_le_nat.
by exists i => //=; rewrite in_itv/= yFa andbT (lt_le_trans _ Fany).
- move=> z/= [n _ /=]; rewrite in_itv/= => /andP[Fanz zFa].
exists (truncn (F a - F (a - n.+1%:R))).+1 => //=.
rewrite in_itv/= zFa andbT lerBlDr -lerBlDl ltW//.
by rewrite -truncn_le_nat le_truncn// lerB// ltW.
Qed.
Lemma
increasing_itvoc_bigcup
Source code
:Source code
{in `]-oo, a] &, {homo F : / x < y}} ->
(`]F (a - n%:R), F a] = \bigcup_( < n) `]F (a - i.+1%:R), F a])%classic.
Proof.
move=> incrF; rewrite eqEsubset; split.
- move: n => [|n]; first by rewrite subr0 set_itvoc0.
by apply: (@bigcup_sup _ _ n) => /=.
- apply: bigcup_sub => k/= kn; apply: subset_itvr; rewrite bnd_simp.
move: kn; rewrite leq_eqVlt => /predU1P[<-//|kn].
by rewrite ltW// incrF ?in_itv/= ?andbT ?gerBl ?ler_ltB ?ltr_nat.
Qed.
- move: n => [|n]; first by rewrite subr0 set_itvoc0.
by apply: (@bigcup_sup _ _ n) => /=.
- apply: bigcup_sub => k/= kn; apply: subset_itvr; rewrite bnd_simp.
move: kn; rewrite leq_eqVlt => /predU1P[<-//|kn].
by rewrite ltW// incrF ?in_itv/= ?andbT ?gerBl ?ler_ltB ?ltr_nat.
Qed.
End monotonic_itv_bigcup.
Section open_closed_sets.
Context { : realFieldType}.
Implicit Types x y : R.
Lemma
open_lt
Source code
: open [set | x < y].Source code
Proof.
move=> x /=; rewrite -subr_gt0 => yDx_gt0. exists (y - x) => // z.
by rewrite /= ltr_distlC subrKC => /andP[].
Qed.
by rewrite /= ltr_distlC subrKC => /andP[].
Qed.
Lemma
open_gt
Source code
: open [set | x > y].Source code
Proof.
move=> x /=; rewrite -subr_gt0 => xDy_gt0; exists (x - y) => // z.
by rewrite /= ltr_distlC subKr => /andP[].
Qed.
by rewrite /= ltr_distlC subKr => /andP[].
Qed.
Lemma
open_neq
Source code
: open [set | x != y].Source code
Proof.
Lemma
interval_open
Source code
: ~~ bound_side true a -> ~~ bound_side false b ->Source code
open [set : R^o | x \in Interval a b].
Proof.
move: a b => [[]a|[]] [[]b|[]]// _ _.
- have -> : [set | a < x < b] = [set | a < x] `&` [set | x < b].
by rewrite predeqE => r; rewrite /mkset; split => [/andP[? ?] //|[-> ->]].
by apply openI; [exact: open_gt | exact: open_lt].
- by under eq_set do rewrite itv_ge// inE.
- by under eq_set do rewrite in_itv andbT/=; exact: open_gt.
- exact: open_lt.
- by rewrite (_ : mkset _ = setT); [rewrite predeqE | exact: openT].
Qed.
- have -> : [set | a < x < b] = [set | a < x] `&` [set | x < b].
by rewrite predeqE => r; rewrite /mkset; split => [/andP[? ?] //|[-> ->]].
by apply openI; [exact: open_gt | exact: open_lt].
- by under eq_set do rewrite itv_ge// inE.
- by under eq_set do rewrite in_itv andbT/=; exact: open_gt.
- exact: open_lt.
- by rewrite (_ : mkset _ = setT); [rewrite predeqE | exact: openT].
Qed.
Lemma
closed_le
Source code
: closed [set | x <= y].Source code
Proof.
Lemma
closed_ge
Source code
: closed [set | y <= x].Source code
Proof.
Lemma
closed_eq
Source code
: closed [set | x = y].Source code
Proof.
Lemma
interval_closed
Source code
: ~~ bound_side false a -> ~~ bound_side true b ->Source code
closed [set : R^o | x \in Interval a b].
Proof.
move: a b => [[]a|[]] [[]b|[]]// _ _;
do ?by under eq_set do rewrite itv_ge// inE falseE; apply: closed0.
- have -> : `[a, b]%classic = [set | x >= a] `&` [set | x <= b].
by rewrite predeqE => ?; rewrite /= in_itv/=; split=> [/andP[]|[->]].
by apply closedI; [exact: closed_ge | exact: closed_le].
- by under eq_set do rewrite in_itv andbT/=; exact: closed_ge.
- exact: closed_le.
Qed.
do ?by under eq_set do rewrite itv_ge// inE falseE; apply: closed0.
- have -> : `[a, b]%classic = [set | x >= a] `&` [set | x <= b].
by rewrite predeqE => ?; rewrite /= in_itv/=; split=> [/andP[]|[->]].
by apply closedI; [exact: closed_ge | exact: closed_le].
- by under eq_set do rewrite in_itv andbT/=; exact: closed_ge.
- exact: closed_le.
Qed.
End open_closed_sets.
#[global] Hint Extern 0 (open _) => now apply: open_gt : core.
#[global] Hint Extern 0 (open _) => now apply: open_lt : core.
#[global] Hint Extern 0 (open _) => now apply: open_neq : core.
#[global] Hint Extern 0 (closed _) => now apply: closed_ge : core.
#[global] Hint Extern 0 (closed _) => now apply: closed_le : core.
#[global] Hint Extern 0 (closed _) => now apply: closed_eq : core.
#[global] Hint Extern 0 (open _) => now apply: interval_open : core.
Section near_in_itv.
Context { : realFieldType} ( : R).
Lemma
near_in_itvoo
Source code
:Source code
{in `]a, b[, forall , \forall \near y, z \in `]a, b[}.
Proof.
Lemma
near_in_itvoy
Source code
:Source code
{in `]a, +oo[, forall , \forall \near y, z \in `]a, +oo[}.
Proof.
Lemma
near_in_itvNyo
Source code
:Source code
{in `]-oo, b[, forall , \forall \near y, z \in `]-oo, b[}.
Proof.
End near_in_itv.
Lemma
nbhs_infty_gtr
Source code
{ : archiRealFieldType} ( : R) :Source code
\forall \near \oo, r < n%:R.
Proof.
Lemma
near_infty_natSinv_lt
Source code
( : archiRealFieldType) ( : {posnum R}) :Source code
\forall \near \oo, n.+1%:R^-1 < e%:num.
Proof.
Lemma
near_infty_natSinv_expn_lt
Source code
( : archiRealFieldType) ( : {posnum R}) :Source code
\forall \near \oo, 1 / 2 ^+ n < e%:num.
Proof.
near=> n.
rewrite mul1r invf_plt ?unfold_in//=; apply: upper_nthrootP.
near: n; eexists; last by move=> m; exact.
by [].
Unshelve. all: by end_near. Qed.
rewrite mul1r invf_plt ?unfold_in//=; apply: upper_nthrootP.
near: n; eexists; last by move=> m; exact.
by [].
Unshelve. all: by end_near. Qed.
Section interval.
Variable : numDomainType.
Definition
is_interval
Source code
( : set R) :=Source code
forall , E x -> E y -> forall , x <= z <= y -> E z.
Lemma
is_intervalPlt
Source code
( : set R) :Source code
is_interval E <-> forall , E x -> E y -> forall , x < z < y -> E z.
Proof.
Lemma
interval_is_interval
Source code
( : interval R) : is_interval [set` i].Source code
Proof.
End interval.
Lemma
interval_unbounded_setT
Source code
{ : realFieldType} ( : set R) : is_interval X ->Source code
~ has_lbound X -> ~ has_ubound X -> X = setT.
Proof.
Section open_union_rat.
Variable : realType.
Implicit Types A U : set R.
Let
ointsub
Source code
:= [/\ open A, is_interval A & A `<=` U].Source code
Let
ointsub_rat
Source code
:= [set | ointsub A U /\ A (ratr q)].Source code
Let
ointsub_rat0
Source code
: ointsub_rat set0 q = set0.Source code
Definition
bigcup_ointsub
Source code
:= \bigcup_( in ointsub_rat U q) A.Source code
Lemma
bigcup_ointsub0
Source code
: bigcup_ointsub set0 q = set0.Source code
Proof.
Lemma
open_bigcup_ointsub
Source code
: open (bigcup_ointsub U q).Source code
Proof.
Lemma
is_interval_bigcup_ointsub
Source code
: is_interval (bigcup_ointsub U q).Source code
Proof.
Lemma
bigcup_ointsub_sub
Source code
: bigcup_ointsub U q `<=` U.Source code
Proof.
by move=> y [A [[oA _ +] _ Ay]]; exact. Qed.
Lemma
bigcup_ointsub_sup
Source code
:Source code
open A -> is_interval A -> A `<=` U -> A (ratr q) ->
A `<=` bigcup_ointsub U q.
Proof.
by move=> oA itvA AU Aq x Ax; exists A. Qed.
Lemma
bigcup_ointsub_mem
Source code
: bigcup_ointsub U q r -> ratr q \in U.Source code
Proof.
see `open_disjoint_itv` in `normed_module.v` for a cover of
disjoint open intervals
Lemma open_bigcup_rat
Source code
: open U ->Source code
U = \bigcup_( in [set | ratr q \in U]) bigcup_ointsub U q.
Proof.
move=> oU; have [->|U0] := eqVneq U set0.
by rewrite bigcup0// => q _; rewrite bigcup_ointsub0.
apply/seteqP; split=> [x Ux|x [p _ Ipx]]; last exact: bigcup_ointsub_sub Ipx.
suff [q Iqx] : exists , bigcup_ointsub U q x.
by exists q => //=; rewrite in_setE; case: Iqx => A [[_ _ +] ? _]; exact.
have : nbhs x U by rewrite nbhsE /=; exists U.
rewrite -nbhs_ballE /nbhs_ball /nbhs_ball_ => -[_/posnumP[r] xrU].
have /rat_in_itvoo[q qxxr] : (x - r%:num < x + r%:num)%R.
by rewrite ltrBlDr -addrA ltrDl.
exists q, `](x - r%:num)%R, (x + r%:num)%R[%classic; last first.
by rewrite /= in_itv/= ltrBlDl ltrDr// ltrDl//; apply/andP.
split=> //; split; [exact: interval_open|exact: interval_is_interval|].
move=> y /=; rewrite in_itv/= => /andP[xy yxr]; apply xrU => /=.
rewrite /ball /= /ball_ /= in xrU *; have [yx|yx] := leP x y.
by rewrite ler0_norm ?subr_le0// opprB ltrBlDl.
by rewrite gtr0_norm ?subr_gt0// ltrBlDr -ltrBlDl.
Qed.
by rewrite bigcup0// => q _; rewrite bigcup_ointsub0.
apply/seteqP; split=> [x Ux|x [p _ Ipx]]; last exact: bigcup_ointsub_sub Ipx.
suff [q Iqx] : exists , bigcup_ointsub U q x.
by exists q => //=; rewrite in_setE; case: Iqx => A [[_ _ +] ? _]; exact.
have : nbhs x U by rewrite nbhsE /=; exists U.
rewrite -nbhs_ballE /nbhs_ball /nbhs_ball_ => -[_/posnumP[r] xrU].
have /rat_in_itvoo[q qxxr] : (x - r%:num < x + r%:num)%R.
by rewrite ltrBlDr -addrA ltrDl.
exists q, `](x - r%:num)%R, (x + r%:num)%R[%classic; last first.
by rewrite /= in_itv/= ltrBlDl ltrDr// ltrDl//; apply/andP.
split=> //; split; [exact: interval_open|exact: interval_is_interval|].
move=> y /=; rewrite in_itv/= => /andP[xy yxr]; apply xrU => /=.
rewrite /ball /= /ball_ /= in xrU *; have [yx|yx] := leP x y.
by rewrite ler0_norm ?subr_le0// opprB ltrBlDl.
by rewrite gtr0_norm ?subr_gt0// ltrBlDr -ltrBlDl.
Qed.
End open_union_rat.
Section ball_realFieldType.
Variables ( : realFieldType).
Lemma
ball0
Source code
( : R) : ball a r = set0 <-> r <= 0.Source code
Proof.
End ball_realFieldType.
Section interval_realType.
Variable : realType.
Lemma
interval_left_unbounded_interior
Source code
( : set R) : is_interval X ->Source code
~ has_lbound X -> has_ubound X -> X° = [set | r < sup X].
Proof.
move=> iX lX uX; rewrite eqEsubset; split; first exact: right_bounded_interior.
rewrite -(open_subsetE _ (@open_lt _ _)) => r rsupX.
move/has_lbPn : lX => /(_ r)[y Xy yr].
have hsX : has_sup X by split => //; exists y.
have /sup_adherent/(_ hsX)[e Xe] : 0 < sup X - r by rewrite subr_gt0.
by rewrite subKr => re; apply: (iX y e); rewrite ?ltW.
Qed.
rewrite -(open_subsetE _ (@open_lt _ _)) => r rsupX.
move/has_lbPn : lX => /(_ r)[y Xy yr].
have hsX : has_sup X by split => //; exists y.
have /sup_adherent/(_ hsX)[e Xe] : 0 < sup X - r by rewrite subr_gt0.
by rewrite subKr => re; apply: (iX y e); rewrite ?ltW.
Qed.
Lemma
interval_right_unbounded_interior
Source code
( : set R) : is_interval X ->Source code
has_lbound X -> ~ has_ubound X -> X° = [set | inf X < r].
Proof.
move=> iX lX uX; rewrite eqEsubset; split; first exact: left_bounded_interior.
rewrite -(open_subsetE _ (@open_gt _ _)) => r infXr.
move/has_ubPn : uX => /(_ r)[y Xy yr].
have hiX : has_inf X by split => //; exists y.
have /inf_adherent/(_ hiX)[e Xe] : 0 < r - inf X by rewrite subr_gt0.
by rewrite addrC subrK => er; apply: (iX e y); rewrite ?ltW.
Qed.
rewrite -(open_subsetE _ (@open_gt _ _)) => r infXr.
move/has_ubPn : uX => /(_ r)[y Xy yr].
have hiX : has_inf X by split => //; exists y.
have /inf_adherent/(_ hiX)[e Xe] : 0 < r - inf X by rewrite subr_gt0.
by rewrite addrC subrK => er; apply: (iX e y); rewrite ?ltW.
Qed.
Lemma
interval_bounded_interior
Source code
( : set R) : is_interval X ->Source code
has_lbound X -> has_ubound X -> X° = [set | inf X < r < sup X].
Proof.
move=> iX bX aX; rewrite eqEsubset; split=> [r Xr|].
apply/andP; split;
[exact: left_bounded_interior|exact: right_bounded_interior].
rewrite -open_subsetE; first exact: (@interval_open _ (BRight _) (BLeft _)).
move=> r /andP[iXr rsX].
have [X0|/set0P X0] := eqVneq X set0.
by move: (lt_trans iXr rsX); rewrite X0 inf_out ?sup_out ?ltxx // => - [[]].
have hiX : has_inf X by split.
have /inf_adherent/(_ hiX)[e Xe] : 0 < r - inf X by rewrite subr_gt0.
rewrite addrC subrK => er.
have hsX : has_sup X by split.
have /sup_adherent/(_ hsX)[f Xf] : 0 < sup X - r by rewrite subr_gt0.
by rewrite subKr => rf; apply: (iX e f); rewrite ?ltW.
Qed.
apply/andP; split;
[exact: left_bounded_interior|exact: right_bounded_interior].
rewrite -open_subsetE; first exact: (@interval_open _ (BRight _) (BLeft _)).
move=> r /andP[iXr rsX].
have [X0|/set0P X0] := eqVneq X set0.
by move: (lt_trans iXr rsX); rewrite X0 inf_out ?sup_out ?ltxx // => - [[]].
have hiX : has_inf X by split.
have /inf_adherent/(_ hiX)[e Xe] : 0 < r - inf X by rewrite subr_gt0.
rewrite addrC subrK => er.
have hsX : has_sup X by split.
have /sup_adherent/(_ hsX)[f Xf] : 0 < sup X - r by rewrite subr_gt0.
by rewrite subKr => rf; apply: (iX e f); rewrite ?ltW.
Qed.
Lemma
interior_set1
Source code
( : R) : [set a]° = set0.Source code
Proof.
Lemma
interior_itv_bnd
Source code
( : R) ( : bool) :Source code
[set` Interval (BSide a x) (BSide b y)]° = `]x, y[%classic.
Proof.
have [|xy] := leP y x.
rewrite le_eqVlt => /predU1P[-> |yx].
by case: a; case: b; rewrite set_itvoo0 ?set_itvE ?interior_set1 ?interior0.
rewrite !set_itv_ge ?interior0//.
- by case: a; case: b; rewrite bnd_simp -?leNgt -?ltNge ?ltW.
- by rewrite bnd_simp -leNgt ltW.
rewrite interval_bounded_interior//; first exact: interval_is_interval.
rewrite inf_itv; first by case: a; case b; rewrite bnd_simp ?ltW.
rewrite sup_itv; first by case: a; case b; rewrite bnd_simp ?ltW.
exact: set_itvoo.
Qed.
rewrite le_eqVlt => /predU1P[-> |yx].
by case: a; case: b; rewrite set_itvoo0 ?set_itvE ?interior_set1 ?interior0.
rewrite !set_itv_ge ?interior0//.
- by case: a; case: b; rewrite bnd_simp -?leNgt -?ltNge ?ltW.
- by rewrite bnd_simp -leNgt ltW.
rewrite interval_bounded_interior//; first exact: interval_is_interval.
rewrite inf_itv; first by case: a; case b; rewrite bnd_simp ?ltW.
rewrite sup_itv; first by case: a; case b; rewrite bnd_simp ?ltW.
exact: set_itvoo.
Qed.
Lemma
interior_itv_bndy
Source code
( : R) ( : bool) :Source code
[set` Interval (BSide b x) (BInfty _ false)]° = `]x, +oo[%classic.
Proof.
rewrite interval_right_unbounded_interior//.
- exact: interval_is_interval.
- by apply: hasNubound_itv; rewrite lt_eqF.
- rewrite inf_itv; first by case: b; rewrite bnd_simp ?ltW.
by rewrite set_itvoy.
Qed.
- exact: interval_is_interval.
- by apply: hasNubound_itv; rewrite lt_eqF.
- rewrite inf_itv; first by case: b; rewrite bnd_simp ?ltW.
by rewrite set_itvoy.
Qed.
Lemma
interior_itv_Nybnd
Source code
( : R) ( : bool) :Source code
[set` Interval (BInfty _ true) (BSide b y)]° = `]-oo, y[%classic.
Proof.
rewrite interval_left_unbounded_interior//.
- exact: interval_is_interval.
- by apply: hasNlbound_itv; rewrite gt_eqF.
- rewrite sup_itv; first by case b; rewrite bnd_simp ?ltW.
exact: set_itvNyo.
Qed.
- exact: interval_is_interval.
- by apply: hasNlbound_itv; rewrite gt_eqF.
- rewrite sup_itv; first by case b; rewrite bnd_simp ?ltW.
exact: set_itvNyo.
Qed.
Lemma
interior_itv_Nyy
Source code
:Source code
[set` Interval (BInfty R true) (BInfty _ false)]° = `]-oo, +oo[%classic.
Proof.
Definition
interior_itv
Source code
:=Source code
(interior_itv_bnd, interior_itv_bndy, interior_itv_Nybnd, interior_itv_Nyy).
End interval_realType.