Documentation

Mathlib.Algebra.Order.Group.Abs

Absolute values in ordered groups #

The absolute value of an element in a group which is also a lattice is its supremum with its negation. This generalizes the usual absolute value on real numbers (|x| = max x (-x)).

Notation #

theorem le_of_mabs_le {G : Type u_1} [CommGroup G] [LinearOrder G] [IsOrderedMonoid G] {a b : G} (h : |a|โ‚˜ โ‰ค b) :
theorem le_of_abs_le {G : Type u_1} [AddCommGroup G] [LinearOrder G] [IsOrderedAddMonoid G] {a b : G} (h : |a| โ‰ค b) :
theorem mabs_div_lt_iff {G : Type u_1} [CommGroup G] [LinearOrder G] [IsOrderedMonoid G] {a b c : G} :
|a / b|โ‚˜ < c โ†” a / b < c โˆง b / a < c
theorem abs_sub_lt_iff {G : Type u_1} [AddCommGroup G] [LinearOrder G] [IsOrderedAddMonoid G] {a b c : G} :
|a - b| < c โ†” a - b < c โˆง b - a < c
theorem div_le_of_mabs_div_le_left {G : Type u_1} [CommGroup G] [LinearOrder G] [IsOrderedMonoid G] {a b c : G} (h : |a / b|โ‚˜ โ‰ค c) :
b / c โ‰ค a
theorem sub_le_of_abs_sub_le_left {G : Type u_1} [AddCommGroup G] [LinearOrder G] [IsOrderedAddMonoid G] {a b c : G} (h : |a - b| โ‰ค c) :
b - c โ‰ค a
theorem div_le_of_mabs_div_le_right {G : Type u_1} [CommGroup G] [LinearOrder G] [IsOrderedMonoid G] {a b c : G} (h : |a / b|โ‚˜ โ‰ค c) :
a / c โ‰ค b
theorem sub_le_of_abs_sub_le_right {G : Type u_1} [AddCommGroup G] [LinearOrder G] [IsOrderedAddMonoid G] {a b c : G} (h : |a - b| โ‰ค c) :
a - c โ‰ค b
theorem div_lt_of_mabs_div_lt_left {G : Type u_1} [CommGroup G] [LinearOrder G] [IsOrderedMonoid G] {a b c : G} (h : |a / b|โ‚˜ < c) :
b / c < a
theorem sub_lt_of_abs_sub_lt_left {G : Type u_1} [AddCommGroup G] [LinearOrder G] [IsOrderedAddMonoid G] {a b c : G} (h : |a - b| < c) :
b - c < a
theorem div_lt_of_mabs_div_lt_right {G : Type u_1} [CommGroup G] [LinearOrder G] [IsOrderedMonoid G] {a b c : G} (h : |a / b|โ‚˜ < c) :
a / c < b
theorem sub_lt_of_abs_sub_lt_right {G : Type u_1} [AddCommGroup G] [LinearOrder G] [IsOrderedAddMonoid G] {a b c : G} (h : |a - b| < c) :
a - c < b
theorem mabs_div_le_of_one_le_of_le {G : Type u_1} [CommGroup G] [LinearOrder G] [IsOrderedMonoid G] {a b n : G} (one_le_a : 1 โ‰ค a) (a_le_n : a โ‰ค n) (one_le_b : 1 โ‰ค b) (b_le_n : b โ‰ค n) :

|a / b|โ‚˜ โ‰ค n if 1 โ‰ค a โ‰ค n and 1 โ‰ค b โ‰ค n.

theorem abs_sub_le_of_nonneg_of_le {G : Type u_1} [AddCommGroup G] [LinearOrder G] [IsOrderedAddMonoid G] {a b n : G} (nonneg_a : 0 โ‰ค a) (a_le_n : a โ‰ค n) (nonneg_b : 0 โ‰ค b) (b_le_n : b โ‰ค n) :

|a - b| โ‰ค n if 0 โ‰ค a โ‰ค n and 0 โ‰ค b โ‰ค n.

theorem mabs_div_lt_of_one_le_of_lt {G : Type u_1} [CommGroup G] [LinearOrder G] [IsOrderedMonoid G] {a b n : G} (one_le_a : 1 โ‰ค a) (a_lt_n : a < n) (one_le_b : 1 โ‰ค b) (b_lt_n : b < n) :

|a / b|โ‚˜ < n if 1 โ‰ค a < n and 1 โ‰ค b < n.

theorem abs_sub_lt_of_nonneg_of_lt {G : Type u_1} [AddCommGroup G] [LinearOrder G] [IsOrderedAddMonoid G] {a b n : G} (nonneg_a : 0 โ‰ค a) (a_lt_n : a < n) (nonneg_b : 0 โ‰ค b) (b_lt_n : b < n) :
|a - b| < n

|a - b| < n if 0 โ‰ค a < n and 0 โ‰ค b < n.

theorem abs_eq {G : Type u_1} [AddCommGroup G] [LinearOrder G] [IsOrderedAddMonoid G] {a b : G} (hb : 0 โ‰ค b) :
|a| = b โ†” a = b โˆจ a = -b
theorem abs_le_max_abs_abs {G : Type u_1} [AddCommGroup G] [LinearOrder G] [IsOrderedAddMonoid G] {a b c : G} (hab : a โ‰ค b) (hbc : b โ‰ค c) :
theorem eq_of_mabs_div_eq_one {G : Type u_1} [CommGroup G] [LinearOrder G] [IsOrderedMonoid G] {a b : G} (h : |a / b|โ‚˜ = 1) :
a = b
theorem eq_of_abs_sub_eq_zero {G : Type u_1} [AddCommGroup G] [LinearOrder G] [IsOrderedAddMonoid G] {a b : G} (h : |a - b| = 0) :
a = b
theorem abs_sub_le {G : Type u_1} [AddCommGroup G] [LinearOrder G] [IsOrderedAddMonoid G] (a b c : G) :
|a - c| โ‰ค |a - b| + |b - c|
theorem mabs_div_le_max_div {G : Type u_1} [CommGroup G] [LinearOrder G] [IsOrderedMonoid G] {a b c : G} (hac : a โ‰ค b) (hcd : b โ‰ค c) (d : G) :
|b / d|โ‚˜ โ‰ค max (c / d) (d / a)
theorem abs_sub_le_max_sub {G : Type u_1} [AddCommGroup G] [LinearOrder G] [IsOrderedAddMonoid G] {a b c : G} (hac : a โ‰ค b) (hcd : b โ‰ค c) (d : G) :
|b - d| โ‰ค max (c - d) (d - a)
theorem mabs_div_le_of_le_of_le {G : Type u_1} [CommGroup G] [LinearOrder G] [IsOrderedMonoid G] {a b lb ub : G} (hal : lb โ‰ค a) (hau : a โ‰ค ub) (hbl : lb โ‰ค b) (hbu : b โ‰ค ub) :
theorem abs_sub_le_of_le_of_le {G : Type u_1} [AddCommGroup G] [LinearOrder G] [IsOrderedAddMonoid G] {a b lb ub : G} (hal : lb โ‰ค a) (hau : a โ‰ค ub) (hbl : lb โ‰ค b) (hbu : b โ‰ค ub) :
|a - b| โ‰ค ub - lb
theorem eq_of_mabs_div_le_one {G : Type u_1} [CommGroup G] [LinearOrder G] [IsOrderedMonoid G] {a b : G} (h : |a / b|โ‚˜ โ‰ค 1) :
a = b
theorem eq_of_abs_sub_nonpos {G : Type u_1} [AddCommGroup G] [LinearOrder G] [IsOrderedAddMonoid G] {a b : G} (h : |a - b| โ‰ค 0) :
a = b
theorem eq_of_mabs_div_lt_all {G : Type u_1} [CommGroup G] [LinearOrder G] [IsOrderedMonoid G] {x y : G} (h : โˆ€ ฮต > 1, |x / y|โ‚˜ < ฮต) :
x = y
theorem eq_of_abs_sub_lt_all {G : Type u_1} [AddCommGroup G] [LinearOrder G] [IsOrderedAddMonoid G] {x y : G} (h : โˆ€ ฮต > 0, |x - y| < ฮต) :
x = y
theorem eq_of_mabs_div_le_all {G : Type u_1} [CommGroup G] [LinearOrder G] [IsOrderedMonoid G] [DenselyOrdered G] {x y : G} (h : โˆ€ ฮต > 1, |x / y|โ‚˜ โ‰ค ฮต) :
x = y
theorem eq_of_abs_sub_le_all {G : Type u_1} [AddCommGroup G] [LinearOrder G] [IsOrderedAddMonoid G] [DenselyOrdered G] {x y : G} (h : โˆ€ ฮต > 0, |x - y| โ‰ค ฮต) :
x = y

For an element a of a multiplicative linear ordered group, either |a|โ‚˜ = a and 1 โ‰ค a, or |a|โ‚˜ = aโปยน and a < 1.

theorem abs_cases {G : Type u_1} [AddCommGroup G] [LinearOrder G] [IsOrderedAddMonoid G] (a : G) :

For an element a of an additive linear ordered group, either |a| = a and 0 โ‰ค a, or |a| = -a and a < 0. Use cases on this lemma to automate linarith in inequalities

theorem apply_abs_le_mul_of_one_le' {G : Type u_1} [AddCommGroup G] [LinearOrder G] [IsOrderedAddMonoid G] {H : Type u_2} [MulOneClass H] [LE H] [MulLeftMono H] [MulRightMono H] {f : G โ†’ H} {a : G} (hโ‚ : 1 โ‰ค f a) (hโ‚‚ : 1 โ‰ค f (-a)) :
f |a| โ‰ค f a * f (-a)
theorem apply_abs_le_add_of_nonneg' {G : Type u_1} [AddCommGroup G] [LinearOrder G] [IsOrderedAddMonoid G] {H : Type u_2} [AddZeroClass H] [LE H] [AddLeftMono H] [AddRightMono H] {f : G โ†’ H} {a : G} (hโ‚ : 0 โ‰ค f a) (hโ‚‚ : 0 โ‰ค f (-a)) :
f |a| โ‰ค f a + f (-a)
theorem apply_abs_le_mul_of_one_le {G : Type u_1} [AddCommGroup G] [LinearOrder G] [IsOrderedAddMonoid G] {H : Type u_2} [MulOneClass H] [LE H] [MulLeftMono H] [MulRightMono H] {f : G โ†’ H} (h : โˆ€ (x : G), 1 โ‰ค f x) (a : G) :
f |a| โ‰ค f a * f (-a)
theorem apply_abs_le_add_of_nonneg {G : Type u_1} [AddCommGroup G] [LinearOrder G] [IsOrderedAddMonoid G] {H : Type u_2} [AddZeroClass H] [LE H] [AddLeftMono H] [AddRightMono H] {f : G โ†’ H} (h : โˆ€ (x : G), 0 โ‰ค f x) (a : G) :
f |a| โ‰ค f a + f (-a)