Skip to content

Commit 41001ea

Browse files
authored
Add properties of non-divisibility to Algebra.Properties.Magma.Divisibility (#2469)
* fix #2306 * blank line * renaming/deprecation following #2341 * add deprecations to `CHANGELOG`
1 parent 4e87466 commit 41001ea

File tree

2 files changed

+86
-13
lines changed

2 files changed

+86
-13
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ Deprecated names
3030
∣-factors-≈ ↦ xy≈z⇒x|z∧y|z
3131
```
3232

33+
* In `Algebra.Properties.Magma.Divisibility`:
34+
```agda
35+
∣-respˡ ↦ ∣-respˡ-≈
36+
∣-respʳ ↦ ∣-respʳ-≈
37+
∣-resp ↦ ∣-resp-≈
38+
```
39+
3340
* In `Algebra.Solver.CommutativeMonoid`:
3441
```agda
3542
normalise-correct ↦ Algebra.Solver.CommutativeMonoid.Normal.correct
@@ -89,6 +96,17 @@ New modules
8996
Additions to existing modules
9097
-----------------------------
9198

99+
* Properties of non-divisibility in `Algebra.Properties.Magma.Divisibility`:
100+
```agda
101+
∤-respˡ-≈ : _∤_ Respectsˡ _≈_
102+
∤-respʳ-≈ : _∤_ Respectsʳ _≈_
103+
∤-resp-≈ : _∤_ Respects₂ _≈_
104+
∤∤-sym : Symmetric _∤∤_
105+
∤∤-respˡ-≈ : _∤∤_ Respectsˡ _≈_
106+
∤∤-respʳ-≈ : _∤∤_ Respectsʳ _≈_
107+
∤∤-resp-≈ : _∤∤_ Respects₂ _≈_
108+
```
109+
92110
* In `Algebra.Solver.Ring`
93111
```agda
94112
Env : ℕ → Set _

src/Algebra/Properties/Magma/Divisibility.agda

Lines changed: 68 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@
77
{-# OPTIONS --cubical-compatible --safe #-}
88

99
open import Algebra using (Magma)
10-
open import Data.Product.Base using (_×_; _,_; ∃; map; swap)
11-
open import Relation.Binary.Definitions
1210

1311
module Algebra.Properties.Magma.Divisibility {a ℓ} (M : Magma a ℓ) where
1412

13+
open import Data.Product.Base using (_,_; swap)
14+
open import Relation.Binary.Definitions
15+
using (_Respects_; _Respectsˡ_; _Respectsʳ_; _Respects₂_; Symmetric)
16+
open import Relation.Nullary.Negation.Core using (contradiction)
17+
1518
open Magma M
1619

1720
------------------------------------------------------------------------
@@ -23,32 +26,84 @@ open import Algebra.Definitions.RawMagma rawMagma public
2326
------------------------------------------------------------------------
2427
-- Properties of divisibility
2528

26-
∣-respʳ : _∣_ Respectsʳ _≈_
27-
∣-respʳ y≈z (q , qx≈y) = q , trans qx≈y y≈z
29+
∣-respʳ-≈ : _∣_ Respectsʳ _≈_
30+
∣-respʳ-≈ y≈z (q , qx≈y) = q , trans qx≈y y≈z
2831

29-
∣-respˡ : _∣_ Respectsˡ _≈_
30-
∣-respˡ x≈z (q , qx≈y) = q , trans (∙-congˡ (sym x≈z)) qx≈y
32+
∣-respˡ-≈ : _∣_ Respectsˡ _≈_
33+
∣-respˡ-≈ x≈z (q , qx≈y) = q , trans (∙-congˡ (sym x≈z)) qx≈y
3134

32-
∣-resp : _∣_ Respects₂ _≈_
33-
∣-resp = ∣-respʳ , ∣-respˡ
35+
∣-resp-≈ : _∣_ Respects₂ _≈_
36+
∣-resp-≈ = ∣-respʳ-≈ , ∣-respˡ-≈
3437

3538
x∣yx : x y x ∣ y ∙ x
3639
x∣yx x y = y , refl
3740

3841
xy≈z⇒y∣z : x y {z} x ∙ y ≈ z y ∣ z
39-
xy≈z⇒y∣z x y xy≈z = ∣-respʳ xy≈z (x∣yx y x)
42+
xy≈z⇒y∣z x y xy≈z = ∣-respʳ-≈ xy≈z (x∣yx y x)
43+
44+
------------------------------------------------------------------------
45+
-- Properties of non-divisibility
46+
47+
∤-respˡ-≈ : _∤_ Respectsˡ _≈_
48+
∤-respˡ-≈ x≈y x∤z y∣z = contradiction (∣-respˡ-≈ (sym x≈y) y∣z) x∤z
49+
50+
∤-respʳ-≈ : _∤_ Respectsʳ _≈_
51+
∤-respʳ-≈ x≈y z∤x z∣y = contradiction (∣-respʳ-≈ (sym x≈y) z∣y) z∤x
52+
53+
∤-resp-≈ : _∤_ Respects₂ _≈_
54+
∤-resp-≈ = ∤-respʳ-≈ , ∤-respˡ-≈
4055

4156
------------------------------------------------------------------------
4257
-- Properties of mutual divisibility _∣∣_
4358

4459
∣∣-sym : Symmetric _∣∣_
4560
∣∣-sym = swap
4661

47-
∣∣-respʳ-≈ : _∣∣_ Respectsʳ _≈_
48-
∣∣-respʳ-≈ y≈z (x∣y , y∣x) = ∣-respʳ y≈z x∣y , ∣-respˡ y≈z y∣x
49-
5062
∣∣-respˡ-≈ : _∣∣_ Respectsˡ _≈_
51-
∣∣-respˡ-≈ x≈z (x∣y , y∣x) = ∣-respˡ x≈z x∣y , ∣-respʳ x≈z y∣x
63+
∣∣-respˡ-≈ x≈z (x∣y , y∣x) = ∣-respˡ-≈ x≈z x∣y , ∣-respʳ-≈ x≈z y∣x
64+
65+
∣∣-respʳ-≈ : _∣∣_ Respectsʳ _≈_
66+
∣∣-respʳ-≈ y≈z (x∣y , y∣x) = ∣-respʳ-≈ y≈z x∣y , ∣-respˡ-≈ y≈z y∣x
5267

5368
∣∣-resp-≈ : _∣∣_ Respects₂ _≈_
5469
∣∣-resp-≈ = ∣∣-respʳ-≈ , ∣∣-respˡ-≈
70+
71+
------------------------------------------------------------------------
72+
-- Properties of mutual non-divisibility _∤∤_
73+
74+
∤∤-sym : Symmetric _∤∤_
75+
∤∤-sym x∤∤y y∣∣x = contradiction (∣∣-sym y∣∣x) x∤∤y
76+
77+
∤∤-respˡ-≈ : _∤∤_ Respectsˡ _≈_
78+
∤∤-respˡ-≈ x≈y x∤∤z y∣∣z = contradiction (∣∣-respˡ-≈ (sym x≈y) y∣∣z) x∤∤z
79+
80+
∤∤-respʳ-≈ : _∤∤_ Respectsʳ _≈_
81+
∤∤-respʳ-≈ x≈y z∤∤x z∣∣y = contradiction (∣∣-respʳ-≈ (sym x≈y) z∣∣y) z∤∤x
82+
83+
∤∤-resp-≈ : _∤∤_ Respects₂ _≈_
84+
∤∤-resp-≈ = ∤∤-respʳ-≈ , ∤∤-respˡ-≈
85+
86+
87+
------------------------------------------------------------------------
88+
-- DEPRECATED NAMES
89+
------------------------------------------------------------------------
90+
-- Please use the new names as continuing support for the old names is
91+
-- not guaranteed.
92+
93+
-- Version 2.2
94+
95+
∣-respˡ = ∣-respˡ-≈
96+
{-# WARNING_ON_USAGE ∣-respˡ
97+
"Warning: ∣-respˡ was deprecated in v2.2.
98+
Please use ∣-respˡ-≈ instead. "
99+
#-}
100+
∣-respʳ = ∣-respʳ-≈
101+
{-# WARNING_ON_USAGE ∣-respʳ
102+
"Warning: ∣-respʳ was deprecated in v2.2.
103+
Please use ∣-respʳ-≈ instead. "
104+
#-}
105+
∣-resp = ∣-resp-≈
106+
{-# WARNING_ON_USAGE ∣-resp
107+
"Warning: ∣-resp was deprecated in v2.2.
108+
Please use ∣-resp-≈ instead. "
109+
#-}

0 commit comments

Comments
 (0)