Last active
August 29, 2015 14:10
-
-
Save notogawa/8df6dad04963e8f375f7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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