Advertisement
Guest User

countable.v

a guest
Apr 18th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 0.37 KB | None | 0 0
  1. Global Instance BoundedNCountable {bound : N} : Countable (BoundedN bound).
  2. Proof.
  3.   refine {| encode n := encode (to_N n);
  4.             decode n := of_N =<< decode n; |}.
  5.   intros [x lt].
  6.   rewrite decode_encode.
  7.   simpl.
  8.   unfold of_N.
  9.   destruct (BoundedN.N_lt_dec x bound).
  10.   - assert (lt = l) by (apply UIP_dec; decide equality).
  11.     congruence.
  12.   - tauto.
  13. Defined.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement