Ltac headptr_field_compatible :=
  match goal with H: headptr ?P |- field_compatible _ _ ?P =>
  apply headptr_field_compatible;
        [ apply H | reflexivity | | simpl; computable | apply la_env_cs_sound; reflexivity];
    apply compute_legal_nested_field_spec';
    simpl_compute_legal_nested_field;
    repeat apply Forall_cons; try apply Forall_nil
  end.

Lemma array_at_data_at1 {cs} : forall sh t gfs lo hi v p, lo <= hi -> field_compatible0 t (gfs SUB lo) p -> field_compatible0 t (gfs SUB hi) p -> @array_at cs sh t gfs lo hi v p = at_offset (@data_at cs sh (nested_field_array_type t gfs lo hi) v) (nested_field_offset t (ArraySubsc lo :: gfs)) p.