Debian Codegraph @

src/Algebra/Module/Definitions/Right.agda

raw
1 ------------------------------------------------------------------------
2 -- The Agda standard library
3 --
4 -- Properties of right-scaling
5 ------------------------------------------------------------------------
6
7 {-# OPTIONS --cubical-compatible --safe #-}
8
9 open import Relation.Binary.Core
10 using (Rel; _Preserves_⟶_; _Preserves₂_⟶_⟶_)
11
12 -- The properties are parameterised by the two carriers and
13 -- the result equality.
14
15 module Algebra.Module.Definitions.Right
16 {a b ℓb} (A : Set a) {B : Set b} (_≈_ : Rel B ℓb)
17 where
18
19 ------------------------------------------------------------------------
20 -- Binary operations
21
22 open import Algebra.Core using (Op₂)
23 open import Algebra.Module.Core using (Opᵣ)
24
25 ------------------------------------------------------------------------
26 -- Properties of operations
27
28 RightIdentity : A → Opᵣ A B → Set _
29 RightIdentity a _∙ᴮ_ = ∀ m → (m ∙ᴮ a) ≈ m
30
31 Associative : Op₂ A → Opᵣ A B → Set _
32 Associative _∙ᴬ_ _∙ᴮ_ = ∀ m x y → ((m ∙ᴮ x) ∙ᴮ y) ≈ (m ∙ᴮ (x ∙ᴬ y))
33
34 infix 4 _DistributesOverʳ_ _DistributesOverˡ_⟶_
35
36 _DistributesOverˡ_⟶_ : Opᵣ A B → Op₂ A → Op₂ B → Set _
37 _*_ DistributesOverˡ _+ᴬ_ ⟶ _+ᴮ_ =
38 ∀ m x y → (m * (x +ᴬ y)) ≈ ((m * x) +ᴮ (m * y))
39
40 _DistributesOverʳ_ : Opᵣ A B → Op₂ B → Set _
41 _*_ DistributesOverʳ _+_ =
42 ∀ x m n → ((m + n) * x) ≈ ((m * x) + (n * x))
43
44 LeftZero : B → Opᵣ A B → Set _
45 LeftZero z _∙_ = ∀ x → (z ∙ x) ≈ z
46
47 RightZero : A → B → Opᵣ A B → Set _
48 RightZero zᴬ zᴮ _∙_ = ∀ x → (x ∙ zᴬ) ≈ zᴮ
49
50 Commutative : Opᵣ A B → Set _
51 Commutative _∙_ = ∀ m x y → ((m ∙ x) ∙ y) ≈ ((m ∙ y) ∙ x)
52
53 LeftCongruent : ∀ {ℓa} → Rel A ℓa → Opᵣ A B → Set _
54 LeftCongruent ≈ᴬ _∙_ = ∀ {m} → (m ∙_) Preserves ≈ᴬ ⟶ _≈_
55
56 RightCongruent : Opᵣ A B → Set _
57 RightCongruent _∙_ = ∀ {x} → (_∙ x) Preserves _≈_ ⟶ _≈_
58
59 Congruent : ∀ {ℓa} → Rel A ℓa → Opᵣ A B → Set _
60 Congruent ≈ᴬ ∙ = ∙ Preserves₂ _≈_ ⟶ ≈ᴬ ⟶ _≈_