l3lab/ntp-mathlib huggingface dataset:
theorem ClassGroup.mk0_eq_mk0_iff [IsDedekindDomain R] {I J : (Ideal R)⁰} :
    ClassGroup.mk0 I = ClassGroup.mk0 J ↔
      ∃ (x y : R) (_hx : x ≠ 0) (_hy : y ≠ 0), Ideal.span {x} * (I : Ideal R) =
      Ideal.span {y} * J := by
  refine (ClassGroup.mk0_eq_mk0_iff_exists_fraction_ring (FractionRing R)).trans ⟨?_, ?_⟩
  · rintro ⟨z, hz, h⟩
    obtain ⟨x, ⟨y, hy⟩, rfl⟩ := IsLocalization.mk'_surjective R⁰ z
    refine ⟨x, y, ?_, mem_nonZeroDivisors_iff_ne_zero.mp hy, ?_⟩
    · rintro hx; 

Proof state:
case refine_1.intro.intro.intro.intro.mk.refine_1
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 J : ↥(Ideal R)⁰
x y : R
hy : y ∈ R⁰
hz : mk' (FractionRing R) x { val := y, property := hy } ≠ 0
h : spanSingleton R⁰ (mk' (FractionRing R) x { val := y, property := hy }) * ↑↑I = ↑↑J
hx : x = 0
⊢ False

Next tactic:
apply hz
theorem ClassGroup.mk0_eq_mk0_iff [IsDedekindDomain R] {I J : (Ideal R)⁰} :
    ClassGroup.mk0 I = ClassGroup.mk0 J ↔
      ∃ (x y : R) (_hx : x ≠ 0) (_hy : y ≠ 0), Ideal.span {x} * (I : Ideal R) =
      Ideal.span {y} * J := by
  refine (ClassGroup.mk0_eq_mk0_iff_exists_fraction_ring (FractionRing R)).trans ⟨?_, ?_⟩
  · rintro ⟨z, hz, h⟩
    obtain ⟨x, ⟨y, hy⟩, rfl⟩ := IsLocalization.mk'_surjective R⁰ z
    refine ⟨x, y, ?_, mem_nonZeroDivisors_iff_ne_zero.mp hy, ?_⟩
    · rintro hx; apply hz
      

Proof state:
case refine_1.intro.intro.intro.intro.mk.refine_1
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 J : ↥(Ideal R)⁰
x y : R
hy : y ∈ R⁰
hz : mk' (FractionRing R) x { val := y, property := hy } ≠ 0
h : spanSingleton R⁰ (mk' (FractionRing R) x { val := y, property := hy }) * ↑↑I = ↑↑J
hx : x = 0
⊢ mk' (FractionRing R) x { val := y, property := hy } = 0

Next tactic:
rw [hx, IsFractionRing.mk'_eq_div, _root_.map_zero, zero_div]
theorem ClassGroup.mk0_eq_mk0_iff [IsDedekindDomain R] {I J : (Ideal R)⁰} :
    ClassGroup.mk0 I = ClassGroup.mk0 J ↔
      ∃ (x y : R) (_hx : x ≠ 0) (_hy : y ≠ 0), Ideal.span {x} * (I : Ideal R) =
      Ideal.span {y} * J := by
  refine (ClassGroup.mk0_eq_mk0_iff_exists_fraction_ring (FractionRing R)).trans ⟨?_, ?_⟩
  · rintro ⟨z, hz, h⟩
    obtain ⟨x, ⟨y, hy⟩, rfl⟩ := IsLocalization.mk'_surjective R⁰ z
    refine ⟨x, y, ?_, mem_nonZeroDivisors_iff_ne_zero.mp hy, ?_⟩
    · rintro hx; apply hz
      rw [hx, IsFractionRing.mk'_eq_div, _root_.map_zero, zero_div]
    · 

Proof state:
case refine_1.intro.intro.intro.intro.mk.refine_2
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 J : ↥(Ideal R)⁰
x y : R
hy : y ∈ R⁰
hz : mk' (FractionRing R) x { val := y, property := hy } ≠ 0
h : spanSingleton R⁰ (mk' (FractionRing R) x { val := y, property := hy }) * ↑↑I = ↑↑J
⊢ Ideal.span {x} * ↑I = Ideal.span {y} * ↑J

Next tactic:
exact (FractionalIdeal.mk'_mul_coeIdeal_eq_coeIdeal _ hy).mp h
theorem ClassGroup.mk0_eq_mk0_iff [IsDedekindDomain R] {I J : (Ideal R)⁰} :
    ClassGroup.mk0 I = ClassGroup.mk0 J ↔
      ∃ (x y : R) (_hx : x ≠ 0) (_hy : y ≠ 0), Ideal.span {x} * (I : Ideal R) =
      Ideal.span {y} * J := by
  refine (ClassGroup.mk0_eq_mk0_iff_exists_fraction_ring (FractionRing R)).trans ⟨?_, ?_⟩
  · rintro ⟨z, hz, h⟩
    obtain ⟨x, ⟨y, hy⟩, rfl⟩ := IsLocalization.mk'_surjective R⁰ z
    refine ⟨x, y, ?_, mem_nonZeroDivisors_iff_ne_zero.mp hy, ?_⟩
    · rintro hx; apply hz
      rw [hx, IsFractionRing.mk'_eq_div, _root_.map_zero, zero_div]
    · exact (FractionalIdeal.mk'_mul_coeIdeal_eq_coeIdeal _ hy).mp h
  · 

Proof state:
case refine_2
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 J : ↥(Ideal R)⁰
⊢ (∃ x y, ∃ (_ : x ≠ 0) (_ : y ≠ 0), Ideal.span {x} * ↑I = Ideal.span {y} * ↑J) →
    ∃ x, ∃ (_ : x ≠ 0), spanSingleton R⁰ x * ↑↑I = ↑↑J

Next tactic:
rintro ⟨x, y, hx, hy, h⟩
theorem ClassGroup.mk0_eq_mk0_iff [IsDedekindDomain R] {I J : (Ideal R)⁰} :
    ClassGroup.mk0 I = ClassGroup.mk0 J ↔
      ∃ (x y : R) (_hx : x ≠ 0) (_hy : y ≠ 0), Ideal.span {x} * (I : Ideal R) =
      Ideal.span {y} * J := by
  refine (ClassGroup.mk0_eq_mk0_iff_exists_fraction_ring (FractionRing R)).trans ⟨?_, ?_⟩
  · rintro ⟨z, hz, h⟩
    obtain ⟨x, ⟨y, hy⟩, rfl⟩ := IsLocalization.mk'_surjective R⁰ z
    refine ⟨x, y, ?_, mem_nonZeroDivisors_iff_ne_zero.mp hy, ?_⟩
    · rintro hx; apply hz
      rw [hx, IsFractionRing.mk'_eq_div, _root_.map_zero, zero_div]
    · exact (FractionalIdeal.mk'_mul_coeIdeal_eq_coeIdeal _ hy).mp h
  · rintro ⟨x, y, hx, hy, h⟩
    

Proof state:
case refine_2.intro.intro.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
inst✝ : IsDedekindDomain R
I J : ↥(Ideal R)⁰
x y : R
hx : x ≠ 0
hy : y ≠ 0
h : Ideal.span {x} * ↑I = Ideal.span {y} * ↑J
⊢ ∃ x, ∃ (_ : x ≠ 0), spanSingleton R⁰ x * ↑↑I = ↑↑J

Next tactic:
have hy' : y ∈ R⁰ := mem_nonZeroDivisors_iff_ne_zero.mpr hy
theorem ClassGroup.mk0_eq_mk0_iff [IsDedekindDomain R] {I J : (Ideal R)⁰} :
    ClassGroup.mk0 I = ClassGroup.mk0 J ↔
      ∃ (x y : R) (_hx : x ≠ 0) (_hy : y ≠ 0), Ideal.span {x} * (I : Ideal R) =
      Ideal.span {y} * J := by
  refine (ClassGroup.mk0_eq_mk0_iff_exists_fraction_ring (FractionRing R)).trans ⟨?_, ?_⟩
  · rintro ⟨z, hz, h⟩
    obtain ⟨x, ⟨y, hy⟩, rfl⟩ := IsLocalization.mk'_surjective R⁰ z
    refine ⟨x, y, ?_, mem_nonZeroDivisors_iff_ne_zero.mp hy, ?_⟩
    · rintro hx; apply hz
      rw [hx, IsFractionRing.mk'_eq_div, _root_.map_zero, zero_div]
    · exact (FractionalIdeal.mk'_mul_coeIdeal_eq_coeIdeal _ hy).mp h
  · rintro ⟨x, y, hx, hy, h⟩
    have hy' : y ∈ R⁰ := mem_nonZeroDivisors_iff_ne_zero.mpr hy
    

Proof state:
case refine_2.intro.intro.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
inst✝ : IsDedekindDomain R
I J : ↥(Ideal R)⁰
x y : R
hx : x ≠ 0
hy : y ≠ 0
h : Ideal.span {x} * ↑I = Ideal.span {y} * ↑J
hy' : y ∈ R⁰
⊢ ∃ x, ∃ (_ : x ≠ 0), spanSingleton R⁰ x * ↑↑I = ↑↑J

Next tactic:
refine ⟨IsLocalization.mk' _ x ⟨y, hy'⟩, ?_, ?_⟩
theorem ClassGroup.mk0_eq_mk0_iff [IsDedekindDomain R] {I J : (Ideal R)⁰} :
    ClassGroup.mk0 I = ClassGroup.mk0 J ↔
      ∃ (x y : R) (_hx : x ≠ 0) (_hy : y ≠ 0), Ideal.span {x} * (I : Ideal R) =
      Ideal.span {y} * J := by
  refine (ClassGroup.mk0_eq_mk0_iff_exists_fraction_ring (FractionRing R)).trans ⟨?_, ?_⟩
  · rintro ⟨z, hz, h⟩
    obtain ⟨x, ⟨y, hy⟩, rfl⟩ := IsLocalization.mk'_surjective R⁰ z
    refine ⟨x, y, ?_, mem_nonZeroDivisors_iff_ne_zero.mp hy, ?_⟩
    · rintro hx; apply hz
      rw [hx, IsFractionRing.mk'_eq_div, _root_.map_zero, zero_div]
    · exact (FractionalIdeal.mk'_mul_coeIdeal_eq_coeIdeal _ hy).mp h
  · rintro ⟨x, y, hx, hy, h⟩
    have hy' : y ∈ R⁰ := mem_nonZeroDivisors_iff_ne_zero.mpr hy
    refine ⟨IsLocalization.mk' _ x ⟨y, hy'⟩, ?_, ?_⟩
    · 

Proof state:
case refine_2.intro.intro.intro.intro.refine_1
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 J : ↥(Ideal R)⁰
x y : R
hx : x ≠ 0
hy : y ≠ 0
h : Ideal.span {x} * ↑I = Ideal.span {y} * ↑J
hy' : y ∈ R⁰
⊢ mk' (FractionRing R) x { val := y, property := hy' } ≠ 0

Next tactic:
contrapose! hx
theorem ClassGroup.mk0_eq_mk0_iff [IsDedekindDomain R] {I J : (Ideal R)⁰} :
    ClassGroup.mk0 I = ClassGroup.mk0 J ↔
      ∃ (x y : R) (_hx : x ≠ 0) (_hy : y ≠ 0), Ideal.span {x} * (I : Ideal R) =
      Ideal.span {y} * J := by
  refine (ClassGroup.mk0_eq_mk0_iff_exists_fraction_ring (FractionRing R)).trans ⟨?_, ?_⟩
  · rintro ⟨z, hz, h⟩
    obtain ⟨x, ⟨y, hy⟩, rfl⟩ := IsLocalization.mk'_surjective R⁰ z
    refine ⟨x, y, ?_, mem_nonZeroDivisors_iff_ne_zero.mp hy, ?_⟩
    · rintro hx; apply hz
      rw [hx, IsFractionRing.mk'_eq_div, _root_.map_zero, zero_div]
    · exact (FractionalIdeal.mk'_mul_coeIdeal_eq_coeIdeal _ hy).mp h
  · rintro ⟨x, y, hx, hy, h⟩
    have hy' : y ∈ R⁰ := mem_nonZeroDivisors_iff_ne_zero.mpr hy
    refine ⟨IsLocalization.mk' _ x ⟨y, hy'⟩, ?_, ?_⟩
    · contrapose! hx
      

Proof state:
case refine_2.intro.intro.intro.intro.refine_1
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 J : ↥(Ideal R)⁰
x y : R
hy : y ≠ 0
h : Ideal.span {x} * ↑I = Ideal.span {y} * ↑J
hy' : y ∈ R⁰
hx : mk' (FractionRing R) x { val := y, property := hy' } = 0
⊢ x = 0

Next tactic:
rwa [mk'_eq_iff_eq_mul, zero_mul, ← (algebraMap R (FractionRing R)).map_zero,
        (IsFractionRing.injective R (FractionRing R)).eq_iff] at hx
theorem ClassGroup.mk0_eq_mk0_iff [IsDedekindDomain R] {I J : (Ideal R)⁰} :
    ClassGroup.mk0 I = ClassGroup.mk0 J ↔
      ∃ (x y : R) (_hx : x ≠ 0) (_hy : y ≠ 0), Ideal.span {x} * (I : Ideal R) =
      Ideal.span {y} * J := by
  refine (ClassGroup.mk0_eq_mk0_iff_exists_fraction_ring (FractionRing R)).trans ⟨?_, ?_⟩
  · rintro ⟨z, hz, h⟩
    obtain ⟨x, ⟨y, hy⟩, rfl⟩ := IsLocalization.mk'_surjective R⁰ z
    refine ⟨x, y, ?_, mem_nonZeroDivisors_iff_ne_zero.mp hy, ?_⟩
    · rintro hx; apply hz
      rw [hx, IsFractionRing.mk'_eq_div, _root_.map_zero, zero_div]
    · exact (FractionalIdeal.mk'_mul_coeIdeal_eq_coeIdeal _ hy).mp h
  · rintro ⟨x, y, hx, hy, h⟩
    have hy' : y ∈ R⁰ := mem_nonZeroDivisors_iff_ne_zero.mpr hy
    refine ⟨IsLocalization.mk' _ x ⟨y, hy'⟩, ?_, ?_⟩
    · contrapose! hx
      rwa [mk'_eq_iff_eq_mul, zero_mul, ← (algebraMap R (FractionRing R)).map_zero,
        (IsFractionRing.injective R (FractionRing R)).eq_iff] at hx
    · 

Proof state:
case refine_2.intro.intro.intro.intro.refine_2
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 J : ↥(Ideal R)⁰
x y : R
hx : x ≠ 0
hy : y ≠ 0
h : Ideal.span {x} * ↑I = Ideal.span {y} * ↑J
hy' : y ∈ R⁰
⊢ spanSingleton R⁰ (mk' (FractionRing R) x { val := y, property := hy' }) * ↑↑I = ↑↑J

Next tactic:
exact (FractionalIdeal.mk'_mul_coeIdeal_eq_coeIdeal _ hy').mpr h
/-- Maps a nonzero fractional ideal to an integral representative in the class group. -/
noncomputable def ClassGroup.integralRep
    (I : FractionalIdeal R⁰ (FractionRing R)) :
    Ideal R :=
  let a := I.2.choose
  { carrier := {x | (algebraMap R _ a)⁻¹ * algebraMap R _ x ∈ I.1}
    add_mem' := 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
I : FractionalIdeal R⁰ (FractionRing R)
a : R := Exists.choose (_ : IsFractional R⁰ ↑I)
⊢ ∀ {a_1 b : R},
    a_1 ∈ {x | ((algebraMap R (FractionRing R)) a)⁻¹ * (algebraMap R (FractionRing R)) x ∈ ↑I} →
      b ∈ {x | ((algebraMap R (FractionRing R)) a)⁻¹ * (algebraMap R (FractionRing R)) x ∈ ↑I} →
        a_1 + b ∈ {x | ((algebraMap R (FractionRing R)) a)⁻¹ * (algebraMap R (FractionRing R)) x ∈ ↑I}

Next tactic:
simp only [Set.mem_setOf_eq, RingHom.map_add, mul_add]
/-- Maps a nonzero fractional ideal to an integral representative in the class group. -/
noncomputable def ClassGroup.integralRep
    (I : FractionalIdeal R⁰ (FractionRing R)) :
    Ideal R :=
  let a := I.2.choose
  { carrier := {x | (algebraMap R _ a)⁻¹ * algebraMap R _ x ∈ I.1}
    add_mem' := by
      simp only [Set.mem_setOf_eq, RingHom.map_add, mul_add]
      

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)
a : R := Exists.choose (_ : IsFractional R⁰ ↑I)
⊢ ∀ {a b : R},
    ((algebraMap R (FractionRing R)) (Exists.choose (_ : IsFractional R⁰ ↑I)))⁻¹ * (algebraMap R (FractionRing R)) a ∈
        ↑I →
      ((algebraMap R (FractionRing R)) (Exists.choose (_ : IsFractional R⁰ ↑I)))⁻¹ * (algebraMap R (FractionRing R)) b ∈
          ↑I →
        ((algebraMap R (FractionRing R)) (Exists.choose (_ : IsFractional R⁰ ↑I)))⁻¹ *
              (algebraMap R (FractionRing R)) a +
            ((algebraMap R (FractionRing R)) (Exists.choose (_ : IsFractional R⁰ ↑I)))⁻¹ *
              (algebraMap R (FractionRing R)) b ∈
          ↑I

Next tactic:
exact fun ha hb => Submodule.add_mem _ ha hb
/-- Maps a nonzero fractional ideal to an integral representative in the class group. -/
noncomputable def ClassGroup.integralRep
    (I : FractionalIdeal R⁰ (FractionRing R)) :
    Ideal R :=
  let a := I.2.choose
  { carrier := {x | (algebraMap R _ a)⁻¹ * algebraMap R _ x ∈ I.1}
    add_mem' := by
      simp only [Set.mem_setOf_eq, RingHom.map_add, mul_add]
      exact fun ha hb => Submodule.add_mem _ ha hb
    zero_mem' := 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
I : FractionalIdeal R⁰ (FractionRing R)
a : R := Exists.choose (_ : IsFractional R⁰ ↑I)
⊢ 0 ∈
    { carrier := {x | ((algebraMap R (FractionRing R)) a)⁻¹ * (algebraMap R (FractionRing R)) x ∈ ↑I},
        add_mem' :=
          (_ :
            ∀ {a_1 b : R},
              a_1 ∈ {x | ((algebraMap R (FractionRing R)) a)⁻¹ * (algebraMap R (FractionRing R)) x ∈ ↑I} →
                b ∈ {x | ((algebraMap R (FractionRing R)) a)⁻¹ * (algebraMap R (FractionRing R)) x ∈ ↑I} →
                  a_1 + b ∈
                    {x | ((algebraMap R (FractionRing R)) a)⁻¹ * (algebraMap R (FractionRing R)) x ∈ ↑I}) }.carrier

Next tactic:
simp only [Set.mem_setOf_eq, RingHom.map_zero, mul_zero]
/-- Maps a nonzero fractional ideal to an integral representative in the class group. -/
noncomputable def ClassGroup.integralRep
    (I : FractionalIdeal R⁰ (FractionRing R)) :
    Ideal R :=
  let a := I.2.choose
  { carrier := {x | (algebraMap R _ a)⁻¹ * algebraMap R _ x ∈ I.1}
    add_mem' := by
      simp only [Set.mem_setOf_eq, RingHom.map_add, mul_add]
      exact fun ha hb => Submodule.add_mem _ ha hb
    zero_mem' := by
      simp only [Set.mem_setOf_eq, RingHom.map_zero, mul_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)
a : R := Exists.choose (_ : IsFractional R⁰ ↑I)
⊢ 0 ∈ ↑I

Next tactic:
exact Submodule.zero_mem _
/-- Maps a nonzero fractional ideal to an integral representative in the class group. -/
noncomputable def ClassGroup.integralRep
    (I : FractionalIdeal R⁰ (FractionRing R)) :
    Ideal R :=
  let a := I.2.choose
  { carrier := {x | (algebraMap R _ a)⁻¹ * algebraMap R _ x ∈ I.1}
    add_mem' := by
      simp only [Set.mem_setOf_eq, RingHom.map_add, mul_add]
      exact fun ha hb => Submodule.add_mem _ ha hb
    zero_mem' := by
      simp only [Set.mem_setOf_eq, RingHom.map_zero, mul_zero]
      exact Submodule.zero_mem _
    smul_mem' := by
      intro c _ hb
      simp only [smul_eq_mul, Set.mem_setOf_eq, RingHom.map_mul,
        mul_left_comm ((algebraMap R (FractionRing R)) a)⁻¹]
      

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)
a : R := Exists.choose (_ : IsFractional R⁰ ↑I)
c x✝ : R
hb :
  x✝ ∈
    {
          toAddSubsemigroup :=
            { carrier := {x | ((algebraMap R (FractionRing R)) a)⁻¹ * (algebraMap R (FractionRing R)) x ∈ ↑I},
              add_mem' :=
                (_ :
                  ∀ {a_1 b : R},
                    a_1 ∈ {x | ((algebraMap R (FractionRing R)) a)⁻¹ * (algebraMap R (FractionRing R)) x ∈ ↑I} →
                      b ∈ {x | ((algebraMap R (FractionRing R)) a)⁻¹ * (algebraMap R (FractionRing R)) x ∈ ↑I} →
                        a_1 + b ∈
                          {x | ((algebraMap R (FractionRing R)) a)⁻¹ * (algebraMap R (FractionRing R)) x ∈ ↑I}) },
          zero_mem' :=
            (_ :
              0 ∈
                { carrier := {x | ((algebraMap R (FractionRing R)) a)⁻¹ * (algebraMap R (FractionRing R)) x ∈ ↑I},
                    add_mem' :=
                      (_ :
                        ∀ {a_1 b : R},
                          a_1 ∈ {x | ((algebraMap R (FractionRing R)) a)⁻¹ * (algebraMap R (FractionRing R)) x ∈ ↑I} →
                            b ∈ {x | ((algebraMap R (FractionRing R)) a)⁻¹ * (algebraMap R (FractionRing R)) x ∈ ↑I} →
                              a_1 + b ∈
                                {x |
                                  ((algebraMap R (FractionRing R)) a)⁻¹ * (algebraMap R (FractionRing R)) x ∈
                                    ↑I}) }.carrier) }.toAddSubsemigroup.carrier
⊢ (algebraMap R (FractionRing R)) c *
      (((algebraMap R (FractionRing R)) (Exists.choose (_ : IsFractional R⁰ ↑I)))⁻¹ *
        (algebraMap R (FractionRing R)) x✝) ∈
    ↑I

Next tactic:
rw [← Algebra.smul_def c]
/-- Maps a nonzero fractional ideal to an integral representative in the class group. -/
noncomputable def ClassGroup.integralRep
    (I : FractionalIdeal R⁰ (FractionRing R)) :
    Ideal R :=
  let a := I.2.choose
  { carrier := {x | (algebraMap R _ a)⁻¹ * algebraMap R _ x ∈ I.1}
    add_mem' := by
      simp only [Set.mem_setOf_eq, RingHom.map_add, mul_add]
      exact fun ha hb => Submodule.add_mem _ ha hb
    zero_mem' := by
      simp only [Set.mem_setOf_eq, RingHom.map_zero, mul_zero]
      exact Submodule.zero_mem _
    smul_mem' := by
      intro c _ hb
      simp only [smul_eq_mul, Set.mem_setOf_eq, RingHom.map_mul,
        mul_left_comm ((algebraMap R (FractionRing R)) a)⁻¹]
      rw [← Algebra.smul_def c]
      

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)
a : R := Exists.choose (_ : IsFractional R⁰ ↑I)
c x✝ : R
hb :
  x✝ ∈
    {
          toAddSubsemigroup :=
            { carrier := {x | ((algebraMap R (FractionRing R)) a)⁻¹ * (algebraMap R (FractionRing R)) x ∈ ↑I},
              add_mem' :=
                (_ :
                  ∀ {a_1 b : R},
                    a_1 ∈ {x | ((algebraMap R (FractionRing R)) a)⁻¹ * (algebraMap R (FractionRing R)) x ∈ ↑I} →
                      b ∈ {x | ((algebraMap R (FractionRing R)) a)⁻¹ * (algebraMap R (FractionRing R)) x ∈ ↑I} →
                        a_1 + b ∈
                          {x | ((algebraMap R (FractionRing R)) a)⁻¹ * (algebraMap R (FractionRing R)) x ∈ ↑I}) },
          zero_mem' :=
            (_ :
              0 ∈
                { carrier := {x | ((algebraMap R (FractionRing R)) a)⁻¹ * (algebraMap R (FractionRing R)) x ∈ ↑I},
                    add_mem' :=
                      (_ :
                        ∀ {a_1 b : R},
                          a_1 ∈ {x | ((algebraMap R (FractionRing R)) a)⁻¹ * (algebraMap R (FractionRing R)) x ∈ ↑I} →
                            b ∈ {x | ((algebraMap R (FractionRing R)) a)⁻¹ * (algebraMap R (FractionRing R)) x ∈ ↑I} →
                              a_1 + b ∈
                                {x |
                                  ((algebraMap R (FractionRing R)) a)⁻¹ * (algebraMap R (FractionRing R)) x ∈
                                    ↑I}) }.carrier) }.toAddSubsemigroup.carrier
⊢ c •
      (((algebraMap R (FractionRing R)) (Exists.choose (_ : IsFractional R⁰ ↑I)))⁻¹ *
        (algebraMap R (FractionRing R)) x✝) ∈
    ↑I

Next tactic:
exact Submodule.smul_mem _ c hb
theorem ClassGroup.integralRep_mem_nonZeroDivisors
    {I} (hI : I ≠ 0) :
    ClassGroup.integralRep I ∈ (Ideal R)⁰ := 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
I : FractionalIdeal R⁰ (FractionRing R)
hI : I ≠ 0
⊢ integralRep I ∈ (Ideal R)⁰

Next tactic:
let a := I.2.choose
theorem ClassGroup.integralRep_mem_nonZeroDivisors
    {I} (hI : I ≠ 0) :
    ClassGroup.integralRep I ∈ (Ideal R)⁰ := by
  let a := I.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
I : FractionalIdeal R⁰ (FractionRing R)
hI : I ≠ 0
a : R := Exists.choose (_ : IsFractional R⁰ ↑I)
⊢ integralRep I ∈ (Ideal R)⁰

Next tactic:
have a_ne_zero' := I.2.choose_spec.1
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
  

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⁰
⊢ integralRep I ∈ (Ideal R)⁰

Next tactic:
have a_ne_zero := mem_nonZeroDivisors_iff_ne_zero.mp a_ne_zero'