statement
stringlengths
1
2.88k
proof
stringlengths
0
13.9k
type
stringclasses
10 values
symbolic_name
stringlengths
1
131
library
stringclasses
417 values
filename
stringlengths
17
80
imports
listlengths
0
16
deps
listlengths
0
64
docstring
stringlengths
0
10.2k
source_url
stringclasses
1 value
commit
stringclasses
1 value
canonically_ordered_add_monoid.to_add_cancel_comm_monoid : add_cancel_comm_monoid α
{ add_left_cancel := λ a b c h, by simpa only [add_tsub_cancel_left] using congr_arg (λ x, x - a) h, ..(by apply_instance : add_comm_monoid α) }
def
canonically_ordered_add_monoid.to_add_cancel_comm_monoid
algebra.order.sub
src/algebra/order/sub/canonical.lean
[ "algebra.order.monoid.canonical.defs", "algebra.order.sub.defs" ]
[ "add_cancel_comm_monoid", "add_comm_monoid", "add_tsub_cancel_left" ]
A `canonically_ordered_add_monoid` with ordered subtraction and order-reflecting addition is cancellative. This is not an instance at it would form a typeclass loop. See note [reducible non-instances].
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_pos_iff_lt : 0 < a - b ↔ b < a
by rw [tsub_pos_iff_not_le, not_le]
lemma
tsub_pos_iff_lt
algebra.order.sub
src/algebra/order/sub/canonical.lean
[ "algebra.order.monoid.canonical.defs", "algebra.order.sub.defs" ]
[ "tsub_pos_iff_not_le" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_eq_tsub_min (a b : α) : a - b = a - min a b
begin cases le_total a b with h h, { rw [min_eq_left h, tsub_self, tsub_eq_zero_of_le h] }, { rw [min_eq_right h] }, end
lemma
tsub_eq_tsub_min
algebra.order.sub
src/algebra/order/sub/canonical.lean
[ "algebra.order.monoid.canonical.defs", "algebra.order.sub.defs" ]
[ "tsub_self" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lt_tsub_iff_right (hc : add_le_cancellable c) : a < b - c ↔ a + c < b
⟨lt_imp_lt_of_le_imp_le tsub_le_iff_right.mpr, hc.lt_tsub_of_add_lt_right⟩
lemma
add_le_cancellable.lt_tsub_iff_right
algebra.order.sub
src/algebra/order/sub/canonical.lean
[ "algebra.order.monoid.canonical.defs", "algebra.order.sub.defs" ]
[ "lt_tsub_iff_right" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lt_tsub_iff_left (hc : add_le_cancellable c) : a < b - c ↔ c + a < b
⟨lt_imp_lt_of_le_imp_le tsub_le_iff_left.mpr, hc.lt_tsub_of_add_lt_left⟩
lemma
add_le_cancellable.lt_tsub_iff_left
algebra.order.sub
src/algebra/order/sub/canonical.lean
[ "algebra.order.monoid.canonical.defs", "algebra.order.sub.defs" ]
[ "lt_tsub_iff_left" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_lt_tsub_iff_right (hc : add_le_cancellable c) (h : c ≤ a) : a - c < b - c ↔ a < b
by rw [hc.lt_tsub_iff_left, add_tsub_cancel_of_le h]
lemma
add_le_cancellable.tsub_lt_tsub_iff_right
algebra.order.sub
src/algebra/order/sub/canonical.lean
[ "algebra.order.monoid.canonical.defs", "algebra.order.sub.defs" ]
[ "add_tsub_cancel_of_le", "tsub_lt_tsub_iff_right" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_lt_self (ha : add_le_cancellable a) (h₁ : 0 < a) (h₂ : 0 < b) : a - b < a
begin refine tsub_le_self.lt_of_ne (λ h, _), rw [← h, tsub_pos_iff_lt] at h₁, exact h₂.not_le (ha.add_le_iff_nonpos_left.1 $ add_le_of_le_tsub_left_of_le h₁.le h.ge), end
lemma
add_le_cancellable.tsub_lt_self
algebra.order.sub
src/algebra/order/sub/canonical.lean
[ "algebra.order.monoid.canonical.defs", "algebra.order.sub.defs" ]
[ "add_le_of_le_tsub_left_of_le", "tsub_lt_self", "tsub_pos_iff_lt" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_lt_self_iff (ha : add_le_cancellable a) : a - b < a ↔ 0 < a ∧ 0 < b
begin refine ⟨λ h, ⟨(zero_le _).trans_lt h, (zero_le b).lt_of_ne _⟩, λ h, ha.tsub_lt_self h.1 h.2⟩, rintro rfl, rw [tsub_zero] at h, exact h.false end
lemma
add_le_cancellable.tsub_lt_self_iff
algebra.order.sub
src/algebra/order/sub/canonical.lean
[ "algebra.order.monoid.canonical.defs", "algebra.order.sub.defs" ]
[ "tsub_lt_self_iff", "tsub_zero" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_lt_tsub_iff_left_of_le (ha : add_le_cancellable a) (hb : add_le_cancellable b) (h : b ≤ a) : a - b < a - c ↔ c < b
lt_iff_lt_of_le_iff_le $ ha.tsub_le_tsub_iff_left hb h
lemma
add_le_cancellable.tsub_lt_tsub_iff_left_of_le
algebra.order.sub
src/algebra/order/sub/canonical.lean
[ "algebra.order.monoid.canonical.defs", "algebra.order.sub.defs" ]
[ "lt_iff_lt_of_le_iff_le", "tsub_lt_tsub_iff_left_of_le" ]
See `lt_tsub_iff_left_of_le_of_le` for a weaker statement in a partial order.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_lt_tsub_iff_right (h : c ≤ a) : a - c < b - c ↔ a < b
contravariant.add_le_cancellable.tsub_lt_tsub_iff_right h
lemma
tsub_lt_tsub_iff_right
algebra.order.sub
src/algebra/order/sub/canonical.lean
[ "algebra.order.monoid.canonical.defs", "algebra.order.sub.defs" ]
[]
This lemma also holds for `ennreal`, but we need a different proof for that.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_lt_self : 0 < a → 0 < b → a - b < a
contravariant.add_le_cancellable.tsub_lt_self
lemma
tsub_lt_self
algebra.order.sub
src/algebra/order/sub/canonical.lean
[ "algebra.order.monoid.canonical.defs", "algebra.order.sub.defs" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_lt_self_iff : a - b < a ↔ 0 < a ∧ 0 < b
contravariant.add_le_cancellable.tsub_lt_self_iff
lemma
tsub_lt_self_iff
algebra.order.sub
src/algebra/order/sub/canonical.lean
[ "algebra.order.monoid.canonical.defs", "algebra.order.sub.defs" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_lt_tsub_iff_left_of_le (h : b ≤ a) : a - b < a - c ↔ c < b
contravariant.add_le_cancellable.tsub_lt_tsub_iff_left_of_le contravariant.add_le_cancellable h
lemma
tsub_lt_tsub_iff_left_of_le
algebra.order.sub
src/algebra/order/sub/canonical.lean
[ "algebra.order.monoid.canonical.defs", "algebra.order.sub.defs" ]
[]
See `lt_tsub_iff_left_of_le_of_le` for a weaker statement in a partial order.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_add_eq_max : a - b + b = max a b
begin cases le_total a b with h h, { rw [max_eq_right h, tsub_eq_zero_of_le h, zero_add] }, { rw [max_eq_left h, tsub_add_cancel_of_le h] } end
lemma
tsub_add_eq_max
algebra.order.sub
src/algebra/order/sub/canonical.lean
[ "algebra.order.monoid.canonical.defs", "algebra.order.sub.defs" ]
[ "tsub_add_cancel_of_le" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
add_tsub_eq_max : a + (b - a) = max a b
by rw [add_comm, max_comm, tsub_add_eq_max]
lemma
add_tsub_eq_max
algebra.order.sub
src/algebra/order/sub/canonical.lean
[ "algebra.order.monoid.canonical.defs", "algebra.order.sub.defs" ]
[ "tsub_add_eq_max" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_min : a - min a b = a - b
begin cases le_total a b with h h, { rw [min_eq_left h, tsub_self, tsub_eq_zero_of_le h] }, { rw [min_eq_right h] } end
lemma
tsub_min
algebra.order.sub
src/algebra/order/sub/canonical.lean
[ "algebra.order.monoid.canonical.defs", "algebra.order.sub.defs" ]
[ "tsub_self" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_add_min : a - b + min a b = a
by { rw [← tsub_min, tsub_add_cancel_of_le], apply min_le_left }
lemma
tsub_add_min
algebra.order.sub
src/algebra/order/sub/canonical.lean
[ "algebra.order.monoid.canonical.defs", "algebra.order.sub.defs" ]
[ "tsub_add_cancel_of_le", "tsub_min" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
has_ordered_sub (α : Type*) [has_le α] [has_add α] [has_sub α] : Prop
(tsub_le_iff_right : ∀ a b c : α, a - b ≤ c ↔ a ≤ c + b)
class
has_ordered_sub
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "tsub_le_iff_right" ]
`has_ordered_sub α` means that `α` has a subtraction characterized by `a - b ≤ c ↔ a ≤ c + b`. In other words, `a - b` is the least `c` such that `a ≤ b + c`. This is satisfied both by the subtraction in additive ordered groups and by truncated subtraction in canonically ordered monoids on many specific types.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_le_iff_right : a - b ≤ c ↔ a ≤ c + b
has_ordered_sub.tsub_le_iff_right a b c
lemma
tsub_le_iff_right
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
add_tsub_le_right : a + b - b ≤ a
tsub_le_iff_right.mpr le_rfl
lemma
add_tsub_le_right
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "le_rfl" ]
See `add_tsub_cancel_right` for the equality if `contravariant_class α α (+) (≤)`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
le_tsub_add : b ≤ (b - a) + a
tsub_le_iff_right.mp le_rfl
lemma
le_tsub_add
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "le_rfl" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_le_iff_left : a - b ≤ c ↔ a ≤ b + c
by rw [tsub_le_iff_right, add_comm]
lemma
tsub_le_iff_left
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "tsub_le_iff_right" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
le_add_tsub : a ≤ b + (a - b)
tsub_le_iff_left.mp le_rfl
lemma
le_add_tsub
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "le_rfl" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
add_tsub_le_left : a + b - a ≤ b
tsub_le_iff_left.mpr le_rfl
lemma
add_tsub_le_left
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "le_rfl" ]
See `add_tsub_cancel_left` for the equality if `contravariant_class α α (+) (≤)`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_le_tsub_right (h : a ≤ b) (c : α) : a - c ≤ b - c
tsub_le_iff_left.mpr $ h.trans le_add_tsub
lemma
tsub_le_tsub_right
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "le_add_tsub" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_le_iff_tsub_le : a - b ≤ c ↔ a - c ≤ b
by rw [tsub_le_iff_left, tsub_le_iff_right]
lemma
tsub_le_iff_tsub_le
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "tsub_le_iff_left", "tsub_le_iff_right" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_tsub_le : b - (b - a) ≤ a
tsub_le_iff_right.mpr le_add_tsub
lemma
tsub_tsub_le
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "le_add_tsub" ]
See `tsub_tsub_cancel_of_le` for the equality.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_le_tsub_left (h : a ≤ b) (c : α) : c - b ≤ c - a
tsub_le_iff_left.mpr $ le_add_tsub.trans $ add_le_add_right h _
lemma
tsub_le_tsub_left
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_le_tsub (hab : a ≤ b) (hcd : c ≤ d) : a - d ≤ b - c
(tsub_le_tsub_right hab _).trans $ tsub_le_tsub_left hcd _
lemma
tsub_le_tsub
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "tsub_le_tsub_left", "tsub_le_tsub_right" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
antitone_const_tsub : antitone (λ x, c - x)
λ x y hxy, tsub_le_tsub rfl.le hxy
lemma
antitone_const_tsub
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "antitone", "tsub_le_tsub" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
add_tsub_le_assoc : a + b - c ≤ a + (b - c)
by { rw [tsub_le_iff_left, add_left_comm], exact add_le_add_left le_add_tsub a }
lemma
add_tsub_le_assoc
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "le_add_tsub", "tsub_le_iff_left" ]
See `add_tsub_assoc_of_le` for the equality.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
add_tsub_le_tsub_add : a + b - c ≤ a - c + b
by { rw [add_comm, add_comm _ b], exact add_tsub_le_assoc }
lemma
add_tsub_le_tsub_add
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "add_tsub_le_assoc" ]
See `tsub_add_eq_add_tsub` for the equality.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
add_le_add_add_tsub : a + b ≤ (a + c) + (b - c)
by { rw [add_assoc], exact add_le_add_left le_add_tsub a }
lemma
add_le_add_add_tsub
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "le_add_tsub" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
le_tsub_add_add : a + b ≤ (a - c) + (b + c)
by { rw [add_comm a, add_comm (a - c)], exact add_le_add_add_tsub }
lemma
le_tsub_add_add
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "add_le_add_add_tsub" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_le_tsub_add_tsub : a - c ≤ (a - b) + (b - c)
begin rw [tsub_le_iff_left, ← add_assoc, add_right_comm], exact le_add_tsub.trans (add_le_add_right le_add_tsub _), end
lemma
tsub_le_tsub_add_tsub
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "le_add_tsub", "tsub_le_iff_left" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_tsub_tsub_le_tsub : (c - a) - (c - b) ≤ b - a
begin rw [tsub_le_iff_left, tsub_le_iff_left, add_left_comm], exact le_tsub_add.trans (add_le_add_left le_add_tsub _), end
lemma
tsub_tsub_tsub_le_tsub
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "le_add_tsub", "tsub_le_iff_left" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_tsub_le_tsub_add {a b c : α} : a - (b - c) ≤ a - b + c
tsub_le_iff_right.2 $ calc a ≤ a - b + b : le_tsub_add ... ≤ a - b + (c + (b - c)) : add_le_add_left le_add_tsub _ ... = a - b + c + (b - c) : (add_assoc _ _ _).symm
lemma
tsub_tsub_le_tsub_add
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "le_add_tsub", "le_tsub_add" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
add_tsub_add_le_tsub_add_tsub : a + b - (c + d) ≤ a - c + (b - d)
begin rw [add_comm c, tsub_le_iff_left, add_assoc, ←tsub_le_iff_left, ←tsub_le_iff_left], refine (tsub_le_tsub_right add_tsub_le_assoc c).trans _, rw [add_comm a, add_comm (a - c)], exact add_tsub_le_assoc, end
lemma
add_tsub_add_le_tsub_add_tsub
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "add_tsub_le_assoc", "tsub_le_iff_left", "tsub_le_tsub_right" ]
See `tsub_add_tsub_comm` for the equality.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
add_tsub_add_le_tsub_left : a + b - (a + c) ≤ b - c
by { rw [tsub_le_iff_left, add_assoc], exact add_le_add_left le_add_tsub _ }
lemma
add_tsub_add_le_tsub_left
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "le_add_tsub", "tsub_le_iff_left" ]
See `add_tsub_add_eq_tsub_left` for the equality.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
add_tsub_add_le_tsub_right : a + c - (b + c) ≤ a - b
by { rw [tsub_le_iff_left, add_right_comm], exact add_le_add_right le_add_tsub c }
lemma
add_tsub_add_le_tsub_right
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "le_add_tsub", "tsub_le_iff_left" ]
See `add_tsub_add_eq_tsub_right` for the equality.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
le_add_tsub_swap (hb : add_le_cancellable b) : a ≤ b + a - b
hb le_add_tsub
lemma
add_le_cancellable.le_add_tsub_swap
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "le_add_tsub", "le_add_tsub_swap" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
le_add_tsub (hb : add_le_cancellable b) : a ≤ a + b - b
by { rw add_comm, exact hb.le_add_tsub_swap }
lemma
add_le_cancellable.le_add_tsub
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "le_add_tsub" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
le_tsub_of_add_le_left (ha : add_le_cancellable a) (h : a + b ≤ c) : b ≤ c - a
ha $ h.trans le_add_tsub
lemma
add_le_cancellable.le_tsub_of_add_le_left
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "le_add_tsub", "le_tsub_of_add_le_left" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
le_tsub_of_add_le_right (hb : add_le_cancellable b) (h : a + b ≤ c) : a ≤ c - b
hb.le_tsub_of_add_le_left $ by rwa add_comm
lemma
add_le_cancellable.le_tsub_of_add_le_right
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "le_tsub_of_add_le_right" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
le_add_tsub_swap : a ≤ b + a - b
contravariant.add_le_cancellable.le_add_tsub_swap
lemma
le_add_tsub_swap
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
le_add_tsub' : a ≤ a + b - b
contravariant.add_le_cancellable.le_add_tsub
lemma
le_add_tsub'
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
le_tsub_of_add_le_left (h : a + b ≤ c) : b ≤ c - a
contravariant.add_le_cancellable.le_tsub_of_add_le_left h
lemma
le_tsub_of_add_le_left
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
le_tsub_of_add_le_right (h : a + b ≤ c) : a ≤ c - b
contravariant.add_le_cancellable.le_tsub_of_add_le_right h
lemma
le_tsub_of_add_le_right
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_nonpos : a - b ≤ 0 ↔ a ≤ b
by rw [tsub_le_iff_left, add_zero]
lemma
tsub_nonpos
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "tsub_le_iff_left" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_tsub (b a c : α) : b - a - c = b - (a + c)
begin apply le_antisymm, { rw [tsub_le_iff_left, tsub_le_iff_left, ← add_assoc, ← tsub_le_iff_left] }, { rw [tsub_le_iff_left, add_assoc, ← tsub_le_iff_left, ← tsub_le_iff_left] } end
lemma
tsub_tsub
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "tsub_le_iff_left" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_add_eq_tsub_tsub (a b c : α) : a - (b + c) = a - b - c
(tsub_tsub _ _ _).symm
lemma
tsub_add_eq_tsub_tsub
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "tsub_tsub" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_add_eq_tsub_tsub_swap (a b c : α) : a - (b + c) = a - c - b
by { rw [add_comm], apply tsub_add_eq_tsub_tsub }
lemma
tsub_add_eq_tsub_tsub_swap
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "tsub_add_eq_tsub_tsub" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_right_comm : a - b - c = a - c - b
by simp_rw [← tsub_add_eq_tsub_tsub, add_comm]
lemma
tsub_right_comm
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "tsub_add_eq_tsub_tsub" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_eq_of_eq_add (hb : add_le_cancellable b) (h : a = c + b) : a - b = c
le_antisymm (tsub_le_iff_right.mpr h.le) $ by { rw h, exact hb.le_add_tsub }
lemma
add_le_cancellable.tsub_eq_of_eq_add
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "tsub_eq_of_eq_add" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
eq_tsub_of_add_eq (hc : add_le_cancellable c) (h : a + c = b) : a = b - c
(hc.tsub_eq_of_eq_add h.symm).symm
lemma
add_le_cancellable.eq_tsub_of_add_eq
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "eq_tsub_of_add_eq" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_eq_of_eq_add_rev (hb : add_le_cancellable b) (h : a = b + c) : a - b = c
hb.tsub_eq_of_eq_add $ by rw [add_comm, h]
theorem
add_le_cancellable.tsub_eq_of_eq_add_rev
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "tsub_eq_of_eq_add_rev" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
add_tsub_cancel_right (hb : add_le_cancellable b) : a + b - b = a
hb.tsub_eq_of_eq_add $ by rw [add_comm]
lemma
add_le_cancellable.add_tsub_cancel_right
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "add_tsub_cancel_right" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
add_tsub_cancel_left (ha : add_le_cancellable a) : a + b - a = b
ha.tsub_eq_of_eq_add $ add_comm a b
lemma
add_le_cancellable.add_tsub_cancel_left
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "add_tsub_cancel_left" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lt_add_of_tsub_lt_left (hb : add_le_cancellable b) (h : a - b < c) : a < b + c
begin rw [lt_iff_le_and_ne, ← tsub_le_iff_left], refine ⟨h.le, _⟩, rintro rfl, simpa [hb] using h, end
lemma
add_le_cancellable.lt_add_of_tsub_lt_left
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "lt_add_of_tsub_lt_left", "lt_iff_le_and_ne", "tsub_le_iff_left" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lt_add_of_tsub_lt_right (hc : add_le_cancellable c) (h : a - c < b) : a < b + c
begin rw [lt_iff_le_and_ne, ← tsub_le_iff_right], refine ⟨h.le, _⟩, rintro rfl, simpa [hc] using h, end
lemma
add_le_cancellable.lt_add_of_tsub_lt_right
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "lt_add_of_tsub_lt_right", "lt_iff_le_and_ne", "tsub_le_iff_right" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lt_tsub_of_add_lt_right (hc : add_le_cancellable c) (h : a + c < b) : a < b - c
(hc.le_tsub_of_add_le_right h.le).lt_of_ne $ by { rintro rfl, exact h.not_le le_tsub_add }
lemma
add_le_cancellable.lt_tsub_of_add_lt_right
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "le_tsub_add", "lt_tsub_of_add_lt_right" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lt_tsub_of_add_lt_left (ha : add_le_cancellable a) (h : a + c < b) : c < b - a
ha.lt_tsub_of_add_lt_right $ by rwa add_comm
lemma
add_le_cancellable.lt_tsub_of_add_lt_left
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "lt_tsub_of_add_lt_left" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_eq_of_eq_add (h : a = c + b) : a - b = c
contravariant.add_le_cancellable.tsub_eq_of_eq_add h
lemma
tsub_eq_of_eq_add
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
eq_tsub_of_add_eq (h : a + c = b) : a = b - c
contravariant.add_le_cancellable.eq_tsub_of_add_eq h
lemma
eq_tsub_of_add_eq
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_eq_of_eq_add_rev (h : a = b + c) : a - b = c
contravariant.add_le_cancellable.tsub_eq_of_eq_add_rev h
lemma
tsub_eq_of_eq_add_rev
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
add_tsub_cancel_right (a b : α) : a + b - b = a
contravariant.add_le_cancellable.add_tsub_cancel_right
lemma
add_tsub_cancel_right
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
add_tsub_cancel_left (a b : α) : a + b - a = b
contravariant.add_le_cancellable.add_tsub_cancel_left
lemma
add_tsub_cancel_left
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lt_add_of_tsub_lt_left (h : a - b < c) : a < b + c
contravariant.add_le_cancellable.lt_add_of_tsub_lt_left h
lemma
lt_add_of_tsub_lt_left
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lt_add_of_tsub_lt_right (h : a - c < b) : a < b + c
contravariant.add_le_cancellable.lt_add_of_tsub_lt_right h
lemma
lt_add_of_tsub_lt_right
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lt_tsub_of_add_lt_left : a + c < b → c < b - a
contravariant.add_le_cancellable.lt_tsub_of_add_lt_left
lemma
lt_tsub_of_add_lt_left
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[]
This lemma (and some of its corollaries) also holds for `ennreal`, but this proof doesn't work for it. Maybe we should add this lemma as field to `has_ordered_sub`?
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lt_tsub_of_add_lt_right : a + c < b → a < b - c
contravariant.add_le_cancellable.lt_tsub_of_add_lt_right
lemma
lt_tsub_of_add_lt_right
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
add_tsub_add_eq_tsub_right (a c b : α) : (a + c) - (b + c) = a - b
begin refine add_tsub_add_le_tsub_right.antisymm (tsub_le_iff_right.2 $ le_of_add_le_add_right _), swap, rw add_assoc, exact le_tsub_add, end
lemma
add_tsub_add_eq_tsub_right
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "le_tsub_add" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
add_tsub_add_eq_tsub_left (a b c : α) : (a + b) - (a + c) = b - c
by rw [add_comm a b, add_comm a c, add_tsub_add_eq_tsub_right]
lemma
add_tsub_add_eq_tsub_left
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "add_tsub_add_eq_tsub_right" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lt_of_tsub_lt_tsub_right (h : a - c < b - c) : a < b
lt_imp_lt_of_le_imp_le (λ h, tsub_le_tsub_right h c) h
lemma
lt_of_tsub_lt_tsub_right
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "lt_imp_lt_of_le_imp_le", "tsub_le_tsub_right" ]
See `lt_of_tsub_lt_tsub_right_of_le` for a weaker statement in a partial order.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lt_tsub_iff_right : a < b - c ↔ a + c < b
lt_iff_lt_of_le_iff_le tsub_le_iff_right
lemma
lt_tsub_iff_right
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "lt_iff_lt_of_le_iff_le", "tsub_le_iff_right" ]
See `lt_tsub_iff_right_of_le` for a weaker statement in a partial order.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lt_tsub_iff_left : a < b - c ↔ c + a < b
lt_iff_lt_of_le_iff_le tsub_le_iff_left
lemma
lt_tsub_iff_left
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "lt_iff_lt_of_le_iff_le", "tsub_le_iff_left" ]
See `lt_tsub_iff_left_of_le` for a weaker statement in a partial order.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lt_tsub_comm : a < b - c ↔ c < b - a
lt_tsub_iff_left.trans lt_tsub_iff_right.symm
lemma
lt_tsub_comm
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
lt_of_tsub_lt_tsub_left (h : a - b < a - c) : c < b
lt_imp_lt_of_le_imp_le (λ h, tsub_le_tsub_left h a) h
lemma
lt_of_tsub_lt_tsub_left
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "lt_imp_lt_of_le_imp_le", "tsub_le_tsub_left" ]
See `lt_of_tsub_lt_tsub_left_of_le` for a weaker statement in a partial order.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
tsub_zero (a : α) : a - 0 = a
add_le_cancellable.tsub_eq_of_eq_add add_le_cancellable_zero (add_zero _).symm
lemma
tsub_zero
algebra.order.sub
src/algebra/order/sub/defs.lean
[ "algebra.covariant_and_contravariant", "algebra.group.basic", "algebra.order.monoid.lemmas", "order.lattice" ]
[ "add_le_cancellable.tsub_eq_of_eq_add" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
sub : Π (a b : with_top α), with_top α
| _ ⊤ := 0 | ⊤ (x : α) := ⊤ | (x : α) (y : α) := (x - y : α)
def
with_top.sub
algebra.order.sub
src/algebra/order/sub/with_top.lean
[ "algebra.order.sub.defs", "algebra.order.monoid.with_top" ]
[ "with_top" ]
If `α` has subtraction and `0`, we can extend the subtraction to `with_top α`.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
coe_sub {a b : α} : (↑(a - b) : with_top α) = ↑a - ↑b
rfl
lemma
with_top.coe_sub
algebra.order.sub
src/algebra/order/sub/with_top.lean
[ "algebra.order.sub.defs", "algebra.order.monoid.with_top" ]
[ "with_top" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
top_sub_coe {a : α} : (⊤ : with_top α) - a = ⊤
rfl
lemma
with_top.top_sub_coe
algebra.order.sub
src/algebra/order/sub/with_top.lean
[ "algebra.order.sub.defs", "algebra.order.monoid.with_top" ]
[ "with_top" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
sub_top {a : with_top α} : a - ⊤ = 0
by { cases a; refl }
lemma
with_top.sub_top
algebra.order.sub
src/algebra/order/sub/with_top.lean
[ "algebra.order.sub.defs", "algebra.order.monoid.with_top" ]
[ "with_top" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
sub_eq_top_iff : ∀ {a b : with_top α}, a - b = ⊤ ↔ a = ⊤ ∧ b ≠ ⊤
| _ ⊤ := by simp | ⊤ (b : α) := by simp | (a : α) (b : α) := by simp only [← coe_sub, coe_ne_top, false_and]
theorem
with_top.sub_eq_top_iff
algebra.order.sub
src/algebra/order/sub/with_top.lean
[ "algebra.order.sub.defs", "algebra.order.monoid.with_top" ]
[ "with_top" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
map_sub [has_sub β] [has_zero β] {f : α → β} (h : ∀ x y, f (x - y) = f x - f y) (h₀ : f 0 = 0) : ∀ x y : with_top α, (x - y).map f = x.map f - y.map f
| _ ⊤ := by simp only [h₀, sub_top, with_top.map_zero, coe_zero, map_top] | ⊤ (x : α) := rfl | (x : α) (y : α) := by simp only [← coe_sub, map_coe, h]
lemma
with_top.map_sub
algebra.order.sub
src/algebra/order/sub/with_top.lean
[ "algebra.order.sub.defs", "algebra.order.monoid.with_top" ]
[ "with_top" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
nat_degree_list_sum_le (l : list S[X]) : nat_degree l.sum ≤ (l.map nat_degree).foldr max 0
list.sum_le_foldr_max nat_degree (by simp) nat_degree_add_le _
lemma
polynomial.nat_degree_list_sum_le
algebra.polynomial
src/algebra/polynomial/big_operators.lean
[ "algebra.order.with_zero", "data.polynomial.monic" ]
[ "list.sum_le_foldr_max" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
nat_degree_multiset_sum_le (l : multiset S[X]) : nat_degree l.sum ≤ (l.map nat_degree).foldr max max_left_comm 0
quotient.induction_on l (by simpa using nat_degree_list_sum_le)
lemma
polynomial.nat_degree_multiset_sum_le
algebra.polynomial
src/algebra/polynomial/big_operators.lean
[ "algebra.order.with_zero", "data.polynomial.monic" ]
[ "multiset" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
nat_degree_sum_le (f : ι → S[X]) : nat_degree (∑ i in s, f i) ≤ s.fold max 0 (nat_degree ∘ f)
by simpa using nat_degree_multiset_sum_le (s.val.map f)
lemma
polynomial.nat_degree_sum_le
algebra.polynomial
src/algebra/polynomial/big_operators.lean
[ "algebra.order.with_zero", "data.polynomial.monic" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
degree_list_sum_le (l : list S[X]) : degree l.sum ≤ (l.map nat_degree).maximum
begin by_cases h : l.sum = 0, { simp [h] }, { rw degree_eq_nat_degree h, suffices : (l.map nat_degree).maximum = ((l.map nat_degree).foldr max 0 : ℕ), { rw this, simpa [this] using nat_degree_list_sum_le l }, rw ← list.foldr_max_of_ne_nil, { congr }, contrapose! h, rw [list.map_eq_ni...
lemma
polynomial.degree_list_sum_le
algebra.polynomial
src/algebra/polynomial/big_operators.lean
[ "algebra.order.with_zero", "data.polynomial.monic" ]
[ "list.foldr_max_of_ne_nil", "list.map_eq_nil" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
nat_degree_list_prod_le (l : list S[X]) : nat_degree l.prod ≤ (l.map nat_degree).sum
begin induction l with hd tl IH, { simp }, { simpa using nat_degree_mul_le.trans (add_le_add_left IH _) } end
lemma
polynomial.nat_degree_list_prod_le
algebra.polynomial
src/algebra/polynomial/big_operators.lean
[ "algebra.order.with_zero", "data.polynomial.monic" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
degree_list_prod_le (l : list S[X]) : degree l.prod ≤ (l.map degree).sum
begin induction l with hd tl IH, { simp }, { simpa using (degree_mul_le _ _).trans (add_le_add_left IH _) } end
lemma
polynomial.degree_list_prod_le
algebra.polynomial
src/algebra/polynomial/big_operators.lean
[ "algebra.order.with_zero", "data.polynomial.monic" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
coeff_list_prod_of_nat_degree_le (l : list S[X]) (n : ℕ) (hl : ∀ p ∈ l, nat_degree p ≤ n) : coeff (list.prod l) (l.length * n) = (l.map (λ p, coeff p n)).prod
begin induction l with hd tl IH, { simp }, { have hl' : ∀ (p ∈ tl), nat_degree p ≤ n := λ p hp, hl p (list.mem_cons_of_mem _ hp), simp only [list.prod_cons, list.map, list.length], rw [add_mul, one_mul, add_comm, ←IH hl', mul_comm tl.length], have h : nat_degree tl.prod ≤ n * tl.length, { refine (...
lemma
polynomial.coeff_list_prod_of_nat_degree_le
algebra.polynomial
src/algebra/polynomial/big_operators.lean
[ "algebra.order.with_zero", "data.polynomial.monic" ]
[ "list.prod", "list.prod_cons", "mul_comm", "mul_zero", "one_mul", "zero_mul" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
nat_degree_multiset_prod_le : t.prod.nat_degree ≤ (t.map nat_degree).sum
quotient.induction_on t (by simpa using nat_degree_list_prod_le)
lemma
polynomial.nat_degree_multiset_prod_le
algebra.polynomial
src/algebra/polynomial/big_operators.lean
[ "algebra.order.with_zero", "data.polynomial.monic" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
nat_degree_prod_le : (∏ i in s, f i).nat_degree ≤ ∑ i in s, (f i).nat_degree
by simpa using nat_degree_multiset_prod_le (s.1.map f)
lemma
polynomial.nat_degree_prod_le
algebra.polynomial
src/algebra/polynomial/big_operators.lean
[ "algebra.order.with_zero", "data.polynomial.monic" ]
[]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
degree_multiset_prod_le : t.prod.degree ≤ (t.map polynomial.degree).sum
quotient.induction_on t (by simpa using degree_list_prod_le)
lemma
polynomial.degree_multiset_prod_le
algebra.polynomial
src/algebra/polynomial/big_operators.lean
[ "algebra.order.with_zero", "data.polynomial.monic" ]
[ "polynomial.degree" ]
The degree of a product of polynomials is at most the sum of the degrees, where the degree of the zero polynomial is ⊥.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
degree_prod_le : (∏ i in s, f i).degree ≤ ∑ i in s, (f i).degree
by simpa only [multiset.map_map] using degree_multiset_prod_le (s.1.map f)
lemma
polynomial.degree_prod_le
algebra.polynomial
src/algebra/polynomial/big_operators.lean
[ "algebra.order.with_zero", "data.polynomial.monic" ]
[ "multiset.map_map" ]
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
leading_coeff_multiset_prod' (h : (t.map leading_coeff).prod ≠ 0) : t.prod.leading_coeff = (t.map leading_coeff).prod
begin induction t using multiset.induction_on with a t ih, { simp }, simp only [multiset.map_cons, multiset.prod_cons] at h ⊢, rw polynomial.leading_coeff_mul'; { rwa ih, apply right_ne_zero_of_mul h } end
lemma
polynomial.leading_coeff_multiset_prod'
algebra.polynomial
src/algebra/polynomial/big_operators.lean
[ "algebra.order.with_zero", "data.polynomial.monic" ]
[ "ih", "multiset.induction_on", "multiset.map_cons", "multiset.prod_cons", "polynomial.leading_coeff_mul'", "right_ne_zero_of_mul" ]
The leading coefficient of a product of polynomials is equal to the product of the leading coefficients, provided that this product is nonzero. See `polynomial.leading_coeff_multiset_prod` (without the `'`) for a version for integral domains, where this condition is automatically satisfied.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
leading_coeff_prod' (h : ∏ i in s, (f i).leading_coeff ≠ 0) : (∏ i in s, f i).leading_coeff = ∏ i in s, (f i).leading_coeff
by simpa using leading_coeff_multiset_prod' (s.1.map f) (by simpa using h)
lemma
polynomial.leading_coeff_prod'
algebra.polynomial
src/algebra/polynomial/big_operators.lean
[ "algebra.order.with_zero", "data.polynomial.monic" ]
[]
The leading coefficient of a product of polynomials is equal to the product of the leading coefficients, provided that this product is nonzero. See `polynomial.leading_coeff_prod` (without the `'`) for a version for integral domains, where this condition is automatically satisfied.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
nat_degree_multiset_prod' (h : (t.map (λ f, leading_coeff f)).prod ≠ 0) : t.prod.nat_degree = (t.map (λ f, nat_degree f)).sum
begin revert h, refine multiset.induction_on t _ (λ a t ih ht, _), { simp }, rw [multiset.map_cons, multiset.prod_cons] at ht ⊢, rw [multiset.sum_cons, polynomial.nat_degree_mul', ih], { apply right_ne_zero_of_mul ht }, { rwa polynomial.leading_coeff_multiset_prod', apply right_ne_zero_of_mul ht }, end
lemma
polynomial.nat_degree_multiset_prod'
algebra.polynomial
src/algebra/polynomial/big_operators.lean
[ "algebra.order.with_zero", "data.polynomial.monic" ]
[ "ih", "multiset.induction_on", "multiset.map_cons", "multiset.prod_cons", "polynomial.leading_coeff_multiset_prod'", "polynomial.nat_degree_mul'", "right_ne_zero_of_mul" ]
The degree of a product of polynomials is equal to the sum of the degrees, provided that the product of leading coefficients is nonzero. See `polynomial.nat_degree_multiset_prod` (without the `'`) for a version for integral domains, where this condition is automatically satisfied.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83
nat_degree_prod' (h : ∏ i in s, (f i).leading_coeff ≠ 0) : (∏ i in s, f i).nat_degree = ∑ i in s, (f i).nat_degree
by simpa using nat_degree_multiset_prod' (s.1.map f) (by simpa using h)
lemma
polynomial.nat_degree_prod'
algebra.polynomial
src/algebra/polynomial/big_operators.lean
[ "algebra.order.with_zero", "data.polynomial.monic" ]
[]
The degree of a product of polynomials is equal to the sum of the degrees, provided that the product of leading coefficients is nonzero. See `polynomial.nat_degree_prod` (without the `'`) for a version for integral domains, where this condition is automatically satisfied.
https://github.com/leanprover-community/mathlib
65a1391a0106c9204fe45bc73a039f056558cb83