Nonlinearity of Boolean functions

Studies of Boolean functions

The nonlinearity of a Boolean function measures how far it is from being a linear Boolean function.
It is the smallest Hamming distance of its truth table to that of a linear.
As an integer it is a soft property (i.e. dependent on arity). But it can be easily defined as a fraction, which is a hard property.

arity ,     soft nonlinearity ,     hard nonlinearity

Let . The highest nonlinearity for arity is .
A Boolean function with nonlinearity is a bent function. They exist when is an integer, i.e. for even .

The finite sequences A207676 and A207328 show the nonlinearities for arities 3 and 4. (The indices encode the truth tables.)

For a given arity the nonlinearity is an integer. They are the column indices of the following number triangle.

But the columns make more sense, when the nonlinearity is defined as a fraction:

arity nonlinearity total
1 4 4
2 8 8 16
3 16 128 112 256
4 32 512 3840 17920 28000 14336 896 65536
5 64 2048 31744 317440 2301440 12888064 57996288 215414784 647666880 1362452480 1412100096 556408832 27387136 4294967296
6 128 8192 258048 5332992 81328128 975937536 9596719104 79515672576 566549167104 3525194817536 19388571496448 95180260073472 420379481991168 1681517927964672 6125529594728448 20418431982428160 62526600834171264 176395152249028608 458313050588725248 1087405010755682304 2291582136636334080 4011570131804454912 5097726702198767616 3821934098435833856 1305039828998603264 103868560519987200 1617838297055232 347227553792 5425430528 18446744073709551616

nonlinearity

Zhegalkin deviation

The terminology used here is likely to be changed again.

Each BF can be assigned a Zhegalkin index – a unique integer, independent of arity.
Its binary exponents shall be called Zhegalkin exponents. For Walsh functions they are only powers of two (see here). For negated Walsh functions also 0.
Here is a way to define a different kind of Hamming distance from linears:
The Zhegalkin exponents of the BF are split into those that are 0 or powers of two, and those that are not.
So one BF is split in two BF, which shall be called its Zhegalkin linear and deviation.
The Zhegalkin weight of the deviation (the number of Zhegalkin exponents that are not 0 or powers of two) is also a degree, to which the BF is not linear.

Zhegalkin linear (reverse prefect)      Z.l. signed weight (reverse prefect signed weight)

Zhegalkin deviation (twin prefect)      Z.d. faction (twin prefect signed weight)      Z.d. weight      Z.d. patron      Z.d. is odious

reverse and twin prefect signed weight