cfahlgren1/math / lean /OAI /Combinatorics /Progressions /Sampling /PositivePartitionScore.lean
cfahlgren1's picture
download
raw
948 Bytes
import Mathlib
namespace OAI
section
namespace Erdos3
open scoped BigOperators
theorem exists_weighted_partition_score {Ω ι : Type*} [Fintype Ω] [Fintype ι] [Nonempty ι]
(a : Ω → ℝ) (w : ι → Ω → ℝ) (hsum : ∀ x, ∑ i, w i x = 1)
{S : ℝ} (hS : S ≤ 𝔼 x, a x) :
∃ i, S / Fintype.card ι ≤ 𝔼 x, a x * w i x := by
have htotal : (∑ i, 𝔼 x, a x * w i x) = 𝔼 x, a x := by
rw [← Finset.expect_sum_comm]
apply Finset.expect_congr rfl
intro x _
rw [← Finset.mul_sum, hsum, mul_one]
have hmean : (𝔼 i, 𝔼 x, a x * w i x) = (𝔼 x, a x) / Fintype.card ι := by
rw [Fintype.expect_eq_sum_div_card, htotal]
obtain ⟨i, _, hi⟩ := Finset.exists_le_of_le_expect Finset.univ_nonempty
(show S / Fintype.card ι ≤ 𝔼 i, 𝔼 x, a x * w i x from
hmean.symm ▸ div_le_div_of_nonneg_right hS (Nat.cast_nonneg _))
exact ⟨i, hi⟩
end Erdos3
end
end OAI

Xet Storage Details

Size:
948 Bytes
·
Xet hash:
6cf327aa4bca1d7a154256bd90d90d1ecd4efa6c5ce6662026f63f8806ce58d3

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.