l3lab/ntp-mathlib huggingface dataset:
@[to_additive]
instance le : LE (Localization s) :=
  ⟨fun a b =>
    Localization.liftOn₂ a b (fun a₁ a₂ b₁ b₂ => ↑b₂ * a₁ ≤ a₂ * b₁)
      @fun a₁ b₁ a₂ b₂ c₁ d₁ c₂ d₂ hab hcd => propext $ by
        obtain ⟨e, he⟩ := r_iff_exists.1 hab
        obtain ⟨f, hf⟩ := r_iff_exists.1 hcd
        simp only [mul_right_inj] at he hf
        dsimp
        

Proof state:
case intro.intro
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁✝ b₁✝ : α
a₂✝ b₂✝ : ↥s
a b : Localization s
a₁ b₁ : α
a₂ b₂ : ↥s
c₁ d₁ : α
c₂ d₂ : ↥s
hab : (r s) (a₁, a₂) (b₁, b₂)
hcd : (r s) (c₁, c₂) (d₁, d₂)
e f : ↥s
he : ↑b₂ * a₁ = ↑a₂ * b₁
hf : ↑d₂ * c₁ = ↑c₂ * d₁
⊢ ↑c₂ * a₁ ≤ ↑a₂ * c₁ ↔ ↑d₂ * b₁ ≤ ↑b₂ * d₁

Next tactic:
rw [← mul_le_mul_iff_right, mul_right_comm, ← hf, mul_right_comm, mul_right_comm (a₂ : α),
          mul_le_mul_iff_right, ← mul_le_mul_iff_left, mul_left_comm, he, mul_left_comm,
          mul_left_comm (b₂ : α), mul_le_mul_iff_left]
@[to_additive]
instance lt : LT (Localization s) :=
  ⟨fun a b =>
    Localization.liftOn₂ a b (fun a₁ a₂ b₁ b₂ => ↑b₂ * a₁ < a₂ * b₁)
      @fun a₁ b₁ a₂ b₂ c₁ d₁ c₂ d₂ hab hcd => propext $ by
        

Proof state:
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁✝ b₁✝ : α
a₂✝ b₂✝ : ↥s
a b : Localization s
a₁ b₁ : α
a₂ b₂ : ↥s
c₁ d₁ : α
c₂ d₂ : ↥s
hab : (r s) (a₁, a₂) (b₁, b₂)
hcd : (r s) (c₁, c₂) (d₁, d₂)
⊢ (fun a₁ a₂ b₁ b₂ => ↑b₂ * a₁ < ↑a₂ * b₁) a₁ a₂ c₁ c₂ ↔ (fun a₁ a₂ b₁ b₂ => ↑b₂ * a₁ < ↑a₂ * b₁) b₁ b₂ d₁ d₂

Next tactic:
obtain ⟨e, he⟩ := r_iff_exists.1 hab
@[to_additive]
instance lt : LT (Localization s) :=
  ⟨fun a b =>
    Localization.liftOn₂ a b (fun a₁ a₂ b₁ b₂ => ↑b₂ * a₁ < a₂ * b₁)
      @fun a₁ b₁ a₂ b₂ c₁ d₁ c₂ d₂ hab hcd => propext $ by
        obtain ⟨e, he⟩ := r_iff_exists.1 hab
        

Proof state:
case intro
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁✝ b₁✝ : α
a₂✝ b₂✝ : ↥s
a b : Localization s
a₁ b₁ : α
a₂ b₂ : ↥s
c₁ d₁ : α
c₂ d₂ : ↥s
hab : (r s) (a₁, a₂) (b₁, b₂)
hcd : (r s) (c₁, c₂) (d₁, d₂)
e : ↥s
he : ↑e * (↑(b₁, b₂).2 * (a₁, a₂).1) = ↑e * (↑(a₁, a₂).2 * (b₁, b₂).1)
⊢ (fun a₁ a₂ b₁ b₂ => ↑b₂ * a₁ < ↑a₂ * b₁) a₁ a₂ c₁ c₂ ↔ (fun a₁ a₂ b₁ b₂ => ↑b₂ * a₁ < ↑a₂ * b₁) b₁ b₂ d₁ d₂

Next tactic:
obtain ⟨f, hf⟩ := r_iff_exists.1 hcd
@[to_additive]
instance lt : LT (Localization s) :=
  ⟨fun a b =>
    Localization.liftOn₂ a b (fun a₁ a₂ b₁ b₂ => ↑b₂ * a₁ < a₂ * b₁)
      @fun a₁ b₁ a₂ b₂ c₁ d₁ c₂ d₂ hab hcd => propext $ by
        obtain ⟨e, he⟩ := r_iff_exists.1 hab
        obtain ⟨f, hf⟩ := r_iff_exists.1 hcd
        

Proof state:
case intro.intro
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁✝ b₁✝ : α
a₂✝ b₂✝ : ↥s
a b : Localization s
a₁ b₁ : α
a₂ b₂ : ↥s
c₁ d₁ : α
c₂ d₂ : ↥s
hab : (r s) (a₁, a₂) (b₁, b₂)
hcd : (r s) (c₁, c₂) (d₁, d₂)
e : ↥s
he : ↑e * (↑(b₁, b₂).2 * (a₁, a₂).1) = ↑e * (↑(a₁, a₂).2 * (b₁, b₂).1)
f : ↥s
hf : ↑f * (↑(d₁, d₂).2 * (c₁, c₂).1) = ↑f * (↑(c₁, c₂).2 * (d₁, d₂).1)
⊢ (fun a₁ a₂ b₁ b₂ => ↑b₂ * a₁ < ↑a₂ * b₁) a₁ a₂ c₁ c₂ ↔ (fun a₁ a₂ b₁ b₂ => ↑b₂ * a₁ < ↑a₂ * b₁) b₁ b₂ d₁ d₂

Next tactic:
simp only [mul_right_inj] at he hf
@[to_additive]
instance lt : LT (Localization s) :=
  ⟨fun a b =>
    Localization.liftOn₂ a b (fun a₁ a₂ b₁ b₂ => ↑b₂ * a₁ < a₂ * b₁)
      @fun a₁ b₁ a₂ b₂ c₁ d₁ c₂ d₂ hab hcd => propext $ by
        obtain ⟨e, he⟩ := r_iff_exists.1 hab
        obtain ⟨f, hf⟩ := r_iff_exists.1 hcd
        simp only [mul_right_inj] at he hf
        

Proof state:
case intro.intro
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁✝ b₁✝ : α
a₂✝ b₂✝ : ↥s
a b : Localization s
a₁ b₁ : α
a₂ b₂ : ↥s
c₁ d₁ : α
c₂ d₂ : ↥s
hab : (r s) (a₁, a₂) (b₁, b₂)
hcd : (r s) (c₁, c₂) (d₁, d₂)
e f : ↥s
he : ↑b₂ * a₁ = ↑a₂ * b₁
hf : ↑d₂ * c₁ = ↑c₂ * d₁
⊢ (fun a₁ a₂ b₁ b₂ => ↑b₂ * a₁ < ↑a₂ * b₁) a₁ a₂ c₁ c₂ ↔ (fun a₁ a₂ b₁ b₂ => ↑b₂ * a₁ < ↑a₂ * b₁) b₁ b₂ d₁ d₂

Next tactic:
dsimp
@[to_additive]
instance lt : LT (Localization s) :=
  ⟨fun a b =>
    Localization.liftOn₂ a b (fun a₁ a₂ b₁ b₂ => ↑b₂ * a₁ < a₂ * b₁)
      @fun a₁ b₁ a₂ b₂ c₁ d₁ c₂ d₂ hab hcd => propext $ by
        obtain ⟨e, he⟩ := r_iff_exists.1 hab
        obtain ⟨f, hf⟩ := r_iff_exists.1 hcd
        simp only [mul_right_inj] at he hf
        dsimp
        

Proof state:
case intro.intro
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁✝ b₁✝ : α
a₂✝ b₂✝ : ↥s
a b : Localization s
a₁ b₁ : α
a₂ b₂ : ↥s
c₁ d₁ : α
c₂ d₂ : ↥s
hab : (r s) (a₁, a₂) (b₁, b₂)
hcd : (r s) (c₁, c₂) (d₁, d₂)
e f : ↥s
he : ↑b₂ * a₁ = ↑a₂ * b₁
hf : ↑d₂ * c₁ = ↑c₂ * d₁
⊢ ↑c₂ * a₁ < ↑a₂ * c₁ ↔ ↑d₂ * b₁ < ↑b₂ * d₁

Next tactic:
rw [← mul_lt_mul_iff_right, mul_right_comm, ← hf, mul_right_comm, mul_right_comm (a₂ : α),
          mul_lt_mul_iff_right, ← mul_lt_mul_iff_left, mul_left_comm, he, mul_left_comm,
          mul_left_comm (b₂ : α), mul_lt_mul_iff_left]
@[to_additive]
instance partialOrder : PartialOrder (Localization s) where
  le := (· ≤ ·)
  lt := (· < ·)
  le_refl a := Localization.induction_on a fun a => le_rfl
  le_trans a b c :=
    Localization.induction_on₃ a b c fun a b c hab hbc => by
      

Proof state:
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁ b₁ : α
a₂ b₂ : ↥s
a✝ b✝ c✝ : Localization s
a b c : α × ↥s
hab : mk a.1 a.2 ≤ mk b.1 b.2
hbc : mk b.1 b.2 ≤ mk c.1 c.2
⊢ mk a.1 a.2 ≤ mk c.1 c.2

Next tactic:
simp only [mk_le_mk] at hab hbc ⊢
@[to_additive]
instance partialOrder : PartialOrder (Localization s) where
  le := (· ≤ ·)
  lt := (· < ·)
  le_refl a := Localization.induction_on a fun a => le_rfl
  le_trans a b c :=
    Localization.induction_on₃ a b c fun a b c hab hbc => by
      simp only [mk_le_mk] at hab hbc ⊢
      

Proof state:
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁ b₁ : α
a₂ b₂ : ↥s
a✝ b✝ c✝ : Localization s
a b c : α × ↥s
hab : ↑b.2 * a.1 ≤ ↑a.2 * b.1
hbc : ↑c.2 * b.1 ≤ ↑b.2 * c.1
⊢ ↑c.2 * a.1 ≤ ↑a.2 * c.1

Next tactic:
refine' le_of_mul_le_mul_left' _
@[to_additive]
instance partialOrder : PartialOrder (Localization s) where
  le := (· ≤ ·)
  lt := (· < ·)
  le_refl a := Localization.induction_on a fun a => le_rfl
  le_trans a b c :=
    Localization.induction_on₃ a b c fun a b c hab hbc => by
      simp only [mk_le_mk] at hab hbc ⊢
      refine' le_of_mul_le_mul_left' _
      · 

Proof state:
case refine'_1
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁ b₁ : α
a₂ b₂ : ↥s
a✝ b✝ c✝ : Localization s
a b c : α × ↥s
hab : ↑b.2 * a.1 ≤ ↑a.2 * b.1
hbc : ↑c.2 * b.1 ≤ ↑b.2 * c.1
⊢ α

Next tactic:
exact ↑b.2
@[to_additive]
instance partialOrder : PartialOrder (Localization s) where
  le := (· ≤ ·)
  lt := (· < ·)
  le_refl a := Localization.induction_on a fun a => le_rfl
  le_trans a b c :=
    Localization.induction_on₃ a b c fun a b c hab hbc => by
      simp only [mk_le_mk] at hab hbc ⊢
      refine' le_of_mul_le_mul_left' _
      · exact ↑b.2
      

Proof state:
case refine'_2
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁ b₁ : α
a₂ b₂ : ↥s
a✝ b✝ c✝ : Localization s
a b c : α × ↥s
hab : ↑b.2 * a.1 ≤ ↑a.2 * b.1
hbc : ↑c.2 * b.1 ≤ ↑b.2 * c.1
⊢ ↑b.2 * (↑c.2 * a.1) ≤ ↑b.2 * (↑a.2 * c.1)

Next tactic:
rw [mul_left_comm]
@[to_additive]
instance partialOrder : PartialOrder (Localization s) where
  le := (· ≤ ·)
  lt := (· < ·)
  le_refl a := Localization.induction_on a fun a => le_rfl
  le_trans a b c :=
    Localization.induction_on₃ a b c fun a b c hab hbc => by
      simp only [mk_le_mk] at hab hbc ⊢
      refine' le_of_mul_le_mul_left' _
      · exact ↑b.2
      rw [mul_left_comm]
      

Proof state:
case refine'_2
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁ b₁ : α
a₂ b₂ : ↥s
a✝ b✝ c✝ : Localization s
a b c : α × ↥s
hab : ↑b.2 * a.1 ≤ ↑a.2 * b.1
hbc : ↑c.2 * b.1 ≤ ↑b.2 * c.1
⊢ ↑c.2 * (↑b.2 * a.1) ≤ ↑b.2 * (↑a.2 * c.1)

Next tactic:
refine' (mul_le_mul_left' hab _).trans _
@[to_additive]
instance partialOrder : PartialOrder (Localization s) where
  le := (· ≤ ·)
  lt := (· < ·)
  le_refl a := Localization.induction_on a fun a => le_rfl
  le_trans a b c :=
    Localization.induction_on₃ a b c fun a b c hab hbc => by
      simp only [mk_le_mk] at hab hbc ⊢
      refine' le_of_mul_le_mul_left' _
      · exact ↑b.2
      rw [mul_left_comm]
      refine' (mul_le_mul_left' hab _).trans _
      

Proof state:
case refine'_2
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁ b₁ : α
a₂ b₂ : ↥s
a✝ b✝ c✝ : Localization s
a b c : α × ↥s
hab : ↑b.2 * a.1 ≤ ↑a.2 * b.1
hbc : ↑c.2 * b.1 ≤ ↑b.2 * c.1
⊢ ↑c.2 * (↑a.2 * b.1) ≤ ↑b.2 * (↑a.2 * c.1)

Next tactic:
rwa [mul_left_comm, mul_left_comm (b.2 : α), mul_le_mul_iff_left]
@[to_additive]
instance partialOrder : PartialOrder (Localization s) where
  le := (· ≤ ·)
  lt := (· < ·)
  le_refl a := Localization.induction_on a fun a => le_rfl
  le_trans a b c :=
    Localization.induction_on₃ a b c fun a b c hab hbc => by
      simp only [mk_le_mk] at hab hbc ⊢
      refine' le_of_mul_le_mul_left' _
      · exact ↑b.2
      rw [mul_left_comm]
      refine' (mul_le_mul_left' hab _).trans _
      rwa [mul_left_comm, mul_left_comm (b.2 : α), mul_le_mul_iff_left]
  le_antisymm a b := by
    

Proof state:
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁ b₁ : α
a₂ b₂ : ↥s
a b : Localization s
⊢ a ≤ b → b ≤ a → a = b

Next tactic:
induction' a using Localization.rec with a₁ a₂
@[to_additive]
instance partialOrder : PartialOrder (Localization s) where
  le := (· ≤ ·)
  lt := (· < ·)
  le_refl a := Localization.induction_on a fun a => le_rfl
  le_trans a b c :=
    Localization.induction_on₃ a b c fun a b c hab hbc => by
      simp only [mk_le_mk] at hab hbc ⊢
      refine' le_of_mul_le_mul_left' _
      · exact ↑b.2
      rw [mul_left_comm]
      refine' (mul_le_mul_left' hab _).trans _
      rwa [mul_left_comm, mul_left_comm (b.2 : α), mul_le_mul_iff_left]
  le_antisymm a b := by
    induction' a using Localization.rec with a₁ a₂
    

Proof state:
case f
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁✝ b₁ : α
a₂✝ b₂ : ↥s
b : Localization s
a₁ : α
a₂ : ↥s
⊢ mk a₁ a₂ ≤ b → b ≤ mk a₁ a₂ → mk a₁ a₂ = b
case H
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁ b₁ : α
a₂ b₂ : ↥s
a b : Localization s
a✝ c✝ : α
b✝ d✝ : ↥s
h✝ : (r s) (a✝, b✝) (c✝, d✝)
⊢ (_ : mk c✝ d✝ ≤ b → b ≤ mk c✝ d✝ → mk c✝ d✝ = b) = (_ : mk c✝ d✝ ≤ b → b ≤ mk c✝ d✝ → mk c✝ d✝ = b)

Next tactic:
induction' b using Localization.rec with b₁ b₂
@[to_additive]
instance partialOrder : PartialOrder (Localization s) where
  le := (· ≤ ·)
  lt := (· < ·)
  le_refl a := Localization.induction_on a fun a => le_rfl
  le_trans a b c :=
    Localization.induction_on₃ a b c fun a b c hab hbc => by
      simp only [mk_le_mk] at hab hbc ⊢
      refine' le_of_mul_le_mul_left' _
      · exact ↑b.2
      rw [mul_left_comm]
      refine' (mul_le_mul_left' hab _).trans _
      rwa [mul_left_comm, mul_left_comm (b.2 : α), mul_le_mul_iff_left]
  le_antisymm a b := by
    induction' a using Localization.rec with a₁ a₂
    induction' b using Localization.rec with b₁ b₂
    

Proof state:
case f.f
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁✝ b₁✝ : α
a₂✝ b₂✝ : ↥s
a₁ : α
a₂ : ↥s
b₁ : α
b₂ : ↥s
⊢ mk a₁ a₂ ≤ mk b₁ b₂ → mk b₁ b₂ ≤ mk a₁ a₂ → mk a₁ a₂ = mk b₁ b₂
case f.H
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁✝ b₁ : α
a₂✝ b₂ : ↥s
b : Localization s
a₁ : α
a₂ : ↥s
a✝ c✝ : α
b✝ d✝ : ↥s
h✝ : (r s) (a✝, b✝) (c✝, d✝)
⊢ (_ : mk a₁ a₂ ≤ mk c✝ d✝ → mk c✝ d✝ ≤ mk a₁ a₂ → mk a₁ a₂ = mk c✝ d✝) =
    (_ : mk a₁ a₂ ≤ mk c✝ d✝ → mk c✝ d✝ ≤ mk a₁ a₂ → mk a₁ a₂ = mk c✝ d✝)
case H
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁ b₁ : α
a₂ b₂ : ↥s
a b : Localization s
a✝ c✝ : α
b✝ d✝ : ↥s
h✝ : (r s) (a✝, b✝) (c✝, d✝)
⊢ (_ : mk c✝ d✝ ≤ b → b ≤ mk c✝ d✝ → mk c✝ d✝ = b) = (_ : mk c✝ d✝ ≤ b → b ≤ mk c✝ d✝ → mk c✝ d✝ = b)

Next tactic:
simp_rw [mk_le_mk, mk_eq_mk_iff, r_iff_exists]
@[to_additive]
instance partialOrder : PartialOrder (Localization s) where
  le := (· ≤ ·)
  lt := (· < ·)
  le_refl a := Localization.induction_on a fun a => le_rfl
  le_trans a b c :=
    Localization.induction_on₃ a b c fun a b c hab hbc => by
      simp only [mk_le_mk] at hab hbc ⊢
      refine' le_of_mul_le_mul_left' _
      · exact ↑b.2
      rw [mul_left_comm]
      refine' (mul_le_mul_left' hab _).trans _
      rwa [mul_left_comm, mul_left_comm (b.2 : α), mul_le_mul_iff_left]
  le_antisymm a b := by
    induction' a using Localization.rec with a₁ a₂
    induction' b using Localization.rec with b₁ b₂
    simp_rw [mk_le_mk, mk_eq_mk_iff, r_iff_exists]
    

Proof state:
case f.f
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁✝ b₁✝ : α
a₂✝ b₂✝ : ↥s
a₁ : α
a₂ : ↥s
b₁ : α
b₂ : ↥s
⊢ ↑b₂ * a₁ ≤ ↑a₂ * b₁ → ↑a₂ * b₁ ≤ ↑b₂ * a₁ → ∃ c, ↑c * (↑b₂ * a₁) = ↑c * (↑a₂ * b₁)
case f.H
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁✝ b₁ : α
a₂✝ b₂ : ↥s
b : Localization s
a₁ : α
a₂ : ↥s
a✝ c✝ : α
b✝ d✝ : ↥s
h✝ : (r s) (a✝, b✝) (c✝, d✝)
⊢ (_ : mk a₁ a₂ ≤ mk c✝ d✝ → mk c✝ d✝ ≤ mk a₁ a₂ → mk a₁ a₂ = mk c✝ d✝) =
    (_ : mk a₁ a₂ ≤ mk c✝ d✝ → mk c✝ d✝ ≤ mk a₁ a₂ → mk a₁ a₂ = mk c✝ d✝)
case H
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁ b₁ : α
a₂ b₂ : ↥s
a b : Localization s
a✝ c✝ : α
b✝ d✝ : ↥s
h✝ : (r s) (a✝, b✝) (c✝, d✝)
⊢ (_ : mk c✝ d✝ ≤ b → b ≤ mk c✝ d✝ → mk c✝ d✝ = b) = (_ : mk c✝ d✝ ≤ b → b ≤ mk c✝ d✝ → mk c✝ d✝ = b)

Next tactic:
exact fun hab hba => ⟨1, by rw [hab.antisymm hba]⟩
@[to_additive]
instance partialOrder : PartialOrder (Localization s) where
  le := (· ≤ ·)
  lt := (· < ·)
  le_refl a := Localization.induction_on a fun a => le_rfl
  le_trans a b c :=
    Localization.induction_on₃ a b c fun a b c hab hbc => by
      simp only [mk_le_mk] at hab hbc ⊢
      refine' le_of_mul_le_mul_left' _
      · exact ↑b.2
      rw [mul_left_comm]
      refine' (mul_le_mul_left' hab _).trans _
      rwa [mul_left_comm, mul_left_comm (b.2 : α), mul_le_mul_iff_left]
  le_antisymm a b := by
    induction' a using Localization.rec with a₁ a₂
    induction' b using Localization.rec with b₁ b₂
    simp_rw [mk_le_mk, mk_eq_mk_iff, r_iff_exists]
    exact fun hab hba => ⟨1, by 

Proof state:
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁✝ b₁✝ : α
a₂✝ b₂✝ : ↥s
a₁ : α
a₂ : ↥s
b₁ : α
b₂ : ↥s
hab : ↑b₂ * a₁ ≤ ↑a₂ * b₁
hba : ↑a₂ * b₁ ≤ ↑b₂ * a₁
⊢ ↑1 * (↑b₂ * a₁) = ↑1 * (↑a₂ * b₁)

Next tactic:
rw [hab.antisymm hba]
@[to_additive]
instance partialOrder : PartialOrder (Localization s) where
  le := (· ≤ ·)
  lt := (· < ·)
  le_refl a := Localization.induction_on a fun a => le_rfl
  le_trans a b c :=
    Localization.induction_on₃ a b c fun a b c hab hbc => by
      simp only [mk_le_mk] at hab hbc ⊢
      refine' le_of_mul_le_mul_left' _
      · exact ↑b.2
      rw [mul_left_comm]
      refine' (mul_le_mul_left' hab _).trans _
      rwa [mul_left_comm, mul_left_comm (b.2 : α), mul_le_mul_iff_left]
  le_antisymm a b := by
    induction' a using Localization.rec with a₁ a₂
    induction' b using Localization.rec with b₁ b₂
    simp_rw [mk_le_mk, mk_eq_mk_iff, r_iff_exists]
    exact fun hab hba => ⟨1, by rw [hab.antisymm hba]⟩
    

Proof state:
case f.H
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁✝ b₁ : α
a₂✝ b₂ : ↥s
b : Localization s
a₁ : α
a₂ : ↥s
a✝ c✝ : α
b✝ d✝ : ↥s
h✝ : (r s) (a✝, b✝) (c✝, d✝)
⊢ (_ : mk a₁ a₂ ≤ mk c✝ d✝ → mk c✝ d✝ ≤ mk a₁ a₂ → mk a₁ a₂ = mk c✝ d✝) =
    (_ : mk a₁ a₂ ≤ mk c✝ d✝ → mk c✝ d✝ ≤ mk a₁ a₂ → mk a₁ a₂ = mk c✝ d✝)
case H
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁ b₁ : α
a₂ b₂ : ↥s
a b : Localization s
a✝ c✝ : α
b✝ d✝ : ↥s
h✝ : (r s) (a✝, b✝) (c✝, d✝)
⊢ (_ : mk c✝ d✝ ≤ b → b ≤ mk c✝ d✝ → mk c✝ d✝ = b) = (_ : mk c✝ d✝ ≤ b → b ≤ mk c✝ d✝ → mk c✝ d✝ = b)

Next tactic:
all_goals intros; rfl
@[to_additive]
instance partialOrder : PartialOrder (Localization s) where
  le := (· ≤ ·)
  lt := (· < ·)
  le_refl a := Localization.induction_on a fun a => le_rfl
  le_trans a b c :=
    Localization.induction_on₃ a b c fun a b c hab hbc => by
      simp only [mk_le_mk] at hab hbc ⊢
      refine' le_of_mul_le_mul_left' _
      · exact ↑b.2
      rw [mul_left_comm]
      refine' (mul_le_mul_left' hab _).trans _
      rwa [mul_left_comm, mul_left_comm (b.2 : α), mul_le_mul_iff_left]
  le_antisymm a b := by
    induction' a using Localization.rec with a₁ a₂
    induction' b using Localization.rec with b₁ b₂
    simp_rw [mk_le_mk, mk_eq_mk_iff, r_iff_exists]
    exact fun hab hba => ⟨1, by rw [hab.antisymm hba]⟩
    all_goals 

Proof state:
case f.H
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁✝ b₁ : α
a₂✝ b₂ : ↥s
b : Localization s
a₁ : α
a₂ : ↥s
a✝ c✝ : α
b✝ d✝ : ↥s
h✝ : (r s) (a✝, b✝) (c✝, d✝)
⊢ (_ : mk a₁ a₂ ≤ mk c✝ d✝ → mk c✝ d✝ ≤ mk a₁ a₂ → mk a₁ a₂ = mk c✝ d✝) =
    (_ : mk a₁ a₂ ≤ mk c✝ d✝ → mk c✝ d✝ ≤ mk a₁ a₂ → mk a₁ a₂ = mk c✝ d✝)

Next tactic:
intros
@[to_additive]
instance partialOrder : PartialOrder (Localization s) where
  le := (· ≤ ·)
  lt := (· < ·)
  le_refl a := Localization.induction_on a fun a => le_rfl
  le_trans a b c :=
    Localization.induction_on₃ a b c fun a b c hab hbc => by
      simp only [mk_le_mk] at hab hbc ⊢
      refine' le_of_mul_le_mul_left' _
      · exact ↑b.2
      rw [mul_left_comm]
      refine' (mul_le_mul_left' hab _).trans _
      rwa [mul_left_comm, mul_left_comm (b.2 : α), mul_le_mul_iff_left]
  le_antisymm a b := by
    induction' a using Localization.rec with a₁ a₂
    induction' b using Localization.rec with b₁ b₂
    simp_rw [mk_le_mk, mk_eq_mk_iff, r_iff_exists]
    exact fun hab hba => ⟨1, by rw [hab.antisymm hba]⟩
    all_goals intros; 

Proof state:
case f.H
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁✝ b₁ : α
a₂✝ b₂ : ↥s
b : Localization s
a₁ : α
a₂ : ↥s
a✝ c✝ : α
b✝ d✝ : ↥s
h✝ : (r s) (a✝, b✝) (c✝, d✝)
⊢ (_ : mk a₁ a₂ ≤ mk c✝ d✝ → mk c✝ d✝ ≤ mk a₁ a₂ → mk a₁ a₂ = mk c✝ d✝) =
    (_ : mk a₁ a₂ ≤ mk c✝ d✝ → mk c✝ d✝ ≤ mk a₁ a₂ → mk a₁ a₂ = mk c✝ d✝)

Next tactic:
rfl
@[to_additive]
instance partialOrder : PartialOrder (Localization s) where
  le := (· ≤ ·)
  lt := (· < ·)
  le_refl a := Localization.induction_on a fun a => le_rfl
  le_trans a b c :=
    Localization.induction_on₃ a b c fun a b c hab hbc => by
      simp only [mk_le_mk] at hab hbc ⊢
      refine' le_of_mul_le_mul_left' _
      · exact ↑b.2
      rw [mul_left_comm]
      refine' (mul_le_mul_left' hab _).trans _
      rwa [mul_left_comm, mul_left_comm (b.2 : α), mul_le_mul_iff_left]
  le_antisymm a b := by
    induction' a using Localization.rec with a₁ a₂
    induction' b using Localization.rec with b₁ b₂
    simp_rw [mk_le_mk, mk_eq_mk_iff, r_iff_exists]
    exact fun hab hba => ⟨1, by rw [hab.antisymm hba]⟩
    all_goals 

Proof state:
case H
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁ b₁ : α
a₂ b₂ : ↥s
a b : Localization s
a✝ c✝ : α
b✝ d✝ : ↥s
h✝ : (r s) (a✝, b✝) (c✝, d✝)
⊢ (_ : mk c✝ d✝ ≤ b → b ≤ mk c✝ d✝ → mk c✝ d✝ = b) = (_ : mk c✝ d✝ ≤ b → b ≤ mk c✝ d✝ → mk c✝ d✝ = b)

Next tactic:
intros
@[to_additive]
instance partialOrder : PartialOrder (Localization s) where
  le := (· ≤ ·)
  lt := (· < ·)
  le_refl a := Localization.induction_on a fun a => le_rfl
  le_trans a b c :=
    Localization.induction_on₃ a b c fun a b c hab hbc => by
      simp only [mk_le_mk] at hab hbc ⊢
      refine' le_of_mul_le_mul_left' _
      · exact ↑b.2
      rw [mul_left_comm]
      refine' (mul_le_mul_left' hab _).trans _
      rwa [mul_left_comm, mul_left_comm (b.2 : α), mul_le_mul_iff_left]
  le_antisymm a b := by
    induction' a using Localization.rec with a₁ a₂
    induction' b using Localization.rec with b₁ b₂
    simp_rw [mk_le_mk, mk_eq_mk_iff, r_iff_exists]
    exact fun hab hba => ⟨1, by rw [hab.antisymm hba]⟩
    all_goals intros; 

Proof state:
case H
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁ b₁ : α
a₂ b₂ : ↥s
a b : Localization s
a✝ c✝ : α
b✝ d✝ : ↥s
h✝ : (r s) (a✝, b✝) (c✝, d✝)
⊢ (_ : mk c✝ d✝ ≤ b → b ≤ mk c✝ d✝ → mk c✝ d✝ = b) = (_ : mk c✝ d✝ ≤ b → b ≤ mk c✝ d✝ → mk c✝ d✝ = b)

Next tactic:
rfl
@[to_additive]
instance orderedCancelCommMonoid : OrderedCancelCommMonoid (Localization s) :=
  { Localization.commMonoid s,
    Localization.partialOrder with
    mul_le_mul_left := fun a b =>
      Localization.induction_on₂ a b fun a b hab c =>
        Localization.induction_on c fun c => by
          

Proof state:
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁ b₁ : α
a₂ b₂ : ↥s
src✝¹ : CommMonoid (Localization s) := commMonoid s
src✝ : PartialOrder (Localization s) := partialOrder
a✝ b✝ : Localization s
a b : α × ↥s
hab : mk a.1 a.2 ≤ mk b.1 b.2
c✝ : Localization s
c : α × ↥s
⊢ mk c.1 c.2 * mk a.1 a.2 ≤ mk c.1 c.2 * mk b.1 b.2

Next tactic:
simp only [mk_mul, mk_le_mk, Submonoid.coe_mul, mul_mul_mul_comm _ _ c.1] at hab ⊢
@[to_additive]
instance orderedCancelCommMonoid : OrderedCancelCommMonoid (Localization s) :=
  { Localization.commMonoid s,
    Localization.partialOrder with
    mul_le_mul_left := fun a b =>
      Localization.induction_on₂ a b fun a b hab c =>
        Localization.induction_on c fun c => by
          simp only [mk_mul, mk_le_mk, Submonoid.coe_mul, mul_mul_mul_comm _ _ c.1] at hab ⊢
          

Proof state:
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁ b₁ : α
a₂ b₂ : ↥s
src✝¹ : CommMonoid (Localization s) := commMonoid s
src✝ : PartialOrder (Localization s) := partialOrder
a✝ b✝ : Localization s
a b : α × ↥s
c✝ : Localization s
c : α × ↥s
hab : ↑b.2 * a.1 ≤ ↑a.2 * b.1
⊢ ↑c.2 * c.1 * (↑b.2 * a.1) ≤ ↑c.2 * c.1 * (↑a.2 * b.1)

Next tactic:
exact mul_le_mul_left' hab _
@[to_additive]
instance orderedCancelCommMonoid : OrderedCancelCommMonoid (Localization s) :=
  { Localization.commMonoid s,
    Localization.partialOrder with
    mul_le_mul_left := fun a b =>
      Localization.induction_on₂ a b fun a b hab c =>
        Localization.induction_on c fun c => by
          simp only [mk_mul, mk_le_mk, Submonoid.coe_mul, mul_mul_mul_comm _ _ c.1] at hab ⊢
          exact mul_le_mul_left' hab _
    le_of_mul_le_mul_left := fun a b c =>
      Localization.induction_on₃ a b c fun a b c hab => by
        

Proof state:
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁ b₁ : α
a₂ b₂ : ↥s
src✝¹ : CommMonoid (Localization s) := commMonoid s
src✝ : PartialOrder (Localization s) := partialOrder
a✝ b✝ c✝ : Localization s
a b c : α × ↥s
hab : mk a.1 a.2 * mk b.1 b.2 ≤ mk a.1 a.2 * mk c.1 c.2
⊢ mk b.1 b.2 ≤ mk c.1 c.2

Next tactic:
simp only [mk_mul, mk_le_mk, Submonoid.coe_mul, mul_mul_mul_comm _ _ a.1] at hab ⊢
@[to_additive]
instance orderedCancelCommMonoid : OrderedCancelCommMonoid (Localization s) :=
  { Localization.commMonoid s,
    Localization.partialOrder with
    mul_le_mul_left := fun a b =>
      Localization.induction_on₂ a b fun a b hab c =>
        Localization.induction_on c fun c => by
          simp only [mk_mul, mk_le_mk, Submonoid.coe_mul, mul_mul_mul_comm _ _ c.1] at hab ⊢
          exact mul_le_mul_left' hab _
    le_of_mul_le_mul_left := fun a b c =>
      Localization.induction_on₃ a b c fun a b c hab => by
        simp only [mk_mul, mk_le_mk, Submonoid.coe_mul, mul_mul_mul_comm _ _ a.1] at hab ⊢
        

Proof state:
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁ b₁ : α
a₂ b₂ : ↥s
src✝¹ : CommMonoid (Localization s) := commMonoid s
src✝ : PartialOrder (Localization s) := partialOrder
a✝ b✝ c✝ : Localization s
a b c : α × ↥s
hab : ↑a.2 * a.1 * (↑c.2 * b.1) ≤ ↑a.2 * a.1 * (↑b.2 * c.1)
⊢ ↑c.2 * b.1 ≤ ↑b.2 * c.1

Next tactic:
exact le_of_mul_le_mul_left' hab
/-- An ordered cancellative monoid injects into its localization by sending `a` to `a / b`. -/
@[to_additive (attr := simps!) "An ordered cancellative monoid injects into its localization by
sending `a` to `a - b`."]
def mkOrderEmbedding (b : s) : α ↪o Localization s where
  toFun a := mk a b
  inj' := mk_left_injective _
  map_rel_iff' {a b} := by 

Proof state:
α : Type u_1
inst✝ : OrderedCancelCommMonoid α
s : Submonoid α
a₁ b₁ : α
a₂ b₂ b✝ : ↥s
a b : α
⊢ { toFun := fun a => mk a b✝, inj' := (_ : Injective fun a => mk a b✝) } a ≤
      { toFun := fun a => mk a b✝, inj' := (_ : Injective fun a => mk a b✝) } b ↔
    a ≤ b

Next tactic:
simp [-mk_eq_monoidOf_mk', mk_le_mk]