Opaque bs2nat.
Opaque Cond.
Definition False_e n :=
Comp n (Succ false) [Zero_e n].
Opaque Zero_e One_e False_e Rev_e RemoveLSZ_e.
Definition Normalize_e : Cobham :=
Comp 1 Rev_e [Comp 1 RemoveLSZ_e [Rev_e]].
Opaque Normalize_e.
(** Def 1 of (Rose) *)
Definition Succ_e : Cobham :=
Rec
(Comp 0 (Succ true) [Zero])
(Comp 2 (Succ true) [Proj 2 0])
(Comp 2 (Succ false) [Proj 2 1])
(Comp 1 (Succ true) [Proj 1 0]).
Opaque Succ_e.
(** Def 2 of (Rose) *)
Definition Pred'_e : Cobham :=
Rec
Zero
(Comp 2 (Succ true) [Proj 2 1])
(Comp 2 (Succ false) [Proj 2 0])
(Proj 1 0).
Opaque Pred'_e.
Definition Pred_e : Cobham :=
Comp 1 Pred'_e [Normalize_e].
Opaque Pred_e.
(** Def 3 of (Rose) *)
Definition OneMinus'_e : Cobham :=
Rec2
(One_e 0)
(Zero_e 2)
(One_e 1).

Lemma OneMinus'_correct : forall l,
hd nil l = nil \/ bs2nat (hd nil l) <> 0 ->
bs2nat (Sem OneMinus'_e l) = 1 - bs2nat (hd nil l).