-
Notifications
You must be signed in to change notification settings - Fork 2
Description
A proof in src/Bluebell/Logic/Ownership.lean contains a sorry.
🤖 AI Analysis:
Statement Explanation
This theorem states an equivalence between two hyper-assertions. On the left-hand side, we have the separating conjunction (HyperAssertion.sep, denoted ∗) of two assertTrue assertions. assertTrue i E₁ asserts that the Boolean-valued expression E₁ is true almost surely (with probability 1) in the context of the probability space at index i. The separating conjunction means that the resources for these two assertions must be disjoint.
On the right-hand side, we have a single assertTrue assertion for the logical conjunction (∧) of the two expressions.
In essence, the theorem says: holding "E₁ is true almost surely" and "E₂ is true almost surely" on separate resources is equivalent to holding "E₁ and E₂ are jointly true almost surely" on a single resource.
Context
This theorem is a crucial logical rule for reasoning about events that are true almost surely. It establishes that the assertTrue assertion is duplicable or persistent. In separation logic, a persistent assertion P satisfies P ∗ Q ⊣⊢ P ∧ Q for any Q. This means having P in a disjoint part of the state is equivalent to having it as a global fact alongside Q.
This property is fundamental for probabilistic reasoning within this framework. It allows programmers to freely duplicate or combine facts about events that happen with probability one, which simplifies proofs significantly. This theorem connects the separating conjunction (sep) of the logic with the standard logical conjunction (∧) for the specific case of assertTrue assertions. Its proof relies on the underlying structure of the IndexedPSpPm CMRA, particularly how probability spaces are composed (indepMul).
Proof Suggestion
The proof requires showing entailment in both directions, as HyperAssertion.equiv is defined as mutual entailment.
A key strategy is to first prove an intermediate equivalence:
HyperAssertion.and (assertTrue i E₁) (assertTrue i E₂) ⊣⊢ assertTrue i (fun x => E₁ x ∧ E₂ x)
-
Prove
and ⊢ assertTrue:- Start by unfolding the definitions of
assertTrue,assertSampledFrom, andownIndexedProb. - An assumption
x ∈ and (assertTrue i E₁) (assertTrue i E₂)implies that the resourcexsatisfies both assertions. - This means there exist two probability space families,
P₁andP₂. By inspecting the definition ofown, you can argue they must be the same probability space familyPdetermined by the resourcex. - Therefore, the measure
(P i).μmakes bothE₁andE₂true almost surely. - Use the standard probability theory fact that if two events have probability 1, their intersection also has probability 1. Conclude that
(P i).μmakesE₁ ∧ E₂true almost surely, which satisfies the goal.
- Start by unfolding the definitions of
-
Prove
assertTrue ⊢ and:- This direction is more straightforward. If
E₁ ∧ E₂is true almost surely, then bothE₁andE₂are individually true almost surely under the same measure. Unfolding the definitions should lead to the goal.
- This direction is more straightforward. If
With the above equivalence established, the main goal reduces to proving:
HyperAssertion.sep (assertTrue i E₁) (assertTrue i E₂) ⊣⊢ HyperAssertion.and (assertTrue i E₁) (assertTrue i E₂)
-
Prove
sep ⊢ and:- This direction is given by the lemma
sep_of_and_assertTrueavailable in the file. You can instantiate itsPwithassertTrue i E₂.
- This direction is given by the lemma
-
Prove
and ⊢ sep:- This is the most complex part and shows that
assertTrueis duplicable. - Assume
x ∈ and (assertTrue i E₁) (assertTrue i E₂). From step 1, this gives you a single probability space familyPand permissionp. - You need to construct two resources,
yandz, such thaty ∈ assertTrue i E₁,z ∈ assertTrue i E₂, andy • z ≼ x. - A common technique for duplicable assertions is to split the resource
x. You can try to setytoxitself. Then you need to find a resourcezthat satisfiesassertTrue i E₂and for whichx • z ≼ x. This typically requireszto be (or be included in) a unit of the•operation. - Investigate the CMRA structure of
PSpPm. The unit involvesPSp.emp(WithTop.none) andPermission.one. However,assertTruerequires aWithTop.someprobability space. You may need to construct a witness forassertTrue i E₂using a "minimal" resource: a probability space that acts as a unit forindepMul(if one exists) and a permission that is a unit for•(e.g., additive identity0for all variables). This will likely require lemmas about the properties ofindepMuland the permission CMRA.
- This is the most complex part and shows that
Goal: Replace the sorry with a complete proof.
Code Snippet:
theorem sep_assertTrue_iff {i : I} {E₁ E₂ : (α → V) → Bool} :
HyperAssertion.equiv
(HyperAssertion.sep
(assertTrue (I := I) (α := α) (V := V) (F := F) i E₁)
(assertTrue (I := I) (α := α) (V := V) (F := F) i E₂))
(assertTrue (I := I) (α := α) (V := V) (F := F) i (fun x => E₁ x ∧ E₂ x)) := by
sorry