l3lab/ntp-mathlib huggingface dataset:
theorem LinearIndependent.localization_localization {ι : Type*} {v : ι → A}
    (hv : LinearIndependent R v) : LinearIndependent Rₛ (algebraMap A Aₛ ∘ v) := by
  rw [linearIndependent_iff'] at hv ⊢
  intro s g hg i hi
  choose! a g' hg' using IsLocalization.exist_integer_multiples S s g
  

Proof state:
R : Type u_1
Rₛ : Type u_2
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing Rₛ
inst✝⁸ : Algebra R Rₛ
S : Submonoid R
hT : IsLocalization S Rₛ
A : Type u_3
inst✝⁷ : CommRing A
inst✝⁶ : Algebra R A
Aₛ : Type u_4
inst✝⁵ : CommRing Aₛ
inst✝⁴ : Algebra A Aₛ
inst✝³ : Algebra Rₛ Aₛ
inst✝² : Algebra R Aₛ
inst✝¹ : IsScalarTower R Rₛ Aₛ
inst✝ : IsScalarTower R A Aₛ
hA : IsLocalization (Algebra.algebraMapSubmonoid A S) Aₛ
ι : Type u_5
v : ι → A
hv : ∀ (s : Finset ι) (g : ι → R), ∑ i in s, g i • v i = 0 → ∀ i ∈ s, g i = 0
s : Finset ι
g : ι → Rₛ
hg : ∑ i in s, g i • (⇑(algebraMap A Aₛ) ∘ v) i = 0
i : ι
hi : i ∈ s
a : ↥S
g' : ι → R
hg' : ∀ i ∈ s, (algebraMap R Rₛ) (g' i) = ↑a • g i
⊢ g i = 0

Next tactic:
have h0 : algebraMap A Aₛ (∑ i in s, g' i • v i) = 0 := by
    apply_fun ((a : R) • ·) at hg
    rw [smul_zero, Finset.smul_sum] at hg
    rw [map_sum, ← hg]
    refine' Finset.sum_congr rfl fun i hi => _
    rw [← smul_assoc, ← hg' i hi, Algebra.smul_def, map_mul, ← IsScalarTower.algebraMap_apply, ←
      Algebra.smul_def, algebraMap_smul, Function.comp_apply]
theorem LinearIndependent.localization_localization {ι : Type*} {v : ι → A}
    (hv : LinearIndependent R v) : LinearIndependent Rₛ (algebraMap A Aₛ ∘ v) := by
  rw [linearIndependent_iff'] at hv ⊢
  intro s g hg i hi
  choose! a g' hg' using IsLocalization.exist_integer_multiples S s g
  have h0 : algebraMap A Aₛ (∑ i in s, g' i • v i) = 0 := by
    

Proof state:
R : Type u_1
Rₛ : Type u_2
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing Rₛ
inst✝⁸ : Algebra R Rₛ
S : Submonoid R
hT : IsLocalization S Rₛ
A : Type u_3
inst✝⁷ : CommRing A
inst✝⁶ : Algebra R A
Aₛ : Type u_4
inst✝⁵ : CommRing Aₛ
inst✝⁴ : Algebra A Aₛ
inst✝³ : Algebra Rₛ Aₛ
inst✝² : Algebra R Aₛ
inst✝¹ : IsScalarTower R Rₛ Aₛ
inst✝ : IsScalarTower R A Aₛ
hA : IsLocalization (Algebra.algebraMapSubmonoid A S) Aₛ
ι : Type u_5
v : ι → A
hv : ∀ (s : Finset ι) (g : ι → R), ∑ i in s, g i • v i = 0 → ∀ i ∈ s, g i = 0
s : Finset ι
g : ι → Rₛ
hg : ∑ i in s, g i • (⇑(algebraMap A Aₛ) ∘ v) i = 0
i : ι
hi : i ∈ s
a : ↥S
g' : ι → R
hg' : ∀ i ∈ s, (algebraMap R Rₛ) (g' i) = ↑a • g i
⊢ (algebraMap A Aₛ) (∑ i in s, g' i • v i) = 0

Next tactic:
apply_fun ((a : R) • ·) at hg
theorem LinearIndependent.localization_localization {ι : Type*} {v : ι → A}
    (hv : LinearIndependent R v) : LinearIndependent Rₛ (algebraMap A Aₛ ∘ v) := by
  rw [linearIndependent_iff'] at hv ⊢
  intro s g hg i hi
  choose! a g' hg' using IsLocalization.exist_integer_multiples S s g
  have h0 : algebraMap A Aₛ (∑ i in s, g' i • v i) = 0 := by
    apply_fun ((a : R) • ·) at hg
    

Proof state:
R : Type u_1
Rₛ : Type u_2
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing Rₛ
inst✝⁸ : Algebra R Rₛ
S : Submonoid R
hT : IsLocalization S Rₛ
A : Type u_3
inst✝⁷ : CommRing A
inst✝⁶ : Algebra R A
Aₛ : Type u_4
inst✝⁵ : CommRing Aₛ
inst✝⁴ : Algebra A Aₛ
inst✝³ : Algebra Rₛ Aₛ
inst✝² : Algebra R Aₛ
inst✝¹ : IsScalarTower R Rₛ Aₛ
inst✝ : IsScalarTower R A Aₛ
hA : IsLocalization (Algebra.algebraMapSubmonoid A S) Aₛ
ι : Type u_5
v : ι → A
hv : ∀ (s : Finset ι) (g : ι → R), ∑ i in s, g i • v i = 0 → ∀ i ∈ s, g i = 0
s : Finset ι
g : ι → Rₛ
i : ι
hi : i ∈ s
a : ↥S
g' : ι → R
hg' : ∀ i ∈ s, (algebraMap R Rₛ) (g' i) = ↑a • g i
hg : ↑a • ∑ i in s, g i • (⇑(algebraMap A Aₛ) ∘ v) i = ↑a • 0
⊢ (algebraMap A Aₛ) (∑ i in s, g' i • v i) = 0

Next tactic:
rw [smul_zero, Finset.smul_sum] at hg
theorem LinearIndependent.localization_localization {ι : Type*} {v : ι → A}
    (hv : LinearIndependent R v) : LinearIndependent Rₛ (algebraMap A Aₛ ∘ v) := by
  rw [linearIndependent_iff'] at hv ⊢
  intro s g hg i hi
  choose! a g' hg' using IsLocalization.exist_integer_multiples S s g
  have h0 : algebraMap A Aₛ (∑ i in s, g' i • v i) = 0 := by
    apply_fun ((a : R) • ·) at hg
    rw [smul_zero, Finset.smul_sum] at hg
    

Proof state:
R : Type u_1
Rₛ : Type u_2
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing Rₛ
inst✝⁸ : Algebra R Rₛ
S : Submonoid R
hT : IsLocalization S Rₛ
A : Type u_3
inst✝⁷ : CommRing A
inst✝⁶ : Algebra R A
Aₛ : Type u_4
inst✝⁵ : CommRing Aₛ
inst✝⁴ : Algebra A Aₛ
inst✝³ : Algebra Rₛ Aₛ
inst✝² : Algebra R Aₛ
inst✝¹ : IsScalarTower R Rₛ Aₛ
inst✝ : IsScalarTower R A Aₛ
hA : IsLocalization (Algebra.algebraMapSubmonoid A S) Aₛ
ι : Type u_5
v : ι → A
hv : ∀ (s : Finset ι) (g : ι → R), ∑ i in s, g i • v i = 0 → ∀ i ∈ s, g i = 0
s : Finset ι
g : ι → Rₛ
i : ι
hi : i ∈ s
a : ↥S
g' : ι → R
hg' : ∀ i ∈ s, (algebraMap R Rₛ) (g' i) = ↑a • g i
hg : ∑ x in s, ↑a • g x • (⇑(algebraMap A Aₛ) ∘ v) x = 0
⊢ (algebraMap A Aₛ) (∑ i in s, g' i • v i) = 0

Next tactic:
rw [map_sum, ← hg]
theorem LinearIndependent.localization_localization {ι : Type*} {v : ι → A}
    (hv : LinearIndependent R v) : LinearIndependent Rₛ (algebraMap A Aₛ ∘ v) := by
  rw [linearIndependent_iff'] at hv ⊢
  intro s g hg i hi
  choose! a g' hg' using IsLocalization.exist_integer_multiples S s g
  have h0 : algebraMap A Aₛ (∑ i in s, g' i • v i) = 0 := by
    apply_fun ((a : R) • ·) at hg
    rw [smul_zero, Finset.smul_sum] at hg
    rw [map_sum, ← hg]
    

Proof state:
R : Type u_1
Rₛ : Type u_2
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing Rₛ
inst✝⁸ : Algebra R Rₛ
S : Submonoid R
hT : IsLocalization S Rₛ
A : Type u_3
inst✝⁷ : CommRing A
inst✝⁶ : Algebra R A
Aₛ : Type u_4
inst✝⁵ : CommRing Aₛ
inst✝⁴ : Algebra A Aₛ
inst✝³ : Algebra Rₛ Aₛ
inst✝² : Algebra R Aₛ
inst✝¹ : IsScalarTower R Rₛ Aₛ
inst✝ : IsScalarTower R A Aₛ
hA : IsLocalization (Algebra.algebraMapSubmonoid A S) Aₛ
ι : Type u_5
v : ι → A
hv : ∀ (s : Finset ι) (g : ι → R), ∑ i in s, g i • v i = 0 → ∀ i ∈ s, g i = 0
s : Finset ι
g : ι → Rₛ
i : ι
hi : i ∈ s
a : ↥S
g' : ι → R
hg' : ∀ i ∈ s, (algebraMap R Rₛ) (g' i) = ↑a • g i
hg : ∑ x in s, ↑a • g x • (⇑(algebraMap A Aₛ) ∘ v) x = 0
⊢ ∑ x in s, (algebraMap A Aₛ) (g' x • v x) = ∑ x in s, ↑a • g x • (⇑(algebraMap A Aₛ) ∘ v) x

Next tactic:
refine' Finset.sum_congr rfl fun i hi => _
theorem LinearIndependent.localization_localization {ι : Type*} {v : ι → A}
    (hv : LinearIndependent R v) : LinearIndependent Rₛ (algebraMap A Aₛ ∘ v) := by
  rw [linearIndependent_iff'] at hv ⊢
  intro s g hg i hi
  choose! a g' hg' using IsLocalization.exist_integer_multiples S s g
  have h0 : algebraMap A Aₛ (∑ i in s, g' i • v i) = 0 := by
    apply_fun ((a : R) • ·) at hg
    rw [smul_zero, Finset.smul_sum] at hg
    rw [map_sum, ← hg]
    refine' Finset.sum_congr rfl fun i hi => _
    

Proof state:
R : Type u_1
Rₛ : Type u_2
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing Rₛ
inst✝⁸ : Algebra R Rₛ
S : Submonoid R
hT : IsLocalization S Rₛ
A : Type u_3
inst✝⁷ : CommRing A
inst✝⁶ : Algebra R A
Aₛ : Type u_4
inst✝⁵ : CommRing Aₛ
inst✝⁴ : Algebra A Aₛ
inst✝³ : Algebra Rₛ Aₛ
inst✝² : Algebra R Aₛ
inst✝¹ : IsScalarTower R Rₛ Aₛ
inst✝ : IsScalarTower R A Aₛ
hA : IsLocalization (Algebra.algebraMapSubmonoid A S) Aₛ
ι : Type u_5
v : ι → A
hv : ∀ (s : Finset ι) (g : ι → R), ∑ i in s, g i • v i = 0 → ∀ i ∈ s, g i = 0
s : Finset ι
g : ι → Rₛ
i✝ : ι
hi✝ : i✝ ∈ s
a : ↥S
g' : ι → R
hg' : ∀ i ∈ s, (algebraMap R Rₛ) (g' i) = ↑a • g i
hg : ∑ x in s, ↑a • g x • (⇑(algebraMap A Aₛ) ∘ v) x = 0
i : ι
hi : i ∈ s
⊢ (algebraMap A Aₛ) (g' i • v i) = ↑a • g i • (⇑(algebraMap A Aₛ) ∘ v) i

Next tactic:
rw [← smul_assoc, ← hg' i hi, Algebra.smul_def, map_mul, ← IsScalarTower.algebraMap_apply, ←
      Algebra.smul_def, algebraMap_smul, Function.comp_apply]
theorem LinearIndependent.localization_localization {ι : Type*} {v : ι → A}
    (hv : LinearIndependent R v) : LinearIndependent Rₛ (algebraMap A Aₛ ∘ v) := by
  rw [linearIndependent_iff'] at hv ⊢
  intro s g hg i hi
  choose! a g' hg' using IsLocalization.exist_integer_multiples S s g
  have h0 : algebraMap A Aₛ (∑ i in s, g' i • v i) = 0 := by
    apply_fun ((a : R) • ·) at hg
    rw [smul_zero, Finset.smul_sum] at hg
    rw [map_sum, ← hg]
    refine' Finset.sum_congr rfl fun i hi => _
    rw [← smul_assoc, ← hg' i hi, Algebra.smul_def, map_mul, ← IsScalarTower.algebraMap_apply, ←
      Algebra.smul_def, algebraMap_smul, Function.comp_apply]
  

Proof state:
R : Type u_1
Rₛ : Type u_2
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing Rₛ
inst✝⁸ : Algebra R Rₛ
S : Submonoid R
hT : IsLocalization S Rₛ
A : Type u_3
inst✝⁷ : CommRing A
inst✝⁶ : Algebra R A
Aₛ : Type u_4
inst✝⁵ : CommRing Aₛ
inst✝⁴ : Algebra A Aₛ
inst✝³ : Algebra Rₛ Aₛ
inst✝² : Algebra R Aₛ
inst✝¹ : IsScalarTower R Rₛ Aₛ
inst✝ : IsScalarTower R A Aₛ
hA : IsLocalization (Algebra.algebraMapSubmonoid A S) Aₛ
ι : Type u_5
v : ι → A
hv : ∀ (s : Finset ι) (g : ι → R), ∑ i in s, g i • v i = 0 → ∀ i ∈ s, g i = 0
s : Finset ι
g : ι → Rₛ
hg : ∑ i in s, g i • (⇑(algebraMap A Aₛ) ∘ v) i = 0
i : ι
hi : i ∈ s
a : ↥S
g' : ι → R
hg' : ∀ i ∈ s, (algebraMap R Rₛ) (g' i) = ↑a • g i
h0 : (algebraMap A Aₛ) (∑ i in s, g' i • v i) = 0
⊢ g i = 0

Next tactic:
obtain ⟨⟨_, r, hrS, rfl⟩, hr : algebraMap R A r * _ = 0⟩ :=
    (IsLocalization.map_eq_zero_iff (Algebra.algebraMapSubmonoid A S) _ _).1 h0
theorem LinearIndependent.localization_localization {ι : Type*} {v : ι → A}
    (hv : LinearIndependent R v) : LinearIndependent Rₛ (algebraMap A Aₛ ∘ v) := by
  rw [linearIndependent_iff'] at hv ⊢
  intro s g hg i hi
  choose! a g' hg' using IsLocalization.exist_integer_multiples S s g
  have h0 : algebraMap A Aₛ (∑ i in s, g' i • v i) = 0 := by
    apply_fun ((a : R) • ·) at hg
    rw [smul_zero, Finset.smul_sum] at hg
    rw [map_sum, ← hg]
    refine' Finset.sum_congr rfl fun i hi => _
    rw [← smul_assoc, ← hg' i hi, Algebra.smul_def, map_mul, ← IsScalarTower.algebraMap_apply, ←
      Algebra.smul_def, algebraMap_smul, Function.comp_apply]
  obtain ⟨⟨_, r, hrS, rfl⟩, hr : algebraMap R A r * _ = 0⟩ :=
    (IsLocalization.map_eq_zero_iff (Algebra.algebraMapSubmonoid A S) _ _).1 h0
  

Proof state:
case intro.mk.intro.intro
R : Type u_1
Rₛ : Type u_2
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing Rₛ
inst✝⁸ : Algebra R Rₛ
S : Submonoid R
hT : IsLocalization S Rₛ
A : Type u_3
inst✝⁷ : CommRing A
inst✝⁶ : Algebra R A
Aₛ : Type u_4
inst✝⁵ : CommRing Aₛ
inst✝⁴ : Algebra A Aₛ
inst✝³ : Algebra Rₛ Aₛ
inst✝² : Algebra R Aₛ
inst✝¹ : IsScalarTower R Rₛ Aₛ
inst✝ : IsScalarTower R A Aₛ
hA : IsLocalization (Algebra.algebraMapSubmonoid A S) Aₛ
ι : Type u_5
v : ι → A
hv : ∀ (s : Finset ι) (g : ι → R), ∑ i in s, g i • v i = 0 → ∀ i ∈ s, g i = 0
s : Finset ι
g : ι → Rₛ
hg : ∑ i in s, g i • (⇑(algebraMap A Aₛ) ∘ v) i = 0
i : ι
hi : i ∈ s
a : ↥S
g' : ι → R
hg' : ∀ i ∈ s, (algebraMap R Rₛ) (g' i) = ↑a • g i
h0 : (algebraMap A Aₛ) (∑ i in s, g' i • v i) = 0
r : R
hrS : r ∈ ↑S
hr : (algebraMap R A) r * ∑ i in s, g' i • v i = 0
⊢ g i = 0

Next tactic:
simp_rw [Finset.mul_sum, ← Algebra.smul_def, smul_smul] at hr
theorem LinearIndependent.localization_localization {ι : Type*} {v : ι → A}
    (hv : LinearIndependent R v) : LinearIndependent Rₛ (algebraMap A Aₛ ∘ v) := by
  rw [linearIndependent_iff'] at hv ⊢
  intro s g hg i hi
  choose! a g' hg' using IsLocalization.exist_integer_multiples S s g
  have h0 : algebraMap A Aₛ (∑ i in s, g' i • v i) = 0 := by
    apply_fun ((a : R) • ·) at hg
    rw [smul_zero, Finset.smul_sum] at hg
    rw [map_sum, ← hg]
    refine' Finset.sum_congr rfl fun i hi => _
    rw [← smul_assoc, ← hg' i hi, Algebra.smul_def, map_mul, ← IsScalarTower.algebraMap_apply, ←
      Algebra.smul_def, algebraMap_smul, Function.comp_apply]
  obtain ⟨⟨_, r, hrS, rfl⟩, hr : algebraMap R A r * _ = 0⟩ :=
    (IsLocalization.map_eq_zero_iff (Algebra.algebraMapSubmonoid A S) _ _).1 h0
  simp_rw [Finset.mul_sum, ← Algebra.smul_def, smul_smul] at hr
  

Proof state:
case intro.mk.intro.intro
R : Type u_1
Rₛ : Type u_2
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing Rₛ
inst✝⁸ : Algebra R Rₛ
S : Submonoid R
hT : IsLocalization S Rₛ
A : Type u_3
inst✝⁷ : CommRing A
inst✝⁶ : Algebra R A
Aₛ : Type u_4
inst✝⁵ : CommRing Aₛ
inst✝⁴ : Algebra A Aₛ
inst✝³ : Algebra Rₛ Aₛ
inst✝² : Algebra R Aₛ
inst✝¹ : IsScalarTower R Rₛ Aₛ
inst✝ : IsScalarTower R A Aₛ
hA : IsLocalization (Algebra.algebraMapSubmonoid A S) Aₛ
ι : Type u_5
v : ι → A
hv : ∀ (s : Finset ι) (g : ι → R), ∑ i in s, g i • v i = 0 → ∀ i ∈ s, g i = 0
s : Finset ι
g : ι → Rₛ
hg : ∑ i in s, g i • (⇑(algebraMap A Aₛ) ∘ v) i = 0
i : ι
hi : i ∈ s
a : ↥S
g' : ι → R
hg' : ∀ i ∈ s, (algebraMap R Rₛ) (g' i) = ↑a • g i
h0 : (algebraMap A Aₛ) (∑ i in s, g' i • v i) = 0
r : R
hrS : r ∈ ↑S
hr : ∑ x in s, (r * g' x) • v x = 0
⊢ g i = 0

Next tactic:
specialize hv s _ hr i hi
theorem LinearIndependent.localization_localization {ι : Type*} {v : ι → A}
    (hv : LinearIndependent R v) : LinearIndependent Rₛ (algebraMap A Aₛ ∘ v) := by
  rw [linearIndependent_iff'] at hv ⊢
  intro s g hg i hi
  choose! a g' hg' using IsLocalization.exist_integer_multiples S s g
  have h0 : algebraMap A Aₛ (∑ i in s, g' i • v i) = 0 := by
    apply_fun ((a : R) • ·) at hg
    rw [smul_zero, Finset.smul_sum] at hg
    rw [map_sum, ← hg]
    refine' Finset.sum_congr rfl fun i hi => _
    rw [← smul_assoc, ← hg' i hi, Algebra.smul_def, map_mul, ← IsScalarTower.algebraMap_apply, ←
      Algebra.smul_def, algebraMap_smul, Function.comp_apply]
  obtain ⟨⟨_, r, hrS, rfl⟩, hr : algebraMap R A r * _ = 0⟩ :=
    (IsLocalization.map_eq_zero_iff (Algebra.algebraMapSubmonoid A S) _ _).1 h0
  simp_rw [Finset.mul_sum, ← Algebra.smul_def, smul_smul] at hr
  specialize hv s _ hr i hi
  

Proof state:
case intro.mk.intro.intro
R : Type u_1
Rₛ : Type u_2
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing Rₛ
inst✝⁸ : Algebra R Rₛ
S : Submonoid R
hT : IsLocalization S Rₛ
A : Type u_3
inst✝⁷ : CommRing A
inst✝⁶ : Algebra R A
Aₛ : Type u_4
inst✝⁵ : CommRing Aₛ
inst✝⁴ : Algebra A Aₛ
inst✝³ : Algebra Rₛ Aₛ
inst✝² : Algebra R Aₛ
inst✝¹ : IsScalarTower R Rₛ Aₛ
inst✝ : IsScalarTower R A Aₛ
hA : IsLocalization (Algebra.algebraMapSubmonoid A S) Aₛ
ι : Type u_5
v : ι → A
s : Finset ι
g : ι → Rₛ
hg : ∑ i in s, g i • (⇑(algebraMap A Aₛ) ∘ v) i = 0
i : ι
hi : i ∈ s
a : ↥S
g' : ι → R
hg' : ∀ i ∈ s, (algebraMap R Rₛ) (g' i) = ↑a • g i
h0 : (algebraMap A Aₛ) (∑ i in s, g' i • v i) = 0
r : R
hrS : r ∈ ↑S
hr : ∑ x in s, (r * g' x) • v x = 0
hv : r * g' i = 0
⊢ g i = 0

Next tactic:
rw [← (IsLocalization.map_units Rₛ a).mul_right_eq_zero, ← Algebra.smul_def, ← hg' i hi]
theorem LinearIndependent.localization_localization {ι : Type*} {v : ι → A}
    (hv : LinearIndependent R v) : LinearIndependent Rₛ (algebraMap A Aₛ ∘ v) := by
  rw [linearIndependent_iff'] at hv ⊢
  intro s g hg i hi
  choose! a g' hg' using IsLocalization.exist_integer_multiples S s g
  have h0 : algebraMap A Aₛ (∑ i in s, g' i • v i) = 0 := by
    apply_fun ((a : R) • ·) at hg
    rw [smul_zero, Finset.smul_sum] at hg
    rw [map_sum, ← hg]
    refine' Finset.sum_congr rfl fun i hi => _
    rw [← smul_assoc, ← hg' i hi, Algebra.smul_def, map_mul, ← IsScalarTower.algebraMap_apply, ←
      Algebra.smul_def, algebraMap_smul, Function.comp_apply]
  obtain ⟨⟨_, r, hrS, rfl⟩, hr : algebraMap R A r * _ = 0⟩ :=
    (IsLocalization.map_eq_zero_iff (Algebra.algebraMapSubmonoid A S) _ _).1 h0
  simp_rw [Finset.mul_sum, ← Algebra.smul_def, smul_smul] at hr
  specialize hv s _ hr i hi
  rw [← (IsLocalization.map_units Rₛ a).mul_right_eq_zero, ← Algebra.smul_def, ← hg' i hi]
  

Proof state:
case intro.mk.intro.intro
R : Type u_1
Rₛ : Type u_2
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing Rₛ
inst✝⁸ : Algebra R Rₛ
S : Submonoid R
hT : IsLocalization S Rₛ
A : Type u_3
inst✝⁷ : CommRing A
inst✝⁶ : Algebra R A
Aₛ : Type u_4
inst✝⁵ : CommRing Aₛ
inst✝⁴ : Algebra A Aₛ
inst✝³ : Algebra Rₛ Aₛ
inst✝² : Algebra R Aₛ
inst✝¹ : IsScalarTower R Rₛ Aₛ
inst✝ : IsScalarTower R A Aₛ
hA : IsLocalization (Algebra.algebraMapSubmonoid A S) Aₛ
ι : Type u_5
v : ι → A
s : Finset ι
g : ι → Rₛ
hg : ∑ i in s, g i • (⇑(algebraMap A Aₛ) ∘ v) i = 0
i : ι
hi : i ∈ s
a : ↥S
g' : ι → R
hg' : ∀ i ∈ s, (algebraMap R Rₛ) (g' i) = ↑a • g i
h0 : (algebraMap A Aₛ) (∑ i in s, g' i • v i) = 0
r : R
hrS : r ∈ ↑S
hr : ∑ x in s, (r * g' x) • v x = 0
hv : r * g' i = 0
⊢ (algebraMap R Rₛ) (g' i) = 0

Next tactic:
exact (IsLocalization.map_eq_zero_iff S _ _).2 ⟨⟨r, hrS⟩, hv⟩
theorem SpanEqTop.localization_localization {v : Set A} (hv : span R v = ⊤) :
    span Rₛ (algebraMap A Aₛ '' v) = ⊤ := by
  

Proof state:
R : Type u_1
Rₛ : Type u_2
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing Rₛ
inst✝⁸ : Algebra R Rₛ
S : Submonoid R
hT : IsLocalization S Rₛ
A : Type u_3
inst✝⁷ : CommRing A
inst✝⁶ : Algebra R A
Aₛ : Type u_4
inst✝⁵ : CommRing Aₛ
inst✝⁴ : Algebra A Aₛ
inst✝³ : Algebra Rₛ Aₛ
inst✝² : Algebra R Aₛ
inst✝¹ : IsScalarTower R Rₛ Aₛ
inst✝ : IsScalarTower R A Aₛ
hA : IsLocalization (Algebra.algebraMapSubmonoid A S) Aₛ
v : Set A
hv : span R v = ⊤
⊢ span Rₛ (⇑(algebraMap A Aₛ) '' v) = ⊤

Next tactic:
rw [eq_top_iff]
theorem SpanEqTop.localization_localization {v : Set A} (hv : span R v = ⊤) :
    span Rₛ (algebraMap A Aₛ '' v) = ⊤ := by
  rw [eq_top_iff]
  

Proof state:
R : Type u_1
Rₛ : Type u_2
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing Rₛ
inst✝⁸ : Algebra R Rₛ
S : Submonoid R
hT : IsLocalization S Rₛ
A : Type u_3
inst✝⁷ : CommRing A
inst✝⁶ : Algebra R A
Aₛ : Type u_4
inst✝⁵ : CommRing Aₛ
inst✝⁴ : Algebra A Aₛ
inst✝³ : Algebra Rₛ Aₛ
inst✝² : Algebra R Aₛ
inst✝¹ : IsScalarTower R Rₛ Aₛ
inst✝ : IsScalarTower R A Aₛ
hA : IsLocalization (Algebra.algebraMapSubmonoid A S) Aₛ
v : Set A
hv : span R v = ⊤
⊢ ⊤ ≤ span Rₛ (⇑(algebraMap A Aₛ) '' v)

Next tactic:
rintro a' -
theorem SpanEqTop.localization_localization {v : Set A} (hv : span R v = ⊤) :
    span Rₛ (algebraMap A Aₛ '' v) = ⊤ := by
  rw [eq_top_iff]
  rintro a' -
  

Proof state:
R : Type u_1
Rₛ : Type u_2
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing Rₛ
inst✝⁸ : Algebra R Rₛ
S : Submonoid R
hT : IsLocalization S Rₛ
A : Type u_3
inst✝⁷ : CommRing A
inst✝⁶ : Algebra R A
Aₛ : Type u_4
inst✝⁵ : CommRing Aₛ
inst✝⁴ : Algebra A Aₛ
inst✝³ : Algebra Rₛ Aₛ
inst✝² : Algebra R Aₛ
inst✝¹ : IsScalarTower R Rₛ Aₛ
inst✝ : IsScalarTower R A Aₛ
hA : IsLocalization (Algebra.algebraMapSubmonoid A S) Aₛ
v : Set A
hv : span R v = ⊤
a' : Aₛ
⊢ a' ∈ span Rₛ (⇑(algebraMap A Aₛ) '' v)

Next tactic:
obtain ⟨a, ⟨_, s, hs, rfl⟩, rfl⟩ :=
    IsLocalization.mk'_surjective (Algebra.algebraMapSubmonoid A S) a'
theorem SpanEqTop.localization_localization {v : Set A} (hv : span R v = ⊤) :
    span Rₛ (algebraMap A Aₛ '' v) = ⊤ := by
  rw [eq_top_iff]
  rintro a' -
  obtain ⟨a, ⟨_, s, hs, rfl⟩, rfl⟩ :=
    IsLocalization.mk'_surjective (Algebra.algebraMapSubmonoid A S) a'
  

Proof state:
case intro.intro.mk.intro.intro
R : Type u_1
Rₛ : Type u_2
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing Rₛ
inst✝⁸ : Algebra R Rₛ
S : Submonoid R
hT : IsLocalization S Rₛ
A : Type u_3
inst✝⁷ : CommRing A
inst✝⁶ : Algebra R A
Aₛ : Type u_4
inst✝⁵ : CommRing Aₛ
inst✝⁴ : Algebra A Aₛ
inst✝³ : Algebra Rₛ Aₛ
inst✝² : Algebra R Aₛ
inst✝¹ : IsScalarTower R Rₛ Aₛ
inst✝ : IsScalarTower R A Aₛ
hA : IsLocalization (Algebra.algebraMapSubmonoid A S) Aₛ
v : Set A
hv : span R v = ⊤
a : A
s : R
hs : s ∈ ↑S
⊢ IsLocalization.mk' Aₛ a
      { val := (algebraMap R A) s, property := (_ : ∃ a ∈ ↑S, (algebraMap R A) a = (algebraMap R A) s) } ∈
    span Rₛ (⇑(algebraMap A Aₛ) '' v)

Next tactic:
rw [IsLocalization.mk'_eq_mul_mk'_one, mul_comm, ← map_one (algebraMap R A)]
theorem SpanEqTop.localization_localization {v : Set A} (hv : span R v = ⊤) :
    span Rₛ (algebraMap A Aₛ '' v) = ⊤ := by
  rw [eq_top_iff]
  rintro a' -
  obtain ⟨a, ⟨_, s, hs, rfl⟩, rfl⟩ :=
    IsLocalization.mk'_surjective (Algebra.algebraMapSubmonoid A S) a'
  rw [IsLocalization.mk'_eq_mul_mk'_one, mul_comm, ← map_one (algebraMap R A)]
  

Proof state:
case intro.intro.mk.intro.intro
R : Type u_1
Rₛ : Type u_2
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing Rₛ
inst✝⁸ : Algebra R Rₛ
S : Submonoid R
hT : IsLocalization S Rₛ
A : Type u_3
inst✝⁷ : CommRing A
inst✝⁶ : Algebra R A
Aₛ : Type u_4
inst✝⁵ : CommRing Aₛ
inst✝⁴ : Algebra A Aₛ
inst✝³ : Algebra Rₛ Aₛ
inst✝² : Algebra R Aₛ
inst✝¹ : IsScalarTower R Rₛ Aₛ
inst✝ : IsScalarTower R A Aₛ
hA : IsLocalization (Algebra.algebraMapSubmonoid A S) Aₛ
v : Set A
hv : span R v = ⊤
a : A
s : R
hs : s ∈ ↑S
⊢ IsLocalization.mk' Aₛ ((algebraMap R A) 1)
        { val := (algebraMap R A) s, property := (_ : ∃ a ∈ ↑S, (algebraMap R A) a = (algebraMap R A) s) } *
      (algebraMap A Aₛ) a ∈
    span Rₛ (⇑(algebraMap A Aₛ) '' v)

Next tactic:
erw [← IsLocalization.algebraMap_mk' A Rₛ Aₛ (1 : R) ⟨s, hs⟩]
theorem SpanEqTop.localization_localization {v : Set A} (hv : span R v = ⊤) :
    span Rₛ (algebraMap A Aₛ '' v) = ⊤ := by
  rw [eq_top_iff]
  rintro a' -
  obtain ⟨a, ⟨_, s, hs, rfl⟩, rfl⟩ :=
    IsLocalization.mk'_surjective (Algebra.algebraMapSubmonoid A S) a'
  rw [IsLocalization.mk'_eq_mul_mk'_one, mul_comm, ← map_one (algebraMap R A)]
  erw [← IsLocalization.algebraMap_mk' A Rₛ Aₛ (1 : R) ⟨s, hs⟩]
  -- `erw` needed to unify `⟨s, hs⟩`
  

Proof state:
case intro.intro.mk.intro.intro
R : Type u_1
Rₛ : Type u_2
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing Rₛ
inst✝⁸ : Algebra R Rₛ
S : Submonoid R
hT : IsLocalization S Rₛ
A : Type u_3
inst✝⁷ : CommRing A
inst✝⁶ : Algebra R A
Aₛ : Type u_4
inst✝⁵ : CommRing Aₛ
inst✝⁴ : Algebra A Aₛ
inst✝³ : Algebra Rₛ Aₛ
inst✝² : Algebra R Aₛ
inst✝¹ : IsScalarTower R Rₛ Aₛ
inst✝ : IsScalarTower R A Aₛ
hA : IsLocalization (Algebra.algebraMapSubmonoid A S) Aₛ
v : Set A
hv : span R v = ⊤
a : A
s : R
hs : s ∈ ↑S
⊢ (algebraMap Rₛ Aₛ) (IsLocalization.mk' Rₛ 1 { val := s, property := hs }) * (algebraMap A Aₛ) a ∈
    span Rₛ (⇑(algebraMap A Aₛ) '' v)

Next tactic:
rw [← Algebra.smul_def]
theorem SpanEqTop.localization_localization {v : Set A} (hv : span R v = ⊤) :
    span Rₛ (algebraMap A Aₛ '' v) = ⊤ := by
  rw [eq_top_iff]
  rintro a' -
  obtain ⟨a, ⟨_, s, hs, rfl⟩, rfl⟩ :=
    IsLocalization.mk'_surjective (Algebra.algebraMapSubmonoid A S) a'
  rw [IsLocalization.mk'_eq_mul_mk'_one, mul_comm, ← map_one (algebraMap R A)]
  erw [← IsLocalization.algebraMap_mk' A Rₛ Aₛ (1 : R) ⟨s, hs⟩]
  -- `erw` needed to unify `⟨s, hs⟩`
  rw [← Algebra.smul_def]
  

Proof state:
case intro.intro.mk.intro.intro
R : Type u_1
Rₛ : Type u_2
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing Rₛ
inst✝⁸ : Algebra R Rₛ
S : Submonoid R
hT : IsLocalization S Rₛ
A : Type u_3
inst✝⁷ : CommRing A
inst✝⁶ : Algebra R A
Aₛ : Type u_4
inst✝⁵ : CommRing Aₛ
inst✝⁴ : Algebra A Aₛ
inst✝³ : Algebra Rₛ Aₛ
inst✝² : Algebra R Aₛ
inst✝¹ : IsScalarTower R Rₛ Aₛ
inst✝ : IsScalarTower R A Aₛ
hA : IsLocalization (Algebra.algebraMapSubmonoid A S) Aₛ
v : Set A
hv : span R v = ⊤
a : A
s : R
hs : s ∈ ↑S
⊢ IsLocalization.mk' Rₛ 1 { val := s, property := hs } • (algebraMap A Aₛ) a ∈ span Rₛ (⇑(algebraMap A Aₛ) '' v)

Next tactic:
refine' smul_mem _ _ (span_subset_span R Rₛ _ _)
theorem SpanEqTop.localization_localization {v : Set A} (hv : span R v = ⊤) :
    span Rₛ (algebraMap A Aₛ '' v) = ⊤ := by
  rw [eq_top_iff]
  rintro a' -
  obtain ⟨a, ⟨_, s, hs, rfl⟩, rfl⟩ :=
    IsLocalization.mk'_surjective (Algebra.algebraMapSubmonoid A S) a'
  rw [IsLocalization.mk'_eq_mul_mk'_one, mul_comm, ← map_one (algebraMap R A)]
  erw [← IsLocalization.algebraMap_mk' A Rₛ Aₛ (1 : R) ⟨s, hs⟩]
  -- `erw` needed to unify `⟨s, hs⟩`
  rw [← Algebra.smul_def]
  refine' smul_mem _ _ (span_subset_span R Rₛ _ _)
  

Proof state:
case intro.intro.mk.intro.intro
R : Type u_1
Rₛ : Type u_2
inst✝¹⁰ : CommRing R
inst✝⁹ : CommRing Rₛ
inst✝⁸ : Algebra R Rₛ
S : Submonoid R
hT : IsLocalization S Rₛ
A : Type u_3
inst✝⁷ : CommRing A
inst✝⁶ : Algebra R A
Aₛ : Type u_4
inst✝⁵ : CommRing Aₛ
inst✝⁴ : Algebra A Aₛ
inst✝³ : Algebra Rₛ Aₛ
inst✝² : Algebra R Aₛ
inst✝¹ : IsScalarTower R Rₛ Aₛ
inst✝ : IsScalarTower R A Aₛ
hA : IsLocalization (Algebra.algebraMapSubmonoid A S) Aₛ
v : Set A
hv : span R v = ⊤
a : A
s : R
hs : s ∈ ↑S
⊢ (algebraMap A Aₛ) a ∈ ↑(span R (⇑(algebraMap A Aₛ) '' v))

Next tactic:
rw [← Algebra.coe_linearMap, ← LinearMap.coe_restrictScalars R, ← LinearMap.map_span]