Theorem: NumberField.mixedEmbedding.stdBasis_repr_eq_matrixToStdBasis_mul
File: Mathlib/NumberTheory/NumberField/CanonicalEmbedding/Basic.lean

tactic: simp_rw [commMap, matrixToStdBasis, LinearMap.coe_mk, AddHom.coe_mk,
  mulVec, dotProduct, Function.comp_apply, index, Fintype.sum_sum_type,
  diagonal_one, reindex_apply, ← univ_product_univ, sum_product,
  indexEquiv_apply_ofIsReal, Fin.sum_univ_two, indexEquiv_apply_ofIsComplex_fst,
  indexEquiv_apply_ofIsComplex_snd, smul_of, smul_cons, smul_eq_mul,
  mul_one, Matrix.smul_empty, Equiv.prodComm_symm, Equiv.coe_prodComm]
state_before: K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
x : (K →+* ℂ) → ℂ
hx : ∀ (φ : K →+* ℂ), (starRingEnd ℂ) (x φ) = x (ComplexEmbedding.conjugate φ)
c : index K
⊢ ↑(((stdBasis K).repr ((commMap K) x)) c) = (matrixToStdBasis K *ᵥ x ∘ ⇑(indexEquiv K)) c
state_after: K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
x : (K →+* ℂ) → ℂ
hx : ∀ (φ : K →+* ℂ), (starRingEnd ℂ) (x φ) = x (ComplexEmbedding.conjugate φ)
c : index K
⊢ ↑(((stdBasis K).repr (fun w => (x (↑w).embedding).re, fun w => x (↑w).embedding)) c) =
    ∑ x_1 : { w // w.IsReal },
        fromBlocks 1 0 0
            ((blockDiagonal fun x => of ![![2⁻¹, 2⁻¹], ![2⁻¹ * -I, 2⁻¹ * I]]).submatrix Prod.swap Prod.swap) c
            (Sum.inl x_1) *
          x (↑x_1).embedding +
      ∑ x_1 : { w // w.IsComplex },
        (fromBlocks 1 0 0
              ((blockDiagonal fun x => of ![![2⁻¹, 2⁻¹], ![2⁻¹ * -I, 2⁻¹ * I]]).submatrix Prod.swap Prod.swap) c
              (Sum.inr (x_1, 0)) *
            x (↑x_1).embedding +
          fromBlocks 1 0 0
              ((blockDiagonal fun x => of ![![2⁻¹, 2⁻¹], ![2⁻¹ * -I, 2⁻¹ * I]]).submatrix Prod.swap Prod.swap) c
              (Sum.inr (x_1, 1)) *
            x (ComplexEmbedding.conjugate (↑x_1).embedding))

tactic: simp_rw [stdBasis_apply_ofIsReal, fromBlocks_apply₁₁, fromBlocks_apply₁₂,
  one_apply, Matrix.zero_apply, ite_mul, one_mul, zero_mul, sum_ite_eq, mem_univ, ite_true,
  add_zero, sum_const_zero, add_zero, ← conj_eq_iff_re, hx (embedding w.val),
  conjugate_embedding_eq_of_isReal w.prop]
state_before: case inl
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
x : (K →+* ℂ) → ℂ
hx : ∀ (φ : K →+* ℂ), (starRingEnd ℂ) (x φ) = x (ComplexEmbedding.conjugate φ)
w : { w // w.IsReal }
⊢ ↑(((stdBasis K).repr (fun w => (x (↑w).embedding).re, fun w => x (↑w).embedding)) (Sum.inl w)) =
    ∑ x_1 : { w // w.IsReal },
        fromBlocks 1 0 0
            ((blockDiagonal fun x => of ![![2⁻¹, 2⁻¹], ![2⁻¹ * -I, 2⁻¹ * I]]).submatrix Prod.swap Prod.swap) (Sum.inl w)
            (Sum.inl x_1) *
          x (↑x_1).embedding +
      ∑ x_1 : { w // w.IsComplex },
        (fromBlocks 1 0 0
              ((blockDiagonal fun x => of ![![2⁻¹, 2⁻¹], ![2⁻¹ * -I, 2⁻¹ * I]]).submatrix Prod.swap Prod.swap)
              (Sum.inl w) (Sum.inr (x_1, 0)) *
            x (↑x_1).embedding +
          fromBlocks 1 0 0
              ((blockDiagonal fun x => of ![![2⁻¹, 2⁻¹], ![2⁻¹ * -I, 2⁻¹ * I]]).submatrix Prod.swap Prod.swap)
              (Sum.inl w) (Sum.inr (x_1, 1)) *
            x (ComplexEmbedding.conjugate (↑x_1).embedding))
state_after: no goals

tactic: rcases c with ⟨w, j⟩
state_before: case inr
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
x : (K →+* ℂ) → ℂ
hx : ∀ (φ : K →+* ℂ), (starRingEnd ℂ) (x φ) = x (ComplexEmbedding.conjugate φ)
c : { w // w.IsComplex } × Fin 2
⊢ ↑(((stdBasis K).repr (fun w => (x (↑w).embedding).re, fun w => x (↑w).embedding)) (Sum.inr c)) =
    ∑ x_1 : { w // w.IsReal },
        fromBlocks 1 0 0
            ((blockDiagonal fun x => of ![![2⁻¹, 2⁻¹], ![2⁻¹ * -I, 2⁻¹ * I]]).submatrix Prod.swap Prod.swap) (Sum.inr c)
            (Sum.inl x_1) *
          x (↑x_1).embedding +
      ∑ x_1 : { w // w.IsComplex },
        (fromBlocks 1 0 0
              ((blockDiagonal fun x => of ![![2⁻¹, 2⁻¹], ![2⁻¹ * -I, 2⁻¹ * I]]).submatrix Prod.swap Prod.swap)
              (Sum.inr c) (Sum.inr (x_1, 0)) *
            x (↑x_1).embedding +
          fromBlocks 1 0 0
              ((blockDiagonal fun x => of ![![2⁻¹, 2⁻¹], ![2⁻¹ * -I, 2⁻¹ * I]]).submatrix Prod.swap Prod.swap)
              (Sum.inr c) (Sum.inr (x_1, 1)) *
            x (ComplexEmbedding.conjugate (↑x_1).embedding))
state_after: case inr.mk
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
x : (K →+* ℂ) → ℂ
hx : ∀ (φ : K →+* ℂ), (starRingEnd ℂ) (x φ) = x (ComplexEmbedding.conjugate φ)
w : { w // w.IsComplex }
j : Fin 2
⊢ ↑(((stdBasis K).repr (fun w => (x (↑w).embedding).re, fun w => x (↑w).embedding)) (Sum.inr (w, j))) =
    ∑ x_1 : { w // w.IsReal },
        fromBlocks 1 0 0
            ((blockDiagonal fun x => of ![![2⁻¹, 2⁻¹], ![2⁻¹ * -I, 2⁻¹ * I]]).submatrix Prod.swap Prod.swap)
            (Sum.inr (w, j)) (Sum.inl x_1) *
          x (↑x_1).embedding +
      ∑ x_1 : { w // w.IsComplex },
        (fromBlocks 1 0 0
              ((blockDiagonal fun x => of ![![2⁻¹, 2⁻¹], ![2⁻¹ * -I, 2⁻¹ * I]]).submatrix Prod.swap Prod.swap)
              (Sum.inr (w, j)) (Sum.inr (x_1, 0)) *
            x (↑x_1).embedding +
          fromBlocks 1 0 0
              ((blockDiagonal fun x => of ![![2⁻¹, 2⁻¹], ![2⁻¹ * -I, 2⁻¹ * I]]).submatrix Prod.swap Prod.swap)
              (Sum.inr (w, j)) (Sum.inr (x_1, 1)) *
            x (ComplexEmbedding.conjugate (↑x_1).embedding))

tactic: fin_cases j
state_before: case inr.mk
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
x : (K →+* ℂ) → ℂ
hx : ∀ (φ : K →+* ℂ), (starRingEnd ℂ) (x φ) = x (ComplexEmbedding.conjugate φ)
w : { w // w.IsComplex }
j : Fin 2
⊢ ↑(((stdBasis K).repr (fun w => (x (↑w).embedding).re, fun w => x (↑w).embedding)) (Sum.inr (w, j))) =
    ∑ x_1 : { w // w.IsReal },
        fromBlocks 1 0 0
            ((blockDiagonal fun x => of ![![2⁻¹, 2⁻¹], ![2⁻¹ * -I, 2⁻¹ * I]]).submatrix Prod.swap Prod.swap)
            (Sum.inr (w, j)) (Sum.inl x_1) *
          x (↑x_1).embedding +
      ∑ x_1 : { w // w.IsComplex },
        (fromBlocks 1 0 0
              ((blockDiagonal fun x => of ![![2⁻¹, 2⁻¹], ![2⁻¹ * -I, 2⁻¹ * I]]).submatrix Prod.swap Prod.swap)
              (Sum.inr (w, j)) (Sum.inr (x_1, 0)) *
            x (↑x_1).embedding +
          fromBlocks 1 0 0
              ((blockDiagonal fun x => of ![![2⁻¹, 2⁻¹], ![2⁻¹ * -I, 2⁻¹ * I]]).submatrix Prod.swap Prod.swap)
              (Sum.inr (w, j)) (Sum.inr (x_1, 1)) *
            x (ComplexEmbedding.conjugate (↑x_1).embedding))
state_after: case inr.mk.head
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
x : (K →+* ℂ) → ℂ
hx : ∀ (φ : K →+* ℂ), (starRingEnd ℂ) (x φ) = x (ComplexEmbedding.conjugate φ)
w : { w // w.IsComplex }
⊢ ↑(((stdBasis K).repr (fun w => (x (↑w).embedding).re, fun w => x (↑w).embedding)) (Sum.inr (w, ⟨0, ⋯⟩))) =
    ∑ x_1 : { w // w.IsReal },
        fromBlocks 1 0 0
            ((blockDiagonal fun x => of ![![2⁻¹, 2⁻¹], ![2⁻¹ * -I, 2⁻¹ * I]]).submatrix Prod.swap Prod.swap)
            (Sum.inr (w, ⟨0, ⋯⟩)) (Sum.inl x_1) *
          x (↑x_1).embedding +
      ∑ x_1 : { w // w.IsComplex },
        (fromBlocks 1 0 0
              ((blockDiagonal fun x => of ![![2⁻¹, 2⁻¹], ![2⁻¹ * -I, 2⁻¹ * I]]).submatrix Prod.swap Prod.swap)
              (Sum.inr (w, ⟨0, ⋯⟩)) (Sum.inr (x_1, 0)) *
            x (↑x_1).embedding +
          fromBlocks 1 0 0
              ((blockDiagonal fun x => of ![![2⁻¹, 2⁻¹], ![2⁻¹ * -I, 2⁻¹ * I]]).submatrix Prod.swap Prod.swap)
              (Sum.inr (w, ⟨0, ⋯⟩)) (Sum.inr (x_1, 1)) *
            x (ComplexEmbedding.conjugate (↑x_1).embedding))

case inr.mk.tail.head
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
x : (K →+* ℂ) → ℂ
hx : ∀ (φ : K →+* ℂ), (starRingEnd ℂ) (x φ) = x (ComplexEmbedding.conjugate φ)
w : { w // w.IsComplex }
⊢ ↑(((stdBasis K).repr (fun w => (x (↑w).embedding).re, fun w => x (↑w).embedding)) (Sum.inr (w, ⟨1, ⋯⟩))) =
    ∑ x_1 : { w // w.IsReal },
        fromBlocks 1 0 0
            ((blockDiagonal fun x => of ![![2⁻¹, 2⁻¹], ![2⁻¹ * -I, 2⁻¹ * I]]).submatrix Prod.swap Prod.swap)
            (Sum.inr (w, ⟨1, ⋯⟩)) (Sum.inl x_1) *
          x (↑x_1).embedding +
      ∑ x_1 : { w // w.IsComplex },
        (fromBlocks 1 0 0
              ((blockDiagonal fun x => of ![![2⁻¹, 2⁻¹], ![2⁻¹ * -I, 2⁻¹ * I]]).submatrix Prod.swap Prod.swap)
              (Sum.inr (w, ⟨1, ⋯⟩)) (Sum.inr (x_1, 0)) *
            x (↑x_1).embedding +
          fromBlocks 1 0 0
              ((blockDiagonal fun x => of ![![2⁻¹, 2⁻¹], ![2⁻¹ * -I, 2⁻¹ * I]]).submatrix Prod.swap Prod.swap)
              (Sum.inr (w, ⟨1, ⋯⟩)) (Sum.inr (x_1, 1)) *
            x (ComplexEmbedding.conjugate (↑x_1).embedding))

tactic: simp_rw [Fin.mk_zero, stdBasis_apply_ofIsComplex_fst, fromBlocks_apply₂₁,
  fromBlocks_apply₂₂, Matrix.zero_apply, submatrix_apply,
  blockDiagonal_apply, Prod.swap_prod_mk, ite_mul, zero_mul, sum_const_zero, zero_add,
  sum_add_distrib, sum_ite_eq, mem_univ, ite_true, of_apply, cons_val', cons_val_zero,
  cons_val_one, head_cons, ← hx (embedding w), re_eq_add_conj]
state_before: case inr.mk.head
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
x : (K →+* ℂ) → ℂ
hx : ∀ (φ : K →+* ℂ), (starRingEnd ℂ) (x φ) = x (ComplexEmbedding.conjugate φ)
w : { w // w.IsComplex }
⊢ ↑(((stdBasis K).repr (fun w => (x (↑w).embedding).re, fun w => x (↑w).embedding)) (Sum.inr (w, ⟨0, ⋯⟩))) =
    ∑ x_1 : { w // w.IsReal },
        fromBlocks 1 0 0
            ((blockDiagonal fun x => of ![![2⁻¹, 2⁻¹], ![2⁻¹ * -I, 2⁻¹ * I]]).submatrix Prod.swap Prod.swap)
            (Sum.inr (w, ⟨0, ⋯⟩)) (Sum.inl x_1) *
          x (↑x_1).embedding +
      ∑ x_1 : { w // w.IsComplex },
        (fromBlocks 1 0 0
              ((blockDiagonal fun x => of ![![2⁻¹, 2⁻¹], ![2⁻¹ * -I, 2⁻¹ * I]]).submatrix Prod.swap Prod.swap)
              (Sum.inr (w, ⟨0, ⋯⟩)) (Sum.inr (x_1, 0)) *
            x (↑x_1).embedding +
          fromBlocks 1 0 0
              ((blockDiagonal fun x => of ![![2⁻¹, 2⁻¹], ![2⁻¹ * -I, 2⁻¹ * I]]).submatrix Prod.swap Prod.swap)
              (Sum.inr (w, ⟨0, ⋯⟩)) (Sum.inr (x_1, 1)) *
            x (ComplexEmbedding.conjugate (↑x_1).embedding))
state_after: case inr.mk.head
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
x : (K →+* ℂ) → ℂ
hx : ∀ (φ : K →+* ℂ), (starRingEnd ℂ) (x φ) = x (ComplexEmbedding.conjugate φ)
w : { w // w.IsComplex }
⊢ (x (↑w).embedding + (starRingEnd ℂ) (x (↑w).embedding)) / 2 =
    2⁻¹ * x (↑w).embedding + 2⁻¹ * (starRingEnd ℂ) (x (↑w).embedding)

tactic: field_simp
state_before: case inr.mk.head
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
x : (K →+* ℂ) → ℂ
hx : ∀ (φ : K →+* ℂ), (starRingEnd ℂ) (x φ) = x (ComplexEmbedding.conjugate φ)
w : { w // w.IsComplex }
⊢ (x (↑w).embedding + (starRingEnd ℂ) (x (↑w).embedding)) / 2 =
    2⁻¹ * x (↑w).embedding + 2⁻¹ * (starRingEnd ℂ) (x (↑w).embedding)
state_after: no goals

tactic: simp_rw [Fin.mk_one, stdBasis_apply_ofIsComplex_snd, fromBlocks_apply₂₁,
  fromBlocks_apply₂₂, Matrix.zero_apply, submatrix_apply, blockDiagonal_apply,
  Prod.swap_prod_mk, ite_mul, zero_mul, sum_const_zero, zero_add, sum_add_distrib, sum_ite_eq,
  mem_univ, ite_true, of_apply, cons_val', cons_val_zero, cons_val_one, head_cons,
  ← hx (embedding w), im_eq_sub_conj]
state_before: case inr.mk.tail.head
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
x : (K →+* ℂ) → ℂ
hx : ∀ (φ : K →+* ℂ), (starRingEnd ℂ) (x φ) = x (ComplexEmbedding.conjugate φ)
w : { w // w.IsComplex }
⊢ ↑(((stdBasis K).repr (fun w => (x (↑w).embedding).re, fun w => x (↑w).embedding)) (Sum.inr (w, ⟨1, ⋯⟩))) =
    ∑ x_1 : { w // w.IsReal },
        fromBlocks 1 0 0
            ((blockDiagonal fun x => of ![![2⁻¹, 2⁻¹], ![2⁻¹ * -I, 2⁻¹ * I]]).submatrix Prod.swap Prod.swap)
            (Sum.inr (w, ⟨1, ⋯⟩)) (Sum.inl x_1) *
          x (↑x_1).embedding +
      ∑ x_1 : { w // w.IsComplex },
        (fromBlocks 1 0 0
              ((blockDiagonal fun x => of ![![2⁻¹, 2⁻¹], ![2⁻¹ * -I, 2⁻¹ * I]]).submatrix Prod.swap Prod.swap)
              (Sum.inr (w, ⟨1, ⋯⟩)) (Sum.inr (x_1, 0)) *
            x (↑x_1).embedding +
          fromBlocks 1 0 0
              ((blockDiagonal fun x => of ![![2⁻¹, 2⁻¹], ![2⁻¹ * -I, 2⁻¹ * I]]).submatrix Prod.swap Prod.swap)
              (Sum.inr (w, ⟨1, ⋯⟩)) (Sum.inr (x_1, 1)) *
            x (ComplexEmbedding.conjugate (↑x_1).embedding))
state_after: case inr.mk.tail.head
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
x : (K →+* ℂ) → ℂ
hx : ∀ (φ : K →+* ℂ), (starRingEnd ℂ) (x φ) = x (ComplexEmbedding.conjugate φ)
w : { w // w.IsComplex }
⊢ (x (↑w).embedding - (starRingEnd ℂ) (x (↑w).embedding)) / (2 * I) =
    2⁻¹ * -I * x (↑w).embedding + 2⁻¹ * I * (starRingEnd ℂ) (x (↑w).embedding)

tactic: ring_nf
state_before: case inr.mk.tail.head
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
x : (K →+* ℂ) → ℂ
hx : ∀ (φ : K →+* ℂ), (starRingEnd ℂ) (x φ) = x (ComplexEmbedding.conjugate φ)
w : { w // w.IsComplex }
⊢ (x (↑w).embedding - (starRingEnd ℂ) (x (↑w).embedding)) / (2 * I) =
    2⁻¹ * -I * x (↑w).embedding + 2⁻¹ * I * (starRingEnd ℂ) (x (↑w).embedding)
state_after: case inr.mk.tail.head
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
x : (K →+* ℂ) → ℂ
hx : ∀ (φ : K →+* ℂ), (starRingEnd ℂ) (x φ) = x (ComplexEmbedding.conjugate φ)
w : { w // w.IsComplex }
⊢ x (↑w).embedding * I⁻¹ * (1 / 2) + (starRingEnd ℂ) (x (↑w).embedding) * I⁻¹ * (-1 / 2) =
    x (↑w).embedding * I * (-1 / 2) + (starRingEnd ℂ) (x (↑w).embedding) * I * (1 / 2)

tactic: field_simp
state_before: case inr.mk.tail.head
K : Type u_1
inst✝¹ : Field K
inst✝ : NumberField K
x : (K →+* ℂ) → ℂ
hx : ∀ (φ : K →+* ℂ), (starRingEnd ℂ) (x φ) = x (ComplexEmbedding.conjugate φ)
w : { w // w.IsComplex }
⊢ x (↑w).embedding * I⁻¹ * (1 / 2) + (starRingEnd ℂ) (x (↑w).embedding) * I⁻¹ * (-1 / 2) =
    x (↑w).embedding * I * (-1 / 2) + (starRingEnd ℂ) (x (↑w).embedding) * I * (1 / 2)
state_after: no goals