Commit eda5a110 authored by Nicola Botta's avatar Nicola Botta
Browse files

Initial.

parent 7f0148a6
> module Bool.Properties
> import Data.Fin
> import Control.Isomorphism
> import Basic.Predicates
> import Finite.Predicates
> import Sigma.Sigma
> %default total
> %access public export
> %auto_implicits off
> ||| Bool is not empty
> notEmptyBool : Not (Empty Bool)
> notEmptyBool = \ contra => contra False
> ||| Bool is finite
> finiteBool : Finite Bool
> finiteBool = MkSigma 2 (MkIso to from toFrom fromTo) where
>
> to : Bool -> Fin 2
> to False = FZ
> to True = FS FZ
>
> from : Fin 2 -> Bool
> from FZ = False
> from (FS FZ) = True
> from (FS (FS k)) = absurd k
> toFrom : (k : Fin 2) -> to (from k) = k
> toFrom FZ = Refl
> toFrom (FS FZ) = Refl
> toFrom (FS (FS k)) = absurd k
> fromTo : (b : Bool) -> from (to b) = b
> fromTo False = Refl
> fromTo True = Refl
> ||| Equality of Bools is decidable
> decidableEqBool : DecEq Bool
> decidableEqBool = %implementation
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment