Theorem: Algebra.FormallyUnramified.finite_of_free_aux
File: Mathlib/RingTheory/Unramified/Finite.lean

Proof steps:
state_before: R S : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
M : Type u_1
inst✝⁶ : AddCommGroup M
inst✝⁵ : Module R M
inst✝⁴ : Module S M
inst✝³ : IsScalarTower R S M
inst✝² : FormallyUnramified R S
inst✝¹ : EssFiniteType R S
I : Type u_2
inst✝ : DecidableEq I
b : Basis I R S
f : I →₀ S
x : S
a : I → I →₀ R
ha : a = fun i => b.repr (b i * x)
⊢ (1 ⊗ₜ[R] x * f.sum fun i y => y ⊗ₜ[R] b i) =
    ∑ k ∈ f.support.biUnion fun i => (a i).support,
      (b.repr (f.sum fun i y => (a i) k • y)).sum fun j c => c • b j ⊗ₜ[R] b k
state_after: R S : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
M : Type u_1
inst✝⁶ : AddCommGroup M
inst✝⁵ : Module R M
inst✝⁴ : Module S M
inst✝³ : IsScalarTower R S M
inst✝² : FormallyUnramified R S
inst✝¹ : EssFiniteType R S
I : Type u_2
inst✝ : DecidableEq I
b : Basis I R S
f : I →₀ S
x : S
a : I → I →₀ R
ha : a = fun i => b.repr (b i * x)
⊢ ∑ i ∈ f.support, 1 ⊗ₜ[R] x * f i ⊗ₜ[R] b i =
    ∑ k ∈ f.support.biUnion fun i => (a i).support,
      (b.repr (f.sum fun i y => (a i) k • y)).sum fun j c => c • b j ⊗ₜ[R] b k
tactic: rw [Finsupp.sum, Finset.mul_sum]
state_before: R S : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
M : Type u_1
inst✝⁶ : AddCommGroup M
inst✝⁵ : Module R M
inst✝⁴ : Module S M
inst✝³ : IsScalarTower R S M
inst✝² : FormallyUnramified R S
inst✝¹ : EssFiniteType R S
I : Type u_2
inst✝ : DecidableEq I
b : Basis I R S
f : I →₀ S
x : S
a : I → I →₀ R
ha : a = fun i => b.repr (b i * x)
⊢ ∑ i ∈ f.support, 1 ⊗ₜ[R] x * f i ⊗ₜ[R] b i =
    ∑ k ∈ f.support.biUnion fun i => (a i).support,
      (b.repr (f.sum fun i y => (a i) k • y)).sum fun j c => c • b j ⊗ₜ[R] b k
state_after: R S : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
M : Type u_1
inst✝⁶ : AddCommGroup M
inst✝⁵ : Module R M
inst✝⁴ : Module S M
inst✝³ : IsScalarTower R S M
inst✝² : FormallyUnramified R S
inst✝¹ : EssFiniteType R S
I : Type u_2
inst✝ : DecidableEq I
b : Basis I R S
f : I →₀ S
x : S
⊢ ∑ i ∈ f.support, 1 ⊗ₜ[R] x * f i ⊗ₜ[R] b i =
    ∑ k ∈ f.support.biUnion fun i => ((fun i => b.repr (b i * x)) i).support,
      (b.repr (f.sum fun i y => ((fun i => b.repr (b i * x)) i) k • y)).sum fun j c => c • b j ⊗ₜ[R] b k
tactic: subst ha
state_before: R S : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
M : Type u_1
inst✝⁶ : AddCommGroup M
inst✝⁵ : Module R M
inst✝⁴ : Module S M
inst✝³ : IsScalarTower R S M
inst✝² : FormallyUnramified R S
inst✝¹ : EssFiniteType R S
I : Type u_2
inst✝ : DecidableEq I
b : Basis I R S
f : I →₀ S
x : S
⊢ ∑ i ∈ f.support, 1 ⊗ₜ[R] x * f i ⊗ₜ[R] b i =
    ∑ k ∈ f.support.biUnion fun i => ((fun i => b.repr (b i * x)) i).support,
      (b.repr (f.sum fun i y => ((fun i => b.repr (b i * x)) i) k • y)).sum fun j c => c • b j ⊗ₜ[R] b k
state_after: R S : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
M : Type u_1
inst✝⁶ : AddCommGroup M
inst✝⁵ : Module R M
inst✝⁴ : Module S M
inst✝³ : IsScalarTower R S M
inst✝² : FormallyUnramified R S
inst✝¹ : EssFiniteType R S
I : Type u_2
inst✝ : DecidableEq I
b : Basis I R S
f : I →₀ S
x : S
a : I → I →₀ R := fun i => b.repr (b i * x)
⊢ ∑ i ∈ f.support, 1 ⊗ₜ[R] x * f i ⊗ₜ[R] b i =
    ∑ k ∈ f.support.biUnion fun i => ((fun i => b.repr (b i * x)) i).support,
      (b.repr (f.sum fun i y => ((fun i => b.repr (b i * x)) i) k • y)).sum fun j c => c • b j ⊗ₜ[R] b k
tactic: let a i := b.repr (b i * x)
state_before: R S : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
M : Type u_1
inst✝⁶ : AddCommGroup M
inst✝⁵ : Module R M
inst✝⁴ : Module S M
inst✝³ : IsScalarTower R S M
inst✝² : FormallyUnramified R S
inst✝¹ : EssFiniteType R S
I : Type u_2
inst✝ : DecidableEq I
b : Basis I R S
f : I →₀ S
x : S
a : I → I →₀ R := fun i => b.repr (b i * x)
⊢ ∑ i ∈ f.support, 1 ⊗ₜ[R] x * f i ⊗ₜ[R] b i =
    ∑ k ∈ f.support.biUnion fun i => ((fun i => b.repr (b i * x)) i).support,
      (b.repr (f.sum fun i y => ((fun i => b.repr (b i * x)) i) k • y)).sum fun j c => c • b j ⊗ₜ[R] b k
state_after: R S : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
M : Type u_1
inst✝⁶ : AddCommGroup M
inst✝⁵ : Module R M
inst✝⁴ : Module S M
inst✝³ : IsScalarTower R S M
inst✝² : FormallyUnramified R S
inst✝¹ : EssFiniteType R S
I : Type u_2
inst✝ : DecidableEq I
b : Basis I R S
f : I →₀ S
x : S
a : I → I →₀ R := fun i => b.repr (b i * x)
⊢ ∑ i ∈ f.support, f i ⊗ₜ[R] (Finsupp.total I S R ⇑b) (a i) =
    ∑ k ∈ f.support.biUnion fun i => ((fun i => b.repr (b i * x)) i).support,
      (b.repr (f.sum fun i y => ((fun i => b.repr (b i * x)) i) k • y)).sum fun j c => c • b j ⊗ₜ[R] b k
tactic: conv_lhs =>
    simp only [TensorProduct.tmul_mul_tmul, one_mul, mul_comm x (b _),
      ← show ∀ i, Finsupp.total _ _ _ b (a i) = b i * x from fun _ ↦ b.total_repr _]
state_before: R S : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
M : Type u_1
inst✝⁶ : AddCommGroup M
inst✝⁵ : Module R M
inst✝⁴ : Module S M
inst✝³ : IsScalarTower R S M
inst✝² : FormallyUnramified R S
inst✝¹ : EssFiniteType R S
I : Type u_2
inst✝ : DecidableEq I
b : Basis I R S
f : I →₀ S
x : S
a : I → I →₀ R := fun i => b.repr (b i * x)
⊢ ∑ i ∈ f.support, f i ⊗ₜ[R] (Finsupp.total I S R ⇑b) (a i) =
    ∑ k ∈ f.support.biUnion fun i => ((fun i => b.repr (b i * x)) i).support,
      (b.repr (f.sum fun i y => ((fun i => b.repr (b i * x)) i) k • y)).sum fun j c => c • b j ⊗ₜ[R] b k
state_after: R S : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
M : Type u_1
inst✝⁶ : AddCommGroup M
inst✝⁵ : Module R M
inst✝⁴ : Module S M
inst✝³ : IsScalarTower R S M
inst✝² : FormallyUnramified R S
inst✝¹ : EssFiniteType R S
I : Type u_2
inst✝ : DecidableEq I
b : Basis I R S
f : I →₀ S
x : S
a : I → I →₀ R := fun i => b.repr (b i * x)
⊢ ∑ x ∈ f.support, ∑ x_1 ∈ (a x).support, ((a x) x_1 • f x) ⊗ₜ[R] b x_1 =
    ∑ k ∈ f.support.biUnion fun i => ((fun i => b.repr (b i * x)) i).support,
      (b.repr (f.sum fun i y => ((fun i => b.repr (b i * x)) i) k • y)).sum fun j c => c • b j ⊗ₜ[R] b k
tactic: conv_lhs => simp only [Finsupp.total, Finsupp.coe_lsum,
    LinearMap.coe_smulRight, LinearMap.id_coe, id_eq, Finsupp.sum, TensorProduct.tmul_sum,
    ← TensorProduct.smul_tmul]
state_before: R S : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
M : Type u_1
inst✝⁶ : AddCommGroup M
inst✝⁵ : Module R M
inst✝⁴ : Module S M
inst✝³ : IsScalarTower R S M
inst✝² : FormallyUnramified R S
inst✝¹ : EssFiniteType R S
I : Type u_2
inst✝ : DecidableEq I
b : Basis I R S
f : I →₀ S
x : S
a : I → I →₀ R := fun i => b.repr (b i * x)
h₁ :
  ∀ (k : I),
    ((f.sum fun i y => (a i) k • b.repr y).sum fun j z => z • b j ⊗ₜ[R] b k) =
      f.sum fun i y => (b.repr y).sum fun j z => (a i) k • z • b j ⊗ₜ[R] b k
⊢ ∑ x ∈ f.support, ∑ x_1 ∈ (a x).support, ((a x) x_1 • f x) ⊗ₜ[R] b x_1 =
    ∑ k ∈ f.support.biUnion fun i => ((fun i => b.repr (b i * x)) i).support,
      (b.repr (f.sum fun i y => ((fun i => b.repr (b i * x)) i) k • y)).sum fun j c => c • b j ⊗ₜ[R] b k
state_after: R S : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
M : Type u_1
inst✝⁶ : AddCommGroup M
inst✝⁵ : Module R M
inst✝⁴ : Module S M
inst✝³ : IsScalarTower R S M
inst✝² : FormallyUnramified R S
inst✝¹ : EssFiniteType R S
I : Type u_2
inst✝ : DecidableEq I
b : Basis I R S
f : I →₀ S
x : S
a : I → I →₀ R := fun i => b.repr (b i * x)
h₁ :
  ∀ (k : I),
    ((f.sum fun i y => (a i) k • b.repr y).sum fun j z => z • b j ⊗ₜ[R] b k) =
      f.sum fun i y => (b.repr y).sum fun j z => (a i) k • z • b j ⊗ₜ[R] b k
h₂ : ∀ (x : S), ∑ a ∈ (b.repr x).support, (b.repr x) a • b a = x
⊢ ∑ x ∈ f.support, ∑ x_1 ∈ (a x).support, ((a x) x_1 • f x) ⊗ₜ[R] b x_1 =
    ∑ k ∈ f.support.biUnion fun i => ((fun i => b.repr (b i * x)) i).support,
      (b.repr (f.sum fun i y => ((fun i => b.repr (b i * x)) i) k • y)).sum fun j c => c • b j ⊗ₜ[R] b k
tactic: have h₂ : ∀ (x : S), ((b.repr x).support.sum fun a ↦ b.repr x a • b a) = x := by
    simpa only [Finsupp.total_apply, Finsupp.sum] using b.total_repr
state_before: R S : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
M : Type u_1
inst✝⁶ : AddCommGroup M
inst✝⁵ : Module R M
inst✝⁴ : Module S M
inst✝³ : IsScalarTower R S M
inst✝² : FormallyUnramified R S
inst✝¹ : EssFiniteType R S
I : Type u_2
inst✝ : DecidableEq I
b : Basis I R S
f : I →₀ S
x : S
a : I → I →₀ R := fun i => b.repr (b i * x)
h₁ :
  ∀ (k : I),
    ((f.sum fun i y => (a i) k • b.repr y).sum fun j z => z • b j ⊗ₜ[R] b k) =
      f.sum fun i y => (b.repr y).sum fun j z => (a i) k • z • b j ⊗ₜ[R] b k
h₂ : ∀ (x : S), ∑ a ∈ (b.repr x).support, (b.repr x) a • b a = x
⊢ ∑ x ∈ f.support, ∑ x_1 ∈ (a x).support, ((a x) x_1 • f x) ⊗ₜ[R] b x_1 =
    ∑ k ∈ f.support.biUnion fun i => ((fun i => b.repr (b i * x)) i).support,
      (b.repr (f.sum fun i y => ((fun i => b.repr (b i * x)) i) k • y)).sum fun j c => c • b j ⊗ₜ[R] b k
state_after: R S : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
M : Type u_1
inst✝⁶ : AddCommGroup M
inst✝⁵ : Module R M
inst✝⁴ : Module S M
inst✝³ : IsScalarTower R S M
inst✝² : FormallyUnramified R S
inst✝¹ : EssFiniteType R S
I : Type u_2
inst✝ : DecidableEq I
b : Basis I R S
f : I →₀ S
x : S
a : I → I →₀ R := fun i => b.repr (b i * x)
h₁ :
  ∀ (k : I),
    ((f.sum fun i y => (a i) k • b.repr y).sum fun j z => z • b j ⊗ₜ[R] b k) =
      f.sum fun i y => (b.repr y).sum fun j z => (a i) k • z • b j ⊗ₜ[R] b k
h₂ : ∀ (x : S), ∑ a ∈ (b.repr x).support, (b.repr x) a • b a = x
⊢ ∑ x ∈ f.support, ∑ x_1 ∈ (a x).support, ((a x) x_1 • f x) ⊗ₜ[R] b x_1 =
    ∑ x_1 ∈ f.support, ∑ x ∈ f.support.biUnion fun i => (b.repr (b i * x)).support, ((a x_1) x • f x_1) ⊗ₜ[R] b x
tactic: simp_rw [map_finsupp_sum, map_smul, h₁, Finsupp.sum, Finset.sum_comm (t := f.support),
    TensorProduct.smul_tmul', ← TensorProduct.sum_tmul, ← Finset.smul_sum, h₂]
state_before: R S : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
M : Type u_1
inst✝⁶ : AddCommGroup M
inst✝⁵ : Module R M
inst✝⁴ : Module S M
inst✝³ : IsScalarTower R S M
inst✝² : FormallyUnramified R S
inst✝¹ : EssFiniteType R S
I : Type u_2
inst✝ : DecidableEq I
b : Basis I R S
f : I →₀ S
x : S
a : I → I →₀ R := fun i => b.repr (b i * x)
h₁ :
  ∀ (k : I),
    ((f.sum fun i y => (a i) k • b.repr y).sum fun j z => z • b j ⊗ₜ[R] b k) =
      f.sum fun i y => (b.repr y).sum fun j z => (a i) k • z • b j ⊗ₜ[R] b k
h₂ : ∀ (x : S), ∑ a ∈ (b.repr x).support, (b.repr x) a • b a = x
⊢ ∑ x ∈ f.support, ∑ x_1 ∈ (a x).support, ((a x) x_1 • f x) ⊗ₜ[R] b x_1 =
    ∑ x_1 ∈ f.support, ∑ x ∈ f.support.biUnion fun i => (b.repr (b i * x)).support, ((a x_1) x • f x_1) ⊗ₜ[R] b x
state_after: R S : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
M : Type u_1
inst✝⁶ : AddCommGroup M
inst✝⁵ : Module R M
inst✝⁴ : Module S M
inst✝³ : IsScalarTower R S M
inst✝² : FormallyUnramified R S
inst✝¹ : EssFiniteType R S
I : Type u_2
inst✝ : DecidableEq I
b : Basis I R S
f : I →₀ S
x : S
a : I → I →₀ R := fun i => b.repr (b i * x)
h₁ :
  ∀ (k : I),
    ((f.sum fun i y => (a i) k • b.repr y).sum fun j z => z • b j ⊗ₜ[R] b k) =
      f.sum fun i y => (b.repr y).sum fun j z => (a i) k • z • b j ⊗ₜ[R] b k
h₂ : ∀ (x : S), ∑ a ∈ (b.repr x).support, (b.repr x) a • b a = x
⊢ ∀ x_1 ∈ f.support,
    ∑ x ∈ (a x_1).support, ((a x_1) x • f x_1) ⊗ₜ[R] b x =
      ∑ x ∈ f.support.biUnion fun i => (b.repr (b i * x)).support, ((a x_1) x • f x_1) ⊗ₜ[R] b x
tactic: apply Finset.sum_congr rfl
state_before: R S : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
M : Type u_1
inst✝⁶ : AddCommGroup M
inst✝⁵ : Module R M
inst✝⁴ : Module S M
inst✝³ : IsScalarTower R S M
inst✝² : FormallyUnramified R S
inst✝¹ : EssFiniteType R S
I : Type u_2
inst✝ : DecidableEq I
b : Basis I R S
f : I →₀ S
x : S
a : I → I →₀ R := fun i => b.repr (b i * x)
h₁ :
  ∀ (k : I),
    ((f.sum fun i y => (a i) k • b.repr y).sum fun j z => z • b j ⊗ₜ[R] b k) =
      f.sum fun i y => (b.repr y).sum fun j z => (a i) k • z • b j ⊗ₜ[R] b k
h₂ : ∀ (x : S), ∑ a ∈ (b.repr x).support, (b.repr x) a • b a = x
⊢ ∀ x_1 ∈ f.support,
    ∑ x ∈ (a x_1).support, ((a x_1) x • f x_1) ⊗ₜ[R] b x =
      ∑ x ∈ f.support.biUnion fun i => (b.repr (b i * x)).support, ((a x_1) x • f x_1) ⊗ₜ[R] b x
state_after: R S : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
M : Type u_1
inst✝⁶ : AddCommGroup M
inst✝⁵ : Module R M
inst✝⁴ : Module S M
inst✝³ : IsScalarTower R S M
inst✝² : FormallyUnramified R S
inst✝¹ : EssFiniteType R S
I : Type u_2
inst✝ : DecidableEq I
b : Basis I R S
f : I →₀ S
x : S
a : I → I →₀ R := fun i => b.repr (b i * x)
h₁ :
  ∀ (k : I),
    ((f.sum fun i y => (a i) k • b.repr y).sum fun j z => z • b j ⊗ₜ[R] b k) =
      f.sum fun i y => (b.repr y).sum fun j z => (a i) k • z • b j ⊗ₜ[R] b k
h₂ : ∀ (x : S), ∑ a ∈ (b.repr x).support, (b.repr x) a • b a = x
i : I
hi : i ∈ f.support
⊢ ∑ x ∈ (a i).support, ((a i) x • f i) ⊗ₜ[R] b x =
    ∑ x ∈ f.support.biUnion fun i => (b.repr (b i * x)).support, ((a i) x • f i) ⊗ₜ[R] b x
tactic: intros i hi
state_before: R S : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
M : Type u_1
inst✝⁶ : AddCommGroup M
inst✝⁵ : Module R M
inst✝⁴ : Module S M
inst✝³ : IsScalarTower R S M
inst✝² : FormallyUnramified R S
inst✝¹ : EssFiniteType R S
I : Type u_2
inst✝ : DecidableEq I
b : Basis I R S
f : I →₀ S
x : S
a : I → I →₀ R := fun i => b.repr (b i * x)
h₁ :
  ∀ (k : I),
    ((f.sum fun i y => (a i) k • b.repr y).sum fun j z => z • b j ⊗ₜ[R] b k) =
      f.sum fun i y => (b.repr y).sum fun j z => (a i) k • z • b j ⊗ₜ[R] b k
h₂ : ∀ (x : S), ∑ a ∈ (b.repr x).support, (b.repr x) a • b a = x
i : I
hi : i ∈ f.support
⊢ ∑ x ∈ (a i).support, ((a i) x • f i) ⊗ₜ[R] b x =
    ∑ x ∈ f.support.biUnion fun i => (b.repr (b i * x)).support, ((a i) x • f i) ⊗ₜ[R] b x
state_after: case h
R S : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
M : Type u_1
inst✝⁶ : AddCommGroup M
inst✝⁵ : Module R M
inst✝⁴ : Module S M
inst✝³ : IsScalarTower R S M
inst✝² : FormallyUnramified R S
inst✝¹ : EssFiniteType R S
I : Type u_2
inst✝ : DecidableEq I
b : Basis I R S
f : I →₀ S
x : S
a : I → I →₀ R := fun i => b.repr (b i * x)
h₁ :
  ∀ (k : I),
    ((f.sum fun i y => (a i) k • b.repr y).sum fun j z => z • b j ⊗ₜ[R] b k) =
      f.sum fun i y => (b.repr y).sum fun j z => (a i) k • z • b j ⊗ₜ[R] b k
h₂ : ∀ (x : S), ∑ a ∈ (b.repr x).support, (b.repr x) a • b a = x
i : I
hi : i ∈ f.support
⊢ (a i).support ⊆ f.support.biUnion fun i => (b.repr (b i * x)).support

case hg
R S : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
M : Type u_1
inst✝⁶ : AddCommGroup M
inst✝⁵ : Module R M
inst✝⁴ : Module S M
inst✝³ : IsScalarTower R S M
inst✝² : FormallyUnramified R S
inst✝¹ : EssFiniteType R S
I : Type u_2
inst✝ : DecidableEq I
b : Basis I R S
f : I →₀ S
x : S
a : I → I →₀ R := fun i => b.repr (b i * x)
h₁ :
  ∀ (k : I),
    ((f.sum fun i y => (a i) k • b.repr y).sum fun j z => z • b j ⊗ₜ[R] b k) =
      f.sum fun i y => (b.repr y).sum fun j z => (a i) k • z • b j ⊗ₜ[R] b k
h₂ : ∀ (x : S), ∑ a ∈ (b.repr x).support, (b.repr x) a • b a = x
i : I
hi : i ∈ f.support
⊢ ∀ x_1 ∈ (f.support.biUnion fun i => (b.repr (b i * x)).support) \ (a i).support, ((a i) x_1 • f i) ⊗ₜ[R] b x_1 = 0

case hfg
R S : Type u_3
inst✝⁹ : CommRing R
inst✝⁸ : CommRing S
inst✝⁷ : Algebra R S
M : Type u_1
inst✝⁶ : AddCommGroup M
inst✝⁵ : Module R M
inst✝⁴ : Module S M
inst✝³ : IsScalarTower R S M
inst✝² : FormallyUnramified R S
inst✝¹ : EssFiniteType R S
I : Type u_2
inst✝ : DecidableEq I
b : Basis I R S
f : I →₀ S
x : S
a : I → I →₀ R := fun i => b.repr (b i * x)
h₁ :
  ∀ (k : I),
    ((f.sum fun i y => (a i) k • b.repr y).sum fun j z => z • b j ⊗ₜ[R] b k) =
      f.sum fun i y => (b.repr y).sum fun j z => (a i) k • z • b j ⊗ₜ[R] b k
h₂ : ∀ (x : S), ∑ a ∈ (b.repr x).support, (b.repr x) a • b a = x
i : I
hi : i ∈ f.support
⊢ ∀ x ∈ (a i).support, ((a i) x • f i) ⊗ₜ[R] b x = ((a i) x • f i) ⊗ₜ[R] b x
tactic: apply Finset.sum_subset_zero_on_sdiff