-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Decidable Setoid -> Apartness Relation and Rational Heyting Field (#2194
) * new stuff * forgot to add bundles for rational instance of Heyting* * one more (obvious) simplification * a few more simplifications * comments on DecSetoid properties from jamesmckinna * not working, but partially there * woo! * fix anonymous instance * fix errant whitespace * `fix-whitespace` * rectified wrt `contradiction` * rectified `DecSetoid` properties * rectified `Group` properties * inlined lemma; tidied up --------- Co-authored-by: jamesmckinna <[email protected]> Co-authored-by: James McKinna <[email protected]>
- Loading branch information
1 parent
c5255d0
commit bfd7a7b
Showing
5 changed files
with
139 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
------------------------------------------------------------------------ | ||
-- The Agda standard library | ||
-- | ||
-- Every decidable setoid induces tight apartness relation. | ||
------------------------------------------------------------------------ | ||
|
||
{-# OPTIONS --cubical-compatible --safe #-} | ||
|
||
open import Relation.Binary.Bundles using (DecSetoid; ApartnessRelation) | ||
|
||
module Relation.Binary.Properties.DecSetoid {c ℓ} (S : DecSetoid c ℓ) where | ||
|
||
open import Data.Product using (_,_) | ||
open import Data.Sum using (inj₁; inj₂) | ||
open import Relation.Binary.Definitions | ||
using (Cotransitive; Tight) | ||
import Relation.Binary.Properties.Setoid as SetoidProperties | ||
open import Relation.Binary.Structures | ||
using (IsApartnessRelation; IsDecEquivalence) | ||
open import Relation.Nullary.Decidable.Core | ||
using (yes; no; decidable-stable) | ||
|
||
open DecSetoid S using (_≈_; _≉_; _≟_; setoid; trans) | ||
open SetoidProperties setoid | ||
|
||
≉-cotrans : Cotransitive _≉_ | ||
≉-cotrans {x} {y} x≉y z with x ≟ z | z ≟ y | ||
... | _ | no z≉y = inj₂ z≉y | ||
... | no x≉z | _ = inj₁ x≉z | ||
... | yes x≈z | yes z≈y = inj₁ λ _ → x≉y (trans x≈z z≈y) | ||
|
||
≉-isApartnessRelation : IsApartnessRelation _≈_ _≉_ | ||
≉-isApartnessRelation = record | ||
{ irrefl = ≉-irrefl | ||
; sym = ≉-sym | ||
; cotrans = ≉-cotrans | ||
} | ||
|
||
≉-apartnessRelation : ApartnessRelation c ℓ ℓ | ||
≉-apartnessRelation = record { isApartnessRelation = ≉-isApartnessRelation } | ||
|
||
≉-tight : Tight _≈_ _≉_ | ||
≉-tight x y = decidable-stable (x ≟ y) , ≉-irrefl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters