fact stringlengths 8 1.54k | type stringclasses 19 values | library stringclasses 8 values | imports listlengths 1 10 | filename stringclasses 98 values | symbolic_name stringlengths 1 42 | docstring stringclasses 1 value |
|---|---|---|---|---|---|---|
big_change_idxI x r (P : pred I) F :
\big[*%M/x]_(j <- r | P j) F j = (\big[*%M/1]_(j <- r | P j) F j) * x.
Proof.
elim: r => [|i r]; rewrite ?(big_nil, big_cons, mul1m)// => ->.
by case: ifP => // Pi; rewrite mulmA.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_change_idx | |
big1_eqI r (P : pred I) : \big[*%M/1]_(i <- r | P i) 1 = 1.
Proof. by rewrite big1_idem //= mul1m. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big1_eq | |
big1I r (P : pred I) F :
(forall i, P i -> F i = 1) -> \big[*%M/1]_(i <- r | P i) F i = 1.
Proof. by move/(eq_bigr _)->; apply: big1_eq. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big1 | |
big1_seq(I : eqType) r (P : pred I) F :
(forall i, P i && (i \in r) -> F i = 1) ->
\big[*%M/1]_(i <- r | P i) F i = 1.
Proof. by move=> eqF1; rewrite big_seq_cond big_andbC big1. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big1_seq | |
big_seq1I (i : I) F : \big[*%M/1]_(j <- [:: i]) F j = F i.
Proof. by rewrite big_seq1_id mulm1. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_seq1 | |
big_rconsI i r (P : pred I) F :
\big[*%M/1]_(j <- rcons r i | P j) F j =
(\big[*%M/1]_(j <- r | P j) F j) * (if P i then F i else idx).
Proof. by rewrite big_rcons_op big_change_idx mulm1. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_rcons | |
big_mkcondI r (P : pred I) F :
\big[*%M/1]_(i <- r | P i) F i =
\big[*%M/1]_(i <- r) (if P i then F i else 1).
Proof. by rewrite unlock; elim: r => //= i r ->; case P; rewrite ?mul1m. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_mkcond | |
big_mkcondrI r (P Q : pred I) F :
\big[*%M/1]_(i <- r | P i && Q i) F i =
\big[*%M/1]_(i <- r | P i) (if Q i then F i else 1).
Proof. by rewrite -big_filter_cond big_mkcond big_filter. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_mkcondr | |
big_mkcondlI r (P Q : pred I) F :
\big[*%M/1]_(i <- r | P i && Q i) F i =
\big[*%M/1]_(i <- r | Q i) (if P i then F i else 1).
Proof. by rewrite big_andbC big_mkcondr. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_mkcondl | |
big_rmcondI (r : seq I) (P : pred I) F :
(forall i, ~~ P i -> F i = 1) ->
\big[*%M/1]_(i <- r | P i) F i = \big[*%M/1]_(i <- r) F i.
Proof.
move=> F_eq1; rewrite big_mkcond; apply: eq_bigr => i.
by case: (P i) (F_eq1 i) => // ->.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_rmcond | |
big_rmcond_in(I : eqType) (r : seq I) (P : pred I) F :
(forall i, i \in r -> ~~ P i -> F i = 1) ->
\big[*%M/1]_(i <- r | P i) F i = \big[*%M/1]_(i <- r) F i.
Proof.
move=> F_eq1; rewrite big_seq_cond [RHS]big_seq_cond !big_mkcondl big_rmcond//.
by move=> i /F_eq1; case: ifP => // _ ->.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_rmcond_in | |
big_catI r1 r2 (P : pred I) F :
\big[*%M/1]_(i <- r1 ++ r2 | P i) F i =
\big[*%M/1]_(i <- r1 | P i) F i * \big[*%M/1]_(i <- r2 | P i) F i.
Proof.
rewrite !(big_mkcond _ P) unlock.
by elim: r1 => /= [|i r1 ->]; rewrite (mul1m, mulmA).
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_cat | |
big_allpairs_depI1 (I2 : I1 -> Type) J (h : forall i1, I2 i1 -> J)
(r1 : seq I1) (r2 : forall i1, seq (I2 i1)) (F : J -> R) :
\big[*%M/1]_(i <- [seq h i1 i2 | i1 <- r1, i2 <- r2 i1]) F i =
\big[*%M/1]_(i1 <- r1) \big[*%M/1]_(i2 <- r2 i1) F (h i1 i2).
Proof.
elim: r1 => [|i1 r1 IHr1]; first by rewrite !big_nil.
by rewrite big_cat IHr1 big_cons big_map.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_allpairs_dep | |
big_allpairsI1 I2 (r1 : seq I1) (r2 : seq I2) F :
\big[*%M/1]_(i <- [seq (i1, i2) | i1 <- r1, i2 <- r2]) F i =
\big[*%M/1]_(i1 <- r1) \big[op/idx]_(i2 <- r2) F (i1, i2).
Proof. exact: big_allpairs_dep. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_allpairs | |
rev_big_revI (r : seq I) P F :
\big[*%M/1]_(i <- rev r | P i) F i =
\big[(fun x y => y * x)/1]_(i <- r | P i) F i.
Proof.
elim: r => [|i r IHr]; rewrite ?big_nil// big_cons rev_cons big_rcons IHr.
by case: (P i); rewrite ?mulm1.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | rev_big_rev | |
big_only1(I : finType) (i : I) (P : pred I) (F : I -> R) : P i ->
(forall j, j != i -> P j -> F j = idx) ->
\big[op/idx]_(j | P j) F j = F i.
Proof.
move=> Pi Fisx; have := index_enum_uniq I.
have : i \in index_enum I by rewrite mem_index_enum.
elim: index_enum => //= j r IHr /[!inE]; case: eqVneq => [<-|nij]//=.
move=> _ /andP[iNr runiq]; rewrite big_cons/= Pi big1_seq ?Monoid.mulm1//.
by move=> {}j /andP[/Fisx + jr] => ->//; apply: contraNneq iNr => <-.
move=> ir /andP[jNr runiq]; rewrite big_cons IHr//.
by case: ifPn => // /Fisx->; rewrite 1?eq_sym// Monoid.mul1m.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_only1 | |
big_pred1_eq(I : finType) (i : I) F : \big[*%M/1]_(j | j == i) F j = F i.
Proof. by rewrite (@big_only1 _ i)// => j /negPf->. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_pred1_eq | |
big_pred1(I : finType) i (P : pred I) F :
P =1 pred1 i -> \big[*%M/1]_(j | P j) F j = F i.
Proof. by move/(eq_bigl _ _)->; apply: big_pred1_eq. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_pred1 | |
big_ord1F : \big[op/idx]_(i < 1) F i = F ord0.
Proof. by rewrite big_ord_recl big_ord0 Monoid.mulm1. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_ord1 | |
big_ord1_condP F :
\big[op/idx]_(i < 1 | P i) F i = if P ord0 then F ord0 else idx.
Proof. by rewrite big_mkcond big_ord1. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_ord1_cond | |
big_ord1_eq(F : nat -> R) i n :
\big[op/idx]_(j < n | j == i :> nat) F j = if i < n then F i else idx.
Proof.
case: ltnP => [i_lt|i_ge]; first by rewrite (big_pred1_eq (Ordinal _)).
by rewrite big_pred0// => j; apply: contra_leqF i_ge => /eqP <-.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_ord1_eq | |
big_ord1_cond_eq(F : nat -> R) (P : pred nat) i n :
\big[op/idx]_(j < n | P j && (j == i :> nat)) F j =
if (i < n) && P i then F i else idx.
Proof.
by rewrite big_mkcondl if_and (big_ord1_eq (fun j => if P j then F j else _)).
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_ord1_cond_eq | |
big_cat_natn m p (P : pred nat) F : m <= n -> n <= p ->
\big[*%M/1]_(m <= i < p | P i) F i =
(\big[*%M/1]_(m <= i < n | P i) F i) * (\big[*%M/1]_(n <= i < p | P i) F i).
Proof.
move=> le_mn le_np; rewrite -big_cat -{2}(subnKC le_mn) -iotaD subnDA.
by rewrite subnKC // leq_sub.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_cat_nat | |
big_nat_widenl(m1 m2 n : nat) (P : pred nat) F :
m2 <= m1 ->
\big[op/idx]_(m1 <= i < n | P i) F i =
\big[op/idx]_(m2 <= i < n | P i && (m1 <= i)) F i.
Proof.
move=> le_m21; have [le_nm1|lt_m1n] := leqP n m1.
rewrite big_geq// big_nat_cond big1//.
by move=> i /and3P[/andP[_ /leq_trans/(_ le_nm1)/ltn_geF->]].
rewrite big_mkcond big_mkcondl (big_cat_nat _ _ le_m21) 1?ltnW//.
rewrite [X in op X]big_nat_cond [X in op X]big_pred0; last first.
by move=> k; case: ltnP; rewrite andbF.
by rewrite Monoid.mul1m; apply: congr_big_nat => // k /andP[].
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_nat_widenl | |
big_geq_mkord(m n : nat) (P : pred nat) F :
\big[op/idx]_(m <= i < n | P i) F i =
\big[op/idx]_(i < n | P i && (m <= i)) F i.
Proof. by rewrite (@big_nat_widenl _ 0)// big_mkord. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_geq_mkord | |
big_nat1_eq(F : nat -> R) i m n :
\big[op/idx]_(m <= j < n | j == i) F j = if m <= i < n then F i else idx.
Proof. by rewrite big_geq_mkord big_andbC big_ord1_cond_eq andbC. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_nat1_eq | |
big_nat1_cond_eq(F : nat -> R) (P : pred nat) i m n :
\big[op/idx]_(m <= j < n | P j && (j == i)) F j =
if (m <= i < n) && P i then F i else idx.
Proof. by rewrite big_mkcondl big_nat1_eq -if_and. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_nat1_cond_eq | |
big_nat1n F : \big[*%M/1]_(n <= i < n.+1) F i = F n.
Proof. by rewrite big_ltn // big_geq // mulm1. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_nat1 | |
big_nat_recrn m F : m <= n ->
\big[*%M/1]_(m <= i < n.+1) F i = (\big[*%M/1]_(m <= i < n) F i) * F n.
Proof. by move=> lemn; rewrite (@big_cat_nat n) ?leqnSn // big_nat1. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_nat_recr | |
big_nat_muln k F :
\big[*%M/1]_(0 <= i < n * k) F i =
\big[*%M/1]_(0 <= i < n) \big[*%M/1]_(i * k <= j < i.+1 * k) F j.
Proof.
elim: n => [|n ih]; first by rewrite mul0n 2!big_nil.
rewrite [in RHS]big_nat_recr//= -ih mulSn addnC [in LHS]/index_iota subn0 iotaD.
rewrite big_cat /= [in X in _ = X * _]/index_iota subn0; congr (_ * _).
by rewrite add0n /index_iota (addnC _ k) addnK.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_nat_mul | |
big_ord_recrn F :
\big[*%M/1]_(i < n.+1) F i =
(\big[*%M/1]_(i < n) F (widen_ord (leqnSn n) i)) * F ord_max.
Proof.
transitivity (\big[*%M/1]_(0 <= i < n.+1) F (inord i)).
by rewrite big_mkord; apply: eq_bigr=> i _; rewrite inord_val.
rewrite big_nat_recr // big_mkord; congr (_ * F _); last first.
by apply: val_inj; rewrite /= inordK.
by apply: eq_bigr => [] i _; congr F; apply: ord_inj; rewrite inordK //= leqW.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_ord_recr | |
big_sumType(I1 I2 : finType) (P : pred (I1 + I2)) F :
\big[*%M/1]_(i | P i) F i =
(\big[*%M/1]_(i | P (inl _ i)) F (inl _ i))
* (\big[*%M/1]_(i | P (inr _ i)) F (inr _ i)).
Proof.
by rewrite ![index_enum _]unlock [@Finite.enum in LHS]unlock/= big_cat !big_map.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_sumType | |
big_split_ordm n (P : pred 'I_(m + n)) F :
\big[*%M/1]_(i | P i) F i =
(\big[*%M/1]_(i | P (lshift n i)) F (lshift n i))
* (\big[*%M/1]_(i | P (rshift m i)) F (rshift m i)).
Proof.
rewrite -(big_map _ _ (lshift n) _ P F) -(big_map _ _ (@rshift m _) _ P F).
rewrite -big_cat; congr bigop; apply: (inj_map val_inj).
rewrite map_cat -!map_comp (map_comp (addn m)) /=.
by rewrite ![index_enum _]unlock unlock !val_ord_enum -iotaDl addn0 iotaD.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_split_ord | |
big_flattenI rr (P : pred I) F :
\big[*%M/1]_(i <- flatten rr | P i) F i
= \big[*%M/1]_(r <- rr) \big[*%M/1]_(i <- r | P i) F i.
Proof.
by elim: rr => [|r rr IHrr]; rewrite ?big_nil //= big_cat big_cons -IHrr.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_flatten | |
big_pmapJ I (h : J -> option I) (r : seq J) F :
\big[op/idx]_(i <- pmap h r) F i = \big[op/idx]_(j <- r) oapp F idx (h j).
Proof.
elim: r => [| r0 r IHr]/=; first by rewrite !big_nil.
rewrite /= big_cons; case: (h r0) => [i|] /=; last by rewrite mul1m.
by rewrite big_cons IHr.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_pmap | |
telescope_big(f : nat -> nat -> R) (n m : nat) :
(forall k, n < k < m -> op (f n k) (f k k.+1) = f n k.+1) ->
\big[op/idx]_(n <= i < m) f i i.+1 = if n < m then f n m else idx.
Proof.
elim: m => [//| m IHm]; first by rewrite ltn0 big_geq.
move=> tm; rewrite ltnS; case: ltnP=> // mn; first by rewrite big_geq.
rewrite big_nat_recr// IHm//; last first.
by move=> k /andP[nk /ltnW nm]; rewrite tm// nk.
by case: ltngtP mn=> //= [nm|<-]; rewrite ?mul1m// tm// nm leqnn.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | telescope_big | |
big_rem(I : eqType) r x (P : pred I) F :
x \in r ->
\big[*%M/1]_(y <- r | P y) F y
= (if P x then F x else 1) * \big[*%M/1]_(y <- rem x r | P y) F y.
Proof.
by move/perm_to_rem/(perm_big _)->; rewrite !(big_mkcond _ _ P) big_cons.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_rem | |
big_revI (r : seq I) P F :
\big[*%M/1]_(i <- rev r | P i) F i = \big[*%M/1]_(i <- r | P i) F i.
Proof.
by rewrite rev_big_rev; apply: (eq_big_op (fun=> True)) => // *; apply: mulmC.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_rev | |
eq_big_idem(I : eqType) (r1 r2 : seq I) (P : pred I) F :
idempotent_op *%M -> r1 =i r2 ->
\big[*%M/1]_(i <- r1 | P i) F i = \big[*%M/1]_(i <- r2 | P i) F i.
Proof.
move=> idM eq_r; rewrite -big_undup // -(big_undup r2) //; apply/perm_big.
by rewrite uniq_perm ?undup_uniq // => i; rewrite !mem_undup eq_r.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | eq_big_idem | |
big_undup_iterop_count(I : eqType) (r : seq I) (P : pred I) F :
\big[*%M/1]_(i <- undup r | P i) iterop (count_mem i r) *%M (F i) 1
= \big[*%M/1]_(i <- r | P i) F i.
Proof.
rewrite -[RHS](perm_big _ F (perm_count_undup _)) big_flatten big_map.
by rewrite [LHS]big_mkcond; apply: eq_bigr=> i _; rewrite big_nseq_cond iteropE.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_undup_iterop_count | |
big_splitI r (P : pred I) F1 F2 :
\big[*%M/1]_(i <- r | P i) (F1 i * F2 i) =
\big[*%M/1]_(i <- r | P i) F1 i * \big[*%M/1]_(i <- r | P i) F2 i.
Proof. exact/big_split_idem/mul1m. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_split | |
bigIDI r (a P : pred I) F :
\big[*%M/1]_(i <- r | P i) F i =
\big[*%M/1]_(i <- r | P i && a i) F i *
\big[*%M/1]_(i <- r | P i && ~~ a i) F i.
Proof. exact/bigID_idem/mul1m. Qed.
Arguments bigID [I r]. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | bigID | |
big_ifI r (P Q : pred I) F G :
\big[*%M/1]_(i <- r | P i) (if Q i then F i else G i) =
\big[*%M/1]_(i <- r | P i && Q i) F i *
\big[*%M/1]_(i <- r | P i && ~~ Q i) G i.
Proof.
rewrite (bigID Q); congr (_ * _); apply: eq_bigr => i /andP[_].
by move=> ->.
by move=> /negPf ->.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_if | |
bigU(I : finType) (A B : pred I) F :
[disjoint A & B] ->
\big[*%M/1]_(i in [predU A & B]) F i =
(\big[*%M/1]_(i in A) F i) * (\big[*%M/1]_(i in B) F i).
Proof. exact/bigU_idem/mul1m. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | bigU | |
partition_bigI (s : seq I)
(J : finType) (P : pred I) (p : I -> J) (Q : pred J) F :
(forall i, P i -> Q (p i)) ->
\big[*%M/1]_(i <- s | P i) F i =
\big[*%M/1]_(j : J | Q j) \big[*%M/1]_(i <- s | (P i) && (p i == j)) F i.
Proof.
move=> Qp; transitivity (\big[*%M/1]_(i <- s | P i && Q (p i)) F i).
by apply: eq_bigl => i; case Pi: (P i); rewrite // Qp.
have [n leQn] := ubnP #|Q|; elim: n => // n IHn in Q {Qp} leQn *.
case: (pickP Q) => [j Qj | Q0]; last first.
by rewrite !big_pred0 // => i; rewrite Q0 andbF.
rewrite (bigD1 j) // -IHn; last by rewrite ltnS (cardD1x Qj) in leQn.
rewrite (bigID (fun i => p i == j)); congr (_ * _); apply: eq_bigl => i.
by case: eqP => [-> | _]; rewrite !(Qj, simpm).
by rewrite andbA.
Qed.
Arguments partition_big [I s J P] p Q [F]. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | partition_big | |
big_enum_val(I : finType) (A : pred I) F :
\big[op/idx]_(x in A) F x = \big[op/idx]_(i < #|A|) F (enum_val i).
Proof. by rewrite -(big_enum_val_cond predT) big_mkcondr. Qed.
Arguments big_enum_val [I A] F. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_enum_val | |
big_enum_rank(I : finType) (A : pred I) x (xA : x \in A) F
(h := enum_rank_in xA) :
\big[op/idx]_(i < #|A|) F i = \big[op/idx]_(s in A) F (h s).
Proof. by rewrite (big_enum_rank_cond xA) big_mkcondr. Qed.
Arguments big_enum_rank [I A x] xA F. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_enum_rank | |
big_sub_cond(I : finType) (A P : {pred I}) (F : I -> R) :
\big[*%M/1]_(i in A | P i) F i =
\big[*%M/1]_(x : {x in A} | P (val x)) F (val x).
Proof.
rewrite (reindex_omap (val : {x in A} -> I) insub); last first.
by move=> i /andP[iA Pi]; rewrite insubT.
by apply: eq_bigl=> -[i iA]/=; rewrite insubT ?iA /= eqxx andbT.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_sub_cond | |
big_sub(I : finType) (A : {pred I}) (F : I -> R) :
\big[*%M/1]_(i in A) F i = \big[*%M/1]_(x : {x in A}) F (val x).
Proof. by rewrite -(big_sub_cond A xpredT) big_mkcondr. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_sub | |
sig_big_dep(I : finType) (J : I -> finType)
(P : pred I) (Q : forall {i}, pred (J i)) (F : forall {i}, J i -> R) :
\big[op/idx]_(i | P i) \big[op/idx]_(j : J i | Q j) F j =
\big[op/idx]_(p : {i : I & J i} | P (tag p) && Q (tagged p)) F (tagged p).
Proof. exact/sig_big_dep_idem/mul1m. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | sig_big_dep | |
pair_big_dep(I J : finType) (P : pred I) (Q : I -> pred J) F :
\big[*%M/1]_(i | P i) \big[*%M/1]_(j | Q i j) F i j =
\big[*%M/1]_(p | P p.1 && Q p.1 p.2) F p.1 p.2.
Proof. exact/pair_big_dep_idem/mul1m. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | pair_big_dep | |
pair_big(I J : finType) (P : pred I) (Q : pred J) F :
\big[*%M/1]_(i | P i) \big[*%M/1]_(j | Q j) F i j =
\big[*%M/1]_(p | P p.1 && Q p.2) F p.1 p.2.
Proof. exact/pair_big_idem/mul1m. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | pair_big | |
pair_bigA(I J : finType) (F : I -> J -> R) :
\big[*%M/1]_i \big[*%M/1]_j F i j = \big[*%M/1]_p F p.1 p.2.
Proof. exact/pair_bigA_idem/mul1m. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | pair_bigA | |
exchange_big_depI J rI rJ (P : pred I) (Q : I -> pred J)
(xQ : pred J) F :
(forall i j, P i -> Q i j -> xQ j) ->
\big[*%M/1]_(i <- rI | P i) \big[*%M/1]_(j <- rJ | Q i j) F i j =
\big[*%M/1]_(j <- rJ | xQ j) \big[*%M/1]_(i <- rI | P i && Q i j) F i j.
Proof. exact/exchange_big_dep_idem/mul1m. Qed.
Arguments exchange_big_dep [I J rI rJ P Q] xQ [F]. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | exchange_big_dep | |
exchange_bigI J rI rJ (P : pred I) (Q : pred J) F :
\big[*%M/1]_(i <- rI | P i) \big[*%M/1]_(j <- rJ | Q j) F i j =
\big[*%M/1]_(j <- rJ | Q j) \big[*%M/1]_(i <- rI | P i) F i j.
Proof. exact/exchange_big_idem/mul1m. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | exchange_big | |
exchange_big_dep_natm1 n1 m2 n2 (P : pred nat) (Q : rel nat)
(xQ : pred nat) F :
(forall i j, m1 <= i < n1 -> m2 <= j < n2 -> P i -> Q i j -> xQ j) ->
\big[*%M/1]_(m1 <= i < n1 | P i) \big[*%M/1]_(m2 <= j < n2 | Q i j) F i j =
\big[*%M/1]_(m2 <= j < n2 | xQ j)
\big[*%M/1]_(m1 <= i < n1 | P i && Q i j) F i j.
Proof. exact/exchange_big_dep_nat_idem/mul1m. Qed.
Arguments exchange_big_dep_nat [m1 n1 m2 n2 P Q] xQ [F]. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | exchange_big_dep_nat | |
exchange_big_natm1 n1 m2 n2 (P Q : pred nat) F :
\big[*%M/1]_(m1 <= i < n1 | P i) \big[*%M/1]_(m2 <= j < n2 | Q j) F i j =
\big[*%M/1]_(m2 <= j < n2 | Q j) \big[*%M/1]_(m1 <= i < n1 | P i) F i j.
Proof. exact/exchange_big_nat_idem/mul1m. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | exchange_big_nat | |
sub_le_bigI [s] (P P' : {pred I}) (F : I -> R) :
(forall i, P i -> P' i) ->
le (\big[op/x]_(i <- s | P i) F i) (\big[op/x]_(i <- s | P' i) F i).
Proof.
move=> PP'; rewrite [X in le _ X](big_AC_mk_monoid opA opC) (bigID P P') /=.
under [in X in le _ X]eq_bigl do rewrite (andb_idl (PP' _)).
rewrite [X in le X _](big_AC_mk_monoid opA opC).
case: (bigop _ _ _) (bigop _ _ _) => [y|] [z|]//=.
by rewrite -opA [_ y x]opC opA op_incr.
by rewrite opC op_incr.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | sub_le_big | |
sub_le_big_seq(I : eqType) s s' P (F : I -> R) :
(forall i, count_mem i s <= count_mem i s')%N ->
le (\big[op/x]_(i <- s | P i) F i) (\big[op/x]_(i <- s' | P i) F i).
Proof.
rewrite (big_AC_mk_monoid opA opC) => /count_subseqP[_ /subseqP[m sm ->]].
move/(perm_big _)->; rewrite big_mask [X in le _ X]big_tnth.
by rewrite -!(big_AC_mk_monoid opA opC) sub_le_big // => j /andP[].
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | sub_le_big_seq | |
sub_le_big_seq_cond(I : eqType) s s' P P' (F : I -> R) :
(forall i, count_mem i (filter P s) <= count_mem i (filter P' s'))%N ->
le (\big[op/x]_(i <- s | P i) F i) (\big[op/x]_(i <- s' | P' i) F i).
Proof. by move=> /(sub_le_big_seq xpredT F); rewrite !big_filter. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | sub_le_big_seq_cond | |
uniq_sub_le_big(I : eqType) s s' P (F : I -> R) : uniq s -> uniq s' ->
{subset s <= s'} ->
le (\big[op/x]_(i <- s | P i) F i) (\big[op/x]_(i <- s' | P i) F i).
Proof.
move=> us us' ss'; rewrite sub_le_big_seq => // i; rewrite !count_uniq_mem//.
by have /implyP := ss' i; case: (_ \in s) (_ \in s') => [] [].
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | uniq_sub_le_big | |
uniq_sub_le_big_cond(I : eqType) s s' P P' (F : I -> R) :
uniq (filter P s) -> uniq (filter P' s') ->
{subset [seq i <- s | P i] <= [seq i <- s' | P' i]} ->
le (\big[op/x]_(i <- s | P i) F i) (\big[op/x]_(i <- s' | P' i) F i).
Proof. by move=> u v /(uniq_sub_le_big xpredT F u v); rewrite !big_filter. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | uniq_sub_le_big_cond | |
idem_sub_le_big(I : eqType) s s' P (F : I -> R) :
{subset s <= s'} ->
le (\big[op/x]_(i <- s | P i) F i) (\big[op/x]_(i <- s' | P i) F i).
Proof.
move=> ss'; rewrite -big_undup// -[X in le _ X]big_undup//.
by rewrite uniq_sub_le_big ?undup_uniq// => i; rewrite !mem_undup; apply: ss'.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | idem_sub_le_big | |
idem_sub_le_big_cond(I : eqType) s s' P P' (F : I -> R) :
{subset [seq i <- s | P i] <= [seq i <- s' | P' i]} ->
le (\big[op/x]_(i <- s | P i) F i) (\big[op/x]_(i <- s' | P' i) F i).
Proof. by move=> /(idem_sub_le_big xpredT F); rewrite !big_filter. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | idem_sub_le_big_cond | |
sub_in_le_big[I : eqType] (s : seq I) (P P' : {pred I}) (F : I -> R) :
{in s, forall i, P i -> P' i} ->
le (\big[op/x]_(i <- s | P i) F i) (\big[op/x]_(i <- s | P' i) F i).
Proof.
move=> PP'; apply: sub_le_big_seq_cond => i; rewrite leq_count_subseq//.
rewrite subseq_filter filter_subseq andbT; apply/allP => j.
by rewrite !mem_filter => /andP[/PP'/[apply]->].
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | sub_in_le_big | |
le_big_ordn m [P : {pred nat}] [F : nat -> R] : (n <= m)%N ->
le (\big[op/x]_(i < n | P i) F i) (\big[op/x]_(i < m | P i) F i).
Proof.
by move=> nm; rewrite (big_ord_widen_cond m)// sub_le_big => //= ? /andP[].
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | le_big_ord | |
subset_le_big[I : finType] [A A' P : {pred I}] (F : I -> R) :
A \subset A' ->
le (\big[op/x]_(i in A | P i) F i) (\big[op/x]_(i in A' | P i) F i).
Proof.
move=> AA'; apply: sub_le_big => y /andP[yA yP]; apply/andP; split => //.
exact: subsetP yA.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | subset_le_big | |
le_big_nat_condn m n' m' (P P' : {pred nat}) (F : nat -> R) :
(n' <= n)%N -> (m <= m')%N -> (forall i, (n <= i < m)%N -> P i -> P' i) ->
le (\big[op/x]_(n <= i < m | P i) F i) (\big[op/x]_(n' <= i < m' | P' i) F i).
Proof.
move=> len'n lemm' PP'i; rewrite uniq_sub_le_big_cond ?filter_uniq ?iota_uniq//.
move=> i; rewrite !mem_filter !mem_index_iota => /and3P[Pi ni im].
by rewrite PP'i ?ni//= (leq_trans _ ni)// (leq_trans im).
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | le_big_nat_cond | |
le_big_natn m n' m' [P] [F : nat -> R] : (n' <= n)%N -> (m <= m')%N ->
le (\big[op/x]_(n <= i < m | P i) F i) (\big[op/x]_(n' <= i < m' | P i) F i).
Proof. by move=> len'n lemm'; rewrite le_big_nat_cond. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | le_big_nat | |
le_big_ord_condn m (P P' : {pred nat}) (F : nat -> R) :
(n <= m)%N -> (forall i : 'I_n, P i -> P' i) ->
le (\big[op/x]_(i < n | P i) F i) (\big[op/x]_(i < m | P' i) F i).
Proof.
move=> nm PP'; rewrite -!big_mkord le_big_nat_cond//= => i ni.
by have := PP' (Ordinal ni).
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | le_big_ord_cond | |
eq_bigl_supp(r : seq I) (P1 : pred I) (P2 : pred I) (F : I -> R) :
{in [pred x | F x != idx], P1 =1 P2} ->
\big[op/idx]_(i <- r | P1 i) F i = \big[op/idx]_(i <- r | P2 i) F i.
Proof.
move=> P12; rewrite big_mkcond [RHS]big_mkcond; apply: eq_bigr => i _.
by case: (eqVneq (F i) idx) => [->|/P12->]; rewrite ?if_same.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | eq_bigl_supp | |
perm_big_supp_cond[r s : seq I] [P : pred I] (F : I -> R) :
perm_eq
[seq i <- r | P i && (F i != idx)]
[seq i <- s | P i && (F i != idx)] ->
\big[op/idx]_(i <- r | P i) F i = \big[op/idx]_(i <- s | P i) F i.
Proof.
move=> prs; rewrite !(bigID [pred i | F i == idx] P F)/=.
rewrite big1 ?Monoid.mul1m; last by move=> i /andP[_ /eqP->].
rewrite [in RHS]big1 ?Monoid.mul1m; last by move=> i /andP[_ /eqP->].
by rewrite -[in LHS]big_filter -[in RHS]big_filter; apply perm_big.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | perm_big_supp_cond | |
perm_big_supp[r s : seq I] [P : pred I] (F : I -> R) :
perm_eq [seq i <- r | F i != idx] [seq i <- s | F i != idx] ->
\big[op/idx]_(i <- r | P i) F i = \big[op/idx]_(i <- s | P i) F i.
Proof.
by move=> ?; apply: perm_big_supp_cond; rewrite !filter_predI perm_filter.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | perm_big_supp | |
big_distrlI r a (P : pred I) F :
\big[+%M/0]_(i <- r | P i) F i * a = \big[+%M/0]_(i <- r | P i) (F i * a).
Proof. by rewrite (big_endo ( *%M^~ a)) ?mul0m // => x y; apply: mulmDl. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_distrl | |
big_distrrI r a (P : pred I) F :
a * \big[+%M/0]_(i <- r | P i) F i = \big[+%M/0]_(i <- r | P i) (a * F i).
Proof. by rewrite big_endo ?mulm0 // => x y; apply: mulmDr. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_distrr | |
big_distrlrI J rI rJ (pI : pred I) (pJ : pred J) F G :
(\big[+%M/0]_(i <- rI | pI i) F i) * (\big[+%M/0]_(j <- rJ | pJ j) G j)
= \big[+%M/0]_(i <- rI | pI i) \big[+%M/0]_(j <- rJ | pJ j) (F i * G j).
Proof. by rewrite big_distrl; under eq_bigr do rewrite big_distrr. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_distrlr | |
big_distr_big_dep(I J : finType) j0 (P : pred I) (Q : I -> pred J) F :
\big[*%M/1]_(i | P i) \big[+%M/0]_(j | Q i j) F i j =
\big[+%M/0]_(f in pfamily j0 P Q) \big[*%M/1]_(i | P i) F i (f i).
Proof.
pose fIJ := {ffun I -> J}; pose Pf := pfamily j0 (_ : seq I) Q.
have [r big_r [Ur mem_r] _] := big_enumP P.
symmetry; transitivity (\big[+%M/0]_(f in Pf r) \big[*%M/1]_(i <- r) F i (f i)).
by apply: eq_big => // f; apply: eq_forallb => i; rewrite /= mem_r.
rewrite -{P mem_r}big_r; elim: r Ur => /= [_ | i r IHr].
rewrite (big_pred1 [ffun=> j0]) ?big_nil //= => f.
apply/familyP/eqP=> /= [Df |->{f} i]; last by rewrite ffunE !inE.
by apply/ffunP=> i; rewrite ffunE; apply/eqP/Df.
case/andP=> /negbTE nri; rewrite big_cons big_distrl => {}/IHr<-.
rewrite (partition_big (fun f : fIJ => f i) (Q i)) => [|f]; last first.
by move/familyP/(_ i); rewrite /= inE /= eqxx.
pose seti j (f : fIJ) := [ffun k => if k == i then j else f k].
apply: eq_bigr => j Qij.
rewrite (reindex_onto (seti j) (seti j0)) => [|f /andP[_ /eqP fi]]; last first.
by apply/ffunP=> k; rewrite !ffunE; case: eqP => // ->.
rewrite big_distrr; apply: eq_big => [f | f eq_f]; last first.
rewrite big_cons ffunE eqxx !big_seq; congr (_ * _).
by apply: eq_bigr => k; rewrite ffunE; case: eqP nri => // -> ->.
rewrite !ffunE !eqxx andbT; apply/andP/familyP=> /= [[Pjf fij0] k | Pff].
have /[!(ffunE, inE)] := familyP Pjf k; case: eqP => // -> _.
by rewrite nri -(eqP fij0) !ffunE !inE !eqxx.
(split; [apply/familyP | apply/eqP/ff
... | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_distr_big_dep | |
big_distr_big(I J : finType) j0 (P : pred I) (Q : pred J) F :
\big[*%M/1]_(i | P i) \big[+%M/0]_(j | Q j) F i j =
\big[+%M/0]_(f in pffun_on j0 P Q) \big[*%M/1]_(i | P i) F i (f i).
Proof.
rewrite (big_distr_big_dep j0); apply: eq_bigl => f.
by apply/familyP/familyP=> Pf i; case: ifP (Pf i).
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_distr_big | |
bigA_distr_big_dep(I J : finType) (Q : I -> pred J) F :
\big[*%M/1]_i \big[+%M/0]_(j | Q i j) F i j
= \big[+%M/0]_(f in family Q) \big[*%M/1]_i F i (f i).
Proof.
have [j _ | J0] := pickP J; first by rewrite (big_distr_big_dep j).
have Q0 i: Q i =i pred0 by move=> /J0/esym/notF[].
transitivity (iter #|I| ( *%M 0) 1).
by rewrite -big_const; apply/eq_bigr=> i; have /(big_pred0 _)-> := Q0 i.
have [i _ | I0] := pickP I.
rewrite (cardD1 i) //= mul0m big_pred0 // => f.
by apply/familyP=> /(_ i); rewrite Q0.
have f: I -> J by move=> /I0/esym/notF[].
rewrite eq_card0 // (big_pred1 (finfun f)) ?big_pred0 // => g.
by apply/familyP/eqP=> _; first apply/ffunP; move=> /I0/esym/notF[].
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | bigA_distr_big_dep | |
bigA_distr_big(I J : finType) (Q : pred J) (F : I -> J -> R) :
\big[*%M/1]_i \big[+%M/0]_(j | Q j) F i j
= \big[+%M/0]_(f in ffun_on Q) \big[*%M/1]_i F i (f i).
Proof. exact: bigA_distr_big_dep. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | bigA_distr_big | |
bigA_distr_bigA(I J : finType) F :
\big[*%M/1]_(i : I) \big[+%M/0]_(j : J) F i j
= \big[+%M/0]_(f : {ffun I -> J}) \big[*%M/1]_i F i (f i).
Proof. by rewrite bigA_distr_big; apply: eq_bigl => ?; apply/familyP. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | bigA_distr_bigA | |
big_has: \big[orb/false]_(i <- r) B i = has B r.
Proof. by rewrite unlock. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_has | |
big_all: \big[andb/true]_(i <- r) B i = all B r.
Proof. by rewrite unlock. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_all | |
big_has_cond: \big[orb/false]_(i <- r | P i) B i = has (predI P B) r.
Proof. by rewrite big_mkcond unlock. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_has_cond | |
big_all_cond:
\big[andb/true]_(i <- r | P i) B i = all [pred i | P i ==> B i] r.
Proof. by rewrite big_mkcond unlock. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_all_cond | |
big_boolR (idx : R) (op : Monoid.com_law idx) (F : bool -> R):
\big[op/idx]_(i : bool) F i = op (F true) (F false).
Proof. by rewrite /index_enum !unlock /= Monoid.mulm1. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_bool | |
big_orE: \big[orb/false]_(i | P i) B i = [exists (i | P i), B i].
Proof. by rewrite big_has_cond; apply/hasP/existsP=> [] [i]; exists i. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_orE | |
big_andE: \big[andb/true]_(i | P i) B i = [forall (i | P i), B i].
Proof.
rewrite big_all_cond; apply/allP/forallP=> /= allB i; rewrite allB //.
exact: mem_index_enum.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | big_andE | |
sum_nat_constn : \sum_(i in A) n = #|A| * n.
Proof. by rewrite big_const iter_addn_0 mulnC. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | sum_nat_const | |
sum1_card: \sum_(i in A) 1 = #|A|.
Proof. by rewrite sum_nat_const muln1. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | sum1_card | |
sum1_countJ (r : seq J) (a : pred J) : \sum_(j <- r | a j) 1 = count a r.
Proof. by rewrite big_const_seq iter_addn_0 mul1n. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | sum1_count | |
sum1_sizeJ (r : seq J) : \sum_(j <- r) 1 = size r.
Proof. by rewrite sum1_count count_predT. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | sum1_size | |
prod_nat_constn : \prod_(i in A) n = n ^ #|A|.
Proof. by rewrite big_const -Monoid.iteropE. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | prod_nat_const | |
sum_nat_const_natn1 n2 n : \sum_(n1 <= i < n2) n = (n2 - n1) * n.
Proof. by rewrite big_const_nat iter_addn_0 mulnC. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | sum_nat_const_nat | |
prod_nat_const_natn1 n2 n : \prod_(n1 <= i < n2) n = n ^ (n2 - n1).
Proof. by rewrite big_const_nat -Monoid.iteropE. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | prod_nat_const_nat | |
telescope_sumn_inn m f : n <= m ->
(forall i, n <= i < m -> f i <= f i.+1) ->
\sum_(n <= k < m) (f k.+1 - f k) = f m - f n.
Proof.
move=> nm fle; rewrite (telescope_big (fun i j => f j - f i)).
by case: ltngtP nm => // ->; rewrite subnn.
move=> k /andP[nk km]; rewrite /= addnBAC ?subnKC ?fle ?(ltnW nk)//.
elim: k nk km => [//| k IHk /[!ltnS]/[1!leq_eqVlt]+ km].
move=> /predU1P[/[dup]nk -> | nk]; first by rewrite fle ?nk ?leqnn 1?ltnW.
by rewrite (leq_trans (IHk _ _) (fle _ _))// ltnW// ltnW.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | telescope_sumn_in | |
telescope_sumnn m f : {homo f : x y / x <= y} ->
\sum_(n <= k < m) (f k.+1 - f k) = f m - f n.
Proof.
move=> fle; case: (ltnP n m) => nm.
by apply: (telescope_sumn_in (ltnW nm)) => ? ?; apply: fle.
by apply/esym/eqP; rewrite big_geq// subn_eq0 fle.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | telescope_sumn | |
sumnEr : sumn r = \sum_(i <- r) i. Proof. exact: foldrE. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | sumnE | |
card_bseqn (T : finType) : #|{bseq n of T}| = \sum_(i < n.+1) #|T| ^ i.
Proof.
rewrite (bij_eq_card bseq_tagged_tuple_bij) card_tagged sumnE big_map big_enum.
by under eq_bigr do rewrite card_tuple.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | card_bseq | |
leqif_sum(I : finType) (P C : pred I) (E1 E2 : I -> nat) :
(forall i, P i -> E1 i <= E2 i ?= iff C i) ->
\sum_(i | P i) E1 i <= \sum_(i | P i) E2 i ?= iff [forall (i | P i), C i].
Proof.
move=> leE12; rewrite -big_andE.
by elim/big_rec3: _ => // i Ci m1 m2 /leE12; apply: leqif_add.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path",
"From mathcomp Require Import div fintype tuple finfun"
] | boot/bigop.v | leqif_sum |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.