Module docstring
{"# min and max in linearly ordered groups.
"}
{"# min and max in linearly ordered groups.
"}
max_one_div_max_inv_one_eq_self
theorem
(a : α) : max a 1 / max a⁻¹ 1 = a
@[to_additive (attr := simp)]
theorem max_one_div_max_inv_one_eq_self (a : α) : max a 1 / max a⁻¹ 1 = a := by
rcases le_total a 1 with (h | h) <;> simp [h]
max_inv_one
theorem
(a : α) : max a⁻¹ 1 = a⁻¹ * max a 1
@[to_additive]
lemma max_inv_one (a : α) : max a⁻¹ 1 = a⁻¹ * max a 1 := by
rw [eq_inv_mul_iff_mul_eq, ← eq_div_iff_mul_eq', max_one_div_max_inv_one_eq_self]
min_inv_inv'
theorem
(a b : α) : min a⁻¹ b⁻¹ = (max a b)⁻¹
@[to_additive min_neg_neg]
theorem min_inv_inv' (a b : α) : min a⁻¹ b⁻¹ = (max a b)⁻¹ :=
Eq.symm <| (@Monotone.map_max α αᵒᵈ _ _ Inv.inv a b) fun _ _ =>
inv_le_inv_iff.mpr
max_inv_inv'
theorem
(a b : α) : max a⁻¹ b⁻¹ = (min a b)⁻¹
@[to_additive max_neg_neg]
theorem max_inv_inv' (a b : α) : max a⁻¹ b⁻¹ = (min a b)⁻¹ :=
Eq.symm <| (@Monotone.map_min α αᵒᵈ _ _ Inv.inv a b) fun _ _ =>
inv_le_inv_iff.mpr
min_div_div_right'
theorem
(a b c : α) : min (a / c) (b / c) = min a b / c
@[to_additive min_sub_sub_right]
theorem min_div_div_right' (a b c : α) : min (a / c) (b / c) = min a b / c := by
simpa only [div_eq_mul_inv] using min_mul_mul_right a b c⁻¹
max_div_div_right'
theorem
(a b c : α) : max (a / c) (b / c) = max a b / c
@[to_additive max_sub_sub_right]
theorem max_div_div_right' (a b c : α) : max (a / c) (b / c) = max a b / c := by
simpa only [div_eq_mul_inv] using max_mul_mul_right a b c⁻¹
min_div_div_left'
theorem
(a b c : α) : min (a / b) (a / c) = a / max b c
@[to_additive min_sub_sub_left]
theorem min_div_div_left' (a b c : α) : min (a / b) (a / c) = a / max b c := by
simp only [div_eq_mul_inv, min_mul_mul_left, min_inv_inv']
max_div_div_left'
theorem
(a b c : α) : max (a / b) (a / c) = a / min b c
@[to_additive max_sub_sub_left]
theorem max_div_div_left' (a b c : α) : max (a / b) (a / c) = a / min b c := by
simp only [div_eq_mul_inv, max_mul_mul_left, max_inv_inv']
max_sub_max_le_max
theorem
(a b c d : α) : max a b - max c d ≤ max (a - c) (b - d)
theorem max_sub_max_le_max (a b c d : α) : max a b - max c d ≤ max (a - c) (b - d) := by
simp only [sub_le_iff_le_add, max_le_iff]; constructor
· calc
a = a - c + c := (sub_add_cancel a c).symm
_ ≤ max (a - c) (b - d) + max c d := add_le_add (le_max_left _ _) (le_max_left _ _)
· calc
b = b - d + d := (sub_add_cancel b d).symm
_ ≤ max (a - c) (b - d) + max c d := add_le_add (le_max_right _ _) (le_max_right _ _)
abs_max_sub_max_le_max
theorem
(a b c d : α) : |max a b - max c d| ≤ max |a - c| |b - d|
theorem abs_max_sub_max_le_max (a b c d : α) : |max a b - max c d| ≤ max |a - c| |b - d| := by
refine abs_sub_le_iff.2 ⟨?_, ?_⟩
· exact (max_sub_max_le_max _ _ _ _).trans (max_le_max (le_abs_self _) (le_abs_self _))
· rw [abs_sub_comm a c, abs_sub_comm b d]
exact (max_sub_max_le_max _ _ _ _).trans (max_le_max (le_abs_self _) (le_abs_self _))
abs_min_sub_min_le_max
theorem
(a b c d : α) : |min a b - min c d| ≤ max |a - c| |b - d|
theorem abs_min_sub_min_le_max (a b c d : α) : |min a b - min c d| ≤ max |a - c| |b - d| := by
simpa only [max_neg_neg, neg_sub_neg, abs_sub_comm] using
abs_max_sub_max_le_max (-a) (-b) (-c) (-d)
abs_max_sub_max_le_abs
theorem
(a b c : α) : |max a c - max b c| ≤ |a - b|
theorem abs_max_sub_max_le_abs (a b c : α) : |max a c - max b c| ≤ |a - b| := by
simpa only [sub_self, abs_zero, max_eq_left (abs_nonneg (a - b))]
using abs_max_sub_max_le_max a c b c