Module mathcomp.experimental_reals.distr
From mathcomp Require Import boot order algebra.
From mathcomp Require Import boolp classical_sets.
From mathcomp Require Import constructive_ereal reals.
From mathcomp Require Import xfinmap discrete realseq realsum.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Unset SsrOldRewriteGoalsOrder.
Import Order.TTheory GRing.Theory Num.Theory.
Local Open Scope ring_scope.
Local Notation
Source code
Reserved Notation "\dlet_ ( i <- d ) E"
(at level 36, E at level 36, i, d at level 50,
format "'[' \dlet_ ( i <- d ) '/ ' E ']'").
Reserved Notation "\dlim_ ( n ) E"
(at level 36, E at level 36, n at level 50,
format "'[' \dlim_ ( n ) '/ ' E ']'").
Reserved Notation "\P_[ mu ] E" (at level 2, format "\P_[ mu ] E").
Reserved Notation "\P_[ mu , A ] E" (at level 2, format "\P_[ mu , A ] E").
Reserved Notation "\E?_[ mu ] f" (at level 2, format "\E?_[ mu ] f").
Reserved Notation "\E_[ mu ] f" (at level 2, format "\E_[ mu ] f").
Reserved Notation "\E_[ mu , A ] f" (at level 2, format "\E_[ mu , A ] f").
Local Notation
Source code
Section Distribution.
Variables ( : realType) ( : choiceType).
Structure
Source code
:> T -> R;
_ : forall , 0 <= mu x;
_ : summable mu;
_ : PosSum.psum mu <= 1
}.
Definition
is_nearE : prop_of = prop_in_filter_proj is_nearE is not universe polymorphic is_nearE is transparent Expands to: Constant mathcomp.classical.filter.is_nearE Declared in library mathcomp.classical.filter, line 576, characters 11-19
Source code
End Distribution.
Notation
Source code
(at level 0, T at level 2, format "{ 'distr' T / R }")
: type_scope.
Section DistrCoreTh.
Context { : realType} ( : choiceType) ( : {distr T / R}).
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
#[global] Hint Extern 0 (is_true (0 <= _)) => solve [apply: ge0_mu] : core.
#[global] Hint Resolve le1_mu summable_mu : core.
Section Clamp.
Context { : realType}.
Definition
in_filterT : forall [T : Type] [F : set_system T], Filter F -> in_filter (T:=T) F in_filterT is not universe polymorphic Arguments in_filterT [T]%_type_scope [F] FF in_filterT is transparent Expands to: Constant mathcomp.classical.filter.in_filterT Declared in library mathcomp.classical.filter, line 581, characters 11-21
Source code
Num.max (Num.min x 1) 0.
Lemma
Source code
Lemma
Source code
Definition
in_filterI : forall [T : Type] [F : set_system T], Filter F -> in_filter (T:=T) F -> in_filter (T:=T) F -> in_filter (T:=T) F in_filterI is not universe polymorphic Arguments in_filterI [T]%_type_scope [F] FF P Q in_filterI is transparent Expands to: Constant mathcomp.classical.filter.in_filterI Declared in library mathcomp.classical.filter, line 583, characters 10-20
Source code
Lemma
Source code
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Section StdDefs.
Context { : realType} ( : choiceType).
Implicit Types (mu : {distr T / R}) (A B E : pred T) (f : T -> R).
Definition
eventually_filterType : filter_on nat eventually_filterType is not universe polymorphic eventually_filterType is transparent Expands to: Constant mathcomp.classical.filter.eventually_filterType Declared in library mathcomp.classical.filter, line 784, characters 10-31
Source code
Lemma
Source code
(x \in dinsupp mu) = (mu x != 0).
Proof.
Lemma
Source code
Lemma
Source code
Definition
eventually_pfilterType : pfilter_on nat eventually_pfilterType is not universe polymorphic eventually_pfilterType is transparent Expands to: Constant mathcomp.classical.filter.eventually_pfilterType Declared in library mathcomp.classical.filter, line 785, characters 10-32
Source code
Definition
fmap : forall {T U : Type}, (T -> U) -> set_system T -> set_system U fmap is not universe polymorphic Arguments fmap {T U}%_type_scope f%_function_scope F _ / The reduction tactics unfold fmap when applied to 5 arguments fmap is transparent Expands to: Constant mathcomp.classical.filter.fmap Declared in library mathcomp.classical.filter, line 820, characters 11-15
Source code
Definition
fmapi : forall {T U : Type}, (T -> set U) -> set_system T -> set_system U fmapi is not universe polymorphic Arguments fmapi {T U}%_type_scope f%_function_scope F _ fmapi is transparent Expands to: Constant mathcomp.classical.filter.fmapi Declared in library mathcomp.classical.filter, line 853, characters 11-16
Source code
Definition
continuous_at : forall [T U : nbhsType], T -> (T -> U) -> Prop continuous_at is not universe polymorphic Arguments continuous_at [T U] x f%_function_scope continuous_at is transparent Expands to: Constant mathcomp.classical.filter.continuous_at Declared in library mathcomp.classical.filter, line 973, characters 11-24
Source code
Definition
globally : forall {T : Type}, set T -> set_system T globally is not universe polymorphic Arguments globally {T}%_type_scope A%_classical_set_scope _ / The reduction tactics unfold globally when applied to 3 arguments globally is transparent Expands to: Constant mathcomp.classical.filter.globally Declared in library mathcomp.classical.filter, line 999, characters 11-19
Source code
End StdDefs.
Notation
Source code
Notation
Source code
Notation
Source code
Notation
Source code
Notation
Source code
Notation
Source code
Section DistrTheory.
Context { : realType} { : choiceType} ( : T -> R).
Definition
frechet_filter : forall [T : Type], set (set T) frechet_filter is not universe polymorphic Arguments frechet_filter [T]%_type_scope _ frechet_filter is transparent Expands to: Constant mathcomp.classical.filter.frechet_filter Declared in library mathcomp.classical.filter, line 1021, characters 11-25
Source code
(forall , 0 <= mu x) /\ (forall , uniq J -> \sum_( <- J) mu j <= 1).
Hypothesis
Source code
Local Lemma
Source code
Proof.
Local Lemma
Source code
Proof.
Local Lemma
Source code
Proof.
by exists 0, fset0; rewrite big_fset0.
apply/ubP=> y [x ->]; rewrite big_fset_seq /=.
by case: isd => _; apply; case: x => x /= /canonical_uniq.
Qed.
Definition
prod_filter_on : forall [T U : Type], filter_on T -> filter_on U -> filter_on (T * U) prod_filter_on is not universe polymorphic Arguments prod_filter_on [T U]%_type_scope F G prod_filter_on is transparent Expands to: Constant mathcomp.classical.filter.prod_filter_on Declared in library mathcomp.classical.filter, line 1050, characters 10-24
Source code
Lemma
Source code
Proof.
Definition
in_filter_prod : forall {T U : Type} {F : set_system T} {G : set_system U}, in_filter (T:=T) F -> in_filter (T:=U) G -> in_filter (T:=T * U) (filter_prod F G) in_filter_prod is not universe polymorphic Arguments in_filter_prod {T U}%_type_scope {F G} P Q in_filter_prod is transparent Expands to: Constant mathcomp.classical.filter.in_filter_prod Declared in library mathcomp.classical.filter, line 1076, characters 19-33
Source code
[/\ forall , 0 <= mu x & summable mu].
End DistrTheory.
Lemma
Source code
(isdistr mu) <-> (forall , 0 <= mu x) /\ (\sum_ mu j <= 1).
Proof.
Lemma
Source code
{ : realType} { : choiceType} ( : {distr T / R}) : mu x <= 1.
Proof.
Section DistrD.
Context { : realType} { : choiceType} ( : T -> R).
Definition
near_simpl : (forall (U : Type) (T : filteredType U) (x : T) (P : set U), (\forall x0 \near nbhs x, P x0) = (\near x, P x)) * (forall (U : Type) (T : filteredType U) (x : T) (P : set U), nbhs x P = (\near x, P x)) * (forall (X : Type) (fX : filteredType X) (x : fX) (P : set X), nbhs x P = (\near x, P x)) * (forall (T : Type) (F : filter_on T) (P : set T), (\near F, P F) = (\forall x \near F, P x)) * (forall (T U : Type) (f : T -> U) (F : set_system T) (P : set U), (\forall y \near (f x @[x --> F])%classic, P y) = (\near F, P (f F))) * (forall (T U : Type) (f : T -> set U) (F : set_system T) (P : set U), (\forall y \near (f x `@[x --> F])%classic, P y) = (\near F, exists y : U, f F y /\ P y)) * (forall (T T' U U' : Type) (f : T -> U) (g : T' -> U') (F : set_system T) (G : set_system T') (P : U -> set U'), Filter F -> Filter G -> (\forall y \near (f x @[x --> F])%classic & y' \near (g x @[x --> G])%classic, P y y') = (\near F & G, P (f F) (g G))) near_simpl is not universe polymorphic near_simpl is transparent Expands to: Constant mathcomp.classical.filter.NearMap.near_simpl Declared in library mathcomp.classical.filter, line 1146, characters 11-21
Source code
Lemma
Source code
Definition
cvg_to_comp_2 : forall [T U V W : Type] [F : set_system T] [G : set_system U] [H : set_system V] [I : set_system W], Filter F -> Filter G -> Filter H -> forall [f : T -> U] [g : T -> V] [h : U -> V -> W], (f x @[x --> F] --> G)%classic -> (g x @[x --> F] --> H)%classic -> (h x.1 x.2 @[x --> (G, H)] --> I)%classic -> (h (f x) (g x) @[x --> F] --> I)%classic cvg_to_comp_2 is not universe polymorphic Expanded type for implicit arguments cvg_to_comp_2 : forall [T U V W : Type] [F : set_system T] [G : set_system U] [H : set_system V] [I : set_system W], Filter F -> Filter G -> Filter H -> forall [f : T -> U] [g : T -> V] [h : U -> V -> W], (f x @[x --> F] --> G)%classic -> (g x @[x --> F] --> H)%classic -> (h x.1 x.2 @[x --> (G, H)] --> I)%classic -> forall [t : set W], nbhs I t -> F ((fun x : T => h (f x) (g x)) @^-1` t)%classic Arguments cvg_to_comp_2 [T U V W]%_type_scope [F G H I] FF FG FH [f g h]%_function_scope _ _ _ [t] _ cvg_to_comp_2 is transparent Expands to: Constant mathcomp.classical.filter.cvg_to_comp_2 Declared in library mathcomp.classical.filter, line 1172, characters 11-24
Source code
Lemma
Source code
Proof.
Definition
within : forall {T : Type}, set T -> set_system T -> set_system T within is not universe polymorphic Arguments within {T}%_type_scope D%_classical_set_scope F _ within is transparent Expands to: Constant mathcomp.classical.filter.within Declared in library mathcomp.classical.filter, line 1194, characters 11-17
Source code
if @idP `[< isdistr mu >] is ReflectT Px then
mkdistr (asboolW Px)
else dnull.
End DistrD.
Lemma
Source code
dnull <=1 mu.
Section Restr.
Context { : realType} { : choiceType} ( : pred T).
Definition
within_filter_on : forall [T : Type], set T -> filter_on T -> filter_on T within_filter_on is not universe polymorphic Arguments within_filter_on [T]%_type_scope D%_classical_set_scope F within_filter_on is transparent Expands to: Constant mathcomp.classical.filter.within_filter_on Declared in library mathcomp.classical.filter, line 1240, characters 10-26
Source code
fun => if p x then mu x else 0.
Lemma
Source code
Proof.
Definition
subset_filter : forall [T : finType] (p : T -> bool) [s1 s2 : seq T], s1 \subset s2 -> [seq a <- s1 | p a] \subset [seq a <- s2 | p a] subset_filter is not universe polymorphic Arguments subset_filter [T] p%_function_scope [s1 s2]%_seq_scope _ subset_filter is opaque Expands to: Constant mathcomp.boot.fintype.subset_filter Declared in library mathcomp.boot.fintype, line 710, characters 6-19
Source code
Lemma
Source code
drestr mu x = if p x then mu x else 0.
Proof.
Section RestrTheory.
Context { : realType} { : choiceType}.
Lemma
Source code
mu x = drestr p mu x + drestr (predC p) mu x.
Lemma
Source code
(x \in dinsupp (drestr p mu)) = (x \in dinsupp mu) && p x.
Proof.
Section DRat.
Context { : realType} ( : choiceType).
Local Notation
Source code
Implicit Types (s : seq T).
Definition
powerset_filter_from : forall {Y : Type}, set_system Y -> set_system (set Y) powerset_filter_from is not universe polymorphic Arguments powerset_filter_from {Y}%_type_scope F _ powerset_filter_from is transparent Expands to: Constant mathcomp.classical.filter.powerset_filter_from Declared in library mathcomp.classical.filter, line 1285, characters 11-31
Source code
fun : T => (count (pred1 x) s)%:R / (size s)%:R.
Lemma
Source code
Local Lemma
Source code
Proof.
by move=> ->; rewrite invr0 mulr0 ler01.
move=> /eqP nz_s; rewrite ler_pdivrMr ?ltr0n ?lt0n // mul1r.
rewrite ler_nat (bigID (mem s)) /= [X in (_+X)%N]big1 ?addn0.
by move=> i /count_memPn.
have ->: (size s = \sum_( <- undup s) count_mem i s)%N.
rewrite -sum1_size -big_undup_iterop_count; apply: eq_bigr => i _.
by rewrite Monoid.iteropE iter_addn addn0 mul1n.
rewrite [X in (_<=X)%N](bigID (mem J)) /= -ltnS -addSn.
rewrite ltn_addr //= ltnS -big_filter -[X in (_<=X)%N]big_filter.
rewrite leq_eqVlt; apply/orP; left; apply/eqP/perm_big.
apply/uniq_perm; rewrite ?filter_uniq ?undup_uniq //.
by move=> x; rewrite !mem_filter mem_undup andbC.
Qed.
Local Lemma
Source code
\sum_( <- undup s) mrat s i = 1.
Proof.
Local Lemma
Source code
Proof.
by move=> j _; rewrite ger0_norm ?ge0_mrat.
by apply/has_sup_mrat.
Qed.
Lemma
Source code
Proof.
Definition
principal_filter : forall {X : Type}, X -> set_system X principal_filter is not universe polymorphic Arguments principal_filter {X}%_type_scope x _ principal_filter is transparent Expands to: Constant mathcomp.classical.filter.principal_filter Declared in library mathcomp.classical.filter, line 1378, characters 11-27
Source code
Lemma
Source code
drat s x = (count_mem x s)%:R / (size s)%:R.
Definition
principal_filter_type : Type -> Type principal_filter_type is not universe polymorphic Arguments principal_filter_type P%_type_scope principal_filter_type is transparent Expands to: Constant mathcomp.classical.filter.principal_filter_type Declared in library mathcomp.classical.filter, line 1382, characters 11-32
Source code
Definition
filterI_iter : forall {T : Type}, set_system T -> nat -> set (set T) filterI_iter is not universe polymorphic Arguments filterI_iter {T}%_type_scope F n%_nat_scope _ filterI_iter is transparent Expands to: Constant mathcomp.classical.filter.filterI_iter Declared in library mathcomp.classical.filter, line 1530, characters 9-21
Source code
Lemma
Source code
Lemma
Source code
Proof.
Lemma
Source code
t' \in dinsupp (dunit t) -> t' = t :> T.
End DRat.
Section Flip.
Context { : realType}.
Definition
open_finI_from : forall [I : choiceType] [T : Type], set I -> (I -> set T) -> set (set T) open_finI_from is not universe polymorphic Arguments open_finI_from [I] [T]%_type_scope D%_classical_set_scope f%_function_scope _ open_finI_from is transparent Expands to: Constant mathcomp.classical.filter.open_finI_from Declared in library mathcomp.classical.filter, line 1562, characters 11-25
Source code
fun => if b then clamp xt else 1 - clamp xt.
Lemma
Source code
Proof.
+ by case: b; rewrite ?subr_ge0 cp01_clamp.
+ by rewrite /index_enum !unlock /= addr0 addrC subrK.
Qed.
Definition
finI : forall [I : choiceType] [T : Type], set I -> (I -> set T) -> Prop finI is not universe polymorphic Arguments finI [I] [T]%_type_scope D%_classical_set_scope f%_function_scope finI is transparent Expands to: Constant mathcomp.classical.filter.finI Declared in library mathcomp.classical.filter, line 1635, characters 11-15
Source code
Lemma
Source code
End Flip.
Section Std.
Context { : realType}.
Local Notation
Source code
Implicit Types (T U : choiceType).
Section Bind.
Context { : choiceType} ( : T -> distr U) ( : distr T).
Definition
Source code
Lemma
Source code
Proof.
rewrite /mlet psum_bigop; first by move=> y x; rewrite mulr_ge0.
move=> u; apply/(le_summable (g := mu)) => //.
by move=> x; rewrite mulr_ge0 //= ler_piMr ?le1_mu1.
apply/(le_trans _ (le1_mu mu))/le_psum => //.
move=> x; rewrite sumr_ge0 /= => [y _|]; first by rewrite mulr_ge0.
rewrite -mulr_sumr ler_piMr //; apply/(le_trans _ (le1_mu (f x))).
have := summable_mu (f x) => /gerfinseq_psum => /(_ _ uqJ).
by apply/(le_trans _)/ler_sum=> y _; apply/ler_norm.
Qed.
Definition
Source code
Lemma
Source code
Proof.
Notation
Source code
Definition
Source code
fun => \dlet_( <- d) f x.
Definition
Source code
fun => (iter n (dlift f) (dunit a)).
Section BindTheory.
Variables ( : choiceType).
Implicit Types (f g : T -> distr U) (mu nu : distr T).
Lemma
Source code
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
dlet f mu =1 dlet g nu.
Proof.
Lemma
Source code
(forall , 0 <= f x <= 1) -> summable (fun => mu x * f x).
Proof.
exists 1 => x; case/andP: (in01_f x) => ge0_fx le1_fx.
by rewrite ger0_norm.
Qed.
Lemma
Source code
Proof.
Lemma
Source code
dlet f mu <=1 dlet g mu.
Proof.
Lemma
Source code
Proof.
Lemma
Source code
mu <=1 nu
-> {in dinsupp mu, forall , f x <=1 g x}
-> \dlet_( <- mu) f x <=1 \dlet_( <- nu) g x.
Proof.
Lemma
Source code
(\dlet_(_ <- mu) nu) y = (dweight mu) * (nu y).
Proof.
Lemma
Source code
y \in dinsupp (\dlet_( <- mu) f x) ->
exists2 , x \in dinsupp mu & f x y != 0.
Proof.
Lemma
Source code
x \in dinsupp mu -> f x y != 0 -> y \in dinsupp (dlet f mu).
Proof.
Lemma
Source code
{in dinsupp mu, forall , f x != y} -> (\dlet_( <- mu) dunit (f x)) y = 0.
Proof.
Lemma
Source code
(\dlet_( <- mu) F x) y = 0 -> forall , x \in dinsupp mu -> F x y = 0.
Proof.
End BindTheory.
Section DLetDLet.
Context { : choiceType} ( : T -> distr U) ( : U -> distr V).
Lemma
Source code
\dlet_( <- \dlet_( <- mu) f1 y) f2 x
=1 \dlet_( <- mu) (\dlet_( <- f1 y) f2 x).
Proof.
pose S := mu x * (f1 x y * f2 y z).
rewrite (eq_psum (F2 := fun => PosSum.psum (S^~ y))) => [x|].
by rewrite -psumZ //; apply/eq_psum => y /=.
rewrite interchange_psum.
+ by move=> x; apply/summableZ/summable_mlet.
+ rewrite {}/S; apply/(le_summable (g := mu)) => //.
move=> x; rewrite ge0_psum /= psumZ ?ler_piMr //.
apply/(le_trans _ (le1_mu (f1 x)))/le_psum => //.
by move=> y; rewrite mulr_ge0 //= ler_piMr ?le1_mu1.
apply/eq_psum=> y /=; rewrite -psumZr //.
by apply/eq_psum=> x /=; rewrite {}/S mulrA.
Qed.
End DLetDLet.
Section DLetAlg.
Context { : choiceType} (
Source code
Source code
Lemma
Source code
(forall , mu x = mu1 x + mu2 x) -> (\dlet_( <- mu) f x) z =
(\dlet_( <- mu1) f x) z + (\dlet_( <- mu2) f x) z.
Proof.
by move=> x; rewrite mulr_ge0. by move=> x; rewrite mulr_ge0.
by apply/summable_mlet. by apply/summable_mlet.
by apply/eq_psum=> x /=; rewrite -mulrDl -muD.
Qed.
Definition
Source code
fun => fine (nlim (fun => f n x)).
Lemma
Source code
Proof.
case: nlimP=> // l cvSl; apply/fine_ge0/(ncvg_geC _ cvSl).
by move=> n; apply/ge0_mu.
move=> uqJ; pose F :=
if `[< iscvg (fun => f n j) >] then fun => f n j else 0%:S.
apply/(@le_trans _ _ (\sum_( <- J) (fine (nlim (F j) (*: R*))))).
apply/ler_sum=> j _; rewrite /F; case/boolP: `[< _ >] => //.
move/asboolPn=> h; rewrite nlimC; case: nlimP=> //.
by case=> // l cf; case: h; exists l.
rewrite -lee_fin -nlim_sumR => [i _|].
rewrite /F; case/boolP: `[< _ >] => [/asboolP //|].
by move=> _; apply/iscvgC.
rewrite leNgt; apply/negP; pose s := \sum_( <- J) F j n.
move/ncvg_gt=> -/(_ s (nlim_ncvg _)) [].
suff: iscvg s by case=> l cs; exists l%:E.
apply/iscvg_sum=> j _; rewrite /F; case/boolP: `[< _ >].
by move/asboolP. by move=> _; apply/iscvgC.
move=> K /(_ _ (leqnn K)) /=; apply/negP; rewrite -leNgt.
apply/(@le_trans _ _ (\sum_( <- J) f K j)); last first.
have /(gerfinseq_psum uqJ) := summable_mu (f K).
move/le_trans=> -/(_ _ (le1_mu (f K)))=> h.
by apply/(le_trans _ h)/ler_sum=> i _; apply/ler_norm.
by apply/ler_sum=> j _; rewrite /F; case/boolP: `[< _ >].
Qed.
Definition
Source code
locked (mkdistr (isd_mlim f)).
Notation
Source code
Lemma
Source code
(\dlim_() f n) x = fine (nlim (fun => f n x)).
Proof.
Section DLimTheory.
Variables ( : choiceType).
Implicit Types (f g : nat -> distr T) (h : T -> {distr U / R}).
Implicit Types (mu : {distr T / R}).
Lemma
Source code
Lemma
Source code
Proof.
Lemma
Source code
(forall , (K <= n)%N -> f n =1 g n) -> dlim f =1 dlim g.
Proof.
by apply/(eq_from_nlim (K := K)); move=> n /eq_fg /(_ x).
Qed.
Definition
Source code
dlim (fun => mu n.+1) =1 dlim mu.
Definition
big_lexi_order : forall {I : Type}, (I -> Type) -> Type big_lexi_order is not universe polymorphic Arguments big_lexi_order {I}%_type_scope T%_function_scope big_lexi_order is transparent Expands to: Constant mathcomp.classical.classical_orders.big_lexi_order Declared in library mathcomp.classical.classical_orders, line 28, characters 11-25
Source code
dlim (fun => mu (n + p)%N) =1 dlim mu.
Proof.
Definition
same_prefix : forall {K : nat -> eqType}, NatOrder.Datatypes_nat__canonical__Order_Preorder -> (forall n : nat, K n) -> (forall n : nat, K n) -> Prop same_prefix is not universe polymorphic Arguments same_prefix {K}%_function_scope n (t1 t2)%_function_scope same_prefix is transparent Expands to: Constant mathcomp.classical.classical_orders.same_prefix Declared in library mathcomp.classical.classical_orders, line 35, characters 11-22
Source code
forall , exists , ncvg (fun => f n x) l.
Definition
first_diff : forall {K : nat -> eqType}, (forall n : nat, K n) -> (forall n : nat, K n) -> option nat first_diff is not universe polymorphic Arguments first_diff {K}%_function_scope (t1 t2)%_function_scope first_diff is transparent Expands to: Constant mathcomp.classical.classical_orders.first_diff Declared in library mathcomp.classical.classical_orders, line 59, characters 11-21
Source code
exists , forall , ncvg (fun => f n x) l.
CoInductive
Source code
|
Source code
ncvg (fun => f n x) l%:E -> dlim_spec f x l
|
Source code
dlim_spec f x 0.
Lemma
Source code
Proof.
Lemma
Source code
exists2 , (0 <= l <= 1) & ncvg (f^~ x) l%:E.
Proof.
Lemma
Source code
(forall , (n <= m)%N -> f n <=1 f m) -> dcvg f.
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Lemma
Source code
(forall , f n <=1 g n) -> dcvg g -> dlim f <=1 dlim g.
Proof.
Lemma
Source code
Proof.
Lemma
Source code
(forall , (n <= m)%N -> f n <=1 f m) -> f k <=1 dlim f.
Proof.
Lemma
Source code
\dlet_( <- dlim f) h x =1 \dlim_() \dlet_( <- f n) h x.
Proof.
Lemma
Source code
(forall , (n <= m)%N -> f n x <=1 f m x) ->
\dlim_() \dlet_( <- mu) (f n x) =1
\dlet_( <- mu) \dlim_() (f n x).
Proof using Type. End DLimTheory.
#[deprecated(since="mathcomp-analysis 0.6.2",
note="lacks proof, use __admitted__dlet_lim explicitly if you really want to use this lemma")]
Notation
Source code
#[deprecated(since="mathcomp-analysis 0.6.2",
note="lacks proof, use __admitted__dlim_let explicitly if you really want to use this lemma")]
Notation
Source code
Section Marginals.
Variable ( : choiceType) ( : T -> U) ( : distr T).
Definition
big_lexi_le : forall {K : nat -> eqType}, (forall n : nat, K n -> K n -> bool) -> (forall n : nat, K n) -> (forall n : nat, K n) -> bool big_lexi_le is not universe polymorphic Arguments big_lexi_le {K}%_function_scope (R t1 t2)%_function_scope big_lexi_le is transparent Expands to: Constant mathcomp.classical.classical_orders.big_lexi_le Declared in library mathcomp.classical.classical_orders, line 130, characters 11-22
Source code
Lemma
Source code
Proof.
Section MarginalsTh.
Variable ( : choiceType).
Lemma
Source code
(dmargin f mu) y = PosSum.psum (fun => (f x == y)%:R * mu x).
Lemma
Source code
\dlet_( <- dmargin f mu) g u =1 \dlet_( <- mu) (g (f t)).
Proof.
Lemma
Source code
dmargin f (\dlet_( <- mu) g t) =1 \dlet_( <- mu) (dmargin f (g t)).
Proof.
Lemma
Source code
dmargin f (dunit t) =1 dunit (f t) :> {distr U / R}.
Proof.
End Std.
#[deprecated(since="1.17.0", note="use `dmargin_dlet` instead")]
Notation
Source code
#[deprecated(since="1.17.0", note="use `dlet_dmargin` instead")]
Notation
Source code
#[deprecated(since="1.17.0", note="use `dlet_dlet` instead")]
Notation
Source code
Notation
Source code
Notation
Source code
Notation
Source code
Notation
Source code
Section DSwap.
Context { : realType} { : choiceType} ( : {distr (A * B) / R}).
Definition
start_with : forall {K : nat -> eqType}, NatOrder.Datatypes_nat__canonical__Order_Preorder -> (forall n : nat, K n) -> (forall n : nat, K n) -> forall i : nat, K i start_with is not universe polymorphic Arguments start_with {K}%_function_scope n (t1 t2)%_function_scope i%_nat_scope start_with is transparent Expands to: Constant mathcomp.classical.classical_orders.start_with Declared in library mathcomp.classical.classical_orders, line 183, characters 11-21
Source code
dmargin (fun => (xy.2, xy.1)) mu.
End DSwap.
Section DSwapCoreTheory.
Context { : realType} { : choiceType} ( : {distr (A * B) / R}).
Lemma
Source code
Proof.
Section DSwapTheory.
Context { : realType} { : choiceType} ( : {distr (A * B) / R}).
Lemma
Source code
Proof.
Lemma
Source code
xy \in dinsupp (dswap mu).
Lemma
Source code
Proof.
by move=> _ t /=; rewrite dlet_unit /=.
Qed.
Lemma
Source code
Proof.
by move=> _ t /=; rewrite dlet_unit /=.
Qed.
#[deprecated(since="1.17.0", note="use `dfst_dswap` instead")]
Notation
Source code
#[deprecated(since="1.17.0", note="use `dsnd_dswap` instead")]
Notation
Source code
Section DFst.
Context { : realType} { : choiceType}.
Lemma
Source code
dfst mu x = PosSum.psum (fun => mu (x, y)).
Proof.
rewrite (reindex_psum (P := [pred | z.1 == x]) (h := h)) /=.
+ case=> a b; rewrite !inE/= mulf_eq0 => /norP[].
by rewrite pnatr_eq0 eqb0 negbK.
+ by exists snd => [z|[z1 z2]]; rewrite !inE //= => /eqP ->.
by apply/eq_psum => y; rewrite eqxx mul1r.
Qed.
Lemma
Source code
summable (fun => mu (x, y)).
Proof.
apply/summable_seqP; exists M => // J uqJ; pose X := [seq (x, y) | <- J].
apply/(le_trans _ (h X _)); last by rewrite map_inj_uniq // => y1 y2 [].
by rewrite le_eqVlt big_map eqxx.
Qed.
Section DSnd.
Context { : realType} { : choiceType}.
Lemma
Source code
dsnd mu y = PosSum.psum (fun => mu (x, y)).
Proof.
Lemma
Source code
summable (fun => mu (x, y)).
Proof.
#[deprecated(since="1.17.0", note="use `dsndE` instead")]
Notation
Source code
Section PrCoreTheory.
Context { : realType} { : choiceType}.
Implicit Types (mu : {distr T / R}) (A B E : pred T).
Lemma
Source code
Proof.
by rewrite mulr_ge0 ?ler0n //= ler_piMl // lern1 leq_b1.
Qed.
Lemma
Source code
Lemma
Source code
Proof.
Lemma
Source code
Lemma
Source code
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Lemma
Source code
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Lemma
Source code
Proof.
Lemma
Source code
Lemma
Source code
{in dinsupp mu, A =i B} -> \P_[mu] A = \P_[mu] B.
Proof.
Lemma
Source code
Proof.
Lemma
Source code
{in dinsupp mu, f1 =1 f2} -> \E_[mu] f1 = \E_[mu] f2.
Proof.
Lemma
Source code
E =1 pred0 -> \P_[mu] E = 0.
End PrCoreTheory.
Section PrTheory.
Context { : realType} { : choiceType} { : eqType}.
Implicit Types (mu : {distr T / R}) (A B E : pred T).
Lemma
Source code
\P_[dlet f mu] E = \E_[mu] (fun => \P_[f x] E).
Proof.
rewrite /pr; unlock dlet => /=; rewrite /mlet /=.
pose F := (E x)%:R * (mu y * f y x).
transitivity (PosSum.psum (fun => PosSum.psum (fun => F x y))); rewrite {}/F.
by apply/eq_psum => x; rewrite -psumZ ?ler0n.
rewrite interchange_psum /=; last first.
apply/eq_psum=> y /=; rewrite mulrC -psumZ //.
by apply/eq_psum=> x /=; rewrite mulrCA.
+ have := summable_pr E (dlet f mu); apply/eq_summable.
by move=> x; rewrite /= dletE psumZ ?ler0n.
+ by move=> t; exact/summable_condl/summable_mlet.
Qed.
Lemma
Source code
\P_[dmargin f mu] E = \P_[mu] [pred | f x \in E].
Lemma
Source code
(forall , x \in dinsupp mu -> x \notin A) -> \P_[mu] A = 0.
Proof.
Lemma
Source code
(forall , x \in dinsupp mu -> x \in B -> x \notin A)
-> \P_[mu, B] A = 0.
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Lemma
Source code
f1 <=1 f2 -> \E_[mu] f1 <= \E_[mu] f2.
Lemma
Source code
(forall , x \in dinsupp mu -> x \in E1 -> x \in E2) ->
\P_[mu] E1 <= \P_[mu] E2.
Proof.
Lemma
Source code
(forall , x \in dinsupp nu -> x \in A -> nu x <= mu x)
-> \P_[nu] A <= \P_[mu] A.
Proof.
Lemma
Source code
Proof.
Lemma
Source code
PosSum.psum (fun => \P_[mu, A] (pred1 x)) = 1.
Proof.
rewrite (eq_psum (F2 := (fun => (A x)%:R * mu x))); last first.
by rewrite divff // gt_eqF.
move=> x /=; rewrite /pr (psum_finseq (r := [:: x])) ?big_seq1 //=.
move=> y; rewrite !inE; case: (y == x) => //=.
by rewrite mul0r eqxx.
by rewrite !inE eqxx -topredE ger0_norm ?mulr_ge0 ?ler0n.
Qed.
Lemma
Source code
Proof.
by move: xE; rewrite -topredE /= => ->; rewrite mul1r.
Qed.
Lemma
Source code
\P_[mu] A = \P_[mu] [predI A & B] + \P_[mu] [predI A & predC B].
Proof.
Lemma
Source code
(forall , x \in A -> x \notin B) ->
\P_[mu] [predU A & B] = \P_[mu] A + \P_[mu] B.
Proof.
Lemma
Source code
\P_[mu] [pred | f x \in r]
= \sum_( <- r) \P_[mu] [pred | f x == y].
Proof.
case/andP=> yNr /ih {ih}h; rewrite big_cons -h -pr_or_indep.
by move=> x; rewrite !inE => /eqP->. by apply/eq_pr.
Qed.
Lemma
Source code
\P_[mu] [pred | x \in r] = \sum_( <- r) mu x.
Proof.
case/andP=> yNr /ih {ih}h; rewrite big_cons /= pr_pred1.
by rewrite -h -pr_or_indep // => x /eqP ->.
Qed.
Lemma
Source code
uniq r
-> (forall , p1 != p2 -> p1 \in r -> p2 \in r -> x \in P p1 -> x \notin P p2)
-> \P_[mu] [pred | has [pred | x \in P p] r]
= \sum_( <- r) \P_[mu] (P p).
Proof.
rewrite (eq_pr (B := S)) => [x|]; first by rewrite !inE -big_has.
rewrite {}/S; elim: r uq_r dj => [_|p r ih /andP[pNr /ih {ih}h]] dj.
by rewrite big_nil pr_pred0_eq // => x; rewrite big_nil.
rewrite big_cons -h => [p1 p2 x ne_p p1r p2r|].
by apply/dj=> //; rewrite in_cons (p1r, p2r) orbT.
rewrite -pr_or_indep => [x xNPp|].
rewrite -topredE /= big_has; apply/hasPn => y y_in_r.
apply/(dj p); rewrite ?in_cons ?(eqxx, y_in_r, orbT) //.
by apply/contra: pNr=> /eqP->.
by apply/eq_pr=> x; rewrite -!topredE /= big_cons.
Qed.
Lemma
Source code
\P_[mu] A + \P_[mu] B - \P_[mu] [predI A & B].
Proof.
Lemma
Source code
\P_[mu] A + \P_[mu] B - \P_[mu] [predU A & B].
Lemma
Source code
\P_[mu] [predU A & B] <= \P_[mu] A + \P_[mu] B.
Lemma
Source code
\P_[mu] [predI A & B] <= \P_[mu] A + \P_[mu] B.
Lemma
Source code
Proof.
Lemma
Source code
\P_[mu] B * \P_[mu, B] A
+ \P_[mu] (predC B) * \P_[mu, predC B] A.
Proof.
by rewrite (prID _ B); congr (_ + _); apply/h.
rewrite /prc mulrCA; have [] := eqVneq (\P_[mu] B') 0; last first.
by move=> nzPB'; rewrite divff // mulr1.
move=> zPB'; rewrite zPB' invr0 !mulr0; apply/eq0_pr.
move=> x mux; move/pr_eq0: zPB' => /(_ x) h; rewrite !inE.
by apply/negP=> /andP[_ /h] /dinsuppP.
Qed.
Lemma
Source code
\P_[mu] A * \E_[mu, A] f
+ \P_[mu] (predC A) * \E_[mu, predC A] f.
Proof using Type.
Lemma
Source code
(exists , forall , `|f x| < M) -> \E?_[mu] f.
Proof.
case=> M ltM; rewrite /has_esp; apply/summable_seqP.
exists (Num.max M 0); first by rewrite le_max lexx orbT.
move=> J uqJ; apply/(@le_trans _ _ (\sum_( <- J) M * mu j)).
apply/ler_sum=> j _; rewrite normrM [X in _*X]ger0_norm //.
by apply/ler_wpM2r=> //; apply/ltW.
case: (ltrP M 0) => [lt0_M|ge0_M].
rewrite ?(ltW lt0_M) // -mulr_sumr.
by rewrite nmulr_rle0 //; apply/sumr_ge0.
by rewrite -mulr_sumr ler_piMr // -pr_mem ?le1_pr.
Qed.
Lemma
Source code
(exists , forall , `|F x| <= M) -> \E?_[mu] F.
Proof.
Lemma
Source code
Proof.
Lemma
Source code
0 <= M -> (forall , `|F x| <= M) -> \E_[mu] F <= M.
Proof.
Lemma
Source code
(forall
Source code
\E_[dlet nu mu] F = \E_[mu] (fun => \E_[nu x] F).
Proof using Type*. End PrTheory.
#[deprecated(since="1.17.0", note="use `pr_dlet` instead")]
Notation
Source code
#[deprecated(since="mathcomp-analysis 0.6.2",
note="lacks proof, use __admitted__exp_split explicitly if you really want to use this lemma")]
Notation
Source code
#[deprecated(since="mathcomp-analysis 0.6.2",
note="lacks proof, use __admitted__exp_dlet explicitly is you really want to use this lemma")]
Notation
Source code
Section Jensen.
Context { : realType} { : finType}.
Definition
Source code
forall , (a <= x%:E <= b)%E -> (a <= y%:E <= b)%E ->
forall , 0 <= t <= 1 ->
f (t * x + (1 - t) * y) <= t * (f x) + (1 - t) * (f y).
Notation
Source code
Section Jensen.
Context ( : R -> R) ( : I -> R).
Hypothesis
Source code
Hypothesis
Source code
Hypothesis
Source code
Lemma
Source code
Proof.
by move/esym/eqP; rewrite oner_eq0.
elim: {i} s (l i) (ge0_l i) (x i) => [|j s ih] li ge0_li xi.
by rewrite !big_nil !addr0 => ->; rewrite !mul1r.
rewrite !big_cons; have := ge0_l j; rewrite le_eqVlt.
case/orP => [/eqP<-|gt0_lj].
by rewrite !Monoid.simpm /= !Monoid.simpm; apply/ih.
rewrite !addrA => eq1; pose z := (li * xi + l j * x j) / (li + l j).
have nz_lij: li + l j != 0 by rewrite gt_eqF ?ltr_wpDl.
have/ih := eq1 => -/(_ _ z); rewrite [_ * (_ / _)]mulrC.
rewrite mulfVK // => {}ih; apply/(le_trans (ih _)).
by rewrite addr_ge0 ?ge0_l.
rewrite lerD2r {ih}/z [_ / _]mulrDl ![_*_/_]mulrAC.
set c1 : R := _ / _; set c2 : R := _ / _; have eqc2: c2 = 1 - c1.
apply/(mulfI nz_lij); rewrite mulrBr mulr1 ![(li + l j)*_]mulrC.
by apply/eqP; rewrite !mulfVK // eq_sym subr_eq addrC.
set c := (li + l j); pose z := (c * c1 * f xi + c * c2 * f (x j)).
apply/(@le_trans _ _ z); last by rewrite /z ![_*(_/_)]mulrC !mulfVK.
rewrite {}/z -![c * _ * _]mulrA -mulrDr ler_wpM2l ?addr_ge0 //.
rewrite eqc2 cvx_f // ?leNye ?leey // divr_ge0 ?addr_ge0 //=.
by rewrite ler_pdivrMr ?mul1r ?lerDl ?ltr_wpDl.
Qed.
End Jensen.
Notation
Source code