(a) Uniqueness of representation.
A function $f\in\mathbf{B}_n$ is linear if it can be represented as
$$f(x_{1},\ldots, x_{n}) = a_{0} + a_{1}x_{1} +\cdots +a_{n}x_{n}$$
with $a_{0},\ldots, a_{n}\in\{0,1\}$. We need to show that this representation is unique. Note that
$f:\{0,1\}^n\to\{0,1\}$.
Each term $a_i x_i$ is either $0$ (if $a_i = 0$) or $x_i$ (if $a_i = 1$).
For any valuation of $x_1, \dots, x_n$, $f$ is determined completely by
$$a_0 + a_1 x_1 + \dots + a_n x_n$$
Now, suppose the contrary; there are two different representations:
$$f(x_1, \ldots, x_n) = a_0 + a_1 x_1 + \dots + a_n x_n$$
and
$$f(x_1, \ldots, x_n) = b_0 + b_1 x_1 + \dots + b_n x_n$$
Since both express the same function, they agree on all valuations of $(x_{1},\ldots, x_{n})\in\{0,1\}^{n}$. Taking their difference by XOR:
$$(a_0 + b_0) + (a_1 + b_1)x_1 + \dots + (a_n + b_n)x_n = 0$$
for all valustions of $x_1, \dots, x_n$.
Since the only Boolean function that is identically zero is the trivial function with all coefficients $0$, we conclude $a_i = b_i$ for all $i$.
More explicitly, step by step, we can see that as follows:
- Evaluate the expressions at $(x_{1},\ldots, x_{n})=(0,…,0)$ and get $a_{0}=b_{0}$.
- For some $k$, $1\leq k\leq n$, evaluate the expressions at $(x_{1},\ldots, x_{n})=(0,\ldots, 1,\ldots, 0)$ so that $x_{k}= 1$ and for all $j\neq k, x_{j}=0$ and get $a_{0}+a_{k}=a_{0}+b_{k}$, hence $a_{k}=b_{k}$.
(b) The total number of $n$-ary linear Boolean functions.
As we have seen, each function is uniquely determined by choosing values for $a_0,\ldots, a_n$, where each $a_i$ can be either $0$ or $1$.
- There are $n+1$ coefficients.
- Each coefficient has 2 choices.
Thus, the total number of $n$-ary linear Boolean functions is: $\quad2^{n+1}$
Compare this to how many semantically different Boolean functions are there for n Boolean variables?
(c) Every formula $\alpha$ in $\{\neg, +\}$ represents a linear function.
We need to show that any Boolean function representable using only negation and XOR is necessarily of the linear form:
$$a_{0} + a_1 x_1 + \dots + a_n x_n$$
We do this by structural induction.
Basis clause:
Inductive hypothesis:
- Suppose $\beta$ and and $\gamma$ are formulas that are represented by linear functions $f(x_1, \dots, x_n)$ and $g(x_1, \dots, x_n)$, respectively:
$$f = a_0 + a_1 x_1 + \dots + a_n x_n$$
$$g = b_0 + b_1 x_1 + \dots + b_n x_n$$
(i) The case of XOR
Suppose the formula $\alpha$ is of the form $\beta +\gamma$.
Since $f + g$ is computed modulo 2, we have:
$$f + g = (a_0 + b_0) + (a_1 + b_1) x_1 + \dots + (a_n + b_n) x_n$$
which is again a linear function.
(ii) The case of negation
Suppose $\alpha$ is of the form $\neg\beta$.
Since $\neg x = 1 + x$, negating any linear function just flips $a_0$, preserving the linear form.
Hence, each formula built from $\neg$ and $+$ represents a linear Boolean function.