File size: 2,030 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 | import OAI.Combinatorics.BalancedRyser.Local.InjectionExposure
import OAI.Combinatorics.BalancedRyser.Probability.FiniteUniformConditioning
namespace OAI
namespace Balanced.InjectionExposure
variable {I J : Type*} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J]
[Nonempty (I βͺ J)]
theorem original_uniform_conditioned (K : Finset I) (base : I βͺ J)
(h : β e β (β(completions K base) : Set (I βͺ J)),
e β (PMF.uniformOfFintype (I βͺ J)).support) :
(PMF.uniformOfFintype (I βͺ J)).filter (β(completions K base)) h =
PMF.uniformOfFinset (completions K base) (completions_nonempty K base) := by
classical
let S := completions K base
have : Nonempty (βS : Set (I βͺ J)) := β¨β¨base, by simp [S]β©β©
rw [uniform_filter_eq_subtype_map]
ext e
by_cases he : e β completions K base
Β· rw [PMF.map_apply, tsum_eq_single (β¨e, heβ© : (βS : Set (I βͺ J)))]
Β· simp only [PMF.uniformOfFintype_apply, PMF.uniformOfFinset_apply,
he, ite_true]
exact congrArg (fun n : β => (n : ENNReal)β»ΒΉ)
(Fintype.card_coe (completions K base))
Β· intro f hf
rw [ite_eq_right]
intro hef
exact hf (Subtype.ext hef.symm)
Β· rw [PMF.uniformOfFinset_apply_of_notMem (completions_nonempty K base) he,
PMF.map_apply]
apply ENNReal.tsum_eq_zero.mpr
intro f
rw [ite_eq_right]
intro hef
exact he (hef βΈ f.property)
theorem original_conditioned_next_event (K : Finset I) (base : I βͺ J)
(h : β e β (β(completions K base) : Set (I βͺ J)),
e β (PMF.uniformOfFintype (I βͺ J)).support)
(i : I) (hi : i β K) (P : J β Prop) [DecidablePred P] :
(((PMF.uniformOfFintype (I βͺ J)).filter (β(completions K base)) h).toOuterMeasure
{e | P (e i)}).toReal =
(((remaining K base).filter P).card : β) / ((remaining K base).card : β) := by
rw [original_uniform_conditioned K base h]
exact next_event_probability K base i hi P
end Balanced.InjectionExposure
end OAI
|