Skip to content

Instantly share code, notes, and snippets.

@bond15
Last active July 25, 2022 22:23
Show Gist options
  • Save bond15/4dc8d7a6a5b7afb931c1e21047eddd9c to your computer and use it in GitHub Desktop.
Save bond15/4dc8d7a6a5b7afb931c1e21047eddd9c to your computer and use it in GitHub Desktop.
Don't match on Set
module foo where
data ⊘ : Set where
data ⊤ : Set where tt : ⊤
open import Cubical.Data.Bool
open import Cubical.Foundations.Isomorphism
open import Cubical.Foundations.Prelude
postulate
f : Set → Bool
reduction₁ : f (⊤ × ⊤) ≡ true
reduction₂ : f (⊤) ≡ false
f' : Set → Set
reduction₃ : f' (⊤ × ⊤) ≡ ⊤
reduciton₄ : f' (⊤) ≡ ⊘
⊤≡⊤×⊤ : ⊤ ≡ ⊤ × ⊤
⊤≡⊤×⊤ = isoToPath (iso (λ _ → tt , tt) (λ x → tt) (λ{ (tt , tt) → refl}) λ{tt → refl})
oops : true ≡ false
oops = true ≡⟨ sym reduction₁ ⟩
f (⊤ × ⊤) ≡⟨ cong f (sym ⊤≡⊤×⊤) ⟩
f ⊤ ≡⟨ reduction₂ ⟩
false ∎
oops' : ⊤ ≡ ⊘
oops' = ⊤ ≡⟨ sym reduction₃ ⟩
f' (⊤ × ⊤) ≡⟨ cong f' (sym ⊤≡⊤×⊤) ⟩
f' ⊤ ≡⟨ reduciton₄ ⟩
⊘ ∎
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment