l3lab/ntp-mathlib huggingface dataset:
theorem ClassGroup.integralRep_mem_nonZeroDivisors
    {I} (hI : I ≠ 0) :
    ClassGroup.integralRep I ∈ (Ideal R)⁰ := by
  let a := I.2.choose
  have a_ne_zero' := I.2.choose_spec.1
  have a_ne_zero := mem_nonZeroDivisors_iff_ne_zero.mp a_ne_zero'
  

Proof state:
R : Type u_1
K : Type u_2
L : Type u_3
inst✝¹⁰ : CommRing R
inst✝⁹ : Field K
inst✝⁸ : Field L
inst✝⁷ : DecidableEq L
inst✝⁶ : Algebra R K
inst✝⁵ : IsFractionRing R K
inst✝⁴ : Algebra K L
inst✝³ : FiniteDimensional K L
inst✝² : Algebra R L
inst✝¹ : IsScalarTower R K L
inst✝ : IsDomain R
I : FractionalIdeal R⁰ (FractionRing R)
hI : I ≠ 0
a : R := Exists.choose (_ : IsFractional R⁰ ↑I)
a_ne_zero' : Exists.choose (_ : IsFractional R⁰ ↑I) ∈ R⁰
a_ne_zero : Exists.choose (_ : IsFractional R⁰ ↑I) ≠ 0
⊢ integralRep I ∈ (Ideal R)⁰

Next tactic:
have fa_ne_zero : (algebraMap R (FractionRing R)) a ≠ 0 :=
    IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors a_ne_zero'
theorem ClassGroup.integralRep_mem_nonZeroDivisors
    {I} (hI : I ≠ 0) :
    ClassGroup.integralRep I ∈ (Ideal R)⁰ := by
  let a := I.2.choose
  have a_ne_zero' := I.2.choose_spec.1
  have a_ne_zero := mem_nonZeroDivisors_iff_ne_zero.mp a_ne_zero'
  have fa_ne_zero : (algebraMap R (FractionRing R)) a ≠ 0 :=
    IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors a_ne_zero'
  

Proof state:
R : Type u_1
K : Type u_2
L : Type u_3
inst✝¹⁰ : CommRing R
inst✝⁹ : Field K
inst✝⁸ : Field L
inst✝⁷ : DecidableEq L
inst✝⁶ : Algebra R K
inst✝⁵ : IsFractionRing R K
inst✝⁴ : Algebra K L
inst✝³ : FiniteDimensional K L
inst✝² : Algebra R L
inst✝¹ : IsScalarTower R K L
inst✝ : IsDomain R
I : FractionalIdeal R⁰ (FractionRing R)
hI : I ≠ 0
a : R := Exists.choose (_ : IsFractional R⁰ ↑I)
a_ne_zero' : Exists.choose (_ : IsFractional R⁰ ↑I) ∈ R⁰
a_ne_zero : Exists.choose (_ : IsFractional R⁰ ↑I) ≠ 0
fa_ne_zero : (algebraMap R (FractionRing R)) a ≠ 0
⊢ integralRep I ∈ (Ideal R)⁰

Next tactic:
rw [mem_nonZeroDivisors_iff_ne_zero, Submodule.zero_eq_bot, Submodule.ne_bot_iff]
theorem ClassGroup.integralRep_mem_nonZeroDivisors
    {I} (hI : I ≠ 0) :
    ClassGroup.integralRep I ∈ (Ideal R)⁰ := by
  let a := I.2.choose
  have a_ne_zero' := I.2.choose_spec.1
  have a_ne_zero := mem_nonZeroDivisors_iff_ne_zero.mp a_ne_zero'
  have fa_ne_zero : (algebraMap R (FractionRing R)) a ≠ 0 :=
    IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors a_ne_zero'
  rw [mem_nonZeroDivisors_iff_ne_zero, Submodule.zero_eq_bot, Submodule.ne_bot_iff]
  

Proof state:
R : Type u_1
K : Type u_2
L : Type u_3
inst✝¹⁰ : CommRing R
inst✝⁹ : Field K
inst✝⁸ : Field L
inst✝⁷ : DecidableEq L
inst✝⁶ : Algebra R K
inst✝⁵ : IsFractionRing R K
inst✝⁴ : Algebra K L
inst✝³ : FiniteDimensional K L
inst✝² : Algebra R L
inst✝¹ : IsScalarTower R K L
inst✝ : IsDomain R
I : FractionalIdeal R⁰ (FractionRing R)
hI : I ≠ 0
a : R := Exists.choose (_ : IsFractional R⁰ ↑I)
a_ne_zero' : Exists.choose (_ : IsFractional R⁰ ↑I) ∈ R⁰
a_ne_zero : Exists.choose (_ : IsFractional R⁰ ↑I) ≠ 0
fa_ne_zero : (algebraMap R (FractionRing R)) a ≠ 0
⊢ ∃ x ∈ integralRep I, x ≠ 0

Next tactic:
obtain ⟨x, x_ne, x_mem⟩ := exists_ne_zero_mem_isInteger hI
theorem ClassGroup.integralRep_mem_nonZeroDivisors
    {I} (hI : I ≠ 0) :
    ClassGroup.integralRep I ∈ (Ideal R)⁰ := by
  let a := I.2.choose
  have a_ne_zero' := I.2.choose_spec.1
  have a_ne_zero := mem_nonZeroDivisors_iff_ne_zero.mp a_ne_zero'
  have fa_ne_zero : (algebraMap R (FractionRing R)) a ≠ 0 :=
    IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors a_ne_zero'
  rw [mem_nonZeroDivisors_iff_ne_zero, Submodule.zero_eq_bot, Submodule.ne_bot_iff]
  obtain ⟨x, x_ne, x_mem⟩ := exists_ne_zero_mem_isInteger hI
  

Proof state:
case intro.intro
R : Type u_1
K : Type u_2
L : Type u_3
inst✝¹⁰ : CommRing R
inst✝⁹ : Field K
inst✝⁸ : Field L
inst✝⁷ : DecidableEq L
inst✝⁶ : Algebra R K
inst✝⁵ : IsFractionRing R K
inst✝⁴ : Algebra K L
inst✝³ : FiniteDimensional K L
inst✝² : Algebra R L
inst✝¹ : IsScalarTower R K L
inst✝ : IsDomain R
I : FractionalIdeal R⁰ (FractionRing R)
hI : I ≠ 0
a : R := Exists.choose (_ : IsFractional R⁰ ↑I)
a_ne_zero' : Exists.choose (_ : IsFractional R⁰ ↑I) ∈ R⁰
a_ne_zero : Exists.choose (_ : IsFractional R⁰ ↑I) ≠ 0
fa_ne_zero : (algebraMap R (FractionRing R)) a ≠ 0
x : R
x_ne : x ≠ 0
x_mem : (algebraMap R (FractionRing R)) x ∈ I
⊢ ∃ x ∈ integralRep I, x ≠ 0

Next tactic:
refine ⟨a*x, ?_, mul_ne_zero a_ne_zero x_ne⟩
theorem ClassGroup.integralRep_mem_nonZeroDivisors
    {I} (hI : I ≠ 0) :
    ClassGroup.integralRep I ∈ (Ideal R)⁰ := by
  let a := I.2.choose
  have a_ne_zero' := I.2.choose_spec.1
  have a_ne_zero := mem_nonZeroDivisors_iff_ne_zero.mp a_ne_zero'
  have fa_ne_zero : (algebraMap R (FractionRing R)) a ≠ 0 :=
    IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors a_ne_zero'
  rw [mem_nonZeroDivisors_iff_ne_zero, Submodule.zero_eq_bot, Submodule.ne_bot_iff]
  obtain ⟨x, x_ne, x_mem⟩ := exists_ne_zero_mem_isInteger hI
  refine ⟨a*x, ?_, mul_ne_zero a_ne_zero x_ne⟩
  

Proof state:
case intro.intro
R : Type u_1
K : Type u_2
L : Type u_3
inst✝¹⁰ : CommRing R
inst✝⁹ : Field K
inst✝⁸ : Field L
inst✝⁷ : DecidableEq L
inst✝⁶ : Algebra R K
inst✝⁵ : IsFractionRing R K
inst✝⁴ : Algebra K L
inst✝³ : FiniteDimensional K L
inst✝² : Algebra R L
inst✝¹ : IsScalarTower R K L
inst✝ : IsDomain R
I : FractionalIdeal R⁰ (FractionRing R)
hI : I ≠ 0
a : R := Exists.choose (_ : IsFractional R⁰ ↑I)
a_ne_zero' : Exists.choose (_ : IsFractional R⁰ ↑I) ∈ R⁰
a_ne_zero : Exists.choose (_ : IsFractional R⁰ ↑I) ≠ 0
fa_ne_zero : (algebraMap R (FractionRing R)) a ≠ 0
x : R
x_ne : x ≠ 0
x_mem : (algebraMap R (FractionRing R)) x ∈ I
⊢ a * x ∈ integralRep I

Next tactic:
change ((algebraMap R _) a)⁻¹ * (algebraMap R _) (a * x) ∈ I
theorem ClassGroup.integralRep_mem_nonZeroDivisors
    {I} (hI : I ≠ 0) :
    ClassGroup.integralRep I ∈ (Ideal R)⁰ := by
  let a := I.2.choose
  have a_ne_zero' := I.2.choose_spec.1
  have a_ne_zero := mem_nonZeroDivisors_iff_ne_zero.mp a_ne_zero'
  have fa_ne_zero : (algebraMap R (FractionRing R)) a ≠ 0 :=
    IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors a_ne_zero'
  rw [mem_nonZeroDivisors_iff_ne_zero, Submodule.zero_eq_bot, Submodule.ne_bot_iff]
  obtain ⟨x, x_ne, x_mem⟩ := exists_ne_zero_mem_isInteger hI
  refine ⟨a*x, ?_, mul_ne_zero a_ne_zero x_ne⟩
  change ((algebraMap R _) a)⁻¹ * (algebraMap R _) (a * x) ∈ I
  

Proof state:
case intro.intro
R : Type u_1
K : Type u_2
L : Type u_3
inst✝¹⁰ : CommRing R
inst✝⁹ : Field K
inst✝⁸ : Field L
inst✝⁷ : DecidableEq L
inst✝⁶ : Algebra R K
inst✝⁵ : IsFractionRing R K
inst✝⁴ : Algebra K L
inst✝³ : FiniteDimensional K L
inst✝² : Algebra R L
inst✝¹ : IsScalarTower R K L
inst✝ : IsDomain R
I : FractionalIdeal R⁰ (FractionRing R)
hI : I ≠ 0
a : R := Exists.choose (_ : IsFractional R⁰ ↑I)
a_ne_zero' : Exists.choose (_ : IsFractional R⁰ ↑I) ∈ R⁰
a_ne_zero : Exists.choose (_ : IsFractional R⁰ ↑I) ≠ 0
fa_ne_zero : (algebraMap R (FractionRing R)) a ≠ 0
x : R
x_ne : x ≠ 0
x_mem : (algebraMap R (FractionRing R)) x ∈ I
⊢ ((algebraMap R (FractionRing R)) a)⁻¹ * (algebraMap R (FractionRing R)) (a * x) ∈ I

Next tactic:
rwa [RingHom.map_mul, ← mul_assoc, inv_mul_cancel fa_ne_zero, one_mul]
theorem ClassGroup.mk0_integralRep [IsDedekindDomain R]
    (I : (FractionalIdeal R⁰ (FractionRing R))ˣ) :
    ClassGroup.mk0 ⟨ClassGroup.integralRep I, ClassGroup.integralRep_mem_nonZeroDivisors I.ne_zero⟩
      = ClassGroup.mk I := by
  

Proof state:
R : Type u_1
K : Type u_2
L : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : Field K
inst✝⁹ : Field L
inst✝⁸ : DecidableEq L
inst✝⁷ : Algebra R K
inst✝⁶ : IsFractionRing R K
inst✝⁵ : Algebra K L
inst✝⁴ : FiniteDimensional K L
inst✝³ : Algebra R L
inst✝² : IsScalarTower R K L
inst✝¹ : IsDomain R
inst✝ : IsDedekindDomain R
I : (FractionalIdeal R⁰ (FractionRing R))ˣ
⊢ mk0 { val := integralRep ↑I, property := (_ : integralRep ↑I ∈ (Ideal R)⁰) } = mk I

Next tactic:
let a := I.1.2.choose
theorem ClassGroup.mk0_integralRep [IsDedekindDomain R]
    (I : (FractionalIdeal R⁰ (FractionRing R))ˣ) :
    ClassGroup.mk0 ⟨ClassGroup.integralRep I, ClassGroup.integralRep_mem_nonZeroDivisors I.ne_zero⟩
      = ClassGroup.mk I := by
  let a := I.1.2.choose
  

Proof state:
R : Type u_1
K : Type u_2
L : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : Field K
inst✝⁹ : Field L
inst✝⁸ : DecidableEq L
inst✝⁷ : Algebra R K
inst✝⁶ : IsFractionRing R K
inst✝⁵ : Algebra K L
inst✝⁴ : FiniteDimensional K L
inst✝³ : Algebra R L
inst✝² : IsScalarTower R K L
inst✝¹ : IsDomain R
inst✝ : IsDedekindDomain R
I : (FractionalIdeal R⁰ (FractionRing R))ˣ
a : R := Exists.choose (_ : IsFractional R⁰ ↑↑I)
⊢ mk0 { val := integralRep ↑I, property := (_ : integralRep ↑I ∈ (Ideal R)⁰) } = mk I

Next tactic:
have a_ne_zero' := I.1.2.choose_spec.1
theorem ClassGroup.mk0_integralRep [IsDedekindDomain R]
    (I : (FractionalIdeal R⁰ (FractionRing R))ˣ) :
    ClassGroup.mk0 ⟨ClassGroup.integralRep I, ClassGroup.integralRep_mem_nonZeroDivisors I.ne_zero⟩
      = ClassGroup.mk I := by
  let a := I.1.2.choose
  have a_ne_zero' := I.1.2.choose_spec.1
  

Proof state:
R : Type u_1
K : Type u_2
L : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : Field K
inst✝⁹ : Field L
inst✝⁸ : DecidableEq L
inst✝⁷ : Algebra R K
inst✝⁶ : IsFractionRing R K
inst✝⁵ : Algebra K L
inst✝⁴ : FiniteDimensional K L
inst✝³ : Algebra R L
inst✝² : IsScalarTower R K L
inst✝¹ : IsDomain R
inst✝ : IsDedekindDomain R
I : (FractionalIdeal R⁰ (FractionRing R))ˣ
a : R := Exists.choose (_ : IsFractional R⁰ ↑↑I)
a_ne_zero' : Exists.choose (_ : IsFractional R⁰ ↑↑I) ∈ R⁰
⊢ mk0 { val := integralRep ↑I, property := (_ : integralRep ↑I ∈ (Ideal R)⁰) } = mk I

Next tactic:
have ha := I.1.2.choose_spec.2
theorem ClassGroup.mk0_integralRep [IsDedekindDomain R]
    (I : (FractionalIdeal R⁰ (FractionRing R))ˣ) :
    ClassGroup.mk0 ⟨ClassGroup.integralRep I, ClassGroup.integralRep_mem_nonZeroDivisors I.ne_zero⟩
      = ClassGroup.mk I := by
  let a := I.1.2.choose
  have a_ne_zero' := I.1.2.choose_spec.1
  have ha := I.1.2.choose_spec.2
  

Proof state:
R : Type u_1
K : Type u_2
L : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : Field K
inst✝⁹ : Field L
inst✝⁸ : DecidableEq L
inst✝⁷ : Algebra R K
inst✝⁶ : IsFractionRing R K
inst✝⁵ : Algebra K L
inst✝⁴ : FiniteDimensional K L
inst✝³ : Algebra R L
inst✝² : IsScalarTower R K L
inst✝¹ : IsDomain R
inst✝ : IsDedekindDomain R
I : (FractionalIdeal R⁰ (FractionRing R))ˣ
a : R := Exists.choose (_ : IsFractional R⁰ ↑↑I)
a_ne_zero' : Exists.choose (_ : IsFractional R⁰ ↑↑I) ∈ R⁰
ha : ∀ b ∈ ↑↑I, IsInteger R (Exists.choose (_ : IsFractional R⁰ ↑↑I) • b)
⊢ mk0 { val := integralRep ↑I, property := (_ : integralRep ↑I ∈ (Ideal R)⁰) } = mk I

Next tactic:
have fa_ne_zero : (algebraMap R (FractionRing R)) a ≠ 0 :=
    IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors a_ne_zero'
theorem ClassGroup.mk0_integralRep [IsDedekindDomain R]
    (I : (FractionalIdeal R⁰ (FractionRing R))ˣ) :
    ClassGroup.mk0 ⟨ClassGroup.integralRep I, ClassGroup.integralRep_mem_nonZeroDivisors I.ne_zero⟩
      = ClassGroup.mk I := by
  let a := I.1.2.choose
  have a_ne_zero' := I.1.2.choose_spec.1
  have ha := I.1.2.choose_spec.2
  have fa_ne_zero : (algebraMap R (FractionRing R)) a ≠ 0 :=
    IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors a_ne_zero'
  

Proof state:
R : Type u_1
K : Type u_2
L : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : Field K
inst✝⁹ : Field L
inst✝⁸ : DecidableEq L
inst✝⁷ : Algebra R K
inst✝⁶ : IsFractionRing R K
inst✝⁵ : Algebra K L
inst✝⁴ : FiniteDimensional K L
inst✝³ : Algebra R L
inst✝² : IsScalarTower R K L
inst✝¹ : IsDomain R
inst✝ : IsDedekindDomain R
I : (FractionalIdeal R⁰ (FractionRing R))ˣ
a : R := Exists.choose (_ : IsFractional R⁰ ↑↑I)
a_ne_zero' : Exists.choose (_ : IsFractional R⁰ ↑↑I) ∈ R⁰
ha : ∀ b ∈ ↑↑I, IsInteger R (Exists.choose (_ : IsFractional R⁰ ↑↑I) • b)
fa_ne_zero : (algebraMap R (FractionRing R)) a ≠ 0
⊢ mk0 { val := integralRep ↑I, property := (_ : integralRep ↑I ∈ (Ideal R)⁰) } = mk I

Next tactic:
symm
theorem ClassGroup.mk0_integralRep [IsDedekindDomain R]
    (I : (FractionalIdeal R⁰ (FractionRing R))ˣ) :
    ClassGroup.mk0 ⟨ClassGroup.integralRep I, ClassGroup.integralRep_mem_nonZeroDivisors I.ne_zero⟩
      = ClassGroup.mk I := by
  let a := I.1.2.choose
  have a_ne_zero' := I.1.2.choose_spec.1
  have ha := I.1.2.choose_spec.2
  have fa_ne_zero : (algebraMap R (FractionRing R)) a ≠ 0 :=
    IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors a_ne_zero'
  symm
  

Proof state:
R : Type u_1
K : Type u_2
L : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : Field K
inst✝⁹ : Field L
inst✝⁸ : DecidableEq L
inst✝⁷ : Algebra R K
inst✝⁶ : IsFractionRing R K
inst✝⁵ : Algebra K L
inst✝⁴ : FiniteDimensional K L
inst✝³ : Algebra R L
inst✝² : IsScalarTower R K L
inst✝¹ : IsDomain R
inst✝ : IsDedekindDomain R
I : (FractionalIdeal R⁰ (FractionRing R))ˣ
a : R := Exists.choose (_ : IsFractional R⁰ ↑↑I)
a_ne_zero' : Exists.choose (_ : IsFractional R⁰ ↑↑I) ∈ R⁰
ha : ∀ b ∈ ↑↑I, IsInteger R (Exists.choose (_ : IsFractional R⁰ ↑↑I) • b)
fa_ne_zero : (algebraMap R (FractionRing R)) a ≠ 0
⊢ mk I = mk0 { val := integralRep ↑I, property := (_ : integralRep ↑I ∈ (Ideal R)⁰) }

Next tactic:
apply Quotient.sound
theorem ClassGroup.mk0_integralRep [IsDedekindDomain R]
    (I : (FractionalIdeal R⁰ (FractionRing R))ˣ) :
    ClassGroup.mk0 ⟨ClassGroup.integralRep I, ClassGroup.integralRep_mem_nonZeroDivisors I.ne_zero⟩
      = ClassGroup.mk I := by
  let a := I.1.2.choose
  have a_ne_zero' := I.1.2.choose_spec.1
  have ha := I.1.2.choose_spec.2
  have fa_ne_zero : (algebraMap R (FractionRing R)) a ≠ 0 :=
    IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors a_ne_zero'
  symm
  apply Quotient.sound
  

Proof state:
case a
R : Type u_1
K : Type u_2
L : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : Field K
inst✝⁹ : Field L
inst✝⁸ : DecidableEq L
inst✝⁷ : Algebra R K
inst✝⁶ : IsFractionRing R K
inst✝⁵ : Algebra K L
inst✝⁴ : FiniteDimensional K L
inst✝³ : Algebra R L
inst✝² : IsScalarTower R K L
inst✝¹ : IsDomain R
inst✝ : IsDedekindDomain R
I : (FractionalIdeal R⁰ (FractionRing R))ˣ
a : R := Exists.choose (_ : IsFractional R⁰ ↑↑I)
a_ne_zero' : Exists.choose (_ : IsFractional R⁰ ↑↑I) ∈ R⁰
ha : ∀ b ∈ ↑↑I, IsInteger R (Exists.choose (_ : IsFractional R⁰ ↑↑I) • b)
fa_ne_zero : (algebraMap R (FractionRing R)) a ≠ 0
⊢ (Units.map ↑(canonicalEquiv R⁰ (FractionRing R) (FractionRing R))) I ≈
    (Units.map ↑(canonicalEquiv R⁰ (FractionRing R) (FractionRing R)))
      ((FractionalIdeal.mk0 (FractionRing R)) { val := integralRep ↑I, property := (_ : integralRep ↑I ∈ (Ideal R)⁰) })

Next tactic:
change @Setoid.r _
    (QuotientGroup.leftRel (toPrincipalIdeal R (FractionRing R)).range) _ _
theorem ClassGroup.mk0_integralRep [IsDedekindDomain R]
    (I : (FractionalIdeal R⁰ (FractionRing R))ˣ) :
    ClassGroup.mk0 ⟨ClassGroup.integralRep I, ClassGroup.integralRep_mem_nonZeroDivisors I.ne_zero⟩
      = ClassGroup.mk I := by
  let a := I.1.2.choose
  have a_ne_zero' := I.1.2.choose_spec.1
  have ha := I.1.2.choose_spec.2
  have fa_ne_zero : (algebraMap R (FractionRing R)) a ≠ 0 :=
    IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors a_ne_zero'
  symm
  apply Quotient.sound
  change @Setoid.r _
    (QuotientGroup.leftRel (toPrincipalIdeal R (FractionRing R)).range) _ _
  

Proof state:
case a
R : Type u_1
K : Type u_2
L : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : Field K
inst✝⁹ : Field L
inst✝⁸ : DecidableEq L
inst✝⁷ : Algebra R K
inst✝⁶ : IsFractionRing R K
inst✝⁵ : Algebra K L
inst✝⁴ : FiniteDimensional K L
inst✝³ : Algebra R L
inst✝² : IsScalarTower R K L
inst✝¹ : IsDomain R
inst✝ : IsDedekindDomain R
I : (FractionalIdeal R⁰ (FractionRing R))ˣ
a : R := Exists.choose (_ : IsFractional R⁰ ↑↑I)
a_ne_zero' : Exists.choose (_ : IsFractional R⁰ ↑↑I) ∈ R⁰
ha : ∀ b ∈ ↑↑I, IsInteger R (Exists.choose (_ : IsFractional R⁰ ↑↑I) • b)
fa_ne_zero : (algebraMap R (FractionRing R)) a ≠ 0
⊢ Setoid.r ((Units.map ↑(canonicalEquiv R⁰ (FractionRing R) (FractionRing R))) I)
    ((Units.map ↑(canonicalEquiv R⁰ (FractionRing R) (FractionRing R)))
      ((FractionalIdeal.mk0 (FractionRing R)) { val := integralRep ↑I, property := (_ : integralRep ↑I ∈ (Ideal R)⁰) }))

Next tactic:
rw [canonicalEquiv_self, RingEquiv.coe_monoidHom_refl, Units.map_id, MonoidHom.id_apply,
      MonoidHom.id_apply, QuotientGroup.leftRel_apply]
theorem ClassGroup.mk0_integralRep [IsDedekindDomain R]
    (I : (FractionalIdeal R⁰ (FractionRing R))ˣ) :
    ClassGroup.mk0 ⟨ClassGroup.integralRep I, ClassGroup.integralRep_mem_nonZeroDivisors I.ne_zero⟩
      = ClassGroup.mk I := by
  let a := I.1.2.choose
  have a_ne_zero' := I.1.2.choose_spec.1
  have ha := I.1.2.choose_spec.2
  have fa_ne_zero : (algebraMap R (FractionRing R)) a ≠ 0 :=
    IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors a_ne_zero'
  symm
  apply Quotient.sound
  change @Setoid.r _
    (QuotientGroup.leftRel (toPrincipalIdeal R (FractionRing R)).range) _ _
  rw [canonicalEquiv_self, RingEquiv.coe_monoidHom_refl, Units.map_id, MonoidHom.id_apply,
      MonoidHom.id_apply, QuotientGroup.leftRel_apply]
  

Proof state:
case a
R : Type u_1
K : Type u_2
L : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : Field K
inst✝⁹ : Field L
inst✝⁸ : DecidableEq L
inst✝⁷ : Algebra R K
inst✝⁶ : IsFractionRing R K
inst✝⁵ : Algebra K L
inst✝⁴ : FiniteDimensional K L
inst✝³ : Algebra R L
inst✝² : IsScalarTower R K L
inst✝¹ : IsDomain R
inst✝ : IsDedekindDomain R
I : (FractionalIdeal R⁰ (FractionRing R))ˣ
a : R := Exists.choose (_ : IsFractional R⁰ ↑↑I)
a_ne_zero' : Exists.choose (_ : IsFractional R⁰ ↑↑I) ∈ R⁰
ha : ∀ b ∈ ↑↑I, IsInteger R (Exists.choose (_ : IsFractional R⁰ ↑↑I) • b)
fa_ne_zero : (algebraMap R (FractionRing R)) a ≠ 0
⊢ I⁻¹ *
      (FractionalIdeal.mk0 (FractionRing R)) { val := integralRep ↑I, property := (_ : integralRep ↑I ∈ (Ideal R)⁰) } ∈
    MonoidHom.range (toPrincipalIdeal R (FractionRing R))

Next tactic:
refine ⟨Units.mk0 (algebraMap R _ a) fa_ne_zero, ?_⟩
theorem ClassGroup.mk0_integralRep [IsDedekindDomain R]
    (I : (FractionalIdeal R⁰ (FractionRing R))ˣ) :
    ClassGroup.mk0 ⟨ClassGroup.integralRep I, ClassGroup.integralRep_mem_nonZeroDivisors I.ne_zero⟩
      = ClassGroup.mk I := by
  let a := I.1.2.choose
  have a_ne_zero' := I.1.2.choose_spec.1
  have ha := I.1.2.choose_spec.2
  have fa_ne_zero : (algebraMap R (FractionRing R)) a ≠ 0 :=
    IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors a_ne_zero'
  symm
  apply Quotient.sound
  change @Setoid.r _
    (QuotientGroup.leftRel (toPrincipalIdeal R (FractionRing R)).range) _ _
  rw [canonicalEquiv_self, RingEquiv.coe_monoidHom_refl, Units.map_id, MonoidHom.id_apply,
      MonoidHom.id_apply, QuotientGroup.leftRel_apply]
  refine ⟨Units.mk0 (algebraMap R _ a) fa_ne_zero, ?_⟩
  

Proof state:
case a
R : Type u_1
K : Type u_2
L : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : Field K
inst✝⁹ : Field L
inst✝⁸ : DecidableEq L
inst✝⁷ : Algebra R K
inst✝⁶ : IsFractionRing R K
inst✝⁵ : Algebra K L
inst✝⁴ : FiniteDimensional K L
inst✝³ : Algebra R L
inst✝² : IsScalarTower R K L
inst✝¹ : IsDomain R
inst✝ : IsDedekindDomain R
I : (FractionalIdeal R⁰ (FractionRing R))ˣ
a : R := Exists.choose (_ : IsFractional R⁰ ↑↑I)
a_ne_zero' : Exists.choose (_ : IsFractional R⁰ ↑↑I) ∈ R⁰
ha : ∀ b ∈ ↑↑I, IsInteger R (Exists.choose (_ : IsFractional R⁰ ↑↑I) • b)
fa_ne_zero : (algebraMap R (FractionRing R)) a ≠ 0
⊢ (toPrincipalIdeal R (FractionRing R)) (Units.mk0 ((algebraMap R (FractionRing R)) a) fa_ne_zero) =
    I⁻¹ *
      (FractionalIdeal.mk0 (FractionRing R)) { val := integralRep ↑I, property := (_ : integralRep ↑I ∈ (Ideal R)⁰) }

Next tactic:
rw [_root_.eq_inv_mul_iff_mul_eq, eq_comm, mul_comm I]
theorem ClassGroup.mk0_integralRep [IsDedekindDomain R]
    (I : (FractionalIdeal R⁰ (FractionRing R))ˣ) :
    ClassGroup.mk0 ⟨ClassGroup.integralRep I, ClassGroup.integralRep_mem_nonZeroDivisors I.ne_zero⟩
      = ClassGroup.mk I := by
  let a := I.1.2.choose
  have a_ne_zero' := I.1.2.choose_spec.1
  have ha := I.1.2.choose_spec.2
  have fa_ne_zero : (algebraMap R (FractionRing R)) a ≠ 0 :=
    IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors a_ne_zero'
  symm
  apply Quotient.sound
  change @Setoid.r _
    (QuotientGroup.leftRel (toPrincipalIdeal R (FractionRing R)).range) _ _
  rw [canonicalEquiv_self, RingEquiv.coe_monoidHom_refl, Units.map_id, MonoidHom.id_apply,
      MonoidHom.id_apply, QuotientGroup.leftRel_apply]
  refine ⟨Units.mk0 (algebraMap R _ a) fa_ne_zero, ?_⟩
  rw [_root_.eq_inv_mul_iff_mul_eq, eq_comm, mul_comm I]
  

Proof state:
case a
R : Type u_1
K : Type u_2
L : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : Field K
inst✝⁹ : Field L
inst✝⁸ : DecidableEq L
inst✝⁷ : Algebra R K
inst✝⁶ : IsFractionRing R K
inst✝⁵ : Algebra K L
inst✝⁴ : FiniteDimensional K L
inst✝³ : Algebra R L
inst✝² : IsScalarTower R K L
inst✝¹ : IsDomain R
inst✝ : IsDedekindDomain R
I : (FractionalIdeal R⁰ (FractionRing R))ˣ
a : R := Exists.choose (_ : IsFractional R⁰ ↑↑I)
a_ne_zero' : Exists.choose (_ : IsFractional R⁰ ↑↑I) ∈ R⁰
ha : ∀ b ∈ ↑↑I, IsInteger R (Exists.choose (_ : IsFractional R⁰ ↑↑I) • b)
fa_ne_zero : (algebraMap R (FractionRing R)) a ≠ 0
⊢ (FractionalIdeal.mk0 (FractionRing R)) { val := integralRep ↑I, property := (_ : integralRep ↑I ∈ (Ideal R)⁰) } =
    (toPrincipalIdeal R (FractionRing R)) (Units.mk0 ((algebraMap R (FractionRing R)) a) fa_ne_zero) * I

Next tactic:
apply Units.ext
theorem ClassGroup.mk0_integralRep [IsDedekindDomain R]
    (I : (FractionalIdeal R⁰ (FractionRing R))ˣ) :
    ClassGroup.mk0 ⟨ClassGroup.integralRep I, ClassGroup.integralRep_mem_nonZeroDivisors I.ne_zero⟩
      = ClassGroup.mk I := by
  let a := I.1.2.choose
  have a_ne_zero' := I.1.2.choose_spec.1
  have ha := I.1.2.choose_spec.2
  have fa_ne_zero : (algebraMap R (FractionRing R)) a ≠ 0 :=
    IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors a_ne_zero'
  symm
  apply Quotient.sound
  change @Setoid.r _
    (QuotientGroup.leftRel (toPrincipalIdeal R (FractionRing R)).range) _ _
  rw [canonicalEquiv_self, RingEquiv.coe_monoidHom_refl, Units.map_id, MonoidHom.id_apply,
      MonoidHom.id_apply, QuotientGroup.leftRel_apply]
  refine ⟨Units.mk0 (algebraMap R _ a) fa_ne_zero, ?_⟩
  rw [_root_.eq_inv_mul_iff_mul_eq, eq_comm, mul_comm I]
  apply Units.ext
  

Proof state:
case a.a
R : Type u_1
K : Type u_2
L : Type u_3
inst✝¹¹ : CommRing R
inst✝¹⁰ : Field K
inst✝⁹ : Field L
inst✝⁸ : DecidableEq L
inst✝⁷ : Algebra R K
inst✝⁶ : IsFractionRing R K
inst✝⁵ : Algebra K L
inst✝⁴ : FiniteDimensional K L
inst✝³ : Algebra R L
inst✝² : IsScalarTower R K L
inst✝¹ : IsDomain R
inst✝ : IsDedekindDomain R
I : (FractionalIdeal R⁰ (FractionRing R))ˣ
a : R := Exists.choose (_ : IsFractional R⁰ ↑↑I)
a_ne_zero' : Exists.choose (_ : IsFractional R⁰ ↑↑I) ∈ R⁰
ha : ∀ b ∈ ↑↑I, IsInteger R (Exists.choose (_ : IsFractional R⁰ ↑↑I) • b)
fa_ne_zero : (algebraMap R (FractionRing R)) a ≠ 0
⊢ ↑((FractionalIdeal.mk0 (FractionRing R)) { val := integralRep ↑I, property := (_ : integralRep ↑I ∈ (Ideal R)⁰) }) =
    ↑((toPrincipalIdeal R (FractionRing R)) (Units.mk0 ((algebraMap R (FractionRing R)) a) fa_ne_zero) * I)

Next tactic:
simp only [FractionalIdeal.coe_mk0, FractionalIdeal.map_canonicalEquiv_mk0,
    Units.val_mk0, coe_toPrincipalIdeal, Units.val_mul,
    FractionalIdeal.eq_spanSingleton_mul]