Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove sampleSpace variables #112

Merged
merged 8 commits into from
Nov 6, 2023
Merged

Remove sampleSpace variables #112

merged 8 commits into from
Nov 6, 2023

Conversation

fzaiser
Copy link
Collaborator

@fzaiser fzaiser commented Nov 3, 2023

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

b := BernoulliExpNegSampleCaseLe1(Rationals.Int(1));
gamma' := Rationals.Rational(gamma'.numer - gamma'.denom, gamma'.denom);
assert Model.GammaReductionLoop((true, prevGamma))(prevS) == Model.GammaReductionLoop((b, gamma'))(s);
Copy link
Collaborator

@stefan-aws stefan-aws Nov 6, 2023

Choose a reason for hiding this comment

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

This file seems to be unrelated to the rest of the PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The changes I made caused the resource usage of this proof to increase, which is why I had to modify it.

Copy link
Collaborator

@stefan-aws stefan-aws left a comment

Choose a reason for hiding this comment

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

I personally think we should keep the definitions in Measures.dfy as generic / close to the established theory as possible, even though the particular event space in RandomSource is a trivial one. I like some of the other changes in this PR though.

@@ -26,20 +33,12 @@ module Measures {
f(i) + CountableSum(f, i+1)
}

ghost function Powerset<A(!new)>(): iset<A> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Good you remove this one. I don't think the naming was right.

iset x: T | x !in event
}

ghost function SampleSpace<T(!new)>(): iset<T> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This function seems very useful, even if we'd keep the generality elsewhere.

Complement(iset{})
}

ghost predicate IsSigmaAlgebra<T(!new)>(eventSpace: iset<iset<T>>) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think we should remove sampleSpace here (and elsewhere). Imo it's confusing for people that read this section for the first time, and it doesn't seem to save us from writing too much code elsewhere.

@fzaiser
Copy link
Collaborator Author

fzaiser commented Nov 6, 2023

I find it redundant to carry around a sampleSpace: iset<A> everywhere, when in every instance that we can foresee, it'll just be equal to iset a | true. The reason we need it in the mathematical formulation is that it's based on set theory. But in Dafny, we're based on type theory, so the sample space is clear from the type A. So I don't see the point of having this variable everywhere with a predictable value. As another argument, Lean's measurable spaces only specify the measurable sets and don't define a set of all elements of the type: https://github.com/leanprover-community/mathlib4/blob/9257586cca3c453ea33261e155792fa0d22d39dd//Mathlib/MeasureTheory/MeasurableSpace/Defs.lean#L48-L58

@stefan-aws
Copy link
Collaborator

Could you add one comment in Measures.dfy that the sample space we are working with is "the set of elements of type T" (and generally, sample spaces can be obtained by defining appropriate (sub-)types).

@fzaiser
Copy link
Collaborator Author

fzaiser commented Nov 6, 2023

Added some comments around σ-algebras.

@stefan-aws stefan-aws merged commit b21286d into main Nov 6, 2023
7 checks passed
@fzaiser fzaiser deleted the samplespace branch November 6, 2023 18:43
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