Skip to content

a small lemma about the constant RV#220

Open
affeldt-aist wants to merge 2 commits into
masterfrom
proba_20260501
Open

a small lemma about the constant RV#220
affeldt-aist wants to merge 2 commits into
masterfrom
proba_20260501

Conversation

@affeldt-aist
Copy link
Copy Markdown
Owner

Note that there is only one lemma: the other one is actually an instance of pfwd1_const_RV from your PR #219 @t6s

Copy link
Copy Markdown
Collaborator

@t6s t6s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about stating an equivalence instead of inference?

Lemma dirac_const_RV {R : realType} (U T : finType) (P : R.-fdist U)
  (X : {RV P -> T}) (a : T) :
  `Pr[X = a] = 1 <-> ({in [set u | P u != 0], X =1 const_RV P a}).
Proof.
rewrite pfwd1E Pr_to_cplt (rwP eqP) -eqr_opp opprB subr_eq addrC subrr.
split.
  move=> /eqP + u; rewrite inE => + Pu0.
  have [->//|Xua] := eqVneq (X u) a.
  move/eqP; rewrite psumr_eq0// => /allP /(_ u).
  by rewrite mem_index_enum !inE Xua/= (negPf Pu0) => /(_ erefl).
move=> H; apply/eqP/Pr_set0P => u; have := H u; rewrite !inE/=.
have [//|?] := eqVneq (P u) 0.
by move/(_ erefl) ->; rewrite /const_RV/cst/= eqxx.
Qed.

Comment thread probability/proba.v
(X : {RV P -> T}) (a : T) :
`Pr[X = a] = 1 -> {in [set u | P u != 0], X =1 const_RV P a}.
Proof.
move=> Xa1 u; rewrite inE => Pu0.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proof can be shortened:

Proof.
move=> /eqP + u; rewrite inE => + Pu0. 
have [->//|Xua] := eqVneq (X u) a.
suff: `Pr[ (X) = (a) ] != 1 by move/negPf ->.
rewrite pfwd1E Pr_to_cplt -eqr_opp opprB subr_eq addrC subrr psumr_neq0//.
by apply/hasP; exists u => //; rewrite !inE Xua/= fdist_gt0.
Qed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants