Skip to content

[fixes #2168] Change names in Algebra.Consequences.* to reflect style-guide conventions #2206

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

Merged
merged 2 commits into from
Nov 25, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
53 changes: 37 additions & 16 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1272,6 +1272,27 @@ Deprecated modules
Deprecated names
----------------

* In `Algebra.Consequences.Setoid`:
```agda
comm+cancelˡ⇒cancelʳ ↦ comm∧cancelˡ⇒cancelʳ
comm+cancelʳ⇒cancelˡ ↦ comm∧cancelʳ⇒cancelˡ
comm+almostCancelˡ⇒almostCancelʳ ↦ comm∧almostCancelˡ⇒almostCancelʳ
comm+almostCancelʳ⇒almostCancelˡ ↦ comm∧almostCancelʳ⇒almostCancelˡ
comm+idˡ⇒idʳ ↦ comm∧idˡ⇒idʳ
comm+idʳ⇒idˡ ↦ comm∧idʳ⇒idˡ
comm+zeˡ⇒zeʳ ↦ comm∧zeˡ⇒zeʳ
comm+zeʳ⇒zeˡ ↦ comm∧zeʳ⇒zeˡ
comm+invˡ⇒invʳ ↦ comm∧invˡ⇒invʳ
comm+invʳ⇒invˡ ↦ comm∧invʳ⇒invˡ
comm+distrˡ⇒distrʳ ↦ comm∧distrˡ⇒distrʳ
comm+distrʳ⇒distrˡ ↦ comm∧distrʳ⇒distrˡ
assoc+distribʳ+idʳ+invʳ⇒zeˡ ↦ assoc∧distribʳ∧idʳ∧invʳ⇒zeˡ
assoc+distribˡ+idʳ+invʳ⇒zeʳ ↦ assoc∧distribˡ∧idʳ∧invʳ⇒zeʳ
assoc+id+invʳ⇒invˡ-unique ↦ assoc∧id∧invʳ⇒invˡ-unique
assoc+id+invˡ⇒invʳ-unique ↦ assoc∧id∧invˡ⇒invʳ-unique
subst+comm⇒sym ↦ subst∧comm⇒sym
```

* In `Algebra.Construct.Zero`:
```agda
rawMagma ↦ Algebra.Construct.Terminal.rawMagma
Expand Down Expand Up @@ -2168,21 +2189,21 @@ Additions to existing modules

* Added new proof to `Algebra.Consequences.Base`:
```agda
reflexive+selfInverse⇒involutive : Reflexive _≈_ → SelfInverse _≈_ f → Involutive _≈_ f
reflexiveselfInverse⇒involutive : Reflexive _≈_ → SelfInverse _≈_ f → Involutive _≈_ f
```

* Added new proofs to `Algebra.Consequences.Propositional`:
```agda
comm+assoc⇒middleFour : Commutative _∙_ → Associative _∙_ → _∙_ MiddleFourExchange _∙_
identity+middleFour⇒assoc : Identity e _∙_ → _∙_ MiddleFourExchange _∙_ → Associative _∙_
identity+middleFour⇒comm : Identity e _+_ → _∙_ MiddleFourExchange _+_ → Commutative _∙_
commassoc⇒middleFour : Commutative _∙_ → Associative _∙_ → _∙_ MiddleFourExchange _∙_
identitymiddleFour⇒assoc : Identity e _∙_ → _∙_ MiddleFourExchange _∙_ → Associative _∙_
identitymiddleFour⇒comm : Identity e _+_ → _∙_ MiddleFourExchange _+_ → Commutative _∙_
```

* Added new proofs to `Algebra.Consequences.Setoid`:
```agda
comm+assoc⇒middleFour : Congruent₂ _∙_ → Commutative _∙_ → Associative _∙_ → _∙_ MiddleFourExchange _∙_
identity+middleFour⇒assoc : Congruent₂ _∙_ → Identity e _∙_ → _∙_ MiddleFourExchange _∙_ → Associative _∙_
identity+middleFour⇒comm : Congruent₂ _∙_ → Identity e _+_ → _∙_ MiddleFourExchange _+_ → Commutative _∙_
commassoc⇒middleFour : Congruent₂ _∙_ → Commutative _∙_ → Associative _∙_ → _∙_ MiddleFourExchange _∙_
identitymiddleFour⇒assoc : Congruent₂ _∙_ → Identity e _∙_ → _∙_ MiddleFourExchange _∙_ → Associative _∙_
identitymiddleFour⇒comm : Congruent₂ _∙_ → Identity e _+_ → _∙_ MiddleFourExchange _+_ → Commutative _∙_

involutive⇒surjective : Involutive f → Surjective f
selfInverse⇒involutive : SelfInverse f → Involutive f
Expand All @@ -2192,15 +2213,15 @@ Additions to existing modules
selfInverse⇒injective : SelfInverse f → Injective f
selfInverse⇒bijective : SelfInverse f → Bijective f

comm+idˡ⇒id : Commutative _∙_ → LeftIdentity e _∙_ → Identity e _∙_
comm+idʳ⇒id : Commutative _∙_ → RightIdentity e _∙_ → Identity e _∙_
comm+zeˡ⇒ze : Commutative _∙_ → LeftZero e _∙_ → Zero e _∙_
comm+zeʳ⇒ze : Commutative _∙_ → RightZero e _∙_ → Zero e _∙_
comm+invˡ⇒inv : Commutative _∙_ → LeftInverse e _⁻¹ _∙_ → Inverse e _⁻¹ _∙_
comm+invʳ⇒inv : Commutative _∙_ → RightInverse e _⁻¹ _∙_ → Inverse e _⁻¹ _∙_
comm+distrˡ⇒distr : Commutative _∙_ → _∙_ DistributesOverˡ _◦_ → _∙_ DistributesOver _◦_
comm+distrʳ⇒distr : Commutative _∙_ → _∙_ DistributesOverʳ _◦_ → _∙_ DistributesOver _◦_
distrib+absorbs⇒distribˡ : Associative _∙_ → Commutative _◦_ → _∙_ Absorbs _◦_ → _◦_ Absorbs _∙_ → _◦_ DistributesOver _∙_ → _∙_ DistributesOverˡ _◦_
commidˡ⇒id : Commutative _∙_ → LeftIdentity e _∙_ → Identity e _∙_
commidʳ⇒id : Commutative _∙_ → RightIdentity e _∙_ → Identity e _∙_
commzeˡ⇒ze : Commutative _∙_ → LeftZero e _∙_ → Zero e _∙_
commzeʳ⇒ze : Commutative _∙_ → RightZero e _∙_ → Zero e _∙_
comminvˡ⇒inv : Commutative _∙_ → LeftInverse e _⁻¹ _∙_ → Inverse e _⁻¹ _∙_
comminvʳ⇒inv : Commutative _∙_ → RightInverse e _⁻¹ _∙_ → Inverse e _⁻¹ _∙_
commdistrˡ⇒distr : Commutative _∙_ → _∙_ DistributesOverˡ _◦_ → _∙_ DistributesOver _◦_
commdistrʳ⇒distr : Commutative _∙_ → _∙_ DistributesOverʳ _◦_ → _∙_ DistributesOver _◦_
distribabsorbs⇒distribˡ : Associative _∙_ → Commutative _◦_ → _∙_ Absorbs _◦_ → _◦_ Absorbs _∙_ → _◦_ DistributesOver _∙_ → _∙_ DistributesOverˡ _◦_
```

* Added new functions to `Algebra.Construct.DirectProduct`:
Expand Down
17 changes: 15 additions & 2 deletions src/Algebra/Consequences/Base.agda
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,21 @@ module _ {ℓ} {_•_ : Op₂ A} (_≈_ : Rel A ℓ) where

module _ {ℓ} {f : Op₁ A} (_≈_ : Rel A ℓ) where

reflexive+selfInverse⇒involutive : Reflexive _≈_ →
reflexiveselfInverse⇒involutive : Reflexive _≈_ →
SelfInverse _≈_ f →
Involutive _≈_ f
reflexive+selfInverse⇒involutive refl inv _ = inv refl
reflexiveselfInverse⇒involutive refl inv _ = inv refl

------------------------------------------------------------------------
-- DEPRECATED NAMES
------------------------------------------------------------------------
-- Please use the new names as continuing support for the old names is
-- not guaranteed.

-- Version 2.0

reflexive+selfInverse⇒involutive = reflexive∧selfInverse⇒involutive
{-# WARNING_ON_USAGE reflexive+selfInverse⇒involutive
"Warning: reflexive+selfInverse⇒involutive was deprecated in v2.0.
Please use reflexive∧selfInverse⇒involutive instead."
#-}
74 changes: 42 additions & 32 deletions src/Algebra/Consequences/Propositional.agda
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ import Algebra.Consequences.Setoid (setoid A) as Base

open Base public
hiding
( comm+assoc⇒middleFour
; identity+middleFour⇒assoc
; identity+middleFour⇒comm
; assoc+distribʳ+idʳ+invʳ⇒zeˡ
; assoc+distribˡ+idʳ+invʳ⇒zeʳ
; assoc+id+invʳ⇒invˡ-unique
; assoc+id+invˡ⇒invʳ-unique
; comm+distrˡ⇒distrʳ
; comm+distrʳ⇒distrˡ
( commassoc⇒middleFour
; identitymiddleFour⇒assoc
; identitymiddleFour⇒comm
; assocdistribʳidʳinvʳ⇒zeˡ
; assocdistribˡidʳinvʳ⇒zeʳ
; assoc∧id∧invʳ⇒invˡ-unique
; assoc∧id∧invˡ⇒invʳ-unique
; commdistrˡ⇒distrʳ
; commdistrʳ⇒distrˡ
; comm⇒sym[distribˡ]
; subst+comm⇒sym
; substcomm⇒sym
; wlog
; sel⇒idem
)
Expand All @@ -46,43 +46,43 @@ open Base public

module _ {_∙_ _⁻¹ ε} where

assoc+id+invʳ⇒invˡ-unique : Associative _∙_ → Identity ε _∙_ →
assoc∧id∧invʳ⇒invˡ-unique : Associative _∙_ → Identity ε _∙_ →
RightInverse ε _⁻¹ _∙_ →
∀ x y → (x ∙ y) ≡ ε → x ≡ (y ⁻¹)
assoc+id+invʳ⇒invˡ-unique = Base.assoc+id+invʳ⇒invˡ-unique (cong₂ _)
assoc∧id∧invʳ⇒invˡ-unique = Base.assoc∧id∧invʳ⇒invˡ-unique (cong₂ _)

assoc+id+invˡ⇒invʳ-unique : Associative _∙_ → Identity ε _∙_ →
assoc∧id∧invˡ⇒invʳ-unique : Associative _∙_ → Identity ε _∙_ →
LeftInverse ε _⁻¹ _∙_ →
∀ x y → (x ∙ y) ≡ ε → y ≡ (x ⁻¹)
assoc+id+invˡ⇒invʳ-unique = Base.assoc+id+invˡ⇒invʳ-unique (cong₂ _)
assoc∧id∧invˡ⇒invʳ-unique = Base.assoc∧id∧invˡ⇒invʳ-unique (cong₂ _)

------------------------------------------------------------------------
-- Ring-like structures

module _ {_+_ _*_ -_ 0#} where

assoc+distribʳ+idʳ+invʳ⇒zeˡ : Associative _+_ → _*_ DistributesOverʳ _+_ →
assocdistribʳidʳinvʳ⇒zeˡ : Associative _+_ → _*_ DistributesOverʳ _+_ →
RightIdentity 0# _+_ → RightInverse 0# -_ _+_ →
LeftZero 0# _*_
assoc+distribʳ+idʳ+invʳ⇒zeˡ =
Base.assoc+distribʳ+idʳ+invʳ⇒zeˡ (cong₂ _+_) (cong₂ _*_)
assocdistribʳidʳinvʳ⇒zeˡ =
Base.assocdistribʳidʳinvʳ⇒zeˡ (cong₂ _+_) (cong₂ _*_)

assoc+distribˡ+idʳ+invʳ⇒zeʳ : Associative _+_ → _*_ DistributesOverˡ _+_ →
assocdistribˡidʳinvʳ⇒zeʳ : Associative _+_ → _*_ DistributesOverˡ _+_ →
RightIdentity 0# _+_ → RightInverse 0# -_ _+_ →
RightZero 0# _*_
assoc+distribˡ+idʳ+invʳ⇒zeʳ =
Base.assoc+distribˡ+idʳ+invʳ⇒zeʳ (cong₂ _+_) (cong₂ _*_)
assocdistribˡidʳinvʳ⇒zeʳ =
Base.assocdistribˡidʳinvʳ⇒zeʳ (cong₂ _+_) (cong₂ _*_)

------------------------------------------------------------------------
-- Bisemigroup-like structures

module _ {_∙_ _◦_ : Op₂ A} (∙-comm : Commutative _∙_) where

comm+distrˡ⇒distrʳ : _∙_ DistributesOverˡ _◦_ → _∙_ DistributesOverʳ _◦_
comm+distrˡ⇒distrʳ = Base.comm+distrˡ⇒distrʳ (cong₂ _) ∙-comm
commdistrˡ⇒distrʳ : _∙_ DistributesOverˡ _◦_ → _∙_ DistributesOverʳ _◦_
commdistrˡ⇒distrʳ = Base.comm+distrˡ⇒distrʳ (cong₂ _) ∙-comm

comm+distrʳ⇒distrˡ : _∙_ DistributesOverʳ _◦_ → _∙_ DistributesOverˡ _◦_
comm+distrʳ⇒distrˡ = Base.comm+distrʳ⇒distrˡ (cong₂ _) ∙-comm
commdistrʳ⇒distrˡ : _∙_ DistributesOverʳ _◦_ → _∙_ DistributesOverˡ _◦_
commdistrʳ⇒distrˡ = Base.commdistrʳ⇒distrˡ (cong₂ _) ∙-comm

comm⇒sym[distribˡ] : ∀ x → Symmetric (λ y z → (x ◦ (y ∙ z)) ≡ ((x ◦ y) ∙ (x ◦ z)))
comm⇒sym[distribˡ] = Base.comm⇒sym[distribˡ] (cong₂ _◦_) ∙-comm
Expand All @@ -100,31 +100,41 @@ module _ {_∙_ : Op₂ A} where

module _ {_∙_ : Op₂ A} where

comm+assoc⇒middleFour : Commutative _∙_ → Associative _∙_ →
commassoc⇒middleFour : Commutative _∙_ → Associative _∙_ →
_∙_ MiddleFourExchange _∙_
comm+assoc⇒middleFour = Base.comm+assoc⇒middleFour (cong₂ _∙_)
commassoc⇒middleFour = Base.commassoc⇒middleFour (cong₂ _∙_)

identity+middleFour⇒assoc : {e : A} → Identity e _∙_ →
identitymiddleFour⇒assoc : {e : A} → Identity e _∙_ →
_∙_ MiddleFourExchange _∙_ →
Associative _∙_
identity+middleFour⇒assoc = Base.identity+middleFour⇒assoc (cong₂ _∙_)
identitymiddleFour⇒assoc = Base.identitymiddleFour⇒assoc (cong₂ _∙_)

identity+middleFour⇒comm : {_+_ : Op₂ A} {e : A} → Identity e _+_ →
identitymiddleFour⇒comm : {_+_ : Op₂ A} {e : A} → Identity e _+_ →
_∙_ MiddleFourExchange _+_ →
Commutative _∙_
identity+middleFour⇒comm = Base.identity+middleFour⇒comm (cong₂ _∙_)
identitymiddleFour⇒comm = Base.identitymiddleFour⇒comm (cong₂ _∙_)

------------------------------------------------------------------------
-- Without Loss of Generality

module _ {p} {P : Pred A p} where

subst+comm⇒sym : ∀ {f} (f-comm : Commutative f) →
substcomm⇒sym : ∀ {f} (f-comm : Commutative f) →
Symmetric (λ a b → P (f a b))
subst+comm⇒sym = Base.subst+comm⇒sym {P = P} subst
substcomm⇒sym = Base.substcomm⇒sym {P = P} subst

wlog : ∀ {f} (f-comm : Commutative f) →
∀ {r} {_R_ : Rel _ r} → Total _R_ →
(∀ a b → a R b → P (f a b)) →
∀ a b → P (f a b)
wlog = Base.wlog {P = P} subst


------------------------------------------------------------------------
-- DEPRECATED NAMES
------------------------------------------------------------------------
-- Please use the new names as continuing support for the old names is
-- not guaranteed.

-- Version 2.0
-- See all the names deprecated in Algebra.Consequences.{Base|Setoid}
Loading