-
Notifications
You must be signed in to change notification settings - Fork 3
Description
A proof in src/Bluebell/Logic/JointCondition.lean contains a sorry.
🤖 AI Analysis:
Statement Explanation
This theorem, C_transfer, establishes a transfer principle for the joint conditioning modality 𝑪_. It states that if two probability mass functions, μ on type β and μ' on type β', are essentially the same up to a relabeling of their outcomes, then their corresponding joint conditioning modalities are logically related.
Hypotheses:
f : μ'.support ≃ μ.support: An equivalence (a bijection) between the set of outcomes whereμ'is non-zero (μ'.support) and the set of outcomes whereμis non-zero (μ.support). This means the distributions have the same number of possible outcomes.h : ∀ b, (hb : b ∈ μ'.support) → μ' b = μ (f ⟨b, hb⟩).1: For any outcomebin the support ofμ', its probabilityμ' bis equal to the probabilityμassigns to the corresponding outcomef ⟨b, hb⟩inμ's support. This confirms thatμ'is just a relabeling ofμviaf.
Goal:
The goal is to prove 𝑪_ μ K ⊢ 𝑪_ μ' (fun b => K (f ⟨b, sorry⟩)). This is an entailment in the logic of hyper-assertions, meaning for any resource a, if a satisfies 𝑪_ μ K, it must also satisfy 𝑪_ μ' K', where K' is a new family of hyper-assertions defined by applying K to the relabeled outcomes from μ'. The sorry in the goal is a placeholder for a proof that b is in the support of μ', which will be available from the context when this part of the goal is being proved.
In short, the theorem says that if you can prove a property K holds for all outcomes of a distribution μ, you can transfer that result to an equivalent distribution μ' by relabeling the outcomes in K.
Context
This theorem is one of several fundamental logical rules for the jointCondition modality (𝑪_), which is a cornerstone of the reasoning system being built. Other theorems in this section establish properties like consequence (C_conseq), framing (C_frame), associativity (C_assoc), and interaction with logical connectives like and, exists, and forall.
C_transfer is a structural rule that demonstrates the modality's invariance to the specific representation of outcomes in a probability distribution. It allows for abstracting away from concrete data types. For example, a result proven for a boolean distribution (PMF Bool) could be transferred to a distribution over any two-element type, provided the probabilities match. This is a crucial property for portability and reuse of proofs in probabilistic verification. It connects the logic of jointCondition with algebraic properties of probability distributions, specifically the notion of isomorphism between them.
Proof Suggestion
The proof involves showing that the witnesses for 𝑪_ μ K can be transformed into valid witnesses for 𝑪_ μ' K'.
- Unfold and Destructure: Start by unfolding the entailment
⊢. Assume you have a resourceaand a hypothesisha : a ∈ 𝑪_ μ K. - Use
rcases ha with ⟨P, p, h_compat, κ, h_incl, h_factor, h_K⟩to get the witnesses (P,p,h_compat,κ) and the three conditions they satisfy for𝑪_ μ K. - Construct New Witnesses: Your goal is to prove
a ∈ 𝑪_ μ' (fun b => K (f ⟨b, sorry⟩)). You need to construct a new kernel,κ'. The other witnessesP,p,h_compatcan be reused directly.- Define
κ' : (i : I) → β' → Measure ...based onκ. A good choice is to use the equivalencef. For an outcomeb' : β', defineκ' i b' := if h : b' ∈ μ'.support then κ i (f ⟨b', h⟩).1 else 0. This maps an outcome inμ''s support to the corresponding outcome inμ's support and reuses the original kernelκ.
- Define
- Prove the Three Conditions for
𝑪_ μ':- Inclusion: The inclusion property
(fun i => ...) ≤ afollows directly fromh_inclbecause you are reusingPandp. - Measure Factorization: This is the most technical part. You need to prove
∀ i, (P i).μ = μ'.toMeasure.bind (κ' i).- Start with what you know from
h_factor:(P i).μ = μ.toMeasure.bind (κ i). - The main task is to show
μ.toMeasure.bind (κ i) = μ'.toMeasure.bind (κ' i). - Use the hypothesis
hto relateμ.toMeasureandμ'.toMeasure. It implies thatμ'.toMeasureis themapofμ.toMeasureunder an extension off.symm. - Use a lemma like
MeasureTheory.Measure.bind_mapto perform a change of variables in the integral that definesbind. Your definition ofκ'is crafted to make the integrands equal after this change of variables.
- Start with what you know from
- Kernel Property: You need to prove
∀ b ∈ μ'.support, K (f ⟨b, hb⟩).1 (resource built from κ' at b).- Take an arbitrary
b ∈ μ'.support. - Let
v_sub := f ⟨b, hb⟩. Note thatv_sub.1 ∈ μ.support. - From
h_K, you have a proof forK v_sub.1 (resource built from κ at v_sub.1). - Show that the resource constructed from
κ'atbis identical to the resource constructed fromκatv_sub.1. This boils down to showingκ' j b = κ j v_sub.1for allj, which is true by your definition ofκ'. - The goal then follows directly from
h_K.
- Take an arbitrary
- Inclusion: The inclusion property
Goal: Replace the sorry with a complete proof.
Code Snippet:
theorem C_transfer {β' : Type*} [MeasurableSpace β'] {μ' : PMF β'}
(f : μ'.support ≃ μ.support)
(h : ∀ b, (hb : b ∈ μ'.support) → μ' b = μ (f ⟨b, hb⟩).1) :
𝑪_ μ K ⊢ 𝑪_ μ' (fun b => K (f ⟨b, sorry⟩)) := by