Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 17102ae

Browse files
feat(algebra/big_operators/basic): add sum_erase_lt_of_pos (#14066)
`sum_erase_lt_of_pos (hd : d ∈ s) (hdf : 0 < f d) : ∑ (m : ℕ) in s.erase d, f m < ∑ (m : ℕ) in s, f m`
1 parent 86d58ae commit 17102ae

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/algebra/big_operators/basic.lean

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,6 +1290,15 @@ begin
12901290
rwa eq_of_mem_of_not_mem_erase hx hnx
12911291
end
12921292

1293+
lemma sum_erase_lt_of_pos {γ : Type*} [decidable_eq α] [ordered_add_comm_monoid γ]
1294+
[covariant_class γ γ (+) (<)] {s : finset α} {d : α} (hd : d ∈ s) {f : α → γ} (hdf : 0 < f d) :
1295+
∑ (m : α) in s.erase d, f m < ∑ (m : α) in s, f m :=
1296+
begin
1297+
nth_rewrite_rhs 0 ←finset.insert_erase hd,
1298+
rw finset.sum_insert (finset.not_mem_erase d s),
1299+
exact lt_add_of_pos_left _ hdf,
1300+
end
1301+
12931302
/-- If a product is 1 and the function is 1 except possibly at one
12941303
point, it is 1 everywhere on the `finset`. -/
12951304
@[to_additive "If a sum is 0 and the function is 0 except possibly at one

0 commit comments

Comments
 (0)