File tree Expand file tree Collapse file tree 5 files changed +17
-7
lines changed
Data/List/Relation/Unary/First Expand file tree Collapse file tree 5 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -77,3 +77,8 @@ Additions to existing modules
77
77
≟-≢ : (m≢n : m ≢ n) → (m ≟ n) ≡ no m≢n
78
78
∸-suc : m ≤ n → suc n ∸ m ≡ suc (n ∸ m)
79
79
```
80
+
81
+ * In ` Relation.Nullary.Negation.Core `
82
+ ``` agda
83
+ ¬¬-η : A → ¬ ¬ A
84
+ ```
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ import Data.Sum.Base as Sum
18
18
open import Function.Base using (_∘′_; _∘_; id)
19
19
open import Relation.Binary.PropositionalEquality.Core as ≡ using (_≡_; refl; _≗_)
20
20
open import Relation.Nullary.Decidable.Core as Dec
21
- open import Relation.Nullary.Negation.Core using (contradiction)
21
+ open import Relation.Nullary.Negation.Core using (¬¬-η; contradiction)
22
22
open import Relation.Nullary.Reflects using (invert)
23
23
open import Relation.Unary using (Pred; _⊆_; ∁; Irrelevant; Decidable)
24
24
@@ -54,7 +54,7 @@ module _ {a p q} {A : Set a} {P : Pred A p} {Q : Pred A q} where
54
54
module _ {a p q} {A : Set a} {P : Pred A p} {Q : Pred A q} where
55
55
56
56
All⇒¬First : P ⊆ ∁ Q → All P ⊆ ∁ (First P Q)
57
- All⇒¬First p⇒¬q (px ∷ pxs) [ qx ] = contradiction qx ( p⇒¬q px)
57
+ All⇒¬First p⇒¬q (px ∷ pxs) [ qx ] = p⇒¬q px qx
58
58
All⇒¬First p⇒¬q (_ ∷ pxs) (_ ∷ hf) = All⇒¬First p⇒¬q pxs hf
59
59
60
60
First⇒¬All : Q ⊆ ∁ P → First P Q ⊆ ∁ (All P)
@@ -97,7 +97,7 @@ module _ {a p} {A : Set a} {P : Pred A p} where
97
97
98
98
first? : Decidable P → Decidable (First P (∁ P))
99
99
first? P? = Dec.fromSum
100
- ∘ Sum.map₂ (All⇒¬First contradiction )
100
+ ∘ Sum.map₂ (All⇒¬First ¬¬-η )
101
101
∘ first (Dec.toSum ∘ P?)
102
102
103
103
cofirst? : Decidable P → Decidable (First (∁ P) P)
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ open import Relation.Nullary.Recomputable.Core as Recomputable
28
28
open import Relation.Nullary.Reflects as Reflects
29
29
hiding (recompute; recompute-constant)
30
30
open import Relation.Nullary.Negation.Core
31
- using (¬_; Stable; negated-stable; contradiction; DoubleNegation)
31
+ using (¬_; ¬¬-η; Stable; negated-stable; contradiction; DoubleNegation)
32
32
33
33
34
34
private
@@ -215,7 +215,7 @@ decidable-stable (true because [a]) ¬¬a = invert [a]
215
215
decidable-stable (false because [¬a]) ¬¬a = contradiction (invert [¬a]) ¬¬a
216
216
217
217
¬-drop-Dec : Dec (¬ ¬ A) → Dec (¬ A)
218
- ¬-drop-Dec ¬¬a? = map′ negated-stable contradiction (¬? ¬¬a?)
218
+ ¬-drop-Dec ¬¬a? = map′ negated-stable ¬¬-η (¬? ¬¬a?)
219
219
220
220
-- A double-negation-translated variant of excluded middle (or: every
221
221
-- nullary relation is decidable in the double-negation monad).
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ open import Relation.Nullary.Negation.Core public
56
56
¬¬-Monad : RawMonad {a} DoubleNegation
57
57
¬¬-Monad = mkRawMonad
58
58
DoubleNegation
59
- contradiction
59
+ ¬¬-η
60
60
(λ x f → negated-stable (¬¬-map f x))
61
61
62
62
¬¬-push : DoubleNegation Π[ P ] → Π[ DoubleNegation ∘ P ]
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ open import Level using (Level; _⊔_)
15
15
16
16
private
17
17
variable
18
- a p q w : Level
18
+ a w : Level
19
19
A B C : Set a
20
20
Whatever : Set w
21
21
@@ -33,6 +33,11 @@ infix 3 ¬_
33
33
DoubleNegation : Set a → Set a
34
34
DoubleNegation A = ¬ ¬ A
35
35
36
+ -- Eta law for double-negation
37
+
38
+ ¬¬-η : A → ¬ ¬ A
39
+ ¬¬-η a ¬a = ¬a a
40
+
36
41
-- Stability under double-negation.
37
42
Stable : Set a → Set a
38
43
Stable A = ¬ ¬ A → A
You can’t perform that action at this time.
0 commit comments