...I've heard that it was proven mathematically that it's impossible to attack the chain if the difference is 6 blocks and more.
The person who told you that is wrong. It is possible to successfully "attack the chain" regardless of the number of block if you have sufficient resources.
There is a rule of thumb saying that it is extremely unlikely for a chain reorg to be 6 blocks deep. The six blocks rule of thumb comes from an analysis in a very old post here somewhere.