Skip to content

Commit fb8480b

Browse files
committed
refactoring; move Stable to Relation.Unary
1 parent 17cc4b4 commit fb8480b

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3213,6 +3213,7 @@ Additions to existing modules
32133213
_≐_ : Pred A ℓ₁ → Pred A ℓ₂ → Set _
32143214
_≐′_ : Pred A ℓ₁ → Pred A ℓ₂ → Set _
32153215
_∖_ : Pred A ℓ₁ → Pred A ℓ₂ → Pred A _
3216+
Stable : Pred A ℓ → Set _
32163217
```
32173218

32183219
* Added new proofs in `Relation.Unary.Properties`:

src/Induction/NoInfiniteDescent.agda

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ open import Relation.Binary.Core using (Rel)
2020
open import Relation.Binary.Construct.Closure.Transitive
2121
open import Relation.Binary.PropositionalEquality.Core
2222
open import Relation.Nullary.Negation.Core as Negation using (¬_)
23-
open import Relation.Unary using (Pred; _∩_; _⇒_; Universal; IUniversal)
23+
open import Relation.Unary using (Pred; _∩_; _⇒_; Universal; IUniversal; Stable)
2424

2525
private
2626
variable
@@ -204,20 +204,17 @@ module FurtherCorollaries {_<_ : Rel A r} (P : Pred A ℓ) where
204204
CounterExample : Pred A ℓ Pred A ℓ
205205
CounterExample P = ¬_ ∘ P
206206

207-
Stable : Pred A ℓ Set _
208-
Stable P = {x} Negation.Stable (P x)
209-
210207
module _ {_<_ : Rel A r} {P : Pred A ℓ} (stable : Stable P) where
211208

212209
open FurtherCorollaries {_<_ = _<_} (CounterExample P)
213210
using (acc⇒noInfiniteDescent⁺; wf⇒noInfiniteDescent⁺)
214211
renaming (Acc⇒Descent⁺ to NoSmallestCounterExample)
215212

216213
acc⇒noSmallestCounterExample : NoSmallestCounterExample ∀[ Acc _<_ ⇒ P ]
217-
acc⇒noSmallestCounterExample noSmallest = stable ∘ (acc⇒noInfiniteDescent⁺ noSmallest)
214+
acc⇒noSmallestCounterExample noSmallest = stable _ ∘ acc⇒noInfiniteDescent⁺ noSmallest
218215

219216
wf⇒noSmallestCounterExample : WellFounded _<_ NoSmallestCounterExample ∀[ P ]
220-
wf⇒noSmallestCounterExample wf noSmallest = stable (wf⇒noInfiniteDescent⁺ noSmallest wf)
217+
wf⇒noSmallestCounterExample wf noSmallest = stable _ (wf⇒noInfiniteDescent⁺ noSmallest wf)
221218

222219
------------------------------------------------------------------------
223220
-- Exports

src/Relation/Unary.agda

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ open import Data.Sum.Base using (_⊎_; [_,_])
1515
open import Function.Base using (_∘_; _|>_)
1616
open import Level using (Level; _⊔_; 0ℓ; suc; Lift)
1717
open import Relation.Nullary.Decidable.Core using (Dec; True)
18-
open import Relation.Nullary.Negation.Core using (¬_)
18+
open import Relation.Nullary.Negation.Core as Negation using (¬_)
1919
open import Relation.Binary.PropositionalEquality.Core using (_≡_)
2020

2121
private
@@ -162,6 +162,11 @@ IUniversal P = ∀ {x} → x ∈ P
162162

163163
syntax IUniversal P = ∀[ P ]
164164

165+
-- Stability - instances of P are stable wrt double negation
166+
167+
Stable : Pred A ℓ Set _
168+
Stable P = x Negation.Stable (P x)
169+
165170
-- Decidability - it is possible to determine if an arbitrary element
166171
-- satisfies P.
167172

0 commit comments

Comments
 (0)