@@ -19,7 +19,7 @@ open import Level using (Level)
19
19
open import Relation.Binary.Core using (Rel)
20
20
open import Relation.Binary.Construct.Closure.Transitive
21
21
open import Relation.Binary.PropositionalEquality.Core
22
- open import Relation.Nullary.Negation.Core using (¬_)
22
+ open import Relation.Nullary.Negation.Core as Negation using (¬_)
23
23
open import Relation.Unary using (Pred; _∩_; _⇒_; Universal; IUniversal)
24
24
25
25
private
@@ -99,43 +99,43 @@ module InfiniteDescent (_<_ : Rel A r) (P : Pred A ℓ) where
99
99
100
100
module _ {_<_ : Rel A r} (P : Pred A ℓ) where
101
101
102
- open InfiniteDescent _<_ P public
102
+ open InfiniteDescent _<_ P public
103
103
104
- module Corollaries (descent : Acc⇒Descent) where
104
+ module Corollaries (descent : Acc⇒Descent) where
105
105
106
- private
106
+ private
107
107
108
- P∩Acc : Pred A _
109
- P∩Acc = P ∩ (Acc _<_)
108
+ P∩Acc : Pred A _
109
+ P∩Acc = P ∩ (Acc _<_)
110
110
111
- module ID∩ = InfiniteDescent _<_ P∩Acc
111
+ module ID∩ = InfiniteDescent _<_ P∩Acc
112
112
113
- descent∩ : ID∩.Descent
114
- descent∩ (px , acc[x]) =
115
- let y , y<x , py = descent acc[x] px
116
- in y , y<x , py , acc-inverse acc[x] y<x
113
+ descent∩ : ID∩.Descent
114
+ descent∩ (px , acc[x]) =
115
+ let y , y<x , py = descent acc[x] px
116
+ in y , y<x , py , acc-inverse acc[x] y<x
117
117
118
- module Lemmas∩ = ID∩.Lemmas descent∩
118
+ module Lemmas∩ = ID∩.Lemmas descent∩
119
119
120
- acc⇒infiniteDescent : Acc⇒InfiniteDescent
121
- acc⇒infiniteDescent acc[x] px =
122
- let f , Π[[P∩Acc]∘f] , sequence[f] = Lemmas∩.acc⇒infiniteDescent acc[x] (px , acc[x])
123
- in f , proj₁ ∘ Π[[P∩Acc]∘f] , sequence[f]
120
+ acc⇒infiniteDescent : Acc⇒InfiniteDescent
121
+ acc⇒infiniteDescent acc[x] px =
122
+ let f , Π[[P∩Acc]∘f] , sequence[f] = Lemmas∩.acc⇒infiniteDescent acc[x] (px , acc[x])
123
+ in f , proj₁ ∘ Π[[P∩Acc]∘f] , sequence[f]
124
124
125
- wf⇒infiniteDescent : WellFounded _<_ → InfiniteDescent
126
- wf⇒infiniteDescent wf = acc⇒infiniteDescent (wf _)
125
+ wf⇒infiniteDescent : WellFounded _<_ → InfiniteDescent
126
+ wf⇒infiniteDescent wf = acc⇒infiniteDescent (wf _)
127
127
128
- acc⇒noInfiniteDescent : ∀[ Acc _<_ ⇒ ¬_ ∘ P ]
129
- acc⇒noInfiniteDescent acc[x] px = Lemmas∩.acc⇒noInfiniteDescent acc[x] (px , acc[x])
128
+ acc⇒noInfiniteDescent : ∀[ Acc _<_ ⇒ ¬_ ∘ P ]
129
+ acc⇒noInfiniteDescent acc[x] px = Lemmas∩.acc⇒noInfiniteDescent acc[x] (px , acc[x])
130
130
131
- wf⇒noInfiniteDescent : WellFounded _<_ → ∀[ ¬_ ∘ P ]
132
- wf⇒noInfiniteDescent wf = acc⇒noInfiniteDescent (wf _)
131
+ wf⇒noInfiniteDescent : WellFounded _<_ → ∀[ ¬_ ∘ P ]
132
+ wf⇒noInfiniteDescent wf = acc⇒noInfiniteDescent (wf _)
133
133
134
134
135
135
------------------------------------------------------------------------
136
136
-- Further corollaries: assume _<⁺_ descent only for Acc _<⁺_ elements
137
137
138
- module _ {_<_ : Rel A r} (P : Pred A ℓ) where
138
+ module FurtherCorollaries {_<_ : Rel A r} (P : Pred A ℓ) where
139
139
140
140
private
141
141
@@ -196,7 +196,32 @@ module _ {_<_ : Rel A r} (P : Pred A ℓ) where
196
196
wf⇒noInfiniteDescent⁺ = Corollaries⁺.wf⇒noInfiniteDescent ∘ (wellFounded _)
197
197
198
198
199
+ ------------------------------------------------------------------------
200
+ -- Finally: the (classical) 'no smallest counterexample' principle itself
201
+
202
+ -- these belong in Relation.Unary
203
+
204
+ CounterExample : Pred A ℓ → Pred A ℓ
205
+ CounterExample P = ¬_ ∘ P
206
+
207
+ Stable : Pred A ℓ → Set _
208
+ Stable P = ∀ {x} → Negation.Stable (P x)
209
+
210
+ module _ {_<_ : Rel A r} {P : Pred A ℓ} (stable : Stable P) where
211
+
212
+ open FurtherCorollaries {_<_ = _<_} (CounterExample P)
213
+ using (acc⇒noInfiniteDescent⁺; wf⇒noInfiniteDescent⁺)
214
+ renaming (Acc⇒Descent⁺ to NoSmallestCounterExample)
215
+
216
+ acc⇒noSmallestCounterExample : NoSmallestCounterExample → ∀[ Acc _<_ ⇒ P ]
217
+ acc⇒noSmallestCounterExample noSmallest = stable ∘ (acc⇒noInfiniteDescent⁺ noSmallest)
218
+
219
+ wf⇒noSmallestCounterExample : WellFounded _<_ → NoSmallestCounterExample → ∀[ P ]
220
+ wf⇒noSmallestCounterExample wf noSmallest = stable (wf⇒noInfiniteDescent⁺ noSmallest wf)
221
+
199
222
------------------------------------------------------------------------
200
223
-- Exports
201
224
202
225
open Corollaries public
226
+ open FurtherCorollaries public
227
+
0 commit comments