Formalization: One Intervention per Latent Variable: Generic Identification of Nonlinear Causal Representations on Fixed-sign Compact Strata

The complete Lean development behind this paper — every definition, lemma, and theorem of its module, including helpers the paper text never cites. Identifiers link within this page, into the Causalean library, or out to the official Mathlib docs.

CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Basic 29 declarations This file fixes the latent finite-DAG mechanism, its observed environment family, and the population assumptions shared by the paper's results.

Cover-ratio causal representation model

This file fixes the latent finite-DAG mechanism, its observed environment family, and the population assumptions shared by the paper's results.

For a finite dimension, the latent state space is the real coordinate space.

Definition (Lean source)
n :
LatentState n :
Type
Fin n → ℝ
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.LatentState · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Basic.lean:25
def latentCube

The closed latent cube.

Definition (Lean source)
n :
latentCube n :
pi univ (fun _ => Icc (0 : ℝ) 1)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.latentCube · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Basic.lean:28

A sign vector with every coordinate equal to -1 or 1.

Definition (Lean source)
n :
value :
Fin n → ℝ
signed :
∀ i, value i = -1 ∨ value i = 1
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.SignVector · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Basic.lean:32

A family of observational conditional densities and parent-independent intervention densities. The proof field makes the parent scope part of the carrier.

Definition (Lean source)
n :
G :
DAG (Fin n)
p :
Fin n → LatentState n → ℝ
q :
Fin n → ℝ → ℝ
parent_local :
∀ i v w
if
v i = w i
and
(∀ j ∈ G.parents i, v j = w j)
then
p i v = p i w
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.Mechanism · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Basic.lean:37
def mechanismC2Coordinates

Values and the first two derivatives within the closed domain of every mechanism slot, each equipped with uniform convergence there. Pulling this topology back gives the paper's finite relative product topology, including its one-sided boundary derivatives, rather than Lean's default pointwise function topology.

Definition (Lean source)
n :
DAG (Fin n)
θ :
mechanismC2Coordinates θ :
(Fin n → UniformOnFun (LatentState n) ℝ {latentCube n}) × (Fin n → UniformOnFun (LatentState n) (LatentState n →L[ℝ] ℝ) {latentCube n}) × (Fin n → UniformOnFun (LatentState n) (LatentState n [×2]→L[ℝ] ℝ) {latentCube n}) × (Fin n → UniformOnFun ℝ ℝ {Icc 0 1}) × (Fin n → UniformOnFun ℝ (ℝ →L[ℝ] ℝ) {Icc 0 1}) × (Fin n → UniformOnFun ℝ (ℝ [×2]→L[ℝ] ℝ) {Icc 0 1})
((fun i => ofFun {latentCube n} (θ.p i)), (fun i => ofFun {latentCube n} (fderivWithin ℝ (θ.p i) (latentCube n))), (fun i => ofFun {latentCube n} (iteratedFDerivWithin ℝ 2 (θ.p i) (latentCube n))), (fun i => ofFun {Icc (0 : ℝ) 1} (θ.q i)), (fun i => ofFun {Icc (0 : ℝ) 1} (fderivWithin ℝ (θ.q i) (Icc (0 : ℝ) 1))), (fun i => ofFun {Icc (0 : ℝ) 1} (iteratedFDerivWithin ℝ 2 (θ.q i) (Icc (0 : ℝ) 1))))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.mechanismC2Coordinates · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Basic.lean:46
instance instTopologicalSpaceMechanism

For a finite latent dimension and DAG, the mechanism space carries the relative product C² topology.

Definition (Lean source)
instance {n : ℕ} {G : DAG (Fin n)} : TopologicalSpace (Mechanism n G) := TopologicalSpace.induced mechanismC2Coordinates inferInstance
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.instTopologicalSpaceMechanism · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Basic.lean:61

The intervention distribution function Q_i(v) = ∫₀ᵛ q_i(u) du.

Definition (Lean source)
n :
DAG (Fin n)
θ :
i :
Fin n
v :
interventionCDF θ i v :
∫ u in (0 : ℝ)..v, θ.q i u
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.interventionCDF · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Basic.lean:66
def observationalDensity Definition 2 in the paper ↗

The observational product density.

Definition (Lean source)
n :
DAG (Fin n)
θ :
v :
observationalDensity θ v :
∏ i, θ.p i v
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observationalDensity · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Basic.lean:71
def interventionalDensity

The density after replacing exactly the target mechanism by q_i.

Definition (Lean source)
n :
DAG (Fin n)
θ :
i :
Fin n
v :
interventionalDensity θ i v :
θ.q i (v i) * ∏ l ∈ Finset.univ.erase i, θ.p l v
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.interventionalDensity · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Basic.lean:76
def observationalLaw

The observational law on the compact latent cube.

Definition (Lean source)
n :
DAG (Fin n)
θ :
observationalLaw θ :
(volume.restrict (latentCube n)).withDensity (fun v => ofReal (observationalDensity θ v))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observationalLaw · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Basic.lean:82
def interventionalLaw

The target-i perfect-intervention law on the latent cube.

Definition (Lean source)
n :
DAG (Fin n)
θ :
i :
Fin n
interventionalLaw θ i :
(volume.restrict (latentCube n)).withDensity (fun v => ofReal (interventionalDensity θ i v))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.interventionalLaw · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Basic.lean:89
def coordinateProjection

Finite-coordinate projection, used to state conditional independence.

Definition (Lean source)
n :
S :
v :
j :
{j // j ∈ S}
coordinateProjection S v j :
fun j => v j
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.coordinateProjection · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Basic.lean:96

Conditional independence of latent coordinate blocks under the observational law.

Definition (Lean source)
n :
DAG (Fin n)
θ :
X Y Z :
CondIndepCoordinates θ X Y Z :
Prop
letI := hμ ∃ _hX : Measurable (coordinateProjection X), ∃ _hY : Measurable (coordinateProjection Y), ∃ hZ : Measurable (coordinateProjection Z), CondIndepFun (comap (coordinateProjection Z) inferInstance) hZ.comap_le (coordinateProjection X) (coordinateProjection Y) (observationalLaw θ)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.CondIndepCoordinates · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Basic.lean:100
def ownLogRatioDerivative

The own-coordinate derivative of the latent log density ratio.

Definition (Lean source)
n :
DAG (Fin n)
θ :
i :
Fin n
v :
ownLogRatioDerivative θ i v :
derivWithin (fun z => log (θ.q i z / θ.p i (update v i z))) (Icc (0 : ℝ) 1) (v i)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.ownLogRatioDerivative · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Basic.lean:113

For a finite node set and DAG, the ancestral cover relation consists of cover pairs in the DAG's ancestor order.

Definition (Lean source)
n :
shared
G :
DAG (Fin n)
ancestralCover G :
Fin n → Fin n → Prop
@CovBy (Fin n) ⟨G.isAncestor⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.ancestralCover · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Basic.lean:126
def PositiveNormalizedSmoothMechanisms

Every observational and intervention mechanism is a positive normalized density on its closed cube, with each conditional normalized in its own coordinate.

Definition (Lean source)
n :
shared
G :
DAG (Fin n)
shared
θ :
PositiveNormalizedSmoothMechanisms G θ :
Prop
clause 1
i v :
v ∈ latentCube n
0 < θ.p i v
clause 2
i z :
z ∈ Icc (0 : ℝ) 1
0 < θ.q i z
clause 3
i :
ContDiffOn ℝ 3 (θ.p i) (latentCube n)
clause 4
i :
ContDiffOn ℝ 3 (θ.q i) (Icc (0 : ℝ) 1)
clause 5
i v :
v ∈ latentCube n
∫ z in Icc (0 : ℝ) 1, θ.p i (update v i z) = 1
clause 6
i :
∫ z in Icc (0 : ℝ) 1, θ.q i z = 1
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.PositiveNormalizedSmoothMechanisms · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Basic.lean:132
def FixedOwnDerivativeSign

Each latent log ratio has the prescribed strict own-coordinate derivative sign.

Definition (Lean source)
n :
shared
G :
DAG (Fin n)
shared
s :
shared
θ :
i v :
v ∈ latentCube n
FixedOwnDerivativeSign G s θ :
Prop
0 < s.value i * ownLogRatioDerivative θ i v
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.FixedOwnDerivativeSign · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Basic.lean:146
def CausalMinimality

Every direct causal edge remains conditionally dependent given the other parents.

Definition (Lean source)
n :
shared
G :
DAG (Fin n)
shared
θ :
j i :
G.edge j i
CausalMinimality G θ :
Prop
¬ CondIndepCoordinates θ {i} {j} ((G.parents i).erase j)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.CausalMinimality · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Basic.lean:152
def Faithfulness

Every observational conditional independence is graphically entailed by d-separation.

Definition (Lean source)
n :
shared
G :
DAG (Fin n)
shared
θ :
X Y Z :
CondIndepCoordinates θ X Y Z
Faithfulness G θ :
Prop
G.dSep X Y Z
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.Faithfulness · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Basic.lean:158
structure ModelStratum

The positive, normalized, smooth, causal-minimal, fixed-sign mechanism stratum.

Definition (Lean source)
n :
shared
G :
DAG (Fin n)
shared
s :
shared
θ :
positiveSmooth :
causalMinimal :
fixedSign :
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.ModelStratum · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Basic.lean:164
def StratumPoint

The mechanism subtype carrying the relative product topology.

Definition (Lean source)
n :
shared
G :
DAG (Fin n)
shared
s :
shared
StratumPoint G s :
Type
{θ : Mechanism n G // ModelStratum G s θ}
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.StratumPoint · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Basic.lean:170
structure ObservedWorld Definition 4 in the paper ↗

The shared observed-space representation and the supplied family of observed laws and ratios.

Definition (Lean source)
n :
shared
G :
DAG (Fin n)
shared
θ :
mix :
unmix :
targetPerm :
Perm (Fin n)
law :
Fin (n + 1) → Measure (LatentState n)
ratio :
Fin n → LatentState n → ℝ
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.ObservedWorld · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Basic.lean:176

The identity-mixing environment family generated directly by a mechanism and target permutation. This is used for the explicit witness calculations.

Definition (Lean source)
n :
shared
G :
DAG (Fin n)
shared
θ :
π :
Perm (Fin n)
canonicalObservedWorld G θ π :
clause 1
mix := id
clause 2
unmix := id
clause 3
targetPerm := π
clause 4
law := Fin.cases (observationalLaw θ) (fun e => interventionalLaw θ (π e))
clause 5
ratio := fun e v => θ.q (π e) (v (π e)) / θ.p (π e) v
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.canonicalObservedWorld · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Basic.lean:184
def observedSupport

The observed support is the image of the latent cube.

Definition (Lean source)
n :
shared
G :
shared
W :
observedSupport G W :
W.mix '' latentCube n
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedSupport · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Basic.lean:194
def observation

The observed random vector obtained from a latent state.

Definition (Lean source)
n :
shared
G :
shared
W :
v :
observation G W v :
W.mix v
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observation · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Basic.lean:198

The environment-label DAG obtained by pulling G back through the target permutation.

Definition (Lean source)
n :
shared
G :
shared
W :
j i :
Fin n
permutedGraph G W j i :
Prop
G.edge (W.targetPerm j) (W.targetPerm i)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.permutedGraph · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Basic.lean:202
def logRatio

The observable log-ratio coordinate.

Definition (Lean source)
n :
shared
G :
shared
W :
i :
Fin n
x :
logRatio G W i x :
log (W.ratio i x)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.logRatio · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Basic.lean:207
def SharedDiffeomorphicMixing Assumption 2 in the paper ↗

The shared mixing map is a diffeomorphism between the latent cube and observed support.

Definition (Lean source)
n :
shared
G :
DAG (Fin n)
shared
θ :
shared
W :
shared
SharedDiffeomorphicMixing G θ W :
Prop
clause 1
ContDiffOn ℝ 2 W.mix (latentCube n)
clause 2
ContDiffOn ℝ 2 W.unmix (observedSupport G W)
clause 3
v ∈ latentCube n :
W.unmix (W.mix v) = v
clause 4
x ∈ observedSupport G W :
W.mix (W.unmix x) = x
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.SharedDiffeomorphicMixing · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Basic.lean:216
def OnePerfectInterventionPerNode Assumption 3 in the paper ↗

The observed laws are the shared pushforwards of one observational and one distinct single-target intervention law, and the supplied ratios are their Radon--Nikodym derivatives.

Definition (Lean source)
n :
shared
G :
DAG (Fin n)
shared
θ :
shared
W :
shared
OnePerfectInterventionPerNode G θ W :
Prop
clause 1
W.law 0 = Measure.map W.mix (observationalLaw θ)
clause 2
e :
Fin n
W.law e.succ = Measure.map W.mix (interventionalLaw θ (W.targetPerm e))
clause 3
e :
Fin n
(fun x => ofReal (W.ratio e x)) =ᵐ[W.law 0] (W.law e.succ).rnDeriv (W.law 0)
clause 4
e v :
v ∈ latentCube n
W.ratio e (W.mix v) = θ.q (W.targetPerm e) (v (W.targetPerm e)) / θ.p (W.targetPerm e) v
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.OnePerfectInterventionPerNode · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Basic.lean:224
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.AffinePathTopology 10 declarations This file records compact-uniform continuity of all six value and within-derivative coordinates of the affine mechanism path, and hence continuity in the induced relative product C² topology.

Topology of the affine witness path

This file records compact-uniform continuity of all six value and within-derivative coordinates of the affine mechanism path, and hence continuity in the induced relative product topology.

theorem derivWithin_coordinateSection_eq_fderivWithin_apply

Restricting a differentiable function on the product cube to one coordinate turns its within Fréchet derivative into evaluation on the corresponding coordinate basis vector. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
(Fin n → ℝ) → ℝ
hF :
v :
Fin n → ℝ
hv :
v ∈ latentCube n
i :
Fin n
z :
hz :
z ∈ Icc (0 : ℝ) 1
derivWithin (fun y ↦ F (update v i y)) (Icc (0 : ℝ) 1) z
= fderivWithin ℝ F (latentCube n) (update v i z) (single i 1)
Proof (Lean source)
lemma derivWithin_coordinateSection_eq_fderivWithin_apply {n : ℕ} {F : (Fin n → ℝ) → ℝ} (hF : DifferentiableOn ℝ F (latentCube n)) {v : Fin n → ℝ} (hv : v ∈ latentCube n) (i : Fin n) {z : ℝ} (hz : z ∈ Icc (0 : ℝ) 1) : derivWithin (fun y ↦ F (update v i y)) (Icc (0 : ℝ) 1) z = fderivWithin ℝ F (latentCube n) (update v i z) (single i 1) := by have hmap : Set.MapsTo (update v i) (Icc (0 : ℝ) 1) (latentCube n) := by intro y hy k by_cases hki : k = i · subst k simpa using hy · simpa [update, hki] using hv k have hcomp := (hF (update v i z) (hmap hz)).hasFDerivWithinAt.comp z (hasDerivAt_update v i z).hasFDerivAt.hasFDerivWithinAt hmap simpa [Function.comp_def] using hcomp.hasDerivWithinAt.derivWithin ((uniqueDiffOn_Icc (by norm_num)).uniqueDiffWithinAt hz)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.derivWithin_coordinateSection_eq_fderivWithin_apply · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AffinePathTopology.lean:21
theorem continuous_affinePathExtension_p_values

Given the selected directed edge, the observational-factor value coordinate of the unrestricted affine path varies continuously in the compact-uniform topology.

Formal statement
n :
θ :
j i :
Fin n
hji :
G.edge j i
l :
Fin n
Continuous (fun t : ℝ => ofFun {latentCube n} ((affinePathExtension s θ hji t).p l))
Proof (Lean source)
@[fun_prop] lemma continuous_affinePathExtension_p_values {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θ : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) (l : Fin n) : Continuous (fun t : ℝ => ofFun {latentCube n} ((affinePathExtension s θ hji t).p l)) := by apply continuous_uniformOnFun_affine_of_compact · rw [latentCube] exact isCompact_univ_pi fun _ => isCompact_Icc · exact ⟨0, fun _ _ => ⟨by norm_num, by norm_num⟩⟩ · simpa only [smul_eq_mul] using (θ.property.positiveSmooth.2.2.1 l).continuousOn · exact ((embeddedSparseWitness_positive_normalized_smooth s hji).2.2.1 l).continuousOn
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuous_affinePathExtension_p_values · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AffinePathTopology.lean:41
theorem continuous_affinePathExtension_q_values

Given the selected directed edge, the intervention-factor value coordinate of the unrestricted affine path varies continuously in the compact-uniform topology.

Formal statement
n :
θ :
j i :
Fin n
hji :
G.edge j i
l :
Fin n
Continuous (fun t : ℝ => ofFun {Icc (0 : ℝ) 1} ((affinePathExtension s θ hji t).q l))
Proof (Lean source)
@[fun_prop] lemma continuous_affinePathExtension_q_values {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θ : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) (l : Fin n) : Continuous (fun t : ℝ => ofFun {Icc (0 : ℝ) 1} ((affinePathExtension s θ hji t).q l)) := by apply continuous_uniformOnFun_affine_of_compact isCompact_Icc (nonempty_Icc.mpr (by norm_num)) · simpa only [smul_eq_mul] using (θ.property.positiveSmooth.2.2.2.1 l).continuousOn · exact ((embeddedSparseWitness_positive_normalized_smooth s hji).2.2.2.1 l).continuousOn
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuous_affinePathExtension_q_values · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AffinePathTopology.lean:55
theorem continuous_affinePathExtension_p_fderivWithin

Given the selected directed edge, the observational-factor first within-derivative coordinate varies continuously along the unrestricted affine path.

Formal statement
n :
θ :
j i :
Fin n
hji :
G.edge j i
l :
Fin n
Continuous (fun t : ℝ => ofFun {latentCube n} (fderivWithin ℝ ((affinePathExtension s θ hji t).p l) (latentCube n)))
Proof (Lean source)
@[fun_prop] lemma continuous_affinePathExtension_p_fderivWithin {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θ : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) (l : Fin n) : Continuous (fun t : ℝ => ofFun {latentCube n} (fderivWithin ℝ ((affinePathExtension s θ hji t).p l) (latentCube n))) := by let hu : UniqueDiffOn ℝ (latentCube n) := by rw [latentCube] exact UniqueDiffOn.univ_pi fun _ => uniqueDiffOn_Icc (by norm_num) let hθ := θ.property.positiveSmooth.2.2.1 l let hstar := (embeddedSparseWitness_positive_normalized_smooth s hji).2.2.1 l apply continuous_uniformOnFun_of_eq_affine_on_compact (K := latentCube n) (by rw [latentCube]; exact isCompact_univ_pi fun _ => isCompact_Icc) (show (latentCube n).Nonempty from ⟨0, fun _ _ => ⟨by norm_num, by norm_num⟩⟩) (hθ.continuousOn_fderivWithin hu (by norm_num)) (hstar.continuousOn_fderivWithin hu (by norm_num)) intro t x hx change fderivWithin ℝ (fun y => (1 - t) • θ.1.p l y + t • (embeddedSparseWitness s hji).p l y) (latentCube n) x = _ rw [fderivWithin_fun_add (hu.uniqueDiffWithinAt hx) (((hθ.const_smul (1 - t)) x hx).differentiableWithinAt (by norm_num)) (((hstar.const_smul t) x hx).differentiableWithinAt (by norm_num)), fderivWithin_fun_const_smul (hu.uniqueDiffWithinAt hx) ((hθ x hx).differentiableWithinAt (by norm_num)) (1 - t), fderivWithin_fun_const_smul (hu.uniqueDiffWithinAt hx) ((hstar x hx).differentiableWithinAt (by norm_num)) t]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuous_affinePathExtension_p_fderivWithin · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AffinePathTopology.lean:67
theorem continuous_affinePathExtension_p_iteratedFDerivWithin_two

Given the selected directed edge, the observational-factor second within-derivative coordinate varies continuously along the unrestricted affine path.

Formal statement
n :
θ :
j i :
Fin n
hji :
G.edge j i
l :
Fin n
Continuous (fun t : ℝ => ofFun {latentCube n} (iteratedFDerivWithin ℝ 2 ((affinePathExtension s θ hji t).p l) (latentCube n)))
Proof (Lean source)
@[fun_prop] lemma continuous_affinePathExtension_p_iteratedFDerivWithin_two {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θ : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) (l : Fin n) : Continuous (fun t : ℝ => ofFun {latentCube n} (iteratedFDerivWithin ℝ 2 ((affinePathExtension s θ hji t).p l) (latentCube n))) := by let hu : UniqueDiffOn ℝ (latentCube n) := by rw [latentCube] exact UniqueDiffOn.univ_pi fun _ => uniqueDiffOn_Icc (by norm_num) let hθ := θ.property.positiveSmooth.2.2.1 l let hstar := (embeddedSparseWitness_positive_normalized_smooth s hji).2.2.1 l let hθ2 : ContDiffOn ℝ 2 (θ.1.p l) (latentCube n) := hθ.of_le (by norm_num) let hstar2 : ContDiffOn ℝ 2 ((embeddedSparseWitness s hji).p l) (latentCube n) := hstar.of_le (by norm_num) apply continuous_uniformOnFun_of_eq_affine_on_compact (K := latentCube n) (by rw [latentCube]; exact isCompact_univ_pi fun _ => isCompact_Icc) (show (latentCube n).Nonempty from ⟨0, fun _ _ => ⟨by norm_num, by norm_num⟩⟩) (hθ.continuousOn_iteratedFDerivWithin (by norm_num) hu) (hstar.continuousOn_iteratedFDerivWithin (by norm_num) hu) intro t x hx change iteratedFDerivWithin ℝ 2 (fun y => (1 - t) • θ.1.p l y + t • (embeddedSparseWitness s hji).p l y) (latentCube n) x = _ have hscaleθ : iteratedFDerivWithin ℝ 2 (fun y => (1 - t) • θ.1.p l y) (latentCube n) x = (1 - t) • iteratedFDerivWithin ℝ 2 (θ.1.p l) (latentCube n) x := by change iteratedFDerivWithin ℝ 2 ((1 - t) • θ.1.p l) (latentCube n) x = _ exact iteratedFDerivWithin_const_smul_apply (hθ2 x hx) hu hx have hscaleStar : iteratedFDerivWithin ℝ 2 (fun y => t • (embeddedSparseWitness s hji).p l y) (latentCube n) x = t • iteratedFDerivWithin ℝ 2 ((embeddedSparseWitness s hji).p l) (latentCube n) x := by change iteratedFDerivWithin ℝ 2 (t • (embeddedSparseWitness s hji).p l) (latentCube n) x = _ exact iteratedFDerivWithin_const_smul_apply (hstar2 x hx) hu hx rw [fun_iteratedFDerivWithin_add_apply ((hθ2.const_smul (1 - t)) x hx) ((hstar2.const_smul t) x hx) hu hx, hscaleθ, hscaleStar]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuous_affinePathExtension_p_iteratedFDerivWithin_two · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AffinePathTopology.lean:98
theorem continuous_affinePathExtension_q_fderivWithin

Given the selected directed edge, the intervention-factor first within-derivative coordinate varies continuously along the unrestricted affine path.

Formal statement
n :
θ :
j i :
Fin n
hji :
G.edge j i
l :
Fin n
Continuous (fun t : ℝ => ofFun {Icc (0 : ℝ) 1} (fderivWithin ℝ ((affinePathExtension s θ hji t).q l) (Icc (0 : ℝ) 1)))
Proof (Lean source)
@[fun_prop] lemma continuous_affinePathExtension_q_fderivWithin {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θ : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) (l : Fin n) : Continuous (fun t : ℝ => ofFun {Icc (0 : ℝ) 1} (fderivWithin ℝ ((affinePathExtension s θ hji t).q l) (Icc (0 : ℝ) 1))) := by let K := Icc (0 : ℝ) 1 let hu : UniqueDiffOn ℝ K := uniqueDiffOn_Icc (by norm_num) let hθ := θ.property.positiveSmooth.2.2.2.1 l let hstar := (embeddedSparseWitness_positive_normalized_smooth s hji).2.2.2.1 l apply continuous_uniformOnFun_of_eq_affine_on_compact isCompact_Icc (nonempty_Icc.mpr (by norm_num)) (hθ.continuousOn_fderivWithin hu (by norm_num)) (hstar.continuousOn_fderivWithin hu (by norm_num)) intro t x hx change fderivWithin ℝ (fun y => (1 - t) • θ.1.q l y + t • (embeddedSparseWitness s hji).q l y) K x = _ rw [fderivWithin_fun_add (hu.uniqueDiffWithinAt hx) (((hθ.const_smul (1 - t)) x hx).differentiableWithinAt (by norm_num)) (((hstar.const_smul t) x hx).differentiableWithinAt (by norm_num)), fderivWithin_fun_const_smul (hu.uniqueDiffWithinAt hx) ((hθ x hx).differentiableWithinAt (by norm_num)) (1 - t), fderivWithin_fun_const_smul (hu.uniqueDiffWithinAt hx) ((hstar x hx).differentiableWithinAt (by norm_num)) t]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuous_affinePathExtension_q_fderivWithin · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AffinePathTopology.lean:145
theorem continuous_affinePathExtension_q_iteratedFDerivWithin_two

Given the selected directed edge, the intervention-factor second within-derivative coordinate varies continuously along the unrestricted affine path.

Formal statement
n :
θ :
j i :
Fin n
hji :
G.edge j i
l :
Fin n
Continuous (fun t : ℝ => ofFun {Icc (0 : ℝ) 1} (iteratedFDerivWithin ℝ 2 ((affinePathExtension s θ hji t).q l) (Icc (0 : ℝ) 1)))
Proof (Lean source)
@[fun_prop] lemma continuous_affinePathExtension_q_iteratedFDerivWithin_two {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θ : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) (l : Fin n) : Continuous (fun t : ℝ => ofFun {Icc (0 : ℝ) 1} (iteratedFDerivWithin ℝ 2 ((affinePathExtension s θ hji t).q l) (Icc (0 : ℝ) 1))) := by let K := Icc (0 : ℝ) 1 let hu : UniqueDiffOn ℝ K := uniqueDiffOn_Icc (by norm_num) let hθ := θ.property.positiveSmooth.2.2.2.1 l let hstar := (embeddedSparseWitness_positive_normalized_smooth s hji).2.2.2.1 l let hθ2 : ContDiffOn ℝ 2 (θ.1.q l) K := hθ.of_le (by norm_num) let hstar2 : ContDiffOn ℝ 2 ((embeddedSparseWitness s hji).q l) K := hstar.of_le (by norm_num) apply continuous_uniformOnFun_of_eq_affine_on_compact isCompact_Icc (nonempty_Icc.mpr (by norm_num)) (hθ.continuousOn_iteratedFDerivWithin (by norm_num) hu) (hstar.continuousOn_iteratedFDerivWithin (by norm_num) hu) intro t x hx change iteratedFDerivWithin ℝ 2 (fun y => (1 - t) • θ.1.q l y + t • (embeddedSparseWitness s hji).q l y) K x = _ have hscaleθ : iteratedFDerivWithin ℝ 2 (fun y => (1 - t) • θ.1.q l y) K x = (1 - t) • iteratedFDerivWithin ℝ 2 (θ.1.q l) K x := by change iteratedFDerivWithin ℝ 2 ((1 - t) • θ.1.q l) K x = _ exact iteratedFDerivWithin_const_smul_apply (hθ2 x hx) hu hx have hscaleStar : iteratedFDerivWithin ℝ 2 (fun y => t • (embeddedSparseWitness s hji).q l y) K x = t • iteratedFDerivWithin ℝ 2 ((embeddedSparseWitness s hji).q l) K x := by change iteratedFDerivWithin ℝ 2 (t • (embeddedSparseWitness s hji).q l) K x = _ exact iteratedFDerivWithin_const_smul_apply (hstar2 x hx) hu hx rw [fun_iteratedFDerivWithin_add_apply ((hθ2.const_smul (1 - t)) x hx) ((hstar2.const_smul t) x hx) hu hx, hscaleθ, hscaleStar]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuous_affinePathExtension_q_iteratedFDerivWithin_two · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AffinePathTopology.lean:171
theorem continuous_affinePathExtension

Given the selected directed edge, the unrestricted affine mechanism path is continuous in the induced relative product C² topology.

Formal statement
n :
θ :
j i :
Fin n
hji :
G.edge j i
Continuous (fun t : ℝ => affinePathExtension s θ hji t)
Proof (Lean source)
@[fun_prop] lemma continuous_affinePathExtension {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θ : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) : Continuous (fun t : ℝ => affinePathExtension s θ hji t) := by rw [continuous_induced_rng] unfold mechanismC2Coordinates fun_prop
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuous_affinePathExtension · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AffinePathTopology.lean:211
theorem tendsto_affinePathExtension_zero

The unrestricted affine mechanism path tends to its initial stratum point at parameter zero. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
θ :
j i :
Fin n
hji :
G.edge j i
Tendsto (fun t : ℝ => affinePathExtension s θ hji t) (𝓝 0) (𝓝 θ.1)
Proof (Lean source)
lemma tendsto_affinePathExtension_zero {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θ : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) : Tendsto (fun t : ℝ => affinePathExtension s θ hji t) (𝓝 0) (𝓝 θ.1) := by have hzero : affinePathExtension s θ hji 0 = θ.1 := by rcases θ with ⟨⟨p, q, hlocal⟩, hprop⟩ simp [affinePathExtension] have hc : Tendsto (fun t : ℝ => affinePathExtension s θ hji t) (𝓝 0) (𝓝 (affinePathExtension s θ hji 0)) := (continuous_affinePathExtension θ hji).continuousAt rwa [hzero] at hc
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.tendsto_affinePathExtension_zero · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AffinePathTopology.lean:221
theorem affinePathExtension_p_eventually_uniform_close

The observational factors of the affine path are uniformly close to their initial values for all nodes and cube points when the parameter is sufficiently small. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
θ :
j i :
Fin n
hji :
G.edge j i
ε :
:
0 < ε
∃ δ > 0,
∀ t : ℝ,
|t| < δ → ∀ l v, v ∈ latentCube n → |(affinePathExtension s θ hji t).p l v
- θ.1.p l v| < ε
Proof (Lean source)
lemma affinePathExtension_p_eventually_uniform_close {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θ : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) {ε : ℝ} (hε : 0 < ε) : ∃ δ > 0, ∀ t : ℝ, |t| < δ → ∀ l v, v ∈ latentCube n → |(affinePathExtension s θ hji t).p l v - θ.1.p l v| < ε := by let θstar := embeddedSparseWitness s hji let K : Set (Fin n × LatentState n) := Set.univ ×ˢ latentCube n have hK : IsCompact K := isCompact_univ.prod (by rw [latentCube] exact isCompact_univ_pi fun _ => isCompact_Icc) have hKne : K.Nonempty := ⟨(j, 0), ⟨Set.mem_univ _, fun _ _ => ⟨by norm_num, by norm_num⟩⟩⟩ have hcont : ContinuousOn (fun z : Fin n × LatentState n => |θstar.p z.1 z.2 - θ.1.p z.1 z.2|) K := by rw [continuousOn_prod_of_discrete_left] intro l simpa only [K, Set.mem_prod, Set.mem_univ, true_and, Set.ofPred_mem_eq, θstar, Pi.sub_apply] using (((embeddedSparseWitness_positive_normalized_smooth s hji).2.2.1 l).continuousOn.sub (θ.property.positiveSmooth.2.2.1 l).continuousOn).abs rcases hK.exists_isMaxOn hKne hcont with ⟨z₀, hz₀, hzmax⟩ let B := |θstar.p z₀.1 z₀.2 - θ.1.p z₀.1 z₀.2| + 1 have hB : 0 < B := by dsimp [B]; positivity refine ⟨ε / B, div_pos hε hB, ?_⟩ intro t ht l v hv have hbound0 := hzmax (show (l, v) ∈ K from ⟨Set.mem_univ _, hv⟩) change |θstar.p l v - θ.1.p l v| ≤ |θstar.p z₀.1 z₀.2 - θ.1.p z₀.1 z₀.2| at hbound0 have hbound : |θstar.p l v - θ.1.p l v| < B := by dsimp [B]; linarith change |((1 - t) * θ.1.p l v + t * θstar.p l v) - θ.1.p l v| < ε rw [show ((1 - t) * θ.1.p l v + t * θstar.p l v) - θ.1.p l v = t * (θstar.p l v - θ.1.p l v) by ring, abs_mul] calc |t| * |θstar.p l v - θ.1.p l v| ≤ |t| * B := mul_le_mul_of_nonneg_left hbound.le (abs_nonneg _) _ < (ε / B) * B := mul_lt_mul_of_pos_right ht hB _ = ε := div_mul_cancel₀ ε hB.ne'
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathExtension_p_eventually_uniform_close · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AffinePathTopology.lean:234
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.AnalyticEdgePerturbation 52 declarations The lemma states the path integral identity, analytic nonidentity certificate, isolated-zero property, and arbitrarily small stratum-preserving perturbation.

Analytic edge perturbation

The lemma states the path integral identity, analytic nonidentity certificate, isolated-zero property, and arbitrarily small stratum-preserving perturbation.

theorem isOpen_affine_forall_gt

A strict uniform lower bound for finitely many affine families on a compact space defines an open set of parameters. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
a b :
ι → X → ℝ
c :
ha :
∀ i, Continuous (a i)
hb :
∀ i, Continuous (b i)
IsOpen {t : ℝ | ∀ i x, c < (1 - t) * a i x + t * b i x}
Proof (Lean source)
lemma isOpen_affine_forall_gt {ι X : Type*} [Finite ι] [TopologicalSpace ι] [DiscreteTopology ι] [TopologicalSpace X] [CompactSpace X] (a b : ι → X → ℝ) (c : ℝ) (ha : ∀ i, Continuous (a i)) (hb : ∀ i, Continuous (b i)) : IsOpen {t : ℝ | ∀ i x, c < (1 - t) * a i x + t * b i x} := by rw [isOpen_iff_mem_nhds] intro t ht have hcompact : IsCompact (Set.univ : Set (ι × X)) := isCompact_univ have ha' : Continuous (fun z : ι × X ↦ a z.1 z.2) := continuous_prod_of_discrete_left.mpr ha have hb' : Continuous (fun z : ι × X ↦ b z.1 z.2) := continuous_prod_of_discrete_left.mpr hb have hevent : ∀ᶠ u in 𝓝 t, ∀ z : ι × X, c < (1 - u) * a z.1 z.2 + u * b z.1 z.2 := by simpa only [Set.mem_univ, forall_const] using (hcompact.eventually_forall_of_forall_eventually (x₀ := t) (P := fun u z ↦ c < (1 - u) * a z.1 z.2 + u * b z.1 z.2) (by intro z _ apply (show ContinuousAt (fun w : ℝ × (ι × X) ↦ (1 - w.1) * a w.2.1 w.2.2 + w.1 * b w.2.1 w.2.2) (t, z) by exact (((continuous_const.sub continuous_fst).mul (ha'.comp continuous_snd)).add (continuous_fst.mul (hb'.comp continuous_snd))).continuousAt).tendsto exact Ioi_mem_nhds (ht z.1 z.2))) filter_upwards [hevent] with u hu exact fun i x ↦ hu (i, x)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.isOpen_affine_forall_gt · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:26
theorem convex_affine_forall_gt

Strict affine lower-bound constraints are convex in the scalar parameter. the stated conclusion follows.

Formal statement
iota X :
Type*
a b :
iota → X → ℝ
c :
Convex ℝ {t : ℝ | ∀ i x, c < (1 - t) * a i x + t * b i x}
Proof (Lean source)
lemma convex_affine_forall_gt {iota X : Type*} (a b : iota → X → ℝ) (c : ℝ) : Convex ℝ {t : ℝ | ∀ i x, c < (1 - t) * a i x + t * b i x} := by intro x hx y hy u v hu hv huv i z change c < (1 - (u * x + v * y)) * a i z + (u * x + v * y) * b i z have hx' := hx i z have hy' := hy i z have hvEq : v = 1 - u := by linarith rw [show (1 - (u * x + v * y)) * a i z + (u * x + v * y) * b i z = u * ((1 - x) * a i z + x * b i z) + v * ((1 - y) * a i z + y * b i z) by rw [hvEq] ring, show c = u * c + v * c by rw [hvEq]; ring] by_cases hupos : 0 < u · exact add_lt_add_of_lt_of_le (mul_lt_mul_of_pos_left hx' hupos) (mul_le_mul_of_nonneg_left hy'.le hv) · have hvpos : 0 < v := by linarith exact add_lt_add_of_le_of_lt (mul_le_mul_of_nonneg_left hx'.le hu) (mul_lt_mul_of_pos_left hy' hvpos)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.convex_affine_forall_gt · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:56

The ordered two-point finset is equivalent to Fin 2.

Definition (Lean source)
α :
Type*
α
hab :
a ≠ b
pairFinEquiv hab :
Fin 2 ≃ {x : α // x ∈ ({a, b} : Finset α)}
clause 1
toFun k := if hk : k = 0 then ⟨a, by simp⟩ else ⟨b, by simp⟩
clause 2
invFun x := if x.1 = a then 0 else 1
clause 3
left_inv k := by fin_cases k · simp · simp [Ne.symm hab]
clause 4
right_inv x := by apply Subtype.ext simp only by_cases hx : x.1
= a · simp [hx] · have hxmem := x.2 simp only [Finset.mem_insert, mem_singleton] at hxmem have hxb : x.1 = b := hxmem.resolve_left hx simp [hxb, Ne.symm hab]
theorem integral_fin_two_pi_eq_iterated Lemma integral_fin_two_pi_eq_iterated in the paper ↗

Fubini's theorem for a two-coordinate product measure in coordinate order. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
μ :
f :
(Fin 2 → ℝ) → ℝ
hf :
Integrable f (Measure.pi fun _ : Fin 2 => μ)
(∫ v, f v ∂Measure.pi fun _ : Fin 2 => μ) = ∫ x, (∫ y, f ![x, y] ∂μ) ∂μ
Proof (Lean source)
lemma integral_fin_two_pi_eq_iterated (μ : Measure ℝ) [SigmaFinite μ] (f : (Fin 2 → ℝ) → ℝ) (hf : Integrable f (Measure.pi fun _ : Fin 2 => μ)) : (∫ v, f v ∂Measure.pi fun _ : Fin 2 => μ) = ∫ x, (∫ y, f ![x, y] ∂μ) ∂μ := by let e2 := MeasurableEquiv.piFinSuccAbove (fun _ : Fin 2 => ℝ) 0 have he2 := (measurePreserving_piFinSuccAbove (fun _ : Fin 2 => μ) 0).symm have hf2 : Integrable (f ∘ e2.symm) (μ.prod (Measure.pi fun _ : Fin 1 => μ)) := (he2.integrable_comp_emb e2.symm.measurableEmbedding).2 hf rw [← he2.integral_comp e2.symm.measurableEmbedding] have hf2' := hf2 change Integrable (fun z => f (e2.symm z)) (μ.prod (Measure.pi fun _ : Fin 1 => μ)) at hf2' rw [integral_prod _ hf2'] apply integral_congr_ae filter_upwards [hf2'.prod_right_ae] with x hfx let e1 := MeasurableEquiv.piUnique (fun _ : Fin 1 => ℝ) have he1 := (measurePreserving_piUnique (fun _ : Fin 1 => μ)).symm rw [← he1.integral_comp e1.symm.measurableEmbedding] apply integral_congr_ae filter_upwards with y congr 1 funext k fin_cases k <;> rfl
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.integral_fin_two_pi_eq_iterated · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:99
def affinePathContrast

Direct-edge contrast along the identity-target affine path.

Definition (Lean source)
n :
DAG (Fin n)
s :
θ :
j i :
Fin n
hji :
G.edge j i
t :
affinePathContrast s θ hji t :
θt :
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathContrast · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:124
def affinePathContrastIntegral

The explicit rational-integral expression for the direct-edge path contrast.

Definition (Lean source)
n :
DAG (Fin n)
s :
θ :
j i :
Fin n
hji :
G.edge j i
t :
affinePathContrastIntegral s θ hji t :
θt :
∫ v in latentCube n, (θt.q i (v i)) ^ 2 * (θt.q j (v j) - θt.p j v) * (∏ l ∈ (Finset.univ.erase i).erase j, θt.p l v) / θt.p i v
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathContrastIntegral · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:130
def affineFactorPolynomial

The degree-one polynomial whose value at t is the affine interpolation from a to b.

Definition (Lean source)
a b :
affineFactorPolynomial a b :
Polynomial.C a + Polynomial.X * Polynomial.C (b - a)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affineFactorPolynomial · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:139
theorem affineFactorPolynomial_eval

The degree-one factor polynomial evaluates to affine interpolation.

Formal statement
a b t :
(affineFactorPolynomial a b).eval t = (1 - t) * a + t * b
Proof (Lean source)
@[simp] lemma affineFactorPolynomial_eval (a b t : ℝ) : (affineFactorPolynomial a b).eval t = (1 - t) * a + t * b := by simp [affineFactorPolynomial] ring
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affineFactorPolynomial_eval · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:143
theorem affineFactorPolynomial_natDegree_le_one

The affine factor polynomial has degree at most one.

Formal statement
a b :
Proof (Lean source)
lemma affineFactorPolynomial_natDegree_le_one (a b : ℝ) : (affineFactorPolynomial a b).natDegree ≤ 1 := by unfold affineFactorPolynomial compute_degree
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affineFactorPolynomial_natDegree_le_one · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:149
def affinePathNumeratorPolynomial

Polynomial encoding of the complete numerator in affinePathContrastIntegral.

Definition (Lean source)
n :
DAG (Fin n)
s :
θs :
j i :
Fin n
hji :
G.edge j i
v :
affinePathNumeratorPolynomial s θs hji v :
θstar :
(affineFactorPolynomial (θs.1.q i (v i)) (θstar.q i (v i))) ^ 2 * (affineFactorPolynomial (θs.1.q j (v j)) (θstar.q j (v j)) - affineFactorPolynomial (θs.1.p j v) (θstar.p j v)) * ∏ l ∈ (Finset.univ.erase i).erase j, affineFactorPolynomial (θs.1.p l v) (θstar.p l v)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathNumeratorPolynomial · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:155
theorem affinePathNumeratorPolynomial_eval

Evaluating the numerator polynomial recovers exactly the affine-path numerator. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
θs :
j i :
Fin n
hji :
G.edge j i
t :
v :
(affinePathNumeratorPolynomial s θs hji v).eval t
= ((affinePathExtension s θs hji t).q i (v i)) ^ 2 * ((affinePathExtension s θs hji t).q j (v j) - (affinePathExtension s θs hji t).p j v) * (∏ l ∈ (Finset.univ.erase i).erase j, (affinePathExtension s θs hji t).p l v)
Proof (Lean source)
lemma affinePathNumeratorPolynomial_eval {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θs : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) (t : ℝ) (v : LatentState n) : (affinePathNumeratorPolynomial s θs hji v).eval t = ((affinePathExtension s θs hji t).q i (v i)) ^ 2 * ((affinePathExtension s θs hji t).q j (v j) - (affinePathExtension s θs hji t).p j v) * (∏ l ∈ (Finset.univ.erase i).erase j, (affinePathExtension s θs hji t).p l v) := by unfold affinePathNumeratorPolynomial simp only [Polynomial.eval_mul, Polynomial.eval_sub, Polynomial.eval_pow] simp_rw [Polynomial.eval_prod] simp [affinePathExtension]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathNumeratorPolynomial_eval · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:167
def affinePathNumeratorCoefficient

Coefficients of the affine-path numerator, padded to the uniform degree bound n + 3.

Definition (Lean source)
n :
DAG (Fin n)
s :
θs :
j i :
Fin n
hji :
G.edge j i
affinePathNumeratorCoefficient s θs hji :
Fin (n + 3 + 1) → LatentState n → ℝ
fun k v ↦ (affinePathNumeratorPolynomial s θs hji v).coeff k
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathNumeratorCoefficient · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:183
theorem continuousOn_polynomial_mul_coeff

If every coefficient of the first polynomial family is continuous and every coefficient of the second is continuous, then each product coefficient is continuous.

Formal statement
α :
Type*
Set α
α → Polynomial
hP :
∀ k, ContinuousOn (fun x ↦ (P x).coeff k) K
hQ :
∀ k, ContinuousOn (fun x ↦ (Q x).coeff k) K
k :
ContinuousOn (fun x ↦ (P x * Q x).coeff k) K
Proof (Lean source)
lemma continuousOn_polynomial_mul_coeff {α : Type*} [TopologicalSpace α] {K : Set α} {P Q : α → Polynomial ℝ} (hP : ∀ k, ContinuousOn (fun x ↦ (P x).coeff k) K) (hQ : ∀ k, ContinuousOn (fun x ↦ (Q x).coeff k) K) (k : ℕ) : ContinuousOn (fun x ↦ (P x * Q x).coeff k) K := by simp only [Polynomial.coeff_mul] exact continuousOn_finsetSum _ fun ij _ ↦ (hP ij.1).mul (hQ ij.2)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuousOn_polynomial_mul_coeff · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:190
theorem continuousOn_affineFactorPolynomial_coeff

If the first endpoint varies continuously and the second endpoint varies continuously, then every affine-factor coefficient varies continuously.

Formal statement
α :
Type*
Set α
α → ℝ
ha :
hb :
k :
ContinuousOn (fun x ↦ (affineFactorPolynomial (a x) (b x)).coeff k) K
Proof (Lean source)
lemma continuousOn_affineFactorPolynomial_coeff {α : Type*} [TopologicalSpace α] {K : Set α} {a b : α → ℝ} (ha : ContinuousOn a K) (hb : ContinuousOn b K) (k : ℕ) : ContinuousOn (fun x ↦ (affineFactorPolynomial (a x) (b x)).coeff k) K := by rcases k with _ | k · simpa [affineFactorPolynomial] using ha · rcases k with _ | k · have h := hb.sub ha change ContinuousOn (fun x ↦ b x - a x) K at h simpa [affineFactorPolynomial, Polynomial.coeff_X_mul] using h · simp [affineFactorPolynomial] fun_prop
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuousOn_affineFactorPolynomial_coeff · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:201
theorem continuousOn_polynomial_finsetProd_coeff

If every coefficient in a finite polynomial family is continuous, then every coefficient of its finite product is continuous.

Formal statement
α ι :
S :
P :
ι → α → Polynomial
hP :
∀ i ∈ S, ∀ k, ContinuousOn (fun x ↦ (P i x).coeff k) K
k :
ContinuousOn (fun x ↦ (∏ i ∈ S, P i x).coeff k) K
Proof (Lean source)
lemma continuousOn_polynomial_finsetProd_coeff {α ι : Type*} [TopologicalSpace α] [DecidableEq ι] {K : Set α} (S : Finset ι) (P : ι → α → Polynomial ℝ) (hP : ∀ i ∈ S, ∀ k, ContinuousOn (fun x ↦ (P i x).coeff k) K) (k : ℕ) : ContinuousOn (fun x ↦ (∏ i ∈ S, P i x).coeff k) K := by classical revert hP k induction S using Finset.induction_on with | empty => intro _ k simp fun_prop | @insert a S ha ih => intro hP k simp only [Finset.prod_insert ha] exact continuousOn_polynomial_mul_coeff (fun m ↦ hP a (by simp) m) (fun m ↦ ih (fun i hi k ↦ hP i (by simp [hi]) k) m) k
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuousOn_polynomial_finsetProd_coeff · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:216
theorem affinePathNumeratorPolynomial_natDegree_lt

The uniform padding bound really contains every numerator coefficient. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
θs :
j i :
Fin n
hji :
G.edge j i
v :
(affinePathNumeratorPolynomial s θs hji v).natDegree < n + 3 + 1
Proof (Lean source)
lemma affinePathNumeratorPolynomial_natDegree_lt {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θs : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) (v : LatentState n) : (affinePathNumeratorPolynomial s θs hji v).natDegree < n + 3 + 1 := by unfold affinePathNumeratorPolynomial calc _ ≤ 2 * 1 + 1 + ∑ l ∈ (Finset.univ.erase i).erase j, 1 := by refine Polynomial.natDegree_mul_le.trans ?_ refine Nat.add_le_add ?_ ?_ · exact Polynomial.natDegree_mul_le.trans (Nat.add_le_add (Polynomial.natDegree_pow_le.trans (Nat.mul_le_mul_left 2 (affineFactorPolynomial_natDegree_le_one _ _))) ((Polynomial.natDegree_sub_le _ _).trans (max_le (affineFactorPolynomial_natDegree_le_one _ _) (affineFactorPolynomial_natDegree_le_one _ _)))) · calc _ ≤ ∑ l ∈ (Finset.univ.erase i).erase j, (affineFactorPolynomial (θs.1.p l v) ((embeddedSparseWitness s hji).p l v)).natDegree := Polynomial.natDegree_prod_le ((Finset.univ.erase i).erase j) (fun l ↦ affineFactorPolynomial (θs.1.p l v) ((embeddedSparseWitness s hji).p l v)) _ ≤ ∑ l ∈ (Finset.univ.erase i).erase j, 1 := Finset.sum_le_sum fun l _ ↦ affineFactorPolynomial_natDegree_le_one _ _ _ ≤ n + 3 := by have hc : ((Finset.univ.erase i).erase j).card ≤ n := by calc _ ≤ (Finset.univ : Finset (Fin n)).card := Finset.card_le_card (by simp) _ = n := Finset.card_fin n simpa [Finset.sum_const, Nat.add_comm] using Nat.add_le_add_left hc 3 _ < n + 3 + 1 := Nat.lt_succ_self _
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathNumeratorPolynomial_natDegree_lt · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:237
theorem affinePathNumerator_polynomialNumerator_eq

The padded coefficient family evaluates to the complete affine numerator. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
θs :
j i :
Fin n
hji :
G.edge j i
t :
v :
Proof (Lean source)
lemma affinePathNumerator_polynomialNumerator_eq {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θs : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) (t : ℝ) (v : LatentState n) : polynomialNumerator (n + 3) (affinePathNumeratorCoefficient s θs hji) t v = (affinePathNumeratorPolynomial s θs hji v).eval t := by rw [Polynomial.eval_eq_sum_range' (affinePathNumeratorPolynomial_natDegree_lt θs hji v)] unfold polynomialNumerator simpa [affinePathNumeratorCoefficient] using (Fin.sum_univ_eq_sum_range (fun k : ℕ ↦ (affinePathNumeratorPolynomial s θs hji v).coeff k * t ^ k) (n + 3 + 1))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathNumerator_polynomialNumerator_eq · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:273
theorem affinePathNumeratorCoefficient_continuousOn

Every padded numerator coefficient is continuous on the compact latent cube. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
θs :
j i :
Fin n
hji :
G.edge j i
k :
Fin (n + 3 + 1)
Proof (Lean source)
lemma affinePathNumeratorCoefficient_continuousOn {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θs : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) (k : Fin (n + 3 + 1)) : ContinuousOn (affinePathNumeratorCoefficient s θs hji k) (latentCube n) := by let θstar := embeddedSparseWitness s hji have hθ := θs.property.positiveSmooth have hstar := embeddedSparseWitness_positive_normalized_smooth s hji have hpθ (l : Fin n) : ContinuousOn (θs.1.p l) (latentCube n) := (hθ.2.2.1 l).continuousOn have hpstar (l : Fin n) : ContinuousOn (θstar.p l) (latentCube n) := (hstar.2.2.1 l).continuousOn have hqθ (l : Fin n) : ContinuousOn (fun v : LatentState n ↦ θs.1.q l (v l)) (latentCube n) := (hθ.2.2.2.1 l).continuousOn.comp ((continuous_apply l).continuousOn) (fun v hv ↦ hv l (Set.mem_univ l)) have hqstar (l : Fin n) : ContinuousOn (fun v : LatentState n ↦ θstar.q l (v l)) (latentCube n) := (hstar.2.2.2.1 l).continuousOn.comp ((continuous_apply l).continuousOn) (fun v hv ↦ hv l (Set.mem_univ l)) have hpfac (l : Fin n) (m : ℕ) : ContinuousOn (fun v ↦ (affineFactorPolynomial (θs.1.p l v) (θstar.p l v)).coeff m) (latentCube n) := continuousOn_affineFactorPolynomial_coeff (hpθ l) (hpstar l) m have hqfac (l : Fin n) (m : ℕ) : ContinuousOn (fun v ↦ (affineFactorPolynomial (θs.1.q l (v l)) (θstar.q l (v l))).coeff m) (latentCube n) := continuousOn_affineFactorPolynomial_coeff (hqθ l) (hqstar l) m have hqpow (m : ℕ) : ContinuousOn (fun v ↦ ((affineFactorPolynomial (θs.1.q i (v i)) (θstar.q i (v i))) ^ 2).coeff m) (latentCube n) := by simpa only [pow_two] using continuousOn_polynomial_mul_coeff (hqfac i) (hqfac i) m have hdiff (m : ℕ) : ContinuousOn (fun v ↦ (affineFactorPolynomial (θs.1.q j (v j)) (θstar.q j (v j)) - affineFactorPolynomial (θs.1.p j v) (θstar.p j v)).coeff m) (latentCube n) := by have h := (hqfac j m).sub (hpfac j m) change ContinuousOn (fun v ↦ (affineFactorPolynomial (θs.1.q j (v j)) (θstar.q j (v j))).coeff m - (affineFactorPolynomial (θs.1.p j v) (θstar.p j v)).coeff m) (latentCube n) at h simpa only [Polynomial.coeff_sub] using h have hprod (m : ℕ) : ContinuousOn (fun v ↦ (∏ l ∈ (Finset.univ.erase i).erase j, affineFactorPolynomial (θs.1.p l v) (θstar.p l v)).coeff m) (latentCube n) := continuousOn_polynomial_finsetProd_coeff ((Finset.univ.erase i).erase j) (fun l v ↦ affineFactorPolynomial (θs.1.p l v) (θstar.p l v)) (fun l _ m ↦ hpfac l m) m have hleft (m : ℕ) := continuousOn_polynomial_mul_coeff hqpow hdiff m have hall (m : ℕ) := continuousOn_polynomial_mul_coeff hleft hprod m change ContinuousOn (fun v ↦ (affinePathNumeratorPolynomial s θs hji v).coeff k) (latentCube n) simpa [affinePathNumeratorPolynomial, θstar] using hall k
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathNumeratorCoefficient_continuousOn · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:288
theorem latentCube_isClosed

A globally continuous extension of each cube coefficient, needed because the generic parametric-integral API states measurability on the ambient sample space. the stated conclusion follows.

Formal statement
n :
Proof (Lean source)
lemma latentCube_isClosed (n : ℕ) : IsClosed (latentCube n) := by rw [latentCube] exact (isCompact_univ_pi fun _ ↦ isCompact_Icc).isClosed
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.latentCube_isClosed · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:343
def affinePathNumeratorCoefficientExtension

For a finite dimension, DAG, sign pattern, stratum point, directed edge endpoints, edge certificate, and coefficient index, the globally continuous extension of the affine numerator coefficient agrees on the cube.

Definition (Lean source)
n :
DAG (Fin n)
s :
θs :
j i :
Fin n
hji :
G.edge j i
k :
Fin (n + 3 + 1)
affinePathNumeratorCoefficientExtension s θs hji k :
LatentState n → ℝ
f :
⟨fun v ↦ affinePathNumeratorCoefficient s θs hji k v.1, (affinePathNumeratorCoefficient_continuousOn θs hji k).restrict⟩ (: C({v : LatentState n // v ∈ latentCube n}, ℝ))
⇑(choose (ContinuousMap.exists_restrict_eq (latentCube_isClosed n) f))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathNumeratorCoefficientExtension · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:349
theorem affinePathNumeratorCoefficientExtension_continuous

Given the selected directed edge, the extended affine numerator coefficient is continuous on the ambient latent space.

Formal statement
n :
θs :
j i :
Fin n
hji :
G.edge j i
k :
Fin (n + 3 + 1)
Proof (Lean source)
lemma affinePathNumeratorCoefficientExtension_continuous {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θs : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) (k : Fin (n + 3 + 1)) : Continuous (affinePathNumeratorCoefficientExtension s θs hji k) := by unfold affinePathNumeratorCoefficientExtension exact (choose (ContinuousMap.exists_restrict_eq (latentCube_isClosed n) (show C({v : LatentState n // v ∈ latentCube n}, ℝ) from ⟨fun v ↦ affinePathNumeratorCoefficient s θs hji k v.1, (affinePathNumeratorCoefficient_continuousOn θs hji k).restrict⟩))).continuous
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathNumeratorCoefficientExtension_continuous · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:361
theorem affinePathNumeratorCoefficientExtension_eq

Given the selected directed edge and a point in the latent cube, the coefficient extension agrees with the original coefficient.

Formal statement
n :
θs :
j i :
Fin n
hji :
G.edge j i
k :
Fin (n + 3 + 1)
v :
hv :
v ∈ latentCube n
Proof (Lean source)
lemma affinePathNumeratorCoefficientExtension_eq {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θs : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) (k : Fin (n + 3 + 1)) {v : LatentState n} (hv : v ∈ latentCube n) : affinePathNumeratorCoefficientExtension s θs hji k v = affinePathNumeratorCoefficient s θs hji k v := by let f : C({v : LatentState n // v ∈ latentCube n}, ℝ) := ⟨fun v ↦ affinePathNumeratorCoefficient s θs hji k v.1, (affinePathNumeratorCoefficient_continuousOn θs hji k).restrict⟩ have hs := Classical.choose_spec (ContinuousMap.exists_restrict_eq (latentCube_isClosed n) f) change (choose (ContinuousMap.exists_restrict_eq (latentCube_isClosed n) f)) v = _ exact DFunLike.congr_fun hs ⟨v, hv⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathNumeratorCoefficientExtension_eq · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:374
theorem affinePathNumerator_extension_polynomialNumerator_eq

Given the selected directed edge and a point in the latent cube, the extended polynomial numerator equals the original numerator polynomial evaluation.

Formal statement
n :
θs :
j i :
Fin n
hji :
G.edge j i
t :
v :
hv :
v ∈ latentCube n
Proof (Lean source)
lemma affinePathNumerator_extension_polynomialNumerator_eq {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θs : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) (t : ℝ) {v : LatentState n} (hv : v ∈ latentCube n) : polynomialNumerator (n + 3) (affinePathNumeratorCoefficientExtension s θs hji) t v = (affinePathNumeratorPolynomial s θs hji v).eval t := by rw [← affinePathNumerator_polynomialNumerator_eq θs hji t v] unfold polynomialNumerator apply Finset.sum_congr rfl intro k _ rw [affinePathNumeratorCoefficientExtension_eq θs hji k hv]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathNumerator_extension_polynomialNumerator_eq · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:391
theorem affinePathNumeratorCoefficientExtension_measurable

Given the selected directed edge, the extended affine numerator coefficient is measurable.

Formal statement
n :
θs :
j i :
Fin n
hji :
G.edge j i
k :
Fin (n + 3 + 1)
Proof (Lean source)
lemma affinePathNumeratorCoefficientExtension_measurable {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θs : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) (k : Fin (n + 3 + 1)) : Measurable (affinePathNumeratorCoefficientExtension s θs hji k) := (affinePathNumeratorCoefficientExtension_continuous θs hji k).measurable
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathNumeratorCoefficientExtension_measurable · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:406
theorem affinePathNumeratorCoefficientExtension_compact_bounds

Given the selected directed edge, the extended numerator coefficients have uniform bounds on the compact latent cube.

Formal statement
n :
θs :
j i :
Fin n
hji :
G.edge j i
∃ C : Fin (n + 3 + 1) → ℝ,
∀ k v, v ∈ latentCube n → |affinePathNumeratorCoefficientExtension s θs hji k v| ≤ C k
Proof (Lean source)
lemma affinePathNumeratorCoefficientExtension_compact_bounds {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θs : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) : ∃ C : Fin (n + 3 + 1) → ℝ, ∀ k v, v ∈ latentCube n → |affinePathNumeratorCoefficientExtension s θs hji k v| ≤ C k := by have hK : IsCompact (latentCube n) := by rw [latentCube] exact isCompact_univ_pi fun _ ↦ isCompact_Icc choose C hC using fun k : Fin (n + 3 + 1) ↦ hK.exists_bound_of_continuousOn (affinePathNumeratorCoefficientExtension_continuous θs hji k).continuousOn exact ⟨C, fun k v hv ↦ hC k v hv⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathNumeratorCoefficientExtension_compact_bounds · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:415
def affinePathDenominatorStartExtension

A globally continuous representative of the initial distinguished denominator factor.

Definition (Lean source)
n :
theta :
i :
Fin n
affinePathDenominatorStartExtension theta i :
LatentState n → ℝ
f :
⟨fun v ↦ theta.1.p i v.1, (theta.property.positiveSmooth.2.2.1 i).continuousOn.restrict⟩ (: C({v : LatentState n // v ∈ latentCube n}, ℝ))
⇑(choose (ContinuousMap.exists_restrict_eq (latentCube_isClosed n) f))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathDenominatorStartExtension · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:430
def affinePathDenominatorEndExtension

A globally continuous representative of the terminal distinguished denominator factor.

Definition (Lean source)
n :
DAG (Fin n)
s :
j i :
Fin n
hji :
G.edge j i
affinePathDenominatorEndExtension s hji :
LatentState n → ℝ
thetaStar :
f :
⟨fun v ↦ thetaStar.p i v.1, ((embeddedSparseWitness_positive_normalized_smooth s hji).2.2.1 i).continuousOn.restrict⟩ (: C({v : LatentState n // v ∈ latentCube n}, ℝ))
⇑(choose (ContinuousMap.exists_restrict_eq (latentCube_isClosed n) f))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathDenominatorEndExtension · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:438
theorem affinePathDenominatorStartExtension_continuous

The initial denominator extension is continuous on the ambient latent space.

Formal statement
n :
theta :
i :
Fin n
Proof (Lean source)
lemma affinePathDenominatorStartExtension_continuous {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (theta : StratumPoint G s) (i : Fin n) : Continuous (affinePathDenominatorStartExtension theta i) := by unfold affinePathDenominatorStartExtension exact (choose (ContinuousMap.exists_restrict_eq (latentCube_isClosed n) (show C({v : LatentState n // v ∈ latentCube n}, ℝ) from ⟨fun v ↦ theta.1.p i v.1, (theta.property.positiveSmooth.2.2.1 i).continuousOn.restrict⟩))).continuous
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathDenominatorStartExtension_continuous · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:448
theorem affinePathDenominatorEndExtension_continuous

Given the selected directed edge, the terminal denominator extension is continuous on the ambient latent space.

Formal statement
n :
hji :
G.edge j i
Proof (Lean source)
lemma affinePathDenominatorEndExtension_continuous {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} {j i : Fin n} (hji : G.edge j i) : Continuous (affinePathDenominatorEndExtension s hji) := by unfold affinePathDenominatorEndExtension exact (choose (ContinuousMap.exists_restrict_eq (latentCube_isClosed n) (show C({v : LatentState n // v ∈ latentCube n}, ℝ) from ⟨fun v ↦ (embeddedSparseWitness s hji).p i v.1, ((embeddedSparseWitness_positive_normalized_smooth s hji).2.2.1 i).continuousOn.restrict⟩))).continuous
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathDenominatorEndExtension_continuous · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:459
theorem affinePathDenominatorStartExtension_eq

For a point in the latent cube, the initial denominator extension agrees with the stratum mechanism factor.

Formal statement
n :
theta :
i :
Fin n
v :
hv :
v ∈ latentCube n
affinePathDenominatorStartExtension theta i v = theta.1.p i v
Proof (Lean source)
lemma affinePathDenominatorStartExtension_eq {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (theta : StratumPoint G s) (i : Fin n) {v : LatentState n} (hv : v ∈ latentCube n) : affinePathDenominatorStartExtension theta i v = theta.1.p i v := by let f : C({v : LatentState n // v ∈ latentCube n}, ℝ) := ⟨fun v ↦ theta.1.p i v.1, (theta.property.positiveSmooth.2.2.1 i).continuousOn.restrict⟩ have hs := Classical.choose_spec (ContinuousMap.exists_restrict_eq (latentCube_isClosed n) f) change (choose (ContinuousMap.exists_restrict_eq (latentCube_isClosed n) f)) v = _ exact DFunLike.congr_fun hs ⟨v, hv⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathDenominatorStartExtension_eq · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:471
theorem affinePathDenominatorEndExtension_eq

Given the selected directed edge and a point in the latent cube, the terminal denominator extension agrees with the sparse-witness factor.

Formal statement
n :
hji :
G.edge j i
v :
hv :
v ∈ latentCube n
Proof (Lean source)
lemma affinePathDenominatorEndExtension_eq {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} {j i : Fin n} (hji : G.edge j i) {v : LatentState n} (hv : v ∈ latentCube n) : affinePathDenominatorEndExtension s hji v = (embeddedSparseWitness s hji).p i v := by let f : C({v : LatentState n // v ∈ latentCube n}, ℝ) := ⟨fun v ↦ (embeddedSparseWitness s hji).p i v.1, ((embeddedSparseWitness_positive_normalized_smooth s hji).2.2.1 i).continuousOn.restrict⟩ have hs := Classical.choose_spec (ContinuousMap.exists_restrict_eq (latentCube_isClosed n) f) change (choose (ContinuousMap.exists_restrict_eq (latentCube_isClosed n) f)) v = _ exact DFunLike.congr_fun hs ⟨v, hv⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathDenominatorEndExtension_eq · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:486
theorem affinePathExtension_zero

The unrestricted affine extension starts at the supplied stratum point. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
θ :
j i :
Fin n
hji :
G.edge j i
affinePathExtension s θ hji 0 = θ.1
Proof (Lean source)
lemma affinePathExtension_zero {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θ : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) : affinePathExtension s θ hji 0 = θ.1 := by rcases θ with ⟨⟨p, q, hlocal⟩, hprop⟩ simp [affinePathExtension]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathExtension_zero · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:504
theorem affinePathExtension_one

The unrestricted affine extension ends at the edge-specific sparse witness. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
θ :
j i :
Fin n
hji :
G.edge j i
Proof (Lean source)
lemma affinePathExtension_one {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θ : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) : affinePathExtension s θ hji 1 = embeddedSparseWitness s hji := by rcases θ with ⟨⟨p, q, hlocal⟩, hprop⟩ simp [affinePathExtension]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathExtension_one · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:513
theorem affinePathExtension_normalized_smooth

The unrestricted affine extension is normalized and for every real path parameter; only positivity requires restricting the parameter to a neighborhood of the closed unit interval. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
θ :
j i :
Fin n
hji :
G.edge j i
t :
conclusion 1
l :
ContDiffOn ℝ 3 ((affinePathExtension s θ hji t).p l) (latentCube n)
conclusion 2
l :
ContDiffOn ℝ 3 ((affinePathExtension s θ hji t).q l) (Icc (0 : ℝ) 1)
conclusion 3
l v :
v ∈ latentCube n
∫ z in Icc (0 : ℝ) 1, (affinePathExtension s θ hji t).p l (update v l z) = 1
conclusion 4
l :
∫ z in Icc (0 : ℝ) 1, (affinePathExtension s θ hji t).q l z = 1
Proof (Lean source)
lemma affinePathExtension_normalized_smooth {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θ : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) (t : ℝ) : (∀ l, ContDiffOn ℝ 3 ((affinePathExtension s θ hji t).p l) (latentCube n)) ∧ (∀ l, ContDiffOn ℝ 3 ((affinePathExtension s θ hji t).q l) (Icc (0 : ℝ) 1)) ∧ (∀ l v, v ∈ latentCube n → ∫ z in Icc (0 : ℝ) 1, (affinePathExtension s θ hji t).p l (update v l z) = 1) ∧ (∀ l, ∫ z in Icc (0 : ℝ) 1, (affinePathExtension s θ hji t).q l z = 1) := by let θstar := embeddedSparseWitness s hji have hθ := θ.property.positiveSmooth have hstar := embeddedSparseWitness_positive_normalized_smooth s hji refine ⟨?_, ?_, ?_, ?_⟩ · intro l exact (hθ.2.2.1 l).const_smul (1 - t) |>.add ((hstar.2.2.1 l).const_smul t) · intro l exact (hθ.2.2.2.1 l).const_smul (1 - t) |>.add ((hstar.2.2.2.1 l).const_smul t) · intro l v hv have hupdate : Continuous (fun z : ℝ => update v l z) := by fun_prop have hmaps : MapsTo (fun z : ℝ => update v l z) (Icc (0 : ℝ) 1) (latentCube n) := by intro z hz k _ by_cases hkl : k = l · subst k simpa using hz · simpa only [update, dif_neg hkl] using hv k (Set.mem_univ k) have hpInt : IntegrableOn (fun z : ℝ => (1 - t) * θ.1.p l (update v l z)) (Icc (0 : ℝ) 1) := by exact ((hθ.2.2.1 l).continuousOn.comp hupdate.continuousOn hmaps |>.const_mul _) |>.integrableOn_Icc have hpstarInt : IntegrableOn (fun z : ℝ => t * θstar.p l (update v l z)) (Icc (0 : ℝ) 1) := by exact ((hstar.2.2.1 l).continuousOn.comp hupdate.continuousOn hmaps |>.const_mul _) |>.integrableOn_Icc change ∫ z in Icc (0 : ℝ) 1, ((1 - t) * θ.1.p l (update v l z) + t * θstar.p l (update v l z)) = 1 rw [MeasureTheory.integral_add, MeasureTheory.integral_const_mul, MeasureTheory.integral_const_mul, hθ.2.2.2.2.1 l v hv, hstar.2.2.2.2.1 l v hv] · ring · exact hpInt · exact hpstarInt · intro l change ∫ z in Icc (0 : ℝ) 1, ((1 - t) * θ.1.q l z + t * θstar.q l z) = 1 rw [MeasureTheory.integral_add, MeasureTheory.integral_const_mul, MeasureTheory.integral_const_mul, hθ.2.2.2.2.2 l, hstar.2.2.2.2.2 l] · ring · exact ((hθ.2.2.2.1 l).continuousOn.const_mul _).integrableOn_Icc · exact ((hstar.2.2.2.1 l).continuousOn.const_mul _).integrableOn_Icc
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathExtension_normalized_smooth · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:522
theorem mechanism_p_uniform_lower

Positivity and compactness give one strict lower bound valid for every observational mechanism slot on the latent cube. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
∃ ε > 0, ∀ i v, v ∈ latentCube n → ε ≤ θ.p i v
Proof (Lean source)
lemma mechanism_p_uniform_lower {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (hθ : PositiveNormalizedSmoothMechanisms G θ) : ∃ ε > 0, ∀ i v, v ∈ latentCube n → ε ≤ θ.p i v := by let K : Set (Fin n × LatentState n) := Set.univ ×ˢ latentCube n have hK : IsCompact K := by exact isCompact_univ.prod (by rw [latentCube] exact isCompact_univ_pi fun _ => isCompact_Icc) have hcont : ContinuousOn (fun z : Fin n × LatentState n => θ.p z.1 z.2) K := by rw [continuousOn_prod_of_discrete_left] intro i simpa only [K, Set.mem_prod, Set.mem_univ, true_and, Set.ofPred_mem_eq] using (hθ.2.2.1 i).continuousOn have hpos : ∀ z ∈ K, (0 : ℝ) < θ.p z.1 z.2 := by intro z hz exact hθ.1 z.1 z.2 hz.2 rcases hK.exists_forall_le' hcont hpos with ⟨ε, hε, hbound⟩ exact ⟨ε, hε, fun i v hv => hbound (i, v) ⟨Set.mem_univ i, hv⟩⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.mechanism_p_uniform_lower · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:582
theorem mechanism_q_uniform_lower

Positivity and compactness give one strict lower bound valid for every intervention mechanism slot on the unit interval. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
∃ ε > 0, ∀ i z, z ∈ Icc (0 : ℝ) 1 → ε ≤ θ.q i z
Proof (Lean source)
lemma mechanism_q_uniform_lower {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (hθ : PositiveNormalizedSmoothMechanisms G θ) : ∃ ε > 0, ∀ i z, z ∈ Icc (0 : ℝ) 1 → ε ≤ θ.q i z := by let K : Set (Fin n × ℝ) := univ ×ˢ Icc (0 : ℝ) 1 have hK : IsCompact K := isCompact_univ.prod isCompact_Icc have hcont : ContinuousOn (fun z : Fin n × ℝ => θ.q z.1 z.2) K := by rw [continuousOn_prod_of_discrete_left] intro i simpa only [K, Set.mem_prod, Set.mem_univ, true_and, Set.ofPred_mem_eq] using (hθ.2.2.2.1 i).continuousOn have hpos : ∀ z ∈ K, (0 : ℝ) < θ.q z.1 z.2 := by intro z hz exact hθ.2.1 z.1 z.2 hz.2 rcases hK.exists_forall_le' hcont hpos with ⟨ε, hε, hbound⟩ exact ⟨ε, hε, fun i z hz => hbound (i, z) ⟨Set.mem_univ i, hz⟩⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.mechanism_q_uniform_lower · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:605
theorem affinePathExtension_open_positive_uniformDenominator

The closed affine path admits an open parameter enlargement on which all factors remain positive and the distinguished observational denominator has one uniform separation margin. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
θs :
j i :
Fin n
hji :
G.edge j i
∃ O : Set ℝ, ∃ ε > 0,
Icc (0 : ℝ) 1 ⊆ O
Convex ℝ O
conclusion 1
t ∈ O :
v ∈ latentCube n :
ε
≤ |affineDenominator (θs.1.p i) ((embeddedSparseWitness s hji).p i) t v|
Proof (Lean source)
lemma affinePathExtension_open_positive_uniformDenominator {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θs : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) : ∃ O : Set ℝ, ∃ ε > 0, IsOpen O ∧ Icc (0 : ℝ) 1 ⊆ O ∧ Convex ℝ O ∧ ∀ t ∈ O, PositiveNormalizedSmoothMechanisms G (affinePathExtension s θs hji t) ∧ ∀ v ∈ latentCube n, ε ≤ |affineDenominator (θs.1.p i) ((embeddedSparseWitness s hji).p i) t v| := by let θstar := embeddedSparseWitness s hji have hθ := θs.property.positiveSmooth have hstar := embeddedSparseWitness_positive_normalized_smooth s hji rcases mechanism_p_uniform_lower hθ with ⟨mpθ, hmpθ, hpθ⟩ rcases mechanism_p_uniform_lower hstar with ⟨mpstar, hmpstar, hpstar⟩ rcases mechanism_q_uniform_lower hθ with ⟨mqθ, hmqθ, hqθ⟩ rcases mechanism_q_uniform_lower hstar with ⟨mqstar, hmqstar, hqstar⟩ let m := min mpθ (min mpstar (min mqθ mqstar)) have hm : 0 < m := by dsimp [m]; positivity let Cube := {v : LatentState n // v ∈ latentCube n} let Unit := {z : ℝ // z ∈ Icc (0 : ℝ) 1} letI : CompactSpace Cube := isCompact_iff_compactSpace.mp (by rw [latentCube] exact isCompact_univ_pi fun _ ↦ isCompact_Icc) letI : CompactSpace Unit := isCompact_iff_compactSpace.mp isCompact_Icc let Op : Set ℝ := {t | ∀ l (v : Cube), m / 2 < (1 - t) * θs.1.p l v.1 + t * θstar.p l v.1} let Oq : Set ℝ := {t | ∀ l (z : Unit), m / 2 < (1 - t) * θs.1.q l z.1 + t * θstar.q l z.1} have hOp : IsOpen Op := isOpen_affine_forall_gt (fun l (v : Cube) ↦ θs.1.p l v.1) (fun l (v : Cube) ↦ θstar.p l v.1) (m / 2) (fun l ↦ (hθ.2.2.1 l).continuousOn.restrict) (fun l ↦ (hstar.2.2.1 l).continuousOn.restrict) have hOq : IsOpen Oq := isOpen_affine_forall_gt (fun l (z : Unit) ↦ θs.1.q l z.1) (fun l (z : Unit) ↦ θstar.q l z.1) (m / 2) (fun l ↦ (hθ.2.2.2.1 l).continuousOn.restrict) (fun l ↦ (hstar.2.2.2.1 l).continuousOn.restrict) have hOpConvex : Convex ℝ Op := convex_affine_forall_gt (fun l (v : Cube) ↦ θs.1.p l v.1) (fun l (v : Cube) ↦ θstar.p l v.1) (m / 2) have hOqConvex : Convex ℝ Oq := convex_affine_forall_gt (fun l (z : Unit) ↦ θs.1.q l z.1) (fun l (z : Unit) ↦ θstar.q l z.1) (m / 2) refine ⟨Op ∩ Oq, m / 2, half_pos hm, hOp.inter hOq, ?_, hOpConvex.inter hOqConvex, ?_⟩ · intro t ht constructor · intro l v have ha : m ≤ θs.1.p l v.1 := le_trans (min_le_left _ _) (hpθ l v.1 v.2) have hb : m ≤ θstar.p l v.1 := le_trans (min_le_right _ _ |>.trans (min_le_left _ _)) (hpstar l v.1 v.2) calc m / 2 < m := half_lt_self hm _ = (1 - t) * m + t * m := by ring _ ≤ (1 - t) * θs.1.p l v.1 + t * θstar.p l v.1 := add_le_add (mul_le_mul_of_nonneg_left ha (sub_nonneg.mpr ht.2)) (mul_le_mul_of_nonneg_left hb ht.1) · intro l z have ha : m ≤ θs.1.q l z.1 := le_trans (min_le_right _ _ |>.trans (min_le_right _ _ |>.trans (min_le_left _ _))) (hqθ l z.1 z.2) have hb : m ≤ θstar.q l z.1 := le_trans (min_le_right _ _ |>.trans (min_le_right _ _ |>.trans (min_le_right _ _))) (hqstar l z.1 z.2) calc m / 2 < m := half_lt_self hm _ = (1 - t) * m + t * m := by ring _ ≤ (1 - t) * θs.1.q l z.1 + t * θstar.q l z.1 := add_le_add (mul_le_mul_of_nonneg_left ha (sub_nonneg.mpr ht.2)) (mul_le_mul_of_nonneg_left hb ht.1) · intro t ht have hnorm := affinePathExtension_normalized_smooth θs hji t have hposp : ∀ l v, v ∈ latentCube n → 0 < (affinePathExtension s θs hji t).p l v := by intro l v hv exact (half_pos hm).trans (ht.1 l ⟨v, hv⟩) have hposq : ∀ l z, z ∈ Icc (0 : ℝ) 1 → 0 < (affinePathExtension s θs hji t).q l z := by intro l z hz exact (half_pos hm).trans (ht.2 l ⟨z, hz⟩) refine ⟨⟨hposp, hposq, hnorm.1, hnorm.2.1, hnorm.2.2.1, hnorm.2.2.2⟩, ?_⟩ intro v hv change m / 2 ≤ |(1 - t) * θs.1.p i v + t * (embeddedSparseWitness s hji).p i v| rw [abs_of_pos ((half_pos hm).trans (ht.1 i ⟨v, hv⟩))] exact (ht.1 i ⟨v, hv⟩).le
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathExtension_open_positive_uniformDenominator · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:624
theorem affinePathContrastIntegral_eq_extendedIntegral

The ambient continuous extensions used by the generic analytic theorem give exactly the paper's rational integral, because the integration measure is restricted to the latent cube. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
theta :
j i :
Fin n
hji :
G.edge j i
t :
Proof (Lean source)
lemma affinePathContrastIntegral_eq_extendedIntegral {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (theta : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) (t : ℝ) : affinePathContrastIntegral s theta hji t = ∫ v in latentCube n, polynomialNumerator (n + 3) (affinePathNumeratorCoefficientExtension s theta hji) t v / affineDenominator (affinePathDenominatorStartExtension theta i) (affinePathDenominatorEndExtension s hji) t v := by have hK : MeasurableSet (latentCube n) := by rw [latentCube] exact MeasurableSet.univ_pi fun _ ↦ measurableSet_Icc unfold affinePathContrastIntegral apply integral_congr_ae filter_upwards [ae_restrict_mem hK] with v hv rw [affinePathNumerator_extension_polynomialNumerator_eq theta hji t hv, affinePathNumeratorPolynomial_eval theta hji t v] unfold affineDenominator rw [ affinePathDenominatorStartExtension_eq theta i hv, affinePathDenominatorEndExtension_eq hji hv] simp [affinePathExtension]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathContrastIntegral_eq_extendedIntegral · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:711
theorem affinePathContrastIntegral_analyticOnNhd

The affine-path rational integral is analytic on the common positive enlargement. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
theta :
j i :
Fin n
hji :
G.edge j i
∃ O : Set ℝ,
Icc (0 : ℝ) 1 ⊆ O
Convex ℝ O
conclusion 1
t ∈ O :
conclusion 2
Proof (Lean source)
lemma affinePathContrastIntegral_analyticOnNhd {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (theta : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) : ∃ O : Set ℝ, IsOpen O ∧ Icc (0 : ℝ) 1 ⊆ O ∧ Convex ℝ O ∧ (∀ t ∈ O, PositiveNormalizedSmoothMechanisms G (affinePathExtension s theta hji t)) ∧ AnalyticOnNhd ℝ (affinePathContrastIntegral s theta hji) O := by rcases affinePathExtension_open_positive_uniformDenominator theta hji with ⟨O, epsilon, hepsilon, hO, hIcc, hconvex, hpositive⟩ rcases affinePathNumeratorCoefficientExtension_compact_bounds theta hji with ⟨C, hC⟩ have hK : MeasurableSet (latentCube n) := by rw [latentCube] exact MeasurableSet.univ_pi fun _ ↦ measurableSet_Icc have hmu : volume (latentCube n) ≠ ⊤ := by exact (show IsCompact (latentCube n) by rw [latentCube] exact isCompact_univ_pi fun _ ↦ isCompact_Icc).measure_lt_top.ne have hden' : ∀ t ∈ O, ∀ v ∈ latentCube n, epsilon ≤ |affineDenominator (affinePathDenominatorStartExtension theta i) (affinePathDenominatorEndExtension s hji) t v| := by intro t ht v hv unfold affineDenominator rw [affinePathDenominatorStartExtension_eq theta i hv, affinePathDenominatorEndExtension_eq hji hv] exact (hpositive t ht).2 v hv have han := analyticOnNhd_setIntegral_polynomial_div_affine_of_uniform_nonzero volume hK hmu (n + 3) (affinePathNumeratorCoefficientExtension s theta hji) (affinePathDenominatorStartExtension theta i) (affinePathDenominatorEndExtension s hji) O epsilon C hO hepsilon (affinePathNumeratorCoefficientExtension_measurable theta hji) (affinePathDenominatorStartExtension_continuous theta i).measurable (affinePathDenominatorEndExtension_continuous hji).measurable hC hden' refine ⟨O, hO, hIcc, hconvex, fun t ht ↦ (hpositive t ht).1, ?_⟩ simpa only [← affinePathContrastIntegral_eq_extendedIntegral theta hji] using han
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathContrastIntegral_analyticOnNhd · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:737
theorem ownLogRatioDerivative_eq_fderivWithin

The paper's scalar own-coordinate log-ratio derivative is the difference of the intervention logarithmic derivative and the full-cube observational Fréchet derivative in the own-coordinate direction. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
i :
Fin n
v :
hv :
v ∈ latentCube n
= fderivWithin ℝ (θ.q i) (Icc (0 : ℝ) 1) (v i) 1 / θ.q i (v i)
- fderivWithin ℝ (θ.p i) (latentCube n) v (single i 1) / θ.p i v
Proof (Lean source)
lemma ownLogRatioDerivative_eq_fderivWithin {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (hθ : PositiveNormalizedSmoothMechanisms G θ) (i : Fin n) (v : LatentState n) (hv : v ∈ latentCube n) : ownLogRatioDerivative θ i v = fderivWithin ℝ (θ.q i) (Icc (0 : ℝ) 1) (v i) 1 / θ.q i (v i) - fderivWithin ℝ (θ.p i) (latentCube n) v (single i 1) / θ.p i v := by have hvi : v i ∈ Icc (0 : ℝ) 1 := hv i (Set.mem_univ i) have hpsection : DifferentiableOn ℝ (fun z ↦ θ.p i (update v i z)) (Icc (0 : ℝ) 1) := by intro z hz apply ((hθ.2.2.1 i).differentiableOn (by norm_num) (update v i z) (by intro k _ by_cases hki : k = i · subst k simpa using hz · simpa [update, hki] using hv k (Set.mem_univ k))).comp z (hasDerivAt_update v i z).differentiableAt.differentiableWithinAt intro y hy k _ by_cases hki : k = i · subst k simpa using hy · simpa [update, hki] using hv k (Set.mem_univ k) unfold ownLogRatioDerivative change derivWithin (logRatio (θ.q i) (fun z ↦ θ.p i (update v i z))) (Icc (0 : ℝ) 1) (v i) = _ rw [derivWithin_logRatio (by norm_num) ((hθ.2.2.2.1 i).differentiableOn (by norm_num)) hpsection (hθ.2.1 i) (fun z hz ↦ hθ.1 i (update v i z) (by intro k by_cases hki : k = i · subst k simpa using hz · simpa [update, hki] using hv k (Set.mem_univ k))) hvi] rw [derivWithin_coordinateSection_eq_fderivWithin_apply ((hθ.2.2.1 i).differentiableOn (by norm_num)) hv i hvi] simp [derivWithin]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.ownLogRatioDerivative_eq_fderivWithin · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:777
theorem affinePathContrast_zero

At the initial endpoint, the affine-path contrast is the original mechanism's contrast. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
θ :
j i :
Fin n
hji :
G.edge j i
Proof (Lean source)
lemma affinePathContrast_zero {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θ : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) : affinePathContrast s θ hji 0 = secondMomentContrast (canonicalObservedWorld G θ.1 (refl (Fin n))) j i := by unfold affinePathContrast rw [affinePathExtension_zero]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathContrast_zero · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:820
theorem affinePathContrast_one

At the terminal endpoint, the affine-path contrast is the embedded sparse contrast. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
θ :
j i :
Fin n
hji :
G.edge j i
Proof (Lean source)
lemma affinePathContrast_one {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θ : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) : affinePathContrast s θ hji 1 = secondMomentContrast (canonicalObservedWorld G (embeddedSparseWitness s hji) (refl (Fin n))) j i := by unfold affinePathContrast rw [affinePathExtension_one]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathContrast_one · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:831
theorem canonical_secondMomentContrast_eq_integral

For a positive normalized mechanism and distinct intervention and ratio targets, the canonical second-moment contrast equals the rational mechanism integral obtained by cancelling the observational child-density factor. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
j i :
Fin n
hji :
j ≠ i
= ∫ v in latentCube n, (θ.q i (v i)) ^ 2 * (θ.q j (v j) - θ.p j v) * (∏ l ∈ (Finset.univ.erase i).erase j, θ.p l v) / θ.p i v
Proof (Lean source)
lemma canonical_secondMomentContrast_eq_integral {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (hpos : PositiveNormalizedSmoothMechanisms G θ) {j i : Fin n} (hji : j ≠ i) : secondMomentContrast (canonicalObservedWorld G θ (refl (Fin n))) j i = ∫ v in latentCube n, (θ.q i (v i)) ^ 2 * (θ.q j (v j) - θ.p j v) * (∏ l ∈ (Finset.univ.erase i).erase j, θ.p l v) / θ.p i v := by let μ : Measure (LatentState n) := volume.restrict (latentCube n) let r : LatentState n → ℝ := fun v => θ.q i (v i) / θ.p i v have hcube : MeasurableSet (latentCube n) := by rw [latentCube] exact MeasurableSet.univ_pi fun _ => measurableSet_Icc have hcubeCompact : IsCompact (latentCube n) := by rw [latentCube] exact isCompact_univ_pi fun _ => isCompact_Icc have hpcont (l : Fin n) : ContinuousOn (θ.p l) (latentCube n) := (hpos.2.2.1 l).continuousOn have hqcont (l : Fin n) : ContinuousOn (fun v : LatentState n => θ.q l (v l)) (latentCube n) := (hpos.2.2.2.1 l).continuousOn.comp ((continuous_apply l).continuousOn) (fun v hv => hv l (Set.mem_univ l)) have hrcont : ContinuousOn r (latentCube n) := by exact (hqcont i).div (hpcont i) fun v hv => ne_of_gt (hpos.1 i v hv) have hobscont : ContinuousOn (observationalDensity θ) (latentCube n) := by unfold observationalDensity exact continuousOn_finsetProd _ fun l _ => hpcont l have hintcont : ContinuousOn (interventionalDensity θ j) (latentCube n) := by unfold interventionalDensity exact (hqcont j).mul (continuousOn_finsetProd _ fun l _ => hpcont l) have hobsint : Integrable (fun v => observationalDensity θ v * r v ^ 2) μ := by exact (hobscont.mul (hrcont.pow 2)).integrableOn_compact hcubeCompact have hintint : Integrable (fun v => interventionalDensity θ j v * r v ^ 2) μ := by exact (hintcont.mul (hrcont.pow 2)).integrableOn_compact hcubeCompact have hobs : (∫ v, r v ^ 2 ∂observationalLaw θ) = ∫ v, observationalDensity θ v * r v ^ 2 ∂μ := by unfold observationalLaw rw [integral_withDensity_eq_integral_toReal_smul₀] · apply integral_congr_ae filter_upwards [ae_restrict_mem hcube] with v hv rw [ENNReal.toReal_ofReal (le_of_lt (by unfold observationalDensity exact Finset.prod_pos fun l _ => hpos.1 l v hv))] rfl · exact (hobscont.aestronglyMeasurable hcube).aemeasurable.ennreal_ofReal · filter_upwards with v exact ENNReal.ofReal_lt_top have hint : (∫ v, r v ^ 2 ∂interventionalLaw θ j) = ∫ v, interventionalDensity θ j v * r v ^ 2 ∂μ := by unfold interventionalLaw rw [integral_withDensity_eq_integral_toReal_smul₀] · apply integral_congr_ae filter_upwards [ae_restrict_mem hcube] with v hv rw [ENNReal.toReal_ofReal (le_of_lt (by unfold interventionalDensity exact mul_pos (hpos.2.1 j (v j) (hv j (Set.mem_univ j))) (Finset.prod_pos fun l _ => hpos.1 l v hv)))] rfl · exact (hintcont.aestronglyMeasurable hcube).aemeasurable.ennreal_ofReal · filter_upwards with v exact ENNReal.ofReal_lt_top unfold secondMomentContrast change (∫ v, r v ^ 2 ∂interventionalLaw θ j) - (∫ v, r v ^ 2 ∂observationalLaw θ) = _ rw [hint, hobs, ← integral_sub hintint hobsint] apply integral_congr_ae filter_upwards [ae_restrict_mem hcube] with v hv have hpi : θ.p i v ≠ 0 := ne_of_gt (hpos.1 i v hv) have hinterDensity : interventionalDensity θ j v = θ.q j (v j) * θ.p i v * (∏ l ∈ (Finset.univ.erase i).erase j, θ.p l v) := by unfold interventionalDensity have hprod : (∏ l ∈ Finset.univ.erase j, θ.p l v) = θ.p i v * (∏ l ∈ (Finset.univ.erase j).erase i, θ.p l v) := by rw [Finset.prod_eq_mul_prod_sdiff_singleton_of_mem (Finset.mem_erase.mpr ⟨Ne.symm hji, Finset.mem_univ i⟩)] simp only [Finset.sdiff_singleton_eq_erase] rw [hprod, Finset.erase_right_comm] ring have hobsDensity : observationalDensity θ v = θ.p i v * θ.p j v * (∏ l ∈ (Finset.univ.erase i).erase j, θ.p l v) := by unfold observationalDensity rw [Finset.prod_eq_mul_prod_sdiff_singleton_of_mem (Finset.mem_univ i)] simp only [Finset.sdiff_singleton_eq_erase] rw [Finset.prod_eq_mul_prod_sdiff_singleton_of_mem (Finset.mem_erase.mpr ⟨hji, Finset.mem_univ j⟩)] simp only [Finset.sdiff_singleton_eq_erase] ring unfold r rw [hinterDensity, hobsDensity] field_simp
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.canonical_secondMomentContrast_eq_integral · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:843
theorem affinePathContrast_eq_integral_of_mem_Icc

On the closed affine path, the contrast is exactly its rational mechanism integral. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
θs :
j i :
Fin n
hji :
G.edge j i
t :
ht :
t ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma affinePathContrast_eq_integral_of_mem_Icc {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θs : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) {t : ℝ} (ht : t ∈ Icc (0 : ℝ) 1) : affinePathContrast s θs hji t = affinePathContrastIntegral s θs hji t := by have hne : j ≠ i := by intro h subst j exact G.irrefl i hji unfold affinePathContrast affinePathContrastIntegral exact canonical_secondMomentContrast_eq_integral (affinePathExtension_positive_normalized_smooth θs hji ht) hne
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathContrast_eq_integral_of_mem_Icc · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:940
theorem analyticOnNhd_isolated_zeros_of_nonzero Lemma analyticOnNhd_isolated_zeros_of_nonzero in the paper ↗

A real analytic function on a preconnected set that is nonzero somewhere has an isolated zero at every point of the set. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
f :
ℝ → ℝ
O :
Set
hf :
z t :
hz :
z ∈ O
hfz :
f z ≠ 0
ht :
t ∈ O
hft :
f t = 0
∃ ε > 0, ∀ u ∈ Ioo (t - ε) (t + ε), u ≠ t → f u ≠ 0
Proof (Lean source)
lemma analyticOnNhd_isolated_zeros_of_nonzero {f : ℝ → ℝ} {O : Set ℝ} (hf : AnalyticOnNhd ℝ f O) (hO : IsPreconnected O) {z t : ℝ} (hz : z ∈ O) (hfz : f z ≠ 0) (ht : t ∈ O) (hft : f t = 0) : ∃ ε > 0, ∀ u ∈ Ioo (t - ε) (t + ε), u ≠ t → f u ≠ 0 := by rcases (hf t ht).eventually_eq_zero_or_eventually_ne_zero with hzero | hne · exact (hfz (hf.eqOn_zero_of_preconnected_of_eventuallyEq_zero hO ht hzero hz)).elim · change {u | f u ≠ 0} ∈ nhdsWithin t {t}ᶜ at hne rw [Metric.mem_nhdsWithin_iff] at hne rcases hne with ⟨ε, hε, hball⟩ refine ⟨ε, hε, fun u hu hut => hball ?_⟩ refine ⟨?_, ?_⟩ · simp only [Metric.mem_ball, Real.dist_eq] rw [abs_lt] constructor <;> linarith [hu.1, hu.2] · simpa only [Set.mem_compl_iff, Set.mem_singleton_iff]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.analyticOnNhd_isolated_zeros_of_nonzero · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:955
theorem threeNode_affinePathContrast_one_ne_zero

On the explicit three-node edge, the affine path ends at the quantitatively separated sparse witness. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
s :
hji :
threeNodeDAG.edge (0 : Fin 3) 1
affinePathContrast s θs hji 1 ≠ 0
Proof (Lean source)
lemma threeNode_affinePathContrast_one_ne_zero (s : SignVector 3) (θs : StratumPoint threeNodeDAG s) (hji : threeNodeDAG.edge (0 : Fin 3) 1) : affinePathContrast s θs hji 1 ≠ 0 := by rw [affinePathContrast_one] have heq : embeddedSparseWitness s hji = sparseWitness s := by rfl rw [heq] have hgap := (sparse_witness_certificate s).2.2.2.2.2.2.2.2.2.2.1 have hc : secondMomentContrast (canonicalObservedWorld threeNodeDAG (sparseWitness s) (refl (Fin 3))) 0 1 < -(3 / 10000 : ℝ) := by unfold secondMomentContrast linarith exact ne_of_lt (lt_of_lt_of_le hc (by norm_num))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.threeNode_affinePathContrast_one_ne_zero · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:974
theorem affinePathContrast_one_ne_zero

Every edge-specific affine path ends at a sparse mechanism with nonzero contrast. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
θs :
j i :
Fin n
hji :
G.edge j i
affinePathContrast s θs hji 1 ≠ 0
Proof (Lean source)
lemma affinePathContrast_one_ne_zero {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θs : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) : affinePathContrast s θs hji 1 ≠ 0 := by have hne : j ≠ i := by intro h subst j exact G.irrefl i hji rw [affinePathContrast_one] rw [canonical_secondMomentContrast_eq_integral (embeddedSparseWitness_positive_normalized_smooth s hji) hne] let μ : Measure ℝ := volume.restrict (Icc (0 : ℝ) 1) let f : LatentState n → ℝ := fun v => ((embeddedSparseWitness s hji).q i (v i)) ^ 2 * ((embeddedSparseWitness s hji).q j (v j) - (embeddedSparseWitness s hji).p j v) * (∏ l ∈ (Finset.univ.erase i).erase j, (embeddedSparseWitness s hji).p l v) / (embeddedSparseWitness s hji).p i v have hpos := embeddedSparseWitness_positive_normalized_smooth s hji have hfcont : ContinuousOn f (latentCube n) := by apply ContinuousOn.div · apply ContinuousOn.mul · apply ContinuousOn.mul · exact ((hpos.2.2.2.1 i).continuousOn.comp ((continuous_apply i).continuousOn) (fun (v : LatentState n) (hv : v ∈ latentCube n) => hv i (Set.mem_univ i))).pow 2 · exact ((hpos.2.2.2.1 j).continuousOn.comp ((continuous_apply j).continuousOn) (fun (v : LatentState n) (hv : v ∈ latentCube n) => hv j (Set.mem_univ j))).sub (hpos.2.2.1 j).continuousOn · exact continuousOn_finsetProd _ fun l _ => (hpos.2.2.1 l).continuousOn · exact (hpos.2.2.1 i).continuousOn · intro v hv exact ne_of_gt (hpos.1 i v hv) have hf : Integrable f (volume.restrict (latentCube n)) := hfcont.integrableOn_compact (by rw [latentCube] exact isCompact_univ_pi fun _ => isCompact_Icc) have hμ : volume.restrict (latentCube n) = Measure.pi (fun _ : Fin n => μ) := by change volume.restrict (Set.univ.pi fun _ : Fin n => Icc (0 : ℝ) 1) = _ rw [MeasureTheory.volume_pi, Measure.restrict_pi_pi] change (∫ v in latentCube n, f v) ≠ 0 rw [hμ] letI : IsProbabilityMeasure μ := ⟨by simp [μ, Real.volume_Icc]⟩ let S : Finset (Fin n) := {j, i} let jj : {l : Fin n // l ∈ S} := ⟨j, by simp [S]⟩ let ii : {l : Fin n // l ∈ S} := ⟨i, by simp [S]⟩ let g : ({l : Fin n // l ∈ S} → ℝ) → ℝ := fun z => exponentialInterventionDensity (reflectedCoordinate s i (z ii)) ^ 2 * (exponentialInterventionDensity (reflectedCoordinate s j (z jj)) - 1) / (1 + (1 / 10 : ℝ) * centeredCoordinate (reflectedCoordinate s j (z jj)) * centeredCoordinate (reflectedCoordinate s i (z ii))) have hfg : f = fun v => g (fun l : {l : Fin n // l ∈ S} => v l.1) := by funext v simp only [f, g, ii, jj, embeddedSparseWitness, embeddedSparseP] simp [hne] rw [hfg, integral_comp_pi_restrict_finset μ S g] let e : Fin 2 ≃ {l : Fin n // l ∈ S} := pairFinEquiv hne have he := measurePreserving_piCongrLeft (fun _ : {l : Fin n // l ∈ S} => μ) e rw [← he.integral_comp'] have hgint : Integrable (g ∘ MeasurableEquiv.piCongrLeft (fun _ : {l : Fin n // l ∈ S} => ℝ) e) (Measure.pi fun _ : Fin 2 => μ) := by apply (he.integrable_comp_emb (MeasurableEquiv.piCongrLeft (fun _ : {l : Fin n // l ∈ S} => ℝ) e).measurableEmbedding).2 have hp := Causalean.Stat.measurePreserving_pi_restrict_finset μ S have hgmeas : Measurable g := by rcases s.signed i with hi | hi <;> rcases s.signed j with hj | hj <;> simp [g, exponentialInterventionDensity, reflectedCoordinate, reflect, centeredCoordinate, hi, hj, show (-1 : ℝ) ≠ 1 by norm_num] <;> fun_prop apply (hp.integrable_comp hgmeas.aestronglyMeasurable).1 rw [show g ∘ (fun (v : Fin n → ℝ) (l : {l : Fin n // l ∈ S}) => v l.1) = f by simpa only [Function.comp_def] using hfg.symm] simpa only [← hμ] using hf change (∫ v : Fin 2 → ℝ, (g ∘ MeasurableEquiv.piCongrLeft (fun _ : {l : Fin n // l ∈ S} => ℝ) e) v ∂Measure.pi fun _ : Fin 2 => μ) ≠ 0 rw [integral_fin_two_pi_eq_iterated μ _ hgint] have hj_eval (z : Fin 2 → ℝ) : (MeasurableEquiv.piCongrLeft (fun _ : {l : Fin n // l ∈ S} => ℝ) e z) jj = z 0 := by have hjj : jj = e 0 := by apply Subtype.ext simp [e, pairFinEquiv, jj, S] rw [hjj, MeasurableEquiv.piCongrLeft_apply_apply] have hi_eval (z : Fin 2 → ℝ) : (MeasurableEquiv.piCongrLeft (fun _ : {l : Fin n // l ∈ S} => ℝ) e z) ii = z 1 := by have hii : ii = e 1 := by apply Subtype.ext simp [e, pairFinEquiv, ii, S] rw [hii, MeasurableEquiv.piCongrLeft_apply_apply] simp_rw [Function.comp_apply, g, hj_eval, hi_eval, Matrix.cons_val_zero, Matrix.cons_val_one] simp only [Matrix.cons_val_zero] have hrefY (x : ℝ) : (∫ y in Icc (0 : ℝ) 1, exponentialInterventionDensity (reflectedCoordinate s i y) ^ 2 * (exponentialInterventionDensity (reflectedCoordinate s j x) - 1) / (1 + (10 : ℝ)⁻¹ * centeredCoordinate (reflectedCoordinate s j x) * centeredCoordinate (reflectedCoordinate s i y))) = (exponentialInterventionDensity (reflectedCoordinate s j x) - 1) * sparseA (reflectedCoordinate s j x) := by change (∫ y in Icc (0 : ℝ) 1, (fun y => exponentialInterventionDensity y ^ 2 * (exponentialInterventionDensity (reflectedCoordinate s j x) - 1) / (1 + (10 : ℝ)⁻¹ * centeredCoordinate (reflectedCoordinate s j x) * centeredCoordinate y)) (reflectedCoordinate s i y)) = _ have href := integral_reflectedCoordinate s i (fun y => exponentialInterventionDensity y ^ 2 * (exponentialInterventionDensity (reflectedCoordinate s j x) - 1) / (1 + (10 : ℝ)⁻¹ * centeredCoordinate (reflectedCoordinate s j x) * centeredCoordinate y)) rw [href] unfold sparseA rw [show (fun y : ℝ => exponentialInterventionDensity y ^ 2 * (exponentialInterventionDensity (reflectedCoordinate s j x) - 1) / (1 + (10 : ℝ)⁻¹ * centeredCoordinate (reflectedCoordinate s j x) * centeredCoordinate y)) = fun y => (exponentialInterventionDensity (reflectedCoordinate s j x) - 1) * (exponentialInterventionDensity y ^ 2 / (1 + centeredCoordinate (reflectedCoordinate s j x) / 10 * centeredCoordinate y)) by funext y; ring, MeasureTheory.integral_const_mul] dsimp only [μ] simp only [one_div] simp_rw [hrefY] change (∫ x in Icc (0 : ℝ) 1, (fun x => (exponentialInterventionDensity x - 1) * sparseA x) (reflectedCoordinate s j x)) ≠ 0 rw [show (∫ x in Icc (0 : ℝ) 1, (fun x => (exponentialInterventionDensity x - 1) * sparseA x) (reflectedCoordinate s j x)) = ∫ x in Icc (0 : ℝ) 1, (exponentialInterventionDensity x - 1) * sparseA x by simpa only using integral_reflectedCoordinate s j (fun x => (exponentialInterventionDensity x - 1) * sparseA x)] have hgap := sparse_unreflected_moment_gap intro hzero have hneg : (∫ x in Icc (0 : ℝ) 1, (1 - exponentialInterventionDensity x) * sparseA x) = 0 := by rw [show (fun x : ℝ => (1 - exponentialInterventionDensity x) * sparseA x) = fun x => -((exponentialInterventionDensity x - 1) * sparseA x) by funext x ring, MeasureTheory.integral_neg, hzero, neg_zero] linarith
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathContrast_one_ne_zero · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:993
theorem affinePathExtension_eventually_causalMinimal

Causal minimality persists for sufficiently small positive parameters along the affine path. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
θs :
j i :
Fin n
hji :
G.edge j i
∃ δ > 0,
∀ t : {t : ℝ // t ∈ Icc (0 : ℝ) 1},
t.1 < δ → CausalMinimality G (affinePathExtension s θs hji t.1)
Proof (Lean source)
lemma affinePathExtension_eventually_causalMinimal {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θs : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) : ∃ δ > 0, ∀ t : {t : ℝ // t ∈ Icc (0 : ℝ) 1}, t.1 < δ → CausalMinimality G (affinePathExtension s θs hji t.1) := by rcases mechanismCompact_all_edge_witnesses_open θs with ⟨ε, hε, hopen⟩ rcases affinePathExtension_p_eventually_uniform_close θs hji hε with ⟨δ, hδ, hclose⟩ refine ⟨δ, hδ, ?_⟩ intro t htδ a b hab let η := affinePathExtension s θs hji t.1 have hη : PositiveNormalizedSmoothMechanisms G η := affinePathExtension_positive_normalized_smooth θs hji t.2 have htAbs : |t.1| < δ := by simpa only [abs_of_nonneg t.2.1] using htδ have hfactor : (mechanismCompactPositiveFactorization θs.property.positiveSmooth).FactorSupClose (mechanismCompactPositiveFactorization hη) ε := mechanismCompact_factorSupClose_of_p_close θs.property.positiveSmooth hη (hclose t.1 htAbs) have hnotCompact := hopen (mechanismCompactPositiveFactorization hη) hfactor b a hab intro hpaper apply hnotCompact exact (condIndepCoordinates_iff_compactPositiveFactorization_mechanism η (mechanismCompactPositiveFactorization hη) (mechanismCompactPositiveFactorization_observationalMeasure hη) b a ((G.parents b).erase a)).mp hpaper
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathExtension_eventually_causalMinimal · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:1147
theorem affinePathExtension_eventually_fixedOwnDerivativeSign

The prescribed own-coordinate derivative signs persist uniformly for small affine-path parameters. Compactness is used only in the latent-state variable; finiteness then combines the nodewise neighborhoods. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
θs :
j i :
Fin n
hji :
G.edge j i
∃ δ > 0,
∀ t : {t : ℝ // t ∈ Icc (0 : ℝ) 1},
t.1 < δ → FixedOwnDerivativeSign G s (affinePathExtension s θs hji t.1)
Proof (Lean source)
lemma affinePathExtension_eventually_fixedOwnDerivativeSign {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θs : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) : ∃ δ > 0, ∀ t : {t : ℝ // t ∈ Icc (0 : ℝ) 1}, t.1 < δ → FixedOwnDerivativeSign G s (affinePathExtension s θs hji t.1) := by let θstar := embeddedSparseWitness s hji let Cube := {v : LatentState n // v ∈ latentCube n} letI : CompactSpace Cube := isCompact_iff_compactSpace.mp (by rw [latentCube] exact isCompact_univ_pi fun _ ↦ isCompact_Icc) let score (l : Fin n) (t : ℝ) (v : Cube) : ℝ := s.value l * (((1 - t) * fderivWithin ℝ (θs.1.q l) (Icc (0 : ℝ) 1) (v.1 l) 1 + t * fderivWithin ℝ (θstar.q l) (Icc (0 : ℝ) 1) (v.1 l) 1) / ((1 - t) * θs.1.q l (v.1 l) + t * θstar.q l (v.1 l)) - ((1 - t) * fderivWithin ℝ (θs.1.p l) (latentCube n) v.1 (single l 1) + t * fderivWithin ℝ (θstar.p l) (latentCube n) v.1 (single l 1)) / ((1 - t) * θs.1.p l v.1 + t * θstar.p l v.1)) have hnode : ∀ l : Fin n, ∀ᶠ t in 𝓝 (0 : ℝ), ∀ v : Cube, 0 < score l t v := by intro l have huCube : UniqueDiffOn ℝ (latentCube n) := by rw [latentCube] exact UniqueDiffOn.univ_pi fun _ ↦ uniqueDiffOn_Icc (by norm_num) have huIcc : UniqueDiffOn ℝ (Icc (0 : ℝ) 1) := uniqueDiffOn_Icc (by norm_num) have hcoord : Continuous (fun v : Cube ↦ v.1 l) := (continuous_apply l).comp continuous_subtype_val have hcoordMaps : Set.MapsTo (fun v : Cube ↦ v.1 l) Set.univ (Icc (0 : ℝ) 1) := fun v _ ↦ v.2 l (Set.mem_univ l) have hqθd : Continuous (fun v : Cube ↦ fderivWithin ℝ (θs.1.q l) (Icc (0 : ℝ) 1) (v.1 l)) := ((θs.property.positiveSmooth.2.2.2.1 l).continuousOn_fderivWithin huIcc (by norm_num)).comp_continuous hcoord (fun v ↦ hcoordMaps (Set.mem_univ v)) have hstarSmooth := embeddedSparseWitness_positive_normalized_smooth s hji have hqstard : Continuous (fun v : Cube ↦ fderivWithin ℝ (θstar.q l) (Icc (0 : ℝ) 1) (v.1 l)) := (hstarSmooth.2.2.2.1 l).continuousOn_fderivWithin huIcc (by norm_num) |>.comp_continuous hcoord (fun v ↦ hcoordMaps (Set.mem_univ v)) have hpθd : Continuous (fun v : Cube ↦ fderivWithin ℝ (θs.1.p l) (latentCube n) v.1) := ((θs.property.positiveSmooth.2.2.1 l).continuousOn_fderivWithin huCube (by norm_num)).comp_continuous continuous_subtype_val (fun v ↦ v.2) have hpstard : Continuous (fun v : Cube ↦ fderivWithin ℝ (θstar.p l) (latentCube n) v.1) := (hstarSmooth.2.2.1 l).continuousOn_fderivWithin huCube (by norm_num) |>.comp_continuous continuous_subtype_val (fun v ↦ v.2) have hqθ : Continuous (fun v : Cube ↦ θs.1.q l (v.1 l)) := ((θs.property.positiveSmooth.2.2.2.1 l).continuousOn.comp_continuous hcoord (fun v ↦ hcoordMaps (Set.mem_univ v))) have hqstar : Continuous (fun v : Cube ↦ θstar.q l (v.1 l)) := (hstarSmooth.2.2.2.1 l).continuousOn.comp_continuous hcoord (fun v ↦ hcoordMaps (Set.mem_univ v)) have hpθ : Continuous (fun v : Cube ↦ θs.1.p l v.1) := ((θs.property.positiveSmooth.2.2.1 l).continuousOn.comp_continuous continuous_subtype_val (fun v ↦ v.2)) have hpstar : Continuous (fun v : Cube ↦ θstar.p l v.1) := (hstarSmooth.2.2.1 l).continuousOn.comp_continuous continuous_subtype_val (fun v ↦ v.2) have hqθd1 : Continuous (fun v : Cube ↦ fderivWithin ℝ (θs.1.q l) (Icc (0 : ℝ) 1) (v.1 l) 1) := by fun_prop have hqstard1 : Continuous (fun v : Cube ↦ fderivWithin ℝ (θstar.q l) (Icc (0 : ℝ) 1) (v.1 l) 1) := by fun_prop have hpθd1 : Continuous (fun v : Cube ↦ fderivWithin ℝ (θs.1.p l) (latentCube n) v.1 (single l 1)) := by fun_prop have hpstard1 : Continuous (fun v : Cube ↦ fderivWithin ℝ (θstar.p l) (latentCube n) v.1 (single l 1)) := by fun_prop have hnumq : Continuous (fun z : ℝ × Cube ↦ (1 - z.1) * fderivWithin ℝ (θs.1.q l) (Icc (0 : ℝ) 1) (z.2.1 l) 1 + z.1 * fderivWithin ℝ (θstar.q l) (Icc (0 : ℝ) 1) (z.2.1 l) 1) := by exact ((continuous_const.sub continuous_fst).mul (hqθd1.comp continuous_snd)).add (continuous_fst.mul (hqstard1.comp continuous_snd)) have hdenq : Continuous (fun z : ℝ × Cube ↦ (1 - z.1) * θs.1.q l (z.2.1 l) + z.1 * θstar.q l (z.2.1 l)) := by exact ((continuous_const.sub continuous_fst).mul (hqθ.comp continuous_snd)).add (continuous_fst.mul (hqstar.comp continuous_snd)) have hnump : Continuous (fun z : ℝ × Cube ↦ (1 - z.1) * fderivWithin ℝ (θs.1.p l) (latentCube n) z.2.1 (single l 1) + z.1 * fderivWithin ℝ (θstar.p l) (latentCube n) z.2.1 (single l 1)) := by exact ((continuous_const.sub continuous_fst).mul (hpθd1.comp continuous_snd)).add (continuous_fst.mul (hpstard1.comp continuous_snd)) have hdenp : Continuous (fun z : ℝ × Cube ↦ (1 - z.1) * θs.1.p l z.2.1 + z.1 * θstar.p l z.2.1) := by exact ((continuous_const.sub continuous_fst).mul (hpθ.comp continuous_snd)).add (continuous_fst.mul (hpstar.comp continuous_snd)) have hcont : ∀ v : Cube, ContinuousAt (fun z : ℝ × Cube ↦ score l z.1 z.2) (0, v) := by intro v dsimp [score, θstar] apply ContinuousAt.mul continuousAt_const apply ContinuousAt.sub · apply ContinuousAt.div · exact hnumq.continuousAt · exact hdenq.continuousAt · simpa using (θs.property.positiveSmooth.2.1 l (v.1 l) (v.2 l (Set.mem_univ l))).ne' · apply ContinuousAt.div · exact hnump.continuousAt · exact hdenp.continuousAt · simpa using (θs.property.positiveSmooth.1 l v.1 v.2).ne' simpa only [Set.mem_univ, forall_const] using (isCompact_univ.eventually_forall_of_forall_eventually (x₀ := (0 : ℝ)) (P := fun t v ↦ 0 < score l t v) (by intro v _ have hformula := ownLogRatioDerivative_eq_fderivWithin θs.property.positiveSmooth l v.1 v.2 have hpos := θs.property.fixedSign l v.1 v.2 apply (hcont v).tendsto exact Ioi_mem_nhds (by simpa [score, θstar, hformula] using hpos))) have hall : ∀ᶠ t in 𝓝 (0 : ℝ), ∀ l : Fin n, ∀ v : Cube, 0 < score l t v := by simpa only [Set.mem_univ, forall_const] using ((Filter.eventually_all_finite (Set.toFinite (Set.univ : Set (Fin n)))).2 (fun l _ ↦ hnode l)) rcases Metric.eventually_nhds_iff.mp hall with ⟨δ, hδ, hδall⟩ refine ⟨δ, hδ, ?_⟩ intro t htδ l v hv have hscore : 0 < score l t.1 ⟨v, hv⟩ := hδall (by simpa [Real.dist_eq, abs_of_nonneg t.2.1] using htδ) l ⟨v, hv⟩ have hη := affinePathExtension_positive_normalized_smooth θs hji t.2 rw [ownLogRatioDerivative_eq_fderivWithin hη l v hv] have huCube : UniqueDiffOn ℝ (latentCube n) := by rw [latentCube] exact UniqueDiffOn.univ_pi fun _ ↦ uniqueDiffOn_Icc (by norm_num) have huIcc : UniqueDiffOn ℝ (Icc (0 : ℝ) 1) := uniqueDiffOn_Icc (by norm_num) let hθq := θs.property.positiveSmooth.2.2.2.1 l let hstarq := (embeddedSparseWitness_positive_normalized_smooth s hji).2.2.2.1 l let hθp := θs.property.positiveSmooth.2.2.1 l let hstarp := (embeddedSparseWitness_positive_normalized_smooth s hji).2.2.1 l have hqfd : fderivWithin ℝ ((affinePathExtension s θs hji t.1).q l) (Icc (0 : ℝ) 1) (v l) = (1 - t.1) • fderivWithin ℝ (θs.1.q l) (Icc (0 : ℝ) 1) (v l) + t.1 • fderivWithin ℝ ((embeddedSparseWitness s hji).q l) (Icc (0 : ℝ) 1) (v l) := by change fderivWithin ℝ (fun z ↦ (1 - t.1) • θs.1.q l z + t.1 • (embeddedSparseWitness s hji).q l z) (Icc (0 : ℝ) 1) (v l) = _ rw [fderivWithin_fun_add (huIcc.uniqueDiffWithinAt (hv l (Set.mem_univ l))) (((hθq.const_smul (1 - t.1)) (v l) (hv l (Set.mem_univ l))).differentiableWithinAt (by norm_num)) (((hstarq.const_smul t.1) (v l) (hv l (Set.mem_univ l))).differentiableWithinAt (by norm_num)), fderivWithin_fun_const_smul (huIcc.uniqueDiffWithinAt (hv l (Set.mem_univ l))) ((hθq (v l) (hv l (Set.mem_univ l))).differentiableWithinAt (by norm_num)) (1 - t.1), fderivWithin_fun_const_smul (huIcc.uniqueDiffWithinAt (hv l (Set.mem_univ l))) ((hstarq (v l) (hv l (Set.mem_univ l))).differentiableWithinAt (by norm_num)) t.1] have hpfd : fderivWithin ℝ ((affinePathExtension s θs hji t.1).p l) (latentCube n) v = (1 - t.1) • fderivWithin ℝ (θs.1.p l) (latentCube n) v + t.1 • fderivWithin ℝ ((embeddedSparseWitness s hji).p l) (latentCube n) v := by change fderivWithin ℝ (fun w ↦ (1 - t.1) • θs.1.p l w + t.1 • (embeddedSparseWitness s hji).p l w) (latentCube n) v = _ rw [fderivWithin_fun_add (huCube.uniqueDiffWithinAt hv) (((hθp.const_smul (1 - t.1)) v hv).differentiableWithinAt (by norm_num)) (((hstarp.const_smul t.1) v hv).differentiableWithinAt (by norm_num)), fderivWithin_fun_const_smul (huCube.uniqueDiffWithinAt hv) ((hθp v hv).differentiableWithinAt (by norm_num)) (1 - t.1), fderivWithin_fun_const_smul (huCube.uniqueDiffWithinAt hv) ((hstarp v hv).differentiableWithinAt (by norm_num)) t.1] rw [hqfd, hpfd] simpa [score, θstar, affinePathExtension, smul_eq_mul] using hscore
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathExtension_eventually_fixedOwnDerivativeSign · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:1175
theorem affinePathExtension_eventually_modelStratum

All three paper-local stratum conditions hold simultaneously along a sufficiently short positive initial segment of the affine path. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
θs :
j i :
Fin n
hji :
G.edge j i
∃ δ > 0,
∀ t : {t : ℝ // t ∈ Icc (0 : ℝ) 1},
t.1 < δ → ModelStratum G s (affinePathExtension s θs hji t.1)
Proof (Lean source)
lemma affinePathExtension_eventually_modelStratum {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θs : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) : ∃ δ > 0, ∀ t : {t : ℝ // t ∈ Icc (0 : ℝ) 1}, t.1 < δ → ModelStratum G s (affinePathExtension s θs hji t.1) := by rcases affinePathExtension_eventually_causalMinimal θs hji with ⟨δmin, hδmin, hmin⟩ rcases affinePathExtension_eventually_fixedOwnDerivativeSign θs hji with ⟨δsign, hδsign, hsign⟩ refine ⟨min δmin δsign, lt_min hδmin hδsign, ?_⟩ intro t ht exact ⟨affinePathExtension_positive_normalized_smooth θs hji t.2, hmin t (ht.trans_le (min_le_left _ _)), hsign t (ht.trans_le (min_le_right _ _))⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathExtension_eventually_modelStratum · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:1349
theorem affinePath_exists_small_stratum_nonzero

Once the analytic package is available, isolated zeros, affine-path continuity, and local stratum preservation produce the arbitrarily small nonzero perturbation used by the headline. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
θs :
j i :
Fin n
hji :
G.edge j i
O :
Set
hO :
Icc (0 : ℝ) 1 ⊆ O
hanalytic :
hisolated :
∀ t ∈ O,
affinePathContrast s θs hji t
= 0 → ∃ ε > 0, ∀ u ∈ Ioo (t - ε) (t + ε), u ≠ t → affinePathContrast s θs hji u ≠ 0
N :
hN :
N ∈ 𝓝 θs.1
∃ t : {t : ℝ // t ∈ Ioo (0 : ℝ) 1},
conclusion 1
affinePath s θs hji ⟨t.1, ⟨le_of_lt t.2.1, le_of_lt t.2.2⟩⟩ ∈ N
conclusion 2
ModelStratum G s (affinePath s θs hji ⟨t.1, ⟨le_of_lt t.2.1, le_of_lt t.2.2⟩⟩)
conclusion 3
affinePathContrast s θs hji t.1 ≠ 0
Proof (Lean source)
lemma affinePath_exists_small_stratum_nonzero {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θs : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) {O : Set ℝ} (hO : Icc (0 : ℝ) 1 ⊆ O) (hanalytic : AnalyticOnNhd ℝ (affinePathContrast s θs hji) O) (hisolated : ∀ t ∈ O, affinePathContrast s θs hji t = 0 → ∃ ε > 0, ∀ u ∈ Ioo (t - ε) (t + ε), u ≠ t → affinePathContrast s θs hji u ≠ 0) (N : Set (Mechanism n G)) (hN : N ∈ 𝓝 θs.1) : ∃ t : {t : ℝ // t ∈ Ioo (0 : ℝ) 1}, affinePath s θs hji ⟨t.1, ⟨le_of_lt t.2.1, le_of_lt t.2.2⟩⟩ ∈ N ∧ ModelStratum G s (affinePath s θs hji ⟨t.1, ⟨le_of_lt t.2.1, le_of_lt t.2.2⟩⟩) ∧ affinePathContrast s θs hji t.1 ≠ 0 := by rcases affinePathExtension_eventually_modelStratum θs hji with ⟨δs, hδs, hs⟩ have heventN : ∀ᶠ t in 𝓝 (0 : ℝ), affinePathExtension s θs hji t ∈ N := (tendsto_affinePathExtension_zero θs hji) hN rcases Metric.eventually_nhds_iff.mp heventN with ⟨δN, hδN, hnearN⟩ have hzeroNhd : ∃ δ > 0, ∀ u, |u| < δ → u ≠ 0 → affinePathContrast s θs hji u ≠ 0 := by by_cases hz : affinePathContrast s θs hji 0 = 0 · rcases hisolated 0 (hO ⟨by norm_num, by norm_num⟩) hz with ⟨δ, hδ, hiso⟩ exact ⟨δ, hδ, fun u hu hu0 ↦ hiso u (by simpa [abs_lt] using hu) hu0⟩ · have hc := (hanalytic 0 (hO ⟨by norm_num, by norm_num⟩)).continuousAt have hev : ∀ᶠ u in 𝓝 (0 : ℝ), affinePathContrast s θs hji u ≠ 0 := hc (isOpen_compl_singleton.mem_nhds (by simpa using hz)) rcases Metric.eventually_nhds_iff.mp hev with ⟨δ, hδ, hδev⟩ exact ⟨δ, hδ, fun u hu _ ↦ hδev (by simpa [Real.dist_eq] using hu)⟩ rcases hzeroNhd with ⟨δz, hδz, hz⟩ let r := min 1 (min δs (min δN δz)) have hr : 0 < r := by dsimp [r] positivity let u : ℝ := r / 2 have hu0 : 0 < u := div_pos hr (by norm_num) have hu1 : u < 1 := by dsimp [u, r] have := min_le_left (1 : ℝ) (min δs (min δN δz)) linarith let t : {t : ℝ // t ∈ Ioo (0 : ℝ) 1} := ⟨u, hu0, hu1⟩ refine ⟨t, ?_, ?_, ?_⟩ · exact hnearN (by rw [Real.dist_eq, sub_zero, abs_of_pos hu0] dsimp [u, r] have := min_le_right (1 : ℝ) (min δs (min δN δz)) have := min_le_right δs (min δN δz) have := min_le_left δN δz linarith) · apply hs ⟨u, ⟨hu0.le, hu1.le⟩⟩ dsimp [u, r] have := min_le_right (1 : ℝ) (min δs (min δN δz)) have := min_le_left δs (min δN δz) linarith · apply hz u · rw [abs_of_pos hu0] dsimp [u, r] have := min_le_right (1 : ℝ) (min δs (min δN δz)) have := min_le_right δs (min δN δz) have := min_le_right δN δz linarith · exact ne_of_gt hu0
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePath_exists_small_stratum_nonzero · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:1366
theorem analytic_edge_perturbation Lemma 1 in the paper ↗

Every edge admits arbitrarily small stratum-preserving affine perturbations with nonzero second-moment contrast; the contrast has the stated analytic integral and isolated zeros. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
θs :
j i :
Fin n
hji :
G.edge j i
hIntervention :
conclusion 1
∃ O : Set ℝ,
Icc (0 : ℝ) 1 ⊆ O
t ∈ O :
t ∈ O :
affinePathContrast s θs hji t = 0
∃ ε > 0, ∀ u ∈ Ioo (t - ε) (t + ε), u ≠ t → affinePathContrast s θs hji u ≠ 0
conclusion 2
affinePathContrast s θs hji 1 ≠ 0
conclusion 3
N ∈ 𝓝 θs.1 :
∃ t : {t : ℝ // t ∈ Ioo (0 : ℝ) 1},
affinePath s θs hji ⟨t.1, ⟨le_of_lt t.2.1, le_of_lt t.2.2⟩⟩ ∈ N
ModelStratum G s (affinePath s θs hji ⟨t.1, ⟨le_of_lt t.2.1, le_of_lt t.2.2⟩⟩)
affinePathContrast s θs hji t.1 ≠ 0
Proof (Lean source)
lemma analytic_edge_perturbation {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θs : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) (hIntervention : OnePerfectInterventionPerNode G θs.1 (canonicalObservedWorld G θs.1 (refl (Fin n)))) : (∃ O : Set ℝ, IsOpen O ∧ Icc (0 : ℝ) 1 ⊆ O ∧ (∀ t ∈ O, affinePathContrast s θs hji t = affinePathContrastIntegral s θs hji t) ∧ AnalyticOnNhd ℝ (affinePathContrast s θs hji) O ∧ ∀ t ∈ O, affinePathContrast s θs hji t = 0 → ∃ ε > 0, ∀ u ∈ Ioo (t - ε) (t + ε), u ≠ t → affinePathContrast s θs hji u ≠ 0) ∧ affinePathContrast s θs hji 1 ≠ 0 ∧ (∀ N ∈ 𝓝 θs.1, ∃ t : {t : ℝ // t ∈ Ioo (0 : ℝ) 1}, affinePath s θs hji ⟨t.1, ⟨le_of_lt t.2.1, le_of_lt t.2.2⟩⟩ ∈ N ∧ ModelStratum G s (affinePath s θs hji ⟨t.1, ⟨le_of_lt t.2.1, le_of_lt t.2.2⟩⟩) ∧ affinePathContrast s θs hji t.1 ≠ 0) := by rcases affinePathContrastIntegral_analyticOnNhd θs hji with ⟨O, hO, hIcc, hconvex, hpositive, hintegralAnalytic⟩ have hneji : j ≠ i := by intro h subst j exact G.irrefl i hji have heq : ∀ t ∈ O, affinePathContrast s θs hji t = affinePathContrastIntegral s θs hji t := by intro t ht unfold affinePathContrast affinePathContrastIntegral exact canonical_secondMomentContrast_eq_integral (hpositive t ht) hneji have hanalytic : AnalyticOnNhd ℝ (affinePathContrast s θs hji) O := hintegralAnalytic.congr hO (fun t ht ↦ (heq t ht).symm) have hone : affinePathContrast s θs hji 1 ≠ 0 := affinePathContrast_one_ne_zero θs hji have hisolated : ∀ t ∈ O, affinePathContrast s θs hji t = 0 → ∃ epsilon > 0, ∀ u ∈ Ioo (t - epsilon) (t + epsilon), u ≠ t → affinePathContrast s θs hji u ≠ 0 := by intro t ht hzero exact analyticOnNhd_isolated_zeros_of_nonzero hanalytic hconvex.isPreconnected (hIcc ⟨by norm_num, by norm_num⟩) hone ht hzero refine ⟨⟨O, hO, hIcc, heq, hanalytic, hisolated⟩, hone, ?_⟩ intro N hN exact affinePath_exists_small_stratum_nonzero θs hji hIcc hanalytic hisolated N hN
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.analytic_edge_perturbation · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/AnalyticEdgePerturbation.lean:1431
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.BoundedSubclass 21 declarations This file records the determinate bounded statistical regime and its uniform first-stage ratio event.

Bounded Hölder subclass and first-stage contract

This file records the determinate bounded statistical regime and its uniform first-stage ratio event. The unresolved generated-rank estimator remains a descriptive payload rather than a fabricated construction.

structure BoundedRegime Definition 31 in the paper ↗

Parameters of the bounded generated-rank regime.

Definition (Lean source)
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
sampleSizeSequence :
ℕ → Fin (n + 1) → ℕ
ratioRate :
ℕ → ℝ
ratioRate_pos :
∀ N, 0 < ratioRate N
ratioRate_zero :
Tendsto ratioRate atTop (𝓝 0)
failureRate :
ℕ → ℝ
failureRate_pos :
∀ N, 0 < failureRate N
failureRate_zero :
Tendsto failureRate atTop (𝓝 0)
bandwidth :
ℕ → ℝ
bandwidth_pos :
∀ N, 0 < bandwidth N
bandwidth_zero :
Tendsto bandwidth atTop (𝓝 0)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.BoundedRegime · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/BoundedSubclass.lean:22
def ModelGeneratedObservedWorld

An observed world generated by the latent mechanism through a shared diffeomorphism and one relabeled perfect intervention per latent node.

Definition (Lean source)
n :
G :
DAG (Fin n)
θ :
ModelGeneratedObservedWorld G θ :
Type
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.ModelGeneratedObservedWorld · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/BoundedSubclass.lean:37
def DecoderSelectedBoundedRegime

A bounded regime whose predecessor sets use exactly the ordering selected by the law-only population decoder.

Definition (Lean source)
n :
DAG (Fin n)
DecoderSelectedBoundedRegime W :
Type
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.DecoderSelectedBoundedRegime · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/BoundedSubclass.lean:44
def conditioningDomain

Conditioning-coordinate domain induced by the log-ratios on K.

Definition (Lean source)
n :
DAG (Fin n)
shared
W :
shared
R :
shared
K :
i :
Fin n
conditioningDomain R K i :
Set ((j : {j // j ∈ predecessorSet R.order i}) → ℝ)
familyProjection (logRatio G W) (predecessorSet R.order i) '' K
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.conditioningDomain · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/BoundedSubclass.lean:55
def maximumConditioningDimension Definition 33 in the paper ↗

Maximum conditioning dimension of the selected ordering.

Definition (Lean source)
n :
DAG (Fin n)
shared
W :
shared
R :
shared
maximumConditioningDimension R :
Finset.univ.sup (fun i : Fin n => (predecessorSet R.order i).card)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.maximumConditioningDimension · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/BoundedSubclass.lean:61
def regimeMinimumSampleSize

Minimum environment sample size at global index N.

Definition (Lean source)
n :
DAG (Fin n)
shared
W :
shared
R :
shared
N :
regimeMinimumSampleSize R N :
Finset.univ.inf' ⟨0, Finset.mem_univ 0⟩ (R.sampleSizeSequence N)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.regimeMinimumSampleSize · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/BoundedSubclass.lean:66
def HolderOrderBound

Hölder-ball predicate of real order β: every derivative through ⌊β⌋ is bounded by M, and the top derivative has the corresponding fractional Hölder modulus.

Definition (Lean source)
β M :
f :
E → F
K :
Set E
HolderOrderBound β M f K :
Prop
k :
⌊β⌋₊
ContDiffOn ℝ k f K
m :
m ≤ k
x ∈ K :
‖iteratedFDerivWithin ℝ m f K x‖ ≤ M
x ∈ K :
y ∈ K :
‖iteratedFDerivWithin ℝ k f K x - iteratedFDerivWithin ℝ k f K y‖ ≤ M * ‖x - y‖ ^ (β - k)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.HolderOrderBound · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/BoundedSubclass.lean:71
def BoundedHolderRadius Assumption 8 in the paper ↗

All observational mechanisms, intervention densities, and unmixed log ratios lie in the common Hölder ball of order β and radius M.

Definition (Lean source)
n :
DAG (Fin n)
shared
W :
shared
_R :
β M :
BoundedHolderRadius _R β M :
Prop
clause 1
2 < β
clause 2
1 < M
clause 3
i :
HolderOrderBound β M (θ.p i) (latentCube n)
clause 4
i :
HolderOrderBound β M (θ.q i) (Icc (0 : ℝ) 1)
clause 5
i :
HolderOrderBound β M (fun v => logRatio G W i (W.mix v)) (latentCube n)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.BoundedHolderRadius · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/BoundedSubclass.lean:84
def DensityLowerEnvelope Assumption 9 in the paper ↗

Every observational and intervention density is uniformly bounded below by c.

Definition (Lean source)
n :
DAG (Fin n)
shared
W :
shared
_R :
c :
DensityLowerEnvelope _R c :
Prop
clause 1
c ∈ Ioo (0 : ℝ) 1
clause 2
i v :
v ∈ latentCube n
c ≤ θ.p i v
clause 3
i z :
z ∈ Icc (0 : ℝ) 1
c ≤ θ.q i z
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.DensityLowerEnvelope · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/BoundedSubclass.lean:95
def OwnDerivativeMargin Assumption 10 in the paper ↗

Every signed own-coordinate observed log-ratio derivative is at least c.

Definition (Lean source)
n :
shared
W :
shared
_R :
c :
i v :
v ∈ latentCube n
OwnDerivativeMargin _R c :
Prop
c
≤ s.value i * derivWithin (fun z => logRatio G W i (W.mix (update v i z))) (Icc (0 : ℝ) 1) (v i)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.OwnDerivativeMargin · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/BoundedSubclass.lean:102
def CommonInteriorDomain Assumption 11 in the paper ↗

The latent preimage of K is at least ρ from the boundary of the latent cube.

Definition (Lean source)
n :
DAG (Fin n)
shared
W :
shared
_R :
K :
ρ :
CommonInteriorDomain _R K ρ :
Prop
clause 1
ρ ∈ Ioo (0 : ℝ) (1 / 2)
clause 2
clause 3
clause 4
v ∈ W.unmix '' K :
ρ ≤ infDist v (frontier (latentCube n))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.CommonInteriorDomain · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/BoundedSubclass.lean:110
def jacobianDeterminantWithin

The Jacobian determinant of a Euclidean self-map relative to its stated domain.

Definition (Lean source)
n :
shared
f :
S :
x :
jacobianDeterminantWithin f S x :
LinearMap.det (fderivWithin ℝ f S x).toLinearMap
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.jacobianDeterminantWithin · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/BoundedSubclass.lean:118
def BoundedSharedMixingGeometry Assumption 12 in the paper ↗

The shared map, inverse map, and both Jacobian determinants obey the uniform envelope.

Definition (Lean source)
n :
DAG (Fin n)
shared
W :
shared
_R :
M :
BoundedSharedMixingGeometry _R M :
Prop
clause 1
ContDiffOn ℝ 2 W.mix (latentCube n)
clause 2
ContDiffOn ℝ 2 W.unmix (observedSupport G W)
clause 3
v ∈ latentCube n :
‖W.mix v‖ ≤ M
‖fderivWithin ℝ W.mix (latentCube n) v‖ ≤ M
‖iteratedFDerivWithin ℝ 2 W.mix (latentCube n) v‖ ≤ M
|jacobianDeterminantWithin W.mix (latentCube n) v| ≤ M
clause 4
x ∈ observedSupport G W :
‖W.unmix x‖ ≤ M
‖fderivWithin ℝ W.unmix (observedSupport G W) x‖ ≤ M
‖iteratedFDerivWithin ℝ 2 W.unmix (observedSupport G W) x‖ ≤ M
|jacobianDeterminantWithin W.unmix (observedSupport G W) x| ≤ M
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.BoundedSharedMixingGeometry · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/BoundedSubclass.lean:124
def ObservedLogRatioRegularity Assumption 13 in the paper ↗

Every observed log ratio has uniformly bounded value and first two derivatives on K.

Definition (Lean source)
n :
DAG (Fin n)
shared
W :
shared
_R :
K :
M :
ObservedLogRatioRegularity _R K M :
Prop
clause 1
i :
ContDiffOn ℝ 2 (logRatio G W i) K
clause 2
i x :
x ∈ K
|logRatio G W i x| ≤ M
‖fderivWithin ℝ (logRatio G W i) K x‖ ≤ M
‖iteratedFDerivWithin ℝ 2 (logRatio G W i) K x‖ ≤ M
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.ObservedLogRatioRegularity · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/BoundedSubclass.lean:138
def ConditionalDesignEnvelope Assumption 14 in the paper ↗

For each environment, some density version of the law of its conditioning coordinates obeys the empty-predecessor convention and lies between c and M on its induced domain.

Definition (Lean source)
n :
DAG (Fin n)
shared
W :
shared
c M :
K :
i :
ConditionalDesignEnvelope R c M K :
Prop
∃ hmeas : AEMeasurable (familyProjection (logRatio G W) (predecessorSet R.order i)) (W.law i.succ),
∃ g : (((j : {j // j ∈ predecessorSet R.order i}) → ℝ) → ℝ),
clause 1
predecessorSet R.order i = ∅
g = fun _ => 1
clause 2
Measure.map (hmeas.mk (familyProjection (logRatio G W) (predecessorSet R.order i))) (W.law i.succ)
= volume.withDensity (fun z => ofReal (g z))
clause 3
z :
z ∈ conditioningDomain R K i
c ≤ g z
g z ≤ M
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.ConditionalDesignEnvelope · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/BoundedSubclass.lean:148
structure BoundedHolderSubclass

Membership evidence for the bounded Hölder subclass, indexed by a point of the full model stratum. Its extension is boundedSubclassSet.

Definition (Lean source)
n :
shared
G :
DAG (Fin n)
shared
s :
shared
world :
regime :
∀ θs : StratumPoint G s, DecoderSelectedBoundedRegime (world θs)
β c M :
K :
ρ :
θs :
holderRadius :
BoundedHolderRadius (regime θs).1 β M
densityLower :
DensityLowerEnvelope (regime θs).1 c
derivativeMargin :
OwnDerivativeMargin (s := s) (regime θs).1 c
interiorDomain :
CommonInteriorDomain (regime θs).1 K ρ
mixingGeometry :
ratioRegularity :
ObservedLogRatioRegularity (regime θs).1 K M
designEnvelope :
ConditionalDesignEnvelope (regime θs).1 c M K
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.BoundedHolderSubclass · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/BoundedSubclass.lean:167
def boundedSubclassSet

The bounded Hölder subclass as a subset of the population stratum.

Definition (Lean source)
n :
shared
world :
regime :
∀ θs : StratumPoint G s, DecoderSelectedBoundedRegime (world θs)
β c M :
K :
ρ :
boundedSubclassSet world regime β c M K ρ :
{θs | BoundedHolderSubclass world regime β c M K ρ θs}
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.boundedSubclassSet · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/BoundedSubclass.lean:182
def uniformC1RatioEvent

The uniform log-ratio error event, including membership of the fitted and true log-ratios rather than only pointwise derivative inequalities.

Definition (Lean source)
n :
DAG (Fin n)
shared
W :
shared
Ω :
S :
b :
uniformC1RatioEvent S b :
Set Ω
{ω | ∀ i, ContDiffOn ℝ 1 (fun y => log (S.ratioEstimate ω i y)) (observedSupport G W) ∧ ContDiffOn ℝ 1 (logRatio G W i) (observedSupport G W) ∧ ∀ x ∈ observedSupport G W, |log (S.ratioEstimate ω i x) - logRatio G W i x| ≤ b ∧ ‖fderivWithin ℝ (fun y => log (S.ratioEstimate ω i y)) (observedSupport G W) x - fderivWithin ℝ (logRatio G W i) (observedSupport G W) x‖ ≤ b}
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.uniformC1RatioEvent · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/BoundedSubclass.lean:191
def firstStageRatioContract

The common N-indexed first-stage contract over the bounded subclass. Each sampling world uses the regime's environment sample-size sequence, and the event is explicitly measurable.

Definition (Lean source)
n :
shared
Ω :
world :
regime :
∀ θs : StratumPoint G s, DecoderSelectedBoundedRegime (world θs)
sampling :
∀ (θs : StratumPoint G s) (_N : ℕ), SampleSplitWorld (world θs).1 Ω
sampleSizeSequence :
ℕ → Fin (n + 1) → ℕ
bN etaN :
ℕ → ℝ
β c M :
K :
ρ :
firstStageRatioContract world regime sampling sampleSizeSequence bN etaN β c M K ρ :
Prop
clause 1
N :
0 < bN N
clause 2
Tendsto bN atTop (𝓝 0)
clause 3
N :
0 < etaN N
clause 4
Tendsto etaN atTop (𝓝 0)
clause 5
N θs :
θs ∈ boundedSubclassSet world regime β c M K ρ
(regime θs).1.sampleSizeSequence = sampleSizeSequence
(regime θs).1.ratioRate = bN
(regime θs).1.failureRate = etaN
(sampling θs N).sampleSize = sampleSizeSequence N
MeasurableSet (uniformC1RatioEvent (sampling θs N) (bN N))
1 - etaN N ≤ (sampling θs N).probability.real (uniformC1RatioEvent (sampling θs N) (bN N))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.firstStageRatioContract · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/BoundedSubclass.lean:206
def coordinateRate

The proposed uniform coordinate-rate expression.

Definition (Lean source)
n :
DAG (Fin n)
shared
W :
shared
R :
shared
N :
coordinateRate R N :
R.bandwidth N ^ 2
+ sqrt (log (regimeMinimumSampleSize R N) / ((regimeMinimumSampleSize R N : ℝ) * R.bandwidth N ^ maximumConditioningDimension R))
+ R.ratioRate N / R.bandwidth N
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.coordinateRate · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/BoundedSubclass.lean:229
def generatedRankHandle Remark 1 in the paper ↗

@realizes Hrank\mathfrak H_{\mathrm{rank}}(open generated-rank proof-strategy handle) @realizes U^i\widehat U_i(open second-stage cross-fitted rank estimator)

Definition (Lean source)
generatedRankHandle :
_root_.String
"Nonassertive generated-rank handle: adapt Xie's local-linear conditional-CDF estimator to \ cross-fitted log-ratio responses and covariates; decompose the second stage into the oracle \ conditional-CDF process, indicator boundary crossings from the generated threshold, and \ local-design perturbations from generated conditioning arguments; then linearize that last \ component using Mammen convention, bandwidth selector, influence representation, attainment claim, or sharpness claim \ is supplied here."
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.generatedRankHandle · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/BoundedSubclass.lean:240
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.CitedGates 3 declarations These closed string payloads record cited scope facts.

Bibliographic comparator-scope records

These closed string payloads record cited scope facts. They are metadata only and are not logical hypotheses of any theorem.

Wendong, Kekić, von Kügelgen, Buchholz, Besserve, Gresele, and Schölkopf (2023), "Causal Component Analysis," Definition 3.2, Theorem 4.2, and Appendix E.2, NeurIPS paper handle WendongEtAl2023CauCA.

Definition (Lean source)
caucaComparatorScope :
_root_.String
"Wendong et al. (2023), Causal Component Analysis, Definition 3.2, Theorem 4.2, and Appendix E.2 (WendongEtAl2023CauCA; https://papers.nips.cc/paper_files/paper/2023/file/67089958e98b243d5cc1881ad60418b8-Paper-Conference.pdf): the graph G is assumed known, intervention targets are observed and fixed across candidate models, and one perfect stochastic intervention per node, each satisfying Assumption 4.1, gives identification up to componentwise scaling."
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.caucaComparatorScope · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CitedGates.lean:11

von Kügelgen, Besserve, Wendong, Gresele, Kekić, Bareinboim, Blei, and Schölkopf (2023), "Nonparametric Identifiability of Causal Representations from Unknown Interventions," Theorems 3.2 and 3.4 and Section 7, handle vonKugelgenEtAl2023UnknownInterventions.

Definition (Lean source)
vonKugelgenComparatorScope :
_root_.String
"von Kugelgen et al. (2023), Nonparametric Identifiability of Causal Representations from Unknown Interventions, Theorems 3.2 and 3.4 and Section 7 (vonKugelgenEtAl2023UnknownInterventions; https://papers.nips.cc/paper_files/paper/2023/file/97fe251c25b6f99a2a23b330a75b11d4-Paper-Conference.pdf): Theorem 3.2 is bivariate with one unknown-target perfect intervention per node and a continuous witness genericity condition; Theorem 3.4 uses two paired perfect interventions per node in arbitrary dimension; the one-intervention extension for n greater than two is stated as a conjecture."
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.vonKugelgenComparatorScope · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CitedGates.lean:22

Yao, Rancati, Cadei, Fumero, and Locatello (2025), "Unifying Causal Representation Learning with the Invariance Principle," Assumption D.1, Corollary D.1, and the following remark, arXiv handle 2409.02772v2.

Definition (Lean source)
yaoComparatorScope :
_root_.String
"Yao et al. (2025), Unifying Causal Representation Learning with the Invariance Principle, Assumption D.1, Corollary D.1, and the immediately following remark (YaoEtAl2025InvariancePrinciple; arXiv:2409.02772v2; https://arxiv.org/abs/2409.02772v2): exactly one imperfect intervention is supplied per node, the target labels preserve a supplied topological order, componentwise identification follows from marginal and score invariances, and identifying the order is explicitly treated as a separate subproblem."
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.yaoComparatorScope · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CitedGates.lean:34
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.CompactCondIndepBridge 12 declarations This file transports the paper's ambient, cube-supported coordinate conditional independence to the compact coordinate-product presentation used by positive finite-DAG factorizations.

Conditional-independence bridge to compact cube factorizations

This file transports the paper's ambient, cube-supported coordinate conditional independence to the compact coordinate-product presentation used by positive finite-DAG factorizations.

theorem measurable_paperCoordinateProjection

The finite-coordinate projection from latent states is measurable.

Formal statement
n :
S :
Measurable (coordinateProjection S)
Proof (Lean source)
@[fun_prop] lemma measurable_paperCoordinateProjection {n : ℕ} (S : Finset (Fin n)) : Measurable (coordinateProjection S) := by exact measurable_pi_lambda _ fun j ↦ measurable_pi_apply j.1
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.measurable_paperCoordinateProjection · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CompactCondIndepBridge.lean:27
theorem comap_compact_realProjection_eq

On compact coordinates, the real-valued coordinate projection generates the same sigma-algebra as the subtype-valued coordinate projection. the stated conclusion follows.

Formal statement
n :
S :
comap ((coordinateProjection S) ∘ compactCubeInclude n) inferInstance
= comap (coordinateProjection (X := fun _ : Fin n ↦ Icc (0 : ℝ) 1) S) inferInstance
Proof (Lean source)
lemma comap_compact_realProjection_eq (n : ℕ) (S : Finset (Fin n)) : comap ((coordinateProjection S) ∘ compactCubeInclude n) inferInstance = comap (coordinateProjection (X := fun _ : Fin n ↦ Icc (0 : ℝ) 1) S) inferInstance := by let compactProjection := coordinateProjection (X := fun _ : Fin n ↦ Icc (0 : ℝ) 1) S let coeProjection : ((j : {j // j ∈ S}) → Icc (0 : ℝ) 1) → ((j : {j // j ∈ S}) → ℝ) := fun x j ↦ x j let retractProjection : ((j : {j // j ∈ S}) → ℝ) → ((j : {j // j ∈ S}) → Icc (0 : ℝ) 1) := fun x j ↦ projIcc 0 1 (by norm_num) (x j) have hcoe : Measurable coeProjection := by exact measurable_pi_lambda _ fun j ↦ measurable_subtype_coe.comp (measurable_pi_apply j) have hretract : Measurable retractProjection := by exact measurable_pi_lambda _ fun j ↦ continuous_projIcc.measurable.comp (measurable_pi_apply j) have hreal : ((coordinateProjection S) ∘ compactCubeInclude n) = coeProjection ∘ compactProjection := rfl have hback : compactProjection = retractProjection ∘ ((coordinateProjection S) ∘ compactCubeInclude n) := by funext x j apply Subtype.ext change (x j : ℝ) = ((projIcc 0 1 (by norm_num) (x j) : Icc (0 : ℝ) 1) : ℝ) exact congrArg val (Set.projIcc_of_mem (show (0 : ℝ) ≤ 1 by norm_num) (x j).property).symm apply le_antisymm · rw [hreal] change comap (coeProjection ∘ compactProjection) inferInstancecomap compactProjection inferInstance simpa only [MeasurableSpace.comap_comp] using comap_mono hcoe.comap_le · change comap compactProjection inferInstancecomap ((coordinateProjection S) ∘ compactCubeInclude n) inferInstance rw [hback] simpa only [MeasurableSpace.comap_comp] using comap_mono hretract.comap_le
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.comap_compact_realProjection_eq · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CompactCondIndepBridge.lean:33
theorem comap_compact_realCoordinate_eq

On compact coordinates, coercing one interval-valued coordinate to a real generates the same sigma-algebra as the original interval-valued coordinate. the stated conclusion follows.

Formal statement
n :
i :
Fin n
= comap (fun x : (k : Fin n) → Icc (0 : ℝ) 1 ↦ x i) inferInstance
Proof (Lean source)
lemma comap_compact_realCoordinate_eq (n : ℕ) (i : Fin n) : comap ((fun v : LatentState n ↦ v i) ∘ compactCubeInclude n) inferInstance = comap (fun x : (k : Fin n) → Icc (0 : ℝ) 1 ↦ x i) inferInstance := by let compactCoordinate : ((k : Fin n) → Icc (0 : ℝ) 1) → Icc (0 : ℝ) 1 := fun x ↦ x i let coeCoordinate : Icc (0 : ℝ) 1 → ℝ := Subtype.val let retractCoordinate : ℝ → Icc (0 : ℝ) 1 := projIcc 0 1 (by norm_num) have hcoe : Measurable coeCoordinate := measurable_subtype_coe have hretract : Measurable retractCoordinate := continuous_projIcc.measurable have hreal : ((fun v : LatentState n ↦ v i) ∘ compactCubeInclude n) = coeCoordinate ∘ compactCoordinate := rfl have hback : compactCoordinate = retractCoordinate ∘ ((fun v : LatentState n ↦ v i) ∘ compactCubeInclude n) := by funext x apply Subtype.ext exact congrArg Subtype.val (Set.projIcc_of_mem (show (0 : ℝ) ≤ 1 by norm_num) (x i).property).symm apply le_antisymm · rw [hreal] change comap (coeCoordinate ∘ compactCoordinate) inferInstancecomap compactCoordinate inferInstance simpa only [MeasurableSpace.comap_comp] using comap_mono hcoe.comap_le · change comap compactCoordinate inferInstancecomap ((fun v : LatentState n ↦ v i) ∘ compactCubeInclude n) inferInstance rw [hback] simpa only [MeasurableSpace.comap_comp] using comap_mono hretract.comap_le
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.comap_compact_realCoordinate_eq · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CompactCondIndepBridge.lean:78
theorem compactRealCondIndep_iff

The real-coordinate presentation on the compact cube is equivalent to the native subtype-coordinate presentation of a compact positive factorization. the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
Fin n → Measure (Icc (0 : ℝ) 1)
∀ k, SigmaFinite (mu k)
M :
CompactPositiveFactorization G (fun _ : Fin n ↦ Icc (0 : ℝ) 1) mu
i j :
Fin n
C :
CondIndepFun (comap ((coordinateProjection C) ∘ compactCubeInclude n) inferInstance) ((measurable_paperCoordinateProjection C).comp (measurable_compactCubeInclude n)).comap_le ((fun v : LatentState n ↦ v i) ∘ compactCubeInclude n) ((fun v : LatentState n ↦ v j) ∘ compactCubeInclude n) M.observationalMeasure
↔ M.CondIndepCoordinates i j C
Proof (Lean source)
lemma compactRealCondIndep_iff {n : ℕ} {G : DAG (Fin n)} {mu : Fin n → Measure (Icc (0 : ℝ) 1)} [∀ k, SigmaFinite (mu k)] (M : CompactPositiveFactorization G (fun _ : Fin n ↦ Icc (0 : ℝ) 1) mu) (i j : Fin n) (C : Finset (Fin n)) : CondIndepFun (comap ((coordinateProjection C) ∘ compactCubeInclude n) inferInstance) ((measurable_paperCoordinateProjection C).comp (measurable_compactCubeInclude n)).comap_le ((fun v : LatentState n ↦ v i) ∘ compactCubeInclude n) ((fun v : LatentState n ↦ v j) ∘ compactCubeInclude n) M.observationalMeasure ↔ M.CondIndepCoordinates i j C := by unfold CompactPositiveFactorization.CondIndepCoordinates rw [ProbabilityTheory.condIndepFun_iff_condIndep, ProbabilityTheory.condIndepFun_iff_condIndep] have hZ := comap_compact_realProjection_eq n C have hX := comap_compact_realCoordinate_eq n i have hY := comap_compact_realCoordinate_eq n j simpa only [hZ, hX, hY]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.compactRealCondIndep_iff · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CompactCondIndepBridge.lean:113
theorem condIndepCoordinates_iff_compactPositiveFactorization

If a compact positive factorization's observational measure includes to the paper's ambient observational law, then the two singleton-coordinate conditional-independence encodings are equivalent. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
Fin n → Measure (Icc (0 : ℝ) 1)
∀ k, SigmaFinite (mu k)
theta :
M :
CompactPositiveFactorization G (fun _ : Fin n ↦ Icc (0 : ℝ) 1) mu
hobs :
Measure.map (compactCubeInclude n) M.observationalMeasure = observationalLaw theta.1
i j :
Fin n
C :
CondIndepCoordinates theta.1 {i} {j} C ↔ M.CondIndepCoordinates i j C
Proof (Lean source)
lemma condIndepCoordinates_iff_compactPositiveFactorization {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} {mu : Fin n → Measure (Icc (0 : ℝ) 1)} [∀ k, SigmaFinite (mu k)] (theta : StratumPoint G s) (M : CompactPositiveFactorization G (fun _ : Fin n ↦ Icc (0 : ℝ) 1) mu) (hobs : Measure.map (compactCubeInclude n) M.observationalMeasure = observationalLaw theta.1) (i j : Fin n) (C : Finset (Fin n)) : CondIndepCoordinates theta.1 {i} {j} C ↔ M.CondIndepCoordinates i j C := by letI : IsFiniteMeasure (observationalLaw theta.1) := by rw [← hobs] infer_instance have hmapRetract : Measure.map (compactCubeRetract n) (observationalLaw theta.1) = M.observationalMeasure := by rw [← hobs] exact map_compactCubeRetract_map_compactCubeInclude M.observationalMeasure have hcompact := condIndepFun_comp_aeEquiv_iff (compactCubeInclude n) (compactCubeRetract n) (measurable_compactCubeInclude n) (measurable_compactCubeRetract n) hobs hmapRetract (compactCubeInclude_retract_ae_observationalLaw theta.1) (fun v : LatentState n ↦ v i) (fun v : LatentState n ↦ v j) (coordinateProjection C) (measurable_pi_apply i) (measurable_pi_apply j) (measurable_paperCoordinateProjection C) rw [condIndepCoordinates_singletons_iff_condIndepGiven i j C] constructor · rintro ⟨_, _, _, _, hambient⟩ exact (compactRealCondIndep_iff M i j C).mp (hcompact.mpr hambient) · intro hM have hreal := (compactRealCondIndep_iff M i j C).mpr hM refine ⟨inferInstance, measurable_pi_apply i, measurable_pi_apply j, measurable_paperCoordinateProjection C, ?_⟩ exact hcompact.mp hreal
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.condIndepCoordinates_iff_compactPositiveFactorization · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CompactCondIndepBridge.lean:138
theorem condIndepCoordinates_iff_compactPositiveFactorization_mechanism

The paper and compact-factorization singleton conditional-independence encodings agree for an arbitrary mechanism whenever their observational measures agree. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
Fin n → Measure (Icc (0 : ℝ) 1)
∀ k, SigmaFinite (mu k)
theta :
M :
CompactPositiveFactorization G (fun _ : Fin n ↦ Icc (0 : ℝ) 1) mu
hobs :
Measure.map (compactCubeInclude n) M.observationalMeasure = observationalLaw theta
i j :
Fin n
C :
CondIndepCoordinates theta {i} {j} C ↔ M.CondIndepCoordinates i j C
Proof (Lean source)
lemma condIndepCoordinates_iff_compactPositiveFactorization_mechanism {n : ℕ} {G : DAG (Fin n)} {mu : Fin n → Measure (Icc (0 : ℝ) 1)} [∀ k, SigmaFinite (mu k)] (theta : Mechanism n G) (M : CompactPositiveFactorization G (fun _ : Fin n ↦ Icc (0 : ℝ) 1) mu) (hobs : Measure.map (compactCubeInclude n) M.observationalMeasure = observationalLaw theta) (i j : Fin n) (C : Finset (Fin n)) : CondIndepCoordinates theta {i} {j} C ↔ M.CondIndepCoordinates i j C := by letI : IsFiniteMeasure (observationalLaw theta) := by rw [← hobs] infer_instance have hmapRetract : Measure.map (compactCubeRetract n) (observationalLaw theta) = M.observationalMeasure := by rw [← hobs] exact map_compactCubeRetract_map_compactCubeInclude M.observationalMeasure have hcompact := condIndepFun_comp_aeEquiv_iff (compactCubeInclude n) (compactCubeRetract n) (measurable_compactCubeInclude n) (measurable_compactCubeRetract n) hobs hmapRetract (compactCubeInclude_retract_ae_observationalLaw theta) (fun v : LatentState n ↦ v i) (fun v : LatentState n ↦ v j) (coordinateProjection C) (measurable_pi_apply i) (measurable_pi_apply j) (measurable_paperCoordinateProjection C) rw [condIndepCoordinates_singletons_iff_condIndepGiven i j C] constructor · rintro ⟨_, _, _, _, hambient⟩ exact (compactRealCondIndep_iff M i j C).mp (hcompact.mpr hambient) · intro hM have hreal := (compactRealCondIndep_iff M i j C).mpr hM refine ⟨inferInstance, measurable_pi_apply i, measurable_pi_apply j, measurable_paperCoordinateProjection C, ?_⟩ exact hcompact.mp hreal
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.condIndepCoordinates_iff_compactPositiveFactorization_mechanism · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CompactCondIndepBridge.lean:178
def mechanismCompactPositiveFactorization

A positive normalized smooth paper mechanism restricts to a compact positive factorization on the product of unit-interval coordinate subtypes.

Definition (Lean source)
mechanismCompactPositiveFactorization hpos :
CompactPositiveFactorization G (fun _ : Fin n ↦ Icc (0 : ℝ) 1) (fun _ : Fin n ↦ (volume : Measure (Icc (0 : ℝ) 1)))
by let B := mechanismUnitCubeFactorization hpos have hcube (x : (k : Fin n) → Icc (0 : ℝ) 1) : compactCubeInclude n x ∈ latentCube n := fun k _ ↦ (x k).property have hfactor (i : Fin n) (x : (k : Fin n) → Icc (0 : ℝ) 1) : B.factor i (compactCubeInclude n x)
= ofReal (theta.p i (compactCubeInclude n x)) := by simpa only [B, mechanismUnitCubeFactorization, latentCube] using unitCubeFactorizationOfRealCubeFactors_factor_eq theta.p (measurableOnSet_of_continuousOn_cube theta.p (fun k => (hpos.2.2.1 k).continuousOn)) (fun k v hv => (hpos.1 k v hv).le) (fun k v w _ _ hvw => theta.parent_local k v w (hvw k (mem_insert_self _ _)) (fun l hl => hvw l (mem_insert_of_mem hl))) hpos.2.2.2.2.1 i (hcube x) have hlower_exists : ∃ lower > 0, ∀ z ∈ univ ×ˢ latentCube n, lower ≤ theta.p z.1 z.2 := (isCompact_univ.prod (by rw [latentCube] exact isCompact_univ_pi fun _ => isCompact_Icc)).exists_forall_le' (by rw [continuousOn_prod_of_discrete_left] intro i simpa only [Set.mem_prod, Set.mem_univ, true_and, Set.ofPred_mem_eq] using (hpos.2.2.1 i).continuousOn) (fun z hz => hpos.1 z.1 z.2 hz.2) let lower := choose hlower_exists have hlower_spec := Classical.choose_spec hlower_exists have hlower : 0 < lower := hlower_spec.1 have hlower_le : ∀ z ∈ univ ×ˢ latentCube n, lower ≤ theta.p z.1 z.2 := hlower_spec.2 refine { toFactorization := { factor := fun i x ↦ B.factor i (compactCubeInclude n x) measurable_factor := fun i ↦ (B.measurable_factor i).comp (measurable_compactCubeInclude n) local_factor := ?_ normalized_factor := ?_ } lower := lower lower_pos := hlower factor_ne_top := ?_ factor_continuous := ?_ lower_le_factor := ?_ } · intro i x y hxy apply B.local_factor i intro k hk exact congrArg Subtype.val (hxy k hk) · intro i x have hfun : (fun z : Icc (0 : ℝ) 1 ↦ B.factor i (compactCubeInclude n (update x i z))) = (fun z : ℝ ↦ B.factor i (update (compactCubeInclude n x) i z)) ∘ Subtype.val := by funext z congr 2 funext k by_cases hki : k = i · subst k simp [compactCubeInclude] · simp [update, hki, compactCubeInclude] have hf : Measurable (fun z : ℝ ↦ B.factor i (update (compactCubeInclude n x) i z)) := (B.measurable_factor i).comp (measurable_update (compactCubeInclude n x)) rw [hfun, unitInterval.volume_def] let f : ℝ → ℝ≥0∞ := fun z ↦ B.factor i (update (compactCubeInclude n x) i z) have he : MeasurePreserving (Subtype.val : Icc (0 : ℝ) 1 → ℝ) (Measure.comap Subtype.val volume) (volume.restrict (Icc (0 : ℝ) 1)) := measurePreserving_subtype_coe measurableSet_Icc calc (∫⁻ z : Icc (0 : ℝ) 1, f z ∂Measure.comap Subtype.val volume) = ∫⁻ z : ℝ, f z ∂volume.restrict (Icc (0 : ℝ) 1) := he.lintegral_comp hf _ = 1 := B.normalized_factor i (compactCubeInclude n x) · intro i x rw [hfactor] exact ENNReal.ofReal_ne_top · intro i have hinclude : Continuous (compactCubeInclude n) := by exact continuous_pi fun k ↦ continuous_subtype_val.comp (continuous_apply k) have hmaps : MapsTo (compactCubeInclude n) univ (latentCube n) := fun x _ ↦ hcube x have hcont : Continuous (fun x => theta.p i (compactCubeInclude n x)) := (hpos.2.2.1 i).continuousOn.comp_continuous hinclude (fun x => hcube x) convert hcont using 1 funext x rw [hfactor, ENNReal.toReal_ofReal (hpos.1 i _ (hcube x)).le] · intro i x rw [hfactor, ENNReal.toReal_ofReal (hpos.1 i _ (hcube x)).le] exact hlower_le (i, compactCubeInclude n x) ⟨Set.mem_univ i, hcube x⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.mechanismCompactPositiveFactorization · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CompactCondIndepBridge.lean:216
theorem mechanismCompactPositiveFactorization_factor_eq

The compact factorization's local factor is the paper mechanism factor evaluated at the included compact assignment. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
i :
Fin n
x :
(k : Fin n) → Icc (0 : ℝ) 1
(mechanismCompactPositiveFactorization hpos).toFactorization.factor i x
= ofReal (theta.p i (compactCubeInclude n x))
Proof (Lean source)
lemma mechanismCompactPositiveFactorization_factor_eq {n : ℕ} {G : DAG (Fin n)} {theta : Mechanism n G} (hpos : PositiveNormalizedSmoothMechanisms G theta) (i : Fin n) (x : (k : Fin n) → Icc (0 : ℝ) 1) : (mechanismCompactPositiveFactorization hpos).toFactorization.factor i x = ofReal (theta.p i (compactCubeInclude n x)) := by change (mechanismUnitCubeFactorization hpos).factor i (compactCubeInclude n x) = _ change (mechanismUnitCubeFactorization hpos).factor i (fun k => (x k : ℝ)) = ofReal (theta.p i (fun k => (x k : ℝ))) simpa only [mechanismUnitCubeFactorization, latentCube] using unitCubeFactorizationOfRealCubeFactors_factor_eq theta.p (measurableOnSet_of_continuousOn_cube theta.p (fun k => (hpos.2.2.1 k).continuousOn)) (fun k v hv => (hpos.1 k v hv).le) (fun k v w _ _ hvw => theta.parent_local k v w (hvw k (mem_insert_self _ _)) (fun l hl => hvw l (mem_insert_of_mem hl))) hpos.2.2.2.2.1 i (fun k _ => (x k).property)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.mechanismCompactPositiveFactorization_factor_eq · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CompactCondIndepBridge.lean:316
theorem mechanismCompact_factorSupClose_of_p_close

Uniform closeness of paper observational factors implies FactorSupClose for their compact positive factorizations. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
ε :
hclose :
∀ i v
if
v ∈ latentCube n
then
|eta.p i v - theta.p i v| < ε
Proof (Lean source)
lemma mechanismCompact_factorSupClose_of_p_close {n : ℕ} {G : DAG (Fin n)} {theta eta : Mechanism n G} (hθ : PositiveNormalizedSmoothMechanisms G theta) (hη : PositiveNormalizedSmoothMechanisms G eta) {ε : ℝ} (hclose : ∀ i v, v ∈ latentCube n → |eta.p i v - theta.p i v| < ε) : (mechanismCompactPositiveFactorization hθ).FactorSupClose (mechanismCompactPositiveFactorization hη) ε := by intro i x rw [mechanismCompactPositiveFactorization_factor_eq, mechanismCompactPositiveFactorization_factor_eq] have hx : compactCubeInclude n x ∈ latentCube n := fun k _ => (x k).property rw [ENNReal.toReal_ofReal (hη.1 i _ hx).le, ENNReal.toReal_ofReal (hθ.1 i _ hx).le] exact hclose i _ hx
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.mechanismCompact_factorSupClose_of_p_close · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CompactCondIndepBridge.lean:337
theorem mechanismCompactPositiveFactorization_observationalMeasure

Including the compact factorization's observational measure into the ambient latent space recovers the paper's cube-supported observational law. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
Proof (Lean source)
lemma mechanismCompactPositiveFactorization_observationalMeasure {n : ℕ} {G : DAG (Fin n)} {theta : Mechanism n G} (hpos : PositiveNormalizedSmoothMechanisms G theta) : Measure.map (compactCubeInclude n) (mechanismCompactPositiveFactorization hpos).observationalMeasure = observationalLaw theta := by let M := mechanismCompactPositiveFactorization hpos let e := compactCubeEquiv n let d : {v : LatentState n // v ∈ latentCube n} → ℝ≥0∞ := fun v => ofReal (observationalDensity theta v.1) have hdensity : M.toFactorization.observationalDensity = d ∘ e := by funext x unfold observationalDensity partialDensity change (∏ i, (mechanismCompactPositiveFactorization hpos).toFactorization.factor i x) = ofReal (∏ i, theta.p i (compactCubeInclude n x)) simp_rw [mechanismCompactPositiveFactorization_factor_eq hpos] rw [← ENNReal.ofReal_prod_of_nonneg] intro i hi exact (hpos.1 i (compactCubeInclude n x) (fun k _ => (x k).property)).le have heWeighted : Measure.map e M.observationalMeasure = (volume : Measure {v : LatentState n // v ∈ latentCube n}).withDensity d := by unfold CompactPositiveFactorization.observationalMeasure observationalMeasure rw [hdensity] exact map_withDensity_comp_measurableEquiv e (compactCubeEquiv_measurePreserving n) d have hcube : MeasurableSet (latentCube n) := by rw [latentCube] exact MeasurableSet.univ_pi fun _ => measurableSet_Icc have hcoe : MeasurePreserving (Subtype.val : {v : LatentState n // v ∈ latentCube n} → LatentState n) volume (volume.restrict (latentCube n)) := measurePreserving_subtype_coe hcube have hcoeWeighted : Measure.map (Subtype.val : {v : LatentState n // v ∈ latentCube n} → LatentState n) ((volume : Measure {v : LatentState n // v ∈ latentCube n}).withDensity d) = observationalLaw theta := by ext s hs rw [Measure.map_apply measurable_subtype_coe hs, withDensity_apply _ (measurable_subtype_coe hs)] unfold observationalLaw rw [withDensity_apply _ hs] exact hcoe.setLIntegral_comp_preimage_emb (MeasurableEmbedding.subtype_coe hcube) (fun v => ofReal (observationalDensity theta v)) s rw [← heWeighted] at hcoeWeighted rw [Measure.map_map measurable_subtype_coe e.measurable] at hcoeWeighted exact hcoeWeighted
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.mechanismCompactPositiveFactorization_observationalMeasure · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CompactCondIndepBridge.lean:354
theorem condIndepCoordinates_iff_mechanismCompactPositiveFactorization

For a positive smooth mechanism, the paper's singleton-block conditional independence is exactly the compact positive factorization's coordinate conditional independence. the stated conclusion follows.

Formal statement
n :
theta :
i j :
Fin n
C :
CondIndepCoordinates theta.1 {i} {j} C
↔ CompactPositiveFactorization.CondIndepCoordinates (mechanismCompactPositiveFactorization theta.property.positiveSmooth) i j C
Proof (Lean source)
lemma condIndepCoordinates_iff_mechanismCompactPositiveFactorization {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (theta : StratumPoint G s) (i j : Fin n) (C : Finset (Fin n)) : CondIndepCoordinates theta.1 {i} {j} C ↔ CompactPositiveFactorization.CondIndepCoordinates (mechanismCompactPositiveFactorization theta.property.positiveSmooth) i j C := by exact condIndepCoordinates_iff_compactPositiveFactorization theta (mechanismCompactPositiveFactorization theta.property.positiveSmooth) (mechanismCompactPositiveFactorization_observationalMeasure theta.property.positiveSmooth) i j C
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.condIndepCoordinates_iff_mechanismCompactPositiveFactorization · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CompactCondIndepBridge.lean:406
theorem mechanismCompact_all_edge_witnesses_open

Every paper stratum point has one uniform compact-factor neighborhood in which causal minimality persists on all directed edges. the stated conclusion follows.

Formal statement
n :
theta :
M :
mechanismCompactPositiveFactorization theta.property.positiveSmooth
∃ ε > 0,
∀ N : CompactPositiveFactorization G (fun _ : Fin n ↦ Icc (0 : ℝ) 1) (fun _ : Fin n ↦ (volume : Measure (Icc (0 : ℝ) 1))),
M.FactorSupClose N ε → ∀ i j (hji : G.edge j i), ¬ N.CondIndepCoordinates i j ((G.parents i).erase j)
Proof (Lean source)
lemma mechanismCompact_all_edge_witnesses_open {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (theta : StratumPoint G s) : let M := mechanismCompactPositiveFactorization theta.property.positiveSmooth ∃ ε > 0, ∀ N : CompactPositiveFactorization G (fun _ : Fin n ↦ Icc (0 : ℝ) 1) (fun _ : Fin n ↦ (volume : Measure (Icc (0 : ℝ) 1))), M.FactorSupClose N ε → ∀ i j (hji : G.edge j i), ¬ N.CondIndepCoordinates i j ((G.parents i).erase j) := by classical dsimp only let M := mechanismCompactPositiveFactorization theta.property.positiveSmooth have hwitness : ∀ i j, G.edge j i → Nonempty (M.EdgeWitness i j) := by intro i j hji have hnot : ¬ M.CondIndepCoordinates i j ((G.parents i).erase j) := by rw [← condIndepCoordinates_iff_mechanismCompactPositiveFactorization theta] exact theta.property.causalMinimal hji have hnotAll : ¬ ∀ (x : ∀ k : Fin n, Icc (0 : ℝ) 1) (xi xi' : Icc (0 : ℝ) 1) (xj xj' : Icc (0 : ℝ) 1), M.localContrast i j x xi xi' xj xj' = 0 := by exact fun hall => hnot ((M.edge_condIndep_iff_localContrast_zero hji).mpr hall) push_neg at hnotAll rcases hnotAll with ⟨x, xi, xi', xj, xj', hne⟩ exact ⟨ { base := x child₀ := xi child₁ := xi' parent₀ := xj parent₁ := xj' nonzero := hne }⟩ exact M.all_edge_witnesses_open fun i j hji => choice (hwitness i j hji)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.mechanismCompact_all_edge_witnesses_open · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CompactCondIndepBridge.lean:419
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.CompactCubeBridge 11 declarations This file identifies the ambient closed cube used by the paper with the product of compact interval coordinate types used by finite positive-density factorizations.

Compact cube carrier bridge

This file identifies the ambient closed cube used by the paper with the product of compact interval coordinate types used by finite positive-density factorizations.

The product of unit-interval coordinate types is measurably equivalent to the subtype of ambient latent vectors lying in the closed cube.

Definition (Lean source)
n :
compactCubeEquiv n :
((i : Fin n) → Icc (0 : ℝ) 1) ≃ᵐ {v : LatentState n // v ∈ latentCube n}
clause 1
toFun x := ⟨fun i ↦ x i, fun i _ ↦ (x i).property⟩
clause 2
invFun v := fun i ↦ ⟨v.1 i, v.2 i (Set.mem_univ i)⟩
clause 3
left_inv x := by funext i exact Subtype.ext rfl
clause 4
right_inv v := by exact Subtype.ext (funext fun _ ↦ rfl)
clause 5
measurable_toFun := by apply Measurable.subtype_mk exact measurable_pi_iff.mpr fun i ↦ measurable_subtype_coe.comp (measurable_pi_apply i)
clause 6
measurable_invFun := by apply measurable_pi_iff.mpr intro i change Measurable (fun v : {v : LatentState n // v ∈ latentCube n} ↦ (⟨v.1 i, v.2 i (Set.mem_univ i)⟩ : Icc (0 : ℝ) 1)) exact Measurable.subtype_mk ((measurable_pi_apply i).comp measurable_subtype_coe)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.compactCubeEquiv · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CompactCubeBridge.lean:20
theorem compactCubeEquiv_measurePreserving

The cube equivalence carries the product of restricted coordinate volumes to the restricted ambient volume on the closed cube. the stated conclusion follows.

Formal statement
n :
MeasurePreserving (compactCubeEquiv n) (Measure.pi fun _ : Fin n ↦ (volume : Measure (Icc (0 : ℝ) 1))) (volume : Measure {v : LatentState n // v ∈ latentCube n})
Proof (Lean source)
lemma compactCubeEquiv_measurePreserving (n : ℕ) : MeasurePreserving (compactCubeEquiv n) (Measure.pi fun _ : Fin n ↦ (volume : Measure (Icc (0 : ℝ) 1))) (volume : Measure {v : LatentState n // v ∈ latentCube n}) := by let e := compactCubeEquiv n let c : ((i : Fin n) → Icc (0 : ℝ) 1) → LatentState n := fun x i ↦ x i have hc : MeasurePreserving c (Measure.pi fun _ : Fin n ↦ (volume : Measure (Icc (0 : ℝ) 1))) (Measure.pi fun _ : Fin n ↦ volume.restrict (Icc (0 : ℝ) 1)) := by exact measurePreserving_pi _ _ fun _ ↦ measurePreserving_subtype_coe measurableSet_Icc have hcube : MeasurableSet (latentCube n) := by rw [latentCube] exact MeasurableSet.univ_pi fun _ ↦ measurableSet_Icc have hcoe : MeasurePreserving (Subtype.val : {v : LatentState n // v ∈ latentCube n} → LatentState n) volume (volume.restrict (latentCube n)) := measurePreserving_subtype_coe hcube refine ⟨e.measurable, ?_⟩ apply (MeasurableEmbedding.subtype_coe hcube).map_injective rw [Measure.map_map measurable_subtype_coe e.measurable, hcoe.map_eq] change Measure.map c (Measure.pi fun _ : Fin n ↦ (volume : Measure (Icc (0 : ℝ) 1))) = volume.restrict (latentCube n) rw [hc.map_eq] change (Measure.pi fun _ : Fin n ↦ volume.restrict (Icc (0 : ℝ) 1)) = volume.restrict (Set.univ.pi fun _ : Fin n ↦ Icc (0 : ℝ) 1) rw [MeasureTheory.volume_pi, Measure.restrict_pi_pi]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.compactCubeEquiv_measurePreserving · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CompactCubeBridge.lean:44

Compact coordinate assignments include into the ambient latent vector space.

Definition (Lean source)
n :
compactCubeInclude n :
((i : Fin n) → Icc (0 : ℝ) 1) → LatentState n
fun x i ↦ x i
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.compactCubeInclude · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CompactCubeBridge.lean:77

Coordinatewise projection onto the unit interval retracts the ambient latent vector space onto compact coordinate assignments.

Definition (Lean source)
n :
compactCubeRetract n :
((i : Fin n) → Icc (0 : ℝ) 1)
fun v i ↦ projIcc 0 1 (by norm_num) (v i)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.compactCubeRetract · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CompactCubeBridge.lean:83
theorem measurable_compactCubeInclude

Inclusion of compact coordinate assignments into ambient latent vectors is measurable. the stated conclusion follows.

Formal statement
n :
Proof (Lean source)
lemma measurable_compactCubeInclude (n : ℕ) : Measurable (compactCubeInclude n) := by exact measurable_pi_iff.mpr fun i ↦ measurable_subtype_coe.comp (measurable_pi_apply i)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.measurable_compactCubeInclude · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CompactCubeBridge.lean:90
theorem measurable_compactCubeRetract

The coordinatewise compact-cube retraction is measurable. the stated conclusion follows.

Formal statement
n :
Proof (Lean source)
lemma measurable_compactCubeRetract (n : ℕ) : Measurable (compactCubeRetract n) := by exact measurable_pi_iff.mpr fun i ↦ continuous_projIcc.measurable.comp (measurable_pi_apply i)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.measurable_compactCubeRetract · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CompactCubeBridge.lean:96
theorem compactCubeRetract_include

Retraction after inclusion is exactly the identity on compact coordinate assignments. the stated conclusion follows.

Formal statement
n :
Proof (Lean source)
lemma compactCubeRetract_include (n : ℕ) : compactCubeRetract n ∘ compactCubeInclude n = id := by funext x funext i apply Subtype.ext exact congrArg val (Set.projIcc_of_mem (show (0 : ℝ) ≤ 1 by norm_num) (x i).property)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.compactCubeRetract_include · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CompactCubeBridge.lean:102
theorem compactCubeInclude_retract_of_mem

Inclusion after retraction fixes every ambient point belonging to the latent cube. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
hv :
v ∈ latentCube n
Proof (Lean source)
lemma compactCubeInclude_retract_of_mem {n : ℕ} {v : LatentState n} (hv : v ∈ latentCube n) : compactCubeInclude n (compactCubeRetract n v) = v := by funext i exact congrArg val (Set.projIcc_of_mem (show (0 : ℝ) ≤ 1 by norm_num) (hv i (Set.mem_univ i)))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.compactCubeInclude_retract_of_mem · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CompactCubeBridge.lean:112
theorem compactCubeInclude_retract_ae_observationalLaw

Under a positive smooth mechanism's cube-supported observational law, inclusion after the compact-cube retraction is almost everywhere the ambient identity. the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
θ :
Proof (Lean source)
lemma compactCubeInclude_retract_ae_observationalLaw {n : ℕ} {G : DAG (Fin n)} (θ : Mechanism n G) : (compactCubeInclude n ∘ compactCubeRetract n) =ᵐ[observationalLaw θ] id := by have hcube : MeasurableSet (latentCube n) := by rw [latentCube] exact MeasurableSet.univ_pi fun _ ↦ measurableSet_Icc have hbase : (compactCubeInclude n ∘ compactCubeRetract n) =ᵐ[volume.restrict (latentCube n)] id := by filter_upwards [ae_restrict_mem hcube] with v hv simpa only [Function.comp_apply, id_eq] using compactCubeInclude_retract_of_mem hv exact (withDensity_absolutelyContinuous _ _).ae_le hbase
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.compactCubeInclude_retract_ae_observationalLaw · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CompactCubeBridge.lean:122
theorem map_compactCubeInclude_map_compactCubeRetract_observationalLaw

Pushing a cube-supported observational law to compact coordinates and including it back recovers the original ambient law. the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
θ :
Measure.map (compactCubeInclude n) (Measure.map (compactCubeRetract n) (observationalLaw θ))
Proof (Lean source)
lemma map_compactCubeInclude_map_compactCubeRetract_observationalLaw {n : ℕ} {G : DAG (Fin n)} (θ : Mechanism n G) : Measure.map (compactCubeInclude n) (Measure.map (compactCubeRetract n) (observationalLaw θ)) = observationalLaw θ := by rw [Measure.map_map (measurable_compactCubeInclude n) (measurable_compactCubeRetract n)] rw [Measure.map_congr (compactCubeInclude_retract_ae_observationalLaw θ)] exact Measure.map_id
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.map_compactCubeInclude_map_compactCubeRetract_observationalLaw · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CompactCubeBridge.lean:137
theorem map_compactCubeRetract_map_compactCubeInclude

For every compact-coordinate measure, inclusion followed by retraction also recovers the original measure. the stated conclusion follows.

Formal statement
n :
μ :
Measure ((i : Fin n) → Icc (0 : ℝ) 1)
Measure.map (compactCubeRetract n) (Measure.map (compactCubeInclude n) μ) = μ
Proof (Lean source)
lemma map_compactCubeRetract_map_compactCubeInclude {n : ℕ} (μ : Measure ((i : Fin n) → Icc (0 : ℝ) 1)) : Measure.map (compactCubeRetract n) (Measure.map (compactCubeInclude n) μ) = μ := by rw [Measure.map_map (measurable_compactCubeRetract n) (measurable_compactCubeInclude n)] rw [compactCubeRetract_include] exact Measure.map_id
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.map_compactCubeRetract_map_compactCubeInclude · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CompactCubeBridge.lean:150
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.CondIndepIntersection 10 declarations This file scaffolds the positivity-based graphoid intersection step and the finite-coordinate product bridge used with Causalean's generic weak-union lemma.

Conditional-independence bridges for parent pruning

This file scaffolds the positivity-based graphoid intersection step and the finite-coordinate product bridge used with Causalean's generic weak-union lemma.

def observedLatentCoordinate

The latent coordinate targeted by an environment label, expressed on observed space.

Definition (Lean source)
n :
DAG (Fin n)
W :
e :
Fin n
observedLatentCoordinate W e :
LatentState n → ℝ
by classical exact (observedSupport G W).piecewise (fun x => W.unmix x (W.targetPerm e)) (fun _ => 0)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedLatentCoordinate · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CondIndepIntersection.lean:21
theorem measurable_observedLatentCoordinate

The support-restricted version of an observed latent coordinate is measurable; on the observed support it is exactly the corresponding coordinate of the inverse mixing map. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
e :
Fin n
Proof (Lean source)
lemma measurable_observedLatentCoordinate {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hmix : SharedDiffeomorphicMixing G θ W) (e : Fin n) : Measurable (observedLatentCoordinate W e) := by classical have hcube : IsCompact (latentCube n) := by rw [latentCube] exact isCompact_univ_pi fun _ => isCompact_Icc have hs : IsClosed (observedSupport G W) := (hcube.image_of_continuousOn hmix.1.continuousOn).isClosed unfold observedLatentCoordinate exact ((continuous_apply (W.targetPerm e)).comp_continuousOn hmix.2.1.continuousOn) |>.measurable_piecewise continuous_const.continuousOn hs.measurableSet
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.measurable_observedLatentCoordinate · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CondIndepIntersection.lean:31
theorem observedLatentCoordinate_mix

On the latent cube, the measurable observed coordinate version recovers the targeted latent coordinate after applying the mixing map. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
e :
Fin n
v :
hv :
v ∈ latentCube n
observedLatentCoordinate W e (W.mix v) = v (W.targetPerm e)
Proof (Lean source)
lemma observedLatentCoordinate_mix {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hmix : SharedDiffeomorphicMixing G θ W) (e : Fin n) (v : LatentState n) (hv : v ∈ latentCube n) : observedLatentCoordinate W e (W.mix v) = v (W.targetPerm e) := by classical rw [observedLatentCoordinate, Set.piecewise_eq_of_mem] · exact congrFun (hmix.2.2.1 v hv) (W.targetPerm e) · exact ⟨v, hv, rfl⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedLatentCoordinate_mix · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CondIndepIntersection.lean:48

Conditional independence is equivalent before and after transporting the ambient law along a measurable map. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
hphi :
f :
B → X
hf :
g :
B → Y
hg :
k :
B → Z
hk :
IsFiniteMeasure (mu.map phi)
CondIndepFun (comap (k ∘ phi) inferInstance) (hk.comp hphi).comap_le (f ∘ phi) (g ∘ phi) mu
CondIndepFun (comap k inferInstance) hk.comap_le f g (mu.map phi)
Proof (Lean source)
lemma condIndepFun_map_iff {A B X Y Z : Type*} [MeasurableSpace A] [StandardBorelSpace A] [MeasurableSpace B] [StandardBorelSpace B] [MeasurableSpace X] [StandardBorelSpace X] [Nonempty X] [MeasurableSpace Y] [StandardBorelSpace Y] [Nonempty Y] [MeasurableSpace Z] {phi : A → B} (hphi : Measurable phi) {f : B → X} (hf : Measurable f) {g : B → Y} (hg : Measurable g) {k : B → Z} (hk : Measurable k) {mu : Measure A} [IsFiniteMeasure mu] [IsFiniteMeasure (mu.map phi)] : CondIndepFun (comap (k ∘ phi) inferInstance) (hk.comp hphi).comap_le (f ∘ phi) (g ∘ phi) mu ↔ CondIndepFun (comap k inferInstance) hk.comap_le f g (mu.map phi) := by have hcd1 : condDistrib (g ∘ phi) (k ∘ phi) mu = condDistrib g k (mu.map phi) := by simp only [condDistrib] congr 1 exact (Measure.map_map (hk.prodMk hg) hphi).symm have hcd2 : condDistrib (g ∘ phi) (fun a ↦ ((k ∘ phi) a, (f ∘ phi) a)) mu = condDistrib g (fun b ↦ (k b, f b)) (mu.map phi) := by simp only [condDistrib] congr 1 exact (Measure.map_map ((hk.prodMk hf).prodMk hg) hphi).symm have hmap : mu.map (fun a ↦ ((k ∘ phi) a, (f ∘ phi) a)) = (mu.map phi).map (fun b ↦ (k b, f b)) := (Measure.map_map (hk.prodMk hf) hphi).symm rw [condIndepFun_iff_condDistrib_prod_ae_eq_prodMkRight (hg.comp hphi) (hf.comp hphi) (hk.comp hphi), condIndepFun_iff_condDistrib_prod_ae_eq_prodMkRight hg hf hk, hcd2, hcd1, hmap]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.condIndepFun_map_iff · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CondIndepIntersection.lean:61
theorem condIndepGiven_map_iff

Pulling three measurable variables back along a measurable map preserves and reflects conditional independence when the target law is the corresponding pushforward. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
hphi :
f :
B → X
hf :
g :
B → Y
hg :
k :
B → Z
hk :
IsFiniteMeasure (mu.map phi)
CondIndepGiven mu (f ∘ phi) (g ∘ phi) (k ∘ phi) ↔ CondIndepGiven (mu.map phi) f g k
Proof (Lean source)
lemma condIndepGiven_map_iff {A B X Y Z : Type*} [MeasurableSpace A] [StandardBorelSpace A] [MeasurableSpace B] [StandardBorelSpace B] [MeasurableSpace X] [StandardBorelSpace X] [Nonempty X] [MeasurableSpace Y] [StandardBorelSpace Y] [Nonempty Y] [MeasurableSpace Z] {phi : A → B} (hphi : Measurable phi) {f : B → X} (hf : Measurable f) {g : B → Y} (hg : Measurable g) {k : B → Z} (hk : Measurable k) {mu : Measure A} [IsFiniteMeasure mu] [IsFiniteMeasure (mu.map phi)] : CondIndepGiven mu (f ∘ phi) (g ∘ phi) (k ∘ phi) ↔ CondIndepGiven (mu.map phi) f g k := by constructor · rintro ⟨_, _, _, _, hCI⟩ refine ⟨inferInstance, hf, hg, hk, ?_⟩ exact (condIndepFun_map_iff hphi hf hg hk).1 hCI · rintro ⟨_, _, _, _, hCI⟩ refine ⟨inferInstance, hf.comp hphi, hg.comp hphi, hk.comp hphi, ?_⟩ exact (condIndepFun_map_iff hphi hf hg hk).2 hCI
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.condIndepGiven_map_iff · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CondIndepIntersection.lean:97
theorem condIndepGiven_measurableEquiv_comp

Applying bimeasurable bijections separately to the two variables and the conditioning variable preserves conditional independence. the stated conclusion follows.

Formal statement
UX :
Ω → X
UY :
Ω → Y
UZ :
Ω → Z
eX :
X ≃ᵐ X'
eY :
Y ≃ᵐ Y'
eZ :
Z ≃ᵐ Z'
CondIndepGiven μ (eX ∘ UX) (eY ∘ UY) (eZ ∘ UZ) ↔ CondIndepGiven μ UX UY UZ
Proof (Lean source)
lemma condIndepGiven_measurableEquiv_comp {Ω X Y Z X' Y' Z' : Type*} [MeasurableSpace Ω] [StandardBorelSpace Ω] [MeasurableSpace X] [MeasurableSpace Y] [MeasurableSpace Z] [MeasurableSpace X'] [MeasurableSpace Y'] [MeasurableSpace Z'] {μ : Measure Ω} (UX : Ω → X) (UY : Ω → Y) (UZ : Ω → Z) (eX : X ≃ᵐ X') (eY : Y ≃ᵐ Y') (eZ : Z ≃ᵐ Z') : CondIndepGiven μ (eX ∘ UX) (eY ∘ UY) (eZ ∘ UZ) ↔ CondIndepGiven μ UX UY UZ := by constructor · rintro ⟨hμ, hX, hY, hZ, hCI⟩ letI := hμ have hX' : Measurable UX := by convert eX.symm.measurable.comp hX using 1 funext ω exact (eX.symm_apply_apply (UX ω)).symm have hY' : Measurable UY := by convert eY.symm.measurable.comp hY using 1 funext ω exact (eY.symm_apply_apply (UY ω)).symm have hZ' : Measurable UZ := by convert eZ.symm.measurable.comp hZ using 1 funext ω exact (eZ.symm_apply_apply (UZ ω)).symm refine ⟨hμ, hX', hY', hZ', ?_⟩ have hraw := hCI.comp eX.symm.measurable eY.symm.measurable have hs : CondIndepFun (comap (eZ ∘ UZ) inferInstance) hZ.comap_le UX UY μ := by simpa only [Function.comp_def, eX.symm_apply_apply, eY.symm_apply_apply] using hraw simpa only [← MeasurableSpace.comap_comp, eZ.measurableEmbedding.comap_eq] using hs · rintro ⟨hμ, hX, hY, hZ, hCI⟩ letI := hμ refine ⟨hμ, eX.measurable.comp hX, eY.measurable.comp hY, eZ.measurable.comp hZ, ?_⟩ have hraw := hCI.comp eX.measurable eY.measurable simpa only [← MeasurableSpace.comap_comp, eZ.measurableEmbedding.comap_eq] using hraw
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.condIndepGiven_measurableEquiv_comp · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CondIndepIntersection.lean:121
theorem condIndepGiven_congr_ae_forward

Replacing all three measurable coordinates by almost-everywhere equal versions preserves conditional independence. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
Ω X Y Z :
hX₁ :
hX₂ :
hY₁ :
hY₂ :
hZ₁ :
hZ₂ :
hX :
X₁ =ᵐ[μ] X₂
hY :
Y₁ =ᵐ[μ] Y₂
hZ :
Z₁ =ᵐ[μ] Z₂
CondIndepGiven μ X₁ Y₁ Z₁
CondIndepGiven μ X₂ Y₂ Z₂
Proof (Lean source)
lemma condIndepGiven_congr_ae_forward {Ω X Y Z : Type*} [MeasurableSpace Ω] [StandardBorelSpace Ω] [MeasurableSpace X] [StandardBorelSpace X] [Nonempty X] [MeasurableSpace Y] [StandardBorelSpace Y] [Nonempty Y] [MeasurableSpace Z] {μ : Measure Ω} {X₁ X₂ : Ω → X} {Y₁ Y₂ : Ω → Y} {Z₁ Z₂ : Ω → Z} (hX₁ : Measurable X₁) (hX₂ : Measurable X₂) (hY₁ : Measurable Y₁) (hY₂ : Measurable Y₂) (hZ₁ : Measurable Z₁) (hZ₂ : Measurable Z₂) (hX : X₁ =ᵐ[μ] X₂) (hY : Y₁ =ᵐ[μ] Y₂) (hZ : Z₁ =ᵐ[μ] Z₂) : CondIndepGiven μ X₁ Y₁ Z₁ → CondIndepGiven μ X₂ Y₂ Z₂ := by rintro ⟨hμ, _, _, _, hCI⟩ letI := hμ refine ⟨hμ, hX₂, hY₂, hZ₂, ?_⟩ rw [condIndepFun_iff_condDistrib_prod_ae_eq_prodMkRight hY₂ hX₂ hZ₂] rw [condIndepFun_iff_condDistrib_prod_ae_eq_prodMkRight hY₁ hX₁ hZ₁] at hCI have hZY : (fun ω => (Z₁ ω, Y₁ ω)) =ᵐ[μ] fun ω => (Z₂ ω, Y₂ ω) := hZ.prodMk hY have hZX : (fun ω => (Z₁ ω, X₁ ω)) =ᵐ[μ] fun ω => (Z₂ ω, X₂ ω) := hZ.prodMk hX have hZXY := (hZ.prodMk hX).prodMk hY simpa only [condDistrib, Measure.map_congr hZY, Measure.map_congr hZX, Measure.map_congr hZXY] using hCI
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.condIndepGiven_congr_ae_forward · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CondIndepIntersection.lean:164
theorem condIndepGiven_congr_ae

Conditional independence is invariant under almost-everywhere replacement of each of its three measurable coordinates. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
Ω X Y Z :
hX₁ :
hX₂ :
hY₁ :
hY₂ :
hZ₁ :
hZ₂ :
hX :
X₁ =ᵐ[μ] X₂
hY :
Y₁ =ᵐ[μ] Y₂
hZ :
Z₁ =ᵐ[μ] Z₂
CondIndepGiven μ X₁ Y₁ Z₁ ↔ CondIndepGiven μ X₂ Y₂ Z₂
Proof (Lean source)
lemma condIndepGiven_congr_ae {Ω X Y Z : Type*} [MeasurableSpace Ω] [StandardBorelSpace Ω] [MeasurableSpace X] [StandardBorelSpace X] [Nonempty X] [MeasurableSpace Y] [StandardBorelSpace Y] [Nonempty Y] [MeasurableSpace Z] {μ : Measure Ω} {X₁ X₂ : Ω → X} {Y₁ Y₂ : Ω → Y} {Z₁ Z₂ : Ω → Z} (hX₁ : Measurable X₁) (hX₂ : Measurable X₂) (hY₁ : Measurable Y₁) (hY₂ : Measurable Y₂) (hZ₁ : Measurable Z₁) (hZ₂ : Measurable Z₂) (hX : X₁ =ᵐ[μ] X₂) (hY : Y₁ =ᵐ[μ] Y₂) (hZ : Z₁ =ᵐ[μ] Z₂) : CondIndepGiven μ X₁ Y₁ Z₁ ↔ CondIndepGiven μ X₂ Y₂ Z₂ := by constructor · exact condIndepGiven_congr_ae_forward hX₁ hX₂ hY₁ hY₂ hZ₁ hZ₂ hX hY hZ · exact condIndepGiven_congr_ae_forward hX₂ hX₁ hY₂ hY₁ hZ₂ hZ₁ hX.symm hY.symm hZ.symm
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.condIndepGiven_congr_ae · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CondIndepIntersection.lean:192
theorem condIndep_intersection_of_pos

Positivity-based graphoid intersection for four disjoint latent-coordinate blocks on the paper's full product support. The disjointness hypotheses are the internal DAG bookkeeping used in equations (15)--(18); they are not assumptions of the delivered decoder theorem. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
i b :
Fin n
C Z :
hib :
i ≠ b
hiC :
i ∉ C
hiZ :
i ∉ Z
hbC :
b ∉ C
hbZ :
b ∉ Z
hCZ :
Proof (Lean source)
-- @node: condIndep_intersection_of_pos lemma condIndep_intersection_of_pos {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (i b : Fin n) (C Z : Finset (Fin n)) (hib : i ≠ b) (hiC : i ∉ C) (hiZ : i ∉ Z) (hbC : b ∉ C) (hbZ : b ∉ Z) (hCZ : Disjoint C Z) (h₁ : CondIndepGiven (W.law 0) (observedLatentCoordinate W i) (observedLatentCoordinate W b) (fun x => (familyProjection (observedLatentCoordinate W) Z x, familyProjection (observedLatentCoordinate W) C x))) (h₂ : CondIndepGiven (W.law 0) (observedLatentCoordinate W i) (familyProjection (observedLatentCoordinate W) C) (fun x => (familyProjection (observedLatentCoordinate W) Z x, observedLatentCoordinate W b x))) : CondIndepGiven (W.law 0) (observedLatentCoordinate W i) (observedLatentCoordinate W b) (familyProjection (observedLatentCoordinate W) Z) ∧ CondIndepGiven (W.law 0) (observedLatentCoordinate W i) (fun x => (observedLatentCoordinate W b x, familyProjection (observedLatentCoordinate W) C x)) (familyProjection (observedLatentCoordinate W) Z) := by classical let unit : Measure ℝ := volume.restrict (Icc (0 : ℝ) 1) letI : IsProbabilityMeasure unit := ⟨by simp [unit, Real.volume_Icc]⟩ let ref := CausalSmith.Substrate.PositiveDensityCondindepIntersection.fourBlockReference unit unit (Measure.pi fun _ : C ↦ unit) (Measure.pi fun _ : Z ↦ unit) let Fobs : LatentState n → CausalSmith.Substrate.PositiveDensityCondindepIntersection.FourBlock ℝ ℝ (ValuesOn C (fun _ ↦ ℝ)) (ValuesOn Z (fun _ ↦ ℝ)) := fun x ↦ (observedLatentCoordinate W i x, (observedLatentCoordinate W b x, (familyProjection (observedLatentCoordinate W) C x, familyProjection (observedLatentCoordinate W) Z x))) let Flat : LatentState n → CausalSmith.Substrate.PositiveDensityCondindepIntersection.FourBlock ℝ ℝ (ValuesOn C (fun _ ↦ ℝ)) (ValuesOn Z (fun _ ↦ ℝ)) := fun v ↦ (v (W.targetPerm i), (v (W.targetPerm b), (familyProjection (fun e w ↦ w (W.targetPerm e)) C v, familyProjection (fun e w ↦ w (W.targetPerm e)) Z v))) rcases h₁ with ⟨hfinite, hUi, hUb, hZC, hCI₁⟩ letI : IsFiniteMeasure (W.law 0) := hfinite rcases h₂ with ⟨_, _, hUC, hZb, hCI₂⟩ have hUZ : Measurable (familyProjection (observedLatentCoordinate W) Z) := measurable_fst.comp hZC have hUC' : Measurable (familyProjection (observedLatentCoordinate W) C) := measurable_snd.comp hZC have hFobs : Measurable Fobs := hUi.prodMk (hUb.prodMk (hUC'.prodMk hUZ)) have hFlat : Measurable Flat := (measurable_pi_apply _).prodMk ((measurable_pi_apply _).prodMk ((measurable_pi_lambda _ fun _ : C ↦ measurable_pi_apply _).prodMk (measurable_pi_lambda _ fun _ : Z ↦ measurable_pi_apply _))) let fullRef : Measure (LatentState n) := Measure.pi fun _ : Fin n ↦ unit have hcubeRef : volume.restrict (latentCube n) = fullRef := by change volume.restrict (Set.univ.pi fun _ : Fin n ↦ Icc (0 : ℝ) 1) = _ rw [MeasureTheory.volume_pi, Measure.restrict_pi_pi] let dens : LatentState n → ENNReal := fun v ↦ ofReal (observationalDensity θ v) have hdensOn : ContinuousOn dens (latentCube n) := by apply ENNReal.continuous_ofReal.comp_continuousOn unfold observationalDensity exact continuousOn_finset_prod _ fun k _ ↦ (hpos.2.2.1 k).continuousOn have hcube : MeasurableSet (latentCube n) := by rw [latentCube] measurability have hdensAE : AEMeasurable dens (volume.restrict (latentCube n)) := aemeasurable_restrict_of_measurable_subtype hcube hdensOn.restrict.measurable have hdens_ne : ∀ᵐ v ∂volume.restrict (latentCube n), dens v ≠ 0 := by filter_upwards [ae_restrict_mem hcube] with v hv have hp : 0 < observationalDensity θ v := by unfold observationalDensity exact Finset.prod_pos fun k _ ↦ hpos.1 k v hv exact (ENNReal.ofReal_pos.mpr hp).ne' have hobs_forward : observationalLaw θ ≪ fullRef := by rw [← hcubeRef] exact withDensity_absolutelyContinuous _ _ have hobs_reverse : fullRef ≪ observationalLaw θ := by rw [← hcubeRef] exact withDensity_absolutelyContinuous' hdensAE hdens_ne have hFlatRef : Measure.map Flat fullRef = ref := by simpa only [Flat, fullRef, ref] using (map_permuted_scalar_fourBlockProjection_pi i b C Z hib hiC hiZ hbC hbZ hCZ W.targetPerm unit) have hlatent_forward : Measure.map Flat (observationalLaw θ) ≪ ref := by rw [← hFlatRef] exact @Measure.AbsolutelyContinuous.map _ _ _ _ _ _ hobs_forward Flat hFlat have hlatent_reverse : ref ≪ Measure.map Flat (observationalLaw θ) := by rw [← hFlatRef] exact @Measure.AbsolutelyContinuous.map _ _ _ _ _ _ hobs_reverse Flat hFlat have hobs_cube : observationalLaw θ (latentCube n)ᶜ = 0 := hobs_forward (by rw [← hcubeRef, Measure.restrict_apply hcube.compl] simp) have hcube_ae : ∀ᵐ v ∂observationalLaw θ, v ∈ latentCube n := by rw [ae_iff] change observationalLaw θ (latentCube n)ᶜ = 0 exact hobs_cube let mix' : LatentState n → LatentState n := (latentCube n).piecewise W.mix (fun _ ↦ 0) have hmix' : Measurable mix' := by exact hmix.1.continuousOn.measurable_piecewise continuous_const.continuousOn hcube have hmix_eq : W.mix =ᵐ[observationalLaw θ] mix' := by filter_upwards [hcube_ae] with v hv simp [mix', Set.piecewise, hv] have hcomp : Fobs ∘ mix' =ᵐ[observationalLaw θ] Flat := by filter_upwards [hmix_eq, hcube_ae] with v hmv hv change Fobs (mix' v) = Flat v rw [← hmv] have hinv := hmix.2.2.1 v hv simp only [Fobs, Flat, Function.comp_apply, familyProjection] apply Prod.ext · exact observedLatentCoordinate_mix W hmix i v hv apply Prod.ext · exact observedLatentCoordinate_mix W hmix b v hv apply Prod.ext · funext a exact observedLatentCoordinate_mix W hmix a v hv · funext a exact observedLatentCoordinate_mix W hmix a v hv have hlaw : W.law 0 = Measure.map mix' (observationalLaw θ) := by rw [hone.1] exact Measure.map_congr hmix_eq have hjoint : Measure.map Fobs (W.law 0) = Measure.map Flat (observationalLaw θ) := by rw [hlaw] calc Measure.map Fobs (Measure.map mix' (observationalLaw θ)) = Measure.map (Fobs ∘ mix') (observationalLaw θ) := Measure.map_map hFobs hmix' _ = Measure.map Flat (observationalLaw θ) := Measure.map_congr hcomp have hforward : Measure.map Fobs (W.law 0) ≪ ref := by rw [hjoint] exact hlatent_forward have hreverse : ref ≪ Measure.map Fobs (W.law 0) := by rw [hjoint] exact hlatent_reverse apply condIndepGiven_intersection_of_equivalent_fourBlock (observedLatentCoordinate W i) (observedLatentCoordinate W b) (familyProjection (observedLatentCoordinate W) C) (familyProjection (observedLatentCoordinate W) Z) hUi hUb hUC' hUZ unit unit (Measure.pi fun _ : C ↦ unit) (Measure.pi fun _ : Z ↦ unit) hforward hreverse · exact ⟨hfinite, hUi, hUb, hZC, hCI₁⟩ · exact ⟨hfinite, hUi, hUC, hZb, hCI₂⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.condIndep_intersection_of_pos · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CondIndepIntersection.lean:629
theorem condIndep_coordSplit_prodMk

Coordinate-pair presentation of generic weak union for a finite family of measurable maps. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
U :
Fin n → Ω → ℝ
i b :
Fin n
A S :
hU :
∀ c, Measurable (U c)
hA :
A ⊆ S
hb :
b ∈ S
hbA :
b ∉ A
hCI :
conclusion 2
CondIndepGiven μ (U i) (U b) (familyProjection U (S.erase b))
Proof (Lean source)
-- @node: condIndep_coordSplit_prodMk lemma condIndep_coordSplit_prodMk {Ω : Type*} [MeasurableSpace Ω] [StandardBorelSpace Ω] {μ : Measure Ω} [IsFiniteMeasure μ] {n : ℕ} (U : Fin n → Ω → ℝ) (i b : Fin n) (A S : Finset (Fin n)) (hU : ∀ c, Measurable (U c)) (hA : A ⊆ S) (hb : b ∈ S) (hbA : b ∉ A) (hCI : CondIndepGiven μ (U i) (familyProjection U (S \ A)) (familyProjection U A)) : (comap (familyProjection U A) inferInstancecomap (familyProjection U ((S \ A).erase b)) inferInstance = comap (familyProjection U (S.erase b)) inferInstance) ∧ CondIndepGiven μ (U i) (U b) (familyProjection U (S.erase b)) := by have hproj (T : Finset (Fin n)) : Measurable (familyProjection U T) := by apply measurable_pi_lambda intro j exact hU j have hbDiff : b ∈ S \ A := Finset.mem_sdiff.mpr ⟨hb, hbA⟩ let split : ((j : {j // j ∈ S \ A}) → ℝ) → ℝ × ((j : {j // j ∈ (S \ A).erase b}) → ℝ) := fun x => (x ⟨b, hbDiff⟩, fun j => x ⟨j, Finset.mem_sdiff.mpr (Finset.mem_sdiff.mp (Finset.mem_erase.mp j.2).2)⟩) have hsplit : Measurable split := by apply Measurable.prod · exact measurable_pi_apply _ · apply measurable_pi_lambda intro j exact measurable_pi_apply _ have hCIpair : CondIndepGiven μ (U i) (fun ω => (U b ω, familyProjection U ((S \ A).erase b) ω)) (familyProjection U A) := by rcases hCI with ⟨hμ, hXi, hY, hZA, hCI⟩ refine ⟨hμ, hXi, (hU b).prod (hproj _), hZA, ?_⟩ convert hCI.comp measurable_id hsplit using 1 <;> ext ω j <;> rfl have hsigma : comap (familyProjection U A) inferInstancecomap (familyProjection U ((S \ A).erase b)) inferInstance = comap (familyProjection U (S.erase b)) inferInstance := by apply le_antisymm · apply sup_le · have hm : @Measurable Ω _ (comap (familyProjection U (S.erase b)) inferInstance) inferInstance (familyProjection U A) := by letI : MeasurableSpace Ω := comap (familyProjection U (S.erase b)) inferInstance refine measurable_pi_lambda _ (fun j => ?_) have hjS : (j : Fin n) ∈ S.erase b := Finset.mem_erase.mpr ⟨by intro h; subst b; exact hbA j.2, hA j.2⟩ have heval : Measurable (fun x : ((j : {j // j ∈ S.erase b}) → ℝ) => x ⟨j, hjS⟩) := measurable_pi_apply _ convert heval.comp (Measurable.of_comap_le le_rfl) using 1 funext c rfl exact hm.comap_le · have hm : @Measurable Ω _ (comap (familyProjection U (S.erase b)) inferInstance) inferInstance (familyProjection U ((S \ A).erase b)) := by letI : MeasurableSpace Ω := comap (familyProjection U (S.erase b)) inferInstance refine measurable_pi_lambda _ (fun j => ?_) have hjS : (j : Fin n) ∈ S.erase b := by rcases Finset.mem_erase.mp j.2 with ⟨hjb, hjSA⟩ exact Finset.mem_erase.mpr ⟨hjb, (Finset.mem_sdiff.mp hjSA).1⟩ have heval : Measurable (fun x : ((j : {j // j ∈ S.erase b}) → ℝ) => x ⟨j, hjS⟩) := measurable_pi_apply _ convert heval.comp (Measurable.of_comap_le le_rfl) using 1 funext c rfl exact hm.comap_le · have hm : @Measurable Ω _ (comap (familyProjection U A) inferInstancecomap (familyProjection U ((S \ A).erase b)) inferInstance) inferInstance (familyProjection U (S.erase b)) := by letI : MeasurableSpace Ω := comap (familyProjection U A) inferInstancecomap (familyProjection U ((S \ A).erase b)) inferInstance refine measurable_pi_lambda _ (fun j => ?_) rcases Finset.mem_erase.mp j.2 with ⟨hjb, hjS⟩ by_cases hjA : (j : Fin n) ∈ A · have heval : Measurable (fun x : ((j : {j // j ∈ A}) → ℝ) => x ⟨j, hjA⟩) := measurable_pi_apply _ convert heval.comp (Measurable.of_comap_le le_sup_left) using 1 funext c rfl · have hjRest : (j : Fin n) ∈ (S \ A).erase b := Finset.mem_erase.mpr ⟨hjb, Finset.mem_sdiff.mpr ⟨hjS, hjA⟩⟩ have heval : Measurable (fun x : ((j : {j // j ∈ (S \ A).erase b}) → ℝ) => x ⟨j, hjRest⟩) := measurable_pi_apply _ convert heval.comp (Measurable.of_comap_le le_sup_right) using 1 funext c rfl exact hm.comap_le refine ⟨hsigma, ?_⟩ rcases hCIpair with ⟨hμ, hXi, hPair, hZA, hCIpair⟩ refine ⟨hμ, hXi, hU b, hproj _, ?_⟩ have hraw := condIndepFun_weak_union_of_prodMk hZA.comap_le (hU i) (hU b) (hproj ((S \ A).erase b)) hCIpair simpa only [hsigma] using hraw
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.condIndep_coordSplit_prodMk · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/CondIndepIntersection.lean:784
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.ContrastIntegral 1 declarations This file isolates the density cancellation that rewrites a canonical second-moment contrast as the rational mechanism integral used by both the explicit sparse witness and the analytic perturbation argument.

Canonical second-moment contrast integral

This file isolates the density cancellation that rewrites a canonical second-moment contrast as the rational mechanism integral used by both the explicit sparse witness and the analytic perturbation argument.

theorem canonical_secondMomentContrast_eq_integral_for_witness

For a positive normalized mechanism and distinct intervention and ratio targets, the canonical second-moment contrast equals the rational mechanism integral obtained by cancelling the observational child-density factor. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
j i :
Fin n
hji :
j ≠ i
= ∫ v in latentCube n, (θ.q i (v i)) ^ 2 * (θ.q j (v j) - θ.p j v) * (∏ l ∈ (Finset.univ.erase i).erase j, θ.p l v) / θ.p i v
Proof (Lean source)
-- @node: canonical_secondMomentContrast_eq_integral_for_witness lemma canonical_secondMomentContrast_eq_integral_for_witness {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (hpos : PositiveNormalizedSmoothMechanisms G θ) {j i : Fin n} (hji : j ≠ i) : secondMomentContrast (canonicalObservedWorld G θ (refl (Fin n))) j i = ∫ v in latentCube n, (θ.q i (v i)) ^ 2 * (θ.q j (v j) - θ.p j v) * (∏ l ∈ (Finset.univ.erase i).erase j, θ.p l v) / θ.p i v := by let μ : Measure (LatentState n) := volume.restrict (latentCube n) let r : LatentState n → ℝ := fun v => θ.q i (v i) / θ.p i v have hcube : MeasurableSet (latentCube n) := by rw [latentCube] exact MeasurableSet.univ_pi fun _ => measurableSet_Icc have hcubeCompact : IsCompact (latentCube n) := by rw [latentCube] exact isCompact_univ_pi fun _ => isCompact_Icc have hpcont (l : Fin n) : ContinuousOn (θ.p l) (latentCube n) := (hpos.2.2.1 l).continuousOn have hqcont (l : Fin n) : ContinuousOn (fun v : LatentState n => θ.q l (v l)) (latentCube n) := (hpos.2.2.2.1 l).continuousOn.comp ((continuous_apply l).continuousOn) (fun v hv => hv l (Set.mem_univ l)) have hrcont : ContinuousOn r (latentCube n) := by exact (hqcont i).div (hpcont i) fun v hv => ne_of_gt (hpos.1 i v hv) have hobscont : ContinuousOn (observationalDensity θ) (latentCube n) := by unfold observationalDensity exact continuousOn_finsetProd _ fun l _ => hpcont l have hintcont : ContinuousOn (interventionalDensity θ j) (latentCube n) := by unfold interventionalDensity exact (hqcont j).mul (continuousOn_finsetProd _ fun l _ => hpcont l) have hobsint : Integrable (fun v => observationalDensity θ v * r v ^ 2) μ := by exact (hobscont.mul (hrcont.pow 2)).integrableOn_compact hcubeCompact have hintint : Integrable (fun v => interventionalDensity θ j v * r v ^ 2) μ := by exact (hintcont.mul (hrcont.pow 2)).integrableOn_compact hcubeCompact have hobs : (∫ v, r v ^ 2 ∂observationalLaw θ) = ∫ v, observationalDensity θ v * r v ^ 2 ∂μ := by unfold observationalLaw rw [integral_withDensity_eq_integral_toReal_smul₀] · apply integral_congr_ae filter_upwards [ae_restrict_mem hcube] with v hv rw [ENNReal.toReal_ofReal (le_of_lt (by unfold observationalDensity exact Finset.prod_pos fun l _ => hpos.1 l v hv))] rfl · exact (hobscont.aestronglyMeasurable hcube).aemeasurable.ennreal_ofReal · filter_upwards with v exact ENNReal.ofReal_lt_top have hint : (∫ v, r v ^ 2 ∂interventionalLaw θ j) = ∫ v, interventionalDensity θ j v * r v ^ 2 ∂μ := by unfold interventionalLaw rw [integral_withDensity_eq_integral_toReal_smul₀] · apply integral_congr_ae filter_upwards [ae_restrict_mem hcube] with v hv rw [ENNReal.toReal_ofReal (le_of_lt (by unfold interventionalDensity exact mul_pos (hpos.2.1 j (v j) (hv j (Set.mem_univ j))) (Finset.prod_pos fun l _ => hpos.1 l v hv)))] rfl · exact (hintcont.aestronglyMeasurable hcube).aemeasurable.ennreal_ofReal · filter_upwards with v exact ENNReal.ofReal_lt_top unfold secondMomentContrast change (∫ v, r v ^ 2 ∂interventionalLaw θ j) - (∫ v, r v ^ 2 ∂observationalLaw θ) = _ rw [hint, hobs, ← integral_sub hintint hobsint] apply integral_congr_ae filter_upwards [ae_restrict_mem hcube] with v hv have hpi : θ.p i v ≠ 0 := ne_of_gt (hpos.1 i v hv) have hinterDensity : interventionalDensity θ j v = θ.q j (v j) * θ.p i v * (∏ l ∈ (Finset.univ.erase i).erase j, θ.p l v) := by unfold interventionalDensity have hprod : (∏ l ∈ Finset.univ.erase j, θ.p l v) = θ.p i v * (∏ l ∈ (Finset.univ.erase j).erase i, θ.p l v) := by rw [Finset.prod_eq_mul_prod_sdiff_singleton_of_mem (Finset.mem_erase.mpr ⟨Ne.symm hji, Finset.mem_univ i⟩)] simp only [Finset.sdiff_singleton_eq_erase] rw [hprod, Finset.erase_right_comm] ring have hobsDensity : observationalDensity θ v = θ.p i v * θ.p j v * (∏ l ∈ (Finset.univ.erase i).erase j, θ.p l v) := by unfold observationalDensity rw [Finset.prod_eq_mul_prod_sdiff_singleton_of_mem (Finset.mem_univ i)] simp only [Finset.sdiff_singleton_eq_erase] rw [Finset.prod_eq_mul_prod_sdiff_singleton_of_mem (Finset.mem_erase.mpr ⟨hji, Finset.mem_univ j⟩)] simp only [Finset.sdiff_singleton_eq_erase] ring unfold r rw [hinterDensity, hobsDensity] field_simp
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.canonical_secondMomentContrast_eq_integral_for_witness · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/ContrastIntegral.lean:18
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.Decoder 45 declarations The decoder is a function only of the observed probability laws.

Population ratio and conditional-rank decoder

The decoder is a function only of the observed probability laws. It selects a topological ordering internally, constructs [0,1]-valued conditional ranks, and prunes to the unique minimal admissible parent sets on the model domain.

A numerical linear extension of a directed relation. Injectivity excludes tied labels.

Definition (Lean source)
n :
shared
E :
Fin n → Fin n → Prop
order :
Fin n → ℕ
IsTopologicalOrdering E order :
Prop
clause 1
Injective order
clause 2
j i :
E j i
order j < order i
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.IsTopologicalOrdering · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:24
def predecessorSet

Labels preceding i in the explicitly selected ordering.

Definition (Lean source)
n :
shared
order :
Fin n → ℕ
i :
Fin n
predecessorSet order i :
Finset.univ.filter (fun j => order j < order i)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.predecessorSet · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:28
def familyProjection

Projection of a coordinate family onto a finite index set.

Definition (Lean source)
n :
shared
X Y :
Type*
U :
Fin n → X → Y
S :
x :
X
j :
{j // j ∈ S}
familyProjection U S x j :
Y
fun j => U j x
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.familyProjection · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:33
def ObservedProbabilityLawFamily

A decoder input consists of genuine probability laws in all n+1 environments.

Definition (Lean source)
n :
ObservedProbabilityLawFamily n :
Type
{laws : ObservedLawFamily n // ∀ e, IsProbabilityMeasure (laws e)}
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.ObservedProbabilityLawFamily · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:37
def observedProbabilityLawFamily

Turn a measure family into a probability-law family when it is one, using a fixed Dirac probability family only outside that domain. Model hypotheses prove that this fallback is never used by the exact-decoder theorem.

Definition (Lean source)
n :
shared
observedProbabilityLawFamily laws :
by classical exact if h : ∀ e, IsProbabilityMeasure (laws e) then ⟨laws, h⟩ else ⟨fun _
=> Measure.dirac 0, by intro e; infer_instance⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedProbabilityLawFamily · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:41

A continuous observed-ratio version for law family laws and environment i agrees almost everywhere with the canonical Radon--Nikodym ratio and is continuous on the support of the observational law.

Definition (Lean source)
n :
shared
i :
Fin n
R :
LatentState n → ℝ
IsContinuousObservedRatioVersion laws i R :
Prop
clause 1
R =ᵐ[laws 0] observedLawRatio laws i
clause 2
ContinuousOn R (Measure.support (laws 0))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.IsContinuousObservedRatioVersion · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:50
def observedContinuousRatio

The law-only continuous ratio selector for laws and environment i chooses a continuous version when one exists and otherwise retains the canonical Radon--Nikodym ratio.

Definition (Lean source)
n :
shared
i :
Fin n
observedContinuousRatio laws i :
LatentState n → ℝ
by classical exact if h : ∃ R, IsContinuousObservedRatioVersion laws i R then (Measure.support (laws 0)).piecewise (choose h) (fun _ ↦ 0) else observedLawRatio laws i
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedContinuousRatio · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:58
theorem observedContinuousRatio_isVersion

Whenever a continuous observed-ratio version exists, the law-only selector returns one. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
shared
i :
Fin n
hex :
Proof (Lean source)
lemma observedContinuousRatio_isVersion (laws : ObservedLawFamily n) (i : Fin n) (hex : ∃ R, IsContinuousObservedRatioVersion laws i R) : IsContinuousObservedRatioVersion laws i (observedContinuousRatio laws i) := by classical rw [observedContinuousRatio, dif_pos hex] let R := Classical.choose hex have hR : IsContinuousObservedRatioVersion laws i R := Classical.choose_spec hex constructor · filter_upwards [hR.1, Measure.support_mem_ae (μ := laws 0)] with x hx hxs rw [Set.piecewise_eq_of_mem (Measure.support (laws 0)) (Classical.choose hex) (fun _ ↦ 0) hxs] simpa only [R] using hx · exact hR.2.congr fun x hx ↦ Set.piecewise_eq_of_mem (Measure.support (laws 0)) R (fun _ ↦ 0) hx
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedContinuousRatio_isVersion · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:68
theorem measurable_observedContinuousRatio

The law-selected continuous ratio is globally measurable: outside the observational support the selector uses the fixed zero extension. the stated conclusion follows.

Formal statement
n :
shared
i :
Fin n
Proof (Lean source)
lemma measurable_observedContinuousRatio (laws : ObservedLawFamily n) (i : Fin n) : Measurable (observedContinuousRatio laws i) := by classical rw [observedContinuousRatio] split · rename_i hex let R := Classical.choose hex have hR : IsContinuousObservedRatioVersion laws i R := Classical.choose_spec hex exact hR.2.measurable_piecewise continuous_const.continuousOn (laws 0).isClosed_support.measurableSet · exact measurable_observedLawRatio laws i
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.measurable_observedContinuousRatio · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:85
theorem eqOn

Two continuous versions of the same almost-everywhere function agree throughout the measure's support. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
EqOn R S (Measure.support (laws 0))
Proof (Lean source)
lemma IsContinuousObservedRatioVersion.eqOn {laws : ObservedLawFamily n} {i : Fin n} {R S : LatentState n → ℝ} (hR : IsContinuousObservedRatioVersion laws i R) (hS : IsContinuousObservedRatioVersion laws i S) : EqOn R S (Measure.support (laws 0)) := by exact continuousOn_support_eq_of_ae_eq (hR.1.trans hS.1.symm) hR.2 hS.2
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.IsContinuousObservedRatioVersion.eqOn · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:125
def observedLawLogRatio

The observable log ratio constructed from the law-selected continuous ratio version.

Definition (Lean source)
n :
shared
i :
Fin n
x :
observedLawLogRatio laws i x :
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedLawLogRatio · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:134
theorem measurable_observedLawLogRatio

The law-selected logarithmic ratio is globally measurable. the stated conclusion follows.

Formal statement
n :
shared
i :
Fin n
Proof (Lean source)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.measurable_observedLawLogRatio · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:138
def observedLawDiscrepancy

Population MMD computed solely from the observed environment laws.

Definition (Lean source)
n :
shared
j i :
Fin n
observedLawDiscrepancy U laws j i :
‖meanEmbedding U (Measure.map (observedLawRatio laws i) (laws 0)) - meanEmbedding U (Measure.map (observedLawRatio laws i) (laws j.succ))‖
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedLawDiscrepancy · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:143

The ratio graph constructed solely from observed laws.

Definition (Lean source)
observedLawRatioGraph U laws :
Fin n → Fin n → Prop
fun j i => j ≠ i ∧ 0 < observedLawDiscrepancy U laws j i
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedLawRatioGraph · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:150
def PredecessorLogRatios

The predecessor log-ratio vector used as the conditioning variable.

Definition (Lean source)
n :
shared
order :
Fin n → ℕ
i :
Fin n
PredecessorLogRatios order i :
Type
(j : {j // j ∈ predecessorSet order i}) → ℝ
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.PredecessorLogRatios · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:158
def conditionalRatioArgument

The joint observed log-ratio and predecessor-log-ratio argument.

Definition (Lean source)
n :
shared
order :
Fin n → ℕ
i :
Fin n
x :
conditionalRatioArgument laws order i x :
ℝ × PredecessorLogRatios order i
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.conditionalRatioArgument · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:162
theorem measurable_conditionalRatioArgument

The joint log-ratio and predecessor-log-ratio argument is measurable. the stated conclusion follows.

Formal statement
n :
shared
order :
Fin n → ℕ
i :
Fin n
Proof (Lean source)
lemma measurable_conditionalRatioArgument (laws : ObservedLawFamily n) (order : Fin n → ℕ) (i : Fin n) : Measurable (conditionalRatioArgument laws order i) := by apply prodMk (measurable_observedLawLogRatio laws i) apply measurable_pi_lambda intro j exact measurable_observedLawLogRatio laws j
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.measurable_conditionalRatioArgument · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:168
theorem measurable_kernel_Iic_uncurry

Evaluation of an s-finite real kernel on a varying lower interval is jointly measurable in the endpoint and kernel parameter. the stated conclusion follows.

Formal statement
B :
κ :
Measurable (fun z : ℝ × B ↦ κ z.2 (Iic z.1))
Proof (Lean source)
lemma measurable_kernel_Iic_uncurry {B : Type*} [MeasurableSpace B] (κ : Kernel B ℝ) [IsSFiniteKernel κ] : Measurable (fun z : ℝ × B ↦ κ z.2 (Iic z.1)) := by let η : Kernel (ℝ × B) ℝ := κ.comap Prod.snd measurable_snd have hs : MeasurableSet {q : (ℝ × B) × ℝ | q.2 ≤ q.1.1} := measurableSet_le measurable_snd measurable_fst.fst have hf : Measurable (uncurry (fun z : ℝ × B ↦ fun y : ℝ ↦ indicator {q : (ℝ × B) × ℝ | q.2 ≤ q.1.1} (fun _ ↦ (1 : ENNReal)) (z, y))) := measurable_const.indicator hs have hi := hf.lintegral_kernel_prod_right (κ := η) convert hi using 1 funext z rw [Kernel.lintegral_comap] simp only [indicator, Set.mem_ofPred_eq] change (κ z.2) (Iic z.1) = ∫⁻ b, (Iic z.1).indicator (fun _ ↦ (1 : ENNReal)) b ∂κ z.2 rw [MeasureTheory.lintegral_indicator measurableSet_Iic, lintegral_one] simp
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.measurable_kernel_Iic_uncurry · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:177
def observedConditionalRatioSupport

The law-derived domain on which a conditional-CDF version is required to be continuous: all thresholds over the support of the conditioning predecessor scores.

Definition (Lean source)
n :
shared
order :
Fin n → ℕ
i :
Fin n
observedConditionalRatioSupport laws order i :
Set (ℝ × PredecessorLogRatios order i)
univ ×ˢ Measure.support (Measure.map (familyProjection (observedLawLogRatio laws) (predecessorSet order i)) (laws i.succ))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedConditionalRatioSupport · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:199
def rawObservedConditionalRatioCDF

The raw regular-conditional-distribution representative, with the original zero fallback when the supplied environment laws are not finite.

Definition (Lean source)
n :
shared
order :
Fin n → ℕ
i :
Fin n
t :
ell :
rawObservedConditionalRatioCDF laws order i t ell :
by classical exact if hfinite : ∀ e, IsFiniteMeasure (laws.1 e) then letI := hfinite i.succ (condDistrib (observedLawLogRatio laws.1 i) (familyProjection (observedLawLogRatio laws.1) (predecessorSet order i)) (laws.1 i.succ) ell (Iic t)).toReal else 0
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.rawObservedConditionalRatioCDF · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:206
theorem measurable_rawObservedConditionalRatioCDF

The raw regular-conditional-distribution CDF is jointly measurable in threshold and conditioning argument. the stated conclusion follows.

Formal statement
n :
shared
order :
Fin n → ℕ
i :
Fin n
Measurable (fun z : ℝ × PredecessorLogRatios order i ↦ rawObservedConditionalRatioCDF laws order i z.1 z.2)
Proof (Lean source)
lemma measurable_rawObservedConditionalRatioCDF (laws : ObservedProbabilityLawFamily n) (order : Fin n → ℕ) (i : Fin n) : Measurable (fun z : ℝ × PredecessorLogRatios order i ↦ rawObservedConditionalRatioCDF laws order i z.1 z.2) := by classical unfold rawObservedConditionalRatioCDF split · rename_i hfinite letI := hfinite i.succ exact ENNReal.measurable_toReal.comp (measurable_kernel_Iic_uncurry (condDistrib (observedLawLogRatio laws.1 i) (familyProjection (observedLawLogRatio laws.1) (predecessorSet order i)) (laws.1 i.succ))) · exact measurable_const
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.measurable_rawObservedConditionalRatioCDF · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:219

A law-only conditional-CDF version: it is jointly measurable, agrees almost everywhere with the regular conditional distribution both at every fixed threshold and under the joint ratio/predecessor law, and is continuous on the joint model support.

Definition (Lean source)
n :
shared
order :
Fin n → ℕ
i :
Fin n
C :
ℝ → PredecessorLogRatios order i → Icc (0 : ℝ) 1
IsContinuousConditionalRatioCDFVersion laws order i C :
Prop
clause 1
Measurable (fun z : ℝ × PredecessorLogRatios order i => (C z.1 z.2 : ℝ))
clause 2
t :
(fun ell => (C t ell : ℝ))
=ᵐ[Measure.map (familyProjection (observedLawLogRatio laws.1) (predecessorSet order i)) (laws.1 i.succ)] rawObservedConditionalRatioCDF laws order i t
clause 3
(fun z : ℝ × PredecessorLogRatios order i => (C z.1 z.2 : ℝ))
=ᵐ[ Measure.map (conditionalRatioArgument laws.1 order i) (laws.1 i.succ)] (fun z => rawObservedConditionalRatioCDF laws order i z.1 z.2)
clause 4
ContinuousOn (fun z : ℝ × PredecessorLogRatios order i => (C z.1 z.2 : ℝ)) (observedConditionalRatioSupport laws.1 order i)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.IsContinuousConditionalRatioCDFVersion · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:236
def rawObservedConditionalRatioCDFUnit

The raw conditional-CDF representative as a unit-interval value, retaining it when it has the required range and using zero only as the range-check fallback.

Definition (Lean source)
n :
shared
order :
Fin n → ℕ
i :
Fin n
t :
ell :
rawObservedConditionalRatioCDFUnit laws order i t ell :
Icc (0 : ℝ) 1
by classical exact if h : rawObservedConditionalRatioCDF laws order i t ell ∈ Icc (0 : ℝ) 1 then ⟨rawObservedConditionalRatioCDF laws order i t ell, h⟩ else ⟨0, by constructor <;> norm_num⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.rawObservedConditionalRatioCDFUnit · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:252
theorem measurable_rawObservedConditionalRatioCDFUnit

The range-checked raw conditional CDF is jointly measurable. the stated conclusion follows.

Formal statement
n :
shared
order :
Fin n → ℕ
i :
Fin n
Measurable (fun z : ℝ × PredecessorLogRatios order i ↦ rawObservedConditionalRatioCDFUnit laws order i z.1 z.2)
Proof (Lean source)
lemma measurable_rawObservedConditionalRatioCDFUnit (laws : ObservedProbabilityLawFamily n) (order : Fin n → ℕ) (i : Fin n) : Measurable (fun z : ℝ × PredecessorLogRatios order i ↦ rawObservedConditionalRatioCDFUnit laws order i z.1 z.2) := by have hraw := measurable_rawObservedConditionalRatioCDF laws order i have hs : MeasurableSet {z : ℝ × PredecessorLogRatios order i | rawObservedConditionalRatioCDF laws order i z.1 z.2 ∈ Icc (0 : ℝ) 1} := measurableSet_Icc.preimage hraw have hreal : Measurable (fun z : ℝ × PredecessorLogRatios order i ↦ if rawObservedConditionalRatioCDF laws order i z.1 z.2 ∈ Icc (0 : ℝ) 1 then rawObservedConditionalRatioCDF laws order i z.1 z.2 else 0) := by exact Measurable.ite hs hraw measurable_const have hval : ∀ z : ℝ × PredecessorLogRatios order i, (if rawObservedConditionalRatioCDF laws order i z.1 z.2 ∈ Icc (0 : ℝ) 1 then rawObservedConditionalRatioCDF laws order i z.1 z.2 else 0) ∈ Icc (0 : ℝ) 1 := by intro z split · assumption · constructor <;> norm_num convert hreal.subtype_mk (h := hval) using 1 funext z unfold rawObservedConditionalRatioCDFUnit split <;> rfl
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.measurable_rawObservedConditionalRatioCDFUnit · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:262
def observedConditionalRatioCDF Definition 20 in the paper ↗

The continuous conditional-CDF version selected from the observed laws alone. If no continuous version exists, this retains the raw condDistrib/zero fallback.

Definition (Lean source)
n :
shared
order :
Fin n → ℕ
i :
Fin n
observedConditionalRatioCDF laws order i :
ℝ → PredecessorLogRatios order i → Icc (0 : ℝ) 1
by classical exact if h : ∃ C, IsContinuousConditionalRatioCDFVersion laws order i C then choose h else rawObservedConditionalRatioCDFUnit laws order i
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedConditionalRatioCDF · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:287
theorem observedConditionalRatioCDF_isContinuousVersion

Whenever a continuous conditional-CDF version exists, the law-only selector returns one. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
shared
order :
Fin n → ℕ
i :
Fin n
hex :
Proof (Lean source)
lemma observedConditionalRatioCDF_isContinuousVersion (laws : ObservedProbabilityLawFamily n) (order : Fin n → ℕ) (i : Fin n) (hex : ∃ C, IsContinuousConditionalRatioCDFVersion laws order i C) : IsContinuousConditionalRatioCDFVersion laws order i (observedConditionalRatioCDF laws order i) := by classical rw [observedConditionalRatioCDF, dif_pos hex] exact Classical.choose_spec hex
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedConditionalRatioCDF_isContinuousVersion · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:299
theorem measurable_observedConditionalRatioCDF_unconditional

The selected conditional CDF is jointly measurable whether or not a continuous version exists: the fallback is the measurable range-checked raw conditional distribution. the stated conclusion follows.

Formal statement
n :
shared
order :
Fin n → ℕ
i :
Fin n
Measurable (fun z : ℝ × PredecessorLogRatios order i ↦ observedConditionalRatioCDF laws order i z.1 z.2)
Proof (Lean source)
lemma measurable_observedConditionalRatioCDF_unconditional (laws : ObservedProbabilityLawFamily n) (order : Fin n → ℕ) (i : Fin n) : Measurable (fun z : ℝ × PredecessorLogRatios order i ↦ observedConditionalRatioCDF laws order i z.1 z.2) := by classical unfold observedConditionalRatioCDF split · rename_i hex exact (Classical.choose_spec hex).1.subtype_mk · exact measurable_rawObservedConditionalRatioCDFUnit laws order i
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.measurable_observedConditionalRatioCDF_unconditional · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:309
theorem eqOn

Two continuous conditional-CDF versions agree everywhere on the support of the observed joint ratio/predecessor law. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
shared
C D :
ℝ → PredecessorLogRatios order i → Icc (0 : ℝ) 1
EqOn (fun z : ℝ × PredecessorLogRatios order i ↦ (C z.1 z.2 : ℝ)) (fun z ↦ (D z.1 z.2 : ℝ)) (observedConditionalRatioSupport laws.1 order i)
Proof (Lean source)
lemma IsContinuousConditionalRatioCDFVersion.eqOn {laws : ObservedProbabilityLawFamily n} {order : Fin n → ℕ} {i : Fin n} {C D : ℝ → PredecessorLogRatios order i → Icc (0 : ℝ) 1} (hC : IsContinuousConditionalRatioCDFVersion laws order i C) (hD : IsContinuousConditionalRatioCDFVersion laws order i D) : EqOn (fun z : ℝ × PredecessorLogRatios order i ↦ (C z.1 z.2 : ℝ)) (fun z ↦ (D z.1 z.2 : ℝ)) (observedConditionalRatioSupport laws.1 order i) := by intro z hz let μ := Measure.map (familyProjection (observedLawLogRatio laws.1) (predecessorSet order i)) (laws.1 i.succ) have hmap : Set.MapsTo (fun ell : PredecessorLogRatios order i => (z.1, ell)) (Measure.support μ) (observedConditionalRatioSupport laws.1 order i) := by intro ell hell exact ⟨Set.mem_univ _, hell⟩ have hCcont : ContinuousOn (fun ell => (C z.1 ell : ℝ)) (Measure.support μ) := hC.2.2.2.comp (continuousOn_const.prodMk continuousOn_id) hmap have hDcont : ContinuousOn (fun ell => (D z.1 ell : ℝ)) (Measure.support μ) := hD.2.2.2.comp (continuousOn_const.prodMk continuousOn_id) hmap exact continuousOn_support_eq_of_ae_eq ((hC.2.1 z.1).trans (hD.2.1 z.1).symm) hCcont hDcont hz.2
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.IsContinuousConditionalRatioCDFVersion.eqOn · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:322
theorem observedConditionalRatioCDF_eq_on_support

Every continuous conditional-CDF version agrees on joint support with the law-only selected version. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
shared
order :
Fin n → ℕ
i :
Fin n
hex :
C :
ℝ → PredecessorLogRatios order i → Icc (0 : ℝ) 1
z ∈ observedConditionalRatioSupport laws.1 order i :
C z.1 z.2 = observedConditionalRatioCDF laws order i z.1 z.2
Proof (Lean source)
lemma observedConditionalRatioCDF_eq_on_support (laws : ObservedProbabilityLawFamily n) (order : Fin n → ℕ) (i : Fin n) (hex : ∃ C, IsContinuousConditionalRatioCDFVersion laws order i C) (C : ℝ → PredecessorLogRatios order i → Icc (0 : ℝ) 1) (hC : IsContinuousConditionalRatioCDFVersion laws order i C) : ∀ z ∈ observedConditionalRatioSupport laws.1 order i, C z.1 z.2 = observedConditionalRatioCDF laws order i z.1 z.2 := by intro z hz apply Subtype.ext exact hC.eqOn (observedConditionalRatioCDF_isContinuousVersion laws order i hex) hz
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedConditionalRatioCDF_eq_on_support · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:346
def observedLawRankCoordinate

The identified rank coordinate, constructed only from observed laws and an explicit ordering.

Definition (Lean source)
n :
shared
order :
Fin n → ℕ
i :
Fin n
x :
observedLawRankCoordinate laws order i x :
Icc (0 : ℝ) 1
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedLawRankCoordinate · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:359
theorem measurable_observedLawRankCoordinate

Every law-selected rank coordinate is measurable, including on the selector's raw fallback branch. the stated conclusion follows.

Formal statement
n :
shared
order :
Fin n → ℕ
i :
Fin n
Proof (Lean source)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.measurable_observedLawRankCoordinate · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:367
theorem measurable_rankFamilyProjection

Every finite projection of the law-selected rank family is measurable. the stated conclusion follows.

Formal statement
n :
shared
order :
Fin n → ℕ
S :
Proof (Lean source)
lemma measurable_rankFamilyProjection (laws : ObservedProbabilityLawFamily n) (order : Fin n → ℕ) (S : Finset (Fin n)) : Measurable (familyProjection (observedLawRankCoordinate laws order) S) := by apply measurable_pi_lambda intro j exact measurable_observedLawRankCoordinate laws order j
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.measurable_rankFamilyProjection · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:375

Conditional independence of two measurable functions given a third.

Definition (Lean source)
μ :
X :
Ω → A
Y :
Ω → B
Z :
Ω → C
CondIndepGiven μ X Y Z :
Prop
∃ hμ : IsFiniteMeasure μ,
letI := hμ ∃ _hX : Measurable X, ∃ _hY : Measurable Y, ∃ hZ : Measurable Z, CondIndepFun (comap Z inferInstance) hZ.comap_le X Y μ
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.CondIndepGiven · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:384

A candidate parent set satisfies the observed-law conditional-independence test.

Definition (Lean source)
n :
shared
order :
Fin n → ℕ
i :
Fin n
A :
AdmissibleParentSet laws order i A :
Prop
clause 1
A ⊆ predecessorSet order i
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.AdmissibleParentSet · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:397

Inclusion-minimal admissibility for parent pruning.

Definition (Lean source)
n :
shared
order :
Fin n → ℕ
i :
Fin n
A :
MinimalAdmissibleParentSet laws order i A :
Prop
clause 1
AdmissibleParentSet laws order i A
clause 2
B :
AdmissibleParentSet laws order i B
B ⊆ A
A ⊆ B
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.MinimalAdmissibleParentSet · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:406
def selectedParentSet

The uniquely inclusion-minimal admissible set, defined only when it is genuinely unique. none records that the observed laws lie outside the decoder's parent-pruning domain.

Definition (Lean source)
n :
shared
order :
Fin n → ℕ
i :
Fin n
selectedParentSet laws order i :
by classical exact if h : ∃! A : Finset (Fin n), MinimalAdmissibleParentSet laws order i A then some (choose h.exists) else none
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.selectedParentSet · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:412

The parent relation carried by a successful unique-minimum selection.

Definition (Lean source)
n :
shared
order :
Fin n → ℕ
selectedParentRelation laws order :
Fin n → Fin n → Prop
fun j i => ∃ A, selectedParentSet laws order i = some A ∧ j ∈ A
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.selectedParentRelation · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:421
theorem selectedParentSet_precedes

Every selected edge points forward in the supplied ordering. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
shared
order :
Fin n → ℕ
j i :
Fin n
hj :
selectedParentRelation laws order j i
order j < order i
Proof (Lean source)
lemma selectedParentSet_precedes (laws : ObservedProbabilityLawFamily n) (order : Fin n → ℕ) {j i : Fin n} (hj : selectedParentRelation laws order j i) : order j < order i := by rcases hj with ⟨A, hA, hjA⟩ unfold selectedParentSet at hA split at hA · rename_i h_unique injection hA with hA' subst A simpa [predecessorSet] using (Classical.choose_spec h_unique.exists).1.1 hjA · simp at hA
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.selectedParentSet_precedes · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:426
theorem selectedParentRelation_acyclic

The selected-parent relation is acyclic because every edge points forward in order. the stated conclusion follows.

Formal statement
n :
shared
order :
Fin n → ℕ
i :
Fin n
¬ TransGen (selectedParentRelation laws order) i i
Proof (Lean source)
lemma selectedParentRelation_acyclic (laws : ObservedProbabilityLawFamily n) (order : Fin n → ℕ) (i : Fin n) : ¬ TransGen (selectedParentRelation laws order) i i := by intro h have path_lt : ∀ {a b : Fin n}, TransGen (selectedParentRelation laws order) a b → order a < order b := by intro a b hab induction hab with | single hji => exact selectedParentSet_precedes laws order hji | tail hab hbc ih => exact lt_trans ih (selectedParentSet_precedes laws order hbc) have hi : order i < order i := path_lt h exact (lt_irrefl _ hi)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.selectedParentRelation_acyclic · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:439
def selectedParentDAG

The acyclic graph induced by all successful unique-minimum parent selections.

Definition (Lean source)
n :
shared
order :
Fin n → ℕ
selectedParentDAG laws order :
DAG (Fin n)
clause 1
clause 2
decEdge := Classical.decRel _
clause 3
acyclic := selectedParentRelation_acyclic laws order
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.selectedParentDAG · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:453

Compatibility restricts law-coherence comparisons to representations of the same observed law family on the same observed support.

Definition (Lean source)
n :
DAG (Fin n)
Mechanism n G₁
Mechanism n G₂
shared
W₁ :
ObservedWorld G₁ θ₁
W₂ :
ObservedWorld G₂ θ₂
CompatibleObservedRepresentation W₁ W₂ :
Prop
clause 1
W₁.law = W₂.law
clause 2
observedSupport G₁ W₁ = observedSupport G₂ W₂
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.CompatibleObservedRepresentation · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:460

Coherence uses almost-everywhere Radon--Nikodym representatives, but compares the selected continuous ranks pointwise on the full common observed support.

Definition (Lean source)
n :
DAG (Fin n)
shared
W :
ObservedWorldLawCoherent W :
Prop
clause 1
i :
W.ratio i =ᵐ[W.law 0] observedLawRatio W.law i
clause 2
G' :
DAG (Fin n)
θ' :
W' :
order i :
x ∈ observedSupport G W :
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.ObservedWorldLawCoherent · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:467
def selectedTopologicalOrder

A topological ordering selected from the ratio graph using only the observed laws. The numeric label order is a total fallback outside the acyclic model domain.

Definition (Lean source)
n :
shared
selectedTopologicalOrder laws :
Fin n → ℕ
by classical exact if h : ∃ order, IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap laws.1) order then choose h else fun i
=> i.val
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.selectedTopologicalOrder · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:477
theorem selectedTopologicalOrder_isTopologicalOrdering

If the observed ratio graph has a topological ordering, its law-only selected ordering is itself topological. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
Proof (Lean source)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.selectedTopologicalOrder_isTopologicalOrdering · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:488
def populationDecoder Algorithm 1 in the paper ↗

The law-only population recovery map. It forms the Gaussian-MMD graph, selects its own topological ordering, constructs unit-interval ranks, and returns the parent-pruned DAG.

Definition (Lean source)
n :
shared
populationDecoder laws :
(Fin n → Fin n → Prop) × (Fin n → LatentState n → Icc (0 : ℝ) 1) × DAG (Fin n)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.populationDecoder · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Decoder.lean:501
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.DecoderCompProd 14 declarations This file separates one distinguished coordinate from a finite product-density measure.

Product-law assembly for decoder coordinates

This file separates one distinguished coordinate from a finite product-density measure. It supplies the measure-product step needed to assemble the equation-(11) conditional kernel.

theorem map_withDensity_measurableEquiv Lemma map_withDensity_measurableEquiv in the paper ↗

Transporting a weighted measure through a measurable equivalence transports its density by the inverse equivalence. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
α β :
e :
α ≃ᵐ β
μ :
ν :
h :
f :
α → ℝ≥0∞
Measure.map e (μ.withDensity f) = ν.withDensity (f ∘ e.symm)
Proof (Lean source)
lemma map_withDensity_measurableEquiv {α β : Type*} [MeasurableSpace α] [MeasurableSpace β] (e : α ≃ᵐ β) {μ : Measure α} {ν : Measure β} (h : MeasurePreserving e μ ν) (f : α → ℝ≥0∞) : Measure.map e (μ.withDensity f) = ν.withDensity (f ∘ e.symm) := by classical ext s hs rw [Measure.map_apply e.measurable hs, withDensity_apply _ (e.measurable hs), withDensity_apply _ hs] rw [← lintegral_indicator (e.measurable hs), ← lintegral_indicator hs] rw [h.lintegral_map_equiv] apply lintegral_congr intro a change (if e a ∈ s then f a else 0) = if e a ∈ s then f (e.symm (e a)) else 0 rw [e.symm_apply_apply]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.map_withDensity_measurableEquiv · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderCompProd.lean:18
theorem weightedCoordinate_independence Lemma weightedCoordinate_independence in the paper ↗

If a finite product density factors into a normalized density at one coordinate and a factor depending only on a disjoint coordinate set, that coordinate is independent of the projected set under the weighted measure. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
V :
μ :
V → Measure
∀ k, SigmaFinite (μ k)
∀ k, IsProbabilityMeasure (μ k)
j :
V
S :
hjS :
j ∉ S
q :
ℝ → ℝ≥0∞
hq :
g :
(V → ℝ) → ℝ≥0∞
hg :
hgS :
IsProbabilityMeasure ((μ j).withDensity q)
Measure.map (fun x => (coordinateProjection S x, x j)) ((Measure.pi μ).withDensity (fun x => q (x j) * g x))
= (Measure.map (coordinateProjection S) ((Measure.pi μ).withDensity (fun x => q (x j) * g x))).prod ((μ j).withDensity q)
Proof (Lean source)
lemma weightedCoordinate_independence {V : Type*} [Fintype V] [DecidableEq V] (μ : V → Measure ℝ) [∀ k, SigmaFinite (μ k)] [∀ k, IsProbabilityMeasure (μ k)] (j : V) (S : Finset V) (hjS : j ∉ S) (q : ℝ → ℝ≥0∞) (hq : Measurable q) (g : (V → ℝ) → ℝ≥0∞) (hg : Measurable g) (hgS : DependsOn S g) [IsProbabilityMeasure ((μ j).withDensity q)] : Measure.map (fun x => (coordinateProjection S x, x j)) ((Measure.pi μ).withDensity (fun x => q (x j) * g x)) = (Measure.map (coordinateProjection S) ((Measure.pi μ).withDensity (fun x => q (x j) * g x))).prod ((μ j).withDensity q) := by classical let p : V → Prop := fun k => k = j let E0 := MeasurableEquiv.piEquivPiSubtypeProd (fun _ : V => ℝ) p let μone : Measure ((k : {k // p k}) → ℝ) := @Measure.pi (Subtype p) (fun _ => ℝ) (fintype p) (fun _ => inferInstance) (fun k => μ k) let μrest : Measure ((k : {k // ¬ p k}) → ℝ) := @Measure.pi (Subtype fun k => ¬ p k) (fun _ => ℝ) (fintype fun k => ¬ p k) (fun _ => inferInstance) (fun k => μ k) let qone : ((k : {k // p k}) → ℝ) → ℝ≥0∞ := fun z => q (z ⟨j, rfl⟩) let zeroOne : (k : {k // p k}) → ℝ := fun _ => 0 let grest : ((k : {k // ¬ p k}) → ℝ) → ℝ≥0∞ := fun z => g (E0.symm (zeroOne, z)) have hsplit : MeasurePreserving E0 (Measure.pi μ) (μone.prod μrest) := by simpa [E0, μone, μrest] using (MeasureTheory.measurePreserving_piEquivPiSubtypeProd μ p) have hqone : Measurable qone := by exact hq.comp (measurable_pi_apply (⟨j, rfl⟩ : {k // p k})) have hgrest : Measurable grest := hg.comp (E0.symm.measurable.comp (measurable_const.prodMk measurable_id)) have hdensity : (fun z => q (E0.symm z j) * g (E0.symm z)) = fun z => qone z.1 * grest z.2 := by funext z congr 1 · change q (E0.symm z j) = q (z.1 ⟨j, rfl⟩) congr 1 simp [E0, p] · apply hgS intro k hk have hkj : k ≠ j := fun h => hjS (h ▸ hk) change E0.symm z k = E0.symm (zeroOne, z.2) k simp [E0, p, hkj] have hweighted : Measure.map E0 ((Measure.pi μ).withDensity (fun x => q (x j) * g x)) = (μone.withDensity qone).prod (μrest.withDensity grest) := by rw [map_withDensity_measurableEquiv E0 hsplit] rw [MeasureTheory.prod_withDensity hqone hgrest] congr 1 let evalOne : ((k : {k // p k}) → ℝ) → ℝ := fun z => z ⟨j, rfl⟩ let projectRest : ((k : {k // ¬ p k}) → ℝ) → ((k : S) → ℝ) := fun z k => z ⟨k, by intro hkj apply hjS rw [← hkj] exact k.property⟩ have heval : Measurable evalOne := measurable_pi_apply (⟨j, rfl⟩ : {k // p k}) have hproject : Measurable projectRest := by apply measurable_pi_lambda intro k exact measurable_pi_apply _ have htarget : Measure.map evalOne (μone.withDensity qone) = (μ j).withDensity q := by let Eone := MeasurableEquiv.piUnique (fun _ : {k // p k} => ℝ) have hone : MeasurePreserving Eone μone (μ j) := by have hraw := @MeasureTheory.measurePreserving_piUnique (Subtype p) (fintype p) (fun _ => ℝ) inferInstance (fun _ => inferInstance) (fun k => μ k) have hdef : (default : {k // p k}).1 = j := (default : {k // p k}).2 simpa [Eone, μone, p, hdef] using hraw rw [show evalOne = Eone by rfl] rw [map_withDensity_measurableEquiv Eone hone] congr 1 have hdown : Measurable (fun z : ((k : {k // p k}) → ℝ) × ((k : {k // ¬ p k}) → ℝ) => (projectRest z.2, evalOne z.1)) := (hproject.comp measurable_snd).prodMk (heval.comp measurable_fst) have hpair : (fun x : V → ℝ => (coordinateProjection S x, x j)) = (fun z => (projectRest z.2, evalOne z.1)) ∘ E0 := by funext x apply Prod.ext · funext k simp [projectRest, E0, p, coordinateProjection] · simp [evalOne, E0, p] have hjoint : Measure.map (fun x : V → ℝ => (coordinateProjection S x, x j)) ((Measure.pi μ).withDensity (fun x => q (x j) * g x)) = (Measure.map projectRest (μrest.withDensity grest)).prod (Measure.map evalOne (μone.withDensity qone)) := by rw [hpair, ← Measure.map_map hdown E0.measurable, hweighted] calc Measure.map (fun z => (projectRest z.2, evalOne z.1)) ((μone.withDensity qone).prod (μrest.withDensity grest)) = Measure.map swap (Measure.map (map evalOne projectRest) ((μone.withDensity qone).prod (μrest.withDensity grest))) := by rw [Measure.map_map measurable_swap (heval.prodMap hproject)] rfl _ = Measure.map swap ((Measure.map evalOne (μone.withDensity qone)).prod (Measure.map projectRest (μrest.withDensity grest))) := by rw [← Measure.map_prod_map _ _ heval hproject] _ = _ := Measure.prod_swap have hpred : Measure.map (coordinateProjection S) ((Measure.pi μ).withDensity (fun x => q (x j) * g x)) = Measure.map projectRest (μrest.withDensity grest) := by calc Measure.map (coordinateProjection S) ((Measure.pi μ).withDensity (fun x => q (x j) * g x)) = Measure.map fst (Measure.map (fun x : V → ℝ => (coordinateProjection S x, x j)) ((Measure.pi μ).withDensity (fun x => q (x j) * g x))) := by rw [Measure.map_map measurable_fst (by fun_prop)] rfl _ = Measure.map fst ((Measure.map projectRest (μrest.withDensity grest)).prod ((μ j).withDensity q)) := by rw [hjoint, htarget] _ = Measure.map projectRest (μrest.withDensity grest) := by rw [Measure.map_fst_prod] simp rw [hjoint, htarget, hpred]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.weightedCoordinate_independence · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderCompProd.lean:38
theorem equationTen_predecessorCoordinates_independent_target

Equation (10) as a product law: under intervention i, the target coordinate has its replacement-density law and is independent of all latent coordinates preceding i. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
hgraphOrder :
i :
Fin n
A :
S :
A.erase (W.targetPerm i)
pred :
coordinateProjection (X := fun _ : Fin n => ℝ) S
Measure.map (fun v => (pred v, v (W.targetPerm i))) (interventionalLaw θ (W.targetPerm i))
= (Measure.map pred (interventionalLaw θ (W.targetPerm i))).prod (decoderInterventionCoordinateMeasure W hpos i)
Proof (Lean source)
lemma equationTen_predecessorCoordinates_independent_target {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) {order : Fin n → ℕ} (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) (i : Fin n) : let A := decoderRetainedLatentSet W order i let S := A.erase (W.targetPerm i) let pred := coordinateProjection (X := fun _ : Fin n => ℝ) S Measure.map (fun v => (pred v, v (W.targetPerm i))) (interventionalLaw θ (W.targetPerm i)) = (Measure.map pred (interventionalLaw θ (W.targetPerm i))).prod (decoderInterventionCoordinateMeasure W hpos i) := by dsimp only let B := mechanismUnitCubeFactorization hpos let q := mechanismInterventionDensity W hpos i let A := decoderRetainedLatentSet W order i let S := A.erase (W.targetPerm i) let μ : Fin n → Measure ℝ := fun _ => Causalean.Graph.FiniteDensity.unitIntervalReference let ν := (Measure.pi μ).withDensity (fun v => q.density (v (W.targetPerm i)) * B.partialDensity S v) have hσ : ∀ k, SigmaFinite (μ k) := fun _ => by dsimp only [μ] unfold Causalean.Graph.FiniteDensity.unitIntervalReference infer_instance letI : ∀ k, SigmaFinite (μ k) := hσ have hprob : ∀ k, IsProbabilityMeasure (μ k) := fun _ => by constructor dsimp only [μ] unfold Causalean.Graph.FiniteDensity.unitIntervalReference simp [Real.volume_Icc] letI : ∀ k, IsProbabilityMeasure (μ k) := hprob have htargetNotMem : W.targetPerm i ∉ S := Finset.notMem_erase _ _ have hg : Measurable (B.partialDensity S) := B.measurable_partialDensity S have hgS : DependsOn S (B.partialDensity S) := by intro x y hxy unfold partialDensity apply Finset.prod_congr rfl intro k hk apply B.local_factor k intro a ha apply hxy a rcases Finset.mem_insert.mp ha with rfl | ha · exact hk have hkA : k ∈ A := (Finset.mem_erase.mp hk).2 have haA : a ∈ A := decoderRetainedLatentSet_parentClosed W horder hgraphOrder i hkA ha have hane : a ≠ W.targetPerm i := by intro hat subst a change k ∈ decoderRetainedLatentSet W order i at hkA rw [decoderRetainedLatentSet, Finset.mem_insert] at hkA rcases hkA with hkt | hkpred · exact (Finset.mem_erase.mp hk).1 hkt · rcases Finset.mem_map.mp hkpred with ⟨b, hb, rfl⟩ exact target_not_parent_of_mem_predecessorSet W horder hgraphOrder hb ha exact Finset.mem_erase.mpr ⟨hane, haA⟩ have hνprod := @weightedCoordinate_independence (Fin n) inferInstance inferInstance μ hσ hprob (W.targetPerm i) S htargetNotMem q.density q.measurable_density (B.partialDensity S) hg hgS (by simpa [μ, q, decoderInterventionCoordinateMeasure] using decoderInterventionCoordinateMeasure_isProbability W hpos i) have hAeq : A = decoderRetainedLatentSet W order i := rfl have hretained := equationTen_retainedMarginalMeasure W hpos horder hgraphOrder i change Measure.map (coordinateProjection A) (interventionalLaw θ (W.targetPerm i)) = Measure.map (coordinateProjection A) ν at hretained have hpairMeas : Measurable (fun v : LatentState n => (coordinateProjection S v, v (W.targetPerm i))) := (Causalean.Mathlib.MeasureTheory.FiniteCoordinate.measurable_coordinateProjection S).prodMk (measurable_pi_apply _) have hpairDepends : DependsOn A (fun v : LatentState n => (coordinateProjection S v, v (W.targetPerm i))) := by intro x y hxy apply Prod.ext · funext k exact hxy k (mem_of_mem_erase k.property) · exact hxy _ (by simp [A, decoderRetainedLatentSet]) have hpredMeas : Measurable (coordinateProjection (X := fun _ : Fin n => ℝ) S) := Causalean.Mathlib.MeasureTheory.FiniteCoordinate.measurable_coordinateProjection S have hpredDepends : DependsOn A (coordinateProjection (X := fun _ : Fin n => ℝ) S) := by intro x y hxy funext k exact hxy k (mem_of_mem_erase k.property) have hpairMap := map_eq_of_map_coordinateProjection_eq (fun _ : Fin n => (0 : ℝ)) hpairMeas hpairDepends hretained have hpredMap := map_eq_of_map_coordinateProjection_eq (fun _ : Fin n => (0 : ℝ)) hpredMeas hpredDepends hretained calc Measure.map (fun v : LatentState n => (coordinateProjection S v, v (W.targetPerm i))) (interventionalLaw θ (W.targetPerm i)) = Measure.map (fun v : LatentState n => (coordinateProjection S v, v (W.targetPerm i))) ν := hpairMap _ = (Measure.map (coordinateProjection S) ν).prod (decoderInterventionCoordinateMeasure W hpos i) := by simpa [μ, q, decoderInterventionCoordinateMeasure] using hνprod _ = (Measure.map (coordinateProjection S) (interventionalLaw θ (W.targetPerm i))).prod (decoderInterventionCoordinateMeasure W hpos i) := by rw [hpredMap]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.equationTen_predecessorCoordinates_independent_target · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderCompProd.lean:169
theorem map_prod_compProd_of_fiber Lemma map_prod_compProd_of_fiber in the paper ↗

Mapping a product measure through a measurable fiber map gives a compositional product whenever the supplied kernel is the fiberwise pushforward of the second marginal. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
μ :
ν :
g :
α → δ
hg :
f :
α × β → γ
hf :
κ :
:
∀ a, κ (g a) = Measure.map (fun b => f (a, b)) ν
Measure.map (fun z : α × β => (g z.1, f z)) (μ.prod ν) = Measure.map g μ ⊗ₘ κ
Proof (Lean source)
lemma map_prod_compProd_of_fiber {α β γ δ : Type*} [MeasurableSpace α] [MeasurableSpace β] [MeasurableSpace γ] [MeasurableSpace δ] (μ : Measure α) (ν : Measure β) [SFinite μ] [SFinite ν] (g : α → δ) (hg : Measurable g) (f : α × β → γ) (hf : Measurable f) (κ : Kernel δ γ) [IsSFiniteKernel κ] (hκ : ∀ a, κ (g a) = Measure.map (fun b => f (a, b)) ν) : Measure.map (fun z : α × β => (g z.1, f z)) (μ.prod ν) = Measure.map g μ ⊗ₘ κ := by have hpair : Measurable (fun z : α × β => (g z.1, f z)) := by fun_prop ext s hs rw [Measure.map_apply hpair hs, Measure.prod_apply (hs.preimage hpair), Measure.compProd_apply hs] rw [MeasureTheory.lintegral_map (Kernel.measurable_kernel_prodMk_left hs) hg] apply lintegral_congr intro a rw [hκ a, Measure.map_apply (by fun_prop) (hs.preimage (by fun_prop))] rfl
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.map_prod_compProd_of_fiber · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderCompProd.lean:281
def retainedProjectionToPredecessorCube

Reindex and clamp retained latent predecessor coordinates into the compact decoder cube.

Definition (Lean source)
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
i :
Fin n
y :
(k : (decoderRetainedLatentSet W order i).erase (W.targetPerm i)) → ℝ
retainedProjectionToPredecessorCube W order i y :
fun j
=> ⟨max 0 (min 1 (y ⟨W.targetPerm j, by apply Finset.mem_erase.mpr constructor · intro h have hji : j.1 = i := W.targetPerm.injective h have hjlt : order j < order i := by simpa [predecessorSet] using j.2 exact (hji ▸ hjlt).false · rw [decoderRetainedLatentSet] exact mem_insert_of_mem (Finset.mem_map.mpr ⟨j, j.2, rfl⟩)⟩)), ⟨le_max_left _ _, max_le zero_le_one (min_le_left _ _)⟩⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.retainedProjectionToPredecessorCube · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderCompProd.lean:305
theorem measurable_retainedProjectionToPredecessorCube

Reindexing and clamping the retained predecessor projection is measurable.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
i :
Fin n
Proof (Lean source)
@[fun_prop] lemma measurable_retainedProjectionToPredecessorCube {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (order : Fin n → ℕ) (i : Fin n) : Measurable (retainedProjectionToPredecessorCube W order i) := by apply measurable_pi_lambda intro j apply Measurable.subtype_mk fun_prop
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.measurable_retainedProjectionToPredecessorCube · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderCompProd.lean:323
theorem retainedProjectionToPredecessorCube_coordinateProjection

On the latent cube, the clamped retained projection is the actual predecessor restriction. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
i :
Fin n
v :
hv :
v ∈ latentCube n
Proof (Lean source)
lemma retainedProjectionToPredecessorCube_coordinateProjection {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (order : Fin n → ℕ) (i : Fin n) (v : LatentState n) (hv : v ∈ latentCube n) : retainedProjectionToPredecessorCube W order i (coordinateProjection ((decoderRetainedLatentSet W order i).erase (W.targetPerm i)) v) = predecessorLatentCubeOfState W order i v hv := by funext j apply Subtype.ext simp only [retainedProjectionToPredecessorCube, coordinateProjection, predecessorLatentCubeOfState] have hj := hv (W.targetPerm j) (Set.mem_univ _) rw [min_eq_right hj.2, max_eq_right hj.1]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.retainedProjectionToPredecessorCube_coordinateProjection · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderCompProd.lean:334
def clampedPredecessorCoordinates

The globally measurable clamped predecessor restriction of an ambient latent state.

Definition (Lean source)
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
i :
Fin n
v :
clampedPredecessorCoordinates W order i v :
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.clampedPredecessorCoordinates · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderCompProd.lean:352
theorem measurable_clampedPredecessorCoordinates

The clamped predecessor-coordinate restriction is measurable.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
i :
Fin n
Proof (Lean source)
@[fun_prop] lemma measurable_clampedPredecessorCoordinates {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (order : Fin n → ℕ) (i : Fin n) : Measurable (clampedPredecessorCoordinates W order i) := by exact (measurable_retainedProjectionToPredecessorCube W order i).comp (measurable_coordinateProjection _)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.measurable_clampedPredecessorCoordinates · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderCompProd.lean:362
theorem clampedPredecessorCoordinates_of_mem

On the latent cube, clamped predecessor coordinates equal the genuine restriction. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
i :
Fin n
v :
hv :
v ∈ latentCube n
Proof (Lean source)
lemma clampedPredecessorCoordinates_of_mem {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (order : Fin n → ℕ) (i : Fin n) (v : LatentState n) (hv : v ∈ latentCube n) : clampedPredecessorCoordinates W order i v = predecessorLatentCubeOfState W order i v hv := retainedProjectionToPredecessorCube_coordinateProjection W order i v hv
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.clampedPredecessorCoordinates_of_mem · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderCompProd.lean:371
theorem predecessorCoordinates_independent_target

Equation (10) transported to the compact predecessor cube: under intervention i, clamped predecessor coordinates and the target coordinate have a product law. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
hgraphOrder :
i :
Fin n
Measure.map (fun v => (clampedPredecessorCoordinates W order i v, v (W.targetPerm i))) (interventionalLaw θ (W.targetPerm i))
= (Measure.map (clampedPredecessorCoordinates W order i) (interventionalLaw θ (W.targetPerm i))).prod (decoderInterventionCoordinateMeasure W hpos i)
Proof (Lean source)
lemma predecessorCoordinates_independent_target {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) {order : Fin n → ℕ} (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) (i : Fin n) : Measure.map (fun v => (clampedPredecessorCoordinates W order i v, v (W.targetPerm i))) (interventionalLaw θ (W.targetPerm i)) = (Measure.map (clampedPredecessorCoordinates W order i) (interventionalLaw θ (W.targetPerm i))).prod (decoderInterventionCoordinateMeasure W hpos i) := by let A := decoderRetainedLatentSet W order i let S := A.erase (W.targetPerm i) let pred := coordinateProjection (X := fun _ : Fin n => ℝ) S let F := retainedProjectionToPredecessorCube W order i let μ := interventionalLaw θ (W.targetPerm i) let ν := decoderInterventionCoordinateMeasure W hpos i letI : IsProbabilityMeasure μ := interventionalLaw_isProbabilityMeasure W hpos i have hprod := equationTen_predecessorCoordinates_independent_target W hpos horder hgraphOrder i change Measure.map (fun v => (pred v, v (W.targetPerm i))) μ = (Measure.map pred μ).prod ν at hprod have hF : Measurable F := measurable_retainedProjectionToPredecessorCube W order i have hpair : Measurable (fun v : LatentState n => (pred v, v (W.targetPerm i))) := by fun_prop have hmap := congrArg (Measure.map (map F id)) hprod calc Measure.map (fun v => (clampedPredecessorCoordinates W order i v, v (W.targetPerm i))) μ = Measure.map (map F id) (Measure.map (fun v => (pred v, v (W.targetPerm i))) μ) := by rw [Measure.map_map (hF.prodMap measurable_id) hpair] rfl _ = Measure.map (map F id) ((Measure.map pred μ).prod ν) := hmap _ = (Measure.map F (Measure.map pred μ)).prod ν := by rw [← Measure.map_prod_map _ _ hF measurable_id] simp _ = (Measure.map (clampedPredecessorCoordinates W order i) μ).prod ν := by rw [Measure.map_map hF (by fun_prop)] rfl
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.predecessorCoordinates_independent_target · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderCompProd.lean:381
theorem equationElevenAmbientKernel_apply_scoreMap

On a triangular predecessor score, the ambient equation-(11) kernel is precisely the pushforward of the replacement coordinate law along the corresponding own-score fiber. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ :
W :
hsign :
order :
Fin n → ℕ
hgraphOrder :
i :
Fin n
z :
(equationElevenAmbientKernel s W hpos hmix hone hsign horder hgraphOrder i) (predecessorScoreMap W order i z)
= Measure.map (fun w => equationElevenClampedScore W order i (z, w)) (decoderInterventionCoordinateMeasure W hpos i)
Proof (Lean source)
lemma equationElevenAmbientKernel_apply_scoreMap {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (hsign : FixedOwnDerivativeSign G s θ) {order : Fin n → ℕ} (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) (i : Fin n) (z : PredecessorLatentCube order i) : (equationElevenAmbientKernel s W hpos hmix hone hsign horder hgraphOrder i) (predecessorScoreMap W order i z) = Measure.map (fun w => equationElevenClampedScore W order i (z, w)) (decoderInterventionCoordinateMeasure W hpos i) := by let e := predecessorScoreHomeomorph s W hpos hmix hone hsign horder hgraphOrder i have hrange : predecessorScoreMap W order i z ∈ range (predecessorScoreMap W order i) := ⟨z, rfl⟩ have hretract : predecessorScoreRangeRetraction W order i (predecessorScoreMap W order i z) = ⟨predecessorScoreMap W order i z, hrange⟩ := by simp [predecessorScoreRangeRetraction, hrange] have hinv : e.symm ⟨predecessorScoreMap W order i z, hrange⟩ = z := by apply e.injective rw [e.apply_symm_apply] rfl rw [equationElevenAmbientKernel, Kernel.comap_apply, equationElevenScoreImageKernel, Kernel.comap_apply, hretract, hinv, equationElevenPredecessorKernel] ext u hu rw [Kernel.map_apply' _ (measurable_equationElevenClampedScore W hpos order i) _ hu, Kernel.comap_apply, Kernel.parallelComp_apply, Kernel.id_apply, Kernel.const_apply, Measure.dirac_prod] rw [Measure.map_apply (by fun_prop) (hu.preimage (measurable_equationElevenClampedScore W hpos order i))] rw [Measure.map_apply (by fun_prop) hu] rfl
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.equationElevenAmbientKernel_apply_scoreMap · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderCompProd.lean:426
theorem equationElevenClampedScore_of_latentState

On a latent cube point, the clamped equation-(11) fiber score equals the observed target log-ratio, because every target parent occurs among the reconstructed predecessors. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
hgraphOrder :
i :
Fin n
v :
hv :
v ∈ latentCube n
equationElevenClampedScore W order i (clampedPredecessorCoordinates W order i v, v (W.targetPerm i))
= observedLawLogRatio W.law i (W.mix v)
Proof (Lean source)
lemma equationElevenClampedScore_of_latentState {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) {order : Fin n → ℕ} (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) (i : Fin n) (v : LatentState n) (hv : v ∈ latentCube n) : equationElevenClampedScore W order i (clampedPredecessorCoordinates W order i v, v (W.targetPerm i)) = observedLawLogRatio W.law i (W.mix v) := by rw [clampedPredecessorCoordinates_of_mem W order i v hv] rw [observedLawLogRatio_comp_mix_eq W hpos hmix hone i v hv] unfold equationElevenClampedScore have hvi := hv (W.targetPerm i) (Set.mem_univ _) rw [min_eq_right hvi.2, max_eq_right hvi.1] dsimp only have hp : θ.p (W.targetPerm i) (update (predecessorCubeLatentState W order i (predecessorLatentCubeOfState W order i v hv)) (W.targetPerm i) (v (W.targetPerm i))) = θ.p (W.targetPerm i) v := by apply θ.parent_local (W.targetPerm i) · simp · intro a ha let j := W.targetPerm.symm a have hjparent : j ∈ environmentParentSet W i := by simpa [j, environmentParentSet, parents] using ha have hjpred := environmentParentSet_subset_predecessorSet_of_transitiveClosure W horder hgraphOrder i hjparent have hbase := predecessorCubeLatentState_ofState_apply W order i v hv j hjpred have hat : a ≠ W.targetPerm i := by intro h have hji : j = i := W.targetPerm.injective (by simpa [j] using h) have hjlt : order j < order i := by simpa [predecessorSet] using hjpred exact (hji ▸ hjlt).false simpa [update, hat, j] using hbase rw [hp]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.equationElevenClampedScore_of_latentState · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderCompProd.lean:467
theorem observedRatioPredecessor_compProd Lemma 6 in the paper ↗

Under intervention i, the observed predecessor-score and target-score law is the predecessor marginal composed with the ambient equation-(11) Markov kernel. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ :
W :
hsign :
order :
Fin n → ℕ
hgraphOrder :
i :
Fin n
Measure.map (fun x ↦ (familyProjection (observedLawLogRatio W.law) (predecessorSet order i) x, observedLawLogRatio W.law i x)) (W.law i.succ)
= Measure.map (familyProjection (observedLawLogRatio W.law) (predecessorSet order i)) (W.law i.succ) ⊗ₘ equationElevenAmbientKernel s W hpos hmix hone hsign horder hgraphOrder i
Proof (Lean source)
lemma observedRatioPredecessor_compProd {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (hsign : FixedOwnDerivativeSign G s θ) {order : Fin n → ℕ} (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) (i : Fin n) : Measure.map (fun x ↦ (familyProjection (observedLawLogRatio W.law) (predecessorSet order i) x, observedLawLogRatio W.law i x)) (W.law i.succ) = Measure.map (familyProjection (observedLawLogRatio W.law) (predecessorSet order i)) (W.law i.succ) ⊗ₘ equationElevenAmbientKernel s W hpos hmix hone hsign horder hgraphOrder i := by let μ := interventionalLaw θ (W.targetPerm i) let ν := decoderInterventionCoordinateMeasure W hpos i let z := clampedPredecessorCoordinates W order i let g := predecessorScoreMap W order i let f := equationElevenClampedScore W order i let κ := equationElevenAmbientKernel s W hpos hmix hone hsign horder hgraphOrder i let latentJoint : LatentState n → PredecessorLogRatios order i × ℝ := fun v => (g (z v), f (z v, v (W.targetPerm i))) let observedJoint : LatentState n → PredecessorLogRatios order i × ℝ := fun x => (familyProjection (observedLawLogRatio W.law) (predecessorSet order i) x, observedLawLogRatio W.law i x) have hμ : IsProbabilityMeasure μ := interventionalLaw_isProbabilityMeasure W hpos i letI : IsProbabilityMeasure μ := hμ have hν : IsProbabilityMeasure ν := decoderInterventionCoordinateMeasure_isProbability W hpos i letI : IsProbabilityMeasure ν := hν have hz : Measurable z := measurable_clampedPredecessorCoordinates W order i have hg : Measurable g := (continuous_predecessorScoreMap W hpos order i).measurable have hf : Measurable f := measurable_equationElevenClampedScore W hpos order i have hκ : ∀ a, κ (g a) = Measure.map (fun b => f (a, b)) ν := equationElevenAmbientKernel_apply_scoreMap s W hpos hmix hone hsign horder hgraphOrder i have hbase := predecessorCoordinates_independent_target W hpos horder hgraphOrder i change Measure.map (fun v => (z v, v (W.targetPerm i))) μ = (Measure.map z μ).prod ν at hbase have hpair : Measurable (fun v : LatentState n => (z v, v (W.targetPerm i))) := by fun_prop have hgf : Measurable (fun p : PredecessorLatentCube order i × ℝ => (g p.1, f p)) := by fun_prop have hmap := congrArg (Measure.map (fun p : PredecessorLatentCube order i × ℝ => (g p.1, f p))) hbase have hlatent : Measure.map latentJoint μ = Measure.map g (Measure.map z μ) ⊗ₘ κ := by calc Measure.map latentJoint μ = Measure.map (fun p : PredecessorLatentCube order i × ℝ => (g p.1, f p)) (Measure.map (fun v => (z v, v (W.targetPerm i))) μ) := by rw [Measure.map_map hgf hpair] rfl _ = Measure.map (fun p : PredecessorLatentCube order i × ℝ => (g p.1, f p)) ((Measure.map z μ).prod ν) := hmap _ = Measure.map g (Measure.map z μ) ⊗ₘ κ := map_prod_compProd_of_fiber (Measure.map z μ) ν g hg f hf κ hκ have hcube : ∀ᵐ v ∂μ, v ∈ latentCube n := by filter_upwards [Measure.support_mem_ae (μ := μ)] with v hv simpa [μ, interventionalLaw_support_eq_latentCube W hpos i] using hv have hlatent_obs : latentJoint =ᵐ[μ] observedJoint ∘ W.mix := by filter_upwards [hcube] with v hv apply Prod.ext · dsimp only [latentJoint, observedJoint, g, z] rw [clampedPredecessorCoordinates_of_mem W order i v hv] exact predecessorScoreMap_of_latentState W hpos hmix hone horder hgraphOrder i v hv · exact equationElevenClampedScore_of_latentState W hpos hmix hone horder hgraphOrder i v hv have hmixAE : AEMeasurable W.mix μ := by apply aemeasurable_of_supportMeasurableOn (by rw [latentCube] exact MeasurableSet.pi Set.countable_univ (fun _ _ ↦ measurableSet_Icc)) hcube hmix.1.continuousOn.domRestrict.measurable have hobsJoint : Measurable observedJoint := by dsimp only [observedJoint] apply Measurable.prodMk · apply measurable_pi_lambda intro j exact measurable_observedLawLogRatio W.law j · exact measurable_observedLawLogRatio W.law i have hpushed : Measure.map observedJoint (W.law i.succ) = Measure.map latentJoint μ := by rw [hone.2.1 i] rw [AEMeasurable.map_map_of_aemeasurable hobsJoint.aemeasurable hmixAE] exact Measure.map_congr hlatent_obs.symm have hpredAE : (g ∘ z) =ᵐ[μ] (familyProjection (observedLawLogRatio W.law) (predecessorSet order i)) ∘ W.mix := by filter_upwards [hcube] with v hv dsimp only [g, z, Function.comp_apply] rw [clampedPredecessorCoordinates_of_mem W order i v hv] exact predecessorScoreMap_of_latentState W hpos hmix hone horder hgraphOrder i v hv have hpredMeas : Measurable (familyProjection (observedLawLogRatio W.law) (predecessorSet order i)) := by apply measurable_pi_lambda intro j exact measurable_observedLawLogRatio W.law j have hpredPushed : Measure.map (familyProjection (observedLawLogRatio W.law) (predecessorSet order i)) (W.law i.succ) = Measure.map g (Measure.map z μ) := by rw [hone.2.1 i] rw [AEMeasurable.map_map_of_aemeasurable hpredMeas.aemeasurable hmixAE] rw [Measure.map_map hg hz] exact Measure.map_congr hpredAE.symm rw [hpushed, hlatent, hpredPushed]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedRatioPredecessor_compProd · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderCompProd.lean:510
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.DecoderConditionalKernel 26 declarations This file supplies the factor-elimination identity underlying equation (10): when a parent-closed retained set contains the intervention target, its marginal density is the replacement density times the product of the re

Intervention marginal density for the decoder

This file supplies the factor-elimination identity underlying equation (10): when a parent-closed retained set contains the intervention target, its marginal density is the replacement density times the product of the remaining retained observational factors. It also constructs the equation-(11) Markov kernel on the compact predecessor cube and transports it through the triangular predecessor-score homeomorphism.

theorem interventionMarginalDensity_eq_replacement_mul_partialDensity Lemma interventionMarginalDensity_eq_replacement_mul_partialDensity in the paper ↗

Eliminating all coordinates outside a parent-closed set containing the intervention target leaves the intervention density times the observational factors at the other retained nodes. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
V :
Type*
V → Type*
∀ i, MeasurableSpace (X i)
μ :
∀ i, Measure (X i)
∀ i, SigmaFinite (μ i)
G :
DAG V
B :
A :
hA :
j :
V
hj :
j ∈ A
q :
(∫⋯∫⁻_(univ \ A), B.interventionDensity j q ∂μ)
= fun v => q.density (v j) * B.partialDensity (A.erase j) v
Proof (Lean source)
lemma interventionMarginalDensity_eq_replacement_mul_partialDensity {V : Type*} [DecidableEq V] [Fintype V] {X : V → Type*} [∀ i, MeasurableSpace (X i)] {μ : ∀ i, Measure (X i)} [∀ i, SigmaFinite (μ i)] {G : DAG V} (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 ∂μ) = fun v => q.density (v j) * B.partialDensity (A.erase j) v := by rw [← B.observationalDensity_intervene] rw [(B.intervene j q).lmarginal_compl_observationalDensity_eq hA] funext v unfold Factorization.partialDensity Factorization.intervene rw [← Finset.prod_erase_mul _ _ hj] have hprod : (∏ i ∈ A.erase j, if i = j then q.density (v j) else B.factor i v) = ∏ i ∈ A.erase j, B.factor i v := by apply Finset.prod_congr rfl intro i hi have hij : i ≠ j := (Finset.mem_erase.mp hi).1 simp [hij] rw [hprod] simp only [if_pos] exact mul_comm _ _
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.interventionMarginalDensity_eq_replacement_mul_partialDensity · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderConditionalKernel.lean:26
def decoderRetainedLatentSet

The latent-coordinate image of a decoder predecessor set, together with the current intervention target.

Definition (Lean source)
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
i :
Fin n
decoderRetainedLatentSet W order i :
insert (W.targetPerm i) ((predecessorSet order i).map W.targetPerm.toEmbedding)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.decoderRetainedLatentSet · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderConditionalKernel.lean:55
theorem decoderRetainedLatentSet_parentClosed

If the selected order respects the recovered ancestral order, the target and its decoder predecessors form a parent-closed latent set. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
hgraphOrder :
i :
Fin n
Proof (Lean source)
lemma decoderRetainedLatentSet_parentClosed {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) {order : Fin n → ℕ} (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) (i : Fin n) : ParentClosed G (decoderRetainedLatentSet W order i) := by intro k hk a ha rw [decoderRetainedLatentSet, Finset.mem_insert] at hk ⊢ rcases hk with rfl | hk · right refine Finset.mem_map.mpr ⟨W.targetPerm.symm a, ?_, ?_⟩ · apply environmentParentSet_subset_predecessorSet_of_transitiveClosure W horder hgraphOrder i simpa only [environmentParentSet, mem_filter, Finset.mem_univ, true_and, Equiv.apply_symm_apply] using G.mem_parents.mp ha · simp · right rcases Finset.mem_map.mp hk with ⟨b, hb, rfl⟩ refine Finset.mem_map.mpr ⟨W.targetPerm.symm a, ?_, ?_⟩ · have hab : W.targetPerm.symm a ∈ predecessorSet order b := by apply environmentParentSet_subset_predecessorSet_of_transitiveClosure W horder hgraphOrder b have hedge : G.edge a (W.targetPerm b) := by simpa using G.mem_parents.mp ha simpa only [environmentParentSet, mem_filter, Finset.mem_univ, true_and, Equiv.apply_symm_apply] using hedge simp only [predecessorSet, mem_filter, Finset.mem_univ, true_and] at hab hb ⊢ exact hab.trans hb · simp
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.decoderRetainedLatentSet_parentClosed · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderConditionalKernel.lean:63
theorem equationTen_predecessorDensity_update_target

The predecessor-factor part of equation (10) is constant along the current target's own-coordinate fiber. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
hgraphOrder :
i :
Fin n
v :
w :
B.partialDensity (A.erase (W.targetPerm i)) (update v (W.targetPerm i) w)
= B.partialDensity (A.erase (W.targetPerm i)) v
Proof (Lean source)
lemma equationTen_predecessorDensity_update_target {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) {order : Fin n → ℕ} (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) (i : Fin n) (v : LatentState n) (w : ℝ) : let B := mechanismUnitCubeFactorization hpos let A := decoderRetainedLatentSet W order i B.partialDensity (A.erase (W.targetPerm i)) (update v (W.targetPerm i) w) = B.partialDensity (A.erase (W.targetPerm i)) v := by dsimp only unfold partialDensity apply Finset.prod_congr rfl intro k hk apply (mechanismUnitCubeFactorization hpos).local_factor k intro a ha have hatarget : a ≠ W.targetPerm i := by intro hEq subst a rcases Finset.mem_insert.mp ha with hki | hparent · exact (Finset.mem_erase.mp hk).1 hki.symm · have hkA := (Finset.mem_erase.mp hk).2 rw [decoderRetainedLatentSet, Finset.mem_insert] at hkA rcases hkA with hkTarget | hkPred · exact (Finset.mem_erase.mp hk).1 hkTarget · rcases Finset.mem_map.mp hkPred with ⟨b, hb, hkb⟩ subst k exact target_not_parent_of_mem_predecessorSet W horder hgraphOrder hb hparent simp [update, hatarget]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.equationTen_predecessorDensity_update_target · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderConditionalKernel.lean:94
theorem equationTen_interventionMarginalDensity Lemma 4 in the paper ↗

Equation (10) at the density-elimination level: under the current intervention, retaining the target and all predecessor coordinates leaves the replacement density times the remaining retained observational factors. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
hgraphOrder :
i :
Fin n
(∫⋯∫⁻_(univ \ A), B.interventionDensity (W.targetPerm i) q ∂fun _ : Fin n => unitIntervalReference)
= fun v => q.density (v (W.targetPerm i)) * B.partialDensity (A.erase (W.targetPerm i)) v
Proof (Lean source)
lemma equationTen_interventionMarginalDensity {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) {order : Fin n → ℕ} (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) (i : Fin n) : let B := mechanismUnitCubeFactorization hpos let q := mechanismInterventionDensity W hpos i let A := decoderRetainedLatentSet W order i (∫⋯∫⁻_(univ \ A), B.interventionDensity (W.targetPerm i) q ∂fun _ : Fin n => unitIntervalReference) = fun v => q.density (v (W.targetPerm i)) * B.partialDensity (A.erase (W.targetPerm i)) v := by dsimp only have hσ : ∀ _ : Fin n, SigmaFinite unitIntervalReference := fun _ => by unfold unitIntervalReference infer_instance exact @interventionMarginalDensity_eq_replacement_mul_partialDensity (Fin n) _ _ (fun _ : Fin n => ℝ) (fun _ : Fin n => inferInstance) (fun _ : Fin n => unitIntervalReference) hσ G (mechanismUnitCubeFactorization hpos) (decoderRetainedLatentSet W order i) (decoderRetainedLatentSet_parentClosed W horder hgraphOrder i) (W.targetPerm i) (by simp [decoderRetainedLatentSet]) (mechanismInterventionDensity W hpos i)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.equationTen_interventionMarginalDensity · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderConditionalKernel.lean:129
theorem equationTen_interventionMarginalDensity_fiber_product Lemma 5 in the paper ↗

Equation (10) in explicit fiber-product form: after fixing predecessor coordinates, the retained intervention density is the own-coordinate replacement density times a factor that is constant along that coordinate's fiber. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
hgraphOrder :
i :
Fin n
v :
w :
(∫⋯∫⁻_(univ \ A), B.interventionDensity (W.targetPerm i) q ∂fun _ : Fin n => unitIntervalReference) (update v (W.targetPerm i) w)
= q.density w * B.partialDensity (A.erase (W.targetPerm i)) v
Proof (Lean source)
lemma equationTen_interventionMarginalDensity_fiber_product {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) {order : Fin n → ℕ} (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) (i : Fin n) (v : LatentState n) (w : ℝ) : let B := mechanismUnitCubeFactorization hpos let q := mechanismInterventionDensity W hpos i let A := decoderRetainedLatentSet W order i (∫⋯∫⁻_(univ \ A), B.interventionDensity (W.targetPerm i) q ∂fun _ : Fin n => unitIntervalReference) (update v (W.targetPerm i) w) = q.density w * B.partialDensity (A.erase (W.targetPerm i)) v := by dsimp only have hten := congrFun (equationTen_interventionMarginalDensity W hpos horder hgraphOrder i) (update v (W.targetPerm i) w) rw [equationTen_predecessorDensity_update_target W hpos horder hgraphOrder i v w] at hten simpa using hten
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.equationTen_interventionMarginalDensity_fiber_product · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderConditionalKernel.lean:157
def decoderInterventionCoordinateMeasure

The normalized replacement density, viewed as a probability measure on the target's scalar coordinate.

Definition (Lean source)
n :
DAG (Fin n)
W :
i :
Fin n
decoderInterventionCoordinateMeasure W hpos i :
Causalean.Graph.FiniteDensity.unitIntervalReference.withDensity (mechanismInterventionDensity W hpos i).density
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.decoderInterventionCoordinateMeasure · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderConditionalKernel.lean:183
instance decoderInterventionCoordinateMeasure_isProbability

Normalization of the replacement density makes its coordinate measure a probability measure.

Definition (Lean source)
instance decoderInterventionCoordinateMeasure_isProbability {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (i : Fin n) : IsProbabilityMeasure (decoderInterventionCoordinateMeasure W hpos i) := by constructor rw [decoderInterventionCoordinateMeasure, withDensity_apply _ MeasurableSet.univ] simpa only [Measure.restrict_univ] using (mechanismInterventionDensity W hpos i).normalized_density
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.decoderInterventionCoordinateMeasure_isProbability · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderConditionalKernel.lean:193
def equationElevenClampedScore

A globally measurable clamped extension of the target log-ratio score along a predecessor fiber. On the unit interval it is the score appearing in equation (11).

Definition (Lean source)
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
i :
Fin n
zw :
PredecessorLatentCube order i × ℝ
equationElevenClampedScore W order i zw :
w :
max 0 (min 1 zw.2)
v :
log (θ.q (W.targetPerm i) w / θ.p (W.targetPerm i) (update v (W.targetPerm i) w))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.equationElevenClampedScore · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderConditionalKernel.lean:205
theorem measurable_equationElevenClampedScore

Smoothness on the compact cube makes the clamped equation-(11) score jointly measurable in predecessor coordinates and the target coordinate. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
i :
Fin n
Proof (Lean source)
@[fun_prop] lemma measurable_equationElevenClampedScore {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (order : Fin n → ℕ) (i : Fin n) : Measurable (equationElevenClampedScore W order i) := by have hw : Continuous (fun zw : PredecessorLatentCube order i × ℝ => max 0 (min 1 zw.2)) := by fun_prop have hwmem : ∀ zw : PredecessorLatentCube order i × ℝ, max 0 (min 1 zw.2) ∈ Icc (0 : ℝ) 1 := by intro zw exact ⟨le_max_left _ _, max_le zero_le_one (min_le_left _ _)⟩ have hbase : Continuous (predecessorCubeLatentState W order i) := by apply continuous_pi intro a simp only [predecessorCubeLatentState] split <;> fun_prop have hv : Continuous (fun zw : PredecessorLatentCube order i × ℝ => update (predecessorCubeLatentState W order i zw.1) (W.targetPerm i) (max 0 (min 1 zw.2))) := by apply continuous_pi intro k by_cases hki : k = W.targetPerm i · subst k simpa using hw · have heq : (fun a : PredecessorLatentCube order i × ℝ => update (predecessorCubeLatentState W order i a.1) (W.targetPerm i) (max 0 (min 1 a.2)) k) = fun a => predecessorCubeLatentState W order i a.1 k := by funext a simp [update, hki] rw [heq] exact (continuous_apply k).comp (hbase.comp continuous_fst) have hvmem : ∀ zw : PredecessorLatentCube order i × ℝ, update (predecessorCubeLatentState W order i zw.1) (W.targetPerm i) (max 0 (min 1 zw.2)) ∈ latentCube n := by intro zw k hk by_cases hki : k = W.targetPerm i · subst k simpa using hwmem zw · simp [update, hki] exact predecessorCubeLatentState_mem_latentCube W order i zw.1 k (Set.mem_univ k) have hq := (hpos.2.2.2.1 (W.targetPerm i)).continuousOn.comp_continuous hw hwmem have hp := (hpos.2.2.1 (W.targetPerm i)).continuousOn.comp_continuous hv hvmem have hpne : ∀ zw : PredecessorLatentCube order i × ℝ, θ.p (W.targetPerm i) (update (predecessorCubeLatentState W order i zw.1) (W.targetPerm i) (max 0 (min 1 zw.2))) ≠ 0 := fun zw => ne_of_gt (hpos.1 _ _ (hvmem zw)) have hqne : ∀ zw : PredecessorLatentCube order i × ℝ, θ.q (W.targetPerm i) (max 0 (min 1 zw.2)) ≠ 0 := fun zw => ne_of_gt (hpos.2.1 _ _ (hwmem zw)) exact (hq.div hp hpne |>.log (fun zw => div_ne_zero (hqne zw) (hpne zw))).measurable
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.measurable_equationElevenClampedScore · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderConditionalKernel.lean:217
def equationElevenPredecessorKernel

The equation-(11) Markov kernel on predecessor latent coordinates: draw the target from its replacement density and push it through the target log-ratio score.

Definition (Lean source)
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
i :
Fin n
equationElevenPredecessorKernel W hpos order i :
(((Kernel.id : Kernel (PredecessorLatentCube order i) _) ∥ₖ Kernel.const Unit (decoderInterventionCoordinateMeasure W hpos i)).comap (fun z => (z, ())) (by fun_prop)).map (equationElevenClampedScore W order i)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.equationElevenPredecessorKernel · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderConditionalKernel.lean:272
instance equationElevenPredecessorKernel_isMarkov

The equation-(11) predecessor kernel has unit mass on every predecessor fiber.

Definition (Lean source)
instance equationElevenPredecessorKernel_isMarkov {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (order : Fin n → ℕ) (i : Fin n) : IsMarkovKernel (equationElevenPredecessorKernel W hpos order i) := by unfold equationElevenPredecessorKernel let base : Kernel (PredecessorLatentCube order i × Unit) (PredecessorLatentCube order i × ℝ) := Kernel.id ∥ₖ Kernel.const Unit (decoderInterventionCoordinateMeasure W hpos i) haveI : IsMarkovKernel base := by dsimp only [base]; infer_instance haveI : IsMarkovKernel (base.comap (fun z => (z, ())) (by fun_prop)) := Kernel.IsMarkovKernel.comap base (by fun_prop) exact Kernel.IsMarkovKernel.map _ (measurable_equationElevenClampedScore W hpos order i)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.equationElevenPredecessorKernel_isMarkov · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderConditionalKernel.lean:283
theorem equationElevenPredecessorKernel_apply_Iic

Every lower-interval probability of the predecessor kernel is exactly the explicit equation-(11) conditional-CDF integral. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
i :
Fin n
z :
t :
((equationElevenPredecessorKernel W hpos order i) z (Iic t)).toReal
Proof (Lean source)
lemma equationElevenPredecessorKernel_apply_Iic {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (order : Fin n → ℕ) (i : Fin n) (z : PredecessorLatentCube order i) (t : ℝ) : ((equationElevenPredecessorKernel W hpos order i) z (Iic t)).toReal = equationElevenConditionalRatioCDF θ (W.targetPerm i) t (predecessorCubeLatentState W order i z) := by rw [equationElevenPredecessorKernel, Kernel.map_apply' _ (measurable_equationElevenClampedScore W hpos order i) _ measurableSet_Iic, Kernel.comap_apply, Kernel.parallelComp_apply, Kernel.id_apply, Kernel.const_apply] rw [Measure.dirac_prod] rw [Measure.map_apply (by fun_prop) (measurableSet_Iic.preimage (measurable_equationElevenClampedScore W hpos order i))] change ((decoderInterventionCoordinateMeasure W hpos i) {w | equationElevenClampedScore W order i (z, w) ≤ t}).toReal = _ rw [decoderInterventionCoordinateMeasure] have hset : MeasurableSet {w | equationElevenClampedScore W order i (z, w) ≤ t} := measurableSet_Iic.preimage ((measurable_equationElevenClampedScore W hpos order i).comp (measurable_const.prodMk measurable_id)) rw [withDensity_apply _ hset] let v := predecessorCubeLatentState W order i z let score : ℝ → ℝ := fun w => log (θ.q (W.targetPerm i) w / θ.p (W.targetPerm i) (update v (W.targetPerm i) w)) let f : ℝ → ℝ := fun w => if score w ≤ t then θ.q (W.targetPerm i) w else 0 have hf_nonneg : 0 ≤ᵐ[volume.restrict (Icc (0 : ℝ) 1)] f := by filter_upwards [ae_restrict_mem measurableSet_Icc] with w hw simp only [f] split · exact le_of_lt (hpos.2.1 _ w hw) · exact le_rfl have hf_meas : AEStronglyMeasurable f (volume.restrict (Icc (0 : ℝ) 1)) := by have hscore : ContinuousOn score (Icc (0 : ℝ) 1) := by dsimp only [score, v] have hq := (hpos.2.2.2.1 (W.targetPerm i)).continuousOn have hbase := predecessorCubeLatentState_mem_latentCube W order i z have hp : ContinuousOn (fun w => θ.p (W.targetPerm i) (update (predecessorCubeLatentState W order i z) (W.targetPerm i) w)) (Icc (0 : ℝ) 1) := by apply (hpos.2.2.1 (W.targetPerm i)).continuousOn.comp · fun_prop · intro w hw k hk by_cases hki : k = W.targetPerm i · subst k simpa using hw · simp [update, hki] exact hbase k (Set.mem_univ k) have hpne : ∀ w ∈ Icc (0 : ℝ) 1, θ.p (W.targetPerm i) (update (predecessorCubeLatentState W order i z) (W.targetPerm i) w) ≠ 0 := fun w hw => ne_of_gt (hpos.1 _ _ (by intro k hk by_cases hki : k = W.targetPerm i · subst k simpa using hw · simp [update, hki] exact hbase k (Set.mem_univ k))) exact (hq.div hp hpne).log (fun w hw => div_ne_zero (ne_of_gt (hpos.2.1 _ w hw)) (hpne w hw)) have hqae : AEMeasurable (θ.q (W.targetPerm i)) (volume.restrict (Icc (0 : ℝ) 1)) := (hpos.2.2.2.1 (W.targetPerm i)).continuousOn.aemeasurable measurableSet_Icc have hscoreae : AEMeasurable score (volume.restrict (Icc (0 : ℝ) 1)) := hscore.aemeasurable measurableSet_Icc let qm := hqae.mk let sm := hscoreae.mk have hfm : Measurable (fun w => if sm w ≤ t then qm w else 0) := by exact Measurable.ite (measurableSet_le hscoreae.measurable_mk measurable_const) hqae.measurable_mk measurable_const apply hfm.aestronglyMeasurable.congr filter_upwards [hqae.ae_eq_mk, hscoreae.ae_eq_mk] with w hqw hsw simp only [qm, sm, f] at hqw hsw ⊢ rw [← hqw, ← hsw] rw [equationElevenConditionalRatioCDF] change _ = ∫ w in Icc (0 : ℝ) 1, f w rw [integral_eq_lintegral_of_nonneg_ae hf_nonneg hf_meas] congr 1 rw [← lintegral_indicator hset] apply lintegral_congr_ae filter_upwards [ae_restrict_mem measurableSet_Icc] with w hw have hclamp : max 0 (min 1 w) = w := by rw [min_eq_right hw.2, max_eq_right hw.1] have hscoreeq : equationElevenClampedScore W order i (z, w) = score w := by simp only [equationElevenClampedScore, score, v, hclamp] simp only [indicator, Set.mem_ofPred_eq, hscoreeq] simp only [mechanismInterventionDensity, interventionDensityOfRealCube, interventionDensityOfCube, hclamp] by_cases hs : score w ≤ t · simp [f, hs] · simp [f, hs]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.equationElevenPredecessorKernel_apply_Iic · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderConditionalKernel.lean:299
def equationElevenScoreImageKernel

Transporting the predecessor kernel through the compact triangular inverse gives the equation-(11) kernel on the realized predecessor-score image.

Definition (Lean source)
n :
DAG (Fin n)
s :
θ :
W :
hsign :
order :
Fin n → ℕ
hgraphOrder :
i :
Fin n
equationElevenScoreImageKernel s W hpos hmix hone hsign horder hgraphOrder i :
Kernel (range (predecessorScoreMap W order i)) ℝ
(equationElevenPredecessorKernel W hpos order i).comap (predecessorScoreHomeomorph s W hpos hmix hone hsign horder hgraphOrder i).symm (continuous_predecessorScoreInverse s W hpos hmix hone hsign horder hgraphOrder i).measurable
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.equationElevenScoreImageKernel · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderConditionalKernel.lean:394
instance equationElevenScoreImageKernel_isMarkov

The score-image transport of the equation-(11) kernel remains Markov.

Definition (Lean source)
instance equationElevenScoreImageKernel_isMarkov {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (hsign : FixedOwnDerivativeSign G s θ) {order : Fin n → ℕ} (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) (i : Fin n) : IsMarkovKernel (equationElevenScoreImageKernel s W hpos hmix hone hsign horder hgraphOrder i) := by exact Kernel.IsMarkovKernel.comap _ (continuous_predecessorScoreInverse s W hpos hmix hone hsign horder hgraphOrder i).measurable
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.equationElevenScoreImageKernel_isMarkov · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderConditionalKernel.lean:412
theorem equationElevenScoreImageKernel_apply_Iic

On every realized predecessor score, the transported kernel's lower-interval probability is the explicit equation-(11) integral at the reconstructed predecessor coordinates. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ :
W :
hsign :
order :
Fin n → ℕ
hgraphOrder :
i :
Fin n
ell :
t :
((equationElevenScoreImageKernel s W hpos hmix hone hsign horder hgraphOrder i) ell (Iic t)).toReal
= equationElevenConditionalRatioCDF θ (W.targetPerm i) t (predecessorCubeLatentState W order i ((predecessorScoreHomeomorph s W hpos hmix hone hsign horder hgraphOrder i).symm ell))
Proof (Lean source)
lemma equationElevenScoreImageKernel_apply_Iic {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (hsign : FixedOwnDerivativeSign G s θ) {order : Fin n → ℕ} (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) (i : Fin n) (ell : range (predecessorScoreMap W order i)) (t : ℝ) : ((equationElevenScoreImageKernel s W hpos hmix hone hsign horder hgraphOrder i) ell (Iic t)).toReal = equationElevenConditionalRatioCDF θ (W.targetPerm i) t (predecessorCubeLatentState W order i ((predecessorScoreHomeomorph s W hpos hmix hone hsign horder hgraphOrder i).symm ell)) := by rw [equationElevenScoreImageKernel, Kernel.comap_apply] exact equationElevenPredecessorKernel_apply_Iic W hpos order i _ t
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.equationElevenScoreImageKernel_apply_Iic · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderConditionalKernel.lean:429
theorem equationElevenScoreImageKernel_apply_Iic_of_latentState

At every predecessor score realized by a latent cube point, the transported Markov kernel has exactly the equation-(11) lower-interval probability at that latent state. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ :
W :
hsign :
order :
Fin n → ℕ
hgraphOrder :
i :
Fin n
v :
hv :
v ∈ latentCube n
t :
ell :
⟨familyProjection (observedLawLogRatio W.law) (predecessorSet order i) (W.mix v), observedPredecessorLogRatio_mem_scoreRange W hpos hmix hone horder hgraphOrder i v hv⟩ (: range (predecessorScoreMap W order i))
((equationElevenScoreImageKernel s W hpos hmix hone hsign horder hgraphOrder i) ell (Iic t)).toReal
= equationElevenConditionalRatioCDF θ (W.targetPerm i) t v
Proof (Lean source)
lemma equationElevenScoreImageKernel_apply_Iic_of_latentState {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (hsign : FixedOwnDerivativeSign G s θ) {order : Fin n → ℕ} (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) (i : Fin n) (v : LatentState n) (hv : v ∈ latentCube n) (t : ℝ) : let ell : range (predecessorScoreMap W order i) := ⟨familyProjection (observedLawLogRatio W.law) (predecessorSet order i) (W.mix v), observedPredecessorLogRatio_mem_scoreRange W hpos hmix hone horder hgraphOrder i v hv⟩ ((equationElevenScoreImageKernel s W hpos hmix hone hsign horder hgraphOrder i) ell (Iic t)).toReal = equationElevenConditionalRatioCDF θ (W.targetPerm i) t v := by dsimp only let z := predecessorLatentCubeOfState W order i v hv let e := predecessorScoreHomeomorph s W hpos hmix hone hsign horder hgraphOrder i let ell : range (predecessorScoreMap W order i) := ⟨familyProjection (observedLawLogRatio W.law) (predecessorSet order i) (W.mix v), observedPredecessorLogRatio_mem_scoreRange W hpos hmix hone horder hgraphOrder i v hv⟩ have hinv : e.symm ell = z := by apply e.injective rw [e.apply_symm_apply] apply Subtype.ext exact (predecessorScoreMap_of_latentState W hpos hmix hone horder hgraphOrder i v hv).symm rw [equationElevenScoreImageKernel_apply_Iic s W hpos hmix hone hsign horder hgraphOrder i ell t] apply equationElevenConditionalRatioCDF_eq_of_parents_eq θ (W.targetPerm i) t intro a ha let k := W.targetPerm.symm a have hkParent : k ∈ environmentParentSet W i := by simpa [k, environmentParentSet, parents] using ha have hkPred := environmentParentSet_subset_predecessorSet_of_transitiveClosure W horder hgraphOrder i hkParent rw [hinv] simpa [z, k] using predecessorCubeLatentState_ofState_apply W order i v hv k hkPred
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.equationElevenScoreImageKernel_apply_Iic_of_latentState · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderConditionalKernel.lean:451
def predecessorScoreRangeRetraction

A measurable retraction of the ambient predecessor-score space onto the compact realized score image. Off the image it uses the score of the zero predecessor vector.

Definition (Lean source)
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
i :
Fin n
ell :
predecessorScoreRangeRetraction W order i ell :
by classical exact if h : ell ∈ range (predecessorScoreMap W order i) then ⟨ell, h⟩ else ⟨predecessorScoreMap W order i (fun _ => ⟨0, by norm_num⟩), ⟨fun _
=> ⟨0, by norm_num⟩, rfl⟩⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.predecessorScoreRangeRetraction · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderConditionalKernel.lean:493
theorem measurable_predecessorScoreRangeRetraction

The compact-score retraction is measurable. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
i :
Fin n
Proof (Lean source)
@[fun_prop] lemma measurable_predecessorScoreRangeRetraction {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (order : Fin n → ℕ) (i : Fin n) : Measurable (predecessorScoreRangeRetraction W order i) := by classical have hclosed : IsClosed (range (predecessorScoreMap W order i)) := by simpa only [Set.image_univ] using (isCompact_univ.image (continuous_predecessorScoreMap W hpos order i)).isClosed unfold predecessorScoreRangeRetraction apply Measurable.dite measurable_id measurable_const hclosed.measurableSet
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.measurable_predecessorScoreRangeRetraction · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderConditionalKernel.lean:506
def equationElevenAmbientKernel

The equation-(11) kernel on the full predecessor-score space, obtained by a measurable retraction to the compact realized score image. Its off-support values are immaterial.

Definition (Lean source)
n :
DAG (Fin n)
s :
θ :
W :
hsign :
order :
Fin n → ℕ
hgraphOrder :
i :
Fin n
equationElevenAmbientKernel s W hpos hmix hone hsign horder hgraphOrder i :
(equationElevenScoreImageKernel s W hpos hmix hone hsign horder hgraphOrder i).comap (predecessorScoreRangeRetraction W order i) (measurable_predecessorScoreRangeRetraction W hpos order i)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.equationElevenAmbientKernel · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderConditionalKernel.lean:521
instance equationElevenAmbientKernel_isMarkov

The ambient extension of the equation-(11) kernel remains Markov.

Definition (Lean source)
instance equationElevenAmbientKernel_isMarkov {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (hsign : FixedOwnDerivativeSign G s θ) {order : Fin n → ℕ} (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) (i : Fin n) : IsMarkovKernel (equationElevenAmbientKernel s W hpos hmix hone hsign horder hgraphOrder i) := by exact Kernel.IsMarkovKernel.comap _ (measurable_predecessorScoreRangeRetraction W hpos order i)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.equationElevenAmbientKernel_isMarkov · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderConditionalKernel.lean:539
theorem equationElevenAmbientKernel_apply_Iic_of_latentState

On every predecessor score realized by a latent cube point, the ambient kernel evaluates to the explicit equation-(11) conditional CDF. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ :
W :
hsign :
order :
Fin n → ℕ
hgraphOrder :
i :
Fin n
v :
hv :
v ∈ latentCube n
t :
((equationElevenAmbientKernel s W hpos hmix hone hsign horder hgraphOrder i) (familyProjection (observedLawLogRatio W.law) (predecessorSet order i) (W.mix v)) (Iic t)).toReal
= equationElevenConditionalRatioCDF θ (W.targetPerm i) t v
Proof (Lean source)
lemma equationElevenAmbientKernel_apply_Iic_of_latentState {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (hsign : FixedOwnDerivativeSign G s θ) {order : Fin n → ℕ} (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) (i : Fin n) (v : LatentState n) (hv : v ∈ latentCube n) (t : ℝ) : ((equationElevenAmbientKernel s W hpos hmix hone hsign horder hgraphOrder i) (familyProjection (observedLawLogRatio W.law) (predecessorSet order i) (W.mix v)) (Iic t)).toReal = equationElevenConditionalRatioCDF θ (W.targetPerm i) t v := by let ell := familyProjection (observedLawLogRatio W.law) (predecessorSet order i) (W.mix v) have hell : ell ∈ range (predecessorScoreMap W order i) := observedPredecessorLogRatio_mem_scoreRange W hpos hmix hone horder hgraphOrder i v hv rw [equationElevenAmbientKernel, Kernel.comap_apply] have hretract : predecessorScoreRangeRetraction W order i ell = ⟨ell, hell⟩ := by simp [predecessorScoreRangeRetraction, hell] rw [hretract] exact equationElevenScoreImageKernel_apply_Iic_of_latentState s W hpos hmix hone hsign horder hgraphOrder i v hv t
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.equationElevenAmbientKernel_apply_Iic_of_latentState · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderConditionalKernel.lean:556
theorem lmarginal_eq_self_of_update_eq Lemma lmarginal_eq_self_of_update_eq in the paper ↗

Integrating out coordinates on which a measurable function is invariant leaves the function unchanged when every coordinate reference measure has unit mass. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
V :
Type*
V → Type*
∀ i, MeasurableSpace (X i)
μ :
∀ i, Measure (X i)
∀ i, IsProbabilityMeasure (μ i)
T :
f :
(∀ i, X i) → ℝ≥0∞
hf :
hinv :
∀ k ∈ T, ∀ x y, f (update x k y) = f x
(∫⋯∫⁻_T, f ∂μ) = f
Proof (Lean source)
lemma lmarginal_eq_self_of_update_eq {V : Type*} [DecidableEq V] {X : V → Type*} [∀ i, MeasurableSpace (X i)] (μ : ∀ i, Measure (X i)) [∀ i, IsProbabilityMeasure (μ i)] (T : Finset V) (f : (∀ i, X i) → ℝ≥0∞) (hf : Measurable f) (hinv : ∀ k ∈ T, ∀ x y, f (update x k y) = f x) : (∫⋯∫⁻_T, f ∂μ) = f := by induction T using Finset.induction with | empty => simp | @insert k T hk ih => rw [MeasureTheory.lmarginal_insert' _ hf hk] have hinner : (fun x => ∫⁻ y, f (update x k y) ∂μ k) = f := by funext x simp_rw [hinv k (mem_insert_self k T) x] simp rw [hinner] exact ih (fun j hj => hinv j (mem_insert_of_mem hj))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.lmarginal_eq_self_of_update_eq · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderConditionalKernel.lean:584
theorem equationTen_retainedDensity_update_outside

The factorized retained density from equation (10) is invariant under every coordinate outside the target-plus-predecessor set. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
hgraphOrder :
i k :
Fin n
hk :
k ∉ decoderRetainedLatentSet W order i
v :
x :
q.density ((update v k x) (W.targetPerm i)) * B.partialDensity (A.erase (W.targetPerm i)) (update v k x)
= q.density (v (W.targetPerm i)) * B.partialDensity (A.erase (W.targetPerm i)) v
Proof (Lean source)
lemma equationTen_retainedDensity_update_outside {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) {order : Fin n → ℕ} (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) (i k : Fin n) (hk : k ∉ decoderRetainedLatentSet W order i) (v : LatentState n) (x : ℝ) : let B := mechanismUnitCubeFactorization hpos let q := mechanismInterventionDensity W hpos i let A := decoderRetainedLatentSet W order i q.density ((update v k x) (W.targetPerm i)) * B.partialDensity (A.erase (W.targetPerm i)) (update v k x) = q.density (v (W.targetPerm i)) * B.partialDensity (A.erase (W.targetPerm i)) v := by dsimp only have hkt : k ≠ W.targetPerm i := by intro h subst k exact hk (by simp [decoderRetainedLatentSet]) congr 1 · simp [update, hkt.symm] · unfold partialDensity apply Finset.prod_congr rfl intro l hl apply (mechanismUnitCubeFactorization hpos).local_factor l intro a ha have haA : a ∈ decoderRetainedLatentSet W order i := by rcases Finset.mem_insert.mp ha with rfl | ha · exact (Finset.mem_erase.mp hl).2 · exact decoderRetainedLatentSet_parentClosed W horder hgraphOrder i (Finset.mem_erase.mp hl).2 ha have hka : k ≠ a := fun h => hk (h ▸ haA) simp [update, hka.symm]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.equationTen_retainedDensity_update_outside · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderConditionalKernel.lean:605
theorem equationTen_retainedMarginalMeasure

Equation (10) as an equality of retained-coordinate measures: the actual intervention law has the same target-plus-predecessor marginal as the explicit replacement-density product. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
hgraphOrder :
i :
Fin n
Measure.map (coordinateProjection (X := fun _ : Fin n => ℝ) A) (interventionalLaw θ (W.targetPerm i))
= Measure.map (coordinateProjection (X := fun _ : Fin n => ℝ) A) ((Measure.pi (fun _ : Fin n => unitIntervalReference)).withDensity (fun v => q.density (v (W.targetPerm i)) * B.partialDensity (A.erase (W.targetPerm i)) v))
Proof (Lean source)
lemma equationTen_retainedMarginalMeasure {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) {order : Fin n → ℕ} (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) (i : Fin n) : let B := mechanismUnitCubeFactorization hpos let q := mechanismInterventionDensity W hpos i let A := decoderRetainedLatentSet W order i Measure.map (coordinateProjection (X := fun _ : Fin n => ℝ) A) (interventionalLaw θ (W.targetPerm i)) = Measure.map (coordinateProjection (X := fun _ : Fin n => ℝ) A) ((Measure.pi (fun _ : Fin n => Causalean.Graph.FiniteDensity.unitIntervalReference)).withDensity (fun v => q.density (v (W.targetPerm i)) * B.partialDensity (A.erase (W.targetPerm i)) v)) := by dsimp only let B := mechanismUnitCubeFactorization hpos let q := mechanismInterventionDensity W hpos i let A := decoderRetainedLatentSet W order i have hσ : ∀ _ : Fin n, SigmaFinite Causalean.Graph.FiniteDensity.unitIntervalReference := fun _ => by unfold Causalean.Graph.FiniteDensity.unitIntervalReference infer_instance have hprob : ∀ _ : Fin n, IsProbabilityMeasure Causalean.Graph.FiniteDensity.unitIntervalReference := fun _ => by constructor unfold Causalean.Graph.FiniteDensity.unitIntervalReference simp [Real.volume_Icc] have hBint : Measurable (B.interventionDensity (W.targetPerm i) q) := @measurable_interventionDensity (Fin n) _ _ (fun _ : Fin n => ℝ) _ (fun _ : Fin n => Causalean.Graph.FiniteDensity.unitIntervalReference) hσ G B (W.targetPerm i) q have hBpartial : Measurable (B.partialDensity (A.erase (W.targetPerm i))) := @measurable_partialDensity (Fin n) _ _ (fun _ : Fin n => ℝ) _ (fun _ : Fin n => Causalean.Graph.FiniteDensity.unitIntervalReference) hσ G B (A.erase (W.targetPerm i)) rw [← mechanismUnitCubeFactorization_interventionMeasure W hpos i] unfold interventionMeasure apply @map_coordinateProjection_withDensity_eq_of_lmarginal_eq (Fin n) _ (fun _ : Fin n => ℝ) _ _ (fun _ : Fin n => Causalean.Graph.FiniteDensity.unitIntervalReference) hσ A · exact hBint · exact q.measurable_density.comp (measurable_pi_apply _) |>.mul hBpartial · rw [equationTen_interventionMarginalDensity W hpos horder hgraphOrder i] symm apply @lmarginal_eq_self_of_update_eq (Fin n) _ (fun _ : Fin n => ℝ) _ (fun _ : Fin n => Causalean.Graph.FiniteDensity.unitIntervalReference) hprob (univ \ A) · exact (q.measurable_density.comp (measurable_pi_apply _)).mul hBpartial · intro k hk v x exact equationTen_retainedDensity_update_outside W hpos horder hgraphOrder i k (show k ∉ decoderRetainedLatentSet W order i from (Finset.mem_sdiff.mp hk).2) v x
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.equationTen_retainedMarginalMeasure · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderConditionalKernel.lean:643
theorem rawObservedConditionalRatioCDF_ae_eq_kernel_of_compProd Lemma rawObservedConditionalRatioCDF_ae_eq_kernel_of_compProd in the paper ↗

A candidate finite kernel whose compositional product is the observed predecessor/score law is the raw conditional-ratio CDF at every fixed threshold. This is the conditional-distribution uniqueness step used after equation (10). Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
order :
Fin n → ℕ
i :
Fin n
hjoint :
Measure.map (fun x ↦ (familyProjection (observedLawLogRatio laws.1) (predecessorSet order i) x, observedLawLogRatio laws.1 i x)) (laws.1 i.succ)
= Measure.map (familyProjection (observedLawLogRatio laws.1) (predecessorSet order i)) (laws.1 i.succ) ⊗ₘ κ
t :
(fun ell ↦ rawObservedConditionalRatioCDF laws order i t ell)
=ᵐ[ Measure.map (familyProjection (observedLawLogRatio laws.1) (predecessorSet order i)) (laws.1 i.succ)] fun ell ↦ (κ ell (Iic t)).toReal
Proof (Lean source)
lemma rawObservedConditionalRatioCDF_ae_eq_kernel_of_compProd {n : ℕ} (laws : ObservedProbabilityLawFamily n) (order : Fin n → ℕ) (i : Fin n) (κ : Kernel (PredecessorLogRatios order i) ℝ) [IsFiniteKernel κ] (hjoint : Measure.map (fun x ↦ (familyProjection (observedLawLogRatio laws.1) (predecessorSet order i) x, observedLawLogRatio laws.1 i x)) (laws.1 i.succ) = Measure.map (familyProjection (observedLawLogRatio laws.1) (predecessorSet order i)) (laws.1 i.succ) ⊗ₘ κ) : ∀ t, (fun ell ↦ rawObservedConditionalRatioCDF laws order i t ell) =ᵐ[ Measure.map (familyProjection (observedLawLogRatio laws.1) (predecessorSet order i)) (laws.1 i.succ)] fun ell ↦ (κ ell (Iic t)).toReal := by letI : IsProbabilityMeasure (laws.1 i.succ) := laws.2 i.succ have hcond := ProbabilityTheory.condDistrib_ae_eq_of_measure_eq_compProd (familyProjection (observedLawLogRatio laws.1) (predecessorSet order i)) (measurable_observedLawLogRatio laws.1 i).aemeasurable hjoint intro t filter_upwards [hcond] with ell hell have hfinite : ∀ e, IsFiniteMeasure (laws.1 e) := by intro e letI : IsProbabilityMeasure (laws.1 e) := laws.2 e infer_instance rw [rawObservedConditionalRatioCDF, dif_pos hfinite, hell]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.rawObservedConditionalRatioCDF_ae_eq_kernel_of_compProd · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderConditionalKernel.lean:704
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.DecoderContinuousVersion 11 declarations This file proves continuity of the equation-(11) fiber integral and packages the ambient Markov kernel as the continuous conditional-CDF version selected by the decoder.

Continuous equation-(11) conditional-CDF version

This file proves continuity of the equation-(11) fiber integral and packages the ambient Markov kernel as the continuous conditional-CDF version selected by the decoder.

theorem continuous_equationElevenClampedScore

The clamped equation-(11) score is jointly continuous in predecessor and target coordinates. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
i :
Fin n
Proof (Lean source)
lemma continuous_equationElevenClampedScore {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (order : Fin n → ℕ) (i : Fin n) : Continuous (equationElevenClampedScore W order i) := by have hw : Continuous (fun zw : PredecessorLatentCube order i × ℝ => max 0 (min 1 zw.2)) := by fun_prop have hwmem : ∀ zw : PredecessorLatentCube order i × ℝ, max 0 (min 1 zw.2) ∈ Icc (0 : ℝ) 1 := by intro zw exact ⟨le_max_left _ _, max_le zero_le_one (min_le_left _ _)⟩ have hbase : Continuous (predecessorCubeLatentState W order i) := by apply continuous_pi intro a simp only [predecessorCubeLatentState] split <;> fun_prop have hv : Continuous (fun zw : PredecessorLatentCube order i × ℝ => update (predecessorCubeLatentState W order i zw.1) (W.targetPerm i) (max 0 (min 1 zw.2))) := by apply continuous_pi intro k by_cases hki : k = W.targetPerm i · subst k simpa using hw · have heq : (fun a : PredecessorLatentCube order i × ℝ => update (predecessorCubeLatentState W order i a.1) (W.targetPerm i) (max 0 (min 1 a.2)) k) = fun a => predecessorCubeLatentState W order i a.1 k := by funext a simp [update, hki] rw [heq] exact (continuous_apply k).comp (hbase.comp continuous_fst) have hvmem : ∀ zw : PredecessorLatentCube order i × ℝ, update (predecessorCubeLatentState W order i zw.1) (W.targetPerm i) (max 0 (min 1 zw.2)) ∈ latentCube n := by intro zw k hk by_cases hki : k = W.targetPerm i · subst k simpa using hwmem zw · simp [update, hki] exact predecessorCubeLatentState_mem_latentCube W order i zw.1 k (Set.mem_univ k) have hq := (hpos.2.2.2.1 (W.targetPerm i)).continuousOn.comp_continuous hw hwmem have hp := (hpos.2.2.1 (W.targetPerm i)).continuousOn.comp_continuous hv hvmem have hpne : ∀ zw : PredecessorLatentCube order i × ℝ, θ.p (W.targetPerm i) (update (predecessorCubeLatentState W order i zw.1) (W.targetPerm i) (max 0 (min 1 zw.2))) ≠ 0 := fun zw => ne_of_gt (hpos.1 _ _ (hvmem zw)) have hqne : ∀ zw : PredecessorLatentCube order i × ℝ, θ.q (W.targetPerm i) (max 0 (min 1 zw.2)) ≠ 0 := fun zw => ne_of_gt (hpos.2.1 _ _ (hwmem zw)) exact (hq.div hp hpne).log (fun zw => div_ne_zero (hqne zw) (hpne zw))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuous_equationElevenClampedScore · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderContinuousVersion.lean:18
def equationElevenPredecessorCDF

The equation-(11) fiber integral on the compact predecessor cube.

Definition (Lean source)
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
i :
Fin n
z :
ℝ × PredecessorLatentCube order i
equationElevenPredecessorCDF W order i z :
∫ w in Icc (0 : ℝ) 1, if equationElevenClampedScore W order i (z.2, w)
≤ z.1 then θ.q (W.targetPerm i) w else 0
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.equationElevenPredecessorCDF · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderContinuousVersion.lean:72
theorem continuous_equationElevenPredecessorCDF

The equation-(11) fiber integral varies continuously with both its threshold and predecessor coordinates. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ :
W :
hsign :
order :
Fin n → ℕ
i :
Fin n
Proof (Lean source)
lemma continuous_equationElevenPredecessorCDF {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hsign : FixedOwnDerivativeSign G s θ) (order : Fin n → ℕ) (i : Fin n) : Continuous (equationElevenPredecessorCDF W order i) := by let μ := volume.restrict (Icc (0 : ℝ) 1) let F : (ℝ × PredecessorLatentCube order i) → ℝ → ℝ := fun z w => if equationElevenClampedScore W order i (z.2, w) ≤ z.1 then θ.q (W.targetPerm i) w else 0 have hqcont : ContinuousOn (θ.q (W.targetPerm i)) (Icc (0 : ℝ) 1) := (hpos.2.2.2.1 (W.targetPerm i)).continuousOn have hqint : Integrable (fun w => ‖θ.q (W.targetPerm i) w‖) μ := by exact (hqcont.norm.integrableOn_compact isCompact_Icc) rw [continuous_iff_continuousAt] intro z have hmono : StrictMonoOn (fun w => equationElevenClampedScore W order i (z.2, w)) (Icc (0 : ℝ) 1) ∨ StrictAntiOn (fun w => equationElevenClampedScore W order i (z.2, w)) (Icc (0 : ℝ) 1) := by let v := predecessorCubeLatentState W order i z.2 have hv : v ∈ latentCube n := predecessorCubeLatentState_mem_latentCube W order i z.2 rcases s.signed (W.targetPerm i) with hneg | hposi · right have h := fixedOwnDerivativeSign_strictAntiOn s θ hpos hsign (W.targetPerm i) v hv hneg apply h.congr intro w hw simp only [equationElevenClampedScore] rw [min_eq_right hw.2, max_eq_right hw.1] · left have h := fixedOwnDerivativeSign_strictMonoOn s θ hpos hsign (W.targetPerm i) v hv hposi apply h.congr intro w hw simp only [equationElevenClampedScore] rw [min_eq_right hw.2, max_eq_right hw.1] have hlevel : Subsingleton {w : ℝ | w ∈ Icc (0 : ℝ) 1 ∧ equationElevenClampedScore W order i (z.2, w) = z.1} := by intro a ha b hb rcases hmono with hm | hm · apply hm.injOn ha.1 hb.1 calc equationElevenClampedScore W order i (z.2, a) = z.1 := ha.2 _ = equationElevenClampedScore W order i (z.2, b) := hb.2.symm · apply hm.injOn ha.1 hb.1 calc equationElevenClampedScore W order i (z.2, a) = z.1 := ha.2 _ = equationElevenClampedScore W order i (z.2, b) := hb.2.symm have hne : ∀ᵐ w ∂μ, equationElevenClampedScore W order i (z.2, w) ≠ z.1 := by rw [MeasureTheory.ae_restrict_iff' measurableSet_Icc, MeasureTheory.ae_iff] have hset : {w | ¬(w ∈ Icc (0 : ℝ) 1 → equationElevenClampedScore W order i (z.2, w) ≠ z.1)} = {w | w ∈ Icc (0 : ℝ) 1 ∧ equationElevenClampedScore W order i (z.2, w) = z.1} := by ext w by_cases hwmem : w ∈ Icc (0 : ℝ) 1 <;> by_cases heq : equationElevenClampedScore W order i (z.2, w) = z.1 <;> simp [hwmem, heq] rw [hset] exact hlevel.measure_zero volume apply MeasureTheory.continuousAt_of_dominated (F := F) (bound := fun w => ‖θ.q (W.targetPerm i) w‖) · filter_upwards with z' have hscore : Measurable (fun w => equationElevenClampedScore W order i (z'.2, w)) := (continuous_equationElevenClampedScore W hpos order i).measurable.comp (measurable_const.prodMk measurable_id) have hq : AEMeasurable (θ.q (W.targetPerm i)) μ := hqcont.aemeasurable measurableSet_Icc let qm := hq.mk (θ.q (W.targetPerm i)) have hm : Measurable (fun w => if equationElevenClampedScore W order i (z'.2, w) ≤ z'.1 then qm w else 0) := Measurable.ite (measurableSet_le hscore measurable_const) hq.measurable_mk measurable_const apply hm.aestronglyMeasurable.congr filter_upwards [hq.ae_eq_mk] with w hw simp only [F, qm] rw [← hw] · filter_upwards with z' filter_upwards with w by_cases h : equationElevenClampedScore W order i (z'.2, w) ≤ z'.1 · simp [F, h] · simp [F, h] · exact hqint · filter_upwards [hne] with w hw have hscore : ContinuousAt (fun z' : ℝ × PredecessorLatentCube order i => equationElevenClampedScore W order i (z'.2, w)) z := (continuous_equationElevenClampedScore W hpos order i).continuousAt.comp (continuousAt_snd.prodMk continuousAt_const) rcases lt_or_gt_of_ne hw with hlt | hgt · have hev := hscore.eventually_lt continuousAt_fst hlt have hc : ContinuousAt (fun _ : ℝ × PredecessorLatentCube order i => θ.q (W.targetPerm i) w) z := continuousAt_const apply hc.congr_of_eventuallyEq filter_upwards [hev] with z' hz' simp [F, hz'.le] · have hev := continuousAt_fst.eventually_lt hscore hgt have hc : ContinuousAt (fun _ : ℝ × PredecessorLatentCube order i => (0 : ℝ)) z := continuousAt_const apply hc.congr_of_eventuallyEq filter_upwards [hev] with z' hz' simp [F, not_le_of_gt hz']
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuous_equationElevenPredecessorCDF · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderContinuousVersion.lean:82
theorem equationElevenPredecessorCDF_eq

The compact fiber CDF is the explicit equation-(11) integral. the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
i :
Fin n
t :
z :
Proof (Lean source)
lemma equationElevenPredecessorCDF_eq {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (order : Fin n → ℕ) (i : Fin n) (t : ℝ) (z : PredecessorLatentCube order i) : equationElevenPredecessorCDF W order i (t, z) = equationElevenConditionalRatioCDF θ (W.targetPerm i) t (predecessorCubeLatentState W order i z) := by unfold equationElevenPredecessorCDF equationElevenConditionalRatioCDF apply MeasureTheory.integral_congr_ae filter_upwards [ae_restrict_mem measurableSet_Icc] with w hw simp only [equationElevenClampedScore] have hclamp : max 0 (min 1 w) = w := by simp [min_eq_right hw.2, max_eq_right hw.1] simp [hclamp]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.equationElevenPredecessorCDF_eq · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderContinuousVersion.lean:194
def equationElevenAmbientCDF

The ambient equation-(11) Markov kernel evaluated on lower intervals, packaged as a unit-interval-valued conditional CDF.

Definition (Lean source)
n :
DAG (Fin n)
s :
θ :
W :
hsign :
order :
Fin n → ℕ
hgraphOrder :
i :
Fin n
t :
ell :
equationElevenAmbientCDF s W hpos hmix hone hsign horder hgraphOrder i t ell :
Icc (0 : ℝ) 1
by let κ := equationElevenAmbientKernel s W hpos hmix hone hsign horder hgraphOrder i let y := (κ ell (Iic t)).toReal have hle : κ ell (Iic t)
≤ 1 := by calc κ ell (Iic t) ≤ κ ell univ := measure_mono (Set.subset_univ _) _ = 1 := measure_univ exact ⟨y, ENNReal.toReal_nonneg, by have hy : κ ell (Iic t) ≠ ⊤ := ne_top_of_le_ne_top ENNReal.one_ne_top hle simpa [y] using (ENNReal.toReal_le_toReal hy ENNReal.one_ne_top).2 hle⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.equationElevenAmbientCDF · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderContinuousVersion.lean:211
theorem measurable_equationElevenAmbientCDF

The ambient equation-(11) conditional CDF is jointly measurable. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ :
W :
hsign :
order :
Fin n → ℕ
hgraphOrder :
i :
Fin n
Measurable (fun z : ℝ × PredecessorLogRatios order i => equationElevenAmbientCDF s W hpos hmix hone hsign horder hgraphOrder i z.1 z.2)
Proof (Lean source)
lemma measurable_equationElevenAmbientCDF {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (hsign : FixedOwnDerivativeSign G s θ) {order : Fin n → ℕ} (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) (i : Fin n) : Measurable (fun z : ℝ × PredecessorLogRatios order i => equationElevenAmbientCDF s W hpos hmix hone hsign horder hgraphOrder i z.1 z.2) := by apply Measurable.subtype_mk exact ENNReal.measurable_toReal.comp (measurable_kernel_Iic_uncurry (equationElevenAmbientKernel s W hpos hmix hone hsign horder hgraphOrder i))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.measurable_equationElevenAmbientCDF · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderContinuousVersion.lean:235
theorem continuousOn_equationElevenAmbientCDF_scoreRange

On the realized predecessor-score range, the ambient equation-(11) CDF is continuous. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ :
W :
hsign :
order :
Fin n → ℕ
hgraphOrder :
i :
Fin n
ContinuousOn (fun z : ℝ × PredecessorLogRatios order i => (equationElevenAmbientCDF s W hpos hmix hone hsign horder hgraphOrder i z.1 z.2 : ℝ)) (univ ×ˢ range (predecessorScoreMap W order i))
Proof (Lean source)
lemma continuousOn_equationElevenAmbientCDF_scoreRange {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (hsign : FixedOwnDerivativeSign G s θ) {order : Fin n → ℕ} (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) (i : Fin n) : ContinuousOn (fun z : ℝ × PredecessorLogRatios order i => (equationElevenAmbientCDF s W hpos hmix hone hsign horder hgraphOrder i z.1 z.2 : ℝ)) (univ ×ˢ range (predecessorScoreMap W order i)) := by classical let R := range (predecessorScoreMap W order i) let r := predecessorScoreRangeRetraction W order i let e := predecessorScoreHomeomorph s W hpos hmix hone hsign horder hgraphOrder i have hr : ContinuousOn r R := by rw [continuousOn_iff_continuous_restrict] have hre : R.domRestrict r = id := by funext ell apply Subtype.ext simp [R, r, predecessorScoreRangeRetraction, ell.property] rw [hre] exact continuous_id let H : ℝ × PredecessorLogRatios order i → ℝ × PredecessorLatentCube order i := fun z => (z.1, e.symm (r z.2)) have hH : ContinuousOn H (univ ×ˢ R) := by apply ContinuousOn.prodMk continuousOn_fst apply e.symm.continuous.comp_continuousOn apply hr.comp continuousOn_snd intro z hz exact hz.2 have hcont : ContinuousOn (equationElevenPredecessorCDF W order i ∘ H) (univ ×ˢ R) := (continuous_equationElevenPredecessorCDF s W hpos hsign order i).comp_continuousOn hH apply hcont.congr intro z hz have hzrange : z.2 ∈ range (predecessorScoreMap W order i) := hz.2 let ell : R := ⟨z.2, hzrange⟩ have hretract : r z.2 = ell := by apply Subtype.ext change (predecessorScoreRangeRetraction W order i z.2).1 = z.2 simp [predecessorScoreRangeRetraction, hzrange] have hinv : e.symm ell = e.symm (r z.2) := by rw [hretract] change (equationElevenAmbientKernel s W hpos hmix hone hsign horder hgraphOrder i z.2 (Iic z.1)).toReal = equationElevenPredecessorCDF W order i (H z) rw [equationElevenAmbientKernel, Kernel.comap_apply, show predecessorScoreRangeRetraction W order i z.2 = ell from hretract, equationElevenScoreImageKernel, Kernel.comap_apply] change ((equationElevenPredecessorKernel W hpos order i) (e.symm ell) (Iic z.1)).toReal = _ rw [equationElevenPredecessorKernel_apply_Iic] rw [equationElevenPredecessorCDF_eq] exact equationElevenConditionalRatioCDF_eq_of_parents_eq θ (W.targetPerm i) z.1 (fun _ _ => congrFun (congrArg (fun z0 => predecessorCubeLatentState W order i z0) hinv) _)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuousOn_equationElevenAmbientCDF_scoreRange · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderContinuousVersion.lean:254
theorem observedConditionalRatioSupport_subset_scoreRange

The observed joint ratio/predecessor support has predecessor component in the compact triangular score range. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
hgraphOrder :
i :
Fin n
Proof (Lean source)
lemma observedConditionalRatioSupport_subset_scoreRange {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) {order : Fin n → ℕ} (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) (i : Fin n) : observedConditionalRatioSupport W.law order i ⊆ univ ×ˢ range (predecessorScoreMap W order i) := by let μ := interventionalLaw θ (W.targetPerm i) let pred := familyProjection (observedLawLogRatio W.law) (predecessorSet order i) let R := range (predecessorScoreMap W order i) have hclosedRange : IsClosed (range (predecessorScoreMap W order i)) := by simpa only [Set.image_univ] using (isCompact_univ.image (continuous_predecessorScoreMap W hpos order i)).isClosed have hcube : ∀ᵐ v ∂μ, v ∈ latentCube n := by filter_upwards [Measure.support_mem_ae (μ := μ)] with v hv simpa [μ, interventionalLaw_support_eq_latentCube W hpos i] using hv have hmixAE : AEMeasurable W.mix μ := by apply aemeasurable_of_supportMeasurableOn (by rw [latentCube] exact MeasurableSet.pi Set.countable_univ (fun _ _ => measurableSet_Icc)) hcube hmix.1.continuousOn.domRestrict.measurable have hpred : Measurable pred := by dsimp only [pred] apply measurable_pi_lambda intro j exact measurable_observedLawLogRatio W.law j have hcomp : AEMeasurable (pred ∘ W.mix) μ := hpred.aemeasurable.comp_aemeasurable hmixAE have hRae : R ∈ ae (Measure.map (pred ∘ W.mix) μ) := by refine (MeasureTheory.ae_map_iff hcomp (p := fun y => y ∈ R) hclosedRange.measurableSet).2 ?_ filter_upwards [hcube] with v hv exact observedPredecessorLogRatio_mem_scoreRange W hpos hmix hone horder hgraphOrder i v hv have hsupp : Measure.support (Measure.map pred (W.law i.succ)) ⊆ R := by apply Measure.support_subset_of_isClosed hclosedRange rw [hone.2.1 i] rw [AEMeasurable.map_map_of_aemeasurable hpred.aemeasurable hmixAE] exact hRae rw [observedConditionalRatioSupport] intro z hz exact ⟨Set.mem_univ _, hsupp hz.2⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedConditionalRatioSupport_subset_scoreRange · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderContinuousVersion.lean:314
theorem rawObservedConditionalRatioCDF_joint_ae_eq_kernel_of_compProd Lemma rawObservedConditionalRatioCDF_joint_ae_eq_kernel_of_compProd in the paper ↗

Conditional-kernel uniqueness holds jointly under the observed threshold/predecessor law, not merely separately at each fixed threshold. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
order :
Fin n → ℕ
i :
Fin n
hjoint :
Measure.map (fun x ↦ (familyProjection (observedLawLogRatio laws.1) (predecessorSet order i) x, observedLawLogRatio laws.1 i x)) (laws.1 i.succ)
= Measure.map (familyProjection (observedLawLogRatio laws.1) (predecessorSet order i)) (laws.1 i.succ) ⊗ₘ κ
(fun z : ℝ × PredecessorLogRatios order i => (κ z.2 (Iic z.1)).toReal)
=ᵐ[ Measure.map (conditionalRatioArgument laws.1 order i) (laws.1 i.succ)] (fun z => rawObservedConditionalRatioCDF laws order i z.1 z.2)
Proof (Lean source)
lemma rawObservedConditionalRatioCDF_joint_ae_eq_kernel_of_compProd {n : ℕ} (laws : ObservedProbabilityLawFamily n) (order : Fin n → ℕ) (i : Fin n) (κ : Kernel (PredecessorLogRatios order i) ℝ) [IsFiniteKernel κ] (hjoint : Measure.map (fun x ↦ (familyProjection (observedLawLogRatio laws.1) (predecessorSet order i) x, observedLawLogRatio laws.1 i x)) (laws.1 i.succ) = Measure.map (familyProjection (observedLawLogRatio laws.1) (predecessorSet order i)) (laws.1 i.succ) ⊗ₘ κ) : (fun z : ℝ × PredecessorLogRatios order i => (κ z.2 (Iic z.1)).toReal) =ᵐ[ Measure.map (conditionalRatioArgument laws.1 order i) (laws.1 i.succ)] (fun z => rawObservedConditionalRatioCDF laws order i z.1 z.2) := by letI : IsProbabilityMeasure (laws.1 i.succ) := laws.2 i.succ let pred := familyProjection (observedLawLogRatio laws.1) (predecessorSet order i) let score := observedLawLogRatio laws.1 i let predLaw := Measure.map pred (laws.1 i.succ) have hcond := ProbabilityTheory.condDistrib_ae_eq_of_measure_eq_compProd pred (measurable_observedLawLogRatio laws.1 i).aemeasurable hjoint have hall : ∀ᵐ ell ∂predLaw, ∀ t, (κ ell (Iic t)).toReal = rawObservedConditionalRatioCDF laws order i t ell := by filter_upwards [hcond] with ell hell intro t have hfinite : ∀ e, IsFiniteMeasure (laws.1 e) := by intro e letI : IsProbabilityMeasure (laws.1 e) := laws.2 e infer_instance rw [rawObservedConditionalRatioCDF, dif_pos hfinite, hell] let joint := Measure.map (conditionalRatioArgument laws.1 order i) (laws.1 i.succ) have hmap : Measure.map snd joint = predLaw := by dsimp only [joint, predLaw, pred] rw [Measure.map_map measurable_snd (measurable_conditionalRatioArgument laws.1 order i)] rfl rw [← hmap] at hall have hpull := MeasureTheory.mem_ae_of_mem_ae_map measurable_snd.aemeasurable hall filter_upwards [hpull] with z hz exact hz z.1
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.rawObservedConditionalRatioCDF_joint_ae_eq_kernel_of_compProd · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderContinuousVersion.lean:364
theorem equationElevenAmbientCDF_isContinuousVersion

The ambient equation-(11) CDF is a continuous conditional-distribution version for the observed intervention law. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ :
W :
hsign :
order :
Fin n → ℕ
hgraphOrder :
i :
Fin n
IsContinuousConditionalRatioCDFVersion (observedProbabilityLawFamily W.law) order i (equationElevenAmbientCDF s W hpos hmix hone hsign horder hgraphOrder i)
Proof (Lean source)
lemma equationElevenAmbientCDF_isContinuousVersion {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (hsign : FixedOwnDerivativeSign G s θ) {order : Fin n → ℕ} (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) (i : Fin n) : IsContinuousConditionalRatioCDFVersion (observedProbabilityLawFamily W.law) order i (equationElevenAmbientCDF s W hpos hmix hone hsign horder hgraphOrder i) := by let laws := observedProbabilityLawFamily W.law let κ := equationElevenAmbientKernel s W hpos hmix hone hsign horder hgraphOrder i have hprob : ∀ e, IsProbabilityMeasure (W.law e) := observedWorld_laws_isProbabilityMeasure W hpos hmix hone have hlaws : laws.1 = W.law := by simp [laws, observedProbabilityLawFamily, hprob] have hjoint := observedRatioPredecessor_compProd s W hpos hmix hone hsign horder hgraphOrder i have hjoint' : Measure.map (fun x ↦ (familyProjection (observedLawLogRatio laws.1) (predecessorSet order i) x, observedLawLogRatio laws.1 i x)) (laws.1 i.succ) = Measure.map (familyProjection (observedLawLogRatio laws.1) (predecessorSet order i)) (laws.1 i.succ) ⊗ₘ κ := by simpa only [hlaws] using hjoint have hfixed := rawObservedConditionalRatioCDF_ae_eq_kernel_of_compProd laws order i κ hjoint' have hjointAE := rawObservedConditionalRatioCDF_joint_ae_eq_kernel_of_compProd laws order i κ hjoint' have hsupp : observedConditionalRatioSupport laws.1 order i ⊆ univ ×ˢ range (predecessorScoreMap W order i) := by rw [hlaws] exact observedConditionalRatioSupport_subset_scoreRange W hpos hmix hone horder hgraphOrder i refine ⟨?_, ?_, ?_, ?_⟩ · exact measurable_subtype_coe.comp (measurable_equationElevenAmbientCDF s W hpos hmix hone hsign horder hgraphOrder i) · intro t simpa [κ, equationElevenAmbientCDF] using (hfixed t).symm · simpa [κ, equationElevenAmbientCDF] using hjointAE · exact (continuousOn_equationElevenAmbientCDF_scoreRange s W hpos hmix hone hsign horder hgraphOrder i).mono hsupp
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.equationElevenAmbientCDF_isContinuousVersion · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderContinuousVersion.lean:407
theorem equationElevenAmbientCDF_apply_of_latentState

On every realized predecessor score, the continuous version evaluates to the explicit equation-(11) integral. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ :
W :
hsign :
order :
Fin n → ℕ
hgraphOrder :
i :
Fin n
t :
v :
hv :
v ∈ latentCube n
(equationElevenAmbientCDF s W hpos hmix hone hsign horder hgraphOrder i t (familyProjection (observedLawLogRatio W.law) (predecessorSet order i) (W.mix v)) : ℝ)
= equationElevenConditionalRatioCDF θ (W.targetPerm i) t v
Proof (Lean source)
lemma equationElevenAmbientCDF_apply_of_latentState {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (hsign : FixedOwnDerivativeSign G s θ) {order : Fin n → ℕ} (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) (i : Fin n) (t : ℝ) (v : LatentState n) (hv : v ∈ latentCube n) : (equationElevenAmbientCDF s W hpos hmix hone hsign horder hgraphOrder i t (familyProjection (observedLawLogRatio W.law) (predecessorSet order i) (W.mix v)) : ℝ) = equationElevenConditionalRatioCDF θ (W.targetPerm i) t v := by exact equationElevenAmbientKernel_apply_Iic_of_latentState s W hpos hmix hone hsign horder hgraphOrder i v hv t
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.equationElevenAmbientCDF_apply_of_latentState · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderContinuousVersion.lean:458
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.DecoderCore 14 declarations This file collects paper-local consequences of the primitive observed-world assumptions that feed directly into the exact population decoder.

Structural pieces of the exact population decoder

This file collects paper-local consequences of the primitive observed-world assumptions that feed directly into the exact population decoder.

theorem interventionalLaw_support_eq_latentCube

Strict positivity of every retained factor and the replacement density gives each latent single-target intervention law the full closed cube as its support. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
e :
Fin n
Measure.support (interventionalLaw θ (W.targetPerm e)) = latentCube n
Proof (Lean source)
lemma interventionalLaw_support_eq_latentCube {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (e : Fin n) : Measure.support (interventionalLaw θ (W.targetPerm e)) = latentCube n := by letI : SigmaFinite unitIntervalReference := by unfold unitIntervalReference infer_instance let B := mechanismUnitCubeFactorization hpos let q := mechanismInterventionDensity W hpos e let μ := unitCubeReference (Fin n) have hint_μ : interventionalLaw θ (W.targetPerm e) ≪ μ := by rw [← mechanismUnitCubeFactorization_interventionMeasure W hpos e] exact withDensity_absolutelyContinuous _ _ have hdens_ne : ∀ v, B.interventionDensity (W.targetPerm e) q v ≠ 0 := by intro v apply mul_ne_zero · change ofReal (θ.q (W.targetPerm e) (max 0 (min 1 (v (W.targetPerm e))))) ≠ 0 apply (ENNReal.ofReal_pos.mpr (hpos.2.1 (W.targetPerm e) _ ?_)).ne' exact ⟨le_max_left _ _, max_le zero_le_one (min_le_left _ _)⟩ · unfold partialDensity apply Finset.prod_ne_zero_iff.mpr intro i _ change ofReal (θ.p i (clampCube (Fin n) v)) ≠ 0 exact (ENNReal.ofReal_pos.mpr (hpos.1 i _ (by simpa only [latentCube, unitCube] using clampCube_mem (Fin n) v))).ne' have hμ_int : μ ≪ interventionalLaw θ (W.targetPerm e) := by rw [← mechanismUnitCubeFactorization_interventionMeasure W hpos e] exact withDensity_absolutelyContinuous' (B.measurable_interventionDensity (W.targetPerm e) q).aemeasurable (Filter.Eventually.of_forall hdens_ne) apply Set.Subset.antisymm · exact hint_μ.support_mono.trans (by rw [unitCubeReference_support_eq_latentCube n]) · rw [← unitCubeReference_support_eq_latentCube n] exact hμ_int.support_mono
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.interventionalLaw_support_eq_latentCube · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderCore.lean:72
theorem observedLaw_support_eq_observedSupport

The observational observed law has exactly the image of the latent cube as its support. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
Measure.support (W.law 0) = observedSupport G W
Proof (Lean source)
lemma observedLaw_support_eq_observedSupport {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) : Measure.support (W.law 0) = observedSupport G W := by have hcube_compact : IsCompact (latentCube n) := by rw [latentCube] exact isCompact_univ_pi fun _ => isCompact_Icc have hsupport_closed : IsClosed (observedSupport G W) := by exact (hcube_compact.image_of_continuousOn hmix.1.continuousOn).isClosed have hobs_cube : ∀ᵐ v ∂observationalLaw θ, v ∈ latentCube n := by filter_upwards [Measure.support_mem_ae (μ := observationalLaw θ)] with v hv rw [observationalLaw_support_eq_latentCube hpos] at hv exact hv have hcube_meas : MeasurableSet (latentCube n) := by rw [latentCube] exact MeasurableSet.pi Set.countable_univ (fun _ _ ↦ measurableSet_Icc) have hmixAE : AEMeasurable W.mix (observationalLaw θ) := aemeasurable_of_supportMeasurableOn hcube_meas (ae_iff.mp hobs_cube) hmix.1.continuousOn.domRestrict.measurable have hfull : W.law 0 (observedSupport G W)ᶜ = 0 := by rw [hone.1, Measure.map_apply_of_aemeasurable hmixAE hsupport_closed.isOpen_compl.measurableSet] apply measure_mono_null (t := (latentCube n)ᶜ) · intro v hv hvcube exact hv ⟨v, hvcube, rfl⟩ · exact ae_iff.mp hobs_cube apply Set.Subset.antisymm · exact Measure.support_subset_of_isClosed hsupport_closed (ae_iff.mpr hfull) · rintro x ⟨v, hv, rfl⟩ rw [Measure.mem_support_iff_forall] intro U hU rcases mem_nhds_iff.mp hU with ⟨O, hOU, hOopen, hmixO⟩ rw [hone.1] apply lt_of_lt_of_le _ (measure_mono hOU) rw [Measure.map_apply_of_aemeasurable hmixAE hOopen.measurableSet] have hpre : W.mix ⁻¹' O ∈ nhdsWithin v (latentCube n) := (hmix.1.continuousOn v hv) (hOopen.mem_nhds hmixO) rcases mem_nhdsWithin_iff_exists_mem_nhds_inter.mp hpre with ⟨V, hV, hVsub⟩ have hVpos : 0 < observationalLaw θ V := (Measure.mem_support_iff_forall v).mp ((observationalLaw_support_eq_latentCube hpos).symm.subset hv) V hV rw [← Measure.measure_inter_eq_of_ae hobs_cube] at hVpos exact hVpos.trans_le (measure_mono (by simpa [inter_comm] using hVsub))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedLaw_support_eq_observedSupport · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderCore.lean:114
theorem observationalLaw_isProbabilityMeasure

Normalized local factors make the observational latent law a probability measure. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
Proof (Lean source)
lemma observationalLaw_isProbabilityMeasure {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (hpos : PositiveNormalizedSmoothMechanisms G θ) : IsProbabilityMeasure (observationalLaw θ) := by constructor rw [← mechanismUnitCubeFactorization_observationalMeasure hpos] exact factorization_observationalMeasure_univ (mechanismUnitCubeFactorization hpos)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observationalLaw_isProbabilityMeasure · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderCore.lean:204
theorem interventionalLaw_isProbabilityMeasure

Normalized local and replacement factors make every interventional latent law a probability measure. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
e :
Fin n
Proof (Lean source)
lemma interventionalLaw_isProbabilityMeasure {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (e : Fin n) : IsProbabilityMeasure (interventionalLaw θ (W.targetPerm e)) := by constructor rw [← mechanismUnitCubeFactorization_interventionMeasure W hpos e] exact factorization_interventionMeasure_univ (mechanismUnitCubeFactorization hpos) (W.targetPerm e) (mechanismInterventionDensity W hpos e)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.interventionalLaw_isProbabilityMeasure · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderCore.lean:213
theorem observedWorld_laws_isProbabilityMeasure

The pushforward assumptions and normalized latent factors make every observed environment law a probability measure. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
Proof (Lean source)
lemma observedWorld_laws_isProbabilityMeasure {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) : ∀ e, IsProbabilityMeasure (W.law e) := by intro e let μ := unitCubeReference (Fin n) have hcube : MeasurableSet (latentCube n) := by rw [latentCube] exact MeasurableSet.pi Set.countable_univ (fun _ _ ↦ measurableSet_Icc) have hμ_cube : μ (latentCube n)ᶜ = 0 := by simpa only [μ, latentCube, unitCube] using unitCubeReference_compl (Fin n) refine Fin.cases ?_ (fun i => ?_) e · letI : IsProbabilityMeasure (observationalLaw θ) := observationalLaw_isProbabilityMeasure hpos have hobs_μ : observationalLaw θ ≪ μ := by rw [← mechanismUnitCubeFactorization_observationalMeasure hpos] exact withDensity_absolutelyContinuous _ _ have hmixAE : AEMeasurable W.mix (observationalLaw θ) := aemeasurable_of_supportMeasurableOn hcube (hobs_μ hμ_cube) hmix.1.continuousOn.domRestrict.measurable rw [hone.1] exact Measure.isProbabilityMeasure_map hmixAE · letI : IsProbabilityMeasure (interventionalLaw θ (W.targetPerm i)) := interventionalLaw_isProbabilityMeasure W hpos i let B := mechanismUnitCubeFactorization hpos let q := mechanismInterventionDensity W hpos i have hint_μ : B.interventionMeasure (W.targetPerm i) q ≪ μ := by rw [interventionMeasure] exact withDensity_absolutelyContinuous _ _ have hint_cube : interventionalLaw θ (W.targetPerm i) (latentCube n)ᶜ = 0 := by rw [← mechanismUnitCubeFactorization_interventionMeasure W hpos i] exact hint_μ hμ_cube have hmixAE : AEMeasurable W.mix (interventionalLaw θ (W.targetPerm i)) := aemeasurable_of_supportMeasurableOn hcube hint_cube hmix.1.continuousOn.domRestrict.measurable rw [hone.2.1 i] exact Measure.isProbabilityMeasure_map hmixAE
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedWorld_laws_isProbabilityMeasure · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderCore.lean:225
theorem canonicalRatio_map_eq_observedLawRatio_map_mix

Transporting the latent canonical Radon--Nikodym ratio through the support diffeomorphism does not change its law under any latent base measure dominated by the observational law. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
i :
Fin n
ρ :
:
Measure.map (fun v ↦ ((interventionalLaw θ (W.targetPerm i)).rnDeriv (observationalLaw θ) v).toReal) ρ
= Measure.map (observedLawRatio W.law i) (Measure.map W.mix ρ)
Proof (Lean source)
lemma canonicalRatio_map_eq_observedLawRatio_map_mix {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (i : Fin n) (ρ : Measure (LatentState n)) (hρ : ρ ≪ observationalLaw θ) : Measure.map (fun v ↦ ((interventionalLaw θ (W.targetPerm i)).rnDeriv (observationalLaw θ) v).toReal) ρ = Measure.map (observedLawRatio W.law i) (Measure.map W.mix ρ) := by let m := interventionalLaw θ (W.targetPerm i) let ν := observationalLaw θ let S := latentCube n let T := observedSupport G W letI : IsProbabilityMeasure m := interventionalLaw_isProbabilityMeasure W hpos i letI : IsProbabilityMeasure ν := observationalLaw_isProbabilityMeasure hpos have hS : MeasurableSet S := by change MeasurableSet (latentCube n) rw [latentCube] exact MeasurableSet.pi Set.countable_univ (fun _ _ ↦ measurableSet_Icc) have hcompact : IsCompact S := by change IsCompact (latentCube n) rw [latentCube] exact isCompact_univ_pi fun _ => isCompact_Icc have hT : MeasurableSet T := (hcompact.image_of_continuousOn hmix.1.continuousOn).isClosed.measurableSet have hmS : m Sᶜ = 0 := by change interventionalLaw θ (W.targetPerm i) (latentCube n)ᶜ = 0 rw [← interventionalLaw_support_eq_latentCube W hpos i] exact Measure.measure_compl_support have hνS : ν Sᶜ = 0 := by change observationalLaw θ (latentCube n)ᶜ = 0 rw [← observationalLaw_support_eq_latentCube hpos] exact Measure.measure_compl_support have hmn : m ≪ ν := interventionalLaw_absolutelyContinuous_observational W hpos i have hrn := rnDeriv_map_of_support_equiv m ν hmn S T hS hT hmS hνS W.mix W.unmix hmix.1.continuousOn.domRestrict.measurable hmix.2.1.continuousOn.domRestrict.measurable (fun x hx ↦ ⟨x, hx, rfl⟩) (fun y hy ↦ by rcases hy with ⟨x, hx, rfl⟩ simpa only [hmix.2.2.1 x hx] using hx) hmix.2.2.1 hmix.2.2.2 have hrnW : (fun v ↦ ((W.law i.succ).rnDeriv (W.law 0) (W.mix v)).toReal) =ᵐ[ν] (fun v ↦ (m.rnDeriv ν v).toReal) := by filter_upwards [hrn] with v hv change ((W.law i.succ).rnDeriv (W.law 0) (W.mix v)).toReal = ((interventionalLaw θ (W.targetPerm i)).rnDeriv (observationalLaw θ) v).toReal rw [hone.2.1 i, hone.1] exact congrArg toReal hv have hrnρ := hρ.ae_eq hrnW have hρS : ρ Sᶜ = 0 := hρ hνS have hmixρ : AEMeasurable W.mix ρ := aemeasurable_of_supportMeasurableOn hS hρS hmix.1.continuousOn.domRestrict.measurable calc Measure.map (fun v ↦ (m.rnDeriv ν v).toReal) ρ = Measure.map (observedLawRatio W.law i ∘ W.mix) ρ := Measure.map_congr hrnρ.symm _ = Measure.map (observedLawRatio W.law i) (Measure.map W.mix ρ) := by symm exact AEMeasurable.map_map_of_aemeasurable (measurable_observedLawRatio W.law i).aemeasurable hmixρ
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.canonicalRatio_map_eq_observedLawRatio_map_mix · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderCore.lean:269
theorem observationalLaw_ae_mem_latentCube

The observational latent law is concentrated on the closed latent cube. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
∀ᵐ v ∂observationalLaw θ, v ∈ latentCube n
Proof (Lean source)
-- @node: observationalLaw_ae_mem_latentCube lemma observationalLaw_ae_mem_latentCube {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (hpos : PositiveNormalizedSmoothMechanisms G θ) : ∀ᵐ v ∂observationalLaw θ, v ∈ latentCube n := by let μ := unitCubeReference (Fin n) have hobs_μ : observationalLaw θ ≪ μ := by rw [← mechanismUnitCubeFactorization_observationalMeasure hpos] exact withDensity_absolutelyContinuous _ _ apply ae_iff.mpr change observationalLaw θ (latentCube n)ᶜ = 0 exact hobs_μ (by simpa only [μ, latentCube, unitCube] using unitCubeReference_compl (Fin n))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observationalLaw_ae_mem_latentCube · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderCore.lean:337
theorem observedObservational_absolutelyContinuous_interventional

Strict positivity of all latent factors makes the observational and target-intervention observed laws equivalent; this is the reverse direction not needed by the ratio-law bridge. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
W.law 0 ≪ W.law e.succ
Proof (Lean source)
lemma observedObservational_absolutelyContinuous_interventional {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (e : Fin n) : W.law 0 ≪ W.law e.succ := by let B := mechanismUnitCubeFactorization hpos let q := mechanismInterventionDensity W hpos e let μ := unitCubeReference (Fin n) have hmeas_int : Measurable (B.interventionDensity (W.targetPerm e) q) := by unfold interventionDensity exact (q.measurable_density.comp (measurable_pi_apply _)).mul (Finset.measurable_prod _ fun i _ ↦ B.measurable_factor i) have hint_pos : ∀ v, B.interventionDensity (W.targetPerm e) q v ≠ 0 := by intro v unfold interventionDensity apply mul_ne_zero · change ofReal (θ.q (W.targetPerm e) (max 0 (min 1 (v (W.targetPerm e))))) ≠ 0 exact (ENNReal.ofReal_pos.mpr (hpos.2.1 (W.targetPerm e) _ ⟨le_max_left _ _, max_le zero_le_one (min_le_left _ _)⟩)).ne' · exact Finset.prod_ne_zero_iff.mpr fun i _ ↦ by change ofReal (θ.p i (clampCube (Fin n) v)) ≠ 0 exact (ENNReal.ofReal_pos.mpr (hpos.1 i _ (by simpa only [latentCube, unitCube] using clampCube_mem (Fin n) v))).ne' have hμ_int : μ ≪ B.interventionMeasure (W.targetPerm e) q := by rw [interventionMeasure] exact withDensity_absolutelyContinuous' hmeas_int.aemeasurable (Filter.Eventually.of_forall hint_pos) have hobs_μ : B.observationalMeasure ≪ μ := by rw [observationalMeasure] exact withDensity_absolutelyContinuous _ _ have hlatentB : B.observationalMeasure ≪ B.interventionMeasure (W.targetPerm e) q := hobs_μ.trans hμ_int have hlatent : observationalLaw θ ≪ interventionalLaw θ (W.targetPerm e) := by simpa only [B, q, mechanismUnitCubeFactorization_observationalMeasure hpos, mechanismUnitCubeFactorization_interventionMeasure W hpos e] using hlatentB let ν := interventionalLaw θ (W.targetPerm e) have hcube : MeasurableSet (latentCube n) := by rw [latentCube] exact MeasurableSet.pi Set.countable_univ (fun _ _ ↦ measurableSet_Icc) have hobs_cube : observationalLaw θ (latentCube n)ᶜ = 0 := by rw [← mechanismUnitCubeFactorization_observationalMeasure hpos] exact hobs_μ (by simpa only [μ, latentCube, unitCube] using unitCubeReference_compl (Fin n)) have hint_μ : B.interventionMeasure (W.targetPerm e) q ≪ μ := by rw [interventionMeasure] exact withDensity_absolutelyContinuous _ _ have hint_cube : ν (latentCube n)ᶜ = 0 := by change interventionalLaw θ (W.targetPerm e) (latentCube n)ᶜ = 0 rw [← mechanismUnitCubeFactorization_interventionMeasure W hpos e] exact hint_μ (by simpa only [μ, latentCube, unitCube] using unitCubeReference_compl (Fin n)) have hmixObs : AEMeasurable W.mix (observationalLaw θ) := aemeasurable_of_supportMeasurableOn hcube hobs_cube hmix.1.continuousOn.domRestrict.measurable have hmixInt : AEMeasurable W.mix ν := aemeasurable_of_supportMeasurableOn hcube hint_cube hmix.1.continuousOn.domRestrict.measurable let mix' := hmixInt.mk W.mix have heqInt : W.mix =ᵐ[ν] mix' := hmixInt.ae_eq_mk have heqObs : W.mix =ᵐ[observationalLaw θ] mix' := hlatent.ae_eq heqInt rw [hone.1, hone.2.1 e] calc Measure.map W.mix (observationalLaw θ) = Measure.map mix' (observationalLaw θ) := Measure.map_congr heqObs _ ≪ Measure.map mix' ν := @Measure.AbsolutelyContinuous.map _ _ _ _ _ _ hlatent mix' hmixInt.measurable_mk _ = Measure.map W.mix ν := (Measure.map_congr heqInt).symm
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedObservational_absolutelyContinuous_interventional · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderCore.lean:353
theorem observedWorldLawCoherent_of_assumptions

The supplied observed-world ratio agrees almost everywhere with the canonical law ratio, and the law-selected rank construction is unchanged by a compatible representation. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
Proof (Lean source)
lemma observedWorldLawCoherent_of_assumptions {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) : ObservedWorldLawCoherent W := by classical constructor · intro i let μ := unitCubeReference (Fin n) have hcube : MeasurableSet (latentCube n) := by rw [latentCube] exact MeasurableSet.pi Set.countable_univ (fun _ _ ↦ measurableSet_Icc) have hμ_cube : μ (latentCube n)ᶜ = 0 := by simpa only [μ, latentCube, unitCube] using unitCubeReference_compl (Fin n) have hobs_μ : observationalLaw θ ≪ μ := by rw [← mechanismUnitCubeFactorization_observationalMeasure hpos] exact withDensity_absolutelyContinuous _ _ have hobs_cube : observationalLaw θ (latentCube n)ᶜ = 0 := hobs_μ hμ_cube have hmixAE : AEMeasurable W.mix (observationalLaw θ) := aemeasurable_of_supportMeasurableOn hcube hobs_cube hmix.1.continuousOn.domRestrict.measurable have hint_cube : interventionalLaw θ (W.targetPerm i) (latentCube n)ᶜ = 0 := by let B := mechanismUnitCubeFactorization hpos let q := mechanismInterventionDensity W hpos i have hint_μ : B.interventionMeasure (W.targetPerm i) q ≪ μ := by rw [interventionMeasure] exact withDensity_absolutelyContinuous _ _ rw [← mechanismUnitCubeFactorization_interventionMeasure W hpos i] exact hint_μ hμ_cube have hmixAEInt : AEMeasurable W.mix (interventionalLaw θ (W.targetPerm i)) := aemeasurable_of_supportMeasurableOn hcube hint_cube hmix.1.continuousOn.domRestrict.measurable have hrn_pos : ∀ᵐ x ∂W.law 0, 0 < (W.law i.succ).rnDeriv (W.law 0) x := by letI : IsProbabilityMeasure (observationalLaw θ) := observationalLaw_isProbabilityMeasure hpos letI : IsProbabilityMeasure (interventionalLaw θ (W.targetPerm i)) := interventionalLaw_isProbabilityMeasure W hpos i letI : IsProbabilityMeasure (W.law 0) := ⟨by rw [hone.1, Measure.map_apply_of_aemeasurable hmixAE MeasurableSet.univ, preimage_univ, measure_univ]⟩ letI : IsProbabilityMeasure (W.law i.succ) := ⟨by rw [hone.2.1 i, Measure.map_apply_of_aemeasurable hmixAEInt MeasurableSet.univ, preimage_univ, measure_univ]⟩ exact Measure.rnDeriv_pos' (observedObservational_absolutelyContinuous_interventional W hpos hmix hone i) filter_upwards [hone.2.2.1 i, hrn_pos] with x hx hrnpos have hposx : 0 < W.ratio i x := by by_contra hnot have hle : W.ratio i x ≤ 0 := le_of_not_gt hnot have : ofReal (W.ratio i x) = 0 := ENNReal.ofReal_eq_zero.mpr hle rw [hx] at this exact hrnpos.ne' this calc W.ratio i x = (ofReal (W.ratio i x)).toReal := (ENNReal.toReal_ofReal hposx.le).symm _ = ((W.law i.succ).rnDeriv (W.law 0) x).toReal := congrArg toReal hx _ = observedLawRatio W.law i x := rfl · intro G' θ' W' hcompat order i x hx rcases hcompat with ⟨hlaw, _hsupport⟩ rw [← hlaw]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedWorldLawCoherent_of_assumptions · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderCore.lean:430
def smoothObservedRatio

The smooth mechanism formula for an observed ratio, extended through the unmixing map.

Definition (Lean source)
n :
DAG (Fin n)
W :
i :
Fin n
x :
smoothObservedRatio W i x :
θ.q (W.targetPerm i) (W.unmix x (W.targetPerm i)) / θ.p (W.targetPerm i) (W.unmix x)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.smoothObservedRatio · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderCore.lean:500
theorem smoothObservedRatio_isVersion

Under the positive smooth mechanism assumptions, shared mixing assumptions, and perfect-intervention assumptions, the smooth mechanism ratio is a continuous observed-ratio version for world W and environment i.

Formal statement
Proof (Lean source)
lemma smoothObservedRatio_isVersion {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (i : Fin n) : IsContinuousObservedRatioVersion W.law i (smoothObservedRatio W i) := by constructor · have hratio := (observedWorldLawCoherent_of_assumptions W hpos hmix hone).1 i apply Filter.EventuallyEq.trans _ hratio filter_upwards [Measure.support_mem_ae (μ := W.law 0)] with x hx rw [observedLaw_support_eq_observedSupport W hpos hmix hone] at hx rcases hx with ⟨v, hv, rfl⟩ rw [smoothObservedRatio, show W.unmix (W.mix v) = v from hmix.2.2.1 v hv] exact (hone.2.2.2 i v hv).symm · rw [observedLaw_support_eq_observedSupport W hpos hmix hone] have hunmix_mem : Set.MapsTo W.unmix (observedSupport G W) (latentCube n) := by rintro x ⟨v, hv, rfl⟩ simpa only [hmix.2.2.1 v hv] using hv have hunmix_cont : ContinuousOn W.unmix (observedSupport G W) := hmix.2.1.continuousOn have hcoord_cont : ContinuousOn (fun x ↦ W.unmix x (W.targetPerm i)) (observedSupport G W) := (continuous_apply (W.targetPerm i)).comp_continuousOn hunmix_cont have hcoord_mem : Set.MapsTo (fun x ↦ W.unmix x (W.targetPerm i)) (observedSupport G W) (Icc 0 1) := by intro x hx exact hunmix_mem hx (W.targetPerm i) (Set.mem_univ _) apply ((hpos.2.2.2.1 (W.targetPerm i)).continuousOn.comp hcoord_cont hcoord_mem).div ((hpos.2.2.1 (W.targetPerm i)).continuousOn.comp hunmix_cont hunmix_mem) intro x hx exact ne_of_gt (hpos.1 (W.targetPerm i) _ (hunmix_mem hx))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.smoothObservedRatio_isVersion · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderCore.lean:508
theorem exists_continuousObservedRatioVersion

Under positive smooth mechanisms, shared diffeomorphic mixing, and one perfect intervention per node, each observed ratio law has a continuous version.

Formal statement
Proof (Lean source)
lemma exists_continuousObservedRatioVersion {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (i : Fin n) : ∃ R, IsContinuousObservedRatioVersion W.law i R := by exact ⟨smoothObservedRatio W i, smoothObservedRatio_isVersion W hpos hmix hone i⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.exists_continuousObservedRatioVersion · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderCore.lean:547
theorem observedLawLogRatio_comp_mix_eq

The law-selected logarithmic ratio pulled back through the mixing map agrees pointwise on the latent cube with the smooth mechanism ratio, under the positive smooth mechanism assumptions, shared mixing assumptions, and perfect-intervention assumptions, for world W and environment i.

Formal statement
n :
DAG (Fin n)
W :
i :
Fin n
v :
v ∈ latentCube n
observedLawLogRatio W.law i (W.mix v)
= log (θ.q (W.targetPerm i) (v (W.targetPerm i)) / θ.p (W.targetPerm i) v)
Proof (Lean source)
-- @node: observedLawLogRatio_comp_mix_eq lemma observedLawLogRatio_comp_mix_eq {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (i : Fin n) : ∀ v, v ∈ latentCube n → observedLawLogRatio W.law i (W.mix v) = log (θ.q (W.targetPerm i) (v (W.targetPerm i)) / θ.p (W.targetPerm i) v) := by intro v hv have hselected := observedContinuousRatio_isVersion W.law i (exists_continuousObservedRatioVersion W hpos hmix hone i) have hR := smoothObservedRatio_isVersion W hpos hmix hone i have heq := hselected.eqOn hR have hmix_support : W.mix v ∈ Measure.support (W.law 0) := by rw [observedLaw_support_eq_observedSupport W hpos hmix hone] exact ⟨v, hv, rfl⟩ rw [observedLawLogRatio, heq hmix_support, smoothObservedRatio, hmix.2.2.1 v hv]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedLawLogRatio_comp_mix_eq · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderCore.lean:559
theorem observedLawLogRatio_comp_mix_ae_eq

The observed-law logarithmic ratio pulled back through the mixing map agrees almost everywhere with the mechanism's scalar log ratio. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
(fun v => observedLawLogRatio W.law i (W.mix v))
=ᵐ[observationalLaw θ] fun v => log (θ.q (W.targetPerm i) (v (W.targetPerm i)) / θ.p (W.targetPerm i) v)
Proof (Lean source)
-- @node: observedLawLogRatio_comp_mix_ae_eq lemma observedLawLogRatio_comp_mix_ae_eq {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (i : Fin n) : (fun v => observedLawLogRatio W.law i (W.mix v)) =ᵐ[observationalLaw θ] fun v => log (θ.q (W.targetPerm i) (v (W.targetPerm i)) / θ.p (W.targetPerm i) v) := by filter_upwards [observationalLaw_ae_mem_latentCube hpos] with v hv exact observedLawLogRatio_comp_mix_eq W hpos hmix hone i v hv
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedLawLogRatio_comp_mix_ae_eq · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderCore.lean:585
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.DecoderGraph 19 declarations This file proves equations (4)--(6): nonancestor interventions cannot create ratio-law edges, ancestral covers generate the latent transitive closure, and every ratio-graph topological ordering places latent parents befo

Ratio-graph reconstruction for the exact decoder

This file proves equations (4)--(6): nonancestor interventions cannot create ratio-law edges, ancestral covers generate the latent transitive closure, and every ratio-graph topological ordering places latent parents before their children.

def environmentParentSet

Environment-label parents obtained by pulling back the latent parent set.

Definition (Lean source)
n :
DAG (Fin n)
W :
i :
Fin n
environmentParentSet W i :
Finset.univ.filter (fun j => G.edge (W.targetPerm j) (W.targetPerm i))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.environmentParentSet · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderGraph.lean:20

A numeric order respects every latent edge after intervention-label relabeling.

Definition (Lean source)
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
j i :
PermutedGraphOrdered W order :
Prop
order j < order i
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.PermutedGraphOrdered · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderGraph.lean:26
theorem permutedGraphOrdered_of_transitiveClosure

Transitive-closure recovery makes every ratio-graph topological order respect latent edges. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
Proof (Lean source)
lemma permutedGraphOrdered_of_transitiveClosure {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (order : Fin n → ℕ) (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (htc : TransGen (observedLawRatioGraph gaussianFeatureMap W.law) = TransGen (permutedGraph G W)) : PermutedGraphOrdered W order := by intro j i hji have hpath : TransGen (observedLawRatioGraph gaussianFeatureMap W.law) j i := by rw [htc] exact Relation.TransGen.single hji have path_lt : ∀ {a b : Fin n}, TransGen (observedLawRatioGraph gaussianFeatureMap W.law) a b → order a < order b := by intro a b hab induction hab with | single h => exact horder.2 h | tail hab h ih => exact lt_trans ih (horder.2 h) exact path_lt hpath
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.permutedGraphOrdered_of_transitiveClosure · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderGraph.lean:33
theorem canonical_observationalRatioLaw_eq_supplied

The observational canonical-ratio law is invariant under the supplied support diffeomorphism. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
Proof (Lean source)
lemma canonical_observationalRatioLaw_eq_supplied {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (i : Fin n) : observationalRatioLaw (canonicalObservedWorld G θ W.targetPerm) i = observationalRatioLaw W i := by have hcanonical : observedLawRatio (canonicalObservedWorld G θ W.targetPerm).law i = fun v => ((interventionalLaw θ (W.targetPerm i)).rnDeriv (observationalLaw θ) v).toReal := by rfl rw [observationalRatioLaw, observationalRatioLaw, hcanonical, hone.1] exact canonicalRatio_map_eq_observedLawRatio_map_mix W hpos hmix hone i (observationalLaw θ) Measure.AbsolutelyContinuous.rfl
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.canonical_observationalRatioLaw_eq_supplied · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderGraph.lean:56
theorem canonical_interventionalRatioLaw_eq_supplied

Every intervention-base canonical-ratio law is likewise invariant under the supplied support diffeomorphism. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
j i :
Fin n
Proof (Lean source)
lemma canonical_interventionalRatioLaw_eq_supplied {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (j i : Fin n) : interventionalRatioLaw (canonicalObservedWorld G θ W.targetPerm) j i = interventionalRatioLaw W j i := by have hcanonical : observedLawRatio (canonicalObservedWorld G θ W.targetPerm).law i = fun v => ((interventionalLaw θ (W.targetPerm i)).rnDeriv (observationalLaw θ) v).toReal := by rfl rw [interventionalRatioLaw, interventionalRatioLaw, hcanonical, hone.2.1 j] exact canonicalRatio_map_eq_observedLawRatio_map_mix W hpos hmix hone i (interventionalLaw θ (W.targetPerm j)) (interventionalLaw_absolutelyContinuous_observational W hpos j)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.canonical_interventionalRatioLaw_eq_supplied · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderGraph.lean:73
theorem canonical_populationDiscrepancy_eq_observedLawDiscrepancy

Hence the canonical-world discrepancy used by cover separation is exactly the observable discrepancy of the supplied law family. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
Proof (Lean source)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.canonical_populationDiscrepancy_eq_observedLawDiscrepancy · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderGraph.lean:91
theorem canonical_coverDiscrepancy_to_supplied

Cover separation stated for the identity-mixing canonical world supplies exactly the cover edges required for the observed world. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
hcover :
∀ ⦃a b : Fin n⦄
then
0 < populationDiscrepancy U (canonicalObservedWorld G θ W.targetPerm) (W.targetPerm.symm a) (W.targetPerm.symm b)
a b :
Fin n
0 < populationDiscrepancy U W (W.targetPerm.symm a) (W.targetPerm.symm b)
Proof (Lean source)
lemma canonical_coverDiscrepancy_to_supplied {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℝ H] [CompleteSpace H] (U : UnitNormFeatureMap H) (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (hcover : ∀ ⦃a b : Fin n⦄, ancestralCover G a b → 0 < populationDiscrepancy U (canonicalObservedWorld G θ W.targetPerm) (W.targetPerm.symm a) (W.targetPerm.symm b)) : ∀ ⦃a b : Fin n⦄, ancestralCover G a b → 0 < populationDiscrepancy U W (W.targetPerm.symm a) (W.targetPerm.symm b) := by intro a b hab have hc := hcover hab rw [canonical_populationDiscrepancy_eq_observedLawDiscrepancy U W hpos hmix hone] at hc exact hc
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.canonical_coverDiscrepancy_to_supplied · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderGraph.lean:107
theorem ratio_nonancestor_zero Lemma 2 in the paper ↗

A non-ancestor intervention leaves the corresponding ratio law unchanged, hence has zero MMD. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
W :
j i :
Fin n
hne :
j ≠ i
hna :
¬ G.isAncestor (W.targetPerm j) (W.targetPerm i)
Proof (Lean source)
lemma ratio_nonancestor_zero {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) {j i : Fin n} (hne : j ≠ i) (hna : ¬ G.isAncestor (W.targetPerm j) (W.targetPerm i)) : populationDiscrepancy gaussianFeatureMap W j i = 0 := by apply populationDiscrepancy_eq_zero_of_ratioLaw_eq exact FiniteDensityObservedWorldBridge.ratioLaw_eq_of_nonancestor (finiteDensityObservedWorldBridge_of_assumptions W hpos hmix hone) hne hna
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.ratio_nonancestor_zero · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderGraph.lean:129
theorem isAncestor_transGen_ancestralCover

Every strict ancestor relation in a finite DAG factors through ancestral covers. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
G :
DAG (Fin n)
a b :
Fin n
h :
G.isAncestor a b
Proof (Lean source)
lemma isAncestor_transGen_ancestralCover {n : ℕ} (G : DAG (Fin n)) {a b : Fin n} (h : G.isAncestor a b) : TransGen (ancestralCover G) a b := by letI : LE (Fin n) := ⟨fun x y => x = y ∨ G.isAncestor x y⟩ letI : LT (Fin n) := ⟨G.isAncestor⟩ letI : PartialOrder (Fin n) := { le_refl x := inl rfl le_trans x y z hxy hyz := by rcases hxy with rfl | hxy · exact hyz rcases hyz with rfl | hyz · exact inr hxy · exact inr (G.isAncestor_trans hxy hyz) le_antisymm x y hxy hyx := by rcases hxy with rfl | hxy · rfl rcases hyx with rfl | hyx · rfl exact elim (G.isAncestor_irrefl x (G.isAncestor_trans hxy hyx)) lt_iff_le_not_ge x y := by constructor · intro hxy exact ⟨Or.inr hxy, fun hyx => by rcases hyx with rfl | hyx · exact G.isAncestor_irrefl _ hxy · exact G.isAncestor_irrefl _ (G.isAncestor_trans hxy hyx)⟩ · rintro ⟨hxy, hnxy⟩ rcases hxy with rfl | hxy · exact elim (hnxy (inl rfl)) · exact hxy } letI : DecidableLE (Fin n) := Classical.decRel _ letI : DecidableLT (Fin n) := Classical.decRel _ letI : LocallyFiniteOrder (Fin n) := Fintype.toLocallyFiniteOrder exact transGen_covBy_of_lt h
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.isAncestor_transGen_ancestralCover · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderGraph.lean:144
theorem observedLawRatioGraph_edge_isAncestor

Every observable ratio-graph edge points along the latent ancestral order. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
G.isAncestor (W.targetPerm j) (W.targetPerm i)
Proof (Lean source)
lemma observedLawRatioGraph_edge_isAncestor {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) {j i : Fin n} (hji : observedLawRatioGraph gaussianFeatureMap W.law j i) : G.isAncestor (W.targetPerm j) (W.targetPerm i) := by by_contra hna have hz := ratio_nonancestor_zero (s := s) W hpos hmix hone hji.1 hna have hz' : observedLawDiscrepancy gaussianFeatureMap W.law j i = 0 := by exact hz exact (not_lt_of_ge hz'.le) hji.2
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedLawRatioGraph_edge_isAncestor · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderGraph.lean:181
theorem ratioGraph_transitiveClosure_eq_of_cover

Sound ratio edges plus all ancestral covers recover exactly the permuted latent transitive closure. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
W :
hcover :
∀ ⦃a b : Fin n⦄
then
0 < populationDiscrepancy gaussianFeatureMap W (W.targetPerm.symm a) (W.targetPerm.symm b)
Proof (Lean source)
lemma ratioGraph_transitiveClosure_eq_of_cover {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (hcover : ∀ ⦃a b : Fin n⦄, ancestralCover G a b → 0 < populationDiscrepancy gaussianFeatureMap W (W.targetPerm.symm a) (W.targetPerm.symm b)) : TransGen (observedLawRatioGraph gaussianFeatureMap W.law) = TransGen (permutedGraph G W) := by have hliftAncestor : ∀ {a b}, G.isAncestor a b → TransGen (permutedGraph G W) (W.targetPerm.symm a) (W.targetPerm.symm b) := by intro a b hji induction hji with | edge h => exact Relation.TransGen.single (by simpa [permutedGraph] using h) | trans hab hbc ih => exact Relation.TransGen.tail ih (by simpa [permutedGraph] using hbc) have hancestorPath : ∀ {j i}, G.isAncestor (W.targetPerm j) (W.targetPerm i) → TransGen (permutedGraph G W) j i := by intro j i hji simpa using hliftAncestor hji have hforward : TransGen (observedLawRatioGraph gaussianFeatureMap W.law) ≤ TransGen (permutedGraph G W) := by apply Relation.TransGen.closed intro j i hji exact hancestorPath (observedLawRatioGraph_edge_isAncestor (s := s) W hpos hmix hone hji) have hcoverEdge : ∀ {a b : Fin n}, ancestralCover G a b → observedLawRatioGraph gaussianFeatureMap W.law (W.targetPerm.symm a) (W.targetPerm.symm b) := by intro a b hab have hne : W.targetPerm.symm a ≠ W.targetPerm.symm b := by intro heq have : a = b := W.targetPerm.symm.injective heq subst b exact G.isAncestor_irrefl a (@CovBy.lt (Fin n) ⟨G.isAncestor⟩ a a hab) refine ⟨hne, ?_⟩ exact hcover hab have hmapCoverPath : ∀ {a b}, TransGen (ancestralCover G) a b → TransGen (observedLawRatioGraph gaussianFeatureMap W.law) (W.targetPerm.symm a) (W.targetPerm.symm b) := by intro a b hc exact hc.lift W.targetPerm.symm (fun _ _ h => hcoverEdge h) have hpermEdge : ∀ {j i}, permutedGraph G W j i → TransGen (observedLawRatioGraph gaussianFeatureMap W.law) j i := by intro j i hji have hc := isAncestor_transGen_ancestralCover G (Causalean.DAG.isAncestor.edge hji) simpa using hmapCoverPath hc exact le_antisymm hforward (Relation.TransGen.closed (fun _ _ h => hpermEdge h))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.ratioGraph_transitiveClosure_eq_of_cover · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderGraph.lean:198
theorem environmentParentSet_subset_predecessorSet_of_transitiveClosure

Once the ratio graph has the latent transitive closure, every topological ordering puts all environment-label parents before their child. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
hgraphOrder :
i :
Fin n
Proof (Lean source)
lemma environmentParentSet_subset_predecessorSet_of_transitiveClosure {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) {order : Fin n → ℕ} (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) (i : Fin n) : environmentParentSet W i ⊆ predecessorSet order i := by intro j hj have hedge : permutedGraph G W j i := by simpa [environmentParentSet, permutedGraph] using hj have hlt : order j < order i := hgraphOrder hedge simpa [predecessorSet] using hlt
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.environmentParentSet_subset_predecessorSet_of_transitiveClosure · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderGraph.lean:252
theorem finTwo_edge_ancestralCover

In a two-vertex DAG every directed edge is automatically a cover of the ancestral order, since there is no third vertex that can lie strictly between its endpoints. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
G :
DAG (Fin 2)
j i :
Fin 2
hji :
G.edge j i
Proof (Lean source)
lemma finTwo_edge_ancestralCover (G : DAG (Fin 2)) {j i : Fin 2} (hji : G.edge j i) : ancestralCover G j i := by refine ⟨Causalean.DAG.isAncestor.edge hji, ?_⟩ intro c hjc hci have hj_ne_i : j ≠ i := by intro h subst i exact G.acyclic j (Relation.TransGen.single hji) have hj_ne_c : j ≠ c := by intro h subst c exact G.acyclic j ((G.isAncestor_iff_transGen).mp hjc) have hc_ne_i : c ≠ i := by intro h subst c exact G.acyclic i ((G.isAncestor_iff_transGen).mp hci) fin_cases j <;> fin_cases i <;> fin_cases c <;> simp_all
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.finTwo_edge_ancestralCover · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderGraph.lean:268
theorem bivariate_edge_discrepancy_pos_of_coverSeparated

Cover separation supplies the bivariate Gaussian-MMD edge witness because every edge of a two-vertex DAG is an ancestral cover. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
G :
hcover :
∀ ⦃a b : Fin 2⦄
then
0 < populationDiscrepancy gaussianFeatureMap W (W.targetPerm.symm a) (W.targetPerm.symm b)
j i :
G.edge j i
0 < observedLawDiscrepancy gaussianFeatureMap W.law (W.targetPerm.symm j) (W.targetPerm.symm i)
Proof (Lean source)
lemma bivariate_edge_discrepancy_pos_of_coverSeparated {G : DAG (Fin 2)} {theta : Mechanism 2 G} (W : ObservedWorld G theta) (hcover : ∀ ⦃a b : Fin 2⦄, ancestralCover G a b → 0 < populationDiscrepancy gaussianFeatureMap W (W.targetPerm.symm a) (W.targetPerm.symm b)) : ∀ ⦃j i⦄, G.edge j i → 0 < observedLawDiscrepancy gaussianFeatureMap W.law (W.targetPerm.symm j) (W.targetPerm.symm i) := by intro j i hji simpa [observedLawDiscrepancy, populationDiscrepancy, observationalRatioLaw, interventionalRatioLaw] using hcover (finTwo_edge_ancestralCover G hji)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.bivariate_edge_discrepancy_pos_of_coverSeparated · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderGraph.lean:289
theorem target_not_parent_of_mem_predecessorSet

The intervention target of a node cannot be a parent of any earlier node in a valid ratio-graph topological ordering. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
hgraphOrder :
j i :
Fin n
hj :
j ∈ predecessorSet order i
W.targetPerm i ∉ G.parents (W.targetPerm j)
Proof (Lean source)
lemma target_not_parent_of_mem_predecessorSet {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) {order : Fin n → ℕ} (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) {j i : Fin n} (hj : j ∈ predecessorSet order i) : W.targetPerm i ∉ G.parents (W.targetPerm j) := by intro hparent have hi_env : i ∈ environmentParentSet W j := by simpa [environmentParentSet, parents] using hparent have hi_pred := environmentParentSet_subset_predecessorSet_of_transitiveClosure W horder hgraphOrder j hi_env have hji : order j < order i := by simpa [predecessorSet] using hj have hij : order i < order j := by simpa [predecessorSet] using hi_pred exact lt_asymm hji hij
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.target_not_parent_of_mem_predecessorSet · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderGraph.lean:305
theorem predecessorLogRatioProjection_injective_on_predecessors

The triangular predecessor-score map recovers every predecessor's latent coordinate. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ :
W :
hsign :
order :
Fin n → ℕ
hgraphOrder :
i :
Fin n
v w :
hv :
v ∈ latentCube n
hw :
w ∈ latentCube n
heq :
familyProjection (observedLawLogRatio W.law) (predecessorSet order i) (W.mix v)
= familyProjection (observedLawLogRatio W.law) (predecessorSet order i) (W.mix w)
j ∈ predecessorSet order i :
v (W.targetPerm j) = w (W.targetPerm j)
Proof (Lean source)
lemma predecessorLogRatioProjection_injective_on_predecessors {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (hsign : FixedOwnDerivativeSign G s θ) {order : Fin n → ℕ} (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) (i : Fin n) {v w : LatentState n} (hv : v ∈ latentCube n) (hw : w ∈ latentCube n) (heq : familyProjection (observedLawLogRatio W.law) (predecessorSet order i) (W.mix v) = familyProjection (observedLawLogRatio W.law) (predecessorSet order i) (W.mix w)) : ∀ j ∈ predecessorSet order i, v (W.targetPerm j) = w (W.targetPerm j) := by have hind : ∀ m : ℕ, ∀ j : Fin n, order j = m → j ∈ predecessorSet order i → v (W.targetPerm j) = w (W.targetPerm j) := by intro m induction m using Nat.strong_induction_on with | h m ih => intro j hjorder hjpred have hparents : ∀ a ∈ G.parents (W.targetPerm j), v a = w a := by intro a ha let k := W.targetPerm.symm a have hk_env : k ∈ environmentParentSet W j := by simpa [k, environmentParentSet, parents] using ha have hk_pred_j := environmentParentSet_subset_predecessorSet_of_transitiveClosure W horder hgraphOrder j hk_env have hkj : order k < order j := by simpa [predecessorSet] using hk_pred_j have hji : order j < order i := by simpa [predecessorSet] using hjpred have hk_pred_i : k ∈ predecessorSet order i := by simpa [predecessorSet] using hkj.trans hji have hk := ih (order k) (by simpa [hjorder] using hkj) k rfl hk_pred_i simpa [k] using hk have hscore : log (θ.q (W.targetPerm j) (v (W.targetPerm j)) / θ.p (W.targetPerm j) v) = log (θ.q (W.targetPerm j) (w (W.targetPerm j)) / θ.p (W.targetPerm j) w) := by have hjscore := congrFun heq ⟨j, hjpred⟩ simpa only [familyProjection, observedLawLogRatio_comp_mix_eq W hpos hmix hone j v hv, observedLawLogRatio_comp_mix_eq W hpos hmix hone j w hw] using hjscore exact (mechanismLogRatio_eq_iff_own_eq_of_parents_eq s θ hpos hsign (W.targetPerm j) hv hw hparents).mp hscore intro j hj exact hind (order j) j rfl hj
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.predecessorLogRatioProjection_injective_on_predecessors · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderGraph.lean:323
theorem observedLawRatioGraph_hasTopologicalOrdering

Positivity and the shared perfect-intervention representation make the observed ratio graph acyclic, witnessed by the latent DAG's topological order transported to environment labels. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
Proof (Lean source)
lemma observedLawRatioGraph_hasTopologicalOrdering {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) : ∃ order, IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order := by let order : Fin n → ℕ := fun i => G.topoOrder (W.targetPerm i) refine ⟨order, ?_, ?_⟩ · exact G.topoOrder_injective.comp W.targetPerm.injective · intro j i hji exact G.isAncestor_topoOrder_lt (observedLawRatioGraph_edge_isAncestor (s := s) W hpos hmix hone hji)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedLawRatioGraph_hasTopologicalOrdering · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderGraph.lean:373
theorem selectedTopologicalOrder_valid_of_assumptions

Under the model assumptions, the decoder's internally selected ordering is a valid topological ordering of the observed ratio graph. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
Proof (Lean source)
lemma selectedTopologicalOrder_valid_of_assumptions {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) (selectedTopologicalOrder (observedProbabilityLawFamily W.law)) := by classical let laws := observedProbabilityLawFamily W.law have hprob : ∀ e, IsProbabilityMeasure (W.law e) := observedWorld_laws_isProbabilityMeasure W hpos hmix hone have hlaws : laws.1 = W.law := by simp [laws, observedProbabilityLawFamily, hprob] have hex : ∃ order, IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap laws.1) order := by rw [hlaws] exact observedLawRatioGraph_hasTopologicalOrdering (s := s) W hpos hmix hone simpa only [hlaws] using selectedTopologicalOrder_isTopologicalOrdering laws hex
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.selectedTopologicalOrder_valid_of_assumptions · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderGraph.lean:391
theorem ratioGraph_reconstruction_order_and_predecessors

Equations (4)--(6) assemble into transitive-closure recovery, validity of the decoder's selected order, and containment of every true parent among every valid order's predecessors. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
W :
hcover :
∀ ⦃a b : Fin n⦄
then
0 < populationDiscrepancy gaussianFeatureMap W (W.targetPerm.symm a) (W.targetPerm.symm b)
Proof (Lean source)
lemma ratioGraph_reconstruction_order_and_predecessors {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (hcover : ∀ ⦃a b : Fin n⦄, ancestralCover G a b → 0 < populationDiscrepancy gaussianFeatureMap W (W.targetPerm.symm a) (W.targetPerm.symm b)) : TransGen (observedLawRatioGraph gaussianFeatureMap W.law) = TransGen (permutedGraph G W) ∧ IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) (selectedTopologicalOrder (observedProbabilityLawFamily W.law)) ∧ ∀ order, IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order → ∀ i, environmentParentSet W i ⊆ predecessorSet order i := by have htc := ratioGraph_transitiveClosure_eq_of_cover (s := s) W hpos hmix hone hcover refine ⟨htc, selectedTopologicalOrder_valid_of_assumptions (s := s) W hpos hmix hone, ?_⟩ intro order horder i exact environmentParentSet_subset_predecessorSet_of_transitiveClosure W horder (permutedGraphOrdered_of_transitiveClosure W order horder htc) i
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.ratioGraph_reconstruction_order_and_predecessors · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderGraph.lean:414
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.DecoderOrderedLocalMarkov 7 declarations This module packages the finite-density ordered local Markov theorem in the paper's CondIndepGiven interface under its observational law.

Ordered local Markov bridge for decoder pruning

This module packages the finite-density ordered local Markov theorem in the paper's CondIndepGiven interface under its observational law.

theorem permutedGraph_edge_lt_of_transitiveClosure

A numeric topological order for the ratio graph also orders every latent edge once their transitive closures agree. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
order j < order i
Proof (Lean source)
lemma permutedGraph_edge_lt_of_transitiveClosure {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (order : Fin n → ℕ) (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (htc : TransGen (observedLawRatioGraph gaussianFeatureMap W.law) = TransGen (permutedGraph G W)) : ∀ ⦃j i⦄, permutedGraph G W j i → order j < order i := by intro j i hji have hpath : TransGen (observedLawRatioGraph gaussianFeatureMap W.law) j i := by rw [htc] exact Relation.TransGen.single hji have path_lt : ∀ {a b : Fin n}, TransGen (observedLawRatioGraph gaussianFeatureMap W.law) a b → order a < order b := by intro a b hab induction hab with | single h => exact horder.2 h | tail hab h ih => exact lt_trans ih (horder.2 h) exact path_lt hpath
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.permutedGraph_edge_lt_of_transitiveClosure · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderOrderedLocalMarkov.lean:19
def latentTopologicalRankingOfPermutedOrder

A topological order of the environment-label graph pulls back along the target permutation to a topological ranking of the latent graph.

Definition (Lean source)
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
hinj :
Injective order
hedge :
∀ ⦃j i⦄
if
then
order j < order i
latentTopologicalRankingOfPermutedOrder W order hinj hedge :
clause 1
rank := fun k ↦ order (W.targetPerm.symm k)
clause 2
injective_rank := hinj.comp W.targetPerm.symm.injective
clause 3
edge_lt := by intro j i hji apply hedge simpa [permutedGraph] using hji
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.latentTopologicalRankingOfPermutedOrder · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderOrderedLocalMarkov.lean:44
theorem latentTopologicalRankingOfPermutedOrder_predecessors

Predecessors in the pulled-back latent ranking are exactly target-permutation images of the environment-label predecessors. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
hinj :
Injective order
hedge :
∀ ⦃j i⦄
if
then
order j < order i
k i :
Fin n
k ∈ predecessors (latentTopologicalRankingOfPermutedOrder W order hinj hedge) (W.targetPerm i)
↔ W.targetPerm.symm k ∈ predecessorSet order i
Proof (Lean source)
lemma latentTopologicalRankingOfPermutedOrder_predecessors {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (order : Fin n → ℕ) (hinj : Injective order) (hedge : ∀ ⦃j i⦄, permutedGraph G W j i → order j < order i) (k i : Fin n) : k ∈ predecessors (latentTopologicalRankingOfPermutedOrder W order hinj hedge) (W.targetPerm i) ↔ W.targetPerm.symm k ∈ predecessorSet order i := by simp [predecessors, predecessorSet, latentTopologicalRankingOfPermutedOrder]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.latentTopologicalRankingOfPermutedOrder_predecessors · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderOrderedLocalMarkov.lean:60
theorem mechanism_condIndepGiven_orderedLocalMarkov

A positive normalized paper mechanism makes a latent coordinate conditionally independent of the nonconditioned predecessors whenever the conditioning set contains all latent parents. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
i :
Fin n
A :
hA :
A ⊆ predecessors τ i
hpa :
G.parents i ⊆ A
CondIndepGiven (observationalLaw θ) (fun v : LatentState n ↦ v i) (coordinateProjection (X := fun _ : Fin n ↦ ℝ) (predecessors τ i \ A)) (coordinateProjection (X := fun _ : Fin n ↦ ℝ) A)
Proof (Lean source)
lemma mechanism_condIndepGiven_orderedLocalMarkov {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (hpos : PositiveNormalizedSmoothMechanisms G θ) (τ : TopologicalRanking G) (i : Fin n) (A : Finset (Fin n)) (hA : A ⊆ predecessors τ i) (hpa : G.parents i ⊆ A) : CondIndepGiven (observationalLaw θ) (fun v : LatentState n ↦ v i) (coordinateProjection (X := fun _ : Fin n ↦ ℝ) (predecessors τ i \ A)) (coordinateProjection (X := fun _ : Fin n ↦ ℝ) A) := by rw [← mechanismUnitCubeFactorization_observationalMeasure hpos] rcases mechanism_orderedLocalMarkov hpos τ i A hA hpa with ⟨hfinite, hci⟩ exact ⟨hfinite, measurable_pi_apply i, measurable_coordinateProjection _, measurable_coordinateProjection _, hci⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.mechanism_condIndepGiven_orderedLocalMarkov · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderOrderedLocalMarkov.lean:75
theorem mechanism_condIndepGiven_permutedOrderedLocalMarkov

The ordered local-Markov property pulled back to environment labels: whenever an environment conditioning set contains the target's environment-label parents, the target latent coordinate is independent of all remaining predecessors. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
hgraphOrder :
i :
Fin n
A :
hA :
A ⊆ predecessorSet order i
hpa :
CondIndepGiven (observationalLaw θ) (fun v : LatentState n ↦ v (W.targetPerm i)) (coordinateProjection (X := fun _ : Fin n ↦ ℝ) ((predecessorSet order i).map W.targetPerm.toEmbedding \ A.map W.targetPerm.toEmbedding)) (coordinateProjection (X := fun _ : Fin n ↦ ℝ) (A.map W.targetPerm.toEmbedding))
Proof (Lean source)
lemma mechanism_condIndepGiven_permutedOrderedLocalMarkov {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (order : Fin n → ℕ) (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) (i : Fin n) (A : Finset (Fin n)) (hA : A ⊆ predecessorSet order i) (hpa : environmentParentSet W i ⊆ A) : CondIndepGiven (observationalLaw θ) (fun v : LatentState n ↦ v (W.targetPerm i)) (coordinateProjection (X := fun _ : Fin n ↦ ℝ) ((predecessorSet order i).map W.targetPerm.toEmbedding \ A.map W.targetPerm.toEmbedding)) (coordinateProjection (X := fun _ : Fin n ↦ ℝ) (A.map W.targetPerm.toEmbedding)) := by let τ := latentTopologicalRankingOfPermutedOrder W order horder.1 hgraphOrder have hpred : predecessors τ (W.targetPerm i) = (predecessorSet order i).map W.targetPerm.toEmbedding := by ext k rw [latentTopologicalRankingOfPermutedOrder_predecessors W order horder.1 hgraphOrder k i] simp rw [← hpred] apply mechanism_condIndepGiven_orderedLocalMarkov hpos τ (W.targetPerm i) (A.map W.targetPerm.toEmbedding) · rw [hpred] intro k hk rcases Finset.mem_map.mp hk with ⟨e, he, rfl⟩ exact Finset.mem_map.mpr ⟨e, hA he, rfl⟩ · intro k hk have hkEnv : W.targetPerm.symm k ∈ environmentParentSet W i := by simpa [environmentParentSet, parents] using hk exact Finset.mem_map.mpr ⟨W.targetPerm.symm k, hpa hkEnv, W.targetPerm.apply_symm_apply k⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.mechanism_condIndepGiven_permutedOrderedLocalMarkov · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderOrderedLocalMarkov.lean:97
theorem condIndepCoordinates_singletons_iff_condIndepGiven

Singleton-block conditional independence is equivalent to its scalar-coordinate presentation, with the same finite conditioning projection. the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
i b :
Fin n
Z :
CondIndepCoordinates θ {i} {b} Z
CondIndepGiven (observationalLaw θ) (fun v : LatentState n ↦ v i) (fun v : LatentState n ↦ v b) (coordinateProjection Z)
Proof (Lean source)
lemma condIndepCoordinates_singletons_iff_condIndepGiven {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (i b : Fin n) (Z : Finset (Fin n)) : CondIndepCoordinates θ {i} {b} Z ↔ CondIndepGiven (observationalLaw θ) (fun v : LatentState n ↦ v i) (fun v : LatentState n ↦ v b) (coordinateProjection Z) := by constructor · rintro ⟨hfinite, hXi, hXb, hZ, hCI⟩ letI := hfinite let evalI : ((j : {j // j ∈ ({i} : Finset (Fin n))}) → ℝ) → ℝ := fun x ↦ x ⟨i, Finset.mem_singleton_self i⟩ let evalB : ((j : {j // j ∈ ({b} : Finset (Fin n))}) → ℝ) → ℝ := fun x ↦ x ⟨b, Finset.mem_singleton_self b⟩ have hevalI : Measurable evalI := measurable_pi_apply _ have hevalB : Measurable evalB := measurable_pi_apply _ refine ⟨hfinite, measurable_pi_apply i, measurable_pi_apply b, hZ, ?_⟩ simpa [evalI, evalB, coordinateProjection, Function.comp_def] using hCI.comp hevalI hevalB · rintro ⟨hfinite, hi, hb, hZ, hCI⟩ letI := hfinite let singletonI : ℝ → ((j : {j // j ∈ ({i} : Finset (Fin n))}) → ℝ) := fun r _ ↦ r let singletonB : ℝ → ((j : {j // j ∈ ({b} : Finset (Fin n))}) → ℝ) := fun r _ ↦ r have hsingletonI : Measurable singletonI := measurable_pi_lambda _ fun _ ↦ measurable_id have hsingletonB : Measurable singletonB := measurable_pi_lambda _ fun _ ↦ measurable_id refine ⟨hfinite, measurable_coordinateProjection _, measurable_coordinateProjection _, hZ, ?_⟩ have hraw := hCI.comp hsingletonI hsingletonB convert hraw using 1 · funext v j have hj : (j : Fin n) = i := Finset.mem_singleton.mp j.2 change v j = v i exact congrArg v hj · funext v j have hj : (j : Fin n) = b := Finset.mem_singleton.mp j.2 change v j = v b exact congrArg v hj
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.condIndepCoordinates_singletons_iff_condIndepGiven · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderOrderedLocalMarkov.lean:140
theorem parentOmission_intersection_core

The decoder's weak-union independence and the ordered local-Markov independence combine, by strict-positive-density intersection, to remove every nonparent predecessor from the conditioning set of a putatively omitted parent. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
i b :
Fin n
S P A :
hPS :
P ⊆ S
hAS :
A ⊆ S
hiS :
i ∉ S
hbP :
b ∈ P
hbA :
b ∉ A
Proof (Lean source)
lemma parentOmission_intersection_core {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (i b : Fin n) (S P A : Finset (Fin n)) (hU : ∀ c, Measurable (observedLatentCoordinate W c)) (hPS : P ⊆ S) (hAS : A ⊆ S) (hiS : i ∉ S) (hbP : b ∈ P) (hbA : b ∉ A) (hCI : CondIndepGiven (W.law 0) (observedLatentCoordinate W i) (familyProjection (observedLatentCoordinate W) (S \ A)) (familyProjection (observedLatentCoordinate W) A)) (hMarkov : CondIndepGiven (W.law 0) (observedLatentCoordinate W i) (familyProjection (observedLatentCoordinate W) (S \ P)) (familyProjection (observedLatentCoordinate W) P)) : CondIndepGiven (W.law 0) (observedLatentCoordinate W i) (observedLatentCoordinate W b) (familyProjection (observedLatentCoordinate W) (P.erase b)) := by classical let U := observedLatentCoordinate W have hU' : ∀ c, Measurable (U c) := hU letI : IsFiniteMeasure (W.law 0) := hCI.choose have hbS : b ∈ S := hPS hbP have hweak : CondIndepGiven (W.law 0) (U i) (U b) (familyProjection U (S.erase b)) := (condIndep_coordSplit_prodMk U i b A S hU' hAS hbS hbA hCI).2 let Z := P.erase b let C := S \ P have hib : i ≠ b := by intro h subst b exact hiS (hPS hbP) have hiZ : i ∉ Z := by intro hi exact hiS (hPS (mem_of_mem_erase hi)) have hiC : i ∉ C := by intro hi exact hiS (Finset.mem_sdiff.mp hi).1 have hbZ : b ∉ Z := by simp [Z] have hbC : b ∉ C := by intro hb exact (Finset.mem_sdiff.mp hb).2 hbP have hZC : Disjoint Z C := by refine Finset.disjoint_left.mpr ?_ intro x hxZ hxC exact (Finset.mem_sdiff.mp hxC).2 (mem_of_mem_erase hxZ) have hZCeq : Z ∪ C = S.erase b := by ext x simp only [Z, C, mem_union, Finset.mem_erase, mem_sdiff] constructor · rintro (⟨hxb, hxP⟩ | ⟨hxS, hxnotP⟩) · exact ⟨hxb, hPS hxP⟩ · exact ⟨by intro h; subst x; exact hxnotP hbP, hxS⟩ · rintro ⟨hxb, hxS⟩ by_cases hxP : x ∈ P · exact inl ⟨hxb, hxP⟩ · exact inr ⟨hxS, hxP⟩ let eZC : ((j : {j // j ∈ S.erase b}) → ℝ) ≃ᵐ (((j : {j // j ∈ Z}) → ℝ) × ((j : {j // j ∈ C}) → ℝ)) := (valuesEquivOfEq (Ω := fun _ : Fin n ↦ ℝ) hZCeq.symm).trans (MeasurableEquiv.piFinsetUnion (fun _ : Fin n ↦ ℝ) hZC).symm have heZC : eZC ∘ familyProjection U (S.erase b) = fun x => (familyProjection U Z x, familyProjection U C x) := by funext x ext j <;> rfl have h₁ : CondIndepGiven (W.law 0) (U i) (U b) (fun x => (familyProjection U Z x, familyProjection U C x)) := by rw [← heZC] exact (condIndepGiven_measurableEquiv_comp (U i) (U b) (familyProjection U (S.erase b)) (MeasurableEquiv.refl ℝ) (MeasurableEquiv.refl ℝ) eZC).2 hweak let singletonB : ((j : {j // j ∈ ({b} : Finset (Fin n))}) → ℝ) ≃ᵐ ℝ := { toFun x := x ⟨b, mem_singleton_self b⟩ invFun r _ := r left_inv x := by funext j have hj : j = ⟨b, mem_singleton_self b⟩ := Subtype.ext (Finset.mem_singleton.mp j.2) subst j rfl right_inv _ := rfl measurable_toFun := measurable_pi_apply _ measurable_invFun := measurable_pi_lambda _ fun _ ↦ measurable_id } have hZb : Disjoint Z ({b} : Finset (Fin n)) := by simpa [Finset.disjoint_singleton_right] have hZbeq : Z ∪ {b} = P := by rw [union_comm] exact Finset.insert_erase hbP let eZb : ((j : {j // j ∈ P}) → ℝ) ≃ᵐ (((j : {j // j ∈ Z}) → ℝ) × ℝ) := (valuesEquivOfEq (Ω := fun _ : Fin n ↦ ℝ) hZbeq.symm).trans ((MeasurableEquiv.piFinsetUnion (fun _ : Fin n ↦ ℝ) hZb).symm.trans (MeasurableEquiv.prodCongr (MeasurableEquiv.refl _) singletonB)) have heZb : eZb ∘ familyProjection U P = fun x => (familyProjection U Z x, U b x) := by funext x ext j <;> rfl have h₂ : CondIndepGiven (W.law 0) (U i) (familyProjection U C) (fun x => (familyProjection U Z x, U b x)) := by rw [← heZb] exact (condIndepGiven_measurableEquiv_comp (U i) (familyProjection U C) (familyProjection U P) (MeasurableEquiv.refl ℝ) (MeasurableEquiv.refl _) eZb).2 hMarkov exact (condIndep_intersection_of_pos W hpos hmix hone i b C Z hib hiC hiZ hbC hbZ hZC.symm h₁ h₂).1
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.parentOmission_intersection_core · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderOrderedLocalMarkov.lean:186
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.DecoderPruning 3 declarations This file packages the set-theoretic conclusion of equation (19): once the conditional-independence test characterizes exactly the supersets of the true parent set, that set is the unique inclusion-minimal admissible set

Exact parent pruning

This file packages the set-theoretic conclusion of equation (19): once the conditional-independence test characterizes exactly the supersets of the true parent set, that set is the unique inclusion-minimal admissible set and the decoder's selected graph is the permuted latent graph.

theorem exactParentPruning_at_order

At one common order, the conditional-independence characterization makes the true parent set the unique inclusion-minimal admissible set. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
hparents :
∀ i, environmentParentSet W i ⊆ predecessorSet order i
hiff :
∀ i A
if
A ⊆ predecessorSet order i
i :
conclusion 1
conclusion 2
A :
Proof (Lean source)
lemma exactParentPruning_at_order {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (laws : ObservedProbabilityLawFamily n) (order : Fin n → ℕ) (hparents : ∀ i, environmentParentSet W i ⊆ predecessorSet order i) (hiff : ∀ i A, A ⊆ predecessorSet order i → (CondIndepGiven (laws.1 0) (observedLawRankCoordinate laws order i) (familyProjection (observedLawRankCoordinate laws order) (predecessorSet order i \ A)) (familyProjection (observedLawRankCoordinate laws order) A) ↔ environmentParentSet W i ⊆ A)) : ∀ i, MinimalAdmissibleParentSet laws order i (environmentParentSet W i) ∧ ∀ A, MinimalAdmissibleParentSet laws order i A → A = environmentParentSet W i := by intro i have hp := hparents i have hpa : AdmissibleParentSet laws order i (environmentParentSet W i) := ⟨hp, (hiff i _ hp).2 Finset.Subset.rfl⟩ have hpmin : MinimalAdmissibleParentSet laws order i (environmentParentSet W i) := by refine ⟨hpa, ?_⟩ intro B hB _ exact (hiff i B hB.1).1 hB.2 refine ⟨hpmin, ?_⟩ intro A hA apply Finset.Subset.antisymm · exact hA.2 _ hpa ((hiff i A hA.1.1).1 hA.1.2) · exact (hiff i A hA.1.1).1 hA.1.2
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.exactParentPruning_at_order · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderPruning.lean:19
theorem exactParentPruning_of_condIndepCharacterization

If admissibility is equivalent to containing the true environment-label parents for every valid ordering, parent pruning has that parent set as its unique minimum. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
hpred :
hiff :
∀ order,
order :
i :
conclusion 1
conclusion 2
A :
Proof (Lean source)
lemma exactParentPruning_of_condIndepCharacterization {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (laws : ObservedProbabilityLawFamily n) (hpred : ∀ order, IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap laws.1) order → ∀ i, environmentParentSet W i ⊆ predecessorSet order i) (hiff : ∀ order, IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap laws.1) order → ∀ i A, A ⊆ predecessorSet order i → (CondIndepGiven (laws.1 0) (observedLawRankCoordinate laws order i) (familyProjection (observedLawRankCoordinate laws order) (predecessorSet order i \ A)) (familyProjection (observedLawRankCoordinate laws order) A) ↔ environmentParentSet W i ⊆ A)) : ∀ order, IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap laws.1) order → ∀ i, MinimalAdmissibleParentSet laws order i (environmentParentSet W i) ∧ ∀ A, MinimalAdmissibleParentSet laws order i A → A = environmentParentSet W i := by intro order horder i have hparents : environmentParentSet W i ⊆ predecessorSet order i := hpred order horder i have hparentsAdmissible : AdmissibleParentSet laws order i (environmentParentSet W i) := by refine ⟨hparents, ?_⟩ exact (hiff order horder i (environmentParentSet W i) hparents).2 (Finset.Subset.rfl) have hparentsMinimal : MinimalAdmissibleParentSet laws order i (environmentParentSet W i) := by refine ⟨hparentsAdmissible, ?_⟩ intro B hB _hBparents exact (hiff order horder i B hB.1).1 hB.2 refine ⟨hparentsMinimal, ?_⟩ intro A hA apply Finset.Subset.antisymm · exact hA.2 (environmentParentSet W i) hparentsAdmissible ((hiff order horder i A hA.1.1).1 hA.1.2) · exact (hiff order horder i A hA.1.1).1 hA.1.2
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.exactParentPruning_of_condIndepCharacterization · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderPruning.lean:50
theorem selectedParentDAG_eq_permutedGraph_of_exactPruning

Exact unique parent pruning at the selected topological order makes the decoder's returned DAG equal to the environment-label pullback of the latent DAG. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
Proof (Lean source)
lemma selectedParentDAG_eq_permutedGraph_of_exactPruning {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (laws : ObservedProbabilityLawFamily n) (hprune : ∀ i, MinimalAdmissibleParentSet laws (selectedTopologicalOrder laws) i (environmentParentSet W i) ∧ ∀ A, MinimalAdmissibleParentSet laws (selectedTopologicalOrder laws) i A → A = environmentParentSet W i) : (populationDecoder laws).2.2.edge = permutedGraph G W := by funext j i apply propext change selectedParentRelation laws (selectedTopologicalOrder laws) j i ↔ permutedGraph G W j i have hunique : ∃! A : Finset (Fin n), MinimalAdmissibleParentSet laws (selectedTopologicalOrder laws) i A := by refine ⟨environmentParentSet W i, (hprune i).1, ?_⟩ intro A hA exact (hprune i).2 A hA have hselected : selectedParentSet laws (selectedTopologicalOrder laws) i = some (environmentParentSet W i) := by rw [selectedParentSet, dif_pos hunique] congr exact (hprune i).2 _ (Classical.choose_spec hunique.exists) constructor · rintro ⟨A, hA, hjA⟩ rw [hselected] at hA injection hA with hA subst A simpa [environmentParentSet, permutedGraph] using hjA · intro hji refine ⟨environmentParentSet W i, hselected, ?_⟩ simpa [environmentParentSet, permutedGraph] using hji
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.selectedParentDAG_eq_permutedGraph_of_exactPruning · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderPruning.lean:93
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.DecoderRank 16 declarations This file proves the one-dimensional integration step in equation (12): evaluating a conditional CDF at a strictly monotone score returns the intervention CDF, reflected when the score is decreasing.

Scalar conditional-rank identities

This file proves the one-dimensional integration step in equation (12): evaluating a conditional CDF at a strictly monotone score returns the intervention CDF, reflected when the score is decreasing.

def equationElevenConditionalRatioCDF

Equation (11): conditional on predecessor ranks (hence on the parents), the target log-ratio CDF integrates the intervention density over own-coordinate values below the log-ratio threshold.

Definition (Lean source)
n :
DAG (Fin n)
θ :
i :
Fin n
t :
v :
equationElevenConditionalRatioCDF θ i t v :
∫ w in Icc (0 : ℝ) 1, if log (θ.q i w / θ.p i (update v i w))
≤ t then θ.q i w else 0
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.equationElevenConditionalRatioCDF · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRank.lean:18
theorem interventionCDF_mem_Icc

The normalized positive intervention density has a distribution function valued in the unit interval at every point of the unit interval. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
θ :
i :
Fin n
z :
hz :
z ∈ Icc (0 : ℝ) 1
interventionCDF θ i z ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma interventionCDF_mem_Icc {n : ℕ} {G : DAG (Fin n)} (θ : Mechanism n G) (hpos : PositiveNormalizedSmoothMechanisms G θ) (i : Fin n) (z : ℝ) (hz : z ∈ Icc (0 : ℝ) 1) : interventionCDF θ i z ∈ Icc (0 : ℝ) 1 := by have hq : IntervalIntegrable (θ.q i) volume 0 1 := by have hcont : ContinuousOn (θ.q i) (uIcc (0 : ℝ) 1) := by simpa [uIcc_of_le (show (0 : ℝ) ≤ 1 by norm_num)] using (hpos.2.2.2.1 i).continuousOn exact hcont.intervalIntegrable have hq_nonneg : ∀ᵐ w ∂volume.restrict (Ioc (0 : ℝ) 1), 0 ≤ θ.q i w := by filter_upwards [ae_restrict_mem measurableSet_Ioc] with w hw exact le_of_lt (hpos.2.1 i w ⟨le_of_lt hw.1, hw.2⟩) have hnorm := hpos.2.2.2.2.2 i rw [MeasureTheory.integral_Icc_eq_integral_Ioc, ← intervalIntegral.integral_of_le zero_le_one] at hnorm rw [interventionCDF] constructor · exact intervalIntegral.integral_nonneg hz.1 fun w hw ↦ le_of_lt (hpos.2.1 i w ⟨hw.1, hw.2.trans hz.2⟩) · rw [← hnorm] exact intervalIntegral.integral_mono_interval le_rfl hz.1 hz.2 hq_nonneg hq
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.interventionCDF_mem_Icc · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRank.lean:27
theorem equationElevenConditionalRatioCDF_mem_Icc

The equation-(11) conditional kernel is a genuine unit-interval-valued CDF at every threshold and every latent state in the cube. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
θ :
i :
Fin n
t :
v :
hv :
v ∈ latentCube n
equationElevenConditionalRatioCDF θ i t v ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma equationElevenConditionalRatioCDF_mem_Icc {n : ℕ} {G : DAG (Fin n)} (θ : Mechanism n G) (hpos : PositiveNormalizedSmoothMechanisms G θ) (i : Fin n) (t : ℝ) (v : LatentState n) (hv : v ∈ latentCube n) : equationElevenConditionalRatioCDF θ i t v ∈ Icc (0 : ℝ) 1 := by let f : ℝ → ℝ := fun w ↦ if log (θ.q i w / θ.p i (update v i w)) ≤ t then θ.q i w else 0 have hq : IntegrableOn (θ.q i) (Icc (0 : ℝ) 1) := by exact (hpos.2.2.2.1 i).continuousOn.integrableOn_compact isCompact_Icc have hscore : ContinuousOn (fun w ↦ log (θ.q i w / θ.p i (update v i w))) (Icc (0 : ℝ) 1) := by have hqcont := (hpos.2.2.2.1 i).continuousOn have hpcont : ContinuousOn (fun w ↦ θ.p i (update v i w)) (Icc (0 : ℝ) 1) := by apply (hpos.2.2.1 i).continuousOn.comp · fun_prop · intro w hw j hj by_cases hji : j = i · subst j simpa using hw · simp [hji] exact hv j (Set.mem_univ j) have hpne : ∀ w ∈ Icc (0 : ℝ) 1, θ.p i (update v i w) ≠ 0 := fun w hw ↦ ne_of_gt (hpos.1 i _ (by intro j hj by_cases hji : j = i · subst j simpa using hw · simp [hji] exact hv j (Set.mem_univ j))) have hqne : ∀ w ∈ Icc (0 : ℝ) 1, θ.q i w ≠ 0 := fun w hw ↦ ne_of_gt (hpos.2.1 i w hw) exact (hqcont.div hpcont hpne).log (fun w hw ↦ div_ne_zero (hqne w hw) (hpne w hw)) let μ := volume.restrict (Icc (0 : ℝ) 1) have hqae : AEMeasurable (θ.q i) μ := (hpos.2.2.2.1 i).continuousOn.aemeasurable measurableSet_Icc have hscoreae : AEMeasurable (fun w ↦ log (θ.q i w / θ.p i (update v i w))) μ := hscore.aemeasurable measurableSet_Icc let qm := hqae.mk let sm := hscoreae.mk have hfm : Measurable (fun w ↦ if sm w ≤ t then qm w else 0) := by exact Measurable.ite (measurableSet_le hscoreae.measurable_mk measurable_const) hqae.measurable_mk measurable_const have hfeq : (fun w ↦ if sm w ≤ t then qm w else 0) =ᵐ[μ] f := by filter_upwards [hqae.ae_eq_mk, hscoreae.ae_eq_mk] with w hqw hsw simp only [qm, sm] at hqw hsw ⊢ rw [← hqw, ← hsw] have hfstrong : AEStronglyMeasurable f μ := hfm.aestronglyMeasurable.congr hfeq have hf : IntegrableOn f (Icc (0 : ℝ) 1) := by apply hq.mono' hfstrong · filter_upwards [ae_restrict_mem measurableSet_Icc] with w hw simp only [f] split · rw [Real.norm_eq_abs, abs_of_pos (hpos.2.1 i w hw)] · simpa only [norm_zero] using le_of_lt (hpos.2.1 i w hw) have hnonneg : 0 ≤ ∫ w in Icc (0 : ℝ) 1, f w := by apply MeasureTheory.integral_nonneg_of_ae filter_upwards [ae_restrict_mem measurableSet_Icc] with w hw simp only [f] split · exact le_of_lt (hpos.2.1 i w hw) · exact le_rfl have hle : (∫ w in Icc (0 : ℝ) 1, f w) ≤ ∫ w in Icc (0 : ℝ) 1, θ.q i w := by apply MeasureTheory.integral_mono_ae hf hq filter_upwards [ae_restrict_mem measurableSet_Icc] with w hw simp only [f] split · exact le_rfl · exact le_of_lt (hpos.2.1 i w hw) rw [hpos.2.2.2.2.2 i] at hle change 0 ≤ ∫ w in Icc (0 : ℝ) 1, f w ∧ (∫ w in Icc (0 : ℝ) 1, f w) ≤ 1 exact ⟨hnonneg, hle⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.equationElevenConditionalRatioCDF_mem_Icc · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRank.lean:53
theorem equationElevenConditionalRatioCDF_eq_of_parents_eq

The equation-(11) kernel depends on the conditioning state only through the target's parent coordinates. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
θ :
i :
Fin n
t :
v v' :
hparents :
∀ j ∈ G.parents i, v j = v' j
Proof (Lean source)
lemma equationElevenConditionalRatioCDF_eq_of_parents_eq {n : ℕ} {G : DAG (Fin n)} (θ : Mechanism n G) (i : Fin n) (t : ℝ) {v v' : LatentState n} (hparents : ∀ j ∈ G.parents i, v j = v' j) : equationElevenConditionalRatioCDF θ i t v = equationElevenConditionalRatioCDF θ i t v' := by apply MeasureTheory.integral_congr_ae filter_upwards with w have hp : θ.p i (update v i w) = θ.p i (update v' i w) := by apply θ.parent_local i · simp · intro j hj have hji : j ≠ i := by intro hEq subst j exact G.acyclic i (Relation.TransGen.single (G.mem_parents.mp hj)) simpa [update, hji] using hparents j hj rw [hp]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.equationElevenConditionalRatioCDF_eq_of_parents_eq · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRank.lean:135
theorem conditionalCDF_at_strictMono_score Lemma conditionalCDF_at_strictMono_score in the paper ↗

On the unit interval, a score whose lower level set at z is [0,z] has conditional CDF equal to the integral of its density from zero to z. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
q score :
ℝ → ℝ
z :
hz :
z ∈ Icc (0 : ℝ) 1
hlevel :
∀ w ∈ Icc (0 : ℝ) 1, score w ≤ score z ↔ w ≤ z
(∫ w in Icc (0 : ℝ) 1, if score w ≤ score z then q w else 0) = ∫ w in (0 : ℝ)..z, q w
Proof (Lean source)
lemma conditionalCDF_at_strictMono_score (q score : ℝ → ℝ) (z : ℝ) (hz : z ∈ Icc (0 : ℝ) 1) (hlevel : ∀ w ∈ Icc (0 : ℝ) 1, score w ≤ score z ↔ w ≤ z) : (∫ w in Icc (0 : ℝ) 1, if score w ≤ score z then q w else 0) = ∫ w in (0 : ℝ)..z, q w := by rw [intervalIntegral.integral_of_le hz.1, ← MeasureTheory.integral_Icc_eq_integral_Ioc] rw [← MeasureTheory.integral_indicator measurableSet_Icc, ← MeasureTheory.integral_indicator measurableSet_Icc] apply MeasureTheory.integral_congr_ae filter_upwards with w by_cases hw : w ∈ Icc (0 : ℝ) 1 · simp only [Set.indicator_of_mem hw] have hm := hlevel w hw by_cases hwz : w ≤ z · have hwmem : w ∈ Icc (0 : ℝ) z := ⟨hw.1, hwz⟩ simp [hm, hwz, hwmem] · have hwnmem : w ∉ Icc (0 : ℝ) z := fun h ↦ hwz h.2 simp [hm, hwz, hwnmem] · have hw' : w ∉ Icc (0 : ℝ) z := by intro hwz exact hw ⟨hwz.1, hwz.2.trans hz.2⟩ simp [hw, hw']
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.conditionalCDF_at_strictMono_score · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRank.lean:158
theorem conditionalCDF_at_strictAnti_score Lemma conditionalCDF_at_strictAnti_score in the paper ↗

On the unit interval, a decreasing score has conditional CDF equal to one minus the integral of its normalized density from zero to z. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
q score :
ℝ → ℝ
z :
hz :
z ∈ Icc (0 : ℝ) 1
hnorm :
∫ w in Icc (0 : ℝ) 1, q w = 1
hlevel :
∀ w ∈ Icc (0 : ℝ) 1, score w ≤ score z ↔ z ≤ w
(∫ w in Icc (0 : ℝ) 1, if score w ≤ score z then q w else 0)
= 1 - ∫ w in (0 : ℝ)..z, q w
Proof (Lean source)
lemma conditionalCDF_at_strictAnti_score (q score : ℝ → ℝ) (z : ℝ) (hz : z ∈ Icc (0 : ℝ) 1) (hq : IntervalIntegrable q volume 0 1) (hnorm : ∫ w in Icc (0 : ℝ) 1, q w = 1) (hlevel : ∀ w ∈ Icc (0 : ℝ) 1, score w ≤ score z ↔ z ≤ w) : (∫ w in Icc (0 : ℝ) 1, if score w ≤ score z then q w else 0) = 1 - ∫ w in (0 : ℝ)..z, q w := by have htail : (∫ w in Icc (0 : ℝ) 1, if score w ≤ score z then q w else 0) = ∫ w in z..(1 : ℝ), q w := by rw [intervalIntegral.integral_of_le hz.2, ← MeasureTheory.integral_Icc_eq_integral_Ioc] rw [← MeasureTheory.integral_indicator measurableSet_Icc, ← MeasureTheory.integral_indicator measurableSet_Icc] apply MeasureTheory.integral_congr_ae filter_upwards with w by_cases hw : w ∈ Icc (0 : ℝ) 1 · simp only [Set.indicator_of_mem hw] have hm := hlevel w hw by_cases hzw : z ≤ w · have hwmem : w ∈ Icc z (1 : ℝ) := ⟨hzw, hw.2⟩ simp [hm, hzw, hwmem] · have hwnmem : w ∉ Icc z (1 : ℝ) := fun h ↦ hzw h.1 simp [hm, hzw, hwnmem] · have hw' : w ∉ Icc z (1 : ℝ) := by intro hwz exact hw ⟨hz.1.trans hwz.1, hwz.2⟩ simp [hw, hw'] rw [htail] have hq0z : IntervalIntegrable q volume 0 z := by apply hq.mono_set rw [uIcc_of_le hz.1, uIcc_of_le zero_le_one] exact Set.Icc_subset_Icc_right hz.2 have hqz1 : IntervalIntegrable q volume z 1 := by apply hq.mono_set rw [uIcc_of_le hz.2, uIcc_of_le zero_le_one] exact Set.Icc_subset_Icc_left hz.1 have hadd := intervalIntegral.integral_add_adjacent_intervals hq0z hqz1 rw [MeasureTheory.integral_Icc_eq_integral_Ioc, ← intervalIntegral.integral_of_le zero_le_one] at hnorm linarith
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.conditionalCDF_at_strictAnti_score · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRank.lean:185
theorem conditionalCDF_at_strictMonoOn_score Lemma conditionalCDF_at_strictMonoOn_score in the paper ↗

A normalized density evaluated through a strictly increasing score produces its ordinary distribution function. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
q score :
ℝ → ℝ
z :
hz :
z ∈ Icc (0 : ℝ) 1
hmono :
StrictMonoOn score (Icc (0 : ℝ) 1)
(∫ w in Icc (0 : ℝ) 1, if score w ≤ score z then q w else 0) = ∫ w in (0 : ℝ)..z, q w
Proof (Lean source)
lemma conditionalCDF_at_strictMonoOn_score (q score : ℝ → ℝ) (z : ℝ) (hz : z ∈ Icc (0 : ℝ) 1) (hmono : StrictMonoOn score (Icc (0 : ℝ) 1)) : (∫ w in Icc (0 : ℝ) 1, if score w ≤ score z then q w else 0) = ∫ w in (0 : ℝ)..z, q w := by apply conditionalCDF_at_strictMono_score q score z hz intro w hw exact hmono.le_iff_le hw hz
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.conditionalCDF_at_strictMonoOn_score · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRank.lean:230
theorem conditionalCDF_at_strictAntiOn_score Lemma conditionalCDF_at_strictAntiOn_score in the paper ↗

A normalized density evaluated through a strictly decreasing score produces its reflected distribution function. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
q score :
ℝ → ℝ
z :
hz :
z ∈ Icc (0 : ℝ) 1
hnorm :
∫ w in Icc (0 : ℝ) 1, q w = 1
hanti :
StrictAntiOn score (Icc (0 : ℝ) 1)
(∫ w in Icc (0 : ℝ) 1, if score w ≤ score z then q w else 0)
= 1 - ∫ w in (0 : ℝ)..z, q w
Proof (Lean source)
lemma conditionalCDF_at_strictAntiOn_score (q score : ℝ → ℝ) (z : ℝ) (hz : z ∈ Icc (0 : ℝ) 1) (hq : IntervalIntegrable q volume 0 1) (hnorm : ∫ w in Icc (0 : ℝ) 1, q w = 1) (hanti : StrictAntiOn score (Icc (0 : ℝ) 1)) : (∫ w in Icc (0 : ℝ) 1, if score w ≤ score z then q w else 0) = 1 - ∫ w in (0 : ℝ)..z, q w := by apply conditionalCDF_at_strictAnti_score q score z hz hq hnorm intro w hw exact hanti.le_iff_ge hw hz
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.conditionalCDF_at_strictAntiOn_score · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRank.lean:242
theorem equationEleven_at_strictMonoOwnScore

Equation (11), evaluated at the realized own-coordinate score, is the intervention CDF when that score is strictly increasing on the unit interval. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
θ :
i :
Fin n
v :
hv :
v ∈ latentCube n
hmono :
StrictMonoOn (fun w => log (θ.q i w / θ.p i (update v i w))) (Icc (0 : ℝ) 1)
equationElevenConditionalRatioCDF θ i (log (θ.q i (v i) / θ.p i v)) v
= interventionCDF θ i (v i)
Proof (Lean source)
lemma equationEleven_at_strictMonoOwnScore {n : ℕ} {G : DAG (Fin n)} (θ : Mechanism n G) (i : Fin n) (v : LatentState n) (hv : v ∈ latentCube n) (hmono : StrictMonoOn (fun w => log (θ.q i w / θ.p i (update v i w))) (Icc (0 : ℝ) 1)) : equationElevenConditionalRatioCDF θ i (log (θ.q i (v i) / θ.p i v)) v = interventionCDF θ i (v i) := by have hvi : v i ∈ Icc (0 : ℝ) 1 := hv i (Set.mem_univ i) have hvupdate : update v i (v i) = v := Function.update_eq_self i v simpa only [equationElevenConditionalRatioCDF, interventionCDF, hvupdate] using conditionalCDF_at_strictMonoOn_score (θ.q i) (fun w => log (θ.q i w / θ.p i (update v i w))) (v i) hvi hmono
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.equationEleven_at_strictMonoOwnScore · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRank.lean:256
theorem equationEleven_at_strictAntiOwnScore

Equation (11), evaluated at the realized own-coordinate score, is the reflected intervention CDF when that score is strictly decreasing on the unit interval. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
θ :
i :
Fin n
v :
hv :
v ∈ latentCube n
hanti :
StrictAntiOn (fun w => log (θ.q i w / θ.p i (update v i w))) (Icc (0 : ℝ) 1)
equationElevenConditionalRatioCDF θ i (log (θ.q i (v i) / θ.p i v)) v
= 1 - interventionCDF θ i (v i)
Proof (Lean source)
lemma equationEleven_at_strictAntiOwnScore {n : ℕ} {G : DAG (Fin n)} (θ : Mechanism n G) (hpos : PositiveNormalizedSmoothMechanisms G θ) (i : Fin n) (v : LatentState n) (hv : v ∈ latentCube n) (hanti : StrictAntiOn (fun w => log (θ.q i w / θ.p i (update v i w))) (Icc (0 : ℝ) 1)) : equationElevenConditionalRatioCDF θ i (log (θ.q i (v i) / θ.p i v)) v = 1 - interventionCDF θ i (v i) := by have hvi : v i ∈ Icc (0 : ℝ) 1 := hv i (Set.mem_univ i) have hvupdate : update v i (v i) = v := Function.update_eq_self i v have hq : IntervalIntegrable (θ.q i) volume 0 1 := by have hcont : ContinuousOn (θ.q i) (uIcc (0 : ℝ) 1) := by simpa [uIcc_of_le (show (0 : ℝ) ≤ 1 by norm_num)] using (hpos.2.2.2.1 i).continuousOn exact hcont.intervalIntegrable simpa only [equationElevenConditionalRatioCDF, interventionCDF, hvupdate] using conditionalCDF_at_strictAntiOn_score (θ.q i) (fun w => log (θ.q i w / θ.p i (update v i w))) (v i) hvi hq (hpos.2.2.2.2.2 i) hanti
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.equationEleven_at_strictAntiOwnScore · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRank.lean:274
theorem fixedOwnDerivativeSign_strictMonoOn

A positive prescribed own-score derivative makes the own-coordinate score strictly increasing on the closed unit interval. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ :
hsign :
i :
Fin n
v :
hv :
v ∈ latentCube n
hsi :
s.value i = 1
StrictMonoOn (fun w => log (θ.q i w / θ.p i (update v i w))) (Icc (0 : ℝ) 1)
Proof (Lean source)
lemma fixedOwnDerivativeSign_strictMonoOn {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) (θ : Mechanism n G) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hsign : FixedOwnDerivativeSign G s θ) (i : Fin n) (v : LatentState n) (hv : v ∈ latentCube n) (hsi : s.value i = 1) : StrictMonoOn (fun w => log (θ.q i w / θ.p i (Function.update v i w))) (Icc (0 : ℝ) 1) := by let score : ℝ → ℝ := fun w => log (θ.q i w / θ.p i (Function.update v i w)) apply strictMonoOn_of_deriv_pos (convex_Icc (0 : ℝ) 1) · have hq : ContinuousOn (θ.q i) (Icc (0 : ℝ) 1) := (hpos.2.2.2.1 i).continuousOn have hp : ContinuousOn (fun w => θ.p i (Function.update v i w)) (Icc (0 : ℝ) 1) := by apply (hpos.2.2.1 i).continuousOn.comp · fun_prop · intro w hw j hj by_cases hji : j = i · subst j simpa using hw · simp [hji] exact hv j (Set.mem_univ j) have hpne : ∀ w ∈ Icc (0 : ℝ) 1, θ.p i (Function.update v i w) ≠ 0 := fun w hw => ne_of_gt (hpos.1 i _ (by intro j hj by_cases hji : j = i · subst j simpa using hw · simp [hji] exact hv j (Set.mem_univ j))) have hqne : ∀ w ∈ Icc (0 : ℝ) 1, θ.q i w ≠ 0 := fun w hw => ne_of_gt (hpos.2.1 i w hw) exact (hq.div hp hpne).log (fun w hw => div_ne_zero (hqne w hw) (hpne w hw)) · intro w hw rw [interior_Icc] at hw have hwIcc : w ∈ Icc (0 : ℝ) 1 := ⟨le_of_lt hw.1, le_of_lt hw.2⟩ let vw := Function.update v i w have hvw : vw ∈ latentCube n := by intro j hj by_cases hji : j = i · subst j simpa [vw] using hwIcc · simp [vw, hji] exact hv j (Set.mem_univ j) have hs := hsign i vw hvw rw [hsi, one_mul] at hs have hscore : (fun z => log (θ.q i z / θ.p i (Function.update vw i z))) = score := by funext z simp [vw, score, Function.update_idem] have hderivWithin : derivWithin score (Icc (0 : ℝ) 1) w = ownLogRatioDerivative θ i vw := by simp only [ownLogRatioDerivative, hscore, vw, Function.update_self] rw [← derivWithin_of_mem_nhds (Filter.mem_of_superset (Ioo_mem_nhds hw.1 hw.2) Set.Ioo_subset_Icc_self)] rw [hderivWithin] exact hs
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.fixedOwnDerivativeSign_strictMonoOn · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRank.lean:299
theorem fixedOwnDerivativeSign_strictAntiOn

A negative prescribed own-score derivative makes the own-coordinate score strictly decreasing on the closed unit interval. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ :
hsign :
i :
Fin n
v :
hv :
v ∈ latentCube n
hsi :
s.value i = -1
StrictAntiOn (fun w => log (θ.q i w / θ.p i (update v i w))) (Icc (0 : ℝ) 1)
Proof (Lean source)
lemma fixedOwnDerivativeSign_strictAntiOn {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) (θ : Mechanism n G) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hsign : FixedOwnDerivativeSign G s θ) (i : Fin n) (v : LatentState n) (hv : v ∈ latentCube n) (hsi : s.value i = -1) : StrictAntiOn (fun w => log (θ.q i w / θ.p i (Function.update v i w))) (Icc (0 : ℝ) 1) := by let score : ℝ → ℝ := fun w => log (θ.q i w / θ.p i (Function.update v i w)) apply strictAntiOn_of_deriv_neg (convex_Icc (0 : ℝ) 1) · have hq : ContinuousOn (θ.q i) (Icc (0 : ℝ) 1) := (hpos.2.2.2.1 i).continuousOn have hp : ContinuousOn (fun w => θ.p i (Function.update v i w)) (Icc (0 : ℝ) 1) := by apply (hpos.2.2.1 i).continuousOn.comp · fun_prop · intro w hw j hj by_cases hji : j = i · subst j simpa using hw · simp [hji] exact hv j (Set.mem_univ j) have hpne : ∀ w ∈ Icc (0 : ℝ) 1, θ.p i (Function.update v i w) ≠ 0 := fun w hw => ne_of_gt (hpos.1 i _ (by intro j hj by_cases hji : j = i · subst j simpa using hw · simp [hji] exact hv j (Set.mem_univ j))) have hqne : ∀ w ∈ Icc (0 : ℝ) 1, θ.q i w ≠ 0 := fun w hw => ne_of_gt (hpos.2.1 i w hw) exact (hq.div hp hpne).log (fun w hw => div_ne_zero (hqne w hw) (hpne w hw)) · intro w hw rw [interior_Icc] at hw have hwIcc : w ∈ Icc (0 : ℝ) 1 := ⟨le_of_lt hw.1, le_of_lt hw.2⟩ let vw := Function.update v i w have hvw : vw ∈ latentCube n := by intro j hj by_cases hji : j = i · subst j simpa [vw] using hwIcc · simp [vw, hji] exact hv j (Set.mem_univ j) have hs := hsign i vw hvw rw [hsi] at hs have hscore : (fun z => log (θ.q i z / θ.p i (Function.update vw i z))) = score := by funext z simp [vw, score, Function.update_idem] have hderivWithin : derivWithin score (Icc (0 : ℝ) 1) w = ownLogRatioDerivative θ i vw := by simp only [ownLogRatioDerivative, hscore, vw, Function.update_self] rw [← derivWithin_of_mem_nhds (Filter.mem_of_superset (Ioo_mem_nhds hw.1 hw.2) Set.Ioo_subset_Icc_self)] rw [hderivWithin] linarith
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.fixedOwnDerivativeSign_strictAntiOn · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRank.lean:358
theorem mechanismLogRatio_eq_iff_own_eq_of_parents_eq

With parent coordinates fixed, equality of a node's log-ratio score is equivalent to equality of its own coordinate. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ :
hsign :
i :
Fin n
v w :
hv :
v ∈ latentCube n
hw :
w ∈ latentCube n
hparents :
∀ j ∈ G.parents i, v j = w j
log (θ.q i (v i) / θ.p i v) = log (θ.q i (w i) / θ.p i w) ↔ v i = w i
Proof (Lean source)
lemma mechanismLogRatio_eq_iff_own_eq_of_parents_eq {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) (θ : Mechanism n G) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hsign : FixedOwnDerivativeSign G s θ) (i : Fin n) {v w : LatentState n} (hv : v ∈ latentCube n) (hw : w ∈ latentCube n) (hparents : ∀ j ∈ G.parents i, v j = w j) : log (θ.q i (v i) / θ.p i v) = log (θ.q i (w i) / θ.p i w) ↔ v i = w i := by let score : ℝ → ℝ := fun z ↦ log (θ.q i z / θ.p i (update v i z)) have hvi : v i ∈ Icc (0 : ℝ) 1 := hv i (Set.mem_univ i) have hwi : w i ∈ Icc (0 : ℝ) 1 := hw i (Set.mem_univ i) have hscore_v : score (v i) = log (θ.q i (v i) / θ.p i v) := by simp [score, Function.update_eq_self] have hp_update : θ.p i (update v i (w i)) = θ.p i w := by apply θ.parent_local i · simp · intro j hj have hji : j ≠ i := by intro hEq subst j exact G.acyclic i (Relation.TransGen.single (G.mem_parents.mp hj)) simpa [update, hji] using hparents j hj have hscore_w : score (w i) = log (θ.q i (w i) / θ.p i w) := by simp only [score, hp_update] constructor · intro heq have hscore_eq : score (v i) = score (w i) := by rw [hscore_v, hscore_w] exact heq rcases s.signed i with hneg | hpossign · exact (fixedOwnDerivativeSign_strictAntiOn s θ hpos hsign i v hv hneg).injOn hvi hwi hscore_eq · exact (fixedOwnDerivativeSign_strictMonoOn s θ hpos hsign i v hv hpossign).injOn hvi hwi hscore_eq · intro hi have hp : θ.p i v = θ.p i w := θ.parent_local i v w hi hparents rw [hi, hp]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.mechanismLogRatio_eq_iff_own_eq_of_parents_eq · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRank.lean:416
theorem equationEleven_at_fixedOwnDerivativeSign

Equation (12) follows from equation (11) and the prescribed own-coordinate derivative sign: the recovered rank is the intervention CDF, reflected exactly for negative sign. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ :
hsign :
i :
Fin n
v :
hv :
v ∈ latentCube n
equationElevenConditionalRatioCDF θ i (log (θ.q i (v i) / θ.p i v)) v
= if s.value i = 1 then interventionCDF θ i (v i) else 1 - interventionCDF θ i (v i)
Proof (Lean source)
lemma equationEleven_at_fixedOwnDerivativeSign {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) (θ : Mechanism n G) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hsign : FixedOwnDerivativeSign G s θ) (i : Fin n) (v : LatentState n) (hv : v ∈ latentCube n) : equationElevenConditionalRatioCDF θ i (log (θ.q i (v i) / θ.p i v)) v = if s.value i = 1 then interventionCDF θ i (v i) else 1 - interventionCDF θ i (v i) := by rcases s.signed i with hneg | hposi · rw [if_neg (by linarith : s.value i ≠ 1)] exact equationEleven_at_strictAntiOwnScore θ hpos i v hv (fixedOwnDerivativeSign_strictAntiOn s θ hpos hsign i v hv hneg) · rw [if_pos hposi] exact equationEleven_at_strictMonoOwnScore θ i v hv (fixedOwnDerivativeSign_strictMonoOn s θ hpos hsign i v hv hposi)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.equationEleven_at_fixedOwnDerivativeSign · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRank.lean:458
theorem equationEleven_at_fixedOwnDerivativeSign_mem_Icc

At the realized score, the signed equation-(11) formula has the unit-interval range required by the decoder's conditional-CDF codomain. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ :
hsign :
i :
Fin n
v :
hv :
v ∈ latentCube n
equationElevenConditionalRatioCDF θ i (log (θ.q i (v i) / θ.p i v)) v ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma equationEleven_at_fixedOwnDerivativeSign_mem_Icc {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) (θ : Mechanism n G) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hsign : FixedOwnDerivativeSign G s θ) (i : Fin n) (v : LatentState n) (hv : v ∈ latentCube n) : equationElevenConditionalRatioCDF θ i (log (θ.q i (v i) / θ.p i v)) v ∈ Icc (0 : ℝ) 1 := by rw [equationEleven_at_fixedOwnDerivativeSign s θ hpos hsign i v hv] have hvi : v i ∈ Icc (0 : ℝ) 1 := hv i (Set.mem_univ i) have hQ := interventionCDF_mem_Icc θ hpos i (v i) hvi split · exact hQ · constructor <;> linarith [hQ.1, hQ.2]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.equationEleven_at_fixedOwnDerivativeSign_mem_Icc · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRank.lean:478
theorem observedLawRankCoordinate_eq_of_equationEleven

Once the law-selected conditional CDF is identified with equation (11), evaluating it at the pointwise identified log ratio gives the signed intervention-CDF rank of equation (12). Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ :
W :
order :
Fin n → ℕ
hsign :
i :
Fin n
hEleven :
∀ t v
if
v ∈ latentCube n
then
(observedConditionalRatioCDF laws order i t (familyProjection (observedLawLogRatio laws.1) (predecessorSet order i) (W.mix v)) : ℝ)
= equationElevenConditionalRatioCDF θ (W.targetPerm i) t v
hRatio :
∀ v
if
v ∈ latentCube n
then
observedLawLogRatio laws.1 i (W.mix v)
= log (θ.q (W.targetPerm i) (v (W.targetPerm i)) / θ.p (W.targetPerm i) v)
v :
v ∈ latentCube n
(observedLawRankCoordinate laws order i (W.mix v) : ℝ)
= if s.value (W.targetPerm i) = 1 then interventionCDF θ (W.targetPerm i) (v (W.targetPerm i)) else 1
- interventionCDF θ (W.targetPerm i) (v (W.targetPerm i))
Proof (Lean source)
lemma observedLawRankCoordinate_eq_of_equationEleven {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) (θ : Mechanism n G) (W : ObservedWorld G θ) (laws : ObservedProbabilityLawFamily n) (order : Fin n → ℕ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hsign : FixedOwnDerivativeSign G s θ) (i : Fin n) (hEleven : ∀ t v, v ∈ latentCube n → (observedConditionalRatioCDF laws order i t (familyProjection (observedLawLogRatio laws.1) (predecessorSet order i) (W.mix v)) : ℝ) = equationElevenConditionalRatioCDF θ (W.targetPerm i) t v) (hRatio : ∀ v, v ∈ latentCube n → observedLawLogRatio laws.1 i (W.mix v) = log (θ.q (W.targetPerm i) (v (W.targetPerm i)) / θ.p (W.targetPerm i) v)) : ∀ v, v ∈ latentCube n → (observedLawRankCoordinate laws order i (W.mix v) : ℝ) = if s.value (W.targetPerm i) = 1 then interventionCDF θ (W.targetPerm i) (v (W.targetPerm i)) else 1 - interventionCDF θ (W.targetPerm i) (v (W.targetPerm i)) := by intro v hv rw [observedLawRankCoordinate, hEleven _ v hv, hRatio v hv] exact equationEleven_at_fixedOwnDerivativeSign s θ hpos hsign (W.targetPerm i) v hv
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedLawRankCoordinate_eq_of_equationEleven · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRank.lean:495
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.DecoderRankAssembly 2 declarations This file assembles the support, continuous-version, explicit equation-(11), and signed-rank facts into the complete conditional-rank clause consumed by the exact population decoder theorem.

Continuous conditional-rank assembly

This file assembles the support, continuous-version, explicit equation-(11), and signed-rank facts into the complete conditional-rank clause consumed by the exact population decoder theorem.

theorem exactRatioDecoder_continuousRankClauses_of_order

A ratio-graph order that also respects the latent edges has the law-selected continuous conditional CDF, its equation-(11) realization, and the signed intervention-CDF rank. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ :
W :
hsign :
order :
Fin n → ℕ
hgraphOrder :
i :
∃ C,
t v :
v ∈ latentCube n
(C t (familyProjection (observedLawLogRatio W.law) (predecessorSet order i) (W.mix v)) : ℝ)
= equationElevenConditionalRatioCDF θ (W.targetPerm i) t v
C :
z ∈ observedConditionalRatioSupport W.law order i :
C z.1 z.2 = observedConditionalRatioCDF laws order i z.1 z.2
t v :
v ∈ latentCube n
(observedConditionalRatioCDF laws order i t (familyProjection (observedLawLogRatio W.law) (predecessorSet order i) (W.mix v)) : ℝ)
= equationElevenConditionalRatioCDF θ (W.targetPerm i) t v
v :
v ∈ latentCube n
(observedLawRankCoordinate laws order i (W.mix v) : ℝ)
= if s.value (W.targetPerm i) = 1 then interventionCDF θ (W.targetPerm i) (v (W.targetPerm i)) else 1
- interventionCDF θ (W.targetPerm i) (v (W.targetPerm i))
Proof (Lean source)
lemma exactRatioDecoder_continuousRankClauses_of_order {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (hsign : FixedOwnDerivativeSign G s θ) (order : Fin n → ℕ) (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) : ∀ i, let laws := observedProbabilityLawFamily W.law IsContinuousConditionalRatioCDFVersion laws order i (observedConditionalRatioCDF laws order i) ∧ (∃ C, IsContinuousConditionalRatioCDFVersion laws order i C ∧ ∀ t v, v ∈ latentCube n → (C t (familyProjection (observedLawLogRatio W.law) (predecessorSet order i) (W.mix v)) : ℝ) = equationElevenConditionalRatioCDF θ (W.targetPerm i) t v) ∧ (∀ C, IsContinuousConditionalRatioCDFVersion laws order i C → ∀ z ∈ observedConditionalRatioSupport W.law order i, C z.1 z.2 = observedConditionalRatioCDF laws order i z.1 z.2) ∧ (∀ t v, v ∈ latentCube n → (observedConditionalRatioCDF laws order i t (familyProjection (observedLawLogRatio W.law) (predecessorSet order i) (W.mix v)) : ℝ) = equationElevenConditionalRatioCDF θ (W.targetPerm i) t v) ∧ ∀ v, v ∈ latentCube n → (observedLawRankCoordinate laws order i (W.mix v) : ℝ) = if s.value (W.targetPerm i) = 1 then interventionCDF θ (W.targetPerm i) (v (W.targetPerm i)) else 1 - interventionCDF θ (W.targetPerm i) (v (W.targetPerm i)) := by intro i let laws := observedProbabilityLawFamily W.law have hprob : ∀ e, IsProbabilityMeasure (W.law e) := observedWorld_laws_isProbabilityMeasure W hpos hmix hone have hlaws : laws.1 = W.law := by simp [laws, observedProbabilityLawFamily, hprob] let C := equationElevenAmbientCDF s W hpos hmix hone hsign horder hgraphOrder i have hC : IsContinuousConditionalRatioCDFVersion laws order i C := by exact equationElevenAmbientCDF_isContinuousVersion s W hpos hmix hone hsign horder hgraphOrder i have hex : ∃ D, IsContinuousConditionalRatioCDFVersion laws order i D := ⟨C, hC⟩ have hselected : IsContinuousConditionalRatioCDFVersion laws order i (observedConditionalRatioCDF laws order i) := observedConditionalRatioCDF_isContinuousVersion laws order i hex have hC_apply : ∀ t v, v ∈ latentCube n → (C t (familyProjection (observedLawLogRatio W.law) (predecessorSet order i) (W.mix v)) : ℝ) = equationElevenConditionalRatioCDF θ (W.targetPerm i) t v := by intro t v hv exact equationElevenAmbientCDF_apply_of_latentState s W hpos hmix hone hsign horder hgraphOrder i t v hv have hselected_apply : ∀ t v, v ∈ latentCube n → (observedConditionalRatioCDF laws order i t (familyProjection (observedLawLogRatio W.law) (predecessorSet order i) (W.mix v)) : ℝ) = equationElevenConditionalRatioCDF θ (W.targetPerm i) t v := by intro t v hv let ell := familyProjection (observedLawLogRatio W.law) (predecessorSet order i) (W.mix v) have hz : (t, ell) ∈ observedConditionalRatioSupport laws.1 order i := by rw [hlaws] exact ⟨Set.mem_univ t, observedPredecessorLogRatio_mem_support W hpos hmix hone i v hv⟩ have heq := observedConditionalRatioCDF_eq_on_support laws order i hex C hC (t, ell) hz calc (observedConditionalRatioCDF laws order i t ell : ℝ) = (C t ell : ℝ) := congrArg val heq.symm _ = equationElevenConditionalRatioCDF θ (W.targetPerm i) t v := hC_apply t v hv refine ⟨hselected, ⟨C, hC, hC_apply⟩, ?_, hselected_apply, ?_⟩ · intro D hD simpa only [hlaws] using (observedConditionalRatioCDF_eq_on_support laws order i hex D hD) · have hselected_apply' : ∀ t v, v ∈ latentCube n → (observedConditionalRatioCDF laws order i t (familyProjection (observedLawLogRatio laws.1) (predecessorSet order i) (W.mix v)) : ℝ) = equationElevenConditionalRatioCDF θ (W.targetPerm i) t v := by simpa only [hlaws] using hselected_apply have hratio' : ∀ v, v ∈ latentCube n → observedLawLogRatio laws.1 i (W.mix v) = log (θ.q (W.targetPerm i) (v (W.targetPerm i)) / θ.p (W.targetPerm i) v) := by simpa only [hlaws] using (observedLawLogRatio_comp_mix_eq W hpos hmix hone i) exact observedLawRankCoordinate_eq_of_equationEleven s θ W laws order hpos hsign i hselected_apply' hratio'
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.exactRatioDecoder_continuousRankClauses_of_order · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRankAssembly.lean:19
theorem exactRatioDecoder_continuousRankClauses Lemma 7 in the paper ↗

Transitive-closure recovery supplies latent-edge compatibility for every valid ratio order. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
∃ C,
t v :
v ∈ latentCube n
(C t (familyProjection (observedLawLogRatio W.law) (predecessorSet order i) (W.mix v)) : ℝ)
= equationElevenConditionalRatioCDF θ (W.targetPerm i) t v
C :
z ∈ observedConditionalRatioSupport W.law order i :
C z.1 z.2 = observedConditionalRatioCDF laws order i z.1 z.2
t v :
v ∈ latentCube n
(observedConditionalRatioCDF laws order i t (familyProjection (observedLawLogRatio W.law) (predecessorSet order i) (W.mix v)) : ℝ)
= equationElevenConditionalRatioCDF θ (W.targetPerm i) t v
v :
v ∈ latentCube n
(observedLawRankCoordinate laws order i (W.mix v) : ℝ)
= if s.value (W.targetPerm i) = 1 then interventionCDF θ (W.targetPerm i) (v (W.targetPerm i)) else 1
- interventionCDF θ (W.targetPerm i) (v (W.targetPerm i))
Proof (Lean source)
lemma exactRatioDecoder_continuousRankClauses {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (hsign : FixedOwnDerivativeSign G s θ) (htc : TransGen (observedLawRatioGraph gaussianFeatureMap W.law) = TransGen (permutedGraph G W)) : ∀ order, IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order → ∀ i, let laws := observedProbabilityLawFamily W.law IsContinuousConditionalRatioCDFVersion laws order i (observedConditionalRatioCDF laws order i) ∧ (∃ C, IsContinuousConditionalRatioCDFVersion laws order i C ∧ ∀ t v, v ∈ latentCube n → (C t (familyProjection (observedLawLogRatio W.law) (predecessorSet order i) (W.mix v)) : ℝ) = equationElevenConditionalRatioCDF θ (W.targetPerm i) t v) ∧ (∀ C, IsContinuousConditionalRatioCDFVersion laws order i C → ∀ z ∈ observedConditionalRatioSupport W.law order i, C z.1 z.2 = observedConditionalRatioCDF laws order i z.1 z.2) ∧ (∀ t v, v ∈ latentCube n → (observedConditionalRatioCDF laws order i t (familyProjection (observedLawLogRatio W.law) (predecessorSet order i) (W.mix v)) : ℝ) = equationElevenConditionalRatioCDF θ (W.targetPerm i) t v) ∧ ∀ v, v ∈ latentCube n → (observedLawRankCoordinate laws order i (W.mix v) : ℝ) = if s.value (W.targetPerm i) = 1 then interventionCDF θ (W.targetPerm i) (v (W.targetPerm i)) else 1 - interventionCDF θ (W.targetPerm i) (v (W.targetPerm i)) := by intro order horder exact exactRatioDecoder_continuousRankClauses_of_order s W hpos hmix hone hsign order horder (permutedGraphOrdered_of_transitiveClosure W order horder htc)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.exactRatioDecoder_continuousRankClauses · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRankAssembly.lean:113
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.DecoderRankCondIndep 4 declarations This module records the measurable-embedding invariance used to pass between the decoder's signed CDF ranks and the corresponding latent coordinates.

Rank-coordinate conditional-independence transport

This module records the measurable-embedding invariance used to pass between the decoder's signed CDF ranks and the corresponding latent coordinates.

theorem condIndepGiven_measurableEmbedding_comp

Applying measurable embeddings separately to both variables and the conditioning variable preserves and reflects conditional independence. the stated conclusion follows.

Formal statement
UX :
Ω → X
UY :
Ω → Y
UZ :
Ω → Z
fX :
X → X'
fY :
Y → Y'
fZ :
Z → Z'
CondIndepGiven μ (fX ∘ UX) (fY ∘ UY) (fZ ∘ UZ) ↔ CondIndepGiven μ UX UY UZ
Proof (Lean source)
lemma condIndepGiven_measurableEmbedding_comp {Ω X Y Z X' Y' Z' : Type*} [MeasurableSpace Ω] [StandardBorelSpace Ω] [MeasurableSpace X] [MeasurableSpace Y] [MeasurableSpace Z] [MeasurableSpace X'] [MeasurableSpace Y'] [MeasurableSpace Z'] [Nonempty X] [Nonempty Y] [Nonempty Z] {μ : Measure Ω} (UX : Ω → X) (UY : Ω → Y) (UZ : Ω → Z) {fX : X → X'} {fY : Y → Y'} {fZ : Z → Z'} (eX : MeasurableEmbedding fX) (eY : MeasurableEmbedding fY) (eZ : MeasurableEmbedding fZ) : CondIndepGiven μ (fX ∘ UX) (fY ∘ UY) (fZ ∘ UZ) ↔ CondIndepGiven μ UX UY UZ := by constructor · rintro ⟨hμ, hX, hY, hZ, hCI⟩ letI := hμ have hUX : Measurable UX := by convert eX.measurable_invFun.comp hX using 1 funext ω exact (eX.leftInverse_invFun (UX ω)).symm have hUY : Measurable UY := by convert eY.measurable_invFun.comp hY using 1 funext ω exact (eY.leftInverse_invFun (UY ω)).symm have hUZ : Measurable UZ := by convert eZ.measurable_invFun.comp hZ using 1 funext ω exact (eZ.leftInverse_invFun (UZ ω)).symm refine ⟨hμ, hUX, hUY, hUZ, ?_⟩ have hraw := hCI.comp eX.measurable_invFun eY.measurable_invFun have hs : CondIndepFun (comap (fZ ∘ UZ) inferInstance) hZ.comap_le UX UY μ := by convert hraw using 1 <;> funext ω · exact (eX.leftInverse_invFun (UX ω)).symm · exact (eY.leftInverse_invFun (UY ω)).symm simpa only [← MeasurableSpace.comap_comp, eZ.comap_eq] using hs · rintro ⟨hμ, hX, hY, hZ, hCI⟩ letI := hμ refine ⟨hμ, eX.measurable.comp hX, eY.measurable.comp hY, eZ.measurable.comp hZ, ?_⟩ have hraw := hCI.comp eX.measurable eY.measurable simpa only [← MeasurableSpace.comap_comp, eZ.comap_eq] using hraw
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.condIndepGiven_measurableEmbedding_comp · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRankCondIndep.lean:18
def signedInterventionCDFChart

The signed intervention CDF restricted to the unit interval, with its range proof.

Definition (Lean source)
n :
DAG (Fin n)
s :
θ :
i :
Fin n
signedInterventionCDFChart s θ hpos i :
Icc (0 : ℝ) 1 → Icc (0 : ℝ) 1
fun z
=> ⟨signedInterventionCDF s θ i z, by unfold signedInterventionCDF have hQ := interventionCDF_mem_Icc θ hpos i z z.2 split · exact hQ · constructor <;> linarith [hQ.1, hQ.2]⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.signedInterventionCDFChart · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRankCondIndep.lean:63
theorem continuous_signedInterventionCDFChart

The signed intervention CDF chart is continuous on the closed unit interval. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ :
i :
Fin n
Proof (Lean source)
lemma continuous_signedInterventionCDFChart {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) (θ : Mechanism n G) (hpos : PositiveNormalizedSmoothMechanisms G θ) (i : Fin n) : Continuous (signedInterventionCDFChart s θ hpos i) := by have hqint : IntegrableOn (θ.q i) (Icc (0 : ℝ) 1) := (hpos.2.2.2.1 i).continuousOn.integrableOn_compact isCompact_Icc have hcset := intervalIntegral.continuousOn_primitive hqint have hcdf : Continuous (fun z : Icc (0 : ℝ) 1 => interventionCDF θ i z) := by have h := hcset.restrict convert h using 1 funext z change (∫ u in (0 : ℝ)..(z : ℝ), θ.q i u) = ∫ u in Ioc (0 : ℝ) (z : ℝ), θ.q i u exact intervalIntegral.integral_of_le z.2.1 have hsigned : Continuous (fun z : Icc (0 : ℝ) 1 => signedInterventionCDF s θ i z) := by unfold signedInterventionCDF split · exact hcdf · fun_prop exact hsigned.subtype_mk _
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuous_signedInterventionCDFChart · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRankCondIndep.lean:77
theorem signedInterventionCDFChart_measurableEmbedding

The positive-density signed CDF chart is a measurable embedding of the unit interval. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ :
i :
Fin n
Proof (Lean source)
lemma signedInterventionCDFChart_measurableEmbedding {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) (θ : Mechanism n G) (hpos : PositiveNormalizedSmoothMechanisms G θ) (i : Fin n) : MeasurableEmbedding (signedInterventionCDFChart s θ hpos i) := by apply (continuous_signedInterventionCDFChart s θ hpos i).measurableEmbedding intro a b hab apply Subtype.ext exact signedInterventionCDF_injOn s θ hpos i a.2 b.2 (congrArg val hab)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.signedInterventionCDFChart_measurableEmbedding · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRankCondIndep.lean:101
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.DecoderRankPruning 15 declarations This module transports conditional independence between law-selected signed-CDF ranks and measurable support-restricted latent coordinates, then combines ordered local Markov and positive-density intersection to characte

Rank-coordinate parent-pruning assembly

This module transports conditional independence between law-selected signed-CDF ranks and measurable support-restricted latent coordinates, then combines ordered local Markov and positive-density intersection to characterize the admissible parent sets exactly.

def observedLatentUnitCoordinate

The support-restricted observed latent coordinate, bundled with its unit-interval range.

Definition (Lean source)
n :
DAG (Fin n)
W :
e :
Fin n
observedLatentUnitCoordinate W hmix e :
LatentState n → Icc (0 : ℝ) 1
fun x
=> ⟨observedLatentCoordinate W e x, by classical by_cases hx : x ∈ observedSupport G W · rcases hx with ⟨v, hv, rfl⟩ rw [observedLatentCoordinate_mix W hmix e v hv] exact hv _ (Set.mem_univ _) · simp [observedLatentCoordinate, hx]⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedLatentUnitCoordinate · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRankPruning.lean:19
theorem measurable_observedLatentUnitCoordinate

The unit-interval-valued observed latent coordinate is measurable. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
e :
Fin n
Proof (Lean source)
lemma measurable_observedLatentUnitCoordinate {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hmix : SharedDiffeomorphicMixing G θ W) (e : Fin n) : Measurable (observedLatentUnitCoordinate W hmix e) := (measurable_observedLatentCoordinate W hmix e).subtype_mk
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.measurable_observedLatentUnitCoordinate · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRankPruning.lean:33
def signedInterventionCDFFamilyChart

Coordinatewise signed-CDF chart on a finite family of environment labels.

Definition (Lean source)
n :
DAG (Fin n)
s :
θ :
W :
A :
signedInterventionCDFFamilyChart s θ hpos W A :
((e : {e // e ∈ A}) → Icc (0 : ℝ) 1) → ((e : {e // e ∈ A}) → Icc (0 : ℝ) 1)
fun z e => signedInterventionCDFChart s θ hpos (W.targetPerm e) (z e)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.signedInterventionCDFFamilyChart · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRankPruning.lean:41
theorem signedInterventionCDFFamilyChart_measurableEmbedding

Applying the signed intervention CDF separately in finitely many coordinates is a measurable embedding. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ :
W :
A :
Proof (Lean source)
lemma signedInterventionCDFFamilyChart_measurableEmbedding {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) (θ : Mechanism n G) (hpos : PositiveNormalizedSmoothMechanisms G θ) (W : ObservedWorld G θ) (A : Finset (Fin n)) : MeasurableEmbedding (signedInterventionCDFFamilyChart s θ hpos W A) := by apply Continuous.measurableEmbedding · apply continuous_pi intro e exact (continuous_signedInterventionCDFChart s θ hpos (W.targetPerm e)).comp (continuous_apply e) · intro x y hxy funext e exact (signedInterventionCDFChart_measurableEmbedding s θ hpos (W.targetPerm e)).injective (congrFun hxy e)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.signedInterventionCDFFamilyChart_measurableEmbedding · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRankPruning.lean:51

Coordinatewise coercion from unit-interval-valued families to real-valued families.

Definition (Lean source)
n :
shared
A :
unitFamilyVal A :
((e : {e // e ∈ A}) → Icc (0 : ℝ) 1) → ((e : {e // e ∈ A}) → ℝ)
fun z e => z e
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.unitFamilyVal · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRankPruning.lean:69
theorem unitFamilyVal_measurableEmbedding

Coordinatewise coercion from a finite product of unit intervals is a measurable embedding. the stated conclusion follows.

Formal statement
n :
shared
A :
Proof (Lean source)
lemma unitFamilyVal_measurableEmbedding (A : Finset (Fin n)) : MeasurableEmbedding (unitFamilyVal A) := by apply Continuous.measurableEmbedding · exact continuous_pi fun e => continuous_subtype_val.comp (continuous_apply e) · intro x y hxy funext e exact Subtype.ext (congrFun hxy e)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.unitFamilyVal_measurableEmbedding · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRankPruning.lean:75
theorem rankCoordinate_condIndep_iff_observedLatent

Pointwise identification of every selected rank with its signed intervention CDF transports the decoder's conditional-independence test exactly to the support-restricted latent coordinates. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ :
W :
order :
Fin n → ℕ
hrank :
∀ e v
if
v ∈ latentCube n
then
(observedLawRankCoordinate laws order e (W.mix v) : ℝ)
= signedInterventionCDF s θ (W.targetPerm e) (v (W.targetPerm e))
i :
Fin n
Y Z :
Proof (Lean source)
lemma rankCoordinate_condIndep_iff_observedLatent {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (laws : ObservedProbabilityLawFamily n) (order : Fin n → ℕ) (hrank : ∀ e v, v ∈ latentCube n → (observedLawRankCoordinate laws order e (W.mix v) : ℝ) = signedInterventionCDF s θ (W.targetPerm e) (v (W.targetPerm e))) (i : Fin n) (Y Z : Finset (Fin n)) : CondIndepGiven (W.law 0) (observedLawRankCoordinate laws order i) (familyProjection (observedLawRankCoordinate laws order) Y) (familyProjection (observedLawRankCoordinate laws order) Z) ↔ CondIndepGiven (W.law 0) (observedLatentCoordinate W i) (familyProjection (observedLatentCoordinate W) Y) (familyProjection (observedLatentCoordinate W) Z) := by classical let U := fun e => observedLatentUnitCoordinate W hmix e let phi := fun e => signedInterventionCDFChart s θ hpos (W.targetPerm e) have hsupp : ∀ᵐ x ∂W.law 0, x ∈ observedSupport G W := by filter_upwards [Measure.support_mem_ae (μ := W.law 0)] with x hx rwa [observedLaw_support_eq_observedSupport W hpos hmix hone] at hx have hi : observedLawRankCoordinate laws order i =ᵐ[W.law 0] phi i ∘ U i := by filter_upwards [hsupp] with x hx rcases hx with ⟨v, hv, rfl⟩ apply Subtype.ext simpa [phi, U, signedInterventionCDFChart, observedLatentUnitCoordinate, observedLatentCoordinate_mix W hmix i v hv] using hrank i v hv have hY : familyProjection (observedLawRankCoordinate laws order) Y =ᵐ[W.law 0] signedInterventionCDFFamilyChart s θ hpos W Y ∘ familyProjection U Y := by filter_upwards [hsupp] with x hx rcases hx with ⟨v, hv, rfl⟩ funext e apply Subtype.ext simpa [signedInterventionCDFFamilyChart, familyProjection, U, signedInterventionCDFChart, observedLatentUnitCoordinate, observedLatentCoordinate_mix W hmix e v hv] using hrank e v hv have hZ : familyProjection (observedLawRankCoordinate laws order) Z =ᵐ[W.law 0] signedInterventionCDFFamilyChart s θ hpos W Z ∘ familyProjection U Z := by filter_upwards [hsupp] with x hx rcases hx with ⟨v, hv, rfl⟩ funext e apply Subtype.ext simpa [signedInterventionCDFFamilyChart, familyProjection, U, signedInterventionCDFChart, observedLatentUnitCoordinate, observedLatentCoordinate_mix W hmix e v hv] using hrank e v hv have hU (e : Fin n) : Measurable (U e) := measurable_observedLatentUnitCoordinate W hmix e have hUY (A : Finset (Fin n)) : Measurable (familyProjection U A) := measurable_pi_lambda _ fun e => hU e have hcongr := condIndepGiven_congr_ae (measurable_observedLawRankCoordinate laws order i) ((signedInterventionCDFChart_measurableEmbedding s θ hpos (W.targetPerm i)).measurable.comp (hU i)) (measurable_rankFamilyProjection laws order Y) ((signedInterventionCDFFamilyChart_measurableEmbedding s θ hpos W Y).measurable.comp (hUY Y)) (measurable_rankFamilyProjection laws order Z) ((signedInterventionCDFFamilyChart_measurableEmbedding s θ hpos W Z).measurable.comp (hUY Z)) hi hY hZ have hchart := condIndepGiven_measurableEmbedding_comp (μ := W.law 0) (U i) (familyProjection U Y) (familyProjection U Z) (signedInterventionCDFChart_measurableEmbedding s θ hpos (W.targetPerm i)) (signedInterventionCDFFamilyChart_measurableEmbedding s θ hpos W Y) (signedInterventionCDFFamilyChart_measurableEmbedding s θ hpos W Z) have hval := condIndepGiven_measurableEmbedding_comp (μ := W.law 0) (U i) (familyProjection U Y) (familyProjection U Z) (MeasurableEmbedding.subtype_coe measurableSet_Icc) (unitFamilyVal_measurableEmbedding Y) (unitFamilyVal_measurableEmbedding Z) have hvalI : ((fun z : Icc (0 : ℝ) 1 => (z : ℝ)) ∘ U i) = observedLatentCoordinate W i := by funext x rfl have hvalY : unitFamilyVal Y ∘ familyProjection U Y = familyProjection (observedLatentCoordinate W) Y := by funext x e rfl have hvalZ : unitFamilyVal Z ∘ familyProjection U Z = familyProjection (observedLatentCoordinate W) Z := by funext x e rfl have hc : CondIndepGiven (W.law 0) (phi i ∘ U i) (signedInterventionCDFFamilyChart s θ hpos W Y ∘ familyProjection U Y) (signedInterventionCDFFamilyChart s θ hpos W Z ∘ familyProjection U Z) ↔ CondIndepGiven (W.law 0) (U i) (familyProjection U Y) (familyProjection U Z) := by simpa [phi] using hchart have hv : CondIndepGiven (W.law 0) (observedLatentCoordinate W i) (familyProjection (observedLatentCoordinate W) Y) (familyProjection (observedLatentCoordinate W) Z) ↔ CondIndepGiven (W.law 0) (U i) (familyProjection U Y) (familyProjection U Z) := by rw [hvalI, hvalY, hvalZ] at hval exact hval exact hcongr.trans (hc.trans hv.symm)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.rankCoordinate_condIndep_iff_observedLatent · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRankPruning.lean:85
def measurableMixVersion

A globally measurable version of the mixing map, equal to it on the latent cube.

Definition (Lean source)
n :
DAG (Fin n)
W :
measurableMixVersion W :
by classical exact (latentCube n).piecewise W.mix (fun _ => 0)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.measurableMixVersion · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRankPruning.lean:184
theorem measurable_measurableMixVersion

The support-restricted mixing-map version is measurable. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
Proof (Lean source)
lemma measurable_measurableMixVersion {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hmix : SharedDiffeomorphicMixing G θ W) : Measurable (measurableMixVersion W) := by classical have hcube : MeasurableSet (latentCube n) := by rw [latentCube] measurability unfold measurableMixVersion exact hmix.1.continuousOn.measurable_piecewise continuous_const.continuousOn hcube
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.measurable_measurableMixVersion · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRankPruning.lean:192
theorem observedLatent_condIndep_iff_latent

Conditional independence of support-restricted observed latent coordinates is equivalent to conditional independence of the target-permuted coordinates under the latent observational law. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
i :
Fin n
Y Z :
CondIndepGiven (observationalLaw θ) (fun v => v (W.targetPerm i)) (familyProjection (fun e v => v (W.targetPerm e)) Y) (familyProjection (fun e v => v (W.targetPerm e)) Z)
Proof (Lean source)
lemma observedLatent_condIndep_iff_latent {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (i : Fin n) (Y Z : Finset (Fin n)) : CondIndepGiven (W.law 0) (observedLatentCoordinate W i) (familyProjection (observedLatentCoordinate W) Y) (familyProjection (observedLatentCoordinate W) Z) ↔ CondIndepGiven (observationalLaw θ) (fun v => v (W.targetPerm i)) (familyProjection (fun e v => v (W.targetPerm e)) Y) (familyProjection (fun e v => v (W.targetPerm e)) Z) := by classical let mix' := measurableMixVersion W let V := fun e : Fin n => observedLatentCoordinate W e let X := fun e : Fin n => fun v : LatentState n => v (W.targetPerm e) have hmix' : Measurable mix' := measurable_measurableMixVersion W hmix have hV (e : Fin n) : Measurable (V e) := measurable_observedLatentCoordinate W hmix e have hVproj (A : Finset (Fin n)) : Measurable (familyProjection V A) := measurable_pi_lambda _ fun e => hV e have hcube : ∀ᵐ v ∂observationalLaw θ, v ∈ latentCube n := observationalLaw_ae_mem_latentCube hpos have hmix_eq : W.mix =ᵐ[observationalLaw θ] mix' := by filter_upwards [hcube] with v hv simp [mix', measurableMixVersion, hv] have hlaw : W.law 0 = Measure.map mix' (observationalLaw θ) := by rw [hone.1] exact Measure.map_congr hmix_eq have hi : V i ∘ mix' =ᵐ[observationalLaw θ] X i := by filter_upwards [hcube, hmix_eq] with v hv hmv change V i (mix' v) = X i v rw [← hmv] exact observedLatentCoordinate_mix W hmix i v hv have hY : familyProjection V Y ∘ mix' =ᵐ[observationalLaw θ] familyProjection X Y := by filter_upwards [hcube, hmix_eq] with v hv hmv change familyProjection V Y (mix' v) = familyProjection X Y v rw [← hmv] funext e exact observedLatentCoordinate_mix W hmix e v hv have hZ : familyProjection V Z ∘ mix' =ᵐ[observationalLaw θ] familyProjection X Z := by filter_upwards [hcube, hmix_eq] with v hv hmv change familyProjection V Z (mix' v) = familyProjection X Z v rw [← hmv] funext e exact observedLatentCoordinate_mix W hmix e v hv letI : IsProbabilityMeasure (observationalLaw θ) := observationalLaw_isProbabilityMeasure hpos have hmap := condIndepGiven_map_iff (mu := observationalLaw θ) hmix' (hV i) (hVproj Y) (hVproj Z) rw [← hlaw] at hmap have hcongr := condIndepGiven_congr_ae ((hV i).comp hmix') (measurable_pi_apply (W.targetPerm i)) ((hVproj Y).comp hmix') (measurable_pi_lambda _ fun e => measurable_pi_apply (W.targetPerm e)) ((hVproj Z).comp hmix') (measurable_pi_lambda _ fun e => measurable_pi_apply (W.targetPerm e)) hi hY hZ exact hmap.symm.trans hcongr
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedLatent_condIndep_iff_latent · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRankPruning.lean:205
def permutedValuesEquiv

Reindexing a finite coordinate family along the world's target permutation.

Definition (Lean source)
n :
DAG (Fin n)
W :
A :
permutedValuesEquiv W A :
((k : {k // k ∈ A.map W.targetPerm.toEmbedding}) → ℝ) ≃ᵐ ((e : {e // e ∈ A}) → ℝ)
clause 1
toFun x e := x ⟨W.targetPerm e, Finset.mem_map.mpr ⟨e, e.2, rfl⟩⟩
clause 2
invFun y k := y ⟨W.targetPerm.symm k, by rcases Finset.mem_map.mp k.2 with ⟨e, he, hek⟩ have heq : e
= W.targetPerm.symm k := by apply W.targetPerm.injective simpa using hek simpa only [← heq] using he⟩
clause 3
left_inv x := by funext k apply congrArg x apply Subtype.ext simp
clause 4
right_inv y := by funext e apply congrArg y apply Subtype.ext simp
clause 5
measurable_toFun := measurable_pi_lambda _ fun e => measurable_pi_apply _
clause 6
measurable_invFun := measurable_pi_lambda _ fun k => measurable_pi_apply _
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.permutedValuesEquiv · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRankPruning.lean:270

A one-coordinate finite family is measurably equivalent to its scalar coordinate.

Definition (Lean source)
n :
shared
b :
Fin n
singletonFamilyEquiv b :
((e : {e // e ∈ ({b} : Finset (Fin n))}) → ℝ) ≃ᵐ ℝ
clause 1
toFun x := x ⟨b, mem_singleton_self b⟩
clause 2
invFun r _ := r
clause 3
left_inv x := by funext e apply congrArg x apply Subtype.ext exact (Finset.mem_singleton.mp e.2).symm
clause 4
right_inv _ := rfl
clause 5
measurable_toFun := measurable_pi_apply _
clause 6
measurable_invFun := measurable_pi_lambda _ fun _ => measurable_id
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.singletonFamilyEquiv · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRankPruning.lean:298
theorem mechanism_condIndepGiven_permutedOrderedLocalMarkov_env

Ordered local Markov in environment-label coordinates, reindexing the latent projection along the intervention-target permutation. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
hgraphOrder :
i :
Fin n
A :
hA :
A ⊆ predecessorSet order i
hpa :
CondIndepGiven (observationalLaw θ) (fun v => v (W.targetPerm i)) (familyProjection (fun e v => v (W.targetPerm e)) (predecessorSet order i \ A)) (familyProjection (fun e v => v (W.targetPerm e)) A)
Proof (Lean source)
lemma mechanism_condIndepGiven_permutedOrderedLocalMarkov_env {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (order : Fin n → ℕ) (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) (i : Fin n) (A : Finset (Fin n)) (hA : A ⊆ predecessorSet order i) (hpa : environmentParentSet W i ⊆ A) : CondIndepGiven (observationalLaw θ) (fun v => v (W.targetPerm i)) (familyProjection (fun e v => v (W.targetPerm e)) (predecessorSet order i \ A)) (familyProjection (fun e v => v (W.targetPerm e)) A) := by classical let S := predecessorSet order i have hraw := mechanism_condIndepGiven_permutedOrderedLocalMarkov W hpos order horder hgraphOrder i A hA hpa have hmapdiff : S.map W.targetPerm.toEmbedding \ A.map W.targetPerm.toEmbedding = (S \ A).map W.targetPerm.toEmbedding := by ext k simp [S] rw [hmapdiff] at hraw have htransport := (condIndepGiven_measurableEquiv_comp (μ := observationalLaw θ) (fun v : LatentState n => v (W.targetPerm i)) (coordinateProjection (X := fun _ : Fin n => ℝ) ((S \ A).map W.targetPerm.toEmbedding)) (coordinateProjection (X := fun _ : Fin n => ℝ) (A.map W.targetPerm.toEmbedding)) (MeasurableEquiv.refl ℝ) (permutedValuesEquiv W (S \ A)) (permutedValuesEquiv W A)).2 hraw convert htransport using 1 · rfl · funext x e rfl · funext x e rfl
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.mechanism_condIndepGiven_permutedOrderedLocalMarkov_env · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRankPruning.lean:313
theorem exactRankCondIndepCharacterization_of_order

For every valid ratio-graph ordering, rank-coordinate conditional independence holds exactly when the conditioning set contains all environment-label parents. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ :
W :
hminimal :
order :
Fin n → ℕ
hgraphOrder :
hrank :
∀ e v
if
v ∈ latentCube n
then
(observedLawRankCoordinate laws order e (W.mix v) : ℝ)
= signedInterventionCDF s θ (W.targetPerm e) (v (W.targetPerm e))
i A :
A ⊆ predecessorSet order i
Proof (Lean source)
lemma exactRankCondIndepCharacterization_of_order {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hminimal : CausalMinimality G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (laws : ObservedProbabilityLawFamily n) (order : Fin n → ℕ) (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) (hrank : ∀ e v, v ∈ latentCube n → (observedLawRankCoordinate laws order e (W.mix v) : ℝ) = signedInterventionCDF s θ (W.targetPerm e) (v (W.targetPerm e))) : ∀ i A, A ⊆ predecessorSet order i → (CondIndepGiven (W.law 0) (observedLawRankCoordinate laws order i) (familyProjection (observedLawRankCoordinate laws order) (predecessorSet order i \ A)) (familyProjection (observedLawRankCoordinate laws order) A) ↔ environmentParentSet W i ⊆ A) := by classical intro i A hAS let S := predecessorSet order i let P := environmentParentSet W i have hPS : P ⊆ S := environmentParentSet_subset_predecessorSet_of_transitiveClosure W horder hgraphOrder i have hrankObs := rankCoordinate_condIndep_iff_observedLatent s W hpos hmix hone laws order hrank i (S \ A) A constructor · intro hCIrank have hCIobs : CondIndepGiven (W.law 0) (observedLatentCoordinate W i) (familyProjection (observedLatentCoordinate W) (S \ A)) (familyProjection (observedLatentCoordinate W) A) := hrankObs.1 hCIrank by_contra hnsub rw [Finset.not_subset] at hnsub rcases hnsub with ⟨b, hbP, hbA⟩ have hmarkLat := mechanism_condIndepGiven_permutedOrderedLocalMarkov_env W hpos order horder hgraphOrder i P hPS (Finset.Subset.rfl) have hmarkObs := (observedLatent_condIndep_iff_latent W hpos hmix hone i (S \ P) P).2 hmarkLat have hiS : i ∉ S := by simp [S, predecessorSet] have hscalarObs := parentOmission_intersection_core W hpos hmix hone i b S P A (fun c => measurable_observedLatentCoordinate W hmix c) hPS hAS hiS hbP hbA hCIobs hmarkObs have hsingleObs : CondIndepGiven (W.law 0) (observedLatentCoordinate W i) (familyProjection (observedLatentCoordinate W) {b}) (familyProjection (observedLatentCoordinate W) (P.erase b)) := by have h := (condIndepGiven_measurableEquiv_comp (μ := W.law 0) (observedLatentCoordinate W i) (familyProjection (observedLatentCoordinate W) {b}) (familyProjection (observedLatentCoordinate W) (P.erase b)) (MeasurableEquiv.refl ℝ) (singletonFamilyEquiv b) (MeasurableEquiv.refl _)).1 apply h simpa [singletonFamilyEquiv, familyProjection, Function.comp_def] using hscalarObs have hsingleLat := (observedLatent_condIndep_iff_latent W hpos hmix hone i {b} (P.erase b)).1 hsingleObs have hscalarLat : CondIndepGiven (observationalLaw θ) (fun v => v (W.targetPerm i)) (fun v => v (W.targetPerm b)) (familyProjection (fun e v => v (W.targetPerm e)) (P.erase b)) := by have h := (condIndepGiven_measurableEquiv_comp (μ := observationalLaw θ) (fun v : LatentState n => v (W.targetPerm i)) (familyProjection (fun (e : Fin n) (v : LatentState n) => v (W.targetPerm e)) {b}) (familyProjection (fun (e : Fin n) (v : LatentState n) => v (W.targetPerm e)) (P.erase b)) (MeasurableEquiv.refl ℝ) (singletonFamilyEquiv b) (MeasurableEquiv.refl _)).2 hsingleLat simpa [singletonFamilyEquiv, familyProjection, Function.comp_def] using h have hmapP : P.map W.targetPerm.toEmbedding = G.parents (W.targetPerm i) := by ext k simp [P, environmentParentSet, parents] have hmapErase : (P.erase b).map W.targetPerm.toEmbedding = (G.parents (W.targetPerm i)).erase (W.targetPerm b) := by rw [Finset.map_erase, hmapP] rfl have hactual : CondIndepGiven (observationalLaw θ) (fun v => v (W.targetPerm i)) (fun v => v (W.targetPerm b)) (coordinateProjection (X := fun _ : Fin n => ℝ) ((G.parents (W.targetPerm i)).erase (W.targetPerm b))) := by have h := (condIndepGiven_measurableEquiv_comp (μ := observationalLaw θ) (fun v : LatentState n => v (W.targetPerm i)) (fun v : LatentState n => v (W.targetPerm b)) (coordinateProjection (X := fun _ : Fin n => ℝ) ((P.erase b).map W.targetPerm.toEmbedding)) (MeasurableEquiv.refl ℝ) (MeasurableEquiv.refl ℝ) (permutedValuesEquiv W (P.erase b))).1 hscalarLat rw [← hmapErase] exact h have hedge : G.edge (W.targetPerm b) (W.targetPerm i) := by simpa [P, environmentParentSet, parents] using hbP exact hminimal hedge ((condIndepCoordinates_singletons_iff_condIndepGiven (W.targetPerm i) (W.targetPerm b) ((G.parents (W.targetPerm i)).erase (W.targetPerm b))).2 hactual) · intro hpa have hlat := mechanism_condIndepGiven_permutedOrderedLocalMarkov_env W hpos order horder hgraphOrder i A hAS hpa have hobs := (observedLatent_condIndep_iff_latent W hpos hmix hone i (S \ A) A).2 hlat exact hrankObs.2 hobs
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.exactRankCondIndepCharacterization_of_order · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRankPruning.lean:356
theorem exactRankCondIndepCharacterization

Transitive-closure recovery specializes the ordered characterization to every ratio order. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ :
W :
hminimal :
order :
Fin n → ℕ
hrank :
∀ e v
if
v ∈ latentCube n
then
(observedLawRankCoordinate laws order e (W.mix v) : ℝ)
= signedInterventionCDF s θ (W.targetPerm e) (v (W.targetPerm e))
i A :
A ⊆ predecessorSet order i
Proof (Lean source)
lemma exactRankCondIndepCharacterization {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hminimal : CausalMinimality G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (laws : ObservedProbabilityLawFamily n) (htc : TransGen (observedLawRatioGraph gaussianFeatureMap W.law) = TransGen (permutedGraph G W)) (order : Fin n → ℕ) (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hrank : ∀ e v, v ∈ latentCube n → (observedLawRankCoordinate laws order e (W.mix v) : ℝ) = signedInterventionCDF s θ (W.targetPerm e) (v (W.targetPerm e))) : ∀ i A, A ⊆ predecessorSet order i → (CondIndepGiven (W.law 0) (observedLawRankCoordinate laws order i) (familyProjection (observedLawRankCoordinate laws order) (predecessorSet order i \ A)) (familyProjection (observedLawRankCoordinate laws order) A) ↔ environmentParentSet W i ⊆ A) := exactRankCondIndepCharacterization_of_order s W hpos hminimal hmix hone laws order horder (permutedGraphOrdered_of_transitiveClosure W order horder htc) hrank
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.exactRankCondIndepCharacterization · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRankPruning.lean:461
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.DecoderRepresentation 11 declarations These lemmas isolate the law-support and graph-relabeling parts of the compatible- representation argument.

Compatible-representation bookkeeping

These lemmas isolate the law-support and graph-relabeling parts of the compatible- representation argument. The remaining analytic step is the componentwise coordinate identification from the common law-selected ranks.

def signedInterventionCDF

The scalar rank chart selected by an intervention CDF and the prescribed ratio-score sign.

Definition (Lean source)
n :
DAG (Fin n)
s :
θ :
i :
Fin n
z :
signedInterventionCDF s θ i z :
if s.value i = 1 then interventionCDF θ i z else 1 - interventionCDF θ i z
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.signedInterventionCDF · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRepresentation.lean:19
theorem interventionCDF_strictMonoOn

Strict positivity of the intervention density makes its CDF strictly increasing on the latent interval. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
θ :
i :
Fin n
StrictMonoOn (interventionCDF θ i) (Icc (0 : ℝ) 1)
Proof (Lean source)
lemma interventionCDF_strictMonoOn {n : ℕ} {G : DAG (Fin n)} (θ : Mechanism n G) (hpos : PositiveNormalizedSmoothMechanisms G θ) (i : Fin n) : StrictMonoOn (interventionCDF θ i) (Icc (0 : ℝ) 1) := by intro a ha b hb hab have hcont : ContinuousOn (θ.q i) (Icc (0 : ℝ) 1) := (hpos.2.2.2.1 i).continuousOn have hcont₀a : ContinuousOn (θ.q i) (uIcc (0 : ℝ) a) := by apply hcont.mono rw [Set.uIcc_of_le ha.1] exact Set.Icc_subset_Icc le_rfl ha.2 have hcontab : ContinuousOn (θ.q i) (uIcc a b) := by apply hcont.mono rw [Set.uIcc_of_le hab.le] exact Set.Icc_subset_Icc ha.1 hb.2 have hintpos : 0 < ∫ z in a..b, θ.q i z := by apply intervalIntegral.integral_pos hab · simpa only [Set.uIcc_of_le hab.le] using hcontab · intro z hz exact (hpos.2.1 i z ⟨ha.1.trans hz.1.le, hz.2.trans hb.2⟩).le · exact ⟨a, ⟨le_rfl, hab.le⟩, hpos.2.1 i a ha⟩ have hadd : (∫ z in (0 : ℝ)..a, θ.q i z) + ∫ z in a..b, θ.q i z = ∫ z in (0 : ℝ)..b, θ.q i z := intervalIntegral.integral_add_adjacent_intervals hcont₀a.intervalIntegrable hcontab.intervalIntegrable unfold interventionCDF linarith
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.interventionCDF_strictMonoOn · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRepresentation.lean:26
theorem signedInterventionCDF_injOn

Reflection for a negative score sign preserves injectivity of the scalar intervention-CDF chart. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ :
i :
Fin n
InjOn (signedInterventionCDF s θ i) (Icc (0 : ℝ) 1)
Proof (Lean source)
lemma signedInterventionCDF_injOn {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) (θ : Mechanism n G) (hpos : PositiveNormalizedSmoothMechanisms G θ) (i : Fin n) : InjOn (signedInterventionCDF s θ i) (Icc (0 : ℝ) 1) := by intro a ha b hb heq have hinj := (interventionCDF_strictMonoOn θ hpos i).injOn unfold signedInterventionCDF at heq split at heq · exact hinj ha hb heq · apply hinj ha hb linarith
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.signedInterventionCDF_injOn · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRepresentation.lean:57
theorem observedProbabilityLawFamily_eq_of_law_eq

The probability-family packaging, selected order, and rank coordinates are literally shared by representations whose supplied law families are equal. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
Mechanism n G₁
Mechanism n G₂
W₁ :
ObservedWorld G₁ θ₁
W₂ :
ObservedWorld G₂ θ₂
hlaw :
W₂.law = W₁.law
Proof (Lean source)
lemma observedProbabilityLawFamily_eq_of_law_eq {n : ℕ} {G₁ G₂ : DAG (Fin n)} {θ₁ : Mechanism n G₁} {θ₂ : Mechanism n G₂} (W₁ : ObservedWorld G₁ θ₁) (W₂ : ObservedWorld G₂ θ₂) (hlaw : W₂.law = W₁.law) : observedProbabilityLawFamily W₂.law = observedProbabilityLawFamily W₁.law := by rw [hlaw]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedProbabilityLawFamily_eq_of_law_eq · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRepresentation.lean:72
theorem observedSupport_eq_of_observationalLaw_eq

Compatible smooth observed worlds with the same observational law have the same observed support. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
Mechanism n G₁
Mechanism n G₂
W₁ :
ObservedWorld G₁ θ₁
W₂ :
ObservedWorld G₂ θ₂
hpos₁ :
hmix₁ :
hone₁ :
hpos₂ :
hmix₂ :
hone₂ :
hlaw :
W₂.law = W₁.law
observedSupport G₁ W₁ = observedSupport G₂ W₂
Proof (Lean source)
lemma observedSupport_eq_of_observationalLaw_eq {n : ℕ} {G₁ G₂ : DAG (Fin n)} {θ₁ : Mechanism n G₁} {θ₂ : Mechanism n G₂} (W₁ : ObservedWorld G₁ θ₁) (W₂ : ObservedWorld G₂ θ₂) (hpos₁ : PositiveNormalizedSmoothMechanisms G₁ θ₁) (hmix₁ : SharedDiffeomorphicMixing G₁ θ₁ W₁) (hone₁ : OnePerfectInterventionPerNode G₁ θ₁ W₁) (hpos₂ : PositiveNormalizedSmoothMechanisms G₂ θ₂) (hmix₂ : SharedDiffeomorphicMixing G₂ θ₂ W₂) (hone₂ : OnePerfectInterventionPerNode G₂ θ₂ W₂) (hlaw : W₂.law = W₁.law) : observedSupport G₁ W₁ = observedSupport G₂ W₂ := by rw [← observedLaw_support_eq_observedSupport W₁ hpos₁ hmix₁ hone₁, ← observedLaw_support_eq_observedSupport W₂ hpos₂ hmix₂ hone₂, hlaw]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedSupport_eq_of_observationalLaw_eq · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRepresentation.lean:83
theorem aligned_edge_iff_of_permutedGraph_eq

Equality of environment-label graphs gives graph isomorphism under the intervention-target alignment permutation. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
Mechanism n G₁
Mechanism n G₂
W₁ :
ObservedWorld G₁ θ₁
W₂ :
ObservedWorld G₂ θ₂
hgraph :
permutedGraph G₁ W₁ = permutedGraph G₂ W₂
j i :
G₂.edge ((W₁.targetPerm.symm.trans W₂.targetPerm) j) ((W₁.targetPerm.symm.trans W₂.targetPerm) i)
↔ G₁.edge j i
Proof (Lean source)
lemma aligned_edge_iff_of_permutedGraph_eq {n : ℕ} {G₁ G₂ : DAG (Fin n)} {θ₁ : Mechanism n G₁} {θ₂ : Mechanism n G₂} (W₁ : ObservedWorld G₁ θ₁) (W₂ : ObservedWorld G₂ θ₂) (hgraph : permutedGraph G₁ W₁ = permutedGraph G₂ W₂) : ∀ j i, G₂.edge ((W₁.targetPerm.symm.trans W₂.targetPerm) j) ((W₁.targetPerm.symm.trans W₂.targetPerm) i) ↔ G₁.edge j i := by intro j i have h := congrFun (congrFun hgraph (W₁.targetPerm.symm j)) (W₁.targetPerm.symm i) simpa [permutedGraph] using h.symm
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.aligned_edge_iff_of_permutedGraph_eq · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRepresentation.lean:102
theorem aligned_edge_iff_of_common_exactPruning

If law-only exact pruning identifies both representations' parent relations, their latent graphs align by the target permutation. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
Mechanism n G₁
Mechanism n G₂
W₁ :
ObservedWorld G₁ θ₁
W₂ :
ObservedWorld G₂ θ₂
j i :
G₂.edge ((W₁.targetPerm.symm.trans W₂.targetPerm) j) ((W₁.targetPerm.symm.trans W₂.targetPerm) i)
↔ G₁.edge j i
Proof (Lean source)
lemma aligned_edge_iff_of_common_exactPruning {n : ℕ} {G₁ G₂ : DAG (Fin n)} {θ₁ : Mechanism n G₁} {θ₂ : Mechanism n G₂} (W₁ : ObservedWorld G₁ θ₁) (W₂ : ObservedWorld G₂ θ₂) (laws : ObservedProbabilityLawFamily n) (hprune₁ : ∀ i, MinimalAdmissibleParentSet laws (selectedTopologicalOrder laws) i (environmentParentSet W₁ i) ∧ ∀ A, MinimalAdmissibleParentSet laws (selectedTopologicalOrder laws) i A → A = environmentParentSet W₁ i) (hprune₂ : ∀ i, MinimalAdmissibleParentSet laws (selectedTopologicalOrder laws) i (environmentParentSet W₂ i) ∧ ∀ A, MinimalAdmissibleParentSet laws (selectedTopologicalOrder laws) i A → A = environmentParentSet W₂ i) : ∀ j i, G₂.edge ((W₁.targetPerm.symm.trans W₂.targetPerm) j) ((W₁.targetPerm.symm.trans W₂.targetPerm) i) ↔ G₁.edge j i := by apply aligned_edge_iff_of_permutedGraph_eq W₁ W₂ rw [← selectedParentDAG_eq_permutedGraph_of_exactPruning W₁ laws hprune₁, ← selectedParentDAG_eq_permutedGraph_of_exactPruning W₂ laws hprune₂]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.aligned_edge_iff_of_common_exactPruning · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRepresentation.lean:119
theorem competitorTopologicalOrder_is_common_of_law_eq

A topological order pulled back from a compatible competitor orders the common observable ratio graph and, once the reference transitive closure is identified, the reference graph too. No cover-separation premise is required for the competitor. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
Mechanism n G₁
Mechanism n G₂
W₁ :
ObservedWorld G₁ θ₁
W₂ :
ObservedWorld G₂ θ₂
hpos₂ :
hmix₂ :
hone₂ :
hlaw :
W₂.law = W₁.law
order :
fun e ↦ G₂.topoOrder (W₂.targetPerm e) (: Fin n → ℕ)
j i :
permutedGraph G₁ W₁ j i
order j < order i
j i :
permutedGraph G₂ W₂ j i
order j < order i
i :
i :
Proof (Lean source)
lemma competitorTopologicalOrder_is_common_of_law_eq {n : ℕ} {G₁ G₂ : DAG (Fin n)} {s : SignVector n} {θ₁ : Mechanism n G₁} {θ₂ : Mechanism n G₂} (W₁ : ObservedWorld G₁ θ₁) (W₂ : ObservedWorld G₂ θ₂) (hpos₂ : PositiveNormalizedSmoothMechanisms G₂ θ₂) (hmix₂ : SharedDiffeomorphicMixing G₂ θ₂ W₂) (hone₂ : OnePerfectInterventionPerNode G₂ θ₂ W₂) (hlaw : W₂.law = W₁.law) (htc₁ : TransGen (observedLawRatioGraph gaussianFeatureMap W₁.law) = TransGen (permutedGraph G₁ W₁)) : let order : Fin n → ℕ := fun e ↦ G₂.topoOrder (W₂.targetPerm e) IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W₁.law) order ∧ (∀ ⦃j i⦄, permutedGraph G₁ W₁ j i → order j < order i) ∧ (∀ ⦃j i⦄, permutedGraph G₂ W₂ j i → order j < order i) ∧ (∀ i, environmentParentSet W₁ i ⊆ predecessorSet order i) ∧ (∀ i, environmentParentSet W₂ i ⊆ predecessorSet order i) := by let order : Fin n → ℕ := fun e ↦ G₂.topoOrder (W₂.targetPerm e) have hinj : Injective order := G₂.topoOrder_injective.comp W₂.targetPerm.injective have hratio : ∀ ⦃j i⦄, observedLawRatioGraph gaussianFeatureMap W₁.law j i → order j < order i := by intro j i hji have hji₂ : observedLawRatioGraph gaussianFeatureMap W₂.law j i := by simpa only [hlaw] using hji exact G₂.isAncestor_topoOrder_lt (observedLawRatioGraph_edge_isAncestor (s := s) W₂ hpos₂ hmix₂ hone₂ hji₂) have hpath : ∀ ⦃j i⦄, TransGen (observedLawRatioGraph gaussianFeatureMap W₁.law) j i → order j < order i := by intro j i hji induction hji with | single h => exact hratio h | tail _ h ih => exact lt_trans ih (hratio h) have hedge₁ : ∀ ⦃j i⦄, permutedGraph G₁ W₁ j i → order j < order i := by intro j i hji apply hpath rw [htc₁] exact Relation.TransGen.single hji have hedge₂ : ∀ ⦃j i⦄, permutedGraph G₂ W₂ j i → order j < order i := by intro j i hji exact G₂.isAncestor_topoOrder_lt (Causalean.DAG.isAncestor.edge hji) refine ⟨⟨hinj, hratio⟩, hedge₁, hedge₂, ?_, ?_⟩ · intro j i hji simpa [predecessorSet, order] using hedge₁ (by simpa [environmentParentSet, permutedGraph] using hji) · intro j i hji simpa [predecessorSet, order] using hedge₂ (by simpa [environmentParentSet, permutedGraph] using hji)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.competitorTopologicalOrder_is_common_of_law_eq · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRepresentation.lean:145
theorem signedInterventionCDF_eq_of_common_rank

Two representations realizing the same law-only rank coordinate have equal signed scalar intervention-CDF coordinates at every common support point. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
Mechanism n G₁
Mechanism n G₂
W₁ :
ObservedWorld G₁ θ₁
W₂ :
ObservedWorld G₂ θ₂
hmix₁ :
hmix₂ :
order :
Fin n → ℕ
hrank₁ :
∀ e v
if
v ∈ latentCube n
then
(observedLawRankCoordinate laws order e (W₁.mix v) : ℝ)
= signedInterventionCDF s θ₁ (W₁.targetPerm e) (v (W₁.targetPerm e))
hrank₂ :
∀ e v
if
v ∈ latentCube n
then
(observedLawRankCoordinate laws order e (W₂.mix v) : ℝ)
= signedInterventionCDF s θ₂ (W₂.targetPerm e) (v (W₂.targetPerm e))
x :
hx₁ :
x ∈ observedSupport G₁ W₁
hx₂ :
x ∈ observedSupport G₂ W₂
e :
Fin n
signedInterventionCDF s θ₁ (W₁.targetPerm e) (W₁.unmix x (W₁.targetPerm e))
= signedInterventionCDF s θ₂ (W₂.targetPerm e) (W₂.unmix x (W₂.targetPerm e))
Proof (Lean source)
lemma signedInterventionCDF_eq_of_common_rank {n : ℕ} {G₁ G₂ : DAG (Fin n)} {s : SignVector n} {θ₁ : Mechanism n G₁} {θ₂ : Mechanism n G₂} (W₁ : ObservedWorld G₁ θ₁) (W₂ : ObservedWorld G₂ θ₂) (hmix₁ : SharedDiffeomorphicMixing G₁ θ₁ W₁) (hmix₂ : SharedDiffeomorphicMixing G₂ θ₂ W₂) (laws : ObservedProbabilityLawFamily n) (order : Fin n → ℕ) (hrank₁ : ∀ e v, v ∈ latentCube n → (observedLawRankCoordinate laws order e (W₁.mix v) : ℝ) = signedInterventionCDF s θ₁ (W₁.targetPerm e) (v (W₁.targetPerm e))) (hrank₂ : ∀ e v, v ∈ latentCube n → (observedLawRankCoordinate laws order e (W₂.mix v) : ℝ) = signedInterventionCDF s θ₂ (W₂.targetPerm e) (v (W₂.targetPerm e))) (x : LatentState n) (hx₁ : x ∈ observedSupport G₁ W₁) (hx₂ : x ∈ observedSupport G₂ W₂) (e : Fin n) : signedInterventionCDF s θ₁ (W₁.targetPerm e) (W₁.unmix x (W₁.targetPerm e)) = signedInterventionCDF s θ₂ (W₂.targetPerm e) (W₂.unmix x (W₂.targetPerm e)) := by have hv₁ : W₁.unmix x ∈ latentCube n := by rcases hx₁ with ⟨v, hv, rfl⟩ simpa only [hmix₁.2.2.1 v hv] using hv have hv₂ : W₂.unmix x ∈ latentCube n := by rcases hx₂ with ⟨v, hv, rfl⟩ simpa only [hmix₂.2.2.1 v hv] using hv have h₁ := hrank₁ e (W₁.unmix x) hv₁ have h₂ := hrank₂ e (W₂.unmix x) hv₂ rw [hmix₁.2.2.2 x hx₁] at h₁ rw [hmix₂.2.2.2 x hx₂] at h₂ exact h₁.symm.trans h₂
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.signedInterventionCDF_eq_of_common_rank · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRepresentation.lean:198
theorem alignedCoordinate_eq_of_common_rank

Equality of an aligned source coordinate forces equality of the competitor coordinate once both worlds realize the common law-only rank. This is the componentwise-dependence leaf of the representation argument. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
Mechanism n G₁
Mechanism n G₂
W₁ :
ObservedWorld G₁ θ₁
W₂ :
ObservedWorld G₂ θ₂
hmix₁ :
hpos₂ :
hmix₂ :
order :
Fin n → ℕ
hrank₁ :
∀ e v
if
v ∈ latentCube n
then
(observedLawRankCoordinate laws order e (W₁.mix v) : ℝ)
= signedInterventionCDF s θ₁ (W₁.targetPerm e) (v (W₁.targetPerm e))
hrank₂ :
∀ e v
if
v ∈ latentCube n
then
(observedLawRankCoordinate laws order e (W₂.mix v) : ℝ)
= signedInterventionCDF s θ₂ (W₂.targetPerm e) (v (W₂.targetPerm e))
x y :
hx₁ :
x ∈ observedSupport G₁ W₁
hx₂ :
x ∈ observedSupport G₂ W₂
hy₁ :
y ∈ observedSupport G₁ W₁
hy₂ :
y ∈ observedSupport G₂ W₂
e :
Fin n
hcoord :
W₁.unmix x (W₁.targetPerm e) = W₁.unmix y (W₁.targetPerm e)
W₂.unmix x (W₂.targetPerm e) = W₂.unmix y (W₂.targetPerm e)
Proof (Lean source)
lemma alignedCoordinate_eq_of_common_rank {n : ℕ} {G₁ G₂ : DAG (Fin n)} {s : SignVector n} {θ₁ : Mechanism n G₁} {θ₂ : Mechanism n G₂} (W₁ : ObservedWorld G₁ θ₁) (W₂ : ObservedWorld G₂ θ₂) (hmix₁ : SharedDiffeomorphicMixing G₁ θ₁ W₁) (hpos₂ : PositiveNormalizedSmoothMechanisms G₂ θ₂) (hmix₂ : SharedDiffeomorphicMixing G₂ θ₂ W₂) (laws : ObservedProbabilityLawFamily n) (order : Fin n → ℕ) (hrank₁ : ∀ e v, v ∈ latentCube n → (observedLawRankCoordinate laws order e (W₁.mix v) : ℝ) = signedInterventionCDF s θ₁ (W₁.targetPerm e) (v (W₁.targetPerm e))) (hrank₂ : ∀ e v, v ∈ latentCube n → (observedLawRankCoordinate laws order e (W₂.mix v) : ℝ) = signedInterventionCDF s θ₂ (W₂.targetPerm e) (v (W₂.targetPerm e))) (x y : LatentState n) (hx₁ : x ∈ observedSupport G₁ W₁) (hx₂ : x ∈ observedSupport G₂ W₂) (hy₁ : y ∈ observedSupport G₁ W₁) (hy₂ : y ∈ observedSupport G₂ W₂) (e : Fin n) (hcoord : W₁.unmix x (W₁.targetPerm e) = W₁.unmix y (W₁.targetPerm e)) : W₂.unmix x (W₂.targetPerm e) = W₂.unmix y (W₂.targetPerm e) := by have hsx := signedInterventionCDF_eq_of_common_rank W₁ W₂ hmix₁ hmix₂ laws order hrank₁ hrank₂ x hx₁ hx₂ e have hsy := signedInterventionCDF_eq_of_common_rank W₁ W₂ hmix₁ hmix₂ laws order hrank₁ hrank₂ y hy₁ hy₂ e apply signedInterventionCDF_injOn s θ₂ hpos₂ (W₂.targetPerm e) · rcases hx₂ with ⟨v, hv, rfl⟩ simpa only [hmix₂.2.2.1 v hv] using hv (W₂.targetPerm e) (Set.mem_univ _) · rcases hy₂ with ⟨v, hv, rfl⟩ simpa only [hmix₂.2.2.1 v hv] using hv (W₂.targetPerm e) (Set.mem_univ _) · calc signedInterventionCDF s θ₂ (W₂.targetPerm e) (W₂.unmix x (W₂.targetPerm e)) = signedInterventionCDF s θ₁ (W₁.targetPerm e) (W₁.unmix x (W₁.targetPerm e)) := hsx.symm _ = signedInterventionCDF s θ₁ (W₁.targetPerm e) (W₁.unmix y (W₁.targetPerm e)) := congrArg _ hcoord _ = signedInterventionCDF s θ₂ (W₂.targetPerm e) (W₂.unmix y (W₂.targetPerm e)) := hsy
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.alignedCoordinate_eq_of_common_rank · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRepresentation.lean:232
theorem signedInterventionCDF_eq_of_common_law_and_transitiveClosures

Once the common law-selected order is known to be topological for both latent transitive closures, the assembled equation-(11)--(12) rank formula identifies their signed scalar CDF coordinates pointwise on the common support. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ₁ :
Mechanism n G₁
θ₂ :
Mechanism n G₂
W₁ :
ObservedWorld G₁ θ₁
W₂ :
ObservedWorld G₂ θ₂
hpos₁ :
hmix₁ :
hone₁ :
hsign₁ :
hpos₂ :
hmix₂ :
hone₂ :
hsign₂ :
hlaw :
W₂.law = W₁.law
order :
Fin n → ℕ
x :
hx₁ :
x ∈ observedSupport G₁ W₁
hx₂ :
x ∈ observedSupport G₂ W₂
e :
Fin n
signedInterventionCDF s θ₁ (W₁.targetPerm e) (W₁.unmix x (W₁.targetPerm e))
= signedInterventionCDF s θ₂ (W₂.targetPerm e) (W₂.unmix x (W₂.targetPerm e))
Proof (Lean source)
lemma signedInterventionCDF_eq_of_common_law_and_transitiveClosures {n : ℕ} {G₁ G₂ : DAG (Fin n)} (s : SignVector n) {θ₁ : Mechanism n G₁} {θ₂ : Mechanism n G₂} (W₁ : ObservedWorld G₁ θ₁) (W₂ : ObservedWorld G₂ θ₂) (hpos₁ : PositiveNormalizedSmoothMechanisms G₁ θ₁) (hmix₁ : SharedDiffeomorphicMixing G₁ θ₁ W₁) (hone₁ : OnePerfectInterventionPerNode G₁ θ₁ W₁) (hsign₁ : FixedOwnDerivativeSign G₁ s θ₁) (hpos₂ : PositiveNormalizedSmoothMechanisms G₂ θ₂) (hmix₂ : SharedDiffeomorphicMixing G₂ θ₂ W₂) (hone₂ : OnePerfectInterventionPerNode G₂ θ₂ W₂) (hsign₂ : FixedOwnDerivativeSign G₂ s θ₂) (hlaw : W₂.law = W₁.law) (htc₁ : TransGen (observedLawRatioGraph gaussianFeatureMap W₁.law) = TransGen (permutedGraph G₁ W₁)) (htc₂ : TransGen (observedLawRatioGraph gaussianFeatureMap W₂.law) = TransGen (permutedGraph G₂ W₂)) (order : Fin n → ℕ) (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W₁.law) order) (x : LatentState n) (hx₁ : x ∈ observedSupport G₁ W₁) (hx₂ : x ∈ observedSupport G₂ W₂) (e : Fin n) : signedInterventionCDF s θ₁ (W₁.targetPerm e) (W₁.unmix x (W₁.targetPerm e)) = signedInterventionCDF s θ₂ (W₂.targetPerm e) (W₂.unmix x (W₂.targetPerm e)) := by let laws := observedProbabilityLawFamily W₁.law have horder₂ : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W₂.law) order := by simpa only [hlaw] using horder apply signedInterventionCDF_eq_of_common_rank W₁ W₂ hmix₁ hmix₂ laws order (fun e v hv ↦ ?_) (fun e v hv ↦ ?_) x hx₁ hx₂ e · simpa only [laws, signedInterventionCDF] using (exactRatioDecoder_continuousRankClauses s W₁ hpos₁ hmix₁ hone₁ hsign₁ htc₁ order horder e).2.2.2.2 v hv · simpa only [laws, hlaw, signedInterventionCDF] using (exactRatioDecoder_continuousRankClauses s W₂ hpos₂ hmix₂ hone₂ hsign₂ htc₂ order horder₂ e).2.2.2.2 v hv
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.signedInterventionCDF_eq_of_common_law_and_transitiveClosures · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderRepresentation.lean:276
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.DecoderSupport 5 declarations This file proves that every predecessor-score vector produced by a latent cube point lies in the support of its observed interventional predecessor law.

Realized predecessor-score support

This file proves that every predecessor-score vector produced by a latent cube point lies in the support of its observed interventional predecessor law. It is the support bridge needed to turn continuous-version uniqueness into the pointwise equation-(11) identity.

theorem observedInterventionalLaw_support_eq_observedSupport

Every supplied observed single-target intervention law has the full observed model support, because its latent density is strictly positive on the full cube. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
Measure.support (W.law e.succ) = observedSupport G W
Proof (Lean source)
lemma observedInterventionalLaw_support_eq_observedSupport {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (e : Fin n) : Measure.support (W.law e.succ) = observedSupport G W := by let μ := interventionalLaw θ (W.targetPerm e) have hcube_compact : IsCompact (latentCube n) := by rw [latentCube] exact isCompact_univ_pi fun _ => isCompact_Icc have hsupport_closed : IsClosed (observedSupport G W) := (hcube_compact.image_of_continuousOn hmix.1.continuousOn).isClosed have hμ_cube : ∀ᵐ v ∂μ, v ∈ latentCube n := by filter_upwards [Measure.support_mem_ae (μ := μ)] with v hv simpa [μ, interventionalLaw_support_eq_latentCube W hpos e] using hv have hcube_meas : MeasurableSet (latentCube n) := by rw [latentCube] exact MeasurableSet.pi Set.countable_univ (fun _ _ => measurableSet_Icc) have hmixAE : AEMeasurable W.mix μ := aemeasurable_of_supportMeasurableOn hcube_meas (ae_iff.mp hμ_cube) hmix.1.continuousOn.domRestrict.measurable have hfull : W.law e.succ (observedSupport G W)ᶜ = 0 := by rw [hone.2.1 e, Measure.map_apply_of_aemeasurable hmixAE hsupport_closed.isOpen_compl.measurableSet] apply measure_mono_null (t := (latentCube n)ᶜ) · intro v hv hvcube exact hv ⟨v, hvcube, rfl⟩ · exact ae_iff.mp hμ_cube apply Set.Subset.antisymm · exact Measure.support_subset_of_isClosed hsupport_closed (ae_iff.mpr hfull) · rintro x ⟨v, hv, rfl⟩ rw [Measure.mem_support_iff_forall] intro U hU rcases mem_nhds_iff.mp hU with ⟨O, hOU, hOopen, hmixO⟩ rw [hone.2.1 e] apply lt_of_lt_of_le _ (measure_mono hOU) rw [Measure.map_apply_of_aemeasurable hmixAE hOopen.measurableSet] have hpre : W.mix ⁻¹' O ∈ nhdsWithin v (latentCube n) := (hmix.1.continuousOn v hv) (hOopen.mem_nhds hmixO) rcases mem_nhdsWithin_iff_exists_mem_nhds_inter.mp hpre with ⟨V, hV, hVsub⟩ have hVpos : 0 < μ V := (Measure.mem_support_iff_forall v).mp ((interventionalLaw_support_eq_latentCube W hpos e).symm.subset hv) V hV rw [← Measure.measure_inter_eq_of_ae hμ_cube] at hVpos exact hVpos.trans_le (measure_mono (by simpa [inter_comm] using hVsub))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedInterventionalLaw_support_eq_observedSupport · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderSupport.lean:21
theorem continuousOn_observedLawLogRatio_observedSupport

The law-selected log ratio is continuous on the common observed support. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
Proof (Lean source)
lemma continuousOn_observedLawLogRatio_observedSupport {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (i : Fin n) : ContinuousOn (observedLawLogRatio W.law i) (observedSupport G W) := by have hex := exists_continuousObservedRatioVersion W hpos hmix hone i have hselected := observedContinuousRatio_isVersion W.law i hex have hsmooth := smoothObservedRatio_isVersion W hpos hmix hone i have heq := hselected.eqOn hsmooth rw [← observedLaw_support_eq_observedSupport W hpos hmix hone] apply ContinuousOn.log hselected.2 intro x hx rw [heq hx] rw [observedLaw_support_eq_observedSupport W hpos hmix hone] at hx rcases hx with ⟨v, hv, rfl⟩ rw [smoothObservedRatio, hmix.2.2.1 v hv] exact div_ne_zero (ne_of_gt (hpos.2.1 _ _ (hv _ (Set.mem_univ _)))) (ne_of_gt (hpos.1 _ _ hv))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuousOn_observedLawLogRatio_observedSupport · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderSupport.lean:71
theorem continuousOn_predecessorLogRatioProjection_observedSupport

The vector of predecessor log ratios is continuous on the common observed support. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
i :
Fin n
Proof (Lean source)
lemma continuousOn_predecessorLogRatioProjection_observedSupport {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (order : Fin n → ℕ) (i : Fin n) : ContinuousOn (familyProjection (observedLawLogRatio W.law) (predecessorSet order i)) (observedSupport G W) := by rw [continuousOn_pi] intro j exact continuousOn_observedLawLogRatio_observedSupport W hpos hmix hone j
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuousOn_predecessorLogRatioProjection_observedSupport · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderSupport.lean:94
theorem continuousOn_map_mem_support Lemma continuousOn_map_mem_support in the paper ↗

A function continuous on the support of a measure sends support points into the support of its pushforward. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
hf :
hcont :
ContinuousOn f (Measure.support μ)
x :
X
hx :
x ∈ Measure.support μ
f x ∈ Measure.support (Measure.map f μ)
Proof (Lean source)
lemma continuousOn_map_mem_support {X Y : Type*} [TopologicalSpace X] [MeasurableSpace X] [HereditarilyLindelofSpace X] [TopologicalSpace Y] [MeasurableSpace Y] [BorelSpace Y] {μ : Measure X} {f : X → Y} (hf : AEMeasurable f μ) (hcont : ContinuousOn f (Measure.support μ)) {x : X} (hx : x ∈ Measure.support μ) : f x ∈ Measure.support (Measure.map f μ) := by rw [Measure.mem_support_iff_forall] intro U hU rcases mem_nhds_iff.mp hU with ⟨O, hOU, hOopen, hfxO⟩ apply lt_of_lt_of_le _ (measure_mono hOU) rw [Measure.map_apply_of_aemeasurable hf hOopen.measurableSet] have hpre : f ⁻¹' O ∈ nhdsWithin x (Measure.support μ) := (hcont x hx) (hOopen.mem_nhds hfxO) rcases mem_nhdsWithin_iff_exists_mem_nhds_inter.mp hpre with ⟨V, hV, hVsub⟩ have hVpos : 0 < μ V := (Measure.mem_support_iff_forall x).mp hx V hV rw [← Measure.measure_inter_eq_of_ae (Measure.support_mem_ae (μ := μ))] at hVpos exact hVpos.trans_le (measure_mono (fun y hy => hVsub ⟨hy.2, hy.1⟩))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuousOn_map_mem_support · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderSupport.lean:110
theorem observedPredecessorLogRatio_mem_support

Every predecessor-score vector realized by a latent cube point belongs to the support of the observed predecessor law under the current intervention. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
i :
Fin n
v :
hv :
v ∈ latentCube n
familyProjection (observedLawLogRatio W.law) (predecessorSet order i) (W.mix v) ∈ Measure.support (Measure.map (familyProjection (observedLawLogRatio W.law) (predecessorSet order i)) (W.law i.succ))
Proof (Lean source)
lemma observedPredecessorLogRatio_mem_support {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) {order : Fin n → ℕ} (i : Fin n) (v : LatentState n) (hv : v ∈ latentCube n) : familyProjection (observedLawLogRatio W.law) (predecessorSet order i) (W.mix v) ∈ Measure.support (Measure.map (familyProjection (observedLawLogRatio W.law) (predecessorSet order i)) (W.law i.succ)) := by let pred := familyProjection (observedLawLogRatio W.law) (predecessorSet order i) have hpred : Measurable pred := by dsimp only [pred, familyProjection] apply measurable_pi_lambda intro j exact measurable_observedLawLogRatio W.law j have hx : W.mix v ∈ Measure.support (W.law i.succ) := by rw [observedInterventionalLaw_support_eq_observedSupport W hpos hmix hone i] exact ⟨v, hv, rfl⟩ apply continuousOn_map_mem_support (μ := W.law i.succ) (f := pred) hpred.aemeasurable (show ContinuousOn pred (Measure.support (W.law i.succ)) by rw [observedInterventionalLaw_support_eq_observedSupport W hpos hmix hone i] exact continuousOn_predecessorLogRatioProjection_observedSupport W hpos hmix hone order i) hx
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedPredecessorLogRatio_mem_support · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderSupport.lean:132
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.DecoderTriangularInverse 12 declarations This file packages equations (7)--(9): predecessor latent coordinates form a compact cube, their triangular log-ratio score map is a continuous injection, and hence it has a continuous inverse on its image.

Compact triangular predecessor-score inverse

This file packages equations (7)--(9): predecessor latent coordinates form a compact cube, their triangular log-ratio score map is a continuous injection, and hence it has a continuous inverse on its image.

The compact product cube of latent coordinates indexed by predecessors of i.

Definition (Lean source)
n :
order :
Fin n → ℕ
i :
Fin n
PredecessorLatentCube order i :
Type
(j : {j // j ∈ predecessorSet order i}) → Icc (0 : ℝ) 1
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.PredecessorLatentCube · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderTriangularInverse.lean:19
def predecessorCubeLatentState

Embed predecessor coordinates into the full latent cube, filling nonpredecessors with zero.

Definition (Lean source)
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
i :
Fin n
z :
predecessorCubeLatentState W order i z :
fun k
=> if h : W.targetPerm.symm k ∈ predecessorSet order i then z ⟨W.targetPerm.symm k, h⟩ else 0
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.predecessorCubeLatentState · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderTriangularInverse.lean:24
def predecessorLatentCubeOfState

Restrict a latent cube point to the coordinates indexed by decoder predecessors.

Definition (Lean source)
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
i :
Fin n
v :
hv :
v ∈ latentCube n
predecessorLatentCubeOfState W order i v hv :
fun j => ⟨v (W.targetPerm j), hv _ (Set.mem_univ _)⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.predecessorLatentCubeOfState · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderTriangularInverse.lean:33
theorem predecessorCubeLatentState_ofState_apply

Embedding the predecessor restriction back into the ambient cube preserves every predecessor coordinate. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
i :
Fin n
v :
hv :
v ∈ latentCube n
j :
Fin n
hj :
j ∈ predecessorSet order i
predecessorCubeLatentState W order i (predecessorLatentCubeOfState W order i v hv) (W.targetPerm j)
= v (W.targetPerm j)
Proof (Lean source)
lemma predecessorCubeLatentState_ofState_apply {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (order : Fin n → ℕ) (i : Fin n) (v : LatentState n) (hv : v ∈ latentCube n) (j : Fin n) (hj : j ∈ predecessorSet order i) : predecessorCubeLatentState W order i (predecessorLatentCubeOfState W order i v hv) (W.targetPerm j) = v (W.targetPerm j) := by simp [predecessorCubeLatentState, predecessorLatentCubeOfState, hj]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.predecessorCubeLatentState_ofState_apply · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderTriangularInverse.lean:41
def predecessorScoreMap

The triangular predecessor log-ratio map, written directly in latent coordinates.

Definition (Lean source)
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
i :
Fin n
z :
predecessorScoreMap W order i z :
fun j
=> log (θ.q (W.targetPerm j) ((predecessorCubeLatentState W order i z) (W.targetPerm j)) / θ.p (W.targetPerm j) (predecessorCubeLatentState W order i z))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.predecessorScoreMap · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderTriangularInverse.lean:54
theorem predecessorCubeLatentState_mem_latentCube

The zero-filled predecessor-coordinate embedding always lies in the full latent cube. the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
i :
Fin n
z :
Proof (Lean source)
lemma predecessorCubeLatentState_mem_latentCube {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (order : Fin n → ℕ) (i : Fin n) (z : PredecessorLatentCube order i) : predecessorCubeLatentState W order i z ∈ latentCube n := by intro k hk simp only [predecessorCubeLatentState] split · exact (z _).property · exact ⟨by norm_num, by norm_num⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.predecessorCubeLatentState_mem_latentCube · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderTriangularInverse.lean:65
theorem predecessorScoreMap_of_latentState

On a latent cube point, the compact triangular score map is exactly the observed predecessor log-ratio projection pulled back through the mixing map. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
hgraphOrder :
i :
Fin n
v :
hv :
v ∈ latentCube n
Proof (Lean source)
lemma predecessorScoreMap_of_latentState {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) {order : Fin n → ℕ} (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) (i : Fin n) (v : LatentState n) (hv : v ∈ latentCube n) : predecessorScoreMap W order i (predecessorLatentCubeOfState W order i v hv) = familyProjection (observedLawLogRatio W.law) (predecessorSet order i) (W.mix v) := by funext j unfold familyProjection rw [observedLawLogRatio_comp_mix_eq W hpos hmix hone j v hv] unfold predecessorScoreMap congr 2 · exact congrArg (θ.q (W.targetPerm j)) (predecessorCubeLatentState_ofState_apply W order i v hv j j.property) · apply θ.parent_local (W.targetPerm j) · exact predecessorCubeLatentState_ofState_apply W order i v hv j j.property · intro a ha let k := W.targetPerm.symm a have hkParent : k ∈ environmentParentSet W j := by simpa [k, environmentParentSet, parents] using ha have hkBeforeJ := environmentParentSet_subset_predecessorSet_of_transitiveClosure W horder hgraphOrder j hkParent have hjBeforeI : order j < order i := by simpa [predecessorSet] using j.property have hkBeforeI : k ∈ predecessorSet order i := by simpa [predecessorSet] using (show order k < order i from (by simpa [predecessorSet] using hkBeforeJ : order k < order j).trans hjBeforeI) simpa [k] using predecessorCubeLatentState_ofState_apply W order i v hv k hkBeforeI
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.predecessorScoreMap_of_latentState · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderTriangularInverse.lean:78
theorem observedPredecessorLogRatio_mem_scoreRange

Every predecessor log-ratio vector realized by a latent cube point belongs to the image of the compact triangular predecessor-score map. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
hgraphOrder :
i :
Fin n
v :
hv :
v ∈ latentCube n
Proof (Lean source)
lemma observedPredecessorLogRatio_mem_scoreRange {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) {order : Fin n → ℕ} (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) (i : Fin n) (v : LatentState n) (hv : v ∈ latentCube n) : familyProjection (observedLawLogRatio W.law) (predecessorSet order i) (W.mix v) ∈ range (predecessorScoreMap W order i) := by refine ⟨predecessorLatentCubeOfState W order i v hv, ?_⟩ exact predecessorScoreMap_of_latentState W hpos hmix hone horder hgraphOrder i v hv
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedPredecessorLogRatio_mem_scoreRange · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderTriangularInverse.lean:117
theorem continuous_predecessorScoreMap

Smooth positive mechanisms make the triangular predecessor score map continuous. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
order :
Fin n → ℕ
i :
Fin n
Proof (Lean source)
lemma continuous_predecessorScoreMap {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (order : Fin n → ℕ) (i : Fin n) : Continuous (predecessorScoreMap W order i) := by have hlatent : Continuous (predecessorCubeLatentState W order i) := by apply continuous_pi intro k simp only [predecessorCubeLatentState] split <;> fun_prop apply continuous_pi intro j have hcoord : ∀ z, predecessorCubeLatentState W order i z (W.targetPerm j) ∈ Icc (0 : ℝ) 1 := by intro z simpa only [predecessorCubeLatentState, Equiv.symm_apply_apply, dif_pos j.property] using (z j).property have hpne : ∀ z, θ.p (W.targetPerm j) (predecessorCubeLatentState W order i z) ≠ 0 := fun z => ne_of_gt (hpos.1 _ _ (predecessorCubeLatentState_mem_latentCube W order i z)) have hqne : ∀ z, θ.q (W.targetPerm j) (predecessorCubeLatentState W order i z (W.targetPerm j)) ≠ 0 := fun z => ne_of_gt (hpos.2.1 _ _ (hcoord z)) apply Continuous.log _ (fun z => div_ne_zero (hqne z) (hpne z)) apply Continuous.div _ _ hpne · exact (hpos.2.2.2.1 (W.targetPerm j)).continuousOn.comp_continuous (continuous_apply (W.targetPerm j) |>.comp hlatent) hcoord · exact (hpos.2.2.1 (W.targetPerm j)).continuousOn.comp_continuous hlatent (predecessorCubeLatentState_mem_latentCube W order i)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuous_predecessorScoreMap · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderTriangularInverse.lean:135
theorem predecessorScoreMap_injective

The prescribed own-score signs make the triangular predecessor score map injective. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ :
W :
hsign :
order :
Fin n → ℕ
hgraphOrder :
i :
Fin n
Proof (Lean source)
lemma predecessorScoreMap_injective {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (hsign : FixedOwnDerivativeSign G s θ) {order : Fin n → ℕ} (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) (i : Fin n) : Injective (predecessorScoreMap W order i) := by intro z w heq let vz := predecessorCubeLatentState W order i z let vw := predecessorCubeLatentState W order i w have hvz : vz ∈ latentCube n := predecessorCubeLatentState_mem_latentCube W order i z have hvw : vw ∈ latentCube n := predecessorCubeLatentState_mem_latentCube W order i w have heq' : familyProjection (observedLawLogRatio W.law) (predecessorSet order i) (W.mix vz) = familyProjection (observedLawLogRatio W.law) (predecessorSet order i) (W.mix vw) := by funext j simp only [familyProjection] rw [observedLawLogRatio_comp_mix_eq W hpos hmix hone j vz hvz, observedLawLogRatio_comp_mix_eq W hpos hmix hone j vw hvw] exact congrFun heq j have hcoords := predecessorLogRatioProjection_injective_on_predecessors s W hpos hmix hone hsign horder hgraphOrder i hvz hvw heq' funext j apply Subtype.ext simpa only [vz, vw, predecessorCubeLatentState, Equiv.symm_apply_apply, dif_pos j.property] using hcoords j j.property
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.predecessorScoreMap_injective · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderTriangularInverse.lean:166
def predecessorScoreHomeomorph Lemma 3 in the paper ↗

The compact triangular predecessor score map is a homeomorphism onto its image.

Definition (Lean source)
n :
DAG (Fin n)
s :
θ :
W :
hsign :
order :
Fin n → ℕ
hgraphOrder :
i :
Fin n
predecessorScoreHomeomorph s W hpos hmix hone hsign horder hgraphOrder i :
((continuous_predecessorScoreMap W hpos order i).isClosedEmbedding (predecessorScoreMap_injective s W hpos hmix hone hsign horder hgraphOrder i)).isEmbedding |>.toHomeomorph
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.predecessorScoreHomeomorph · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderTriangularInverse.lean:199
theorem continuous_predecessorScoreInverse

The inverse predecessor-coordinate reconstruction is continuous on the score image. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ :
W :
hsign :
order :
Fin n → ℕ
hgraphOrder :
i :
Fin n
Continuous (predecessorScoreHomeomorph s W hpos hmix hone hsign horder hgraphOrder i).symm
Proof (Lean source)
lemma continuous_predecessorScoreInverse {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (hsign : FixedOwnDerivativeSign G s θ) {order : Fin n → ℕ} (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order) (hgraphOrder : PermutedGraphOrdered W order) (i : Fin n) : Continuous (predecessorScoreHomeomorph s W hpos hmix hone hsign horder hgraphOrder i).symm := (predecessorScoreHomeomorph s W hpos hmix hone hsign horder hgraphOrder i).symm.continuous
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuous_predecessorScoreInverse · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/DecoderTriangularInverse.lean:217
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.FiniteDensityBridge 13 declarations This file records the model-specific identification needed to instantiate the general finite-DAG nonancestor marginal theorem with the paper's observed laws.

Finite-density bridge for observed ratio laws

This file records the model-specific identification needed to instantiate the general finite-DAG nonancestor marginal theorem with the paper's observed laws.

structure FiniteDensityObservedWorldBridge

A paper mechanism and observed world are represented by the reusable unit-cube factorization, including identification of the canonical observed ratio pushforwards.

Definition (Lean source)
n :
DAG (Fin n)
W :
factorization :
intervention :
∀ e : Fin n,
InterventionDensity (W.targetPerm e) (fun _ : Fin n => ℝ) (fun _ : Fin n => unitIntervalReference)
numerator :
Fin n → ℝ → ℝ≥0∞
ratio_measurable :
∀ i,
Measurable (fun v : LatentState n => numerator i (v (W.targetPerm i)) / factorization.factor (W.targetPerm i) v)
observational_identification :
∀ i,
= Measure.map (fun v : LatentState n => (numerator i (v (W.targetPerm i)) / factorization.factor (W.targetPerm i) v).toReal) factorization.observationalMeasure
interventional_identification :
∀ j i,
= Measure.map (fun v : LatentState n => (numerator i (v (W.targetPerm i)) / factorization.factor (W.targetPerm i) v).toReal) (factorization.interventionMeasure (W.targetPerm j) (intervention j))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.FiniteDensityObservedWorldBridge · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/FiniteDensityBridge.lean:22
def mechanismUnitCubeFactorization

A positive normalized smooth latent mechanism determines the reusable unit-cube factorization of its observational conditional densities.

Definition (Lean source)
mechanismUnitCubeFactorization hpos :
by apply unitCubeFactorizationOfRealCubeFactors θ.p · apply measurableOnSet_of_continuousOn_cube intro i exact (hpos.2.2.1 i).continuousOn · intro i v hv exact (hpos.1 i v hv).le · intro i v w hv hw hvw apply θ.parent_local i v w · exact hvw i (mem_insert_self i (G.parents i)) · intro k hk exact hvw k (mem_insert_of_mem hk) · exact hpos.2.2.2.2.1
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.mechanismUnitCubeFactorization · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/FiniteDensityBridge.lean:52
def mechanismInterventionDensity

A positive normalized smooth latent mechanism and observed target permutation determine the reusable unit-cube intervention density for an environment.

Definition (Lean source)
n :
DAG (Fin n)
W :
e :
Fin n
mechanismInterventionDensity W hpos e :
InterventionDensity (W.targetPerm e) (fun _ : Fin n => ℝ) (fun _ : Fin n => unitIntervalReference)
by apply interventionDensityOfRealCube (W.targetPerm e) (θ.q (W.targetPerm e)) · exact (hpos.2.2.2.1 (W.targetPerm e)).continuousOn.domRestrict.measurable · intro x hx exact (hpos.2.1 (W.targetPerm e) x hx).le · exact hpos.2.2.2.2.2 (W.targetPerm e)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.mechanismInterventionDensity · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/FiniteDensityBridge.lean:71
theorem mechanismUnitCubeFactorization_observationalMeasure

A positive normalized smooth mechanism has the same observational law as the observational measure of its clamped unit-cube factorization.

Formal statement
(mechanismUnitCubeFactorization hpos).observationalMeasure = observationalLaw θ
Proof (Lean source)
theorem mechanismUnitCubeFactorization_observationalMeasure {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (hpos : PositiveNormalizedSmoothMechanisms G θ) : (mechanismUnitCubeFactorization hpos).observationalMeasure = observationalLaw θ := by -- Unfold the paper law after applying the substrate's real cube-product identification. change (mechanismUnitCubeFactorization hpos).observationalMeasure = realCubeProductDensityMeasure θ.p simpa only [mechanismUnitCubeFactorization, latentCube] using observationalMeasure_unitCubeFactorizationOfRealCubeFactors θ.p (measurableOnSet_of_continuousOn_cube θ.p (fun i => (hpos.2.2.1 i).continuousOn)) (fun i v hv => (hpos.1 i v hv).le) (fun i v w _ _ hvw => θ.parent_local i v w (hvw i (mem_insert_self _ _)) (fun k hk => hvw k (mem_insert_of_mem hk))) hpos.2.2.2.2.1
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.mechanismUnitCubeFactorization_observationalMeasure · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/FiniteDensityBridge.lean:86
theorem mechanismUnitCubeFactorization_interventionMeasure

A positive normalized smooth mechanism has the same target-intervention law as the intervention measure of its clamped unit-cube factorization.

Formal statement
n :
DAG (Fin n)
W :
e :
Fin n
Proof (Lean source)
theorem mechanismUnitCubeFactorization_interventionMeasure {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (e : Fin n) : (mechanismUnitCubeFactorization hpos).interventionMeasure (W.targetPerm e) (mechanismInterventionDensity W hpos e) = interventionalLaw θ (W.targetPerm e) := by -- Unfold the paper law after applying the substrate's real cube-intervention identification. change (mechanismUnitCubeFactorization hpos).interventionMeasure (W.targetPerm e) (mechanismInterventionDensity W hpos e) = realCubeInterventionDensityMeasure θ.p (W.targetPerm e) (θ.q (W.targetPerm e)) simpa only [mechanismUnitCubeFactorization, mechanismInterventionDensity, latentCube] using interventionMeasure_unitCubeFactorizationOfRealCubeFactors θ.p (measurableOnSet_of_continuousOn_cube θ.p (fun i => (hpos.2.2.1 i).continuousOn)) (fun i v hv => (hpos.1 i v hv).le) (fun i v w _ _ hvw => θ.parent_local i v w (hvw i (mem_insert_self _ _)) (fun k hk => hvw k (mem_insert_of_mem hk))) hpos.2.2.2.2.1 (W.targetPerm e) (θ.q (W.targetPerm e)) ((hpos.2.2.2.1 (W.targetPerm e)).continuousOn.domRestrict.measurable) (fun x hx => (hpos.2.1 (W.targetPerm e) x hx).le) (hpos.2.2.2.2.2 (W.targetPerm e))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.mechanismUnitCubeFactorization_interventionMeasure · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/FiniteDensityBridge.lean:105
def mechanismRatioNumerator

The positive normalized smooth mechanism and environment target determine the globally measurable clamped numerator used in the canonical target ratio.

Definition (Lean source)
n :
DAG (Fin n)
W :
e :
Fin n
mechanismRatioNumerator W hpos e :
ℝ → ℝ≥0∞
(mechanismInterventionDensity W hpos e).density
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.mechanismRatioNumerator · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/FiniteDensityBridge.lean:130
theorem mechanismTargetRatio_toReal_eq

On the latent unit cube, the real value of the clamped factor ratio is the paper's ordinary replacement-to-observational density ratio. With the stated inputs and conditions, the documented conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
e :
Fin n
v :
hv :
v ∈ latentCube n
(mechanismRatioNumerator W hpos e (v (W.targetPerm e)) / (mechanismUnitCubeFactorization hpos).factor (W.targetPerm e) v).toReal
= θ.q (W.targetPerm e) (v (W.targetPerm e)) / θ.p (W.targetPerm e) v
Proof (Lean source)
theorem mechanismTargetRatio_toReal_eq {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (e : Fin n) {v : LatentState n} (hv : v ∈ latentCube n) : (mechanismRatioNumerator W hpos e (v (W.targetPerm e)) / (mechanismUnitCubeFactorization hpos).factor (W.targetPerm e) v).toReal = θ.q (W.targetPerm e) (v (W.targetPerm e)) / θ.p (W.targetPerm e) v := by -- Both clamped extensions are unchanged on the cube; positivity removes `ofReal` truncation. have hj := hv (W.targetPerm e) (Set.mem_univ _) have hnum : mechanismRatioNumerator W hpos e (v (W.targetPerm e)) = ofReal (θ.q (W.targetPerm e) (v (W.targetPerm e))) := by simp [mechanismRatioNumerator, mechanismInterventionDensity, interventionDensityOfRealCube, interventionDensityOfCube, min_eq_right hj.2, max_eq_right hj.1] have hden : (mechanismUnitCubeFactorization hpos).factor (W.targetPerm e) v = ofReal (θ.p (W.targetPerm e) v) := by simpa only [mechanismUnitCubeFactorization, latentCube] using unitCubeFactorizationOfRealCubeFactors_factor_eq θ.p (measurableOnSet_of_continuousOn_cube θ.p (fun i => (hpos.2.2.1 i).continuousOn)) (fun i w hw => (hpos.1 i w hw).le) (fun i x y _ _ hxy => θ.parent_local i x y (hxy i (mem_insert_self _ _)) (fun k hk => hxy k (mem_insert_of_mem hk))) hpos.2.2.2.2.1 (W.targetPerm e) hv rw [hnum, hden, ENNReal.toReal_div, ENNReal.toReal_ofReal (hpos.2.1 _ _ hj).le, ENNReal.toReal_ofReal (hpos.1 _ _ hv).le]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.mechanismTargetRatio_toReal_eq · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/FiniteDensityBridge.lean:138
theorem measurable_mechanismTargetRatio

The clamped target ratio is globally measurable.

Formal statement
n :
DAG (Fin n)
W :
e :
Fin n
Measurable (fun v : LatentState n => mechanismRatioNumerator W hpos e (v (W.targetPerm e)) / (mechanismUnitCubeFactorization hpos).factor (W.targetPerm e) v)
Proof (Lean source)
theorem measurable_mechanismTargetRatio {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (e : Fin n) : Measurable (fun v : LatentState n => mechanismRatioNumerator W hpos e (v (W.targetPerm e)) / (mechanismUnitCubeFactorization hpos).factor (W.targetPerm e) v) := by exact ((mechanismInterventionDensity W hpos e).measurable_density.comp (measurable_pi_apply (W.targetPerm e))).div ((mechanismUnitCubeFactorization hpos).measurable_factor (W.targetPerm e))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.measurable_mechanismTargetRatio · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/FiniteDensityBridge.lean:169
theorem interventionalLaw_absolutelyContinuous_observational

Every positive single-target latent intervention law is absolutely continuous with respect to the corresponding observational latent law. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
e :
Fin n
interventionalLaw θ (W.targetPerm e) ≪ observationalLaw θ
Proof (Lean source)
lemma interventionalLaw_absolutelyContinuous_observational {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (e : Fin n) : interventionalLaw θ (W.targetPerm e) ≪ observationalLaw θ := by letI : SigmaFinite unitIntervalReference := by unfold unitIntervalReference infer_instance let B := mechanismUnitCubeFactorization hpos let q := mechanismInterventionDensity W hpos e let μ := unitCubeReference (Fin n) have hfactor_pos : ∀ i v, 0 < B.factor i v := by intro i v change 0 < ofReal (θ.p i (clampCube (Fin n) v)) rw [ENNReal.ofReal_pos] exact hpos.1 i _ (by simpa only [latentCube, unitCube] using clampCube_mem (Fin n) v) have hμ_obs : μ ≪ B.observationalMeasure := by rw [observationalMeasure] apply withDensity_absolutelyContinuous' B.measurable_observationalDensity.aemeasurable filter_upwards with v unfold observationalDensity partialDensity exact Finset.prod_ne_zero_iff.mpr (fun i _ => (hfactor_pos i v).ne') have hint_μ : B.interventionMeasure (W.targetPerm e) q ≪ μ := by rw [interventionMeasure] exact withDensity_absolutelyContinuous _ _ simpa only [B, q, mechanismUnitCubeFactorization_interventionMeasure W hpos e, mechanismUnitCubeFactorization_observationalMeasure hpos] using hint_μ.trans hμ_obs
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.interventionalLaw_absolutelyContinuous_observational · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/FiniteDensityBridge.lean:180
theorem observedInterventional_absolutelyContinuous_observational

Under positive latent densities, support-local shared mixing, and the supplied pushforward laws, every observed single-target intervention law is absolutely continuous with respect to the observed observational law.

Formal statement
W.law e.succ ≪ W.law 0
Proof (Lean source)
theorem observedInterventional_absolutelyContinuous_observational {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (e : Fin n) : W.law e.succ ≪ W.law 0 := by -- First compare both cube-restricted densities to the common restricted-volume reference, -- then transport absolute continuity through the map using its a.e. measurability on the cube. let B := mechanismUnitCubeFactorization hpos let q := mechanismInterventionDensity W hpos e let μ := unitCubeReference (Fin n) have hfactor_pos : ∀ i v, 0 < B.factor i v := by intro i v change 0 < ofReal (θ.p i (clampCube (Fin n) v)) rw [ENNReal.ofReal_pos] exact hpos.1 i _ (by simpa only [latentCube, unitCube] using clampCube_mem (Fin n) v) have hmeas_obs : Measurable B.observationalDensity := by unfold observationalDensity partialDensity exact Finset.measurable_prod univ (fun i _ => B.measurable_factor i) have hμ_obs : μ ≪ B.observationalMeasure := by rw [observationalMeasure] apply withDensity_absolutelyContinuous' hmeas_obs.aemeasurable filter_upwards with v change (∏ i ∈ univ, B.factor i v) ≠ 0 exact Finset.prod_ne_zero_iff.mpr (fun i _ => (hfactor_pos i v).ne') have hint_μ : B.interventionMeasure (W.targetPerm e) q ≪ μ := by rw [interventionMeasure] exact withDensity_absolutelyContinuous _ _ have hlatentB : B.interventionMeasure (W.targetPerm e) q ≪ B.observationalMeasure := hint_μ.trans hμ_obs have hlatent : interventionalLaw θ (W.targetPerm e) ≪ observationalLaw θ := by simpa only [B, q, mechanismUnitCubeFactorization_interventionMeasure W hpos e, mechanismUnitCubeFactorization_observationalMeasure hpos] using hlatentB have hcube : MeasurableSet (latentCube n) := by rw [latentCube] exact MeasurableSet.pi Set.countable_univ (fun _ _ => measurableSet_Icc) have hμ_cube : μ (latentCube n)ᶜ = 0 := by simpa only [μ, latentCube, unitCube] using unitCubeReference_compl (Fin n) have hobs_μ : observationalLaw θ ≪ μ := by rw [← mechanismUnitCubeFactorization_observationalMeasure hpos] exact withDensity_absolutelyContinuous _ _ have hobs_cube : observationalLaw θ (latentCube n)ᶜ = 0 := hobs_μ hμ_cube have hmixOn : SupportMeasurableOn W.mix (latentCube n) := hmix.1.continuousOn.domRestrict.measurable have hmixAE : AEMeasurable W.mix (observationalLaw θ) := aemeasurable_of_supportMeasurableOn hcube hobs_cube hmixOn let mix' := hmixAE.mk W.mix have hmix_eq_obs : W.mix =ᵐ[observationalLaw θ] mix' := hmixAE.ae_eq_mk have hmix_eq_int : W.mix =ᵐ[interventionalLaw θ (W.targetPerm e)] mix' := hlatent.ae_eq hmix_eq_obs have hmap : Measure.map mix' (interventionalLaw θ (W.targetPerm e)) ≪ Measure.map mix' (observationalLaw θ) := @Measure.AbsolutelyContinuous.map _ _ _ _ _ _ hlatent mix' hmixAE.measurable_mk rw [hone.2.1 e, hone.1] calc Measure.map W.mix (interventionalLaw θ (W.targetPerm e)) = Measure.map mix' (interventionalLaw θ (W.targetPerm e)) := Measure.map_congr hmix_eq_int _ ≪ Measure.map mix' (observationalLaw θ) := hmap _ = Measure.map W.mix (observationalLaw θ) := (Measure.map_congr hmix_eq_obs).symm
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedInterventional_absolutelyContinuous_observational · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/FiniteDensityBridge.lean:212
def finiteDensityObservedWorldBridge_of_assumptions

The [primitive smooth-mechanism, support-local mixing, and observed-law hypotheses] (hyp:hpos,hmix,hone) construct the paper's finite-density observed-world bridge.

Definition (Lean source)
finiteDensityObservedWorldBridge_of_assumptions W hpos hmix hone :
clause 1
factorization := mechanismUnitCubeFactorization hpos
clause 2
intervention := mechanismInterventionDensity W hpos
clause 3
numerator := mechanismRatioNumerator W hpos
clause 4
ratio_measurable := measurable_mechanismTargetRatio W hpos
clause 5
observational_identification := by intro i let μ := unitCubeReference (Fin n) have hcube : MeasurableSet (latentCube n) := by rw [latentCube] exact MeasurableSet.pi Set.countable_univ (fun _ _ => measurableSet_Icc) have hμ_cube : μ (latentCube n)ᶜ
= 0 := by simpa only [μ, latentCube, unitCube] using unitCubeReference_compl (Fin n) have hobs_μ : observationalLaw θ ≪ μ := by rw [← mechanismUnitCubeFactorization_observationalMeasure hpos] exact withDensity_absolutelyContinuous _ _ have hobs_cube : observationalLaw θ (latentCube n)ᶜ = 0 := hobs_μ hμ_cube have hmixOn : SupportMeasurableOn W.mix (latentCube n) := hmix.1.continuousOn.domRestrict.measurable have hmixAE : AEMeasurable W.mix (observationalLaw θ) := aemeasurable_of_supportMeasurableOn hcube hobs_cube hmixOn let mix' := hmixAE.mk W.mix have hmix_eq : W.mix =ᵐ[observationalLaw θ] mix' := hmixAE.ae_eq_mk have htend : Tendsto W.mix (ae (observationalLaw θ)) (ae (W.law 0)) := by have hrep := (hmixAE.measurable_mk.quasiMeasurePreserving (observationalLaw θ)).tendsto_ae rw [← Measure.map_congr hmix_eq, ← hone.1] at hrep exact Filter.Tendsto.congr' hmix_eq.symm hrep have hpull := (hone.2.2.1 i).comp_tendsto htend let r := fun v : LatentState n => mechanismRatioNumerator W hpos i (v (W.targetPerm i)) / (mechanismUnitCubeFactorization hpos).factor (W.targetPerm i) v have hr : (observedLawRatio W.law i ∘ W.mix) =ᵐ[observationalLaw θ] (toReal ∘ r) := by filter_upwards [hpull, ae_iff.mpr hobs_cube] with v hvcanon hv have hratio_pos : 0 < W.ratio i (W.mix v) := by rw [hone.2.2.2 i v hv] exact div_pos (hpos.2.1 _ _ (hv (W.targetPerm i) (Set.mem_univ _))) (hpos.1 _ _ hv) change ((W.law i.succ).rnDeriv (W.law 0) (W.mix v)).toReal = (r v).toReal calc _ = (ofReal (W.ratio i (W.mix v))).toReal := (congrArg toReal hvcanon).symm _ = W.ratio i (W.mix v) := ENNReal.toReal_ofReal hratio_pos.le _ = θ.q (W.targetPerm i) (v (W.targetPerm i)) / θ.p (W.targetPerm i) v := hone.2.2.2 i v hv _ = (r v).toReal := (mechanismTargetRatio_toReal_eq W hpos i hv).symm unfold observationalRatioLaw rw [hone.1] calc Measure.map (observedLawRatio W.law i) (Measure.map W.mix (observationalLaw θ)) = Measure.map (observedLawRatio W.law i ∘ W.mix) (observationalLaw θ) := AEMeasurable.map_map_of_aemeasurable (measurable_observedLawRatio W.law i).aemeasurable hmixAE _ = Measure.map (toReal ∘ r) (observationalLaw θ) := Measure.map_congr hr _ = Measure.map (toReal ∘ r) (mechanismUnitCubeFactorization hpos).observationalMeasure := by rw [mechanismUnitCubeFactorization_observationalMeasure hpos] _ = _ := by rfl
clause 6
interventional_identification := by intro j i let B := mechanismUnitCubeFactorization hpos let qj := mechanismInterventionDensity W hpos j let μ := unitCubeReference (Fin n) let ν := interventionalLaw θ (W.targetPerm j) have hcube : MeasurableSet (latentCube n) := by rw [latentCube] exact MeasurableSet.pi Set.countable_univ (fun _ _ => measurableSet_Icc) have hμ_cube : μ (latentCube n)ᶜ
= 0 := by simpa only [μ, latentCube, unitCube] using unitCubeReference_compl (Fin n) have hν_μ : ν ≪ μ := by change interventionalLaw θ (W.targetPerm j) ≪ unitCubeReference (Fin n) rw [← mechanismUnitCubeFactorization_interventionMeasure W hpos j] rw [interventionMeasure] exact withDensity_absolutelyContinuous _ _ have hν_cube : ν (latentCube n)ᶜ = 0 := hν_μ hμ_cube have hmixOn : SupportMeasurableOn W.mix (latentCube n) := hmix.1.continuousOn.domRestrict.measurable have hmixAE : AEMeasurable W.mix ν := aemeasurable_of_supportMeasurableOn hcube hν_cube hmixOn let mix' := hmixAE.mk W.mix have hmix_eq : W.mix =ᵐ[ν] mix' := hmixAE.ae_eq_mk have htend : Tendsto W.mix (ae ν) (ae (W.law j.succ)) := by have hrep := (hmixAE.measurable_mk.quasiMeasurePreserving ν).tendsto_ae rw [← Measure.map_congr hmix_eq, ← hone.2.1 j] at hrep exact Filter.Tendsto.congr' hmix_eq.symm hrep have hcanon_j := (observedInterventional_absolutelyContinuous_observational W hpos hmix hone j).ae_eq (hone.2.2.1 i) have hpull := hcanon_j.comp_tendsto htend let r := fun v : LatentState n => mechanismRatioNumerator W hpos i (v (W.targetPerm i)) / (mechanismUnitCubeFactorization hpos).factor (W.targetPerm i) v have hr : (observedLawRatio W.law i ∘ W.mix) =ᵐ[ν] (toReal ∘ r) := by filter_upwards [hpull, ae_iff.mpr hν_cube] with v hvcanon hv have hratio_pos : 0 < W.ratio i (W.mix v) := by rw [hone.2.2.2 i v hv] exact div_pos (hpos.2.1 _ _ (hv (W.targetPerm i) (Set.mem_univ _))) (hpos.1 _ _ hv) change ((W.law i.succ).rnDeriv (W.law 0) (W.mix v)).toReal = (r v).toReal calc _ = (ofReal (W.ratio i (W.mix v))).toReal := (congrArg toReal hvcanon).symm _ = W.ratio i (W.mix v) := ENNReal.toReal_ofReal hratio_pos.le _ = θ.q (W.targetPerm i) (v (W.targetPerm i)) / θ.p (W.targetPerm i) v := hone.2.2.2 i v hv _ = (r v).toReal := (mechanismTargetRatio_toReal_eq W hpos i hv).symm unfold interventionalRatioLaw rw [hone.2.1 j] calc Measure.map (observedLawRatio W.law i) (Measure.map W.mix ν) = Measure.map (observedLawRatio W.law i ∘ W.mix) ν := AEMeasurable.map_map_of_aemeasurable (measurable_observedLawRatio W.law i).aemeasurable hmixAE _ = Measure.map (toReal ∘ r) ν := Measure.map_congr hr _ = Measure.map (toReal ∘ r) (B.interventionMeasure (W.targetPerm j) qj) := by change Measure.map (toReal ∘ r) (interventionalLaw θ (W.targetPerm j)) = Measure.map (toReal ∘ r) ((mechanismUnitCubeFactorization hpos).interventionMeasure (W.targetPerm j) (mechanismInterventionDensity W hpos j)) rw [mechanismUnitCubeFactorization_interventionMeasure W hpos j] _ = _ := by rfl
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.finiteDensityObservedWorldBridge_of_assumptions · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/FiniteDensityBridge.lean:281
theorem ratioLaw_eq_of_nonancestor

The finite-density bridge turns nonancestry into equality of the two canonical real-valued ratio laws. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
j i :
Fin n
hji :
j ≠ i
hna :
¬ G.isAncestor (W.targetPerm j) (W.targetPerm i)
Proof (Lean source)
-- @node: FiniteDensityObservedWorldBridge.ratioLaw_eq_of_nonancestor lemma FiniteDensityObservedWorldBridge.ratioLaw_eq_of_nonancestor {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} {W : ObservedWorld G θ} (B : FiniteDensityObservedWorldBridge W) {j i : Fin n} (hji : j ≠ i) (hna : ¬ G.isAncestor (W.targetPerm j) (W.targetPerm i)) : observationalRatioLaw W i = interventionalRatioLaw W j i := by rw [B.observational_identification i, B.interventional_identification j i] have hσ : ∀ _ : Fin n, SigmaFinite Causalean.Graph.FiniteDensity.unitIntervalReference := fun _ => by unfold Causalean.Graph.FiniteDensity.unitIntervalReference infer_instance have htarget : W.targetPerm j ≠ W.targetPerm i := by exact fun h => hji (W.targetPerm.injective h) have h := @targetRatio_map_eq (Fin n) _ _ (fun _ : Fin n => ℝ) _ (fun _ : Fin n => Causalean.Graph.FiniteDensity.unitIntervalReference) hσ G B.factorization (W.targetPerm i) (W.targetPerm j) htarget hna (B.intervention j) (B.numerator i) (B.ratio_measurable i) (fun _ => 0) let r := fun v : LatentState n => B.numerator i (v (W.targetPerm i)) / B.factorization.factor (W.targetPerm i) v change Measure.map (toReal ∘ r) B.factorization.observationalMeasure = Measure.map (toReal ∘ r) (B.factorization.interventionMeasure (W.targetPerm j) (B.intervention j)) calc _ = Measure.map toReal (Measure.map r B.factorization.observationalMeasure) := by simpa [r] using (Measure.map_map ENNReal.measurable_toReal (B.ratio_measurable i)).symm _ = Measure.map toReal (Measure.map r (B.factorization.interventionMeasure (W.targetPerm j) (B.intervention j))) := congrArg (Measure.map toReal) h _ = _ := by simpa [r] using Measure.map_map ENNReal.measurable_toReal (B.ratio_measurable i)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.FiniteDensityObservedWorldBridge.ratioLaw_eq_of_nonancestor · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/FiniteDensityBridge.lean:421
theorem mechanism_orderedLocalMarkov

The observational law of a positive normalized mechanism satisfies the ordered local Markov property for every topological ranking of its latent DAG. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
i :
Fin n
A :
hA :
A ⊆ predecessors τ i
hpa :
G.parents i ⊆ A
∃ hfinite : IsFiniteMeasure B.observationalMeasure, letI
Proof (Lean source)
lemma mechanism_orderedLocalMarkov {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (hpos : PositiveNormalizedSmoothMechanisms G θ) (τ : TopologicalRanking G) (i : Fin n) (A : Finset (Fin n)) (hA : A ⊆ predecessors τ i) (hpa : G.parents i ⊆ A) : let B := mechanismUnitCubeFactorization hpos ∃ hfinite : IsFiniteMeasure B.observationalMeasure, letI := hfinite CondIndepFun (comap (coordinateProjection (X := fun _ : Fin n ↦ ℝ) A) inferInstance) (coordinateConditioning_comap_le (X := fun _ : Fin n ↦ ℝ) A) (fun v : LatentState n ↦ v i) (coordinateProjection (X := fun _ : Fin n ↦ ℝ) (predecessors τ i \ A)) B.observationalMeasure := by let B := mechanismUnitCubeFactorization hpos have hfinite : IsFiniteMeasure B.observationalMeasure := instIsFiniteMeasureUnitCubeObservational B refine ⟨hfinite, ?_⟩ exact B.orderedLocalMarkov_unitCubeReference τ i A hA hpa
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.mechanism_orderedLocalMarkov · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/FiniteDensityBridge.lean:460
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.GaussianRecoveryBridge 4 declarations This file connects the paper's duplicated explicit Gaussian feature expansion and its canonical ratio laws to the neutral bounded-support recovery theorem.

Gaussian recovery bridge

This file connects the paper's duplicated explicit Gaussian feature expansion and its canonical ratio laws to the neutral bounded-support recovery theorem.

theorem canonicalObservedWorld_onePerfectInterventionPerNode

The identity-mixing canonical world satisfies the paper's perfect-intervention contract. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
π :
Perm (Fin n)
Proof (Lean source)
lemma canonicalObservedWorld_onePerfectInterventionPerNode {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (hpos : PositiveNormalizedSmoothMechanisms G θ) (π : Perm (Fin n)) : OnePerfectInterventionPerNode G θ (canonicalObservedWorld G θ π) := by let W := canonicalObservedWorld G θ π let B := mechanismUnitCubeFactorization hpos constructor · simp [canonicalObservedWorld] constructor · intro e simp [canonicalObservedWorld] constructor · intro e let q := mechanismInterventionDensity W hpos e let r := fun v : LatentState n => q.density (v (W.targetPerm e)) / B.factor (W.targetPerm e) v have hfactor_zero : ∀ v, B.factor (W.targetPerm e) v ≠ 0 := by intro v change ofReal (θ.p (W.targetPerm e) (clampCube (Fin n) v)) ≠ 0 exact (ENNReal.ofReal_pos.mpr (hpos.1 _ _ (by simpa only [latentCube, unitCube] using clampCube_mem (Fin n) v))).ne' have hfactor_top : ∀ v, B.factor (W.targetPerm e) v ≠ ∞ := by intro v change ofReal (θ.p (W.targetPerm e) (clampCube (Fin n) v)) ≠ ∞ exact ENNReal.ofReal_ne_top have hmeasure : interventionalLaw θ (W.targetPerm e) = (observationalLaw θ).withDensity r := by rw [← mechanismUnitCubeFactorization_interventionMeasure W hpos e, ← mechanismUnitCubeFactorization_observationalMeasure hpos] exact factorization_interventionMeasure_eq_withDensity_targetRatio B (W.targetPerm e) q hfactor_zero hfactor_top have hrn : (interventionalLaw θ (W.targetPerm e)).rnDeriv (observationalLaw θ) =ᵐ[ observationalLaw θ] r := by letI : IsProbabilityMeasure (observationalLaw θ) := observationalLaw_isProbabilityMeasure hpos rw [hmeasure] exact Measure.rnDeriv_withDensity _ ((q.measurable_density.comp (measurable_pi_apply (W.targetPerm e))).div (B.measurable_factor (W.targetPerm e))) filter_upwards [hrn, observationalLaw_ae_mem_latentCube hpos] with v hrv hv change ofReal (θ.q (π e) (v (π e)) / θ.p (π e) v) = (interventionalLaw θ (π e)).rnDeriv (observationalLaw θ) v have hrtop : r v ≠ ∞ := ENNReal.div_ne_top (by dsimp only [r, q, mechanismInterventionDensity, mechanismRatioNumerator] exact ENNReal.ofReal_ne_top) (hfactor_zero v) have hratio : (r v).toReal = θ.q (π e) (v (π e)) / θ.p (π e) v := by simpa only [r, q, B, W, mechanismRatioNumerator, canonicalObservedWorld] using mechanismTargetRatio_toReal_eq W hpos e hv calc ofReal (θ.q (π e) (v (π e)) / θ.p (π e) v) = ofReal (r v).toReal := by rw [hratio] _ = r v := ENNReal.ofReal_toReal hrtop _ = _ := hrv.symm · intro e v hv rfl
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.canonicalObservedWorld_onePerfectInterventionPerNode · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/GaussianRecoveryBridge.lean:53
theorem gaussianFeature_eq_recovery

The paper and neutral Gaussian feature vectors are the same explicit ℓ² vector. the stated conclusion follows.

Formal statement
r :
= CausalSmith.Substrate.GaussianMeanEmbeddingBoundedMomentRecovery.gaussianFeature r
Proof (Lean source)
lemma gaussianFeature_eq_recovery (r : ℝ) : gaussianFeature r = CausalSmith.Substrate.GaussianMeanEmbeddingBoundedMomentRecovery.gaussianFeature r := by apply Subtype.ext funext m rfl
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.gaussianFeature_eq_recovery · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/GaussianRecoveryBridge.lean:115
theorem meanEmbedding_gaussianFeatureMap_eq_recovery

The paper's Gaussian mean embedding agrees with the neutral recovery embedding. the stated conclusion follows.

Formal statement
μ :
= CausalSmith.Substrate.GaussianMeanEmbeddingBoundedMomentRecovery.meanEmbedding CausalSmith.Substrate.GaussianMeanEmbeddingBoundedMomentRecovery.gaussianFeatureMap μ
Proof (Lean source)
lemma meanEmbedding_gaussianFeatureMap_eq_recovery (μ : Measure ℝ) : meanEmbedding gaussianFeatureMap μ = CausalSmith.Substrate.GaussianMeanEmbeddingBoundedMomentRecovery.meanEmbedding CausalSmith.Substrate.GaussianMeanEmbeddingBoundedMomentRecovery.gaussianFeatureMap μ := by unfold meanEmbedding CausalSmith.Substrate.GaussianMeanEmbeddingBoundedMomentRecovery.meanEmbedding apply integral_congr_ae filter_upwards with r exact gaussianFeature_eq_recovery r
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.meanEmbedding_gaussianFeatureMap_eq_recovery · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/GaussianRecoveryBridge.lean:123
theorem canonical_populationDiscrepancy_pos_of_secondMomentContrast_ne

A nonzero canonical raw second-moment contrast forces positive paper-local Gaussian MMD. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
π :
Perm (Fin n)
j i :
Fin n
hmom :
Proof (Lean source)
lemma canonical_populationDiscrepancy_pos_of_secondMomentContrast_ne {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (hpos : PositiveNormalizedSmoothMechanisms G θ) (π : Perm (Fin n)) (j i : Fin n) (hmom : secondMomentContrast (canonicalObservedWorld G θ π) j i ≠ 0) : 0 < populationDiscrepancy gaussianFeatureMap (canonicalObservedWorld G θ π) j i := by let W := canonicalObservedWorld G θ π let μ := observationalRatioLaw W i let ν := interventionalRatioLaw W j i let ratio := fun v : LatentState n => θ.q (π i) (v (π i)) / θ.p (π i) v have hone := canonicalObservedWorld_onePerfectInterventionPerNode hpos π have hobsCube : ∀ᵐ v ∂observationalLaw θ, v ∈ latentCube n := observationalLaw_ae_mem_latentCube hpos have hac : interventionalLaw θ (π j) ≪ observationalLaw θ := by simpa only [W, canonicalObservedWorld] using interventionalLaw_absolutelyContinuous_observational W hpos j have hintCube : ∀ᵐ v ∂interventionalLaw θ (π j), v ∈ latentCube n := hac.ae_le hobsCube have hratioObs : observedLawRatio W.law i =ᵐ[observationalLaw θ] ratio := by filter_upwards [hone.2.2.1 i, hobsCube] with v hrv hv change ((interventionalLaw θ (π i)).rnDeriv (observationalLaw θ) v).toReal = θ.q (π i) (v (π i)) / θ.p (π i) v calc _ = (ofReal (W.ratio i v)).toReal := congrArg toReal hrv.symm _ = W.ratio i v := ENNReal.toReal_ofReal (div_nonneg (hpos.2.1 _ _ (hv (π i) (Set.mem_univ _))).le (hpos.1 _ _ hv).le) _ = _ := by rfl have hratioInt : observedLawRatio W.law i =ᵐ[interventionalLaw θ (π j)] ratio := by exact hac.ae_eq hratioObs have hratioCont : ContinuousOn ratio (latentCube n) := by apply ((hpos.2.2.2.1 (π i)).continuousOn.comp ((continuous_apply (π i)).continuousOn) (fun (v : LatentState n) (hv : v ∈ latentCube n) => hv (π i) (Set.mem_univ _))).div ((hpos.2.2.1 (π i)).continuousOn) intro v hv exact ne_of_gt (hpos.1 _ _ hv) have hcubeCompact : IsCompact (latentCube n) := by rw [latentCube] exact isCompact_univ_pi fun _ => isCompact_Icc obtain ⟨R, hR⟩ := (hcubeCompact.image_of_continuousOn hratioCont).isBounded.subset_closedBall (0 : ℝ) let B := max R 0 have hB : 0 ≤ B := le_max_right _ _ have hratioBound : ∀ v ∈ latentCube n, ratio v ∈ Icc (-B) B := by intro v hv have hvball : ratio v ∈ closedBall (0 : ℝ) R := hR (Set.mem_image_of_mem ratio hv) have habsR : |ratio v| ≤ R := by simpa [Real.dist_eq] using hvball exact (abs_le.mp (habsR.trans (le_max_left _ _))) have hμsupport : μ (Icc (-B) B)ᶜ = 0 := by dsimp only [μ] rw [observationalRatioLaw, Measure.map_apply (measurable_observedLawRatio W.law i) measurableSet_Icc.compl] apply ae_iff.mp filter_upwards [hratioObs, hobsCube] with v hratio hv rw [hratio] exact hratioBound v hv have hνsupport : ν (Icc (-B) B)ᶜ = 0 := by dsimp only [ν] rw [interventionalRatioLaw, show W.law j.succ = interventionalLaw θ (π j) by rfl, Measure.map_apply (measurable_observedLawRatio W.law i) measurableSet_Icc.compl] apply ae_iff.mp filter_upwards [hratioInt, hintCube] with v hratio hv rw [hratio] exact hratioBound v hv have hμmoment : (∫ r, r ^ 2 ∂μ) = ∫ v, (ratio v) ^ 2 ∂observationalLaw θ := by dsimp only [μ] rw [observationalRatioLaw, MeasureTheory.integral_map (measurable_observedLawRatio W.law i).aemeasurable (by fun_prop)] apply integral_congr_ae filter_upwards [hratioObs] with v hv rw [hv] have hνmoment : (∫ r, r ^ 2 ∂ν) = ∫ v, (ratio v) ^ 2 ∂interventionalLaw θ (π j) := by dsimp only [ν] rw [interventionalRatioLaw, show W.law j.succ = interventionalLaw θ (π j) by rfl, MeasureTheory.integral_map (measurable_observedLawRatio W.law i).aemeasurable (by fun_prop)] apply integral_congr_ae filter_upwards [hratioInt] with v hv rw [hv] letI : IsProbabilityMeasure (observationalLaw θ) := observationalLaw_isProbabilityMeasure hpos letI : IsProbabilityMeasure (interventionalLaw θ (π j)) := by simpa only [W, canonicalObservedWorld] using interventionalLaw_isProbabilityMeasure W hpos j letI : IsFiniteMeasure (W.law 0) := by change IsFiniteMeasure (observationalLaw θ) infer_instance letI : IsFiniteMeasure (W.law j.succ) := by change IsFiniteMeasure (interventionalLaw θ (π j)) infer_instance letI : IsFiniteMeasure μ := by dsimp only [μ, observationalRatioLaw] exact Measure.isFiniteMeasure_map (W.law 0) (observedLawRatio W.law i) letI : IsFiniteMeasure ν := by dsimp only [ν, interventionalRatioLaw] exact Measure.isFiniteMeasure_map (W.law j.succ) (observedLawRatio W.law i) have hraw : (∫ r, r ^ 2 ∂μ) ≠ ∫ r, r ^ 2 ∂ν := by intro heq apply hmom unfold secondMomentContrast change (∫ v, (ratio v) ^ 2 ∂interventionalLaw θ (π j)) - (∫ v, (ratio v) ^ 2 ∂observationalLaw θ) = 0 rw [← hνmoment, ← hμmoment, ← heq, sub_self] have hrecover := CausalSmith.Substrate.GaussianMeanEmbeddingBoundedMomentRecovery.norm_meanEmbedding_sub_pos_of_secondMoment_ne_of_boundedSupport μ ν B hB hμsupport hνsupport hraw rw [← meanEmbedding_gaussianFeatureMap_eq_recovery μ, ← meanEmbedding_gaussianFeatureMap_eq_recovery ν] at hrecover simpa only [populationDiscrepancy, μ, ν, W] using hrecover
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.canonical_populationDiscrepancy_pos_of_secondMomentContrast_ne · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/GaussianRecoveryBridge.lean:136
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.Inference 15 declarations This file defines the multi-environment evaluation sample, arbitrary training-fold ratio estimates, empirical MMDs, and the simultaneous threshold.

Independent sample-splitting and the confidence graph

This file defines the multi-environment evaluation sample, arbitrary training-fold ratio estimates, empirical MMDs, and the simultaneous threshold.

structure SampleSplitWorld Definition 24 in the paper ↗

A sample-split experiment over a fixed observed environment family.

Definition (Lean source)
n :
DAG (Fin n)
W :
Ω :
probability :
sampleSize :
Fin (n + 1) → ℕ
evaluation :
∀ e
if
Fin (sampleSize e)
and
Ω
trainingSize :
Fin (n + 1) → ℕ
training :
∀ e
if
Fin (trainingSize e)
and
Ω
ratioFit :
(∀ e, Fin (trainingSize e) → LatentState n) → Fin n → LatentState n → ℝ
@realizes \(\widehat R_i\)(measurable function fitted from the full training fold)
ratioFit_joint_measurable :
∀ i, Measurable (uncurry (fun T x => ratioFit T i x))
@realizes \(\widehat R_i\)(joint measurability in training data and evaluation point)
ratioFit_measurable :
∀ T i, Measurable (ratioFit T i)
@realizes \(\widehat R_i\)(measurable as a function of the observation)
ratioFit_pos :
∀ T i x, 0 < ratioFit T i x
@realizes \(\widehat R_i\)(strictly positive range)
firstStageRadius :
ℝ → ℝ
firstStageRadius_nonneg :
∀ η, 0 ≤ firstStageRadius η
@realizes \(a_N\)(nonnegative range)
alpha :
alpha_mem :
alpha ∈ Ioo (0 : ℝ) 1
eta :
eta_mem :
eta ∈ Ioo (0 : ℝ) 1
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.SampleSplitWorld · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Inference.lean:19

The complete training fold, retained rather than compressed to an arbitrary summary.

Definition (Lean source)
n :
DAG (Fin n)
W :
Ω :
S :
ω :
Ω
e :
trainingFold S ω e :
Fin (S.trainingSize e) → LatentState n
fun e r => S.training e r ω
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.trainingFold · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Inference.lean:45
def trainingSigma

The σ-algebra generated by the complete training fold.

Definition (Lean source)
n :
DAG (Fin n)
W :
Ω :
S :
trainingSigma S :
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.trainingSigma · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Inference.lean:53
def ratioEstimate

The fitted ratio, definitionally factored through the complete training fold.

Definition (Lean source)
n :
DAG (Fin n)
W :
Ω :
S :
ω :
Ω
ratioEstimate S ω :
Fin n → LatentState n → ℝ
S.ratioFit (trainingFold S ω)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.SampleSplitWorld.ratioEstimate · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Inference.lean:59

The training-fold finite ratio-error event used by the confidence theorem.

Definition (Lean source)
n :
DAG (Fin n)
W :
Ω :
S :
firstStageL1Event S :
Set Ω
{ω | ∀ i : Fin n, ∀ e : Fin (n + 1), Integrable (fun x => |S.ratioEstimate ω i x - observedLawRatio W.law i x|) (W.law e) ∧ ∫ x, |S.ratioEstimate ω i x - observedLawRatio W.law i x| ∂W.law e ≤ S.firstStageRadius S.eta}
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.firstStageL1Event · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Inference.lean:65
def allEvaluationData

All evaluation observations as a single dependent array.

Definition (Lean source)
n :
DAG (Fin n)
W :
Ω :
S :
ω :
Ω
e :
allEvaluationData S ω e :
Fin (S.sampleSize e) → LatentState n
fun e r => S.evaluation e r ω
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.allEvaluationData · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Inference.lean:74
def IndependentEnvironmentSampling Assumption 7 in the paper ↗

Evaluation observations are independent within each environment, have the stated environment law, and the complete evaluation fold is independent of the training fold.

Definition (Lean source)
n :
DAG (Fin n)
shared
W :
shared
Ω :
Type u_1
shared
S :
shared
IndependentEnvironmentSampling S :
Prop
clause 1
IsProbabilityMeasure S.probability
clause 2
e :
clause 3
e r :
Measurable (S.training e r)
clause 4
e :
iIndepFun (S.training e) S.probability
clause 5
e r :
Measure.map (S.training e r) S.probability = W.law e
clause 6
e r :
Measurable (S.evaluation e r)
clause 7
e :
iIndepFun (S.evaluation e) S.probability
clause 8
e r :
Measure.map (S.evaluation e r) S.probability = W.law e
clause 9
clause 10
i x :
@Measurable Ω ℝ (comap (trainingFold S) inferInstance) inferInstance (fun ω => S.ratioEstimate ω i x)
clause 11
i :
@Measurable (Ω × LatentState n) ℝ ((comap (trainingFold S) inferInstance).prod inferInstance) inferInstance (fun p => S.ratioEstimate p.1 i p.2)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.IndependentEnvironmentSampling · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Inference.lean:86
def ConditionalEvaluationSampling

The part of the sample-splitting assumptions needed to condition an evaluation-sample concentration bound on the training fold. It deliberately omits the unused training-sample law and i.i.d. clauses and the measurability of the separate first-stage event.

Definition (Lean source)
n :
DAG (Fin n)
shared
W :
shared
Ω :
Type u_1
shared
S :
shared
ConditionalEvaluationSampling S :
Prop
clause 1
IsProbabilityMeasure S.probability
clause 2
e :
clause 4
e r :
Measurable (S.evaluation e r)
clause 5
e :
iIndepFun (S.evaluation e) S.probability
clause 6
e r :
Measure.map (S.evaluation e r) S.probability = W.law e
clause 7
clause 8
i :
@Measurable (Ω × LatentState n) ℝ ((comap (trainingFold S) inferInstance).prod inferInstance) inferInstance (fun p => S.ratioEstimate p.1 i p.2)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.ConditionalEvaluationSampling · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Inference.lean:106
theorem toConditionalEvaluationSampling

The full independent-environment sampling contract supplies the smaller collection of assumptions needed for conditional evaluation-fold concentration. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
shared
W :
shared
Ω :
Type u_1
shared
S :
shared
Proof (Lean source)
lemma IndependentEnvironmentSampling.toConditionalEvaluationSampling (h : IndependentEnvironmentSampling S) : ConditionalEvaluationSampling S := by rcases h with ⟨hprob, hlaw, htrainMeas, _htrainIndep, _htrainLaw, hevalMeas, hevalIndep, hevalLaw, hsplit, _hratioMeas, hratioJoint, _hfirstMeas⟩ have htrain : Measurable (trainingFold S) := by apply measurable_pi_lambda intro e apply measurable_pi_lambda intro r exact htrainMeas e r exact ⟨hprob, hlaw, htrain, hevalMeas, hevalIndep, hevalLaw, hsplit, hratioJoint⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.IndependentEnvironmentSampling.toConditionalEvaluationSampling · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Inference.lean:121

Event E has conditional probability at least p, on event A, relative to m. The setwise formulation avoids selecting a conditional-expectation version.

Definition (Lean source)
Ω :
μ :
E A :
Set Ω
p :
B :
Set Ω
ConditionalProbabilityAtLeast μ m E A p :
Prop
p * μ.real (A ∩ B) ≤ μ.real (E ∩ A ∩ B)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.ConditionalProbabilityAtLeast · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Inference.lean:137
def minimumSampleSize

The minimum sample size across observational and intervention environments.

Definition (Lean source)
n :
DAG (Fin n)
shared
W :
shared
Ω :
Type u_1
shared
S :
shared
minimumSampleSize S :
Finset.univ.inf' ⟨0, Finset.mem_univ 0⟩ S.sampleSize
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.minimumSampleSize · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Inference.lean:145
def empiricalMeanEmbedding

Empirical mean embedding for ratio estimate i in environment e.

Definition (Lean source)
n :
DAG (Fin n)
shared
W :
shared
Ω :
Type u_1
shared
S :
shared
e :
Fin (n + 1)
i :
Fin n
ω :
Ω
empiricalMeanEmbedding S U e i ω :
H
(S.sampleSize e : ℝ)⁻¹ • ∑ r, U.Φ (S.ratioEstimate ω i (S.evaluation e r ω))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.empiricalMeanEmbedding · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Inference.lean:150
def empiricalDiscrepancy Definition 27 in the paper ↗

The sample-split empirical Gaussian-kernel MMD.

Definition (Lean source)
n :
DAG (Fin n)
shared
W :
shared
Ω :
Type u_1
shared
S :
shared
j i :
Fin n
ω :
Ω
empiricalDiscrepancy S U j i ω :
‖empiricalMeanEmbedding S U j.succ i ω - empiricalMeanEmbedding S U 0 i ω‖
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.empiricalDiscrepancy · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Inference.lean:157

The paper's simultaneous confidence radius.

Definition (Lean source)
n :
DAG (Fin n)
shared
W :
shared
Ω :
Type u_1
shared
S :
shared
confidenceRadius S :
2 * sqrt 2 * S.firstStageRadius S.eta
+ 2 * (1 + sqrt (2 * log ((n : ℝ) * (n + 1 : ℝ) / S.alpha))) / sqrt (minimumSampleSize S)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.confidenceRadius · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Inference.lean:164
def sampleSplitConfidenceGraph

The graph selected by positive lower confidence bounds for population discrepancies.

Definition (Lean source)
n :
DAG (Fin n)
shared
W :
shared
Ω :
Type u_1
shared
S :
shared
ω :
Ω
sampleSplitConfidenceGraph S U _hSampling ω :
Fin n → Fin n → Prop
fun j i => j ≠ i ∧ 0 < empiricalDiscrepancy S U j i ω - confidenceRadius S
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sampleSplitConfidenceGraph · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Inference.lean:173
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.Kernel 20 declarations This file defines the paper's explicit square-summable Gaussian feature map, kernel mean embeddings, population discrepancies, and the two genericity sets.

Gaussian feature embeddings and cover separation

This file defines the paper's explicit square-summable Gaussian feature map, kernel mean embeddings, population discrepancies, and the two genericity sets.

def gaussianKernel

The Gaussian kernel exp (-(a-b)²).

Definition (Lean source)
a b :
gaussianKernel a b :
exp (-(a - b) ^ 2)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.gaussianKernel · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Kernel.lean:25

A real Hilbert-space feature map of unit norm that realizes a specified kernel.

Definition (Lean source)
Φ :
ℝ → H
norm_eq_one :
∀ r, ‖Φ r‖ = 1
inner_eq_kernel :
∀ a b, ⟪Φ a, Φ b⟫_ℝ = gaussianKernel a b
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.UnitNormFeatureMap · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Kernel.lean:29
def gaussianFeatureCoefficient

The mth coordinate of the paper's explicit Gaussian feature expansion.

Definition (Lean source)
r :
m :
gaussianFeatureCoefficient r m :
sqrt ((2 : ℝ) ^ m / m.factorial) * exp (-r ^ 2) * r ^ m
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.gaussianFeatureCoefficient · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Kernel.lean:36
theorem gaussianFeature_memℓp

The explicit coefficient sequence is square-summable. the stated conclusion follows.

Formal statement
r :
Proof (Lean source)
lemma gaussianFeature_memℓp (r : ℝ) : Memℓp (gaussianFeatureCoefficient r) 2 := by apply memℓp_gen norm_num simp only [gaussianFeatureCoefficient] have hs : Summable (fun m : ℕ => (2 * r ^ 2) ^ m / m.factorial) := Real.summable_pow_div_factorial _ apply (hs.mul_left (exp (-r ^ 2) ^ 2)).congr intro m have hnonneg : 0 ≤ (2 : ℝ) ^ m / m.factorial := by positivity calc _ = exp (-r ^ 2) ^ 2 * ((2 : ℝ) ^ m / m.factorial) * r ^ (2 * m) := by ring _ = (sqrt ((2 : ℝ) ^ m / m.factorial)) ^ 2 * exp (-r ^ 2) ^ 2 * r ^ (2 * m) := by rw [Real.sq_sqrt hnonneg] ac_rfl _ = _ := by ring
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.gaussianFeature_memℓp · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Kernel.lean:40
def gaussianFeature

The explicit Gaussian feature vector in real ℓ².

Definition (Lean source)
r :
gaussianFeature r :
lp (fun _ : ℕ => ℝ) 2
⟨gaussianFeatureCoefficient r, gaussianFeature_memℓp r⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.gaussianFeature · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Kernel.lean:60
theorem gaussianFeature_inner

The inner product of two explicit Gaussian feature vectors equals the Gaussian kernel.

Formal statement
a b :
⟪gaussianFeature a, gaussianFeature b⟫_ℝ = gaussianKernel a b
Proof (Lean source)
lemma gaussianFeature_inner (a b : ℝ) : ⟪gaussianFeature a, gaussianFeature b⟫_ℝ = gaussianKernel a b := by rw [lp.inner_eq_tsum] simp_rw [RCLike.inner_apply, starRingEnd_apply, star_trivial] change (∑' m : ℕ, gaussianFeatureCoefficient b m * gaussianFeatureCoefficient a m) = _ have hterm : (fun m : ℕ => gaussianFeatureCoefficient b m * gaussianFeatureCoefficient a m) = fun m => (exp (-a ^ 2) * exp (-b ^ 2)) * ((2 * a * b) ^ m / m.factorial) := by funext m unfold gaussianFeatureCoefficient have hnonneg : 0 ≤ (2 : ℝ) ^ m / m.factorial := by positivity have hsqrt := Real.mul_self_sqrt hnonneg calc _ = (sqrt ((2 : ℝ) ^ m / m.factorial) * sqrt ((2 : ℝ) ^ m / m.factorial)) * (exp (-a ^ 2) * exp (-b ^ 2)) * (a ^ m * b ^ m) := by ring _ = _ := by rw [hsqrt]; ring rw [hterm, tsum_mul_left, (NormedSpace.expSeries_div_hasSum_exp (2 * a * b)).tsum_eq, ← Real.exp_eq_exp_ℝ, ← Real.exp_add, ← Real.exp_add] unfold gaussianKernel congr 1 ring
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.gaussianFeature_inner · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Kernel.lean:64
theorem gaussianFeature_norm

Every explicit Gaussian feature vector has unit norm.

Formal statement
r :
‖gaussianFeature r‖ = 1
Proof (Lean source)
lemma gaussianFeature_norm (r : ℝ) : ‖gaussianFeature r‖ = 1 := by have hsq : ‖gaussianFeature r‖ ^ 2 = 1 := by rw [← real_inner_self_eq_norm_sq, gaussianFeature_inner] simp [gaussianKernel] nlinarith [norm_nonneg (gaussianFeature r)]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.gaussianFeature_norm · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Kernel.lean:93

The concrete unit-norm feature-map realization of the Gaussian kernel.

Definition (Lean source)
gaussianFeatureMap :
UnitNormFeatureMap (lp (fun _ : ℕ => ℝ) 2)
clause 1
clause 2
norm_eq_one := gaussianFeature_norm
clause 3
inner_eq_kernel := gaussianFeature_inner
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.gaussianFeatureMap · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Kernel.lean:100
def meanEmbedding

The Bochner kernel mean embedding of a real-valued law in a Hilbert space.

Definition (Lean source)
meanEmbedding U μ :
H
∫ r, U.Φ r ∂μ
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.meanEmbedding · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Kernel.lean:106
def ObservedLawFamily

The observational law followed by the n interventional environment laws.

Definition (Lean source)
n :
ObservedLawFamily n :
Type
Fin (n + 1) → Measure (LatentState n)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.ObservedLawFamily · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Kernel.lean:112
def observedLawRatio

The canonical Radon--Nikodym ratio determined by the observed laws.

Definition (Lean source)
n :
shared
i :
Fin n
x :
observedLawRatio laws i x :
((laws i.succ).rnDeriv (laws 0) x).toReal
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observedLawRatio · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Kernel.lean:115
theorem measurable_observedLawRatio

The canonical observed-law ratio is globally measurable. the stated conclusion follows.

Formal statement
n :
shared
i :
Fin n
Proof (Lean source)
lemma measurable_observedLawRatio (laws : ObservedLawFamily n) (i : Fin n) : Measurable (observedLawRatio laws i) := ENNReal.measurable_toReal.comp (Measure.measurable_rnDeriv _ _)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.measurable_observedLawRatio · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Kernel.lean:120
def observationalRatioLaw

The law of ratio i under the observational environment.

Definition (Lean source)
n :
DAG (Fin n)
shared
W :
i :
Fin n
observationalRatioLaw W i :
Measure.map (observedLawRatio W.law i) (W.law 0)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.observationalRatioLaw · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Kernel.lean:125
def interventionalRatioLaw

The law of ratio i under intervention environment j.

Definition (Lean source)
n :
DAG (Fin n)
shared
W :
j i :
Fin n
interventionalRatioLaw W j i :
Measure.map (observedLawRatio W.law i) (W.law j.succ)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.interventionalRatioLaw · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Kernel.lean:129
def populationDiscrepancy Definition 6 in the paper ↗

Population Gaussian-kernel MMD between the observational and environment-j ratio laws.

Definition (Lean source)
n :
DAG (Fin n)
shared
θ :
W :
j i :
Fin n
populationDiscrepancy U W j i :
‖meanEmbedding U (observationalRatioLaw W i) - meanEmbedding U (interventionalRatioLaw W j i)‖
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.populationDiscrepancy · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Kernel.lean:134
theorem populationDiscrepancy_eq_zero_of_ratioLaw_eq

Equal observational and interventional ratio laws have zero population discrepancy. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
shared
θ :
W :
j i :
Fin n
Proof (Lean source)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.populationDiscrepancy_eq_zero_of_ratioLaw_eq · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Kernel.lean:144
def secondMomentContrast Definition 36 in the paper ↗

The environment-j minus observational second-moment contrast of ratio i.

Definition (Lean source)
n :
DAG (Fin n)
shared
W :
j i :
Fin n
secondMomentContrast W j i :
(∫ x, (W.ratio i x) ^ 2 ∂W.law j.succ) - ∫ x, (W.ratio i x) ^ 2 ∂W.law 0
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.secondMomentContrast · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Kernel.lean:152

The observable directed ratio graph.

Definition (Lean source)
n :
DAG (Fin n)
shared
θ :
W :
ratioGraph U W :
Fin n → Fin n → Prop
fun j i => j ≠ i ∧ 0 < populationDiscrepancy U W j i
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.ratioGraph · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Kernel.lean:159
def edgeSeparatedSet Definition 5 in the paper ↗

Mechanisms whose second-moment contrast is nonzero on every permuted direct edge.

Definition (Lean source)
n :
shared
π :
Perm (Fin n)
edgeSeparatedSet π :
{θ | ∀ ⦃j i⦄, G.edge j i → secondMomentContrast (canonicalObservedWorld G θ.1 π) (π.symm j) (π.symm i) ≠ 0}
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.edgeSeparatedSet · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Kernel.lean:168
def coverSeparatedSet

Mechanisms whose Gaussian MMD is positive on every permuted ancestral cover.

Definition (Lean source)
n :
shared
π :
Perm (Fin n)
coverSeparatedSet U π :
{θ | ∀ ⦃j i⦄, ancestralCover G j i → 0 < populationDiscrepancy U (canonicalObservedWorld G θ.1 π) (π.symm j) (π.symm i)}
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.coverSeparatedSet · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Kernel.lean:176
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.OpenQuestions 1 declarations The second-stage procedure and sharp remainder criterion are intentionally left undefined by the paper, so the complete question is preserved as text.

Generated-rank frontier

The second-stage procedure and sharp remainder criterion are intentionally left undefined by the paper, so the complete question is preserved as text.

def generatedRankFrontierQuestion Remark 2 in the paper ↗

@realizes U^i\widehat U_i(open cross-fitted conditional-CDF estimator) @realizes Hrank\mathfrak H_{\mathrm{rank}}(named nonassertive construction handle)

Definition (Lean source)
generatedRankFrontierQuestion :
_root_.String
"Open, nonassertive generated-rank frontier. Regime: shared C2 diffeomorphic mixing; one \ distinct unknown-target parent-independent perfect intervention per latent node; fixed \ own-coordinate derivative signs; independent sampling within environments and independent \ training/evaluation folds; and the bounded Holder subclass Theta^beta_{G,s}(c,M,K,rho). \ Assume inf_theta Pr_theta{E_N^infty(b_N)} >
= 1-eta_N. Let h_N -> 0, b_N = o(h_N), \ and Nbar*h_N^dstar/log(Nbar) -> infinity. Question: using H_rank, can one construct \ cross-fitted conditional-CDF estimators Uhat_i with max_i \ ||Uhat_i-U_i||_{infinity,K} = O_Pr(r_N), where \ r_N = h_N^2
+ sqrt(log(Nbar)/(Nbar*h_N^dstar))
+ b_N/h_N? Under an additional \ uniform asymptotically linear first-stage log-ratio representation on K, derive an expansion \ separating generated-threshold indicator boundary crossings, generated-conditioning \ local-design perturbations, oracle conditional-CDF variance, and smoothing bias, and \ characterize the weakest sufficient first-stage remainder. This payload asserts neither \ construction nor attainment nor sharpness of the rate, and asserts no sufficient or necessary \ remainder bound; the influence representation and second-stage weight convention remain \ unspecified."
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.generatedRankFrontierQuestion · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/OpenQuestions.lean:13
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.RkhsEmpiricalMean 5 declarations The statement is made against the local unit-norm feature-map interface and is designed for the reused scalar McDiarmid concentration engine.

Uniform Hilbert-valued empirical-mean deviation

The statement is made against the local unit-norm feature-map interface and is designed for the reused scalar McDiarmid concentration engine.

theorem randomParam_event_inter_le Lemma randomParam_event_inter_le in the paper ↗

A training-measurable localization of the random-parameter product-law bound. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
Y :
Ω → β
hY :
@Measurable Ω β mΩ mβ Y
hY_law :
μ.map Y = ν
mA :
hmA :
mA ≤ mΩ
hindep :
@Indep Ω mA (comap Y mβ) mΩ μ
δ :
Bad :
Ω → Set β
hBad :
@MeasurableSet (Ω × β) (mA.prod mβ) {p | p.2 ∈ Bad p.1}
hsec :
∀ ω, ν (Bad ω) ≤ ofReal δ
B :
Set Ω
hB :
@MeasurableSet Ω mA B
μ ({ω | Y ω ∈ Bad ω} ∩ B) ≤ ofReal δ * μ B
Proof (Lean source)
-- @node: randomParam_event_inter_le lemma randomParam_event_inter_le {Ω β : Type*} [mΩ : MeasurableSpace Ω] [mβ : MeasurableSpace β] {μ : Measure Ω} [IsProbabilityMeasure μ] {Y : Ω → β} (hY : @Measurable Ω β mΩ mβ Y) {ν : Measure β} [IsProbabilityMeasure ν] (hY_law : μ.map Y = ν) (mA : MeasurableSpace Ω) (hmA : mA ≤ mΩ) (hindep : @Indep Ω mA (comap Y mβ) mΩ μ) {δ : ℝ} (Bad : Ω → Set β) (hBad : @MeasurableSet (Ω × β) (mA.prod mβ) {p | p.2 ∈ Bad p.1}) (hsec : ∀ ω, ν (Bad ω) ≤ ofReal δ) (B : Set Ω) (hB : @MeasurableSet Ω mA B) : μ ({ω | Y ω ∈ Bad ω} ∩ B) ≤ ofReal δ * μ B := by have hJ : @Measurable Ω (Ω × β) mΩ (mA.prod mβ) (fun ω => (ω, Y ω)) := (measurable_id'' hmA).prod hY have hfst : @Measurable (Ω × β) Ω (mA.prod mβ) mA fst := measurable_fst have hset : @MeasurableSet (Ω × β) (mA.prod mβ) ({p | p.2 ∈ Bad p.1} ∩ fst ⁻¹' B) := hBad.inter (hB.preimage hfst) have hYa : @AEMeasurable Ω β mβ mΩ Y μ := hY.aemeasurable have hmap := @Causalean.Mathlib.indep_trim_prod_map_eq Ω β mΩ mβ μ _ mA hmA Y hYa hindep have heq : {ω | Y ω ∈ Bad ω} ∩ B = (fun ω => (ω, Y ω)) ⁻¹' ({p | p.2 ∈ Bad p.1} ∩ fst ⁻¹' B) := by ext ω simp rw [heq, ← Measure.map_apply hJ hset, hmap, hY_law, Measure.prod_apply hset] calc (∫⁻ ω, ν (Prod.mk ω ⁻¹' ({p | p.2 ∈ Bad p.1} ∩ fst ⁻¹' B)) ∂μ.trim hmA) ≤ ∫⁻ ω, B.indicator (fun _ => ofReal δ) ω ∂μ.trim hmA := by apply lintegral_mono intro ω change ν (Prod.mk ω ⁻¹' ({p | p.2 ∈ Bad p.1} ∩ fst ⁻¹' B)) ≤ B.indicator (fun _ => ofReal δ) ω by_cases hω : ω ∈ B · have he : Prod.mk ω ⁻¹' ({p | p.2 ∈ Bad p.1} ∩ fst ⁻¹' B) = Bad ω := by ext x simp [hω] rw [he] simpa [hω] using hsec ω · have he : Prod.mk ω ⁻¹' ({p | p.2 ∈ Bad p.1} ∩ fst ⁻¹' B) = ∅ := by ext x simp [hω] simp [he, hω] _ = ofReal δ * μ B := by rw [lintegral_indicator hB, lintegral_const, Measure.restrict_apply_univ, trim_measurableSet_eq hmA hB]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.randomParam_event_inter_le · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/RkhsEmpiricalMean.lean:25
theorem unitNormFeatureMap_dist_le

Every realization of the Gaussian kernel is sqrt 2-Lipschitz. the stated conclusion follows.

Formal statement
a b :
‖U.Φ a - U.Φ b‖ ≤ sqrt 2 * |a - b|
Proof (Lean source)
-- @node: unitNormFeatureMap_dist_le lemma unitNormFeatureMap_dist_le {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℝ H] (U : UnitNormFeatureMap H) (a b : ℝ) : ‖U.Φ a - U.Φ b‖ ≤ sqrt 2 * |a - b| := by have hsqrt : 0 ≤ sqrt 2 := Real.sqrt_nonneg _ have hsqrt_sq : (sqrt 2) ^ 2 = 2 := by norm_num have hexp := Real.one_sub_le_exp_neg ((a - b) ^ 2) have hsq : ‖U.Φ a - U.Φ b‖ ^ 2 ≤ 2 * (a - b) ^ 2 := by rw [unitNormFeatureMap_dist_sq U] unfold gaussianKernel nlinarith have habs : 0 ≤ |a - b| := abs_nonneg _ apply (sq_le_sq₀ (norm_nonneg _) (mul_nonneg hsqrt habs)).mp calc ‖U.Φ a - U.Φ b‖ ^ 2 ≤ 2 * (a - b) ^ 2 := hsq _ = (sqrt 2 * |a - b|) ^ 2 := by rw [mul_pow, hsqrt_sq, sq_abs]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.unitNormFeatureMap_dist_le · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/RkhsEmpiricalMean.lean:88
theorem meanEmbedding_map_sub_le_l1

Gaussian mean embeddings are controlled by sqrt 2 times the input distance. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
f g :
X → ℝ
hf :
hg :
hfg :
Integrable (fun x => |f x - g x|) μ
‖meanEmbedding U (Measure.map f μ) - meanEmbedding U (Measure.map g μ)‖
sqrt 2 * ∫ x, |f x - g x| ∂μ
Proof (Lean source)
-- @node: meanEmbedding_map_sub_le_l1 lemma meanEmbedding_map_sub_le_l1 {X H : Type*} [MeasurableSpace X] [NormedAddCommGroup H] [InnerProductSpace ℝ H] [CompleteSpace H] (U : UnitNormFeatureMap H) (μ : Measure X) [IsProbabilityMeasure μ] (f g : X → ℝ) (hf : Measurable f) (hg : Measurable g) (hfg : Integrable (fun x => |f x - g x|) μ) : ‖meanEmbedding U (Measure.map f μ) - meanEmbedding U (Measure.map g μ)‖ ≤ sqrt 2 * ∫ x, |f x - g x| ∂μ := by have hΦf : Integrable (fun x => U.Φ (f x)) μ := Integrable.of_bound ((unitNormFeatureMap_stronglyMeasurable U).comp_measurable hf).aestronglyMeasurable 1 (Filter.Eventually.of_forall fun x => by rw [U.norm_eq_one]) have hΦg : Integrable (fun x => U.Φ (g x)) μ := Integrable.of_bound ((unitNormFeatureMap_stronglyMeasurable U).comp_measurable hg).aestronglyMeasurable 1 (Filter.Eventually.of_forall fun x => by rw [U.norm_eq_one]) unfold meanEmbedding rw [integral_map hf.aemeasurable (unitNormFeatureMap_stronglyMeasurable U).aestronglyMeasurable, integral_map hg.aemeasurable (unitNormFeatureMap_stronglyMeasurable U).aestronglyMeasurable, ← integral_sub hΦf hΦg] calc ‖∫ x, U.Φ (f x) - U.Φ (g x) ∂μ‖ ≤ ∫ x, ‖U.Φ (f x) - U.Φ (g x)‖ ∂μ := norm_integral_le_integral_norm _ _ ≤ ∫ x, sqrt 2 * |f x - g x| ∂μ := by exact integral_mono_ae (hΦf.sub hΦg).norm (hfg.const_mul _) (Filter.Eventually.of_forall fun x => unitNormFeatureMap_dist_le U (f x) (g x)) _ = sqrt 2 * ∫ x, |f x - g x| ∂μ := integral_const_mul _ _
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.meanEmbedding_map_sub_le_l1 · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/RkhsEmpiricalMean.lean:142
def fittedMeanEmbedding

Conditional population embedding of the fitted ratio under environment e.

Definition (Lean source)
n :
DAG (Fin n)
W :
S :
e :
Fin (n + 1)
i :
Fin n
ω :
Ω
fittedMeanEmbedding S U e i ω :
H
meanEmbedding U (Measure.map (S.ratioEstimate ω i) (W.law e))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.fittedMeanEmbedding · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/RkhsEmpiricalMean.lean:175
theorem bounded_rkhs_empirical_mean Lemma 8 in the paper ↗

Conditional on training, all environment/ratio empirical feature means obey the stated unit-norm Hilbert-space deviation bound with probability at least 1-α. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
S :
hn :
1 ≤ n
hN :
∀ e, 1 ≤ S.sampleSize e
:
S.alpha ∈ Ioo (0 : ℝ) 1
ConditionalProbabilityAtLeast S.probability (comap (trainingFold S) inferInstance) {ω | ∀ i : Fin n, ∀ e : Fin (n + 1), ‖empiricalMeanEmbedding S U e i ω - fittedMeanEmbedding S U e i ω‖ ≤ (1 + sqrt (2 * log ((n : ℝ) * (n + 1 : ℝ) / S.alpha))) / sqrt (minimumSampleSize S)} univ (1 - S.alpha)
Proof (Lean source)
lemma bounded_rkhs_empirical_mean {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} {W : ObservedWorld G θ} {Ω H : Type*} [mΩ : MeasurableSpace Ω] [NormedAddCommGroup H] [InnerProductSpace ℝ H] [CompleteSpace H] [MeasurableSpace H] [BorelSpace H] (S : SampleSplitWorld W Ω) (U : UnitNormFeatureMap H) (hSampling : ConditionalEvaluationSampling S) (hn : 1 ≤ n) (hN : ∀ e, 1 ≤ S.sampleSize e) (hα : S.alpha ∈ Ioo (0 : ℝ) 1) : ConditionalProbabilityAtLeast S.probability (comap (trainingFold S) inferInstance) {ω | ∀ i : Fin n, ∀ e : Fin (n + 1), ‖empiricalMeanEmbedding S U e i ω - fittedMeanEmbedding S U e i ω‖ ≤ (1 + sqrt (2 * log ((n : ℝ) * (n + 1 : ℝ) / S.alpha))) / sqrt (minimumSampleSize S)} univ (1 - S.alpha) := by classical rcases hSampling with ⟨hprob, hlaw, htrain, hevalMeas, hevalIndep, hevalLaw, hsplit, hratioJoint⟩ letI : IsProbabilityMeasure S.probability := hprob have hmA : trainingSigma S ≤ mΩ := htrain.comap_le have hmin (e : Fin (n + 1)) : minimumSampleSize S ≤ S.sampleSize e := Finset.inf'_le S.sampleSize (Finset.mem_univ e) have hmin_pos : 0 < minimumSampleSize S := by rw [minimumSampleSize] exact lt_of_lt_of_le Nat.zero_lt_one (Finset.le_inf' ⟨0, Finset.mem_univ 0⟩ S.sampleSize (fun e _ => hN e)) let δ : ℝ := S.alpha / ((n : ℝ) * (n + 1 : ℝ)) have hnR : 0 < (n : ℝ) := by exact_mod_cast (lt_of_lt_of_le Nat.zero_lt_one hn) have hn1 : (1 : ℝ) ≤ n := by exact_mod_cast hn have hK : 1 ≤ (n : ℝ) * (n + 1 : ℝ) := by calc (1 : ℝ) = 1 * 1 := by ring _ ≤ (n : ℝ) * (n + 1 : ℝ) := mul_le_mul hn1 (by linarith) (by norm_num) hnR.le have hδpos : 0 < δ := by dsimp [δ] exact div_pos hα.1 (mul_pos hnR (by linarith)) have hδone : δ < 1 := by dsimp [δ] exact (div_le_self hα.1.le hK).trans_lt hα.2 have hradius (e : Fin (n + 1)) : 1 / sqrt (S.sampleSize e) + sqrt (2 * log (1 / δ) / S.sampleSize e) ≤ (1 + sqrt (2 * log ((n : ℝ) * (n + 1 : ℝ) / S.alpha))) / sqrt (minimumSampleSize S) := by have hm0 : 0 < (S.sampleSize e : ℝ) := by exact_mod_cast hN e have hmin0 : 0 < (minimumSampleSize S : ℝ) := by exact_mod_cast hmin_pos have hle : sqrt (minimumSampleSize S) ≤ sqrt (S.sampleSize e) := Real.sqrt_le_sqrt (by exact_mod_cast hmin e) have hlogarg : 1 / δ = (n : ℝ) * (n + 1 : ℝ) / S.alpha := by dsimp [δ] field_simp have hratio_one : 1 ≤ (n : ℝ) * (n + 1 : ℝ) / S.alpha := by apply (le_div_iff₀ hα.1).2 simpa only [one_mul] using hα.2.le.trans hK have hlog_nonneg : 0 ≤ 2 * log ((n : ℝ) * (n + 1 : ℝ) / S.alpha) := by exact mul_nonneg (by norm_num) (Real.log_nonneg hratio_one) rw [hlogarg, Real.sqrt_div hlog_nonneg] have hnum : 0 ≤ 1 + sqrt (2 * log ((n : ℝ) * (n + 1 : ℝ) / S.alpha)) := by positivity rw [← add_div] exact div_le_div_of_nonneg_left hnum (Real.sqrt_pos.2 hmin0) hle intro B hB have hBfull : @MeasurableSet Ω mΩ B := hmA B hB have hpair (i : Fin n) (e : Fin (n + 1)) : MeasurableSet {ω | (1 / sqrt (S.sampleSize e) + sqrt (2 * log (1 / δ) / S.sampleSize e)) < ‖empiricalMeanEmbedding S U e i ω - fittedMeanEmbedding S U e i ω‖} ∧ S.probability ({ω | (1 / sqrt (S.sampleSize e) + sqrt (2 * log (1 / δ) / S.sampleSize e)) < ‖empiricalMeanEmbedding S U e i ω - fittedMeanEmbedding S U e i ω‖} ∩ B) ≤ ofReal δ * S.probability B := by let Y : Ω → (Fin (S.sampleSize e) → LatentState n) := fun ω r => S.evaluation e r ω have hY : Measurable Y := by apply measurable_pi_lambda intro r exact hevalMeas e r let ν : Measure (Fin (S.sampleSize e) → LatentState n) := Measure.pi (fun _ => W.law e) letI : IsProbabilityMeasure ν := by dsimp [ν]; infer_instance have hYlaw : S.probability.map Y = ν := by have hp := (ProbabilityTheory.iIndepFun_iff_map_fun_eq_pi_map (fun r => (hevalMeas e r).aemeasurable)).mp (hevalIndep e) calc S.probability.map Y = Measure.pi (fun r => S.probability.map (S.evaluation e r)) := hp _ = ν := by congr 1 funext r exact hevalLaw e r have hindepY : @Indep Ω (trainingSigma S) (comap Y inferInstance) mΩ S.probability := by change IndepFun (trainingFold S) Y S.probability have he : Measurable (fun z : (∀ e, Fin (S.sampleSize e) → LatentState n) => z e) := measurable_pi_apply e convert hsplit.comp measurable_id he using 1 <;> rfl let f : Ω → LatentState n → H := fun ω x => U.Φ (@SampleSplitWorld.ratioEstimate n G θ W Ω mΩ S ω i x) have hf_joint : @StronglyMeasurable (Ω × LatentState n) H inferInstance ((trainingSigma S).prod inferInstance) (uncurry f) := by apply (unitNormFeatureMap_stronglyMeasurable U).comp_measurable exact hratioJoint i have hf_int : @StronglyMeasurable Ω H inferInstance (trainingSigma S) (fun ω => ∫ x, f ω x ∂W.law e) := @MeasureTheory.StronglyMeasurable.integral_prod_right Ω (LatentState n) H (trainingSigma S) inferInstance (W.law e) inferInstance inferInstance inferInstance f hf_joint have hf_eval (r : Fin (S.sampleSize e)) : @StronglyMeasurable (Ω × (Fin (S.sampleSize e) → LatentState n)) H inferInstance ((trainingSigma S).prod inferInstance) (fun p => f p.1 (p.2 r)) := by exact hf_joint.comp_measurable (prodMk measurable_fst ((measurable_pi_apply r).comp measurable_snd)) let Bad : Ω → Set (Fin (S.sampleSize e) → LatentState n) := fun ω => {z | 1 / sqrt (S.sampleSize e) + sqrt (2 * log (1 / δ) / S.sampleSize e) < ‖(S.sampleSize e : ℝ)⁻¹ • ∑ r, f ω (z r) - ∫ x, f ω x ∂W.law e‖} have hBad : @MeasurableSet (Ω × (Fin (S.sampleSize e) → LatentState n)) ((trainingSigma S).prod inferInstance) {p | p.2 ∈ Bad p.1} := by change @MeasurableSet (Ω × (Fin (S.sampleSize e) → LatentState n)) ((trainingSigma S).prod inferInstance) {(p : Ω × (Fin (S.sampleSize e) → LatentState n)) | (1 / sqrt (S.sampleSize e) + sqrt (2 * log (1 / δ) / S.sampleSize e)) < ‖(S.sampleSize e : ℝ)⁻¹ • ∑ r, f p.1 (p.2 r) - ∫ x, f p.1 x ∂W.law e‖} apply measurableSet_lt measurable_const apply StronglyMeasurable.measurable apply StronglyMeasurable.norm apply StronglyMeasurable.sub · apply StronglyMeasurable.const_smul rw [← Finset.sum_fn] exact Finset.stronglyMeasurable_sum _ (fun r _ => hf_eval r) · exact hf_int.comp_measurable measurable_fst have hsec (ω : Ω) : ν (Bad ω) ≤ ofReal δ := by have ht := centeredEmpiricalMean_norm_tail_le (W.law e) (f ω) ((unitNormFeatureMap_stronglyMeasurable U).comp_measurable (S.ratioFit_measurable (trainingFold S ω) i)) (fun x => by rw [U.norm_eq_one]) (hN e) hδpos hδone have hne : ν (Bad ω) ≠ ⊤ := measure_ne_top _ _ rw [← ENNReal.ofReal_toReal hne] exact ENNReal.ofReal_le_ofReal (by simpa [ν, Bad, f] using ht) have hJ : @Measurable Ω (Ω × (Fin (S.sampleSize e) → LatentState n)) mΩ ((trainingSigma S).prod inferInstance) (fun ω => (ω, Y ω)) := (measurable_id'' hmA).prod hY have hevent : MeasurableSet {ω | Y ω ∈ Bad ω} := by change MeasurableSet ((fun ω => (ω, Y ω)) ⁻¹' {p | p.2 ∈ Bad p.1}) exact hBad.preimage hJ have hraw := randomParam_event_inter_le hY hYlaw (trainingSigma S) hmA hindepY Bad hBad hsec B hB have heq : {ω | Y ω ∈ Bad ω} = {ω | (1 / sqrt (S.sampleSize e) + sqrt (2 * log (1 / δ) / S.sampleSize e)) < ‖empiricalMeanEmbedding S U e i ω - fittedMeanEmbedding S U e i ω‖} := by ext ω simp only [Y, Bad, f, Set.mem_setOf_eq] unfold empiricalMeanEmbedding fittedMeanEmbedding meanEmbedding have hint : (∫ r, U.Φ r ∂Measure.map (S.ratioEstimate ω i) (W.law e)) = ∫ x, U.Φ (S.ratioEstimate ω i x) ∂W.law e := integral_map (S.ratioFit_measurable (trainingFold S ω) i).aemeasurable (unitNormFeatureMap_stronglyMeasurable U).aestronglyMeasurable rw [hint] rw [heq] at hevent hraw exact ⟨hevent, hraw⟩ let BadPair : Fin n × Fin (n + 1) → Set Ω := fun ie => {ω | (1 / sqrt (S.sampleSize ie.2) + sqrt (2 * log (1 / δ) / S.sampleSize ie.2)) < ‖empiricalMeanEmbedding S U ie.2 ie.1 ω - fittedMeanEmbedding S U ie.2 ie.1 ω‖} let BadAll : Set Ω := ⋃ ie, BadPair ie have hBadAllMeas : MeasurableSet BadAll := by dsimp only [BadAll] exact MeasurableSet.iUnion fun ie => (hpair ie.1 ie.2).1 have hUnion : S.probability (BadAll ∩ B) ≤ ofReal S.alpha * S.probability B := by calc S.probability (BadAll ∩ B) = S.probability (⋃ ie, BadPair ie ∩ B) := by congr 1 dsimp only [BadAll] ext ω simp _ ≤ ∑ ie : Fin n × Fin (n + 1), S.probability (BadPair ie ∩ B) := measure_iUnion_fintype_le _ _ _ ≤ ∑ _ie : Fin n × Fin (n + 1), (ofReal δ * S.probability B) := by gcongr with ie exact (hpair ie.1 ie.2).2 _ = ofReal S.alpha * S.probability B := by simp only [Finset.sum_const, Fintype.card_prod, Fintype.card_fin, nsmul_eq_mul] have hcoeff : ((Finset.univ : Finset (Fin n × Fin (n + 1))).card : ENNReal) * ofReal δ = ofReal S.alpha := by rw [← ENNReal.ofReal_natCast, ← ENNReal.ofReal_mul (by positivity : 0 ≤ ((Finset.univ : Finset (Fin n × Fin (n + 1))).card : ℝ))] congr 1 simp only [Finset.card_univ, Fintype.card_prod, Fintype.card_fin, Nat.cast_mul, Nat.cast_add, cast_one] dsimp [δ] field_simp calc ((Finset.univ : Finset (Fin n × Fin (n + 1))).card : ENNReal) * (ofReal δ * S.probability B) = (((Finset.univ : Finset (Fin n × Fin (n + 1))).card : ENNReal) * ofReal δ) * S.probability B := (mul_assoc _ _ _).symm _ = _ := by rw [hcoeff] let Good : Set Ω := {ω | ∀ i : Fin n, ∀ e : Fin (n + 1), ‖empiricalMeanEmbedding S U e i ω - fittedMeanEmbedding S U e i ω‖ ≤ (1 + sqrt (2 * log ((n : ℝ) * (n + 1 : ℝ) / S.alpha))) / sqrt (minimumSampleSize S)} have hgood : B \ BadAll ⊆ Good ∩ univ ∩ B := by intro ω hω dsimp only [BadAll] at hω simp only [Set.mem_diff, Set.mem_iUnion, not_exists, BadPair, Set.mem_setOf_eq, Set.mem_inter_iff, Set.mem_univ, true_and] at hω ⊢ refine ⟨⟨?_, trivial⟩, hω.1⟩ intro i e exact (not_lt.mp (hω.2 (i, e))).trans (hradius e) have hBfinite : S.probability B ≠ ⊤ := measure_ne_top _ _ have hbadfinite : S.probability (BadAll ∩ B) ≠ ⊤ := measure_ne_top _ _ have hmeasure : S.probability B - S.probability (BadAll ∩ B) ≤ S.probability (Good ∩ univ ∩ B) := by rw [← measure_diff Set.inter_subset_right ((hBadAllMeas.inter hBfull).nullMeasurableSet) hbadfinite] apply measure_mono intro ω hω refine hgood ⟨hω.1, ?_⟩ exact fun hbad => hω.2 ⟨hbad, hω.1⟩ have hbadB : S.probability (BadAll ∩ B) ≤ S.probability B := measure_mono (Set.inter_subset_right) have hUnionReal : (S.probability (BadAll ∩ B)).toReal ≤ -- … truncated; follow the source link for the rest …
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.bounded_rkhs_empirical_mean · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/RkhsEmpiricalMean.lean:187
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.WitnessAssembly 14 declarations This file isolates the pointwise cancellations that turn the sparse and cancellation witness expectations into the low-dimensional integrals used by the certificate proof.

Explicit-witness density algebra

This file isolates the pointwise cancellations that turn the sparse and cancellation witness expectations into the low-dimensional integrals used by the certificate proof.

theorem integral_fin_three_pi_eq_iterated Lemma integral_fin_three_pi_eq_iterated in the paper ↗

Fubini's theorem for a three-coordinate product measure, written in the explicit coordinate order used by the witness calculations. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
μ :
f :
(Fin 3 → ℝ) → ℝ
hf :
Integrable f (Measure.pi fun _ : Fin 3 => μ)
(∫ v, f v ∂Measure.pi fun _ : Fin 3 => μ) = ∫ x, (∫ y, (∫ z, f ![x, y, z] ∂μ) ∂μ) ∂μ
Proof (Lean source)
lemma integral_fin_three_pi_eq_iterated (μ : Measure ℝ) [SigmaFinite μ] (f : (Fin 3 → ℝ) → ℝ) (hf : Integrable f (Measure.pi fun _ : Fin 3 => μ)) : (∫ v, f v ∂Measure.pi fun _ : Fin 3 => μ) = ∫ x, (∫ y, (∫ z, f ![x, y, z] ∂μ) ∂μ) ∂μ := by let e3 := MeasurableEquiv.piFinSuccAbove (fun _ : Fin 3 => ℝ) 0 have he3 := (measurePreserving_piFinSuccAbove (fun _ : Fin 3 => μ) 0).symm have hf3 : Integrable (f ∘ e3.symm) (μ.prod (Measure.pi fun _ : Fin 2 => μ)) := (he3.integrable_comp_emb e3.symm.measurableEmbedding).2 hf rw [← he3.integral_comp e3.symm.measurableEmbedding] have hf3' := hf3 change Integrable (fun z => f ((MeasurableEquiv.piFinSuccAbove (fun _ : Fin 3 => ℝ) 0).symm z)) (μ.prod (Measure.pi fun _ : Fin 2 => μ)) at hf3' rw [integral_prod _ hf3'] apply integral_congr_ae filter_upwards [hf3.prod_right_ae] with x hfx let e2 := MeasurableEquiv.piFinSuccAbove (fun _ : Fin 2 => ℝ) 0 have he2 := (measurePreserving_piFinSuccAbove (fun _ : Fin 2 => μ) 0).symm have hf2 : Integrable ((fun v => f (e3.symm (x, v))) ∘ e2.symm) (μ.prod (Measure.pi fun _ : Fin 1 => μ)) := (he2.integrable_comp_emb e2.symm.measurableEmbedding).2 hfx rw [← he2.integral_comp e2.symm.measurableEmbedding] have hf2' := hf2 change Integrable (fun z => f (e3.symm (x, e2.symm z))) (μ.prod (Measure.pi fun _ : Fin 1 => μ)) at hf2' rw [integral_prod _ hf2'] simp only [e3, e2, MeasurableEquiv.piFinSuccAbove_symm_apply, Fin.insertNthEquiv, Fin.insertNth_zero] apply integral_congr_ae filter_upwards [hf2'.prod_right_ae] with y hfy let e1 := MeasurableEquiv.piUnique (fun _ : Fin 1 => ℝ) have he1 := (measurePreserving_piUnique (fun _ : Fin 1 => μ)).symm rw [← he1.integral_comp e1.symm.measurableEmbedding] apply integral_congr_ae filter_upwards with z congr 1 funext i fin_cases i <;> rfl
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.integral_fin_three_pi_eq_iterated · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessAssembly.lean:19
theorem sparse_observationalDensity_mul_ratio_sq

In the sparse observational law, one child-density factor cancels from the square of the explicit child ratio. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
s :
v :
hv :
v ∈ latentCube 3
observationalDensity (sparseWitness s) v * (((sparseWitness s).q 1 (v 1) / (sparseWitness s).p 1 v) ^ 2)
= ((sparseWitness s).q 1 (v 1)) ^ 2 / (sparseWitness s).p 1 v
Proof (Lean source)
lemma sparse_observationalDensity_mul_ratio_sq (s : SignVector 3) (v : LatentState 3) (hv : v ∈ latentCube 3) : observationalDensity (sparseWitness s) v * (((sparseWitness s).q 1 (v 1) / (sparseWitness s).p 1 v) ^ 2) = ((sparseWitness s).q 1 (v 1)) ^ 2 / (sparseWitness s).p 1 v := by have hp : (sparseWitness s).p 1 v ≠ 0 := ne_of_gt ((sparseWitness_positive_normalized_smooth s).1 1 v hv) simp only [observationalDensity] simp [sparseWitness, sparseP] field_simp
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparse_observationalDensity_mul_ratio_sq · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessAssembly.lean:61
theorem sparse_parentInterventionalDensity_mul_ratio_sq

Under the sparse parent intervention, the same cancellation leaves the parent tilt multiplying the reduced child integrand. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
s :
v :
hv :
v ∈ latentCube 3
interventionalDensity (sparseWitness s) 0 v * (((sparseWitness s).q 1 (v 1) / (sparseWitness s).p 1 v) ^ 2)
= (sparseWitness s).q 0 (v 0) * (((sparseWitness s).q 1 (v 1)) ^ 2 / (sparseWitness s).p 1 v)
Proof (Lean source)
lemma sparse_parentInterventionalDensity_mul_ratio_sq (s : SignVector 3) (v : LatentState 3) (hv : v ∈ latentCube 3) : interventionalDensity (sparseWitness s) 0 v * (((sparseWitness s).q 1 (v 1) / (sparseWitness s).p 1 v) ^ 2) = (sparseWitness s).q 0 (v 0) * (((sparseWitness s).q 1 (v 1)) ^ 2 / (sparseWitness s).p 1 v) := by have hp : (sparseWitness s).p 1 v ≠ 0 := ne_of_gt ((sparseWitness_positive_normalized_smooth s).1 1 v hv) simp only [interventionalDensity] simp [sparseWitness, sparseP] field_simp
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparse_parentInterventionalDensity_mul_ratio_sq · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessAssembly.lean:75
theorem cancellation_density_difference_mul_test

The cancellation witness's parent-interventional minus observational test integrand factors into the parent tilt and the child test integrand. the stated conclusion follows.

Formal statement
s :
v :
psi :
ℝ → ℝ
(interventionalDensity (cancellationWitness s) 0 v - observationalDensity (cancellationWitness s) v) * psi ((cancellationWitness s).q 1 (v 1) / (cancellationWitness s).p 1 v)
= ((cancellationWitness s).q 0 (v 0) - 1) * ((cancellationWitness s).p 1 v * psi ((cancellationWitness s).q 1 (v 1) / (cancellationWitness s).p 1 v))
Proof (Lean source)
lemma cancellation_density_difference_mul_test (s : SignVector 3) (v : LatentState 3) (psi : ℝ → ℝ) : (interventionalDensity (cancellationWitness s) 0 v - observationalDensity (cancellationWitness s) v) * psi ((cancellationWitness s).q 1 (v 1) / (cancellationWitness s).p 1 v) = ((cancellationWitness s).q 0 (v 0) - 1) * ((cancellationWitness s).p 1 v * psi ((cancellationWitness s).q 1 (v 1) / (cancellationWitness s).p 1 v)) := by simp only [interventionalDensity, observationalDensity] simp [cancellationWitness, cancellationP] ring
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellation_density_difference_mul_test · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessAssembly.lean:90
theorem cancellation_factored_test_eq_reflected_integrand

Expanding the cancellation witness identifies its factored density difference with the reflected two-coordinate integrand from the FTC argument. the stated conclusion follows.

Formal statement
s :
v :
psi :
ℝ → ℝ
((cancellationWitness s).q 0 (v 0) - 1) * ((cancellationWitness s).p 1 v * psi ((cancellationWitness s).q 1 (v 1) / (cancellationWitness s).p 1 v))
Proof (Lean source)
lemma cancellation_factored_test_eq_reflected_integrand (s : SignVector 3) (v : LatentState 3) (psi : ℝ → ℝ) : ((cancellationWitness s).q 0 (v 0) - 1) * ((cancellationWitness s).p 1 v * psi ((cancellationWitness s).q 1 (v 1) / (cancellationWitness s).p 1 v)) = (exponentialInterventionDensity (reflectedCoordinate s 0 (v 0)) - 1) * ((1 + (1 / 10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (reflectedCoordinate s 1 (v 1))) * psi (exponentialInterventionDensity (reflectedCoordinate s 1 (v 1)) / (1 + (1 / 10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (reflectedCoordinate s 1 (v 1))))) := by simp [cancellationWitness, sparseQ, cancellationP]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellation_factored_test_eq_reflected_integrand · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessAssembly.lean:107
theorem cancellation_density_difference_eq_reflected_integrand

The full density difference against a ratio-law test function is exactly the reflected two-coordinate cancellation integrand. the stated conclusion follows.

Formal statement
s :
v :
psi :
ℝ → ℝ
Proof (Lean source)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellation_density_difference_eq_reflected_integrand · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessAssembly.lean:126
theorem cancellation_reflected_iterated_test_integral_zero

Coordinate reflections preserve the complete cancellation integral, so it vanishes for every prescribed sign vector. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
s :
psi :
ℝ → ℝ
hpsi :
∫ y in Icc (0 : ℝ) 1, ∫ x in Icc (0 : ℝ) 1, (exponentialInterventionDensity (reflectedCoordinate s 0 x) - 1) * ((1 + (1 / 10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 x) * centeredCoordinate (reflectedCoordinate s 1 y)) * psi (exponentialInterventionDensity (reflectedCoordinate s 1 y) / (1 + (1 / 10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 x) * centeredCoordinate (reflectedCoordinate s 1 y))))
= 0
Proof (Lean source)
lemma cancellation_reflected_iterated_test_integral_zero (s : SignVector 3) (psi : ℝ → ℝ) (hpsi : Continuous psi) : ∫ y in Icc (0 : ℝ) 1, ∫ x in Icc (0 : ℝ) 1, (exponentialInterventionDensity (reflectedCoordinate s 0 x) - 1) * ((1 + (1 / 10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 x) * centeredCoordinate (reflectedCoordinate s 1 y)) * psi (exponentialInterventionDensity (reflectedCoordinate s 1 y) / (1 + (1 / 10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 x) * centeredCoordinate (reflectedCoordinate s 1 y)))) = 0 := by let J : ℝ → ℝ → ℝ := fun x y => (exponentialInterventionDensity x - 1) * ((1 + (1 / 10 : ℝ) * cancellationPrimitive x * centeredCoordinate y) * psi (exponentialInterventionDensity y / (1 + (1 / 10 : ℝ) * cancellationPrimitive x * centeredCoordinate y))) change (∫ y in Icc (0 : ℝ) 1, ∫ x in Icc (0 : ℝ) 1, J (reflectedCoordinate s 0 x) (reflectedCoordinate s 1 y)) = 0 calc _ = ∫ y in Icc (0 : ℝ) 1, ∫ x in Icc (0 : ℝ) 1, J x (reflectedCoordinate s 1 y) := by apply integral_congr_ae filter_upwards with y exact integral_reflectedCoordinate s 0 (fun x => J x (reflectedCoordinate s 1 y)) _ = ∫ y in Icc (0 : ℝ) 1, ∫ x in Icc (0 : ℝ) 1, J x y := integral_reflectedCoordinate s 1 (fun y => ∫ x in Icc (0 : ℝ) 1, J x y) _ = 0 := cancellation_iterated_test_integral_zero psi hpsi
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellation_reflected_iterated_test_integral_zero · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessAssembly.lean:146
theorem measurable_sparseQ

The reflected exponential intervention slots are globally measurable.

Formal statement
s :
i :
Fin 3
Proof (Lean source)
@[fun_prop] lemma measurable_sparseQ (s : SignVector 3) (i : Fin 3) : Measurable (sparseQ s i) := by rcases s.signed i with hi | hi · unfold sparseQ exponentialInterventionDensity reflectedCoordinate reflect rw [hi] norm_num fun_prop · unfold sparseQ exponentialInterventionDensity reflectedCoordinate reflect rw [hi] simp only [if_pos] fun_prop
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.measurable_sparseQ · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessAssembly.lean:180
theorem measurable_cancellationP

Every cancellation-witness observational mechanism slot is globally measurable.

Formal statement
s :
i :
Fin 3
Proof (Lean source)
@[fun_prop] lemma measurable_cancellationP (s : SignVector 3) (i : Fin 3) : Measurable (cancellationP s i) := by fin_cases i · change Measurable (fun _ : LatentState 3 => (1 : ℝ)) fun_prop · rcases s.signed 0 with h0 | h0 <;> rcases s.signed 1 with h1 | h1 <;> change Measurable (fun v : LatentState 3 => 1 + (1 / 10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (reflectedCoordinate s 1 (v 1))) <;> simp [cancellationPrimitive, centeredCoordinate, reflectedCoordinate, reflect, h0, h1, show (-1 : ℝ) ≠ 1 by norm_num] <;> fun_prop · change Measurable (fun _ : LatentState 3 => (1 : ℝ)) fun_prop
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.measurable_cancellationP · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessAssembly.lean:194
theorem measurable_cancellationWitness_observationalDensity

The cancellation witness's observational joint density is globally measurable.

Formal statement
s :
Measurable (observationalDensity (cancellationWitness s))
Proof (Lean source)
@[fun_prop] lemma measurable_cancellationWitness_observationalDensity (s : SignVector 3) : Measurable (observationalDensity (cancellationWitness s)) := by unfold observationalDensity apply Finset.measurable_prod intro i _ exact measurable_cancellationP s i
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.measurable_cancellationWitness_observationalDensity · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessAssembly.lean:211
theorem measurable_cancellationWitness_interventionalDensity

Every cancellation-witness interventional joint density is globally measurable.

Formal statement
s :
j :
Fin 3
Proof (Lean source)
@[fun_prop] lemma measurable_cancellationWitness_interventionalDensity (s : SignVector 3) (j : Fin 3) : Measurable (interventionalDensity (cancellationWitness s) j) := by unfold interventionalDensity apply (measurable_sparseQ s j).comp (measurable_pi_apply j) |>.mul apply Finset.measurable_prod intro i _ exact measurable_cancellationP s i
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.measurable_cancellationWitness_interventionalDensity · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessAssembly.lean:220
theorem measurableSet_latentCube Lemma measurableSet_latentCube in the paper ↗

The finite latent unit cube is measurable. the stated conclusion follows.

Formal statement
n :
Proof (Lean source)
lemma measurableSet_latentCube (n : ℕ) : MeasurableSet (latentCube n) := by rw [latentCube] exact MeasurableSet.univ_pi fun _ => measurableSet_Icc
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.measurableSet_latentCube · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessAssembly.lean:231
theorem cancellationWitness_ratioLaws_eq

The cancellation witness has exactly the same child-ratio law before and after intervening on its parent. the stated conclusion follows.

Formal statement
Proof (Lean source)
lemma cancellationWitness_ratioLaws_eq (s : SignVector 3) : let W := canonicalObservedWorld threeNodeDAG (cancellationWitness s) (refl (Fin 3)) observationalRatioLaw W 1 = interventionalRatioLaw W 0 1 := by dsimp only let θ := cancellationWitness s let W := canonicalObservedWorld threeNodeDAG θ (refl (Fin 3)) have hpos : PositiveNormalizedSmoothMechanisms threeNodeDAG θ := cancellationWitness_positive_normalized_smooth s letI : IsProbabilityMeasure (observationalLaw θ) := observationalLaw_isProbabilityMeasure hpos letI : IsProbabilityMeasure (interventionalLaw θ ((refl (Fin 3)) 0)) := interventionalLaw_isProbabilityMeasure W hpos 0 letI : IsFiniteMeasure (W.law 0) := by change IsFiniteMeasure (observationalLaw θ) infer_instance letI : IsFiniteMeasure (W.law (succ 0)) := by change IsFiniteMeasure (interventionalLaw θ ((refl (Fin 3)) 0)) infer_instance have hratio : Measurable (fun v : LatentState 3 => θ.q ((refl (Fin 3)) 1) (v ((refl (Fin 3)) 1)) / θ.p ((refl (Fin 3)) 1) v) := by dsimp only [θ] change Measurable ((sparseQ s 1 ∘ fun v : LatentState 3 => v 1) / cancellationP s 1) exact ((measurable_sparseQ s 1).comp (measurable_pi_apply 1)).div (measurable_cancellationP s 1) apply ratioLaws_eq_of_boundedContinuous_integrals_eq W 0 1 intro ψ rw [canonical_observationalRatioLaw_eq_mechanismRatio_map hpos (refl (Fin 3)) 1, canonical_interventionalRatioLaw_eq_mechanismRatio_map hpos (refl (Fin 3)) 0 1] rw [MeasureTheory.integral_map] · rw [MeasureTheory.integral_map] · simp only [Equiv.refl_apply] let ratio : LatentState 3 → ℝ := fun v => θ.q 1 (v 1) / θ.p 1 v let μ : Measure (LatentState 3) := volume.restrict (latentCube 3) have hobs : (∫ v, ψ (ratio v) ∂observationalLaw θ) = ∫ v, observationalDensity θ v * ψ (ratio v) ∂μ := by unfold observationalLaw rw [integral_withDensity_eq_integral_toReal_smul] · apply integral_congr_ae filter_upwards [ae_restrict_mem (measurableSet_latentCube 3)] with v hv rw [ENNReal.toReal_ofReal (le_of_lt (by unfold observationalDensity exact Finset.prod_pos fun i _ => hpos.1 i v hv))] rfl · exact (measurable_cancellationWitness_observationalDensity s).ennreal_ofReal · filter_upwards with v exact ENNReal.ofReal_lt_top have hint : (∫ v, ψ (ratio v) ∂interventionalLaw θ 0) = ∫ v, interventionalDensity θ 0 v * ψ (ratio v) ∂μ := by unfold interventionalLaw rw [integral_withDensity_eq_integral_toReal_smul] · apply integral_congr_ae filter_upwards [ae_restrict_mem (measurableSet_latentCube 3)] with v hv rw [ENNReal.toReal_ofReal (le_of_lt (by unfold interventionalDensity exact mul_pos (hpos.2.1 0 (v 0) (hv 0 (Set.mem_univ 0))) (Finset.prod_pos fun i _ => hpos.1 i v hv)))] rfl · exact (measurable_cancellationWitness_interventionalDensity s 0).ennreal_ofReal · filter_upwards with v exact ENNReal.ofReal_lt_top rw [hobs, hint] have hcubeCompact : IsCompact (latentCube 3) := by rw [latentCube] exact isCompact_univ_pi fun _ => isCompact_Icc have hratioCont : ContinuousOn ratio (latentCube 3) := by apply ((hpos.2.2.2.1 1).continuousOn.comp ((continuous_apply 1).continuousOn) (fun (v : LatentState 3) (hv : v ∈ latentCube 3) => hv 1 (Set.mem_univ 1))).div ((hpos.2.2.1 1).continuousOn) intro v hv exact ne_of_gt (hpos.1 1 v hv) have hobsDensityCont : ContinuousOn (observationalDensity θ) (latentCube 3) := by unfold observationalDensity exact continuousOn_finset_prod _ fun i _ => (hpos.2.2.1 i).continuousOn have hintDensityCont : ContinuousOn (interventionalDensity θ 0) (latentCube 3) := by unfold interventionalDensity apply ((hpos.2.2.2.1 0).continuousOn.comp ((continuous_apply 0).continuousOn) (fun (v : LatentState 3) (hv : v ∈ latentCube 3) => hv 0 (Set.mem_univ 0))).mul exact continuousOn_finset_prod _ fun i _ => (hpos.2.2.1 i).continuousOn have hψratioCont : ContinuousOn (fun v => ψ (ratio v)) (latentCube 3) := ψ.continuous.continuousOn.comp hratioCont (fun _ _ => Set.mem_univ _) have hobsInt : Integrable (fun v => observationalDensity θ v * ψ (ratio v)) μ := by dsimp only [μ] exact (hobsDensityCont.mul hψratioCont).integrableOn_compact hcubeCompact have hintInt : Integrable (fun v => interventionalDensity θ 0 v * ψ (ratio v)) μ := by dsimp only [μ] exact (hintDensityCont.mul hψratioCont).integrableOn_compact hcubeCompact rw [eq_comm, ← sub_eq_zero, ← integral_sub hintInt hobsInt] let f : LatentState 3 → ℝ := fun v => (exponentialInterventionDensity (reflectedCoordinate s 0 (v 0)) - 1) * ((1 + (1 / 10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (reflectedCoordinate s 1 (v 1))) * ψ (exponentialInterventionDensity (reflectedCoordinate s 1 (v 1)) / (1 + (1 / 10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (reflectedCoordinate s 1 (v 1))))) have hdiff : (fun v => interventionalDensity θ 0 v * ψ (ratio v) - observationalDensity θ v * ψ (ratio v)) =ᵐ[μ] f := by filter_upwards with v dsimp only [θ, ratio, f] rw [← cancellation_density_difference_eq_reflected_integrand s v ψ] ring rw [integral_congr_ae hdiff] have hμ : μ = Measure.pi (fun _ : Fin 3 => volume.restrict (Icc (0 : ℝ) 1)) := by dsimp only [μ] change volume.restrict (Set.univ.pi fun _ : Fin 3 => Icc (0 : ℝ) 1) = _ rw [MeasureTheory.volume_pi, Measure.restrict_pi_pi] have hf : Integrable f (Measure.pi (fun _ : Fin 3 => volume.restrict (Icc (0 : ℝ) 1))) := by rw [← hμ] exact (hintInt.sub hobsInt).congr hdiff let J : ℝ → ℝ → ℝ := fun x y => (exponentialInterventionDensity (reflectedCoordinate s 0 x) - 1) * ((1 + (1 / 10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 x) * centeredCoordinate (reflectedCoordinate s 1 y)) * ψ (exponentialInterventionDensity (reflectedCoordinate s 1 y) / (1 + (1 / 10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 x) * centeredCoordinate (reflectedCoordinate s 1 y)))) let embed : ℝ × ℝ → LatentState 3 := fun z => ![z.1, z.2, 0] have hembedCont : Continuous embed := by fun_prop have hembedCube : ∀ z ∈ Icc (0 : ℝ) 1 ×ˢ Icc (0 : ℝ) 1, embed z ∈ latentCube 3 := by intro z hz i _ fin_cases i · simpa [embed] using hz.1 · simpa [embed] using hz.2 · simp [embed] have hdiffCont : ContinuousOn (fun v => interventionalDensity θ 0 v * ψ (ratio v) - observationalDensity θ v * ψ (ratio v)) (latentCube 3) := (hintDensityCont.mul hψratioCont).sub (hobsDensityCont.mul hψratioCont) have hJCont : ContinuousOn (uncurry J) (Icc (0 : ℝ) 1 ×ˢ Icc (0 : ℝ) 1) := by apply (hdiffCont.comp hembedCont.continuousOn hembedCube).congr intro z hz dsimp only [uncurry, J, embed, θ, ratio] simp only [Function.comp_apply] rw [← sub_mul, cancellation_density_difference_eq_reflected_integrand s ![z.1, z.2, 0] ψ] simp only [Matrix.cons_val_zero, Matrix.cons_val_one] have hJInt : Integrable (uncurry J) ((volume.restrict (Icc (0 : ℝ) 1)).prod (volume.restrict (Icc (0 : ℝ) 1))) := by rw [Measure.prod_restrict] exact hJCont.integrableOn_compact (isCompact_Icc.prod isCompact_Icc) have hunit : (volume.restrict (Icc (0 : ℝ) 1)).real univ = 1 := by simp [Measure.real, Real.volume_Icc] rw [hμ, integral_fin_three_pi_eq_iterated _ f hf] dsimp only [f] simp only [Matrix.cons_val_zero, Matrix.cons_val_one, integral_const, hunit, one_smul] change (∫ x in Icc (0 : ℝ) 1, ∫ y in Icc (0 : ℝ) 1, J x y) = 0 rw [MeasureTheory.integral_integral_swap hJInt] exact cancellation_reflected_iterated_test_integral_zero s ψ ψ.continuous · exact hratio.aemeasurable · exact ψ.continuous.measurable.aestronglyMeasurable · exact hratio.aemeasurable · exact ψ.continuous.measurable.aestronglyMeasurable
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellationWitness_ratioLaws_eq · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessAssembly.lean:237
theorem cancellationWitness_populationDiscrepancy_eq_zero

Exact cancellation of the ratio laws makes the cancellation witness's Gaussian population discrepancy vanish. the stated conclusion follows.

Formal statement
Proof (Lean source)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellationWitness_populationDiscrepancy_eq_zero · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessAssembly.lean:409
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.WitnessCancellation 15 declarations This file isolates the fundamental-theorem-of-calculus identity behind equality of the cancellation witness's observational and parent-interventional ratio laws.

Cancellation-witness calculus

This file isolates the fundamental-theorem-of-calculus identity behind equality of the cancellation witness's observational and parent-interventional ratio laws.

theorem canonicalObservedWorld_observedLawRatio_ae_eq_mechanismRatio

In the canonical world, the law-defined Radon--Nikodym ratio agrees almost everywhere under the observational law with the explicit mechanism ratio. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
π :
Perm (Fin n)
i :
Fin n
=ᵐ[observationalLaw θ] fun v => θ.q (π i) (v (π i)) / θ.p (π i) v
Proof (Lean source)
lemma canonicalObservedWorld_observedLawRatio_ae_eq_mechanismRatio {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (hpos : PositiveNormalizedSmoothMechanisms G θ) (π : Perm (Fin n)) (i : Fin n) : observedLawRatio (canonicalObservedWorld G θ π).law i =ᵐ[observationalLaw θ] fun v => θ.q (π i) (v (π i)) / θ.p (π i) v := by let W := canonicalObservedWorld G θ π have hone := canonicalObservedWorld_onePerfectInterventionPerNode hpos π filter_upwards [hone.2.2.1 i, observationalLaw_ae_mem_latentCube hpos] with v hrv hv change ((interventionalLaw θ (π i)).rnDeriv (observationalLaw θ) v).toReal = _ calc _ = (ofReal (W.ratio i v)).toReal := congrArg toReal hrv.symm _ = W.ratio i v := ENNReal.toReal_ofReal (div_nonneg (hpos.2.1 _ _ (hv (π i) (Set.mem_univ _))).le (hpos.1 _ _ hv).le) _ = _ := by rfl
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.canonicalObservedWorld_observedLawRatio_ae_eq_mechanismRatio · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessCancellation.lean:20
theorem canonical_observationalRatioLaw_eq_mechanismRatio_map

The canonical observational ratio law is the pushforward of the observational latent law by the explicit mechanism ratio. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
π :
Perm (Fin n)
i :
Fin n
= Measure.map (fun v => θ.q (π i) (v (π i)) / θ.p (π i) v) (observationalLaw θ)
Proof (Lean source)
lemma canonical_observationalRatioLaw_eq_mechanismRatio_map {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (hpos : PositiveNormalizedSmoothMechanisms G θ) (π : Perm (Fin n)) (i : Fin n) : observationalRatioLaw (canonicalObservedWorld G θ π) i = Measure.map (fun v => θ.q (π i) (v (π i)) / θ.p (π i) v) (observationalLaw θ) := by unfold observationalRatioLaw exact Measure.map_congr (canonicalObservedWorld_observedLawRatio_ae_eq_mechanismRatio hpos π i)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.canonical_observationalRatioLaw_eq_mechanismRatio_map · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessCancellation.lean:40
theorem canonical_interventionalRatioLaw_eq_mechanismRatio_map

The canonical interventional ratio law is the pushforward of the corresponding latent interventional law by the same explicit mechanism ratio. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
π :
Perm (Fin n)
j i :
Fin n
= Measure.map (fun v => θ.q (π i) (v (π i)) / θ.p (π i) v) (interventionalLaw θ (π j))
Proof (Lean source)
lemma canonical_interventionalRatioLaw_eq_mechanismRatio_map {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (hpos : PositiveNormalizedSmoothMechanisms G θ) (π : Perm (Fin n)) (j i : Fin n) : interventionalRatioLaw (canonicalObservedWorld G θ π) j i = Measure.map (fun v => θ.q (π i) (v (π i)) / θ.p (π i) v) (interventionalLaw θ (π j)) := by let W := canonicalObservedWorld G θ π have hac : interventionalLaw θ (π j) ≪ observationalLaw θ := by simpa only [W, canonicalObservedWorld] using interventionalLaw_absolutelyContinuous_observational W hpos j unfold interventionalRatioLaw change Measure.map (observedLawRatio W.law i) (interventionalLaw θ (π j)) = _ exact Measure.map_congr (hac.ae_eq (canonicalObservedWorld_observedLawRatio_ae_eq_mechanismRatio hpos π i))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.canonical_interventionalRatioLaw_eq_mechanismRatio_map · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessCancellation.lean:54
theorem canonical_observationalRatioLaw_secondMoment_eq

The second moment of the canonical observational ratio law is the latent observational integral of the square of the explicit mechanism ratio. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
π :
Perm (Fin n)
i :
Fin n
(∫ r, r ^ 2 ∂observationalRatioLaw (canonicalObservedWorld G θ π) i)
= ∫ v, (θ.q (π i) (v (π i)) / θ.p (π i) v) ^ 2 ∂observationalLaw θ
Proof (Lean source)
lemma canonical_observationalRatioLaw_secondMoment_eq {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (hpos : PositiveNormalizedSmoothMechanisms G θ) (π : Perm (Fin n)) (i : Fin n) : (∫ r, r ^ 2 ∂observationalRatioLaw (canonicalObservedWorld G θ π) i) = ∫ v, (θ.q (π i) (v (π i)) / θ.p (π i) v) ^ 2 ∂observationalLaw θ := by let W := canonicalObservedWorld G θ π rw [observationalRatioLaw, MeasureTheory.integral_map (measurable_observedLawRatio W.law i).aemeasurable (by fun_prop)] apply integral_congr_ae filter_upwards [canonicalObservedWorld_observedLawRatio_ae_eq_mechanismRatio hpos π i] with v hv rw [hv]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.canonical_observationalRatioLaw_secondMoment_eq · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessCancellation.lean:74
theorem canonical_interventionalRatioLaw_secondMoment_eq

The second moment of a canonical interventional ratio law is the corresponding latent interventional integral of the square of the explicit mechanism ratio. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
π :
Perm (Fin n)
j i :
Fin n
(∫ r, r ^ 2 ∂interventionalRatioLaw (canonicalObservedWorld G θ π) j i)
= ∫ v, (θ.q (π i) (v (π i)) / θ.p (π i) v) ^ 2 ∂interventionalLaw θ (π j)
Proof (Lean source)
lemma canonical_interventionalRatioLaw_secondMoment_eq {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (hpos : PositiveNormalizedSmoothMechanisms G θ) (π : Perm (Fin n)) (j i : Fin n) : (∫ r, r ^ 2 ∂interventionalRatioLaw (canonicalObservedWorld G θ π) j i) = ∫ v, (θ.q (π i) (v (π i)) / θ.p (π i) v) ^ 2 ∂interventionalLaw θ (π j) := by let W := canonicalObservedWorld G θ π have hac : interventionalLaw θ (π j) ≪ observationalLaw θ := by simpa only [W, canonicalObservedWorld] using interventionalLaw_absolutelyContinuous_observational W hpos j rw [interventionalRatioLaw, MeasureTheory.integral_map (measurable_observedLawRatio W.law i).aemeasurable (by fun_prop)] apply integral_congr_ae filter_upwards [hac.ae_eq (canonicalObservedWorld_observedLawRatio_ae_eq_mechanismRatio hpos π i)] with v hv rw [hv]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.canonical_interventionalRatioLaw_secondMoment_eq · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessCancellation.lean:92
theorem cancellationPrimitive_hasDerivAt Lemma cancellationPrimitive_hasDerivAt in the paper ↗

The cancellation primitive has derivative equal to the intervention-density tilt. the stated conclusion follows.

Formal statement
x :
Proof (Lean source)
lemma cancellationPrimitive_hasDerivAt (x : ℝ) : HasDerivAt cancellationPrimitive (exponentialInterventionDensity x - 1) x := by change HasDerivAt (fun y : ℝ => (exp (4 * y) - 1) / (exp 4 - 1) - y) (exponentialInterventionDensity x - 1) x have hexp : HasDerivAt (fun y : ℝ => exp (4 * y)) (4 * exp (4 * x)) x := by simpa [Function.comp_def, mul_comm] using (Real.hasDerivAt_exp (4 * x)).comp x (hasDerivAt_const_mul (x := x) 4) have hfrac : HasDerivAt (fun y : ℝ => (exp (4 * y) - 1) / (exp 4 - 1)) (exponentialInterventionDensity x) x := by simpa [exponentialInterventionDensity] using (hexp.sub_const 1).div_const (exp 4 - 1) exact hfrac.sub (hasDerivAt_id x)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellationPrimitive_hasDerivAt · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessCancellation.lean:115
theorem cancellation_tilt_integral_comp_zero Lemma cancellation_tilt_integral_comp_zero in the paper ↗

Integrating the cancellation tilt against any continuous function of the cancellation primitive gives zero. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
B :
ℝ → ℝ
hB :
∫ x in Icc (0 : ℝ) 1, (exponentialInterventionDensity x - 1) * B (cancellationPrimitive x)
= 0
Proof (Lean source)
lemma cancellation_tilt_integral_comp_zero (B : ℝ → ℝ) (hB : Continuous B) : ∫ x in Icc (0 : ℝ) 1, (exponentialInterventionDensity x - 1) * B (cancellationPrimitive x) = 0 := by let F : ℝ → ℝ := fun u => ∫ z in (0 : ℝ)..u, B z have hF (u : ℝ) : HasDerivAt F (B u) u := by exact intervalIntegral.integral_hasDerivAt_right (hB.intervalIntegrable 0 u) (hB.stronglyMeasurableAtFilter volume (nhds u)) hB.continuousAt have hcomp (x : ℝ) : HasDerivAt (fun x => F (cancellationPrimitive x)) ((exponentialInterventionDensity x - 1) * B (cancellationPrimitive x)) x := by change HasDerivAt (F ∘ cancellationPrimitive) ((exponentialInterventionDensity x - 1) * B (cancellationPrimitive x)) x simpa only [mul_comm] using (hF (cancellationPrimitive x)).comp x (cancellationPrimitive_hasDerivAt x) have hint : IntervalIntegrable (fun x => (exponentialInterventionDensity x - 1) * B (cancellationPrimitive x)) volume 0 1 := by apply Continuous.intervalIntegrable apply Continuous.mul · unfold exponentialInterventionDensity fun_prop · apply hB.comp unfold cancellationPrimitive fun_prop have hFTC := intervalIntegral.integral_eq_sub_of_hasDerivAt_of_le (show (0 : ℝ) ≤ 1 by norm_num) (show ContinuousOn (fun x => F (cancellationPrimitive x)) (Icc 0 1) by exact (continuous_iff_continuousAt.mpr fun x => (hcomp x).continuousAt).continuousOn) (fun x _ => hcomp x) hint rw [MeasureTheory.integral_Icc_eq_integral_Ioc] rw [← intervalIntegral.integral_of_le (show (0 : ℝ) ≤ 1 by norm_num)] rw [hFTC] simp [cancellationPrimitive_zero]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellation_tilt_integral_comp_zero · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessCancellation.lean:133

Clamp a real argument to the range of the cancellation primitive.

Definition (Lean source)
u :
clampCancellationRange u :
max (-1) (min 0 u)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.clampCancellationRange · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessCancellation.lean:170
theorem clampCancellationRange_eq_self

If the argument already lies in the cancellation range, then clamping leaves it unchanged.

Formal statement
u :
hu :
u ∈ Icc (-1 : ℝ) 0
Proof (Lean source)
@[simp] lemma clampCancellationRange_eq_self {u : ℝ} (hu : u ∈ Icc (-1 : ℝ) 0) : clampCancellationRange u = u := by simp [clampCancellationRange, hu.1, hu.2]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.clampCancellationRange_eq_self · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessCancellation.lean:174

A globally continuous extension of the one-dimensional test integrand used to identify the cancellation ratio law.

Definition (Lean source)
ψ :
ℝ → ℝ
y u :
cancellationTestIntegrand ψ y u :
d :
1 + (1 / 10 : ℝ) * clampCancellationRange u * centeredCoordinate y
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellationTestIntegrand · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessCancellation.lean:181
theorem cancellationTestIntegrand_continuous

The extended cancellation test integrand is continuous when the test function is continuous and the child coordinate lies in the unit interval. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
ψ :
ℝ → ℝ
:
y :
hy :
y ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma cancellationTestIntegrand_continuous (ψ : ℝ → ℝ) (hψ : Continuous ψ) {y : ℝ} (hy : y ∈ Icc (0 : ℝ) 1) : Continuous (cancellationTestIntegrand ψ y) := by have hcy := abs_centeredCoordinate_le_one hy rw [abs_le] at hcy have hclamp (u : ℝ) : clampCancellationRange u ∈ Icc (-1 : ℝ) 0 := by simp only [clampCancellationRange, Set.mem_Icc] constructor · exact le_max_left _ _ · exact max_le (by norm_num) (min_le_left _ _) have hden (u : ℝ) : 1 + (1 / 10 : ℝ) * clampCancellationRange u * centeredCoordinate y ≠ 0 := by have hu := hclamp u have hab : -1 ≤ clampCancellationRange u * centeredCoordinate y := by apply hu.1.trans simpa using mul_le_mul_of_nonpos_left hcy.2 hu.2 nlinarith unfold cancellationTestIntegrand dsimp only apply Continuous.mul · unfold clampCancellationRange centeredCoordinate fun_prop · apply hψ.comp apply Continuous.div continuous_const · unfold clampCancellationRange centeredCoordinate fun_prop · exact hden
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellationTestIntegrand_continuous · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessCancellation.lean:188
theorem cancellation_test_integrand_tilt_zero Lemma cancellation_test_integrand_tilt_zero in the paper ↗

The parent intervention tilt integrates to zero against the exact test integrand that appears after fixing the cancellation witness's child coordinate. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
ψ :
ℝ → ℝ
:
y :
hy :
y ∈ Icc (0 : ℝ) 1
∫ x in Icc (0 : ℝ) 1, (exponentialInterventionDensity x - 1) * ((1 + (1 / 10 : ℝ) * cancellationPrimitive x * centeredCoordinate y) * ψ (exponentialInterventionDensity y / (1 + (1 / 10 : ℝ) * cancellationPrimitive x * centeredCoordinate y)))
= 0
Proof (Lean source)
lemma cancellation_test_integrand_tilt_zero (ψ : ℝ → ℝ) (hψ : Continuous ψ) {y : ℝ} (hy : y ∈ Icc (0 : ℝ) 1) : ∫ x in Icc (0 : ℝ) 1, (exponentialInterventionDensity x - 1) * ((1 + (1 / 10 : ℝ) * cancellationPrimitive x * centeredCoordinate y) * ψ (exponentialInterventionDensity y / (1 + (1 / 10 : ℝ) * cancellationPrimitive x * centeredCoordinate y))) = 0 := by calc _ = ∫ x in Icc (0 : ℝ) 1, (exponentialInterventionDensity x - 1) * cancellationTestIntegrand ψ y (cancellationPrimitive x) := by apply integral_congr_ae filter_upwards [ae_restrict_mem measurableSet_Icc] with x hx simp only [cancellationTestIntegrand] rw [show clampCancellationRange (cancellationPrimitive x) = cancellationPrimitive x by exact clampCancellationRange_eq_self (cancellationPrimitive_mem_negUnitInterval hx)] _ = 0 := cancellation_tilt_integral_comp_zero (cancellationTestIntegrand ψ y) (cancellationTestIntegrand_continuous ψ hψ hy)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellation_test_integrand_tilt_zero · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessCancellation.lean:218
theorem cancellation_iterated_test_integral_zero Lemma cancellation_iterated_test_integral_zero in the paper ↗

The complete two-coordinate cancellation integral vanishes for every continuous test function. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
ψ :
ℝ → ℝ
:
∫ y in Icc (0 : ℝ) 1, ∫ x in Icc (0 : ℝ) 1, (exponentialInterventionDensity x - 1) * ((1 + (1 / 10 : ℝ) * cancellationPrimitive x * centeredCoordinate y) * ψ (exponentialInterventionDensity y / (1 + (1 / 10 : ℝ) * cancellationPrimitive x * centeredCoordinate y)))
= 0
Proof (Lean source)
lemma cancellation_iterated_test_integral_zero (ψ : ℝ → ℝ) (hψ : Continuous ψ) : ∫ y in Icc (0 : ℝ) 1, ∫ x in Icc (0 : ℝ) 1, (exponentialInterventionDensity x - 1) * ((1 + (1 / 10 : ℝ) * cancellationPrimitive x * centeredCoordinate y) * ψ (exponentialInterventionDensity y / (1 + (1 / 10 : ℝ) * cancellationPrimitive x * centeredCoordinate y))) = 0 := by calc _ = ∫ _y in Icc (0 : ℝ) 1, (0 : ℝ) := by apply integral_congr_ae filter_upwards [ae_restrict_mem measurableSet_Icc] with y hy exact cancellation_test_integrand_tilt_zero ψ hψ hy _ = 0 := by simp
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellation_iterated_test_integral_zero · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessCancellation.lean:240
theorem ratioLaws_eq_of_boundedContinuous_integrals_eq

Two finite ratio laws coincide when every bounded continuous real test function has the same integral under both laws. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
W :
j i :
Fin n
IsFiniteMeasure (W.law 0)
IsFiniteMeasure (W.law j.succ)
h :
∀ ψ : BoundedContinuousFunction ℝ ℝ,
(∫ r, ψ r ∂observationalRatioLaw W i) = ∫ r, ψ r ∂interventionalRatioLaw W j i
Proof (Lean source)
lemma ratioLaws_eq_of_boundedContinuous_integrals_eq {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (W : ObservedWorld G θ) (j i : Fin n) [IsFiniteMeasure (W.law 0)] [IsFiniteMeasure (W.law j.succ)] (h : ∀ ψ : BoundedContinuousFunction ℝ ℝ, (∫ r, ψ r ∂observationalRatioLaw W i) = ∫ r, ψ r ∂interventionalRatioLaw W j i) : observationalRatioLaw W i = interventionalRatioLaw W j i := by letI : IsFiniteMeasure (observationalRatioLaw W i) := by unfold observationalRatioLaw exact Measure.isFiniteMeasure_map _ _ letI : IsFiniteMeasure (interventionalRatioLaw W j i) := by unfold interventionalRatioLaw exact Measure.isFiniteMeasure_map _ _ exact MeasureTheory.ext_of_forall_integral_eq_of_IsFiniteMeasure h
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.ratioLaws_eq_of_boundedContinuous_integrals_eq · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessCancellation.lean:257
theorem populationDiscrepancy_eq_zero_of_ratioLaws_eq

Equality of the observational and interventional ratio laws forces their kernel mean discrepancy to vanish. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
Proof (Lean source)
lemma populationDiscrepancy_eq_zero_of_ratioLaws_eq {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℝ H] [CompleteSpace H] (U : UnitNormFeatureMap H) (W : ObservedWorld G θ) (j i : Fin n) (h : observationalRatioLaw W i = interventionalRatioLaw W j i) : populationDiscrepancy U W j i = 0 := by simp only [populationDiscrepancy, h, sub_self, norm_zero]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.populationDiscrepancy_eq_zero_of_ratioLaws_eq · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessCancellation.lean:276
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.WitnessCancellationFaithfulness 9 declarations This file proves dependence of the cancellation witness's unique edge from a strictly positive covariance, and then invokes the three-node graph reduction.

Cancellation-witness faithfulness

This file proves dependence of the cancellation witness's unique edge from a strictly positive covariance, and then invokes the three-node graph reduction.

theorem continuous_reflectedCancellationPrimitive

A fixed signed reflection followed by the cancellation primitive is continuous.

Formal statement
s :
i :
Fin 3
Proof (Lean source)
@[fun_prop] lemma continuous_reflectedCancellationPrimitive (s : SignVector 3) (i : Fin 3) : Continuous (fun z : ℝ => cancellationPrimitive (reflectedCoordinate s i z)) := by rcases s.signed i with hi | hi <;> simp [cancellationPrimitive, reflectedCoordinate, reflect, hi, show (-1 : ℝ) ≠ 1 by norm_num] <;> fun_prop
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuous_reflectedCancellationPrimitive · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessCancellationFaithfulness.lean:17
theorem cancellationWitness_integral_eq_iterated

A continuous test function under the cancellation observational law is its explicit three-coordinate iterated density integral. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
s :
f :
LatentState 3 → ℝ
(∫ v, f v ∂observationalLaw (cancellationWitness s))
= ∫ x in Icc (0 : ℝ) 1, ∫ y in Icc (0 : ℝ) 1, ∫ z in Icc (0 : ℝ) 1, observationalDensity (cancellationWitness s) ![x, y, z] * f ![x, y, z]
Proof (Lean source)
lemma cancellationWitness_integral_eq_iterated (s : SignVector 3) (f : LatentState 3 → ℝ) (hf : ContinuousOn f (latentCube 3)) : (∫ v, f v ∂observationalLaw (cancellationWitness s)) = ∫ x in Icc (0 : ℝ) 1, ∫ y in Icc (0 : ℝ) 1, ∫ z in Icc (0 : ℝ) 1, observationalDensity (cancellationWitness s) ![x, y, z] * f ![x, y, z] := by let μ : Measure (LatentState 3) := volume.restrict (latentCube 3) have hpos := cancellationWitness_positive_normalized_smooth s have hcubeCompact : IsCompact (latentCube 3) := by rw [latentCube] exact isCompact_univ_pi fun _ => isCompact_Icc have hdensityCont : ContinuousOn (observationalDensity (cancellationWitness s)) (latentCube 3) := by unfold observationalDensity exact continuousOn_finset_prod _ fun i _ => (hpos.2.2.1 i).continuousOn have hprodInt : Integrable (fun v => observationalDensity (cancellationWitness s) v * f v) μ := by dsimp only [μ] exact (hdensityCont.mul hf).integrableOn_compact hcubeCompact have hμ : μ = Measure.pi (fun _ : Fin 3 => volume.restrict (Icc (0 : ℝ) 1)) := by dsimp only [μ] change volume.restrict (Set.univ.pi fun _ : Fin 3 => Icc (0 : ℝ) 1) = _ rw [MeasureTheory.volume_pi, Measure.restrict_pi_pi] calc (∫ v, f v ∂observationalLaw (cancellationWitness s)) = ∫ v, observationalDensity (cancellationWitness s) v * f v ∂μ := by unfold observationalLaw rw [integral_withDensity_eq_integral_toReal_smul] · apply integral_congr_ae filter_upwards [ae_restrict_mem (measurableSet_latentCube 3)] with v hv rw [ENNReal.toReal_ofReal (le_of_lt (by unfold observationalDensity exact Finset.prod_pos fun i _ => hpos.1 i v hv))] rfl · exact (measurable_cancellationWitness_observationalDensity s).ennreal_ofReal · filter_upwards with v exact ENNReal.ofReal_lt_top _ = _ := by rw [hμ, integral_fin_three_pi_eq_iterated _ _ (by simpa [hμ] using hprodInt)]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellationWitness_integral_eq_iterated · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessCancellationFaithfulness.lean:26
theorem cancellationWitness_parent_inner_integral

Integrating over the child leaves the cancellation coefficient unchanged. the stated conclusion follows.

Formal statement
s :
x :
Proof (Lean source)
lemma cancellationWitness_parent_inner_integral (s : SignVector 3) (x : ℝ) : (∫ y in Icc (0 : ℝ) 1, (1 + (1 / 10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 x) * centeredCoordinate (reflectedCoordinate s 1 y)) * cancellationPrimitive (reflectedCoordinate s 0 x)) = cancellationPrimitive (reflectedCoordinate s 0 x) := by let A := cancellationPrimitive (reflectedCoordinate s 0 x) let B : ℝ → ℝ := fun y => centeredCoordinate (reflectedCoordinate s 1 y) have hB : Continuous B := continuous_reflectedCenteredCoordinate s 1 have h2 : IntegrableOn (fun y => (1 / 10 : ℝ) * A ^ 2 * B y) (Icc (0 : ℝ) 1) := (continuous_const.mul hB).continuousOn.integrableOn_Icc have hconst : IntegrableOn (fun _ : ℝ => A) (Icc (0 : ℝ) 1) := continuous_const.continuousOn.integrableOn_Icc rw [show (fun y => (1 + (1 / 10 : ℝ) * A * B y) * A) = fun y => A + (1 / 10 : ℝ) * A ^ 2 * B y by funext y; ring, integral_add hconst h2, MeasureTheory.integral_const, MeasureTheory.integral_const_mul, centeredCoordinate_reflected_integral, mul_zero, add_zero] simp [A, Real.volume_Icc]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellationWitness_parent_inner_integral · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessCancellationFaithfulness.lean:71
theorem cancellationWitness_child_inner_integral

Integrating the centered child coordinate gives one thirtieth of the parent coefficient. the stated conclusion follows.

Formal statement
s :
x :
(∫ y in Icc (0 : ℝ) 1, (1 + (1 / 10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 x) * centeredCoordinate (reflectedCoordinate s 1 y)) * centeredCoordinate (reflectedCoordinate s 1 y))
= (1 / 30 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 x)
Proof (Lean source)
lemma cancellationWitness_child_inner_integral (s : SignVector 3) (x : ℝ) : (∫ y in Icc (0 : ℝ) 1, (1 + (1 / 10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 x) * centeredCoordinate (reflectedCoordinate s 1 y)) * centeredCoordinate (reflectedCoordinate s 1 y)) = (1 / 30 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 x) := by let A := cancellationPrimitive (reflectedCoordinate s 0 x) let B : ℝ → ℝ := fun y => centeredCoordinate (reflectedCoordinate s 1 y) have hB : Continuous B := continuous_reflectedCenteredCoordinate s 1 have h1 : IntegrableOn B (Icc (0 : ℝ) 1) := hB.continuousOn.integrableOn_Icc have h2 : IntegrableOn (fun y => (1 / 10 : ℝ) * A * B y ^ 2) (Icc (0 : ℝ) 1) := (continuous_const.mul (hB.pow 2)).continuousOn.integrableOn_Icc rw [show (fun y => (1 + (1 / 10 : ℝ) * A * B y) * B y) = fun y => B y + (1 / 10 : ℝ) * A * B y ^ 2 by funext y; ring, integral_add h1 h2, MeasureTheory.integral_const_mul, centeredCoordinate_reflected_integral, centeredCoordinate_reflected_sq_integral] dsimp only [A] ring
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellationWitness_child_inner_integral · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessCancellationFaithfulness.lean:95
theorem cancellationWitness_joint_inner_integral

The child-parent test-product integral is one thirtieth of the squared coefficient. the stated conclusion follows.

Formal statement
s :
x :
Proof (Lean source)
lemma cancellationWitness_joint_inner_integral (s : SignVector 3) (x : ℝ) : (∫ y in Icc (0 : ℝ) 1, (1 + (1 / 10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 x) * centeredCoordinate (reflectedCoordinate s 1 y)) * (cancellationPrimitive (reflectedCoordinate s 0 x) * centeredCoordinate (reflectedCoordinate s 1 y))) = (1 / 30 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 x) ^ 2 := by let A := cancellationPrimitive (reflectedCoordinate s 0 x) let B : ℝ → ℝ := fun y => centeredCoordinate (reflectedCoordinate s 1 y) have hB : Continuous B := continuous_reflectedCenteredCoordinate s 1 have h1 : IntegrableOn (fun y => A * B y) (Icc (0 : ℝ) 1) := (continuous_const.mul hB).continuousOn.integrableOn_Icc have h2 : IntegrableOn (fun y => (1 / 10 : ℝ) * A ^ 2 * B y ^ 2) (Icc (0 : ℝ) 1) := (continuous_const.mul (hB.pow 2)).continuousOn.integrableOn_Icc rw [show (fun y => (1 + (1 / 10 : ℝ) * A * B y) * (A * B y)) = fun y => A * B y + (1 / 10 : ℝ) * A ^ 2 * B y ^ 2 by funext y; ring, integral_add h1 h2, MeasureTheory.integral_const_mul, MeasureTheory.integral_const_mul, centeredCoordinate_reflected_integral, centeredCoordinate_reflected_sq_integral] dsimp only [A] ring
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellationWitness_joint_inner_integral · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessCancellationFaithfulness.lean:120
theorem reflectedCancellationPrimitive_variance_pos

The reflected cancellation coefficient has strictly positive variance under unit Lebesgue law. the stated conclusion follows.

Formal statement
s :
0 < (∫ x in Icc (0 : ℝ) 1, cancellationPrimitive (reflectedCoordinate s 0 x) ^ 2)
- (∫ x in Icc (0 : ℝ) 1, cancellationPrimitive (reflectedCoordinate s 0 x)) ^ 2
Proof (Lean source)
lemma reflectedCancellationPrimitive_variance_pos (s : SignVector 3) : 0 < (∫ x in Icc (0 : ℝ) 1, cancellationPrimitive (reflectedCoordinate s 0 x) ^ 2) - (∫ x in Icc (0 : ℝ) 1, cancellationPrimitive (reflectedCoordinate s 0 x)) ^ 2 := by let K : ℝ → ℝ := fun x => cancellationPrimitive (reflectedCoordinate s 0 x) let m : ℝ := ∫ x in Icc (0 : ℝ) 1, K x have hK : Continuous K := continuous_reflectedCancellationPrimitive s 0 have hx : ∃ x ∈ Icc (0 : ℝ) 1, K x ≠ m := by have hmid : K (1 / 2) = cancellationPrimitive (1 / 2) := by rcases s.signed 0 with hi | hi <;> norm_num [K, reflectedCoordinate, reflect, hi, show (-1 : ℝ) ≠ 1 by norm_num] by_cases hm : K (1 / 2) = m · rcases s.signed 0 with hi | hi · refine ⟨1, by norm_num, ?_⟩ have hend : K 1 = 0 := by simp only [K, reflectedCoordinate, hi, reflect, if_neg (show (-1 : ℝ) ≠ 1 by norm_num)] norm_num exact cancellationPrimitive_zero.1 rw [← hm, hmid] rw [hend] exact ne_of_gt cancellationPrimitive_half_neg · refine ⟨0, by norm_num, ?_⟩ have hend : K 0 = 0 := by simp [K, reflectedCoordinate, reflect, hi, cancellationPrimitive_zero.1] rw [← hm, hmid] rw [hend] exact ne_of_gt cancellationPrimitive_half_neg · exact ⟨1 / 2, by norm_num, hm⟩ have hposInt : 0 < ∫ x in Icc (0 : ℝ) 1, (K x - m) ^ 2 := by rw [MeasureTheory.integral_Icc_eq_integral_Ioc, ← intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1)] have hlt := intervalIntegral.integral_lt_integral_of_continuousOn_of_le_of_exists_lt (f := fun _ : ℝ => 0) (g := fun x => (K x - m) ^ 2) (by norm_num : (0 : ℝ) < 1) continuousOn_const ((hK.sub continuous_const).pow 2).continuousOn (fun x hx' => sq_nonneg _) (by rcases hx with ⟨x, hxI, hxm⟩ exact ⟨x, hxI, sq_pos_of_ne_zero (sub_ne_zero.mpr hxm)⟩) simpa using hlt have hexpand : (∫ x in Icc (0 : ℝ) 1, (K x - m) ^ 2) = (∫ x in Icc (0 : ℝ) 1, K x ^ 2) - m ^ 2 := by have hKint : IntegrableOn K (Icc (0 : ℝ) 1) := hK.continuousOn.integrableOn_Icc have hKsq : IntegrableOn (fun x => K x ^ 2) (Icc (0 : ℝ) 1) := (hK.pow 2).continuousOn.integrableOn_Icc have hcross : IntegrableOn (fun x => 2 * m * K x) (Icc (0 : ℝ) 1) := hKint.const_mul (2 * m) have hconst : IntegrableOn (fun _ : ℝ => m ^ 2) (Icc (0 : ℝ) 1) := continuous_const.continuousOn.integrableOn_Icc calc _ = ∫ x in Icc (0 : ℝ) 1, (K x ^ 2 - 2 * m * K x) + m ^ 2 := by apply integral_congr_ae filter_upwards with x ring _ = (∫ x in Icc (0 : ℝ) 1, K x ^ 2 - 2 * m * K x) + ∫ _x in Icc (0 : ℝ) 1, m ^ 2 := by simpa only [Pi.add_apply, Pi.sub_apply] using integral_add (hKsq.sub hcross) hconst _ = ((∫ x in Icc (0 : ℝ) 1, K x ^ 2) - ∫ x in Icc (0 : ℝ) 1, 2 * m * K x) + ∫ _x in Icc (0 : ℝ) 1, m ^ 2 := by rw [integral_sub hKsq hcross] _ = _ := by rw [MeasureTheory.integral_const_mul, MeasureTheory.integral_const] have hvol : (volume.restrict (Icc (0 : ℝ) 1)).real univ = 1 := by simp [Measure.real, Real.volume_Icc] rw [hvol] dsimp only [m] ring rw [hexpand] at hposInt simpa only [K, m] using hposInt
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.reflectedCancellationPrimitive_variance_pos · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessCancellationFaithfulness.lean:146
theorem cancellationWitness_not_condIndep_edge

Positive coefficient-child covariance rules out independence of the cancellation edge. the stated conclusion follows.

Formal statement
s :
¬ CondIndepCoordinates (cancellationWitness s) {0} {1} ∅
Proof (Lean source)
lemma cancellationWitness_not_condIndep_edge (s : SignVector 3) : ¬ CondIndepCoordinates (cancellationWitness s) {0} {1} ∅ := by intro hCI let K : ℝ → ℝ := fun x => cancellationPrimitive (reflectedCoordinate s 0 x) let H : ℝ → ℝ := fun y => centeredCoordinate (reflectedCoordinate s 1 y) let m : ℝ := ∫ x in Icc (0 : ℝ) 1, K x let v2 : ℝ := ∫ x in Icc (0 : ℝ) 1, K x ^ 2 have hparent : (∫ v, K (v 0) ∂observationalLaw (cancellationWitness s)) = m := by rw [cancellationWitness_integral_eq_iterated] · simp [observationalDensity, cancellationWitness, cancellationP] apply integral_congr_ae filter_upwards with x simpa [K, one_div] using cancellationWitness_parent_inner_integral s x · exact (continuous_reflectedCancellationPrimitive s 0).comp (continuous_apply 0) |>.continuousOn have hchild : (∫ v, H (v 1) ∂observationalLaw (cancellationWitness s)) = (1 / 30 : ℝ) * m := by rw [cancellationWitness_integral_eq_iterated] · simp [observationalDensity, cancellationWitness, cancellationP] calc _ = ∫ x in Icc (0 : ℝ) 1, (1 / 30 : ℝ) * K x := by apply integral_congr_ae filter_upwards with x simpa [K, H, one_div] using cancellationWitness_child_inner_integral s x _ = _ := by rw [MeasureTheory.integral_const_mul] norm_num change (∫ x in Icc (0 : ℝ) 1, K x) = ∫ x in Icc (0 : ℝ) 1, K x rfl · exact (continuous_reflectedCenteredCoordinate s 1).comp (continuous_apply 1) |>.continuousOn have hjoint : (∫ v, K (v 0) * H (v 1) ∂observationalLaw (cancellationWitness s)) = (1 / 30 : ℝ) * v2 := by rw [cancellationWitness_integral_eq_iterated] · simp [observationalDensity, cancellationWitness, cancellationP] calc _ = ∫ x in Icc (0 : ℝ) 1, (1 / 30 : ℝ) * K x ^ 2 := by apply integral_congr_ae filter_upwards with x simpa [K, H, one_div] using cancellationWitness_joint_inner_integral s x _ = _ := by rw [MeasureTheory.integral_const_mul] norm_num change (∫ x in Icc (0 : ℝ) 1, K x ^ 2) = ∫ x in Icc (0 : ℝ) 1, K x ^ 2 rfl · exact ((continuous_reflectedCancellationPrimitive s 0).comp (continuous_apply 0)).mul ((continuous_reflectedCenteredCoordinate s 1).comp (continuous_apply 1)) |>.continuousOn letI : IsProbabilityMeasure (observationalLaw (cancellationWitness s)) := observationalLaw_isProbabilityMeasure (cancellationWitness_positive_normalized_smooth s) have hblocks := indepFun_of_condIndepCoordinates_empty ({0} : Finset (Fin 3)) ({1} : Finset (Fin 3)) hCI let z0 : {j // j ∈ ({0} : Finset (Fin 3))} := ⟨0, by simp⟩ let z1 : {j // j ∈ ({1} : Finset (Fin 3))} := ⟨1, by simp⟩ have hind : IndepFun (fun v : LatentState 3 => K (v 0)) (fun v : LatentState 3 => H (v 1)) (observationalLaw (cancellationWitness s)) := by let left := fun z : ((j : {j // j ∈ ({0} : Finset (Fin 3))}) → ℝ) => K (z z0) let right := fun z : ((j : {j // j ∈ ({1} : Finset (Fin 3))}) → ℝ) => H (z z1) have hraw := hblocks.comp (show Measurable left by unfold left; fun_prop) (show Measurable right by unfold right; fun_prop) convert hraw using 1 <;> funext v <;> rfl have hmul := hind.integral_fun_mul_eq_mul_integral ((continuous_reflectedCancellationPrimitive s 0).measurable.comp (measurable_pi_apply 0)).aestronglyMeasurable ((continuous_reflectedCenteredCoordinate s 1).measurable.comp (measurable_pi_apply 1)).aestronglyMeasurable rw [hjoint, hparent, hchild] at hmul have hvar := reflectedCancellationPrimitive_variance_pos s nlinarith
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellationWitness_not_condIndep_edge · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessCancellationFaithfulness.lean:225
theorem cancellationWitness_causalMinimality

The cancellation witness is causally minimal for the one-edge three-node DAG. the stated conclusion follows.

Formal statement
Proof (Lean source)
lemma cancellationWitness_causalMinimality (s : SignVector 3) : CausalMinimality threeNodeDAG (cancellationWitness s) := by intro j i hji rcases hji with ⟨rfl, rfl⟩ intro hCI apply cancellationWitness_not_condIndep_edge s have hparents : (threeNodeDAG.parents 1).erase 0 = ∅ := by ext k fin_cases k <;> simp [threeNodeDAG, threeNodeEdge, parents] rw [hparents] at hCI exact condIndepCoordinates_symm hCI
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellationWitness_causalMinimality · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessCancellationFaithfulness.lean:302
theorem cancellationWitness_faithfulness

The cancellation witness is faithful to 0 → 1 with isolated node 2. the stated conclusion follows.

Formal statement
s :
Proof (Lean source)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellationWitness_faithfulness · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessCancellationFaithfulness.lean:316
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.WitnessFaithfulness 9 declarations This file isolates the finite graph calculation used to reduce faithfulness of the explicit three-node witnesses to dependence of the unique adjacent pair.

Graph reduction for explicit-witness faithfulness

This file isolates the finite graph calculation used to reduce faithfulness of the explicit three-node witnesses to dependence of the unique adjacent pair.

theorem indepFun_of_condIndepFun_bot Lemma indepFun_of_condIndepFun_bot in the paper ↗

Conditional independence given the trivial sigma algebra is ordinary independence on a probability space. This is the reverse of Causalean's existing trivial-conditioning bridge and is used to expose dependence of the explicit witness edge. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
β γ :
Type*
Ω → β
Ω → γ
hf :
hg :
h :
CondIndepFunbot_le f g μ
IndepFun f g μ
Proof (Lean source)
lemma indepFun_of_condIndepFun_bot {Ω : Type*} [MeasurableSpace Ω] [StandardBorelSpace Ω] {β γ : Type*} [MeasurableSpace β] [MeasurableSpace γ] {f : Ω → β} {g : Ω → γ} (hf : Measurable f) (hg : Measurable g) {μ : Measure Ω} [IsProbabilityMeasure μ] (h : CondIndepFunbot_le f g μ) : IndepFun f g μ := by rw [indepFun_iff_measure_inter_preimage_eq_mul] intro s t hs ht have hfs : MeasurableSet (f ⁻¹' s) := hf hs have hgt : MeasurableSet (g ⁻¹' t) := hg ht have hfgst : MeasurableSet (f ⁻¹' s ∩ g ⁻¹' t) := hfs.inter hgt rw [ProbabilityTheory.condIndepFun_iff_condExp_inter_preimage_eq_mul hf hg] at h have heq := h s t hs ht change condExp ⊥ μ (indicator (f ⁻¹' s ∩ g ⁻¹' t) (1 : Ω → ℝ)) =ᵐ[μ] fun ω => condExp ⊥ μ (indicator (f ⁻¹' s) (1 : Ω → ℝ)) ω * condExp ⊥ μ (indicator (g ⁻¹' t) (1 : Ω → ℝ)) ω at heq rw [MeasureTheory.condExp_bot (μ := μ) _, MeasureTheory.condExp_bot (μ := μ) _, MeasureTheory.condExp_bot (μ := μ) _] at heq have hpoint := heq.exists rcases hpoint with ⟨ω, hω⟩ rw [← ENNReal.toReal_eq_toReal_iff' (measure_ne_top μ _) (ENNReal.mul_ne_top (measure_ne_top μ _) (measure_ne_top μ _))] simpa only [MeasureTheory.integral_indicator_one hfgst, MeasureTheory.integral_indicator_one hfs, MeasureTheory.integral_indicator_one hgt, MeasureTheory.measureReal_def, ENNReal.toReal_mul] using hω
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.indepFun_of_condIndepFun_bot · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessFaithfulness.lean:19
theorem indepFun_of_condIndepCoordinates_empty

Coordinate-block conditional independence given the empty block implies ordinary independence whenever the observational law is a probability measure. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
X Y :
hCI :
CondIndepCoordinates θ X Y ∅
IndepFun (coordinateProjection X) (coordinateProjection Y) (observationalLaw θ)
Proof (Lean source)
lemma indepFun_of_condIndepCoordinates_empty {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (X Y : Finset (Fin n)) [IsProbabilityMeasure (observationalLaw θ)] (hCI : CondIndepCoordinates θ X Y ∅) : IndepFun (coordinateProjection X) (coordinateProjection Y) (observationalLaw θ) := by rcases hCI with ⟨hμ, hX, hY, hZ, hCI⟩ let _ := hμ have hbot : comap (coordinateProjection (∅ : Finset (Fin n))) inferInstance = (⊥ : MeasurableSpace (LatentState n)) := comap_eq_bot_of_subsingleton _ rw [condIndepFun_iff_condExp_inter_preimage_eq_mul hX hY] at hCI rw [hbot] at hCI apply indepFun_of_condIndepFun_bot hX hY rw [condIndepFun_iff_condExp_inter_preimage_eq_mul hX hY] exact hCI
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.indepFun_of_condIndepCoordinates_empty · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessFaithfulness.lean:53
theorem threeNodeDAG_not_dSep_iff_cross_edge Lemma threeNodeDAG_not_dSep_iff_cross_edge in the paper ↗

For pairwise-disjoint blocks in the three-node witness DAG, d-separation fails exactly when the endpoints of its unique edge occur in opposite query blocks. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
X Y Z :
hXY :
hXZ :
hYZ :
¬ threeNodeDAG.dSep X Y Z ↔ ((0 ∈ X ∧ 1 ∈ Y) ∨ (1 ∈ X ∧ 0 ∈ Y))
Proof (Lean source)
lemma threeNodeDAG_not_dSep_iff_cross_edge (X Y Z : Finset (Fin 3)) (hXY : Disjoint X Y) (hXZ : Disjoint X Z) (hYZ : Disjoint Y Z) : ¬ threeNodeDAG.dSep X Y Z ↔ ((0 ∈ X ∧ 1 ∈ Y) ∨ (1 ∈ X ∧ 0 ∈ Y)) := by classical fin_cases X <;> fin_cases Y <;> fin_cases Z <;> first | contradiction | decide
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.threeNodeDAG_not_dSep_iff_cross_edge · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessFaithfulness.lean:74
theorem condIndepCoordinates_singletons_of_mem

Conditional independence of two coordinate blocks descends to any chosen singleton coordinate from each block. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
θ :
X Y Z :
a b :
Fin n
ha :
a ∈ X
hb :
b ∈ Y
hCI :
CondIndepCoordinates θ X Y Z
CondIndepCoordinates θ {a} {b} Z
Proof (Lean source)
lemma condIndepCoordinates_singletons_of_mem {n : ℕ} {G : DAG (Fin n)} (θ : Mechanism n G) (X Y Z : Finset (Fin n)) {a b : Fin n} (ha : a ∈ X) (hb : b ∈ Y) (hCI : CondIndepCoordinates θ X Y Z) : CondIndepCoordinates θ {a} {b} Z := by rcases hCI with ⟨hμ, hX, hY, hZ, hCI⟩ let left : ((j : {j // j ∈ X}) → ℝ) → ((j : {j // j ∈ ({a} : Finset (Fin n))}) → ℝ) := fun v _ => v ⟨a, ha⟩ let right : ((j : {j // j ∈ Y}) → ℝ) → ((j : {j // j ∈ ({b} : Finset (Fin n))}) → ℝ) := fun v _ => v ⟨b, hb⟩ have hleft : coordinateProjection ({a} : Finset (Fin n)) = left ∘ coordinateProjection X := by funext v j have hj : (j : Fin n) = a := Finset.mem_singleton.mp j.prop change v j = v a exact congrArg v hj have hright : coordinateProjection ({b} : Finset (Fin n)) = right ∘ coordinateProjection Y := by funext v j have hj : (j : Fin n) = b := Finset.mem_singleton.mp j.prop change v j = v b exact congrArg v hj refine ⟨hμ, ?_, ?_, hZ, ?_⟩ · rw [hleft] fun_prop · rw [hright] fun_prop have hc := hCI.comp (show Measurable left by fun_prop) (show Measurable right by fun_prop) simpa only [← hleft, ← hright] using hc
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.condIndepCoordinates_singletons_of_mem · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessFaithfulness.lean:85
theorem condIndepCoordinates_symm

Coordinate-block conditional independence is symmetric in its two query blocks. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
hCI :
CondIndepCoordinates θ X Y Z
CondIndepCoordinates θ Y X Z
Proof (Lean source)
lemma condIndepCoordinates_symm {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} {X Y Z : Finset (Fin n)} (hCI : CondIndepCoordinates θ X Y Z) : CondIndepCoordinates θ Y X Z := by rcases hCI with ⟨hμ, hX, hY, hZ, hCI⟩ exact ⟨hμ, hY, hX, hZ, hCI.symm⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.condIndepCoordinates_symm · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessFaithfulness.lean:121
theorem threeNodeDAG_faithful_of_edge_dependence

For the three-node witness DAG, dependence of the unique adjacent pair under every admissible conditioning block suffices for full faithfulness. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
hdep :
∀ Z : Finset (Fin 3)
if
Disjoint ({0} : Finset (Fin 3)) Z
and
Disjoint ({1} : Finset (Fin 3)) Z
then
¬ CondIndepCoordinates θ {0} {1} Z
Proof (Lean source)
lemma threeNodeDAG_faithful_of_edge_dependence {θ : Mechanism 3 threeNodeDAG} (hdep : ∀ Z : Finset (Fin 3), Disjoint ({0} : Finset (Fin 3)) Z → Disjoint ({1} : Finset (Fin 3)) Z → ¬ CondIndepCoordinates θ {0} {1} Z) : Faithfulness threeNodeDAG θ := by intro X Y Z hXY hXZ hYZ hCI by_contra hdsep rcases (threeNodeDAG_not_dSep_iff_cross_edge X Y Z hXY hXZ hYZ).mp hdsep with hcross | hcross · exact hdep Z (Finset.disjoint_singleton_left.mpr fun h0Z => (Finset.disjoint_left.mp hXZ) hcross.1 h0Z) (Finset.disjoint_singleton_left.mpr fun h1Z => (Finset.disjoint_left.mp hYZ) hcross.2 h1Z) (condIndepCoordinates_singletons_of_mem θ X Y Z hcross.1 hcross.2 hCI) · exact hdep Z (Finset.disjoint_singleton_left.mpr fun h0Z => (Finset.disjoint_left.mp hYZ) hcross.2 h0Z) (Finset.disjoint_singleton_left.mpr fun h1Z => (Finset.disjoint_left.mp hXZ) hcross.1 h1Z) (condIndepCoordinates_symm (condIndepCoordinates_singletons_of_mem θ X Y Z hcross.1 hcross.2 hCI))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.threeNodeDAG_faithful_of_edge_dependence · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessFaithfulness.lean:130
theorem threeNodeDAG_faithful_of_unconditional_edge_dependence

For the three-node witness DAG, unconditional dependence of the unique edge and independence of its first endpoint from the isolated node imply full faithfulness. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
hdep :
¬ CondIndepCoordinates θ {0} {1} ∅
hisolated :
CondIndepCoordinates θ {0} {2} ∅
Proof (Lean source)
lemma threeNodeDAG_faithful_of_unconditional_edge_dependence {θ : Mechanism 3 threeNodeDAG} (hdep : ¬ CondIndepCoordinates θ {0} {1} ∅) (hisolated : CondIndepCoordinates θ {0} {2} ∅) : Faithfulness threeNodeDAG θ := by apply threeNodeDAG_faithful_of_edge_dependence intro Z h0Z h1Z hCI classical have hZ : Z = ∅ ∨ Z = {2} := by apply Finset.subset_singleton_iff.mp intro k hk fin_cases k · exact (Finset.disjoint_singleton_left.mp h0Z hk).elim · exact (Finset.disjoint_singleton_left.mp h1Z hk).elim · simp rcases hZ with rfl | rfl · exact hdep hCI · apply hdep rcases hCI with ⟨hμ, hX, hY, hW, hXY⟩ letI := hμ rcases hisolated with ⟨_, hX', hW', hEmpty, hXW⟩ have hbot : comap (coordinateProjection (∅ : Finset (Fin 3))) inferInstance = (⊥ : MeasurableSpace (LatentState 3)) := Causalean.comap_eq_bot_of_subsingleton _ have hXY' : CondIndepFun ((⊥ : MeasurableSpace (LatentState 3)) ⊔ comap (coordinateProjection ({2} : Finset (Fin 3))) inferInstance) (sup_le bot_le hW.comap_le) (coordinateProjection {0}) (coordinateProjection {1}) (observationalLaw θ) := by simpa using hXY have hXW' : CondIndepFun (⊥ : MeasurableSpace (LatentState 3)) bot_le (coordinateProjection {0}) (coordinateProjection {2}) (observationalLaw θ) := by simpa only [hbot] using hXW have hpair := Causalean.condIndepFun_contraction_of_prodMk bot_le hX hY hW hXY' hXW' have hplain : CondIndepFun (⊥ : MeasurableSpace (LatentState 3)) bot_le (coordinateProjection {0}) (coordinateProjection {1}) (observationalLaw θ) := by convert hpair.comp measurable_id measurable_fst using 1 <;> funext ω <;> rfl exact ⟨hμ, hX, hY, hEmpty, by simpa only [hbot] using hplain⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.threeNodeDAG_faithful_of_unconditional_edge_dependence · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessFaithfulness.lean:155
theorem threeNodeDAG_isolated_independence

Every positive normalized mechanism factorizing over the three-node witness DAG makes the first endpoint of the unique edge independent of the isolated third coordinate. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
CondIndepCoordinates θ {0} {2} ∅
Proof (Lean source)
lemma threeNodeDAG_isolated_independence {θ : Mechanism 3 threeNodeDAG} (hpos : PositiveNormalizedSmoothMechanisms threeNodeDAG θ) : CondIndepCoordinates θ {0} {2} ∅ := by let τ : TopologicalRanking threeNodeDAG := { rank := fun i ↦ i.val injective_rank := Fin.val_injective edge_lt := by intro i j hij fin_cases i <;> fin_cases j <;> simp [threeNodeDAG, threeNodeEdge] at hij ⊢ } have hpred : predecessors τ 2 = {0, 1} := by ext k fin_cases k <;> decide have hraw := mechanism_condIndepGiven_orderedLocalMarkov hpos τ 2 ∅ (by simp [hpred]) (by simp [threeNodeDAG, threeNodeEdge, parents]) rw [hpred] at hraw rcases hraw with ⟨hμ, h2, h01, hE, hci⟩ letI := hμ have h0 : Measurable (coordinateProjection ({0} : Finset (Fin 3))) := by unfold coordinateProjection fun_prop have h2local : Measurable (coordinateProjection ({2} : Finset (Fin 3))) := by unfold coordinateProjection fun_prop have hleft : Measurable (fun r : ℝ ↦ fun _ : {j // j ∈ ({2} : Finset (Fin 3))} ↦ r) := by apply measurable_pi_lambda intro j exact measurable_id have hright : Measurable (fun z : (j : {j // j ∈ ({0, 1} : Finset (Fin 3))}) → ℝ ↦ fun _ : {j // j ∈ ({0} : Finset (Fin 3))} ↦ z ⟨0, by simp⟩) := by apply measurable_pi_lambda intro j exact measurable_pi_apply _ have hci' := hci.comp hleft hright have hEmptyLocal : Measurable (coordinateProjection (∅ : Finset (Fin 3))) := by unfold coordinateProjection fun_prop refine condIndepCoordinates_symm ⟨hμ, h2local, h0, hEmptyLocal, ?_⟩ change CondIndepFun (comap (coordinateProjection (∅ : Finset (Fin 3))) inferInstance) _ (coordinateProjection {2}) (coordinateProjection {0}) (observationalLaw θ) convert hci' using 1 · funext v j have hj : (j : Fin 3) = 2 := Finset.mem_singleton.mp j.prop change v j = v 2 exact congrArg v hj · funext v j have hj : (j : Fin 3) = 0 := Finset.mem_singleton.mp j.prop change v j = v 0 exact congrArg v hj
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.threeNodeDAG_isolated_independence · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessFaithfulness.lean:200
theorem threeNodeDAG_faithful_of_causalMinimality

On the explicit three-node DAG, positivity and causal minimality already imply faithfulness because the only nontrivial d-connection is its unique edge. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
Proof (Lean source)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.threeNodeDAG_faithful_of_causalMinimality · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessFaithfulness.lean:258
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.WitnessFaithfulnessAssembly 14 declarations This file turns the explicit sparse density calculation into dependence of the unique adjacent coordinate pair, and hence into faithfulness of the sparse three-node witness.

Explicit-witness faithfulness assembly

This file turns the explicit sparse density calculation into dependence of the unique adjacent coordinate pair, and hence into faithfulness of the sparse three-node witness.

theorem centeredCoordinate_sq_integral Lemma centeredCoordinate_sq_integral in the paper ↗

The squared centered coordinate has unit-interval integral 1/3. the stated conclusion follows.

Formal statement
(∫ z in Icc (0 : ℝ) 1, centeredCoordinate z ^ 2) = 1 / 3
Proof (Lean source)
lemma centeredCoordinate_sq_integral : (∫ z in Icc (0 : ℝ) 1, centeredCoordinate z ^ 2) = 1 / 3 := by rw [MeasureTheory.integral_Icc_eq_integral_Ioc] rw [← intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1)] have hfun : (fun z : ℝ => centeredCoordinate z ^ 2) = fun z => 4 * z ^ 2 - 4 * z + 1 := by funext z simp only [centeredCoordinate] ring have hpow : IntervalIntegrable (fun z : ℝ => 4 * z ^ 2) volume 0 1 := by exact (intervalIntegral.intervalIntegrable_pow 2).const_mul 4 have hid : IntervalIntegrable (fun z : ℝ => 4 * z) volume 0 1 := by exact intervalIntegral.intervalIntegrable_id.const_mul 4 rw [hfun, intervalIntegral.integral_add (hpow.sub hid) intervalIntegrable_const, intervalIntegral.integral_sub hpow hid, intervalIntegral.integral_const_mul, integral_pow, intervalIntegral.integral_const_mul, integral_id, intervalIntegral.integral_const] norm_num
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.centeredCoordinate_sq_integral · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessFaithfulnessAssembly.lean:20
theorem centeredCoordinate_reflected_sq_integral

Coordinate reflection preserves the squared centered-coordinate integral. the stated conclusion follows.

Formal statement
s :
i :
Fin 3
(∫ z in Icc (0 : ℝ) 1, centeredCoordinate (reflectedCoordinate s i z) ^ 2) = 1 / 3
Proof (Lean source)
lemma centeredCoordinate_reflected_sq_integral (s : SignVector 3) (i : Fin 3) : (∫ z in Icc (0 : ℝ) 1, centeredCoordinate (reflectedCoordinate s i z) ^ 2) = 1 / 3 := by calc _ = ∫ z in Icc (0 : ℝ) 1, centeredCoordinate z ^ 2 := integral_reflectedCoordinate s i (fun z => centeredCoordinate z ^ 2) _ = 1 / 3 := centeredCoordinate_sq_integral
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.centeredCoordinate_reflected_sq_integral · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessFaithfulnessAssembly.lean:42
theorem measurable_sparseP

Every sparse-witness observational mechanism slot is globally measurable.

Formal statement
s :
i :
Fin 3
Proof (Lean source)
@[fun_prop] lemma measurable_sparseP (s : SignVector 3) (i : Fin 3) : Measurable (sparseP s i) := by fin_cases i · change Measurable (fun _ : LatentState 3 => (1 : ℝ)) fun_prop · rcases s.signed 0 with h0 | h0 <;> rcases s.signed 1 with h1 | h1 <;> change Measurable (fun v : LatentState 3 => 1 + (1 / 10 : ℝ) * centeredCoordinate (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (reflectedCoordinate s 1 (v 1))) <;> simp [centeredCoordinate, reflectedCoordinate, reflect, h0, h1, show (-1 : ℝ) ≠ 1 by norm_num] <;> fun_prop · change Measurable (fun _ : LatentState 3 => (1 : ℝ)) fun_prop
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.measurable_sparseP · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessFaithfulnessAssembly.lean:52
theorem measurable_sparseWitness_observationalDensity

The sparse witness's observational joint density is globally measurable.

Formal statement
s :
Measurable (observationalDensity (sparseWitness s))
Proof (Lean source)
@[fun_prop] lemma measurable_sparseWitness_observationalDensity (s : SignVector 3) : Measurable (observationalDensity (sparseWitness s)) := by unfold observationalDensity apply Finset.measurable_prod intro i _ exact measurable_sparseP s i
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.measurable_sparseWitness_observationalDensity · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessFaithfulnessAssembly.lean:69
theorem continuous_reflectedCenteredCoordinate

A fixed signed reflection followed by centering is continuous.

Formal statement
s :
i :
Fin 3
Proof (Lean source)
@[fun_prop] lemma continuous_reflectedCenteredCoordinate (s : SignVector 3) (i : Fin 3) : Continuous (fun z : ℝ => centeredCoordinate (reflectedCoordinate s i z)) := by rcases s.signed i with hi | hi · simp [centeredCoordinate, reflectedCoordinate, reflect, hi, show (-1 : ℝ) ≠ 1 by norm_num] fun_prop · simp [centeredCoordinate, reflectedCoordinate, reflect, hi] fun_prop
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuous_reflectedCenteredCoordinate · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessFaithfulnessAssembly.lean:78
theorem sparseWitness_integral_eq_iterated

A continuous test function under the sparse observational law can be evaluated as the explicit three-coordinate iterated density integral. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
s :
f :
LatentState 3 → ℝ
(∫ v, f v ∂observationalLaw (sparseWitness s))
= ∫ x in Icc (0 : ℝ) 1, ∫ y in Icc (0 : ℝ) 1, ∫ z in Icc (0 : ℝ) 1, observationalDensity (sparseWitness s) ![x, y, z] * f ![x, y, z]
Proof (Lean source)
lemma sparseWitness_integral_eq_iterated (s : SignVector 3) (f : LatentState 3 → ℝ) (hf : ContinuousOn f (latentCube 3)) : (∫ v, f v ∂observationalLaw (sparseWitness s)) = ∫ x in Icc (0 : ℝ) 1, ∫ y in Icc (0 : ℝ) 1, ∫ z in Icc (0 : ℝ) 1, observationalDensity (sparseWitness s) ![x, y, z] * f ![x, y, z] := by let μ : Measure (LatentState 3) := volume.restrict (latentCube 3) have hpos := sparseWitness_positive_normalized_smooth s have hcubeCompact : IsCompact (latentCube 3) := by rw [latentCube] exact isCompact_univ_pi fun _ => isCompact_Icc have hdensityCont : ContinuousOn (observationalDensity (sparseWitness s)) (latentCube 3) := by unfold observationalDensity exact continuousOn_finset_prod _ fun i _ => (hpos.2.2.1 i).continuousOn have hprodInt : Integrable (fun v => observationalDensity (sparseWitness s) v * f v) μ := by dsimp only [μ] exact (hdensityCont.mul hf).integrableOn_compact hcubeCompact have hμ : μ = Measure.pi (fun _ : Fin 3 => volume.restrict (Icc (0 : ℝ) 1)) := by dsimp only [μ] change volume.restrict (Set.univ.pi fun _ : Fin 3 => Icc (0 : ℝ) 1) = _ rw [MeasureTheory.volume_pi, Measure.restrict_pi_pi] calc (∫ v, f v ∂observationalLaw (sparseWitness s)) = ∫ v, observationalDensity (sparseWitness s) v * f v ∂μ := by unfold observationalLaw rw [integral_withDensity_eq_integral_toReal_smul] · apply integral_congr_ae filter_upwards [ae_restrict_mem (measurableSet_latentCube 3)] with v hv rw [ENNReal.toReal_ofReal (le_of_lt (by unfold observationalDensity exact Finset.prod_pos fun i _ => hpos.1 i v hv))] rfl · exact (measurable_sparseWitness_observationalDensity s).ennreal_ofReal · filter_upwards with v exact ENNReal.ofReal_lt_top _ = _ := by rw [hμ, integral_fin_three_pi_eq_iterated _ _ (by simpa [hμ] using hprodInt)]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseWitness_integral_eq_iterated · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessFaithfulnessAssembly.lean:90
theorem sparseWitness_parent_inner_integral

Integrating the sparse density times its centered parent coordinate over the child coordinate leaves the centered parent coordinate unchanged. the stated conclusion follows.

Formal statement
s :
x :
Proof (Lean source)
lemma sparseWitness_parent_inner_integral (s : SignVector 3) (x : ℝ) : (∫ y in Icc (0 : ℝ) 1, (1 + (1 / 10 : ℝ) * centeredCoordinate (reflectedCoordinate s 0 x) * centeredCoordinate (reflectedCoordinate s 1 y)) * centeredCoordinate (reflectedCoordinate s 0 x)) = centeredCoordinate (reflectedCoordinate s 0 x) := by let A := centeredCoordinate (reflectedCoordinate s 0 x) let B : ℝ → ℝ := fun y => centeredCoordinate (reflectedCoordinate s 1 y) have hB : Continuous B := continuous_reflectedCenteredCoordinate s 1 have h1 : IntegrableOn (fun y => A * B y) (Icc (0 : ℝ) 1) := (continuous_const.mul hB).continuousOn.integrableOn_Icc have h2 : IntegrableOn (fun y => (1 / 10 : ℝ) * A ^ 2 * B y) (Icc (0 : ℝ) 1) := (continuous_const.mul hB).continuousOn.integrableOn_Icc have hconst : IntegrableOn (fun _ : ℝ => A) (Icc (0 : ℝ) 1) := continuous_const.continuousOn.integrableOn_Icc rw [show (fun y => (1 + (1 / 10 : ℝ) * A * B y) * A) = fun y => A + (1 / 10 : ℝ) * A ^ 2 * B y by funext y; ring, integral_add hconst h2, MeasureTheory.integral_const, MeasureTheory.integral_const_mul, centeredCoordinate_reflected_integral, mul_zero, add_zero] simp [A, Real.volume_Icc]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseWitness_parent_inner_integral · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessFaithfulnessAssembly.lean:135
theorem sparseWitness_child_inner_integral

Integrating the sparse density times the centered child coordinate produces one thirtieth of the centered parent coordinate. the stated conclusion follows.

Formal statement
s :
x :
(∫ y in Icc (0 : ℝ) 1, (1 + (1 / 10 : ℝ) * centeredCoordinate (reflectedCoordinate s 0 x) * centeredCoordinate (reflectedCoordinate s 1 y)) * centeredCoordinate (reflectedCoordinate s 1 y))
= (1 / 30 : ℝ) * centeredCoordinate (reflectedCoordinate s 0 x)
Proof (Lean source)
lemma sparseWitness_child_inner_integral (s : SignVector 3) (x : ℝ) : (∫ y in Icc (0 : ℝ) 1, (1 + (1 / 10 : ℝ) * centeredCoordinate (reflectedCoordinate s 0 x) * centeredCoordinate (reflectedCoordinate s 1 y)) * centeredCoordinate (reflectedCoordinate s 1 y)) = (1 / 30 : ℝ) * centeredCoordinate (reflectedCoordinate s 0 x) := by let A := centeredCoordinate (reflectedCoordinate s 0 x) let B : ℝ → ℝ := fun y => centeredCoordinate (reflectedCoordinate s 1 y) have hB : Continuous B := continuous_reflectedCenteredCoordinate s 1 have h1 : IntegrableOn B (Icc (0 : ℝ) 1) := hB.continuousOn.integrableOn_Icc have h2 : IntegrableOn (fun y => (1 / 10 : ℝ) * A * B y ^ 2) (Icc (0 : ℝ) 1) := (continuous_const.mul (hB.pow 2)).continuousOn.integrableOn_Icc rw [show (fun y => (1 + (1 / 10 : ℝ) * A * B y) * B y) = fun y => B y + (1 / 10 : ℝ) * A * B y ^ 2 by funext y; ring, integral_add h1 h2, MeasureTheory.integral_const_mul, centeredCoordinate_reflected_integral, centeredCoordinate_reflected_sq_integral] dsimp only [A] ring
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseWitness_child_inner_integral · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessFaithfulnessAssembly.lean:161
theorem sparseWitness_joint_inner_integral

Integrating the sparse density times both centered edge coordinates over the child coordinate produces one thirtieth of the squared parent coordinate. the stated conclusion follows.

Formal statement
s :
x :
= (1 / 30 : ℝ) * centeredCoordinate (reflectedCoordinate s 0 x) ^ 2
Proof (Lean source)
lemma sparseWitness_joint_inner_integral (s : SignVector 3) (x : ℝ) : (∫ y in Icc (0 : ℝ) 1, (1 + (1 / 10 : ℝ) * centeredCoordinate (reflectedCoordinate s 0 x) * centeredCoordinate (reflectedCoordinate s 1 y)) * (centeredCoordinate (reflectedCoordinate s 0 x) * centeredCoordinate (reflectedCoordinate s 1 y))) = (1 / 30 : ℝ) * centeredCoordinate (reflectedCoordinate s 0 x) ^ 2 := by let A := centeredCoordinate (reflectedCoordinate s 0 x) let B : ℝ → ℝ := fun y => centeredCoordinate (reflectedCoordinate s 1 y) have hB : Continuous B := continuous_reflectedCenteredCoordinate s 1 have h1 : IntegrableOn (fun y => A * B y) (Icc (0 : ℝ) 1) := (continuous_const.mul hB).continuousOn.integrableOn_Icc have h2 : IntegrableOn (fun y => (1 / 10 : ℝ) * A ^ 2 * B y ^ 2) (Icc (0 : ℝ) 1) := (continuous_const.mul (hB.pow 2)).continuousOn.integrableOn_Icc rw [show (fun y => (1 + (1 / 10 : ℝ) * A * B y) * (A * B y)) = fun y => A * B y + (1 / 10 : ℝ) * A ^ 2 * B y ^ 2 by funext y; ring, integral_add h1 h2, MeasureTheory.integral_const_mul, MeasureTheory.integral_const_mul, centeredCoordinate_reflected_integral, centeredCoordinate_reflected_sq_integral] dsimp only [A] ring
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseWitness_joint_inner_integral · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessFaithfulnessAssembly.lean:186
theorem sparseWitness_centered_marginal_zero

Each reflected centered endpoint has zero mean under the sparse observational law. the stated conclusion follows.

Formal statement
s :
i :
Fin 2
(∫ v, centeredCoordinate (reflectedCoordinate s i.castSucc (v i.castSucc)) ∂observationalLaw (sparseWitness s))
= 0
Proof (Lean source)
lemma sparseWitness_centered_marginal_zero (s : SignVector 3) (i : Fin 2) : (∫ v, centeredCoordinate (reflectedCoordinate s i.castSucc (v i.castSucc)) ∂observationalLaw (sparseWitness s)) = 0 := by rw [sparseWitness_integral_eq_iterated] · fin_cases i · simp [observationalDensity, sparseWitness, sparseP] calc _ = ∫ x in Icc (0 : ℝ) 1, centeredCoordinate (reflectedCoordinate s 0 x) := by apply integral_congr_ae filter_upwards with x simpa [one_div] using sparseWitness_parent_inner_integral s x _ = 0 := centeredCoordinate_reflected_integral s 0 · simp [observationalDensity, sparseWitness, sparseP] calc _ = ∫ x in Icc (0 : ℝ) 1, (1 / 30 : ℝ) * centeredCoordinate (reflectedCoordinate s 0 x) := by apply integral_congr_ae filter_upwards with x simpa [one_div] using sparseWitness_child_inner_integral s x _ = 0 := by rw [MeasureTheory.integral_const_mul, centeredCoordinate_reflected_integral, mul_zero] · apply Continuous.continuousOn exact (continuous_reflectedCenteredCoordinate s i.castSucc).comp (continuous_apply i.castSucc)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseWitness_centered_marginal_zero · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessFaithfulnessAssembly.lean:213
theorem sparseWitness_centered_jointMoment

The two reflected centered edge coordinates have the exact positive sparse-law joint moment 1/90. the stated conclusion follows.

Formal statement
s :
(∫ v, centeredCoordinate (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (reflectedCoordinate s 1 (v 1)) ∂observationalLaw (sparseWitness s))
= 1 / 90
Proof (Lean source)
lemma sparseWitness_centered_jointMoment (s : SignVector 3) : (∫ v, centeredCoordinate (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (reflectedCoordinate s 1 (v 1)) ∂observationalLaw (sparseWitness s)) = 1 / 90 := by rw [sparseWitness_integral_eq_iterated] · simp [observationalDensity, sparseWitness, sparseP] calc _ = ∫ x in Icc (0 : ℝ) 1, (1 / 30 : ℝ) * centeredCoordinate (reflectedCoordinate s 0 x) ^ 2 := by apply integral_congr_ae filter_upwards with x simpa [one_div] using sparseWitness_joint_inner_integral s x _ = 1 / 90 := by rw [MeasureTheory.integral_const_mul, centeredCoordinate_reflected_sq_integral] norm_num norm_num · apply Continuous.continuousOn exact ((continuous_reflectedCenteredCoordinate s 0).comp (continuous_apply 0)).mul ((continuous_reflectedCenteredCoordinate s 1).comp (continuous_apply 1))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseWitness_centered_jointMoment · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessFaithfulnessAssembly.lean:242
theorem sparseWitness_not_condIndep_edge

The exact nonzero centered cross-moment rules out independence of the sparse witness's unique adjacent coordinate pair. the stated conclusion follows.

Formal statement
s :
¬ CondIndepCoordinates (sparseWitness s) {0} {1} ∅
Proof (Lean source)
lemma sparseWitness_not_condIndep_edge (s : SignVector 3) : ¬ CondIndepCoordinates (sparseWitness s) {0} {1} ∅ := by intro hCI letI : IsProbabilityMeasure (observationalLaw (sparseWitness s)) := observationalLaw_isProbabilityMeasure (sparseWitness_positive_normalized_smooth s) have hblocks := indepFun_of_condIndepCoordinates_empty ({0} : Finset (Fin 3)) ({1} : Finset (Fin 3)) hCI let z0 : {j // j ∈ ({0} : Finset (Fin 3))} := ⟨0, by simp⟩ let z1 : {j // j ∈ ({1} : Finset (Fin 3))} := ⟨1, by simp⟩ let left : ((j : {j // j ∈ ({0} : Finset (Fin 3))}) → ℝ) → ℝ := fun z => centeredCoordinate (reflectedCoordinate s 0 (z z0)) let right : ((j : {j // j ∈ ({1} : Finset (Fin 3))}) → ℝ) → ℝ := fun z => centeredCoordinate (reflectedCoordinate s 1 (z z1)) have hleft : Measurable left := by unfold left exact (continuous_reflectedCenteredCoordinate s 0).measurable.comp (measurable_pi_apply z0) have hright : Measurable right := by unfold right exact (continuous_reflectedCenteredCoordinate s 1).measurable.comp (measurable_pi_apply z1) have hindRaw := hblocks.comp hleft hright have hind : IndepFun (fun v : LatentState 3 => centeredCoordinate (reflectedCoordinate s 0 (v 0))) (fun v : LatentState 3 => centeredCoordinate (reflectedCoordinate s 1 (v 1))) (observationalLaw (sparseWitness s)) := by convert hindRaw using 1 <;> funext v <;> rfl have hmul := hind.integral_fun_mul_eq_mul_integral ((continuous_reflectedCenteredCoordinate s 0).measurable.comp (measurable_pi_apply 0)).aestronglyMeasurable ((continuous_reflectedCenteredCoordinate s 1).measurable.comp (measurable_pi_apply 1)).aestronglyMeasurable have hm0 : (∫ v, centeredCoordinate (reflectedCoordinate s 0 (v 0)) ∂observationalLaw (sparseWitness s)) = 0 := by simpa using sparseWitness_centered_marginal_zero s (0 : Fin 2) have hm1 : (∫ v, centeredCoordinate (reflectedCoordinate s 1 (v 1)) ∂observationalLaw (sparseWitness s)) = 0 := by simpa using sparseWitness_centered_marginal_zero s (1 : Fin 2) rw [sparseWitness_centered_jointMoment, hm0, hm1] at hmul norm_num at hmul
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseWitness_not_condIndep_edge · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessFaithfulnessAssembly.lean:267
theorem sparseWitness_causalMinimality

The sparse witness is causally minimal for the one-edge three-node DAG. the stated conclusion follows.

Formal statement
s :
Proof (Lean source)
lemma sparseWitness_causalMinimality (s : SignVector 3) : CausalMinimality threeNodeDAG (sparseWitness s) := by intro j i hji rcases hji with ⟨rfl, rfl⟩ intro hCI apply sparseWitness_not_condIndep_edge s have hparents : (threeNodeDAG.parents 1).erase 0 = ∅ := by ext k fin_cases k <;> simp [threeNodeDAG, threeNodeEdge, parents] rw [hparents] at hCI have hsymm := condIndepCoordinates_symm hCI exact hsymm
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseWitness_causalMinimality · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessFaithfulnessAssembly.lean:311
theorem sparseWitness_faithfulness

The sparse witness is faithful to 0 → 1 with isolated node 2. the stated conclusion follows.

Formal statement
s :
Proof (Lean source)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseWitness_faithfulness · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessFaithfulnessAssembly.lean:326
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.WitnessMomentMmdAssembly 10 declarations

For a parent coordinate, the sparse child-weight integral averages the squared intervention density against the sparse denominator.

Definition (Lean source)
x :
sparseA x :
∫ y in Icc (0 : ℝ) 1, exponentialInterventionDensity y ^ 2 / (1 + (centeredCoordinate x / 10) * centeredCoordinate y)
theorem sparseA_hasDerivAt

At a point of the unit interval, the sparse child-weight integral has the stated derivative.

Formal statement
x :
hx :
x ∈ Icc (0 : ℝ) 1
HasDerivAt sparseA (-(1 / 5 : ℝ) * ∫ y in Icc (0 : ℝ) 1, centeredCoordinate y * sparseWeight (centeredCoordinate x / 10) y) x
Proof (Lean source)
lemma sparseA_hasDerivAt {x : ℝ} (hx : x ∈ Icc (0 : ℝ) 1) : HasDerivAt sparseA (-(1 / 5 : ℝ) * ∫ y in Icc (0 : ℝ) 1, centeredCoordinate y * sparseWeight (centeredCoordinate x / 10) y) x := by change HasDerivAt (fun x : ℝ => ∫ y in Icc (0 : ℝ) 1, exponentialInterventionDensity y ^ 2 / (1 + (centeredCoordinate x / 10) * centeredCoordinate y)) _ x let F : ℝ → ℝ → ℝ := fun x y => exponentialInterventionDensity y ^ 2 / (1 + (centeredCoordinate x / 10) * centeredCoordinate y) let F' : ℝ → ℝ → ℝ := fun x y => -(1 / 5 : ℝ) * centeredCoordinate y * sparseWeight (centeredCoordinate x / 10) y let μ : Measure ℝ := volume.restrict (Icc (0 : ℝ) 1) have hs : Ioo (-1 / 4 : ℝ) (5 / 4) ∈ 𝓝 x := IsOpen.mem_nhds isOpen_Ioo (by constructor <;> nlinarith [hx.1, hx.2]) have hden : ∀ z ∈ Ioo (-1 / 4 : ℝ) (5 / 4), ∀ y ∈ Icc (0 : ℝ) 1, 0 < 1 + centeredCoordinate z / 10 * centeredCoordinate y := by intro z hz y hy have hh := abs_centeredCoordinate_le_one hy rw [abs_le] at hh have hzcenter : (-3 / 2 : ℝ) < centeredCoordinate z ∧ centeredCoordinate z < 3 / 2 := by unfold centeredCoordinate constructor <;> linarith [hz.1, hz.2] have hzabs : |centeredCoordinate z| < 3 / 2 := (abs_lt).2 ⟨by linarith, hzcenter.2⟩ have hyabs : |centeredCoordinate y| ≤ 1 := (abs_le).2 hh have habs : |centeredCoordinate z / 10 * centeredCoordinate y| < 3 / 20 := by rw [abs_mul, abs_div, abs_of_pos (by norm_num : (0 : ℝ) < 10)] calc |centeredCoordinate z| / 10 * |centeredCoordinate y| ≤ |centeredCoordinate z| / 10 * 1 := by gcongr _ < 3 / 20 := by nlinarith linarith [neg_lt_of_abs_lt habs] have hqcont : Continuous exponentialInterventionDensity := by unfold exponentialInterventionDensity fun_prop have hccont : Continuous centeredCoordinate := by unfold centeredCoordinate fun_prop have hF_meas : ∀ᶠ z in 𝓝 x, AEStronglyMeasurable (F z) μ := by filter_upwards [hs] with z hz have hzcont : ContinuousOn (F z) (Icc (0 : ℝ) 1) := by dsimp only [F] apply ContinuousOn.div (hqcont.pow 2).continuousOn (continuous_const.add (continuous_const.mul hccont)).continuousOn intro y hy exact (hden z hz y hy).ne' exact hzcont.aestronglyMeasurable measurableSet_Icc have hF_int : Integrable (F x) μ := by apply ContinuousOn.integrableOn_compact isCompact_Icc dsimp only [F] apply ContinuousOn.div · exact (hqcont.pow 2).continuousOn · exact (continuous_const.add (continuous_const.mul hccont)).continuousOn · intro y hy exact (hden x (by constructor <;> nlinarith [hx.1, hx.2]) y hy).ne' have hF'_meas : AEStronglyMeasurable (F' x) μ := by have hcont : ContinuousOn (F' x) (Icc (0 : ℝ) 1) := by dsimp only [F', sparseWeight] apply ContinuousOn.mul (continuous_const.mul hccont).continuousOn apply ContinuousOn.div (hqcont.pow 2).continuousOn ((continuous_const.add (continuous_const.mul hccont)).pow 2).continuousOn intro y hy exact pow_ne_zero 2 (hden x (by constructor <;> nlinarith [hx.1, hx.2]) y hy).ne' exact hcont.aestronglyMeasurable measurableSet_Icc have h_bound : ∀ᵐ y ∂μ, ∀ z ∈ Ioo (-1 / 4 : ℝ) (5 / 4), ‖F' z y‖ ≤ (10 : ℝ) := by filter_upwards [ae_restrict_mem measurableSet_Icc] with y hy z hz have hh := abs_centeredCoordinate_le_one hy have hq := exponentialInterventionDensity_lt_thirteen_div_three hy have hqp := exponentialInterventionDensity_pos y have hd := hden z hz y hy have hdlower : (17 / 20 : ℝ) < 1 + centeredCoordinate z / 10 * centeredCoordinate y := by rw [abs_le] at hh have hzcenter : (-3 / 2 : ℝ) < centeredCoordinate z ∧ centeredCoordinate z < 3 / 2 := by unfold centeredCoordinate constructor <;> linarith [hz.1, hz.2] have hzabs : |centeredCoordinate z| < 3 / 2 := (abs_lt).2 ⟨by linarith, hzcenter.2⟩ have hyabs : |centeredCoordinate y| ≤ 1 := (abs_le).2 hh have habs : |centeredCoordinate z / 10 * centeredCoordinate y| < 3 / 20 := by rw [abs_mul, abs_div, abs_of_pos (by norm_num : (0 : ℝ) < 10)] calc |centeredCoordinate z| / 10 * |centeredCoordinate y| ≤ |centeredCoordinate z| / 10 * 1 := by gcongr _ < 3 / 20 := by nlinarith linarith [neg_lt_of_abs_lt habs] dsimp only [F', sparseWeight] rw [Real.norm_eq_abs, abs_mul, abs_mul, abs_div, abs_pow, abs_of_pos hqp] norm_num only [abs_neg, abs_of_nonneg, one_div] rw [show |(1 + centeredCoordinate z / 10 * centeredCoordinate y) ^ 2| = (1 + centeredCoordinate z / 10 * centeredCoordinate y) ^ 2 by exact abs_of_nonneg (sq_nonneg _)] have hhs : |centeredCoordinate y| ≤ 1 := hh have hnum : exponentialInterventionDensity y ^ 2 < (13 / 3 : ℝ) ^ 2 := by nlinarith have hdsq : (17 / 20 : ℝ) ^ 2 < (1 + centeredCoordinate z / 10 * centeredCoordinate y) ^ 2 := by nlinarith rw [show (1 / 5 : ℝ) * |centeredCoordinate y| * (exponentialInterventionDensity y ^ 2 / (1 + centeredCoordinate z / 10 * centeredCoordinate y) ^ 2) = ((1 / 5 : ℝ) * |centeredCoordinate y| * exponentialInterventionDensity y ^ 2) / (1 + centeredCoordinate z / 10 * centeredCoordinate y) ^ 2 by ring] rw [div_le_iff₀ (sq_pos_of_pos hd)] nlinarith [sq_nonneg (1 + centeredCoordinate z / 10 * centeredCoordinate y)] have hbound_int : Integrable (fun _ : ℝ => (10 : ℝ)) μ := by dsimp only [μ] exact continuous_const.continuousOn.integrableOn_compact isCompact_Icc have hdiff : ∀ᵐ y ∂μ, ∀ z ∈ Ioo (-1 / 4 : ℝ) (5 / 4), HasDerivAt (fun z => F z y) (F' z y) z := by filter_upwards [ae_restrict_mem measurableSet_Icc] with y hy z hz have hd := (hden z hz y hy).ne' have hh : HasDerivAt (fun z : ℝ => centeredCoordinate z / 10) (1 / 5) z := by have hp0 : HasDerivAt (fun u : ℝ => 2 * u - 1) 2 z := by convert (hasDerivAt_const_mul (x := z) 2).sub_const 1 using 1 have hh' := hp0.div_const 10 apply hh'.congr_deriv norm_num have hdenDeriv : HasDerivAt (fun z : ℝ => 1 + centeredCoordinate z / 10 * centeredCoordinate y) ((1 / 5 : ℝ) * centeredCoordinate y) z := by simpa using (hh.mul_const (centeredCoordinate y)).const_add 1 have hnum : HasDerivAt (fun _ : ℝ => exponentialInterventionDensity y ^ 2) 0 z := hasDerivAt_const (x := z) (c := exponentialInterventionDensity y ^ 2) have hraw : HasDerivAt (fun z : ℝ => exponentialInterventionDensity y ^ 2 / (1 + centeredCoordinate z / 10 * centeredCoordinate y)) ((0 * (1 + centeredCoordinate z / 10 * centeredCoordinate y) - exponentialInterventionDensity y ^ 2 * ((1 / 5 : ℝ) * centeredCoordinate y)) / (1 + centeredCoordinate z / 10 * centeredCoordinate y) ^ 2) z := hnum.div hdenDeriv hd dsimp only [F, F', sparseWeight] apply hraw.congr_deriv field_simp [hd] ring have h := hasDerivAt_integral_of_dominated_loc_of_deriv_le (𝕜 := ℝ) hs hF_meas hF_int hF'_meas h_bound hbound_int hdiff apply h.2.congr_deriv dsimp only [F', μ] rw [show (fun y : ℝ => -(1 / 5 : ℝ) * centeredCoordinate y * sparseWeight (centeredCoordinate x / 10) y) = fun y => -(1 / 5 : ℝ) * (centeredCoordinate y * sparseWeight (centeredCoordinate x / 10) y) by funext y; ring] rw [MeasureTheory.integral_const_mul]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseA_hasDerivAt · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessMomentMmdAssembly.lean:23
theorem sparseA_deriv_eq

At a point of the unit interval, the derivative of the sparse child-weight integral equals its centered-weight formula.

Formal statement
x :
hx :
x ∈ Icc (0 : ℝ) 1
= -(1 / 5 : ℝ) * ∫ y in Icc (0 : ℝ) 1, centeredCoordinate y * sparseWeight (centeredCoordinate x / 10) y
Proof (Lean source)
lemma sparseA_deriv_eq {x : ℝ} (hx : x ∈ Icc (0 : ℝ) 1) : deriv sparseA x = -(1 / 5 : ℝ) * ∫ y in Icc (0 : ℝ) 1, centeredCoordinate y * sparseWeight (centeredCoordinate x / 10) y := (sparseA_hasDerivAt hx).deriv
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseA_deriv_eq · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessMomentMmdAssembly.lean:172
theorem sparseA_continuousOn

The sparse child-weight integral is continuous on the unit interval.

Formal statement
ContinuousOn sparseA (Icc (0 : ℝ) 1)
Proof (Lean source)
lemma sparseA_continuousOn : ContinuousOn sparseA (Icc (0 : ℝ) 1) := by exact fun x hx => (sparseA_hasDerivAt hx).continuousAt.continuousWithinAt
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseA_continuousOn · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessMomentMmdAssembly.lean:181
theorem sparseA_deriv_intervalIntegrable

The derivative of the sparse child-weight integral is interval-integrable.

Formal statement
Proof (Lean source)
lemma sparseA_deriv_intervalIntegrable : IntervalIntegrable (deriv sparseA) volume 0 1 := by rw [intervalIntegrable_iff] refine IntegrableOn.of_bound (by simp) ((stronglyMeasurable_deriv sparseA).aestronglyMeasurable.restrict) 10 ?_ filter_upwards [ae_restrict_mem measurableSet_uIoc] with x hx all_goals have hx' : x ∈ Icc (0 : ℝ) 1 := by rw [uIoc_of_le (by norm_num : (0 : ℝ) ≤ 1)] at hx exact ⟨le_of_lt hx.1, hx.2⟩ rw [sparseA_deriv_eq hx'] rw [norm_mul, Real.norm_eq_abs] norm_num only [abs_neg, abs_of_nonneg, one_div] have hi : IntegrableOn (fun y => centeredCoordinate y * sparseWeight (centeredCoordinate x / 10) y) (Icc (0 : ℝ) 1) := by have ha : centeredCoordinate x / 10 ∈ Icc (-1 / 10 : ℝ) (1 / 10) := by have hh := abs_centeredCoordinate_le_one hx' rw [abs_le] at hh exact ⟨by nlinarith [hh.1], by nlinarith [hh.2]⟩ have hden : ∀ y ∈ Icc (0 : ℝ) 1, 1 + centeredCoordinate x / 10 * centeredCoordinate y ≠ 0 := by intro y hy have hh := abs_centeredCoordinate_le_one hy rw [abs_le] at hh rcases ha with ⟨ha1, ha2⟩ nlinarith apply ContinuousOn.integrableOn_Icc apply ContinuousOn.mul (by unfold centeredCoordinate; fun_prop) unfold sparseWeight apply ContinuousOn.div · unfold exponentialInterventionDensity; fun_prop · unfold centeredCoordinate; fun_prop · intro y hy exact pow_ne_zero 2 (hden y hy) calc (1 / 5 : ℝ) * ‖∫ y in Icc (0 : ℝ) 1, centeredCoordinate y * sparseWeight (centeredCoordinate x / 10) y‖ ≤ (1 / 5 : ℝ) * ∫ y in Icc (0 : ℝ) 1, ‖centeredCoordinate y * sparseWeight (centeredCoordinate x / 10) y‖ := by gcongr exact norm_integral_le_integral_norm _ _ ≤ (1 / 5 : ℝ) * 50 := by gcongr calc (∫ y in Icc (0 : ℝ) 1, ‖centeredCoordinate y * sparseWeight (centeredCoordinate x / 10) y‖) ≤ ∫ _y in Icc (0 : ℝ) 1, (50 : ℝ) := by apply integral_mono_ae hi.norm (continuous_const.continuousOn.integrableOn_compact isCompact_Icc) filter_upwards [ae_restrict_mem measurableSet_Icc] with y hy have hh := abs_centeredCoordinate_le_one hy have hq := exponentialInterventionDensity_lt_thirteen_div_three hy have hqp := exponentialInterventionDensity_pos y have ha : centeredCoordinate x / 10 ∈ Icc (-1 / 10 : ℝ) (1 / 10) := by have hhx := abs_centeredCoordinate_le_one hx' rw [abs_le] at hhx exact ⟨by nlinarith [hhx.1], by nlinarith [hhx.2]⟩ have hd : (9 / 10 : ℝ) ≤ 1 + centeredCoordinate x / 10 * centeredCoordinate y := by rw [abs_le] at hh rcases ha with ⟨ha1, ha2⟩ nlinarith rw [Real.norm_eq_abs, abs_mul] simp only [sparseWeight] rw [abs_div, abs_pow, abs_of_pos hqp] rw [show |(1 + centeredCoordinate x / 10 * centeredCoordinate y) ^ 2| = (1 + centeredCoordinate x / 10 * centeredCoordinate y) ^ 2 by exact abs_of_nonneg (sq_nonneg _)] rw [show |centeredCoordinate y| * (exponentialInterventionDensity y ^ 2 / (1 + centeredCoordinate x / 10 * centeredCoordinate y) ^ 2) = (|centeredCoordinate y| * exponentialInterventionDensity y ^ 2) / (1 + centeredCoordinate x / 10 * centeredCoordinate y) ^ 2 by ring] rw [div_le_iff₀ (sq_pos_of_pos (by linarith))] have hqsq : exponentialInterventionDensity y ^ 2 < (13 / 3 : ℝ) ^ 2 := by nlinarith nlinarith [sq_nonneg (1 + centeredCoordinate x / 10 * centeredCoordinate y)] _ = 50 := by simp [Measure.real, Real.volume_Icc] _ = 10 := by norm_num
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseA_deriv_intervalIntegrable · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessMomentMmdAssembly.lean:186
theorem neg_cancellationPrimitive_integral_eq_centeredMean Lemma neg_cancellationPrimitive_integral_eq_centeredMean in the paper ↗

The integral of the negated cancellation primitive equals its explicit centered mean.

Formal statement
(∫ x in Icc (0 : ℝ) 1, -cancellationPrimitive x) = 1 / (1 - exp (-4)) - 3 / 4
Proof (Lean source)
lemma neg_cancellationPrimitive_integral_eq_centeredMean : (∫ x in Icc (0 : ℝ) 1, -cancellationPrimitive x) = 1 / (1 - exp (-4)) - 3 / 4 := by have hip := intervalIntegral.integral_mul_deriv_eq_deriv_mul (a := (0 : ℝ)) (b := 1) (u := fun x : ℝ => x) (v := cancellationPrimitive) (u' := fun _ => (1 : ℝ)) (v' := fun x => exponentialInterventionDensity x - 1) (fun x _ => hasDerivAt_id x) (fun x _ => cancellationPrimitive_hasDerivAt x) (continuous_const.intervalIntegrable 0 1) ((by unfold exponentialInterventionDensity; fun_prop : Continuous (fun x => exponentialInterventionDensity x - 1)).intervalIntegrable 0 1) simp only [one_mul, one_mul, zero_mul, sub_zero, cancellationPrimitive_zero] at hip rw [MeasureTheory.integral_Icc_eq_integral_Ioc, ← intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1)] rw [intervalIntegral.integral_neg] have hxq : IntervalIntegrable (fun x => x * exponentialInterventionDensity x) volume 0 1 := (by unfold exponentialInterventionDensity; fun_prop : Continuous (fun x => x * exponentialInterventionDensity x)).intervalIntegrable 0 1 have hxone : IntervalIntegrable (fun x : ℝ => x) volume 0 1 := continuous_id.intervalIntegrable 0 1 have hsplit : (∫ x in (0 : ℝ)..1, x * (exponentialInterventionDensity x - 1)) = (∫ x in (0 : ℝ)..1, x * exponentialInterventionDensity x) - ∫ x in (0 : ℝ)..1, x := by rw [show (fun x : ℝ => x * (exponentialInterventionDensity x - 1)) = fun x => x * exponentialInterventionDensity x - x by funext x; ring, intervalIntegral.integral_sub hxq hxone] rw [hsplit] at hip have hxqeq : (∫ x in (0 : ℝ)..1, x * exponentialInterventionDensity x) = 1 / (1 - exp (-4)) - 1 / 4 := by rw [intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1), ← MeasureTheory.integral_Icc_eq_integral_Ioc] exact exponentialInterventionDensity_firstMoment have hid : (∫ x in (0 : ℝ)..1, x) = 1 / 2 := by rw [integral_id]; norm_num rw [hxqeq, hid] at hip linarith
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.neg_cancellationPrimitive_integral_eq_centeredMean · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessMomentMmdAssembly.lean:268
theorem sparse_unreflected_moment_gap

The unreflected sparse construction has a strictly positive quantitative moment gap.

Formal statement
(3 / 10000 : ℝ) < ∫ x in Icc (0 : ℝ) 1, (1 - exponentialInterventionDensity x) * sparseA x
Proof (Lean source)
lemma sparse_unreflected_moment_gap : (3 / 10000 : ℝ) < ∫ x in Icc (0 : ℝ) 1, (1 - exponentialInterventionDensity x) * sparseA x := by let C : ℝ := (1 / 6 : ℝ) * ((68 / 9 : ℝ) * (4 / 729) * (100 / 121)) have hHcont : Continuous cancellationPrimitive := by unfold cancellationPrimitive fun_prop have hqcont : Continuous exponentialInterventionDensity := by unfold exponentialInterventionDensity fun_prop have hip := intervalIntegral.integral_mul_deriv_eq_deriv_mul (a := (0 : ℝ)) (b := 1) (u := cancellationPrimitive) (v := sparseA) (u' := fun x => exponentialInterventionDensity x - 1) (v' := deriv sparseA) (fun x _ => cancellationPrimitive_hasDerivAt x) (fun x hx => by have hx' : x ∈ Icc (0 : ℝ) 1 := by simpa only [uIcc_of_le (by norm_num : (0 : ℝ) ≤ 1)] using hx simpa only [sparseA_deriv_eq hx'] using sparseA_hasDerivAt hx') ((hqcont.sub continuous_const).intervalIntegrable 0 1) sparseA_deriv_intervalIntegrable simp only [cancellationPrimitive_zero, zero_mul, sub_self] at hip have hgapEq : (∫ x in Icc (0 : ℝ) 1, (1 - exponentialInterventionDensity x) * sparseA x) = ∫ x in Icc (0 : ℝ) 1, cancellationPrimitive x * deriv sparseA x := by rw [MeasureTheory.integral_Icc_eq_integral_Ioc, MeasureTheory.integral_Icc_eq_integral_Ioc, ← intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1), ← intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1)] rw [show (fun x : ℝ => (1 - exponentialInterventionDensity x) * sparseA x) = fun x => -((exponentialInterventionDensity x - 1) * sparseA x) by funext x; ring, intervalIntegral.integral_neg] linarith rw [hgapEq] have hright : IntegrableOn (fun x => cancellationPrimitive x * deriv sparseA x) (Icc (0 : ℝ) 1) := by rw [integrableOn_Icc_iff_integrableOn_Ioc] rw [← intervalIntegrable_iff_integrableOn_Ioc_of_le (by norm_num : (0 : ℝ) ≤ 1)] exact sparseA_deriv_intervalIntegrable.continuousOn_mul hHcont.continuousOn have hleft : IntegrableOn (fun x => (1 / 5 : ℝ) * C * (-cancellationPrimitive x)) (Icc (0 : ℝ) 1) := by exact (continuous_const.mul hHcont.neg).continuousOn.integrableOn_Icc have hmono : (∫ x in Icc (0 : ℝ) 1, (1 / 5 : ℝ) * C * (-cancellationPrimitive x)) ≤ ∫ x in Icc (0 : ℝ) 1, cancellationPrimitive x * deriv sparseA x := by apply integral_mono_ae hleft hright filter_upwards [ae_restrict_mem measurableSet_Icc] with x hx have hH : cancellationPrimitive x ≤ 0 := (cancellationPrimitive_mem_negUnitInterval hx).2 have ha : centeredCoordinate x / 10 ∈ Icc (-1 / 10 : ℝ) (1 / 10) := by have hh := abs_centeredCoordinate_le_one hx rw [abs_le] at hh exact ⟨by nlinarith [hh.1], by nlinarith [hh.2]⟩ have hI := sparseWeight_centered_integral_lower_bound ha rw [sparseA_deriv_eq hx] dsimp only [C] nlinarith rw [MeasureTheory.integral_const_mul, neg_cancellationPrimitive_integral_eq_centeredMean] at hmono have hcert := sparseWeight_moment_certificate (a := 0) (by norm_num) dsimp only [C] at hmono have hI0 := sparseWeight_centered_integral_lower_bound (show (0 : ℝ) ∈ Icc (-1 / 10) (1 / 10) by norm_num) have hgap := exponentialTiltMeanGap_gt have hrat := sparseMomentRationalCertificate have hexact := sparseMomentCoefficient_exact nlinarith
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparse_unreflected_moment_gap · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessMomentMmdAssembly.lean:310
theorem sparse_secondMomentContrast_eq_neg_gap

The sparse witness's second-moment contrast equals the negative analytic gap.

Formal statement
s :
Proof (Lean source)
lemma sparse_secondMomentContrast_eq_neg_gap (s : SignVector 3) : secondMomentContrast (canonicalObservedWorld threeNodeDAG (sparseWitness s) (refl (Fin 3))) 0 1 = -(∫ x in Icc (0 : ℝ) 1, (1 - exponentialInterventionDensity x) * sparseA x) := by have hpos := sparseWitness_positive_normalized_smooth s rw [canonical_secondMomentContrast_eq_integral_for_witness hpos (by norm_num : (0 : Fin 3) ≠ 1)] let f : LatentState 3 → ℝ := fun v => ((sparseWitness s).q 1 (v 1)) ^ 2 * ((sparseWitness s).q 0 (v 0) - (sparseWitness s).p 0 v) * (∏ l ∈ (Finset.univ.erase 1).erase 0, (sparseWitness s).p l v) / (sparseWitness s).p 1 v have hfcont : ContinuousOn f (latentCube 3) := by apply ContinuousOn.div · apply ContinuousOn.mul · apply ContinuousOn.mul · exact ((hpos.2.2.2.1 1).continuousOn.comp ((continuous_apply 1).continuousOn) (fun (v : LatentState 3) (hv : v ∈ latentCube 3) => hv 1 (Set.mem_univ 1))).pow 2 · exact ((hpos.2.2.2.1 0).continuousOn.comp ((continuous_apply 0).continuousOn) (fun (v : LatentState 3) (hv : v ∈ latentCube 3) => hv 0 (Set.mem_univ 0))).sub (hpos.2.2.1 0).continuousOn · exact continuousOn_finsetProd _ fun l _ => (hpos.2.2.1 l).continuousOn · exact (hpos.2.2.1 1).continuousOn · intro v hv exact ne_of_gt (hpos.1 1 v hv) have hf : Integrable f (volume.restrict (latentCube 3)) := hfcont.integrableOn_compact (by rw [latentCube] exact isCompact_univ_pi fun _ => isCompact_Icc) have hμ : volume.restrict (latentCube 3) = Measure.pi (fun _ : Fin 3 => volume.restrict (Icc (0 : ℝ) 1)) := by change volume.restrict (Set.univ.pi fun _ : Fin 3 => Icc (0 : ℝ) 1) = _ rw [MeasureTheory.volume_pi, Measure.restrict_pi_pi] change (∫ v in latentCube 3, f v) = _ rw [hμ, integral_fin_three_pi_eq_iterated _ f (by simpa [hμ] using hf)] have hone : (volume.restrict (Icc (0 : ℝ) 1)).real univ = 1 := by simp [Measure.real, Real.volume_Icc] simp only [f, sparseWitness, sparseQ, sparseP, Matrix.cons_val_zero, Matrix.cons_val_one, integral_const, hone, one_smul] have herase : (Finset.univ.erase (1 : Fin 3)).erase 0 = {2} := by decide rw [herase] norm_num have hrefY (x : ℝ) : (∫ y in Icc (0 : ℝ) 1, exponentialInterventionDensity (reflectedCoordinate s 1 y) ^ 2 * (exponentialInterventionDensity (reflectedCoordinate s 0 x) - 1) / (1 + (10 : ℝ)⁻¹ * centeredCoordinate (reflectedCoordinate s 0 x) * centeredCoordinate (reflectedCoordinate s 1 y))) = (exponentialInterventionDensity (reflectedCoordinate s 0 x) - 1) * sparseA (reflectedCoordinate s 0 x) := by change (∫ y in Icc (0 : ℝ) 1, (fun y => exponentialInterventionDensity y ^ 2 * (exponentialInterventionDensity (reflectedCoordinate s 0 x) - 1) / (1 + (10 : ℝ)⁻¹ * centeredCoordinate (reflectedCoordinate s 0 x) * centeredCoordinate y)) (reflectedCoordinate s 1 y)) = _ have href := integral_reflectedCoordinate s 1 (fun y => exponentialInterventionDensity y ^ 2 * (exponentialInterventionDensity (reflectedCoordinate s 0 x) - 1) / (1 + (10 : ℝ)⁻¹ * centeredCoordinate (reflectedCoordinate s 0 x) * centeredCoordinate y)) rw [href] unfold sparseA rw [show (fun y : ℝ => exponentialInterventionDensity y ^ 2 * (exponentialInterventionDensity (reflectedCoordinate s 0 x) - 1) / (1 + (10 : ℝ)⁻¹ * centeredCoordinate (reflectedCoordinate s 0 x) * centeredCoordinate y)) = fun y => (exponentialInterventionDensity (reflectedCoordinate s 0 x) - 1) * (exponentialInterventionDensity y ^ 2 / (1 + centeredCoordinate (reflectedCoordinate s 0 x) / 10 * centeredCoordinate y)) by funext y; ring, MeasureTheory.integral_const_mul] simp only [Fin.isValue, Fin.reduceEq, ↓reduceIte, one_div] simp_rw [hrefY] change (∫ x in Icc (0 : ℝ) 1, (fun x => (exponentialInterventionDensity x - 1) * sparseA x) (reflectedCoordinate s 0 x)) = _ rw [show (∫ x in Icc (0 : ℝ) 1, (fun x => (exponentialInterventionDensity x - 1) * sparseA x) (reflectedCoordinate s 0 x)) = ∫ x in Icc (0 : ℝ) 1, (exponentialInterventionDensity x - 1) * sparseA x by simpa only using integral_reflectedCoordinate s 0 (fun x => (exponentialInterventionDensity x - 1) * sparseA x)] rw [← MeasureTheory.integral_neg] apply integral_congr_ae filter_upwards with x ring
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparse_secondMomentContrast_eq_neg_gap · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessMomentMmdAssembly.lean:379
theorem sparse_witness_moment_gap

The explicit sparse witness has the required strictly positive observed-ratio moment gap.

Formal statement
s :
(3 / 10000 : ℝ) < (∫ x, ((canonicalObservedWorld threeNodeDAG (sparseWitness s) (refl (Fin 3))).ratio 1 x) ^ 2 ∂(canonicalObservedWorld threeNodeDAG (sparseWitness s) (refl (Fin 3))).law 0)
Proof (Lean source)
lemma sparse_witness_moment_gap (s : SignVector 3) : (3 / 10000 : ℝ) < (∫ x, ((canonicalObservedWorld threeNodeDAG (sparseWitness s) (refl (Fin 3))).ratio 1 x) ^ 2 ∂(canonicalObservedWorld threeNodeDAG (sparseWitness s) (refl (Fin 3))).law 0) - ∫ x, ((canonicalObservedWorld threeNodeDAG (sparseWitness s) (refl (Fin 3))).ratio 1 x) ^ 2 ∂(canonicalObservedWorld threeNodeDAG (sparseWitness s) (refl (Fin 3))).law (succ 0) := by have hgap := sparse_unreflected_moment_gap have hcontrast := sparse_secondMomentContrast_eq_neg_gap s unfold secondMomentContrast at hcontrast dsimp only [canonicalObservedWorld, Equiv.refl_apply] at hcontrast ⊢ linarith
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparse_witness_moment_gap · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessMomentMmdAssembly.lean:475
theorem sparse_witness_mmd_gap

The explicit sparse witness has the required strictly positive Gaussian-kernel discrepancy.

Formal statement
s :
Proof (Lean source)
lemma sparse_witness_mmd_gap (s : SignVector 3) : (5 / 100000000 : ℝ) < populationDiscrepancy gaussianFeatureMap (canonicalObservedWorld threeNodeDAG (sparseWitness s) (refl (Fin 3))) 0 1 := by let θ := sparseWitness s let W := canonicalObservedWorld threeNodeDAG θ (refl (Fin 3)) let μ := observationalRatioLaw W 1 let ν := interventionalRatioLaw W 0 1 have hpos : PositiveNormalizedSmoothMechanisms threeNodeDAG θ := sparseWitness_positive_normalized_smooth s letI : IsProbabilityMeasure (observationalLaw θ) := observationalLaw_isProbabilityMeasure hpos letI : IsProbabilityMeasure (interventionalLaw θ 0) := by simpa only [W, canonicalObservedWorld, Equiv.refl_apply] using interventionalLaw_isProbabilityMeasure W hpos 0 letI : IsProbabilityMeasure μ := by change IsProbabilityMeasure (Measure.map (observedLawRatio W.law 1) (observationalLaw θ)) exact Measure.isProbabilityMeasure_map (measurable_observedLawRatio W.law 1).aemeasurable letI : IsProbabilityMeasure ν := by change IsProbabilityMeasure (Measure.map (observedLawRatio W.law 1) (interventionalLaw θ 0)) exact Measure.isProbabilityMeasure_map (measurable_observedLawRatio W.law 1).aemeasurable have hobsCube : ∀ᵐ v ∂observationalLaw θ, v ∈ latentCube 3 := observationalLaw_ae_mem_latentCube hpos have hac : interventionalLaw θ 0 ≪ observationalLaw θ := by simpa only [W, canonicalObservedWorld, Equiv.refl_apply] using interventionalLaw_absolutelyContinuous_observational W hpos 0 have hintCube : ∀ᵐ v ∂interventionalLaw θ 0, v ∈ latentCube 3 := hac.ae_le hobsCube have hratioObs := canonicalObservedWorld_observedLawRatio_ae_eq_mechanismRatio hpos (refl (Fin 3)) 1 have hratioInt : observedLawRatio W.law 1 =ᵐ[interventionalLaw θ 0] fun v => θ.q 1 (v 1) / θ.p 1 v := by exact hac.ae_eq (by simpa only [W, Equiv.refl_apply] using hratioObs) have hμsupport : μ (Icc (0 : ℝ) 5)ᶜ = 0 := by dsimp only [μ, observationalRatioLaw] rw [Measure.map_apply (measurable_observedLawRatio W.law 1) measurableSet_Icc.compl] apply ae_iff.mp filter_upwards [hobsCube, hratioObs] with v hv hr rw [hr] exact ⟨(sparseWitness_child_ratio_bounds s v hv).1.le, le_of_lt (sparseWitness_child_ratio_bounds s v hv).2⟩ have hνsupport : ν (Icc (0 : ℝ) 5)ᶜ = 0 := by dsimp only [ν, interventionalRatioLaw] change Measure.map (observedLawRatio W.law 1) (interventionalLaw θ 0) (Icc (0 : ℝ) 5)ᶜ = 0 rw [Measure.map_apply (measurable_observedLawRatio W.law 1) measurableSet_Icc.compl] apply ae_iff.mp filter_upwards [hintCube, hratioInt] with v hv hr rw [hr] exact ⟨(sparseWitness_child_ratio_bounds s v hv).1.le, le_of_lt (sparseWitness_child_ratio_bounds s v hv).2⟩ have hmom : (3 / 10000 : ℝ) < (∫ r, r ^ 2 ∂μ) - ∫ r, r ^ 2 ∂ν := by rw [canonical_observationalRatioLaw_secondMoment_eq hpos (refl (Fin 3)) 1, canonical_interventionalRatioLaw_secondMoment_eq hpos (refl (Fin 3)) 0 1] have hbase := sparse_witness_moment_gap s simp only [canonicalObservedWorld, Fin.cases_zero, Fin.cases_succ, Equiv.refl_apply] at hbase simpa only [μ, ν, θ, W, Equiv.refl_apply] using hbase have habs : (3 / 10000 : ℝ) < |(∫ r, r ^ 2 ∂μ) - ∫ r, r ^ 2 ∂ν| := by rw [abs_of_pos (lt_trans (by norm_num) hmom)] exact hmom have hlower := CausalSmith.Substrate.GaussianMeanEmbeddingQuantitativeMomentStability.gaussian_meanEmbedding_norm_lowerBound_of_secondMoment_gap μ ν hμsupport hνsupport (lt_trans (by norm_num) habs) have hrat := sparseMmdRationalCertificate rw [← meanEmbedding_gaussianFeatureMap_eq_recovery μ, ← meanEmbedding_gaussianFeatureMap_eq_recovery ν] at hlower unfold populationDiscrepancy nlinarith [hlower.2]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparse_witness_mmd_gap · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessMomentMmdAssembly.lean:493
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.WitnessPath 3 declarations This file records the elementary one-dimensional facts about the child-mechanism coefficient along the path from the cancellation witness to the sparse witness.

Explicit cancellation-to-sparse witness path

This file records the elementary one-dimensional facts about the child-mechanism coefficient along the path from the cancellation witness to the sparse witness.

The child-mechanism coefficient on the affine path from the cancellation witness (t = 0) to the sparse witness (t = 1).

Definition (Lean source)
t x :
cancellationSparsePathPrimitive t x :
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellationSparsePathPrimitive · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessPath.lean:17
theorem cancellationSparsePathPrimitive_mem_unitInterval

Convex interpolation preserves the coefficient bound on the unit interval. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
t x :
ht :
t ∈ Icc (0 : ℝ) 1
hx :
x ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma cancellationSparsePathPrimitive_mem_unitInterval {t x : ℝ} (ht : t ∈ Icc (0 : ℝ) 1) (hx : x ∈ Icc (0 : ℝ) 1) : cancellationSparsePathPrimitive t x ∈ Icc (-1 : ℝ) 1 := by have hH := cancellationPrimitive_mem_unitInterval_sub hx have hh := abs_centeredCoordinate_le_one hx rw [abs_le] at hh unfold cancellationSparsePathPrimitive constructor <;> nlinarith [ht.1, ht.2, hH.1, hH.2, hh.1, hh.2]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellationSparsePathPrimitive_mem_unitInterval · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessPath.lean:23
theorem cancellationSparsePathPrimitive_nonconstant

Every coefficient on the closed cancellation-to-sparse segment is nonconstant. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
t :
ht :
t ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma cancellationSparsePathPrimitive_nonconstant {t : ℝ} (ht : t ∈ Icc (0 : ℝ) 1) : ∃ x, cancellationSparsePathPrimitive t x ≠ cancellationSparsePathPrimitive t 0 := by by_cases ht0 : t = 0 · subst t simpa [cancellationSparsePathPrimitive] using cancellationPrimitive_nonconstant · refine ⟨1, ?_⟩ have hH := cancellationPrimitive_zero simp only [cancellationSparsePathPrimitive, hH.1, hH.2, centeredCoordinate] intro heq apply ht0 linarith
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellationSparsePathPrimitive_nonconstant · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessPath.lean:34
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.WitnessPathRegularity 1 declarations This file records the positive, normalized, smooth part of stratum preservation along the closed affine path.

Affine witness-path regularity

This file records the positive, normalized, smooth part of stratum preservation along the closed affine path. Causal minimality and the fixed-sign cell are handled separately by the analytic perturbation argument.

theorem affinePathExtension_positive_normalized_smooth

Convex interpolation with the embedded sparse endpoint preserves positivity, normalization, and smoothness throughout the closed unit interval. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
θ :
j i :
Fin n
hji :
G.edge j i
t :
ht :
t ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma affinePathExtension_positive_normalized_smooth {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (θ : StratumPoint G s) {j i : Fin n} (hji : G.edge j i) {t : ℝ} (ht : t ∈ Icc (0 : ℝ) 1) : PositiveNormalizedSmoothMechanisms G (affinePathExtension s θ hji t) := by let θstar := embeddedSparseWitness s hji have hθ := θ.property.positiveSmooth have hstar := embeddedSparseWitness_positive_normalized_smooth s hji refine ⟨?_, ?_, ?_, ?_, ?_, ?_⟩ · intro l v hv change 0 < (1 - t) * θ.1.p l v + t * θstar.p l v have hp := hθ.1 l v hv have hpstar := hstar.1 l v hv by_cases ht0 : t = 0 · simp [ht0, hp] · have htpos : 0 < t := lt_of_le_of_ne ht.1 (Ne.symm ht0) exact add_pos_of_nonneg_of_pos (mul_nonneg (sub_nonneg.mpr ht.2) hp.le) (mul_pos htpos hpstar) · intro l z hz change 0 < (1 - t) * θ.1.q l z + t * θstar.q l z have hq := hθ.2.1 l z hz have hqstar := hstar.2.1 l z hz by_cases ht0 : t = 0 · simp [ht0, hq] · have htpos : 0 < t := lt_of_le_of_ne ht.1 (Ne.symm ht0) exact add_pos_of_nonneg_of_pos (mul_nonneg (sub_nonneg.mpr ht.2) hq.le) (mul_pos htpos hqstar) · intro l exact (hθ.2.2.1 l).const_smul (1 - t) |>.add ((hstar.2.2.1 l).const_smul t) · intro l exact (hθ.2.2.2.1 l).const_smul (1 - t) |>.add ((hstar.2.2.2.1 l).const_smul t) · intro l v hv have hupdate : Continuous (fun z : ℝ => update v l z) := by fun_prop have hmaps : MapsTo (fun z : ℝ => update v l z) (Icc (0 : ℝ) 1) (latentCube n) := by intro z hz k _ by_cases hkl : k = l · subst k simpa using hz · simpa only [update, dif_neg hkl] using hv k (Set.mem_univ k) have hpInt : IntegrableOn (fun z : ℝ => (1 - t) * θ.1.p l (update v l z)) (Icc (0 : ℝ) 1) := by exact ((hθ.2.2.1 l).continuousOn.comp hupdate.continuousOn hmaps |>.const_mul _) |>.integrableOn_Icc have hpstarInt : IntegrableOn (fun z : ℝ => t * θstar.p l (update v l z)) (Icc (0 : ℝ) 1) := by exact ((hstar.2.2.1 l).continuousOn.comp hupdate.continuousOn hmaps |>.const_mul _) |>.integrableOn_Icc change ∫ z in Icc (0 : ℝ) 1, ((1 - t) * θ.1.p l (update v l z) + t * θstar.p l (update v l z)) = 1 rw [MeasureTheory.integral_add, MeasureTheory.integral_const_mul, MeasureTheory.integral_const_mul, hθ.2.2.2.2.1 l v hv, hstar.2.2.2.2.1 l v hv] · ring · exact hpInt · exact hpstarInt · intro l change ∫ z in Icc (0 : ℝ) 1, ((1 - t) * θ.1.q l z + t * θstar.q l z) = 1 rw [MeasureTheory.integral_add, MeasureTheory.integral_const_mul, MeasureTheory.integral_const_mul, hθ.2.2.2.2.2 l, hstar.2.2.2.2.2 l] · ring · exact ((hθ.2.2.2.1 l).continuousOn.const_mul _).integrableOn_Icc · exact ((hstar.2.2.2.1 l).continuousOn.const_mul _).integrableOn_Icc
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathExtension_positive_normalized_smooth · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessPathRegularity.lean:18
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.WitnessQuantitative 25 declarations This file isolates the elementary exponential and rational estimates used in the quantitative moment and Gaussian-MMD certificate.

Rational bounds for the explicit sparse witness

This file isolates the elementary exponential and rational estimates used in the quantitative moment and Gaussian-MMD certificate.

The one-dimensional weight appearing after differentiating the sparse second-moment integrand with respect to its parent coefficient.

Definition (Lean source)
a y :
sparseWeight a y :
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseWeight · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessQuantitative.lean:18
theorem sparseWeight_log_hasDerivAt

The logarithmic derivative of the sparse weight has the explicit form used in the quantitative moment-gap argument. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
a y :
hden :
1 + a * centeredCoordinate y ≠ 0
HasDerivAt (fun z => log (sparseWeight a z)) (8 - 4 * a / (1 + a * centeredCoordinate y)) y
Proof (Lean source)
-- @node: sparseWeight_log_hasDerivAt lemma sparseWeight_log_hasDerivAt {a y : ℝ} (hden : 1 + a * centeredCoordinate y ≠ 0) : HasDerivAt (fun z => log (sparseWeight a z)) (8 - 4 * a / (1 + a * centeredCoordinate y)) y := by have hq : HasDerivAt exponentialInterventionDensity (4 * exponentialInterventionDensity y) y := by simpa [mul_comm] using exponentialInterventionDensity_hasDerivAt y have hp0 : HasDerivAt (fun z : ℝ => 2 * z - 1) 2 y := by convert (hasDerivAt_const_mul (x := y) 2).sub_const 1 using 1 have hp : HasDerivAt (fun z : ℝ => 1 + a * centeredCoordinate z) (2 * a) y := by simpa only [centeredCoordinate, mul_comm] using (hp0.const_mul a).const_add 1 have hw := (hq.pow 2).div (hp.pow 2) (pow_ne_zero 2 hden) have hwne : sparseWeight a y ≠ 0 := by unfold sparseWeight exact div_ne_zero (pow_ne_zero 2 (ne_of_gt (exponentialInterventionDensity_pos y))) (pow_ne_zero 2 hden) have hlog := hw.log hwne have hqne : exponentialInterventionDensity y ≠ 0 := ne_of_gt (exponentialInterventionDensity_pos y) convert hlog using 1 · rfl · simp only [Pi.pow_apply, Pi.div_apply] field_simp [hqne, hden] ring
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseWeight_log_hasDerivAt · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessQuantitative.lean:25
theorem sparseWeight_log_deriv_lower_bound

For every parent coefficient in [-1/10,1/10], the logarithmic derivative of the sparse weight is at least 68/9 on the unit interval. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
a y :
ha :
a ∈ Icc (-1 / 10 : ℝ) (1 / 10)
hy :
y ∈ Icc (0 : ℝ) 1
(68 / 9 : ℝ) ≤ deriv (fun z => log (sparseWeight a z)) y
Proof (Lean source)
-- @node: sparseWeight_log_deriv_lower_bound lemma sparseWeight_log_deriv_lower_bound {a y : ℝ} (ha : a ∈ Icc (-1 / 10 : ℝ) (1 / 10)) (hy : y ∈ Icc (0 : ℝ) 1) : (68 / 9 : ℝ) ≤ deriv (fun z => log (sparseWeight a z)) y := by have hh := abs_centeredCoordinate_le_one hy have ha' : |a| ≤ (1 / 10 : ℝ) := by rw [abs_le] constructor <;> norm_num at ha ⊢ · exact ha.1 · exact ha.2 have haprod : |a * centeredCoordinate y| ≤ (1 / 10 : ℝ) := by rw [abs_mul] calc |a| * |centeredCoordinate y| ≤ (1 / 10 : ℝ) * 1 := mul_le_mul ha' hh (abs_nonneg _) (by norm_num) _ = 1 / 10 := by norm_num rw [abs_le] at haprod have hden_pos : 0 < 1 + a * centeredCoordinate y := by nlinarith [haprod.1] have hfactor_nonneg : 0 ≤ 9 - centeredCoordinate y := by rw [abs_le] at hh linarith have hmul := mul_le_mul_of_nonneg_right ha.2 hfactor_nonneg have hratio : a / (1 + a * centeredCoordinate y) ≤ (1 / 9 : ℝ) := by rw [div_le_iff₀ hden_pos] nlinarith [hmul] have hratio4 := mul_le_mul_of_nonneg_left hratio (by norm_num : (0 : ℝ) ≤ 4) rw [(sparseWeight_log_hasDerivAt hden_pos.ne').deriv] rw [show 4 * a / (1 + a * centeredCoordinate y) = 4 * (a / (1 + a * centeredCoordinate y)) by ring] norm_num at hratio4 ⊢ nlinarith
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseWeight_log_deriv_lower_bound · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessQuantitative.lean:54
theorem sparseWeight_hasDerivAt

The sparse weight derivative is its value times the explicit logarithmic derivative factor. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
a y :
hden :
1 + a * centeredCoordinate y ≠ 0
HasDerivAt (sparseWeight a) (sparseWeight a y * (8 - 4 * a / (1 + a * centeredCoordinate y))) y
Proof (Lean source)
lemma sparseWeight_hasDerivAt {a y : ℝ} (hden : 1 + a * centeredCoordinate y ≠ 0) : HasDerivAt (sparseWeight a) (sparseWeight a y * (8 - 4 * a / (1 + a * centeredCoordinate y))) y := by have hq : HasDerivAt exponentialInterventionDensity (4 * exponentialInterventionDensity y) y := by simpa [mul_comm] using exponentialInterventionDensity_hasDerivAt y have hp0 : HasDerivAt (fun z : ℝ => 2 * z - 1) 2 y := by convert (hasDerivAt_const_mul (x := y) 2).sub_const 1 using 1 have hp : HasDerivAt (fun z : ℝ => 1 + a * centeredCoordinate z) (2 * a) y := by simpa only [centeredCoordinate, mul_comm] using (hp0.const_mul a).const_add 1 have hw := (hq.pow 2).div (hp.pow 2) (pow_ne_zero 2 hden) change HasDerivAt (sparseWeight a) _ y at hw apply hw.congr_deriv simp only [Pi.pow_apply] unfold sparseWeight field_simp [hden] ring
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseWeight_hasDerivAt · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessQuantitative.lean:91

The exponential normalizer in the witness is strictly below 55. the stated conclusion follows.

Formal statement
exp 4 < 55
Proof (Lean source)
lemma exp_four_lt_fifty_five : exp 4 < 55 := by calc exp 4 = exp 1 ^ 4 := by rw [← Real.exp_nat_mul]; norm_num _ < (2.7182818286 : ℝ) ^ 4 := pow_lt_pow_left₀ Real.exp_one_lt_d9 (Real.exp_pos 1).le (by norm_num) _ < 55 := by norm_num
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.exp_four_lt_fifty_five · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessQuantitative.lean:113
theorem exponentialNormalizer_gt_two_div_twenty_seven Lemma exponentialNormalizer_gt_two_div_twenty_seven in the paper ↗

The normalizing constant 4 / (exp 4 - 1) exceeds 2/27. the stated conclusion follows.

Formal statement
(2 / 27 : ℝ) < 4 / (exp 4 - 1)
Proof (Lean source)
lemma exponentialNormalizer_gt_two_div_twenty_seven : (2 / 27 : ℝ) < 4 / (exp 4 - 1) := by have hden : 0 < exp 4 - 1 := by linarith [thirteen_lt_exp_four] rw [div_lt_div_iff₀ (by norm_num : (0 : ℝ) < 27) hden] nlinarith [exp_four_lt_fifty_five]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.exponentialNormalizer_gt_two_div_twenty_seven · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessQuantitative.lean:122
theorem sparseWeight_gt_rational_floor

On the coefficient strip used by the witness, the sparse weight is strictly above the rational floor obtained from c > 2/27 and p₂ ≤ 11/10. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
a y :
ha :
a ∈ Icc (-1 / 10 : ℝ) (1 / 10)
hy :
y ∈ Icc (0 : ℝ) 1
(4 / 729 : ℝ) * (100 / 121) < sparseWeight a y
Proof (Lean source)
lemma sparseWeight_gt_rational_floor {a y : ℝ} (ha : a ∈ Icc (-1 / 10 : ℝ) (1 / 10)) (hy : y ∈ Icc (0 : ℝ) 1) : (4 / 729 : ℝ) * (100 / 121) < sparseWeight a y := by have hh := abs_centeredCoordinate_le_one hy rw [abs_le] at hh have hden : 0 < 1 + a * centeredCoordinate y := by have ha1 : (-1 / 10 : ℝ) ≤ a := ha.1 have ha2 : a ≤ (1 / 10 : ℝ) := ha.2 nlinarith have hdenUpper : 1 + a * centeredCoordinate y ≤ (11 / 10 : ℝ) := by have ha1 : (-1 / 10 : ℝ) ≤ a := ha.1 have ha2 : a ≤ (1 / 10 : ℝ) := ha.2 nlinarith have hexp : 1 ≤ exp (4 * y) := Real.one_le_exp (by nlinarith [hy.1]) have hc := exponentialNormalizer_gt_two_div_twenty_seven have hq : (2 / 27 : ℝ) < exponentialInterventionDensity y := by unfold exponentialInterventionDensity have hnormalizer_pos : 0 < 4 / (exp 4 - 1) := lt_trans (by norm_num) hc rw [show 4 * exp (4 * y) / (exp 4 - 1) = (4 / (exp 4 - 1)) * exp (4 * y) by ring] nlinarith have hdenSq : 0 < (1 + a * centeredCoordinate y) ^ 2 := sq_pos_of_pos hden have hupperSq : (1 + a * centeredCoordinate y) ^ 2 ≤ (11 / 10 : ℝ) ^ 2 := by nlinarith have hqSq : (2 / 27 : ℝ) ^ 2 < exponentialInterventionDensity y ^ 2 := by nlinarith [exponentialInterventionDensity_pos y] unfold sparseWeight calc (4 / 729 : ℝ) * (100 / 121) = (2 / 27 : ℝ) ^ 2 / (11 / 10 : ℝ) ^ 2 := by norm_num _ < exponentialInterventionDensity y ^ 2 / (1 + a * centeredCoordinate y) ^ 2 := by rw [div_lt_div_iff₀ (by norm_num : (0 : ℝ) < (11 / 10) ^ 2) hdenSq] have hleft := mul_le_mul_of_nonneg_left hupperSq (sq_nonneg (2 / 27 : ℝ)) have hright := mul_lt_mul_of_pos_right hqSq (by norm_num : (0 : ℝ) < (11 / 10) ^ 2) exact lt_of_le_of_lt hleft hright
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseWeight_gt_rational_floor · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessQuantitative.lean:130
theorem sparseWeight_deriv_gt_rational_floor

The derivative of the sparse weight has the uniform rational lower bound used in the moment certificate. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
a y :
ha :
a ∈ Icc (-1 / 10 : ℝ) (1 / 10)
hy :
y ∈ Icc (0 : ℝ) 1
(68 / 9 : ℝ) * ((4 / 729) * (100 / 121)) < deriv (sparseWeight a) y
Proof (Lean source)
lemma sparseWeight_deriv_gt_rational_floor {a y : ℝ} (ha : a ∈ Icc (-1 / 10 : ℝ) (1 / 10)) (hy : y ∈ Icc (0 : ℝ) 1) : (68 / 9 : ℝ) * ((4 / 729) * (100 / 121)) < deriv (sparseWeight a) y := by have hden : 0 < 1 + a * centeredCoordinate y := by have hh := abs_centeredCoordinate_le_one hy rw [abs_le] at hh have ha1 : (-1 / 10 : ℝ) ≤ a := ha.1 have ha2 : a ≤ (1 / 10 : ℝ) := ha.2 nlinarith have hw := sparseWeight_gt_rational_floor ha hy have hlog := sparseWeight_log_deriv_lower_bound ha hy have hfactor : (68 / 9 : ℝ) ≤ 8 - 4 * a / (1 + a * centeredCoordinate y) := by simpa [(sparseWeight_log_hasDerivAt hden.ne').deriv] using hlog rw [(sparseWeight_hasDerivAt hden.ne').deriv] have hfloor : 0 < (4 / 729 : ℝ) * (100 / 121) := by norm_num have hfactorPos : 0 < 8 - 4 * a / (1 + a * centeredCoordinate y) := lt_of_lt_of_le (by norm_num) hfactor nlinarith
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseWeight_deriv_gt_rational_floor · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessQuantitative.lean:173
theorem sparseWeight_secant_lower_bound

The derivative certificate integrates to a uniform secant lower bound on the unit interval. This is the monotonicity input for the covariance step in the sparse moment calculation. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
a z y :
ha :
a ∈ Icc (-1 / 10 : ℝ) (1 / 10)
hz :
z ∈ Icc (0 : ℝ) 1
hy :
y ∈ Icc (0 : ℝ) 1
hzy :
z ≤ y
(68 / 9 : ℝ) * (4 / 729) * (100 / 121) * (y - z) ≤ sparseWeight a y - sparseWeight a z
Proof (Lean source)
lemma sparseWeight_secant_lower_bound {a z y : ℝ} (ha : a ∈ Icc (-1 / 10 : ℝ) (1 / 10)) (hz : z ∈ Icc (0 : ℝ) 1) (hy : y ∈ Icc (0 : ℝ) 1) (hzy : z ≤ y) : (68 / 9 : ℝ) * (4 / 729) * (100 / 121) * (y - z) ≤ sparseWeight a y - sparseWeight a z := by have ha' : -(1 / 10 : ℝ) ≤ a ∧ a ≤ 1 / 10 := by constructor · norm_num at ha ⊢ exact ha.1 · exact ha.2 have hdiff : ∀ x ∈ Icc (0 : ℝ) 1, DifferentiableAt ℝ (sparseWeight a) x := by intro x hx have hc : |centeredCoordinate x| ≤ 1 := abs_centeredCoordinate_le_one hx have habs : |a| ≤ 1 / 10 := by rw [abs_le]; exact ha' have hp : |a * centeredCoordinate x| ≤ 1 / 10 := by rw [abs_mul] exact (mul_le_mul habs hc (abs_nonneg _) (by norm_num)).trans_eq (by norm_num) rw [abs_le] at hp exact (sparseWeight_hasDerivAt (by nlinarith)).differentiableAt apply (convex_Icc (0 : ℝ) 1).mul_sub_le_image_sub_of_le_deriv · exact fun x hx => (hdiff x hx).continuousAt.continuousWithinAt · intro x hx apply (hdiff x ?_).differentiableWithinAt rw [interior_Icc] at hx exact ⟨le_of_lt hx.1, le_of_lt hx.2⟩ · intro x hx have hx' : x ∈ Icc (0 : ℝ) 1 := by rw [interior_Icc] at hx exact ⟨le_of_lt hx.1, le_of_lt hx.2⟩ simpa only [mul_assoc] using le_of_lt (sparseWeight_deriv_gt_rational_floor ha hx') · exact hz · exact hy · exact hzy
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseWeight_secant_lower_bound · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessQuantitative.lean:197
theorem sparseWeight_centered_product_lower_bound

Centering at the midpoint turns the secant estimate into the pointwise quadratic lower bound whose integral is the 1/6 covariance factor. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
a y :
ha :
a ∈ Icc (-1 / 10 : ℝ) (1 / 10)
hy :
y ∈ Icc (0 : ℝ) 1
(68 / 9 : ℝ) * (4 / 729) * (100 / 121) * (2 * (y - 1 / 2) ^ 2)
centeredCoordinate y * (sparseWeight a y - sparseWeight a (1 / 2))
Proof (Lean source)
lemma sparseWeight_centered_product_lower_bound {a y : ℝ} (ha : a ∈ Icc (-1 / 10 : ℝ) (1 / 10)) (hy : y ∈ Icc (0 : ℝ) 1) : (68 / 9 : ℝ) * (4 / 729) * (100 / 121) * (2 * (y - 1 / 2) ^ 2) ≤ centeredCoordinate y * (sparseWeight a y - sparseWeight a (1 / 2)) := by by_cases hmid : (1 / 2 : ℝ) ≤ y · have hsec := sparseWeight_secant_lower_bound ha (by norm_num : (1 / 2 : ℝ) ∈ Icc 0 1) hy hmid simp only [centeredCoordinate] nlinarith · have hsec := sparseWeight_secant_lower_bound ha hy (by norm_num : (1 / 2 : ℝ) ∈ Icc 0 1) (le_of_not_ge hmid) simp only [centeredCoordinate] nlinarith
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseWeight_centered_product_lower_bound · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessQuantitative.lean:237
theorem sparseWeight_centered_integral_lower_bound

Integrating the centered secant estimate supplies the exact 1/6 factor used in the sparse second-moment certificate. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
a :
ha :
a ∈ Icc (-1 / 10 : ℝ) (1 / 10)
(1 / 6 : ℝ) * ((68 / 9 : ℝ) * (4 / 729) * (100 / 121))
≤ ∫ y in Icc (0 : ℝ) 1, centeredCoordinate y * sparseWeight a y
Proof (Lean source)
lemma sparseWeight_centered_integral_lower_bound {a : ℝ} (ha : a ∈ Icc (-1 / 10 : ℝ) (1 / 10)) : (1 / 6 : ℝ) * ((68 / 9 : ℝ) * (4 / 729) * (100 / 121)) ≤ ∫ y in Icc (0 : ℝ) 1, centeredCoordinate y * sparseWeight a y := by let C : ℝ := (68 / 9 : ℝ) * (4 / 729) * (100 / 121) have hden : ∀ y ∈ Icc (0 : ℝ) 1, 1 + a * centeredCoordinate y ≠ 0 := by intro y hy have hh := abs_centeredCoordinate_le_one hy rw [abs_le] at hh have ha1 : (-1 / 10 : ℝ) ≤ a := ha.1 have ha2 : a ≤ (1 / 10 : ℝ) := ha.2 nlinarith have hc : Continuous centeredCoordinate := by unfold centeredCoordinate fun_prop have hwcont : ContinuousOn (sparseWeight a) (Icc (0 : ℝ) 1) := by unfold sparseWeight apply ContinuousOn.div · unfold exponentialInterventionDensity fun_prop · exact (continuous_const.add (continuous_const.mul hc)).pow 2 |>.continuousOn · intro y hy exact pow_ne_zero 2 (hden y hy) have hwint : IntegrableOn (fun y => centeredCoordinate y * sparseWeight a y) (Icc (0 : ℝ) 1) := (hc.continuousOn.mul hwcont).integrableOn_Icc have hconst : IntegrableOn (fun y => sparseWeight a (1 / 2) * centeredCoordinate y) (Icc (0 : ℝ) 1) := (continuous_const.mul hc).continuousOn.integrableOn_Icc have hright : IntegrableOn (fun y => centeredCoordinate y * (sparseWeight a y - sparseWeight a (1 / 2))) (Icc (0 : ℝ) 1) := (hc.continuousOn.mul (hwcont.sub continuousOn_const)).integrableOn_Icc have hleft : IntegrableOn (fun y : ℝ => C * (2 * (y - 1 / 2) ^ 2)) (Icc (0 : ℝ) 1) := by apply ContinuousOn.integrableOn_Icc fun_prop have hmono : (∫ y in Icc (0 : ℝ) 1, C * (2 * (y - 1 / 2) ^ 2)) ≤ ∫ y in Icc (0 : ℝ) 1, centeredCoordinate y * (sparseWeight a y - sparseWeight a (1 / 2)) := by apply integral_mono_ae hleft hright filter_upwards [ae_restrict_mem measurableSet_Icc] with y hy exact sparseWeight_centered_product_lower_bound ha hy have hquad : (∫ y in Icc (0 : ℝ) 1, 2 * (y - 1 / 2) ^ 2) = 1 / 6 := by have hfun : (fun y : ℝ => 2 * (y - 1 / 2) ^ 2) = fun y => 2 * y ^ 2 - 2 * y ^ 1 + 1 / 2 := by funext y ring rw [hfun, MeasureTheory.integral_Icc_eq_integral_Ioc] rw [← intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1)] rw [intervalIntegral.integral_add ((intervalIntegral.intervalIntegrable_pow 2).const_mul 2 |>.sub ((intervalIntegral.intervalIntegrable_pow 1).const_mul 2)) intervalIntegrable_const, intervalIntegral.integral_sub ((intervalIntegral.intervalIntegrable_pow 2).const_mul 2) ((intervalIntegral.intervalIntegrable_pow 1).const_mul 2), intervalIntegral.integral_const_mul, integral_pow, intervalIntegral.integral_const_mul, integral_pow, intervalIntegral.integral_const] norm_num have hcentered : (∫ y in Icc (0 : ℝ) 1, centeredCoordinate y * (sparseWeight a y - sparseWeight a (1 / 2))) = ∫ y in Icc (0 : ℝ) 1, centeredCoordinate y * sparseWeight a y := by have hfun : (fun y => centeredCoordinate y * (sparseWeight a y - sparseWeight a (1 / 2))) = fun y => centeredCoordinate y * sparseWeight a y - sparseWeight a (1 / 2) * centeredCoordinate y := by funext y ring rw [hfun, integral_sub hwint hconst, MeasureTheory.integral_const_mul, centeredCoordinate_integral, mul_zero, sub_zero] rw [MeasureTheory.integral_const_mul, hquad, hcentered] at hmono dsimp only [C] at hmono ⊢ nlinarith
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseWeight_centered_integral_lower_bound · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessQuantitative.lean:256
theorem cancellationPrimitive_mem_negUnitInterval Lemma cancellationPrimitive_mem_negUnitInterval in the paper ↗

Convexity of the exponential puts the cancellation primitive in [-1,0] on the unit interval. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
x :
hx :
x ∈ Icc (0 : ℝ) 1
cancellationPrimitive x ∈ Icc (-1 : ℝ) 0
Proof (Lean source)
lemma cancellationPrimitive_mem_negUnitInterval {x : ℝ} (hx : x ∈ Icc (0 : ℝ) 1) : cancellationPrimitive x ∈ Icc (-1 : ℝ) 0 := by have hden : 0 < exp 4 - 1 := by linarith [thirteen_lt_exp_four] have hfrac0 : 0 ≤ (exp (4 * x) - 1) / (exp 4 - 1) := by apply div_nonneg · have : 1 ≤ exp (4 * x) := Real.one_le_exp (by nlinarith [hx.1]) linarith · exact hden.le have hconv : exp (4 * x) ≤ 1 + x * (exp 4 - 1) := by rw [mul_comm 4 x] have h := convexOn_exp.2 (Set.mem_univ (0 : ℝ)) (Set.mem_univ (4 : ℝ)) (sub_nonneg.mpr hx.2) hx.1 (by ring : (1 - x) + x = 1) calc exp (x * 4) ≤ 1 - x + x * exp 4 := by simpa [smul_eq_mul] using h _ = 1 + x * (exp 4 - 1) := by ring have hfracx : (exp (4 * x) - 1) / (exp 4 - 1) ≤ x := by rw [div_le_iff₀ hden] nlinarith unfold cancellationPrimitive constructor <;> linarith [hx.1, hx.2]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellationPrimitive_mem_negUnitInterval · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessQuantitative.lean:340
theorem reflectedCenteredCoordinate_nonconstant_on_unitInterval

Reflection preserves the nonconstancy of the centered coordinate on the unit interval. the stated conclusion follows.

Formal statement
s :
i :
Fin 3
∃ x ∈ Icc (0 : ℝ) 1,
∃ x' ∈ Icc (0 : ℝ) 1,
Proof (Lean source)
lemma reflectedCenteredCoordinate_nonconstant_on_unitInterval (s : SignVector 3) (i : Fin 3) : ∃ x ∈ Icc (0 : ℝ) 1, ∃ x' ∈ Icc (0 : ℝ) 1, centeredCoordinate (reflectedCoordinate s i x) ≠ centeredCoordinate (reflectedCoordinate s i x') := by rcases s.signed i with hi | hi · refine ⟨0, by norm_num, 1, by norm_num, ?_⟩ norm_num [centeredCoordinate, reflectedCoordinate, reflect, hi, show (-1 : ℝ) ≠ 1 by norm_num] · refine ⟨0, by norm_num, 1, by norm_num, ?_⟩ norm_num [centeredCoordinate, reflectedCoordinate, reflect, hi]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.reflectedCenteredCoordinate_nonconstant_on_unitInterval · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessQuantitative.lean:365
theorem cancellationPrimitive_half_neg Lemma cancellationPrimitive_half_neg in the paper ↗

The cancellation primitive is strictly negative at the midpoint of the unit interval. the stated conclusion follows.

Formal statement
cancellationPrimitive (1 / 2 : ℝ) < 0
Proof (Lean source)
lemma cancellationPrimitive_half_neg : cancellationPrimitive (1 / 2 : ℝ) < 0 := by have he2 : 1 < exp 2 := Real.one_lt_exp_iff.mpr (by norm_num) have hfac : exp 4 - 1 = (exp 2 - 1) * (exp 2 + 1) := by rw [show (4 : ℝ) = 2 + 2 by norm_num, Real.exp_add] ring have hne1 : exp 2 - 1 ≠ 0 := ne_of_gt (sub_pos.mpr he2) have hne2 : exp 2 + 1 ≠ 0 := by positivity unfold cancellationPrimitive rw [show (4 : ℝ) * (1 / 2) = 2 by norm_num, hfac] have hcancel : (exp 2 - 1) / ((exp 2 - 1) * (exp 2 + 1)) = 1 / (exp 2 + 1) := by field_simp rw [hcancel] have hhalf : 1 / (exp 2 + 1) < (1 / 2 : ℝ) := by rw [div_lt_div_iff₀ (by positivity : 0 < exp 2 + 1) (by norm_num : (0 : ℝ) < 2)] nlinarith linarith
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellationPrimitive_half_neg · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessQuantitative.lean:378
theorem reflectedCancellationPrimitive_nonconstant_on_unitInterval

Reflection preserves the nonconstancy of the cancellation coefficient on the unit interval. the stated conclusion follows.

Formal statement
s :
i :
Fin 3
∃ x ∈ Icc (0 : ℝ) 1,
∃ x' ∈ Icc (0 : ℝ) 1,
Proof (Lean source)
lemma reflectedCancellationPrimitive_nonconstant_on_unitInterval (s : SignVector 3) (i : Fin 3) : ∃ x ∈ Icc (0 : ℝ) 1, ∃ x' ∈ Icc (0 : ℝ) 1, cancellationPrimitive (reflectedCoordinate s i x) ≠ cancellationPrimitive (reflectedCoordinate s i x') := by refine ⟨1 / 2, by norm_num, ?_⟩ rcases s.signed i with hi | hi · refine ⟨1, by norm_num, ?_⟩ simp only [reflectedCoordinate, reflect, hi, if_neg (show (-1 : ℝ) ≠ 1 by norm_num)] norm_num [cancellationPrimitive_zero.1] exact ne_of_lt cancellationPrimitive_half_neg · refine ⟨0, by norm_num, ?_⟩ simp [reflectedCoordinate, reflect, hi, cancellationPrimitive_zero.1] simpa only [one_div] using ne_of_lt cancellationPrimitive_half_neg
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.reflectedCancellationPrimitive_nonconstant_on_unitInterval · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessQuantitative.lean:399
theorem reflectedCoefficient_child_nonconstant

A nonconstant reflected parent coefficient makes the affine child conditional genuinely depend on that parent somewhere on the unit square. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
s :
K :
ℝ → ℝ
hK :
∃ x ∈ Icc (0 : ℝ) 1,
∃ x' ∈ Icc (0 : ℝ) 1, K (reflectedCoordinate s 0 x) ≠ K (reflectedCoordinate s 0 x')
∃ x ∈ Icc (0 : ℝ) 1,
∃ x' ∈ Icc (0 : ℝ) 1,
∃ y ∈ Icc (0 : ℝ) 1,
1
+ (1 / 10 : ℝ) * K (reflectedCoordinate s 0 x) * centeredCoordinate (reflectedCoordinate s 1 y)
≠ 1
+ (1 / 10 : ℝ) * K (reflectedCoordinate s 0 x') * centeredCoordinate (reflectedCoordinate s 1 y)
Proof (Lean source)
lemma reflectedCoefficient_child_nonconstant (s : SignVector 3) (K : ℝ → ℝ) (hK : ∃ x ∈ Icc (0 : ℝ) 1, ∃ x' ∈ Icc (0 : ℝ) 1, K (reflectedCoordinate s 0 x) ≠ K (reflectedCoordinate s 0 x')) : ∃ x ∈ Icc (0 : ℝ) 1, ∃ x' ∈ Icc (0 : ℝ) 1, ∃ y ∈ Icc (0 : ℝ) 1, 1 + (1 / 10 : ℝ) * K (reflectedCoordinate s 0 x) * centeredCoordinate (reflectedCoordinate s 1 y) ≠ 1 + (1 / 10 : ℝ) * K (reflectedCoordinate s 0 x') * centeredCoordinate (reflectedCoordinate s 1 y) := by rcases hK with ⟨x, hx, x', hx', hxx'⟩ refine ⟨x, hx, x', hx', 0, by norm_num, ?_⟩ rcases s.signed 1 with hi | hi · simp only [centeredCoordinate, reflectedCoordinate, reflect, hi, if_neg (show (-1 : ℝ) ≠ 1 by norm_num)] norm_num intro heq apply hxx' simpa [reflectedCoordinate, reflect] using heq · simp only [centeredCoordinate, reflectedCoordinate, reflect, hi] norm_num intro heq apply hxx' simpa [reflectedCoordinate, reflect] using heq
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.reflectedCoefficient_child_nonconstant · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessQuantitative.lean:417
theorem explicitWitness_child_parent_dependence

Both explicit witness child conditionals genuinely depend on the reflected parent coordinate on the unit square. the stated conclusion follows.

Formal statement
s :
conclusion 1
∃ x ∈ Icc (0 : ℝ) 1,
∃ x' ∈ Icc (0 : ℝ) 1,
∃ y ∈ Icc (0 : ℝ) 1,
1
≠ 1
conclusion 2
∃ x ∈ Icc (0 : ℝ) 1,
∃ x' ∈ Icc (0 : ℝ) 1,
∃ y ∈ Icc (0 : ℝ) 1,
1
≠ 1
Proof (Lean source)
lemma explicitWitness_child_parent_dependence (s : SignVector 3) : (∃ x ∈ Icc (0 : ℝ) 1, ∃ x' ∈ Icc (0 : ℝ) 1, ∃ y ∈ Icc (0 : ℝ) 1, 1 + (1 / 10 : ℝ) * centeredCoordinate (reflectedCoordinate s 0 x) * centeredCoordinate (reflectedCoordinate s 1 y) ≠ 1 + (1 / 10 : ℝ) * centeredCoordinate (reflectedCoordinate s 0 x') * centeredCoordinate (reflectedCoordinate s 1 y)) ∧ (∃ x ∈ Icc (0 : ℝ) 1, ∃ x' ∈ Icc (0 : ℝ) 1, ∃ y ∈ Icc (0 : ℝ) 1, 1 + (1 / 10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 x) * centeredCoordinate (reflectedCoordinate s 1 y) ≠ 1 + (1 / 10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 x') * centeredCoordinate (reflectedCoordinate s 1 y)) := by exact ⟨reflectedCoefficient_child_nonconstant s centeredCoordinate (reflectedCenteredCoordinate_nonconstant_on_unitInterval s 0), reflectedCoefficient_child_nonconstant s cancellationPrimitive (reflectedCancellationPrimitive_nonconstant_on_unitInterval s 0)⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.explicitWitness_child_parent_dependence · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessQuantitative.lean:444
theorem sparseP_bounds

The sparse child conditional lies between 9/10 and 11/10 on the latent cube. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
s :
v :
hv :
v ∈ latentCube 3
conclusion 1
(9 / 10 : ℝ) ≤ sparseP s 1 v
conclusion 2
sparseP s 1 v ≤ (11 / 10 : ℝ)
Proof (Lean source)
lemma sparseP_bounds (s : SignVector 3) (v : LatentState 3) (hv : v ∈ latentCube 3) : (9 / 10 : ℝ) ≤ sparseP s 1 v ∧ sparseP s 1 v ≤ (11 / 10 : ℝ) := by have hv0 : v 0 ∈ Icc (0 : ℝ) 1 := hv 0 (Set.mem_univ 0) have hv1 : v 1 ∈ Icc (0 : ℝ) 1 := hv 1 (Set.mem_univ 1) have h0 := abs_centeredCoordinate_le_one (reflectedCoordinate_mem_unitInterval s 0 hv0) have h1 := abs_centeredCoordinate_le_one (reflectedCoordinate_mem_unitInterval s 1 hv1) rw [abs_le] at h0 h1 simp only [sparseP, if_true] constructor <;> nlinarith
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseP_bounds · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessQuantitative.lean:465
theorem sparseWitness_child_ratio_bounds

On the latent cube the sparse child ratio is strictly between zero and five. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
s :
v :
hv :
v ∈ latentCube 3
conclusion 1
0 < (sparseWitness s).q 1 (v 1) / (sparseWitness s).p 1 v
conclusion 2
(sparseWitness s).q 1 (v 1) / (sparseWitness s).p 1 v < 5
Proof (Lean source)
lemma sparseWitness_child_ratio_bounds (s : SignVector 3) (v : LatentState 3) (hv : v ∈ latentCube 3) : 0 < (sparseWitness s).q 1 (v 1) / (sparseWitness s).p 1 v ∧ (sparseWitness s).q 1 (v 1) / (sparseWitness s).p 1 v < 5 := by have hv1 : v 1 ∈ Icc (0 : ℝ) 1 := hv 1 (Set.mem_univ 1) have href : reflectedCoordinate s 1 (v 1) ∈ Icc (0 : ℝ) 1 := reflectedCoordinate_mem_unitInterval s 1 hv1 have hqpos : 0 < (sparseWitness s).q 1 (v 1) := by exact exponentialInterventionDensity_pos _ have hq : (sparseWitness s).q 1 (v 1) < (13 / 3 : ℝ) := by exact exponentialInterventionDensity_lt_thirteen_div_three href have hp := sparseP_bounds s v hv change (9 / 10 : ℝ) ≤ (sparseWitness s).p 1 v ∧ (sparseWitness s).p 1 v ≤ (11 / 10 : ℝ) at hp have hppos : 0 < (sparseWitness s).p 1 v := lt_of_lt_of_le (by norm_num) hp.1 constructor · positivity · rw [div_lt_iff₀ hppos] nlinarith
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseWitness_child_ratio_bounds · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessQuantitative.lean:479
theorem exponentialTiltMeanGap_gt Lemma exponentialTiltMeanGap_gt in the paper ↗

The rational lower bound for the exponential-tilt mean excess used in the sparse moment calculation. the stated conclusion follows.

Formal statement
(29 / 108 : ℝ) < 1 / (1 - exp (-4)) - 3 / 4
Proof (Lean source)
lemma exponentialTiltMeanGap_gt : (29 / 108 : ℝ) < 1 / (1 - exp (-4)) - 3 / 4 := by have hEpos : 0 < exp 4 := Real.exp_pos 4 have hden : 0 < exp 4 - 1 := by linarith [thirteen_lt_exp_four] rw [Real.exp_neg, inv_eq_one_div] field_simp nlinarith [exp_four_lt_fifty_five]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.exponentialTiltMeanGap_gt · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessQuantitative.lean:501
theorem sparseMomentCoefficient_exact Lemma sparseMomentCoefficient_exact in the paper ↗

The product of rational lower bounds in the sparse moment argument is the stated exact certificate. the stated conclusion follows.

Formal statement
(1 / 30 : ℝ) * (68 / 9) * (4 / 729) * (100 / 121) * (29 / 108) = 19720 / 64304361
Proof (Lean source)
lemma sparseMomentCoefficient_exact : (1 / 30 : ℝ) * (68 / 9) * (4 / 729) * (100 / 121) * (29 / 108) = 19720 / 64304361 := by norm_num
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseMomentCoefficient_exact · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessQuantitative.lean:512
theorem sparseMomentRationalCertificate Lemma sparseMomentRationalCertificate in the paper ↗

The exact rational lower certificate in the sparse moment calculation is strictly larger than 3 / 10000. the stated conclusion follows.

Formal statement
(3 / 10000 : ℝ) < 19720 / 64304361
Proof (Lean source)
lemma sparseMomentRationalCertificate : (3 / 10000 : ℝ) < 19720 / 64304361 := by norm_num
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseMomentRationalCertificate · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessQuantitative.lean:520
theorem sparseWeight_moment_certificate

The integrated sparse-weight covariance and exponential-tilt mean gap combine to exceed the paper's 3 / 10000 moment threshold. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
a :
ha :
a ∈ Icc (-1 / 10 : ℝ) (1 / 10)
(3 / 10000 : ℝ) < (1 / 5) * (∫ y in Icc (0 : ℝ) 1, centeredCoordinate y * sparseWeight a y) * (1 / (1 - exp (-4)) - 3 / 4)
Proof (Lean source)
lemma sparseWeight_moment_certificate {a : ℝ} (ha : a ∈ Icc (-1 / 10 : ℝ) (1 / 10)) : (3 / 10000 : ℝ) < (1 / 5) * (∫ y in Icc (0 : ℝ) 1, centeredCoordinate y * sparseWeight a y) * (1 / (1 - exp (-4)) - 3 / 4) := by have hI := sparseWeight_centered_integral_lower_bound ha have hgap := exponentialTiltMeanGap_gt have hcert := sparseMomentRationalCertificate have hexact := sparseMomentCoefficient_exact have hC : 0 < (68 / 9 : ℝ) * (4 / 729) * (100 / 121) := by norm_num have hgapPos : 0 < 1 / (1 - exp (-4)) - 3 / 4 := by linarith have hIPos : 0 < ∫ y in Icc (0 : ℝ) 1, centeredCoordinate y * sparseWeight a y := by nlinarith nlinarith
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseWeight_moment_certificate · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessQuantitative.lean:526
theorem sparseMmdRationalCertificate Lemma sparseMmdRationalCertificate in the paper ↗

After the coordinate and tail estimates, the remaining numerical MMD comparison is strictly larger than 5 / 10^8. the stated conclusion follows.

Formal statement
(5 / 100000000 : ℝ) < ((3 / 10000 : ℝ) - 1 / 10 ^ 15) / 5151
Proof (Lean source)
lemma sparseMmdRationalCertificate : (5 / 100000000 : ℝ) < ((3 / 10000 : ℝ) - 1 / 10 ^ 15) / 5151 := by norm_num
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseMmdRationalCertificate · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessQuantitative.lean:547
theorem sparseMmdTailRationalCertificate Lemma sparseMmdTailRationalCertificate in the paper ↗

The geometric majorant for the factorial tail beyond degree one hundred is below 10⁻¹⁵. the stated conclusion follows.

Formal statement
(50 : ℝ) * (25 ^ 101 / ((101 : ℕ).factorial : ℝ)) * (102 / 77) < 1 / 10 ^ 15
Proof (Lean source)
lemma sparseMmdTailRationalCertificate : (50 : ℝ) * (25 ^ 101 / ((101 : ℕ).factorial : ℝ)) * (102 / 77) < 1 / 10 ^ 15 := by norm_num [factorial]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseMmdTailRationalCertificate · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessQuantitative.lean:554
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.WitnessSigns 6 declarations This file proves the elementary logarithmic-derivative bounds that give the sparse witness its prescribed own-coordinate signs after reflection.

Derivative signs for the explicit witnesses

This file proves the elementary logarithmic-derivative bounds that give the sparse witness its prescribed own-coordinate signs after reflection.

theorem exponentialInterventionDensity_hasDerivAt Lemma exponentialInterventionDensity_hasDerivAt in the paper ↗

The normalized exponential intervention density has logarithmic slope four. the stated conclusion follows.

Formal statement
Proof (Lean source)
lemma exponentialInterventionDensity_hasDerivAt (x : ℝ) : HasDerivAt exponentialInterventionDensity (4 * exponentialInterventionDensity x) x := by have hexp : HasDerivAt (fun y : ℝ => exp (4 * y)) (4 * exp (4 * x)) x := by simpa [Function.comp_def, mul_comm] using (Real.hasDerivAt_exp (4 * x)).comp x (hasDerivAt_const_mul (x := x) 4) unfold exponentialInterventionDensity convert (hexp.const_mul 4).div_const (exp 4 - 1) using 1 <;> first | rfl | ring
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.exponentialInterventionDensity_hasDerivAt · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessSigns.lean:15
theorem exponentialLogRatio_hasDerivAt Lemma exponentialLogRatio_hasDerivAt in the paper ↗

The unreflected child log ratio has slope 4 - K / (5p). Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
K x :
hden :
1 + (1 / 10 : ℝ) * K * centeredCoordinate x ≠ 0
HasDerivAt (fun z : ℝ => log (exponentialInterventionDensity z / (1 + (1/10 : ℝ) * K * centeredCoordinate z))) (4 - (1/5 : ℝ) * K / (1 + (1/10 : ℝ) * K * centeredCoordinate x)) x
Proof (Lean source)
lemma exponentialLogRatio_hasDerivAt (K x : ℝ) (hden : 1 + (1 / 10 : ℝ) * K * centeredCoordinate x ≠ 0) : HasDerivAt (fun z : ℝ => log (exponentialInterventionDensity z / (1 + (1/10 : ℝ) * K * centeredCoordinate z))) (4 - (1/5 : ℝ) * K / (1 + (1/10 : ℝ) * K * centeredCoordinate x)) x := by have hq := exponentialInterventionDensity_hasDerivAt x have hd : HasDerivAt (fun z : ℝ => 1 + (1/10 : ℝ) * K * centeredCoordinate z) ((1/5 : ℝ) * K) x := by unfold centeredCoordinate convert ((((hasDerivAt_id x).const_mul 2).sub_const 1).const_mul ((1/10 : ℝ) * K)).const_add 1 using 1 <;> first | rfl | ring have hquot := hq.div hd hden have hqpos := exponentialInterventionDensity_pos x have hh := hquot.log (div_ne_zero (ne_of_gt hqpos) hden) simp only [Pi.div_apply] at hh change HasDerivAt (fun z : ℝ => log (exponentialInterventionDensity z / (1 + (1 / 10 : ℝ) * K * centeredCoordinate z))) _ x at hh convert hh using 1 have hden' : 10 + K * centeredCoordinate x ≠ 0 := by intro h apply hden nlinarith field_simp [hden', ne_of_gt hqpos]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.exponentialLogRatio_hasDerivAt · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessSigns.lean:27
theorem reflectedExponentialLogRatio_hasDerivAt Lemma reflectedExponentialLogRatio_hasDerivAt in the paper ↗

Reflection reverses the child log-ratio derivative. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
K x :
hden :
1 + (1 / 10 : ℝ) * K * centeredCoordinate (1 - x) ≠ 0
HasDerivAt (fun z : ℝ => log (exponentialInterventionDensity (1-z) / (1 + (1/10 : ℝ) * K * centeredCoordinate (1-z)))) (-4 + (1/5 : ℝ) * K / (1 + (1/10 : ℝ) * K * centeredCoordinate (1-x))) x
Proof (Lean source)
lemma reflectedExponentialLogRatio_hasDerivAt (K x : ℝ) (hden : 1 + (1 / 10 : ℝ) * K * centeredCoordinate (1 - x) ≠ 0) : HasDerivAt (fun z : ℝ => log (exponentialInterventionDensity (1-z) / (1 + (1/10 : ℝ) * K * centeredCoordinate (1-z)))) (-4 + (1/5 : ℝ) * K / (1 + (1/10 : ℝ) * K * centeredCoordinate (1-x))) x := by have hh := (exponentialLogRatio_hasDerivAt K (1 - x) hden).comp x ((hasDerivAt_const (x := x) (1 : ℝ)).sub (hasDerivAt_id x)) convert hh using 1 <;> first | rfl | ring
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.reflectedExponentialLogRatio_hasDerivAt · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessSigns.lean:56
theorem sparseWitness_fixedOwnDerivativeSign

The reflected sparse witness has the prescribed strict own-coordinate derivative signs. the stated conclusion follows.

Formal statement
s :
Proof (Lean source)
lemma sparseWitness_fixedOwnDerivativeSign (s : SignVector 3) : FixedOwnDerivativeSign threeNodeDAG s (sparseWitness s) := by intro i v hv unfold ownLogRatioDerivative have hud : UniqueDiffWithinAt ℝ (Icc (0 : ℝ) 1) (v i) := (uniqueDiffOn_Icc (by norm_num)).uniqueDiffWithinAt (hv i (Set.mem_univ i)) by_cases hi : i = 1 · subst i have hv0 : v 0 ∈ Icc (0 : ℝ) 1 := hv 0 (Set.mem_univ 0) have hK := abs_centeredCoordinate_le_one (reflectedCoordinate_mem_unitInterval s 0 hv0) rw [abs_le] at hK rcases s.signed 1 with hs | hs · rw [hs] have href (z : ℝ) : reflectedCoordinate s 1 z = 1-z := by simp [reflectedCoordinate, reflect, hs, show (-1 : ℝ) ≠ 1 by norm_num] have hup (z : ℝ) : reflectedCoordinate s 0 ((update v 1 z) 0) = reflectedCoordinate s 0 (v 0) := by simp [update] simp only [sparseWitness, sparseQ, sparseP, if_true] simp_rw [href, hup] simp only [Function.update_self] change 0 < (-1 : ℝ) * derivWithin (fun z : ℝ => log (exponentialInterventionDensity (1-z) / (1 + (1/10 : ℝ) * centeredCoordinate (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (1-z)))) (Icc 0 1) (v 1) have hp := sparseP_pos s 1 v hv have hden : 1 + (1 / 10 : ℝ) * centeredCoordinate (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (1 - v 1) ≠ 0 := by simpa [sparseP, reflectedCoordinate, reflect, hs, show (-1 : ℝ) ≠ 1 by norm_num] using ne_of_gt hp rw [(reflectedExponentialLogRatio_hasDerivAt _ _ hden).hasDerivWithinAt.derivWithin hud] have hp' : 0 < 1 + (1 / 10 : ℝ) * centeredCoordinate (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (1 - v 1) := by have hv1 : 0 ≤ v 1 ∧ v 1 ≤ 1 := hv 1 (Set.mem_univ 1) have h1 := abs_centeredCoordinate_le_one (show 1 - v 1 ∈ Icc (0 : ℝ) 1 by constructor <;> linarith) rw [abs_le] at h1 nlinarith have hv1 : 0 ≤ v 1 ∧ v 1 ≤ 1 := hv 1 (Set.mem_univ 1) have h1 := abs_centeredCoordinate_le_one (show 1 - v 1 ∈ Icc (0 : ℝ) 1 by constructor <;> linarith) rw [abs_le] at h1 have hden_lb : (9 / 10 : ℝ) ≤ 1 + (1 / 10 : ℝ) * centeredCoordinate (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (1 - v 1) := by nlinarith have hfrac : centeredCoordinate (reflectedCoordinate s 0 (v 0)) / (1 + (1 / 10 : ℝ) * centeredCoordinate (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (1 - v 1)) ≤ 10 / 9 := (div_le_iff₀ hp').2 (by nlinarith [hden_lb]) norm_num at hfrac ⊢ have hsmall : (1 / 5 : ℝ) * (centeredCoordinate (reflectedCoordinate s 0 (v 0)) / (1 + (1 / 10 : ℝ) * centeredCoordinate (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (1 - v 1))) ≤ 2 / 9 := calc _ ≤ (1 / 5 : ℝ) * (10 / 9) := mul_le_mul_of_nonneg_left hfrac (by norm_num) _ = 2 / 9 := by norm_num norm_num at hsmall rw [mul_div_assoc] linarith · rw [hs] have href (z : ℝ) : reflectedCoordinate s 1 z = z := by simp [reflectedCoordinate, reflect, hs] have hup (z : ℝ) : reflectedCoordinate s 0 ((update v 1 z) 0) = reflectedCoordinate s 0 (v 0) := by simp [update] simp only [sparseWitness, sparseQ, sparseP, if_true] simp_rw [href, hup] simp only [Function.update_self] change 0 < (1 : ℝ) * derivWithin (fun z : ℝ => log (exponentialInterventionDensity z / (1 + (1/10 : ℝ) * centeredCoordinate (reflectedCoordinate s 0 (v 0)) * centeredCoordinate z))) (Icc 0 1) (v 1) have hp := sparseP_pos s 1 v hv have hden : 1 + (1 / 10 : ℝ) * centeredCoordinate (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (v 1) ≠ 0 := by simpa [sparseP, reflectedCoordinate, reflect, hs] using ne_of_gt hp rw [(exponentialLogRatio_hasDerivAt _ _ hden).hasDerivWithinAt.derivWithin hud] have hv1 : 0 ≤ v 1 ∧ v 1 ≤ 1 := hv 1 (Set.mem_univ 1) have h1 := abs_centeredCoordinate_le_one hv1 rw [abs_le] at h1 have hp' : 0 < 1 + (1 / 10 : ℝ) * centeredCoordinate (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (v 1) := by nlinarith have hden_lb : (9 / 10 : ℝ) ≤ 1 + (1 / 10 : ℝ) * centeredCoordinate (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (v 1) := by nlinarith have hfrac : centeredCoordinate (reflectedCoordinate s 0 (v 0)) / (1 + (1 / 10 : ℝ) * centeredCoordinate (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (v 1)) ≤ 10 / 9 := (div_le_iff₀ hp').2 (by nlinarith [hden_lb]) norm_num at hfrac ⊢ have hsmall : (1 / 5 : ℝ) * (centeredCoordinate (reflectedCoordinate s 0 (v 0)) / (1 + (1 / 10 : ℝ) * centeredCoordinate (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (v 1))) ≤ 2 / 9 := calc _ ≤ (1 / 5 : ℝ) * (10 / 9) := mul_le_mul_of_nonneg_left hfrac (by norm_num) _ = 2 / 9 := by norm_num norm_num at hsmall rw [mul_div_assoc] linarith · rcases s.signed i with hs | hs · rw [hs] have href (z : ℝ) : reflectedCoordinate s i z = 1 - z := by simp [reflectedCoordinate, reflect, hs, show (-1 : ℝ) ≠ 1 by norm_num] simp only [sparseWitness, sparseQ, sparseP, hi] simp_rw [href] simp only [if_false, div_one] have hd := reflectedExponentialLogRatio_hasDerivAt (0 : ℝ) (v i) (by norm_num) have hd' : HasDerivAt (fun z : ℝ => log (exponentialInterventionDensity (1 - z))) (-4) (v i) := by simpa using hd rw [hd'.hasDerivWithinAt.derivWithin hud] norm_num · rw [hs] have href (z : ℝ) : reflectedCoordinate s i z = z := by simp [reflectedCoordinate, reflect, hs] simp only [sparseWitness, sparseQ, sparseP, hi] simp_rw [href] simp only [if_false, div_one] have hd := exponentialLogRatio_hasDerivAt (0 : ℝ) (v i) (by norm_num) have hd' : HasDerivAt (fun z : ℝ => log (exponentialInterventionDensity z)) 4 (v i) := by simpa using hd rw [hd'.hasDerivWithinAt.derivWithin hud] norm_num
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseWitness_fixedOwnDerivativeSign · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessSigns.lean:69
theorem cancellationWitness_fixedOwnDerivativeSign

The reflected cancellation witness has the prescribed strict own-coordinate derivative signs. the stated conclusion follows.

Formal statement
Proof (Lean source)
lemma cancellationWitness_fixedOwnDerivativeSign (s : SignVector 3) : FixedOwnDerivativeSign threeNodeDAG s (cancellationWitness s) := by intro i v hv unfold ownLogRatioDerivative have hud : UniqueDiffWithinAt ℝ (Icc (0 : ℝ) 1) (v i) := (uniqueDiffOn_Icc (by norm_num)).uniqueDiffWithinAt (hv i (Set.mem_univ i)) by_cases hi : i = 1 · subst i have hv0 : v 0 ∈ Icc (0 : ℝ) 1 := hv 0 (Set.mem_univ 0) have hK := cancellationPrimitive_mem_unitInterval_sub (reflectedCoordinate_mem_unitInterval s 0 hv0) rcases s.signed 1 with hs | hs · rw [hs] have href (z : ℝ) : reflectedCoordinate s 1 z = 1-z := by simp [reflectedCoordinate, reflect, hs, show (-1 : ℝ) ≠ 1 by norm_num] have hup (z : ℝ) : reflectedCoordinate s 0 ((update v 1 z) 0) = reflectedCoordinate s 0 (v 0) := by simp [update] simp only [cancellationWitness, sparseQ, cancellationP, if_true] simp_rw [href, hup] simp only [Function.update_self] change 0 < (-1 : ℝ) * derivWithin (fun z : ℝ => log (exponentialInterventionDensity (1-z) / (1 + (1/10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (1-z)))) (Icc 0 1) (v 1) have hp := cancellationP_pos s 1 v hv have hden : 1 + (1 / 10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (1 - v 1) ≠ 0 := by simpa [cancellationP, reflectedCoordinate, reflect, hs, show (-1 : ℝ) ≠ 1 by norm_num] using ne_of_gt hp rw [(reflectedExponentialLogRatio_hasDerivAt _ _ hden).hasDerivWithinAt.derivWithin hud] have hv1 : 0 ≤ v 1 ∧ v 1 ≤ 1 := hv 1 (Set.mem_univ 1) have h1 := abs_centeredCoordinate_le_one (show 1 - v 1 ∈ Icc (0 : ℝ) 1 by constructor <;> linarith) rw [abs_le] at h1 have hp' : 0 < 1 + (1 / 10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (1 - v 1) := by nlinarith [hK.1, hK.2] have hden_lb : (9 / 10 : ℝ) ≤ 1 + (1 / 10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (1 - v 1) := by nlinarith [hK.1, hK.2] have hfrac : cancellationPrimitive (reflectedCoordinate s 0 (v 0)) / (1 + (1 / 10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (1 - v 1)) ≤ 10 / 9 := (div_le_iff₀ hp').2 (by nlinarith [hK.2, hden_lb]) norm_num at hfrac ⊢ have hsmall : (1 / 5 : ℝ) * (cancellationPrimitive (reflectedCoordinate s 0 (v 0)) / (1 + (1 / 10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (1 - v 1))) ≤ 2 / 9 := calc _ ≤ (1 / 5 : ℝ) * (10 / 9) := mul_le_mul_of_nonneg_left hfrac (by norm_num) _ = 2 / 9 := by norm_num norm_num at hsmall rw [mul_div_assoc] linarith · rw [hs] have href (z : ℝ) : reflectedCoordinate s 1 z = z := by simp [reflectedCoordinate, reflect, hs] have hup (z : ℝ) : reflectedCoordinate s 0 ((update v 1 z) 0) = reflectedCoordinate s 0 (v 0) := by simp [update] simp only [cancellationWitness, sparseQ, cancellationP, if_true] simp_rw [href, hup] simp only [Function.update_self] change 0 < (1 : ℝ) * derivWithin (fun z : ℝ => log (exponentialInterventionDensity z / (1 + (1/10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 (v 0)) * centeredCoordinate z))) (Icc 0 1) (v 1) have hp := cancellationP_pos s 1 v hv have hden : 1 + (1 / 10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (v 1) ≠ 0 := by simpa [cancellationP, reflectedCoordinate, reflect, hs] using ne_of_gt hp rw [(exponentialLogRatio_hasDerivAt _ _ hden).hasDerivWithinAt.derivWithin hud] have hv1 : 0 ≤ v 1 ∧ v 1 ≤ 1 := hv 1 (Set.mem_univ 1) have h1 := abs_centeredCoordinate_le_one hv1 rw [abs_le] at h1 have hp' : 0 < 1 + (1 / 10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (v 1) := by nlinarith [hK.1, hK.2] have hden_lb : (9 / 10 : ℝ) ≤ 1 + (1 / 10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (v 1) := by nlinarith [hK.1, hK.2] have hfrac : cancellationPrimitive (reflectedCoordinate s 0 (v 0)) / (1 + (1 / 10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (v 1)) ≤ 10 / 9 := (div_le_iff₀ hp').2 (by nlinarith [hK.2, hden_lb]) norm_num at hfrac ⊢ have hsmall : (1 / 5 : ℝ) * (cancellationPrimitive (reflectedCoordinate s 0 (v 0)) / (1 + (1 / 10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (v 1))) ≤ 2 / 9 := calc _ ≤ (1 / 5 : ℝ) * (10 / 9) := mul_le_mul_of_nonneg_left hfrac (by norm_num) _ = 2 / 9 := by norm_num norm_num at hsmall rw [mul_div_assoc] linarith · rcases s.signed i with hs | hs · rw [hs] have href (z : ℝ) : reflectedCoordinate s i z = 1 - z := by simp [reflectedCoordinate, reflect, hs, show (-1 : ℝ) ≠ 1 by norm_num] simp only [cancellationWitness, sparseQ, cancellationP, hi] simp_rw [href] simp only [if_false, div_one] have hd := reflectedExponentialLogRatio_hasDerivAt (0 : ℝ) (v i) (by norm_num) have hd' : HasDerivAt (fun z : ℝ => log (exponentialInterventionDensity (1 - z))) (-4) (v i) := by simpa using hd rw [hd'.hasDerivWithinAt.derivWithin hud] norm_num · rw [hs] have href (z : ℝ) : reflectedCoordinate s i z = z := by simp [reflectedCoordinate, reflect, hs] simp only [cancellationWitness, sparseQ, cancellationP, hi] simp_rw [href] simp only [if_false, div_one] have hd := exponentialLogRatio_hasDerivAt (0 : ℝ) (v i) (by norm_num) have hd' : HasDerivAt (fun z : ℝ => log (exponentialInterventionDensity z)) 4 (v i) := by simpa using hd rw [hd'.hasDerivWithinAt.derivWithin hud] norm_num
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellationWitness_fixedOwnDerivativeSign · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessSigns.lean:206
theorem explicitWitness_regularities

Both explicit witnesses are positive, normalized, smooth to every finite order, and obey their prescribed own-coordinate derivative signs. the stated conclusion follows.

Formal statement
s :
conclusion 3
k i :
ContDiffOn ℝ k ((sparseWitness s).p i) (latentCube 3)
conclusion 4
k i :
ContDiffOn ℝ k ((sparseWitness s).q i) (Icc (0 : ℝ) 1)
conclusion 7
k i :
conclusion 8
k i :
ContDiffOn ℝ k ((cancellationWitness s).q i) (Icc (0 : ℝ) 1)
Proof (Lean source)
lemma explicitWitness_regularities (s : SignVector 3) : PositiveNormalizedSmoothMechanisms threeNodeDAG (sparseWitness s) ∧ FixedOwnDerivativeSign threeNodeDAG s (sparseWitness s) ∧ (∀ k i, ContDiffOn ℝ k ((sparseWitness s).p i) (latentCube 3)) ∧ (∀ k i, ContDiffOn ℝ k ((sparseWitness s).q i) (Icc (0 : ℝ) 1)) ∧ PositiveNormalizedSmoothMechanisms threeNodeDAG (cancellationWitness s) ∧ FixedOwnDerivativeSign threeNodeDAG s (cancellationWitness s) ∧ (∀ k i, ContDiffOn ℝ k ((cancellationWitness s).p i) (latentCube 3)) ∧ (∀ k i, ContDiffOn ℝ k ((cancellationWitness s).q i) (Icc (0 : ℝ) 1)) := by rcases sparseWitness_contDiff_all s with ⟨hsp, hsq⟩ rcases cancellationWitness_contDiff_all s with ⟨hcp, hcq⟩ exact ⟨sparseWitness_positive_normalized_smooth s, sparseWitness_fixedOwnDerivativeSign s, hsp, hsq, cancellationWitness_positive_normalized_smooth s, cancellationWitness_fixedOwnDerivativeSign s, hcp, hcq⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.explicitWitness_regularities · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessSigns.lean:339
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.WitnessTransport 4 declarations This file records the distribution-function and first-moment calculations used to transport the sparse witness's derivative bound along the exponential tilt.

Exponential-tilt transport identities

This file records the distribution-function and first-moment calculations used to transport the sparse witness's derivative bound along the exponential tilt.

theorem exponentialInterventionDensity_intervalIntegral Lemma exponentialInterventionDensity_intervalIntegral in the paper ↗

The exponential intervention density has its stated closed-form distribution function. the stated conclusion follows.

Formal statement
x :
(∫ z in (0 : ℝ)..x, exponentialInterventionDensity z)
= (exp (4 * x) - 1) / (exp 4 - 1)
Proof (Lean source)
lemma exponentialInterventionDensity_intervalIntegral (x : ℝ) : (∫ z in (0 : ℝ)..x, exponentialInterventionDensity z) = (exp (4 * x) - 1) / (exp 4 - 1) := by have hden : exp 4 - 1 ≠ 0 := by linarith [thirteen_lt_exp_four] have hd (z : ℝ) : HasDerivAt (fun u : ℝ => (exp (4 * u) - 1) / (exp 4 - 1)) (exponentialInterventionDensity z) z := by have he : HasDerivAt (fun u : ℝ => exp (4 * u)) (4 * exp (4 * z)) z := by simpa [Function.comp_def, mul_comm] using (Real.hasDerivAt_exp (4 * z)).comp z (hasDerivAt_const_mul (x := z) 4) simpa [exponentialInterventionDensity] using (he.sub_const 1).div_const (exp 4 - 1) rw [intervalIntegral.integral_eq_sub_of_hasDerivAt (fun z _ => hd z) (by apply Continuous.intervalIntegrable; unfold exponentialInterventionDensity; fun_prop)] simp
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.exponentialInterventionDensity_intervalIntegral · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessTransport.lean:17
theorem exponentialInterventionCDF_le_identity Lemma exponentialInterventionCDF_le_identity in the paper ↗

The exponential-tilt distribution function lies below the uniform distribution function. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
x :
hx :
x ∈ Icc (0 : ℝ) 1
(∫ z in (0 : ℝ)..x, exponentialInterventionDensity z) ≤ x
Proof (Lean source)
lemma exponentialInterventionCDF_le_identity {x : ℝ} (hx : x ∈ Icc (0 : ℝ) 1) : (∫ z in (0 : ℝ)..x, exponentialInterventionDensity z) ≤ x := by rw [exponentialInterventionDensity_intervalIntegral] have hH := (cancellationPrimitive_mem_negUnitInterval hx).2 unfold cancellationPrimitive at hH linarith
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.exponentialInterventionCDF_le_identity · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessTransport.lean:37
theorem exponentialInterventionDensity_firstMoment Lemma exponentialInterventionDensity_firstMoment in the paper ↗

The exponential intervention density has the exact first moment used in the sparse gap. the stated conclusion follows.

Formal statement
(∫ z in Icc (0 : ℝ) 1, z * exponentialInterventionDensity z)
= 1 / (1 - exp (-4)) - 1 / 4
Proof (Lean source)
lemma exponentialInterventionDensity_firstMoment : (∫ z in Icc (0 : ℝ) 1, z * exponentialInterventionDensity z) = 1 / (1 - exp (-4)) - 1 / 4 := by have hden : exp 4 - 1 ≠ 0 := by linarith [thirteen_lt_exp_four] let F : ℝ → ℝ := fun z => exp (4 * z) * (z - 1 / 4) / (exp 4 - 1) have hd (z : ℝ) : HasDerivAt F (z * exponentialInterventionDensity z) z := by have he : HasDerivAt (fun u : ℝ => exp (4 * u)) (4 * exp (4 * z)) z := by simpa [Function.comp_def, mul_comm] using (Real.hasDerivAt_exp (4 * z)).comp z (hasDerivAt_const_mul (x := z) 4) have hz : HasDerivAt (fun u : ℝ => u - 1 / 4) 1 z := (hasDerivAt_id z).sub_const (1 / 4) have hraw : HasDerivAt F ((4 * exp (4 * z) * (z - 1 / 4) + exp (4 * z)) / (exp 4 - 1)) z := by simpa only [F, Pi.mul_apply, mul_one] using (he.mul hz).div_const (exp 4 - 1) apply hraw.congr_deriv unfold exponentialInterventionDensity field_simp ring rw [MeasureTheory.integral_Icc_eq_integral_Ioc] rw [← intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1)] rw [intervalIntegral.integral_eq_sub_of_hasDerivAt (fun z _ => hd z) (by apply Continuous.intervalIntegrable; unfold exponentialInterventionDensity; fun_prop)] dsimp only [F] simp only [mul_one, mul_zero, Real.exp_zero, zero_sub, one_mul] rw [Real.exp_neg] field_simp [hden, Real.exp_ne_zero] ring
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.exponentialInterventionDensity_firstMoment · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessTransport.lean:46
theorem exponentialInterventionDensity_centeredMean Lemma exponentialInterventionDensity_centeredMean in the paper ↗

The exponential-tilt mean excess over the uniform mean has its exact closed form. the stated conclusion follows.

Formal statement
(∫ z in Icc (0 : ℝ) 1, z * exponentialInterventionDensity z) - 1 / 2
= 1 / (1 - exp (-4)) - 3 / 4
Proof (Lean source)
lemma exponentialInterventionDensity_centeredMean : (∫ z in Icc (0 : ℝ) 1, z * exponentialInterventionDensity z) - 1 / 2 = 1 / (1 - exp (-4)) - 3 / 4 := by rw [exponentialInterventionDensity_firstMoment] ring
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.exponentialInterventionDensity_centeredMean · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/WitnessTransport.lean:80
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.Helpers.Witnesses 46 declarations This file contains the elementary compact-cube mechanisms used by the genericity and cancellation arguments.

Explicit sparse, cancellation, and affine-path mechanisms

This file contains the elementary compact-cube mechanisms used by the genericity and cancellation arguments.

Reflection of a coordinate when its prescribed sign is negative.

Definition (Lean source)
σ z :
reflect σ z :
if σ = 1 then z else 1 - z
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.reflect · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:18
def centeredCoordinate

The centered affine function 2z-1.

Definition (Lean source)
z :
centeredCoordinate z :
2 * z - 1
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.centeredCoordinate · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:21
def exponentialInterventionDensity

The normalized exponential intervention density.

Definition (Lean source)
z :
exponentialInterventionDensity z :
4 * exp (4 * z) / (exp 4 - 1)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.exponentialInterventionDensity · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:24
def cancellationPrimitive

The cancellation primitive H.

Definition (Lean source)
x :
cancellationPrimitive x :
(exp (4 * x) - 1) / (exp 4 - 1) - x
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellationPrimitive · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:28
def threeNodeEdge

The three-node graph 0 → 1 with node 2 isolated.

Definition (Lean source)
i j :
Fin 3
threeNodeEdge i j :
Prop
clause 1
i = 0
clause 2
j = 1
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.threeNodeEdge · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:32
theorem threeNodeEdge_acyclic

The three-node edge relation has no directed cycle.

Formal statement
v :
Fin 3
Proof (Lean source)
lemma threeNodeEdge_acyclic (v : Fin 3) : ¬ TransGen threeNodeEdge v v := by intro h have path_shape : ∀ {a b : Fin 3}, TransGen threeNodeEdge a b → a = 0 ∧ b = 1 := by intro a b hab induction hab with | single hab => exact hab | tail hab hbc ih => exact ⟨ih.1, hbc.2⟩ rcases path_shape h with ⟨hv0, hv1⟩ simp_all
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.threeNodeEdge_acyclic · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:35
def threeNodeDAG

The fixed three-node witness DAG.

Definition (Lean source)
threeNodeDAG :
DAG (Fin 3)
clause 1
clause 2
decEdge := fun i j => by unfold threeNodeEdge; infer_instance
clause 3
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.threeNodeDAG · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:47
def reflectedCoordinate

Reflected coordinate selected by a sign vector.

Definition (Lean source)
n :
s :
i :
Fin n
z :
reflectedCoordinate s i z :
reflect (s.value i) z
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.reflectedCoordinate · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:53
def sparseP

Sparse witness observational conditional mechanism.

Definition (Lean source)
s :
i :
Fin 3
v :
sparseP s i v :
if i
= 1 then 1
+ (1 / 10 : ℝ) * centeredCoordinate (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (reflectedCoordinate s 1 (v 1)) else 1
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseP · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:57
def sparseQ

Sparse witness intervention mechanism.

Definition (Lean source)
s :
i :
Fin 3
z :
sparseQ s i z :
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseQ · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:64
theorem sparseP_parent_local

The sparse observational factor depends only on its own coordinate and graph parents.

Formal statement
s :
i v w :
v i = w i
(∀ j ∈ threeNodeDAG.parents i, v j = w j)
sparseP s i v = sparseP s i w
Proof (Lean source)
lemma sparseP_parent_local (s : SignVector 3) : ∀ i v w, v i = w i → (∀ j ∈ threeNodeDAG.parents i, v j = w j) → sparseP s i v = sparseP s i w := by intro i v w hi hp simp only [sparseP] split · rename_i h_i have h0 : v 0 = w 0 := hp 0 (by simp [threeNodeDAG, parents, threeNodeEdge, h_i]) have h1 : v 1 = w 1 := by simpa [h_i] using hi rw [h0, h1] · rfl
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseP_parent_local · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:68
def sparseWitness

The explicit reflected sparse witness on 0 → 1 plus an isolated node.

Definition (Lean source)
s :
sparseWitness s :
clause 1
p := sparseP s
clause 2
q := sparseQ s
clause 3
parent_local := sparseP_parent_local s
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseWitness · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:83
def cancellationP

Cancellation witness observational conditional mechanism.

Definition (Lean source)
s :
i :
Fin 3
v :
cancellationP s i v :
if i
= 1 then 1
+ (1 / 10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (reflectedCoordinate s 1 (v 1)) else 1
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellationP · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:89
theorem cancellationP_parent_local

The cancellation observational factor depends only on its own coordinate and graph parents.

Formal statement
s :
i v w :
v i = w i
(∀ j ∈ threeNodeDAG.parents i, v j = w j)
Proof (Lean source)
lemma cancellationP_parent_local (s : SignVector 3) : ∀ i v w, v i = w i → (∀ j ∈ threeNodeDAG.parents i, v j = w j) → cancellationP s i v = cancellationP s i w := by intro i v w hi hp simp only [cancellationP] split · rename_i h_i have h0 : v 0 = w 0 := hp 0 (by simp [threeNodeDAG, parents, threeNodeEdge, h_i]) have h1 : v 1 = w 1 := by simpa [h_i] using hi rw [h0, h1] · rfl
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellationP_parent_local · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:96
def cancellationWitness

The explicit reflected faithful cancellation mechanism.

Definition (Lean source)
s :
cancellationWitness s :
clause 1
clause 2
q := sparseQ s
clause 3
parent_local := cancellationP_parent_local s
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellationWitness · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:112
def embeddedSparseP

Edge-specific sparse endpoint embedded in an arbitrary DAG.

Definition (Lean source)
n :
s :
j i :
Fin n
l :
Fin n
v :
embeddedSparseP s j i l v :
if l
= i then 1
+ (1 / 10 : ℝ) * centeredCoordinate (reflectedCoordinate s j (v j)) * centeredCoordinate (reflectedCoordinate s i (v i)) else 1
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.embeddedSparseP · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:118
theorem embeddedSparseP_parent_local

Given the selected directed edge, the embedded sparse factor depends only on its own coordinate and graph parents.

Formal statement
n :
DAG (Fin n)
s :
j i :
Fin n
hji :
G.edge j i
l v w :
v l = w l
(∀ k ∈ G.parents l, v k = w k)
embeddedSparseP s j i l v = embeddedSparseP s j i l w
Proof (Lean source)
lemma embeddedSparseP_parent_local {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) {j i : Fin n} (hji : G.edge j i) : ∀ l v w, v l = w l → (∀ k ∈ G.parents l, v k = w k) → embeddedSparseP s j i l v = embeddedSparseP s j i l w := by intro l v w hl hp simp only [embeddedSparseP] split · rename_i hli have hj : v j = w j := hp j (by simpa [parents, hli] using hji) have hi : v i = w i := by simpa [hli] using hl rw [hj, hi] · rfl
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.embeddedSparseP_parent_local · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:126
def embeddedSparseWitness

The edge-specific sparse endpoint used by the affine perturbation.

Definition (Lean source)
n :
DAG (Fin n)
s :
j i :
Fin n
hji :
G.edge j i
embeddedSparseWitness s hji :
clause 1
p := embeddedSparseP s j i
clause 2
clause 3
parent_local := embeddedSparseP_parent_local s hji
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.embeddedSparseWitness · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:141
theorem affinePath_parent_local

The affine interpolation of two mechanisms remains local to each node and its parents.

Formal statement
n :
DAG (Fin n)
θ endpoint :
t :
i v w :
v i = w i
(∀ j ∈ G.parents i, v j = w j)
((1 - t) * θ.p i v + t * endpoint.p i v) = ((1 - t) * θ.p i w + t * endpoint.p i w)
Proof (Lean source)
lemma affinePath_parent_local {n : ℕ} {G : DAG (Fin n)} (θ endpoint : Mechanism n G) (t : ℝ) : ∀ i v w, v i = w i → (∀ j ∈ G.parents i, v j = w j) → ((1 - t) * θ.p i v + t * endpoint.p i v) = ((1 - t) * θ.p i w + t * endpoint.p i w) := by intro i v w hi hp rw [θ.parent_local i v w hi hp, endpoint.parent_local i v w hi hp]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePath_parent_local · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:148
def affinePathExtension

For a finite dimension, DAG, sign pattern, stratum point, directed edge endpoints, edge certificate, and real path parameter, the unrestricted affine mechanism path interpolates toward the embedded sparse witness.

Definition (Lean source)
n :
DAG (Fin n)
s :
θ :
j i :
Fin n
hji :
G.edge j i
t :
affinePathExtension s θ hji t :
clause 1
p := fun l v => (1 - t) * θ.1.p l v + t * (embeddedSparseWitness s hji).p l v
clause 2
q := fun l z => (1 - t) * θ.1.q l z + t * (embeddedSparseWitness s hji).q l z
clause 3
parent_local := affinePath_parent_local θ.1 (embeddedSparseWitness s hji) t
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePathExtension · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:159
def affinePath

Nodewise normalized affine interpolation, indexed exactly by t ∈ [0,1].

Definition (Lean source)
n :
DAG (Fin n)
s :
θ :
j i :
Fin n
hji :
G.edge j i
t :
Icc (0 : ℝ) 1
affinePath s θ hji t :
affinePathExtension s θ hji t.1
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.affinePath · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:169
theorem exponentialInterventionDensity_integral

The exponential intervention density integrates to one on the unit interval.

Formal statement
∫ z in Icc (0 : ℝ) 1, exponentialInterventionDensity z = 1
Proof (Lean source)
lemma exponentialInterventionDensity_integral : ∫ z in Icc (0 : ℝ) 1, exponentialInterventionDensity z = 1 := by rw [MeasureTheory.integral_Icc_eq_integral_Ioc] rw [← intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1)] unfold exponentialInterventionDensity have hfun : (fun z : ℝ => 4 * exp (4 * z) / (exp 4 - 1)) = fun z => (exp 4 - 1)⁻¹ * (4 * exp (4 * z)) := by funext z field_simp rw [hfun, intervalIntegral.integral_const_mul, intervalIntegral.integral_const_mul] rw [intervalIntegral.integral_comp_mul_left exp (by norm_num : (4 : ℝ) ≠ 0)] rw [integral_exp] have hden : exp 4 - 1 ≠ 0 := by have h : 1 < exp 4 := Real.one_lt_exp_iff.mpr (by norm_num) linarith simp only [mul_zero, mul_one, Real.exp_zero, inv_eq_one_div, smul_eq_mul] field_simp
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.exponentialInterventionDensity_integral · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:176
theorem centeredCoordinate_integral

The centered coordinate integrates to zero on the unit interval.

Formal statement
∫ z in Icc (0 : ℝ) 1, centeredCoordinate z = 0
Proof (Lean source)
lemma centeredCoordinate_integral : ∫ z in Icc (0 : ℝ) 1, centeredCoordinate z = 0 := by rw [MeasureTheory.integral_Icc_eq_integral_Ioc] rw [← intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1)] unfold centeredCoordinate rw [intervalIntegral.integral_sub (intervalIntegral.intervalIntegrable_id.const_mul 2) intervalIntegrable_const, intervalIntegral.integral_const_mul, integral_id, integral_one] norm_num
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.centeredCoordinate_integral · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:195
theorem integral_reflectedCoordinate

Reflection about the midpoint preserves integrals over the unit interval. the stated conclusion follows.

Formal statement
n :
s :
i :
Fin n
f :
ℝ → ℝ
∫ z in Icc (0 : ℝ) 1, f (reflectedCoordinate s i z) = ∫ z in Icc (0 : ℝ) 1, f z
Proof (Lean source)
lemma integral_reflectedCoordinate {n : ℕ} (s : SignVector n) (i : Fin n) (f : ℝ → ℝ) : ∫ z in Icc (0 : ℝ) 1, f (reflectedCoordinate s i z) = ∫ z in Icc (0 : ℝ) 1, f z := by rcases s.signed i with hi | hi · have hne : (-1 : ℝ) ≠ 1 := by norm_num simp only [reflectedCoordinate, reflect, hi, if_neg hne] rw [MeasureTheory.integral_Icc_eq_integral_Ioc, MeasureTheory.integral_Icc_eq_integral_Ioc] rw [← intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1), ← intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1)] simpa using intervalIntegral.integral_comp_sub_left f (1 : ℝ) · simp [reflectedCoordinate, reflect, hi]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.integral_reflectedCoordinate · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:208
theorem sparseQ_normalized

Every reflected exponential intervention density is normalized. the stated conclusion follows.

Formal statement
s :
i :
Fin 3
∫ z in Icc (0 : ℝ) 1, sparseQ s i z = 1
Proof (Lean source)
lemma sparseQ_normalized (s : SignVector 3) (i : Fin 3) : ∫ z in Icc (0 : ℝ) 1, sparseQ s i z = 1 := by unfold sparseQ rw [integral_reflectedCoordinate] exact exponentialInterventionDensity_integral
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseQ_normalized · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:224
theorem centeredCoordinate_reflected_integral

Every reflected centered coordinate has zero integral. the stated conclusion follows.

Formal statement
s :
i :
Fin 3
∫ z in Icc (0 : ℝ) 1, centeredCoordinate (reflectedCoordinate s i z) = 0
Proof (Lean source)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.centeredCoordinate_reflected_integral · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:232
theorem sparseP_normalized

Every sparse observational conditional is normalized in its own coordinate. the stated conclusion follows.

Formal statement
s :
i :
Fin 3
v :
∫ z in Icc (0 : ℝ) 1, sparseP s i (update v i z) = 1
Proof (Lean source)
lemma sparseP_normalized (s : SignVector 3) (i : Fin 3) (v : LatentState 3) : ∫ z in Icc (0 : ℝ) 1, sparseP s i (update v i z) = 1 := by by_cases hi : i = 1 · subst i simp only [sparseP, if_true, Function.update_self] simp only [update, dif_neg (by decide : ¬(0 : Fin 3) = 1)] rw [integral_add] · simp only [integral_const, Measure.restrict_apply_univ, Measure.real, measureReal_def, Real.volume_Icc, sub_zero, ENNReal.toReal_one, one_smul] rw [show (∫ a in Icc (0 : ℝ) 1, (1 / 10 * centeredCoordinate (reflectedCoordinate s 0 (v 0))) * centeredCoordinate (reflectedCoordinate s 1 a)) = (1 / 10 * centeredCoordinate (reflectedCoordinate s 0 (v 0))) * ∫ a in Icc (0 : ℝ) 1, centeredCoordinate (reflectedCoordinate s 1 a) by rw [integral_const_mul]] rw [centeredCoordinate_reflected_integral] ring norm_num · exact integrableOn_const (ne_of_lt measure_Icc_lt_top) · have hc : Continuous (fun z : ℝ => 1 / 10 * centeredCoordinate (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (reflectedCoordinate s 1 z)) := by rcases s.signed 1 with hs | hs · simp only [centeredCoordinate, reflectedCoordinate, reflect, hs, if_neg (by norm_num : (-1 : ℝ) ≠ 1)] fun_prop · simp only [centeredCoordinate, reflectedCoordinate, reflect, hs] simp only [if_true] fun_prop exact hc.integrableOn_Icc · simp [sparseP, hi]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseP_normalized · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:240
theorem cancellationP_normalized

Every cancellation observational conditional is normalized in its own coordinate. the stated conclusion follows.

Formal statement
s :
i :
Fin 3
v :
∫ z in Icc (0 : ℝ) 1, cancellationP s i (update v i z) = 1
Proof (Lean source)
lemma cancellationP_normalized (s : SignVector 3) (i : Fin 3) (v : LatentState 3) : ∫ z in Icc (0 : ℝ) 1, cancellationP s i (update v i z) = 1 := by by_cases hi : i = 1 · subst i simp only [cancellationP, if_true, Function.update_self] simp only [update, dif_neg (by decide : ¬(0 : Fin 3) = 1)] rw [integral_add] · simp only [integral_const, Measure.restrict_apply_univ, Measure.real, measureReal_def, Real.volume_Icc, sub_zero, ENNReal.toReal_one, one_smul] rw [show (∫ a in Icc (0 : ℝ) 1, (1 / 10 * cancellationPrimitive (reflectedCoordinate s 0 (v 0))) * centeredCoordinate (reflectedCoordinate s 1 a)) = (1 / 10 * cancellationPrimitive (reflectedCoordinate s 0 (v 0))) * ∫ a in Icc (0 : ℝ) 1, centeredCoordinate (reflectedCoordinate s 1 a) by rw [integral_const_mul]] rw [centeredCoordinate_reflected_integral] ring norm_num · exact integrableOn_const (ne_of_lt measure_Icc_lt_top) · have hc : Continuous (fun z : ℝ => 1 / 10 * cancellationPrimitive (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (reflectedCoordinate s 1 z)) := by rcases s.signed 1 with hs | hs · simp only [centeredCoordinate, reflectedCoordinate, reflect, hs, if_neg (by norm_num : (-1 : ℝ) ≠ 1)] fun_prop · simp only [centeredCoordinate, reflectedCoordinate, reflect, hs] simp only [if_true] fun_prop exact hc.integrableOn_Icc · simp [cancellationP, hi]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellationP_normalized · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:276
theorem cancellationPrimitive_zero

The cancellation primitive vanishes at both endpoints of the unit interval.

Formal statement
conclusion 1
conclusion 2
Proof (Lean source)
lemma cancellationPrimitive_zero : cancellationPrimitive 0 = 0 ∧ cancellationPrimitive 1 = 0 := by constructor · simp [cancellationPrimitive] · unfold cancellationPrimitive have h : exp 4 - 1 ≠ 0 := by have : 1 < exp 4 := Real.one_lt_exp_iff.mpr (by norm_num) linarith field_simp norm_num
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellationPrimitive_zero · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:311
theorem cancellationPrimitive_deriv

The derivative of the cancellation primitive is the intervention density minus one.

Formal statement
x :
Proof (Lean source)
lemma cancellationPrimitive_deriv (x : ℝ) : deriv cancellationPrimitive x = exponentialInterventionDensity x - 1 := by change deriv (fun y : ℝ => (exp (4 * y) - 1) / (exp 4 - 1) - y) x = exponentialInterventionDensity x - 1 have hexp : HasDerivAt (fun y : ℝ => exp (4 * y)) (4 * exp (4 * x)) x := by simpa [Function.comp_def, mul_comm] using (Real.hasDerivAt_exp (4 * x)).comp x (hasDerivAt_const_mul (x := x) 4) have hF : HasDerivAt (fun y : ℝ => (exp (4 * y) - 1) / (exp 4 - 1)) (exponentialInterventionDensity x) x := by simpa [exponentialInterventionDensity] using (hexp.sub_const 1).div_const (exp 4 - 1) exact (hF.sub (hasDerivAt_id x)).deriv
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellationPrimitive_deriv · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:323
theorem cancellationPrimitive_nonconstant Lemma cancellationPrimitive_nonconstant in the paper ↗

The cancellation primitive genuinely varies, as witnessed by its nonzero derivative at zero. the stated conclusion follows.

Formal statement
Proof (Lean source)
lemma cancellationPrimitive_nonconstant : ∃ x, cancellationPrimitive x ≠ cancellationPrimitive 0 := by by_contra hconst push Not at hconst have hd0 : deriv cancellationPrimitive 0 = 0 := by rw [show cancellationPrimitive = fun _ => cancellationPrimitive 0 by funext x exact hconst x] simp rw [cancellationPrimitive_deriv] at hd0 have hexp : 5 < exp 4 := by nlinarith [Real.add_one_lt_exp (by norm_num : (4 : ℝ) ≠ 0)] have hden : 0 < exp 4 - 1 := by linarith have hq0 : exponentialInterventionDensity 0 < 1 := by simp only [exponentialInterventionDensity, mul_zero, Real.exp_zero] apply (div_lt_one hden).2 linarith linarith
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellationPrimitive_nonconstant · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:340
theorem cancellationPrimitive_mem_unitInterval_sub Lemma cancellationPrimitive_mem_unitInterval_sub in the paper ↗

On the unit interval the cancellation primitive lies between minus one and one. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
x :
hx :
x ∈ Icc (0 : ℝ) 1
cancellationPrimitive x ∈ Icc (-1 : ℝ) 1
Proof (Lean source)
lemma cancellationPrimitive_mem_unitInterval_sub {x : ℝ} (hx : x ∈ Icc (0 : ℝ) 1) : cancellationPrimitive x ∈ Icc (-1 : ℝ) 1 := by have hden : 0 < exp 4 - 1 := by have h := Real.one_lt_exp_iff.mpr (by norm_num : (0 : ℝ) < 4) linarith have hexp0 : 1 ≤ exp (4 * x) := by simpa using Real.one_le_exp (by nlinarith [hx.1] : 0 ≤ 4 * x) have hexp4 : exp (4 * x) ≤ exp 4 := by apply Real.exp_le_exp.mpr nlinarith [hx.2] have hfrac0 : 0 ≤ (exp (4 * x) - 1) / (exp 4 - 1) := div_nonneg (by linarith) hden.le have hfrac1 : (exp (4 * x) - 1) / (exp 4 - 1) ≤ 1 := by apply (div_le_one hden).2 linarith unfold cancellationPrimitive constructor <;> linarith [hx.1, hx.2]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellationPrimitive_mem_unitInterval_sub · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:361
theorem reflectedCoordinate_mem_unitInterval

A prescribed coordinate reflection preserves the closed unit interval. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
s :
i :
Fin n
z :
hz :
z ∈ Icc (0 : ℝ) 1
reflectedCoordinate s i z ∈ Icc (0 : ℝ) 1
Proof (Lean source)
-- @node: reflectedCoordinate_mem_unitInterval lemma reflectedCoordinate_mem_unitInterval {n : ℕ} (s : SignVector n) (i : Fin n) {z : ℝ} (hz : z ∈ Icc (0 : ℝ) 1) : reflectedCoordinate s i z ∈ Icc (0 : ℝ) 1 := by rcases s.signed i with hi | hi · simp only [reflectedCoordinate, reflect, hi, if_neg (by norm_num : (-1 : ℝ) ≠ 1)] constructor <;> linarith [hz.1, hz.2] · rw [reflectedCoordinate, reflect, hi, if_pos rfl] exact hz
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.reflectedCoordinate_mem_unitInterval · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:379
theorem abs_centeredCoordinate_le_one Lemma abs_centeredCoordinate_le_one in the paper ↗

The centered coordinate has absolute value at most one on the unit interval. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
z :
hz :
z ∈ Icc (0 : ℝ) 1
Proof (Lean source)
-- @node: abs_centeredCoordinate_le_one lemma abs_centeredCoordinate_le_one {z : ℝ} (hz : z ∈ Icc (0 : ℝ) 1) : |centeredCoordinate z| ≤ 1 := by rw [abs_le] constructor <;> simp only [centeredCoordinate] <;> linarith [hz.1, hz.2]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.abs_centeredCoordinate_le_one · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:390
theorem embeddedSparseP_bounds

The embedded sparse conditional stays uniformly between 9/10 and 11/10 on the latent cube. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
j i :
Fin n
hji :
G.edge j i
l :
Fin n
v :
hv :
v ∈ latentCube n
conclusion 1
(9 / 10 : ℝ) ≤ embeddedSparseP s j i l v
conclusion 2
embeddedSparseP s j i l v ≤ (11 / 10 : ℝ)
Proof (Lean source)
lemma embeddedSparseP_bounds {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) {j i : Fin n} (hji : G.edge j i) (l : Fin n) (v : LatentState n) (hv : v ∈ latentCube n) : (9 / 10 : ℝ) ≤ embeddedSparseP s j i l v ∧ embeddedSparseP s j i l v ≤ (11 / 10 : ℝ) := by by_cases hli : l = i · subst l have hj : v j ∈ Icc (0 : ℝ) 1 := hv j (Set.mem_univ j) have hi : v i ∈ Icc (0 : ℝ) 1 := hv i (Set.mem_univ i) have hbj := abs_centeredCoordinate_le_one (reflectedCoordinate_mem_unitInterval s j hj) have hbi := abs_centeredCoordinate_le_one (reflectedCoordinate_mem_unitInterval s i hi) rw [abs_le] at hbj hbi simp only [embeddedSparseP, if_true] constructor <;> nlinarith · simp [embeddedSparseP, hli] norm_num
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.embeddedSparseP_bounds · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:397
theorem embeddedSparseP_normalized

Every embedded sparse observational conditional is normalized in its own coordinate. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
j i :
Fin n
hji :
G.edge j i
l :
Fin n
v :
∫ z in Icc (0 : ℝ) 1, embeddedSparseP s j i l (update v l z) = 1
Proof (Lean source)
lemma embeddedSparseP_normalized {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) {j i : Fin n} (hji : G.edge j i) (l : Fin n) (v : LatentState n) : ∫ z in Icc (0 : ℝ) 1, embeddedSparseP s j i l (update v l z) = 1 := by by_cases hli : l = i · subst l have hji_ne : j ≠ i := by intro h subst j exact G.irrefl i hji simp only [embeddedSparseP, if_true, Function.update_self] simp only [update, dif_neg hji_ne] rw [integral_add] · simp only [integral_const, Measure.restrict_apply_univ, Measure.real, measureReal_def, Real.volume_Icc, sub_zero, ENNReal.toReal_one, one_smul] rw [show (∫ a in Icc (0 : ℝ) 1, (1 / 10 * centeredCoordinate (reflectedCoordinate s j (v j))) * centeredCoordinate (reflectedCoordinate s i a)) = (1 / 10 * centeredCoordinate (reflectedCoordinate s j (v j))) * ∫ a in Icc (0 : ℝ) 1, centeredCoordinate (reflectedCoordinate s i a) by rw [integral_const_mul]] rw [integral_reflectedCoordinate, centeredCoordinate_integral] ring norm_num · exact integrableOn_const (ne_of_lt measure_Icc_lt_top) · have hc : Continuous (fun z : ℝ => 1 / 10 * centeredCoordinate (reflectedCoordinate s j (v j)) * centeredCoordinate (reflectedCoordinate s i z)) := by rcases s.signed i with hs | hs · simp only [centeredCoordinate, reflectedCoordinate, reflect, hs, if_neg (by norm_num : (-1 : ℝ) ≠ 1)] fun_prop · simp only [centeredCoordinate, reflectedCoordinate, reflect, hs, if_true] fun_prop exact hc.integrableOn_Icc · simp [embeddedSparseP, hli]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.embeddedSparseP_normalized · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:418
theorem embeddedSparseWitness_positive_normalized_smooth

The edge-specific sparse endpoint is positive, normalized, and smooth on every finite DAG, including DAGs with additional unused parents and edges. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
j i :
Fin n
hji :
G.edge j i
Proof (Lean source)
lemma embeddedSparseWitness_positive_normalized_smooth {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) {j i : Fin n} (hji : G.edge j i) : PositiveNormalizedSmoothMechanisms G (embeddedSparseWitness s hji) := by refine ⟨?_, ?_, ?_, ?_, ?_, ?_⟩ · intro l v hv exact lt_of_lt_of_le (by norm_num : (0 : ℝ) < 9 / 10) (embeddedSparseP_bounds s hji l v hv).1 · intro l z hz change 0 < exponentialInterventionDensity (reflectedCoordinate s l z) unfold exponentialInterventionDensity have hden : 0 < exp 4 - 1 := by have := Real.one_lt_exp_iff.mpr (by norm_num : (0 : ℝ) < 4) linarith positivity · intro l change ContDiffOn ℝ 3 (embeddedSparseP s j i l) (latentCube n) by_cases hli : l = i · subst l rw [show embeddedSparseP s j i i = fun v : LatentState n => 1 + (1 / 10 : ℝ) * centeredCoordinate (reflectedCoordinate s j (v j)) * centeredCoordinate (reflectedCoordinate s i (v i)) by funext v simp [embeddedSparseP]] rcases s.signed j with hj | hj <;> rcases s.signed i with hi | hi <;> simp [reflectedCoordinate, reflect, hj, hi, centeredCoordinate, show (-1 : ℝ) ≠ 1 by norm_num] <;> fun_prop · rw [show embeddedSparseP s j i l = fun _ => (1 : ℝ) by funext v simp [embeddedSparseP, hli]] fun_prop · intro l change ContDiffOn ℝ 3 (fun z : ℝ => exponentialInterventionDensity (reflectedCoordinate s l z)) (Icc 0 1) unfold exponentialInterventionDensity rcases s.signed l with hl | hl · simp [reflectedCoordinate, reflect, hl, show (-1 : ℝ) ≠ 1 by norm_num] fun_prop · simp [reflectedCoordinate, reflect, hl] fun_prop · intro l v hv exact embeddedSparseP_normalized s hji l v · intro l change ∫ z in Icc (0 : ℝ) 1, exponentialInterventionDensity (reflectedCoordinate s l z) = 1 rw [integral_reflectedCoordinate] exact exponentialInterventionDensity_integral
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.embeddedSparseWitness_positive_normalized_smooth · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:458
theorem exponentialInterventionDensity_pos Lemma exponentialInterventionDensity_pos in the paper ↗

The normalized exponential intervention density is strictly positive. the stated conclusion follows.

Formal statement
z :
Proof (Lean source)
-- @node: exponentialInterventionDensity_pos lemma exponentialInterventionDensity_pos (z : ℝ) : 0 < exponentialInterventionDensity z := by unfold exponentialInterventionDensity have hden : 0 < exp 4 - 1 := by have := Real.one_lt_exp_iff.mpr (by norm_num : (0 : ℝ) < 4) linarith positivity
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.exponentialInterventionDensity_pos · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:508
theorem thirteen_lt_exp_four

A rational lower bound on the exponential normalizing constant used by the quantitative sparse certificate. the stated conclusion follows.

Formal statement
(13 : ℝ) < exp 4
Proof (Lean source)
lemma thirteen_lt_exp_four : (13 : ℝ) < exp 4 := by have h := Real.sum_le_exp_of_nonneg (x := (4 : ℝ)) (by norm_num) 4 norm_num [Finset.sum_range_succ] at h ⊢ linarith
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.thirteen_lt_exp_four · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:518
theorem exponentialInterventionDensity_lt_thirteen_div_three

On the unit interval the intervention density is strictly below 13/3. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
z :
hz :
z ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma exponentialInterventionDensity_lt_thirteen_div_three {z : ℝ} (hz : z ∈ Icc (0 : ℝ) 1) : exponentialInterventionDensity z < (13 / 3 : ℝ) := by have hden : 0 < exp 4 - 1 := by linarith [thirteen_lt_exp_four] have he : exp (4 * z) ≤ exp 4 := by exact Real.exp_le_exp.mpr (by nlinarith [hz.2]) unfold exponentialInterventionDensity calc 4 * exp (4 * z) / (exp 4 - 1) ≤ 4 * exp 4 / (exp 4 - 1) := div_le_div_of_nonneg_right (by nlinarith) hden.le _ < 13 / 3 := (div_lt_iff₀ hden).2 (by nlinarith [thirteen_lt_exp_four])
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.exponentialInterventionDensity_lt_thirteen_div_three · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:525
theorem sparseP_pos

Every sparse observational mechanism is strictly positive on the latent cube. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
s :
i :
Fin 3
v :
hv :
v ∈ latentCube 3
0 < sparseP s i v
Proof (Lean source)
-- @node: sparseP_pos lemma sparseP_pos (s : SignVector 3) (i : Fin 3) (v : LatentState 3) (hv : v ∈ latentCube 3) : 0 < sparseP s i v := by by_cases hi : i = 1 · subst i have hv0 : v 0 ∈ Icc (0 : ℝ) 1 := hv 0 (Set.mem_univ 0) have hv1 : v 1 ∈ Icc (0 : ℝ) 1 := hv 1 (Set.mem_univ 1) have h0 := abs_centeredCoordinate_le_one (reflectedCoordinate_mem_unitInterval s 0 hv0) have h1 := abs_centeredCoordinate_le_one (reflectedCoordinate_mem_unitInterval s 1 hv1) have hprod : -1 ≤ centeredCoordinate (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (reflectedCoordinate s 1 (v 1)) := by rw [abs_le] at h0 h1 nlinarith simp only [sparseP, if_true] nlinarith · simp [sparseP, hi]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseP_pos · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:539
theorem sparseWitness_positive_normalized_smooth

The sparse witness is positive, normalized, and on every mechanism domain. the stated conclusion follows.

Formal statement
Proof (Lean source)
-- @node: sparseWitness_positive_normalized_smooth lemma sparseWitness_positive_normalized_smooth (s : SignVector 3) : PositiveNormalizedSmoothMechanisms threeNodeDAG (sparseWitness s) := by refine ⟨?_, ?_, ?_, ?_, ?_, ?_⟩ · intro i v hv exact sparseP_pos s i v hv · intro i z hz exact exponentialInterventionDensity_pos _ · intro i by_cases hi : i = 1 · subst i change ContDiffOn ℝ 3 (fun v : LatentState 3 => 1 + (1 / 10 : ℝ) * centeredCoordinate (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (reflectedCoordinate s 1 (v 1))) (latentCube 3) rcases s.signed 0 with h0 | h0 <;> rcases s.signed 1 with h1 | h1 <;> simp [reflectedCoordinate, reflect, h0, h1, centeredCoordinate, show (-1 : ℝ) ≠ 1 by norm_num] <;> fun_prop · change ContDiffOn ℝ 3 (sparseP s i) (latentCube 3) rw [show sparseP s i = fun _ => (1 : ℝ) by funext v simp [sparseP, hi]] fun_prop · intro i change ContDiffOn ℝ 3 (fun z : ℝ => exponentialInterventionDensity (reflectedCoordinate s i z)) (Icc 0 1) unfold exponentialInterventionDensity rcases s.signed i with hi | hi · simp [reflectedCoordinate, reflect, hi, show (-1 : ℝ) ≠ 1 by norm_num] fun_prop · simp [reflectedCoordinate, reflect, hi] fun_prop · intro i v hv exact sparseP_normalized s i v · intro i exact sparseQ_normalized s i
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseWitness_positive_normalized_smooth · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:559
theorem cancellationP_pos

Every cancellation observational mechanism is strictly positive on the latent cube. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
s :
i :
Fin 3
v :
hv :
v ∈ latentCube 3
0 < cancellationP s i v
Proof (Lean source)
lemma cancellationP_pos (s : SignVector 3) (i : Fin 3) (v : LatentState 3) (hv : v ∈ latentCube 3) : 0 < cancellationP s i v := by by_cases hi : i = 1 · subst i have hv0 : v 0 ∈ Icc (0 : ℝ) 1 := hv 0 (Set.mem_univ 0) have hv1 : v 1 ∈ Icc (0 : ℝ) 1 := hv 1 (Set.mem_univ 1) have h0 := cancellationPrimitive_mem_unitInterval_sub (reflectedCoordinate_mem_unitInterval s 0 hv0) have h1 := abs_centeredCoordinate_le_one (reflectedCoordinate_mem_unitInterval s 1 hv1) rw [abs_le] at h1 simp only [cancellationP, if_true] nlinarith [h0.1, h0.2] · simp [cancellationP, hi]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellationP_pos · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:597
theorem cancellationWitness_positive_normalized_smooth

The cancellation witness is positive, normalized, and on every mechanism domain. the stated conclusion follows.

Formal statement
Proof (Lean source)
lemma cancellationWitness_positive_normalized_smooth (s : SignVector 3) : PositiveNormalizedSmoothMechanisms threeNodeDAG (cancellationWitness s) := by refine ⟨?_, ?_, ?_, ?_, ?_, ?_⟩ · intro i v hv exact cancellationP_pos s i v hv · intro i z hz exact exponentialInterventionDensity_pos _ · intro i by_cases hi : i = 1 · subst i change ContDiffOn ℝ 3 (fun v : LatentState 3 => 1 + (1 / 10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (reflectedCoordinate s 1 (v 1))) (latentCube 3) rcases s.signed 0 with h0 | h0 <;> rcases s.signed 1 with h1 | h1 <;> simp [cancellationPrimitive, reflectedCoordinate, reflect, h0, h1, centeredCoordinate, show (-1 : ℝ) ≠ 1 by norm_num] <;> fun_prop · change ContDiffOn ℝ 3 (cancellationP s i) (latentCube 3) rw [show cancellationP s i = fun _ => (1 : ℝ) by funext v simp [cancellationP, hi]] fun_prop · intro i change ContDiffOn ℝ 3 (fun z : ℝ => exponentialInterventionDensity (reflectedCoordinate s i z)) (Icc 0 1) unfold exponentialInterventionDensity rcases s.signed i with hi | hi · simp [reflectedCoordinate, reflect, hi, show (-1 : ℝ) ≠ 1 by norm_num] fun_prop · simp [reflectedCoordinate, reflect, hi] fun_prop · intro i v hv exact cancellationP_normalized s i v · intro i exact sparseQ_normalized s i
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellationWitness_positive_normalized_smooth · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:614
theorem sparseWitness_contDiff_all

Every sparse-witness mechanism component is smooth to every finite order. the stated conclusion follows.

Formal statement
s :
conclusion 1
k i :
ContDiffOn ℝ k ((sparseWitness s).p i) (latentCube 3)
conclusion 2
k i :
ContDiffOn ℝ k ((sparseWitness s).q i) (Icc (0 : ℝ) 1)
Proof (Lean source)
lemma sparseWitness_contDiff_all (s : SignVector 3) : (∀ k i, ContDiffOn ℝ k ((sparseWitness s).p i) (latentCube 3)) ∧ ∀ k i, ContDiffOn ℝ k ((sparseWitness s).q i) (Icc (0 : ℝ) 1) := by constructor · intro k i by_cases hi : i = 1 · subst i change ContDiffOn ℝ k (fun v : LatentState 3 => 1 + (1 / 10 : ℝ) * centeredCoordinate (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (reflectedCoordinate s 1 (v 1))) (latentCube 3) rcases s.signed 0 with h0 | h0 <;> rcases s.signed 1 with h1 | h1 <;> simp [reflectedCoordinate, reflect, h0, h1, centeredCoordinate, show (-1 : ℝ) ≠ 1 by norm_num] <;> fun_prop · change ContDiffOn ℝ k (sparseP s i) (latentCube 3) rw [show sparseP s i = fun _ => (1 : ℝ) by funext v simp [sparseP, hi]] fun_prop · intro k i change ContDiffOn ℝ k (fun z : ℝ => exponentialInterventionDensity (reflectedCoordinate s i z)) (Icc 0 1) unfold exponentialInterventionDensity rcases s.signed i with hi | hi · simp [reflectedCoordinate, reflect, hi, show (-1 : ℝ) ≠ 1 by norm_num] fun_prop · simp [reflectedCoordinate, reflect, hi] fun_prop
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparseWitness_contDiff_all · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:651
theorem cancellationWitness_contDiff_all

Every cancellation-witness mechanism component is smooth to every finite order. the stated conclusion follows.

Formal statement
s :
conclusion 1
k i :
conclusion 2
k i :
ContDiffOn ℝ k ((cancellationWitness s).q i) (Icc (0 : ℝ) 1)
Proof (Lean source)
lemma cancellationWitness_contDiff_all (s : SignVector 3) : (∀ k i, ContDiffOn ℝ k ((cancellationWitness s).p i) (latentCube 3)) ∧ ∀ k i, ContDiffOn ℝ k ((cancellationWitness s).q i) (Icc (0 : ℝ) 1) := by constructor · intro k i by_cases hi : i = 1 · subst i change ContDiffOn ℝ k (fun v : LatentState 3 => 1 + (1 / 10 : ℝ) * cancellationPrimitive (reflectedCoordinate s 0 (v 0)) * centeredCoordinate (reflectedCoordinate s 1 (v 1))) (latentCube 3) rcases s.signed 0 with h0 | h0 <;> rcases s.signed 1 with h1 | h1 <;> simp [cancellationPrimitive, reflectedCoordinate, reflect, h0, h1, centeredCoordinate, show (-1 : ℝ) ≠ 1 by norm_num] <;> fun_prop · change ContDiffOn ℝ k (cancellationP s i) (latentCube 3) rw [show cancellationP s i = fun _ => (1 : ℝ) by funext v simp [cancellationP, hi]] fun_prop · intro k i change ContDiffOn ℝ k (fun z : ℝ => exponentialInterventionDensity (reflectedCoordinate s i z)) (Icc 0 1) unfold exponentialInterventionDensity rcases s.signed i with hi | hi · simp [reflectedCoordinate, reflect, hi, show (-1 : ℝ) ≠ 1 by norm_num] fun_prop · simp [reflectedCoordinate, reflect, hi] fun_prop
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.cancellationWitness_contDiff_all · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/Helpers/Witnesses.lean:681
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.TExactRatioDecoder 11 declarations This file states the population transitive-closure, continuous conditional-rank, parent-pruning, ordering-independence, and representation-uniqueness conclusions.

Exact ratio decoder

This file states the population transitive-closure, continuous conditional-rank, parent-pruning, ordering-independence, and representation-uniqueness conclusions. Faithfulness is confined to a separate overlap corollary.

def ComponentwiseC2Equivalent Definition 22 in the paper ↗

The componentwise ambiguity relating two compatible representations.

Definition (Lean source)
n :
DAG (Fin n)
Mechanism n G₁
Mechanism n G₂
W₁ :
ObservedWorld G₁ θ₁
W₂ :
ObservedWorld G₂ θ₂
ComponentwiseC2Equivalent W₁ W₂ :
Prop
clause 1
observedSupport G₁ W₁ = observedSupport G₂ W₂
clause 2
∃ σ : Perm (Fin n),
j i :
G₂.edge (σ j) (σ i) ↔ G₁.edge j i
e :
W₂.targetPerm e = σ (W₁.targetPerm e)
∃ h hinv : Fin n → ℝ → ℝ,
i :
ContDiffOn ℝ 2 (h i) (Icc (0 : ℝ) 1)
i :
ContDiffOn ℝ 2 (hinv i) (Icc (0 : ℝ) 1)
i :
Set.MapsTo (h i) (Icc (0 : ℝ) 1) (Icc (0 : ℝ) 1)
i :
Set.MapsTo (hinv i) (Icc (0 : ℝ) 1) (Icc (0 : ℝ) 1)
i z :
z ∈ Icc (0 : ℝ) 1
hinv i (h i z) = z
i z :
z ∈ Icc (0 : ℝ) 1
h i (hinv i z) = z
x ∈ observedSupport G₁ W₁ :
i :
W₂.unmix x (σ i) = h i (W₁.unmix x i)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.ComponentwiseC2Equivalent · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TExactRatioDecoder.lean:35
theorem componentwiseC2Equivalent_of_common_rank_and_aligned_edges

Common law-selected scalar ranks and aligned edges assemble the componentwise equivalence, including explicit inverse charts on the closed latent interval. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
Mechanism n G₁
Mechanism n G₂
W₁ :
ObservedWorld G₁ θ₁
W₂ :
ObservedWorld G₂ θ₂
hpos₁ :
hmix₁ :
hpos₂ :
hmix₂ :
order :
Fin n → ℕ
hrank₁ :
∀ e v
if
v ∈ latentCube n
then
(observedLawRankCoordinate laws order e (W₁.mix v) : ℝ)
= signedInterventionCDF s θ₁ (W₁.targetPerm e) (v (W₁.targetPerm e))
hrank₂ :
∀ e v
if
v ∈ latentCube n
then
(observedLawRankCoordinate laws order e (W₂.mix v) : ℝ)
= signedInterventionCDF s θ₂ (W₂.targetPerm e) (v (W₂.targetPerm e))
hsupport :
observedSupport G₁ W₁ = observedSupport G₂ W₂
hedge :
∀ j i,
G₂.edge ((W₁.targetPerm.symm.trans W₂.targetPerm) j) ((W₁.targetPerm.symm.trans W₂.targetPerm) i)
↔ G₁.edge j i
Proof (Lean source)
lemma componentwiseC2Equivalent_of_common_rank_and_aligned_edges {n : ℕ} {G₁ G₂ : DAG (Fin n)} {s : SignVector n} {θ₁ : Mechanism n G₁} {θ₂ : Mechanism n G₂} (W₁ : ObservedWorld G₁ θ₁) (W₂ : ObservedWorld G₂ θ₂) (hpos₁ : PositiveNormalizedSmoothMechanisms G₁ θ₁) (hmix₁ : SharedDiffeomorphicMixing G₁ θ₁ W₁) (hpos₂ : PositiveNormalizedSmoothMechanisms G₂ θ₂) (hmix₂ : SharedDiffeomorphicMixing G₂ θ₂ W₂) (laws : ObservedProbabilityLawFamily n) (order : Fin n → ℕ) (hrank₁ : ∀ e v, v ∈ latentCube n → (observedLawRankCoordinate laws order e (W₁.mix v) : ℝ) = signedInterventionCDF s θ₁ (W₁.targetPerm e) (v (W₁.targetPerm e))) (hrank₂ : ∀ e v, v ∈ latentCube n → (observedLawRankCoordinate laws order e (W₂.mix v) : ℝ) = signedInterventionCDF s θ₂ (W₂.targetPerm e) (v (W₂.targetPerm e))) (hsupport : observedSupport G₁ W₁ = observedSupport G₂ W₂) (hedge : ∀ j i, G₂.edge ((W₁.targetPerm.symm.trans W₂.targetPerm) j) ((W₁.targetPerm.symm.trans W₂.targetPerm) i) ↔ G₁.edge j i) : ComponentwiseC2Equivalent W₁ W₂ := by let σ : Perm (Fin n) := W₁.targetPerm.symm.trans W₂.targetPerm let base : LatentState n := 0 let h : Fin n → ℝ → ℝ := fun i z => W₂.unmix (W₁.mix (update base i z)) (σ i) let hinv : Fin n → ℝ → ℝ := fun i z => W₁.unmix (W₂.mix (update base (σ i) z)) i have hbase (i : Fin n) (z : ℝ) (hz : z ∈ Icc (0 : ℝ) 1) : update base i z ∈ latentCube n := by intro k hk by_cases hki : k = i · subst k; simpa [update] · simp [base, update, hki] have hsigma (i : Fin n) : σ i = W₂.targetPerm (W₁.targetPerm.symm i) := rfl have hmaps (i : Fin n) : Set.MapsTo (h i) (Icc (0 : ℝ) 1) (Icc 0 1) := by intro z hz have hy₁ : W₁.mix (update base i z) ∈ observedSupport G₁ W₁ := ⟨_, hbase i z hz, rfl⟩ have hy₂ : W₁.mix (update base i z) ∈ observedSupport G₂ W₂ := by rw [← hsupport]; exact hy₁ rcases hy₂ with ⟨v, hv, heq⟩ dsimp only [h] rw [← heq, hmix₂.2.2.1 v hv] exact hv (σ i) (Set.mem_univ _) have hinvmaps (i : Fin n) : Set.MapsTo (hinv i) (Icc (0 : ℝ) 1) (Icc 0 1) := by intro z hz have hy₂ : W₂.mix (update base (σ i) z) ∈ observedSupport G₂ W₂ := ⟨_, hbase (σ i) z hz, rfl⟩ have hy₁ : W₂.mix (update base (σ i) z) ∈ observedSupport G₁ W₁ := by rw [hsupport]; exact hy₂ rcases hy₁ with ⟨v, hv, heq⟩ dsimp only [hinv] rw [← heq, hmix₁.2.2.1 v hv] exact hv i (Set.mem_univ _) have hdepend : ∀ x ∈ observedSupport G₁ W₁, ∀ i, W₂.unmix x (σ i) = h i (W₁.unmix x i) := by intro x hx i have hx₂ : x ∈ observedSupport G₂ W₂ := by rw [← hsupport]; exact hx let y := W₁.mix (update base i (W₁.unmix x i)) have hxi : W₁.unmix x i ∈ Icc (0 : ℝ) 1 := by rcases hx with ⟨v, hv, rfl⟩ simpa only [hmix₁.2.2.1 v hv] using hv i (Set.mem_univ _) have hy₁ : y ∈ observedSupport G₁ W₁ := ⟨_, hbase i _ hxi, rfl⟩ have hy₂ : y ∈ observedSupport G₂ W₂ := by rw [← hsupport]; exact hy₁ have hcoord : W₁.unmix x (W₁.targetPerm (W₁.targetPerm.symm i)) = W₁.unmix y (W₁.targetPerm (W₁.targetPerm.symm i)) := by simp only [W₁.targetPerm.apply_symm_apply] rw [show W₁.unmix y = update base i (W₁.unmix x i) by exact hmix₁.2.2.1 _ (hbase i _ hxi)] simp have hc := alignedCoordinate_eq_of_common_rank W₁ W₂ hmix₁ hpos₂ hmix₂ laws order hrank₁ hrank₂ x y hx hx₂ hy₁ hy₂ (W₁.targetPerm.symm i) hcoord simpa only [W₁.targetPerm.apply_symm_apply, hsigma, h] using hc refine ⟨hsupport, σ, hedge, ?_, h, hinv, ?_, ?_, hmaps, hinvmaps, ?_, ?_, hdepend⟩ · intro e simp [σ] · intro i have hup : ContDiffOn ℝ 2 (update base i) (Icc (0 : ℝ) 1) := (contDiff_update 2 base i).contDiffOn have hf : ContDiffOn ℝ 2 (W₁.mix ∘ update base i) (Icc 0 1) := hmix₁.1.comp hup (hbase i) have hfmap : Set.MapsTo (W₁.mix ∘ update base i) (Icc (0 : ℝ) 1) (observedSupport G₂ W₂) := by intro z hz rw [← hsupport] exact ⟨_, hbase i z hz, rfl⟩ have hg : ContDiffOn ℝ 2 (W₂.unmix ∘ W₁.mix ∘ update base i) (Icc (0 : ℝ) 1) := by convert hmix₂.2.1.comp hf hfmap using 1 change ContDiffOn ℝ 2 ((fun v : LatentState n ↦ v (σ i)) ∘ (W₂.unmix ∘ W₁.mix ∘ update base i)) (Icc (0 : ℝ) 1) exact (contDiff_apply ℝ ℝ (σ i)).contDiffOn.comp hg (Set.mapsTo_univ _ _) · intro i have hup : ContDiffOn ℝ 2 (update base (σ i)) (Icc (0 : ℝ) 1) := (contDiff_update 2 base (σ i)).contDiffOn have hf : ContDiffOn ℝ 2 (W₂.mix ∘ update base (σ i)) (Icc 0 1) := hmix₂.1.comp hup (hbase (σ i)) have hfmap : Set.MapsTo (W₂.mix ∘ update base (σ i)) (Icc (0 : ℝ) 1) (observedSupport G₁ W₁) := by intro z hz rw [hsupport] exact ⟨_, hbase (σ i) z hz, rfl⟩ have hg : ContDiffOn ℝ 2 (W₁.unmix ∘ W₂.mix ∘ update base (σ i)) (Icc (0 : ℝ) 1) := by convert hmix₁.2.1.comp hf hfmap using 1 change ContDiffOn ℝ 2 ((fun v : LatentState n ↦ v i) ∘ (W₁.unmix ∘ W₂.mix ∘ update base (σ i))) (Icc (0 : ℝ) 1) exact (contDiff_apply ℝ ℝ i).contDiffOn.comp hg (Set.mapsTo_univ _ _) · intro i z hz let y₁ := W₁.mix (update base i z) let y₂ := W₂.mix (update base (σ i) (h i z)) have hy₁₁ : y₁ ∈ observedSupport G₁ W₁ := ⟨_, hbase i z hz, rfl⟩ have hy₁₂ : y₁ ∈ observedSupport G₂ W₂ := by rw [← hsupport]; exact hy₁₁ have hhmem := hmaps i hz have hy₂₂ : y₂ ∈ observedSupport G₂ W₂ := ⟨_, hbase (σ i) _ hhmem, rfl⟩ have hy₂₁ : y₂ ∈ observedSupport G₁ W₁ := by rw [hsupport]; exact hy₂₂ let e := W₂.targetPerm.symm (σ i) have he : e = W₁.targetPerm.symm i := by apply W₂.targetPerm.injective simp [e, hsigma] have hcoord : W₂.unmix y₁ (W₂.targetPerm e) = W₂.unmix y₂ (W₂.targetPerm e) := by rw [W₂.targetPerm.apply_symm_apply] rw [show W₂.unmix y₂ = update base (σ i) (h i z) by exact hmix₂.2.2.1 _ (hbase (σ i) _ hhmem)] simp only [Function.update_self] rfl have hc := alignedCoordinate_eq_of_common_rank W₂ W₁ hmix₂ hpos₁ hmix₁ laws order hrank₂ hrank₁ y₁ y₂ hy₁₂ hy₁₁ hy₂₂ hy₂₁ e hcoord rw [he, W₁.targetPerm.apply_symm_apply] at hc rw [show W₁.unmix y₁ = update base i z by exact hmix₁.2.2.1 _ (hbase i z hz)] at hc simpa only [Function.update_self, hinv, y₂] using hc.symm · intro i z hz let y₂ := W₂.mix (update base (σ i) z) let y₁ := W₁.mix (update base i (hinv i z)) have hy₂₂ : y₂ ∈ observedSupport G₂ W₂ := ⟨_, hbase (σ i) z hz, rfl⟩ have hy₂₁ : y₂ ∈ observedSupport G₁ W₁ := by rw [hsupport]; exact hy₂₂ have himem := hinvmaps i hz have hy₁₁ : y₁ ∈ observedSupport G₁ W₁ := ⟨_, hbase i _ himem, rfl⟩ have hy₁₂ : y₁ ∈ observedSupport G₂ W₂ := by rw [← hsupport]; exact hy₁₁ let e := W₁.targetPerm.symm i have hcoord : W₁.unmix y₂ (W₁.targetPerm e) = W₁.unmix y₁ (W₁.targetPerm e) := by rw [W₁.targetPerm.apply_symm_apply] rw [show W₁.unmix y₁ = update base i (hinv i z) by exact hmix₁.2.2.1 _ (hbase i _ himem)] simp only [Function.update_self] rfl have hc := alignedCoordinate_eq_of_common_rank W₁ W₂ hmix₁ hpos₂ hmix₂ laws order hrank₁ hrank₂ y₂ y₁ hy₂₁ hy₂₂ hy₁₁ hy₁₂ e hcoord have hsige : W₂.targetPerm e = σ i := by simp [e, σ] rw [hsige] at hc rw [show W₂.unmix y₂ = update base (σ i) z by exact hmix₂.2.2.1 _ (hbase (σ i) z hz)] at hc simpa only [Function.update_self, h, y₁] using hc.symm
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.componentwiseC2Equivalent_of_common_rank_and_aligned_edges · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TExactRatioDecoder.lean:55
theorem componentwiseC2Equivalent_of_common_exactPruning

Exact law-only pruning for two compatible causal-minimal representations first aligns their graphs; their common selected rank coordinates then assemble the componentwise ambiguity. No cover-separation condition is imposed on the competitor. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ₁ :
Mechanism n G₁
θ₂ :
Mechanism n G₂
W₁ :
ObservedWorld G₁ θ₁
W₂ :
ObservedWorld G₂ θ₂
hpos₁ :
hmix₁ :
hone₁ :
hsign₁ :
hpos₂ :
hmix₂ :
hone₂ :
hsign₂ :
hlaw :
W₂.law = W₁.law
Proof (Lean source)
lemma componentwiseC2Equivalent_of_common_exactPruning {n : ℕ} {G₁ G₂ : DAG (Fin n)} (s : SignVector n) {θ₁ : Mechanism n G₁} {θ₂ : Mechanism n G₂} (W₁ : ObservedWorld G₁ θ₁) (W₂ : ObservedWorld G₂ θ₂) (hpos₁ : PositiveNormalizedSmoothMechanisms G₁ θ₁) (hmix₁ : SharedDiffeomorphicMixing G₁ θ₁ W₁) (hone₁ : OnePerfectInterventionPerNode G₁ θ₁ W₁) (hsign₁ : FixedOwnDerivativeSign G₁ s θ₁) (hpos₂ : PositiveNormalizedSmoothMechanisms G₂ θ₂) (hmix₂ : SharedDiffeomorphicMixing G₂ θ₂ W₂) (hone₂ : OnePerfectInterventionPerNode G₂ θ₂ W₂) (hsign₂ : FixedOwnDerivativeSign G₂ s θ₂) (hlaw : W₂.law = W₁.law) (htc₁ : TransGen (observedLawRatioGraph gaussianFeatureMap W₁.law) = TransGen (permutedGraph G₁ W₁)) (hprune₁ : ∀ i, MinimalAdmissibleParentSet (observedProbabilityLawFamily W₁.law) (selectedTopologicalOrder (observedProbabilityLawFamily W₁.law)) i (environmentParentSet W₁ i) ∧ ∀ A, MinimalAdmissibleParentSet (observedProbabilityLawFamily W₁.law) (selectedTopologicalOrder (observedProbabilityLawFamily W₁.law)) i A → A = environmentParentSet W₁ i) (hprune₂ : ∀ i, MinimalAdmissibleParentSet (observedProbabilityLawFamily W₁.law) (selectedTopologicalOrder (observedProbabilityLawFamily W₁.law)) i (environmentParentSet W₂ i) ∧ ∀ A, MinimalAdmissibleParentSet (observedProbabilityLawFamily W₁.law) (selectedTopologicalOrder (observedProbabilityLawFamily W₁.law)) i A → A = environmentParentSet W₂ i) : ComponentwiseC2Equivalent W₁ W₂ := by let laws := observedProbabilityLawFamily W₁.law let order := selectedTopologicalOrder laws have hgraph₁ : (selectedParentDAG laws order).edge = permutedGraph G₁ W₁ := selectedParentDAG_eq_permutedGraph_of_exactPruning W₁ laws hprune₁ have hgraph₂ : (selectedParentDAG laws order).edge = permutedGraph G₂ W₂ := selectedParentDAG_eq_permutedGraph_of_exactPruning W₂ laws hprune₂ have hperm : permutedGraph G₁ W₁ = permutedGraph G₂ W₂ := hgraph₁.symm.trans hgraph₂ have htc₂ : TransGen (observedLawRatioGraph gaussianFeatureMap W₂.law) = TransGen (permutedGraph G₂ W₂) := by rw [hlaw, htc₁, hperm] have horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W₁.law) order := by exact selectedTopologicalOrder_valid_of_assumptions (s := s) W₁ hpos₁ hmix₁ hone₁ have horder₂ : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W₂.law) order := by simpa only [hlaw] using horder have hrank₁ : ∀ e v, v ∈ latentCube n → (observedLawRankCoordinate laws order e (W₁.mix v) : ℝ) = signedInterventionCDF s θ₁ (W₁.targetPerm e) (v (W₁.targetPerm e)) := by intro e v hv simpa only [laws, order, signedInterventionCDF] using (exactRatioDecoder_continuousRankClauses s W₁ hpos₁ hmix₁ hone₁ hsign₁ htc₁ order horder e).2.2.2.2 v hv have hrank₂ : ∀ e v, v ∈ latentCube n → (observedLawRankCoordinate laws order e (W₂.mix v) : ℝ) = signedInterventionCDF s θ₂ (W₂.targetPerm e) (v (W₂.targetPerm e)) := by intro e v hv simpa only [laws, order, hlaw, signedInterventionCDF] using (exactRatioDecoder_continuousRankClauses s W₂ hpos₂ hmix₂ hone₂ hsign₂ htc₂ order horder₂ e).2.2.2.2 v hv have hsupport := observedSupport_eq_of_observationalLaw_eq W₁ W₂ hpos₁ hmix₁ hone₁ hpos₂ hmix₂ hone₂ hlaw exact componentwiseC2Equivalent_of_common_rank_and_aligned_edges W₁ W₂ hpos₁ hmix₁ hpos₂ hmix₂ laws order hrank₁ hrank₂ hsupport (aligned_edge_iff_of_permutedGraph_eq W₁ W₂ hperm)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.componentwiseC2Equivalent_of_common_exactPruning · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TExactRatioDecoder.lean:216

On the faithful overlap with von Kügelgen et al. (2023), the present law-only decoder uses one unknown-target intervention per node, strictly fewer than the comparator's two interventions per node in arbitrary dimension, while retaining representation uniqueness.

Definition (Lean source)
n :
DAG (Fin n)
s :
θ :
W :
VonKugelgenTwoVersusOneComparison s θ W :
Prop
clause 1
= "von Kugelgen et al. (2023), Nonparametric Identifiability of Causal Representations from Unknown Interventions, Theorems 3.2 and 3.4 and Section 7 (vonKugelgenEtAl2023UnknownInterventions; https://papers.nips.cc/paper_files/paper/2023/file/97fe251c25b6f99a2a23b330a75b11d4-Paper-Conference.pdf): Theorem 3.2 is bivariate with one unknown-target perfect intervention per node and a continuous witness genericity condition; Theorem 3.4 uses two paired perfect interventions per node in arbitrary dimension; the one-intervention extension for n greater than two is stated as a conjecture."
clause 2
i :
Fin n
∃! e : Fin n, W.targetPerm e = i
(1 : ℕ) < 2
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.VonKugelgenTwoVersusOneComparison · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TExactRatioDecoder.lean:287

Explicit scope boundary for the comparison with von Kügelgen et al. (2023): the present result assumes positive densities on the compact latent cube and mixing. In positive dimension that cube is strictly smaller than the full Euclidean latent space, and derivative order two is not the comparator's order.

Definition (Lean source)
n :
DAG (Fin n)
θ :
W :
FullRnC1NoncoverageClause θ W :
Prop
clause 1
= "von Kugelgen et al. (2023), Nonparametric Identifiability of Causal Representations from Unknown Interventions, Theorems 3.2 and 3.4 and Section 7 (vonKugelgenEtAl2023UnknownInterventions; https://papers.nips.cc/paper_files/paper/2023/file/97fe251c25b6f99a2a23b330a75b11d4-Paper-Conference.pdf): Theorem 3.2 is bivariate with one unknown-target perfect intervention per node and a continuous witness genericity condition; Theorem 3.4 uses two paired perfect interventions per node in arbitrary dimension; the one-intervention extension for n greater than two is stated as a conjecture."
clause 4
n ≠ 0
clause 5
(2 : ℕ) ≠ 1
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.FullRnC1NoncoverageClause · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TExactRatioDecoder.lean:305

Relative to Wendong et al. (2023) and Yao et al. (2025), the graph, topological order, and environment-to-coordinate alignment are outputs computed from the observed laws, rather than supplied structural inputs.

Definition (Lean source)
n :
DAG (Fin n)
s :
θ :
W :
WendongYaoSuppliedStructureComparison s θ W :
Prop
= "Wendong et al. (2023), Causal Component Analysis, Definition 3.2, Theorem 4.2, and Appendix E.2 (WendongEtAl2023CauCA; https://papers.nips.cc/paper_files/paper/2023/file/67089958e98b243d5cc1881ad60418b8-Paper-Conference.pdf): the graph G is assumed known, intervention targets are observed and fixed across candidate models, and one perfect stochastic intervention per node, each satisfying Assumption 4.1, gives identification up to componentwise scaling."
= "Yao et al. (2025), Unifying Causal Representation Learning with the Invariance Principle, Assumption D.1, Corollary D.1, and the immediately following remark (YaoEtAl2025InvariancePrinciple; arXiv:2409.02772v2; https://arxiv.org/abs/2409.02772v2): exactly one imperfect intervention is supplied per node, the target labels preserve a supplied topological order, componentwise identification follows from marginal and score invariances, and identifying the order is explicitly treated as a separate subproblem."
i v :
v ∈ latentCube n
(observedLawRankCoordinate laws (selectedTopologicalOrder laws) i (W.mix v) : ℝ)
= if s.value (W.targetPerm i) = 1 then interventionCDF θ (W.targetPerm i) (v (W.targetPerm i)) else 1
- interventionCDF θ (W.targetPerm i) (v (W.targetPerm i))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.WendongYaoSuppliedStructureComparison · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TExactRatioDecoder.lean:319

Formal scope/comparison payload: the frozen von-Kügelgen intervention-count and noncoverage clauses, recovery of the structure supplied by Wendong/Yao, and the bivariate MMD witness.

Definition (Lean source)
n :
DAG (Fin n)
s :
θ :
W :
ExactRatioDecoderComparisonClauses s θ W :
Prop
clause 4
n = 2
j i :
G.edge j i
0 < observedLawDiscrepancy gaussianFeatureMap W.law (W.targetPerm.symm j) (W.targetPerm.symm i)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.ExactRatioDecoderComparisonClauses · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TExactRatioDecoder.lean:342

All mathematical conclusions of the exact population decoder theorem.

Definition (Lean source)
n :
DAG (Fin n)
s :
θ :
W :
ExactRatioDecoderConclusion s θ W :
Prop
∃ C,
t v :
v ∈ latentCube n
(C t (familyProjection (observedLawLogRatio W.law) (predecessorSet order i) (W.mix v)) : ℝ)
= equationElevenConditionalRatioCDF θ (W.targetPerm i) t v
C :
z ∈ observedConditionalRatioSupport W.law order i :
C z.1 z.2 = observedConditionalRatioCDF laws order i z.1 z.2
t v :
v ∈ latentCube n
(observedConditionalRatioCDF laws order i t (familyProjection (observedLawLogRatio W.law) (predecessorSet order i) (W.mix v)) : ℝ)
= equationElevenConditionalRatioCDF θ (W.targetPerm i) t v
v :
v ∈ latentCube n
(observedLawRankCoordinate laws order i (W.mix v) : ℝ)
= if s.value (W.targetPerm i) = 1 then interventionCDF θ (W.targetPerm i) (v (W.targetPerm i)) else 1
- interventionCDF θ (W.targetPerm i) (v (W.targetPerm i))
n = 2
j i :
G.edge j i
0 < observedLawDiscrepancy gaussianFeatureMap W.law (W.targetPerm.symm j) (W.targetPerm.symm i)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.ExactRatioDecoderConclusion · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TExactRatioDecoder.lean:355
theorem exactRatioDecoderComparisonClauses_of_mainConclusions Lemma exactRatioDecoderComparisonClauses_of_mainConclusions in the paper ↗

The formal comparator payload follows from exact graph recovery, representation uniqueness, the bivariate edge witness, and predecessor containment; target uniqueness is supplied by the world's target permutation. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ :
W :
hunique :
∀ (G' : DAG (Fin n)) (θ' : Mechanism n G') (W' : ObservedWorld G' θ')
hbiv :
n
= 2 → ∀ ⦃j i⦄, G.edge j i → 0 < observedLawDiscrepancy gaussianFeatureMap W.law (W.targetPerm.symm j) (W.targetPerm.symm i)
hpred :
hrank :
∀ i v
if
v ∈ latentCube n
then
= if s.value (W.targetPerm i) = 1 then interventionCDF θ (W.targetPerm i) (v (W.targetPerm i)) else 1
- interventionCDF θ (W.targetPerm i) (v (W.targetPerm i))
Proof (Lean source)
lemma exactRatioDecoderComparisonClauses_of_mainConclusions {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) {θ : Mechanism n G} (W : ObservedWorld G θ) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hgraph : (populationDecoder (observedProbabilityLawFamily W.law)).2.2.edge = permutedGraph G W) (hunique : ∀ (G' : DAG (Fin n)) (θ' : Mechanism n G') (W' : ObservedWorld G' θ'), PositiveNormalizedSmoothMechanisms G' θ' → CausalMinimality G' θ' → FixedOwnDerivativeSign G' s θ' → SharedDiffeomorphicMixing G' θ' W' → OnePerfectInterventionPerNode G' θ' W' → W'.law = W.law → ComponentwiseC2Equivalent W W') (hbiv : n = 2 → ∀ ⦃j i⦄, G.edge j i → 0 < observedLawDiscrepancy gaussianFeatureMap W.law (W.targetPerm.symm j) (W.targetPerm.symm i)) (hpred : ∀ order, IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) order → ∀ i, environmentParentSet W i ⊆ predecessorSet order i) (horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W.law) (selectedTopologicalOrder (observedProbabilityLawFamily W.law))) (hrank : ∀ i v, v ∈ latentCube n → (observedLawRankCoordinate (observedProbabilityLawFamily W.law) (selectedTopologicalOrder (observedProbabilityLawFamily W.law)) i (W.mix v) : ℝ) = if s.value (W.targetPerm i) = 1 then interventionCDF θ (W.targetPerm i) (v (W.targetPerm i)) else 1 - interventionCDF θ (W.targetPerm i) (v (W.targetPerm i))) : ExactRatioDecoderComparisonClauses s θ W := by refine ⟨?_, ?_, ⟨rfl, rfl, horder, hgraph, hpred, hrank⟩, hbiv⟩ · refine ⟨rfl, ?_⟩ intro _hfaith refine ⟨?_, by norm_num, hunique⟩ intro i refine ⟨W.targetPerm.symm i, W.targetPerm.apply_symm_apply i, ?_⟩ intro e he exact W.targetPerm.injective (he.trans (W.targetPerm.apply_symm_apply i).symm) · refine ⟨rfl, hpos, hmix, ?_, by norm_num⟩ intro hn hcube have hnpos : 0 < n := Nat.pos_of_ne_zero hn let v : LatentState n := fun _ ↦ 2 have hv : v ∈ latentCube n := by rw [hcube] exact Set.mem_univ v let i : Fin n := ⟨0, hnpos⟩ have hi := hv i (Set.mem_univ i) norm_num at hi
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.exactRatioDecoderComparisonClauses_of_mainConclusions · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TExactRatioDecoder.lean:414
theorem exact_ratio_decoder Theorem 3 in the paper ↗

Cover-separated positive smooth causal-minimal mechanisms are decoded exactly from their observed environment laws, up to relabeling and componentwise diffeomorphisms. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ :
world :
∀ θ' : Mechanism n G, ObservedWorld G θ'
hminimal :
hmix :
hone :
hsign :
hcover :
(⟨θ, ⟨hpos, hminimal, hsign⟩⟩ : StratumPoint G s) ∈ coverSeparatedSet (s := s) gaussianFeatureMap (world θ).targetPerm
Proof (Lean source)
theorem exact_ratio_decoder {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) (θ : Mechanism n G) (world : ∀ θ' : Mechanism n G, ObservedWorld G θ') (hpos : PositiveNormalizedSmoothMechanisms G θ) (hminimal : CausalMinimality G θ) (hmix : SharedDiffeomorphicMixing G θ (world θ)) (hone : OnePerfectInterventionPerNode G θ (world θ)) (hsign : FixedOwnDerivativeSign G s θ) (hcover : (⟨θ, ⟨hpos, hminimal, hsign⟩⟩ : StratumPoint G s) ∈ coverSeparatedSet (s := s) gaussianFeatureMap (world θ).targetPerm) : ExactRatioDecoderConclusion s θ (world θ) := by have hcoherent : ObservedWorldLawCoherent (world θ) := observedWorldLawCoherent_of_assumptions (world θ) hpos hmix hone have _hratio : ∀ i v, v ∈ latentCube n → observedLawLogRatio (world θ).law i ((world θ).mix v) = log (θ.q ((world θ).targetPerm i) (v ((world θ).targetPerm i)) / θ.p ((world θ).targetPerm i) v) := fun i => observedLawLogRatio_comp_mix_eq (world θ) hpos hmix hone i have hcoverCanonical : ∀ ⦃a b : Fin n⦄, ancestralCover G a b → 0 < populationDiscrepancy gaussianFeatureMap (canonicalObservedWorld G θ (world θ).targetPerm) ((world θ).targetPerm.symm a) ((world θ).targetPerm.symm b) := by simpa only [coverSeparatedSet, Set.mem_setOf_eq] using hcover have hcoverWorld := canonical_coverDiscrepancy_to_supplied gaussianFeatureMap (world θ) hpos hmix hone hcoverCanonical have hgraph := ratioGraph_reconstruction_order_and_predecessors (s := s) (world θ) hpos hmix hone hcoverWorld have _htriangularInverse : ∀ order, IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap (world θ).law) order → ∀ i, PredecessorLatentCube order i ≃ₜ range (predecessorScoreMap (world θ) order i) := by intro order horder i exact predecessorScoreHomeomorph s (world θ) hpos hmix hone hsign horder (permutedGraphOrdered_of_transitiveClosure (world θ) order horder hgraph.1) i have _hequationTenDensity : ∀ order, IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap (world θ).law) order → ∀ i, let B := mechanismUnitCubeFactorization hpos let q := mechanismInterventionDensity (world θ) hpos i let A := decoderRetainedLatentSet (world θ) order i (∫⋯∫⁻_(univ \ A), B.interventionDensity ((world θ).targetPerm i) q ∂fun _ : Fin n => unitIntervalReference) = fun v => q.density (v ((world θ).targetPerm i)) * B.partialDensity (A.erase ((world θ).targetPerm i)) v := by intro order horder i exact equationTen_interventionMarginalDensity (world θ) hpos horder (permutedGraphOrdered_of_transitiveClosure (world θ) order horder hgraph.1) i have _hequationTenFiberProduct : ∀ order, IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap (world θ).law) order → ∀ i (v : LatentState n) (w : ℝ), let B := mechanismUnitCubeFactorization hpos let q := mechanismInterventionDensity (world θ) hpos i let A := decoderRetainedLatentSet (world θ) order i (∫⋯∫⁻_(univ \ A), B.interventionDensity ((world θ).targetPerm i) q ∂fun _ : Fin n ↦ unitIntervalReference) (update v ((world θ).targetPerm i) w) = q.density w * B.partialDensity (A.erase ((world θ).targetPerm i)) v := by intro order horder i v w exact equationTen_interventionMarginalDensity_fiber_product (world θ) hpos horder (permutedGraphOrdered_of_transitiveClosure (world θ) order horder hgraph.1) i v w have hcontinuousRankClauses := exactRatioDecoder_continuousRankClauses s (world θ) hpos hmix hone hsign hgraph.1 have hbivariate : n = 2 → ∀ ⦃j i⦄, G.edge j i → 0 < observedLawDiscrepancy gaussianFeatureMap (world θ).law ((world θ).targetPerm.symm j) ((world θ).targetPerm.symm i) := by intro hn subst n exact bivariate_edge_discrepancy_pos_of_coverSeparated (world θ) hcoverWorld have hprob : ∀ e, IsProbabilityMeasure ((world θ).law e) := observedWorld_laws_isProbabilityMeasure (world θ) hpos hmix hone let laws := observedProbabilityLawFamily (world θ).law have hlaws : laws.1 = (world θ).law := by simp [laws, observedProbabilityLawFamily, hprob] have hiff : ∀ order, IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap (world θ).law) order → ∀ i A, A ⊆ predecessorSet order i → (CondIndepGiven ((world θ).law 0) (observedLawRankCoordinate laws order i) (familyProjection (observedLawRankCoordinate laws order) (predecessorSet order i \ A)) (familyProjection (observedLawRankCoordinate laws order) A) ↔ environmentParentSet (world θ) i ⊆ A) := by intro order horder i A hA have hrank : ∀ e v, v ∈ latentCube n → (observedLawRankCoordinate laws order e ((world θ).mix v) : ℝ) = signedInterventionCDF s θ ((world θ).targetPerm e) (v ((world θ).targetPerm e)) := by intro e v hv simpa only [laws, signedInterventionCDF] using (hcontinuousRankClauses order horder e).2.2.2.2 v hv exact exactRankCondIndepCharacterization s (world θ) hpos hminimal hmix hone laws hgraph.1 order horder hrank i A hA have hprune : ∀ order, IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap (world θ).law) order → ∀ i, MinimalAdmissibleParentSet laws order i (environmentParentSet (world θ) i) ∧ ∀ A, MinimalAdmissibleParentSet laws order i A → A = environmentParentSet (world θ) i := by have hp := exactParentPruning_of_condIndepCharacterization (world θ) laws (by simpa only [hlaws] using hgraph.2.2) (by simpa only [hlaws] using hiff) simpa only [hlaws] using hp have hselected : (populationDecoder laws).2.2.edge = permutedGraph G (world θ) := selectedParentDAG_eq_permutedGraph_of_exactPruning (world θ) laws (hprune (selectedTopologicalOrder laws) hgraph.2.1) have hunique : ∀ (G' : DAG (Fin n)) (θ' : Mechanism n G') (W' : ObservedWorld G' θ'), PositiveNormalizedSmoothMechanisms G' θ' → CausalMinimality G' θ' → FixedOwnDerivativeSign G' s θ' → SharedDiffeomorphicMixing G' θ' W' → OnePerfectInterventionPerNode G' θ' W' → W'.law = (world θ).law → ComponentwiseC2Equivalent (world θ) W' := by intro G' θ' W' hpos' hminimal' hsign' hmix' hone' hlaw' let order : Fin n → ℕ := fun e ↦ G'.topoOrder (W'.targetPerm e) have hcommon := competitorTopologicalOrder_is_common_of_law_eq (s := s) (world θ) W' hpos' hmix' hone' hlaw' hgraph.1 have horder : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap (world θ).law) order := hcommon.1 have horder' : IsTopologicalOrdering (observedLawRatioGraph gaussianFeatureMap W'.law) order := by simpa only [hlaw'] using horder have hgraphOrder : PermutedGraphOrdered (world θ) order := hcommon.2.1 have hgraphOrder' : PermutedGraphOrdered W' order := hcommon.2.2.1 have hrank : ∀ e v, v ∈ latentCube n → (observedLawRankCoordinate laws order e ((world θ).mix v) : ℝ) = signedInterventionCDF s θ ((world θ).targetPerm e) (v ((world θ).targetPerm e)) := by intro e v hv simpa only [laws, signedInterventionCDF] using (exactRatioDecoder_continuousRankClauses_of_order s (world θ) hpos hmix hone hsign order horder hgraphOrder e).2.2.2.2 v hv have hrank' : ∀ e v, v ∈ latentCube n → (observedLawRankCoordinate laws order e (W'.mix v) : ℝ) = signedInterventionCDF s θ' (W'.targetPerm e) (v (W'.targetPerm e)) := by intro e v hv simpa only [laws, hlaw', signedInterventionCDF] using (exactRatioDecoder_continuousRankClauses_of_order s W' hpos' hmix' hone' hsign' order horder' hgraphOrder' e).2.2.2.2 v hv have hiff' := exactRankCondIndepCharacterization_of_order s W' hpos' hminimal' hmix' hone' laws order horder' hgraphOrder' hrank' have hprune' : ∀ i, MinimalAdmissibleParentSet laws order i (environmentParentSet W' i) ∧ ∀ A, MinimalAdmissibleParentSet laws order i A → A = environmentParentSet W' i := by apply exactParentPruning_at_order W' laws order hcommon.2.2.2.2 intro i A hA simpa only [hlaws, hlaw'] using hiff' i A hA have hpruneMain := hprune order horder have hparents : ∀ i, environmentParentSet W' i = environmentParentSet (world θ) i := by intro i exact (hpruneMain i).2 _ (hprune' i).1 have hedge : ∀ j i, G'.edge (((world θ).targetPerm.symm.trans W'.targetPerm) j) (((world θ).targetPerm.symm.trans W'.targetPerm) i) ↔ G.edge j i := by intro j i have hm := congrArg (fun A : Finset (Fin n) => (world θ).targetPerm.symm j ∈ A) (hparents ((world θ).targetPerm.symm i)) simpa [environmentParentSet] using hm have hsupport := observedSupport_eq_of_observationalLaw_eq (world θ) W' hpos hmix hone hpos' hmix' hone' hlaw' exact componentwiseC2Equivalent_of_common_rank_and_aligned_edges (world θ) W' hpos hmix hpos' hmix' laws order hrank hrank' hsupport hedge refine ⟨hgraph.1, hgraph.2.1, hcontinuousRankClauses, hgraph.2.2, hiff, hprune, hcoherent, hselected, hunique, hbivariate, ?_⟩ exact exactRatioDecoderComparisonClauses_of_mainConclusions s (world θ) hpos hmix hselected hunique hbivariate hgraph.2.2 hgraph.2.1 (fun i => (hcontinuousRankClauses (selectedTopologicalOrder laws) hgraph.2.1 i).2.2.2.2)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.exact_ratio_decoder · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TExactRatioDecoder.lean:466
theorem exact_ratio_decoder_faithful

Faithful-overlap corollary; faithfulness is deliberately not a premise of the main theorem. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
s :
θ :
world :
∀ θ' : Mechanism n G, ObservedWorld G θ'
hminimal :
hmix :
hone :
hsign :
hfaith :
hcover :
(⟨θ, ⟨hpos, hminimal, hsign⟩⟩ : StratumPoint G s) ∈ coverSeparatedSet (s := s) gaussianFeatureMap (world θ).targetPerm
Proof (Lean source)
-- keep: explicit faithful-overlap corollary stated in the paper's scope comparison theorem exact_ratio_decoder_faithful {n : ℕ} {G : DAG (Fin n)} (s : SignVector n) (θ : Mechanism n G) (world : ∀ θ' : Mechanism n G, ObservedWorld G θ') (hpos : PositiveNormalizedSmoothMechanisms G θ) (hminimal : CausalMinimality G θ) (hmix : SharedDiffeomorphicMixing G θ (world θ)) (hone : OnePerfectInterventionPerNode G θ (world θ)) (hsign : FixedOwnDerivativeSign G s θ) (hfaith : Faithfulness G θ) (hcover : (⟨θ, ⟨hpos, hminimal, hsign⟩⟩ : StratumPoint G s) ∈ coverSeparatedSet (s := s) gaussianFeatureMap (world θ).targetPerm) : ExactRatioDecoderConclusion s θ (world θ) := by exact exact_ratio_decoder s θ world hpos hminimal hmix hone hsign hcover
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.exact_ratio_decoder_faithful · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TExactRatioDecoder.lean:649
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.TGenericCoverSeparation 27 declarations This file states the open-dense direct-edge result and its residual Gaussian-MMD ancestral-cover consequence, including the empty-graph case.

Generic cover separation

This file states the open-dense direct-edge result and its residual Gaussian-MMD ancestral-cover consequence, including the empty-graph case.

theorem canonical_secondMomentContrast_perm_eq

Relabelling the canonical intervention environments does not change the latent direct-edge contrast after transporting the two environment indices back through the permutation. the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
theta :
pi :
Perm (Fin n)
j i :
Fin n
secondMomentContrast (canonicalObservedWorld G theta pi) (pi.symm j) (pi.symm i)
Proof (Lean source)
lemma canonical_secondMomentContrast_perm_eq {n : ℕ} {G : DAG (Fin n)} (theta : Mechanism n G) (pi : Perm (Fin n)) (j i : Fin n) : secondMomentContrast (canonicalObservedWorld G theta pi) (pi.symm j) (pi.symm i) = secondMomentContrast (canonicalObservedWorld G theta (refl (Fin n))) j i := by unfold secondMomentContrast canonicalObservedWorld simp
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.canonical_secondMomentContrast_perm_eq · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TGenericCoverSeparation.lean:24
theorem edgeContrastNonzeroSet_dense

For each fixed direct edge, the corresponding canonical contrast-nonzero locus is dense in the mechanism stratum, independently of the target permutation. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
G :
DAG (Fin n)
s :
pi :
Perm (Fin n)
j i :
Fin n
hji :
G.edge j i
Dense {theta : StratumPoint G s | secondMomentContrast (canonicalObservedWorld G theta.1 pi) (pi.symm j) (pi.symm i) ≠ 0}
Proof (Lean source)
lemma edgeContrastNonzeroSet_dense {n : ℕ} (G : DAG (Fin n)) (s : SignVector n) (pi : Perm (Fin n)) {j i : Fin n} (hji : G.edge j i) : Dense {theta : StratumPoint G s | secondMomentContrast (canonicalObservedWorld G theta.1 pi) (pi.symm j) (pi.symm i) ≠ 0} := by rw [dense_iff_inter_open] intro U hU hUne rcases hUne with ⟨theta, hthetaU⟩ rcases isOpen_induced_iff.mp hU with ⟨V, hV, hVU⟩ have hthetaV : theta.1 ∈ V := by have : theta ∈ val ⁻¹' V := by simpa [hVU] using hthetaU exact this have hIntervention : OnePerfectInterventionPerNode G theta.1 (canonicalObservedWorld G theta.1 (refl (Fin n))) := canonicalObservedWorld_onePerfectInterventionPerNode theta.property.positiveSmooth (refl (Fin n)) rcases (analytic_edge_perturbation theta hji hIntervention).2.2 V (hV.mem_nhds hthetaV) with ⟨t, htV, htStratum, htne⟩ let eta : StratumPoint G s := ⟨affinePath s theta hji ⟨t.1, ⟨le_of_lt t.2.1, le_of_lt t.2.2⟩⟩, htStratum⟩ refine ⟨eta, ?_, ?_⟩ · have : eta ∈ val ⁻¹' V := htV simpa [hVU] using this · change secondMomentContrast (canonicalObservedWorld G eta.1 pi) (pi.symm j) (pi.symm i) ≠ 0 rw [canonical_secondMomentContrast_perm_eq] exact htne
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.edgeContrastNonzeroSet_dense · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TGenericCoverSeparation.lean:34
theorem continuous_stratum_p_valueCoordinate

The observational value coordinate is continuous on the mechanism stratum by construction of the induced product C² topology. the stated conclusion follows.

Formal statement
n :
i :
Fin n
Continuous (fun theta : StratumPoint G s ↦ ofFun {latentCube n} (theta.1.p i))
Proof (Lean source)
lemma continuous_stratum_p_valueCoordinate {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (i : Fin n) : Continuous (fun theta : StratumPoint G s ↦ ofFun {latentCube n} (theta.1.p i)) := by have hcoordinates : Continuous (fun theta : StratumPoint G s ↦ mechanismC2Coordinates theta.1) := (continuous_induced_dom (f := @mechanismC2Coordinates n G)).comp continuous_subtype_val unfold mechanismC2Coordinates at hcoordinates exact (continuous_apply i).comp (continuous_fst.comp hcoordinates)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuous_stratum_p_valueCoordinate · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TGenericCoverSeparation.lean:65
theorem continuous_stratum_q_valueCoordinate

The intervention value coordinate is continuous on the mechanism stratum by construction of the induced product C² topology. the stated conclusion follows.

Formal statement
n :
i :
Fin n
Continuous (fun theta : StratumPoint G s ↦ ofFun {Icc (0 : ℝ) 1} (theta.1.q i))
Proof (Lean source)
lemma continuous_stratum_q_valueCoordinate {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (i : Fin n) : Continuous (fun theta : StratumPoint G s ↦ ofFun {Icc (0 : ℝ) 1} (theta.1.q i)) := by have hcoordinates : Continuous (fun theta : StratumPoint G s ↦ mechanismC2Coordinates theta.1) := (continuous_induced_dom (f := @mechanismC2Coordinates n G)).comp continuous_subtype_val unfold mechanismC2Coordinates at hcoordinates exact (continuous_apply i).comp (continuous_fst.comp (continuous_snd.comp (continuous_snd.comp (continuous_snd.comp hcoordinates))))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuous_stratum_q_valueCoordinate · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TGenericCoverSeparation.lean:77
theorem continuous_uniformFun_eval₂_of_continuous

Uniform convergence of a continuous family, combined with continuous motion of the argument, gives joint continuity of evaluation. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
X alpha beta :
F :
X → UniformFun alpha beta
hF :
hc :
∀ x, Continuous (toFun (F x))
Continuous (fun z : X × alpha ↦ toFun (F z.1) z.2)
Proof (Lean source)
lemma continuous_uniformFun_eval₂_of_continuous {X alpha beta : Type*} [TopologicalSpace X] [TopologicalSpace alpha] [UniformSpace beta] (F : X → UniformFun alpha beta) (hF : Continuous F) (hc : ∀ x, Continuous (toFun (F x))) : Continuous (fun z : X × alpha ↦ toFun (F z.1) z.2) := by rw [continuous_iff_continuousAt] intro z have hFt : Tendsto (F ∘ fst) (nhds z) (nhds (F z.1)) := hF.continuousAt.comp continuousAt_fst have hu := UniformFun.tendsto_iff_tendstoUniformly.mp hFt exact hu.tendsto_comp (hc z.1).continuousAt continuousAt_snd
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuous_uniformFun_eval₂_of_continuous · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TGenericCoverSeparation.lean:91
theorem continuous_stratum_p_eval

Observational-factor evaluation is jointly continuous in a stratum mechanism and a compact latent state. the stated conclusion follows.

Formal statement
n :
i :
Fin n
Continuous (fun z : StratumPoint G s × {v : LatentState n // v ∈ latentCube n} ↦ z.1.1.p i z.2.1)
Proof (Lean source)
lemma continuous_stratum_p_eval {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (i : Fin n) : Continuous (fun z : StratumPoint G s × {v : LatentState n // v ∈ latentCube n} ↦ z.1.1.p i z.2.1) := by let F : StratumPoint G s → UniformFun {v : LatentState n // v ∈ latentCube n} ℝ := fun theta ↦ UniformFun.ofFun ((latentCube n).domRestrict (theta.1.p i)) have hF : Continuous F := by have h := (UniformOnFun.continuous_rng_iff.mp (continuous_stratum_p_valueCoordinate (G := G) (s := s) i) (latentCube n) (by simp)) simpa [F, Function.comp_def] using h apply continuous_uniformFun_eval₂_of_continuous F hF intro theta exact (theta.property.positiveSmooth.2.2.1 i).continuousOn.restrict
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuous_stratum_p_eval · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TGenericCoverSeparation.lean:105
theorem continuous_stratum_q_eval

Intervention-factor evaluation is jointly continuous in a stratum mechanism and a unit coordinate. the stated conclusion follows.

Formal statement
n :
i :
Fin n
Continuous (fun z : StratumPoint G s × {x : ℝ // x ∈ Icc (0 : ℝ) 1} ↦ z.1.1.q i z.2.1)
Proof (Lean source)
lemma continuous_stratum_q_eval {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (i : Fin n) : Continuous (fun z : StratumPoint G s × {x : ℝ // x ∈ Icc (0 : ℝ) 1} ↦ z.1.1.q i z.2.1) := by let F : StratumPoint G s → UniformFun {x : ℝ // x ∈ Icc (0 : ℝ) 1} ℝ := fun theta ↦ UniformFun.ofFun (Icc (0 : ℝ) 1 |>.domRestrict (theta.1.q i)) have hF : Continuous F := by have h := (UniformOnFun.continuous_rng_iff.mp (continuous_stratum_q_valueCoordinate (G := G) (s := s) i) (Icc (0 : ℝ) 1) (by simp)) simpa [F, Function.comp_def] using h apply continuous_uniformFun_eval₂_of_continuous F hF intro theta exact (theta.property.positiveSmooth.2.2.2.1 i).continuousOn.restrict
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuous_stratum_q_eval · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TGenericCoverSeparation.lean:123
theorem continuous_compactCube_projection

Coordinatewise projection supplies a continuous ambient representative of a latent-cube point. the stated conclusion follows.

Formal statement
n :
Proof (Lean source)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuous_compactCube_projection · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TGenericCoverSeparation.lean:141
theorem compactCube_projection_mem

The coordinatewise compact-cube projection belongs to the latent cube.

Formal statement
n :
v :
Proof (Lean source)
lemma compactCube_projection_mem (n : ℕ) (v : LatentState n) : compactCubeInclude n (compactCubeRetract n v) ∈ latentCube n := by intro i _ exact (projIcc 0 1 (by norm_num) (v i)).property
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.compactCube_projection_mem · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TGenericCoverSeparation.lean:149
theorem continuous_stratum_contrastIntegrand

The compact-cube rational contrast integrand, continuously extended to the ambient latent space by coordinatewise projection, is jointly continuous in the mechanism and latent state. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
hji :
G.edge j i
Continuous (fun z : StratumPoint G s × LatentState n ↦ let v := compactCubeInclude n (compactCubeRetract n z.2) (z.1.1.q i (v i)) ^ 2 * (z.1.1.q j (v j) - z.1.1.p j v) * (∏ l ∈ (Finset.univ.erase i).erase j, z.1.1.p l v) / z.1.1.p i v)
Proof (Lean source)
lemma continuous_stratum_contrastIntegrand {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} {j i : Fin n} (hji : G.edge j i) : Continuous (fun z : StratumPoint G s × LatentState n ↦ let v := compactCubeInclude n (compactCubeRetract n z.2) (z.1.1.q i (v i)) ^ 2 * (z.1.1.q j (v j) - z.1.1.p j v) * (∏ l ∈ (Finset.univ.erase i).erase j, z.1.1.p l v) / z.1.1.p i v) := by let R : LatentState n → LatentState n := fun v ↦ compactCubeInclude n (compactCubeRetract n v) have hR : Continuous R := continuous_compactCube_projection n have hRmem : ∀ v, R v ∈ latentCube n := compactCube_projection_mem n have hp (l : Fin n) : Continuous (fun z : StratumPoint G s × LatentState n ↦ z.1.1.p l (R z.2)) := by exact (continuous_stratum_p_eval (G := G) (s := s) l).comp (continuous_fst.prodMk ((hR.comp continuous_snd).subtype_mk (fun z ↦ hRmem z.2))) have hq (l : Fin n) : Continuous (fun z : StratumPoint G s × LatentState n ↦ z.1.1.q l (R z.2 l)) := by exact (continuous_stratum_q_eval (G := G) (s := s) l).comp (continuous_fst.prodMk (((continuous_apply l).comp (hR.comp continuous_snd)).subtype_mk (fun z ↦ hRmem z.2 l (Set.mem_univ l)))) dsimp only apply Continuous.div · exact (((hq i).pow 2).mul ((hq j).sub (hp j))).mul (continuous_finsetProd _ fun l _ ↦ hp l) · exact hp i · intro z exact ne_of_gt (z.1.property.positiveSmooth.1 i (R z.2) (hRmem z.2))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuous_stratum_contrastIntegrand · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TGenericCoverSeparation.lean:155
theorem continuous_canonical_secondMomentContrast

A canonical direct-edge second-moment contrast varies continuously with the mechanism in the induced relative product C² topology. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
pi :
Perm (Fin n)
j i :
Fin n
hji :
G.edge j i
Continuous (fun theta : StratumPoint G s ↦ secondMomentContrast (canonicalObservedWorld G theta.1 pi) (pi.symm j) (pi.symm i))
Proof (Lean source)
lemma continuous_canonical_secondMomentContrast {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (pi : Perm (Fin n)) {j i : Fin n} (hji : G.edge j i) : Continuous (fun theta : StratumPoint G s ↦ secondMomentContrast (canonicalObservedWorld G theta.1 pi) (pi.symm j) (pi.symm i)) := by let F : StratumPoint G s → LatentState n → ℝ := fun theta v ↦ (theta.1.q i (v i)) ^ 2 * (theta.1.q j (v j) - theta.1.p j v) * (∏ l ∈ (Finset.univ.erase i).erase j, theta.1.p l v) / theta.1.p i v letI : CompactSpace {v : LatentState n // v ∈ latentCube n} := isCompact_iff_compactSpace.mp (by rw [latentCube] exact isCompact_univ_pi fun _ ↦ isCompact_Icc) have hFcont (theta : StratumPoint G s) : ContinuousOn (F theta) (latentCube n) := by have hq (l : Fin n) : ContinuousOn (fun v : LatentState n ↦ theta.1.q l (v l)) (latentCube n) := (theta.property.positiveSmooth.2.2.2.1 l).continuousOn.comp (continuous_apply l).continuousOn (fun v hv ↦ hv l (Set.mem_univ l)) have hp (l : Fin n) := (theta.property.positiveSmooth.2.2.1 l).continuousOn exact (((hq i).pow 2).mul ((hq j).sub (hp j))).mul (continuousOn_finsetProd _ fun l _ ↦ hp l) |>.div (hp i) (fun v hv ↦ ne_of_gt (theta.property.positiveSmooth.1 i v hv)) have hJoint : Continuous (fun z : StratumPoint G s × {v : LatentState n // v ∈ latentCube n} ↦ F z.1 z.2.1) := by have h := (continuous_stratum_contrastIntegrand (G := G) (s := s) hji).comp (show Continuous (fun z : StratumPoint G s × {v : LatentState n // v ∈ latentCube n} ↦ (z.1, z.2.1)) by fun_prop) convert h using 1 funext z dsimp [F] rw [compactCubeInclude_retract_of_mem z.2.property] let FC : StratumPoint G s → C({v : LatentState n // v ∈ latentCube n}, ℝ) := fun theta ↦ ⟨fun v ↦ F theta v.1, (hFcont theta).restrict⟩ have hFC : Continuous FC := by apply ContinuousMap.continuous_of_continuous_uncurry change Continuous (fun z : StratumPoint G s × {v : LatentState n // v ∈ latentCube n} ↦ F z.1 z.2.1) exact hJoint have hUniform : Continuous (fun theta ↦ ofFun {latentCube n} (F theta)) := by apply (ContinuousOn.continuous_domRestrict_iff_continuous_uniformOnFun hFcont).mp exact hFC have hmu : MeasureTheory.volume (latentCube n) < ⊤ := (show IsCompact (latentCube n) by rw [latentCube] exact isCompact_univ_pi fun _ ↦ isCompact_Icc).measure_lt_top have hInt (theta : StratumPoint G s) : IntegrableOn (F theta) (latentCube n) := (hFcont theta).integrableOn_compact (by rw [latentCube] exact isCompact_univ_pi fun _ ↦ isCompact_Icc) have hint : Continuous (fun theta ↦ ∫ v in latentCube n, F theta v) := continuous_setIntegral_of_continuous_uniformOn MeasureTheory.volume (latentCube n) hmu F hUniform hInt have hne : j ≠ i := fun h ↦ by subst j; exact G.irrefl i hji rw [show (fun theta : StratumPoint G s ↦ secondMomentContrast (canonicalObservedWorld G theta.1 pi) (pi.symm j) (pi.symm i)) = fun theta ↦ ∫ v in latentCube n, F theta v by funext theta rw [canonical_secondMomentContrast_perm_eq, canonical_secondMomentContrast_eq_integral theta.property.positiveSmooth hne]] exact hint
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuous_canonical_secondMomentContrast · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TGenericCoverSeparation.lean:186
theorem continuous_gaussianFeature

The explicit Gaussian feature vector depends continuously on its scalar argument. the stated conclusion follows.

Formal statement
Proof (Lean source)
lemma continuous_gaussianFeature : Continuous gaussianFeature := by rw [continuous_iff_continuousAt] intro r have hnormsq (x : ℝ) : ‖gaussianFeature x - gaussianFeature r‖ ^ 2 = 2 - 2 * gaussianKernel x r := by rw [← real_inner_self_eq_norm_sq] simp only [inner_sub_left, inner_sub_right, gaussianFeature_inner] simp [gaussianKernel] ring have hsquare : ContinuousAt (fun x : ℝ => 2 - 2 * gaussianKernel x r) r := by unfold gaussianKernel fun_prop have hzero : 2 - 2 * gaussianKernel r r = 0 := by simp [gaussianKernel] rw [ContinuousAt, tendsto_iff_norm_sub_tendsto_zero] have hsqrt := Real.continuous_sqrt.continuousAt.comp hsquare change Tendsto (fun x : ℝ => sqrt (2 - 2 * gaussianKernel x r)) (nhds r) (nhds (sqrt (2 - 2 * gaussianKernel r r))) at hsqrt have hsqrt' : Tendsto (fun x : ℝ => sqrt (2 - 2 * gaussianKernel x r)) (nhds r) (nhds (sqrt (2 - 2 * gaussianKernel r r))) := by exact hsqrt rw [hzero, Real.sqrt_zero] at hsqrt' convert hsqrt' using 1 funext x rw [← hnormsq x, Real.sqrt_sq_eq_abs, abs_of_nonneg (norm_nonneg _)]
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuous_gaussianFeature · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TGenericCoverSeparation.lean:251
theorem continuous_stratum_observationalGaussianIntegrand

The observational Gaussian-embedding integrand is jointly continuous on the mechanism stratum and compact latent cube. the stated conclusion follows.

Formal statement
n :
i :
Fin n
Continuous (fun z : StratumPoint G s × {v : LatentState n // v ∈ latentCube n} ↦ observationalDensity z.1.1 z.2.1 • gaussianFeature (z.1.1.q i (z.2.1 i) / z.1.1.p i z.2.1))
Proof (Lean source)
lemma continuous_stratum_observationalGaussianIntegrand {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (i : Fin n) : Continuous (fun z : StratumPoint G s × {v : LatentState n // v ∈ latentCube n} ↦ observationalDensity z.1.1 z.2.1 • gaussianFeature (z.1.1.q i (z.2.1 i) / z.1.1.p i z.2.1)) := by have hp (l : Fin n) : Continuous (fun z : StratumPoint G s × {v : LatentState n // v ∈ latentCube n} ↦ z.1.1.p l z.2.1) := continuous_stratum_p_eval (G := G) (s := s) l have hq (l : Fin n) : Continuous (fun z : StratumPoint G s × {v : LatentState n // v ∈ latentCube n} ↦ z.1.1.q l (z.2.1 l)) := by have hc : Continuous (fun z : StratumPoint G s × {v : LatentState n // v ∈ latentCube n} ↦ z.2.1 l) := (continuous_apply l).comp (continuous_subtype_val.comp continuous_snd) have hc' : Continuous (fun z : StratumPoint G s × {v : LatentState n // v ∈ latentCube n} ↦ (⟨z.2.1 l, z.2.property l (Set.mem_univ l)⟩ : {x : ℝ // x ∈ Icc (0 : ℝ) 1})) := hc.subtype_mk _ convert (continuous_stratum_q_eval (G := G) (s := s) l).comp (continuous_fst.prodMk hc') using 1 <;> rfl have hr : Continuous (fun z : StratumPoint G s × {v : LatentState n // v ∈ latentCube n} ↦ z.1.1.q i (z.2.1 i) / z.1.1.p i z.2.1) := by exact (hq i).div (hp i) fun z ↦ ne_of_gt (z.1.property.positiveSmooth.1 i z.2.1 z.2.property) unfold observationalDensity exact (continuous_finsetProd _ fun l _ ↦ hp l).smul (continuous_gaussianFeature.comp hr)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuous_stratum_observationalGaussianIntegrand · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TGenericCoverSeparation.lean:281
theorem continuous_stratum_interventionalGaussianIntegrand

The target-interventional Gaussian-embedding integrand is jointly continuous on the mechanism stratum and compact latent cube. the stated conclusion follows.

Formal statement
n :
j i :
Fin n
Continuous (fun z : StratumPoint G s × {v : LatentState n // v ∈ latentCube n} ↦ interventionalDensity z.1.1 j z.2.1 • gaussianFeature (z.1.1.q i (z.2.1 i) / z.1.1.p i z.2.1))
Proof (Lean source)
lemma continuous_stratum_interventionalGaussianIntegrand {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (j i : Fin n) : Continuous (fun z : StratumPoint G s × {v : LatentState n // v ∈ latentCube n} ↦ interventionalDensity z.1.1 j z.2.1 • gaussianFeature (z.1.1.q i (z.2.1 i) / z.1.1.p i z.2.1)) := by have hp (l : Fin n) : Continuous (fun z : StratumPoint G s × {v : LatentState n // v ∈ latentCube n} ↦ z.1.1.p l z.2.1) := continuous_stratum_p_eval (G := G) (s := s) l have hq (l : Fin n) : Continuous (fun z : StratumPoint G s × {v : LatentState n // v ∈ latentCube n} ↦ z.1.1.q l (z.2.1 l)) := by have hc : Continuous (fun z : StratumPoint G s × {v : LatentState n // v ∈ latentCube n} ↦ z.2.1 l) := (continuous_apply l).comp (continuous_subtype_val.comp continuous_snd) have hc' : Continuous (fun z : StratumPoint G s × {v : LatentState n // v ∈ latentCube n} ↦ (⟨z.2.1 l, z.2.property l (Set.mem_univ l)⟩ : {x : ℝ // x ∈ Icc (0 : ℝ) 1})) := hc.subtype_mk _ convert (continuous_stratum_q_eval (G := G) (s := s) l).comp (continuous_fst.prodMk hc') using 1 <;> rfl have hr : Continuous (fun z : StratumPoint G s × {v : LatentState n // v ∈ latentCube n} ↦ z.1.1.q i (z.2.1 i) / z.1.1.p i z.2.1) := by exact (hq i).div (hp i) fun z ↦ ne_of_gt (z.1.property.positiveSmooth.1 i z.2.1 z.2.property) unfold interventionalDensity exact ((hq j).mul (continuous_finsetProd _ fun l _ ↦ hp l)).smul (continuous_gaussianFeature.comp hr)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuous_stratum_interventionalGaussianIntegrand · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TGenericCoverSeparation.lean:313
theorem canonical_observationalMeanEmbedding_eq_setIntegral

The canonical observational ratio-law embedding is the explicit weighted cube integral. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
π :
Perm (Fin n)
i :
Fin n
= ∫ v in latentCube n, observationalDensity θ v • gaussianFeature (θ.q (π i) (v (π i)) / θ.p (π i) v)
Proof (Lean source)
lemma canonical_observationalMeanEmbedding_eq_setIntegral {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (hpos : PositiveNormalizedSmoothMechanisms G θ) (π : Perm (Fin n)) (i : Fin n) : meanEmbedding gaussianFeatureMap (observationalRatioLaw (canonicalObservedWorld G θ π) i) = ∫ v in latentCube n, observationalDensity θ v • gaussianFeature (θ.q (π i) (v (π i)) / θ.p (π i) v) := by let W := canonicalObservedWorld G θ π let r : LatentState n → ℝ := fun v ↦ θ.q (π i) (v (π i)) / θ.p (π i) v let μ : Measure (LatentState n) := MeasureTheory.volume.restrict (latentCube n) have hcube : MeasurableSet (latentCube n) := by rw [latentCube] exact MeasurableSet.univ_pi fun _ ↦ measurableSet_Icc have hobsCube : ∀ᵐ v ∂observationalLaw θ, v ∈ latentCube n := observationalLaw_ae_mem_latentCube hpos have hone := canonicalObservedWorld_onePerfectInterventionPerNode hpos π have hr : observedLawRatio W.law i =ᵐ[observationalLaw θ] r := by filter_upwards [hone.2.2.1 i, hobsCube] with v hrv hv change ((interventionalLaw θ (π i)).rnDeriv (observationalLaw θ) v).toReal = r v calc _ = (ofReal (W.ratio i v)).toReal := congrArg toReal hrv.symm _ = W.ratio i v := ENNReal.toReal_ofReal (div_nonneg (hpos.2.1 _ _ (hv (π i) (Set.mem_univ _))).le (hpos.1 _ _ hv).le) _ = r v := by rfl have hobscont : ContinuousOn (observationalDensity θ) (latentCube n) := by unfold observationalDensity exact continuousOn_finsetProd _ fun l _ ↦ (hpos.2.2.1 l).continuousOn unfold meanEmbedding observationalRatioLaw change (∫ x, gaussianFeature x ∂MeasureTheory.Measure.map (observedLawRatio W.law i) (observationalLaw θ)) = _ rw [MeasureTheory.integral_map (measurable_observedLawRatio W.law i).aemeasurable continuous_gaussianFeature.aestronglyMeasurable] calc (∫ v, gaussianFeature (observedLawRatio W.law i v) ∂observationalLaw θ) = ∫ v, gaussianFeature (r v) ∂observationalLaw θ := by apply MeasureTheory.integral_congr_ae filter_upwards [hr] with v hv rw [hv] _ = ∫ v, observationalDensity θ v • gaussianFeature (r v) ∂μ := by unfold observationalLaw rw [integral_withDensity_eq_integral_toReal_smul₀] · apply MeasureTheory.integral_congr_ae filter_upwards [MeasureTheory.ae_restrict_mem hcube] with v hv rw [ENNReal.toReal_ofReal (le_of_lt (by unfold observationalDensity exact Finset.prod_pos fun l _ ↦ hpos.1 l v hv))] · exact (hobscont.aestronglyMeasurable hcube).aemeasurable.ennreal_ofReal · filter_upwards with v exact ENNReal.ofReal_lt_top _ = _ := by rfl
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.canonical_observationalMeanEmbedding_eq_setIntegral · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TGenericCoverSeparation.lean:345
theorem canonical_interventionalMeanEmbedding_eq_setIntegral

The canonical interventional ratio-law embedding is the explicit weighted cube integral. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
π :
Perm (Fin n)
j i :
Fin n
= ∫ v in latentCube n, interventionalDensity θ (π j) v • gaussianFeature (θ.q (π i) (v (π i)) / θ.p (π i) v)
Proof (Lean source)
lemma canonical_interventionalMeanEmbedding_eq_setIntegral {n : ℕ} {G : DAG (Fin n)} {θ : Mechanism n G} (hpos : PositiveNormalizedSmoothMechanisms G θ) (π : Perm (Fin n)) (j i : Fin n) : meanEmbedding gaussianFeatureMap (interventionalRatioLaw (canonicalObservedWorld G θ π) j i) = ∫ v in latentCube n, interventionalDensity θ (π j) v • gaussianFeature (θ.q (π i) (v (π i)) / θ.p (π i) v) := by let W := canonicalObservedWorld G θ π let r : LatentState n → ℝ := fun v ↦ θ.q (π i) (v (π i)) / θ.p (π i) v let μ : Measure (LatentState n) := MeasureTheory.volume.restrict (latentCube n) have hcube : MeasurableSet (latentCube n) := by rw [latentCube] exact MeasurableSet.univ_pi fun _ ↦ measurableSet_Icc have hobsCube : ∀ᵐ v ∂observationalLaw θ, v ∈ latentCube n := observationalLaw_ae_mem_latentCube hpos have hone := canonicalObservedWorld_onePerfectInterventionPerNode hpos π have hrObs : observedLawRatio W.law i =ᵐ[observationalLaw θ] r := by filter_upwards [hone.2.2.1 i, hobsCube] with v hrv hv change ((interventionalLaw θ (π i)).rnDeriv (observationalLaw θ) v).toReal = r v calc _ = (ofReal (W.ratio i v)).toReal := congrArg toReal hrv.symm _ = W.ratio i v := ENNReal.toReal_ofReal (div_nonneg (hpos.2.1 _ _ (hv (π i) (Set.mem_univ _))).le (hpos.1 _ _ hv).le) _ = r v := by rfl have hac : interventionalLaw θ (π j) ≪ observationalLaw θ := by simpa only [W, canonicalObservedWorld] using interventionalLaw_absolutelyContinuous_observational W hpos j have hr : observedLawRatio W.law i =ᵐ[interventionalLaw θ (π j)] r := hac.ae_eq hrObs have hintcont : ContinuousOn (interventionalDensity θ (π j)) (latentCube n) := by unfold interventionalDensity have hq : ContinuousOn (fun v : LatentState n ↦ θ.q (π j) (v (π j))) (latentCube n) := (hpos.2.2.2.1 (π j)).continuousOn.comp ((continuous_apply (π j)).continuousOn) (fun v hv ↦ hv (π j) (Set.mem_univ _)) exact hq.mul (continuousOn_finsetProd _ fun l _ ↦ (hpos.2.2.1 l).continuousOn) unfold meanEmbedding interventionalRatioLaw change (∫ x, gaussianFeature x ∂MeasureTheory.Measure.map (observedLawRatio W.law i) (interventionalLaw θ (π j))) = _ rw [MeasureTheory.integral_map (measurable_observedLawRatio W.law i).aemeasurable continuous_gaussianFeature.aestronglyMeasurable] calc (∫ v, gaussianFeature (observedLawRatio W.law i v) ∂interventionalLaw θ (π j)) = ∫ v, gaussianFeature (r v) ∂interventionalLaw θ (π j) := by apply MeasureTheory.integral_congr_ae filter_upwards [hr] with v hv rw [hv] _ = ∫ v, interventionalDensity θ (π j) v • gaussianFeature (r v) ∂μ := by unfold interventionalLaw rw [integral_withDensity_eq_integral_toReal_smul₀] · apply MeasureTheory.integral_congr_ae filter_upwards [MeasureTheory.ae_restrict_mem hcube] with v hv rw [ENNReal.toReal_ofReal (le_of_lt (by unfold interventionalDensity exact mul_pos (hpos.2.1 (π j) (v (π j)) (hv (π j) (Set.mem_univ _))) (Finset.prod_pos fun l _ ↦ hpos.1 l v hv)))] · exact (hintcont.aestronglyMeasurable hcube).aemeasurable.ennreal_ofReal · filter_upwards with v exact ENNReal.ofReal_lt_top _ = _ := by rfl
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.canonical_interventionalMeanEmbedding_eq_setIntegral · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TGenericCoverSeparation.lean:402
theorem continuous_canonical_populationDiscrepancy

The canonical Gaussian population discrepancy varies continuously with the mechanism. the stated conclusion follows.

Formal statement
n :
π :
Perm (Fin n)
j i :
Fin n
Continuous (fun θ : StratumPoint G s ↦ populationDiscrepancy gaussianFeatureMap (canonicalObservedWorld G θ.1 π) (π.symm j) (π.symm i))
Proof (Lean source)
lemma continuous_canonical_populationDiscrepancy {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} (π : Perm (Fin n)) (j i : Fin n) : Continuous (fun θ : StratumPoint G s ↦ populationDiscrepancy gaussianFeatureMap (canonicalObservedWorld G θ.1 π) (π.symm j) (π.symm i)) := by let Fobs := fun θ : StratumPoint G s ↦ fun v : LatentState n ↦ observationalDensity θ.1 v • gaussianFeature (θ.1.q i (v i) / θ.1.p i v) let Fint := fun θ : StratumPoint G s ↦ fun v : LatentState n ↦ interventionalDensity θ.1 j v • gaussianFeature (θ.1.q i (v i) / θ.1.p i v) letI : CompactSpace {v : LatentState n // v ∈ latentCube n} := isCompact_iff_compactSpace.mp (by rw [latentCube] exact isCompact_univ_pi fun _ ↦ isCompact_Icc) have hcompact : IsCompact (latentCube n) := by rw [latentCube] exact isCompact_univ_pi fun _ ↦ isCompact_Icc have hobsJoint : Continuous (fun z : StratumPoint G s × {v : LatentState n // v ∈ latentCube n} ↦ Fobs z.1 z.2.1) := by exact continuous_stratum_observationalGaussianIntegrand (G := G) (s := s) i have hintJoint : Continuous (fun z : StratumPoint G s × {v : LatentState n // v ∈ latentCube n} ↦ Fint z.1 z.2.1) := by exact continuous_stratum_interventionalGaussianIntegrand (G := G) (s := s) j i have hobsOn (θ : StratumPoint G s) : ContinuousOn (Fobs θ) (latentCube n) := by apply continuousOn_iff_continuous_restrict.mpr exact hobsJoint.comp (continuous_const.prodMk continuous_id) have hintOn (θ : StratumPoint G s) : ContinuousOn (Fint θ) (latentCube n) := by apply continuousOn_iff_continuous_restrict.mpr exact hintJoint.comp (continuous_const.prodMk continuous_id) let Cobs : StratumPoint G s → C({v : LatentState n // v ∈ latentCube n}, lp (fun _ : ℕ => ℝ) 2) := fun θ ↦ ⟨fun v ↦ Fobs θ v.1, (hobsOn θ).restrict⟩ let Cint : StratumPoint G s → C({v : LatentState n // v ∈ latentCube n}, lp (fun _ : ℕ => ℝ) 2) := fun θ ↦ ⟨fun v ↦ Fint θ v.1, (hintOn θ).restrict⟩ have hCobs : Continuous Cobs := by apply ContinuousMap.continuous_of_continuous_uncurry exact hobsJoint have hCint : Continuous Cint := by apply ContinuousMap.continuous_of_continuous_uncurry exact hintJoint have hobsUniform : Continuous (fun θ ↦ ofFun {latentCube n} (Fobs θ)) := by apply (ContinuousOn.continuous_domRestrict_iff_continuous_uniformOnFun hobsOn).mp exact hCobs have hintUniform : Continuous (fun θ ↦ ofFun {latentCube n} (Fint θ)) := by apply (ContinuousOn.continuous_domRestrict_iff_continuous_uniformOnFun hintOn).mp exact hCint have hmu : volume (latentCube n) < ⊤ := hcompact.measure_lt_top have hobsInt (θ : StratumPoint G s) : IntegrableOn (Fobs θ) (latentCube n) := (hobsOn θ).integrableOn_compact hcompact have hintInt (θ : StratumPoint G s) : IntegrableOn (Fint θ) (latentCube n) := (hintOn θ).integrableOn_compact hcompact have hobsIntegral : Continuous (fun θ ↦ ∫ v in latentCube n, Fobs θ v) := continuous_setIntegral_of_continuous_uniformOn volume (latentCube n) hmu Fobs hobsUniform hobsInt have hintIntegral : Continuous (fun θ ↦ ∫ v in latentCube n, Fint θ v) := continuous_setIntegral_of_continuous_uniformOn volume (latentCube n) hmu Fint hintUniform hintInt rw [show (fun θ : StratumPoint G s ↦ populationDiscrepancy gaussianFeatureMap (canonicalObservedWorld G θ.1 π) (π.symm j) (π.symm i)) = fun θ ↦ ‖(∫ v in latentCube n, Fobs θ v) - ∫ v in latentCube n, Fint θ v‖ by funext θ unfold populationDiscrepancy rw [canonical_observationalMeanEmbedding_eq_setIntegral θ.property.positiveSmooth π (π.symm i), canonical_interventionalMeanEmbedding_eq_setIntegral θ.property.positiveSmooth π (π.symm j) (π.symm i)] simp only [Equiv.apply_symm_apply, Fobs, Fint]] exact (hobsIntegral.sub hintIntegral).norm
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.continuous_canonical_populationDiscrepancy · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TGenericCoverSeparation.lean:473
theorem dense_biInter_finset_of_open

A finite intersection of open dense sets is dense, without any Baire-space assumption. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
S :
A :
I → Set X
hopen :
∀ i ∈ S, IsOpen (A i)
hdense :
∀ i ∈ S, Dense (A i)
Dense (⋂ i ∈ S, A i)
Proof (Lean source)
lemma dense_biInter_finset_of_open {X I : Type*} [TopologicalSpace X] [DecidableEq I] (S : Finset I) (A : I → Set X) (hopen : ∀ i ∈ S, IsOpen (A i)) (hdense : ∀ i ∈ S, Dense (A i)) : Dense (⋂ i ∈ S, A i) := by classical induction S using Finset.induction_on with | empty => simp | @insert a S ha ih => rw [show (⋂ i ∈ insert a S, A i) = A a ∩ ⋂ i ∈ S, A i by ext x simp [ha]] exact (hdense a (by simp)).inter_of_isOpen_left (ih (fun i hi ↦ hopen i (by simp [hi])) (fun i hi ↦ hdense i (by simp [hi]))) (hopen a (by simp))
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.dense_biInter_finset_of_open · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TGenericCoverSeparation.lean:556
theorem edgeSeparatedSet_isOpen

Direct-edge contrast separation is open in the stratum topology. the stated conclusion follows.

Formal statement
n :
G :
DAG (Fin n)
s :
pi :
Perm (Fin n)
IsOpen (edgeSeparatedSet (G := G) (s := s) pi)
Proof (Lean source)
lemma edgeSeparatedSet_isOpen {n : ℕ} (G : DAG (Fin n)) (s : SignVector n) (pi : Perm (Fin n)) : IsOpen (edgeSeparatedSet (G := G) (s := s) pi) := by rw [isOpen_iff_mem_nhds] intro theta htheta have hall : ∀ᶠ eta in nhds theta, ∀ j i, G.edge j i → secondMomentContrast (canonicalObservedWorld G eta.1 pi) (pi.symm j) (pi.symm i) ≠ 0 := by have hpairs : ∀ᶠ eta in nhds theta, ∀ ji : Fin n × Fin n, ji ∈ (Set.univ : Set (Fin n × Fin n)) → G.edge ji.1 ji.2 → secondMomentContrast (canonicalObservedWorld G eta.1 pi) (pi.symm ji.1) (pi.symm ji.2) ≠ 0 := (Filter.eventually_all_finite (l := nhds theta) (p := fun ji eta ↦ G.edge ji.1 ji.2 → secondMomentContrast (canonicalObservedWorld G eta.1 pi) (pi.symm ji.1) (pi.symm ji.2) ≠ 0) (Set.toFinite (Set.univ : Set (Fin n × Fin n)))).2 (fun ji _ ↦ by by_cases hedge : G.edge ji.1 ji.2 · have hc := continuous_canonical_secondMomentContrast (G := G) (s := s) pi hedge filter_upwards [hc.continuousAt (isOpen_compl_singleton.mem_nhds (by simpa [edgeSeparatedSet] using htheta hedge))] with eta heta exact fun _ ↦ heta · exact Filter.Eventually.of_forall fun _ h ↦ (hedge h).elim) filter_upwards [hpairs] with eta heta exact fun j i hji ↦ heta (j, i) (Set.mem_univ _) hji filter_upwards [hall] with eta heta exact heta
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.edgeSeparatedSet_isOpen · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TGenericCoverSeparation.lean:573
theorem edgeSeparatedSet_dense

Direct-edge contrast separation is dense in the stratum topology. the stated conclusion follows.

Formal statement
n :
G :
DAG (Fin n)
s :
pi :
Perm (Fin n)
Dense (edgeSeparatedSet (G := G) (s := s) pi)
Proof (Lean source)
lemma edgeSeparatedSet_dense {n : ℕ} (G : DAG (Fin n)) (s : SignVector n) (pi : Perm (Fin n)) : Dense (edgeSeparatedSet (G := G) (s := s) pi) := by let A : (Fin n × Fin n) → Set (StratumPoint G s) := fun ji ↦ if h : G.edge ji.1 ji.2 then {theta | secondMomentContrast (canonicalObservedWorld G theta.1 pi) (pi.symm ji.1) (pi.symm ji.2) ≠ 0} else Set.univ have hopen : ∀ ji ∈ (Finset.univ : Finset (Fin n × Fin n)), IsOpen (A ji) := by intro ji _ dsimp [A] split_ifs with h · exact (continuous_canonical_secondMomentContrast (G := G) (s := s) pi h).isOpen_preimage {0}ᶜ isOpen_compl_singleton · exact isOpen_univ have hdense : ∀ ji ∈ (Finset.univ : Finset (Fin n × Fin n)), Dense (A ji) := by intro ji _ dsimp [A] split_ifs with h · exact edgeContrastNonzeroSet_dense G s pi h · exact dense_univ have h := dense_biInter_finset_of_open (Finset.univ : Finset (Fin n × Fin n)) A hopen hdense apply h.mono intro theta htheta j i hji have hmem : theta ∈ A (j, i) := Set.mem_iInter.mp (Set.mem_iInter.mp htheta (j, i)) (Finset.mem_univ _) simpa [A, hji] using hmem
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.edgeSeparatedSet_dense · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TGenericCoverSeparation.lean:606
theorem coverSeparatedSet_isOpen

Ancestral-cover Gaussian-MMD separation is open in the mechanism stratum. the stated conclusion follows.

Formal statement
n :
G :
DAG (Fin n)
s :
π :
Perm (Fin n)
Proof (Lean source)
lemma coverSeparatedSet_isOpen {n : ℕ} (G : DAG (Fin n)) (s : SignVector n) (π : Perm (Fin n)) : IsOpen (coverSeparatedSet (G := G) (s := s) gaussianFeatureMap π) := by rw [isOpen_iff_mem_nhds] intro θ hθ have hpairs : ∀ᶠ η in nhds θ, ∀ ji : Fin n × Fin n, ji ∈ (Set.univ : Set (Fin n × Fin n)) → ancestralCover G ji.1 ji.2 → 0 < populationDiscrepancy gaussianFeatureMap (canonicalObservedWorld G η.1 π) (π.symm ji.1) (π.symm ji.2) := (Filter.eventually_all_finite (l := nhds θ) (p := fun ji η ↦ ancestralCover G ji.1 ji.2 → 0 < populationDiscrepancy gaussianFeatureMap (canonicalObservedWorld G η.1 π) (π.symm ji.1) (π.symm ji.2)) (Set.toFinite (Set.univ : Set (Fin n × Fin n)))).2 (fun ji _ ↦ by by_cases hcover : ancestralCover G ji.1 ji.2 · have hc := continuous_canonical_populationDiscrepancy (G := G) (s := s) π ji.1 ji.2 filter_upwards [hc.continuousAt (isOpen_Ioi.mem_nhds (hθ hcover))] with η hη exact fun _ ↦ hη · exact Filter.Eventually.of_forall fun _ h ↦ (hcover h).elim) filter_upwards [hpairs] with η hη exact fun j i hji ↦ hη (j, i) (Set.mem_univ _) hji
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.coverSeparatedSet_isOpen · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TGenericCoverSeparation.lean:637
theorem ancestralCover_edge

An ancestral cover in a DAG is necessarily a direct edge. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
Fin n
hji :
G.edge j i
Proof (Lean source)
lemma ancestralCover_edge {n : ℕ} {G : DAG (Fin n)} {j i : Fin n} (hji : ancestralCover G j i) : G.edge j i := by have hanc : G.isAncestor j i := @CovBy.lt (Fin n) ⟨G.isAncestor⟩ j i hji rcases G.isAncestor_child hanc with hedge | ⟨k, hjk, hki⟩ · exact hedge · exact (hji.2 (Causalean.DAG.isAncestor.edge hjk) hki).elim
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.ancestralCover_edge · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TGenericCoverSeparation.lean:666
theorem ancestralCover_false_of_no_edge

An edge-free DAG has no ancestral covers. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
DAG (Fin n)
hG :
∀ j i, ¬ G.edge j i
j i :
Fin n
hji :
Proof (Lean source)
lemma ancestralCover_false_of_no_edge {n : ℕ} {G : DAG (Fin n)} (hG : ∀ j i, ¬ G.edge j i) {j i : Fin n} (hji : ancestralCover G j i) : False := by exact hG j i (ancestralCover_edge hji)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.ancestralCover_false_of_no_edge · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TGenericCoverSeparation.lean:677
theorem separatedSets_eq_univ_of_no_edge

Both separation conditions are vacuous for an edge-free DAG. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
G :
DAG (Fin n)
s :
π :
Perm (Fin n)
hG :
∀ j i, ¬ G.edge j i
conclusion 1
edgeSeparatedSet (G := G) (s := s) π = univ
conclusion 2
Proof (Lean source)
lemma separatedSets_eq_univ_of_no_edge {n : ℕ} (G : DAG (Fin n)) (s : SignVector n) (π : Perm (Fin n)) (hG : ∀ j i, ¬ G.edge j i) : edgeSeparatedSet (G := G) (s := s) π = univcoverSeparatedSet (G := G) (s := s) gaussianFeatureMap π = univ := by constructor · ext θ simp only [edgeSeparatedSet, Set.mem_ofPred_eq, Set.mem_univ, iff_true] intro j i hji exact (hG j i hji).elim · ext θ simp only [coverSeparatedSet, Set.mem_ofPred_eq, Set.mem_univ, iff_true] intro j i hji exact (ancestralCover_false_of_no_edge hG hji).elim
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.separatedSets_eq_univ_of_no_edge · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TGenericCoverSeparation.lean:685
theorem openDense_compl_topology Lemma openDense_compl_topology in the paper ↗

The complement of an open dense set is closed, nowhere dense, and meagre. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
X :
hopen :
hdense :
conclusion 1
conclusion 2
conclusion 3
Proof (Lean source)
lemma openDense_compl_topology {X : Type*} [TopologicalSpace X] {A : Set X} (hopen : IsOpen A) (hdense : Dense A) : IsMeagre Aᶜ ∧ IsClosed Aᶜ ∧ IsNowhereDense Aᶜ := by have hclosed_nowhere : IsClosed Aᶜ ∧ IsNowhereDense Aᶜ := by rw [isClosed_isNowhereDense_iff_compl] simpa using intro hopen hdense exact ⟨hclosed_nowhere.2.isMeagre, hclosed_nowhere.1, hclosed_nowhere.2⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.openDense_compl_topology · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TGenericCoverSeparation.lean:702
theorem edgeSeparated_subset_coverSeparated

Direct-edge raw second-moment separation implies Gaussian-MMD separation on every ancestral cover. the stated conclusion follows.

Formal statement
n :
G :
DAG (Fin n)
s :
π :
Perm (Fin n)
edgeSeparatedSet (G := G) (s := s) π ⊆ coverSeparatedSet (G := G) (s := s) gaussianFeatureMap π
Proof (Lean source)
lemma edgeSeparated_subset_coverSeparated {n : ℕ} (G : DAG (Fin n)) (s : SignVector n) (π : Perm (Fin n)) : edgeSeparatedSet (G := G) (s := s) π ⊆ coverSeparatedSet (G := G) (s := s) gaussianFeatureMap π := by intro θ hθ j i hji apply canonical_populationDiscrepancy_pos_of_secondMomentContrast_ne θ.property.positiveSmooth π exact hθ (ancestralCover_edge hji)
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.edgeSeparated_subset_coverSeparated · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TGenericCoverSeparation.lean:713
theorem generic_cover_separation Theorem 2 in the paper ↗

In every nonempty fixed-DAG sign stratum, direct-edge moment separation is open dense and implies an open dense residual ancestral-cover MMD region with closed nowhere-dense complement. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
G :
DAG (Fin n)
s :
π :
Perm (Fin n)
hne :
(Set.univ : Set (StratumPoint G s)).Nonempty
conclusion 1
IsOpen (edgeSeparatedSet (G := G) (s := s) π)
conclusion 2
Dense (edgeSeparatedSet (G := G) (s := s) π)
conclusion 3
edgeSeparatedSet (G := G) (s := s) π ⊆ coverSeparatedSet (G := G) (s := s) gaussianFeatureMap π
conclusion 4
conclusion 5
conclusion 6
IsMeagre ((coverSeparatedSet (G := G) (s := s) gaussianFeatureMap π)ᶜ)
conclusion 7
IsClosed ((coverSeparatedSet (G := G) (s := s) gaussianFeatureMap π)ᶜ)
conclusion 8
conclusion 9
(∀ j i, ¬ G.edge j i)
edgeSeparatedSet (G := G) (s := s) π = Set.univ
coverSeparatedSet (G := G) (s := s) gaussianFeatureMap π = Set.univ
Proof (Lean source)
theorem generic_cover_separation {n : ℕ} (G : DAG (Fin n)) (s : SignVector n) (π : Perm (Fin n)) (hne : (Set.univ : Set (StratumPoint G s)).Nonempty) : IsOpen (edgeSeparatedSet (G := G) (s := s) π) ∧ Dense (edgeSeparatedSet (G := G) (s := s) π) ∧ edgeSeparatedSet (G := G) (s := s) π ⊆ coverSeparatedSet (G := G) (s := s) gaussianFeatureMap π ∧ IsOpen (coverSeparatedSet (G := G) (s := s) gaussianFeatureMap π) ∧ Dense (coverSeparatedSet (G := G) (s := s) gaussianFeatureMap π) ∧ IsMeagre ((coverSeparatedSet (G := G) (s := s) gaussianFeatureMap π)ᶜ) ∧ IsClosed ((coverSeparatedSet (G := G) (s := s) gaussianFeatureMap π)ᶜ) ∧ IsNowhereDense ((coverSeparatedSet (G := G) (s := s) gaussianFeatureMap π)ᶜ) ∧ ((∀ j i, ¬ G.edge j i) → edgeSeparatedSet (G := G) (s := s) π = Set.univ ∧ coverSeparatedSet (G := G) (s := s) gaussianFeatureMap π = Set.univ) := by have hsubset := edgeSeparated_subset_coverSeparated G s π have htopology : IsOpen (edgeSeparatedSet (G := G) (s := s) π) ∧ Dense (edgeSeparatedSet (G := G) (s := s) π) ∧ IsOpen (coverSeparatedSet (G := G) (s := s) gaussianFeatureMap π) := by exact ⟨edgeSeparatedSet_isOpen G s π, edgeSeparatedSet_dense G s π, coverSeparatedSet_isOpen G s π⟩ have hdenseCover : Dense (coverSeparatedSet (G := G) (s := s) gaussianFeatureMap π) := htopology.2.1.mono hsubset have hcompl := openDense_compl_topology htopology.2.2 hdenseCover exact ⟨htopology.1, htopology.2.1, hsubset, htopology.2.2, hdenseCover, hcompl.1, hcompl.2.1, hcompl.2.2, separatedSets_eq_univ_of_no_edge G s π⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.generic_cover_separation · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TGenericCoverSeparation.lean:726
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.TSimultaneousConfidenceEdges 2 declarations This file states the conditional and unconditional simultaneous MMD bounds, soundness of selected edges, and transitive-closure recovery under a cover margin.

Simultaneous confidence edges

This file states the conditional and unconditional simultaneous MMD bounds, soundness of selected edges, and transitive-closure recovery under a cover margin.

The event that every empirical MMD is within the simultaneous confidence radius.

Definition (Lean source)
simultaneousMmdEvent S U :
Set Ω
{ω | ∀ j i : Fin n, j ≠ i → |empiricalDiscrepancy S U j i ω - populationDiscrepancy U W j i| ≤ confidenceRadius S}
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.simultaneousMmdEvent · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TSimultaneousConfidenceEdges.lean:18
theorem simultaneous_confidence_edges Theorem 4 in the paper ↗

Under the simultaneous first-stage event, sample splitting yields familywise MMD confidence bounds. Selected arrows are ancestral, and a two-radius cover margin recovers the true transitive closure. Given the stated inputs and conditions, the stated conclusion follows.

Formal statement
n :
W :
Ω :
S :
hn :
1 ≤ n
hN :
∀ e, 1 ≤ S.sampleSize e
:
S.alpha ∈ Ioo (0 : ℝ) 1
:
S.eta ∈ Ioo (0 : ℝ) 1
hfirst :
1 - S.eta ≤ S.probability.real (firstStageL1Event S)
conclusion 1
ConditionalProbabilityAtLeast S.probability (comap (trainingFold S) inferInstance) (simultaneousMmdEvent S gaussianFeatureMap) (firstStageL1Event S) (1 - S.alpha)
conclusion 2
1 - S.alpha - S.eta ≤ S.probability.real (simultaneousMmdEvent S gaussianFeatureMap)
conclusion 3
ω ∈ simultaneousMmdEvent S gaussianFeatureMap :
j i :
sampleSplitConfidenceGraph S gaussianFeatureMap hSampling ω j i
G.isAncestor (W.targetPerm j) (W.targetPerm i)
conclusion 4
(∀ j i, ancestralCover G (W.targetPerm j) (W.targetPerm i) → 2 * confidenceRadius S < populationDiscrepancy gaussianFeatureMap W j i)
ω ∈ simultaneousMmdEvent S gaussianFeatureMap :
TransGen (sampleSplitConfidenceGraph S gaussianFeatureMap hSampling ω)
Proof (Lean source)
theorem simultaneous_confidence_edges {n : ℕ} {G : DAG (Fin n)} {s : SignVector n} {θ : Mechanism n G} (W : ObservedWorld G θ) {Ω : Type*} [MeasurableSpace Ω] (S : SampleSplitWorld W Ω) (hpos : PositiveNormalizedSmoothMechanisms G θ) (hmix : SharedDiffeomorphicMixing G θ W) (hone : OnePerfectInterventionPerNode G θ W) (hSampling : IndependentEnvironmentSampling S) (hn : 1 ≤ n) (hN : ∀ e, 1 ≤ S.sampleSize e) (hα : S.alpha ∈ Ioo (0 : ℝ) 1) (hη : S.eta ∈ Ioo (0 : ℝ) 1) (hfirst : 1 - S.eta ≤ S.probability.real (firstStageL1Event S)) : ConditionalProbabilityAtLeast S.probability (comap (trainingFold S) inferInstance) (simultaneousMmdEvent S gaussianFeatureMap) (firstStageL1Event S) (1 - S.alpha) ∧ 1 - S.alpha - S.eta ≤ S.probability.real (simultaneousMmdEvent S gaussianFeatureMap) ∧ (∀ ω ∈ simultaneousMmdEvent S gaussianFeatureMap, ∀ j i, sampleSplitConfidenceGraph S gaussianFeatureMap hSampling ω j i → G.isAncestor (W.targetPerm j) (W.targetPerm i)) ∧ ((∀ j i, ancestralCover G (W.targetPerm j) (W.targetPerm i) → 2 * confidenceRadius S < populationDiscrepancy gaussianFeatureMap W j i) → ∀ ω ∈ simultaneousMmdEvent S gaussianFeatureMap, TransGen (sampleSplitConfidenceGraph S gaussianFeatureMap hSampling ω) = TransGen (permutedGraph G W)) := by classical letI : IsProbabilityMeasure S.probability := hSampling.1 letI : MeasurableSpace (lp (fun _ : ℕ => ℝ) 2) := borel _ letI : BorelSpace (lp (fun _ : ℕ => ℝ) 2) := ⟨rfl⟩ let R : ℝ := (1 + sqrt (2 * log ((n : ℝ) * (n + 1 : ℝ) / S.alpha))) / sqrt (minimumSampleSize S) let Good : Set Ω := {ω | ∀ i : Fin n, ∀ e : Fin (n + 1), ‖empiricalMeanEmbedding S gaussianFeatureMap e i ω - fittedMeanEmbedding S gaussianFeatureMap e i ω‖ ≤ R} have hcondSampling := hSampling.toConditionalEvaluationSampling have hgood : ConditionalProbabilityAtLeast S.probability (comap (trainingFold S) inferInstance) Good univ (1 - S.alpha) := by simpa only [Good, R] using bounded_rkhs_empirical_mean S gaussianFeatureMap hcondSampling hn hN hα have hlaw : ∀ e, IsProbabilityMeasure (W.law e) := hSampling.2.1 have hbridge (ω : Ω) (hω : ω ∈ firstStageL1Event S) (i : Fin n) (e : Fin (n + 1)) : ‖fittedMeanEmbedding S gaussianFeatureMap e i ω - meanEmbedding gaussianFeatureMap (Measure.map (observedLawRatio W.law i) (W.law e))‖ ≤ sqrt 2 * S.firstStageRadius S.eta := by letI : IsProbabilityMeasure (W.law e) := hlaw e exact (meanEmbedding_map_sub_le_l1 gaussianFeatureMap (W.law e) (S.ratioEstimate ω i) (observedLawRatio W.law i) (S.ratioFit_measurable (trainingFold S ω) i) (measurable_observedLawRatio W.law i) (hω i e).1).trans (mul_le_mul_of_nonneg_left (hω i e).2 (Real.sqrt_nonneg _)) have hGoodEvent : Good ∩ firstStageL1Event S ⊆ simultaneousMmdEvent S gaussianFeatureMap := by intro ω hω intro j i hji have hjEval := hω.1 i j.succ have h0Eval := hω.1 i 0 have hjFit := hbridge ω hω.2 i j.succ have h0Fit := hbridge ω hω.2 i 0 let Ej := empiricalMeanEmbedding S gaussianFeatureMap j.succ i ω let E0 := empiricalMeanEmbedding S gaussianFeatureMap 0 i ω let Fj := fittedMeanEmbedding S gaussianFeatureMap j.succ i ω let F0 := fittedMeanEmbedding S gaussianFeatureMap 0 i ω let Pj := meanEmbedding gaussianFeatureMap (Measure.map (observedLawRatio W.law i) (W.law j.succ)) let P0 := meanEmbedding gaussianFeatureMap (Measure.map (observedLawRatio W.law i) (W.law 0)) have hvec : ‖(Ej - E0) - (Pj - P0)‖ ≤ 2 * R + 2 * (sqrt 2 * S.firstStageRadius S.eta) := by calc ‖(Ej - E0) - (Pj - P0)‖ = ‖(Ej - Fj) + (Fj - Pj) - ((E0 - F0) + (F0 - P0))‖ := by congr 1 <;> abel _ ≤ ‖Ej - Fj‖ + ‖Fj - Pj‖ + (‖E0 - F0‖ + ‖F0 - P0‖) := by exact (norm_sub_le _ _).trans (add_le_add (norm_add_le _ _) (norm_add_le _ _)) _ ≤ R + (sqrt 2 * S.firstStageRadius S.eta) + (R + (sqrt 2 * S.firstStageRadius S.eta)) := by gcongr _ = 2 * R + 2 * (sqrt 2 * S.firstStageRadius S.eta) := by ring have hnorm : |‖Ej - E0‖ - ‖Pj - P0‖| ≤ 2 * R + 2 * (sqrt 2 * S.firstStageRadius S.eta) := (abs_norm_sub_norm_le (Ej - E0) (Pj - P0)).trans hvec have hrev : ‖Pj - P0‖ = ‖P0 - Pj‖ := norm_sub_rev _ _ rw [hrev] at hnorm have hfinal : |‖Ej - E0‖ - ‖P0 - Pj‖| ≤ confidenceRadius S := by convert hnorm using 1 all_goals simp only [confidenceRadius, R] all_goals ring simpa only [empiricalDiscrepancy, populationDiscrepancy, observationalRatioLaw, interventionalRatioLaw, Ej, E0, Pj, P0] using hfinal have hconditional : ConditionalProbabilityAtLeast S.probability (comap (trainingFold S) inferInstance) (simultaneousMmdEvent S gaussianFeatureMap) (firstStageL1Event S) (1 - S.alpha) := by intro B hB have hA : @MeasurableSet Ω (comap (trainingFold S) inferInstance) (firstStageL1Event S) := hSampling.2.2.2.2.2.2.2.2.2.2.2 have hg := hgood (firstStageL1Event S ∩ B) (hA.inter hB) simp only [Set.univ_inter, Set.inter_assoc] at hg exact hg.trans (measureReal_mono (by intro ω hω exact ⟨⟨hGoodEvent ⟨hω.1, hω.2.1⟩, hω.2.1⟩, hω.2.2⟩) (measure_ne_top _ _)) refine ⟨hconditional, ?_, ?_, ?_⟩ · have hc := hconditional univ MeasurableSet.univ simp only [Set.inter_univ] at hc have hEA : S.probability.real (simultaneousMmdEvent S gaussianFeatureMap ∩ firstStageL1Event S) ≤ S.probability.real (simultaneousMmdEvent S gaussianFeatureMap) := measureReal_mono Set.inter_subset_left (measure_ne_top _ _) have hnonneg : 0 ≤ 1 - S.alpha := by linarith [hα.2] have hmul := mul_le_mul_of_nonneg_left hfirst hnonneg nlinarith [hη.1, hα.1] · intro ω hω j i hedge by_contra hna have hz := ratio_nonancestor_zero (s := s) W hpos hmix hone hedge.1 hna have herr := hω j i hedge.1 rw [hz, sub_zero] at herr have hem : 0 ≤ empiricalDiscrepancy S gaussianFeatureMap j i ω := by exact norm_nonneg _ rw [abs_of_nonneg hem] at herr unfold sampleSplitConfidenceGraph at hedge linarith · intro hmargin ω hω have hedge : ∀ {j i}, sampleSplitConfidenceGraph S gaussianFeatureMap hSampling ω j i → G.isAncestor (W.targetPerm j) (W.targetPerm i) := by intro j i hji apply Classical.byContradiction intro hna have hz := ratio_nonancestor_zero (s := s) W hpos hmix hone hji.1 hna have herr := hω j i hji.1 rw [hz, sub_zero] at herr have hem : 0 ≤ empiricalDiscrepancy S gaussianFeatureMap j i ω := by exact norm_nonneg _ rw [abs_of_nonneg hem] at herr unfold sampleSplitConfidenceGraph at hji linarith have hliftAncestor : ∀ {a b}, G.isAncestor a b → TransGen (permutedGraph G W) (W.targetPerm.symm a) (W.targetPerm.symm b) := by intro a b hji induction hji with | edge h => apply Relation.TransGen.single simpa [permutedGraph] using h | trans hab hbc ih => apply Relation.TransGen.tail ih simpa [permutedGraph] using hbc have hancestorPath : ∀ {j i}, G.isAncestor (W.targetPerm j) (W.targetPerm i) → TransGen (permutedGraph G W) j i := by intro j i hji simpa using hliftAncestor hji have hforward : TransGen (sampleSplitConfidenceGraph S gaussianFeatureMap hSampling ω) ≤ TransGen (permutedGraph G W) := by intro j i hji induction hji with | single h => exact hancestorPath (hedge h) | tail hab hbc ih => exact ih.trans (hancestorPath (hedge hbc)) have hcoverEdge : ∀ {a b : Fin n}, ancestralCover G a b → sampleSplitConfidenceGraph S gaussianFeatureMap hSampling ω (W.targetPerm.symm a) (W.targetPerm.symm b) := by intro a b hab have hne : W.targetPerm.symm a ≠ W.targetPerm.symm b := by intro heq have : a = b := W.targetPerm.symm.injective heq subst b have hab' : G.isAncestor a a := by exact (@CovBy.lt (Fin n) ⟨G.isAncestor⟩ a a hab) exact G.isAncestor_irrefl a hab' have hD := hmargin (W.targetPerm.symm a) (W.targetPerm.symm b) (by simpa) have herr := hω (W.targetPerm.symm a) (W.targetPerm.symm b) hne unfold sampleSplitConfidenceGraph refine ⟨hne, ?_⟩ have hlow := (abs_le.mp herr).1 linarith have hmapCoverPath : ∀ {a b}, TransGen (ancestralCover G) a b → TransGen (sampleSplitConfidenceGraph S gaussianFeatureMap hSampling ω) (W.targetPerm.symm a) (W.targetPerm.symm b) := by intro a b hc induction hc with | single h => exact Relation.TransGen.single (hcoverEdge h) | tail hab hbc ih => exact Relation.TransGen.tail ih (hcoverEdge hbc) have hpermEdge : ∀ {j i}, permutedGraph G W j i → TransGen (sampleSplitConfidenceGraph S gaussianFeatureMap hSampling ω) j i := by intro j i hji have ha : G.isAncestor (W.targetPerm j) (W.targetPerm i) := Causalean.DAG.isAncestor.edge hji have hc := isAncestor_transGen_ancestralCover G ha have mapped := hmapCoverPath hc simpa using mapped have hbackward : TransGen (permutedGraph G W) ≤ TransGen (sampleSplitConfidenceGraph S gaussianFeatureMap hSampling ω) := by intro j i hji induction hji with | single h => exact hpermEdge h | tail hab hbc ih => exact ih.trans (hpermEdge hbc) apply le_antisymm · exact hforward · exact hbackward
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.simultaneous_confidence_edges · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TSimultaneousConfidenceEdges.lean:30
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity_Research.TSparseWitnessCertificate 2 declarations The theorem certifies both explicit three-node constructions, quantitative sparse separation, and the exact cancellation example.

Sparse and cancellation witness certificate

The theorem certifies both explicit three-node constructions, quantitative sparse separation, and the exact cancellation example.

theorem explicitWitness_structural_cancellation_certificate

The already established witness lemmas assemble both faithfulness assertions, all regularity, and exact cancellation. This leaves only the quantitative sparse moment/MMD estimates to the final assembly. the stated conclusion follows.

Formal statement
s :
Proof (Lean source)
-- @node: explicitWitness_structural_cancellation_certificate lemma explicitWitness_structural_cancellation_certificate (s : SignVector 3) : let sparse := sparseWitness s let cancel := cancellationWitness s let Wc := canonicalObservedWorld threeNodeDAG cancel (refl (Fin 3)) PositiveNormalizedSmoothMechanisms threeNodeDAG sparse ∧ FixedOwnDerivativeSign threeNodeDAG s sparse ∧ Faithfulness threeNodeDAG sparse ∧ (∀ k i, ContDiffOn ℝ k (sparse.p i) (latentCube 3)) ∧ (∀ k i, ContDiffOn ℝ k (sparse.q i) (Icc (0 : ℝ) 1)) ∧ PositiveNormalizedSmoothMechanisms threeNodeDAG cancelFixedOwnDerivativeSign threeNodeDAG s cancelFaithfulness threeNodeDAG cancel ∧ (∀ k i, ContDiffOn ℝ k (cancel.p i) (latentCube 3)) ∧ (∀ k i, ContDiffOn ℝ k (cancel.q i) (Icc (0 : ℝ) 1)) ∧ observationalRatioLaw Wc 1 = interventionalRatioLaw Wc 0 1 ∧ populationDiscrepancy gaussianFeatureMap Wc 0 1 = 0 := by dsimp only rcases explicitWitness_regularities s with ⟨hsp, hss, hspd, hsqd, hcp, hcs, hcpd, hcqd⟩ exact ⟨hsp, hss, sparseWitness_faithfulness s, hspd, hsqd, hcp, hcs, cancellationWitness_faithfulness s, hcpd, hcqd, cancellationWitness_ratioLaws_eq s, cancellationWitness_populationDiscrepancy_eq_zero s⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.explicitWitness_structural_cancellation_certificate · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TSparseWitnessCertificate.lean:25
theorem sparse_witness_certificate Theorem 1 in the paper ↗

The reflected sparse and cancellation mechanisms satisfy the model atoms; the sparse witness has the certified moment and Gaussian-MMD gaps, while the cancellation ratio law is unchanged. the stated conclusion follows.

Formal statement
s :
k i :
ContDiffOn ℝ k (sparse.p i) (latentCube 3)
k i :
ContDiffOn ℝ k (sparse.q i) (Icc (0 : ℝ) 1)
k i :
ContDiffOn ℝ k (cancel.p i) (latentCube 3)
k i :
ContDiffOn ℝ k (cancel.q i) (Icc (0 : ℝ) 1)
(3 / 10000 : ℝ) < (∫ x, (Ws.ratio 1 x) ^ 2 ∂Ws.law 0)
- ∫ x, (Ws.ratio 1 x) ^ 2 ∂Ws.law (succ 0)
(5 / 100000000 : ℝ) < populationDiscrepancy gaussianFeatureMap Ws 0 1
Proof (Lean source)
-- @node: prop:sparse-witness-certificate theorem sparse_witness_certificate (s : SignVector 3) : let sparse := sparseWitness s let cancel := cancellationWitness s let Ws := canonicalObservedWorld threeNodeDAG sparse (refl (Fin 3)) let Wc := canonicalObservedWorld threeNodeDAG cancel (refl (Fin 3)) PositiveNormalizedSmoothMechanisms threeNodeDAG sparse ∧ FixedOwnDerivativeSign threeNodeDAG s sparse ∧ Faithfulness threeNodeDAG sparse ∧ (∀ k i, ContDiffOn ℝ k (sparse.p i) (latentCube 3)) ∧ (∀ k i, ContDiffOn ℝ k (sparse.q i) (Icc (0 : ℝ) 1)) ∧ PositiveNormalizedSmoothMechanisms threeNodeDAG cancelFixedOwnDerivativeSign threeNodeDAG s cancelFaithfulness threeNodeDAG cancel ∧ (∀ k i, ContDiffOn ℝ k (cancel.p i) (latentCube 3)) ∧ (∀ k i, ContDiffOn ℝ k (cancel.q i) (Icc (0 : ℝ) 1)) ∧ (3 / 10000 : ℝ) < (∫ x, (Ws.ratio 1 x) ^ 2 ∂Ws.law 0) - ∫ x, (Ws.ratio 1 x) ^ 2 ∂Ws.law (succ 0) ∧ (5 / 100000000 : ℝ) < populationDiscrepancy gaussianFeatureMap Ws 0 1 ∧ observationalRatioLaw Wc 1 = interventionalRatioLaw Wc 0 1 ∧ populationDiscrepancy gaussianFeatureMap Wc 0 1 = 0 := by dsimp only rcases explicitWitness_structural_cancellation_certificate s with ⟨hsp, hss, hsf, hspd, hsqd, hcp, hcs, hcf, hcpd, hcqd, hratio, hcMmd⟩ exact ⟨hsp, hss, hsf, hspd, hsqd, hcp, hcs, hcf, hcpd, hcqd, sparse_witness_moment_gap s, sparse_witness_mmd_gap s, hratio, hcMmd⟩
CausalSmith.ExactID.EID_CrlCoverratioMmdGenericity.sparse_witness_certificate · CausalSmith/ExactID/EID_CrlCoverratioMmdGenericity_Research/TSparseWitnessCertificate.lean:53