l3lab/ntp-mathlib huggingface dataset:
/-- Send a set of `x`s in a finite extension `L` of the fraction field of `R`
to `(y : R) • x ∈ integralClosure R L`. -/
theorem exists_integral_multiples (s : Finset L) :
    ∃ (y : _) (_ : y ≠ (0 : A)), ∀ x ∈ s, IsIntegral A (y • x) := by
  haveI := Classical.decEq L
  refine' s.induction _ _
  · use 1, one_ne_zero
    

Proof state:
case h
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁵ : CommRing R
inst✝¹⁴ : CommRing A
inst✝¹³ : Field K
inst✝¹² : IsDomain A
inst✝¹¹ : Algebra A K
inst✝¹⁰ : IsFractionRing A K
L : Type u_4
inst✝⁹ : Field L
C : Type u_5
inst✝⁸ : CommRing C
inst✝⁷ : Algebra K L
inst✝⁶ : Algebra A L
inst✝⁵ : IsScalarTower A K L
inst✝⁴ : Algebra C L
inst✝³ : IsIntegralClosure C A L
inst✝² : Algebra A C
inst✝¹ : IsScalarTower A C L
inst✝ : FiniteDimensional K L
s : Finset L
this : DecidableEq L
⊢ ∀ x ∈ ∅, IsIntegral A (1 • x)

Next tactic:
rintro x ⟨⟩
/-- Send a set of `x`s in a finite extension `L` of the fraction field of `R`
to `(y : R) • x ∈ integralClosure R L`. -/
theorem exists_integral_multiples (s : Finset L) :
    ∃ (y : _) (_ : y ≠ (0 : A)), ∀ x ∈ s, IsIntegral A (y • x) := by
  haveI := Classical.decEq L
  refine' s.induction _ _
  · use 1, one_ne_zero
    rintro x ⟨⟩
  · 

Proof state:
case refine'_2
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁵ : CommRing R
inst✝¹⁴ : CommRing A
inst✝¹³ : Field K
inst✝¹² : IsDomain A
inst✝¹¹ : Algebra A K
inst✝¹⁰ : IsFractionRing A K
L : Type u_4
inst✝⁹ : Field L
C : Type u_5
inst✝⁸ : CommRing C
inst✝⁷ : Algebra K L
inst✝⁶ : Algebra A L
inst✝⁵ : IsScalarTower A K L
inst✝⁴ : Algebra C L
inst✝³ : IsIntegralClosure C A L
inst✝² : Algebra A C
inst✝¹ : IsScalarTower A C L
inst✝ : FiniteDimensional K L
s : Finset L
this : DecidableEq L
⊢ ∀ ⦃a : L⦄ {s : Finset L},
    a ∉ s →
      (∃ y, ∃ (_ : y ≠ 0), ∀ x ∈ s, IsIntegral A (y • x)) → ∃ y, ∃ (_ : y ≠ 0), ∀ x ∈ insert a s, IsIntegral A (y • x)

Next tactic:
rintro x s hx ⟨y, hy, hs⟩
/-- Send a set of `x`s in a finite extension `L` of the fraction field of `R`
to `(y : R) • x ∈ integralClosure R L`. -/
theorem exists_integral_multiples (s : Finset L) :
    ∃ (y : _) (_ : y ≠ (0 : A)), ∀ x ∈ s, IsIntegral A (y • x) := by
  haveI := Classical.decEq L
  refine' s.induction _ _
  · use 1, one_ne_zero
    rintro x ⟨⟩
  · rintro x s hx ⟨y, hy, hs⟩
    

Proof state:
case refine'_2.intro.intro
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁵ : CommRing R
inst✝¹⁴ : CommRing A
inst✝¹³ : Field K
inst✝¹² : IsDomain A
inst✝¹¹ : Algebra A K
inst✝¹⁰ : IsFractionRing A K
L : Type u_4
inst✝⁹ : Field L
C : Type u_5
inst✝⁸ : CommRing C
inst✝⁷ : Algebra K L
inst✝⁶ : Algebra A L
inst✝⁵ : IsScalarTower A K L
inst✝⁴ : Algebra C L
inst✝³ : IsIntegralClosure C A L
inst✝² : Algebra A C
inst✝¹ : IsScalarTower A C L
inst✝ : FiniteDimensional K L
s✝ : Finset L
this : DecidableEq L
x : L
s : Finset L
hx : x ∉ s
y : A
hy : y ≠ 0
hs : ∀ x ∈ s, IsIntegral A (y • x)
⊢ ∃ y, ∃ (_ : y ≠ 0), ∀ x_2 ∈ insert x s, IsIntegral A (y • x_2)

Next tactic:
have := exists_integral_multiple
      ((IsFractionRing.isAlgebraic_iff A K L).mpr (.of_finite _ x))
      ((injective_iff_map_eq_zero (algebraMap A L)).mp ?_)
/-- Send a set of `x`s in a finite extension `L` of the fraction field of `R`
to `(y : R) • x ∈ integralClosure R L`. -/
theorem exists_integral_multiples (s : Finset L) :
    ∃ (y : _) (_ : y ≠ (0 : A)), ∀ x ∈ s, IsIntegral A (y • x) := by
  haveI := Classical.decEq L
  refine' s.induction _ _
  · use 1, one_ne_zero
    rintro x ⟨⟩
  · rintro x s hx ⟨y, hy, hs⟩
    have := exists_integral_multiple
      ((IsFractionRing.isAlgebraic_iff A K L).mpr (.of_finite _ x))
      ((injective_iff_map_eq_zero (algebraMap A L)).mp ?_)
    

Proof state:
case refine'_2.intro.intro.refine_2
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁵ : CommRing R
inst✝¹⁴ : CommRing A
inst✝¹³ : Field K
inst✝¹² : IsDomain A
inst✝¹¹ : Algebra A K
inst✝¹⁰ : IsFractionRing A K
L : Type u_4
inst✝⁹ : Field L
C : Type u_5
inst✝⁸ : CommRing C
inst✝⁷ : Algebra K L
inst✝⁶ : Algebra A L
inst✝⁵ : IsScalarTower A K L
inst✝⁴ : Algebra C L
inst✝³ : IsIntegralClosure C A L
inst✝² : Algebra A C
inst✝¹ : IsScalarTower A C L
inst✝ : FiniteDimensional K L
s✝ : Finset L
this✝ : DecidableEq L
x : L
s : Finset L
hx : x ∉ s
y : A
hy : y ≠ 0
hs : ∀ x ∈ s, IsIntegral A (y • x)
this : ∃ x_1 y, ∃ (_ : y ≠ 0), x * (algebraMap A L) y = ↑x_1
⊢ ∃ y, ∃ (_ : y ≠ 0), ∀ x_2 ∈ insert x s, IsIntegral A (y • x_2)
case refine'_2.intro.intro.refine_1
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁵ : CommRing R
inst✝¹⁴ : CommRing A
inst✝¹³ : Field K
inst✝¹² : IsDomain A
inst✝¹¹ : Algebra A K
inst✝¹⁰ : IsFractionRing A K
L : Type u_4
inst✝⁹ : Field L
C : Type u_5
inst✝⁸ : CommRing C
inst✝⁷ : Algebra K L
inst✝⁶ : Algebra A L
inst✝⁵ : IsScalarTower A K L
inst✝⁴ : Algebra C L
inst✝³ : IsIntegralClosure C A L
inst✝² : Algebra A C
inst✝¹ : IsScalarTower A C L
inst✝ : FiniteDimensional K L
s✝ : Finset L
this : DecidableEq L
x : L
s : Finset L
hx : x ∉ s
y : A
hy : y ≠ 0
hs : ∀ x ∈ s, IsIntegral A (y • x)
⊢ Function.Injective ⇑(algebraMap A L)

Next tactic:
rcases this with ⟨x', y', hy', hx'⟩
/-- Send a set of `x`s in a finite extension `L` of the fraction field of `R`
to `(y : R) • x ∈ integralClosure R L`. -/
theorem exists_integral_multiples (s : Finset L) :
    ∃ (y : _) (_ : y ≠ (0 : A)), ∀ x ∈ s, IsIntegral A (y • x) := by
  haveI := Classical.decEq L
  refine' s.induction _ _
  · use 1, one_ne_zero
    rintro x ⟨⟩
  · rintro x s hx ⟨y, hy, hs⟩
    have := exists_integral_multiple
      ((IsFractionRing.isAlgebraic_iff A K L).mpr (.of_finite _ x))
      ((injective_iff_map_eq_zero (algebraMap A L)).mp ?_)
    rcases this with ⟨x', y', hy', hx'⟩
    

Proof state:
case refine'_2.intro.intro.refine_2.intro.intro.intro
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁵ : CommRing R
inst✝¹⁴ : CommRing A
inst✝¹³ : Field K
inst✝¹² : IsDomain A
inst✝¹¹ : Algebra A K
inst✝¹⁰ : IsFractionRing A K
L : Type u_4
inst✝⁹ : Field L
C : Type u_5
inst✝⁸ : CommRing C
inst✝⁷ : Algebra K L
inst✝⁶ : Algebra A L
inst✝⁵ : IsScalarTower A K L
inst✝⁴ : Algebra C L
inst✝³ : IsIntegralClosure C A L
inst✝² : Algebra A C
inst✝¹ : IsScalarTower A C L
inst✝ : FiniteDimensional K L
s✝ : Finset L
this : DecidableEq L
x : L
s : Finset L
hx : x ∉ s
y : A
hy : y ≠ 0
hs : ∀ x ∈ s, IsIntegral A (y • x)
x' : ↥(integralClosure A L)
y' : A
hy' : y' ≠ 0
hx' : x * (algebraMap A L) y' = ↑x'
⊢ ∃ y, ∃ (_ : y ≠ 0), ∀ x_2 ∈ insert x s, IsIntegral A (y • x_2)
case refine'_2.intro.intro.refine_1
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁵ : CommRing R
inst✝¹⁴ : CommRing A
inst✝¹³ : Field K
inst✝¹² : IsDomain A
inst✝¹¹ : Algebra A K
inst✝¹⁰ : IsFractionRing A K
L : Type u_4
inst✝⁹ : Field L
C : Type u_5
inst✝⁸ : CommRing C
inst✝⁷ : Algebra K L
inst✝⁶ : Algebra A L
inst✝⁵ : IsScalarTower A K L
inst✝⁴ : Algebra C L
inst✝³ : IsIntegralClosure C A L
inst✝² : Algebra A C
inst✝¹ : IsScalarTower A C L
inst✝ : FiniteDimensional K L
s✝ : Finset L
this : DecidableEq L
x : L
s : Finset L
hx : x ∉ s
y : A
hy : y ≠ 0
hs : ∀ x ∈ s, IsIntegral A (y • x)
⊢ Function.Injective ⇑(algebraMap A L)

Next tactic:
refine' ⟨y * y', mul_ne_zero hy hy', fun x'' hx'' => _⟩
/-- Send a set of `x`s in a finite extension `L` of the fraction field of `R`
to `(y : R) • x ∈ integralClosure R L`. -/
theorem exists_integral_multiples (s : Finset L) :
    ∃ (y : _) (_ : y ≠ (0 : A)), ∀ x ∈ s, IsIntegral A (y • x) := by
  haveI := Classical.decEq L
  refine' s.induction _ _
  · use 1, one_ne_zero
    rintro x ⟨⟩
  · rintro x s hx ⟨y, hy, hs⟩
    have := exists_integral_multiple
      ((IsFractionRing.isAlgebraic_iff A K L).mpr (.of_finite _ x))
      ((injective_iff_map_eq_zero (algebraMap A L)).mp ?_)
    rcases this with ⟨x', y', hy', hx'⟩
    refine' ⟨y * y', mul_ne_zero hy hy', fun x'' hx'' => _⟩
    

Proof state:
case refine'_2.intro.intro.refine_2.intro.intro.intro
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁵ : CommRing R
inst✝¹⁴ : CommRing A
inst✝¹³ : Field K
inst✝¹² : IsDomain A
inst✝¹¹ : Algebra A K
inst✝¹⁰ : IsFractionRing A K
L : Type u_4
inst✝⁹ : Field L
C : Type u_5
inst✝⁸ : CommRing C
inst✝⁷ : Algebra K L
inst✝⁶ : Algebra A L
inst✝⁵ : IsScalarTower A K L
inst✝⁴ : Algebra C L
inst✝³ : IsIntegralClosure C A L
inst✝² : Algebra A C
inst✝¹ : IsScalarTower A C L
inst✝ : FiniteDimensional K L
s✝ : Finset L
this : DecidableEq L
x : L
s : Finset L
hx : x ∉ s
y : A
hy : y ≠ 0
hs : ∀ x ∈ s, IsIntegral A (y • x)
x' : ↥(integralClosure A L)
y' : A
hy' : y' ≠ 0
hx' : x * (algebraMap A L) y' = ↑x'
x'' : L
hx'' : x'' ∈ insert x s
⊢ IsIntegral A ((y * y') • x'')
case refine'_2.intro.intro.refine_1
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁵ : CommRing R
inst✝¹⁴ : CommRing A
inst✝¹³ : Field K
inst✝¹² : IsDomain A
inst✝¹¹ : Algebra A K
inst✝¹⁰ : IsFractionRing A K
L : Type u_4
inst✝⁹ : Field L
C : Type u_5
inst✝⁸ : CommRing C
inst✝⁷ : Algebra K L
inst✝⁶ : Algebra A L
inst✝⁵ : IsScalarTower A K L
inst✝⁴ : Algebra C L
inst✝³ : IsIntegralClosure C A L
inst✝² : Algebra A C
inst✝¹ : IsScalarTower A C L
inst✝ : FiniteDimensional K L
s✝ : Finset L
this : DecidableEq L
x : L
s : Finset L
hx : x ∉ s
y : A
hy : y ≠ 0
hs : ∀ x ∈ s, IsIntegral A (y • x)
⊢ Function.Injective ⇑(algebraMap A L)

Next tactic:
rcases Finset.mem_insert.mp hx'' with (rfl | hx'')
/-- Send a set of `x`s in a finite extension `L` of the fraction field of `R`
to `(y : R) • x ∈ integralClosure R L`. -/
theorem exists_integral_multiples (s : Finset L) :
    ∃ (y : _) (_ : y ≠ (0 : A)), ∀ x ∈ s, IsIntegral A (y • x) := by
  haveI := Classical.decEq L
  refine' s.induction _ _
  · use 1, one_ne_zero
    rintro x ⟨⟩
  · rintro x s hx ⟨y, hy, hs⟩
    have := exists_integral_multiple
      ((IsFractionRing.isAlgebraic_iff A K L).mpr (.of_finite _ x))
      ((injective_iff_map_eq_zero (algebraMap A L)).mp ?_)
    rcases this with ⟨x', y', hy', hx'⟩
    refine' ⟨y * y', mul_ne_zero hy hy', fun x'' hx'' => _⟩
    rcases Finset.mem_insert.mp hx'' with (rfl | hx'')
    · 

Proof state:
case refine'_2.intro.intro.refine_2.intro.intro.intro.inl
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁵ : CommRing R
inst✝¹⁴ : CommRing A
inst✝¹³ : Field K
inst✝¹² : IsDomain A
inst✝¹¹ : Algebra A K
inst✝¹⁰ : IsFractionRing A K
L : Type u_4
inst✝⁹ : Field L
C : Type u_5
inst✝⁸ : CommRing C
inst✝⁷ : Algebra K L
inst✝⁶ : Algebra A L
inst✝⁵ : IsScalarTower A K L
inst✝⁴ : Algebra C L
inst✝³ : IsIntegralClosure C A L
inst✝² : Algebra A C
inst✝¹ : IsScalarTower A C L
inst✝ : FiniteDimensional K L
s✝ : Finset L
this : DecidableEq L
s : Finset L
y : A
hy : y ≠ 0
hs : ∀ x ∈ s, IsIntegral A (y • x)
x' : ↥(integralClosure A L)
y' : A
hy' : y' ≠ 0
x'' : L
hx : x'' ∉ s
hx' : x'' * (algebraMap A L) y' = ↑x'
hx'' : x'' ∈ insert x'' s
⊢ IsIntegral A ((y * y') • x'')

Next tactic:
rw [mul_smul, Algebra.smul_def, Algebra.smul_def, mul_comm _ x'', hx']
/-- Send a set of `x`s in a finite extension `L` of the fraction field of `R`
to `(y : R) • x ∈ integralClosure R L`. -/
theorem exists_integral_multiples (s : Finset L) :
    ∃ (y : _) (_ : y ≠ (0 : A)), ∀ x ∈ s, IsIntegral A (y • x) := by
  haveI := Classical.decEq L
  refine' s.induction _ _
  · use 1, one_ne_zero
    rintro x ⟨⟩
  · rintro x s hx ⟨y, hy, hs⟩
    have := exists_integral_multiple
      ((IsFractionRing.isAlgebraic_iff A K L).mpr (.of_finite _ x))
      ((injective_iff_map_eq_zero (algebraMap A L)).mp ?_)
    rcases this with ⟨x', y', hy', hx'⟩
    refine' ⟨y * y', mul_ne_zero hy hy', fun x'' hx'' => _⟩
    rcases Finset.mem_insert.mp hx'' with (rfl | hx'')
    · rw [mul_smul, Algebra.smul_def, Algebra.smul_def, mul_comm _ x'', hx']
      

Proof state:
case refine'_2.intro.intro.refine_2.intro.intro.intro.inl
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁵ : CommRing R
inst✝¹⁴ : CommRing A
inst✝¹³ : Field K
inst✝¹² : IsDomain A
inst✝¹¹ : Algebra A K
inst✝¹⁰ : IsFractionRing A K
L : Type u_4
inst✝⁹ : Field L
C : Type u_5
inst✝⁸ : CommRing C
inst✝⁷ : Algebra K L
inst✝⁶ : Algebra A L
inst✝⁵ : IsScalarTower A K L
inst✝⁴ : Algebra C L
inst✝³ : IsIntegralClosure C A L
inst✝² : Algebra A C
inst✝¹ : IsScalarTower A C L
inst✝ : FiniteDimensional K L
s✝ : Finset L
this : DecidableEq L
s : Finset L
y : A
hy : y ≠ 0
hs : ∀ x ∈ s, IsIntegral A (y • x)
x' : ↥(integralClosure A L)
y' : A
hy' : y' ≠ 0
x'' : L
hx : x'' ∉ s
hx' : x'' * (algebraMap A L) y' = ↑x'
hx'' : x'' ∈ insert x'' s
⊢ IsIntegral A ((algebraMap A L) y * ↑x')

Next tactic:
exact isIntegral_algebraMap.mul x'.2
/-- Send a set of `x`s in a finite extension `L` of the fraction field of `R`
to `(y : R) • x ∈ integralClosure R L`. -/
theorem exists_integral_multiples (s : Finset L) :
    ∃ (y : _) (_ : y ≠ (0 : A)), ∀ x ∈ s, IsIntegral A (y • x) := by
  haveI := Classical.decEq L
  refine' s.induction _ _
  · use 1, one_ne_zero
    rintro x ⟨⟩
  · rintro x s hx ⟨y, hy, hs⟩
    have := exists_integral_multiple
      ((IsFractionRing.isAlgebraic_iff A K L).mpr (.of_finite _ x))
      ((injective_iff_map_eq_zero (algebraMap A L)).mp ?_)
    rcases this with ⟨x', y', hy', hx'⟩
    refine' ⟨y * y', mul_ne_zero hy hy', fun x'' hx'' => _⟩
    rcases Finset.mem_insert.mp hx'' with (rfl | hx'')
    · rw [mul_smul, Algebra.smul_def, Algebra.smul_def, mul_comm _ x'', hx']
      exact isIntegral_algebraMap.mul x'.2
    · 

Proof state:
case refine'_2.intro.intro.refine_2.intro.intro.intro.inr
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁵ : CommRing R
inst✝¹⁴ : CommRing A
inst✝¹³ : Field K
inst✝¹² : IsDomain A
inst✝¹¹ : Algebra A K
inst✝¹⁰ : IsFractionRing A K
L : Type u_4
inst✝⁹ : Field L
C : Type u_5
inst✝⁸ : CommRing C
inst✝⁷ : Algebra K L
inst✝⁶ : Algebra A L
inst✝⁵ : IsScalarTower A K L
inst✝⁴ : Algebra C L
inst✝³ : IsIntegralClosure C A L
inst✝² : Algebra A C
inst✝¹ : IsScalarTower A C L
inst✝ : FiniteDimensional K L
s✝ : Finset L
this : DecidableEq L
x : L
s : Finset L
hx : x ∉ s
y : A
hy : y ≠ 0
hs : ∀ x ∈ s, IsIntegral A (y • x)
x' : ↥(integralClosure A L)
y' : A
hy' : y' ≠ 0
hx' : x * (algebraMap A L) y' = ↑x'
x'' : L
hx''✝ : x'' ∈ insert x s
hx'' : x'' ∈ s
⊢ IsIntegral A ((y * y') • x'')

Next tactic:
rw [mul_comm, mul_smul, Algebra.smul_def]
/-- Send a set of `x`s in a finite extension `L` of the fraction field of `R`
to `(y : R) • x ∈ integralClosure R L`. -/
theorem exists_integral_multiples (s : Finset L) :
    ∃ (y : _) (_ : y ≠ (0 : A)), ∀ x ∈ s, IsIntegral A (y • x) := by
  haveI := Classical.decEq L
  refine' s.induction _ _
  · use 1, one_ne_zero
    rintro x ⟨⟩
  · rintro x s hx ⟨y, hy, hs⟩
    have := exists_integral_multiple
      ((IsFractionRing.isAlgebraic_iff A K L).mpr (.of_finite _ x))
      ((injective_iff_map_eq_zero (algebraMap A L)).mp ?_)
    rcases this with ⟨x', y', hy', hx'⟩
    refine' ⟨y * y', mul_ne_zero hy hy', fun x'' hx'' => _⟩
    rcases Finset.mem_insert.mp hx'' with (rfl | hx'')
    · rw [mul_smul, Algebra.smul_def, Algebra.smul_def, mul_comm _ x'', hx']
      exact isIntegral_algebraMap.mul x'.2
    · rw [mul_comm, mul_smul, Algebra.smul_def]
      

Proof state:
case refine'_2.intro.intro.refine_2.intro.intro.intro.inr
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁵ : CommRing R
inst✝¹⁴ : CommRing A
inst✝¹³ : Field K
inst✝¹² : IsDomain A
inst✝¹¹ : Algebra A K
inst✝¹⁰ : IsFractionRing A K
L : Type u_4
inst✝⁹ : Field L
C : Type u_5
inst✝⁸ : CommRing C
inst✝⁷ : Algebra K L
inst✝⁶ : Algebra A L
inst✝⁵ : IsScalarTower A K L
inst✝⁴ : Algebra C L
inst✝³ : IsIntegralClosure C A L
inst✝² : Algebra A C
inst✝¹ : IsScalarTower A C L
inst✝ : FiniteDimensional K L
s✝ : Finset L
this : DecidableEq L
x : L
s : Finset L
hx : x ∉ s
y : A
hy : y ≠ 0
hs : ∀ x ∈ s, IsIntegral A (y • x)
x' : ↥(integralClosure A L)
y' : A
hy' : y' ≠ 0
hx' : x * (algebraMap A L) y' = ↑x'
x'' : L
hx''✝ : x'' ∈ insert x s
hx'' : x'' ∈ s
⊢ IsIntegral A ((algebraMap A L) y' * y • x'')

Next tactic:
exact isIntegral_algebraMap.mul (hs _ hx'')
/-- Send a set of `x`s in a finite extension `L` of the fraction field of `R`
to `(y : R) • x ∈ integralClosure R L`. -/
theorem exists_integral_multiples (s : Finset L) :
    ∃ (y : _) (_ : y ≠ (0 : A)), ∀ x ∈ s, IsIntegral A (y • x) := by
  haveI := Classical.decEq L
  refine' s.induction _ _
  · use 1, one_ne_zero
    rintro x ⟨⟩
  · rintro x s hx ⟨y, hy, hs⟩
    have := exists_integral_multiple
      ((IsFractionRing.isAlgebraic_iff A K L).mpr (.of_finite _ x))
      ((injective_iff_map_eq_zero (algebraMap A L)).mp ?_)
    rcases this with ⟨x', y', hy', hx'⟩
    refine' ⟨y * y', mul_ne_zero hy hy', fun x'' hx'' => _⟩
    rcases Finset.mem_insert.mp hx'' with (rfl | hx'')
    · rw [mul_smul, Algebra.smul_def, Algebra.smul_def, mul_comm _ x'', hx']
      exact isIntegral_algebraMap.mul x'.2
    · rw [mul_comm, mul_smul, Algebra.smul_def]
      exact isIntegral_algebraMap.mul (hs _ hx'')
    · 

Proof state:
case refine'_2.intro.intro.refine_1
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁵ : CommRing R
inst✝¹⁴ : CommRing A
inst✝¹³ : Field K
inst✝¹² : IsDomain A
inst✝¹¹ : Algebra A K
inst✝¹⁰ : IsFractionRing A K
L : Type u_4
inst✝⁹ : Field L
C : Type u_5
inst✝⁸ : CommRing C
inst✝⁷ : Algebra K L
inst✝⁶ : Algebra A L
inst✝⁵ : IsScalarTower A K L
inst✝⁴ : Algebra C L
inst✝³ : IsIntegralClosure C A L
inst✝² : Algebra A C
inst✝¹ : IsScalarTower A C L
inst✝ : FiniteDimensional K L
s✝ : Finset L
this : DecidableEq L
x : L
s : Finset L
hx : x ∉ s
y : A
hy : y ≠ 0
hs : ∀ x ∈ s, IsIntegral A (y • x)
⊢ Function.Injective ⇑(algebraMap A L)

Next tactic:
rw [IsScalarTower.algebraMap_eq A K L]
/-- Send a set of `x`s in a finite extension `L` of the fraction field of `R`
to `(y : R) • x ∈ integralClosure R L`. -/
theorem exists_integral_multiples (s : Finset L) :
    ∃ (y : _) (_ : y ≠ (0 : A)), ∀ x ∈ s, IsIntegral A (y • x) := by
  haveI := Classical.decEq L
  refine' s.induction _ _
  · use 1, one_ne_zero
    rintro x ⟨⟩
  · rintro x s hx ⟨y, hy, hs⟩
    have := exists_integral_multiple
      ((IsFractionRing.isAlgebraic_iff A K L).mpr (.of_finite _ x))
      ((injective_iff_map_eq_zero (algebraMap A L)).mp ?_)
    rcases this with ⟨x', y', hy', hx'⟩
    refine' ⟨y * y', mul_ne_zero hy hy', fun x'' hx'' => _⟩
    rcases Finset.mem_insert.mp hx'' with (rfl | hx'')
    · rw [mul_smul, Algebra.smul_def, Algebra.smul_def, mul_comm _ x'', hx']
      exact isIntegral_algebraMap.mul x'.2
    · rw [mul_comm, mul_smul, Algebra.smul_def]
      exact isIntegral_algebraMap.mul (hs _ hx'')
    · rw [IsScalarTower.algebraMap_eq A K L]
      

Proof state:
case refine'_2.intro.intro.refine_1
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁵ : CommRing R
inst✝¹⁴ : CommRing A
inst✝¹³ : Field K
inst✝¹² : IsDomain A
inst✝¹¹ : Algebra A K
inst✝¹⁰ : IsFractionRing A K
L : Type u_4
inst✝⁹ : Field L
C : Type u_5
inst✝⁸ : CommRing C
inst✝⁷ : Algebra K L
inst✝⁶ : Algebra A L
inst✝⁵ : IsScalarTower A K L
inst✝⁴ : Algebra C L
inst✝³ : IsIntegralClosure C A L
inst✝² : Algebra A C
inst✝¹ : IsScalarTower A C L
inst✝ : FiniteDimensional K L
s✝ : Finset L
this : DecidableEq L
x : L
s : Finset L
hx : x ∉ s
y : A
hy : y ≠ 0
hs : ∀ x ∈ s, IsIntegral A (y • x)
⊢ Function.Injective ⇑(RingHom.comp (algebraMap K L) (algebraMap A K))

Next tactic:
apply (algebraMap K L).injective.comp
/-- Send a set of `x`s in a finite extension `L` of the fraction field of `R`
to `(y : R) • x ∈ integralClosure R L`. -/
theorem exists_integral_multiples (s : Finset L) :
    ∃ (y : _) (_ : y ≠ (0 : A)), ∀ x ∈ s, IsIntegral A (y • x) := by
  haveI := Classical.decEq L
  refine' s.induction _ _
  · use 1, one_ne_zero
    rintro x ⟨⟩
  · rintro x s hx ⟨y, hy, hs⟩
    have := exists_integral_multiple
      ((IsFractionRing.isAlgebraic_iff A K L).mpr (.of_finite _ x))
      ((injective_iff_map_eq_zero (algebraMap A L)).mp ?_)
    rcases this with ⟨x', y', hy', hx'⟩
    refine' ⟨y * y', mul_ne_zero hy hy', fun x'' hx'' => _⟩
    rcases Finset.mem_insert.mp hx'' with (rfl | hx'')
    · rw [mul_smul, Algebra.smul_def, Algebra.smul_def, mul_comm _ x'', hx']
      exact isIntegral_algebraMap.mul x'.2
    · rw [mul_comm, mul_smul, Algebra.smul_def]
      exact isIntegral_algebraMap.mul (hs _ hx'')
    · rw [IsScalarTower.algebraMap_eq A K L]
      apply (algebraMap K L).injective.comp
      

Proof state:
case refine'_2.intro.intro.refine_1
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁵ : CommRing R
inst✝¹⁴ : CommRing A
inst✝¹³ : Field K
inst✝¹² : IsDomain A
inst✝¹¹ : Algebra A K
inst✝¹⁰ : IsFractionRing A K
L : Type u_4
inst✝⁹ : Field L
C : Type u_5
inst✝⁸ : CommRing C
inst✝⁷ : Algebra K L
inst✝⁶ : Algebra A L
inst✝⁵ : IsScalarTower A K L
inst✝⁴ : Algebra C L
inst✝³ : IsIntegralClosure C A L
inst✝² : Algebra A C
inst✝¹ : IsScalarTower A C L
inst✝ : FiniteDimensional K L
s✝ : Finset L
this : DecidableEq L
x : L
s : Finset L
hx : x ∉ s
y : A
hy : y ≠ 0
hs : ∀ x ∈ s, IsIntegral A (y • x)
⊢ Function.Injective fun x => (algebraMap A K) x

Next tactic:
exact IsFractionRing.injective _ _
/-- If `L` is a finite extension of `K = Frac(A)`,
then `L` has a basis over `A` consisting of integral elements. -/
theorem FiniteDimensional.exists_is_basis_integral :
    ∃ (s : Finset L) (b : Basis s K L), ∀ x, IsIntegral A (b x) := by
  

Proof state:
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁵ : CommRing R
inst✝¹⁴ : CommRing A
inst✝¹³ : Field K
inst✝¹² : IsDomain A
inst✝¹¹ : Algebra A K
inst✝¹⁰ : IsFractionRing A K
L : Type u_4
inst✝⁹ : Field L
C : Type u_5
inst✝⁸ : CommRing C
inst✝⁷ : Algebra K L
inst✝⁶ : Algebra A L
inst✝⁵ : IsScalarTower A K L
inst✝⁴ : Algebra C L
inst✝³ : IsIntegralClosure C A L
inst✝² : Algebra A C
inst✝¹ : IsScalarTower A C L
inst✝ : FiniteDimensional K L
⊢ ∃ s b, ∀ (x : { x // x ∈ s }), IsIntegral A (b x)

Next tactic:
letI := Classical.decEq L
/-- If `L` is a finite extension of `K = Frac(A)`,
then `L` has a basis over `A` consisting of integral elements. -/
theorem FiniteDimensional.exists_is_basis_integral :
    ∃ (s : Finset L) (b : Basis s K L), ∀ x, IsIntegral A (b x) := by
  letI := Classical.decEq L
  

Proof state:
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁵ : CommRing R
inst✝¹⁴ : CommRing A
inst✝¹³ : Field K
inst✝¹² : IsDomain A
inst✝¹¹ : Algebra A K
inst✝¹⁰ : IsFractionRing A K
L : Type u_4
inst✝⁹ : Field L
C : Type u_5
inst✝⁸ : CommRing C
inst✝⁷ : Algebra K L
inst✝⁶ : Algebra A L
inst✝⁵ : IsScalarTower A K L
inst✝⁴ : Algebra C L
inst✝³ : IsIntegralClosure C A L
inst✝² : Algebra A C
inst✝¹ : IsScalarTower A C L
inst✝ : FiniteDimensional K L
this : DecidableEq L := Classical.decEq L
⊢ ∃ s b, ∀ (x : { x // x ∈ s }), IsIntegral A (b x)

Next tactic:
letI : IsNoetherian K L := IsNoetherian.iff_fg.2 inferInstance
/-- If `L` is a finite extension of `K = Frac(A)`,
then `L` has a basis over `A` consisting of integral elements. -/
theorem FiniteDimensional.exists_is_basis_integral :
    ∃ (s : Finset L) (b : Basis s K L), ∀ x, IsIntegral A (b x) := by
  letI := Classical.decEq L
  letI : IsNoetherian K L := IsNoetherian.iff_fg.2 inferInstance
  

Proof state:
R : Type u_1
A : Type u_2
K : Type u_3
inst✝¹⁵ : CommRing R
inst✝¹⁴ : CommRing A
inst✝¹³ : Field K
inst✝¹² : IsDomain A
inst✝¹¹ : Algebra A K
inst✝¹⁰ : IsFractionRing A K
L : Type u_4
inst✝⁹ : Field L
C : Type u_5
inst✝⁸ : CommRing C
inst✝⁷ : Algebra K L
inst✝⁶ : Algebra A L
inst✝⁵ : IsScalarTower A K L
inst✝⁴ : Algebra C L
inst✝³ : IsIntegralClosure C A L
inst✝² : Algebra A C
inst✝¹ : IsScalarTower A C L
inst✝ : FiniteDimensional K L
this✝ : DecidableEq L := Classical.decEq L
this : IsNoetherian K L := IsNoetherian.iff_fg.mpr inferInstance
⊢ ∃ s b, ∀ (x : { x // x ∈ s }), IsIntegral A (b x)

Next tactic:
let s' := IsNoetherian.finsetBasisIndex K L