3data Parity : Nat -> Type where
5 odd : Parity (S (n + n))
7parity : (n:Nat) -> Parity n
9parity (S Z) = odd {n=Z}
10parity (S (S k)) with (parity k)
11 parity (S (S (j + j))) | even ?= even {n=S j}
12 parity (S (S (S (j + j)))) | odd ?= odd {n=S j}
14natToBin : Nat -> List Bool
16natToBin k with (parity k)
17 natToBin (j + j) | even = False :: natToBin j
18 natToBin (S (j + j)) | odd = True :: natToBin j
21---------- Proofs ----------
23views.parity_lemma_2 = proof {
26 rewrite sym (plusSuccRightSucc j j);
30views.parity_lemma_1 = proof {
33 rewrite sym (plusSuccRightSucc j j);
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list