-- Mathlib/RingTheory/DedekindDomain/Ideal.lean
theorem mul_inv_cancel [IsDedekindDomain A] {I : FractionalIdeal A⁰ K} (hne : I ≠ 0) :
    I * I⁻¹ = 1

Proof state:
case intro.intro.intro
A : Type u_2
K : Type u_3
inst✝⁴ : CommRing A
inst✝³ : Field K
inst✝² : Algebra A K
inst✝¹ : IsFractionRing A K
inst✝ : IsDedekindDomain A
a : A
J : Ideal A
ha : a ≠ 0
hne : spanSingleton A⁰ ((algebraMap A K) a)⁻¹ * ↑J ≠ 0
⊢ spanSingleton A⁰ ((algebraMap A K) a)⁻¹ * ↑J * (spanSingleton A⁰ ((algebraMap A K) a) * (↑J)⁻¹) = 1

Tactic:
rw [mul_assoc, mul_left_comm (J : FractionalIdeal A⁰ K), coe_ideal_mul_inv, mul_one,
  spanSingleton_mul_spanSingleton, inv_mul_cancel₀, spanSingleton_one]

Result:
case intro.intro.intro
A : Type u_2
K : Type u_3
inst✝⁴ : CommRing A
inst✝³ : Field K
inst✝² : Algebra A K
inst✝¹ : IsFractionRing A K
inst✝ : IsDedekindDomain A
a : A
J : Ideal A
ha : a ≠ 0
hne : spanSingleton A⁰ ((algebraMap A K) a)⁻¹ * ↑J ≠ 0
⊢ (algebraMap A K) a ≠ 0

case intro.intro.intro.hI0
A : Type u_2
K : Type u_3
inst✝⁴ : CommRing A
inst✝³ : Field K
inst✝² : Algebra A K
inst✝¹ : IsFractionRing A K
inst✝ : IsDedekindDomain A
a : A
J : Ideal A
ha : a ≠ 0
hne : spanSingleton A⁰ ((algebraMap A K) a)⁻¹ * ↑J ≠ 0
⊢ J ≠ ⊥

Proof state:
case intro.intro.intro
A : Type u_2
K : Type u_3
inst✝⁴ : CommRing A
inst✝³ : Field K
inst✝² : Algebra A K
inst✝¹ : IsFractionRing A K
inst✝ : IsDedekindDomain A
I : FractionalIdeal A⁰ K
hne : I ≠ 0
a : A
J : Ideal A
ha : a ≠ 0
hJ : I = spanSingleton A⁰ ((algebraMap A K) a)⁻¹ * ↑J
⊢ I * (spanSingleton A⁰ ((algebraMap A K) a) * (↑J)⁻¹) = 1

Tactic:
subst hJ

Result:
case intro.intro.intro
A : Type u_2
K : Type u_3
inst✝⁴ : CommRing A
inst✝³ : Field K
inst✝² : Algebra A K
inst✝¹ : IsFractionRing A K
inst✝ : IsDedekindDomain A
a : A
J : Ideal A
ha : a ≠ 0
hne : spanSingleton A⁰ ((algebraMap A K) a)⁻¹ * ↑J ≠ 0
⊢ spanSingleton A⁰ ((algebraMap A K) a)⁻¹ * ↑J * (spanSingleton A⁰ ((algebraMap A K) a) * (↑J)⁻¹) = 1

Proof state:
case intro.intro.intro.hI0
A : Type u_2
K : Type u_3
inst✝⁴ : CommRing A
inst✝³ : Field K
inst✝² : Algebra A K
inst✝¹ : IsFractionRing A K
inst✝ : IsDedekindDomain A
a : A
J : Ideal A
ha : a ≠ 0
hne : spanSingleton A⁰ ((algebraMap A K) a)⁻¹ * ↑J ≠ 0
⊢ J ≠ ⊥

Tactic:
exact coeIdeal_ne_zero.mp (right_ne_zero_of_mul hne)

Result:
no goals

Proof state:
A : Type u_2
K : Type u_3
inst✝⁴ : CommRing A
inst✝³ : Field K
inst✝² : Algebra A K
inst✝¹ : IsFractionRing A K
inst✝ : IsDedekindDomain A
I : FractionalIdeal A⁰ K
hne : I ≠ 0
⊢ I * I⁻¹ = 1

Tactic:
obtain ⟨a, J, ha, hJ⟩ :
  ∃ (a : A) (aI : Ideal A), a ≠ 0 ∧ I = spanSingleton A⁰ (algebraMap A K a)⁻¹ * aI :=
  exists_eq_spanSingleton_mul I

Result:
case intro.intro.intro
A : Type u_2
K : Type u_3
inst✝⁴ : CommRing A
inst✝³ : Field K
inst✝² : Algebra A K
inst✝¹ : IsFractionRing A K
inst✝ : IsDedekindDomain A
I : FractionalIdeal A⁰ K
hne : I ≠ 0
a : A
J : Ideal A
ha : a ≠ 0
hJ : I = spanSingleton A⁰ ((algebraMap A K) a)⁻¹ * ↑J
⊢ I * I⁻¹ = 1

Proof state:
case intro.intro.intro
A : Type u_2
K : Type u_3
inst✝⁴ : CommRing A
inst✝³ : Field K
inst✝² : Algebra A K
inst✝¹ : IsFractionRing A K
inst✝ : IsDedekindDomain A
I : FractionalIdeal A⁰ K
hne : I ≠ 0
a : A
J : Ideal A
ha : a ≠ 0
hJ : I = spanSingleton A⁰ ((algebraMap A K) a)⁻¹ * ↑J
⊢ I * I⁻¹ = 1

Tactic:
suffices h₂ : I * (spanSingleton A⁰ (algebraMap _ _ a) * (J : FractionalIdeal A⁰ K)⁻¹) = 1 by
  rw [mul_inv_cancel_iff]
  exact ⟨spanSingleton A⁰ (algebraMap _ _ a) * (J : FractionalIdeal A⁰ K)⁻¹, h₂⟩

Result:
case intro.intro.intro
A : Type u_2
K : Type u_3
inst✝⁴ : CommRing A
inst✝³ : Field K
inst✝² : Algebra A K
inst✝¹ : IsFractionRing A K
inst✝ : IsDedekindDomain A
I : FractionalIdeal A⁰ K
hne : I ≠ 0
a : A
J : Ideal A
ha : a ≠ 0
hJ : I = spanSingleton A⁰ ((algebraMap A K) a)⁻¹ * ↑J
⊢ I * (spanSingleton A⁰ ((algebraMap A K) a) * (↑J)⁻¹) = 1

Proof state:
A : Type u_2
K : Type u_3
inst✝⁴ : CommRing A
inst✝³ : Field K
inst✝² : Algebra A K
inst✝¹ : IsFractionRing A K
inst✝ : IsDedekindDomain A
I : FractionalIdeal A⁰ K
hne : I ≠ 0
a : A
J : Ideal A
ha : a ≠ 0
hJ : I = spanSingleton A⁰ ((algebraMap A K) a)⁻¹ * ↑J
h₂ : I * (spanSingleton A⁰ ((algebraMap A K) a) * (↑J)⁻¹) = 1
⊢ ∃ J, I * J = 1

Tactic:
exact ⟨spanSingleton A⁰ (algebraMap _ _ a) * (J : FractionalIdeal A⁰ K)⁻¹, h₂⟩

Result:
no goals

Proof state:
case intro.intro.intro
A : Type u_2
K : Type u_3
inst✝⁴ : CommRing A
inst✝³ : Field K
inst✝² : Algebra A K
inst✝¹ : IsFractionRing A K
inst✝ : IsDedekindDomain A
a : A
J : Ideal A
ha : a ≠ 0
hne : spanSingleton A⁰ ((algebraMap A K) a)⁻¹ * ↑J ≠ 0
⊢ (algebraMap A K) a ≠ 0

Tactic:
exact mt ((injective_iff_map_eq_zero (algebraMap A K)).mp (IsFractionRing.injective A K) _) ha

Result:
no goals

Proof state:
A : Type u_2
K : Type u_3
inst✝⁴ : CommRing A
inst✝³ : Field K
inst✝² : Algebra A K
inst✝¹ : IsFractionRing A K
inst✝ : IsDedekindDomain A
I : FractionalIdeal A⁰ K
hne : I ≠ 0
a : A
J : Ideal A
ha : a ≠ 0
hJ : I = spanSingleton A⁰ ((algebraMap A K) a)⁻¹ * ↑J
h₂ : I * (spanSingleton A⁰ ((algebraMap A K) a) * (↑J)⁻¹) = 1
⊢ I * I⁻¹ = 1

Tactic:
rw [mul_inv_cancel_iff]

Result:
A : Type u_2
K : Type u_3
inst✝⁴ : CommRing A
inst✝³ : Field K
inst✝² : Algebra A K
inst✝¹ : IsFractionRing A K
inst✝ : IsDedekindDomain A
I : FractionalIdeal A⁰ K
hne : I ≠ 0
a : A
J : Ideal A
ha : a ≠ 0
hJ : I = spanSingleton A⁰ ((algebraMap A K) a)⁻¹ * ↑J
h₂ : I * (spanSingleton A⁰ ((algebraMap A K) a) * (↑J)⁻¹) = 1
⊢ ∃ J, I * J = 1