Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #2408 #2422

Merged
merged 4 commits into from
Aug 2, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions src/Algebra/Properties/IdempotentCommutativeMonoid.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
------------------------------------------------------------------------
-- The Agda standard library
--
-- Some derivable properties
------------------------------------------------------------------------

{-# OPTIONS --cubical-compatible --safe #-}

open import Algebra.Bundles using (IdempotentCommutativeMonoid)

module Algebra.Properties.IdempotentCommutativeMonoid
{c ℓ} (M : IdempotentCommutativeMonoid c ℓ) where

open IdempotentCommutativeMonoid M

open import Algebra.Consequences.Setoid setoid
using (comm∧distrˡ⇒distrʳ; comm∧distrˡ⇒distr)
open import Algebra.Definitions _≈_
using (_DistributesOverˡ_; _DistributesOverʳ_; _DistributesOver_)
open import Algebra.Properties.CommutativeSemigroup commutativeSemigroup
using (interchange)
open import Relation.Binary.Reasoning.Setoid setoid


------------------------------------------------------------------------
-- Distributivity

∙-distrˡ-∙ : _∙_ DistributesOverˡ _∙_
∙-distrˡ-∙ a b c = begin
a ∙ (b ∙ c) ≈⟨ ∙-congʳ (idem a) ⟨
(a ∙ a) ∙ (b ∙ c) ≈⟨ interchange _ _ _ _ ⟩
(a ∙ b) ∙ (a ∙ c) ∎

∙-distrʳ-∙ : _∙_ DistributesOverʳ _∙_
∙-distrʳ-∙ = comm∧distrˡ⇒distrʳ ∙-cong comm ∙-distrˡ-∙

∙-distr-∙ : _∙_ DistributesOver _∙_
∙-distr-∙ = comm∧distrˡ⇒distr ∙-cong comm ∙-distrˡ-∙