Class HistoryBasedSigF (ora: RandomOracle) {SFo: SigmaAlgebraFamily RandomHistory} := {
measurable_subspace_legal: forall P, is_measurable_subspace P -> LegalHistoryAntiChain P;
is_measurable_subspace_same_covered: forall P Q: HistoryAntiChain, same_covered_anti_chain P Q -> is_measurable_subspace P -> is_measurable_subspace Q;
is_measurable_set_same_covered: forall (O1 O2 P1 P2: HistoryAntiChain) H1 H2, Included P1 O1 -> Included P2 O2 -> same_covered_anti_chain O1 O2 -> same_covered_anti_chain P1 P2 -> PrFamily.is_measurable_set P1 (exist is_measurable_subspace O1 H1) -> PrFamily.is_measurable_set P2 (exist is_measurable_subspace O2 H2);
max_anti_chain_measurable: forall P, is_max_anti_chain P -> is_measurable_subspace P
}.
Section RandomVariable.
Context {ora: RandomOracle} {SFo: SigmaAlgebraFamily RandomHistory}.
Definition RandomVarDomain {HBSFo: HistoryBasedSigF ora}: Type := PrFamily.measurable_subspace.
Definition RandomVarDomain_HistoryAntiChain {HBSFo: HistoryBasedSigF ora} (Omega: RandomVarDomain): HistoryAntiChain := Build_HistoryAntiChain _ (proj1_sig Omega) (measurable_subspace_legal _ (proj2_sig Omega)).
Global Coercion RandomVarDomain_HistoryAntiChain: RandomVarDomain >-> HistoryAntiChain.
Definition RandomVariable {HBSFo: HistoryBasedSigF ora} (Omega: RandomVarDomain) (A: Type) {SA: SigmaAlgebra A}: Type := PrFamily.MeasurableFunction Omega A.
Global Identity Coercion RandomVariable_MeasurableFunction: RandomVariable >-> PrFamily.MeasurableFunction.
Definition MeasurableSubset {HBSFo: HistoryBasedSigF ora} (Omega: RandomVarDomain): Type := PrFamily.measurable_set Omega.
Definition MeasurableSubset_HistoryAntiChain {HBSFo: HistoryBasedSigF ora} {Omega: RandomVarDomain} (P: MeasurableSubset Omega): HistoryAntiChain.
exists (PrFamily.measurable_set_Ensemble Omega P).
assert (Included (PrFamily.measurable_set_Ensemble Omega P) Omega).
+ unfold PrFamily.measurable_set_Ensemble.
intros ? [? ?].
auto.
+ eapply LegalHistoryAntiChain_Included; eauto.
apply measurable_subspace_legal.
destruct Omega; auto.
Defined.
Global Coercion MeasurableSubset_HistoryAntiChain: MeasurableSubset >-> HistoryAntiChain.
Context {HBSFo: HistoryBasedSigF ora}.

Lemma MeasurableSubset_in_domain: forall (Omega: RandomVarDomain) (P: MeasurableSubset Omega) h,
P h ->
Omega h.