Module mathcomp.classical.fsbigop
From mathcomp Require Import boot order ssralg ssrnum ssrint interval finmap.#[warning="-warn-library-file-internal-analysis"]
From mathcomp Require Import unstable.
From mathcomp Require Import boolp classical_sets functions cardinality.
# Finitely-supported big operators
```
finite_support idx D F := D `&` F @^-1` [set~ idx]
\big[op/idx]_(i \in A) F i == iterated application of the operator op
with neutral idx over finite_support idx A F
\sum_(i \in A) F i == iterated addition, in ring_scope
```
Reserved Notation "\big [ op / idx ]_ ( i '\in' A ) F"
(F at level 36, A at level 60,
format "'[' \big [ op / idx ]_ ( i '\in' A ) '/ ' F ']'").
Reserved Notation "\sum_ ( i '\in' A ) F"
(F at level 41, A at level 60,
format "'[' \sum_ ( i '\in' A ) '/ ' F ']'").
Unset SsrOldRewriteGoalsOrder.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Import Order.TTheory GRing.Theory Num.Def Num.Theory.
Local Open Scope classical_set_scope.
Local Open Scope ring_scope.
Notation "\big [ op / idx ]_ ( i '\in' A ) F"Source code :=
(\big[op/idx]_(iSource code <- fset_set (A `&` ((fun iSource code => F) @^-1` [set~ idx]))) F)
(only parsing) : big_scope.
Lemma finite_index_keySource code : unit
Proof.
Used by
- mathcomp.analysis.ereal
Source code {ISource code : choiceType} {TSource code : Type} (idxSource code : T) (DSource code : set I)
(FSource code : I -> T) : seq I :=
locked_with finite_index_key (fset_set (D `&` F @^-1` [set~ idx] : set I)).
Notation "\big [ op / idx ]_ ( i '\in' D ) F"Source code :=
(\big[op/idx]_(iSource code <- finite_support idx D (fun iSource code => F)) F)
: big_scope.
Lemma in_finite_supportUsed by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
Source code (TSource code : Type) (JSource code : choiceType) (iSource code : T) (PSource code : set J)
(FSource code : J -> T) : finite_set (P `&` F @^-1` [set~ i]) ->
finite_support i P F =i P `&` F @^-1` [set~ i].
Proof.
Lemma finite_support_uniqSource code (TSource code : Type) (JSource code : choiceType) (iSource code : T) (PSource code : set J)
(FSource code : J -> T) : uniq (finite_support i P F).
Proof.
Lemma no_finite_supportSource code (TSource code : Type) (JSource code : choiceType) (iSource code : T) (PSource code : set J)
(FSource code : J -> T) : infinite_set (P `&` F @^-1` [set~ i]) ->
finite_support i P F = [::].
Proof.
Lemma eq_finite_supportUsed by
- mathcomp.analysis.ereal
Source code {ISource code : choiceType} {TSource code : Type} (idxSource code : T) (DSource code : set I)
(FSource code GSource code : I -> T) : {in D, F =1 G} ->
finite_support idx D F = finite_support idx D G.
Proof.
Variant finite_support_specSource code RSource code (TSource code : choiceType)
(PSource code : set T) (FSource code : T -> R) (idxSource code : R) : seq T -> Type :=
| NoFiniteSupportSource code of infinite_set (P `&` F @^-1` [set~ idx]) :
finite_support_spec P F idx [::]
| FiniteSupportSource code (XSource code : {fset T}) of [set` X] `<=` P
& (forall iSource code, P i -> i \notin X -> F i = idx)
& [set` X] = (P `&` F @^-1` [set~ idx]) :
finite_support_spec P F idx X.
Lemma finite_supportPUsed by
- mathcomp.analysis.ereal
Source code RSource code (TSource code : choiceType) (PSource code : set T) (FSource code : T -> R) (idxSource code : R) :
finite_support_spec P F idx (finite_support idx P F).
Proof.
Notation "\sum_ ( i '\in' A ) F"Source code := (\big[+%R/0%R]_(iSource code \in A) F) : ring_scope.
Lemma eq_fsbiglSource code (RSource code : Type) (idxSource code : R) (opSource code : R -> R -> R)
(TSource code : choiceType) (fSource code : T -> R) (PSource code QSource code : set T) :
P = Q -> \big[op/idx]_(xSource code \in P) f x = \big[op/idx]_(xSource code \in Q) f x.
Proof.
by move=> ->. Qed.
Lemma eq_fsbigrUsed by
- mathcomp.analysis.esum
- mathcomp.analysis.probability_theory.independence
- mathcomp.analysis.probability_theory.uniform_distribution
- mathcomp.analysis.probability_theory.bernoulli_distribution
- mathcomp.analysis.measure_theory.measure_function
- mathcomp.analysis.measure_theory.dirac_measure
- mathcomp.analysis.kernel
- mathcomp.analysis.ereal
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
- mathcomp.analysis.lebesgue_integral_theory.giry
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_Rintegral
- mathcomp.analysis.lebesgue_integral_theory.simple_functions
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_fubini
- mathcomp.analysis.lebesgue_integral_theory.counting_lebesgue
- mathcomp.analysis.lebesgue_integral_theory.radon_nikodym
Source code (RSource code : Type) (idxSource code : R) (opSource code : Monoid.com_law idx)
(TSource code : choiceType) (fSource code gSource code : T -> R) (PSource code : set T) :
{in P, f =1 g} -> (\big[op/idx]_(xSource code \in P) f x = \big[op/idx]_(xSource code \in P) g x).
Proof.
move=> fg; rewrite (eq_finite_support _ fg); apply: eq_big_seq => x.
by case: finite_supportP => //= X XP _ gidx xX; rewrite fg // ?inE; apply/XP.
Qed.
by case: finite_supportP => //= X XP _ gidx xX; rewrite fg // ?inE; apply/XP.
Qed.
Lemma fsbigTESource code (RSource code : Type) (idxSource code : R) (opSource code : Monoid.com_law idx) (TSource code : choiceType)
(ASource code : {fset T}) (fSource code : T -> R) :
(forall iSource code, i \notin A -> f i = idx) ->
\big[op/idx]_(iSource code \in [set: T]) f i = \big[op/idx]_(iSource code <- A) f i.
Proof.
elim/Peq: R => R in idx op f *.
move=> Af; have Afin : finite_set (f @^-1` [set~ idx]).
by apply: (finite_subfset A) => x; apply: contra_notT => /Af.
rewrite [in RHS](big_fsetID _ [pred xSource code | f x == idx])/=.
rewrite [X in _ = op X _]big_fset [X in _ = op X _]big1 ?Monoid.simpm//.
by move=> i /= /eqP.
apply eq_fbigl => r.
rewrite in_finite_support// ?setTI// /preimage/=; apply/idP/idP => /=.
rewrite !inE/=; apply: contra_notP => /negP.
by rewrite negb_and negbK => /orP[|/eqP//]; exact: Af.
by rewrite !inE/= => /andP[_ /eqP].
Qed.
move=> Af; have Afin : finite_set (f @^-1` [set~ idx]).
by apply: (finite_subfset A) => x; apply: contra_notT => /Af.
rewrite [in RHS](big_fsetID _ [pred xSource code | f x == idx])/=.
rewrite [X in _ = op X _]big_fset [X in _ = op X _]big1 ?Monoid.simpm//.
by move=> i /= /eqP.
apply eq_fbigl => r.
rewrite in_finite_support// ?setTI// /preimage/=; apply/idP/idP => /=.
rewrite !inE/=; apply: contra_notP => /negP.
by rewrite negb_and negbK => /orP[|/eqP//]; exact: Af.
by rewrite !inE/= => /andP[_ /eqP].
Qed.
Lemma fsbig_mkcondSource code (RSource code : Type) (idxSource code : R) (opSource code : Monoid.com_law idx)
(TSource code : choiceType) (ASource code : set T) (fSource code : T -> R) :
\big[op/idx]_(iSource code \in A) f i =
\big[op/idx]_(iSource code \in [set: T]) patch (fun=> idx) A f i.
Proof.
elim/Peq: R => R in idx op f *.
rewrite -big_mkcond/= -[in RHS]big_filter; apply: perm_big.
rewrite uniq_perm ?filter_uniq//= => i; rewrite mem_filter.
set g := fun iSource code => if i \in A then f i else idx.
have gAf : setT `&` g @^-1` [set~ idx] = (A `&` f @^-1` [set~ idx]).
rewrite setTI; apply/predeqP => x; split; rewrite /preimage/g/=.
by case: ifPn; rewrite (inE, notin_setE).
by case: ifPn; rewrite (inE, notin_setE) => ? [].
case: finite_supportP => //.
rewrite -gAf; case: finite_supportP=> //=; first by rewrite ?inE andbF.
by move=> X _ gidx <-//.
move=> X XA fidx XE; case: finite_supportP; rewrite gAf -?XE//=.
move=> Y _ gidx /predeqP/=/(_ _)/propext YX.
by apply/idP/andP => [|[]]; rewrite YX// inE => Xi; split=> //; apply: XA.
Qed.
rewrite -big_mkcond/= -[in RHS]big_filter; apply: perm_big.
rewrite uniq_perm ?filter_uniq//= => i; rewrite mem_filter.
set g := fun iSource code => if i \in A then f i else idx.
have gAf : setT `&` g @^-1` [set~ idx] = (A `&` f @^-1` [set~ idx]).
rewrite setTI; apply/predeqP => x; split; rewrite /preimage/g/=.
by case: ifPn; rewrite (inE, notin_setE).
by case: ifPn; rewrite (inE, notin_setE) => ? [].
case: finite_supportP => //.
rewrite -gAf; case: finite_supportP=> //=; first by rewrite ?inE andbF.
by move=> X _ gidx <-//.
move=> X XA fidx XE; case: finite_supportP; rewrite gAf -?XE//=.
move=> Y _ gidx /predeqP/=/(_ _)/propext YX.
by apply/idP/andP => [|[]]; rewrite YX// inE => Xi; split=> //; apply: XA.
Qed.
Lemma fsbig_mkcondrSource code (RSource code : Type) (idxSource code : R) (opSource code : Monoid.com_law idx)
(TSource code : choiceType) (ISource code JSource code : set T) (aSource code : T -> R) :
\big[op/idx]_(iSource code \in I `&` J) a i =
\big[op/idx]_(iSource code \in I) if i \in J then a i else idx.
Proof.
Lemma fsbig_mkcondlSource code (RSource code : Type) (idxSource code : R) (opSource code : Monoid.com_law idx)
(TSource code : choiceType) (ISource code JSource code : set T) (aSource code : T -> R) :
\big[op/idx]_(iSource code \in I `&` J) a i =
\big[op/idx]_(iSource code \in J) if i \in I then a i else idx.
Proof.
Lemma bigfsSource code (RSource code : Type) (idxSource code : R) (opSource code : Monoid.com_law idx) (TSource code : choiceType)
(rSource code : seq T) (PSource code : {pred T}) (fSource code : T -> R) : uniq r ->
(forall iSource code, P i -> i \notin r -> f i = idx) ->
\big[op/idx]_(iSource code <- r | P i) f i = \big[op/idx]_(iSource code \in [set` P]) f i.
Proof.
Lemma fsbigEUsed by
- mathcomp.experimental_reals.realsum
Source code (RSource code : Type) (idxSource code : R) (opSource code : Monoid.com_law idx) (TSource code : choiceType)
(ASource code : set T) (rSource code : seq T) (fSource code : T -> R) :
uniq r ->
[set` r] `<=` A ->
(forall iSource code, A i -> i \notin r -> f i = idx) ->
\big[op/idx]_(iSource code \in A) f i = \big[op/idx]_(iSource code <- r | i \in A) f i.
Proof.
move=> r_uniq rQ fidx; rewrite [RHS]bigfs ?set_mem_set//=.
by move=> i; rewrite inE; apply: fidx.
Qed.
by move=> i; rewrite inE; apply: fidx.
Qed.
Lemma fsbig_seqUsed by
- mathcomp.analysis.esum
- mathcomp.analysis.probability_theory.independence
- mathcomp.analysis.measure_theory.measure_function
Source code (RSource code : Type) (idxSource code : R) (opSource code : Monoid.com_law idx)
(ISource code : choiceType) (rSource code : seq I) (FSource code : I -> R) :
uniq r ->
\big[op/idx]_(aSource code <- r) F a = \big[op/idx]_(aSource code \in [set` r]) F a.
Proof.
move=> ur; rewrite (fsbigE r)//=; first by move=> + ->.
by rewrite mem_setE big_seq_cond big_mkcondr.
Qed.
by rewrite mem_setE big_seq_cond big_mkcondr.
Qed.
Lemma fsbig1Used by
- mathcomp.analysis.esum
- mathcomp.analysis.numfun
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
Source code (RSource code : Type) (idxSource code : R) (opSource code : Monoid.law idx) (ISource code : choiceType)
(PSource code : set I) (FSource code : I -> R) :
(forall iSource code, P i -> F i = idx) -> \big[op/idx]_(iSource code \in P) F i = idx.
Proof.
move=> PF0; rewrite big1_seq// => i/=; case: finite_supportP=> //=.
by move=> X XP _ _ Xi; rewrite PF0//; apply/XP.
Qed.
by move=> X XP _ _ Xi; rewrite PF0//; apply/XP.
Qed.
Lemma fsbig_dfltSource code (RSource code : Type) (idxSource code : R) (opSource code : Monoid.law idx) (ISource code : choiceType)
(PSource code : set I) (FSource code : I -> R) :
infinite_set (P `&` F @^-1` [set~ idx])-> \big[op/idx]_(iSource code \in P) F i = idx.
Proof.
Lemma fsbig_widenUsed by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
- mathcomp.analysis.lebesgue_integral_theory.simple_functions
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
Source code (TSource code : choiceType) [RSource code : Type] [idxSource code : R]
(opSource code : Monoid.com_law idx) (PSource code DSource code : set T) (fSource code : T -> R) :
P `<=` D ->
D `\` P `<=` f @^-1` [set idx] ->
\big[op/idx]_(iSource code \in P) f i = \big[op/idx]_(iSource code \in D) f i.
Proof.
move=> PD DPf; rewrite fsbig_mkcond [RHS]fsbig_mkcond.
apply: eq_fsbigr => x _; rewrite /patch; case: ifPn; rewrite (inE, notin_setE).
by move=> Px; rewrite ifT// inE; apply: PD.
by move=> Px; case: ifP => //; rewrite inE => Dx; rewrite DPf.
Qed.
apply: eq_fsbigr => x _; rewrite /patch; case: ifPn; rewrite (inE, notin_setE).
by move=> Px; rewrite ifT// inE; apply: PD.
by move=> Px; case: ifP => //; rewrite inE => Dx; rewrite DPf.
Qed.
Lemma fsbig_suppSource code (TSource code : choiceType) [RSource code : Type] [idxSource code : R]
(opSource code : Monoid.com_law idx) (PSource code : set T) (fSource code : T -> R) :
\big[op/idx]_(iSource code \in P) f i = \big[op/idx]_(iSource code \in P `&` f @^-1` [set~ idx]) f i.
Proof.
Lemma fsbig_fwidenSource code (TSource code : choiceType) [RSource code : eqType] [idxSource code : R]
(opSource code : Monoid.com_law idx)
(rSource code : seq T) (PSource code : set T) (fSource code : T -> R) :
P `<=` [set` r] ->
uniq r ->
[set iSource code | i \in r] `\` P `<=` f @^-1` [set idx] ->
\big[op/idx]_(iSource code \in P) f i = \big[op/idx]_(iSource code <- r) f i.
Proof.
Lemma fsbig_set0Used by
- mathcomp.analysis.esum
- mathcomp.analysis.probability_theory.bernoulli_distribution
- mathcomp.analysis.measure_theory.measure_function
Source code (RSource code : Type) (idxSource code : R) (opSource code : Monoid.com_law idx) (TSource code : choiceType)
(FSource code : T -> R) : \big[op/idx]_(xSource code \in set0) F x = idx.
Lemma fsbig_set1Used by
- mathcomp.analysis.esum
- mathcomp.analysis.probability_theory.independence
- mathcomp.analysis.probability_theory.bernoulli_distribution
- mathcomp.analysis.measure_theory.measure_function
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
Source code (RSource code : Type) (idxSource code : R) (opSource code : Monoid.com_law idx) (TSource code : choiceType) xSource code
(FSource code : T -> R) : \big[op/idx]_(ySource code \in [set x]) F y = F x.
Proof.
Lemma __deprecated__full_fsbigIDSource code (RSource code : Type) (idxSource code : R) (opSource code : Monoid.com_law idx)
(ISource code : choiceType) (BSource code : set I) (ASource code : set I) (FSource code : I -> R) :
finite_set (A `&` F @^-1` [set~ idx]) ->
\big[op/idx]_(iSource code \in A) F i = op (\big[op/idx]_(iSource code \in A `&` B) F i)
(\big[op/idx]_(iSource code \in A `&` ~` B) F i).
Proof.
move=> finF.
have fsbig_setI C : \big[op/idx]_(iSource code <-
[fset x | xSource code in fset_set (A `&` F @^-1` [set~ idx]) & x \in C]%fset) F i =
\big[op/idx]_(iSource code \in A `&` C) F i.
apply: eq_fbigl => i /=; apply/idP/idP.
rewrite !inE/= => /andP[+ Bi]; rewrite in_fset_set// inE => -[Ai Fi].
rewrite unlock in_fset_set ?inE// setIAC; last by rewrite inE in Bi.
exact/finite_setIl.
rewrite unlock in_fset_set; first by rewrite setIAC; exact/finite_setIl.
by rewrite inE => -[[Ai Bi] Fi0]; rewrite !inE/= in_fset_set// !mem_set.
rewrite (big_fsetID _ [pred iSource code | i \in B])/= [locked_with _ _]unlock.
rewrite fsbig_setI; congr (op _ _); rewrite -fsbig_setI.
by apply eq_fbigl => i; rewrite !inE in_setC.
Qed.
have fsbig_setI C : \big[op/idx]_(iSource code <-
[fset x | xSource code in fset_set (A `&` F @^-1` [set~ idx]) & x \in C]%fset) F i =
\big[op/idx]_(iSource code \in A `&` C) F i.
apply: eq_fbigl => i /=; apply/idP/idP.
rewrite !inE/= => /andP[+ Bi]; rewrite in_fset_set// inE => -[Ai Fi].
rewrite unlock in_fset_set ?inE// setIAC; last by rewrite inE in Bi.
exact/finite_setIl.
rewrite unlock in_fset_set; first by rewrite setIAC; exact/finite_setIl.
by rewrite inE => -[[Ai Bi] Fi0]; rewrite !inE/= in_fset_set// !mem_set.
rewrite (big_fsetID _ [pred iSource code | i \in B])/= [locked_with _ _]unlock.
rewrite fsbig_setI; congr (op _ _); rewrite -fsbig_setI.
by apply eq_fbigl => i; rewrite !inE in_setC.
Qed.
Lemma fsbigIDSource code (RSource code : Type) (idxSource code : R) (opSource code : Monoid.com_law idx)
(ISource code : choiceType) (BSource code : set I) (ASource code : set I) (FSource code : I -> R) :
finite_set A ->
\big[op/idx]_(iSource code \in A) F i = op (\big[op/idx]_(iSource code \in A `&` B) F i)
(\big[op/idx]_(iSource code \in A `&` ~` B) F i).
Proof.
#[deprecated(note="Use fsbigID instead")]
Notation full_fsbigIDSource code := __deprecated__full_fsbigID (only parsing).
Lemma fsbigUUsed by
- mathcomp.analysis.probability_theory.bernoulli_distribution
- mathcomp.analysis.measure_theory.measure_function
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
Source code (RSource code : Type) (idxSource code : R) (opSource code : Monoid.com_law idx)
(ISource code : choiceType) (ASource code BSource code : set I) (FSource code : I -> R) :
finite_set A -> finite_set B -> A `&` B `<=` F @^-1` [set idx] ->
\big[op/idx]_(iSource code \in A `|` B) F i =
op (\big[op/idx]_(iSource code \in A) F i) (\big[op/idx]_(iSource code \in B) F i).
Proof.
Lemma fsbigU0Used by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
Source code (RSource code : Type) (idxSource code : R) (opSource code : Monoid.com_law idx)
(ISource code : choiceType) (ASource code BSource code : set I) (FSource code : I -> R) :
finite_set A -> finite_set B -> A `&` B `<=` set0 ->
\big[op/idx]_(iSource code \in A `|` B) F i =
op (\big[op/idx]_(iSource code \in A) F i) (\big[op/idx]_(iSource code \in B) F i).
Proof.
Lemma fsbigD1Used by
- mathcomp.analysis.ereal
- mathcomp.analysis.numfun
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
Source code (RSource code : Type) (idxSource code : R) (opSource code : Monoid.com_law idx)
(ISource code : choiceType) (iSource code : I) (ASource code : set I) (FSource code : I -> R) :
finite_set A -> A i ->
\big[op/idx]_(jSource code \in A) F j = op (F i) (\big[op/idx]_(jSource code \in A `\ i) F j).
Arguments fsbigD1 {R idx op I} i A F.
Lemma full_fsbig_distrrSource code (RSource code : Type) (zeroSource code : R) (timesSource code : Monoid.mul_law zero)
(plusSource code : Monoid.add_law zero times) (ISource code : choiceType) (aSource code : R) (PSource code : set I)
(FSource code : I -> R) :
finite_set (P `&` F @^-1` [set~ zero]) ->
times a (\big[plus/zero]_(iSource code \in P) F i) =
\big[plus/zero]_(iSource code \in P) times a (F i).
Proof.
move=> finF; elim/Peq : R => R in zero times plus a F finF *.
have [->|a0] := eqVneq a zero.
by rewrite Monoid.mul0m fsbig1//; move=> i _; rewrite Monoid.mul0m.
#[warning="deprecated"] (* FIXME *)
rewrite big_distrr [RHS](full_fsbigID (F @^-1` [set zero])).
apply: sub_finite_set finF => x /= [Px aFN0].
by split=> //; apply: contra_not aFN0 => ->; rewrite Monoid.simpm.
set b0 := bigop _ _ _.
set b1 := bigop _ _ _.
set b2 := bigop _ _ _.
rewrite (_ : b1 = zero) ?Monoid.simpm.
by rewrite /b1 fsbig1// => i [_ ->]; rewrite Monoid.simpm.
apply/esym/fsbig_fwiden => //.
by move=> x [Px Fx0]; rewrite /= in_finite_support// inE.
move=> i []; rewrite /preimage/= in_finite_support //.
by rewrite !inE => -[Pi]; rewrite /preimage/= => Fi0; tauto.
Qed.
have [->|a0] := eqVneq a zero.
by rewrite Monoid.mul0m fsbig1//; move=> i _; rewrite Monoid.mul0m.
#[warning="deprecated"] (* FIXME *)
rewrite big_distrr [RHS](full_fsbigID (F @^-1` [set zero])).
apply: sub_finite_set finF => x /= [Px aFN0].
by split=> //; apply: contra_not aFN0 => ->; rewrite Monoid.simpm.
set b0 := bigop _ _ _.
set b1 := bigop _ _ _.
set b2 := bigop _ _ _.
rewrite (_ : b1 = zero) ?Monoid.simpm.
by rewrite /b1 fsbig1// => i [_ ->]; rewrite Monoid.simpm.
apply/esym/fsbig_fwiden => //.
by move=> x [Px Fx0]; rewrite /= in_finite_support// inE.
move=> i []; rewrite /preimage/= in_finite_support //.
by rewrite !inE => -[Pi]; rewrite /preimage/= => Fi0; tauto.
Qed.
Lemma fsbig_distrrSource code (RSource code : Type) (zeroSource code : R) (timesSource code : Monoid.mul_law zero)
(plusSource code : Monoid.add_law zero times) (ISource code : choiceType) (aSource code : R) (PSource code : set I)
(FSource code : I -> R) :
finite_set P ->
times a (\big[plus/zero]_(iSource code \in P) F i) =
\big[plus/zero]_(iSource code \in P) times a (F i).
Proof.
Lemma mulr_fsumrUsed by
- mathcomp.analysis.probability_theory.independence
Source code (RSource code : idomainType) (ISource code : choiceType) aSource code (PSource code : set I) (FSource code : I -> R) :
a * (\sum_(iSource code \in P) F i) = \sum_(iSource code \in P) a * F i.
Proof.
have [->|aN0] := eqVneq a 0; first by rewrite mul0r big1// => i; rewrite mul0r.
case: (pselect (finite_set (P `&` F @^-1` [set~ 0]))) => PFfin.
exact: full_fsbig_distrr.
rewrite !fsbig_dflt ?mulr0//; apply: contra_not PFfin; apply: sub_finite_set.
by move=> x [Px /eqP Fx0]; split=> //=; apply/eqP; rewrite mulf_neq0.
Qed.
case: (pselect (finite_set (P `&` F @^-1` [set~ 0]))) => PFfin.
exact: full_fsbig_distrr.
rewrite !fsbig_dflt ?mulr0//; apply: contra_not PFfin; apply: sub_finite_set.
by move=> x [Px /eqP Fx0]; split=> //=; apply/eqP; rewrite mulf_neq0.
Qed.
Lemma mulr_fsumlUsed by
- mathcomp.analysis.probability_theory.independence
Source code (RSource code : idomainType) (ISource code : choiceType) aSource code (PSource code : set I) (FSource code : I -> R) :
(\sum_(iSource code \in P) F i) * a = \sum_(iSource code \in P) (F i * a).
Proof.
Lemma fsbig_ordUsed by
- mathcomp.analysis.probability_theory.binomial_distribution
- mathcomp.analysis.measure_theory.measure_function
Source code RSource code (idxSource code : R) (opSource code : Monoid.com_law idx) nSource code (FSource code : nat -> R) :
\big[op/idx]_(aSource code < n) F a = \big[op/idx]_(aSource code \in `I_n) F a.
Proof.
Lemma fsbig_finiteUsed by
- mathcomp.analysis.esum
- mathcomp.analysis.probability_theory.independence
- mathcomp.analysis.probability_theory.bernoulli_distribution
- mathcomp.analysis.real_measure.lebesgue_measure
- mathcomp.analysis.real_measure.lebesgue_stieltjes_measure
- mathcomp.analysis.measure_theory.measure_extension
- mathcomp.analysis.measure_theory.measure_function
- mathcomp.analysis.measure_theory.dirac_measure
- mathcomp.analysis.ereal
- mathcomp.analysis.topology_theory.separation_axioms
- mathcomp.analysis.numfun
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
- mathcomp.analysis.lebesgue_integral_theory.simple_functions
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
- mathcomp.analysis.lebesgue_integral_theory.counting_lebesgue
- mathcomp.analysis.lebesgue_integral_theory.measurable_fun_approximation
- mathcomp.experimental_reals.realsum
Source code (RSource code : Type) (idxSource code : R) (opSource code : Monoid.com_law idx) (TSource code : choiceType)
(DSource code : set T) (FSource code : T -> R) : finite_set D ->
\big[op/idx]_(xSource code \in D) F x = \big[op/idx]_(xSource code <- fset_set D) F x.
Proof.
Section fsbig2.
Variables (RSource code : Type) (idxSource code : R) (opSource code : Monoid.com_law idx).
Lemma reindex_fsbigUsed by
- mathcomp.analysis.measure_theory.measure_function
Source code {ISource code JSource code : choiceType} (hSource code : I -> J) PSource code QSource code
(FSource code : J -> R) : set_bij P Q h ->
\big[op/idx]_(jSource code \in Q) F j = \big[op/idx]_(iSource code \in P) F (h i).
Proof.
elim/choicePpointed: I => I in h P *.
rewrite !emptyE => /Pbij[{}h ->].
by rewrite -[in LHS](image_eq h) image_set0 !fsbig_set0.
elim/choicePpointed: J => J in F h Q *; first by have := no (h point).
move=> /(@pPbij _ _ _)[{}h ->].
pose A := P `&` (F \o h) @^-1` [set~ idx].
pose B := Q `&` F @^-1` [set~ idx].
have /(@pPbij _ _ _)[g gh] : set_bij A B h.
apply: splitbij_sub; rewrite /A /B /preimage //=.
by move=> x [Px Fhx]; split=> //; apply: funS.
by move=> x [Qx Fx]; split; rewrite ?invK ?inE//; apply: funS.
case: finite_supportP; rewrite ?big_nil//=.
case: finite_supportP; rewrite ?big_nil//=.
move=> X XP _ XE []; rewrite -/B -(image_eq g) /A.
by apply: finite_image; rewrite -XE.
move=> Y YQ Fidx YE; case: finite_supportP.
move=> []; rewrite -/A -(image_eq [bij of g^-1%FUN]).
by apply: finite_image; rewrite /B -YE.
move=> X XP Fhidx XE; suff -> : Y = (h @` X)%fset.
by rewrite big_imfset// => ? ? ? ? /inj; apply; rewrite inE; apply: XP.
have BY j : (B j) = (j \in Y) by rewrite -[RHS]/([set` Y] j) YE.
have AX i : (A i) = (i \in X) by rewrite -[RHS]/([set` X] i) XE.
rewrite gh; apply/fsetP=> j; apply/idP/imfsetP => [Yj | [i iX ->]]; last first.
by rewrite -BY; apply: funS; rewrite AX.
by exists (g^-1%FUN j); rewrite ?invK ?inE ?BY// -AX; apply: funS; rewrite BY.
Qed.
rewrite !emptyE => /Pbij[{}h ->].
by rewrite -[in LHS](image_eq h) image_set0 !fsbig_set0.
elim/choicePpointed: J => J in F h Q *; first by have := no (h point).
move=> /(@pPbij _ _ _)[{}h ->].
pose A := P `&` (F \o h) @^-1` [set~ idx].
pose B := Q `&` F @^-1` [set~ idx].
have /(@pPbij _ _ _)[g gh] : set_bij A B h.
apply: splitbij_sub; rewrite /A /B /preimage //=.
by move=> x [Px Fhx]; split=> //; apply: funS.
by move=> x [Qx Fx]; split; rewrite ?invK ?inE//; apply: funS.
case: finite_supportP; rewrite ?big_nil//=.
case: finite_supportP; rewrite ?big_nil//=.
move=> X XP _ XE []; rewrite -/B -(image_eq g) /A.
by apply: finite_image; rewrite -XE.
move=> Y YQ Fidx YE; case: finite_supportP.
move=> []; rewrite -/A -(image_eq [bij of g^-1%FUN]).
by apply: finite_image; rewrite /B -YE.
move=> X XP Fhidx XE; suff -> : Y = (h @` X)%fset.
by rewrite big_imfset// => ? ? ? ? /inj; apply; rewrite inE; apply: XP.
have BY j : (B j) = (j \in Y) by rewrite -[RHS]/([set` Y] j) YE.
have AX i : (A i) = (i \in X) by rewrite -[RHS]/([set` X] i) XE.
rewrite gh; apply/fsetP=> j; apply/idP/imfsetP => [Yj | [i iX ->]]; last first.
by rewrite -BY; apply: funS; rewrite AX.
by exists (g^-1%FUN j); rewrite ?invK ?inE ?BY// -AX; apply: funS; rewrite BY.
Qed.
Lemma fsbig_imageUsed by
- mathcomp.analysis.measure_theory.measure_function
Source code {ISource code JSource code : choiceType} PSource code (hSource code : I -> J) (FSource code : J -> R) : set_inj P h ->
\big[op/idx]_(jSource code \in h @` P) F j = \big[op/idx]_(iSource code \in P) F (h i).
Proof.
Lemma __deprecated__reindex_insideSource code {ISource code JSource code : choiceType} PSource code QSource code (hSource code : I -> J) (FSource code : J -> R) :
bijective h -> P `<=` h @` Q -> Q `<=` h @^-1` P ->
\big[op/idx]_(jSource code \in P) F j = \big[op/idx]_(iSource code \in Q) F (h i).
Proof.
Lemma reindex_fsbigTUsed by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
Source code {ISource code JSource code : choiceType} (hSource code : I -> J) (FSource code : J -> R) :
bijective h ->
\big[op/idx]_(jSource code \in [set: J]) F j = \big[op/idx]_(iSource code \in [set: I]) F (h i).
Proof.
End fsbig2.
Arguments reindex_fsbig {R idx op I J} _ _ _.
Arguments fsbig_image {R idx op I J} _ _.
Arguments __deprecated__reindex_inside {R idx op I J} _ _.
Arguments reindex_fsbigT {R idx op I J} _ _.
#[deprecated(note="use reindex_fsbig, fsbig_image or reindex_fsbigT instead")]
Notation reindex_insideSource code := __deprecated__reindex_inside (only parsing).
#[deprecated(note="use reindex_fsbigT instead")]
Notation reindex_inside_setTSource code := reindex_fsbigT (only parsing).
Lemma fsbigN1Source code (RSource code : eqType) (idxSource code : R) (opSource code : Monoid.com_law idx)
(T1Source code T2Source code : choiceType) (QSource code : set T2) (fSource code : T1 -> T2 -> R) (xSource code : T1) :
\big[op/idx]_(ySource code \in Q) f x y != idx -> exists2 ySource code, Q y & f x y != idx.
Proof.
Lemma fsbig_splitUsed by
- mathcomp.analysis.esum
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
Source code (TSource code : choiceType) (RSource code : eqType) (idxSource code : R)
(opSource code : Monoid.com_law idx) (PSource code : set T) (fSource code gSource code : T -> R) : finite_set P ->
\big[op/idx]_(xSource code \in P) op (f x) (g x) =
op (\big[op/idx]_(xSource code \in P) f x) (\big[op/idx]_(xSource code \in P) g x).
Proof.
Lemma fsumr_ge0Source code (RSource code : numDomainType) (ISource code : choiceType) (PSource code : set I) (FSource code : I -> R) :
(forall iSource code, P i -> 0 <= F i) -> 0 <= \sum_(iSource code \in P) F i.
Proof.
move=> PF; case: finite_supportP; rewrite ?big_nil// => X XP F0 _.
by rewrite big_seq_cond big_mkcondr sumr_ge0// => i /XP/PF.
Qed.
by rewrite big_seq_cond big_mkcondr sumr_ge0// => i /XP/PF.
Qed.
Lemma fsumr_le0Source code (RSource code : numDomainType) (ISource code : choiceType) (PSource code : set I) (FSource code : I -> R) :
(forall iSource code, P i -> F i <= 0) -> \sum_(iSource code \in P) F i <= 0.
Proof.
move=> PF; case: finite_supportP; rewrite ?big_nil// => X XP F0 _.
by rewrite big_seq_cond big_mkcondr sumr_le0// => i /XP/PF.
Qed.
by rewrite big_seq_cond big_mkcondr sumr_le0// => i /XP/PF.
Qed.
Lemma fsumr_gt0Source code (RSource code : realDomainType) (ISource code : choiceType) (rSource code : seq I) (PSource code : set I)
(FSource code : I -> R) :
0 < \sum_(iSource code \in P) F i -> exists2 iSource code, P i & 0 < F i.
Proof.
Lemma fsumr_lt0Source code (RSource code : realDomainType) (ISource code : choiceType) (PSource code : set I)
(FSource code : I -> R) :
\sum_(iSource code \in P) F i < 0 -> exists2 iSource code, P i & F i < 0.
Proof.
Lemma pfsumr_eq0Source code (RSource code : realDomainType) (ISource code : choiceType) (PSource code : set I)
(FSource code : I -> R) :
finite_set P ->
(forall iSource code, P i -> 0 <= F i) ->
\sum_(iSource code \in P) F i = 0 -> forall iSource code, P i -> F i = 0.
Proof.
Lemma fsbig_setUUsed by
- mathcomp.analysis.measure_theory.measure_function
- mathcomp.analysis.topology_theory.sigT_topology
- mathcomp.analysis.homotopy_theory.wedge_sigT
- mathcomp.analysis.lebesgue_integral_theory.simple_functions
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
Source code {TSource code} {ISource code : choiceType} (ASource code : set I) (FSource code : I -> set T) :
finite_set A ->
\big[setU/set0]_(iSource code \in A) F i = \bigcup_(iSource code in A) F i.
Proof.
Lemma fsbig_setU_set1Used by
- mathcomp.analysis.topology_theory.separation_axioms
Source code {TSource code : choiceType} (ASource code : set T) :
finite_set A -> \big[setU/set0]_(xSource code \in A) [set x] = A.
Proof.
Lemma pair_fsbigSource code (RSource code : Type) (idxSource code : R) (opSource code : Monoid.com_law idx)
(ISource code JSource code : choiceType) (PSource code : set I) (QSource code : set J) (FSource code : I -> J -> R) :
finite_set P -> finite_set Q ->
\big[op/idx]_(iSource code \in P) \big[op/idx]_(jSource code \in Q) F i j
= \big[op/idx]_(pSource code \in P `*` Q) F p.1 p.2.
Proof.
move=> Pfin Qfin; have PQfin : finite_set (P `*` Q) by exact: finite_setX.
rewrite !fsbig_finite//=; under eq_bigr do rewrite fsbig_finite//=.
rewrite pair_big_dep_cond/= fset_setX//.
apply: eq_fbigl => -[i j] //=; apply/imfset2P/idP; rewrite inE //=.
by move=> [x + [y + [-> ->]]]; rewrite 4!inE/= !andbT/= => -> ->.
move=> /andP[Pi Qi]; exists i; rewrite 2?inE ?andbT//.
by exists j; rewrite 2?inE ?andbT.
Qed.
rewrite !fsbig_finite//=; under eq_bigr do rewrite fsbig_finite//=.
rewrite pair_big_dep_cond/= fset_setX//.
apply: eq_fbigl => -[i j] //=; apply/imfset2P/idP; rewrite inE //=.
by move=> [x + [y + [-> ->]]]; rewrite 4!inE/= !andbT/= => -> ->.
move=> /andP[Pi Qi]; exists i; rewrite 2?inE ?andbT//.
by exists j; rewrite 2?inE ?andbT.
Qed.
Lemma exchange_fsbigUsed by
- mathcomp.analysis.measure_theory.measure_function
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
Source code (RSource code : Type) (idxSource code : R) (opSource code : Monoid.com_law idx)
(ISource code JSource code : choiceType) (PSource code : set I) (QSource code : set J) (FSource code : I -> J -> R) :
finite_set P -> finite_set Q ->
\big[op/idx]_(iSource code \in P) \big[op/idx]_(jSource code \in Q) F i j
= \big[op/idx]_(jSource code \in Q) \big[op/idx]_(iSource code \in P) F i j.
Proof.
move=> Pfin Qfin; rewrite 2?pair_fsbig//; pose swap (xSource code : I * J) := (x.2, x.1).
apply/esym/(reindex_fsbig swap).
split=> [? [? ?]//|[? ?] [? ?] /set_mem[? ?] /set_mem[? ?] [-> ->]//|].
by move=> [i j] [? ?]; exists (j, i).
Qed.
apply/esym/(reindex_fsbig swap).
split=> [? [? ?]//|[? ?] [? ?] /set_mem[? ?] /set_mem[? ?] [-> ->]//|].
by move=> [i j] [? ?]; exists (j, i).
Qed.