-- Mathlib/RingTheory/DedekindDomain/Different.lean
lemma pow_sub_one_dvd_differentIdeal_aux [IsFractionRing B L] [IsDedekindDomain A]
    [NoZeroSMulDivisors A B] [Module.Finite A B]
    {p : Ideal A} [p.IsMaximal] (P : Ideal B) {e : ℕ} (he : e ≠ 0) (hp : p ≠ ⊥)
    (hP : P ^ e ∣ p.map (algebraMap A B)) : P ^ (e - 1) ∣ differentIdeal A 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✝¹⁰ : IsFractionRing A K
inst✝⁹ : FiniteDimensional K L
inst✝⁸ : Algebra.IsSeparable K L
inst✝⁷ : IsIntegralClosure B A L
inst✝⁶ : IsIntegrallyClosed A
inst✝⁵ : IsDedekindDomain B
inst✝⁴ : IsFractionRing B L
inst✝³ : IsDedekindDomain A
inst✝² : NoZeroSMulDivisors A B
inst✝¹ : Module.Finite A B
p : Ideal A
inst✝ : p.IsMaximal
P : Ideal B
e : ℕ
he : e ≠ 0
hp : p ≠ ⊥
hP✝ : P ^ e ∣ Ideal.map (algebraMap A B) p
a : Ideal B
ha : Ideal.map (algebraMap A B) p = P ^ (e - 1) * a
hp' : ¬Ideal.map (algebraMap A B) p = ⊥
habot : a ≠ ⊥
hPbot : P ≠ ⊥
this✝ : Ideal.map (algebraMap A B) p ∣ a ^ e
this : ∀ x ∈ a, (intTrace A B) x ∈ p
hP : (↑(P ^ (e - 1)))⁻¹ = ↑a / ↑(Ideal.map (algebraMap A B) p)
x : L
hx : ∀ y ∈ ↑(Ideal.map (algebraMap A B) p), x * y ∈ ↑a
⊢ ∀ y ∈ ↑p, (Algebra.trace K L) x * y ∈ ↑p

Tactic:
simp only [FractionalIdeal.mem_coeIdeal, forall_exists_index, and_imp,
  forall_apply_eq_imp_iff₂] at hx

Result:
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✝¹⁰ : IsFractionRing A K
inst✝⁹ : FiniteDimensional K L
inst✝⁸ : Algebra.IsSeparable K L
inst✝⁷ : IsIntegralClosure B A L
inst✝⁶ : IsIntegrallyClosed A
inst✝⁵ : IsDedekindDomain B
inst✝⁴ : IsFractionRing B L
inst✝³ : IsDedekindDomain A
inst✝² : NoZeroSMulDivisors A B
inst✝¹ : Module.Finite A B
p : Ideal A
inst✝ : p.IsMaximal
P : Ideal B
e : ℕ
he : e ≠ 0
hp : p ≠ ⊥
hP✝ : P ^ e ∣ Ideal.map (algebraMap A B) p
a : Ideal B
ha : Ideal.map (algebraMap A B) p = P ^ (e - 1) * a
hp' : ¬Ideal.map (algebraMap A B) p = ⊥
habot : a ≠ ⊥
hPbot : P ≠ ⊥
this✝ : Ideal.map (algebraMap A B) p ∣ a ^ e
this : ∀ x ∈ a, (intTrace A B) x ∈ p
hP : (↑(P ^ (e - 1)))⁻¹ = ↑a / ↑(Ideal.map (algebraMap A B) p)
x : L
hx : ∀ a_1 ∈ Ideal.map (algebraMap A B) p, ∃ x' ∈ a, (algebraMap B L) x' = x * (algebraMap B L) a_1
⊢ ∀ y ∈ ↑p, (Algebra.trace K L) x * y ∈ ↑p

Proof state:
case 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✝¹⁰ : IsFractionRing A K
inst✝⁹ : FiniteDimensional K L
inst✝⁸ : Algebra.IsSeparable K L
inst✝⁷ : IsIntegralClosure B A L
inst✝⁶ : IsIntegrallyClosed A
inst✝⁵ : IsDedekindDomain B
inst✝⁴ : IsFractionRing B L
inst✝³ : IsDedekindDomain A
inst✝² : NoZeroSMulDivisors A B
inst✝¹ : Module.Finite A B
p : Ideal A
inst✝ : p.IsMaximal
P : Ideal B
e : ℕ
he : e ≠ 0
hp : p ≠ ⊥
hP : P ^ e ∣ Ideal.map (algebraMap A B) p
a : Ideal B
ha : Ideal.map (algebraMap A B) p = P ^ (e - 1) * a
hp' : ¬Ideal.map (algebraMap A B) p = ⊥
habot : a ≠ ⊥
hPbot : P ≠ ⊥
this : Ideal.map (algebraMap A B) p ∣ a ^ e
⊢ P ^ (e - 1) ∣ differentIdeal A B

Tactic:
suffices ∀ x ∈ a, intTrace A B x ∈ p by
  have hP : ((P ^ (e - 1) :)⁻¹ : FractionalIdeal B⁰ L) = a / p.map (algebraMap A B) := by
    apply inv_involutive.injective
    simp only [inv_inv, ha, FractionalIdeal.coeIdeal_mul, inv_div, ne_eq,
        FractionalIdeal.coeIdeal_eq_zero, mul_div_assoc]
    rw [div_self (by simpa), mul_one]
  rw [Ideal.dvd_iff_le, differentialIdeal_le_iff (K := K) (L := L) (pow_ne_zero _ hPbot), hP,
    Submodule.map_le_iff_le_comap]
  intro x hx
  rw [Submodule.restrictScalars_mem, FractionalIdeal.mem_coe,
    FractionalIdeal.mem_div_iff_of_nonzero (by simpa using hp')] at hx
  rw [Submodule.mem_comap, LinearMap.coe_restrictScalars, ← FractionalIdeal.coe_one,
    ← div_self (G₀ := FractionalIdeal A⁰ K) (a := p) (by simpa using hp),
    FractionalIdeal.mem_coe, FractionalIdeal.mem_div_iff_of_nonzero (by simpa using hp)]
  simp only [FractionalIdeal.mem_coeIdeal, forall_exists_index, and_imp,
    forall_apply_eq_imp_iff₂] at hx
  intro y hy'
  obtain ⟨y, hy, rfl : algebraMap A K _ = _⟩ := (FractionalIdeal.mem_coeIdeal _).mp hy'
  obtain ⟨z, hz, hz'⟩ := hx _ (Ideal.mem_map_of_mem _ hy)
  have : trace K L (algebraMap B L z) ∈ (p : FractionalIdeal A⁰ K) := by
    rw [← algebraMap_intTrace (A := A)]
    exact ⟨intTrace A B z, this z hz, rfl⟩
  rwa [mul_comm, ← smul_eq_mul, ← LinearMap.map_smul, smul_def, mul_comm,
    ← IsScalarTower.algebraMap_apply, IsScalarTower.algebraMap_apply A B L, ← hz']

Result:
case 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✝¹⁰ : IsFractionRing A K
inst✝⁹ : FiniteDimensional K L
inst✝⁸ : Algebra.IsSeparable K L
inst✝⁷ : IsIntegralClosure B A L
inst✝⁶ : IsIntegrallyClosed A
inst✝⁵ : IsDedekindDomain B
inst✝⁴ : IsFractionRing B L
inst✝³ : IsDedekindDomain A
inst✝² : NoZeroSMulDivisors A B
inst✝¹ : Module.Finite A B
p : Ideal A
inst✝ : p.IsMaximal
P : Ideal B
e : ℕ
he : e ≠ 0
hp : p ≠ ⊥
hP : P ^ e ∣ Ideal.map (algebraMap A B) p
a : Ideal B
ha : Ideal.map (algebraMap A B) p = P ^ (e - 1) * a
hp' : ¬Ideal.map (algebraMap A B) p = ⊥
habot : a ≠ ⊥
hPbot : P ≠ ⊥
this : Ideal.map (algebraMap A B) p ∣ a ^ e
⊢ ∀ x ∈ a, (intTrace A B) x ∈ p