-
Notifications
You must be signed in to change notification settings - Fork 260
An alternative to #1698 #1709
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
An alternative to #1698 #1709
Changes from 26 commits
e0ebddd
f2c61dd
df98374
1346dec
9685a22
b3f17cc
fc58d5f
22dbe04
d51832a
3c967b5
c473b13
8982eaa
d67e49d
7af3b40
5027911
8c19672
aeda1e1
d43f92d
57b6767
ec2ad2c
ccbb62d
d646078
eb15a97
3fa38f9
9ac3c64
97a332b
2c31273
bb714ec
e66974c
4c3cf29
c7aa491
7c1f530
c40cba0
3322f4a
9824893
3f9f635
70bc731
96a9506
390890a
a43f52d
811fd05
e7a3f58
cec361d
3e48ede
a47e6ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,12 +9,13 @@ | |
| module Data.Nat.Induction where | ||
|
|
||
| open import Function | ||
| open import Data.Nat.Base | ||
| open import Data.Nat.Properties using (≤⇒≤′; n<1+n) | ||
| open import Data.Nat.Base using (ℕ; zero; suc; _<_; _<′_; n<′1+n; <′-step) | ||
| open import Data.Nat.Properties using (m<1+n⇒m<n∨m≡n) | ||
| open import Data.Product | ||
| open import Data.Sum using (inj₁; inj₂) | ||
| open import Data.Unit.Polymorphic | ||
| open import Induction | ||
| open import Induction.WellFounded as WF | ||
| open import Induction.WellFounded as WF using (WellFounded; WfRec) | ||
| open import Level using (Level) | ||
| open import Relation.Binary.PropositionalEquality | ||
| open import Relation.Unary | ||
|
|
@@ -69,8 +70,8 @@ mutual | |
| <′-wellFounded n = acc (<′-wellFounded′ n) | ||
|
|
||
| <′-wellFounded′ : ∀ n → <′-Rec (Acc _<′_) n | ||
| <′-wellFounded′ (suc n) .n ≤′-refl = <′-wellFounded n | ||
| <′-wellFounded′ (suc n) m (≤′-step m<n) = <′-wellFounded′ n m m<n | ||
| <′-wellFounded′ (suc n) .n n<′1+n = <′-wellFounded n | ||
MatthewDaggitt marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| <′-wellFounded′ (suc n) m (<′-step m<n) = <′-wellFounded′ n m m<n | ||
|
|
||
| module _ {ℓ} where | ||
| open WF.All <′-wellFounded ℓ public | ||
|
|
@@ -85,8 +86,16 @@ module _ {ℓ} where | |
| <-Rec : ∀ {ℓ} → RecStruct ℕ ℓ ℓ | ||
| <-Rec = WfRec _<_ | ||
|
|
||
| <-wellFounded : WellFounded _<_ | ||
| <-wellFounded = Subrelation.wellFounded ≤⇒≤′ <′-wellFounded | ||
| mutual | ||
|
|
||
| <-wellFounded : WellFounded _<_ | ||
| <-wellFounded n = acc (<-wellFounded′ n) | ||
|
|
||
| <-wellFounded′ : ∀ n → <-Rec (Acc _<_) n | ||
| <-wellFounded′ zero y () | ||
| <-wellFounded′ (suc n) y y<1+n with <-wellFounded n | m<1+n⇒m<n∨m≡n y<1+n | ||
| ... | wfn@(acc rec) | inj₁ y<n = rec y y<n | ||
|
||
| ... | wfn | inj₂ refl = wfn | ||
|
|
||
| -- A version of `<-wellFounded` that cheats by skipping building | ||
| -- the first billion proofs. Use this when you require the function | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.