AFTD Auto-Formalizing Theoretical Domains

rank_two_qutrit_projection_isometry

theoremverified

A rank-two orthogonal qutrit projection is the product of a two-column isometry and its adjoint.

Statement

theorem rank_two_qutrit_projection_isometry :
  ∀ P : Matrix (Fin 3) (Fin 3) ℂ, P.IsHermitian → P*P = P → P.rank = 2 →
    ∃ U : Matrix (Fin 3) (Fin 2) ℂ, Uᴴ*U = 1 ∧ U*Uᴴ = P
Source
Local compatibility helper for OP-693.
Verified
12 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 1
  • VThe ambient space $V = \mathbb{F}_p^n \times \mathbb{F}_p^n$ of pairs of coordinate vectors.
Used by 4

The proof, explained

The theorem is proved by diagonalizing the Hermitian matrix P via the spectral theorem. Because P is idempotent (P² = P), each of its eigenvalues satisfies λ² = λ and is therefore either 0 or 1. Since P has rank 2, exactly two eigenvalues are equal to 1, indexed by a two-element subset I ⊂ {0, 1, 2}. Selecting the two columns of the unitary eigenvector matrix corresponding to I defines a 3 × 2 matrix U that is an isometry (Uᴴ U = 1) and reconstructs the projection (U Uᴴ = P).

  1. Each eigenvector v from the orthonormal basis of P is non-zero and satisfies P *ᵥ v = λₖ • v.

    For any index k ∈ Fin 3, let v be the k-th vector in the orthonormal eigenvector basis of the Hermitian matrix P. Because the basis is orthonormal, v is non-zero, which is verified by injecting through the L² norm wrapper WithLp 2. By definition of the eigenvector basis, P *ᵥ v equals the eigenvalue coerced to ℂ times v.

    lines 8–15

    uses WithLp.ofLp_injective, RCLike.real_smul_eq_coe_smul

      let v : Fin 3 → ℂ := ⇑(hP.eigenvectorBasis k)
      have hv : v ≠ 0 := by
        intro h
        apply hP.eigenvectorBasis.orthonormal.ne_zero k
        apply WithLp.ofLp_injective 2
        exact h
      have he : P *ᵥ v = (hP.eigenvalues k : ℂ) • v := by
        simpa [RCLike.real_smul_eq_coe_smul] using hP.mulVec_eigenvectorBasis k
  2. The eigenvalue satisfies λₖ • (λₖ • v) = λₖ • v.

    Applying P to P *ᵥ v yields λₖ • (λₖ • v) by substituting the eigenvector equation and pulling out the scalar. On the other hand, matrix-vector multiplication is associative, so P *ᵥ (P *ᵥ v) = (P * P) *ᵥ v = P *ᵥ v = λₖ • v by idempotence of P (P * P = P). Equating both sides gives λₖ² v = λₖ v.

    lines 16–22

    uses Matrix.mulVec_smul, Matrix.mulVec_mulVec

      have hh : (hP.eigenvalues k : ℂ) • ((hP.eigenvalues k : ℂ) • v) =
          (hP.eigenvalues k : ℂ) • v := by
        calc
          _ = P *ᵥ (P *ᵥ v) := by rw [he, Matrix.mulVec_smul, he]
          _ = (P*P) *ᵥ v := Matrix.mulVec_mulVec v P P
          _ = P *ᵥ v := by rw [hPP]
          _ = _ := he
  3. Every eigenvalue of P is either 0 or 1.

    Since v is non-zero, it has at least one non-zero component v i ≠ 0. Evaluating the vector equation λₖ² v = λₖ v at coordinate i gives (λₖ² - λₖ) * v i = 0. Because v i ≠ 0, we have λₖ² - λₖ = 0 in ℝ. Factoring into λₖ * (λₖ - 1) = 0 implies λₖ = 0 or λₖ = 1.

    lines 23–35

    uses Function.ne_iff.mp, congrFun, Pi.smul_apply, smul_eq_mul, mul_eq_zero.mp, Or.inl, Or.inr, sub_eq_zero.mp

      obtain ⟨i,hi⟩ := Function.ne_iff.mp hv
      have hi' : v i ≠ 0 := by simpa using hi
      have hcoord := congrFun hh i
      simp only [Pi.smul_apply, smul_eq_mul] at hcoord
      have hz : ((hP.eigenvalues k : ℂ)^2 - (hP.eigenvalues k : ℂ)) * v i = 0 := by
        linear_combination hcoord
      have heval : (hP.eigenvalues k : ℝ)^2 - hP.eigenvalues k = 0 := by
        have h := (mul_eq_zero.mp hz).resolve_right hi'
        exact_mod_cast h
      have hfactor : hP.eigenvalues k * (hP.eigenvalues k - 1)=0 := by nlinarith [heval]
      rcases mul_eq_zero.mp hfactor with h | h
      · exact Or.inl h
      · exact Or.inr (sub_eq_zero.mp h)
  4. The set I of non-zero eigenvalue indices has size 2, and selecting these columns of the unitary eigenvector matrix defines U : Matrix (Fin 3) (Fin 2) ℂ.

    Let I be the subtype of indices in Fin 3 with non-zero eigenvalues. The rank of a Hermitian matrix equals the number of non-zero eigenvalues, and since rank P = 2, I has cardinality 2. Choosing a bijection e : Fin 2 ≃ I, we define U by taking the two columns of the unitary eigenvector matrix V corresponding to e, so U i j = V i (e j).

    lines 40–48

    uses hP.rank_eq_card_non_zero_eigs, Fintype.equivOfCardEq

      classical
      let I := {k : Fin 3 // hP.eigenvalues k ≠ 0}
      have hcard : Fintype.card I = 2 := by
        change Fintype.card {k : Fin 3 // hP.eigenvalues k ≠ 0} = 2
        rw [← hP.rank_eq_card_non_zero_eigs]
        exact hRank
      let e : Fin 2 ≃ I := Fintype.equivOfCardEq (by simp [hcard])
      let V : Matrix (Fin 3) (Fin 3) ℂ := hP.eigenvectorUnitary
      let U : Matrix (Fin 3) (Fin 2) ℂ := fun i j => V i (e j).val
  5. Uᴴ * U = 1, so U is an isometry from ℂ² into ℂ³.

    Because V is unitary, Vᴴ * V = 1. Entrywise, (Uᴴ * U) i j = (Vᴴ * V) (e i) (e j) = 1 (e i) (e j). Since e is a bijection, e i = e j if and only if i = j, so the entry equals the Kronecker delta 1 i j. Hence Uᴴ * U = 1.

    lines 49–61

    uses Unitary.coe_star_mul_self, Matrix.star_eq_conjTranspose, congrArg, Subtype.ext, Matrix.mul_apply, Matrix.conjTranspose_apply, Matrix.one_apply

      have hV : Vᴴ*V=1 := by
        have hh := Unitary.coe_star_mul_self hP.eigenvectorUnitary
        simpa [V, Matrix.star_eq_conjTranspose] using hh
      have hU : Uᴴ*U=1 := by
        ext i j
        have hh := congrArg (fun M : Matrix (Fin 3) (Fin 3) ℂ => M (e i).val (e j).val) hV
        have heq : (e i).val = (e j).val ↔ i=j := by
          constructor
          · intro h
            exact e.injective (Subtype.ext h)
          · rintro rfl
            rfl
        simpa [U, Matrix.mul_apply, Matrix.conjTranspose_apply, Matrix.one_apply, heq] using hh
  6. By the spectral theorem, P i j = ∑ k : I, V i k * star (V j k).

    The spectral theorem diagonalizes P as V * (diagonal λ) * Vᴴ. Because every eigenvalue is 0 or 1, each term V i k * λₖ * star (V j k) reduces to V i k * star (V j k) when λₖ ≠ 0 and 0 when λₖ = 0. The sum over all three indices k ∈ Fin 3 therefore equals the sum restricted to the non-zero eigenvalue index subtype I.

    lines 62–75

    uses Unitary.conjStarAlgAut_apply, Matrix.star_eq_conjTranspose, Function.comp_def, in767_projectionproof_projection_eigenvalues, Finset.sum_filter, Finset.sum_subtype

      have hspec : P = V * Matrix.diagonal (fun k => (hP.eigenvalues k : ℂ)) * Vᴴ := by
        have hh := hP.spectral_theorem
        simpa [V, Unitary.conjStarAlgAut_apply, Matrix.star_eq_conjTranspose, Function.comp_def] using hh
      have heig (k : Fin 3) : hP.eigenvalues k = 0 ∨ hP.eigenvalues k = 1 :=
        in767_projectionproof_projection_eigenvalues P hP hPP k
      have hterm (i j k : Fin 3) :
          V i k * (hP.eigenvalues k : ℂ) * star (V j k) =
          if hP.eigenvalues k ≠ 0 then V i k * star (V j k) else 0 := by
        rcases heig k with h | h <;> simp [h]
      have hsub (i j : Fin 3) :
          (∑ k : Fin 3, if hP.eigenvalues k ≠ 0 then V i k * star (V j k) else 0) =
          ∑ k : I, V i k.val * star (V j k.val) := by
        rw [← Finset.sum_filter]
        exact Finset.sum_subtype (Finset.univ.filter fun k : Fin 3 => hP.eigenvalues k ≠ 0) (by simp) _
  7. U * Uᴴ = P, so U is the desired witness.

    The (i,j) entry of U * Uᴴ is the sum over k ∈ Fin 2 of V i (e k) * star (V j (e k)). Re-indexing this sum via the equivalence e : Fin 2 ≃ I gives the sum over k ∈ I of V i k * star (V j k), which equals P i j from the spectral decomposition. Thus U * Uᴴ = P, providing the witness ⟨U, hU, hUU⟩.

    lines 76–87

    uses congrArg, Matrix.mul_apply, Matrix.mul_diagonal, Matrix.conjTranspose_apply

      have hUU : U*Uᴴ=P := by
        ext i j
        have hh := congrArg (fun M : Matrix (Fin 3) (Fin 3) ℂ => M i j) hspec
        rw [Matrix.mul_apply] at hh
        simp only [Matrix.mul_diagonal, Matrix.conjTranspose_apply] at hh
        simp_rw [hterm] at hh
        rw [hsub] at hh
        have he := e.sum_comp (fun k : I => V i k.val * star (V j k.val))
        change (∑ k : Fin 2, V i (e k).val * star (V j (e k).val)) = P i j
        rw [he]
        exact hh.symm
      exact ⟨U,hU,hUU⟩
  8. Any rank-two orthogonal projection on a qutrit factors as U * Uᴴ for an isometry U.

    Given P with P.IsHermitian, P * P = P, and rank P = 2, the main theorem applies the rank-two projection isometry lemma to conclude the existence of U with Uᴴ * U = 1 and U * Uᴴ = P.

    lines 92–93

    uses in767_projectionproof_projection_rank_two_isometry

      intro P hP hPP hRank
      exact in767_projectionproof_projection_rank_two_isometry P hP hPP hRank
Finset.sum_filter
Summing over a finset filtered by a predicate equals the unfiltered sum with an if-then-else indicator.
Finset.sum_subtype
Summing over a finset defined by a predicate equals summing over the subtype of elements satisfying that predicate.
Fintype.equivOfCardEq
Two finite types with equal cardinalities are equivalent (in bijection).
Function.comp_def
Function composition is defined by (f ∘ g)(x) = f(g(x)).
Function.ne_iff.mp
Two functions are not equal if and only if they differ at some input.
Matrix.mul_apply
The (i,k)-th entry of a matrix product M * N is the sum ∑ j, M i j * N j k.
Matrix.mul_diagonal
Multiplying a matrix on the right by a diagonal matrix scales each column by the corresponding diagonal entry.
Matrix.mulVec_mulVec
Matrix-vector multiplication is associative with matrix multiplication: M *ᵥ (N *ᵥ v) = (M * N) *ᵥ v.
Matrix.mulVec_smul
Matrix-vector multiplication commutes with scalar multiplication: M *ᵥ (b • v) = b • (M *ᵥ v).
Matrix.one_apply
The entries of the identity matrix are given by the Kronecker delta: 1 i j is 1 if i = j and 0 otherwise.
Matrix.star_eq_conjTranspose
The star operation on complex square matrices is the conjugate transpose: star M = Mᴴ.
Matrix.conjTranspose_apply
The (j,i)-th entry of the conjugate transpose Mᴴ is the complex conjugate of M i j.
Or.inl
Constructs a proof of a ∨ b from a proof of a.
Or.inr
Constructs a proof of a ∨ b from a proof of b.
Pi.smul_apply
Pointwise scalar multiplication of a function evaluates as (a • f) i = a • f i.
RCLike.real_smul_eq_coe_smul
Scalar multiplication by a real number on a complex vector space coincides with multiplication by its complex coercion.
Subtype.ext
Two subtype elements are equal if and only if their underlying values are equal.
Unitary.conjStarAlgAut_apply
The conjugation star-algebra automorphism induced by a unitary matrix u acts by conjugation: x ↦ u * x * star u.
Unitary.coe_star_mul_self
For any unitary element U, (star U) * U = 1.
WithLp.ofLp_injective
The canonical map from an L^p type to its underlying type is injective.
congrArg
Applying a function to equal arguments yields equal values.
congrFun
If two functions are equal, their values at any argument are equal.
hP.rank_eq_card_non_zero_eigs
The rank of a Hermitian matrix equals the number of its non-zero eigenvalues.
in767_projectionproof_projection_eigenvalues
Every eigenvalue of an idempotent Hermitian 3x3 matrix is either 0 or 1.
in767_projectionproof_projection_rank_two_isometry
A rank-two idempotent Hermitian 3x3 complex matrix can be factored as U * Uᴴ with Uᴴ * U = 1.
mul_eq_zero.mp
If a product of two numbers is zero, at least one of the factors is zero.
smul_eq_mul
Scalar multiplication in a multiplication-equipped type is given by multiplication.
sub_eq_zero.mp
If a - b = 0, then a = b.

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

open Matrixopen scoped BigOperators Matrix ComplexOrderset_option backward.isDefEq.respectTransparency falseset_option linter.unusedSimpArgs falseprivate lemma in767_projectionproof_projection_eigenvalues (P : Matrix (Fin 3) (Fin 3) ℂ)    (hP : P.IsHermitian) (hPP : P*P=P) (k : Fin 3) :    hP.eigenvalues k = 0 ∨ hP.eigenvalues k = 1 := by  let v : Fin 3 → ℂ := ⇑(hP.eigenvectorBasis k)  have hv : v ≠ 0 := by    intro h    apply hP.eigenvectorBasis.orthonormal.ne_zero k    apply WithLp.ofLp_injective 2    exact h  have he : P *ᵥ v = (hP.eigenvalues k : ℂ) • v := by    simpa [RCLike.real_smul_eq_coe_smul] using hP.mulVec_eigenvectorBasis k  have hh : (hP.eigenvalues k : ℂ) • ((hP.eigenvalues k : ℂ) • v) =      (hP.eigenvalues k : ℂ) • v := by    calc      _ = P *ᵥ (P *ᵥ v) := by rw [he, Matrix.mulVec_smul, he]      _ = (P*P) *ᵥ v := Matrix.mulVec_mulVec v P P      _ = P *ᵥ v := by rw [hPP]      _ = _ := he  obtain ⟨i,hi⟩ := Function.ne_iff.mp hv  have hi' : v i ≠ 0 := by simpa using hi  have hcoord := congrFun hh i  simp only [Pi.smul_apply, smul_eq_mul] at hcoord  have hz : ((hP.eigenvalues k : ℂ)^2 - (hP.eigenvalues k : ℂ)) * v i = 0 := by    linear_combination hcoord  have heval : (hP.eigenvalues k : ℝ)^2 - hP.eigenvalues k = 0 := by    have h := (mul_eq_zero.mp hz).resolve_right hi'    exact_mod_cast h  have hfactor : hP.eigenvalues k * (hP.eigenvalues k - 1)=0 := by nlinarith [heval]  rcases mul_eq_zero.mp hfactor with h | h  · exact Or.inl h  · exact Or.inr (sub_eq_zero.mp h)private lemma in767_projectionproof_projection_rank_two_isometry    (P : Matrix (Fin 3) (Fin 3) ℂ) (hP : P.IsHermitian) (hPP : P*P=P) (hRank : P.rank=2) :    ∃ U : Matrix (Fin 3) (Fin 2) ℂ, Uᴴ*U=1 ∧ U*Uᴴ=P := by  classical  let I := {k : Fin 3 // hP.eigenvalues k ≠ 0}  have hcard : Fintype.card I = 2 := by    change Fintype.card {k : Fin 3 // hP.eigenvalues k ≠ 0} = 2    rw [← hP.rank_eq_card_non_zero_eigs]    exact hRank  let e : Fin 2 ≃ I := Fintype.equivOfCardEq (by simp [hcard])  let V : Matrix (Fin 3) (Fin 3) ℂ := hP.eigenvectorUnitary  let U : Matrix (Fin 3) (Fin 2) ℂ := fun i j => V i (e j).val  have hV : Vᴴ*V=1 := by    have hh := Unitary.coe_star_mul_self hP.eigenvectorUnitary    simpa [V, Matrix.star_eq_conjTranspose] using hh  have hU : Uᴴ*U=1 := by    ext i j    have hh := congrArg (fun M : Matrix (Fin 3) (Fin 3) ℂ => M (e i).val (e j).val) hV    have heq : (e i).val = (e j).val ↔ i=j := by      constructor      · intro h        exact e.injective (Subtype.ext h)      · rintro rfl        rfl    simpa [U, Matrix.mul_apply, Matrix.conjTranspose_apply, Matrix.one_apply, heq] using hh  have hspec : P = V * Matrix.diagonal (fun k => (hP.eigenvalues k : ℂ)) * Vᴴ := by    have hh := hP.spectral_theorem    simpa [V, Unitary.conjStarAlgAut_apply, Matrix.star_eq_conjTranspose, Function.comp_def] using hh  have heig (k : Fin 3) : hP.eigenvalues k = 0 ∨ hP.eigenvalues k = 1 :=    in767_projectionproof_projection_eigenvalues P hP hPP k  have hterm (i j k : Fin 3) :      V i k * (hP.eigenvalues k : ℂ) * star (V j k) =      if hP.eigenvalues k ≠ 0 then V i k * star (V j k) else 0 := by    rcases heig k with h | h <;> simp [h]  have hsub (i j : Fin 3) :      (∑ k : Fin 3, if hP.eigenvalues k ≠ 0 then V i k * star (V j k) else 0) =      ∑ k : I, V i k.val * star (V j k.val) := by    rw [← Finset.sum_filter]    exact Finset.sum_subtype (Finset.univ.filter fun k : Fin 3 => hP.eigenvalues k ≠ 0) (by simp) _  have hUU : U*Uᴴ=P := by    ext i j    have hh := congrArg (fun M : Matrix (Fin 3) (Fin 3) ℂ => M i j) hspec    rw [Matrix.mul_apply] at hh    simp only [Matrix.mul_diagonal, Matrix.conjTranspose_apply] at hh    simp_rw [hterm] at hh    rw [hsub] at hh    have he := e.sum_comp (fun k : I => V i k.val * star (V j k.val))    change (∑ k : Fin 2, V i (e k).val * star (V j (e k).val)) = P i j    rw [he]    exact hh.symm  exact ⟨U,hU,hUU⟩theorem rank_two_qutrit_projection_isometry :  ∀ P : Matrix (Fin 3) (Fin 3) ℂ, P.IsHermitian → P*P = P → P.rank = 2 →    ∃ U : Matrix (Fin 3) (Fin 2) ℂ, Uᴴ*U = 1 ∧ U*Uᴴ = P := by  intro P hP hPP hRank  exact in767_projectionproof_projection_rank_two_isometry P hP hPP hRank
See it in the graphDiscuss this resultChallenge it