7
7
{-# OPTIONS --cubical-compatible --safe #-}
8
8
9
9
open import Algebra using (Magma)
10
- open import Data.Product.Base using (_×_; _,_; ∃; map; swap)
11
- open import Relation.Binary.Definitions
12
10
13
11
module Algebra.Properties.Magma.Divisibility {a ℓ} (M : Magma a ℓ) where
14
12
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
+
15
18
open Magma M
16
19
17
20
------------------------------------------------------------------------
@@ -23,32 +26,84 @@ open import Algebra.Definitions.RawMagma rawMagma public
23
26
------------------------------------------------------------------------
24
27
-- Properties of divisibility
25
28
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
28
31
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
31
34
32
- ∣-resp : _∣_ Respects₂ _≈_
33
- ∣-resp = ∣-respʳ , ∣-respˡ
35
+ ∣-resp-≈ : _∣_ Respects₂ _≈_
36
+ ∣-resp-≈ = ∣-respʳ-≈ , ∣-respˡ-≈
34
37
35
38
x∣yx : ∀ x y → x ∣ y ∙ x
36
39
x∣yx x y = y , refl
37
40
38
41
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ˡ-≈
40
55
41
56
------------------------------------------------------------------------
42
57
-- Properties of mutual divisibility _∣∣_
43
58
44
59
∣∣-sym : Symmetric _∣∣_
45
60
∣∣-sym = swap
46
61
47
- ∣∣-respʳ-≈ : _∣∣_ Respectsʳ _≈_
48
- ∣∣-respʳ-≈ y≈z (x∣y , y∣x) = ∣-respʳ y≈z x∣y , ∣-respˡ y≈z y∣x
49
-
50
62
∣∣-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
52
67
53
68
∣∣-resp-≈ : _∣∣_ Respects₂ _≈_
54
69
∣∣-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