Section COMPOSITE_ENV.
Context {cs: compspecs}.
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].
(* field_offset2_in_range union's version *)
Definition in_map: forall {A B : Type} (f : A -> B) (l : list A) (x : A),
In x l -> In (f x) (map f l) :=
fun (A B : Type) (f : A -> B) (l : list A) =>
list_ind (fun l0 : list A => forall x : A, In x l0 -> In (f x) (map f l0))
(fun (x : A) (H : In x nil) => H)
(fun (a : A) (l0 : list A)
(IHl : forall x : A, In x l0 -> In (f x) (map f l0)) (x : A)
(H : In x (a :: l0)) =>
or_ind
(fun H0 : a = x =>
or_introl (eq_ind_r (fun a0 : A => f a0 = f x) eq_refl H0))
(fun H0 : In x l0 =>
or_intror
((fun H1 : In x l0 -> In (f x) (map f l0) =>
(fun H2 : In (f x) (map f l0) => H2) (H1 H0)) (IHl x))) H) l.

Lemma field_offset_next_change_composite {cs_from cs_to} {CCE: change_composite_env cs_from cs_to}: forall id i,
match (coeq cs_from cs_to) ! id with
| Some b => test_aux cs_from cs_to b id
| None => false
end = true ->
field_offset_next (@cenv_cs cs_from) i (co_members (get_co id)) (co_sizeof (@get_co cs_from id)) =
field_offset_next (@cenv_cs cs_to) i (co_members (get_co id)) (co_sizeof (@get_co cs_to id)).