Debian Codegraph @

src/Algebra/Apartness/Structures.agda

raw
1 ------------------------------------------------------------------------
2 -- The Agda standard library
3 --
4 -- Algebraic structures with an apartness relation
5 ------------------------------------------------------------------------
6
7 {-# OPTIONS --cubical-compatible --safe #-}
8
9 open import Algebra.Core using (Op₁; Op₂)
10 open import Relation.Binary.Core using (Rel)
11
12 module Algebra.Apartness.Structures
13 {c ℓ₁ ℓ₂} {Carrier : Set c}
14 (_≈_ : Rel Carrier ℓ₁)
15 (_#_ : Rel Carrier ℓ₂)
16 (_+_ _*_ : Op₂ Carrier) (-_ : Op₁ Carrier) (0# 1# : Carrier)
17 where
18
19 open import Level using (_⊔_; suc)
20 open import Data.Product.Base using (∃-syntax; _×_; _,_; proj₂)
21 open import Algebra.Definitions _≈_ using (Invertible)
22 open import Algebra.Structures _≈_ using (IsCommutativeRing)
23 open import Relation.Binary.Structures using (IsEquivalence; IsApartnessRelation)
24 open import Relation.Binary.Definitions using (Tight)
25 open import Relation.Nullary.Negation using (¬_)
26 import Relation.Binary.Properties.ApartnessRelation as AR
27
28
29 record IsHeytingCommutativeRing : Set (c ⊔ ℓ₁ ⊔ ℓ₂) where
30
31 field
32 isCommutativeRing : IsCommutativeRing _+_ _*_ -_ 0# 1#
33 isApartnessRelation : IsApartnessRelation _≈_ _#_
34
35 open IsCommutativeRing isCommutativeRing public
36 open IsApartnessRelation isApartnessRelation public
37 renaming
38 ( irrefl to #-irrefl
39 ; sym to #-sym
40 ; cotrans to #-cotrans
41 )
42
43 field
44 #⇒invertible : ∀ {x y} → x # y → Invertible 1# _*_ (x - y)
45 invertible⇒# : ∀ {x y} → Invertible 1# _*_ (x - y) → x # y
46
47 ¬#-isEquivalence : IsEquivalence _¬#_
48 ¬#-isEquivalence = AR.¬#-isEquivalence refl isApartnessRelation
49
50
51 record IsHeytingField : Set (c ⊔ ℓ₁ ⊔ ℓ₂) where
52
53 field
54 isHeytingCommutativeRing : IsHeytingCommutativeRing
55 tight : Tight _≈_ _#_
56
57 open IsHeytingCommutativeRing isHeytingCommutativeRing public