Skip to content

Instantly share code, notes, and snippets.

@ikedaisuke
Created May 30, 2012 10:34
Show Gist options
  • Save ikedaisuke/2835396 to your computer and use it in GitHub Desktop.
Save ikedaisuke/2835396 to your computer and use it in GitHub Desktop.
@noricoco gives an exercise.
module Noricoco where
-- Hello! See also
-- http://togetter.com/li/312309
open import Data.Empty using (⊥-elim)
open import Data.Nat using (_≟_; ℕ)
open import Data.Sum using (_⊎_; inj₁; inj₂)
open import Relation.Binary.PropositionalEquality using (_≡_)
open import Relation.Nullary using (yes; no)
triv : (x y z : ℕ) -> (x ≡ 3 -> y ≡ 5) ⊎ (y ≡ 5 -> z ≡ 8)
triv x y z with y ≟ 5
... | yes p = inj₁ (λ _ -> p)
... | no ¬p = inj₂ (λ q -> ⊥-elim (¬p q))
@ikedaisuke
Copy link
Author

日本語による解説を書きました。http://sovmoess.tumblr.com/post/24062521384/x-y-z-x-3-y-5-y-5-z-8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment