fixed exercise in List
This commit is contained in:
parent
749e6a9e57
commit
9f0ae6e4b6
1 changed files with 16 additions and 3 deletions
|
@ -958,11 +958,11 @@ Show that the equivalence `All-++-⇔` can be extended to an isomorphism.
|
|||
-- Your code goes here
|
||||
```
|
||||
|
||||
#### Exercise `¬Any≃All¬` (recommended)
|
||||
#### Exercise `¬Any⇔All¬` (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`.
|
||||
|
|
Loading…
Add table
Reference in a new issue