law any_filter
import bend-mathlib@0.8.1.0/list.bend as Listimport Base
1475# Any over a filter looks for q only where p holds: any q (filter p xs) = any (p and q) xs.
1476law any_filter:
1477 for ~A: Data
1478 for ~p: A -> Bool
1479 for ~q: A -> Bool
1480 for xs: List<&2, A>
1481 {List.any(~&2, ~A, ~q, List.filter(~A, ~p, xs)) == List.any(~&2, ~A, ~(+x => Bool.and(p(x), q(x))), xs) : Bool}