End FunImageComp.
Notation "\bigcup_ ( i <- r | P ) F" :=
(\big[@setU _/set0]_(i <- r | P) F%SET) : set_scope.
Notation "\bigcup_ ( i <- r ) F" :=
(\big[@setU _/set0]_(i <- r) F%SET) : set_scope.
Notation "\bigcup_ ( m <= i < n | P ) F" :=
(\big[@setU _/set0]_(m <= i < n | P%B) F%SET) : set_scope.
Notation "\bigcup_ ( m <= i < n ) F" :=
(\big[@setU _/set0]_(m <= i < n) F%SET) : set_scope.
Notation "\bigcup_ ( i | P ) F" :=
(\big[@setU _/set0]_(i | P%B) F%SET) : set_scope.
Notation "\bigcup_ i F" :=
(\big[@setU _/set0]_i F%SET) : set_scope.
Notation "\bigcup_ ( i : t | P ) F" :=
(\big[@setU _/set0]_(i : t | P%B) F%SET) (only parsing): set_scope.
Notation "\bigcup_ ( i : t ) F" :=
(\big[@setU _/set0]_(i : t) F%SET) (only parsing) : set_scope.
Notation "\bigcup_ ( i < n | P ) F" :=
(\big[@setU _/set0]_(i < n | P%B) F%SET) : set_scope.
Notation "\bigcup_ ( i < n ) F" :=
(\big[@setU _/set0]_ (i < n) F%SET) : set_scope.
Notation "\bigcup_ ( i 'in' A | P ) F" :=
(\big[@setU _/set0]_(i in A | P%B) F%SET) : set_scope.
Notation "\bigcup_ ( i 'in' A ) F" :=
(\big[@setU _/set0]_(i in A) F%SET) : set_scope.
Notation "\bigcap_ ( i <- r | P ) F" :=
(\big[@setI _/setT]_(i <- r | P%B) F%SET) : set_scope.
Notation "\bigcap_ ( i <- r ) F" :=
(\big[@setI _/setT]_(i <- r) F%SET) : set_scope.
Notation "\bigcap_ ( m <= i < n | P ) F" :=
(\big[@setI _/setT]_(m <= i < n | P%B) F%SET) : set_scope.
Notation "\bigcap_ ( m <= i < n ) F" :=
(\big[@setI _/setT]_(m <= i < n) F%SET) : set_scope.
Notation "\bigcap_ ( i | P ) F" :=
(\big[@setI _/setT]_(i | P%B) F%SET) : set_scope.
Notation "\bigcap_ i F" :=
(\big[@setI _/setT]_i F%SET) : set_scope.
Notation "\bigcap_ ( i : t | P ) F" :=
(\big[@setI _/setT]_(i : t | P%B) F%SET) (only parsing): set_scope.
Notation "\bigcap_ ( i : t ) F" :=
(\big[@setI _/setT]_(i : t) F%SET) (only parsing) : set_scope.
Notation "\bigcap_ ( i < n | P ) F" :=
(\big[@setI _/setT]_(i < n | P%B) F%SET) : set_scope.
Notation "\bigcap_ ( i < n ) F" :=
(\big[@setI _/setT]_(i < n) F%SET) : set_scope.
Notation "\bigcap_ ( i 'in' A | P ) F" :=
(\big[@setI _/setT]_(i in A | P%B) F%SET) : set_scope.
Notation "\bigcap_ ( i 'in' A ) F" :=
(\big[@setI _/setT]_(i in A) F%SET) : set_scope.
Section BigSetOps.
Variables T I : finType.
Implicit Types (U : pred T) (P : pred I) (A B : {set I}) (F :  I -> {set T}).

(* Specifications: *)
(* It is very hard to use this lemma, because the unification fails to *)
(* defer the F j pattern (even though it's a Miller pattern!).         *)
Lemma bigcup_sup j P F : P j -> F j \subset \bigcup_(i | P i) F i.
Lemma bigcupsP U P F :
reflect (forall i, P i -> F i \subset U) (\bigcup_(i | P i) F i \subset U).
Lemma bigcup_disjoint U P F :
(forall i, P i -> [disjoint U & F i]) -> [disjoint U & \bigcup_(i | P i) F i].
Lemma bigcup_setU A B F :
\bigcup_(i in A :|: B) F i =
(\bigcup_(i in A) F i) :|: (\bigcup_ (i in B) F i).
Lemma bigcup_seq r F : \bigcup_(i <- r) F i = \bigcup_(i in r) F i.
(* Unlike its setU counterpart, this lemma is useable. *)
Lemma bigcap_inf j P F : P j -> \bigcap_(i | P i) F i \subset F j.
Lemma bigcapP x P F :
reflect (forall i, P i -> x \in F i) (x \in \bigcap_(i | P i) F i).
Lemma setC_bigcup J r (P : pred J) (F : J -> {set T}) :
~: (\bigcup_(j <- r | P j) F j) = \bigcap_(j <- r | P j) ~: F j.
Lemma curry_imset2l : f @2: (D1, D2) = \bigcup_(x1 in D1) f x1 @: D2.
Lemma curry_imset2r : f @2: (D1, D2) = \bigcup_(x2 in D2) f^~ x2 @: D1.
End Curry.
Lemma imset2Ul (A B : {set aT1}) (C : {set aT2}) :
f @2: (A :|: B, C) = f @2: (A, C) :|: f @2: (B, C).
Lemma leq_card_cover P : #|cover P| <= \sum_(A in P) #|A| ?= iff trivIset P.
Lemma trivIsetP P :
reflect {in P &, forall A B, A != B -> [disjoint A & B]} (trivIset P).
Lemma trivIsetS P Q : P \subset Q -> trivIset Q -> trivIset P.
Lemma mem_pblock P x : (x \in pblock P x) = (x \in cover P).
Lemma pblock_mem P x : x \in cover P -> pblock P x \in P.
Lemma def_pblock P B x : trivIset P -> B \in P -> x \in B -> pblock P x = B.
Lemma same_pblock P x y :
trivIset P -> x \in pblock P y -> pblock P x = pblock P y.
Lemma eq_pblock P x y :
trivIset P -> x \in cover P ->
(pblock P x == pblock P y) = (y \in pblock P x).
Lemma trivIsetU1 A P :
{in P, forall B, [disjoint A & B]} -> trivIset P -> set0 \notin P ->
trivIset (A |: P) /\ A \notin P.
Lemma cover_imset J F : cover (F @: J) = \bigcup_(i in J) F i.
Lemma trivIimset J 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}.
Lemma cover_partition P D : partition P D -> cover P = D.
Section BigOps.