有这个定理:
Lemma all_count T (a : pred T) s :
all a s = (count a s == size s).
Proof.
elim: s=> [| x xs IH] //. case E: (a x)=> /=; rewrite E.
- rewrite addnC. rewrite addn1. rewrite eqSS. by rewrite -IH.
- rewrite addnC=> /=. rewrite addn0. rewrite -size_filter.
我得到了这个状态:
T : Type
a : pred T
x : T
xs : seq T
IH : all a xs = (count a xs == size xs)
E : a x = false
============================
false = (size [seq x <- xs | a x] == (size xs).+1)
我怎样才能证明那size [seq x <- xs | a x]
总是更少(size xs).+1)
呢?所以,他们的平等总是错误的。