Strassen Algorithm Proof
📂Matrix AlgebraStrassen Algorithm Proof
Algorithm
Let’s say for k∈N there is n=2k. For A,B∈Rn×n, using the Jordan block matrix representation, let’s consider the following 8 matrices 2n×2n, Ai, and Bi.
AB=[A1A3A2A4][B1B3B2B4]=[C1C3C2C4]=C
To calculate C=AB, compute the following.
P1=A1(B2−B4)P2=(A1+A2)B4P3=(A3+A4)B1P4=A4(B3−B1)P5=(A1+A4)(B1+B4)P6=(A2−A4)(B3+B4)P7=(A3−A1)(B1+B2)
C1=−P2+P4+P5+P6C2=P1+P2C3=P3+P4C4=P1−P3+P5+P7
When calculating AiBj, repeat the same method, and the time complexity is Θ(n2.807).
- Of course, it is not that you cannot use n=2k, and you can apply it as is by adjusting the size.
Explanation
The multiplications of matrices that are straightforward and immediately come to mind are
C1=A1B1+A2B3C2=A1B2+A2B4C3=A3B1+A4B3C4=A3B2+A4B4
Just keep repeating this calculation, and there was no doubt that the time it took was known as Θ(n3) until Strassen was born.
This algorithm is very revolutionary because originally, it is definitely necessary to perform two matrix multiplications to calculate one Ci. Combining them requires calculation 8 times each time, but Strassen reduced this to 7 times. The consideration from the very beginning, whether there could be another method, is an extraordinary sense, and what was truly found can even be said to be a wonder. With the development of this algorithm, a significant amount of resources, if not a little, that would have been used for matrix calculations can be saved.
Proof
Part 1. Computability
There’s no choice but to calculate directly.
Part 1-1. C1=A1B1+A2B3
C1=====−P2+P4+P5+P6(−A1B4−A2B4)+P4+(A1B1+A1B4+A4B1+A4B4)+P6−A2B4+(A4B3−A4B1)+A1B1+A4B1+A4B4+P6−A2B4+A4B3+A1B1+A4B4+(A2B3+A2A4−A4B3−A4B4)A1B1+A2B3
Part 1-2. C2=A1B2+A2B4
C2===P1+P2(A1B2−A1B4)+(A1B4+A2B4)A1B2+A2B4
Part 1-3. C3=A3B1+A4B3
C3===P3+P4(A3B1+A4B1)+(A4B3−A4B1)A3B1+A4B3
Part 1-4. C4=A3B2+A4B4
C4=====P1−P3+P5+P7(A1B2−A1B4)−P3+(A1B1+A1B4+A4B1+A4B4)+P7A1B2+(−A3B1−A4B1)+A1B1+A4B1+A4B4+P7A1B2−A3B1+A1B1+A4B4+(A3B1+A3B2−A1B1−A1B2)A3B2+A4B4
Part 2. Time Complexity
Essentially, it is the same as the method that proved that the original calculation method was known as Θ(n3). If the time taken for one calculation is T(n) and the time taken outside of repetitions is c, then because it is T(n)=7T(2n)+c,
T(n)=====≈===7T(2n)+c7[7T(4n)+c]+c7[49T(8n)+7c+c]+c73T(8n)+(1+7+72)c73T(8n)+7−173−1c⋮7log2n(T(1)+c)nlog27(T(1)+c)n2.807(T(1)+c)Θ(n2.807)
■