Zulip Chat Archive

Stream: new members

Topic: Evaluating star of a matrix


Maris Ozols (Jul 27 2025 at 09:28):

I'm trying to prove that a simple 3x3 matrix is untary but for some reason the last rewrite with star_apply doesn't work.

import Mathlib.LinearAlgebra.UnitaryGroup
import Mathlib.Data.Complex.Basic

open Matrix

abbrev U3 := unitaryGroup (Fin 3) 

def X : Matrix (Fin 3) (Fin 3)  :=
  !![ 0, 0, 1;
      1, 0, 0;
      0, 1, 0 ]

lemma X_in_U3 : X  U3 := by
  rw [mem_unitaryGroup_iff]
  unfold X
  ext i j
  rw [mul_apply]
  rw [star_apply]
  sorry

Ruben Van de Velde (Jul 27 2025 at 10:28):

That's because it's under the sum. simp_rw works

Maris Ozols (Jul 27 2025 at 10:50):

Any tips on how to finish this proof or how to do these types of proofs that involve simple calculations with small explicit numerical matrices?

Kenny Lau (Jul 27 2025 at 10:51):

norm_num

Kenny Lau (Jul 27 2025 at 10:51):

oh wait, it's matrices, sorry

Kenny Lau (Jul 27 2025 at 10:51):

you need to split it into nine goals (one for each component) first, and then do norm_num

Kenny Lau (Jul 27 2025 at 10:53):

someone asked a similar question and i forgot the answer...

Kenny Lau (Jul 27 2025 at 10:59):

import Mathlib.LinearAlgebra.UnitaryGroup
import Mathlib.Data.Complex.Basic

open Matrix

abbrev U3 := unitaryGroup (Fin 3) 

def X : Matrix (Fin 3) (Fin 3)  :=
  !![ 0, 0, 1;
      1, 0, 0;
      0, 1, 0 ]

lemma X_in_U3 : X  U3 := by
  have star_X_eq : star X =
      !![star 0, star 1, star 0; star 0, star 0, star 1; star 1, star 0, star 0] :=
    Matrix.etaExpand_eq _ |>.symm
  rw [mem_unitaryGroup_iff, star_X_eq, X]
  ext i j; fin_cases i <;> fin_cases j <;> simp

Kenny Lau (Jul 27 2025 at 10:59):

@Eric Wieser might have more to say on this

Eric Wieser (Jul 27 2025 at 11:00):

I think we're missing some automation to transpose concrete matrices

Kenny Lau (Jul 27 2025 at 11:05):

import Mathlib.LinearAlgebra.UnitaryGroup
import Mathlib.Data.Complex.Basic

open Matrix

abbrev U3 := unitaryGroup (Fin 3) 

def X : Matrix (Fin 3) (Fin 3)  :=
  !![ 0, 0, 1;
      1, 0, 0;
      0, 1, 0 ]

lemma X_in_U3 : X  U3 := by
  rw [mem_unitaryGroup_iff, X]
  ext i j; fin_cases i <;> fin_cases j <;>
  simp [Matrix.vecMul_eq_sum, Fin.sum_univ_three]

Last updated: Dec 20 2025 at 21:32 UTC