Skip to content

Commit 77a4e32

Browse files
committed
response to review comments
1 parent d8f1e47 commit 77a4e32

File tree

4 files changed

+28
-19
lines changed

4 files changed

+28
-19
lines changed

CHANGELOG.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -407,14 +407,19 @@ Additions to existing modules
407407
WeaklyDecidable : Set _
408408
```
409409

410+
* Added new proof in `Relation.Nullary.Decidable`:
411+
```agda
412+
⌊⌋-map′ : (a? : Dec A) → ⌊ map′ t f a? ⌋ ≡ ⌊ a? ⌋
413+
```
414+
410415
* Added new definitions in `Relation.Nullary.Negation.Core`:
411416
```agda
412-
weak-contradiction : .A → ¬ A → Whatever
417+
contradiction-irr : .A → ¬ A → Whatever
413418
```
414419

415-
* Added new proof in `Relation.Nullary.Decidable`:
420+
* Added new definitions in `Relation.Nullary.Reflects`:
416421
```agda
417-
⌊⌋-map′ : (a? : Dec A) → ⌊ map′ t f a? ⌋ ≡ ⌊ a? ⌋
422+
recompute : Reflects A b → Recomputable A
418423
```
419424

420425
* Added new definitions in `Relation.Unary`

src/Relation/Nullary/Negation/Core.agda

+8-8
Original file line numberDiff line numberDiff line change
@@ -47,26 +47,26 @@ _¬-⊎_ = [_,_]
4747
------------------------------------------------------------------------
4848
-- Uses of negation
4949

50-
weak-contradiction : .A ¬ A Whatever
51-
weak-contradiction a ¬a = ⊥-elim-irr (¬a a)
50+
contradiction-irr : .A ¬ A Whatever
51+
contradiction-irr a ¬a = ⊥-elim-irr (¬a a)
5252

5353
contradiction : A ¬ A Whatever
54-
contradiction a = weak-contradiction a
54+
contradiction a = contradiction-irr a
5555

5656
contradiction₂ : A ⊎ B ¬ A ¬ B Whatever
57-
contradiction₂ (inj₁ a) ¬a ¬b = weak-contradiction a ¬a
58-
contradiction₂ (inj₂ b) ¬a ¬b = weak-contradiction b ¬b
57+
contradiction₂ (inj₁ a) ¬a ¬b = contradiction a ¬a
58+
contradiction₂ (inj₂ b) ¬a ¬b = contradiction b ¬b
5959

6060
contraposition : (A B) ¬ B ¬ A
61-
contraposition f ¬b a = weak-contradiction (f a) ¬b
61+
contraposition f ¬b a = contradiction (f a) ¬b
6262

6363
-- Everything is stable in the double-negation monad.
6464
stable : ¬ ¬ Stable A
65-
stable ¬[¬¬a→a] = ¬[¬¬a→a] (weak-contradiction (¬[¬¬a→a] ∘ const))
65+
stable ¬[¬¬a→a] = ¬[¬¬a→a] (contradiction (¬[¬¬a→a] ∘ const))
6666

6767
-- Negated predicates are stable.
6868
negated-stable : Stable (¬ A)
69-
negated-stable ¬¬¬a a = ¬¬¬a (weak-contradiction a)
69+
negated-stable ¬¬¬a a = ¬¬¬a (contradiction a)
7070

7171
¬¬-map : (A B) ¬ ¬ A ¬ ¬ B
7272
¬¬-map f = contraposition (contraposition f)

src/Relation/Nullary/Recomputable.agda

+6-3
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,19 @@ private
2121

2222
------------------------------------------------------------------------
2323
-- Definition
24+
--
25+
-- The idea of being 'recomputable' is that, given an *irrelevant* proof
26+
-- of a proposition `A` (signalled by being a value of type `.A`, all of
27+
-- whose inhabitants are identified up to definitional equality, and hence
28+
-- do *not* admit pattern-matching), one may 'promote' such a value to a
29+
-- 'genuine' value of `A`, available for subsequent eg. pattern-matching.
2430

2531
Recomputable : (A : Set a) Set a
2632
Recomputable A = .A A
2733

2834
------------------------------------------------------------------------
2935
-- Constructions
3036

31-
------------------------------------------------------------------------
32-
-- Recomputable types are Harrop
33-
3437
⊥-recompute : Recomputable ⊥
3538
⊥-recompute ()
3639

src/Relation/Nullary/Reflects.agda

+6-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ open import Data.Sum.Base using (_⊎_; inj₁; inj₂)
1515
open import Data.Product.Base using (_×_; _,_; proj₁; proj₂)
1616
open import Level using (Level)
1717
open import Function.Base using (_$_; _∘_; const; id)
18-
open import Relation.Nullary.Negation.Core using (¬_; weak-contradiction; _¬-⊎_)
18+
open import Relation.Nullary.Negation.Core
19+
using (¬_; contradiction-irr; contradiction; _¬-⊎_)
1920
open import Relation.Nullary.Recomputable using (Recomputable)
2021

2122
private
@@ -58,7 +59,7 @@ invert (ofⁿ ¬a) = ¬a
5859

5960
recompute : {b} Reflects A b Recomputable A
6061
recompute (ofʸ a) _ = a
61-
recompute (ofⁿ ¬a) a = weak-contradiction a ¬a
62+
recompute (ofⁿ ¬a) a = contradiction-irr a ¬a
6263

6364
------------------------------------------------------------------------
6465
-- Interaction with negation, product, sums etc.
@@ -92,7 +93,7 @@ _→-reflects_ : ∀ {a b} → Reflects A a → Reflects B b →
9293
Reflects (A B) (not a ∨ b)
9394
ofʸ a →-reflects ofʸ b = of (const b)
9495
ofʸ a →-reflects ofⁿ ¬b = of (¬b ∘ (_$ a))
95-
ofⁿ ¬a →-reflects _ = of (λ a weak-contradiction a ¬a)
96+
ofⁿ ¬a →-reflects _ = of (λ a contradiction a ¬a)
9697

9798
------------------------------------------------------------------------
9899
-- Other lemmas
@@ -104,8 +105,8 @@ fromEquivalence {b = false} sound complete = of complete
104105
-- `Reflects` is deterministic.
105106
det : {b b′} Reflects A b Reflects A b′ b ≡ b′
106107
det (ofʸ a) (ofʸ _) = refl
107-
det (ofʸ a) (ofⁿ ¬a) = weak-contradiction a ¬a
108-
det (ofⁿ ¬a) (ofʸ a) = weak-contradiction a ¬a
108+
det (ofʸ a) (ofⁿ ¬a) = contradiction a ¬a
109+
det (ofⁿ ¬a) (ofʸ a) = contradiction a ¬a
109110
det (ofⁿ ¬a) (ofⁿ _) = refl
110111

111112
T-reflects-elim : {a b} Reflects (T a) b b ≡ a

0 commit comments

Comments
 (0)