Theorem: Matrix.dualNumberEquiv_apply
File: Mathlib/Data/Matrix/DualNumber.lean

Proof steps:
state_before: R n : Type
inst✝² : CommSemiring R
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A B : Matrix n n (DualNumber R)
⊢ { toFun := fun A => (of fun i j => fst (A i j), of fun i j => snd (A i j)),
          invFun := fun d => of fun i j => (fst d i j, snd d i j), left_inv := ⋯, right_inv := ⋯ }.toFun
      (A * B) =
    { toFun := fun A => (of fun i j => fst (A i j), of fun i j => snd (A i j)),
            invFun := fun d => of fun i j => (fst d i j, snd d i j), left_inv := ⋯, right_inv := ⋯ }.toFun
        A *
      { toFun := fun A => (of fun i j => fst (A i j), of fun i j => snd (A i j)),
            invFun := fun d => of fun i j => (fst d i j, snd d i j), left_inv := ⋯, right_inv := ⋯ }.toFun
        B
state_after: case h1.a
R n : Type
inst✝² : CommSemiring R
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A B : Matrix n n (DualNumber R)
i✝ j✝ : n
⊢ fst
      ({ toFun := fun A => (of fun i j => fst (A i j), of fun i j => snd (A i j)),
            invFun := fun d => of fun i j => (fst d i j, snd d i j), left_inv := ⋯, right_inv := ⋯ }.toFun
        (A * B))
      i✝ j✝ =
    fst
      ({ toFun := fun A => (of fun i j => fst (A i j), of fun i j => snd (A i j)),
              invFun := fun d => of fun i j => (fst d i j, snd d i j), left_inv := ⋯, right_inv := ⋯ }.toFun
          A *
        { toFun := fun A => (of fun i j => fst (A i j), of fun i j => snd (A i j)),
              invFun := fun d => of fun i j => (fst d i j, snd d i j), left_inv := ⋯, right_inv := ⋯ }.toFun
          B)
      i✝ j✝

case h2.a
R n : Type
inst✝² : CommSemiring R
inst✝¹ : Fintype n
inst✝ : DecidableEq n
A B : Matrix n n (DualNumber R)
i✝ j✝ : n
⊢ snd
      ({ toFun := fun A => (of fun i j => fst (A i j), of fun i j => snd (A i j)),
            invFun := fun d => of fun i j => (fst d i j, snd d i j), left_inv := ⋯, right_inv := ⋯ }.toFun
        (A * B))
      i✝ j✝ =
    snd
      ({ toFun := fun A => (of fun i j => fst (A i j), of fun i j => snd (A i j)),
              invFun := fun d => of fun i j => (fst d i j, snd d i j), left_inv := ⋯, right_inv := ⋯ }.toFun
          A *
        { toFun := fun A => (of fun i j => fst (A i j), of fun i j => snd (A i j)),
              invFun := fun d => of fun i j => (fst d i j, snd d i j), left_inv := ⋯, right_inv := ⋯ }.toFun
          B)
      i✝ j✝
tactic: ext
state_before: R n : Type
inst✝² : CommSemiring R
inst✝¹ : Fintype n
inst✝ : DecidableEq n
r : R
⊢ { toFun := fun A => (of fun i j => fst (A i j), of fun i j => snd (A i j)),
          invFun := fun d => of fun i j => (fst d i j, snd d i j), left_inv := ⋯, right_inv := ⋯ }.toFun
      ((algebraMap R (Matrix n n (DualNumber R))) r) =
    (algebraMap R (DualNumber (Matrix n n R))) r
state_after: R n : Type
inst✝² : CommSemiring R
inst✝¹ : Fintype n
inst✝ : DecidableEq n
r : R
⊢ (of fun i j => diagonal (fun m => r) i j, of fun i j => 0) = inl (diagonal fun m => r)
tactic: simp_rw [algebraMap_eq_inl', algebraMap_eq_diagonal, Pi.algebraMap_def,
      Algebra.id.map_eq_self, algebraMap_eq_inl, ← diagonal_map (inl_zero R), map_apply, fst_inl,
      snd_inl]
state_before: R n : Type
inst✝² : CommSemiring R
inst✝¹ : Fintype n
inst✝ : DecidableEq n
r : R
⊢ (of fun i j => diagonal (fun m => r) i j, of fun i j => 0) = inl (diagonal fun m => r)
state_after: no goals
tactic: rfl