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

Fix #2396 by removing redundant zero in IsNonAssociativeRing #2410

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Bug-fixes
These operators are used for equational reasoning of heterogeneous equality
`x ≅ y`, but previously the three operators in `≡-syntax` unnecessarily require
`x` and `y` to have the same type, making them unusable in most situations.
* Removed unnecessary parameter `zero : Zero 0# *` from
`Algebra.Structures.IsNonAssociativeRing`.

Non-backwards compatible changes
--------------------------------
Expand Down
2 changes: 0 additions & 2 deletions src/Algebra/Construct/DirectProduct.agda
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,6 @@ nonAssociativeRing R S = record
; *-identity = UnitalMagma.identity (unitalMagma R.*-unitalMagma S.*-unitalMagma)
; distrib = (λ x y z → (R.distribˡ , S.distribˡ) <*> x <*> y <*> z)
, (λ x y z → (R.distribʳ , S.distribʳ) <*> x <*> y <*> z)
; zero = uncurry (λ x y → R.zeroˡ x , S.zeroˡ y)
, uncurry (λ x y → R.zeroʳ x , S.zeroʳ y)
}

} where module R = NonAssociativeRing R; module S = NonAssociativeRing S
Expand Down
16 changes: 9 additions & 7 deletions src/Algebra/Structures.agda
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,6 @@ record IsNonAssociativeRing (+ * : Op₂ A) (-_ : Op₁ A) (0# 1# : A) : Set (a
*-cong : Congruent₂ *
*-identity : Identity 1# *
distrib : * DistributesOver +
zero : Zero 0# *

open IsAbelianGroup +-isAbelianGroup public
renaming
Expand Down Expand Up @@ -833,18 +832,21 @@ record IsNonAssociativeRing (+ * : Op₂ A) (-_ : Op₁ A) (0# 1# : A) : Set (a
; isGroup to +-isGroup
)

zeroˡ : LeftZero 0# *
zeroˡ = proj₁ zero

zeroʳ : RightZero 0# *
zeroʳ = proj₂ zero

distribˡ : * DistributesOverˡ +
distribˡ = proj₁ distrib

distribʳ : * DistributesOverʳ +
distribʳ = proj₂ distrib

zeroˡ : LeftZero 0# *
zeroˡ = Consequences.assoc∧distribʳ∧idʳ∧invʳ⇒zeˡ setoid +-cong *-cong +-assoc distribʳ +-identityʳ -‿inverseʳ

zeroʳ : RightZero 0# *
zeroʳ = Consequences.assoc∧distribˡ∧idʳ∧invʳ⇒zeʳ setoid +-cong *-cong +-assoc distribˡ +-identityʳ -‿inverseʳ

zero : Zero 0# *
zero = zeroˡ , zeroʳ

*-isMagma : IsMagma *
*-isMagma = record
{ isEquivalence = isEquivalence
Expand Down
Loading