| 1 |
------------------------------------------------------------------------ |
| 2 |
-- The Agda standard library |
| 3 |
-- |
| 4 |
-- Properties of divisibility over semirings |
| 5 |
------------------------------------------------------------------------ |
| 6 |
|
| 7 |
{-# OPTIONS --cubical-compatible --safe #-} |
| 8 |
|
| 9 |
open import Algebra.Bundles using (Semiring) |
| 10 |
|
| 11 |
module Algebra.Properties.Semiring.Divisibility |
| 12 |
{a ℓ} (R : Semiring a ℓ) where |
| 13 |
|
| 14 |
open Semiring R |
| 15 |
|
| 16 |
------------------------------------------------------------------------ |
| 17 |
-- Re-exporting divisibility over monoids |
| 18 |
|
| 19 |
open import Algebra.Properties.Monoid.Divisibility *-monoid public |
| 20 |
renaming (ε∣_ to 1∣_) |
| 21 |
|
| 22 |
------------------------------------------------------------------------ |
| 23 |
-- Divisibility properties specific to semirings. |
| 24 |
|
| 25 |
infixr 8 _∣0 |
| 26 |
|
| 27 |
_∣0 : ∀ x → x ∣ 0# |
| 28 |
x ∣0 = 0# , zeroˡ x |
| 29 |
|
| 30 |
0∣x⇒x≈0 : ∀ {x} → 0# ∣ x → x ≈ 0# |
| 31 |
0∣x⇒x≈0 (q , q*0≈x) = trans (sym q*0≈x) (zeroʳ q) |
| 32 |
|
| 33 |
x∣y∧y≉0⇒x≉0 : ∀ {x y} → x ∣ y → y ≉ 0# → x ≉ 0# |
| 34 |
x∣y∧y≉0⇒x≉0 x∣y y≉0 x≈0 = y≉0 (0∣x⇒x≈0 (∣-respˡ x≈0 x∣y)) |
| 35 |
|
| 36 |
0∤1 : 0# ≉ 1# → 0# ∤ 1# |
| 37 |
0∤1 0≉1 0∣1 = 0≉1 (sym (0∣x⇒x≈0 0∣1)) |