a small lemma about the constant RV#220
Open
affeldt-aist wants to merge 2 commits into
Open
Conversation
t6s
reviewed
May 8, 2026
Collaborator
t6s
left a comment
There was a problem hiding this comment.
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.
| (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. |
Collaborator
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note that there is only one lemma: the other one is actually an instance of
pfwd1_const_RVfrom your PR #219 @t6s