This answer partially references GPT, GPT_Pro to solve the problem better
Prove that a symmetric matrix with rank equal to n can be decomposed into the sum of n stacked matrices with rank equal to 1. Firstly, we need to make clear several concepts:

rank: refers to the maximum number of linearly independent rows of a matrix. If a matrix has n linearly independent rows, then its rank is n.

Symmetric matrix: defined as A matrix A, A is A symmetric matrix when A transpose A'=A.

Stacking matrix: is defined as stacking two or more matrices of the same type, that is, concatenating the matrix rows of the upper part after the matrix rows of the lower part to form a new matrix.
By definition, for A symmetric matrix A of rank n, its transpose A'=A, so both A and its transpose A' are composed of n independent rows, that is, both A and A' are nmembers, so this theorem can be proved by using Cayley's rule. Cayley's rule states that if a symmetric matrix of n n can be decomposed into the sum of n unit diagonal matrices of 1 1 and n1 diagonal matrices of 2 2(the diagonal matrices proposed here need not all be unit diagonal matrices and 2 2).
Suppose A is a symmetric matrix of n n with m rows of the same numbers. Decompose A into the sum of m diagonal matrices of 2 2 and(nm) diagonal matrices of 1 1. If the same number exists in the m row(i.e., m> 1), then merge all the numbers in the m row into one row and decompose it into a diagonal matrix of 2 2. For example:
A =
[a,b,c,d]
[b,a,d,c]
[c,d,a,b]
[d,c,b,a]
can be decomposed into the sum of four 1*1 unit diagonal matrices:
A =
[a,0,0,0] + [0,b,0,0] + [0,0,c,0] + [0,0,0,d]
Since A is itself a symmetric matrix, any row can be treated as the uppermost row; So just treat the first m rows as the most m rows. It can be proved that any symmetric matrix of n
n can be decomposed into the sum of n unit diagonal matrices of 1
1. Therefore, the theorem to be proved in this paper is obtained.
If the answer is helpful, please accept it.