l3lab/ntp-mathlib huggingface dataset:
instance {A : Type*} [Semiring A] [Algebra R A] {S : Submonoid R} :
    Monoid (LocalizedModule S A) :=
  { mul := fun m₁ m₂ =>
      liftOn₂ m₁ m₂ (fun x₁ x₂ => LocalizedModule.mk (x₁.1 * x₂.1) (x₁.2 * x₂.2))
        (by
          rintro ⟨a₁, s₁⟩ ⟨a₂, s₂⟩ ⟨b₁, t₁⟩ ⟨b₂, t₂⟩ ⟨u₁, e₁⟩ ⟨u₂, e₂⟩
          rw [mk_eq]
          use u₁ * u₂
          dsimp only at e₁ e₂ ⊢
          rw [eq_comm]
          trans (u₁ • t₁ • a₁) • u₂ • t₂ • a₂
          rw [e₁, e₂]; swap; rw [eq_comm]
          all_goals
            rw [smul_smul, mul_mul_mul_comm, ← smul_eq_mul, ← smul_eq_mul A, smul_smul_smul_comm,
              mul_smul, mul_smul])
    one := mk 1 (1 : S)
    one_mul := by
      rintro ⟨a, s⟩
      exact mk_eq.mpr ⟨1, by simp only [one_mul, one_smul]⟩
    mul_one := by
      rintro ⟨a, s⟩
      exact mk_eq.mpr ⟨1, by simp only [mul_one, one_smul]⟩
    mul_assoc := by
      rintro ⟨a₁, s₁⟩ ⟨a₂, s₂⟩ ⟨a₃, s₃⟩
      apply mk_eq.mpr _
      use 1
      

Proof state:
case h
R : Type u
inst✝⁴ : CommSemiring R
S✝ : Submonoid R
M : Type v
inst✝³ : AddCommMonoid M
inst✝² : Module R M
A : Type u_1
inst✝¹ : Semiring A
inst✝ : Algebra R A
S : Submonoid R
a✝ : LocalizedModule S A
a₁ : A
s₁ : ↥S
b✝ : LocalizedModule S A
a₂ : A
s₂ : ↥S
c✝ : LocalizedModule S A
a₃ : A
s₃ : ↥S
⊢ 1 •
      ((a₁, s₁).2 * ((a₂, s₂).1 * (a₃, s₃).1, (a₂, s₂).2 * (a₃, s₃).2).2) •
        (((a₁, s₁).1 * (a₂, s₂).1, (a₁, s₁).2 * (a₂, s₂).2).1 * (a₃, s₃).1) =
    1 •
      (((a₁, s₁).1 * (a₂, s₂).1, (a₁, s₁).2 * (a₂, s₂).2).2 * (a₃, s₃).2) •
        ((a₁, s₁).1 * ((a₂, s₂).1 * (a₃, s₃).1, (a₂, s₂).2 * (a₃, s₃).2).1)

Next tactic:
simp only [one_mul, smul_smul, ← mul_assoc, mul_right_comm]
instance {A : Type*} [Semiring A] [Algebra R A] {S : Submonoid R} :
    Monoid (LocalizedModule S A) :=
  { mul := fun m₁ m₂ =>
      liftOn₂ m₁ m₂ (fun x₁ x₂ => LocalizedModule.mk (x₁.1 * x₂.1) (x₁.2 * x₂.2))
        (by
          rintro ⟨a₁, s₁⟩ ⟨a₂, s₂⟩ ⟨b₁, t₁⟩ ⟨b₂, t₂⟩ ⟨u₁, e₁⟩ ⟨u₂, e₂⟩
          rw [mk_eq]
          use u₁ * u₂
          dsimp only at e₁ e₂ ⊢
          rw [eq_comm]
          trans (u₁ • t₁ • a₁) • u₂ • t₂ • a₂
          rw [e₁, e₂]; swap; rw [eq_comm]
          all_goals
            rw [smul_smul, mul_mul_mul_comm, ← smul_eq_mul, ← smul_eq_mul A, smul_smul_smul_comm,
              mul_smul, mul_smul])
    one := mk 1 (1 : S)
    one_mul := by
      

Proof state:
R : Type u
inst✝⁴ : CommSemiring R
S✝ : Submonoid R
M : Type v
inst✝³ : AddCommMonoid M
inst✝² : Module R M
A : Type u_1
inst✝¹ : Semiring A
inst✝ : Algebra R A
S : Submonoid R
⊢ ∀ (a : LocalizedModule S A), 1 * a = a

Next tactic:
rintro ⟨a, s⟩
instance {A : Type*} [Semiring A] [Algebra R A] {S : Submonoid R} :
    Monoid (LocalizedModule S A) :=
  { mul := fun m₁ m₂ =>
      liftOn₂ m₁ m₂ (fun x₁ x₂ => LocalizedModule.mk (x₁.1 * x₂.1) (x₁.2 * x₂.2))
        (by
          rintro ⟨a₁, s₁⟩ ⟨a₂, s₂⟩ ⟨b₁, t₁⟩ ⟨b₂, t₂⟩ ⟨u₁, e₁⟩ ⟨u₂, e₂⟩
          rw [mk_eq]
          use u₁ * u₂
          dsimp only at e₁ e₂ ⊢
          rw [eq_comm]
          trans (u₁ • t₁ • a₁) • u₂ • t₂ • a₂
          rw [e₁, e₂]; swap; rw [eq_comm]
          all_goals
            rw [smul_smul, mul_mul_mul_comm, ← smul_eq_mul, ← smul_eq_mul A, smul_smul_smul_comm,
              mul_smul, mul_smul])
    one := mk 1 (1 : S)
    one_mul := by
      rintro ⟨a, s⟩
      

Proof state:
case mk.mk
R : Type u
inst✝⁴ : CommSemiring R
S✝ : Submonoid R
M : Type v
inst✝³ : AddCommMonoid M
inst✝² : Module R M
A : Type u_1
inst✝¹ : Semiring A
inst✝ : Algebra R A
S : Submonoid R
a✝ : LocalizedModule S A
a : A
s : ↥S
⊢ 1 * Quot.mk Setoid.r (a, s) = Quot.mk Setoid.r (a, s)

Next tactic:
exact mk_eq.mpr ⟨1, by simp only [one_mul, one_smul]⟩
instance {A : Type*} [Semiring A] [Algebra R A] {S : Submonoid R} :
    Monoid (LocalizedModule S A) :=
  { mul := fun m₁ m₂ =>
      liftOn₂ m₁ m₂ (fun x₁ x₂ => LocalizedModule.mk (x₁.1 * x₂.1) (x₁.2 * x₂.2))
        (by
          rintro ⟨a₁, s₁⟩ ⟨a₂, s₂⟩ ⟨b₁, t₁⟩ ⟨b₂, t₂⟩ ⟨u₁, e₁⟩ ⟨u₂, e₂⟩
          rw [mk_eq]
          use u₁ * u₂
          dsimp only at e₁ e₂ ⊢
          rw [eq_comm]
          trans (u₁ • t₁ • a₁) • u₂ • t₂ • a₂
          rw [e₁, e₂]; swap; rw [eq_comm]
          all_goals
            rw [smul_smul, mul_mul_mul_comm, ← smul_eq_mul, ← smul_eq_mul A, smul_smul_smul_comm,
              mul_smul, mul_smul])
    one := mk 1 (1 : S)
    one_mul := by
      rintro ⟨a, s⟩
      exact mk_eq.mpr ⟨1, by 

Proof state:
R : Type u
inst✝⁴ : CommSemiring R
S✝ : Submonoid R
M : Type v
inst✝³ : AddCommMonoid M
inst✝² : Module R M
A : Type u_1
inst✝¹ : Semiring A
inst✝ : Algebra R A
S : Submonoid R
a✝ : LocalizedModule S A
a : A
s : ↥S
⊢ 1 • s • ((1, 1).1 * (a, s).1) = 1 • ((1, 1).2 * (a, s).2) • a

Next tactic:
simp only [one_mul, one_smul]
instance {A : Type*} [Semiring A] [Algebra R A] {S : Submonoid R} :
    Monoid (LocalizedModule S A) :=
  { mul := fun m₁ m₂ =>
      liftOn₂ m₁ m₂ (fun x₁ x₂ => LocalizedModule.mk (x₁.1 * x₂.1) (x₁.2 * x₂.2))
        (by
          rintro ⟨a₁, s₁⟩ ⟨a₂, s₂⟩ ⟨b₁, t₁⟩ ⟨b₂, t₂⟩ ⟨u₁, e₁⟩ ⟨u₂, e₂⟩
          rw [mk_eq]
          use u₁ * u₂
          dsimp only at e₁ e₂ ⊢
          rw [eq_comm]
          trans (u₁ • t₁ • a₁) • u₂ • t₂ • a₂
          rw [e₁, e₂]; swap; rw [eq_comm]
          all_goals
            rw [smul_smul, mul_mul_mul_comm, ← smul_eq_mul, ← smul_eq_mul A, smul_smul_smul_comm,
              mul_smul, mul_smul])
    one := mk 1 (1 : S)
    one_mul := by
      rintro ⟨a, s⟩
      exact mk_eq.mpr ⟨1, by simp only [one_mul, one_smul]⟩
    mul_one := by
      

Proof state:
R : Type u
inst✝⁴ : CommSemiring R
S✝ : Submonoid R
M : Type v
inst✝³ : AddCommMonoid M
inst✝² : Module R M
A : Type u_1
inst✝¹ : Semiring A
inst✝ : Algebra R A
S : Submonoid R
⊢ ∀ (a : LocalizedModule S A), a * 1 = a

Next tactic:
rintro ⟨a, s⟩
instance {A : Type*} [Semiring A] [Algebra R A] {S : Submonoid R} :
    Monoid (LocalizedModule S A) :=
  { mul := fun m₁ m₂ =>
      liftOn₂ m₁ m₂ (fun x₁ x₂ => LocalizedModule.mk (x₁.1 * x₂.1) (x₁.2 * x₂.2))
        (by
          rintro ⟨a₁, s₁⟩ ⟨a₂, s₂⟩ ⟨b₁, t₁⟩ ⟨b₂, t₂⟩ ⟨u₁, e₁⟩ ⟨u₂, e₂⟩
          rw [mk_eq]
          use u₁ * u₂
          dsimp only at e₁ e₂ ⊢
          rw [eq_comm]
          trans (u₁ • t₁ • a₁) • u₂ • t₂ • a₂
          rw [e₁, e₂]; swap; rw [eq_comm]
          all_goals
            rw [smul_smul, mul_mul_mul_comm, ← smul_eq_mul, ← smul_eq_mul A, smul_smul_smul_comm,
              mul_smul, mul_smul])
    one := mk 1 (1 : S)
    one_mul := by
      rintro ⟨a, s⟩
      exact mk_eq.mpr ⟨1, by simp only [one_mul, one_smul]⟩
    mul_one := by
      rintro ⟨a, s⟩
      

Proof state:
case mk.mk
R : Type u
inst✝⁴ : CommSemiring R
S✝ : Submonoid R
M : Type v
inst✝³ : AddCommMonoid M
inst✝² : Module R M
A : Type u_1
inst✝¹ : Semiring A
inst✝ : Algebra R A
S : Submonoid R
a✝ : LocalizedModule S A
a : A
s : ↥S
⊢ Quot.mk Setoid.r (a, s) * 1 = Quot.mk Setoid.r (a, s)

Next tactic:
exact mk_eq.mpr ⟨1, by simp only [mul_one, one_smul]⟩
instance {A : Type*} [Semiring A] [Algebra R A] {S : Submonoid R} :
    Monoid (LocalizedModule S A) :=
  { mul := fun m₁ m₂ =>
      liftOn₂ m₁ m₂ (fun x₁ x₂ => LocalizedModule.mk (x₁.1 * x₂.1) (x₁.2 * x₂.2))
        (by
          rintro ⟨a₁, s₁⟩ ⟨a₂, s₂⟩ ⟨b₁, t₁⟩ ⟨b₂, t₂⟩ ⟨u₁, e₁⟩ ⟨u₂, e₂⟩
          rw [mk_eq]
          use u₁ * u₂
          dsimp only at e₁ e₂ ⊢
          rw [eq_comm]
          trans (u₁ • t₁ • a₁) • u₂ • t₂ • a₂
          rw [e₁, e₂]; swap; rw [eq_comm]
          all_goals
            rw [smul_smul, mul_mul_mul_comm, ← smul_eq_mul, ← smul_eq_mul A, smul_smul_smul_comm,
              mul_smul, mul_smul])
    one := mk 1 (1 : S)
    one_mul := by
      rintro ⟨a, s⟩
      exact mk_eq.mpr ⟨1, by simp only [one_mul, one_smul]⟩
    mul_one := by
      rintro ⟨a, s⟩
      exact mk_eq.mpr ⟨1, by 

Proof state:
R : Type u
inst✝⁴ : CommSemiring R
S✝ : Submonoid R
M : Type v
inst✝³ : AddCommMonoid M
inst✝² : Module R M
A : Type u_1
inst✝¹ : Semiring A
inst✝ : Algebra R A
S : Submonoid R
a✝ : LocalizedModule S A
a : A
s : ↥S
⊢ 1 • s • ((a, s).1 * (1, 1).1) = 1 • ((a, s).2 * (1, 1).2) • a

Next tactic:
simp only [mul_one, one_smul]
instance {A : Type*} [Semiring A] [Algebra R A] {S : Submonoid R} :
    Semiring (LocalizedModule S A) :=
  { show (AddCommMonoid (LocalizedModule S A)) by 

Proof state:
R : Type u
inst✝⁴ : CommSemiring R
S✝ : Submonoid R
M : Type v
inst✝³ : AddCommMonoid M
inst✝² : Module R M
A : Type u_1
inst✝¹ : Semiring A
inst✝ : Algebra R A
S : Submonoid R
⊢ AddCommMonoid (LocalizedModule S A)

Next tactic:
infer_instance
instance {A : Type*} [Semiring A] [Algebra R A] {S : Submonoid R} :
    Semiring (LocalizedModule S A) :=
  { show (AddCommMonoid (LocalizedModule S A)) by infer_instance,
    show (Monoid (LocalizedModule S A)) by 

Proof state:
R : Type u
inst✝⁴ : CommSemiring R
S✝ : Submonoid R
M : Type v
inst✝³ : AddCommMonoid M
inst✝² : Module R M
A : Type u_1
inst✝¹ : Semiring A
inst✝ : Algebra R A
S : Submonoid R
src✝ : AddCommMonoid (LocalizedModule S A) :=
  let_fun this := inferInstance;
  this
⊢ Monoid (LocalizedModule S A)

Next tactic:
infer_instance
instance {A : Type*} [Semiring A] [Algebra R A] {S : Submonoid R} :
    Semiring (LocalizedModule S A) :=
  { show (AddCommMonoid (LocalizedModule S A)) by infer_instance,
    show (Monoid (LocalizedModule S A)) by infer_instance with
    left_distrib := by
      

Proof state:
R : Type u
inst✝⁴ : CommSemiring R
S✝ : Submonoid R
M : Type v
inst✝³ : AddCommMonoid M
inst✝² : Module R M
A : Type u_1
inst✝¹ : Semiring A
inst✝ : Algebra R A
S : Submonoid R
src✝¹ : AddCommMonoid (LocalizedModule S A) :=
  let_fun this := inferInstance;
  this
src✝ : Monoid (LocalizedModule S A) :=
  let_fun this := inferInstance;
  this
⊢ ∀ (a b c : LocalizedModule S A), a * (b + c) = a * b + a * c

Next tactic:
rintro ⟨a₁, s₁⟩ ⟨a₂, s₂⟩ ⟨a₃, s₃⟩
instance {A : Type*} [Semiring A] [Algebra R A] {S : Submonoid R} :
    Semiring (LocalizedModule S A) :=
  { show (AddCommMonoid (LocalizedModule S A)) by infer_instance,
    show (Monoid (LocalizedModule S A)) by infer_instance with
    left_distrib := by
      rintro ⟨a₁, s₁⟩ ⟨a₂, s₂⟩ ⟨a₃, s₃⟩
      

Proof state:
case mk.mk.mk.mk.mk.mk
R : Type u
inst✝⁴ : CommSemiring R
S✝ : Submonoid R
M : Type v
inst✝³ : AddCommMonoid M
inst✝² : Module R M
A : Type u_1
inst✝¹ : Semiring A
inst✝ : Algebra R A
S : Submonoid R
src✝¹ : AddCommMonoid (LocalizedModule S A) :=
  let_fun this := inferInstance;
  this
src✝ : Monoid (LocalizedModule S A) :=
  let_fun this := inferInstance;
  this
a✝ : LocalizedModule S A
a₁ : A
s₁ : ↥S
b✝ : LocalizedModule S A
a₂ : A
s₂ : ↥S
c✝ : LocalizedModule S A
a₃ : A
s₃ : ↥S
⊢ Quot.mk Setoid.r (a₁, s₁) * (Quot.mk Setoid.r (a₂, s₂) + Quot.mk Setoid.r (a₃, s₃)) =
    Quot.mk Setoid.r (a₁, s₁) * Quot.mk Setoid.r (a₂, s₂) + Quot.mk Setoid.r (a₁, s₁) * Quot.mk Setoid.r (a₃, s₃)

Next tactic:
apply mk_eq.mpr _
instance {A : Type*} [Semiring A] [Algebra R A] {S : Submonoid R} :
    Semiring (LocalizedModule S A) :=
  { show (AddCommMonoid (LocalizedModule S A)) by infer_instance,
    show (Monoid (LocalizedModule S A)) by infer_instance with
    left_distrib := by
      rintro ⟨a₁, s₁⟩ ⟨a₂, s₂⟩ ⟨a₃, s₃⟩
      apply mk_eq.mpr _
      

Proof state:
R : Type u
inst✝⁴ : CommSemiring R
S✝ : Submonoid R
M : Type v
inst✝³ : AddCommMonoid M
inst✝² : Module R M
A : Type u_1
inst✝¹ : Semiring A
inst✝ : Algebra R A
S : Submonoid R
src✝¹ : AddCommMonoid (LocalizedModule S A) :=
  let_fun this := inferInstance;
  this
src✝ : Monoid (LocalizedModule S A) :=
  let_fun this := inferInstance;
  this
a✝ : LocalizedModule S A
a₁ : A
s₁ : ↥S
b✝ : LocalizedModule S A
a₂ : A
s₂ : ↥S
c✝ : LocalizedModule S A
a₃ : A
s₃ : ↥S
⊢ ∃ u,
    u •
        (((a₁, s₁).1 * (a₂, s₂).1, (a₁, s₁).2 * (a₂, s₂).2).2 * ((a₁, s₁).1 * (a₃, s₃).1, (a₁, s₁).2 * (a₃, s₃).2).2) •
          ((a₁, s₁).1 * ((a₃, s₃).2 • (a₂, s₂).1 + (a₂, s₂).2 • (a₃, s₃).1, (a₂, s₂).2 * (a₃, s₃).2).1) =
      u •
        ((a₁, s₁).2 * ((a₃, s₃).2 • (a₂, s₂).1 + (a₂, s₂).2 • (a₃, s₃).1, (a₂, s₂).2 * (a₃, s₃).2).2) •
          (((a₁, s₁).1 * (a₃, s₃).1, (a₁, s₁).2 * (a₃, s₃).2).2 • ((a₁, s₁).1 * (a₂, s₂).1, (a₁, s₁).2 * (a₂, s₂).2).1 +
            ((a₁, s₁).1 * (a₂, s₂).1, (a₁, s₁).2 * (a₂, s₂).2).2 • ((a₁, s₁).1 * (a₃, s₃).1, (a₁, s₁).2 * (a₃, s₃).2).1)

Next tactic:
use 1
instance {A : Type*} [Semiring A] [Algebra R A] {S : Submonoid R} :
    Semiring (LocalizedModule S A) :=
  { show (AddCommMonoid (LocalizedModule S A)) by infer_instance,
    show (Monoid (LocalizedModule S A)) by infer_instance with
    left_distrib := by
      rintro ⟨a₁, s₁⟩ ⟨a₂, s₂⟩ ⟨a₃, s₃⟩
      apply mk_eq.mpr _
      use 1
      

Proof state:
case h
R : Type u
inst✝⁴ : CommSemiring R
S✝ : Submonoid R
M : Type v
inst✝³ : AddCommMonoid M
inst✝² : Module R M
A : Type u_1
inst✝¹ : Semiring A
inst✝ : Algebra R A
S : Submonoid R
src✝¹ : AddCommMonoid (LocalizedModule S A) :=
  let_fun this := inferInstance;
  this
src✝ : Monoid (LocalizedModule S A) :=
  let_fun this := inferInstance;
  this
a✝ : LocalizedModule S A
a₁ : A
s₁ : ↥S
b✝ : LocalizedModule S A
a₂ : A
s₂ : ↥S
c✝ : LocalizedModule S A
a₃ : A
s₃ : ↥S
⊢ 1 •
      (((a₁, s₁).1 * (a₂, s₂).1, (a₁, s₁).2 * (a₂, s₂).2).2 * ((a₁, s₁).1 * (a₃, s₃).1, (a₁, s₁).2 * (a₃, s₃).2).2) •
        ((a₁, s₁).1 * ((a₃, s₃).2 • (a₂, s₂).1 + (a₂, s₂).2 • (a₃, s₃).1, (a₂, s₂).2 * (a₃, s₃).2).1) =
    1 •
      ((a₁, s₁).2 * ((a₃, s₃).2 • (a₂, s₂).1 + (a₂, s₂).2 • (a₃, s₃).1, (a₂, s₂).2 * (a₃, s₃).2).2) •
        (((a₁, s₁).1 * (a₃, s₃).1, (a₁, s₁).2 * (a₃, s₃).2).2 • ((a₁, s₁).1 * (a₂, s₂).1, (a₁, s₁).2 * (a₂, s₂).2).1 +
          ((a₁, s₁).1 * (a₂, s₂).1, (a₁, s₁).2 * (a₂, s₂).2).2 • ((a₁, s₁).1 * (a₃, s₃).1, (a₁, s₁).2 * (a₃, s₃).2).1)

Next tactic:
simp only [one_mul, smul_add, mul_add, mul_smul_comm, smul_smul, ← mul_assoc,
        mul_right_comm]
instance {A : Type*} [Semiring A] [Algebra R A] {S : Submonoid R} :
    Semiring (LocalizedModule S A) :=
  { show (AddCommMonoid (LocalizedModule S A)) by infer_instance,
    show (Monoid (LocalizedModule S A)) by infer_instance with
    left_distrib := by
      rintro ⟨a₁, s₁⟩ ⟨a₂, s₂⟩ ⟨a₃, s₃⟩
      apply mk_eq.mpr _
      use 1
      simp only [one_mul, smul_add, mul_add, mul_smul_comm, smul_smul, ← mul_assoc,
        mul_right_comm]
    right_distrib := by
      

Proof state:
R : Type u
inst✝⁴ : CommSemiring R
S✝ : Submonoid R
M : Type v
inst✝³ : AddCommMonoid M
inst✝² : Module R M
A : Type u_1
inst✝¹ : Semiring A
inst✝ : Algebra R A
S : Submonoid R
src✝¹ : AddCommMonoid (LocalizedModule S A) :=
  let_fun this := inferInstance;
  this
src✝ : Monoid (LocalizedModule S A) :=
  let_fun this := inferInstance;
  this
⊢ ∀ (a b c : LocalizedModule S A), (a + b) * c = a * c + b * c

Next tactic:
rintro ⟨a₁, s₁⟩ ⟨a₂, s₂⟩ ⟨a₃, s₃⟩
instance {A : Type*} [Semiring A] [Algebra R A] {S : Submonoid R} :
    Semiring (LocalizedModule S A) :=
  { show (AddCommMonoid (LocalizedModule S A)) by infer_instance,
    show (Monoid (LocalizedModule S A)) by infer_instance with
    left_distrib := by
      rintro ⟨a₁, s₁⟩ ⟨a₂, s₂⟩ ⟨a₃, s₃⟩
      apply mk_eq.mpr _
      use 1
      simp only [one_mul, smul_add, mul_add, mul_smul_comm, smul_smul, ← mul_assoc,
        mul_right_comm]
    right_distrib := by
      rintro ⟨a₁, s₁⟩ ⟨a₂, s₂⟩ ⟨a₃, s₃⟩
      

Proof state:
case mk.mk.mk.mk.mk.mk
R : Type u
inst✝⁴ : CommSemiring R
S✝ : Submonoid R
M : Type v
inst✝³ : AddCommMonoid M
inst✝² : Module R M
A : Type u_1
inst✝¹ : Semiring A
inst✝ : Algebra R A
S : Submonoid R
src✝¹ : AddCommMonoid (LocalizedModule S A) :=
  let_fun this := inferInstance;
  this
src✝ : Monoid (LocalizedModule S A) :=
  let_fun this := inferInstance;
  this
a✝ : LocalizedModule S A
a₁ : A
s₁ : ↥S
b✝ : LocalizedModule S A
a₂ : A
s₂ : ↥S
c✝ : LocalizedModule S A
a₃ : A
s₃ : ↥S
⊢ (Quot.mk Setoid.r (a₁, s₁) + Quot.mk Setoid.r (a₂, s₂)) * Quot.mk Setoid.r (a₃, s₃) =
    Quot.mk Setoid.r (a₁, s₁) * Quot.mk Setoid.r (a₃, s₃) + Quot.mk Setoid.r (a₂, s₂) * Quot.mk Setoid.r (a₃, s₃)

Next tactic:
apply mk_eq.mpr _
instance {A : Type*} [Semiring A] [Algebra R A] {S : Submonoid R} :
    Semiring (LocalizedModule S A) :=
  { show (AddCommMonoid (LocalizedModule S A)) by infer_instance,
    show (Monoid (LocalizedModule S A)) by infer_instance with
    left_distrib := by
      rintro ⟨a₁, s₁⟩ ⟨a₂, s₂⟩ ⟨a₃, s₃⟩
      apply mk_eq.mpr _
      use 1
      simp only [one_mul, smul_add, mul_add, mul_smul_comm, smul_smul, ← mul_assoc,
        mul_right_comm]
    right_distrib := by
      rintro ⟨a₁, s₁⟩ ⟨a₂, s₂⟩ ⟨a₃, s₃⟩
      apply mk_eq.mpr _
      

Proof state:
R : Type u
inst✝⁴ : CommSemiring R
S✝ : Submonoid R
M : Type v
inst✝³ : AddCommMonoid M
inst✝² : Module R M
A : Type u_1
inst✝¹ : Semiring A
inst✝ : Algebra R A
S : Submonoid R
src✝¹ : AddCommMonoid (LocalizedModule S A) :=
  let_fun this := inferInstance;
  this
src✝ : Monoid (LocalizedModule S A) :=
  let_fun this := inferInstance;
  this
a✝ : LocalizedModule S A
a₁ : A
s₁ : ↥S
b✝ : LocalizedModule S A
a₂ : A
s₂ : ↥S
c✝ : LocalizedModule S A
a₃ : A
s₃ : ↥S
⊢ ∃ u,
    u •
        (((a₁, s₁).1 * (a₃, s₃).1, (a₁, s₁).2 * (a₃, s₃).2).2 * ((a₂, s₂).1 * (a₃, s₃).1, (a₂, s₂).2 * (a₃, s₃).2).2) •
          (((a₂, s₂).2 • (a₁, s₁).1 + (a₁, s₁).2 • (a₂, s₂).1, (a₁, s₁).2 * (a₂, s₂).2).1 * (a₃, s₃).1) =
      u •
        (((a₂, s₂).2 • (a₁, s₁).1 + (a₁, s₁).2 • (a₂, s₂).1, (a₁, s₁).2 * (a₂, s₂).2).2 * (a₃, s₃).2) •
          (((a₂, s₂).1 * (a₃, s₃).1, (a₂, s₂).2 * (a₃, s₃).2).2 • ((a₁, s₁).1 * (a₃, s₃).1, (a₁, s₁).2 * (a₃, s₃).2).1 +
            ((a₁, s₁).1 * (a₃, s₃).1, (a₁, s₁).2 * (a₃, s₃).2).2 • ((a₂, s₂).1 * (a₃, s₃).1, (a₂, s₂).2 * (a₃, s₃).2).1)

Next tactic:
use 1
instance {A : Type*} [Semiring A] [Algebra R A] {S : Submonoid R} :
    Semiring (LocalizedModule S A) :=
  { show (AddCommMonoid (LocalizedModule S A)) by infer_instance,
    show (Monoid (LocalizedModule S A)) by infer_instance with
    left_distrib := by
      rintro ⟨a₁, s₁⟩ ⟨a₂, s₂⟩ ⟨a₃, s₃⟩
      apply mk_eq.mpr _
      use 1
      simp only [one_mul, smul_add, mul_add, mul_smul_comm, smul_smul, ← mul_assoc,
        mul_right_comm]
    right_distrib := by
      rintro ⟨a₁, s₁⟩ ⟨a₂, s₂⟩ ⟨a₃, s₃⟩
      apply mk_eq.mpr _
      use 1
      

Proof state:
case h
R : Type u
inst✝⁴ : CommSemiring R
S✝ : Submonoid R
M : Type v
inst✝³ : AddCommMonoid M
inst✝² : Module R M
A : Type u_1
inst✝¹ : Semiring A
inst✝ : Algebra R A
S : Submonoid R
src✝¹ : AddCommMonoid (LocalizedModule S A) :=
  let_fun this := inferInstance;
  this
src✝ : Monoid (LocalizedModule S A) :=
  let_fun this := inferInstance;
  this
a✝ : LocalizedModule S A
a₁ : A
s₁ : ↥S
b✝ : LocalizedModule S A
a₂ : A
s₂ : ↥S
c✝ : LocalizedModule S A
a₃ : A
s₃ : ↥S
⊢ 1 •
      (((a₁, s₁).1 * (a₃, s₃).1, (a₁, s₁).2 * (a₃, s₃).2).2 * ((a₂, s₂).1 * (a₃, s₃).1, (a₂, s₂).2 * (a₃, s₃).2).2) •
        (((a₂, s₂).2 • (a₁, s₁).1 + (a₁, s₁).2 • (a₂, s₂).1, (a₁, s₁).2 * (a₂, s₂).2).1 * (a₃, s₃).1) =
    1 •
      (((a₂, s₂).2 • (a₁, s₁).1 + (a₁, s₁).2 • (a₂, s₂).1, (a₁, s₁).2 * (a₂, s₂).2).2 * (a₃, s₃).2) •
        (((a₂, s₂).1 * (a₃, s₃).1, (a₂, s₂).2 * (a₃, s₃).2).2 • ((a₁, s₁).1 * (a₃, s₃).1, (a₁, s₁).2 * (a₃, s₃).2).1 +
          ((a₁, s₁).1 * (a₃, s₃).1, (a₁, s₁).2 * (a₃, s₃).2).2 • ((a₂, s₂).1 * (a₃, s₃).1, (a₂, s₂).2 * (a₃, s₃).2).1)

Next tactic:
simp only [one_mul, smul_add, add_mul, smul_smul, ← mul_assoc, smul_mul_assoc,
        mul_right_comm]
instance {A : Type*} [Semiring A] [Algebra R A] {S : Submonoid R} :
    Semiring (LocalizedModule S A) :=
  { show (AddCommMonoid (LocalizedModule S A)) by infer_instance,
    show (Monoid (LocalizedModule S A)) by infer_instance with
    left_distrib := by
      rintro ⟨a₁, s₁⟩ ⟨a₂, s₂⟩ ⟨a₃, s₃⟩
      apply mk_eq.mpr _
      use 1
      simp only [one_mul, smul_add, mul_add, mul_smul_comm, smul_smul, ← mul_assoc,
        mul_right_comm]
    right_distrib := by
      rintro ⟨a₁, s₁⟩ ⟨a₂, s₂⟩ ⟨a₃, s₃⟩
      apply mk_eq.mpr _
      use 1
      simp only [one_mul, smul_add, add_mul, smul_smul, ← mul_assoc, smul_mul_assoc,
        mul_right_comm]
    zero_mul := by
      

Proof state:
R : Type u
inst✝⁴ : CommSemiring R
S✝ : Submonoid R
M : Type v
inst✝³ : AddCommMonoid M
inst✝² : Module R M
A : Type u_1
inst✝¹ : Semiring A
inst✝ : Algebra R A
S : Submonoid R
src✝¹ : AddCommMonoid (LocalizedModule S A) :=
  let_fun this := inferInstance;
  this
src✝ : Monoid (LocalizedModule S A) :=
  let_fun this := inferInstance;
  this
⊢ ∀ (a : LocalizedModule S A), 0 * a = 0

Next tactic:
rintro ⟨a, s⟩
instance {A : Type*} [Semiring A] [Algebra R A] {S : Submonoid R} :
    Semiring (LocalizedModule S A) :=
  { show (AddCommMonoid (LocalizedModule S A)) by infer_instance,
    show (Monoid (LocalizedModule S A)) by infer_instance with
    left_distrib := by
      rintro ⟨a₁, s₁⟩ ⟨a₂, s₂⟩ ⟨a₃, s₃⟩
      apply mk_eq.mpr _
      use 1
      simp only [one_mul, smul_add, mul_add, mul_smul_comm, smul_smul, ← mul_assoc,
        mul_right_comm]
    right_distrib := by
      rintro ⟨a₁, s₁⟩ ⟨a₂, s₂⟩ ⟨a₃, s₃⟩
      apply mk_eq.mpr _
      use 1
      simp only [one_mul, smul_add, add_mul, smul_smul, ← mul_assoc, smul_mul_assoc,
        mul_right_comm]
    zero_mul := by
      rintro ⟨a, s⟩
      

Proof state:
case mk.mk
R : Type u
inst✝⁴ : CommSemiring R
S✝ : Submonoid R
M : Type v
inst✝³ : AddCommMonoid M
inst✝² : Module R M
A : Type u_1
inst✝¹ : Semiring A
inst✝ : Algebra R A
S : Submonoid R
src✝¹ : AddCommMonoid (LocalizedModule S A) :=
  let_fun this := inferInstance;
  this
src✝ : Monoid (LocalizedModule S A) :=
  let_fun this := inferInstance;
  this
a✝ : LocalizedModule S A
a : A
s : ↥S
⊢ 0 * Quot.mk Setoid.r (a, s) = 0

Next tactic:
exact mk_eq.mpr ⟨1, by simp only [zero_mul, smul_zero]⟩
instance {A : Type*} [Semiring A] [Algebra R A] {S : Submonoid R} :
    Semiring (LocalizedModule S A) :=
  { show (AddCommMonoid (LocalizedModule S A)) by infer_instance,
    show (Monoid (LocalizedModule S A)) by infer_instance with
    left_distrib := by
      rintro ⟨a₁, s₁⟩ ⟨a₂, s₂⟩ ⟨a₃, s₃⟩
      apply mk_eq.mpr _
      use 1
      simp only [one_mul, smul_add, mul_add, mul_smul_comm, smul_smul, ← mul_assoc,
        mul_right_comm]
    right_distrib := by
      rintro ⟨a₁, s₁⟩ ⟨a₂, s₂⟩ ⟨a₃, s₃⟩
      apply mk_eq.mpr _
      use 1
      simp only [one_mul, smul_add, add_mul, smul_smul, ← mul_assoc, smul_mul_assoc,
        mul_right_comm]
    zero_mul := by
      rintro ⟨a, s⟩
      exact mk_eq.mpr ⟨1, by 

Proof state:
R : Type u
inst✝⁴ : CommSemiring R
S✝ : Submonoid R
M : Type v
inst✝³ : AddCommMonoid M
inst✝² : Module R M
A : Type u_1
inst✝¹ : Semiring A
inst✝ : Algebra R A
S : Submonoid R
src✝¹ : AddCommMonoid (LocalizedModule S A) :=
  let_fun this := inferInstance;
  this
src✝ : Monoid (LocalizedModule S A) :=
  let_fun this := inferInstance;
  this
a✝ : LocalizedModule S A
a : A
s : ↥S
⊢ 1 • 1 • ((0, 1).1 * (a, s).1) = 1 • ((0, 1).2 * (a, s).2) • 0

Next tactic:
simp only [zero_mul, smul_zero]
instance {A : Type*} [Semiring A] [Algebra R A] {S : Submonoid R} :
    Semiring (LocalizedModule S A) :=
  { show (AddCommMonoid (LocalizedModule S A)) by infer_instance,
    show (Monoid (LocalizedModule S A)) by infer_instance with
    left_distrib := by
      rintro ⟨a₁, s₁⟩ ⟨a₂, s₂⟩ ⟨a₃, s₃⟩
      apply mk_eq.mpr _
      use 1
      simp only [one_mul, smul_add, mul_add, mul_smul_comm, smul_smul, ← mul_assoc,
        mul_right_comm]
    right_distrib := by
      rintro ⟨a₁, s₁⟩ ⟨a₂, s₂⟩ ⟨a₃, s₃⟩
      apply mk_eq.mpr _
      use 1
      simp only [one_mul, smul_add, add_mul, smul_smul, ← mul_assoc, smul_mul_assoc,
        mul_right_comm]
    zero_mul := by
      rintro ⟨a, s⟩
      exact mk_eq.mpr ⟨1, by simp only [zero_mul, smul_zero]⟩
    mul_zero := by
      

Proof state:
R : Type u
inst✝⁴ : CommSemiring R
S✝ : Submonoid R
M : Type v
inst✝³ : AddCommMonoid M
inst✝² : Module R M
A : Type u_1
inst✝¹ : Semiring A
inst✝ : Algebra R A
S : Submonoid R
src✝¹ : AddCommMonoid (LocalizedModule S A) :=
  let_fun this := inferInstance;
  this
src✝ : Monoid (LocalizedModule S A) :=
  let_fun this := inferInstance;
  this
⊢ ∀ (a : LocalizedModule S A), a * 0 = 0

Next tactic:
rintro ⟨a, s⟩