# 4-ary Boolean functions

Venn diagram of the Boolean function
0000 0001 0001 0110

There are ${\displaystyle 2^{2^{4}}}$ = 65536 4-ary Boolean functions, which correspond to 16-bit binary strings.

## Big equivalence classes (bec)

Compare: Big equivalence classes of 3-ary Boolean functions

When binarily colored tesseracts can be transformed into each other by actions in the tesseract's symmetry group C4, they are essentially the same.
The corresponding Boolean functions are often called equivalent and belong to the same big equivalence class (bec).
The 65536 functions belong to 1 + 1 + 4 + 6 + 19 + 27 + 50 + 56 + 74 + 56 + 50 + 27 + 19 + 6 + 4 + 1 + 1 = 402 becs.

The following sortable table (in the collapsed box) shows the 402 becs with some key features.
The default order is that of the numbers in column N. Sorting by # sorts also by N.
The numbers in column weight are the hamming weights of the functions, i.e. the number of ones in the binary strings.
Column sec tells the number of secs in the bec. Column f tells the number of functions in the bec.
The function with the smallest numerical value is shown in column F as an example. It's numerical value is shown in column N.
becs with an entry in column sona are related to subgroups of nimber addition.
The entry in column wec denotes the Walsh equivalence class the bec belongs to.
The nonlinearity of all functions in the bec is shown in column nonlin.
Functions with nonlinearity 0 are linear, those with nonlinearity 6 are bent.
To sort by more than one column you can hold the shift-key and than click the other sort buttons. *

32768 = 215

2048 = 211
8192 = 213
12288 = 212 * 3
8192 = 213
2048 = 211

## Ring count vectors (rcv)

A step back:
The 16 2-ary Boolean functions correspond to the subsets of the nested set or hereditarily finite set V3 = P3({}) = { {} , {{}} , {{{}}} , {{},{{}}} }.
That is hard to read, so the nested sets are represented by nested rings of different size.

In the same way every 4-ary Boolean function corresponds to a subset of V4 = P4({}):

This set corresponds to the tautology. The cardinality of the subsets of V4 corresponds to the weight of the functions, in this case 16. Without the outer ring there are four different sizes of rings in these graphics. By counting also the smaller rings the concept of weight can be refined, which leads to a 4-place ring count vector (rcv) for every 4-ary Boolean function. For the tautology it is (16,32,32,16)>.

For the next function the rcv is (8,16,16,8)>:

The vectors are not always so regular. For the next function it is (7,10,8,4)>:

Every set of 4-ary Boolean functions has a 5-place rcv where the first digit is the set's cardinality. E.g. the set that contains only the above-mentioned function has the rcv (1>,7,10,8,4>).

Sets of functions that are of some interest are equivalence classes. The last four digits in the rcvs of equivalence classes usually have the pattern n,2n,2n,n>.

In the ggbec table above only the first digits are shown, because the rcvs have the pattern n>,8n,16n,16n,8n>. This is also true for the wec table, because a wec is a union of many ggbecs.

## Hamming weight 8

There are ${\displaystyle {\tbinom {16}{8}}}$ = 12870 balanced 4-ary Boolean functions (with 8 ones in their binary string).

They belong to 74 becs, which are linked in the following table:

10 11 12 13 14 15 16
${\displaystyle {\tfrac {384}{1}}=384}$

0T

08 0T 08 08

0T 04 088 088

042 08 08

04

${\displaystyle {\tfrac {384}{2}}=192}$

0T

0T3 0TT 088

0T2 088 0TT

043 088 088 0TT

0T2 0T 088

0T1 041 088

${\displaystyle {\tfrac {384}{4}}=96}$

088 01823

044 044 044 03823 02822 01812 02813

03812

${\displaystyle {\tfrac {384}{6}}=64}$

0S4

0S4

0T1 043 0T3

041

${\displaystyle {\tfrac {384}{8}}=48}$

088 02833 02S24

02811

${\displaystyle {\tfrac {384}{12}}=32}$

01S34

03S14

04013

${\displaystyle {\tfrac {384}{16}}=24}$

04022

${\displaystyle {\tfrac {384}{32}}=12}$

0 11 22 33 4 0 11 2222 33

${\displaystyle {\tfrac {384}{48}}=8}$

0 111 222 3 S 1 222 333 4

0 1 222 333 S 111 222 3 4

${\displaystyle {\tfrac {384}{192}}=2}$

0 222222 4 0 1111 3333

The numbers 0, 4, 8, T (twelve) and S (sixteen) tell the number of dots in the last line of the small matrices.
The subscripts on the left side tell the rank of the lines without dots in the small matrices.
(The top row with rank 0 is always without dots, so the 0 is always there.)
The subscripts on the right side tell the rank of the lines full of dots.

The rank of a line is the number of negated arguments.
(Compare big matrices, where the arguments are shown. The top line of a matrix has rank 0, the last line has rank 4.)

The dots in the big matrices show the bits that differ from the top line in the whole bec (the whole file).
The dots in the small matrices show the bits that differ from the top line in the sec (the actual matrix).

Big equivalence classes that are complements (and thus form a gbecs) are linked next to each other.
Links are bold when the bec contains self complementary secs with 16 elements.

## Bent functions

There are 896 4-ary Bent functions,
which belong to four different greater big equivalence classes (gbecs).

Their nonlinearity is ${\displaystyle 2^{4-1}-2^{{\frac {4}{2}}-1}=8-2=6}$ and their Hamming weight is ${\displaystyle 2^{4-1}\pm 2^{{\frac {4}{2}}-1}=8\pm 2}$ .

Only the functions with Hamming weight 6 are shown. Those with Hamming weight 10 are their complements.

 Belongs to a bec with 16 functions The simplest exampleof a 4-ary bent function:${\displaystyle x_{1}\land x_{2}~~\oplus ~~x_{3}\land x_{4}}$Belongs to a bec with 3*16 functions Belongs to a bec with 12*16 functions Belongs to a bec with 12*16 functions

It's worth taking a look at the distribution of dots in the small matrices in the bec files.
They are all closely related to permuted Walsh matrices,
which is not the case for any other 4-ary Boolean functions.
Even more: Only the bent functions have 8 dots in every row (except the top row) of the small matrices.
Walsh permutation; bent functions