-- Module: Mathlib.LinearAlgebra.Charpoly.Basic
Goal:
R : Type u
M : Type v
inst : CommRing R
inst_1 : AddCommGroup M
inst_2 : Module R M
inst_3 : Module.Free R M
inst_4 : Module.Finite R M
f : M →ₗ[R] M
t : R
rw :
  eval t
      (Matrix.charpoly.{u, v} (n := ChooseBasisIndex R M)
        ((toMatrix (chooseBasis R M) (chooseBasis R M) :
            (a : M →ₗ[R] M) → Matrix (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)
          f)) =
    (LinearMap.det : (a : M →ₗ[R] M) → R)
      (HSub.hSub (α := M →ₗ[R] M) ((algebraMap R (M →ₗ[R] M) : (a : R) → M →ₗ[R] M) t : M →ₗ[R] M) f)
rw₁ :
  (HSub.hSub (α := Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R) (β :=
        Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)
        ((scalar (ChooseBasisIndex R M) : (a : R) → Matrix (ChooseBasisIndex R M) (ChooseBasisIndex R M) R) t :
          Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)
        ((toMatrix (chooseBasis R M) (chooseBasis R M) :
              (a : M →ₗ[R] M) → Matrix (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)
            f :
          Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)).det =
    (LinearMap.det : (a : M →ₗ[R] M) → R)
      (HSub.hSub (α := M →ₗ[R] M) ((algebraMap R (M →ₗ[R] M) : (a : R) → M →ₗ[R] M) t : M →ₗ[R] M) f)
rw₂ :
  (HSub.hSub (α := Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R) (β :=
        Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)
        ((scalar (ChooseBasisIndex R M) : (a : R) → Matrix (ChooseBasisIndex R M) (ChooseBasisIndex R M) R) t :
          Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)
        ((toMatrix (chooseBasis R M) (chooseBasis R M) :
              (a : M →ₗ[R] M) → Matrix (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)
            f :
          Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)).det =
    det.{u, v} (n := ChooseBasisIndex R M)
      ((toMatrix (chooseBasis R M) (chooseBasis R M) :
          (a : M →ₗ[R] M) → Matrix (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)
        (HSub.hSub (α := M →ₗ[R] M) ((algebraMap R (M →ₗ[R] M) : (a : R) → M →ₗ[R] M) t : M →ₗ[R] M) f))
rw₃ :
  (HSub.hSub (α := Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R) (β :=
        Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)
        ((scalar (ChooseBasisIndex R M) : (a : R) → Matrix (ChooseBasisIndex R M) (ChooseBasisIndex R M) R) t :
          Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)
        ((toMatrix (chooseBasis R M) (chooseBasis R M) :
              (a : M →ₗ[R] M) → Matrix (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)
            f :
          Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)).det =
    (HSub.hSub (α := Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R) (β :=
        Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)
        ((toMatrix (chooseBasis R M) (chooseBasis R M) :
              (a : M →ₗ[R] M) → Matrix (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)
            ((algebraMap R (M →ₗ[R] M) : (a : R) → M →ₗ[R] M) t) :
          Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)
        ((toMatrix (chooseBasis R M) (chooseBasis R M) :
              (a : M →ₗ[R] M) → Matrix (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)
            f :
          Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)).det
rw₄ :
  (HSub.hSub (α := Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R) (β :=
        Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R) (diagonal fun (x : ChooseBasisIndex R M) ↦ t)
        ((toMatrix (chooseBasis R M) (chooseBasis R M) :
              (a : M →ₗ[R] M) → Matrix (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)
            f :
          Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)).det =
    (HSub.hSub (α := Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R) (β :=
        Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)
        ((toMatrix (chooseBasis R M) (chooseBasis R M) :
              (a : M →ₗ[R] M) → Matrix (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)
            ((algebraMap R (M →ₗ[R] M) : (a : R) → M →ₗ[R] M) t) :
          Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)
        ((toMatrix (chooseBasis R M) (chooseBasis R M) :
              (a : M →ₗ[R] M) → Matrix (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)
            f :
          Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)).det
rw₅ :
  (HSub.hSub (α := Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R) (β :=
        Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R) (diagonal fun (x : ChooseBasisIndex R M) ↦ t)
        ((toMatrix (chooseBasis R M) (chooseBasis R M) :
              (a : M →ₗ[R] M) → Matrix (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)
            f :
          Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)).det =
    (HSub.hSub (α := Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R) (β :=
        Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)
        ((scalar (ChooseBasisIndex R M) : (a : R) → Matrix (ChooseBasisIndex R M) (ChooseBasisIndex R M) R) t :
          Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)
        ((toMatrix (chooseBasis R M) (chooseBasis R M) :
              (a : M →ₗ[R] M) → Matrix (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)
            f :
          Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)).det
rw₆ rw₇ :
  (HSub.hSub (α := Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R) (β :=
        Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R) (diagonal fun (x : ChooseBasisIndex R M) ↦ t)
        ((toMatrix (chooseBasis R M) (chooseBasis R M) :
              (a : M →ₗ[R] M) → Matrix (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)
            f :
          Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)).det =
    (HSub.hSub (α := Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R) (β :=
        Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R) (diagonal fun (x : ChooseBasisIndex R M) ↦ t)
        ((toMatrix (chooseBasis R M) (chooseBasis R M) :
              (a : M →ₗ[R] M) → Matrix (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)
            f :
          Matrix.{v, v, u} (ChooseBasisIndex R M) (ChooseBasisIndex R M) R)).det
⊢ eval t f.charpoly =
    (LinearMap.det : (a : M →ₗ[R] M) → R)
      (HSub.hSub (α := M →ₗ[R] M) ((algebraMap R (M →ₗ[R] M) : (a : R) → M →ₗ[R] M) t : M →ₗ[R] M) f)

Tactic:
rw [charpoly, Matrix.eval_charpoly, ← LinearMap.det_toMatrix (chooseBasis R M), map_sub,
    scalar_apply, toMatrix_algebraMap, scalar_apply]

Premises used: map_sub, LinearMap.toMatrix_algebraMap, Matrix.eval_charpoly, Matrix.scalar_apply, LinearMap.charpoly, LinearMap.det_toMatrix, Module.Free.chooseBasis