Debian Codegraph @

src/Algebra/Properties/Magma/Divisibility.agda

raw
1 ------------------------------------------------------------------------
2 -- The Agda standard library
3 --
4 -- Divisibility over magmas
5 ------------------------------------------------------------------------
6
7 {-# OPTIONS --cubical-compatible --safe #-}
8
9 open import Algebra.Bundles using (Magma)
10
11 module Algebra.Properties.Magma.Divisibility {a ℓ} (M : Magma a ℓ) where
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
18 open Magma M
19
20 ------------------------------------------------------------------------
21 -- Re-export divisibility relations publicly
22
23 open import Algebra.Definitions.RawMagma rawMagma public
24 using (_∣_; _∤_; _∥_; _∦_; _∣ˡ_; _∤ˡ_; _∣ʳ_; _∤ʳ_; _,_)
25
26 ------------------------------------------------------------------------
27 -- Properties of right divisibility
28
29 ∣ʳ-respʳ-≈ : _∣ʳ_ Respectsʳ _≈_
30 ∣ʳ-respʳ-≈ y≈z (q , qx≈y) = q , trans qx≈y y≈z
31
32 ∣ʳ-respˡ-≈ : _∣ʳ_ Respectsˡ _≈_
33 ∣ʳ-respˡ-≈ x≈z (q , qx≈y) = q , trans (∙-congˡ (sym x≈z)) qx≈y
34
35 ∣ʳ-resp-≈ : _∣ʳ_ Respects₂ _≈_
36 ∣ʳ-resp-≈ = ∣ʳ-respʳ-≈ , ∣ʳ-respˡ-≈
37
38 x∣ʳyx : ∀ x y → x ∣ʳ y ∙ x
39 x∣ʳyx x y = y , refl
40
41 xy≈z⇒y∣ʳz : ∀ x y {z} → x ∙ y ≈ z → y ∣ʳ z
42 xy≈z⇒y∣ʳz x y xy≈z = x , xy≈z
43
44 ------------------------------------------------------------------------
45 -- Properties of left divisibility
46
47 ∣ˡ-respʳ-≈ : _∣ˡ_ Respectsʳ _≈_
48 ∣ˡ-respʳ-≈ y≈z (q , xq≈y) = q , trans xq≈y y≈z
49
50 ∣ˡ-respˡ-≈ : _∣ˡ_ Respectsˡ _≈_
51 ∣ˡ-respˡ-≈ x≈z (q , xq≈y) = q , trans (∙-congʳ (sym x≈z)) xq≈y
52
53 ∣ˡ-resp-≈ : _∣ˡ_ Respects₂ _≈_
54 ∣ˡ-resp-≈ = ∣ˡ-respʳ-≈ , ∣ˡ-respˡ-≈
55
56 x∣ˡxy : ∀ x y → x ∣ˡ x ∙ y
57 x∣ˡxy x y = y , refl
58
59 xy≈z⇒x∣ˡz : ∀ x y {z} → x ∙ y ≈ z → x ∣ˡ z
60 xy≈z⇒x∣ˡz x y xy≈z = y , xy≈z
61
62 ------------------------------------------------------------------------
63 -- Properties of non-divisibility
64
65 ∤-respˡ-≈ : _∤_ Respectsˡ _≈_
66 ∤-respˡ-≈ x≈y x∤z y∣ʳz = contradiction (∣ʳ-respˡ-≈ (sym x≈y) y∣ʳz) x∤z
67
68 ∤-respʳ-≈ : _∤_ Respectsʳ _≈_
69 ∤-respʳ-≈ x≈y z∤x z∣ʳy = contradiction (∣ʳ-respʳ-≈ (sym x≈y) z∣ʳy) z∤x
70
71 ∤-resp-≈ : _∤_ Respects₂ _≈_
72 ∤-resp-≈ = ∤-respʳ-≈ , ∤-respˡ-≈
73
74 ------------------------------------------------------------------------
75 -- Properties of mutual divisibility _∥_
76
77 ∥-sym : Symmetric _∥_
78 ∥-sym = swap
79
80 ∥-respˡ-≈ : _∥_ Respectsˡ _≈_
81 ∥-respˡ-≈ x≈z (x∣ʳy , y∣ʳx) = ∣ʳ-respˡ-≈ x≈z x∣ʳy , ∣ʳ-respʳ-≈ x≈z y∣ʳx
82
83 ∥-respʳ-≈ : _∥_ Respectsʳ _≈_
84 ∥-respʳ-≈ y≈z (x∣ʳy , y∣ʳx) = ∣ʳ-respʳ-≈ y≈z x∣ʳy , ∣ʳ-respˡ-≈ y≈z y∣ʳx
85
86 ∥-resp-≈ : _∥_ Respects₂ _≈_
87 ∥-resp-≈ = ∥-respʳ-≈ , ∥-respˡ-≈
88
89 ------------------------------------------------------------------------
90 -- Properties of mutual non-divisibility _∤∤_
91
92 ∦-sym : Symmetric _∦_
93 ∦-sym x∦y y∥x = contradiction (∥-sym y∥x) x∦y
94
95 ∦-respˡ-≈ : _∦_ Respectsˡ _≈_
96 ∦-respˡ-≈ x≈y x∦z y∥z = contradiction (∥-respˡ-≈ (sym x≈y) y∥z) x∦z
97
98 ∦-respʳ-≈ : _∦_ Respectsʳ _≈_
99 ∦-respʳ-≈ x≈y z∦x z∥y = contradiction (∥-respʳ-≈ (sym x≈y) z∥y) z∦x
100
101 ∦-resp-≈ : _∦_ Respects₂ _≈_
102 ∦-resp-≈ = ∦-respʳ-≈ , ∦-respˡ-≈
103
104
105 ------------------------------------------------------------------------
106 -- DEPRECATED NAMES
107 ------------------------------------------------------------------------
108 -- Please use the new names as continuing support for the old names is
109 -- not guaranteed.
110
111 -- Version 2.2
112
113 ∣-respˡ = ∣ʳ-respˡ-≈
114 {-# WARNING_ON_USAGE ∣-respˡ
115 "Warning: ∣-respˡ was deprecated in v2.2.
116 Please use ∣ʳ-respˡ-≈ instead. "
117 #-}
118 ∣-respʳ = ∣ʳ-respʳ-≈
119 {-# WARNING_ON_USAGE ∣-respʳ
120 "Warning: ∣-respʳ was deprecated in v2.2.
121 Please use ∣ʳ-respʳ-≈ instead. "
122 #-}
123 ∣-resp = ∣ʳ-resp-≈
124 {-# WARNING_ON_USAGE ∣-resp
125 "Warning: ∣-resp was deprecated in v2.2.
126 Please use ∣ʳ-resp-≈ instead. "
127 #-}
128
129 -- Version 2.3
130
131 ∣∣-sym = ∥-sym
132 {-# WARNING_ON_USAGE ∣∣-sym
133 "Warning: ∣∣-sym was deprecated in v2.3.
134 Please use ∥-sym instead. "
135 #-}
136 ∣∣-respˡ-≈ = ∥-respˡ-≈
137 {-# WARNING_ON_USAGE ∣∣-respˡ-≈
138 "Warning: ∣∣-respˡ-≈ was deprecated in v2.3.
139 Please use ∥-respˡ-≈ instead. "
140 #-}
141 ∣∣-respʳ-≈ = ∥-respʳ-≈
142 {-# WARNING_ON_USAGE ∣∣-respʳ-≈
143 "Warning: ∣∣-respʳ-≈ was deprecated in v2.3.
144 Please use ∥-respʳ-≈ instead. "
145 #-}
146 ∣∣-resp-≈ = ∥-resp-≈
147 {-# WARNING_ON_USAGE ∣∣-resp-≈
148 "Warning: ∣∣-resp-≈ was deprecated in v2.3.
149 Please use ∥-resp-≈ instead. "
150 #-}
151 ∤∤-sym = ∦-sym
152 {-# WARNING_ON_USAGE ∤∤-sym
153 "Warning: ∤∤-sym was deprecated in v2.3.
154 Please use ∦-sym instead. "
155 #-}
156 ∤∤-respˡ-≈ = ∦-respˡ-≈
157 {-# WARNING_ON_USAGE ∤∤-respˡ-≈
158 "Warning: ∤∤-respˡ-≈ was deprecated in v2.3.
159 Please use ∦-respˡ-≈ instead. "
160 #-}
161 ∤∤-respʳ-≈ = ∦-respʳ-≈
162 {-# WARNING_ON_USAGE ∤∤-respʳ-≈
163 "Warning: ∤∤-respʳ-≈ was deprecated in v2.3.
164 Please use ∦-respʳ-≈ instead. "
165 #-}
166 ∤∤-resp-≈ = ∦-resp-≈
167 {-# WARNING_ON_USAGE ∤∤-resp-≈
168 "Warning: ∤∤-resp-≈ was deprecated in v2.3.
169 Please use ∦-resp-≈ instead. "
170 #-}
171
172 ∣-respʳ-≈ = ∣ʳ-respʳ-≈
173 {-# WARNING_ON_USAGE ∣-respʳ-≈
174 "Warning: ∣-respʳ-≈ was deprecated in v2.3.
175 Please use ∣ʳ-respʳ-≈ instead. "
176 #-}
177
178 ∣-respˡ-≈ = ∣ʳ-respˡ-≈
179 {-# WARNING_ON_USAGE ∣-respˡ-≈
180 "Warning: ∣-respˡ-≈ was deprecated in v2.3.
181 Please use ∣ʳ-respˡ-≈ instead. "
182 #-}
183
184 ∣-resp-≈ = ∣ʳ-resp-≈
185 {-# WARNING_ON_USAGE ∣-resp-≈
186 "Warning: ∣-resp-≈ was deprecated in v2.3.
187 Please use ∣ʳ-resp-≈ instead. "
188 #-}
189
190 x∣yx = x∣ʳyx
191 {-# WARNING_ON_USAGE x∣yx
192 "Warning: x∣yx was deprecated in v2.3.
193 Please use x∣ʳyx instead. "
194 #-}
195
196 xy≈z⇒y∣z = xy≈z⇒y∣ʳz
197 {-# WARNING_ON_USAGE xy≈z⇒y∣z
198 "Warning: xy≈z⇒y∣z was deprecated in v2.3.
199 Please use xy≈z⇒y∣ʳz instead. "
200 #-}