Skip to content

Instantly share code, notes, and snippets.

@wilcoxjay
Created October 25, 2016 23:15
Show Gist options
  • Save wilcoxjay/e913b5f8533831ad963da0383f401a89 to your computer and use it in GitHub Desktop.
Save wilcoxjay/e913b5f8533831ad963da0383f401a89 to your computer and use it in GitHub Desktop.
Require Import PArith Omega.
Lemma unique_succ : forall a : positive, exists! b : nat, S b = Pos.to_nat a.
Proof.
induction a.
- destruct IHa as [b [Hb Hbunique]].
rewrite Pos2Nat.inj_xI.
eexists.
split; eauto.
intros. omega.
- destruct IHa as [b [Hb Hbunique]].
rewrite Pos2Nat.inj_xO.
rewrite <- Hb.
simpl.
eexists.
split; eauto.
intros. omega.
- exists 0. split; auto.
compute. intros. omega.
Qed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment