Skip to content

Instantly share code, notes, and snippets.

@thelissimus
Created December 21, 2024 17:23
Show Gist options
  • Select an option

  • Save thelissimus/4bdca8f10ff9dae3df1850f1c4cfd864 to your computer and use it in GitHub Desktop.

Select an option

Save thelissimus/4bdca8f10ff9dae3df1850f1c4cfd864 to your computer and use it in GitHub Desktop.
open import Function.Bundles
open import Data.Bool
open import Data.Product
open import Relation.Binary.PropositionalEquality
open Equivalence
fn : {a : Set} → (a × a) ⇔ (Bool → a)
fn .to (_ , snd) false = snd
fn .to (fst , _) true = fst
fn .from f = f true , f false
fn .to-cong = cong (fn .to)
fn .from-cong = cong (fn .from)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment