Beta
Making things complex for fun!
Description:
We have:
data Painfulℕ : Set where
pain : ∀ zero? → (zero? ≡ false → Painfulℕ) → Painfulℕ
The first parameter of a constructor pain
indicates whether current value is zero. The second parameter is a function which makes sure that current value is not zero and returns a predecessor of that value.
Your task is to write some operations on Painfulℕ
, and proofs that require functional extensionality(and UIP in Coq)!
In bonus, show bijection between natural numbers and their painful version.
Note: Preloaded is using custom definition of bijection:
record _⇔_ (A B : Set) : Set where
constructor Bijection
field
to : A → B
from : B → A
to∘from : ∀ x → to (from x) ≡ x
from∘to : ∀ x → from (to x) ≡ x
If you want to do it in your text editor, here's the version to copy-paste: OwO
Theorem Proving
Algorithms
Similar Kata:
Stats:
Created | Mar 16, 2020 |
Published | Mar 16, 2020 |
Warriors Trained | 30 |
Total Skips | 4 |
Total Code Submissions | 27 |
Total Times Completed | 6 |
Agda Completions | 6 |
Total Stars | 2 |
% of votes with a positive feedback rating | 90% of 5 |
Total "Very Satisfied" Votes | 4 |
Total "Somewhat Satisfied" Votes | 1 |
Total "Not Satisfied" Votes | 0 |
Total Rank Assessments | 5 |
Average Assessed Rank | 5 kyu |
Highest Assessed Rank | 4 kyu |
Lowest Assessed Rank | 7 kyu |