Algebraic Normal Form of Boolean Functions Explained
This article provides a clear overview of the Algebraic Normal Form (ANF) of Boolean functions, detailing how it represents logical operations through polynomial equations in the binary system. You will learn the mathematical foundation of ANF, how truth values are mapped to the binary field \(\mathbb{F}_2\) (or GF(2)), the rules for converting standard logic operations into algebraic terms, and the practical significance of this canonical representation in modern computing and cryptography.
What is Algebraic Normal Form (ANF)?
Algebraic Normal Form (ANF), also known as the Zhegalkin polynomial, is a canonical way of expressing any Boolean function as a polynomial over the two-element Galois field, denoted as \(\text{GF}(2)\) or \(\mathbb{F}_2\).
In standard Boolean logic, functions are typically expressed using combinations of AND (\(\land\)), OR (\(\lor\)), and NOT (\(\neg\)) operators. In contrast, ANF expresses functions exclusively using two fundamental operations: 1. Addition modulo 2 (equivalent to the logical XOR operation, denoted as \(\oplus\)). 2. Multiplication (equivalent to the logical AND operation, denoted as \(\cdot\) or simple concatenation).
Because the representation is canonical, every Boolean function corresponds to one and only one unique ANF polynomial.
Expressing Truth Values in the Binary System
ANF operates strictly within the binary number system by mapping standard Boolean truth values to elements of \(\text{GF}(2)\):
- False is represented by the binary integer \(0\).
- True is represented by the binary integer \(1\).
The Arithmetic Operations
- Addition (\(\oplus\)):
Modulo-2 Addition (XOR)
- \(0 \oplus 0 = 0\)
- \(0 \oplus 1 = 1\)
- \(1 \oplus 0 = 1\)
- \(1 \oplus 1 = 0\)
- Multiplication (\(\cdot\)):
Standard Binary Multiplication (AND)
- \(0 \cdot 0 = 0\)
- \(0 \cdot 1 = 0\)
- \(1 \cdot 0 = 0\)
- \(1 \cdot 1 = 1\)
- Additive Inversion (NOT) The logical NOT of a variable \(x\) is expressed algebraically as adding \(1\): \[\neg x = 1 \oplus x\]
Because \(x \cdot x = x\) (idempotence) and \(x \oplus x = 0\) in binary field arithmetic, no variable in an ANF expression ever has an exponent greater than \(1\), and identical terms cancel each other out.
Mathematical Structure of ANF
For a Boolean function with \(n\) variables, \(f(x_1, x_2, \dots, x_n)\), the ANF is written as the XOR sum of all possible product terms (monomials):
\[f(x_1, \dots, x_n) = a_0 \oplus \bigoplus_{1 \le i \le n} a_i x_i \oplus \bigoplus_{1 \le i < j \le n} a_{ij} x_i x_j \oplus \dots \oplus a_{12\dots n} x_1 x_2 \dots x_n\]
Where: * \(a_0, a_i, a_{ij}, \dots \in \{0, 1\}\) are binary coefficients. * \(a_0\) is the constant term (\(f(0, 0, \dots, 0)\)). * Linear terms have single variables (\(x_i\)). * Higher-order terms represent the conjunction (AND) of multiple variables (\(x_i x_j\)).
There are \(2^n\) possible coefficients, matching the total number of entries in a truth table for \(n\) variables.
Example: Converting Standard Logic to ANF
Consider the standard inclusive OR function: \(f(x, y) = x \lor y\).
Using De Morgan’s Laws and binary arithmetic: 1. \(x \lor y = \neg(\neg x \land \neg y)\) 2. Replace \(\neg z\) with \((1 \oplus z)\) and \(\land\) with multiplication: \[f(x, y) = 1 \oplus ((1 \oplus x)(1 \oplus y))\] 3. Expand the product: \[f(x, y) = 1 \oplus (1 \oplus y \oplus x \oplus xy)\] 4. Simplify using modulo-2 rules (\(1 \oplus 1 = 0\)): \[f(x, y) = x \oplus y \oplus xy\]
This final expression, \(x \oplus y \oplus xy\), is the unique Algebraic Normal Form for the OR operation.
Key Properties and Significance
- Algebraic Degree: The degree of the polynomial corresponds to the size of the largest product term with a coefficient of \(1\). For example, the degree of \(x \oplus y \oplus xy\) is \(2\).
- Affine and Linear Functions: Functions with an algebraic degree of at most \(1\) are classified as affine (or linear if the constant term \(a_0 = 0\)).
- Cryptography: ANF is widely used to analyze the security of symmetric ciphers and hash functions. A high algebraic degree is essential to protect block ciphers and stream ciphers against algebraic and higher-order differential cryptanalysis.
- Circuit Simplification: In digital circuit design, ANF forms the foundation of Reed-Muller logic networks, offering compact implementations for arithmetic-heavy logical systems.