# Nakafa Framework: LLM
URL: https://nakafa.com/en/subject/university/bachelor/ai-ds/linear-methods/spectral-complex-matrix
Source: https://raw.githubusercontent.com/nakafaai/nakafa.com/refs/heads/main/packages/contents/subject/university/bachelor/ai-ds/linear-methods/spectral-complex-matrix/en.mdx
Output docs content for large language models.
---
export const metadata = {
   title: "Spectral Theorem for Complex Matrices",
   description: "Master orthogonal diagonalization of normal matrices: prove equivalence between normality and eigenvector bases using mathematical induction.",
   authors: [{ name: "Nabil Akbarazzima Fatih" }],
   date: "07/16/2025",
   subject: "Linear Methods of AI",
};
## Orthogonal Diagonalization Characterization
The spectral theorem for complex matrices provides a complete characterization of when a complex matrix can be diagonalized using an orthonormal basis of eigenvectors. This is a very important result in linear algebra because it connects geometric concepts (orthonormal basis) with algebraic concepts (matrix normality).
For a complex matrix , the following conditions are equivalent to each other:
1. There exists an orthonormal basis of  consisting of eigenvectors of matrix 
2. Matrix  is normal
This equivalence is very profound because it shows that algebraic properties (normality) are directly related to the possibility of orthogonal diagonalization.
## Proof of the First Direction
Let us prove that if there exists an orthonormal basis of eigenvectors, then the matrix is normal. This is like proving that if a building has a very regular and symmetric structure, then the building has special balance properties.
Let  be an orthonormal basis consisting of eigenvectors of matrix . For each  we have .
Since it's an orthonormal basis, we have the following sequence of calculations:
This means , so that:
Since this holds for all basis vectors, then , which means  is normal.
## Proof from Normality to Diagonalization
Now we prove the opposite direction using mathematical induction. Imagine building a multi-story house, we start from the ground floor and prove that each new floor can be built using results from the previous floor.
### Mathematical Induction Structure
1. **Base Step** 
   For  (empty matrix), the statement is clearly true.
2. **Induction Hypothesis** 
   Assume the statement is true for all normal matrices of size .
3. **Induction Step** 
   Let  be normal. Based on the fundamental theorem of algebra, there exists an eigenvalue  of . Let  be a corresponding eigenvector with .
   We have  and from the properties of normal matrices, .
### Formation of Invariant Subspace
Complete  to an orthonormal basis of  with vectors . Define:
Here the span of vectors  is the set of all linear combinations of those vectors. In other words,  contains all vectors that can be written as  with .
For every , we have:
So , which means:
In other words,  is a subspace that is invariant (unchanging) under transformation . This is like a separate pond where fish swimming in that pond never leave the pond.
### Unitary Transformation and Preservation of Normality
Let  be a unitary matrix with columns . Then .
This transformation gives an elegant block form:
with:
Since unitary transformations preserve normality like a mirror that preserves the shape of objects, we can show that:
Therefore the block diagonal matrix is also normal, which means  is also normal.
## Construction of Complete Orthonormal Basis
Now we arrive at the final stage like assembling a puzzle that is almost complete. Based on the induction hypothesis, there exists an orthonormal basis  of eigenvectors for . Let  be a unitary matrix with those columns, where:
so that:
with eigenvalues  of .
Now we define:
Then  is a unitary matrix with:
and:
The columns of  form an orthonormal basis of eigenvectors of matrix .
## Real Matrix Case
For real matrices, the situation is slightly different like the difference between drawing on a flat canvas (real) compared to drawing in 3D space (complex). A real matrix:
is called normal if:
Normal real matrices are a special case of normal complex matrices with real entries. Therefore, the same properties apply to both types of symmetric and orthogonal matrices.
Symmetric matrices and orthogonal matrices are always normal. For a symmetric matrix , it is clear that:
For an orthogonal matrix , we have:
However, not all normal real matrices have real eigenvalues. In the real spectral theorem, the existence of real eigenvalues is not guaranteed, so orthogonal diagonalization may not always be possible in real numbers.