Skip to content

minor additions to Decidable and Reflects #2055

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 59 commits into from
Closed
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
eac8e01
minor additions to `Decidable` and `Reflects`; plus tidied up depreca…
jamesmckinna Aug 13, 2023
7602d71
moved deprecation notice in `CHANGELOG`
jamesmckinna Aug 13, 2023
cdaee59
naming, plus tidying up `CHANGELOG`
jamesmckinna Aug 13, 2023
d2c5977
updated `README.Deisgn.Decidability` to use new defns; simplified imp…
jamesmckinna Aug 13, 2023
b48287f
simplified imports for `Data.Fin.Base\'
jamesmckinna Aug 13, 2023
4c16bf0
simplified imports for `Data.Fin.Properties\'
jamesmckinna Aug 13, 2023
3c23786
further simplified imports for `Data.Fin.Properties\'
jamesmckinna Aug 13, 2023
6cb1d0c
further simplified imports for `Data.Fin.Properties\'
jamesmckinna Aug 13, 2023
c99911e
simplified imports for `Data.Integer.*\'
jamesmckinna Aug 13, 2023
6450d77
simplified imports for `Data.List.*\'
jamesmckinna Aug 13, 2023
9729f53
further simplified imports for `Data.List.*\'; plus some previously u…
jamesmckinna Aug 14, 2023
f16b735
simplified imports for `Data.Maybe.*\'
jamesmckinna Aug 14, 2023
a2534c6
simplified imports for `Data.Nat.*\'
jamesmckinna Aug 14, 2023
ab5c40d
simplified imports for `Data.Product.*\'
jamesmckinna Aug 14, 2023
70ad7d2
simplified imports for `Data.Record.*\'
jamesmckinna Aug 14, 2023
2d1c6c1
simplified imports for `Data.Sign.*\'
jamesmckinna Aug 14, 2023
f6ff902
tweak use of `invert`
jamesmckinna Aug 14, 2023
fcd8cea
simplified imports for `Data.String.*\'
jamesmckinna Aug 14, 2023
5e73cf9
simplified imports for `Data.Sum.*\'
jamesmckinna Aug 14, 2023
d70bb88
simplified imports for `Data.These.*\'
jamesmckinna Aug 14, 2023
bfed6be
simplified imports for `Data.Tree.AVL.*\'
jamesmckinna Aug 14, 2023
cc7e62c
simplified imports for `Data.Vec.*\'
jamesmckinna Aug 14, 2023
b2a5ac8
simplified imports for `Data.Word.*\'
jamesmckinna Aug 14, 2023
060d2d7
simplified imports for `Effect.Monad.Partiality\'
jamesmckinna Aug 14, 2023
f621e5e
tweak use of `invert`
jamesmckinna Aug 14, 2023
741e437
simplified imports for `Relation.*ary.*\'
jamesmckinna Aug 14, 2023
72e5159
removed imports for `System.Clock`
jamesmckinna Aug 14, 2023
f0114fa
simplified imports for `tests.*\'
jamesmckinna Aug 14, 2023
bcaac54
simplified imports for `Tactic.*\'
jamesmckinna Aug 14, 2023
14a50e4
simplified imports for `Test.*\'
jamesmckinna Aug 14, 2023
332880f
simplified imports for `Text.Regex.*\'
jamesmckinna Aug 14, 2023
b86106c
simplified imports for `Reflection.AST.*\'
jamesmckinna Aug 14, 2023
ccfec83
simplified imports for `README.*\'
jamesmckinna Aug 14, 2023
a00863e
yet more simplified imports
jamesmckinna Aug 14, 2023
ddc927d
yet more simplified imports
jamesmckinna Aug 14, 2023
9db629f
yet more simplified imports
jamesmckinna Aug 14, 2023
34152d3
missed this first time around
jamesmckinna Aug 15, 2023
97f3c74
missed this first time around
jamesmckinna Aug 15, 2023
fdf4f79
further `import` simplification
jamesmckinna Aug 16, 2023
44d163b
further `import` simplification; made `True-↔` less strict
jamesmckinna Aug 16, 2023
246683c
further `import` simplification; made `True↔` less strict
jamesmckinna Aug 16, 2023
6de49ff
further `import` simplification
jamesmckinna Aug 16, 2023
165e61f
tightened `import`s
jamesmckinna Aug 17, 2023
5c5e3bc
another round of import tightening
jamesmckinna Aug 18, 2023
24296c8
`Data.Bool` import tightening
jamesmckinna Aug 18, 2023
c405c12
reverted to lazier `decToMaybe`
jamesmckinna Aug 18, 2023
d2e3ff9
reverted to lazier `filter⁺` and `derun⁺-aux`
jamesmckinna Aug 18, 2023
77c6969
partial reversion of `d2c59778b2554271f51e10b086848f3a8dc899f7`
jamesmckinna Aug 20, 2023
6b0dcce
partial reversion of `eac8e01ef822db9cf0591f179c6bd619b9a0fc34`: rena…
jamesmckinna Aug 20, 2023
94c01f6
partial reversion of `eac8e01ef822db9cf0591f179c6bd619b9a0fc34`: `CHA…
jamesmckinna Aug 20, 2023
15f0005
tweak `CHANGELOG`
jamesmckinna Aug 20, 2023
3458900
knock-on chnages; further simplified `import`s
jamesmckinna Aug 20, 2023
c4f3b1f
merge conflict resolution
jamesmckinna Aug 20, 2023
88e9e55
merge conflict resolution
jamesmckinna Aug 20, 2023
6d3b5f1
Merge branch 'master' into reflects
jamesmckinna Aug 20, 2023
e75543f
Merge branch 'master' into reflects
MatthewDaggitt Sep 27, 2023
124da89
updated to reflect recent changes to `master`
jamesmckinna Sep 28, 2023
cef8c21
updated to reflect recent changes to `master`
jamesmckinna Sep 28, 2023
f938d1b
updated to reflect recent changes to `master`
jamesmckinna Sep 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -682,6 +682,7 @@ Non-backwards compatible changes
- `¬-reflects` has been moved from `Relation.Nullary.Negation.Core` to `Relation.Nullary.Reflects`.
- `decidable-stable`, `excluded-middle` and `¬-drop-Dec` have been moved from `Relation.Nullary.Negation`
to `Relation.Nullary.Decidable`.
- `excluded-middle` has been deprecated in favour of `¬¬-excluded-middle`
- `fromDec` and `toDec` have been moved from `Data.Sum.Base` to `Data.Sum`.

### Refactoring of the unindexed Functor/Applicative/Monad hierarchy
@@ -958,9 +959,6 @@ Non-backwards compatible changes
lookup : All P xs → (∀ {x} → x ∈ₚ xs → P x)
lookupₛ : P Respects _≈_ → All P xs → (∀ {x} → x ∈ xs → P x)
```
* `excluded-middle` in `Relation.Nullary.Decidable.Core` has been renamed to
`¬¬-excluded-middle`.

Major improvements
------------------

@@ -1542,6 +1540,11 @@ Deprecated names
invPreorder ↦ converse-preorder
```

* In `Relation.Nullary.Decidable.Core`:
```
excluded-middle` ↦ `¬¬-excluded-middle`
```

### Renamed Data.Erased to Data.Irrelevant

* This fixes the fact we had picked the wrong name originally. The erased modality
@@ -2406,8 +2409,8 @@ Additions to existing modules
_!≢0 : NonZero (n !)
_!*_!≢0 : NonZero (m ! * n !)

anyUpTo? : ∀ (P? : U.Decidable P) (v : ℕ) → Dec (∃ λ n → n < v × P n)
allUpTo? : ∀ (P? : U.Decidable P) (v : ℕ) → Dec (∀ {n} → n < v → P n)
anyUpTo? : ∀ (P? : Decidable P) (v : ℕ) → Dec (∃ λ n → n < v × P n)
allUpTo? : ∀ (P? : Decidable P) (v : ℕ) → Dec (∀ {n} → n < v → P n)

n≤1⇒n≡0∨n≡1 : n ≤ 1 → n ≡ 0 ⊎ n ≡ 1

@@ -2921,6 +2924,16 @@ Additions to existing modules
subst₂-removable : subst₂ _∼_ eq₁ eq₂ p ≅ p
```

* Added new constructor for `Relation.Nullary.Decidable`
```
T? : ∀ b → Dec (T b)
```

* Added new constructor for `Relation.Nullary.Reflects`
```
T⁺ : ∀ b → Reflects (T b) b
```

* Added new definitions in `Relation.Unary`:
```
_≐_ : Pred A ℓ₁ → Pred A ℓ₂ → Set _
2 changes: 1 addition & 1 deletion README/Axiom.agda
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ private variable ℓ : Level
-- The types for which `P` or `¬P` holds is called `Dec P` in the
-- standard library (short for `Decidable`).

open import Relation.Nullary.Decidable using (Dec)
open import Relation.Nullary.Decidable.Core using (Dec)

-- The type of the proof of saying that excluded middle holds for
-- all types at universe level ℓ is therefore:
2 changes: 1 addition & 1 deletion README/Data/Trie/NonDependent.agda
Original file line number Diff line number Diff line change
@@ -64,7 +64,7 @@ open import Data.These as These
open import Function.Base using (case_of_; _$_; _∘′_; id; _on_)
open import Relation.Nary
open import Relation.Binary.Core using (Rel)
open import Relation.Nullary.Decidable using (¬?)
open import Relation.Nullary.Decidable.Core using (¬?)

open import Data.Trie Char.<-strictTotalOrder
open import Data.Tree.AVL.Value
4 changes: 2 additions & 2 deletions README/Design/Decidability.agda
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@

module README.Design.Decidability where

open import Data.Bool
open import Data.Bool.Base
open import Data.List.Base using (List; []; _∷_)
open import Data.List.Properties using (∷-injective)
open import Data.Nat
@@ -43,7 +43,7 @@ ex₂ true = ofʸ tt
------------------------------------------------------------------------
-- Dec

open import Relation.Nullary.Decidable
open import Relation.Nullary.Decidable.Core

-- A proof of `Dec P` is a proof of `Reflects P b` for some `b`.
-- `Dec P` is declared as a record, with fields:
2 changes: 1 addition & 1 deletion README/Foreign/Haskell.agda
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ open import Data.List.Base as List using (List; _∷_; []; takeWhile; dropWhile)
open import Data.Maybe.Base using (Maybe; just; nothing)
open import Data.Product.Base using (_×_; _,_)
open import Function
open import Relation.Nullary.Decidable
open import Relation.Nullary.Decidable.Core using (¬?)

import Foreign.Haskell as FFI
open import Foreign.Haskell.Coerce
3 changes: 1 addition & 2 deletions README/Text/Regex.agda
Original file line number Diff line number Diff line change
@@ -12,8 +12,7 @@ open import Data.Bool using (true; false)
open import Data.List.Base using (_∷_; [])
open import Data.String
open import Function.Base using () renaming (_$′_ to _$_)
open import Relation.Nullary.Decidable using (yes)
open import Relation.Nullary.Decidable using (True; False; from-yes)
open import Relation.Nullary.Decidable.Core using (yes; True; False; from-yes)

-- Our library available via the Text.Regex module is safe but it works on
-- lists of characters.
4 changes: 2 additions & 2 deletions src/Algebra/Construct/LexProduct/Inner.agda
Original file line number Diff line number Diff line change
@@ -12,8 +12,8 @@ open import Data.Product.Base using (_×_; _,_; swap; map; uncurry′)
open import Function.Base using (_∘_)
open import Level using (Level; _⊔_)
open import Relation.Binary.Definitions using (Decidable)
open import Relation.Nullary.Decidable using (does; yes; no)
open import Relation.Nullary.Negation
open import Relation.Nullary.Decidable.Core using (does; yes; no)
open import Relation.Nullary.Negation.Core
using (contradiction; contradiction₂)
import Relation.Binary.Reasoning.Setoid as SetoidReasoning

4 changes: 2 additions & 2 deletions src/Algebra/Properties/CancellativeCommutativeSemiring.agda
Original file line number Diff line number Diff line change
@@ -10,8 +10,8 @@ open import Algebra using (CancellativeCommutativeSemiring)
open import Algebra.Definitions using (AlmostRightCancellative)
open import Data.Sum.Base using (_⊎_; inj₁; inj₂)
open import Relation.Binary.Definitions using (Decidable)
open import Relation.Nullary.Decidable using (yes; no)
open import Relation.Nullary.Negation using (contradiction)
open import Relation.Nullary.Decidable.Core using (yes; no)
open import Relation.Nullary.Negation.Core using (contradiction)

module Algebra.Properties.CancellativeCommutativeSemiring
{a ℓ} (R : CancellativeCommutativeSemiring a ℓ)
2 changes: 1 addition & 1 deletion src/Algebra/Solver/CommutativeMonoid.agda
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ import Relation.Nullary.Decidable as Dec
import Data.Vec.Relation.Binary.Pointwise.Inductive as Pointwise

open import Relation.Binary.PropositionalEquality.Core as P using (_≡_)
open import Relation.Nullary.Decidable using (Dec)
open import Relation.Nullary.Decidable.Core using (Dec)

open CommutativeMonoid M
open EqReasoning setoid
2 changes: 1 addition & 1 deletion src/Algebra/Solver/IdempotentCommutativeMonoid.agda
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ import Relation.Nullary.Decidable as Dec
import Data.Vec.Relation.Binary.Pointwise.Inductive as Pointwise

open import Relation.Binary.PropositionalEquality as P using (_≡_; decSetoid)
open import Relation.Nullary.Decidable using (Dec)
open import Relation.Nullary.Decidable.Core using (Dec)

module Algebra.Solver.IdempotentCommutativeMonoid
{m₁ m₂} (M : IdempotentCommutativeMonoid m₁ m₂) where
5 changes: 2 additions & 3 deletions src/Algebra/Solver/Monoid.agda
Original file line number Diff line number Diff line change
@@ -24,8 +24,7 @@ open import Relation.Binary.Definitions using (Decidable)

open import Relation.Binary.PropositionalEquality.Core as P using (_≡_)
import Relation.Binary.Reflection
open import Relation.Nullary
import Relation.Nullary.Decidable as Dec
open import Relation.Nullary.Decidable.Core using (map′)

open Monoid M
open import Relation.Binary.Reasoning.Setoid setoid
@@ -115,7 +114,7 @@ open module R = Relation.Binary.Reflection
infix 5 _≟_

_≟_ : ∀ {n} → Decidable {A = Normal n} _≡_
nf₁ ≟ nf₂ = Dec.map′ ≋⇒≡ ≡⇒≋ (nf₁ ≋? nf₂)
nf₁ ≟ nf₂ = map′ ≋⇒≡ ≡⇒≋ (nf₁ ≋? nf₂)
where open ListEq Fin._≟_

-- We can also give a sound, but not necessarily complete, procedure
2 changes: 1 addition & 1 deletion src/Algebra/Solver/Ring.agda
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ open import Algebra.Morphism
open _-Raw-AlmostCommutative⟶_ morphism renaming (⟦_⟧ to ⟦_⟧′)
open import Algebra.Properties.Semiring.Exp semiring

open import Relation.Nullary.Decidable using (yes; no)
open import Relation.Nullary.Decidable.Core using (yes; no)
open import Relation.Binary.Reasoning.Setoid setoid
import Relation.Binary.PropositionalEquality.Core as PropEq
import Relation.Binary.Reflection as Reflection
2 changes: 1 addition & 1 deletion src/Axiom/DoubleNegationElimination.agda
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ open import Axiom.ExcludedMiddle
open import Level
open import Relation.Nullary
open import Relation.Nullary.Negation
open import Relation.Nullary.Decidable
open import Relation.Nullary.Decidable.Core

------------------------------------------------------------------------
-- Definition
3 changes: 1 addition & 2 deletions src/Codata/Musical/Colist.agda
Original file line number Diff line number Diff line change
@@ -35,9 +35,8 @@ import Relation.Binary.Reasoning.Preorder as PreR
import Relation.Binary.Reasoning.PartialOrder as POR
open import Relation.Binary.PropositionalEquality as P using (_≡_)
open import Relation.Nullary.Reflects using (invert)
open import Relation.Nullary
open import Relation.Nullary.Negation
open import Relation.Nullary.Decidable using (¬¬-excluded-middle)
open import Relation.Nullary.Decidable.Core using (Dec; _because_; ¬¬-excluded-middle)
open import Relation.Unary using (Pred)

private
2 changes: 1 addition & 1 deletion src/Codata/Sized/Cofin/Literals.agda
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ open import Agda.Builtin.FromNat
open import Codata.Sized.Conat
open import Codata.Sized.Conat.Properties
open import Codata.Sized.Cofin
open import Relation.Nullary.Decidable
open import Relation.Nullary.Decidable.Core using (True; toWitness)

number : ∀ n → Number (Cofin n)
number n = record
2 changes: 1 addition & 1 deletion src/Codata/Sized/Conat/Properties.agda
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ open import Codata.Sized.Conat
open import Codata.Sized.Conat.Bisimilarity
open import Function.Base using (_∋_)
open import Relation.Nullary
open import Relation.Nullary.Decidable using (map′)
open import Relation.Nullary.Decidable.Core using (map′)
open import Relation.Binary.Definitions using (Decidable)

private
3 changes: 0 additions & 3 deletions src/Data/Bool.agda
Original file line number Diff line number Diff line change
@@ -8,9 +8,6 @@

module Data.Bool where

open import Relation.Nullary
open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl)

------------------------------------------------------------------------
-- The boolean type and some operations

7 changes: 2 additions & 5 deletions src/Data/Bool/Properties.agda
Original file line number Diff line number Diff line change
@@ -28,8 +28,7 @@ open import Relation.Binary.Definitions
using (Decidable; Reflexive; Transitive; Antisymmetric; Minimum; Maximum; Total; Irrelevant; Irreflexive; Asymmetric; Trans; Trichotomous; tri≈; tri<; tri>; _Respects₂_)
open import Relation.Binary.PropositionalEquality.Core
open import Relation.Binary.PropositionalEquality.Properties
open import Relation.Nullary.Reflects using (ofʸ; ofⁿ)
open import Relation.Nullary.Decidable.Core using (True; does; proof; yes; no)
open import Relation.Nullary.Decidable.Core as Dec using (True; yes; no)
import Relation.Unary as U

open import Algebra.Definitions {A = Bool} _≡_
@@ -759,9 +758,7 @@ T-irrelevant : U.Irrelevant T
T-irrelevant {true} _ _ = refl

T? : U.Decidable T
does (T? b) = b
proof (T? true ) = ofʸ _
proof (T? false) = ofⁿ λ()
T? = Dec.T?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm inclining towards reverting this, in favour of

T? b = b because (T⁺ b)

in order to decouple this change (and the need to reinstate the import of Relation.Nullary.Reflects) from any future possible refactoring/dependency simplification of Data.Bool.Properties?


T?-diag : ∀ b → T b → True (T? b)
T?-diag true _ = _
2 changes: 1 addition & 1 deletion src/Data/Char/Properties.agda
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ open import Data.Product.Base using (_,_)

open import Function.Base
open import Relation.Nullary using (¬_; yes; no)
open import Relation.Nullary.Decidable using (map′; isYes)
open import Relation.Nullary.Decidable.Core using (map′; isYes)
open import Relation.Binary.Core using (_⇒_)
open import Relation.Binary.Bundles
using (Setoid; DecSetoid; StrictPartialOrder; StrictTotalOrder; Preorder; Poset; DecPoset)
2 changes: 1 addition & 1 deletion src/Data/Digit.agda
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ open import Data.Product.Base using (∃; _,_)
open import Data.Vec.Base as Vec using (Vec; _∷_; [])
open import Data.Nat.DivMod
open import Data.Nat.Induction
open import Relation.Nullary.Decidable using (True; does; toWitness)
open import Relation.Nullary.Decidable.Core using (True; does; toWitness)
open import Relation.Binary.Definitions using (Decidable)
open import Relation.Binary.PropositionalEquality.Core as P using (_≡_; refl)
open import Function.Base using (_$_)
2 changes: 1 addition & 1 deletion src/Data/Digit/Properties.agda
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ open import Data.Product.Base using (_,_; proj₁)
open import Data.Vec.Relation.Unary.Unique.Propositional using (Unique)
import Data.Vec.Relation.Unary.Unique.Propositional.Properties as Uniqueₚ
open import Data.Vec.Relation.Unary.AllPairs using (allPairs?)
open import Relation.Nullary.Decidable using (True; from-yes; ¬?)
open import Relation.Nullary.Decidable.Core using (True; from-yes; ¬?)
open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl)
open import Function.Base using (_∘_)

3 changes: 1 addition & 2 deletions src/Data/Fin/Base.agda
Original file line number Diff line number Diff line change
@@ -17,11 +17,10 @@ open import Data.Product.Base as Product using (_×_; _,_; proj₁; proj₂)
open import Data.Sum.Base as Sum using (_⊎_; inj₁; inj₂; [_,_]′)
open import Function.Base using (id; _∘_; _on_; flip)
open import Level using (0ℓ)
open import Relation.Nullary.Negation.Core using (contradiction)
open import Relation.Nullary.Decidable.Core using (yes; no; True; toWitness)
open import Relation.Binary.Core
open import Relation.Binary.PropositionalEquality.Core using (_≡_; _≢_; refl; cong)
open import Relation.Binary.Indexed.Heterogeneous.Core using (IRel)
open import Relation.Nullary.Negation.Core using (contradiction)

private
variable
4 changes: 2 additions & 2 deletions src/Data/Fin/Induction.agda
Original file line number Diff line number Diff line change
@@ -31,8 +31,8 @@ import Relation.Binary.Construct.NonStrictToStrict as ToStrict
import Relation.Binary.Construct.On as On
open import Relation.Binary.Definitions using (Tri; tri<; tri≈; tri>)
open import Relation.Binary.PropositionalEquality
open import Relation.Nullary.Decidable using (yes; no)
open import Relation.Nullary.Negation using (contradiction)
open import Relation.Nullary.Decidable.Core using (yes; no)
open import Relation.Nullary.Negation.Core using (contradiction)
open import Relation.Unary using (Pred)

module Data.Fin.Induction where
6 changes: 3 additions & 3 deletions src/Data/Fin/Literals.agda
Original file line number Diff line number Diff line change
@@ -9,12 +9,12 @@
module Data.Fin.Literals where

open import Agda.Builtin.FromNat
open import Data.Nat using (suc; _≤?_)
open import Data.Nat using (_<?_)
open import Data.Fin using (Fin ; #_)
open import Relation.Nullary.Decidable using (True)
open import Relation.Nullary.Decidable.Core using (True)

number : ∀ n → Number (Fin n)
number n = record
{ Constraint = λ m → True (suc m ≤? n)
{ Constraint = λ m → True (m <? n)
; fromNat = λ m {{pr}} → (# m) {n} {pr}
}
13 changes: 7 additions & 6 deletions src/Data/Fin/Properties.agda
Original file line number Diff line number Diff line change
@@ -43,10 +43,11 @@ open import Relation.Binary.Structures
using (IsDecEquivalence; IsPreorder; IsPartialOrder; IsTotalOrder; IsDecTotalOrder; IsStrictPartialOrder; IsStrictTotalOrder)
open import Relation.Binary.PropositionalEquality as P
using (_≡_; _≢_; refl; sym; trans; cong; cong₂; subst; _≗_; module ≡-Reasoning)
open import Relation.Nullary
using (Reflects; ofʸ; ofⁿ; Dec; _because_; does; proof; yes; no; ¬_; _×-dec_; _⊎-dec_; contradiction)
open import Relation.Nullary.Reflects
open import Relation.Nullary.Decidable as Dec using (map′)
open import Relation.Nullary.Decidable.Core
using (Dec; _because_; does; yes; no; _×-dec_; _⊎-dec_; map′)
open import Relation.Nullary.Decidable using (via-injection)
open import Relation.Nullary.Negation.Core using (¬_; contradiction)
open import Relation.Nullary.Reflects using (invert)
open import Relation.Unary as U
using (U; Pred; Decidable; _⊆_; Satisfiable; Universal)
open import Relation.Unary.Properties using (U?)
@@ -952,7 +953,7 @@ decFinSubset {suc n} {P = P} {Q} Q? P?

any? : ∀ {p} {P : Pred (Fin n) p} → Decidable P → Dec (∃ P)
any? {zero} {P = _} P? = no λ { (() , _) }
any? {suc n} {P = P} P? = Dec.map ⊎⇔∃ (P? zero ⊎-dec any? (P? ∘ suc))
any? {suc n} {P = P} P? = map′ [ ∃-here , ∃-there ] ∃-toSum (P? zero ⊎-dec any? (P? ∘ suc))

all? : ∀ {p} {P : Pred (Fin n) p} → Decidable P → Dec (∀ f → P f)
all? P? = map′ (λ ∀p f → ∀p tt) (λ ∀p {x} _ → ∀p x)
@@ -1052,7 +1053,7 @@ module _ {ℓ} {S : Setoid a ℓ} (inj : Injection S (≡-setoid n)) where
open Setoid S

inj⇒≟ : B.Decidable _≈_
inj⇒≟ = Dec.via-injection inj _≟_
inj⇒≟ = via-injection inj _≟_

inj⇒decSetoid : DecSetoid a ℓ
inj⇒decSetoid = record
3 changes: 1 addition & 2 deletions src/Data/Fin/Show.agda
Original file line number Diff line number Diff line change
@@ -14,8 +14,7 @@ open import Data.Nat as ℕ using (ℕ; _≤?_; _<?_)
import Data.Nat.Show as ℕ using (show; readMaybe)
open import Data.String.Base using (String)
open import Function.Base
open import Relation.Nullary.Decidable using (yes; no)
open import Relation.Nullary.Decidable using (True)
open import Relation.Nullary.Decidable.Core using (yes; no; True)

show : ∀ {n} → Fin n → String
show = ℕ.show ∘′ toℕ
Loading