File size: 4,018 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 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | import OAI.Combinatorics.BalancedRyser.Local.InjectionAuxiliaryExposure
namespace OAI
namespace Balanced.InjectionExposure
noncomputable section
open scoped Classical BigOperators
variable {I J Z : Type*} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J]
theorem mem_completions_symm (K : Finset I) (e f : I βͺ J) :
e β completions K f β f β completions K e := by
simp only [mem_completions]
exact β¨fun h j hj => (h j hj).symm, fun h j hj => (h j hj).symmβ©
theorem completions_eq_of_mem (K : Finset I) (e f : I βͺ J)
(h : e β completions K f) : completions K e = completions K f := by
ext a
simp only [mem_completions] at h β’
exact β¨fun ha j hj => (ha j hj).trans (h j hj),
fun ha j hj => (ha j hj).trans (h j hj).symmβ©
variable [Nonempty (I βͺ J)]
theorem uniform_bind_completions (K : Finset I) :
(PMF.uniformOfFintype (I βͺ J)).bind
(fun e => PMF.uniformOfFinset (completions K e) (completions_nonempty K e)) =
PMF.uniformOfFintype (I βͺ J) := by
ext f
rw [PMF.bind_apply, tsum_fintype]
simp only [PMF.uniformOfFintype_apply]
rw [β Finset.mul_sum]
suffices hs : (β e : I βͺ J,
PMF.uniformOfFinset (completions K e) (completions_nonempty K e) f) = 1 by
rw [hs, mul_one]
have heq : (β e : I βͺ J,
PMF.uniformOfFinset (completions K e) (completions_nonempty K e) f) =
β e : I βͺ J, if e β completions K f then
((completions K f).card : ENNReal)β»ΒΉ else 0 := by
apply Finset.sum_congr rfl
intro e _
rw [PMF.uniformOfFinset_apply]
by_cases h : e β completions K f
Β· have hf : f β completions K e := (mem_completions_symm K e f).mp h
rw [ite_eq_left hf, ite_eq_left h, completions_eq_of_mem K e f h]
Β· have hf : f β completions K e := fun hf => h ((mem_completions_symm K f e).mp hf)
rw [ite_eq_right hf, ite_eq_right h]
rw [heq]
have hfilter : Finset.univ.filter (fun e => e β completions K f) = completions K f := by
ext e
simp
rw [β Finset.sum_filter, hfilter, Finset.sum_const, nsmul_eq_mul]
exact ENNReal.mul_inv_cancel
(by exact_mod_cast (completions_nonempty K f).card_pos.ne') (by simp)
theorem uniform_bind_auxiliaryLaw (K : Finset I)
(noise : (I βͺ J) β PMF Z) :
(PMF.uniformOfFintype (I βͺ J)).bind (fun e => auxiliaryLaw K e noise) =
(PMF.uniformOfFintype (I βͺ J)).bind
(fun e => (noise e).map (fun z => (e,z))) := by
unfold auxiliaryLaw
rw [β PMF.bind_bind, uniform_bind_completions]
theorem original_probability_eq_auxiliary_average (K : Finset I)
(noise : (I βͺ J) β PMF Z) (E : Set ((I βͺ J) Γ Z)) :
(((PMF.uniformOfFintype (I βͺ J)).bind
(fun e => (noise e).map (fun z => (e,z)))).toOuterMeasure E).toReal =
(β e : I βͺ J, ((auxiliaryLaw K e noise).toOuterMeasure E).toReal) /
Fintype.card (I βͺ J) := by
rw [β uniform_bind_auxiliaryLaw K noise, PMF.toOuterMeasure_bind_apply,
tsum_fintype, ENNReal.toReal_sum]
Β· simp_rw [ENNReal.toReal_mul, PMF.uniformOfFintype_apply,
ENNReal.toReal_inv, ENNReal.toReal_natCast]
rw [β Finset.mul_sum]
ring
Β· intro e _
apply ENNReal.mul_ne_top ((PMF.uniformOfFintype (I βͺ J)).apply_ne_top e)
rw [PMF.toOuterMeasure_apply]
exact PMF.tsum_coe_indicator_ne_top _ _
theorem original_probability_le_of_auxiliary (K : Finset I)
(noise : (I βͺ J) β PMF Z) (E : Set ((I βͺ J) Γ Z)) (B : β)
(h : β e, ((auxiliaryLaw K e noise).toOuterMeasure E).toReal β€ B) :
(((PMF.uniformOfFintype (I βͺ J)).bind
(fun e => (noise e).map (fun z => (e,z)))).toOuterMeasure E).toReal β€ B := by
rw [original_probability_eq_auxiliary_average K noise E]
have hc : (0 : β) < Fintype.card (I βͺ J) := by exact_mod_cast Fintype.card_pos
apply (div_le_iffβ hc).mpr
calc
_ β€ β _e : I βͺ J, B := Finset.sum_le_sum (fun e _ => h e)
_ = B * Fintype.card (I βͺ J) := by simp [mul_comm]
end
end Balanced.InjectionExposure
end OAI
|