law all_map

bend-mathlib@0.8.1.0 · list.bend:1510

import bend-mathlib@0.8.1.0/list.bend as List
import Base

1510# All over a map checks the composed predicate: all p (map f xs) = all (p . f) xs.
1511law all_map:
1512  for ~A: Type
1513  for ~B: Type
1514  for ~f: A -> B
1515  for ~p: B -> Bool
1516  for xs: List<A>
1517  {List.all(~&1, ~B, ~p, List.map(~A, ~B, ~f, xs)) == List.all(~&1, ~A, ~(x => p(f(x))), xs) : Bool}

Uses (5)

Used by (1)