Skip to content

[ add ] rule of signs for RingWithoutOne #2761

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

Open
wants to merge 1 commit 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
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,13 @@ Additions to existing modules
∣ˡ-preorder : Preorder a ℓ _
```

* In `Algebra.Properties.Semigroup` adding consequences for associativity for semigroups
* In `Algebra.Properties.RingWithoutOne`:
```agda
[-x][-y]≈xy : ∀ x y → - x * - y ≈ x * y
```

```
* In `Algebra.Properties.Semigroup`, consequences for associativity for semigroups:
```
uv≈w⇒xu∙v≈xw : ∀ x → (x ∙ u) ∙ v ≈ x ∙ w
uv≈w⇒u∙vx≈wx : ∀ x → u ∙ (v ∙ x) ≈ w ∙ x
uv≈w⇒u[vx∙y]≈w∙xy : ∀ x y → u ∙ ((v ∙ x) ∙ y) ≈ w ∙ (x ∙ y)
Expand All @@ -275,7 +279,7 @@ Additions to existing modules
uv≈wx⇒yu∙v≈yw∙x : ∀ y → (y ∙ u) ∙ v ≈ (y ∙ w) ∙ x
uv≈wx⇒u∙vy≈w∙xy : ∀ y → u ∙ (v ∙ y) ≈ w ∙ (x ∙ y)
uv≈wx⇒yu∙vz≈yw∙xz : ∀ y z → (y ∙ u) ∙ (v ∙ z) ≈ (y ∙ w) ∙ (x ∙ z)
```
```

* In `Algebra.Properties.Semigroup.Divisibility`:
```agda
Expand Down
20 changes: 15 additions & 5 deletions src/Algebra/Properties/RingWithoutOne.agda
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ open import Function.Base using (_$_)
open import Relation.Binary.Reasoning.Setoid setoid

------------------------------------------------------------------------
-- Export properties of abelian groups
-- Re-export abelian group properties for addition

open AbelianGroupProperties +-abelianGroup public
renaming
Expand All @@ -36,6 +36,12 @@ open AbelianGroupProperties +-abelianGroup public
; ⁻¹-∙-comm to -‿+-comm
)

x+x≈x⇒x≈0 : ∀ x → x + x ≈ x → x ≈ 0#
x+x≈x⇒x≈0 x eq = +-identityˡ-unique x x eq

------------------------------------------------------------------------
-- Consequences of distributivity

-‿distribˡ-* : ∀ x y → - (x * y) ≈ - x * y
-‿distribˡ-* x y = sym $ begin
- x * y ≈⟨ +-identityʳ (- x * y) ⟨
Expand All @@ -58,17 +64,21 @@ open AbelianGroupProperties +-abelianGroup public
- (x * y) + 0# ≈⟨ +-identityʳ (- (x * y)) ⟩
- (x * y) ∎

x+x≈x⇒x≈0 : ∀ x → x + x ≈ x → x ≈ 0#
x+x≈x⇒x≈0 x eq = +-identityˡ-unique x x eq
[-x][-y]≈xy : ∀ x y → - x * - y ≈ x * y
[-x][-y]≈xy x y = begin
- x * - y ≈⟨ -‿distribˡ-* x (- y) ⟨
- (x * - y) ≈⟨ -‿cong (-‿distribʳ-* x y) ⟨
- (- (x * y)) ≈⟨ -‿involutive (x * y) ⟩
x * y ∎

x[y-z]≈xy-xz : ∀ x y z → x * (y - z) ≈ x * y - x * z
x[y-z]≈xy-xz x y z = begin
x * (y - z) ≈⟨ distribˡ x y (- z) ⟩
x * y + x * - z ≈⟨ +-congˡ (sym (-‿distribʳ-* x z)) ⟩
x * y + x * - z ≈⟨ +-congˡ (-‿distribʳ-* x z)
x * y - x * z ∎

[y-z]x≈yx-zx : ∀ x y z → (y - z) * x ≈ (y * x) - (z * x)
[y-z]x≈yx-zx x y z = begin
(y - z) * x ≈⟨ distribʳ x y (- z) ⟩
y * x + - z * x ≈⟨ +-congˡ (sym (-‿distribˡ-* z x)) ⟩
y * x + - z * x ≈⟨ +-congˡ (-‿distribˡ-* z x)
y * x - z * x ∎