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 |
|---|---|---|---|---|---|---|
subsetU1x A : A \subset x |: A.
Proof. exact: subsetUr. 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 | subsetU1 | |
subsetDlA B : A :\: B \subset A.
Proof. by rewrite setDE 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 | subsetDl | |
subD1setA x : A :\ x \subset A.
Proof. by rewrite subsetDl. 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 | subD1set | |
subsetDrA B : A :\: B \subset ~: B.
Proof. by rewrite setDE 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 | subsetDr | |
sub1setA x : ([set x] \subset A) = (x \in A).
Proof. by rewrite -subset_pred1; apply: eq_subset=> y; 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 | sub1set | |
cards_eq_specA : seq T -> {set T} -> nat -> Type :=
| CardEq (s : seq T) & uniq s : cards_eq_spec A s [set x | x \in s] (size s). | Variant | 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 | cards_eq_spec | |
cards_eqPA : cards_eq_spec A (enum A) A #|A|.
Proof.
by move: (enum A) (cardE A) (set_enum A) (enum_uniq A) => s -> <-; constructor.
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 | cards_eqP | |
cards1PA : reflect (exists x, A = [set x]) (#|A| == 1).
Proof.
apply: (iffP idP) => [|[x ->]]; last by rewrite cards1.
by have [[|x []]// _] := cards_eqP; exists x; apply/setP => y; 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 | cards1P | |
cards2PA : reflect (exists x y : T, x != y /\ A = [set x; y])
(#|A| == 2).
Proof.
apply: (iffP idP) => [|[x] [y] [xy ->]]; last by rewrite cards2 xy.
have [[|x [|y []]]//=] := cards_eqP; rewrite !inE andbT => neq_xy.
by exists x, y; split=> //; apply/setP => z; 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 | cards2P | |
subset1A x : (A \subset [set x]) = (A == [set x]) || (A == set0).
Proof.
rewrite eqEcard cards1 -cards_eq0 orbC andbC.
by case: posnP => // A0; rewrite (cards0_eq A0) sub0set.
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 | subset1 | |
powerset1x : powerset [set x] = [set set0; [set x]].
Proof. by apply/setP=> A; rewrite inE subset1 orbC set1.unlock !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 | powerset1 | |
setIidPlA B : reflect (A :&: B = A) (A \subset B).
Proof.
apply: (iffP subsetP) => [sAB | <- x /setIP[] //].
by apply/setP=> x /[1!inE]; apply/andb_idr/sAB.
Qed.
Arguments setIidPl {A B}. | 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 | setIidPl | |
setIidPrA B : reflect (A :&: B = B) (B \subset A).
Proof. by rewrite setIC; apply: setIidPl. 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 | setIidPr | |
cardsDSA B : B \subset A -> #|A :\: B| = #|A| - #|B|.
Proof. by rewrite cardsD => /setIidPr->. 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 | cardsDS | |
setUidPlA B : reflect (A :|: B = A) (B \subset A).
Proof.
by rewrite -setCS (sameP setIidPl eqP) -setCU (inj_eq setC_inj); apply: 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 | setUidPl | |
setUidPrA B : reflect (A :|: B = B) (A \subset B).
Proof. by rewrite setUC; apply: setUidPl. 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 | setUidPr | |
setDidPlA B : reflect (A :\: B = A) [disjoint A & B].
Proof. by rewrite setDE disjoints_subset; apply: setIidPl. 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 | setDidPl | |
subIsetA B C : (B \subset A) || (C \subset A) -> (B :&: C \subset A).
Proof. by case/orP; apply: subset_trans; rewrite (subsetIl, 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 | subIset | |
subsetIA B C : (A \subset B :&: C) = (A \subset B) && (A \subset C).
Proof.
rewrite !(sameP setIidPl eqP) setIA; have [-> //|] := eqVneq (A :&: B) A.
by apply: contraNF => /eqP <-; rewrite -setIA -setIIl setIAC.
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 | subsetI | |
subsetIPA B C : reflect (A \subset B /\ A \subset C) (A \subset B :&: C).
Proof. by rewrite subsetI; apply: andP. 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 | subsetIP | |
subsetIidlA B : (A \subset A :&: B) = (A \subset B).
Proof. by rewrite subsetI subxx. 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 | subsetIidl | |
subsetIidrA B : (B \subset A :&: B) = (B \subset A).
Proof. by rewrite setIC subsetIidl. 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 | subsetIidr | |
powersetIA B : powerset (A :&: B) = powerset A :&: powerset B.
Proof. by apply/setP=> C; rewrite !inE subsetI. 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 | powersetI | |
subUsetA B C : (B :|: C \subset A) = (B \subset A) && (C \subset A).
Proof. by rewrite -setCS setCU subsetI !setCS. 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 | subUset | |
subsetUA B C : (A \subset B) || (A \subset C) -> A \subset B :|: C.
Proof. by rewrite -!(setCS _ A) setCU; apply: subIset. 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 | subsetU | |
subUsetPA B C : reflect (A \subset C /\ B \subset C) (A :|: B \subset C).
Proof. by rewrite subUset; apply: andP. 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 | subUsetP | |
subsetCA B : (A \subset ~: B) = (B \subset ~: A).
Proof. by rewrite -setCS setCK. 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 | subsetC | |
subCsetA B : (~: A \subset B) = (~: B \subset A).
Proof. by rewrite -setCS setCK. 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 | subCset | |
subsetDA B C : (A \subset B :\: C) = (A \subset B) && [disjoint A & C].
Proof. by rewrite setDE subsetI -disjoints_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 | subsetD | |
subDsetA B C : (A :\: B \subset C) = (A \subset B :|: C).
Proof.
apply/subsetP/subsetP=> sABC x; rewrite !inE.
by case Bx: (x \in B) => // Ax; rewrite sABC ?inE ?Bx.
by case Bx: (x \in B) => // /sABC; rewrite inE Bx.
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 | subDset | |
subsetDPA B C :
reflect (A \subset B /\ [disjoint A & C]) (A \subset B :\: C).
Proof. by rewrite subsetD; apply: andP. 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 | subsetDP | |
setU_eq0A B : (A :|: B == set0) = (A == set0) && (B == set0).
Proof. by rewrite -!subset0 subUset. 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 | setU_eq0 | |
setD_eq0A B : (A :\: B == set0) = (A \subset B).
Proof. by rewrite -subset0 subDset setU0. 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 | setD_eq0 | |
setI_eq0A B : (A :&: B == set0) = [disjoint A & B].
Proof. by rewrite disjoints_subset -setD_eq0 setDE setCK. 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 | setI_eq0 | |
eq0_subsetB A : (A == set0) = (A \subset B) && (A \subset ~: B).
Proof. by rewrite -subsetI setICr subset0. 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 | eq0_subset | |
disjoint_setI0A B : [disjoint A & B] -> A :&: B = set0.
Proof. by rewrite -setI_eq0; move/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 | disjoint_setI0 | |
subsetC_disjointA B : [disjoint A & B] ->
forall C, C != set0 -> C \subset A -> ~~ (C \subset B).
Proof.
move=> dAB C + CA; apply: contra_neqN => CB.
by apply/eqP; rewrite -subset0 -(disjoint_setI0 dAB) subsetI CA CB.
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 | subsetC_disjoint | |
disjoints1A x : [disjoint [set x] & A] = (x \notin A).
Proof. by rewrite (@eq_disjoint1 _ x) // => y; 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 | disjoints1 | |
subsetD1A B x : (A \subset B :\ x) = (A \subset B) && (x \notin A).
Proof. by rewrite setDE subsetI subsetC sub1set 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 | subsetD1 | |
subsetD1PA B x : reflect (A \subset B /\ x \notin A) (A \subset B :\ x).
Proof. by rewrite subsetD1; apply: andP. 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 | subsetD1P | |
properD1A x : x \in A -> A :\ x \proper A.
Proof.
move=> Ax; rewrite properE subsetDl; apply/subsetPn; exists x=> //.
by rewrite in_setD1 Ax 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 | properD1 | |
properIrA B : ~~ (B \subset A) -> A :&: B \proper B.
Proof. by move=> nsAB; rewrite properE subsetIr subsetI negb_and nsAB. 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 | properIr | |
properIlA B : ~~ (A \subset B) -> A :&: B \proper A.
Proof. by move=> nsBA; rewrite properE subsetIl subsetI negb_and nsBA 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 | properIl | |
properUrA B : ~~ (A \subset B) -> B \proper A :|: B.
Proof. by rewrite properE subsetUr subUset subxx /= andbT. 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 | properUr | |
properUlA B : ~~ (B \subset A) -> A \proper A :|: B.
Proof. by move=> not_sBA; rewrite setUC properUr. 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 | properUl | |
proper1setA x : ([set x] \proper A) -> (x \in A).
Proof. by move/proper_sub; 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 | proper1set | |
properIsetA B C : (B \proper A) || (C \proper A) -> (B :&: C \proper A).
Proof. by case/orP; apply: sub_proper_trans; rewrite (subsetIl, 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 | properIset | |
properIA B C : (A \proper B :&: C) -> (A \proper B) && (A \proper C).
Proof.
move=> pAI; apply/andP.
by split; apply: (proper_sub_trans pAI); rewrite (subsetIl, 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 | properI | |
properUA B C : (B :|: C \proper A) -> (B \proper A) && (C \proper A).
Proof.
move=> pUA; apply/andP.
by split; apply: sub_proper_trans pUA; rewrite (subsetUr, 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 | properU | |
properDA B C : (A \proper B :\: C) -> (A \proper B) && [disjoint A & C].
Proof. by rewrite setDE disjoints_subset => /properI/andP[-> /proper_sub]. 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 | properD | |
properCrA B : (A \proper ~: B) = (B \proper ~: A).
Proof. by rewrite -properC setCK. 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 | properCr | |
properClA B : (~: A \proper B) = (~: B \proper A).
Proof. by rewrite -properC setCK. 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 | properCl | |
enum_setUA B : perm_eq (enum (A :|: B)) (undup (enum A ++ enum B)).
Proof.
apply: uniq_perm; rewrite ?enum_uniq ?undup_uniq//.
by move=> i; rewrite mem_undup mem_enum inE mem_cat !mem_enum.
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 | enum_setU | |
enum_setIA B : perm_eq (enum (A :&: B)) (filter [in B] (enum A)).
Proof.
apply: uniq_perm; rewrite ?enum_uniq// 1?filter_uniq// ?enum_uniq//.
by move=> x; rewrite /= mem_enum mem_filter inE mem_enum 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 | enum_setI | |
has_set1pA A a : has pA (enum [set a]) = pA a.
Proof. by rewrite enum_set1 has_seq1. 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 | has_set1 | |
has_setUpA A B :
has pA (enum (A :|: B)) = (has pA (enum A)) || (has pA (enum B)).
Proof. by rewrite (perm_has _ (enum_setU _ _)) has_undup has_cat. 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 | has_setU | |
all_set1pA A a : all pA (enum [set a]) = pA a.
Proof. by rewrite enum_set1 all_seq1. 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 | all_set1 | |
all_setUpA A B :
all pA (enum (A :|: B)) = (all pA (enum A)) && (all pA (enum B)).
Proof. by rewrite (perm_all _ (enum_setU _ _)) all_undup all_cat. 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 | all_setU | |
Definition_ := isComLaw.Build {set T} [set: T] (@setI T)
(@setIA T) (@setIC T) (@setTI T).
HB.instance Definition _ := isMulLaw.Build {set T} set0 (@setI T)
(@set0I T) (@setI0 T).
HB.instance Definition _ := isComLaw.Build {set T} set0 (@setU T)
(@setUA T) (@setUC T) (@set0U T).
HB.instance Definition _ := isMulLaw.Build {set T} [set: T] (@setU T)
(@setTU T) (@setUT T).
HB.instance Definition _ := isAddLaw.Build {set T} (@setU T) (@setI T)
(@setUIl T) (@setUIr T).
HB.instance Definition _ := isAddLaw.Build {set T} (@setI T) (@setU T)
(@setIUl T) (@setIUr T). | HB.instance | 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 | Definition | |
setX:= [set u | u.1 \in A1 & u.2 \in A2]. | 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 | setX | |
in_setXx1 x2 : ((x1, x2) \in setX) = (x1 \in A1) && (x2 \in A2).
Proof. by 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 | in_setX | |
setXPx1 x2 : reflect (x1 \in A1 /\ x2 \in A2) ((x1, x2) \in setX).
Proof. by rewrite inE; apply: andP. 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 | setXP | |
cardsX: #|setX| = #|A1| * #|A2|.
Proof. by rewrite cardsE cardX. 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 | cardsX | |
setXn:= [set x : {dffun _} in family A]. | 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 | setXn | |
in_setXnx : (x \in setXn) = [forall i, x i \in A i].
Proof. by 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 | in_setXn | |
setXnPx : reflect (forall i, x i \in A i) (x \in setXn).
Proof. by rewrite inE; apply: forallP. 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 | setXnP | |
cardsXn: #|setXn| = \prod_i #|A i|.
Proof. by rewrite cardsE card_family foldrE big_map big_enum. 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 | cardsXn | |
imset(aT rT : finType) f mD := [set y in @image_mem aT rT f mD]. | 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 | imset | |
imset_unlock:= Unlockable imset.unlock.
HB.lock | Canonical | 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_unlock | |
imset2(aT1 aT2 rT : finType) f (D1 : mem_pred aT1) (D2 : _ -> mem_pred aT2) :=
[set y in @image_mem _ rT (uncurry f) (mem [pred u | D1 u.1 & D2 u.1 u.2])]. | 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 | imset2 | |
imset2_unlock:= Unlockable imset2.unlock. | Canonical | 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_unlock | |
preimset(aT : finType) rT f (R : mem_pred rT) :=
[set x : aT | in_mem (f x) R]. | 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 | preimset | |
imsetPD y : reflect (exists2 x, in_mem x D & y = f x) (y \in imset f D).
Proof. by rewrite [@imset]unlock inE; apply: imageP. 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 | imsetP | |
imset2_specD1 D2 y : Prop :=
Imset2spec x1 x2 of in_mem x1 D1 & in_mem x2 (D2 x1) & y = f2 x1 x2. | Variant | 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_spec | |
imset2PD1 D2 y : reflect (imset2_spec D1 D2 y) (y \in imset2 f2 D1 D2).
Proof.
rewrite [@imset2]unlock inE.
apply: (iffP imageP) => [[[x1 x2] Dx12] | [x1 x2 Dx1 Dx2]] -> {y}.
by case/andP: Dx12; exists x1 x2.
by exists (x1, x2); rewrite //= !inE Dx1.
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 | imset2P | |
imset_f(D : {pred aT}) x : x \in D -> f x \in f @: D.
Proof. by move=> Dx; apply/imsetP; exists x. 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_f | |
mem_imset(D : {pred aT}) x : injective f -> f x \in f @: D = (x \in D).
Proof.
by move=> f_inj; apply/imsetP/idP;[case=> [y] ? /f_inj -> | move=> ?; exists x].
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_imset | |
imset0: f @: set0 = set0.
Proof. by apply/setP => y /[!inE]; apply/imsetP => -[x /[!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 | imset0 | |
imset_eq0(A : {set aT}) : (f @: A == set0) = (A == set0).
Proof.
have [-> | [x Ax]] := set_0Vmem A; first by rewrite imset0 !eqxx.
by rewrite -!cards_eq0 (cardsD1 x) Ax (cardsD1 (f x)) 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 | imset_eq0 | |
imset_set1x : f @: [set x] = [set f x].
Proof.
apply/setP => y.
by apply/imsetP/set1P=> [[x' /set1P-> //]| ->]; exists x; 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 | imset_set1 | |
imset_inj: injective f -> injective (fun A : {set aT} => f @: A).
Proof.
move=> inj_f A B => /setP E; apply/setP => x.
by rewrite -(mem_imset A x inj_f) E mem_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 | imset_inj | |
imset_disjoint(A B : {pred aT}) :
injective f -> [disjoint f @: A & f @: B] = [disjoint A & B].
Proof.
move=> inj_f; apply/pred0Pn/pred0Pn => /= [[_ /andP[/imsetP[x xA ->]] xB]|].
by exists x; rewrite xA -(mem_imset B x inj_f).
by move=> [x /andP[xA xB]]; exists (f x); rewrite !mem_imset ?xA.
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_disjoint | |
imset2_f(D : {pred aT}) (D2 : aT -> {pred aT2}) x x2 :
x \in D -> x2 \in D2 x ->
f2 x x2 \in [set f2 y y2 | y in D, y2 in D2 y].
Proof. by move=> Dx Dx2; apply/imset2P; exists x 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 | imset2_f | |
mem_imset2(D : {pred aT}) (D2 : aT -> {pred aT2}) x x2 :
injective2 f2 ->
(f2 x x2 \in [set f2 y y2 | y in D, y2 in D2 y])
= (x \in D) && (x2 \in D2 x).
Proof.
move=> inj2_f; apply/imset2P/andP => [|[xD xD2]]; last by exists x x2.
by move => [x' x2' xD xD2 eq_f2]; case: (inj2_f _ _ _ _ eq_f2) => -> ->.
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_imset2 | |
sub_imset_pre(A : {pred aT}) (B : {pred rT}) :
(f @: A \subset B) = (A \subset f @^-1: B).
Proof.
apply/subsetP/subsetP=> [sfAB x Ax | sAf'B fx].
by rewrite inE sfAB ?imset_f.
by move=> /imsetP[a + ->] => /sAf'B /[!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 | sub_imset_pre | |
preimsetS(A B : {pred rT}) :
A \subset B -> (f @^-1: A) \subset (f @^-1: B).
Proof. by move=> sAB; apply/subsetP=> y /[!inE]; apply: 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 | preimsetS | |
preimset0: f @^-1: set0 = set0.
Proof. by apply/setP=> x; 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 | preimset0 | |
preimsetT: f @^-1: setT = setT.
Proof. by apply/setP=> x; 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 | preimsetT | |
preimsetI(A B : {set rT}) :
f @^-1: (A :&: B) = (f @^-1: A) :&: (f @^-1: B).
Proof. by apply/setP=> y; 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 | preimsetI | |
preimsetU(A B : {set rT}) :
f @^-1: (A :|: B) = (f @^-1: A) :|: (f @^-1: B).
Proof. by apply/setP=> y; 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 | preimsetU | |
preimsetD(A B : {set rT}) :
f @^-1: (A :\: B) = (f @^-1: A) :\: (f @^-1: B).
Proof. by apply/setP=> y; 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 | preimsetD | |
preimsetC(A : {set rT}) : f @^-1: (~: A) = ~: f @^-1: A.
Proof. by apply/setP=> y; 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 | preimsetC | |
imsetS(A B : {pred aT}) : A \subset B -> f @: A \subset f @: B.
Proof.
move=> sAB; apply/subsetP => _ /imsetP[x Ax ->].
by apply/imsetP; exists x; rewrite ?(subsetP sAB).
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 | imsetS | |
imset_proper(A B : {set aT}) :
{in B &, injective f} -> A \proper B -> f @: A \proper f @: B.
Proof.
move=> injf /properP[sAB [x Bx nAx]]; rewrite properE imsetS //=.
apply: contra nAx => sfBA.
have: f x \in f @: A by rewrite (subsetP sfBA) ?imset_f.
by case/imsetP=> y Ay /injf-> //; apply: subsetP sAB y Ay.
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_proper | |
preimset_proper(A B : {set rT}) :
B \subset codom f -> A \proper B -> (f @^-1: A) \proper (f @^-1: B).
Proof.
move=> sBc /properP[sAB [u Bu nAu]]; rewrite properE preimsetS //=.
by apply/subsetPn; exists (iinv (subsetP sBc _ Bu)); rewrite inE /= 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 | preimset_proper | |
imsetU(A B : {set aT}) : f @: (A :|: B) = (f @: A) :|: (f @: B).
Proof.
apply/eqP; rewrite eqEsubset subUset.
rewrite 2?imsetS (andbT, subsetUl, subsetUr) // andbT.
apply/subsetP=> _ /imsetP[x ABx ->]; apply/setUP.
by case/setUP: ABx => [Ax | Bx]; [left | right]; apply/imsetP; exists x.
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 | imsetU | |
imsetU1a (A : {set aT}) : f @: (a |: A) = f a |: (f @: A).
Proof. by rewrite imsetU imset_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 | imsetU1 | |
imsetI(A B : {set aT}) :
{in A & B, injective f} -> f @: (A :&: B) = f @: A :&: f @: B.
Proof.
move=> injf; apply/eqP; rewrite eqEsubset subsetI.
rewrite 2?imsetS (andTb, subsetIl, subsetIr) //=.
apply/subsetP=> _ /setIP[/imsetP[x Ax ->] /imsetP[z Bz /injf eqxz]].
by rewrite imset_f // inE Ax eqxz.
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 | imsetI | |
imset2Sl(A B : {pred aT}) (C : {pred aT2}) :
A \subset B -> f2 @2: (A, C) \subset f2 @2: (B, C).
Proof.
move=> sAB; apply/subsetP=> _ /imset2P[x y Ax Cy ->].
by apply/imset2P; exists x y; rewrite ?(subsetP sAB).
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 | imset2Sl | |
imset2Sr(A B : {pred aT2}) (C : {pred aT}) :
A \subset B -> f2 @2: (C, A) \subset f2 @2: (C, B).
Proof.
move=> sAB; apply/subsetP=> _ /imset2P[x y Ax Cy ->].
by apply/imset2P; exists x y; rewrite ?(subsetP sAB).
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 | imset2Sr |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.