Require Import Morphisms.
Require Import Equivalence.
Require Import Program.Basics.
Require Import Lra Lia.
Require Import Classical.
Require Import Reals.
Require Import FunctionalExtensionality.
Require Import Coquelicot.Coquelicot.
Require Import IndefiniteDescription ClassicalDescription ClassicalChoice.
Require Import PropExtensionality.
Require Export RandomVariableFinite RandomVariableLpR.
Require Import quotient_space.
Require Import Almost.
Require Import utils.Utils.
Require Import List.
Set Bullet Behavior "
Strict Subproofs".
Section Linf.
Context {
Ts:
Type}
{
dom:
SigmaAlgebra Ts}
(
prts:
ProbSpace dom).
Lemma sa_le_gt_rv (
rv_X :
Ts ->
R) {
rv :
RandomVariable dom borel_sa rv_X}
x
:
sa_sigma (
fun omega => (
rvabs rv_X)
omega >
x).
Proof.
Definition Linfty_term (
rv_X :
Ts ->
R) {
rv :
RandomVariable dom borel_sa rv_X}
x :
event dom
:=
exist _ (
fun omega => (
rvabs rv_X)
omega >
x) (
sa_le_gt_rv _ _).
Definition Linfty_norm (
rv_X :
Ts ->
R)
{
rv :
RandomVariable dom borel_sa rv_X} :
Rbar :=
Glb_Rbar (
fun (
x :
R) =>
ps_P (
Linfty_term rv_X x) = 0).
Class IsLinfty (
rv_X :
Ts ->
R)
{
rv :
RandomVariable dom borel_sa rv_X} :=
is_linfty :
is_finite (
Linfty_norm rv_X).
Lemma empty_glb_inf (
E :
R ->
Prop) :
(
forall (
r:
R), ~
E r) ->
is_glb_Rbar E p_infty.
Proof.
Lemma is_finite_glb (
E :
R ->
Prop) :
(
exists (
z:
Rbar),
is_glb_Rbar E z /\
is_finite z) ->
exists (
r:
R),
E r.
Proof.
Lemma finite_glb (
E :
R ->
Prop) :
is_finite (
Glb_Rbar E) ->
exists (
r:
R),
E r.
Proof.
Lemma abs_neg_psall (
rv_X :
Ts ->
R) (
r:
R)
{
rv :
RandomVariable dom borel_sa rv_X} :
ps_P (
Linfty_term rv_X r) = 0 -> 0<=
r.
Proof.
destruct (
Rle_dec 0
r);
intros;
trivial.
assert (
event_equiv (
Linfty_term rv_X r) Ω).
intro x0.
unfold rvabs.
generalize (
Rabs_pos (
rv_X x0));
intros.
unfold Ω,
pre_Ω;
simpl.
unfold rvabs.
split;
trivial;
intros.
lra.
rewrite H0 in H.
rewrite ps_all in H.
lra.
Qed.
Lemma is_Linfty_c_nonneg (
rv_X :
Ts ->
R)
{
rv :
RandomVariable dom borel_sa rv_X}
{
isl:
IsLinfty rv_X} :
exists (
c:
nonnegreal),
ps_P (
Linfty_term rv_X c) = 0.
Proof.
Lemma Linfty_norm_Rbar_nneg (
rv_X :
Ts ->
R)
{
rv :
RandomVariable dom borel_sa rv_X} :
Rbar_le 0 (
Linfty_norm rv_X).
Proof.
Lemma IsLinfty_norm_bounded (
rv_X :
Ts ->
R) (
c :
R)
{
rv :
RandomVariable dom borel_sa rv_X} :
Rbar_le (
Linfty_norm rv_X)
c ->
IsLinfty rv_X.
Proof.
Lemma Linfty_norm_nneg (
rv_X :
Ts ->
R)
{
rv :
RandomVariable dom borel_sa rv_X}
{
isl:
IsLinfty rv_X} :
0 <=
Linfty_norm rv_X.
Proof.
Lemma rvclip_almostR2_bounded (
rv_X :
Ts ->
R) (
c :
nonnegreal)
{
rv :
RandomVariable dom borel_sa rv_X} :
ps_P (
Linfty_term rv_X c) = 0 ->
almostR2 prts eq rv_X (
rvclip rv_X c).
Proof.
Lemma rvclip_almostR2_bounded_exists (
rv_X :
Ts ->
R)
{
rv :
RandomVariable dom borel_sa rv_X}
{
isl:
IsLinfty rv_X} :
exists (
c:
nonnegreal),
almostR2 prts eq rv_X (
rvclip rv_X c).
Proof.
Lemma zero_prob_bound
(
rv_X :
Ts ->
R)
{
rv :
RandomVariable dom borel_sa rv_X} :
forall (
c1 c2 :
R),
c1 <=
c2 ->
ps_P (
Linfty_term rv_X c1) = 0 ->
ps_P (
Linfty_term rv_X c2) = 0.
Proof.
Lemma zero_prob_bound_Linfty
(
rv_X :
Ts ->
R)
{
rv :
RandomVariable dom borel_sa rv_X}
{
isl:
IsLinfty rv_X} :
forall (
c :
R),
(0 <
c ->
ps_P (
Linfty_term rv_X (
Linfty_norm rv_X +
c)) = 0).
Proof.
Lemma Linfty_norm_contains_finite_lim (
rv_X :
Ts ->
R)
{
rv :
RandomVariable dom borel_sa rv_X}
{
isl:
IsLinfty rv_X} :
ps_P (
Linfty_term rv_X (
Linfty_norm rv_X)) = 0.
Proof.
Lemma almostR2_abs_le_Linfty_norm (
rv_X :
Ts ->
R)
{
rv :
RandomVariable dom borel_sa rv_X}
{
isl:
IsLinfty rv_X} :
almostR2 prts Rle (
rvabs rv_X) (
const (
Linfty_norm rv_X)).
Proof.
Lemma term_bound_Linfty_norm (
rv_X :
Ts ->
R) (
c :
R)
{
rv :
RandomVariable dom borel_sa rv_X} :
ps_P (
Linfty_term rv_X c) = 0 ->
Rbar_le (
Linfty_norm rv_X)
c.
Proof.
Instance IsLp_const_bounded (
n:
R) (
rv_X :
Ts ->
R) (
bound :
R)
{
rv :
RandomVariable dom borel_sa rv_X} :
0 <=
n ->
rv_le (
rvabs rv_X) (
const bound) ->
IsLp prts n rv_X.
Proof.
Global Instance Linfty_Lp (
n:
nonnegreal) (
rv_X :
Ts ->
R)
{
rv :
RandomVariable dom borel_sa rv_X}
{
isl:
IsLinfty rv_X}
:
IsLp prts n rv_X.
Proof.
Definition posreal_nnneg (
x:
posreal) :
nonnegreal
:=
mknonnegreal x (
Rlt_le _ _ (
cond_pos x)).
Coercion posreal_nnneg :
posreal >->
nonnegreal.
Global Instance Linfty_Lp' (
n:
posreal) (
rv_X :
Ts ->
R)
{
rv :
RandomVariable dom borel_sa rv_X}
{
isl:
IsLinfty rv_X}
:
IsLp prts n rv_X.
Proof.
Lemma Linfty_Lp_le (
p:
posreal) (
rv_X :
Ts ->
R)
{
rv :
RandomVariable dom borel_sa rv_X}
{
isl:
IsLinfty rv_X} :
LpRRVnorm (
p:=
p)
prts (
pack_LpRRV prts rv_X (
lp:=
Linfty_Lp p _)) <=
Linfty_norm rv_X.
Proof.
Definition norm_convergence
(
X:
Ts ->
R)
(
Xn:
nat ->
Ts ->
R)
(
norm : (
Ts ->
R) ->
nonnegreal) :=
is_lim_seq (
fun n =>
norm (
rvminus X (
Xn n))) 0.
Lemma Linf_Lp_converge (
p:
posreal)
(
X:
Ts ->
R)
(
Xn:
nat ->
Ts ->
R)
(
rvdif :
forall (
n:
nat),
RandomVariable dom borel_sa (
rvminus X (
Xn n)))
(
isl:
forall (
n:
nat),
IsLinfty (
rvminus X (
Xn n))) :
is_lim_seq (
fun n =>
Linfty_norm (
rvminus X (
Xn n))) 0 ->
is_lim_seq (
fun n =>
LpRRVnorm (
p:=
p)
prts (
pack_LpRRV prts (
rvminus X (
Xn n)))) 0.
Proof.
Global Instance almostR2_same_lift {
A B}
R1 R2 (
f :
A ->
B)
(
p:
Proper (
R1 ==>
R2)
f) :
Proper (
almostR2 prts R1 ==>
almostR2 prts R2) (
fun x t =>
f (
x t)).
Proof.
intros P1 P2 [P [Pone PR1]].
exists P.
split; trivial.
intros ??.
specialize (PR1 _ H).
now apply p.
Qed.
Global Instance almostR2_sub_lift
{
Td1 Td2:
Type}
(
R1:
Td1->
Td1->
Prop)
(
R2:
Td2->
Td2->
Prop)
(
f:(
Ts->
Td1)->
Ts->
Td2)
(
fpres:
forall x y a,
R1 (
x a) (
y a) ->
R2 (
f x a) (
f y a))
:
Proper (
almostR2 prts R1 ==>
almostR2 prts R2)
f.
Proof.
intros x1 x2 [Px [Pxall eq_onx]].
exists Px.
split; trivial.
intros; auto.
Qed.
Lemma Linfty_term_almostR2_Rle_impl rv_X1 rv_X2
{
rv1:
RandomVariable dom borel_sa rv_X1}
{
rv2:
RandomVariable dom borel_sa rv_X2} :
almostR2 prts Rle (
rvabs rv_X1)
rv_X2 ->
forall a,
almostR2 prts impl (
Linfty_term rv_X1 a) (
Linfty_term rv_X2 a).
Proof.
Lemma Linfty_norm_almostR2_le rv_X1 rv_X2
{
rv1:
RandomVariable dom borel_sa rv_X1}
{
rv2:
RandomVariable dom borel_sa rv_X2}
(
rle:
almostR2 prts Rle (
rvabs rv_X1)
rv_X2) :
Rbar_le (
Linfty_norm rv_X1) (
Linfty_norm rv_X2).
Proof.
Lemma IsLinfty_almostR2_le rv_X1 rv_X2
{
rv1:
RandomVariable dom borel_sa rv_X1}
{
rv2:
RandomVariable dom borel_sa rv_X2}
(
rle:
almostR2 prts Rle (
rvabs rv_X1)
rv_X2)
{
isli:
IsLinfty rv_X2}
:
IsLinfty rv_X1.
Proof.
Lemma Linfty_norm_const c :
Linfty_norm (
const c) =
Rabs c.
Proof.
Global Instance IsLinfty_const c :
IsLinfty (
const c).
Proof.
Lemma Linfty_term_almostR2_eq rv_X1 rv_X2
{
rv1:
RandomVariable dom borel_sa rv_X1}
{
rv2:
RandomVariable dom borel_sa rv_X2}
(
req:
almostR2 prts eq rv_X1 rv_X2) :
forall x,
almostR2 prts iff (
Linfty_term rv_X2 x) (
Linfty_term rv_X1 x).
Proof.
intros x.
destruct req as [
p [
pa HH]].
exists p.
split;
trivial;
intros.
unfold Linfty_term,
rvabs;
simpl.
rewrite (
HH _ H).
tauto.
Qed.
Lemma Linfty_norm_almostR2_eq rv_X1 rv_X2
{
rv1:
RandomVariable dom borel_sa rv_X1}
{
rv2:
RandomVariable dom borel_sa rv_X2}
(
req:
almostR2 prts eq rv_X1 rv_X2) :
Linfty_norm rv_X1 =
Linfty_norm rv_X2.
Proof.
Lemma IsLinfty_almostR2_eq rv_X1 rv_X2
{
rv1:
RandomVariable dom borel_sa rv_X1}
{
rv2:
RandomVariable dom borel_sa rv_X2}
(
req:
almostR2 prts eq rv_X1 rv_X2) :
IsLinfty rv_X1 <->
IsLinfty rv_X2.
Proof.
Lemma Linfty_norm_scale c x (
y:
R)
{
rv_x:
RandomVariable dom borel_sa x} :
Linfty_norm x =
y ->
Linfty_norm (
rvscale c x) =
Rabs c *
y.
Proof.
Global Instance IsLinfty_scale c x
{
rv_x:
RandomVariable dom borel_sa x}
{
li_x:
IsLinfty x}
:
IsLinfty (
rvscale c x).
Proof.
Lemma Linfty_norm_abs x
{
rv_x:
RandomVariable dom borel_sa x} :
Linfty_norm (
rvabs x) =
Linfty_norm x.
Proof.
Lemma Linfty_norm_opp x
{
rv_x:
RandomVariable dom borel_sa x} :
Linfty_norm (
rvopp x) =
Linfty_norm x.
Proof.
Lemma Linfty_norm_minus_swap x y
{
rv_x:
RandomVariable dom borel_sa x}
{
rv_y:
RandomVariable dom borel_sa y} :
Linfty_norm (
rvminus x y) =
Linfty_norm (
rvminus y x).
Proof.
Global Instance IsLinfty_abs x
{
rv_x:
RandomVariable dom borel_sa x}
{
li_x:
IsLinfty x}
:
IsLinfty (
rvabs x).
Proof.
Lemma IsLinfty_abs_inv x
{
rv_x:
RandomVariable dom borel_sa x}
{
li_x:
IsLinfty (
rvabs x)}
:
IsLinfty x.
Proof.
Existing Instance rvclip_rv.
Lemma Linfty_term_rvclip x c
{
rv_x:
RandomVariable dom borel_sa x} :
event_equiv (
Linfty_term (
rvclip x c)
c)
event_none.
Proof.
Instance IsLinfty_rvclip x c
{
rv_x:
RandomVariable dom borel_sa x} :
IsLinfty (
rvclip x c).
Proof.
Global Instance IsLinfty_plus x y
{
rv_x:
RandomVariable dom borel_sa x}
{
rv_y:
RandomVariable dom borel_sa y}
{
isli_x:
IsLinfty x}
{
isli_y:
IsLinfty y} :
IsLinfty (
rvplus x y).
Proof.
Global Instance IsLinfty_minus x y
{
rv_x:
RandomVariable dom borel_sa x}
{
rv_y:
RandomVariable dom borel_sa y}
{
isli_x:
IsLinfty x}
{
isli_y:
IsLinfty y} :
IsLinfty (
rvminus x y).
Proof.
typeclasses eauto.
Qed.
Lemma rvabs_triang (
f g:
Ts->
R) :
rv_le (
rvabs (
rvplus f g)) (
rvplus (
rvabs f) (
rvabs g)).
Proof.
Lemma Linfty_norm_minkowski (
x y : (
Ts ->
R))
{
rv_x:
RandomVariable dom borel_sa x}
{
rv_y:
RandomVariable dom borel_sa y}
{
isli_x:
IsLinfty x}
{
isli_y:
IsLinfty y} :
Linfty_norm (
rvplus x y) <=
Linfty_norm x +
Linfty_norm y.
Proof.
Lemma almostR2_eq_rvabs0 x :
almostR2 prts eq (
rvabs x) (
const 0) <->
almostR2 prts eq x (
const 0).
Proof.
split;
intros [
p[
pone peq]]
;
exists p;
split;
trivial
;
intros a pa
;
specialize (
peq a pa)
;
rv_unfold.
-
now apply Rcomplements.Rabs_eq_0.
-
rewrite peq.
apply Rabs_R0.
Qed.
Lemma Linfty_norm0 x
{
rv_x:
RandomVariable dom borel_sa x} :
Linfty_norm x = 0 ->
almostR2 prts eq x (
const 0).
Proof.
Section packed.
Record LiRRV :
Type
:=
LiRRV_of {
LiRRV_rv_X :>
Ts ->
R
;
LiRRV_rv :>
RandomVariable dom borel_sa LiRRV_rv_X
;
LiRRV_li :>
IsLinfty LiRRV_rv_X
}.
Global Existing Instance LiRRV_rv.
Global Existing Instance LiRRV_li.
Definition pack_LiRRV (
rv_X:
Ts ->
R) {
rv:
RandomVariable dom borel_sa rv_X} {
li:
IsLinfty rv_X}
:=
LiRRV_of rv_X rv li.
Definition LiRRV_LpRRV (
n:
nonnegreal) (
rv:
LiRRV)
:
LpRRV prts n
:=
pack_LpRRV prts (
LiRRV_rv_X rv).
Definition LiRRV_seq (
rv1 rv2:
LiRRV)
:=
rv_eq (
LiRRV_rv_X rv1) (
LiRRV_rv_X rv2).
Definition LiRRV_eq (
rv1 rv2:
LiRRV)
:=
almostR2 prts eq rv1 rv2.
Global Instance LiRRV_seq_eq :
subrelation LiRRV_seq LiRRV_eq.
Proof.
Global Instance LiRRV_seq_equiv :
Equivalence (
LiRRV_seq).
Proof.
Global Instance LiRRV_eq_equiv :
Equivalence LiRRV_eq.
Proof.
unfold LiRRV_eq.
constructor.
-
intros [
x?].
reflexivity.
-
intros [
x?] [
y?]
ps1;
simpl in *.
now symmetry.
-
intros [
x??] [
y??] [
z??]
ps1 ps2.
simpl in *.
etransitivity;
eauto.
Qed.
Definition LiRRVconst (
x:
R) :
LiRRV
:=
pack_LiRRV (
const x).
Definition LiRRVzero :
LiRRV :=
LiRRVconst 0.
Program Definition LiRRVscale (
x:
R) (
rv:
LiRRV) :
LiRRV
:=
pack_LiRRV (
rvscale x rv).
Global Instance LiRRV_scale_sproper :
Proper (
eq ==>
LiRRV_seq ==>
LiRRV_seq)
LiRRVscale.
Proof.
unfold Proper,
respectful,
LiRRV_eq.
intros ?
x ? [
x1??] [
x2??]
eqqx.
subst.
simpl in *.
unfold rvscale.
red.
simpl.
red in eqqx.
simpl in *.
now rewrite eqqx.
Qed.
Global Instance LiRRV_scale_proper :
Proper (
eq ==>
LiRRV_eq ==>
LiRRV_eq)
LiRRVscale.
Proof.
unfold Proper,
respectful,
LiRRV_eq.
intros ?
x ? [
x1??] [
x2??]
eqqx.
subst.
simpl in *.
rewrite eqqx.
reflexivity.
Qed.
Definition LiRRVopp (
rv:
LiRRV) :
LiRRV
:=
pack_LiRRV (
rvopp rv).
Global Instance LiRRV_opp_sproper :
Proper (
LiRRV_seq ==>
LiRRV_seq)
LiRRVopp.
Proof.
Global Instance LiRRV_opp_proper :
Proper (
LiRRV_eq ==>
LiRRV_eq)
LiRRVopp.
Proof.
Lemma LiRRVopp_scale (
rv:
LiRRV) :
LiRRV_eq
(
LiRRVopp rv) (
LiRRVscale (-1)
rv).
Proof.
red.
reflexivity.
Qed.
Definition LiRRVabs (
rv:
LiRRV) :
LiRRV
:=
pack_LiRRV (
rvabs rv).
Global Instance LiRRV_abs_sproper :
Proper (
LiRRV_seq ==>
LiRRV_seq)
LiRRVabs.
Proof.
unfold Proper,
respectful.
intros x y eqq.
red in eqq.
red;
simpl.
now rewrite eqq.
Qed.
Global Instance LiRRV_abs_proper :
Proper (
LiRRV_eq ==>
LiRRV_eq)
LiRRVabs.
Proof.
Program Definition LiRRVplus (
x y:
LiRRV) :
LiRRV
:=
pack_LiRRV (
rvplus x y).
Global Instance LiRRV_plus_sproper :
Proper (
LiRRV_seq ==>
LiRRV_seq ==>
LiRRV_seq)
LiRRVplus.
Proof.
unfold Proper,
respectful.
intros x y eqq1 a b eqq2.
red in eqq1,
eqq2.
red;
simpl.
now rewrite eqq1,
eqq2.
Qed.
Global Instance LiRRV_plus_proper :
Proper (
LiRRV_eq ==>
LiRRV_eq ==>
LiRRV_eq)
LiRRVplus.
Proof.
Definition LiRRVminus (
rv1 rv2:
LiRRV) :
LiRRV
:=
pack_LiRRV (
rvminus rv1 rv2).
Lemma LiRRVminus_plus (
rv1 rv2:
LiRRV) :
LiRRV_seq
(
LiRRVminus rv1 rv2) (
LiRRVplus rv1 (
LiRRVopp rv2)).
Proof.
intros ?.
reflexivity.
Qed.
Global Instance LiRRV_minus_sproper :
Proper (
LiRRV_seq ==>
LiRRV_seq ==>
LiRRV_seq)
LiRRVminus.
Proof.
Global Instance LiRRV_minus_proper :
Proper (
LiRRV_eq ==>
LiRRV_eq ==>
LiRRV_eq)
LiRRVminus.
Proof.
Ltac LiRRV_simpl
:=
repeat match goal with
| [
H :
LiRRV |-
_ ] =>
destruct H as [???]
end
;
unfold LiRRVplus,
LiRRVminus,
LiRRVopp,
LiRRVscale,
LiRRVabs
;
simpl.
Lemma LiRRV_plus_comm x y :
LiRRV_eq (
LiRRVplus x y) (
LiRRVplus y x).
Proof.
Lemma LiRRV_plus_assoc (
x y z :
LiRRV) :
LiRRV_eq (
LiRRVplus x (
LiRRVplus y z)) (
LiRRVplus (
LiRRVplus x y)
z).
Proof.
Lemma LiRRV_plus_zero (
x :
LiRRV) :
LiRRV_eq (
LiRRVplus x (
LiRRVconst 0))
x.
Proof.
Lemma LiRRV_plus_inv (
x:
LiRRV) :
LiRRV_eq (
LiRRVplus x (
LiRRVopp x)) (
LiRRVconst 0).
Proof.
Lemma LiRRV_scale_scale (
x y :
R) (
u :
LiRRV) :
LiRRV_eq (
LiRRVscale x (
LiRRVscale y u)) (
LiRRVscale (
x *
y)
u).
Proof.
Lemma LiRRV_scale1 (
u :
LiRRV) :
LiRRV_eq (
LiRRVscale one u)
u.
Proof.
Lemma LiRRV_scale_plus_l (
x :
R) (
u v :
LiRRV) :
LiRRV_eq (
LiRRVscale x (
LiRRVplus u v)) (
LiRRVplus (
LiRRVscale x u) (
LiRRVscale x v)).
Proof.
Lemma LiRRV_scale_plus_r (
x y :
R) (
u :
LiRRV) :
LiRRV_eq (
LiRRVscale (
x +
y)
u) (
LiRRVplus (
LiRRVscale x u) (
LiRRVscale y u)).
Proof.
Definition LiRRVnorm (
rv_X:
LiRRV) :
R
:=
real (
Linfty_norm rv_X).
Global Instance LiRRV_norm_proper :
Proper (
LiRRV_eq ==>
eq)
LiRRVnorm.
Proof.
Global Instance LiRRV_norm_sproper :
Proper (
LiRRV_seq ==>
eq)
LiRRVnorm.
Proof.
Definition LiRRVnorm_factor :
R := 1.
Lemma LiRRV_norm_plus (
x y:
LiRRV) :
LiRRVnorm (
LiRRVplus x y) <=
LiRRVnorm x +
LiRRVnorm y.
Proof.
Lemma LiRRV_norm_scal_strong (
x:
R) (
y:
LiRRV) :
LiRRVnorm (
LiRRVscale x y) =
Rabs x *
LiRRVnorm y.
Proof.
Lemma LiRRV_norm_scal (
x:
R) (
y:
LiRRV) :
LiRRVnorm (
LiRRVscale x y) <=
Rabs x *
LiRRVnorm y.
Proof.
Lemma LiRRV_norm0 (
x:
LiRRV) :
LiRRVnorm x = 0 ->
almostR2 prts eq x LiRRVzero.
Proof.
Definition LiRRVpoint :
LiRRV :=
LiRRVconst 0.
Definition LiRRVball (
x:
LiRRV) (
e:
R) (
y:
LiRRV):
Prop
:=
LiRRVnorm (
LiRRVminus x y) <
e.
Ltac LiRRV_simpl
::=
repeat match goal with
| [
H :
LiRRV |-
_ ] =>
destruct H as [???]
end;
unfold LiRRVball,
LiRRVnorm,
LiRRVplus,
LiRRVminus,
LiRRVopp,
LiRRVscale,
LiRRVnorm in *
;
simpl pack_LiRRV;
simpl LiRRV_rv_X in *.
Global Instance LiRRV_ball_sproper :
Proper (
LiRRV_seq ==>
eq ==>
LiRRV_seq ==>
iff)
LiRRVball.
Proof.
intros ??
eqq1 ??
eqq2 ??
eqq3.
unfold LiRRVball in *.
rewrite <-
eqq1, <-
eqq2, <-
eqq3.
reflexivity.
Qed.
Global Instance LiRRV_ball_proper :
Proper (
LiRRV_eq ==>
eq ==>
LiRRV_eq ==>
iff)
LiRRVball.
Proof.
intros ??
eqq1 ??
eqq2 ??
eqq3.
unfold LiRRVball in *.
rewrite <-
eqq1, <-
eqq2, <-
eqq3.
reflexivity.
Qed.
Lemma LiRRV_ball_refl x (
e :
posreal) :
LiRRVball x e x.
Proof.
Lemma LiRRV_ball_sym x y e :
LiRRVball x e y ->
LiRRVball y e x.
Proof.
Lemma LiRRV_ball_trans x y z e1 e2 :
LiRRVball x e1 y ->
LiRRVball y e2 z ->
LiRRVball x (
e1+
e2)
z.
Proof.
Lemma LiRRV_close_close (
x y :
LiRRV) (
eps :
R) :
LiRRVnorm (
LiRRVminus y x) <
eps ->
LiRRVball x eps y.
Proof.
Lemma LiRRV_norm_ball_compat (
x y :
LiRRV) (
eps :
posreal) :
LiRRVball x eps y ->
LiRRVnorm (
LiRRVminus y x) <
LiRRVnorm_factor *
eps.
Proof.
Definition LiRRV_UniformSpace_mixin :
UniformSpace.mixin_of LiRRV
:=
UniformSpace.Mixin LiRRV LiRRVpoint LiRRVball
LiRRV_ball_refl
LiRRV_ball_sym
LiRRV_ball_trans.
Canonical LiRRV_UniformSpace :=
UniformSpace.Pack LiRRV LiRRV_UniformSpace_mixin LiRRV.
Section quoted.
Definition LiRRVq :
Type :=
quot LiRRV_eq.
Definition LiRRVq_const (
x:
R) :
LiRRVq :=
Quot _ (
LiRRVconst x).
Lemma LiRRVq_constE x :
LiRRVq_const x =
Quot _ (
LiRRVconst x).
Proof.
reflexivity.
Qed.
Hint Rewrite LiRRVq_constE :
quot.
Definition LiRRVq_zero :
LiRRVq :=
LiRRVq_const 0.
Lemma LiRRVq_zeroE :
LiRRVq_zero =
LiRRVq_const 0.
Proof.
reflexivity.
Qed.
Hint Rewrite LiRRVq_zeroE :
quot.
Definition LiRRVq_scale (
x:
R) :
LiRRVq ->
LiRRVq
:=
quot_lift (
LiRRVscale x).
Lemma LiRRVq_scaleE x y :
LiRRVq_scale x (
Quot _ y) =
Quot _ (
LiRRVscale x y).
Proof.
Hint Rewrite LiRRVq_scaleE :
quot.
Definition LiRRVq_opp :
LiRRVq ->
LiRRVq
:=
quot_lift LiRRVopp.
Lemma LiRRVq_oppE x :
LiRRVq_opp (
Quot _ x) =
Quot _ (
LiRRVopp x).
Proof.
Hint Rewrite LiRRVq_oppE :
quot.
Definition LiRRVq_abs :
LiRRVq ->
LiRRVq
:=
quot_lift LiRRVabs.
Lemma LiRRVq_absE x :
LiRRVq_abs (
Quot _ x) =
Quot _ (
LiRRVabs x).
Proof.
Hint Rewrite LiRRVq_absE :
quot.
Definition LiRRVq_plus :
LiRRVq ->
LiRRVq ->
LiRRVq
:=
quot_lift2 LiRRVplus.
Lemma LiRRVq_plusE x y :
LiRRVq_plus (
Quot _ x) (
Quot _ y) =
Quot _ (
LiRRVplus x y).
Proof.
Hint Rewrite LiRRVq_plusE :
quot.
Definition LiRRVq_minus :
LiRRVq ->
LiRRVq ->
LiRRVq
:=
quot_lift2 LiRRVminus.
Lemma LiRRVq_minusE x y :
LiRRVq_minus (
Quot _ x) (
Quot _ y) =
Quot _ (
LiRRVminus x y).
Proof.
Hint Rewrite LiRRVq_minusE :
quot.
Ltac LiRRVq_simpl
:=
repeat match goal with
| [
H:
LiRRVq |-
_ ] =>
let xx :=
fresh H in destruct (
Quot_inv H)
as [
xx ?];
subst H;
rename xx into H
end
;
try autorewrite with quot
;
try apply (@
eq_Quot _ _ LiRRV_eq_equiv).
Lemma LiRRVq_minus_plus (
rv1 rv2:
LiRRVq) :
LiRRVq_minus rv1 rv2 =
LiRRVq_plus rv1 (
LiRRVq_opp rv2).
Proof.
Lemma LiRRVq_opp_scale (
rv:
LiRRVq) :
LiRRVq_opp rv =
LiRRVq_scale (-1)
rv.
Proof.
Lemma LiRRVq_plus_comm x y :
LiRRVq_plus x y =
LiRRVq_plus y x.
Proof.
Lemma LiRRVq_plus_assoc (
x y z :
LiRRVq) :
LiRRVq_plus x (
LiRRVq_plus y z) =
LiRRVq_plus (
LiRRVq_plus x y)
z.
Proof.
Lemma LiRRVq_plus_zero (
x :
LiRRVq) :
LiRRVq_plus x LiRRVq_zero =
x.
Proof.
Lemma LiRRVq_plus_inv (
x:
LiRRVq) :
LiRRVq_plus x (
LiRRVq_opp x) =
LiRRVq_zero.
Proof.
Definition LiRRVq_AbelianGroup_mixin :
AbelianGroup.mixin_of LiRRVq
:=
AbelianGroup.Mixin LiRRVq LiRRVq_plus LiRRVq_opp LiRRVq_zero
LiRRVq_plus_comm LiRRVq_plus_assoc
LiRRVq_plus_zero LiRRVq_plus_inv.
Canonical LiRRVq_AbelianGroup :=
AbelianGroup.Pack LiRRVq LiRRVq_AbelianGroup_mixin LiRRVq.
Ltac LiRRVq_simpl ::=
repeat match goal with
| [
H:
LiRRVq |-
_ ] =>
let xx :=
fresh H in destruct (
Quot_inv H)
as [
xx ?];
subst H;
rename xx into H
| [
H:
AbelianGroup.sort LiRRVq_AbelianGroup |-
_ ] =>
let xx :=
fresh H in destruct (
Quot_inv H)
as [
xx ?];
subst H;
rename xx into H
end
;
try autorewrite with quot
;
try apply (@
eq_Quot _ _ LiRRV_eq_equiv).
Lemma LiRRVq_scale_scale (
x y :
R_Ring) (
u :
LiRRVq_AbelianGroup) :
LiRRVq_scale x (
LiRRVq_scale y u) =
LiRRVq_scale (
x *
y)
u.
Proof.
Lemma LiRRVq_scale1 (
u :
LiRRVq_AbelianGroup) :
LiRRVq_scale one u =
u.
Proof.
Lemma LiRRVq_scale_plus_l (
x :
R_Ring) (
u v :
LiRRVq_AbelianGroup) :
LiRRVq_scale x (
plus u v) =
plus (
LiRRVq_scale x u) (
LiRRVq_scale x v).
Proof.
Lemma LiRRVq_scale_plus_r (
x y :
R_Ring) (
u :
LiRRVq_AbelianGroup) :
LiRRVq_scale (
plus x y)
u =
plus (
LiRRVq_scale x u) (
LiRRVq_scale y u).
Proof.
Definition LiRRVq_ModuleSpace_mixin :
ModuleSpace.mixin_of R_Ring LiRRVq_AbelianGroup
:=
ModuleSpace.Mixin R_Ring LiRRVq_AbelianGroup
LiRRVq_scale LiRRVq_scale_scale LiRRVq_scale1
LiRRVq_scale_plus_l LiRRVq_scale_plus_r.
Canonical LiRRVq_ModuleSpace :=
ModuleSpace.Pack R_Ring LiRRVq (
ModuleSpace.Class R_Ring LiRRVq LiRRVq_AbelianGroup_mixin LiRRVq_ModuleSpace_mixin)
LiRRVq.
Definition LiRRVq_norm :
LiRRVq ->
R
:=
quot_rec LiRRV_norm_proper.
Lemma LiRRVq_normE x :
LiRRVq_norm (
Quot _ x) =
LiRRVnorm x.
Proof.
Hint Rewrite LiRRVq_normE :
quot.
Lemma LiRRVq_norm_plus (
x y:
LiRRVq) :
LiRRVq_norm (
LiRRVq_plus x y) <=
LiRRVq_norm x +
LiRRVq_norm y.
Proof.
Lemma LiRRVq_norm_scal_strong (
x:
R) (
y:
LiRRVq) :
LiRRVq_norm (
LiRRVq_scale x y) =
Rabs x *
LiRRVq_norm y.
Proof.
Lemma LiRRVq_norm_scal x (
y:
LiRRVq) :
LiRRVq_norm (
LiRRVq_scale x y) <=
Rabs x *
LiRRVq_norm y.
Proof.
Lemma LiRRVq_norm0 x :
LiRRVq_norm x = 0 ->
x =
LiRRVq_zero.
Proof.
intros.
LiRRVq_simpl.
autorewrite with quot in *.
now apply LiRRV_norm0.
Qed.
Definition LiRRVq_ball :
LiRRVq ->
R ->
LiRRVq ->
Prop
:=
quot_lift_ball LiRRV_eq LiRRVball.
Lemma LiRRVq_ballE x e y :
LiRRVq_ball (
Quot _ x)
e (
Quot _ y) =
LiRRVball x e y.
Proof.
Hint Rewrite LiRRVq_ballE :
quot.
Definition LiRRVq_point:
LiRRVq
:=
Quot _ (
LiRRVpoint).
Lemma LiRRVq_ball_refl x (
e :
posreal) :
LiRRVq_ball x e x.
Proof.
Lemma LiRRVq_ball_sym x y e :
LiRRVq_ball x e y ->
LiRRVq_ball y e x.
Proof.
Lemma LiRRVq_ball_trans x y z e1 e2 :
LiRRVq_ball x e1 y ->
LiRRVq_ball y e2 z ->
LiRRVq_ball x (
e1+
e2)
z.
Proof.
Lemma LiRRVq_minus_minus (
x y :
LiRRVq) :
minus x y =
LiRRVq_minus x y.
Proof.
Lemma LiRRVq_close_close (
x y :
LiRRVq) (
eps :
R) :
LiRRVq_norm (
minus y x) <
eps ->
LiRRVq_ball x eps y.
Proof.
Lemma LiRRVq_norm_ball_compat (
x y :
LiRRVq) (
eps :
posreal) :
LiRRVq_ball x eps y ->
LiRRVq_norm (
minus y x) <
LiRRVnorm_factor *
eps.
Proof.
Definition LiRRVq_UniformSpace_mixin :
UniformSpace.mixin_of LiRRVq
:=
UniformSpace.Mixin LiRRVq LiRRVq_point LiRRVq_ball
LiRRVq_ball_refl
LiRRVq_ball_sym
LiRRVq_ball_trans.
Canonical LiRRVq_UniformSpace :=
UniformSpace.Pack LiRRVq LiRRVq_UniformSpace_mixin LiRRVq.
Canonical LiRRVq_NormedModuleAux :=
NormedModuleAux.Pack R_AbsRing LiRRVq
(
NormedModuleAux.Class R_AbsRing LiRRVq
(
ModuleSpace.class _ LiRRVq_ModuleSpace)
(
LiRRVq_UniformSpace_mixin))
LiRRVq.
Definition LiRRVq_NormedModule_mixin :
NormedModule.mixin_of R_AbsRing LiRRVq_NormedModuleAux
:=
NormedModule.Mixin R_AbsRing LiRRVq_NormedModuleAux
LiRRVq_norm
LiRRVnorm_factor
LiRRVq_norm_plus
LiRRVq_norm_scal
LiRRVq_close_close
LiRRVq_norm_ball_compat
LiRRVq_norm0.
Canonical LiRRVq_NormedModule :=
NormedModule.Pack R_AbsRing LiRRVq
(
NormedModule.Class R_AbsRing LiRRVq
(
NormedModuleAux.class _ LiRRVq_NormedModuleAux)
LiRRVq_NormedModule_mixin)
LiRRVq.
End quoted.
End packed.
Hint Rewrite @
LiRRVq_constE :
quot.
Hint Rewrite @
LiRRVq_zeroE :
quot.
Hint Rewrite @
LiRRVq_scaleE :
quot.
Hint Rewrite @
LiRRVq_oppE :
quot.
Hint Rewrite @
LiRRVq_absE :
quot.
Hint Rewrite @
LiRRVq_plusE :
quot.
Hint Rewrite @
LiRRVq_minusE :
quot.
Hint Rewrite LiRRVq_normE :
quot.
Global Arguments LiRRV :
clear implicits.
Global Arguments LiRRVq :
clear implicits.
Lemma Linf_sequential_uniformly_convergent
(
f :
nat ->
Ts ->
R)
{
rv :
forall n,
RandomVariable dom borel_sa (
f n)}
{
isl :
forall n,
IsLinfty (
f n)} :
(
forall (
eps :
posreal),
exists (
N :
nat),
forall (
n m :
nat),
(
N <=
n)%
nat -> (
N <=
m)%
nat ->
Linfty_norm (
rvminus (
f n) (
f m)) <
eps) ->
exists (
P :
event dom),
ps_P P = 1 /\
forall (
eps :
posreal),
exists (
N :
nat),
forall (
n m :
nat),
(
N <=
n)%
nat -> (
N <=
m)%
nat ->
forall (
x:
Ts),
P x ->
rvabs (
rvminus (
f n) (
f m))
x <
eps.
Proof.
Lemma uniformly_convergent_cauchy (
f :
nat ->
Ts ->
R)
{
rv :
forall n,
RandomVariable dom borel_sa (
f n)} :
(
forall (
eps :
posreal),
exists (
N :
nat),
forall (
n m :
nat),
(
N <=
n)%
nat -> (
N <=
m)%
nat ->
forall (
x:
Ts),
rvabs (
rvminus (
f n) (
f m))
x <
eps) ->
exists (
g :
Ts ->
R),
RandomVariable dom borel_sa g /\
forall (
eps:
posreal),
exists (
N :
nat),
forall (
n :
nat),
(
N <=
n)%
nat ->
forall (
x :
Ts),
rvabs (
rvminus g (
f n))
x <
eps.
Proof.
End Linf.
Section Linf2.
Context {
Ts:
Type}
{
dom:
SigmaAlgebra Ts}
(
prts:
ProbSpace dom).
Lemma uniformly_convergent_cauchy_almostR2
(
f :
nat ->
Ts ->
R)
{
rv :
forall n,
RandomVariable dom borel_sa (
f n)}
(
P :
event dom)
(
dec :
forall x:
Ts, {
P x} + {~
P x}) :
ps_P P = 1 ->
(
forall (
eps :
posreal),
exists (
N :
nat),
forall (
n m :
nat),
(
N <=
n)%
nat -> (
N <=
m)%
nat ->
forall (
x:
Ts),
P x ->
rvabs (
rvminus (
f n) (
f m))
x <
eps) ->
exists (
g :
Ts ->
R),
RandomVariable dom borel_sa g /\
forall (
eps:
posreal),
exists (
N :
nat),
forall (
n :
nat),
(
N <=
n)%
nat ->
forall (
x :
Ts),
P x ->
rvabs (
rvminus g (
f n))
x <
eps.
Proof.
Local Open Scope prob.
Lemma ps_complement' {
T:
Type} {σ:
SigmaAlgebra T} (
ps:
ProbSpace σ) (
A:
event σ) :
ps_P A = 1 -
ps_P (¬
A).
Proof.
Definition pre_event_transport
{
T:
Type} {σ:
SigmaAlgebra T} (
x:
event σ) (
y :
pre_event T)
(
eqq:
pre_event_equiv (
event_pre x)
y)
:
event σ
:=
exist _ y (
proj1 (
sa_proper σ (
event_pre x)
y eqq) (
proj2_sig x)).
Lemma pre_event_transport_equiv {
T:
Type} {σ:
SigmaAlgebra T} (
x:
event σ) (
y :
pre_event T)
(
eqq:
pre_event_equiv (
event_pre x)
y) :
event_equiv x (
pre_event_transport x y eqq).
Proof.
intros HH.
destruct x; simpl.
apply eqq.
Qed.
Lemma almostR2_ps1 {
T:
Type} {σ:
SigmaAlgebra Ts} (
ps:
ProbSpace σ) (
R:
T->
T->
Prop) (
E:
event σ) (
x y:
Ts->
T)
(
compat:(
forall omega,
E omega <->
R (
x omega) (
y omega))) :
almostR2 ps R x y ->
ps_P E = 1.
Proof.
intros alm.
destruct alm as [
p [
pone px]].
generalize (
ps_sub ps p E)
;
intros HH.
cut_to HH.
-
generalize (
ps_le1 _ E);
lra.
-
intros ??.
specialize (
px _ H).
now apply compat in px.
Qed.
Lemma almostR2_bounded_Rbar_le_Linfty_norm
(
g :
Ts ->
R)
{
rv :
RandomVariable dom borel_sa g}
(
P :
event dom)
(
eps :
posreal) :
ps_P P = 1 ->
(
forall x,
P x -> (
rvabs g)
x <
eps) ->
Rbar_le (
Linfty_norm prts g)
eps.
Proof.
Lemma almostR2_bounded_IsLinfty
(
g :
Ts ->
R)
{
rv :
RandomVariable dom borel_sa g}
(
P :
event dom)
(
eps :
posreal) :
ps_P P = 1 ->
(
forall x,
P x -> (
rvabs g)
x <
eps) ->
IsLinfty prts g.
Proof.
Lemma Linf_sequential_uniformly_convergent_complete
(
f :
nat ->
Ts ->
R)
{
rv :
forall n,
RandomVariable dom borel_sa (
f n)}
{
isl :
forall n,
IsLinfty prts (
f n)}
(
P :
event dom)
(
dec :
forall x:
Ts, {
P x} + {~
P x}) :
ps_P P = 1 ->
(
forall (
eps :
posreal),
exists (
N :
nat),
forall (
n m :
nat),
(
N <=
n)%
nat -> (
N <=
m)%
nat ->
forall (
x:
Ts),
P x ->
rvabs (
rvminus (
f n) (
f m))
x <
eps) ->
exists (
g :
Ts ->
R),
exists (
rvg:
RandomVariable dom borel_sa g),
IsLinfty prts g /\
is_lim_seq (
fun n =>
Linfty_norm prts (
rvminus (
f n)
g)) 0.
Proof.
Lemma Linf_sequential_complete
(
f :
nat ->
Ts ->
R)
{
rv :
forall n,
RandomVariable dom borel_sa (
f n)}
{
isl :
forall n,
IsLinfty prts (
f n)} :
(
forall (
eps :
posreal),
exists (
N :
nat),
forall (
n m :
nat),
(
N <=
n)%
nat -> (
N <=
m)%
nat ->
Linfty_norm prts (
rvminus (
f n) (
f m)) <
eps) ->
exists (
g :
Ts ->
R),
exists (
rvg:
RandomVariable dom borel_sa g),
IsLinfty prts g /\
is_lim_seq (
fun n =>
Linfty_norm prts (
rvminus (
f n)
g)) 0.
Proof.
Lemma LiRRVq_Linf_sequential_complete
(
f :
nat ->
LiRRVq prts) :
(
forall (
eps :
posreal),
exists (
N :
nat),
forall (
n m :
nat),
(
N <=
n)%
nat -> (
N <=
m)%
nat ->
LiRRVq_norm prts (
LiRRVq_minus prts (
f n) (
f m)) <
eps) ->
exists (
g :
LiRRVq prts),
is_lim_seq (
fun n =>
LiRRVq_norm prts (
LiRRVq_minus prts (
f n)
g)) 0.
Proof.
End Linf2.
Section complete.
Context {
Ts:
Type}
{
dom:
SigmaAlgebra Ts}
(
prts:
ProbSpace dom).
Definition LiRRVq_lim_ball_center_center
(
F : (
LiRRVq_UniformSpace prts ->
Prop) ->
Prop) :
ProperFilter F ->
cauchy F ->
forall (
n:
nat),
{
b:
LiRRVq_UniformSpace prts |
F (
Hierarchy.ball (
M:=
LiRRVq_UniformSpace prts)
b (
mkposreal _ (
inv_pow_2_pos n)))}.
Proof.
Definition LiRRVq_lim_ball_center
(
F : (
LiRRVq_UniformSpace prts ->
Prop) ->
Prop) :
ProperFilter F ->
cauchy F ->
forall (
n:
nat), {
b:
LiRRVq prts ->
Prop |
F b}.
Proof.
Definition LiRRVq_lim_ball_cumulative
(
F : (
LiRRVq_UniformSpace prts ->
Prop) ->
Prop)
(
PF:
ProperFilter F)
(
cF:
cauchy F)
(
n:
nat) : {
x:
LiRRVq prts->
Prop |
F x}
:=
fold_right (
fun x y =>
exist _ _ (
Hierarchy.filter_and
_ _ (
proj2_sig x) (
proj2_sig y)))
(
exist _ _ Hierarchy.filter_true)
(
map (
LiRRVq_lim_ball_center F PF cF) (
seq 0 (
S n))).
Definition LiRRVq_lim_picker
(
F : (
LiRRVq_UniformSpace prts ->
Prop) ->
Prop)
(
PF:
ProperFilter F)
(
cF:
cauchy F)
(
n:
nat) :
LiRRVq prts
:= (
proj1_sig (
constructive_indefinite_description
_
(
filter_ex
_
(
proj2_sig (
LiRRVq_lim_ball_cumulative F PF cF n))))).
Lemma LiRRVq_lim_picker_cumulative_included
(
F : (
LiRRVq_UniformSpace prts ->
Prop) ->
Prop)
(
PF:
ProperFilter F)
(
cF:
cauchy F)
(
N n:
nat) :
(
N <=
n)%
nat ->
forall x,
proj1_sig (
LiRRVq_lim_ball_cumulative F PF cF n)
x ->
(
proj1_sig (
LiRRVq_lim_ball_center F PF cF N))
x.
Proof.
unfold LiRRVq_lim_ball_cumulative.
intros.
assert (
inn:
In N (
seq 0 (
S n))).
{
apply in_seq.
lia.
}
revert inn H0.
generalize (
seq 0 (
S n)).
clear.
induction l;
simpl.
-
tauto.
-
intros [
eqq |
inn];
intros.
+
subst.
tauto.
+
apply (
IHl inn).
tauto.
Qed.
Lemma LiRRVq_lim_picker_included
(
F : (
LiRRVq_UniformSpace prts ->
Prop) ->
Prop)
(
PF:
ProperFilter F)
(
cF:
cauchy F)
(
N n:
nat) :
(
N <=
n)%
nat ->
(
proj1_sig (
LiRRVq_lim_ball_center F PF cF N))
(
LiRRVq_lim_picker F PF cF n).
Proof.
Lemma LiRRVq_lim_ball_center_ball_center_center (
F : (
LiRRVq_UniformSpace prts ->
Prop) ->
Prop)
(
PF:
ProperFilter F)
(
cF:
cauchy F)
(
n:
nat) :
forall (
x:
UniformSpace.sort (
LiRRVq_UniformSpace prts)),
(
Hierarchy.ball (
M:=
LiRRVq_UniformSpace prts)
(
proj1_sig (
LiRRVq_lim_ball_center_center F PF cF n))
(
mkposreal _ (
inv_pow_2_pos n)))
x
<->
proj1_sig (
LiRRVq_lim_ball_center F PF cF n)
x.
Proof.
Lemma LiRRVq_lim_picker_center_included
(
F : (
LiRRVq_UniformSpace prts ->
Prop) ->
Prop)
(
PF:
ProperFilter F)
(
cF:
cauchy F)
(
n:
nat) :
(
Hierarchy.ball (
M:=
LiRRVq_UniformSpace prts)
(
proj1_sig (
LiRRVq_lim_ball_center_center F PF cF n))
(
mkposreal _ (
inv_pow_2_pos n)))
(
LiRRVq_lim_picker F PF cF n).
Proof.
Lemma LiRRVq_lim_picker_center_included2
(
F : (
LiRRVq_UniformSpace prts ->
Prop) ->
Prop)
(
PF:
ProperFilter F)
(
cF:
cauchy F)
(
N:
nat) :
forall (
n:
nat),
(
n >=
N)%
nat ->
(
Hierarchy.ball (
M:=
LiRRVq_UniformSpace prts)
(
proj1_sig (
LiRRVq_lim_ball_center_center F PF cF N))
(
mkposreal _ (
inv_pow_2_pos N)))
(
LiRRVq_lim_picker F PF cF n).
Proof.
Ltac LiRRVq_simpl :=
repeat match goal with
| [
H:
LiRRVq _ |-
_ ] =>
let xx :=
fresh H in destruct (
Quot_inv H)
as [
xx ?];
subst H;
rename xx into H
| [
H:
AbelianGroup.sort LiRRVq_AbelianGroup |-
_ ] =>
let xx :=
fresh H in destruct (
Quot_inv H)
as [
xx ?];
subst H;
rename xx into H
end
;
try autorewrite with quot
;
try apply (@
eq_Quot _ _ LiRRV_eq_equiv).
Lemma LiRRV_norm_opp (
x :
LiRRV prts) :
LiRRVnorm prts (
LiRRVopp prts x) =
LiRRVnorm prts x.
Proof.
Lemma LiRRVq_lim_ball_center_dist (
x y :
LiRRVq prts)
(
F : (
LiRRVq_UniformSpace prts ->
Prop) ->
Prop)
(
PF:
ProperFilter F)
(
cF:
cauchy F)
(
N:
nat) :
(
proj1_sig (
LiRRVq_lim_ball_center F PF cF N))
x ->
(
proj1_sig (
LiRRVq_lim_ball_center F PF cF N))
y ->
LiRRVq_norm prts (
LiRRVq_minus prts x y) < 2 / 2 ^
N.
Proof.
Lemma LiRRVq_lim_filter_cauchy
(
F : (
LiRRVq_UniformSpace prts ->
Prop) ->
Prop)
(
PF:
ProperFilter F)
(
cF:
cauchy F) :
forall N :
nat,
forall n m :
nat,
(
n >=
N)%
nat ->
(
m >=
N)%
nat ->
LiRRVq_norm prts (
LiRRVq_minus
prts
(
LiRRVq_lim_picker F PF cF n)
(
LiRRVq_lim_picker F PF cF m)) < 2 / 2 ^
N.
Proof.
Lemma LiRRVq_lim_filter_cauchy_eps
(
F : (
LiRRVq_UniformSpace prts ->
Prop) ->
Prop)
(
PF:
ProperFilter F)
(
cF:
cauchy F) :
forall (
eps :
posreal),
exists N :
nat,
forall n m :
nat,
(
n >=
N)%
nat ->
(
m >=
N)%
nat ->
LiRRVq_norm prts (
LiRRVq_minus
prts
(
LiRRVq_lim_picker F PF cF n)
(
LiRRVq_lim_picker F PF cF m)) <
eps.
Proof.
Lemma LiRRVq_norm_LiRRV_cauchy_picker
(
F : (
LiRRVq_UniformSpace prts ->
Prop) ->
Prop)
(
PF:
ProperFilter F)
(
cF:
cauchy F)
(
eps :
posreal) :
exists (
N :
nat),
exists (
x :
LiRRVq prts),
(
F (
Hierarchy.ball x eps)) /\
(
forall (
n:
nat), (
n >=
N)%
nat ->
((
Hierarchy.ball (
M :=
LiRRVq_UniformSpace prts)
x eps)
(
LiRRVq_lim_picker F PF cF n))).
Proof.
Lemma LiRRVq_lim_filter_cauchy_lim
(
F : (
LiRRVq_UniformSpace prts ->
Prop) ->
Prop)
(
PF:
ProperFilter F)
(
cF:
cauchy F) :
exists (
g :
LiRRVq prts),
is_lim_seq (
fun n =>
LiRRVq_norm
prts
(
LiRRVq_minus prts (
LiRRVq_lim_picker F PF cF n)
g)) 0.
Proof.
Lemma LiRRVq_cauchy_filter_explicit
(
F : (
LiRRVq_UniformSpace prts ->
Prop) ->
Prop)
(
PF:
ProperFilter F)
(
cF:
cauchy F) :
{
g :
LiRRVq prts |
is_lim_seq (
fun n =>
LiRRVq_norm
prts
(
LiRRVq_minus prts (
LiRRVq_lim_picker F PF cF n)
g)) 0}.
Proof.
Definition LiRRVq_cauchy_filter_fun (
F : (
LiRRVq_UniformSpace prts ->
Prop) ->
Prop)
(
PF:
ProperFilter F)
(
cF:
cauchy F) :
LiRRVq prts
:=
match LiRRVq_cauchy_filter_explicit F PF cF with
|
exist g _ =>
g
end.
Definition LiRRVq_lim_with_conditions (
F : (
LiRRVq_UniformSpace prts ->
Prop) ->
Prop)
(
PF:
ProperFilter F)
(
cF:
cauchy F) :
LiRRVq prts
:=
LiRRVq_cauchy_filter_fun F PF cF.
Definition LiRRVq_lim (
F : ((
LiRRVq prts ->
Prop) ->
Prop)) :
LiRRVq prts.
Proof.
Lemma LiRRVq_ball_LiRRVq_norm (
x :
LiRRVq prts) (
e :
R) (
y :
LiRRVq prts) :
LiRRVq_ball prts x e y <->
LiRRVq_norm prts (
LiRRVq_minus prts x y) <
e.
Proof.
Lemma LiRRVq_norm_pos (
x :
LiRRVq prts) :
LiRRVq_norm prts x >= 0.
Proof.
Lemma LiRRVq_ball_LiRRV_lim_picker
(
F : (
LiRRVq_UniformSpace prts ->
Prop) ->
Prop)
(
PF:
ProperFilter F)
(
cF:
cauchy F)
(
eps :
posreal) :
exists (
N :
nat),
forall (
n :
nat), (
n >=
N)%
nat ->
(
Hierarchy.ball (
M :=
LiRRVq_UniformSpace prts)
(
LiRRVq_lim_picker F PF cF (
S n))
eps (
LiRRVq_lim F)).
Proof.
Lemma LiRRVnorm_LiRRV_lim
(
F : (
LiRRVq_UniformSpace prts ->
Prop) ->
Prop)
(
PF:
ProperFilter F)
(
cF:
cauchy F)
(
eps :
posreal) :
exists (
x :
LiRRVq prts),
(
F (
Hierarchy.ball x eps)) /\
((
Hierarchy.ball (
M :=
LiRRVq_UniformSpace prts)
x eps) (
LiRRVq_lim F)).
Proof.
Lemma LiRRVq_lim_complete (
F : (
LiRRVq_UniformSpace prts ->
Prop) ->
Prop)
(
PF :
ProperFilter F)
(
cF :
cauchy F) :
forall eps :
posreal,
F (
Hierarchy.ball (
LiRRVq_lim F)
eps).
Proof.
Lemma LiRRVq_lim_close (
F1 F2 : (
LiRRVq_UniformSpace prts ->
Prop) ->
Prop) :
filter_le F1 F2 ->
filter_le F2 F1 ->
@
close (
LiRRVq_UniformSpace prts) (
LiRRVq_lim F1) (
LiRRVq_lim F2).
Proof.
Definition LiRRVq_Complete_mixin :
CompleteSpace.mixin_of (
LiRRVq_UniformSpace prts)
:=
CompleteSpace.Mixin (
LiRRVq_UniformSpace prts)
LiRRVq_lim
LiRRVq_lim_complete
LiRRVq_lim_close.
Canonical LiRRVq_Complete :=
CompleteSpace.Pack (
LiRRVq prts)
(
CompleteSpace.Class _ (
LiRRVq_UniformSpace_mixin prts)
LiRRVq_Complete_mixin)
(
LiRRVq prts).
Canonical LiRRVq_CompleteNormedModule :=
CompleteNormedModule.Pack R_AbsRing (
LiRRVq prts)
(
CompleteNormedModule.Class
R_AbsRing (
LiRRVq prts)
(
NormedModule.class R_AbsRing
(
LiRRVq_NormedModule prts))
LiRRVq_Complete_mixin)
(
LiRRVq prts).
End complete.