/-- 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
      

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 : R) {x : R},
    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 • x ∈
        {
              toAddSubsemigroup :=
                { carrier := {x | ((algebraMap R (FractionRing R)) a)⁻¹ * (algebraMap R (FractionRing R)) x ∈ ↑I},
                  add_mem' :=
                    (_ :
                      ∀ {a_2 b : R},
                        a_2 ∈ {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_2 + 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_2 b : R},
                              a_2 ∈
                                  {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_2 + b ∈
                                    {x |
                                      ((algebraMap R (FractionRing R)) a)⁻¹ * (algebraMap R (FractionRing R)) x ∈
                                        ↑I}) }.carrier) }.toAddSubsemigroup.carrier

Next tactic:
intro c _ hb