-- Mathlib/RingTheory/DedekindDomain/IntegralClosure.lean
theorem FiniteDimensional.exists_is_basis_integral :
    ∃ (s : Finset L) (b : Basis s K L), ∀ x, IsIntegral A (b x)

Proof state:
A : Type u_1
K : Type u_2
inst✝⁹ : CommRing A
inst✝⁸ : Field K
inst✝⁷ : Algebra A K
inst✝⁶ : IsFractionRing A K
L : Type u_3
inst✝⁵ : Field L
inst✝⁴ : Algebra K L
inst✝³ : Algebra A L
inst✝² : IsScalarTower A K L
inst✝¹ : FiniteDimensional K L
inst✝ : IsDomain A
this✝ : DecidableEq L := Classical.decEq L
this : IsNoetherian K L := IsNoetherian.iff_fg.mpr inferInstance
s' : Finset L := IsNoetherian.finsetBasisIndex K L
bs' : Basis { x // x ∈ IsNoetherian.finsetBasisIndex K L } K L := IsNoetherian.finsetBasis K L
y : A
hy : y ≠ 0
his' : ∀ x ∈ Finset.image (⇑bs') Finset.univ, IsIntegral A (y • x)
⊢ Function.Injective ⇑(algebraMap A L)

Tactic:
rw [IsScalarTower.algebraMap_eq A K L]

Result:
A : Type u_1
K : Type u_2
inst✝⁹ : CommRing A
inst✝⁸ : Field K
inst✝⁷ : Algebra A K
inst✝⁶ : IsFractionRing A K
L : Type u_3
inst✝⁵ : Field L
inst✝⁴ : Algebra K L
inst✝³ : Algebra A L
inst✝² : IsScalarTower A K L
inst✝¹ : FiniteDimensional K L
inst✝ : IsDomain A
this✝ : DecidableEq L := Classical.decEq L
this : IsNoetherian K L := IsNoetherian.iff_fg.mpr inferInstance
s' : Finset L := IsNoetherian.finsetBasisIndex K L
bs' : Basis { x // x ∈ IsNoetherian.finsetBasisIndex K L } K L := IsNoetherian.finsetBasis K L
y : A
hy : y ≠ 0
his' : ∀ x ∈ Finset.image (⇑bs') Finset.univ, IsIntegral A (y • x)
⊢ Function.Injective ⇑((algebraMap K L).comp (algebraMap A K))

Proof state:
case intro.intro.refine_2
A : Type u_1
K : Type u_2
inst✝⁹ : CommRing A
inst✝⁸ : Field K
inst✝⁷ : Algebra A K
inst✝⁶ : IsFractionRing A K
L : Type u_3
inst✝⁵ : Field L
inst✝⁴ : Algebra K L
inst✝³ : Algebra A L
inst✝² : IsScalarTower A K L
inst✝¹ : FiniteDimensional K L
inst✝ : IsDomain A
this✝ : DecidableEq L := Classical.decEq L
this : IsNoetherian K L := IsNoetherian.iff_fg.mpr inferInstance
s' : Finset L := IsNoetherian.finsetBasisIndex K L
bs' : Basis { x // x ∈ IsNoetherian.finsetBasisIndex K L } K L := IsNoetherian.finsetBasis K L
y : A
hy : y ≠ 0
his' : ∀ x ∈ Finset.image (⇑bs') Finset.univ, IsIntegral A (y • x)
hy' : (algebraMap A L) y ≠ 0
⊢ Function.RightInverse (fun x => ((algebraMap A L) y)⁻¹ * x)
    { toFun := fun x => (algebraMap A L) y * x, map_add' := ⋯, map_smul' := ⋯ }.toFun

Tactic:
intro x

Result:
case intro.intro.refine_2
A : Type u_1
K : Type u_2
inst✝⁹ : CommRing A
inst✝⁸ : Field K
inst✝⁷ : Algebra A K
inst✝⁶ : IsFractionRing A K
L : Type u_3
inst✝⁵ : Field L
inst✝⁴ : Algebra K L
inst✝³ : Algebra A L
inst✝² : IsScalarTower A K L
inst✝¹ : FiniteDimensional K L
inst✝ : IsDomain A
this✝ : DecidableEq L := Classical.decEq L
this : IsNoetherian K L := IsNoetherian.iff_fg.mpr inferInstance
s' : Finset L := IsNoetherian.finsetBasisIndex K L
bs' : Basis { x // x ∈ IsNoetherian.finsetBasisIndex K L } K L := IsNoetherian.finsetBasis K L
y : A
hy : y ≠ 0
his' : ∀ x ∈ Finset.image (⇑bs') Finset.univ, IsIntegral A (y • x)
hy' : (algebraMap A L) y ≠ 0
x : L
⊢ { toFun := fun x => (algebraMap A L) y * x, map_add' := ⋯, map_smul' := ⋯ }.toFun
      ((fun x => ((algebraMap A L) y)⁻¹ * x) x) =
    x

Proof state:
case intro.intro.refine_3.mk
A : Type u_1
K : Type u_2
inst✝⁹ : CommRing A
inst✝⁸ : Field K
inst✝⁷ : Algebra A K
inst✝⁶ : IsFractionRing A K
L : Type u_3
inst✝⁵ : Field L
inst✝⁴ : Algebra K L
inst✝³ : Algebra A L
inst✝² : IsScalarTower A K L
inst✝¹ : FiniteDimensional K L
inst✝ : IsDomain A
this✝ : DecidableEq L := Classical.decEq L
this : IsNoetherian K L := IsNoetherian.iff_fg.mpr inferInstance
s' : Finset L := IsNoetherian.finsetBasisIndex K L
bs' : Basis { x // x ∈ IsNoetherian.finsetBasisIndex K L } K L := IsNoetherian.finsetBasis K L
y : A
hy : y ≠ 0
hy' : (algebraMap A L) y ≠ 0
x' : L
hx' : x' ∈ s'
his' : ∀ (x : L), (∃ a, bs' a = x) → IsIntegral A ((algebraMap A L) y * x)
⊢ IsIntegral A ((algebraMap A L) y * bs' ⟨x', hx'⟩)

Tactic:
exact his' _ ⟨_, rfl⟩

Result:
no goals