end material for Connectives

This commit is contained in:
wadler 2018-03-15 11:47:49 -03:00
parent 72ed3ad3d9
commit f3fa5ff5fd
2 changed files with 41 additions and 4 deletions

View file

@ -770,6 +770,43 @@ gives rise to an isomorphism, while the second only gives rise to an
embedding, revealing a sense in which one of these laws is "more embedding, revealing a sense in which one of these laws is "more
true" than the other. true" than the other.
<!-- Introduce biimplication `⇔` in a previous section, so that it ### Exercise (`⇔-refl`, `⇔-sym`, `⇔-trans`)
has a formal meaning when it is referred to here. -->
Define equivalence of propositions (also known as "if and only if") as follows.
\begin{code}
record _⇔_ (A B : Set) : Set where
field
to : A → B
from : B → A
\end{code}
Show that equivalence is reflexive, symmetric, and transitive.
### Exercise (`⇔-iso`)
Show that `A ⇔ B` is isomorphic to `(A → B) × (B → A)`.
## Standard library
Definitions similar to those in this chapter can be found in the standard library.
\begin{code}
import Data.Product using (_×_; _,_; proj₁; proj₂)
import Data.Unit using (; tt)
import Data.Sum using (_⊎_; inj₁; inj₂) renaming ([_,_] to ⊎-elim)
import Data.Empty using (⊥; ⊥-elim)
\end{code}
## Unicode
This chapter uses the following unicode.
× U+00D7 MULTIPLICATION SIGN (\x)
⊎ U+228E MULTISET UNION (\u+)
U+22A4 DOWN TACK (\top)
⊥ U+22A5 UP TACK (\bot)
₁ U+2081 SUBSCRIPT ONE (\_1)
₂ U+2082 SUBSCRIPT TWO (\_2)
⇔ U+21D4 LEFT RIGHT DOUBLE ARROW (\<=>)

View file

@ -310,8 +310,8 @@ import Function.Inverse using (_↔_)
import Function.LeftInverse using (_↞_) import Function.LeftInverse using (_↞_)
\end{code} \end{code}
Here `_↔_` correpsonds to our `_≃_`, and `_↞_` corresponds to our `_≲_`. Here `_↔_` correpsonds to our `_≃_`, and `_↞_` corresponds to our `_≲_`.
However, we stick with the definitions given here, mainly because `_↔_` is
specified as a nested record, rather than the flat records used here.
## Unicode ## Unicode