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_Tstruct: forall {cs: compspecs} t (v: reptype t) i a m v2 r, t = Tstruct i a -> m = co_members (get_co i) -> JMeq (@unfold_reptype cs t v) v2 -> r =struct_Prop m (fun it => value_fits (field_type (fst it) m)) v2 -> value_fits t v = r.