math / data /lean /OAI /NumberTheory /PiExponent /Analysis /CollisionOccupancy.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
2.41 kB
import Mathlib
namespace OAI
namespace PiExponent.Collision
open scoped BigOperators
variable {G : Type*}
theorem sum_sq_le_card_mul_sum_sq (S : Finset G) (n : G β†’ ℝ) :
(βˆ‘ a ∈ S, n a) ^ 2 ≀ (S.card : ℝ) * βˆ‘ a ∈ S, n a ^ 2 := by
simpa using Finset.sum_mul_sq_le_sq_mul_sq S (fun _ : G => (1 : ℝ)) n
theorem sum_sq_le_card_mul_total_sq (S U : Finset G) (hSU : S βŠ† U)
(n : G β†’ ℝ) :
(βˆ‘ a ∈ S, n a) ^ 2 ≀ (S.card : ℝ) * βˆ‘ a ∈ U, n a ^ 2 := by
apply (sum_sq_le_card_mul_sum_sq S n).trans
apply mul_le_mul_of_nonneg_left _ (Nat.cast_nonneg _)
exact Finset.sum_le_sum_of_subset_of_nonneg hSU (fun a _ _ => sq_nonneg (n a))
theorem mass_sq_div_card_le_total_sq (S U : Finset G) (hSU : S βŠ† U)
(n : G β†’ ℝ) {mass : ℝ} (hmass : 0 ≀ mass)
(hlow : mass ≀ βˆ‘ a ∈ S, n a) (hcard : 0 < S.card) :
mass ^ 2 / (S.card : ℝ) ≀ βˆ‘ a ∈ U, n a ^ 2 := by
have hsq : mass ^ 2 ≀ (βˆ‘ a ∈ S, n a) ^ 2 := by
exact pow_le_pow_leftβ‚€ hmass hlow 2
have hc : (0 : ℝ) < S.card := by exact_mod_cast hcard
apply (div_le_iffβ‚€ hc).2
calc
mass ^ 2 ≀ (βˆ‘ a ∈ S, n a) ^ 2 := hsq
_ ≀ (S.card : ℝ) * βˆ‘ a ∈ U, n a ^ 2 :=
sum_sq_le_card_mul_total_sq S U hSU n
_ = (βˆ‘ a ∈ U, n a ^ 2) * (S.card : ℝ) := mul_comm _ _
theorem fraction_sq_mul_mass_sq_div_card_le_total_sq
(S U : Finset G) (hSU : S βŠ† U) (n : G β†’ ℝ)
{Ξ· M : ℝ} (hΞ· : 0 ≀ Ξ·) (hM : 0 ≀ M)
(hlow : Ξ· * M ≀ βˆ‘ a ∈ S, n a) (hcard : 0 < S.card) :
Ξ· ^ 2 * M ^ 2 / (S.card : ℝ) ≀ βˆ‘ a ∈ U, n a ^ 2 := by
simpa only [mul_pow] using
mass_sq_div_card_le_total_sq S U hSU n (mul_nonneg hΞ· hM) hlow hcard
variable [Fintype G]
theorem sum_sq_le_card_mul_univ_sq (S : Finset G) (n : G β†’ ℝ) :
(βˆ‘ a ∈ S, n a) ^ 2 ≀ (S.card : ℝ) * βˆ‘ a, n a ^ 2 := by
exact sum_sq_le_card_mul_total_sq S Finset.univ (Finset.subset_univ S) n
theorem nat_occupancy_square_lower_bound (S : Finset G) (n : G β†’ β„•)
{Ξ· : ℝ} {M : β„•} (hΞ· : 0 ≀ Ξ·)
(hlow : Ξ· * (M : ℝ) ≀ βˆ‘ a ∈ S, (n a : ℝ)) (hcard : 0 < S.card) :
Ξ· ^ 2 * (M : ℝ) ^ 2 / (S.card : ℝ) ≀ βˆ‘ a, (n a : ℝ) ^ 2 := by
exact fraction_sq_mul_mass_sq_div_card_le_total_sq S Finset.univ
(Finset.subset_univ S) (fun a => (n a : ℝ)) hΞ· (Nat.cast_nonneg M) hlow hcard
end PiExponent.Collision
end OAI