File size: 1,951 Bytes
2fca478 | 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 | import Mathlib.Algebra.BigOperators.Ring.Finset
import Mathlib.Algebra.Order.BigOperators.Group.Finset
import Mathlib.Algebra.Order.Field.Rat
namespace OAI
universe uΩ uI
namespace PeriodicTilingThree
open scoped BigOperators
theorem exists_avoiding_of_sum_card_lt {Ω : Type uΩ} {I : Type uI} [Fintype Ω]
(events : Finset I) (bad : I → Finset Ω)
(hsmall : (∑ i ∈ events, (bad i).card) < Fintype.card Ω) :
∃ ω, ∀ i ∈ events, ω ∉ bad i := by
classical
have hUnion : (events.biUnion bad).card < (Finset.univ : Finset Ω).card := by
rw [Finset.card_univ]
exact lt_of_le_of_lt Finset.card_biUnion_le hsmall
obtain ⟨ω, _, hω⟩ := Finset.exists_mem_notMem_of_card_lt_card hUnion
refine ⟨ω, ?_⟩
intro i hi hbad
exact hω (Finset.mem_biUnion.mpr ⟨i, hi, hbad⟩)
theorem exists_avoiding_of_uniform_ratio_lt {Ω : Type uΩ} {I : Type uI} [Fintype Ω]
(events : Finset I) (bad : I → Finset Ω) (r : ℚ)
(hΩ : 0 < Fintype.card Ω)
(hbound : ∀ i ∈ events, ((bad i).card : ℚ) / (Fintype.card Ω : ℚ) ≤ r)
(hsmall : (events.card : ℚ) * r < 1) :
∃ ω, ∀ i ∈ events, ω ∉ bad i := by
have hpos : (0 : ℚ) < (Fintype.card Ω : ℚ) := Nat.cast_pos.mpr hΩ
have hsum : (∑ i ∈ events, ((bad i).card : ℚ)) < (Fintype.card Ω : ℚ) := by
calc
(∑ i ∈ events, ((bad i).card : ℚ))
≤ ∑ i ∈ events, r * (Fintype.card Ω : ℚ) :=
Finset.sum_le_sum fun i hi => (div_le_iff₀ hpos).mp (hbound i hi)
_ = (events.card : ℚ) * r * (Fintype.card Ω : ℚ) := by
simp only [Finset.sum_const, nsmul_eq_mul, mul_assoc]
_ < 1 * (Fintype.card Ω : ℚ) := mul_lt_mul_of_pos_right hsmall hpos
_ = (Fintype.card Ω : ℚ) := one_mul _
apply exists_avoiding_of_sum_card_lt events bad
apply (Nat.cast_lt (α := ℚ)).mp
simpa only [Nat.cast_sum] using hsum
end PeriodicTilingThree
end OAI
|