File size: 2,406 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | 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
|