fixed exercise in List

This commit is contained in:
wadler 2019-10-28 15:19:47 +00:00
parent 749e6a9e57
commit 9f0ae6e4b6

View file

@ -958,11 +958,11 @@ Show that the equivalence `All-++-⇔` can be extended to an isomorphism.
-- Your code goes here
```
#### Exercise `¬AnyAll¬` (recommended)
#### Exercise `¬AnyAll¬` (recommended)
Show that `Any` and `All` satisfy a version of De Morgan's Law:
(¬_ ∘ Any P) xs All (¬_ ∘ P) xs
(¬_ ∘ Any P) xs All (¬_ ∘ P) xs
(Can you see why it is important that here `_∘_` is generalised
to arbitrary levels, as described in the section on
@ -970,11 +970,24 @@ to arbitrary levels, as described in the section on
Do we also have the following?
(¬_ ∘ All P) xs Any (¬_ ∘ P) xs
(¬_ ∘ All P) xs Any (¬_ ∘ P) xs
If so, prove; if not, explain why.
```
-- Your code goes here
```
#### Exercise `¬Any≃All¬` (stretch)
Show that the equivalence `¬Any⇔All¬` can be extended to an isomorphism.
You will need to use extensionality.
```
-- Your code goes here
```
#### Exercise `All-∀` (practice)
Show that `All P xs` is isomorphic to `∀ {x} → x ∈ xs → P x`.