lemma andbPF : ∀a,b:bool. reflect (a = false ∨ b = false) (negb (andb a b)).
intros (a b); apply prove_reflect; cases a; cases b; simplify; intros (H);
-[1,2,3,4: rewrite > H; [1,2:right|3,4:left] reflexivity
+[1,2,3,4: try rewrite > H; [1,2:right|3,4:left] reflexivity
|5,6,7,8: unfold Not; intros (H1); [2,3,4: destruct H]; cases H1; destruct H2]
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 ; rewrite > E; [reflexivity]
+apply (cmpP d x t); intros (E); simplify ; try rewrite > E; [reflexivity]
rewrite > andbA; rewrite > andbC in ⊢ (? ? (? % ?) ?); rewrite < andbA;
rewrite < H; rewrite > andbC in ⊢ (? ? ? (? % ?)); rewrite < andbA; reflexivity;
qed.
[2: lapply (uniq_mem ? ? ? H1) as H4; simplify; apply (cmpP d x t);
intros (H5); simplify;
[1: rewrite > count_O; [reflexivity]
- intros (y Hy); rewrite > H5 in H2 H3 H4 ⊢ %; clear H5; clear x;
+ intros (y Hy); rewrite > H5 in H2 H3 ⊢ %; clear H5; clear x;
rewrite > H2 in H4; destruct H4;
- |2: simplify; rewrite > H5; simplify; apply H;
+ |2: simplify; apply H;
rewrite > uniq_tail in H1; cases (b2pT ? ? (andbP ? ?) H1);
assumption;]
|1: simplify; rewrite > H2; simplify; rewrite > count_O; [reflexivity]