Ltac solve_field_offset_type i m :=
  let H := fresh "H" in
  let Hty := fresh "H" in
  let Hofs := fresh "H" in
  let t := fresh "t" in
  let ofs := fresh "ofs" in
  pose proof field_offset_field_type_match cenv_cs i m;
  destruct (Ctypes.field_offset cenv_cs i m) as [ofs|?] eqn:Hofs, (Ctypes.field_type i m) as [t|?] eqn:Hty;
    [clear H | inversion H | inversion H | clear H].

(* Specifications: *)
Lemma complete_legal_cosu_member: forall (cenv : composite_env) (id : ident) (t : type) (m : list (ident * type)), In (id, t) m -> @composite_complete_legal_cosu_type cenv m = true -> @complete_legal_cosu_type cenv t = true.
Lemma complete_legal_cosu_type_field_type: forall id i, in_members i (co_members (get_co id)) -> complete_legal_cosu_type (field_type i (co_members (get_co id))) = true.
Lemma align_compatible_rec_Tstruct_inv': forall id a ofs, align_compatible_rec cenv_cs (Tstruct id a) ofs -> forall i, in_members i (co_members (get_co id)) -> align_compatible_rec cenv_cs (field_type i (co_members (get_co id))) (ofs + field_offset cenv_cs i (co_members (get_co id))).
Lemma align_compatible_rec_Tunion_inv': forall id a ofs, align_compatible_rec cenv_cs (Tunion id a) ofs -> forall i, in_members i (co_members (get_co id)) -> align_compatible_rec cenv_cs (field_type i (co_members (get_co id))) ofs.
Lemma field_offset_in_range: forall i m, in_members i m -> 0 <= field_offset cenv_cs i m /\ field_offset cenv_cs i m + sizeof (field_type i m) <= sizeof_struct cenv_cs 0 m.
Lemma sizeof_union_in_members: forall i m, in_members i m -> sizeof (field_type i m) <= sizeof_union cenv_cs m.
Lemma field_offset_no_overlap: forall i1 i2 m, i1 <> i2 -> in_members i1 m -> in_members i2 m -> field_offset cenv_cs i1 m + sizeof (field_type i1 m) <= field_offset cenv_cs i2 m \/ field_offset cenv_cs i2 m + sizeof (field_type i2 m) <= field_offset cenv_cs i1 m.
Lemma not_in_members_field_type: forall i m, ~ in_members i m -> field_type i m = Tvoid.
Lemma not_in_members_field_offset: forall i m, ~ in_members i m -> field_offset cenv_cs i m = 0.
Lemma field_offset_next_in_range: forall i m sz, in_members i m -> sizeof_struct cenv_cs 0 m <= sz -> field_offset cenv_cs i m + sizeof (field_type i m) <= field_offset_next cenv_cs i m sz <= sz.
Lemma Pos_eqb_eq: forall p q: positive, iff (eq (Pos.eqb p q) true) (eq p q).
Lemma id_in_list_true: forall i ids, id_in_list i ids = true -> In i ids.
Lemma id_in_list_false: forall i ids, id_in_list i ids = false -> ~In i ids.
Lemma members_no_replicate_ind: forall m, (members_no_replicate m = true) <-> match m with | nil => True | (i0, _) :: m0 => ~ in_members i0 m0 /\ members_no_replicate m0 = true end.
Lemma map_members_ext: forall A (f f':ident * type -> A) (m: members), members_no_replicate m = true -> (forall i, in_members i m -> f (i, field_type i m) = f' (i, field_type i m)) -> map f m = map f' m.
Lemma in_members_tail_no_replicate: forall i i0 t0 m, members_no_replicate ((i0, t0) :: m) = true -> in_members i m -> i <> i0.
Lemma neq_field_offset_rec_cons: forall env i i0 t0 m z, i <> i0 -> field_offset_rec env i ((i0, t0) :: m) z = field_offset_rec env i m (align z (alignof t0) + sizeof t0).
Lemma neq_field_offset_next_rec_cons: forall env i i0 t0 i1 t1 m z sz, i <> i0 -> field_offset_next_rec env i ((i0, t0) :: (i1, t1) :: m) z sz = field_offset_next_rec env i ((i1, t1) :: m) (align (z + sizeof t0) (alignof t1)) sz.
Lemma sizeof_struct_0: forall env i m, sizeof_struct env 0 m = 0 -> in_members i m -> sizeof (field_type i m) = 0 /\ field_offset_next env i m 0 - (field_offset env i m + sizeof (field_type i m)) = 0.
Lemma sizeof_union_0: forall env i m, sizeof_union env m = 0 -> in_members i m -> sizeof (field_type i m) = 0.