Skip to content

Instantly share code, notes, and snippets.

@notogawa
Last active August 29, 2015 14:10
Show Gist options
  • Save notogawa/8df6dad04963e8f375f7 to your computer and use it in GitHub Desktop.
Save notogawa/8df6dad04963e8f375f7 to your computer and use it in GitHub Desktop.
module Test where
open import Relation.Binary.PropositionalEquality
postulate
extensionality : ∀ {a} {b} {A : Set a} {B : A → Set b} {f g : (x : A) → B x} → (∀ x → f x ≡ g x) → f ≡ g
covariant : {B : Set} → (B → B → B) → {A : Set} → (A → B) → (A → B) → (A → B)
covariant _⊕_ f g = λ x → f x ⊕ g x
record IsSemiGroup {A : Set} (_∙_ : A → A → A) : Set where
field
assoc : ∀ x y z → (x ∙ y) ∙ z ≡ x ∙ (y ∙ z)
theorem : {B : Set} {_⊕_ : B → B → B} → IsSemiGroup _⊕_ → {A : Set} → IsSemiGroup (covariant _⊕_ {A})
theorem sg = record { assoc = λ x y z → extensionality (λ a → IsSemiGroup.assoc sg (x a) (y a) (z a)) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment