Graph.FiniteDensity
Finite DAG product-density factorizations: coordinate dependence, normalized leaf elimination, and nonancestor-intervention marginal invariance without an SCM representation.
Factorization 7 core · 4 supporting This module packages a family of measurable normalized conditional densities on a finite DAG. ★ observationalDensity_intervene
Finite DAG density factorizations
This module packages a family of measurable normalized conditional densities on a finite DAG.
Each factor is an ℝ≥0∞-valued function of its node and parent coordinates. It also defines the
single-node replacement by a normalized parent-independent intervention density.
A finite DAG, coordinate value spaces, and coordinate reference measures determine a factorization interface of measurable, parent-local conditional densities normalized in their own coordinates.
Definition (Lean source)
A DAG factorization, a finite node set, and a full assignment determine the product density over that node set.
Definition (Lean source)
A DAG factorization and a full assignment determine the observational product density over all nodes.
Definition (Lean source)
An intervention target, coordinate value spaces, and coordinate reference measures determine a measurable unit-mass replacement density for that target.
Definition (Lean source)
A DAG factorization, intervention target, and normalized replacement density determine the factorization obtained by replacing that target's factor.
Definition (Lean source)
A DAG factorization, intervention target, replacement density, and full assignment determine the truncated product density for that intervention.
Definition (Lean source)
A DAG factorization, intervention target, and replacement density give the same product density whether intervention is represented by factor replacement or by the explicit truncated product.
Formal statement
Proof (Lean source)
4 supporting declarations (lemmas, instances)
-
measurable_partialDensitytheorem — A DAG factorization and a finite node set have a measurable partial product density.hypothesesconclusionMeasurable (B.partialDensity S)Proof (Lean source)
@[fun_prop] theorem Factorization.measurable_partialDensity {G : DAG V} (B : Factorization G X μ) (S : Finset V) : Measurable (B.partialDensity S) := by change Measurable (fun v ↦ ∏ i ∈ S, B.factor i v) exact Finset.measurable_prod S (fun i _ ↦ B.measurable_factor i) -
measurable_observationalDensitytheorem — A DAG factorization has a measurable observational product density.Proof (Lean source)
@[fun_prop] theorem Factorization.measurable_observationalDensity {G : DAG V} (B : Factorization G X μ) : Measurable B.observationalDensity := by change Measurable (B.partialDensity univ) exact B.measurable_partialDensity univ -
targetRatio_dependsOntheorem — A DAG factorization, a target node, and a numerator depending on that node's value give a density ratio determined only by the target and its parents.hypothesesProof (Lean source)
theorem Factorization.targetRatio_dependsOn {G : DAG V} (B : Factorization G X μ) (i : V) (numerator : X i → ℝ≥0∞) : DependsOn (insert i (G.parents i)) (fun v ↦ numerator (v i) / B.factor i v) := by intro x y hxy exact congrArg₂ (· / ·) (congrArg numerator (hxy i (mem_insert_self i _))) (B.local_factor i hxy) -
measurable_interventionDensitytheorem — A DAG factorization, intervention target, and replacement density give a measurable truncated intervention density.hypothesesconclusionMeasurable (B.interventionDensity j q)Proof (Lean source)
@[fun_prop] theorem Factorization.measurable_interventionDensity {G : DAG V} (B : Factorization G X μ) (j : V) (q : InterventionDensity j X μ) : Measurable (B.interventionDensity j q) := by change Measurable (fun v ↦ q.density (v j) * B.partialDensity (Finset.univ.erase j) v) exact (q.measurable_density.comp (measurable_pi_apply j)).mul (B.measurable_partialDensity (Finset.univ.erase j))
Leaf 2 core · 2 supporting This module proves the one-coordinate analytic step behind finite Bayesian-network marginalization: a normalized factor at a leaf can be integrated away without changing the product of the remaining factors. ★ lintegral_partialDensity_leaf
Normalized leaf elimination
This module proves the one-coordinate analytic step behind finite Bayesian-network marginalization: a normalized factor at a leaf can be integrated away without changing the product of the remaining factors.
A finite DAG, a node, and a finite node set determine the property that the node is a leaf within that set.
A DAG factorization, a leaf within a finite node set, and a fixed assignment of the other coordinates show that integrating the normalized leaf factor removes exactly that factor from the product.
Formal statement
Proof (Lean source)
2 supporting declarations (lemmas, instances)
-
factor_update_eq_of_ne_of_not_parenttheorem — A DAG factorization, two distinct nodes, evidence that the updated node is not a parent of the other, a full assignment, and a new coordinate value leave the other node's local factor unchanged.hypothesesconclusionB.factor l (update v k x) = B.factor l vProof (Lean source)
theorem Factorization.factor_update_eq_of_ne_of_not_parent (B : Factorization G X μ) {k l : V} (hkl : k ≠ l) (hkpar : k ∉ G.parents l) (v : ∀ i, X i) (x : X k) : B.factor l (update v k x) = B.factor l v := by -- Apply locality and show every coordinate in `insert l (parents l)` is untouched by the update. apply B.local_factor l intro i hi have hik : i ≠ k := by intro h subst i exact (Finset.mem_insert.mp hi).elim hkl hkpar exact Function.update_of_ne hik x v -
partialDensity_erase_update_leaftheorem — A DAG factorization, a leaf of a finite node set, a full assignment, and a new leaf-coordinate value leave the product of all remaining factors unchanged.hypothesesconclusionB.partialDensity (S.erase k) (update v k x) = B.partialDensity (S.erase k) vProof (Lean source)
theorem Factorization.partialDensity_erase_update_leaf (B : Factorization G X μ) {S : Finset V} {k : V} (hleaf : IsLeafIn G k S) (v : ∀ i, X i) (x : X k) : B.partialDensity (S.erase k) (update v k x) = B.partialDensity (S.erase k) v := by -- Compare factors pointwise; leafhood rules out `k` as a parent of every retained node. unfold Factorization.partialDensity apply Finset.prod_congr rfl intro l hl have hlk : l ≠ k := (Finset.mem_erase.mp hl).1 have hlS : l ∈ S := (Finset.mem_erase.mp hl).2 apply B.factor_update_eq_of_ne_of_not_parent hlk.symm intro hkpar exact hleaf.2 l hlS hlk (G.mem_parents.mp hkpar)
Elimination 2 core · 3 supporting This module iterates normalized leaf elimination. ★ lmarginal_partialDensity_union_eq
Reverse-topological elimination outside a parent-closed set
This module iterates normalized leaf elimination. A parent-closed set retains all factors that can influence it, so factors outside it may be removed in reverse topological order. The result is stated both for an arbitrary retained set and for the complement marginal of a full density.
A finite DAG and a finite node set determine the property that the set contains every parent of each of its nodes.
A DAG factorization, a parent-closed retained set, and its disjointness from an eliminable set show that integrating every eliminable coordinate removes all of their factors.
Formal statement
Proof (Lean source)
3 supporting declarations (lemmas, instances)
-
exists_leaf_in_union_of_parentClosedtheorem — A parent-closed retained set, its disjointness from an eliminable set, and a nonempty eliminable set produce an eliminable node that is a leaf of their union.hypothesesconclusion∃ k ∈ T, IsLeafIn G k (A ∪ T)Proof (Lean source)
theorem exists_leaf_in_union_of_parentClosed {A T : Finset V} (hA : ParentClosed G A) (hAT : Disjoint A T) (hT : T.Nonempty) : ∃ k ∈ T, IsLeafIn G k (A ∪ T) := by -- Choose a `topoOrder`-maximal node of `T`; parent-closure excludes edges from it into `A`. obtain ⟨k, hkT, hkmax⟩ := Finset.exists_max_image T G.topoOrder hT refine ⟨k, hkT, mem_union_right A hkT, ?_⟩ intro l hlU hlk hkl rcases Finset.mem_union.mp hlU with hlA | hlT · have hkA : k ∈ A := hA hlA (G.mem_parents.mpr hkl) exact (Finset.disjoint_left.mp hAT hkA hkT) · exact (not_lt_of_ge (hkmax l hlT)) (G.topoOrder_lt k l hkl) -
lmarginal_compl_observationalDensity_eqtheorem — A DAG factorization and a parent-closed retained set show that integrating the observational density outside the set leaves precisely its retained factor product.hypothesesconclusion(∫⋯∫⁻_(univ \ A), B.observationalDensity ∂μ) = B.partialDensity AProof (Lean source)
theorem Factorization.lmarginal_compl_observationalDensity_eq (B : Factorization G X μ) {A : Finset V} (hA : ParentClosed G A) : (∫⋯∫⁻_(univ \ A), B.observationalDensity ∂μ) = B.partialDensity A := by -- Rewrite `univ` as `A ∪ (univ \ A)` and invoke the union elimination theorem. have huniv : A ∪ (univ \ A) = univ := Finset.union_sdiff_of_subset (Finset.subset_univ A) calc (∫⋯∫⁻_(univ \ A), B.observationalDensity ∂μ) = (∫⋯∫⁻_(univ \ A), B.partialDensity (A ∪ (univ \ A)) ∂μ) := by rw [huniv] rfl _ = B.partialDensity A := B.lmarginal_partialDensity_union_eq hA Finset.disjoint_sdiff -
lmarginal_compl_interventionDensity_eqtheorem — A DAG factorization, a parent-closed retained set, an intervention target outside that set, and a normalized replacement density show that integrating the intervention density outside the set leaves the same retained factor product.hypothesesB :Factorization G X μA :Finset VhA :ParentClosed G Aj :Vhj :j ∉ Aq :InterventionDensity j X μconclusion(∫⋯∫⁻_(univ \ A), B.interventionDensity j q ∂μ) = B.partialDensity AProof (Lean source)
theorem Factorization.lmarginal_compl_interventionDensity_eq (B : Factorization G X μ) {A : Finset V} (hA : ParentClosed G A) {j : V} (hj : j ∉ A) (q : InterventionDensity j X μ) : (∫⋯∫⁻_(univ \ A), B.interventionDensity j q ∂μ) = B.partialDensity A := by -- Rewrite the density as `(B.intervene j q).observationalDensity` and note its factors -- agree on `A`. calc (∫⋯∫⁻_(univ \ A), B.interventionDensity j q ∂μ) = (∫⋯∫⁻_(univ \ A), (B.intervene j q).observationalDensity ∂μ) := by rw [B.observationalDensity_intervene] _ = (B.intervene j q).partialDensity A := (B.intervene j q).lmarginal_compl_observationalDensity_eq hA _ = B.partialDensity A := by unfold Factorization.partialDensity funext v apply Finset.prod_congr rfl intro i hi have hij : i ≠ j := by intro hij subst i exact hj hi simp only [Factorization.intervene, hij, ↓reduceIte]
Main 4 core · 9 supporting This module turns reverse-topological density elimination into equality of measures. ★ ancestralMarginal_eq
Nonancestor marginal invariance for finite DAG product densities
This module turns reverse-topological density elimination into equality of measures. Replacing one normalized conditional density by a normalized parent-independent density preserves the marginal on every parent-closed set omitting the target, hence on the ancestral closure of every distinct node of which the target is not an ancestor. Measurable functions determined by that closure consequently have identical pushforward laws.
A DAG factorization determines its observational product measure.
Definition (Lean source)
A DAG factorization, an intervention target, and a normalized replacement density determine the corresponding single-target interventional product measure.
Definition (Lean source)
A finite DAG and a node determine the node's ancestral closure, including the node and all strict ancestors.
A DAG factorization, distinct intervention and queried nodes, evidence that the intervention target is not an ancestor of the queried node, and a normalized replacement density give identical observational and interventional laws on the queried node's ancestral closure.
Formal statement
Proof (Lean source)
9 supporting declarations (lemmas, instances)
-
mem_nodeAncestralClosure_ifftheorem — A queried node and a candidate node satisfy ancestral-closure membership exactly when the candidate is the queried node or an ancestor of it.Proof (Lean source)
theorem mem_nodeAncestralClosure_iff {i j : V} : j ∈ nodeAncestralClosure G i ↔ j = i ∨ G.isAncestor j i := by -- Unfold the closure and the graph's `ancestors` membership characterization. simp only [nodeAncestralClosure, Finset.mem_insert, G.mem_ancestors] -
parentClosed_nodeAncestralClosuretheorem — A node has an ancestral closure that contains every parent of each of its nodes.Proof (Lean source)
theorem parentClosed_nodeAncestralClosure (i : V) : ParentClosed G (nodeAncestralClosure G i) := by -- A parent of `i` is an ancestor; a parent of an ancestor reaches `i` by transitivity. intro k hk l hl rw [mem_nodeAncestralClosure_iff] at hk ⊢ rcases hk with rfl | hki · exact inr (G.mem_ancestors.mp (G.parents_subset_ancestors k hl)) · exact inr (G.isAncestor_trans (G.mem_ancestors.mp (G.parents_subset_ancestors k hl)) hki) -
selfParents_subset_nodeAncestralClosuretheorem — A node and all of its parents belong to that node's ancestral closure.Proof (Lean source)
theorem selfParents_subset_nodeAncestralClosure (i : V) : insert i (G.parents i) ⊆ nodeAncestralClosure G i := by -- Combine self-membership with `G.parents_subset_ancestors i`. intro j hj rw [mem_nodeAncestralClosure_iff] rcases Finset.mem_insert.mp hj with rfl | hj · exact inl rfl · exact inr (G.mem_ancestors.mp (G.parents_subset_ancestors i hj)) -
parentClosed_marginal_eqtheorem — A DAG factorization, a parent-closed retained set, an intervention target outside that set, and a normalized replacement density give identical observational and interventional marginals on the retained set.hypothesesB :Factorization G X μA :Finset VhA :ParentClosed G Aj :Vhj :j ∉ Aq :InterventionDensity j X μconclusionMeasure.map (coordinateProjection (X := X) A) B.observationalMeasure= Measure.map (coordinateProjection (X := X) A) (B.interventionMeasure j q)Proof (Lean source)
theorem Factorization.parentClosed_marginal_eq (B : Factorization G X μ) {A : Finset V} (hA : ParentClosed G A) {j : V} (hj : j ∉ A) (q : InterventionDensity j X μ) : Measure.map (coordinateProjection (X := X) A) B.observationalMeasure = Measure.map (coordinateProjection (X := X) A) (B.interventionMeasure j q) := by -- Apply the coordinate-density bridge to the two complement-marginal elimination identities. apply map_coordinateProjection_withDensity_eq_of_lmarginal_eq A B.measurable_observationalDensity (B.measurable_interventionDensity j q) rw [B.lmarginal_compl_observationalDensity_eq hA, B.lmarginal_compl_interventionDensity_eq hA hj q] -
map_eq_of_dependsOn_nodeAncestralClosuretheorem — A DAG factorization, distinct intervention and queried nodes, evidence that the intervention target is not an ancestor of the queried node, a normalized replacement density, a measurable outcome map, its dependence only on the queried node's ancestral closure, and an anchor assignment give the same observational and interventional outcome law.hypothesesB :Factorization G X μi j :Vhji :j ≠ ihnotAncestor :¬ G.isAncestor j iq :InterventionDensity j X μY :Type*f :(∀ k, X k) → Yhf :hdepends :DependsOn (nodeAncestralClosure G i) fx₀ :∀ k, X kconclusionMeasure.map f B.observationalMeasure = Measure.map f (B.interventionMeasure j q)Proof (Lean source)
theorem Factorization.map_eq_of_dependsOn_nodeAncestralClosure (B : Factorization G X μ) {i j : V} (hji : j ≠ i) (hnotAncestor : ¬ G.isAncestor j i) (q : InterventionDensity j X μ) {Y : Type*} [MeasurableSpace Y] (f : (∀ k, X k) → Y) (hf : Measurable f) (hdepends : DependsOn (nodeAncestralClosure G i) f) (x₀ : ∀ k, X k) : Measure.map f B.observationalMeasure = Measure.map f (B.interventionMeasure j q) := by -- Transport ancestral projection equality through the coordinate extension representation -- of `f`. exact map_eq_of_map_coordinateProjection_eq x₀ hf hdepends (B.ancestralMarginal_eq hji hnotAncestor q) -
targetRatio_map_eqtheorem — A DAG factorization, distinct intervention and ratio nodes, evidence that the intervention target is not an ancestor of the ratio node, a normalized replacement density, a node-coordinate numerator, measurability of the resulting ratio, and an anchor assignment give the same observational and interventional law for the canonical density ratio.hypothesesB :Factorization G X μi j :Vhji :j ≠ ihnotAncestor :¬ G.isAncestor j iq :InterventionDensity j X μnumerator :X i → ℝ≥0∞hratio :Measurable (fun v : ∀ k, X k ↦ numerator (v i) / B.factor i v)x₀ :∀ k, X kconclusionMeasure.map (fun v : ∀ k, X k ↦ numerator (v i) / B.factor i v) B.observationalMeasure= Measure.map (fun v : ∀ k, X k ↦ numerator (v i) / B.factor i v) (B.interventionMeasure j q)Proof (Lean source)
theorem Factorization.targetRatio_map_eq (B : Factorization G X μ) {i j : V} (hji : j ≠ i) (hnotAncestor : ¬ G.isAncestor j i) (q : InterventionDensity j X μ) (numerator : X i → ℝ≥0∞) (hratio : Measurable (fun v : ∀ k, X k ↦ numerator (v i) / B.factor i v)) (x₀ : ∀ k, X k) : Measure.map (fun v : ∀ k, X k ↦ numerator (v i) / B.factor i v) B.observationalMeasure = Measure.map (fun v : ∀ k, X k ↦ numerator (v i) / B.factor i v) (B.interventionMeasure j q) := by -- Enlarge `targetRatio_dependsOn` to the ancestral closure, then use the dependent-map theorem. apply B.map_eq_of_dependsOn_nodeAncestralClosure hji hnotAncestor q (fun v : ∀ k, X k ↦ numerator (v i) / B.factor i v) hratio _ x₀ exact (B.targetRatio_dependsOn i numerator).mono (selfParents_subset_nodeAncestralClosure i) -
map_ancestralProjection_eqtheorem — A DAG factorization, distinct intervention and queried nodes, evidence that the intervention target is not an ancestor of the queried node, a normalized replacement density, and a measurable map of the ancestral subproduct give the same observational and interventional law after that map.hypothesesB :Factorization G X μi j :Vhji :j ≠ ihnotAncestor :¬ G.isAncestor j iq :InterventionDensity j X μY :Type*mix :(∀ k : nodeAncestralClosure G i, X k) → Yhmix :Measurable mixconclusionMeasure.map (mix ∘ coordinateProjection (X := X) (nodeAncestralClosure G i)) B.observationalMeasure= Measure.map (mix ∘ coordinateProjection (X := X) (nodeAncestralClosure G i)) (B.interventionMeasure j q)Proof (Lean source)
theorem Factorization.map_ancestralProjection_eq (B : Factorization G X μ) {i j : V} (hji : j ≠ i) (hnotAncestor : ¬ G.isAncestor j i) (q : InterventionDensity j X μ) {Y : Type*} [MeasurableSpace Y] (mix : (∀ k : nodeAncestralClosure G i, X k) → Y) (hmix : Measurable mix) : Measure.map (mix ∘ coordinateProjection (X := X) (nodeAncestralClosure G i)) B.observationalMeasure = Measure.map (mix ∘ coordinateProjection (X := X) (nodeAncestralClosure G i)) (B.interventionMeasure j q) := by -- Use `Measure.map_map` on both sides of `ancestralMarginal_eq`. exact map_comp_eq_of_map_eq (measurable_coordinateProjection (X := X) (nodeAncestralClosure G i)) hmix (B.ancestralMarginal_eq hji hnotAncestor q) -
lintegral_observationalDensity_lt_toptheorem — The observational density of a normalized finite DAG factorization has finite integral against the product reference measure.Proof (Lean source)
theorem Factorization.lintegral_observationalDensity_lt_top (B : Factorization G X μ) : ∫⁻ x, B.observationalDensity x ∂Measure.pi μ < ∞ := by /- Evaluate `B.lmarginal_compl_observationalDensity_eq` at the empty retained set after splitting on whether the full dependent product `∀ i, X i` is empty. In the inhabited case, evaluate the all-coordinate marginal at an anchor assignment and rewrite it as the full lintegral. In the empty case the product measure, hence the integral, is zero. Do not assume coordinate nonemptiness. -/ classical by_cases h : Nonempty (∀ i, X i) · let x : ∀ i, X i := choice h have hmarg := B.lmarginal_compl_observationalDensity_eq (A := ∅) (by intro i hi simp at hi) have hlin : ∫⁻ v, B.observationalDensity v ∂Measure.pi μ = 1 := by rw [MeasureTheory.lintegral_eq_lmarginal_univ x] simpa [Factorization.partialDensity] using congrFun hmarg x rw [hlin] exact ENNReal.one_lt_top · let _ : IsEmpty (∀ i, X i) := not_nonempty_iff.mp h rw [MeasureTheory.lintegral_of_isEmpty] exact ENNReal.zero_lt_top -
instIsFiniteMeasureObservationalMeasureinstance — The observational measure induced by a normalized finite DAG factorization is a finite measure.parametersB :Factorization G X μinstancegiven byby rw [Factorization.observationalMeasure] exact isFiniteMeasure_withDensity (ne_of_lt B.lintegral_observationalDensity_lt_top)
Cube 19 core · 15 supporting This module specializes the general finite-product theorem to real coordinates equipped with Lebesgue measure restricted to [0,1]. ★ ancestralMarginal_eq★ observationalMeasure_unitCubeFactorizationOfCubeFactors
Finite unit-cube specialization
This module specializes the general finite-product theorem to real coordinates equipped with
Lebesgue measure restricted to [0,1]. The resulting product reference measure is concentrated
on Set.pi Set.univ (fun _ ↦ Set.Icc 0 1), the finite product cube in the requirement.
A vertex population determines the unit cube of real assignments: the set of assignments whose every coordinate lies in the closed interval from zero to one.
The one-coordinate reference measure on the unit interval is Lebesgue measure restricted to the closed interval from zero to one.
A finite vertex population determines the product reference measure on its unit cube.
Definition (Lean source)
A finite DAG determines the factorization interface whose coordinates use unit-interval-restricted Lebesgue reference measure.
Definition (Lean source)
A unit-cube DAG factorization, distinct intervention and queried nodes, evidence that the intervention target is not an ancestor of the queried node, and a normalized replacement density give identical observational and interventional laws on the queried node's ancestral closure.
Formal statement
Proof (Lean source)
A coordinate type and a real assignment determine the coordinatewise clamp to the closed unit cube, by clamping each coordinate between zero and one.
A function and a set determine the proposition that the function is measurable on that set, by testing the restriction to the set's subtype.
Definition (Lean source)
A node set and an extended-nonnegative function determine cube-local dependence, by requiring agreement on those coordinates to determine the function value at any two cube points.
A cube-local extended-nonnegative function determines its globally defined clamped extension, by evaluating it after coordinatewise clamping.
Definition (Lean source)
A cube-local real function determines its globally defined nonnegative clamped extension, by applying the nonnegative-real conversion after coordinatewise clamping.
Cube-local extended-nonnegative factors that are measurable on the cube, local to each node and its parents on the cube, and normalized in their own coordinates on the cube determine a global unit-cube DAG factorization, by using their clamped extensions as factors.
Definition (Lean source)
Cube-local extended-nonnegative factors determine the corresponding cube-restricted observational product-density measure, by weighting restricted Lebesgue volume with their joint product.
Cube-local extended-nonnegative factors, a target coordinate, and a replacement density determine the corresponding cube-restricted single-target product-density measure, by replacing that coordinate's factor in the joint product.
Cube-local factors with cube measurability, node-and-parent locality, and coordinate-wise normalization give an observational law of the clamped factorization equal to the cube-restricted product-density measure.
Formal statement
Proof (Lean source)
A target coordinate and a cube-local replacement density that is measurable on the interval and normalized there determine a global intervention density, by scalar clamping.
Definition (Lean source)
Real-valued cube factors that are measurable on the cube, nonnegative there, local to each node and its parents, and normalized by Lebesgue integration in their own coordinate determine a global unit-cube DAG factorization, by conversion to extended nonnegative factors.
Definition (Lean source)
Real-valued cube factors, with no sign restriction, determine their cube-restricted observational product-density measure: Lebesgue measure restricted to the unit cube, weighted by the joint product of the factors, where a negative product is truncated to zero.
Real-valued cube factors, a target coordinate, and a real-valued replacement function for that coordinate, none sign-restricted, determine their cube-restricted single-target product-density measure: Lebesgue measure restricted to the unit cube, weighted by the product in which the target factor is replaced by the replacement evaluated at the target coordinate, with a negative product truncated to zero.
A target coordinate and a real replacement density that is measurable on the unit interval, nonnegative there, and Lebesgue-normalized determine a global intervention density, by nonnegative-real conversion followed by scalar clamping.
Definition (Lean source)
15 supporting declarations (lemmas, instances)
-
unitCubeReference_compltheorem — A finite vertex population has a unit-cube product reference measure concentrated on the ambient finite unit cube.Proof (Lean source)
theorem unitCubeReference_compl (V : Type*) [DecidableEq V] [Fintype V] : unitCubeReference V (unitCube V)ᶜ = 0 := by -- Rewrite `pi univ` as an intersection of coordinate preimages, take complements, -- and use `measure_iUnion_null` with `Measure.pi_eval_preimage_null`. Unfold -- `unitIntervalReference` when synthesizing the `SigmaFinite` instance for the restricted -- Lebesgue measure; the definition is intentionally not an abbreviation. classical have hσ : ∀ _ : V, SigmaFinite unitIntervalReference := fun _ ↦ by unfold unitIntervalReference infer_instance rw [unitCubeReference, unitCube, univ_pi_eq_iInter, compl_iInter] apply measure_iUnion_null intro i rw [← preimage_compl] exact @Measure.pi_eval_preimage_null V (fun _ : V ↦ ℝ) _ _ (fun _ : V ↦ unitIntervalReference) hσ i (Icc 0 1)ᶜ (by simp [unitIntervalReference]) -
measurable_clampCubetheorem — The coordinatewise clamp for a finite coordinate type is measurable.Proof (Lean source)
@[fun_prop] theorem measurable_clampCube : Measurable (clampCube V) := by -- Prove each coordinate measurable from `measurable_pi_iff`, using measurability of `min` and -- `max` on the real line. refine measurable_pi_iff.mpr fun i ↦ ?_ exact measurable_const.max (measurable_const.min (measurable_pi_apply i)) -
clampCube_memtheorem — Every real assignment over a finite coordinate type is sent by the coordinatewise clamp into the finite unit cube.Proof (Lean source)
-
clampCube_eq_selftheorem — A finite coordinate type and a point in its unit cube are such that the coordinatewise clamp fixes that point.Proof (Lean source)
@[simp] theorem clampCube_eq_self {v : V → ℝ} (hv : v ∈ unitCube V) : clampCube V v = v := by -- Extensionality reduces this to `max_eq_right` and `min_eq_right`, using the two coordinate -- inequalities extracted from `hv`. ext i have hi : v i ∈ Icc (0 : ℝ) 1 := hv i (Set.mem_univ i) simp [clampCube, min_eq_right hi.2, max_eq_right hi.1] -
clampCube_updatetheorem — An assignment, a coordinate, and a replacement value satisfy the update-and-clamp identity.hypothesesV :sharedType u_1v :V → ℝi :Vx :ℝProof (Lean source)
-
clampCube_update_of_memtheorem — An assignment, a coordinate, and a replacement value in the unit interval satisfy the update identity in which only the unchanged context is clamped.hypothesesProof (Lean source)
theorem clampCube_update_of_mem (v : V → ℝ) (i : V) {x : ℝ} (hx : x ∈ Icc (0 : ℝ) 1) : clampCube V (update v i x) = update (clampCube V v) i x := by -- Rewrite with `clampCube_update` and simplify the scalar clamp from `hx`. rw [clampCube_update] simp [min_eq_right hx.2, max_eq_right hx.1] -
unitCubeReference_eq_volume_restricttheorem — For a finite coordinate type, the product of unit-interval Lebesgue restrictions is Lebesgue volume restricted to the finite unit cube.Proof (Lean source)
theorem unitCubeReference_eq_volume_restrict (V : Type*) [DecidableEq V] [Fintype V] : unitCubeReference V = volume.restrict (unitCube V) := by -- Unfold both Causalean definitions. Rewrite product volume with `volume_pi`, then apply -- `Measure.restrict_pi_pi` to the constant family `Icc 0 1`. rw [unitCubeReference, unitIntervalReference, unitCube, volume_pi, Measure.restrict_pi_pi] -
measurable_clampedFactortheorem — A cube-local extended-nonnegative function with cube-local measurability has a globally measurable clamped extension.Proof (Lean source)
@[fun_prop] theorem measurable_clampedFactor {p : (V → ℝ) → ℝ≥0∞} (hp : MeasurableOnSet p (unitCube V)) : Measurable (clampedFactor p) := by -- Regard `clampCube` as a measurable map into the cube subtype using `clampCube_mem`, then -- compose it with `hp`. exact hp.comp ((measurable_clampCube V).subtype_mk (h := clampCube_mem V)) -
measurable_clampedOfRealFactortheorem — A cube-local real function with cube-local measurability has a globally measurable nonnegative clamped extension.Proof (Lean source)
@[fun_prop] theorem measurable_clampedOfRealFactor {p : (V → ℝ) → ℝ} (hp : MeasurableOnSet p (unitCube V)) : Measurable (clampedOfRealFactor p) := by -- Compose the subtype-valued clamp with `hp`, then with `ENNReal.measurable_ofReal`. exact ENNReal.measurable_ofReal.comp (hp.comp ((measurable_clampCube V).subtype_mk (h := clampCube_mem V))) -
unitCubeFactorizationOfCubeFactors_factor_eqtheorem — Cube-local factors with cube measurability, node-and-parent locality, and coordinate-wise normalization, evaluated at a node and a cube point, give a constructed factor equal to the original factor.hypothesesp :∀ i : Vif(V → ℝ)thenℝ≥0∞hmeas :∀ i : V, MeasurableOnSet (p i) (unitCube V)hlocal :∀ i : V, CubeDependsOn (insert i (G.parents i)) (p i)i :Vv :V → ℝhv :v ∈ unitCube Vconclusion(unitCubeFactorizationOfCubeFactors p hmeas hlocal hnorm).factor i v = p i vProof (Lean source)
theorem unitCubeFactorizationOfCubeFactors_factor_eq {G : DAG V} (p : ∀ i : V, (V → ℝ) → ℝ≥0∞) (hmeas : ∀ i : V, MeasurableOnSet (p i) (unitCube V)) (hlocal : ∀ i : V, CubeDependsOn (insert i (G.parents i)) (p i)) (hnorm : ∀ i : V, ∀ v : V → ℝ, v ∈ unitCube V → ∫⁻ x in Icc (0 : ℝ) 1, p i (update v i x) ∂volume = 1) (i : V) {v : V → ℝ} (hv : v ∈ unitCube V) : (unitCubeFactorizationOfCubeFactors p hmeas hlocal hnorm).factor i v = p i v := by -- Unfold the constructor and rewrite `clampCube V v` with `clampCube_eq_self hv`. simp [unitCubeFactorizationOfCubeFactors, clampedFactor, clampCube_eq_self V hv] -
interventionMeasure_unitCubeFactorizationOfCubeFactorstheorem — Cube-local factors with cube measurability, node-and-parent locality, and coordinate-wise normalization, together with a target coordinate, a replacement density, its interval measurability, and its normalization, give an intervention law equal to the cube-restricted replacement product-density measure.hypothesesp :∀ i : Vif(V → ℝ)thenℝ≥0∞hmeas :∀ i : V, MeasurableOnSet (p i) (unitCube V)hlocal :∀ i : V, CubeDependsOn (insert i (G.parents i)) (p i)j :Vq :ℝ → ℝ≥0∞hqmeas :MeasurableOnSet q (Icc (0 : ℝ) 1)hqnorm :∫⁻ x in Icc (0 : ℝ) 1, q x ∂volume = 1conclusion(unitCubeFactorizationOfCubeFactors p hmeas hlocal hnorm).interventionMeasure j (interventionDensityOfCube j q hqmeas hqnorm)= cubeInterventionDensityMeasure p j qProof (Lean source)
theorem interventionMeasure_unitCubeFactorizationOfCubeFactors {G : DAG V} (p : ∀ i : V, (V → ℝ) → ℝ≥0∞) (hmeas : ∀ i : V, MeasurableOnSet (p i) (unitCube V)) (hlocal : ∀ i : V, CubeDependsOn (insert i (G.parents i)) (p i)) (hnorm : ∀ i : V, ∀ v : V → ℝ, v ∈ unitCube V → ∫⁻ x in Icc (0 : ℝ) 1, p i (update v i x) ∂volume = 1) (j : V) (q : ℝ → ℝ≥0∞) (hqmeas : MeasurableOnSet q (Icc (0 : ℝ) 1)) (hqnorm : ∫⁻ x in Icc (0 : ℝ) 1, q x ∂volume = 1) : (unitCubeFactorizationOfCubeFactors p hmeas hlocal hnorm).interventionMeasure j (interventionDensityOfCube j q hqmeas hqnorm) = cubeInterventionDensityMeasure p j q := by -- Rewrite the reference measure, use with-density a.e. congruence on the cube, and simplify both -- the replacement density and every retained factor by their identity-on-cube lemmas. rw [interventionMeasure] change (unitCubeReference V).withDensity _ = _ rw [unitCubeReference_eq_volume_restrict] unfold cubeInterventionDensityMeasure apply withDensity_congr_ae filter_upwards [ae_restrict_mem measurableSet_unitCube] with v hv unfold interventionDensity congr 1 · simp [interventionDensityOfCube] have hj := hv j (Set.mem_univ j) simp [min_eq_right hj.2, max_eq_right hj.1] · apply Finset.prod_congr rfl intro i hi exact unitCubeFactorizationOfCubeFactors_factor_eq p hmeas hlocal hnorm i hv -
unitCubeFactorizationOfRealCubeFactors_factor_eqtheorem — Real cube factors with cube measurability, nonnegativity, node-and-parent locality, and coordinate-wise normalization, evaluated at a node and a cube point, give a constructed factor equal to the nonnegative-real conversion of the original factor.hypothesesp :∀ i : Vif(V → ℝ)thenℝhmeas :∀ i : V, MeasurableOnSet (p i) (unitCube V)hnonneg :∀ i : V, ∀ v, v ∈ unitCube V → 0 ≤ p i vhlocal :i :Vv :V → ℝhv :v ∈ unitCube Vconclusion(unitCubeFactorizationOfRealCubeFactors p hmeas hnonneg hlocal hnorm).factor i v= ofReal (p i v)Proof (Lean source)
theorem unitCubeFactorizationOfRealCubeFactors_factor_eq {G : DAG V} (p : ∀ i : V, (V → ℝ) → ℝ) (hmeas : ∀ i : V, MeasurableOnSet (p i) (unitCube V)) (hnonneg : ∀ i : V, ∀ v, v ∈ unitCube V → 0 ≤ p i v) (hlocal : ∀ i : V, ∀ {v w : V → ℝ}, v ∈ unitCube V → w ∈ unitCube V → (∀ k ∈ insert i (G.parents i), v k = w k) → p i v = p i w) (hnorm : ∀ i : V, ∀ v : V → ℝ, v ∈ unitCube V → ∫ x in Icc (0 : ℝ) 1, p i (update v i x) ∂volume = 1) (i : V) {v : V → ℝ} (hv : v ∈ unitCube V) : (unitCubeFactorizationOfRealCubeFactors p hmeas hnonneg hlocal hnorm).factor i v = ofReal (p i v) := by -- Reduce to the ENNReal factor-on-cube theorem used by the real constructor. simp [unitCubeFactorizationOfRealCubeFactors, unitCubeFactorizationOfCubeFactors, clampedFactor, clampCube_eq_self V hv] -
observationalMeasure_unitCubeFactorizationOfRealCubeFactorstheorem — Real cube factors with cube measurability, nonnegativity, node-and-parent locality, and coordinate-wise normalization give an observational law equal to the usual cube-restricted real product-density measure.hypothesesp :∀ i : Vif(V → ℝ)thenℝhmeas :∀ i : V, MeasurableOnSet (p i) (unitCube V)hnonneg :∀ i : V, ∀ v, v ∈ unitCube V → 0 ≤ p i vhlocal :conclusion(unitCubeFactorizationOfRealCubeFactors p hmeas hnonneg hlocal hnorm).observationalMeasureProof (Lean source)
theorem observationalMeasure_unitCubeFactorizationOfRealCubeFactors {G : DAG V} (p : ∀ i : V, (V → ℝ) → ℝ) (hmeas : ∀ i : V, MeasurableOnSet (p i) (unitCube V)) (hnonneg : ∀ i : V, ∀ v, v ∈ unitCube V → 0 ≤ p i v) (hlocal : ∀ i : V, ∀ {v w : V → ℝ}, v ∈ unitCube V → w ∈ unitCube V → (∀ k ∈ insert i (G.parents i), v k = w k) → p i v = p i w) (hnorm : ∀ i : V, ∀ v : V → ℝ, v ∈ unitCube V → ∫ x in Icc (0 : ℝ) 1, p i (update v i x) ∂volume = 1) : (unitCubeFactorizationOfRealCubeFactors p hmeas hnonneg hlocal hnorm).observationalMeasure = realCubeProductDensityMeasure p := by -- Start from the ENNReal observational identity and rewrite the finite product of `ofReal` -- factors as `ofReal` of the real product, using cube nonnegativity. rw [observationalMeasure] change (unitCubeReference V).withDensity _ = _ rw [unitCubeReference_eq_volume_restrict] unfold realCubeProductDensityMeasure apply withDensity_congr_ae filter_upwards [ae_restrict_mem measurableSet_unitCube] with v hv unfold observationalDensity partialDensity rw [ENNReal.ofReal_prod_of_nonneg (fun i _ ↦ hnonneg i v hv)] apply Finset.prod_congr rfl intro i hi exact unitCubeFactorizationOfRealCubeFactors_factor_eq p hmeas hnonneg hlocal hnorm i hv -
interventionMeasure_unitCubeFactorizationOfRealCubeFactorstheorem — Real cube factors with cube measurability, nonnegativity, node-and-parent locality, and coordinate-wise normalization, together with a target coordinate, a real replacement density, its interval measurability, its nonnegativity, and its normalization, give an intervention law equal to the usual cube-restricted real replacement product-density measure.hypothesesp :∀ i : Vif(V → ℝ)thenℝhmeas :∀ i : V, MeasurableOnSet (p i) (unitCube V)hnonneg :∀ i : V, ∀ v, v ∈ unitCube V → 0 ≤ p i vhlocal :j :Vq :ℝ → ℝhqmeas :MeasurableOnSet q (Icc (0 : ℝ) 1)hqnonneg :∀ x ∈ Icc (0 : ℝ) 1, 0 ≤ q xhqnorm :∫ x in Icc (0 : ℝ) 1, q x ∂volume = 1conclusion(unitCubeFactorizationOfRealCubeFactors p hmeas hnonneg hlocal hnorm).interventionMeasure j (interventionDensityOfRealCube j q hqmeas hqnonneg hqnorm)Proof (Lean source)
theorem interventionMeasure_unitCubeFactorizationOfRealCubeFactors {G : DAG V} (p : ∀ i : V, (V → ℝ) → ℝ) (hmeas : ∀ i : V, MeasurableOnSet (p i) (unitCube V)) (hnonneg : ∀ i : V, ∀ v, v ∈ unitCube V → 0 ≤ p i v) (hlocal : ∀ i : V, ∀ {v w : V → ℝ}, v ∈ unitCube V → w ∈ unitCube V → (∀ k ∈ insert i (G.parents i), v k = w k) → p i v = p i w) (hnorm : ∀ i : V, ∀ v : V → ℝ, v ∈ unitCube V → ∫ x in Icc (0 : ℝ) 1, p i (update v i x) ∂volume = 1) (j : V) (q : ℝ → ℝ) (hqmeas : MeasurableOnSet q (Icc (0 : ℝ) 1)) (hqnonneg : ∀ x ∈ Icc (0 : ℝ) 1, 0 ≤ q x) (hqnorm : ∫ x in Icc (0 : ℝ) 1, q x ∂volume = 1) : (unitCubeFactorizationOfRealCubeFactors p hmeas hnonneg hlocal hnorm).interventionMeasure j (interventionDensityOfRealCube j q hqmeas hqnonneg hqnorm) = realCubeInterventionDensityMeasure p j q := by -- Use the ENNReal intervention identity and combine `ofReal` over the nonnegative replacement -- and retained-factor product on the cube. rw [interventionMeasure] change (unitCubeReference V).withDensity _ = _ rw [unitCubeReference_eq_volume_restrict] unfold realCubeInterventionDensityMeasure apply withDensity_congr_ae filter_upwards [ae_restrict_mem measurableSet_unitCube] with v hv rw [ENNReal.ofReal_mul (hqnonneg (v j) (hv j (Set.mem_univ j))), ENNReal.ofReal_prod_of_nonneg (fun i _ ↦ hnonneg i v hv)] unfold interventionDensity congr 1 · simp [interventionDensityOfRealCube, interventionDensityOfCube] have hj := hv j (Set.mem_univ j) simp [min_eq_right hj.2, max_eq_right hj.1] · apply Finset.prod_congr rfl intro i hi exact unitCubeFactorizationOfRealCubeFactors_factor_eq p hmeas hnonneg hlocal hnorm i hv -
measurableOnSet_of_continuousOn_cubetheorem — Real cube factors with continuity on the finite unit cube have the cube-local measurability required by the real-valued factorization constructor.hypothesesV :sharedType u_1p :∀ i : Vif(V → ℝ)thenℝhcont :∀ i : V, ContinuousOn (p i) (unitCube V)i :VconclusionMeasurableOnSet (p i) (unitCube V)Proof (Lean source)
theorem measurableOnSet_of_continuousOn_cube (p : ∀ i : V, (V → ℝ) → ℝ) (hcont : ∀ i : V, ContinuousOn (p i) (unitCube V)) : ∀ i : V, MeasurableOnSet (p i) (unitCube V) := by -- A continuous map on a set is continuous as a map from the subtype; continuous maps between -- these Borel spaces are measurable. intro i exact (hcont i).domRestrict.measurable