Require Import Morphisms.
Require Import Equivalence.
Require Import Program.Basics.
Require Import Lra Lia.
Require Import Classical ClassicalChoice RelationClasses.
Require Import FunctionalExtensionality.
Require Import IndefiniteDescription ClassicalDescription.
Require Export ConditionalExpectation.
Require Import RbarExpectation.
Require Import Event.
Require Import Almost DVector.
Require Import utils.Utils.
Require Import List.
Require Import PushNeg.
Require Import Reals.
Require Import Coquelicot.Rbar.
Set Bullet Behavior "
Strict Subproofs".
Section martingale.
Local Open Scope R.
Local Existing Instance Rge_pre.
Context {
Ts:
Type}
{
dom:
SigmaAlgebra Ts}
(
prts:
ProbSpace dom).
Class IsMartingale (
RR:
R->
R->
Prop) {
pre:
PreOrder RR}
(
Y :
nat ->
Ts ->
R) (
sas :
nat ->
SigmaAlgebra Ts)
{
rv:
forall n,
RandomVariable dom borel_sa (
Y n)}
{
isfe:
forall n,
IsFiniteExpectation prts (
Y n)}
{
adapt:
IsAdapted borel_sa Y sas}
{
filt:
IsFiltration sas}
{
sub:
IsSubAlgebras dom sas}
:=
is_martingale :
forall n,
almostR2 prts RR (
Y n) (
FiniteConditionalExpectation prts (
sub n) (
Y (
S n))).
Lemma is_martingale_eq_proper (
RR:
R->
R->
Prop) {
pre:
PreOrder RR}
(
Y1 Y2 :
nat ->
Ts ->
R) (
sas1 sas2 :
nat ->
SigmaAlgebra Ts)
{
rv1:
forall n,
RandomVariable dom borel_sa (
Y1 n)}
{
rv2:
forall n,
RandomVariable dom borel_sa (
Y2 n)}
{
isfe1:
forall n,
IsFiniteExpectation prts (
Y1 n)}
{
isfe2:
forall n,
IsFiniteExpectation prts (
Y2 n)}
{
adapt1:
IsAdapted borel_sa Y1 sas1}
{
adapt2:
IsAdapted borel_sa Y2 sas2}
{
filt1:
IsFiltration sas1}
{
filt2:
IsFiltration sas2}
{
sub1:
IsSubAlgebras dom sas1}
{
sub2:
IsSubAlgebras dom sas2} :
(
forall n,
almostR2 prts eq (
Y1 n) (
Y2 n)) ->
(
forall n,
sa_equiv (
sas1 n) (
sas2 n)) ->
IsMartingale RR Y1 sas1 ->
IsMartingale RR Y2 sas2.
Proof.
Lemma is_martingale_eq_proper_iff (
RR:
R->
R->
Prop) {
pre:
PreOrder RR}
(
Y1 Y2 :
nat ->
Ts ->
R) (
sas1 sas2 :
nat ->
SigmaAlgebra Ts)
{
rv1:
forall n,
RandomVariable dom borel_sa (
Y1 n)}
{
rv2:
forall n,
RandomVariable dom borel_sa (
Y2 n)}
{
isfe1:
forall n,
IsFiniteExpectation prts (
Y1 n)}
{
isfe2:
forall n,
IsFiniteExpectation prts (
Y2 n)}
{
adapt1:
IsAdapted borel_sa Y1 sas1}
{
adapt2:
IsAdapted borel_sa Y2 sas2}
{
filt1:
IsFiltration sas1}
{
filt2:
IsFiltration sas2}
{
sub1:
IsSubAlgebras dom sas1}
{
sub2:
IsSubAlgebras dom sas2} :
(
forall n,
almostR2 prts eq (
Y1 n) (
Y2 n)) ->
(
forall n,
sa_equiv (
sas1 n) (
sas2 n)) ->
IsMartingale RR Y1 sas1 <->
IsMartingale RR Y2 sas2.
Proof.
Lemma is_martingale_eq_proper_transport (
RR:
R->
R->
Prop) {
pre:
PreOrder RR}
(
Y1 Y2 :
nat ->
Ts ->
R) (
sas1 sas2 :
nat ->
SigmaAlgebra Ts)
{
rv1:
forall n,
RandomVariable dom borel_sa (
Y1 n)}
{
rv2:
forall n,
RandomVariable dom borel_sa (
Y2 n)}
{
isfe1:
forall n,
IsFiniteExpectation prts (
Y1 n)}
{
adapt1:
IsAdapted borel_sa Y1 sas1}
{
adapt2:
IsAdapted borel_sa Y2 sas2}
{
filt1:
IsFiltration sas1}
{
sub1:
IsSubAlgebras dom sas1}
(
Y_eqq:(
forall n,
almostR2 prts eq (
Y1 n) (
Y2 n)))
(
sas_eqq:
forall n,
sa_equiv (
sas1 n) (
sas2 n)) :
IsMartingale RR Y1 sas1 ->
IsMartingale RR Y2 sas2
(
isfe:=
fun n =>
IsFiniteExpectation_proper_almostR2 prts _ _ (
Y_eqq n))
(
filt:=
IsFiltration_proper'
_ _ sas_eqq filt1)
(
sub:=
IsSubAlgebras_eq_proper'
_ _ (
reflexivity _)
_ _ sas_eqq sub1).
Proof.
Example IsSubMartingale
(
Y :
nat ->
Ts ->
R) (
sas :
nat ->
SigmaAlgebra Ts)
{
rv:
forall n,
RandomVariable dom borel_sa (
Y n)}
{
isfe:
forall n,
IsFiniteExpectation prts (
Y n)}
{
adapt:
IsAdapted borel_sa Y sas}
{
filt:
IsFiltration sas}
{
sub:
IsSubAlgebras dom sas}
:=
IsMartingale Rle Y sas.
Example IsSuperMartingale
(
Y :
nat ->
Ts ->
R) (
sas :
nat ->
SigmaAlgebra Ts)
{
rv:
forall n,
RandomVariable dom borel_sa (
Y n)}
{
isfe:
forall n,
IsFiniteExpectation prts (
Y n)}
{
adapt:
IsAdapted borel_sa Y sas}
{
filt:
IsFiltration sas}
{
sub:
IsSubAlgebras dom sas}
:=
IsMartingale Rge Y sas.
Lemma is_martingale_sub_super_eq
(
Y :
nat ->
Ts ->
R) (
sas :
nat ->
SigmaAlgebra Ts)
{
rv:
forall n,
RandomVariable dom borel_sa (
Y n)}
{
isfe:
forall n,
IsFiniteExpectation prts (
Y n)}
{
adapt:
IsAdapted borel_sa Y sas}
{
filt:
IsFiltration sas}
{
sub:
IsSubAlgebras dom sas}
:
IsMartingale Rle Y sas ->
IsMartingale Rge Y sas ->
IsMartingale eq Y sas.
Proof.
Instance is_martingale_eq_any (
RR:
R->
R->
Prop) {
pre:
PreOrder RR}
(
Y :
nat ->
Ts ->
R) (
sas :
nat ->
SigmaAlgebra Ts)
{
rv:
forall n,
RandomVariable dom borel_sa (
Y n)}
{
isfe:
forall n,
IsFiniteExpectation prts (
Y n)}
{
adapt:
IsAdapted borel_sa Y sas}
{
filt:
IsFiltration sas}
{
sub:
IsSubAlgebras dom sas}
:
IsMartingale eq Y sas ->
IsMartingale RR Y sas.
Proof.
intros ??.
generalize (
H n).
apply almost_impl;
apply all_almost;
intros ??.
rewrite H0.
reflexivity.
Qed.
Corollary is_martingale_eq_sub
(
Y :
nat ->
Ts ->
R) (
sas :
nat ->
SigmaAlgebra Ts)
{
rv:
forall n,
RandomVariable dom borel_sa (
Y n)}
{
isfe:
forall n,
IsFiniteExpectation prts (
Y n)}
{
adapt:
IsAdapted borel_sa Y sas}
{
filt:
IsFiltration sas}
{
sub:
IsSubAlgebras dom sas}
:
IsMartingale eq Y sas ->
IsMartingale Rle Y sas.
Proof.
Corollary is_martingale_eq_super
(
Y :
nat ->
Ts ->
R) (
sas :
nat ->
SigmaAlgebra Ts)
{
rv:
forall n,
RandomVariable dom borel_sa (
Y n)}
{
isfe:
forall n,
IsFiniteExpectation prts (
Y n)}
{
adapt:
IsAdapted borel_sa Y sas}
{
filt:
IsFiltration sas}
{
sub:
IsSubAlgebras dom sas}
:
IsMartingale eq Y sas ->
IsMartingale Rge Y sas.
Proof.
Lemma is_sub_martingale_neg
(
Y :
nat ->
Ts ->
R) (
sas :
nat ->
SigmaAlgebra Ts)
{
rv:
forall n,
RandomVariable dom borel_sa (
Y n)}
{
isfe:
forall n,
IsFiniteExpectation prts (
Y n)}
{
adapt:
IsAdapted borel_sa Y sas}
{
filt:
IsFiltration sas}
{
sub:
IsSubAlgebras dom sas} :
IsMartingale Rle (
fun n =>
rvopp (
Y n))
sas <->
IsMartingale Rge Y sas.
Proof.
Lemma is_super_martingale_neg
(
Y :
nat ->
Ts ->
R) (
sas :
nat ->
SigmaAlgebra Ts)
{
rv:
forall n,
RandomVariable dom borel_sa (
Y n)}
{
isfe:
forall n,
IsFiniteExpectation prts (
Y n)}
{
adapt:
IsAdapted borel_sa Y sas}
{
filt:
IsFiltration sas}
{
sub:
IsSubAlgebras dom sas} :
IsMartingale Rge (
fun n =>
rvopp (
Y n))
sas <->
IsMartingale Rle Y sas.
Proof.
Lemma is_sub_martingale_proper
(
Y1 Y2 :
nat ->
Ts ->
R) (
sas1 sas2 :
nat ->
SigmaAlgebra Ts)
{
rv1:
forall n,
RandomVariable dom borel_sa (
Y1 n)}
{
rv2:
forall n,
RandomVariable dom borel_sa (
Y2 n)}
{
isfe1:
forall n,
IsFiniteExpectation prts (
Y1 n)}
{
isfe2:
forall n,
IsFiniteExpectation prts (
Y2 n)}
{
adapt1:
IsAdapted borel_sa Y1 sas1}
{
adapt2:
IsAdapted borel_sa Y2 sas2}
{
filt1:
IsFiltration sas1}
{
filt2:
IsFiltration sas2}
{
sub1:
IsSubAlgebras dom sas1}
{
sub2:
IsSubAlgebras dom sas2} :
(
forall n,
almostR2 prts eq (
Y1 n) (
Y2 n)) ->
(
forall n,
sa_sub (
sas2 n) (
sas1 n)) ->
IsMartingale Rle Y1 sas1 ->
IsMartingale Rle Y2 sas2.
Proof.
Lemma is_super_martingale_proper
(
Y1 Y2 :
nat ->
Ts ->
R) (
sas1 sas2 :
nat ->
SigmaAlgebra Ts)
{
rv1:
forall n,
RandomVariable dom borel_sa (
Y1 n)}
{
rv2:
forall n,
RandomVariable dom borel_sa (
Y2 n)}
{
isfe1:
forall n,
IsFiniteExpectation prts (
Y1 n)}
{
isfe2:
forall n,
IsFiniteExpectation prts (
Y2 n)}
{
adapt1:
IsAdapted borel_sa Y1 sas1}
{
adapt2:
IsAdapted borel_sa Y2 sas2}
{
filt1:
IsFiltration sas1}
{
filt2:
IsFiltration sas2}
{
sub1:
IsSubAlgebras dom sas1}
{
sub2:
IsSubAlgebras dom sas2} :
(
forall n,
almostR2 prts eq (
Y1 n) (
Y2 n)) ->
(
forall n,
sa_sub (
sas2 n) (
sas1 n)) ->
IsMartingale Rge Y1 sas1 ->
IsMartingale Rge Y2 sas2.
Proof.
Lemma is_martingale_proper
(
Y1 Y2 :
nat ->
Ts ->
R) (
sas1 sas2 :
nat ->
SigmaAlgebra Ts)
{
rv1:
forall n,
RandomVariable dom borel_sa (
Y1 n)}
{
rv2:
forall n,
RandomVariable dom borel_sa (
Y2 n)}
{
isfe1:
forall n,
IsFiniteExpectation prts (
Y1 n)}
{
isfe2:
forall n,
IsFiniteExpectation prts (
Y2 n)}
{
adapt1:
IsAdapted borel_sa Y1 sas1}
{
adapt2:
IsAdapted borel_sa Y2 sas2}
{
filt1:
IsFiltration sas1}
{
filt2:
IsFiltration sas2}
{
sub1:
IsSubAlgebras dom sas1}
{
sub2:
IsSubAlgebras dom sas2} :
(
forall n,
almostR2 prts eq (
Y1 n) (
Y2 n)) ->
(
forall n,
sa_sub (
sas2 n) (
sas1 n)) ->
IsMartingale eq Y1 sas1 ->
IsMartingale eq Y2 sas2.
Proof.
Corollary is_sub_martingale_natural
(
Y :
nat ->
Ts ->
R) (
sas :
nat ->
SigmaAlgebra Ts)
{
rv:
forall n,
RandomVariable dom borel_sa (
Y n)}
{
isfe:
forall n,
IsFiniteExpectation prts (
Y n)}
{
adapt:
IsAdapted borel_sa Y sas}
{
filt:
IsFiltration sas}
{
sub:
IsSubAlgebras dom sas} :
IsMartingale Rle Y sas ->
IsMartingale Rle Y (
filtration_history_sa Y).
Proof.
Corollary is_super_martingale_natural
(
Y :
nat ->
Ts ->
R) (
sas :
nat ->
SigmaAlgebra Ts)
{
rv:
forall n,
RandomVariable dom borel_sa (
Y n)}
{
isfe:
forall n,
IsFiniteExpectation prts (
Y n)}
{
adapt:
IsAdapted borel_sa Y sas}
{
filt:
IsFiltration sas}
{
sub:
IsSubAlgebras dom sas} :
IsMartingale Rge Y sas ->
IsMartingale Rge Y (
filtration_history_sa Y).
Proof.
Corollary is_martingale_natural
(
Y :
nat ->
Ts ->
R) (
sas :
nat ->
SigmaAlgebra Ts)
{
rv:
forall n,
RandomVariable dom borel_sa (
Y n)}
{
isfe:
forall n,
IsFiniteExpectation prts (
Y n)}
{
adapt:
IsAdapted borel_sa Y sas}
{
filt:
IsFiltration sas}
{
sub:
IsSubAlgebras dom sas} :
IsMartingale eq Y sas ->
IsMartingale eq Y (
filtration_history_sa Y).
Proof.
Lemma is_sub_martingale_lt
(
Y :
nat ->
Ts ->
R) (
sas :
nat ->
SigmaAlgebra Ts)
{
rv:
forall n,
RandomVariable dom borel_sa (
Y n)}
{
isfe:
forall n,
IsFiniteExpectation prts (
Y n)}
{
adapt:
IsAdapted borel_sa Y sas}
{
filt:
IsFiltration sas}
{
sub:
IsSubAlgebras dom sas}
{
mart:
IsMartingale Rle Y sas} :
forall s t, (
s <
t)%
nat ->
almostR2 prts Rle (
Y s) (
FiniteConditionalExpectation prts (
sub s) (
Y t)).
Proof.
Lemma is_super_martingale_lt
(
Y :
nat ->
Ts ->
R) (
sas :
nat ->
SigmaAlgebra Ts)
{
rv:
forall n,
RandomVariable dom borel_sa (
Y n)}
{
isfe:
forall n,
IsFiniteExpectation prts (
Y n)}
{
adapt:
IsAdapted borel_sa Y sas}
{
filt:
IsFiltration sas}
{
sub:
IsSubAlgebras dom sas}
{
mart:
IsMartingale Rge Y sas} :
forall s t, (
s <
t)%
nat ->
almostR2 prts Rge (
Y s) (
FiniteConditionalExpectation prts (
sub s) (
Y t)).
Proof.
Lemma is_martingale_lt
(
Y :
nat ->
Ts ->
R) (
sas :
nat ->
SigmaAlgebra Ts)
{
rv:
forall n,
RandomVariable dom borel_sa (
Y n)}
{
isfe:
forall n,
IsFiniteExpectation prts (
Y n)}
{
adapt:
IsAdapted borel_sa Y sas}
{
filt:
IsFiltration sas}
{
sub:
IsSubAlgebras dom sas}
{
mart:
IsMartingale eq Y sas} :
forall s t, (
s <
t)%
nat ->
almostR2 prts eq (
Y s) (
FiniteConditionalExpectation prts (
sub s) (
Y t)).
Proof.
Lemma is_sub_martingale_expectation
(
Y :
nat ->
Ts ->
R) (
sas :
nat ->
SigmaAlgebra Ts)
{
rv:
forall n,
RandomVariable dom borel_sa (
Y n)}
{
isfe:
forall n,
IsFiniteExpectation prts (
Y n)}
{
adapt:
IsAdapted borel_sa Y sas}
{
filt:
IsFiltration sas}
{
sub:
IsSubAlgebras dom sas}
{
mart:
IsMartingale Rle Y sas}
:
forall s t, (
s <=
t)%
nat ->
FiniteExpectation prts (
Y s) <=
FiniteExpectation prts (
Y t).
Proof.
Lemma is_super_martingale_expectation
(
Y :
nat ->
Ts ->
R) (
sas :
nat ->
SigmaAlgebra Ts)
{
rv:
forall n,
RandomVariable dom borel_sa (
Y n)}
{
isfe:
forall n,
IsFiniteExpectation prts (
Y n)}
{
adapt:
IsAdapted borel_sa Y sas}
{
filt:
IsFiltration sas}
{
sub:
IsSubAlgebras dom sas}
{
mart:
IsMartingale Rge Y sas}
:
forall s t, (
s <=
t)%
nat ->
FiniteExpectation prts (
Y s) >=
FiniteExpectation prts (
Y t).
Proof.
Lemma is_martingale_expectation
(
Y :
nat ->
Ts ->
R) (
sas :
nat ->
SigmaAlgebra Ts)
{
rv:
forall n,
RandomVariable dom borel_sa (
Y n)}
{
isfe:
forall n,
IsFiniteExpectation prts (
Y n)}
{
adapt:
IsAdapted borel_sa Y sas}
{
filt:
IsFiltration sas}
{
sub:
IsSubAlgebras dom sas}
{
mart:
IsMartingale eq Y sas}
:
forall s t,
FiniteExpectation prts (
Y s) =
FiniteExpectation prts (
Y t).
Proof.
Definition is_predictable {
Td} {
saD:
SigmaAlgebra Td} (
Y :
nat ->
Ts ->
Td) (
sas :
nat ->
SigmaAlgebra Ts)
:=
IsAdapted saD (
fun x =>
Y (
S x))
sas.
Lemma is_adapted_filtration_pred {
Td} {
saD:
SigmaAlgebra Td}
(
Y :
nat ->
Ts ->
Td) (
sas :
nat ->
SigmaAlgebra Ts)
{
filt:
IsFiltration sas}
{
adapt:
IsAdapted saD Y (
fun n =>
sas (
pred n))} :
IsAdapted saD Y sas.
Proof.
intros n.
generalize (
adapt n).
eapply RandomVariable_proper_le;
try reflexivity.
destruct n;
simpl.
-
reflexivity.
-
apply filt.
Qed.
Lemma is_adapted_filtration_pred_predictable
{
Td} {
saD:
SigmaAlgebra Td}
(
Y :
nat ->
Ts ->
Td) (
sas :
nat ->
SigmaAlgebra Ts)
{
filt:
IsFiltration sas}
{
adapt:
IsAdapted saD Y (
fun n =>
sas (
pred n))} :
is_predictable Y sas.
Proof.
intros n.
apply (
adapt (
S n)).
Qed.
Lemma is_adapted_filtration_shift
{
Td} {
saD:
SigmaAlgebra Td}
k (
Y :
nat ->
Ts ->
Td) (
sas :
nat ->
SigmaAlgebra Ts)
{
filt:
IsFiltration sas}
{
adapt:
IsAdapted saD Y (
fun n =>
sas (
n -
k)%
nat)} :
IsAdapted saD Y sas.
Proof.
Theorem doob_meyer_decomposition
(
Y :
nat ->
Ts ->
R) (
sas :
nat ->
SigmaAlgebra Ts)
{
rv:
forall n,
RandomVariable dom borel_sa (
Y n)}
{
isfe:
forall n,
IsFiniteExpectation prts (
Y n)}
{
adapt:
IsAdapted borel_sa Y sas}
{
filt:
IsFiltration sas}
{
sub:
IsSubAlgebras dom sas}
{
mart:
IsMartingale Rle Y sas} :
{
M :
nat ->
Ts ->
R |
let A :=
fun n =>
rvminus (
Y n) (
M n)
in
exists (
rvM:
forall n,
RandomVariable dom borel_sa (
M n))
(
isfeM:
forall n,
IsFiniteExpectation prts (
M n))
(
adaptM:
IsAdapted borel_sa M sas),
IsMartingale eq M sas
/\
IsAdapted borel_sa A (
fun n =>
sas (
pred n))
/\ (
forall n,
RandomVariable dom borel_sa (
A n))
/\ (
forall n,
IsFiniteExpectation prts (
A n))
/\ (
forall n,
almostR2 prts Rle (
A n) (
A (
S n)))}.
Proof.
Instance is_adapted_convex (
Y :
nat ->
Ts ->
R) (
sas :
nat ->
SigmaAlgebra Ts) (
phi:
R->
R)
{
adapt:
IsAdapted borel_sa Y sas}:
(
forall c x y,
convex phi c x y) ->
IsAdapted borel_sa (
fun (
n :
nat) (
omega :
Ts) =>
phi (
Y n omega))
sas.
Proof.
Lemma is_martingale_convex
(
Y :
nat ->
Ts ->
R) (
sas :
nat ->
SigmaAlgebra Ts) (
phi:
R->
R)
{
rv:
forall n,
RandomVariable dom borel_sa (
Y n)}
{
isfe:
forall n,
IsFiniteExpectation prts (
Y n)}
{
adapt:
IsAdapted borel_sa Y sas}
{
filt:
IsFiltration sas}
{
sub:
IsSubAlgebras dom sas}
{
mart:
IsMartingale eq Y sas}
{
rvphi :
forall n,
RandomVariable dom borel_sa (
fun x =>
phi (
Y n x))}
{
isfephi :
forall n,
IsFiniteExpectation prts (
fun x =>
phi (
Y n x))}
{
adaptphi:
IsAdapted borel_sa (
fun (
n :
nat) (
omega :
Ts) =>
phi (
Y n omega))
sas}
:
(
forall c x y,
convex phi c x y) ->
IsMartingale Rle (
fun n omega => (
phi (
Y n omega)))
sas.
Proof.
Lemma is_sub_martingale_incr_convex
(
Y :
nat ->
Ts ->
R) (
sas :
nat ->
SigmaAlgebra Ts) (
phi:
R->
R)
{
rv:
forall n,
RandomVariable dom borel_sa (
Y n)}
{
isfe:
forall n,
IsFiniteExpectation prts (
Y n)}
{
adapt:
IsAdapted borel_sa Y sas}
{
filt:
IsFiltration sas}
{
sub:
IsSubAlgebras dom sas}
{
mart:
IsMartingale Rle Y sas}
{
rvphi :
forall n,
RandomVariable dom borel_sa (
fun x =>
phi (
Y n x))}
{
isfephi :
forall n,
IsFiniteExpectation prts (
fun x =>
phi (
Y n x))}
{
adaptphi:
IsAdapted borel_sa (
fun (
n :
nat) (
omega :
Ts) =>
phi (
Y n omega))
sas}
:
(
forall c x y,
convex phi c x y) ->
(
forall x y,
x <=
y ->
phi x <=
phi y) ->
IsMartingale Rle (
fun n omega => (
phi (
Y n omega)))
sas.
Proof.
Section stopping_times.
Definition stopping_time_pre_event (
rt:
Ts->
option nat) (
n:
nat) :
pre_event Ts
:=
fun x =>
rt x =
Some n.
Definition stopping_time_pre_event_alt (
rt:
Ts->
option nat) (
n:
nat) :
pre_event Ts
:= (
fun x =>
match rt x with
|
None =>
False
|
Some a => (
a <=
n)%
nat
end).
Lemma stopping_time_pre_event_dec (
rt:
Ts->
option nat) (
n:
nat) :
dec_pre_event (
stopping_time_pre_event rt n).
Proof.
Definition stopping_time_pre_event_alt_dec (
rt:
Ts->
option nat) (
n:
nat) :
dec_pre_event (
stopping_time_pre_event_alt rt n)
:= (
fun x =>
match rt x as aa
return {
match aa with
|
None =>
False
|
Some a => (
a <=
n)%
nat
end} + {~
match aa with
|
None =>
False
|
Some a => (
a <=
n)%
nat
end}
with
|
None =>
right (
fun x =>
x)
|
Some a =>
le_dec a n
end).
Class IsStoppingTime (
rt:
Ts->
option nat) (
sas:
nat ->
SigmaAlgebra Ts)
:=
is_stopping_time :
forall n,
sa_sigma (
SigmaAlgebra :=
sas n) (
stopping_time_pre_event rt n).
Definition is_stopping_time_alt (
rt:
Ts->
option nat) (
sas:
nat ->
SigmaAlgebra Ts)
:=
forall n,
sa_sigma (
SigmaAlgebra :=
sas n) (
stopping_time_pre_event_alt rt n).
Lemma is_stopping_time_as_alt (
rt:
Ts->
option nat) (
sas:
nat ->
SigmaAlgebra Ts) {
filt:
IsFiltration sas}:
IsStoppingTime rt sas <->
is_stopping_time_alt rt sas.
Proof.
Example is_stopping_time_constant (
c:
option nat) (
sas:
nat ->
SigmaAlgebra Ts)
:
IsStoppingTime (
const c)
sas.
Proof.
Instance is_stopping_time_adapted (
rt:
Ts->
option nat) (
sas:
nat ->
SigmaAlgebra Ts) :
IsStoppingTime rt sas ->
IsAdapted borel_sa (
fun n =>
EventIndicator (
stopping_time_pre_event_dec rt n))
sas.
Proof.
Lemma is_stopping_time_alt_adapted (
rt:
Ts->
option nat) (
sas:
nat ->
SigmaAlgebra Ts) :
is_stopping_time_alt rt sas ->
IsAdapted borel_sa (
fun n =>
EventIndicator (
stopping_time_pre_event_alt_dec rt n))
sas.
Proof.
Lemma is_adapted_stopping_time (
rt:
Ts->
option nat) (
sas:
nat ->
SigmaAlgebra Ts) :
IsAdapted borel_sa (
fun n =>
EventIndicator (
stopping_time_pre_event_dec rt n))
sas ->
IsStoppingTime rt sas.
Proof.
Definition lift2_min (
x y :
option nat)
:=
match x,
y with
|
None,
None =>
None
|
Some a,
None =>
Some a
|
None,
Some b =>
Some b
|
Some a,
Some b =>
Some (
min a b)
end.
Lemma is_stopping_time_min
(
rt1 rt2:
Ts->
option nat)
(
sas:
nat ->
SigmaAlgebra Ts)
{
filt:
IsFiltration sas}:
IsStoppingTime rt1 sas ->
IsStoppingTime rt2 sas ->
IsStoppingTime (
fun x =>
lift2_min (
rt1 x) (
rt2 x))
sas.
Proof.
Lemma is_stopping_time_max
(
rt1 rt2:
Ts->
option nat)
(
sas:
nat ->
SigmaAlgebra Ts) {
filt:
IsFiltration sas}:
IsStoppingTime rt1 sas ->
IsStoppingTime rt2 sas ->
IsStoppingTime (
fun x =>
lift2 max (
rt1 x) (
rt2 x))
sas.
Proof.
Lemma is_stopping_time_plus
(
rt1 rt2:
Ts->
option nat)
(
sas:
nat ->
SigmaAlgebra Ts)
{
filt:
IsFiltration sas}:
IsStoppingTime rt1 sas ->
IsStoppingTime rt2 sas ->
IsStoppingTime (
fun x =>
lift2 plus (
rt1 x) (
rt2 x))
sas.
Proof.
Definition past_before_sa_sigma (
rt:
Ts->
option nat) (
sas:
nat ->
SigmaAlgebra Ts)
(
a:
pre_event Ts) :
Prop
:=
forall n,
sa_sigma (
SigmaAlgebra:=
sas n) (
pre_event_inter a (
stopping_time_pre_event rt n)).
Program Global Instance past_before_sa (
rt:
Ts->
option nat) (
sas:
nat ->
SigmaAlgebra Ts)
(
stop:
IsStoppingTime rt sas)
:
SigmaAlgebra Ts
:= {|
sa_sigma :=
past_before_sa_sigma rt sas
|} .
Next Obligation.
Next Obligation.
Next Obligation.
Lemma past_before_stopping_sa_sigma
(
rt:
Ts->
option nat)
(
sas:
nat ->
SigmaAlgebra Ts)
(
stop:
IsStoppingTime rt sas) :
forall n,
sa_sigma (
SigmaAlgebra:=
past_before_sa rt sas stop) (
stopping_time_pre_event rt n).
Proof.
Lemma past_before_sa_le (
rt1 rt2:
Ts->
option nat)
(
sas:
nat ->
SigmaAlgebra Ts)
{
filt:
IsFiltration sas}
(
stop1:
IsStoppingTime rt1 sas)
(
stop2:
IsStoppingTime rt2 sas) :
(
forall x,
match rt1 x,
rt2 x with
|
Some a,
Some b => (
a <=
b)%
nat
|
Some _,
None =>
True
|
None,
Some _ =>
False
|
None,
None =>
True
end) ->
sa_sub (
past_before_sa rt1 sas stop1) (
past_before_sa rt2 sas stop2).
Proof.
Lemma past_before_sa_eq_in (
rt1 rt2:
Ts->
option nat)
(
sas:
nat ->
SigmaAlgebra Ts)
{
filt:
IsFiltration sas}
(
stop1:
IsStoppingTime rt1 sas)
(
stop2:
IsStoppingTime rt2 sas) :
sa_sigma (
SigmaAlgebra:=
past_before_sa rt1 sas stop1) (
fun x =>
rt1 x =
rt2 x).
Proof.
Lemma past_before_sa_eq_in' (
rt1 rt2:
Ts->
option nat)
(
sas:
nat ->
SigmaAlgebra Ts)
{
filt:
IsFiltration sas}
(
stop1:
IsStoppingTime rt1 sas)
(
stop2:
IsStoppingTime rt2 sas) :
sa_sigma (
SigmaAlgebra:=
past_before_sa rt2 sas stop2) (
fun x =>
rt1 x =
rt2 x).
Proof.
Definition opt_nat_as_Rbar (
n:
option nat) :
Rbar.Rbar
:=
match n with
|
Some a =>
Rbar.Finite (
INR a)
|
None =>
Rbar.p_infty
end.
Lemma Rabs_INR_lt_1_eq a b :
Rabs (
INR a -
INR b) < 1 ->
a =
b.
Proof.
unfold Rabs.
match_destr;
intros.
-
assert (
INR a <
INR b)
by lra.
apply INR_lt in H0.
assert (
INR b <
INR a + 1)
by lra.
rewrite <-
S_INR in H1.
apply INR_lt in H1.
lia.
-
assert (
INR b <=
INR a)
by lra.
apply INR_le in H0.
assert (
INR a <
INR b + 1)
by lra.
rewrite <-
S_INR in H1.
apply INR_lt in H1.
lia.
Qed.
Lemma is_stopping_time_lim (
rtn:
nat->
Ts->
option nat)
(
sas:
nat ->
SigmaAlgebra Ts)
{
filt:
IsFiltration sas}
(
stop:
forall n,
IsStoppingTime (
rtn n)
sas)
(
rt:
Ts->
option nat) :
(
forall omega,
is_Elim_seq (
fun n => (
opt_nat_as_Rbar (
rtn n omega))) (
opt_nat_as_Rbar (
rt omega))) ->
IsStoppingTime rt sas.
Proof.
End stopping_times.
Definition martingale_transform (
H X :
nat ->
Ts ->
R) (
n:
nat) :
Ts ->
R
:=
match n with
| 0%
nat =>
const 0
|
S m =>
rvsum (
fun k =>
rvmult (
H (
S k)) (
rvminus (
X (
S k)) (
X k)))
m
end.
Global Instance martingale_transform_rv (
H X :
nat ->
Ts ->
R)
{
rvH:
forall n,
RandomVariable dom borel_sa (
H n)}
{
rvX:
forall n,
RandomVariable dom borel_sa (
X n)} :
forall n :
nat,
RandomVariable dom borel_sa (
martingale_transform H X n).
Proof.
intros [| n]; simpl;
typeclasses eauto.
Qed.
Global Instance martingale_transform_isfe (
H X :
nat ->
Ts ->
R)
{
isfe0:
IsFiniteExpectation prts (
X 0%
nat)}
{
isfe:
forall n,
IsFiniteExpectation prts (
rvmult (
H (
S n)) (
rvminus (
X (
S n)) (
X n)))}
{
rvH:
forall n,
RandomVariable dom borel_sa (
H n)}
{
rvX:
forall n,
RandomVariable dom borel_sa (
X n)} :
forall n :
nat,
IsFiniteExpectation prts (
martingale_transform H X n).
Proof.
Global Instance martingale_transform_adapted (
H X :
nat ->
Ts ->
R)
sas
{
adapt:
IsAdapted borel_sa X sas}
{
filt:
IsFiltration sas} :
is_predictable H sas ->
IsAdapted borel_sa (
martingale_transform H X)
sas.
Proof.
Lemma martingale_transform_predictable_martingale
(
H X :
nat ->
Ts ->
R) (
sas:
nat->
SigmaAlgebra Ts)
{
adaptX:
IsAdapted borel_sa X sas}
{
filt:
IsFiltration sas}
{
sub :
IsSubAlgebras dom sas}
{
rvH:
forall n,
RandomVariable dom borel_sa (
H n)}
{
rvX:
forall n,
RandomVariable dom borel_sa (
X n)}
{
rv:
forall n :
nat,
RandomVariable dom borel_sa (
martingale_transform H X n)}
{
isfeX:
forall n,
IsFiniteExpectation prts (
X n)}
{
isfeS:
forall n,
IsFiniteExpectation prts (
rvmult (
H (
S n)) (
rvminus (
X (
S n)) (
X n)))}
{
isfe :
forall n :
nat,
IsFiniteExpectation prts (
martingale_transform H X n)}
{
adapt:
IsAdapted borel_sa (
martingale_transform H X)
sas}
(
predict:
is_predictable H sas)
{
mart:
IsMartingale eq X sas} :
IsMartingale eq (
martingale_transform H X)
sas.
Proof.
Lemma martingale_transform_predictable_sub_martingale
(
H X :
nat ->
Ts ->
R) (
sas:
nat->
SigmaAlgebra Ts)
{
adaptX:
IsAdapted borel_sa X sas}
{
filt:
IsFiltration sas}
{
sub :
IsSubAlgebras dom sas}
{
rvH:
forall n,
RandomVariable dom borel_sa (
H n)}
{
rvX:
forall n,
RandomVariable dom borel_sa (
X n)}
{
rv:
forall n :
nat,
RandomVariable dom borel_sa (
martingale_transform H X n)}
{
isfeX:
forall n,
IsFiniteExpectation prts (
X n)}
{
isfeS:
forall n,
IsFiniteExpectation prts (
rvmult (
H (
S n)) (
rvminus (
X (
S n)) (
X n)))}
{
isfe :
forall n :
nat,
IsFiniteExpectation prts (
martingale_transform H X n)}
{
adapt:
IsAdapted borel_sa (
martingale_transform H X)
sas}
(
predict:
is_predictable H sas)
(
Hpos:
forall n,
almostR2 prts Rle (
const 0) (
H n))
{
mart:
IsMartingale Rle X sas} :
IsMartingale Rle (
martingale_transform H X)
sas.
Proof.
Lemma martingale_transform_plus (
H1 H2 X :
nat ->
Ts ->
R) (
k:
nat) :
rv_eq (
rvplus (
martingale_transform H1 X k) (
martingale_transform H2 X k))
(
martingale_transform (
fun k' => (
rvplus (
H1 k') (
H2 k')))
X k).
Proof.
Global Instance martingale_transform_proper :
Proper (
pointwise_relation _ rv_eq ==>
pointwise_relation _ rv_eq ==>
pointwise_relation _ rv_eq)
martingale_transform.
Proof.
Lemma martingale_transform_1 Y n :
rv_eq (
martingale_transform (
fun _ :
nat =>
const 1)
Y n) (
rvminus (
Y n) (
Y 0%
nat)).
Proof.
Definition hitting_time
(
X :
nat ->
Ts ->
R)
(
B:
event borel_sa)
(
a:
Ts) :
option nat
:=
classic_min_of (
fun k =>
B (
X k a)).
Global Instance hitting_time_proper :
Proper (
pointwise_relation _ (
pointwise_relation _ eq) ==>
event_equiv ==>
pointwise_relation _ eq)
hitting_time.
Proof.
Lemma hitting_time_is_stop
(
X :
nat ->
Ts ->
R) (
sas:
nat->
SigmaAlgebra Ts)
{
filt:
IsFiltration sas}
{
adaptX:
IsAdapted borel_sa X sas}
(
B:
event borel_sa) :
IsStoppingTime (
hitting_time X B)
sas.
Proof.
Fixpoint hitting_time_n
(
X :
nat ->
Ts ->
R)
(
B:
event borel_sa)
(
n:
nat)
(
a:
Ts) :
option nat
:=
match n with
| 0%
nat =>
hitting_time X B a
|
S m =>
match hitting_time_n X B m a with
|
None =>
None
|
Some hitk =>
match classic_min_of (
fun k =>
B (
X (
k +
S hitk)%
nat a))
with
|
None =>
None
|
Some a =>
Some (
a +
S hitk)%
nat
end
end
end.
Lemma hitting_time_n_is_stop
(
X :
nat ->
Ts ->
R) (
sas:
nat->
SigmaAlgebra Ts)
{
filt:
IsFiltration sas}
{
adaptX:
IsAdapted borel_sa X sas}
(
B:
event borel_sa)
n :
IsStoppingTime (
hitting_time_n X B n)
sas.
Proof.
Lemma is_stopping_time_compose_incr (
sas :
nat ->
SigmaAlgebra Ts) (
t1:
Ts ->
option nat) (
t2 :
nat ->
Ts ->
option nat)
{
filt:
IsFiltration sas} :
IsStoppingTime t1 sas ->
(
forall old,
IsStoppingTime (
t2 old)
sas) ->
(
forall old n ts,
t2 old ts =
Some n ->
old <=
n)%
nat ->
IsStoppingTime (
fun ts =>
match (
t1 ts)
with
|
Some old =>
t2 old ts
|
None =>
None
end
)
sas.
Proof.
Definition hitting_time_from
(
X :
nat ->
Ts ->
R)
(
old:
nat)
(
B:
event borel_sa)
(
a:
Ts) :
option nat
:=
match hitting_time (
fun k =>
X (
k +
old)%
nat)
B a with
|
None =>
None
|
Some k =>
Some (
k +
old)%
nat
end.
Global Instance hitting_time_from_proper :
Proper (
pointwise_relation _ (
pointwise_relation _ eq) ==>
eq ==>
event_equiv ==>
pointwise_relation _ eq)
hitting_time_from.
Proof.
Lemma hitting_time_from0
(
X :
nat ->
Ts ->
R)
(
B:
event borel_sa)
(
a:
Ts) :
hitting_time_from X 0%
nat B a =
hitting_time X B a.
Proof.
Lemma hitting_time_from_is_stop
(
X :
nat ->
Ts ->
R) (
old:
nat) (
sas:
nat->
SigmaAlgebra Ts)
{
filt:
IsFiltration sas}
{
adaptX:
IsAdapted borel_sa X sas}
(
B:
event borel_sa) :
IsStoppingTime (
hitting_time_from X old B)
sas.
Proof.
Lemma hitting_time_from_ge
(
X :
nat ->
Ts ->
R) (
old:
nat) (
sas:
nat->
SigmaAlgebra Ts)
{
filt:
IsFiltration sas}
{
adaptX:
IsAdapted borel_sa X sas}
(
B:
event borel_sa)
ts (
n:
nat) :
hitting_time_from X old B ts =
Some n ->
(
old <=
n)%
nat.
Proof.
End martingale.
Section levy.
Context {
Ts:
Type}
{
dom:
SigmaAlgebra Ts}
(
prts:
ProbSpace dom).
Context (
X:
Ts ->
R)
{
rv:
RandomVariable dom borel_sa X}
{
isfe:
IsFiniteExpectation prts X}
(
sas :
nat ->
SigmaAlgebra Ts)
{
sub:
IsSubAlgebras dom sas}.
Definition levy_martingale
:
nat ->
Ts ->
R
:=
fun n =>
FiniteConditionalExpectation prts (
sub n)
X.
Global Instance levy_martingale_rv :
forall n :
nat,
RandomVariable dom borel_sa (
levy_martingale n).
Proof.
Global Instance levy_martingale_is_adapted :
IsAdapted borel_sa levy_martingale sas.
Proof.
Global Instance levy_martingale_is_martingale {
filt:
IsFiltration sas} :
IsMartingale prts eq levy_martingale sas.
Proof.
End levy.
Section MartingaleDifferenceSeq.
Class IsMDS {
Ts:
Type}
{
dom:
SigmaAlgebra Ts}
{
prts:
ProbSpace dom} (
sas :
nat ->
SigmaAlgebra Ts) (
X :
nat ->
Ts ->
R)
{
adapt :
IsAdapted borel_sa X sas}
{
isfe :
forall n,
IsFiniteExpectation prts (
X n)}
{
rv :
forall n,
RandomVariable dom borel_sa (
X n)}
{
filt:
IsFiltration sas}
{
sub:
IsSubAlgebras dom sas}
:={
is_mds :
forall n :
nat,
almostR2 prts eq (
const 0%
R)
(
FiniteConditionalExpectation prts (
sub n) (
X (
S n)))
}.
Context {
Ts:
Type}
{
dom:
SigmaAlgebra Ts}
(
prts:
ProbSpace dom) (
X :
nat ->
Ts ->
R)
(
sas :
nat ->
SigmaAlgebra Ts)
{
adapt :
IsAdapted borel_sa X sas}
{
rv:
forall n,
RandomVariable dom borel_sa (
X n)}
{
isfe:
forall n,
IsFiniteExpectation prts (
X n)}
{
sub:
IsSubAlgebras dom sas}
{
filt :
IsFiltration sas}.
Lemma Martingale_diff_IsMDS (
Y :
nat ->
Ts ->
R) (
rvy :
forall n :
nat,
RandomVariable dom borel_sa (
Y n))
(
isfey :
forall n :
nat,
IsFiniteExpectation prts (
Y n))
(
adapty :
IsAdapted borel_sa Y sas)
(
hy :
IsMartingale prts eq Y sas) :
(
forall n :
nat,
almostR2 prts eq (
X (
S n)) (
rvminus (
Y (
S n)) (
Y n))) ->
IsMDS sas X.
Proof.
End MartingaleDifferenceSeq.