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

Stats:

CreatedMar 16, 2020
PublishedMar 16, 2020
Warriors Trained30
Total Skips4
Total Code Submissions27
Total Times Completed6
Agda Completions6
Total Stars2
% of votes with a positive feedback rating90% of 5
Total "Very Satisfied" Votes4
Total "Somewhat Satisfied" Votes1
Total "Not Satisfied" Votes0
Total Rank Assessments5
Average Assessed Rank
5 kyu
Highest Assessed Rank
4 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • bredor Avatar
Ad