The question is how do we define bijection in agda? definition:
We know that
2 + 2 = 2 × 2 = 2^2 = 4for numbers. Similarly, we have that
Bool + Bool ∼= Bool × Bool ∼= Bool → Boolwhere A ∼= B means that there is a bijection between A and B, that is, that there are
f : A → Bandg : B → Awhich are inverses of each other, that is,g (f x) = xfor allx : Aandf (g y) = yfor ally : B.Implement these bijections in Agda!
So i started by defining Bool and some functions for it:
data Bool : Set where
true : Bool
false : Bool
not : Bool → Bool
not true = false
not false = true
T : Bool → Set
T true = ⊤
T false = ⊥
_∧_ : Bool → Bool → Bool
true ∧ b = b
false ∧ b = false
_∨_ : Bool → Bool → Bool
true ∨ b = true
false ∨ b = b
_xor_ : Bool → Bool → Bool
true xor b = not b
false xor b = b
But im stuck on the bijections, not sure at all how to solve it.