#### Exercise `Any-∃`
Show that `Any P xs` is isomorphic to `∃[ x ∈ xs ] P x`.
抛开∃[ x ∈ xs ] P x
甚至不是valid syntax的事实-仅Σ[ x ∈ xs ] P x
可能是有效的,我没有尝试过针对该特定问题进行类型检查的类型签名。
Any-∃ : ∀ {A : Set} {P : A → Set} {xs : List A} → Any P xs ≃ Σ[ x ∈ xs ] P x
List A !=< Set _a_1582 of type Set
when checking that the expression xs has type Set _a_1582
这里最明显的事情失败了。我有点理解问题在试图问我什么,但是我不确定∃[ x ∈ xs ] P x
的结构应该是什么。
这是PLFA本书Lists chapter中倒数第二次的练习。
答案 0 :(得分:1)
这本书已经更正:
练习Any-∃
(练习)
表明Any P xs
与∃[ x ] (x ∈ xs × P x)
同构。