math / data /lean /OAI /Combinatorics /BalancedRyser /Local /InjectionConditioning.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
2.03 kB
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