mem d2 x (filter d1 d2 p l) = false.
intros 5 (d1 d2 x l p);
elim l; simplify; [reflexivity]
-generalize in match (refl_eq ? (p t));
-generalize in match (p t) in ⊢ (? ? ? % → %); intros 1 (b); cases b; clear b; intros (Hpt);
+generalize in match (refl_eq ? (p a));
+generalize in match (p a) in ⊢ (? ? ? % → %); intros 1 (b); cases b; clear b; intros (Hpt);
[1: apply H; intros (y Hyl);
apply H1; simplify;
rewrite > Hyl; rewrite > orbC; reflexivity;
|2: simplify; apply (cmpP d2 x s); simplify; intros (E);
- [1: rewrite < (H1 t); simplify; [rewrite > Hpt; rewrite > E]
+ [1: rewrite < (H1 a); simplify; [rewrite > Hpt; rewrite > E]
simplify; rewrite > cmp_refl; reflexivity
|2: apply H; intros; apply H1; simplify; rewrite > H2;
rewrite > orbC; reflexivity]]
∀d:eqType.∀p:d→bool.∀l:list d.
(∀x:d.mem d x l = true → notb (p x) = true) → count d p l = O.
intros 3 (d p l); elim l; simplify; [1: reflexivity]
-generalize in match (refl_eq ? (p t));
-generalize in match (p t) in ⊢ (? ? ? % → %); intros 1 (b);
+generalize in match (refl_eq ? (p a));
+generalize in match (p a) in ⊢ (? ? ? % → %); intros 1 (b);
cases b; simplify;
[2:intros (Hpt); apply H; intros; apply H1; simplify;
- apply (cmpP d x t); [2: rewrite > H2;]; intros; reflexivity;
-|1:intros (H2); lapply (H1 t); [2:simplify; rewrite > cmp_refl; simplify; autobatch]
+ apply (cmpP d x a); [2: rewrite > H2;]; intros; reflexivity;
+|1:intros (H2); lapply (H1 a); [2:simplify; rewrite > cmp_refl; simplify; autobatch]
rewrite > H2 in Hletin; simplify in Hletin; destruct Hletin]
qed.
lemma uniq_tail :
∀d:eqType.∀x:d.∀l:list d. uniq d (x::l) = andb (negb (mem d x l)) (uniq d l).
intros (d x l); elim l; simplify; [reflexivity]
-apply (cmpP d x t); intros (E); simplify ; try rewrite > E; [reflexivity]
+apply (cmpP d x a); intros (E); simplify ; try rewrite > E; [reflexivity]
rewrite > andbA; rewrite > andbC in ⊢ (? ? (? % ?) ?); rewrite < andbA;
rewrite < H; rewrite > andbC in ⊢ (? ? ? (? % ?)); rewrite < andbA; reflexivity;
qed.
lemma count_O_mem : ∀d:eqType.∀x:d.∀l:list d.ltb O (count d (cmp d x) l) = mem d x l.
-intros 3 (d x l); elim l [reflexivity] simplify; rewrite < H; cases (cmp d x t);
+intros 3 (d x l); elim l [reflexivity] simplify; rewrite < H; cases (cmp d x a);
reflexivity; qed.
lemma uniqP : ∀d:eqType.∀l:list d.
[1: generalize in match H2; simplify in H2;
lapply (b2pT ? ? (orbP ? ?) H2) as H3; clear H2;
cases H3; clear H3; intros;
- [2: lapply (uniq_mem ? ? ? H1) as H4; simplify; apply (cmpP d x t);
+ [2: lapply (uniq_mem ? ? ? H1) as H4; simplify; apply (cmpP d x a);
intros (H5); simplify;
[1: rewrite > count_O; [reflexivity]
intros (y Hy); rewrite > H5 in H2 H3 ⊢ %; clear H5; clear x;
|1: simplify; rewrite > H2; simplify; rewrite > count_O; [reflexivity]
intros (y Hy); rewrite > (b2pT ? ? (eqP d ? ?) H2) in H3 ⊢ %;
clear H2; clear x; lapply (uniq_mem ? ? ? H1) as H4;
- apply (cmpP d t y); intros (E); [2: reflexivity].
+ apply (cmpP d a y); intros (E); [2: reflexivity].
rewrite > E in H4; rewrite > H4 in Hy; destruct Hy;]
|2: rewrite > uniq_tail in H1;
generalize in match (refl_eq ? (uniq d l1));
generalize in match (uniq d l1) in ⊢ (? ? ? % → %); intros 1 (b); cases b; clear b;
[1: intros (E); rewrite > E in H1; rewrite > andbC in H1; simplify in H1;
- unfold Not; intros (A); lapply (A t) as A';
+ unfold Not; intros (A); lapply (A a) as A';
[1: simplify in A'; rewrite > cmp_refl in A'; simplify in A';
destruct A'; rewrite < count_O_mem in H1;
rewrite > Hcut in H1; simplify in H1; destruct H1;
|2: simplify; rewrite > cmp_refl; reflexivity;]
|2: intros (Ul1); lapply (H Ul1); unfold Not; intros (A); apply Hletin;
intros (r Mrl1); lapply (A r);
- [2: simplify; rewrite > Mrl1; cases (cmp d r t); reflexivity]
- generalize in match Hletin1; simplify; apply (cmpP d r t);
+ [2: simplify; rewrite > Mrl1; cases (cmp d r a); reflexivity]
+ generalize in match Hletin1; simplify; apply (cmpP d r a);
simplify; intros (E Hc); [2: assumption]
destruct Hc; rewrite < count_O_mem in Mrl1;
rewrite > Hcut in Mrl1; simplify in Mrl1; destruct Mrl1;]]
generalize in match (mem_finType d t);
generalize in match (uniq_fintype_enum d);
elim (enum d); [simplify in H1; destruct H1] simplify;
-cases (in_sub_eq d p t1); simplify;
+cases (in_sub_eq d p a); simplify;
[1:generalize in match H3; clear H3; cases s (r Hr); clear s;
simplify; intros (Ert1); generalize in match Hr; clear Hr;
rewrite > Ert1; clear Ert1; clear r; intros (Ht1);
unfold sub_eqType in ⊢ (? ? match ? (% ? ?) ? ? with [_ ⇒ ?|_ ⇒ ?] ?);
- simplify; apply (cmpP ? t t1); simplify; intros (Ett1);
+ simplify; apply (cmpP ? t a); simplify; intros (Ett1);
[1: cut (count (sub_eqType d p) (cmp (sub_eqType d p) {t,Ht})
(filter d (sigma d p) (if_p d p) l) = O); [1:rewrite > Hcut; reflexivity]
lapply (uniq_mem ? ? ? H1);
generalize in match Ht;
rewrite > Ett1; intros (Ht1'); clear Ht1;
generalize in match Hletin; elim l; [ reflexivity]
- simplify; cases (in_sub_eq d p t2); simplify;
+ simplify; cases (in_sub_eq d p a1); simplify;
[1: generalize in match H5; cases s; simplify; intros; clear H5;
unfold sub_eqType in ⊢ (? ? match ? (% ? ?) ? ? with [_ ⇒ ?|_ ⇒ ?] ?);
simplify; rewrite > H7; simplify in H4;
- generalize in match H4; clear H4; apply (cmpP ? t1 t2);
+ generalize in match H4; clear H4; apply (cmpP ? a a1);
simplify; intros; [destruct H5] apply H3; assumption;
|2: apply H3;
- generalize in match H4; clear H4; simplify; apply (cmpP ? t1 t2);
+ generalize in match H4; clear H4; simplify; apply (cmpP ? a a1);
simplify; intros; [destruct H6] assumption;]
|2: apply H; [ rewrite > uniq_tail in H1; cases (b2pT ? ? (andbP ? ?) H1); assumption]
simplify in H2; rewrite > Ett1 in H2; simplify in H2; assumption]
|2:rewrite > H; [1:reflexivity|2: rewrite > uniq_tail in H1; cases (b2pT ? ? (andbP ? ?) H1); assumption]
- simplify in H2; generalize in match H2; apply (cmpP ? t t1);
+ simplify in H2; generalize in match H2; apply (cmpP ? t a);
intros (E) [2:assumption] clear H; rewrite > E in Ht; rewrite > H3 in Ht;
destruct Ht;]
qed.