Skip to content

Commit c8cae98

Browse files
authored
Add +-*-commutativeRing structure to Data.Rational (ℚ) via ℚᵘ (#1212)
1 parent 10a4d2f commit c8cae98

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,13 @@ Other minor additions
278278
recompute : .(Coprime n d) → Coprime n d
279279
```
280280

281-
* Added new types and constructors to `Data.Rational.Unnormalised`:
281+
* Add proof to `Algebra.Morphism.RingMonomorphism`:
282+
```agda
283+
isCommutativeRing : IsCommutativeRing _≈₂_ _⊕_ _⊛_ ⊝_ 0#₂ 1#₂ →
284+
IsCommutativeRing _≈₁_ _+_ _*_ -_ 0# 1#
285+
```
286+
287+
* Added new types and constructors to `Data.Rational`:
282288
```agda
283289
NonZero : Pred ℚ 0ℓ
284290
Positive : Pred ℚ 0ℓ
@@ -295,6 +301,12 @@ Other minor additions
295301
nonNegative : p ≥ 0ℚ → NonNegative p
296302
```
297303

304+
* Added proofs to `Data.Rational.Properties`:
305+
```agda
306+
+-*-isCommutativeRing : IsCommutativeRing _+_ _*_ -_ 0ℚ 1ℚ
307+
+-*-commutativeRing : CommutativeRing 0ℓ 0ℓ
308+
```
309+
298310
* Added new types and constructors to `Data.Rational.Unnormalised`
299311
```agda
300312
_≠_ : Rel ℚᵘ 0ℓ

src/Algebra/Morphism/RingMonomorphism.agda

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,10 @@ isRing isRing = record
127127
; distrib = distrib R.+-isGroup R.*-isMagma R.distrib
128128
; zero = zero R.+-isGroup R.*-isMagma R.zero
129129
} where module R = IsRing isRing
130+
131+
isCommutativeRing : IsCommutativeRing _≈₂_ _⊕_ _⊛_ ⊝_ 0#₂ 1#₂
132+
IsCommutativeRing _≈₁_ _+_ _*_ -_ 0# 1#
133+
isCommutativeRing isCommRing = record
134+
{ isRing = isRing C.isRing
135+
; *-comm = *-comm C.*-isMagma C.*-comm
136+
} where module C = IsCommutativeRing isCommRing

src/Data/Rational/Properties.agda

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,9 @@ private
818818
+-*-isRing : IsRing _+_ _*_ -_ 0ℚ 1ℚ
819819
+-*-isRing = *-Monomorphism.isRing ℚᵘ.+-*-isRing
820820

821+
+-*-isCommutativeRing : IsCommutativeRing _+_ _*_ -_ 0ℚ 1ℚ
822+
+-*-isCommutativeRing = *-Monomorphism.isCommutativeRing ℚᵘ.+-*-isCommutativeRing
823+
821824
------------------------------------------------------------------------
822825
-- Packages
823826

@@ -846,6 +849,11 @@ private
846849
{ isRing = +-*-isRing
847850
}
848851

852+
+-*-commutativeRing : CommutativeRing 0ℓ 0ℓ
853+
+-*-commutativeRing = record
854+
{ isCommutativeRing = +-*-isCommutativeRing
855+
}
856+
849857
------------------------------------------------------------------------
850858
-- DEPRECATED NAMES
851859
------------------------------------------------------------------------

0 commit comments

Comments
 (0)