forked from agda/agda-stdlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c5255d0
commit be62e95
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
46 changes: 46 additions & 0 deletions
46
src/Data/List/Relation/Binary/Equality/Setoid/Properties.agda
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
------------------------------------------------------------------------ | ||
-- The Agda standard library | ||
-- | ||
-- Properties of List modulo ≋ | ||
------------------------------------------------------------------------ | ||
|
||
{-# OPTIONS --cubical-compatible --safe #-} | ||
|
||
open import Relation.Binary.Bundles using (Setoid) | ||
|
||
module Data.List.Relation.Binary.Equality.Setoid.Properties | ||
{c ℓ} (S : Setoid c ℓ) | ||
where | ||
|
||
open import Algebra.Bundles using (Monoid) | ||
open import Algebra.Structures using (IsMonoid) | ||
open import Data.List.Base using (List; []; _++_) | ||
import Data.List.Properties as List | ||
import Data.List.Relation.Binary.Equality.Setoid as ≋ | ||
open import Data.Product.Base using (_,_) | ||
open import Function.Base using (_∘_) | ||
open import Level using (_⊔_) | ||
|
||
open ≋ S using (_≋_; ≋-refl; ≋-reflexive; ≋-isEquivalence; ++⁺) | ||
|
||
------------------------------------------------------------------------ | ||
-- The []-++-Monoid | ||
|
||
-- Structure | ||
|
||
isMonoid : IsMonoid _≋_ _++_ [] | ||
isMonoid = record | ||
{ isSemigroup = record | ||
{ isMagma = record | ||
{ isEquivalence = ≋-isEquivalence | ||
; ∙-cong = ++⁺ | ||
} | ||
; assoc = λ xs ys zs → ≋-reflexive (List.++-assoc xs ys zs) | ||
} | ||
; identity = (λ _ → ≋-refl) , ≋-reflexive ∘ List.++-identityʳ | ||
} | ||
|
||
-- Bundle | ||
|
||
monoid : Monoid c (c ⊔ ℓ) | ||
monoid = record { isMonoid = isMonoid } |