Paradoxical Compression with VDF
github.com
github.com
Edit: If c+1 would wrap around, you could fallback on encoding as C0(x) || enc(0) || Mac(C0(x) || enc(0)).
There likely won't be enough computation, ever, to trigger an accidental collision, even if was a galactic bitcoin equivalent.
I'd only be worried about deliberate collisions, if the construction isn't sufficiently hard.
It's computationally intractable (in fact, I'm pretty sure it's computational-intractability-complete), but if you live in a deterministic universe, it actually is possible to compress any input to at most a psuedo-constant number of bits.
Just run every possible program in some Turing-complete language in parallel, and pick the shortest program that outputs your input. In the worst case, this will be a program that simulates the entire history of your universe up to the point where you were provided with the input and then reads out the simulated input. No matter how large the input is, this will only take (U+logXYZT) bits, where U is the number of bits to describe the laws of physics and initial state of the universe, and logXYZT is the number of bits to describe your position in space and time (among other things, it's logarithmic in the current age of the universe).
(Caution: there may be elditch abominations in your universal prior[0], but as long as you stick to programs that output a fixed input and don't try to fiddle with them to decompress more data than you originally put in, they probably can't hurt you.)
0: https://ordinaryideas.wordpress.com/2016/11/30/what-does-the...
https://cs.fit.edu/~mmahoney/compression/barf.html
Of course, there's a catch.
head -c -1 "$file" > "$file$(tail -c1 "$file")"
EDIT: Obviously this has the corner case of null bytesYou can decompress a gzip file without the file name (think about tar using a pipe.)
That's AWESOME show me!
> Of course I am slightly cheating here
mkay... :-(
Compression: gzip the file and tacking a crypto hash on the end. Discard if not shorter and store the original instead.
Decompression: if has gzip header and the crypto hash at the end matches, unzip. Else return source as is.
Have I just paradoxically compressed something?
1. Take something compressible like x0=AAAA...
2. Compress to get y0.
3. Take x1=y0. Compress to get y1. Now most likely y0=y1 meaning that decompressing y1 doesn't give x1, so you lost. But if y1 != y0, then
4. Take x{i+1} = y{i} and compress. Eventually there will be a collision.
Preventing this is why the author's scheme is so complex.
Most files in the space of all possible files will be essentially random and not compress, and adding a header will make them larger.
1. Look for at least two as long as possible identical peaces with arbitrary bit offset from the beginning.
2. Record value and length (common for all peaces) and offsets for each peace.
3. Create and prepend a header with following fields: compressed_flag, piece length, pieces count, piece value, pieces offsets list, content
Obviously if the file is very small this approach will not work. But assuming that we know the file size (which is the loophole here), we can pre-calculate which is a threshold file size to consider to be with a header, and what is too short so uncompressed headerless content is being saved there.
P.S. To remove the loophole possibility the streams of data should be rather considered instead of files.
Compress file B fails to make it shorter, so the generated file C is actually identical to B.
We’ve just compressed twice. Uncompressing twice generates A again.
Since B == C, when you uncompress C, you get A, which is not what you started with.
Isn't this trivially wrong?
If you have a bitstring s and you compress it to c, where the length of s is larger than length of c, compressing c again produces an issue.
For example, if you compress a bitstring to just 1, how do you compress 1? To 0? And how do you compress 0 then? We can use this principle to find uncompressable bitstrings of any length anywhere for any algorithm.
An idea pops into my head regarding this, though: in signal analysis there's a concept called noise shaping (which matches OPs ideas to a great degree), the idea is to push any noise out from some band and into another, it's super neat actually.
Could this idea be expanded such that there is some singular monster string that expands to an absurd size, while others stay the same or are smaller? How about multiple but still small in density?
My intuition sadly says no because of what I started this comment with. It's trivial to find strings that aren't compressible.
Please let me know if and where my ideas on this go wrong!
This paradoxical compression, as stated above is incomplete. You can achieve all input files to be compressed without having to expand any other file but you would expand time instead. Let me explain it: - Any set of data can be expressed using mathematical functions/algorithms that can be saved as one file, very small in data compared with original data, but to do so you'll need to invest a lot of time to find those functions/algorithms. One practical example would be a mission to Alpha Centauri which might want to have Earth's internet on board but no physical space for all that data. Let's say it takes 10 years to prepare the mission which in that case you'd also use this 10 years to compress, for argument sake, Google's big index, (or NSA Utah center if you like that one) and you'll have on board, on a single thumb stick, Internet version from 10 years before launch.
Edit: Since some people have problems understanding this extreme compression, I am trying to clarify this further. This method is unique to that set of data. And it can be applied to only that data, only one time and that's it. Not a general set of algorithms so you can compress anything else. It will fail if not applied to that data. It is not a classic compression, it is more, if you like the term, a data generator. It will run a program that at the end of its run will generate that Internet version you started with 10 years ago. But to do that you'll need to research how to do that data generating, hence the extreme time it takes to achieve. In practice I'll envision a lot of people getting their slice of data and do one function. And the program will run those functions one after another, generating the data.
If you'd like to use a purpose-built computer or decoder for each output, then you need to include the complexity of the computer or decoder in the compressed size. Otherwise you could write a decoder such as "when given any input, output the contents of wikipedia" and claim that it compresses a certain text to 0 bytes.
The problem is that once you fix the architecture (for example a x64 compatible processor) and you try to compress every possible 1GB files like in my link, for some of them you will get a size of descompresor+data that is very small, specially if you have a lot of time. This is essentially the challenge. The articles in Wikipedia have a lot of internal structure, so if you are smart and/or have lot time you can get a very small size.
Anyway, once you fixed the architecture, it is possible that an evil person looks at the details of the the architecture and make a file that is so weird that the size of descompresor+data is bigger, in spite you are very smart or you have a lot of time to try the brute force approach.
The Pigeonhole Principle guarantees that the evil person can always success, in spite the file with the problem may not be very interesting and it may be very difficult to find it.
(Actually, any file with cryptography random number will probably work. A file with pseudo random numbers is not enough, because with enough patient you may find the algorithm, seed and offset and use that as the compressed version. The digits of pi skipping the first million is also a bad idea, because is also a ba idea for the same reason.)
Also I agree with your points, this assumes every participant to be honest when researching their slice, as per my edit.
In the case of the ship, they will be able to store a very compressed version of Wikipedia, but they will not be able to store a file with the same size that records the last bit of the central pixel of a CCD carera that is pointed to the sun filtered with the von Neumann trick https://en.wikipedia.org/wiki/Fair_coin#Fair_results_from_a_...