l3lab/ntp-mathlib huggingface dataset:
theorem star_ne_zero [AddMonoid R] [StarAddMonoid R] {x : R} : star x ≠ 0 ↔ x ≠ 0 := by
  

Proof state:
R : Type u
inst✝¹ : AddMonoid R
inst✝ : StarAddMonoid R
x : R
⊢ star x ≠ 0 ↔ x ≠ 0

Next tactic:
simp only [ne_eq, star_eq_zero]
instance RingHom.involutiveStar {S : Type*} [NonAssocSemiring S] [CommSemiring R] [StarRing R] :
    InvolutiveStar (S →+* R) where
  toStar := { star := fun f => RingHom.comp (starRingEnd R) f }
  star_involutive := by
    

Proof state:
R : Type u
S : Type u_1
inst✝² : NonAssocSemiring S
inst✝¹ : CommSemiring R
inst✝ : StarRing R
⊢ Function.Involutive star

Next tactic:
intro
instance RingHom.involutiveStar {S : Type*} [NonAssocSemiring S] [CommSemiring R] [StarRing R] :
    InvolutiveStar (S →+* R) where
  toStar := { star := fun f => RingHom.comp (starRingEnd R) f }
  star_involutive := by
    intro
    

Proof state:
R : Type u
S : Type u_1
inst✝² : NonAssocSemiring S
inst✝¹ : CommSemiring R
inst✝ : StarRing R
x✝ : S →+* R
⊢ star (star x✝) = x✝

Next tactic:
ext
instance RingHom.involutiveStar {S : Type*} [NonAssocSemiring S] [CommSemiring R] [StarRing R] :
    InvolutiveStar (S →+* R) where
  toStar := { star := fun f => RingHom.comp (starRingEnd R) f }
  star_involutive := by
    intro
    ext
    

Proof state:
case a
R : Type u
S : Type u_1
inst✝² : NonAssocSemiring S
inst✝¹ : CommSemiring R
inst✝ : StarRing R
x✝¹ : S →+* R
x✝ : S
⊢ (star (star x✝¹)) x✝ = x✝¹ x✝

Next tactic:
simp only [RingHom.coe_comp, Function.comp_apply, starRingEnd_self_apply]
/-- When multiplication is commutative, `star` preserves division. -/
@[simp]
theorem star_div' [Semifield R] [StarRing R] (x y : R) : star (x / y) = star x / star y := by
  

Proof state:
R : Type u
inst✝¹ : Semifield R
inst✝ : StarRing R
x y : R
⊢ star (x / y) = star x / star y

Next tactic:
apply op_injective
/-- When multiplication is commutative, `star` preserves division. -/
@[simp]
theorem star_div' [Semifield R] [StarRing R] (x y : R) : star (x / y) = star x / star y := by
  apply op_injective
  

Proof state:
case a
R : Type u
inst✝¹ : Semifield R
inst✝ : StarRing R
x y : R
⊢ op (star (x / y)) = op (star x / star y)

Next tactic:
rw [division_def, op_div, mul_comm, star_mul, star_inv', op_mul, op_inv]
@[simp]
theorem star_bit0 [AddMonoid R] [StarAddMonoid R] (r : R) : star (bit0 r) = bit0 (star r) := by
  

Proof state:
R : Type u
inst✝¹ : AddMonoid R
inst✝ : StarAddMonoid R
r : R
⊢ star (bit0 r) = bit0 (star r)

Next tactic:
simp [bit0]
@[simp]
theorem star_bit1 [Semiring R] [StarRing R] (r : R) : star (bit1 r) = bit1 (star r) := by
  

Proof state:
R : Type u
inst✝¹ : Semiring R
inst✝ : StarRing R
r : R
⊢ star (bit1 r) = bit1 (star r)

Next tactic:
simp [bit1]
theorem Ring.inverse_star [Semiring R] [StarRing R] (a : R) :
    Ring.inverse (star a) = star (Ring.inverse a) := by
  

Proof state:
R : Type u
inst✝¹ : Semiring R
inst✝ : StarRing R
a : R
⊢ inverse (star a) = star (inverse a)

Next tactic:
by_cases ha : IsUnit a
theorem Ring.inverse_star [Semiring R] [StarRing R] (a : R) :
    Ring.inverse (star a) = star (Ring.inverse a) := by
  by_cases ha : IsUnit a
  · 

Proof state:
case pos
R : Type u
inst✝¹ : Semiring R
inst✝ : StarRing R
a : R
ha : IsUnit a
⊢ inverse (star a) = star (inverse a)

Next tactic:
obtain ⟨u, rfl⟩ := ha
theorem Ring.inverse_star [Semiring R] [StarRing R] (a : R) :
    Ring.inverse (star a) = star (Ring.inverse a) := by
  by_cases ha : IsUnit a
  · obtain ⟨u, rfl⟩ := ha
    

Proof state:
case pos.intro
R : Type u
inst✝¹ : Semiring R
inst✝ : StarRing R
u : Rˣ
⊢ inverse (star ↑u) = star (inverse ↑u)

Next tactic:
rw [Ring.inverse_unit, ← Units.coe_star, Ring.inverse_unit, ← Units.coe_star_inv]
theorem Ring.inverse_star [Semiring R] [StarRing R] (a : R) :
    Ring.inverse (star a) = star (Ring.inverse a) := by
  by_cases ha : IsUnit a
  · obtain ⟨u, rfl⟩ := ha
    rw [Ring.inverse_unit, ← Units.coe_star, Ring.inverse_unit, ← Units.coe_star_inv]
  

Proof state:
case neg
R : Type u
inst✝¹ : Semiring R
inst✝ : StarRing R
a : R
ha : ¬IsUnit a
⊢ inverse (star a) = star (inverse a)

Next tactic:
rw [Ring.inverse_non_unit _ ha, Ring.inverse_non_unit _ (mt isUnit_star.mp ha), star_zero]
instance Invertible.star {R : Type*} [MulOneClass R] [StarMul R] (r : R) [Invertible r] :
    Invertible (star r) where
  invOf := Star.star (⅟ r)
  invOf_mul_self := by 

Proof state:
R✝ : Type u
R : Type u_1
inst✝² : MulOneClass R
inst✝¹ : StarMul R
r : R
inst✝ : Invertible r
⊢ Star.star ⅟r * Star.star r = 1

Next tactic:
rw [← star_mul, mul_invOf_self, star_one]
instance Invertible.star {R : Type*} [MulOneClass R] [StarMul R] (r : R) [Invertible r] :
    Invertible (star r) where
  invOf := Star.star (⅟ r)
  invOf_mul_self := by rw [← star_mul, mul_invOf_self, star_one]
  mul_invOf_self := by 

Proof state:
R✝ : Type u
R : Type u_1
inst✝² : MulOneClass R
inst✝¹ : StarMul R
r : R
inst✝ : Invertible r
⊢ Star.star r * Star.star ⅟r = 1

Next tactic:
rw [← star_mul, invOf_mul_self, star_one]
theorem star_invOf {R : Type*} [Monoid R] [StarMul R] (r : R) [Invertible r]
    [Invertible (star r)] : star (⅟ r) = ⅟ (star r) := by
  

Proof state:
R✝ : Type u
R : Type u_1
inst✝³ : Monoid R
inst✝² : StarMul R
r : R
inst✝¹ : Invertible r
inst✝ : Invertible (star r)
⊢ star ⅟r = ⅟(star r)

Next tactic:
have : star (⅟ r) = star (⅟ r) * ((star r) * ⅟ (star r)) := by
    simp only [mul_invOf_self, mul_one]
theorem star_invOf {R : Type*} [Monoid R] [StarMul R] (r : R) [Invertible r]
    [Invertible (star r)] : star (⅟ r) = ⅟ (star r) := by
  have : star (⅟ r) = star (⅟ r) * ((star r) * ⅟ (star r)) := by
    

Proof state:
R✝ : Type u
R : Type u_1
inst✝³ : Monoid R
inst✝² : StarMul R
r : R
inst✝¹ : Invertible r
inst✝ : Invertible (star r)
⊢ star ⅟r = star ⅟r * (star r * ⅟(star r))

Next tactic:
simp only [mul_invOf_self, mul_one]
theorem star_invOf {R : Type*} [Monoid R] [StarMul R] (r : R) [Invertible r]
    [Invertible (star r)] : star (⅟ r) = ⅟ (star r) := by
  have : star (⅟ r) = star (⅟ r) * ((star r) * ⅟ (star r)) := by
    simp only [mul_invOf_self, mul_one]
  

Proof state:
R✝ : Type u
R : Type u_1
inst✝³ : Monoid R
inst✝² : StarMul R
r : R
inst✝¹ : Invertible r
inst✝ : Invertible (star r)
this : star ⅟r = star ⅟r * (star r * ⅟(star r))
⊢ star ⅟r = ⅟(star r)

Next tactic:
rw [this, ← mul_assoc]
theorem star_invOf {R : Type*} [Monoid R] [StarMul R] (r : R) [Invertible r]
    [Invertible (star r)] : star (⅟ r) = ⅟ (star r) := by
  have : star (⅟ r) = star (⅟ r) * ((star r) * ⅟ (star r)) := by
    simp only [mul_invOf_self, mul_one]
  rw [this, ← mul_assoc]
  

Proof state:
R✝ : Type u
R : Type u_1
inst✝³ : Monoid R
inst✝² : StarMul R
r : R
inst✝¹ : Invertible r
inst✝ : Invertible (star r)
this : star ⅟r = star ⅟r * (star r * ⅟(star r))
⊢ star ⅟r * star r * ⅟(star r) = ⅟(star r)

Next tactic:
have : (star (⅟ r)) * (star r) = star 1 := by rw [← star_mul, mul_invOf_self]
theorem star_invOf {R : Type*} [Monoid R] [StarMul R] (r : R) [Invertible r]
    [Invertible (star r)] : star (⅟ r) = ⅟ (star r) := by
  have : star (⅟ r) = star (⅟ r) * ((star r) * ⅟ (star r)) := by
    simp only [mul_invOf_self, mul_one]
  rw [this, ← mul_assoc]
  have : (star (⅟ r)) * (star r) = star 1 := by 

Proof state:
R✝ : Type u
R : Type u_1
inst✝³ : Monoid R
inst✝² : StarMul R
r : R
inst✝¹ : Invertible r
inst✝ : Invertible (star r)
this : star ⅟r = star ⅟r * (star r * ⅟(star r))
⊢ star ⅟r * star r = star 1

Next tactic:
rw [← star_mul, mul_invOf_self]
theorem star_invOf {R : Type*} [Monoid R] [StarMul R] (r : R) [Invertible r]
    [Invertible (star r)] : star (⅟ r) = ⅟ (star r) := by
  have : star (⅟ r) = star (⅟ r) * ((star r) * ⅟ (star r)) := by
    simp only [mul_invOf_self, mul_one]
  rw [this, ← mul_assoc]
  have : (star (⅟ r)) * (star r) = star 1 := by rw [← star_mul, mul_invOf_self]
  

Proof state:
R✝ : Type u
R : Type u_1
inst✝³ : Monoid R
inst✝² : StarMul R
r : R
inst✝¹ : Invertible r
inst✝ : Invertible (star r)
this✝ : star ⅟r = star ⅟r * (star r * ⅟(star r))
this : star ⅟r * star r = star 1
⊢ star ⅟r * star r * ⅟(star r) = ⅟(star r)

Next tactic:
rw [this, star_one, one_mul]
/-- Assumes left covariance. -/
theorem Left.mul_pos [PosMulStrictMono α] (ha : 0 < a) (hb : 0 < b) : 0 < a * b := by
  

Proof state:
α : Type u_1
a b c d : α
inst✝² : MulZeroClass α
inst✝¹ : Preorder α
inst✝ : PosMulStrictMono α
ha : 0 < a
hb : 0 < b
⊢ 0 < a * b

Next tactic:
simpa only [mul_zero] using mul_lt_mul_of_pos_left hb ha
theorem mul_neg_of_pos_of_neg [PosMulStrictMono α] (ha : 0 < a) (hb : b < 0) : a * b < 0 := by
  

Proof state:
α : Type u_1
a b c d : α
inst✝² : MulZeroClass α
inst✝¹ : Preorder α
inst✝ : PosMulStrictMono α
ha : 0 < a
hb : b < 0
⊢ a * b < 0

Next tactic:
simpa only [mul_zero] using mul_lt_mul_of_pos_left hb ha
@[simp]
theorem zero_lt_mul_left [PosMulStrictMono α] [PosMulReflectLT α] (h : 0 < c) :
    0 < c * b ↔ 0 < b := by
  

Proof state:
α : Type u_1
a b c d : α
inst✝³ : MulZeroClass α
inst✝² : Preorder α
inst✝¹ : PosMulStrictMono α
inst✝ : PosMulReflectLT α
h : 0 < c
⊢ 0 < c * b ↔ 0 < b

Next tactic:
rw [← mul_zero c, mul_lt_mul_left h]
@[simp]
theorem zero_lt_mul_left [PosMulStrictMono α] [PosMulReflectLT α] (h : 0 < c) :
    0 < c * b ↔ 0 < b := by
  rw [← mul_zero c, mul_lt_mul_left h]
  

Proof state:
α : Type u_1
a b c d : α
inst✝³ : MulZeroClass α
inst✝² : Preorder α
inst✝¹ : PosMulStrictMono α
inst✝ : PosMulReflectLT α
h : 0 < c
⊢ 0 < b ↔ c * 0 < b

Next tactic:
simp
/-- Assumes right covariance. -/
theorem Right.mul_pos [MulPosStrictMono α] (ha : 0 < a) (hb : 0 < b) : 0 < a * b := by
  

Proof state:
α : Type u_1
a b c d : α
inst✝² : MulZeroClass α
inst✝¹ : Preorder α
inst✝ : MulPosStrictMono α
ha : 0 < a
hb : 0 < b
⊢ 0 < a * b

Next tactic:
simpa only [zero_mul] using mul_lt_mul_of_pos_right ha hb
theorem mul_neg_of_neg_of_pos [MulPosStrictMono α] (ha : a < 0) (hb : 0 < b) : a * b < 0 := by
  

Proof state:
α : Type u_1
a b c d : α
inst✝² : MulZeroClass α
inst✝¹ : Preorder α
inst✝ : MulPosStrictMono α
ha : a < 0
hb : 0 < b
⊢ a * b < 0

Next tactic:
simpa only [zero_mul] using mul_lt_mul_of_pos_right ha hb
@[simp]
theorem zero_lt_mul_right [MulPosStrictMono α] [MulPosReflectLT α] (h : 0 < c) :
    0 < b * c ↔ 0 < b := by
  

Proof state:
α : Type u_1
a b c d : α
inst✝³ : MulZeroClass α
inst✝² : Preorder α
inst✝¹ : MulPosStrictMono α
inst✝ : MulPosReflectLT α
h : 0 < c
⊢ 0 < b * c ↔ 0 < b

Next tactic:
rw [← zero_mul c, mul_lt_mul_right h]
@[simp]
theorem zero_lt_mul_right [MulPosStrictMono α] [MulPosReflectLT α] (h : 0 < c) :
    0 < b * c ↔ 0 < b := by
  rw [← zero_mul c, mul_lt_mul_right h]
  

Proof state:
α : Type u_1
a b c d : α
inst✝³ : MulZeroClass α
inst✝² : Preorder α
inst✝¹ : MulPosStrictMono α
inst✝ : MulPosReflectLT α
h : 0 < c
⊢ 0 < b ↔ 0 * c < b

Next tactic:
simp
/-- Assumes left covariance. -/
theorem Left.mul_nonneg [PosMulMono α] (ha : 0 ≤ a) (hb : 0 ≤ b) : 0 ≤ a * b := by
  

Proof state:
α : Type u_1
a b c d : α
inst✝² : MulZeroClass α
inst✝¹ : Preorder α
inst✝ : PosMulMono α
ha : 0 ≤ a
hb : 0 ≤ b
⊢ 0 ≤ a * b

Next tactic:
simpa only [mul_zero] using mul_le_mul_of_nonneg_left hb ha
theorem mul_nonpos_of_nonneg_of_nonpos [PosMulMono α] (ha : 0 ≤ a) (hb : b ≤ 0) : a * b ≤ 0 := by
  

Proof state:
α : Type u_1
a b c d : α
inst✝² : MulZeroClass α
inst✝¹ : Preorder α
inst✝ : PosMulMono α
ha : 0 ≤ a
hb : b ≤ 0
⊢ a * b ≤ 0

Next tactic:
simpa only [mul_zero] using mul_le_mul_of_nonneg_left hb ha
/-- Assumes right covariance. -/
theorem Right.mul_nonneg [MulPosMono α] (ha : 0 ≤ a) (hb : 0 ≤ b) : 0 ≤ a * b := by
  

Proof state:
α : Type u_1
a b c d : α
inst✝² : MulZeroClass α
inst✝¹ : Preorder α
inst✝ : MulPosMono α
ha : 0 ≤ a
hb : 0 ≤ b
⊢ 0 ≤ a * b

Next tactic:
simpa only [zero_mul] using mul_le_mul_of_nonneg_right ha hb
theorem mul_nonpos_of_nonpos_of_nonneg [MulPosMono α] (ha : a ≤ 0) (hb : 0 ≤ b) : a * b ≤ 0 := by
  

Proof state:
α : Type u_1
a b c d : α
inst✝² : MulZeroClass α
inst✝¹ : Preorder α
inst✝ : MulPosMono α
ha : a ≤ 0
hb : 0 ≤ b
⊢ a * b ≤ 0

Next tactic:
simpa only [zero_mul] using mul_le_mul_of_nonneg_right ha hb
theorem posMulMono_iff_covariant_pos :
    PosMulMono α ↔ CovariantClass α>0 α (fun x y => x * y) (· ≤ ·) :=
  ⟨@PosMulMono.to_covariantClass_pos_mul_le _ _ _ _, fun h =>
    ⟨fun a b c h => by
      

Proof state:
α : Type u_1
a✝ b✝ c✝ d : α
inst✝¹ : MulZeroClass α
inst✝ : PartialOrder α
h✝ : CovariantClass { x // 0 < x } α (fun x y => ↑x * y) fun x x_1 => x ≤ x_1
a : { x // 0 ≤ x }
b c : α
h : b ≤ c
⊢ ↑a * b ≤ ↑a * c

Next tactic:
obtain ha | ha := a.prop.eq_or_lt
theorem posMulMono_iff_covariant_pos :
    PosMulMono α ↔ CovariantClass α>0 α (fun x y => x * y) (· ≤ ·) :=
  ⟨@PosMulMono.to_covariantClass_pos_mul_le _ _ _ _, fun h =>
    ⟨fun a b c h => by
      obtain ha | ha := a.prop.eq_or_lt
      · 

Proof state:
case inl
α : Type u_1
a✝ b✝ c✝ d : α
inst✝¹ : MulZeroClass α
inst✝ : PartialOrder α
h✝ : CovariantClass { x // 0 < x } α (fun x y => ↑x * y) fun x x_1 => x ≤ x_1
a : { x // 0 ≤ x }
b c : α
h : b ≤ c
ha : 0 = ↑a
⊢ ↑a * b ≤ ↑a * c

Next tactic:
simp [← ha]
theorem posMulMono_iff_covariant_pos :
    PosMulMono α ↔ CovariantClass α>0 α (fun x y => x * y) (· ≤ ·) :=
  ⟨@PosMulMono.to_covariantClass_pos_mul_le _ _ _ _, fun h =>
    ⟨fun a b c h => by
      obtain ha | ha := a.prop.eq_or_lt
      · simp [← ha]
      · 

Proof state:
case inr
α : Type u_1
a✝ b✝ c✝ d : α
inst✝¹ : MulZeroClass α
inst✝ : PartialOrder α
h✝ : CovariantClass { x // 0 < x } α (fun x y => ↑x * y) fun x x_1 => x ≤ x_1
a : { x // 0 ≤ x }
b c : α
h : b ≤ c
ha : 0 < ↑a
⊢ ↑a * b ≤ ↑a * c

Next tactic:
exact @CovariantClass.elim α>0 α (fun x y => x * y) (· ≤ ·) _ ⟨_, ha⟩ _ _ h
theorem mulPosMono_iff_covariant_pos :
    MulPosMono α ↔ CovariantClass α>0 α (fun x y => y * x) (· ≤ ·) :=
  ⟨@MulPosMono.to_covariantClass_pos_mul_le _ _ _ _, fun h =>
    ⟨fun a b c h => by
      

Proof state:
α : Type u_1
a✝ b✝ c✝ d : α
inst✝¹ : MulZeroClass α
inst✝ : PartialOrder α
h✝ : CovariantClass { x // 0 < x } α (fun x y => y * ↑x) fun x x_1 => x ≤ x_1
a : { x // 0 ≤ x }
b c : α
h : b ≤ c
⊢ b * ↑a ≤ c * ↑a

Next tactic:
obtain ha | ha := a.prop.eq_or_lt
theorem mulPosMono_iff_covariant_pos :
    MulPosMono α ↔ CovariantClass α>0 α (fun x y => y * x) (· ≤ ·) :=
  ⟨@MulPosMono.to_covariantClass_pos_mul_le _ _ _ _, fun h =>
    ⟨fun a b c h => by
      obtain ha | ha := a.prop.eq_or_lt
      · 

Proof state:
case inl
α : Type u_1
a✝ b✝ c✝ d : α
inst✝¹ : MulZeroClass α
inst✝ : PartialOrder α
h✝ : CovariantClass { x // 0 < x } α (fun x y => y * ↑x) fun x x_1 => x ≤ x_1
a : { x // 0 ≤ x }
b c : α
h : b ≤ c
ha : 0 = ↑a
⊢ b * ↑a ≤ c * ↑a

Next tactic:
simp [← ha]
theorem mulPosMono_iff_covariant_pos :
    MulPosMono α ↔ CovariantClass α>0 α (fun x y => y * x) (· ≤ ·) :=
  ⟨@MulPosMono.to_covariantClass_pos_mul_le _ _ _ _, fun h =>
    ⟨fun a b c h => by
      obtain ha | ha := a.prop.eq_or_lt
      · simp [← ha]
      · 

Proof state:
case inr
α : Type u_1
a✝ b✝ c✝ d : α
inst✝¹ : MulZeroClass α
inst✝ : PartialOrder α
h✝ : CovariantClass { x // 0 < x } α (fun x y => y * ↑x) fun x x_1 => x ≤ x_1
a : { x // 0 ≤ x }
b c : α
h : b ≤ c
ha : 0 < ↑a
⊢ b * ↑a ≤ c * ↑a

Next tactic:
exact @CovariantClass.elim α>0 α (fun x y => y * x) (· ≤ ·) _ ⟨_, ha⟩ _ _ h
theorem posMulReflectLT_iff_contravariant_pos :
    PosMulReflectLT α ↔ ContravariantClass α>0 α (fun x y => x * y) (· < ·) :=
  ⟨@PosMulReflectLT.to_contravariantClass_pos_mul_lt _ _ _ _, fun h =>
    ⟨fun a b c h => by
      

Proof state:
α : Type u_1
a✝ b✝ c✝ d : α
inst✝¹ : MulZeroClass α
inst✝ : PartialOrder α
h✝ : ContravariantClass { x // 0 < x } α (fun x y => ↑x * y) fun x x_1 => x < x_1
a : { x // 0 ≤ x }
b c : α
h : ↑a * b < ↑a * c
⊢ b < c

Next tactic:
obtain ha | ha := a.prop.eq_or_lt
theorem posMulReflectLT_iff_contravariant_pos :
    PosMulReflectLT α ↔ ContravariantClass α>0 α (fun x y => x * y) (· < ·) :=
  ⟨@PosMulReflectLT.to_contravariantClass_pos_mul_lt _ _ _ _, fun h =>
    ⟨fun a b c h => by
      obtain ha | ha := a.prop.eq_or_lt
      · 

Proof state:
case inl
α : Type u_1
a✝ b✝ c✝ d : α
inst✝¹ : MulZeroClass α
inst✝ : PartialOrder α
h✝ : ContravariantClass { x // 0 < x } α (fun x y => ↑x * y) fun x x_1 => x < x_1
a : { x // 0 ≤ x }
b c : α
h : ↑a * b < ↑a * c
ha : 0 = ↑a
⊢ b < c

Next tactic:
simp [← ha] at h
theorem posMulReflectLT_iff_contravariant_pos :
    PosMulReflectLT α ↔ ContravariantClass α>0 α (fun x y => x * y) (· < ·) :=
  ⟨@PosMulReflectLT.to_contravariantClass_pos_mul_lt _ _ _ _, fun h =>
    ⟨fun a b c h => by
      obtain ha | ha := a.prop.eq_or_lt
      · simp [← ha] at h
      · 

Proof state:
case inr
α : Type u_1
a✝ b✝ c✝ d : α
inst✝¹ : MulZeroClass α
inst✝ : PartialOrder α
h✝ : ContravariantClass { x // 0 < x } α (fun x y => ↑x * y) fun x x_1 => x < x_1
a : { x // 0 ≤ x }
b c : α
h : ↑a * b < ↑a * c
ha : 0 < ↑a
⊢ b < c

Next tactic:
exact @ContravariantClass.elim α>0 α (fun x y => x * y) (· < ·) _ ⟨_, ha⟩ _ _ h
theorem mulPosReflectLT_iff_contravariant_pos :
    MulPosReflectLT α ↔ ContravariantClass α>0 α (fun x y => y * x) (· < ·) :=
  ⟨@MulPosReflectLT.to_contravariantClass_pos_mul_lt _ _ _ _, fun h =>
    ⟨fun a b c h => by
      

Proof state:
α : Type u_1
a✝ b✝ c✝ d : α
inst✝¹ : MulZeroClass α
inst✝ : PartialOrder α
h✝ : ContravariantClass { x // 0 < x } α (fun x y => y * ↑x) fun x x_1 => x < x_1
a : { x // 0 ≤ x }
b c : α
h : b * ↑a < c * ↑a
⊢ b < c

Next tactic:
obtain ha | ha := a.prop.eq_or_lt
theorem mulPosReflectLT_iff_contravariant_pos :
    MulPosReflectLT α ↔ ContravariantClass α>0 α (fun x y => y * x) (· < ·) :=
  ⟨@MulPosReflectLT.to_contravariantClass_pos_mul_lt _ _ _ _, fun h =>
    ⟨fun a b c h => by
      obtain ha | ha := a.prop.eq_or_lt
      · 

Proof state:
case inl
α : Type u_1
a✝ b✝ c✝ d : α
inst✝¹ : MulZeroClass α
inst✝ : PartialOrder α
h✝ : ContravariantClass { x // 0 < x } α (fun x y => y * ↑x) fun x x_1 => x < x_1
a : { x // 0 ≤ x }
b c : α
h : b * ↑a < c * ↑a
ha : 0 = ↑a
⊢ b < c

Next tactic:
simp [← ha] at h
theorem mulPosReflectLT_iff_contravariant_pos :
    MulPosReflectLT α ↔ ContravariantClass α>0 α (fun x y => y * x) (· < ·) :=
  ⟨@MulPosReflectLT.to_contravariantClass_pos_mul_lt _ _ _ _, fun h =>
    ⟨fun a b c h => by
      obtain ha | ha := a.prop.eq_or_lt
      · simp [← ha] at h
      · 

Proof state:
case inr
α : Type u_1
a✝ b✝ c✝ d : α
inst✝¹ : MulZeroClass α
inst✝ : PartialOrder α
h✝ : ContravariantClass { x // 0 < x } α (fun x y => y * ↑x) fun x x_1 => x < x_1
a : { x // 0 ≤ x }
b c : α
h : b * ↑a < c * ↑a
ha : 0 < ↑a
⊢ b < c

Next tactic:
exact @ContravariantClass.elim α>0 α (fun x y => y * x) (· < ·) _ ⟨_, ha⟩ _ _ h
instance (priority := 100) PosMulReflectLE.toPosMulReflectLT [PosMulReflectLE α] :
    PosMulReflectLT α :=
  posMulReflectLT_iff_contravariant_pos.2
    ⟨fun a b c h =>
      (le_of_mul_le_mul_of_pos_left h.le a.2).lt_of_ne <| by
        

Proof state:
α : Type u_1
a✝ b✝ c✝ d : α
inst✝² : MulZeroClass α
inst✝¹ : PartialOrder α
inst✝ : PosMulReflectLE α
a : { x // 0 < x }
b c : α
h : ↑a * b < ↑a * c
⊢ b ≠ c

Next tactic:
rintro rfl
instance (priority := 100) PosMulReflectLE.toPosMulReflectLT [PosMulReflectLE α] :
    PosMulReflectLT α :=
  posMulReflectLT_iff_contravariant_pos.2
    ⟨fun a b c h =>
      (le_of_mul_le_mul_of_pos_left h.le a.2).lt_of_ne <| by
        rintro rfl
        

Proof state:
α : Type u_1
a✝ b✝ c d : α
inst✝² : MulZeroClass α
inst✝¹ : PartialOrder α
inst✝ : PosMulReflectLE α
a : { x // 0 < x }
b : α
h : ↑a * b < ↑a * b
⊢ False

Next tactic:
simp at h
instance (priority := 100) MulPosReflectLE.toMulPosReflectLT [MulPosReflectLE α] :
    MulPosReflectLT α :=
  mulPosReflectLT_iff_contravariant_pos.2
    ⟨fun a b c h =>
      (le_of_mul_le_mul_of_pos_right h.le a.2).lt_of_ne <| by
        

Proof state:
α : Type u_1
a✝ b✝ c✝ d : α
inst✝² : MulZeroClass α
inst✝¹ : PartialOrder α
inst✝ : MulPosReflectLE α
a : { x // 0 < x }
b c : α
h : b * ↑a < c * ↑a
⊢ b ≠ c

Next tactic:
rintro rfl
instance (priority := 100) MulPosReflectLE.toMulPosReflectLT [MulPosReflectLE α] :
    MulPosReflectLT α :=
  mulPosReflectLT_iff_contravariant_pos.2
    ⟨fun a b c h =>
      (le_of_mul_le_mul_of_pos_right h.le a.2).lt_of_ne <| by
        rintro rfl
        

Proof state:
α : Type u_1
a✝ b✝ c d : α
inst✝² : MulZeroClass α
inst✝¹ : PartialOrder α
inst✝ : MulPosReflectLE α
a : { x // 0 < x }
b : α
h : b * ↑a < b * ↑a
⊢ False

Next tactic:
simp at h
theorem mul_eq_mul_iff_eq_and_eq_of_pos [PosMulStrictMono α] [MulPosStrictMono α]
    (hab : a ≤ b) (hcd : c ≤ d) (a0 : 0 < a) (d0 : 0 < d) :
    a * c = b * d ↔ a = b ∧ c = d := by
  

Proof state:
α : Type u_1
a b c d : α
inst✝³ : MulZeroClass α
inst✝² : PartialOrder α
inst✝¹ : PosMulStrictMono α
inst✝ : MulPosStrictMono α
hab : a ≤ b
hcd : c ≤ d
a0 : 0 < a
d0 : 0 < d
⊢ a * c = b * d ↔ a = b ∧ c = d

Next tactic:
refine' ⟨fun h ↦ _, by rintro ⟨rfl, rfl⟩; rfl⟩
theorem mul_eq_mul_iff_eq_and_eq_of_pos [PosMulStrictMono α] [MulPosStrictMono α]
    (hab : a ≤ b) (hcd : c ≤ d) (a0 : 0 < a) (d0 : 0 < d) :
    a * c = b * d ↔ a = b ∧ c = d := by
  refine' ⟨fun h ↦ _, by 

Proof state:
α : Type u_1
a b c d : α
inst✝³ : MulZeroClass α
inst✝² : PartialOrder α
inst✝¹ : PosMulStrictMono α
inst✝ : MulPosStrictMono α
hab : a ≤ b
hcd : c ≤ d
a0 : 0 < a
d0 : 0 < d
⊢ a = b ∧ c = d → a * c = b * d

Next tactic:
rintro ⟨rfl, rfl⟩
theorem mul_eq_mul_iff_eq_and_eq_of_pos [PosMulStrictMono α] [MulPosStrictMono α]
    (hab : a ≤ b) (hcd : c ≤ d) (a0 : 0 < a) (d0 : 0 < d) :
    a * c = b * d ↔ a = b ∧ c = d := by
  refine' ⟨fun h ↦ _, by rintro ⟨rfl, rfl⟩; 

Proof state:
case intro
α : Type u_1
a c : α
inst✝³ : MulZeroClass α
inst✝² : PartialOrder α
inst✝¹ : PosMulStrictMono α
inst✝ : MulPosStrictMono α
a0 : 0 < a
hab : a ≤ a
hcd : c ≤ c
d0 : 0 < c
⊢ a * c = a * c

Next tactic:
rfl
theorem mul_eq_mul_iff_eq_and_eq_of_pos [PosMulStrictMono α] [MulPosStrictMono α]
    (hab : a ≤ b) (hcd : c ≤ d) (a0 : 0 < a) (d0 : 0 < d) :
    a * c = b * d ↔ a = b ∧ c = d := by
  refine' ⟨fun h ↦ _, by rintro ⟨rfl, rfl⟩; rfl⟩
  

Proof state:
α : Type u_1
a b c d : α
inst✝³ : MulZeroClass α
inst✝² : PartialOrder α
inst✝¹ : PosMulStrictMono α
inst✝ : MulPosStrictMono α
hab : a ≤ b
hcd : c ≤ d
a0 : 0 < a
d0 : 0 < d
h : a * c = b * d
⊢ a = b ∧ c = d

Next tactic:
simp only [eq_iff_le_not_lt, hab, hcd, true_and]
theorem mul_eq_mul_iff_eq_and_eq_of_pos [PosMulStrictMono α] [MulPosStrictMono α]
    (hab : a ≤ b) (hcd : c ≤ d) (a0 : 0 < a) (d0 : 0 < d) :
    a * c = b * d ↔ a = b ∧ c = d := by
  refine' ⟨fun h ↦ _, by rintro ⟨rfl, rfl⟩; rfl⟩
  simp only [eq_iff_le_not_lt, hab, hcd, true_and]
  

Proof state:
α : Type u_1
a b c d : α
inst✝³ : MulZeroClass α
inst✝² : PartialOrder α
inst✝¹ : PosMulStrictMono α
inst✝ : MulPosStrictMono α
hab : a ≤ b
hcd : c ≤ d
a0 : 0 < a
d0 : 0 < d
h : a * c = b * d
⊢ ¬a < b ∧ ¬c < d

Next tactic:
refine' ⟨fun hab ↦ h.not_lt _, fun hcd ↦ h.not_lt _⟩
theorem mul_eq_mul_iff_eq_and_eq_of_pos [PosMulStrictMono α] [MulPosStrictMono α]
    (hab : a ≤ b) (hcd : c ≤ d) (a0 : 0 < a) (d0 : 0 < d) :
    a * c = b * d ↔ a = b ∧ c = d := by
  refine' ⟨fun h ↦ _, by rintro ⟨rfl, rfl⟩; rfl⟩
  simp only [eq_iff_le_not_lt, hab, hcd, true_and]
  refine' ⟨fun hab ↦ h.not_lt _, fun hcd ↦ h.not_lt _⟩
  · 

Proof state:
case refine'_1
α : Type u_1
a b c d : α
inst✝³ : MulZeroClass α
inst✝² : PartialOrder α
inst✝¹ : PosMulStrictMono α
inst✝ : MulPosStrictMono α
hab✝ : a ≤ b
hcd : c ≤ d
a0 : 0 < a
d0 : 0 < d
h : a * c = b * d
hab : a < b
⊢ a * c < b * d

Next tactic:
exact (mul_le_mul_of_nonneg_left hcd a0.le).trans_lt (mul_lt_mul_of_pos_right hab d0)
theorem mul_eq_mul_iff_eq_and_eq_of_pos [PosMulStrictMono α] [MulPosStrictMono α]
    (hab : a ≤ b) (hcd : c ≤ d) (a0 : 0 < a) (d0 : 0 < d) :
    a * c = b * d ↔ a = b ∧ c = d := by
  refine' ⟨fun h ↦ _, by rintro ⟨rfl, rfl⟩; rfl⟩
  simp only [eq_iff_le_not_lt, hab, hcd, true_and]
  refine' ⟨fun hab ↦ h.not_lt _, fun hcd ↦ h.not_lt _⟩
  · exact (mul_le_mul_of_nonneg_left hcd a0.le).trans_lt (mul_lt_mul_of_pos_right hab d0)
  · 

Proof state:
case refine'_2
α : Type u_1
a b c d : α
inst✝³ : MulZeroClass α
inst✝² : PartialOrder α
inst✝¹ : PosMulStrictMono α
inst✝ : MulPosStrictMono α
hab : a ≤ b
hcd✝ : c ≤ d
a0 : 0 < a
d0 : 0 < d
h : a * c = b * d
hcd : c < d
⊢ a * c < b * d

Next tactic:
exact (mul_lt_mul_of_pos_left hcd a0).trans_le (mul_le_mul_of_nonneg_right hab d0.le)