1
1
------------------------------------------------------------------------
2
2
-- The Agda standard library
3
3
--
4
- -- Some theory for CancellativeCommutativeSemiring .
4
+ -- Properties of Coprimality and Irreducibility for Semiring .
5
5
------------------------------------------------------------------------
6
6
7
7
{-# OPTIONS --cubical-compatible --safe #-}
8
8
9
- open import Algebra using (Semiring)
10
- open import Data.Sum.Base using (reduce)
11
- open import Function.Base using (flip)
12
- open import Relation.Binary.Definitions using (Symmetric)
9
+ open import Algebra.Bundles using (Semiring)
13
10
14
11
module Algebra.Properties.Semiring.Primality
15
12
{a ℓ} (R : Semiring a ℓ)
16
13
where
17
14
15
+ open import Data.Sum.Base using (reduce)
16
+ open import Function.Base using (flip)
17
+ open import Relation.Binary.Definitions using (Symmetric)
18
+
18
19
open Semiring R renaming (Carrier to A)
19
20
open import Algebra.Properties.Semiring.Divisibility R
21
+ using (_∣_; ∣-trans; 0∤1)
22
+
23
+ private
24
+ variable
25
+ x p : A
26
+
20
27
21
28
------------------------------------------------------------------------
22
29
-- Re-export primality definitions
@@ -30,12 +37,12 @@ open import Algebra.Definitions.RawSemiring rawSemiring public
30
37
Coprime-sym : Symmetric Coprime
31
38
Coprime-sym coprime = flip coprime
32
39
33
- ∣1⇒Coprime : ∀ {x} y → x ∣ 1# → Coprime x y
34
- ∣1⇒Coprime {x} y x∣1 z∣x _ = ∣-trans z∣x x∣1
40
+ ∣1⇒Coprime : ∀ y → x ∣ 1# → Coprime x y
41
+ ∣1⇒Coprime _ x∣1 z∣x _ = ∣-trans z∣x x∣1
35
42
36
43
------------------------------------------------------------------------
37
44
-- Properties of Irreducible
38
45
39
- Irreducible⇒≉0 : 0# ≉ 1# → ∀ {p} → Irreducible p → p ≉ 0#
46
+ Irreducible⇒≉0 : 0# ≉ 1# → Irreducible p → p ≉ 0#
40
47
Irreducible⇒≉0 0≉1 (mkIrred _ chooseInvertible) p≈0 =
41
48
0∤1 0≉1 (reduce (chooseInvertible (trans p≈0 (sym (zeroˡ 0#)))))
0 commit comments