I'm trying to solve the bonus exercise on page 23 of this tutorial, but I can't fill in this hole:
lem-all-filter : {A : Set}(xs : List A)(p : A -> Bool)
-> All (satisfies p) (filter p xs)
lem-all-filter [] p = all[]
lem-all-filter (x :: xs) p with p x
... | true = {! !} :all: lem-all-filter xs p
... | false = lem-all-filter xs p
If I type C-c C-, in the hole then I get this message:
Goal: isTrue (p x)
--------------------------------
xs : List .A
p : .A -> Bool
x : .A
.A : Set
but I would expect the goal to have type True, since p x
is true
and isTrue true = True
. Am I missing something?