{'fraction_non_alphanumeric': 0.03866272458494428, 'fraction_numerical': 0.007732544916988856, 'mean_word_length': 3.7032085561497325, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Every computable set is generically reducible to every computable set that does not have density 0 or 1

The notion of generic reducibility was introduced by A.Rybalov in his CiE 2018 paper: a set A is generically reducible to set B if there exists a total computable function f that m-reduces A to B such that the f-preimage of every set that has density 0 has density 0. It may be considered as the ``generic version'' of the notion of m-reducibility. In this note we improve one of his results and show that every two computable sets that do not have density 0 or 1 are equivalent with respect to generic reducibility, and that every computable set is reducible to every computable set that does not have density 0 or 1, thus providing a complete classification of computable sets with respect to generic reducibility.


Definitions and results
Definition 1. For a set A ⊂ N we define the density ρ n (A) as the fraction of A's elements among the first n natural numbers: ρ n (A) = #{k < n | k ∈ A} n The limit lim n ρ n (A) (if it exists) is called the asymptotic density of A and denoted by ρ(A).  Definition 4. We say that a set A ⊂ N is generically m-reducible to a set B ⊂ N (and write A ≤ gm B) if there exists a uniform computable function f : N → N that m-reduces A to B, i.e., x ∈ A ⇐⇒ f (x) ∈ B for all x ∈ N.
The notion of generic m-reducibility is a special case of m-reducibility: if A ≤ gm B then A ≤ m B. The reverse implication is not true: if A ≤ gm B and B is negligible, then A is also negligible (being the preimage of the negligible set B under the uniform reduction function).
In [1] all computable sets that have limit density were classified with respect to the generic reducibility. Namely, Theorem 2 (p. 361) says (for computable sets A, B ⊂ N that are not empty and have non-empty complement, and have some limit density): We show that the condition of having limit density may be omitted: Theorem. Every two computable sets that do not have density 0 or 1 are equivalent with respect to generic reducibility. Moreover, every computable set is generically reducible to every computable set that does not have density 0 or 1.
In this way we get a complete classification of computable sets with respect to generic reducibility: (all sets are assumed to be computable).

Proofs
We start with a result that does not mention computability (and then consider its effective version): Theorem. Let A be an arbitrary subset of N. Assume that B is a subset of N and neither B nor its complement are negligible. Then there exists a uniform (total) function that reduces A to B, i.e., a function that maps A into B and the complement of A into the complement of B.
Proof. The statement of the theorem follows from two lemmas.

Lemma 1.
For an arbitrary set A there exists a uniform function that reduces A to the set of even numbers (i.e., each element of A is mapped to an even number and each element of its complement is mapped to an odd number).
Lemma 2. Let B ⊂ N be a set such that neither B nor its complement is negligible. Then there exists a uniform function that reduces the set of even numbers to B.
Indeed, the composition of these two functions reduces A to B while being uniform.
Proof of Lemma 1. We map elements of A to different even numbers preserving the order: the least element of A is mapped to 0, the next one is mapped to 2 and so forth. In the same way the elements of A's complement are mapped to odd numbers. (If A or its complement are finite some elements of N are not in the range of the function.) Let us show that this map (called f in the sequel) is uniform. Let B be a negligible set. Consider an arbitrary initial segment of N. We are interested in the density of the preimage of B in this segment. The segment can be divided in two parts: the elements of A and the elements of its complement. The density of f −1 (B) in the segment is a weighted average of its densities in the both parts. These two densities are the densities of B in some initial segments of even numbers and odd numbers respectively. If both A and its complement are infinite, the lengths of these segments grow infinitely, and since B is negligible, both densities converge to 0. If A or its complement are finite, the weight of the finite part in the weighted average of densities converges to 0, so this part can be ignored.
Proof of Lemma 2. Let us prove an auxilary statement first: Claim. Assume that a set B ⊂ N is not negligible. Then there exists a uniform function f whose range is contained in B.
Proof of the claim. Suppose that the density of B in initial segments exceeds some ε infinitely often (this happens for some ε > 0 if B is not negligible). Then we can split N into intervals such that in each interval the density of B is greater than ε (we can construct these intervals consecutively; if the next interval is much longer than the all previous ones combined, the density of B in this interval is close to its density in some initial segment and therefore exceeds ε at some moment). Let the lengths of these intervals be n 1 , n 2 , . . . respectively. Without loss of generality we may assume that n 1 ≪ n 2 ≪ . . . (see below about the exact requirements for the lengths). The number of elements of B in these intervals is at least εn 1 , εn 2 , etc.
To construct the function f with the required properties, let us choose some N 1 ≪ N 2 ≪ . . . (much greater than n 1 , n 2 , . . .) and split N into consecutive intervals of lengths N 1 , N 2 , etc. The function f will cyclically map the interval of length N i to the elements of B in the interval of length n i of the initial partition (we may assume for simplicity that N i is a multiple of the number of the elements of B in the interval of length n i ).
Let X be a negligible set. Let us show that its preimage f −1 (X ) is negligible. The fraction of X in an interval of length n i converges to 0 as i → ∞ (we assume here that n i is greater than the sum of the lengths of the previous intervals, so deleting the previous intervals could increase the density at most by factor 2, and the density of X in the initial segment converges to 0). On the other hand, the fraction of B-elements in the same interval of length n i does not converge to 0 (exceeds ε ). Therefore, the fraction of X -elements among B-elements (in the same interval) converges to 0. This fraction equals the density of f −1 (X ) in the interval of length N i of the second partition (in the preimage space). If the lengths N 1 , N 2 , . . . grow fast enough, then the fraction of f −1 (X ) in the "aligned" initial segments (i.e., the initial segments that end on the boundaries between intervals of lengths N 1 , N 2 , . . .) also converges to 0.
However, we should also care about non-aligned initial segments. On the interval of length N i the mapping f is periodic (see the construction above), and one period enumerates all the elements of B in the n i -interval. So the density of f −1 (X ) in each period is equal to the density of X among the elelemts of B (inside the n i -interval), and this is OK. The problem is that while the density of f −1 (X ) in a single cycle inside N i -interval is OK, this density may vary substantially in some parts of this cycle. But if n i is small enough compared to N 1 + N 2 + . . .
, to be precise), then the weight of this part of the period in the density for the entire initial segment converges to 0 (note that the length of the period inside N i is the number of B-elements in n i -interval and therefore is bounded by n i ), so the last non-full period can be ignored. This is the proof scheme. Let us list the requirements we used: • n 1 + . . . + n i−1 = o(n i ), to get the lower bound for the density of X in n i -interval; to estimate the density of f −1 (X ) in the initial segment that contains intervals of length N 1 , . . ., N i ; , to deal with the non-aligned initial segments and the non-full periods.
It is easy to see that these requirement can be fulfilled (all at the same time); first we choose n i satisfying the first requirement; then we choose N i that are large enough and grow fast enough. This finishes the proof of the Claim.
This statement (used twice) provides two uniform functions whose images are contained in B and its complement. Let us combine them, using the first function on the set of even numbers and the second one on the set of odd numbers. The combined function is also uniform. Indeed, for every negligible set X its preimage is the union of two sets (the preimages for the two parts). One of them is negligible among the even numbers, while the other one is negligible among the odd numbers. Thus the combined preimage of X is also negligible. Lemma 2 is proven.
As we have seen, this finishes the proof of our theorem.