-- Mathlib/RingTheory/Trace/Defs.lean
theorem trace_prod_apply [Module.Free R S] [Module.Free R T] [Module.Finite R S] [Module.Finite R T]
    (x : S × T) : trace R (S × T) x = trace R S x.fst + trace R T x.snd

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁸ : CommRing R
inst✝⁷ : CommRing S
inst✝⁶ : CommRing T
inst✝⁵ : Algebra R S
inst✝⁴ : Algebra R T
inst✝³ : Free R S
inst✝² : Free R T
inst✝¹ : Module.Finite R S
inst✝ : Module.Finite R T
x : S × T
a✝ : Nontrivial R
⊢ (trace R (S × T)) x = (trace R S) x.1 + (trace R T) x.2

Tactic:
let f := (lmul R S).toLinearMap.prodMap (lmul R T).toLinearMap

Result:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁸ : CommRing R
inst✝⁷ : CommRing S
inst✝⁶ : CommRing T
inst✝⁵ : Algebra R S
inst✝⁴ : Algebra R T
inst✝³ : Free R S
inst✝² : Free R T
inst✝¹ : Module.Finite R S
inst✝ : Module.Finite R T
x : S × T
a✝ : Nontrivial R
f : S × T →ₗ[R] End R S × End R T := (lmul R S).toLinearMap.prodMap (lmul R T).toLinearMap
⊢ (trace R (S × T)) x = (trace R S) x.1 + (trace R T) x.2

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁸ : CommRing R
inst✝⁷ : CommRing S
inst✝⁶ : CommRing T
inst✝⁵ : Algebra R S
inst✝⁴ : Algebra R T
inst✝³ : Free R S
inst✝² : Free R T
inst✝¹ : Module.Finite R S
inst✝ : Module.Finite R T
x : S × T
⊢ (trace R (S × T)) x = (trace R S) x.1 + (trace R T) x.2

Tactic:
nontriviality R

Result:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁸ : CommRing R
inst✝⁷ : CommRing S
inst✝⁶ : CommRing T
inst✝⁵ : Algebra R S
inst✝⁴ : Algebra R T
inst✝³ : Free R S
inst✝² : Free R T
inst✝¹ : Module.Finite R S
inst✝ : Module.Finite R T
x : S × T
a✝ : Nontrivial R
⊢ (trace R (S × T)) x = (trace R S) x.1 + (trace R T) x.2

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁸ : CommRing R
inst✝⁷ : CommRing S
inst✝⁶ : CommRing T
inst✝⁵ : Algebra R S
inst✝⁴ : Algebra R T
inst✝³ : Free R S
inst✝² : Free R T
inst✝¹ : Module.Finite R S
inst✝ : Module.Finite R T
x : S × T
a✝ : Nontrivial R
f : S × T →ₗ[R] End R S × End R T := (lmul R S).toLinearMap.prodMap (lmul R T).toLinearMap
⊢ (trace R (S × T)) x = (trace R S) x.1 + (trace R T) x.2

Tactic:
have : (lmul R (S × T)).toLinearMap = (prodMapLinear R S T S T R).comp f :=
  LinearMap.ext₂ Prod.mul_def

Result:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁸ : CommRing R
inst✝⁷ : CommRing S
inst✝⁶ : CommRing T
inst✝⁵ : Algebra R S
inst✝⁴ : Algebra R T
inst✝³ : Free R S
inst✝² : Free R T
inst✝¹ : Module.Finite R S
inst✝ : Module.Finite R T
x : S × T
a✝ : Nontrivial R
f : S × T →ₗ[R] End R S × End R T := (lmul R S).toLinearMap.prodMap (lmul R T).toLinearMap
this : (lmul R (S × T)).toLinearMap = prodMapLinear R S T S T R ∘ₗ f
⊢ (trace R (S × T)) x = (trace R S) x.1 + (trace R T) x.2

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁸ : CommRing R
inst✝⁷ : CommRing S
inst✝⁶ : CommRing T
inst✝⁵ : Algebra R S
inst✝⁴ : Algebra R T
inst✝³ : Free R S
inst✝² : Free R T
inst✝¹ : Module.Finite R S
inst✝ : Module.Finite R T
x : S × T
a✝ : Nontrivial R
f : S × T →ₗ[R] End R S × End R T := (lmul R S).toLinearMap.prodMap (lmul R T).toLinearMap
this : (lmul R (S × T)).toLinearMap = prodMapLinear R S T S T R ∘ₗ f
⊢ (LinearMap.trace R (S × T) ∘ₗ prodMapLinear R S T S T R ∘ₗ f) x =
    (LinearMap.trace R S ∘ₗ (lmul R S).toLinearMap) x.1 + (LinearMap.trace R T ∘ₗ (lmul R T).toLinearMap) x.2

Tactic:
exact trace_prodMap' _ _

Result:
no goals

Proof state:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁸ : CommRing R
inst✝⁷ : CommRing S
inst✝⁶ : CommRing T
inst✝⁵ : Algebra R S
inst✝⁴ : Algebra R T
inst✝³ : Free R S
inst✝² : Free R T
inst✝¹ : Module.Finite R S
inst✝ : Module.Finite R T
x : S × T
a✝ : Nontrivial R
f : S × T →ₗ[R] End R S × End R T := (lmul R S).toLinearMap.prodMap (lmul R T).toLinearMap
this : (lmul R (S × T)).toLinearMap = prodMapLinear R S T S T R ∘ₗ f
⊢ (trace R (S × T)) x = (trace R S) x.1 + (trace R T) x.2

Tactic:
simp_rw [trace, this]

Result:
R : Type u_1
S : Type u_2
T : Type u_3
inst✝⁸ : CommRing R
inst✝⁷ : CommRing S
inst✝⁶ : CommRing T
inst✝⁵ : Algebra R S
inst✝⁴ : Algebra R T
inst✝³ : Free R S
inst✝² : Free R T
inst✝¹ : Module.Finite R S
inst✝ : Module.Finite R T
x : S × T
a✝ : Nontrivial R
f : S × T →ₗ[R] End R S × End R T := (lmul R S).toLinearMap.prodMap (lmul R T).toLinearMap
this : (lmul R (S × T)).toLinearMap = prodMapLinear R S T S T R ∘ₗ f
⊢ (LinearMap.trace R (S × T) ∘ₗ prodMapLinear R S T S T R ∘ₗ f) x =
    (LinearMap.trace R S ∘ₗ (lmul R S).toLinearMap) x.1 + (LinearMap.trace R T ∘ₗ (lmul R T).toLinearMap) x.2