l3lab/ntp-mathlib huggingface dataset:
instance instAlgebra [Algebra S R] (r : R → R → Prop) : Algebra S (RingQuot r) where
  smul := (· • ·)
  toFun r := ⟨Quot.mk _ (algebraMap S R r)⟩
  map_one' := by simp [← one_quot]
  map_mul' := by simp [mul_quot]
  map_zero' := by simp [← zero_quot]
  map_add' := by simp [add_quot]
  commutes' r := by
    rintro ⟨⟨a⟩⟩
    

Proof state:
case mk.mk
R : Type uR
inst✝⁴ : Semiring R
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝¹ : R → R → Prop
inst✝ : Algebra S R
r✝ : R → R → Prop
r : S
toQuot✝ : Quot (Rel r✝)
a : R
⊢ {
          toMonoidHom :=
            {
              toOneHom :=
                { toFun := fun r => { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) r) },
                  map_one' := (_ : { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) 1) } = 1) },
              map_mul' :=
                (_ :
                  ∀ (a a_1 : S),
                    { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) (a * a_1)) } =
                      { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) a) } *
                        { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) a_1) }) },
          map_zero' := (_ : { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) 0) } = 0),
          map_add' :=
            (_ :
              ∀ (a a_1 : S),
                { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) (a + a_1)) } =
                  { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) a) } +
                    { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) a_1) }) }
        r *
      { toQuot := Quot.mk (Rel r✝) a } =
    { toQuot := Quot.mk (Rel r✝) a } *
      {
          toMonoidHom :=
            {
              toOneHom :=
                { toFun := fun r => { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) r) },
                  map_one' := (_ : { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) 1) } = 1) },
              map_mul' :=
                (_ :
                  ∀ (a a_1 : S),
                    { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) (a * a_1)) } =
                      { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) a) } *
                        { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) a_1) }) },
          map_zero' := (_ : { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) 0) } = 0),
          map_add' :=
            (_ :
              ∀ (a a_1 : S),
                { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) (a + a_1)) } =
                  { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) a) } +
                    { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) a_1) }) }
        r

Next tactic:
simp [Algebra.commutes, mul_quot]
instance instAlgebra [Algebra S R] (r : R → R → Prop) : Algebra S (RingQuot r) where
  smul := (· • ·)
  toFun r := ⟨Quot.mk _ (algebraMap S R r)⟩
  map_one' := by simp [← one_quot]
  map_mul' := by simp [mul_quot]
  map_zero' := by simp [← zero_quot]
  map_add' := by simp [add_quot]
  commutes' r := by
    rintro ⟨⟨a⟩⟩
    simp [Algebra.commutes, mul_quot]
  smul_def' r := by
    

Proof state:
R : Type uR
inst✝⁴ : Semiring R
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝¹ : R → R → Prop
inst✝ : Algebra S R
r✝ : R → R → Prop
r : S
⊢ ∀ (x : RingQuot r✝),
    r • x =
      {
            toMonoidHom :=
              {
                toOneHom :=
                  { toFun := fun r => { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) r) },
                    map_one' := (_ : { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) 1) } = 1) },
                map_mul' :=
                  (_ :
                    ∀ (a a_1 : S),
                      { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) (a * a_1)) } =
                        { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) a) } *
                          { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) a_1) }) },
            map_zero' := (_ : { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) 0) } = 0),
            map_add' :=
              (_ :
                ∀ (a a_1 : S),
                  { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) (a + a_1)) } =
                    { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) a) } +
                      { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) a_1) }) }
          r *
        x

Next tactic:
rintro ⟨⟨a⟩⟩
instance instAlgebra [Algebra S R] (r : R → R → Prop) : Algebra S (RingQuot r) where
  smul := (· • ·)
  toFun r := ⟨Quot.mk _ (algebraMap S R r)⟩
  map_one' := by simp [← one_quot]
  map_mul' := by simp [mul_quot]
  map_zero' := by simp [← zero_quot]
  map_add' := by simp [add_quot]
  commutes' r := by
    rintro ⟨⟨a⟩⟩
    simp [Algebra.commutes, mul_quot]
  smul_def' r := by
    rintro ⟨⟨a⟩⟩
    

Proof state:
case mk.mk
R : Type uR
inst✝⁴ : Semiring R
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝¹ : R → R → Prop
inst✝ : Algebra S R
r✝ : R → R → Prop
r : S
toQuot✝ : Quot (Rel r✝)
a : R
⊢ r • { toQuot := Quot.mk (Rel r✝) a } =
    {
          toMonoidHom :=
            {
              toOneHom :=
                { toFun := fun r => { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) r) },
                  map_one' := (_ : { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) 1) } = 1) },
              map_mul' :=
                (_ :
                  ∀ (a a_1 : S),
                    { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) (a * a_1)) } =
                      { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) a) } *
                        { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) a_1) }) },
          map_zero' := (_ : { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) 0) } = 0),
          map_add' :=
            (_ :
              ∀ (a a_1 : S),
                { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) (a + a_1)) } =
                  { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) a) } +
                    { toQuot := Quot.mk (Rel r✝) ((algebraMap S R) a_1) }) }
        r *
      { toQuot := Quot.mk (Rel r✝) a }

Next tactic:
simp [smul_quot, Algebra.smul_def, mul_quot]
/-- The quotient map from a ring to its quotient, as a homomorphism of rings.
-/
irreducible_def mkRingHom (r : R → R → Prop) : R →+* RingQuot r :=
  { toFun := fun x ↦ ⟨Quot.mk _ x⟩
    map_one' := by 

Proof state:
R : Type uR
inst✝³ : Semiring R
S : Type uS
inst✝² : CommSemiring S
T : Type uT
A : Type uA
inst✝¹ : Semiring A
inst✝ : Algebra S A
r✝ r : R → R → Prop
⊢ (fun x => { toQuot := Quot.mk (Rel r) x }) 1 = 1

Next tactic:
simp [← one_quot]
/-- The quotient map from a ring to its quotient, as a homomorphism of rings.
-/
irreducible_def mkRingHom (r : R → R → Prop) : R →+* RingQuot r :=
  { toFun := fun x ↦ ⟨Quot.mk _ x⟩
    map_one' := by simp [← one_quot]
    map_mul' := by 

Proof state:
R : Type uR
inst✝³ : Semiring R
S : Type uS
inst✝² : CommSemiring S
T : Type uT
A : Type uA
inst✝¹ : Semiring A
inst✝ : Algebra S A
r✝ r : R → R → Prop
⊢ ∀ (x y : R),
    OneHom.toFun
        { toFun := fun x => { toQuot := Quot.mk (Rel r) x }, map_one' := (_ : { toQuot := Quot.mk (Rel r) 1 } = 1) }
        (x * y) =
      OneHom.toFun
          { toFun := fun x => { toQuot := Quot.mk (Rel r) x }, map_one' := (_ : { toQuot := Quot.mk (Rel r) 1 } = 1) }
          x *
        OneHom.toFun
          { toFun := fun x => { toQuot := Quot.mk (Rel r) x }, map_one' := (_ : { toQuot := Quot.mk (Rel r) 1 } = 1) } y

Next tactic:
simp [mul_quot]
/-- The quotient map from a ring to its quotient, as a homomorphism of rings.
-/
irreducible_def mkRingHom (r : R → R → Prop) : R →+* RingQuot r :=
  { toFun := fun x ↦ ⟨Quot.mk _ x⟩
    map_one' := by simp [← one_quot]
    map_mul' := by simp [mul_quot]
    map_zero' := by 

Proof state:
R : Type uR
inst✝³ : Semiring R
S : Type uS
inst✝² : CommSemiring S
T : Type uT
A : Type uA
inst✝¹ : Semiring A
inst✝ : Algebra S A
r✝ r : R → R → Prop
⊢ OneHom.toFun
      (↑{
          toOneHom :=
            { toFun := fun x => { toQuot := Quot.mk (Rel r) x },
              map_one' := (_ : { toQuot := Quot.mk (Rel r) 1 } = 1) },
          map_mul' :=
            (_ :
              ∀ (a a_1 : R),
                { toQuot := Quot.mk (Rel r) (a * a_1) } =
                  { toQuot := Quot.mk (Rel r) a } * { toQuot := Quot.mk (Rel r) a_1 }) })
      0 =
    0

Next tactic:
simp [← zero_quot]
/-- The quotient map from a ring to its quotient, as a homomorphism of rings.
-/
irreducible_def mkRingHom (r : R → R → Prop) : R →+* RingQuot r :=
  { toFun := fun x ↦ ⟨Quot.mk _ x⟩
    map_one' := by simp [← one_quot]
    map_mul' := by simp [mul_quot]
    map_zero' := by simp [← zero_quot]
    map_add' := by 

Proof state:
R : Type uR
inst✝³ : Semiring R
S : Type uS
inst✝² : CommSemiring S
T : Type uT
A : Type uA
inst✝¹ : Semiring A
inst✝ : Algebra S A
r✝ r : R → R → Prop
⊢ ∀ (x y : R),
    OneHom.toFun
        (↑{
            toOneHom :=
              { toFun := fun x => { toQuot := Quot.mk (Rel r) x },
                map_one' := (_ : { toQuot := Quot.mk (Rel r) 1 } = 1) },
            map_mul' :=
              (_ :
                ∀ (a a_1 : R),
                  { toQuot := Quot.mk (Rel r) (a * a_1) } =
                    { toQuot := Quot.mk (Rel r) a } * { toQuot := Quot.mk (Rel r) a_1 }) })
        (x + y) =
      OneHom.toFun
          (↑{
              toOneHom :=
                { toFun := fun x => { toQuot := Quot.mk (Rel r) x },
                  map_one' := (_ : { toQuot := Quot.mk (Rel r) 1 } = 1) },
              map_mul' :=
                (_ :
                  ∀ (a a_1 : R),
                    { toQuot := Quot.mk (Rel r) (a * a_1) } =
                      { toQuot := Quot.mk (Rel r) a } * { toQuot := Quot.mk (Rel r) a_1 }) })
          x +
        OneHom.toFun
          (↑{
              toOneHom :=
                { toFun := fun x => { toQuot := Quot.mk (Rel r) x },
                  map_one' := (_ : { toQuot := Quot.mk (Rel r) 1 } = 1) },
              map_mul' :=
                (_ :
                  ∀ (a a_1 : R),
                    { toQuot := Quot.mk (Rel r) (a * a_1) } =
                      { toQuot := Quot.mk (Rel r) a } * { toQuot := Quot.mk (Rel r) a_1 }) })
          y

Next tactic:
simp [add_quot]
theorem mkRingHom_rel {r : R → R → Prop} {x y : R} (w : r x y) : mkRingHom r x = mkRingHom r y := by
  

Proof state:
R : Type uR
inst✝³ : Semiring R
S : Type uS
inst✝² : CommSemiring S
T : Type uT
A : Type uA
inst✝¹ : Semiring A
inst✝ : Algebra S A
r✝ r : R → R → Prop
x y : R
w : r x y
⊢ (mkRingHom r) x = (mkRingHom r) y

Next tactic:
simp [mkRingHom_def, Quot.sound (Rel.of w)]
theorem mkRingHom_surjective (r : R → R → Prop) : Function.Surjective (mkRingHom r) := by
  

Proof state:
R : Type uR
inst✝³ : Semiring R
S : Type uS
inst✝² : CommSemiring S
T : Type uT
A : Type uA
inst✝¹ : Semiring A
inst✝ : Algebra S A
r✝ r : R → R → Prop
⊢ Function.Surjective ⇑(mkRingHom r)

Next tactic:
simp only [mkRingHom_def, RingHom.coe_mk, MonoidHom.coe_mk, OneHom.coe_mk]
theorem mkRingHom_surjective (r : R → R → Prop) : Function.Surjective (mkRingHom r) := by
  simp only [mkRingHom_def, RingHom.coe_mk, MonoidHom.coe_mk, OneHom.coe_mk]
  

Proof state:
R : Type uR
inst✝³ : Semiring R
S : Type uS
inst✝² : CommSemiring S
T : Type uT
A : Type uA
inst✝¹ : Semiring A
inst✝ : Algebra S A
r✝ r : R → R → Prop
⊢ Function.Surjective fun x => { toQuot := Quot.mk (Rel r) x }

Next tactic:
rintro ⟨⟨⟩⟩
theorem mkRingHom_surjective (r : R → R → Prop) : Function.Surjective (mkRingHom r) := by
  simp only [mkRingHom_def, RingHom.coe_mk, MonoidHom.coe_mk, OneHom.coe_mk]
  rintro ⟨⟨⟩⟩
  

Proof state:
case mk.mk
R : Type uR
inst✝³ : Semiring R
S : Type uS
inst✝² : CommSemiring S
T : Type uT
A : Type uA
inst✝¹ : Semiring A
inst✝ : Algebra S A
r✝ r : R → R → Prop
toQuot✝ : Quot (Rel r)
a✝ : R
⊢ ∃ a, (fun x => { toQuot := Quot.mk (Rel r) x }) a = { toQuot := Quot.mk (Rel r) a✝ }

Next tactic:
simp
@[ext 1100]
theorem ringQuot_ext [Semiring T] {r : R → R → Prop} (f g : RingQuot r →+* T)
    (w : f.comp (mkRingHom r) = g.comp (mkRingHom r)) : f = g := by
  

Proof state:
R : Type uR
inst✝⁴ : Semiring R
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝ : R → R → Prop
inst✝ : Semiring T
r : R → R → Prop
f g : RingQuot r →+* T
w : RingHom.comp f (mkRingHom r) = RingHom.comp g (mkRingHom r)
⊢ f = g

Next tactic:
ext x
@[ext 1100]
theorem ringQuot_ext [Semiring T] {r : R → R → Prop} (f g : RingQuot r →+* T)
    (w : f.comp (mkRingHom r) = g.comp (mkRingHom r)) : f = g := by
  ext x
  

Proof state:
case a
R : Type uR
inst✝⁴ : Semiring R
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝ : R → R → Prop
inst✝ : Semiring T
r : R → R → Prop
f g : RingQuot r →+* T
w : RingHom.comp f (mkRingHom r) = RingHom.comp g (mkRingHom r)
x : RingQuot r
⊢ f x = g x

Next tactic:
rcases mkRingHom_surjective r x with ⟨x, rfl⟩
@[ext 1100]
theorem ringQuot_ext [Semiring T] {r : R → R → Prop} (f g : RingQuot r →+* T)
    (w : f.comp (mkRingHom r) = g.comp (mkRingHom r)) : f = g := by
  ext x
  rcases mkRingHom_surjective r x with ⟨x, rfl⟩
  

Proof state:
case a.intro
R : Type uR
inst✝⁴ : Semiring R
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝ : R → R → Prop
inst✝ : Semiring T
r : R → R → Prop
f g : RingQuot r →+* T
w : RingHom.comp f (mkRingHom r) = RingHom.comp g (mkRingHom r)
x : R
⊢ f ((mkRingHom r) x) = g ((mkRingHom r) x)

Next tactic:
exact (RingHom.congr_fun w x : _)
irreducible_def preLift {r : R → R → Prop} { f : R →+* T } (h : ∀ ⦃x y⦄, r x y → f x = f y) :
  RingQuot r →+* T :=
  { toFun := fun x ↦ Quot.lift f
        (by
          

Proof state:
R : Type uR
inst✝⁴ : Semiring R
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝ : R → R → Prop
inst✝ : Semiring T
r : R → R → Prop
f : R →+* T
h : ∀ ⦃x y : R⦄, r x y → f x = f y
x : RingQuot r
⊢ ∀ (a b : R), Rel r a b → f a = f b

Next tactic:
rintro _ _ r
irreducible_def preLift {r : R → R → Prop} { f : R →+* T } (h : ∀ ⦃x y⦄, r x y → f x = f y) :
  RingQuot r →+* T :=
  { toFun := fun x ↦ Quot.lift f
        (by
          rintro _ _ r
          

Proof state:
R : Type uR
inst✝⁴ : Semiring R
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝¹ : R → R → Prop
inst✝ : Semiring T
r✝ : R → R → Prop
f : R →+* T
h : ∀ ⦃x y : R⦄, r✝ x y → f x = f y
x : RingQuot r✝
a✝ b✝ : R
r : Rel r✝ a✝ b✝
⊢ f a✝ = f b✝

Next tactic:
induction r with
          | of r => exact h r
          | add_left _ r' => rw [map_add, map_add, r']
          | mul_left _ r' => rw [map_mul, map_mul, r']
          | mul_right _ r' => rw [map_mul, map_mul, r']
irreducible_def preLift {r : R → R → Prop} { f : R →+* T } (h : ∀ ⦃x y⦄, r x y → f x = f y) :
  RingQuot r →+* T :=
  { toFun := fun x ↦ Quot.lift f
        (by
          rintro _ _ r
          induction r with
          

Proof state:
case of
R : Type uR
inst✝⁴ : Semiring R
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝¹ : R → R → Prop
inst✝ : Semiring T
r✝ : R → R → Prop
f : R →+* T
h : ∀ ⦃x y : R⦄, r✝ x y → f x = f y
x : RingQuot r✝
a✝ b✝ x✝ y✝ : R
r : r✝ x✝ y✝
⊢ f x✝ = f y✝

Next tactic:
| of r => exact h r
irreducible_def preLift {r : R → R → Prop} { f : R →+* T } (h : ∀ ⦃x y⦄, r x y → f x = f y) :
  RingQuot r →+* T :=
  { toFun := fun x ↦ Quot.lift f
        (by
          rintro _ _ r
          induction r with
          | of r => 

Proof state:
case of
R : Type uR
inst✝⁴ : Semiring R
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝¹ : R → R → Prop
inst✝ : Semiring T
r✝ : R → R → Prop
f : R →+* T
h : ∀ ⦃x y : R⦄, r✝ x y → f x = f y
x : RingQuot r✝
a✝ b✝ x✝ y✝ : R
r : r✝ x✝ y✝
⊢ f x✝ = f y✝

Next tactic:
exact h r
irreducible_def preLift {r : R → R → Prop} { f : R →+* T } (h : ∀ ⦃x y⦄, r x y → f x = f y) :
  RingQuot r →+* T :=
  { toFun := fun x ↦ Quot.lift f
        (by
          rintro _ _ r
          induction r with
          | of r => exact h r
          

Proof state:
case add_left
R : Type uR
inst✝⁴ : Semiring R
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝ : R → R → Prop
inst✝ : Semiring T
r : R → R → Prop
f : R →+* T
h : ∀ ⦃x y : R⦄, r x y → f x = f y
x : RingQuot r
a✝² b✝¹ a✝¹ b✝ c✝ : R
a✝ : Rel r a✝¹ b✝
r' : f a✝¹ = f b✝
⊢ f (a✝¹ + c✝) = f (b✝ + c✝)

Next tactic:
| add_left _ r' => rw [map_add, map_add, r']
irreducible_def preLift {r : R → R → Prop} { f : R →+* T } (h : ∀ ⦃x y⦄, r x y → f x = f y) :
  RingQuot r →+* T :=
  { toFun := fun x ↦ Quot.lift f
        (by
          rintro _ _ r
          induction r with
          | of r => exact h r
          | add_left _ r' => 

Proof state:
case add_left
R : Type uR
inst✝⁴ : Semiring R
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝ : R → R → Prop
inst✝ : Semiring T
r : R → R → Prop
f : R →+* T
h : ∀ ⦃x y : R⦄, r x y → f x = f y
x : RingQuot r
a✝² b✝¹ a✝¹ b✝ c✝ : R
a✝ : Rel r a✝¹ b✝
r' : f a✝¹ = f b✝
⊢ f (a✝¹ + c✝) = f (b✝ + c✝)

Next tactic:
rw [map_add, map_add, r']
irreducible_def preLift {r : R → R → Prop} { f : R →+* T } (h : ∀ ⦃x y⦄, r x y → f x = f y) :
  RingQuot r →+* T :=
  { toFun := fun x ↦ Quot.lift f
        (by
          rintro _ _ r
          induction r with
          | of r => exact h r
          | add_left _ r' => rw [map_add, map_add, r']
          

Proof state:
case mul_left
R : Type uR
inst✝⁴ : Semiring R
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝ : R → R → Prop
inst✝ : Semiring T
r : R → R → Prop
f : R →+* T
h : ∀ ⦃x y : R⦄, r x y → f x = f y
x : RingQuot r
a✝² b✝¹ a✝¹ b✝ c✝ : R
a✝ : Rel r a✝¹ b✝
r' : f a✝¹ = f b✝
⊢ f (a✝¹ * c✝) = f (b✝ * c✝)

Next tactic:
| mul_left _ r' => rw [map_mul, map_mul, r']
irreducible_def preLift {r : R → R → Prop} { f : R →+* T } (h : ∀ ⦃x y⦄, r x y → f x = f y) :
  RingQuot r →+* T :=
  { toFun := fun x ↦ Quot.lift f
        (by
          rintro _ _ r
          induction r with
          | of r => exact h r
          | add_left _ r' => rw [map_add, map_add, r']
          | mul_left _ r' => 

Proof state:
case mul_left
R : Type uR
inst✝⁴ : Semiring R
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝ : R → R → Prop
inst✝ : Semiring T
r : R → R → Prop
f : R →+* T
h : ∀ ⦃x y : R⦄, r x y → f x = f y
x : RingQuot r
a✝² b✝¹ a✝¹ b✝ c✝ : R
a✝ : Rel r a✝¹ b✝
r' : f a✝¹ = f b✝
⊢ f (a✝¹ * c✝) = f (b✝ * c✝)

Next tactic:
rw [map_mul, map_mul, r']
irreducible_def preLift {r : R → R → Prop} { f : R →+* T } (h : ∀ ⦃x y⦄, r x y → f x = f y) :
  RingQuot r →+* T :=
  { toFun := fun x ↦ Quot.lift f
        (by
          rintro _ _ r
          induction r with
          | of r => exact h r
          | add_left _ r' => rw [map_add, map_add, r']
          | mul_left _ r' => rw [map_mul, map_mul, r']
          

Proof state:
case mul_right
R : Type uR
inst✝⁴ : Semiring R
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝ : R → R → Prop
inst✝ : Semiring T
r : R → R → Prop
f : R →+* T
h : ∀ ⦃x y : R⦄, r x y → f x = f y
x : RingQuot r
a✝² b✝¹ a✝¹ b✝ c✝ : R
a✝ : Rel r b✝ c✝
r' : f b✝ = f c✝
⊢ f (a✝¹ * b✝) = f (a✝¹ * c✝)

Next tactic:
| mul_right _ r' => rw [map_mul, map_mul, r']
irreducible_def preLift {r : R → R → Prop} { f : R →+* T } (h : ∀ ⦃x y⦄, r x y → f x = f y) :
  RingQuot r →+* T :=
  { toFun := fun x ↦ Quot.lift f
        (by
          rintro _ _ r
          induction r with
          | of r => exact h r
          | add_left _ r' => rw [map_add, map_add, r']
          | mul_left _ r' => rw [map_mul, map_mul, r']
          | mul_right _ r' => 

Proof state:
case mul_right
R : Type uR
inst✝⁴ : Semiring R
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝ : R → R → Prop
inst✝ : Semiring T
r : R → R → Prop
f : R →+* T
h : ∀ ⦃x y : R⦄, r x y → f x = f y
x : RingQuot r
a✝² b✝¹ a✝¹ b✝ c✝ : R
a✝ : Rel r b✝ c✝
r' : f b✝ = f c✝
⊢ f (a✝¹ * b✝) = f (a✝¹ * c✝)

Next tactic:
rw [map_mul, map_mul, r']
irreducible_def preLift {r : R → R → Prop} { f : R →+* T } (h : ∀ ⦃x y⦄, r x y → f x = f y) :
  RingQuot r →+* T :=
  { toFun := fun x ↦ Quot.lift f
        (by
          rintro _ _ r
          induction r with
          | of r => exact h r
          | add_left _ r' => rw [map_add, map_add, r']
          | mul_left _ r' => rw [map_mul, map_mul, r']
          | mul_right _ r' => rw [map_mul, map_mul, r'])
        x.toQuot
    map_zero' := by simp only [← zero_quot, f.map_zero]
    map_add' := by
      rintro ⟨⟨x⟩⟩ ⟨⟨y⟩⟩
      simp only [add_quot, f.map_add x y]
    map_one' := by 

Proof state:
R : Type uR
inst✝⁴ : Semiring R
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝ : R → R → Prop
inst✝ : Semiring T
r : R → R → Prop
f : R →+* T
h : ∀ ⦃x y : R⦄, r x y → f x = f y
⊢ (fun x => Quot.lift ⇑f (_ : ∀ (a b : R), Rel r a b → f a = f b) x.toQuot) 1 = 1

Next tactic:
simp only [← one_quot, f.map_one]
irreducible_def preLift {r : R → R → Prop} { f : R →+* T } (h : ∀ ⦃x y⦄, r x y → f x = f y) :
  RingQuot r →+* T :=
  { toFun := fun x ↦ Quot.lift f
        (by
          rintro _ _ r
          induction r with
          | of r => exact h r
          | add_left _ r' => rw [map_add, map_add, r']
          | mul_left _ r' => rw [map_mul, map_mul, r']
          | mul_right _ r' => rw [map_mul, map_mul, r'])
        x.toQuot
    map_zero' := by simp only [← zero_quot, f.map_zero]
    map_add' := by
      rintro ⟨⟨x⟩⟩ ⟨⟨y⟩⟩
      simp only [add_quot, f.map_add x y]
    map_one' := by simp only [← one_quot, f.map_one]
    map_mul' := by
      

Proof state:
R : Type uR
inst✝⁴ : Semiring R
S : Type uS
inst✝³ : CommSemiring S
T : Type uT
A : Type uA
inst✝² : Semiring A
inst✝¹ : Algebra S A
r✝ : R → R → Prop
inst✝ : Semiring T
r : R → R → Prop
f : R →+* T
h : ∀ ⦃x y : R⦄, r x y → f x = f y
⊢ ∀ (x y : RingQuot r),
    OneHom.toFun
        { toFun := fun x => Quot.lift ⇑f (_ : ∀ (a b : R), Rel r a b → f a = f b) x.toQuot,
          map_one' := (_ : Quot.lift ⇑f (_ : ∀ (a b : R), Rel r a b → f a = f b) 1.toQuot = 1) }
        (x * y) =
      OneHom.toFun
          { toFun := fun x => Quot.lift ⇑f (_ : ∀ (a b : R), Rel r a b → f a = f b) x.toQuot,
            map_one' := (_ : Quot.lift ⇑f (_ : ∀ (a b : R), Rel r a b → f a = f b) 1.toQuot = 1) }
          x *
        OneHom.toFun
          { toFun := fun x => Quot.lift ⇑f (_ : ∀ (a b : R), Rel r a b → f a = f b) x.toQuot,
            map_one' := (_ : Quot.lift ⇑f (_ : ∀ (a b : R), Rel r a b → f a = f b) 1.toQuot = 1) }
          y

Next tactic:
rintro ⟨⟨x⟩⟩ ⟨⟨y⟩⟩