cfahlgren1/math / lean /OAI /Geometry /PeriodicTiling /FiniteEventUnion.lean
cfahlgren1's picture
download
raw
1.95 kB
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

Xet Storage Details

Size:
1.95 kB
·
Xet hash:
01d94027cb05baba57f3b3ee28c62310c3577c3330fec3cc48fbb0def86fb04c

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