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
imset2S(A B : {pred aT}) (A2 B2 : {pred aT2}) : A \subset B -> A2 \subset B2 -> f2 @2: (A, A2) \subset f2 @2: (B, B2). Proof. by move=> /(imset2Sl B2) sBA /(imset2Sr A)/subset_trans->. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
imset2S
eq_preimsetf g R : f =1 g -> f @^-1: R = g @^-1: R. Proof. by move=> eqfg; apply/setP => y; rewrite !inE eqfg. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
eq_preimset
eq_imsetf g D : f =1 g -> f @: D = g @: D. Proof. move=> eqfg; apply/setP=> y. by apply/imsetP/imsetP=> [] [x Dx ->]; exists x; rewrite ?eqfg. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
eq_imset
eq_in_imsetf g D : {in D, f =1 g} -> f @: D = g @: D. Proof. move=> eqfg; apply/setP => y. by apply/imsetP/imsetP=> [] [x Dx ->]; exists x; rewrite ?eqfg. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
eq_in_imset
eq_in_imset2(f g : aT -> aT2 -> rT) (D : {pred aT}) (D2 : {pred aT2}) : {in D & D2, f =2 g} -> f @2: (D, D2) = g @2: (D, D2). Proof. move=> eqfg; apply/setP => y. by apply/imset2P/imset2P=> [] [x x2 Dx Dx2 ->]; exists x x2; rewrite ?eqfg. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
eq_in_imset2
imset2_pair(A : {set aT}) (B : {set aT2}) : [set (x, y) | x in A, y in B] = setX A B. Proof. apply/setP=> [[x y]]; rewrite !inE /=. by apply/imset2P/andP=> [[_ _ _ _ [-> ->]//]| []]; exists x y. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
imset2_pair
setXS(A1 B1 : {set aT}) (A2 B2 : {set aT2}) : A1 \subset B1 -> A2 \subset B2 -> setX A1 A2 \subset setX B1 B2. Proof. by move=> sAB1 sAB2; rewrite -!imset2_pair imset2S. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
setXS
pick_set1i0 : [pick x in [set i0]] = Some i0. Proof. by case: pickP => [i /[!inE]/eqP-> | /(_ i0)/[!(inE, eqxx)]]. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
pick_set1
unset1A : option I := if #|A| == 1 then [pick x in A] else None.
Definition
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
unset1
set1K: pcancel set1 unset1. Proof. by move=> i; rewrite /unset1 cards1 eqxx pick_set1. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
set1K
omap_unset1KA : #|A| = 1 -> omap set1 (unset1 A) = Some A. Proof. by move=> /eqP/cards1P[i ->]; rewrite set1K. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
omap_unset1K
unset10: unset1 set0 = None. Proof. by rewrite /unset1 cards0. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
unset10
unset1N1A : #|A| != 1 -> unset1 A = None. Proof. by move=> AN1; rewrite /unset1 ifN. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
unset1N1
unset1K: ocancel unset1 set1. Proof. move=> A; rewrite /unset1. by case: ifPn => // /cards1P[i ->]/=; rewrite pick_set1. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
unset1K
setXnS(I : finType) (T : I -> finType) (A B : forall i, {set T i}) : (forall i, A i \subset B i) -> setXn A \subset setXn B. Proof. move=> sAB; apply/subsetP => x /setXnP xA. by apply/setXnP => i; apply/subsetP: (xA i). Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
setXnS
eq_setXn(I : finType) (T : I -> finType) (A B : forall i, {set T i}) : (forall i, A i = B i) -> setXn A = setXn B. Proof. by move=> eqAB; apply/eqP; rewrite eqEsubset !setXnS// => j; rewrite eqAB. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
eq_setXn
big_set0F : \big[op/x]_(i in set0) F i = x. Proof. by apply: big_pred0 => i; rewrite inE. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
big_set0
big_set1Ej F : \big[op/x]_(i in [set j]) F i = op (F j) x. Proof. by rewrite -big_pred1_eq_id; apply: eq_bigl => i; apply: in_set1. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
big_set1E
big_set(A : pred I) F : \big[op/x]_(i in [set i | A i]) (F i) = \big[op/x]_(i in A) (F i). Proof. by apply: eq_bigl => i; rewrite inE. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
big_set
subset_le_big_cond(I : finType) (A A' P P' : {pred I}) (F : I -> R) : [set i in A | P i] \subset [set i in A' | P' i] -> le (\big[op/x]_(i in A | P i) F i) (\big[op/x]_(i in A' | P' i) F i). Proof. by move=> /subsetP AP; apply: sub_le_big => // i; have /[!inE] := AP i. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
subset_le_big_cond
big_imset_idem[I J : finType] (h : I -> J) (A : pred I) F : idempotent_op op -> \big[op/x]_(j in h @: A) F j = \big[op/x]_(i in A) F (h i). Proof. rewrite -!big_image => op_idem; rewrite -big_undup// -[RHS]big_undup//. apply/perm_big/perm_undup => j; apply/imageP. have [mem_j | /imageP mem_j] := boolP (j \in [seq h j | j in A]). - by exists j => //; apply/imsetP; apply: imageP mem_j. - by case=> k /imsetP [i j_in_A ->] eq_i; apply: mem_j; exists i. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
big_imset_idem
big_set1a F : \big[op/idx]_(i in [set a]) F i = F a. Proof. by apply: big_pred1 => i; rewrite !inE. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
big_set1
big_setIDA B F : \big[aop/idx]_(i in A) F i = aop (\big[aop/idx]_(i in A :&: B) F i) (\big[aop/idx]_(i in A :\: B) F i). Proof. rewrite (bigID [in B]) setDE. by congr (aop _ _); apply: eq_bigl => i; rewrite !inE. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
big_setID
big_setIDcondA B P F : \big[aop/idx]_(i in A | P i) F i = aop (\big[aop/idx]_(i in A :&: B | P i) F i) (\big[aop/idx]_(i in A :\: B | P i) F i). Proof. by rewrite !big_mkcondr; apply: big_setID. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
big_setIDcond
big_setD1a A F : a \in A -> \big[aop/idx]_(i in A) F i = aop (F a) (\big[aop/idx]_(i in A :\ a) F i). Proof. move=> Aa; rewrite (bigD1 a Aa); congr (aop _). by apply: eq_bigl => x; rewrite !inE andbC. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
big_setD1
big_setU1a A F : a \notin A -> \big[aop/idx]_(i in a |: A) F i = aop (F a) (\big[aop/idx]_(i in A) F i). Proof. by move=> notAa; rewrite (@big_setD1 a) ?setU11 //= setU1K. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
big_setU1
big_subset_idem_condA B P F : idempotent_op aop -> A \subset B -> aop (\big[aop/idx]_(i in A | P i) F i) (\big[aop/idx]_(i in B | P i) F i) = \big[aop/idx]_(i in B | P i) F i. Proof. by move=> idaop /setIidPr <-; rewrite (big_setIDcond B A) Monoid.mulmA /= idaop. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
big_subset_idem_cond
big_subset_idemA B F : idempotent_op aop -> A \subset B -> aop (\big[aop/idx]_(i in A) F i) (\big[aop/idx]_(i in B) F i) = \big[aop/idx]_(i in B) F i. Proof. by rewrite -2!big_condT; apply: big_subset_idem_cond. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
big_subset_idem
big_setU_condA B P F : idempotent_op aop -> \big[aop/idx]_(i in A :|: B | P i) F i = aop (\big[aop/idx]_(i in A | P i) F i) (\big[aop/idx]_(i in B | P i) F i). Proof. move=> idemaop; rewrite (big_setIDcond _ A) setUK setDUl setDv set0U. rewrite (big_setIDcond B A) Monoid.mulmCA Monoid.mulmA /=. by rewrite (@big_subset_idem_cond (B :&: A)) // subsetIr. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
big_setU_cond
big_setUA B F : idempotent_op aop -> \big[aop/idx]_(i in A :|: B) F i = aop (\big[aop/idx]_(i in A) F i) (\big[aop/idx]_(i in B) F i). Proof. by rewrite -3!big_condT; apply: big_setU_cond. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
big_setU
big_imseth (A : {pred I}) G : {in A &, injective h} -> \big[aop/idx]_(j in h @: A) G j = \big[aop/idx]_(i in A) G (h i). Proof. move=> injh; pose hA := mem (image h A). rewrite (eq_bigl hA) => [|j]; last exact/imsetP/imageP. pose h' := omap (fun u : {j | hA j} => iinv (svalP u)) \o insub. rewrite (reindex_omap h h') => [|j hAj]; rewrite {}/h'/= ?insubT/= ?f_iinv//. apply: eq_bigl => i; case: insubP => [u /= -> def_u | nhAhi]; last first. by apply/andP/idP => [[]//| Ai]; case/imageP: nhAhi; exists i. set i' := iinv _; have Ai' : i' \in A := mem_iinv (svalP u). by apply/eqP/idP => [[<-] // | Ai]; congr Some; apply: injh; rewrite ?f_iinv. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
big_imset
big_imset_condh (A : {pred I}) (P : pred J) G : {in A &, injective h} -> \big[aop/idx]_(j in h @: A | P j) G j = \big[aop/idx]_(i in A | P (h i)) G (h i). Proof. by move=> h_inj; rewrite 2!big_mkcondr big_imset. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
big_imset_cond
partition_big_imseth (A : {pred I}) F : \big[aop/idx]_(i in A) F i = \big[aop/idx]_(j in h @: A) \big[aop/idx]_(i in A | h i == j) F i. Proof. by apply: partition_big => i Ai; apply/imsetP; exists i. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
partition_big_imset
big_cards1(f : {set I} -> R) : \big[aop/idx]_(A : {set I} | #|A| == 1) f A = \big[aop/idx]_(i : I) f [set i]. Proof. rewrite (reindex_omap set1 unset1) => [|A /cards1P[i ->] /[!set1K]//]. by apply: eq_bigl => i; rewrite set1K cards1 !eqxx. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
big_cards1
bigA_distr(R : Type) (zero one : R) (mul : Monoid.mul_law zero) (add : Monoid.add_law zero mul) (I : finType) (F G : I -> R) : \big[mul/one]_i add (F i) (G i) = \big[add/zero]_(J in {set I}) \big[mul/one]_i (if i \in J then F i else G i). Proof. under eq_bigr => i _ do rewrite -(big_bool _ (fun b => if b then F i else G i)). rewrite bigA_distr_bigA. set f := fun J : {set I} => val J. transitivity (\big[add/zero]_(f0 in (imset f (mem setT))) \big[mul/one]_i (if f0 i then F i else G i)). suff <-: setT = imset f (mem setT) by apply: congr_big=>// i; rewrite in_setT. apply/esym/eqP; rewrite -subTset; apply/subsetP => b _. by apply/imsetP; exists (FinSet b). rewrite big_imset; last by case=> g; case=> h _ _; rewrite /f => /= ->. apply: congr_big => //; case=> g; first exact: in_setT. by move=> _; apply: eq_bigr => i _; congr (if _ then _ else _); rewrite unlock. Qed. Arguments big_setID [R idx aop I A]. Arguments big_setD1 [R idx aop I] a [A F]. Arguments big_setU1 [R idx aop I] a [A F]. Arguments big_imset [R idx aop I J h A]. Arguments partition_big_imset [R idx aop I J].
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
bigA_distr
imset2_set1lx1 (D2 : {pred aT2}) : f @2: ([set x1], D2) = f x1 @: D2. Proof. apply/setP=> y; apply/imset2P/imsetP=> [[x x2 /set1P->]| [x2 Dx2 ->]]. by exists x2. by exists x1 x2; rewrite ?set11. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
imset2_set1l
imset2_set1rx2 (D1 : {pred aT1}) : f @2: (D1, [set x2]) = f^~ x2 @: D1. Proof. apply/setP=> y; apply/imset2P/imsetP=> [[x1 x Dx1 /set1P->]| [x1 Dx1 ->]]. by exists x1. by exists x1 x2; rewrite ?set11. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
imset2_set1r
imset_card: #|f @: D| = #|image f D|. Proof. by rewrite [@imset]unlock cardsE. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
imset_card
leq_imset_card: #|f @: D| <= #|D|. Proof. by rewrite imset_card leq_image_card. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
leq_imset_card
card_in_imset: {in D &, injective f} -> #|f @: D| = #|D|. Proof. by move=> injf; rewrite imset_card card_in_image. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
card_in_imset
card_imset: injective f -> #|f @: D| = #|D|. Proof. by move=> injf; rewrite imset_card card_image. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
card_imset
imset_injP: reflect {in D &, injective f} (#|f @: D| == #|D|). Proof. by rewrite [@imset]unlock cardsE; apply: image_injP. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
imset_injP
can2_in_imset_pre: {in D, cancel f g} -> {on D, cancel g & f} -> f @: D = g @^-1: D. Proof. move=> fK gK; apply/setP=> y; rewrite inE. by apply/imsetP/idP=> [[x Ax ->] | Agy]; last exists (g y); rewrite ?(fK, gK). Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
can2_in_imset_pre
can2_imset_pre: cancel f g -> cancel g f -> f @: D = g @^-1: D. Proof. by move=> fK gK; apply: can2_in_imset_pre; apply: in1W. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
can2_imset_pre
on_card_preimset(aT rT : finType) (f : aT -> rT) (R : {pred rT}) : {on R, bijective f} -> #|f @^-1: R| = #|R|. Proof. case=> g fK gK; rewrite -(can2_in_imset_pre gK) // card_in_imset //. exact: can_in_inj gK. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
on_card_preimset
can_imset_pre(T : finType) f g (A : {set T}) : cancel f g -> f @: A = g @^-1: A :> {set T}. Proof. move=> fK; apply: can2_imset_pre => // x. suffices fx: x \in codom f by rewrite -(f_iinv fx) fK. exact/(subset_cardP (card_codom (can_inj fK)))/subsetP. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
can_imset_pre
imset_id(T : finType) (A : {set T}) : [set x | x in A] = A. Proof. by apply/setP=> x; rewrite (@can_imset_pre _ _ id) ?inE. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
imset_id
card_preimset(T : finType) (f : T -> T) (A : {set T}) : injective f -> #|f @^-1: A| = #|A|. Proof. move=> injf; apply: on_card_preimset; apply: onW_bij. have ontof: _ \in codom f by apply/(subset_cardP (card_codom injf))/subsetP. by exists (fun x => iinv (ontof x)) => x; rewrite (f_iinv, iinv_f). Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
card_preimset
card_powerset(T : finType) (A : {set T}) : #|powerset A| = 2 ^ #|A|. Proof. rewrite -card_bool -(card_pffun_on false) -(card_imset _ val_inj). apply: eq_card => f; pose sf := false.-support f; pose D := finset sf. have sDA: (D \subset A) = (sf \subset A) by apply: eq_subset; apply: in_set. have eq_sf x : sf x = f x by rewrite /= negb_eqb addbF. have valD: val D = f by rewrite /D unlock; apply/ffunP=> x; rewrite ffunE eq_sf. apply/imsetP/pffun_onP=> [[B] | [sBA _]]; last by exists D; rewrite // inE ?sDA. by rewrite inE -sDA -valD => sBA /val_inj->. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
card_powerset
imset_comp(f : T' -> U) (g : T -> T') (H : {pred T}) : (f \o g) @: H = f @: (g @: H). Proof. apply/setP/subset_eqP/andP. split; apply/subsetP=> _ /imsetP[x0 Hx0 ->]; apply/imsetP. by exists (g x0); first apply: imset_f. by move/imsetP: Hx0 => [x1 Hx1 ->]; exists x1. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
imset_comp
bigcup_supj P F : P j -> F j \subset \bigcup_(i | P i) F i. Proof. by move=> Pj; rewrite (bigD1 j) //= subsetUl. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
bigcup_sup
bigcup_maxj U P F : P j -> U \subset F j -> U \subset \bigcup_(i | P i) F i. Proof. by move=> Pj sUF; apply: subset_trans (bigcup_sup _ Pj). Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
bigcup_max
bigcupPx P F : reflect (exists2 i, P i & x \in F i) (x \in \bigcup_(i | P i) F i). Proof. apply: (iffP idP) => [|[i Pi]]; last first. by apply: subsetP x; apply: bigcup_sup. by elim/big_rec: _ => [|i _ Pi _ /setUP[|//]]; [rewrite inE | exists i]. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
bigcupP
bigcupsPU P F : reflect (forall i, P i -> F i \subset U) (\bigcup_(i | P i) F i \subset U). Proof. apply: (iffP idP) => [sFU i Pi| sFU]. by apply: subset_trans sFU; apply: bigcup_sup. by apply/subsetP=> x /bigcupP[i Pi]; apply: (subsetP (sFU i Pi)). Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
bigcupsP
bigcup0PP F : reflect (forall i, P i -> F i = set0) (\bigcup_(i | P i) F i == set0). Proof. rewrite -subset0; apply: (iffP (bigcupsP _ _ _)) => sub0 i /sub0; last by move->. by rewrite subset0 => /eqP. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
bigcup0P
bigcup_disjointPU P F : reflect (forall i : I, P i -> [disjoint U & F i]) [disjoint U & \bigcup_(i | P i) F i]. Proof. apply: (iffP idP) => [dUF i Pp|dUF]. by apply: disjointWr dUF; apply: bigcup_sup. rewrite disjoint_sym disjoint_subset. by apply/bigcupsP=> i /dUF; rewrite disjoint_sym disjoint_subset. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
bigcup_disjointP
bigcup_disjointU P F : (forall i, P i -> [disjoint U & F i]) -> [disjoint U & \bigcup_(i | P i) F i]. Proof. by move/bigcup_disjointP. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
bigcup_disjoint
bigcup_setUA B F : \bigcup_(i in A :|: B) F i = (\bigcup_(i in A) F i) :|: (\bigcup_ (i in B) F i). Proof. apply/setP=> x; apply/bigcupP/setUP=> [[i] | ]. by case/setUP; [left | right]; apply/bigcupP; exists i. by case=> /bigcupP[i Pi]; exists i; rewrite // inE Pi ?orbT. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
bigcup_setU
bigcup_seqr F : \bigcup_(i <- r) F i = \bigcup_(i in r) F i. Proof. elim: r => [|i r IHr]; first by rewrite big_nil big_pred0. rewrite big_cons {}IHr; case r_i: (i \in r). rewrite (setUidPr _) ?bigcup_sup //. by apply: eq_bigl => j /[!inE]; case: eqP => // ->. rewrite (bigD1 i (mem_head i r)) /=; congr (_ :|: _). by apply: eq_bigl => j /=; rewrite andbC; case: eqP => // ->. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
bigcup_seq
bigcap_infj P F : P j -> \bigcap_(i | P i) F i \subset F j. Proof. by move=> Pj; rewrite (bigD1 j) //= subsetIl. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
bigcap_inf
bigcap_minj U P F : P j -> F j \subset U -> \bigcap_(i | P i) F i \subset U. Proof. by move=> Pj; apply: subset_trans (bigcap_inf _ Pj). Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
bigcap_min
bigcapsPU P F : reflect (forall i, P i -> U \subset F i) (U \subset \bigcap_(i | P i) F i). Proof. apply: (iffP idP) => [sUF i Pi | sUF]. by apply: subset_trans sUF _; apply: bigcap_inf. elim/big_rec: _ => [|i V Pi sUV]; apply/subsetP=> x Ux; rewrite inE //. by rewrite !(subsetP _ x Ux) ?sUF. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
bigcapsP
bigcapPx P F : reflect (forall i, P i -> x \in F i) (x \in \bigcap_(i | P i) F i). Proof. rewrite -sub1set. by apply: (iffP (bigcapsP _ _ _)) => Fx i /Fx; rewrite sub1set. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
bigcapP
setC_bigcupJ r (P : pred J) (F : J -> {set T}) : ~: (\bigcup_(j <- r | P j) F j) = \bigcap_(j <- r | P j) ~: F j. Proof. by apply: big_morph => [A B|]; rewrite ?setC0 ?setCU. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
setC_bigcup
setC_bigcapJ r (P : pred J) (F : J -> {set T}) : ~: (\bigcap_(j <- r | P j) F j) = \bigcup_(j <- r | P j) ~: F j. Proof. by apply: big_morph => [A B|]; rewrite ?setCT ?setCI. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
setC_bigcap
bigcap_setUA B F : (\bigcap_(i in A :|: B) F i) = (\bigcap_(i in A) F i) :&: (\bigcap_(i in B) F i). Proof. by apply: setC_inj; rewrite setCI !setC_bigcap bigcup_setU. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
bigcap_setU
bigcap_seqr F : \bigcap_(i <- r) F i = \bigcap_(i in r) F i. Proof. by apply: setC_inj; rewrite !setC_bigcap bigcup_seq. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
bigcap_seq
curry_imset2X: f @2: (A1, A2) = uncurry f @: (setX A1 A2). Proof. rewrite [@imset]unlock unlock; apply/setP=> x; rewrite !in_set; congr (x \in _). by apply: eq_image => u //=; rewrite !inE. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
curry_imset2X
curry_imset2l: f @2: (D1, D2) = \bigcup_(x1 in D1) f x1 @: D2. Proof. apply/setP=> y; apply/imset2P/bigcupP => [[x1 x2 Dx1 Dx2 ->{y}] | [x1 Dx1]]. by exists x1; rewrite // imset_f. by case/imsetP=> x2 Dx2 ->{y}; exists x1 x2. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
curry_imset2l
curry_imset2r: f @2: (D1, D2) = \bigcup_(x2 in D2) f^~ x2 @: D1. Proof. apply/setP=> y; apply/imset2P/bigcupP => [[x1 x2 Dx1 Dx2 ->{y}] | [x2 Dx2]]. by exists x2; rewrite // (imset_f (f^~ x2)). by case/imsetP=> x1 Dx1 ->{y}; exists x1 x2. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
curry_imset2r
imset2Ul(A B : {set aT1}) (C : {set aT2}) : f @2: (A :|: B, C) = f @2: (A, C) :|: f @2: (B, C). Proof. by rewrite !curry_imset2l bigcup_setU. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
imset2Ul
imset2Ur(A : {set aT1}) (B C : {set aT2}) : f @2: (A, B :|: C) = f @2: (A, B) :|: f @2: (A, C). Proof. by rewrite !curry_imset2r bigcup_setU. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
imset2Ur
coverP := \bigcup_(B in P) B.
Definition
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
cover
pblockP x := odflt set0 (pick [pred B in P | x \in B]).
Definition
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
pblock
trivIsetP := \sum_(B in P) #|B| == #|cover P|.
Definition
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
trivIset
partitionP D := [&& cover P == D, trivIset P & set0 \notin P].
Definition
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
partition
is_transversalX P D := [&& partition P D, X \subset D & [forall B in P, #|X :&: B| == 1]].
Definition
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
is_transversal
transversalP D := [set odflt x [pick y in pblock P x] | x in D].
Definition
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
transversal
transversal_reprx0 X B := odflt x0 [pick x in X :&: B].
Definition
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
transversal_repr
leq_card_setUA B : #|A :|: B| <= #|A| + #|B| ?= iff [disjoint A & B]. Proof. rewrite -(addn0 #|_|) -setI_eq0 -cards_eq0 -cardsUI eq_sym. by rewrite (mono_leqif (leq_add2l _)). Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
leq_card_setU
leq_card_coverP : #|cover P| <= \sum_(A in P) #|A| ?= iff trivIset P. Proof. split; last exact: eq_sym. rewrite /cover; elim/big_rec2: _ => [|A n U _ leUn]; first by rewrite cards0. by rewrite (leq_trans (leq_card_setU A U).1) ?leq_add2l. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
leq_card_cover
imset_cover(T' : finType) P (f : T -> T') : [set f x | x in cover P] = \bigcup_(i in P) [set f x | x in i]. Proof. apply/setP=> y; apply/imsetP/bigcupP => [|[A AP /imsetP[x xA ->]]]. by move=> [x /bigcupP[A AP xA] ->]; exists A => //; rewrite imset_f. by exists x => //; apply/bigcupP; exists A. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
imset_cover
cover1A : cover [set A] = A. Proof. by rewrite /cover big_set1. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
cover1
trivIset1A : trivIset [set A]. Proof. by rewrite /trivIset cover1 big_set1. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
trivIset1
trivIsetPP : reflect {in P &, forall A B, A != B -> [disjoint A & B]} (trivIset P). Proof. rewrite -[P]set_enum; elim: {P}(enum _) (enum_uniq P) => [_ | A e IHe] /=. by rewrite /trivIset /cover !big_set0 cards0; left=> A; rewrite inE. case/andP; rewrite set_cons -(in_set (fun B => B \in e)) => PA {}/IHe. move: {e}[set x in e] PA => P PA IHP. rewrite /trivIset /cover !big_setU1 //= eq_sym. have:= leq_card_cover P; rewrite -(mono_leqif (leq_add2l #|A|)). move/(leqif_trans (leq_card_setU _ _))->; rewrite disjoints_subset setC_bigcup. case: bigcapsP => [disjA | meetA]; last first. right=> [tI]; case: meetA => B PB; rewrite -disjoints_subset. by rewrite tI ?setU11 ?setU1r //; apply: contraNneq PA => ->. apply: (iffP IHP) => [] tI B C PB PC; last by apply: tI; apply: setU1r. by case/setU1P: PC PB => [->|PC] /setU1P[->|PB]; try by [apply: tI | case/eqP]; first rewrite disjoint_sym; rewrite disjoints_subset disjA. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
trivIsetP
trivIsetSP Q : P \subset Q -> trivIset Q -> trivIset P. Proof. by move/subsetP/sub_in2=> sPQ /trivIsetP/sPQ/trivIsetP. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
trivIsetS
trivIsetDP Q : trivIset P -> trivIset (P :\: Q). Proof. move/trivIsetP => tP; apply/trivIsetP => A B /setDP[TA _] /setDP[TB _]; exact: tP. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
trivIsetD
trivIsetUP Q : trivIset Q -> trivIset P -> [disjoint cover Q & cover P] -> trivIset (Q :|: P). Proof. move => /trivIsetP tQ /trivIsetP tP dQP; apply/trivIsetP => A B. move => /setUP[?|?] /setUP[?|?]; first [exact:tQ|exact:tP|move => _]. by apply: disjointW dQP; rewrite bigcup_sup. by rewrite disjoint_sym; apply: disjointW dQP; rewrite bigcup_sup. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
trivIsetU
coverD1P B : trivIset P -> B \in P -> cover (P :\ B) = cover P :\: B. Proof. move/trivIsetP => tP SP; apply/setP => x; rewrite inE. apply/bigcupP/idP => [[A /setD1P [ADS AP] xA]|/andP[xNS /bigcupP[A AP xA]]]. by rewrite (disjointFr (tP _ _ _ _ ADS)) //=; apply/bigcupP; exists A. by exists A; rewrite // !inE AP andbT; apply: contraNneq xNS => <-. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
coverD1
trivIsetIP D : trivIset P -> trivIset (P ::&: D). Proof. by apply: trivIsetS; rewrite -setI_powerset subsetIl. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
trivIsetI
cover_setIP D : cover (P ::&: D) \subset cover P :&: D. Proof. by apply/bigcupsP=> A /setIdP[PA sAD]; rewrite subsetI sAD andbT (bigcup_max A). Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
cover_setI
mem_pblockP x : (x \in pblock P x) = (x \in cover P). Proof. rewrite /pblock; apply/esym/bigcupP. case: pickP => /= [A /andP[PA Ax]| noA]; first by rewrite Ax; exists A. by rewrite inE => [[A PA Ax]]; case/andP: (noA A). Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
mem_pblock
pblock_memP x : x \in cover P -> pblock P x \in P. Proof. by rewrite -mem_pblock /pblock; case: pickP => [A /andP[]| _] //=; rewrite inE. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
pblock_mem
def_pblockP B x : trivIset P -> B \in P -> x \in B -> pblock P x = B. Proof. move/trivIsetP=> tiP PB Bx; have Px: x \in cover P by apply/bigcupP; exists B. apply: (contraNeq (tiP _ _ _ PB)); first by rewrite pblock_mem. by apply/pred0Pn; exists x; rewrite /= mem_pblock Px. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
def_pblock
same_pblockP x y : trivIset P -> x \in pblock P y -> pblock P x = pblock P y. Proof. rewrite {1 3}/pblock => tI; case: pickP => [A|]; last by rewrite inE. by case/andP=> PA _{y} /= Ax; apply: def_pblock. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
same_pblock
eq_pblockP x y : trivIset P -> x \in cover P -> (pblock P x == pblock P y) = (y \in pblock P x). Proof. move=> tiP Px; apply/eqP/idP=> [eq_xy | /same_pblock-> //]. move: Px; rewrite -mem_pblock eq_xy /pblock. by case: pickP => [B /andP[] // | _] /[1!inE]. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
eq_pblock
trivIsetU1A P : {in P, forall B, [disjoint A & B]} -> trivIset P -> set0 \notin P -> trivIset (A |: P) /\ A \notin P. Proof. move=> tiAP tiP notPset0; split; last first. apply: contra notPset0 => P_A. by have:= tiAP A P_A; rewrite -setI_eq0 setIid => /eqP <-. apply/trivIsetP=> B1 B2 /setU1P[->|PB1] /setU1P[->|PB2]; by [apply: (trivIsetP _ tiP) | rewrite ?eqxx // ?(tiAP, disjoint_sym)]. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
trivIsetU1
cover_imsetJ F : cover (F @: J) = \bigcup_(i in J) F i. Proof. apply/setP=> x. apply/bigcupP/bigcupP=> [[_ /imsetP[i Ji ->]] | [i]]; first by exists i. by exists (F i); first apply: imset_f. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
cover_imset
trivIimsetJ F (P := F @: J) : {in J &, forall i j, j != i -> [disjoint F i & F j]} -> set0 \notin P -> trivIset P /\ {in J &, injective F}. Proof. move=> tiF notPset0; split=> [|i j Ji Jj /= eqFij]. apply/trivIsetP=> _ _ /imsetP[i Ji ->] /imsetP[j Jj ->] neqFij. by rewrite tiF // (contraNneq _ neqFij) // => ->. apply: contraNeq notPset0 => neq_ij; apply/imsetP; exists i => //; apply/eqP. by rewrite eq_sym -[F i]setIid setI_eq0 {1}eqFij tiF. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
trivIimset
cover_partitionP D : partition P D -> cover P = D. Proof. by case/and3P=> /eqP. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat div seq", "From mathcomp Require Import choice fintype finfun bigop" ]
boot/finset.v
cover_partition