Fixpoint convI (e : BC) : BCI :=
match e with
| zero => zeroI
| proj n s i =>
if leb (S i) n then projIn i else projIs (i - n)
| succ b => succI b
| pred => predI
| cond => condI
| rec g h0 h1 => recI (convI g) (convI h0) (convI h1)
| comp n s g ln ls =>
compI (convI g) (map convI ln) (map convI ls)
end.
Opaque maxl.

(* Specifications: *)
Lemma convI_inf_correct : forall (e : BC) n s,
arities e = ok_arities n s ->
exists n', exists s',
n' <= n /\ s' <= s /\ inf (convI e) = I n' s'.
Lemma convI_correct : forall e n s,
arities e = ok_arities n s ->
forall vnl vsl,
semI (convI e) vnl vsl = sem e vnl vsl.