Require Import LibUtils List RealAdd.
Require Import Reals Psatz Morphisms.
Require Import mathcomp.ssreflect.ssreflect.
Require Import Reals mathcomp.ssreflect.ssreflect.
Require Import Coquelicot.Rcomplements.
Require Import Coquelicot.Rbar Coquelicot.Lub Coquelicot.Markov Coquelicot.Hierarchy.
Require Import Coquelicot.Rcomplements Coquelicot.Rbar Coquelicot.Markov Coquelicot.Iter Coquelicot.Lub.
Set Bullet Behavior "
Strict Subproofs".
Local Open Scope R_scope.
Require Coquelicot.Lim_seq.
Require Import Classical_Pred_Type.
Definition is_ELimSup_seq (
u :
nat ->
Rbar) (
l :
Rbar) :=
match l with
|
Finite l =>
forall eps :
posreal,
(
forall N :
nat,
exists n :
nat, (
N <=
n)%
nat /\
Rbar_lt (
l -
eps) (
u n))
/\ (
exists N :
nat,
forall n :
nat, (
N <=
n)%
nat ->
Rbar_lt (
u n) (
l +
eps))
|
p_infty =>
forall M :
R, (
forall N :
nat,
exists n :
nat, (
N <=
n)%
nat /\
Rbar_lt M (
u n))
|
m_infty =>
forall M :
R, (
exists N :
nat,
forall n :
nat, (
N <=
n)%
nat ->
Rbar_lt (
u n)
M)
end.
Lemma is_ELimSup_seq_fin (
u :
nat ->
R) (
l :
Rbar) :
is_ELimSup_seq u l <->
Lim_seq.is_LimSup_seq u l.
Proof.
Definition is_ELimInf_seq (
u :
nat ->
Rbar) (
l :
Rbar) :=
match l with
|
Finite l =>
forall eps :
posreal,
(
forall N :
nat,
exists n :
nat, (
N <=
n)%
nat /\
Rbar_lt (
u n) (
l +
eps))
/\ (
exists N :
nat,
forall n :
nat, (
N <=
n)%
nat ->
Rbar_lt (
l -
eps) (
u n))
|
p_infty =>
forall M :
R, (
exists N :
nat,
forall n :
nat, (
N <=
n)%
nat ->
Rbar_lt M (
u n))
|
m_infty =>
forall M :
R, (
forall N :
nat,
exists n :
nat, (
N <=
n)%
nat /\
Rbar_lt (
u n)
M)
end.
Lemma is_ELimInf_seq_fin (
u :
nat ->
R) (
l :
Rbar) :
is_ELimInf_seq u l <->
Lim_seq.is_LimInf_seq u l.
Proof.
Lemma is_ELimInf_opp_ELimSup_seq (
u :
nat ->
Rbar) (
l :
Rbar) :
is_ELimInf_seq (
fun n =>
Rbar_opp (
u n)) (
Rbar_opp l)
<->
is_ELimSup_seq u l.
Proof.
destruct l;
simpl.
-
intuition
;
specialize (
H eps);
destruct H as [
HH1 [
N2 HH2]]
;
try solve [
destruct (
HH1 N)
as [
x [??]]
;
exists x;
split;
trivial
;
destruct (
u x);
simpl in *;
lra
|
exists N2;
intros N ltN
;
specialize (
HH2 _ ltN)
;
destruct (
u N);
simpl in *;
lra
] .
-
intuition
;
specialize (
H (-
M)
N)
;
destruct H as [?[??]]
;
exists x;
split;
trivial
;
destruct (
u x);
simpl in *;
trivial;
lra.
-
intuition
;
specialize (
H (-
M))
;
destruct H as [
x ?]
;
exists x;
intros n nlt
;
specialize (
H n nlt)
;
destruct (
u n);
simpl in *;
trivial;
lra.
Qed.
Lemma is_ELimInf_seq_ext_loc (
u v :
nat ->
Rbar) (
l :
Rbar) :
eventually (
fun n =>
u n =
v n) ->
is_ELimInf_seq u l ->
is_ELimInf_seq v l.
Proof.
intros [
Neqq eqq]
lim1.
destruct l;
simpl in *.
-
intros eps.
specialize (
lim1 eps).
destruct lim1 as [
HH1 [
N2 HH2]].
split.
+
intros N.
destruct (
HH1 (
Nat.max N Neqq))
as [
x [
xlt lt2]].
exists x.
split.
*
etransitivity;
try apply xlt.
apply Nat.le_max_l.
*
rewrite <-
eqq;
trivial.
etransitivity;
try apply xlt.
apply Nat.le_max_r.
+
exists (
Nat.max N2 Neqq).
intros x xlt.
rewrite <-
eqq.
*
apply HH2.
etransitivity;
try apply xlt.
apply Nat.le_max_l.
*
etransitivity;
try apply xlt.
apply Nat.le_max_r.
-
intros M.
specialize (
lim1 M).
destruct lim1 as [
N lim1].
exists (
Nat.max N Neqq);
intros x xlt.
rewrite <-
eqq.
*
apply lim1.
etransitivity;
try apply xlt.
apply Nat.le_max_l.
*
etransitivity;
try apply xlt.
apply Nat.le_max_r.
-
intros M N.
specialize (
lim1 M (
Nat.max N Neqq)).
destruct lim1 as [
x [
xlt lt2]].
exists x.
split.
*
etransitivity;
try apply xlt.
apply Nat.le_max_l.
*
rewrite <-
eqq;
trivial.
etransitivity;
try apply xlt.
apply Nat.le_max_r.
Qed.
Lemma all_eventually (
P :
nat ->
Prop) :
(
forall x,
P x) ->
eventually P.
Proof.
intros.
exists 0%nat; auto.
Qed.
Lemma eventually_impl (
P Q :
nat ->
Prop) :
eventually (
fun n =>
P n ->
Q n) ->
eventually P ->
eventually Q.
Proof.
intros [
N1 ?] [
N2 ?].
exists (
Nat.max N1 N2).
intros N ltN.
apply H.
-
rewrite <-
ltN.
apply Nat.le_max_l.
-
apply H0.
rewrite <-
ltN.
apply Nat.le_max_r.
Qed.
Lemma eventually_and (
P Q :
nat ->
Prop) :
eventually P ->
eventually Q ->
eventually (
fun n =>
P n /\
Q n).
Proof.
intros [
N1 ?] [
N2 ?].
exists (
Nat.max N1 N2).
intros N ltN.
split.
-
apply H.
rewrite <-
ltN.
apply Nat.le_max_l.
-
apply H0.
rewrite <-
ltN.
apply Nat.le_max_r.
Qed.
Lemma is_ELimInf_seq_ext (
u v :
nat ->
Rbar) (
l :
Rbar) :
(
forall n,
u n =
v n)
->
is_ELimInf_seq u l ->
is_ELimInf_seq v l.
Proof.
Global Instance is_ELimInf_seq_proper :
Proper (
pointwise_relation _ eq ==>
eq ==>
iff)
is_ELimInf_seq.
Proof.
Lemma is_ELimSup_opp_ELimInf_seq (
u :
nat ->
Rbar) (
l :
Rbar) :
is_ELimSup_seq (
fun n =>
Rbar_opp (
u n)) (
Rbar_opp l)
<->
is_ELimInf_seq u l.
Proof.
Lemma is_ELimSup_seq_ext_loc (
u v :
nat ->
Rbar) (
l :
Rbar) :
eventually (
fun n =>
u n =
v n) ->
is_ELimSup_seq u l ->
is_ELimSup_seq v l.
Proof.
Lemma is_ELimSup_seq_ext (
u v :
nat ->
Rbar) (
l :
Rbar) :
(
forall n,
u n =
v n)
->
is_ELimSup_seq u l ->
is_ELimSup_seq v l.
Proof.
Global Instance is_ELimSup_seq_proper :
Proper (
pointwise_relation _ eq ==>
eq ==>
iff)
is_ELimSup_seq.
Proof.
Example posreal1 :
posreal :=
mkposreal 1
Rlt_0_1.
Lemma is_ELimSup_infSup_seq (
u :
nat ->
Rbar) (
l :
Rbar) :
is_ELimSup_seq u l <->
Lim_seq.is_inf_seq (
fun m =>
Lim_seq.Sup_seq (
fun n =>
u (
n +
m)%
nat))
l.
Proof.
unfold is_ELimSup_seq,
Lim_seq.is_inf_seq.
destruct l;
simpl.
-
split.
+
intros.
split;
intros.
*
specialize (
H eps).
destruct H as [?
_].
apply Lim_seq.Sup_seq_minor_lt.
destruct (
H n)
as [
x [??]].
exists (
x-
n)%
nat.
rewrite Nat.sub_add;
trivial.
*
specialize (
H (
pos_div_2 eps)).
destruct H as [
_ [??]].
exists x.
unfold Lim_seq.Sup_seq,
proj1_sig.
match_destr.
red in i.
destruct x0;
simpl in *;
try tauto.
--
destruct (
i (
pos_div_2 eps))
as [?[??]].
specialize (
H (
x0 +
x)%
nat).
cut_to H;
try lia.
match_destr_in H1;
try tauto.
simpl in *.
lra.
--
destruct (
i (
r +
eps / 2)).
specialize (
H (
x0 +
x)%
nat).
cut_to H;
try lia.
match_destr_in H0.
simpl in *.
lra.
+
intros.
split;
intros.
*
specialize (
H eps).
destruct H as [?
_].
specialize (
H N).
apply Lim_seq.Sup_seq_minor_lt in H.
destruct H as [??].
exists (
x +
N)%
nat.
split;
try lia.
match_destr.
*
specialize (
H eps).
destruct H as [
_ ?].
destruct H as [??].
exists x;
intros.
apply (
Rbar_not_le_lt).
intros ?.
apply Rbar_lt_not_le in H.
apply H.
apply (
Lim_seq.Sup_seq_minor_le _ _ (
n -
x)%
nat).
rewrite Nat.sub_add;
trivial.
-
split;
intros.
destruct (
H M n)
as [? [??]].
+
apply Lim_seq.Sup_seq_minor_lt.
exists (
x -
n)%
nat.
rewrite Nat.sub_add;
trivial.
+
specialize (
H M N).
apply Lim_seq.Sup_seq_minor_lt in H.
destruct H as [
x ?].
exists (
x +
N)%
nat.
split;
trivial;
try lia.
-
split;
intros HH M.
+
specialize (
HH (
M-1)).
destruct HH as [
N HH].
exists N.
unfold Lim_seq.Sup_seq,
proj1_sig.
match_destr.
red in i.
destruct x;
simpl;
try tauto.
*
destruct (
i posreal1)
as [? [
n ?]];
simpl in *.
specialize (
HH (
n+
N)%
nat).
cut_to HH;
try lia.
match_destr_in H0;
try tauto.
simpl in *.
lra.
*
destruct (
i M)
as [
x ?].
specialize (
HH (
x+
N)%
nat).
cut_to HH;
try lia.
destruct (
u (
x+
N)%
nat);
simpl in *;
try lra.
+
destruct (
HH M)
as [
N ?].
exists N;
intros.
apply (
Rbar_not_le_lt M (
u n)).
intros ?.
apply Rbar_le_not_lt in H;
trivial.
apply (
Lim_seq.Sup_seq_minor_le _ _ (
n -
N)%
nat).
now rewrite MyNat.sub_add.
Qed.
Lemma is_ELimInf_supInf_seq (
u :
nat ->
Rbar) (
l :
Rbar) :
is_ELimInf_seq u l <->
Lim_seq.is_sup_seq (
fun m =>
Lim_seq.Inf_seq (
fun n =>
u (
n +
m)%
nat))
l.
Proof.
Lemma ex_ELimSup_seq (
u :
nat ->
Rbar) :
{
l :
Rbar |
is_ELimSup_seq u l}.
Proof.
Lemma ex_ELimInf_seq (
u :
nat ->
Rbar) :
{
l :
Rbar |
is_ELimInf_seq u l}.
Proof.
Definition ELimSup_seq (
u :
nat ->
Rbar) :=
proj1_sig (
ex_ELimSup_seq u).
Definition ELimInf_seq (
u :
nat ->
Rbar) :=
proj1_sig (
ex_ELimInf_seq u).
Lemma is_ELimSup_seq_correct (
u:
nat ->
Rbar) :
is_ELimSup_seq u (
ELimSup_seq u).
Proof.
Lemma is_ELimInf_seq_correct (
u:
nat ->
Rbar) :
is_ELimInf_seq u (
ELimInf_seq u).
Proof.
Lemma is_ELimSup_seq_unique (
u :
nat ->
Rbar) (
l :
Rbar) :
is_ELimSup_seq u l ->
ELimSup_seq u =
l.
Proof.
Lemma is_ELimInf_seq_unique (
u :
nat ->
Rbar) (
l :
Rbar) :
is_ELimInf_seq u l ->
ELimInf_seq u =
l.
Proof.
Lemma ELimInf_seq_fin (
u :
nat ->
R) :
ELimInf_seq u =
Lim_seq.LimInf_seq u.
Proof.
Lemma ELimSup_seq_fin (
u :
nat ->
R) :
ELimSup_seq u =
Lim_seq.LimSup_seq u.
Proof.
Lemma ELimSup_InfSup_seq (
u :
nat ->
Rbar) :
ELimSup_seq u =
Lim_seq.Inf_seq (
fun m =>
Lim_seq.Sup_seq (
fun n =>
u (
n +
m)%
nat)).
Proof.
Lemma ELimInf_SupInf_seq (
u :
nat ->
Rbar) :
ELimInf_seq u =
Lim_seq.Sup_seq (
fun m =>
Lim_seq.Inf_seq (
fun n =>
u (
n +
m)%
nat)).
Proof.
Lemma is_ELimSup_ELimInf_seq_le (
u :
nat ->
Rbar) (
ls li :
Rbar) :
is_ELimSup_seq u ls ->
is_ELimInf_seq u li ->
Rbar_le li ls.
Proof.
intros sup inf.
destruct ls;
destruct li;
simpl;
try tauto
;
simpl in *.
-
apply le_epsilon;
intros eps pos.
specialize (
sup (
pos_div_2 (
mkposreal _ pos))).
specialize (
inf (
pos_div_2 (
mkposreal _ pos))).
destruct sup as [
sup1 [
xs sup2]].
destruct inf as [
inf1 [
xi inf2]].
specialize (
sup2 (
xi +
xs)%
nat).
cut_to sup2;
try lia.
specialize (
inf2 (
xi +
xs)%
nat).
cut_to inf2;
try lia.
simpl in *.
destruct (
u (
xi +
xs)%
nat);
simpl in *;
lra.
-
destruct (
sup posreal1)
as [?[??]].
destruct (
inf (
r+1)).
specialize (
H0 (
x +
x0)%
nat).
cut_to H0;
try lia.
specialize (
H1 (
x +
x0)%
nat).
cut_to H1;
try lia.
destruct (
u (
x +
x0)%
nat);
simpl in *;
lra.
-
destruct (
inf posreal1)
as [?[??]].
destruct (
sup (
r-1)).
specialize (
H0 (
x +
x0)%
nat).
cut_to H0;
try lia.
specialize (
H1 (
x +
x0)%
nat).
cut_to H1;
try lia.
destruct (
u (
x +
x0)%
nat);
simpl in *;
lra.
-
destruct (
sup 0).
destruct (
inf 0).
specialize (
H (
x +
x0)%
nat).
cut_to H;
try lia.
specialize (
H0 (
x +
x0)%
nat).
cut_to H0;
try lia.
destruct (
u (
x +
x0)%
nat);
simpl in *;
lra.
Qed.
Lemma ELimSup_ELimInf_seq_le (
u :
nat ->
Rbar) :
Rbar_le (
ELimInf_seq u) (
ELimSup_seq u).
Proof.
Lemma is_ELimSup_seq_const (
a :
Rbar) :
is_ELimSup_seq (
fun _ =>
a)
a.
Proof.
destruct a; simpl; intros.
- split.
+ intros.
exists N.
split; trivial.
destruct eps; simpl; lra.
+ exists 0%nat; intros.
destruct eps; simpl; lra.
- exists N.
split; trivial.
- exists 0%nat.
trivial.
Qed.
Lemma ELimSup_seq_const (
a :
Rbar) :
ELimSup_seq (
fun _ =>
a) =
a.
Proof.
Lemma is_ELimInf_seq_const (
a :
Rbar) :
is_ELimInf_seq (
fun _ =>
a)
a.
Proof.
Lemma ELimInf_seq_const (
a :
Rbar) :
ELimInf_seq (
fun _ =>
a) =
a.
Proof.
Lemma ELimSup_seq_opp (
u :
nat ->
Rbar) :
ELimSup_seq (
fun n =>
Rbar_opp (
u n)) =
Rbar_opp (
ELimInf_seq u).
Proof.
Lemma ELimInf_seq_opp (
u :
nat ->
Rbar) :
ELimInf_seq (
fun n =>
Rbar_opp (
u n)) =
Rbar_opp (
ELimSup_seq u).
Proof.
Lemma is_ELimSup_le (
u v :
nat ->
Rbar) (
lu lv:
Rbar) :
eventually (
fun n :
nat =>
Rbar_le (
u n) (
v n)) ->
is_ELimSup_seq u lu ->
is_ELimSup_seq v lv ->
Rbar_le lu lv.
Proof.
intros [
N le]
sup1 sup2.
destruct lu;
destruct lv;
simpl in *;
trivial.
-
destruct (
Rle_dec r r0);
trivial.
assert (
pos:0 <
r -
r0)
by lra.
specialize (
sup1 (
pos_div_2 (
mkposreal _ pos))).
specialize (
sup2 (
pos_div_2 (
mkposreal _ pos))).
destruct sup1 as [
sup1 _].
destruct sup2 as [
_ [
x2 sup2]].
specialize (
sup1 (
N+
x2)%
nat).
destruct sup1 as [? [??]].
specialize (
le x).
cut_to le;
try lia.
specialize (
sup2 x).
cut_to sup2;
try lia.
simpl in *.
destruct (
u x);
destruct (
v x);
simpl in *;
try lra.
-
destruct (
sup2 (
r-1)).
destruct (
sup1 posreal1)
as [
HH _].
destruct (
HH (
N+
x)%
nat)
as [?[??]].
specialize (
le x0).
cut_to le;
try lia.
specialize (
H x0).
cut_to H;
try lia.
destruct (
u x0);
destruct (
v x0);
simpl in *;
lra.
-
destruct (
sup2 posreal1)
as [
_ [??]].
destruct (
sup1 (
r+1) (
N+
x)%
nat)
as [?[??]].
specialize (
le x0).
cut_to le;
try lia.
specialize (
H x0).
cut_to H;
try lia.
destruct (
u x0);
destruct (
v x0);
simpl in *;
lra.
-
destruct (
sup2 0)
as [??].
destruct (
sup1 0 (
N+
x)%
nat).
specialize (
le x0).
cut_to le;
try lia.
specialize (
H x0).
cut_to H;
try lia.
destruct (
u x0);
destruct (
v x0);
simpl in *;
lra.
Qed.
Lemma Rbar_opp_le_contravar (
r1 r2 :
Rbar) :
Rbar_le (
Rbar_opp r1) (
Rbar_opp r2) <->
Rbar_le r2 r1.
Proof.
intros.
destruct r1; destruct r2; simpl in *; rbar_prover.
Qed.
Lemma is_ELimInf_le (
u v :
nat ->
Rbar) (
lu lv:
Rbar) :
eventually (
fun n :
nat =>
Rbar_le (
u n) (
v n)) ->
is_ELimInf_seq u lu ->
is_ELimInf_seq v lv ->
Rbar_le lu lv.
Proof.
Lemma ELimSup_le (
u v :
nat ->
Rbar) :
eventually (
fun n =>
Rbar_le (
u n) (
v n))
->
Rbar_le (
ELimSup_seq u) (
ELimSup_seq v).
Proof.
Lemma ELimInf_le (
u v :
nat ->
Rbar) :
eventually (
fun n =>
Rbar_le (
u n) (
v n))
->
Rbar_le (
ELimInf_seq u) (
ELimInf_seq v).
Proof.
Lemma ELimSup_seq_ext_loc (
u v :
nat ->
Rbar) :
eventually (
fun n =>
u n =
v n) ->
ELimSup_seq u =
ELimSup_seq v.
Proof.
Lemma ELimInf_seq_ext_loc (
u v :
nat ->
Rbar) :
eventually (
fun n =>
u n =
v n) ->
ELimInf_seq u =
ELimInf_seq v.
Proof.
Global Instance ELimSup_proper :
Proper (
pointwise_relation _ eq ==>
eq)
ELimSup_seq.
Proof.
Global Instance ELimInf_proper :
Proper (
pointwise_relation _ eq ==>
eq)
ELimInf_seq.
Proof.
Global Instance ELimSup_le_proper :
Proper (
pointwise_relation _ Rbar_le ==>
Rbar_le)
ELimSup_seq.
Proof.
Global Instance ELimInf_le_proper :
Proper (
pointwise_relation _ Rbar_le ==>
Rbar_le)
ELimInf_seq.
Proof.
Lemma is_ELimSup_seq_scal_pos_aux (
a :
R) (
u :
nat ->
Rbar) (
l :
Rbar) :
0 <
a ->
is_ELimSup_seq u l ->
is_ELimSup_seq (
fun n =>
Rbar_mult a (
u n)) (
Rbar_mult a l).
Proof.
intros apos sup.
destruct l;
simpl in *.
-
intros eps.
assert (
pos:0 <
eps /
a).
{
apply RIneq.Rdiv_lt_0_compat;
trivial.
apply cond_pos.
}
specialize (
sup (
mkposreal _ pos)).
destruct sup as [
sup1 sup2].
split.
+
intros N1.
destruct (
sup1 N1)
as [
x [
xle sup1N]].
exists x.
split;
trivial.
destruct eps;
simpl in *.
destruct (
u x);
simpl in *;
rbar_prover.
rewrite (
Rmult_comm _ r0).
apply Rlt_div_l;
try lra.
rewrite RIneq.Rdiv_minus_distr.
unfold Rdiv.
rewrite Rinv_r_simpl_m;
lra.
+
destruct sup2 as [
x sup2].
exists x;
intros n len.
specialize (
sup2 n len).
simpl in sup2.
destruct eps;
simpl in *.
destruct (
u n);
simpl in *;
rbar_prover.
apply (
Rmult_lt_compat_l a)
in sup2;
try lra.
rewrite Rmult_plus_distr_l in sup2.
unfold Rdiv in sup2.
rewrite <-
Rmult_assoc in sup2.
rewrite Rinv_r_simpl_m in sup2;
lra.
-
rbar_prover;
simpl.
intros M N.
destruct (
sup (
M /
a)
N)
as [?[??]].
exists x.
split;
trivial.
destruct (
u x);
simpl;
rbar_prover.
rewrite Rmult_comm.
apply Rlt_div_l;
try lra.
-
rbar_prover;
simpl.
intros M.
destruct (
sup (
M /
a)).
exists x;
intros.
specialize (
H _ H0).
destruct (
u n);
simpl in *;
rbar_prover.
rewrite Rmult_comm.
apply Rlt_div_r;
try lra.
Qed.
Lemma is_ELimSup_seq_scal_pos (
a :
R) (
u :
nat ->
Rbar) (
l :
Rbar) :
0 <=
a ->
is_ELimSup_seq u l ->
is_ELimSup_seq (
fun n =>
Rbar_mult a (
u n)) (
Rbar_mult a l).
Proof.
Lemma ELimSup_seq_scal_pos (
a :
R) (
u :
nat ->
Rbar) :
0 <=
a ->
ELimSup_seq (
fun n =>
Rbar_mult a (
u n)) =
Rbar_mult a (
ELimSup_seq u).
Proof.
Lemma is_ELimInf_seq_scal_pos (
a :
R) (
u :
nat ->
Rbar) (
l :
Rbar) :
0 <=
a ->
is_ELimInf_seq u l ->
is_ELimInf_seq (
fun n =>
Rbar_mult a (
u n)) (
Rbar_mult a l).
Proof.
Lemma ELimInf_seq_scal_pos (
a :
R) (
u :
nat ->
Rbar) :
0 <=
a ->
ELimInf_seq (
fun n =>
Rbar_mult a (
u n)) =
Rbar_mult a (
ELimInf_seq u).
Proof.
Lemma is_ELimSup_seq_ind_1 (
u :
nat ->
Rbar) (
l :
Rbar) :
is_ELimSup_seq u l <->
is_ELimSup_seq (
fun n =>
u (
S n))
l.
Proof.
destruct l;
simpl.
-
split;
intros HH eps
;
specialize (
HH eps);
(
split; [
destruct HH as [
HH _] |
destruct HH as [
_ [
n HH]]]).
+
intros N.
destruct (
HH (
S N))
as [?[??]].
destruct x;
try lia.
exists x.
split;
trivial;
lia.
+
exists n;
intros.
apply HH;
lia.
+
intros N.
destruct (
HH N)
as [?[??]].
exists (
S x).
split;
trivial;
lia.
+
exists (
S n);
intros.
destruct n0;
try lia.
apply HH;
lia.
-
split;
intros HH M N
;
specialize (
HH M).
+
destruct (
HH (
S N))
as [?[??]].
destruct x;
try lia.
exists x.
split;
trivial;
lia.
+
destruct (
HH N)
as [?[??]].
exists (
S x).
split;
trivial;
lia.
-
split;
intros HH M
;
specialize (
HH M);
destruct HH as [
N ?].
+
exists N;
intros.
apply H;
lia.
+
exists (
S N);
intros.
destruct n;
try lia.
apply H;
lia.
Qed.
Lemma ELimSup_seq_ind_1 (
u :
nat ->
Rbar) :
ELimSup_seq (
fun n =>
u (
S n)) =
ELimSup_seq u.
Proof.
Lemma is_ELimInf_seq_ind_1 (
u :
nat ->
Rbar) (
l :
Rbar) :
is_ELimInf_seq u l <->
is_ELimInf_seq (
fun n =>
u (
S n))
l.
Proof.
Lemma ELimInf_seq_ind_1 (
u :
nat ->
Rbar) :
ELimInf_seq (
fun n =>
u (
S n)) =
ELimInf_seq u.
Proof.
Lemma is_ELimSup_seq_ind_k (
u :
nat ->
Rbar) (
k :
nat) (
l :
Rbar) :
is_ELimSup_seq u l <->
is_ELimSup_seq (
fun n =>
u (
n +
k)%
nat)
l.
Proof.
Lemma is_ELimInf_seq_ind_k (
u :
nat ->
Rbar) (
k :
nat) (
l :
Rbar) :
is_ELimInf_seq u l <->
is_ELimInf_seq (
fun n =>
u (
n +
k)%
nat)
l.
Proof.
Lemma ELimSup_seq_ind_k (
u :
nat ->
Rbar) (
k:
nat) :
ELimSup_seq (
fun n =>
u (
n +
k)%
nat) =
ELimSup_seq u.
Proof.
Lemma ELimInf_seq_ind_k (
u :
nat ->
Rbar) (
k :
nat) :
ELimInf_seq (
fun n =>
u (
n +
k)%
nat) =
ELimInf_seq u.
Proof.
Definition ELim_seq (
u :
nat ->
Rbar) :
Rbar :=
Rbar_div_pos (
Rbar_plus (
ELimSup_seq u) (
ELimInf_seq u))
{|
pos := 2;
cond_pos :=
Rlt_R0_R2 |}.
Definition ex_Elim_seq (
u :
nat ->
Rbar) :=
ELimSup_seq u =
ELimInf_seq u.
Definition is_Elim_seq (
u :
nat ->
Rbar) (
l :
Rbar) :=
is_ELimInf_seq u l /\
is_ELimSup_seq u l.
Definition is_Elim_seq' (
u :
nat ->
Rbar) (
l :
Rbar) :=
match l with
|
Finite l =>
forall eps :
posreal,
eventually (
fun n =>
Rbar_lt (
Rbar_abs (
Rbar_minus (
u n)
l))
eps)
|
p_infty =>
forall M :
R,
eventually (
fun n =>
Rbar_lt M (
u n))
|
m_infty =>
forall M :
R,
eventually (
fun n =>
Rbar_lt (
u n)
M)
end.
Lemma is_Elim_seq_spec :
forall u l,
is_Elim_seq'
u l <->
is_Elim_seq u l.
Proof.
unfold is_Elim_seq.
destruct l;
simpl in *;
split;
intros HH.
-
split;
intros eps;
destruct (
HH eps);
clear HH
;
repeat split;
intros.
+
exists (
max N x).
split;
try lia.
specialize (
H (
max N x)).
cut_to H;
try lia.
destruct (
u (
Init.Nat.max N x));
simpl in *;
rbar_prover.
generalize (
Rle_abs (
r0 + -
r));
intros;
lra.
+
exists x;
intros.
specialize (
H _ H0).
match_destr;
simpl in *.
rewrite Rabs_minus_sym in H.
generalize (
Rle_abs (
r -
r0));
intros;
lra.
+
exists (
max N x).
split;
try lia.
specialize (
H (
max N x)).
cut_to H;
try lia.
destruct (
u (
Init.Nat.max N x));
simpl in *;
rbar_prover.
rewrite Rabs_minus_sym in H.
generalize (
Rle_abs (
r -
r0));
intros;
lra.
+
exists x;
intros.
specialize (
H _ H0).
destruct (
u n);
simpl in *;
rbar_prover.
generalize (
Rle_abs (
r0 + -
r));
intros;
lra.
-
intros eps;
red.
destruct HH as [
HH1 HH2].
specialize (
HH1 eps);
specialize (
HH2 eps).
destruct HH1 as [?[??]].
destruct HH2 as [?[??]].
exists (
max x x0);
intros.
specialize (
H0 n).
specialize (
H2 n).
cut_to H0;
try lia.
cut_to H2;
try lia.
destruct (
u n);
simpl in *;
try lra.
unfold Rabs.
match_destr;
lra.
-
split;
intros M;
specialize (
HH M);
destruct HH.
+
exists x;
intros.
now apply H.
+
intros.
exists (
max N x).
split;
try lia.
apply H;
lia.
-
intros M.
destruct HH as [
HH1 HH2].
specialize (
HH1 M);
specialize (
HH2 M).
destruct HH1 as [??].
exists x;
trivial.
-
split;
intros M;
specialize (
HH M);
destruct HH;
intros.
+
exists (
max x N).
split;
try lia.
apply H;
lia.
+
eauto.
-
intros M.
destruct HH as [
HH1 HH2].
specialize (
HH1 M);
specialize (
HH2 M).
destruct HH2 as [??].
exists x;
trivial.
Qed.
Lemma is_Elim_seq_fin (
u :
nat ->
R) (
l :
Rbar) :
is_Elim_seq u l <->
Lim_seq.is_lim_seq u l.
Proof.
Lemma is_Elim_seq_Reals (
u :
nat ->
R) (
l :
R) :
is_Elim_seq u l <->
Un_cv u l.
Proof.
Lemma is_Elim_seq_p_infty_Reals (
u :
nat ->
R) :
is_Elim_seq u p_infty <->
cv_infty u.
Proof.
Lemma is_Elim_LimSup_seq (
u :
nat ->
Rbar) (
l :
Rbar) :
is_Elim_seq u l ->
is_ELimSup_seq u l.
Proof.
now intros [??].
Qed.
Lemma is_Elim_LimInf_seq (
u :
nat ->
Rbar) (
l :
Rbar) :
is_Elim_seq u l ->
is_ELimInf_seq u l.
Proof.
now intros [??].
Qed.
Lemma is_ELimSup_LimInf_lim_seq (
u :
nat ->
Rbar) (
l :
Rbar) :
is_ELimSup_seq u l ->
is_ELimInf_seq u l ->
is_Elim_seq u l.
Proof.
split; trivial.
Qed.
Lemma ex_Elim_LimSup_LimInf_seq (
u :
nat ->
Rbar) :
ex_Elim_seq u <->
ELimSup_seq u =
ELimInf_seq u.
Proof.
reflexivity.
Qed.
Lemma is_Elim_seq_ex_Elim_seq (
u :
nat ->
Rbar) (
l:
Rbar) :
is_Elim_seq u l ->
ex_Elim_seq u.
Proof.
Lemma ex_Elim_seq_is_Elim_seq_sup (
u :
nat ->
Rbar) :
ex_Elim_seq u ->
is_Elim_seq u (
ELimSup_seq u).
Proof.
Lemma ex_Elim_seq_is_Elim_seq_inf (
u :
nat ->
Rbar) :
ex_Elim_seq u ->
is_Elim_seq u (
ELimInf_seq u).
Proof.
Lemma is_Elim_seq_ext_loc (
u v :
nat ->
Rbar) (
l :
Rbar) :
eventually (
fun n =>
u n =
v n) ->
is_Elim_seq u l ->
is_Elim_seq v l.
Proof.
Lemma ex_Elim_seq_ext_loc (
u v :
nat ->
Rbar) :
eventually (
fun n =>
u n =
v n) ->
ex_Elim_seq u ->
ex_Elim_seq v.
Proof.
Lemma ELim_seq_ext_loc (
u v :
nat ->
Rbar) :
eventually (
fun n =>
u n =
v n) ->
ELim_seq u =
ELim_seq v.
Proof.
Lemma is_Elim_seq_ext (
u v :
nat ->
Rbar) (
l :
Rbar) :
(
forall n,
u n =
v n) ->
is_Elim_seq u l ->
is_Elim_seq v l.
Proof.
Lemma ex_Elim_seq_ext (
u v :
nat ->
Rbar) :
(
forall n,
u n =
v n) ->
ex_Elim_seq u ->
ex_Elim_seq v.
Proof.
Lemma ELim_seq_ext (
u v :
nat ->
Rbar) :
(
forall n,
u n =
v n) ->
ELim_seq u =
ELim_seq v.
Proof.
Global Instance is_Elim_seq_proper :
Proper (
pointwise_relation _ eq ==>
eq ==>
iff)
is_Elim_seq.
Proof.
Global Instance ex_Elim_seq_proper :
Proper (
pointwise_relation _ eq ==>
iff)
ex_Elim_seq.
Proof.
Global Instance ELim_seq_proper :
Proper (
pointwise_relation _ eq ==>
eq)
ELim_seq.
Proof.
Lemma is_Elim_seq_unique (
u :
nat ->
Rbar) (
l :
Rbar) :
is_Elim_seq u l ->
ELim_seq u =
l.
Proof.
Lemma ELim_seq_correct (
u :
nat ->
Rbar) :
ex_Elim_seq u ->
is_Elim_seq u (
ELim_seq u).
Proof.
Lemma ex_Elim_seq_fin (
u :
nat ->
R) :
ex_Elim_seq u <->
Lim_seq.ex_lim_seq u.
Proof.
Lemma Elim_seq_fin (
u :
nat ->
R) :
ELim_seq u =
Lim_seq.Lim_seq u.
Proof.
Definition ex_finite_Elim_seq (
u :
nat ->
Rbar) :=
ex_Elim_seq u /\
is_finite (
ELim_seq u).
Lemma ELim_seq_correct' (
u :
nat ->
Rbar) :
ex_finite_Elim_seq u ->
is_Elim_seq u (
real (
ELim_seq u)).
Proof.
Lemma ex_finite_Elim_seq_correct (
u :
nat ->
Rbar) :
ex_finite_Elim_seq u <->
ex_Elim_seq u /\
is_finite (
ELim_seq u).
Proof.
reflexivity.
Qed.
Lemma ex_Elim_seq_sup (
u :
nat ->
Rbar) :
ex_Elim_seq u ->
ELim_seq u =
ELimSup_seq u.
Proof.
Lemma ex_Elim_seq_dec (
u :
nat ->
Rbar) :
{
ex_Elim_seq u} + {~
ex_Elim_seq u}.
Proof.
Lemma ex_finite_Elim_seq_dec (
u :
nat ->
Rbar) :
{
ex_finite_Elim_seq u} + {~
ex_finite_Elim_seq u}.
Proof.
Definition ex_Elim_seq_cauchy (
u :
nat ->
Rbar) :=
forall eps :
posreal,
exists N :
nat,
forall n m,
(
N <=
n)%
nat -> (
N <=
m)%
nat ->
Rbar_lt (
Rbar_abs (
Rbar_minus (
u n) (
u m)))
eps.
Local Existing Instance Rbar_le_pre.
Lemma is_Elim_seq_INR :
is_Elim_seq INR p_infty.
Proof.
Lemma ex_Elim_seq_INR :
ex_Elim_seq INR.
Proof.
Lemma ELim_seq_INR :
ELim_seq INR =
p_infty.
Proof.
Lemma is_Elim_seq_const (
a :
Rbar) :
is_Elim_seq (
fun n =>
a)
a.
Proof.
Lemma ex_Elim_seq_const (
a :
Rbar) :
ex_Elim_seq (
fun n =>
a).
Proof.
Lemma ELim_seq_const (
a :
Rbar) :
ELim_seq (
fun n =>
a) =
a.
Proof.
Lemma is_Elim_seq_subseq (
u :
nat ->
Rbar) (
l :
Rbar) (
phi :
nat ->
nat) :
filterlim phi eventually eventually ->
is_Elim_seq u l ->
is_Elim_seq (
fun n =>
u (
phi n))
l.
Proof.
intros.
destruct H0.
split.
{
destruct l.
-
intros eps.
specialize (
H0 eps).
specialize (
H1 eps).
destruct H0 as [
H11 H12].
destruct H1 as [
H21 H22].
split;
intros.
+
destruct (
H (
fun n =>
Rbar_lt (
u n) (
r +
eps))).
{
eapply filter_imp;
try eapply H22;
intros.
simpl in H0.
destruct eps;
simpl in *.
destruct (
u x);
simpl in *;
rbar_prover.
}
*
exists (
max N x);
intros.
split;
try lia.
specialize (
H0 (
max N x)).
cut_to H0;
try lia.
destruct eps;
simpl in *.
destruct (
u (
phi (
Init.Nat.max N x)));
simpl in *;
rbar_prover.
+
destruct (
H (
fun n =>
Rbar_lt (
r -
eps) (
u n))).
{
eapply filter_imp;
try eapply H12;
auto.
}
eauto.
-
intros M.
specialize (
H0 M).
destruct H0 as [??].
destruct (
H (
fun n =>
Rbar_lt M (
u n))).
{
exists x;
apply H0.
}
eauto.
-
intros M N.
specialize (
H1 M).
destruct H1 as [??].
repeat red in H.
destruct (
H (
fun n =>
Rbar_lt (
u n)
M)).
{
exists x;
intros.
now apply H1.
}
exists (
max N x0).
split;
try lia.
apply H2;
lia.
}
{
destruct l.
-
intros eps.
specialize (
H0 eps).
specialize (
H1 eps).
destruct H0 as [
H11 H12].
destruct H1 as [
H21 H22].
split;
intros.
+
destruct (
H (
fun n =>
Rbar_lt (
r -
eps) (
u n))).
{
eapply filter_imp;
try eapply H12;
intros.
simpl in H0.
destruct eps;
simpl in *.
destruct (
u x);
simpl in *;
rbar_prover.
}
*
exists (
max N x);
intros.
split;
try lia.
specialize (
H0 (
max N x)).
cut_to H0;
try lia.
destruct eps;
simpl in *.
destruct (
u (
phi (
Init.Nat.max N x)));
simpl in *;
rbar_prover.
+
destruct (
H (
fun n =>
Rbar_lt (
u n) (
r +
eps))).
{
eapply filter_imp;
try eapply H22;
auto.
}
eauto.
-
intros M N.
specialize (
H0 M).
destruct H0 as [??].
repeat red in H.
destruct (
H (
fun n =>
Rbar_lt M (
u n))).
{
exists x;
intros.
now apply H0.
}
exists (
max N x0).
split;
try lia.
apply H2;
lia.
-
intros M.
specialize (
H1 M).
destruct H1 as [??].
destruct (
H (
fun n =>
Rbar_lt (
u n)
M)).
{
exists x;
apply H1.
}
eauto.
}
Qed.
Lemma ex_Elim_seq_subseq (
u :
nat ->
Rbar) (
phi :
nat ->
nat) :
filterlim phi eventually eventually ->
ex_Elim_seq u ->
ex_Elim_seq (
fun n =>
u (
phi n)).
Proof.
Lemma ELim_seq_subseq (
u :
nat ->
Rbar) (
phi :
nat ->
nat) :
filterlim phi eventually eventually ->
ex_Elim_seq u ->
ELim_seq (
fun n =>
u (
phi n)) =
ELim_seq u.
Proof.
Lemma is_Elim_seq_incr_1 (
u :
nat ->
Rbar) (
l :
Rbar) :
is_Elim_seq u l <->
is_Elim_seq (
fun n =>
u (
S n))
l.
Proof.
Lemma ex_Elim_seq_incr_1 (
u :
nat ->
Rbar) :
ex_Elim_seq u <->
ex_Elim_seq (
fun n =>
u (
S n)).
Proof.
Lemma ELim_seq_incr_1 (
u :
nat ->
Rbar) :
ELim_seq (
fun n =>
u (
S n)) =
ELim_seq u.
Proof.
Lemma is_Elim_seq_incr_n (
u :
nat ->
Rbar) (
N :
nat) (
l :
Rbar) :
is_Elim_seq u l <->
is_Elim_seq (
fun n =>
u (
n +
N)%
nat)
l.
Proof.
Lemma ex_Elim_seq_incr_n (
u :
nat ->
Rbar) (
N :
nat) :
ex_Elim_seq u <->
ex_Elim_seq (
fun n =>
u (
n +
N)%
nat).
Proof.
Lemma ELim_seq_incr_n (
u :
nat ->
Rbar) (
N :
nat) :
ELim_seq (
fun n =>
u (
n +
N)%
nat) =
ELim_seq u.
Proof.
Lemma ELim_seq_le_loc (
u v :
nat ->
Rbar) :
eventually (
fun n =>
Rbar_le (
u n) (
v n)) ->
Rbar_le (
ELim_seq u) (
ELim_seq v).
Proof.
Lemma ELim_seq_le (
u v :
nat ->
Rbar) :
(
forall n,
Rbar_le (
u n) (
v n)) ->
Rbar_le (
ELim_seq u) (
ELim_seq v).
Proof.
Global Instance ELim_le_proper :
Proper (
pointwise_relation _ Rbar_le ==>
Rbar_le)
ELim_seq.
Proof.
Lemma is_Elim_seq_le_loc (
u v :
nat ->
Rbar) (
l1 l2 :
Rbar) :
eventually (
fun n =>
Rbar_le (
u n) (
v n)) ->
is_Elim_seq u l1 ->
is_Elim_seq v l2 ->
Rbar_le l1 l2.
Proof.
Lemma is_Elim_seq_le (
u v :
nat ->
Rbar) (
l1 l2 :
Rbar) :
(
forall n,
Rbar_le (
u n) (
v n)) ->
is_Elim_seq u l1 ->
is_Elim_seq v l2 ->
Rbar_le l1 l2.
Proof.
Lemma is_ELimSup_seq_le_le_loc (
u v w :
nat ->
Rbar) (
l :
Rbar) :
eventually (
fun n =>
Rbar_le (
u n) (
v n) /\
Rbar_le (
v n) (
w n)) ->
is_ELimSup_seq u l ->
is_ELimSup_seq w l ->
is_ELimSup_seq v l.
Proof.
Lemma is_ELimInf_seq_le_le_loc (
u v w :
nat ->
Rbar) (
l :
Rbar) :
eventually (
fun n =>
Rbar_le (
u n) (
v n) /\
Rbar_le (
v n) (
w n)) ->
is_ELimInf_seq u l ->
is_ELimInf_seq w l ->
is_ELimInf_seq v l.
Proof.
Lemma is_Elim_seq_le_le_loc (
u v w :
nat ->
Rbar) (
l :
Rbar) :
eventually (
fun n =>
Rbar_le (
u n) (
v n) /\
Rbar_le (
v n) (
w n)) ->
is_Elim_seq u l ->
is_Elim_seq w l ->
is_Elim_seq v l.
Proof.
Lemma is_Elim_seq_le_le (
u v w :
nat ->
Rbar) (
l :
Rbar) :
(
forall n,
Rbar_le (
u n) (
v n) /\
Rbar_le (
v n) (
w n)) ->
is_Elim_seq u l ->
is_Elim_seq w l ->
is_Elim_seq v l.
Proof.
Lemma is_Elim_seq_le_p_loc (
u v :
nat ->
Rbar) :
eventually (
fun n =>
Rbar_le (
u n) (
v n)) ->
is_Elim_seq u p_infty ->
is_Elim_seq v p_infty.
Proof.
Lemma is_Elim_seq_le_m_loc (
u v :
nat ->
Rbar) :
eventually (
fun n =>
Rbar_le (
v n) (
u n)) ->
is_Elim_seq u m_infty ->
is_Elim_seq v m_infty.
Proof.
Lemma preorder_S_le_incr {
A} (
RR:
A->
A->
Prop) {
RR_pre:
PreOrder RR} (
f:
nat->
A) :
(
forall n,
RR (
f n) (
f (
S n))) ->
forall n m, (
n <=
m)%
nat ->
RR (
f n) (
f m).
Proof.
intros.
induction H0.
- reflexivity.
- etransitivity; eauto.
Qed.
Lemma preorder_S_le_decr {
A} (
RR:
A->
A->
Prop) {
RR_pre:
PreOrder RR} (
f:
nat->
A) :
(
forall n,
RR (
f (
S n)) (
f n)) ->
forall n m, (
n <=
m)%
nat ->
RR (
f m) (
f n).
Proof.
intros.
induction H0.
- reflexivity.
- etransitivity; eauto.
Qed.
Lemma is_Elim_seq_decr_compare (
u :
nat ->
Rbar) (
l :
Rbar) :
is_Elim_seq u l
-> (
forall n,
Rbar_le (
u (
S n)) (
u n))
->
forall n,
Rbar_le l (
u n).
Proof.
Lemma is_Elim_seq_incr_compare (
u :
nat ->
Rbar) (
l :
Rbar) :
is_Elim_seq u l
-> (
forall n,
Rbar_le (
u n) (
u (
S n)))
->
forall n,
Rbar_le (
u n)
l.
Proof.
Lemma ex_Elim_seq_decr (
u :
nat ->
Rbar) :
(
forall n, (
Rbar_le (
u (
S n)) (
u n)))
->
ex_Elim_seq u.
Proof.
Lemma ex_Elim_seq_incr (
u :
nat ->
Rbar) :
(
forall n,
Rbar_le (
u n) (
u (
S n)))
->
ex_Elim_seq u.
Proof.
Lemma ex_finite_Elim_seq_decr (
u :
nat ->
Rbar) (
M :
R) (
m:
nat):
(
forall n,
Rbar_le (
u (
S n)) (
u n)) -> (
forall n,
Rbar_le M (
u n)) ->
(
u m <>
p_infty) ->
ex_finite_Elim_seq u.
Proof.
Lemma ex_finite_Elim_seq_incr (
u :
nat ->
Rbar) (
M :
R) (
m:
nat):
(
forall n,
Rbar_le (
u n) (
u (
S n))) -> (
forall n,
Rbar_le (
u n)
M) ->
(
u m <>
m_infty) ->
ex_finite_Elim_seq u.
Proof.
Lemma is_Elim_seq_opp (
u :
nat ->
Rbar) (
l :
Rbar) :
is_Elim_seq u l <->
is_Elim_seq (
fun n =>
Rbar_opp (
u n)) (
Rbar_opp l).
Proof.
Lemma ex_Elim_seq_opp (
u :
nat ->
Rbar) :
ex_Elim_seq u <->
ex_Elim_seq (
fun n =>
Rbar_opp (
u n)).
Proof.
Lemma ELim_seq_opp (
u :
nat ->
Rbar) :
ELim_seq (
fun n =>
Rbar_opp (
u n)) =
Rbar_opp (
ELim_seq u).
Proof.
Lemma is_Elim_seq_plus_aux (
u v :
nat ->
Rbar) (
l1 l2 l :
Rbar) :
Rbar_le 0
l ->
is_Elim_seq u l1 ->
is_Elim_seq v l2 ->
is_Rbar_plus l1 l2 l ->
is_Elim_seq (
fun n =>
Rbar_plus (
u n) (
v n))
l.
Proof.
intros zpos limu limv isp.
apply is_Elim_seq_spec in limu.
apply is_Elim_seq_spec in limv.
apply is_Elim_seq_spec.
unfold is_Elim_seq',
is_Rbar_plus in *.
destruct l.
-
intros eps.
destruct l1;
destruct l2;
simpl in isp;
invcs isp.
eapply filter_imp; [|
eapply filter_and; [
apply (
limu (
pos_div_2 eps)) |
apply (
limv (
pos_div_2 eps))]]
;
simpl;
intros ? [??].
generalize (
Rbar_plus_lt_compat _ _ _ _ H H0)
;
intros.
destruct (
u x);
destruct (
v x);
simpl in *;
rbar_prover.
rewrite <-
double_var in H1.
eapply Rle_lt_trans;
try eapply H1.
eapply Rle_trans; [|
eapply Rabs_triang].
apply BasicUtils.refl_refl.
f_equal;
lra.
-
intros M.
destruct l1;
destruct l2;
invcs isp.
+
specialize (
limu posreal1).
specialize (
limv (
M -
r + 1)).
eapply filter_imp; [|
eapply filter_and; [
apply limu |
apply limv]]
;
simpl;
intros ? [??].
destruct (
u x);
destruct (
v x);
simpl in *;
rbar_prover.
assert (
M <
r +
r1 - 1)
by lra.
eapply Rlt_le_trans;
try eapply H1.
cut (
r - 1 <=
r0); [
lra | ].
cut ((
r -
r0) <= 1); [
lra | ].
unfold Rabs in *.
match_destr_in H;
lra.
+
specialize (
limu (
M -
r + 1)).
specialize (
limv posreal1).
eapply filter_imp; [|
eapply filter_and; [
apply limu |
apply limv]]
;
simpl;
intros ? [??].
destruct (
u x);
destruct (
v x);
simpl in *;
rbar_prover.
assert (
M <
r +
r0 - 1)
by lra.
eapply Rlt_le_trans;
try eapply H1.
cut (
r - 1 <=
r1); [
lra | ].
cut ((
r -
r1) <= 1); [
lra | ].
unfold Rabs in *.
match_destr_in H0;
lra.
+
specialize (
limu (
M / 2)).
specialize (
limv (
M / 2)).
eapply filter_imp; [|
eapply filter_and; [
apply limu |
apply limv]]
;
simpl;
intros ? [??].
destruct (
u x);
destruct (
v x);
simpl in *;
rbar_prover.
-
simpl in zpos;
tauto.
Qed.
Lemma is_Elim_seq_plus (
u v :
nat ->
Rbar) (
l1 l2 l :
Rbar) :
is_Elim_seq u l1 ->
is_Elim_seq v l2 ->
is_Rbar_plus l1 l2 l ->
is_Elim_seq (
fun n =>
Rbar_plus (
u n) (
v n))
l.
Proof.
Lemma is_Elim_seq_plus' (
u v :
nat ->
Rbar) (
l1 l2 :
R) :
is_Elim_seq u l1 ->
is_Elim_seq v l2 ->
is_Elim_seq (
fun n => (
Rbar_plus (
u n) (
v n))) (
l1 +
l2).
Proof.
Lemma ex_Elim_seq_plus (
u v :
nat ->
Rbar) :
ex_Elim_seq u ->
ex_Elim_seq v ->
ex_Rbar_plus (
ELim_seq u) (
ELim_seq v) ->
ex_Elim_seq (
fun n =>
Rbar_plus (
u n) (
v n)).
Proof.
Lemma ELim_seq_plus (
u v :
nat ->
Rbar) :
ex_Elim_seq u ->
ex_Elim_seq v ->
ex_Rbar_plus (
ELim_seq u) (
ELim_seq v) ->
ELim_seq (
fun n =>
Rbar_plus (
u n) (
v n)) =
Rbar_plus (
ELim_seq u) (
ELim_seq v).
Proof.
Lemma is_Elim_seq_minus (
u v :
nat ->
Rbar) (
l1 l2 l :
Rbar) :
is_Elim_seq u l1 ->
is_Elim_seq v l2 ->
is_Rbar_minus l1 l2 l ->
is_Elim_seq (
fun n =>
Rbar_minus (
u n) (
v n))
l.
Proof.
Lemma is_Elim_seq_minus' (
u v :
nat ->
Rbar) (
l1 l2 :
R) :
is_Elim_seq u l1 ->
is_Elim_seq v l2 ->
is_Elim_seq (
fun n =>
Rbar_minus (
u n) (
v n)) (
l1 -
l2).
Proof.
Lemma ex_Elim_seq_minus (
u v :
nat ->
Rbar) :
ex_Elim_seq u ->
ex_Elim_seq v ->
ex_Rbar_minus (
ELim_seq u) (
ELim_seq v) ->
ex_Elim_seq (
fun n =>
Rbar_minus (
u n) (
v n)).
Proof.
Lemma ELim_seq_minus (
u v :
nat ->
Rbar) :
ex_Elim_seq u ->
ex_Elim_seq v ->
ex_Rbar_minus (
ELim_seq u) (
ELim_seq v) ->
ELim_seq (
fun n =>
Rbar_minus (
u n) (
v n)) =
Rbar_minus (
ELim_seq u) (
ELim_seq v).
Proof.
Lemma is_Elim_seq_inv_pos (
u :
nat ->
Rbar) (
l :
Rbar) :
is_Elim_seq u l ->
Rbar_lt 0
l ->
is_Elim_seq (
fun n =>
Rbar_inv (
u n)) (
Rbar_inv l).
Proof.
Lemma is_Elim_seq_inv_neg (
u :
nat ->
Rbar) (
l :
Rbar) :
is_Elim_seq u l ->
Rbar_lt 0 (
Rbar_opp l) ->
is_Elim_seq (
fun n =>
Rbar_inv (
u n)) (
Rbar_inv l).
Proof.
Lemma is_Elim_seq_inv (
u :
nat ->
Rbar) (
l :
Rbar) :
is_Elim_seq u l ->
l <> 0 ->
is_Elim_seq (
fun n =>
Rbar_inv (
u n)) (
Rbar_inv l).
Proof.
Lemma ex_Elim_seq_inv (
u :
nat ->
Rbar) :
ex_Elim_seq u
->
ELim_seq u <> 0
->
ex_Elim_seq (
fun n =>
Rbar_inv (
u n)).
Proof.
Lemma ELim_seq_inv (
u :
nat ->
Rbar) :
ex_Elim_seq u -> (
ELim_seq u <> 0)
->
ELim_seq (
fun n =>
Rbar_inv (
u n)) =
Rbar_inv (
ELim_seq u).
Proof.
Lemma is_Elim_seq_mult_aux_pos123 (
u v :
nat ->
Rbar) (
l1 l2 l :
Rbar) :
Rbar_le 0
l1 ->
Rbar_le 0
l2 ->
Rbar_le l1 l2 ->
is_Elim_seq u l1 ->
is_Elim_seq v l2 ->
is_Rbar_mult l1 l2 l ->
(
eventually (
fun n =>
ex_Rbar_mult (
u n) (
v n))) ->
is_Elim_seq (
fun n =>
Rbar_mult (
u n) (
v n))
l.
Proof.
Lemma is_Elim_seq_mult_aux_pos12 (
u v :
nat ->
Rbar) (
l1 l2 l :
Rbar) :
Rbar_le 0
l1 ->
Rbar_le 0
l2 ->
is_Elim_seq u l1 ->
is_Elim_seq v l2 ->
is_Rbar_mult l1 l2 l ->
(
eventually (
fun n =>
ex_Rbar_mult (
u n) (
v n))) ->
is_Elim_seq (
fun n =>
Rbar_mult (
u n) (
v n))
l.
Proof.
Lemma is_Elim_seq_mult (
u v :
nat ->
Rbar) (
l1 l2 l :
Rbar) :
is_Elim_seq u l1 ->
is_Elim_seq v l2 ->
is_Rbar_mult l1 l2 l ->
(
eventually (
fun n =>
ex_Rbar_mult (
u n) (
v n))) ->
is_Elim_seq (
fun n =>
Rbar_mult (
u n) (
v n))
l.
Proof.
Lemma is_Elim_seq_mult' (
u v :
nat ->
Rbar) (
l1 l2 :
R) :
is_Elim_seq u l1 ->
is_Elim_seq v l2 ->
(
eventually (
fun n =>
ex_Rbar_mult (
u n) (
v n))) ->
is_Elim_seq (
fun n =>
Rbar_mult (
u n) (
v n)) (
l1 *
l2).
Proof.
Lemma ex_Elim_seq_mult (
u v :
nat ->
Rbar) :
ex_Elim_seq u ->
ex_Elim_seq v ->
ex_Rbar_mult (
ELim_seq u) (
ELim_seq v) ->
(
eventually (
fun n =>
ex_Rbar_mult (
u n) (
v n))) ->
ex_Elim_seq (
fun n =>
Rbar_mult (
u n) (
v n)).
Proof.
Lemma ELim_seq_mult (
u v :
nat ->
Rbar) :
ex_Elim_seq u ->
ex_Elim_seq v ->
ex_Rbar_mult (
ELim_seq u) (
ELim_seq v) ->
(
eventually (
fun n =>
ex_Rbar_mult (
u n) (
v n))) ->
ELim_seq (
fun n =>
Rbar_mult (
u n) (
v n)) =
Rbar_mult (
ELim_seq u) (
ELim_seq v).
Proof.
Lemma is_Elim_seq_scal_l (
u :
nat ->
Rbar) (
a :
Rbar) (
lu :
Rbar) :
is_Elim_seq u lu ->
ex_Rbar_mult a lu ->
eventually (
fun n :
nat =>
ex_Rbar_mult a (
u n)) ->
is_Elim_seq (
fun n =>
Rbar_mult a (
u n)) (
Rbar_mult a lu).
Proof.
Lemma is_Elim_seq_scal_l' (
u :
nat ->
Rbar) (
a :
R) (
lu :
Rbar) :
is_Elim_seq u lu ->
is_Elim_seq (
fun n =>
Rbar_mult a (
u n)) (
Rbar_mult a lu).
Proof.
Lemma ex_Elim_seq_scal_l (
u :
nat ->
Rbar) (
a :
Rbar) :
ex_Rbar_mult a (
ELim_seq u) ->
ex_Elim_seq u ->
eventually (
fun n :
nat =>
ex_Rbar_mult a (
u n)) ->
ex_Elim_seq (
fun n =>
Rbar_mult a (
u n)).
Proof.
Lemma ex_Elim_seq_scal_l' (
u :
nat ->
Rbar) (
a :
R) :
ex_Elim_seq u ->
ex_Elim_seq (
fun n =>
Rbar_mult a (
u n)).
Proof.
Lemma ELim_seq_scal_l_pos (
u :
nat ->
Rbar) (
a :
R) :
0 <=
a ->
ex_Rbar_mult a (
ELim_seq u) ->
ELim_seq (
fun n =>
Rbar_mult a (
u n)) =
Rbar_mult a (
ELim_seq u).
Proof.
Lemma ELim_seq_scal_l (
u :
nat ->
Rbar) (
a :
R) :
ex_Rbar_mult a (
ELim_seq u) ->
ELim_seq (
fun n =>
Rbar_mult a (
u n)) =
Rbar_mult a (
ELim_seq u).
Proof.
Lemma is_Elim_seq_scal_r (
u :
nat ->
Rbar) (
a :
Rbar) (
lu :
Rbar) :
is_Elim_seq u lu ->
ex_Rbar_mult lu a ->
eventually (
fun n :
nat =>
ex_Rbar_mult (
u n)
a) ->
is_Elim_seq (
fun n =>
Rbar_mult (
u n)
a) (
Rbar_mult lu a).
Proof.
Lemma is_Elim_seq_scal_r' (
u :
nat ->
Rbar) (
a :
R) (
lu :
Rbar) :
is_Elim_seq u lu ->
is_Elim_seq (
fun n =>
Rbar_mult (
u n)
a) (
Rbar_mult lu a).
Proof.
intros.
generalize (
is_Elim_seq_scal_l'
u a lu)
;
intros HH.
cut_to HH;
trivial.
revert HH
;
apply is_Elim_seq_proper
;
try red;
intros;
now rewrite Rbar_mult_comm.
Qed.
Lemma ex_Elim_seq_scal_r (
u :
nat ->
Rbar) (
a :
Rbar) :
ex_Rbar_mult a (
ELim_seq u) ->
ex_Elim_seq u ->
eventually (
fun n :
nat =>
ex_Rbar_mult (
u n)
a) ->
ex_Elim_seq (
fun n =>
Rbar_mult (
u n)
a).
Proof.
Lemma ex_Elim_seq_scal_r' (
u :
nat ->
Rbar) (
a :
R) :
ex_Elim_seq u ->
ex_Elim_seq (
fun n =>
Rbar_mult (
u n)
a).
Proof.
intros.
generalize (
ex_Elim_seq_scal_l'
u a)
;
intros HH.
cut_to HH;
trivial.
revert HH
;
apply ex_Elim_seq_proper
;
try red;
intros;
now rewrite Rbar_mult_comm.
Qed.
Lemma ELim_seq_scal_r (
u :
nat ->
Rbar) (
a :
R) :
ex_Rbar_mult (
ELim_seq u)
a ->
ELim_seq (
fun n =>
Rbar_mult (
u n)
a) =
Rbar_mult (
ELim_seq u)
a.
Proof.
Lemma is_Elim_seq_div (
u v :
nat ->
Rbar) (
l1 l2 l :
Rbar) :
is_Elim_seq u l1 ->
is_Elim_seq v l2 ->
l2 <> 0 ->
is_Rbar_div l1 l2 l ->
(
eventually (
fun n =>
ex_Rbar_div (
u n) (
v n))) ->
is_Elim_seq (
fun n =>
Rbar_div (
u n) (
v n))
l.
Proof.
Lemma is_elim_seq_div' (
u v :
nat ->
Rbar) (
l1 l2 :
R) :
is_Elim_seq u l1 ->
is_Elim_seq v l2 ->
l2 <> 0 ->
(
eventually (
fun n =>
ex_Rbar_div (
u n) (
v n))) ->
is_Elim_seq (
fun n =>
Rbar_div (
u n) (
v n)) (
l1 /
l2).
Proof.
Lemma ex_Elim_seq_div (
u v :
nat ->
Rbar) :
ex_Elim_seq u ->
ex_Elim_seq v ->
ELim_seq v <> 0 ->
ex_Rbar_div (
ELim_seq u) (
ELim_seq v) ->
(
eventually (
fun n =>
ex_Rbar_div (
u n) (
v n))) ->
ex_Elim_seq (
fun n =>
Rbar_div (
u n) (
v n)).
Proof.
Lemma ELim_seq_div (
u v :
nat ->
Rbar) :
ex_Elim_seq u ->
ex_Elim_seq v -> (
ELim_seq v <> 0) ->
ex_Rbar_div (
ELim_seq u) (
ELim_seq v) ->
(
eventually (
fun n =>
ex_Rbar_div (
u n) (
v n))) ->
ELim_seq (
fun n =>
Rbar_div (
u n) (
v n)) =
Rbar_div (
ELim_seq u) (
ELim_seq v).
Proof.
Lemma is_Elim_seq_continuous (
f :
R ->
R) (
u :
nat ->
Rbar) (
l :
R) :
continuity_pt f l ->
is_Elim_seq u l
->
is_Elim_seq (
fun n =>
match u n with
|
Finite y =>
Finite (
f y)
|
p_infty =>
p_infty
|
m_infty =>
m_infty
end)
(
f l).
Proof.
Lemma is_Elim_seq_abs (
u :
nat ->
Rbar) (
l :
Rbar) :
is_Elim_seq u l ->
is_Elim_seq (
fun n =>
Rbar_abs (
u n)) (
Rbar_abs l).
Proof.
intros.
apply is_Elim_seq_spec in H.
apply is_Elim_seq_spec.
destruct l.
-
intros eps.
generalize (
H eps).
apply filter_imp;
intros.
destruct (
u x);
simpl in *;
try lra.
unfold Rabs in *.
destruct (
Rcase_abs r0)
;
destruct (
Rcase_abs r)
;
match_destr_in H0;
try lra
;
match_destr;
lra.
-
intros ?.
generalize (
H M).
apply filter_imp;
intros.
eapply Rbar_lt_le_trans;
try eapply H0.
destruct (
u x);
simpl in *;
try lra.
apply Rle_abs.
-
intros M.
generalize (
H (-
M)).
apply filter_imp;
intros.
destruct (
u x);
simpl in *;
try lra.
unfold Rabs.
match_destr;
lra.
Qed.
Lemma ex_Elim_seq_abs (
u :
nat ->
Rbar) :
ex_Elim_seq u ->
ex_Elim_seq (
fun n =>
Rbar_abs (
u n)).
Proof.
Lemma ELim_seq_abs (
u :
nat ->
Rbar) :
ex_Elim_seq u ->
ELim_seq (
fun n =>
Rbar_abs (
u n)) =
Rbar_abs (
ELim_seq u).
Proof.
Lemma is_Elim_seq_abs_0 (
u :
nat ->
Rbar) :
is_Elim_seq u 0 <->
is_Elim_seq (
fun n =>
Rbar_abs (
u n)) 0.
Proof.
Lemma is_Elim_seq_geom (
q :
R) :
Rabs q < 1 ->
is_Elim_seq (
fun n =>
q ^
n) 0.
Proof.
Lemma ex_Elim_seq_geom (
q :
R) :
Rabs q < 1 ->
ex_Elim_seq (
fun n =>
q ^
n).
Proof.
Lemma ELim_seq_geom (
q :
R) :
Rabs q < 1 ->
ELim_seq (
fun n =>
q ^
n) = 0.
Proof.
Lemma is_Elim_seq_geom_p (
q :
R) :
1 <
q ->
is_Elim_seq (
fun n =>
q ^
n)
p_infty.
Proof.
Lemma ex_Elim_seq_geom_p (
q :
R) :
1 <
q ->
ex_Elim_seq (
fun n =>
q ^
n).
Proof.
Lemma ELim_seq_geom_p (
q :
R) :
1 <
q ->
ELim_seq (
fun n =>
q ^
n) =
p_infty.
Proof.
Lemma ex_Elim_seq_geom_m (
q :
R) :
q <= -1 -> ~
ex_Elim_seq (
fun n =>
q ^
n).
Proof.
Lemma is_ELimInf_seq_const_plus (
f :
nat ->
Rbar) (
g :
R) (
l:
Rbar) :
is_ELimInf_seq (
fun n =>
Rbar_plus g (
f n))
l ->
is_ELimInf_seq f (
Rbar_minus l g).
Proof.
intros HH.
destruct l; simpl in *.
- intros eps.
specialize (HH eps).
destruct HH as [HH1 [N HH2]].
split.
+ intros NN.
destruct (HH1 NN) as [n [??]].
exists n.
split; trivial.
destruct (f n); try tauto; simpl in *; lra.
+ exists N.
intros n Nle.
specialize (HH2 n Nle).
destruct (f n); simpl in *; try tauto; lra.
- intros M.
destruct (HH (M + g)) as [N HH1].
exists N.
intros n Nle.
specialize (HH1 n Nle).
destruct (f n); simpl in *; try tauto; lra.
- intros M N.
destruct (HH (M + g) N) as [n [Nle leM]].
exists n.
split; trivial.
destruct (f n); simpl in *; try tauto; lra.
Qed.
Lemma ELimInf_seq_const_plus (
f :
nat ->
Rbar) (
g :
R) :
ELimInf_seq (
fun n =>
Rbar_plus g (
f n)) =
Rbar_plus g (
ELimInf_seq f).
Proof.
Lemma ELimInf_seq_const_minus (
f :
nat ->
Rbar) (
g :
R) :
ELimInf_seq (
fun n =>
Rbar_minus g (
f n)) =
Rbar_minus g (
ELimSup_seq f).
Proof.