In this section, we will delve into the study of the coding of the orbits of the Collatz function. The main results of this section are the invariance of the coding between and on the fractions with denominator q and the one-to-one identification of each element of with its coding.
5.2. Coding of the Orbits
It is a common practice in dynamical systems to encode orbits based on specific criteria. In our case, we will encode the orbits of the Collatz function according to the parity of its elements, assigning the value 1 when they are odd and 0 when they are even. Since our primary focus is on the Collatz function over , we will modify the initial coding by assigning 10 when it is odd, as opposed to just 1. We will denote the space where these encodings reside as since it is a subset of the sequence space consisting of 0s and 1s, denoted in dynamics as . Formally, we express this as

To rigorously examine the properties of the coding, it is essential to establish a precise form for the elements generated by and .

Proof: We will prove by induction on k (length of S) for we have
, then, and then .
, then, and then .
Suppose the statement is true up to k, let of length with H of length k and let b be the quantity of 1 and a be the quantity of 0 of .
Claim 1:. We have:
the quantity of 1 of is
and for and the quantity of 0 of is
On the other hand, we have:
where we observe that the values coincide with those calculated.
Claim 2:. We have
the quantity of 1 of is b.
for
.
On the other hand, we have
where we observe that the values coincide with those calculated, then the statement is true.
QED.
Now we will see the first property of the coding

Proof: Let . To prove that they have the same coding, we have to prove that they have the same decomposition in principle, except that where there is we have a . let us observe that q has commutative properties with and .
As
then there exists
such that
For convenience we will denote
. Then we have
since
q does not permute any element
, we have that if
is
then
is still
and if
is
then
corresponds to
. By Proposition 5 we have that the coding of
has to be the same as that of
S.
QED.
Let us contemplate a generalization of the Collatz function applied to integers. In this variant, rather than adding 1, the function adds , where q is an odd integer. Subsequently, we will establish the compatibility of this generalization with the extension of the Collatz function to .

Now, we will demonstrate the compatibility of this generalization

Proof: We let’s observe that
Suppose first that
. This fraction is irreducible. Indeed we have that
. Then the parity of the fraction depends only on the numerator since there is no possibility of simplification that changes the parity of the numerator and we can continue with the iteration for all
k since the irreducibility of the iterations only depends on the initial fraction is irreducible. Then we have
Now suppose that , for this case, the resulting fraction is not irreducible. However, as we are going to prove below, this does not change the parity of the orbits, so the formula would continue to be valid for this case. Suppose that, with and let . We will divide this proof into two parts.
Case one : We are going to prove the statement by induction. To
Now suppose that the statement is true for
k, observe before continuing that the expressions
and
have the same parity. Indeed,
if the expression on the left-hand side is even, if and only if
it is even. On the other hand, if the left side is odd,
must be odd and if
is odd, since the product of odd is odd, the left side is odd, so the expressions have the same parity.
-
if
it is odd. Expanding the left-hand side of the proposition,
developing the right-hand side of the proposition,
We conclude in this case that both parts are equal
-
if
it is even. Expanding the left-hand side of the proposition,
developing the right-hand side of the proposition,
We conclude in this case that both parts are equal. Since in both cases it gave equality, we conclude that the proposition is true.
Case two : We are going to prove the statement by induction. To
Now suppose that the statement is true for
k, observe before continuing that the expressions
and
have the same parity. Indeed,
if the expression on the left-hand side is even, if and only if
it is even. On the other hand, if the left side is odd,
must be odd and if
is odd since the product of odd is odd, the left side is odd, so the expressions have the same parity.
-
if
it is odd. Expanding the left-hand side of the proposition,
developing the right-hand side of the proposition,
We conclude in this case that both parts are equal.
-
if
it is even. Expanding the left-hand side of the proposition,
developing the right-hand side of the proposition,
We conclude in this case that both parts are equal. Since in both cases it gave equality, we conclude that the proposition is true.
QED.
We will define a coding function for the Collatz q-functions and demonstrate that they produce the same coding as the fractions with denominator q.

Proof: By proposition 9 we have
Since q it is odd, then, we have coding of and must be the same.
QED.
We will now establish the initial connection between sets of integers and coding. Specifically, we will demonstrate that all elements within the integer set S share the same coding.

Proof: Let and then by definition by Proposition 3 we have with , then .
Suppose that then , then .
QED.
We show below the second connection between the integer sets and the encoding. Specifically, we demonstrate that all values p within the integer set indeed have the same coding as the corresponding fraction .

Proof: Let
of length
k such that
, for the proposition 9, we have
then
finally by the proposition 11, we have
if and only if
.
QED.
The following proposition demonstrates that for a given rational number, we can generate a family of rationals that share the same encoding. This suggests that there exist many rationals with the same k-th encoding

Proof: Let
such that
then
this implies
then
QED.
As we have seen so far, we can characterize the entire set S from its encoding. Exploiting this property, we generalize the entire set S to encompass all fractions sharing the same encoding. We will call the Coding set.

The encoding set also exhibits the property of monotonicity, similar to the integer set of S.

Proof: Let by definition then trivially we have , then .
QED.

Similarly, the behavior of the solutions of Diophantine equations, in which knowing a particular solution allows us to determine other solutions, is reflected in the coding set. This connection is illustrated in the following proposition.

Proof: Let
and
such that
, now consider
and
such that
by proposition 12 we have
the latter is equivalent
We are going to prove that
and
are elements of
with
. Indeed,
and
then
QED.
Now, we will present the main theorem of this section, establishing that the encoding of a rational number is unique.

Proof: Let
numbers from 0 to
. Suppose there is another element,
such than
by proposition 15
Since then . On the other hand, since and since T is an integer, so tending to infinity, which implies should be infinite, which is a contradiction.
QED.