Theorem: MatrixEquivTensor.right_inv
File: Mathlib/RingTheory/MatrixAlgebra.lean

Proof steps:
state_before: R : Type u
inst✝⁴ : CommSemiring R
A : Type v
inst✝³ : Semiring A
inst✝² : Algebra R A
n : Type w
inst✝¹ : DecidableEq n
inst✝ : Fintype n
M : Matrix n n A
⊢ (toFunAlgHom R A n) (invFun R A n M) = M
state_after: R : Type u
inst✝⁴ : CommSemiring R
A : Type v
inst✝³ : Semiring A
inst✝² : Algebra R A
n : Type w
inst✝¹ : DecidableEq n
inst✝ : Fintype n
M : Matrix n n A
⊢ ∑ x : n × n, M x.1 x.2 • (stdBasisMatrix x.1 x.2 1).map ⇑(algebraMap R A) = M
tactic: simp only [invFun, map_sum, stdBasisMatrix, apply_ite ↑(algebraMap R A), smul_eq_mul,
    mul_boole, toFunAlgHom_apply, RingHom.map_zero, RingHom.map_one, Matrix.map_apply,
    Pi.smul_def]
state_before: R : Type u
inst✝⁴ : CommSemiring R
A : Type v
inst✝³ : Semiring A
inst✝² : Algebra R A
n : Type w
inst✝¹ : DecidableEq n
inst✝ : Fintype n
M : Matrix n n A
⊢ ∑ x : n × n, M x.1 x.2 • (stdBasisMatrix x.1 x.2 1).map ⇑(algebraMap R A) = M
state_after: case h.e'_3
R : Type u
inst✝⁴ : CommSemiring R
A : Type v
inst✝³ : Semiring A
inst✝² : Algebra R A
n : Type w
inst✝¹ : DecidableEq n
inst✝ : Fintype n
M : Matrix n n A
⊢ M = ∑ x : n, ∑ y : n, M (x, y).1 (x, y).2 • (stdBasisMatrix (x, y).1 (x, y).2 1).map ⇑(algebraMap R A)
tactic: convert Finset.sum_product (β := Matrix n n A)
state_before: case h.e'_3
R : Type u
inst✝⁴ : CommSemiring R
A : Type v
inst✝³ : Semiring A
inst✝² : Algebra R A
n : Type w
inst✝¹ : DecidableEq n
inst✝ : Fintype n
M : Matrix n n A
⊢ M = ∑ x : n, ∑ y : n, M (x, y).1 (x, y).2 • (stdBasisMatrix (x, y).1 (x, y).2 1).map ⇑(algebraMap R A)
state_after: case h.e'_3
R : Type u
inst✝⁴ : CommSemiring R
A : Type v
inst✝³ : Semiring A
inst✝² : Algebra R A
n : Type w
inst✝¹ : DecidableEq n
inst✝ : Fintype n
M : Matrix n n A
⊢ ∑ i : n, ∑ j : n, stdBasisMatrix i j (M i j) =
    ∑ x : n, ∑ y : n, M (x, y).1 (x, y).2 • (stdBasisMatrix (x, y).1 (x, y).2 1).map ⇑(algebraMap R A)
tactic: conv_lhs => rw [matrix_eq_sum_std_basis M]
state_before: case h.e'_3
R : Type u
inst✝⁴ : CommSemiring R
A : Type v
inst✝³ : Semiring A
inst✝² : Algebra R A
n : Type w
inst✝¹ : DecidableEq n
inst✝ : Fintype n
M : Matrix n n A
⊢ ∑ i : n, ∑ j : n, stdBasisMatrix i j (M i j) =
    ∑ x : n, ∑ y : n, M (x, y).1 (x, y).2 • (stdBasisMatrix (x, y).1 (x, y).2 1).map ⇑(algebraMap R A)
state_after: case h.e'_3
R : Type u
inst✝⁴ : CommSemiring R
A : Type v
inst✝³ : Semiring A
inst✝² : Algebra R A
n : Type w
inst✝¹ : DecidableEq n
inst✝ : Fintype n
M : Matrix n n A
i : n
x✝¹ : i ∈ Finset.univ
j : n
x✝ : j ∈ Finset.univ
a b : n
⊢ stdBasisMatrix i j (M i j) a b =
    (M (i, j).1 (i, j).2 • (stdBasisMatrix (i, j).1 (i, j).2 1).map ⇑(algebraMap R A)) a b
tactic: refine Finset.sum_congr rfl fun i _ => Finset.sum_congr rfl fun j _ => Matrix.ext fun a b => ?_
state_before: case h.e'_3
R : Type u
inst✝⁴ : CommSemiring R
A : Type v
inst✝³ : Semiring A
inst✝² : Algebra R A
n : Type w
inst✝¹ : DecidableEq n
inst✝ : Fintype n
M : Matrix n n A
i : n
x✝¹ : i ∈ Finset.univ
j : n
x✝ : j ∈ Finset.univ
a b : n
⊢ stdBasisMatrix i j (M i j) a b =
    (M (i, j).1 (i, j).2 • (stdBasisMatrix (i, j).1 (i, j).2 1).map ⇑(algebraMap R A)) a b
state_after: case h.e'_3
R : Type u
inst✝⁴ : CommSemiring R
A : Type v
inst✝³ : Semiring A
inst✝² : Algebra R A
n : Type w
inst✝¹ : DecidableEq n
inst✝ : Fintype n
M : Matrix n n A
i : n
x✝¹ : i ∈ Finset.univ
j : n
x✝ : j ∈ Finset.univ
a b : n
⊢ (if i = a ∧ j = b then M i j else 0) = M i j • (algebraMap R A) (if i = a ∧ j = b then 1 else 0)
tactic: simp only [stdBasisMatrix, smul_apply, Matrix.map_apply]
state_before: case h.e'_3
R : Type u
inst✝⁴ : CommSemiring R
A : Type v
inst✝³ : Semiring A
inst✝² : Algebra R A
n : Type w
inst✝¹ : DecidableEq n
inst✝ : Fintype n
M : Matrix n n A
i : n
x✝¹ : i ∈ Finset.univ
j : n
x✝ : j ∈ Finset.univ
a b : n
⊢ (if i = a ∧ j = b then M i j else 0) = M i j • (algebraMap R A) (if i = a ∧ j = b then 1 else 0)
state_after: no goals
tactic: split_ifs <;> aesop