l3lab/ntp-mathlib huggingface dataset:
theorem sum_div_card_sq_le_sum_sq_div_card :
    ((∑ i in s, f i) / s.card) ^ 2 ≤ (∑ i in s, f i ^ 2) / s.card := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedField α
s : Finset ι
f : ι → α
⊢ ((∑ i in s, f i) / ↑(card s)) ^ 2 ≤ (∑ i in s, f i ^ 2) / ↑(card s)

Next tactic:
obtain rfl | hs := s.eq_empty_or_nonempty
theorem sum_div_card_sq_le_sum_sq_div_card :
    ((∑ i in s, f i) / s.card) ^ 2 ≤ (∑ i in s, f i ^ 2) / s.card := by
  obtain rfl | hs := s.eq_empty_or_nonempty
  · 

Proof state:
case inl
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedField α
f : ι → α
⊢ ((∑ i in ∅, f i) / ↑(card ∅)) ^ 2 ≤ (∑ i in ∅, f i ^ 2) / ↑(card ∅)

Next tactic:
simp
theorem sum_div_card_sq_le_sum_sq_div_card :
    ((∑ i in s, f i) / s.card) ^ 2 ≤ (∑ i in s, f i ^ 2) / s.card := by
  obtain rfl | hs := s.eq_empty_or_nonempty
  · simp
  

Proof state:
case inr
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedField α
s : Finset ι
f : ι → α
hs : Finset.Nonempty s
⊢ ((∑ i in s, f i) / ↑(card s)) ^ 2 ≤ (∑ i in s, f i ^ 2) / ↑(card s)

Next tactic:
rw [← card_pos, ← @Nat.cast_pos α] at hs
theorem sum_div_card_sq_le_sum_sq_div_card :
    ((∑ i in s, f i) / s.card) ^ 2 ≤ (∑ i in s, f i ^ 2) / s.card := by
  obtain rfl | hs := s.eq_empty_or_nonempty
  · simp
  rw [← card_pos, ← @Nat.cast_pos α] at hs
  

Proof state:
case inr
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedField α
s : Finset ι
f : ι → α
hs : 0 < ↑(card s)
⊢ ((∑ i in s, f i) / ↑(card s)) ^ 2 ≤ (∑ i in s, f i ^ 2) / ↑(card s)

Next tactic:
rw [div_pow, div_le_div_iff (sq_pos_of_ne_zero _ hs.ne') hs, sq (s.card : α), mul_left_comm, ←
    mul_assoc]
theorem sum_div_card_sq_le_sum_sq_div_card :
    ((∑ i in s, f i) / s.card) ^ 2 ≤ (∑ i in s, f i ^ 2) / s.card := by
  obtain rfl | hs := s.eq_empty_or_nonempty
  · simp
  rw [← card_pos, ← @Nat.cast_pos α] at hs
  rw [div_pow, div_le_div_iff (sq_pos_of_ne_zero _ hs.ne') hs, sq (s.card : α), mul_left_comm, ←
    mul_assoc]
  

Proof state:
case inr
ι : Type u_1
α : Type u_2
β : Type u_3
inst✝ : LinearOrderedField α
s : Finset ι
f : ι → α
hs : 0 < ↑(card s)
⊢ (∑ i in s, f i) ^ 2 * ↑(card s) ≤ (↑(card s) * ∑ i in s, f i ^ 2) * ↑(card s)

Next tactic:
exact mul_le_mul_of_nonneg_right sq_sum_le_card_mul_sum_sq hs.le
@[to_additive] lemma mul_le_mul_iff_of_ge [CovariantClass α α (· * ·) (· < ·)]
    [CovariantClass α α (swap (· * ·)) (· < ·)] {a₁ a₂ b₁ b₂ : α} (ha : a₁ ≤ a₂) (hb : b₁ ≤ b₂) :
    a₂ * b₂ ≤ a₁ * b₁ ↔ a₁ = a₂ ∧ b₁ = b₂ := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : Mul α
inst✝² : PartialOrder α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x < x_1
a₁ a₂ b₁ b₂ : α
ha : a₁ ≤ a₂
hb : b₁ ≤ b₂
⊢ a₂ * b₂ ≤ a₁ * b₁ ↔ a₁ = a₂ ∧ b₁ = b₂

Next tactic:
haveI := covariantClass_le_of_lt α α (· * ·)
@[to_additive] lemma mul_le_mul_iff_of_ge [CovariantClass α α (· * ·) (· < ·)]
    [CovariantClass α α (swap (· * ·)) (· < ·)] {a₁ a₂ b₁ b₂ : α} (ha : a₁ ≤ a₂) (hb : b₁ ≤ b₂) :
    a₂ * b₂ ≤ a₁ * b₁ ↔ a₁ = a₂ ∧ b₁ = b₂ := by
  haveI := covariantClass_le_of_lt α α (· * ·)
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : Mul α
inst✝² : PartialOrder α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x < x_1
a₁ a₂ b₁ b₂ : α
ha : a₁ ≤ a₂
hb : b₁ ≤ b₂
this : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
⊢ a₂ * b₂ ≤ a₁ * b₁ ↔ a₁ = a₂ ∧ b₁ = b₂

Next tactic:
haveI := covariantClass_le_of_lt α α (swap (· * ·))
@[to_additive] lemma mul_le_mul_iff_of_ge [CovariantClass α α (· * ·) (· < ·)]
    [CovariantClass α α (swap (· * ·)) (· < ·)] {a₁ a₂ b₁ b₂ : α} (ha : a₁ ≤ a₂) (hb : b₁ ≤ b₂) :
    a₂ * b₂ ≤ a₁ * b₁ ↔ a₁ = a₂ ∧ b₁ = b₂ := by
  haveI := covariantClass_le_of_lt α α (· * ·)
  haveI := covariantClass_le_of_lt α α (swap (· * ·))
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : Mul α
inst✝² : PartialOrder α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x < x_1
a₁ a₂ b₁ b₂ : α
ha : a₁ ≤ a₂
hb : b₁ ≤ b₂
this✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
this : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
⊢ a₂ * b₂ ≤ a₁ * b₁ ↔ a₁ = a₂ ∧ b₁ = b₂

Next tactic:
refine' ⟨fun h ↦ _, by rintro ⟨rfl, rfl⟩; rfl⟩
@[to_additive] lemma mul_le_mul_iff_of_ge [CovariantClass α α (· * ·) (· < ·)]
    [CovariantClass α α (swap (· * ·)) (· < ·)] {a₁ a₂ b₁ b₂ : α} (ha : a₁ ≤ a₂) (hb : b₁ ≤ b₂) :
    a₂ * b₂ ≤ a₁ * b₁ ↔ a₁ = a₂ ∧ b₁ = b₂ := by
  haveI := covariantClass_le_of_lt α α (· * ·)
  haveI := covariantClass_le_of_lt α α (swap (· * ·))
  refine' ⟨fun h ↦ _, by 

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : Mul α
inst✝² : PartialOrder α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x < x_1
a₁ a₂ b₁ b₂ : α
ha : a₁ ≤ a₂
hb : b₁ ≤ b₂
this✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
this : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
⊢ a₁ = a₂ ∧ b₁ = b₂ → a₂ * b₂ ≤ a₁ * b₁

Next tactic:
rintro ⟨rfl, rfl⟩
@[to_additive] lemma mul_le_mul_iff_of_ge [CovariantClass α α (· * ·) (· < ·)]
    [CovariantClass α α (swap (· * ·)) (· < ·)] {a₁ a₂ b₁ b₂ : α} (ha : a₁ ≤ a₂) (hb : b₁ ≤ b₂) :
    a₂ * b₂ ≤ a₁ * b₁ ↔ a₁ = a₂ ∧ b₁ = b₂ := by
  haveI := covariantClass_le_of_lt α α (· * ·)
  haveI := covariantClass_le_of_lt α α (swap (· * ·))
  refine' ⟨fun h ↦ _, by rintro ⟨rfl, rfl⟩; 

Proof state:
case intro
α : Type u_1
β : Type u_2
inst✝³ : Mul α
inst✝² : PartialOrder α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x < x_1
a₁ b₁ : α
this✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
this : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
ha : a₁ ≤ a₁
hb : b₁ ≤ b₁
⊢ a₁ * b₁ ≤ a₁ * b₁

Next tactic:
rfl
@[to_additive] lemma mul_le_mul_iff_of_ge [CovariantClass α α (· * ·) (· < ·)]
    [CovariantClass α α (swap (· * ·)) (· < ·)] {a₁ a₂ b₁ b₂ : α} (ha : a₁ ≤ a₂) (hb : b₁ ≤ b₂) :
    a₂ * b₂ ≤ a₁ * b₁ ↔ a₁ = a₂ ∧ b₁ = b₂ := by
  haveI := covariantClass_le_of_lt α α (· * ·)
  haveI := covariantClass_le_of_lt α α (swap (· * ·))
  refine' ⟨fun h ↦ _, by rintro ⟨rfl, rfl⟩; rfl⟩
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : Mul α
inst✝² : PartialOrder α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x < x_1
a₁ a₂ b₁ b₂ : α
ha : a₁ ≤ a₂
hb : b₁ ≤ b₂
this✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
this : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
h : a₂ * b₂ ≤ a₁ * b₁
⊢ a₁ = a₂ ∧ b₁ = b₂

Next tactic:
simp only [eq_iff_le_not_lt, ha, hb, true_and]
@[to_additive] lemma mul_le_mul_iff_of_ge [CovariantClass α α (· * ·) (· < ·)]
    [CovariantClass α α (swap (· * ·)) (· < ·)] {a₁ a₂ b₁ b₂ : α} (ha : a₁ ≤ a₂) (hb : b₁ ≤ b₂) :
    a₂ * b₂ ≤ a₁ * b₁ ↔ a₁ = a₂ ∧ b₁ = b₂ := by
  haveI := covariantClass_le_of_lt α α (· * ·)
  haveI := covariantClass_le_of_lt α α (swap (· * ·))
  refine' ⟨fun h ↦ _, by rintro ⟨rfl, rfl⟩; rfl⟩
  simp only [eq_iff_le_not_lt, ha, hb, true_and]
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : Mul α
inst✝² : PartialOrder α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x < x_1
a₁ a₂ b₁ b₂ : α
ha : a₁ ≤ a₂
hb : b₁ ≤ b₂
this✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
this : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
h : a₂ * b₂ ≤ a₁ * b₁
⊢ ¬a₁ < a₂ ∧ ¬b₁ < b₂

Next tactic:
refine' ⟨fun ha ↦ h.not_lt _, fun hb ↦ h.not_lt _⟩
@[to_additive] lemma mul_le_mul_iff_of_ge [CovariantClass α α (· * ·) (· < ·)]
    [CovariantClass α α (swap (· * ·)) (· < ·)] {a₁ a₂ b₁ b₂ : α} (ha : a₁ ≤ a₂) (hb : b₁ ≤ b₂) :
    a₂ * b₂ ≤ a₁ * b₁ ↔ a₁ = a₂ ∧ b₁ = b₂ := by
  haveI := covariantClass_le_of_lt α α (· * ·)
  haveI := covariantClass_le_of_lt α α (swap (· * ·))
  refine' ⟨fun h ↦ _, by rintro ⟨rfl, rfl⟩; rfl⟩
  simp only [eq_iff_le_not_lt, ha, hb, true_and]
  refine' ⟨fun ha ↦ h.not_lt _, fun hb ↦ h.not_lt _⟩
  

Proof state:
case refine'_1
α : Type u_1
β : Type u_2
inst✝³ : Mul α
inst✝² : PartialOrder α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x < x_1
a₁ a₂ b₁ b₂ : α
ha✝ : a₁ ≤ a₂
hb : b₁ ≤ b₂
this✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
this : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
h : a₂ * b₂ ≤ a₁ * b₁
ha : a₁ < a₂
⊢ a₁ * b₁ < a₂ * b₂
case refine'_2
α : Type u_1
β : Type u_2
inst✝³ : Mul α
inst✝² : PartialOrder α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x < x_1
a₁ a₂ b₁ b₂ : α
ha : a₁ ≤ a₂
hb✝ : b₁ ≤ b₂
this✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
this : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
h : a₂ * b₂ ≤ a₁ * b₁
hb : b₁ < b₂
⊢ a₁ * b₁ < a₂ * b₂

Next tactic:
exacts [mul_lt_mul_of_lt_of_le ha hb, mul_lt_mul_of_le_of_lt ha hb]
@[to_additive] theorem mul_eq_mul_iff_eq_and_eq [CovariantClass α α (· * ·) (· < ·)]
    [CovariantClass α α (swap (· * ·)) (· < ·)] {a b c d : α} (hac : a ≤ c) (hbd : b ≤ d) :
    a * b = c * d ↔ a = c ∧ b = d := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : Mul α
inst✝² : PartialOrder α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x < x_1
a b c d : α
hac : a ≤ c
hbd : b ≤ d
⊢ a * b = c * d ↔ a = c ∧ b = d

Next tactic:
haveI := covariantClass_le_of_lt α α (· * ·)
@[to_additive] theorem mul_eq_mul_iff_eq_and_eq [CovariantClass α α (· * ·) (· < ·)]
    [CovariantClass α α (swap (· * ·)) (· < ·)] {a b c d : α} (hac : a ≤ c) (hbd : b ≤ d) :
    a * b = c * d ↔ a = c ∧ b = d := by
  haveI := covariantClass_le_of_lt α α (· * ·)
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : Mul α
inst✝² : PartialOrder α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x < x_1
a b c d : α
hac : a ≤ c
hbd : b ≤ d
this : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
⊢ a * b = c * d ↔ a = c ∧ b = d

Next tactic:
haveI := covariantClass_le_of_lt α α (swap (· * ·))
@[to_additive] theorem mul_eq_mul_iff_eq_and_eq [CovariantClass α α (· * ·) (· < ·)]
    [CovariantClass α α (swap (· * ·)) (· < ·)] {a b c d : α} (hac : a ≤ c) (hbd : b ≤ d) :
    a * b = c * d ↔ a = c ∧ b = d := by
  haveI := covariantClass_le_of_lt α α (· * ·)
  haveI := covariantClass_le_of_lt α α (swap (· * ·))
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : Mul α
inst✝² : PartialOrder α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x < x_1
a b c d : α
hac : a ≤ c
hbd : b ≤ d
this✝ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
this : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
⊢ a * b = c * d ↔ a = c ∧ b = d

Next tactic:
rw [le_antisymm_iff, eq_true (mul_le_mul' hac hbd), true_and, mul_le_mul_iff_of_ge hac hbd]
@[to_additive] lemma min_lt_max_of_mul_lt_mul
    [CovariantClass α α (· * ·) (· ≤ ·)] [CovariantClass α α (swap (· * ·)) (· ≤ ·)]
    (h : a * b < c * d) : min a b < max c d := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : Mul α
inst✝² : LinearOrder α
a b c d : α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
h : a * b < c * d
⊢ min a b < max c d

Next tactic:
simp_rw [min_lt_iff, lt_max_iff]
@[to_additive] lemma min_lt_max_of_mul_lt_mul
    [CovariantClass α α (· * ·) (· ≤ ·)] [CovariantClass α α (swap (· * ·)) (· ≤ ·)]
    (h : a * b < c * d) : min a b < max c d := by
  simp_rw [min_lt_iff, lt_max_iff]; 

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : Mul α
inst✝² : LinearOrder α
a b c d : α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
h : a * b < c * d
⊢ (a < c ∨ a < d) ∨ b < c ∨ b < d

Next tactic:
contrapose! h
@[to_additive] lemma min_lt_max_of_mul_lt_mul
    [CovariantClass α α (· * ·) (· ≤ ·)] [CovariantClass α α (swap (· * ·)) (· ≤ ·)]
    (h : a * b < c * d) : min a b < max c d := by
  simp_rw [min_lt_iff, lt_max_iff]; contrapose! h; 

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : Mul α
inst✝² : LinearOrder α
a b c d : α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
h : (c ≤ a ∧ d ≤ a) ∧ c ≤ b ∧ d ≤ b
⊢ c * d ≤ a * b

Next tactic:
exact mul_le_mul' h.1.1 h.2.2
@[to_additive] lemma Left.min_le_max_of_mul_le_mul
    [CovariantClass α α (· * ·) (· < ·)] [CovariantClass α α (swap (· * ·)) (· ≤ ·)]
    (h : a * b ≤ c * d) : min a b ≤ max c d := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : Mul α
inst✝² : LinearOrder α
a b c d : α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
h : a * b ≤ c * d
⊢ min a b ≤ max c d

Next tactic:
simp_rw [min_le_iff, le_max_iff]
@[to_additive] lemma Left.min_le_max_of_mul_le_mul
    [CovariantClass α α (· * ·) (· < ·)] [CovariantClass α α (swap (· * ·)) (· ≤ ·)]
    (h : a * b ≤ c * d) : min a b ≤ max c d := by
  simp_rw [min_le_iff, le_max_iff]; 

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : Mul α
inst✝² : LinearOrder α
a b c d : α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
h : a * b ≤ c * d
⊢ (a ≤ c ∨ a ≤ d) ∨ b ≤ c ∨ b ≤ d

Next tactic:
contrapose! h
@[to_additive] lemma Left.min_le_max_of_mul_le_mul
    [CovariantClass α α (· * ·) (· < ·)] [CovariantClass α α (swap (· * ·)) (· ≤ ·)]
    (h : a * b ≤ c * d) : min a b ≤ max c d := by
  simp_rw [min_le_iff, le_max_iff]; contrapose! h; 

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : Mul α
inst✝² : LinearOrder α
a b c d : α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
h : (c < a ∧ d < a) ∧ c < b ∧ d < b
⊢ c * d < a * b

Next tactic:
exact mul_lt_mul_of_le_of_lt h.1.1.le h.2.2
@[to_additive] lemma Right.min_le_max_of_mul_le_mul
    [CovariantClass α α (· * ·) (· ≤ ·)] [CovariantClass α α (swap (· * ·)) (· < ·)]
    (h : a * b ≤ c * d) : min a b ≤ max c d := by
  

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : Mul α
inst✝² : LinearOrder α
a b c d : α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x < x_1
h : a * b ≤ c * d
⊢ min a b ≤ max c d

Next tactic:
simp_rw [min_le_iff, le_max_iff]
@[to_additive] lemma Right.min_le_max_of_mul_le_mul
    [CovariantClass α α (· * ·) (· ≤ ·)] [CovariantClass α α (swap (· * ·)) (· < ·)]
    (h : a * b ≤ c * d) : min a b ≤ max c d := by
  simp_rw [min_le_iff, le_max_iff]; 

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : Mul α
inst✝² : LinearOrder α
a b c d : α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x < x_1
h : a * b ≤ c * d
⊢ (a ≤ c ∨ a ≤ d) ∨ b ≤ c ∨ b ≤ d

Next tactic:
contrapose! h
@[to_additive] lemma Right.min_le_max_of_mul_le_mul
    [CovariantClass α α (· * ·) (· ≤ ·)] [CovariantClass α α (swap (· * ·)) (· < ·)]
    (h : a * b ≤ c * d) : min a b ≤ max c d := by
  simp_rw [min_le_iff, le_max_iff]; contrapose! h; 

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : Mul α
inst✝² : LinearOrder α
a b c d : α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x < x_1
h : (c < a ∧ d < a) ∧ c < b ∧ d < b
⊢ c * d < a * b

Next tactic:
exact mul_lt_mul_of_lt_of_le h.1.1 h.2.2.le
@[to_additive]
theorem one_le_of_le_mul_right [ContravariantClass α α (· * ·) (· ≤ ·)] {a b : α} (h : a ≤ a * b) :
    1 ≤ b :=
  le_of_mul_le_mul_left' <| by 

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MulOneClass α
inst✝¹ : LE α
inst✝ : ContravariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
a b : α
h : a ≤ a * b
⊢ ?m.20859 h * 1 ≤ ?m.20859 h * b

Next tactic:
simpa only [mul_one]
@[to_additive]
theorem le_one_of_mul_le_right [ContravariantClass α α (· * ·) (· ≤ ·)] {a b : α} (h : a * b ≤ a) :
    b ≤ 1 :=
  le_of_mul_le_mul_left' <| by 

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MulOneClass α
inst✝¹ : LE α
inst✝ : ContravariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
a b : α
h : a * b ≤ a
⊢ ?m.21353 h * b ≤ ?m.21353 h * 1

Next tactic:
simpa only [mul_one]
@[to_additive]
theorem one_le_of_le_mul_left [ContravariantClass α α (swap (· * ·)) (· ≤ ·)] {a b : α}
    (h : b ≤ a * b) :
    1 ≤ a :=
  le_of_mul_le_mul_right' <| by 

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MulOneClass α
inst✝¹ : LE α
inst✝ : ContravariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
a b : α
h : b ≤ a * b
⊢ 1 * ?m.21883 h ≤ a * ?m.21883 h

Next tactic:
simpa only [one_mul]
@[to_additive]
theorem le_one_of_mul_le_left [ContravariantClass α α (swap (· * ·)) (· ≤ ·)] {a b : α}
    (h : a * b ≤ b) :
    a ≤ 1 :=
  le_of_mul_le_mul_right' <| by 

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MulOneClass α
inst✝¹ : LE α
inst✝ : ContravariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
a b : α
h : a * b ≤ b
⊢ a * ?m.22411 h ≤ 1 * ?m.22411 h

Next tactic:
simpa only [one_mul]
@[to_additive (attr := simp) le_add_iff_nonneg_right]
theorem le_mul_iff_one_le_right' [CovariantClass α α (· * ·) (· ≤ ·)]
    [ContravariantClass α α (· * ·) (· ≤ ·)] (a : α) {b : α} :
    a ≤ a * b ↔ 1 ≤ b :=
  Iff.trans (by 

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : MulOneClass α
inst✝² : LE α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
inst✝ : ContravariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
a b : α
⊢ a ≤ a * b ↔ a * 1 ≤ a * b

Next tactic:
rw [mul_one]
@[to_additive (attr := simp) le_add_iff_nonneg_left]
theorem le_mul_iff_one_le_left' [CovariantClass α α (swap (· * ·)) (· ≤ ·)]
    [ContravariantClass α α (swap (· * ·)) (· ≤ ·)] (a : α) {b : α} :
    a ≤ b * a ↔ 1 ≤ b :=
  Iff.trans (by 

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : MulOneClass α
inst✝² : LE α
inst✝¹ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
inst✝ : ContravariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
a b : α
⊢ a ≤ b * a ↔ 1 * a ≤ b * a

Next tactic:
rw [one_mul]
@[to_additive (attr := simp) add_le_iff_nonpos_right]
theorem mul_le_iff_le_one_right' [CovariantClass α α (· * ·) (· ≤ ·)]
    [ContravariantClass α α (· * ·) (· ≤ ·)] (a : α) {b : α} :
    a * b ≤ a ↔ b ≤ 1 :=
  Iff.trans (by 

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : MulOneClass α
inst✝² : LE α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
inst✝ : ContravariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
a b : α
⊢ a * b ≤ a ↔ a * b ≤ a * 1

Next tactic:
rw [mul_one]
@[to_additive (attr := simp) add_le_iff_nonpos_left]
theorem mul_le_iff_le_one_left' [CovariantClass α α (swap (· * ·)) (· ≤ ·)]
    [ContravariantClass α α (swap (· * ·)) (· ≤ ·)] {a b : α} :
    a * b ≤ b ↔ a ≤ 1 :=
  Iff.trans (by 

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : MulOneClass α
inst✝² : LE α
inst✝¹ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
inst✝ : ContravariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
a b : α
⊢ a * b ≤ b ↔ a * b ≤ 1 * b

Next tactic:
rw [one_mul]
@[to_additive]
theorem one_lt_of_lt_mul_right [ContravariantClass α α (· * ·) (· < ·)] {a b : α} (h : a < a * b) :
    1 < b :=
  lt_of_mul_lt_mul_left' <| by 

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MulOneClass α
inst✝¹ : LT α
inst✝ : ContravariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
a b : α
h : a < a * b
⊢ ?m.27651 h * 1 < ?m.27651 h * b

Next tactic:
simpa only [mul_one]
@[to_additive]
theorem lt_one_of_mul_lt_right [ContravariantClass α α (· * ·) (· < ·)] {a b : α} (h : a * b < a) :
    b < 1 :=
  lt_of_mul_lt_mul_left' <| by 

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MulOneClass α
inst✝¹ : LT α
inst✝ : ContravariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
a b : α
h : a * b < a
⊢ ?m.28141 h * b < ?m.28141 h * 1

Next tactic:
simpa only [mul_one]
@[to_additive]
theorem one_lt_of_lt_mul_left [ContravariantClass α α (swap (· * ·)) (· < ·)] {a b : α}
    (h : b < a * b) :
    1 < a :=
  lt_of_mul_lt_mul_right' <| by 

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MulOneClass α
inst✝¹ : LT α
inst✝ : ContravariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x < x_1
a b : α
h : b < a * b
⊢ 1 * ?m.28665 h < a * ?m.28665 h

Next tactic:
simpa only [one_mul]
@[to_additive]
theorem lt_one_of_mul_lt_left [ContravariantClass α α (swap (· * ·)) (· < ·)] {a b : α}
    (h : a * b < b) :
    a < 1 :=
  lt_of_mul_lt_mul_right' <| by 

Proof state:
α : Type u_1
β : Type u_2
inst✝² : MulOneClass α
inst✝¹ : LT α
inst✝ : ContravariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x < x_1
a b : α
h : a * b < b
⊢ a * ?m.29187 h < 1 * ?m.29187 h

Next tactic:
simpa only [one_mul]
@[to_additive (attr := simp) lt_add_iff_pos_right]
theorem lt_mul_iff_one_lt_right' [CovariantClass α α (· * ·) (· < ·)]
    [ContravariantClass α α (· * ·) (· < ·)] (a : α) {b : α} :
    a < a * b ↔ 1 < b :=
  Iff.trans (by 

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : MulOneClass α
inst✝² : LT α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
inst✝ : ContravariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
a b : α
⊢ a < a * b ↔ a * 1 < a * b

Next tactic:
rw [mul_one]
@[to_additive (attr := simp) lt_add_iff_pos_left]
theorem lt_mul_iff_one_lt_left' [CovariantClass α α (swap (· * ·)) (· < ·)]
    [ContravariantClass α α (swap (· * ·)) (· < ·)] (a : α) {b : α} : a < b * a ↔ 1 < b :=
  Iff.trans (by 

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : MulOneClass α
inst✝² : LT α
inst✝¹ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x < x_1
inst✝ : ContravariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x < x_1
a b : α
⊢ a < b * a ↔ 1 * a < b * a

Next tactic:
rw [one_mul]
@[to_additive (attr := simp) add_lt_iff_neg_left]
theorem mul_lt_iff_lt_one_left' [CovariantClass α α (· * ·) (· < ·)]
    [ContravariantClass α α (· * ·) (· < ·)] {a b : α} :
    a * b < a ↔ b < 1 :=
  Iff.trans (by 

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : MulOneClass α
inst✝² : LT α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
inst✝ : ContravariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x < x_1
a b : α
⊢ a * b < a ↔ a * b < a * 1

Next tactic:
rw [mul_one]
@[to_additive (attr := simp) add_lt_iff_neg_right]
theorem mul_lt_iff_lt_one_right' [CovariantClass α α (swap (· * ·)) (· < ·)]
    [ContravariantClass α α (swap (· * ·)) (· < ·)] {a : α} (b : α) : a * b < b ↔ a < 1 :=
  Iff.trans (by 

Proof state:
α : Type u_1
β : Type u_2
inst✝³ : MulOneClass α
inst✝² : LT α
inst✝¹ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x < x_1
inst✝ : ContravariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x < x_1
a b : α
⊢ a * b < b ↔ a * b < 1 * b

Next tactic:
rw [one_mul]