l3lab/ntp-mathlib huggingface dataset:
lemma Submodule.one_le_traceDual_one :
    (1 : Submodule B L) ≤ 1ᵛ := by
  rw [le_traceDual_iff_map_le_one, mul_one]
  rintro _ ⟨x, ⟨x, rfl⟩, rfl⟩
  

Proof state:
case intro.intro.intro
A : Type u_1
K : Type u_2
L : Type u
B : Type u_3
inst✝¹⁸ : CommRing A
inst✝¹⁷ : Field K
inst✝¹⁶ : CommRing B
inst✝¹⁵ : Field L
inst✝¹⁴ : Algebra A K
inst✝¹³ : Algebra B L
inst✝¹² : Algebra A B
inst✝¹¹ : Algebra K L
inst✝¹⁰ : Algebra A L
inst✝⁹ : IsScalarTower A K L
inst✝⁸ : IsScalarTower A B L
inst✝⁷ : IsDomain A
inst✝⁶ : IsDomain B
inst✝⁵ : IsFractionRing A K
inst✝⁴ : IsIntegralClosure B A L
inst✝³ : IsFractionRing B L
inst✝² : FiniteDimensional K L
inst✝¹ : IsSeparable K L
inst✝ : IsIntegrallyClosed A
x : B
⊢ (↑A (Algebra.trace K L)) ((Algebra.linearMap B L) x) ∈ 1

Next tactic:
apply IsIntegrallyClosed.isIntegral_iff.mp
lemma Submodule.one_le_traceDual_one :
    (1 : Submodule B L) ≤ 1ᵛ := by
  rw [le_traceDual_iff_map_le_one, mul_one]
  rintro _ ⟨x, ⟨x, rfl⟩, rfl⟩
  apply IsIntegrallyClosed.isIntegral_iff.mp
  

Proof state:
case intro.intro.intro
A : Type u_1
K : Type u_2
L : Type u
B : Type u_3
inst✝¹⁸ : CommRing A
inst✝¹⁷ : Field K
inst✝¹⁶ : CommRing B
inst✝¹⁵ : Field L
inst✝¹⁴ : Algebra A K
inst✝¹³ : Algebra B L
inst✝¹² : Algebra A B
inst✝¹¹ : Algebra K L
inst✝¹⁰ : Algebra A L
inst✝⁹ : IsScalarTower A K L
inst✝⁸ : IsScalarTower A B L
inst✝⁷ : IsDomain A
inst✝⁶ : IsDomain B
inst✝⁵ : IsFractionRing A K
inst✝⁴ : IsIntegralClosure B A L
inst✝³ : IsFractionRing B L
inst✝² : FiniteDimensional K L
inst✝¹ : IsSeparable K L
inst✝ : IsIntegrallyClosed A
x : B
⊢ IsIntegral A ((↑A (Algebra.trace K L)) ((Algebra.linearMap B L) x))

Next tactic:
apply isIntegral_trace
lemma Submodule.one_le_traceDual_one :
    (1 : Submodule B L) ≤ 1ᵛ := by
  rw [le_traceDual_iff_map_le_one, mul_one]
  rintro _ ⟨x, ⟨x, rfl⟩, rfl⟩
  apply IsIntegrallyClosed.isIntegral_iff.mp
  apply isIntegral_trace
  

Proof state:
case intro.intro.intro.hx
A : Type u_1
K : Type u_2
L : Type u
B : Type u_3
inst✝¹⁸ : CommRing A
inst✝¹⁷ : Field K
inst✝¹⁶ : CommRing B
inst✝¹⁵ : Field L
inst✝¹⁴ : Algebra A K
inst✝¹³ : Algebra B L
inst✝¹² : Algebra A B
inst✝¹¹ : Algebra K L
inst✝¹⁰ : Algebra A L
inst✝⁹ : IsScalarTower A K L
inst✝⁸ : IsScalarTower A B L
inst✝⁷ : IsDomain A
inst✝⁶ : IsDomain B
inst✝⁵ : IsFractionRing A K
inst✝⁴ : IsIntegralClosure B A L
inst✝³ : IsFractionRing B L
inst✝² : FiniteDimensional K L
inst✝¹ : IsSeparable K L
inst✝ : IsIntegrallyClosed A
x : B
⊢ IsIntegral A ((Algebra.linearMap B L) x)

Next tactic:
rw [IsIntegralClosure.isIntegral_iff (A := B)]
lemma Submodule.one_le_traceDual_one :
    (1 : Submodule B L) ≤ 1ᵛ := by
  rw [le_traceDual_iff_map_le_one, mul_one]
  rintro _ ⟨x, ⟨x, rfl⟩, rfl⟩
  apply IsIntegrallyClosed.isIntegral_iff.mp
  apply isIntegral_trace
  rw [IsIntegralClosure.isIntegral_iff (A := B)]
  

Proof state:
case intro.intro.intro.hx
A : Type u_1
K : Type u_2
L : Type u
B : Type u_3
inst✝¹⁸ : CommRing A
inst✝¹⁷ : Field K
inst✝¹⁶ : CommRing B
inst✝¹⁵ : Field L
inst✝¹⁴ : Algebra A K
inst✝¹³ : Algebra B L
inst✝¹² : Algebra A B
inst✝¹¹ : Algebra K L
inst✝¹⁰ : Algebra A L
inst✝⁹ : IsScalarTower A K L
inst✝⁸ : IsScalarTower A B L
inst✝⁷ : IsDomain A
inst✝⁶ : IsDomain B
inst✝⁵ : IsFractionRing A K
inst✝⁴ : IsIntegralClosure B A L
inst✝³ : IsFractionRing B L
inst✝² : FiniteDimensional K L
inst✝¹ : IsSeparable K L
inst✝ : IsIntegrallyClosed A
x : B
⊢ ∃ y, (algebraMap B L) y = (Algebra.linearMap B L) x

Next tactic:
exact ⟨_, rfl⟩
/-- If `b` is an `A`-integral basis of `L` with discriminant `b`, then `d • a * x` is integral over
  `A` for all `a ∈ I` and `x ∈ Iᵛ`. -/
lemma isIntegral_discr_mul_of_mem_traceDual
    (I : Submodule B L) {ι} [DecidableEq ι] [Fintype ι]
    {b : Basis ι K L} (hb : ∀ i, IsIntegral A (b i))
    {a x : L} (ha : a ∈ I) (hx : x ∈ Iᵛ) :
    IsIntegral A ((discr K b) • a * x) := by
  

Proof state:
A : Type u_1
K : Type u_2
L : Type u
B : Type u_3
inst✝²⁰ : CommRing A
inst✝¹⁹ : Field K
inst✝¹⁸ : CommRing B
inst✝¹⁷ : Field L
inst✝¹⁶ : Algebra A K
inst✝¹⁵ : Algebra B L
inst✝¹⁴ : Algebra A B
inst✝¹³ : Algebra K L
inst✝¹² : Algebra A L
inst✝¹¹ : IsScalarTower A K L
inst✝¹⁰ : IsScalarTower A B L
inst✝⁹ : IsDomain A
inst✝⁸ : IsDomain B
inst✝⁷ : IsFractionRing A K
inst✝⁶ : IsIntegralClosure B A L
inst✝⁵ : IsFractionRing B L
inst✝⁴ : FiniteDimensional K L
inst✝³ : IsSeparable K L
inst✝² : IsIntegrallyClosed A
I : Submodule B L
ι : Type u_4
inst✝¹ : DecidableEq ι
inst✝ : Fintype ι
b : Basis ι K L
hb : ∀ (i : ι), IsIntegral A (b i)
a x : L
ha : a ∈ I
hx : x ∈ Iᵛ
⊢ IsIntegral A (discr K ⇑b • a * x)

Next tactic:
have hinv : IsUnit (traceMatrix K b).det := by
    simpa [← discr_def] using discr_isUnit_of_basis _ b
/-- If `b` is an `A`-integral basis of `L` with discriminant `b`, then `d • a * x` is integral over
  `A` for all `a ∈ I` and `x ∈ Iᵛ`. -/
lemma isIntegral_discr_mul_of_mem_traceDual
    (I : Submodule B L) {ι} [DecidableEq ι] [Fintype ι]
    {b : Basis ι K L} (hb : ∀ i, IsIntegral A (b i))
    {a x : L} (ha : a ∈ I) (hx : x ∈ Iᵛ) :
    IsIntegral A ((discr K b) • a * x) := by
  have hinv : IsUnit (traceMatrix K b).det := by
    

Proof state:
A : Type u_1
K : Type u_2
L : Type u
B : Type u_3
inst✝²⁰ : CommRing A
inst✝¹⁹ : Field K
inst✝¹⁸ : CommRing B
inst✝¹⁷ : Field L
inst✝¹⁶ : Algebra A K
inst✝¹⁵ : Algebra B L
inst✝¹⁴ : Algebra A B
inst✝¹³ : Algebra K L
inst✝¹² : Algebra A L
inst✝¹¹ : IsScalarTower A K L
inst✝¹⁰ : IsScalarTower A B L
inst✝⁹ : IsDomain A
inst✝⁸ : IsDomain B
inst✝⁷ : IsFractionRing A K
inst✝⁶ : IsIntegralClosure B A L
inst✝⁵ : IsFractionRing B L
inst✝⁴ : FiniteDimensional K L
inst✝³ : IsSeparable K L
inst✝² : IsIntegrallyClosed A
I : Submodule B L
ι : Type u_4
inst✝¹ : DecidableEq ι
inst✝ : Fintype ι
b : Basis ι K L
hb : ∀ (i : ι), IsIntegral A (b i)
a x : L
ha : a ∈ I
hx : x ∈ Iᵛ
⊢ IsUnit (det (traceMatrix K ⇑b))

Next tactic:
simpa [← discr_def] using discr_isUnit_of_basis _ b
/-- If `b` is an `A`-integral basis of `L` with discriminant `b`, then `d • a * x` is integral over
  `A` for all `a ∈ I` and `x ∈ Iᵛ`. -/
lemma isIntegral_discr_mul_of_mem_traceDual
    (I : Submodule B L) {ι} [DecidableEq ι] [Fintype ι]
    {b : Basis ι K L} (hb : ∀ i, IsIntegral A (b i))
    {a x : L} (ha : a ∈ I) (hx : x ∈ Iᵛ) :
    IsIntegral A ((discr K b) • a * x) := by
  have hinv : IsUnit (traceMatrix K b).det := by
    simpa [← discr_def] using discr_isUnit_of_basis _ b
  

Proof state:
A : Type u_1
K : Type u_2
L : Type u
B : Type u_3
inst✝²⁰ : CommRing A
inst✝¹⁹ : Field K
inst✝¹⁸ : CommRing B
inst✝¹⁷ : Field L
inst✝¹⁶ : Algebra A K
inst✝¹⁵ : Algebra B L
inst✝¹⁴ : Algebra A B
inst✝¹³ : Algebra K L
inst✝¹² : Algebra A L
inst✝¹¹ : IsScalarTower A K L
inst✝¹⁰ : IsScalarTower A B L
inst✝⁹ : IsDomain A
inst✝⁸ : IsDomain B
inst✝⁷ : IsFractionRing A K
inst✝⁶ : IsIntegralClosure B A L
inst✝⁵ : IsFractionRing B L
inst✝⁴ : FiniteDimensional K L
inst✝³ : IsSeparable K L
inst✝² : IsIntegrallyClosed A
I : Submodule B L
ι : Type u_4
inst✝¹ : DecidableEq ι
inst✝ : Fintype ι
b : Basis ι K L
hb : ∀ (i : ι), IsIntegral A (b i)
a x : L
ha : a ∈ I
hx : x ∈ Iᵛ
hinv : IsUnit (det (traceMatrix K ⇑b))
⊢ IsIntegral A (discr K ⇑b • a * x)

Next tactic:
have H := mulVec_cramer (traceMatrix K b) fun i => trace K L (x * a * b i)
/-- If `b` is an `A`-integral basis of `L` with discriminant `b`, then `d • a * x` is integral over
  `A` for all `a ∈ I` and `x ∈ Iᵛ`. -/
lemma isIntegral_discr_mul_of_mem_traceDual
    (I : Submodule B L) {ι} [DecidableEq ι] [Fintype ι]
    {b : Basis ι K L} (hb : ∀ i, IsIntegral A (b i))
    {a x : L} (ha : a ∈ I) (hx : x ∈ Iᵛ) :
    IsIntegral A ((discr K b) • a * x) := by
  have hinv : IsUnit (traceMatrix K b).det := by
    simpa [← discr_def] using discr_isUnit_of_basis _ b
  have H := mulVec_cramer (traceMatrix K b) fun i => trace K L (x * a * b i)
  

Proof state:
A : Type u_1
K : Type u_2
L : Type u
B : Type u_3
inst✝²⁰ : CommRing A
inst✝¹⁹ : Field K
inst✝¹⁸ : CommRing B
inst✝¹⁷ : Field L
inst✝¹⁶ : Algebra A K
inst✝¹⁵ : Algebra B L
inst✝¹⁴ : Algebra A B
inst✝¹³ : Algebra K L
inst✝¹² : Algebra A L
inst✝¹¹ : IsScalarTower A K L
inst✝¹⁰ : IsScalarTower A B L
inst✝⁹ : IsDomain A
inst✝⁸ : IsDomain B
inst✝⁷ : IsFractionRing A K
inst✝⁶ : IsIntegralClosure B A L
inst✝⁵ : IsFractionRing B L
inst✝⁴ : FiniteDimensional K L
inst✝³ : IsSeparable K L
inst✝² : IsIntegrallyClosed A
I : Submodule B L
ι : Type u_4
inst✝¹ : DecidableEq ι
inst✝ : Fintype ι
b : Basis ι K L
hb : ∀ (i : ι), IsIntegral A (b i)
a x : L
ha : a ∈ I
hx : x ∈ Iᵛ
hinv : IsUnit (det (traceMatrix K ⇑b))
H :
  mulVec (traceMatrix K ⇑b) ((cramer (traceMatrix K ⇑b)) fun i => (Algebra.trace K L) (x * a * b i)) =
    det (traceMatrix K ⇑b) • fun i => (Algebra.trace K L) (x * a * b i)
⊢ IsIntegral A (discr K ⇑b • a * x)

Next tactic:
have : Function.Injective (traceMatrix K b).mulVec
/-- If `b` is an `A`-integral basis of `L` with discriminant `b`, then `d • a * x` is integral over
  `A` for all `a ∈ I` and `x ∈ Iᵛ`. -/
lemma isIntegral_discr_mul_of_mem_traceDual
    (I : Submodule B L) {ι} [DecidableEq ι] [Fintype ι]
    {b : Basis ι K L} (hb : ∀ i, IsIntegral A (b i))
    {a x : L} (ha : a ∈ I) (hx : x ∈ Iᵛ) :
    IsIntegral A ((discr K b) • a * x) := by
  have hinv : IsUnit (traceMatrix K b).det := by
    simpa [← discr_def] using discr_isUnit_of_basis _ b
  have H := mulVec_cramer (traceMatrix K b) fun i => trace K L (x * a * b i)
  have : Function.Injective (traceMatrix K b).mulVec
  · 

Proof state:
case this
A : Type u_1
K : Type u_2
L : Type u
B : Type u_3
inst✝²⁰ : CommRing A
inst✝¹⁹ : Field K
inst✝¹⁸ : CommRing B
inst✝¹⁷ : Field L
inst✝¹⁶ : Algebra A K
inst✝¹⁵ : Algebra B L
inst✝¹⁴ : Algebra A B
inst✝¹³ : Algebra K L
inst✝¹² : Algebra A L
inst✝¹¹ : IsScalarTower A K L
inst✝¹⁰ : IsScalarTower A B L
inst✝⁹ : IsDomain A
inst✝⁸ : IsDomain B
inst✝⁷ : IsFractionRing A K
inst✝⁶ : IsIntegralClosure B A L
inst✝⁵ : IsFractionRing B L
inst✝⁴ : FiniteDimensional K L
inst✝³ : IsSeparable K L
inst✝² : IsIntegrallyClosed A
I : Submodule B L
ι : Type u_4
inst✝¹ : DecidableEq ι
inst✝ : Fintype ι
b : Basis ι K L
hb : ∀ (i : ι), IsIntegral A (b i)
a x : L
ha : a ∈ I
hx : x ∈ Iᵛ
hinv : IsUnit (det (traceMatrix K ⇑b))
H :
  mulVec (traceMatrix K ⇑b) ((cramer (traceMatrix K ⇑b)) fun i => (Algebra.trace K L) (x * a * b i)) =
    det (traceMatrix K ⇑b) • fun i => (Algebra.trace K L) (x * a * b i)
⊢ Function.Injective (mulVec (traceMatrix K ⇑b))

Next tactic:
rwa [mulVec_injective_iff_isUnit, isUnit_iff_isUnit_det]
/-- If `b` is an `A`-integral basis of `L` with discriminant `b`, then `d • a * x` is integral over
  `A` for all `a ∈ I` and `x ∈ Iᵛ`. -/
lemma isIntegral_discr_mul_of_mem_traceDual
    (I : Submodule B L) {ι} [DecidableEq ι] [Fintype ι]
    {b : Basis ι K L} (hb : ∀ i, IsIntegral A (b i))
    {a x : L} (ha : a ∈ I) (hx : x ∈ Iᵛ) :
    IsIntegral A ((discr K b) • a * x) := by
  have hinv : IsUnit (traceMatrix K b).det := by
    simpa [← discr_def] using discr_isUnit_of_basis _ b
  have H := mulVec_cramer (traceMatrix K b) fun i => trace K L (x * a * b i)
  have : Function.Injective (traceMatrix K b).mulVec
  · rwa [mulVec_injective_iff_isUnit, isUnit_iff_isUnit_det]
  

Proof state:
A : Type u_1
K : Type u_2
L : Type u
B : Type u_3
inst✝²⁰ : CommRing A
inst✝¹⁹ : Field K
inst✝¹⁸ : CommRing B
inst✝¹⁷ : Field L
inst✝¹⁶ : Algebra A K
inst✝¹⁵ : Algebra B L
inst✝¹⁴ : Algebra A B
inst✝¹³ : Algebra K L
inst✝¹² : Algebra A L
inst✝¹¹ : IsScalarTower A K L
inst✝¹⁰ : IsScalarTower A B L
inst✝⁹ : IsDomain A
inst✝⁸ : IsDomain B
inst✝⁷ : IsFractionRing A K
inst✝⁶ : IsIntegralClosure B A L
inst✝⁵ : IsFractionRing B L
inst✝⁴ : FiniteDimensional K L
inst✝³ : IsSeparable K L
inst✝² : IsIntegrallyClosed A
I : Submodule B L
ι : Type u_4
inst✝¹ : DecidableEq ι
inst✝ : Fintype ι
b : Basis ι K L
hb : ∀ (i : ι), IsIntegral A (b i)
a x : L
ha : a ∈ I
hx : x ∈ Iᵛ
hinv : IsUnit (det (traceMatrix K ⇑b))
H :
  mulVec (traceMatrix K ⇑b) ((cramer (traceMatrix K ⇑b)) fun i => (Algebra.trace K L) (x * a * b i)) =
    det (traceMatrix K ⇑b) • fun i => (Algebra.trace K L) (x * a * b i)
this : Function.Injective (mulVec (traceMatrix K ⇑b))
⊢ IsIntegral A (discr K ⇑b • a * x)

Next tactic:
rw [← traceMatrix_of_basis_mulVec, ← mulVec_smul, this.eq_iff,
    traceMatrix_of_basis_mulVec] at H
/-- If `b` is an `A`-integral basis of `L` with discriminant `b`, then `d • a * x` is integral over
  `A` for all `a ∈ I` and `x ∈ Iᵛ`. -/
lemma isIntegral_discr_mul_of_mem_traceDual
    (I : Submodule B L) {ι} [DecidableEq ι] [Fintype ι]
    {b : Basis ι K L} (hb : ∀ i, IsIntegral A (b i))
    {a x : L} (ha : a ∈ I) (hx : x ∈ Iᵛ) :
    IsIntegral A ((discr K b) • a * x) := by
  have hinv : IsUnit (traceMatrix K b).det := by
    simpa [← discr_def] using discr_isUnit_of_basis _ b
  have H := mulVec_cramer (traceMatrix K b) fun i => trace K L (x * a * b i)
  have : Function.Injective (traceMatrix K b).mulVec
  · rwa [mulVec_injective_iff_isUnit, isUnit_iff_isUnit_det]
  rw [← traceMatrix_of_basis_mulVec, ← mulVec_smul, this.eq_iff,
    traceMatrix_of_basis_mulVec] at H
  

Proof state:
A : Type u_1
K : Type u_2
L : Type u
B : Type u_3
inst✝²⁰ : CommRing A
inst✝¹⁹ : Field K
inst✝¹⁸ : CommRing B
inst✝¹⁷ : Field L
inst✝¹⁶ : Algebra A K
inst✝¹⁵ : Algebra B L
inst✝¹⁴ : Algebra A B
inst✝¹³ : Algebra K L
inst✝¹² : Algebra A L
inst✝¹¹ : IsScalarTower A K L
inst✝¹⁰ : IsScalarTower A B L
inst✝⁹ : IsDomain A
inst✝⁸ : IsDomain B
inst✝⁷ : IsFractionRing A K
inst✝⁶ : IsIntegralClosure B A L
inst✝⁵ : IsFractionRing B L
inst✝⁴ : FiniteDimensional K L
inst✝³ : IsSeparable K L
inst✝² : IsIntegrallyClosed A
I : Submodule B L
ι : Type u_4
inst✝¹ : DecidableEq ι
inst✝ : Fintype ι
b : Basis ι K L
hb : ∀ (i : ι), IsIntegral A (b i)
a x : L
ha : a ∈ I
hx : x ∈ Iᵛ
hinv : IsUnit (det (traceMatrix K ⇑b))
H :
  ((cramer (traceMatrix K ⇑b)) fun i => (Algebra.trace K L) (x * a * b i)) =
    det (traceMatrix K ⇑b) • (Basis.equivFun b) (x * a)
this : Function.Injective (mulVec (traceMatrix K ⇑b))
⊢ IsIntegral A (discr K ⇑b • a * x)

Next tactic:
rw [← b.equivFun.symm_apply_apply (_ * _), b.equivFun_symm_apply]
/-- If `b` is an `A`-integral basis of `L` with discriminant `b`, then `d • a * x` is integral over
  `A` for all `a ∈ I` and `x ∈ Iᵛ`. -/
lemma isIntegral_discr_mul_of_mem_traceDual
    (I : Submodule B L) {ι} [DecidableEq ι] [Fintype ι]
    {b : Basis ι K L} (hb : ∀ i, IsIntegral A (b i))
    {a x : L} (ha : a ∈ I) (hx : x ∈ Iᵛ) :
    IsIntegral A ((discr K b) • a * x) := by
  have hinv : IsUnit (traceMatrix K b).det := by
    simpa [← discr_def] using discr_isUnit_of_basis _ b
  have H := mulVec_cramer (traceMatrix K b) fun i => trace K L (x * a * b i)
  have : Function.Injective (traceMatrix K b).mulVec
  · rwa [mulVec_injective_iff_isUnit, isUnit_iff_isUnit_det]
  rw [← traceMatrix_of_basis_mulVec, ← mulVec_smul, this.eq_iff,
    traceMatrix_of_basis_mulVec] at H
  rw [← b.equivFun.symm_apply_apply (_ * _), b.equivFun_symm_apply]
  

Proof state:
A : Type u_1
K : Type u_2
L : Type u
B : Type u_3
inst✝²⁰ : CommRing A
inst✝¹⁹ : Field K
inst✝¹⁸ : CommRing B
inst✝¹⁷ : Field L
inst✝¹⁶ : Algebra A K
inst✝¹⁵ : Algebra B L
inst✝¹⁴ : Algebra A B
inst✝¹³ : Algebra K L
inst✝¹² : Algebra A L
inst✝¹¹ : IsScalarTower A K L
inst✝¹⁰ : IsScalarTower A B L
inst✝⁹ : IsDomain A
inst✝⁸ : IsDomain B
inst✝⁷ : IsFractionRing A K
inst✝⁶ : IsIntegralClosure B A L
inst✝⁵ : IsFractionRing B L
inst✝⁴ : FiniteDimensional K L
inst✝³ : IsSeparable K L
inst✝² : IsIntegrallyClosed A
I : Submodule B L
ι : Type u_4
inst✝¹ : DecidableEq ι
inst✝ : Fintype ι
b : Basis ι K L
hb : ∀ (i : ι), IsIntegral A (b i)
a x : L
ha : a ∈ I
hx : x ∈ Iᵛ
hinv : IsUnit (det (traceMatrix K ⇑b))
H :
  ((cramer (traceMatrix K ⇑b)) fun i => (Algebra.trace K L) (x * a * b i)) =
    det (traceMatrix K ⇑b) • (Basis.equivFun b) (x * a)
this : Function.Injective (mulVec (traceMatrix K ⇑b))
⊢ IsIntegral A (Finset.sum Finset.univ fun i => (Basis.equivFun b) (discr K ⇑b • a * x) i • b i)

Next tactic:
apply IsIntegral.sum
/-- If `b` is an `A`-integral basis of `L` with discriminant `b`, then `d • a * x` is integral over
  `A` for all `a ∈ I` and `x ∈ Iᵛ`. -/
lemma isIntegral_discr_mul_of_mem_traceDual
    (I : Submodule B L) {ι} [DecidableEq ι] [Fintype ι]
    {b : Basis ι K L} (hb : ∀ i, IsIntegral A (b i))
    {a x : L} (ha : a ∈ I) (hx : x ∈ Iᵛ) :
    IsIntegral A ((discr K b) • a * x) := by
  have hinv : IsUnit (traceMatrix K b).det := by
    simpa [← discr_def] using discr_isUnit_of_basis _ b
  have H := mulVec_cramer (traceMatrix K b) fun i => trace K L (x * a * b i)
  have : Function.Injective (traceMatrix K b).mulVec
  · rwa [mulVec_injective_iff_isUnit, isUnit_iff_isUnit_det]
  rw [← traceMatrix_of_basis_mulVec, ← mulVec_smul, this.eq_iff,
    traceMatrix_of_basis_mulVec] at H
  rw [← b.equivFun.symm_apply_apply (_ * _), b.equivFun_symm_apply]
  apply IsIntegral.sum
  

Proof state:
case h
A : Type u_1
K : Type u_2
L : Type u
B : Type u_3
inst✝²⁰ : CommRing A
inst✝¹⁹ : Field K
inst✝¹⁸ : CommRing B
inst✝¹⁷ : Field L
inst✝¹⁶ : Algebra A K
inst✝¹⁵ : Algebra B L
inst✝¹⁴ : Algebra A B
inst✝¹³ : Algebra K L
inst✝¹² : Algebra A L
inst✝¹¹ : IsScalarTower A K L
inst✝¹⁰ : IsScalarTower A B L
inst✝⁹ : IsDomain A
inst✝⁸ : IsDomain B
inst✝⁷ : IsFractionRing A K
inst✝⁶ : IsIntegralClosure B A L
inst✝⁵ : IsFractionRing B L
inst✝⁴ : FiniteDimensional K L
inst✝³ : IsSeparable K L
inst✝² : IsIntegrallyClosed A
I : Submodule B L
ι : Type u_4
inst✝¹ : DecidableEq ι
inst✝ : Fintype ι
b : Basis ι K L
hb : ∀ (i : ι), IsIntegral A (b i)
a x : L
ha : a ∈ I
hx : x ∈ Iᵛ
hinv : IsUnit (det (traceMatrix K ⇑b))
H :
  ((cramer (traceMatrix K ⇑b)) fun i => (Algebra.trace K L) (x * a * b i)) =
    det (traceMatrix K ⇑b) • (Basis.equivFun b) (x * a)
this : Function.Injective (mulVec (traceMatrix K ⇑b))
⊢ ∀ x_1 ∈ Finset.univ, IsIntegral A ((Basis.equivFun b) (discr K ⇑b • a * x) x_1 • b x_1)

Next tactic:
intro i _
/-- If `b` is an `A`-integral basis of `L` with discriminant `b`, then `d • a * x` is integral over
  `A` for all `a ∈ I` and `x ∈ Iᵛ`. -/
lemma isIntegral_discr_mul_of_mem_traceDual
    (I : Submodule B L) {ι} [DecidableEq ι] [Fintype ι]
    {b : Basis ι K L} (hb : ∀ i, IsIntegral A (b i))
    {a x : L} (ha : a ∈ I) (hx : x ∈ Iᵛ) :
    IsIntegral A ((discr K b) • a * x) := by
  have hinv : IsUnit (traceMatrix K b).det := by
    simpa [← discr_def] using discr_isUnit_of_basis _ b
  have H := mulVec_cramer (traceMatrix K b) fun i => trace K L (x * a * b i)
  have : Function.Injective (traceMatrix K b).mulVec
  · rwa [mulVec_injective_iff_isUnit, isUnit_iff_isUnit_det]
  rw [← traceMatrix_of_basis_mulVec, ← mulVec_smul, this.eq_iff,
    traceMatrix_of_basis_mulVec] at H
  rw [← b.equivFun.symm_apply_apply (_ * _), b.equivFun_symm_apply]
  apply IsIntegral.sum
  intro i _
  

Proof state:
case h
A : Type u_1
K : Type u_2
L : Type u
B : Type u_3
inst✝²⁰ : CommRing A
inst✝¹⁹ : Field K
inst✝¹⁸ : CommRing B
inst✝¹⁷ : Field L
inst✝¹⁶ : Algebra A K
inst✝¹⁵ : Algebra B L
inst✝¹⁴ : Algebra A B
inst✝¹³ : Algebra K L
inst✝¹² : Algebra A L
inst✝¹¹ : IsScalarTower A K L
inst✝¹⁰ : IsScalarTower A B L
inst✝⁹ : IsDomain A
inst✝⁸ : IsDomain B
inst✝⁷ : IsFractionRing A K
inst✝⁶ : IsIntegralClosure B A L
inst✝⁵ : IsFractionRing B L
inst✝⁴ : FiniteDimensional K L
inst✝³ : IsSeparable K L
inst✝² : IsIntegrallyClosed A
I : Submodule B L
ι : Type u_4
inst✝¹ : DecidableEq ι
inst✝ : Fintype ι
b : Basis ι K L
hb : ∀ (i : ι), IsIntegral A (b i)
a x : L
ha : a ∈ I
hx : x ∈ Iᵛ
hinv : IsUnit (det (traceMatrix K ⇑b))
H :
  ((cramer (traceMatrix K ⇑b)) fun i => (Algebra.trace K L) (x * a * b i)) =
    det (traceMatrix K ⇑b) • (Basis.equivFun b) (x * a)
this : Function.Injective (mulVec (traceMatrix K ⇑b))
i : ι
a✝ : i ∈ Finset.univ
⊢ IsIntegral A ((Basis.equivFun b) (discr K ⇑b • a * x) i • b i)

Next tactic:
rw [smul_mul_assoc, b.equivFun.map_smul, discr_def, mul_comm, ← H, Algebra.smul_def]
/-- If `b` is an `A`-integral basis of `L` with discriminant `b`, then `d • a * x` is integral over
  `A` for all `a ∈ I` and `x ∈ Iᵛ`. -/
lemma isIntegral_discr_mul_of_mem_traceDual
    (I : Submodule B L) {ι} [DecidableEq ι] [Fintype ι]
    {b : Basis ι K L} (hb : ∀ i, IsIntegral A (b i))
    {a x : L} (ha : a ∈ I) (hx : x ∈ Iᵛ) :
    IsIntegral A ((discr K b) • a * x) := by
  have hinv : IsUnit (traceMatrix K b).det := by
    simpa [← discr_def] using discr_isUnit_of_basis _ b
  have H := mulVec_cramer (traceMatrix K b) fun i => trace K L (x * a * b i)
  have : Function.Injective (traceMatrix K b).mulVec
  · rwa [mulVec_injective_iff_isUnit, isUnit_iff_isUnit_det]
  rw [← traceMatrix_of_basis_mulVec, ← mulVec_smul, this.eq_iff,
    traceMatrix_of_basis_mulVec] at H
  rw [← b.equivFun.symm_apply_apply (_ * _), b.equivFun_symm_apply]
  apply IsIntegral.sum
  intro i _
  rw [smul_mul_assoc, b.equivFun.map_smul, discr_def, mul_comm, ← H, Algebra.smul_def]
  

Proof state:
case h
A : Type u_1
K : Type u_2
L : Type u
B : Type u_3
inst✝²⁰ : CommRing A
inst✝¹⁹ : Field K
inst✝¹⁸ : CommRing B
inst✝¹⁷ : Field L
inst✝¹⁶ : Algebra A K
inst✝¹⁵ : Algebra B L
inst✝¹⁴ : Algebra A B
inst✝¹³ : Algebra K L
inst✝¹² : Algebra A L
inst✝¹¹ : IsScalarTower A K L
inst✝¹⁰ : IsScalarTower A B L
inst✝⁹ : IsDomain A
inst✝⁸ : IsDomain B
inst✝⁷ : IsFractionRing A K
inst✝⁶ : IsIntegralClosure B A L
inst✝⁵ : IsFractionRing B L
inst✝⁴ : FiniteDimensional K L
inst✝³ : IsSeparable K L
inst✝² : IsIntegrallyClosed A
I : Submodule B L
ι : Type u_4
inst✝¹ : DecidableEq ι
inst✝ : Fintype ι
b : Basis ι K L
hb : ∀ (i : ι), IsIntegral A (b i)
a x : L
ha : a ∈ I
hx : x ∈ Iᵛ
hinv : IsUnit (det (traceMatrix K ⇑b))
H :
  ((cramer (traceMatrix K ⇑b)) fun i => (Algebra.trace K L) (x * a * b i)) =
    det (traceMatrix K ⇑b) • (Basis.equivFun b) (x * a)
this : Function.Injective (mulVec (traceMatrix K ⇑b))
i : ι
a✝ : i ∈ Finset.univ
⊢ IsIntegral A ((algebraMap K L) ((cramer (traceMatrix K ⇑b)) (fun i => (Algebra.trace K L) (x * a * b i)) i) * b i)

Next tactic:
refine RingHom.IsIntegralElem.mul _ ?_ (hb _)
/-- If `b` is an `A`-integral basis of `L` with discriminant `b`, then `d • a * x` is integral over
  `A` for all `a ∈ I` and `x ∈ Iᵛ`. -/
lemma isIntegral_discr_mul_of_mem_traceDual
    (I : Submodule B L) {ι} [DecidableEq ι] [Fintype ι]
    {b : Basis ι K L} (hb : ∀ i, IsIntegral A (b i))
    {a x : L} (ha : a ∈ I) (hx : x ∈ Iᵛ) :
    IsIntegral A ((discr K b) • a * x) := by
  have hinv : IsUnit (traceMatrix K b).det := by
    simpa [← discr_def] using discr_isUnit_of_basis _ b
  have H := mulVec_cramer (traceMatrix K b) fun i => trace K L (x * a * b i)
  have : Function.Injective (traceMatrix K b).mulVec
  · rwa [mulVec_injective_iff_isUnit, isUnit_iff_isUnit_det]
  rw [← traceMatrix_of_basis_mulVec, ← mulVec_smul, this.eq_iff,
    traceMatrix_of_basis_mulVec] at H
  rw [← b.equivFun.symm_apply_apply (_ * _), b.equivFun_symm_apply]
  apply IsIntegral.sum
  intro i _
  rw [smul_mul_assoc, b.equivFun.map_smul, discr_def, mul_comm, ← H, Algebra.smul_def]
  refine RingHom.IsIntegralElem.mul _ ?_ (hb _)
  

Proof state:
case h
A : Type u_1
K : Type u_2
L : Type u
B : Type u_3
inst✝²⁰ : CommRing A
inst✝¹⁹ : Field K
inst✝¹⁸ : CommRing B
inst✝¹⁷ : Field L
inst✝¹⁶ : Algebra A K
inst✝¹⁵ : Algebra B L
inst✝¹⁴ : Algebra A B
inst✝¹³ : Algebra K L
inst✝¹² : Algebra A L
inst✝¹¹ : IsScalarTower A K L
inst✝¹⁰ : IsScalarTower A B L
inst✝⁹ : IsDomain A
inst✝⁸ : IsDomain B
inst✝⁷ : IsFractionRing A K
inst✝⁶ : IsIntegralClosure B A L
inst✝⁵ : IsFractionRing B L
inst✝⁴ : FiniteDimensional K L
inst✝³ : IsSeparable K L
inst✝² : IsIntegrallyClosed A
I : Submodule B L
ι : Type u_4
inst✝¹ : DecidableEq ι
inst✝ : Fintype ι
b : Basis ι K L
hb : ∀ (i : ι), IsIntegral A (b i)
a x : L
ha : a ∈ I
hx : x ∈ Iᵛ
hinv : IsUnit (det (traceMatrix K ⇑b))
H :
  ((cramer (traceMatrix K ⇑b)) fun i => (Algebra.trace K L) (x * a * b i)) =
    det (traceMatrix K ⇑b) • (Basis.equivFun b) (x * a)
this : Function.Injective (mulVec (traceMatrix K ⇑b))
i : ι
a✝ : i ∈ Finset.univ
⊢ RingHom.IsIntegralElem (algebraMap A L)
    ((algebraMap K L) ((cramer (traceMatrix K ⇑b)) (fun i => (Algebra.trace K L) (x * a * b i)) i))

Next tactic:
apply IsIntegral.algebraMap