| 1 |
------------------------------------------------------------------------ |
| 2 |
-- The Agda standard library |
| 3 |
-- |
| 4 |
-- Some basic properties of Quasigroup |
| 5 |
------------------------------------------------------------------------ |
| 6 |
|
| 7 |
{-# OPTIONS --cubical-compatible --safe #-} |
| 8 |
|
| 9 |
open import Algebra.Bundles using (Quasigroup) |
| 10 |
|
| 11 |
module Algebra.Properties.Quasigroup {q₁ q₂} (Q : Quasigroup q₁ q₂) where |
| 12 |
|
| 13 |
open Quasigroup Q |
| 14 |
open import Algebra.Definitions _≈_ |
| 15 |
open import Relation.Binary.Reasoning.Setoid setoid |
| 16 |
open import Data.Product.Base using (_,_) |
| 17 |
|
| 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 |
|
| 30 |
cancelˡ : LeftCancellative _∙_ |
| 31 |
cancelˡ x y z eq = begin |
| 32 |
y ≈⟨ y≈x\\z x y (x ∙ z) eq ⟩ |
| 33 |
x \\ (x ∙ z) ≈⟨ leftDividesʳ x z ⟩ |
| 34 |
z ∎ |
| 35 |
|
| 36 |
cancelʳ : RightCancellative _∙_ |
| 37 |
cancelʳ x y z eq = begin |
| 38 |
y ≈⟨ x≈z//y y x (z ∙ x) eq ⟩ |
| 39 |
(z ∙ x) // x ≈⟨ rightDividesʳ x z ⟩ |
| 40 |
z ∎ |
| 41 |
|
| 42 |
cancel : Cancellative _∙_ |
| 43 |
cancel = cancelˡ , cancelʳ |