Documentation

Mathlib.Algebra.Order.Sub.Basic

Lemmas about subtraction in unbundled canonically ordered monoids #

theorem add_tsub_cancel_iff_le {α : Type u_1} [CanonicallyOrderedAddCommMonoid α] [Sub α] [OrderedSub α] {a b : α} :
a + (b - a) = b a b
theorem tsub_add_cancel_iff_le {α : Type u_1} [CanonicallyOrderedAddCommMonoid α] [Sub α] [OrderedSub α] {a b : α} :
b - a + a = b a b
theorem tsub_eq_zero_iff_le {α : Type u_1} [CanonicallyOrderedAddCommMonoid α] [Sub α] [OrderedSub α] {a b : α} :
a - b = 0 a b
theorem tsub_eq_zero_of_le {α : Type u_1} [CanonicallyOrderedAddCommMonoid α] [Sub α] [OrderedSub α] {a b : α} :
a ba - b = 0

Alias of the reverse direction of tsub_eq_zero_iff_le.

@[simp]
theorem tsub_self {α : Type u_1} [CanonicallyOrderedAddCommMonoid α] [Sub α] [OrderedSub α] (a : α) :
a - a = 0
theorem tsub_le_self {α : Type u_1} [CanonicallyOrderedAddCommMonoid α] [Sub α] [OrderedSub α] {a b : α} :
a - b a
theorem zero_tsub {α : Type u_1} [CanonicallyOrderedAddCommMonoid α] [Sub α] [OrderedSub α] (a : α) :
0 - a = 0
theorem tsub_self_add {α : Type u_1} [CanonicallyOrderedAddCommMonoid α] [Sub α] [OrderedSub α] (a b : α) :
a - (a + b) = 0
theorem tsub_pos_iff_not_le {α : Type u_1} [CanonicallyOrderedAddCommMonoid α] [Sub α] [OrderedSub α] {a b : α} :
0 < a - b ¬a b
theorem tsub_pos_of_lt {α : Type u_1} [CanonicallyOrderedAddCommMonoid α] [Sub α] [OrderedSub α] {a b : α} (h : a < b) :
0 < b - a
theorem tsub_lt_of_lt {α : Type u_1} [CanonicallyOrderedAddCommMonoid α] [Sub α] [OrderedSub α] {a b c : α} (h : a < b) :
a - c < b
theorem AddLECancellable.tsub_le_tsub_iff_left {α : Type u_1} [CanonicallyOrderedAddCommMonoid α] [Sub α] [OrderedSub α] {a b c : α} (ha : AddLECancellable a) (hc : AddLECancellable c) (h : c a) :
a - b a - c c b
theorem AddLECancellable.tsub_right_inj {α : Type u_1} [CanonicallyOrderedAddCommMonoid α] [Sub α] [OrderedSub α] {a b c : α} (ha : AddLECancellable a) (hb : AddLECancellable b) (hc : AddLECancellable c) (hba : b a) (hca : c a) :
a - b = a - c b = c

Lemmas where addition is order-reflecting. #

theorem tsub_le_tsub_iff_left {α : Type u_1} [CanonicallyOrderedAddCommMonoid α] [Sub α] [OrderedSub α] {a b c : α} [AddLeftReflectLE α] (h : c a) :
a - b a - c c b
theorem tsub_right_inj {α : Type u_1} [CanonicallyOrderedAddCommMonoid α] [Sub α] [OrderedSub α] {a b c : α} [AddLeftReflectLE α] (hba : b a) (hca : c a) :
a - b = a - c b = c
@[reducible, inline]

A CanonicallyOrderedAddCommMonoid with ordered subtraction and order-reflecting addition is cancellative. This is not an instance as it would form a typeclass loop.

See note [reducible non-instances].

Equations
Instances For

    Lemmas in a linearly canonically ordered monoid. #

    @[simp]
    theorem tsub_pos_iff_lt {α : Type u_1} [CanonicallyLinearOrderedAddCommMonoid α] [Sub α] [OrderedSub α] {a b : α} :
    0 < a - b b < a
    theorem tsub_eq_tsub_min {α : Type u_1} [CanonicallyLinearOrderedAddCommMonoid α] [Sub α] [OrderedSub α] (a b : α) :
    a - b = a - a b
    theorem AddLECancellable.lt_tsub_iff_right {α : Type u_1} [CanonicallyLinearOrderedAddCommMonoid α] [Sub α] [OrderedSub α] {a b c : α} (hc : AddLECancellable c) :
    a < b - c a + c < b
    theorem AddLECancellable.lt_tsub_iff_left {α : Type u_1} [CanonicallyLinearOrderedAddCommMonoid α] [Sub α] [OrderedSub α] {a b c : α} (hc : AddLECancellable c) :
    a < b - c c + a < b
    theorem AddLECancellable.tsub_lt_tsub_iff_right {α : Type u_1} [CanonicallyLinearOrderedAddCommMonoid α] [Sub α] [OrderedSub α] {a b c : α} (hc : AddLECancellable c) (h : c a) :
    a - c < b - c a < b
    theorem AddLECancellable.tsub_lt_self {α : Type u_1} [CanonicallyLinearOrderedAddCommMonoid α] [Sub α] [OrderedSub α] {a b : α} (ha : AddLECancellable a) (h₁ : 0 < a) (h₂ : 0 < b) :
    a - b < a
    theorem AddLECancellable.tsub_lt_self_iff {α : Type u_1} [CanonicallyLinearOrderedAddCommMonoid α] [Sub α] [OrderedSub α] {a b : α} (ha : AddLECancellable a) :
    a - b < a 0 < a 0 < b
    theorem AddLECancellable.tsub_lt_tsub_iff_left_of_le {α : Type u_1} [CanonicallyLinearOrderedAddCommMonoid α] [Sub α] [OrderedSub α] {a b c : α} (ha : AddLECancellable a) (hb : AddLECancellable b) (h : b a) :
    a - b < a - c c < b

    See lt_tsub_iff_left_of_le_of_le for a weaker statement in a partial order.

    theorem tsub_lt_tsub_iff_right {α : Type u_1} [CanonicallyLinearOrderedAddCommMonoid α] [Sub α] [OrderedSub α] {a b c : α} [AddLeftReflectLE α] (h : c a) :
    a - c < b - c a < b

    This lemma also holds for ENNReal, but we need a different proof for that.

    theorem tsub_lt_self {α : Type u_1} [CanonicallyLinearOrderedAddCommMonoid α] [Sub α] [OrderedSub α] {a b : α} [AddLeftReflectLE α] :
    0 < a0 < ba - b < a
    @[simp]
    theorem tsub_lt_self_iff {α : Type u_1} [CanonicallyLinearOrderedAddCommMonoid α] [Sub α] [OrderedSub α] {a b : α} [AddLeftReflectLE α] :
    a - b < a 0 < a 0 < b
    theorem tsub_lt_tsub_iff_left_of_le {α : Type u_1} [CanonicallyLinearOrderedAddCommMonoid α] [Sub α] [OrderedSub α] {a b c : α} [AddLeftReflectLE α] (h : b a) :
    a - b < a - c c < b

    See lt_tsub_iff_left_of_le_of_le for a weaker statement in a partial order.

    theorem tsub_tsub_eq_min {α : Type u_1} [CanonicallyLinearOrderedAddCommMonoid α] [Sub α] [OrderedSub α] [AddLeftReflectLE α] (a b : α) :
    a - (a - b) = a b

    Lemmas about max and min. #

    theorem tsub_add_eq_max {α : Type u_1} [CanonicallyLinearOrderedAddCommMonoid α] [Sub α] [OrderedSub α] {a b : α} :
    a - b + b = a b
    theorem add_tsub_eq_max {α : Type u_1} [CanonicallyLinearOrderedAddCommMonoid α] [Sub α] [OrderedSub α] {a b : α} :
    a + (b - a) = a b
    theorem tsub_min {α : Type u_1} [CanonicallyLinearOrderedAddCommMonoid α] [Sub α] [OrderedSub α] {a b : α} :
    a - a b = a - b
    theorem tsub_add_min {α : Type u_1} [CanonicallyLinearOrderedAddCommMonoid α] [Sub α] [OrderedSub α] {a b : α} :
    a - b + a b = a
    theorem Even.tsub {α : Type u_1} [CanonicallyLinearOrderedAddCommMonoid α] [Sub α] [OrderedSub α] [AddLeftReflectLE α] {m n : α} (hm : Even m) (hn : Even n) :
    Even (m - n)