How define formally a user-defined binary operation?

52 Views Asked by At

Let $x \in \{0,1\}^{|\mathcal{S}|}$ and $k \in \{0,1\}^{|\mathcal{R}|}$, where their elements are indexed by the index sets $\mathcal{S}$ and $\mathcal{R}$ respectively. The index sets satisfy $\mathcal{R} \subset \mathcal{S}$. I would like to define, formally, a binary (elementwise) operation $f(x,k,\mathcal{R})$ such that, for any $j \in \mathcal{S}$, \begin{align} y(j) = \left\{ \begin{array}{ll} x(j) & \text{if } x \in \mathcal{R}, \\ x(j) \oplus k(j) & \text{otherwise.} \end{array} \right. \end{align}

Above, I have defined the binary operation for each index $j \in \mathcal{R}$, but I want to define formally the function that applies to the entire vector $x$.

Thank you.