Definition rightI (d:nat)(x:TypeI) : nat :=
 match x with
 | I _ n => n
 | E _ => d
 end.

(* Specifications: *)
Lemma inf_list_maxl_r : forall l n s, inf_list l = I n s -> s = maxl (map (rightI 0) l).
Lemma in_inf_list_le_l l n s n' s' : In (I n' s') l -> inf_list l = I n s -> n' <= n.
Lemma in_inf_list_le_r l n s n' s' : In (I n' s') l -> inf_list l = I n s -> s' <= s.
Lemma in_inf_list_le l n s n' s' : In (I n' s') l -> inf_list l = I n s -> n' <= n /\ s' <= s.
Lemma in_inf_list_err : forall l err, In (E err) l -> exists err', inf_list l = E err'.
Lemma in_inf_list_err_conv : forall l err, inf_list l = E err -> exists err', In (E err') l.
Lemma inf_list_ex : forall l e n s, In e l -> inf_list (map inf l) = I n s -> exists n', exists s', n' <= n /\ s' <= s /\ inf e = I n' s'.
Lemma inf_correct : forall (e : BCI) n s n' s', n' <= n -> s' <= s -> inf e = I n' s' -> arities (conv n s e) = ok_arities n s.
Lemma conv_correct : forall (e : BCI) (vnl vsl : list bs) n s n' s', n' <= n -> s' <= s -> inf e = I n' s' -> sem (conv n s e) vnl vsl = semI e vnl vsl.