Section FIB.
Variable R : BSRS.
Definition obstring n :=
option (bstring n).
Notation obcast H := (Some (bcast H)).
Definition ccons n b (s : obstring n) : obstring n :=
match s with
| Some (exist _ s _) => match (le_dec (|b::s|) n) with
| left H => obcast H
| right _ => None
end
| None => None
end.
Definition cdrv n (s t : obstring n) :=
match s, t with
| Some (exist _ s _), Some (exist _ t _) => derivable R s t
| _, _ => False
end.
Definition sub n (x y : obstring n) :=
match x, y with
| Some (exist _ s _), Some (exist _ t _) => s <> t /\ exists s', t = s'++s
| _, _ => False
end.
Global Instance FIB n : interp (obstring n).
Definition obembed n (s : obstring n) : obstring (S n) :=
match s with
| Some (exist _ s H) => Some (exist _ s (le_S _ _ H))
| None => None
end.

Lemma drv_cdrv s t :
derivable R s t <-> @cdrv (max (|s|) (|t|)) (ienc s) (ienc t).