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
fin_pred_sort(T : finType) (pT : predType T) := pred_sort pT. Identity Coercion pred_sort_of_fin : fin_pred_sort >-> pred_sort.
Definition
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
fin_pred_sort
enum_memT (mA : mem_pred _) := filter mA (Finite.enum T).
Definition
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
enum_mem
enumA := (enum_mem (mem A)).
Notation
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
enum
pick(T : finType) (P : pred T) := ohead (enum P).
Definition
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
pick
pick_trueT (x : T) := true. Reserved Notation "[ 'pick' x : T ]" (x name, format "[ 'pick' x : T ]").
Definition
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
pick_true
card_unlock:= Unlockable card.unlock.
Canonical
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
card_unlock
pred0b(T : finType) (P : pred T) := #|P| == 0. Prenex Implicits pred0b.
Definition
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
pred0b
quantified:= Quantified of bool. Delimit Scope fin_quant_scope with Q. Bind Scope fin_quant_scope with quantified.
Variant
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
quantified
quant0bBp := pred0b [pred x : T | let: F^* := Bp x x in F].
Definition
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
quant0b
exB x y := B.
Definition
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
ex
allB x y := let: F^* := B in (~~ F)^*.
Definition
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
all
all_inC B x y := let: F^* := B in (~~ (C ==> F))^*.
Definition
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
all_in
ex_inC B x y := let: F^* := B in (C && F)^*.
Definition
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
ex_in
disjointT (A B : mem_pred _) := @pred0b T (predI A B).
Definition
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
disjoint
subset(T : finType) (A B : mem_pred T) : bool := pred0b (predD A B).
Definition
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
subset
subset_unlock:= Unlockable subset.unlock.
Canonical
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
subset_unlock
properT A B := @subset T A B && ~~ subset B A.
Definition
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
proper
enumP: Finite.axiom (Finite.enum T). Proof. by rewrite unlock; apply: enumP_subdef. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
enumP
enumT: enum T = Finite.enum T. Proof. exact: filter_predT. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
enumT
mem_enumA : enum A =i A. Proof. by move=> x; rewrite mem_filter andbC -has_pred1 has_count enumP. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
mem_enum
enum_uniqA : uniq (enum A). Proof. by apply/filter_uniq/count_mem_uniq => x; rewrite enumP -enumT mem_enum. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
enum_uniq
enum0: enum pred0 = Nil T. Proof. exact: filter_pred0. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
enum0
enum1x : enum (pred1 x) = [:: x]. Proof. rewrite [enum _](all_pred1P x _ _); first by rewrite size_filter enumP. by apply/allP=> y; rewrite mem_enum. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
enum1
pick_spec: option T -> Type := | Pick x of P x : pick_spec (Some x) | Nopick of P =1 xpred0 : pick_spec None.
Variant
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
pick_spec
pickP: pick_spec (pick P). Proof. rewrite /pick; case: (enum _) (mem_enum P) => [|x s] Pxs /=. by right; apply: fsym. by left; rewrite -[P _]Pxs mem_head. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
pickP
eq_enumA B : A =i B -> enum A = enum B. Proof. by move=> eqAB; apply: eq_filter. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
eq_enum
eq_pickP Q : P =1 Q -> pick P = pick Q. Proof. by move=> eqPQ; rewrite /pick (eq_enum eqPQ). Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
eq_pick
cardEA : #|A| = size (enum A). Proof. by rewrite unlock. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
cardE
eq_cardA B : A =i B -> #|A| = #|B|. Proof. by move=> eqAB; rewrite !cardE (eq_enum eqAB). Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
eq_card
eq_card_transA B n : #|A| = n -> B =i A -> #|B| = n. Proof. by move <-; apply: eq_card. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
eq_card_trans
card0: #|@pred0 T| = 0. Proof. by rewrite cardE enum0. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
card0
cardT: #|T| = size (enum T). Proof. by rewrite cardE. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
cardT
card1x : #|pred1 x| = 1. Proof. by rewrite cardE enum1. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
card1
eq_card0A : A =i pred0 -> #|A| = 0. Proof. exact: eq_card_trans card0. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
eq_card0
eq_cardTA : A =i predT -> #|A| = size (enum T). Proof. exact: eq_card_trans cardT. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
eq_cardT
eq_card1x A : A =i pred1 x -> #|A| = 1. Proof. exact: eq_card_trans (card1 x). Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
eq_card1
cardUIA B : #|[predU A & B]| + #|[predI A & B]| = #|A| + #|B|. Proof. by rewrite !cardE !size_filter count_predUI. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
cardUI
cardIDB A : #|[predI A & B]| + #|[predD A & B]| = #|A|. Proof. rewrite -cardUI addnC [#|predI _ _|]eq_card0 => [|x] /=. by apply: eq_card => x; rewrite !inE andbC -andb_orl orbN. by rewrite !inE -!andbA andbC andbA andbN. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
cardID
cardCA : #|A| + #|[predC A]| = #|T|. Proof. by rewrite !cardE !size_filter count_predC. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
cardC
cardU1x A : #|[predU1 x & A]| = (x \notin A) + #|A|. Proof. case Ax: (x \in A). by apply: eq_card => y /[1!inE]/=; case: eqP => // ->. rewrite /= -(card1 x) -cardUI addnC. rewrite [#|predI _ _|]eq_card0 => [|y /=]; first exact: eq_card. by rewrite !inE; case: eqP => // ->. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
cardU1
card2x y : #|pred2 x y| = (x != y).+1. Proof. by rewrite cardU1 card1 addn1. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
card2
cardC1x : #|predC1 x| = #|T|.-1. Proof. by rewrite -(cardC (pred1 x)) card1. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
cardC1
cardD1x A : #|A| = (x \in A) + #|[predD1 A & x]|. Proof. case Ax: (x \in A); last first. by apply: eq_card => y /[!inE]/=; case: eqP => // ->. rewrite /= -(card1 x) -cardUI addnC /=. rewrite [#|predI _ _|]eq_card0 => [|y]; last by rewrite !inE; case: eqP. by apply: eq_card => y /[!inE]; case: eqP => // ->. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
cardD1
max_cardA : #|A| <= #|T|. Proof. by rewrite -(cardC A) leq_addr. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
max_card
card_sizes : #|s| <= size s. Proof. elim: s => [|x s IHs] /=; first by rewrite card0. by rewrite cardU1 /=; case: (~~ _) => //; apply: leqW. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
card_size
card_uniqPs : reflect (#|s| = size s) (uniq s). Proof. elim: s => [|x s IHs]; first by left; apply: card0. rewrite cardU1 /= /addn; case: {+}(x \in s) => /=. by right=> card_Ssz; have:= card_size s; rewrite card_Ssz ltnn. by apply: (iffP IHs) => [<-| [<-]]. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
card_uniqP
card0_eqA : #|A| = 0 -> A =i pred0. Proof. by move=> A0 x; apply/idP => Ax; rewrite (cardD1 x) Ax in A0. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
card0_eq
fintype0: T -> #|T| <> 0. Proof. by move=> x /card0_eq/(_ x). Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
fintype0
pred0PP : reflect (P =1 pred0) (pred0b P). Proof. by apply: (iffP eqP); [apply: card0_eq | apply: eq_card0]. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
pred0P
pred0PnP : reflect (exists x, P x) (~~ pred0b P). Proof. case: (pickP P) => [x Px | P0]. by rewrite (introN (pred0P P)) => [|P0]; [left; exists x | rewrite P0 in Px]. by rewrite -lt0n eq_card0 //; right=> [[x]]; rewrite P0. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
pred0Pn
card_gt0PA : reflect (exists i, i \in A) (#|A| > 0). Proof. by rewrite lt0n; apply: pred0Pn. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
card_gt0P
card_le1P{A} : reflect {in A, forall x, A =i pred1 x} (#|A| <= 1). Proof. apply: (iffP idP) => [A1 x xA y|]; last first. by have [/= x xA /(_ _ xA)/eq_card1->|/eq_card0->//] := pickP [in A]. move: A1; rewrite (cardD1 x) xA ltnS leqn0 => /eqP/card0_eq/(_ y). by rewrite !inE; have [->|]:= eqP. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
card_le1P
mem_card1A : #|A| = 1 -> {x | A =i pred1 x}. Proof. move=> A1; have /card_gt0P/sigW[x xA]: #|A| > 0 by rewrite A1. by exists x; apply/card_le1P; rewrite ?A1. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
mem_card1
card1PA : reflect (exists x, A =i pred1 x) (#|A| == 1). Proof. by apply: (iffP idP) => [/eqP/mem_card1[x inA]|[x /eq_card1/eqP//]]; exists x. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
card1P
card_le1_eqPA : reflect {in A &, forall x, all_equal_to x} (#|A| <= 1). Proof. apply: (iffP card_le1P) => [Ale1 x y xA yA /=|all_eq x xA y]. by apply/eqP; rewrite -[_ == _]/(y \in pred1 x) -Ale1. by rewrite inE; case: (altP (y =P x)) => [->//|]; exact/contra_neqF/all_eq. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
card_le1_eqP
fintype_le1P: reflect (forall x : T, all_equal_to x) (#|T| <= 1). Proof. apply: (iffP (card_le1_eqP {:T})); [exact: in2T | exact: in2W]. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
fintype_le1P
fintype1: #|T| = 1 -> {x : T | all_equal_to x}. Proof. by move=> /mem_card1[x ex]; exists x => y; suff: y \in T by rewrite ex => /eqP. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
fintype1
fintype1P: reflect (exists x, all_equal_to x) (#|T| == 1). Proof. apply: (iffP idP) => [/eqP/fintype1|] [x eqx]; first by exists x. by apply/card1P; exists x => y; rewrite eqx !inE eqxx. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
fintype1P
subsetEA B : (A \subset B) = pred0b [predD A & B]. Proof. by rewrite unlock. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
subsetE
subsetPA B : reflect {subset A <= B} (A \subset B). Proof. rewrite unlock; apply: (iffP (pred0P _)) => [AB0 x | sAB x /=]. by apply/implyP; apply/idPn; rewrite negb_imply andbC [_ && _]AB0. by rewrite andbC -negb_imply; apply/negbF/implyP; apply: sAB. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
subsetP
subsetPnA B : reflect (exists2 x, x \in A & x \notin B) (~~ (A \subset B)). Proof. rewrite unlock; apply: (iffP (pred0Pn _)) => [[x] | [x Ax nBx]]. by case/andP; exists x. by exists x; rewrite /= nBx. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
subsetPn
subset_leq_cardA B : A \subset B -> #|A| <= #|B|. Proof. move=> sAB. rewrite -(cardID A B) [#|predI _ _|](@eq_card _ A) ?leq_addr //= => x. by rewrite !inE andbC; case Ax: (x \in A) => //; apply: subsetP Ax. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
subset_leq_card
subxx_hint(mA : mem_pred T) : subset mA mA. Proof. by case: mA => A; have:= introT (subsetP A A); rewrite !unlock => ->. Qed. Hint Resolve subxx_hint : core.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
subxx_hint
subxx(pT : predType T) (pA : pT) : pA \subset pA. Proof. by []. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
subxx
eq_subsetA B : A =i B -> subset (mem A) =1 subset (mem B). Proof. move=> eqAB [C]; rewrite !unlock; congr (_ == 0). by apply: eq_card => x; rewrite inE /= eqAB. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
eq_subset
eq_subset_rA B : A =i B -> (@subset T)^~ (mem A) =1 (@subset T)^~ (mem B). Proof. move=> eqAB [C]; rewrite !unlock; congr (_ == 0). by apply: eq_card => x; rewrite !inE /= eqAB. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
eq_subset_r
eq_subxxA B : A =i B -> A \subset B. Proof. by move/eq_subset->. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
eq_subxx
subset_predTA : A \subset T. Proof. exact/subsetP. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
subset_predT
predT_subsetA : T \subset A -> forall x, x \in A. Proof. by move/subsetP=> allA x; apply: allA. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
predT_subset
subset_pred1A x : (pred1 x \subset A) = (x \in A). Proof. by apply/subsetP/idP=> [-> // | Ax y /eqP-> //]; apply: eqxx. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
subset_pred1
subset_eqPA B : reflect (A =i B) ((A \subset B) && (B \subset A)). Proof. apply: (iffP andP) => [[sAB sBA] x| eqAB]; last by rewrite !eq_subxx. by apply/idP/idP; apply: subsetP. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
subset_eqP
subset_cardPA B : #|A| = #|B| -> reflect (A =i B) (A \subset B). Proof. move=> eqcAB; case: (subsetP A B) (subset_eqP A B) => //= sAB. case: (subsetP B A) => [//|[]] x Bx; apply/idPn => Ax. case/idP: (ltnn #|A|); rewrite {2}eqcAB (cardD1 x B) Bx /=. apply: subset_leq_card; apply/subsetP=> y Ay; rewrite inE /= andbC. by rewrite sAB //; apply/eqP => eqyx; rewrite -eqyx Ay in Ax. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
subset_cardP
subset_leqif_cardA B : A \subset B -> #|A| <= #|B| ?= iff (B \subset A). Proof. move=> sAB; split; [exact: subset_leq_card | apply/eqP/idP]. by move/subset_cardP=> sABP; rewrite (eq_subset_r (sABP sAB)). by move=> sBA; apply: eq_card; apply/subset_eqP; rewrite sAB. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
subset_leqif_card
subset_transA B C : A \subset B -> B \subset C -> A \subset C. Proof. by move/subsetP=> sAB /subsetP=> sBC; apply/subsetP=> x /sAB; apply: sBC. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
subset_trans
subset_alls A : (s \subset A) = all [in A] s. Proof. exact: (sameP (subsetP _ _) allP). Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
subset_all
subset_conss x : s \subset x :: s. Proof. by apply/subsetP => y /[!inE] ->; rewrite orbT. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
subset_cons
subset_cons2s1 s2 x : s1 \subset s2 -> x :: s1 \subset x :: s2. Proof. by move=> ?; apply/subsetP => y /[!inE]; case: eqP => // _; apply: subsetP. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
subset_cons2
subset_catls s' : s \subset s ++ s'. Proof. by apply/subsetP=> x xins; rewrite mem_cat xins. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
subset_catl
subset_catrs s' : s \subset s' ++ s. Proof. by apply/subsetP => x xins; rewrite mem_cat xins orbT. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
subset_catr
subset_cat2s1 s2 s3 : s1 \subset s2 -> s3 ++ s1 \subset s3 ++ s2. Proof. move=> /subsetP s12; apply/subsetP => x. by rewrite !mem_cat => /orP[->|/s12->]; rewrite ?orbT. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
subset_cat2
filter_subsetp s : [seq a <- s | p a] \subset s. Proof. by apply/subsetP=> x; rewrite mem_filter => /andP[]. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
filter_subset
subset_filterp s1 s2 : s1 \subset s2 -> [seq a <- s1 | p a] \subset [seq a <- s2 | p a]. Proof. by move/subsetP=> s12; apply/subsetP=> x; rewrite !mem_filter=> /andP[-> /s12]. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
subset_filter
properEA B : A \proper B = (A \subset B) && ~~ (B \subset A). Proof. by []. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
properE
properPA B : reflect (A \subset B /\ (exists2 x, x \in B & x \notin A)) (A \proper B). Proof. by rewrite properE; apply: (iffP andP) => [] [-> /subsetPn]. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
properP
proper_subA B : A \proper B -> A \subset B. Proof. by case/andP. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
proper_sub
proper_subnA B : A \proper B -> ~~ (B \subset A). Proof. by case/andP. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
proper_subn
proper_transA B C : A \proper B -> B \proper C -> A \proper C. Proof. case/properP=> sAB [x Bx nAx] /properP[sBC [y Cy nBy]]. rewrite properE (subset_trans sAB) //=; apply/subsetPn; exists y => //. by apply: contra nBy; apply: subsetP. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
proper_trans
proper_sub_transA B C : A \proper B -> B \subset C -> A \proper C. Proof. case/properP=> sAB [x Bx nAx] sBC; rewrite properE (subset_trans sAB) //. by apply/subsetPn; exists x; rewrite ?(subsetP _ _ sBC). Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
proper_sub_trans
sub_proper_transA B C : A \subset B -> B \proper C -> A \proper C. Proof. move=> sAB /properP[sBC [x Cx nBx]]; rewrite properE (subset_trans sAB) //. by apply/subsetPn; exists x => //; apply: contra nBx; apply: subsetP. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
sub_proper_trans
proper_cardA B : A \proper B -> #|A| < #|B|. Proof. by case/andP=> sAB nsBA; rewrite ltn_neqAle !(subset_leqif_card sAB) andbT. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
proper_card
proper_irreflA : ~~ (A \proper A). Proof. by rewrite properE subxx. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
proper_irrefl
properxxA : (A \proper A) = false. Proof. by rewrite properE subxx. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
properxx
eq_properA B : A =i B -> proper (mem A) =1 proper (mem B). Proof. move=> eAB [C]; congr (_ && _); first exact: (eq_subset eAB). by rewrite (eq_subset_r eAB). Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
eq_proper
eq_proper_rA B : A =i B -> (@proper T)^~ (mem A) =1 (@proper T)^~ (mem B). Proof. move=> eAB [C]; congr (_ && _); first exact: (eq_subset_r eAB). by rewrite (eq_subset eAB). Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
eq_proper_r
card_geqP{A n} : reflect (exists s, [/\ uniq s, size s = n & {subset s <= A}]) (n <= #|A|). Proof. apply: (iffP idP) => [n_le_A|[s] [uniq_s size_s /subsetP subA]]; last first. by rewrite -size_s -(card_uniqP _ uniq_s); exact: subset_leq_card. exists (take n (enum A)); rewrite take_uniq ?enum_uniq // size_take. split => //; last by move => x /mem_take; rewrite mem_enum. case: (ltnP n (size (enum A))) => // size_A. by apply/eqP; rewrite eqn_leq size_A -cardE n_le_A. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
card_geqP
card_gt1PA : reflect (exists x y, [/\ x \in A, y \in A & x != y]) (1 < #|A|). Proof. apply: (iffP card_geqP) => [[s] []|[x] [y] [xA yA xDy]]. case: s => [|a [|b []]]//= /[!(inE, andbT)] aDb _ subD. by exists a, b; rewrite aDb !subD ?inE ?eqxx ?orbT. by exists [:: x; y]; rewrite /= !inE xDy; split=> // z /[!inE] /pred2P[]->. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
card_gt1P
card_gt2PA : reflect (exists x y z, [/\ x \in A, y \in A & z \in A] /\ [/\ x != y, y != z & z != x]) (2 < #|A|). Proof. apply: (iffP card_geqP) => [[s] []|[x] [y] [z] [[xD yD zD] [xDy xDz yDz]]]. case: s => [|x [|y [|z []]]]//=; rewrite !inE !andbT negb_or -andbA. case/and3P => xDy xDz yDz _ subA. by exists x, y, z; rewrite xDy yDz eq_sym xDz !subA ?inE ?eqxx ?orbT. exists [:: x; y; z]; rewrite /= !inE negb_or xDy xDz eq_sym yDz; split=> // u. by rewrite !inE => /or3P [] /eqP->. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
card_gt2P
disjoint_symA B : [disjoint A & B] = [disjoint B & A]. Proof. by congr (_ == 0); apply: eq_card => x; apply: andbC. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
disjoint_sym
eq_disjointA B : A =i B -> disjoint (mem A) =1 disjoint (mem B). Proof. by move=> eqAB [C]; congr (_ == 0); apply: eq_card => x; rewrite !inE eqAB. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
eq_disjoint
eq_disjoint_rA B : A =i B -> (@disjoint T)^~ (mem A) =1 (@disjoint T)^~ (mem B). Proof. by move=> eqAB [C]; congr (_ == 0); apply: eq_card => x; rewrite !inE eqAB. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype", "From mathcomp Require Import ssrnat seq choice path div" ]
boot/fintype.v
eq_disjoint_r