Definition value_fits: forall t, reptype t -> Prop :=
  type_func (fun t => reptype t -> Prop)
    (fun t v =>
       if type_is_volatile t then True else tc_val' t (repinject t v))
    (fun t n a P v => Zlength (unfold_reptype v) =  Z.max 0 n /\ Forall P (unfold_reptype v))
    (fun id a P v => struct_value_fits_aux (co_members (get_co id)) (co_members (get_co id)) P (unfold_reptype v))
    (fun id a P v => union_value_fits_aux (co_members (get_co id)) (co_members (get_co id)) P (unfold_reptype v)).

Lemma value_fits_Tarray: forall {cs: compspecs} t (v: reptype t) t' n a (v' : list (reptype t')) r, t = (Tarray t' n a) -> JMeq (unfold_reptype v) v' -> n >= 0 -> r = (Zlength v' = n /\ Forall (value_fits t') v') -> value_fits t v =r.