l3lab/ntp-mathlib huggingface dataset:
/-- The morphism `numeratorHom` is a monoid localization map in the case of commutative `R`. -/
protected def localizationMap : S.LocalizationMap R[S⁻¹]
    where
  toFun := numeratorHom
  map_one' := rfl
  map_mul' r₁ r₂ := by 

Proof state:
R : Type u_1
inst✝¹ : CommMonoid R
S : Submonoid R
inst✝ : OreSet S
r₁ r₂ : R
⊢ OneHom.toFun { toFun := ⇑numeratorHom, map_one' := (_ : numeratorHom 1 = numeratorHom 1) } (r₁ * r₂) =
    OneHom.toFun { toFun := ⇑numeratorHom, map_one' := (_ : numeratorHom 1 = numeratorHom 1) } r₁ *
      OneHom.toFun { toFun := ⇑numeratorHom, map_one' := (_ : numeratorHom 1 = numeratorHom 1) } r₂

Next tactic:
simp
/-- The morphism `numeratorHom` is a monoid localization map in the case of commutative `R`. -/
protected def localizationMap : S.LocalizationMap R[S⁻¹]
    where
  toFun := numeratorHom
  map_one' := rfl
  map_mul' r₁ r₂ := by simp
  map_units' := numerator_isUnit
  surj' z := by
    

Proof state:
R : Type u_1
inst✝¹ : CommMonoid R
S : Submonoid R
inst✝ : OreSet S
z : OreLocalization R S
⊢ ∃ x,
    z *
        OneHom.toFun
          ↑{ toOneHom := { toFun := ⇑numeratorHom, map_one' := (_ : numeratorHom 1 = numeratorHom 1) },
              map_mul' := (_ : ∀ (r₁ r₂ : R), numeratorHom (r₁ * r₂) = numeratorHom r₁ * numeratorHom r₂) }
          ↑x.2 =
      OneHom.toFun
        (↑{ toOneHom := { toFun := ⇑numeratorHom, map_one' := (_ : numeratorHom 1 = numeratorHom 1) },
            map_mul' := (_ : ∀ (r₁ r₂ : R), numeratorHom (r₁ * r₂) = numeratorHom r₁ * numeratorHom r₂) })
        x.1

Next tactic:
induction' z using OreLocalization.ind with r s
/-- The morphism `numeratorHom` is a monoid localization map in the case of commutative `R`. -/
protected def localizationMap : S.LocalizationMap R[S⁻¹]
    where
  toFun := numeratorHom
  map_one' := rfl
  map_mul' r₁ r₂ := by simp
  map_units' := numerator_isUnit
  surj' z := by
    induction' z using OreLocalization.ind with r s
    

Proof state:
case c
R : Type u_1
inst✝¹ : CommMonoid R
S : Submonoid R
inst✝ : OreSet S
r : R
s : ↥S
⊢ ∃ x,
    r /ₒ s *
        OneHom.toFun
          ↑{ toOneHom := { toFun := ⇑numeratorHom, map_one' := (_ : numeratorHom 1 = numeratorHom 1) },
              map_mul' := (_ : ∀ (r₁ r₂ : R), numeratorHom (r₁ * r₂) = numeratorHom r₁ * numeratorHom r₂) }
          ↑x.2 =
      OneHom.toFun
        (↑{ toOneHom := { toFun := ⇑numeratorHom, map_one' := (_ : numeratorHom 1 = numeratorHom 1) },
            map_mul' := (_ : ∀ (r₁ r₂ : R), numeratorHom (r₁ * r₂) = numeratorHom r₁ * numeratorHom r₂) })
        x.1

Next tactic:
use (r, s)
/-- The morphism `numeratorHom` is a monoid localization map in the case of commutative `R`. -/
protected def localizationMap : S.LocalizationMap R[S⁻¹]
    where
  toFun := numeratorHom
  map_one' := rfl
  map_mul' r₁ r₂ := by simp
  map_units' := numerator_isUnit
  surj' z := by
    induction' z using OreLocalization.ind with r s
    use (r, s); 

Proof state:
case h
R : Type u_1
inst✝¹ : CommMonoid R
S : Submonoid R
inst✝ : OreSet S
r : R
s : ↥S
⊢ r /ₒ s *
      OneHom.toFun
        ↑{ toOneHom := { toFun := ⇑numeratorHom, map_one' := (_ : numeratorHom 1 = numeratorHom 1) },
            map_mul' := (_ : ∀ (r₁ r₂ : R), numeratorHom (r₁ * r₂) = numeratorHom r₁ * numeratorHom r₂) }
        ↑(r, s).2 =
    OneHom.toFun
      ↑{ toOneHom := { toFun := ⇑numeratorHom, map_one' := (_ : numeratorHom 1 = numeratorHom 1) },
          map_mul' := (_ : ∀ (r₁ r₂ : R), numeratorHom (r₁ * r₂) = numeratorHom r₁ * numeratorHom r₂) }
      (r, s).1

Next tactic:
dsimp
/-- The morphism `numeratorHom` is a monoid localization map in the case of commutative `R`. -/
protected def localizationMap : S.LocalizationMap R[S⁻¹]
    where
  toFun := numeratorHom
  map_one' := rfl
  map_mul' r₁ r₂ := by simp
  map_units' := numerator_isUnit
  surj' z := by
    induction' z using OreLocalization.ind with r s
    use (r, s); dsimp
    

Proof state:
case h
R : Type u_1
inst✝¹ : CommMonoid R
S : Submonoid R
inst✝ : OreSet S
r : R
s : ↥S
⊢ r /ₒ s * numeratorHom ↑s = numeratorHom r

Next tactic:
rw [numeratorHom_apply, numeratorHom_apply]
/-- The morphism `numeratorHom` is a monoid localization map in the case of commutative `R`. -/
protected def localizationMap : S.LocalizationMap R[S⁻¹]
    where
  toFun := numeratorHom
  map_one' := rfl
  map_mul' r₁ r₂ := by simp
  map_units' := numerator_isUnit
  surj' z := by
    induction' z using OreLocalization.ind with r s
    use (r, s); dsimp
    rw [numeratorHom_apply, numeratorHom_apply]; 

Proof state:
case h
R : Type u_1
inst✝¹ : CommMonoid R
S : Submonoid R
inst✝ : OreSet S
r : R
s : ↥S
⊢ r /ₒ s * (↑s /ₒ 1) = r /ₒ 1

Next tactic:
simp
/-- The morphism `numeratorHom` is a monoid localization map in the case of commutative `R`. -/
protected def localizationMap : S.LocalizationMap R[S⁻¹]
    where
  toFun := numeratorHom
  map_one' := rfl
  map_mul' r₁ r₂ := by simp
  map_units' := numerator_isUnit
  surj' z := by
    induction' z using OreLocalization.ind with r s
    use (r, s); dsimp
    rw [numeratorHom_apply, numeratorHom_apply]; simp
  exists_of_eq r₁ r₂ := by
    

Proof state:
R : Type u_1
inst✝¹ : CommMonoid R
S : Submonoid R
inst✝ : OreSet S
r₁ r₂ : R
⊢ OneHom.toFun
        (↑{ toOneHom := { toFun := ⇑numeratorHom, map_one' := (_ : numeratorHom 1 = numeratorHom 1) },
            map_mul' := (_ : ∀ (r₁ r₂ : R), numeratorHom (r₁ * r₂) = numeratorHom r₁ * numeratorHom r₂) })
        r₁ =
      OneHom.toFun
        (↑{ toOneHom := { toFun := ⇑numeratorHom, map_one' := (_ : numeratorHom 1 = numeratorHom 1) },
            map_mul' := (_ : ∀ (r₁ r₂ : R), numeratorHom (r₁ * r₂) = numeratorHom r₁ * numeratorHom r₂) })
        r₂ →
    ∃ c, ↑c * r₁ = ↑c * r₂

Next tactic:
dsimp
/-- The morphism `numeratorHom` is a monoid localization map in the case of commutative `R`. -/
protected def localizationMap : S.LocalizationMap R[S⁻¹]
    where
  toFun := numeratorHom
  map_one' := rfl
  map_mul' r₁ r₂ := by simp
  map_units' := numerator_isUnit
  surj' z := by
    induction' z using OreLocalization.ind with r s
    use (r, s); dsimp
    rw [numeratorHom_apply, numeratorHom_apply]; simp
  exists_of_eq r₁ r₂ := by
    dsimp
    

Proof state:
R : Type u_1
inst✝¹ : CommMonoid R
S : Submonoid R
inst✝ : OreSet S
r₁ r₂ : R
⊢ numeratorHom r₁ = numeratorHom r₂ → ∃ c, ↑c * r₁ = ↑c * r₂

Next tactic:
intro h
/-- The morphism `numeratorHom` is a monoid localization map in the case of commutative `R`. -/
protected def localizationMap : S.LocalizationMap R[S⁻¹]
    where
  toFun := numeratorHom
  map_one' := rfl
  map_mul' r₁ r₂ := by simp
  map_units' := numerator_isUnit
  surj' z := by
    induction' z using OreLocalization.ind with r s
    use (r, s); dsimp
    rw [numeratorHom_apply, numeratorHom_apply]; simp
  exists_of_eq r₁ r₂ := by
    dsimp
    intro h
    

Proof state:
R : Type u_1
inst✝¹ : CommMonoid R
S : Submonoid R
inst✝ : OreSet S
r₁ r₂ : R
h : numeratorHom r₁ = numeratorHom r₂
⊢ ∃ c, ↑c * r₁ = ↑c * r₂

Next tactic:
rw [numeratorHom_apply, numeratorHom_apply, oreDiv_eq_iff] at h
/-- The morphism `numeratorHom` is a monoid localization map in the case of commutative `R`. -/
protected def localizationMap : S.LocalizationMap R[S⁻¹]
    where
  toFun := numeratorHom
  map_one' := rfl
  map_mul' r₁ r₂ := by simp
  map_units' := numerator_isUnit
  surj' z := by
    induction' z using OreLocalization.ind with r s
    use (r, s); dsimp
    rw [numeratorHom_apply, numeratorHom_apply]; simp
  exists_of_eq r₁ r₂ := by
    dsimp
    intro h
    rw [numeratorHom_apply, numeratorHom_apply, oreDiv_eq_iff] at h
    

Proof state:
R : Type u_1
inst✝¹ : CommMonoid R
S : Submonoid R
inst✝ : OreSet S
r₁ r₂ : R
h : ∃ u v, r₂ * ↑u = r₁ * v ∧ ↑1 * ↑u = ↑1 * v
⊢ ∃ c, ↑c * r₁ = ↑c * r₂

Next tactic:
rcases h with ⟨u, v, h₁, h₂⟩
/-- The morphism `numeratorHom` is a monoid localization map in the case of commutative `R`. -/
protected def localizationMap : S.LocalizationMap R[S⁻¹]
    where
  toFun := numeratorHom
  map_one' := rfl
  map_mul' r₁ r₂ := by simp
  map_units' := numerator_isUnit
  surj' z := by
    induction' z using OreLocalization.ind with r s
    use (r, s); dsimp
    rw [numeratorHom_apply, numeratorHom_apply]; simp
  exists_of_eq r₁ r₂ := by
    dsimp
    intro h
    rw [numeratorHom_apply, numeratorHom_apply, oreDiv_eq_iff] at h
    rcases h with ⟨u, v, h₁, h₂⟩
    

Proof state:
case intro.intro.intro
R : Type u_1
inst✝¹ : CommMonoid R
S : Submonoid R
inst✝ : OreSet S
r₁ r₂ : R
u : ↥S
v : R
h₁ : r₂ * ↑u = r₁ * v
h₂ : ↑1 * ↑u = ↑1 * v
⊢ ∃ c, ↑c * r₁ = ↑c * r₂

Next tactic:
dsimp at h₂
/-- The morphism `numeratorHom` is a monoid localization map in the case of commutative `R`. -/
protected def localizationMap : S.LocalizationMap R[S⁻¹]
    where
  toFun := numeratorHom
  map_one' := rfl
  map_mul' r₁ r₂ := by simp
  map_units' := numerator_isUnit
  surj' z := by
    induction' z using OreLocalization.ind with r s
    use (r, s); dsimp
    rw [numeratorHom_apply, numeratorHom_apply]; simp
  exists_of_eq r₁ r₂ := by
    dsimp
    intro h
    rw [numeratorHom_apply, numeratorHom_apply, oreDiv_eq_iff] at h
    rcases h with ⟨u, v, h₁, h₂⟩
    dsimp at h₂
    

Proof state:
case intro.intro.intro
R : Type u_1
inst✝¹ : CommMonoid R
S : Submonoid R
inst✝ : OreSet S
r₁ r₂ : R
u : ↥S
v : R
h₁ : r₂ * ↑u = r₁ * v
h₂ : 1 * ↑u = 1 * v
⊢ ∃ c, ↑c * r₁ = ↑c * r₂

Next tactic:
rw [one_mul, one_mul] at h₂
/-- The morphism `numeratorHom` is a monoid localization map in the case of commutative `R`. -/
protected def localizationMap : S.LocalizationMap R[S⁻¹]
    where
  toFun := numeratorHom
  map_one' := rfl
  map_mul' r₁ r₂ := by simp
  map_units' := numerator_isUnit
  surj' z := by
    induction' z using OreLocalization.ind with r s
    use (r, s); dsimp
    rw [numeratorHom_apply, numeratorHom_apply]; simp
  exists_of_eq r₁ r₂ := by
    dsimp
    intro h
    rw [numeratorHom_apply, numeratorHom_apply, oreDiv_eq_iff] at h
    rcases h with ⟨u, v, h₁, h₂⟩
    dsimp at h₂
    rw [one_mul, one_mul] at h₂
    

Proof state:
case intro.intro.intro
R : Type u_1
inst✝¹ : CommMonoid R
S : Submonoid R
inst✝ : OreSet S
r₁ r₂ : R
u : ↥S
v : R
h₁ : r₂ * ↑u = r₁ * v
h₂ : ↑u = v
⊢ ∃ c, ↑c * r₁ = ↑c * r₂

Next tactic:
subst h₂
/-- The morphism `numeratorHom` is a monoid localization map in the case of commutative `R`. -/
protected def localizationMap : S.LocalizationMap R[S⁻¹]
    where
  toFun := numeratorHom
  map_one' := rfl
  map_mul' r₁ r₂ := by simp
  map_units' := numerator_isUnit
  surj' z := by
    induction' z using OreLocalization.ind with r s
    use (r, s); dsimp
    rw [numeratorHom_apply, numeratorHom_apply]; simp
  exists_of_eq r₁ r₂ := by
    dsimp
    intro h
    rw [numeratorHom_apply, numeratorHom_apply, oreDiv_eq_iff] at h
    rcases h with ⟨u, v, h₁, h₂⟩
    dsimp at h₂
    rw [one_mul, one_mul] at h₂
    subst h₂
    

Proof state:
case intro.intro.intro
R : Type u_1
inst✝¹ : CommMonoid R
S : Submonoid R
inst✝ : OreSet S
r₁ r₂ : R
u : ↥S
h₁ : r₂ * ↑u = r₁ * ↑u
⊢ ∃ c, ↑c * r₁ = ↑c * r₂

Next tactic:
use u
/-- The morphism `numeratorHom` is a monoid localization map in the case of commutative `R`. -/
protected def localizationMap : S.LocalizationMap R[S⁻¹]
    where
  toFun := numeratorHom
  map_one' := rfl
  map_mul' r₁ r₂ := by simp
  map_units' := numerator_isUnit
  surj' z := by
    induction' z using OreLocalization.ind with r s
    use (r, s); dsimp
    rw [numeratorHom_apply, numeratorHom_apply]; simp
  exists_of_eq r₁ r₂ := by
    dsimp
    intro h
    rw [numeratorHom_apply, numeratorHom_apply, oreDiv_eq_iff] at h
    rcases h with ⟨u, v, h₁, h₂⟩
    dsimp at h₂
    rw [one_mul, one_mul] at h₂
    subst h₂
    use u
    

Proof state:
case h
R : Type u_1
inst✝¹ : CommMonoid R
S : Submonoid R
inst✝ : OreSet S
r₁ r₂ : R
u : ↥S
h₁ : r₂ * ↑u = r₁ * ↑u
⊢ ↑u * r₁ = ↑u * r₂

Next tactic:
simpa only [mul_comm] using h₁.symm
private theorem add''_char (r₁ : R) (s₁ : S) (r₂ : R) (s₂ : S) (rb : R) (sb : S)
    (hb : (s₁ : R) * sb = (s₂ : R) * rb) :
    add'' r₁ s₁ r₂ s₂ = (r₁ * sb + r₂ * rb) /ₒ (s₁ * sb) := by
  -- Porting note: `noncomm_ring` was not ported yet
  

Proof state:
R : Type u_1
inst✝¹ : Semiring R
S : Submonoid R
inst✝ : OreSet S
r₁ : R
s₁ : ↥S
r₂ : R
s₂ : ↥S
rb : R
sb : ↥S
hb : ↑s₁ * ↑sb = ↑s₂ * rb
⊢ OreLocalization.add'' r₁ s₁ r₂ s₂ = (r₁ * ↑sb + r₂ * rb) /ₒ (s₁ * sb)

Next tactic:
simp only [add'']
private theorem add''_char (r₁ : R) (s₁ : S) (r₂ : R) (s₂ : S) (rb : R) (sb : S)
    (hb : (s₁ : R) * sb = (s₂ : R) * rb) :
    add'' r₁ s₁ r₂ s₂ = (r₁ * sb + r₂ * rb) /ₒ (s₁ * sb) := by
  -- Porting note: `noncomm_ring` was not ported yet
  simp only [add'']
  

Proof state:
R : Type u_1
inst✝¹ : Semiring R
S : Submonoid R
inst✝ : OreSet S
r₁ : R
s₁ : ↥S
r₂ : R
s₂ : ↥S
rb : R
sb : ↥S
hb : ↑s₁ * ↑sb = ↑s₂ * rb
⊢ (r₁ * ↑(oreDenom (↑s₁) s₂) + r₂ * oreNum (↑s₁) s₂) /ₒ (s₁ * oreDenom (↑s₁) s₂) = (r₁ * ↑sb + r₂ * rb) /ₒ (s₁ * sb)

Next tactic:
have ha := ore_eq (s₁ : R) s₂
private theorem add''_char (r₁ : R) (s₁ : S) (r₂ : R) (s₂ : S) (rb : R) (sb : S)
    (hb : (s₁ : R) * sb = (s₂ : R) * rb) :
    add'' r₁ s₁ r₂ s₂ = (r₁ * sb + r₂ * rb) /ₒ (s₁ * sb) := by
  -- Porting note: `noncomm_ring` was not ported yet
  simp only [add'']
  have ha := ore_eq (s₁ : R) s₂
  

Proof state:
R : Type u_1
inst✝¹ : Semiring R
S : Submonoid R
inst✝ : OreSet S
r₁ : R
s₁ : ↥S
r₂ : R
s₂ : ↥S
rb : R
sb : ↥S
hb : ↑s₁ * ↑sb = ↑s₂ * rb
ha : ↑s₁ * ↑(oreDenom (↑s₁) s₂) = ↑s₂ * oreNum (↑s₁) s₂
⊢ (r₁ * ↑(oreDenom (↑s₁) s₂) + r₂ * oreNum (↑s₁) s₂) /ₒ (s₁ * oreDenom (↑s₁) s₂) = (r₁ * ↑sb + r₂ * rb) /ₒ (s₁ * sb)

Next tactic:
set! ra := oreNum (s₁ : R) s₂ with h
private theorem add''_char (r₁ : R) (s₁ : S) (r₂ : R) (s₂ : S) (rb : R) (sb : S)
    (hb : (s₁ : R) * sb = (s₂ : R) * rb) :
    add'' r₁ s₁ r₂ s₂ = (r₁ * sb + r₂ * rb) /ₒ (s₁ * sb) := by
  -- Porting note: `noncomm_ring` was not ported yet
  simp only [add'']
  have ha := ore_eq (s₁ : R) s₂
  set! ra := oreNum (s₁ : R) s₂ with h
  

Proof state:
R : Type u_1
inst✝¹ : Semiring R
S : Submonoid R
inst✝ : OreSet S
r₁ : R
s₁ : ↥S
r₂ : R
s₂ : ↥S
rb : R
sb : ↥S
hb : ↑s₁ * ↑sb = ↑s₂ * rb
ha : ↑s₁ * ↑(oreDenom (↑s₁) s₂) = ↑s₂ * oreNum (↑s₁) s₂
ra : R := oreNum (↑s₁) s₂
h : ra = oreNum (↑s₁) s₂
⊢ (r₁ * ↑(oreDenom (↑s₁) s₂) + r₂ * oreNum (↑s₁) s₂) /ₒ (s₁ * oreDenom (↑s₁) s₂) = (r₁ * ↑sb + r₂ * rb) /ₒ (s₁ * sb)

Next tactic:
rw [← h] at *
private theorem add''_char (r₁ : R) (s₁ : S) (r₂ : R) (s₂ : S) (rb : R) (sb : S)
    (hb : (s₁ : R) * sb = (s₂ : R) * rb) :
    add'' r₁ s₁ r₂ s₂ = (r₁ * sb + r₂ * rb) /ₒ (s₁ * sb) := by
  -- Porting note: `noncomm_ring` was not ported yet
  simp only [add'']
  have ha := ore_eq (s₁ : R) s₂
  set! ra := oreNum (s₁ : R) s₂ with h
  rw [← h] at *
  

Proof state:
R : Type u_1
inst✝¹ : Semiring R
S : Submonoid R
inst✝ : OreSet S
r₁ : R
s₁ : ↥S
r₂ : R
s₂ : ↥S
rb : R
sb : ↥S
hb : ↑s₁ * ↑sb = ↑s₂ * rb
ha : ↑s₁ * ↑(oreDenom (↑s₁) s₂) = ↑s₂ * oreNum (↑s₁) s₂
ra : R := oreNum (↑s₁) s₂
h : ra = ra
⊢ (r₁ * ↑(oreDenom (↑s₁) s₂) + r₂ * ra) /ₒ (s₁ * oreDenom (↑s₁) s₂) = (r₁ * ↑sb + r₂ * rb) /ₒ (s₁ * sb)

Next tactic:
clear h
private theorem add''_char (r₁ : R) (s₁ : S) (r₂ : R) (s₂ : S) (rb : R) (sb : S)
    (hb : (s₁ : R) * sb = (s₂ : R) * rb) :
    add'' r₁ s₁ r₂ s₂ = (r₁ * sb + r₂ * rb) /ₒ (s₁ * sb) := by
  -- Porting note: `noncomm_ring` was not ported yet
  simp only [add'']
  have ha := ore_eq (s₁ : R) s₂
  set! ra := oreNum (s₁ : R) s₂ with h
  rw [← h] at *
  clear h
  -- r tilde
  

Proof state:
R : Type u_1
inst✝¹ : Semiring R
S : Submonoid R
inst✝ : OreSet S
r₁ : R
s₁ : ↥S
r₂ : R
s₂ : ↥S
rb : R
sb : ↥S
hb : ↑s₁ * ↑sb = ↑s₂ * rb
ha : ↑s₁ * ↑(oreDenom (↑s₁) s₂) = ↑s₂ * oreNum (↑s₁) s₂
ra : R := oreNum (↑s₁) s₂
⊢ (r₁ * ↑(oreDenom (↑s₁) s₂) + r₂ * ra) /ₒ (s₁ * oreDenom (↑s₁) s₂) = (r₁ * ↑sb + r₂ * rb) /ₒ (s₁ * sb)

Next tactic:
set! sa := oreDenom (s₁ : R) s₂ with h
private theorem add''_char (r₁ : R) (s₁ : S) (r₂ : R) (s₂ : S) (rb : R) (sb : S)
    (hb : (s₁ : R) * sb = (s₂ : R) * rb) :
    add'' r₁ s₁ r₂ s₂ = (r₁ * sb + r₂ * rb) /ₒ (s₁ * sb) := by
  -- Porting note: `noncomm_ring` was not ported yet
  simp only [add'']
  have ha := ore_eq (s₁ : R) s₂
  set! ra := oreNum (s₁ : R) s₂ with h
  rw [← h] at *
  clear h
  -- r tilde
  set! sa := oreDenom (s₁ : R) s₂ with h
  

Proof state:
R : Type u_1
inst✝¹ : Semiring R
S : Submonoid R
inst✝ : OreSet S
r₁ : R
s₁ : ↥S
r₂ : R
s₂ : ↥S
rb : R
sb : ↥S
hb : ↑s₁ * ↑sb = ↑s₂ * rb
ha : ↑s₁ * ↑(oreDenom (↑s₁) s₂) = ↑s₂ * oreNum (↑s₁) s₂
ra : R := oreNum (↑s₁) s₂
sa : ↥S := oreDenom (↑s₁) s₂
h : sa = oreDenom (↑s₁) s₂
⊢ (r₁ * ↑(oreDenom (↑s₁) s₂) + r₂ * ra) /ₒ (s₁ * oreDenom (↑s₁) s₂) = (r₁ * ↑sb + r₂ * rb) /ₒ (s₁ * sb)

Next tactic:
rw [← h] at *
private theorem add''_char (r₁ : R) (s₁ : S) (r₂ : R) (s₂ : S) (rb : R) (sb : S)
    (hb : (s₁ : R) * sb = (s₂ : R) * rb) :
    add'' r₁ s₁ r₂ s₂ = (r₁ * sb + r₂ * rb) /ₒ (s₁ * sb) := by
  -- Porting note: `noncomm_ring` was not ported yet
  simp only [add'']
  have ha := ore_eq (s₁ : R) s₂
  set! ra := oreNum (s₁ : R) s₂ with h
  rw [← h] at *
  clear h
  -- r tilde
  set! sa := oreDenom (s₁ : R) s₂ with h
  rw [← h] at *
  

Proof state:
R : Type u_1
inst✝¹ : Semiring R
S : Submonoid R
inst✝ : OreSet S
r₁ : R
s₁ : ↥S
r₂ : R
s₂ : ↥S
rb : R
sb : ↥S
hb : ↑s₁ * ↑sb = ↑s₂ * rb
ha : ↑s₁ * ↑(oreDenom (↑s₁) s₂) = ↑s₂ * oreNum (↑s₁) s₂
ra : R := oreNum (↑s₁) s₂
sa : ↥S := oreDenom (↑s₁) s₂
h : sa = sa
⊢ (r₁ * ↑sa + r₂ * ra) /ₒ (s₁ * sa) = (r₁ * ↑sb + r₂ * rb) /ₒ (s₁ * sb)

Next tactic:
clear h
private theorem add''_char (r₁ : R) (s₁ : S) (r₂ : R) (s₂ : S) (rb : R) (sb : S)
    (hb : (s₁ : R) * sb = (s₂ : R) * rb) :
    add'' r₁ s₁ r₂ s₂ = (r₁ * sb + r₂ * rb) /ₒ (s₁ * sb) := by
  -- Porting note: `noncomm_ring` was not ported yet
  simp only [add'']
  have ha := ore_eq (s₁ : R) s₂
  set! ra := oreNum (s₁ : R) s₂ with h
  rw [← h] at *
  clear h
  -- r tilde
  set! sa := oreDenom (s₁ : R) s₂ with h
  rw [← h] at *
  clear h
  -- s tilde
  

Proof state:
R : Type u_1
inst✝¹ : Semiring R
S : Submonoid R
inst✝ : OreSet S
r₁ : R
s₁ : ↥S
r₂ : R
s₂ : ↥S
rb : R
sb : ↥S
hb : ↑s₁ * ↑sb = ↑s₂ * rb
ha : ↑s₁ * ↑(oreDenom (↑s₁) s₂) = ↑s₂ * oreNum (↑s₁) s₂
ra : R := oreNum (↑s₁) s₂
sa : ↥S := oreDenom (↑s₁) s₂
⊢ (r₁ * ↑sa + r₂ * ra) /ₒ (s₁ * sa) = (r₁ * ↑sb + r₂ * rb) /ₒ (s₁ * sb)

Next tactic:
rcases oreCondition (sa : R) sb with ⟨rc, sc, hc⟩
private theorem add''_char (r₁ : R) (s₁ : S) (r₂ : R) (s₂ : S) (rb : R) (sb : S)
    (hb : (s₁ : R) * sb = (s₂ : R) * rb) :
    add'' r₁ s₁ r₂ s₂ = (r₁ * sb + r₂ * rb) /ₒ (s₁ * sb) := by
  -- Porting note: `noncomm_ring` was not ported yet
  simp only [add'']
  have ha := ore_eq (s₁ : R) s₂
  set! ra := oreNum (s₁ : R) s₂ with h
  rw [← h] at *
  clear h
  -- r tilde
  set! sa := oreDenom (s₁ : R) s₂ with h
  rw [← h] at *
  clear h
  -- s tilde
  rcases oreCondition (sa : R) sb with ⟨rc, sc, hc⟩
  -- s*, r*
  

Proof state:
case mk.mk
R : Type u_1
inst✝¹ : Semiring R
S : Submonoid R
inst✝ : OreSet S
r₁ : R
s₁ : ↥S
r₂ : R
s₂ : ↥S
rb : R
sb : ↥S
hb : ↑s₁ * ↑sb = ↑s₂ * rb
ha : ↑s₁ * ↑(oreDenom (↑s₁) s₂) = ↑s₂ * oreNum (↑s₁) s₂
ra : R := oreNum (↑s₁) s₂
sa : ↥S := oreDenom (↑s₁) s₂
rc : R
sc : ↥S
hc : ↑sa * ↑sc = ↑sb * rc
⊢ (r₁ * ↑sa + r₂ * ra) /ₒ (s₁ * sa) = (r₁ * ↑sb + r₂ * rb) /ₒ (s₁ * sb)

Next tactic:
have : (s₂ : R) * (rb * rc) = s₂ * (ra * sc) := by
    rw [← mul_assoc, ← hb, mul_assoc, ← hc, ← mul_assoc, ← mul_assoc, ha]
private theorem add''_char (r₁ : R) (s₁ : S) (r₂ : R) (s₂ : S) (rb : R) (sb : S)
    (hb : (s₁ : R) * sb = (s₂ : R) * rb) :
    add'' r₁ s₁ r₂ s₂ = (r₁ * sb + r₂ * rb) /ₒ (s₁ * sb) := by
  -- Porting note: `noncomm_ring` was not ported yet
  simp only [add'']
  have ha := ore_eq (s₁ : R) s₂
  set! ra := oreNum (s₁ : R) s₂ with h
  rw [← h] at *
  clear h
  -- r tilde
  set! sa := oreDenom (s₁ : R) s₂ with h
  rw [← h] at *
  clear h
  -- s tilde
  rcases oreCondition (sa : R) sb with ⟨rc, sc, hc⟩
  -- s*, r*
  have : (s₂ : R) * (rb * rc) = s₂ * (ra * sc) := by
    

Proof state:
R : Type u_1
inst✝¹ : Semiring R
S : Submonoid R
inst✝ : OreSet S
r₁ : R
s₁ : ↥S
r₂ : R
s₂ : ↥S
rb : R
sb : ↥S
hb : ↑s₁ * ↑sb = ↑s₂ * rb
ha : ↑s₁ * ↑(oreDenom (↑s₁) s₂) = ↑s₂ * oreNum (↑s₁) s₂
ra : R := oreNum (↑s₁) s₂
sa : ↥S := oreDenom (↑s₁) s₂
rc : R
sc : ↥S
hc : ↑sa * ↑sc = ↑sb * rc
⊢ ↑s₂ * (rb * rc) = ↑s₂ * (ra * ↑sc)

Next tactic:
rw [← mul_assoc, ← hb, mul_assoc, ← hc, ← mul_assoc, ← mul_assoc, ha]
private theorem add''_char (r₁ : R) (s₁ : S) (r₂ : R) (s₂ : S) (rb : R) (sb : S)
    (hb : (s₁ : R) * sb = (s₂ : R) * rb) :
    add'' r₁ s₁ r₂ s₂ = (r₁ * sb + r₂ * rb) /ₒ (s₁ * sb) := by
  -- Porting note: `noncomm_ring` was not ported yet
  simp only [add'']
  have ha := ore_eq (s₁ : R) s₂
  set! ra := oreNum (s₁ : R) s₂ with h
  rw [← h] at *
  clear h
  -- r tilde
  set! sa := oreDenom (s₁ : R) s₂ with h
  rw [← h] at *
  clear h
  -- s tilde
  rcases oreCondition (sa : R) sb with ⟨rc, sc, hc⟩
  -- s*, r*
  have : (s₂ : R) * (rb * rc) = s₂ * (ra * sc) := by
    rw [← mul_assoc, ← hb, mul_assoc, ← hc, ← mul_assoc, ← mul_assoc, ha]
  

Proof state:
case mk.mk
R : Type u_1
inst✝¹ : Semiring R
S : Submonoid R
inst✝ : OreSet S
r₁ : R
s₁ : ↥S
r₂ : R
s₂ : ↥S
rb : R
sb : ↥S
hb : ↑s₁ * ↑sb = ↑s₂ * rb
ha : ↑s₁ * ↑(oreDenom (↑s₁) s₂) = ↑s₂ * oreNum (↑s₁) s₂
ra : R := oreNum (↑s₁) s₂
sa : ↥S := oreDenom (↑s₁) s₂
rc : R
sc : ↥S
hc : ↑sa * ↑sc = ↑sb * rc
this : ↑s₂ * (rb * rc) = ↑s₂ * (ra * ↑sc)
⊢ (r₁ * ↑sa + r₂ * ra) /ₒ (s₁ * sa) = (r₁ * ↑sb + r₂ * rb) /ₒ (s₁ * sb)

Next tactic:
rcases ore_left_cancel _ _ s₂ this with ⟨sd, hd⟩
private theorem add''_char (r₁ : R) (s₁ : S) (r₂ : R) (s₂ : S) (rb : R) (sb : S)
    (hb : (s₁ : R) * sb = (s₂ : R) * rb) :
    add'' r₁ s₁ r₂ s₂ = (r₁ * sb + r₂ * rb) /ₒ (s₁ * sb) := by
  -- Porting note: `noncomm_ring` was not ported yet
  simp only [add'']
  have ha := ore_eq (s₁ : R) s₂
  set! ra := oreNum (s₁ : R) s₂ with h
  rw [← h] at *
  clear h
  -- r tilde
  set! sa := oreDenom (s₁ : R) s₂ with h
  rw [← h] at *
  clear h
  -- s tilde
  rcases oreCondition (sa : R) sb with ⟨rc, sc, hc⟩
  -- s*, r*
  have : (s₂ : R) * (rb * rc) = s₂ * (ra * sc) := by
    rw [← mul_assoc, ← hb, mul_assoc, ← hc, ← mul_assoc, ← mul_assoc, ha]
  rcases ore_left_cancel _ _ s₂ this with ⟨sd, hd⟩
  -- s#
  

Proof state:
case mk.mk.intro
R : Type u_1
inst✝¹ : Semiring R
S : Submonoid R
inst✝ : OreSet S
r₁ : R
s₁ : ↥S
r₂ : R
s₂ : ↥S
rb : R
sb : ↥S
hb : ↑s₁ * ↑sb = ↑s₂ * rb
ha : ↑s₁ * ↑(oreDenom (↑s₁) s₂) = ↑s₂ * oreNum (↑s₁) s₂
ra : R := oreNum (↑s₁) s₂
sa : ↥S := oreDenom (↑s₁) s₂
rc : R
sc : ↥S
hc : ↑sa * ↑sc = ↑sb * rc
this : ↑s₂ * (rb * rc) = ↑s₂ * (ra * ↑sc)
sd : ↥S
hd : rb * rc * ↑sd = ra * ↑sc * ↑sd
⊢ (r₁ * ↑sa + r₂ * ra) /ₒ (s₁ * sa) = (r₁ * ↑sb + r₂ * rb) /ₒ (s₁ * sb)

Next tactic:
symm
private theorem add''_char (r₁ : R) (s₁ : S) (r₂ : R) (s₂ : S) (rb : R) (sb : S)
    (hb : (s₁ : R) * sb = (s₂ : R) * rb) :
    add'' r₁ s₁ r₂ s₂ = (r₁ * sb + r₂ * rb) /ₒ (s₁ * sb) := by
  -- Porting note: `noncomm_ring` was not ported yet
  simp only [add'']
  have ha := ore_eq (s₁ : R) s₂
  set! ra := oreNum (s₁ : R) s₂ with h
  rw [← h] at *
  clear h
  -- r tilde
  set! sa := oreDenom (s₁ : R) s₂ with h
  rw [← h] at *
  clear h
  -- s tilde
  rcases oreCondition (sa : R) sb with ⟨rc, sc, hc⟩
  -- s*, r*
  have : (s₂ : R) * (rb * rc) = s₂ * (ra * sc) := by
    rw [← mul_assoc, ← hb, mul_assoc, ← hc, ← mul_assoc, ← mul_assoc, ha]
  rcases ore_left_cancel _ _ s₂ this with ⟨sd, hd⟩
  -- s#
  symm
  

Proof state:
case mk.mk.intro
R : Type u_1
inst✝¹ : Semiring R
S : Submonoid R
inst✝ : OreSet S
r₁ : R
s₁ : ↥S
r₂ : R
s₂ : ↥S
rb : R
sb : ↥S
hb : ↑s₁ * ↑sb = ↑s₂ * rb
ha : ↑s₁ * ↑(oreDenom (↑s₁) s₂) = ↑s₂ * oreNum (↑s₁) s₂
ra : R := oreNum (↑s₁) s₂
sa : ↥S := oreDenom (↑s₁) s₂
rc : R
sc : ↥S
hc : ↑sa * ↑sc = ↑sb * rc
this : ↑s₂ * (rb * rc) = ↑s₂ * (ra * ↑sc)
sd : ↥S
hd : rb * rc * ↑sd = ra * ↑sc * ↑sd
⊢ (r₁ * ↑sb + r₂ * rb) /ₒ (s₁ * sb) = (r₁ * ↑sa + r₂ * ra) /ₒ (s₁ * sa)

Next tactic:
rw [oreDiv_eq_iff]