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, and ownIndexedProb.
- An assumption
x ∈ and (assertTrue i E₁) (assertTrue i E₂) implies that the resource x satisfies both assertions.
- This means there exist two probability space families,
P₁ and P₂. By inspecting the definition of own, you can argue they must be the same probability space family P determined by the resource x.
- Therefore, the measure
(P i).μ makes both E₁ and E₂ 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).μ makes E₁ ∧ E₂ true almost surely, which satisfies the goal.
-
Prove assertTrue ⊢ and:
- This direction is more straightforward. If
E₁ ∧ E₂ is true almost surely, then both E₁ and E₂ are individually true almost surely under the same measure. Unfolding the definitions should lead to the goal.
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_assertTrue available in the file. You can instantiate its P with assertTrue i E₂.
-
Prove and ⊢ sep:
- This is the most complex part and shows that
assertTrue is duplicable.
- Assume
x ∈ and (assertTrue i E₁) (assertTrue i E₂). From step 1, this gives you a single probability space family P and permission p.
- You need to construct two resources,
y and z, such that y ∈ assertTrue i E₁, z ∈ assertTrue i E₂, and y • z ≼ x.
- A common technique for duplicable assertions is to split the resource
x. You can try to set y to x itself. Then you need to find a resource z that satisfies assertTrue i E₂ and for which x • z ≼ x. This typically requires z to be (or be included in) a unit of the • operation.
- Investigate the CMRA structure of
PSpPm. The unit involves PSp.emp (WithTop.none) and Permission.one. However, assertTrue requires a WithTop.some probability space. You may need to construct a witness for assertTrue i E₂ using a "minimal" resource: a probability space that acts as a unit for indepMul (if one exists) and a permission that is a unit for • (e.g., additive identity 0 for all variables). This will likely require lemmas about the properties of indepMul and the permission CMRA.
Goal: Replace the sorry with a complete proof.
Link to the sorry on GitHub
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
A proof in
src/Bluebell/Logic/Ownership.leancontains asorry.🤖 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 twoassertTrueassertions.assertTrue i E₁asserts that the Boolean-valued expressionE₁is true almost surely (with probability 1) in the context of the probability space at indexi. The separating conjunction means that the resources for these two assertions must be disjoint.On the right-hand side, we have a single
assertTrueassertion 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
assertTrueassertion is duplicable or persistent. In separation logic, a persistent assertionPsatisfiesP ∗ Q ⊣⊢ P ∧ Qfor anyQ. This means havingPin a disjoint part of the state is equivalent to having it as a global fact alongsideQ.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 ofassertTrueassertions. Its proof relies on the underlying structure of theIndexedPSpPmCMRA, particularly how probability spaces are composed (indepMul).Proof Suggestion
The proof requires showing entailment in both directions, as
HyperAssertion.equivis 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:assertTrue,assertSampledFrom, andownIndexedProb.x ∈ and (assertTrue i E₁) (assertTrue i E₂)implies that the resourcexsatisfies both assertions.P₁andP₂. By inspecting the definition ofown, you can argue they must be the same probability space familyPdetermined by the resourcex.(P i).μmakes bothE₁andE₂true almost surely.(P i).μmakesE₁ ∧ E₂true almost surely, which satisfies the goal.Prove
assertTrue ⊢ and: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.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:sep_of_and_assertTrueavailable in the file. You can instantiate itsPwithassertTrue i E₂.Prove
and ⊢ sep:assertTrueis duplicable.x ∈ and (assertTrue i E₁) (assertTrue i E₂). From step 1, this gives you a single probability space familyPand permissionp.yandz, such thaty ∈ assertTrue i E₁,z ∈ assertTrue i E₂, andy • z ≼ x.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.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.Goal: Replace the
sorrywith a complete proof.Link to the sorry on GitHub
Code Snippet: