-
Notifications
You must be signed in to change notification settings - Fork 2
Description
A proof in src/Bluebell/Logic/JointCondition.lean contains a sorry.
🤖 AI Analysis:
Statement Explanation
This theorem, C_and, states a distributivity property for the joint conditioning modality 𝑪_ over logical conjunction ∧. It asserts that if a resource a satisfies both 𝑪_ μ K₁ and 𝑪_ μ K₂, and for any outcome v of the distribution μ, the hyper-assertions K₁ v and K₂ v depend on disjoint sets of indices, then a also satisfies 𝑪_ μ (fun v => and (K₁ v) (K₂ v)).
-
Hypotheses:
a ∈ 𝑪_ μ K₁ ∧ 𝑪_ μ K₂: The resourceasatisfies twojointConditionproperties simultaneously. This means there exist two sets of witnesses,(P₁, p₁, κ₁)and(P₂, p₂, κ₂), each satisfying the conditions of thejointConditiondefinition with respect toa.h : ∀ v, relevantIndices (K₁ v) ∩ relevantIndices (K₂ v) = ∅: This is a crucial separation condition. It states that for any valuevthat can be drawn fromμ, the set of indices relevant toK₁ vis disjoint from the set of indices relevant toK₂ v.
-
Goal:
a ∈ 𝑪_ μ (fun v => and (K₁ v) (K₂ v)): We need to show thatasatisfies a single, combinedjointCondition. This involves constructing a new witness(P, p, κ)and proving that it satisfies the required properties, where the inner hyper-assertion is the conjunctionK₁ v ∧ K₂ v.
Context
This theorem is a fundamental property of the jointCondition modality (𝑪_), which is the formalization of the "Supercond modality" from the accompanying paper. It establishes how this modality interacts with logical conjunction, analogous to rules in separation logic that relate logical and separating conjunction (∧ vs ∗).
The proof relies heavily on the concept of relevantIndices, which captures the spatial "footprint" of a hyper-assertion on the indexed CMRA IndexedPSpPm. The disjointness hypothesis h is the key that allows for the composition of the witnesses from the two conjuncts on the left-hand side. This theorem is structurally similar to the sep_of_and lemma, which states that P ∧ Q ⊢ P ∗ Q under index disjointness. Proving C_and is a critical step in showing that 𝑪_ behaves like a logical modality and can be used for compositional reasoning about probabilistic programs.
Proof Suggestion
The proof strategy is to construct a single witness for the goal 𝑪_ μ (fun v => and (K₁ v) (K₂ v)) by combining the two witnesses obtained from the hypothesis a ∈ 𝑪_ μ K₁ ∧ 𝑪_ μ K₂.
-
Unpack witnesses: Start by unfolding the definitions. Use
intro a haandcases ha with ha1 ha2. Then, fromha1andha2, which are existential statements, obtain the witnesses:⟨P₁, p₁, h₁, κ₁, hinc₁, hμ₁, hK₁⟩and⟨P₂, p₂, h₂, κ₂, hinc₂, hμ₂, hK₂⟩. -
Construct combined witness: Define a new set of witnesses
(P, p, h, κ)by combining the corresponding components from the two initial sets. The natural way to combine them is using the CMRA's composition operation (•), which forPSpPminvolvesProbabilitySpace.indepProductfor probability spaces andPermission.opfor permissions.- Define
P iusingProbabilitySpace.indepProduct (P₁ i) (P₂ i). - Define
p i := p₁ i • p₂ i. - Define
κ i vas the measure resulting from theMeasure.IndependentProductofκ₁ i vandκ₂ i v.
- Define
-
Prove properties for the combined witness: The main work is to prove the three required conjuncts for your constructed witness:
a. Inclusion: Show that the resource built from(P, p)is included ina. You havehinc₁andhinc₂, which state that the resources forK₁andK₂are included ina. You'll need to show that their composition is also included ina. This may require a lemma akin to(x ≤ z ∧ y ≤ z) → x • y ≤ zwhenxandyare "disjoint," which is what therelevantIndicescondition provides.
b. Measure Factorization: Prove that∀ i, (P i).μ = μ.toMeasure.bind (κ i). This will require a lemma establishing howMeasure.binddistributes over the independent product of measures, i.e., showing thatindepProduct (μ.bind κ₁) (μ.bind κ₂) = μ.bind (indepProduct κ₁ κ₂).
c. Inner Assertion: Prove that for anyv ∈ μ.support, the hyper-assertionand (K₁ v) (K₂ v)holds on the resource constructed from the combined kernelκ.
- Leta'_vbe the resource built fromκandp. This resource will be the composition of the resourcesa₁'_v(fromκ₁,p₁) anda₂'_v(fromκ₂,p₂).
- You need to showa'_v ∈ K₁ vanda'_v ∈ K₂ v. You already havea₁'_v ∈ K₁ vfromhK₁.
- To provea₁'_v • a₂'_v ∈ K₁ v, use the disjointness hypothesishand the definition ofrelevantIndices. The propertyisIrrelevantimplies thatK₁ vis unaffected by composing a resource (likea₂'_v) that is trivial on its relevant indices. The disjointness condition ensures this holds. A similar argument works forK₂ v.
Goal: Replace the sorry with a complete proof.
Code Snippet:
theorem C_and [DecidableEq I] [Fintype I]
(h : ∀ v, relevantIndices (K₁ v) ∩ relevantIndices (K₂ v) = ∅) :
𝑪_ μ K₁ ∧ 𝑪_ μ K₂ ⊢ 𝑪_ μ (fun v => and (K₁ v) (K₂ v)) := by
sorry