Skip to content
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,10 @@ Non-backwards compatible changes

* In `Algebra.Core` the operations `Opₗ` and `Opᵣ` have moved to `Algebra.Module.Core`.

* In `Algebra.Definitions.RawMagma.Divisibility` the definitions for `_∣ˡ_` and `_∣ʳ_`
have been changed from being defined as raw products to being defined as records. However,
the record constructors are called `_,_` so the changes required are minimal.

* In `Codata.Guarded.Stream` the following functions have been modified to have simpler definitions:
* `cycle`
* `interleave⁺`
Expand Down
25 changes: 19 additions & 6 deletions src/Algebra/Definitions/RawMagma.agda
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,31 @@ open RawMagma M renaming (Carrier to A)

infix 5 _∣ˡ_ _∤ˡ_ _∣ʳ_ _∤ʳ_ _∣_ _∤_

-- Divisibility from the left

_∣ˡ_ : Rel A (a ⊔ ℓ)
x ∣ˡ y = ∃ λ q → (x ∙ q) ≈ y
-- Divisibility from the left.
--
-- This and, the definition of right divisibility below, are defined as
-- records rather than in terms of the base product type in order to
-- make the use of pattern synonyms more ergonomic (see #2216 for
-- further details). The record field names are not designed to be
-- used explicitly and indeed aren't re-exported publicly by
-- `Algebra.X.Properties.Divisibility` modules.

record _∣ˡ_ (x y : A) : Set (a ⊔ ℓ) where
constructor _,_
field
quotient : A
equality : x ∙ quotient ≈ y

_∤ˡ_ : Rel A (a ⊔ ℓ)
x ∤ˡ y = ¬ x ∣ˡ y

-- Divisibility from the right

_∣ʳ_ : Rel A (a ⊔ ℓ)
x ∣ʳ y = ∃ λ q → (q ∙ x) ≈ y
record _∣ʳ_ (x y : A) : Set (a ⊔ ℓ) where
constructor _,_
field
quotient : A
equality : quotient ∙ x ≈ y

_∤ʳ_ : Rel A (a ⊔ ℓ)
x ∤ʳ y = ¬ x ∣ʳ y
Expand Down
2 changes: 1 addition & 1 deletion src/Algebra/Properties/Magma/Divisibility.agda
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ open Magma M
-- Re-export divisibility relations publicly

open import Algebra.Definitions.RawMagma rawMagma public
using (_∣_; _∤_; _∣∣_; _∤∤_; _∣ˡ_; _∤ˡ_; _∣ʳ_; _∤ʳ_)
using (_∣_; _∤_; _∣∣_; _∤∤_; _∣ˡ_; _∤ˡ_; _∣ʳ_; _∤ʳ_; _,_)

------------------------------------------------------------------------
-- Properties of divisibility
Expand Down
2 changes: 1 addition & 1 deletion src/Data/Nat/Base.agda
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
module Data.Nat.Base where

open import Algebra.Bundles.Raw using (RawMagma; RawMonoid; RawNearSemiring; RawSemiring)
open import Algebra.Definitions.RawMagma using (_∣ˡ_)
open import Algebra.Definitions.RawMagma using (_∣ˡ_; _,_)
open import Data.Bool.Base using (Bool; true; false; T; not)
open import Data.Parity.Base using (Parity; 0ℙ; 1ℙ)
open import Data.Product.Base using (_,_)
Copy link
Contributor

@jamesmckinna jamesmckinna Nov 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha! As far as I can remember, this import (UPDATED: of Data.Product.Base!) is/was/used to be present only to support the pattern synonym less-than-or-equal... ;-)

And yes, that does indeed seem to be the case... happy to push such a commit removing it (or would be, but... git problems at my end)

UPDATED: and: it must be removed, or else the bug isn't fixed! (see below).
NOW git weirdness fixed; commit pushed.

Expand Down