Definition CountMixin := EnumMixin count_enumP.Record class_of T := Class {
  base : Choice.class_of T;
  mixin : mixin_of (Equality.Pack base)
}.Record class_of T := Class {
  base : Choice.class_of T;
  mixin : mixin_of (Equality.Pack base)
}.Record class_of T := Class {
  base : Choice.class_of T;
  mixin : mixin_of (Equality.Pack base)
}.Record class_of T := Class {
  base : Choice.class_of T;
  mixin : mixin_of (Equality.Pack base)
}.Definition base2 T c := Countable.Class (@base T c) (mixin_base (mixin c)).Structure type : Type := Pack {sort; _ : class_of sort}.Structure type : Type := Pack {sort; _ : class_of sort}.Structure type : Type := Pack {sort; _ : class_of sort}.Definition clone c of phant_id class c := @Pack T c.Notation xclass := (class : class_of xT).Definition eqType := @Equality.Pack cT xclass.Definition choiceType := @Choice.Pack cT xclass.Definition countType := @Countable.Pack cT (base2 xclass).Notation finType := type.Notation FinType T m := (@pack T _ m _ _ id _ id).Notation FinMixin := EnumMixin.Notation UniqFinMixin := UniqMixin.(* This assumes that T has a subCountType structure over a type that  *)
(* has a finType structure.                                           *)
Notation "[ 'finMixin' 'of' T 'by' <: ]" :=
    (SubFinMixin_for (Phant T) (erefl _))
  (at level 0, format "[ 'finMixin'  'of'  T  'by'  <: ]") : form_scope.Definition enum cT := mixin_enum (class cT).Definition enumDef := erefl enum.Notation enum A := (enum_mem (mem A)).Canonical finEnum_unlock := Unlockable Finite.EnumDef.enumDef.(* Workaround for the silly syntactic uniformity restriction on coercions;    *)
(* this avoids a cross-dependency between finset.v and prime.v for the        *)
(* definition of the \pi(A) notation.                                         *)
Definition fin_pred_sort (T : finType) (pT : predType T) := pred_sort pT.Identity Coercion pred_sort_of_fin : fin_pred_sort >-> pred_sort.Definition enum_mem T (mA : mem_pred _) := filter mA (Finite.enum T).Definition pick (T : finType) (P : pred T) := ohead (enum P).Definition pick_true T (x : T) := true.(* We lock the definitions of card and subset to mitigate divergence of the   *)
(* Coq term comparison algorithm.                                             *)

Local Notation card_type := (forall T : finType, mem_pred T -> nat).Local Notation card_def := (fun T mA => size (enum_mem mA)).Definition card : card_type := card_def.Definition cardEdef := erefl card.Canonical card_unlock := Unlockable cardEdef.(* A is at level 99 to allow the notation #|G : H| in groups. *)
Notation "#| A |" := (card (mem A))
  (at level 0, A at level 99, format "#| A |") : nat_scope.Variant quantified := Quantified of bool.Variant quantified := Quantified of bool.Notation "''I_' n" := (ordinal n)
  (at level 8, n at level 2, format "''I_' n").Implicit Types (B : quantified) (x y : T).(* The first redundant argument protects the notation from  Coq's K-term      *)
(* display kludge; the second protects it from simpl and /=.                  *)
Definition ex B x y := B.Definition disjoint T (A B : mem_pred _) := @pred0b T (predI A B).Notation "A \proper B" := (proper (mem A) (mem B))
  (at level 70, no associativity) : bool_scope.Local Notation subset_type := (forall (T : finType) (A B : mem_pred T), bool).Local Notation subset_def := (fun T A B => pred0b (predD A B)).Definition subset : subset_type := subset_def.Definition subsetEdef := erefl subset.Canonical subset_unlock := Unlockable subsetEdef.Definition proper T A B := @subset T A B && ~~ subset B A.Implicit Type A : pred T.Implicit Types x y : T.Implicit Type s : seq T.

(* Specifications: *)
Lemma enumP : Finite.axiom (Finite.enum T).
Lemma enumT : enum T = Finite.enum T.
Lemma mem_enum A : enum A =i A.
Lemma enum_uniq : uniq (enum P).
Lemma enum0 : enum pred0 = Nil T.
Lemma pickP : pick_spec (pick P).
Lemma eq_enum P Q : P =i Q -> enum P = enum Q.
Lemma eq_pick P Q : P =1 Q -> pick P = pick Q.
Lemma pred0P P : reflect (P =1 pred0) (pred0b P).
Lemma pred0Pn P : reflect (exists x, P x) (~~ pred0b P).
Lemma subxx_hint (mA : mem_pred T) : subset mA mA.
Lemma eq_subset A1 A2 : A1 =i A2 -> subset (mem A1) =1 subset (mem A2).
Lemma eq_subset_r B1 B2 : B1 =i B2 -> (@subset T)^~ (mem B1) =1 (@subset T)^~ (mem B2).
Lemma eq_proper A B : A =i B -> proper (mem A) =1 proper (mem B).
Lemma eq_proper_r A B : A =i B -> (@proper T)^~ (mem A) =1 (@proper T)^~ (mem B).
Lemma eq_disjoint A1 A2 : A1 =i A2 -> disjoint (mem A1) =1 disjoint (mem A2).
Lemma eq_disjoint_r B1 B2 : B1 =i B2 -> (@disjoint T)^~ (mem B1) =1 (@disjoint T)^~ (mem B2).