Skip to content

Commit ecd82b0

Browse files
committed
[ DRY ] refactor Algebra.Properties.Quasigroup
1 parent 5c64117 commit ecd82b0

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

src/Algebra/Properties/Quasigroup.agda

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,29 @@ open import Algebra.Definitions _≈_
1515
open import Relation.Binary.Reasoning.Setoid setoid
1616
open import Data.Product.Base using (_,_)
1717

18+
y≈x\\z : x y z x ∙ y ≈ z y ≈ x \\ z
19+
y≈x\\z x y z eq = begin
20+
y ≈⟨ leftDividesʳ x y ⟨
21+
x \\ (x ∙ y) ≈⟨ \\-congˡ eq ⟩
22+
x \\ z ∎
23+
24+
x≈z//y : x y z x ∙ y ≈ z x ≈ z // y
25+
x≈z//y x y z eq = begin
26+
x ≈⟨ rightDividesʳ y x ⟨
27+
(x ∙ y) // y ≈⟨ //-congʳ eq ⟩
28+
z // y ∎
29+
1830
cancelˡ : LeftCancellative _∙_
1931
cancelˡ x y z eq = begin
20-
y ≈⟨ leftDividesʳ x y ⟨
21-
x \\ (x ∙ y) ≈⟨ \\-congˡ eq ⟩
32+
y ≈⟨ y≈x\\z x y (x ∙ z) eq ⟩
2233
x \\ (x ∙ z) ≈⟨ leftDividesʳ x z ⟩
2334
z ∎
2435

2536
cancelʳ : RightCancellative _∙_
2637
cancelʳ x y z eq = begin
27-
y ≈⟨ rightDividesʳ x y ⟨
28-
(y ∙ x) // x ≈⟨ //-congʳ eq ⟩
38+
y ≈⟨ x≈z//y y x (z ∙ x) eq ⟩
2939
(z ∙ x) // x ≈⟨ rightDividesʳ x z ⟩
3040
z ∎
3141

3242
cancel : Cancellative _∙_
3343
cancel = cancelˡ , cancelʳ
34-
35-
y≈x\\z : x y z x ∙ y ≈ z y ≈ x \\ z
36-
y≈x\\z x y z eq = begin
37-
y ≈⟨ leftDividesʳ x y ⟨
38-
x \\ (x ∙ y) ≈⟨ \\-congˡ eq ⟩
39-
x \\ z ∎
40-
41-
x≈z//y : x y z x ∙ y ≈ z x ≈ z // y
42-
x≈z//y x y z eq = begin
43-
x ≈⟨ rightDividesʳ y x ⟨
44-
(x ∙ y) // y ≈⟨ //-congʳ eq ⟩
45-
z // y ∎

0 commit comments

Comments
 (0)