Mathlib.Probability.Kernel.Three­Bernoulli

This module bundles the finite-density construction of three conditionally independent Boolean marks over a base probability law, together with its base marginal, conditional-independence, selected-mark, and cell-integra

Selected­Law­KL 13 core · 1 supporting · 7 submodules This module collects density, likelihood, conditional-KL, and quadratic comparison results for two selected three-Bernoulli laws with a common base measure and treatment propensity.
Basic 12 core · 5 supporting The density coordinates put first mark and the remaining-mark pair before the base. ★ jointLaw_probability

Three Bernoulli marks over an arbitrary base law

The density coordinates put first mark and the remaining-mark pair before the base. This lets the finite counting-measure construction feed the existing three-block conditional-independence theorem when the base is standard Borel. The public joint coordinates are (x, (a, (y₀, y₁))).

def bitMass reviewed
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli

The mass of a Boolean Bernoulli mark with success probability p at the specified Boolean value.

Definition (Lean source)
p :
ℝ
b :
bitMass p b :
ℝ
if b then p else 1 - p
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli.bitMass · Causalean/Mathlib/Probability/Kernel/ThreeBernoulli/Basic.lean:25
def cellMass reviewed
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli

The selected cell mass at first mark a and selected value y, from first-mark probability and the two remaining-mark probabilities: the Bernoulli mass of the first mark at a times the Bernoulli mass at y of the mark that a selects, whose success probability is q₁ when a is true and q₀ when a is false.

Definition (Lean source)
p q₀ q₁ :
ℝ
a y :
cellMass p q₀ q₁ a y :
ℝ
bitMass p a * bitMass (if a then q₁ else q₀) y
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli.cellMass · Causalean/Mathlib/Probability/Kernel/ThreeBernoulli/Basic.lean:29
def tripleMass reviewed
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli

The product mass of three independent Bernoulli marks at the specified triple, with their three success probabilities.

Definition (Lean source)
p q₀ q₁ :
ℝ
a y₀ y₁ :
tripleMass p q₀ q₁ a y₀ y₁ :
ℝ
bitMass p a * bitMass q₀ y₀ * bitMass q₁ y₁
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli.tripleMass · Causalean/Mathlib/Probability/Kernel/ThreeBernoulli/Basic.lean:37
abbrev DensityCoord reviewed
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli

Coordinates for the finite-count density consist of first mark, the pair of remaining marks, and the base space.

Definition (Lean source)
X :
Type u
DensityCoord X :
Type (max 0 u)
Bool × ((Bool × Bool) × X)
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli.DensityCoord · Causalean/Mathlib/Probability/Kernel/ThreeBernoulli/Basic.lean:42
abbrev FullCoord reviewed
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli

Coordinates for the public three-mark law consist of the base space, first mark, and both remaining marks.

Definition (Lean source)
X :
Type u
FullCoord X :
Type (max u 0)
X × (Bool × (Bool × Bool))
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli.FullCoord · Causalean/Mathlib/Probability/Kernel/ThreeBernoulli/Basic.lean:46
abbrev SelectedCoord reviewed
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli

Coordinates for the selected-mark law consist of the base space, first mark, and the realized selected value.

Definition (Lean source)
X :
Type u
SelectedCoord X :
Type (max u 0)
X × (Bool × Bool)
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli.SelectedCoord · Causalean/Mathlib/Probability/Kernel/ThreeBernoulli/Basic.lean:50
def reference reviewed
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli

The finite-count reference measure combines counting measures on three Boolean marks with a base measure.

Definition (Lean source)
X :
μ :
reference μ :
(Measure.count : Measure Bool).prod (((Measure.count : Measure Bool).prod (Measure.count : Measure Bool)).prod μ)
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli.reference · Causalean/Mathlib/Probability/Kernel/ThreeBernoulli/Basic.lean:54 · uses DensityCoord
def density reviewed
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli

The product Bernoulli density at one three-mark point uses three base-dependent mark probabilities: it is the product of the three Bernoulli masses of the point's marks, evaluated at the point's base value and read as an extended nonnegative number (a negative product, possible only when a probability leaves the unit interval, is replaced by zero).

Definition (Lean source)
X :
Type u
e q₀ q₁ :
X → ℝ
z :
density e q₀ q₁ z :
ℝ≥0∞
ofReal (tripleMass (e z.2.2) (q₀ z.2.2) (q₁ z.2.2) z.1 z.2.1.1 z.2.1.2)
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli.density · Causalean/Mathlib/Probability/Kernel/ThreeBernoulli/Basic.lean:61 · uses DensityCoord
def densityLaw reviewed
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli

The three-mark measure in density coordinates is the product-counting reference measure weighted by the three Bernoulli probabilities.

Definition (Lean source)
X :
μ :
e q₀ q₁ :
X → ℝ
densityLaw μ e q₀ q₁ :
(reference μ).withDensity (density e q₀ q₁)
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli.densityLaw · Causalean/Mathlib/Probability/Kernel/ThreeBernoulli/Basic.lean:70 · uses DensityCoord
def toFull reviewed
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli

The reordering to base-first three-mark coordinates sends density coordinates to (x,a,y₀,y₁).

Definition (Lean source)
X :
Type u
z :
toFull z :
(z.2.2, (z.1, z.2.1))
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli.toFull · Causalean/Mathlib/Probability/Kernel/ThreeBernoulli/Basic.lean:76 · uses DensityCoord , FullCoord
def jointLaw reviewed
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli

The joint law of base, first mark, and remaining marks is the reordered finite-count Bernoulli density law.

Definition (Lean source)
X :
μ :
e q₀ q₁ :
X → ℝ
jointLaw μ e q₀ q₁ :
(densityLaw μ e q₀ q₁).map toFull
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli.jointLaw · Causalean/Mathlib/Probability/Kernel/ThreeBernoulli/Basic.lean:81 · uses FullCoord
theorem jointLaw_probability reviewed
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli

The base-first joint law is a probability measure under a probability base law, measurable mark probabilities, and unit-interval bounds.

Formal statement
X :
e q₀ q₁ :
X → ℝ
he :
hq₀ :
hq₁ :
he01 :
∀ x, e x ∈ Icc (0 : ℝ) 1
hq₀01 :
∀ x, q₀ x ∈ Icc (0 : ℝ) 1
hq₁01 :
∀ x, q₁ x ∈ Icc (0 : ℝ) 1
Proof (Lean source)
theorem jointLaw_probability {X : Type u} [MeasurableSpace X] (μ : Measure X) [IsProbabilityMeasure μ] (e q₀ q₁ : X → ℝ) (he : Measurable e) (hq₀ : Measurable q₀) (hq₁ : Measurable q₁) (he01 : ∀ x, e x ∈ Icc (0 : ℝ) 1) (hq₀01 : ∀ x, q₀ x ∈ Icc (0 : ℝ) 1) (hq₁01 : ∀ x, q₁ x ∈ Icc (0 : ℝ) 1) : IsProbabilityMeasure (jointLaw μ e q₀ q₁) := by -- Transport `densityLaw_probability` through measurable `toFull` and -- simplify the measure of `univ` under `Measure.map`. haveI : IsProbabilityMeasure (densityLaw μ e q₀ q₁) := densityLaw_probability μ e q₀ q₁ he hq₀ hq₁ he01 hq₀01 hq₁01 exact Measure.isProbabilityMeasure_map (by unfold toFull fun_prop)
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli.jointLaw_probability · Causalean/Mathlib/Probability/Kernel/ThreeBernoulli/Basic.lean:205 · uses FullCoord , jointLaw
5 supporting declarations (lemmas, instances)
Selection 4 core · 6 supporting The selected law is an independent four-cell density over first mark and the realized selected value. ★ jointLaw_selectMark_map

Selected Bernoulli cells

The selected law is an independent four-cell density over first mark and the realized selected value. Its equality with the three-mark observation pushforward and the four measurable base-cell integrals are stated here.

def selectMark reviewed
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli

The selected observation of a three-mark point retains the base and first mark of that point and keeps only the remaining mark that the first mark selects: the second remaining mark when the first mark is true, the first remaining mark when it is false.

Definition (Lean source)
X :
Type u
z :
selectMark z :
(z.1, (z.2.1, if z.2.1 then z.2.2.2 else z.2.2.1))
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli.selectMark · Causalean/Mathlib/Probability/Kernel/ThreeBernoulli/Selection.lean:23 · uses FullCoord , SelectedCoord
def selectedDensity reviewed
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli

The selected four-cell density at a cell (first mark, selected value) and base value uses first-mark probability and remaining-mark probabilities: it is the selected cell mass of that cell at that base value, read as an extended nonnegative number (a negative value is replaced by zero).

Definition (Lean source)
X :
Type u
e q₀ q₁ :
X → ℝ
z :
(Bool × Bool) × X
selectedDensity e q₀ q₁ z :
ℝ≥0∞
ofReal (cellMass (e z.2) (q₀ z.2) (q₁ z.2) z.1.1 z.1.2)
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli.selectedDensity · Causalean/Mathlib/Probability/Kernel/ThreeBernoulli/Selection.lean:30
def selectedLaw reviewed
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli

The explicit selected four-cell law weights the product of counting measure on the four cells and the base measure by the selected cell probabilities, then reorders coordinates to put the base first.

Definition (Lean source)
X :
μ :
e q₀ q₁ :
X → ℝ
selectedLaw μ e q₀ q₁ :
(((Measure.count : Measure Bool).prod (Measure.count : Measure Bool)).prod μ).withDensity (selectedDensity e q₀ q₁) |>.map (fun z => (z.2, z.1))
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli.selectedLaw · Causalean/Mathlib/Probability/Kernel/ThreeBernoulli/Selection.lean:38 · uses SelectedCoord
theorem jointLaw_selectMark_map reviewed
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli

The pushforward of the three-mark law under observation is the explicit four-cell selected law for a probability base measure, measurable mark probabilities, and unit-interval bounds.

Formal statement
X :
e q₀ q₁ :
X → ℝ
he :
hq₀ :
hq₁ :
he01 :
∀ x, e x ∈ Icc (0 : ℝ) 1
hq₀01 :
∀ x, q₀ x ∈ Icc (0 : ℝ) 1
hq₁01 :
∀ x, q₁ x ∈ Icc (0 : ℝ) 1
(jointLaw μ e q₀ q₁).map selectMark = selectedLaw μ e q₀ q₁
Proof (Lean source)
theorem jointLaw_selectMark_map {X : Type u} [MeasurableSpace X] (μ : Measure X) [IsProbabilityMeasure μ] (e q₀ q₁ : X → ℝ) (he : Measurable e) (hq₀ : Measurable q₀) (hq₁ : Measurable q₁) (he01 : ∀ x, e x ∈ Icc (0 : ℝ) 1) (hq₀01 : ∀ x, q₀ x ∈ Icc (0 : ℝ) 1) (hq₁01 : ∀ x, q₁ x ∈ Icc (0 : ℝ) 1) : (jointLaw μ e q₀ q₁).map selectMark = selectedLaw μ e q₀ q₁ := by classical have hTo : Measurable (toFull (X := X)) := by unfold toFull fun_prop have hObs : Measurable (selectMark (X := X)) := by unfold selectMark apply Measurable.prodMk · fun_prop · apply Measurable.prodMk · fun_prop · apply Measurable.ite · measurability · fun_prop · fun_prop have hComp : Measurable (selectMark ∘ toFull : DensityCoord X → SelectedCoord X) := hObs.comp hTo apply Measure.ext intro S hS let E : Set (DensityCoord X) := {z | (z.2.2, (z.1, if z.1 then z.2.1.2 else z.2.1.1)) ∈ S} let F : Set ((Bool × Bool) × X) := {z | (z.2, z.1) ∈ S} have hE : MeasurableSet E := by unfold E exact hS.preimage hComp have hF : MeasurableSet F := by unfold F exact hS.preimage (by fun_prop) have hd : Measurable (density e q₀ q₁) := by have hbit (p : X → ℝ) (hp : Measurable p) (b : DensityCoord X → Bool) (hb : Measurable b) : Measurable (fun z : DensityCoord X => bitMass (p z.2.2) (b z)) := by unfold bitMass apply Measurable.ite · exact hb (MeasurableSet.singleton true) · exact hp.comp (by fun_prop) · exact measurable_const.sub (hp.comp (by fun_prop)) unfold density tripleMass exact ENNReal.measurable_ofReal.comp (((hbit e he (fun z => z.1) (by fun_prop)).mul (hbit q₀ hq₀ (fun z => z.2.1.1) (by fun_prop))).mul (hbit q₁ hq₁ (fun z => z.2.1.2) (by fun_prop))) have hD : Measurable (selectedDensity e q₀ q₁) := by unfold selectedDensity cellMass bitMass apply ENNReal.measurable_ofReal.comp apply mul · apply Measurable.ite · measurability · exact he.comp (by fun_prop) · exact measurable_const.sub (he.comp (by fun_prop)) · apply Measurable.ite · measurability · apply Measurable.ite · measurability · exact hq₁.comp (by fun_prop) · exact hq₀.comp (by fun_prop) · exact measurable_const.sub (by apply Measurable.ite · measurability · exact hq₁.comp (by fun_prop) · exact hq₀.comp (by fun_prop)) rw [jointLaw, Measure.map_map hObs hTo] rw [Measure.map_apply hComp hS] change densityLaw μ e q₀ q₁ E = _ rw [selectedLaw, Measure.map_apply (by fun_prop) hS] change densityLaw μ e q₀ q₁ E = (((Measure.count : Measure Bool).prod (Measure.count : Measure Bool)).prod μ).withDensity (selectedDensity e q₀ q₁) F rw [densityLaw, withDensity_apply _ hE, ← lintegral_indicator hE] rw [withDensity_apply _ hF, ← lintegral_indicator hF] rw [reference, lintegral_prod_symm' _ (hd.indicator hE)] simp only [lintegral_count, tsum_fintype] conv_lhs => rw [lintegral_prod_symm' _ (by fun_prop)] conv_rhs => rw [lintegral_prod_symm' _ (hD.indicator hF)] have hleft (x : X) : (∫⁻ z : Bool × Bool, ∑ a : Bool, E.indicator (density e q₀ q₁) (a, (z, x)) ∂(Measure.count : Measure Bool).prod (Measure.count : Measure Bool)) = ∑ y₀ : Bool, ∑ y₁ : Bool, ∑ a : Bool, E.indicator (density e q₀ q₁) (a, ((y₀, y₁), x)) := by rw [lintegral_prod _ (by exact (measurable_of_finite _).aemeasurable)] simp only [lintegral_count, tsum_fintype] have hright (x : X) : (∫⁻ z : Bool × Bool, F.indicator (selectedDensity e q₀ q₁) (z, x) ∂(Measure.count : Measure Bool).prod (Measure.count : Measure Bool)) = ∑ a : Bool, ∑ y : Bool, F.indicator (selectedDensity e q₀ q₁) ((a, y), x) := by rw [lintegral_prod _ (by exact (measurable_of_finite _).aemeasurable)] simp only [lintegral_count, tsum_fintype] have hnonneg (x : X) (a y₀ y₁ : Bool) : 0 ≤ tripleMass (e x) (q₀ x) (q₁ x) a y₀ y₁ := by unfold tripleMass exact mul_nonneg (mul_nonneg (bitMass_nonneg _ (he01 x) _) (bitMass_nonneg _ (hq₀01 x) _)) (bitMass_nonneg _ (hq₁01 x) _) have hcollapse (x : X) (a y : Bool) : (∑ y₀ : Bool, ∑ y₁ : Bool, if (if a then y₁ else y₀) = y then density e q₀ q₁ (a, ((y₀, y₁), x)) else 0) = selectedDensity e q₀ q₁ ((a, y), x) := by have hterm (y₀ y₁ : Bool) : (if (if a then y₁ else y₀) = y then density e q₀ q₁ (a, ((y₀, y₁), x)) else 0) = ofReal (if (if a then y₁ else y₀) = y then tripleMass (e x) (q₀ x) (q₁ x) a y₀ y₁ else 0) := by split_ifs <;> simp [density] simp_rw [hterm] calc (∑ y₀ : Bool, ∑ y₁ : Bool, ofReal (if (if a then y₁ else y₀) = y then tripleMass (e x) (q₀ x) (q₁ x) a y₀ y₁ else 0)) = ∑ y₀ : Bool, ofReal (∑ y₁ : Bool, if (if a then y₁ else y₀) = y then tripleMass (e x) (q₀ x) (q₁ x) a y₀ y₁ else 0) := by apply Finset.sum_congr rfl intro y₀ _ exact (ENNReal.ofReal_sum_of_nonneg (fun y₁ _ => by split_ifs <;> first | exact hnonneg x a y₀ y₁ | exact le_rfl)).symm _ = ofReal (∑ y₀ : Bool, ∑ y₁ : Bool, if (if a then y₁ else y₀) = y then tripleMass (e x) (q₀ x) (q₁ x) a y₀ y₁ else 0) := by exact (ENNReal.ofReal_sum_of_nonneg (fun y₀ _ => Finset.sum_nonneg fun y₁ _ => by split_ifs <;> first | exact hnonneg x a y₀ y₁ | exact le_rfl)).symm _ = selectedDensity e q₀ q₁ ((a, y), x) := by rw [tripleMass_selected_sum] rfl apply lintegral_congr intro x rw [hleft x, hright x] calc (∑ y₀ : Bool, ∑ y₁ : Bool, ∑ a : Bool, E.indicator (density e q₀ q₁) (a, ((y₀, y₁), x))) = ∑ a : Bool, ∑ y₀ : Bool, ∑ y₁ : Bool, E.indicator (density e q₀ q₁) (a, ((y₀, y₁), x)) := by simp only [Fintype.sum_bool] ac_rfl _ = ∑ a : Bool, ∑ y : Bool, if (x, (a, y)) ∈ S then selectedDensity e q₀ q₁ ((a, y), x) else 0 := by apply Finset.sum_congr rfl intro a _ simp only [Fintype.sum_bool] rw [← hcollapse x a false, ← hcollapse x a true] cases a · by_cases h0 : (x, (false, false)) ∈ S <;> by_cases h1 : (x, (false, true)) ∈ S <;> simp [E, indicator, h0, h1] · by_cases h0 : (x, (true, false)) ∈ S <;> by_cases h1 : (x, (true, true)) ∈ S <;> simp [E, indicator, h0, h1] <;> ac_rfl _ = ∑ a : Bool, ∑ y : Bool, F.indicator (selectedDensity e q₀ q₁) ((a, y), x) := by simp [F, indicator]
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli.jointLaw_selectMark_map · Causalean/Mathlib/Probability/Kernel/ThreeBernoulli/Selection.lean:46 · uses FullCoord , SelectedCoord , jointLaw , selectMark , selectedLaw
6 supporting declarations (lemmas, instances)
Independence 3 core · 2 supporting The measurable-set identity works for an arbitrary measurable base space. ★ jointLaw_condIndepFun

Conditional independence of the finite marks

The measurable-set identity works for an arbitrary measurable base space. When the space is standard Borel, it is also exposed as Mathlib's formal conditional-independence relation.

def firstMarkSetMass reviewed
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli

The Bernoulli probability of a Boolean first mark set at first-mark probability p for the set s.

Definition (Lean source)
p :
ℝ
s :
firstMarkSetMass p s :
ℝ≥0∞
by classical exact ∑ a : Bool, if a ∈ s then ofReal (bitMass p a) else 0
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli.firstMarkSetMass · Causalean/Mathlib/Probability/Kernel/ThreeBernoulli/Independence.lean:25
def remainingPairSetMass reviewed
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli

The product Bernoulli probability of a remaining-mark-pair set for the two success probabilities and the set t.

Definition (Lean source)
q₀ q₁ :
ℝ
t :
remainingPairSetMass q₀ q₁ t :
ℝ≥0∞
by classical exact ∑ y₀ : Bool, ∑ y₁ : Bool, if (y₀, y₁) ∈ t then ofReal (bitMass q₀ y₀ * bitMass q₁ y₁) else 0
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli.remainingPairSetMass · Causalean/Mathlib/Probability/Kernel/ThreeBernoulli/Independence.lean:30
theorem jointLaw_condIndepFun reviewed
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli

Under the base-first joint law, the first mark and the pair of remaining marks are conditionally independent given the σ-algebra generated by the base coordinate, for standard Borel bases, a probability base law, measurable mark probabilities, and unit-interval bounds.

Formal statement
e q₀ q₁ :
X → ℝ
he :
hq₀ :
hq₁ :
he01 :
∀ x, e x ∈ Icc (0 : ℝ) 1
hq₀01 :
∀ x, q₀ x ∈ Icc (0 : ℝ) 1
hq₁01 :
∀ x, q₁ x ∈ Icc (0 : ℝ) 1
letI : IsProbabilityMeasure (jointLaw μ e q₀ q₁)
Proof (Lean source)
theorem jointLaw_condIndepFun {X : Type u} [MeasurableSpace X] [StandardBorelSpace X] (μ : Measure X) [IsProbabilityMeasure μ] (e q₀ q₁ : X → ℝ) (he : Measurable e) (hq₀ : Measurable q₀) (hq₁ : Measurable q₁) (he01 : ∀ x, e x ∈ Icc (0 : ℝ) 1) (hq₀01 : ∀ x, q₀ x ∈ Icc (0 : ℝ) 1) (hq₁01 : ∀ x, q₁ x ∈ Icc (0 : ℝ) 1) : letI : IsProbabilityMeasure (jointLaw μ e q₀ q₁) := jointLaw_probability μ e q₀ q₁ he hq₀ hq₁ he01 hq₀01 hq₁01 CondIndepFun (comap (fun z : FullCoord X => z.1) inferInstance) ((measurable_fst : Measurable (fun z : FullCoord X => z.1)).comap_le) (fun z : FullCoord X => z.2.1) (fun z : FullCoord X => z.2.2) (jointLaw μ e q₀ q₁) := by letI : IsProbabilityMeasure (densityLaw μ e q₀ q₁) := densityLaw_probability μ e q₀ q₁ he hq₀ hq₁ he01 hq₀01 hq₁01 letI : IsProbabilityMeasure (jointLaw μ e q₀ q₁) := jointLaw_probability μ e q₀ q₁ he hq₀ hq₁ he01 hq₀01 hq₁01 change CondIndepFun (comap (fun z : FullCoord X => z.1) inferInstance) ((measurable_fst : Measurable (fun z : FullCoord X => z.1)).comap_le) (fun z : FullCoord X => z.2.1) (fun z : FullCoord X => z.2.2) ((densityLaw μ e q₀ q₁).map toFull) apply condIndepFun_of_map (φ := toFull) (by unfold toFull; fun_prop) (by fun_prop) (by fun_prop) (by fun_prop) change CondIndepFun (comap (fun z : DensityCoord X => z.2.2) inferInstance) ((measurable_snd.comp measurable_snd : Measurable (fun z : DensityCoord X => z.2.2)).comap_le) (fun z : DensityCoord X => z.1) (fun z : DensityCoord X => z.2.1) (densityLaw μ e q₀ q₁) exact densityLaw_condIndepFun μ e q₀ q₁ he hq₀ hq₁ he01 hq₀01 hq₁01
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli.jointLaw_condIndepFun · Causalean/Mathlib/Probability/Kernel/ThreeBernoulli/Independence.lean:194 · uses FullCoord , jointLaw , jointLaw_probability
2 supporting declarations (lemmas, instances)
Marginal 1 core · 2 supporting Finite Boolean summation removes the three marks and recovers the original base law. ★ jointLaw_base_marginal

Base marginal and support transfer

Finite Boolean summation removes the three marks and recovers the original base law. Full-mass measurable support sets then transfer to three marks.

theorem jointLaw_base_marginal reviewed
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli

The base marginal of the public joint law equals μ for a probability base law μ when mark probabilities are measurable and unit-interval valued.

Formal statement
X :
e q₀ q₁ :
X → ℝ
he :
hq₀ :
hq₁ :
he01 :
∀ x, e x ∈ Icc (0 : ℝ) 1
hq₀01 :
∀ x, q₀ x ∈ Icc (0 : ℝ) 1
hq₁01 :
∀ x, q₁ x ∈ Icc (0 : ℝ) 1
(jointLaw μ e q₀ q₁).map (fun z : FullCoord X => z.1) = μ
Proof (Lean source)
theorem jointLaw_base_marginal {X : Type u} [MeasurableSpace X] (μ : Measure X) [IsProbabilityMeasure μ] (e q₀ q₁ : X → ℝ) (he : Measurable e) (hq₀ : Measurable q₀) (hq₁ : Measurable q₁) (he01 : ∀ x, e x ∈ Icc (0 : ℝ) 1) (hq₀01 : ∀ x, q₀ x ∈ Icc (0 : ℝ) 1) (hq₁01 : ∀ x, q₁ x ∈ Icc (0 : ℝ) 1) : (jointLaw μ e q₀ q₁).map (fun z : FullCoord X => z.1) = μ := by -- Compose the two measurable coordinate maps and apply -- `densityLaw_base_marginal`. unfold jointLaw rw [Measure.map_map (by fun_prop) (by unfold toFull; fun_prop)] change (densityLaw μ e q₀ q₁).map (fun z : DensityCoord X => z.2.2) = μ exact densityLaw_base_marginal μ e q₀ q₁ he hq₀ hq₁ he01 hq₀01 hq₁01
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli.jointLaw_base_marginal · Causalean/Mathlib/Probability/Kernel/ThreeBernoulli/Marginal.lean:118 · uses FullCoord , jointLaw
2 supporting declarations (lemmas, instances)
Parameters 4 core · 11 supporting Parameters packages the base measure, mark probabilities, and hypotheses so model structures can obtain the full and selected laws with short field lemmas. ★ condIndepFun

Packaged Bernoulli marking assumptions

Parameters packages the base measure, mark probabilities, and hypotheses so model structures can obtain the full and selected laws with short field lemmas.

structure Parameters reviewed
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli

A reusable package of Bernoulli-marking parameters over a measurable base space records a probability measure, three measurable success probabilities, and their pointwise unit-interval bounds.

Definition (Lean source)
X :
μ :
μ_prob :
e :
X → ℝ
q₀ :
X → ℝ
q₁ :
X → ℝ
he :
hq₀ :
hq₁ :
he01 :
∀ x, e x ∈ Icc (0 : ℝ) 1
hq₀01 :
∀ x, q₀ x ∈ Icc (0 : ℝ) 1
hq₁01 :
∀ x, q₁ x ∈ Icc (0 : ℝ) 1
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli.Parameters · Causalean/Mathlib/Probability/Kernel/ThreeBernoulli/Parameters.lean:24
def fullLaw reviewed
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli.Parameters

The three-mark law associated with a parameter package uses its base law and mark probabilities.

Definition (Lean source)
X :
P :
fullLaw P :
jointLaw P.μ P.e P.q₀ P.q₁
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli.Parameters.fullLaw · Causalean/Mathlib/Probability/Kernel/ThreeBernoulli/Parameters.lean:42 · uses FullCoord , Parameters
def selected reviewed
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli.Parameters

The selected-mark law associated with a parameter package uses its base law and four Bernoulli cell masses.

Definition (Lean source)
X :
P :
selected P :
selectedLaw P.μ P.e P.q₀ P.q₁
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli.Parameters.selected · Causalean/Mathlib/Probability/Kernel/ThreeBernoulli/Parameters.lean:47 · uses Parameters , SelectedCoord
theorem condIndepFun reviewed
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli.Parameters

Under the packaged three-mark law, the first mark and the pair of remaining marks are conditionally independent given the σ-algebra generated by the base coordinate, for standard Borel bases and valid Bernoulli parameters.

Formal statement
Proof (Lean source)
theorem condIndepFun {X : Type u} [MeasurableSpace X] [StandardBorelSpace X] (P : Parameters X) : letI : IsProbabilityMeasure P.μ := P.μ_prob letI : IsProbabilityMeasure P.fullLaw := P.fullLaw_probability CondIndepFun (comap (fun z : FullCoord X => z.1) inferInstance) ((measurable_fst : Measurable (fun z : FullCoord X => z.1)).comap_le) (fun z : FullCoord X => z.2.1) (fun z : FullCoord X => z.2.2) P.fullLaw := by letI : IsProbabilityMeasure P.μ := P.μ_prob simpa [fullLaw] using jointLaw_condIndepFun P.μ P.e P.q₀ P.q₁ P.he P.hq₀ P.hq₁ P.he01 P.hq₀01 P.hq₁01
Causalean.Mathlib.Probability.Kernel.ThreeBernoulli.Parameters.condIndepFun · Causalean/Mathlib/Probability/Kernel/ThreeBernoulli/Parameters.lean:107 · uses FullCoord , Parameters , fullLaw , fullLaw_probability
11 supporting declarations (lemmas, instances)