Skip to content

Commit c2302f4

Browse files
authoredOct 26, 2022
Fix #1844 by renaming abelian group proof for integers and moving raw bundles (#1862)
1 parent fd37e5d commit c2302f4

File tree

3 files changed

+62
-10
lines changed

3 files changed

+62
-10
lines changed
 

‎CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,8 @@ Deprecated names
968968
pos-distrib-* ↦ pos-*
969969
pos-+-commute ↦ pos-+
970970
abs-*-commute ↦ abs-*
971+
972+
+-isAbelianGroup ↦ +-0-isAbelianGroup
971973
```
972974

973975
* In `Data.List.Properties`:

‎src/Data/Integer/Base.agda

+48
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
module Data.Integer.Base where
1313

14+
open import Algebra.Bundles.Raw
15+
using (RawMagma; RawMonoid; RawNearSemiring; RawSemiring; RawRing)
1416
open import Data.Bool.Base using (Bool; T; true; false)
1517
open import Data.Nat.Base as ℕ using (ℕ; z≤n; s≤s)
1618
open import Data.Sign.Base as Sign using (Sign)
@@ -293,3 +295,49 @@ _%ℕ_ : (dividend : ℤ) (divisor : ℕ) .{{_ : ℕ.NonZero divisor}} → ℕ
293295

294296
_%_ : (dividend divisor : ℤ) .{{_ : NonZero divisor}}
295297
i % j = i %ℕ ∣ j ∣
298+
299+
------------------------------------------------------------------------
300+
-- Bundles
301+
302+
+-rawMagma : RawMagma 0ℓ 0ℓ
303+
+-rawMagma = record { _≈_ = _≡_ ; _∙_ = _+_ }
304+
305+
+-0-rawMonoid : RawMonoid 0ℓ 0ℓ
306+
+-0-rawMonoid = record { _≈_ = _≡_ ; _∙_ = _+_ ; ε = 0ℤ }
307+
308+
*-rawMagma : RawMagma 0ℓ 0ℓ
309+
*-rawMagma = record { _≈_ = _≡_ ; _∙_ = _*_ }
310+
311+
*-1-rawMonoid : RawMonoid 0ℓ 0ℓ
312+
*-1-rawMonoid = record { _≈_ = _≡_ ; _∙_ = _*_ ; ε = 1ℤ }
313+
314+
+-*-rawNearSemiring : RawNearSemiring 0ℓ 0ℓ
315+
+-*-rawNearSemiring = record
316+
{ Carrier = _
317+
; _≈_ = _≡_
318+
; _+_ = _+_
319+
; _*_ = _*_
320+
; 0# = 0ℤ
321+
}
322+
323+
+-*-rawSemiring : RawSemiring 0ℓ 0ℓ
324+
+-*-rawSemiring = record
325+
{ Carrier = _
326+
; _≈_ = _≡_
327+
; _+_ = _+_
328+
; _*_ = _*_
329+
; 0# = 0ℤ
330+
; 1# = 1ℤ
331+
}
332+
333+
+-*-rawRing : RawRing 0ℓ 0ℓ
334+
+-*-rawRing = record
335+
{ Carrier = _
336+
; _≈_ = _≡_
337+
; _+_ = _+_
338+
; _*_ = _*_
339+
; -_ = -_
340+
; 0# = 0ℤ
341+
; 1# = 1ℤ
342+
}
343+

‎src/Data/Integer/Properties.agda

+12-10
Original file line numberDiff line numberDiff line change
@@ -944,8 +944,8 @@ distribʳ-⊖-+-neg m n o = begin
944944
; ⁻¹-cong = cong (-_)
945945
}
946946

947-
+-isAbelianGroup : IsAbelianGroup _+_ +0 (-_)
948-
+-isAbelianGroup = record
947+
+-0-isAbelianGroup : IsAbelianGroup _+_ +0 (-_)
948+
+-0-isAbelianGroup = record
949949
{ isGroup = +-0-isGroup
950950
; comm = +-comm
951951
}
@@ -980,7 +980,7 @@ distribʳ-⊖-+-neg m n o = begin
980980

981981
+-0-abelianGroup : AbelianGroup 0ℓ 0ℓ
982982
+-0-abelianGroup = record
983-
{ isAbelianGroup = +-isAbelianGroup
983+
{ isAbelianGroup = +-0-isAbelianGroup
984984
}
985985

986986
------------------------------------------------------------------------
@@ -1522,7 +1522,7 @@ private
15221522

15231523
+-*-isRing : IsRing _+_ _*_ -_ 0ℤ 1ℤ
15241524
+-*-isRing = record
1525-
{ +-isAbelianGroup = +-isAbelianGroup
1525+
{ +-isAbelianGroup = +-0-isAbelianGroup
15261526
; *-cong = cong₂ _*_
15271527
; *-assoc = *-assoc
15281528
; *-identity = *-identity
@@ -1539,12 +1539,6 @@ private
15391539
------------------------------------------------------------------------
15401540
-- Bundles
15411541

1542-
*-rawMagma : RawMagma 0ℓ 0ℓ
1543-
*-rawMagma = record { _≈_ = _≡_ ; _∙_ = _*_ }
1544-
1545-
*-1-rawMonoid : RawMonoid 0ℓ 0ℓ
1546-
*-1-rawMonoid = record { _≈_ = _≡_ ; _∙_ = _*_ ; ε = 1ℤ }
1547-
15481542
*-magma : Magma 0ℓ 0ℓ
15491543
*-magma = record
15501544
{ isMagma = *-isMagma
@@ -2387,3 +2381,11 @@ pos-distrib-* m n = sym (pos-* m n)
23872381
"Warning: pos-distrib-* was deprecated in v2.0
23882382
Please use pos-* instead."
23892383
#-}
2384+
+-isAbelianGroup = +-0-isAbelianGroup
2385+
{-# WARNING_ON_USAGE +-isAbelianGroup
2386+
"Warning: +-isAbelianGroup was deprecated in v2.0
2387+
Please use +-0-isAbelianGroup instead."
2388+
#-}
2389+
{- issue1844/issue1755: raw bundles have moved to `Data.X.Base` -}
2390+
open Data.Integer.Base public
2391+
using (*-rawMagma; *-1-rawMonoid)

0 commit comments

Comments
 (0)
Please sign in to comment.