added an example to beginning of Quantification

This commit is contained in:
wadler 2019-10-07 10:59:15 +01:00
parent b066c247c1
commit d8a42e68f9

View file

@ -27,16 +27,23 @@ open import plfa.part1.Isomorphism using (_≃_; extensionality)
## Universals ## Universals
We formalise universal quantification using the We formalise universal quantification using the dependent function
dependent function type, which has appeared throughout this book. type, which has appeared throughout this book. For instance, in
Chapter Induction we showed addition is associative:
Given a variable `x` of type `A` and a proposition `B x` which +-assoc : ∀ (m n p : ) → (m + n) + p ≡ m + (n + p)
contains `x` as a free variable, the universally quantified
proposition `∀ (x : A) → B x` holds if for every term `M` of type which asserts for all natural numbers `m`, `n`, and `p`
`A` the proposition `B M` holds. Here `B M` stands for that `(m + n) + p ≡ m + (n + p)` holds. It is a dependent
the proposition `B x` with each free occurrence of `x` replaced by function, which given values for `m`, `n`, and `p` returns
`M`. Variable `x` appears free in `B x` but bound in evidence for the corresponding equation.
`∀ (x : A) → B x`.
In general, given a variable `x` of type `A` and a proposition `B x`
which contains `x` as a free variable, the universally quantified
proposition `∀ (x : A) → B x` holds if for every term `M` of type `A`
the proposition `B M` holds. Here `B M` stands for the proposition
`B x` with each free occurrence of `x` replaced by `M`. Variable `x`
appears free in `B x` but bound in `∀ (x : A) → B x`.
Evidence that `∀ (x : A) → B x` holds is of the form Evidence that `∀ (x : A) → B x` holds is of the form
@ -371,7 +378,7 @@ restated in this way.
-- Your code goes here -- Your code goes here
``` ```
#### Exercise `∃-|-≤` (practice) #### Exercise `∃-+-≤` (practice)
Show that `y ≤ z` holds if and only if there exists a `x` such that Show that `y ≤ z` holds if and only if there exists a `x` such that
`x + y ≡ z`. `x + y ≡ z`.