Formalization: Private Estimation and Honest Inference for Conditional Treatment Effects with Rough Nuisance Functions

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.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Basic 51 declarations Concrete causal laws, selected observational versions, private kernels and extended-real minimax criteria.

Concrete causal laws, selected observational versions, private kernels and extended-real minimax criteria. Published inequalities are explicit conditional gates.

The covariate takes values in the closed unit interval.

Definition (Lean source)
Covariate :
Set ℝ
CausalSmith.Stat.PrivateCateRoughdesign.Covariate · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Basic.lean:22
def O

Observed records consist of a covariate and two binary marks for treatment and outcome.

Definition (Lean source)
O :
Type
def Record

Full causal records also carry the two binary potential outcomes.

Definition (Lean source)
Record :
Type
Covariate × Bool × (Bool × Bool) × Bool
def Dataset

A dataset is a finite tuple of observed records indexed by the public sample size.

Definition (Lean source)
n :
ℕ
Dataset n :
Type
Fin n → O
def bit

A binary mark is represented numerically by zero or one.

Definition (Lean source)
a :
bit a :
ℝ
if a then 1 else 0
def X

The covariate coordinate of a full causal record.

Definition (Lean source)
z :
X z :
z.1

The binary treatment coordinate of a full causal record.

Definition (Lean source)
z :
A z :
z.2.1
def Ypot

The control and treated potential outcomes of a full causal record.

Definition (Lean source)
z :
Ypot z :
z.2.2.1

The observed binary outcome coordinate of a full causal record.

Definition (Lean source)
z :
Y z :
z.2.2.2
def observe

Observation forgets the potential outcomes and retains covariate, treatment and outcome.

Definition (Lean source)
z :
observe z :
O
(X z, A z, Y z)

The covariate coordinate is measurable. The displayed conclusion follows.

Formal statement
Proof (Lean source)
-- @node: measurable_X @[fun_prop] lemma measurable_X : Measurable X := by unfold X fun_prop
CausalSmith.Stat.PrivateCateRoughdesign.measurable_X · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Basic.lean:42

The public regularity radius is fixed at three.

Definition (Lean source)
L :
ℝ
3

The evaluation point one half belongs to the closed unit interval. the asserted conclusion follows.

Formal statement
(1 / 2 : ℝ) ∈ Icc 0 1
Proof (Lean source)
-- @node: half_mem_unitInterval lemma half_mem_unitInterval : (1 / 2 : ℝ) ∈ Icc 0 1 := by constructor <;> norm_num
CausalSmith.Stat.PrivateCateRoughdesign.half_mem_unitInterval · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Basic.lean:50
def x0

The public evaluation point is one half.

Definition (Lean source)
x0 :
⟨1/2, half_mem_unitInterval⟩

The version identities pin the density and the three observational regressions to the law. The arm means are integrable for their arm-specific covariate measures, without interior bounds.

Definition (Lean source)
law :
probability :
f :
Covariate → ℝ
e :
Covariate → ℝ
mu0 :
Covariate → ℝ
mu1 :
Covariate → ℝ
f_measurable :
e_measurable :
mu0_measurable :
mu1_measurable :
density_version :
law.map X ≪ volume → law.map X = volume.withDensity (fun x => ofReal (f x))
e_integrable :
Integrable e (law.map X)
mu0_integrable :
Integrable mu0 ((law.restrict {z | A z = false}).map X)
mu1_integrable :
Integrable mu1 ((law.restrict {z | A z = true}).map X)
e_version :
∀ s : Set Covariate
then
∫ x in s, e x ∂(law.map X) = law.real {z | X z ∈ s ∧ A z = true}
mu0_version :
∀ s : Set Covariate
then
∫ x in s, mu0 x ∂((law.restrict {z | A z = false}).map X)
= ∫ z in {z | X z ∈ s ∧ A z = false}, bit (Y z) ∂law
mu1_version :
∀ s : Set Covariate
then
∫ x in s, mu1 x ∂((law.restrict {z | A z = true}).map X)
= ∫ z in {z | X z ∈ s ∧ A z = true}, bit (Y z) ∂law
CausalSmith.Stat.PrivateCateRoughdesign.CausalLaw · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Basic.lean:57
instance instIsProbabilityMeasureRecordLaw

The bundled causal law carries its probability-measure instance.

Definition (Lean source)
instance (P : CausalLaw) : IsProbabilityMeasure P.law := P.probability
CausalSmith.Stat.PrivateCateRoughdesign.instIsProbabilityMeasureRecordLaw · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Basic.lean:85
def Pobs

The observed marginal is the pushforward of the causal law by observation.

Definition (Lean source)
P :
Pobs P :
P.law.map observe
def PX

The design marginal is the pushforward of the causal law by the covariate coordinate.

Definition (Lean source)
P :
P.law.map X
def tau

The selected observational contrast is the treated regression minus the control regression.

Definition (Lean source)
tau P x :
ℝ
P.mu1 x - P.mu0 x

The point target evaluates the selected contrast at one half.

Definition (Lean source)
P :
theta P :
ℝ
tau P x0

The dataset law is the finite product of the observed marginal.

Definition (Lean source)
n :
ℕ
P :
dataLaw n P :
Measure.pi (fun _ : Fin n => Pobs P)

The sampling hypothesis identifies the dataset distribution with that observed product law.

Definition (Lean source)
n :
ℕ
shared
P :
shared
Q :
IIDSampling n P Q :
Prop
Q = dataLaw n P
CausalSmith.Stat.PrivateCateRoughdesign.IIDSampling · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Basic.lean:102

The observed outcome agrees almost surely with the potential outcome selected by treatment.

Definition (Lean source)
P :
shared
Consistency P :
Prop
∀ᵐ z ∂P.law, Y z = if A z then (Ypot z).2 else (Ypot z).1
CausalSmith.Stat.PrivateCateRoughdesign.Consistency · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Basic.lean:105

The potential-outcome pair and treatment are conditionally independent given the covariate.

Definition (Lean source)
P :
shared
Exchangeability P :
Prop
CondIndepFun (comap X inferInstance) measurable_X.comap_le Ypot A P.law
CausalSmith.Stat.PrivateCateRoughdesign.Exchangeability · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Basic.lean:108

The design marginal is absolutely continuous and its selected density is between one half and three halves almost everywhere for Lebesgue measure.

Definition (Lean source)
P :
shared
DensityBounds P :
Prop
clause 1
PX P ≪ volume
clause 2
∀ᵐ x ∂(volume : Measure Covariate), 1/2 ≤ P.f x ∧ P.f x ≤ 3/2
CausalSmith.Stat.PrivateCateRoughdesign.DensityBounds · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Basic.lean:112

The selected propensity is between one quarter and three quarters at every covariate.

Definition (Lean source)
P :
shared
x :
Overlap P :
Prop
clause 1
1/4 ≤ P.e x
clause 2
P.e x ≤ 3/4
def PropensityHolder Assumption 6 in the paper ↗

The selected propensity obeys the one-tenth Holder modulus with radius three.

Definition (Lean source)
P :
shared
x x' :
PropensityHolder P :
Prop
|P.e x - P.e x'| ≤ L * |(x : ℝ) - x'| ^ (1/10 : ℝ)
CausalSmith.Stat.PrivateCateRoughdesign.PropensityHolder · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Basic.lean:122

The selected control regression obeys the one-tenth Holder modulus with radius three.

Definition (Lean source)
P :
shared
x x' :
ControlHolder P :
Prop
|P.mu0 x - P.mu0 x'| ≤ L * |(x : ℝ) - x'| ^ (1/10 : ℝ)
CausalSmith.Stat.PrivateCateRoughdesign.ControlHolder · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Basic.lean:126
def ContrastLipschitz Assumption 8 in the paper ↗

The selected contrast obeys the Lipschitz modulus with radius three.

Definition (Lean source)
P :
shared
x x' :
ContrastLipschitz P :
Prop
|tau P x - tau P x'| ≤ L * |(x : ℝ) - x'|
CausalSmith.Stat.PrivateCateRoughdesign.ContrastLipschitz · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Basic.lean:130
structure CompleteModel

The complete law class bundles consistency, exchangeability, density, overlap and the three specified regularity conditions.

Definition (Lean source)
P :
shared
consistency :
Consistency P
exchangeability :
density :
overlap :
propensity_holder :
control_holder :
contrast_lipschitz :
CausalSmith.Stat.PrivateCateRoughdesign.CompleteModel · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Basic.lean:134
def dHam

The Hamming distance counts the records at which two datasets differ.

Definition (Lean source)
n :
ℕ
shared
D Dprime :
dHam n D Dprime :
ℕ
hammingDist D Dprime

Replacement privacy bounds every measurable output event on every adjacent pair of input datasets.

Definition (Lean source)
n :
ℕ
shared
B :
Type u_1
shared
epsilon :
ℝ
shared
M :
shared
D Dprime :
dHam n D Dprime = 1
E :
PurePrivacy n epsilon M :
Prop
(M D).real E ≤ exp epsilon * (M Dprime).real E
CausalSmith.Stat.PrivateCateRoughdesign.PurePrivacy · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Basic.lean:153
structure PrivateKernel

The private-kernel predicate bundles Markov normalization and replacement privacy.

Definition (Lean source)
n :
ℕ
shared
B :
Type u_1
shared
epsilon :
ℝ
shared
M :
shared
markov :
pure_privacy :
PurePrivacy n epsilon M
CausalSmith.Stat.PrivateCateRoughdesign.PrivateKernel · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Basic.lean:159
def TV

Total variation is the substrate distance between probability measures on a common measurable space.

Definition (Lean source)
α :
Q Q' :
TV Q Q' :
ℝ
tvDist Q Q'
def WH

Hamming transport is the extended-real infimum of expected dataset Hamming distance over all couplings.

Definition (Lean source)
n :
ℕ
shared
Q Q' :
WH n Q Q' :
ℝ≥0∞
⨅ (γ : Measure (Dataset n × Dataset n)) (_ : IsCoupling γ Q Q'), ∫⁻ z, (dHam n z.1 z.2 : ℝ≥0∞) ∂γ
def IntervalCode

Connected Borel intervals are represented by extended endpoints and inclusion flags, with a separate empty code.

Definition (Lean source)
IntervalCode :
Type
Unit ⊕ (EReal × EReal × Bool × Bool)
CausalSmith.Stat.PrivateCateRoughdesign.IntervalCode · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Basic.lean:176
theorem intervalCode_borelSpace Lemma intervalCode_borelSpace in the paper ↗

The empty-or-endpoints representation has the Borel sigma algebra of its sum topology. This representation property is derived locally, rather than assumed by headline consumers. the asserted conclusion follows.

Formal statement
Proof (Lean source)
-- @node: intervalCode_borelSpace lemma intervalCode_borelSpace : BorelSpace IntervalCode := by constructor apply le_antisymm · intro s hs have hparts := measurableSet_sum_iff.mp hs letI : MeasurableSpace IntervalCode := borel IntervalCode letI : BorelSpace IntervalCode := ⟨rfl⟩ have hel : MeasurableEmbedding (Sum.inl : Unit → IntervalCode) := Topology.IsOpenEmbedding.inl.measurableEmbedding have her : MeasurableEmbedding (Sum.inr : EReal × EReal × Bool × Bool → IntervalCode) := Topology.IsOpenEmbedding.inr.measurableEmbedding have hl := hel.measurableSet_image.mpr hparts.1 have hr := her.measurableSet_image.mpr hparts.2 simpa only [Set.image_preimage_inl_union_image_preimage_inr] using hl.union hr · apply MeasurableSpace.generateFrom_le intro s hs exact measurableSet_sum_iff.mpr ⟨(hs.preimage continuous_inl).measurableSet, (hs.preimage continuous_inr).measurableSet⟩
CausalSmith.Stat.PrivateCateRoughdesign.intervalCode_borelSpace · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Basic.lean:179
instance instBorelSpaceIntervalCode

The interval representation carries its derived Borel-space instance.

Definition (Lean source)
instance : BorelSpace IntervalCode := intervalCode_borelSpace -- @realizes Ispace(Borel coding)
CausalSmith.Stat.PrivateCateRoughdesign.instBorelSpaceIntervalCode · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Basic.lean:201
def toSet

An interval code denotes the corresponding connected subset of the real line.

Definition (Lean source)
toSet c :
Set ℝ
match c with | .inl _
=> ∅ | .inr (l,u,lc,uc) => {x | (if lc then l ≤ (x : EReal) else l < (x : EReal)) ∧ (if uc then (x : EReal) ≤ u else (x : EReal) < u)}
CausalSmith.Stat.PrivateCateRoughdesign.IntervalCode.toSet · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Basic.lean:203
def leb

The length of a coded interval is its possibly infinite Lebesgue measure.

Definition (Lean source)
leb c :
ℝ≥0∞
volume c.toSet
CausalSmith.Stat.PrivateCateRoughdesign.IntervalCode.leb · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Basic.lean:208
def scalarRisk

Absolute risk integrates both the observed dataset distribution and randomized scalar output.

Definition (Lean source)
n :
ℕ
shared
T :
Kernel (Dataset n) ℝ
P :
scalarRisk n T P :
ℝ≥0∞
∫⁻ u, ofReal |u - theta P| ∂(T ∘ₘ dataLaw n P)
CausalSmith.Stat.PrivateCateRoughdesign.scalarRisk · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Basic.lean:211

Expected interval length integrates both the observed dataset distribution and randomized interval output.

Definition (Lean source)
n :
ℕ
shared
P :
expectedLength n I P :
ℝ≥0∞
∫⁻ c, c.leb ∂(I ∘ₘ dataLaw n P)
CausalSmith.Stat.PrivateCateRoughdesign.expectedLength · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Basic.lean:214

Coverage is the probability that the randomized coded interval contains the law-specific point target.

Definition (Lean source)
n :
ℕ
shared
P :
coverage n I P :
ℝ
(I ∘ₘ dataLaw n P).real {c | theta P ∈ c.toSet}
CausalSmith.Stat.PrivateCateRoughdesign.coverage · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Basic.lean:218

Maximal absolute risk is the extended-real supremum across the complete law class.

Definition (Lean source)
n :
ℕ
shared
T :
Kernel (Dataset n) ℝ
worstRisk n T :
ℝ≥0∞
⨆ P, ⨆ (_ : CompleteModel P), scalarRisk n T P
CausalSmith.Stat.PrivateCateRoughdesign.worstRisk · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Basic.lean:222

Maximal expected length is the extended-real supremum across the complete law class.

Definition (Lean source)
n :
ℕ
shared
worstLength n I :
ℝ≥0∞
⨆ P, ⨆ (_ : CompleteModel P), expectedLength n I P
CausalSmith.Stat.PrivateCateRoughdesign.worstLength · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Basic.lean:225
def nonprivateMinimaxRisk

The same absolute-risk criterion without a privacy restriction.

Definition (Lean source)
n :
ℕ
shared
nonprivateMinimaxRisk n :
ℝ≥0∞
⨅ (T : Kernel (Dataset n) ℝ) (_ : IsMarkovKernel T), worstRisk n T
CausalSmith.Stat.PrivateCateRoughdesign.nonprivateMinimaxRisk · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Basic.lean:228
def privateMinimaxRisk Definition 11 in the paper ↗

Private minimax absolute risk takes the infimum of maximal risk over all total private Markov scalar releases.

Definition (Lean source)
n :
ℕ
shared
epsilon :
ℝ
shared
privateMinimaxRisk n epsilon :
ℝ≥0∞
⨅ (T : Kernel (Dataset n) ℝ) (_ : IsMarkovKernel T ∧ PrivateKernel n epsilon T), worstRisk n T
CausalSmith.Stat.PrivateCateRoughdesign.privateMinimaxRisk · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Basic.lean:233
def privateHonestLength Definition 13 in the paper ↗

The honest private length frontier takes the infimum of maximal expected length over private Markov interval releases with class-wide coverage at least nine tenths.

Definition (Lean source)
n :
ℕ
shared
epsilon :
ℝ
shared
privateHonestLength n epsilon :
ℝ≥0∞
⨅ (I : Kernel (Dataset n) IntervalCode) (_ : IsMarkovKernel I ∧ PrivateKernel n epsilon I ∧ ∀ P, CompleteModel P → 9/10 ≤ coverage n I P), worstLength n I
CausalSmith.Stat.PrivateCateRoughdesign.privateHonestLength · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Basic.lean:241

Boucheron, Lugosi and Massart (2013), Theorem 3.1, printed p.54, replacement-copy form. Source: https://math.hse.ru/data/2016/11/24/1113029206/Concentration%20inequalities.pdf DOI: 10.1093/acprof:oso/9780199535255.001.0001. This published claim is an assumed gate.

Definition (Lean source)
EfronSteinReplacement :
Sort 0
∀ (s : ℕ) (E : Fin s → Type) (mE : ∀ i, MeasurableSpace (E i)) (μ : ∀ i, @Measure (E i) (mE i))
if
letI : ∀ i, MeasurableSpace (E i) := mE ∀ (_ : ∀ i, IsProbabilityMeasure (μ i)) (Ψ : (∀ i, E i) → ℝ), Measurable Ψ
and
MemLp Ψ 2 (Measure.pi μ)
then
variance Ψ (Measure.pi μ)
≤ 1/2 * ∑ i : Fin s, ∫ zz, (Ψ zz.1 - Ψ (update zz.1 i zz.2)) ^ 2 ∂((Measure.pi μ).prod (μ i))
CausalSmith.Stat.PrivateCateRoughdesign.EfronSteinReplacement · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Basic.lean:248

Boucheron, Lugosi and Massart (2013), Theorem 6.2, displayed log-mgf bound in the proof, printed p.167. Source: https://math.hse.ru/data/2016/11/24/1113029206/Concentration%20inequalities.pdf . DOI: 10.1093/acprof:oso/9780199535255.001.0001. Positive parameters are exponentiated and the zero parameter is included by equality. This is an assumed gate.

Definition (Lean source)
BoundedDifferencesMGF :
Sort 0
∀ (s : ℕ) (E : Fin s → Type) (mE : ∀ i, MeasurableSpace (E i)) (μ : ∀ i, @Measure (E i) (mE i)),
letI : ∀ i, MeasurableSpace (E i) := mE ∀ (_ : ∀ i, IsProbabilityMeasure (μ i)) (Ψ : (∀ i, E i) → ℝ), Measurable Ψ → (∃ C : ℝ, ∀ z, |Ψ z| ≤ C) → ∀ c : Fin s → ℝ, (∀ i, 0 ≤ c i) → (∀ i z b, |Ψ z - Ψ (update z i b)| ≤ c i) → ∀ u : ℝ, 0
≤ u → (∫ z, exp (u * (Ψ z - ∫ w, Ψ w ∂Measure.pi μ)) ∂Measure.pi μ) ≤ exp (u^2 / 8 * ∑ i, (c i)^2)
CausalSmith.Stat.PrivateCateRoughdesign.BoundedDifferencesMGF · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Basic.lean:261

Keller and Trotter (2017), Applied Combinatorics, Section 5.6, Theorem 5.40. Source: https://appliedcombinatorics.org/book/s_graphs_counting-trees.html . Nat.card counts the finite subtype of undirected labeled trees. This is an assumed gate.

Definition (Lean source)
CayleyLabeledTreeCount :
Sort 0
∀ s : ℕ
if
2 ≤ s
then
card {G : SimpleGraph (Fin s) // G.IsTree} = s^(s-2)
CausalSmith.Stat.PrivateCateRoughdesign.CayleyLabeledTreeCount · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Basic.lean:278
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.BinaryExchangeability 4 declarations Conditional exchangeability of the explicit independent Bernoulli construction.

Conditional exchangeability of the explicit independent Bernoulli construction.

Density coordinates are sent to full records by selecting the observed outcome.

Definition (Lean source)
binaryRecordOfDensity z :
(z.2.2, z.1, z.2.1, if z.1 then z.2.1.2 else z.2.1.1)
theorem measurable_binaryRecordOfDensity

The consistency selection map is measurable. The displayed conclusion follows.

Formal statement
Proof (Lean source)
-- @node: measurable_binaryRecordOfDensity @[fun_prop] lemma measurable_binaryRecordOfDensity : Measurable binaryRecordOfDensity := by unfold binaryRecordOfDensity have hy : Measurable (fun z : DensityCoord Covariate => if z.1 then z.2.1.2 else z.2.1.1) := Measurable.ite (measurable_fst (MeasurableSet.singleton true)) (by fun_prop) (by fun_prop) exact measurable_snd.snd.prodMk (measurable_fst.prodMk (measurable_snd.fst.prodMk hy))
CausalSmith.Stat.PrivateCateRoughdesign.measurable_binaryRecordOfDensity · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/BinaryExchangeability.lean:17
theorem binaryLaw_eq_map_densityLaw

The paper's finite conditional law is the pushforward of the library's product density law. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
a b c :
Covariate → ℝ
ha :
hb :
hc :
Proof (Lean source)
-- @node: binaryLaw_eq_map_densityLaw lemma binaryLaw_eq_map_densityLaw (a b c : Covariate → ℝ) (ha : Measurable a) (hb : Measurable b) (hc : Measurable c) : binaryLaw a b c = (densityLaw volume a b c).map binaryRecordOfDensity := by classical have hbit (p : Covariate → ℝ) (hp : Measurable p) (f : DensityCoord Covariate → Bool) (hf : Measurable f) : Measurable (fun z : DensityCoord Covariate => bitMass (p z.2.2) (f z)) := by unfold bitMass exact Measurable.ite (hf (MeasurableSet.singleton true)) (hp.comp (by fun_prop)) (measurable_const.sub (hp.comp (by fun_prop))) have hd : Measurable (density a b c) := by unfold density tripleMass exact ENNReal.measurable_ofReal.comp (((hbit a ha _ (by fun_prop)).mul (hbit b hb _ (by fun_prop))).mul (hbit c hc _ (by fun_prop))) ext s hs have hpre : MeasurableSet (binaryRecordOfDensity ⁻¹' s) := measurable_binaryRecordOfDensity hs rw [binaryLaw, Measure.bind_apply hs (measurable_binaryRecordLaw a b c ha hb hc).aemeasurable, Measure.map_apply measurable_binaryRecordOfDensity hs, densityLaw, withDensity_apply _ (measurable_binaryRecordOfDensity hs), ← lintegral_indicator (measurable_binaryRecordOfDensity hs), reference, lintegral_prod_symm' _ (hd.indicator (measurable_binaryRecordOfDensity hs))] simp only [lintegral_count, tsum_fintype] rw [lintegral_prod_symm' _ (by fun_prop)] apply lintegral_congr intro x rw [lintegral_prod _ (by exact (measurable_of_finite _).aemeasurable)] simp only [lintegral_count, tsum_fintype, Measure.finsetSum_apply, Measure.smul_apply, Measure.dirac_apply' _ hs, smul_eq_mul, Fintype.sum_prod_type] simp only [Fintype.sum_bool, Set.indicator_apply, density, tripleMass, bitMass, bernoulliMass, binaryRecordOfDensity, Set.mem_preimage, Bool.false_eq_true, if_false, if_true, Pi.one_apply, mul_ite, mul_zero, mul_one] ac_rfl
CausalSmith.Stat.PrivateCateRoughdesign.binaryLaw_eq_map_densityLaw · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/BinaryExchangeability.lean:27
theorem binaryCausalLaw_exchangeability

Independent treatment and potential-outcome marks remain conditionally independent when the observed consistency outcome is appended to the record. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
a b c :
Covariate → ℝ
ha :
hb :
hc :
hr :
∀ x, a x ∈ Icc 0 1 ∧ b x ∈ Icc 0 1 ∧ c x ∈ Icc 0 1
Exchangeability (binaryCausalLaw a b c ha hb hc hr)
Proof (Lean source)
-- @node: binaryCausalLaw_exchangeability lemma binaryCausalLaw_exchangeability (a b c : Covariate → ℝ) (ha : Measurable a) (hb : Measurable b) (hc : Measurable c) (hr : ∀ x, a x ∈ Icc 0 1 ∧ b x ∈ Icc 0 1 ∧ c x ∈ Icc 0 1) : Exchangeability (binaryCausalLaw a b c ha hb hc hr) := by letI : IsProbabilityMeasure (densityLaw volume a b c) := densityLaw_probability volume a b c ha hb hc (fun x => (hr x).1) (fun x => (hr x).2.1) (fun x => (hr x).2.2) letI : IsProbabilityMeasure ((densityLaw volume a b c).map binaryRecordOfDensity) := Measure.isProbabilityMeasure_map measurable_binaryRecordOfDensity.aemeasurable letI : IsProbabilityMeasure (binaryLaw a b c) := binaryLaw_probability a b c ha hb hc hr have hind : CondIndepFun (comap X inferInstance) measurable_X.comap_le Ypot A ((densityLaw volume a b c).map binaryRecordOfDensity) := by apply condIndepFun_of_map measurable_binaryRecordOfDensity (by unfold Ypot; fun_prop) (by unfold A; fun_prop) measurable_X exact (densityLaw_condIndepFun volume a b c ha hb hc (fun x => (hr x).1) (fun x => (hr x).2.1) (fun x => (hr x).2.2)).symm simpa only [Exchangeability, binaryCausalLaw, ← binaryLaw_eq_map_densityLaw a b c ha hb hc] using hind
CausalSmith.Stat.PrivateCateRoughdesign.binaryCausalLaw_exchangeability · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/BinaryExchangeability.lean:65
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.BinaryLaw 26 declarations Uniform-design binary causal laws and their conditional regression identities.

Uniform-design binary causal laws and their conditional regression identities.

def bernoulliMass

The binary probability mass is the specified success probability for one and its complement for zero.

Definition (Lean source)
p :
ℝ
b :
bernoulliMass p b :
ℝ
if b then p else 1-p

A valid Bernoulli parameter gives nonnegative mass to either binary outcome. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
p :
ℝ
hp :
p ∈ Icc 0 1
z :
0 ≤ bernoulliMass p z
Proof (Lean source)
-- @node: bernoulliMass_nonneg lemma bernoulliMass_nonneg {p : ℝ} (hp : p ∈ Icc 0 1) (z : Bool) : 0 ≤ bernoulliMass p z := by cases z <;> simp only [bernoulliMass, Bool.false_eq_true, if_false, if_true] · linarith [hp.2] · exact hp.1
CausalSmith.Stat.PrivateCateRoughdesign.bernoulliMass_nonneg · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/BinaryLaw.lean:14

The two nonnegative Bernoulli masses add to one in extended real arithmetic. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
p :
ℝ
hp :
p ∈ Icc 0 1
∑ z : Bool, ofReal (bernoulliMass p z) = 1
Proof (Lean source)
-- @node: bernoulliMass_sum lemma bernoulliMass_sum {p : ℝ} (hp : p ∈ Icc 0 1) : ∑ z : Bool, ofReal (bernoulliMass p z) = 1 := by rw [Fintype.sum_bool, ← ENNReal.ofReal_add (bernoulliMass_nonneg hp true) (bernoulliMass_nonneg hp false)] simp [bernoulliMass]
CausalSmith.Stat.PrivateCateRoughdesign.bernoulliMass_sum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/BinaryLaw.lean:22
theorem bernoulliTripleMass_sum Lemma bernoulliTripleMass_sum in the paper ↗

Three independent valid Bernoulli masses have unit total mass. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
a b c :
ℝ
ha :
a ∈ Icc 0 1
hb :
b ∈ Icc 0 1
hc :
c ∈ Icc 0 1
∑ z : Bool × Bool × Bool, ofReal (bernoulliMass a z.1 * bernoulliMass b z.2.1 * bernoulliMass c z.2.2)
= 1
Proof (Lean source)
-- @node: bernoulliTripleMass_sum lemma bernoulliTripleMass_sum {a b c : ℝ} (ha : a ∈ Icc 0 1) (hb : b ∈ Icc 0 1) (hc : c ∈ Icc 0 1) : ∑ z : Bool × Bool × Bool, ofReal (bernoulliMass a z.1 * bernoulliMass b z.2.1 * bernoulliMass c z.2.2) = 1 := by have hn (z : Bool × Bool × Bool) : ofReal (bernoulliMass a z.1 * bernoulliMass b z.2.1 * bernoulliMass c z.2.2) = ofReal (bernoulliMass a z.1) * ofReal (bernoulliMass b z.2.1) * ofReal (bernoulliMass c z.2.2) := by rw [ENNReal.ofReal_mul (mul_nonneg (bernoulliMass_nonneg ha _) (bernoulliMass_nonneg hb _)), ENNReal.ofReal_mul (bernoulliMass_nonneg ha _)] simp_rw [hn, Fintype.sum_prod_type, ← Finset.mul_sum, bernoulliMass_sum hc, mul_one, ← Finset.mul_sum, bernoulliMass_sum hb, mul_one, bernoulliMass_sum ha]
CausalSmith.Stat.PrivateCateRoughdesign.bernoulliTripleMass_sum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/BinaryLaw.lean:30
def binaryLaw

A uniform covariate draw is followed by independent Bernoulli treatment and potential outcomes and the consistency observation map.

Definition (Lean source)
a b c :
Covariate → ℝ
binaryLaw a b c :
(volume : Measure Covariate).bind (fun x => ∑ z : Bool × Bool × Bool, ofReal (bernoulliMass (a x) z.1 * bernoulliMass (b x) z.2.1 * bernoulliMass (c x) z.2.2) • Measure.dirac (x, z.1, (z.2.1,z.2.2), if z.1 then z.2.2 else z.2.1))
theorem measurable_binaryRecordLaw Lemma measurable_binaryRecordLaw in the paper ↗

The finite conditional Bernoulli record law varies measurably with the covariate. the asserted conclusion follows.

Formal statement
a :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
b :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
c :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
ha :
shared
hb :
shared
hc :
shared
Measurable (fun x : Covariate => ∑ z : Bool × Bool × Bool, ofReal (bernoulliMass (a x) z.1 * bernoulliMass (b x) z.2.1 * bernoulliMass (c x) z.2.2) • Measure.dirac (x, z.1, (z.2.1,z.2.2), if z.1 then z.2.2 else z.2.1))
Proof (Lean source)
-- @node: measurable_binaryRecordLaw lemma measurable_binaryRecordLaw : Measurable (fun x : Covariate => ∑ z : Bool × Bool × Bool, ofReal (bernoulliMass (a x) z.1 * bernoulliMass (b x) z.2.1 * bernoulliMass (c x) z.2.2) • Measure.dirac (x, z.1, (z.2.1,z.2.2), if z.1 then z.2.2 else z.2.1)) := by apply Measure.measurable_of_measurable_coe intro s hs simp only [Measure.finsetSum_apply, Measure.smul_apply, smul_eq_mul] apply Finset.measurable_fun_sum intro z hz apply mul · unfold bernoulliMass cases z.1 <;> cases z.2.1 <;> cases z.2.2 <;> simp only [if_true, if_false, Bool.false_eq_true] <;> fun_prop · exact (Measure.measurable_coe hs).comp (Measure.measurable_dirac.comp (by fun_prop))
CausalSmith.Stat.PrivateCateRoughdesign.measurable_binaryRecordLaw · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/BinaryLaw.lean:62

The finite Bernoulli construction is a probability law for measurable probability-valued parameters. the asserted conclusion follows.

Formal statement
a :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
b :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
c :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
ha :
shared
hb :
shared
hc :
shared
hr :
∀ (x : ↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate),
a x ∈ Icc 0 1 ∧ b x ∈ Icc 0 1 ∧ c x ∈ Icc 0 1
shared
Proof (Lean source)
-- @node: binaryLaw_probability lemma binaryLaw_probability : IsProbabilityMeasure (binaryLaw a b c) := by rw [isProbabilityMeasure_iff, binaryLaw, Measure.bind_apply MeasurableSet.univ] · have hm : ∀ x : Covariate, (∑ z : Bool × Bool × Bool, ofReal (bernoulliMass (a x) z.1 * bernoulliMass (b x) z.2.1 * bernoulliMass (c x) z.2.2) • Measure.dirac (x, z.1, (z.2.1,z.2.2), if z.1 then z.2.2 else z.2.1)) univ = 1 := by intro x simp only [Measure.finsetSum_apply, Measure.smul_apply, Measure.dirac_apply_of_mem (Set.mem_univ _), smul_eq_mul, mul_one] exact bernoulliTripleMass_sum (hr x).1 (hr x).2.1 (hr x).2.2 simp_rw [hm] simp · exact (measurable_binaryRecordLaw a b c ha hb hc).aemeasurable
CausalSmith.Stat.PrivateCateRoughdesign.binaryLaw_probability · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/BinaryLaw.lean:81

The finite Bernoulli construction has the uniform design density. the asserted conclusion follows.

Formal statement
a :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
b :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
c :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
ha :
shared
hb :
shared
hc :
shared
hr :
∀ (x : ↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate),
a x ∈ Icc 0 1 ∧ b x ∈ Icc 0 1 ∧ c x ∈ Icc 0 1
shared
(binaryLaw a b c).map X = volume
Proof (Lean source)
-- @node: binaryLaw_design lemma binaryLaw_design : (binaryLaw a b c).map X = volume := by classical ext s hs rw [Measure.map_apply measurable_X hs, binaryLaw, Measure.bind_apply (measurable_X hs) (measurable_binaryRecordLaw a b c ha hb hc).aemeasurable] have hm : ∀ x : Covariate, (∑ z : Bool × Bool × Bool, ofReal (bernoulliMass (a x) z.1 * bernoulliMass (b x) z.2.1 * bernoulliMass (c x) z.2.2) • Measure.dirac (x, z.1, (z.2.1,z.2.2), if z.1 then z.2.2 else z.2.1)) (X ⁻¹' s) = s.indicator (fun _ => (1 : ℝ≥0∞)) x := by intro x simp only [Measure.finsetSum_apply, Measure.smul_apply, Measure.dirac_apply' _ (measurable_X hs), Set.indicator_apply, Set.mem_preimage, X, smul_eq_mul, Pi.one_apply] change (∑ z : Bool × Bool × Bool, ofReal (bernoulliMass (a x) z.1 * bernoulliMass (b x) z.2.1 * bernoulliMass (c x) z.2.2) * (if x ∈ s then 1 else 0)) = s.indicator (fun _ => (1 : ℝ≥0∞)) x by_cases hx : x ∈ s · simp only [hx, if_true, mul_one, Set.indicator_of_mem hx] exact bernoulliTripleMass_sum (hr x).1 (hr x).2.1 (hr x).2.2 · simp [hx] simp_rw [hm] simp [hs]
CausalSmith.Stat.PrivateCateRoughdesign.binaryLaw_design · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/BinaryLaw.lean:100
theorem binaryLaw_density_version Lemma binaryLaw_density_version in the paper ↗

The uniform design has the selected constant density one. The displayed conclusion follows.

Formal statement
a :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
b :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
c :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
ha :
shared
hb :
shared
hc :
shared
hr :
∀ (x : ↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate),
a x ∈ Icc 0 1 ∧ b x ∈ Icc 0 1 ∧ c x ∈ Icc 0 1
shared
(binaryLaw a b c).map X ≪ volume
(binaryLaw a b c).map X = volume.withDensity (fun _ => ofReal (1 : ℝ))
Proof (Lean source)
-- @node: binaryLaw_density_version lemma binaryLaw_density_version : (binaryLaw a b c).map X ≪ volume → (binaryLaw a b c).map X = volume.withDensity (fun _ => ofReal (1 : ℝ)) := by intro _ simpa using binaryLaw_design a b c ha hb hc hr
CausalSmith.Stat.PrivateCateRoughdesign.binaryLaw_density_version · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/BinaryLaw.lean:130

The selected propensity is integrable under the constructed design marginal. the asserted conclusion follows.

Formal statement
a :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
b :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
c :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
ha :
shared
hb :
shared
hc :
shared
hr :
∀ (x : ↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate),
a x ∈ Icc 0 1 ∧ b x ∈ Icc 0 1 ∧ c x ∈ Icc 0 1
shared
Integrable a ((binaryLaw a b c).map X)
Proof (Lean source)
-- @node: binaryLaw_e_integrable lemma binaryLaw_e_integrable : Integrable a ((binaryLaw a b c).map X) := by let := binaryLaw_probability a b c ha hb hc hr apply Integrable.of_mem_Icc 0 1 (by fun_prop) exact ae_of_all _ (fun x => (hr x).1)
CausalSmith.Stat.PrivateCateRoughdesign.binaryLaw_e_integrable · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/BinaryLaw.lean:137
theorem binaryLaw_mu0_integrable Lemma binaryLaw_mu0_integrable in the paper ↗

The selected control mean is integrable under the constructed control-arm covariate measure. the asserted conclusion follows.

Formal statement
a :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
b :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
c :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
ha :
shared
hb :
shared
hc :
shared
hr :
∀ (x : ↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate),
a x ∈ Icc 0 1 ∧ b x ∈ Icc 0 1 ∧ c x ∈ Icc 0 1
shared
Integrable b (((binaryLaw a b c).restrict {z | A z = false}).map X)
Proof (Lean source)
-- @node: binaryLaw_mu0_integrable lemma binaryLaw_mu0_integrable : Integrable b (((binaryLaw a b c).restrict {z | A z = false}).map X) := by let := binaryLaw_probability a b c ha hb hc hr apply Integrable.of_mem_Icc 0 1 (by fun_prop) exact ae_of_all _ (fun x => (hr x).2.1)
CausalSmith.Stat.PrivateCateRoughdesign.binaryLaw_mu0_integrable · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/BinaryLaw.lean:144
theorem binaryLaw_mu1_integrable Lemma binaryLaw_mu1_integrable in the paper ↗

The selected treated mean is integrable under the constructed treated-arm covariate measure. the asserted conclusion follows.

Formal statement
a :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
b :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
c :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
ha :
shared
hb :
shared
hc :
shared
hr :
∀ (x : ↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate),
a x ∈ Icc 0 1 ∧ b x ∈ Icc 0 1 ∧ c x ∈ Icc 0 1
shared
Integrable c (((binaryLaw a b c).restrict {z | A z = true}).map X)
Proof (Lean source)
-- @node: binaryLaw_mu1_integrable lemma binaryLaw_mu1_integrable : Integrable c (((binaryLaw a b c).restrict {z | A z = true}).map X) := by let := binaryLaw_probability a b c ha hb hc hr apply Integrable.of_mem_Icc 0 1 (by fun_prop) exact ae_of_all _ (fun x => (hr x).2.2)
CausalSmith.Stat.PrivateCateRoughdesign.binaryLaw_mu1_integrable · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/BinaryLaw.lean:152

The constructed propensity satisfies the conditional probability identity on every measurable covariate set. the asserted conclusion follows.

Formal statement
a :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
b :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
c :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
ha :
shared
hb :
shared
hc :
shared
hr :
∀ (x : ↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate),
a x ∈ Icc 0 1 ∧ b x ∈ Icc 0 1 ∧ c x ∈ Icc 0 1
shared
s :
Set ↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate
shared
∫ x in s, a x ∂((binaryLaw a b c).map X)
= (binaryLaw a b c).real {z | X z ∈ s ∧ A z = true}
Proof (Lean source)
-- @node: binaryLaw_e_version lemma binaryLaw_e_version : ∀ s : Set Covariate, MeasurableSet s → ∫ x in s, a x ∂((binaryLaw a b c).map X) = (binaryLaw a b c).real {z | X z ∈ s ∧ A z = true} := by classical intro s hs have hset : MeasurableSet {z : Record | X z ∈ s ∧ A z = true} := by apply MeasurableSet.inter (measurable_X hs) exact measurableSet_eq_fun (by unfold A; fun_prop) measurable_const rw [binaryLaw_design a b c ha hb hc hr, integral_eq_lintegral_of_nonneg_ae (ae_of_all _ (fun x => (hr x).1.1)) ha.aestronglyMeasurable, measureReal_def, binaryLaw, Measure.bind_apply hset (measurable_binaryRecordLaw a b c ha hb hc).aemeasurable] congr 1 have hm : ∀ x : Covariate, (∑ z : Bool × Bool × Bool, ofReal (bernoulliMass (a x) z.1 * bernoulliMass (b x) z.2.1 * bernoulliMass (c x) z.2.2) • Measure.dirac (x, z.1, (z.2.1,z.2.2), if z.1 then z.2.2 else z.2.1)) {z | X z ∈ s ∧ A z = true} = s.indicator (fun x => ofReal (a x)) x := by intro x simp only [Measure.finsetSum_apply, Measure.smul_apply, Measure.dirac_apply' _ hset, smul_eq_mul] by_cases hx : x ∈ s · have ha0 := (hr x).1.1 have hb0 := (hr x).2.1.1 have hc0 := (hr x).2.2.1 have hb1 : 0 ≤ 1 - b x := sub_nonneg.mpr (hr x).2.1.2 have hc1 : 0 ≤ 1 - c x := sub_nonneg.mpr (hr x).2.2.2 simp only [Fintype.sum_prod_type, Fintype.sum_bool, bernoulliMass, X, A, Set.indicator_apply, Pi.one_apply, Set.mem_setOf_eq, hx, Bool.false_eq_true, and_false, and_true, if_true, if_false, Set.indicator_of_mem hx, mul_one, mul_zero, add_zero, zero_add, Set.mem_setOf_eq] rw [← ENNReal.ofReal_add (by positivity) (by positivity)] rw [← ENNReal.ofReal_add (by positivity) (by positivity)] rw [← ENNReal.ofReal_add (by positivity) (by positivity)] congr 1 ring · simp [X, A, hx, Set.indicator_of_notMem hx] simp_rw [hm] rw [lintegral_indicator hs]
CausalSmith.Stat.PrivateCateRoughdesign.binaryLaw_e_version · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/BinaryLaw.lean:160

Integration under the generated record law is integration of the finite conditional masses. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
a :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
b :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
c :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
ha :
shared
hb :
shared
hc :
shared
f :
Record → ℝ≥0∞
hf :
∫⁻ z, f z ∂binaryLaw a b c
= ∫⁻ x : Covariate, ∑ z : Bool × Bool × Bool, ofReal (bernoulliMass (a x) z.1 * bernoulliMass (b x) z.2.1 * bernoulliMass (c x) z.2.2) * f (x, z.1, (z.2.1, z.2.2), if z.1 then z.2.2 else z.2.1)
Proof (Lean source)
-- @node: binaryLaw_lintegral lemma binaryLaw_lintegral (f : Record → ℝ≥0∞) (hf : Measurable f) : ∫⁻ z, f z ∂binaryLaw a b c = ∫⁻ x : Covariate, ∑ z : Bool × Bool × Bool, ofReal (bernoulliMass (a x) z.1 * bernoulliMass (b x) z.2.1 * bernoulliMass (c x) z.2.2) * f (x, z.1, (z.2.1, z.2.2), if z.1 then z.2.2 else z.2.1) := by rw [binaryLaw, Measure.lintegral_bind (measurable_binaryRecordLaw a b c ha hb hc).aemeasurable hf.aemeasurable] simp only [lintegral_finsetSum_measure, lintegral_smul_measure, lintegral_dirac, smul_eq_mul]
CausalSmith.Stat.PrivateCateRoughdesign.binaryLaw_lintegral · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/BinaryLaw.lean:206

In each arm, the conditional mean of the observed binary response is its Bernoulli parameter. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
a :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
b :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
c :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
ha :
shared
hb :
shared
hc :
shared
hr :
∀ (x : ↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate),
a x ∈ Icc 0 1 ∧ b x ∈ Icc 0 1 ∧ c x ∈ Icc 0 1
shared
arm :
hs :
∫ x in s, (if arm then c x else b x) ∂(((binaryLaw a b c).restrict {z | A z = arm}).map X)
= ∫ z in {z | X z ∈ s ∧ A z = arm}, bit (Y z) ∂binaryLaw a b c
Proof (Lean source)
-- @node: binaryLaw_arm_version lemma binaryLaw_arm_version (arm : Bool) (s : Set Covariate) (hs : MeasurableSet s) : ∫ x in s, (if arm then c x else b x) ∂(((binaryLaw a b c).restrict {z | A z = arm}).map X) = ∫ z in {z | X z ∈ s ∧ A z = arm}, bit (Y z) ∂binaryLaw a b c := by classical have hm : Measurable (fun x => if arm then c x else b x) := by cases arm <;> simp <;> fun_prop have ht : MeasurableSet {z : Record | A z = arm} := by exact measurableSet_eq_fun (by unfold A; fun_prop) measurable_const have hset : MeasurableSet {z : Record | X z ∈ s ∧ A z = arm} := (measurable_X hs).inter ht rw [setIntegral_map hs hm.aestronglyMeasurable measurable_X.aemeasurable, Measure.restrict_restrict (measurable_X hs)] change (∫ z in {z | X z ∈ s ∧ A z = arm}, (if arm then c (X z) else b (X z)) ∂binaryLaw a b c) = _ have hmy : Measurable (fun z : Record => bit (Y z)) := by exact (by fun_prop : Measurable bit).comp (by unfold Y; fun_prop) have hmf : Measurable (fun z : Record => if arm then c (X z) else b (X z)) := hm.comp measurable_X rw [integral_eq_lintegral_of_nonneg_ae (ae_of_all _ (fun z => by cases arm · exact (hr (X z)).2.1.1 · exact (hr (X z)).2.2.1)) hmf.aestronglyMeasurable, integral_eq_lintegral_of_nonneg_ae (ae_of_all _ (fun z => by unfold bit; split <;> norm_num)) hmy.aestronglyMeasurable, ← lintegral_indicator hset, ← lintegral_indicator hset] congr 1 rw [binaryLaw_lintegral a b c ha hb hc (fun z => {z | X z ∈ s ∧ A z = arm}.indicator (fun z => ofReal (if arm then c (X z) else b (X z))) z) (by simpa only [Function.comp_def] using (ENNReal.measurable_ofReal.comp hmf).indicator hset), binaryLaw_lintegral a b c ha hb hc (fun z => {z | X z ∈ s ∧ A z = arm}.indicator (fun z => ofReal (bit (Y z))) z) (by simpa only [Function.comp_def] using (ENNReal.measurable_ofReal.comp hmy).indicator hset)] apply lintegral_congr intro x have ha0 := (hr x).1.1 have hb0 := (hr x).2.1.1 have hc0 := (hr x).2.2.1 have ha1 : 0 ≤ 1 - a x := sub_nonneg.mpr (hr x).1.2 have hb1 : 0 ≤ 1 - b x := sub_nonneg.mpr (hr x).2.1.2 have hc1 : 0 ≤ 1 - c x := sub_nonneg.mpr (hr x).2.2.2 by_cases hx : x ∈ s · cases arm <;> simp only [Fintype.sum_prod_type, Fintype.sum_bool, Set.indicator_apply, Set.mem_setOf_eq, bernoulliMass, X, A, Y, bit, hx, and_true, and_false, Bool.false_eq_true, if_true, if_false, ENNReal.ofReal_one, ENNReal.ofReal_zero, mul_one, mul_zero, zero_add, add_zero] all_goals try simp only [Bool.true_eq_false, and_false, if_false, mul_zero, zero_add] repeat rw [← ENNReal.ofReal_mul (by positivity)] repeat rw [← ENNReal.ofReal_add (by positivity) (by positivity)] congr 1 ring · simp [Set.indicator_apply, X, A, hx]
CausalSmith.Stat.PrivateCateRoughdesign.binaryLaw_arm_version · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/BinaryLaw.lean:220

The constructed control regression satisfies the conditional mean identity on every measurable covariate set. the asserted conclusion follows.

Formal statement
a :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
b :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
c :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
ha :
shared
hb :
shared
hc :
shared
hr :
∀ (x : ↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate),
a x ∈ Icc 0 1 ∧ b x ∈ Icc 0 1 ∧ c x ∈ Icc 0 1
shared
s :
Set ↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate
shared
∫ x in s, b x ∂(((binaryLaw a b c).restrict {z | A z = false}).map X)
= ∫ z in {z | X z ∈ s ∧ A z = false}, bit (Y z) ∂binaryLaw a b c
Proof (Lean source)
-- @node: binaryLaw_mu0_version lemma binaryLaw_mu0_version : ∀ s : Set Covariate, MeasurableSet s → ∫ x in s, b x ∂(((binaryLaw a b c).restrict {z | A z = false}).map X) = ∫ z in {z | X z ∈ s ∧ A z = false}, bit (Y z) ∂binaryLaw a b c := by intro s hs exact binaryLaw_arm_version a b c ha hb hc hr false s hs
CausalSmith.Stat.PrivateCateRoughdesign.binaryLaw_mu0_version · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/BinaryLaw.lean:285

The constructed treated regression satisfies the conditional mean identity on every measurable covariate set. the asserted conclusion follows.

Formal statement
a :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
b :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
c :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
ha :
shared
hb :
shared
hc :
shared
hr :
∀ (x : ↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate),
a x ∈ Icc 0 1 ∧ b x ∈ Icc 0 1 ∧ c x ∈ Icc 0 1
shared
s :
Set ↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate
shared
∫ x in s, c x ∂(((binaryLaw a b c).restrict {z | A z = true}).map X)
= ∫ z in {z | X z ∈ s ∧ A z = true}, bit (Y z) ∂binaryLaw a b c
Proof (Lean source)
-- @node: binaryLaw_mu1_version lemma binaryLaw_mu1_version : ∀ s : Set Covariate, MeasurableSet s → ∫ x in s, c x ∂(((binaryLaw a b c).restrict {z | A z = true}).map X) = ∫ z in {z | X z ∈ s ∧ A z = true}, bit (Y z) ∂binaryLaw a b c := by intro s hs exact binaryLaw_arm_version a b c ha hb hc hr true s hs
CausalSmith.Stat.PrivateCateRoughdesign.binaryLaw_mu1_version · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/BinaryLaw.lean:294
def binaryCausalLaw

The finite Bernoulli product followed by consistency gives a concrete causal-law bundle.

Definition (Lean source)
a :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
b :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
c :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
ha :
shared
hb :
shared
hc :
shared
hr :
∀ (x : ↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate),
a x ∈ Icc 0 1 ∧ b x ∈ Icc 0 1 ∧ c x ∈ Icc 0 1
shared
binaryCausalLaw a b c ha hb hc hr :
clause 1
law := binaryLaw a b c
clause 2
probability := binaryLaw_probability a b c ha hb hc hr
clause 3
f := fun _ => 1
clause 4
e := a
clause 5
mu0 := b
clause 6
mu1 := c
clause 7
f_measurable := measurable_const
clause 8
e_measurable := ha
clause 9
mu0_measurable := hb
clause 10
mu1_measurable := hc
clause 11
density_version := binaryLaw_density_version a b c ha hb hc hr
clause 12
e_integrable := binaryLaw_e_integrable a b c ha hb hc hr
clause 13
mu0_integrable := binaryLaw_mu0_integrable a b c ha hb hc hr
clause 14
mu1_integrable := binaryLaw_mu1_integrable a b c ha hb hc hr
clause 15
e_version := binaryLaw_e_version a b c ha hb hc hr
clause 16
mu0_version := binaryLaw_mu0_version a b c ha hb hc hr
clause 17
mu1_version := binaryLaw_mu1_version a b c ha hb hc hr
theorem binaryCausalLaw_consistency

Every generated record uses the potential outcome selected by its treatment. the asserted conclusion follows.

Formal statement
a :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
b :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
c :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
ha :
shared
hb :
shared
hc :
shared
hr :
∀ (x : ↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate),
a x ∈ Icc 0 1 ∧ b x ∈ Icc 0 1 ∧ c x ∈ Icc 0 1
shared
Consistency (binaryCausalLaw a b c ha hb hc hr)
Proof (Lean source)
-- @node: binaryCausalLaw_consistency lemma binaryCausalLaw_consistency : Consistency (binaryCausalLaw a b c ha hb hc hr) := by classical change ∀ᵐ z ∂binaryLaw a b c, Y z = if A z then (Ypot z).2 else (Ypot z).1 rw [ae_iff] have hs : MeasurableSet {z : Record | ¬ (Y z = if A z then (Ypot z).2 else (Ypot z).1)} := by have hA : Measurable A := by unfold A; fun_prop have hY : Measurable Y := by unfold Y; fun_prop have hp0 : Measurable (fun z => (Ypot z).1) := by unfold Ypot; fun_prop have hp1 : Measurable (fun z => (Ypot z).2) := by unfold Ypot; fun_prop exact (measurableSet_eq_fun hY (hp1.ite (measurableSet_eq_fun hA measurable_const) hp0)).compl rw [binaryLaw, Measure.bind_apply hs (measurable_binaryRecordLaw a b c ha hb hc).aemeasurable] have hf : ∀ x : Covariate, (∑ z : Bool × Bool × Bool, ofReal (bernoulliMass (a x) z.1 * bernoulliMass (b x) z.2.1 * bernoulliMass (c x) z.2.2) • Measure.dirac (x, z.1, (z.2.1,z.2.2), if z.1 then z.2.2 else z.2.1)) {z : Record | ¬ (Y z = if A z then (Ypot z).2 else (Ypot z).1)} = 0 := by intro x simp only [Measure.finsetSum_apply, Measure.smul_apply, smul_eq_mul] apply Finset.sum_eq_zero intro z hz rw [Measure.dirac_apply' _ hs] simp only [Set.mem_setOf_eq, Y, A, Ypot] simp exact inr rfl simp_rw [hf] simp
CausalSmith.Stat.PrivateCateRoughdesign.binaryCausalLaw_consistency · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/BinaryLaw.lean:324
theorem binaryCausalLaw_densityBounds

The constructed law's selected density is one and its design is exactly uniform. The displayed conclusion follows.

Formal statement
a :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
b :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
c :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
ha :
shared
hb :
shared
hc :
shared
hr :
∀ (x : ↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate),
a x ∈ Icc 0 1 ∧ b x ∈ Icc 0 1 ∧ c x ∈ Icc 0 1
shared
DensityBounds (binaryCausalLaw a b c ha hb hc hr)
Proof (Lean source)
-- @node: binaryCausalLaw_densityBounds lemma binaryCausalLaw_densityBounds : DensityBounds (binaryCausalLaw a b c ha hb hc hr) := by constructor · change (binaryLaw a b c).map X ≪ volume rw [binaryLaw_design a b c ha hb hc hr] · filter_upwards with x change (1 / 2 : ℝ) ≤ 1 ∧ (1 : ℝ) ≤ 3 / 2 norm_num
CausalSmith.Stat.PrivateCateRoughdesign.binaryCausalLaw_densityBounds · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/BinaryLaw.lean:357
theorem binaryCausalLaw_completeModel

Analytic regularity and conditional exchangeability complete the binary law's model certificate; consistency and the uniform density follow from its construction. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
a :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
b :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
c :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate → ℝ
shared
ha :
shared
hb :
shared
hc :
shared
hr :
∀ (x : ↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate),
a x ∈ Icc 0 1 ∧ b x ∈ Icc 0 1 ∧ c x ∈ Icc 0 1
shared
hex :
Exchangeability (binaryCausalLaw a b c ha hb hc hr)
hov :
∀ x, 1 / 4 ≤ a x ∧ a x ≤ 3 / 4
haH :
∀ x y, |a x - a y| ≤ L * |(x : ℝ) - y| ^ (1/10 : ℝ)
hbH :
∀ x y, |b x - b y| ≤ L * |(x : ℝ) - y| ^ (1/10 : ℝ)
htL :
∀ x y, |(c x - b x) - (c y - b y)| ≤ L * |(x : ℝ) - y|
CompleteModel (binaryCausalLaw a b c ha hb hc hr)
Proof (Lean source)
-- @node: binaryCausalLaw_completeModel lemma binaryCausalLaw_completeModel (hex : Exchangeability (binaryCausalLaw a b c ha hb hc hr)) (hov : ∀ x, 1 / 4 ≤ a x ∧ a x ≤ 3 / 4) (haH : ∀ x y, |a x - a y| ≤ L * |(x : ℝ) - y| ^ (1/10 : ℝ)) (hbH : ∀ x y, |b x - b y| ≤ L * |(x : ℝ) - y| ^ (1/10 : ℝ)) (htL : ∀ x y, |(c x - b x) - (c y - b y)| ≤ L * |(x : ℝ) - y|) : CompleteModel (binaryCausalLaw a b c ha hb hc hr) := by exact ⟨binaryCausalLaw_consistency a b c ha hb hc hr, hex, binaryCausalLaw_densityBounds a b c ha hb hc hr, hov, haH, hbH, htL⟩
CausalSmith.Stat.PrivateCateRoughdesign.binaryCausalLaw_completeModel · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/BinaryLaw.lean:368
theorem binaryCausalLaw_observed_apply Lemma binaryCausalLaw_observed_apply in the paper ↗

An observed event under the binary construction integrates the four conditional mark masses; the unused potential outcome sums out exactly. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
a b c :
Covariate → ℝ
ha :
hb :
hc :
hr :
∀ x, a x ∈ Icc 0 1 ∧ b x ∈ Icc 0 1 ∧ c x ∈ Icc 0 1
s :
Set O
hs :
Pobs (binaryCausalLaw a b c ha hb hc hr) s
= ∫⁻ x : Covariate, ∑ z : Bool × Bool, ofReal (bernoulliMass (a x) z.1 * bernoulliMass (if z.1 then c x else b x) z.2) * s.indicator (fun _ => (1 : ℝ≥0∞)) (x, z.1, z.2)
Proof (Lean source)
-- @node: binaryCausalLaw_observed_apply lemma binaryCausalLaw_observed_apply (a b c : Covariate → ℝ) (ha : Measurable a) (hb : Measurable b) (hc : Measurable c) (hr : ∀ x, a x ∈ Icc 0 1 ∧ b x ∈ Icc 0 1 ∧ c x ∈ Icc 0 1) (s : Set O) (hs : MeasurableSet s) : Pobs (binaryCausalLaw a b c ha hb hc hr) s = ∫⁻ x : Covariate, ∑ z : Bool × Bool, ofReal (bernoulliMass (a x) z.1 * bernoulliMass (if z.1 then c x else b x) z.2) * s.indicator (fun _ => (1 : ℝ≥0∞)) (x, z.1, z.2) := by classical have hm : Measurable observe := by unfold observe X A Y; fun_prop change (binaryLaw a b c).map observe s = _ rw [Measure.map_apply hm hs, ← lintegral_indicator_one (hm hs)] rw [binaryLaw_lintegral a b c ha hb hc ((observe ⁻¹' s).indicator (1 : Record → ℝ≥0∞)) (measurable_const.indicator (hm hs))] apply lintegral_congr intro x have ha0 := (hr x).1.1 have hb0 := (hr x).2.1.1 have hc0 := (hr x).2.2.1 have ha1 : 0 ≤ 1 - a x := sub_nonneg.mpr (hr x).1.2 have hb1 : 0 ≤ 1 - b x := sub_nonneg.mpr (hr x).2.1.2 have hc1 : 0 ≤ 1 - c x := sub_nonneg.mpr (hr x).2.2.2 have hmass (av yv : Bool) : (∑ z : Bool, ofReal (bernoulliMass (a x) av * bernoulliMass (b x) z * bernoulliMass (c x) yv)) = ofReal (bernoulliMass (a x) av * bernoulliMass (c x) yv) := by cases av <;> cases yv <;> simp only [Fintype.sum_bool, bernoulliMass, Bool.false_eq_true, if_true, if_false] <;> rw [← ENNReal.ofReal_add (by positivity) (by positivity)] <;> congr 1 <;> ring have hmass' (av yv : Bool) : (∑ z : Bool, ofReal (bernoulliMass (a x) av * bernoulliMass (b x) yv * bernoulliMass (c x) z)) = ofReal (bernoulliMass (a x) av * bernoulliMass (b x) yv) := by cases av <;> cases yv <;> simp only [Fintype.sum_bool, bernoulliMass, Bool.false_eq_true, if_true, if_false] <;> rw [← ENNReal.ofReal_add (by positivity) (by positivity)] <;> congr 1 <;> ring simp only [Fintype.sum_prod_type, Fintype.sum_bool, Set.indicator_apply, Set.mem_preimage, observe, X, A, Y, Bool.false_eq_true, if_false, if_true, Pi.one_apply] have ht := hmass true true have ht' := hmass true false have hf := hmass' false true have hf' := hmass' false false simp only [Fintype.sum_bool, bernoulliMass, if_true, Bool.false_eq_true, if_false] at ht ht' hf hf' simp only [bernoulliMass, if_true, Bool.false_eq_true, if_false] calc _ = (ofReal (a x * b x * c x) + ofReal (a x * (1-b x) * c x)) * (if (x, true, true) ∈ s then 1 else 0) + (ofReal (a x * b x * (1-c x)) + ofReal (a x * (1-b x) * (1-c x))) * (if (x, true, false) ∈ s then 1 else 0) + (ofReal ((1-a x) * b x * c x) + ofReal ((1-a x) * b x * (1-c x))) * (if (x, false, true) ∈ s then 1 else 0) + (ofReal ((1-a x) * (1-b x) * c x) + ofReal ((1-a x) * (1-b x) * (1-c x))) * (if (x, false, false) ∈ s then 1 else 0) := by ring _ = _ := by rw [ht, ht', hf, hf']; ring
CausalSmith.Stat.PrivateCateRoughdesign.binaryCausalLaw_observed_apply · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/BinaryLaw.lean:381
theorem finite_product_measure_mono Lemma finite_product_measure_mono in the paper ↗

Coordinatewise measure domination is preserved by a finite product. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
ι :
Type*
ι → Type*
∀ i, MeasurableSpace (α i)
μ ν :
∀ i, Measure (α i)
hle :
∀ i, μ i ≤ ν i
Measure.pi μ ≤ Measure.pi ν
Proof (Lean source)
-- @node: finite_product_measure_mono lemma finite_product_measure_mono {ι : Type*} [Fintype ι] {α : ι → Type*} [∀ i, MeasurableSpace (α i)] (μ ν : ∀ i, Measure (α i)) (hle : ∀ i, μ i ≤ ν i) : Measure.pi μ ≤ Measure.pi ν := by apply Measure.le_iff.mpr intro s hs rw [Measure.pi, Measure.pi, toMeasure_apply _ _ hs, toMeasure_apply _ _ hs] have ho : OuterMeasure.pi (fun i => (μ i).toOuterMeasure) ≤ OuterMeasure.pi (fun i => (ν i).toOuterMeasure) := by apply OuterMeasure.le_pi.mpr intro t _ht exact (OuterMeasure.pi_pi_le _ _).trans (Finset.prod_le_prod' (fun i _ => hle i (t i))) exact ho s
CausalSmith.Stat.PrivateCateRoughdesign.finite_product_measure_mono · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/BinaryLaw.lean:443
theorem finite_product_measure_domination Lemma finite_product_measure_domination in the paper ↗

A common finite domination factor becomes its nth power for an n-record experiment. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
α :
μ ν :
c :
ℝ≥0∞
SigmaFinite (c • ν)
hle :
μ ≤ c • ν
Measure.pi (fun _ : Fin n => μ) ≤ c ^ n • Measure.pi (fun _ : Fin n => ν)
Proof (Lean source)
-- @node: finite_product_measure_domination lemma finite_product_measure_domination (n : ℕ) {α : Type*} [MeasurableSpace α] (μ ν : Measure α) [SigmaFinite ν] (c : ℝ≥0∞) [SigmaFinite (c • ν)] (hle : μ ≤ c • ν) : Measure.pi (fun _ : Fin n => μ) ≤ c ^ n • Measure.pi (fun _ : Fin n => ν) := by have heq : Measure.pi (fun _ : Fin n => c • ν) = c ^ n • Measure.pi (fun _ : Fin n => ν) := by apply Measure.pi_eq intro s hs rw [Measure.smul_apply, Measure.pi_pi] simp only [Measure.smul_apply, smul_eq_mul] rw [Finset.prod_mul_distrib] simp rw [← heq] exact finite_product_measure_mono _ _ (fun _ => hle)
CausalSmith.Stat.PrivateCateRoughdesign.finite_product_measure_domination · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/BinaryLaw.lean:460
theorem binaryLaw_fair_domination Lemma binaryLaw_fair_domination in the paper ↗

Every probability-valued binary construction is dominated by eight times the fair full-record law. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
a b c :
Covariate → ℝ
ha :
hb :
hc :
hr :
∀ x, a x ∈ Icc 0 1 ∧ b x ∈ Icc 0 1 ∧ c x ∈ Icc 0 1
binaryLaw a b c ≤ (8 : ℝ≥0∞) • binaryLaw (fun _ => 1/2) (fun _ => 1/2) (fun _ => 1/2)
Proof (Lean source)
-- @node: binaryLaw_fair_domination lemma binaryLaw_fair_domination (a b c : Covariate → ℝ) (ha : Measurable a) (hb : Measurable b) (hc : Measurable c) (hr : ∀ x, a x ∈ Icc 0 1 ∧ b x ∈ Icc 0 1 ∧ c x ∈ Icc 0 1) : binaryLaw a b c ≤ (8 : ℝ≥0∞) • binaryLaw (fun _ => 1/2) (fun _ => 1/2) (fun _ => 1/2) := by apply Measure.le_iff.mpr intro s hs rw [binaryLaw, Measure.bind_apply hs (measurable_binaryRecordLaw a b c ha hb hc).aemeasurable, Measure.smul_apply, binaryLaw, Measure.bind_apply hs (measurable_binaryRecordLaw _ _ _ measurable_const measurable_const measurable_const).aemeasurable, smul_eq_mul, ← lintegral_const_mul' _ _ (by norm_num : (8 : ℝ≥0∞) ≠ ∞)] apply lintegral_mono intro x simp only [Measure.finsetSum_apply, Measure.smul_apply, smul_eq_mul, Finset.mul_sum] apply Finset.sum_le_sum intro z hz have hp (p : ℝ) (hp : p ∈ Icc 0 1) (v : Bool) : bernoulliMass p v ≤ 1 := by cases v <;> simp [bernoulliMass] <;> linarith [hp.1, hp.2] have hm : bernoulliMass (a x) z.1 * bernoulliMass (b x) z.2.1 * bernoulliMass (c x) z.2.2 ≤ 1 := by exact mul_le_one₀ (mul_le_one₀ (hp _ (hr x).1 _) (bernoulliMass_nonneg (hr x).2.1 _) (hp _ (hr x).2.1 _)) (bernoulliMass_nonneg (hr x).2.2 _) (hp _ (hr x).2.2 _) have hmass : ofReal (bernoulliMass (a x) z.1 * bernoulliMass (b x) z.2.1 * bernoulliMass (c x) z.2.2) ≤ 1 := by simpa using ENNReal.ofReal_le_ofReal hm have hf (v : Bool) : bernoulliMass (1/2) v = 1/2 := by cases v <;> norm_num [bernoulliMass] simp only [hf] rw [← mul_assoc] have hfair : (8 : ℝ≥0∞) * ofReal ((1/2 : ℝ) * (1/2) * (1/2)) = 1 := by rw [← ENNReal.ofReal_ofNat 8, ← ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 8)] norm_num rw [hfair] exact mul_le_mul' hmass le_rfl
CausalSmith.Stat.PrivateCateRoughdesign.binaryLaw_fair_domination · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/BinaryLaw.lean:477
theorem square_rnDeriv_integrable_of_domination Lemma square_rnDeriv_integrable_of_domination in the paper ↗

Finite domination makes the squared density deviation integrable under a finite reference law. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
α :
μ ν :
c :
ℝ≥0∞
hc0 :
c ≠ 0
hct :
c ≠ ∞
hle :
μ ≤ c • ν
Integrable (fun z => ((μ.rnDeriv ν z).toReal - 1)^2) ν
Proof (Lean source)
-- @node: square_rnDeriv_integrable_of_domination lemma square_rnDeriv_integrable_of_domination {α : Type*} [MeasurableSpace α] (μ ν : Measure α) [IsFiniteMeasure ν] (c : ℝ≥0∞) (hc0 : c ≠ 0) (hct : c ≠ ∞) (hle : μ ≤ c • ν) : Integrable (fun z => ((μ.rnDeriv ν z).toReal - 1)^2) ν := by letI : IsFiniteMeasure (c • ν) := Measure.smul_finite ν hct letI : IsFiniteMeasure μ := isFiniteMeasure_of_le (c • ν) hle have hsmall : μ.rnDeriv (c • ν) ≤ᵐ[ν] 1 := (Measure.absolutelyContinuous_smul hc0).ae_le (Measure.rnDeriv_le_one_of_le hle) have hscale := Measure.rnDeriv_smul_right_of_ne_top μ ν hc0 hct have hbound : ∀ᵐ z ∂ν, (μ.rnDeriv ν z).toReal ≤ c.toReal := by filter_upwards [hsmall, hscale] with z hz hs rw [hs, Pi.smul_apply, smul_eq_mul] at hz have hz' : μ.rnDeriv ν z ≤ c := by calc _ = c * (c⁻¹ * μ.rnDeriv ν z) := by rw [← mul_assoc, ENNReal.mul_inv_cancel hc0 hct, one_mul] _ ≤ c * 1 := mul_le_mul' le_rfl hz _ = c := mul_one _ exact ENNReal.toReal_mono hct hz' apply Integrable.of_mem_Icc 0 ((c.toReal + 1)^2) (by fun_prop) filter_upwards [hbound] with z hz have hn := ENNReal.toReal_nonneg (a := μ.rnDeriv ν z) have hc := ENNReal.toReal_nonneg (a := c) constructor · exact sq_nonneg _ · nlinarith
CausalSmith.Stat.PrivateCateRoughdesign.square_rnDeriv_integrable_of_domination · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/BinaryLaw.lean:516
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.CellMoments 30 declarations Positive-mass conditional cell laws, independent binary pair moments and occupancy-certificate assembly.

Positive-mass conditional cell laws, independent binary pair moments and occupancy-certificate assembly.

theorem observed_cell_measure

The observed cell event has exactly the mass of the corresponding design cell. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
k :
ℕ
h :
ℝ
P :
j :
Fin k
(Pobs P) {z | z.1 ∈ cell h k j} = (PX P) (cell h k j)
Proof (Lean source)
-- @node: observed_cell_measure lemma observed_cell_measure (k : ℕ) (h : ℝ) (P : CausalLaw) (j : Fin k) : (Pobs P) {z | z.1 ∈ cell h k j} = (PX P) (cell h k j) := by change (P.law.map observe) (fst ⁻¹' cell h k j) = (P.law.map X) (cell h k j) rw [Measure.map_apply measurable_observe ((measurableSet_cell h k j).preimage measurable_fst), Measure.map_apply measurable_X (measurableSet_cell h k j)] rfl
CausalSmith.Stat.PrivateCateRoughdesign.observed_cell_measure · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CellMoments.lean:13
theorem conditionalCellLaw_probability

Density bounded below ensures that conditioning on any public cell gives a probability law. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
k :
ℕ
h :
ℝ
hk :
0 < k
hh :
0 < h ∧ h ≤ 1 / 4
P :
hP :
j :
Fin k
Proof (Lean source)
-- @node: conditionalCellLaw_probability lemma conditionalCellLaw_probability (k : ℕ) (h : ℝ) (hk : 0 < k) (hh : 0 < h ∧ h ≤ 1 / 4) (P : CausalLaw) (hP : CompleteModel P) (j : Fin k) : IsProbabilityMeasure (conditionalCellLaw h k P j) := by let : IsProbabilityMeasure (PX P) := Measure.isProbabilityMeasure_map measurable_X.aemeasurable let : IsProbabilityMeasure (PX P) := Measure.isProbabilityMeasure_map measurable_X.aemeasurable have hp : 0 < cellMass h k P j := lt_of_lt_of_le (half_pos (cell_endpoint_bounds k h hk hh j).2.2.2) (cellMass_density_bounds k h hk hh P hP j).1 have hzero : (PX P) (cell h k j) ≠ 0 := by intro hz simp [cellMass, measureReal_def, hz] at hp refine ⟨?_⟩ simp only [conditionalCellLaw, Measure.smul_apply, Measure.restrict_apply MeasurableSet.univ, Set.univ_inter, smul_eq_mul, observed_cell_measure] exact ENNReal.inv_mul_cancel hzero (measure_ne_top _ _)
CausalSmith.Stat.PrivateCateRoughdesign.conditionalCellLaw_probability · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CellMoments.lean:23
theorem integrable_causal_pair_numerator Lemma integrable_causal_pair_numerator in the paper ↗

The bounded binary numerator kernel is integrable under any finite pair measure. The displayed conclusion follows.

Formal statement
μ :
Integrable (fun z => KN z.1 z.2) μ
Proof (Lean source)
-- @node: integrable_causal_pair_numerator @[fun_prop] lemma integrable_causal_pair_numerator (μ : Measure (O × O)) [IsFiniteMeasure μ] : Integrable (fun z => KN z.1 z.2) μ := by apply Integrable.of_bound (by unfold KN; fun_prop) 1 filter_upwards [] with z simpa only [Real.norm_eq_abs] using (causal_pair_kernel_unit_bounds z.1 z.2).1
CausalSmith.Stat.PrivateCateRoughdesign.integrable_causal_pair_numerator · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CellMoments.lean:41
theorem integrable_causal_pair_denominator Lemma integrable_causal_pair_denominator in the paper ↗

The bounded binary denominator kernel is integrable under any finite pair measure. The displayed conclusion follows.

Formal statement
μ :
Integrable (fun z => KD z.1 z.2) μ
Proof (Lean source)
-- @node: integrable_causal_pair_denominator @[fun_prop] lemma integrable_causal_pair_denominator (μ : Measure (O × O)) [IsFiniteMeasure μ] : Integrable (fun z => KD z.1 z.2) μ := by apply Integrable.of_bound (by unfold KD; fun_prop) 1 filter_upwards [] with z simpa only [Real.norm_eq_abs] using (causal_pair_kernel_unit_bounds z.1 z.2).2
CausalSmith.Stat.PrivateCateRoughdesign.integrable_causal_pair_denominator · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CellMoments.lean:49
theorem conditional_cell_numerator_abs_le_denominator

The conditional pair numerator cannot exceed the denominator in absolute value. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
k :
ℕ
h :
ℝ
hk :
0 < k
hh :
0 < h ∧ h ≤ 1 / 4
P :
hP :
j :
Fin k
|nu h k P j| ≤ dj h k P j
Proof (Lean source)
-- @node: conditional_cell_numerator_abs_le_denominator lemma conditional_cell_numerator_abs_le_denominator (k : ℕ) (h : ℝ) (hk : 0 < k) (hh : 0 < h ∧ h ≤ 1 / 4) (P : CausalLaw) (hP : CompleteModel P) (j : Fin k) : |nu h k P j| ≤ dj h k P j := by let := conditionalCellLaw_probability k h hk hh P hP j let μ := (conditionalCellLaw h k P j).prod (conditionalCellLaw h k P j) have hN := integrable_causal_pair_numerator μ have hD := integrable_causal_pair_denominator μ calc |nu h k P j| ≤ ∫ z, |KN z.1 z.2| ∂μ := abs_integral_le_integral_abs _ ≤ ∫ z, KD z.1 z.2 ∂μ := integral_mono hN.abs hD (fun z => (causal_pair_kernel_bounds z.1 z.2).2.2.1) _ = dj h k P j := rfl
CausalSmith.Stat.PrivateCateRoughdesign.conditional_cell_numerator_abs_le_denominator · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CellMoments.lean:57
theorem conditional_cell_treatment_mean

The normalized cell treatment mean is the selected propensity averaged over that cell. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
k :
ℕ
h :
ℝ
P :
j :
Fin k
(∫ z, bit z.2.1 ∂conditionalCellLaw h k P j)
= (∫ x in cell h k j, P.e x ∂PX P) / cellMass h k P j
Proof (Lean source)
-- @node: conditional_cell_treatment_mean lemma conditional_cell_treatment_mean (k : ℕ) (h : ℝ) (P : CausalLaw) (j : Fin k) : (∫ z, bit z.2.1 ∂conditionalCellLaw h k P j) = (∫ x in cell h k j, P.e x ∂PX P) / cellMass h k P j := by have ht : MeasurableSet {z : O | z.2.1 = true} := measurableSet_eq_fun (by fun_prop) measurable_const have heq : (fun z : O => bit z.2.1) = {z : O | z.2.1 = true}.indicator (fun _ => (1 : ℝ)) := by funext z cases hz : z.2.1 <;> simp [bit, indicator, hz] rw [conditionalCellLaw, integral_smul_measure, heq, integral_indicator ht, setIntegral_one_eq_measureReal] simp only [measureReal_def, Measure.restrict_apply ht, ENNReal.toReal_inv] rw [observed_cell_measure] have hj : MeasurableSet ({z : O | z.2.1 = true} ∩ {z | z.1 ∈ cell h k j}) := ht.inter ((measurableSet_cell h k j).preimage measurable_fst) rw [Pobs, Measure.map_apply measurable_observe hj] have hs : observe ⁻¹' ({z : O | z.2.1 = true} ∩ {z | z.1 ∈ cell h k j}) = {z | X z ∈ cell h k j ∧ A z = true} := by ext z simp [observe, and_comm] rw [hs] change ((PX P).real (cell h k j))⁻¹ * P.law.real {z | X z ∈ cell h k j ∧ A z = true} = _ rw [← P.e_version _ (measurableSet_cell h k j)] simp only [cellMass, PX, div_eq_mul_inv, mul_comm]
CausalSmith.Stat.PrivateCateRoughdesign.conditional_cell_treatment_mean · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CellMoments.lean:72
theorem conditional_cell_treatment_overlap

Averaging the everywhere overlap bounds under a positive-mass cell preserves overlap. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
k :
ℕ
h :
ℝ
hk :
0 < k
hh :
0 < h ∧ h ≤ 1 / 4
P :
hP :
j :
Fin k
conclusion 1
1 / 4 ≤ (∫ z, bit z.2.1 ∂conditionalCellLaw h k P j)
conclusion 2
(∫ z, bit z.2.1 ∂conditionalCellLaw h k P j) ≤ 3 / 4
Proof (Lean source)
-- @node: conditional_cell_treatment_overlap lemma conditional_cell_treatment_overlap (k : ℕ) (h : ℝ) (hk : 0 < k) (hh : 0 < h ∧ h ≤ 1 / 4) (P : CausalLaw) (hP : CompleteModel P) (j : Fin k) : 1 / 4 ≤ (∫ z, bit z.2.1 ∂conditionalCellLaw h k P j) ∧ (∫ z, bit z.2.1 ∂conditionalCellLaw h k P j) ≤ 3 / 4 := by let : IsProbabilityMeasure (PX P) := Measure.isProbabilityMeasure_map measurable_X.aemeasurable have hp : 0 < cellMass h k P j := lt_of_lt_of_le (half_pos (cell_endpoint_bounds k h hk hh j).2.2.2) (cellMass_density_bounds k h hk hh P hP j).1 have hlo : ∫ x in cell h k j, (1 / 4 : ℝ) ∂PX P ≤ ∫ x in cell h k j, P.e x ∂PX P := by exact integral_mono_ae (integrable_const _) P.e_integrable.integrableOn (ae_of_all _ (fun x => (hP.overlap x).1)) have hhi : ∫ x in cell h k j, P.e x ∂PX P ≤ ∫ x in cell h k j, (3 / 4 : ℝ) ∂PX P := by exact integral_mono_ae P.e_integrable.integrableOn (integrable_const _) (ae_of_all _ (fun x => (hP.overlap x).2)) simp only [setIntegral_const, smul_eq_mul] at hlo hhi rw [conditional_cell_treatment_mean] constructor · apply (le_div_iff₀ hp).mpr simpa only [cellMass, mul_comm] using hlo · apply (div_le_iff₀ hp).mpr simpa only [cellMass, mul_comm] using hhi
CausalSmith.Stat.PrivateCateRoughdesign.conditional_cell_treatment_overlap · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CellMoments.lean:100
theorem independent_binary_denominator_moment Lemma independent_binary_denominator_moment in the paper ↗

Independent binary treatments have denominator moment twice p times one minus p. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
(∫ z, KD z.1 z.2 ∂μ.prod μ) = 2 * (∫ z, bit z.2.1 ∂μ) * (1 - ∫ z, bit z.2.1 ∂μ)
Proof (Lean source)
-- @node: independent_binary_denominator_moment lemma independent_binary_denominator_moment (μ : Measure O) [IsProbabilityMeasure μ] : (∫ z, KD z.1 z.2 ∂μ.prod μ) = 2 * (∫ z, bit z.2.1 ∂μ) * (1 - ∫ z, bit z.2.1 ∂μ) := by have hb := integrable_bit_comp μ (fun z : O => z.2.1) (by fun_prop) rw [integral_prod _ (integrable_causal_pair_denominator (μ.prod μ))] have hk (x y : O) : KD x y = bit x.2.1 + bit y.2.1 - (2 * bit x.2.1) * bit y.2.1 := by cases hx : x.2.1 <;> cases hy : y.2.1 <;> norm_num [KD, bit, hx, hy] simp_rw [hk] have hinner (x : O) : (∫ y, bit x.2.1 + bit y.2.1 - (2 * bit x.2.1) * bit y.2.1 ∂μ) = bit x.2.1 + (∫ y, bit y.2.1 ∂μ) - (2 * bit x.2.1) * (∫ y, bit y.2.1 ∂μ) := by integral_linearity simp simp_rw [hinner] integral_linearity simp only [integral_const, probReal_univ, one_smul] ring
CausalSmith.Stat.PrivateCateRoughdesign.independent_binary_denominator_moment · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CellMoments.lean:126
theorem conditional_cell_denominator_lower

The conditional pair denominator satisfies the paper's three-eighths lower bound. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
k :
ℕ
h :
ℝ
hk :
0 < k
hh :
0 < h ∧ h ≤ 1 / 4
P :
hP :
j :
Fin k
3 / 8 ≤ dj h k P j
Proof (Lean source)
-- @node: conditional_cell_denominator_lower lemma conditional_cell_denominator_lower (k : ℕ) (h : ℝ) (hk : 0 < k) (hh : 0 < h ∧ h ≤ 1 / 4) (P : CausalLaw) (hP : CompleteModel P) (j : Fin k) : 3 / 8 ≤ dj h k P j := by let := conditionalCellLaw_probability k h hk hh P hP j have he := conditional_cell_treatment_overlap k h hk hh P hP j have hd := (cross_treatment_denominator_bounds _ _ he he).1 rw [dj, independent_binary_denominator_moment] nlinarith
CausalSmith.Stat.PrivateCateRoughdesign.conditional_cell_denominator_lower · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CellMoments.lean:147
theorem conditional_cell_integral

Conditioning rescales an observed cell integral by its actual design probability. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
k :
ℕ
h :
ℝ
P :
j :
Fin k
f :
O → ℝ
(∫ z, f z ∂conditionalCellLaw h k P j)
= (∫ z in {z : O | z.1 ∈ cell h k j}, f z ∂Pobs P) / cellMass h k P j
Proof (Lean source)
-- @node: conditional_cell_integral lemma conditional_cell_integral (k : ℕ) (h : ℝ) (P : CausalLaw) (j : Fin k) (f : O → ℝ) : (∫ z, f z ∂conditionalCellLaw h k P j) = (∫ z in {z : O | z.1 ∈ cell h k j}, f z ∂Pobs P) / cellMass h k P j := by rw [conditionalCellLaw, integral_smul_measure, ENNReal.toReal_inv, observed_cell_measure] simp only [cellMass, measureReal_def, smul_eq_mul, div_eq_mul_inv, mul_comm]
CausalSmith.Stat.PrivateCateRoughdesign.conditional_cell_integral · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CellMoments.lean:158
theorem observed_arm_response_design_integral

The arm-response integral equals the design integral of the arm probability times its mean. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
(∫ z in {z : O | z.1 ∈ s ∧ z.2.1 = d}, bit z.2.2 ∂Pobs P)
= ∫ x in s, (if d then P.e x else 1 - P.e x) * (if d then P.mu1 x else P.mu0 x) ∂PX P
Proof (Lean source)
-- @node: observed_arm_response_design_integral lemma observed_arm_response_design_integral (P : CausalLaw) (hP : CompleteModel P) (d : Bool) (s : Set Covariate) (hs : MeasurableSet s) : (∫ z in {z : O | z.1 ∈ s ∧ z.2.1 = d}, bit z.2.2 ∂Pobs P) = ∫ x in s, (if d then P.e x else 1 - P.e x) * (if d then P.mu1 x else P.mu0 x) ∂PX P := by rw [← observed_arm_outcome_integral P d s hs] have hv : (∫ z in {z | X z ∈ s ∧ A z = d}, bit (Y z) ∂P.law) = ∫ x in s, (if d then P.mu1 x else P.mu0 x) ∂((P.law.restrict {z | A z = d}).map X) := by cases d · exact (P.mu0_version s hs).symm · exact (P.mu1_version s hs).symm rw [hv, arm_design_withDensity P hP d] have hq : Measurable (fun x => if d then P.e x else 1 - P.e x) := by have he := P.e_measurable cases d <;> simp only [Bool.false_eq_true, if_false, if_true] <;> fun_prop change (∫ x in s, (if d then P.mu1 x else P.mu0 x) ∂(PX P).withDensity (ofReal ∘ (fun x => if d then P.e x else 1 - P.e x))) = _ rw [setIntegral_withDensity_eq_setIntegral_toReal_smul₀ (μ := PX P) (ENNReal.measurable_ofReal.comp hq).aemeasurable (ae_of_all _ (fun x => ENNReal.ofReal_lt_top)) _ hs] apply integral_congr_ae filter_upwards with x have hn : 0 ≤ (if d then P.e x else 1 - P.e x) := by cases d <;> simp only [Bool.false_eq_true, if_false, if_true] <;> linarith [(hP.overlap x).1, (hP.overlap x).2] simp only [Function.comp_def, ENNReal.toReal_ofReal hn, smul_eq_mul]
CausalSmith.Stat.PrivateCateRoughdesign.observed_arm_response_design_integral · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CellMoments.lean:168
theorem conditional_cell_arm_response_mean

Each conditional arm-response moment averages the selected arm regression with its propensity. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
k :
ℕ
h :
ℝ
P :
hP :
j :
Fin k
d :
(∫ z, (if z.2.1 = d then bit z.2.2 else 0) ∂conditionalCellLaw h k P j)
= (∫ x in cell h k j, (if d then P.e x else 1 - P.e x) * (if d then P.mu1 x else P.mu0 x) ∂PX P) / cellMass h k P j
Proof (Lean source)
-- @node: conditional_cell_arm_response_mean lemma conditional_cell_arm_response_mean (k : ℕ) (h : ℝ) (P : CausalLaw) (hP : CompleteModel P) (j : Fin k) (d : Bool) : (∫ z, (if z.2.1 = d then bit z.2.2 else 0) ∂conditionalCellLaw h k P j) = (∫ x in cell h k j, (if d then P.e x else 1 - P.e x) * (if d then P.mu1 x else P.mu0 x) ∂PX P) / cellMass h k P j := by have ht : MeasurableSet {z : O | z.2.1 = d} := measurableSet_eq_fun (by fun_prop) measurable_const have heq : (fun z : O => if z.2.1 = d then bit z.2.2 else 0) = {z : O | z.2.1 = d}.indicator (fun z => bit z.2.2) := by funext z simp only [Set.indicator_apply, Set.mem_ofPred_eq] rw [conditional_cell_integral, heq, setIntegral_indicator ht] have hs : {z : O | z.1 ∈ cell h k j} ∩ {z : O | z.2.1 = d} = {z : O | z.1 ∈ cell h k j ∧ z.2.1 = d} := rfl rw [hs, observed_arm_response_design_integral P hP d _ (measurableSet_cell h k j)]
CausalSmith.Stat.PrivateCateRoughdesign.conditional_cell_arm_response_mean · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CellMoments.lean:198
theorem conditional_cell_treated_response_mean

The conditional treated-response moment is the cell average of propensity times treated mean. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
k :
ℕ
h :
ℝ
P :
hP :
j :
Fin k
(∫ z, bit z.2.1 * bit z.2.2 ∂conditionalCellLaw h k P j)
= (∫ x in cell h k j, P.e x * P.mu1 x ∂PX P) / cellMass h k P j
Proof (Lean source)
-- @node: conditional_cell_treated_response_mean lemma conditional_cell_treated_response_mean (k : ℕ) (h : ℝ) (P : CausalLaw) (hP : CompleteModel P) (j : Fin k) : (∫ z, bit z.2.1 * bit z.2.2 ∂conditionalCellLaw h k P j) = (∫ x in cell h k j, P.e x * P.mu1 x ∂PX P) / cellMass h k P j := by have heq : (fun z : O => bit z.2.1 * bit z.2.2) = (fun z : O => if z.2.1 = true then bit z.2.2 else 0) := by funext z cases z.2.1 <;> simp [bit] rw [heq, conditional_cell_arm_response_mean k h P hP j true] simp only [if_true]
CausalSmith.Stat.PrivateCateRoughdesign.conditional_cell_treated_response_mean · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CellMoments.lean:216
theorem conditional_cell_response_mean

The conditional response mean sums the propensity-weighted means in the two treatment arms. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
k :
ℕ
h :
ℝ
hk :
0 < k
hh :
0 < h ∧ h ≤ 1 / 4
P :
hP :
j :
Fin k
(∫ z, bit z.2.2 ∂conditionalCellLaw h k P j)
= (∫ x in cell h k j, (1 - P.e x) * P.mu0 x ∂PX P) / cellMass h k P j
+ (∫ x in cell h k j, P.e x * P.mu1 x ∂PX P) / cellMass h k P j
Proof (Lean source)
-- @node: conditional_cell_response_mean lemma conditional_cell_response_mean (k : ℕ) (h : ℝ) (hk : 0 < k) (hh : 0 < h ∧ h ≤ 1 / 4) (P : CausalLaw) (hP : CompleteModel P) (j : Fin k) : (∫ z, bit z.2.2 ∂conditionalCellLaw h k P j) = (∫ x in cell h k j, (1 - P.e x) * P.mu0 x ∂PX P) / cellMass h k P j + (∫ x in cell h k j, P.e x * P.mu1 x ∂PX P) / cellMass h k P j := by let μ := conditionalCellLaw h k P j let : IsProbabilityMeasure μ := conditionalCellLaw_probability k h hk hh P hP j have hy := integrable_bit_comp μ (fun z : O => z.2.2) (by fun_prop) have ht (d : Bool) : MeasurableSet {z : O | z.2.1 = d} := measurableSet_eq_fun (by fun_prop) measurable_const have hi (d : Bool) : Integrable (fun z : O => if z.2.1 = d then bit z.2.2 else 0) μ := by have heq : (fun z : O => if z.2.1 = d then bit z.2.2 else 0) = {z : O | z.2.1 = d}.indicator (fun z => bit z.2.2) := by funext z simp only [Set.indicator_apply, Set.mem_ofPred_eq] rw [heq] exact hy.indicator (ht d) have heq : (fun z : O => bit z.2.2) = (fun z : O => (if z.2.1 = false then bit z.2.2 else 0) + (if z.2.1 = true then bit z.2.2 else 0)) := by funext z cases z.2.1 <;> simp rw [heq, integral_add (hi false) (hi true), conditional_cell_arm_response_mean k h P hP j false, conditional_cell_arm_response_mean k h P hP j true] simp only [Bool.false_eq_true, if_false, if_true]
CausalSmith.Stat.PrivateCateRoughdesign.conditional_cell_response_mean · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CellMoments.lean:229
theorem independent_binary_numerator_moment Lemma independent_binary_numerator_moment in the paper ↗

Independent binary records have numerator moment twice the treatment-response covariance. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
(∫ z, KN z.1 z.2 ∂μ.prod μ)
= 2 * ((∫ z, bit z.2.1 * bit z.2.2 ∂μ) - (∫ z, bit z.2.1 ∂μ) * (∫ z, bit z.2.2 ∂μ))
Proof (Lean source)
-- @node: independent_binary_numerator_moment lemma independent_binary_numerator_moment (μ : Measure O) [IsProbabilityMeasure μ] : (∫ z, KN z.1 z.2 ∂μ.prod μ) = 2 * ((∫ z, bit z.2.1 * bit z.2.2 ∂μ) - (∫ z, bit z.2.1 ∂μ) * (∫ z, bit z.2.2 ∂μ)) := by have ha := integrable_bit_comp μ (fun z : O => z.2.1) (by fun_prop) have hy := integrable_bit_comp μ (fun z : O => z.2.2) (by fun_prop) have hay : Integrable (fun z : O => bit z.2.1 * bit z.2.2) μ := by apply Integrable.of_mem_Icc 0 1 (by fun_prop) filter_upwards with z cases z.2.1 <;> cases z.2.2 <;> norm_num [bit] rw [integral_prod _ (integrable_causal_pair_numerator (μ.prod μ))] have hk (x y : O) : KN x y = bit x.2.1 * bit x.2.2 - bit x.2.1 * bit y.2.2 - bit y.2.1 * bit x.2.2 + bit y.2.1 * bit y.2.2 := by unfold KN ring simp_rw [hk] have hinner (x : O) : (∫ y, bit x.2.1 * bit x.2.2 - bit x.2.1 * bit y.2.2 - bit y.2.1 * bit x.2.2 + bit y.2.1 * bit y.2.2 ∂μ) = bit x.2.1 * bit x.2.2 - bit x.2.1 * (∫ y, bit y.2.2 ∂μ) - (∫ y, bit y.2.1 ∂μ) * bit x.2.2 + ∫ y, bit y.2.1 * bit y.2.2 ∂μ := by integral_linearity simp simp_rw [hinner] integral_linearity simp only [integral_const, probReal_univ, one_smul] ring
CausalSmith.Stat.PrivateCateRoughdesign.independent_binary_numerator_moment · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CellMoments.lean:259
theorem conditional_cell_numerator_covariance

The conditional numerator is the treatment-response covariance within the actual cell law. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
k :
ℕ
h :
ℝ
hk :
0 < k
hh :
0 < h ∧ h ≤ 1 / 4
P :
hP :
j :
Fin k
nu h k P j
= 2 * ((∫ z, bit z.2.1 * bit z.2.2 ∂conditionalCellLaw h k P j) - (∫ z, bit z.2.1 ∂conditionalCellLaw h k P j) * (∫ z, bit z.2.2 ∂conditionalCellLaw h k P j))
Proof (Lean source)
-- @node: conditional_cell_numerator_covariance lemma conditional_cell_numerator_covariance (k : ℕ) (h : ℝ) (hk : 0 < k) (hh : 0 < h ∧ h ≤ 1 / 4) (P : CausalLaw) (hP : CompleteModel P) (j : Fin k) : nu h k P j = 2 * ((∫ z, bit z.2.1 * bit z.2.2 ∂conditionalCellLaw h k P j) - (∫ z, bit z.2.1 ∂conditionalCellLaw h k P j) * (∫ z, bit z.2.2 ∂conditionalCellLaw h k P j)) := by let := conditionalCellLaw_probability k h hk hh P hP j exact independent_binary_numerator_moment _
CausalSmith.Stat.PrivateCateRoughdesign.conditional_cell_numerator_covariance · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CellMoments.lean:290
theorem conditional_cell_numerator_design_formula

The conditional numerator uses the actual design-weighted cell moments, with no density approximation. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
k :
ℕ
h :
ℝ
hk :
0 < k
hh :
0 < h ∧ h ≤ 1 / 4
P :
hP :
j :
Fin k
nu h k P j
= 2 * ((∫ x in cell h k j, P.e x * P.mu1 x ∂PX P) / cellMass h k P j - ((∫ x in cell h k j, P.e x ∂PX P) / cellMass h k P j) * ((∫ x in cell h k j, (1 - P.e x) * P.mu0 x ∂PX P) / cellMass h k P j + (∫ x in cell h k j, P.e x * P.mu1 x ∂PX P) / cellMass h k P j))
Proof (Lean source)
-- @node: conditional_cell_numerator_design_formula lemma conditional_cell_numerator_design_formula (k : ℕ) (h : ℝ) (hk : 0 < k) (hh : 0 < h ∧ h ≤ 1 / 4) (P : CausalLaw) (hP : CompleteModel P) (j : Fin k) : nu h k P j = 2 * ((∫ x in cell h k j, P.e x * P.mu1 x ∂PX P) / cellMass h k P j - ((∫ x in cell h k j, P.e x ∂PX P) / cellMass h k P j) * ((∫ x in cell h k j, (1 - P.e x) * P.mu0 x ∂PX P) / cellMass h k P j + (∫ x in cell h k j, P.e x * P.mu1 x ∂PX P) / cellMass h k P j)) := by rw [conditional_cell_numerator_covariance k h hk hh P hP j, conditional_cell_treated_response_mean k h P hP j, conditional_cell_treatment_mean k h P j, conditional_cell_response_mean k h hk hh P hP j]
CausalSmith.Stat.PrivateCateRoughdesign.conditional_cell_numerator_design_formula · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CellMoments.lean:301
theorem conditional_cell_numerator_design_pair

The observed conditional numerator equals the cross-treatment moment of two actual conditional covariates. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
k :
ℕ
h :
ℝ
hk :
0 < k
hh :
0 < h ∧ h ≤ 1 / 4
P :
hP :
j :
Fin k
nu h k P j
Proof (Lean source)
-- @node: conditional_cell_numerator_design_pair lemma conditional_cell_numerator_design_pair (k : ℕ) (h : ℝ) (hk : 0 < k) (hh : 0 < h ∧ h ≤ 1 / 4) (P : CausalLaw) (hP : CompleteModel P) (j : Fin k) : nu h k P j = ∫ z, designPairNumerator P z ∂(conditionalDesignLaw h k P j).prod (conditionalDesignLaw h k P j) := by let := conditionalDesignLaw_probability k h hk hh P hP j rw [(design_pair_numerator_moment P hP (conditionalDesignLaw h k P j)).2] simp only [conditionalDesignLaw_integral] exact conditional_cell_numerator_design_formula k h hk hh P hP j
CausalSmith.Stat.PrivateCateRoughdesign.conditional_cell_numerator_design_pair · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CellMoments.lean:315
theorem conditional_cell_denominator_design_pair

The observed conditional denominator equals the cross-treatment probability for two actual conditional covariates. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
k :
ℕ
h :
ℝ
hk :
0 < k
hh :
0 < h ∧ h ≤ 1 / 4
P :
hP :
j :
Fin k
dj h k P j
Proof (Lean source)
-- @node: conditional_cell_denominator_design_pair lemma conditional_cell_denominator_design_pair (k : ℕ) (h : ℝ) (hk : 0 < k) (hh : 0 < h ∧ h ≤ 1 / 4) (P : CausalLaw) (hP : CompleteModel P) (j : Fin k) : dj h k P j = ∫ z, designPairDenominator P z ∂(conditionalDesignLaw h k P j).prod (conditionalDesignLaw h k P j) := by let := conditionalDesignLaw_probability k h hk hh P hP j let := conditionalCellLaw_probability k h hk hh P hP j rw [(design_pair_denominator_moment P hP (conditionalDesignLaw h k P j)).2, dj, independent_binary_denominator_moment, conditional_cell_treatment_mean] simp only [conditionalDesignLaw_integral]
CausalSmith.Stat.PrivateCateRoughdesign.conditional_cell_denominator_design_pair · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CellMoments.lean:327
theorem conditional_cell_bias_bound

The actual conditional cell moments satisfy the paper's complete causal bias bound. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
k :
ℕ
h :
ℝ
hk :
0 < k
hh :
0 < h ∧ h ≤ 1 / 4
P :
hP :
j :
Fin k
|nu h k P j - theta P * dj h k P j| ≤ bias h k * dj h k P j
Proof (Lean source)
-- @node: conditional_cell_bias_bound lemma conditional_cell_bias_bound (k : ℕ) (h : ℝ) (hk : 0 < k) (hh : 0 < h ∧ h ≤ 1 / 4) (P : CausalLaw) (hP : CompleteModel P) (j : Fin k) : |nu h k P j - theta P * dj h k P j| ≤ bias h k * dj h k P j := by rw [conditional_cell_numerator_design_pair k h hk hh P hP j, conditional_cell_denominator_design_pair k h hk hh P hP j] exact conditional_design_pair_bias k h hk hh P hP j
CausalSmith.Stat.PrivateCateRoughdesign.conditional_cell_bias_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CellMoments.lean:340

Two distinct coordinates of an iid array have the product of the record law as their law. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
s :
ℕ
i l :
Fin s
hil :
i ≠ l
MeasurePreserving (fun z : Fin s → O => (z i, z l)) (Measure.pi (fun _ : Fin s => μ)) (μ.prod μ)
Proof (Lean source)
-- @node: iid_pair_coordinates lemma iid_pair_coordinates (s : ℕ) (μ : Measure O) [IsProbabilityMeasure μ] (i l : Fin s) (hil : i ≠ l) : MeasurePreserving (fun z : Fin s → O => (z i, z l)) (Measure.pi (fun _ : Fin s => μ)) (μ.prod μ) := by have hind := ProbabilityTheory.iIndepFun_pi (μ := fun _ : Fin s => μ) (X := fun _ (z : O) => z) (fun _ => measurable_id.aemeasurable) have hm := (hind.indepFun hil).map_prod_eq_prod_map_map (measurable_pi_apply i).aemeasurable (measurable_pi_apply l).aemeasurable rw [(measurePreserving_eval (fun _ : Fin s => μ) i).map_eq, (measurePreserving_eval (fun _ : Fin s => μ) l).map_eq] at hm exact ⟨by fun_prop, hm⟩
CausalSmith.Stat.PrivateCateRoughdesign.iid_pair_coordinates · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CellMoments.lean:349
theorem iid_pair_kernel_integral Lemma iid_pair_kernel_integral in the paper ↗

Every distinct iid coordinate pair has the same integrable kernel moment. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
s :
ℕ
i l :
Fin s
hil :
i ≠ l
K :
O → O → ℝ
hK :
Integrable (fun z : O × O => K z.1 z.2) (μ.prod μ)
conclusion 1
Integrable (fun z : Fin s → O => K (z i) (z l)) (Measure.pi (fun _ : Fin s => μ))
conclusion 2
(∫ z : Fin s → O, K (z i) (z l) ∂Measure.pi (fun _ : Fin s => μ))
= ∫ z, K z.1 z.2 ∂μ.prod μ
Proof (Lean source)
-- @node: iid_pair_kernel_integral lemma iid_pair_kernel_integral (s : ℕ) (μ : Measure O) [IsProbabilityMeasure μ] (i l : Fin s) (hil : i ≠ l) (K : O → O → ℝ) (hK : Integrable (fun z : O × O => K z.1 z.2) (μ.prod μ)) : Integrable (fun z : Fin s → O => K (z i) (z l)) (Measure.pi (fun _ : Fin s => μ)) ∧ (∫ z : Fin s → O, K (z i) (z l) ∂Measure.pi (fun _ : Fin s => μ)) = ∫ z, K z.1 z.2 ∂μ.prod μ := by have hp := iid_pair_coordinates s μ i l hil constructor · exact hp.integrable_comp_of_integrable hK · rw [← hp.map_eq] at hK ⊢ exact (integral_map hp.measurable.aemeasurable hK.aestronglyMeasurable).symm
CausalSmith.Stat.PrivateCateRoughdesign.iid_pair_kernel_integral · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CellMoments.lean:364
theorem iid_pairContribution_expectation Lemma iid_pairContribution_expectation in the paper ↗

At a fixed iid cell count, the count-weighted pair sum has expectation s times the conditional pair moment; empty and singleton samples contribute zero. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
s :
ℕ
K :
O → O → ℝ
hK :
Integrable (fun z : O × O => K z.1 z.2) (μ.prod μ)
(∫ z : Fin s → O, pairContribution K z ∂Measure.pi (fun _ : Fin s => μ))
= (if s < 2 then 0 else (s : ℝ)) * (∫ z, K z.1 z.2 ∂μ.prod μ)
Proof (Lean source)
-- @node: iid_pairContribution_expectation lemma iid_pairContribution_expectation (s : ℕ) (μ : Measure O) [IsProbabilityMeasure μ] (K : O → O → ℝ) (hK : Integrable (fun z : O × O => K z.1 z.2) (μ.prod μ)) : (∫ z : Fin s → O, pairContribution K z ∂Measure.pi (fun _ : Fin s => μ)) = (if s < 2 then 0 else (s : ℝ)) * (∫ z, K z.1 z.2 ∂μ.prod μ) := by classical by_cases hs : s < 2 · simp [pairContribution, hs] have hc : (choose s 2 : ℝ) ≠ 0 := by exact_mod_cast (Nat.choose_pos (show 2 ≤ s by omega)).ne' have hi (i l : Fin s) : Integrable (fun z : Fin s → O => if i < l then K (z i) (z l) else 0) (Measure.pi (fun _ : Fin s => μ)) := by by_cases hil : i < l · simpa only [if_pos hil] using (iid_pair_kernel_integral s μ i l hil.ne K hK).1 · simp only [if_neg hil] exact integrable_zero _ _ _ have hm (i l : Fin s) : (∫ z : Fin s → O, (if i < l then K (z i) (z l) else 0) ∂Measure.pi (fun _ : Fin s => μ)) = (if i < l then (1 : ℝ) else 0) * (∫ z, K z.1 z.2 ∂μ.prod μ) := by by_cases hil : i < l · simp only [if_pos hil, one_mul] exact (iid_pair_kernel_integral s μ i l hil.ne K hK).2 · simp [hil] simp only [pairContribution, if_neg hs] rw [integral_const_mul, integral_finset_sum _ (fun i _ => integrable_finset_sum _ (fun l _ => hi i l))] simp_rw [integral_finset_sum _ (fun l _ => hi _ l), hm] simp_rw [← Finset.sum_mul] rw [ordered_pair_count] field_simp [hc]
CausalSmith.Stat.PrivateCateRoughdesign.iid_pairContribution_expectation · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CellMoments.lean:378
theorem integrable_numeratorCell Lemma integrable_numeratorCell in the paper ↗

Every numerator cell contribution is integrable under a finite dataset law. The displayed conclusion follows.

Formal statement
n k :
ℕ
h :
ℝ
j :
Fin k
Integrable (fun D => numeratorCell n h k D j) Q
Proof (Lean source)
-- @node: integrable_numeratorCell @[fun_prop] lemma integrable_numeratorCell (n k : ℕ) (h : ℝ) (j : Fin k) (Q : Measure (Dataset n)) [IsFiniteMeasure Q] : Integrable (fun D => numeratorCell n h k D j) Q := by apply Integrable.mono' (integrable_const (μ := Q) (n : ℝ)) (by fun_prop) filter_upwards with D have hc : cellCount n h k D j ≤ n := by simpa only [cellCount, Fintype.card_fin] using (Finset.card_le_univ (cellRecords n h k D j)) simpa only [Real.norm_eq_abs] using (cell_contribution_bounds n k h D j).1.trans (by exact_mod_cast hc)
CausalSmith.Stat.PrivateCateRoughdesign.integrable_numeratorCell · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CellMoments.lean:413
theorem integrable_denominatorCell Lemma integrable_denominatorCell in the paper ↗

Every denominator cell contribution is integrable under a finite dataset law. The displayed conclusion follows.

Formal statement
n k :
ℕ
h :
ℝ
j :
Fin k
Integrable (fun D => denominatorCell n h k D j) Q
Proof (Lean source)
-- @node: integrable_denominatorCell @[fun_prop] lemma integrable_denominatorCell (n k : ℕ) (h : ℝ) (j : Fin k) (Q : Measure (Dataset n)) [IsFiniteMeasure Q] : Integrable (fun D => denominatorCell n h k D j) Q := by apply Integrable.mono' (integrable_const (μ := Q) (n : ℝ)) (by fun_prop) filter_upwards with D have hc : cellCount n h k D j ≤ n := by simpa only [cellCount, Fintype.card_fin] using (Finset.card_le_univ (cellRecords n h k D j)) simpa only [Real.norm_eq_abs] using (cell_contribution_bounds n k h D j).2.trans (by exact_mod_cast hc)
CausalSmith.Stat.PrivateCateRoughdesign.integrable_denominatorCell · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CellMoments.lean:426

Population statistics sum the cell expectations, without independence between cell counts. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
conclusion 1
Nbar n h k Q = ∑ j : Fin k, ∫ D, numeratorCell n h k D j ∂Q
conclusion 2
Dbar n h k Q = ∑ j : Fin k, ∫ D, denominatorCell n h k D j ∂Q
Proof (Lean source)
-- @node: population_cell_sum lemma population_cell_sum (n k : ℕ) (h : ℝ) (Q : Measure (Dataset n)) [IsFiniteMeasure Q] : Nbar n h k Q = ∑ j : Fin k, ∫ D, numeratorCell n h k D j ∂Q ∧ Dbar n h k Q = ∑ j : Fin k, ∫ D, denominatorCell n h k D j ∂Q := by constructor · exact integral_finset_sum _ (fun j _ => integrable_numeratorCell n k h j Q) · exact integral_finset_sum _ (fun j _ => integrable_denominatorCell n k h j Q)
CausalSmith.Stat.PrivateCateRoughdesign.population_cell_sum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CellMoments.lean:439
theorem conditional_cell_contribution_expectation

Conditional on exact membership labels, the two cell contributions equal the eligible occupancy times their respective conditional pair moments. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
hk :
2 ≤ k
hh :
0 < h ∧ h ≤ 1 / 4
P :
hP :
j :
Fin k
I :
Q :
((dataLaw n P) {D | cellRecords n h k D j = I})⁻¹ • (dataLaw n P).restrict {D | cellRecords n h k D j = I}
(∫ D, numeratorCell n h k D j ∂Q)
= (∫ D, (if cellCount n h k D j < 2 then 0 else (cellCount n h k D j : ℝ)) ∂Q) * nu h k P j
(∫ D, denominatorCell n h k D j ∂Q)
= (∫ D, (if cellCount n h k D j < 2 then 0 else (cellCount n h k D j : ℝ)) ∂Q) * dj h k P j
Proof (Lean source)
-- @node: conditional_cell_contribution_expectation lemma conditional_cell_contribution_expectation (n k : ℕ) (h : ℝ) (hk : 2 ≤ k) (hh : 0 < h ∧ h ≤ 1 / 4) (P : CausalLaw) (hP : CompleteModel P) (j : Fin k) (I : Finset (Fin n)) : let Q := ((dataLaw n P) {D | cellRecords n h k D j = I})⁻¹ • (dataLaw n P).restrict {D | cellRecords n h k D j = I} (∫ D, numeratorCell n h k D j ∂Q) = (∫ D, (if cellCount n h k D j < 2 then 0 else (cellCount n h k D j : ℝ)) ∂Q) * nu h k P j ∧ (∫ D, denominatorCell n h k D j ∂Q) = (∫ D, (if cellCount n h k D j < 2 then 0 else (cellCount n h k D j : ℝ)) ∂Q) * dj h k P j := by classical dsimp only let Q := ((dataLaw n P) {D | cellRecords n h k D j = I})⁻¹ • (dataLaw n P).restrict {D | cellRecords n h k D j = I} have hp := cell_membership_label_positive n k h hk hh P hP j I let : IsProbabilityMeasure Q := conditional_membership_probability n k h P j I hp let := conditionalCellLaw_probability k h (by omega) hh P hP j let e : Fin I.card ≃ {i // i ∈ I} := (Fintype.equivFinOfCardEq (by simp)).symm have hae : ∀ᵐ D ∂Q, cellRecords n h k D j = I := Measure.ae_smul_measure (ae_restrict_mem (measurableSet_cell_membership n k h j I)) _ have hcount : (∫ D, (if cellCount n h k D j < 2 then 0 else (cellCount n h k D j : ℝ)) ∂Q) = if I.card < 2 then 0 else (I.card : ℝ) := by calc _ = ∫ _D : Dataset n, (if I.card < 2 then 0 else (I.card : ℝ)) ∂Q := by apply integral_congr_ae filter_upwards [hae] with D hD simp only [cellCount, hD] _ = _ := by simp have hN : (fun D => numeratorCell n h k D j) =ᵐ[Q] (fun D => pairContribution KN (fun i => D (e i))) := by filter_upwards [hae] with D hD rw [(selected_pair_formulas I D e).1] simp only [numeratorCell, selectedNumerator, cellCount, cellSum, hD] have hD : (fun D => denominatorCell n h k D j) =ᵐ[Q] (fun D => pairContribution KD (fun i => D (e i))) := by filter_upwards [hae] with D hD rw [(selected_pair_formulas I D e).2] simp only [denominatorCell, selectedDenominator, cellCount, cellSum, hD] change (∫ D, numeratorCell n h k D j ∂Q) = _ ∧ (∫ D, denominatorCell n h k D j ∂Q) = _ rw [integral_congr_ae hN, integral_congr_ae hD, hcount] constructor · exact conditional_selected_pairContribution_expectation n k h P j I hp e KN (integrable_causal_pair_numerator _) · exact conditional_selected_pairContribution_expectation n k h P j I hp e KD (integrable_causal_pair_denominator _)
CausalSmith.Stat.PrivateCateRoughdesign.conditional_cell_contribution_expectation · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CellMoments.lean:449
theorem integral_cell_membership_partition Lemma integral_cell_membership_partition in the paper ↗

Integrating a function over all datasets is summing its integrals on the disjoint exact membership-label events. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
j :
Fin k
μ :
f :
Dataset n → ℝ
hf :
(∫ D, f D ∂μ) = ∑ I : Finset (Fin n), ∫ D in {D | cellRecords n h k D j = I}, f D ∂μ
Proof (Lean source)
-- @node: integral_cell_membership_partition lemma integral_cell_membership_partition (n k : ℕ) (h : ℝ) (j : Fin k) (μ : Measure (Dataset n)) (f : Dataset n → ℝ) (hf : Integrable f μ) : (∫ D, f D ∂μ) = ∑ I : Finset (Fin n), ∫ D in {D | cellRecords n h k D j = I}, f D ∂μ := by have huniv : (⋃ I : Finset (Fin n), {D | cellRecords n h k D j = I}) = univ := by ext D simp rw [← integral_iUnion_fintype (fun I => measurableSet_cell_membership n k h j I) (fun I J hIJ => Set.disjoint_left.mpr (fun D hI hJ => hIJ (hI.symm.trans hJ))) (fun _ => hf.integrableOn), huniv, Measure.restrict_univ]
CausalSmith.Stat.PrivateCateRoughdesign.integral_cell_membership_partition · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CellMoments.lean:500
theorem cell_membership_setIntegral_normalize

Undoing normalization multiplies each conditional integral by the probability of its membership-label event. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
hk :
2 ≤ k
hh :
0 < h ∧ h ≤ 1 / 4
P :
hP :
j :
Fin k
I :
f :
Dataset n → ℝ
(∫ D in {D | cellRecords n h k D j = I}, f D ∂dataLaw n P)
= (dataLaw n P).real {D | cellRecords n h k D j = I} * ∫ D, f D ∂(((dataLaw n P) {D | cellRecords n h k D j = I})⁻¹ • (dataLaw n P).restrict {D | cellRecords n h k D j = I})
Proof (Lean source)
-- @node: cell_membership_setIntegral_normalize lemma cell_membership_setIntegral_normalize (n k : ℕ) (h : ℝ) (hk : 2 ≤ k) (hh : 0 < h ∧ h ≤ 1 / 4) (P : CausalLaw) (hP : CompleteModel P) (j : Fin k) (I : Finset (Fin n)) (f : Dataset n → ℝ) : (∫ D in {D | cellRecords n h k D j = I}, f D ∂dataLaw n P) = (dataLaw n P).real {D | cellRecords n h k D j = I} * ∫ D, f D ∂(((dataLaw n P) {D | cellRecords n h k D j = I})⁻¹ • (dataLaw n P).restrict {D | cellRecords n h k D j = I}) := by classical let : IsProbabilityMeasure (Pobs P) := Measure.isProbabilityMeasure_map measurable_observe.aemeasurable let : IsProbabilityMeasure (dataLaw n P) := by unfold dataLaw; infer_instance have hp : (dataLaw n P) {D | cellRecords n h k D j = I} ≠ 0 := by rw [cell_membership_rectangle, dataLaw, Measure.pi_pi] apply Finset.prod_ne_zero_iff.mpr intro i hi exact cell_membership_label_positive n k h hk hh P hP j I i have hr : (dataLaw n P).real {D | cellRecords n h k D j = I} ≠ 0 := ENNReal.toReal_ne_zero.mpr ⟨hp, measure_ne_top _ _⟩ rw [integral_smul_measure, ENNReal.toReal_inv] simp only [smul_eq_mul, ← mul_assoc] rw [show ((dataLaw n P) {D | cellRecords n h k D j = I}).toReal = (dataLaw n P).real {D | cellRecords n h k D j = I} from rfl, mul_inv_cancel₀ hr, one_mul]
CausalSmith.Stat.PrivateCateRoughdesign.cell_membership_setIntegral_normalize · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CellMoments.lean:515
theorem occupancy_cancellation

The common occupancy weights cancel in the population ratio for every admissible density. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
hn :
2 ≤ n
hk :
2 ≤ k
hh :
0 < h ∧ h ≤ 1 / 4
P :
Q :
hiid :
hP :
conclusion 1
Nbar n h k Q = ∑ j : Fin k, occupancyWeight n h k P j * nu h k P j
conclusion 2
Dbar n h k Q = ∑ j : Fin k, occupancyWeight n h k P j * dj h k P j
conclusion 3
j :
Fin k
3/8 ≤ dj h k P j
|nu h k P j - theta P * dj h k P j| ≤ bias h k * dj h k P j
conclusion 4
info n h k / 8 ≤ Wocc n h k P
conclusion 5
Wocc n h k P ≤ 9*info n h k/2
conclusion 6
d0 n h k ≤ Dbar n h k Q
conclusion 7
|Nbar n h k Q / Dbar n h k Q - theta P| ≤ bias h k
Proof (Lean source)
-- @node: lem:occupancy-cancellation lemma occupancy_cancellation (n k : ℕ) (h : ℝ) (hn : 2 ≤ n) (hk : 2 ≤ k) (hh : 0 < h ∧ h ≤ 1 / 4) (P : CausalLaw) (Q : Measure (Dataset n)) (hiid : IIDSampling n P Q) (hP : CompleteModel P) : Nbar n h k Q = ∑ j : Fin k, occupancyWeight n h k P j * nu h k P j ∧ Dbar n h k Q = ∑ j : Fin k, occupancyWeight n h k P j * dj h k P j ∧ (∀ j : Fin k, 3/8 ≤ dj h k P j ∧ |nu h k P j - theta P * dj h k P j| ≤ bias h k * dj h k P j) ∧ info n h k / 8 ≤ Wocc n h k P ∧ Wocc n h k P ≤ 9*info n h k/2 ∧ d0 n h k ≤ Dbar n h k Q ∧ |Nbar n h k Q / Dbar n h k Q - theta P| ≤ bias h k := by let : IsProbabilityMeasure (Pobs P) := Measure.isProbabilityMeasure_map measurable_observe.aemeasurable let : IsProbabilityMeasure (dataLaw n P) := by unfold dataLaw; infer_instance let : IsProbabilityMeasure Q := hiid.symm ▸ inferInstance have hconditional : ∀ j : Fin k, (∫ D, numeratorCell n h k D j ∂Q) = (∫ D, (if cellCount n h k D j < 2 then 0 else (cellCount n h k D j : ℝ)) ∂Q) * nu h k P j ∧ (∫ D, denominatorCell n h k D j ∂Q) = (∫ D, (if cellCount n h k D j < 2 then 0 else (cellCount n h k D j : ℝ)) ∂Q) * dj h k P j := by intro j rw [hiid] have hlabel (I : Finset (Fin n)) := conditional_cell_contribution_expectation n k h hk hh P hP j I have hlocal (I : Finset (Fin n)) : (∫ D in {D | cellRecords n h k D j = I}, numeratorCell n h k D j ∂dataLaw n P) = (∫ D in {D | cellRecords n h k D j = I}, (if cellCount n h k D j < 2 then 0 else (cellCount n h k D j : ℝ)) ∂dataLaw n P) * nu h k P j ∧ (∫ D in {D | cellRecords n h k D j = I}, denominatorCell n h k D j ∂dataLaw n P) = (∫ D in {D | cellRecords n h k D j = I}, (if cellCount n h k D j < 2 then 0 else (cellCount n h k D j : ℝ)) ∂dataLaw n P) * dj h k P j := by simp only [cell_membership_setIntegral_normalize n k h hk hh P hP j I] rw [(hlabel I).1, (hlabel I).2] constructor <;> ring rw [integral_cell_membership_partition n k h j _ _ (integrable_numeratorCell n k h j _), integral_cell_membership_partition n k h j _ _ (integrable_denominatorCell n k h j _), integral_cell_membership_partition n k h j _ _ (integrable_cell_partner_count n k h j _)] constructor · simp_rw [(hlocal _).1, Finset.sum_mul] · simp_rw [(hlocal _).2, Finset.sum_mul] have hweight (j : Fin k) : (∫ D, (if cellCount n h k D j < 2 then 0 else (cellCount n h k D j : ℝ)) ∂Q) = occupancyWeight n h k P j := by rw [hiid] exact iid_cell_partner_count_expectation n k h P j have hpopulation : Nbar n h k Q = ∑ j : Fin k, occupancyWeight n h k P j * nu h k P j ∧ Dbar n h k Q = ∑ j : Fin k, occupancyWeight n h k P j * dj h k P j := by obtain ⟨hsN, hsD⟩ := population_cell_sum n k h Q constructor · rw [hsN] apply Finset.sum_congr rfl intro j hj rw [(hconditional j).1, hweight] · rw [hsD] apply Finset.sum_congr rfl intro j hj rw [(hconditional j).2, hweight] obtain ⟨hN, hD⟩ := hpopulation have hc : ∀ j : Fin k, 3 / 8 ≤ dj h k P j ∧ |nu h k P j - theta P * dj h k P j| ≤ bias h k * dj h k P j := fun j => ⟨conditional_cell_denominator_lower k h (by omega) hh P hP j, conditional_cell_bias_bound k h (by omega) hh P hP j⟩ obtain ⟨hWlo, hWhi⟩ := occupancy_comparisons n k h hn (by omega) hh P hP obtain ⟨hfloor, hbias⟩ := occupancy_ratio_assembly n k h P Q (by omega) (by omega) hh.1 hN hD hc hWlo exact ⟨hN, hD, hc, hWlo, hWhi, hfloor, hbias⟩
CausalSmith.Stat.PrivateCateRoughdesign.occupancy_cancellation · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CellMoments.lean:542
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.ComponentAmplitude 27 declarations Free-amplitude conditional mark arrays and their derivative bounds for the second-order component contraction argument.

Free-amplitude conditional mark arrays and their derivative bounds for the second-order component contraction argument.

The Fourier mark mass with a free amplitude and fixed perturbation and bump.

Definition (Lean source)
S q u :
ℝ
z :
amplitudeMarkMass S q u z :
ℝ
(1 + (2*bit z.1-1)*u*S + (2*bit z.2-1)*(u^3*q-u)*S + (2*bit z.1-1)*(2*bit z.2-1)*u^2*(q-S^2))/4

The first amplitude derivative of the four conditional masses.

Definition (Lean source)
S q u :
ℝ
z :
amplitudeMarkSlope S q u z :
ℝ
((2*bit z.1-1)*S + (2*bit z.2-1)*(3*u^2*q-1)*S + (2*bit z.1-1)*(2*bit z.2-1)*2*u*(q-S^2))/4

The second amplitude derivative of the four conditional masses.

Definition (Lean source)
S q u :
ℝ
z :
amplitudeMarkCurvature S q u z :
ℝ
((2*bit z.2-1)*6*u*q*S + (2*bit z.1-1)*(2*bit z.2-1)*2*(q-S^2))/4
CausalSmith.Stat.PrivateCateRoughdesign.amplitudeMarkCurvature · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentAmplitude.lean:23

A Bernoulli Fourier mark has absolute value one. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
b :
|2*bit b-1| = 1
Proof (Lean source)
-- @node: abs_bit_sign lemma abs_bit_sign (b : Bool) : |2*bit b-1| = 1 := by cases b <;> norm_num [bit]

The finite Fourier triangle inequality bounds the sum of absolute mark masses. the theorem's stated inputs and assumptions, and the asserted conclusion follows.

Formal statement
a b c d :
ℝ
(∑ z : Bool × Bool, |(a + (2*bit z.1-1)*b + (2*bit z.2-1)*c + (2*bit z.1-1)*(2*bit z.2-1)*d)/4|)
≤ |a|+|b|+|c|+|d|
Proof (Lean source)
-- @node: markFourier_abs_sum_le lemma markFourier_abs_sum_le (a b c d : ℝ) : (∑ z : Bool × Bool, |(a + (2*bit z.1-1)*b + (2*bit z.2-1)*c + (2*bit z.1-1)*(2*bit z.2-1)*d)/4|) ≤ |a|+|b|+|c|+|d| := by have hp (z : Bool × Bool) : |(a + (2*bit z.1-1)*b + (2*bit z.2-1)*c + (2*bit z.1-1)*(2*bit z.2-1)*d)/4| ≤ (|a|+|b|+|c|+|d|)/4 := by rw [abs_div, abs_of_pos (by norm_num : (0 : ℝ) < 4)] apply div_le_div_of_nonneg_right _ (by norm_num) calc _ ≤ |a| + |(2*bit z.1-1)*b| + |(2*bit z.2-1)*c| + |(2*bit z.1-1)*(2*bit z.2-1)*d| := by have h1 := abs_add_le a ((2*bit z.1-1)*b) have h2 := abs_add_le (a+(2*bit z.1-1)*b) ((2*bit z.2-1)*c) have h3 := abs_add_le (a+(2*bit z.1-1)*b+(2*bit z.2-1)*c) ((2*bit z.1-1)*(2*bit z.2-1)*d) linarith _ = _ := by simp only [abs_mul, abs_bit_sign, one_mul] have hs := Finset.sum_le_sum (fun z (_ : z ∈ univ) => hp z) simp only [Finset.sum_const, Finset.card_univ, Fintype.card_prod, Fintype.card_bool, nsmul_eq_mul, Nat.cast_mul, Nat.cast_ofNat] at hs linarith
CausalSmith.Stat.PrivateCateRoughdesign.markFourier_abs_sum_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentAmplitude.lean:33
theorem amplitudeMarkMass_factorization

The free-amplitude mass is the product of the treatment and outcome Bernoulli factors. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
S q u :
ℝ
z :
= ((1+(2*bit z.1-1)*u*S)/2) * ((1+(2*bit z.2-1)*(-u*S+(2*bit z.1-1)*u^2*q))/2)
Proof (Lean source)
-- @node: amplitudeMarkMass_factorization lemma amplitudeMarkMass_factorization (S q u : ℝ) (z : Bool × Bool) : amplitudeMarkMass S q u z = ((1+(2*bit z.1-1)*u*S)/2) * ((1+(2*bit z.2-1)*(-u*S+(2*bit z.1-1)*u^2*q))/2) := by rcases z with ⟨a, b⟩ cases a <;> cases b <;> norm_num [amplitudeMarkMass, bit] <;> ring
CausalSmith.Stat.PrivateCateRoughdesign.amplitudeMarkMass_factorization · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentAmplitude.lean:60
theorem amplitudeMarkMass_sum

Summing the four conditional masses gives one at every amplitude. The displayed conclusion follows.

Formal statement
S q u :
ℝ
(∑ z : Bool × Bool, amplitudeMarkMass S q u z) = 1
Proof (Lean source)
-- @node: amplitudeMarkMass_sum lemma amplitudeMarkMass_sum (S q u : ℝ) : (∑ z : Bool × Bool, amplitudeMarkMass S q u z) = 1 := by simp [Fintype.sum_prod_type, amplitudeMarkMass, bit] ring
theorem amplitudeMarkMass_zero

The mass at zero amplitude is the fair pair mass. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
S q :
ℝ
z :
amplitudeMarkMass S q 0 z = 1 / 4
Proof (Lean source)
-- @node: amplitudeMarkMass_zero lemma amplitudeMarkMass_zero (S q : ℝ) (z : Bool × Bool) : amplitudeMarkMass S q 0 z = 1 / 4 := by simp [amplitudeMarkMass]
CausalSmith.Stat.PrivateCateRoughdesign.amplitudeMarkMass_zero · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentAmplitude.lean:76
theorem amplitudeMarkMass_actual

The actual alternative is the free-amplitude array evaluated at the square-root separation. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
lam :
x :
z :
= conditionalLikelihood hL lam x z.1 z.2 / 4
Proof (Lean source)
-- @node: amplitudeMarkMass_actual lemma amplitudeMarkMass_actual (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (lam : SignVector hL) (x : Covariate) (z : Bool × Bool) : amplitudeMarkMass (perturbation hL lam x) (bump hL x) (sqrt (separation hL)) z = conditionalLikelihood hL lam x z.1 z.2 / 4 := by rw [conditionalLikelihood_fourier hL hhL] have hs := Real.sq_sqrt (separation_unit_range hL hhL).1 dsimp [amplitudeMarkMass] rw [pow_succ, hs] ring
CausalSmith.Stat.PrivateCateRoughdesign.amplitudeMarkMass_actual · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentAmplitude.lean:82
theorem amplitudeMarkMass_hasDerivAt

The polynomial first derivative is valid at every real amplitude. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
S q u :
ℝ
z :
HasDerivAt (fun v => amplitudeMarkMass S q v z) (amplitudeMarkSlope S q u z) u
Proof (Lean source)
-- @node: amplitudeMarkMass_hasDerivAt lemma amplitudeMarkMass_hasDerivAt (S q u : ℝ) (z : Bool × Bool) : HasDerivAt (fun v => amplitudeMarkMass S q v z) (amplitudeMarkSlope S q u z) u := by convert (((hasDerivAt_const u (1 : ℝ)).add (((hasDerivAt_id u).const_mul (2*bit z.1-1)).mul_const S)).add (((((hasDerivAt_id u).pow 3).mul_const q).sub (hasDerivAt_id u)).const_mul (2*bit z.2-1) |>.mul_const S)).add ((((hasDerivAt_id u).pow 2).const_mul ((2*bit z.1-1)*(2*bit z.2-1))).mul_const (q-S^2)) |>.div_const 4 using 1 <;> first | rfl | (dsimp [amplitudeMarkMass, amplitudeMarkSlope]; ring)
CausalSmith.Stat.PrivateCateRoughdesign.amplitudeMarkMass_hasDerivAt · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentAmplitude.lean:94
theorem amplitudeMarkSlope_hasDerivAt

The polynomial second derivative is valid at every real amplitude. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
S q u :
ℝ
z :
Proof (Lean source)
-- @node: amplitudeMarkSlope_hasDerivAt lemma amplitudeMarkSlope_hasDerivAt (S q u : ℝ) (z : Bool × Bool) : HasDerivAt (fun v => amplitudeMarkSlope S q v z) (amplitudeMarkCurvature S q u z) u := by convert (((hasDerivAt_const u ((2*bit z.1-1)*S)).add ((((((hasDerivAt_id u).pow 2).const_mul 3).mul_const q).sub (hasDerivAt_const u (1 : ℝ))).const_mul (2*bit z.2-1) |>.mul_const S)).add (((hasDerivAt_id u).const_mul ((2*bit z.1-1)*(2*bit z.2-1)*2)).mul_const (q-S^2))) |>.div_const 4 using 1 <;> first | rfl | (dsimp [amplitudeMarkSlope, amplitudeMarkCurvature]; ring)
CausalSmith.Stat.PrivateCateRoughdesign.amplitudeMarkSlope_hasDerivAt · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentAmplitude.lean:106
theorem amplitudeMarkMass_pos

Legal free amplitudes keep both Bernoulli factors strictly positive. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
S q u :
ℝ
hS :
|S| ≤ 3 / 2
hq :
q ∈ Icc 0 1
hu :
u ∈ Icc 0 (1 / 10)
z :
0 < amplitudeMarkMass S q u z
Proof (Lean source)
-- @node: amplitudeMarkMass_pos lemma amplitudeMarkMass_pos (S q u : ℝ) (hS : |S| ≤ 3 / 2) (hq : q ∈ Icc 0 1) (hu : u ∈ Icc 0 (1 / 10)) (z : Bool × Bool) : 0 < amplitudeMarkMass S q u z := by have hlin : |u*S| ≤ 3 / 20 := by rw [abs_mul, abs_of_nonneg hu.1] have := mul_le_mul hu.2 hS (abs_nonneg S) (by norm_num : (0 : ℝ) ≤ 1 / 10) norm_num at this exact this have hquad : |u^2*q| ≤ 1 / 100 := by rw [abs_mul, abs_of_nonneg (sq_nonneg u), abs_of_nonneg hq.1] have hu2 : u^2 ≤ 1 / 100 := by nlinarith [hu.1, hu.2] nlinarith [mul_le_mul_of_nonneg_left hq.2 (sq_nonneg u)] have ha : |(2*bit z.1-1)*u*S| ≤ 3 / 20 := by simpa only [mul_assoc, abs_mul, abs_bit_sign, one_mul] using hlin have hb : |(2*bit z.2-1)*(-u*S+(2*bit z.1-1)*u^2*q)| ≤ 4 / 25 := by rw [abs_mul, abs_bit_sign, one_mul] have htri := abs_add_le (-u*S) ((2*bit z.1-1)*u^2*q) have hfirst : |-u*S| = |u*S| := by rw [neg_mul, abs_neg] have hsecond : |(2*bit z.1-1)*u^2*q| = |u^2*q| := by rw [mul_assoc, abs_mul, abs_bit_sign, one_mul] rw [hfirst, hsecond] at htri linarith rw [amplitudeMarkMass_factorization] exact mul_pos (by linarith [(abs_le.mp ha).1]) (by linarith [(abs_le.mp hb).1])
theorem amplitudeMarkMass_abs_sum

The four conditional masses have unit ℓ₁ norm on the free-amplitude path. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
S q u :
ℝ
hS :
|S| ≤ 3 / 2
hq :
q ∈ Icc 0 1
hu :
u ∈ Icc 0 (1 / 10)
(∑ z : Bool × Bool, |amplitudeMarkMass S q u z|) = 1
Proof (Lean source)
-- @node: amplitudeMarkMass_abs_sum lemma amplitudeMarkMass_abs_sum (S q u : ℝ) (hS : |S| ≤ 3 / 2) (hq : q ∈ Icc 0 1) (hu : u ∈ Icc 0 (1 / 10)) : (∑ z : Bool × Bool, |amplitudeMarkMass S q u z|) = 1 := by simp_rw [abs_of_pos (amplitudeMarkMass_pos S q u hS hq hu _)] exact amplitudeMarkMass_sum S q u
CausalSmith.Stat.PrivateCateRoughdesign.amplitudeMarkMass_abs_sum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentAmplitude.lean:145
theorem amplitudeMarkSlope_abs_sum_le

The Fourier coefficients bound the ℓ₁ norm of the first derivative. The displayed conclusion follows.

Formal statement
S q u :
ℝ
(∑ z : Bool × Bool, |amplitudeMarkSlope S q u z|)
≤ |S| + |3*u^2*q-1| * |S| + 2*|u| * |q - S^2|
Proof (Lean source)
-- @node: amplitudeMarkSlope_abs_sum_le lemma amplitudeMarkSlope_abs_sum_le (S q u : ℝ) : (∑ z : Bool × Bool, |amplitudeMarkSlope S q u z|) ≤ |S| + |3*u^2*q-1| * |S| + 2*|u| * |q - S^2| := by have h := markFourier_abs_sum_le 0 S ((3*u^2*q-1)*S) (2*u*(q-S^2)) have he (z : Bool × Bool) : amplitudeMarkSlope S q u z = (0+(2*bit z.1-1)*S+(2*bit z.2-1)*((3*u^2*q-1)*S)+ (2*bit z.1-1)*(2*bit z.2-1)*(2*u*(q-S^2)))/4 := by dsimp [amplitudeMarkSlope] ring simp_rw [he] simpa only [abs_zero, zero_add, abs_mul, abs_of_nonneg (by norm_num : (0 : ℝ) ≤ 2), abs_of_nonneg (by norm_num : (0 : ℝ) ≤ 6)] using h
CausalSmith.Stat.PrivateCateRoughdesign.amplitudeMarkSlope_abs_sum_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentAmplitude.lean:153
theorem amplitudeMarkCurvature_abs_sum_le

The Fourier coefficients bound the ℓ₁ norm of the second derivative. The displayed conclusion follows.

Formal statement
S q u :
ℝ
(∑ z : Bool × Bool, |amplitudeMarkCurvature S q u z|) ≤ 6*|u| * |q| * |S| + 2*|q - S^2|
Proof (Lean source)
-- @node: amplitudeMarkCurvature_abs_sum_le lemma amplitudeMarkCurvature_abs_sum_le (S q u : ℝ) : (∑ z : Bool × Bool, |amplitudeMarkCurvature S q u z|) ≤ 6*|u| * |q| * |S| + 2*|q - S^2| := by have h := markFourier_abs_sum_le 0 0 (6*u*q*S) (2*(q-S^2)) have he (z : Bool × Bool) : amplitudeMarkCurvature S q u z = (0+(2*bit z.1-1)*0+(2*bit z.2-1)*(6*u*q*S)+ (2*bit z.1-1)*(2*bit z.2-1)*(2*(q-S^2)))/4 := by dsimp [amplitudeMarkCurvature] ring simp_rw [he] simpa only [abs_zero, zero_add, abs_mul, abs_of_nonneg (by norm_num : (0 : ℝ) ≤ 2), abs_of_nonneg (by norm_num : (0 : ℝ) ≤ 6)] using h
CausalSmith.Stat.PrivateCateRoughdesign.amplitudeMarkCurvature_abs_sum_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentAmplitude.lean:170
theorem amplitudeMarkSlope_abs_sum_le_four

The first derivative has ℓ₁ norm at most four throughout the amplitude path. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
S q u :
ℝ
hS :
|S| ≤ 3 / 2
hq :
q ∈ Icc 0 1
hr :
|q - S^2| ≤ 1
hu :
u ∈ Icc 0 (1 / 10)
(∑ z : Bool × Bool, |amplitudeMarkSlope S q u z|) ≤ 4
Proof (Lean source)
-- @node: amplitudeMarkSlope_abs_sum_le_four lemma amplitudeMarkSlope_abs_sum_le_four (S q u : ℝ) (hS : |S| ≤ 3 / 2) (hq : q ∈ Icc 0 1) (hr : |q - S^2| ≤ 1) (hu : u ∈ Icc 0 (1 / 10)) : (∑ z : Bool × Bool, |amplitudeMarkSlope S q u z|) ≤ 4 := by have hu2 : u^2 ≤ 1 / 100 := by nlinarith [hu.1, hu.2] have hcoef : |3*u^2*q-1| ≤ 1 := by apply abs_le.mpr constructor · nlinarith [mul_nonneg (sq_nonneg u) hq.1] · nlinarith [mul_le_mul_of_nonneg_left hq.2 (sq_nonneg u)] have hmiddle : |3*u^2*q-1| * |S| ≤ 3 / 2 := by have := mul_le_mul hcoef hS (abs_nonneg S) (by norm_num : (0 : ℝ) ≤ 1) simpa using this have hlast : 2*|u| * |q - S^2| ≤ 1 / 5 := by rw [abs_of_nonneg hu.1] nlinarith [mul_le_mul_of_nonneg_left hr hu.1] exact (amplitudeMarkSlope_abs_sum_le S q u).trans (by linarith)
CausalSmith.Stat.PrivateCateRoughdesign.amplitudeMarkSlope_abs_sum_le_four · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentAmplitude.lean:187
theorem amplitudeMarkCurvature_abs_sum_le_four

The second derivative has ℓ₁ norm at most four throughout the amplitude path. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
S q u :
ℝ
hS :
|S| ≤ 3 / 2
hq :
q ∈ Icc 0 1
hr :
|q - S^2| ≤ 1
hu :
u ∈ Icc 0 (1 / 10)
(∑ z : Bool × Bool, |amplitudeMarkCurvature S q u z|) ≤ 4
Proof (Lean source)
-- @node: amplitudeMarkCurvature_abs_sum_le_four lemma amplitudeMarkCurvature_abs_sum_le_four (S q u : ℝ) (hS : |S| ≤ 3 / 2) (hq : q ∈ Icc 0 1) (hr : |q - S^2| ≤ 1) (hu : u ∈ Icc 0 (1 / 10)) : (∑ z : Bool × Bool, |amplitudeMarkCurvature S q u z|) ≤ 4 := by have hprod : u*q ≤ 1 / 10 := by nlinarith [hu.2, mul_le_mul_of_nonneg_left hq.2 hu.1] have hfirst : 6*u*q*|S| ≤ 9 / 10 := by have := mul_le_mul hprod hS (abs_nonneg S) (by norm_num : (0 : ℝ) ≤ 1 / 10) nlinarith have h := amplitudeMarkCurvature_abs_sum_le S q u rw [abs_of_nonneg hu.1, abs_of_nonneg hq.1] at h linarith
CausalSmith.Stat.PrivateCateRoughdesign.amplitudeMarkCurvature_abs_sum_le_four · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentAmplitude.lean:206
theorem amplitudeMark_coefficients_valid Lemma amplitudeMark_coefficients_valid in the paper ↗

The actual perturbation and bump satisfy all coefficient bounds used by the path. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
lam :
x :
conclusion 1
|perturbation hL lam x| ≤ 3 / 2
conclusion 2
bump hL x ∈ Icc 0 1
conclusion 3
|bump hL x-(perturbation hL lam x)^2| ≤ 1
Proof (Lean source)
-- @node: amplitudeMark_coefficients_valid lemma amplitudeMark_coefficients_valid (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (lam : SignVector hL) (x : Covariate) : |perturbation hL lam x| ≤ 3 / 2 ∧ bump hL x ∈ Icc 0 1 ∧ |bump hL x-(perturbation hL lam x)^2| ≤ 1 := by exact ⟨perturbation_abs_le_three_halves hL hhL lam x, bump_range hL x, (perturbation_square_residual_abs_le_bump hL hhL lam x).trans (bump_range hL x).2⟩
CausalSmith.Stat.PrivateCateRoughdesign.amplitudeMark_coefficients_valid · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentAmplitude.lean:220
theorem sqrt_separation_amplitude_range Lemma sqrt_separation_amplitude_range in the paper ↗

The actual square-root separation belongs to the path's amplitude interval. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
sqrt (separation hL) ∈ Icc 0 (1 / 10)
Proof (Lean source)
-- @node: sqrt_separation_amplitude_range lemma sqrt_separation_amplitude_range (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) : sqrt (separation hL) ∈ Icc 0 (1 / 10) := by have ht : separation hL ≤ 1 / 16384 := by dsimp [separation, kappa] linarith [hhL.2] have hs := Real.sq_sqrt (separation_unit_range hL hhL).1 exact ⟨Real.sqrt_nonneg _, by nlinarith [Real.sqrt_nonneg (separation hL)]⟩
CausalSmith.Stat.PrivateCateRoughdesign.sqrt_separation_amplitude_range · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentAmplitude.lean:229
theorem amplitudeMarkSlope_zero

At zero amplitude each first derivative is linear in the latent perturbation. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
S q :
ℝ
z :
amplitudeMarkSlope S q 0 z = ((2*bit z.1-1)-(2*bit z.2-1))*S/4
Proof (Lean source)
-- @node: amplitudeMarkSlope_zero lemma amplitudeMarkSlope_zero (S q : ℝ) (z : Bool × Bool) : amplitudeMarkSlope S q 0 z = ((2*bit z.1-1)-(2*bit z.2-1))*S/4 := by dsimp [amplitudeMarkSlope] ring
CausalSmith.Stat.PrivateCateRoughdesign.amplitudeMarkSlope_zero · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentAmplitude.lean:240
theorem amplitudeMarkSlope_sign_sum_zero

Averaging the zero-amplitude derivative cancels the independent fair signs. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
x :
z :
(∑ lam : SignVector hL, amplitudeMarkSlope (perturbation hL lam x) (bump hL x) 0 z) = 0
Proof (Lean source)
-- @node: amplitudeMarkSlope_sign_sum_zero lemma amplitudeMarkSlope_sign_sum_zero (hL : ℝ) (x : Covariate) (z : Bool × Bool) : (∑ lam : SignVector hL, amplitudeMarkSlope (perturbation hL lam x) (bump hL x) 0 z) = 0 := by simp_rw [amplitudeMarkSlope_zero] rw [← Finset.sum_div, ← Finset.mul_sum, perturbation_sign_sum, mul_zero, zero_div]
CausalSmith.Stat.PrivateCateRoughdesign.amplitudeMarkSlope_sign_sum_zero · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentAmplitude.lean:247
theorem amplitudeMarkMass_sign_sum_exact

Every free-amplitude singleton mixture is exactly the fair mark law. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
x :
u :
ℝ
z :
(∑ lam : SignVector hL, amplitudeMarkMass (perturbation hL lam x) (bump hL x) u z)
= (card (SignVector hL) : ℝ)/4
Proof (Lean source)
-- @node: amplitudeMarkMass_sign_sum_exact lemma amplitudeMarkMass_sign_sum_exact (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (x : Covariate) (u : ℝ) (z : Bool × Bool) : (∑ lam : SignVector hL, amplitudeMarkMass (perturbation hL lam x) (bump hL x) u z) = (card (SignVector hL) : ℝ)/4 := by have hquad : (∑ lam : SignVector hL, (perturbation hL lam x)^2) = (card (SignVector hL) : ℝ)*bump hL x := by rw [perturbation_sign_square_sum, weighted_frame_square_partition hL hhL] simp only [amplitudeMarkMass, ← Finset.sum_div, Finset.sum_add_distrib, ← Finset.mul_sum, Finset.sum_sub_distrib, perturbation_sign_sum, hquad, Finset.sum_const, Finset.card_univ, nsmul_eq_mul] ring
CausalSmith.Stat.PrivateCateRoughdesign.amplitudeMarkMass_sign_sum_exact · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentAmplitude.lean:255

The finite sign mixture of component mark masses along the amplitude path.

Definition (Lean source)
hL :
ℝ
n :
ℕ
x :
C :
z :
u :
ℝ
componentAmplitudeMass hL n x C z u :
ℝ
(2 : ℝ)^(-((activeSigns hL).card : ℤ)) * ∑ lam : SignVector hL, ∏ i : C, amplitudeMarkMass (perturbation hL lam (x i)) (bump hL (x i)) u (z i)
CausalSmith.Stat.PrivateCateRoughdesign.componentAmplitudeMass · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentAmplitude.lean:271
theorem componentAmplitudeMass_actual

The amplitude path's endpoint is precisely the existing alternative component array. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
x :
C :
z :
componentAmplitudeMass hL n x C z (sqrt (separation hL)) = alternativeMass hL n x C z
Proof (Lean source)
-- @node: componentAmplitudeMass_actual lemma componentAmplitudeMass_actual (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (x : Fin n → Covariate) (C : Finset (Fin n)) (z : Marks C) : componentAmplitudeMass hL n x C z (sqrt (separation hL)) = alternativeMass hL n x C z := by simp only [componentAmplitudeMass, amplitudeMarkMass_actual hL hhL, alternativeMass]
CausalSmith.Stat.PrivateCateRoughdesign.componentAmplitudeMass_actual · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentAmplitude.lean:279
theorem componentAmplitudeMass_zero

At zero amplitude the component path equals the fair component array. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
n :
ℕ
x :
C :
z :
componentAmplitudeMass hL n x C z 0 = nullMass n C z
Proof (Lean source)
-- @node: componentAmplitudeMass_zero lemma componentAmplitudeMass_zero (hL : ℝ) (n : ℕ) (x : Fin n → Covariate) (C : Finset (Fin n)) (z : Marks C) : componentAmplitudeMass hL n x C z 0 = nullMass n C z := by simp only [componentAmplitudeMass, amplitudeMarkMass_zero, Finset.prod_const, Finset.card_univ, Fintype.card_coe, Finset.sum_const, nsmul_eq_mul] rw [← mul_assoc, sign_weight_real_normalization, one_mul] simp [nullMass, zpow_neg, zpow_natCast, one_div]
CausalSmith.Stat.PrivateCateRoughdesign.componentAmplitudeMass_zero · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentAmplitude.lean:287
theorem componentAmplitudeMass_hasDerivAt

Differentiation of the finite mixture uses the ordinary finite product rule. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
n :
ℕ
x :
C :
z :
u :
ℝ
HasDerivAt (componentAmplitudeMass hL n x C z) ((2 : ℝ)^(-((activeSigns hL).card : ℤ)) * ∑ lam : SignVector hL, ∑ i : C, (∏ j ∈ (Finset.univ : Finset C).erase i, amplitudeMarkMass (perturbation hL lam (x j)) (bump hL (x j)) u (z j)) * amplitudeMarkSlope (perturbation hL lam (x i)) (bump hL (x i)) u (z i)) u
Proof (Lean source)
-- @node: componentAmplitudeMass_hasDerivAt lemma componentAmplitudeMass_hasDerivAt (hL : ℝ) (n : ℕ) (x : Fin n → Covariate) (C : Finset (Fin n)) (z : Marks C) (u : ℝ) : HasDerivAt (componentAmplitudeMass hL n x C z) ((2 : ℝ)^(-((activeSigns hL).card : ℤ)) * ∑ lam : SignVector hL, ∑ i : C, (∏ j ∈ (Finset.univ : Finset C).erase i, amplitudeMarkMass (perturbation hL lam (x j)) (bump hL (x j)) u (z j)) * amplitudeMarkSlope (perturbation hL lam (x i)) (bump hL (x i)) u (z i)) u := by classical have hp (lam : SignVector hL) := HasDerivAt.fun_finsetProd (u := (Finset.univ : Finset C)) (fun i _ => amplitudeMarkMass_hasDerivAt (perturbation hL lam (x i)) (bump hL (x i)) u (z i)) have hs := (HasDerivAt.fun_sum (u := (Finset.univ : Finset (SignVector hL))) (fun lam _ => hp lam)).const_mul ((2 : ℝ)^(-((activeSigns hL).card : ℤ))) convert hs using 1 <;> rfl
CausalSmith.Stat.PrivateCateRoughdesign.componentAmplitudeMass_hasDerivAt · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentAmplitude.lean:297
theorem componentAmplitudeMass_hasDerivAt_zero

Independent fair signs cancel the entire component path's first derivative at zero. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
n :
ℕ
x :
C :
z :
Proof (Lean source)
-- @node: componentAmplitudeMass_hasDerivAt_zero lemma componentAmplitudeMass_hasDerivAt_zero (hL : ℝ) (n : ℕ) (x : Fin n → Covariate) (C : Finset (Fin n)) (z : Marks C) : HasDerivAt (componentAmplitudeMass hL n x C z) 0 0 := by classical have h := componentAmplitudeMass_hasDerivAt hL n x C z 0 have hz : (∑ lam : SignVector hL, ∑ i : C, (∏ j ∈ (Finset.univ : Finset C).erase i, amplitudeMarkMass (perturbation hL lam (x j)) (bump hL (x j)) 0 (z j)) * amplitudeMarkSlope (perturbation hL lam (x i)) (bump hL (x i)) 0 (z i)) = 0 := by simp_rw [amplitudeMarkMass_zero] rw [Finset.sum_comm] simp_rw [← Finset.mul_sum, amplitudeMarkSlope_sign_sum_zero, mul_zero] simp simpa only [hz, mul_zero] using h
CausalSmith.Stat.PrivateCateRoughdesign.componentAmplitudeMass_hasDerivAt_zero · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentAmplitude.lean:316
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.ComponentContraction 1 declarations Assembly of the Borel measurable shared-sign coupling and its private contraction bound.

Assembly of the Borel measurable shared-sign coupling and its private contraction bound.

theorem measurable_component_contraction

Finite graph factorization yields measurable component couplings and, in the sparse regime, a Hamming bound and its private-output consequence. Both cited gates remain explicit inputs. the theorem's stated inputs and assumptions, and the asserted conclusion follows.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
n :
ℕ
shared
cayley_of_gate :
boundedDifferences_of_gate :
epsilon :
ℝ
he :
0 < epsilon ∧ epsilon ≤ 1
hM :
PrivateKernel n epsilon M
conclusion 1
x z :
= ((orderedComponents hL n x).map (fun C => alternativeMass hL n x C (fun i => z i))).prod
(4 : ℝ)^(-(n : ℤ))
= ((orderedComponents hL n x).map (fun C => nullMass n C (fun i => z i))).prod
conclusion 2
x i :
C :
C.card = 1
≤ 4*separation hL*(componentSize n C : ℝ)^2
conclusion 4
conclusion 5
(n : ℝ)*deltaL hL ≤ 1/128
WH n (signMixture hL hhL n) (dataLaw n fairNull)
≤ ofReal (1024*separation hL*(n : ℝ)^2*hL*deltaL hL)
TV (M ∘ₘ signMixture hL hhL n) (M ∘ₘ dataLaw n fairNull)
≤ 2048*epsilon*separation hL*(n : ℝ)^2*hL*deltaL hL
Proof (Lean source)
-- @node: lem:measurable-component-contraction lemma measurable_component_contraction (cayley_of_gate : CayleyLabeledTreeCount) (boundedDifferences_of_gate : BoundedDifferencesMGF) (epsilon : ℝ) (he : 0 < epsilon ∧ epsilon ≤ 1) {B : Type*} [MeasurableSpace B] [StandardBorelSpace B] (M : Kernel (Dataset n) B) [IsMarkovKernel M] (hM : PrivateKernel n epsilon M) : (∀ x z, fullAlternativeMass hL n x z = ((orderedComponents hL n x).map (fun C => alternativeMass hL n x C (fun i => z i))).prod ∧ (4 : ℝ)^(-(n : ℤ)) = ((orderedComponents hL n x).map (fun C => nullMass n C (fun i => z i))).prod) ∧ (∀ x i, let C := componentVertices hL n x i (C.card = 1 → alternativeComponentLaw hL n x C = nullComponentLaw n C) ∧ TV (alternativeComponentLaw hL n x C) (nullComponentLaw n C) ≤ 4*separation hL*(componentSize n C : ℝ)^2 ∧ IsCoupling (componentCoupling hL n x C) (alternativeComponentLaw hL n x C) (nullComponentLaw n C)) ∧ Measurable (conditionalDatasetCoupling hL n) ∧ IsCoupling (commonMassCoupling hL n) (signMixture hL hhL n) (dataLaw n fairNull) ∧ ((n : ℝ)*deltaL hL ≤ 1/128 → WH n (signMixture hL hhL n) (dataLaw n fairNull) ≤ ofReal (1024*separation hL*(n : ℝ)^2*hL*deltaL hL) ∧ TV (M ∘ₘ signMixture hL hhL n) (M ∘ₘ dataLaw n fairNull) ≤ 2048*epsilon*separation hL*(n : ℝ)^2*hL*deltaL hL) := by refine ⟨?_, ?_, measurable_conditionalDatasetCoupling hL n, commonMassCoupling_isCoupling hL hhL n, ?_⟩ · intro x z exact ⟨fullAlternativeMass_component_factorization hL n x z, nullMass_component_factorization hL n x z⟩ · intro x i exact ⟨alternativeComponentLaw_eq_null_of_card_one hL hhL n x _, component_TV_le_quadratic hL hhL n x _, componentCoupling_isCoupling hL hhL n x _⟩ · intro hcap have heps : 0 ≤ epsilon := he.1.le have hradius : 0 ≤ hL := hhL.1.le have hγ := commonMassCoupling_isCoupling hL hhL n let := hγ.isProbabilityMeasure have hcost : (∫⁻ zw, (dHam n zw.1 zw.2 : ℝ≥0∞) ∂commonMassCoupling hL n) ≤ ofReal (1024*separation hL*(n : ℝ)^2*hL*deltaL hL) := by by_cases hn : 1 ≤ n · exact commonMassCoupling_hamming_cost_le_sparse cayley_of_gate hL hhL n hn hcap · have hn0 : n = 0 := by omega subst n simp [dHam, hammingDist] have hWH : WH n (signMixture hL hhL n) (dataLaw n fairNull) ≤ ofReal (1024*separation hL*(n : ℝ)^2*hL*deltaL hL) := by exact (iInf_le_of_le (commonMassCoupling hL n) (iInf_le_of_le hγ le_rfl)).trans hcost refine ⟨hWH, ?_⟩ let : IsProbabilityMeasure (signMixture hL hhL n) := by rw [← hγ.map_fst] exact Measure.isProbabilityMeasure_map measurable_fst.aemeasurable let : IsProbabilityMeasure (dataLaw n fairNull) := by rw [← hγ.map_snd] exact Measure.isProbabilityMeasure_map measurable_snd.aemeasurable have hout := private_TV_le_coupling_cost n epsilon he M hM (signMixture hL hhL n) (dataLaw n fairNull) (commonMassCoupling hL n) hγ have hbound : ofReal (TV (M ∘ₘ signMixture hL hhL n) (M ∘ₘ dataLaw n fairNull)) ≤ ofReal (2048*epsilon*separation hL*(n : ℝ)^2*hL*deltaL hL) := by calc _ ≤ ofReal (2*epsilon) * ofReal (1024*separation hL*(n : ℝ)^2*hL*deltaL hL) := hout.trans (mul_le_mul' le_rfl hcost) _ = _ := by rw [← ENNReal.ofReal_mul (by positivity : 0 ≤ 2*epsilon)] congr 1 ring exact (ENNReal.ofReal_le_ofReal_iff (by have hs := (separation_unit_range hL hhL).1 have hd : 0 ≤ deltaL hL := by unfold deltaL; positivity positivity)).mp hbound
CausalSmith.Stat.PrivateCateRoughdesign.measurable_component_contraction · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentContraction.lean:12
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.ComponentCounting 18 declarations Component-count expectations as sums over fixed vertex sets, and ordered-tree probability bounds on arbitrary distinct coordinates of the full sample.

Component-count expectations as sums over fixed vertex sets, and ordered-tree probability bounds on arbitrary distinct coordinates of the full sample.

theorem uniform_covariate_injection_map Lemma uniform_covariate_injection_map in the paper ↗

Selecting distinct coordinates of an iid uniform sample preserves the uniform product law. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n s :
ℕ
e :
Fin s → Fin n
he :
(Measure.pi (fun _ : Fin n => (volume : Measure Covariate))).map (fun x i => x (e i))
= Measure.pi (fun _ : Fin s => (volume : Measure Covariate))
Proof (Lean source)
-- @node: uniform_covariate_injection_map lemma uniform_covariate_injection_map (n s : ℕ) (e : Fin s → Fin n) (he : Injective e) : (Measure.pi (fun _ : Fin n => (volume : Measure Covariate))).map (fun x i => x (e i)) = Measure.pi (fun _ : Fin s => (volume : Measure Covariate)) := by have hi : iIndepFun (fun i : Fin n => fun x : Fin n → Covariate => x i) (Measure.pi (fun _ : Fin n => (volume : Measure Covariate))) := iIndepFun_pi (fun _ => measurable_id.aemeasurable) rw [(hi.precomp he).map_fun_eq_pi_map (fun i => (measurable_pi_apply (e i)).aemeasurable)] congr 1 funext i exact (measurePreserving_eval (fun _ : Fin n => (volume : Measure Covariate)) (e i)).map_eq
CausalSmith.Stat.PrivateCateRoughdesign.uniform_covariate_injection_map · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCounting.lean:12
theorem uniform_covariate_injection_preimage Lemma uniform_covariate_injection_preimage in the paper ↗

A Borel event on distinct selected sample coordinates has exactly its smaller product probability. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n s :
ℕ
e :
Fin s → Fin n
he :
A :
Set (Fin s → Covariate)
hA :
(Measure.pi (fun _ : Fin n => (volume : Measure Covariate))) ((fun x i => x (e i)) ⁻¹' A)
= (Measure.pi (fun _ : Fin s => (volume : Measure Covariate))) A
Proof (Lean source)
-- @node: uniform_covariate_injection_preimage lemma uniform_covariate_injection_preimage (n s : ℕ) (e : Fin s → Fin n) (he : Injective e) (A : Set (Fin s → Covariate)) (hA : MeasurableSet A) : (Measure.pi (fun _ : Fin n => (volume : Measure Covariate))) ((fun x i => x (e i)) ⁻¹' A) = (Measure.pi (fun _ : Fin s => (volume : Measure Covariate))) A := by rw [← uniform_covariate_injection_map n s e he, Measure.map_apply (by fun_prop) hA]
CausalSmith.Stat.PrivateCateRoughdesign.uniform_covariate_injection_preimage · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCounting.lean:28
theorem measurableSet_orderedSharedTreeEvent

The recursive shared-sign tree event is Borel, including its support-boundary conventions. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
p :
(m : ℕ) → Fin (m + 1)
m :
ℕ
Proof (Lean source)
-- @node: measurableSet_orderedSharedTreeEvent lemma measurableSet_orderedSharedTreeEvent (hL : ℝ) (p : (m : ℕ) → Fin (m + 1)) (m : ℕ) : MeasurableSet (orderedSharedTreeEvent hL p m) := by induction m with | zero => exact MeasurableSet.univ | succ m ih => exact (ih.preimage (by fun_prop)).inter (measurableSet_sharedAdj hL (m + 2) (last (m + 1)) (p m).castSucc)
CausalSmith.Stat.PrivateCateRoughdesign.measurableSet_orderedSharedTreeEvent · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCounting.lean:37
theorem selected_orderedSharedTreeEvent_volume_le

The specified-tree envelope holds for any distinct vertices in the original sample, so discarding the unused sample coordinates costs no probability factor. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n m :
ℕ
hm :
1 ≤ m
e :
Fin (m + 1) → Fin n
he :
p :
(k : ℕ) → Fin (k + 1)
(Measure.pi (fun _ : Fin n => (volume : Measure Covariate))) {x | (fun i => x (e i)) ∈ orderedSharedTreeEvent hL p m}
≤ ofReal (2 * hL * (4 * deltaL hL) ^ m)
Proof (Lean source)
-- @node: selected_orderedSharedTreeEvent_volume_le lemma selected_orderedSharedTreeEvent_volume_le (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n m : ℕ) (hm : 1 ≤ m) (e : Fin (m + 1) → Fin n) (he : Injective e) (p : (k : ℕ) → Fin (k + 1)) : (Measure.pi (fun _ : Fin n => (volume : Measure Covariate))) {x | (fun i => x (e i)) ∈ orderedSharedTreeEvent hL p m} ≤ ofReal (2 * hL * (4 * deltaL hL) ^ m) := by change (Measure.pi (fun _ : Fin n => (volume : Measure Covariate))) ((fun x i => x (e i)) ⁻¹' orderedSharedTreeEvent hL p m) ≤ _ rw [uniform_covariate_injection_preimage n (m + 1) e he _ (measurableSet_orderedSharedTreeEvent hL p m)] exact orderedSharedTreeEvent_volume_le hL hhL p m hm
CausalSmith.Stat.PrivateCateRoughdesign.selected_orderedSharedTreeEvent_volume_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCounting.lean:48
theorem measurableSet_fixed_component Lemma measurableSet_fixed_component in the paper ↗

The event that a fixed vertex set is one of the selected graph components is Borel. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
n :
ℕ
C :
MeasurableSet {x : Fin n → Covariate | C ∈ orderedComponents hL n x}
Proof (Lean source)
-- @node: measurableSet_fixed_component lemma measurableSet_fixed_component (hL : ℝ) (n : ℕ) (C : Finset (Fin n)) : MeasurableSet {x : Fin n → Covariate | C ∈ orderedComponents hL n x} := by classical have he : {x : Fin n → Covariate | C ∈ orderedComponents hL n x} = ⋃ G : SimpleGraph (Fin n), (if C ∈ componentsOfGraph n G then {x | sharedGraph hL n x = G} else ∅) := by ext x simp only [Set.mem_ofPred_eq, Set.mem_iUnion] constructor · intro hx refine ⟨sharedGraph hL n x, ?_⟩ have hc : C ∈ componentsOfGraph n (sharedGraph hL n x) := hx simp [hc] · rintro ⟨G, hx⟩ split_ifs at hx with hc · have hg : sharedGraph hL n x = G := hx rw [orderedComponents_eq_of_sharedGraph_eq hL n x G hg] exact hc · exact False.elim hx rw [he] apply MeasurableSet.iUnion intro G split_ifs · exact measurableSet_sharedGraph_eq hL n G · exact MeasurableSet.empty
CausalSmith.Stat.PrivateCateRoughdesign.measurableSet_fixed_component · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCounting.lean:64
theorem sizeComponentCount_eq_sum_indicators

Counting size-s components is exactly summing their indicators over all size-s vertex sets. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
n s :
ℕ
x :
(sizeComponentCount hL n x s : ℝ≥0∞)
= ∑ C ∈ (Finset.univ : Finset (Fin n)).powersetCard s, {x : Fin n → Covariate | C ∈ orderedComponents hL n x}.indicator (fun _ => (1 : ℝ≥0∞)) x
Proof (Lean source)
-- @node: sizeComponentCount_eq_sum_indicators lemma sizeComponentCount_eq_sum_indicators (hL : ℝ) (n s : ℕ) (x : Fin n → Covariate) : (sizeComponentCount hL n x s : ℝ≥0∞) = ∑ C ∈ (Finset.univ : Finset (Fin n)).powersetCard s, {x : Fin n → Covariate | C ∈ orderedComponents hL n x}.indicator (fun _ => (1 : ℝ≥0∞)) x := by classical have he : ((orderedComponents hL n x).toFinset.filter (fun C => C.card = s)) = ((Finset.univ : Finset (Fin n)).powersetCard s).filter (fun C => C ∈ orderedComponents hL n x) := by ext C simp only [mem_filter, List.mem_toFinset, Finset.mem_powersetCard, Finset.subset_univ, true_and] exact and_comm rw [sizeComponentCount, he] simp [indicator]
CausalSmith.Stat.PrivateCateRoughdesign.sizeComponentCount_eq_sum_indicators · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCounting.lean:92
theorem lintegral_sizeComponentCount_eq_sum

Taking expectations of the exact indicator count gives a sum of fixed-component probabilities. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
n s :
ℕ
μ :
(∫⁻ x, (sizeComponentCount hL n x s : ℝ≥0∞) ∂μ)
= ∑ C ∈ (Finset.univ : Finset (Fin n)).powersetCard s, μ {x | C ∈ orderedComponents hL n x}
Proof (Lean source)
-- @node: lintegral_sizeComponentCount_eq_sum lemma lintegral_sizeComponentCount_eq_sum (hL : ℝ) (n s : ℕ) (μ : Measure (Fin n → Covariate)) : (∫⁻ x, (sizeComponentCount hL n x s : ℝ≥0∞) ∂μ) = ∑ C ∈ (Finset.univ : Finset (Fin n)).powersetCard s, μ {x | C ∈ orderedComponents hL n x} := by classical simp_rw [sizeComponentCount_eq_sum_indicators] rw [lintegral_finsetSum _ (fun C _ => measurable_const.indicator (measurableSet_fixed_component hL n C))] apply Finset.sum_congr rfl intro C _ rw [lintegral_indicator_const (measurableSet_fixed_component hL n C), one_mul]
CausalSmith.Stat.PrivateCateRoughdesign.lintegral_sizeComponentCount_eq_sum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCounting.lean:111
theorem lintegral_sizeComponentCount_le_choose_mul

A common probability bound for fixed size-s components gives the binomial component-count bound. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
n s :
ℕ
μ :
b :
ℝ≥0∞
hb :
∀ C : Finset (Fin n)
if
C.card = s
then
μ {x | C ∈ orderedComponents hL n x} ≤ b
(∫⁻ x, (sizeComponentCount hL n x s : ℝ≥0∞) ∂μ) ≤ (n.choose s : ℝ≥0∞) * b
Proof (Lean source)
-- @node: lintegral_sizeComponentCount_le_choose_mul lemma lintegral_sizeComponentCount_le_choose_mul (hL : ℝ) (n s : ℕ) (μ : Measure (Fin n → Covariate)) (b : ℝ≥0∞) (hb : ∀ C : Finset (Fin n), C.card = s → μ {x | C ∈ orderedComponents hL n x} ≤ b) : (∫⁻ x, (sizeComponentCount hL n x s : ℝ≥0∞) ∂μ) ≤ (n.choose s : ℝ≥0∞) * b := by classical rw [lintegral_sizeComponentCount_eq_sum] calc _ ≤ ∑ C ∈ (Finset.univ : Finset (Fin n)).powersetCard s, b := by apply Finset.sum_le_sum intro C hC exact hb C (Finset.mem_powersetCard.mp hC).2 _ = _ := by simp [Finset.card_powersetCard, nsmul_eq_mul]
CausalSmith.Stat.PrivateCateRoughdesign.lintegral_sizeComponentCount_le_choose_mul · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCounting.lean:127
theorem sharedAdj_of_pair_component Lemma sharedAdj_of_pair_component in the paper ↗

The two vertices of a two-element graph component share an edge. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
n :
ℕ
x :
i j :
Fin n
hij :
i ≠ j
hC :
({i, j} : Finset (Fin n)) ∈ orderedComponents hL n x
sharedAdj hL n x i j
Proof (Lean source)
-- @node: sharedAdj_of_pair_component lemma sharedAdj_of_pair_component (hL : ℝ) (n : ℕ) (x : Fin n → Covariate) (i j : Fin n) (hij : i ≠ j) (hC : ({i, j} : Finset (Fin n)) ∈ orderedComponents hL n x) : sharedAdj hL n x i j := by classical obtain ⟨r, _, hr⟩ := (mem_orderedComponents hL n x {i, j}).mp hC have hri : (sharedGraph hL n x).Reachable r i := (mem_componentVertices hL n x r i).mp (by rw [hr]; simp) have hrj : (sharedGraph hL n x).Reachable r j := (mem_componentVertices hL n x r j).mp (by rw [hr]; simp) obtain ⟨w⟩ := hri.symm.trans hrj cases w with | nil => exact False.elim (hij rfl) | @cons u v w hedge tail => have hrv := hri.trans hedge.reachable have hv : v = i ∨ v = j := by have hm := (mem_componentVertices hL n x r v).mpr hrv rw [hr] at hm simpa using hm rcases hv with hvi | hvj · exact False.elim (hedge.ne hvi.symm) · simpa [hvj, sharedGraph] using hedge
CausalSmith.Stat.PrivateCateRoughdesign.sharedAdj_of_pair_component · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCounting.lean:145
theorem sharedAdj_uniform_volume_le Lemma sharedAdj_uniform_volume_le in the paper ↗

A specified pair of distinct sampled vertices shares a sign with probability at most its macro root length times its micro child length. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
i j :
Fin n
hij :
i ≠ j
(Measure.pi (fun _ : Fin n => (volume : Measure Covariate))) {x | sharedAdj hL n x i j}
≤ ofReal (2 * hL * (4 * deltaL hL))
Proof (Lean source)
-- @node: sharedAdj_uniform_volume_le lemma sharedAdj_uniform_volume_le (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (i j : Fin n) (hij : i ≠ j) : (Measure.pi (fun _ : Fin n => (volume : Measure Covariate))) {x | sharedAdj hL n x i j} ≤ ofReal (2 * hL * (4 * deltaL hL)) := by let e : Fin 2 → Fin n := ![j, i] have he : Injective e := by intro a b hab fin_cases a <;> fin_cases b <;> simp_all [e] have ht := selected_orderedSharedTreeEvent_volume_le hL hhL n 1 (by omega) e he (fun _ => 0) have hsub : {x : Fin n → Covariate | sharedAdj hL n x i j} ⊆ {x | (fun k => x (e k)) ∈ orderedSharedTreeEvent hL (fun _ => 0) 1} := by intro x hx simpa [orderedSharedTreeEvent, sharedAdj, e] using hx.2 exact (measure_mono hsub).trans (by simpa using ht)
CausalSmith.Stat.PrivateCateRoughdesign.sharedAdj_uniform_volume_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCounting.lean:170
theorem pair_component_uniform_volume_le Lemma pair_component_uniform_volume_le in the paper ↗

The component event for any specified two-set is bounded by the corresponding single-edge event. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
C :
hc :
C.card = 2
(Measure.pi (fun _ : Fin n => (volume : Measure Covariate))) {x | C ∈ orderedComponents hL n x}
≤ ofReal (2 * hL * (4 * deltaL hL))
Proof (Lean source)
-- @node: pair_component_uniform_volume_le lemma pair_component_uniform_volume_le (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (C : Finset (Fin n)) (hc : C.card = 2) : (Measure.pi (fun _ : Fin n => (volume : Measure Covariate))) {x | C ∈ orderedComponents hL n x} ≤ ofReal (2 * hL * (4 * deltaL hL)) := by classical obtain ⟨i, j, hij, rfl⟩ := Finset.card_eq_two.mp hc exact (measure_mono (fun x hx => sharedAdj_of_pair_component hL n x i j hij hx)).trans (sharedAdj_uniform_volume_le hL hhL n i j hij)
CausalSmith.Stat.PrivateCateRoughdesign.pair_component_uniform_volume_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCounting.lean:189
theorem lintegral_sizeComponentCount_two_le

The actual expected number of two-vertex components satisfies the roadmap's binomial labeled-tree bound, with no assumed probability estimate. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
(∫⁻ x, (sizeComponentCount hL n x 2 : ℝ≥0∞) ∂(Measure.pi (fun _ : Fin n => (volume : Measure Covariate))))
≤ ofReal ((n.choose 2 : ℝ) * (2 * hL * (4 * deltaL hL)))
Proof (Lean source)
-- @node: lintegral_sizeComponentCount_two_le lemma lintegral_sizeComponentCount_two_le (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) : (∫⁻ x, (sizeComponentCount hL n x 2 : ℝ≥0∞) ∂(Measure.pi (fun _ : Fin n => (volume : Measure Covariate)))) ≤ ofReal ((n.choose 2 : ℝ) * (2 * hL * (4 * deltaL hL))) := by have hb := lintegral_sizeComponentCount_le_choose_mul hL n 2 (Measure.pi (fun _ : Fin n => (volume : Measure Covariate))) _ (pair_component_uniform_volume_le hL hhL n) rw [← ENNReal.ofReal_natCast, ← ENNReal.ofReal_mul (Nat.cast_nonneg _)] at hb exact hb
CausalSmith.Stat.PrivateCateRoughdesign.lintegral_sizeComponentCount_two_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCounting.lean:201
theorem component_vertex_has_neighbor Lemma component_vertex_has_neighbor in the paper ↗

Every vertex in a component with another vertex has a neighbor in that component. This uses the first step of a connecting walk, without assuming any graph geometry. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
n :
ℕ
x :
C :
hC :
C ∈ orderedComponents hL n x
i j :
Fin n
hi :
i ∈ C
hj :
j ∈ C
hij :
i ≠ j
∃ v ∈ C, sharedAdj hL n x i v
Proof (Lean source)
-- @node: component_vertex_has_neighbor lemma component_vertex_has_neighbor (hL : ℝ) (n : ℕ) (x : Fin n → Covariate) (C : Finset (Fin n)) (hC : C ∈ orderedComponents hL n x) (i j : Fin n) (hi : i ∈ C) (hj : j ∈ C) (hij : i ≠ j) : ∃ v ∈ C, sharedAdj hL n x i v := by obtain ⟨r, _, hr⟩ := (mem_orderedComponents hL n x C).mp hC have hri : (sharedGraph hL n x).Reachable r i := (mem_componentVertices hL n x r i).mp (by rw [hr]; exact hi) have hrj : (sharedGraph hL n x).Reachable r j := (mem_componentVertices hL n x r j).mp (by rw [hr]; exact hj) obtain ⟨w⟩ := hri.symm.trans hrj cases w with | nil => exact False.elim (hij rfl) | @cons u v w hedge tail => refine ⟨v, ?_, hedge⟩ rw [← hr] exact (mem_componentVertices hL n x r v).mpr (hri.trans hedge.reachable)
CausalSmith.Stat.PrivateCateRoughdesign.component_vertex_has_neighbor · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCounting.lean:215
theorem triple_component_contains_tree Lemma triple_component_contains_tree in the paper ↗

A three-vertex component contains one of the three labeled spanning trees. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
n :
ℕ
x :
i j k :
Fin n
hij :
i ≠ j
hik :
i ≠ k
hjk :
j ≠ k
hC :
({i, j, k} : Finset (Fin n)) ∈ orderedComponents hL n x
(sharedAdj hL n x i j ∧ sharedAdj hL n x i k) ∨ (sharedAdj hL n x j i ∧ sharedAdj hL n x j k) ∨ (sharedAdj hL n x k i ∧ sharedAdj hL n x k j)
Proof (Lean source)
-- @node: triple_component_contains_tree lemma triple_component_contains_tree (hL : ℝ) (n : ℕ) (x : Fin n → Covariate) (i j k : Fin n) (hij : i ≠ j) (hik : i ≠ k) (hjk : j ≠ k) (hC : ({i, j, k} : Finset (Fin n)) ∈ orderedComponents hL n x) : (sharedAdj hL n x i j ∧ sharedAdj hL n x i k) ∨ (sharedAdj hL n x j i ∧ sharedAdj hL n x j k) ∨ (sharedAdj hL n x k i ∧ sharedAdj hL n x k j) := by classical have hn (a b : Fin n) (ha : a ∈ ({i, j, k} : Finset (Fin n))) (hb : b ∈ ({i, j, k} : Finset (Fin n))) (hab : a ≠ b) := component_vertex_has_neighbor hL n x {i, j, k} hC a b ha hb hab obtain ⟨v, hv, hiv⟩ := hn i j (by simp) (by simp) hij have hv' : v = j ∨ v = k := by simpa [hiv.1.symm] using hv rcases hv' with hvj | hvk <;> subst v · obtain ⟨v, hv, hkv⟩ := hn k i (by simp) (by simp) hik.symm have hv' : v = i ∨ v = j := by simpa [hkv.1.symm] using hv rcases hv' with hvi | hvj <;> subst v · exact inl ⟨hiv, SimpleGraph.Adj.symm (G := sharedGraph hL n x) hkv⟩ · exact inr (inl ⟨SimpleGraph.Adj.symm (G := sharedGraph hL n x) hiv, SimpleGraph.Adj.symm (G := sharedGraph hL n x) hkv⟩) · obtain ⟨v, hv, hjv⟩ := hn j i (by simp) (by simp) hij.symm have hv' : v = i ∨ v = k := by simpa [hjv.1.symm] using hv rcases hv' with hvi | hvk <;> subst v · exact inl ⟨SimpleGraph.Adj.symm (G := sharedGraph hL n x) hjv, hiv⟩ · exact inr (inr ⟨SimpleGraph.Adj.symm (G := sharedGraph hL n x) hiv, SimpleGraph.Adj.symm (G := sharedGraph hL n x) hjv⟩)
CausalSmith.Stat.PrivateCateRoughdesign.triple_component_contains_tree · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCounting.lean:235
theorem triple_star_uniform_volume_le Lemma triple_star_uniform_volume_le in the paper ↗

A specified two-edge star on three distinct records obeys the tree envelope. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
i j k :
Fin n
hij :
i ≠ j
hik :
i ≠ k
hjk :
j ≠ k
(Measure.pi (fun _ : Fin n => (volume : Measure Covariate))) {x | sharedAdj hL n x i j ∧ sharedAdj hL n x i k}
≤ ofReal (2 * hL * (4 * deltaL hL) ^ 2)
Proof (Lean source)
-- @node: triple_star_uniform_volume_le lemma triple_star_uniform_volume_le (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (i j k : Fin n) (hij : i ≠ j) (hik : i ≠ k) (hjk : j ≠ k) : (Measure.pi (fun _ : Fin n => (volume : Measure Covariate))) {x | sharedAdj hL n x i j ∧ sharedAdj hL n x i k} ≤ ofReal (2 * hL * (4 * deltaL hL) ^ 2) := by let e : Fin 3 → Fin n := ![i, j, k] have he : Injective e := by intro a b hab fin_cases a <;> fin_cases b <;> simp_all [e] have ht := selected_orderedSharedTreeEvent_volume_le hL hhL n 2 (by omega) e he (fun _ => 0) have hsub : {x : Fin n → Covariate | sharedAdj hL n x i j ∧ sharedAdj hL n x i k} ⊆ {x | (fun a => x (e a)) ∈ orderedSharedTreeEvent hL (fun _ => 0) 2} := by intro x hx have hj := SimpleGraph.Adj.symm (G := sharedGraph hL n x) hx.1 have hk := SimpleGraph.Adj.symm (G := sharedGraph hL n x) hx.2 simpa [orderedSharedTreeEvent, sharedAdj, e] using intro hj.2 hk.2 exact (measure_mono hsub).trans ht
CausalSmith.Stat.PrivateCateRoughdesign.triple_star_uniform_volume_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCounting.lean:267
theorem triple_component_uniform_volume_le Lemma triple_component_uniform_volume_le in the paper ↗

The probability that a specified triple is a component is at most the sum of its three labeled spanning-tree envelopes. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
i j k :
Fin n
hij :
i ≠ j
hik :
i ≠ k
hjk :
j ≠ k
(Measure.pi (fun _ : Fin n => (volume : Measure Covariate))) {x | ({i, j, k} : Finset (Fin n)) ∈ orderedComponents hL n x}
≤ ofReal (3 * (2 * hL * (4 * deltaL hL) ^ 2))
Proof (Lean source)
-- @node: triple_component_uniform_volume_le lemma triple_component_uniform_volume_le (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (i j k : Fin n) (hij : i ≠ j) (hik : i ≠ k) (hjk : j ≠ k) : (Measure.pi (fun _ : Fin n => (volume : Measure Covariate))) {x | ({i, j, k} : Finset (Fin n)) ∈ orderedComponents hL n x} ≤ ofReal (3 * (2 * hL * (4 * deltaL hL) ^ 2)) := by classical let μ := Measure.pi (fun _ : Fin n => (volume : Measure Covariate)) let A := {x | sharedAdj hL n x i j ∧ sharedAdj hL n x i k} let B := {x | sharedAdj hL n x j i ∧ sharedAdj hL n x j k} let D := {x | sharedAdj hL n x k i ∧ sharedAdj hL n x k j} have hs : {x | ({i, j, k} : Finset (Fin n)) ∈ orderedComponents hL n x} ⊆ A ∪ (B ∪ D) := fun x hx => triple_component_contains_tree hL n x i j k hij hik hjk hx have ha := triple_star_uniform_volume_le hL hhL n i j k hij hik hjk have hb := triple_star_uniform_volume_le hL hhL n j i k hij.symm hjk hik have hd := triple_star_uniform_volume_le hL hhL n k i j hik.symm hjk.symm hij calc _ ≤ μ (A ∪ (B ∪ D)) := measure_mono hs _ ≤ μ A + (μ B + μ D) := (measure_union_le A (B ∪ D)).trans (add_le_add le_rfl (measure_union_le B D)) _ ≤ ofReal (2 * hL * (4 * deltaL hL) ^ 2) + (ofReal (2 * hL * (4 * deltaL hL) ^ 2) + ofReal (2 * hL * (4 * deltaL hL) ^ 2)) := add_le_add ha (add_le_add hb hd) _ = _ := by have hh : 0 < hL := hhL.1 have hn : 0 ≤ 2 * hL * (4 * deltaL hL) ^ 2 := by positivity rw [← ENNReal.ofReal_add hn hn, ← ENNReal.ofReal_add hn (add_nonneg hn hn)] congr 1 ring
CausalSmith.Stat.PrivateCateRoughdesign.triple_component_uniform_volume_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCounting.lean:288
theorem card_three_component_uniform_volume_le Lemma card_three_component_uniform_volume_le in the paper ↗

Every fixed size-three component obeys the Cayley envelope with three trees. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
C :
hc :
C.card = 3
(Measure.pi (fun _ : Fin n => (volume : Measure Covariate))) {x | C ∈ orderedComponents hL n x}
≤ ofReal (3 * (2 * hL * (4 * deltaL hL) ^ 2))
Proof (Lean source)
-- @node: card_three_component_uniform_volume_le lemma card_three_component_uniform_volume_le (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (C : Finset (Fin n)) (hc : C.card = 3) : (Measure.pi (fun _ : Fin n => (volume : Measure Covariate))) {x | C ∈ orderedComponents hL n x} ≤ ofReal (3 * (2 * hL * (4 * deltaL hL) ^ 2)) := by classical obtain ⟨i, j, k, hij, hik, hjk, rfl⟩ := Finset.card_eq_three.mp hc exact triple_component_uniform_volume_le hL hhL n i j k hij hik hjk
CausalSmith.Stat.PrivateCateRoughdesign.card_three_component_uniform_volume_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCounting.lean:322
theorem lintegral_sizeComponentCount_three_le

The expected number of size-three components satisfies the roadmap's binomial Cayley bound with no assumed component probability estimate. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
(∫⁻ x, (sizeComponentCount hL n x 3 : ℝ≥0∞) ∂(Measure.pi (fun _ : Fin n => (volume : Measure Covariate))))
≤ ofReal ((n.choose 3 : ℝ) * 2 * hL * 3 ^ (3 - 2 : ℕ) * (4 * deltaL hL) ^ (3 - 1 : ℕ))
Proof (Lean source)
-- @node: lintegral_sizeComponentCount_three_le lemma lintegral_sizeComponentCount_three_le (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) : (∫⁻ x, (sizeComponentCount hL n x 3 : ℝ≥0∞) ∂(Measure.pi (fun _ : Fin n => (volume : Measure Covariate)))) ≤ ofReal ((n.choose 3 : ℝ) * 2 * hL * 3 ^ (3 - 2 : ℕ) * (4 * deltaL hL) ^ (3 - 1 : ℕ)) := by have hb := lintegral_sizeComponentCount_le_choose_mul hL n 3 (Measure.pi (fun _ : Fin n => (volume : Measure Covariate))) _ (card_three_component_uniform_volume_le hL hhL n) rw [← ENNReal.ofReal_natCast, ← ENNReal.ofReal_mul (Nat.cast_nonneg _)] at hb convert hb using 1 <;> congr 1 <;> norm_num <;> ring
CausalSmith.Stat.PrivateCateRoughdesign.lintegral_sizeComponentCount_three_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCounting.lean:333
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.ComponentCoupling 52 declarations Shared-sign graphs, ordered finite components, explicit common-mass couplings and conditional sparse Hamming/private-output contraction.

Shared-sign graphs, ordered finite components, explicit common-mass couplings and conditional sparse Hamming/private-output contraction.

def sharedAdj

Distinct records are adjacent exactly when they share a nonzero active sign contribution.

Definition (Lean source)
hL :
ℝ
shared
n :
ℕ
shared
x :
i l :
Fin n
sharedAdj hL n x i l :
Prop
clause 1
i ≠ l
clause 2
∃ j ∈ activeSigns hL,
envelope hL (x i)*frame hL j (x i) ≠ 0
envelope hL (x l)*frame hL j (x l) ≠ 0

Shared-sign adjacency is symmetric. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
Symm (sharedAdj hL n x)
Proof (Lean source)
-- @node: sharedAdj_symm lemma sharedAdj_symm (x : Fin n → Covariate) : Symm (sharedAdj hL n x) := by constructor intro i l hil rcases hil with ⟨hne, j, hj, hi, hl⟩ exact ⟨hne.symm, j, hj, hl, hi⟩

Shared-sign adjacency has no loops. the theorem's stated inputs and assumptions, and the asserted conclusion follows.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
Irrefl (sharedAdj hL n x)
Proof (Lean source)
-- @node: sharedAdj_irrefl lemma sharedAdj_irrefl (x : Fin n → Covariate) : Irrefl (sharedAdj hL n x) := by constructor intro i hii exact hii.1 rfl
def sharedGraph

The shared-sign graph has the specified adjacency relation on dataset indices.

Definition (Lean source)
hL :
ℝ
shared
n :
ℕ
shared
x :
sharedGraph hL n x :
clause 1
Adj := sharedAdj hL n x
clause 2
symm := sharedAdj_symm hL n x
clause 3
loopless := sharedAdj_irrefl hL n x
def componentVertices

A graph component contains exactly the vertices reachable from its selected vertex.

Definition (Lean source)
hL :
ℝ
shared
n :
ℕ
shared
x :
i :
Fin n
componentVertices hL n x i :
Finset.univ.filter (fun l => (sharedGraph hL n x).Reachable i l)
def componentRoots

Each component is represented by its least vertex.

Definition (Lean source)
hL :
ℝ
shared
n :
ℕ
shared
x :
componentRoots hL n x :
Finset.univ.filter (fun i => ∀ l, (sharedGraph hL n x).Reachable i l → i ≤ l)
def orderedComponents

Components are selected by increasing least vertex, so the construction is deterministic.

Definition (Lean source)
hL :
ℝ
shared
n :
ℕ
shared
x :
orderedComponents hL n x :
((componentRoots hL n x).sort (· ≤ ·)).map (componentVertices hL n x)
def componentSize

Component size is its vertex cardinality.

Definition (Lean source)
n :
ℕ
shared
C :
componentSize n C :
ℕ
C.card
def Marks

Component marks are binary treatment-outcome pairs indexed by the component vertices.

Definition (Lean source)
n :
ℕ
C :
Marks C :
Type
C → Bool × Bool
def nullMass

The fair component mark law gives every configuration mass four to the power minus component size.

Definition (Lean source)
n :
ℕ
shared
C :
_z :
nullMass n C _z :
ℝ
(4 : ℝ)^(-(C.card : ℤ))
def alternativeMass

The alternative component mark mass averages the conditional Bernoulli products over the latent signs.

Definition (Lean source)
hL :
ℝ
shared
n :
ℕ
shared
x :
C :
z :
alternativeMass hL n x C z :
ℝ
(2 : ℝ)^(-((activeSigns hL).card : ℤ)) * ∑ lam : SignVector hL, ∏ i : C, (conditionalLikelihood hL lam (x i) (z i).1 (z i).2 / 4)
def commonMass

The common mass is the pointwise minimum of the alternative and null component masses.

Definition (Lean source)
hL :
ℝ
shared
n :
ℕ
shared
x :
C :
z :
commonMass hL n x C z :
ℝ
min (alternativeMass hL n x C z) (nullMass n C z)

Total overlap sums the common component masses.

Definition (Lean source)
hL :
ℝ
shared
n :
ℕ
shared
x :
C :
overlapMass hL n x C :
ℝ
∑ z : Marks C, commonMass hL n x C z
def alternativeComponentLaw

The alternative component measure is the finite measure with the specified alternative mark masses.

Definition (Lean source)
hL :
ℝ
shared
n :
ℕ
shared
x :
C :
alternativeComponentLaw hL n x C :
∑ z : Marks C, ofReal (alternativeMass hL n x C z) • Measure.dirac z
CausalSmith.Stat.PrivateCateRoughdesign.alternativeComponentLaw · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCoupling.lean:74
def nullComponentLaw

The null component measure is the finite measure with the specified fair mark masses.

Definition (Lean source)
n :
ℕ
shared
C :
nullComponentLaw n C :
∑ z : Marks C, ofReal (nullMass n C z) • Measure.dirac z
def componentCouplingMass

The common-mass coupling combines diagonal common mass with the normalized product of the two residual masses, omitting the residual when overlap is one.

Definition (Lean source)
hL :
ℝ
shared
n :
ℕ
shared
x :
C :
z w :
componentCouplingMass hL n x C z w :
ℝ
cz :
commonMass hL n x C z
cw :
commonMass hL n x C w
diagonal :
if z = w then cz else 0
if overlapMass hL n x C < 1 then diagonal
+ (alternativeMass hL n x C z-cz)*(nullMass n C w-cw)/ (1-overlapMass hL n x C) else diagonal
CausalSmith.Stat.PrivateCateRoughdesign.componentCouplingMass · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCoupling.lean:84
def componentCoupling

The finite component coupling measure has the explicit common-mass joint array.

Definition (Lean source)
hL :
ℝ
shared
n :
ℕ
shared
x :
C :
componentCoupling hL n x C :
∑ zw : Marks C × Marks C, ofReal (componentCouplingMass hL n x C zw.1 zw.2) • Measure.dirac zw
def jointMarkMass

The joint mark array is the product of the common-mass couplings across the ordered graph components.

Definition (Lean source)
hL :
ℝ
shared
n :
ℕ
shared
x :
z w :
Fin n → Bool × Bool
jointMarkMass hL n x z w :
ℝ
((orderedComponents hL n x).map (fun C => componentCouplingMass hL n x C (fun i => z i) (fun i => w i))).prod
def attachMarks

The same covariate vector is attached to a vector of treatment-outcome marks.

Definition (Lean source)
n :
ℕ
shared
x :
z :
Fin n → Bool × Bool
attachMarks n x z :
fun i => (x i, (z i).1, (z i).2)
def conditionalDatasetCoupling

The conditional dataset coupling attaches the same covariates to both sides of the product component coupling.

Definition (Lean source)
hL :
ℝ
shared
n :
ℕ
shared
x :
conditionalDatasetCoupling hL n x :
∑ zw : (Fin n → Bool × Bool) × (Fin n → Bool × Bool), ofReal (jointMarkMass hL n x zw.1 zw.2) • Measure.dirac (attachMarks n x zw.1, attachMarks n x zw.2)
CausalSmith.Stat.PrivateCateRoughdesign.conditionalDatasetCoupling · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCoupling.lean:112
def commonMassCoupling Definition 23 in the paper ↗

The dataset coupling integrates the ordered product of explicit component couplings over shared uniform covariates.

Definition (Lean source)
hL :
ℝ
shared
n :
ℕ
shared
commonMassCoupling hL n :
(Measure.pi (fun _ : Fin n => (volume : Measure Covariate))).bind (conditionalDatasetCoupling hL n)
def fullAlternativeMass

The full conditional mark mass averages the dataset Bernoulli likelihood product uniformly over all latent signs.

Definition (Lean source)
hL :
ℝ
shared
n :
ℕ
shared
x :
z :
Fin n → Bool × Bool
fullAlternativeMass hL n x z :
ℝ
(2 : ℝ)^(-((activeSigns hL).card : ℤ)) * ∑ lam : SignVector hL, ∏ i : Fin n, conditionalLikelihood hL lam (x i) (z i).1 (z i).2 / 4
theorem conditionalLikelihood_mark_sum Lemma conditionalLikelihood_mark_sum in the paper ↗

The four conditional mark masses sum to one at every covariate and sign vector. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
lam :
x :
(∑ z : Bool × Bool, conditionalLikelihood hL lam x z.1 z.2 / 4) = 1
Proof (Lean source)
-- @node: conditionalLikelihood_mark_sum lemma conditionalLikelihood_mark_sum (lam : SignVector hL) (x : Covariate) : (∑ z : Bool × Bool, conditionalLikelihood hL lam x z.1 z.2 / 4) = 1 := by simp only [Fintype.sum_prod_type, Fintype.sum_bool, conditionalLikelihood, bernoulliMass, Bool.false_eq_true, if_true, if_false] ring
CausalSmith.Stat.PrivateCateRoughdesign.conditionalLikelihood_mark_sum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCoupling.lean:132

Every alternative component mass is nonnegative. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
n :
ℕ
shared
x :
C :
z :
0 ≤ alternativeMass hL n x C z
Proof (Lean source)
-- @node: alternativeMass_nonneg lemma alternativeMass_nonneg (x : Fin n → Covariate) (C : Finset (Fin n)) (z : Marks C) : 0 ≤ alternativeMass hL n x C z := by apply mul_nonneg (le_of_lt (zpow_pos (by norm_num : (0 : ℝ) < 2) _)) apply Finset.sum_nonneg intro lam _ apply Finset.prod_nonneg intro i _ exact div_nonneg (conditionalLikelihood_nonneg hL hhL lam (x i) (z i).1 (z i).2) (by norm_num)
CausalSmith.Stat.PrivateCateRoughdesign.alternativeMass_nonneg · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCoupling.lean:141

Summing the finite component array gives total mass one, including the empty component. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
C :
(∑ z : Marks C, alternativeMass hL n x C z) = 1
Proof (Lean source)
-- @node: alternativeMass_sum lemma alternativeMass_sum (x : Fin n → Covariate) (C : Finset (Fin n)) : (∑ z : Marks C, alternativeMass hL n x C z) = 1 := by classical simp only [alternativeMass, ← Finset.mul_sum] rw [Finset.sum_comm] have hp (lam : SignVector hL) : (∑ z : Marks C, ∏ i : C, conditionalLikelihood hL lam (x i) (z i).1 (z i).2 / 4) = 1 := by rw [← Fintype.prod_sum (fun (i : C) (z : Bool × Bool) => conditionalLikelihood hL lam (x i) z.1 z.2 / 4)] simp only [conditionalLikelihood_mark_sum, Finset.prod_const_one] simp_rw [hp] rw [Finset.sum_const, Finset.card_univ, nsmul_eq_mul, mul_one] exact sign_weight_real_normalization hL

Every fair component mass is positive. The displayed conclusion follows.

Formal statement
n :
ℕ
shared
C :
z :
0 < nullMass n C z
Proof (Lean source)
-- @node: nullMass_pos lemma nullMass_pos (C : Finset (Fin n)) (z : Marks C) : 0 < nullMass n C z := by exact zpow_pos (by norm_num : (0 : ℝ) < 4) _
theorem alternativeMass_eq_nullMass_of_card_one Lemma alternativeMass_eq_nullMass_of_card_one in the paper ↗

A singleton alternative array equals the fair array by the exact sign cancellations. the theorem's stated inputs and assumptions, and the asserted conclusion follows.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
n :
ℕ
shared
x :
C :
hc :
C.card = 1
z :
alternativeMass hL n x C z = nullMass n C z
Proof (Lean source)
-- @node: alternativeMass_eq_nullMass_of_card_one lemma alternativeMass_eq_nullMass_of_card_one (x : Fin n → Covariate) (C : Finset (Fin n)) (hc : C.card = 1) (z : Marks C) : alternativeMass hL n x C z = nullMass n C z := by classical rcases Finset.card_eq_one.mp hc with ⟨i, rfl⟩ let j : ({i} : Finset (Fin n)) := ⟨i, Finset.mem_singleton_self i⟩ let : Subsingleton ({i} : Finset (Fin n)) := ⟨by intro a b apply Subtype.ext exact (Finset.mem_singleton.mp a.property).trans (Finset.mem_singleton.mp b.property).symm⟩ have hp (lam : SignVector hL) : (∏ a : ({i} : Finset (Fin n)), conditionalLikelihood hL lam (x a) (z a).1 (z a).2 / 4) = conditionalLikelihood hL lam (x j) (z j).1 (z j).2 / 4 := Fintype.prod_subsingleton _ j simp only [alternativeMass, hp, ← Finset.sum_div, conditionalLikelihood_sign_sum_exact hL hhL, nullMass, Finset.card_singleton] rw [← mul_div_assoc, sign_weight_real_normalization] norm_num
CausalSmith.Stat.PrivateCateRoughdesign.alternativeMass_eq_nullMass_of_card_one · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCoupling.lean:175
theorem alternativeComponentLaw_eq_null_of_card_one Lemma alternativeComponentLaw_eq_null_of_card_one in the paper ↗

Singleton component measures coincide pointwise, including at support boundaries. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
n :
ℕ
shared
x :
C :
hc :
C.card = 1
Proof (Lean source)
CausalSmith.Stat.PrivateCateRoughdesign.alternativeComponentLaw_eq_null_of_card_one · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCoupling.lean:198

Common component mass lies between zero and each marginal array. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
n :
ℕ
shared
x :
C :
z :
conclusion 1
0 ≤ commonMass hL n x C z
conclusion 2
commonMass hL n x C z ≤ alternativeMass hL n x C z
conclusion 3
commonMass hL n x C z ≤ nullMass n C z
Proof (Lean source)
-- @node: commonMass_bounds lemma commonMass_bounds (x : Fin n → Covariate) (C : Finset (Fin n)) (z : Marks C) : 0 ≤ commonMass hL n x C z ∧ commonMass hL n x C z ≤ alternativeMass hL n x C z ∧ commonMass hL n x C z ≤ nullMass n C z := by exact ⟨le_min (alternativeMass_nonneg hL hhL n x C z) (nullMass_pos n C z).le, min_le_left _ _, min_le_right _ _⟩

The total common component mass is a probability overlap between zero and one. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
n :
ℕ
shared
x :
C :
overlapMass hL n x C ∈ Icc 0 1
Proof (Lean source)
-- @node: overlapMass_range lemma overlapMass_range (x : Fin n → Covariate) (C : Finset (Fin n)) : overlapMass hL n x C ∈ Icc 0 1 := by constructor · exact Finset.sum_nonneg (fun z _ => (commonMass_bounds hL hhL n x C z).1) · calc _ ≤ ∑ z : Marks C, alternativeMass hL n x C z := Finset.sum_le_sum (fun z _ => (commonMass_bounds hL hhL n x C z).2.1) _ = 1 := alternativeMass_sum hL n x C

The fair component array sums to one for every finite component. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
shared
C :
(∑ z : Marks C, nullMass n C z) = 1
Proof (Lean source)
-- @node: nullMass_sum lemma nullMass_sum (C : Finset (Fin n)) : (∑ z : Marks C, nullMass n C z) = 1 := by classical simp only [nullMass, Finset.sum_const, Finset.card_univ, nsmul_eq_mul, Fintype.card_fun, Fintype.card_prod, Fintype.card_bool, Fintype.card_coe] norm_num only [Nat.cast_pow, Nat.cast_mul, Nat.cast_ofNat] rw [zpow_neg, zpow_natCast, mul_inv_cancel₀ (by positivity)]
theorem alternativeResidual_sum Lemma alternativeResidual_sum in the paper ↗

The first residual array has mass one minus the overlap. the theorem's stated inputs and assumptions, and the asserted conclusion follows.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
C :
(∑ z : Marks C, (alternativeMass hL n x C z-commonMass hL n x C z))
= 1-overlapMass hL n x C
Proof (Lean source)
-- @node: alternativeResidual_sum lemma alternativeResidual_sum (x : Fin n → Covariate) (C : Finset (Fin n)) : (∑ z : Marks C, (alternativeMass hL n x C z-commonMass hL n x C z)) = 1-overlapMass hL n x C := by rw [Finset.sum_sub_distrib, alternativeMass_sum] rfl
CausalSmith.Stat.PrivateCateRoughdesign.alternativeResidual_sum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCoupling.lean:237

The second residual array has the same mass one minus the overlap. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
C :
(∑ z : Marks C, (nullMass n C z-commonMass hL n x C z)) = 1-overlapMass hL n x C
Proof (Lean source)
-- @node: nullResidual_sum lemma nullResidual_sum (x : Fin n → Covariate) (C : Finset (Fin n)) : (∑ z : Marks C, (nullMass n C z-commonMass hL n x C z)) = 1-overlapMass hL n x C := by rw [Finset.sum_sub_distrib, nullMass_sum] rfl
theorem alternativeMass_eq_common_of_overlap_one Lemma alternativeMass_eq_common_of_overlap_one in the paper ↗

At full overlap the alternative array equals the common array. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
n :
ℕ
shared
x :
C :
ha :
overlapMass hL n x C = 1
z :
alternativeMass hL n x C z = commonMass hL n x C z
Proof (Lean source)
-- @node: alternativeMass_eq_common_of_overlap_one lemma alternativeMass_eq_common_of_overlap_one (x : Fin n → Covariate) (C : Finset (Fin n)) (ha : overlapMass hL n x C = 1) (z : Marks C) : alternativeMass hL n x C z = commonMass hL n x C z := by have hs : (∑ w : Marks C, (alternativeMass hL n x C w-commonMass hL n x C w)) = 0 := by rw [alternativeResidual_sum, ha, sub_self] have hz := (Finset.sum_eq_zero_iff_of_nonneg (fun w _ => sub_nonneg.mpr (commonMass_bounds hL hhL n x C w).2.1)).mp hs z (Finset.mem_univ z) exact sub_eq_zero.mp hz
CausalSmith.Stat.PrivateCateRoughdesign.alternativeMass_eq_common_of_overlap_one · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCoupling.lean:254
theorem nullMass_eq_common_of_overlap_one Lemma nullMass_eq_common_of_overlap_one in the paper ↗

At full overlap the null array equals the common array. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
n :
ℕ
shared
x :
C :
ha :
overlapMass hL n x C = 1
z :
nullMass n C z = commonMass hL n x C z
Proof (Lean source)
-- @node: nullMass_eq_common_of_overlap_one lemma nullMass_eq_common_of_overlap_one (x : Fin n → Covariate) (C : Finset (Fin n)) (ha : overlapMass hL n x C = 1) (z : Marks C) : nullMass n C z = commonMass hL n x C z := by have hs : (∑ w : Marks C, (nullMass n C w-commonMass hL n x C w)) = 0 := by rw [nullResidual_sum, ha, sub_self] have hz := (Finset.sum_eq_zero_iff_of_nonneg (fun w _ => sub_nonneg.mpr (commonMass_bounds hL hhL n x C w).2.2)).mp hs z (Finset.mem_univ z) exact sub_eq_zero.mp hz
CausalSmith.Stat.PrivateCateRoughdesign.nullMass_eq_common_of_overlap_one · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCoupling.lean:266
theorem componentCouplingMass_nonneg Lemma componentCouplingMass_nonneg in the paper ↗

The explicit common-mass joint array is nonnegative in both overlap branches. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
n :
ℕ
shared
x :
C :
z w :
0 ≤ componentCouplingMass hL n x C z w
Proof (Lean source)
-- @node: componentCouplingMass_nonneg lemma componentCouplingMass_nonneg (x : Fin n → Covariate) (C : Finset (Fin n)) (z w : Marks C) : 0 ≤ componentCouplingMass hL n x C z w := by classical have hz := commonMass_bounds hL hhL n x C z have hw := commonMass_bounds hL hhL n x C w dsimp [componentCouplingMass] split_ifs with ha he he · exact add_nonneg hz.1 (div_nonneg (mul_nonneg (sub_nonneg.mpr hz.2.1) (sub_nonneg.mpr hw.2.2)) (by linarith)) · rw [zero_add] exact div_nonneg (mul_nonneg (sub_nonneg.mpr hz.2.1) (sub_nonneg.mpr hw.2.2)) (by linarith) · exact hz.1 · exact le_rfl
CausalSmith.Stat.PrivateCateRoughdesign.componentCouplingMass_nonneg · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCoupling.lean:278
theorem componentCouplingMass_row_sum Lemma componentCouplingMass_row_sum in the paper ↗

Summing a row of the explicit coupling recovers the alternative component mass. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
n :
ℕ
shared
x :
C :
z :
(∑ w : Marks C, componentCouplingMass hL n x C z w) = alternativeMass hL n x C z
Proof (Lean source)
-- @node: componentCouplingMass_row_sum lemma componentCouplingMass_row_sum (x : Fin n → Covariate) (C : Finset (Fin n)) (z : Marks C) : (∑ w : Marks C, componentCouplingMass hL n x C z w) = alternativeMass hL n x C z := by classical by_cases ha : overlapMass hL n x C < 1 · have hd : 1-overlapMass hL n x C ≠ 0 := by linarith simp only [componentCouplingMass, if_pos ha, Finset.sum_add_distrib, ← Finset.sum_div, ← Finset.mul_sum] rw [nullResidual_sum] simp only [Finset.sum_ite_eq, Finset.mem_univ, if_true] field_simp ring · have he : overlapMass hL n x C = 1 := le_antisymm (overlapMass_range hL hhL n x C).2 (le_of_not_gt ha) simp only [componentCouplingMass, if_neg ha, Finset.sum_ite_eq, Finset.mem_univ, if_true] exact (alternativeMass_eq_common_of_overlap_one hL hhL n x C he z).symm
CausalSmith.Stat.PrivateCateRoughdesign.componentCouplingMass_row_sum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCoupling.lean:296
theorem componentCouplingMass_column_sum Lemma componentCouplingMass_column_sum in the paper ↗

Summing a column of the explicit coupling recovers the null component mass. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
n :
ℕ
shared
x :
C :
w :
(∑ z : Marks C, componentCouplingMass hL n x C z w) = nullMass n C w
Proof (Lean source)
-- @node: componentCouplingMass_column_sum lemma componentCouplingMass_column_sum (x : Fin n → Covariate) (C : Finset (Fin n)) (w : Marks C) : (∑ z : Marks C, componentCouplingMass hL n x C z w) = nullMass n C w := by classical by_cases ha : overlapMass hL n x C < 1 · have hd : 1-overlapMass hL n x C ≠ 0 := by linarith simp only [componentCouplingMass, if_pos ha, Finset.sum_add_distrib, ← Finset.sum_div, ← Finset.sum_mul] rw [alternativeResidual_sum] simp only [Finset.sum_ite_eq', Finset.mem_univ, if_true] field_simp ring · have he : overlapMass hL n x C = 1 := le_antisymm (overlapMass_range hL hhL n x C).2 (le_of_not_gt ha) simp only [componentCouplingMass, if_neg ha, Finset.sum_ite_eq', Finset.mem_univ, if_true] exact (nullMass_eq_common_of_overlap_one hL hhL n x C he w).symm
CausalSmith.Stat.PrivateCateRoughdesign.componentCouplingMass_column_sum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCoupling.lean:317
theorem componentCoupling_map_fst Lemma componentCoupling_map_fst in the paper ↗

The explicit finite coupling has the alternative component law as first marginal. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
n :
ℕ
shared
x :
C :
Proof (Lean source)
-- @node: componentCoupling_map_fst lemma componentCoupling_map_fst (x : Fin n → Covariate) (C : Finset (Fin n)) : (componentCoupling hL n x C).map fst = alternativeComponentLaw hL n x C := by classical have hr (z : Marks C) : (∑ w : Marks C, ofReal (componentCouplingMass hL n x C z w)) = ofReal (alternativeMass hL n x C z) := by rw [← ENNReal.ofReal_sum_of_nonneg (fun w _ => componentCouplingMass_nonneg hL hhL n x C z w), componentCouplingMass_row_sum hL hhL] ext S hS rw [Measure.map_apply measurable_fst hS] simp only [componentCoupling, alternativeComponentLaw, Measure.finsetSum_apply, Measure.smul_apply, smul_eq_mul, Measure.dirac_apply, Fintype.sum_prod_type] apply Finset.sum_congr rfl intro z _ change (∑ w : Marks C, ofReal (componentCouplingMass hL n x C z w) * S.indicator 1 z) = ofReal (alternativeMass hL n x C z) * S.indicator 1 z rw [← Finset.sum_mul, hr]
CausalSmith.Stat.PrivateCateRoughdesign.componentCoupling_map_fst · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCoupling.lean:338
theorem componentCoupling_map_snd Lemma componentCoupling_map_snd in the paper ↗

The explicit finite coupling has the fair component law as second marginal. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
n :
ℕ
shared
x :
C :
Proof (Lean source)
-- @node: componentCoupling_map_snd lemma componentCoupling_map_snd (x : Fin n → Covariate) (C : Finset (Fin n)) : (componentCoupling hL n x C).map snd = nullComponentLaw n C := by classical have hc (w : Marks C) : (∑ z : Marks C, ofReal (componentCouplingMass hL n x C z w)) = ofReal (nullMass n C w) := by rw [← ENNReal.ofReal_sum_of_nonneg (fun z _ => componentCouplingMass_nonneg hL hhL n x C z w), componentCouplingMass_column_sum hL hhL] ext S hS rw [Measure.map_apply measurable_snd hS] simp only [componentCoupling, nullComponentLaw, Measure.finsetSum_apply, Measure.smul_apply, smul_eq_mul, Measure.dirac_apply, Fintype.sum_prod_type] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro w _ change (∑ z : Marks C, ofReal (componentCouplingMass hL n x C z w) * S.indicator 1 w) = ofReal (nullMass n C w) * S.indicator 1 w rw [← Finset.sum_mul, hc]
CausalSmith.Stat.PrivateCateRoughdesign.componentCoupling_map_snd · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCoupling.lean:360
theorem nullComponentLaw_isProbabilityMeasure Lemma nullComponentLaw_isProbabilityMeasure in the paper ↗

The fair finite component measure is a probability measure. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
shared
C :
Proof (Lean source)
-- @node: nullComponentLaw_isProbabilityMeasure lemma nullComponentLaw_isProbabilityMeasure (C : Finset (Fin n)) : IsProbabilityMeasure (nullComponentLaw n C) := by constructor simp only [nullComponentLaw, Measure.finsetSum_apply, Measure.smul_apply, Measure.dirac_apply_of_mem (Set.mem_univ _), smul_eq_mul, mul_one] rw [← ENNReal.ofReal_sum_of_nonneg (fun z _ => (nullMass_pos n C z).le), nullMass_sum] exact ENNReal.ofReal_one
CausalSmith.Stat.PrivateCateRoughdesign.nullComponentLaw_isProbabilityMeasure · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCoupling.lean:382
theorem componentCoupling_isCoupling Lemma componentCoupling_isCoupling in the paper ↗

The common-mass component construction is a probability coupling of its two mark laws. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
n :
ℕ
shared
x :
C :
Proof (Lean source)
-- @node: componentCoupling_isCoupling lemma componentCoupling_isCoupling (x : Fin n → Covariate) (C : Finset (Fin n)) : IsCoupling (componentCoupling hL n x C) (alternativeComponentLaw hL n x C) (nullComponentLaw n C) := by have hs := componentCoupling_map_snd hL hhL n x C have hprob : IsProbabilityMeasure (componentCoupling hL n x C) := by constructor have hm := congrArg (fun mu : Measure (Marks C) => mu univ) hs rw [Measure.map_apply measurable_snd MeasurableSet.univ] at hm let := nullComponentLaw_isProbabilityMeasure n C simpa using hm exact ⟨hprob, componentCoupling_map_fst hL hhL n x C, hs⟩
CausalSmith.Stat.PrivateCateRoughdesign.componentCoupling_isCoupling · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCoupling.lean:393
theorem componentResidual_diagonal_zero Lemma componentResidual_diagonal_zero in the paper ↗

At any mark vector one of the two residual masses is zero. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
C :
z :
(alternativeMass hL n x C z-commonMass hL n x C z) * (nullMass n C z-commonMass hL n x C z)
= 0
Proof (Lean source)
-- @node: componentResidual_diagonal_zero lemma componentResidual_diagonal_zero (x : Fin n → Covariate) (C : Finset (Fin n)) (z : Marks C) : (alternativeMass hL n x C z-commonMass hL n x C z) * (nullMass n C z-commonMass hL n x C z) = 0 := by dsimp [commonMass] rcases le_total (alternativeMass hL n x C z) (nullMass n C z) with h | h · rw [min_eq_left h, sub_self, zero_mul] · rw [min_eq_right h, sub_self, mul_zero]
CausalSmith.Stat.PrivateCateRoughdesign.componentResidual_diagonal_zero · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCoupling.lean:407
theorem componentCouplingMass_diagonal Lemma componentCouplingMass_diagonal in the paper ↗

The diagonal entry of the joint array is exactly the common mass in either branch. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
C :
z :
componentCouplingMass hL n x C z z = commonMass hL n x C z
Proof (Lean source)
-- @node: componentCouplingMass_diagonal lemma componentCouplingMass_diagonal (x : Fin n → Covariate) (C : Finset (Fin n)) (z : Marks C) : componentCouplingMass hL n x C z z = commonMass hL n x C z := by classical simp only [componentCouplingMass, if_true, componentResidual_diagonal_zero, zero_div, add_zero, ite_self]
CausalSmith.Stat.PrivateCateRoughdesign.componentCouplingMass_diagonal · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCoupling.lean:418
theorem componentCoupling_diagonal_mass Lemma componentCoupling_diagonal_mass in the paper ↗

The component coupling's agreement probability is precisely its common mass overlap. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
n :
ℕ
shared
x :
C :
componentCoupling hL n x C {zw | zw.1 = zw.2} = ofReal (overlapMass hL n x C)
Proof (Lean source)
-- @node: componentCoupling_diagonal_mass lemma componentCoupling_diagonal_mass (x : Fin n → Covariate) (C : Finset (Fin n)) : componentCoupling hL n x C {zw | zw.1 = zw.2} = ofReal (overlapMass hL n x C) := by classical simp only [componentCoupling, Measure.finsetSum_apply, Measure.smul_apply, smul_eq_mul, Measure.dirac_apply, Fintype.sum_prod_type, indicator, Set.mem_ofPred_eq, Pi.one_apply, mul_ite, mul_one, mul_zero, Finset.sum_ite_eq, Finset.mem_univ, if_true, componentCouplingMass_diagonal] exact (ENNReal.ofReal_sum_of_nonneg (fun z _ => (commonMass_bounds hL hhL n x C z).1)).symm
CausalSmith.Stat.PrivateCateRoughdesign.componentCoupling_diagonal_mass · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCoupling.lean:428

The absolute array difference is twice the mass outside their pointwise overlap. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
C :
(∑ z : Marks C, |alternativeMass hL n x C z-nullMass n C z|) = 2*(1-overlapMass hL n x C)
Proof (Lean source)
-- @node: componentMass_abs_sum lemma componentMass_abs_sum (x : Fin n → Covariate) (C : Finset (Fin n)) : (∑ z : Marks C, |alternativeMass hL n x C z-nullMass n C z|) = 2*(1-overlapMass hL n x C) := by have hp (z : Marks C) : |alternativeMass hL n x C z-nullMass n C z| = alternativeMass hL n x C z + nullMass n C z - 2*commonMass hL n x C z := by dsimp [commonMass] rcases le_total (alternativeMass hL n x C z) (nullMass n C z) with h | h · rw [min_eq_left h, abs_of_nonpos (sub_nonpos.mpr h)]; ring · rw [min_eq_right h, abs_of_nonneg (sub_nonneg.mpr h)]; ring simp_rw [hp] rw [Finset.sum_sub_distrib, Finset.sum_add_distrib, ← Finset.mul_sum, alternativeMass_sum, nullMass_sum] dsimp [overlapMass] ring
theorem overlapMass_eq_one_of_card_one Lemma overlapMass_eq_one_of_card_one in the paper ↗

Singleton components have full common-mass overlap. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
n :
ℕ
shared
x :
C :
hc :
C.card = 1
overlapMass hL n x C = 1
Proof (Lean source)
-- @node: overlapMass_eq_one_of_card_one lemma overlapMass_eq_one_of_card_one (x : Fin n → Covariate) (C : Finset (Fin n)) (hc : C.card = 1) : overlapMass hL n x C = 1 := by simp only [overlapMass, commonMass, alternativeMass_eq_nullMass_of_card_one hL hhL n x C hc, min_self] exact nullMass_sum n C
CausalSmith.Stat.PrivateCateRoughdesign.overlapMass_eq_one_of_card_one · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCoupling.lean:459
theorem componentCoupling_disagreement_mass Lemma componentCoupling_disagreement_mass in the paper ↗

The explicit component coupling fails with probability exactly one minus its overlap. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
n :
ℕ
shared
x :
C :
componentCoupling hL n x C {zw | zw.1 ≠ zw.2} = ofReal (1-overlapMass hL n x C)
Proof (Lean source)
-- @node: componentCoupling_disagreement_mass lemma componentCoupling_disagreement_mass (x : Fin n → Covariate) (C : Finset (Fin n)) : componentCoupling hL n x C {zw | zw.1 ≠ zw.2} = ofReal (1-overlapMass hL n x C) := by letI := (componentCoupling_isCoupling hL hhL n x C).isProbabilityMeasure have hD : MeasurableSet {zw : Marks C × Marks C | zw.1 = zw.2} := measurableSet_eq_fun measurable_fst measurable_snd change componentCoupling hL n x C ({zw | zw.1 = zw.2}ᶜ) = _ rw [measure_compl hD (measure_ne_top _ _), measure_univ, componentCoupling_diagonal_mass hL hhL] simpa only [ENNReal.ofReal_one] using (ENNReal.ofReal_sub 1 (overlapMass_range hL hhL n x C).1).symm
CausalSmith.Stat.PrivateCateRoughdesign.componentCoupling_disagreement_mass · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCoupling.lean:468
theorem componentCoupling_disagreement_zero_of_card_one Lemma componentCoupling_disagreement_zero_of_card_one in the paper ↗

Singleton couplings agree almost surely, including support-boundary singletons. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
n :
ℕ
shared
x :
C :
hc :
C.card = 1
componentCoupling hL n x C {zw | zw.1 ≠ zw.2} = 0
Proof (Lean source)
-- @node: componentCoupling_disagreement_zero_of_card_one lemma componentCoupling_disagreement_zero_of_card_one (x : Fin n → Covariate) (C : Finset (Fin n)) (hc : C.card = 1) : componentCoupling hL n x C {zw | zw.1 ≠ zw.2} = 0 := by rw [componentCoupling_disagreement_mass hL hhL, overlapMass_eq_one_of_card_one hL hhL n x C hc, sub_self, ENNReal.ofReal_zero]
CausalSmith.Stat.PrivateCateRoughdesign.componentCoupling_disagreement_zero_of_card_one · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCoupling.lean:483
theorem componentCoupling_hamming_cost_le Lemma componentCoupling_hamming_cost_le in the paper ↗

A component can change at most its cardinality on the coupling's failure event. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
n :
ℕ
shared
x :
C :
(∫⁻ zw, (hammingDist zw.1 zw.2 : ℝ≥0∞) ∂componentCoupling hL n x C)
≤ (C.card : ℝ≥0∞) * ofReal (1-overlapMass hL n x C)
Proof (Lean source)
-- @node: componentCoupling_hamming_cost_le lemma componentCoupling_hamming_cost_le (x : Fin n → Covariate) (C : Finset (Fin n)) : (∫⁻ zw, (hammingDist zw.1 zw.2 : ℝ≥0∞) ∂componentCoupling hL n x C) ≤ (C.card : ℝ≥0∞) * ofReal (1-overlapMass hL n x C) := by classical calc _ ≤ ∫⁻ zw, ({zw : Marks C × Marks C | zw.1 ≠ zw.2}.indicator (fun _ => (C.card : ℝ≥0∞))) zw ∂componentCoupling hL n x C := by apply lintegral_mono intro zw by_cases heq : zw.1 = zw.2 · simp [heq] · rw [Set.indicator_of_mem heq] exact Nat.cast_le.mpr (by simpa using (hammingDist_le_card_fintype (x := zw.1) (y := zw.2))) _ = _ := by rw [lintegral_indicator (show MeasurableSet {zw : Marks C × Marks C | zw.1 ≠ zw.2} from (measurableSet_eq_fun measurable_fst measurable_snd).compl), lintegral_const, Measure.restrict_apply_univ, componentCoupling_disagreement_mass hL hhL]
CausalSmith.Stat.PrivateCateRoughdesign.componentCoupling_hamming_cost_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCoupling.lean:492
theorem componentCoupling_hamming_cost_le_abs_sum Lemma componentCoupling_hamming_cost_le_abs_sum in the paper ↗

The component transport cost is at most half its size times the absolute array difference. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
n :
ℕ
shared
x :
C :
(∫⁻ zw, (hammingDist zw.1 zw.2 : ℝ≥0∞) ∂componentCoupling hL n x C)
≤ ofReal ((C.card : ℝ)/2 * ∑ z : Marks C, |alternativeMass hL n x C z-nullMass n C z|)
Proof (Lean source)
-- @node: componentCoupling_hamming_cost_le_abs_sum lemma componentCoupling_hamming_cost_le_abs_sum (x : Fin n → Covariate) (C : Finset (Fin n)) : (∫⁻ zw, (hammingDist zw.1 zw.2 : ℝ≥0∞) ∂componentCoupling hL n x C) ≤ ofReal ((C.card : ℝ)/2 * ∑ z : Marks C, |alternativeMass hL n x C z-nullMass n C z|) := by rw [componentMass_abs_sum] have heq : (C.card : ℝ)/2 * (2*(1-overlapMass hL n x C)) = (C.card : ℝ)*(1-overlapMass hL n x C) := by ring rw [heq, ENNReal.ofReal_mul (Nat.cast_nonneg _), ENNReal.ofReal_natCast] exact componentCoupling_hamming_cost_le hL hhL n x C
CausalSmith.Stat.PrivateCateRoughdesign.componentCoupling_hamming_cost_le_abs_sum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCoupling.lean:515
theorem componentCoupling_hamming_cost_zero_of_card_one Lemma componentCoupling_hamming_cost_zero_of_card_one in the paper ↗

Singleton components contribute no expected changed marks to the dataset coupling. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
n :
ℕ
shared
x :
C :
hc :
C.card = 1
(∫⁻ zw, (hammingDist zw.1 zw.2 : ℝ≥0∞) ∂componentCoupling hL n x C) = 0
Proof (Lean source)
-- @node: componentCoupling_hamming_cost_zero_of_card_one lemma componentCoupling_hamming_cost_zero_of_card_one (x : Fin n → Covariate) (C : Finset (Fin n)) (hc : C.card = 1) : (∫⁻ zw, (hammingDist zw.1 zw.2 : ℝ≥0∞) ∂componentCoupling hL n x C) = 0 := by apply le_antisymm _ bot_le have hcost := componentCoupling_hamming_cost_le hL hhL n x C rw [overlapMass_eq_one_of_card_one hL hhL n x C hc, sub_self, ENNReal.ofReal_zero, mul_zero] at hcost exact hcost
CausalSmith.Stat.PrivateCateRoughdesign.componentCoupling_hamming_cost_zero_of_card_one · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentCoupling.lean:529
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.ComponentFactorization 12 declarations Pointwise products over the ordered shared-sign partition: fixed-sign conditional likelihoods and fair null masses factor at every covariate vector.

Pointwise products over the ordered shared-sign partition: fixed-sign conditional likelihoods and fair null masses factor at every covariate vector.

theorem orderedComponents_biUnion Lemma orderedComponents_biUnion in the paper ↗

The finite union of the ordered components is the whole dataset index set. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
(orderedComponents hL n x).toFinset.biUnion id = univ
Proof (Lean source)
-- @node: orderedComponents_biUnion lemma orderedComponents_biUnion (x : Fin n → Covariate) : (orderedComponents hL n x).toFinset.biUnion id = univ := by classical ext i simp only [Finset.mem_biUnion, List.mem_toFinset, id_eq, Finset.mem_univ, iff_true] exact orderedComponents_cover hL n x i
CausalSmith.Stat.PrivateCateRoughdesign.orderedComponents_biUnion · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentFactorization.lean:12
theorem orderedComponents_pairwiseDisjoint Lemma orderedComponents_pairwiseDisjoint in the paper ↗

The finset underlying the component order is a disjoint partition. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
PairwiseDisjoint ((orderedComponents hL n x).toFinset : Set (Finset (Fin n))) id
Proof (Lean source)
-- @node: orderedComponents_pairwiseDisjoint lemma orderedComponents_pairwiseDisjoint (x : Fin n → Covariate) : PairwiseDisjoint ((orderedComponents hL n x).toFinset : Set (Finset (Fin n))) id := by classical intro C hC D hD hne exact orderedComponents_disjoint hL n x C D (List.mem_toFinset.mp hC) (List.mem_toFinset.mp hD) hne
CausalSmith.Stat.PrivateCateRoughdesign.orderedComponents_pairwiseDisjoint · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentFactorization.lean:21

Multiplying vertex factors component by component equals the full dataset product. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
α :
Type*
x :
f :
Fin n → α
((orderedComponents hL n x).map (fun C : Finset (Fin n) => ∏ i : C, f i)).prod = ∏ i, f i
Proof (Lean source)
-- @node: orderedComponents_prod lemma orderedComponents_prod {α : Type*} [CommMonoid α] (x : Fin n → Covariate) (f : Fin n → α) : ((orderedComponents hL n x).map (fun C : Finset (Fin n) => ∏ i : C, f i)).prod = ∏ i, f i := by classical simp_rw [Finset.prod_coe_sort] rw [← List.prod_toFinset _ (orderedComponents_nodup hL n x)] have hp := Finset.prod_biUnion (f := f) (orderedComponents_pairwiseDisjoint hL n x) rw [orderedComponents_biUnion] at hp simpa only [id_eq] using hp.symm
theorem orderedComponents_card_sum Lemma orderedComponents_card_sum in the paper ↗

Component cardinalities sum to the number of dataset records. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
((orderedComponents hL n x).map card).sum = n
Proof (Lean source)
-- @node: orderedComponents_card_sum lemma orderedComponents_card_sum (x : Fin n → Covariate) : ((orderedComponents hL n x).map card).sum = n := by classical have hs := Finset.sum_biUnion (f := fun _ : Fin n => (1 : ℕ)) (orderedComponents_pairwiseDisjoint hL n x) rw [orderedComponents_biUnion] at hs simpa only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, smul_eq_mul, mul_one, id_eq, List.sum_toFinset _ (orderedComponents_nodup hL n x)] using hs.symm
CausalSmith.Stat.PrivateCateRoughdesign.orderedComponents_card_sum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentFactorization.lean:42
theorem fixedSign_component_factorization Lemma fixedSign_component_factorization in the paper ↗

Conditional independence given signs factors its mark likelihood over the graph partition. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
z :
Fin n → Bool × Bool
lam :
(∏ i : Fin n, conditionalLikelihood hL lam (x i) (z i).1 (z i).2 / 4)
= ((orderedComponents hL n x).map (fun C : Finset (Fin n) => ∏ i : C, conditionalLikelihood hL lam (x i) (z i).1 (z i).2 / 4)).prod
Proof (Lean source)
-- @node: fixedSign_component_factorization lemma fixedSign_component_factorization (x : Fin n → Covariate) (z : Fin n → Bool × Bool) (lam : SignVector hL) : (∏ i : Fin n, conditionalLikelihood hL lam (x i) (z i).1 (z i).2 / 4) = ((orderedComponents hL n x).map (fun C : Finset (Fin n) => ∏ i : C, conditionalLikelihood hL lam (x i) (z i).1 (z i).2 / 4)).prod := by exact (orderedComponents_prod hL n x _).symm
CausalSmith.Stat.PrivateCateRoughdesign.fixedSign_component_factorization · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentFactorization.lean:53
theorem nullMass_eq_vertex_prod Lemma nullMass_eq_vertex_prod in the paper ↗

A fair component mass is the product of the fair one-record masses. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
shared
C :
z :
nullMass n C z = ∏ _i : C, (1 / 4 : ℝ)
Proof (Lean source)
-- @node: nullMass_eq_vertex_prod lemma nullMass_eq_vertex_prod (C : Finset (Fin n)) (z : Marks C) : nullMass n C z = ∏ _i : C, (1 / 4 : ℝ) := by simp [nullMass, zpow_neg, zpow_natCast, one_div]
theorem nullMass_component_factorization Lemma nullMass_component_factorization in the paper ↗

The fair null factors over components at every covariate vector. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
z :
Fin n → Bool × Bool
(4 : ℝ)^(-(n : ℤ))
= ((orderedComponents hL n x).map (fun C => nullMass n C (fun i => z i))).prod
Proof (Lean source)
-- @node: nullMass_component_factorization lemma nullMass_component_factorization (x : Fin n → Covariate) (z : Fin n → Bool × Bool) : (4 : ℝ)^(-(n : ℤ)) = ((orderedComponents hL n x).map (fun C => nullMass n C (fun i => z i))).prod := by simp_rw [nullMass_eq_vertex_prod] rw [orderedComponents_prod hL n x (fun _ => (1 / 4 : ℝ))] simp [zpow_neg, zpow_natCast, one_div]
CausalSmith.Stat.PrivateCateRoughdesign.nullMass_component_factorization · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentFactorization.lean:68

A component uses precisely those active signs nonzero at one of its vertices.

Definition (Lean source)
hL :
ℝ
shared
n :
ℕ
shared
x :
C :
componentSignIndices hL n x C :
Finset.univ.filter (fun j => ∃ i ∈ C, envelope hL (x i) * frame hL j (x i) ≠ 0)
theorem mem_componentSignIndices

The sign block membership test is the existence of a vertex using that coordinate. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
C :
j :
j ∈ componentSignIndices hL n x C ↔ ∃ i ∈ C, envelope hL (x i) * frame hL j (x i) ≠ 0
Proof (Lean source)
-- @node: mem_componentSignIndices lemma mem_componentSignIndices (x : Fin n → Covariate) (C : Finset (Fin n)) (j : activeSigns hL) : j ∈ componentSignIndices hL n x C ↔ ∃ i ∈ C, envelope hL (x i) * frame hL j (x i) ≠ 0 := by classical simp [componentSignIndices]
CausalSmith.Stat.PrivateCateRoughdesign.mem_componentSignIndices · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentFactorization.lean:85
theorem orderedComponents_signIndices_pairwiseDisjoint

Distinct ordered graph components use disjoint coordinate blocks of the latent signs. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
Proof (Lean source)
-- @node: orderedComponents_signIndices_pairwiseDisjoint lemma orderedComponents_signIndices_pairwiseDisjoint (x : Fin n → Covariate) : PairwiseDisjoint ((orderedComponents hL n x).toFinset : Set (Finset (Fin n))) (componentSignIndices hL n x) := by classical intro C hC D hD hne apply Finset.disjoint_left.mpr intro j hjC hjD obtain ⟨i, hi, hij⟩ := (mem_componentSignIndices hL n x C j).mp hjC obtain ⟨l, hl, hlj⟩ := (mem_componentSignIndices hL n x D j).mp hjD obtain ⟨r, hr, rfl⟩ := (mem_orderedComponents hL n x C).mp (List.mem_toFinset.mp hC) obtain ⟨s, hs, rfl⟩ := (mem_orderedComponents hL n x D).mp (List.mem_toFinset.mp hD) have hrs : ¬(sharedGraph hL n x).Reachable r s := by intro hrs exact hne (componentVertices_eq_of_reachable hL n x r s hrs) exact hlj (component_activeSigns_disjoint hL n x r s i l hrs hi hl j hij)
CausalSmith.Stat.PrivateCateRoughdesign.orderedComponents_signIndices_pairwiseDisjoint · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentFactorization.lean:94
theorem componentLikelihood_dependsOn_signIndices

A component mark product is a function only of its selected sign block. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
C :
z :
lam lam' :
hagree :
∀ j ∈ componentSignIndices hL n x C, lam j = lam' j
(∏ i : C, conditionalLikelihood hL lam (x i) (z i).1 (z i).2 / 4)
= ∏ i : C, conditionalLikelihood hL lam' (x i) (z i).1 (z i).2 / 4
Proof (Lean source)
-- @node: componentLikelihood_dependsOn_signIndices lemma componentLikelihood_dependsOn_signIndices (x : Fin n → Covariate) (C : Finset (Fin n)) (z : Marks C) (lam lam' : SignVector hL) (hagree : ∀ j ∈ componentSignIndices hL n x C, lam j = lam' j) : (∏ i : C, conditionalLikelihood hL lam (x i) (z i).1 (z i).2 / 4) = ∏ i : C, conditionalLikelihood hL lam' (x i) (z i).1 (z i).2 / 4 := by apply componentLikelihood_eq_of_activeSigns_agree hL n x C z lam lam' intro i j hj exact hagree j ((mem_componentSignIndices hL n x C j).mpr ⟨i, i.property, hj⟩)
CausalSmith.Stat.PrivateCateRoughdesign.componentLikelihood_dependsOn_signIndices · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentFactorization.lean:112
theorem fullAlternativeMass_component_factorization Lemma fullAlternativeMass_component_factorization in the paper ↗

Mixing independent signs preserves the product over distinct shared-sign components. This identity holds pointwise in the covariates, including all support boundaries. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
z :
Fin n → Bool × Bool
= ((orderedComponents hL n x).map (fun C => alternativeMass hL n x C (fun i => z i))).prod
Proof (Lean source)
-- @node: fullAlternativeMass_component_factorization lemma fullAlternativeMass_component_factorization (x : Fin n → Covariate) (z : Fin n → Bool × Bool) : fullAlternativeMass hL n x z = ((orderedComponents hL n x).map (fun C => alternativeMass hL n x C (fun i => z i))).prod := by classical let F : Finset (Fin n) → SignVector hL → ℝ := fun C lam => ∏ i : C, conditionalLikelihood hL lam (x i) (z i).1 (z i).2 / 4 have hfactor := fairSignAverage_disjointBlocks_prod (orderedComponents hL n x).toFinset (componentSignIndices hL n x) F (orderedComponents_signIndices_pairwiseDisjoint hL n x) (fun C _ lam lam' hagree => componentLikelihood_dependsOn_signIndices hL n x C (fun i => z i) lam lam' hagree) have hweight : card (activeSigns hL) = (activeSigns hL).card := Fintype.card_coe _ rw [hweight] at hfactor have hprod (lam : SignVector hL) : (∏ C ∈ (orderedComponents hL n x).toFinset, F C lam) = ∏ i : Fin n, conditionalLikelihood hL lam (x i) (z i).1 (z i).2 / 4 := by rw [List.prod_toFinset (fun C => F C lam) (orderedComponents_nodup hL n x)] exact orderedComponents_prod hL n x (fun i => conditionalLikelihood hL lam (x i) (z i).1 (z i).2 / 4) simp_rw [hprod] at hfactor change fullAlternativeMass hL n x z = ∏ C ∈ (orderedComponents hL n x).toFinset, alternativeMass hL n x C (fun i => z i) at hfactor rw [List.prod_toFinset (fun C => alternativeMass hL n x C (fun i => z i)) (orderedComponents_nodup hL n x)] at hfactor exact hfactor
CausalSmith.Stat.PrivateCateRoughdesign.fullAlternativeMass_component_factorization · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentFactorization.lean:123
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.ComponentJointLaw 30 declarations Finite partition sums, conditional marginals of the product common-mass coupling, and the quadratic component total-variation bound.

Finite partition sums, conditional marginals of the product common-mass coupling, and the quadratic component total-variation bound. The certificates hold at every covariate vector, including support boundaries.

Restriction to the blocks of a finite partition is a bijection of assignment spaces.

Definition (Lean source)
ι α :
s :
hcover :
∀ i, ∃ C ∈ s, i ∈ C
hdisj :
partitionRestrictionEquiv s hcover hdisj :
(ι → α) ≃ (∀ C : s, ↥(C : Finset ι) → α)
by classical apply Equiv.ofBijective (fun (z : ι → α) (C : s) (i : ↥(C : Finset ι)) => z i) constructor · intro z w h funext i obtain ⟨C, hC, hi⟩ := hcover i exact congrFun (congrFun h ⟨C, hC⟩) ⟨i, hi⟩ · intro w choose C hC hi using hcover refine ⟨fun i
=> w ⟨C i, hC i⟩ ⟨i, hi i⟩, ?_⟩ funext D i have he : C i = D := by by_contra hne exact Finset.disjoint_left.mp (hdisj (hC i) D.property hne) (hi i) i.property have hs : (⟨C i, hC i⟩ : s) = D := Subtype.ext he have key : ∀ (E D : s) (he : E = D) (a : ↥(E : Finset ι)) (b : ↥(D : Finset ι)), (a : ι) = (b : ι) → w E a = w D b := by intro E D he a b hab subst D exact congrArg (w E) (Subtype.ext hab) exact key _ _ hs _ _ rfl
CausalSmith.Stat.PrivateCateRoughdesign.partitionRestrictionEquiv · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentJointLaw.lean:14

Summing products of independent block arrays factors into their individual sums. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
ι α :
s :
hcover :
∀ i, ∃ C ∈ s, i ∈ C
hdisj :
F :
∀ C : Finset ι
if
(C → α)
then
ℝ
(∑ z : ι → α, ∏ C ∈ s, F C (fun i => z i)) = ∏ C ∈ s, ∑ z : C → α, F C z
Proof (Lean source)
-- @node: sum_prod_partition lemma sum_prod_partition {ι α : Type*} [Fintype ι] [DecidableEq ι] [Fintype α] (s : Finset (Finset ι)) (hcover : ∀ i, ∃ C ∈ s, i ∈ C) (hdisj : PairwiseDisjoint (s : Set (Finset ι)) id) (F : ∀ C : Finset ι, (C → α) → ℝ) : (∑ z : ι → α, ∏ C ∈ s, F C (fun i => z i)) = ∏ C ∈ s, ∑ z : C → α, F C z := by classical let e := partitionRestrictionEquiv (α := α) s hcover hdisj calc _ = ∑ w : ∀ C : s, ↥(C : Finset ι) → α, ∏ C : s, F C (w C) := by apply Fintype.sum_equiv e intro z change (∏ C ∈ s, F C (fun i => z i)) = ∏ C : s, F C (fun i => z i) exact (Finset.prod_coe_sort s (fun C => F C (fun i => z i))).symm _ = _ := by rw [← Fintype.prod_sum] exact Finset.prod_coe_sort s (fun C => ∑ z : C → α, F C z)
theorem orderedComponents_sum_prod Lemma orderedComponents_sum_prod in the paper ↗

The ordered shared-sign components form a finite partition for any mark alphabet. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
α :
Type*
hL :
ℝ
n :
ℕ
x :
F :
∀ C : Finset (Fin n)
if
(C → α)
then
ℝ
(∑ z : Fin n → α, ((orderedComponents hL n x).map (fun C => F C (fun i => z i))).prod)
= ((orderedComponents hL n x).map (fun (C : Finset (Fin n)) => ∑ z : C → α, F C z)).prod
Proof (Lean source)
-- @node: orderedComponents_sum_prod lemma orderedComponents_sum_prod {α : Type*} [Fintype α] (hL : ℝ) (n : ℕ) (x : Fin n → Covariate) (F : ∀ C : Finset (Fin n), (C → α) → ℝ) : (∑ z : Fin n → α, ((orderedComponents hL n x).map (fun C => F C (fun i => z i))).prod) = ((orderedComponents hL n x).map (fun (C : Finset (Fin n)) => ∑ z : C → α, F C z)).prod := by classical have hc : ∀ i, ∃ C ∈ (orderedComponents hL n x).toFinset, i ∈ C := by intro i obtain ⟨C, hC, hi⟩ := orderedComponents_cover hL n x i exact ⟨C, List.mem_toFinset.mpr hC, hi⟩ have hd : PairwiseDisjoint ((orderedComponents hL n x).toFinset : Set (Finset (Fin n))) id := by intro C hC D hD hne exact orderedComponents_disjoint hL n x C D (List.mem_toFinset.mp hC) (List.mem_toFinset.mp hD) hne simp_rw [← List.prod_toFinset _ (orderedComponents_nodup hL n x)] exact sum_prod_partition _ hc hd F
CausalSmith.Stat.PrivateCateRoughdesign.orderedComponents_sum_prod · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentJointLaw.lean:64

Every product joint mass is nonnegative. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
x :
z w :
Fin n → Bool × Bool
0 ≤ jointMarkMass hL n x z w
Proof (Lean source)
-- @node: jointMarkMass_nonneg lemma jointMarkMass_nonneg (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (x : Fin n → Covariate) (z w : Fin n → Bool × Bool) : 0 ≤ jointMarkMass hL n x z w := by apply List.prod_nonneg intro a ha obtain ⟨C, _, rfl⟩ := List.mem_map.mp ha exact componentCouplingMass_nonneg hL hhL n x C _ _

Summing a row of the joint product recovers the full conditional sign mixture. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
x :
z :
Fin n → Bool × Bool
(∑ w, jointMarkMass hL n x z w) = fullAlternativeMass hL n x z
Proof (Lean source)
-- @node: jointMarkMass_row_sum lemma jointMarkMass_row_sum (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (x : Fin n → Covariate) (z : Fin n → Bool × Bool) : (∑ w, jointMarkMass hL n x z w) = fullAlternativeMass hL n x z := by unfold jointMarkMass rw [orderedComponents_sum_prod] simp_rw [componentCouplingMass_row_sum hL hhL] exact (fullAlternativeMass_component_factorization hL n x z).symm
CausalSmith.Stat.PrivateCateRoughdesign.jointMarkMass_row_sum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentJointLaw.lean:95
theorem jointMarkMass_column_sum Lemma jointMarkMass_column_sum in the paper ↗

Summing a column of the joint product recovers the full fair mark array. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
x :
w :
Fin n → Bool × Bool
(∑ z, jointMarkMass hL n x z w) = (4 : ℝ)^(-(n : ℤ))
Proof (Lean source)
-- @node: jointMarkMass_column_sum lemma jointMarkMass_column_sum (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (x : Fin n → Covariate) (w : Fin n → Bool × Bool) : (∑ z, jointMarkMass hL n x z w) = (4 : ℝ)^(-(n : ℤ)) := by unfold jointMarkMass rw [orderedComponents_sum_prod hL n x (fun C z => componentCouplingMass hL n x C z (fun i => w i))] simp_rw [componentCouplingMass_column_sum hL hhL] exact (nullMass_component_factorization hL n x w).symm
CausalSmith.Stat.PrivateCateRoughdesign.jointMarkMass_column_sum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentJointLaw.lean:105
theorem fullAlternativeMass_sum Lemma fullAlternativeMass_sum in the paper ↗

The full conditional alternative array sums to one. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
n :
ℕ
x :
(∑ z, fullAlternativeMass hL n x z) = 1
Proof (Lean source)
CausalSmith.Stat.PrivateCateRoughdesign.fullAlternativeMass_sum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentJointLaw.lean:116

The finite joint product array has unit total mass. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
x :
(∑ zw : (Fin n → Bool × Bool) × (Fin n → Bool × Bool), jointMarkMass hL n x zw.1 zw.2) = 1
Proof (Lean source)
-- @node: jointMarkMass_sum lemma jointMarkMass_sum (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (x : Fin n → Covariate) : (∑ zw : (Fin n → Bool × Bool) × (Fin n → Bool × Bool), jointMarkMass hL n x zw.1 zw.2) = 1 := by rw [Fintype.sum_prod_type] simp_rw [jointMarkMass_row_sum hL hhL] exact fullAlternativeMass_sum hL n x

The conditional alternative dataset law attaches fixed covariates to the mixed marks.

Definition (Lean source)
hL :
ℝ
n :
ℕ
x :
conditionalAlternativeDatasetLaw hL n x :
∑ z : Fin n → Bool × Bool, ofReal (fullAlternativeMass hL n x z) • Measure.dirac (attachMarks n x z)
CausalSmith.Stat.PrivateCateRoughdesign.conditionalAlternativeDatasetLaw · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentJointLaw.lean:134

The conditional null dataset law attaches fixed covariates to independent fair marks.

Definition (Lean source)
n :
ℕ
x :
conditionalNullDatasetLaw n x :
∑ z : Fin n → Bool × Bool, ofReal ((4 : ℝ)^(-(n : ℤ))) • Measure.dirac (attachMarks n x z)
CausalSmith.Stat.PrivateCateRoughdesign.conditionalNullDatasetLaw · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentJointLaw.lean:141
theorem conditionalDatasetCoupling_map_fst

The conditional product coupling has the exact mixed dataset law as first marginal. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
x :
Proof (Lean source)
-- @node: conditionalDatasetCoupling_map_fst lemma conditionalDatasetCoupling_map_fst (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (x : Fin n → Covariate) : (conditionalDatasetCoupling hL n x).map fst = conditionalAlternativeDatasetLaw hL n x := by classical have hr (z : Fin n → Bool × Bool) : (∑ w, ofReal (jointMarkMass hL n x z w)) = ofReal (fullAlternativeMass hL n x z) := by rw [← ENNReal.ofReal_sum_of_nonneg (fun w _ => jointMarkMass_nonneg hL hhL n x z w), jointMarkMass_row_sum hL hhL] ext S hS rw [Measure.map_apply measurable_fst hS] simp only [conditionalDatasetCoupling, conditionalAlternativeDatasetLaw, Measure.finsetSum_apply, Measure.smul_apply, smul_eq_mul, Measure.dirac_apply, Fintype.sum_prod_type] apply Finset.sum_congr rfl intro z _ change (∑ w, ofReal (jointMarkMass hL n x z w) * S.indicator 1 (attachMarks n x z)) = _ rw [← Finset.sum_mul, hr]
CausalSmith.Stat.PrivateCateRoughdesign.conditionalDatasetCoupling_map_fst · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentJointLaw.lean:147
theorem conditionalDatasetCoupling_map_snd

The conditional product coupling has the exact fair dataset law as second marginal. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
x :
Proof (Lean source)
-- @node: conditionalDatasetCoupling_map_snd lemma conditionalDatasetCoupling_map_snd (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (x : Fin n → Covariate) : (conditionalDatasetCoupling hL n x).map snd = conditionalNullDatasetLaw n x := by classical have hc (w : Fin n → Bool × Bool) : (∑ z, ofReal (jointMarkMass hL n x z w)) = ofReal ((4 : ℝ)^(-(n : ℤ))) := by rw [← ENNReal.ofReal_sum_of_nonneg (fun z _ => jointMarkMass_nonneg hL hhL n x z w), jointMarkMass_column_sum hL hhL] ext S hS rw [Measure.map_apply measurable_snd hS] simp only [conditionalDatasetCoupling, conditionalNullDatasetLaw, Measure.finsetSum_apply, Measure.smul_apply, smul_eq_mul, Measure.dirac_apply, Fintype.sum_prod_type] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro w _ change (∑ z, ofReal (jointMarkMass hL n x z w) * S.indicator 1 (attachMarks n x w)) = _ rw [← Finset.sum_mul, hc]
CausalSmith.Stat.PrivateCateRoughdesign.conditionalDatasetCoupling_map_snd · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentJointLaw.lean:170
theorem conditionalDatasetCoupling_isProbabilityMeasure Lemma conditionalDatasetCoupling_isProbabilityMeasure in the paper ↗

The conditional product coupling is a probability measure at every covariate vector. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
x :
Proof (Lean source)
-- @node: conditionalDatasetCoupling_isProbabilityMeasure lemma conditionalDatasetCoupling_isProbabilityMeasure (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (x : Fin n → Covariate) : IsProbabilityMeasure (conditionalDatasetCoupling hL n x) := by constructor simp only [conditionalDatasetCoupling, Measure.finsetSum_apply, Measure.smul_apply, Measure.dirac_apply_of_mem (Set.mem_univ _), smul_eq_mul, mul_one] rw [← ENNReal.ofReal_sum_of_nonneg (fun zw _ => jointMarkMass_nonneg hL hhL n x zw.1 zw.2), jointMarkMass_sum hL hhL] exact ENNReal.ofReal_one
CausalSmith.Stat.PrivateCateRoughdesign.conditionalDatasetCoupling_isProbabilityMeasure · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentJointLaw.lean:193
theorem conditionalDatasetCoupling_isCoupling

The explicit Borel conditional product couples the two full conditional dataset laws. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
x :
Proof (Lean source)
-- @node: conditionalDatasetCoupling_isCoupling lemma conditionalDatasetCoupling_isCoupling (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (x : Fin n → Covariate) : IsCoupling (conditionalDatasetCoupling hL n x) (conditionalAlternativeDatasetLaw hL n x) (conditionalNullDatasetLaw n x) := by exact ⟨conditionalDatasetCoupling_isProbabilityMeasure hL hhL n x, conditionalDatasetCoupling_map_fst hL hhL n x, conditionalDatasetCoupling_map_snd hL hhL n x⟩
CausalSmith.Stat.PrivateCateRoughdesign.conditionalDatasetCoupling_isCoupling · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentJointLaw.lean:205
theorem commonMassCoupling_isProbabilityMeasure

Integrating the pointwise conditional coupling preserves unit total mass. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
Proof (Lean source)
-- @node: commonMassCoupling_isProbabilityMeasure lemma commonMassCoupling_isProbabilityMeasure (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) : IsProbabilityMeasure (commonMassCoupling hL n) := by constructor rw [commonMassCoupling, Measure.bind_apply MeasurableSet.univ (measurable_conditionalDatasetCoupling hL n).aemeasurable] have hp (x : Fin n → Covariate) : conditionalDatasetCoupling hL n x univ = 1 := by let := conditionalDatasetCoupling_isProbabilityMeasure hL hhL n x exact measure_univ simp only [hp, lintegral_const, one_mul, measure_univ]
CausalSmith.Stat.PrivateCateRoughdesign.commonMassCoupling_isProbabilityMeasure · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentJointLaw.lean:215
theorem measurable_conditionalAlternativeDatasetLaw

The conditional alternative dataset law is Borel in the covariates. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
n :
ℕ
Proof (Lean source)
-- @node: measurable_conditionalAlternativeDatasetLaw @[fun_prop] lemma measurable_conditionalAlternativeDatasetLaw (hL : ℝ) (n : ℕ) : Measurable (conditionalAlternativeDatasetLaw hL n) := by apply Measure.measurable_of_measurable_coe intro E hE simp only [conditionalAlternativeDatasetLaw, Measure.finsetSum_apply, Measure.smul_apply, smul_eq_mul] apply Finset.measurable_sum intro z _ apply mul ((measurable_fullAlternativeMass hL n z).ennreal_ofReal) simp only [Measure.dirac_apply' _ hE] exact measurable_const.indicator (hE.preimage (measurable_attachMarks n z))
CausalSmith.Stat.PrivateCateRoughdesign.measurable_conditionalAlternativeDatasetLaw · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentJointLaw.lean:227
theorem measurable_conditionalNullDatasetLaw

The conditional null dataset law is Borel in the covariates. The displayed conclusion follows.

Formal statement
n :
ℕ
Proof (Lean source)
-- @node: measurable_conditionalNullDatasetLaw @[fun_prop] lemma measurable_conditionalNullDatasetLaw (n : ℕ) : Measurable (conditionalNullDatasetLaw n) := by apply Measure.measurable_of_measurable_coe intro E hE simp only [conditionalNullDatasetLaw, Measure.finsetSum_apply, Measure.smul_apply, smul_eq_mul] apply Finset.measurable_sum intro z _ apply mul measurable_const simp only [Measure.dirac_apply' _ hE] exact measurable_const.indicator (hE.preimage (measurable_attachMarks n z))
CausalSmith.Stat.PrivateCateRoughdesign.measurable_conditionalNullDatasetLaw · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentJointLaw.lean:241
theorem commonMassCoupling_map_fst_bind

Integrating the conditional coupling recovers the integrated alternative marginal. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
= (Measure.pi (fun _ : Fin n => (volume : Measure Covariate))).bind (conditionalAlternativeDatasetLaw hL n)
Proof (Lean source)
-- @node: commonMassCoupling_map_fst_bind lemma commonMassCoupling_map_fst_bind (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) : (commonMassCoupling hL n).map fst = (Measure.pi (fun _ : Fin n => (volume : Measure Covariate))).bind (conditionalAlternativeDatasetLaw hL n) := by ext E hE rw [Measure.map_apply measurable_fst hE, commonMassCoupling, Measure.bind_apply (hE.preimage measurable_fst) (measurable_conditionalDatasetCoupling hL n).aemeasurable, Measure.bind_apply hE (measurable_conditionalAlternativeDatasetLaw hL n).aemeasurable] apply lintegral_congr intro x rw [← conditionalDatasetCoupling_map_fst hL hhL n x, Measure.map_apply measurable_fst hE]
CausalSmith.Stat.PrivateCateRoughdesign.commonMassCoupling_map_fst_bind · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentJointLaw.lean:255
theorem commonMassCoupling_map_snd_bind

Integrating the conditional coupling recovers the integrated null marginal. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
= (Measure.pi (fun _ : Fin n => (volume : Measure Covariate))).bind (conditionalNullDatasetLaw n)
Proof (Lean source)
-- @node: commonMassCoupling_map_snd_bind lemma commonMassCoupling_map_snd_bind (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) : (commonMassCoupling hL n).map snd = (Measure.pi (fun _ : Fin n => (volume : Measure Covariate))).bind (conditionalNullDatasetLaw n) := by ext E hE rw [Measure.map_apply measurable_snd hE, commonMassCoupling, Measure.bind_apply (hE.preimage measurable_snd) (measurable_conditionalDatasetCoupling hL n).aemeasurable, Measure.bind_apply hE (measurable_conditionalNullDatasetLaw n).aemeasurable] apply lintegral_congr intro x rw [← conditionalDatasetCoupling_map_snd hL hhL n x, Measure.map_apply measurable_snd hE]
CausalSmith.Stat.PrivateCateRoughdesign.commonMassCoupling_map_snd_bind · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentJointLaw.lean:272
theorem commonMassCoupling_isCoupling_bind

The Borel product construction couples the integrated conditional dataset laws. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
IsCoupling (commonMassCoupling hL n) ((Measure.pi (fun _ : Fin n => (volume : Measure Covariate))).bind (conditionalAlternativeDatasetLaw hL n)) ((Measure.pi (fun _ : Fin n => (volume : Measure Covariate))).bind (conditionalNullDatasetLaw n))
Proof (Lean source)
-- @node: commonMassCoupling_isCoupling_bind lemma commonMassCoupling_isCoupling_bind (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) : IsCoupling (commonMassCoupling hL n) ((Measure.pi (fun _ : Fin n => (volume : Measure Covariate))).bind (conditionalAlternativeDatasetLaw hL n)) ((Measure.pi (fun _ : Fin n => (volume : Measure Covariate))).bind (conditionalNullDatasetLaw n)) := by exact ⟨commonMassCoupling_isProbabilityMeasure hL hhL n, commonMassCoupling_map_fst_bind hL hhL n, commonMassCoupling_map_snd_bind hL hhL n⟩
CausalSmith.Stat.PrivateCateRoughdesign.commonMassCoupling_isCoupling_bind · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentJointLaw.lean:289
theorem finite_atomic_array_real Lemma finite_atomic_array_real in the paper ↗

A nonnegative finite atomic array evaluates an event by summing its selected entries. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
α :
a :
α → ℝ
ha :
∀ z, 0 ≤ a z
E :
Set α
hE :
(∑ z, ofReal (a z) • Measure.dirac z).real E = ∑ z, if z ∈ E then a z else 0
Proof (Lean source)
-- @node: finite_atomic_array_real lemma finite_atomic_array_real {α : Type*} [Fintype α] [MeasurableSpace α] (a : α → ℝ) (ha : ∀ z, 0 ≤ a z) (E : Set α) (hE : MeasurableSet E) : (∑ z, ofReal (a z) • Measure.dirac z).real E = ∑ z, if z ∈ E then a z else 0 := by classical have hn (z : α) : 0 ≤ if z ∈ E then a z else 0 := by split_ifs <;> first | exact ha z | exact le_rfl have he (z : α) : ofReal (a z) * E.indicator 1 z = ofReal (if z ∈ E then a z else 0) := by by_cases hz : z ∈ E <;> simp [hz] simp only [measureReal_def, Measure.finsetSum_apply, Measure.smul_apply, Measure.dirac_apply' _ hE, smul_eq_mul, he] rw [← ENNReal.ofReal_sum_of_nonneg (fun z _ => hn z), ENNReal.toReal_ofReal (Finset.sum_nonneg (fun z _ => hn z))]
CausalSmith.Stat.PrivateCateRoughdesign.finite_atomic_array_real · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentJointLaw.lean:302
theorem finite_array_event_gap_le_overlap_deficit Lemma finite_array_event_gap_le_overlap_deficit in the paper ↗

Event gaps of two probability arrays are bounded by their mass outside the common part. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
α :
Type*
a b :
α → ℝ
hsa :
∑ z, a z = 1
hsb :
∑ z, b z = 1
E :
Set α
|(∑ z, if z ∈ E then a z else 0) - (∑ z, if z ∈ E then b z else 0)|
≤ 1 - ∑ z, min (a z) (b z)
Proof (Lean source)
-- @node: finite_array_event_gap_le_overlap_deficit lemma finite_array_event_gap_le_overlap_deficit {α : Type*} [Fintype α] (a b : α → ℝ) (hsa : ∑ z, a z = 1) (hsb : ∑ z, b z = 1) (E : Set α) : |(∑ z, if z ∈ E then a z else 0) - (∑ z, if z ∈ E then b z else 0)| ≤ 1 - ∑ z, min (a z) (b z) := by classical let c (z : α) := min (a z) (b z) have bounds (f : α → ℝ) (hf : ∀ z, 0 ≤ f z) : 0 ≤ (∑ z, if z ∈ E then f z else 0) ∧ (∑ z, if z ∈ E then f z else 0) ≤ ∑ z, f z := by constructor · apply Finset.sum_nonneg; intro z _; split_ifs <;> first | exact hf z | exact le_rfl · apply Finset.sum_le_sum; intro z _; split_ifs <;> first | exact le_rfl | exact hf z have har := bounds (fun z => a z-c z) (fun z => sub_nonneg.mpr (min_le_left _ _)) have hbr := bounds (fun z => b z-c z) (fun z => sub_nonneg.mpr (min_le_right _ _)) rw [Finset.sum_sub_distrib, hsa] at har rw [Finset.sum_sub_distrib, hsb] at hbr have split_sum (f : α → ℝ) : (∑ z, if z ∈ E then f z else 0) = (∑ z, if z ∈ E then f z-c z else 0) + (∑ z, if z ∈ E then c z else 0) := by rw [← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro z _ split_ifs <;> ring rw [split_sum a, split_sum b, abs_le] change -(1 - ∑ z, c z) ≤ _ ∧ _ ≤ 1 - ∑ z, c z constructor <;> linarith [har.1, har.2, hbr.1, hbr.2]
CausalSmith.Stat.PrivateCateRoughdesign.finite_array_event_gap_le_overlap_deficit · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentJointLaw.lean:320
theorem component_TV_le_overlap_deficit Lemma component_TV_le_overlap_deficit in the paper ↗

The TV of the finite component laws is bounded by the explicit coupling's failure mass. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
x :
C :
TV (alternativeComponentLaw hL n x C) (nullComponentLaw n C) ≤ 1-overlapMass hL n x C
Proof (Lean source)
-- @node: component_TV_le_overlap_deficit lemma component_TV_le_overlap_deficit (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (x : Fin n → Covariate) (C : Finset (Fin n)) : TV (alternativeComponentLaw hL n x C) (nullComponentLaw n C) ≤ 1-overlapMass hL n x C := by classical unfold TV tvDist apply ciSup_le intro E rw [alternativeComponentLaw, nullComponentLaw, finite_atomic_array_real _ (alternativeMass_nonneg hL hhL n x C) E.1 E.2, finite_atomic_array_real _ (fun z => (nullMass_pos n C z).le) E.1 E.2] exact finite_array_event_gap_le_overlap_deficit _ _ (alternativeMass_sum hL n x C) (nullMass_sum n C) E.1
CausalSmith.Stat.PrivateCateRoughdesign.component_TV_le_overlap_deficit · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentJointLaw.lean:350
theorem component_TV_le_quadratic Lemma component_TV_le_quadratic in the paper ↗

The curvature certificate gives the uniform four-times-separation component TV bound. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
x :
C :
≤ 4*separation hL*(componentSize n C : ℝ)^2
Proof (Lean source)
-- @node: component_TV_le_quadratic lemma component_TV_le_quadratic (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (x : Fin n → Covariate) (C : Finset (Fin n)) : TV (alternativeComponentLaw hL n x C) (nullComponentLaw n C) ≤ 4*separation hL*(componentSize n C : ℝ)^2 := by exact (component_TV_le_overlap_deficit hL hhL n x C).trans (overlapMass_deficit_le hL hhL n x C)
CausalSmith.Stat.PrivateCateRoughdesign.component_TV_le_quadratic · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentJointLaw.lean:366
theorem finite_array_positive_event_gap Lemma finite_array_positive_event_gap in the paper ↗

Selecting entries where the first array is larger attains its overlap deficit. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
α :
Type*
a b :
α → ℝ
hsa :
∑ z, a z = 1
(∑ z, if b z ≤ a z then a z else 0) - (∑ z, if b z ≤ a z then b z else 0)
= 1 - ∑ z, min (a z) (b z)
Proof (Lean source)
-- @node: finite_array_positive_event_gap lemma finite_array_positive_event_gap {α : Type*} [Fintype α] (a b : α → ℝ) (hsa : ∑ z, a z = 1) : (∑ z, if b z ≤ a z then a z else 0) - (∑ z, if b z ≤ a z then b z else 0) = 1 - ∑ z, min (a z) (b z) := by classical rw [← Finset.sum_sub_distrib, ← hsa, ← Finset.sum_sub_distrib] apply Finset.sum_congr rfl intro z _ by_cases h : b z ≤ a z · rw [if_pos h, if_pos h, min_eq_right h] · rw [if_neg h, if_neg h, min_eq_left (le_of_not_ge h)] ring
CausalSmith.Stat.PrivateCateRoughdesign.finite_array_positive_event_gap · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentJointLaw.lean:375
theorem alternativeComponentLaw_isProbabilityMeasure Lemma alternativeComponentLaw_isProbabilityMeasure in the paper ↗

Each nonnegative alternative component array defines a probability measure. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
x :
C :
Proof (Lean source)
-- @node: alternativeComponentLaw_isProbabilityMeasure lemma alternativeComponentLaw_isProbabilityMeasure (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (x : Fin n → Covariate) (C : Finset (Fin n)) : IsProbabilityMeasure (alternativeComponentLaw hL n x C) := by constructor simp only [alternativeComponentLaw, Measure.finsetSum_apply, Measure.smul_apply, Measure.dirac_apply_of_mem (Set.mem_univ _), smul_eq_mul, mul_one] rw [← ENNReal.ofReal_sum_of_nonneg (fun z _ => alternativeMass_nonneg hL hhL n x C z), alternativeMass_sum] exact ENNReal.ofReal_one
CausalSmith.Stat.PrivateCateRoughdesign.alternativeComponentLaw_isProbabilityMeasure · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentJointLaw.lean:391
theorem component_TV_eq_overlap_deficit Lemma component_TV_eq_overlap_deficit in the paper ↗

The explicit finite common part gives the exact total variation of component laws. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
x :
C :
Proof (Lean source)
-- @node: component_TV_eq_overlap_deficit lemma component_TV_eq_overlap_deficit (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (x : Fin n → Covariate) (C : Finset (Fin n)) : TV (alternativeComponentLaw hL n x C) (nullComponentLaw n C) = 1-overlapMass hL n x C := by classical apply le_antisymm (component_TV_le_overlap_deficit hL hhL n x C) let E : Set (Marks C) := {z | nullMass n C z ≤ alternativeMass hL n x C z} have hE : MeasurableSet E := Set.to_countable E |>.measurableSet let := alternativeComponentLaw_isProbabilityMeasure hL hhL n x C let := nullComponentLaw_isProbabilityMeasure n C have h := abs_measureReal_sub_le_tvDist (μ := alternativeComponentLaw hL n x C) (ν := nullComponentLaw n C) hE rw [alternativeComponentLaw, nullComponentLaw, finite_atomic_array_real _ (alternativeMass_nonneg hL hhL n x C) E hE, finite_atomic_array_real _ (fun z => (nullMass_pos n C z).le) E hE] at h change |(∑ z, if nullMass n C z ≤ alternativeMass hL n x C z then alternativeMass hL n x C z else 0) - (∑ z, if nullMass n C z ≤ alternativeMass hL n x C z then nullMass n C z else 0)| ≤ _ at h rw [finite_array_positive_event_gap _ _ (alternativeMass_sum hL n x C)] at h change |1-overlapMass hL n x C| ≤ TV (alternativeComponentLaw hL n x C) (nullComponentLaw n C) at h rw [abs_of_nonneg (sub_nonneg.mpr (overlapMass_range hL hhL n x C).2)] at h exact h
CausalSmith.Stat.PrivateCateRoughdesign.component_TV_eq_overlap_deficit · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentJointLaw.lean:403
theorem componentCoupling_disagreement_eq_TV Lemma componentCoupling_disagreement_eq_TV in the paper ↗

The common-mass component coupling fails with probability exactly its marginal TV. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
x :
C :
componentCoupling hL n x C {zw | zw.1 ≠ zw.2}
Proof (Lean source)
-- @node: componentCoupling_disagreement_eq_TV lemma componentCoupling_disagreement_eq_TV (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (x : Fin n → Covariate) (C : Finset (Fin n)) : componentCoupling hL n x C {zw | zw.1 ≠ zw.2} = ofReal (TV (alternativeComponentLaw hL n x C) (nullComponentLaw n C)) := by rw [component_TV_eq_overlap_deficit hL hhL, componentCoupling_disagreement_mass hL hhL]
CausalSmith.Stat.PrivateCateRoughdesign.componentCoupling_disagreement_eq_TV · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentJointLaw.lean:429
theorem component_TV_eq_half_abs_sum Lemma component_TV_eq_half_abs_sum in the paper ↗

Component total variation is half the absolute difference of its finite arrays. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
x :
C :
= 1/2 * ∑ z : Marks C, |alternativeMass hL n x C z-nullMass n C z|
Proof (Lean source)
-- @node: component_TV_eq_half_abs_sum lemma component_TV_eq_half_abs_sum (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (x : Fin n → Covariate) (C : Finset (Fin n)) : TV (alternativeComponentLaw hL n x C) (nullComponentLaw n C) = 1/2 * ∑ z : Marks C, |alternativeMass hL n x C z-nullMass n C z| := by rw [component_TV_eq_overlap_deficit hL hhL, componentMass_abs_sum] ring
CausalSmith.Stat.PrivateCateRoughdesign.component_TV_eq_half_abs_sum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentJointLaw.lean:438
theorem componentCoupling_hamming_cost_le_TV Lemma componentCoupling_hamming_cost_le_TV in the paper ↗

The explicit coupling changes at most the component size times its marginal TV. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
x :
C :
(∫⁻ zw, (hammingDist zw.1 zw.2 : ℝ≥0∞) ∂componentCoupling hL n x C)
≤ (C.card : ℝ≥0∞) * ofReal (TV (alternativeComponentLaw hL n x C) (nullComponentLaw n C))
Proof (Lean source)
-- @node: componentCoupling_hamming_cost_le_TV lemma componentCoupling_hamming_cost_le_TV (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (x : Fin n → Covariate) (C : Finset (Fin n)) : (∫⁻ zw, (hammingDist zw.1 zw.2 : ℝ≥0∞) ∂componentCoupling hL n x C) ≤ (C.card : ℝ≥0∞) * ofReal (TV (alternativeComponentLaw hL n x C) (nullComponentLaw n C)) := by rw [component_TV_eq_overlap_deficit hL hhL] exact componentCoupling_hamming_cost_le hL hhL n x C
CausalSmith.Stat.PrivateCateRoughdesign.componentCoupling_hamming_cost_le_TV · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentJointLaw.lean:447
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.ComponentMeasurability 16 declarations Borel regularity of finite common-mass arrays, fixed-component couplings and the full conditional dataset coupling, using finitely many labeled-graph strata.

Borel regularity of finite common-mass arrays, fixed-component couplings and the full conditional dataset coupling, using finitely many labeled-graph strata. These certificates include the overlap-one branch and require no radius restrictions.

theorem measurable_conditionalLikelihood_covariate Lemma measurable_conditionalLikelihood_covariate in the paper ↗

Fixing the two marks leaves a Borel conditional likelihood in the covariate. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
lam :
a y :
Measurable (fun x : Covariate => conditionalLikelihood hL lam x a y)
Proof (Lean source)
-- @node: measurable_conditionalLikelihood_covariate @[fun_prop] lemma measurable_conditionalLikelihood_covariate (lam : SignVector hL) (a y : Bool) : Measurable (fun x : Covariate => conditionalLikelihood hL lam x a y) := by cases a <;> cases y <;> simp only [conditionalLikelihood, bernoulliMass, Bool.false_eq_true, if_false, if_true] <;> fun_prop
CausalSmith.Stat.PrivateCateRoughdesign.measurable_conditionalLikelihood_covariate · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentMeasurability.lean:13
theorem measurable_alternativeMass Lemma measurable_alternativeMass in the paper ↗

Each fixed-component alternative mass is Borel in the full covariate vector. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
C :
z :
Measurable (fun x => alternativeMass hL n x C z)
Proof (Lean source)
-- @node: measurable_alternativeMass @[fun_prop] lemma measurable_alternativeMass (C : Finset (Fin n)) (z : Marks C) : Measurable (fun x => alternativeMass hL n x C z) := by unfold alternativeMass fun_prop
CausalSmith.Stat.PrivateCateRoughdesign.measurable_alternativeMass · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentMeasurability.lean:20

Taking the pointwise common part preserves Borel regularity. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
C :
z :
Measurable (fun x => commonMass hL n x C z)
Proof (Lean source)
-- @node: measurable_commonMass @[fun_prop] lemma measurable_commonMass (C : Finset (Fin n)) (z : Marks C) : Measurable (fun x => commonMass hL n x C z) := by unfold commonMass fun_prop

The finite sum of common masses is Borel in the covariates. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
C :
Measurable (fun x => overlapMass hL n x C)
Proof (Lean source)
-- @node: measurable_overlapMass @[fun_prop] lemma measurable_overlapMass (C : Finset (Fin n)) : Measurable (fun x => overlapMass hL n x C) := by unfold overlapMass fun_prop
theorem measurable_componentCouplingMass Lemma measurable_componentCouplingMass in the paper ↗

The explicit joint mass is Borel, including the branch where overlap is one. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
C :
z w :
Measurable (fun x => componentCouplingMass hL n x C z w)
Proof (Lean source)
-- @node: measurable_componentCouplingMass @[fun_prop] lemma measurable_componentCouplingMass (C : Finset (Fin n)) (z w : Marks C) : Measurable (fun x => componentCouplingMass hL n x C z w) := by classical dsimp only [componentCouplingMass] have hd : Measurable (fun x : Fin n → Covariate => if z = w then commonMass hL n x C z else 0) := by by_cases hzw : z = w <;> simp only [hzw, if_true, if_false] <;> fun_prop apply Measurable.ite (measurableSet_lt (measurable_overlapMass hL n C) measurable_const) _ hd exact hd.add (((measurable_alternativeMass hL n C z).sub (measurable_commonMass hL n C z)).mul (measurable_const.sub (measurable_commonMass hL n C w)) |>.div (measurable_const.sub (measurable_overlapMass hL n C)))
CausalSmith.Stat.PrivateCateRoughdesign.measurable_componentCouplingMass · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentMeasurability.lean:41
theorem measurable_fullAlternativeMass Lemma measurable_fullAlternativeMass in the paper ↗

The full sign-mixture conditional mass is Borel for each fixed dataset mark vector. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
z :
Fin n → Bool × Bool
Measurable (fun x => fullAlternativeMass hL n x z)
Proof (Lean source)
-- @node: measurable_fullAlternativeMass @[fun_prop] lemma measurable_fullAlternativeMass (z : Fin n → Bool × Bool) : Measurable (fun x => fullAlternativeMass hL n x z) := by unfold fullAlternativeMass fun_prop
CausalSmith.Stat.PrivateCateRoughdesign.measurable_fullAlternativeMass · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentMeasurability.lean:57

Attaching fixed marks to covariates is a Borel map into the dataset space. The displayed conclusion follows.

Formal statement
n :
ℕ
shared
z :
Fin n → Bool × Bool
Measurable (fun x => attachMarks n x z)
Proof (Lean source)
-- @node: measurable_attachMarks @[fun_prop] lemma measurable_attachMarks (z : Fin n → Bool × Bool) : Measurable (fun x => attachMarks n x z) := by unfold attachMarks fun_prop
theorem measurable_alternativeComponentLaw Lemma measurable_alternativeComponentLaw in the paper ↗

The alternative finite component measure varies measurably with the covariates. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
C :
Proof (Lean source)
CausalSmith.Stat.PrivateCateRoughdesign.measurable_alternativeComponentLaw · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentMeasurability.lean:71
theorem measurable_componentCoupling Lemma measurable_componentCoupling in the paper ↗

The common-mass coupling of a fixed component varies measurably with the covariates. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
C :
Measurable (fun x => componentCoupling hL n x C)
Proof (Lean source)
-- @node: measurable_componentCoupling @[fun_prop] lemma measurable_componentCoupling (C : Finset (Fin n)) : Measurable (fun x => componentCoupling hL n x C) := by unfold componentCoupling fun_prop
CausalSmith.Stat.PrivateCateRoughdesign.measurable_componentCoupling · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentMeasurability.lean:78
theorem measurableSet_sharedAdj Lemma measurableSet_sharedAdj in the paper ↗

Sharing an active sign is a Borel predicate, including all support boundaries. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
i l :
Fin n
MeasurableSet {x : Fin n → Covariate | sharedAdj hL n x i l}
Proof (Lean source)
-- @node: measurableSet_sharedAdj lemma measurableSet_sharedAdj (i l : Fin n) : MeasurableSet {x : Fin n → Covariate | sharedAdj hL n x i l} := by classical change MeasurableSet {x : Fin n → Covariate | i ≠ l ∧ ∃ j ∈ activeSigns hL, envelope hL (x i)*frame hL j (x i) ≠ 0 ∧ envelope hL (x l)*frame hL j (x l) ≠ 0} have hc : MeasurableSet {x : Fin n → Covariate | i ≠ l} := by by_cases h : i = l · convert MeasurableSet.empty (α := Fin n → Covariate) using 1; ext x; simp [h] · convert MeasurableSet.univ (α := Fin n → Covariate) using 1; ext x; simp [h] apply hc.inter change MeasurableSet {x : Fin n → Covariate | ∃ j ∈ activeSigns hL, envelope hL (x i)*frame hL j (x i) ≠ 0 ∧ envelope hL (x l)*frame hL j (x l) ≠ 0} rw [show {x : Fin n → Covariate | ∃ j ∈ activeSigns hL, envelope hL (x i)*frame hL j (x i) ≠ 0 ∧ envelope hL (x l)*frame hL j (x l) ≠ 0} = ⋃ j : (activeSigns hL), {x | envelope hL (x i)*frame hL j (x i) ≠ 0 ∧ envelope hL (x l)*frame hL j (x l) ≠ 0} by ext x constructor · rintro ⟨j, hj, hi, hl⟩ exact Set.mem_iUnion.mpr ⟨⟨j, hj⟩, hi, hl⟩ · intro hx obtain ⟨j, hi, hl⟩ := Set.mem_iUnion.mp hx exact ⟨j, j.property, hi, hl⟩] apply MeasurableSet.iUnion intro j apply MeasurableSet.inter <;> exact (measurableSet_eq_fun (by fun_prop) measurable_const).compl
theorem measurableSet_sharedGraph_eq Lemma measurableSet_sharedGraph_eq in the paper ↗

Each labeled graph occupies a Borel stratum of the covariate-vector space. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
G :
MeasurableSet {x : Fin n → Covariate | sharedGraph hL n x = G}
Proof (Lean source)
-- @node: measurableSet_sharedGraph_eq lemma measurableSet_sharedGraph_eq (G : SimpleGraph (Fin n)) : MeasurableSet {x : Fin n → Covariate | sharedGraph hL n x = G} := by have heq : {x : Fin n → Covariate | sharedGraph hL n x = G} = {x | ∀ i l, sharedAdj hL n x i l ↔ G.Adj i l} := by ext x constructor · intro h i l change (sharedGraph hL n x).Adj i l ↔ G.Adj i l rw [h] · intro h exact SimpleGraph.ext (funext fun i => funext fun l => propext (h i l)) rw [heq] rw [show {x : Fin n → Covariate | ∀ i l, sharedAdj hL n x i l ↔ G.Adj i l} = ⋂ i, ⋂ l, {x | sharedAdj hL n x i l ↔ G.Adj i l} by ext x; simp] apply MeasurableSet.iInter intro i apply MeasurableSet.iInter intro l by_cases h : G.Adj i l · simpa only [h, iff_true] using measurableSet_sharedAdj hL n i l · simp only [h, iff_false] convert (measurableSet_sharedAdj hL n i l).compl using 1 ext x rfl
CausalSmith.Stat.PrivateCateRoughdesign.measurableSet_sharedGraph_eq · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentMeasurability.lean:118

The deterministic ordered components of a fixed graph use increasing least vertices.

Definition (Lean source)
n :
ℕ
shared
G :
componentsOfGraph n G :
((Finset.univ.filter (fun i => ∀ l, G.Reachable i l → i ≤ l)).sort (· ≤ ·)).map (fun i => Finset.univ.filter (fun l => G.Reachable i l))
theorem orderedComponents_eq_of_sharedGraph_eq

Freezing the shared-sign graph also freezes its ordered vertex lists. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
G :
hx :
sharedGraph hL n x = G
Proof (Lean source)
CausalSmith.Stat.PrivateCateRoughdesign.orderedComponents_eq_of_sharedGraph_eq · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentMeasurability.lean:152
theorem measurable_fixedComponentProduct Lemma measurable_fixedComponentProduct in the paper ↗

A product over any fixed list of components is a Borel joint mark mass. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
Cs :
z w :
Fin n → Bool × Bool
Measurable (fun x => (Cs.map (fun C => componentCouplingMass hL n x C (fun i => z i) (fun i => w i))).prod)
Proof (Lean source)
-- @node: measurable_fixedComponentProduct lemma measurable_fixedComponentProduct (Cs : List (Finset (Fin n))) (z w : Fin n → Bool × Bool) : Measurable (fun x => (Cs.map (fun C => componentCouplingMass hL n x C (fun i => z i) (fun i => w i))).prod) := by induction Cs with | nil => simpa using (measurable_const : Measurable (fun _ : Fin n → Covariate => (1 : ℝ))) | cons C Cs ih => convert (measurable_componentCouplingMass hL n C (fun i => z i) (fun i => w i)).mul ih using 1 funext x simp only [List.map_cons, List.prod_cons, Pi.mul_apply]
CausalSmith.Stat.PrivateCateRoughdesign.measurable_fixedComponentProduct · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentMeasurability.lean:160
theorem measurable_jointMarkMass Lemma measurable_jointMarkMass in the paper ↗

The varying-graph joint array is Borel by its finite decomposition into graph strata. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
z w :
Fin n → Bool × Bool
Measurable (fun x => jointMarkMass hL n x z w)
Proof (Lean source)
-- @node: measurable_jointMarkMass @[fun_prop] lemma measurable_jointMarkMass (z w : Fin n → Bool × Bool) : Measurable (fun x => jointMarkMass hL n x z w) := by classical have hm : Measurable (fun x => ∑ G : SimpleGraph (Fin n), {x | sharedGraph hL n x = G}.indicator (fun x => ((componentsOfGraph n G).map (fun C => componentCouplingMass hL n x C (fun i => z i) (fun i => w i))).prod) x) := by apply Finset.measurable_sum intro G _ exact (measurable_fixedComponentProduct hL n (componentsOfGraph n G) z w).indicator (measurableSet_sharedGraph_eq hL n G) convert hm using 1 funext x simp only [indicator, Set.mem_ofPred_eq] rw [Finset.sum_ite_eq, if_pos (Finset.mem_univ _)] simp only [jointMarkMass, orderedComponents_eq_of_sharedGraph_eq hL n x (sharedGraph hL n x) rfl]
theorem measurable_conditionalDatasetCoupling Lemma measurable_conditionalDatasetCoupling in the paper ↗

The explicit conditional dataset coupling is Borel on every covariate vector. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
Proof (Lean source)
-- @node: measurable_conditionalDatasetCoupling @[fun_prop] lemma measurable_conditionalDatasetCoupling : Measurable (conditionalDatasetCoupling hL n) := by apply Measure.measurable_of_measurable_coe intro E hE simp only [conditionalDatasetCoupling, Measure.finsetSum_apply, Measure.smul_apply, smul_eq_mul] apply Finset.measurable_sum intro zw _ apply mul ((measurable_jointMarkMass hL n zw.1 zw.2).ennreal_ofReal) simp only [Measure.dirac_apply' _ hE] exact measurable_const.indicator (hE.preimage ((measurable_attachMarks n zw.1).prodMk (measurable_attachMarks n zw.2)))
CausalSmith.Stat.PrivateCateRoughdesign.measurable_conditionalDatasetCoupling · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentMeasurability.lean:194
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.ComponentPartition 18 declarations The ordered shared-sign components partition the dataset indices.

The ordered shared-sign components partition the dataset indices. Distinct components use disjoint active sign coordinates. Conditional likelihoods depend only on those coordinates.

Component membership is exactly reachability in the shared-sign graph. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
i l :
Fin n
l ∈ componentVertices hL n x i ↔ (sharedGraph hL n x).Reachable i l
Proof (Lean source)
-- @node: mem_componentVertices lemma mem_componentVertices (x : Fin n → Covariate) (i l : Fin n) : l ∈ componentVertices hL n x i ↔ (sharedGraph hL n x).Reachable i l := by classical simp [componentVertices]
theorem self_mem_componentVertices Lemma self_mem_componentVertices in the paper ↗

Every vertex belongs to its own component. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
i :
Fin n
i ∈ componentVertices hL n x i
Proof (Lean source)
-- @node: self_mem_componentVertices lemma self_mem_componentVertices (x : Fin n → Covariate) (i : Fin n) : i ∈ componentVertices hL n x i := (mem_componentVertices hL n x i i).mpr .rfl
CausalSmith.Stat.PrivateCateRoughdesign.self_mem_componentVertices · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentPartition.lean:17
theorem componentVertices_eq_of_reachable Lemma componentVertices_eq_of_reachable in the paper ↗

Reachable vertices select the same component. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
i l :
Fin n
hil :
(sharedGraph hL n x).Reachable i l
Proof (Lean source)
-- @node: componentVertices_eq_of_reachable lemma componentVertices_eq_of_reachable (x : Fin n → Covariate) (i l : Fin n) (hil : (sharedGraph hL n x).Reachable i l) : componentVertices hL n x i = componentVertices hL n x l := by ext v rw [mem_componentVertices, mem_componentVertices] exact ⟨fun hiv => hil.symm.trans hiv, fun hlv => hil.trans hlv⟩
CausalSmith.Stat.PrivateCateRoughdesign.componentVertices_eq_of_reachable · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentPartition.lean:23
theorem componentVertices_disjoint_of_not_reachable Lemma componentVertices_disjoint_of_not_reachable in the paper ↗

Two components either coincide or are disjoint. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
i l :
Fin n
hil :
¬(sharedGraph hL n x).Reachable i l
Proof (Lean source)
-- @node: componentVertices_disjoint_of_not_reachable lemma componentVertices_disjoint_of_not_reachable (x : Fin n → Covariate) (i l : Fin n) (hil : ¬(sharedGraph hL n x).Reachable i l) : Disjoint (componentVertices hL n x i) (componentVertices hL n x l) := by classical apply Finset.disjoint_left.mpr intro v hiv hlv exact hil (((mem_componentVertices hL n x i v).mp hiv).trans ((mem_componentVertices hL n x l v).mp hlv).symm)
CausalSmith.Stat.PrivateCateRoughdesign.componentVertices_disjoint_of_not_reachable · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentPartition.lean:32

Component roots are precisely the least vertices of their reachable classes. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
i :
Fin n
i ∈ componentRoots hL n x ↔ ∀ l, (sharedGraph hL n x).Reachable i l → i ≤ l
Proof (Lean source)
-- @node: mem_componentRoots lemma mem_componentRoots (x : Fin n → Covariate) (i : Fin n) : i ∈ componentRoots hL n x ↔ ∀ l, (sharedGraph hL n x).Reachable i l → i ≤ l := by classical simp [componentRoots]

Every vertex has a component root in its reachable class. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
i :
Fin n
∃ r ∈ componentRoots hL n x, i ∈ componentVertices hL n x r
Proof (Lean source)
-- @node: exists_componentRoot lemma exists_componentRoot (x : Fin n → Covariate) (i : Fin n) : ∃ r ∈ componentRoots hL n x, i ∈ componentVertices hL n x r := by classical let C := componentVertices hL n x i have hC : C.Nonempty := ⟨i, self_mem_componentVertices hL n x i⟩ let r := C.min' hC have hir : (sharedGraph hL n x).Reachable i r := (mem_componentVertices hL n x i r).mp (C.min'_mem hC) refine ⟨r, (mem_componentRoots hL n x r).mpr ?_, (mem_componentVertices hL n x r i).mpr hir.symm⟩ intro l hrl exact C.min'_le l ((mem_componentVertices hL n x i l).mpr (hir.trans hrl))
theorem componentRoots_eq_of_reachable Lemma componentRoots_eq_of_reachable in the paper ↗

A reachable class has at most one selected least vertex. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
i l :
Fin n
hi :
i ∈ componentRoots hL n x
hl :
l ∈ componentRoots hL n x
hil :
(sharedGraph hL n x).Reachable i l
i = l
Proof (Lean source)
-- @node: componentRoots_eq_of_reachable lemma componentRoots_eq_of_reachable (x : Fin n → Covariate) (i l : Fin n) (hi : i ∈ componentRoots hL n x) (hl : l ∈ componentRoots hL n x) (hil : (sharedGraph hL n x).Reachable i l) : i = l := by exact le_antisymm ((mem_componentRoots hL n x i).mp hi l hil) ((mem_componentRoots hL n x l).mp hl i hil.symm)
CausalSmith.Stat.PrivateCateRoughdesign.componentRoots_eq_of_reachable · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentPartition.lean:65
theorem componentRoots_pairwise_disjoint Lemma componentRoots_pairwise_disjoint in the paper ↗

Distinct selected roots have disjoint component vertex sets. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
i l :
Fin n
hi :
i ∈ componentRoots hL n x
hl :
l ∈ componentRoots hL n x
hne :
i ≠ l
Proof (Lean source)
-- @node: componentRoots_pairwise_disjoint lemma componentRoots_pairwise_disjoint (x : Fin n → Covariate) (i l : Fin n) (hi : i ∈ componentRoots hL n x) (hl : l ∈ componentRoots hL n x) (hne : i ≠ l) : Disjoint (componentVertices hL n x i) (componentVertices hL n x l) := by apply componentVertices_disjoint_of_not_reachable intro hil exact hne (componentRoots_eq_of_reachable hL n x i l hi hl hil)
CausalSmith.Stat.PrivateCateRoughdesign.componentRoots_pairwise_disjoint · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentPartition.lean:73

The ordered list contains exactly the components of selected roots. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
C :
C ∈ orderedComponents hL n x ↔ ∃ r ∈ componentRoots hL n x, componentVertices hL n x r = C
Proof (Lean source)
-- @node: mem_orderedComponents lemma mem_orderedComponents (x : Fin n → Covariate) (C : Finset (Fin n)) : C ∈ orderedComponents hL n x ↔ ∃ r ∈ componentRoots hL n x, componentVertices hL n x r = C := by classical simp [orderedComponents]
theorem orderedComponents_cover Lemma orderedComponents_cover in the paper ↗

The ordered components cover every dataset index. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
i :
Fin n
∃ C ∈ orderedComponents hL n x, i ∈ C
Proof (Lean source)
-- @node: orderedComponents_cover lemma orderedComponents_cover (x : Fin n → Covariate) (i : Fin n) : ∃ C ∈ orderedComponents hL n x, i ∈ C := by obtain ⟨r, hr, hi⟩ := exists_componentRoot hL n x i exact ⟨componentVertices hL n x r, (mem_orderedComponents hL n x _).mpr ⟨r, hr, rfl⟩, hi⟩
CausalSmith.Stat.PrivateCateRoughdesign.orderedComponents_cover · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentPartition.lean:90
theorem reachable_of_shared_activeSign Lemma reachable_of_shared_activeSign in the paper ↗

Sharing an active sign connects the two records, including the identical-record case. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
i l :
Fin n
j :
hi :
envelope hL (x i) * frame hL j (x i) ≠ 0
hl :
envelope hL (x l) * frame hL j (x l) ≠ 0
(sharedGraph hL n x).Reachable i l
Proof (Lean source)
-- @node: reachable_of_shared_activeSign lemma reachable_of_shared_activeSign (x : Fin n → Covariate) (i l : Fin n) (j : activeSigns hL) (hi : envelope hL (x i) * frame hL j (x i) ≠ 0) (hl : envelope hL (x l) * frame hL j (x l) ≠ 0) : (sharedGraph hL n x).Reachable i l := by by_cases heq : i = l · subst l exact .rfl · exact SimpleGraph.Adj.reachable (show (sharedGraph hL n x).Adj i l from ⟨heq, j, j.property, hi, hl⟩)
CausalSmith.Stat.PrivateCateRoughdesign.reachable_of_shared_activeSign · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentPartition.lean:98
theorem component_activeSigns_disjoint Lemma component_activeSigns_disjoint in the paper ↗

Distinct graph components cannot use the same active sign coordinate. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
r s i l :
Fin n
hrs :
¬(sharedGraph hL n x).Reachable r s
hi :
i ∈ componentVertices hL n x r
hl :
l ∈ componentVertices hL n x s
j :
hij :
envelope hL (x i) * frame hL j (x i) ≠ 0
envelope hL (x l) * frame hL j (x l) = 0
Proof (Lean source)
-- @node: component_activeSigns_disjoint lemma component_activeSigns_disjoint (x : Fin n → Covariate) (r s i l : Fin n) (hrs : ¬(sharedGraph hL n x).Reachable r s) (hi : i ∈ componentVertices hL n x r) (hl : l ∈ componentVertices hL n x s) (j : activeSigns hL) (hij : envelope hL (x i) * frame hL j (x i) ≠ 0) : envelope hL (x l) * frame hL j (x l) = 0 := by by_contra hlj exact hrs (((mem_componentVertices hL n x r i).mp hi).trans ((reachable_of_shared_activeSign hL n x i l j hij hlj).trans ((mem_componentVertices hL n x s l).mp hl).symm))
CausalSmith.Stat.PrivateCateRoughdesign.component_activeSigns_disjoint · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentPartition.lean:111
theorem perturbation_eq_of_activeSigns_agree Lemma perturbation_eq_of_activeSigns_agree in the paper ↗

The perturbation depends only on signs with a nonzero envelope-weighted frame. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
lam lam' :
x :
hagree :
∀ j : activeSigns hL
if
envelope hL x * frame hL j x ≠ 0
then
lam j = lam' j
perturbation hL lam x = perturbation hL lam' x
Proof (Lean source)
-- @node: perturbation_eq_of_activeSigns_agree lemma perturbation_eq_of_activeSigns_agree (lam lam' : SignVector hL) (x : Covariate) (hagree : ∀ j : activeSigns hL, envelope hL x * frame hL j x ≠ 0 → lam j = lam' j) : perturbation hL lam x = perturbation hL lam' x := by classical simp only [perturbation, Finset.mul_sum] apply Finset.sum_congr rfl intro j _ by_cases hj : envelope hL x * frame hL j x = 0 · calc _ = (2*bit (lam j)-1)*(envelope hL x * frame hL j x) := by ring _ = (2*bit (lam' j)-1)*(envelope hL x * frame hL j x) := by rw [hj]; ring _ = _ := by ring · rw [hagree j hj]
CausalSmith.Stat.PrivateCateRoughdesign.perturbation_eq_of_activeSigns_agree · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentPartition.lean:123
theorem conditionalLikelihood_eq_of_activeSigns_agree Lemma conditionalLikelihood_eq_of_activeSigns_agree in the paper ↗

The entire conditional likelihood, including its quadratic term, uses only active signs. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
lam lam' :
x :
a y :
hagree :
∀ j : activeSigns hL
if
envelope hL x * frame hL j x ≠ 0
then
lam j = lam' j
conditionalLikelihood hL lam x a y = conditionalLikelihood hL lam' x a y
Proof (Lean source)
-- @node: conditionalLikelihood_eq_of_activeSigns_agree lemma conditionalLikelihood_eq_of_activeSigns_agree (lam lam' : SignVector hL) (x : Covariate) (a y : Bool) (hagree : ∀ j : activeSigns hL, envelope hL x * frame hL j x ≠ 0 → lam j = lam' j) : conditionalLikelihood hL lam x a y = conditionalLikelihood hL lam' x a y := by simp only [conditionalLikelihood, altE, altMu0, altMu1, perturbation_eq_of_activeSigns_agree hL lam lam' x hagree]
CausalSmith.Stat.PrivateCateRoughdesign.conditionalLikelihood_eq_of_activeSigns_agree · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentPartition.lean:140
theorem orderedComponents_nonempty Lemma orderedComponents_nonempty in the paper ↗

Every component in the ordered list contains its selected root. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
C :
hC :
C ∈ orderedComponents hL n x
C.Nonempty
Proof (Lean source)
-- @node: orderedComponents_nonempty lemma orderedComponents_nonempty (x : Fin n → Covariate) (C : Finset (Fin n)) (hC : C ∈ orderedComponents hL n x) : C.Nonempty := by obtain ⟨r, _, rfl⟩ := (mem_orderedComponents hL n x C).mp hC exact ⟨r, self_mem_componentVertices hL n x r⟩
CausalSmith.Stat.PrivateCateRoughdesign.orderedComponents_nonempty · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentPartition.lean:150
theorem orderedComponents_disjoint Lemma orderedComponents_disjoint in the paper ↗

Distinct members of the ordered component list are disjoint. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
C D :
hC :
C ∈ orderedComponents hL n x
hD :
D ∈ orderedComponents hL n x
hne :
C ≠ D
Proof (Lean source)
-- @node: orderedComponents_disjoint lemma orderedComponents_disjoint (x : Fin n → Covariate) (C D : Finset (Fin n)) (hC : C ∈ orderedComponents hL n x) (hD : D ∈ orderedComponents hL n x) (hne : C ≠ D) : Disjoint C D := by obtain ⟨r, hr, rfl⟩ := (mem_orderedComponents hL n x C).mp hC obtain ⟨s, hs, rfl⟩ := (mem_orderedComponents hL n x D).mp hD apply componentRoots_pairwise_disjoint hL n x r s hr hs intro heq exact hne (congrArg (componentVertices hL n x) heq)
CausalSmith.Stat.PrivateCateRoughdesign.orderedComponents_disjoint · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentPartition.lean:157
theorem orderedComponents_nodup Lemma orderedComponents_nodup in the paper ↗

The deterministic component ordering never repeats a component. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
Proof (Lean source)
-- @node: orderedComponents_nodup lemma orderedComponents_nodup (x : Fin n → Covariate) : (orderedComponents hL n x).Nodup := by classical apply List.Nodup.map_on _ (Finset.sort_nodup _ _) intro r hr s hs heq have hr' : r ∈ componentRoots hL n x := (Finset.mem_sort _).mp hr have hs' : s ∈ componentRoots hL n x := (Finset.mem_sort _).mp hs apply componentRoots_eq_of_reachable hL n x r s hr' hs' apply (mem_componentVertices hL n x r s).mp rw [heq] exact self_mem_componentVertices hL n x s
CausalSmith.Stat.PrivateCateRoughdesign.orderedComponents_nodup · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentPartition.lean:168
theorem componentLikelihood_eq_of_activeSigns_agree Lemma componentLikelihood_eq_of_activeSigns_agree in the paper ↗

Agreement on a component's active signs preserves its entire conditional mark product. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
n :
ℕ
shared
x :
C :
z :
lam lam' :
hagree :
∀ i : C, ∀ j : activeSigns hL, envelope hL (x i) * frame hL j (x i) ≠ 0 → lam j = lam' j
(∏ i : C, conditionalLikelihood hL lam (x i) (z i).1 (z i).2 / 4)
= ∏ i : C, conditionalLikelihood hL lam' (x i) (z i).1 (z i).2 / 4
Proof (Lean source)
-- @node: componentLikelihood_eq_of_activeSigns_agree lemma componentLikelihood_eq_of_activeSigns_agree (x : Fin n → Covariate) (C : Finset (Fin n)) (z : Marks C) (lam lam' : SignVector hL) (hagree : ∀ i : C, ∀ j : activeSigns hL, envelope hL (x i) * frame hL j (x i) ≠ 0 → lam j = lam' j) : (∏ i : C, conditionalLikelihood hL lam (x i) (z i).1 (z i).2 / 4) = ∏ i : C, conditionalLikelihood hL lam' (x i) (z i).1 (z i).2 / 4 := by classical apply Finset.prod_congr rfl intro i _ rw [conditionalLikelihood_eq_of_activeSigns_agree hL lam lam' (x i) (z i).1 (z i).2 (hagree i)]
CausalSmith.Stat.PrivateCateRoughdesign.componentLikelihood_eq_of_activeSigns_agree · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentPartition.lean:182
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.ComponentProduct 22 declarations Finite tensor product differentiation and second-order integration for the component amplitude path, retaining the sharp finite-array absolute-mass bound.

Finite tensor product differentiation and second-order integration for the component amplitude path, retaining the sharp finite-array absolute-mass bound.

The first product-rule array for a finite collection of scalar paths.

Definition (Lean source)
ι :
p q :
ι → ℝ
finiteProductSlope p q :
ℝ
∑ i, (∏ j ∈ (Finset.univ : Finset ι).erase i, p j) * q i

The second product-rule array, including every ordered pair of distinct factors.

Definition (Lean source)
ι :
p q r :
ι → ℝ
finiteProductCurvature p q r :
ℝ
∑ i, ((∑ j ∈ (Finset.univ : Finset ι).erase i, (∏ k ∈ ((Finset.univ : Finset ι).erase i).erase j, p k) * q j) * q i + (∏ j ∈ (Finset.univ : Finset ι).erase i, p j) * r i)
CausalSmith.Stat.PrivateCateRoughdesign.finiteProductCurvature · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentProduct.lean:18
theorem finiteProductSlope_hasDerivAt

The first product-rule array differentiates to the second product-rule array. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
ι :
p q :
ι → ℝ → ℝ
r :
ι → ℝ
u :
ℝ
hp :
∀ i, HasDerivAt (p i) (q i u) u
hq :
∀ i, HasDerivAt (q i) (r i) u
HasDerivAt (fun v => finiteProductSlope (fun i => p i v) (fun i => q i v)) (finiteProductCurvature (fun i => p i u) (fun i => q i u) r) u
Proof (Lean source)
-- @node: finiteProductSlope_hasDerivAt lemma finiteProductSlope_hasDerivAt {ι : Type*} [Fintype ι] [DecidableEq ι] (p q : ι → ℝ → ℝ) (r : ι → ℝ) (u : ℝ) (hp : ∀ i, HasDerivAt (p i) (q i u) u) (hq : ∀ i, HasDerivAt (q i) (r i) u) : HasDerivAt (fun v => finiteProductSlope (fun i => p i v) (fun i => q i v)) (finiteProductCurvature (fun i => p i u) (fun i => q i u) r) u := by exact HasDerivAt.fun_sum (fun i _ => (HasDerivAt.fun_finsetProd (fun j _ => hp j)).mul (hq i))
CausalSmith.Stat.PrivateCateRoughdesign.finiteProductSlope_hasDerivAt · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentProduct.lean:26

The absolute mass of a tensor array factors as the product of its absolute masses. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
ι α :
p :
ι → α → ℝ
(∑ z : ι → α, |∏ i, p i (z i)|) = ∏ i, ∑ a, |p i a|
Proof (Lean source)
-- @node: finiteTensor_abs_sum lemma finiteTensor_abs_sum {ι α : Type*} [Fintype ι] [DecidableEq ι] [Fintype α] (p : ι → α → ℝ) : (∑ z : ι → α, |∏ i, p i (z i)|) = ∏ i, ∑ a, |p i a| := by simp_rw [Finset.abs_prod] exact (Fintype.prod_sum (fun i a => |p i a|)).symm
CausalSmith.Stat.PrivateCateRoughdesign.finiteTensor_abs_sum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentProduct.lean:37
theorem finiteTensor_replace_abs_sum Lemma finiteTensor_replace_abs_sum in the paper ↗

Replacing one tensor factor gives its absolute mass times those of the remaining factors. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
ι α :
p :
ι → α → ℝ
q :
α → ℝ
i :
ι
(∑ z : ι → α, |(∏ j ∈ (Finset.univ : Finset ι).erase i, p j (z j)) * q (z i)|)
= (∏ j ∈ (Finset.univ : Finset ι).erase i, ∑ a, |p j a|) * (∑ a, |q a|)
Proof (Lean source)
-- @node: finiteTensor_replace_abs_sum lemma finiteTensor_replace_abs_sum {ι α : Type*} [Fintype ι] [DecidableEq ι] [Fintype α] (p : ι → α → ℝ) (q : α → ℝ) (i : ι) : (∑ z : ι → α, |(∏ j ∈ (Finset.univ : Finset ι).erase i, p j (z j)) * q (z i)|) = (∏ j ∈ (Finset.univ : Finset ι).erase i, ∑ a, |p j a|) * (∑ a, |q a|) := by classical let f : ι → α → ℝ := update p i q have hprod (z : ι → α) : (∏ j, f j (z j)) = (∏ j ∈ (Finset.univ : Finset ι).erase i, p j (z j)) * q (z i) := by rw [← Finset.prod_erase_mul _ _ (Finset.mem_univ i)] congr 1 · apply Finset.prod_congr rfl intro j hj simp only [f, Function.update_of_ne (Finset.ne_of_mem_erase hj)] · simp [f] simp_rw [← hprod] rw [finiteTensor_abs_sum] rw [← Finset.prod_erase_mul _ _ (Finset.mem_univ i)] congr 1 · apply Finset.prod_congr rfl intro j hj simp only [f, Function.update_of_ne (Finset.ne_of_mem_erase hj)] · simp [f]
CausalSmith.Stat.PrivateCateRoughdesign.finiteTensor_replace_abs_sum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentProduct.lean:45
theorem finiteTensor_replace_abs_sum_unit Lemma finiteTensor_replace_abs_sum_unit in the paper ↗

Unit-mass factors make a one-factor replacement's absolute mass exactly that factor's mass. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
ι α :
p :
ι → α → ℝ
hp :
∀ i, (∑ a, |p i a|) = 1
q :
α → ℝ
i :
ι
(∑ z : ι → α, |(∏ j ∈ (Finset.univ : Finset ι).erase i, p j (z j)) * q (z i)|)
= ∑ a, |q a|
Proof (Lean source)
-- @node: finiteTensor_replace_abs_sum_unit lemma finiteTensor_replace_abs_sum_unit {ι α : Type*} [Fintype ι] [DecidableEq ι] [Fintype α] (p : ι → α → ℝ) (hp : ∀ i, (∑ a, |p i a|) = 1) (q : α → ℝ) (i : ι) : (∑ z : ι → α, |(∏ j ∈ (Finset.univ : Finset ι).erase i, p j (z j)) * q (z i)|) = ∑ a, |q a| := by rw [finiteTensor_replace_abs_sum] simp_rw [hp] simp
CausalSmith.Stat.PrivateCateRoughdesign.finiteTensor_replace_abs_sum_unit · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentProduct.lean:70
theorem finiteTensor_double_replace_abs_sum_unit Lemma finiteTensor_double_replace_abs_sum_unit in the paper ↗

Unit-mass factors make two distinct replacements' absolute mass the product of their masses. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
ι α :
p :
ι → α → ℝ
hp :
∀ i, (∑ a, |p i a|) = 1
q r :
α → ℝ
i j :
ι
hji :
j ≠ i
(∑ z : ι → α, |((∏ k ∈ ((Finset.univ : Finset ι).erase i).erase j, p k (z k)) * r (z j)) * q (z i)|)
= (∑ a, |r a|) * (∑ a, |q a|)
Proof (Lean source)
-- @node: finiteTensor_double_replace_abs_sum_unit lemma finiteTensor_double_replace_abs_sum_unit {ι α : Type*} [Fintype ι] [DecidableEq ι] [Fintype α] (p : ι → α → ℝ) (hp : ∀ i, (∑ a, |p i a|) = 1) (q r : α → ℝ) (i j : ι) (hji : j ≠ i) : (∑ z : ι → α, |((∏ k ∈ ((Finset.univ : Finset ι).erase i).erase j, p k (z k)) * r (z j)) * q (z i)|) = (∑ a, |r a|) * (∑ a, |q a|) := by classical let f : ι → α → ℝ := update p j r have hprod (z : ι → α) : (∏ k ∈ (Finset.univ : Finset ι).erase i, f k (z k)) = (∏ k ∈ ((Finset.univ : Finset ι).erase i).erase j, p k (z k)) * r (z j) := by rw [← Finset.prod_erase_mul _ _ (Finset.mem_erase.mpr ⟨hji, Finset.mem_univ j⟩)] congr 1 · apply Finset.prod_congr rfl intro k hk simp only [f, Function.update_of_ne (Finset.ne_of_mem_erase hk)] · simp [f] simp_rw [← hprod] rw [finiteTensor_replace_abs_sum] rw [← Finset.prod_erase_mul _ _ (Finset.mem_erase.mpr ⟨hji, Finset.mem_univ j⟩)] have hone : (∏ k ∈ ((Finset.univ : Finset ι).erase i).erase j, ∑ a, |f k a|) = 1 := by apply Finset.prod_eq_one intro k hk simp only [f, Function.update_of_ne (Finset.ne_of_mem_erase hk), hp] simp [hone, f]
CausalSmith.Stat.PrivateCateRoughdesign.finiteTensor_double_replace_abs_sum_unit · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentProduct.lean:80
theorem finiteProductCurvature_abs_sum_le

The second product derivative has quadratic absolute mass when individual derivatives have absolute masses at most four and the base factors have unit absolute mass. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
ι α :
p q r :
ι → α → ℝ
hp :
∀ i, (∑ a, |p i a|) = 1
hq :
∀ i, (∑ a, |q i a|) ≤ 4
hr :
∀ i, (∑ a, |r i a|) ≤ 4
(∑ z : ι → α, |finiteProductCurvature (fun i => p i (z i)) (fun i => q i (z i)) (fun i => r i (z i))|)
≤ 16 * (Fintype.card ι : ℝ)^2
Proof (Lean source)
-- @node: finiteProductCurvature_abs_sum_le lemma finiteProductCurvature_abs_sum_le {ι α : Type*} [Fintype ι] [DecidableEq ι] [Fintype α] (p q r : ι → α → ℝ) (hp : ∀ i, (∑ a, |p i a|) = 1) (hq : ∀ i, (∑ a, |q i a|) ≤ 4) (hr : ∀ i, (∑ a, |r i a|) ≤ 4) : (∑ z : ι → α, |finiteProductCurvature (fun i => p i (z i)) (fun i => q i (z i)) (fun i => r i (z i))|) ≤ 16 * (Fintype.card ι : ℝ)^2 := by classical have hpoint (z : ι → α) : |finiteProductCurvature (fun i => p i (z i)) (fun i => q i (z i)) (fun i => r i (z i))| ≤ ∑ i, ((∑ j ∈ (Finset.univ : Finset ι).erase i, |((∏ k ∈ ((Finset.univ : Finset ι).erase i).erase j, p k (z k)) * q j (z j)) * q i (z i)|) + |(∏ j ∈ (Finset.univ : Finset ι).erase i, p j (z j)) * r i (z i)|) := by dsimp [finiteProductCurvature] simp_rw [Finset.sum_mul] apply (Finset.abs_sum_le_sum_abs _ _).trans apply Finset.sum_le_sum intro i _ exact (abs_add_le _ _).trans (add_le_add (Finset.abs_sum_le_sum_abs _ _) le_rfl) have hi (i : ι) : (∑ z : ι → α, ((∑ j ∈ (Finset.univ : Finset ι).erase i, |((∏ k ∈ ((Finset.univ : Finset ι).erase i).erase j, p k (z k)) * q j (z j)) * q i (z i)|) + |(∏ j ∈ (Finset.univ : Finset ι).erase i, p j (z j)) * r i (z i)|)) ≤ 16 * ((Fintype.card ι : ℝ)-1) + 4 := by rw [Finset.sum_add_distrib, Finset.sum_comm, finiteTensor_replace_abs_sum_unit p hp] apply add_le_add _ (hr i) calc _ ≤ ∑ j ∈ (Finset.univ : Finset ι).erase i, (16 : ℝ) := by apply Finset.sum_le_sum intro j hj rw [finiteTensor_double_replace_abs_sum_unit p hp _ _ i j (Finset.ne_of_mem_erase hj)] exact (mul_le_mul (hq j) (hq i) (Finset.sum_nonneg (fun _ _ => abs_nonneg _)) (by norm_num : (0 : ℝ) ≤ 4)).trans_eq (by norm_num) _ = _ := by simp only [Finset.sum_const, nsmul_eq_mul, Finset.card_erase_of_mem (Finset.mem_univ i), Finset.card_univ, Nat.cast_sub (Nat.succ_le_iff.mpr (Fintype.card_pos_iff.mpr ⟨i⟩)), Nat.cast_one] ring calc _ ≤ ∑ z : ι → α, ∑ i, ((∑ j ∈ (Finset.univ : Finset ι).erase i, |((∏ k ∈ ((Finset.univ : Finset ι).erase i).erase j, p k (z k)) * q j (z j)) * q i (z i)|) + |(∏ j ∈ (Finset.univ : Finset ι).erase i, p j (z j)) * r i (z i)|) := Finset.sum_le_sum (fun z _ => hpoint z) _ ≤ ∑ i : ι, (16 * ((Fintype.card ι : ℝ)-1) + 4) := by rw [Finset.sum_comm] exact Finset.sum_le_sum (fun i _ => hi i) _ ≤ 16 * (Fintype.card ι : ℝ)^2 := by simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul] nlinarith [Nat.cast_nonneg (α := ℝ) (Fintype.card ι)]
CausalSmith.Stat.PrivateCateRoughdesign.finiteProductCurvature_abs_sum_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentProduct.lean:109
theorem componentAmplitudeMass_sum

Free-amplitude component masses sum to one at every real amplitude. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
n :
ℕ
x :
C :
u :
ℝ
(∑ z : Marks C, componentAmplitudeMass hL n x C z u) = 1
Proof (Lean source)
-- @node: componentAmplitudeMass_sum lemma componentAmplitudeMass_sum (hL : ℝ) (n : ℕ) (x : Fin n → Covariate) (C : Finset (Fin n)) (u : ℝ) : (∑ z : Marks C, componentAmplitudeMass hL n x C z u) = 1 := by classical simp only [componentAmplitudeMass, ← Finset.mul_sum] rw [Finset.sum_comm] simp_rw [← Fintype.prod_sum, amplitudeMarkMass_sum] simp only [Finset.prod_const_one, Finset.sum_const, Finset.card_univ, nsmul_eq_mul, mul_one] exact sign_weight_real_normalization hL
CausalSmith.Stat.PrivateCateRoughdesign.componentAmplitudeMass_sum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentProduct.lean:169
theorem componentAmplitudeMass_nonneg

On the legal path every component mark mass is nonnegative. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
x :
C :
z :
u :
ℝ
hu :
u ∈ Icc 0 (1 / 10)
0 ≤ componentAmplitudeMass hL n x C z u
Proof (Lean source)
-- @node: componentAmplitudeMass_nonneg lemma componentAmplitudeMass_nonneg (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (x : Fin n → Covariate) (C : Finset (Fin n)) (z : Marks C) (u : ℝ) (hu : u ∈ Icc 0 (1 / 10)) : 0 ≤ componentAmplitudeMass hL n x C z u := by apply mul_nonneg (by positivity) apply Finset.sum_nonneg intro lam _ apply Finset.prod_nonneg intro i _ obtain ⟨hS, hq, _⟩ := amplitudeMark_coefficients_valid hL hhL lam (x i) exact (amplitudeMarkMass_pos _ _ u hS hq hu (z i)).le
CausalSmith.Stat.PrivateCateRoughdesign.componentAmplitudeMass_nonneg · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentProduct.lean:182
theorem componentAmplitudeMass_abs_sum

The component probability array has unit absolute mass on the legal path. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
x :
C :
u :
ℝ
hu :
u ∈ Icc 0 (1 / 10)
(∑ z : Marks C, |componentAmplitudeMass hL n x C z u|) = 1
Proof (Lean source)
-- @node: componentAmplitudeMass_abs_sum lemma componentAmplitudeMass_abs_sum (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (x : Fin n → Covariate) (C : Finset (Fin n)) (u : ℝ) (hu : u ∈ Icc 0 (1 / 10)) : (∑ z : Marks C, |componentAmplitudeMass hL n x C z u|) = 1 := by simp_rw [abs_of_nonneg (componentAmplitudeMass_nonneg hL hhL n x C _ u hu)] exact componentAmplitudeMass_sum hL n x C u
CausalSmith.Stat.PrivateCateRoughdesign.componentAmplitudeMass_abs_sum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentProduct.lean:196

The averaged first product-rule array along the component path.

Definition (Lean source)
hL :
ℝ
n :
ℕ
x :
C :
z :
u :
ℝ
componentAmplitudeSlope hL n x C z u :
ℝ
(2 : ℝ)^(-((activeSigns hL).card : ℤ)) * ∑ lam : SignVector hL, finiteProductSlope (fun i : C => amplitudeMarkMass (perturbation hL lam (x i)) (bump hL (x i)) u (z i)) (fun i : C => amplitudeMarkSlope (perturbation hL lam (x i)) (bump hL (x i)) u (z i))
CausalSmith.Stat.PrivateCateRoughdesign.componentAmplitudeSlope · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentProduct.lean:205

The averaged second product-rule array along the component path.

Definition (Lean source)
hL :
ℝ
n :
ℕ
x :
C :
z :
u :
ℝ
componentAmplitudeCurvature hL n x C z u :
ℝ
(2 : ℝ)^(-((activeSigns hL).card : ℤ)) * ∑ lam : SignVector hL, finiteProductCurvature (fun i : C => amplitudeMarkMass (perturbation hL lam (x i)) (bump hL (x i)) u (z i)) (fun i : C => amplitudeMarkSlope (perturbation hL lam (x i)) (bump hL (x i)) u (z i)) (fun i : C => amplitudeMarkCurvature (perturbation hL lam (x i)) (bump hL (x i)) u (z i))
CausalSmith.Stat.PrivateCateRoughdesign.componentAmplitudeCurvature · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentProduct.lean:214
theorem componentAmplitudeMass_hasDerivAt_slope

The named slope is the derivative of the component mass path. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
n :
ℕ
x :
C :
z :
u :
ℝ
Proof (Lean source)
-- @node: componentAmplitudeMass_hasDerivAt_slope lemma componentAmplitudeMass_hasDerivAt_slope (hL : ℝ) (n : ℕ) (x : Fin n → Covariate) (C : Finset (Fin n)) (z : Marks C) (u : ℝ) : HasDerivAt (componentAmplitudeMass hL n x C z) (componentAmplitudeSlope hL n x C z u) u := componentAmplitudeMass_hasDerivAt hL n x C z u
CausalSmith.Stat.PrivateCateRoughdesign.componentAmplitudeMass_hasDerivAt_slope · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentProduct.lean:224
theorem componentAmplitudeSlope_hasDerivAt

The named curvature is the derivative of the component slope path. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
n :
ℕ
x :
C :
z :
u :
ℝ
Proof (Lean source)
-- @node: componentAmplitudeSlope_hasDerivAt lemma componentAmplitudeSlope_hasDerivAt (hL : ℝ) (n : ℕ) (x : Fin n → Covariate) (C : Finset (Fin n)) (z : Marks C) (u : ℝ) : HasDerivAt (componentAmplitudeSlope hL n x C z) (componentAmplitudeCurvature hL n x C z u) u := by classical exact (HasDerivAt.fun_sum (fun lam _ => finiteProductSlope_hasDerivAt _ _ _ u (fun i => amplitudeMarkMass_hasDerivAt _ _ u (z i)) (fun i => amplitudeMarkSlope_hasDerivAt _ _ u (z i)))).const_mul _
CausalSmith.Stat.PrivateCateRoughdesign.componentAmplitudeSlope_hasDerivAt · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentProduct.lean:232
theorem componentAmplitudeSlope_zero

The named component slope vanishes at zero amplitude by fair-sign cancellation. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
n :
ℕ
x :
C :
z :
componentAmplitudeSlope hL n x C z 0 = 0
Proof (Lean source)
-- @node: componentAmplitudeSlope_zero lemma componentAmplitudeSlope_zero (hL : ℝ) (n : ℕ) (x : Fin n → Covariate) (C : Finset (Fin n)) (z : Marks C) : componentAmplitudeSlope hL n x C z 0 = 0 := by exact (componentAmplitudeMass_hasDerivAt_slope hL n x C z 0).unique (componentAmplitudeMass_hasDerivAt_zero hL n x C z)
CausalSmith.Stat.PrivateCateRoughdesign.componentAmplitudeSlope_zero · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentProduct.lean:243
theorem componentAmplitudeCurvature_abs_sum_le

Averaging over signs preserves the quadratic bound on the component second derivative. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
x :
C :
u :
ℝ
hu :
u ∈ Icc 0 (1 / 10)
(∑ z : Marks C, |componentAmplitudeCurvature hL n x C z u|) ≤ 16 * (C.card : ℝ)^2
Proof (Lean source)
-- @node: componentAmplitudeCurvature_abs_sum_le lemma componentAmplitudeCurvature_abs_sum_le (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (x : Fin n → Covariate) (C : Finset (Fin n)) (u : ℝ) (hu : u ∈ Icc 0 (1 / 10)) : (∑ z : Marks C, |componentAmplitudeCurvature hL n x C z u|) ≤ 16 * (C.card : ℝ)^2 := by classical have hw : 0 ≤ (2 : ℝ)^(-((activeSigns hL).card : ℤ)) := by positivity have hbound (lam : SignVector hL) : (∑ z : Marks C, |finiteProductCurvature (fun i : C => amplitudeMarkMass (perturbation hL lam (x i)) (bump hL (x i)) u (z i)) (fun i : C => amplitudeMarkSlope (perturbation hL lam (x i)) (bump hL (x i)) u (z i)) (fun i : C => amplitudeMarkCurvature (perturbation hL lam (x i)) (bump hL (x i)) u (z i))|) ≤ 16 * (C.card : ℝ)^2 := by simpa only [Fintype.card_coe] using finiteProductCurvature_abs_sum_le (fun i : C => fun a => amplitudeMarkMass (perturbation hL lam (x i)) (bump hL (x i)) u a) (fun i : C => fun a => amplitudeMarkSlope (perturbation hL lam (x i)) (bump hL (x i)) u a) (fun i : C => fun a => amplitudeMarkCurvature (perturbation hL lam (x i)) (bump hL (x i)) u a) (by intro i obtain ⟨hS, hq, hr⟩ := amplitudeMark_coefficients_valid hL hhL lam (x i) exact amplitudeMarkMass_abs_sum _ _ u hS hq hu) (by intro i obtain ⟨hS, hq, hr⟩ := amplitudeMark_coefficients_valid hL hhL lam (x i) exact amplitudeMarkSlope_abs_sum_le_four _ _ u hS hq hr hu) (by intro i obtain ⟨hS, hq, hr⟩ := amplitudeMark_coefficients_valid hL hhL lam (x i) exact amplitudeMarkCurvature_abs_sum_le_four _ _ u hS hq hr hu) unfold componentAmplitudeCurvature simp_rw [abs_mul, abs_of_nonneg hw] apply (Finset.sum_le_sum (fun z _ => mul_le_mul_of_nonneg_left (Finset.abs_sum_le_sum_abs _ _) hw)).trans rw [← Finset.mul_sum, Finset.sum_comm] apply (mul_le_mul_of_nonneg_left (Finset.sum_le_sum (fun lam _ => hbound lam)) hw).trans_eq simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul] rw [← mul_assoc, sign_weight_real_normalization, one_mul]
CausalSmith.Stat.PrivateCateRoughdesign.componentAmplitudeCurvature_abs_sum_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentProduct.lean:251
theorem scalar_second_derivative_remainder_le Lemma scalar_second_derivative_remainder_le in the paper ↗

A vanishing initial slope and a bounded second derivative give the quadratic remainder by the mean-value inequality followed by integration of the first derivative. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
f g r :
ℝ → ℝ
K u :
ℝ
hu :
0 ≤ u
hf :
∀ v, HasDerivAt f (g v) v
hg :
∀ v, HasDerivAt g (r v) v
hzero :
g 0 = 0
hbound :
∀ v ∈ Icc 0 u, |r v| ≤ K
|f u-f 0| ≤ K*u^2/2
Proof (Lean source)
-- @node: scalar_second_derivative_remainder_le lemma scalar_second_derivative_remainder_le (f g r : ℝ → ℝ) (K u : ℝ) (hu : 0 ≤ u) (hf : ∀ v, HasDerivAt f (g v) v) (hg : ∀ v, HasDerivAt g (r v) v) (hzero : g 0 = 0) (hbound : ∀ v ∈ Icc 0 u, |r v| ≤ K) : |f u-f 0| ≤ K*u^2/2 := by have hgc : Continuous g := continuous_iff_continuousAt.mpr (fun v => (hg v).continuousAt) have hgi : IntervalIntegrable g volume 0 u := hgc.intervalIntegrable _ _ have hslope (v : ℝ) (hv : v ∈ Icc 0 u) : |g v| ≤ K*v := by have hm := norm_image_sub_le_of_norm_deriv_le_segment' (a := (0 : ℝ)) (b := u) (f := g) (f' := r) (fun v _ => (hg v).hasDerivWithinAt) (fun v hv => by simpa only [Real.norm_eq_abs] using (hbound v ⟨hv.1, hv.2.le⟩)) v hv simpa only [hzero, sub_zero, Real.norm_eq_abs] using hm rw [← intervalIntegral.integral_eq_sub_of_hasDerivAt (fun v _ => hf v) hgi] calc _ ≤ ∫ v in (0 : ℝ)..u, |g v| := intervalIntegral.abs_integral_le_integral_abs hu _ ≤ ∫ v in (0 : ℝ)..u, K*v := intervalIntegral.integral_mono_on hu hgi.abs ((continuous_const.mul continuous_id).intervalIntegrable _ _) hslope _ = _ := by rw [intervalIntegral.integral_const_mul, integral_id]; simp; ring
CausalSmith.Stat.PrivateCateRoughdesign.scalar_second_derivative_remainder_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentProduct.lean:293
theorem finite_array_second_derivative_remainder_le Lemma finite_array_second_derivative_remainder_le in the paper ↗

Applying the scalar second-order bound to a signed projection controls the whole finite array without multiplying the bound by the number of its coordinates. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
ι :
Type*
f g r :
ι → ℝ → ℝ
K u :
ℝ
hu :
0 ≤ u
hf :
∀ i v, HasDerivAt (f i) (g i v) v
hg :
∀ i v, HasDerivAt (g i) (r i v) v
hzero :
∀ i, g i 0 = 0
hbound :
∀ v ∈ Icc 0 u, (∑ i, |r i v|) ≤ K
(∑ i, |f i u-f i 0|) ≤ K*u^2/2
Proof (Lean source)
-- @node: finite_array_second_derivative_remainder_le lemma finite_array_second_derivative_remainder_le {ι : Type*} [Fintype ι] (f g r : ι → ℝ → ℝ) (K u : ℝ) (hu : 0 ≤ u) (hf : ∀ i v, HasDerivAt (f i) (g i v) v) (hg : ∀ i v, HasDerivAt (g i) (r i v) v) (hzero : ∀ i, g i 0 = 0) (hbound : ∀ v ∈ Icc 0 u, (∑ i, |r i v|) ≤ K) : (∑ i, |f i u-f i 0|) ≤ K*u^2/2 := by classical let a (i : ι) : ℝ := if 0 ≤ f i u-f i 0 then 1 else -1 have ha (i : ι) : |a i| = 1 := by dsimp [a]; split_ifs <;> norm_num have hd (i : ι) : a i*(f i u-f i 0) = |f i u-f i 0| := by dsimp [a] split_ifs with h · rw [one_mul, abs_of_nonneg h] · rw [neg_one_mul, abs_of_neg (lt_of_not_ge h)] have hs := scalar_second_derivative_remainder_le (fun v => ∑ i, a i*f i v) (fun v => ∑ i, a i*g i v) (fun v => ∑ i, a i*r i v) K u hu (fun v => HasDerivAt.fun_sum (fun i _ => (hf i v).const_mul (a i))) (fun v => HasDerivAt.fun_sum (fun i _ => (hg i v).const_mul (a i))) (by simp only [hzero, mul_zero, Finset.sum_const_zero]) (by intro v hv apply (Finset.abs_sum_le_sum_abs _ _).trans simpa only [abs_mul, ha, one_mul] using hbound v hv) have he : (∑ i, a i*f i u)-(∑ i, a i*f i 0) = ∑ i, |f i u-f i 0| := by rw [← Finset.sum_sub_distrib] simp_rw [← mul_sub, hd] rw [he, abs_of_nonneg (Finset.sum_nonneg (fun _ _ => abs_nonneg _))] at hs exact hs
CausalSmith.Stat.PrivateCateRoughdesign.finite_array_second_derivative_remainder_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentProduct.lean:319
theorem alternativeMass_abs_sub_nullMass_sum_le Lemma alternativeMass_abs_sub_nullMass_sum_le in the paper ↗

Integrating the component curvature twice gives the sharp second-order array bound. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
x :
C :
(∑ z : Marks C, |alternativeMass hL n x C z-nullMass n C z|)
≤ 8*separation hL*(C.card : ℝ)^2
Proof (Lean source)
-- @node: alternativeMass_abs_sub_nullMass_sum_le lemma alternativeMass_abs_sub_nullMass_sum_le (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (x : Fin n → Covariate) (C : Finset (Fin n)) : (∑ z : Marks C, |alternativeMass hL n x C z-nullMass n C z|) ≤ 8*separation hL*(C.card : ℝ)^2 := by have hu := sqrt_separation_amplitude_range hL hhL have h := finite_array_second_derivative_remainder_le (componentAmplitudeMass hL n x C) (componentAmplitudeSlope hL n x C) (componentAmplitudeCurvature hL n x C) (16*(C.card : ℝ)^2) (sqrt (separation hL)) hu.1 (componentAmplitudeMass_hasDerivAt_slope hL n x C) (componentAmplitudeSlope_hasDerivAt hL n x C) (componentAmplitudeSlope_zero hL n x C) (by intro v hv exact componentAmplitudeCurvature_abs_sum_le hL hhL n x C v ⟨hv.1, hv.2.trans hu.2⟩) simp_rw [componentAmplitudeMass_actual hL hhL, componentAmplitudeMass_zero] at h rw [Real.sq_sqrt (separation_unit_range hL hhL).1] at h convert h using 1 ring
CausalSmith.Stat.PrivateCateRoughdesign.alternativeMass_abs_sub_nullMass_sum_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentProduct.lean:352

The absolute-array bound gives the component coupling's failure-probability bound. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
x :
C :
1-overlapMass hL n x C ≤ 4*separation hL*(C.card : ℝ)^2
Proof (Lean source)
-- @node: overlapMass_deficit_le lemma overlapMass_deficit_le (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (x : Fin n → Covariate) (C : Finset (Fin n)) : 1-overlapMass hL n x C ≤ 4*separation hL*(C.card : ℝ)^2 := by have h := alternativeMass_abs_sub_nullMass_sum_le hL hhL n x C rw [componentMass_abs_sum] at h linarith
CausalSmith.Stat.PrivateCateRoughdesign.overlapMass_deficit_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentProduct.lean:373
theorem componentCoupling_hamming_cost_le_cubic Lemma componentCoupling_hamming_cost_le_cubic in the paper ↗

A nonsingleton component's expected number of changed marks is at most four times separation times the cube of its size, as required by the component-counting argument. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
x :
C :
(∫⁻ zw, (hammingDist zw.1 zw.2 : ℝ≥0∞) ∂componentCoupling hL n x C)
≤ ofReal (4*separation hL*(C.card : ℝ)^3)
Proof (Lean source)
-- @node: componentCoupling_hamming_cost_le_cubic lemma componentCoupling_hamming_cost_le_cubic (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (x : Fin n → Covariate) (C : Finset (Fin n)) : (∫⁻ zw, (hammingDist zw.1 zw.2 : ℝ≥0∞) ∂componentCoupling hL n x C) ≤ ofReal (4*separation hL*(C.card : ℝ)^3) := by apply (componentCoupling_hamming_cost_le hL hhL n x C).trans rw [← ENNReal.ofReal_natCast C.card, ← ENNReal.ofReal_mul (Nat.cast_nonneg C.card)] apply ENNReal.ofReal_le_ofReal have h := mul_le_mul_of_nonneg_left (overlapMass_deficit_le hL hhL n x C) (Nat.cast_nonneg (α := ℝ) C.card) calc _ ≤ (C.card : ℝ)*(4*separation hL*(C.card : ℝ)^2) := h _ = _ := by ring
CausalSmith.Stat.PrivateCateRoughdesign.componentCoupling_hamming_cost_le_cubic · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentProduct.lean:382
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.ComponentSpanning 11 declarations General labeled spanning-tree assembly for the shared-sign component count.

General labeled spanning-tree assembly for the shared-sign component count. A component induces a connected graph. Enumerating its vertices identifies a spanning tree on Fin s; a finite union bound then applies the published Cayley count.

theorem orderedComponent_induce_connected Lemma orderedComponent_induce_connected in the paper ↗

The induced graph on any selected component is connected, with no size restriction. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
n :
ℕ
x :
C :
hC :
C ∈ orderedComponents hL n x
((sharedGraph hL n x).induce (C : Set (Fin n))).Connected
Proof (Lean source)
-- @node: orderedComponent_induce_connected lemma orderedComponent_induce_connected (hL : ℝ) (n : ℕ) (x : Fin n → Covariate) (C : Finset (Fin n)) (hC : C ∈ orderedComponents hL n x) : ((sharedGraph hL n x).induce (C : Set (Fin n))).Connected := by classical obtain ⟨r, _, hr⟩ := (mem_orderedComponents hL n x C).mp hC have hs : ((sharedGraph hL n x).connectedComponentMk r).supp = (C : Set (Fin n)) := by ext i rw [← hr] simp only [Finset.mem_coe, mem_componentVertices, SimpleGraph.ConnectedComponent.mem_supp_iff, SimpleGraph.ConnectedComponent.eq, SimpleGraph.reachable_comm] have h := ((sharedGraph hL n x).connectedComponentMk r).connected_toSimpleGraph change ((sharedGraph hL n x).induce ((sharedGraph hL n x).connectedComponentMk r).supp).Connected at h rw [hs] at h exact h
CausalSmith.Stat.PrivateCateRoughdesign.orderedComponent_induce_connected · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentSpanning.lean:12

The event that all edges of a specified labeled tree share signs on selected coordinates. Extra graph edges and all isolation requirements are deliberately discarded.

Definition (Lean source)
hL :
ℝ
n s :
ℕ
e :
Fin s → Fin n
T :
labeledSharedTreeEvent hL n s e T :
Set (Fin n → Covariate)
{x | ∀ i j, T.Adj i j → sharedAdj hL n x (e i) (e j)}
CausalSmith.Stat.PrivateCateRoughdesign.labeledSharedTreeEvent · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentSpanning.lean:31
theorem measurableSet_labeledSharedTreeEvent

A specified labeled-tree event is Borel because it is a finite intersection of edge events. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
n s :
ℕ
e :
Fin s → Fin n
T :
Proof (Lean source)
-- @node: measurableSet_labeledSharedTreeEvent lemma measurableSet_labeledSharedTreeEvent (hL : ℝ) (n s : ℕ) (e : Fin s → Fin n) (T : SimpleGraph (Fin s)) : MeasurableSet (labeledSharedTreeEvent hL n s e T) := by classical change MeasurableSet {x : Fin n → Covariate | ∀ i j, T.Adj i j → sharedAdj hL n x (e i) (e j)} simp_rw [ofPred_forall] apply MeasurableSet.iInter intro i apply MeasurableSet.iInter intro j by_cases h : T.Adj i j · simpa [h] using measurableSet_sharedAdj hL n (e i) (e j) · simp [h]
CausalSmith.Stat.PrivateCateRoughdesign.measurableSet_labeledSharedTreeEvent · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentSpanning.lean:38
theorem orderedComponent_contains_labeled_tree

For any fixed enumeration of a component, a labeled spanning tree exists in that component's graph. The enumeration is fixed before taking probabilities. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
n s :
ℕ
C :
e :
Fin s ≃ C
x :
hC :
C ∈ orderedComponents hL n x
∃ T : {T : SimpleGraph (Fin s) // T.IsTree},
x ∈ labeledSharedTreeEvent hL n s (fun i => (e i).val) T.val
Proof (Lean source)
-- @node: orderedComponent_contains_labeled_tree lemma orderedComponent_contains_labeled_tree (hL : ℝ) (n s : ℕ) (C : Finset (Fin n)) (e : Fin s ≃ C) (x : Fin n → Covariate) (hC : C ∈ orderedComponents hL n x) : ∃ T : {T : SimpleGraph (Fin s) // T.IsTree}, x ∈ labeledSharedTreeEvent hL n s (fun i => (e i).val) T.val := by classical let G := (sharedGraph hL n x).induce (C : Set (Fin n)) have hG : G.Connected := orderedComponent_induce_connected hL n x C hC have hGe : (G.comap e).Connected := (SimpleGraph.Iso.comap e G).connected_iff.mpr hG obtain ⟨T, hle, ht⟩ := hGe.exists_isTree_le refine ⟨⟨T, ht⟩, ?_⟩ intro i j hij exact hle hij
CausalSmith.Stat.PrivateCateRoughdesign.orderedComponent_contains_labeled_tree · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentSpanning.lean:54
theorem fixed_component_subset_labeled_tree_union

The component event is contained in the union over all labeled trees on its fixed vertex enumeration. This inclusion also covers singleton components. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
n s :
ℕ
C :
e :
Fin s ≃ C
{x : Fin n → Covariate | C ∈ orderedComponents hL n x} ⊆ ⋃ T : {T : SimpleGraph (Fin s) // T.IsTree}, labeledSharedTreeEvent hL n s (fun i => (e i).val) T.val
Proof (Lean source)
-- @node: fixed_component_subset_labeled_tree_union lemma fixed_component_subset_labeled_tree_union (hL : ℝ) (n s : ℕ) (C : Finset (Fin n)) (e : Fin s ≃ C) : {x : Fin n → Covariate | C ∈ orderedComponents hL n x} ⊆ ⋃ T : {T : SimpleGraph (Fin s) // T.IsTree}, labeledSharedTreeEvent hL n s (fun i => (e i).val) T.val := by intro x hx obtain ⟨T, ht⟩ := orderedComponent_contains_labeled_tree hL n s C e x hx exact Set.mem_iUnion.mpr ⟨T, ht⟩
CausalSmith.Stat.PrivateCateRoughdesign.fixed_component_subset_labeled_tree_union · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentSpanning.lean:71
theorem fixed_component_measure_le_cayley_mul

A common probability envelope for specified labeled trees gives the component probability bound by the finite union bound and the explicit Cayley gate. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
n s :
ℕ
hs :
2 ≤ s
C :
e :
Fin s ≃ C
μ :
b :
ℝ≥0∞
hb :
∀ T : {T : SimpleGraph (Fin s) // T.IsTree},
μ (labeledSharedTreeEvent hL n s (fun i => (e i).val) T.val) ≤ b
μ {x | C ∈ orderedComponents hL n x} ≤ (s ^ (s - 2) : ℕ) * b
Proof (Lean source)
-- @node: fixed_component_measure_le_cayley_mul lemma fixed_component_measure_le_cayley_mul (cayley : CayleyLabeledTreeCount) (hL : ℝ) (n s : ℕ) (hs : 2 ≤ s) (C : Finset (Fin n)) (e : Fin s ≃ C) (μ : Measure (Fin n → Covariate)) (b : ℝ≥0∞) (hb : ∀ T : {T : SimpleGraph (Fin s) // T.IsTree}, μ (labeledSharedTreeEvent hL n s (fun i => (e i).val) T.val) ≤ b) : μ {x | C ∈ orderedComponents hL n x} ≤ (s ^ (s - 2) : ℕ) * b := by classical let := ofFinite {T : SimpleGraph (Fin s) // T.IsTree} calc _ ≤ μ (⋃ T : {T : SimpleGraph (Fin s) // T.IsTree}, labeledSharedTreeEvent hL n s (fun i => (e i).val) T.val) := measure_mono (fixed_component_subset_labeled_tree_union hL n s C e) _ ≤ ∑' T : {T : SimpleGraph (Fin s) // T.IsTree}, μ (labeledSharedTreeEvent hL n s (fun i => (e i).val) T.val) := measure_iUnion_le _ _ ≤ ∑' _T : {T : SimpleGraph (Fin s) // T.IsTree}, b := ENNReal.tsum_le_tsum hb _ = _ := by rw [tsum_fintype] simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul] rw [← Nat.card_eq_fintype_card, cayley s hs]
CausalSmith.Stat.PrivateCateRoughdesign.fixed_component_measure_le_cayley_mul · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentSpanning.lean:83
theorem lintegral_sizeComponentCount_le_of_labeled_tree_bound

The general size-s count assembly: a specified-tree envelope, on arbitrary distinct sample coordinates, implies the binomial Cayley estimate for the actual component count. The tree probability estimate remains an explicit input here, rather than a paper-theorem premise. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
n s :
ℕ
hs :
2 ≤ s
μ :
b :
ℝ≥0∞
hb :
∀ (e : Fin s → Fin n)
then
∀ T : {T : SimpleGraph (Fin s) // T.IsTree}, μ (labeledSharedTreeEvent hL n s e T.val) ≤ b
(∫⁻ x, (sizeComponentCount hL n x s : ℝ≥0∞) ∂μ)
≤ (n.choose s : ℝ≥0∞) * (s ^ (s - 2) : ℕ) * b
Proof (Lean source)
-- @node: lintegral_sizeComponentCount_le_of_labeled_tree_bound lemma lintegral_sizeComponentCount_le_of_labeled_tree_bound (cayley : CayleyLabeledTreeCount) (hL : ℝ) (n s : ℕ) (hs : 2 ≤ s) (μ : Measure (Fin n → Covariate)) (b : ℝ≥0∞) (hb : ∀ (e : Fin s → Fin n), Function.Injective e → ∀ T : {T : SimpleGraph (Fin s) // T.IsTree}, μ (labeledSharedTreeEvent hL n s e T.val) ≤ b) : (∫⁻ x, (sizeComponentCount hL n x s : ℝ≥0∞) ∂μ) ≤ (n.choose s : ℝ≥0∞) * (s ^ (s - 2) : ℕ) * b := by classical rw [mul_assoc] apply lintegral_sizeComponentCount_le_choose_mul intro C hC let e : Fin s ≃ C := (Finset.equivFinOfCardEq hC).symm apply fixed_component_measure_le_cayley_mul cayley hL n s hs C e μ b apply hb intro i j hij exact e.injective (Subtype.ext hij)
CausalSmith.Stat.PrivateCateRoughdesign.lintegral_sizeComponentCount_le_of_labeled_tree_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentSpanning.lean:107
theorem labeledSharedTreeEvent_eq_preimage

Selecting distinct coordinates pulls a labeled-tree event back from its own vertex space; neither extra vertices nor unused coordinates add restrictions. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
n s :
ℕ
e :
Fin s → Fin n
he :
T :
= (fun x i => x (e i)) ⁻¹' labeledSharedTreeEvent hL s s id T
Proof (Lean source)
-- @node: labeledSharedTreeEvent_eq_preimage lemma labeledSharedTreeEvent_eq_preimage (hL : ℝ) (n s : ℕ) (e : Fin s → Fin n) (he : Injective e) (T : SimpleGraph (Fin s)) : labeledSharedTreeEvent hL n s e T = (fun x i => x (e i)) ⁻¹' labeledSharedTreeEvent hL s s id T := by ext x constructor · intro hx i j hij obtain ⟨_, hsign⟩ := hx i j hij exact ⟨hij.ne, hsign⟩ · intro hx i j hij obtain ⟨hne, hsign⟩ := hx i j hij exact ⟨fun h => hne (he h), hsign⟩
CausalSmith.Stat.PrivateCateRoughdesign.labeledSharedTreeEvent_eq_preimage · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentSpanning.lean:130
theorem labeledSharedTreeEvent_uniform_volume_eq

The probability of a labeled-tree event on arbitrary distinct sample coordinates is exactly its probability under the smaller iid uniform design. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
n s :
ℕ
e :
Fin s → Fin n
he :
T :
(Measure.pi (fun _ : Fin n => (volume : Measure Covariate))) (labeledSharedTreeEvent hL n s e T)
= (Measure.pi (fun _ : Fin s => (volume : Measure Covariate))) (labeledSharedTreeEvent hL s s id T)
Proof (Lean source)
-- @node: labeledSharedTreeEvent_uniform_volume_eq lemma labeledSharedTreeEvent_uniform_volume_eq (hL : ℝ) (n s : ℕ) (e : Fin s → Fin n) (he : Injective e) (T : SimpleGraph (Fin s)) : (Measure.pi (fun _ : Fin n => (volume : Measure Covariate))) (labeledSharedTreeEvent hL n s e T) = (Measure.pi (fun _ : Fin s => (volume : Measure Covariate))) (labeledSharedTreeEvent hL s s id T) := by rw [labeledSharedTreeEvent_eq_preimage hL n s e he T] exact uniform_covariate_injection_preimage n s e he _ (measurableSet_labeledSharedTreeEvent hL s s id T)
CausalSmith.Stat.PrivateCateRoughdesign.labeledSharedTreeEvent_uniform_volume_eq · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentSpanning.lean:146
theorem lintegral_sizeComponentCount_le_of_uniform_labeled_tree_bound

The roadmap's general component-count bound follows from specified-tree probabilities on their own vertex spaces. Cayley and coordinate selection supply all the assembly factors. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
n s :
ℕ
hs :
2 ≤ s
htree :
∀ T : {T : SimpleGraph (Fin s) // T.IsTree},
(Measure.pi (fun _ : Fin s => (volume : Measure Covariate))) (labeledSharedTreeEvent hL s s id T.val)
≤ ofReal (2 * hL * (4 * deltaL hL) ^ (s - 1))
(∫⁻ x, (sizeComponentCount hL n x s : ℝ≥0∞) ∂(Measure.pi (fun _ : Fin n => (volume : Measure Covariate))))
≤ ofReal ((n.choose s : ℝ) * 2 * hL * (s : ℝ) ^ (s - 2) * (4 * deltaL hL) ^ (s - 1))
Proof (Lean source)
-- @node: lintegral_sizeComponentCount_le_of_uniform_labeled_tree_bound lemma lintegral_sizeComponentCount_le_of_uniform_labeled_tree_bound (cayley : CayleyLabeledTreeCount) (hL : ℝ) (n s : ℕ) (hs : 2 ≤ s) (htree : ∀ T : {T : SimpleGraph (Fin s) // T.IsTree}, (Measure.pi (fun _ : Fin s => (volume : Measure Covariate))) (labeledSharedTreeEvent hL s s id T.val) ≤ ofReal (2 * hL * (4 * deltaL hL) ^ (s - 1))) : (∫⁻ x, (sizeComponentCount hL n x s : ℝ≥0∞) ∂(Measure.pi (fun _ : Fin n => (volume : Measure Covariate)))) ≤ ofReal ((n.choose s : ℝ) * 2 * hL * (s : ℝ) ^ (s - 2) * (4 * deltaL hL) ^ (s - 1)) := by have hb := lintegral_sizeComponentCount_le_of_labeled_tree_bound cayley hL n s hs (Measure.pi (fun _ : Fin n => (volume : Measure Covariate))) (ofReal (2 * hL * (4 * deltaL hL) ^ (s - 1))) (fun e he T => by rw [labeledSharedTreeEvent_uniform_volume_eq hL n s e he]; exact htree T) rw [← ENNReal.ofReal_natCast, ← ENNReal.ofReal_natCast, ← ENNReal.ofReal_mul (Nat.cast_nonneg _), ← ENNReal.ofReal_mul (mul_nonneg (Nat.cast_nonneg _) (Nat.cast_nonneg _))] at hb convert hb using 1 congr 1 push_cast ring
CausalSmith.Stat.PrivateCateRoughdesign.lintegral_sizeComponentCount_le_of_uniform_labeled_tree_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentSpanning.lean:159
theorem commonMassCoupling_hamming_cost_le_of_labeled_tree_bound

The actual sparse dataset coupling obeys the Hamming-cost bound once each specified labeled tree has its geometric probability envelope. All component-count assembly is proved. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
hn :
1 ≤ n
hcap :
(n : ℝ) * deltaL hL ≤ 1 / 128
htree :
∀ s : ℕ
if
2 ≤ s
and
s ≤ n
then
∀ T : {T : SimpleGraph (Fin s) // T.IsTree},
(Measure.pi (fun _ : Fin s => (volume : Measure Covariate))) (labeledSharedTreeEvent hL s s id T.val)
≤ ofReal (2 * hL * (4 * deltaL hL) ^ (s - 1))
(∫⁻ zw, (dHam n zw.1 zw.2 : ℝ≥0∞) ∂commonMassCoupling hL n)
≤ ofReal (1024 * separation hL * (n : ℝ) ^ 2 * hL * deltaL hL)
Proof (Lean source)
-- @node: commonMassCoupling_hamming_cost_le_of_labeled_tree_bound lemma commonMassCoupling_hamming_cost_le_of_labeled_tree_bound (cayley : CayleyLabeledTreeCount) (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (hn : 1 ≤ n) (hcap : (n : ℝ) * deltaL hL ≤ 1 / 128) (htree : ∀ s : ℕ, 2 ≤ s → s ≤ n → ∀ T : {T : SimpleGraph (Fin s) // T.IsTree}, (Measure.pi (fun _ : Fin s => (volume : Measure Covariate))) (labeledSharedTreeEvent hL s s id T.val) ≤ ofReal (2 * hL * (4 * deltaL hL) ^ (s - 1))) : (∫⁻ zw, (dHam n zw.1 zw.2 : ℝ≥0∞) ∂commonMassCoupling hL n) ≤ ofReal (1024 * separation hL * (n : ℝ) ^ 2 * hL * deltaL hL) := by apply commonMassCoupling_hamming_cost_le_of_tree_counts hL hhL n hn hcap intro i hi have hi' := Finset.mem_range.mp hi have hb := lintegral_sizeComponentCount_le_of_uniform_labeled_tree_bound cayley hL n (i + 2) (by omega) (htree (i + 2) (by omega) (by omega)) convert hb using 1 congr 1 simp ring
CausalSmith.Stat.PrivateCateRoughdesign.commonMassCoupling_hamming_cost_le_of_labeled_tree_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentSpanning.lean:185
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.ComponentTransport 15 declarations Additive transport costs for the finite product of component couplings.

Additive transport costs for the finite product of component couplings.

Pairing two assignments coordinatewise preserves all finite assignments.

Definition (Lean source)
ι α :
Type*
pairedAssignmentEquiv ι α :
((ι → α) × (ι → α)) ≃ (ι → α × α)
clause 1
toFun zw i := (zw.1 i, zw.2 i)
clause 2
invFun v := (fun i => (v i).1, fun i => (v i).2)
clause 3
left_inv _ := rfl
clause 4
right_inv _ := rfl
theorem sum_prod_partition_semiring Lemma sum_prod_partition_semiring in the paper ↗

Partition restriction factors array sums over any commutative semiring. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
ι α R :
s :
hcover :
∀ i, ∃ C ∈ s, i ∈ C
hdisj :
F :
∀ C : Finset ι
if
(C → α)
then
R
(∑ z : ι → α, ∏ C ∈ s, F C (fun i => z i)) = ∏ C ∈ s, ∑ z : C → α, F C z
Proof (Lean source)
-- @node: sum_prod_partition_semiring lemma sum_prod_partition_semiring {ι α R : Type*} [Fintype ι] [DecidableEq ι] [Fintype α] [CommSemiring R] (s : Finset (Finset ι)) (hcover : ∀ i, ∃ C ∈ s, i ∈ C) (hdisj : PairwiseDisjoint (s : Set (Finset ι)) id) (F : ∀ C : Finset ι, (C → α) → R) : (∑ z : ι → α, ∏ C ∈ s, F C (fun i => z i)) = ∏ C ∈ s, ∑ z : C → α, F C z := by classical let e := partitionRestrictionEquiv (α := α) s hcover hdisj calc _ = ∑ w : ∀ C : s, ↥(C : Finset ι) → α, ∏ C : s, F C (w C) := by apply Fintype.sum_equiv e intro z exact (Finset.prod_coe_sort s (fun C => F C (fun i => z i))).symm _ = _ := by rw [← Fintype.prod_sum] exact Finset.prod_coe_sort s (fun C => ∑ z : C → α, F C z)
CausalSmith.Stat.PrivateCateRoughdesign.sum_prod_partition_semiring · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentTransport.lean:19
theorem sum_prod_partition_observable Lemma sum_prod_partition_observable in the paper ↗

A normalized partition product preserves the expectation of any one block observable. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
ι α R :
s :
hcover :
∀ i, ∃ C ∈ s, i ∈ C
hdisj :
F :
∀ C : Finset ι
if
(C → α)
then
R
hF :
∀ C ∈ s
if
∑ z : C
then
α, F C z = 1
D :
hD :
D ∈ s
g :
(D → α) → R
(∑ z : ι → α, (∏ C ∈ s, F C (fun i => z i)) * g (fun i => z i)) = ∑ z : D → α, F D z * g z
Proof (Lean source)
-- @node: sum_prod_partition_observable lemma sum_prod_partition_observable {ι α R : Type*} [Fintype ι] [DecidableEq ι] [Fintype α] [CommSemiring R] (s : Finset (Finset ι)) (hcover : ∀ i, ∃ C ∈ s, i ∈ C) (hdisj : PairwiseDisjoint (s : Set (Finset ι)) id) (F : ∀ C : Finset ι, (C → α) → R) (hF : ∀ C ∈ s, ∑ z : C → α, F C z = 1) (D : Finset ι) (hD : D ∈ s) (g : (D → α) → R) : (∑ z : ι → α, (∏ C ∈ s, F C (fun i => z i)) * g (fun i => z i)) = ∑ z : D → α, F D z * g z := by classical let G (C : Finset ι) (z : C → α) : R := if h : C = D then F D (fun i => z ⟨i, h.symm ▸ i.property⟩) * g (fun i => z ⟨i, h.symm ▸ i.property⟩) else F C z have hp (z : ι → α) : (∏ C ∈ s, G C (fun i => z i)) = (∏ C ∈ s, F C (fun i => z i)) * g (fun i => z i) := by rw [← Finset.prod_erase_mul _ _ hD, ← Finset.prod_erase_mul _ _ hD] have he : (∏ C ∈ s.erase D, G C (fun i => z i)) = ∏ C ∈ s.erase D, F C (fun i => z i) := by apply Finset.prod_congr rfl intro C hC simp [G, Finset.ne_of_mem_erase hC] rw [he] simp [G, mul_assoc] simp_rw [← hp] rw [sum_prod_partition_semiring s hcover hdisj G, ← Finset.prod_erase_mul _ _ hD] have he : (∏ C ∈ s.erase D, ∑ z : C → α, G C z) = 1 := by apply Finset.prod_eq_one intro C hC simpa [G, Finset.ne_of_mem_erase hC] using hF C (mem_of_mem_erase hC) rw [he, one_mul] simp [G]
CausalSmith.Stat.PrivateCateRoughdesign.sum_prod_partition_observable · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentTransport.lean:39
theorem orderedComponents_sum_records Lemma orderedComponents_sum_records in the paper ↗

The shared-sign component list partitions any sum over dataset records. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
M :
hL :
ℝ
n :
ℕ
x :
f :
Fin n → M
(∑ i, f i) = ((orderedComponents hL n x).map (fun C => ∑ i ∈ C, f i)).sum
Proof (Lean source)
-- @node: orderedComponents_sum_records lemma orderedComponents_sum_records {M : Type*} [AddCommMonoid M] (hL : ℝ) (n : ℕ) (x : Fin n → Covariate) (f : Fin n → M) : (∑ i, f i) = ((orderedComponents hL n x).map (fun C => ∑ i ∈ C, f i)).sum := by classical let s := (orderedComponents hL n x).toFinset have hc : s.biUnion id = univ := by ext i simp only [Finset.mem_biUnion, Finset.mem_univ, iff_true] obtain ⟨C, hC, hi⟩ := orderedComponents_cover hL n x i exact ⟨C, List.mem_toFinset.mpr hC, hi⟩ have hd : PairwiseDisjoint (s : Set (Finset (Fin n))) id := by intro C hC D hD hne exact orderedComponents_disjoint hL n x C D (List.mem_toFinset.mp hC) (List.mem_toFinset.mp hD) hne rw [← hc, Finset.sum_biUnion hd] exact List.sum_toFinset _ (orderedComponents_nodup hL n x)
CausalSmith.Stat.PrivateCateRoughdesign.orderedComponents_sum_records · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentTransport.lean:74
theorem attachMarks_hammingDist Lemma attachMarks_hammingDist in the paper ↗

Identical attached covariates make dataset replacements exactly mark replacements. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
x :
z w :
Fin n → Bool × Bool
dHam n (attachMarks n x z) (attachMarks n x w) = hammingDist z w
Proof (Lean source)
-- @node: attachMarks_hammingDist lemma attachMarks_hammingDist (n : ℕ) (x : Fin n → Covariate) (z w : Fin n → Bool × Bool) : dHam n (attachMarks n x z) (attachMarks n x w) = hammingDist z w := by classical unfold dHam hammingDist congr 1 ext i simp [attachMarks, Prod.ext_iff]
CausalSmith.Stat.PrivateCateRoughdesign.attachMarks_hammingDist · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentTransport.lean:94
theorem hammingDist_orderedComponents Lemma hammingDist_orderedComponents in the paper ↗

Hamming cost decomposes over the disjoint ordered components. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
n :
ℕ
x :
z w :
Fin n → Bool × Bool
= ((orderedComponents hL n x).map (fun (C : Finset (Fin n)) => hammingDist (fun i : C => z i) (fun i : C => w i))).sum
Proof (Lean source)
-- @node: hammingDist_orderedComponents lemma hammingDist_orderedComponents (hL : ℝ) (n : ℕ) (x : Fin n → Covariate) (z w : Fin n → Bool × Bool) : hammingDist z w = ((orderedComponents hL n x).map (fun (C : Finset (Fin n)) => hammingDist (fun i : C => z i) (fun i : C => w i))).sum := by classical have hc (C : Finset (Fin n)) : hammingDist (fun i : C => z i) (fun i : C => w i) = ∑ i ∈ C, if z i ≠ w i then 1 else 0 := by simp only [hammingDist, Finset.card_eq_sum_ones, Finset.sum_filter] exact Finset.sum_coe_sort C (fun i => if z i ≠ w i then 1 else 0) simp_rw [hc] simpa only [hammingDist, Finset.card_eq_sum_ones, Finset.sum_filter] using orderedComponents_sum_records hL n x (fun i => if z i ≠ w i then 1 else 0 : Fin n → ℕ)
CausalSmith.Stat.PrivateCateRoughdesign.hammingDist_orderedComponents · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentTransport.lean:105

Summation over pairs of assignments equals summation over paired coordinates. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
ι α M :
f :
(ι → α) × (ι → α) → M
(∑ zw, f zw) = ∑ v : ι → α × α, f (fun i => (v i).1, fun i => (v i).2)
Proof (Lean source)
-- @node: sum_pairedAssignments lemma sum_pairedAssignments {ι α M : Type*} [Fintype ι] [DecidableEq ι] [Fintype α] [AddCommMonoid M] (f : (ι → α) × (ι → α) → M) : (∑ zw, f zw) = ∑ v : ι → α × α, f (fun i => (v i).1, fun i => (v i).2) := by apply Fintype.sum_equiv (pairedAssignmentEquiv ι α) intro zw rfl
theorem componentCouplingMass_paired_sum Lemma componentCouplingMass_paired_sum in the paper ↗

Each component's paired-coordinate coupling array has total mass one. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
x :
C :
(∑ v : C → (Bool × Bool) × (Bool × Bool), ofReal (componentCouplingMass hL n x C (fun i => (v i).1) (fun i => (v i).2)))
= 1
Proof (Lean source)
-- @node: componentCouplingMass_paired_sum lemma componentCouplingMass_paired_sum (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (x : Fin n → Covariate) (C : Finset (Fin n)) : (∑ v : C → (Bool × Bool) × (Bool × Bool), ofReal (componentCouplingMass hL n x C (fun i => (v i).1) (fun i => (v i).2))) = 1 := by rw [← sum_pairedAssignments (fun zw : Marks C × Marks C => ofReal (componentCouplingMass hL n x C zw.1 zw.2)), Fintype.sum_prod_type] have hr (z : Marks C) : (∑ w, ofReal (componentCouplingMass hL n x C z w)) = ofReal (alternativeMass hL n x C z) := by rw [← ENNReal.ofReal_sum_of_nonneg (fun w _ => componentCouplingMass_nonneg hL hhL n x C z w), componentCouplingMass_row_sum hL hhL] simp_rw [hr] rw [← ENNReal.ofReal_sum_of_nonneg (fun z _ => alternativeMass_nonneg hL hhL n x C z), alternativeMass_sum] exact ENNReal.ofReal_one
CausalSmith.Stat.PrivateCateRoughdesign.componentCouplingMass_paired_sum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentTransport.lean:131
theorem jointMarkMass_ofReal_prod Lemma jointMarkMass_ofReal_prod in the paper ↗

Converting the joint mass to an extended real preserves its component product. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
x :
z w :
Fin n → Bool × Bool
ofReal (jointMarkMass hL n x z w)
= ∏ C ∈ (orderedComponents hL n x).toFinset, ofReal (componentCouplingMass hL n x C (fun i => z i) (fun i => w i))
Proof (Lean source)
-- @node: jointMarkMass_ofReal_prod lemma jointMarkMass_ofReal_prod (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (x : Fin n → Covariate) (z w : Fin n → Bool × Bool) : ofReal (jointMarkMass hL n x z w) = ∏ C ∈ (orderedComponents hL n x).toFinset, ofReal (componentCouplingMass hL n x C (fun i => z i) (fun i => w i)) := by unfold jointMarkMass rw [← List.prod_toFinset _ (orderedComponents_nodup hL n x)] exact ENNReal.ofReal_prod_of_nonneg (fun C _ => componentCouplingMass_nonneg hL hhL n x C _ _)
CausalSmith.Stat.PrivateCateRoughdesign.jointMarkMass_ofReal_prod · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentTransport.lean:151
theorem jointMarkMass_component_observable Lemma jointMarkMass_component_observable in the paper ↗

Any component observable has its prescribed marginal under the full product coupling array. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
x :
C :
hC :
C ∈ orderedComponents hL n x
g :
Marks C × Marks C → ℝ≥0∞
(∑ zw : (Fin n → Bool × Bool) × (Fin n → Bool × Bool), ofReal (jointMarkMass hL n x zw.1 zw.2) * g (fun i => zw.1 i, fun i => zw.2 i))
= ∑ zw : Marks C × Marks C, ofReal (componentCouplingMass hL n x C zw.1 zw.2) * g zw
Proof (Lean source)
-- @node: jointMarkMass_component_observable lemma jointMarkMass_component_observable (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (x : Fin n → Covariate) (C : Finset (Fin n)) (hC : C ∈ orderedComponents hL n x) (g : Marks C × Marks C → ℝ≥0∞) : (∑ zw : (Fin n → Bool × Bool) × (Fin n → Bool × Bool), ofReal (jointMarkMass hL n x zw.1 zw.2) * g (fun i => zw.1 i, fun i => zw.2 i)) = ∑ zw : Marks C × Marks C, ofReal (componentCouplingMass hL n x C zw.1 zw.2) * g zw := by classical conv_lhs => rw [sum_pairedAssignments] conv_rhs => rw [sum_pairedAssignments] simp_rw [jointMarkMass_ofReal_prod hL hhL] apply sum_prod_partition_observable (α := (Bool × Bool) × (Bool × Bool)) (s := (orderedComponents hL n x).toFinset) (D := C) (F := fun D v => ofReal (componentCouplingMass hL n x D (fun i => (v i).1) (fun i => (v i).2))) (g := fun v => g (fun i => (v i).1, fun i => (v i).2)) · intro i obtain ⟨D, hD, hi⟩ := orderedComponents_cover hL n x i exact ⟨D, List.mem_toFinset.mpr hD, hi⟩ · intro D hD E hE hne exact orderedComponents_disjoint hL n x D E (List.mem_toFinset.mp hD) (List.mem_toFinset.mp hE) hne · intro D _ exact componentCouplingMass_paired_sum hL hhL n x D · exact List.mem_toFinset.mpr hC
CausalSmith.Stat.PrivateCateRoughdesign.jointMarkMass_component_observable · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentTransport.lean:162
theorem conditionalDatasetCoupling_hamming_cost_eq Lemma conditionalDatasetCoupling_hamming_cost_eq in the paper ↗

The conditional dataset coupling's expected Hamming cost is the sum of component costs. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
x :
(∫⁻ zw, (dHam n zw.1 zw.2 : ℝ≥0∞) ∂conditionalDatasetCoupling hL n x)
= ∑ C ∈ (orderedComponents hL n x).toFinset, ∫⁻ zw, (hammingDist zw.1 zw.2 : ℝ≥0∞) ∂componentCoupling hL n x C
Proof (Lean source)
-- @node: conditionalDatasetCoupling_hamming_cost_eq lemma conditionalDatasetCoupling_hamming_cost_eq (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (x : Fin n → Covariate) : (∫⁻ zw, (dHam n zw.1 zw.2 : ℝ≥0∞) ∂conditionalDatasetCoupling hL n x) = ∑ C ∈ (orderedComponents hL n x).toFinset, ∫⁻ zw, (hammingDist zw.1 zw.2 : ℝ≥0∞) ∂componentCoupling hL n x C := by classical have hd (z w : Fin n → Bool × Bool) : (dHam n (attachMarks n x z) (attachMarks n x w) : ℝ≥0∞) = ∑ C ∈ (orderedComponents hL n x).toFinset, (hammingDist (fun i : C => z i) (fun i : C => w i) : ℝ≥0∞) := by rw [attachMarks_hammingDist, hammingDist_orderedComponents hL n x] rw [← List.sum_toFinset _ (orderedComponents_nodup hL n x), Nat.cast_sum] simp only [conditionalDatasetCoupling, lintegral_finsetSum_measure, lintegral_smul_measure, lintegral_dirac, smul_eq_mul] simp_rw [hd, Finset.mul_sum] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro C hC rw [jointMarkMass_component_observable hL hhL n x C (List.mem_toFinset.mp hC) (fun zw => (hammingDist zw.1 zw.2 : ℝ≥0∞))] simp only [componentCoupling, lintegral_finsetSum_measure, lintegral_smul_measure, lintegral_dirac, smul_eq_mul]
CausalSmith.Stat.PrivateCateRoughdesign.conditionalDatasetCoupling_hamming_cost_eq · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentTransport.lean:192
theorem conditionalDatasetCoupling_hamming_cost_le_cubic_sum Lemma conditionalDatasetCoupling_hamming_cost_le_cubic_sum in the paper ↗

The product coupling costs at most the sum of the nonsingleton cubic certificates. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
x :
(∫⁻ zw, (dHam n zw.1 zw.2 : ℝ≥0∞) ∂conditionalDatasetCoupling hL n x)
≤ ∑ C ∈ (orderedComponents hL n x).toFinset, if C.card = 1 then 0 else ofReal (4*separation hL*(C.card : ℝ)^3)
Proof (Lean source)
-- @node: conditionalDatasetCoupling_hamming_cost_le_cubic_sum lemma conditionalDatasetCoupling_hamming_cost_le_cubic_sum (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (x : Fin n → Covariate) : (∫⁻ zw, (dHam n zw.1 zw.2 : ℝ≥0∞) ∂conditionalDatasetCoupling hL n x) ≤ ∑ C ∈ (orderedComponents hL n x).toFinset, if C.card = 1 then 0 else ofReal (4*separation hL*(C.card : ℝ)^3) := by classical rw [conditionalDatasetCoupling_hamming_cost_eq hL hhL] apply Finset.sum_le_sum intro C _ by_cases hc : C.card = 1 · rw [if_pos hc, componentCoupling_hamming_cost_zero_of_card_one hL hhL n x C hc] · rw [if_neg hc] exact componentCoupling_hamming_cost_le_cubic hL hhL n x C
CausalSmith.Stat.PrivateCateRoughdesign.conditionalDatasetCoupling_hamming_cost_le_cubic_sum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentTransport.lean:217
theorem measurable_datasetHammingCost Lemma measurable_datasetHammingCost in the paper ↗

Replacement Hamming cost is a Borel function of the two datasets. The displayed conclusion follows.

Formal statement
n :
ℕ
Measurable (fun zw : Dataset n × Dataset n => (dHam n zw.1 zw.2 : ℝ≥0∞))
Proof (Lean source)
-- @node: measurable_datasetHammingCost @[fun_prop] lemma measurable_datasetHammingCost (n : ℕ) : Measurable (fun zw : Dataset n × Dataset n => (dHam n zw.1 zw.2 : ℝ≥0∞)) := by classical simp only [dHam, hammingDist, Finset.card_eq_sum_ones, Finset.sum_filter, Nat.cast_sum, Nat.cast_ite, Nat.cast_one, Nat.cast_zero] apply Finset.measurable_sum intro i _ apply Measurable.ite · exact (measurableSet_eq_fun ((measurable_pi_apply i).comp measurable_fst) ((measurable_pi_apply i).comp measurable_snd)).compl · exact measurable_const · exact measurable_const
CausalSmith.Stat.PrivateCateRoughdesign.measurable_datasetHammingCost · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentTransport.lean:233
theorem commonMassCoupling_hamming_cost_eq

Integrating the Borel conditional kernel preserves the exact additive transport cost. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
(∫⁻ zw, (dHam n zw.1 zw.2 : ℝ≥0∞) ∂commonMassCoupling hL n)
= ∫⁻ x, ∑ C ∈ (orderedComponents hL n x).toFinset, ∫⁻ zw, (hammingDist zw.1 zw.2 : ℝ≥0∞) ∂componentCoupling hL n x C ∂(Measure.pi (fun _ : Fin n => (volume : Measure Covariate)))
Proof (Lean source)
-- @node: commonMassCoupling_hamming_cost_eq lemma commonMassCoupling_hamming_cost_eq (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) : (∫⁻ zw, (dHam n zw.1 zw.2 : ℝ≥0∞) ∂commonMassCoupling hL n) = ∫⁻ x, ∑ C ∈ (orderedComponents hL n x).toFinset, ∫⁻ zw, (hammingDist zw.1 zw.2 : ℝ≥0∞) ∂componentCoupling hL n x C ∂(Measure.pi (fun _ : Fin n => (volume : Measure Covariate))) := by rw [commonMassCoupling, Measure.lintegral_bind (measurable_conditionalDatasetCoupling hL n).aemeasurable (measurable_datasetHammingCost n).aemeasurable] apply lintegral_congr intro x exact conditionalDatasetCoupling_hamming_cost_eq hL hhL n x
CausalSmith.Stat.PrivateCateRoughdesign.commonMassCoupling_hamming_cost_eq · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentTransport.lean:248
theorem commonMassCoupling_hamming_cost_le_cubic_sum

The integrated dataset cost is bounded by the expected nonsingleton cubic component sum. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
(∫⁻ zw, (dHam n zw.1 zw.2 : ℝ≥0∞) ∂commonMassCoupling hL n)
≤ ∫⁻ x, ∑ C ∈ (orderedComponents hL n x).toFinset, if C.card = 1 then 0 else ofReal (4*separation hL*(C.card : ℝ)^3) ∂(Measure.pi (fun _ : Fin n => (volume : Measure Covariate)))
Proof (Lean source)
-- @node: commonMassCoupling_hamming_cost_le_cubic_sum lemma commonMassCoupling_hamming_cost_le_cubic_sum (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) : (∫⁻ zw, (dHam n zw.1 zw.2 : ℝ≥0∞) ∂commonMassCoupling hL n) ≤ ∫⁻ x, ∑ C ∈ (orderedComponents hL n x).toFinset, if C.card = 1 then 0 else ofReal (4*separation hL*(C.card : ℝ)^3) ∂(Measure.pi (fun _ : Fin n => (volume : Measure Covariate))) := by rw [commonMassCoupling, Measure.lintegral_bind (measurable_conditionalDatasetCoupling hL n).aemeasurable (measurable_datasetHammingCost n).aemeasurable] exact lintegral_mono (fun x => conditionalDatasetCoupling_hamming_cost_le_cubic_sum hL hhL n x)
CausalSmith.Stat.PrivateCateRoughdesign.commonMassCoupling_hamming_cost_le_cubic_sum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ComponentTransport.lean:263
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.Construction 54 declarations Public cells, count-weighted pair statistics and the single Laplace release; scalar, interval, dyadic tuning and inversion postprocessings are defined concretely.

Public cells, count-weighted pair statistics and the single Laplace release; scalar, interval, dyadic tuning and inversion postprocessings are defined concretely.

def cellWidth

The equal cell width is twice the public radius divided by the public cell count.

Definition (Lean source)
h :
ℝ
shared
k :
ℕ
shared
cellWidth h k :
ℝ
2*h/k
def cell

Public cells partition the localization window with left endpoints included and only the final right endpoint included.

Definition (Lean source)
h :
ℝ
shared
k :
ℕ
shared
j :
Fin k
cell h k j :
{x | (x0 : ℝ) - h + j.val * cellWidth h k ≤ (x : ℝ) ∧ ((x : ℝ) < (x0 : ℝ) - h + (j.val+1) * cellWidth h k ∨ (j.val+1 = k ∧ (x : ℝ) = (x0 : ℝ) + h))}
def cellRecords

A cell selects the dataset indices whose covariates belong to that public cell.

Definition (Lean source)
n :
ℕ
shared
h :
ℝ
shared
k :
ℕ
shared
D :
j :
Fin k
cellRecords n h k D j :
Finset.univ.filter (fun i => (D i).1 ∈ cell h k j)
def cellCount

Cell occupancy is the cardinality of the selected dataset indices.

Definition (Lean source)
n :
ℕ
shared
h :
ℝ
shared
k :
ℕ
shared
D :
j :
Fin k
cellCount n h k D j :
ℕ
(cellRecords n h k D j).card
def KN

The numerator pair kernel multiplies treatment difference by outcome difference.

Definition (Lean source)
z z' :
O
KN z z' :
ℝ
(bit z.2.1 - bit z'.2.1) * (bit z.2.2 - bit z'.2.2)
def KD

The denominator pair kernel squares the treatment difference.

Definition (Lean source)
z z' :
O
KD z z' :
ℝ
(bit z.2.1 - bit z'.2.1)^2
def pairContribution

The count-weighted pair sum is zero below occupancy two, and otherwise weights the sum over unordered pairs by occupancy divided by the number of pairs.

Definition (Lean source)
s :
ℕ
K :
O → O → ℝ
z :
Fin s → O
pairContribution K z :
ℝ
if s < 2 then 0 else (s : ℝ) / choose s 2 * ∑ i : Fin s, ∑ l : Fin s, if i < l then K (z i) (z l) else 0
def cellSum

A cell moment sum adds a record function across the selected dataset indices.

Definition (Lean source)
n :
ℕ
shared
h :
ℝ
shared
k :
ℕ
shared
D :
j :
Fin k
v :
O → ℝ
cellSum n h k D j v :
ℝ
∑ i ∈ cellRecords n h k D j, v (D i)
def numeratorCell

The numerator cell contribution uses the displayed closed treatment-outcome moment formula, with zero below occupancy two.

Definition (Lean source)
n :
ℕ
shared
h :
ℝ
shared
k :
ℕ
shared
D :
j :
Fin k
numeratorCell n h k D j :
ℝ
s :
cellCount n h k D j
if s < 2 then 0 else 2 * ((s : ℝ) * cellSum n h k D j (fun z => bit z.2.1 * bit z.2.2) - cellSum n h k D j (fun z => bit z.2.1) * cellSum n h k D j (fun z => bit z.2.2)) / ((s : ℝ) - 1)
def denominatorCell

The denominator cell contribution uses the displayed closed treatment moment formula, with zero below occupancy two.

Definition (Lean source)
n :
ℕ
shared
h :
ℝ
shared
k :
ℕ
shared
D :
j :
Fin k
denominatorCell n h k D j :
ℝ
s :
cellCount n h k D j
a :
cellSum n h k D j (fun z => bit z.2.1)
if s < 2 then 0 else 2 * ((s : ℝ) * a - a^2) / ((s : ℝ) - 1)
def SN

The numerator statistic sums the closed cell contributions.

Definition (Lean source)
n :
ℕ
shared
h :
ℝ
shared
k :
ℕ
shared
D :
SN n h k D :
ℝ
∑ j : Fin k, numeratorCell n h k D j
def SD

The denominator statistic sums the closed cell contributions.

Definition (Lean source)
n :
ℕ
shared
h :
ℝ
shared
k :
ℕ
shared
D :
SD n h k D :
ℝ
∑ j : Fin k, denominatorCell n h k D j

The sum of pairwise difference products equals the centered finite cross moment. The displayed conclusion follows.

Formal statement
s :
ℕ
a b :
Fin s → ℝ
(∑ i : Fin s, ∑ j : Fin s, if i < j then (a i-a j)*(b i-b j) else 0)
= (s : ℝ) * ∑ i, a i*b i - (∑ i, a i)*(∑ i, b i)
Proof (Lean source)
-- @node: pair_difference_sum lemma pair_difference_sum (s : ℕ) (a b : Fin s → ℝ) : (∑ i : Fin s, ∑ j : Fin s, if i < j then (a i-a j)*(b i-b j) else 0) = (s : ℝ) * ∑ i, a i*b i - (∑ i, a i)*(∑ i, b i) := by classical let K := fun i j => (a i-a j)*(b i-b j) have hsymm : ∀ i j, K i j = K j i := by intros; dsimp [K]; ring have hsplit : ∀ i j, K i j = (if i < j then K i j else 0) + (if j < i then K i j else 0) := by intro i j rcases lt_trichotomy i j with hij | hij | hij · simp [hij, not_lt.mpr hij.le] · subst j; simp [K] · simp [hij, not_lt.mpr hij.le] have htwice : (∑ i : Fin s, ∑ j : Fin s, K i j) = 2 * ∑ i : Fin s, ∑ j : Fin s, if i < j then K i j else 0 := by calc _ = ∑ i : Fin s, ∑ j : Fin s, ((if i < j then K i j else 0) + (if j < i then K i j else 0)) := by apply Finset.sum_congr rfl intro i hi apply Finset.sum_congr rfl intro j hj exact hsplit i j _ = _ := by simp only [Finset.sum_add_distrib] rw [Finset.sum_comm (f := fun i j => if j < i then K i j else 0)] conv_lhs => rhs; arg 2; ext i; arg 2; ext j; rw [hsymm j i] ring have hfull : (∑ i : Fin s, ∑ j : Fin s, K i j) = 2 * ((s : ℝ) * ∑ i, a i*b i - (∑ i, a i)*(∑ i, b i)) := by dsimp [K] simp_rw [sub_mul, mul_sub, Finset.sum_sub_distrib] simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul, ← Finset.mul_sum, ← Finset.sum_mul] ring dsimp [K] at htwice linarith
CausalSmith.Stat.PrivateCateRoughdesign.pair_difference_sum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Construction.lean:81

The pair kernels give the displayed count-weighted moment formulas, including s < 2. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
s :
ℕ
z :
Fin s → O
conclusion 1
pairContribution KN z
= (if s < 2 then 0 else 2 * ((s : ℝ) * ∑ i, bit (z i).2.1 * bit (z i).2.2 - (∑ i, bit (z i).2.1) * (∑ i, bit (z i).2.2)) / ((s : ℝ) - 1))
conclusion 2
pairContribution KD z
= (if s < 2 then 0 else 2 * ((s : ℝ) * ∑ i, bit (z i).2.1 - (∑ i, bit (z i).2.1)^2) / ((s : ℝ) - 1))
Proof (Lean source)
-- @node: pair_moment_formulas lemma pair_moment_formulas (s : ℕ) (z : Fin s → O) : pairContribution KN z = (if s < 2 then 0 else 2 * ((s : ℝ) * ∑ i, bit (z i).2.1 * bit (z i).2.2 - (∑ i, bit (z i).2.1) * (∑ i, bit (z i).2.2)) / ((s : ℝ) - 1)) ∧ pairContribution KD z = (if s < 2 then 0 else 2 * ((s : ℝ) * ∑ i, bit (z i).2.1 - (∑ i, bit (z i).2.1)^2) / ((s : ℝ) - 1)) := by classical by_cases hs : s < 2 · simp [pairContribution, hs] have hs0 : (s : ℝ) ≠ 0 := by have : 0 < s := by omega exact_mod_cast this.ne' have hs1 : (s : ℝ) - 1 ≠ 0 := by have : (2 : ℝ) ≤ s := by exact_mod_cast (show 2 ≤ s by omega) linarith have hN := pair_difference_sum s (fun i => bit (z i).2.1) (fun i => bit (z i).2.2) have hD := pair_difference_sum s (fun i => bit (z i).2.1) (fun i => bit (z i).2.1) have hbit : ∀ a : Bool, bit a * bit a = bit a := by intro a; cases a <;> norm_num [bit] simp only [hbit] at hD constructor · simp only [pairContribution, hs, if_false, KN] rw [hN, Nat.cast_choose_two ℝ] field_simp [hs0, hs1] <;> ring · simp only [pairContribution, hs, if_false, KD, pow_two] rw [hD, Nat.cast_choose_two ℝ] field_simp [hs0, hs1] <;> ring
CausalSmith.Stat.PrivateCateRoughdesign.pair_moment_formulas · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Construction.lean:121

Each public cell is a Borel covariate set, including the final endpoint. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
h :
ℝ
shared
k :
ℕ
shared
j :
Fin k
MeasurableSet (cell h k j)
Proof (Lean source)
-- @node: measurableSet_cell lemma measurableSet_cell (j : Fin k) : MeasurableSet (cell h k j) := by unfold cell measurability
CausalSmith.Stat.PrivateCateRoughdesign.measurableSet_cell · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Construction.lean:153

Counting cell members is measurable on the full dataset space. The displayed conclusion follows.

Formal statement
n :
ℕ
shared
h :
ℝ
shared
k :
ℕ
shared
j :
Fin k
Measurable (fun D => cellCount n h k D j)
Proof (Lean source)
-- @node: measurable_cellCount @[fun_prop] lemma measurable_cellCount (j : Fin k) : Measurable (fun D => cellCount n h k D j) := by classical have heq : (fun D => cellCount n h k D j) = (fun D => ∑ i : Fin n, if (D i).1 ∈ cell h k j then (1 : ℕ) else 0) := by funext D simp [cellCount, cellRecords, Finset.sum_boole] rw [heq] apply Finset.measurable_fun_sum intro i hi exact measurable_const.ite ((measurableSet_cell h k j).preimage (by fun_prop)) measurable_const
CausalSmith.Stat.PrivateCateRoughdesign.measurable_cellCount · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Construction.lean:159

Summing a measurable record function over a public cell is measurable. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
n :
ℕ
shared
h :
ℝ
shared
k :
ℕ
shared
j :
Fin k
v :
O → ℝ
hv :
Measurable (fun D => cellSum n h k D j v)
Proof (Lean source)
-- @node: measurable_cellSum @[fun_prop] lemma measurable_cellSum (j : Fin k) (v : O → ℝ) (hv : Measurable v) : Measurable (fun D => cellSum n h k D j v) := by classical simp only [cellSum, cellRecords, Finset.sum_filter] apply Finset.measurable_fun_sum intro i hi exact (hv.comp (measurable_pi_apply i)).ite ((measurableSet_cell h k j).preimage (by fun_prop)) measurable_const
CausalSmith.Stat.PrivateCateRoughdesign.measurable_cellSum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Construction.lean:173
theorem measurable_bit

Numerically encoding a binary mark is measurable. The displayed conclusion follows.

Formal statement
Proof (Lean source)
@[fun_prop] lemma measurable_bit : Measurable bit := by fun_prop
theorem measurable_numeratorCell Lemma measurable_numeratorCell in the paper ↗

Each closed numerator cell contribution is measurable, including occupancies zero and one. The displayed conclusion follows.

Formal statement
n :
ℕ
shared
h :
ℝ
shared
k :
ℕ
shared
j :
Fin k
Measurable (fun D => numeratorCell n h k D j)
Proof (Lean source)
-- @node: measurable_numeratorCell @[fun_prop] lemma measurable_numeratorCell (j : Fin k) : Measurable (fun D => numeratorCell n h k D j) := by unfold numeratorCell dsimp only refine measurable_const.ite (measurableSet_lt (measurable_cellCount n h k j) measurable_const) ?_ fun_prop
CausalSmith.Stat.PrivateCateRoughdesign.measurable_numeratorCell · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Construction.lean:188
theorem measurable_denominatorCell Lemma measurable_denominatorCell in the paper ↗

Each closed denominator cell contribution is measurable, including occupancies zero and one. The displayed conclusion follows.

Formal statement
n :
ℕ
shared
h :
ℝ
shared
k :
ℕ
shared
j :
Fin k
Measurable (fun D => denominatorCell n h k D j)
Proof (Lean source)
-- @node: measurable_denominatorCell @[fun_prop] lemma measurable_denominatorCell (j : Fin k) : Measurable (fun D => denominatorCell n h k D j) := by unfold denominatorCell dsimp only refine measurable_const.ite (measurableSet_lt (measurable_cellCount n h k j) measurable_const) ?_ fun_prop
CausalSmith.Stat.PrivateCateRoughdesign.measurable_denominatorCell · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Construction.lean:197

The numerator statistic is measurable. The displayed conclusion follows.

Formal statement
n :
ℕ
shared
h :
ℝ
shared
k :
ℕ
shared
Measurable (SN n h k)
Proof (Lean source)
-- @node: measurable_SN @[fun_prop] lemma measurable_SN : Measurable (SN n h k) := by unfold SN fun_prop

The denominator statistic is measurable. The displayed conclusion follows.

Formal statement
n :
ℕ
shared
h :
ℝ
shared
k :
ℕ
shared
Measurable (SD n h k)
Proof (Lean source)
-- @node: measurable_SD @[fun_prop] lemma measurable_SD : Measurable (SD n h k) := by unfold SD fun_prop
def info

The public occupancy scale is sample size times radius times the truncated expected cell occupancy.

Definition (Lean source)
n :
ℕ
shared
h :
ℝ
shared
k :
ℕ
shared
info n h k :
ℝ
n*h*min 1 (n*cellWidth h k)
def d0

The public denominator floor is three sixty-fourths of the occupancy scale.

Definition (Lean source)
n :
ℕ
shared
h :
ℝ
shared
k :
ℕ
shared
d0 n h k :
ℝ
3*info n h k/64
def bias

The public bias envelope retains the localization and rough-nuisance cell terms.

Definition (Lean source)
h :
ℝ
shared
k :
ℕ
shared
bias h k :
ℝ
3*h + 24*(cellWidth h k)^(1/5 : ℝ)

The public squared-error envelope retains localization, cell bias, occupancy and the Laplace second-moment terms with the specified multiplier.

Definition (Lean source)
n :
ℕ
shared
epsilon :
ℝ
shared
h :
ℝ
shared
k :
ℕ
shared
Vbound n epsilon h k :
ℝ
2^20 * (h^2 + (cellWidth h k)^(2/5 : ℝ) + (info n h k)⁻¹ + (epsilon*info n h k)^(-2 : ℤ))
def pairQuery

The joint query consists of the numerator and denominator statistics.

Definition (Lean source)
n :
ℕ
shared
h :
ℝ
shared
k :
ℕ
shared
D :
pairQuery n h k D :
Fin 2 → ℝ
![SN n h k D, SD n h k D]

Both coordinates of the joint query are measurable functions of the dataset. The displayed conclusion follows.

Formal statement
n :
ℕ
shared
h :
ℝ
shared
k :
ℕ
shared
Proof (Lean source)
-- @node: measurable_pairQuery @[fun_prop] lemma measurable_pairQuery : Measurable (pairQuery n h k) := by unfold pairQuery fun_prop
CausalSmith.Stat.PrivateCateRoughdesign.measurable_pairQuery · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Construction.lean:239

The joint Laplace release is measurable. The displayed conclusion follows.

Formal statement
n :
ℕ
shared
epsilon :
ℝ
shared
h :
ℝ
shared
k :
ℕ
shared
Measurable (laplaceMechPi (12/epsilon) (pairQuery n h k))
Proof (Lean source)
-- @node: measurable_pairRelease @[fun_prop] lemma measurable_pairRelease : Measurable (Causalean.Stat.Privacy.laplaceMechPi (12/epsilon) (pairQuery n h k)) := by classical letI : SigmaFinite (Causalean.Stat.Privacy.laplaceMeasure (12/epsilon)) := by unfold Causalean.Stat.Privacy.laplaceMeasure infer_instance unfold Causalean.Stat.Privacy.laplaceMechPi apply Measure.measurable_of_measurable_coe intro E hE have hshift : Measurable (fun p : Dataset n × (Fin 2 → ℝ) => p.2 + pairQuery n h k p.1) := by fun_prop have hm : Measurable (fun p : Dataset n × (Fin 2 → ℝ) => E.indicator (fun _ => (1 : ℝ≥0∞)) (p.2 + pairQuery n h k p.1)) := (measurable_const.indicator hE).comp hshift have hmeas := hm.lintegral_prod_right' (ν := Measure.pi (fun _ : Fin 2 => Causalean.Stat.Privacy.laplaceMeasure (12/epsilon))) convert hmeas using 1 funext D rw [Measure.map_apply (by fun_prop) hE] simpa only [indicator, preimage, Set.mem_setOf_eq, Pi.one_apply] using (lintegral_indicator_one (μ := Measure.pi (fun _ : Fin 2 => Causalean.Stat.Privacy.laplaceMeasure (12/epsilon))) (hE.preimage (show Measurable (fun z : Fin 2 → ℝ => z + pairQuery n h k D) by fun_prop))).symm
CausalSmith.Stat.PrivateCateRoughdesign.measurable_pairRelease · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Construction.lean:244

The single joint Laplace release adds the specified independent noise to the two count- weighted statistics.

Definition (Lean source)
n :
ℕ
shared
epsilon :
ℝ
shared
h :
ℝ
shared
k :
ℕ
shared
privateRatioRelease n epsilon h k :
Kernel (Dataset n) (Fin 2 → ℝ)
clause 1
toFun := laplaceMechPi (12/epsilon) (pairQuery n h k)
clause 2
measurable' := measurable_pairRelease n epsilon h k
CausalSmith.Stat.PrivateCateRoughdesign.privateRatioRelease · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Construction.lean:273
def clip

Clipping truncates a real number to the specified lower and upper endpoints.

Definition (Lean source)
l u z :
ℝ
clip l u z :
ℝ
max l (min u z)
def ratioMap

The scalar postprocessing floors the noisy denominator and clips the ratio to the target range.

Definition (Lean source)
n :
ℕ
shared
h :
ℝ
shared
k :
ℕ
shared
v :
Fin 2 → ℝ
ratioMap n h k v :
ℝ
clip (-1) 1 (v 0 / max (d0 n h k) (v 1))
def closedInterval

Finite closed endpoints give an interval code with both endpoints included.

Definition (Lean source)
l u :
ℝ
closedInterval l u :
.inr (l,u,true,true)
def intervalMap

The conservative interval centers the public radius at the clipped ratio and truncates it to the target range.

Definition (Lean source)
n :
ℕ
shared
epsilon :
ℝ
shared
h :
ℝ
shared
k :
ℕ
shared
v :
Fin 2 → ℝ
intervalMap n epsilon h k v :
closedInterval (max (-1) (ratioMap n h k v - sqrt (10*Vbound n epsilon h k))) (min 1 (ratioMap n h k v + sqrt (10*Vbound n epsilon h k)))

The floored clipped ratio is measurable. The displayed conclusion follows.

Formal statement
n :
ℕ
shared
h :
ℝ
shared
k :
ℕ
shared
Proof (Lean source)
-- @node: measurable_ratioMap @[fun_prop] lemma measurable_ratioMap : Measurable (ratioMap n h k) := by unfold ratioMap clip fun_prop
CausalSmith.Stat.PrivateCateRoughdesign.measurable_ratioMap · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Construction.lean:297

The conservative interval postprocessing is measurable. The displayed conclusion follows.

Formal statement
n :
ℕ
shared
epsilon :
ℝ
shared
h :
ℝ
shared
k :
ℕ
shared
Measurable (intervalMap n epsilon h k)
Proof (Lean source)
-- @node: measurable_intervalMap @[fun_prop] lemma measurable_intervalMap : Measurable (intervalMap n epsilon h k) := by unfold intervalMap closedInterval fun_prop
CausalSmith.Stat.PrivateCateRoughdesign.measurable_intervalMap · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Construction.lean:302

The scalar release is measurable postprocessing of the single joint noisy release.

Definition (Lean source)
n :
ℕ
shared
epsilon :
ℝ
shared
h :
ℝ
shared
k :
ℕ
shared
Thk n epsilon h k :
Kernel (Dataset n) ℝ

The interval release is measurable postprocessing of that same single joint noisy release.

Definition (Lean source)
n :
ℕ
shared
epsilon :
ℝ
shared
h :
ℝ
shared
k :
ℕ
shared
Ihk n epsilon h k :
(privateRatioRelease n epsilon h k).mapOfMeasurable (intervalMap n epsilon h k) (measurable_intervalMap n epsilon h k)

The numerical benchmark is the truncated maximum of the sampling, sparse-privacy and dense- privacy terms.

Definition (Lean source)
n :
ℕ
shared
epsilon :
ℝ
shared
rate n epsilon :
ℝ
min 1 (max ((n : ℝ)^(-1/4 : ℝ)) (max (((n : ℝ)^2*epsilon)^(-1/7 : ℝ)) (((n : ℝ)*epsilon)^(-1/2 : ℝ))))
def tunedH

The public radius is the specified dyadic rounding of the benchmark scale.

Definition (Lean source)
n :
ℕ
shared
epsilon :
ℝ
shared
tunedH n epsilon :
ℝ
(2 : ℝ)^(-ceil (Real.logb 2 (1/rate n epsilon)))
def tunedK

The public integer cell count is twice the inverse fourth power of the dyadic radius.

Definition (Lean source)
n :
ℕ
shared
epsilon :
ℝ
shared
tunedK n epsilon :
ℕ
⌊2*(tunedH n epsilon)^(-4 : ℤ)⌋₊
theorem rate_pos

The benchmark is strictly positive at every positive sample size. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
shared
epsilon :
ℝ
shared
hn :
0 < n
0 < rate n epsilon
Proof (Lean source)
-- @node: rate_pos lemma rate_pos (hn : 0 < n) : 0 < rate n epsilon := by have hn' : 0 < (n : ℝ) := Nat.cast_pos.mpr hn unfold rate exact lt_min zero_lt_one (lt_max_of_lt_left (Real.rpow_pos_of_pos hn' _))
theorem tunedH_bounds

Dyadic rounding brackets the benchmark between the radius and twice the radius. the theorem's stated inputs and assumptions, and the asserted conclusion follows.

Formal statement
n :
ℕ
shared
epsilon :
ℝ
shared
hn :
0 < n
conclusion 1
0 < tunedH n epsilon
conclusion 2
rate n epsilon / 2 ≤ tunedH n epsilon
conclusion 3
tunedH n epsilon ≤ rate n epsilon
Proof (Lean source)
-- @node: tunedH_bounds lemma tunedH_bounds (hn : 0 < n) : 0 < tunedH n epsilon ∧ rate n epsilon / 2 ≤ tunedH n epsilon ∧ tunedH n epsilon ≤ rate n epsilon := by have hr := rate_pos n epsilon hn let c := ceil (Real.logb 2 (1 / rate n epsilon)) have hc : Real.logb 2 (1 / rate n epsilon) ≤ (c : ℝ) := Int.le_ceil _ have hc' : (c : ℝ) ≤ Real.logb 2 (1 / rate n epsilon) + 1 := le_of_lt (Int.ceil_lt_add_one _) have hp : 0 < (2 : ℝ) ^ c := zpow_pos (by norm_num) _ have hl : 1 / rate n epsilon ≤ (2 : ℝ) ^ c := by rw [← Real.rpow_intCast] exact (Real.logb_le_iff_le_rpow (by norm_num) (by positivity)).mp hc have hu : (2 : ℝ) ^ c ≤ 2 / rate n epsilon := by rw [← Real.rpow_intCast] calc (2 : ℝ) ^ (c : ℝ) ≤ 2 ^ (Real.logb 2 (1 / rate n epsilon) + 1) := Real.rpow_le_rpow_of_exponent_le (by norm_num) hc' _ = 2 / rate n epsilon := by rw [Real.rpow_add (by norm_num), Real.rpow_logb (by norm_num) (by norm_num) (by positivity), Real.rpow_one] ring change 0 < (2 : ℝ) ^ (-c) ∧ rate n epsilon / 2 ≤ (2 : ℝ) ^ (-c) ∧ (2 : ℝ) ^ (-c) ≤ rate n epsilon rw [zpow_neg] refine ⟨inv_pos.mpr hp, ?_, ?_⟩ · rw [← one_div] apply (le_div_iff₀ hp).mpr have hu' := (le_div_iff₀ hr).mp hu nlinarith · apply (inv_le_iff_one_le_mul₀ hp).mpr have hl' := (div_le_iff₀ hr).mp hl nlinarith
theorem public_tuning_parameters

The integer conversion is exact on the dyadic branch; its radius, cell count and cell width obey the public construction constraints. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
shared
epsilon :
ℝ
shared
hn :
2 ≤ n
he :
0 < epsilon ∧ epsilon ≤ 1
hr :
rate n epsilon < 1 / 8
conclusion 1
0 < tunedH n epsilon
conclusion 2
tunedH n epsilon ≤ 1 / 4
conclusion 3
2 ≤ tunedK n epsilon
conclusion 4
(tunedK n epsilon : ℝ) = 2*(tunedH n epsilon)^(-4 : ℤ)
conclusion 5
cellWidth (tunedH n epsilon) (tunedK n epsilon) = (tunedH n epsilon)^5
Proof (Lean source)
-- @node: public_tuning_parameters lemma public_tuning_parameters (hn : 2 ≤ n) (he : 0 < epsilon ∧ epsilon ≤ 1) (hr : rate n epsilon < 1 / 8) : 0 < tunedH n epsilon ∧ tunedH n epsilon ≤ 1 / 4 ∧ 2 ≤ tunedK n epsilon ∧ (tunedK n epsilon : ℝ) = 2*(tunedH n epsilon)^(-4 : ℤ) ∧ cellWidth (tunedH n epsilon) (tunedK n epsilon) = (tunedH n epsilon)^5 := by have hb := tunedH_bounds n epsilon (by omega) let c := ceil (Real.logb 2 (1 / rate n epsilon)) have hc : 0 ≤ c := by apply Int.ceil_nonneg apply Real.logb_nonneg (by norm_num) apply (le_div_iff₀ (rate_pos n epsilon (by omega))).mpr linarith have hex : 2 * (tunedH n epsilon) ^ (-4 : ℤ) = ((2 * 2 ^ (c.toNat * 4) : ℕ) : ℝ) := by unfold tunedH change 2 * ((2 : ℝ) ^ (-c)) ^ (-4 : ℤ) = _ rw [← zpow_mul] have hm : -c * (-4 : ℤ) = ((c.toNat * 4 : ℕ) : ℤ) := by rw [Nat.cast_mul, Int.toNat_of_nonneg hc] ring rw [hm, zpow_natCast] push_cast rfl have hk : tunedK n epsilon = 2 * 2 ^ (c.toNat * 4) := by unfold tunedK rw [hex, Nat.floor_natCast] have hkcast : (tunedK n epsilon : ℝ) = 2*(tunedH n epsilon)^(-4 : ℤ) := by rw [hk, ← hex] refine ⟨hb.1, by linarith [hb.2.2], ?_, hkcast, ?_⟩ · rw [hk] have hp : 1 ≤ (2 : ℕ) ^ (c.toNat * 4) := Nat.one_le_pow _ _ (by omega) omega · unfold cellWidth rw [hkcast] rw [zpow_neg, zpow_ofNat] field_simp <;> ring
CausalSmith.Stat.PrivateCateRoughdesign.public_tuning_parameters · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Construction.lean:373

Public tuning returns zero in the constant branch and otherwise uses the specified dyadic pair-ratio release.

Definition (Lean source)
n :
ℕ
shared
epsilon :
ℝ
shared
publicTunedRelease n epsilon :
Kernel (Dataset n) ℝ
if 1/8
≤ rate n epsilon then Kernel.const _ (Measure.dirac 0) else Thk n epsilon (tunedH n epsilon) (tunedK n epsilon)
CausalSmith.Stat.PrivateCateRoughdesign.publicTunedRelease · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Construction.lean:416

Public tuning returns the entire target range in the constant branch and otherwise uses the conservative pair-ratio interval.

Definition (Lean source)
n :
ℕ
shared
epsilon :
ℝ
shared
publicTunedInterval n epsilon :
if 1/8
≤ rate n epsilon then Kernel.const _ (Measure.dirac (closedInterval (-1) 1)) else Ihk n epsilon (tunedH n epsilon) (tunedK n epsilon)
CausalSmith.Stat.PrivateCateRoughdesign.publicTunedInterval · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Construction.lean:423
def cellMass

The population cell mass is the real measure of the cell under the design marginal.

Definition (Lean source)
h :
ℝ
shared
k :
ℕ
shared
P :
j :
Fin k
cellMass h k P j :
ℝ
(PX P).real (cell h k j)
def occupancyWeight

The population weight is expected occupancy multiplied by the probability of another record in the same cell.

Definition (Lean source)
n :
ℕ
shared
h :
ℝ
shared
k :
ℕ
shared
P :
j :
Fin k
occupancyWeight n h k P j :
ℝ
n*cellMass h k P j * (1-(1-cellMass h k P j)^(n-1))
def Wocc

The total occupancy weight sums the population cell weights.

Definition (Lean source)
n :
ℕ
shared
h :
ℝ
shared
k :
ℕ
shared
P :
Wocc n h k P :
ℝ
∑ j : Fin k, occupancyWeight n h k P j
def conditionalCellLaw

The conditional record law is the observed marginal restricted to the cell and normalized by its mass.

Definition (Lean source)
h :
ℝ
shared
k :
ℕ
shared
P :
j :
Fin k
conditionalCellLaw h k P j :
((Pobs P) {z | z.1 ∈ cell h k j})⁻¹ • (Pobs P).restrict {z | z.1 ∈ cell h k j}
CausalSmith.Stat.PrivateCateRoughdesign.conditionalCellLaw · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Construction.lean:444
def nu

The conditional numerator moment integrates the pair kernel under two independent draws from the conditional cell law.

Definition (Lean source)
h :
ℝ
shared
k :
ℕ
shared
P :
j :
Fin k
nu h k P j :
ℝ
∫ zz, KN zz.1 zz.2 ∂((conditionalCellLaw h k P j).prod (conditionalCellLaw h k P j))
def dj

The conditional denominator moment integrates its pair kernel under those independent draws.

Definition (Lean source)
h :
ℝ
shared
k :
ℕ
shared
P :
j :
Fin k
dj h k P j :
ℝ
∫ zz, KD zz.1 zz.2 ∂((conditionalCellLaw h k P j).prod (conditionalCellLaw h k P j))
def Nbar

The population numerator is the expectation of the count-weighted numerator under the dataset law.

Definition (Lean source)
n :
ℕ
shared
h :
ℝ
shared
k :
ℕ
shared
Q :
Nbar n h k Q :
ℝ
∫ D, SN n h k D ∂Q
def Dbar

The population denominator is the expectation of the count-weighted denominator under the dataset law.

Definition (Lean source)
n :
ℕ
shared
h :
ℝ
shared
k :
ℕ
shared
Q :
Dbar n h k Q :
ℝ
∫ D, SD n h k D ∂Q
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.CosineCertificate 24 declarations Assembly of complete sign-family membership and the fixed-sample chi-square certificate.

Assembly of complete sign-family membership and the fixed-sample chi-square certificate.

The micro radius is positive and no larger than the macro radius. the asserted conclusion follows.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
conclusion 1
0 < deltaL hL
conclusion 2
deltaL hL ≤ hL
Proof (Lean source)
-- @node: deltaL_pos_le_macro lemma deltaL_pos_le_macro : 0 < deltaL hL ∧ deltaL hL ≤ hL := by have hp : 0 < hL^5 := pow_pos hhL.1 5 have h1 : hL ≤ 1 := hhL.2.trans (by norm_num) have h4 : hL^4 ≤ 1 := pow_le_one₀ (le_of_lt hhL.1) h1 constructor · exact hp · dsimp [deltaL] calc hL^5 = hL * hL^4 := by ring _ ≤ hL * 1 := mul_le_mul_of_nonneg_left h4 (le_of_lt hhL.1) _ = hL := mul_one _
theorem activeSigns_subset_endpoint_interval Lemma activeSigns_subset_endpoint_interval in the paper ↗

Active centers lie in the integer interval between the two macro endpoint roundings. the asserted conclusion follows.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
activeSigns hL ⊆ Icc ⌊(x0-hL)/deltaL hL⌋ ⌈(x0+hL)/deltaL hL⌉
Proof (Lean source)
-- @node: activeSigns_subset_endpoint_interval lemma activeSigns_subset_endpoint_interval : activeSigns hL ⊆ Icc ⌊(x0-hL)/deltaL hL⌋ ⌈(x0+hL)/deltaL hL⌉ := by intro j hj have hd := (deltaL_pos_le_macro hL hhL).1 have hm := (mem_activeSigns hL hhL j).mp hj have hl : (x0-hL)/deltaL hL < (j : ℝ)+1 := by apply (div_lt_iff₀ hd).mpr nlinarith [hm.2] have hu : (j : ℝ)-1 < (x0+hL)/deltaL hL := by apply (lt_div_iff₀ hd).mpr nlinarith [hm.1] have hf := Int.floor_le ((x0-hL)/deltaL hL) have hc := Int.le_ceil ((x0+hL)/deltaL hL) have hf' : ⌊(x0-hL)/deltaL hL⌋ < j+1 := by exact_mod_cast (hf.trans_lt hl) have hc' : j-1 < ⌈(x0+hL)/deltaL hL⌉ := by exact_mod_cast (hu.trans_le hc) rw [Finset.mem_Icc] omega
CausalSmith.Stat.PrivateCateRoughdesign.activeSigns_subset_endpoint_interval · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineCertificate.lean:25
theorem activeSigns_card_le_length Lemma activeSigns_card_le_length in the paper ↗

Counting the active centers costs at most the macro interval length plus three micro cells. the asserted conclusion follows.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
((activeSigns hL).card : ℝ) ≤ 2*hL/deltaL hL+3
Proof (Lean source)
-- @node: activeSigns_card_le_length lemma activeSigns_card_le_length : ((activeSigns hL).card : ℝ) ≤ 2*hL/deltaL hL+3 := by have hd := (deltaL_pos_le_macro hL hhL).1 have he : (x0-hL)/deltaL hL ≤ (x0+hL)/deltaL hL := by apply div_le_div_of_nonneg_right _ (le_of_lt hd) linarith [hhL.1] have hl := Int.floor_le ((x0-hL)/deltaL hL) have hu := Int.le_ceil ((x0+hL)/deltaL hL) have hround : ⌊(x0-hL)/deltaL hL⌋ ≤ ⌈(x0+hL)/deltaL hL⌉ := by exact_mod_cast (hl.trans (he.trans hu)) have hc := Finset.card_le_card (activeSigns_subset_endpoint_interval hL hhL) have hcount := Int.card_Icc_of_le ⌊(x0-hL)/deltaL hL⌋ ⌈(x0+hL)/deltaL hL⌉ (by omega) have hcR : ((activeSigns hL).card : ℝ) ≤ (⌈(x0+hL)/deltaL hL⌉ : ℝ)+1-(⌊(x0-hL)/deltaL hL⌋ : ℝ) := by exact_mod_cast (show ((activeSigns hL).card : ℤ) ≤ ⌈(x0+hL)/deltaL hL⌉+1-⌊(x0-hL)/deltaL hL⌋ by rw [← hcount]; exact_mod_cast hc) have hf := Int.lt_floor_add_one ((x0-hL)/deltaL hL) have hce := Int.ceil_lt_add_one ((x0+hL)/deltaL hL) have hdiff : (x0+hL)/deltaL hL-(x0-hL)/deltaL hL = 2*hL/deltaL hL := by ring linarith
CausalSmith.Stat.PrivateCateRoughdesign.activeSigns_card_le_length · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineCertificate.lean:45
theorem activeSigns_card_le_five_ratio Lemma activeSigns_card_le_five_ratio in the paper ↗

The number of active signs is at most five times the macro-to-micro radius ratio. the asserted conclusion follows.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
((activeSigns hL).card : ℝ) ≤ 5*hL/deltaL hL
Proof (Lean source)
-- @node: activeSigns_card_le_five_ratio lemma activeSigns_card_le_five_ratio : ((activeSigns hL).card : ℝ) ≤ 5*hL/deltaL hL := by have hd := deltaL_pos_le_macro hL hhL have hr : 1 ≤ hL/deltaL hL := (le_div_iff₀ hd.1).mpr (by simpa using hd.2) have hc := activeSigns_card_le_length hL hhL have he : 5*hL/deltaL hL = 5*(hL/deltaL hL) := by ring have he' : 2*hL/deltaL hL = 2*(hL/deltaL hL) := by ring rw [he] rw [he'] at hc linarith
CausalSmith.Stat.PrivateCateRoughdesign.activeSigns_card_le_five_ratio · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineCertificate.lean:69
theorem perturbation_update_difference Lemma perturbation_update_difference in the paper ↗

Updating one latent sign changes only its localized frame contribution. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
lam :
j :
b :
x :
perturbation hL lam x - perturbation hL (update lam j b) x
= envelope hL x * (2*bit (lam j)-2*bit b) * frame hL j x
Proof (Lean source)
-- @node: perturbation_update_difference lemma perturbation_update_difference (lam : SignVector hL) (j : activeSigns hL) (b : Bool) (x : Covariate) : perturbation hL lam x - perturbation hL (update lam j b) x = envelope hL x * (2*bit (lam j)-2*bit b) * frame hL j x := by classical have hs : (∑ i : activeSigns hL, ((2*bit (lam i)-1)*frame hL i x - (2*bit (update lam j b i)-1)*frame hL i x)) = (2*bit (lam j)-2*bit b)*frame hL j x := by rw [Finset.sum_eq_single j] · simp only [Function.update_self] ring · intro i _ hij simp [Function.update_of_ne hij] · simp simp only [perturbation] rw [← mul_sub, ← Finset.sum_sub_distrib, hs] ring
CausalSmith.Stat.PrivateCateRoughdesign.perturbation_update_difference · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineCertificate.lean:82
theorem perturbation_update_abs_le Lemma perturbation_update_abs_le in the paper ↗

A sign update has pointwise oscillation at most twice its envelope-weighted frame. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
lam :
j :
b :
x :
|perturbation hL lam x - perturbation hL (update lam j b) x|
≤ 2*envelope hL x*|frame hL j x|
Proof (Lean source)
-- @node: perturbation_update_abs_le lemma perturbation_update_abs_le (lam : SignVector hL) (j : activeSigns hL) (b : Bool) (x : Covariate) : |perturbation hL lam x - perturbation hL (update lam j b) x| ≤ 2*envelope hL x*|frame hL j x| := by rw [perturbation_update_difference hL hhL, abs_mul, abs_mul, abs_of_nonneg (envelope_range hL x).1] have hb : |2*bit (lam j)-2*bit b| ≤ 2 := by cases h : lam j <;> cases b <;> norm_num [bit, h] simpa only [mul_comm (envelope hL x) 2] using mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hb (envelope_range hL x).1) (abs_nonneg (frame hL j x))
CausalSmith.Stat.PrivateCateRoughdesign.perturbation_update_abs_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineCertificate.lean:103
theorem perturbation_update_eq_off_support Lemma perturbation_update_eq_off_support in the paper ↗

Outside the updated frame's support the perturbation is unchanged. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
lam :
j :
b :
x :
hx :
deltaL hL ≤ |(x : ℝ)-(j : ℤ)*deltaL hL|
perturbation hL lam x = perturbation hL (update lam j b) x
Proof (Lean source)
-- @node: perturbation_update_eq_off_support lemma perturbation_update_eq_off_support (lam : SignVector hL) (j : activeSigns hL) (b : Bool) (x : Covariate) (hx : deltaL hL ≤ |(x : ℝ)-(j : ℤ)*deltaL hL|) : perturbation hL lam x = perturbation hL (update lam j b) x := by have he := perturbation_update_difference hL hhL lam j b x rw [frame_zero_of_radius_le hL hhL j x hx, mul_zero] at he exact sub_eq_zero.mp he
CausalSmith.Stat.PrivateCateRoughdesign.perturbation_update_eq_off_support · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineCertificate.lean:116
theorem sign_coordinate_squared_budget Lemma sign_coordinate_squared_budget in the paper ↗

The roadmap's coordinate oscillation constants have the required total squared budget. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
(∑ j : activeSigns hL, (16*separation hL*deltaL hL)^2)
≤ 1280*(separation hL)^2*hL*deltaL hL
Proof (Lean source)
-- @node: sign_coordinate_squared_budget lemma sign_coordinate_squared_budget : (∑ j : activeSigns hL, (16*separation hL*deltaL hL)^2) ≤ 1280*(separation hL)^2*hL*deltaL hL := by classical simp only [Finset.sum_const, Finset.card_univ, Fintype.card_coe, nsmul_eq_mul] have hd := (deltaL_pos_le_macro hL hhL).1 have hc := activeSigns_card_le_five_ratio hL hhL have hm := mul_le_mul_of_nonneg_right hc (sq_nonneg (16*separation hL*deltaL hL)) calc _ ≤ (5*hL/deltaL hL)*(16*separation hL*deltaL hL)^2 := hm _ = _ := by field_simp; ring
CausalSmith.Stat.PrivateCateRoughdesign.sign_coordinate_squared_budget · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineCertificate.lean:125
theorem signOverlapIntegrand_update_eq_off_support

The Fourier overlap integrand is unchanged outside a replaced sign's frame support. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
lam lam' :
j :
b :
x :
hx :
deltaL hL ≤ |(x : ℝ)-(j : ℤ)*deltaL hL|
signOverlapIntegrand hL lam lam' x
= signOverlapIntegrand hL (update lam j b) lam' x
Proof (Lean source)
-- @node: signOverlapIntegrand_update_eq_off_support lemma signOverlapIntegrand_update_eq_off_support (lam lam' : SignVector hL) (j : activeSigns hL) (b : Bool) (x : Covariate) (hx : deltaL hL ≤ |(x : ℝ)-(j : ℤ)*deltaL hL|) : signOverlapIntegrand hL lam lam' x = signOverlapIntegrand hL (update lam j b) lam' x := by simp only [signOverlapIntegrand, perturbation_update_eq_off_support hL hhL lam j b x hx]
CausalSmith.Stat.PrivateCateRoughdesign.signOverlapIntegrand_update_eq_off_support · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineCertificate.lean:139
theorem signOverlap_range

The centered overlap stays in a fixed bounded interval after covariate integration. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
lam lam' :
signOverlap hL lam lam' ∈ Icc (-1) 15
Proof (Lean source)
-- @node: signOverlap_range lemma signOverlap_range (lam lam' : SignVector hL) : signOverlap hL lam lam' ∈ Icc (-1) 15 := by have hi := integrable_signOverlapIntegrand hL hhL lam lam' constructor · have hm := integral_mono (integrable_const (-1 : ℝ)) hi (fun x => (signOverlapIntegrand_range hL hhL lam lam' x).1) simpa [signOverlap] using hm · have hm := integral_mono hi (integrable_const (15 : ℝ)) (fun x => (signOverlapIntegrand_range hL hhL lam lam' x).2) simpa [signOverlap] using hm
theorem signOverlap_abs_le_fifteen

The boundedness hypothesis of the bounded-differences gate holds for each fixed second sign. the theorem's stated inputs and assumptions, and the asserted conclusion follows.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
lam lam' :
|signOverlap hL lam lam'| ≤ 15
Proof (Lean source)
-- @node: signOverlap_abs_le_fifteen lemma signOverlap_abs_le_fifteen (lam lam' : SignVector hL) : |signOverlap hL lam lam'| ≤ 15 := by have hr := signOverlap_range hL hhL lam lam' exact abs_le.mpr ⟨by linarith [hr.1], hr.2⟩
CausalSmith.Stat.PrivateCateRoughdesign.signOverlap_abs_le_fifteen · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineCertificate.lean:160
theorem signOverlap_update_difference_integral

A coordinate replacement in the overlap is exactly the integral of its localized change. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
lam lam' :
j :
b :
signOverlap hL lam lam' - signOverlap hL (update lam j b) lam'
= ∫ x : Covariate, (signOverlapIntegrand hL lam lam' x - signOverlapIntegrand hL (update lam j b) lam' x)
Proof (Lean source)
-- @node: signOverlap_update_difference_integral lemma signOverlap_update_difference_integral (lam lam' : SignVector hL) (j : activeSigns hL) (b : Bool) : signOverlap hL lam lam' - signOverlap hL (update lam j b) lam' = ∫ x : Covariate, (signOverlapIntegrand hL lam lam' x - signOverlapIntegrand hL (update lam j b) lam' x) := by exact (integral_sub (integrable_signOverlapIntegrand hL hhL lam lam') (integrable_signOverlapIntegrand hL hhL (update lam j b) lam')).symm
CausalSmith.Stat.PrivateCateRoughdesign.signOverlap_update_difference_integral · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineCertificate.lean:167
theorem frame_nonzero_card_le_two Lemma frame_nonzero_card_le_two in the paper ↗

Only the two neighboring lattice frames can be nonzero, including at grid boundaries. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
x :
(Finset.univ.filter (fun j : activeSigns hL => frame hL j x ≠ 0)).card ≤ 2
Proof (Lean source)
-- @node: frame_nonzero_card_le_two lemma frame_nonzero_card_le_two (x : Covariate) : (Finset.univ.filter (fun j : activeSigns hL => frame hL j x ≠ 0)).card ≤ 2 := by classical let q : ℤ := ⌊(x : ℝ) / deltaL hL⌋ have hd := (deltaL_pos_le_macro hL hhL).1 have hl : (q : ℝ) * deltaL hL ≤ x := (le_div_iff₀ hd).mp (Int.floor_le _) have hu : (x : ℝ) ≤ (q + 1 : ℤ) * deltaL hL := by have hu := (div_lt_iff₀ hd).mp (Int.lt_floor_add_one ((x : ℝ) / deltaL hL)) simpa [q] using hu.le have hc := Finset.card_le_card_of_injOn (fun j : activeSigns hL => (j : ℤ)) (s := Finset.univ.filter (fun j : activeSigns hL => frame hL j x ≠ 0)) (t := {q, q+1}) (by intro j hj have hn := (Finset.mem_filter.mp hj).2 by_cases hj0 : (j : ℤ) = q · simp [hj0] · by_cases hj1 : (j : ℤ) = q+1 · simp [hj1] · exact (hn (frame_zero_off_neighbors hL hhL q j x hl hu hj0 hj1)).elim) (by intro i hi j hj hij; exact Subtype.ext hij) exact hc.trans (Finset.card_le_two)
CausalSmith.Stat.PrivateCateRoughdesign.frame_nonzero_card_le_two · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineCertificate.lean:177
theorem perturbation_square_le_two_bump Lemma perturbation_square_le_two_bump in the paper ↗

The two-frame Cauchy-Schwarz bound keeps every squared perturbation below twice the bump. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
lam :
x :
(perturbation hL lam x)^2 ≤ 2*bump hL x
Proof (Lean source)
-- @node: perturbation_square_le_two_bump lemma perturbation_square_le_two_bump (lam : SignVector hL) (x : Covariate) : (perturbation hL lam x)^2 ≤ 2*bump hL x := by classical let s := Finset.univ.filter (fun j : activeSigns hL => frame hL j x ≠ 0) have hsum : (∑ j ∈ s, (2*bit (lam j)-1)*frame hL j x) = ∑ j : activeSigns hL, (2*bit (lam j)-1)*frame hL j x := by apply Finset.sum_subset (filter_subset _ _) intro j hj hn have hz : frame hL j x = 0 := by simpa [s, hj] using hn simp [hz] have hsquares : (∑ j ∈ s, (frame hL j x)^2) = ∑ j : activeSigns hL, (frame hL j x)^2 := by apply Finset.sum_subset (filter_subset _ _) intro j hj hn have hz : frame hL j x = 0 := by simpa [s, hj] using hn simp [hz] have hc : (s.card : ℝ) ≤ 2 := by exact_mod_cast frame_nonzero_card_le_two hL hhL x have hcs := Finset.sum_mul_sq_le_sq_mul_sq s (fun j => 2*bit (lam j)-1) (fun j => frame hL j x) have hbitSq (b : Bool) : (2 * bit b - 1) ^ 2 = (1 : ℝ) := by cases b <;> norm_num [bit] simp only [hbitSq, Finset.sum_const, nsmul_eq_mul, mul_one] at hcs rw [hsum, hsquares] at hcs have ht := hcs.trans (mul_le_mul_of_nonneg_right hc (Finset.sum_nonneg (fun j _ => sq_nonneg (frame hL j x)))) have hw := mul_le_mul_of_nonneg_left ht (sq_nonneg (envelope hL x)) calc (perturbation hL lam x)^2 = bump hL x * (∑ j : activeSigns hL, (2*bit (lam j)-1)*frame hL j x)^2 := by simp only [perturbation, bump, mul_pow] _ ≤ bump hL x * (2 * ∑ j : activeSigns hL, (frame hL j x)^2) := hw _ = 2*bump hL x := by rw [← mul_assoc, mul_comm (bump hL x) 2, mul_assoc, weighted_frame_square_partition hL hhL]
CausalSmith.Stat.PrivateCateRoughdesign.perturbation_square_le_two_bump · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineCertificate.lean:201
theorem perturbation_square_residual_abs_le_bump Lemma perturbation_square_residual_abs_le_bump in the paper ↗

The centered quadratic Fourier coefficient is bounded by the local bump. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
lam :
x :
|bump hL x-(perturbation hL lam x)^2| ≤ bump hL x
Proof (Lean source)
-- @node: perturbation_square_residual_abs_le_bump lemma perturbation_square_residual_abs_le_bump (lam : SignVector hL) (x : Covariate) : |bump hL x-(perturbation hL lam x)^2| ≤ bump hL x := by have hs := perturbation_square_le_two_bump hL hhL lam x exact abs_le.mpr ⟨by linarith, by linarith [sq_nonneg (perturbation hL lam x)]⟩
CausalSmith.Stat.PrivateCateRoughdesign.perturbation_square_residual_abs_le_bump · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineCertificate.lean:238
theorem perturbation_update_square_abs_le Lemma perturbation_update_square_abs_le in the paper ↗

Replacing one sign changes the squared perturbation by at most twice the bump. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
lam :
j :
b :
x :
|(perturbation hL lam x)^2-(perturbation hL (update lam j b) x)^2| ≤ 2*bump hL x
Proof (Lean source)
-- @node: perturbation_update_square_abs_le lemma perturbation_update_square_abs_le (lam : SignVector hL) (j : activeSigns hL) (b : Bool) (x : Covariate) : |(perturbation hL lam x)^2-(perturbation hL (update lam j b) x)^2| ≤ 2*bump hL x := by have hs := perturbation_square_le_two_bump hL hhL lam x have hu := perturbation_square_le_two_bump hL hhL (update lam j b) x exact abs_le.mpr ⟨by linarith [sq_nonneg (perturbation hL lam x)], by linarith [sq_nonneg (perturbation hL (update lam j b) x)]⟩
CausalSmith.Stat.PrivateCateRoughdesign.perturbation_update_square_abs_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineCertificate.lean:245
theorem perturbation_abs_le_three_halves Lemma perturbation_abs_le_three_halves in the paper ↗

The sharp square bound gives a convenient rational sup-norm envelope. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
lam :
x :
|perturbation hL lam x| ≤ 3/2
Proof (Lean source)
-- @node: perturbation_abs_le_three_halves lemma perturbation_abs_le_three_halves (lam : SignVector hL) (x : Covariate) : |perturbation hL lam x| ≤ 3/2 := by have hs := perturbation_square_le_two_bump hL hhL lam x have hq := (bump_range hL x).2 have ha := sq_abs (perturbation hL lam x) nlinarith [abs_nonneg (perturbation hL lam x)]
CausalSmith.Stat.PrivateCateRoughdesign.perturbation_abs_le_three_halves · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineCertificate.lean:256

The effect amplitude lies between zero and one for every legal macro radius. the asserted conclusion follows.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
separation hL ∈ Icc 0 1
Proof (Lean source)
-- @node: separation_unit_range lemma separation_unit_range : separation hL ∈ Icc 0 1 := by norm_num [separation, kappa] at * constructor <;> linarith [hhL.1, hhL.2]
theorem signOverlapIntegrand_update_abs_le

A coordinate replacement changes the Fourier overlap integrand by at most eight amplitudes. the theorem's stated inputs and assumptions, and the asserted conclusion follows.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
lam lam' :
j :
b :
x :
|signOverlapIntegrand hL lam lam' x
- signOverlapIntegrand hL (update lam j b) lam' x|
≤ 8*separation hL
Proof (Lean source)
-- @node: signOverlapIntegrand_update_abs_le lemma signOverlapIntegrand_update_abs_le (lam lam' : SignVector hL) (j : activeSigns hL) (b : Bool) (x : Covariate) : |signOverlapIntegrand hL lam lam' x - signOverlapIntegrand hL (update lam j b) lam' x| ≤ 8*separation hL := by have ht := separation_unit_range hL hhL have hq := bump_range hL x have hcoef : 0 ≤ 1+(separation hL*bump hL x-1)^2 ∧ 1+(separation hL*bump hL x-1)^2 ≤ 2 := by have hp := mul_nonneg ht.1 hq.1 have hu := mul_le_one₀ ht.2 hq.1 hq.2 constructor · positivity · nlinarith [mul_nonneg hp (sub_nonneg.mpr hu)] have hframe : |frame hL j x| ≤ 1 := by exact (frame_abs_le hL j x).trans (by split_ifs <;> norm_num) have hdiff : |perturbation hL lam x-perturbation hL (update lam j b) x| ≤ 2 := by have hd := perturbation_update_abs_le hL hhL lam j b x have hf := mul_le_mul (envelope_range hL x).2 hframe (abs_nonneg (frame hL j x)) (by norm_num : (0 : ℝ) ≤ 1) nlinarith have hfirst : |separation hL*(1+(separation hL*bump hL x-1)^2)* (perturbation hL lam x-perturbation hL (update lam j b) x)* perturbation hL lam' x| ≤ 6*separation hL := by rw [abs_mul, abs_mul, abs_mul, abs_of_nonneg ht.1, abs_of_nonneg hcoef.1] calc _ ≤ separation hL*2*2*(3/2) := by have ht0 := ht.1 gcongr <;> first | positivity | exact hcoef.2 | exact hdiff | exact perturbation_abs_le_three_halves hL hhL lam' x _ = _ := by ring have hsecond : |(separation hL)^2* ((perturbation hL (update lam j b) x)^2-(perturbation hL lam x)^2)* (bump hL x-(perturbation hL lam' x)^2)| ≤ 2*(separation hL)^2 := by rw [abs_mul, abs_mul, abs_of_nonneg (sq_nonneg _), abs_sub_comm ((perturbation hL (update lam j b) x)^2)] have hd := (perturbation_update_square_abs_le hL hhL lam j b x).trans (mul_le_mul_of_nonneg_left hq.2 (by norm_num : (0 : ℝ) ≤ 2)) have hr := (perturbation_square_residual_abs_le_bump hL hhL lam' x).trans hq.2 calc _ ≤ (separation hL)^2*2*1 := by gcongr simpa using hd _ = _ := by ring have he : signOverlapIntegrand hL lam lam' x - signOverlapIntegrand hL (update lam j b) lam' x = separation hL*(1+(separation hL*bump hL x-1)^2)* (perturbation hL lam x-perturbation hL (update lam j b) x)* perturbation hL lam' x + (separation hL)^2* ((perturbation hL (update lam j b) x)^2-(perturbation hL lam x)^2)* (bump hL x-(perturbation hL lam' x)^2) := by dsimp [signOverlapIntegrand] ring rw [he] calc _ ≤ _ := abs_add_le _ _ _ ≤ 6*separation hL+2*(separation hL)^2 := add_le_add hfirst hsecond _ ≤ 8*separation hL := by nlinarith [mul_nonneg ht.1 (sub_nonneg.mpr ht.2)]
CausalSmith.Stat.PrivateCateRoughdesign.signOverlapIntegrand_update_abs_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineCertificate.lean:271
theorem frame_open_support_volume_le Lemma frame_open_support_volume_le in the paper ↗

Restricting a micro support to the unit interval can only decrease its length. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
j :
ℤ
(volume : Measure Covariate).real {x | |(x : ℝ)-j*deltaL hL| < deltaL hL} ≤ 2*deltaL hL
Proof (Lean source)
-- @node: frame_open_support_volume_le lemma frame_open_support_volume_le (j : ℤ) : (volume : Measure Covariate).real {x | |(x : ℝ)-j*deltaL hL| < deltaL hL} ≤ 2*deltaL hL := by have hd := (deltaL_pos_le_macro hL hhL).1 have hsub : val '' {x : Covariate | |(x : ℝ)-j*deltaL hL| < deltaL hL} ⊆ Ioo ((j : ℝ)*deltaL hL-deltaL hL) ((j : ℝ)*deltaL hL+deltaL hL) := by rintro y ⟨x, hx, rfl⟩ change |(x : ℝ)-j*deltaL hL| < deltaL hL at hx have hx' := abs_lt.mp hx constructor <;> linarith have hm : (volume : Measure ℝ) (val '' {x : Covariate | |(x : ℝ)-j*deltaL hL| < deltaL hL}) ≤ volume (Ioo ((j : ℝ)*deltaL hL-deltaL hL) ((j : ℝ)*deltaL hL+deltaL hL)) := measure_mono hsub rw [← unitInterval.volume_apply, Real.volume_Ioo, show (j : ℝ)*deltaL hL+deltaL hL-((j : ℝ)*deltaL hL-deltaL hL) = 2*deltaL hL by ring] at hm have hr := ENNReal.toReal_mono ENNReal.ofReal_ne_top hm simpa only [Measure.real, ENNReal.toReal_ofReal (by positivity : 0 ≤ 2*deltaL hL)] using hr
CausalSmith.Stat.PrivateCateRoughdesign.frame_open_support_volume_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineCertificate.lean:335
theorem signOverlap_update_abs_le

Integrating the localized pointwise change gives the roadmap's sixteen-amplitude coordinate bound. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
lam lam' :
j :
b :
|signOverlap hL lam lam'-signOverlap hL (update lam j b) lam'|
≤ 16*separation hL*deltaL hL
Proof (Lean source)
-- @node: signOverlap_update_abs_le lemma signOverlap_update_abs_le (lam lam' : SignVector hL) (j : activeSigns hL) (b : Bool) : |signOverlap hL lam lam'-signOverlap hL (update lam j b) lam'| ≤ 16*separation hL*deltaL hL := by classical let s : Set Covariate := {x | |(x : ℝ)-(j : ℤ)*deltaL hL| < deltaL hL} have hs : MeasurableSet s := by apply measurableSet_lt · fun_prop · fun_prop have hi := (integrable_signOverlapIntegrand hL hhL lam lam').sub (integrable_signOverlapIntegrand hL hhL (update lam j b) lam') have hbound (x : Covariate) : |signOverlapIntegrand hL lam lam' x- signOverlapIntegrand hL (update lam j b) lam' x| ≤ s.indicator (fun _ => 8*separation hL) x := by by_cases hx : x ∈ s · rw [Set.indicator_of_mem hx] exact signOverlapIntegrand_update_abs_le hL hhL lam lam' j b x · rw [Set.indicator_of_notMem hx] have hx' : deltaL hL ≤ |(x : ℝ)-(j : ℤ)*deltaL hL| := by exact le_of_not_gt hx rw [signOverlapIntegrand_update_eq_off_support hL hhL lam lam' j b x hx'] simp rw [signOverlap_update_difference_integral hL hhL] calc _ ≤ ∫ x : Covariate, |signOverlapIntegrand hL lam lam' x- signOverlapIntegrand hL (update lam j b) lam' x| := abs_integral_le_integral_abs _ ≤ ∫ x : Covariate, s.indicator (fun _ => 8*separation hL) x := integral_mono hi.abs ((integrable_const _).indicator hs) hbound _ = (volume : Measure Covariate).real s * (8*separation hL) := by rw [integral_indicator_const _ hs, smul_eq_mul] _ ≤ (2*deltaL hL)*(8*separation hL) := mul_le_mul_of_nonneg_right (frame_open_support_volume_le hL hhL j) (mul_nonneg (by norm_num) (separation_unit_range hL hhL).1) _ = _ := by ring
CausalSmith.Stat.PrivateCateRoughdesign.signOverlap_update_abs_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineCertificate.lean:357
theorem signOverlap_exp_average_le

For a fixed second sign vector, the centered overlap obeys the roadmap's mgf bound. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
n :
ℕ
lam' :
(∑ lam : SignVector hL, exp ((n : ℝ)*signOverlap hL lam lam')) / (card (SignVector hL) : ℝ)
≤ exp (160*(n : ℝ)^2*(separation hL)^2*hL*deltaL hL)
Proof (Lean source)
-- @node: signOverlap_exp_average_le lemma signOverlap_exp_average_le (gate : BoundedDifferencesMGF) (n : ℕ) (lam' : SignVector hL) : (∑ lam : SignVector hL, exp ((n : ℝ)*signOverlap hL lam lam')) / (card (SignVector hL) : ℝ) ≤ exp (160*(n : ℝ)^2*(separation hL)^2*hL*deltaL hL) := by classical have hm := finite_sign_mgf_average gate (fun lam => signOverlap hL lam lam') (signOverlap_sign_sum hL hhL lam') ⟨15, fun lam => signOverlap_abs_le_fifteen hL hhL lam lam'⟩ (fun _ => 16*separation hL*deltaL hL) (fun _ => mul_nonneg (mul_nonneg (by norm_num) (separation_unit_range hL hhL).1) (deltaL_pos_le_macro hL hhL).1.le) (fun j lam b => signOverlap_update_abs_le hL hhL lam lam' j b) (n : ℝ) (Nat.cast_nonneg n) apply hm.trans apply Real.exp_le_exp.mpr calc _ ≤ (n : ℝ)^2 / 8 * (1280*(separation hL)^2*hL*deltaL hL) := mul_le_mul_of_nonneg_left (sign_coordinate_squared_budget hL hhL) (by positivity) _ = _ := by ring
CausalSmith.Stat.PrivateCateRoughdesign.signOverlap_exp_average_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineCertificate.lean:397
theorem signOverlap_joint_exp_average_le

Averaging the fixed-second-sign mgf estimate gives the joint exponential bound. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
n :
ℕ
(∑ lam : SignVector hL, ∑ lam' : SignVector hL, exp ((n : ℝ)*signOverlap hL lam lam')) / (card (SignVector hL) : ℝ)^2
≤ exp (160*(n : ℝ)^2*(separation hL)^2*hL*deltaL hL)
Proof (Lean source)
-- @node: signOverlap_joint_exp_average_le lemma signOverlap_joint_exp_average_le (gate : BoundedDifferencesMGF) (n : ℕ) : (∑ lam : SignVector hL, ∑ lam' : SignVector hL, exp ((n : ℝ)*signOverlap hL lam lam')) / (card (SignVector hL) : ℝ)^2 ≤ exp (160*(n : ℝ)^2*(separation hL)^2*hL*deltaL hL) := by classical have hc : 0 < (card (SignVector hL) : ℝ) := by exact_mod_cast Fintype.card_pos have hb (lam' : SignVector hL) := (div_le_iff₀ hc).mp (signOverlap_exp_average_le hL hhL gate n lam') have hs := Finset.sum_le_sum (fun lam' (_ : lam' ∈ univ) => hb lam') rw [Finset.sum_comm] at hs simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul] at hs apply (div_le_iff₀ (sq_pos_of_pos hc)).mpr calc _ ≤ _ := hs _ = _ := by ring
CausalSmith.Stat.PrivateCateRoughdesign.signOverlap_joint_exp_average_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineCertificate.lean:421
theorem positive_family_certificate

Frame moments, model membership, the Fourier likelihood and fixed-sample chi-square certificate are conditional on the published bounded-differences mgf gate. The certificate records absolute continuity and square-density integrability explicitly, so its real-valued chi-square integral represents the finite divergence used in testing. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
boundedDifferences_of_gate :
n :
ℕ
conclusion 2
theta fairNull = 0
conclusion 3
lam :
theta (cosineFamily hL hhL lam) = separation hL
conclusion 4
lam x av yv :
conditionalLikelihood hL lam x av yv
= 1
+ (2*bit av-1)*sqrt (separation hL)*perturbation hL lam x
+ (2*bit yv-1)*sqrt (separation hL)*(separation hL*bump hL x-1)* perturbation hL lam x
+ (2*bit av-1)*(2*bit yv-1)*separation hL* (bump hL x-(perturbation hL lam x)^2)
conclusion 5
conclusion 6
≤ exp (160*(n : ℝ)^2*(separation hL)^2*hL*deltaL hL)-1
conclusion 7
conclusion 8
Integrable (fun z => (((signMixture hL hhL n).rnDeriv (dataLaw n fairNull) z).toReal - 1)^2) (dataLaw n fairNull)
Proof (Lean source)
-- @node: lem:positive-family-certificate lemma positive_family_certificate (boundedDifferences_of_gate : BoundedDifferencesMGF) (n : ℕ) : CompleteModel fairNull ∧ theta fairNull = 0 ∧ (∀ lam : SignVector hL, CompleteModel (cosineFamily hL hhL lam) ∧ theta (cosineFamily hL hhL lam) = separation hL) ∧ (∀ lam x av yv, conditionalLikelihood hL lam x av yv = 1 + (2*bit av-1)*sqrt (separation hL)*perturbation hL lam x + (2*bit yv-1)*sqrt (separation hL)*(separation hL*bump hL x-1)* perturbation hL lam x + (2*bit av-1)*(2*bit yv-1)*separation hL* (bump hL x-(perturbation hL lam x)^2)) ∧ oneRecordMixture hL hhL = Pobs fairNull ∧ chiSqDiv (signMixture hL hhL n) (dataLaw n fairNull) ≤ exp (160*(n : ℝ)^2*(separation hL)^2*hL*deltaL hL)-1 ∧ signMixture hL hhL n ≪ dataLaw n fairNull ∧ Integrable (fun z => (((signMixture hL hhL n).rnDeriv (dataLaw n fairNull) z).toReal - 1)^2) (dataLaw n fairNull) := by have hchi : chiSqDiv (signMixture hL hhL n) (dataLaw n fairNull) ≤ exp (160*(n : ℝ)^2*(separation hL)^2*hL*deltaL hL)-1 := by have hmgf : (∑ lam : SignVector hL, ∑ lam' : SignVector hL, exp ((n : ℝ)*signOverlap hL lam lam')) / (card (SignVector hL) : ℝ)^2 ≤ exp (160*(n : ℝ)^2*(separation hL)^2*hL*deltaL hL) := by exact signOverlap_joint_exp_average_le hL hhL boundedDifferences_of_gate n have hmoment := (signMixture_chiSq_le_fourier_exp_average hL hhL n).trans hmgf linarith have halt : ∀ lam : SignVector hL, CompleteModel (cosineFamily hL hhL lam) := cosineFamily_completeModel hL hhL exact ⟨fairNull_completeModel, fairNull_target, fun lam => ⟨halt lam, cosineFamily_target hL hhL lam⟩, conditionalLikelihood_fourier hL hhL, oneRecordMixture_eq_fairNull hL hhL, hchi, signMixture_absolutelyContinuous hL hhL n, signMixture_square_density_integrable hL hhL n⟩
CausalSmith.Stat.PrivateCateRoughdesign.positive_family_certificate · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineCertificate.lean:441
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.CosineFamily 53 declarations Explicit uniform-design Bernoulli causal laws, overlapping cosine signs, and the conditional published-mgf certificate for the fixed-sample alternative mixture.

Explicit uniform-design Bernoulli causal laws, overlapping cosine signs, and the conditional published-mgf certificate for the fixed-sample alternative mixture.

def signLaw

The latent sign law is uniform on all sign vectors.

Definition (Lean source)
hL :
ℝ
shared
signLaw hL :
ofReal ((2 : ℝ)^(-((activeSigns hL).card : ℤ))) • ∑ lam : SignVector hL, Measure.dirac lam
def perturbation

The nuisance perturbation multiplies the signed frame sum by the macro envelope.

Definition (Lean source)
hL :
ℝ
shared
lam :
x :
perturbation hL lam x :
ℝ
envelope hL x * ∑ j : activeSigns hL, (2*bit (lam j)-1)*frame hL j x
theorem measurable_perturbation Lemma measurable_perturbation in the paper ↗

A finite signed sum of Borel frames times the envelope is Borel measurable. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
lam :
Proof (Lean source)
-- @node: measurable_perturbation @[fun_prop] lemma measurable_perturbation (lam : SignVector hL) : Measurable (perturbation hL lam) := by unfold perturbation fun_prop
CausalSmith.Stat.PrivateCateRoughdesign.measurable_perturbation · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:26

Fair independent signs cancel the nuisance perturbation pointwise, including boundaries. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
x :
(∑ lam : SignVector hL, perturbation hL lam x) = 0
Proof (Lean source)
-- @node: perturbation_sign_sum lemma perturbation_sign_sum (x : Covariate) : (∑ lam : SignVector hL, perturbation hL lam x) = 0 := by classical have hsign (b : Bool) : 2 * bit b - 1 = if b then (1 : ℝ) else -1 := by cases b <;> norm_num [bit] simp only [perturbation, ← Finset.mul_sum] simp_rw [hsign] rw [show (∑ lam : SignVector hL, ∑ j : activeSigns hL, (if lam j then (1 : ℝ) else -1) * frame hL j x) = 0 by exact signLinear_sum (fun j : activeSigns hL => frame hL j x), mul_zero]
CausalSmith.Stat.PrivateCateRoughdesign.perturbation_sign_sum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:33
theorem perturbation_sign_square_sum Lemma perturbation_sign_square_sum in the paper ↗

Off-diagonal frame terms cancel in the exact finite-sign second moment. The remaining geometric sum of squared frames is kept explicit. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
x :
(∑ lam : SignVector hL, (perturbation hL lam x)^2)
= (card (SignVector hL) : ℝ) * (bump hL x * ∑ j : activeSigns hL, (frame hL j x)^2)
Proof (Lean source)
-- @node: perturbation_sign_square_sum lemma perturbation_sign_square_sum (x : Covariate) : (∑ lam : SignVector hL, (perturbation hL lam x)^2) = (card (SignVector hL) : ℝ) * (bump hL x * ∑ j : activeSigns hL, (frame hL j x)^2) := by classical have hsign (b : Bool) : 2 * bit b - 1 = if b then (1 : ℝ) else -1 := by cases b <;> norm_num [bit] simp only [perturbation, mul_pow, ← Finset.mul_sum] simp_rw [hsign] rw [show (∑ lam : SignVector hL, (∑ j : activeSigns hL, (if lam j then (1 : ℝ) else -1) * frame hL j x) ^ 2) = (card (SignVector hL) : ℝ) * ∑ j : activeSigns hL, (frame hL j x) ^ 2 by exact signLinear_sq_sum (fun j : activeSigns hL => frame hL j x)] unfold bump ring
CausalSmith.Stat.PrivateCateRoughdesign.perturbation_sign_square_sum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:46
def altE

The alternative propensity is one half plus the specified shared-sign perturbation.

Definition (Lean source)
hL :
ℝ
shared
lam :
x :
altE hL lam x :
ℝ
(1 + sqrt (separation hL)*perturbation hL lam x)/2
def altMu0

The alternative control mean has the negative shared-sign term and negative effect bump.

Definition (Lean source)
hL :
ℝ
shared
lam :
x :
altMu0 hL lam x :
ℝ
(1 - sqrt (separation hL)*perturbation hL lam x - separation hL*bump hL x)/2
def altMu1

The alternative treated mean has the negative shared-sign term and positive effect bump.

Definition (Lean source)
hL :
ℝ
shared
lam :
x :
altMu1 hL lam x :
ℝ
(1 - sqrt (separation hL)*perturbation hL lam x + separation hL*bump hL x)/2

The shared-sign propensity is measurable. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
lam :
Measurable (altE hL lam)
Proof (Lean source)
-- @node: measurable_altE @[fun_prop] lemma measurable_altE (lam : SignVector hL) : Measurable (altE hL lam) := by unfold altE fun_prop

The shared-sign control mean is measurable. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
lam :
Proof (Lean source)
-- @node: measurable_altMu0 @[fun_prop] lemma measurable_altMu0 (lam : SignVector hL) : Measurable (altMu0 hL lam) := by unfold altMu0 fun_prop

The shared-sign treated mean is measurable. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
lam :
Proof (Lean source)
-- @node: measurable_altMu1 @[fun_prop] lemma measurable_altMu1 (lam : SignVector hL) : Measurable (altMu1 hL lam) := by unfold altMu1 fun_prop

A localized frame has absolute value at most one, and is zero outside its support. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
j :
ℤ
x :
|frame hL j x| ≤ if |(x : ℝ) - j * deltaL hL| ≤ deltaL hL then 1 else 0
Proof (Lean source)
-- @node: frame_abs_le lemma frame_abs_le (j : ℤ) (x : Covariate) : |frame hL j x| ≤ if |(x : ℝ) - j * deltaL hL| ≤ deltaL hL then 1 else 0 := by classical unfold frame split · exact Real.abs_cos_le_one _ · simp

At most three closed frame supports cover a covariate, including support endpoints. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
x :
(Finset.univ.filter (fun j : activeSigns hL => |(x : ℝ) - (j : ℤ) * deltaL hL| ≤ deltaL hL)).card
≤ 3
Proof (Lean source)
-- @node: frame_support_card_le lemma frame_support_card_le (x : Covariate) : (Finset.univ.filter (fun j : activeSigns hL => |(x : ℝ) - (j : ℤ) * deltaL hL| ≤ deltaL hL)).card ≤ 3 := by classical let q : ℤ := ⌊(x : ℝ) / deltaL hL⌋ have hd : 0 < deltaL hL := pow_pos hhL.1 5 have hq := Int.floor_le ((x : ℝ) / deltaL hL) have hq' := Int.lt_floor_add_one ((x : ℝ) / deltaL hL) have hc := Finset.card_le_card_of_injOn (fun j : activeSigns hL => (j : ℤ)) (s := Finset.univ.filter (fun j : activeSigns hL => |(x : ℝ) - (j : ℤ) * deltaL hL| ≤ deltaL hL)) (t := Icc (q - 1) (q + 1)) (by intro j hj have hj' := abs_le.mp (Finset.mem_filter.mp hj).2 rw [Finset.mem_coe, Finset.mem_Icc] have hl : (q : ℝ) - 1 ≤ (j : ℤ) := by have h := (le_div_iff₀ hd).mp hq change (q : ℝ) * deltaL hL ≤ (x : ℝ) at h nlinarith [hj'.2] have hu : (j : ℤ) < (q : ℝ) + 2 := by have h := (div_lt_iff₀ hd).mp hq' change (x : ℝ) < ((q : ℝ) + 1) * deltaL hL at h nlinarith [hj'.1] constructor · exact_mod_cast hl · change (j : ℤ) ≤ q + 1 have : (j : ℤ) < q + 2 := by exact_mod_cast hu omega) (by intro i hi j hj hij exact Subtype.ext hij) have hcard : (Icc (q - 1) (q + 1)).card = 3 := by rw [Int.card_Icc] omega exact hc.trans (by rw [hcard])
CausalSmith.Stat.PrivateCateRoughdesign.frame_support_card_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:101
theorem perturbation_abs_le_three Lemma perturbation_abs_le_three in the paper ↗

Closed-support counting gives a uniform bound on the signed perturbation, also at boundaries. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
lam :
x :
|perturbation hL lam x| ≤ 3
Proof (Lean source)
-- @node: perturbation_abs_le_three lemma perturbation_abs_le_three (lam : SignVector hL) (x : Covariate) : |perturbation hL lam x| ≤ 3 := by classical have hg := envelope_range hL x have hs : |∑ j : activeSigns hL, (2 * bit (lam j) - 1) * frame hL j x| ≤ 3 := by calc _ ≤ ∑ j : activeSigns hL, |(2 * bit (lam j) - 1) * frame hL j x| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ j : activeSigns hL, if |(x : ℝ) - (j : ℤ) * deltaL hL| ≤ deltaL hL then (1 : ℝ) else 0 := by apply Finset.sum_le_sum intro j hj have hb : |2 * bit (lam j) - 1| = 1 := by cases h : lam j <;> norm_num [bit, h] rw [abs_mul, hb, one_mul] exact frame_abs_le hL j x _ = ((Finset.univ.filter (fun j : activeSigns hL => |(x : ℝ) - (j : ℤ) * deltaL hL| ≤ deltaL hL)).card : ℝ) := by simp [← Finset.sum_filter] _ ≤ 3 := by exact_mod_cast frame_support_card_le hL hhL x unfold perturbation rw [abs_mul, abs_of_nonneg hg.1] calc _ ≤ envelope hL x * 3 := mul_le_mul_of_nonneg_left hs hg.1 _ ≤ 3 := by nlinarith [hg.2]
CausalSmith.Stat.PrivateCateRoughdesign.perturbation_abs_le_three · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:139

Every legal macro radius gives valid binary probabilities for every sign vector. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
lam :
x :
conclusion 1
altE hL lam x ∈ Icc 0 1
conclusion 2
altMu0 hL lam x ∈ Icc 0 1
conclusion 3
altMu1 hL lam x ∈ Icc 0 1
Proof (Lean source)
-- @node: alt_parameters_range lemma alt_parameters_range (lam : SignVector hL) : ∀ x, altE hL lam x ∈ Icc 0 1 ∧ altMu0 hL lam x ∈ Icc 0 1 ∧ altMu1 hL lam x ∈ Icc 0 1 := by intro x have hq := bump_range hL x have hs := abs_le.mp (perturbation_abs_le_three hL hhL lam x) have ht : 0 ≤ separation hL ∧ separation hL ≤ 1 / 16384 := by unfold separation kappa norm_num constructor <;> nlinarith [hhL.1, hhL.2] have hroot := Real.sqrt_nonneg (separation hL) have hsq := Real.sq_sqrt ht.1 have hsmall : sqrt (separation hL) ≤ 1 / 128 := by nlinarith have hprodlo := mul_le_mul_of_nonneg_left hs.1 hroot have hprodhi := mul_le_mul_of_nonneg_left hs.2 hroot have hbumplo := mul_nonneg ht.1 hq.1 have hbumphi := mul_le_mul_of_nonneg_left hq.2 ht.1 dsimp [altE, altMu0, altMu1] refine ⟨⟨?_, ?_⟩, ⟨?_, ?_⟩, ⟨?_, ?_⟩⟩ <;> nlinarith
CausalSmith.Stat.PrivateCateRoughdesign.alt_parameters_range · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:168

The small public amplitude keeps every sign alternative inside the required overlap interval, uniformly over covariates and signs. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
lam :
x :
conclusion 1
1 / 4 ≤ altE hL lam x
conclusion 2
altE hL lam x ≤ 3 / 4
Proof (Lean source)
-- @node: altE_overlap lemma altE_overlap (lam : SignVector hL) (x : Covariate) : 1 / 4 ≤ altE hL lam x ∧ altE hL lam x ≤ 3 / 4 := by have hs := abs_le.mp (perturbation_abs_le_three hL hhL lam x) have ht : 0 ≤ separation hL ∧ separation hL ≤ 1 / 16384 := by unfold separation kappa norm_num constructor <;> nlinarith [hhL.1, hhL.2] have hroot := Real.sqrt_nonneg (separation hL) have hsq := Real.sq_sqrt ht.1 have hsmall : sqrt (separation hL) ≤ 1 / 128 := by nlinarith have hlo := mul_le_mul_of_nonneg_left hs.1 hroot have hhi := mul_le_mul_of_nonneg_left hs.2 hroot dsimp [altE] constructor <;> nlinarith
def cosineFamily

The concrete causal alternative has the specified shared-sign propensity and arm means, independent binary potential outcomes given the covariate, and consistency.

Definition (Lean source)
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
lam :
cosineFamily hL hhL lam :
binaryCausalLaw (altE hL lam) (altMu0 hL lam) (altMu1 hL lam) (measurable_altE hL lam) (measurable_altMu0 hL lam) (measurable_altMu1 hL lam) (alt_parameters_range hL hhL lam)

The fair Bernoulli parameters are valid probabilities. The displayed conclusion follows.

Formal statement
x :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate
shared
x :
conclusion 1
(1/2 : ℝ) ∈ Icc 0 1
conclusion 2
(1/2 : ℝ) ∈ Icc 0 1
conclusion 3
(1/2 : ℝ) ∈ Icc 0 1
Proof (Lean source)
-- @node: fair_parameters_range lemma fair_parameters_range : ∀ x : Covariate, (1/2 : ℝ) ∈ Icc 0 1 ∧ (1/2 : ℝ) ∈ Icc 0 1 ∧ (1/2 : ℝ) ∈ Icc 0 1 := by intro x norm_num
CausalSmith.Stat.PrivateCateRoughdesign.fair_parameters_range · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:217
def fairNull

The full-support null uses a uniform covariate and three conditionally independent fair binary variables, followed by consistency.

Definition (Lean source)
fairNull :
def signMixture

The fixed-sample alternative mixture averages the observed product laws uniformly over all sign vectors.

Definition (Lean source)
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
n :
ℕ
signMixture hL hhL n :
(ofReal ((2 : ℝ)^(-(activeSigns hL).card : ℤ))) • ∑ lam : SignVector hL, dataLaw n (cosineFamily hL hhL lam)
def oneRecordMixture

The one-record mixture averages the observed marginals uniformly over all sign vectors.

Definition (Lean source)
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
oneRecordMixture hL hhL :
(ofReal ((2 : ℝ)^(-(activeSigns hL).card : ℤ))) • ∑ lam : SignVector hL, Pobs (cosineFamily hL hhL lam)
def U

The treatment Fourier mark maps the binary treatment to minus one or one.

Definition (Lean source)
z :
O
U z :
ℝ
2*bit z.2.1-1
def conditionalLikelihood

The conditional mark likelihood is the actual Bernoulli cell mass divided by the fair cell mass.

Definition (Lean source)
hL :
ℝ
shared
lam :
x :
av yv :
conditionalLikelihood hL lam x av yv :
ℝ
4 * bernoulliMass (altE hL lam x) av * bernoulliMass (if av then altMu1 hL lam x else altMu0 hL lam x) yv
CausalSmith.Stat.PrivateCateRoughdesign.conditionalLikelihood · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:242

The effect bump equals one at the target covariate. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hh :
0 ≤ hL
bump hL x0 = 1
Proof (Lean source)
-- @node: bump_at_target lemma bump_at_target (hh : 0 ≤ hL) : bump hL x0 = 1 := by simp [bump, envelope, hh]
theorem cosineFamily_contrast

The shared nuisance terms cancel exactly in the alternative contrast. the theorem's stated inputs and assumptions, and the asserted conclusion follows.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
lam :
x :
tau (cosineFamily hL hhL lam) x = separation hL * bump hL x
Proof (Lean source)
-- @node: cosineFamily_contrast lemma cosineFamily_contrast (lam : SignVector hL) (x : Covariate) : tau (cosineFamily hL hhL lam) x = separation hL * bump hL x := by change altMu1 hL lam x - altMu0 hL lam x = _ dsimp [altMu1, altMu0] ring
CausalSmith.Stat.PrivateCateRoughdesign.cosineFamily_contrast · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:253
theorem cosineFamily_target

Every sign alternative has the prescribed point target. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
lam :
theta (cosineFamily hL hhL lam) = separation hL
Proof (Lean source)
-- @node: cosineFamily_target lemma cosineFamily_target (lam : SignVector hL) : theta (cosineFamily hL hhL lam) = separation hL := by rw [theta, cosineFamily_contrast, bump_at_target hL hhL.1.le, mul_one]
CausalSmith.Stat.PrivateCateRoughdesign.cosineFamily_target · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:261
theorem fairNull_target

The fair null has zero contrast at the target. The displayed conclusion follows.

Formal statement
theta fairNull = 0
Proof (Lean source)
-- @node: fairNull_target lemma fairNull_target : theta fairNull = 0 := by change (1 / 2 : ℝ) - 1 / 2 = 0 ring
theorem fairNull_exchangeability

The fair null's treatment is independent of its potential outcomes given the covariate. the asserted conclusion follows.

Formal statement
Proof (Lean source)
-- @node: fairNull_exchangeability lemma fairNull_exchangeability : Exchangeability fairNull := binaryCausalLaw_exchangeability _ _ _ measurable_const measurable_const measurable_const fair_parameters_range
CausalSmith.Stat.PrivateCateRoughdesign.fairNull_exchangeability · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:273
theorem cosineFamily_exchangeability

Each shared-sign law has conditionally independent treatment and potential outcomes. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
lam :
Proof (Lean source)
CausalSmith.Stat.PrivateCateRoughdesign.cosineFamily_exchangeability · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:279
theorem fairNull_completeModel

The fair null satisfies all conditions of the complete causal model. The displayed conclusion follows.

Formal statement
Proof (Lean source)
-- @node: fairNull_completeModel lemma fairNull_completeModel : CompleteModel fairNull := by apply binaryCausalLaw_completeModel (fun _ => 1/2) (fun _ => 1/2) (fun _ => 1/2) measurable_const measurable_const measurable_const fair_parameters_range fairNull_exchangeability · intro x norm_num · intro x y simp only [sub_self, abs_zero] exact mul_nonneg (by norm_num [L]) (Real.rpow_nonneg (abs_nonneg _) _) · intro x y simp only [sub_self, abs_zero] exact mul_nonneg (by norm_num [L]) (Real.rpow_nonneg (abs_nonneg _) _) · intro x y simp only [sub_self, abs_zero] exact mul_nonneg (by norm_num [L]) (abs_nonneg _)
CausalSmith.Stat.PrivateCateRoughdesign.fairNull_completeModel · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:287
theorem conditionalLikelihood_fourier Lemma conditionalLikelihood_fourier in the paper ↗

Expanding the four Bernoulli cells gives the Fourier likelihood relative to fair marks. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
lam :
x :
av yv :
conditionalLikelihood hL lam x av yv
= 1
+ (2*bit av-1)*sqrt (separation hL)*perturbation hL lam x
+ (2*bit yv-1)*sqrt (separation hL)*(separation hL*bump hL x-1)* perturbation hL lam x
+ (2*bit av-1)*(2*bit yv-1)*separation hL* (bump hL x-(perturbation hL lam x)^2)
Proof (Lean source)
-- @node: conditionalLikelihood_fourier lemma conditionalLikelihood_fourier (lam : SignVector hL) (x : Covariate) (av yv : Bool) : conditionalLikelihood hL lam x av yv = 1 + (2*bit av-1)*sqrt (separation hL)*perturbation hL lam x + (2*bit yv-1)*sqrt (separation hL)*(separation hL*bump hL x-1)* perturbation hL lam x + (2*bit av-1)*(2*bit yv-1)*separation hL* (bump hL x-(perturbation hL lam x)^2) := by have ht : 0 ≤ separation hL := by unfold separation kappa exact mul_nonneg (by norm_num) hhL.1.le have hs := Real.sq_sqrt ht cases av <;> cases yv <;> simp only [conditionalLikelihood, bernoulliMass, bit, Bool.false_eq_true, if_false, if_true, altE, altMu0, altMu1] <;> nlinarith [hs]
CausalSmith.Stat.PrivateCateRoughdesign.conditionalLikelihood_fourier · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:305
theorem conditionalLikelihood_sign_sum Lemma conditionalLikelihood_sign_sum in the paper ↗

Averaging the actual Fourier likelihood cancels both linear sign terms; its only remaining deviation from the fair likelihood is the squared-frame defect. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
x :
av yv :
(∑ lam : SignVector hL, conditionalLikelihood hL lam x av yv)
= (card (SignVector hL) : ℝ) * (1 + (2 * bit av - 1) * (2 * bit yv - 1) * separation hL * (bump hL x - bump hL x * ∑ j : activeSigns hL, (frame hL j x)^2))
Proof (Lean source)
-- @node: conditionalLikelihood_sign_sum lemma conditionalLikelihood_sign_sum (x : Covariate) (av yv : Bool) : (∑ lam : SignVector hL, conditionalLikelihood hL lam x av yv) = (card (SignVector hL) : ℝ) * (1 + (2 * bit av - 1) * (2 * bit yv - 1) * separation hL * (bump hL x - bump hL x * ∑ j : activeSigns hL, (frame hL j x)^2)) := by classical simp_rw [conditionalLikelihood_fourier hL hhL] simp only [Finset.sum_add_distrib, Finset.sum_sub_distrib, ← Finset.mul_sum, perturbation_sign_sum, perturbation_sign_square_sum, mul_zero, Finset.sum_const, Finset.card_univ, nsmul_eq_mul, add_zero] ring
CausalSmith.Stat.PrivateCateRoughdesign.conditionalLikelihood_sign_sum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:325
theorem sign_weight_normalization Lemma sign_weight_normalization in the paper ↗

The uniform sign weight times the number of binary sign vectors is one. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
ofReal ((2 : ℝ)^(-((activeSigns hL).card : ℤ))) * (card (SignVector hL) : ℝ≥0∞)
= 1
Proof (Lean source)
-- @node: sign_weight_normalization lemma sign_weight_normalization (hL : ℝ) : ofReal ((2 : ℝ)^(-((activeSigns hL).card : ℤ))) * (card (SignVector hL) : ℝ≥0∞) = 1 := by classical have hcard : card (SignVector hL) = 2 ^ (activeSigns hL).card := by simp [SignVector, Fintype.card_fun] rw [hcard, zpow_neg, zpow_natCast, ENNReal.ofReal_inv_of_pos (by positivity), ENNReal.ofReal_pow (by norm_num), ENNReal.ofReal_ofNat] norm_cast exact ENNReal.inv_mul_cancel (by positivity) (by finiteness)
CausalSmith.Stat.PrivateCateRoughdesign.sign_weight_normalization · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:340
theorem sign_weight_real_normalization Lemma sign_weight_real_normalization in the paper ↗

The real-valued uniform sign weight normalizes the finite number of vectors. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
(2 : ℝ)^(-((activeSigns hL).card : ℤ)) * (card (SignVector hL) : ℝ) = 1
Proof (Lean source)
-- @node: sign_weight_real_normalization lemma sign_weight_real_normalization (hL : ℝ) : (2 : ℝ)^(-((activeSigns hL).card : ℤ)) * (card (SignVector hL) : ℝ) = 1 := by classical have h := congrArg toReal (sign_weight_normalization hL) simpa only [ENNReal.toReal_mul, ENNReal.toReal_ofReal (le_of_lt (zpow_pos (by norm_num : (0 : ℝ) < 2) _)), ENNReal.toReal_natCast, ENNReal.toReal_one] using h
CausalSmith.Stat.PrivateCateRoughdesign.sign_weight_real_normalization · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:353

Integrating any real function against the sign law is its finite uniform average. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
F :
SignVector hL → ℝ
(∫ lam, F lam ∂signLaw hL) = (2 : ℝ)^(-((activeSigns hL).card : ℤ)) * ∑ lam, F lam
Proof (Lean source)
-- @node: integral_signLaw lemma integral_signLaw (F : SignVector hL → ℝ) : (∫ lam, F lam ∂signLaw hL) = (2 : ℝ)^(-((activeSigns hL).card : ℤ)) * ∑ lam, F lam := by classical rw [signLaw, integral_smul_measure, integral_finsetSum_measure] · simp only [integral_dirac, ENNReal.toReal_ofReal (le_of_lt (zpow_pos (by norm_num : (0 : ℝ) < 2) _)), smul_eq_mul] · intro lam _ exact integrable_dirac (by finiteness)

The nuisance perturbation has expectation zero under the actual sign probability law. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
x :
(∫ lam, perturbation hL lam x ∂signLaw hL) = 0
Proof (Lean source)
-- @node: perturbation_sign_mean lemma perturbation_sign_mean (x : Covariate) : (∫ lam, perturbation hL lam x ∂signLaw hL) = 0 := by rw [integral_signLaw, perturbation_sign_sum, mul_zero]
CausalSmith.Stat.PrivateCateRoughdesign.perturbation_sign_mean · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:374
theorem perturbation_sign_second_moment Lemma perturbation_sign_second_moment in the paper ↗

The actual sign-law second moment leaves only the squared-frame geometric factor. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
x :
(∫ lam, (perturbation hL lam x)^2 ∂signLaw hL)
= bump hL x * ∑ j : activeSigns hL, (frame hL j x)^2
Proof (Lean source)
-- @node: perturbation_sign_second_moment lemma perturbation_sign_second_moment (x : Covariate) : (∫ lam, (perturbation hL lam x)^2 ∂signLaw hL) = bump hL x * ∑ j : activeSigns hL, (frame hL j x)^2 := by classical rw [integral_signLaw, perturbation_sign_square_sum, ← mul_assoc, sign_weight_real_normalization, one_mul]
CausalSmith.Stat.PrivateCateRoughdesign.perturbation_sign_second_moment · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:380
theorem conditionalLikelihood_sign_mean Lemma conditionalLikelihood_sign_mean in the paper ↗

Under the actual sign law, the averaged likelihood has exactly the squared-frame defect. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
x :
av yv :
(∫ lam, conditionalLikelihood hL lam x av yv ∂signLaw hL)
= 1
+ (2 * bit av - 1) * (2 * bit yv - 1) * separation hL * (bump hL x - bump hL x * ∑ j : activeSigns hL, (frame hL j x)^2)
Proof (Lean source)
-- @node: conditionalLikelihood_sign_mean lemma conditionalLikelihood_sign_mean (x : Covariate) (av yv : Bool) : (∫ lam, conditionalLikelihood hL lam x av yv ∂signLaw hL) = 1 + (2 * bit av - 1) * (2 * bit yv - 1) * separation hL * (bump hL x - bump hL x * ∑ j : activeSigns hL, (frame hL j x)^2) := by classical rw [integral_signLaw, conditionalLikelihood_sign_sum hL hhL, ← mul_assoc, sign_weight_real_normalization, one_mul]
CausalSmith.Stat.PrivateCateRoughdesign.conditionalLikelihood_sign_mean · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:390
theorem perturbation_sign_second_moment_exact Lemma perturbation_sign_second_moment_exact in the paper ↗

The exact localized frame partition makes the sign second moment equal to the effect bump. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
x :
(∫ lam, (perturbation hL lam x)^2 ∂signLaw hL) = bump hL x
Proof (Lean source)
CausalSmith.Stat.PrivateCateRoughdesign.perturbation_sign_second_moment_exact · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:401
theorem conditionalLikelihood_sign_mean_one Lemma conditionalLikelihood_sign_mean_one in the paper ↗

The actual conditional likelihood has sign average one at every covariate and mark. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
x :
av yv :
(∫ lam, conditionalLikelihood hL lam x av yv ∂signLaw hL) = 1
Proof (Lean source)
-- @node: conditionalLikelihood_sign_mean_one lemma conditionalLikelihood_sign_mean_one (x : Covariate) (av yv : Bool) : (∫ lam, conditionalLikelihood hL lam x av yv ∂signLaw hL) = 1 := by rw [conditionalLikelihood_sign_mean hL hhL, weighted_frame_square_partition hL hhL] ring
CausalSmith.Stat.PrivateCateRoughdesign.conditionalLikelihood_sign_mean_one · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:408
theorem conditionalLikelihood_sign_sum_exact Lemma conditionalLikelihood_sign_sum_exact in the paper ↗

Summing the four-cell likelihood over all signs gives exactly the number of sign vectors. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
x :
av yv :
(∑ lam : SignVector hL, conditionalLikelihood hL lam x av yv)
= (card (SignVector hL) : ℝ)
Proof (Lean source)
CausalSmith.Stat.PrivateCateRoughdesign.conditionalLikelihood_sign_sum_exact · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:416
theorem conditional_mark_mass_sign_average Lemma conditional_mark_mass_sign_average in the paper ↗

The uniform average of every actual conditional Bernoulli mark mass is the fair mass. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
x :
av yv :
ofReal ((2 : ℝ)^(-((activeSigns hL).card : ℤ))) * ∑ lam : SignVector hL, ofReal (bernoulliMass (altE hL lam x) av * bernoulliMass (if av then altMu1 hL lam x else altMu0 hL lam x) yv)
= ofReal (1 / 4 : ℝ)
Proof (Lean source)
-- @node: conditional_mark_mass_sign_average lemma conditional_mark_mass_sign_average (x : Covariate) (av yv : Bool) : ofReal ((2 : ℝ)^(-((activeSigns hL).card : ℤ))) * ∑ lam : SignVector hL, ofReal (bernoulliMass (altE hL lam x) av * bernoulliMass (if av then altMu1 hL lam x else altMu0 hL lam x) yv) = ofReal (1 / 4 : ℝ) := by classical let m : SignVector hL → ℝ := fun lam => bernoulliMass (altE hL lam x) av * bernoulliMass (if av then altMu1 hL lam x else altMu0 hL lam x) yv have hm (lam : SignVector hL) : 0 ≤ m lam := by apply mul_nonneg (bernoulliMass_nonneg (alt_parameters_range hL hhL lam x).1 av) cases av · exact bernoulliMass_nonneg (alt_parameters_range hL hhL lam x).2.1 yv · exact bernoulliMass_nonneg (alt_parameters_range hL hhL lam x).2.2 yv have hsum : (2 : ℝ)^(-((activeSigns hL).card : ℤ)) * ∑ lam, m lam = 1 / 4 := by have hs := conditionalLikelihood_sign_sum_exact hL hhL x av yv simp only [conditionalLikelihood, mul_assoc] at hs change (∑ lam, 4 * (m lam)) = (card (SignVector hL) : ℝ) at hs rw [← Finset.mul_sum] at hs have hn := sign_weight_real_normalization hL calc _ = (2 : ℝ)^(-((activeSigns hL).card : ℤ)) * ((card (SignVector hL) : ℝ) / 4) := by rw [← hs]; ring _ = 1 / 4 := by rw [← mul_div_assoc, hn] change ofReal ((2 : ℝ)^(-((activeSigns hL).card : ℤ))) * ∑ lam, ofReal (m lam) = _ rw [← ENNReal.ofReal_sum_of_nonneg (fun lam _ => hm lam), ← ENNReal.ofReal_mul (le_of_lt (zpow_pos (by norm_num : (0 : ℝ) < 2) _)), hsum]
CausalSmith.Stat.PrivateCateRoughdesign.conditional_mark_mass_sign_average · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:425
theorem oneRecordMixture_eq_fairNull Lemma oneRecordMixture_eq_fairNull in the paper ↗

Averaging the observed one-record laws gives the fair null measure exactly. the asserted conclusion follows.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
Proof (Lean source)
-- @node: oneRecordMixture_eq_fairNull lemma oneRecordMixture_eq_fairNull : oneRecordMixture hL hhL = Pobs fairNull := by classical ext s hs let w := ofReal ((2 : ℝ)^(-((activeSigns hL).card : ℤ))) let f := fun (lam : SignVector hL) (x : Covariate) => ∑ z : Bool × Bool, ofReal (bernoulliMass (altE hL lam x) z.1 * bernoulliMass (if z.1 then altMu1 hL lam x else altMu0 hL lam x) z.2) * s.indicator (fun _ => (1 : ℝ≥0∞)) (x, z.1, z.2) have hfm (lam : SignVector hL) : Measurable (f lam) := by apply Finset.measurable_fun_sum intro z hz apply mul · cases z.1 <;> cases z.2 <;> unfold bernoulliMass <;> simp only [if_true, Bool.false_eq_true, if_false] <;> fun_prop · exact (measurable_const.indicator hs).comp (by fun_prop) have hobs (lam : SignVector hL) : Pobs (cosineFamily hL hhL lam) s = ∫⁻ x, f lam x := binaryCausalLaw_observed_apply _ _ _ (measurable_altE hL lam) (measurable_altMu0 hL lam) (measurable_altMu1 hL lam) (alt_parameters_range hL hhL lam) s hs have hnull : Pobs fairNull s = ∫⁻ x : Covariate, ∑ z : Bool × Bool, ofReal (1 / 4 : ℝ) * s.indicator (fun _ => (1 : ℝ≥0∞)) (x, z.1, z.2) := by rw [fairNull, binaryCausalLaw_observed_apply _ _ _ measurable_const measurable_const measurable_const fair_parameters_range s hs] apply lintegral_congr intro x apply Finset.sum_congr rfl intro z hz cases z.1 <;> cases z.2 <;> norm_num [bernoulliMass] simp only [oneRecordMixture, Measure.smul_apply, Measure.finsetSum_apply, smul_eq_mul] simp_rw [hobs] change w * (∑ lam, ∫⁻ x, f lam x) = _ rw [← lintegral_finsetSum _ (fun lam _ => hfm lam), ← lintegral_const_mul' w _ ENNReal.ofReal_ne_top, hnull] apply lintegral_congr intro x dsimp [f] rw [Finset.sum_comm, Finset.mul_sum] apply Finset.sum_congr rfl intro z hz rw [← Finset.sum_mul, ← mul_assoc] exact congrArg (fun a => a * s.indicator (fun _ => (1 : ℝ≥0∞)) (x, z.1, z.2)) (conditional_mark_mass_sign_average hL hhL x z.1 z.2)
CausalSmith.Stat.PrivateCateRoughdesign.oneRecordMixture_eq_fairNull · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:457
theorem cosineFamily_observed_domination

Each observed sign alternative is dominated by eight times the fair observed null. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1/4
lam :
Pobs (cosineFamily hL hhL lam) ≤ (8 : ℝ≥0∞) • Pobs fairNull
Proof (Lean source)
-- @node: cosineFamily_observed_domination lemma cosineFamily_observed_domination (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1/4) (lam : SignVector hL) : Pobs (cosineFamily hL hhL lam) ≤ (8 : ℝ≥0∞) • Pobs fairNull := by have hm : Measurable observe := by unfold observe A Y; fun_prop have h := Measure.map_mono (binaryLaw_fair_domination (altE hL lam) (altMu0 hL lam) (altMu1 hL lam) (measurable_altE hL lam) (measurable_altMu0 hL lam) (measurable_altMu1 hL lam) (alt_parameters_range hL hhL lam)) hm simpa only [Pobs, cosineFamily, fairNull, binaryCausalLaw, Measure.map_smul] using h
CausalSmith.Stat.PrivateCateRoughdesign.cosineFamily_observed_domination · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:503
theorem signMixture_domination

The finite sign mixture is dominated by eight to the sample-size power times the null dataset law. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1/4
n :
ℕ
signMixture hL hhL n ≤ (8 : ℝ≥0∞)^n • dataLaw n fairNull
Proof (Lean source)
-- @node: signMixture_domination lemma signMixture_domination (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1/4) (n : ℕ) : signMixture hL hhL n ≤ (8 : ℝ≥0∞)^n • dataLaw n fairNull := by classical have hm : Measurable observe := by unfold observe A Y; fun_prop letI : IsProbabilityMeasure (Pobs fairNull) := Measure.isProbabilityMeasure_map hm.aemeasurable letI : IsFiniteMeasure ((8 : ℝ≥0∞) • Pobs fairNull) := ⟨by simp⟩ have hd (lam : SignVector hL) : dataLaw n (cosineFamily hL hhL lam) ≤ (8 : ℝ≥0∞)^n • dataLaw n fairNull := by exact finite_product_measure_domination n _ _ 8 (cosineFamily_observed_domination hL hhL lam) apply Measure.le_iff.mpr intro s hs simp only [signMixture, Measure.smul_apply, Measure.finsetSum_apply, smul_eq_mul] calc _ ≤ ofReal ((2 : ℝ)^(-((activeSigns hL).card : ℤ))) * ∑ lam : SignVector hL, ((8 : ℝ≥0∞)^n • dataLaw n fairNull) s := mul_le_mul' le_rfl (Finset.sum_le_sum (fun lam _ => hd lam s)) _ = _ := by simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul, ← mul_assoc] rw [sign_weight_normalization, one_mul, Measure.smul_apply, smul_eq_mul]
CausalSmith.Stat.PrivateCateRoughdesign.signMixture_domination · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:514

The uniform finite sign law is a probability measure. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
Proof (Lean source)
-- @node: signLaw_probability lemma signLaw_probability (hL : ℝ) : IsProbabilityMeasure (signLaw hL) := by classical rw [isProbabilityMeasure_iff, signLaw] simp only [Measure.smul_apply, Measure.finsetSum_apply, Measure.dirac_apply_of_mem (Set.mem_univ _), smul_eq_mul, Finset.sum_const, Finset.card_univ, nsmul_eq_mul, mul_one] exact sign_weight_normalization hL
CausalSmith.Stat.PrivateCateRoughdesign.signLaw_probability · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:536
theorem signMixture_probability Lemma signMixture_probability in the paper ↗

The sign mixture of observed product laws is a probability measure. the theorem's stated inputs and assumptions, and the asserted conclusion follows.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1/4
n :
ℕ
Proof (Lean source)
-- @node: signMixture_probability lemma signMixture_probability (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1/4) (n : ℕ) : IsProbabilityMeasure (signMixture hL hhL n) := by classical have hm : Measurable observe := by unfold observe A Y; fun_prop letI (P : CausalLaw) : IsProbabilityMeasure (Pobs P) := Measure.isProbabilityMeasure_map hm.aemeasurable letI (P : CausalLaw) : IsProbabilityMeasure (dataLaw n P) := by unfold dataLaw; infer_instance rw [isProbabilityMeasure_iff, signMixture] simp only [Measure.smul_apply, Measure.finsetSum_apply, measure_univ, smul_eq_mul, Finset.sum_const, Finset.card_univ, nsmul_eq_mul, mul_one] exact sign_weight_normalization hL
CausalSmith.Stat.PrivateCateRoughdesign.signMixture_probability · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:545
theorem signMixture_absolutelyContinuous

The dataset sign mixture is absolutely continuous with respect to the fair null experiment. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1/4
n :
ℕ
Proof (Lean source)
-- @node: signMixture_absolutelyContinuous lemma signMixture_absolutelyContinuous (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1/4) (n : ℕ) : signMixture hL hhL n ≪ dataLaw n fairNull := Measure.absolutelyContinuous_of_le_smul (signMixture_domination hL hhL n)
CausalSmith.Stat.PrivateCateRoughdesign.signMixture_absolutelyContinuous · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:559
theorem signMixture_square_density_integrable

The squared density deviation of the sign mixture is integrable under the fair null experiment. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1/4
n :
ℕ
Integrable (fun z => (((signMixture hL hhL n).rnDeriv (dataLaw n fairNull) z).toReal - 1)^2) (dataLaw n fairNull)
Proof (Lean source)
-- @node: signMixture_square_density_integrable lemma signMixture_square_density_integrable (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1/4) (n : ℕ) : Integrable (fun z => (((signMixture hL hhL n).rnDeriv (dataLaw n fairNull) z).toReal - 1)^2) (dataLaw n fairNull) := by have hm : Measurable observe := by unfold observe A Y; fun_prop letI : IsProbabilityMeasure (Pobs fairNull) := Measure.isProbabilityMeasure_map hm.aemeasurable letI : IsProbabilityMeasure (dataLaw n fairNull) := by unfold dataLaw; infer_instance exact square_rnDeriv_integrable_of_domination _ _ ((8 : ℝ≥0∞)^n) (by positivity) (by finiteness) (signMixture_domination hL hhL n)
CausalSmith.Stat.PrivateCateRoughdesign.signMixture_square_density_integrable · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:565
def directMu1

The direct treated mean is one half plus the localized effect bump.

Definition (Lean source)
hL :
ℝ
shared
x :
directMu1 hL x :
ℝ
1/2 + separation hL*bump hL x

The direct treated mean is measurable. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
Proof (Lean source)
-- @node: measurable_directMu1 @[fun_prop] lemma measurable_directMu1 : Measurable (directMu1 hL) := by unfold directMu1 fun_prop
CausalSmith.Stat.PrivateCateRoughdesign.measurable_directMu1 · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:578
theorem direct_parameters_range Lemma direct_parameters_range in the paper ↗

The direct alternative has valid binary parameters at every legal macro radius. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
x :
↑CausalSmith.Stat.PrivateCateRoughdesign.Covariate
shared
x :
conclusion 1
(1/2 : ℝ) ∈ Icc 0 1
conclusion 2
(1/2 : ℝ) ∈ Icc 0 1
conclusion 3
directMu1 hL x ∈ Icc 0 1
Proof (Lean source)
-- @node: direct_parameters_range lemma direct_parameters_range : ∀ x : Covariate, (1/2 : ℝ) ∈ Icc 0 1 ∧ (1/2 : ℝ) ∈ Icc 0 1 ∧ directMu1 hL x ∈ Icc 0 1 := by intro x have hq := bump_range hL x have ht : 0 ≤ separation hL ∧ separation hL ≤ 1 / 2 := by unfold separation kappa norm_num at * constructor <;> nlinarith [hhL.1, hhL.2] have hp := mul_nonneg ht.1 hq.1 have hu := mul_le_mul_of_nonneg_left hq.2 ht.1 dsimp [directMu1] constructor · norm_num constructor · norm_num · constructor <;> nlinarith
CausalSmith.Stat.PrivateCateRoughdesign.direct_parameters_range · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineFamily.lean:584
def directAlternative

The direct localized causal law has fair treatment and control potential outcome and the specified perturbed treated potential outcome, followed by consistency.

Definition (Lean source)
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
directAlternative hL hhL :
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.CosineRegularity 14 declarations Global Lipschitz and Holder certificates for the shared-sign causal alternatives.

Global Lipschitz and Holder certificates for the shared-sign causal alternatives.

The micro radius is no larger than the macro radius in the published range. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hh :
0 < hL ∧ hL ≤ 1/4
deltaL hL ≤ hL
Proof (Lean source)
-- @node: deltaL_le_macro lemma deltaL_le_macro (hL : ℝ) (hh : 0 < hL ∧ hL ≤ 1/4) : deltaL hL ≤ hL := by have h1 : hL ≤ 1 := by linarith [hh.2] simpa only [deltaL, pow_one] using pow_le_pow_of_le_one hh.1.le h1 (by norm_num : 1 ≤ 5)
theorem signed_frame_difference_bound Lemma signed_frame_difference_bound in the paper ↗

Only frames supported at one of the two points contribute to the signed-sum difference. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hh :
0 < hL ∧ hL ≤ 1/4
lam :
x y :
|(∑ j : activeSigns hL, (2*bit (lam j)-1)*frame hL j x)
- (∑ j : activeSigns hL, (2*bit (lam j)-1)*frame hL j y)|
≤ (3*pi/deltaL hL)*|(x : ℝ)-y|
Proof (Lean source)
-- @node: signed_frame_difference_bound lemma signed_frame_difference_bound (hL : ℝ) (hh : 0 < hL ∧ hL ≤ 1/4) (lam : SignVector hL) (x y : Covariate) : |(∑ j : activeSigns hL, (2*bit (lam j)-1)*frame hL j x) - (∑ j : activeSigns hL, (2*bit (lam j)-1)*frame hL j y)| ≤ (3*pi/deltaL hL)*|(x : ℝ)-y| := by classical have hd : 0 < deltaL hL := pow_pos hh.1 5 let sx := Finset.univ.filter (fun j : activeSigns hL => |(x : ℝ)-(j : ℤ)*deltaL hL| ≤ deltaL hL) let sy := Finset.univ.filter (fun j : activeSigns hL => |(y : ℝ)-(j : ℤ)*deltaL hL| ≤ deltaL hL) let v (j : activeSigns hL) := (2*bit (lam j)-1)*(frame hL j x-frame hL j y) have he : (∑ j : activeSigns hL, v j) = ∑ j ∈ sx ∪ sy, v j := by symm apply Finset.sum_subset (Finset.subset_univ _) intro j hj hnot have hn : j ∉ sx ∧ j ∉ sy := by simpa using hnot have hx : ¬ |(x : ℝ)-(j : ℤ)*deltaL hL| ≤ deltaL hL := by simpa [sx] using hn.1 have hy : ¬ |(y : ℝ)-(j : ℤ)*deltaL hL| ≤ deltaL hL := by simpa [sy] using hn.2 simp [v, frame, hx, hy] have hcard : (sx ∪ sy).card ≤ 6 := by have hx := frame_support_card_le hL hh x have hy := frame_support_card_le hL hh y change sx.card ≤ 3 at hx change sy.card ≤ 3 at hy exact (Finset.card_union_le sx sy).trans (by omega) have hv (j : activeSigns hL) : |v j| ≤ (pi/(2*deltaL hL))*|(x : ℝ)-y| := by have hb : |2*bit (lam j)-1| = 1 := by cases h : lam j <;> norm_num [bit, h] simpa only [v, abs_mul, hb, one_mul] using frame_difference_bound hL hh.1 j x y rw [← Finset.sum_sub_distrib] simp only [← mul_sub] change |∑ j : activeSigns hL, v j| ≤ _ rw [he] calc _ ≤ ∑ j ∈ sx ∪ sy, |v j| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ j ∈ sx ∪ sy, (pi/(2*deltaL hL))*|(x : ℝ)-y| := Finset.sum_le_sum (fun j hj => hv j) _ = ((sx ∪ sy).card : ℝ)*((pi/(2*deltaL hL))*|(x : ℝ)-y|) := by simp _ ≤ 6*((pi/(2*deltaL hL))*|(x : ℝ)-y|) := by apply mul_le_mul_of_nonneg_right (by exact_mod_cast hcard) (by positivity) _ = _ := by ring
CausalSmith.Stat.PrivateCateRoughdesign.signed_frame_difference_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineRegularity.lean:17
theorem signed_frame_abs_le_three Lemma signed_frame_abs_le_three in the paper ↗

The same support counting bounds the unlocalized signed sum by three. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hh :
0 < hL ∧ hL ≤ 1/4
lam :
x :
|∑ j : activeSigns hL, (2*bit (lam j)-1)*frame hL j x| ≤ 3
Proof (Lean source)
-- @node: signed_frame_abs_le_three lemma signed_frame_abs_le_three (hL : ℝ) (hh : 0 < hL ∧ hL ≤ 1/4) (lam : SignVector hL) (x : Covariate) : |∑ j : activeSigns hL, (2*bit (lam j)-1)*frame hL j x| ≤ 3 := by classical calc _ ≤ ∑ j : activeSigns hL, |(2*bit (lam j)-1)*frame hL j x| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ j : activeSigns hL, if |(x : ℝ)-(j : ℤ)*deltaL hL| ≤ deltaL hL then (1 : ℝ) else 0 := by apply Finset.sum_le_sum intro j hj have hb : |2*bit (lam j)-1| = 1 := by cases h : lam j <;> norm_num [bit, h] simpa only [abs_mul, hb, one_mul] using frame_abs_le hL j x _ = ((Finset.univ.filter (fun j : activeSigns hL => |(x : ℝ)-(j : ℤ)*deltaL hL| ≤ deltaL hL)).card : ℝ) := by simp [← Finset.sum_filter] _ ≤ 3 := by exact_mod_cast frame_support_card_le hL hh x
CausalSmith.Stat.PrivateCateRoughdesign.signed_frame_abs_le_three · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineRegularity.lean:64
theorem perturbation_difference_bound Lemma perturbation_difference_bound in the paper ↗

Multiplication by the macro envelope preserves a uniform micro-scale Lipschitz modulus. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hh :
0 < hL ∧ hL ≤ 1/4
lam :
x y :
|perturbation hL lam x-perturbation hL lam y| ≤ (24/deltaL hL)*|(x : ℝ)-y|
Proof (Lean source)
-- @node: perturbation_difference_bound lemma perturbation_difference_bound (hL : ℝ) (hh : 0 < hL ∧ hL ≤ 1/4) (lam : SignVector hL) (x y : Covariate) : |perturbation hL lam x-perturbation hL lam y| ≤ (24/deltaL hL)*|(x : ℝ)-y| := by let s (z : Covariate) := ∑ j : activeSigns hL, (2*bit (lam j)-1)*frame hL j z have hs := signed_frame_difference_bound hL hh lam x y have hsy := signed_frame_abs_le_three hL hh lam y have hg := envelope_difference_bound hL hh.1 x y have hx := envelope_range hL x have hd : 0 < deltaL hL := pow_pos hh.1 5 have hinv : pi/hL ≤ pi/deltaL hL := div_le_div_of_nonneg_left Real.pi_pos.le hd (deltaL_le_macro hL hh) have he : perturbation hL lam x-perturbation hL lam y = envelope hL x*(s x-s y)+(envelope hL x-envelope hL y)*s y := by dsimp [perturbation, s]; ring rw [he] calc _ ≤ |envelope hL x*(s x-s y)|+|(envelope hL x-envelope hL y)*s y| := abs_add_le _ _ _ = envelope hL x*|s x-s y|+|envelope hL x-envelope hL y| *|s y| := by rw [abs_mul, abs_mul, abs_of_nonneg hx.1] _ ≤ 1*((3*pi/deltaL hL)*|(x : ℝ)-y|)+ ((pi/hL)*|(x : ℝ)-y|)*3 := add_le_add (mul_le_mul hx.2 hs (abs_nonneg _) (by norm_num)) (mul_le_mul hg hsy (abs_nonneg _) (mul_nonneg (div_nonneg Real.pi_pos.le hh.1.le) (abs_nonneg _))) _ ≤ (6*pi/deltaL hL)*|(x : ℝ)-y| := by have := mul_le_mul_of_nonneg_right hinv (abs_nonneg ((x : ℝ)-y)) have heq : (6*pi/deltaL hL)*|(x : ℝ)-y| = 3*((pi/deltaL hL)*|(x : ℝ)-y|)+ 3*((pi/deltaL hL)*|(x : ℝ)-y|) := by ring rw [heq] have heq2 : 1*((3*pi/deltaL hL)*|(x : ℝ)-y|) = 3*((pi/deltaL hL)*|(x : ℝ)-y|) := by ring rw [heq2] linarith _ ≤ _ := by apply mul_le_mul_of_nonneg_right _ (abs_nonneg _) apply div_le_div_of_nonneg_right _ hd.le linarith [Real.pi_lt_four]
CausalSmith.Stat.PrivateCateRoughdesign.perturbation_difference_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineRegularity.lean:84
theorem bump_micro_difference_bound Lemma bump_micro_difference_bound in the paper ↗

The effect bump satisfies the same coarse micro-scale modulus as the perturbation. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hh :
0 < hL ∧ hL ≤ 1/4
x y :
|bump hL x-bump hL y| ≤ (24/deltaL hL)*|(x : ℝ)-y|
Proof (Lean source)
-- @node: bump_micro_difference_bound lemma bump_micro_difference_bound (hL : ℝ) (hh : 0 < hL ∧ hL ≤ 1/4) (x y : Covariate) : |bump hL x-bump hL y| ≤ (24/deltaL hL)*|(x : ℝ)-y| := by have hd : 0 < deltaL hL := pow_pos hh.1 5 have hi := div_le_div_of_nonneg_left (by positivity : 0 ≤ 2*pi) hd (deltaL_le_macro hL hh) apply (bump_difference_bound hL hh.1 x y).trans apply mul_le_mul_of_nonneg_right _ (abs_nonneg _) apply hi.trans apply div_le_div_of_nonneg_right _ hd.le linarith [Real.pi_lt_four]
CausalSmith.Stat.PrivateCateRoughdesign.bump_micro_difference_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineRegularity.lean:125

The micro radius to the one-tenth power is exactly the square root of the macro radius. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
hh :
0 < hL
(deltaL hL)^(1/10 : ℝ) = sqrt hL
Proof (Lean source)
-- @node: deltaL_tenth_power lemma deltaL_tenth_power (hL : ℝ) (hh : 0 < hL) : (deltaL hL)^(1/10 : ℝ) = sqrt hL := by rw [deltaL, ← Real.rpow_natCast_mul hh.le, Real.sqrt_eq_rpow] norm_num

The square-root amplitude cancels the micro-scale Holder loss with a small constant. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
hh :
0 < hL
sqrt (separation hL) / (deltaL hL)^(1/10 : ℝ) = 1/64
Proof (Lean source)
-- @node: separation_sqrt_scale lemma separation_sqrt_scale (hL : ℝ) (hh : 0 < hL) : sqrt (separation hL) / (deltaL hL)^(1/10 : ℝ) = 1/64 := by have hk : kappa = (1/64 : ℝ)^2 := by norm_num [kappa] rw [deltaL_tenth_power hL hh, separation, hk, Real.sqrt_mul (sq_nonneg _), Real.sqrt_sq (by norm_num : (0 : ℝ) ≤ 1/64)] exact mul_div_cancel_right₀ _ (Real.sqrt_pos.mpr hh).ne'
CausalSmith.Stat.PrivateCateRoughdesign.separation_sqrt_scale · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineRegularity.lean:145

The small effect amplitude is bounded by the square-root amplitude. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hh :
0 < hL ∧ hL ≤ 1/4
conclusion 1
0 ≤ separation hL
conclusion 2
Proof (Lean source)
-- @node: separation_le_sqrt lemma separation_le_sqrt (hL : ℝ) (hh : 0 < hL ∧ hL ≤ 1/4) : 0 ≤ separation hL ∧ separation hL ≤ sqrt (separation hL) := by have ht : 0 ≤ separation hL ∧ separation hL ≤ 1 := by norm_num [separation, kappa] constructor <;> linarith [hh.1, hh.2] refine ⟨ht.1, ?_⟩ nlinarith [Real.sq_sqrt ht.1, Real.sqrt_nonneg (separation hL), mul_nonneg ht.1 (sub_nonneg.mpr ht.2)]
theorem perturbation_holder_bound Lemma perturbation_holder_bound in the paper ↗

The perturbation's two-scale bounds imply the one-tenth Holder modulus. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hh :
0 < hL ∧ hL ≤ 1/4
lam :
x y :
|perturbation hL lam x-perturbation hL lam y|
≤ 24*|(x : ℝ)-y|^(1/10 : ℝ)/(deltaL hL)^(1/10 : ℝ)
Proof (Lean source)
-- @node: perturbation_holder_bound lemma perturbation_holder_bound (hL : ℝ) (hh : 0 < hL ∧ hL ≤ 1/4) (lam : SignVector hL) (x y : Covariate) : |perturbation hL lam x-perturbation hL lam y| ≤ 24*|(x : ℝ)-y|^(1/10 : ℝ)/(deltaL hL)^(1/10 : ℝ) := by apply holder_modulus_of_two_bounds _ _ _ _ (pow_pos hh.1 5) (abs_nonneg _) (by norm_num) · have hx := perturbation_abs_le_three hL hh lam x have hy := perturbation_abs_le_three hL hh lam y linarith [abs_sub (perturbation hL lam x) (perturbation hL lam y)] · convert perturbation_difference_bound hL hh lam x y using 1 <;> dsimp [deltaL] <;> ring
CausalSmith.Stat.PrivateCateRoughdesign.perturbation_holder_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineRegularity.lean:165

The bounded effect bump has the analogous one-tenth Holder modulus. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
hh :
0 < hL ∧ hL ≤ 1/4
x y :
|bump hL x-bump hL y| ≤ 24*|(x : ℝ)-y|^(1/10 : ℝ)/(deltaL hL)^(1/10 : ℝ)
Proof (Lean source)
-- @node: bump_holder_bound lemma bump_holder_bound (hL : ℝ) (hh : 0 < hL ∧ hL ≤ 1/4) (x y : Covariate) : |bump hL x-bump hL y| ≤ 24*|(x : ℝ)-y|^(1/10 : ℝ)/(deltaL hL)^(1/10 : ℝ) := by apply holder_modulus_of_two_bounds _ _ _ _ (pow_pos hh.1 5) (abs_nonneg _) (by norm_num) · have hx := bump_range hL x have hy := bump_range hL y rw [abs_le] constructor <;> linarith [hx.1, hx.2, hy.1, hy.2] · convert bump_micro_difference_bound hL hh x y using 1 <;> dsimp [deltaL] <;> ring
theorem cosineFamily_propensity_holder

The actual propensity satisfies the model's radius-three Holder requirement. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hh :
0 < hL ∧ hL ≤ 1/4
lam :
Proof (Lean source)
-- @node: cosineFamily_propensity_holder lemma cosineFamily_propensity_holder (hL : ℝ) (hh : 0 < hL ∧ hL ≤ 1/4) (lam : SignVector hL) : PropensityHolder (cosineFamily hL hh lam) := by intro x y change |altE hL lam x-altE hL lam y| ≤ _ have he : altE hL lam x-altE hL lam y = sqrt (separation hL)*(perturbation hL lam x-perturbation hL lam y)/2 := by dsimp [altE]; ring rw [he, abs_div, abs_mul, abs_of_nonneg (Real.sqrt_nonneg _)] rw [abs_of_pos (by norm_num : (0 : ℝ) < 2)] have hb := mul_le_mul_of_nonneg_left (perturbation_holder_bound hL hh lam x y) (Real.sqrt_nonneg (separation hL)) have hs := separation_sqrt_scale hL hh.1 have hid : sqrt (separation hL)*(24*|(x : ℝ)-y|^(1/10 : ℝ)/ (deltaL hL)^(1/10 : ℝ)) = (3/8)*|(x : ℝ)-y|^(1/10 : ℝ) := by calc _ = 24*|(x : ℝ)-y|^(1/10 : ℝ)* (sqrt (separation hL)/(deltaL hL)^(1/10 : ℝ)) := by ring _ = _ := by rw [hs]; ring rw [hid] at hb dsimp [L] nlinarith [Real.rpow_nonneg (abs_nonneg ((x : ℝ)-y)) (1/10 : ℝ)]
CausalSmith.Stat.PrivateCateRoughdesign.cosineFamily_propensity_holder · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineRegularity.lean:189
theorem cosineFamily_control_holder

The actual control mean satisfies the model's radius-three Holder requirement. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hh :
0 < hL ∧ hL ≤ 1/4
lam :
Proof (Lean source)
-- @node: cosineFamily_control_holder lemma cosineFamily_control_holder (hL : ℝ) (hh : 0 < hL ∧ hL ≤ 1/4) (lam : SignVector hL) : ControlHolder (cosineFamily hL hh lam) := by intro x y change |altMu0 hL lam x-altMu0 hL lam y| ≤ _ have he : altMu0 hL lam x-altMu0 hL lam y = -(sqrt (separation hL)*(perturbation hL lam x-perturbation hL lam y)+ separation hL*(bump hL x-bump hL y))/2 := by dsimp [altMu0]; ring have ht := separation_le_sqrt hL hh have hb := perturbation_holder_bound hL hh lam x y have hq := bump_holder_bound hL hh x y let B := 24*|(x : ℝ)-y|^(1/10 : ℝ)/(deltaL hL)^(1/10 : ℝ) have hB : 0 ≤ B := div_nonneg (mul_nonneg (by norm_num) (Real.rpow_nonneg (abs_nonneg _) _)) (Real.rpow_nonneg (pow_pos hh.1 5).le _) have hs : sqrt (separation hL)*B = (3/8)*|(x : ℝ)-y|^(1/10 : ℝ) := by dsimp [B] calc _ = 24*|(x : ℝ)-y|^(1/10 : ℝ)* (sqrt (separation hL)/(deltaL hL)^(1/10 : ℝ)) := by ring _ = _ := by rw [separation_sqrt_scale hL hh.1]; ring have hp := mul_le_mul_of_nonneg_left hb (Real.sqrt_nonneg (separation hL)) have hqb := (mul_le_mul_of_nonneg_left hq ht.1).trans (mul_le_mul_of_nonneg_right ht.2 hB) change sqrt (separation hL)*|perturbation hL lam x-perturbation hL lam y| ≤ sqrt (separation hL)*B at hp rw [hs] at hp hqb have ha := abs_add_le (sqrt (separation hL)*(perturbation hL lam x-perturbation hL lam y)) (separation hL*(bump hL x-bump hL y)) simp only [abs_mul, abs_of_nonneg (Real.sqrt_nonneg _), abs_of_nonneg ht.1] at ha rw [he, abs_div, abs_neg] rw [abs_of_pos (by norm_num : (0 : ℝ) < 2)] dsimp [L] nlinarith [Real.rpow_nonneg (abs_nonneg ((x : ℝ)-y)) (1/10 : ℝ)]
CausalSmith.Stat.PrivateCateRoughdesign.cosineFamily_control_holder · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineRegularity.lean:213
theorem cosineFamily_contrast_lipschitz

Nuisance cancellation and the effect-bump modulus give the required contrast regularity. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hh :
0 < hL ∧ hL ≤ 1/4
lam :
Proof (Lean source)
-- @node: cosineFamily_contrast_lipschitz lemma cosineFamily_contrast_lipschitz (hL : ℝ) (hh : 0 < hL ∧ hL ≤ 1/4) (lam : SignVector hL) : ContrastLipschitz (cosineFamily hL hh lam) := by intro x y rw [cosineFamily_contrast, cosineFamily_contrast, ← mul_sub, abs_mul] have ht : 0 ≤ separation hL := (separation_le_sqrt hL hh).1 rw [abs_of_nonneg ht] calc _ ≤ separation hL*((2*pi/hL)*|(x : ℝ)-y|) := mul_le_mul_of_nonneg_left (bump_difference_bound hL hh.1 x y) ht _ = (2*pi*kappa)*|(x : ℝ)-y| := by unfold separation; field_simp [hh.1.ne'] _ ≤ L*|(x : ℝ)-y| := by apply mul_le_mul_of_nonneg_right _ (abs_nonneg _) norm_num [kappa, L] linarith [Real.pi_lt_four]
CausalSmith.Stat.PrivateCateRoughdesign.cosineFamily_contrast_lipschitz · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineRegularity.lean:250
theorem cosineFamily_completeModel

Every shared-sign alternative belongs to the complete model, with all three regularity requirements derived from its explicit cosine construction. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hh :
0 < hL ∧ hL ≤ 1/4
lam :
Proof (Lean source)
-- @node: cosineFamily_completeModel lemma cosineFamily_completeModel (hL : ℝ) (hh : 0 < hL ∧ hL ≤ 1/4) (lam : SignVector hL) : CompleteModel (cosineFamily hL hh lam) := by exact binaryCausalLaw_completeModel _ _ _ (measurable_altE hL lam) (measurable_altMu0 hL lam) (measurable_altMu1 hL lam) (alt_parameters_range hL hh lam) (cosineFamily_exchangeability hL hh lam) (altE_overlap hL hh lam) (cosineFamily_propensity_holder hL hh lam) (cosineFamily_control_holder hL hh lam) (cosineFamily_contrast_lipschitz hL hh lam)
CausalSmith.Stat.PrivateCateRoughdesign.cosineFamily_completeModel · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/CosineRegularity.lean:267
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.DatasetMarginals 20 declarations Finite atomic product kernels identify the integrated conditional dataset laws with the sign mixture and null product experiment, certifying the coupling marginals.

Finite atomic product kernels identify the integrated conditional dataset laws with the sign mixture and null product experiment, certifying the coupling marginals.

Independent finite atomic laws expand into the array of products of their weights. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
ι α β :
w :
ι → α → ℝ≥0∞
f :
ι → α → β
hw :
∀ i a, w i a ≠ ⊤
Measure.pi (fun i => ∑ a, w i a • Measure.dirac (f i a))
= ∑ z : ι → α, (∏ i, w i (z i)) • Measure.dirac (fun i => f i (z i))
Proof (Lean source)
-- @node: pi_finite_atomic lemma pi_finite_atomic {ι α β : Type*} [Fintype ι] [DecidableEq ι] [Fintype α] [MeasurableSpace β] (w : ι → α → ℝ≥0∞) (f : ι → α → β) (hw : ∀ i a, w i a ≠ ⊤) : Measure.pi (fun i => ∑ a, w i a • Measure.dirac (f i a)) = ∑ z : ι → α, (∏ i, w i (z i)) • Measure.dirac (fun i => f i (z i)) := by classical let (i : ι) : IsFiniteMeasure (∑ a, w i a • Measure.dirac (f i a)) := by constructor simpa [Measure.finsetSum_apply, Measure.smul_apply, smul_eq_mul] using (ENNReal.sum_lt_top.mpr (fun a (_ : a ∈ (Finset.univ : Finset α)) => (hw i a).lt_top)) apply Measure.pi_eq intro s hs simp only [Measure.finsetSum_apply, Measure.smul_apply, smul_eq_mul, Measure.dirac_apply' _ (MeasurableSet.univ_pi hs)] simp only [Measure.dirac_apply' _ (hs _)] rw [Fintype.prod_sum] apply Finset.sum_congr rfl intro z _ by_cases hz : ∀ i, f i (z i) ∈ s i · simp [Set.mem_pi, hz] · obtain ⟨i, hi⟩ := not_forall.mp hz have hprod : (∏ j, w j (z j) * (s j).indicator (1 : β → ℝ≥0∞) (f j (z j))) = 0 := by apply Finset.prod_eq_zero (Finset.mem_univ i) simp [hi] simpa [Set.mem_pi, hz] using hprod.symm

The conditional observed law for a fixed sign vector at one covariate.

Definition (Lean source)
hL :
ℝ
lam :
x :
conditionalSignRecordLaw hL lam x :
∑ z : Bool × Bool, ofReal (conditionalLikelihood hL lam x z.1 z.2 / 4) • Measure.dirac (x, z.1, z.2)
CausalSmith.Stat.PrivateCateRoughdesign.conditionalSignRecordLaw · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DatasetMarginals.lean:40
theorem measurable_conditionalSignRecordLaw

The fixed-sign conditional record law varies measurably with the covariate. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
lam :
Proof (Lean source)
-- @node: measurable_conditionalSignRecordLaw @[fun_prop] lemma measurable_conditionalSignRecordLaw (hL : ℝ) (lam : SignVector hL) : Measurable (conditionalSignRecordLaw hL lam) := by apply Measure.measurable_of_measurable_coe intro E hE simp only [conditionalSignRecordLaw, Measure.finsetSum_apply, Measure.smul_apply, Measure.dirac_apply' _ hE, smul_eq_mul] apply Finset.measurable_sum intro z _ apply mul · fun_prop · exact (measurable_const.indicator hE).comp (by fun_prop)
CausalSmith.Stat.PrivateCateRoughdesign.measurable_conditionalSignRecordLaw · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DatasetMarginals.lean:46
theorem conditionalSignRecordLaw_isProbabilityMeasure

Each fixed-sign conditional record law is a probability measure. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
lam :
x :
Proof (Lean source)
-- @node: conditionalSignRecordLaw_isProbabilityMeasure lemma conditionalSignRecordLaw_isProbabilityMeasure (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (lam : SignVector hL) (x : Covariate) : IsProbabilityMeasure (conditionalSignRecordLaw hL lam x) := by constructor simp only [conditionalSignRecordLaw, Measure.finsetSum_apply, Measure.smul_apply, Measure.dirac_apply_of_mem (Set.mem_univ _), smul_eq_mul, mul_one] rw [← ENNReal.ofReal_sum_of_nonneg (fun z _ => div_nonneg (conditionalLikelihood_nonneg hL hhL lam x z.1 z.2) (by norm_num)), conditionalLikelihood_mark_sum, ENNReal.ofReal_one]
CausalSmith.Stat.PrivateCateRoughdesign.conditionalSignRecordLaw_isProbabilityMeasure · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DatasetMarginals.lean:60

The fixed-sign observation kernel attaches the covariate to its conditional marks.

Definition (Lean source)
hL :
ℝ
lam :
signRecordKernel hL lam :
clause 1
toFun := conditionalSignRecordLaw hL lam
clause 2
theorem signRecordKernel_isMarkovKernel

The fixed-sign observation kernel is everywhere probability-valued. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
lam :
Proof (Lean source)
-- @node: signRecordKernel_isMarkovKernel lemma signRecordKernel_isMarkovKernel (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (lam : SignVector hL) : IsMarkovKernel (signRecordKernel hL lam) := ⟨conditionalSignRecordLaw_isProbabilityMeasure hL hhL lam⟩
CausalSmith.Stat.PrivateCateRoughdesign.signRecordKernel_isMarkovKernel · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DatasetMarginals.lean:78
theorem signRecordKernel_comp_volume

Integrating a fixed-sign conditional record reproduces the observed causal law. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
lam :
signRecordKernel hL lam ∘ₘ (volume : Measure Covariate) = Pobs (cosineFamily hL hhL lam)
Proof (Lean source)
-- @node: signRecordKernel_comp_volume lemma signRecordKernel_comp_volume (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (lam : SignVector hL) : signRecordKernel hL lam ∘ₘ (volume : Measure Covariate) = Pobs (cosineFamily hL hhL lam) := by ext E hE change ((volume : Measure Covariate).bind (conditionalSignRecordLaw hL lam)) E = _ rw [Measure.bind_apply hE (measurable_conditionalSignRecordLaw hL lam).aemeasurable] rw [cosineFamily, binaryCausalLaw_observed_apply _ _ _ (measurable_altE hL lam) (measurable_altMu0 hL lam) (measurable_altMu1 hL lam) (alt_parameters_range hL hhL lam) E hE] apply lintegral_congr intro x simp only [conditionalSignRecordLaw, Measure.finsetSum_apply, Measure.smul_apply, Measure.dirac_apply' _ hE, smul_eq_mul] apply Finset.sum_congr rfl intro z _ congr 2 dsimp [conditionalLikelihood] ring
CausalSmith.Stat.PrivateCateRoughdesign.signRecordKernel_comp_volume · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DatasetMarginals.lean:84

Given fixed signs, the conditional dataset law has independent mark weights.

Definition (Lean source)
hL :
ℝ
n :
ℕ
lam :
x :
conditionalSignDatasetLaw hL n lam x :
∑ z : Fin n → Bool × Bool, ofReal (∏ i, conditionalLikelihood hL lam (x i) (z i).1 (z i).2 / 4) • Measure.dirac (attachMarks n x z)
CausalSmith.Stat.PrivateCateRoughdesign.conditionalSignDatasetLaw · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DatasetMarginals.lean:106
theorem conditionalSignDatasetLaw_eq_product

The conditional fixed-sign dataset array equals the coordinatewise product kernel. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
lam :
x :
Proof (Lean source)
-- @node: conditionalSignDatasetLaw_eq_product lemma conditionalSignDatasetLaw_eq_product (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (lam : SignVector hL) (x : Fin n → Covariate) : conditionalSignDatasetLaw hL n lam x = finProductKernel n (signRecordKernel hL lam) x := by let := signRecordKernel_isMarkovKernel hL hhL lam rw [finProductKernel_apply] change _ = Measure.pi (fun i => conditionalSignRecordLaw hL lam (x i)) dsimp only [conditionalSignRecordLaw, conditionalSignDatasetLaw] rw [pi_finite_atomic _ _ (fun _ _ => ENNReal.ofReal_ne_top)] apply Finset.sum_congr rfl intro z _ rw [ENNReal.ofReal_prod_of_nonneg (fun i _ => div_nonneg (conditionalLikelihood_nonneg hL hhL lam (x i) (z i).1 (z i).2) (by norm_num))] rfl
CausalSmith.Stat.PrivateCateRoughdesign.conditionalSignDatasetLaw_eq_product · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DatasetMarginals.lean:114
theorem measurable_conditionalSignDatasetLaw

The fixed-sign conditional dataset array is Borel measurable. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
lam :
Proof (Lean source)
-- @node: measurable_conditionalSignDatasetLaw @[fun_prop] lemma measurable_conditionalSignDatasetLaw (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (lam : SignVector hL) : Measurable (conditionalSignDatasetLaw hL n lam) := by have heq : conditionalSignDatasetLaw hL n lam = finProductKernel n (signRecordKernel hL lam) := by funext x exact conditionalSignDatasetLaw_eq_product hL hhL n lam x rw [heq] exact Kernel.measurable _
CausalSmith.Stat.PrivateCateRoughdesign.measurable_conditionalSignDatasetLaw · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DatasetMarginals.lean:132
theorem conditionalSignDatasetLaw_bind_eq_dataLaw

Integrating a fixed-sign dataset kernel yields the observed product law. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
lam :
(Measure.pi (fun _ : Fin n => (volume : Measure Covariate))).bind (conditionalSignDatasetLaw hL n lam)
= dataLaw n (cosineFamily hL hhL lam)
Proof (Lean source)
-- @node: conditionalSignDatasetLaw_bind_eq_dataLaw lemma conditionalSignDatasetLaw_bind_eq_dataLaw (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (lam : SignVector hL) : (Measure.pi (fun _ : Fin n => (volume : Measure Covariate))).bind (conditionalSignDatasetLaw hL n lam) = dataLaw n (cosineFamily hL hhL lam) := by let := signRecordKernel_isMarkovKernel hL hhL lam have heq : conditionalSignDatasetLaw hL n lam = finProductKernel n (signRecordKernel hL lam) := by funext x exact conditionalSignDatasetLaw_eq_product hL hhL n lam x rw [heq, finProductKernel_comp_pi, signRecordKernel_comp_volume hL hhL] rfl
CausalSmith.Stat.PrivateCateRoughdesign.conditionalSignDatasetLaw_bind_eq_dataLaw · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DatasetMarginals.lean:144
theorem conditionalAlternativeDatasetLaw_eq_sign_sum

The conditional alternative law is the uniform mixture of the fixed-sign dataset kernels. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
x :
= ofReal ((2 : ℝ)^(-((activeSigns hL).card : ℤ))) • ∑ lam : SignVector hL, conditionalSignDatasetLaw hL n lam x
Proof (Lean source)
-- @node: conditionalAlternativeDatasetLaw_eq_sign_sum lemma conditionalAlternativeDatasetLaw_eq_sign_sum (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (x : Fin n → Covariate) : conditionalAlternativeDatasetLaw hL n x = ofReal ((2 : ℝ)^(-((activeSigns hL).card : ℤ))) • ∑ lam : SignVector hL, conditionalSignDatasetLaw hL n lam x := by classical have hp (z : Fin n → Bool × Bool) (lam : SignVector hL) : 0 ≤ ∏ i, conditionalLikelihood hL lam (x i) (z i).1 (z i).2 / 4 := by apply Finset.prod_nonneg intro i _ exact div_nonneg (conditionalLikelihood_nonneg hL hhL lam (x i) _ _) (by norm_num) simp only [conditionalAlternativeDatasetLaw, fullAlternativeMass, ENNReal.ofReal_mul (le_of_lt (zpow_pos (by norm_num : (0 : ℝ) < 2) _)), ENNReal.ofReal_sum_of_nonneg (fun lam _ => hp _ lam), mul_smul, Finset.sum_smul, ← Finset.smul_sum, conditionalSignDatasetLaw] rw [Finset.sum_comm]
CausalSmith.Stat.PrivateCateRoughdesign.conditionalAlternativeDatasetLaw_eq_sign_sum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DatasetMarginals.lean:158
theorem conditionalAlternativeDatasetLaw_bind_eq_signMixture

Integrating the alternative conditional law gives the specified mixture of product laws. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
(Measure.pi (fun _ : Fin n => (volume : Measure Covariate))).bind (conditionalAlternativeDatasetLaw hL n)
= signMixture hL hhL n
Proof (Lean source)
-- @node: conditionalAlternativeDatasetLaw_bind_eq_signMixture lemma conditionalAlternativeDatasetLaw_bind_eq_signMixture (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) : (Measure.pi (fun _ : Fin n => (volume : Measure Covariate))).bind (conditionalAlternativeDatasetLaw hL n) = signMixture hL hhL n := by classical ext E hE rw [Measure.bind_apply hE (measurable_conditionalAlternativeDatasetLaw hL n).aemeasurable] simp_rw [conditionalAlternativeDatasetLaw_eq_sign_sum hL hhL n] simp only [Measure.smul_apply, Measure.finsetSum_apply, smul_eq_mul] rw [lintegral_const_mul' _ _ ENNReal.ofReal_ne_top, lintegral_finsetSum (Finset.univ : Finset (SignVector hL)) (fun lam _ => (show Measurable (fun x => (conditionalSignDatasetLaw hL n lam x) E) from (Measure.measurable_coe hE).comp (measurable_conditionalSignDatasetLaw hL hhL n lam)))] simp only [signMixture, Measure.smul_apply, Measure.finsetSum_apply, smul_eq_mul] congr 1 apply Finset.sum_congr rfl intro lam _ rw [← conditionalSignDatasetLaw_bind_eq_dataLaw hL hhL n lam, Measure.bind_apply hE (measurable_conditionalSignDatasetLaw hL hhL n lam).aemeasurable]
CausalSmith.Stat.PrivateCateRoughdesign.conditionalAlternativeDatasetLaw_bind_eq_signMixture · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DatasetMarginals.lean:177
theorem commonMassCoupling_map_fst_signMixture

The constructed dataset coupling's first marginal is the actual sign-mixture experiment. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
Proof (Lean source)
CausalSmith.Stat.PrivateCateRoughdesign.commonMassCoupling_map_fst_signMixture · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DatasetMarginals.lean:199

The fair observation kernel attaches independent uniform binary marks to its covariate.

Definition (Lean source)
fairRecordKernel :
clause 1
toFun x := ∑ z : Bool × Bool, ofReal (1/4 : ℝ) • Measure.dirac (x, z.1, z.2)
clause 2
measurable' := by apply Measure.measurable_of_measurable_coe intro E hE simp only [Measure.finsetSum_apply, Measure.smul_apply, Measure.dirac_apply' _ hE, smul_eq_mul] apply Finset.measurable_sum intro z _ exact measurable_const.mul ((measurable_const.indicator hE).comp (by fun_prop))
instance fairRecordKernel_isMarkovKernel

The fair observation kernel is a Markov kernel.

Definition (Lean source)
-- @node: fairRecordKernel_isMarkovKernel instance fairRecordKernel_isMarkovKernel : IsMarkovKernel fairRecordKernel where isProbabilityMeasure x := by constructor change (∑ z : Bool × Bool, ofReal (1/4 : ℝ) • Measure.dirac (x, z.1, z.2)) univ = 1 simp only [Measure.finsetSum_apply, Measure.smul_apply, smul_eq_mul, Measure.dirac_apply_of_mem (Set.mem_univ _), mul_one] rw [← ENNReal.ofReal_sum_of_nonneg (fun _ _ => by norm_num)] norm_num [Fintype.sum_prod_type, Fintype.sum_bool]
CausalSmith.Stat.PrivateCateRoughdesign.fairRecordKernel_isMarkovKernel · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DatasetMarginals.lean:220
theorem fairRecordKernel_comp_volume

The fair conditional observation integrates to the observed null law. The displayed conclusion follows.

Formal statement
Proof (Lean source)
-- @node: fairRecordKernel_comp_volume lemma fairRecordKernel_comp_volume : fairRecordKernel ∘ₘ (volume : Measure Covariate) = Pobs fairNull := by ext E hE rw [Measure.bind_apply hE (Kernel.measurable fairRecordKernel).aemeasurable, fairNull, binaryCausalLaw_observed_apply _ _ _ measurable_const measurable_const measurable_const fair_parameters_range E hE] apply lintegral_congr intro x change (∑ z : Bool × Bool, ofReal (1/4 : ℝ) • Measure.dirac (x, z.1, z.2)) E = _ simp only [Measure.finsetSum_apply, Measure.smul_apply, Measure.dirac_apply' _ hE, smul_eq_mul] apply Finset.sum_congr rfl intro z _ cases z.1 <;> cases z.2 <;> norm_num [bernoulliMass, indicator, Pi.one_apply]
CausalSmith.Stat.PrivateCateRoughdesign.fairRecordKernel_comp_volume · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DatasetMarginals.lean:231
theorem conditionalNullDatasetLaw_eq_product

The fair conditional dataset array equals the coordinatewise fair observation kernel. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
x :
Proof (Lean source)
-- @node: conditionalNullDatasetLaw_eq_product lemma conditionalNullDatasetLaw_eq_product (n : ℕ) (x : Fin n → Covariate) : conditionalNullDatasetLaw n x = finProductKernel n fairRecordKernel x := by rw [finProductKernel_apply] change _ = Measure.pi (fun i => ∑ z : Bool × Bool, ofReal (1/4 : ℝ) • Measure.dirac (x i, z.1, z.2)) rw [pi_finite_atomic _ _ (fun _ _ => ENNReal.ofReal_ne_top)] dsimp only [conditionalNullDatasetLaw] apply Finset.sum_congr rfl intro z _ congr 1 rw [Finset.prod_const, Finset.card_univ, Fintype.card_fin, ← ENNReal.ofReal_pow (by norm_num : (0 : ℝ) ≤ 1/4)] congr 1 simp [zpow_neg, zpow_natCast, one_div]
CausalSmith.Stat.PrivateCateRoughdesign.conditionalNullDatasetLaw_eq_product · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DatasetMarginals.lean:248
theorem conditionalNullDatasetLaw_bind_eq_dataLaw

Integrating the fair conditional dataset law yields the null observed product law. The displayed conclusion follows.

Formal statement
n :
ℕ
(Measure.pi (fun _ : Fin n => (volume : Measure Covariate))).bind (conditionalNullDatasetLaw n)
Proof (Lean source)
CausalSmith.Stat.PrivateCateRoughdesign.conditionalNullDatasetLaw_bind_eq_dataLaw · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DatasetMarginals.lean:265
theorem commonMassCoupling_isCoupling

The Borel common-mass construction couples the two specified dataset experiments. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
Proof (Lean source)
CausalSmith.Stat.PrivateCateRoughdesign.commonMassCoupling_isCoupling · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DatasetMarginals.lean:276
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.DesignPairMoments 10 declarations Actual conditional design laws and cross-treatment pair moments.

Actual conditional design laws and cross-treatment pair moments.

def conditionalDesignLaw

The actual design distribution conditioned on a public cell.

Definition (Lean source)
h :
ℝ
k :
ℕ
P :
j :
Fin k
conditionalDesignLaw h k P j :
((PX P) (cell h k j))⁻¹ • (PX P).restrict (cell h k j)
CausalSmith.Stat.PrivateCateRoughdesign.conditionalDesignLaw · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DesignPairMoments.lean:9
theorem conditionalDesignLaw_probability

Every admissible public cell has a normalized conditional design law. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
k :
ℕ
h :
ℝ
hk :
0 < k
hh :
0 < h ∧ h ≤ 1 / 4
P :
hP :
j :
Fin k
Proof (Lean source)
-- @node: conditionalDesignLaw_probability lemma conditionalDesignLaw_probability (k : ℕ) (h : ℝ) (hk : 0 < k) (hh : 0 < h ∧ h ≤ 1 / 4) (P : CausalLaw) (hP : CompleteModel P) (j : Fin k) : IsProbabilityMeasure (conditionalDesignLaw h k P j) := by let : IsProbabilityMeasure (PX P) := Measure.isProbabilityMeasure_map measurable_X.aemeasurable have hp : 0 < cellMass h k P j := lt_of_lt_of_le (half_pos (cell_endpoint_bounds k h hk hh j).2.2.2) (cellMass_density_bounds k h hk hh P hP j).1 have hz : (PX P) (cell h k j) ≠ 0 := by intro hz simp [cellMass, measureReal_def, hz] at hp refine ⟨?_⟩ simp only [conditionalDesignLaw, Measure.smul_apply, Measure.restrict_apply MeasurableSet.univ, Set.univ_inter, smul_eq_mul] exact ENNReal.inv_mul_cancel hz (measure_ne_top _ _)
CausalSmith.Stat.PrivateCateRoughdesign.conditionalDesignLaw_probability · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DesignPairMoments.lean:15
theorem conditionalDesignLaw_integral

Conditional design integrals retain the actual within-cell density. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
k :
ℕ
h :
ℝ
P :
j :
Fin k
f :
Covariate → ℝ
(∫ x, f x ∂conditionalDesignLaw h k P j)
= (∫ x in cell h k j, f x ∂PX P) / cellMass h k P j
Proof (Lean source)
-- @node: conditionalDesignLaw_integral lemma conditionalDesignLaw_integral (k : ℕ) (h : ℝ) (P : CausalLaw) (j : Fin k) (f : Covariate → ℝ) : (∫ x, f x ∂conditionalDesignLaw h k P j) = (∫ x in cell h k j, f x ∂PX P) / cellMass h k P j := by rw [conditionalDesignLaw, integral_smul_measure, ENNReal.toReal_inv] simp only [cellMass, measureReal_def, smul_eq_mul, div_eq_mul_inv, mul_comm]
CausalSmith.Stat.PrivateCateRoughdesign.conditionalDesignLaw_integral · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DesignPairMoments.lean:32
theorem conditionalDesignLaw_pair_mem

Two independent conditional covariates belong to their conditioning cell almost surely. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
k :
ℕ
h :
ℝ
hk :
0 < k
hh :
0 < h ∧ h ≤ 1 / 4
P :
hP :
j :
Fin k
∀ᵐ z ∂(conditionalDesignLaw h k P j).prod (conditionalDesignLaw h k P j), z.1 ∈ cell h k j ∧ z.2 ∈ cell h k j
Proof (Lean source)
-- @node: conditionalDesignLaw_pair_mem lemma conditionalDesignLaw_pair_mem (k : ℕ) (h : ℝ) (hk : 0 < k) (hh : 0 < h ∧ h ≤ 1 / 4) (P : CausalLaw) (hP : CompleteModel P) (j : Fin k) : ∀ᵐ z ∂(conditionalDesignLaw h k P j).prod (conditionalDesignLaw h k P j), z.1 ∈ cell h k j ∧ z.2 ∈ cell h k j := by let μ := conditionalDesignLaw h k P j let : IsProbabilityMeasure μ := conditionalDesignLaw_probability k h hk hh P hP j have hm : ∀ᵐ x ∂μ, x ∈ cell h k j := Measure.ae_smul_measure (ae_restrict_mem (measurableSet_cell h k j)) _ apply (Measure.ae_prod_iff_ae_ae ((measurableSet_cell h k j).preimage measurable_fst |>.inter ((measurableSet_cell h k j).preimage measurable_snd))).mpr filter_upwards [hm] with x hx filter_upwards [hm] with y hy exact ⟨hx, hy⟩
CausalSmith.Stat.PrivateCateRoughdesign.conditionalDesignLaw_pair_mem · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DesignPairMoments.lean:41
def designPairNumerator

Cross-treatment numerator at two selected covariates.

Definition (Lean source)
designPairNumerator P z :
ℝ
P.e z.1 * (1 - P.e z.2) * (P.mu1 z.1 - P.mu0 z.2)
+ P.e z.2 * (1 - P.e z.1) * (P.mu1 z.2 - P.mu0 z.1)
def designPairDenominator

Cross-treatment probability at two selected covariates.

Definition (Lean source)
designPairDenominator P z :
ℝ
P.e z.1 * (1 - P.e z.2) + P.e z.2 * (1 - P.e z.1)
CausalSmith.Stat.PrivateCateRoughdesign.designPairDenominator · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DesignPairMoments.lean:64
theorem design_regressions_integrable

The propensity, arm means, and arm-response regressions are integrable under any finite covariate measure, because the complete model gives everywhere binary-mean bounds. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
conclusion 1
Integrable P.e μ
conclusion 2
Integrable (fun x => 1 - P.e x) μ
conclusion 3
Integrable (fun x => P.e x * P.mu1 x) μ
conclusion 4
Integrable (fun x => (1 - P.e x) * P.mu0 x) μ
Proof (Lean source)
-- @node: design_regressions_integrable lemma design_regressions_integrable (P : CausalLaw) (hP : CompleteModel P) (μ : Measure Covariate) [IsFiniteMeasure μ] : Integrable P.e μ ∧ Integrable (fun x => 1 - P.e x) μ ∧ Integrable (fun x => P.e x * P.mu1 x) μ ∧ Integrable (fun x => (1 - P.e x) * P.mu0 x) μ := by have hme := P.e_measurable have hmm0 := P.mu0_measurable have hmm1 := P.mu1_measurable have he : ∀ x, P.e x ∈ Icc (0 : ℝ) 1 := by intro x constructor <;> linarith [(hP.overlap x).1, (hP.overlap x).2] have hm0 (x) : P.mu0 x ∈ Icc (0 : ℝ) 1 := arm_mean_mem_Icc P hP false x have hm1 (x) : P.mu1 x ∈ Icc (0 : ℝ) 1 := arm_mean_mem_Icc P hP true x have hi : Integrable P.e μ := Integrable.of_mem_Icc 0 1 (by fun_prop) (ae_of_all _ he) refine ⟨hi, (integrable_const _).sub hi, ?_, ?_⟩ · apply Integrable.of_mem_Icc 0 1 (by fun_prop) exact ae_of_all _ (fun x => ⟨mul_nonneg (he x).1 (hm1 x).1, mul_le_one₀ (he x).2 (hm1 x).1 (hm1 x).2⟩) · apply Integrable.of_mem_Icc 0 1 (by fun_prop) exact ae_of_all _ (fun x => ⟨mul_nonneg (by linarith [(he x).2]) (hm0 x).1, mul_le_one₀ (by linarith [(he x).1]) (hm0 x).1 (hm0 x).2⟩)
CausalSmith.Stat.PrivateCateRoughdesign.design_regressions_integrable · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DesignPairMoments.lean:69
theorem design_pair_numerator_moment

Factorization of independent design pairs gives the exact numerator formula. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
conclusion 1
conclusion 2
(∫ z, designPairNumerator P z ∂μ.prod μ)
= 2 * ((∫ x, P.e x * P.mu1 x ∂μ) - (∫ x, P.e x ∂μ) * ((∫ x, (1 - P.e x) * P.mu0 x ∂μ) + (∫ x, P.e x * P.mu1 x ∂μ)))
Proof (Lean source)
-- @node: design_pair_numerator_moment lemma design_pair_numerator_moment (P : CausalLaw) (hP : CompleteModel P) (μ : Measure Covariate) [IsProbabilityMeasure μ] : Integrable (designPairNumerator P) (μ.prod μ) ∧ (∫ z, designPairNumerator P z ∂μ.prod μ) = 2 * ((∫ x, P.e x * P.mu1 x ∂μ) - (∫ x, P.e x ∂μ) * ((∫ x, (1 - P.e x) * P.mu0 x ∂μ) + (∫ x, P.e x * P.mu1 x ∂μ))) := by obtain ⟨he, hc, ht, hu⟩ := design_regressions_integrable P hP μ have hfun : designPairNumerator P = (fun z => (P.e z.1 * P.mu1 z.1) * (1 - P.e z.2) - P.e z.1 * ((1 - P.e z.2) * P.mu0 z.2) + (1 - P.e z.1) * (P.e z.2 * P.mu1 z.2) - ((1 - P.e z.1) * P.mu0 z.1) * P.e z.2) := by funext z unfold designPairNumerator ring rw [hfun] dsimp only refine ⟨((ht.mul_prod hc).sub (he.mul_prod hu)).add (hc.mul_prod ht) |>.sub (hu.mul_prod he), ?_⟩ have hsub := integral_sub (((ht.mul_prod hc).sub (he.mul_prod hu)).add (hc.mul_prod ht)) (hu.mul_prod he) have hadd := integral_add ((ht.mul_prod hc).sub (he.mul_prod hu)) (hc.mul_prod ht) have hsub' := integral_sub (ht.mul_prod hc) (he.mul_prod hu) simp only [Pi.add_apply, Pi.sub_apply] at hsub hadd hsub' rw [hsub, hadd, hsub', integral_prod_mul (fun x => P.e x * P.mu1 x) (fun x => 1 - P.e x), integral_prod_mul P.e (fun x => (1 - P.e x) * P.mu0 x), integral_prod_mul (fun x => 1 - P.e x) (fun x => P.e x * P.mu1 x), integral_prod_mul (fun x => (1 - P.e x) * P.mu0 x) P.e] rw [integral_sub (integrable_const _) he] simp only [integral_const, probReal_univ, smul_eq_mul, one_mul] ring
CausalSmith.Stat.PrivateCateRoughdesign.design_pair_numerator_moment · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DesignPairMoments.lean:94
theorem design_pair_denominator_moment

Factorization of independent design pairs gives the exact denominator formula. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
conclusion 1
conclusion 2
(∫ z, designPairDenominator P z ∂μ.prod μ) = 2 * (∫ x, P.e x ∂μ) * (1 - ∫ x, P.e x ∂μ)
Proof (Lean source)
-- @node: design_pair_denominator_moment lemma design_pair_denominator_moment (P : CausalLaw) (hP : CompleteModel P) (μ : Measure Covariate) [IsProbabilityMeasure μ] : Integrable (designPairDenominator P) (μ.prod μ) ∧ (∫ z, designPairDenominator P z ∂μ.prod μ) = 2 * (∫ x, P.e x ∂μ) * (1 - ∫ x, P.e x ∂μ) := by obtain ⟨he, hc, _, _⟩ := design_regressions_integrable P hP μ have hfun : designPairDenominator P = (fun z => P.e z.1 * (1 - P.e z.2) + (1 - P.e z.1) * P.e z.2) := by funext z unfold designPairDenominator ring rw [hfun] dsimp only refine ⟨(he.mul_prod hc).add (hc.mul_prod he), ?_⟩ rw [integral_add (he.mul_prod hc) (hc.mul_prod he)] rw [integral_prod_mul P.e (fun x => 1 - P.e x), integral_prod_mul (fun x => 1 - P.e x) P.e] rw [integral_sub (integrable_const _) he] simp only [integral_const, probReal_univ, smul_eq_mul, one_mul] ring
CausalSmith.Stat.PrivateCateRoughdesign.design_pair_denominator_moment · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DesignPairMoments.lean:129
theorem conditional_design_pair_bias

Integration of the pointwise causal certificate preserves the density-weighted cell bias. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
k :
ℕ
h :
ℝ
hk :
0 < k
hh :
0 < h ∧ h ≤ 1 / 4
P :
hP :
j :
Fin k
- theta P * (∫ z, designPairDenominator P z ∂(conditionalDesignLaw h k P j).prod (conditionalDesignLaw h k P j))|
≤ bias h k * (∫ z, designPairDenominator P z ∂(conditionalDesignLaw h k P j).prod (conditionalDesignLaw h k P j))
Proof (Lean source)
-- @node: conditional_design_pair_bias lemma conditional_design_pair_bias (k : ℕ) (h : ℝ) (hk : 0 < k) (hh : 0 < h ∧ h ≤ 1 / 4) (P : CausalLaw) (hP : CompleteModel P) (j : Fin k) : |(∫ z, designPairNumerator P z ∂(conditionalDesignLaw h k P j).prod (conditionalDesignLaw h k P j)) - theta P * (∫ z, designPairDenominator P z ∂(conditionalDesignLaw h k P j).prod (conditionalDesignLaw h k P j))| ≤ bias h k * (∫ z, designPairDenominator P z ∂(conditionalDesignLaw h k P j).prod (conditionalDesignLaw h k P j)) := by let μ := conditionalDesignLaw h k P j let : IsProbabilityMeasure μ := conditionalDesignLaw_probability k h hk hh P hP j have hN := (design_pair_numerator_moment P hP μ).1 have hD := (design_pair_denominator_moment P hP μ).1 have hb : ∀ᵐ z ∂μ.prod μ, |designPairNumerator P z - theta P * designPairDenominator P z| ≤ bias h k * designPairDenominator P z := by filter_upwards [conditionalDesignLaw_pair_mem k h hk hh P hP j] with z hz exact (cell_cross_treatment_certificate k h hk hh P hP j z.1 z.2 hz.1 hz.2).2 calc _ = |∫ z, designPairNumerator P z - theta P * designPairDenominator P z ∂μ.prod μ| := by rw [integral_sub hN (hD.const_mul _), integral_const_mul] _ ≤ ∫ z, |designPairNumerator P z - theta P * designPairDenominator P z| ∂μ.prod μ := abs_integral_le_integral_abs _ ≤ ∫ z, bias h k * designPairDenominator P z ∂μ.prod μ := integral_mono_ae (hN.sub (hD.const_mul _)).abs (hD.const_mul _) hb _ = _ := integral_const_mul _ _
CausalSmith.Stat.PrivateCateRoughdesign.conditional_design_pair_bias · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DesignPairMoments.lean:152
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.DirectCoupling 17 declarations The shared-threshold direct experiment coupling and its independent-record transport cost.

The shared-threshold direct experiment coupling and its independent-record transport cost.

theorem bump_lintegral_le_macro_length Lemma bump_lintegral_le_macro_length in the paper ↗

The localized bump has integrated mass at most the length of its macro support. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
(∫⁻ x : Covariate, ofReal (bump hL x)) ≤ ofReal (2*hL)
Proof (Lean source)
-- @node: bump_lintegral_le_macro_length lemma bump_lintegral_le_macro_length (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) : (∫⁻ x : Covariate, ofReal (bump hL x)) ≤ ofReal (2*hL) := by classical let W : Set Covariate := {x | |(x : ℝ)-x0| < hL} have hW : MeasurableSet W := measurableSet_lt (by fun_prop) measurable_const calc _ ≤ ∫⁻ x : Covariate, W.indicator (fun _ => (1 : ℝ≥0∞)) x := by apply lintegral_mono intro x by_cases hx : x ∈ W · simp only [Set.indicator_of_mem hx] exact (ENNReal.ofReal_le_ofReal (bump_range hL x).2).trans_eq (by simp) · have hg : envelope hL x = 0 := envelope_zero_of_radius_le hL hhL x (le_of_not_gt hx) simp [Set.indicator_of_notMem hx, bump, hg] _ = (volume : Measure Covariate) W := by rw [lintegral_indicator_const hW] simp _ ≤ _ := volume_covariate_neighborhood_le x0 hL
CausalSmith.Stat.PrivateCateRoughdesign.bump_lintegral_le_macro_length · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DirectCoupling.lean:14

The crossing probability includes the fair treatment probability.

Definition (Lean source)
hL :
ℝ
x :
directCrossingMass hL x :
ℝ
separation hL * bump hL x / 2
theorem directCrossingMass_range

The crossing mass fits within the fair treated-zero atom. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1/4
x :
conclusion 1
conclusion 2
directCrossingMass hL x ≤ 1/4
Proof (Lean source)
-- @node: directCrossingMass_range lemma directCrossingMass_range (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1/4) (x : Covariate) : 0 ≤ directCrossingMass hL x ∧ directCrossingMass hL x ≤ 1/4 := by have ht := separation_le_sqrt hL hhL have hb := bump_range hL x have hs : separation hL ≤ 1/4 := by dsimp [separation, kappa] linarith [hhL.2] dsimp [directCrossingMass] constructor · exact div_nonneg (mul_nonneg ht.1 hb.1) (by norm_num) · nlinarith [mul_le_mul_of_nonneg_left hb.2 ht.1]
CausalSmith.Stat.PrivateCateRoughdesign.directCrossingMass_range · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DirectCoupling.lean:40

Integrating the shared thresholds leaves four common atoms and one crossing atom.

Definition (Lean source)
hL :
ℝ
x :
directConditionalCoupling hL x :
Measure (O × O)
ofReal (1/4 : ℝ) • Measure.dirac ((x,false,false),(x,false,false))
+ ofReal (1/4 : ℝ) • Measure.dirac ((x,false,true),(x,false,true))
+ ofReal (1/4 - directCrossingMass hL x) • Measure.dirac ((x,true,false),(x,true,false))
+ ofReal (1/4 : ℝ) • Measure.dirac ((x,true,true),(x,true,true))
+ ofReal (directCrossingMass hL x) • Measure.dirac ((x,true,false),(x,true,true))
CausalSmith.Stat.PrivateCateRoughdesign.directConditionalCoupling · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DirectCoupling.lean:54
theorem measurable_directConditionalCoupling

The finite shared-threshold law is a measurable conditional measure. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
Proof (Lean source)
-- @node: measurable_directConditionalCoupling @[fun_prop] lemma measurable_directConditionalCoupling (hL : ℝ) : Measurable (directConditionalCoupling hL) := by apply Measure.measurable_of_measurable_coe intro E hE simp only [directConditionalCoupling, Measure.add_apply, Measure.smul_apply, Measure.dirac_apply' _ hE, smul_eq_mul] unfold directCrossingMass have hdir (a b c d : Bool) : Measurable (fun x : Covariate => E.indicator (1 : O × O → ℝ≥0∞) ((x,a,b),(x,c,d))) := (measurable_const.indicator hE).comp (by fun_prop) fun_prop
CausalSmith.Stat.PrivateCateRoughdesign.measurable_directConditionalCoupling · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DirectCoupling.lean:65
theorem directConditionalCoupling_probability

Conditional shared thresholds have total mass one. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1/4
x :
Proof (Lean source)
-- @node: directConditionalCoupling_probability lemma directConditionalCoupling_probability (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1/4) (x : Covariate) : IsProbabilityMeasure (directConditionalCoupling hL x) := by constructor have hw := directCrossingMass_range hL hhL x simp only [directConditionalCoupling, Measure.add_apply, Measure.smul_apply, Measure.dirac_apply_of_mem (Set.mem_univ _), smul_eq_mul, mul_one] rw [← ENNReal.ofReal_add (by norm_num : (0 : ℝ) ≤ 1/4) (by norm_num : (0 : ℝ) ≤ 1/4), ← ENNReal.ofReal_add (by norm_num : (0 : ℝ) ≤ 1/4+1/4) (sub_nonneg.mpr hw.2), ← ENNReal.ofReal_add (by linarith : 0 ≤ 1/4+1/4+(1/4-directCrossingMass hL x)) (by norm_num : (0 : ℝ) ≤ 1/4), ← ENNReal.ofReal_add (by linarith : 0 ≤ 1/4+1/4+(1/4-directCrossingMass hL x)+1/4) hw.1] rw [show (1/4+1/4+(1/4-directCrossingMass hL x)+1/4+directCrossingMass hL x : ℝ) = 1 by ring] exact ENNReal.ofReal_one
CausalSmith.Stat.PrivateCateRoughdesign.directConditionalCoupling_probability · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DirectCoupling.lean:80
theorem directConditionalCoupling_cost

Only the crossing atom contributes to the conditional disagreement cost. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
x :
(∫⁻ z : O × O, if z.1 = z.2 then (0 : ℝ≥0∞) else 1 ∂directConditionalCoupling hL x)
Proof (Lean source)
-- @node: directConditionalCoupling_cost lemma directConditionalCoupling_cost (hL : ℝ) (x : Covariate) : (∫⁻ z : O × O, if z.1 = z.2 then (0 : ℝ≥0∞) else 1 ∂directConditionalCoupling hL x) = ofReal (directCrossingMass hL x) := by have hm : Measurable (fun z : O × O => if z.1 = z.2 then (0 : ℝ≥0∞) else 1) := by exact Measurable.ite (measurableSet_eq_fun measurable_fst measurable_snd) measurable_const measurable_const simp [directConditionalCoupling, lintegral_add_measure, lintegral_smul_measure, lintegral_dirac' _ hm]
CausalSmith.Stat.PrivateCateRoughdesign.directConditionalCoupling_cost · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DirectCoupling.lean:96

Integrate the conditional shared-threshold coupling over the common uniform covariate.

Definition (Lean source)
hL :
ℝ
directRecordCoupling hL :
Measure (O × O)
CausalSmith.Stat.PrivateCateRoughdesign.directRecordCoupling · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DirectCoupling.lean:107
theorem directRecordCoupling_probability

The common covariate and conditional shared thresholds give a probability coupling law. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1/4
Proof (Lean source)
-- @node: directRecordCoupling_probability lemma directRecordCoupling_probability (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1/4) : IsProbabilityMeasure (directRecordCoupling hL) := by constructor rw [directRecordCoupling, Measure.bind_apply MeasurableSet.univ (measurable_directConditionalCoupling hL).aemeasurable] have hu (x : Covariate) : directConditionalCoupling hL x univ = 1 := by let := directConditionalCoupling_probability hL hhL x exact measure_univ simp_rw [hu] simp
CausalSmith.Stat.PrivateCateRoughdesign.directRecordCoupling_probability · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DirectCoupling.lean:112
theorem directConditionalCoupling_fst

The fair marginal of the shared-threshold conditional coupling. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1/4
x :
E :
Set O
hE :
= ∑ z : Bool × Bool, ofReal (1/4 : ℝ) * E.indicator (1 : O → ℝ≥0∞) (x,z.1,z.2)
Proof (Lean source)
-- @node: directConditionalCoupling_fst lemma directConditionalCoupling_fst (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1/4) (x : Covariate) (E : Set O) (hE : MeasurableSet E) : directConditionalCoupling hL x (fst ⁻¹' E) = ∑ z : Bool × Bool, ofReal (1/4 : ℝ) * E.indicator (1 : O → ℝ≥0∞) (x,z.1,z.2) := by have hw := directCrossingMass_range hL hhL x have ha : ofReal (1/4-directCrossingMass hL x) + ofReal (directCrossingMass hL x) = ofReal (1/4 : ℝ) := by rw [← ENNReal.ofReal_add (sub_nonneg.mpr hw.2) hw.1] congr 1 ring have hind (z : O × O) : (fst ⁻¹' E).indicator (1 : O × O → ℝ≥0∞) z = E.indicator (1 : O → ℝ≥0∞) z.1 := by rfl simp only [directConditionalCoupling, Measure.add_apply, Measure.smul_apply, Measure.dirac_apply' _ (measurable_fst hE), smul_eq_mul] simp_rw [hind] change _ = _ simp only [Set.indicator_preimage, Function.comp_apply, Fintype.sum_prod_type, Fintype.sum_bool] calc _ = ofReal (1/4 : ℝ) * E.indicator 1 (x,false,false) + ofReal (1/4 : ℝ) * E.indicator 1 (x,false,true) + (ofReal (1/4-directCrossingMass hL x) + ofReal (directCrossingMass hL x)) * E.indicator 1 (x,true,false) + ofReal (1/4 : ℝ) * E.indicator 1 (x,true,true) := by simp only [indicator, preimage, Set.mem_setOf_eq, Pi.one_apply, fst, snd] ring _ = _ := by rw [ha]; ring
CausalSmith.Stat.PrivateCateRoughdesign.directConditionalCoupling_fst · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DirectCoupling.lean:125
theorem directConditionalCoupling_snd

The treated marginal of the shared-threshold conditional coupling. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1/4
x :
E :
Set O
hE :
= ∑ z : Bool × Bool, ofReal (bernoulliMass (1/2) z.1 * bernoulliMass (if z.1 then directMu1 hL x else 1/2) z.2) * E.indicator (1 : O → ℝ≥0∞) (x,z.1,z.2)
Proof (Lean source)
-- @node: directConditionalCoupling_snd lemma directConditionalCoupling_snd (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1/4) (x : Covariate) (E : Set O) (hE : MeasurableSet E) : directConditionalCoupling hL x (snd ⁻¹' E) = ∑ z : Bool × Bool, ofReal (bernoulliMass (1/2) z.1 * bernoulliMass (if z.1 then directMu1 hL x else 1/2) z.2) * E.indicator (1 : O → ℝ≥0∞) (x,z.1,z.2) := by have hw := directCrossingMass_range hL hhL x have ha : ofReal (1/4 : ℝ) + ofReal (directCrossingMass hL x) = ofReal (1/4+directCrossingMass hL x) := (ENNReal.ofReal_add (by norm_num) hw.1).symm have hind (z : O × O) : (snd ⁻¹' E).indicator (1 : O × O → ℝ≥0∞) z = E.indicator (1 : O → ℝ≥0∞) z.2 := by rfl simp only [directConditionalCoupling, Measure.add_apply, Measure.smul_apply, Measure.dirac_apply' _ (measurable_snd hE), smul_eq_mul, Set.indicator_preimage, Function.comp_apply, Fintype.sum_prod_type, Fintype.sum_bool, bernoulliMass, Bool.false_eq_true, if_false, if_true] simp_rw [hind] have hplus : (1/2 : ℝ) * directMu1 hL x = 1/4 + directCrossingMass hL x := by dsimp [directMu1, directCrossingMass]; ring have hminus : (1/2 : ℝ) * (1-directMu1 hL x) = 1/4 - directCrossingMass hL x := by dsimp [directMu1, directCrossingMass]; ring norm_num only at * rw [hplus, hminus] calc _ = ofReal (1/4 : ℝ) * E.indicator 1 (x,false,false) + ofReal (1/4 : ℝ) * E.indicator 1 (x,false,true) + ofReal (1/4-directCrossingMass hL x) * E.indicator 1 (x,true,false) + (ofReal (1/4 : ℝ) + ofReal (directCrossingMass hL x)) * E.indicator 1 (x,true,true) := by simp only [indicator, preimage, Set.mem_setOf_eq, Pi.one_apply, fst, snd] ring _ = _ := by rw [ha]; ring
CausalSmith.Stat.PrivateCateRoughdesign.directConditionalCoupling_snd · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DirectCoupling.lean:156
theorem directRecordCoupling_map_fst

The first integrated marginal is the observed fair null law. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1/4
Proof (Lean source)
-- @node: directRecordCoupling_map_fst lemma directRecordCoupling_map_fst (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1/4) : (directRecordCoupling hL).map fst = Pobs fairNull := by ext E hE rw [Measure.map_apply measurable_fst hE, directRecordCoupling, Measure.bind_apply (measurable_fst hE) (measurable_directConditionalCoupling hL).aemeasurable] simp_rw [directConditionalCoupling_fst hL hhL _ E hE] rw [fairNull, binaryCausalLaw_observed_apply _ _ _ measurable_const measurable_const measurable_const fair_parameters_range E hE] apply lintegral_congr intro x apply Finset.sum_congr rfl intro z _ cases z.1 <;> cases z.2 <;> norm_num [bernoulliMass, indicator, Pi.one_apply]
CausalSmith.Stat.PrivateCateRoughdesign.directRecordCoupling_map_fst · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DirectCoupling.lean:192
theorem directRecordCoupling_map_snd

The second integrated marginal is the observed direct alternative law. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1/4
Proof (Lean source)
-- @node: directRecordCoupling_map_snd lemma directRecordCoupling_map_snd (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1/4) : (directRecordCoupling hL).map snd = Pobs (directAlternative hL hhL) := by ext E hE rw [Measure.map_apply measurable_snd hE, directRecordCoupling, Measure.bind_apply (measurable_snd hE) (measurable_directConditionalCoupling hL).aemeasurable, directAlternative, binaryCausalLaw_observed_apply _ _ _ measurable_const measurable_const (measurable_directMu1 hL) (direct_parameters_range hL hhL) E hE] exact lintegral_congr (fun x => directConditionalCoupling_snd hL hhL x E hE)
CausalSmith.Stat.PrivateCateRoughdesign.directRecordCoupling_map_snd · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DirectCoupling.lean:208
theorem directRecordCoupling_cost_le

The integrated disagreement cost is bounded by the crossing probability and macro support. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1/4
(∫⁻ z : O × O, if z.1 = z.2 then (0 : ℝ≥0∞) else 1 ∂directRecordCoupling hL)
≤ ofReal (separation hL*hL)
Proof (Lean source)
-- @node: directRecordCoupling_cost_le lemma directRecordCoupling_cost_le (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1/4) : (∫⁻ z : O × O, if z.1 = z.2 then (0 : ℝ≥0∞) else 1 ∂directRecordCoupling hL) ≤ ofReal (separation hL*hL) := by have hm : Measurable (fun z : O × O => if z.1 = z.2 then (0 : ℝ≥0∞) else 1) := Measurable.ite (measurableSet_eq_fun measurable_fst measurable_snd) measurable_const measurable_const have ht := (separation_le_sqrt hL hhL).1 rw [directRecordCoupling, Measure.lintegral_bind (measurable_directConditionalCoupling hL).aemeasurable hm.aemeasurable] simp_rw [directConditionalCoupling_cost, directCrossingMass, show ∀ x : Covariate, separation hL * bump hL x / 2 = (separation hL/2)*bump hL x by intro x; ring, ENNReal.ofReal_mul (show 0 ≤ separation hL/2 from div_nonneg ht (by norm_num))] rw [lintegral_const_mul' _ _ ENNReal.ofReal_ne_top] calc _ ≤ ofReal (separation hL/2)*ofReal (2*hL) := mul_le_mul' le_rfl (bump_lintegral_le_macro_length hL hhL) _ = _ := by rw [← ENNReal.ofReal_mul (show 0 ≤ separation hL/2 from div_nonneg ht (by norm_num))] congr 1 ring
CausalSmith.Stat.PrivateCateRoughdesign.directRecordCoupling_cost_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DirectCoupling.lean:219

Independent copies of the shared-threshold record pair are regrouped into two datasets.

Definition (Lean source)
hL :
ℝ
n :
ℕ
directDatasetCoupling hL n :
(Measure.pi (fun _ : Fin n => directRecordCoupling hL)).map (fun z => (fun i => (z i).1, fun i => (z i).2))
CausalSmith.Stat.PrivateCateRoughdesign.directDatasetCoupling · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DirectCoupling.lean:243
theorem directDatasetCoupling_isCoupling

The independent-record construction has the two prescribed product marginals. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1/4
n :
ℕ
Proof (Lean source)
-- @node: directDatasetCoupling_isCoupling lemma directDatasetCoupling_isCoupling (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1/4) (n : ℕ) : IsCoupling (directDatasetCoupling hL n) (dataLaw n fairNull) (dataLaw n (directAlternative hL hhL)) := by let := directRecordCoupling_probability hL hhL have hu : Measurable (fun z : Fin n → O × O => (fun i => (z i).1, fun i => (z i).2)) := by fun_prop refine ⟨Measure.isProbabilityMeasure_map hu.aemeasurable, ?_, ?_⟩ · rw [directDatasetCoupling, Measure.map_map measurable_fst hu] change (Measure.pi (fun _ : Fin n => directRecordCoupling hL)).map (fun z i => (z i).1) = _ rw [Measure.pi_map_pi (fun _ => measurable_fst.aemeasurable)] simp_rw [directRecordCoupling_map_fst hL hhL] rfl · rw [directDatasetCoupling, Measure.map_map measurable_snd hu] change (Measure.pi (fun _ : Fin n => directRecordCoupling hL)).map (fun z i => (z i).2) = _ rw [Measure.pi_map_pi (fun _ => measurable_snd.aemeasurable)] simp_rw [directRecordCoupling_map_snd hL hhL] rfl
CausalSmith.Stat.PrivateCateRoughdesign.directDatasetCoupling_isCoupling · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DirectCoupling.lean:249
theorem directDatasetCoupling_cost_le

Hamming cost adds the identical one-record crossing costs over all independent records. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1/4
n :
ℕ
(∫⁻ z, (dHam n z.1 z.2 : ℝ≥0∞) ∂directDatasetCoupling hL n)
≤ ofReal ((n : ℝ)*separation hL*hL)
Proof (Lean source)
-- @node: directDatasetCoupling_cost_le lemma directDatasetCoupling_cost_le (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1/4) (n : ℕ) : (∫⁻ z, (dHam n z.1 z.2 : ℝ≥0∞) ∂directDatasetCoupling hL n) ≤ ofReal ((n : ℝ)*separation hL*hL) := by classical let := directRecordCoupling_probability hL hhL have hm : Measurable (fun z : O × O => if z.1 = z.2 then (0 : ℝ≥0∞) else 1) := Measurable.ite (measurableSet_eq_fun measurable_fst measurable_snd) measurable_const measurable_const rw [directDatasetCoupling, lintegral_map (measurable_datasetHammingCost n) (by fun_prop)] simp only [dHam, hammingDist, Finset.card_eq_sum_ones, Finset.sum_filter, Nat.cast_sum, Nat.cast_ite, Nat.cast_one, Nat.cast_zero] rw [lintegral_finsetSum _ (fun i _ => by simpa only [ite_not, Function.comp_def] using hm.comp (measurable_pi_apply i))] have hi (i : Fin n) : (∫⁻ z : Fin n → O × O, if (z i).1 ≠ (z i).2 then (1 : ℝ≥0∞) else 0 ∂Measure.pi (fun _ : Fin n => directRecordCoupling hL)) = ∫⁻ z : O × O, if z.1 = z.2 then (0 : ℝ≥0∞) else 1 ∂directRecordCoupling hL := by simpa only [ite_not, Function.comp_def] using (measurePreserving_eval (fun _ : Fin n => directRecordCoupling hL) i).lintegral_comp hm simp_rw [hi] calc _ ≤ ∑ _ : Fin n, ofReal (separation hL*hL) := Finset.sum_le_sum (fun _ _ => directRecordCoupling_cost_le hL hhL) _ = _ := by simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] rw [← ENNReal.ofReal_natCast, ← ENNReal.ofReal_mul (Nat.cast_nonneg n)] congr 1 ring
CausalSmith.Stat.PrivateCateRoughdesign.directDatasetCoupling_cost_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/DirectCoupling.lean:271
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.FrameGeometry 20 declarations Localized cosine frames and their exact squared partition identity, including lattice and macro support boundaries.

Localized cosine frames and their exact squared partition identity, including lattice and macro support boundaries.

def deltaL

The lower-family micro radius is the fifth power of its macro radius.

Definition (Lean source)
hL :
ℝ
shared
deltaL hL :
ℝ
hL^5
def kappa

The amplitude constant is two to the power minus twelve.

Definition (Lean source)
kappa :
ℝ
(2 : ℝ)^(-12 : ℤ)

The target separation is the amplitude constant times the macro radius.

Definition (Lean source)
hL :
ℝ
shared
separation hL :
ℝ
def envelope

The macro envelope is the squared cosine inside the localization window and zero outside.

Definition (Lean source)
hL :
ℝ
shared
x :
envelope hL x :
ℝ
if |(x : ℝ) - x0| ≤ hL then (cos (pi*((x : ℝ)-x0)/(2*hL)))^2 else 0
def bump

The effect bump squares the macro envelope.

Definition (Lean source)
hL :
ℝ
shared
x :
bump hL x :
ℝ
(envelope hL x)^2
def frame

Each overlapping cosine frame element is supported within one micro radius of its integer center.

Definition (Lean source)
hL :
ℝ
shared
j :
ℤ
x :
frame hL j x :
ℝ
if |(x : ℝ) - j*deltaL hL|
≤ deltaL hL then cos (pi*((x : ℝ)-j*deltaL hL)/(2*deltaL hL)) else 0

The localized macro envelope is Borel measurable, including its boundary convention. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
Measurable (envelope hL)
Proof (Lean source)
-- @node: measurable_envelope @[fun_prop] lemma measurable_envelope : Measurable (envelope hL) := by unfold envelope apply Measurable.ite (measurableSet_le (by fun_prop) measurable_const) <;> fun_prop
CausalSmith.Stat.PrivateCateRoughdesign.measurable_envelope · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/FrameGeometry.lean:40

Squaring the macro envelope preserves measurability. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
Proof (Lean source)
-- @node: measurable_bump @[fun_prop] lemma measurable_bump : Measurable (bump hL) := by unfold bump fun_prop

Each localized cosine frame is Borel measurable. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
j :
ℤ
Proof (Lean source)
-- @node: measurable_frame @[fun_prop] lemma measurable_frame (j : ℤ) : Measurable (frame hL j) := by unfold frame apply Measurable.ite (measurableSet_le (by fun_prop) measurable_const) <;> fun_prop

The squared-cosine envelope takes values between zero and one. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
x :
envelope hL x ∈ Icc 0 1
Proof (Lean source)
-- @node: envelope_range lemma envelope_range (x : Covariate) : envelope hL x ∈ Icc 0 1 := by unfold envelope split · exact ⟨sq_nonneg _, Real.cos_sq_le_one _⟩ · exact ⟨le_rfl, zero_le_one⟩

The effect bump also takes values between zero and one. the theorem's stated inputs and assumptions, and the asserted conclusion follows.

Formal statement
hL :
ℝ
shared
x :
bump hL x ∈ Icc 0 1
Proof (Lean source)
-- @node: bump_range lemma bump_range (x : Covariate) : bump hL x ∈ Icc 0 1 := by have hg := envelope_range hL x unfold bump constructor · exact sq_nonneg _ · nlinarith [mul_nonneg hg.1 (sub_nonneg.mpr hg.2)]
def activeSigns

The finite active integer indices have frame interiors intersecting the interior of the macro window.

Definition (Lean source)
hL :
ℝ
shared
activeSigns hL :
Finset ℤ
(Icc (⌊((x0 : ℝ)-hL)/deltaL hL⌋-1) (⌈((x0 : ℝ)+hL)/deltaL hL⌉+1)).filter (fun j => (j : ℝ)*deltaL hL - deltaL hL < (x0 : ℝ)+hL ∧ (x0 : ℝ)-hL < (j : ℝ)*deltaL hL + deltaL hL)

The latent signs are binary encodings of minus one and one on the active index set.

Definition (Lean source)
hL :
ℝ
SignVector hL :
Type
(activeSigns hL) → Bool

The finite index construction selects exactly the strict support intersections for every legal macro radius. The displayed conclusion follows.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
j :
ℤ
j ∈ activeSigns hL
↔ ((j : ℝ)*deltaL hL-deltaL hL < (x0 : ℝ)+hL ∧ (x0 : ℝ)-hL < (j : ℝ)*deltaL hL+deltaL hL)
Proof (Lean source)
-- @node: mem_activeSigns lemma mem_activeSigns (j : ℤ) : j ∈ activeSigns hL ↔ ((j : ℝ)*deltaL hL-deltaL hL < (x0 : ℝ)+hL ∧ (x0 : ℝ)-hL < (j : ℝ)*deltaL hL+deltaL hL) := by classical unfold activeSigns rw [mem_filter] constructor · exact fun hj => hj.2 · intro hj refine ⟨?_, hj⟩ rw [Finset.mem_Icc] have hd : 0 < deltaL hL := pow_pos hhL.1 5 have hlo := Int.floor_le (((x0 : ℝ) - hL) / deltaL hL) have hhi := Int.le_ceil (((x0 : ℝ) + hL) / deltaL hL) have hl : (((x0 : ℝ) - hL) / deltaL hL) < (j : ℝ) + 1 := by apply (div_lt_iff₀ hd).mpr nlinarith [hj.2] have hu : (j : ℝ) - 1 < (((x0 : ℝ) + hL) / deltaL hL) := by apply (lt_div_iff₀ hd).mpr nlinarith [hj.1] constructor · have : (⌊((x0 : ℝ) - hL) / deltaL hL⌋ : ℝ) - 1 ≤ (j : ℝ) := by linarith exact_mod_cast this · have : (j : ℝ) ≤ (⌈((x0 : ℝ) + hL) / deltaL hL⌉ : ℝ) + 1 := by linarith exact_mod_cast this
theorem frame_zero_of_radius_le Lemma frame_zero_of_radius_le in the paper ↗

A frame vanishes at either support endpoint and beyond it. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
j :
ℤ
x :
hx :
deltaL hL ≤ |(x : ℝ) - j * deltaL hL|
frame hL j x = 0
Proof (Lean source)
-- @node: frame_zero_of_radius_le lemma frame_zero_of_radius_le (j : ℤ) (x : Covariate) (hx : deltaL hL ≤ |(x : ℝ) - j * deltaL hL|) : frame hL j x = 0 := by have hd : 0 < deltaL hL := pow_pos hhL.1 5 unfold frame split · rename_i hin have he := le_antisymm hin hx rcases (abs_eq (le_of_lt hd)).mp he with he | he · rw [he] have : pi * deltaL hL / (2 * deltaL hL) = pi / 2 := by field_simp <;> ring rw [this, Real.cos_pi_div_two] · rw [he] have : pi * (-deltaL hL) / (2 * deltaL hL) = -(pi / 2) := by field_simp <;> ring rw [this, Real.cos_neg, Real.cos_pi_div_two] · rfl
CausalSmith.Stat.PrivateCateRoughdesign.frame_zero_of_radius_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/FrameGeometry.lean:121
theorem envelope_zero_of_radius_le Lemma envelope_zero_of_radius_le in the paper ↗

The macro envelope vanishes at its endpoints as well as outside its support. the theorem's stated inputs and assumptions, and the asserted conclusion follows.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
x :
hx :
hL ≤ |(x : ℝ) - x0|
envelope hL x = 0
Proof (Lean source)
-- @node: envelope_zero_of_radius_le lemma envelope_zero_of_radius_le (x : Covariate) (hx : hL ≤ |(x : ℝ) - x0|) : envelope hL x = 0 := by unfold envelope split · rename_i hin have he := le_antisymm hin hx rcases (abs_eq hhL.1.le).mp he with he | he · rw [he] have : pi * hL / (2 * hL) = pi / 2 := by field_simp [hhL.1.ne'] <;> ring rw [this, Real.cos_pi_div_two]; norm_num · rw [he] have : pi * (-hL) / (2 * hL) = -(pi / 2) := by field_simp [hhL.1.ne'] <;> ring rw [this, Real.cos_neg, Real.cos_pi_div_two]; norm_num · rfl
CausalSmith.Stat.PrivateCateRoughdesign.envelope_zero_of_radius_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/FrameGeometry.lean:142
theorem inactive_weighted_frame_zero Lemma inactive_weighted_frame_zero in the paper ↗

An index omitted from the active frame set contributes zero after localization. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
j :
ℤ
x :
hj :
j ∉ activeSigns hL
bump hL x * (frame hL j x)^2 = 0
Proof (Lean source)
-- @node: inactive_weighted_frame_zero lemma inactive_weighted_frame_zero (j : ℤ) (x : Covariate) (hj : j ∉ activeSigns hL) : bump hL x * (frame hL j x)^2 = 0 := by by_cases hg : hL ≤ |(x : ℝ) - x0| · rw [bump, envelope_zero_of_radius_le hL hhL x hg]; ring · have hd : 0 < deltaL hL := pow_pos hhL.1 5 have hx := abs_lt.mp (lt_of_not_ge hg) have hnj := mt (mem_activeSigns hL hhL j).mpr hj push_neg at hnj have hf : deltaL hL ≤ |(x : ℝ) - j * deltaL hL| := by by_cases hl : (j : ℝ) * deltaL hL - deltaL hL < (x0 : ℝ) + hL · have hu := hnj hl rw [abs_of_nonneg (by linarith : 0 ≤ (x : ℝ) - j * deltaL hL)] linarith [hx.1] · rw [abs_of_nonpos (by linarith : (x : ℝ) - j * deltaL hL ≤ 0)] linarith [hx.2] rw [frame_zero_of_radius_le hL hhL j x hf]; ring
CausalSmith.Stat.PrivateCateRoughdesign.inactive_weighted_frame_zero · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/FrameGeometry.lean:160
theorem neighboring_frame_squares Lemma neighboring_frame_squares in the paper ↗

On a lattice interval the two neighboring frame squares sum to one. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
q :
ℤ
x :
hl :
(q : ℝ) * deltaL hL ≤ x
hu :
(x : ℝ) ≤ (q + 1 : ℤ) * deltaL hL
(frame hL q x)^2 + (frame hL (q + 1) x)^2 = 1
Proof (Lean source)
-- @node: neighboring_frame_squares lemma neighboring_frame_squares (q : ℤ) (x : Covariate) (hl : (q : ℝ) * deltaL hL ≤ x) (hu : (x : ℝ) ≤ (q + 1 : ℤ) * deltaL hL) : (frame hL q x)^2 + (frame hL (q + 1) x)^2 = 1 := by have hd : 0 < deltaL hL := pow_pos hhL.1 5 have hqc : ((q + 1 : ℤ) : ℝ) = (q : ℝ) + 1 := by push_cast; rfl have h0 : |(x : ℝ) - q * deltaL hL| ≤ deltaL hL := by rw [abs_of_nonneg (by linarith)] rw [hqc] at hu; nlinarith have h1 : |(x : ℝ) - (q + 1 : ℤ) * deltaL hL| ≤ deltaL hL := by rw [abs_of_nonpos (by linarith)] rw [hqc]; nlinarith simp only [frame, h0, h1, if_true] have hang : pi * ((x : ℝ) - (q + 1 : ℤ) * deltaL hL) / (2 * deltaL hL) = pi * ((x : ℝ) - q * deltaL hL) / (2 * deltaL hL) - pi / 2 := by rw [hqc]; field_simp <;> ring rw [hang, Real.cos_sub_pi_div_two, Real.cos_sq_add_sin_sq]
CausalSmith.Stat.PrivateCateRoughdesign.neighboring_frame_squares · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/FrameGeometry.lean:180
theorem frame_zero_off_neighbors Lemma frame_zero_off_neighbors in the paper ↗

All frames except the two neighboring indices vanish on a lattice interval. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
q j :
ℤ
x :
hl :
(q : ℝ) * deltaL hL ≤ x
hu :
(x : ℝ) ≤ (q + 1 : ℤ) * deltaL hL
hj0 :
j ≠ q
hj1 :
j ≠ q + 1
frame hL j x = 0
Proof (Lean source)
-- @node: frame_zero_off_neighbors lemma frame_zero_off_neighbors (q j : ℤ) (x : Covariate) (hl : (q : ℝ) * deltaL hL ≤ x) (hu : (x : ℝ) ≤ (q + 1 : ℤ) * deltaL hL) (hj0 : j ≠ q) (hj1 : j ≠ q + 1) : frame hL j x = 0 := by have hd : 0 < deltaL hL := pow_pos hhL.1 5 apply frame_zero_of_radius_le hL hhL by_cases hj : j < q · have hgap : (j : ℝ) + 1 ≤ q := by exact_mod_cast (show j + 1 ≤ q by omega) rw [abs_of_nonneg (by nlinarith : 0 ≤ (x : ℝ) - j * deltaL hL)] nlinarith · have hgap : (q : ℝ) + 2 ≤ j := by exact_mod_cast (show q + 2 ≤ j by omega) have huc : (x : ℝ) ≤ ((q : ℝ) + 1) * deltaL hL := by simpa using hu rw [abs_of_nonpos (by nlinarith : (x : ℝ) - j * deltaL hL ≤ 0)] nlinarith
CausalSmith.Stat.PrivateCateRoughdesign.frame_zero_off_neighbors · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/FrameGeometry.lean:201
theorem weighted_frame_square_partition Lemma weighted_frame_square_partition in the paper ↗

Localizing the finite frame square sum gives exactly the effect bump everywhere. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
shared
hhL :
0 < hL ∧ hL ≤ 1 / 4
shared
x :
bump hL x * ∑ j : activeSigns hL, (frame hL j x)^2 = bump hL x
Proof (Lean source)
-- @node: weighted_frame_square_partition lemma weighted_frame_square_partition (x : Covariate) : bump hL x * ∑ j : activeSigns hL, (frame hL j x)^2 = bump hL x := by classical let q : ℤ := ⌊(x : ℝ) / deltaL hL⌋ have hd : 0 < deltaL hL := pow_pos hhL.1 5 have hl : (q : ℝ) * deltaL hL ≤ x := (le_div_iff₀ hd).mp (Int.floor_le _) have hu : (x : ℝ) ≤ (q + 1 : ℤ) * deltaL hL := by have hu := (div_lt_iff₀ hd).mp (Int.lt_floor_add_one ((x : ℝ) / deltaL hL)) simpa [q] using hu.le let f : ℤ → ℝ := fun j => bump hL x * (frame hL j x)^2 have hfinite : (∑ j ∈ activeSigns hL, f j) = ∑ j ∈ activeSigns hL ∪ {q, q+1}, f j := by apply Finset.sum_subset (subset_union_left) intro j hj hnot exact inactive_weighted_frame_zero hL hhL j x hnot have hpair : (∑ j ∈ ({q, q+1} : Finset ℤ), f j) = ∑ j ∈ activeSigns hL ∪ {q, q+1}, f j := by apply Finset.sum_subset (subset_union_right) intro j hj hnot have hj0 : j ≠ q := by intro he; subst j; simp at hnot have hj1 : j ≠ q+1 := by intro he; subst j; simp at hnot dsimp [f] rw [frame_zero_off_neighbors hL hhL q j x hl hu hj0 hj1]; ring rw [Finset.mul_sum] change (∑ j ∈ (activeSigns hL).attach, f j) = _ rw [Finset.sum_attach, hfinite, ← hpair] simp only [Finset.sum_insert (by simp : q ∉ ({q+1} : Finset ℤ)), Finset.sum_singleton] dsimp [f] rw [← mul_add, neighboring_frame_squares hL hhL q x hl hu, mul_one]
CausalSmith.Stat.PrivateCateRoughdesign.weighted_frame_square_partition · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/FrameGeometry.lean:219
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.FrameRegularity 7 declarations Global moduli of the localized cosine envelope and effect bump, including support boundaries.

Global moduli of the localized cosine envelope and effect bump, including support boundaries.

theorem localized_cosine_eq_clamped Lemma localized_cosine_eq_clamped in the paper ↗

Clamping the displacement to the support interval realizes a zero-extended cosine exactly. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
r c x :
ℝ
hr :
0 < r
(if |x - c| ≤ r then cos (pi * (x - c) / (2*r)) else 0)
= cos (pi * (projIcc (-r) r (by linarith) (x-c) : ℝ) / (2*r))
Proof (Lean source)
-- @node: localized_cosine_eq_clamped lemma localized_cosine_eq_clamped (r c x : ℝ) (hr : 0 < r) : (if |x - c| ≤ r then cos (pi * (x - c) / (2*r)) else 0) = cos (pi * (projIcc (-r) r (by linarith) (x-c) : ℝ) / (2*r)) := by classical by_cases hx : |x-c| ≤ r · rw [if_pos hx, projIcc_of_mem _ (abs_le.mp hx)] · rw [if_neg hx] have hout : x-c < -r ∨ r < x-c := by simpa only [not_and_or, not_le] using (show ¬ (-r ≤ x-c ∧ x-c ≤ r) by simpa only [← abs_le] using hx) rcases hout with hlo | hhi · rw [projIcc_of_le_left _ hlo.le] have he : pi * (-r) / (2*r) = -(pi/2) := by field_simp rw [he, Real.cos_neg, Real.cos_pi_div_two] · rw [projIcc_of_right_le _ hhi.le] have he : pi * r / (2*r) = pi/2 := by field_simp rw [he, Real.cos_pi_div_two]
CausalSmith.Stat.PrivateCateRoughdesign.localized_cosine_eq_clamped · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/FrameRegularity.lean:11
theorem localized_cosine_difference Lemma localized_cosine_difference in the paper ↗

A zero-extended cosine has its global cosine Lipschitz bound across both support endpoints. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
r c x y :
ℝ
hr :
0 < r
|(if |x-c| ≤ r then cos (pi*(x-c)/(2*r)) else 0)
- (if |y-c| ≤ r then cos (pi*(y-c)/(2*r)) else 0)|
≤ pi/(2*r) * |x-y|
Proof (Lean source)
-- @node: localized_cosine_difference lemma localized_cosine_difference (r c x y : ℝ) (hr : 0 < r) : |(if |x-c| ≤ r then cos (pi*(x-c)/(2*r)) else 0) - (if |y-c| ≤ r then cos (pi*(y-c)/(2*r)) else 0)| ≤ pi/(2*r) * |x-y| := by rw [localized_cosine_eq_clamped r c x hr, localized_cosine_eq_clamped r c y hr] have hc := (LipschitzWith.projIcc (show -r ≤ r by linarith)).dist_le_mul (x-c) (y-c) simp only [Subtype.dist_eq, Real.dist_eq, NNReal.coe_one, one_mul] at hc have ha : |pi * (projIcc (-r) r (by linarith) (x-c) : ℝ) / (2*r) - pi * (projIcc (-r) r (by linarith) (y-c) : ℝ) / (2*r)| = pi/(2*r) * |(projIcc (-r) r (by linarith) (x-c) : ℝ) - (projIcc (-r) r (by linarith) (y-c) : ℝ)| := by rw [← sub_div, ← mul_sub, abs_div, abs_mul, abs_of_pos Real.pi_pos, abs_of_pos (by positivity : 0 < 2*r)] ring calc _ ≤ _ := Real.abs_cos_sub_cos_le _ _ _ = _ := ha _ ≤ _ := by apply mul_le_mul_of_nonneg_left _ (by positivity) simpa only [sub_sub_sub_cancel_right] using hc
CausalSmith.Stat.PrivateCateRoughdesign.localized_cosine_difference · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/FrameRegularity.lean:31
theorem square_difference_le_twice Lemma square_difference_le_twice in the paper ↗

Squaring values in the unit interval at most doubles their absolute difference. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
u v :
ℝ
hu :
|u| ≤ 1
hv :
|v| ≤ 1
|u^2-v^2| ≤ 2*|u-v|
Proof (Lean source)
-- @node: square_difference_le_twice lemma square_difference_le_twice (u v : ℝ) (hu : |u| ≤ 1) (hv : |v| ≤ 1) : |u^2-v^2| ≤ 2*|u-v| := by have he : u^2-v^2 = (u-v)*(u+v) := by ring rw [he, abs_mul] have hs : |u+v| ≤ 2 := (abs_add_le u v).trans (by linarith) nlinarith [abs_nonneg (u-v)]
CausalSmith.Stat.PrivateCateRoughdesign.square_difference_le_twice · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/FrameRegularity.lean:54
theorem envelope_difference_bound Lemma envelope_difference_bound in the paper ↗

The macro envelope has a global Lipschitz modulus, with no exception at support boundaries. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hh :
0 < hL
x y :
|envelope hL x - envelope hL y| ≤ (pi/hL)*|(x : ℝ)-y|
Proof (Lean source)
-- @node: envelope_difference_bound lemma envelope_difference_bound (hL : ℝ) (hh : 0 < hL) (x y : Covariate) : |envelope hL x - envelope hL y| ≤ (pi/hL)*|(x : ℝ)-y| := by classical let f (z : Covariate) : ℝ := if |(z : ℝ)-x0| ≤ hL then cos (pi*((z : ℝ)-x0)/(2*hL)) else 0 have hf (z : Covariate) : |f z| ≤ 1 := by dsimp [f] split_ifs <;> first | exact Real.abs_cos_le_one _ | norm_num have he (z : Covariate) : envelope hL z = (f z)^2 := by dsimp [envelope, f] split_ifs <;> ring rw [he x, he y] calc _ ≤ 2*|f x-f y| := square_difference_le_twice _ _ (hf x) (hf y) _ ≤ 2*(pi/(2*hL)*|(x : ℝ)-y|) := mul_le_mul_of_nonneg_left (localized_cosine_difference hL x0 x y hh) (by norm_num) _ = _ := by field_simp
CausalSmith.Stat.PrivateCateRoughdesign.envelope_difference_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/FrameRegularity.lean:63

The squared envelope has a global Lipschitz modulus inherited from the envelope. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hh :
0 < hL
x y :
|bump hL x - bump hL y| ≤ (2*pi/hL)*|(x : ℝ)-y|
Proof (Lean source)
-- @node: bump_difference_bound lemma bump_difference_bound (hL : ℝ) (hh : 0 < hL) (x y : Covariate) : |bump hL x - bump hL y| ≤ (2*pi/hL)*|(x : ℝ)-y| := by have hx := envelope_range hL x have hy := envelope_range hL y calc _ ≤ 2*|envelope hL x-envelope hL y| := square_difference_le_twice _ _ (by simpa only [abs_of_nonneg hx.1] using hx.2) (by simpa only [abs_of_nonneg hy.1] using hy.2) _ ≤ 2*((pi/hL)*|(x : ℝ)-y|) := mul_le_mul_of_nonneg_left (envelope_difference_bound hL hh x y) (by norm_num) _ = _ := by ring
CausalSmith.Stat.PrivateCateRoughdesign.bump_difference_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/FrameRegularity.lean:83

Each micro-frame has the global modulus of its zero-extended cosine. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hh :
0 < hL
j :
ℤ
x y :
|frame hL j x-frame hL j y| ≤ (pi/(2*deltaL hL))*|(x : ℝ)-y|
Proof (Lean source)
-- @node: frame_difference_bound lemma frame_difference_bound (hL : ℝ) (hh : 0 < hL) (j : ℤ) (x y : Covariate) : |frame hL j x-frame hL j y| ≤ (pi/(2*deltaL hL))*|(x : ℝ)-y| := by exact localized_cosine_difference (deltaL hL) (j*deltaL hL) x y (pow_pos hh 5)
CausalSmith.Stat.PrivateCateRoughdesign.frame_difference_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/FrameRegularity.lean:96
theorem holder_modulus_of_two_bounds Lemma holder_modulus_of_two_bounds in the paper ↗

A bounded oscillation and a Lipschitz modulus give the one-tenth Holder modulus by splitting distances at the public radius. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
r z v C :
ℝ
hr :
0 < r
hz :
0 ≤ z
hC :
0 ≤ C
hbound :
v ≤ C
hlip :
v ≤ C*(z/r)
v ≤ C*z^(1/10 : ℝ)/r^(1/10 : ℝ)
Proof (Lean source)
-- @node: holder_modulus_of_two_bounds lemma holder_modulus_of_two_bounds (r z v C : ℝ) (hr : 0 < r) (hz : 0 ≤ z) (hC : 0 ≤ C) (hbound : v ≤ C) (hlip : v ≤ C*(z/r)) : v ≤ C*z^(1/10 : ℝ)/r^(1/10 : ℝ) := by by_cases hzero : z = 0 · subst z simpa using hlip have hzpos : 0 < z := lt_of_le_of_ne hz (Ne.symm hzero) have hu : 0 ≤ z/r := div_nonneg hz hr.le have hid : (z/r)^(1/10 : ℝ) = z^(1/10 : ℝ)/r^(1/10 : ℝ) := Real.div_rpow hz hr.le _ rw [div_eq_mul_inv, mul_assoc, ← div_eq_mul_inv, ← hid] by_cases hs : z/r ≤ 1 · have he : z/r ≤ (z/r)^(1/10 : ℝ) := by have h := Real.rpow_le_rpow_of_exponent_ge (div_pos hzpos hr) hs (by norm_num : (1/10 : ℝ) ≤ 1) simpa using h exact hlip.trans (mul_le_mul_of_nonneg_left he hC) · have he : 1 ≤ (z/r)^(1/10 : ℝ) := Real.one_le_rpow (le_of_not_ge hs) (by norm_num) exact hbound.trans (by nlinarith)
CausalSmith.Stat.PrivateCateRoughdesign.holder_modulus_of_two_bounds · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/FrameRegularity.lean:102
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.IntervalEvents 1 declarations Borel point-containment events for the shared interval representation.

Borel point-containment events for the shared interval representation.

theorem measurableSet_interval_contains Lemma measurableSet_interval_contains in the paper ↗

Point containment is Borel for every empty, finite, or unbounded interval code. The displayed conclusion follows.

Formal statement
x :
ℝ
MeasurableSet {c : IntervalCode | x ∈ c.toSet}
Proof (Lean source)
-- @node: measurableSet_interval_contains lemma measurableSet_interval_contains (x : ℝ) : MeasurableSet {c : IntervalCode | x ∈ c.toSet} := by apply measurableSet_sum_iff.mpr constructor · simp [IntervalCode.toSet] · change MeasurableSet {p : EReal × EReal × Bool × Bool | (if p.2.2.1 then p.1 ≤ (x : EReal) else p.1 < (x : EReal)) ∧ (if p.2.2.2 then (x : EReal) ≤ p.2.1 else (x : EReal) < p.2.1)} have hl : Measurable (fun p : EReal × EReal × Bool × Bool => p.1) := by fun_prop have hu : Measurable (fun p : EReal × EReal × Bool × Bool => p.2.1) := by fun_prop have hc0 : MeasurableSet {p : EReal × EReal × Bool × Bool | p.2.2.1 = true} := by exact measurableSet_eq_fun (by fun_prop) measurable_const have hc1 : MeasurableSet {p : EReal × EReal × Bool × Bool | p.2.2.2 = true} := by exact measurableSet_eq_fun (by fun_prop) measurable_const convert (MeasurableSet.ite hc0 (measurableSet_le hl (measurable_const (a := (x : EReal)))) (measurableSet_lt hl (measurable_const (a := (x : EReal))))).inter (MeasurableSet.ite hc1 (measurableSet_le (measurable_const (a := (x : EReal))) hu) (measurableSet_lt (measurable_const (a := (x : EReal))) hu)) using 1 ext p simp [Set.ite, ite_prop_iff_or, and_comm]
CausalSmith.Stat.PrivateCateRoughdesign.measurableSet_interval_contains · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/IntervalEvents.lean:8
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.Inversion 11 declarations Explicit endpoints and measurability for the affine acceptance-set inversion.

Explicit endpoints and measurability for the affine acceptance-set inversion.

theorem affine_acceptance_positive Lemma affine_acceptance_positive in the paper ↗

Positive denominators turn the affine acceptance inequality into two explicit endpoints. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
b z r :
ℝ
hb :
0 < b
hr :
0 ≤ r
{x : ℝ | x ∈ Icc (-1) 1 ∧ |clip (-b) b z - x*b| ≤ r*b}
= Icc (max (-1) (clip (-b) b z / b - r)) (min 1 (clip (-b) b z / b + r))
Proof (Lean source)
-- @node: affine_acceptance_positive lemma affine_acceptance_positive (b z r : ℝ) (hb : 0 < b) (hr : 0 ≤ r) : {x : ℝ | x ∈ Icc (-1) 1 ∧ |clip (-b) b z - x*b| ≤ r*b} = Icc (max (-1) (clip (-b) b z / b - r)) (min 1 (clip (-b) b z / b + r)) := by ext x simp only [mem_setOf_eq, mem_Icc, max_le_iff, le_min_iff, abs_le] constructor · rintro ⟨⟨hx0, hx1⟩, h0, h1⟩ refine ⟨⟨hx0, ?_⟩, hx1, ?_⟩ · have : clip (-b) b z / b ≤ x + r := (div_le_iff₀ hb).mpr (by nlinarith) linarith · have : x - r ≤ clip (-b) b z / b := (le_div_iff₀ hb).mpr (by nlinarith) linarith · rintro ⟨⟨hx0, hxlo⟩, hx1, hxhi⟩ have hlo : clip (-b) b z ≤ (x+r)*b := (div_le_iff₀ hb).mp (by linarith) have hhi : (x-r)*b ≤ clip (-b) b z := (le_div_iff₀ hb).mp (by linarith) exact ⟨⟨hx0, hx1⟩, by nlinarith, by nlinarith⟩
CausalSmith.Stat.PrivateCateRoughdesign.affine_acceptance_positive · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Inversion.lean:10
theorem affine_acceptance_endpoints_ordered Lemma affine_acceptance_endpoints_ordered in the paper ↗

Clipping places the center inside the target range, so the truncated endpoints are ordered. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
b z r :
ℝ
hb :
0 < b
hr :
0 ≤ r
max (-1) (clip (-b) b z / b - r) ≤ min 1 (clip (-b) b z / b + r)
Proof (Lean source)
-- @node: affine_acceptance_endpoints_ordered lemma affine_acceptance_endpoints_ordered (b z r : ℝ) (hb : 0 < b) (hr : 0 ≤ r) : max (-1) (clip (-b) b z / b - r) ≤ min 1 (clip (-b) b z / b + r) := by have hlo : -b ≤ clip (-b) b z := le_max_left _ _ have hhi : clip (-b) b z ≤ b := by unfold clip exact max_le (by linarith) (min_le_left _ _) have hc0 : -1 ≤ clip (-b) b z / b := (le_div_iff₀ hb).mpr (by linarith) have hc1 : clip (-b) b z / b ≤ 1 := (div_le_iff₀ hb).mpr (by linarith) simp only [max_le_iff, le_min_iff] constructor <;> constructor <;> linarith
CausalSmith.Stat.PrivateCateRoughdesign.affine_acceptance_endpoints_ordered · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Inversion.lean:34
theorem affine_acceptance_nonpositive Lemma affine_acceptance_nonpositive in the paper ↗

A nonpositive denominator gives the full range at zero, a singleton at zero radius, or an empty acceptance set. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
b z r :
ℝ
hb :
b ≤ 0
hr :
0 ≤ r
{x : ℝ | x ∈ Icc (-1) 1 ∧ |clip (-b) b z - x*b| ≤ r*b}
= if b = 0 then Icc (-1) 1 else if r = 0 then Icc (-1) (-1) else ∅
Proof (Lean source)
-- @node: affine_acceptance_nonpositive lemma affine_acceptance_nonpositive (b z r : ℝ) (hb : b ≤ 0) (hr : 0 ≤ r) : {x : ℝ | x ∈ Icc (-1) 1 ∧ |clip (-b) b z - x*b| ≤ r*b} = if b = 0 then Icc (-1) 1 else if r = 0 then Icc (-1) (-1) else ∅ := by have hc : clip (-b) b z = -b := by unfold clip exact max_eq_left (by have := min_le_left b z; linarith) rw [hc] split_ifs with hb0 hr0 · subst b ext x simp · have hbneg : b < 0 := lt_of_le_of_ne hb hb0 subst r ext x simp only [mem_setOf_eq, mem_Icc, zero_mul, abs_le] constructor · rintro ⟨⟨hx0, hx1⟩, he⟩ have : x = -1 := by nlinarith [he.1, he.2] simp [this] · rintro ⟨hx0, hx1⟩ have : x = -1 := by linarith subst x constructor · constructor <;> norm_num · simp · have hbneg : b < 0 := lt_of_le_of_ne hb hb0 have hrpos : 0 < r := lt_of_le_of_ne hr (Ne.symm hr0) ext x simp only [mem_setOf_eq, mem_empty_iff_false, iff_false, not_and] intro hx ha have := abs_nonneg (-b - x*b) have := mul_neg_of_pos_of_neg hrpos hbneg linarith
CausalSmith.Stat.PrivateCateRoughdesign.affine_acceptance_nonpositive · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Inversion.lean:47
def acceptedSet

The inversion accepts exactly the target-range candidates satisfying the specified floored and clipped affine inequality.

Definition (Lean source)
n :
ℕ
shared
epsilon :
ℝ
shared
h :
ℝ
shared
k :
ℕ
shared
v :
Fin 2 → ℝ
acceptedSet n epsilon h k v :
Set ℝ
bd :
max (d0 n h k) (v 1)
bn :
clip (-bd) bd (v 0)
{vartheta | vartheta ∈ Icc (-1) 1 ∧ |bn - vartheta*bd| ≤ sqrt (10*Vbound n epsilon h k)*bd}
def inversionMap

The inversion returns the closed interval hull of the accepted set, with the prescribed full- range fallback.

Definition (Lean source)
n :
ℕ
shared
epsilon :
ℝ
shared
h :
ℝ
shared
k :
ℕ
shared
v :
Fin 2 → ℝ
inversionMap n epsilon h k v :
if (acceptedSet n epsilon h k v).Nonempty then closedInterval (sInf (acceptedSet n epsilon h k v)) (sSup (acceptedSet n epsilon h k v)) else closedInterval (-1) 1
theorem inversionMap_eq_endpoints

The interval hull inversion has explicit endpoints on every denominator branch. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
shared
epsilon :
ℝ
shared
h :
ℝ
shared
k :
ℕ
shared
v :
Fin 2 → ℝ
inversionMap n epsilon h k v
= if 0 < max (d0 n h k) (v 1) then closedInterval (max (-1) (clip (-(max (d0 n h k) (v 1))) (max (d0 n h k) (v 1)) (v 0) / max (d0 n h k) (v 1) - sqrt (10*Vbound n epsilon h k))) (min 1 (clip (-(max (d0 n h k) (v 1))) (max (d0 n h k) (v 1)) (v 0) / max (d0 n h k) (v 1) + sqrt (10*Vbound n epsilon h k))) else if max (d0 n h k) (v 1) = 0 then closedInterval (-1) 1 else if sqrt (10*Vbound n epsilon h k) = 0 then closedInterval (-1) (-1) else closedInterval (-1) 1
Proof (Lean source)
-- @node: inversionMap_eq_endpoints lemma inversionMap_eq_endpoints (v : Fin 2 → ℝ) : inversionMap n epsilon h k v = if 0 < max (d0 n h k) (v 1) then closedInterval (max (-1) (clip (-(max (d0 n h k) (v 1))) (max (d0 n h k) (v 1)) (v 0) / max (d0 n h k) (v 1) - sqrt (10*Vbound n epsilon h k))) (min 1 (clip (-(max (d0 n h k) (v 1))) (max (d0 n h k) (v 1)) (v 0) / max (d0 n h k) (v 1) + sqrt (10*Vbound n epsilon h k))) else if max (d0 n h k) (v 1) = 0 then closedInterval (-1) 1 else if sqrt (10*Vbound n epsilon h k) = 0 then closedInterval (-1) (-1) else closedInterval (-1) 1 := by classical let b := max (d0 n h k) (v 1) let r := sqrt (10*Vbound n epsilon h k) have hr : 0 ≤ r := Real.sqrt_nonneg _ change inversionMap n epsilon h k v = if 0 < b then _ else _ by_cases hb : 0 < b · rw [if_pos hb] have hs : acceptedSet n epsilon h k v = Icc (max (-1) (clip (-b) b (v 0) / b - r)) (min 1 (clip (-b) b (v 0) / b + r)) := affine_acceptance_positive b (v 0) r hb hr have ho := affine_acceptance_endpoints_ordered b (v 0) r hb hr simp only [inversionMap, hs, nonempty_Icc.mpr ho, ↓reduceIte, csInf_Icc ho, csSup_Icc ho] rfl · rw [if_neg hb] have hs := affine_acceptance_nonpositive b (v 0) r (le_of_not_gt hb) hr change acceptedSet n epsilon h k v = _ at hs by_cases hb0 : b = 0 · rw [if_pos hb0] have hs' : acceptedSet n epsilon h k v = Icc (-1) 1 := by simpa [hb0] using hs simp [inversionMap, hs', csInf_Icc, csSup_Icc] · rw [if_neg hb0] by_cases hr0 : r = 0 · rw [if_pos hr0] have hs' : acceptedSet n epsilon h k v = Icc (-1) (-1) := by simpa [hb0, hr0] using hs simp [inversionMap, hs', csInf_Icc, csSup_Icc] · rw [if_neg hr0] have hs' : acceptedSet n epsilon h k v = ∅ := by simpa [hb0, hr0] using hs simp [inversionMap, hs']
CausalSmith.Stat.PrivateCateRoughdesign.inversionMap_eq_endpoints · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Inversion.lean:100
theorem measurable_inversionMap Lemma measurable_inversionMap in the paper ↗

The explicit inversion is measurable, including the zero and negative denominator cases. The displayed conclusion follows.

Formal statement
n :
ℕ
shared
epsilon :
ℝ
shared
h :
ℝ
shared
k :
ℕ
shared
Measurable (inversionMap n epsilon h k)
Proof (Lean source)
-- @node: measurable_inversionMap @[fun_prop] lemma measurable_inversionMap : Measurable (inversionMap n epsilon h k) := by have heq := funext (inversionMap_eq_endpoints n epsilon h k) rw [heq] have hb : Measurable (fun v : Fin 2 → ℝ => max (d0 n h k) (v 1)) := by fun_prop apply Measurable.ite · exact measurableSet_lt measurable_const hb · unfold closedInterval clip fun_prop · apply Measurable.ite · exact measurableSet_eq_fun hb measurable_const · exact measurable_const · by_cases hr : sqrt (10*Vbound n epsilon h k) = 0 <;> simp only [hr, ↓reduceIte] <;> exact measurable_const
CausalSmith.Stat.PrivateCateRoughdesign.measurable_inversionMap · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Inversion.lean:144

The publicly tuned inversion uses the same single joint release and returns the full target range in the constant branch.

Definition (Lean source)
n :
ℕ
shared
epsilon :
ℝ
shared
optimalIntervalHandle n epsilon :
if 1/8
≤ rate n epsilon then Kernel.const _ (Measure.dirac (closedInterval (-1) 1)) else (privateRatioRelease n epsilon (tunedH n epsilon) (tunedK n epsilon)).mapOfMeasurable (inversionMap n epsilon (tunedH n epsilon) (tunedK n epsilon)) (measurable_inversionMap n epsilon (tunedH n epsilon) (tunedK n epsilon))
CausalSmith.Stat.PrivateCateRoughdesign.optimalIntervalHandle · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Inversion.lean:164

The numerical interval scale output is the benchmark.

Definition (Lean source)
n :
ℕ
shared
epsilon :
ℝ
shared
ell n epsilon :
ℝ
rate n epsilon

The fixed interval lower constant is two to the power minus twenty.

Definition (Lean source)
cI :
ℝ
(2 : ℝ)^(-20 : ℤ)

The fixed interval upper constant is two to the power twenty-two.

Definition (Lean source)
CI :
ℝ
2^22
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.MixtureOverlap 31 declarations Exact iid likelihood-overlap expansion of the shared-sign mixture and its reduction to a finite exponential average.

Exact iid likelihood-overlap expansion of the shared-sign mixture and its reduction to a finite exponential average. All domination and integrability conditions are derived.

theorem observed_probability

Every observed causal law is a probability measure. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
P :
Proof (Lean source)
-- @node: observed_probability lemma observed_probability (P : CausalLaw) : IsProbabilityMeasure (Pobs P) := by have hm : Measurable observe := by unfold observe X A Y; fun_prop exact Measure.isProbabilityMeasure_map hm.aemeasurable
CausalSmith.Stat.PrivateCateRoughdesign.observed_probability · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/MixtureOverlap.lean:12
theorem sign_weight_eq_inv_card Lemma sign_weight_eq_inv_card in the paper ↗

The finite sign weight is the reciprocal of the number of sign vectors. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
ofReal ((2 : ℝ)^(-((activeSigns hL).card : ℤ)))
= (card (SignVector hL) : ℝ≥0∞)⁻¹
Proof (Lean source)
-- @node: sign_weight_eq_inv_card lemma sign_weight_eq_inv_card (hL : ℝ) : ofReal ((2 : ℝ)^(-((activeSigns hL).card : ℤ))) = (card (SignVector hL) : ℝ≥0∞)⁻¹ := by classical have hc : (card (SignVector hL) : ℝ≥0∞) ≠ 0 := by exact_mod_cast Fintype.card_ne_zero calc _ = ofReal ((2 : ℝ)^(-((activeSigns hL).card : ℤ))) * ((card (SignVector hL) : ℝ≥0∞) * (card (SignVector hL) : ℝ≥0∞)⁻¹) := by rw [ENNReal.mul_inv_cancel hc (by simp), mul_one] _ = _ := by rw [← mul_assoc, sign_weight_normalization, one_mul]
CausalSmith.Stat.PrivateCateRoughdesign.sign_weight_eq_inv_card · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/MixtureOverlap.lean:18
theorem signMixture_eq_uniformMixture

The dataset sign mixture is exactly the library's uniform finite iid mixture. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
signMixture hL hhL n
= uniformMixture (fun lam : SignVector hL => Measure.pi (fun _ : Fin n => Pobs (cosineFamily hL hhL lam)))
Proof (Lean source)
-- @node: signMixture_eq_uniformMixture lemma signMixture_eq_uniformMixture (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) : signMixture hL hhL n = uniformMixture (fun lam : SignVector hL => Measure.pi (fun _ : Fin n => Pobs (cosineFamily hL hhL lam))) := by classical simp only [signMixture, sign_weight_eq_inv_card, dataLaw, uniformMixture, mixture, Finset.smul_sum]
CausalSmith.Stat.PrivateCateRoughdesign.signMixture_eq_uniformMixture · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/MixtureOverlap.lean:33
theorem rnDeriv_toReal_le_of_domination Lemma rnDeriv_toReal_le_of_domination in the paper ↗

Finite domination bounds the real density under the reference measure. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
α :
μ ν :
c :
ℝ≥0∞
hc0 :
c ≠ 0
hct :
c ≠ ∞
hle :
μ ≤ c • ν
∀ᵐ z ∂ν, (μ.rnDeriv ν z).toReal ≤ c.toReal
Proof (Lean source)
-- @node: rnDeriv_toReal_le_of_domination lemma rnDeriv_toReal_le_of_domination {α : Type*} [MeasurableSpace α] (μ ν : Measure α) [IsFiniteMeasure ν] (c : ℝ≥0∞) (hc0 : c ≠ 0) (hct : c ≠ ∞) (hle : μ ≤ c • ν) : ∀ᵐ z ∂ν, (μ.rnDeriv ν z).toReal ≤ c.toReal := by letI : IsFiniteMeasure (c • ν) := Measure.smul_finite ν hct letI : IsFiniteMeasure μ := isFiniteMeasure_of_le (c • ν) hle have hsmall : μ.rnDeriv (c • ν) ≤ᵐ[ν] 1 := (Measure.absolutelyContinuous_smul hc0).ae_le (Measure.rnDeriv_le_one_of_le hle) filter_upwards [hsmall, Measure.rnDeriv_smul_right_of_ne_top μ ν hc0 hct] with z hz hs rw [hs, Pi.smul_apply, smul_eq_mul] at hz apply ENNReal.toReal_mono hct calc _ = c * (c⁻¹ * μ.rnDeriv ν z) := by rw [← mul_assoc, ENNReal.mul_inv_cancel hc0 hct, one_mul] _ ≤ c * 1 := mul_le_mul' le_rfl hz _ = c := mul_one _
CausalSmith.Stat.PrivateCateRoughdesign.rnDeriv_toReal_le_of_domination · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/MixtureOverlap.lean:45
theorem cosineFamily_density_pair_integrable

Products of the alternative one-record densities are integrable, with bound sixty-four. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
lam lam' :
Integrable (fun z => ((Pobs (cosineFamily hL hhL lam)).rnDeriv (Pobs fairNull) z).toReal * ((Pobs (cosineFamily hL hhL lam')).rnDeriv (Pobs fairNull) z).toReal) (Pobs fairNull)
Proof (Lean source)
-- @node: cosineFamily_density_pair_integrable lemma cosineFamily_density_pair_integrable (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (lam lam' : SignVector hL) : Integrable (fun z => ((Pobs (cosineFamily hL hhL lam)).rnDeriv (Pobs fairNull) z).toReal * ((Pobs (cosineFamily hL hhL lam')).rnDeriv (Pobs fairNull) z).toReal) (Pobs fairNull) := by letI := observed_probability fairNull have hb (l : SignVector hL) := rnDeriv_toReal_le_of_domination (Pobs (cosineFamily hL hhL l)) (Pobs fairNull) 8 (by norm_num) (by norm_num) (cosineFamily_observed_domination hL hhL l) apply Integrable.of_mem_Icc 0 64 (by fun_prop) filter_upwards [hb lam, hb lam'] with z hz hz' norm_num at hz hz' exact ⟨mul_nonneg ENNReal.toReal_nonneg ENNReal.toReal_nonneg, (mul_le_mul hz hz' ENNReal.toReal_nonneg (by norm_num)).trans (by norm_num)⟩
CausalSmith.Stat.PrivateCateRoughdesign.cosineFamily_density_pair_integrable · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/MixtureOverlap.lean:64

The one-record density overlap is the nonnegative likelihood inner product.

Definition (Lean source)
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
lam lam' :
signDensityOverlap hL hhL lam lam' :
ℝ
∫ z, ((Pobs (cosineFamily hL hhL lam)).rnDeriv (Pobs fairNull) z).toReal * ((Pobs (cosineFamily hL hhL lam')).rnDeriv (Pobs fairNull) z).toReal ∂Pobs fairNull
theorem signDensityOverlap_nonneg

Each one-record density overlap is nonnegative. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
lam lam' :
0 ≤ signDensityOverlap hL hhL lam lam'
Proof (Lean source)
-- @node: signDensityOverlap_nonneg lemma signDensityOverlap_nonneg (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (lam lam' : SignVector hL) : 0 ≤ signDensityOverlap hL hhL lam lam' := by exact integral_nonneg (fun _ => mul_nonneg ENNReal.toReal_nonneg ENNReal.toReal_nonneg)
CausalSmith.Stat.PrivateCateRoughdesign.signDensityOverlap_nonneg · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/MixtureOverlap.lean:88
theorem signMixture_chiSq_overlap_identity

One plus the dataset mixture divergence is exactly the uniform average of nth powers of one-record overlaps; the iid product and finite-mixture identities come from Causalean. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
= (∑ lam : SignVector hL, ∑ lam' : SignVector hL, (signDensityOverlap hL hhL lam lam')^n) / (card (SignVector hL) : ℝ)^2
Proof (Lean source)
-- @node: signMixture_chiSq_overlap_identity lemma signMixture_chiSq_overlap_identity (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) : 1 + chiSqDiv (signMixture hL hhL n) (dataLaw n fairNull) = (∑ lam : SignVector hL, ∑ lam' : SignVector hL, (signDensityOverlap hL hhL lam lam')^n) / (card (SignVector hL) : ℝ)^2 := by letI (P : CausalLaw) := observed_probability P rw [signMixture_eq_uniformMixture] exact one_add_chiSqDiv_uniformMixture_iid (fun lam : SignVector hL => Pobs (cosineFamily hL hhL lam)) (Pobs fairNull) (fun lam => Measure.absolutelyContinuous_of_le_smul (cosineFamily_observed_domination hL hhL lam)) (cosineFamily_density_pair_integrable hL hhL) n
CausalSmith.Stat.PrivateCateRoughdesign.signMixture_chiSq_overlap_identity · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/MixtureOverlap.lean:94
theorem signDensityOverlap_pow_le_exp

Nonnegative likelihood overlaps raised to n are dominated by the exponential of the centered overlap times n, as used in the fixed-sample roadmap. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
lam lam' :
(signDensityOverlap hL hhL lam lam')^n
≤ exp ((n : ℝ)*(signDensityOverlap hL hhL lam lam'-1))
Proof (Lean source)
-- @node: signDensityOverlap_pow_le_exp lemma signDensityOverlap_pow_le_exp (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (lam lam' : SignVector hL) : (signDensityOverlap hL hhL lam lam')^n ≤ exp ((n : ℝ)*(signDensityOverlap hL hhL lam lam'-1)) := by have hb : signDensityOverlap hL hhL lam lam' ≤ exp (signDensityOverlap hL hhL lam lam'-1) := by simpa using Real.add_one_le_exp (signDensityOverlap hL hhL lam lam'-1) calc _ ≤ (exp (signDensityOverlap hL hhL lam lam'-1))^n := pow_le_pow_left₀ (signDensityOverlap_nonneg hL hhL lam lam') hb n _ = _ := by rw [← Real.exp_nat_mul]
CausalSmith.Stat.PrivateCateRoughdesign.signDensityOverlap_pow_le_exp · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/MixtureOverlap.lean:111
theorem signMixture_chiSq_le_exp_average

The exact iid mixture identity reduces its divergence bound to a finite exponential average, without any additional integrability or absolute-continuity assumptions. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
≤ (∑ lam : SignVector hL, ∑ lam' : SignVector hL, exp ((n : ℝ)*(signDensityOverlap hL hhL lam lam'-1))) / (card (SignVector hL) : ℝ)^2
Proof (Lean source)
-- @node: signMixture_chiSq_le_exp_average lemma signMixture_chiSq_le_exp_average (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) : 1 + chiSqDiv (signMixture hL hhL n) (dataLaw n fairNull) ≤ (∑ lam : SignVector hL, ∑ lam' : SignVector hL, exp ((n : ℝ)*(signDensityOverlap hL hhL lam lam'-1))) / (card (SignVector hL) : ℝ)^2 := by rw [signMixture_chiSq_overlap_identity] apply div_le_div_of_nonneg_right _ (sq_nonneg _) exact Finset.sum_le_sum (fun lam _ => Finset.sum_le_sum (fun lam' _ => signDensityOverlap_pow_le_exp hL hhL n lam lam'))
CausalSmith.Stat.PrivateCateRoughdesign.signMixture_chiSq_le_exp_average · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/MixtureOverlap.lean:126

The centered conditional likelihood inner product in the paper's Fourier expansion.

Definition (Lean source)
hL :
ℝ
lam lam' :
x :
signOverlapIntegrand hL lam lam' x :
ℝ
separation hL * (1 + (separation hL*bump hL x-1)^2) * perturbation hL lam x * perturbation hL lam' x
+ (separation hL)^2 * (bump hL x-(perturbation hL lam x)^2) * (bump hL x-(perturbation hL lam' x)^2)
CausalSmith.Stat.PrivateCateRoughdesign.signOverlapIntegrand · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/MixtureOverlap.lean:140
theorem conditionalLikelihood_pair_inner_product

Orthogonality of the four fair marks leaves exactly the two terms of the centered overlap integrand, pointwise in the covariate. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
lam lam' :
x :
(∑ av : Bool, ∑ yv : Bool, conditionalLikelihood hL lam x av yv * conditionalLikelihood hL lam' x av yv) / 4
= 1 + signOverlapIntegrand hL lam lam' x
Proof (Lean source)
-- @node: conditionalLikelihood_pair_inner_product lemma conditionalLikelihood_pair_inner_product (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (lam lam' : SignVector hL) (x : Covariate) : (∑ av : Bool, ∑ yv : Bool, conditionalLikelihood hL lam x av yv * conditionalLikelihood hL lam' x av yv) / 4 = 1 + signOverlapIntegrand hL lam lam' x := by have ht : 0 ≤ separation hL := (separation_le_sqrt hL hhL).1 simp_rw [conditionalLikelihood_fourier hL hhL] simp only [Fintype.sum_bool, bit, if_true, Bool.false_eq_true, if_false] dsimp [signOverlapIntegrand] ring_nf rw [Real.sq_sqrt ht] ring
CausalSmith.Stat.PrivateCateRoughdesign.conditionalLikelihood_pair_inner_product · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/MixtureOverlap.lean:148
theorem measurable_signOverlapIntegrand

The centered overlap integrand is Borel measurable in the covariate. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
lam lam' :
Proof (Lean source)
-- @node: measurable_signOverlapIntegrand @[fun_prop] lemma measurable_signOverlapIntegrand (hL : ℝ) (lam lam' : SignVector hL) : Measurable (signOverlapIntegrand hL lam lam') := by unfold signOverlapIntegrand fun_prop
CausalSmith.Stat.PrivateCateRoughdesign.measurable_signOverlapIntegrand · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/MixtureOverlap.lean:164
theorem perturbation_sign_square_sum_exact Lemma perturbation_sign_square_sum_exact in the paper ↗

The finite sign second moment is exactly the number of signs times the bump, including macro endpoints and lattice boundaries. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
x :
(∑ lam : SignVector hL, (perturbation hL lam x)^2)
= (card (SignVector hL) : ℝ)*bump hL x
Proof (Lean source)
-- @node: perturbation_sign_square_sum_exact lemma perturbation_sign_square_sum_exact (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (x : Covariate) : (∑ lam : SignVector hL, (perturbation hL lam x)^2) = (card (SignVector hL) : ℝ)*bump hL x := by rw [perturbation_sign_square_sum, weighted_frame_square_partition hL hhL]
CausalSmith.Stat.PrivateCateRoughdesign.perturbation_sign_square_sum_exact · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/MixtureOverlap.lean:171
theorem signOverlapIntegrand_sign_sum

Averaging the centered integrand over the first sign vector gives zero for every fixed second sign vector and every covariate, exactly as required by the mgf step. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
lam' :
x :
(∑ lam : SignVector hL, signOverlapIntegrand hL lam lam' x) = 0
Proof (Lean source)
-- @node: signOverlapIntegrand_sign_sum lemma signOverlapIntegrand_sign_sum (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (lam' : SignVector hL) (x : Covariate) : (∑ lam : SignVector hL, signOverlapIntegrand hL lam lam' x) = 0 := by classical simp only [signOverlapIntegrand, Finset.sum_add_distrib, ← Finset.sum_mul, ← Finset.mul_sum, Finset.sum_sub_distrib, perturbation_sign_sum, perturbation_sign_square_sum_exact hL hhL, Finset.sum_const, Finset.card_univ, nsmul_eq_mul] ring
CausalSmith.Stat.PrivateCateRoughdesign.signOverlapIntegrand_sign_sum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/MixtureOverlap.lean:180
theorem signOverlapIntegrand_sign_mean

The actual sign probability law gives the centered integrand mean zero pointwise. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
lam' :
x :
(∫ lam, signOverlapIntegrand hL lam lam' x ∂signLaw hL) = 0
Proof (Lean source)
-- @node: signOverlapIntegrand_sign_mean lemma signOverlapIntegrand_sign_mean (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (lam' : SignVector hL) (x : Covariate) : (∫ lam, signOverlapIntegrand hL lam lam' x ∂signLaw hL) = 0 := by rw [integral_signLaw, signOverlapIntegrand_sign_sum hL hhL, mul_zero]
CausalSmith.Stat.PrivateCateRoughdesign.signOverlapIntegrand_sign_mean · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/MixtureOverlap.lean:193
theorem fairNull_lintegral_marks Lemma fairNull_lintegral_marks in the paper ↗

The fair observed null integrates four equally weighted mark cells at each covariate. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
f :
O → ℝ≥0∞
hf :
(∫⁻ z, f z ∂Pobs fairNull)
= ∫⁻ x : Covariate, ∑ av : Bool, ∑ yv : Bool, (1 / 4 : ℝ≥0∞)*f (x,av,yv)
Proof (Lean source)
-- @node: fairNull_lintegral_marks lemma fairNull_lintegral_marks (f : O → ℝ≥0∞) (hf : Measurable f) : (∫⁻ z, f z ∂Pobs fairNull) = ∫⁻ x : Covariate, ∑ av : Bool, ∑ yv : Bool, (1 / 4 : ℝ≥0∞)*f (x,av,yv) := by have hm : Measurable observe := by unfold observe X A Y; fun_prop change (∫⁻ z, f z ∂(binaryLaw (fun _ => 1/2) (fun _ => 1/2) (fun _ => 1/2)).map observe) = _ rw [lintegral_map hf hm, binaryLaw_lintegral (fun _ => 1/2) (fun _ => 1/2) (fun _ => 1/2) measurable_const measurable_const measurable_const (fun z => f (observe z)) (hf.comp hm)] apply lintegral_congr intro x simp only [Fintype.sum_prod_type, Fintype.sum_bool, Function.comp_apply, observe, X, A, Y, bernoulliMass, Bool.false_eq_true, if_false, if_true] norm_num [ENNReal.ofReal_div_of_pos] have hc : (8 : ℝ≥0∞)⁻¹ * 2 = 4⁻¹ := by rw [show (8 : ℝ≥0∞) = 4*2 by norm_num, ENNReal.mul_inv, mul_assoc, ENNReal.inv_mul_cancel (by norm_num) (by norm_num), mul_one] <;> norm_num ring_nf simp only [mul_right_comm _ _ (2 : ℝ≥0∞), hc] ring
CausalSmith.Stat.PrivateCateRoughdesign.fairNull_lintegral_marks · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/MixtureOverlap.lean:200
theorem measurable_conditionalLikelihood_record Lemma measurable_conditionalLikelihood_record in the paper ↗

The actual conditional likelihood is measurable on the full observed record space. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
lam :
Measurable (fun z : O => conditionalLikelihood hL lam z.1 z.2.1 z.2.2)
Proof (Lean source)
-- @node: measurable_conditionalLikelihood_record @[fun_prop] lemma measurable_conditionalLikelihood_record (hL : ℝ) (lam : SignVector hL) : Measurable (fun z : O => conditionalLikelihood hL lam z.1 z.2.1 z.2.2) := by have ha : MeasurableSet {z : O | z.2.1 = true} := measurableSet_eq_fun (by fun_prop) measurable_const have hy : MeasurableSet {z : O | z.2.2 = true} := measurableSet_eq_fun (by fun_prop) measurable_const have he : Measurable (fun z : O => altE hL lam z.1) := by fun_prop have h0 : Measurable (fun z : O => altMu0 hL lam z.1) := by fun_prop have h1 : Measurable (fun z : O => altMu1 hL lam z.1) := by fun_prop classical have hm : Measurable (fun z : O => if z.2.1 then altMu1 hL lam z.1 else altMu0 hL lam z.1) := h1.ite ha h0 exact (measurable_const.mul (he.ite ha (measurable_const.sub he))).mul (hm.ite hy (measurable_const.sub hm))
CausalSmith.Stat.PrivateCateRoughdesign.measurable_conditionalLikelihood_record · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/MixtureOverlap.lean:222
theorem conditionalLikelihood_nonneg Lemma conditionalLikelihood_nonneg in the paper ↗

Every actual conditional mark likelihood is nonnegative for legal macro radii. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
lam :
x :
av yv :
0 ≤ conditionalLikelihood hL lam x av yv
Proof (Lean source)
-- @node: conditionalLikelihood_nonneg lemma conditionalLikelihood_nonneg (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (lam : SignVector hL) (x : Covariate) (av yv : Bool) : 0 ≤ conditionalLikelihood hL lam x av yv := by unfold conditionalLikelihood apply mul_nonneg (mul_nonneg (by norm_num) (bernoulliMass_nonneg (alt_parameters_range hL hhL lam x).1 av)) cases av · exact bernoulliMass_nonneg (alt_parameters_range hL hhL lam x).2.1 yv · exact bernoulliMass_nonneg (alt_parameters_range hL hhL lam x).2.2 yv
CausalSmith.Stat.PrivateCateRoughdesign.conditionalLikelihood_nonneg · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/MixtureOverlap.lean:238
theorem cosineFamily_observed_withDensity

The conditional four-cell likelihood is the actual observed density relative to the fair null. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
lam :
Pobs (cosineFamily hL hhL lam)
= (Pobs fairNull).withDensity (fun z => ofReal (conditionalLikelihood hL lam z.1 z.2.1 z.2.2))
Proof (Lean source)
-- @node: cosineFamily_observed_withDensity lemma cosineFamily_observed_withDensity (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (lam : SignVector hL) : Pobs (cosineFamily hL hhL lam) = (Pobs fairNull).withDensity (fun z => ofReal (conditionalLikelihood hL lam z.1 z.2.1 z.2.2)) := by classical ext s hs rw [cosineFamily, binaryCausalLaw_observed_apply _ _ _ (measurable_altE hL lam) (measurable_altMu0 hL lam) (measurable_altMu1 hL lam) (alt_parameters_range hL hhL lam) s hs, withDensity_apply _ hs, ← lintegral_indicator hs] rw [fairNull_lintegral_marks _ (((measurable_conditionalLikelihood_record hL lam).ennreal_ofReal).indicator hs)] apply lintegral_congr intro x rw [Fintype.sum_prod_type] apply Finset.sum_congr rfl intro av hav apply Finset.sum_congr rfl intro yv hyv by_cases hx : (x,av,yv) ∈ s · simp only [Set.indicator_of_mem hx, Pi.one_apply, mul_one] rw [conditionalLikelihood, mul_assoc, ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 4)] rw [ENNReal.ofReal_ofNat, ← mul_assoc] norm_num rw [ENNReal.inv_mul_cancel (by norm_num) (by norm_num), one_mul] · simp [Set.indicator_of_notMem hx]
CausalSmith.Stat.PrivateCateRoughdesign.cosineFamily_observed_withDensity · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/MixtureOverlap.lean:250
theorem cosineFamily_rnDeriv_toReal_likelihood

The real observed density is the stated likelihood almost everywhere under the null. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
lam :
(fun z => ((Pobs (cosineFamily hL hhL lam)).rnDeriv (Pobs fairNull) z).toReal)
=ᵐ[Pobs fairNull] (fun z => conditionalLikelihood hL lam z.1 z.2.1 z.2.2)
Proof (Lean source)
-- @node: cosineFamily_rnDeriv_toReal_likelihood lemma cosineFamily_rnDeriv_toReal_likelihood (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (lam : SignVector hL) : (fun z => ((Pobs (cosineFamily hL hhL lam)).rnDeriv (Pobs fairNull) z).toReal) =ᵐ[Pobs fairNull] (fun z => conditionalLikelihood hL lam z.1 z.2.1 z.2.2) := by letI := observed_probability fairNull rw [cosineFamily_observed_withDensity] filter_upwards [Measure.rnDeriv_withDensity (Pobs fairNull) (measurable_conditionalLikelihood_record hL lam).ennreal_ofReal] with z hz rw [hz, ENNReal.toReal_ofReal (conditionalLikelihood_nonneg hL hhL lam z.1 z.2.1 z.2.2)]
CausalSmith.Stat.PrivateCateRoughdesign.cosineFamily_rnDeriv_toReal_likelihood · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/MixtureOverlap.lean:279
theorem fairNull_integral_marks Lemma fairNull_integral_marks in the paper ↗

Nonnegative real functions under the fair null integrate their four-cell average. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
f :
O → ℝ
hf :
hf0 :
∀ z, 0 ≤ f z
(∫ z, f z ∂Pobs fairNull) = ∫ x : Covariate, (∑ av : Bool, ∑ yv : Bool, f (x,av,yv)) / 4
Proof (Lean source)
-- @node: fairNull_integral_marks lemma fairNull_integral_marks (f : O → ℝ) (hf : Measurable f) (hf0 : ∀ z, 0 ≤ f z) : (∫ z, f z ∂Pobs fairNull) = ∫ x : Covariate, (∑ av : Bool, ∑ yv : Bool, f (x,av,yv)) / 4 := by have hm : Measurable (fun x : Covariate => (∑ av : Bool, ∑ yv : Bool, f (x,av,yv)) / 4) := by apply Measurable.div_const apply Finset.measurable_fun_sum intro av hav apply Finset.measurable_fun_sum intro yv hyv exact hf.comp (by fun_prop) rw [integral_eq_lintegral_of_nonneg_ae (ae_of_all _ hf0) hf.aestronglyMeasurable, fairNull_lintegral_marks _ hf.ennreal_ofReal] rw [integral_eq_lintegral_of_nonneg_ae (ae_of_all _ (fun x => div_nonneg (Finset.sum_nonneg (fun av _ => Finset.sum_nonneg (fun yv _ => hf0 (x,av,yv)))) (by norm_num))) hm.aestronglyMeasurable] congr 1 apply lintegral_congr intro x rw [ENNReal.ofReal_div_of_pos (by norm_num : (0 : ℝ) < 4), ENNReal.ofReal_ofNat] rw [ENNReal.ofReal_sum_of_nonneg (fun av _ => Finset.sum_nonneg (fun yv _ => hf0 (x,av,yv)))] simp_rw [ENNReal.ofReal_sum_of_nonneg (fun yv _ => hf0 (x,_,yv))] simp only [div_eq_mul_inv, Finset.sum_mul, one_mul, mul_comm] simp only [Finset.mul_sum]
CausalSmith.Stat.PrivateCateRoughdesign.fairNull_integral_marks · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/MixtureOverlap.lean:291
theorem conditionalLikelihood_le_four Lemma conditionalLikelihood_le_four in the paper ↗

Each actual conditional likelihood is at most four, since a Bernoulli cell mass is a product of two probabilities at most one. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
lam :
x :
av yv :
conditionalLikelihood hL lam x av yv ≤ 4
Proof (Lean source)
-- @node: conditionalLikelihood_le_four lemma conditionalLikelihood_le_four (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (lam : SignVector hL) (x : Covariate) (av yv : Bool) : conditionalLikelihood hL lam x av yv ≤ 4 := by have hb (p : ℝ) (hp : p ∈ Icc 0 1) (b : Bool) : bernoulliMass p b ≤ 1 := by cases b <;> simp only [bernoulliMass, Bool.false_eq_true, if_false, if_true] <;> linarith [hp.1, hp.2] have hm : (if av then altMu1 hL lam x else altMu0 hL lam x) ∈ Icc 0 1 := by cases av · exact (alt_parameters_range hL hhL lam x).2.1 · exact (alt_parameters_range hL hhL lam x).2.2 have hprod := mul_le_one₀ (hb _ (alt_parameters_range hL hhL lam x).1 av) (bernoulliMass_nonneg hm yv) (hb _ hm yv) unfold conditionalLikelihood rw [mul_assoc] linarith
CausalSmith.Stat.PrivateCateRoughdesign.conditionalLikelihood_le_four · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/MixtureOverlap.lean:319
theorem signOverlapIntegrand_range

The centered Fourier overlap integrand lies between minus one and fifteen. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
lam lam' :
x :
signOverlapIntegrand hL lam lam' x ∈ Icc (-1) 15
Proof (Lean source)
-- @node: signOverlapIntegrand_range lemma signOverlapIntegrand_range (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (lam lam' : SignVector hL) (x : Covariate) : signOverlapIntegrand hL lam lam' x ∈ Icc (-1) 15 := by have hp (av yv : Bool) : 0 ≤ conditionalLikelihood hL lam x av yv * conditionalLikelihood hL lam' x av yv ∧ conditionalLikelihood hL lam x av yv * conditionalLikelihood hL lam' x av yv ≤ 16 := by exact ⟨mul_nonneg (conditionalLikelihood_nonneg hL hhL lam x av yv) (conditionalLikelihood_nonneg hL hhL lam' x av yv), (mul_le_mul (conditionalLikelihood_le_four hL hhL lam x av yv) (conditionalLikelihood_le_four hL hhL lam' x av yv) (conditionalLikelihood_nonneg hL hhL lam' x av yv) (by norm_num)).trans (by norm_num)⟩ have hl := Finset.sum_nonneg (s := univ) (fun av _ => Finset.sum_nonneg (s := univ) (fun yv _ => (hp av yv).1)) have hu := Finset.sum_le_sum (s := univ) (fun av _ => Finset.sum_le_sum (s := univ) (fun yv _ => (hp av yv).2)) simp only [Finset.sum_const, Finset.card_univ, Fintype.card_bool, nsmul_eq_mul] at hu have hu' : (∑ av : Bool, ∑ yv : Bool, conditionalLikelihood hL lam x av yv * conditionalLikelihood hL lam' x av yv) ≤ 64 := hu.trans (by norm_num) have he := conditionalLikelihood_pair_inner_product hL hhL lam lam' x constructor <;> linarith [hu']
CausalSmith.Stat.PrivateCateRoughdesign.signOverlapIntegrand_range · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/MixtureOverlap.lean:338
theorem integrable_signOverlapIntegrand

The covariate overlap integral is integrable by its measurable bounded construction. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
lam lam' :
Proof (Lean source)
-- @node: integrable_signOverlapIntegrand @[fun_prop] lemma integrable_signOverlapIntegrand (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (lam lam' : SignVector hL) : Integrable (signOverlapIntegrand hL lam lam') := by exact Integrable.of_mem_Icc (-1) 15 (by fun_prop) (ae_of_all _ (signOverlapIntegrand_range hL hhL lam lam'))
CausalSmith.Stat.PrivateCateRoughdesign.integrable_signOverlapIntegrand · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/MixtureOverlap.lean:363

The paper's centered likelihood inner product integrates the Fourier overlap terms.

Definition (Lean source)
hL :
ℝ
lam lam' :
signOverlap hL lam lam' :
ℝ
∫ x : Covariate, signOverlapIntegrand hL lam lam' x
theorem signDensityOverlap_eq_one_add_signOverlap

The observed density overlap equals one plus the explicit Fourier covariate integral. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
lam lam' :
signDensityOverlap hL hhL lam lam' = 1 + signOverlap hL lam lam'
Proof (Lean source)
-- @node: signDensityOverlap_eq_one_add_signOverlap lemma signDensityOverlap_eq_one_add_signOverlap (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (lam lam' : SignVector hL) : signDensityOverlap hL hhL lam lam' = 1 + signOverlap hL lam lam' := by unfold signDensityOverlap have he : (fun z => ((Pobs (cosineFamily hL hhL lam)).rnDeriv (Pobs fairNull) z).toReal * ((Pobs (cosineFamily hL hhL lam')).rnDeriv (Pobs fairNull) z).toReal) =ᵐ[Pobs fairNull] (fun z => conditionalLikelihood hL lam z.1 z.2.1 z.2.2 * conditionalLikelihood hL lam' z.1 z.2.1 z.2.2) := by filter_upwards [cosineFamily_rnDeriv_toReal_likelihood hL hhL lam, cosineFamily_rnDeriv_toReal_likelihood hL hhL lam'] with z hz hz' rw [hz, hz'] rw [integral_congr_ae he] rw [fairNull_integral_marks _ (by fun_prop) (fun z => mul_nonneg (conditionalLikelihood_nonneg hL hhL lam z.1 z.2.1 z.2.2) (conditionalLikelihood_nonneg hL hhL lam' z.1 z.2.1 z.2.2))] simp_rw [conditionalLikelihood_pair_inner_product hL hhL] rw [integral_add (integrable_const 1) (integrable_signOverlapIntegrand hL hhL lam lam')] simp [signOverlap]
CausalSmith.Stat.PrivateCateRoughdesign.signDensityOverlap_eq_one_add_signOverlap · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/MixtureOverlap.lean:375
theorem signOverlap_sign_sum

Finite averaging commutes with the bounded covariate integrals; the centered overlap has sum zero in its first sign vector for every fixed second vector. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
lam' :
(∑ lam : SignVector hL, signOverlap hL lam lam') = 0
Proof (Lean source)
-- @node: signOverlap_sign_sum lemma signOverlap_sign_sum (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (lam' : SignVector hL) : (∑ lam : SignVector hL, signOverlap hL lam lam') = 0 := by classical unfold signOverlap rw [← integral_finsetSum _ (fun lam _ => integrable_signOverlapIntegrand hL hhL lam lam')] simp_rw [signOverlapIntegrand_sign_sum hL hhL lam'] simp
CausalSmith.Stat.PrivateCateRoughdesign.signOverlap_sign_sum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/MixtureOverlap.lean:397
theorem signOverlap_sign_mean

The centered likelihood overlap has expectation zero under the actual sign law. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
lam' :
(∫ lam, signOverlap hL lam lam' ∂signLaw hL) = 0
Proof (Lean source)
-- @node: signOverlap_sign_mean lemma signOverlap_sign_mean (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (lam' : SignVector hL) : (∫ lam, signOverlap hL lam lam' ∂signLaw hL) = 0 := by rw [integral_signLaw, signOverlap_sign_sum hL hhL, mul_zero]
CausalSmith.Stat.PrivateCateRoughdesign.signOverlap_sign_mean · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/MixtureOverlap.lean:408
theorem signMixture_chiSq_fourier_identity

The exact fixed-sample chi-square identity uses the paper's centered Fourier overlap. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
= (∑ lam : SignVector hL, ∑ lam' : SignVector hL, (1 + signOverlap hL lam lam')^n) / (card (SignVector hL) : ℝ)^2
Proof (Lean source)
-- @node: signMixture_chiSq_fourier_identity lemma signMixture_chiSq_fourier_identity (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) : 1 + chiSqDiv (signMixture hL hhL n) (dataLaw n fairNull) = (∑ lam : SignVector hL, ∑ lam' : SignVector hL, (1 + signOverlap hL lam lam')^n) / (card (SignVector hL) : ℝ)^2 := by rw [signMixture_chiSq_overlap_identity] simp_rw [signDensityOverlap_eq_one_add_signOverlap hL hhL]
CausalSmith.Stat.PrivateCateRoughdesign.signMixture_chiSq_fourier_identity · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/MixtureOverlap.lean:414
theorem signMixture_chiSq_le_fourier_exp_average

The dataset divergence is bounded by the uniform exponential average of the explicit centered Fourier overlap; only the bounded-differences estimate remains to be assembled. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
≤ (∑ lam : SignVector hL, ∑ lam' : SignVector hL, exp ((n : ℝ)*signOverlap hL lam lam')) / (card (SignVector hL) : ℝ)^2
Proof (Lean source)
-- @node: signMixture_chiSq_le_fourier_exp_average lemma signMixture_chiSq_le_fourier_exp_average (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) : 1 + chiSqDiv (signMixture hL hhL n) (dataLaw n fairNull) ≤ (∑ lam : SignVector hL, ∑ lam' : SignVector hL, exp ((n : ℝ)*signOverlap hL lam lam')) / (card (SignVector hL) : ℝ)^2 := by have hb := signMixture_chiSq_le_exp_average hL hhL n simpa only [signDensityOverlap_eq_one_add_signOverlap hL hhL, add_sub_cancel_left] using hb
CausalSmith.Stat.PrivateCateRoughdesign.signMixture_chiSq_le_fourier_exp_average · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/MixtureOverlap.lean:425
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.Occupancy 27 declarations Occupancy cancellation and design-uniform population bias and denominator bounds.

Occupancy cancellation and design-uniform population bias and denominator bounds.

theorem design_mass_bounds

Density bounds compare every design-event mass with its Lebesgue mass. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
conclusion 1
volume.real s / 2 ≤ (PX P).real s
conclusion 2
(PX P).real s ≤ 3 * volume.real s / 2
Proof (Lean source)
-- @node: design_mass_bounds lemma design_mass_bounds (P : CausalLaw) (hP : CompleteModel P) (s : Set Covariate) : volume.real s / 2 ≤ (PX P).real s ∧ (PX P).real s ≤ 3 * volume.real s / 2 := by let : IsProbabilityMeasure (PX P) := Measure.isProbabilityMeasure_map measurable_X.aemeasurable have hlo : (ofReal (1 / 2 : ℝ)) • (volume : Measure Covariate) ≤ PX P := by rw [PX, P.density_version hP.density.1, ← withDensity_const] apply withDensity_mono filter_upwards [hP.density.2] with x hx exact ENNReal.ofReal_le_ofReal hx.1 have hhi : PX P ≤ (ofReal (3 / 2 : ℝ)) • (volume : Measure Covariate) := by rw [PX, P.density_version hP.density.1, ← withDensity_const] apply withDensity_mono filter_upwards [hP.density.2] with x hx exact ENNReal.ofReal_le_ofReal hx.2 have hl := ENNReal.toReal_mono (measure_ne_top (PX P) s) (hlo s) have hu := ENNReal.toReal_mono (show ((ofReal (3 / 2 : ℝ)) • (volume : Measure Covariate)) s ≠ ∞ by simp only [Measure.smul_apply, smul_eq_mul] exact ENNReal.mul_ne_top ENNReal.ofReal_ne_top (measure_ne_top volume s)) (hhi s) simp only [Measure.smul_apply, smul_eq_mul, ENNReal.toReal_mul, ENNReal.toReal_ofReal (by norm_num : (0 : ℝ) ≤ 1 / 2), ENNReal.toReal_ofReal (by norm_num : (0 : ℝ) ≤ 3 / 2), ← measureReal_def] at hl hu constructor <;> linarith
CausalSmith.Stat.PrivateCateRoughdesign.design_mass_bounds · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Occupancy.lean:9

Each cell's endpoints lie in the unit interval and differ by the public width. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
k :
ℕ
h :
ℝ
hk :
0 < k
hh :
0 < h ∧ h ≤ 1 / 4
j :
Fin k
conclusion 1
0 ≤ (x0 : ℝ) - h + j.val * cellWidth h k
conclusion 2
(x0 : ℝ) - h + (j.val + 1) * cellWidth h k ≤ 1
conclusion 3
(x0 : ℝ) - h + (j.val + 1) * cellWidth h k ≤ (x0 : ℝ) + h
conclusion 4
0 < cellWidth h k
Proof (Lean source)
-- @node: cell_endpoint_bounds lemma cell_endpoint_bounds (k : ℕ) (h : ℝ) (hk : 0 < k) (hh : 0 < h ∧ h ≤ 1 / 4) (j : Fin k) : 0 ≤ (x0 : ℝ) - h + j.val * cellWidth h k ∧ (x0 : ℝ) - h + (j.val + 1) * cellWidth h k ≤ 1 ∧ (x0 : ℝ) - h + (j.val + 1) * cellWidth h k ≤ (x0 : ℝ) + h ∧ 0 < cellWidth h k := by have hkR : (0 : ℝ) < k := by exact_mod_cast hk have hh0 := hh.1 have hd : 0 < cellWidth h k := by unfold cellWidth; positivity have hwidth : (k : ℝ) * cellWidth h k = 2 * h := by unfold cellWidth field_simp have hj : (j.val : ℝ) + 1 ≤ k := by exact_mod_cast j.isLt have hju := mul_le_mul_of_nonneg_right hj hd.le have hjl := mul_nonneg (Nat.cast_nonneg j.val) hd.le simp only [x0] at * refine ⟨?_, ?_, ?_, hd⟩ <;> linarith
CausalSmith.Stat.PrivateCateRoughdesign.cell_endpoint_bounds · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Occupancy.lean:35

Including the final right endpoint does not change the Lebesgue mass of a cell. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
k :
ℕ
h :
ℝ
hk :
0 < k
hh :
0 < h ∧ h ≤ 1 / 4
j :
Fin k
volume.real (cell h k j) = cellWidth h k
Proof (Lean source)
-- @node: cell_volume lemma cell_volume (k : ℕ) (h : ℝ) (hk : 0 < k) (hh : 0 < h ∧ h ≤ 1 / 4) (j : Fin k) : volume.real (cell h k j) = cellWidth h k := by obtain ⟨hl, hu, hwindow, hd⟩ := cell_endpoint_bounds k h hk hh j let a : Covariate := ⟨(x0 : ℝ) - h + j.val * cellWidth h k, hl, by nlinarith⟩ let b : Covariate := ⟨(x0 : ℝ) - h + (j.val + 1) * cellWidth h k, by nlinarith, hu⟩ have hab : (b : ℝ) - (a : ℝ) = cellWidth h k := by dsimp [a, b]; ring have hsub : Ico a b ⊆ cell h k j := by intro x hx exact ⟨hx.1, Or.inl hx.2⟩ have hsup : cell h k j ⊆ Icc a b := by intro x hx refine ⟨hx.1, ?_⟩ rcases hx.2 with hx | ⟨hj, hx⟩ · exact hx.le · change (x : ℝ) ≤ (x0 : ℝ) - h + (j.val + 1) * cellWidth h k have he : ((j.val + 1 : ℕ) : ℝ) = k := by exact_mod_cast hj have hw : (k : ℝ) * cellWidth h k = 2 * h := by unfold cellWidth have : (k : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hk) field_simp rw [Nat.cast_add, Nat.cast_one] at he rw [hx, he, hw] linarith have hlo := measure_mono (μ := (volume : Measure Covariate)) hsub have hhi := measure_mono (μ := (volume : Measure Covariate)) hsup rw [unitInterval.volume_Ico, hab] at hlo rw [unitInterval.volume_Icc, hab] at hhi have heq := le_antisymm hhi hlo rw [measureReal_def, heq, ENNReal.toReal_ofReal hd.le]
theorem cellMass_density_bounds

The complete model supplies both cellwise mass estimates without design smoothness. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
k :
ℕ
h :
ℝ
hk :
0 < k
hh :
0 < h ∧ h ≤ 1 / 4
P :
hP :
j :
Fin k
conclusion 1
cellWidth h k / 2 ≤ cellMass h k P j
conclusion 2
cellMass h k P j ≤ 3 * cellWidth h k / 2
Proof (Lean source)
-- @node: cellMass_density_bounds lemma cellMass_density_bounds (k : ℕ) (h : ℝ) (hk : 0 < k) (hh : 0 < h ∧ h ≤ 1 / 4) (P : CausalLaw) (hP : CompleteModel P) (j : Fin k) : cellWidth h k / 2 ≤ cellMass h k P j ∧ cellMass h k P j ≤ 3 * cellWidth h k / 2 := by have hb := design_mass_bounds P hP (cell h k j) rw [cell_volume k h hk hh j] at hb exact hb
CausalSmith.Stat.PrivateCateRoughdesign.cellMass_density_bounds · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Occupancy.lean:90
theorem local_cellMass_sum_bounds

Summing equal-cell mass bounds gives the local-window mass bounds. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
k :
ℕ
h :
ℝ
hk :
0 < k
hh :
0 < h ∧ h ≤ 1 / 4
P :
hP :
conclusion 1
h ≤ ∑ j : Fin k, cellMass h k P j
conclusion 2
(∑ j : Fin k, cellMass h k P j) ≤ 3 * h
Proof (Lean source)
-- @node: local_cellMass_sum_bounds lemma local_cellMass_sum_bounds (k : ℕ) (h : ℝ) (hk : 0 < k) (hh : 0 < h ∧ h ≤ 1 / 4) (P : CausalLaw) (hP : CompleteModel P) : h ≤ ∑ j : Fin k, cellMass h k P j ∧ (∑ j : Fin k, cellMass h k P j) ≤ 3 * h := by have hl := Finset.sum_le_sum (s := univ) (fun (j : Fin k) _ => (cellMass_density_bounds k h hk hh P hP j).1) have hu := Finset.sum_le_sum (s := univ) (fun (j : Fin k) _ => (cellMass_density_bounds k h hk hh P hP j).2) have hw : (k : ℝ) * cellWidth h k = 2 * h := by unfold cellWidth have : (k : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hk) field_simp simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] at hl hu constructor <;> nlinarith
CausalSmith.Stat.PrivateCateRoughdesign.local_cellMass_sum_bounds · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Occupancy.lean:100
theorem cellMass_bounds

Every population cell mass lies between zero and one. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
h :
ℝ
k :
ℕ
P :
j :
Fin k
conclusion 1
0 ≤ cellMass h k P j
conclusion 2
cellMass h k P j ≤ 1
Proof (Lean source)
-- @node: cellMass_bounds lemma cellMass_bounds (h : ℝ) (k : ℕ) (P : CausalLaw) (j : Fin k) : 0 ≤ cellMass h k P j ∧ cellMass h k P j ≤ 1 := by let : IsProbabilityMeasure (PX P) := Measure.isProbabilityMeasure_map measurable_X.aemeasurable exact ⟨measureReal_nonneg, measureReal_le_one⟩
theorem occupancy_no_partner_exp Lemma occupancy_no_partner_exp in the paper ↗

The probability of no partner has the usual exponential envelope. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
p :
ℝ
m :
ℕ
hp :
p ≤ 1
(1 - p) ^ m ≤ exp (-(m : ℝ) * p)
Proof (Lean source)
-- @node: occupancy_no_partner_exp lemma occupancy_no_partner_exp (p : ℝ) (m : ℕ) (hp : p ≤ 1) : (1 - p) ^ m ≤ exp (-(m : ℝ) * p) := by calc _ ≤ (exp (-p)) ^ m := pow_le_pow_left₀ (sub_nonneg.mpr hp) (Real.one_sub_le_exp_neg p) m _ = _ := by rw [← Real.exp_nat_mul]; congr 1; ring
CausalSmith.Stat.PrivateCateRoughdesign.occupancy_no_partner_exp · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Occupancy.lean:124
theorem occupancy_partner_union_bound Lemma occupancy_partner_union_bound in the paper ↗

The union bound controls the probability that a cell has a partner. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
p :
ℝ
m :
ℕ
hp :
0 ≤ p ∧ p ≤ 1
1 - (1 - p) ^ m ≤ min 1 ((m : ℝ) * p)
Proof (Lean source)
-- @node: occupancy_partner_union_bound lemma occupancy_partner_union_bound (p : ℝ) (m : ℕ) (hp : 0 ≤ p ∧ p ≤ 1) : 1 - (1 - p) ^ m ≤ min 1 ((m : ℝ) * p) := by apply le_min · have := pow_nonneg (sub_nonneg.mpr hp.2) m linarith · have hb := one_add_mul_le_pow (a := -p) (by linarith [hp.2]) m have heq : 1 + -p = 1 - p := by ring rw [heq] at hb linarith
CausalSmith.Stat.PrivateCateRoughdesign.occupancy_partner_union_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Occupancy.lean:133
theorem occupancy_exp_rational_lower Lemma occupancy_exp_rational_lower in the paper ↗

The exponential partner probability dominates a rational envelope. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
x :
ℝ
hx :
0 ≤ x
x / (1 + x) ≤ 1 - exp (-x)
Proof (Lean source)
-- @node: occupancy_exp_rational_lower lemma occupancy_exp_rational_lower (x : ℝ) (hx : 0 ≤ x) : x / (1 + x) ≤ 1 - exp (-x) := by have hpos : 0 < 1 + x := by linarith have hE : 1 + x ≤ exp x := by linarith [Real.add_one_le_exp x] have hi : exp (-x) ≤ (1 + x)⁻¹ := by rw [Real.exp_neg] exact (inv_le_inv₀ (Real.exp_pos x) hpos).mpr hE have hid : x / (1 + x) = 1 - (1 + x)⁻¹ := by field_simp <;> ring rw [hid] linarith
CausalSmith.Stat.PrivateCateRoughdesign.occupancy_exp_rational_lower · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Occupancy.lean:145
theorem occupancy_rational_truncation Lemma occupancy_rational_truncation in the paper ↗

The rational envelope controls both sparse and dense occupancies uniformly. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
x :
ℝ
hx :
0 ≤ x
min 1 x / 8 ≤ x / (4 + x)
Proof (Lean source)
-- @node: occupancy_rational_truncation lemma occupancy_rational_truncation (x : ℝ) (hx : 0 ≤ x) : min 1 x / 8 ≤ x / (4 + x) := by have hd : 0 < 4 + x := by linarith rw [le_div_iff₀ hd] by_cases hsmall : x ≤ 1 · rw [min_eq_right hsmall] nlinarith [mul_nonneg hx (sub_nonneg.mpr hsmall)] · rw [min_eq_left (le_of_not_ge hsmall)] linarith
CausalSmith.Stat.PrivateCateRoughdesign.occupancy_rational_truncation · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Occupancy.lean:160
theorem occupancy_partner_lower Lemma occupancy_partner_lower in the paper ↗

The lower cell-mass bound gives a uniform partner-probability lower bound. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
delta p :
ℝ
hn :
2 ≤ n
hd :
0 ≤ delta
hp :
delta / 2 ≤ p
hp1 :
p ≤ 1
min 1 ((n : ℝ) * delta) / 8 ≤ 1 - (1 - p) ^ (n - 1)
Proof (Lean source)
-- @node: occupancy_partner_lower lemma occupancy_partner_lower (n : ℕ) (delta p : ℝ) (hn : 2 ≤ n) (hd : 0 ≤ delta) (hp : delta / 2 ≤ p) (hp1 : p ≤ 1) : min 1 ((n : ℝ) * delta) / 8 ≤ 1 - (1 - p) ^ (n - 1) := by have hn0 : 0 ≤ (n : ℝ) := Nat.cast_nonneg n have hn2 : (2 : ℝ) ≤ n := by exact_mod_cast hn have hm : ((n - 1 : ℕ) : ℝ) = (n : ℝ) - 1 := by rw [Nat.cast_sub (by omega), Nat.cast_one] have hp0 : 0 ≤ p := by linarith have hprod : (n : ℝ) * delta / 4 ≤ ((n - 1 : ℕ) : ℝ) * p := by rw [hm] nlinarith [mul_nonneg (show 0 ≤ (n : ℝ) / 2 by positivity) (show 0 ≤ p - delta / 2 by linarith), mul_nonneg (show 0 ≤ (n : ℝ) - 1 - (n : ℝ) / 2 by linarith) hp0] have hpow : (1 - p) ^ (n - 1) ≤ exp (-((n : ℝ) * delta / 4)) := (occupancy_no_partner_exp p (n - 1) hp1).trans (Real.exp_le_exp.mpr (by linarith)) calc _ ≤ ((n : ℝ) * delta) / (4 + (n : ℝ) * delta) := occupancy_rational_truncation _ (mul_nonneg hn0 hd) _ = ((n : ℝ) * delta / 4) / (1 + (n : ℝ) * delta / 4) := by have : 4 + (n : ℝ) * delta ≠ 0 := by positivity field_simp <;> ring _ ≤ 1 - exp (-((n : ℝ) * delta / 4)) := occupancy_exp_rational_lower _ (by positivity) _ ≤ _ := by linarith
CausalSmith.Stat.PrivateCateRoughdesign.occupancy_partner_lower · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Occupancy.lean:172
theorem occupancy_partner_upper Lemma occupancy_partner_upper in the paper ↗

The upper cell-mass bound gives a uniform partner-probability upper bound. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
delta p :
ℝ
hd :
0 ≤ delta
hp :
0 ≤ p ∧ p ≤ 1
hpu :
p ≤ 3 * delta / 2
1 - (1 - p) ^ (n - 1) ≤ (3 / 2) * min 1 ((n : ℝ) * delta)
Proof (Lean source)
-- @node: occupancy_partner_upper lemma occupancy_partner_upper (n : ℕ) (delta p : ℝ) (hd : 0 ≤ delta) (hp : 0 ≤ p ∧ p ≤ 1) (hpu : p ≤ 3 * delta / 2) : 1 - (1 - p) ^ (n - 1) ≤ (3 / 2) * min 1 ((n : ℝ) * delta) := by have hb := occupancy_partner_union_bound p (n - 1) hp have hm : ((n - 1 : ℕ) : ℝ) ≤ n := by exact_mod_cast sub_le n 1 have hn0 : 0 ≤ (n : ℝ) := Nat.cast_nonneg n have hmp : ((n - 1 : ℕ) : ℝ) * p ≤ (3 / 2) * ((n : ℝ) * delta) := by nlinarith [mul_nonneg (show 0 ≤ (n : ℝ) - ((n - 1 : ℕ) : ℝ) by linarith) hp.1, mul_nonneg hn0 (show 0 ≤ 3 * delta / 2 - p by linarith)] by_cases hs : (n : ℝ) * delta ≤ 1 · rw [min_eq_right hs] exact (hb.trans (min_le_right _ _)).trans hmp · rw [min_eq_left (le_of_not_ge hs)] linarith [hb.trans (min_le_left _ _)]
CausalSmith.Stat.PrivateCateRoughdesign.occupancy_partner_upper · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Occupancy.lean:201
theorem occupancy_comparisons_of_cell_masses

Summing the partner envelopes gives both design-uniform occupancy comparisons. The premises are the cell-mass estimates supplied by the model's density bounds. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
n k :
ℕ
h :
ℝ
P :
hn :
2 ≤ n
hd :
0 ≤ cellWidth h k
hp :
∀ j : Fin k,
cellWidth h k / 2 ≤ cellMass h k P j ∧ cellMass h k P j ≤ 3 * cellWidth h k / 2
hs :
h ≤ ∑ j : Fin k, cellMass h k P j ∧ (∑ j : Fin k, cellMass h k P j) ≤ 3 * h
conclusion 1
info n h k / 8 ≤ Wocc n h k P
conclusion 2
Wocc n h k P ≤ 9 * info n h k / 2
Proof (Lean source)
-- @node: occupancy_comparisons_of_cell_masses lemma occupancy_comparisons_of_cell_masses (n k : ℕ) (h : ℝ) (P : CausalLaw) (hn : 2 ≤ n) (hd : 0 ≤ cellWidth h k) (hp : ∀ j : Fin k, cellWidth h k / 2 ≤ cellMass h k P j ∧ cellMass h k P j ≤ 3 * cellWidth h k / 2) (hs : h ≤ ∑ j : Fin k, cellMass h k P j ∧ (∑ j : Fin k, cellMass h k P j) ≤ 3 * h) : info n h k / 8 ≤ Wocc n h k P ∧ Wocc n h k P ≤ 9 * info n h k / 2 := by have hn0 : 0 ≤ (n : ℝ) := Nat.cast_nonneg n have ht : 0 ≤ min 1 ((n : ℝ) * cellWidth h k) := le_min (by norm_num) (mul_nonneg hn0 hd) have hsumlo : (∑ j : Fin k, (n : ℝ) * cellMass h k P j * (min 1 ((n : ℝ) * cellWidth h k) / 8)) ≤ Wocc n h k P := by apply Finset.sum_le_sum intro j hj exact mul_le_mul_of_nonneg_left (occupancy_partner_lower n _ _ hn hd (hp j).1 (cellMass_bounds h k P j).2) (mul_nonneg hn0 (cellMass_bounds h k P j).1) have hsumhi : Wocc n h k P ≤ ∑ j : Fin k, (n : ℝ) * cellMass h k P j * ((3 / 2) * min 1 ((n : ℝ) * cellWidth h k)) := by apply Finset.sum_le_sum intro j hj exact mul_le_mul_of_nonneg_left (occupancy_partner_upper n _ _ hd (cellMass_bounds h k P j) (hp j).2) (mul_nonneg hn0 (cellMass_bounds h k P j).1) simp only [← Finset.sum_mul, ← Finset.mul_sum] at hsumlo hsumhi constructor · have hmass := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hs.1 hn0) (show 0 ≤ min 1 ((n : ℝ) * cellWidth h k) / 8 by positivity) unfold info nlinarith · have hmass := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hs.2 hn0) (show 0 ≤ (3 / 2 : ℝ) * min 1 ((n : ℝ) * cellWidth h k) by positivity) unfold info nlinarith
CausalSmith.Stat.PrivateCateRoughdesign.occupancy_comparisons_of_cell_masses · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Occupancy.lean:218
theorem occupancy_comparisons

The density bounds imply both occupancy comparisons for every law in the complete model. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
hn :
2 ≤ n
hk :
0 < k
hh :
0 < h ∧ h ≤ 1 / 4
P :
hP :
conclusion 1
info n h k / 8 ≤ Wocc n h k P
conclusion 2
Wocc n h k P ≤ 9 * info n h k / 2
Proof (Lean source)
-- @node: occupancy_comparisons lemma occupancy_comparisons (n k : ℕ) (h : ℝ) (hn : 2 ≤ n) (hk : 0 < k) (hh : 0 < h ∧ h ≤ 1 / 4) (P : CausalLaw) (hP : CompleteModel P) : info n h k / 8 ≤ Wocc n h k P ∧ Wocc n h k P ≤ 9 * info n h k / 2 := by exact occupancy_comparisons_of_cell_masses n k h P hn (cell_endpoint_bounds k h hk hh ⟨0, hk⟩).2.2.2.le (cellMass_density_bounds k h hk hh P hP) (local_cellMass_sum_bounds k h hk hh P hP)
CausalSmith.Stat.PrivateCateRoughdesign.occupancy_comparisons · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Occupancy.lean:259
theorem occupancyWeight_nonneg

The common occupancy weights are nonnegative, even without model assumptions. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
P :
j :
Fin k
0 ≤ occupancyWeight n h k P j
Proof (Lean source)
-- @node: occupancyWeight_nonneg lemma occupancyWeight_nonneg (n k : ℕ) (h : ℝ) (P : CausalLaw) (j : Fin k) : 0 ≤ occupancyWeight n h k P j := by obtain ⟨hp0, hp1⟩ := cellMass_bounds h k P j have hpow : (1 - cellMass h k P j) ^ (n - 1) ≤ 1 := pow_le_one₀ (sub_nonneg.mpr hp1) (by linarith) exact mul_nonneg (mul_nonneg (Nat.cast_nonneg n) hp0) (sub_nonneg.mpr hpow)
CausalSmith.Stat.PrivateCateRoughdesign.occupancyWeight_nonneg · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Occupancy.lean:269

The public information and denominator floor are strictly positive on the public domain. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
hn :
0 < n
hk :
0 < k
hh :
0 < h
conclusion 1
0 < info n h k
conclusion 2
0 < d0 n h k
Proof (Lean source)
-- @node: info_d0_pos lemma info_d0_pos (n k : ℕ) (h : ℝ) (hn : 0 < n) (hk : 0 < k) (hh : 0 < h) : 0 < info n h k ∧ 0 < d0 n h k := by have hn' : 0 < (n : ℝ) := Nat.cast_pos.mpr hn have hk' : 0 < (k : ℝ) := Nat.cast_pos.mpr hk have hw : 0 < cellWidth h k := by unfold cellWidth; positivity have hi : 0 < info n h k := by unfold info; positivity exact ⟨hi, by unfold d0; positivity⟩
theorem occupancy_denominator_lower

A common nonnegative weight preserves the cellwise denominator lower bound. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
P :
hd :
∀ j : Fin k, 3 / 8 ≤ dj h k P j
(3 / 8) * Wocc n h k P ≤ ∑ j : Fin k, occupancyWeight n h k P j * dj h k P j
Proof (Lean source)
-- @node: occupancy_denominator_lower lemma occupancy_denominator_lower (n k : ℕ) (h : ℝ) (P : CausalLaw) (hd : ∀ j : Fin k, 3 / 8 ≤ dj h k P j) : (3 / 8) * Wocc n h k P ≤ ∑ j : Fin k, occupancyWeight n h k P j * dj h k P j := by unfold Wocc rw [Finset.mul_sum] apply Finset.sum_le_sum intro j hj calc (3 / 8) * occupancyWeight n h k P j = occupancyWeight n h k P j * (3 / 8) := mul_comm _ _ _ ≤ _ := mul_le_mul_of_nonneg_left (hd j) (occupancyWeight_nonneg n k h P j)
CausalSmith.Stat.PrivateCateRoughdesign.occupancy_denominator_lower · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Occupancy.lean:288
theorem occupancy_weighted_bias

Common nonnegative weights preserve the conditional cell bias certificate. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
P :
hb :
∀ j : Fin k, |nu h k P j - theta P * dj h k P j| ≤ bias h k * dj h k P j
|(∑ j : Fin k, occupancyWeight n h k P j * nu h k P j)
- theta P * (∑ j : Fin k, occupancyWeight n h k P j * dj h k P j)|
≤ bias h k * (∑ j : Fin k, occupancyWeight n h k P j * dj h k P j)
Proof (Lean source)
-- @node: occupancy_weighted_bias lemma occupancy_weighted_bias (n k : ℕ) (h : ℝ) (P : CausalLaw) (hb : ∀ j : Fin k, |nu h k P j - theta P * dj h k P j| ≤ bias h k * dj h k P j) : |(∑ j : Fin k, occupancyWeight n h k P j * nu h k P j) - theta P * (∑ j : Fin k, occupancyWeight n h k P j * dj h k P j)| ≤ bias h k * (∑ j : Fin k, occupancyWeight n h k P j * dj h k P j) := by classical calc _ = |∑ j : Fin k, occupancyWeight n h k P j * (nu h k P j - theta P * dj h k P j)| := by congr 1 simp only [mul_sub, Finset.sum_sub_distrib, Finset.mul_sum] congr 1 apply Finset.sum_congr rfl intro j hj ring _ ≤ ∑ j : Fin k, |occupancyWeight n h k P j * (nu h k P j - theta P * dj h k P j)| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ j : Fin k, occupancyWeight n h k P j * (bias h k * dj h k P j) := by apply Finset.sum_le_sum intro j hj rw [abs_mul, abs_of_nonneg (occupancyWeight_nonneg n k h P j)] exact mul_le_mul_of_nonneg_left (hb j) (occupancyWeight_nonneg n k h P j) _ = _ := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro j hj ring
CausalSmith.Stat.PrivateCateRoughdesign.occupancy_weighted_bias · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Occupancy.lean:302
theorem ratio_bias_of_positive_denominator Lemma ratio_bias_of_positive_denominator in the paper ↗

Dividing a weighted bias certificate by a positive denominator gives the ratio bound. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
N D target b :
ℝ
hD :
0 < D
hb :
|N - target * D| ≤ b * D
|N / D - target| ≤ b
Proof (Lean source)
-- @node: ratio_bias_of_positive_denominator lemma ratio_bias_of_positive_denominator (N D target b : ℝ) (hD : 0 < D) (hb : |N - target * D| ≤ b * D) : |N / D - target| ≤ b := by have heq : N / D - target = (N - target * D) / D := by field_simp rw [heq, abs_div, abs_of_pos hD] exact (div_le_iff₀ hD).mpr hb
CausalSmith.Stat.PrivateCateRoughdesign.ratio_bias_of_positive_denominator · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Occupancy.lean:333
theorem cross_treatment_denominator_bounds Lemma cross_treatment_denominator_bounds in the paper ↗

The independent cross-treatment probability is at least three eighths under overlap. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
e e' :
ℝ
he :
1 / 4 ≤ e ∧ e ≤ 3 / 4
he' :
1 / 4 ≤ e' ∧ e' ≤ 3 / 4
conclusion 1
3 / 8 ≤ e * (1 - e') + e' * (1 - e)
conclusion 2
e * (1 - e') + e' * (1 - e) ≤ 1
Proof (Lean source)
-- @node: cross_treatment_denominator_bounds lemma cross_treatment_denominator_bounds (e e' : ℝ) (he : 1 / 4 ≤ e ∧ e ≤ 3 / 4) (he' : 1 / 4 ≤ e' ∧ e' ≤ 3 / 4) : 3 / 8 ≤ e * (1 - e') + e' * (1 - e) ∧ e * (1 - e') + e' * (1 - e) ≤ 1 := by have h1 := mul_nonneg (sub_nonneg.mpr he.1) (sub_nonneg.mpr he'.2) have h2 := mul_nonneg (sub_nonneg.mpr he.2) (sub_nonneg.mpr he'.1) have h3 := mul_nonneg (show 0 ≤ e by linarith) (show 0 ≤ e' by linarith) have h4 := mul_nonneg (show 0 ≤ 1 - e by linarith) (show 0 ≤ 1 - e' by linarith) constructor <;> nlinarith
CausalSmith.Stat.PrivateCateRoughdesign.cross_treatment_denominator_bounds · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Occupancy.lean:342
theorem cross_treatment_bias_bound Lemma cross_treatment_bias_bound in the paper ↗

The pointwise conditional numerator identity gives the paper's cellwise bias envelope. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
e e' residual tau0 tau1 target h u :
ℝ
he :
1 / 4 ≤ e ∧ e ≤ 3 / 4
he' :
1 / 4 ≤ e' ∧ e' ≤ 3 / 4
hr :
|residual| ≤ 9 * u
ht0 :
|tau0 - target| ≤ 3 * h
ht1 :
|tau1 - target| ≤ 3 * h
|residual
+ e * (1 - e') * tau0
+ e' * (1 - e) * tau1
- target * (e * (1 - e') + e' * (1 - e))|
≤ (3 * h + 24 * u) * (e * (1 - e') + e' * (1 - e))
Proof (Lean source)
-- @node: cross_treatment_bias_bound lemma cross_treatment_bias_bound (e e' residual tau0 tau1 target h u : ℝ) (he : 1 / 4 ≤ e ∧ e ≤ 3 / 4) (he' : 1 / 4 ≤ e' ∧ e' ≤ 3 / 4) (hr : |residual| ≤ 9 * u) (ht0 : |tau0 - target| ≤ 3 * h) (ht1 : |tau1 - target| ≤ 3 * h) : |residual + e * (1 - e') * tau0 + e' * (1 - e) * tau1 - target * (e * (1 - e') + e' * (1 - e))| ≤ (3 * h + 24 * u) * (e * (1 - e') + e' * (1 - e)) := by have hw0 : 0 ≤ e * (1 - e') := mul_nonneg (by linarith [he.1]) (by linarith [he'.2]) have hw1 : 0 ≤ e' * (1 - e) := mul_nonneg (by linarith [he'.1]) (by linarith [he.2]) have hu : 0 ≤ u := by nlinarith [abs_nonneg residual] have hd := (cross_treatment_denominator_bounds e e' he he').1 calc _ = |residual + (e * (1 - e') * (tau0 - target) + e' * (1 - e) * (tau1 - target))| := by congr 1; ring _ ≤ |residual| + |e * (1 - e') * (tau0 - target) + e' * (1 - e) * (tau1 - target)| := abs_add_le _ _ _ ≤ |residual| + (|e * (1 - e') * (tau0 - target)| + |e' * (1 - e) * (tau1 - target)|) := by exact add_le_add (le_refl |residual|) (abs_add_le (e * (1 - e') * (tau0 - target)) (e' * (1 - e) * (tau1 - target))) _ ≤ 9 * u + (e * (1 - e') * (3 * h) + e' * (1 - e) * (3 * h)) := by rw [abs_mul (e * (1 - e')), abs_mul (e' * (1 - e)), abs_of_nonneg hw0, abs_of_nonneg hw1] exact add_le_add hr (add_le_add (mul_le_mul_of_nonneg_left ht0 hw0) (mul_le_mul_of_nonneg_left ht1 hw1)) _ ≤ _ := by nlinarith [mul_nonneg hu (sub_nonneg.mpr hd)]
CausalSmith.Stat.PrivateCateRoughdesign.cross_treatment_bias_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Occupancy.lean:354
theorem cell_distance_to_target Lemma cell_distance_to_target in the paper ↗

Every point of a public cell lies within the public radius of the target covariate. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
k :
ℕ
h :
ℝ
hk :
0 < k
hh :
0 < h ∧ h ≤ 1 / 4
j :
Fin k
x :
hx :
x ∈ cell h k j
|(x : ℝ) - x0| ≤ h
Proof (Lean source)
-- @node: cell_distance_to_target lemma cell_distance_to_target (k : ℕ) (h : ℝ) (hk : 0 < k) (hh : 0 < h ∧ h ≤ 1 / 4) (j : Fin k) (x : Covariate) (hx : x ∈ cell h k j) : |(x : ℝ) - x0| ≤ h := by obtain ⟨hl, hu, hw, hd⟩ := cell_endpoint_bounds k h hk hh j have hj : 0 ≤ (j.val : ℝ) * cellWidth h k := mul_nonneg (Nat.cast_nonneg _) hd.le have hxlo : (x0 : ℝ) - h ≤ (x : ℝ) := by linarith [hx.1] have hxhi : (x : ℝ) ≤ (x0 : ℝ) + h := by rcases hx.2 with hx | ⟨_, hx⟩ · linarith · exact hx.le exact abs_le.mpr ⟨by linarith, by linarith⟩
CausalSmith.Stat.PrivateCateRoughdesign.cell_distance_to_target · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Occupancy.lean:385

Two covariates in one cell are separated by at most the public cell width, including the right endpoint of the final cell. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
k :
ℕ
h :
ℝ
hk :
0 < k
hh :
0 < h ∧ h ≤ 1 / 4
j :
Fin k
x x' :
hx :
x ∈ cell h k j
hx' :
x' ∈ cell h k j
|(x : ℝ) - x'| ≤ cellWidth h k
Proof (Lean source)
-- @node: cell_pair_distance lemma cell_pair_distance (k : ℕ) (h : ℝ) (hk : 0 < k) (hh : 0 < h ∧ h ≤ 1 / 4) (j : Fin k) (x x' : Covariate) (hx : x ∈ cell h k j) (hx' : x' ∈ cell h k j) : |(x : ℝ) - x'| ≤ cellWidth h k := by have hwidth : (k : ℝ) * cellWidth h k = 2 * h := by unfold cellWidth have hkR : (k : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hk) field_simp have hupper : ∀ z : Covariate, z ∈ cell h k j → (z : ℝ) ≤ (x0 : ℝ) - h + (j.val + 1) * cellWidth h k := by intro z hz rcases hz.2 with hz | ⟨hj, hz⟩ · exact hz.le · have hjR : (j.val : ℝ) + 1 = k := by exact_mod_cast hj rw [hz, hjR, hwidth] linarith have hu := hupper x hx have hu' := hupper x' hx' exact abs_le.mpr ⟨by linarith [hx.1], by linarith [hx'.1]⟩
CausalSmith.Stat.PrivateCateRoughdesign.cell_pair_distance · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Occupancy.lean:400
theorem cell_nuisance_product_bound

The two one-tenth Holder remainders multiply to the one-fifth cell-width term. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
k :
ℕ
h :
ℝ
hk :
0 < k
hh :
0 < h ∧ h ≤ 1 / 4
P :
hP :
j :
Fin k
x x' :
hx :
x ∈ cell h k j
hx' :
x' ∈ cell h k j
|(P.e x - P.e x') * (P.mu0 x - P.mu0 x')| ≤ 9 * (cellWidth h k) ^ (1 / 5 : ℝ)
Proof (Lean source)
-- @node: cell_nuisance_product_bound lemma cell_nuisance_product_bound (k : ℕ) (h : ℝ) (hk : 0 < k) (hh : 0 < h ∧ h ≤ 1 / 4) (P : CausalLaw) (hP : CompleteModel P) (j : Fin k) (x x' : Covariate) (hx : x ∈ cell h k j) (hx' : x' ∈ cell h k j) : |(P.e x - P.e x') * (P.mu0 x - P.mu0 x')| ≤ 9 * (cellWidth h k) ^ (1 / 5 : ℝ) := by have hdelta := (cell_endpoint_bounds k h hk hh j).2.2.2 have hd := cell_pair_distance k h hk hh j x x' hx hx' have he := hP.propensity_holder x x' have hm := hP.control_holder x x' change |P.e x - P.e x'| ≤ 3 * |(x : ℝ) - x'| ^ (1 / 10 : ℝ) at he change |P.mu0 x - P.mu0 x'| ≤ 3 * |(x : ℝ) - x'| ^ (1 / 10 : ℝ) at hm have hr : |(x : ℝ) - x'| ^ (1 / 10 : ℝ) ≤ cellWidth h k ^ (1 / 10 : ℝ) := Real.rpow_le_rpow (abs_nonneg _) hd (by norm_num) have hpow : cellWidth h k ^ (1 / 10 : ℝ) * cellWidth h k ^ (1 / 10 : ℝ) = cellWidth h k ^ (1 / 5 : ℝ) := by rw [← Real.rpow_add (cell_endpoint_bounds k h hk hh j).2.2.2] norm_num calc _ = |P.e x - P.e x'| * |P.mu0 x - P.mu0 x'| := abs_mul _ _ _ ≤ (3 * cellWidth h k ^ (1 / 10 : ℝ)) * (3 * cellWidth h k ^ (1 / 10 : ℝ)) := mul_le_mul (he.trans (by linarith)) (hm.trans (by linarith)) (abs_nonneg _) (by positivity) _ = 9 * cellWidth h k ^ (1 / 5 : ℝ) := by nlinarith [hpow]
CausalSmith.Stat.PrivateCateRoughdesign.cell_nuisance_product_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Occupancy.lean:423
theorem independent_pair_numerator_expansion Lemma independent_pair_numerator_expansion in the paper ↗

Expanding the two cross-treatment cases separates nuisance variation from the contrast. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
e e' m m' t t' :
ℝ
e * (1 - e') * (m + t - m') + e' * (1 - e) * (m' + t' - m)
= (e - e') * (m - m') + e * (1 - e') * t + e' * (1 - e) * t'
Proof (Lean source)
-- @node: independent_pair_numerator_expansion lemma independent_pair_numerator_expansion (e e' m m' t t' : ℝ) : e * (1 - e') * (m + t - m') + e' * (1 - e) * (m' + t' - m) = (e - e') * (m - m') + e * (1 - e') * t + e' * (1 - e) * t' := by ring
CausalSmith.Stat.PrivateCateRoughdesign.independent_pair_numerator_expansion · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Occupancy.lean:452
theorem cell_cross_treatment_certificate

At any two covariates in one cell, the independent binary cross-treatment moments satisfy both the denominator lower bound and the paper's complete bias envelope. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
k :
ℕ
h :
ℝ
hk :
0 < k
hh :
0 < h ∧ h ≤ 1 / 4
P :
hP :
j :
Fin k
x x' :
hx :
x ∈ cell h k j
hx' :
x' ∈ cell h k j
conclusion 1
3 / 8 ≤ P.e x * (1 - P.e x') + P.e x' * (1 - P.e x)
conclusion 2
|P.e x * (1 - P.e x') * (P.mu1 x - P.mu0 x')
+ P.e x' * (1 - P.e x) * (P.mu1 x' - P.mu0 x)
- theta P * (P.e x * (1 - P.e x') + P.e x' * (1 - P.e x))|
≤ bias h k * (P.e x * (1 - P.e x') + P.e x' * (1 - P.e x))
Proof (Lean source)
-- @node: cell_cross_treatment_certificate lemma cell_cross_treatment_certificate (k : ℕ) (h : ℝ) (hk : 0 < k) (hh : 0 < h ∧ h ≤ 1 / 4) (P : CausalLaw) (hP : CompleteModel P) (j : Fin k) (x x' : Covariate) (hx : x ∈ cell h k j) (hx' : x' ∈ cell h k j) : 3 / 8 ≤ P.e x * (1 - P.e x') + P.e x' * (1 - P.e x) ∧ |P.e x * (1 - P.e x') * (P.mu1 x - P.mu0 x') + P.e x' * (1 - P.e x) * (P.mu1 x' - P.mu0 x) - theta P * (P.e x * (1 - P.e x') + P.e x' * (1 - P.e x))| ≤ bias h k * (P.e x * (1 - P.e x') + P.e x' * (1 - P.e x)) := by have ht : ∀ z : Covariate, z ∈ cell h k j → |tau P z - theta P| ≤ 3 * h := by intro z hz have hc : |tau P z - theta P| ≤ 3 * |(z : ℝ) - x0| := hP.contrast_lipschitz z x0 exact hc.trans (mul_le_mul_of_nonneg_left (cell_distance_to_target k h hk hh j z hz) (by norm_num)) refine ⟨(cross_treatment_denominator_bounds _ _ (hP.overlap x) (hP.overlap x')).1, ?_⟩ have hn := independent_pair_numerator_expansion (P.e x) (P.e x') (P.mu0 x) (P.mu0 x') (tau P x) (tau P x') simp only [tau] at hn have hb := cross_treatment_bias_bound (P.e x) (P.e x') ((P.e x - P.e x') * (P.mu0 x - P.mu0 x')) (tau P x) (tau P x') (theta P) h (cellWidth h k ^ (1 / 5 : ℝ)) (hP.overlap x) (hP.overlap x') (cell_nuisance_product_bound k h hk hh P hP j x x' hx hx') (ht x hx) (ht x' hx') rw [show P.mu0 x + (P.mu1 x - P.mu0 x) = P.mu1 x by ring, show P.mu0 x' + (P.mu1 x' - P.mu0 x') = P.mu1 x' by ring] at hn rw [hn] exact hb
CausalSmith.Stat.PrivateCateRoughdesign.cell_cross_treatment_certificate · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Occupancy.lean:459
theorem occupancy_ratio_assembly

The population identities and cellwise certificates imply the floor and ratio bias bounds. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
P :
Q :
hn :
0 < n
hk :
0 < k
hh :
0 < h
hN :
Nbar n h k Q = ∑ j : Fin k, occupancyWeight n h k P j * nu h k P j
hD :
Dbar n h k Q = ∑ j : Fin k, occupancyWeight n h k P j * dj h k P j
hc :
∀ j : Fin k,
3 / 8 ≤ dj h k P j ∧ |nu h k P j - theta P * dj h k P j| ≤ bias h k * dj h k P j
hW :
info n h k / 8 ≤ Wocc n h k P
conclusion 1
d0 n h k ≤ Dbar n h k Q
conclusion 2
|Nbar n h k Q / Dbar n h k Q - theta P| ≤ bias h k
Proof (Lean source)
-- @node: occupancy_ratio_assembly lemma occupancy_ratio_assembly (n k : ℕ) (h : ℝ) (P : CausalLaw) (Q : Measure (Dataset n)) (hn : 0 < n) (hk : 0 < k) (hh : 0 < h) (hN : Nbar n h k Q = ∑ j : Fin k, occupancyWeight n h k P j * nu h k P j) (hD : Dbar n h k Q = ∑ j : Fin k, occupancyWeight n h k P j * dj h k P j) (hc : ∀ j : Fin k, 3 / 8 ≤ dj h k P j ∧ |nu h k P j - theta P * dj h k P j| ≤ bias h k * dj h k P j) (hW : info n h k / 8 ≤ Wocc n h k P) : d0 n h k ≤ Dbar n h k Q ∧ |Nbar n h k Q / Dbar n h k Q - theta P| ≤ bias h k := by have hden : (3 / 8) * Wocc n h k P ≤ Dbar n h k Q := by rw [hD] exact occupancy_denominator_lower n k h P (fun j => (hc j).1) have hfloor : d0 n h k ≤ Dbar n h k Q := by unfold d0 linarith have hpos : 0 < Dbar n h k Q := lt_of_lt_of_le (info_d0_pos n k h hn hk hh).2 hfloor have hb : |Nbar n h k Q - theta P * Dbar n h k Q| ≤ bias h k * Dbar n h k Q := by rw [hN, hD] exact occupancy_weighted_bias n k h P (fun j => (hc j).2) exact ⟨hfloor, ratio_bias_of_positive_denominator _ _ _ _ hpos hb⟩
CausalSmith.Stat.PrivateCateRoughdesign.occupancy_ratio_assembly · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Occupancy.lean:490
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.PartnerProbability 13 declarations Product-law probabilities of a record having another record in a specified cell.

Product-law probabilities of a record having another record in a specified cell.

theorem observed_cell_mass

The observed probability of a covariate cell equals its design probability. The displayed conclusion follows.

Formal statement
h :
ℝ
k :
ℕ
P :
j :
Fin k
(Pobs P).real {z : O | z.1 ∈ cell h k j} = cellMass h k P j
Proof (Lean source)
-- @node: observed_cell_mass lemma observed_cell_mass (h : ℝ) (k : ℕ) (P : CausalLaw) (j : Fin k) : (Pobs P).real {z : O | z.1 ∈ cell h k j} = cellMass h k P j := by have hs : MeasurableSet {z : O | z.1 ∈ cell h k j} := (measurableSet_cell h k j).preimage measurable_fst simp only [cellMass, PX, Pobs, measureReal_def] rw [Measure.map_apply measurable_observe hs, Measure.map_apply measurable_X (measurableSet_cell h k j)] rfl
theorem iid_rectangle_real

A product rectangle has real mass equal to the product of its coordinate real masses. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
P :
s :
Fin n → Set O
(dataLaw n P).real (Set.univ.pi s) = ∏ i, (Pobs P).real (s i)
Proof (Lean source)
-- @node: iid_rectangle_real lemma iid_rectangle_real (n : ℕ) (P : CausalLaw) (s : Fin n → Set O) : (dataLaw n P).real (Set.univ.pi s) = ∏ i, (Pobs P).real (s i) := by let : IsProbabilityMeasure (Pobs P) := Measure.isProbabilityMeasure_map measurable_observe.aemeasurable rw [dataLaw, measureReal_def, Measure.pi_pi, ENNReal.toReal_prod] rfl
theorem iid_no_partner_probability

Under iid sampling, none of the other records belongs to a fixed measurable event with probability p with probability (1-p)^(n-1). the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
P :
r :
Fin n
s :
Set O
hs :
(dataLaw n P).real {D | ∀ i, i ≠ r → D i ∉ s} = (1 - (Pobs P).real s) ^ (n - 1)
Proof (Lean source)
-- @node: iid_no_partner_probability lemma iid_no_partner_probability (n : ℕ) (P : CausalLaw) (r : Fin n) (s : Set O) (hs : MeasurableSet s) : (dataLaw n P).real {D | ∀ i, i ≠ r → D i ∉ s} = (1 - (Pobs P).real s) ^ (n - 1) := by classical let : IsProbabilityMeasure (Pobs P) := Measure.isProbabilityMeasure_map measurable_observe.aemeasurable have he : {D : Dataset n | ∀ i, i ≠ r → D i ∉ s} = Set.univ.pi (fun i => if i = r then univ else sᶜ) := by ext D simp only [Set.mem_setOf_eq, Set.mem_pi, Set.mem_univ, forall_const] constructor · intro h i by_cases hi : i = r <;> simp [hi, h i] · intro h i hi simpa [hi] using h i rw [he, iid_rectangle_real, ← Finset.mul_prod_erase _ _ (Finset.mem_univ r)] simp only [if_pos rfl, probReal_univ, one_mul] have hp : (∏ i ∈ Finset.univ.erase r, (Pobs P).real (if i = r then univ else sᶜ)) = ∏ _i ∈ Finset.univ.erase r, (1 - (Pobs P).real s) := by apply Finset.prod_congr rfl intro i hi rw [if_neg (Finset.mem_erase.mp hi).1, probReal_compl_eq_one_sub hs] rw [hp] simp
CausalSmith.Stat.PrivateCateRoughdesign.iid_no_partner_probability · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PartnerProbability.lean:31
theorem iid_isolated_record_probability

The probability that the distinguished record belongs to an event and all other records avoid it is p(1-p)^(n-1). the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
P :
r :
Fin n
s :
Set O
hs :
(dataLaw n P).real {D | D r ∈ s ∧ ∀ i, i ≠ r → D i ∉ s}
= (Pobs P).real s * (1 - (Pobs P).real s) ^ (n - 1)
Proof (Lean source)
-- @node: iid_isolated_record_probability lemma iid_isolated_record_probability (n : ℕ) (P : CausalLaw) (r : Fin n) (s : Set O) (hs : MeasurableSet s) : (dataLaw n P).real {D | D r ∈ s ∧ ∀ i, i ≠ r → D i ∉ s} = (Pobs P).real s * (1 - (Pobs P).real s) ^ (n - 1) := by classical let : IsProbabilityMeasure (Pobs P) := Measure.isProbabilityMeasure_map measurable_observe.aemeasurable have he : {D : Dataset n | D r ∈ s ∧ ∀ i, i ≠ r → D i ∉ s} = Set.univ.pi (fun i => if i = r then s else sᶜ) := by ext D simp only [Set.mem_setOf_eq, Set.mem_pi, Set.mem_univ, forall_const] constructor · rintro ⟨hr, h⟩ i by_cases hi : i = r <;> simp [hi, hr, h i] · intro h exact ⟨by simpa using h r, fun i hi => by simpa [hi] using h i⟩ rw [he, iid_rectangle_real, ← Finset.mul_prod_erase _ _ (Finset.mem_univ r)] simp only [if_pos rfl] congr 1 calc _ = ∏ _i ∈ Finset.univ.erase r, (1 - (Pobs P).real s) := by apply Finset.prod_congr rfl intro i hi rw [if_neg (Finset.mem_erase.mp hi).1, probReal_compl_eq_one_sub hs] _ = _ := by simp
CausalSmith.Stat.PrivateCateRoughdesign.iid_isolated_record_probability · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PartnerProbability.lean:61
theorem measurableSet_no_partner Lemma measurableSet_no_partner in the paper ↗

Avoidance by all records except the distinguished one is a measurable event. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
r :
Fin n
s :
Set O
hs :
MeasurableSet {D : Dataset n | ∀ i, i ≠ r → D i ∉ s}
Proof (Lean source)
-- @node: measurableSet_no_partner lemma measurableSet_no_partner (n : ℕ) (r : Fin n) (s : Set O) (hs : MeasurableSet s) : MeasurableSet {D : Dataset n | ∀ i, i ≠ r → D i ∉ s} := by simp only [Set.setOf_forall] apply MeasurableSet.iInter intro i by_cases hi : i = r · simp [hi] · have hm : MeasurableSet {D : Dataset n | D i ∉ s} := hs.compl.preimage (measurable_pi_apply i) simpa [hi] using hm
CausalSmith.Stat.PrivateCateRoughdesign.measurableSet_no_partner · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PartnerProbability.lean:90
theorem iid_record_probability

The real mass of a single iid coordinate event is the observed marginal mass. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
P :
r :
Fin n
s :
Set O
(dataLaw n P).real {D | D r ∈ s} = (Pobs P).real s
Proof (Lean source)
-- @node: iid_record_probability lemma iid_record_probability (n : ℕ) (P : CausalLaw) (r : Fin n) (s : Set O) : (dataLaw n P).real {D | D r ∈ s} = (Pobs P).real s := by classical let : IsProbabilityMeasure (Pobs P) := Measure.isProbabilityMeasure_map measurable_observe.aemeasurable have he : {D : Dataset n | D r ∈ s} = Set.univ.pi (fun i => if i = r then s else univ) := by ext D simp only [Set.mem_setOf_eq, Set.mem_pi, Set.mem_univ, forall_const] constructor · intro hr i; by_cases hi : i = r <;> simp [hi, hr] · intro h; simpa using h r rw [he, iid_rectangle_real, ← Finset.mul_prod_erase _ _ (Finset.mem_univ r)] simp only [if_pos rfl] have hp : (∏ i ∈ Finset.univ.erase r, (Pobs P).real (if i = r then s else univ)) = 1 := by apply Finset.prod_eq_one intro i hi rw [if_neg (Finset.mem_erase.mp hi).1, probReal_univ] simp [hp]
CausalSmith.Stat.PrivateCateRoughdesign.iid_record_probability · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PartnerProbability.lean:104
theorem iid_old_partner_probability

The old record has a partner in a measurable event with probability p[1-(1-p)^(n-1)]. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
P :
r :
Fin n
s :
Set O
hs :
(dataLaw n P).real {D | D r ∈ s ∧ ∃ i, i ≠ r ∧ D i ∈ s}
= (Pobs P).real s * (1 - (1 - (Pobs P).real s) ^ (n - 1))
Proof (Lean source)
-- @node: iid_old_partner_probability lemma iid_old_partner_probability (n : ℕ) (P : CausalLaw) (r : Fin n) (s : Set O) (hs : MeasurableSet s) : (dataLaw n P).real {D | D r ∈ s ∧ ∃ i, i ≠ r ∧ D i ∈ s} = (Pobs P).real s * (1 - (1 - (Pobs P).real s) ^ (n - 1)) := by let : IsProbabilityMeasure (Pobs P) := Measure.isProbabilityMeasure_map measurable_observe.aemeasurable let : IsProbabilityMeasure (dataLaw n P) := by unfold dataLaw; infer_instance have his : MeasurableSet {D : Dataset n | D r ∈ s ∧ ∀ i, i ≠ r → D i ∉ s} := (hs.preimage (measurable_pi_apply r)).inter (measurableSet_no_partner n r s hs) have he : {D : Dataset n | D r ∈ s ∧ ∃ i, i ≠ r ∧ D i ∈ s} = {D | D r ∈ s} \ {D | D r ∈ s ∧ ∀ i, i ≠ r → D i ∉ s} := by ext D; simp only [Set.mem_setOf_eq, Set.mem_sdiff] simp only [not_and, not_forall, _root_.not_imp, not_not, exists_prop] tauto rw [he, measureReal_sdiff (s₁ := {D : Dataset n | D r ∈ s}) (fun D hD => hD.1) his, iid_record_probability, iid_isolated_record_probability n P r s hs] ring
CausalSmith.Stat.PrivateCateRoughdesign.iid_old_partner_probability · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PartnerProbability.lean:127
theorem iid_new_partner_probability

An independent replacement has a partner among the unreplaced records with the same probability p[1-(1-p)^(n-1)]. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
P :
r :
Fin n
s :
Set O
hs :
((dataLaw n P).prod (Pobs P)).real {zz : Dataset n × O | zz.2 ∈ s ∧ ∃ i, i ≠ r ∧ zz.1 i ∈ s}
= (Pobs P).real s * (1 - (1 - (Pobs P).real s) ^ (n - 1))
Proof (Lean source)
-- @node: iid_new_partner_probability lemma iid_new_partner_probability (n : ℕ) (P : CausalLaw) (r : Fin n) (s : Set O) (hs : MeasurableSet s) : ((dataLaw n P).prod (Pobs P)).real {zz : Dataset n × O | zz.2 ∈ s ∧ ∃ i, i ≠ r ∧ zz.1 i ∈ s} = (Pobs P).real s * (1 - (1 - (Pobs P).real s) ^ (n - 1)) := by let : IsProbabilityMeasure (Pobs P) := Measure.isProbabilityMeasure_map measurable_observe.aemeasurable let : IsProbabilityMeasure (dataLaw n P) := by unfold dataLaw; infer_instance have he : {zz : Dataset n × O | zz.2 ∈ s ∧ ∃ i, i ≠ r ∧ zz.1 i ∈ s} = {D : Dataset n | ∀ i, i ≠ r → D i ∉ s}ᶜ ×ˢ s := by ext zz; simp only [Set.mem_setOf_eq, Set.mem_prod, Set.mem_compl_iff] simp only [not_forall, _root_.not_imp, not_not, exists_prop] exact and_comm rw [he, measureReal_prod_prod, probReal_compl_eq_one_sub (measurableSet_no_partner n r s hs), iid_no_partner_probability n P r s hs] ring
CausalSmith.Stat.PrivateCateRoughdesign.iid_new_partner_probability · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PartnerProbability.lean:147
theorem measurableSet_old_partner Lemma measurableSet_old_partner in the paper ↗

Having a partner in a measurable event is itself a measurable dataset event. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
r :
Fin n
s :
Set O
hs :
MeasurableSet {D : Dataset n | D r ∈ s ∧ ∃ i, i ≠ r ∧ D i ∈ s}
Proof (Lean source)
-- @node: measurableSet_old_partner lemma measurableSet_old_partner (n : ℕ) (r : Fin n) (s : Set O) (hs : MeasurableSet s) : MeasurableSet {D : Dataset n | D r ∈ s ∧ ∃ i, i ≠ r ∧ D i ∈ s} := by have he : {D : Dataset n | D r ∈ s ∧ ∃ i, i ≠ r ∧ D i ∈ s} = {D | D r ∈ s} ∩ {D | ∀ i, i ≠ r → D i ∉ s}ᶜ := by ext D simp only [Set.mem_setOf_eq, Set.mem_inter_iff, Set.mem_compl_iff, not_forall, _root_.not_imp, not_not, exists_prop] rw [he] exact (hs.preimage (measurable_pi_apply r)).inter (measurableSet_no_partner n r s hs).compl
CausalSmith.Stat.PrivateCateRoughdesign.measurableSet_old_partner · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PartnerProbability.lean:167

Counting members with a distinct partner discards exactly the empty and singleton counts. The displayed conclusion follows.

Formal statement
α :
Type*
s :
(∑ r : α, if r ∈ s ∧ ∃ i ∈ s, i ≠ r then (1 : ℝ) else 0)
= if s.card < 2 then 0 else (s.card : ℝ)
Proof (Lean source)
-- @node: finite_partner_count lemma finite_partner_count {α : Type*} [Fintype α] (s : Finset α) : (∑ r : α, if r ∈ s ∧ ∃ i ∈ s, i ≠ r then (1 : ℝ) else 0) = if s.card < 2 then 0 else (s.card : ℝ) := by classical by_cases hs : s.card < 2 · rw [if_pos hs] apply Finset.sum_eq_zero intro r hr have hn : ¬ (r ∈ s ∧ ∃ i ∈ s, i ≠ r) := by rintro ⟨hr, i, hi, hir⟩ have hc := Finset.one_lt_card.mpr ⟨i, hi, r, hr, hir⟩ omega simp only [if_neg hn] · rw [if_neg hs] have he (r : α) : (r ∈ s ∧ ∃ i ∈ s, i ≠ r) ↔ r ∈ s := by constructor · exact left · intro hr exact ⟨hr, Finset.exists_mem_ne (by omega) r⟩ simp_rw [he] simp

The eligible cell occupancy is the sum of record-level partner indicators. The displayed conclusion follows.

Formal statement
n k :
ℕ
h :
ℝ
D :
j :
Fin k
conclusion 1
(if cellCount n h k D j < 2 then 0 else (cellCount n h k D j : ℝ))
= ∑ r : Fin n, if (D r).1 ∈ cell h k j
conclusion 2
∃ i,
i ≠ r
(D i).1 ∈ cell h k j then (1 : ℝ) else 0
Proof (Lean source)
-- @node: cell_partner_count lemma cell_partner_count (n k : ℕ) (h : ℝ) (D : Dataset n) (j : Fin k) : (if cellCount n h k D j < 2 then 0 else (cellCount n h k D j : ℝ)) = ∑ r : Fin n, if (D r).1 ∈ cell h k j ∧ ∃ i, i ≠ r ∧ (D i).1 ∈ cell h k j then (1 : ℝ) else 0 := by classical have he (r : Fin n) : (r ∈ cellRecords n h k D j ∧ ∃ i ∈ cellRecords n h k D j, i ≠ r) ↔ ((D r).1 ∈ cell h k j ∧ ∃ i, i ≠ r ∧ (D i).1 ∈ cell h k j) := by simp only [cellRecords, mem_filter, Finset.mem_univ, true_and] constructor · rintro ⟨hr, i, hi, hir⟩ exact ⟨hr, i, hir, hi⟩ · rintro ⟨hr, i, hir, hi⟩ exact ⟨hr, i, hi, hir⟩ rw [cellCount, ← finite_partner_count] apply Finset.sum_congr rfl intro r hr by_cases hp : (D r).1 ∈ cell h k j ∧ ∃ i, i ≠ r ∧ (D i).1 ∈ cell h k j · rw [if_pos hp, if_pos ((he r).mpr hp)] · rw [if_neg hp, if_neg (fun hc => hp ((he r).mp hc))]
theorem integrable_cell_partner_count Lemma integrable_cell_partner_count in the paper ↗

Eligible occupancy is integrable under every finite dataset measure. The displayed conclusion follows.

Formal statement
n k :
ℕ
h :
ℝ
j :
Fin k
Integrable (fun D => if cellCount n h k D j < 2 then 0 else (cellCount n h k D j : ℝ)) Q
Proof (Lean source)
-- @node: integrable_cell_partner_count @[fun_prop] lemma integrable_cell_partner_count (n k : ℕ) (h : ℝ) (j : Fin k) (Q : Measure (Dataset n)) [IsFiniteMeasure Q] : Integrable (fun D => if cellCount n h k D j < 2 then 0 else (cellCount n h k D j : ℝ)) Q := by classical simp_rw [cell_partner_count] apply integrable_finset_sum intro r hr have hs := measurableSet_old_partner n r {z : O | z.1 ∈ cell h k j} ((measurableSet_cell h k j).preimage measurable_fst) have hi := (integrable_const (μ := Q) (1 : ℝ)).indicator hs apply hi.congr filter_upwards with D by_cases hp : (D r).1 ∈ cell h k j ∧ ∃ i, i ≠ r ∧ (D i).1 ∈ cell h k j · simp [Set.indicator_apply, hp] · simp [Set.indicator_apply, hp]
CausalSmith.Stat.PrivateCateRoughdesign.integrable_cell_partner_count · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PartnerProbability.lean:230
theorem iid_cell_partner_count_expectation

The binomial occupancy identity follows by summing iid record-partner probabilities, without requiring independence between different cell counts. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
P :
j :
Fin k
(∫ D, (if cellCount n h k D j < 2 then 0 else (cellCount n h k D j : ℝ)) ∂dataLaw n P)
= occupancyWeight n h k P j
Proof (Lean source)
-- @node: iid_cell_partner_count_expectation lemma iid_cell_partner_count_expectation (n k : ℕ) (h : ℝ) (P : CausalLaw) (j : Fin k) : (∫ D, (if cellCount n h k D j < 2 then 0 else (cellCount n h k D j : ℝ)) ∂dataLaw n P) = occupancyWeight n h k P j := by classical let : IsProbabilityMeasure (Pobs P) := Measure.isProbabilityMeasure_map measurable_observe.aemeasurable let : IsProbabilityMeasure (dataLaw n P) := by unfold dataLaw; infer_instance let s : Set O := {z | z.1 ∈ cell h k j} have hs : MeasurableSet s := (measurableSet_cell h k j).preimage measurable_fst have hi (r : Fin n) : Integrable (fun D : Dataset n => if D r ∈ s ∧ ∃ i, i ≠ r ∧ D i ∈ s then (1 : ℝ) else 0) (dataLaw n P) := by have hi := (integrable_const (μ := dataLaw n P) (1 : ℝ)).indicator (measurableSet_old_partner n r s hs) apply hi.congr filter_upwards with D by_cases hp : D r ∈ s ∧ ∃ i, i ≠ r ∧ D i ∈ s · simp [Set.indicator_apply, hp] · simp [Set.indicator_apply, hp] simp_rw [cell_partner_count] change (∫ D : Dataset n, (∑ r : Fin n, if D r ∈ s ∧ ∃ i, i ≠ r ∧ D i ∈ s then (1 : ℝ) else 0) ∂dataLaw n P) = _ rw [integral_finset_sum _ (fun r _ => hi r)] have hm (r : Fin n) : (∫ D : Dataset n, (if D r ∈ s ∧ ∃ i, i ≠ r ∧ D i ∈ s then (1 : ℝ) else 0) ∂dataLaw n P) = cellMass h k P j * (1 - (1 - cellMass h k P j) ^ (n - 1)) := by have hv := integral_indicator_one (μ := dataLaw n P) (measurableSet_old_partner n r s hs) simp only [indicator, Set.mem_setOf_eq, Pi.one_apply] at hv rw [hv, iid_old_partner_probability n P r s hs] rw [show (Pobs P).real s = cellMass h k P j from observed_cell_mass h k P j] change (∑ r : Fin n, (∫ D : Dataset n, (if D r ∈ s ∧ ∃ i, i ≠ r ∧ D i ∈ s then (1 : ℝ) else 0) ∂dataLaw n P)) = _ simp_rw [hm] simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul, occupancyWeight] ring
CausalSmith.Stat.PrivateCateRoughdesign.iid_cell_partner_count_expectation · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PartnerProbability.lean:249
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.PartnerVariance 23 declarations Partner-sensitive replacement increments and the occupancy-weighted Efron--Stein assembly.

Partner-sensitive replacement increments and the occupancy-weighted Efron--Stein assembly.

theorem selected_scalar_insertion_bound

Inserting one record into an arbitrary selected set changes each scalar causal contribution by at most three, at every count. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
I :
D :
r :
Fin n
hr :
r ∉ I
conclusion 1
conclusion 2
Proof (Lean source)
-- @node: selected_scalar_insertion_bound lemma selected_scalar_insertion_bound {n : ℕ} (I : Finset (Fin n)) (D : Dataset n) (r : Fin n) (hr : r ∉ I) : |selectedNumerator (insert r I) D - selectedNumerator I D| ≤ 3 ∧ |selectedDenominator (insert r I) D - selectedDenominator I D| ≤ 3 := by classical let e : Fin I.card ≃ {i // i ∈ I} := (Fintype.equivFinOfCardEq (by simp)).symm let z : Fin (I.card + 1) → O := Fin.lastCases (D r) (fun i => D (e i)) have hz (i : Fin I.card) : z i.castSucc = D (e i) := by simp [z] have hlast : z (last I.card) = D r := by simp [z] have hsum (v : O → ℝ) : (∑ i, v (z i)) = ∑ i ∈ insert r I, v (D i) := by rw [Fin.sum_univ_castSucc] simp_rw [hz] rw [selected_sum n _ I e (fun i => v (D i)), Finset.sum_insert hr, hlast] exact add_comm _ _ obtain ⟨hN, hD⟩ := pair_moment_formulas _ z rw [hsum (fun z => bit z.2.1 * bit z.2.2), hsum (fun z => bit z.2.1), hsum (fun z => bit z.2.2)] at hN rw [hsum (fun z => bit z.2.1)] at hD have hcard := Finset.card_insert_of_notMem hr have hNi : pairContribution KN z = selectedNumerator (insert r I) D := by simpa only [selectedNumerator, hcard, Nat.cast_add, Nat.cast_one] using hN have hDi : pairContribution KD z = selectedDenominator (insert r I) D := by simpa only [selectedDenominator, hcard, Nat.cast_add, Nat.cast_one] using hD obtain ⟨hNo, hDo⟩ := selected_pair_formulas I D e have hbN := pairContribution_insertion_bound I.card KN z (fun x y => (causal_pair_kernel_unit_bounds x y).1) have hbD := pairContribution_insertion_bound I.card KD z (fun x y => (causal_pair_kernel_unit_bounds x y).2) simp_rw [hz] at hbN hbD rw [hNi, hNo] at hbN rw [hDi, hDo] at hbD exact ⟨hbN, hbD⟩
CausalSmith.Stat.PrivateCateRoughdesign.selected_scalar_insertion_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PartnerVariance.lean:11
theorem selected_partner_erasure_bound

Without a remaining selected record, both scalar contributions before and after insertion are zero. With a partner, the scalar insertion bound is three. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
I :
D :
r :
Fin n
conclusion 1
|selectedNumerator I D - selectedNumerator (I.erase r) D|
≤ (if r ∈ I ∧ (I.erase r).Nonempty then 3 else 0)
conclusion 2
≤ (if r ∈ I ∧ (I.erase r).Nonempty then 3 else 0)
Proof (Lean source)
-- @node: selected_partner_erasure_bound lemma selected_partner_erasure_bound {n : ℕ} (I : Finset (Fin n)) (D : Dataset n) (r : Fin n) : |selectedNumerator I D - selectedNumerator (I.erase r) D| ≤ (if r ∈ I ∧ (I.erase r).Nonempty then 3 else 0) ∧ |selectedDenominator I D - selectedDenominator (I.erase r) D| ≤ (if r ∈ I ∧ (I.erase r).Nonempty then 3 else 0) := by classical by_cases hr : r ∈ I · by_cases hp : (I.erase r).Nonempty · simp only [hr, hp, and_self, if_true] have hb := selected_scalar_insertion_bound (I.erase r) D r (Finset.notMem_erase r I) rwa [Finset.insert_erase hr] at hb · have he : I.erase r = ∅ := Finset.not_nonempty_iff_eq_empty.mp hp have hI : I = {r} := by have hi := Finset.insert_erase hr rw [he] at hi simpa using hi.symm simp [hI, selectedNumerator, selectedDenominator] · simp [hr]
CausalSmith.Stat.PrivateCateRoughdesign.selected_partner_erasure_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PartnerVariance.lean:49

The partner indicator records whether a proposed record shares a public cell with any record other than the replaced index.

Definition (Lean source)
n k :
ℕ
h :
ℝ
D :
r :
Fin n
z :
O
partnerIndicator n k h D r z :
ℝ
if ∃ j : Fin k, z.1 ∈ cell h k j ∧ (cellRecords n h k D j |>.erase r).Nonempty then 1 else 0
theorem partnerIndicator_values

Partner indicators take only the values zero and one. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
D :
r :
Fin n
z :
O
partnerIndicator n k h D r z = 0 ∨ partnerIndicator n k h D r z = 1
Proof (Lean source)
-- @node: partnerIndicator_values lemma partnerIndicator_values (n k : ℕ) (h : ℝ) (D : Dataset n) (r : Fin n) (z : O) : partnerIndicator n k h D r z = 0 ∨ partnerIndicator n k h D r z = 1 := by classical unfold partnerIndicator split_ifs <;> simp
CausalSmith.Stat.PrivateCateRoughdesign.partnerIndicator_values · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PartnerVariance.lean:80
theorem erased_cellRecords_congr Lemma erased_cellRecords_congr in the paper ↗

The two datasets in a replacement have identical cell selections after erasing its index. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
D D' :
r :
Fin n
heq :
∀ i
if
i ≠ r
then
D i = D' i
j :
Fin k
(cellRecords n h k D j).erase r = (cellRecords n h k D' j).erase r
Proof (Lean source)
-- @node: erased_cellRecords_congr lemma erased_cellRecords_congr (n k : ℕ) (h : ℝ) (D D' : Dataset n) (r : Fin n) (heq : ∀ i, i ≠ r → D i = D' i) (j : Fin k) : (cellRecords n h k D j).erase r = (cellRecords n h k D' j).erase r := by classical ext i by_cases hi : i = r · subst i; simp · simp [cellRecords, hi, heq i hi]
CausalSmith.Stat.PrivateCateRoughdesign.erased_cellRecords_congr · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PartnerVariance.lean:88
theorem cell_partner_replacement_bound Lemma cell_partner_replacement_bound in the paper ↗

A scalar cell replacement is bounded by the old and new partner indicators in that cell. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
D D' :
r :
Fin n
heq :
∀ i
if
i ≠ r
then
D i = D' i
j :
Fin k
B :
(cellRecords n h k D j).erase r
old :
if (D r).1 ∈ cell h k j ∧ B.Nonempty then (3 : ℝ) else 0
new :
if (D' r).1 ∈ cell h k j ∧ B.Nonempty then (3 : ℝ) else 0
|numeratorCell n h k D j - numeratorCell n h k D' j| ≤ old + new
|denominatorCell n h k D j - denominatorCell n h k D' j| ≤ old + new
Proof (Lean source)
-- @node: cell_partner_replacement_bound lemma cell_partner_replacement_bound (n k : ℕ) (h : ℝ) (D D' : Dataset n) (r : Fin n) (heq : ∀ i, i ≠ r → D i = D' i) (j : Fin k) : let B := (cellRecords n h k D j).erase r let old := if (D r).1 ∈ cell h k j ∧ B.Nonempty then (3 : ℝ) else 0 let new := if (D' r).1 ∈ cell h k j ∧ B.Nonempty then (3 : ℝ) else 0 |numeratorCell n h k D j - numeratorCell n h k D' j| ≤ old + new ∧ |denominatorCell n h k D j - denominatorCell n h k D' j| ≤ old + new := by classical dsimp only let I := cellRecords n h k D j let I' := cellRecords n h k D' j have hbase : I.erase r = I'.erase r := erased_cellRecords_congr n k h D D' r heq j have hcommon : ∀ i ∈ I.erase r, D i = D' i := by intro i hi exact heq i (Finset.mem_erase.mp hi).1 obtain ⟨hcN, hcD⟩ := selected_congr (I.erase r) D D' hcommon rw [hbase] at hcN hcD obtain ⟨hbN, hbD⟩ := selected_partner_erasure_bound I D r obtain ⟨hbN', hbD'⟩ := selected_partner_erasure_bound I' D' r rw [← hcN, ← hbase] at hbN' rw [← hcD, ← hbase] at hbD' have hN := abs_sub_le (selectedNumerator I D) (selectedNumerator (I.erase r) D) (selectedNumerator I' D') have hD := abs_sub_le (selectedDenominator I D) (selectedDenominator (I.erase r) D) (selectedDenominator I' D') rw [abs_sub_comm (selectedNumerator (I.erase r) D)] at hN rw [abs_sub_comm (selectedDenominator (I.erase r) D)] at hD have hmem : (r ∈ I) ↔ (D r).1 ∈ cell h k j := by simp [I, cellRecords] have hmem' : (r ∈ I') ↔ (D' r).1 ∈ cell h k j := by simp [I', cellRecords] simp only [hmem] at hbN hbD simp only [hmem'] at hbN' hbD' change |selectedNumerator I D - selectedNumerator I' D'| ≤ _ ∧ |selectedDenominator I D - selectedDenominator I' D'| ≤ _ constructor <;> linarith
CausalSmith.Stat.PrivateCateRoughdesign.cell_partner_replacement_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PartnerVariance.lean:100
theorem cell_partner_sum

Disjointness reduces the sum of cellwise partner envelopes to the single partner indicator. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
hh :
0 < h
hk :
0 < k
D :
r :
Fin n
z :
O
(∑ j : Fin k, if z.1 ∈ cell h k j ∧ ((cellRecords n h k D j).erase r).Nonempty then (3 : ℝ) else 0)
= 3 * partnerIndicator n k h D r z
Proof (Lean source)
-- @node: cell_partner_sum lemma cell_partner_sum (n k : ℕ) (h : ℝ) (hh : 0 < h) (hk : 0 < k) (D : Dataset n) (r : Fin n) (z : O) : (∑ j : Fin k, if z.1 ∈ cell h k j ∧ ((cellRecords n h k D j).erase r).Nonempty then (3 : ℝ) else 0) = 3 * partnerIndicator n k h D r z := by classical unfold partnerIndicator by_cases hx : ∃ j : Fin k, z.1 ∈ cell h k j ∧ ((cellRecords n h k D j).erase r).Nonempty · rw [if_pos hx] obtain ⟨j, hj⟩ := hx rw [Finset.sum_eq_single j] · simp [hj] · intro i hi hij have hnot : z.1 ∉ cell h k i := by intro hz exact Set.disjoint_left.mp (cell_disjoint k h hh hk i j hij) hz hj.1 simp [hnot] · simp · rw [if_neg hx] have hn : ∀ j : Fin k, ¬(z.1 ∈ cell h k j ∧ ((cellRecords n h k D j).erase r).Nonempty) := by simpa using hx simp [hn]
theorem statistic_partner_replacement_bound

Each scalar replacement increment vanishes without partners and is at most three times the sum of its old and new partner indicators. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
hh :
0 < h
hk :
0 < k
D D' :
r :
Fin n
heq :
∀ i
if
i ≠ r
then
D i = D' i
J :
partnerIndicator n k h D r (D r)
J' :
partnerIndicator n k h D r (D' r)
|SN n h k D - SN n h k D'| ≤ 3 * (J + J')
|SD n h k D - SD n h k D'| ≤ 3 * (J + J')
Proof (Lean source)
-- @node: statistic_partner_replacement_bound lemma statistic_partner_replacement_bound (n k : ℕ) (h : ℝ) (hh : 0 < h) (hk : 0 < k) (D D' : Dataset n) (r : Fin n) (heq : ∀ i, i ≠ r → D i = D' i) : let J := partnerIndicator n k h D r (D r) let J' := partnerIndicator n k h D r (D' r) |SN n h k D - SN n h k D'| ≤ 3 * (J + J') ∧ |SD n h k D - SD n h k D'| ≤ 3 * (J + J') := by classical dsimp only have hbN := Finset.sum_le_sum (s := univ) (fun j _ => (cell_partner_replacement_bound n k h D D' r heq j).1) have hbD := Finset.sum_le_sum (s := univ) (fun j _ => (cell_partner_replacement_bound n k h D D' r heq j).2) simp only [Finset.sum_add_distrib, cell_partner_sum n k h hh hk D r] at hbN hbD have hN : |SN n h k D - SN n h k D'| ≤ ∑ j : Fin k, |numeratorCell n h k D j - numeratorCell n h k D' j| := by rw [SN, SN, ← Finset.sum_sub_distrib] exact Finset.abs_sum_le_sum_abs _ _ have hD : |SD n h k D - SD n h k D'| ≤ ∑ j : Fin k, |denominatorCell n h k D j - denominatorCell n h k D' j| := by rw [SD, SD, ← Finset.sum_sub_distrib] exact Finset.abs_sum_le_sum_abs _ _ constructor <;> linarith
CausalSmith.Stat.PrivateCateRoughdesign.statistic_partner_replacement_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PartnerVariance.lean:164
theorem statistic_partner_square_bound

Squared scalar replacement increments are bounded by eighteen times the two partner indicators, exactly the deterministic envelope in the variance roadmap. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
hh :
0 < h
hk :
0 < k
D :
r :
Fin n
z :
O
J :
partnerIndicator n k h D r (D r)
J' :
partnerIndicator n k h D r z
(SN n h k D - SN n h k (update D r z))^2 ≤ 18 * (J + J')
(SD n h k D - SD n h k (update D r z))^2 ≤ 18 * (J + J')
Proof (Lean source)
-- @node: statistic_partner_square_bound lemma statistic_partner_square_bound (n k : ℕ) (h : ℝ) (hh : 0 < h) (hk : 0 < k) (D : Dataset n) (r : Fin n) (z : O) : let J := partnerIndicator n k h D r (D r) let J' := partnerIndicator n k h D r z (SN n h k D - SN n h k (update D r z))^2 ≤ 18 * (J + J') ∧ (SD n h k D - SD n h k (update D r z))^2 ≤ 18 * (J + J') := by have hb := statistic_partner_replacement_bound n k h hh hk D (update D r z) r (fun i hi => (Function.update_of_ne hi z D).symm) simp only [Function.update_self] at hb exact ⟨replacement_square_indicator_bound _ _ _ (partnerIndicator_values n k h D r (D r)) (partnerIndicator_values n k h D r z) hb.1, replacement_square_indicator_bound _ _ _ (partnerIndicator_values n k h D r (D r)) (partnerIndicator_values n k h D r z) hb.2⟩
CausalSmith.Stat.PrivateCateRoughdesign.statistic_partner_square_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PartnerVariance.lean:190
theorem measurable_partnerIndicator

Partner indicators are Borel functions of the dataset and proposed record. The displayed conclusion follows.

Formal statement
n k :
ℕ
h :
ℝ
r :
Fin n
Measurable (fun zz : Dataset n × O => partnerIndicator n k h zz.1 r zz.2)
Proof (Lean source)
-- @node: measurable_partnerIndicator @[fun_prop] lemma measurable_partnerIndicator (n k : ℕ) (h : ℝ) (r : Fin n) : Measurable (fun zz : Dataset n × O => partnerIndicator n k h zz.1 r zz.2) := by classical unfold partnerIndicator simp only [Nonempty, Finset.mem_erase, cellRecords, mem_filter, Finset.mem_univ, true_and] refine measurable_const.ite ?_ measurable_const simp only [Set.ofPred_exists] apply MeasurableSet.iUnion intro j apply MeasurableSet.inter · exact (measurableSet_cell h k j).preimage (by fun_prop) · change MeasurableSet {zz : Dataset n × O | ∃ i : Fin n, i ≠ r ∧ (zz.1 i).1 ∈ cell h k j} rw [Set.ofPred_exists] apply MeasurableSet.iUnion intro i by_cases hi : i = r · simp [hi] · simp only [ne_eq, hi, not_false_eq_true, true_and] exact (measurableSet_cell h k j).preimage (by fun_prop)
CausalSmith.Stat.PrivateCateRoughdesign.measurable_partnerIndicator · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PartnerVariance.lean:207
theorem partnerIndicator_integrable

Partner indicators are bounded by one and integrable under every finite measure. The displayed conclusion follows.

Formal statement
n k :
ℕ
h :
ℝ
r :
Fin n
Integrable (fun zz => partnerIndicator n k h zz.1 r zz.2) Q
Proof (Lean source)
-- @node: partnerIndicator_integrable @[fun_prop] lemma partnerIndicator_integrable (n k : ℕ) (h : ℝ) (r : Fin n) (Q : Measure (Dataset n × O)) [IsFiniteMeasure Q] : Integrable (fun zz => partnerIndicator n k h zz.1 r zz.2) Q := by apply Integrable.of_bound (by fun_prop) 1 apply ae_of_all intro zz rcases partnerIndicator_values n k h zz.1 r zz.2 with hz | hz <;> simp [hz]
CausalSmith.Stat.PrivateCateRoughdesign.partnerIndicator_integrable · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PartnerVariance.lean:231
theorem statistic_replacement_square_integrable Lemma statistic_replacement_square_integrable in the paper ↗

The squared replacement differences of the bounded statistics are integrable under every finite measure on dataset and replacement pairs. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
hh :
0 < h
hk :
0 < k
r :
Fin n
conclusion 1
Integrable (fun zz => (SN n h k zz.1 - SN n h k (update zz.1 r zz.2))^2) Q
conclusion 2
Integrable (fun zz => (SD n h k zz.1 - SD n h k (update zz.1 r zz.2))^2) Q
Proof (Lean source)
-- @node: statistic_replacement_square_integrable lemma statistic_replacement_square_integrable (n k : ℕ) (h : ℝ) (hh : 0 < h) (hk : 0 < k) (r : Fin n) (Q : Measure (Dataset n × O)) [IsFiniteMeasure Q] : Integrable (fun zz => (SN n h k zz.1 - SN n h k (update zz.1 r zz.2))^2) Q ∧ Integrable (fun zz => (SD n h k zz.1 - SD n h k (update zz.1 r zz.2))^2) Q := by have hb (zz : Dataset n × O) : (SN n h k zz.1 - SN n h k (update zz.1 r zz.2))^2 ≤ 36 ∧ (SD n h k zz.1 - SD n h k (update zz.1 r zz.2))^2 ≤ 36 := by obtain ⟨hN, hD⟩ := statistic_partner_square_bound n k h hh hk zz.1 r zz.2 have hv := partnerIndicator_values n k h zz.1 r (zz.1 r) have hv' := partnerIndicator_values n k h zz.1 r zz.2 rcases hv with hv | hv <;> rcases hv' with hv' | hv' <;> simp only [hv, hv'] at hN hD <;> constructor <;> linarith constructor · apply Integrable.of_bound (by fun_prop) 36 exact ae_of_all _ (fun zz => by simpa only [Real.norm_eq_abs, abs_sq] using (hb zz).1) · apply Integrable.of_bound (by fun_prop) 36 exact ae_of_all _ (fun zz => by simpa only [Real.norm_eq_abs, abs_sq] using (hb zz).2)
CausalSmith.Stat.PrivateCateRoughdesign.statistic_replacement_square_integrable · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PartnerVariance.lean:241
theorem partnerIndicator_eq_sum

Disjoint public cells express the partner indicator as a sum of cell event indicators. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
hh :
0 < h
hk :
0 < k
D :
r :
Fin n
z :
O
partnerIndicator n k h D r z
= ∑ j : Fin k, (if z.1 ∈ cell h k j ∧ ∃ i, i ≠ r ∧ (D i).1 ∈ cell h k j then 1 else 0)
Proof (Lean source)
-- @node: partnerIndicator_eq_sum lemma partnerIndicator_eq_sum (n k : ℕ) (h : ℝ) (hh : 0 < h) (hk : 0 < k) (D : Dataset n) (r : Fin n) (z : O) : partnerIndicator n k h D r z = ∑ j : Fin k, (if z.1 ∈ cell h k j ∧ ∃ i, i ≠ r ∧ (D i).1 ∈ cell h k j then 1 else 0) := by classical have he (j : Fin k) : ((cellRecords n h k D j).erase r).Nonempty ↔ ∃ i, i ≠ r ∧ (D i).1 ∈ cell h k j := by simp [Nonempty, cellRecords] have hs := cell_partner_sum n k h hh hk D r z simp only [he] at hs have ht : (∑ j : Fin k, if z.1 ∈ cell h k j ∧ ∃ i, i ≠ r ∧ (D i).1 ∈ cell h k j then (3 : ℝ) else 0) = 3 * ∑ j : Fin k, if z.1 ∈ cell h k j ∧ ∃ i, i ≠ r ∧ (D i).1 ∈ cell h k j then (1 : ℝ) else 0 := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro j hj split_ifs <;> norm_num rw [ht] at hs linarith
CausalSmith.Stat.PrivateCateRoughdesign.partnerIndicator_eq_sum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PartnerVariance.lean:266
theorem measurableSet_has_partner Lemma measurableSet_has_partner in the paper ↗

Existence of an unreplaced record in an event is measurable. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
r :
Fin n
s :
Set O
hs :
MeasurableSet {D : Dataset n | ∃ i, i ≠ r ∧ D i ∈ s}
Proof (Lean source)
-- @node: measurableSet_has_partner lemma measurableSet_has_partner (n : ℕ) (r : Fin n) (s : Set O) (hs : MeasurableSet s) : MeasurableSet {D : Dataset n | ∃ i, i ≠ r ∧ D i ∈ s} := by have he : {D : Dataset n | ∃ i, i ≠ r ∧ D i ∈ s} = {D : Dataset n | ∀ i, i ≠ r → D i ∉ s}ᶜ := by ext D simp [not_forall, _root_.not_imp] rw [he] exact (measurableSet_no_partner n r s hs).compl
CausalSmith.Stat.PrivateCateRoughdesign.measurableSet_has_partner · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PartnerVariance.lean:289
theorem integral_cell_partner_indicators

Old and independent-copy cell partner indicators both have the Bernoulli occupancy mean. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
P :
r :
Fin n
j :
Fin k
Q :
(dataLaw n P).prod (Pobs P)
p :
cellMass h k P j
(∫ zz : Dataset n × O, if (zz.1 r).1 ∈ cell h k j ∧ ∃ i, i ≠ r ∧ (zz.1 i).1 ∈ cell h k j then (1 : ℝ) else 0 ∂Q)
= p * (1 - (1 - p)^(n - 1))
(∫ zz : Dataset n × O, if zz.2.1 ∈ cell h k j ∧ ∃ i, i ≠ r ∧ (zz.1 i).1 ∈ cell h k j then (1 : ℝ) else 0 ∂Q)
= p * (1 - (1 - p)^(n - 1))
Proof (Lean source)
-- @node: integral_cell_partner_indicators lemma integral_cell_partner_indicators (n k : ℕ) (h : ℝ) (P : CausalLaw) (r : Fin n) (j : Fin k) : let Q := (dataLaw n P).prod (Pobs P) let p := cellMass h k P j (∫ zz : Dataset n × O, if (zz.1 r).1 ∈ cell h k j ∧ ∃ i, i ≠ r ∧ (zz.1 i).1 ∈ cell h k j then (1 : ℝ) else 0 ∂Q) = p * (1 - (1 - p)^(n - 1)) ∧ (∫ zz : Dataset n × O, if zz.2.1 ∈ cell h k j ∧ ∃ i, i ≠ r ∧ (zz.1 i).1 ∈ cell h k j then (1 : ℝ) else 0 ∂Q) = p * (1 - (1 - p)^(n - 1)) := by classical let : IsProbabilityMeasure (Pobs P) := Measure.isProbabilityMeasure_map measurable_observe.aemeasurable let : IsProbabilityMeasure (dataLaw n P) := by unfold dataLaw; infer_instance dsimp only let s : Set O := {z | z.1 ∈ cell h k j} have hs : MeasurableSet s := (measurableSet_cell h k j).preimage measurable_fst have hp := measurableSet_has_partner n r s hs have hor : MeasurableSet {D : Dataset n | D r ∈ s} := hs.preimage (measurable_pi_apply r) have ho : MeasurableSet {zz : Dataset n × O | (zz.1 r) ∈ s ∧ ∃ i, i ≠ r ∧ zz.1 i ∈ s} := (hor.inter hp).preimage measurable_fst have hn : MeasurableSet {zz : Dataset n × O | zz.2 ∈ s ∧ ∃ i, i ≠ r ∧ zz.1 i ∈ s} := (hs.preimage measurable_snd).inter (hp.preimage measurable_fst) have he : {zz : Dataset n × O | (zz.1 r) ∈ s ∧ ∃ i, i ≠ r ∧ zz.1 i ∈ s} = {D : Dataset n | D r ∈ s ∧ ∃ i, i ≠ r ∧ D i ∈ s} ×ˢ univ := by ext zz; simp constructor · have ht := integral_indicator_one (μ := (dataLaw n P).prod (Pobs P)) ho simp only [indicator, Set.mem_setOf_eq, Pi.one_apply, s] at ht simp only [s, Set.mem_setOf_eq] at he rw [ht, he, measureReal_prod_prod, probReal_univ, mul_one] simpa only [s, Set.mem_setOf_eq, observed_cell_mass] using iid_old_partner_probability n P r s hs · have ht := integral_indicator_one (μ := (dataLaw n P).prod (Pobs P)) hn simp only [indicator, Set.mem_setOf_eq, Pi.one_apply, s] at ht rw [ht] simpa only [s, Set.mem_setOf_eq, observed_cell_mass] using iid_new_partner_probability n P r s hs
CausalSmith.Stat.PrivateCateRoughdesign.integral_cell_partner_indicators · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PartnerVariance.lean:302
theorem measurable_oldPartnerIndicator

The old-record partner indicator is Borel on the dataset and independent-copy space. The displayed conclusion follows.

Formal statement
n k :
ℕ
h :
ℝ
r :
Fin n
Measurable (fun zz : Dataset n × O => partnerIndicator n k h zz.1 r (zz.1 r))
Proof (Lean source)
-- @node: measurable_oldPartnerIndicator @[fun_prop] lemma measurable_oldPartnerIndicator (n k : ℕ) (h : ℝ) (r : Fin n) : Measurable (fun zz : Dataset n × O => partnerIndicator n k h zz.1 r (zz.1 r)) := by fun_prop
CausalSmith.Stat.PrivateCateRoughdesign.measurable_oldPartnerIndicator · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PartnerVariance.lean:344
theorem oldPartnerIndicator_integrable

The old-record partner indicator is integrable under any finite pair measure. The displayed conclusion follows.

Formal statement
n k :
ℕ
h :
ℝ
r :
Fin n
Integrable (fun zz => partnerIndicator n k h zz.1 r (zz.1 r)) Q
Proof (Lean source)
-- @node: oldPartnerIndicator_integrable @[fun_prop] lemma oldPartnerIndicator_integrable (n k : ℕ) (h : ℝ) (r : Fin n) (Q : Measure (Dataset n × O)) [IsFiniteMeasure Q] : Integrable (fun zz => partnerIndicator n k h zz.1 r (zz.1 r)) Q := by apply Integrable.of_bound (measurable_oldPartnerIndicator n k h r |>.aestronglyMeasurable) 1 exact ae_of_all _ (fun zz => by rcases partnerIndicator_values n k h zz.1 r (zz.1 r) with hz | hz <;> simp [hz])
CausalSmith.Stat.PrivateCateRoughdesign.oldPartnerIndicator_integrable · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PartnerVariance.lean:350
theorem integrable_cell_partner_indicators Lemma integrable_cell_partner_indicators in the paper ↗

Cellwise partner indicators are integrable for any finite pair measure. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
r :
Fin n
j :
Fin k
conclusion 1
Integrable (fun zz : Dataset n × O => if (zz.1 r).1 ∈ cell h k j ∧ ∃ i, i ≠ r ∧ (zz.1 i).1 ∈ cell h k j then (1 : ℝ) else 0) Q
conclusion 2
Integrable (fun zz : Dataset n × O => if zz.2.1 ∈ cell h k j ∧ ∃ i, i ≠ r ∧ (zz.1 i).1 ∈ cell h k j then (1 : ℝ) else 0) Q
Proof (Lean source)
-- @node: integrable_cell_partner_indicators lemma integrable_cell_partner_indicators (n k : ℕ) (h : ℝ) (r : Fin n) (j : Fin k) (Q : Measure (Dataset n × O)) [IsFiniteMeasure Q] : Integrable (fun zz : Dataset n × O => if (zz.1 r).1 ∈ cell h k j ∧ ∃ i, i ≠ r ∧ (zz.1 i).1 ∈ cell h k j then (1 : ℝ) else 0) Q ∧ Integrable (fun zz : Dataset n × O => if zz.2.1 ∈ cell h k j ∧ ∃ i, i ≠ r ∧ (zz.1 i).1 ∈ cell h k j then (1 : ℝ) else 0) Q := by let s : Set O := {z | z.1 ∈ cell h k j} have hs : MeasurableSet s := (measurableSet_cell h k j).preimage measurable_fst have hp := measurableSet_has_partner n r s hs have hor : MeasurableSet {D : Dataset n | D r ∈ s} := hs.preimage (measurable_pi_apply r) have ho : MeasurableSet {zz : Dataset n × O | (zz.1 r) ∈ s ∧ ∃ i, i ≠ r ∧ zz.1 i ∈ s} := (hor.inter hp).preimage measurable_fst have hn : MeasurableSet {zz : Dataset n × O | zz.2 ∈ s ∧ ∃ i, i ≠ r ∧ zz.1 i ∈ s} := (hs.preimage measurable_snd).inter (hp.preimage measurable_fst) constructor · apply Integrable.of_bound (measurable_const.ite ho measurable_const).aestronglyMeasurable 1 exact ae_of_all _ (fun zz => by split_ifs <;> norm_num) · apply Integrable.of_bound (measurable_const.ite hn measurable_const).aestronglyMeasurable 1 exact ae_of_all _ (fun zz => by split_ifs <;> norm_num)
CausalSmith.Stat.PrivateCateRoughdesign.integrable_cell_partner_indicators · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PartnerVariance.lean:360
theorem iid_partner_expectations

Each of the two partner indicators has mean W/n under the iid law and its independent copy. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
hn :
0 < n
hh :
0 < h
hk :
0 < k
P :
r :
Fin n
conclusion 1
(∫ zz : Dataset n × O, partnerIndicator n k h zz.1 r (zz.1 r) ∂((dataLaw n P).prod (Pobs P)))
= Wocc n h k P / n
conclusion 2
(∫ zz : Dataset n × O, partnerIndicator n k h zz.1 r zz.2 ∂((dataLaw n P).prod (Pobs P)))
= Wocc n h k P / n
Proof (Lean source)
-- @node: iid_partner_expectations lemma iid_partner_expectations (n k : ℕ) (h : ℝ) (hn : 0 < n) (hh : 0 < h) (hk : 0 < k) (P : CausalLaw) (r : Fin n) : (∫ zz : Dataset n × O, partnerIndicator n k h zz.1 r (zz.1 r) ∂((dataLaw n P).prod (Pobs P))) = Wocc n h k P / n ∧ (∫ zz : Dataset n × O, partnerIndicator n k h zz.1 r zz.2 ∂((dataLaw n P).prod (Pobs P))) = Wocc n h k P / n := by classical let : IsProbabilityMeasure (Pobs P) := Measure.isProbabilityMeasure_map measurable_observe.aemeasurable let : IsProbabilityMeasure (dataLaw n P) := by unfold dataLaw; infer_instance have hw : (∑ j : Fin k, cellMass h k P j * (1 - (1 - cellMass h k P j)^(n - 1))) = Wocc n h k P / n := by have hnR : (n : ℝ) ≠ 0 := by exact_mod_cast hn.ne' unfold Wocc occupancyWeight simp only [mul_assoc, ← Finset.mul_sum] field_simp constructor · simp_rw [partnerIndicator_eq_sum n k h hh hk] rw [integral_finset_sum _ (fun j _ => (integrable_cell_partner_indicators n k h r j _).1)] calc _ = ∑ j : Fin k, cellMass h k P j * (1 - (1 - cellMass h k P j)^(n - 1)) := by apply Finset.sum_congr rfl intro j hj exact (integral_cell_partner_indicators n k h P r j).1 _ = _ := hw · simp_rw [partnerIndicator_eq_sum n k h hh hk] rw [integral_finset_sum _ (fun j _ => (integrable_cell_partner_indicators n k h r j _).2)] calc _ = ∑ j : Fin k, cellMass h k P j * (1 - (1 - cellMass h k P j)^(n - 1)) := by apply Finset.sum_congr rfl intro j hj exact (integral_cell_partner_indicators n k h P r j).2 _ = _ := hw
CausalSmith.Stat.PrivateCateRoughdesign.iid_partner_expectations · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PartnerVariance.lean:384
theorem iid_partner_sum_expectation

The old-plus-new partner expectation is exactly twice W/n. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
hn :
0 < n
hh :
0 < h
hk :
0 < k
P :
r :
Fin n
(∫ zz : Dataset n × O, (partnerIndicator n k h zz.1 r (zz.1 r) + partnerIndicator n k h zz.1 r zz.2) ∂((dataLaw n P).prod (Pobs P)))
= 2 * Wocc n h k P / n
Proof (Lean source)
-- @node: iid_partner_sum_expectation lemma iid_partner_sum_expectation (n k : ℕ) (h : ℝ) (hn : 0 < n) (hh : 0 < h) (hk : 0 < k) (P : CausalLaw) (r : Fin n) : (∫ zz : Dataset n × O, (partnerIndicator n k h zz.1 r (zz.1 r) + partnerIndicator n k h zz.1 r zz.2) ∂((dataLaw n P).prod (Pobs P))) = 2 * Wocc n h k P / n := by let : IsProbabilityMeasure (Pobs P) := Measure.isProbabilityMeasure_map measurable_observe.aemeasurable let : IsProbabilityMeasure (dataLaw n P) := by unfold dataLaw; infer_instance obtain ⟨ho, hn'⟩ := iid_partner_expectations n k h hn hh hk P r rw [integral_add (oldPartnerIndicator_integrable n k h r _) (partnerIndicator_integrable n k h r _), ho, hn'] ring
CausalSmith.Stat.PrivateCateRoughdesign.iid_partner_sum_expectation · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PartnerVariance.lean:424
theorem statistic_replacement_moments_of_partners

Integrating the deterministic squared replacement bound reduces both second moments to the common old-plus-new partner expectation. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
n k :
ℕ
h :
ℝ
hh :
0 < h
hk :
0 < k
P :
r :
Fin n
hpartners :
(∫ zz : Dataset n × O, (partnerIndicator n k h zz.1 r (zz.1 r) + partnerIndicator n k h zz.1 r zz.2) ∂((dataLaw n P).prod (Pobs P)))
= 2 * Wocc n h k P / n
conclusion 1
(∫ zz, (SN n h k zz.1 - SN n h k (update zz.1 r zz.2))^2 ∂((dataLaw n P).prod (Pobs P)))
≤ 36 * Wocc n h k P / n
conclusion 2
(∫ zz, (SD n h k zz.1 - SD n h k (update zz.1 r zz.2))^2 ∂((dataLaw n P).prod (Pobs P)))
≤ 36 * Wocc n h k P / n
Proof (Lean source)
-- @node: statistic_replacement_moments_of_partners lemma statistic_replacement_moments_of_partners (n k : ℕ) (h : ℝ) (hh : 0 < h) (hk : 0 < k) (P : CausalLaw) (r : Fin n) (hpartners : (∫ zz : Dataset n × O, (partnerIndicator n k h zz.1 r (zz.1 r) + partnerIndicator n k h zz.1 r zz.2) ∂((dataLaw n P).prod (Pobs P))) = 2 * Wocc n h k P / n) : (∫ zz, (SN n h k zz.1 - SN n h k (update zz.1 r zz.2))^2 ∂((dataLaw n P).prod (Pobs P))) ≤ 36 * Wocc n h k P / n ∧ (∫ zz, (SD n h k zz.1 - SD n h k (update zz.1 r zz.2))^2 ∂((dataLaw n P).prod (Pobs P))) ≤ 36 * Wocc n h k P / n := by let : IsProbabilityMeasure (Pobs P) := Measure.isProbabilityMeasure_map measurable_observe.aemeasurable let : IsProbabilityMeasure (dataLaw n P) := by unfold dataLaw; infer_instance obtain ⟨hiN, hiD⟩ := statistic_replacement_square_integrable n k h hh hk r ((dataLaw n P).prod (Pobs P)) have hi : Integrable (fun zz : Dataset n × O => 18 * (partnerIndicator n k h zz.1 r (zz.1 r) + partnerIndicator n k h zz.1 r zz.2)) ((dataLaw n P).prod (Pobs P)) := by fun_prop have he : (∫ zz : Dataset n × O, 18 * (partnerIndicator n k h zz.1 r (zz.1 r) + partnerIndicator n k h zz.1 r zz.2) ∂((dataLaw n P).prod (Pobs P))) = 36 * Wocc n h k P / n := by rw [integral_const_mul, hpartners] ring constructor · calc _ ≤ _ := integral_mono hiN hi (fun zz => (statistic_partner_square_bound n k h hh hk zz.1 r zz.2).1) _ = _ := he · calc _ ≤ _ := integral_mono hiD hi (fun zz => (statistic_partner_square_bound n k h hh hk zz.1 r zz.2).2) _ = _ := he
CausalSmith.Stat.PrivateCateRoughdesign.statistic_replacement_moments_of_partners · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PartnerVariance.lean:439
theorem statistic_efronStein_assembly

Efron--Stein converts the two occupancy-weighted replacement second-moment estimates into the asserted variance bound. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
efronStein_of_gate :
n k :
ℕ
h :
ℝ
hn :
0 < n
hk :
0 < k
hh :
0 < h
P :
hstep :
∀ r : Fin n,
(∫ zz, (SN n h k zz.1 - SN n h k (update zz.1 r zz.2))^2 ∂((dataLaw n P).prod (Pobs P)))
≤ 36 * Wocc n h k P / n ∧
(∫ zz, (SD n h k zz.1 - SD n h k (update zz.1 r zz.2))^2 ∂((dataLaw n P).prod (Pobs P)))
≤ 36 * Wocc n h k P / n
max (variance (SN n h k) (dataLaw n P)) (variance (SD n h k) (dataLaw n P))
≤ 18 * Wocc n h k P
Proof (Lean source)
-- @node: statistic_efronStein_assembly lemma statistic_efronStein_assembly (efronStein_of_gate : EfronSteinReplacement) (n k : ℕ) (h : ℝ) (hn : 0 < n) (hk : 0 < k) (hh : 0 < h) (P : CausalLaw) (hstep : ∀ r : Fin n, (∫ zz, (SN n h k zz.1 - SN n h k (update zz.1 r zz.2))^2 ∂((dataLaw n P).prod (Pobs P))) ≤ 36 * Wocc n h k P / n ∧ (∫ zz, (SD n h k zz.1 - SD n h k (update zz.1 r zz.2))^2 ∂((dataLaw n P).prod (Pobs P))) ≤ 36 * Wocc n h k P / n) : max (variance (SN n h k) (dataLaw n P)) (variance (SD n h k) (dataLaw n P)) ≤ 18 * Wocc n h k P := by let : IsProbabilityMeasure (Pobs P) := Measure.isProbabilityMeasure_map measurable_observe.aemeasurable let : IsProbabilityMeasure (dataLaw n P) := by unfold dataLaw; infer_instance have hLp := statistic_memLp n k h hh hk (dataLaw n P) 2 have hN := efronStein_of_gate n (fun _ => O) (fun _ => inferInstance) (fun _ => Pobs P) (fun _ => inferInstance) (SN n h k) (by fun_prop) hLp.1 have hD := efronStein_of_gate n (fun _ => O) (fun _ => inferInstance) (fun _ => Pobs P) (fun _ => inferInstance) (SD n h k) (by fun_prop) hLp.2 have hsN := Finset.sum_le_sum (s := univ) (fun r _ => (hstep r).1) have hsD := Finset.sum_le_sum (s := univ) (fun r _ => (hstep r).2) have hnR : (n : ℝ) ≠ 0 := by exact_mod_cast hn.ne' have heq : (∑ _ : Fin n, 36 * Wocc n h k P / (n : ℝ)) = 36 * Wocc n h k P := by simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] field_simp rw [heq] at hsN hsD dsimp only [dataLaw] at hsN hsD apply max_le · exact hN.trans (by linarith) · exact hD.trans (by linarith)
CausalSmith.Stat.PrivateCateRoughdesign.statistic_efronStein_assembly · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PartnerVariance.lean:474
theorem all_count_stability

Sensitivity includes every input and every occupancy; iid variance on the complete model is controlled by the population occupancy weight. The replacement-copy inequality is an explicit assumed gate. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
efronStein_of_gate :
n k :
ℕ
h :
ℝ
hn :
2 ≤ n
hk :
2 ≤ k
hh :
0 < h ∧ h ≤ 1 / 4
P :
Q :
hiid :
hP :
conclusion 1
D Dprime :
dHam n D Dprime = 1
|SN n h k D - SN n h k Dprime| + |SD n h k D - SD n h k Dprime| ≤ 12
conclusion 2
max (variance (SN n h k) Q) (variance (SD n h k) Q) ≤ 18*Wocc n h k P
Proof (Lean source)
-- @node: lem:all-count-stability lemma all_count_stability (efronStein_of_gate : EfronSteinReplacement) (n k : ℕ) (h : ℝ) (hn : 2 ≤ n) (hk : 2 ≤ k) (hh : 0 < h ∧ h ≤ 1 / 4) (P : CausalLaw) (Q : Measure (Dataset n)) (hiid : IIDSampling n P Q) (hP : CompleteModel P) : (∀ D Dprime : Dataset n, dHam n D Dprime = 1 → |SN n h k D - SN n h k Dprime| + |SD n h k D - SD n h k Dprime| ≤ 12) ∧ max (variance (SN n h k) Q) (variance (SD n h k) Q) ≤ 18*Wocc n h k P := by constructor · intro D Dprime hadj exact statistic_hamming_sensitivity n k h hh.1 (by omega) D Dprime hadj · -- The iid product calculation gives both old and new partner expectations. have hpartners : ∀ r : Fin n, (∫ zz : Dataset n × O, (partnerIndicator n k h zz.1 r (zz.1 r) + partnerIndicator n k h zz.1 r zz.2) ∂((dataLaw n P).prod (Pobs P))) = 2 * Wocc n h k P / n := by intro r exact iid_partner_sum_expectation n k h (by omega) hh.1 (by omega) P r have hvariance := statistic_efronStein_assembly efronStein_of_gate n k h (by omega) (by omega) hh.1 P (fun r => statistic_replacement_moments_of_partners n k h hh.1 (by omega) P r (hpartners r)) rw [show Q = dataLaw n P from hiid] exact hvariance
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.PointVersion 26 declarations Continuity selects the uniquely identified point-CATE representative from the observed law.

Continuity selects the uniquely identified point-CATE representative from the observed law.

theorem contrast_lipschitzWith

The model's contrast modulus is an ordinary Lipschitz bound. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
LipschitzWith 3 (tau P)
Proof (Lean source)
-- @node: contrast_lipschitzWith lemma contrast_lipschitzWith (P : CausalLaw) (hP : CompleteModel P) : LipschitzWith 3 (tau P) := by apply LipschitzWith.of_dist_le_mul intro x y simpa only [Real.dist_eq, Subtype.dist_eq, NNReal.coe_ofNat, L] using hP.contrast_lipschitz x y
CausalSmith.Stat.PrivateCateRoughdesign.contrast_lipschitzWith · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PointVersion.lean:13
theorem continuous_tau

The selected contrast is continuous under the complete model. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
Continuous (tau P)
Proof (Lean source)
-- @node: continuous_tau @[fun_prop] lemma continuous_tau (P : CausalLaw) (hP : CompleteModel P) : Continuous (tau P) := by exact (contrast_lipschitzWith P hP).continuous
theorem volume_absolutelyContinuous_PX

The positive design density transfers design-null sets to Lebesgue-null sets. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
(volume : Measure Covariate) ≪ PX P
Proof (Lean source)
-- @node: volume_absolutelyContinuous_PX lemma volume_absolutelyContinuous_PX (P : CausalLaw) (hP : CompleteModel P) : (volume : Measure Covariate) ≪ PX P := by rw [PX, P.density_version hP.density.1] apply withDensity_absolutelyContinuous' · exact (ENNReal.measurable_ofReal.comp P.f_measurable).aemeasurable · filter_upwards [hP.density.2] with x hx exact ENNReal.ofReal_ne_zero_iff.mpr (lt_of_lt_of_le (by norm_num) hx.1)
CausalSmith.Stat.PrivateCateRoughdesign.volume_absolutelyContinuous_PX · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PointVersion.lean:28
theorem continuous_eq_of_volume_ae_eq Lemma continuous_eq_of_volume_ae_eq in the paper ↗

Continuous functions on the unit interval that agree Lebesgue-almost everywhere agree at every point, including the two boundary points. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
v w :
Covariate → ℝ
hv :
hw :
heq :
v =ᵐ[volume] w
v = w
Proof (Lean source)
-- @node: continuous_eq_of_volume_ae_eq lemma continuous_eq_of_volume_ae_eq {v w : Covariate → ℝ} (hv : Continuous v) (hw : Continuous w) (heq : v =ᵐ[volume] w) : v = w := by let c : ℝ → Covariate := projIcc 0 1 (by norm_num) have hc : Continuous c := by fun_prop have hae : (v ∘ c) =ᵐ[(volume : Measure ℝ).restrict (Icc 0 1)] (w ∘ c) := by rw [← unitInterval.measurePreserving_coe.map_eq] apply (ae_map_iff (by fun_prop) (isClosed_eq (hv.comp hc) (hw.comp hc)).measurableSet).mpr filter_upwards [heq] with x hx simpa [c, projIcc_of_mem (by norm_num : (0 : ℝ) ≤ 1) x.property] using hx have hevery := Measure.eqOn_Icc_of_ae_eq (volume : Measure ℝ) (by norm_num : (0 : ℝ) ≠ 1) hae (hv.comp hc).continuousOn (hw.comp hc).continuousOn funext x simpa [c, projIcc_of_mem (by norm_num : (0 : ℝ) ≤ 1) x.property] using hevery x.property
CausalSmith.Stat.PrivateCateRoughdesign.continuous_eq_of_volume_ae_eq · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PointVersion.lean:38
theorem continuous_tau_unique

Positive design density makes the continuous representative of the contrast unique. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
P :
hP :
v :
Covariate → ℝ
hv :
heq :
v =ᵐ[PX P] tau P
v = tau P
Proof (Lean source)
-- @node: continuous_tau_unique lemma continuous_tau_unique (P : CausalLaw) (hP : CompleteModel P) (v : Covariate → ℝ) (hv : Continuous v) (heq : v =ᵐ[PX P] tau P) : v = tau P := by exact continuous_eq_of_volume_ae_eq hv (continuous_tau P hP) ((volume_absolutelyContinuous_PX P hP).ae_eq heq)
CausalSmith.Stat.PrivateCateRoughdesign.continuous_tau_unique · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PointVersion.lean:56

The treatment coordinate is measurable. The displayed conclusion follows.

Formal statement
Proof (Lean source)
-- @node: measurable_A @[fun_prop] lemma measurable_A : Measurable A := by unfold A; fun_prop

The observed outcome coordinate is measurable. The displayed conclusion follows.

Formal statement
Proof (Lean source)
-- @node: measurable_Y @[fun_prop] lemma measurable_Y : Measurable Y := by unfold Y; fun_prop

Each treatment-arm event is measurable. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
d :
MeasurableSet {z : Record | A z = d}
Proof (Lean source)
-- @node: arm_event_measurable lemma arm_event_measurable (d : Bool) : MeasurableSet {z : Record | A z = d} := by exact measurableSet_eq_fun measurable_A measurable_const
CausalSmith.Stat.PrivateCateRoughdesign.arm_event_measurable · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PointVersion.lean:76
theorem arm_design_apply

The arm-specific design measure evaluates a covariate set as its joint arm event. the theorem's stated inputs and assumptions, and the asserted conclusion follows.

Formal statement
((P.law.restrict {z | A z = d}).map X) s = P.law {z | X z ∈ s ∧ A z = d}
Proof (Lean source)
-- @node: arm_design_apply lemma arm_design_apply (P : CausalLaw) (d : Bool) (s : Set Covariate) (hs : MeasurableSet s) : ((P.law.restrict {z | A z = d}).map X) s = P.law {z | X z ∈ s ∧ A z = d} := by rw [Measure.map_apply measurable_X hs, Measure.restrict_apply (measurable_X hs)] rfl
theorem arm_prob_setIntegral

The selected propensity and its complement integrate to the two arm probabilities. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
∫ x in s, (if d then P.e x else 1 - P.e x) ∂PX P = P.law.real {z | X z ∈ s ∧ A z = d}
Proof (Lean source)
-- @node: arm_prob_setIntegral lemma arm_prob_setIntegral (P : CausalLaw) (d : Bool) (s : Set Covariate) (hs : MeasurableSet s) : ∫ x in s, (if d then P.e x else 1 - P.e x) ∂PX P = P.law.real {z | X z ∈ s ∧ A z = d} := by let : IsProbabilityMeasure (PX P) := Measure.isProbabilityMeasure_map measurable_X.aemeasurable have he : Integrable P.e (PX P) := P.e_integrable cases d · have hpartition : (X ⁻¹' s) = {z | X z ∈ s ∧ A z = false} ∪ {z | X z ∈ s ∧ A z = true} := by ext z cases h : A z <;> simp [h] have hd : Disjoint {z | X z ∈ s ∧ A z = false} {z | X z ∈ s ∧ A z = true} := by rw [Set.disjoint_left] intro z hz hz' exact Bool.false_ne_true (hz.2.symm.trans hz'.2) have ht : MeasurableSet {z | X z ∈ s ∧ A z = true} := (measurable_X hs).inter (arm_event_measurable true) have hm : (PX P).real s = P.law.real {z | X z ∈ s ∧ A z = false} + P.law.real {z | X z ∈ s ∧ A z = true} := by rw [PX, measureReal_def, Measure.map_apply measurable_X hs, hpartition, ← measureReal_def, measureReal_union hd ht] simp only [Bool.false_eq_true, if_false] rw [integral_sub (integrable_const _).integrableOn he.integrableOn, setIntegral_const, smul_eq_mul, mul_one] have hv : ∫ x in s, P.e x ∂PX P = P.law.real {z | X z ∈ s ∧ A z = true} := P.e_version s hs linarith · exact P.e_version s hs
CausalSmith.Stat.PrivateCateRoughdesign.arm_prob_setIntegral · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PointVersion.lean:89
theorem PX_absolutelyContinuous_arm

Overlap transfers arm-specific null sets to design null sets. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
P :
hP :
d :
PX P ≪ (P.law.restrict {z | A z = d}).map X
Proof (Lean source)
-- @node: PX_absolutelyContinuous_arm lemma PX_absolutelyContinuous_arm (P : CausalLaw) (hP : CompleteModel P) (d : Bool) : PX P ≪ (P.law.restrict {z | A z = d}).map X := by let : IsProbabilityMeasure (PX P) := Measure.isProbabilityMeasure_map measurable_X.aemeasurable apply Measure.AbsolutelyContinuous.mk intro s hs hz have hzero : P.law.real {z | X z ∈ s ∧ A z = d} = 0 := by rw [measureReal_def, ← arm_design_apply P d s hs, hz, ENNReal.toReal_zero] have hi : Integrable (fun x => if d then P.e x else 1 - P.e x) (PX P) := by cases d · exact (integrable_const _).sub P.e_integrable · exact P.e_integrable have hl : ∫ x in s, (1/4 : ℝ) ∂PX P ≤ ∫ x in s, (if d then P.e x else 1 - P.e x) ∂PX P := by apply integral_mono_ae (integrable_const _) hi.integrableOn filter_upwards with x cases d <;> simp only [Bool.false_eq_true, if_false, if_true] · linarith [(hP.overlap x).2] · exact (hP.overlap x).1 rw [arm_prob_setIntegral P d s hs, hzero, setIntegral_const, smul_eq_mul] at hl have hr : (PX P).real s = 0 := by have := measureReal_nonneg (μ := PX P) (s := s) nlinarith exact (ENNReal.toReal_eq_zero_iff (PX P s)).mp hr |>.resolve_right (measure_ne_top _ _)
CausalSmith.Stat.PrivateCateRoughdesign.PX_absolutelyContinuous_arm · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PointVersion.lean:121
theorem continuous_mu0

The control Holder modulus gives continuity of the selected control mean. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
Proof (Lean source)
-- @node: continuous_mu0 @[fun_prop] lemma continuous_mu0 (P : CausalLaw) (hP : CompleteModel P) : Continuous P.mu0 := by have hh : HolderWith 3 (1/10 : ℝ≥0) P.mu0 := by intro x y rw [edist_dist, edist_dist] have hr := hP.control_holder x y have hn : (0 : ℝ) ≤ 1/10 := by norm_num have he := ENNReal.ofReal_le_ofReal hr simpa only [L, ← Real.dist_eq, ← Subtype.dist_eq, ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 3), ENNReal.ofReal_rpow_of_nonneg (dist_nonneg : 0 ≤ dist x y) hn, ENNReal.ofReal_ofNat, NNReal.coe_div, NNReal.coe_one, NNReal.coe_ofNat, ENNReal.coe_ofNat] using he exact hh.continuous (by norm_num)
theorem continuous_mu1

Continuity of the control mean and contrast gives continuity of the treated mean. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
Proof (Lean source)
-- @node: continuous_mu1 @[fun_prop] lemma continuous_mu1 (P : CausalLaw) (hP : CompleteModel P) : Continuous P.mu1 := by have hid : P.mu1 = fun x => P.mu0 x + tau P x := by funext x simp [tau] rw [hid] exact (continuous_mu0 P hP).add (continuous_tau P hP)
theorem arm_mean_ae_mem_Icc

The observed binary response bounds each selected arm mean almost everywhere. The displayed conclusion follows.

Formal statement
P :
d :
∀ᵐ x ∂((P.law.restrict {z | A z = d}).map X), (if d then P.mu1 x else P.mu0 x) ∈ Icc (0 : ℝ) 1
Proof (Lean source)
-- @node: arm_mean_ae_mem_Icc lemma arm_mean_ae_mem_Icc (P : CausalLaw) (d : Bool) : ∀ᵐ x ∂((P.law.restrict {z | A z = d}).map X), (if d then P.mu1 x else P.mu0 x) ∈ Icc (0 : ℝ) 1 := by have hi : Integrable (fun x => if d then P.mu1 x else P.mu0 x) ((P.law.restrict {z | A z = d}).map X) := by cases d · exact P.mu0_integrable · exact P.mu1_integrable have hv (s : Set Covariate) (hs : MeasurableSet s) : ∫ x in s, (if d then P.mu1 x else P.mu0 x) ∂((P.law.restrict {z | A z = d}).map X) = ∫ z in {z | X z ∈ s ∧ A z = d}, bit (Y z) ∂P.law := by cases d · exact P.mu0_version s hs · exact P.mu1_version s hs have hlo : 0 ≤ᵐ[((P.law.restrict {z | A z = d}).map X)] (fun x => if d then P.mu1 x else P.mu0 x) := by apply ae_nonneg_of_forall_setIntegral_nonneg hi intro s hs _ rw [hv s hs] apply integral_nonneg intro z simp only [bit] split_ifs <;> norm_num have hup : (fun x => if d then P.mu1 x else P.mu0 x) ≤ᵐ[ ((P.law.restrict {z | A z = d}).map X)] (fun _ => (1 : ℝ)) := by apply ae_le_of_forall_setIntegral_le hi (integrable_const _) intro s hs _ rw [hv s hs, setIntegral_const, smul_eq_mul, mul_one, measureReal_def, arm_design_apply P d s hs, ← measureReal_def, ← setIntegral_one_eq_measureReal] apply integral_mono_ae · apply Integrable.of_mem_Icc 0 1 (by fun_prop) filter_upwards with z simp only [bit] split_ifs <;> norm_num · exact integrable_const _ · filter_upwards with z simp only [bit] split_ifs <;> norm_num filter_upwards [hlo, hup] with x hx hy exact ⟨hx, hy⟩
CausalSmith.Stat.PrivateCateRoughdesign.arm_mean_ae_mem_Icc · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PointVersion.lean:174
theorem arm_mean_mem_Icc

Continuity and positive arm support extend the binary mean bounds to every covariate. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
P :
hP :
d :
x :
(if d then P.mu1 x else P.mu0 x) ∈ Icc (0 : ℝ) 1
Proof (Lean source)
-- @node: arm_mean_mem_Icc lemma arm_mean_mem_Icc (P : CausalLaw) (hP : CompleteModel P) (d : Bool) (x : Covariate) : (if d then P.mu1 x else P.mu0 x) ∈ Icc (0 : ℝ) 1 := by let m : Covariate → ℝ := fun x => if d then P.mu1 x else P.mu0 x have hc : Continuous m := by cases d · exact continuous_mu0 P hP · exact continuous_mu1 P hP have hae : ∀ᵐ x ∂(volume : Measure Covariate), m x ∈ Icc (0 : ℝ) 1 := ((volume_absolutelyContinuous_PX P hP).trans (PX_absolutelyContinuous_arm P hP d)).ae_le (arm_mean_ae_mem_Icc P d) have heq : m = fun x => max 0 (min 1 (m x)) := by apply continuous_eq_of_volume_ae_eq hc (by fun_prop) filter_upwards [hae] with x hx rw [min_eq_right hx.2, max_eq_right hx.1] change m x ∈ Icc (0 : ℝ) 1 rw [congrFun heq x] exact ⟨le_max_left _ _, max_le (by norm_num) (min_le_left _ _)⟩
theorem theta_mem_Icc

The difference of the two binary arm means bounds the point target between minus one and one. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
theta P ∈ Icc (-1 : ℝ) 1
Proof (Lean source)
-- @node: theta_mem_Icc lemma theta_mem_Icc (P : CausalLaw) (hP : CompleteModel P) : theta P ∈ Icc (-1 : ℝ) 1 := by have h0 := arm_mean_mem_Icc P hP false x0 have h1 := arm_mean_mem_Icc P hP true x0 simp only [Bool.false_eq_true, if_false, if_true] at h0 h1 change P.mu1 x0 - P.mu0 x0 ∈ Icc (-1 : ℝ) 1 constructor <;> linarith [h0.1, h0.2, h1.1, h1.2]

The observation map is measurable. The displayed conclusion follows.

Formal statement
Measurable observe
Proof (Lean source)
-- @node: measurable_observe @[fun_prop] lemma measurable_observe : Measurable observe := by unfold observe fun_prop
CausalSmith.Stat.PrivateCateRoughdesign.measurable_observe · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PointVersion.lean:247
theorem arm_design_eq_observed

The observed marginal determines each arm-specific covariate measure. The displayed conclusion follows.

Formal statement
P :
d :
(P.law.restrict {z | A z = d}).map X
= ((Pobs P).restrict {z : O | z.2.1 = d}).map fst
Proof (Lean source)
-- @node: arm_design_eq_observed lemma arm_design_eq_observed (P : CausalLaw) (d : Bool) : (P.law.restrict {z | A z = d}).map X = ((Pobs P).restrict {z : O | z.2.1 = d}).map fst := by rw [Pobs, Measure.restrict_map measurable_observe (measurableSet_eq_fun (by fun_prop) measurable_const), Measure.map_map measurable_fst measurable_observe] rfl
CausalSmith.Stat.PrivateCateRoughdesign.arm_design_eq_observed · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PointVersion.lean:253
theorem observed_arm_outcome_integral

The observed marginal determines the response integral on every joint covariate-arm event. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
∫ z in {z | X z ∈ s ∧ A z = d}, bit (Y z) ∂P.law
= ∫ z in {z : O | z.1 ∈ s ∧ z.2.1 = d}, bit z.2.2 ∂Pobs P
Proof (Lean source)
-- @node: observed_arm_outcome_integral lemma observed_arm_outcome_integral (P : CausalLaw) (d : Bool) (s : Set Covariate) (hs : MeasurableSet s) : ∫ z in {z | X z ∈ s ∧ A z = d}, bit (Y z) ∂P.law = ∫ z in {z : O | z.1 ∈ s ∧ z.2.1 = d}, bit z.2.2 ∂Pobs P := by have ht : MeasurableSet {z : O | z.1 ∈ s ∧ z.2.1 = d} := (hs.preimage measurable_fst).inter (measurableSet_eq_fun (by fun_prop) measurable_const) rw [Pobs, setIntegral_map ht (by fun_prop) measurable_observe.aemeasurable] rfl
CausalSmith.Stat.PrivateCateRoughdesign.observed_arm_outcome_integral · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PointVersion.lean:263
theorem arm_mean_eq_of_observed_eq

Equal observed laws have identical continuous arm-mean versions at every covariate. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
P P' :
hP :
hP' :
hobs :
Pobs P' = Pobs P
d :
(fun x => if d then P'.mu1 x else P'.mu0 x) = (fun x => if d then P.mu1 x else P.mu0 x)
Proof (Lean source)
-- @node: arm_mean_eq_of_observed_eq lemma arm_mean_eq_of_observed_eq (P P' : CausalLaw) (hP : CompleteModel P) (hP' : CompleteModel P') (hobs : Pobs P' = Pobs P) (d : Bool) : (fun x => if d then P'.mu1 x else P'.mu0 x) = (fun x => if d then P.mu1 x else P.mu0 x) := by have hmeasure : (P'.law.restrict {z | A z = d}).map X = (P.law.restrict {z | A z = d}).map X := by rw [arm_design_eq_observed P' d, arm_design_eq_observed P d, hobs] have hi (R : CausalLaw) : Integrable (fun x => if d then R.mu1 x else R.mu0 x) ((R.law.restrict {z | A z = d}).map X) := by cases d · exact R.mu0_integrable · exact R.mu1_integrable have hv (R : CausalLaw) (s : Set Covariate) (hs : MeasurableSet s) : ∫ x in s, (if d then R.mu1 x else R.mu0 x) ∂((R.law.restrict {z | A z = d}).map X) = ∫ z in {z : O | z.1 ∈ s ∧ z.2.1 = d}, bit z.2.2 ∂Pobs R := by rw [← observed_arm_outcome_integral R d s hs] cases d · exact R.mu0_version s hs · exact R.mu1_version s hs have hae : (fun x => if d then P'.mu1 x else P'.mu0 x) =ᵐ[ ((P.law.restrict {z | A z = d}).map X)] (fun x => if d then P.mu1 x else P.mu0 x) := by apply Integrable.ae_eq_of_forall_setIntegral_eq · rw [← hmeasure] exact hi P' · exact hi P · intro s hs _ rw [← hmeasure, hv P' s hs, hmeasure, hv P s hs, hobs] apply continuous_eq_of_volume_ae_eq · cases d · exact continuous_mu0 P' hP' · exact continuous_mu1 P' hP' · cases d · exact continuous_mu0 P hP · exact continuous_mu1 P hP · exact ((volume_absolutelyContinuous_PX P hP).trans (PX_absolutelyContinuous_arm P hP d)).ae_eq hae
CausalSmith.Stat.PrivateCateRoughdesign.arm_mean_eq_of_observed_eq · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PointVersion.lean:275
theorem theta_eq_of_observed_eq

The observed law identifies the point target through uniqueness of the continuous arm means. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
P P' :
hP :
hP' :
hobs :
Pobs P' = Pobs P
theta P' = theta P
Proof (Lean source)
-- @node: theta_eq_of_observed_eq lemma theta_eq_of_observed_eq (P P' : CausalLaw) (hP : CompleteModel P) (hP' : CompleteModel P') (hobs : Pobs P' = Pobs P) : theta P' = theta P := by have h0 := congrFun (arm_mean_eq_of_observed_eq P P' hP hP' hobs false) x0 have h1 := congrFun (arm_mean_eq_of_observed_eq P P' hP hP' hobs true) x0 simp only [Bool.false_eq_true, if_false, if_true] at h0 h1 change P'.mu1 x0 - P'.mu0 x0 = P.mu1 x0 - P.mu0 x0 rw [h0, h1]
CausalSmith.Stat.PrivateCateRoughdesign.theta_eq_of_observed_eq · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PointVersion.lean:315
theorem arm_design_withDensity

Each arm-specific design measure has the selected arm probability as its density relative to the design. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
P :
hP :
d :
(P.law.restrict {z | A z = d}).map X
= (PX P).withDensity (fun x => ofReal (if d then P.e x else 1-P.e x))
Proof (Lean source)
-- @node: arm_design_withDensity lemma arm_design_withDensity (P : CausalLaw) (hP : CompleteModel P) (d : Bool) : (P.law.restrict {z | A z = d}).map X = (PX P).withDensity (fun x => ofReal (if d then P.e x else 1-P.e x)) := by have hq : Measurable (fun x => if d then P.e x else 1-P.e x) := by have he := P.e_measurable cases d <;> simp only [Bool.false_eq_true, if_false, if_true] <;> fun_prop have hi : Integrable (fun x => if d then P.e x else 1-P.e x) (PX P) := by let : IsProbabilityMeasure (PX P) := Measure.isProbabilityMeasure_map measurable_X.aemeasurable cases d · exact (integrable_const _).sub P.e_integrable · exact P.e_integrable have hn (x : Covariate) : 0 ≤ (if d then P.e x else 1-P.e x) := by cases d <;> simp only [Bool.false_eq_true, if_false, if_true] <;> linarith [(hP.overlap x).1, (hP.overlap x).2] ext s hs rw [withDensity_apply _ hs, ← ofReal_integral_eq_lintegral_ofReal hi.integrableOn (ae_of_all _ hn), arm_prob_setIntegral P d s hs, measureReal_def, ENNReal.ofReal_toReal (measure_ne_top _ _), arm_design_apply P d s hs]
CausalSmith.Stat.PrivateCateRoughdesign.arm_design_withDensity · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PointVersion.lean:325

A measurable binary response is integrable under any finite measure. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
Ω :
b :
Ω → Bool
hb :
Integrable (fun z => bit (b z)) μ
Proof (Lean source)
-- @node: integrable_bit_comp lemma integrable_bit_comp {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsFiniteMeasure μ] (b : Ω → Bool) (hb : Measurable b) : Integrable (fun z => bit (b z)) μ := by apply Integrable.of_mem_Icc 0 1 (by fun_prop) filter_upwards with z simp only [bit] split_ifs <;> norm_num
CausalSmith.Stat.PrivateCateRoughdesign.integrable_bit_comp · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PointVersion.lean:348
theorem arm_conditional_mean

Exchangeability factors the arm-potential product; consistency and overlap identify its conditional mean. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
P :
hP :
d :
P.law[(fun z => bit (if d then (Ypot z).2 else (Ypot z).1)) | comap X inferInstance]
=ᵐ[P.law] (fun z => if d then P.mu1 (X z) else P.mu0 (X z))
Proof (Lean source)
-- @node: arm_conditional_mean lemma arm_conditional_mean (P : CausalLaw) (hP : CompleteModel P) (d : Bool) : P.law[(fun z => bit (if d then (Ypot z).2 else (Ypot z).1)) | comap X inferInstance] =ᵐ[P.law] (fun z => if d then P.mu1 (X z) else P.mu0 (X z)) := by have hσ : comap X inferInstance ≤ (inferInstance : MeasurableSpace Record) := measurable_X.comap_le let q : Covariate → ℝ := fun x => if d then P.e x else 1-P.e x let m : Covariate → ℝ := fun x => if d then P.mu1 x else P.mu0 x let r : Bool → ℝ := fun a => if a = d then 1 else 0 let b : Record → Bool := fun z => if d then (Ypot z).2 else (Ypot z).1 have hq : Measurable q := by have he := P.e_measurable cases d <;> dsimp [q] <;> fun_prop have hm : Measurable m := by cases d <;> dsimp [m] <;> fun_prop have hr : Measurable r := by dsimp [r]; fun_prop have hb : Measurable b := by cases d <;> dsimp [b, Ypot] <;> fun_prop have hqr (x : Covariate) : q x ∈ Icc (0 : ℝ) 1 := by dsimp [q] cases d <;> simp only [Bool.false_eq_true, if_false, if_true] <;> constructor <;> linarith [(hP.overlap x).1, (hP.overlap x).2] have hmr (x : Covariate) : m x ∈ Icc (0 : ℝ) 1 := arm_mean_mem_Icc P hP d x have hqi : Integrable (fun z => q (X z)) P.law := Integrable.of_mem_Icc 0 1 (by fun_prop) (ae_of_all _ (fun z => hqr (X z))) have hqmi : Integrable (fun z => q (X z) * m (X z)) P.law := by apply Integrable.of_mem_Icc 0 1 (by fun_prop) filter_upwards with z exact ⟨mul_nonneg (hqr _).1 (hmr _).1, mul_le_one₀ (hqr _).2 (hmr _).1 (hmr _).2⟩ have hri : Integrable (fun z => r (A z)) P.law := by apply Integrable.of_mem_Icc 0 1 (by fun_prop) filter_upwards with z dsimp [r] split_ifs <;> norm_num have hyi := integrable_bit_comp P.law Y measurable_Y have hbi := integrable_bit_comp P.law b hb have hryi : Integrable (fun z => r (A z) * bit (Y z)) P.law := by have heq : (fun z => r (A z) * bit (Y z)) = {z | A z = d}.indicator (fun z => bit (Y z)) := by funext z simp [r, indicator] rw [heq] exact hyi.indicator (arm_event_measurable d) have harm : P.law[(fun z => r (A z)) | comap X inferInstance] =ᵐ[P.law] fun z => q (X z) := by symm apply ae_eq_condExp_of_forall_setIntegral_eq hσ hri (fun _ _ _ => hqi.integrableOn) · intro s hs _ obtain ⟨t, ht, rfl⟩ := MeasurableSpace.measurableSet_comap.mp hs have hi := setIntegral_map (μ := P.law) ht hq.aestronglyMeasurable measurable_X.aemeasurable have hv := arm_prob_setIntegral P d t ht have heq : (fun z => r (A z)) = {z | A z = d}.indicator (fun _ => (1 : ℝ)) := by funext z simp [r, indicator] rw [heq, setIntegral_indicator (arm_event_measurable d), setIntegral_one_eq_measureReal] exact hi.symm.trans hv · exact (hq.comp (comap_measurable X)).aestronglyMeasurable have hprod : P.law[(fun z => r (A z) * bit (Y z)) | comap X inferInstance] =ᵐ[P.law] fun z => q (X z) * m (X z) := by symm apply ae_eq_condExp_of_forall_setIntegral_eq hσ hryi (fun _ _ _ => hqmi.integrableOn) · intro s hs _ obtain ⟨t, ht, rfl⟩ := MeasurableSpace.measurableSet_comap.mp hs have hi := setIntegral_map (μ := P.law) ht (hq.mul hm).aestronglyMeasurable measurable_X.aemeasurable have hw : ∫ x in t, m x ∂((P.law.restrict {z | A z = d}).map X) = ∫ x in t, q x * m x ∂PX P := by rw [arm_design_withDensity P hP d] change (∫ x in t, m x ∂(PX P).withDensity (ofReal ∘ q)) = _ rw [setIntegral_withDensity_eq_setIntegral_toReal_smul₀ (μ := PX P) (ENNReal.measurable_ofReal.comp hq).aemeasurable (ae_of_all _ (fun x => ENNReal.ofReal_lt_top)) m ht] apply integral_congr_ae filter_upwards with x simp [q, ENNReal.toReal_ofReal (hqr x).1, smul_eq_mul] have hv : ∫ x in t, m x ∂((P.law.restrict {z | A z = d}).map X) = ∫ z in {z | X z ∈ t ∧ A z = d}, bit (Y z) ∂P.law := by cases d · exact P.mu0_version t ht · exact P.mu1_version t ht have heq : (fun z => r (A z) * bit (Y z)) = {z | A z = d}.indicator (fun z => bit (Y z)) := by funext z simp [r, indicator] rw [heq, setIntegral_indicator (arm_event_measurable d)] exact hi.symm.trans (hw.symm.trans hv) · exact ((hq.mul hm).comp (comap_measurable X)).aestronglyMeasurable have hci : CondIndepFun (comap X inferInstance) hσ A b P.law := by cases d · exact hP.exchangeability.symm.comp measurable_id measurable_fst · exact hP.exchangeability.symm.comp measurable_id measurable_snd have hcons : (fun z => r (A z) * bit (Y z)) =ᵐ[P.law] fun z => r (A z) * bit (b z) := by filter_upwards [hP.consistency] with z hz dsimp [r, b] by_cases ha : A z = d · cases d <;> simp_all · simp [ha] have hf := condExp_mul_of_condIndep hσ measurable_A hb hci hr measurable_bit hri hbi (hryi.congr hcons) have hfact := (condExp_congr_ae hcons).trans hf filter_upwards [harm, hprod, hfact] with z ha hp hf simp only [Pi.mul_apply] at hf rw [ha] at hf have hn : q (X z) ≠ 0 := by have hpos : 1/4 ≤ q (X z) := by dsimp [q] cases d <;> simp only [Bool.false_eq_true, if_false, if_true] <;> linarith [(hP.overlap (X z)).1, (hP.overlap (X z)).2] linarith exact mul_left_cancel₀ hn (hf.symm.trans hp)
CausalSmith.Stat.PrivateCateRoughdesign.arm_conditional_mean · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PointVersion.lean:358
theorem tau_conditional_causal_contrast

Conditional-expectation linearity identifies the selected contrast with the conditional causal effect. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
(fun z => tau P (X z))
=ᵐ[P.law] P.law[(fun z => bit (Ypot z).2 - bit (Ypot z).1) | comap X inferInstance]
Proof (Lean source)
-- @node: tau_conditional_causal_contrast lemma tau_conditional_causal_contrast (P : CausalLaw) (hP : CompleteModel P) : (fun z => tau P (X z)) =ᵐ[P.law] P.law[(fun z => bit (Ypot z).2 - bit (Ypot z).1) | comap X inferInstance] := by have h1 := arm_conditional_mean P hP true have h0 := arm_conditional_mean P hP false have hi1 := integrable_bit_comp P.law (fun z => (Ypot z).2) (by unfold Ypot; fun_prop) have hi0 := integrable_bit_comp P.law (fun z => (Ypot z).1) (by unfold Ypot; fun_prop) exact ((condExp_sub hi1 hi0 _).trans (h1.sub h0)).symm
CausalSmith.Stat.PrivateCateRoughdesign.tau_conditional_causal_contrast · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PointVersion.lean:475
theorem point_version

Model regularity selects a unique continuous contrast, bounds the target, and identifies both the conditional causal contrast and its point value from the observed marginal. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
conclusion 1
Continuous (tau P)
conclusion 2
v :
Covariate → ℝ
v =ᵐ[PX P] tau P
v = tau P
conclusion 3
theta P ∈ Icc (-1) 1
conclusion 4
(fun z => tau P (X z))
=ᵐ[P.law] P.law[(fun z => bit (Ypot z).2 - bit (Ypot z).1) | comap X inferInstance]
conclusion 5
P' :
Pobs P' = Pobs P
theta P' = theta P
Proof (Lean source)
-- @node: lem:point-version lemma point_version (P : CausalLaw) (hP : CompleteModel P) : Continuous (tau P) ∧ (∀ v : Covariate → ℝ, Continuous v → v =ᵐ[PX P] tau P → v = tau P) ∧ theta P ∈ Icc (-1) 1 ∧ (fun z => tau P (X z)) =ᵐ[P.law] P.law[(fun z => bit (Ypot z).2 - bit (Ypot z).1) | comap X inferInstance] ∧ (∀ P' : CausalLaw, CompleteModel P' → Pobs P' = Pobs P → theta P' = theta P) := by refine ⟨continuous_tau P hP, ?_, ?_⟩ · intro v hv heq exact continuous_tau_unique P hP v hv heq · refine ⟨theta_mem_Icc P hP, tau_conditional_causal_contrast P hP, ?_⟩ intro P' hP' hobs exact theta_eq_of_observed_eq P P' hP hP' hobs
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.PrivateComparison 9 declarations Private Hamming comparison, unrestricted Markov contraction, and finite-chi-square TV bounds.

Private Hamming comparison, unrestricted Markov contraction, and finite-chi-square TV bounds.

A composed probability kernel evaluates an event by averaging its row probabilities. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
(K ∘ₘ Q).real E = ∫ x, (K x).real E ∂Q
Proof (Lean source)
-- @node: kernel_comp_real lemma kernel_comp_real {α β : Type*} [MeasurableSpace α] [MeasurableSpace β] (K : Kernel α β) [IsMarkovKernel K] (Q : Measure α) [IsProbabilityMeasure Q] (E : Set β) (hE : MeasurableSet E) : (K ∘ₘ Q).real E = ∫ x, (K x).real E ∂Q := by rw [measureReal_def, Measure.bind_apply hE K.aemeasurable] exact (integral_toReal (K.measurable_coe hE).aemeasurable (Filter.Eventually.of_forall fun x => measure_lt_top (K x) E)).symm

Averaging a Markov kernel contracts total variation, by the bounded-function dual bound. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
TV (K ∘ₘ Q) (K ∘ₘ Q') ≤ TV Q Q'
Proof (Lean source)
-- @node: kernel_TV_contraction lemma kernel_TV_contraction {α β : Type*} [MeasurableSpace α] [MeasurableSpace β] (K : Kernel α β) [IsMarkovKernel K] (Q Q' : Measure α) [IsProbabilityMeasure Q] [IsProbabilityMeasure Q'] : TV (K ∘ₘ Q) (K ∘ₘ Q') ≤ TV Q Q' := by refine ciSup_le fun E => ?_ rw [kernel_comp_real K Q E.1 E.2, kernel_comp_real K Q' E.1 E.2] simpa using tvDist_integral_range Q Q' (fun x => (K x).real E.1) (K.measurable_coe E.2).ennreal_toReal 0 1 (by norm_num) (fun x => ⟨measureReal_nonneg, by simp [measureReal_le_one]⟩)
CausalSmith.Stat.PrivateCateRoughdesign.kernel_TV_contraction · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PrivateComparison.lean:20
theorem TV_le_sqrt_chiSq_of_finite Lemma TV_le_sqrt_chiSq_of_finite in the paper ↗

Finite squared density deviation supplies the integrability needed for the chi-square TV bound. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
α :
hac :
Q ≪ Q'
hf :
(∫⁻ z, ofReal (((Q.rnDeriv Q' z).toReal - 1)^2) ∂Q') < ⊤
TV Q Q' ≤ 1/2 * sqrt (chiSqDiv Q Q')
Proof (Lean source)
-- @node: TV_le_sqrt_chiSq_of_finite lemma TV_le_sqrt_chiSq_of_finite {α : Type*} [MeasurableSpace α] (Q Q' : Measure α) [IsProbabilityMeasure Q] [IsProbabilityMeasure Q'] (hac : Q ≪ Q') (hf : (∫⁻ z, ofReal (((Q.rnDeriv Q' z).toReal - 1)^2) ∂Q') < ⊤) : TV Q Q' ≤ 1/2 * sqrt (chiSqDiv Q Q') := by apply tvDist_le_half_sqrt_chiSqDiv Q Q' hac apply (lintegral_ofReal_ne_top_iff_integrable (((Q.measurable_rnDeriv Q').ennreal_toReal.sub_const 1).pow_const 2).aestronglyMeasurable (Filter.Eventually.of_forall fun z => sq_nonneg _)).mp exact hf.ne
CausalSmith.Stat.PrivateCateRoughdesign.TV_le_sqrt_chiSq_of_finite · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PrivateComparison.lean:32
theorem exp_privacy_increment_le Lemma exp_privacy_increment_le in the paper ↗

Convexity on the unit interval bounds the privacy exponential increment. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
epsilon :
ℝ
he :
0 ≤ epsilon ∧ epsilon ≤ 1
exp epsilon - 1 ≤ 2 * epsilon
Proof (Lean source)
-- @node: exp_privacy_increment_le lemma exp_privacy_increment_le (epsilon : ℝ) (he : 0 ≤ epsilon ∧ epsilon ≤ 1) : exp epsilon - 1 ≤ 2 * epsilon := by have hc := convexOn_exp.2 (Set.mem_univ (0 : ℝ)) (Set.mem_univ (1 : ℝ)) (show 0 ≤ 1 - epsilon by linarith) he.1 (show 1 - epsilon + epsilon = 1 by ring) simp only [smul_eq_mul, mul_zero, zero_add, mul_one, Real.exp_zero] at hc nlinarith [Real.exp_one_lt_three]
CausalSmith.Stat.PrivateCateRoughdesign.exp_privacy_increment_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PrivateComparison.lean:45
theorem private_adjacent_event_bound

Privacy in both directions bounds the event-probability change on an adjacent pair. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
epsilon :
ℝ
he :
0 < epsilon ∧ epsilon ≤ 1
B :
hM :
PrivateKernel n epsilon M
D D' :
hadj :
dHam n D D' = 1
E :
Set B
hE :
|(M D).real E - (M D').real E| ≤ 2 * epsilon
Proof (Lean source)
-- @node: private_adjacent_event_bound lemma private_adjacent_event_bound (n : ℕ) (epsilon : ℝ) (he : 0 < epsilon ∧ epsilon ≤ 1) {B : Type*} [MeasurableSpace B] (M : Kernel (Dataset n) B) [IsMarkovKernel M] (hM : PrivateKernel n epsilon M) (D D' : Dataset n) (hadj : dHam n D D' = 1) (E : Set B) (hE : MeasurableSet E) : |(M D).real E - (M D').real E| ≤ 2 * epsilon := by have hf := hM.pure_privacy D D' hadj E hE have hr := hM.pure_privacy D' D (by simpa [dHam, hammingDist_comm] using hadj) E hE have hc : 0 ≤ exp epsilon - 1 := sub_nonneg.mpr (Real.one_le_exp he.1.le) have hD := mul_le_mul_of_nonneg_left (measureReal_le_one (μ := M D) (s := E)) hc have hD' := mul_le_mul_of_nonneg_left (measureReal_le_one (μ := M D') (s := E)) hc have hexp := exp_privacy_increment_le epsilon ⟨he.1.le, he.2⟩ rw [abs_le] constructor <;> nlinarith
CausalSmith.Stat.PrivateCateRoughdesign.private_adjacent_event_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PrivateComparison.lean:54
theorem event_bound_of_hamming_path Lemma event_bound_of_hamming_path in the paper ↗

A one-coordinate oscillation bound sums along the finite Hamming replacement path. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
f :
Dataset n → ℝ
c :
ℝ
hc :
0 ≤ c
hstep :
∀ D D'
if
dHam n D D' = 1
then
|f D - f D'| ≤ c
D D' :
|f D - f D'| ≤ c * dHam n D D'
Proof (Lean source)
-- @node: event_bound_of_hamming_path lemma event_bound_of_hamming_path (n : ℕ) (f : Dataset n → ℝ) (c : ℝ) (hc : 0 ≤ c) (hstep : ∀ D D', dHam n D D' = 1 → |f D - f D'| ≤ c) (D D' : Dataset n) : |f D - f D'| ≤ c * dHam n D D' := by classical have hfinite (s : Finset (Fin n)) : ∀ D D' : Dataset n, (∀ i, i ∉ s → D i = D' i) → |f D - f D'| ≤ c * s.card := by induction s using Finset.induction_on with | empty => intro D D' h have heq : D = D' := funext fun i => h i (by simp) simp [heq] | @insert i s hi ih => intro D D' h let Dmid := update D i (D' i) have hagree : ∀ j, j ∉ s → Dmid j = D' j := by intro j hj by_cases hji : j = i · subst j; simp [Dmid] · simp only [Dmid, Function.update_of_ne hji] exact h j (by simp [hj, hji]) have hrest := ih Dmid D' hagree have hfirst : |f D - f Dmid| ≤ c := by by_cases heq : D i = D' i · have hm : Dmid = D := by simp [Dmid, ← heq] simpa [hm] using hc · apply hstep D Dmid have hfilter : Finset.univ.filter (fun j => D j ≠ Dmid j) = {i} := by ext j by_cases hji : j = i · subst j; simp [Dmid, heq] · simp [Dmid, Function.update_of_ne hji, hji] simp [dHam, hammingDist, hfilter] calc |f D - f D'| ≤ |f D - f Dmid| + |f Dmid - f D'| := abs_sub_le _ _ _ _ ≤ c + c * s.card := add_le_add hfirst hrest _ = c * (insert i s).card := by rw [Finset.card_insert_of_notMem hi]; push_cast; ring exact hfinite (Finset.univ.filter (fun i => D i ≠ D' i)) D D' (by intro i hi; simpa using hi)
CausalSmith.Stat.PrivateCateRoughdesign.event_bound_of_hamming_path · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PrivateComparison.lean:73
theorem private_hamming_event_bound

Pure privacy controls every event along the Hamming path, including out-of-model datasets. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
epsilon :
ℝ
he :
0 < epsilon ∧ epsilon ≤ 1
B :
hM :
PrivateKernel n epsilon M
D D' :
E :
Set B
hE :
|(M D).real E - (M D').real E| ≤ 2 * epsilon * dHam n D D'
Proof (Lean source)
-- @node: private_hamming_event_bound lemma private_hamming_event_bound (n : ℕ) (epsilon : ℝ) (he : 0 < epsilon ∧ epsilon ≤ 1) {B : Type*} [MeasurableSpace B] (M : Kernel (Dataset n) B) [IsMarkovKernel M] (hM : PrivateKernel n epsilon M) (D D' : Dataset n) (E : Set B) (hE : MeasurableSet E) : |(M D).real E - (M D').real E| ≤ 2 * epsilon * dHam n D D' := by exact event_bound_of_hamming_path n (fun D => (M D).real E) (2 * epsilon) (mul_nonneg (by norm_num) he.1.le) (fun D D' h => private_adjacent_event_bound n epsilon he M hM D D' h E hE) D D'
CausalSmith.Stat.PrivateCateRoughdesign.private_hamming_event_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PrivateComparison.lean:114
theorem private_TV_le_coupling_cost

Integrating the Hamming event bound against any coupling controls output total variation. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
epsilon :
ℝ
he :
0 < epsilon ∧ epsilon ≤ 1
B :
hM :
PrivateKernel n epsilon M
γ :
hγ :
IsCoupling γ Q Q'
ofReal (TV (M ∘ₘ Q) (M ∘ₘ Q'))
≤ ofReal (2 * epsilon) * ∫⁻ z, (dHam n z.1 z.2 : ℝ≥0∞) ∂γ
Proof (Lean source)
-- @node: private_TV_le_coupling_cost lemma private_TV_le_coupling_cost (n : ℕ) (epsilon : ℝ) (he : 0 < epsilon ∧ epsilon ≤ 1) {B : Type*} [MeasurableSpace B] (M : Kernel (Dataset n) B) [IsMarkovKernel M] (hM : PrivateKernel n epsilon M) (Q Q' : Measure (Dataset n)) [IsProbabilityMeasure Q] [IsProbabilityMeasure Q'] (γ : Measure (Dataset n × Dataset n)) (hγ : IsCoupling γ Q Q') : ofReal (TV (M ∘ₘ Q) (M ∘ₘ Q')) ≤ ofReal (2 * epsilon) * ∫⁻ z, (dHam n z.1 z.2 : ℝ≥0∞) ∂γ := by letI := hγ.isProbabilityMeasure have hcost : (∫⁻ z, (dHam n z.1 z.2 : ℝ≥0∞) ∂γ) ≤ (n : ℝ≥0∞) := by calc _ ≤ ∫⁻ _z, (n : ℝ≥0∞) ∂γ := lintegral_mono fun z => by exact Nat.cast_le.mpr (show dHam n z.1 z.2 ≤ n from by simpa [dHam] using (hammingDist_le_card_fintype (x := z.1) (y := z.2))) _ = n := by simp have hfin : ofReal (2 * epsilon) * (∫⁻ z, (dHam n z.1 z.2 : ℝ≥0∞) ∂γ) ≠ ⊤ := ENNReal.mul_ne_top ENNReal.ofReal_ne_top (ne_top_of_le_ne_top (by simp) hcost) apply (ENNReal.ofReal_le_iff_le_toReal hfin).mpr refine ciSup_le fun E => ?_ let f : Dataset n → ℝ := fun D => (M D).real E.1 have hf : Measurable f := (M.measurable_coe E.2).ennreal_toReal have hbound : ∀ D, ‖f D‖ ≤ 1 := fun D => by rw [Real.norm_eq_abs, abs_of_nonneg measureReal_nonneg] exact measureReal_le_one have hi1 : Integrable (fun z => f z.1) γ := Integrable.of_bound (hf.comp measurable_fst).aestronglyMeasurable 1 (Filter.Eventually.of_forall fun z => hbound z.1) have hi2 : Integrable (fun z => f z.2) γ := Integrable.of_bound (hf.comp measurable_snd).aestronglyMeasurable 1 (Filter.Eventually.of_forall fun z => hbound z.2) rw [kernel_comp_real M Q E.1 E.2, kernel_comp_real M Q' E.1 E.2] change |(∫ D, f D ∂Q) - ∫ D, f D ∂Q'| ≤ _ rw [← hγ.map_fst, ← hγ.map_snd, integral_map measurable_fst.aemeasurable hf.aestronglyMeasurable, integral_map measurable_snd.aemeasurable hf.aestronglyMeasurable] apply (ENNReal.ofReal_le_iff_le_toReal hfin).mp calc ofReal |(∫ z, f z.1 ∂γ) - ∫ z, f z.2 ∂γ| ≤ ∫⁻ z, ofReal |f z.1 - f z.2| ∂γ := by simpa only [edist_dist, Real.dist_eq] using edist_integral_le_lintegral_edist hi1 hi2 _ ≤ ∫⁻ z, ofReal (2 * epsilon) * (dHam n z.1 z.2 : ℝ≥0∞) ∂γ := by apply lintegral_mono intro z simpa only [f, ENNReal.ofReal_mul (show 0 ≤ 2 * epsilon from mul_nonneg (by norm_num) he.1.le), ENNReal.ofReal_natCast] using ENNReal.ofReal_le_ofReal (private_hamming_event_bound n epsilon he M hM z.1 z.2 E.1 E.2) _ = _ := lintegral_const_mul' _ _ ENNReal.ofReal_ne_top
CausalSmith.Stat.PrivateCateRoughdesign.private_TV_le_coupling_cost · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PrivateComparison.lean:126
theorem private_kernel_comparison

Replacement privacy contracts expected Hamming transport. Ordinary Markov contraction needs no privacy, and finite chi-square divergence gives the square-root TV bound. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
epsilon :
ℝ
he :
0 < epsilon ∧ epsilon ≤ 1
@realizes B(standard Borel output space)
@realizes M(everywhere probability-valued kernel)
hM :
PrivateKernel n epsilon M
conclusion 1
ofReal (TV (M ∘ₘ Q) (M ∘ₘ Q')) ≤ ofReal (2*epsilon) * WH n Q Q'
conclusion 2
TV (K ∘ₘ Q) (K ∘ₘ Q') ≤ TV Q Q'
conclusion 3
Q ≪ Q'
(∫⁻ z, ofReal (((Q.rnDeriv Q' z).toReal - 1)^2) ∂Q') < ⊤
TV Q Q' ≤ 1/2 * sqrt (chiSqDiv Q Q')
Proof (Lean source)
-- @node: lem:private-kernel-comparison lemma private_kernel_comparison (n : ℕ) (epsilon : ℝ) (he : 0 < epsilon ∧ epsilon ≤ 1) {B : Type*} [MeasurableSpace B] [StandardBorelSpace B] -- @realizes B(standard Borel output space) (M : Kernel (Dataset n) B) [IsMarkovKernel M] -- @realizes M(everywhere probability-valued kernel) (hM : PrivateKernel n epsilon M) (Q Q' : Measure (Dataset n)) [IsProbabilityMeasure Q] [IsProbabilityMeasure Q'] : ofReal (TV (M ∘ₘ Q) (M ∘ₘ Q')) ≤ ofReal (2*epsilon) * WH n Q Q' ∧ (∀ K : Kernel (Dataset n) B, IsMarkovKernel K → TV (K ∘ₘ Q) (K ∘ₘ Q') ≤ TV Q Q') ∧ (Q ≪ Q' → (∫⁻ z, ofReal (((Q.rnDeriv Q' z).toReal - 1)^2) ∂Q') < ⊤ → TV Q Q' ≤ 1/2 * sqrt (chiSqDiv Q Q')) := by refine ⟨?_, ?_, ?_⟩ · rw [WH, ENNReal.mul_iInf_of_ne (ENNReal.ofReal_ne_zero_iff.mpr (mul_pos (by norm_num) he.1)) ENNReal.ofReal_ne_top] apply le_iInf intro γ rw [ENNReal.mul_iInf_of_ne (ENNReal.ofReal_ne_zero_iff.mpr (mul_pos (by norm_num) he.1)) ENNReal.ofReal_ne_top] apply le_iInf intro hγ exact private_TV_le_coupling_cost n epsilon he M hM Q Q' γ hγ · intro K hK letI := hK exact kernel_TV_contraction K Q Q' · exact TV_le_sqrt_chiSq_of_finite Q Q'
CausalSmith.Stat.PrivateCateRoughdesign.private_kernel_comparison · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/PrivateComparison.lean:178
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.RateRegimes 13 declarations Exact comparisons of the benchmark terms and the four public budget regimes.

Exact comparisons of the benchmark terms and the four public budget regimes.

The sparse-privacy term meets the sampling term at the fourth-root budget. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
x epsilon :
ℝ
hx :
0 < x
he :
0 < epsilon
(x ^ 2 * epsilon) ^ (-1 / 7 : ℝ) ≤ x ^ (-1 / 4 : ℝ) ↔ x ^ (-1 / 4 : ℝ) ≤ epsilon
Proof (Lean source)
-- @node: sparse_le_sampling_iff lemma sparse_le_sampling_iff (x epsilon : ℝ) (hx : 0 < x) (he : 0 < epsilon) : (x ^ 2 * epsilon) ^ (-1 / 7 : ℝ) ≤ x ^ (-1 / 4 : ℝ) ↔ x ^ (-1 / 4 : ℝ) ≤ epsilon := by have hxe : 0 < x ^ 2 * epsilon := by positivity rw [← Real.log_le_log_iff (Real.rpow_pos_of_pos hxe _) (Real.rpow_pos_of_pos hx _), ← Real.log_le_log_iff (Real.rpow_pos_of_pos hx _) he] rw [Real.log_rpow hxe, Real.log_rpow hx, Real.log_mul (by positivity) he.ne', Real.log_pow] norm_num constructor <;> intro h <;> linarith
CausalSmith.Stat.PrivateCateRoughdesign.sparse_le_sampling_iff · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/RateRegimes.lean:10

The dense-privacy term meets the sampling term at the square-root budget. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
x epsilon :
ℝ
hx :
0 < x
he :
0 < epsilon
(x * epsilon) ^ (-1 / 2 : ℝ) ≤ x ^ (-1 / 4 : ℝ) ↔ x ^ (-1 / 2 : ℝ) ≤ epsilon
Proof (Lean source)
-- @node: dense_le_sampling_iff lemma dense_le_sampling_iff (x epsilon : ℝ) (hx : 0 < x) (he : 0 < epsilon) : (x * epsilon) ^ (-1 / 2 : ℝ) ≤ x ^ (-1 / 4 : ℝ) ↔ x ^ (-1 / 2 : ℝ) ≤ epsilon := by have hxe : 0 < x * epsilon := by positivity rw [← Real.log_le_log_iff (Real.rpow_pos_of_pos hxe _) (Real.rpow_pos_of_pos hx _), ← Real.log_le_log_iff (Real.rpow_pos_of_pos hx _) he] rw [Real.log_rpow hxe, Real.log_rpow hx, Real.log_rpow hx, Real.log_mul hx.ne' he.ne'] constructor <;> intro h <;> linarith
CausalSmith.Stat.PrivateCateRoughdesign.dense_le_sampling_iff · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/RateRegimes.lean:22

The two privacy terms meet at the three-fifths budget. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
x epsilon :
ℝ
hx :
0 < x
he :
0 < epsilon
(x * epsilon) ^ (-1 / 2 : ℝ)
≤ (x ^ 2 * epsilon) ^ (-1 / 7 : ℝ) ↔ x ^ (-3 / 5 : ℝ) ≤ epsilon
Proof (Lean source)
-- @node: dense_le_sparse_iff lemma dense_le_sparse_iff (x epsilon : ℝ) (hx : 0 < x) (he : 0 < epsilon) : (x * epsilon) ^ (-1 / 2 : ℝ) ≤ (x ^ 2 * epsilon) ^ (-1 / 7 : ℝ) ↔ x ^ (-3 / 5 : ℝ) ≤ epsilon := by have hxe : 0 < x * epsilon := by positivity have hx2e : 0 < x ^ 2 * epsilon := by positivity rw [← Real.log_le_log_iff (Real.rpow_pos_of_pos hxe _) (Real.rpow_pos_of_pos hx2e _), ← Real.log_le_log_iff (Real.rpow_pos_of_pos hx _) he] rw [Real.log_rpow hxe, Real.log_rpow hx2e, Real.log_rpow hx, Real.log_mul hx.ne' he.ne', Real.log_mul (by positivity) he.ne', Real.log_pow] norm_num constructor <;> intro h <;> linarith
CausalSmith.Stat.PrivateCateRoughdesign.dense_le_sparse_iff · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/RateRegimes.lean:33

Reversing the budget comparison reverses the order of the two privacy terms. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
x epsilon :
ℝ
hx :
0 < x
he :
0 < epsilon
(x ^ 2 * epsilon) ^ (-1 / 7 : ℝ)
≤ (x * epsilon) ^ (-1 / 2 : ℝ) ↔ epsilon ≤ x ^ (-3 / 5 : ℝ)
Proof (Lean source)
-- @node: sparse_le_dense_iff lemma sparse_le_dense_iff (x epsilon : ℝ) (hx : 0 < x) (he : 0 < epsilon) : (x ^ 2 * epsilon) ^ (-1 / 7 : ℝ) ≤ (x * epsilon) ^ (-1 / 2 : ℝ) ↔ epsilon ≤ x ^ (-3 / 5 : ℝ) := by have hxe : 0 < x * epsilon := by positivity have hx2e : 0 < x ^ 2 * epsilon := by positivity rw [← Real.log_le_log_iff (Real.rpow_pos_of_pos hx2e _) (Real.rpow_pos_of_pos hxe _), ← Real.log_le_log_iff he (Real.rpow_pos_of_pos hx _)] rw [Real.log_rpow hxe, Real.log_rpow hx2e, Real.log_rpow hx, Real.log_mul hx.ne' he.ne', Real.log_mul (by positivity) he.ne', Real.log_pow] norm_num constructor <;> intro h <;> linarith
CausalSmith.Stat.PrivateCateRoughdesign.sparse_le_dense_iff · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/RateRegimes.lean:48
theorem rate_sampling_regime

In the large-budget regime both privacy terms are below the sampling term. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
n :
ℕ
epsilon :
ℝ
hn :
2 ≤ n
he :
0 < epsilon
hb :
(n : ℝ) ^ (-1 / 4 : ℝ) ≤ epsilon
rate n epsilon = (n : ℝ) ^ (-1 / 4 : ℝ)
Proof (Lean source)
-- @node: rate_sampling_regime lemma rate_sampling_regime (n : ℕ) (epsilon : ℝ) (hn : 2 ≤ n) (he : 0 < epsilon) (hb : (n : ℝ) ^ (-1 / 4 : ℝ) ≤ epsilon) : rate n epsilon = (n : ℝ) ^ (-1 / 4 : ℝ) := by have hn1 : (1 : ℝ) ≤ n := by exact_mod_cast (show 1 ≤ n by omega) have hn0 : (0 : ℝ) < n := by linarith have hba := (sparse_le_sampling_iff _ _ hn0 he).mpr hb have hca := (dense_le_sampling_iff _ _ hn0 he).mpr ((Real.rpow_le_rpow_of_exponent_le hn1 (by norm_num : (-1 / 2 : ℝ) ≤ -1 / 4)).trans hb) have ha1 := Real.rpow_le_one_of_one_le_of_nonpos hn1 (by norm_num : (-1 / 4 : ℝ) ≤ 0) simp only [rate, max_eq_left (max_le hba hca), min_eq_right ha1]
CausalSmith.Stat.PrivateCateRoughdesign.rate_sampling_regime · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/RateRegimes.lean:63
theorem rate_sparse_regime

In the intermediate sparse regime the sparse-privacy term is the maximum and below one. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
n :
ℕ
epsilon :
ℝ
hn :
2 ≤ n
he :
0 < epsilon
hb :
(n : ℝ) ^ (-3 / 5 : ℝ) ≤ epsilon ∧ epsilon ≤ (n : ℝ) ^ (-1 / 4 : ℝ)
rate n epsilon = ((n : ℝ) ^ 2 * epsilon) ^ (-1 / 7 : ℝ)
Proof (Lean source)
-- @node: rate_sparse_regime lemma rate_sparse_regime (n : ℕ) (epsilon : ℝ) (hn : 2 ≤ n) (he : 0 < epsilon) (hb : (n : ℝ) ^ (-3 / 5 : ℝ) ≤ epsilon ∧ epsilon ≤ (n : ℝ) ^ (-1 / 4 : ℝ)) : rate n epsilon = ((n : ℝ) ^ 2 * epsilon) ^ (-1 / 7 : ℝ) := by have hn1 : (1 : ℝ) ≤ n := by exact_mod_cast (show 1 ≤ n by omega) have hn0 : (0 : ℝ) < n := by linarith have hab : (n : ℝ) ^ (-1 / 4 : ℝ) ≤ ((n : ℝ) ^ 2 * epsilon) ^ (-1 / 7 : ℝ) := by have hx : 0 < (n : ℝ) ^ 2 * epsilon := by positivity rw [← Real.log_le_log_iff (Real.rpow_pos_of_pos hn0 _) (Real.rpow_pos_of_pos hx _)] have hl := (Real.log_le_log_iff he (Real.rpow_pos_of_pos hn0 _)).mpr hb.2 rw [Real.log_rpow hn0] at hl rw [Real.log_rpow hn0, Real.log_rpow hx, Real.log_mul (by positivity) he.ne', Real.log_pow] norm_num linarith have hcb := (dense_le_sparse_iff _ _ hn0 he).mpr hb.1 have hi : (n : ℝ) ^ (-1 : ℝ) ≤ epsilon := (Real.rpow_le_rpow_of_exponent_le hn1 (by norm_num : (-1 : ℝ) ≤ -3 / 5)).trans hb.1 have hprod : 1 ≤ (n : ℝ) * epsilon := by rw [Real.rpow_neg_one] at hi have := mul_le_mul_of_nonneg_left hi hn0.le simpa [mul_inv_cancel₀ hn0.ne'] using this have hprod2 : 1 ≤ (n : ℝ) ^ 2 * epsilon := by nlinarith have hb1 := Real.rpow_le_one_of_one_le_of_nonpos hprod2 (by norm_num : (-1 / 7 : ℝ) ≤ 0) simp only [rate, max_eq_left hcb, max_eq_right hab, min_eq_right hb1]
CausalSmith.Stat.PrivateCateRoughdesign.rate_sparse_regime · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/RateRegimes.lean:76
theorem rate_dense_regime

In the dense regime the dense-privacy term is the maximum and below one. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
n :
ℕ
epsilon :
ℝ
hn :
2 ≤ n
he :
0 < epsilon
hb :
(n : ℝ) ^ (-1 : ℤ) ≤ epsilon ∧ epsilon ≤ (n : ℝ) ^ (-3 / 5 : ℝ)
rate n epsilon = ((n : ℝ) * epsilon) ^ (-1 / 2 : ℝ)
Proof (Lean source)
-- @node: rate_dense_regime lemma rate_dense_regime (n : ℕ) (epsilon : ℝ) (hn : 2 ≤ n) (he : 0 < epsilon) (hb : (n : ℝ) ^ (-1 : ℤ) ≤ epsilon ∧ epsilon ≤ (n : ℝ) ^ (-3 / 5 : ℝ)) : rate n epsilon = ((n : ℝ) * epsilon) ^ (-1 / 2 : ℝ) := by have hn1 : (1 : ℝ) ≤ n := by exact_mod_cast (show 1 ≤ n by omega) have hn0 : (0 : ℝ) < n := by linarith have hbc := (sparse_le_dense_iff _ _ hn0 he).mpr hb.2 have hac : (n : ℝ) ^ (-1 / 4 : ℝ) ≤ ((n : ℝ) * epsilon) ^ (-1 / 2 : ℝ) := by have hx : 0 < (n : ℝ) * epsilon := by positivity have hi : epsilon ≤ (n : ℝ) ^ (-1 / 2 : ℝ) := hb.2.trans (Real.rpow_le_rpow_of_exponent_le hn1 (by norm_num : (-3 / 5 : ℝ) ≤ -1 / 2)) have hl := (Real.log_le_log_iff he (Real.rpow_pos_of_pos hn0 _)).mpr hi rw [Real.log_rpow hn0] at hl rw [← Real.log_le_log_iff (Real.rpow_pos_of_pos hn0 _) (Real.rpow_pos_of_pos hx _), Real.log_rpow hn0, Real.log_rpow hx, Real.log_mul hn0.ne' he.ne'] linarith have hprod : 1 ≤ (n : ℝ) * epsilon := by have := mul_le_mul_of_nonneg_left hb.1 hn0.le simpa [zpow_neg_one, mul_inv_cancel₀ hn0.ne'] using this have hc1 := Real.rpow_le_one_of_one_le_of_nonpos hprod (by norm_num : (-1 / 2 : ℝ) ≤ 0) simp only [rate, max_eq_right hbc, max_eq_right hac, min_eq_right hc1]
theorem rate_capped_regime

Below the inverse-sample-size budget the dense term reaches the cap. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
n :
ℕ
epsilon :
ℝ
hn :
2 ≤ n
he :
0 < epsilon
hb :
epsilon ≤ (n : ℝ) ^ (-1 : ℤ)
rate n epsilon = 1
Proof (Lean source)
-- @node: rate_capped_regime lemma rate_capped_regime (n : ℕ) (epsilon : ℝ) (hn : 2 ≤ n) (he : 0 < epsilon) (hb : epsilon ≤ (n : ℝ) ^ (-1 : ℤ)) : rate n epsilon = 1 := by have hn0 : (0 : ℝ) < n := by exact_mod_cast (show 0 < n by omega) have hx : 0 < (n : ℝ) * epsilon := by positivity have hprod : (n : ℝ) * epsilon ≤ 1 := by have := mul_le_mul_of_nonneg_left hb hn0.le simpa [zpow_neg_one, mul_inv_cancel₀ hn0.ne'] using this have hc : 1 ≤ ((n : ℝ) * epsilon) ^ (-1 / 2 : ℝ) := by simpa using Real.rpow_le_rpow_of_nonpos hx hprod (by norm_num : (-1 / 2 : ℝ) ≤ 0) exact min_eq_left (hc.trans ((le_max_right _ _).trans (le_max_right _ _)))
CausalSmith.Stat.PrivateCateRoughdesign.rate_capped_regime · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/RateRegimes.lean:126
theorem rate_unit_budget

Unit budget gives exactly the nonprivate sampling benchmark. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
hn :
2 ≤ n
rate n 1 = (n : ℝ) ^ (-1 / 4 : ℝ)
Proof (Lean source)
-- @node: rate_unit_budget lemma rate_unit_budget (n : ℕ) (hn : 2 ≤ n) : rate n 1 = (n : ℝ) ^ (-1 / 4 : ℝ) := by apply rate_sampling_regime n 1 hn zero_lt_one exact Real.rpow_le_one_of_one_le_of_nonpos (by exact_mod_cast (show 1 ≤ n by omega)) (by norm_num)
theorem capped_dense_le_rate

The capped dense-privacy term is always a lower bound for the benchmark. the theorem's stated inputs and assumptions, and the asserted conclusion follows.

Formal statement
n :
ℕ
epsilon :
ℝ
min 1 (((n : ℝ) * epsilon) ^ (-1 / 2 : ℝ)) ≤ rate n epsilon
Proof (Lean source)
-- @node: capped_dense_le_rate lemma capped_dense_le_rate (n : ℕ) (epsilon : ℝ) : min 1 (((n : ℝ) * epsilon) ^ (-1 / 2 : ℝ)) ≤ rate n epsilon := by exact min_le_min_left 1 ((le_max_right _ _).trans (le_max_right _ _))
CausalSmith.Stat.PrivateCateRoughdesign.capped_dense_le_rate · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/RateRegimes.lean:146
theorem rate_tendsto_zero_of_budget_diverges

Divergence of sample size times budget makes all three benchmark terms vanish. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
budgets :
ℕ → ℝ
he :
∀ j
if
2 ≤ j
then
0 < budgets j
hdiv :
Tendsto (fun j : ℕ => (j : ℝ) * budgets j) atTop atTop
Tendsto (fun j => rate j (budgets j)) atTop (𝓝 0)
Proof (Lean source)
-- @node: rate_tendsto_zero_of_budget_diverges lemma rate_tendsto_zero_of_budget_diverges (budgets : ℕ → ℝ) (he : ∀ j, 2 ≤ j → 0 < budgets j) (hdiv : Tendsto (fun j : ℕ => (j : ℝ) * budgets j) atTop atTop) : Tendsto (fun j => rate j (budgets j)) atTop (𝓝 0) := by have ha : Tendsto (fun j : ℕ => (j : ℝ) ^ (-1 / 4 : ℝ)) atTop (𝓝 0) := by simpa [Function.comp_def, neg_div] using (tendsto_rpow_neg_atTop (by norm_num : (0 : ℝ) < 1 / 4)).comp tendsto_natCast_atTop_atTop have hdiv2 : Tendsto (fun j : ℕ => (j : ℝ) ^ 2 * budgets j) atTop atTop := by apply tendsto_atTop_mono' atTop _ hdiv filter_upwards [eventually_ge_atTop 2] with j hj have hj1 : (1 : ℝ) ≤ j := by exact_mod_cast (show 1 ≤ j by omega) have heb := (he j hj).le have hs : (j : ℝ) ≤ (j : ℝ) ^ 2 := by nlinarith exact mul_le_mul_of_nonneg_right hs heb have hb : Tendsto (fun j : ℕ => ((j : ℝ) ^ 2 * budgets j) ^ (-1 / 7 : ℝ)) atTop (𝓝 0) := by simpa [Function.comp_def, neg_div] using (tendsto_rpow_neg_atTop (by norm_num : (0 : ℝ) < 1 / 7)).comp hdiv2 have hc : Tendsto (fun j : ℕ => ((j : ℝ) * budgets j) ^ (-1 / 2 : ℝ)) atTop (𝓝 0) := by simpa [Function.comp_def, neg_div] using (tendsto_rpow_neg_atTop (by norm_num : (0 : ℝ) < 1 / 2)).comp hdiv simpa [rate] using (tendsto_const_nhds (x := (1 : ℝ))).min (ha.max (hb.max hc))
CausalSmith.Stat.PrivateCateRoughdesign.rate_tendsto_zero_of_budget_diverges · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/RateRegimes.lean:152
theorem budget_diverges_of_rate_tendsto_zero

A vanishing benchmark forces sample size times budget past every finite bound. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
budgets :
ℕ → ℝ
he :
∀ j
if
2 ≤ j
then
0 < budgets j
hr :
Tendsto (fun j => rate j (budgets j)) atTop (𝓝 0)
Tendsto (fun j : ℕ => (j : ℝ) * budgets j) atTop atTop
Proof (Lean source)
-- @node: budget_diverges_of_rate_tendsto_zero lemma budget_diverges_of_rate_tendsto_zero (budgets : ℕ → ℝ) (he : ∀ j, 2 ≤ j → 0 < budgets j) (hr : Tendsto (fun j => rate j (budgets j)) atTop (𝓝 0)) : Tendsto (fun j : ℕ => (j : ℝ) * budgets j) atTop atTop := by apply tendsto_atTop.2 intro K let B : ℝ := max 1 K have hB : 0 < B := lt_of_lt_of_le zero_lt_one (le_max_left _ _) have hsmall : 0 < min 1 (B ^ (-1 / 2 : ℝ)) := lt_min zero_lt_one (Real.rpow_pos_of_pos hB _) filter_upwards [(tendsto_order.1 hr).2 _ hsmall, eventually_ge_atTop 2] with j hj hj2 have hp : 0 < (j : ℝ) * budgets j := by have : (0 : ℝ) < j := by exact_mod_cast (show 0 < j by omega) exact mul_pos this (he j hj2) have hm := lt_of_le_of_lt (capped_dense_le_rate j (budgets j)) hj have hc : ((j : ℝ) * budgets j) ^ (-1 / 2 : ℝ) < B ^ (-1 / 2 : ℝ) := by by_contra hh have : min 1 (B ^ (-1 / 2 : ℝ)) ≤ min 1 (((j : ℝ) * budgets j) ^ (-1 / 2 : ℝ)) := min_le_min_left 1 (le_of_not_gt hh) exact (not_lt_of_ge this) hm have hlt := (Real.rpow_lt_rpow_iff_of_neg hp hB (by norm_num : (-1 / 2 : ℝ) < 0)).mp hc exact (le_max_right 1 K).trans hlt.le
CausalSmith.Stat.PrivateCateRoughdesign.budget_diverges_of_rate_tendsto_zero · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/RateRegimes.lean:178
theorem rate_consistency_iff

The numerical benchmark vanishes exactly for diverging sample size times budget. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
budgets :
ℕ → ℝ
he :
∀ j
if
2 ≤ j
then
0 < budgets j
Tendsto (fun j => rate j (budgets j)) atTop (𝓝 0)
↔ Tendsto (fun j : ℕ => (j : ℝ) * budgets j) atTop atTop
Proof (Lean source)
-- @node: rate_consistency_iff lemma rate_consistency_iff (budgets : ℕ → ℝ) (he : ∀ j, 2 ≤ j → 0 < budgets j) : Tendsto (fun j => rate j (budgets j)) atTop (𝓝 0) ↔ Tendsto (fun j : ℕ => (j : ℝ) * budgets j) atTop atTop := by exact ⟨budget_diverges_of_rate_tendsto_zero budgets he, rate_tendsto_zero_of_budget_diverges budgets he⟩
CausalSmith.Stat.PrivateCateRoughdesign.rate_consistency_iff · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/RateRegimes.lean:203
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.ReleaseMoments 3 declarations Exact centered Laplace release moments and the uniform density-free squared-error guarantee.

Exact centered Laplace release moments and the uniform density-free squared-error guarantee.

theorem privateRatioRelease_eq_laplaceKernel

The constructed pair release is the measurable Laplace kernel. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
epsilon h :
ℝ
he :
0 < epsilon
privateRatioRelease n epsilon h k
= laplaceMechPiKernel (12/epsilon) (by positivity) (pairQuery n h k) (measurable_pairQuery n h k)
Proof (Lean source)
-- @node: privateRatioRelease_eq_laplaceKernel lemma privateRatioRelease_eq_laplaceKernel (n k : ℕ) (epsilon h : ℝ) (he : 0 < epsilon) : privateRatioRelease n epsilon h k = laplaceMechPiKernel (12/epsilon) (by positivity) (pairQuery n h k) (measurable_pairQuery n h k) := by ext D E : 2 rw [laplaceMechPiKernel_apply] rfl
CausalSmith.Stat.PrivateCateRoughdesign.privateRatioRelease_eq_laplaceKernel · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ReleaseMoments.lean:10
theorem privateRatioRelease_centered_moments

The released coordinate squares add exactly two independent Laplace variances to the input variances, with no inflation of the noise coefficient. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
epsilon h :
ℝ
he :
0 < epsilon
hh :
0 < h
hk :
0 < k
P :
(∫ v, (v 0-Nbar n h k (dataLaw n P))^2 + (v 1-Dbar n h k (dataLaw n P))^2 ∂(privateRatioRelease n epsilon h k ∘ₘ dataLaw n P))
= variance (SN n h k) (dataLaw n P) + variance (SD n h k) (dataLaw n P) + 576/epsilon^2
Proof (Lean source)
-- @node: privateRatioRelease_centered_moments lemma privateRatioRelease_centered_moments (n k : ℕ) (epsilon h : ℝ) (he : 0 < epsilon) (hh : 0 < h) (hk : 0 < k) (P : CausalLaw) : (∫ v, (v 0-Nbar n h k (dataLaw n P))^2 + (v 1-Dbar n h k (dataLaw n P))^2 ∂(privateRatioRelease n epsilon h k ∘ₘ dataLaw n P)) = variance (SN n h k) (dataLaw n P) + variance (SD n h k) (dataLaw n P) + 576/epsilon^2 := by letI : IsProbabilityMeasure (Pobs P) := Measure.isProbabilityMeasure_map measurable_observe.aemeasurable letI : IsProbabilityMeasure (dataLaw n P) := by unfold dataLaw; infer_instance have hLp := statistic_memLp n k h hh hk (dataLaw n P) 2 have hN : Integrable (fun D => (pairQuery n h k D 0)^2) (dataLaw n P) := by simpa [pairQuery] using hLp.1.integrable_sq have hD : Integrable (fun D => (pairQuery n h k D 1)^2) (dataLaw n P) := by simpa [pairQuery] using hLp.2.integrable_sq rw [privateRatioRelease_eq_laplaceKernel n k epsilon h he] have hiN := laplaceMechPiKernel_integrable_coord_sub_sq (12/epsilon) (by positivity) (pairQuery n h k) (measurable_pairQuery n h k) (dataLaw n P) 0 hN (Nbar n h k (dataLaw n P)) have hiD := laplaceMechPiKernel_integrable_coord_sub_sq (12/epsilon) (by positivity) (pairQuery n h k) (measurable_pairQuery n h k) (dataLaw n P) 1 hD (Dbar n h k (dataLaw n P)) rw [integral_add hiN hiD, laplaceMechPiKernel_integral_coord_sub_sq _ _ _ _ _ 0 hN, laplaceMechPiKernel_integral_coord_sub_sq _ _ _ _ _ 1 hD, variance_eq_integral (by fun_prop : AEMeasurable (SN n h k) (dataLaw n P)), variance_eq_integral (by fun_prop : AEMeasurable (SD n h k) (dataLaw n P))] simp only [pairQuery, Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.head_cons, Nbar, Dbar] ring
CausalSmith.Stat.PrivateCateRoughdesign.privateRatioRelease_centered_moments · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ReleaseMoments.lean:20
theorem Thk_model_squared_error_le

Integrating the pointwise floored-ratio bound and exact release moments proves the public second-moment envelope throughout the complete model. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
efronStein_of_gate :
n k :
ℕ
epsilon h :
ℝ
hn :
2 ≤ n
hk :
2 ≤ k
he :
0 < epsilon
hh :
0 < h ∧ h ≤ 1/4
P :
hP :
(∫⁻ u, ofReal ((u-theta P)^2) ∂(Thk n epsilon h k ∘ₘ dataLaw n P))
≤ ofReal (Vbound n epsilon h k)
Proof (Lean source)
-- @node: Thk_model_squared_error_le lemma Thk_model_squared_error_le (efronStein_of_gate : EfronSteinReplacement) (n k : ℕ) (epsilon h : ℝ) (hn : 2 ≤ n) (hk : 2 ≤ k) (he : 0 < epsilon) (hh : 0 < h ∧ h ≤ 1/4) (P : CausalLaw) (hP : CompleteModel P) : (∫⁻ u, ofReal ((u-theta P)^2) ∂(Thk n epsilon h k ∘ₘ dataLaw n P)) ≤ ofReal (Vbound n epsilon h k) := by letI : IsProbabilityMeasure (Pobs P) := Measure.isProbabilityMeasure_map measurable_observe.aemeasurable letI : IsProbabilityMeasure (dataLaw n P) := by unfold dataLaw; infer_instance letI := privateRatioRelease_markov n k epsilon h he let Q := privateRatioRelease n epsilon h k ∘ₘ dataLaw n P let f := fun v : Fin 2 → ℝ => (v 0-Nbar n h k (dataLaw n P))^2 + (v 1-Dbar n h k (dataLaw n P))^2 have hLp := statistic_memLp n k h hh.1 (by omega) (dataLaw n P) 2 have hi (i : Fin 2) (c : ℝ) : Integrable (fun v => (v i-c)^2) Q := by dsimp [Q] rw [privateRatioRelease_eq_laplaceKernel n k epsilon h he] apply laplaceMechPiKernel_integrable_coord_sub_sq fin_cases i · simpa [pairQuery] using hLp.1.integrable_sq · simpa [pairQuery] using hLp.2.integrable_sq have hif : Integrable f Q := (hi 0 _).add (hi 1 _) have hrhs : Integrable (fun v => 2*(bias h k)^2 + 4/(d0 n h k)^2 * f v) Q := (integrable_const _).add (hif.const_mul _) have hbound := ratioMap_model_squared_error_le n k h hn hk hh P hP have hierr : Integrable (fun v => (ratioMap n h k v-theta P)^2) Q := by apply hrhs.mono' (by fun_prop) apply ae_of_all intro v rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg (ratioMap n h k v-theta P))] exact hbound v have hvar := (all_count_stability efronStein_of_gate n k h hn hk hh P (dataLaw n P) rfl hP).2 have hmom : (∫ v, f v ∂Q) ≤ 36*Wocc n h k P + 576/epsilon^2 := by rw [show (∫ v, f v ∂Q) = _ from privateRatioRelease_centered_moments n k epsilon h he hh.1 (by omega) P] linarith [le_max_left (variance (SN n h k) (dataLaw n P)) (variance (SD n h k) (dataLaw n P)), le_max_right (variance (SN n h k) (dataLaw n P)) (variance (SD n h k) (dataLaw n P))] have herr : (∫ v, (ratioMap n h k v-theta P)^2 ∂Q) ≤ Vbound n epsilon h k := by calc _ ≤ ∫ v, (2*(bias h k)^2 + 4/(d0 n h k)^2 * f v) ∂Q := integral_mono hierr hrhs hbound _ = 2*(bias h k)^2 + 4/(d0 n h k)^2 * (∫ v, f v ∂Q) := by rw [integral_add (integrable_const _) (hif.const_mul _), integral_const_mul] simp [integral_const_mul] _ ≤ 2*(bias h k)^2 + 4/(d0 n h k)^2 * (36*Wocc n h k P + 576/epsilon^2) := by gcongr _ = 2*(bias h k)^2 + 144*Wocc n h k P/(d0 n h k)^2 + 2304/(epsilon^2*(d0 n h k)^2) := by ring _ ≤ _ := model_variance_envelope_le n k epsilon h hn hk he hh P hP rw [Thk_squared_error_eq, ← ofReal_integral_eq_lintegral_ofReal hierr (ae_of_all _ (fun v => sq_nonneg (ratioMap n h k v-theta P)))] exact ENNReal.ofReal_le_ofReal herr
CausalSmith.Stat.PrivateCateRoughdesign.Thk_model_squared_error_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/ReleaseMoments.lean:54
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.SelectionLaw 11 declarations Membership-label rectangles and their normalized iid product laws.

Membership-label rectangles and their normalized iid product laws.

theorem cell_membership_rectangle Lemma cell_membership_rectangle in the paper ↗

Specifying every cell membership label is a rectangle in the iid sample space. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
j :
Fin k
I :
{D : Dataset n | cellRecords n h k D j = I}
= Set.univ.pi (fun i => if i ∈ I then {z : O | z.1 ∈ cell h k j} else {z : O | z.1 ∈ cell h k j}ᶜ)
Proof (Lean source)
-- @node: cell_membership_rectangle lemma cell_membership_rectangle (n k : ℕ) (h : ℝ) (j : Fin k) (I : Finset (Fin n)) : {D : Dataset n | cellRecords n h k D j = I} = Set.univ.pi (fun i => if i ∈ I then {z : O | z.1 ∈ cell h k j} else {z : O | z.1 ∈ cell h k j}ᶜ) := by classical ext D simp only [Set.mem_ofPred_eq, Set.mem_pi, Set.mem_univ, forall_const] constructor · intro hD i have hi : i ∈ cellRecords n h k D j ↔ i ∈ I := by rw [hD] simp only [cellRecords, mem_filter, Finset.mem_univ, true_and] at hi by_cases hI : i ∈ I <;> simp [hI, hi] · intro hD apply Finset.ext intro i simp only [cellRecords, mem_filter, Finset.mem_univ, true_and] by_cases hI : i ∈ I <;> simpa [hI] using hD i
CausalSmith.Stat.PrivateCateRoughdesign.cell_membership_rectangle · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/SelectionLaw.lean:12
theorem measurableSet_cell_membership Lemma measurableSet_cell_membership in the paper ↗

Every exact membership-label event is measurable. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
j :
Fin k
I :
MeasurableSet {D : Dataset n | cellRecords n h k D j = I}
Proof (Lean source)
-- @node: measurableSet_cell_membership lemma measurableSet_cell_membership (n k : ℕ) (h : ℝ) (j : Fin k) (I : Finset (Fin n)) : MeasurableSet {D : Dataset n | cellRecords n h k D j = I} := by classical rw [cell_membership_rectangle] apply MeasurableSet.univ_pi intro i split_ifs · exact (measurableSet_cell h k j).preimage measurable_fst · exact ((measurableSet_cell h k j).preimage measurable_fst).compl
CausalSmith.Stat.PrivateCateRoughdesign.measurableSet_cell_membership · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/SelectionLaw.lean:33
theorem iid_membership_restriction

Restricting the iid sample law to specified labels factors coordinate by coordinate. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
P :
j :
Fin k
I :
(dataLaw n P).restrict {D | cellRecords n h k D j = I}
= Measure.pi (fun i => (Pobs P).restrict (if i ∈ I then {z : O | z.1 ∈ cell h k j} else {z : O | z.1 ∈ cell h k j}ᶜ))
Proof (Lean source)
-- @node: iid_membership_restriction lemma iid_membership_restriction (n k : ℕ) (h : ℝ) (P : CausalLaw) (j : Fin k) (I : Finset (Fin n)) : (dataLaw n P).restrict {D | cellRecords n h k D j = I} = Measure.pi (fun i => (Pobs P).restrict (if i ∈ I then {z : O | z.1 ∈ cell h k j} else {z : O | z.1 ∈ cell h k j}ᶜ)) := by classical let : IsProbabilityMeasure (Pobs P) := Measure.isProbabilityMeasure_map measurable_observe.aemeasurable rw [cell_membership_rectangle, dataLaw, Measure.restrict_pi_pi]
CausalSmith.Stat.PrivateCateRoughdesign.iid_membership_restriction · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/SelectionLaw.lean:46
theorem normalized_record_restriction_probability Lemma normalized_record_restriction_probability in the paper ↗

Normalizing any positive-mass restriction gives a probability law. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
s :
Set O
hs :
μ s ≠ 0
IsProbabilityMeasure ((μ s)⁻¹ • μ.restrict s)
Proof (Lean source)
-- @node: normalized_record_restriction_probability lemma normalized_record_restriction_probability (μ : Measure O) [IsFiniteMeasure μ] (s : Set O) (hs : μ s ≠ 0) : IsProbabilityMeasure ((μ s)⁻¹ • μ.restrict s) := by refine ⟨?_⟩ rw [Measure.smul_apply, Measure.restrict_apply MeasurableSet.univ, Set.univ_inter, smul_eq_mul] exact ENNReal.inv_mul_cancel hs (measure_ne_top μ s)
CausalSmith.Stat.PrivateCateRoughdesign.normalized_record_restriction_probability · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/SelectionLaw.lean:59
theorem iid_normalized_rectangle Lemma iid_normalized_rectangle in the paper ↗

Dividing a positive rectangle restriction by its mass preserves the product structure. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
s :
Fin n → Set O
hs :
∀ i, μ (s i) ≠ 0
((Measure.pi (fun _ : Fin n => μ)) (Set.univ.pi s))⁻¹ • (Measure.pi (fun _ : Fin n => μ)).restrict (Set.univ.pi s)
= Measure.pi (fun i => (μ (s i))⁻¹ • μ.restrict (s i))
Proof (Lean source)
-- @node: iid_normalized_rectangle lemma iid_normalized_rectangle (n : ℕ) (μ : Measure O) [IsFiniteMeasure μ] (s : Fin n → Set O) (hs : ∀ i, μ (s i) ≠ 0) : ((Measure.pi (fun _ : Fin n => μ)) (Set.univ.pi s))⁻¹ • (Measure.pi (fun _ : Fin n => μ)).restrict (Set.univ.pi s) = Measure.pi (fun i => (μ (s i))⁻¹ • μ.restrict (s i)) := by let ν := fun i => (μ (s i))⁻¹ • μ.restrict (s i) let : ∀ i, IsProbabilityMeasure (ν i) := fun i => normalized_record_restriction_probability μ (s i) (hs i) apply (Measure.pi_eq (μ := ν) _).symm intro t ht rw [Measure.smul_apply, smul_eq_mul, Measure.pi_pi, Measure.restrict_pi_pi, Measure.pi_pi] simp only [ν, Measure.smul_apply, smul_eq_mul] rw [Finset.prod_mul_distrib, ENNReal.prod_inv_distrib] intro i hi l hl hil exact inl (hs i)
CausalSmith.Stat.PrivateCateRoughdesign.iid_normalized_rectangle · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/SelectionLaw.lean:69
theorem iid_conditional_membership_law

Given a specified positive-probability label pattern, all records are independent with coordinate laws conditioned on their own labels. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
n k :
ℕ
h :
ℝ
P :
j :
Fin k
I :
hp :
∀ i : Fin n,
(Pobs P) (if i ∈ I then {z : O | z.1 ∈ cell h k j} else {z : O | z.1 ∈ cell h k j}ᶜ) ≠ 0
((dataLaw n P) {D | cellRecords n h k D j = I})⁻¹ • (dataLaw n P).restrict {D | cellRecords n h k D j = I}
= Measure.pi (fun i => ((Pobs P) (if i ∈ I then {z : O | z.1 ∈ cell h k j} else {z : O | z.1 ∈ cell h k j}ᶜ))⁻¹ • (Pobs P).restrict (if i ∈ I then {z : O | z.1 ∈ cell h k j} else {z : O | z.1 ∈ cell h k j}ᶜ))
Proof (Lean source)
-- @node: iid_conditional_membership_law lemma iid_conditional_membership_law (n k : ℕ) (h : ℝ) (P : CausalLaw) (j : Fin k) (I : Finset (Fin n)) (hp : ∀ i : Fin n, (Pobs P) (if i ∈ I then {z : O | z.1 ∈ cell h k j} else {z : O | z.1 ∈ cell h k j}ᶜ) ≠ 0) : ((dataLaw n P) {D | cellRecords n h k D j = I})⁻¹ • (dataLaw n P).restrict {D | cellRecords n h k D j = I} = Measure.pi (fun i => ((Pobs P) (if i ∈ I then {z : O | z.1 ∈ cell h k j} else {z : O | z.1 ∈ cell h k j}ᶜ))⁻¹ • (Pobs P).restrict (if i ∈ I then {z : O | z.1 ∈ cell h k j} else {z : O | z.1 ∈ cell h k j}ᶜ)) := by classical let : IsProbabilityMeasure (Pobs P) := Measure.isProbabilityMeasure_map measurable_observe.aemeasurable rw [cell_membership_rectangle, dataLaw] exact iid_normalized_rectangle n (Pobs P) _ hp
CausalSmith.Stat.PrivateCateRoughdesign.iid_conditional_membership_law · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/SelectionLaw.lean:88
theorem iid_conditional_membership_pair

On an exact label event, two selected coordinates have the independent conditional cell law, irrespective of the membership of the other records. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
n k :
ℕ
h :
ℝ
P :
j :
Fin k
I :
hp :
∀ r : Fin n,
(Pobs P) (if r ∈ I then {z : O | z.1 ∈ cell h k j} else {z : O | z.1 ∈ cell h k j}ᶜ) ≠ 0
i l :
Fin n
hi :
i ∈ I
hl :
l ∈ I
hil :
i ≠ l
MeasurePreserving (fun D : Dataset n => (D i, D l)) (((dataLaw n P) {D | cellRecords n h k D j = I})⁻¹ • (dataLaw n P).restrict {D | cellRecords n h k D j = I}) ((conditionalCellLaw h k P j).prod (conditionalCellLaw h k P j))
Proof (Lean source)
-- @node: iid_conditional_membership_pair lemma iid_conditional_membership_pair (n k : ℕ) (h : ℝ) (P : CausalLaw) (j : Fin k) (I : Finset (Fin n)) (hp : ∀ r : Fin n, (Pobs P) (if r ∈ I then {z : O | z.1 ∈ cell h k j} else {z : O | z.1 ∈ cell h k j}ᶜ) ≠ 0) (i l : Fin n) (hi : i ∈ I) (hl : l ∈ I) (hil : i ≠ l) : MeasurePreserving (fun D : Dataset n => (D i, D l)) (((dataLaw n P) {D | cellRecords n h k D j = I})⁻¹ • (dataLaw n P).restrict {D | cellRecords n h k D j = I}) ((conditionalCellLaw h k P j).prod (conditionalCellLaw h k P j)) := by classical let : IsProbabilityMeasure (Pobs P) := Measure.isProbabilityMeasure_map measurable_observe.aemeasurable let s := fun r : Fin n => if r ∈ I then {z : O | z.1 ∈ cell h k j} else {z : O | z.1 ∈ cell h k j}ᶜ let ν := fun r => ((Pobs P) (s r))⁻¹ • (Pobs P).restrict (s r) let : ∀ r, IsProbabilityMeasure (ν r) := fun r => normalized_record_restriction_probability (Pobs P) (s r) (hp r) have hind := ProbabilityTheory.iIndepFun_pi (μ := ν) (X := fun _ (z : O) => z) (fun _ => measurable_id.aemeasurable) have hm := (hind.indepFun hil).map_prod_eq_prod_map_map (measurable_pi_apply i).aemeasurable (measurable_pi_apply l).aemeasurable rw [(measurePreserving_eval ν i).map_eq, (measurePreserving_eval ν l).map_eq] at hm have hvi : ν i = conditionalCellLaw h k P j := by simp [ν, s, hi, conditionalCellLaw] have hvl : ν l = conditionalCellLaw h k P j := by simp [ν, s, hl, conditionalCellLaw] rw [hvi, hvl] at hm rw [iid_conditional_membership_law n k h P j I hp] exact ⟨by fun_prop, hm⟩
CausalSmith.Stat.PrivateCateRoughdesign.iid_conditional_membership_pair · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/SelectionLaw.lean:109
theorem iid_conditional_membership_pair_integral

Every selected pair on a fixed label event has the same kernel expectation. This is the conditional pair identity needed before summing the unordered pairs and then the label events. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
n k :
ℕ
h :
ℝ
P :
j :
Fin k
I :
hp :
∀ r : Fin n,
(Pobs P) (if r ∈ I then {z : O | z.1 ∈ cell h k j} else {z : O | z.1 ∈ cell h k j}ᶜ) ≠ 0
i l :
Fin n
hi :
i ∈ I
hl :
l ∈ I
hil :
i ≠ l
K :
O → O → ℝ
hK :
Integrable (fun z : O × O => K z.1 z.2) ((conditionalCellLaw h k P j).prod (conditionalCellLaw h k P j))
conclusion 1
Integrable (fun D : Dataset n => K (D i) (D l)) (((dataLaw n P) {D | cellRecords n h k D j = I})⁻¹ • (dataLaw n P).restrict {D | cellRecords n h k D j = I})
conclusion 2
(∫ D : Dataset n, K (D i) (D l) ∂(((dataLaw n P) {D | cellRecords n h k D j = I})⁻¹ • (dataLaw n P).restrict {D | cellRecords n h k D j = I}))
= ∫ z, K z.1 z.2 ∂(conditionalCellLaw h k P j).prod (conditionalCellLaw h k P j)
Proof (Lean source)
-- @node: iid_conditional_membership_pair_integral lemma iid_conditional_membership_pair_integral (n k : ℕ) (h : ℝ) (P : CausalLaw) (j : Fin k) (I : Finset (Fin n)) (hp : ∀ r : Fin n, (Pobs P) (if r ∈ I then {z : O | z.1 ∈ cell h k j} else {z : O | z.1 ∈ cell h k j}ᶜ) ≠ 0) (i l : Fin n) (hi : i ∈ I) (hl : l ∈ I) (hil : i ≠ l) (K : O → O → ℝ) (hK : Integrable (fun z : O × O => K z.1 z.2) ((conditionalCellLaw h k P j).prod (conditionalCellLaw h k P j))) : Integrable (fun D : Dataset n => K (D i) (D l)) (((dataLaw n P) {D | cellRecords n h k D j = I})⁻¹ • (dataLaw n P).restrict {D | cellRecords n h k D j = I}) ∧ (∫ D : Dataset n, K (D i) (D l) ∂(((dataLaw n P) {D | cellRecords n h k D j = I})⁻¹ • (dataLaw n P).restrict {D | cellRecords n h k D j = I})) = ∫ z, K z.1 z.2 ∂(conditionalCellLaw h k P j).prod (conditionalCellLaw h k P j) := by have hf := iid_conditional_membership_pair n k h P j I hp i l hi hl hil constructor · exact hf.integrable_comp_of_integrable hK · rw [← hf.map_eq] at hK ⊢ exact (integral_map hf.measurable.aemeasurable hK.aestronglyMeasurable).symm
CausalSmith.Stat.PrivateCateRoughdesign.iid_conditional_membership_pair_integral · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/SelectionLaw.lean:143
theorem cell_membership_label_positive

The complete density model gives positive probability to either membership label. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
hk :
2 ≤ k
hh :
0 < h ∧ h ≤ 1 / 4
P :
hP :
j :
Fin k
I :
i :
Fin n
(Pobs P) (if i ∈ I then {z : O | z.1 ∈ cell h k j} else {z : O | z.1 ∈ cell h k j}ᶜ) ≠ 0
Proof (Lean source)
-- @node: cell_membership_label_positive lemma cell_membership_label_positive (n k : ℕ) (h : ℝ) (hk : 2 ≤ k) (hh : 0 < h ∧ h ≤ 1 / 4) (P : CausalLaw) (hP : CompleteModel P) (j : Fin k) (I : Finset (Fin n)) (i : Fin n) : (Pobs P) (if i ∈ I then {z : O | z.1 ∈ cell h k j} else {z : O | z.1 ∈ cell h k j}ᶜ) ≠ 0 := by classical let : IsProbabilityMeasure (Pobs P) := Measure.isProbabilityMeasure_map measurable_observe.aemeasurable have hd := (cell_endpoint_bounds k h (by omega) hh j).2.2.2 obtain ⟨hlo, hhi⟩ := cellMass_density_bounds k h (by omega) hh P hP j have hw : cellWidth h k ≤ 1 / 4 := by unfold cellWidth apply (div_le_iff₀ (by positivity : (0 : ℝ) < k)).mpr have hkR : (2 : ℝ) ≤ k := by exact_mod_cast hk nlinarith [hh.2] have hp : 0 < (Pobs P).real {z : O | z.1 ∈ cell h k j} := by rw [observed_cell_mass] linarith have hc : 0 < (Pobs P).real {z : O | z.1 ∈ cell h k j}ᶜ := by have hs : MeasurableSet {z : O | z.1 ∈ cell h k j} := (measurableSet_cell h k j).preimage measurable_fst rw [probReal_compl_eq_one_sub (μ := Pobs P) hs, observed_cell_mass] linarith split_ifs · intro hz simp [measureReal_def, hz] at hp · intro hz simp [measureReal_def, hz] at hc
CausalSmith.Stat.PrivateCateRoughdesign.cell_membership_label_positive · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/SelectionLaw.lean:169
theorem conditional_membership_probability

A normalized exact label event is a probability measure. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
n k :
ℕ
h :
ℝ
P :
j :
Fin k
I :
hp :
∀ r : Fin n,
(Pobs P) (if r ∈ I then {z : O | z.1 ∈ cell h k j} else {z : O | z.1 ∈ cell h k j}ᶜ) ≠ 0
IsProbabilityMeasure (((dataLaw n P) {D | cellRecords n h k D j = I})⁻¹ • (dataLaw n P).restrict {D | cellRecords n h k D j = I})
Proof (Lean source)
-- @node: conditional_membership_probability lemma conditional_membership_probability (n k : ℕ) (h : ℝ) (P : CausalLaw) (j : Fin k) (I : Finset (Fin n)) (hp : ∀ r : Fin n, (Pobs P) (if r ∈ I then {z : O | z.1 ∈ cell h k j} else {z : O | z.1 ∈ cell h k j}ᶜ) ≠ 0) : IsProbabilityMeasure (((dataLaw n P) {D | cellRecords n h k D j = I})⁻¹ • (dataLaw n P).restrict {D | cellRecords n h k D j = I}) := by classical let : IsProbabilityMeasure (Pobs P) := Measure.isProbabilityMeasure_map measurable_observe.aemeasurable rw [iid_conditional_membership_law n k h P j I hp] let : ∀ r : Fin n, IsProbabilityMeasure (((Pobs P) (if r ∈ I then {z : O | z.1 ∈ cell h k j} else {z : O | z.1 ∈ cell h k j}ᶜ))⁻¹ • (Pobs P).restrict (if r ∈ I then {z : O | z.1 ∈ cell h k j} else {z : O | z.1 ∈ cell h k j}ᶜ)) := fun r => normalized_record_restriction_probability (Pobs P) _ (hp r) infer_instance
CausalSmith.Stat.PrivateCateRoughdesign.conditional_membership_probability · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/SelectionLaw.lean:201
theorem conditional_selected_pairContribution_expectation

Summing the selected unordered pairs at fixed membership labels gives occupancy times the common conditional pair moment. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
n k :
ℕ
h :
ℝ
P :
j :
Fin k
I :
hp :
∀ r : Fin n,
(Pobs P) (if r ∈ I then {z : O | z.1 ∈ cell h k j} else {z : O | z.1 ∈ cell h k j}ᶜ) ≠ 0
e :
Fin I.card ≃ {i // i ∈ I}
K :
O → O → ℝ
hK :
Integrable (fun z : O × O => K z.1 z.2) ((conditionalCellLaw h k P j).prod (conditionalCellLaw h k P j))
(∫ D : Dataset n, pairContribution K (fun i => D (e i)) ∂(((dataLaw n P) {D | cellRecords n h k D j = I})⁻¹ • (dataLaw n P).restrict {D | cellRecords n h k D j = I}))
= (if I.card < 2 then 0 else (I.card : ℝ)) * ∫ z, K z.1 z.2 ∂(conditionalCellLaw h k P j).prod (conditionalCellLaw h k P j)
Proof (Lean source)
-- @node: conditional_selected_pairContribution_expectation lemma conditional_selected_pairContribution_expectation (n k : ℕ) (h : ℝ) (P : CausalLaw) (j : Fin k) (I : Finset (Fin n)) (hp : ∀ r : Fin n, (Pobs P) (if r ∈ I then {z : O | z.1 ∈ cell h k j} else {z : O | z.1 ∈ cell h k j}ᶜ) ≠ 0) (e : Fin I.card ≃ {i // i ∈ I}) (K : O → O → ℝ) (hK : Integrable (fun z : O × O => K z.1 z.2) ((conditionalCellLaw h k P j).prod (conditionalCellLaw h k P j))) : (∫ D : Dataset n, pairContribution K (fun i => D (e i)) ∂(((dataLaw n P) {D | cellRecords n h k D j = I})⁻¹ • (dataLaw n P).restrict {D | cellRecords n h k D j = I})) = (if I.card < 2 then 0 else (I.card : ℝ)) * ∫ z, K z.1 z.2 ∂(conditionalCellLaw h k P j).prod (conditionalCellLaw h k P j) := by classical let Q := ((dataLaw n P) {D | cellRecords n h k D j = I})⁻¹ • (dataLaw n P).restrict {D | cellRecords n h k D j = I} by_cases hs : I.card < 2 · simp [pairContribution, hs] have hc : (choose I.card 2 : ℝ) ≠ 0 := by exact_mod_cast (Nat.choose_pos (show 2 ≤ I.card by omega)).ne' have hpairs (i l : Fin I.card) (hil : i ≠ l) := iid_conditional_membership_pair_integral n k h P j I hp (e i) (e l) (e i).property (e l).property (fun he => hil (e.injective (Subtype.ext he))) K hK have hi (i l : Fin I.card) : Integrable (fun D : Dataset n => if i < l then K (D (e i)) (D (e l)) else 0) Q := by by_cases hil : i < l · simpa only [if_pos hil] using (hpairs i l hil.ne).1 · simp only [if_neg hil] exact integrable_zero _ _ _ have hm (i l : Fin I.card) : (∫ D : Dataset n, (if i < l then K (D (e i)) (D (e l)) else 0) ∂Q) = (if i < l then (1 : ℝ) else 0) * ∫ z, K z.1 z.2 ∂(conditionalCellLaw h k P j).prod (conditionalCellLaw h k P j) := by by_cases hil : i < l · simp only [if_pos hil, one_mul] exact (hpairs i l hil.ne).2 · simp [hil] change (∫ D : Dataset n, pairContribution K (fun i => D (e i)) ∂Q) = _ simp only [pairContribution, if_neg hs] rw [integral_const_mul, integral_finset_sum _ (fun i _ => integrable_finset_sum _ (fun l _ => hi i l))] simp_rw [integral_finset_sum _ (fun l _ => hi _ l), hm, ← Finset.sum_mul] rw [ordered_pair_count] field_simp [hc]
CausalSmith.Stat.PrivateCateRoughdesign.conditional_selected_pairContribution_expectation · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/SelectionLaw.lean:222
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.SignBlockFactorization 4 declarations Finite fair-sign averages factor over disjoint coordinate blocks, by iterating Causalean's two-block expectation identity.

Finite fair-sign averages factor over disjoint coordinate blocks, by iterating Causalean's two-block expectation identity.

A single latent sign is a fair bit.

Definition (Lean source)
fairBitDesign :
clause 1
p _ := 1 / 2
clause 2
p_nonneg _ := by norm_num
clause 3
p_sum := by simp [Fintype.sum_bool]
theorem fairSignDesign_E

The independent fair-bit design expectation is the uniform finite sign average. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
ι :
F :
(ι → Bool) → ℝ
(prodDesign (fun _ : ι => fairBitDesign)).E F
= (2 : ℝ)^(-((card ι) : ℤ)) * ∑ lam, F lam
Proof (Lean source)
-- @node: fairSignDesign_E lemma fairSignDesign_E {ι : Type*} [Fintype ι] [DecidableEq ι] (F : (ι → Bool) → ℝ) : (prodDesign (fun _ : ι => fairBitDesign)).E F = (2 : ℝ)^(-((card ι) : ℤ)) * ∑ lam, F lam := by simp only [FiniteDesign.E, prodDesign_p, fairBitDesign, Finset.prod_const, Finset.card_univ, ← Finset.mul_sum] simp [zpow_neg, zpow_natCast, one_div]
theorem finiteDesign_disjointBlocks_prod Lemma finiteDesign_disjointBlocks_prod in the paper ↗

An arbitrary finite family of functions using pairwise disjoint coordinate blocks has factorized product expectation under an independent coordinate design. the theorem's stated inputs and assumptions, and the asserted conclusion follows.

Formal statement
ι κ :
Type*
ι → Type*
∀ i, Fintype (α i)
D :
∀ i, FiniteDesign (α i)
s :
A :
κ → Finset ι
F :
κ → (∀ i, α i) → ℝ
hdisj :
hdep :
∀ k ∈ s, ∀ w w', (∀ i ∈ A k, w i = w' i) → F k w = F k w'
(prodDesign D).E (fun w => ∏ k ∈ s, F k w) = ∏ k ∈ s, (prodDesign D).E (F k)
Proof (Lean source)
-- @node: finiteDesign_disjointBlocks_prod lemma finiteDesign_disjointBlocks_prod {ι κ : Type*} [Fintype ι] [DecidableEq ι] [DecidableEq κ] {α : ι → Type*} [∀ i, Fintype (α i)] (D : ∀ i, FiniteDesign (α i)) (s : Finset κ) (A : κ → Finset ι) (F : κ → (∀ i, α i) → ℝ) (hdisj : PairwiseDisjoint (s : Set κ) A) (hdep : ∀ k ∈ s, ∀ w w', (∀ i ∈ A k, w i = w' i) → F k w = F k w') : (prodDesign D).E (fun w => ∏ k ∈ s, F k w) = ∏ k ∈ s, (prodDesign D).E (F k) := by classical induction s using Finset.induction_on with | empty => simp [FiniteDesign.E_const] | @insert k s hk ih => simp only [Finset.prod_insert hk] rw [FiniteDesign.E_prod_block_mul D (A k) (F k) (fun w => ∏ l ∈ s, F l w)] · rw [ih] · intro i hi j hj hij exact hdisj (Finset.mem_insert_of_mem hi) (Finset.mem_insert_of_mem hj) hij · intro l hl exact hdep l (Finset.mem_insert_of_mem hl) · exact hdep k (Finset.mem_insert_self k s) · intro w w' hagree apply Finset.prod_congr rfl intro l hl apply hdep l (Finset.mem_insert_of_mem hl) w w' intro i hi apply hagree i intro hik have hkl : k ≠ l := by intro heq; subst l; exact hk hl exact Finset.disjoint_left.mp (hdisj (Finset.mem_insert_self k s) (Finset.mem_insert_of_mem hl) hkl) hik hi
CausalSmith.Stat.PrivateCateRoughdesign.finiteDesign_disjointBlocks_prod · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/SignBlockFactorization.lean:28
theorem fairSignAverage_disjointBlocks_prod Lemma fairSignAverage_disjointBlocks_prod in the paper ↗

Uniform fair-sign averaging commutes with a product of functions of disjoint sign blocks. the theorem's stated inputs and assumptions, and the asserted conclusion follows.

Formal statement
ι κ :
s :
A :
κ → Finset ι
F :
κ → (ι → Bool) → ℝ
hdisj :
hdep :
∀ k ∈ s, ∀ w w', (∀ i ∈ A k, w i = w' i) → F k w = F k w'
(2 : ℝ)^(-((card ι) : ℤ)) * ∑ lam, ∏ k ∈ s, F k lam
= ∏ k ∈ s, ((2 : ℝ)^(-((card ι) : ℤ)) * ∑ lam, F k lam)
Proof (Lean source)
-- @node: fairSignAverage_disjointBlocks_prod lemma fairSignAverage_disjointBlocks_prod {ι κ : Type*} [Fintype ι] [DecidableEq ι] [DecidableEq κ] (s : Finset κ) (A : κ → Finset ι) (F : κ → (ι → Bool) → ℝ) (hdisj : PairwiseDisjoint (s : Set κ) A) (hdep : ∀ k ∈ s, ∀ w w', (∀ i ∈ A k, w i = w' i) → F k w = F k w') : (2 : ℝ)^(-((card ι) : ℤ)) * ∑ lam, ∏ k ∈ s, F k lam = ∏ k ∈ s, ((2 : ℝ)^(-((card ι) : ℤ)) * ∑ lam, F k lam) := by simpa only [fairSignDesign_E] using finiteDesign_disjointBlocks_prod (fun _ => fairBitDesign) s A F hdisj hdep
CausalSmith.Stat.PrivateCateRoughdesign.fairSignAverage_disjointBlocks_prod · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/SignBlockFactorization.lean:63
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.SignProduct 3 declarations Uniform finite sign averages as independent fair-bit product integrals, and the published bounded-differences gate transported to arbitrary finite sign indices.

Uniform finite sign averages as independent fair-bit product integrals, and the published bounded-differences gate transported to arbitrary finite sign indices.

theorem fairSignProduct_singleton Lemma fairSignProduct_singleton in the paper ↗

Every atom of the independent fair-bit product has the same reciprocal-cardinality mass. The displayed conclusion follows.

Formal statement
ι :
z :
ι → Bool
Measure.pi (fun _ : ι => (uniformOfFintype Bool).toMeasure) {z}
= (card (ι → Bool) : ENNReal)⁻¹
Proof (Lean source)
-- @node: fairSignProduct_singleton lemma fairSignProduct_singleton {ι : Type*} [Fintype ι] [DecidableEq ι] (z : ι → Bool) : Measure.pi (fun _ : ι => (uniformOfFintype Bool).toMeasure) {z} = (card (ι → Bool) : ENNReal)⁻¹ := by classical rw [Measure.pi_singleton] simp only [(uniformOfFintype Bool).toMeasure_apply_singleton _ (measurableSet_singleton _), PMF.uniformOfFintype_apply, Fintype.card_bool, Finset.prod_const, Finset.card_univ, Fintype.card_fun, Nat.cast_pow, ENNReal.inv_pow]
CausalSmith.Stat.PrivateCateRoughdesign.fairSignProduct_singleton · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/SignProduct.lean:11
theorem integral_fairSignProduct Lemma integral_fairSignProduct in the paper ↗

Integrating a function of independent fair bits is exactly its uniform finite average. The displayed conclusion follows.

Formal statement
ι :
F :
(ι → Bool) → ℝ
(∫ z, F z ∂Measure.pi (fun _ : ι => (uniformOfFintype Bool).toMeasure))
= (∑ z, F z) / (card (ι → Bool) : ℝ)
Proof (Lean source)
-- @node: integral_fairSignProduct lemma integral_fairSignProduct {ι : Type*} [Fintype ι] [DecidableEq ι] (F : (ι → Bool) → ℝ) : (∫ z, F z ∂Measure.pi (fun _ : ι => (uniformOfFintype Bool).toMeasure)) = (∑ z, F z) / (card (ι → Bool) : ℝ) := by classical rw [integral_fintype Integrable.of_finite] simp only [Measure.real, fairSignProduct_singleton, ENNReal.toReal_inv, ENNReal.toReal_natCast, smul_eq_mul] rw [← Finset.mul_sum, div_eq_mul_inv, mul_comm]
CausalSmith.Stat.PrivateCateRoughdesign.integral_fairSignProduct · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/SignProduct.lean:22
theorem finite_sign_mgf_average

The published independent-coordinate mgf gate bounds a centered uniform finite-sign average on any finite index type, after reindexing its coordinates by Fin. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
ι :
F :
(ι → Bool) → ℝ
hzero :
(∑ z, F z) = 0
hbound :
∃ C : ℝ, ∀ z, |F z| ≤ C
c :
ι → ℝ
hc :
∀ i, 0 ≤ c i
hchange :
∀ i z b, |F z - F (update z i b)| ≤ c i
u :
ℝ
hu :
0 ≤ u
(∑ z, exp (u * F z)) / (card (ι → Bool) : ℝ)
≤ exp (u^2 / 8 * ∑ i, (c i)^2)
Proof (Lean source)
-- @node: finite_sign_mgf_average lemma finite_sign_mgf_average (gate : BoundedDifferencesMGF) {ι : Type*} [Fintype ι] [DecidableEq ι] (F : (ι → Bool) → ℝ) (hzero : (∑ z, F z) = 0) (hbound : ∃ C : ℝ, ∀ z, |F z| ≤ C) (c : ι → ℝ) (hc : ∀ i, 0 ≤ c i) (hchange : ∀ i z b, |F z - F (update z i b)| ≤ c i) (u : ℝ) (hu : 0 ≤ u) : (∑ z, exp (u * F z)) / (card (ι → Bool) : ℝ) ≤ exp (u^2 / 8 * ∑ i, (c i)^2) := by classical let e : Fin (card ι) ≃ ι := (Fintype.equivFin ι).symm let E : (Fin (card ι) → Bool) ≃ (ι → Bool) := e.arrowCongr (Equiv.refl Bool) have hupdate (z : Fin (card ι) → Bool) (i : Fin (card ι)) (b : Bool) : E (update z i b) = update (E z) (e i) b := by funext j change update z i b (e.symm j) = update (E z) (e i) b j by_cases hj : j = e i · subst j; simp · have hi : e.symm j ≠ i := by intro h; apply hj; exact (e.symm_apply_eq).mp h simp [Function.update_of_ne hj, Function.update_of_ne hi, E, Equiv.arrowCongr] have hmean : (∫ z, F (E z) ∂Measure.pi (fun _ : Fin (card ι) => (uniformOfFintype Bool).toMeasure)) = 0 := by rw [integral_fairSignProduct, E.sum_comp F, hzero, zero_div] have hm := gate (card ι) (fun _ => Bool) (fun _ => inferInstance) (fun _ => (uniformOfFintype Bool).toMeasure) (fun _ => inferInstance) (fun z => F (E z)) (by fun_prop) (by obtain ⟨C, hC⟩ := hbound exact ⟨C, fun z => hC (E z)⟩) (fun i => c (e i)) (fun i => hc (e i)) (by intro i z b rw [hupdate] exact hchange (e i) (E z) b) u hu rw [hmean] at hm simp only [sub_zero] at hm rw [integral_fairSignProduct, E.sum_comp (fun z => exp (u * F z))] at hm have hcard : card (Fin (card ι) → Bool) = card (ι → Bool) := Fintype.card_congr E rw [hcard, e.sum_comp (fun i => (c i)^2)] at hm exact hm
CausalSmith.Stat.PrivateCateRoughdesign.finite_sign_mgf_average · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/SignProduct.lean:33
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.Stability 31 declarations All-count sensitivity and Efron--Stein-conditional iid variance stability.

All-count sensitivity and Efron--Stein-conditional iid variance stability.

theorem ordered_pair_sum_append Lemma ordered_pair_sum_append in the paper ↗

Appending a last index adds exactly its pairs with the existing indices. The displayed conclusion follows.

Formal statement
s :
ℕ
f :
Fin (s + 1) → Fin (s + 1) → ℝ
(∑ i, ∑ l, if i < l then f i l else 0)
= (∑ i : Fin s, ∑ l : Fin s, if i < l then f i.castSucc l.castSucc else 0)
+ ∑ i : Fin s, f i.castSucc (last s)
Proof (Lean source)
-- @node: ordered_pair_sum_append lemma ordered_pair_sum_append (s : ℕ) (f : Fin (s + 1) → Fin (s + 1) → ℝ) : (∑ i, ∑ l, if i < l then f i l else 0) = (∑ i : Fin s, ∑ l : Fin s, if i < l then f i.castSucc l.castSucc else 0) + ∑ i : Fin s, f i.castSucc (last s) := by classical rw [Fin.sum_univ_castSucc] have hlast : ∀ i : Fin s, ¬ last s < i.castSucc := fun i => not_lt.mpr (Fin.castSucc_lt_last i).le simp [Fin.sum_univ_castSucc, hlast, Finset.sum_add_distrib]
CausalSmith.Stat.PrivateCateRoughdesign.ordered_pair_sum_append · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Stability.lean:8

The number of ordered index pairs with the first strictly smaller is the binomial count. The displayed conclusion follows.

Formal statement
s :
ℕ
(∑ i : Fin s, ∑ l : Fin s, if i < l then (1 : ℝ) else 0) = (choose s 2 : ℝ)
Proof (Lean source)
-- @node: ordered_pair_count lemma ordered_pair_count (s : ℕ) : (∑ i : Fin s, ∑ l : Fin s, if i < l then (1 : ℝ) else 0) = (choose s 2 : ℝ) := by induction s with | zero => simp | succ s ih => rw [ordered_pair_sum_append, ih] simp [Nat.choose_succ_succ, Nat.choose_one_right, add_comm]
CausalSmith.Stat.PrivateCateRoughdesign.ordered_pair_count · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Stability.lean:21

A unit-bounded kernel has a pair sum bounded by the number of pairs. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
s :
ℕ
K :
O → O → ℝ
z :
Fin s → O
hK :
∀ x y, |K x y| ≤ 1
|∑ i : Fin s, ∑ l : Fin s, if i < l then K (z i) (z l) else 0| ≤ (choose s 2 : ℝ)
Proof (Lean source)
-- @node: ordered_pair_sum_bound lemma ordered_pair_sum_bound (s : ℕ) (K : O → O → ℝ) (z : Fin s → O) (hK : ∀ x y, |K x y| ≤ 1) : |∑ i : Fin s, ∑ l : Fin s, if i < l then K (z i) (z l) else 0| ≤ (choose s 2 : ℝ) := by calc _ ≤ ∑ i : Fin s, |∑ l : Fin s, if i < l then K (z i) (z l) else 0| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ i : Fin s, ∑ l : Fin s, |if i < l then K (z i) (z l) else 0| := by apply Finset.sum_le_sum intro i hi exact Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ i : Fin s, ∑ l : Fin s, if i < l then (1 : ℝ) else 0 := by apply Finset.sum_le_sum intro i hi apply Finset.sum_le_sum intro l hl by_cases hil : i < l · simpa only [if_pos hil] using hK (z i) (z l) · simp only [if_neg hil, abs_zero, le_refl] _ = _ := ordered_pair_count s
CausalSmith.Stat.PrivateCateRoughdesign.ordered_pair_sum_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Stability.lean:32
theorem pairContribution_abs_le Lemma pairContribution_abs_le in the paper ↗

Count-weighted pair contributions are bounded by the occupancy, at every count. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
s :
ℕ
K :
O → O → ℝ
z :
Fin s → O
hK :
∀ x y, |K x y| ≤ 1
|pairContribution K z| ≤ s
Proof (Lean source)
-- @node: pairContribution_abs_le lemma pairContribution_abs_le (s : ℕ) (K : O → O → ℝ) (z : Fin s → O) (hK : ∀ x y, |K x y| ≤ 1) : |pairContribution K z| ≤ s := by classical by_cases hs : s < 2 · simp [pairContribution, hs] have hc : 0 < (choose s 2 : ℝ) := by exact_mod_cast Nat.choose_pos (show 2 ≤ s by omega) rw [pairContribution, if_neg hs, abs_mul, abs_of_nonneg (div_nonneg (Nat.cast_nonneg s) hc.le)] calc _ ≤ ((s : ℝ) / choose s 2) * (choose s 2 : ℝ) := mul_le_mul_of_nonneg_left (ordered_pair_sum_bound s K z hK) (by positivity) _ = _ := div_mul_cancel₀ _ hc.ne'
CausalSmith.Stat.PrivateCateRoughdesign.pairContribution_abs_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Stability.lean:55
theorem pairContribution_insertion_identity Lemma pairContribution_insertion_identity in the paper ↗

At occupancy at least two, insertion equals twice the new-pair average minus the old pair average, as in the all-count stability roadmap. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
s :
ℕ
hs :
2 ≤ s
K :
O → O → ℝ
z :
Fin (s + 1) → O
pairContribution K z - pairContribution K (fun i : Fin s => z i.castSucc)
= 2 / (s : ℝ) * (∑ i : Fin s, K (z i.castSucc) (z (last s)))
- pairContribution K (fun i : Fin s => z i.castSucc) / (s : ℝ)
Proof (Lean source)
-- @node: pairContribution_insertion_identity lemma pairContribution_insertion_identity (s : ℕ) (hs : 2 ≤ s) (K : O → O → ℝ) (z : Fin (s + 1) → O) : pairContribution K z - pairContribution K (fun i : Fin s => z i.castSucc) = 2 / (s : ℝ) * (∑ i : Fin s, K (z i.castSucc) (z (last s))) - pairContribution K (fun i : Fin s => z i.castSucc) / (s : ℝ) := by classical have hs0 : (s : ℝ) ≠ 0 := by exact_mod_cast (show s ≠ 0 by omega) have hs1 : (s : ℝ) - 1 ≠ 0 := by have : (2 : ℝ) ≤ s := by exact_mod_cast hs linarith simp only [pairContribution, show ¬s < 2 by omega, show ¬s + 1 < 2 by omega, if_false] rw [ordered_pair_sum_append] simp only [Nat.cast_choose_two ℝ, Nat.cast_add, Nat.cast_one] have hsp : (s : ℝ) + 1 ≠ 0 := by positivity field_simp [hs0, hs1, hsp] ring
CausalSmith.Stat.PrivateCateRoughdesign.pairContribution_insertion_identity · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Stability.lean:71
theorem insertion_pair_sum_bound Lemma insertion_pair_sum_bound in the paper ↗

The new pairs have total absolute value at most the old occupancy. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
s :
ℕ
K :
O → O → ℝ
z :
Fin (s + 1) → O
hK :
∀ x y, |K x y| ≤ 1
|∑ i : Fin s, K (z i.castSucc) (z (last s))| ≤ s
Proof (Lean source)
-- @node: insertion_pair_sum_bound lemma insertion_pair_sum_bound (s : ℕ) (K : O → O → ℝ) (z : Fin (s + 1) → O) (hK : ∀ x y, |K x y| ≤ 1) : |∑ i : Fin s, K (z i.castSucc) (z (last s))| ≤ s := by calc _ ≤ ∑ i : Fin s, |K (z i.castSucc) (z (last s))| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ i : Fin s, (1 : ℝ) := Finset.sum_le_sum (fun i hi => hK _ _) _ = _ := by simp
CausalSmith.Stat.PrivateCateRoughdesign.insertion_pair_sum_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Stability.lean:92
theorem pairContribution_insertion_bound_large Lemma pairContribution_insertion_bound_large in the paper ↗

Inserting into a cell with at least two records changes a scalar contribution by at most three, using the exact pair identity rather than a count-specific approximation. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
s :
ℕ
hs :
2 ≤ s
K :
O → O → ℝ
z :
Fin (s + 1) → O
hK :
∀ x y, |K x y| ≤ 1
|pairContribution K z - pairContribution K (fun i : Fin s => z i.castSucc)| ≤ 3
Proof (Lean source)
-- @node: pairContribution_insertion_bound_large lemma pairContribution_insertion_bound_large (s : ℕ) (hs : 2 ≤ s) (K : O → O → ℝ) (z : Fin (s + 1) → O) (hK : ∀ x y, |K x y| ≤ 1) : |pairContribution K z - pairContribution K (fun i : Fin s => z i.castSucc)| ≤ 3 := by have hsR : 0 < (s : ℝ) := by exact_mod_cast (show 0 < s by omega) have hb := insertion_pair_sum_bound s K z hK have hf := pairContribution_abs_le s K (fun i => z i.castSucc) hK rw [pairContribution_insertion_identity s hs K z] calc _ ≤ |2 / (s : ℝ) * ∑ i : Fin s, K (z i.castSucc) (z (last s))| + |pairContribution K (fun i : Fin s => z i.castSucc) / (s : ℝ)| := abs_sub _ _ _ = (2 / (s : ℝ)) * |∑ i : Fin s, K (z i.castSucc) (z (last s))| + |pairContribution K (fun i : Fin s => z i.castSucc)| / (s : ℝ) := by simp only [abs_mul, abs_div, abs_of_pos hsR, abs_of_nonneg (by norm_num : (0 : ℝ) ≤ 2)] _ ≤ (2 / (s : ℝ)) * (s : ℝ) + (s : ℝ) / (s : ℝ) := add_le_add (mul_le_mul_of_nonneg_left hb (by positivity)) (div_le_div_of_nonneg_right hf hsR.le) _ = 3 := by field_simp; ring
CausalSmith.Stat.PrivateCateRoughdesign.pairContribution_insertion_bound_large · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Stability.lean:103
theorem pairContribution_small_counts Lemma pairContribution_small_counts in the paper ↗

A singleton contributes zero, and the first pair contributes twice its kernel value. The displayed conclusion follows.

Formal statement
K :
O → O → ℝ
z :
Fin 2 → O
conclusion 1
pairContribution K (fun i : Fin 1 => z i.castSucc) = 0
conclusion 2
pairContribution K z = 2 * K (z 0) (z 1)
Proof (Lean source)
-- @node: pairContribution_small_counts lemma pairContribution_small_counts (K : O → O → ℝ) (z : Fin 2 → O) : pairContribution K (fun i : Fin 1 => z i.castSucc) = 0 ∧ pairContribution K z = 2 * K (z 0) (z 1) := by classical simp [pairContribution, Fin.sum_univ_two]
CausalSmith.Stat.PrivateCateRoughdesign.pairContribution_small_counts · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Stability.lean:125
theorem pairContribution_insertion_bound Lemma pairContribution_insertion_bound in the paper ↗

The insertion bound includes empty and singleton cells as well as all larger occupancies. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
s :
ℕ
K :
O → O → ℝ
z :
Fin (s + 1) → O
hK :
∀ x y, |K x y| ≤ 1
|pairContribution K z - pairContribution K (fun i : Fin s => z i.castSucc)| ≤ 3
Proof (Lean source)
-- @node: pairContribution_insertion_bound lemma pairContribution_insertion_bound (s : ℕ) (K : O → O → ℝ) (z : Fin (s + 1) → O) (hK : ∀ x y, |K x y| ≤ 1) : |pairContribution K z - pairContribution K (fun i : Fin s => z i.castSucc)| ≤ 3 := by by_cases hs : 2 ≤ s · exact pairContribution_insertion_bound_large s hs K z hK have hsmall : s = 0 ∨ s = 1 := by omega rcases hsmall with rfl | rfl · simp [pairContribution] · obtain ⟨hzero, hpair⟩ := pairContribution_small_counts K z rw [hzero, hpair, sub_zero, abs_mul] have hb := hK (z 0) (z 1) rw [abs_of_pos (by norm_num : (0 : ℝ) < 2)] linarith
CausalSmith.Stat.PrivateCateRoughdesign.pairContribution_insertion_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Stability.lean:133
theorem causal_pair_kernel_bounds Lemma causal_pair_kernel_bounds in the paper ↗

Both causal pair kernels are symmetric, and their joint absolute mass is at most two. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
z z' :
O
conclusion 1
KN z z' = KN z' z
conclusion 2
KD z z' = KD z' z
conclusion 3
|KN z z'| ≤ KD z z'
conclusion 4
0 ≤ KD z z'
conclusion 5
KD z z' ≤ 1
Proof (Lean source)
-- @node: causal_pair_kernel_bounds lemma causal_pair_kernel_bounds (z z' : O) : KN z z' = KN z' z ∧ KD z z' = KD z' z ∧ |KN z z'| ≤ KD z z' ∧ 0 ≤ KD z z' ∧ KD z z' ≤ 1 := by rcases z with ⟨x, a, y⟩ rcases z' with ⟨x', a', y'⟩ cases a <;> cases a' <;> cases y <;> cases y' <;> norm_num [KN, KD, bit]
CausalSmith.Stat.PrivateCateRoughdesign.causal_pair_kernel_bounds · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Stability.lean:149
theorem causal_pair_kernel_unit_bounds Lemma causal_pair_kernel_unit_bounds in the paper ↗

The causal numerator and denominator satisfy the scalar unit-kernel bound. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
z z' :
O
conclusion 1
|KN z z'| ≤ 1
conclusion 2
|KD z z'| ≤ 1
Proof (Lean source)
-- @node: causal_pair_kernel_unit_bounds lemma causal_pair_kernel_unit_bounds (z z' : O) : |KN z z'| ≤ 1 ∧ |KD z z'| ≤ 1 := by obtain ⟨hsN, hsD, hND, hD0, hD1⟩ := causal_pair_kernel_bounds z z' exact ⟨hND.trans hD1, by rwa [abs_of_nonneg hD0]⟩
CausalSmith.Stat.PrivateCateRoughdesign.causal_pair_kernel_unit_bounds · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Stability.lean:158
theorem causal_pair_insertion_bound Lemma causal_pair_insertion_bound in the paper ↗

The two causal contributions have joint insertion sensitivity at most six at every count. the theorem's stated inputs and assumptions, and the asserted conclusion follows.

Formal statement
s :
ℕ
z :
Fin (s + 1) → O
|pairContribution KN z
- pairContribution KN (fun i : Fin s => z i.castSucc)|
+ |pairContribution KD z
- pairContribution KD (fun i : Fin s => z i.castSucc)|
≤ 6
Proof (Lean source)
-- @node: causal_pair_insertion_bound lemma causal_pair_insertion_bound (s : ℕ) (z : Fin (s + 1) → O) : |pairContribution KN z - pairContribution KN (fun i : Fin s => z i.castSucc)| + |pairContribution KD z - pairContribution KD (fun i : Fin s => z i.castSucc)| ≤ 6 := by have hN := pairContribution_insertion_bound s KN z (fun x y => (causal_pair_kernel_unit_bounds x y).1) have hD := pairContribution_insertion_bound s KD z (fun x y => (causal_pair_kernel_unit_bounds x y).2) linarith
CausalSmith.Stat.PrivateCateRoughdesign.causal_pair_insertion_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Stability.lean:164
theorem causal_pair_replacement_bound Lemma causal_pair_replacement_bound in the paper ↗

A replacement through a common deleted dataset has joint sensitivity at most twelve. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
s :
ℕ
z z' :
Fin (s + 1) → O
hcommon :
∀ i : Fin s, z i.castSucc = z' i.castSucc
|pairContribution KN z
- pairContribution KN z'|
+ |pairContribution KD z
- pairContribution KD z'|
≤ 12
Proof (Lean source)
-- @node: causal_pair_replacement_bound lemma causal_pair_replacement_bound (s : ℕ) (z z' : Fin (s + 1) → O) (hcommon : ∀ i : Fin s, z i.castSucc = z' i.castSucc) : |pairContribution KN z - pairContribution KN z'| + |pairContribution KD z - pairContribution KD z'| ≤ 12 := by have hN : pairContribution KN (fun i : Fin s => z i.castSucc) = pairContribution KN (fun i : Fin s => z' i.castSucc) := by congr 1 funext i exact hcommon i have hD : pairContribution KD (fun i : Fin s => z i.castSucc) = pairContribution KD (fun i : Fin s => z' i.castSucc) := by congr 1 funext i exact hcommon i have hz := causal_pair_insertion_bound s z have hz' := causal_pair_insertion_bound s z' rw [← hN, ← hD] at hz' have htN := abs_sub_le (pairContribution KN z) (pairContribution KN (fun i : Fin s => z i.castSucc)) (pairContribution KN z') have htD := abs_sub_le (pairContribution KD z) (pairContribution KD (fun i : Fin s => z i.castSucc)) (pairContribution KD z') rw [abs_sub_comm (pairContribution KN (fun i : Fin s => z i.castSucc))] at htN rw [abs_sub_comm (pairContribution KD (fun i : Fin s => z i.castSucc))] at htD linarith
CausalSmith.Stat.PrivateCateRoughdesign.causal_pair_replacement_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Stability.lean:175
theorem replacement_square_indicator_bound Lemma replacement_square_indicator_bound in the paper ↗

The insertion indicator bound yields the squared replacement bound used by Efron--Stein. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
change J J' :
ℝ
hJ :
J = 0 ∨ J = 1
hJ' :
J' = 0 ∨ J' = 1
hchange :
|change| ≤ 3 * (J + J')
change^2 ≤ 18 * (J + J')
Proof (Lean source)
-- @node: replacement_square_indicator_bound lemma replacement_square_indicator_bound (change J J' : ℝ) (hJ : J = 0 ∨ J = 1) (hJ' : J' = 0 ∨ J' = 1) (hchange : |change| ≤ 3 * (J + J')) : change^2 ≤ 18 * (J + J') := by have hsq : change^2 ≤ (3 * (J + J'))^2 := by have hnonneg := abs_nonneg change nlinarith [sq_abs change] rcases hJ with rfl | rfl <;> rcases hJ' with rfl | rfl <;> nlinarith
CausalSmith.Stat.PrivateCateRoughdesign.replacement_square_indicator_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Stability.lean:202

Reindexing the selected record set by any finite enumeration preserves its moment sums. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n s :
ℕ
I :
e :
Fin s ≃ {i // i ∈ I}
v :
Fin n → ℝ
(∑ i : Fin s, v (e i)) = ∑ i ∈ I, v i
Proof (Lean source)
-- @node: selected_sum lemma selected_sum (n s : ℕ) (I : Finset (Fin n)) (e : Fin s ≃ {i // i ∈ I}) (v : Fin n → ℝ) : (∑ i : Fin s, v (e i)) = ∑ i ∈ I, v i := by classical rw [e.sum_comp (fun i => v i.val)] exact Finset.sum_attach I v

Every enumeration of the records in a cell realizes its closed numerator and denominator as count-weighted pair contributions. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
D :
j :
Fin k
e :
Fin (cellCount n h k D j) ≃ {i // i ∈ cellRecords n h k D j}
conclusion 1
pairContribution KN (fun i => D (e i)) = numeratorCell n h k D j
conclusion 2
pairContribution KD (fun i => D (e i)) = denominatorCell n h k D j
Proof (Lean source)
-- @node: cell_pair_formulas lemma cell_pair_formulas (n k : ℕ) (h : ℝ) (D : Dataset n) (j : Fin k) (e : Fin (cellCount n h k D j) ≃ {i // i ∈ cellRecords n h k D j}) : pairContribution KN (fun i => D (e i)) = numeratorCell n h k D j ∧ pairContribution KD (fun i => D (e i)) = denominatorCell n h k D j := by classical obtain ⟨hN, hD⟩ := pair_moment_formulas _ (fun i => D (e i)) have hsum (v : O → ℝ) : (∑ i, v (D (e i))) = cellSum n h k D j v := selected_sum n _ _ e (fun i => v (D i)) rw [hsum (fun z => bit z.2.1 * bit z.2.2), hsum (fun z => bit z.2.1), hsum (fun z => bit z.2.2)] at hN rw [hsum (fun z => bit z.2.1)] at hD exact ⟨hN, hD⟩
CausalSmith.Stat.PrivateCateRoughdesign.cell_pair_formulas · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Stability.lean:221
theorem cell_contribution_bounds Lemma cell_contribution_bounds in the paper ↗

Each scalar cell contribution is bounded by its occupancy, including empty and singleton cells. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
D :
j :
Fin k
conclusion 1
|numeratorCell n h k D j| ≤ cellCount n h k D j
conclusion 2
|denominatorCell n h k D j| ≤ cellCount n h k D j
Proof (Lean source)
-- @node: cell_contribution_bounds lemma cell_contribution_bounds (n k : ℕ) (h : ℝ) (D : Dataset n) (j : Fin k) : |numeratorCell n h k D j| ≤ cellCount n h k D j ∧ |denominatorCell n h k D j| ≤ cellCount n h k D j := by classical let e : Fin (cellCount n h k D j) ≃ {i // i ∈ cellRecords n h k D j} := (Fintype.equivFinOfCardEq (by simp [cellCount])).symm obtain ⟨hN, hD⟩ := cell_pair_formulas n k h D j e rw [← hN, ← hD] exact ⟨pairContribution_abs_le _ KN _ (fun x y => (causal_pair_kernel_unit_bounds x y).1), pairContribution_abs_le _ KD _ (fun x y => (causal_pair_kernel_unit_bounds x y).2)⟩
CausalSmith.Stat.PrivateCateRoughdesign.cell_contribution_bounds · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Stability.lean:238

Distinct public cells are disjoint, including the final right endpoint. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
k :
ℕ
h :
ℝ
hh :
0 < h
hk :
0 < k
i j :
Fin k
hij :
i ≠ j
Disjoint (cell h k i) (cell h k j)
Proof (Lean source)
-- @node: cell_disjoint lemma cell_disjoint (k : ℕ) (h : ℝ) (hh : 0 < h) (hk : 0 < k) (i j : Fin k) (hij : i ≠ j) : Disjoint (cell h k i) (cell h k j) := by have hkR : (0 : ℝ) < k := by exact_mod_cast hk have hd : 0 < cellWidth h k := by unfold cellWidth; positivity have hw : (k : ℝ) * cellWidth h k = 2 * h := by unfold cellWidth field_simp have hlt (i j : Fin k) (hij : i < j) : Disjoint (cell h k i) (cell h k j) := by apply Set.disjoint_left.mpr intro x hxi hxj have horder : (i.val : ℝ) + 1 ≤ j.val := by exact_mod_cast hij have hupper := mul_le_mul_of_nonneg_right horder hd.le rcases hxi.2 with hi | ⟨hi, hx⟩ · linarith [hxj.1] · have : i.val < j.val := hij omega rcases lt_or_gt_of_ne hij with hij | hij · exact hlt i j hij · exact (hlt j i hij).symm

Disjoint cell selection counts each dataset record at most once. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
hh :
0 < h
hk :
0 < k
D :
(∑ j : Fin k, cellCount n h k D j) ≤ n
Proof (Lean source)
-- @node: total_cell_counts lemma total_cell_counts (n k : ℕ) (h : ℝ) (hh : 0 < h) (hk : 0 < k) (D : Dataset n) : (∑ j : Fin k, cellCount n h k D j) ≤ n := by classical have hd : ∀ i j : Fin k, i ≠ j → Disjoint (cellRecords n h k D i) (cellRecords n h k D j) := by intro i j hij apply Finset.disjoint_left.mpr intro r hi hj have hx := Set.disjoint_left.mp (cell_disjoint k h hh hk i j hij) exact hx (by simpa [cellRecords] using hi) (by simpa [cellRecords] using hj) have hcard := Finset.card_biUnion (s := (Finset.univ : Finset (Fin k))) (t := fun j => cellRecords n h k D j) (fun i _ j _ hij => hd i j hij) have hle := Finset.card_le_card (show Finset.univ.biUnion (fun j : Fin k => cellRecords n h k D j) ⊆ (Finset.univ : Finset (Fin n)) from Finset.subset_univ _) simpa only [hcard, Finset.card_univ, Fintype.card_fin, cellCount] using hle
CausalSmith.Stat.PrivateCateRoughdesign.total_cell_counts · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Stability.lean:274

Both scalar statistics are bounded by the sample size on every input dataset. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
hh :
0 < h
hk :
0 < k
D :
conclusion 1
|SN n h k D| ≤ n
conclusion 2
|SD n h k D| ≤ n
Proof (Lean source)
-- @node: statistic_bounds lemma statistic_bounds (n k : ℕ) (h : ℝ) (hh : 0 < h) (hk : 0 < k) (D : Dataset n) : |SN n h k D| ≤ n ∧ |SD n h k D| ≤ n := by have hc : (∑ j : Fin k, (cellCount n h k D j : ℝ)) ≤ n := by exact_mod_cast total_cell_counts n k h hh hk D constructor · exact (Finset.abs_sum_le_sum_abs _ _).trans ((Finset.sum_le_sum (fun j _ => (cell_contribution_bounds n k h D j).1)).trans hc) · exact (Finset.abs_sum_le_sum_abs _ _).trans ((Finset.sum_le_sum (fun j _ => (cell_contribution_bounds n k h D j).2)).trans hc)
CausalSmith.Stat.PrivateCateRoughdesign.statistic_bounds · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Stability.lean:293

The bounded measurable statistics belong to every finite-measure Lp space, in particular the square-integrability class needed for Efron--Stein. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
hh :
0 < h
hk :
0 < k
p :
conclusion 1
MemLp (SN n h k) p Q
conclusion 2
MemLp (SD n h k) p Q
Proof (Lean source)
-- @node: statistic_memLp lemma statistic_memLp (n k : ℕ) (h : ℝ) (hh : 0 < h) (hk : 0 < k) (Q : Measure (Dataset n)) [IsFiniteMeasure Q] (p : ENNReal) : MemLp (SN n h k) p Q ∧ MemLp (SD n h k) p Q := by constructor · apply MemLp.of_bound (by fun_prop) (n : ℝ) exact ae_of_all _ (fun D => by simpa only [Real.norm_eq_abs] using (statistic_bounds n k h hh hk D).1) · apply MemLp.of_bound (by fun_prop) (n : ℝ) exact ae_of_all _ (fun D => by simpa only [Real.norm_eq_abs] using (statistic_bounds n k h hh hk D).2)

The closed numerator moment formula on an arbitrary finite selected record set.

Definition (Lean source)
n :
ℕ
I :
D :
selectedNumerator I D :
ℝ
if I.card < 2 then 0 else 2 * ((I.card : ℝ) * (∑ i ∈ I, bit (D i).2.1 * bit (D i).2.2) - (∑ i ∈ I, bit (D i).2.1) * (∑ i ∈ I, bit (D i).2.2)) / ((I.card : ℝ) - 1)
CausalSmith.Stat.PrivateCateRoughdesign.selectedNumerator · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Stability.lean:321

The closed denominator moment formula on an arbitrary finite selected record set.

Definition (Lean source)
n :
ℕ
I :
D :
selectedDenominator I D :
ℝ
if I.card < 2 then 0 else 2 * ((I.card : ℝ) * (∑ i ∈ I, bit (D i).2.1) - (∑ i ∈ I, bit (D i).2.1)^2) / ((I.card : ℝ) - 1)
CausalSmith.Stat.PrivateCateRoughdesign.selectedDenominator · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Stability.lean:328
theorem selected_pair_formulas

An arbitrary finite record selection has the same closed moments as its enumerated pair contributions. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
I :
D :
e :
Fin I.card ≃ {i // i ∈ I}
conclusion 1
pairContribution KN (fun i => D (e i)) = selectedNumerator I D
conclusion 2
pairContribution KD (fun i => D (e i)) = selectedDenominator I D
Proof (Lean source)
-- @node: selected_pair_formulas lemma selected_pair_formulas {n : ℕ} (I : Finset (Fin n)) (D : Dataset n) (e : Fin I.card ≃ {i // i ∈ I}) : pairContribution KN (fun i => D (e i)) = selectedNumerator I D ∧ pairContribution KD (fun i => D (e i)) = selectedDenominator I D := by obtain ⟨hN, hD⟩ := pair_moment_formulas _ (fun i => D (e i)) have hsum (v : O → ℝ) : (∑ i, v (D (e i))) = ∑ i ∈ I, v (D i) := selected_sum n _ _ e (fun i => v (D i)) rw [hsum (fun z => bit z.2.1 * bit z.2.2), hsum (fun z => bit z.2.1), hsum (fun z => bit z.2.2)] at hN rw [hsum (fun z => bit z.2.1)] at hD exact ⟨hN, hD⟩
CausalSmith.Stat.PrivateCateRoughdesign.selected_pair_formulas · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Stability.lean:335
theorem selected_insertion_bound

Inserting one record into an arbitrary selected set changes the joint causal contribution by at most six, at every count. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
I :
D :
r :
Fin n
hr :
r ∉ I
Proof (Lean source)
-- @node: selected_insertion_bound lemma selected_insertion_bound {n : ℕ} (I : Finset (Fin n)) (D : Dataset n) (r : Fin n) (hr : r ∉ I) : |selectedNumerator (insert r I) D - selectedNumerator I D| + |selectedDenominator (insert r I) D - selectedDenominator I D| ≤ 6 := by classical let e : Fin I.card ≃ {i // i ∈ I} := (Fintype.equivFinOfCardEq (by simp)).symm let z : Fin (I.card + 1) → O := Fin.lastCases (D r) (fun i => D (e i)) have hz (i : Fin I.card) : z i.castSucc = D (e i) := by simp [z] have hlast : z (last I.card) = D r := by simp [z] have hsum (v : O → ℝ) : (∑ i, v (z i)) = ∑ i ∈ insert r I, v (D i) := by rw [Fin.sum_univ_castSucc] simp_rw [hz] rw [selected_sum n _ I e (fun i => v (D i)), Finset.sum_insert hr, hlast] exact add_comm _ _ obtain ⟨hN, hD⟩ := pair_moment_formulas _ z rw [hsum (fun z => bit z.2.1 * bit z.2.2), hsum (fun z => bit z.2.1), hsum (fun z => bit z.2.2)] at hN rw [hsum (fun z => bit z.2.1)] at hD have hcard := Finset.card_insert_of_notMem hr have hNi : pairContribution KN z = selectedNumerator (insert r I) D := by simpa only [selectedNumerator, hcard, Nat.cast_add, Nat.cast_one] using hN have hDi : pairContribution KD z = selectedDenominator (insert r I) D := by simpa only [selectedDenominator, hcard, Nat.cast_add, Nat.cast_one] using hD obtain ⟨hNo, hDo⟩ := selected_pair_formulas I D e have hb := causal_pair_insertion_bound I.card z simp_rw [hz] at hb rwa [hNi, hDi, hNo, hDo] at hb
CausalSmith.Stat.PrivateCateRoughdesign.selected_insertion_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Stability.lean:351
theorem selected_congr

Selected contributions depend only on records at the selected indices. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
I :
D D' :
heq :
∀ i ∈ I, D i = D' i
conclusion 1
Proof (Lean source)
-- @node: selected_congr lemma selected_congr {n : ℕ} (I : Finset (Fin n)) (D D' : Dataset n) (heq : ∀ i ∈ I, D i = D' i) : selectedNumerator I D = selectedNumerator I D' ∧ selectedDenominator I D = selectedDenominator I D' := by have hs (v : O → ℝ) : (∑ i ∈ I, v (D i)) = ∑ i ∈ I, v (D' i) := Finset.sum_congr rfl (fun i hi => congrArg v (heq i hi)) simp only [selectedNumerator, selectedDenominator] rw [hs (fun z => bit z.2.1 * bit z.2.2), hs (fun z => bit z.2.1), hs (fun z => bit z.2.2)] exact ⟨rfl, rfl⟩
theorem selected_erasure_bound

Erasing one selected record has joint sensitivity at most six; erasing an absent record has zero effect. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
I :
D :
r :
Fin n
- selectedNumerator (I.erase r) D|
- selectedDenominator (I.erase r) D|
≤ if r ∈ I then 6 else 0
Proof (Lean source)
-- @node: selected_erasure_bound lemma selected_erasure_bound {n : ℕ} (I : Finset (Fin n)) (D : Dataset n) (r : Fin n) : |selectedNumerator I D - selectedNumerator (I.erase r) D| + |selectedDenominator I D - selectedDenominator (I.erase r) D| ≤ if r ∈ I then 6 else 0 := by classical by_cases hr : r ∈ I · rw [if_pos hr] have hb := selected_insertion_bound (I.erase r) D r (Finset.notMem_erase r I) rwa [Finset.insert_erase hr] at hb · simp [hr]
CausalSmith.Stat.PrivateCateRoughdesign.selected_erasure_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Stability.lean:398

A replacement changes only its old and new cells, using their common erased selection. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
D D' :
r :
Fin n
heq :
∀ i
if
i ≠ r
then
D i = D' i
j :
Fin k
|numeratorCell n h k D j
- numeratorCell n h k D' j|
+ |denominatorCell n h k D j
- denominatorCell n h k D' j|
≤ (if (D r).1 ∈ cell h k j then 6 else 0) + (if (D' r).1 ∈ cell h k j then 6 else 0)
Proof (Lean source)
-- @node: cell_replacement_bound lemma cell_replacement_bound (n k : ℕ) (h : ℝ) (D D' : Dataset n) (r : Fin n) (heq : ∀ i, i ≠ r → D i = D' i) (j : Fin k) : |numeratorCell n h k D j - numeratorCell n h k D' j| + |denominatorCell n h k D j - denominatorCell n h k D' j| ≤ (if (D r).1 ∈ cell h k j then 6 else 0) + (if (D' r).1 ∈ cell h k j then 6 else 0) := by classical let I := cellRecords n h k D j let I' := cellRecords n h k D' j have hbase : I.erase r = I'.erase r := by ext i by_cases hi : i = r · subst i; simp · simp [I, I', cellRecords, hi, heq i hi] have hcommon : ∀ i ∈ I.erase r, D i = D' i := by intro i hi exact heq i (Finset.mem_erase.mp hi).1 obtain ⟨hcN, hcD⟩ := selected_congr (I.erase r) D D' hcommon rw [hbase] at hcN hcD have hb := selected_erasure_bound I D r have hb' := selected_erasure_bound I' D' r rw [← hcN, ← hcD, ← hbase] at hb' have hN := abs_sub_le (selectedNumerator I D) (selectedNumerator (I.erase r) D) (selectedNumerator I' D') have hD := abs_sub_le (selectedDenominator I D) (selectedDenominator (I.erase r) D) (selectedDenominator I' D') rw [abs_sub_comm (selectedNumerator (I.erase r) D)] at hN rw [abs_sub_comm (selectedDenominator (I.erase r) D)] at hD change |selectedNumerator I D - selectedNumerator I' D'| + |selectedDenominator I D - selectedDenominator I' D'| ≤ _ have hmem : (r ∈ I) ↔ (D r).1 ∈ cell h k j := by simp [I, cellRecords] have hmem' : (r ∈ I') ↔ (D' r).1 ∈ cell h k j := by simp [I', cellRecords] simp only [hmem] at hb simp only [hmem'] at hb' linarith
CausalSmith.Stat.PrivateCateRoughdesign.cell_replacement_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Stability.lean:414

A covariate belongs to at most one public cell, so its summed insertion envelope is at most six. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
k :
ℕ
h :
ℝ
hh :
0 < h
hk :
0 < k
x :
(∑ j : Fin k, if x ∈ cell h k j then (6 : ℝ) else 0) ≤ 6
Proof (Lean source)
-- @node: cell_membership_sum lemma cell_membership_sum (k : ℕ) (h : ℝ) (hh : 0 < h) (hk : 0 < k) (x : Covariate) : (∑ j : Fin k, if x ∈ cell h k j then (6 : ℝ) else 0) ≤ 6 := by classical by_cases hx : ∃ j : Fin k, x ∈ cell h k j · obtain ⟨j, hj⟩ := hx rw [Finset.sum_eq_single j] · simp [hj] · intro i hi hij have hnot : x ∉ cell h k i := by intro hx exact Set.disjoint_left.mp (cell_disjoint k h hh hk i j hij) hx hj simp [hnot] · simp · have hn : ∀ j : Fin k, x ∉ cell h k j := by simpa using hx simp [hn]
CausalSmith.Stat.PrivateCateRoughdesign.cell_membership_sum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Stability.lean:453
theorem statistic_replacement_bound Lemma statistic_replacement_bound in the paper ↗

Deletion followed by insertion bounds the joint statistic change by twelve, including replacements between different cells. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
hh :
0 < h
hk :
0 < k
D D' :
r :
Fin n
heq :
∀ i
if
i ≠ r
then
D i = D' i
|SN n h k D - SN n h k D'| + |SD n h k D - SD n h k D'| ≤ 12
Proof (Lean source)
-- @node: statistic_replacement_bound lemma statistic_replacement_bound (n k : ℕ) (h : ℝ) (hh : 0 < h) (hk : 0 < k) (D D' : Dataset n) (r : Fin n) (heq : ∀ i, i ≠ r → D i = D' i) : |SN n h k D - SN n h k D'| + |SD n h k D - SD n h k D'| ≤ 12 := by have hb := Finset.sum_le_sum (s := univ) (fun j _ => cell_replacement_bound n k h D D' r heq j) rw [Finset.sum_add_distrib, Finset.sum_add_distrib] at hb have hN : |SN n h k D - SN n h k D'| ≤ ∑ j : Fin k, |numeratorCell n h k D j - numeratorCell n h k D' j| := by rw [SN, SN, ← Finset.sum_sub_distrib] exact Finset.abs_sum_le_sum_abs _ _ have hD : |SD n h k D - SD n h k D'| ≤ ∑ j : Fin k, |denominatorCell n h k D j - denominatorCell n h k D' j| := by rw [SD, SD, ← Finset.sum_sub_distrib] exact Finset.abs_sum_le_sum_abs _ _ have ho := cell_membership_sum k h hh hk (D r).1 have hn := cell_membership_sum k h hh hk (D' r).1 linarith
CausalSmith.Stat.PrivateCateRoughdesign.statistic_replacement_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Stability.lean:473
theorem statistic_hamming_sensitivity Lemma statistic_hamming_sensitivity in the paper ↗

Hamming-distance-one datasets satisfy the asserted joint sensitivity bound on the entire input space. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
hh :
0 < h
hk :
0 < k
D D' :
hadj :
dHam n D D' = 1
|SN n h k D - SN n h k D'| + |SD n h k D - SD n h k D'| ≤ 12
Proof (Lean source)
-- @node: statistic_hamming_sensitivity lemma statistic_hamming_sensitivity (n k : ℕ) (h : ℝ) (hh : 0 < h) (hk : 0 < k) (D D' : Dataset n) (hadj : dHam n D D' = 1) : |SN n h k D - SN n h k D'| + |SD n h k D - SD n h k D'| ≤ 12 := by classical unfold dHam hammingDist at hadj obtain ⟨r, hr⟩ := Finset.card_eq_one.mp hadj apply statistic_replacement_bound n k h hh hk D D' r intro i hi by_contra hne have hmem : i ∈ (Finset.univ.filter (fun i => D i ≠ D' i)) := by simp [hne] rw [hr] at hmem exact hi (Finset.mem_singleton.mp hmem)
CausalSmith.Stat.PrivateCateRoughdesign.statistic_hamming_sensitivity · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/Stability.lean:495
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.TestingPriors 12 declarations Two finite, class-supported priors with fixed target separation and uniformly close outputs under every private Markov kernel.

Two finite, class-supported priors with fixed target separation and uniformly close outputs under every private Markov kernel.

def finiteProductMixture

A finite prior uniformly averages the observed product laws of its constituent causal laws.

Definition (Lean source)
n s :
ℕ
family :
finiteProductMixture n s family :
(s : ℝ≥0∞)⁻¹ • ∑ i : Fin s, dataLaw n (family i)
CausalSmith.Stat.PrivateCateRoughdesign.finiteProductMixture · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TestingPriors.lean:17
theorem directAlternative_contrast

The direct alternative has the localized contrast prescribed by the construction. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
x :
tau (directAlternative hL hhL) x = separation hL * bump hL x
Proof (Lean source)
-- @node: directAlternative_contrast lemma directAlternative_contrast (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (x : Covariate) : tau (directAlternative hL hhL) x = separation hL * bump hL x := by change (1/2 + separation hL * bump hL x) - 1/2 = _ ring
CausalSmith.Stat.PrivateCateRoughdesign.directAlternative_contrast · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TestingPriors.lean:21
theorem directAlternative_target

The direct alternative has exactly the common target required by the testing prior. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
theta (directAlternative hL hhL) = separation hL
Proof (Lean source)
-- @node: directAlternative_target lemma directAlternative_target (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) : theta (directAlternative hL hhL) = separation hL := by rw [theta, directAlternative_contrast, bump_at_target hL hhL.1.le, mul_one]
CausalSmith.Stat.PrivateCateRoughdesign.directAlternative_target · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TestingPriors.lean:28
theorem directAlternative_contrast_lipschitz

Scaling the bump cancels its inverse-radius modulus, giving radius-three regularity. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
Proof (Lean source)
-- @node: directAlternative_contrast_lipschitz lemma directAlternative_contrast_lipschitz (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) : ContrastLipschitz (directAlternative hL hhL) := by intro x y rw [directAlternative_contrast, directAlternative_contrast, ← mul_sub, abs_mul] have ht : 0 ≤ separation hL := (separation_le_sqrt hL hhL).1 rw [abs_of_nonneg ht] calc _ ≤ separation hL * ((2*pi/hL)*|(x : ℝ)-y|) := mul_le_mul_of_nonneg_left (bump_difference_bound hL hhL.1 x y) ht _ = (2*pi*kappa)*|(x : ℝ)-y| := by unfold separation field_simp [hhL.1.ne'] _ ≤ L*|(x : ℝ)-y| := by apply mul_le_mul_of_nonneg_right _ (abs_nonneg _) norm_num [kappa, L] linarith [Real.pi_lt_four]
CausalSmith.Stat.PrivateCateRoughdesign.directAlternative_contrast_lipschitz · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TestingPriors.lean:34
theorem directAlternative_completeModel

The explicit direct law satisfies every condition of the complete unknown-density model. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
Proof (Lean source)
-- @node: directAlternative_completeModel lemma directAlternative_completeModel (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) : CompleteModel (directAlternative hL hhL) := by apply binaryCausalLaw_completeModel (fun _ => 1/2) (fun _ => 1/2) (directMu1 hL) measurable_const measurable_const (measurable_directMu1 hL) (direct_parameters_range hL hhL) · exact binaryCausalLaw_exchangeability _ _ _ measurable_const measurable_const (measurable_directMu1 hL) (direct_parameters_range hL hhL) · intro x norm_num · intro x y simp only [sub_self, abs_zero] exact mul_nonneg (by norm_num [L]) (Real.rpow_nonneg (abs_nonneg _) _) · intro x y simp only [sub_self, abs_zero] exact mul_nonneg (by norm_num [L]) (Real.rpow_nonneg (abs_nonneg _) _) · exact directAlternative_contrast_lipschitz hL hhL
CausalSmith.Stat.PrivateCateRoughdesign.directAlternative_completeModel · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TestingPriors.lean:53
theorem finiteProductMixture_singleton

A singleton uniform prior is the observed product law itself. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
P :
finiteProductMixture n 1 (fun _ => P) = dataLaw n P
Proof (Lean source)
CausalSmith.Stat.PrivateCateRoughdesign.finiteProductMixture_singleton · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TestingPriors.lean:72
theorem finiteProductMixture_signs

Enumerating all sign vectors gives exactly the uniform sign mixture. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
e :
finiteProductMixture n (card (SignVector hL)) (fun i => cosineFamily hL hhL (e i))
= signMixture hL hhL n
Proof (Lean source)
-- @node: finiteProductMixture_signs lemma finiteProductMixture_signs (n : ℕ) (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (e : Fin (card (SignVector hL)) ≃ SignVector hL) : finiteProductMixture n (card (SignVector hL)) (fun i => cosineFamily hL hhL (e i)) = signMixture hL hhL n := by classical have hc0 : (card (SignVector hL) : ℝ≥0∞) ≠ 0 := by positivity have hcT : (card (SignVector hL) : ℝ≥0∞) ≠ ⊤ := by finiteness have hw : ofReal ((2 : ℝ)^(-((activeSigns hL).card : ℤ))) = (card (SignVector hL) : ℝ≥0∞)⁻¹ := by calc _ = _ * ((card (SignVector hL) : ℝ≥0∞) * (card (SignVector hL) : ℝ≥0∞)⁻¹) := by rw [ENNReal.mul_inv_cancel hc0 hcT, mul_one] _ = _ := by rw [← mul_assoc, sign_weight_normalization, one_mul] have hs : (∑ i : Fin (card (SignVector hL)), dataLaw n (cosineFamily hL hhL (e i))) = ∑ lam : SignVector hL, dataLaw n (cosineFamily hL hhL lam) := by exact Finset.sum_equiv e (by simp) (by simp) simp only [finiteProductMixture, signMixture, hw, hs]
CausalSmith.Stat.PrivateCateRoughdesign.finiteProductMixture_signs · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TestingPriors.lean:78
theorem sampling_sign_output_TV_le

The sampling-radius sign experiment remains close after every Markov release. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
hscale :
(n : ℝ) ^ 2 * hL ^ 8 ≤ 1 / 4 ^ 8
B :
TV (M ∘ₘ dataLaw n fairNull) (M ∘ₘ signMixture hL hhL n) ≤ 1 / 4
Proof (Lean source)
-- @node: sampling_sign_output_TV_le lemma sampling_sign_output_TV_le (gate : BoundedDifferencesMGF) (n : ℕ) (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (hscale : (n : ℝ) ^ 2 * hL ^ 8 ≤ 1 / 4 ^ 8) {B : Type*} [MeasurableSpace B] (M : Kernel (Dataset n) B) [IsMarkovKernel M] : TV (M ∘ₘ dataLaw n fairNull) (M ∘ₘ signMixture hL hhL n) ≤ 1 / 4 := by let := signMixture_probability hL hhL n have hm : Measurable observe := by unfold observe X A Y; fun_prop let : IsProbabilityMeasure (Pobs fairNull) := Measure.isProbabilityMeasure_map hm.aemeasurable let : IsProbabilityMeasure (dataLaw n fairNull) := by unfold dataLaw infer_instance have hcert := positive_family_certificate hL hhL gate n let v := 160*(n : ℝ)^2*(separation hL)^2*hL*deltaL hL have hv : 0 ≤ v ∧ v ≤ 1 / 16 := by have hid : v = 160*kappa^2*((n : ℝ)^2*hL^8) := by dsimp [v, separation, deltaL] ring rw [hid] constructor · positivity · have hb := mul_le_mul_of_nonneg_left hscale (by positivity : 0 ≤ 160*kappa^2) norm_num [kappa] at hb ⊢ linarith have hchi : chiSqDiv (signMixture hL hhL n) (dataLaw n fairNull) ≤ 1 / 4 := by have hx := exp_privacy_increment_le v ⟨hv.1, hv.2.trans (by norm_num)⟩ have hc := hcert.2.2.2.2.2.1 change chiSqDiv _ _ ≤ exp v - 1 at hc linarith have htv := tvDist_le_half_sqrt_chiSqDiv (signMixture hL hhL n) (dataLaw n fairNull) hcert.2.2.2.2.2.2.1 hcert.2.2.2.2.2.2.2 have hroot : sqrt (chiSqDiv (signMixture hL hhL n) (dataLaw n fairNull)) ≤ 1 / 2 := by apply (Real.sqrt_le_iff).mpr exact ⟨by norm_num, by nlinarith⟩ change tvDist _ _ ≤ _ rw [tvDist_symm] exact (kernel_TV_contraction M _ _).trans (by change TV _ _ ≤ _ at htv; linarith)
CausalSmith.Stat.PrivateCateRoughdesign.sampling_sign_output_TV_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TestingPriors.lean:100
def testingUsesSigns

The proof selects signs when the sampling scale is a maximum, or when the sparse scale strictly dominates both other scales. At sample size times budget at most one it selects the direct family; otherwise ties favor sampling, then direct, then sparse.

Definition (Lean source)
n :
ℕ
epsilon :
ℝ
testingUsesSigns n epsilon :
Prop
a :
(n : ℝ)^(-1/4 : ℝ)
b :
((n : ℝ)^2*epsilon)^(-1/7 : ℝ)
c :
((n : ℝ)*epsilon)^(-1/2 : ℝ)
1 < (n : ℝ)*epsilon
(b ≤ a ∧ c ≤ a) ∨ (a < b ∧ c < b)
theorem testing_direct_rate

In every branch selecting the direct experiment, the benchmark is the capped square-root privacy scale, including ties with the sparse scale. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
n :
ℕ
epsilon :
ℝ
hn :
2 ≤ n
he :
0 < epsilon
hnot :
¬ testingUsesSigns n epsilon
rate n epsilon = min 1 (((n : ℝ)*epsilon)^(-1/2 : ℝ))
Proof (Lean source)
-- @node: testing_direct_rate lemma testing_direct_rate (n : ℕ) (epsilon : ℝ) (hn : 2 ≤ n) (he : 0 < epsilon) (hnot : ¬ testingUsesSigns n epsilon) : rate n epsilon = min 1 (((n : ℝ)*epsilon)^(-1/2 : ℝ)) := by have hn0 : (0 : ℝ) < n := by exact_mod_cast (show 0 < n by omega) have hbase : 0 < (n : ℝ)*epsilon := mul_pos hn0 he by_cases hbudget : 1 < (n : ℝ)*epsilon · let a := (n : ℝ)^(-1/4 : ℝ) let b := ((n : ℝ)^2*epsilon)^(-1/7 : ℝ) let c := ((n : ℝ)*epsilon)^(-1/2 : ℝ) have hac : a ≤ c := by by_contra h have hca : c < a := lt_of_not_ge h by_cases hba : b ≤ a · exact hnot ⟨hbudget, inl ⟨hba, hca.le⟩⟩ · have hab : a < b := lt_of_not_ge hba exact hnot ⟨hbudget, inr ⟨hab, hca.trans hab⟩⟩ have hbc : b ≤ c := by by_contra h have hcb : c < b := lt_of_not_ge h exact hnot ⟨hbudget, inr ⟨hac.trans_lt hcb, hcb⟩⟩ dsimp [a, b, c] at hac hbc simp only [rate, max_eq_right hbc, max_eq_right hac] · have hc : 1 ≤ ((n : ℝ)*epsilon)^(-1/2 : ℝ) := by simpa using Real.rpow_le_rpow_of_nonpos hbase (le_of_not_gt hbudget) (by norm_num : (-1/2 : ℝ) ≤ 0) rw [rate, min_eq_left (hc.trans ((le_max_right _ _).trans (le_max_right _ _))), min_eq_left hc]
CausalSmith.Stat.PrivateCateRoughdesign.testing_direct_rate · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TestingPriors.lean:150
theorem testing_direct_privacy_scale_le

The selected direct radius has the uniformly small privacy-transport scale computed in the testing-prior roadmap. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
epsilon :
ℝ
hn :
2 ≤ n
he :
0 < epsilon
hnot :
¬ testingUsesSigns n epsilon
2*epsilon*(n : ℝ)*separation (rate n epsilon / 4)*(rate n epsilon / 4) ≤ kappa/8
Proof (Lean source)
-- @node: testing_direct_privacy_scale_le lemma testing_direct_privacy_scale_le (n : ℕ) (epsilon : ℝ) (hn : 2 ≤ n) (he : 0 < epsilon) (hnot : ¬ testingUsesSigns n epsilon) : 2*epsilon*(n : ℝ)*separation (rate n epsilon / 4)*(rate n epsilon / 4) ≤ kappa/8 := by have hn0 : (0 : ℝ) < n := by exact_mod_cast (show 0 < n by omega) have hbase : 0 < (n : ℝ)*epsilon := mul_pos hn0 he have hr0 : 0 ≤ rate n epsilon := (rate_pos n epsilon (by omega)).le have hr := testing_direct_rate n epsilon hn he hnot have hrc : rate n epsilon ≤ ((n : ℝ)*epsilon)^(-1/2 : ℝ) := by rw [hr] exact min_le_right _ _ have hc0 : 0 ≤ ((n : ℝ)*epsilon)^(-1/2 : ℝ) := Real.rpow_nonneg hbase.le _ have hp : (((n : ℝ)*epsilon)^(-1/2 : ℝ))^2 = ((n : ℝ)*epsilon)⁻¹ := by rw [← Real.rpow_mul_natCast hbase.le] norm_num [Real.rpow_neg_one] have hsquare : (rate n epsilon)^2 ≤ ((n : ℝ)*epsilon)⁻¹ := by rw [← hp] nlinarith have hscale : ((n : ℝ)*epsilon)*(rate n epsilon)^2 ≤ 1 := by have hm := mul_le_mul_of_nonneg_left hsquare hbase.le simpa only [mul_inv_cancel₀ hbase.ne'] using hm calc _ = (kappa/8)*(((n : ℝ)*epsilon)*(rate n epsilon)^2) := by unfold separation ring _ ≤ (kappa/8)*1 := mul_le_mul_of_nonneg_left hscale (by norm_num [kappa]) _ = _ := mul_one _
CausalSmith.Stat.PrivateCateRoughdesign.testing_direct_privacy_scale_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TestingPriors.lean:181
theorem frontier_testing_priors

The proof-selected uniform sign mixture or direct product law at one quarter of the benchmark has the stated separation and TV bound after every private standard-Borel release. the theorem's stated inputs and assumptions, and the asserted conclusion follows.

Formal statement
boundedDifferences_of_gate :
cayley_of_gate :
n :
ℕ
epsilon :
ℝ
hn :
2 ≤ n
he :
0 < epsilon ∧ epsilon ≤ 1
∃ (s0 s1 : ℕ) (F0 : Fin s0 → CausalLaw) (F1 : Fin s1 → CausalLaw) (Delta : ℝ),
0 < s0
0 < s1
(2 : ℝ)^(-14 : ℤ)*rate n epsilon ≤ Delta
conclusion 1
i :
theta (F0 i) = 0
conclusion 2
i :
theta (F1 i) = Delta
conclusion 3
∃ hL : ℝ, ∃ hhL : 0 < hL ∧ hL ≤ 1/4,
hL = rate n epsilon / 4
i :
F0 i = fairNull
i :
∃ lam : SignVector hL, F1 i = cosineFamily hL hhL lam
¬ testingUsesSigns n epsilon
i :
F1 i = directAlternative hL hhL
conclusion 4
TV (M ∘ₘ finiteProductMixture n s0 F0) (M ∘ₘ finiteProductMixture n s1 F1) ≤ 1 / 4
Proof (Lean source)
-- @node: lem:frontier-testing-priors lemma frontier_testing_priors (boundedDifferences_of_gate : BoundedDifferencesMGF) (cayley_of_gate : CayleyLabeledTreeCount) (n : ℕ) (epsilon : ℝ) (hn : 2 ≤ n) (he : 0 < epsilon ∧ epsilon ≤ 1) : ∃ (s0 s1 : ℕ) (F0 : Fin s0 → CausalLaw) (F1 : Fin s1 → CausalLaw) (Delta : ℝ), 0 < s0 ∧ 0 < s1 ∧ (2 : ℝ)^(-14 : ℤ)*rate n epsilon ≤ Delta ∧ (∀ i, CompleteModel (F0 i) ∧ theta (F0 i) = 0) ∧ (∀ i, CompleteModel (F1 i) ∧ theta (F1 i) = Delta) ∧ (∃ hL : ℝ, ∃ hhL : 0 < hL ∧ hL ≤ 1/4, hL = rate n epsilon / 4 ∧ (∀ i, F0 i = fairNull) ∧ (testingUsesSigns n epsilon → (∀ i, ∃ lam : SignVector hL, F1 i = cosineFamily hL hhL lam) ∧ finiteProductMixture n s1 F1 = signMixture hL hhL n) ∧ (¬ testingUsesSigns n epsilon → (∀ i, F1 i = directAlternative hL hhL) ∧ finiteProductMixture n s1 F1 = dataLaw n (directAlternative hL hhL))) ∧ (∀ (B : Type*) [MeasurableSpace B] [StandardBorelSpace B] (M : Kernel (Dataset n) B) [IsMarkovKernel M], PrivateKernel n epsilon M → TV (M ∘ₘ finiteProductMixture n s0 F0) (M ∘ₘ finiteProductMixture n s1 F1) ≤ 1 / 4) := by classical let hL := rate n epsilon / 4 have hhL : 0 < hL ∧ hL ≤ 1 / 4 := by constructor · exact div_pos (rate_pos n epsilon (by omega)) (by norm_num) · have hr : rate n epsilon ≤ 1 := min_le_left _ _ dsimp [hL] linarith have hsep : separation hL = (2 : ℝ)^(-14 : ℤ) * rate n epsilon := by dsimp [separation, kappa, hL] norm_num ring by_cases hsign : testingUsesSigns n epsilon · let s := card (SignVector hL) let e : Fin s ≃ SignVector hL := (Fintype.equivFin (SignVector hL)).symm refine ⟨1, s, (fun _ => fairNull), (fun i => cosineFamily hL hhL (e i)), separation hL, by omega, Fintype.card_pos, hsep.ge, ?_, ?_, ?_, ?_⟩ · intro i exact ⟨fairNull_completeModel, fairNull_target⟩ · intro i exact ⟨cosineFamily_completeModel hL hhL (e i), cosineFamily_target hL hhL (e i)⟩ · refine ⟨hL, hhL, rfl, (fun _ => rfl), ?_, ?_⟩ · intro _ exact ⟨fun i => ⟨e i, rfl⟩, finiteProductMixture_signs n hL hhL e⟩ · intro hnot exact False.elim (hnot hsign) · intro B _ _ M _ hM rw [finiteProductMixture_singleton, finiteProductMixture_signs n hL hhL e] rcases hsign with ⟨hbudget, hsampling | hsparse⟩ · have hn0 : (0 : ℝ) < n := by exact_mod_cast (show 0 < n by omega) have hn1 : (1 : ℝ) ≤ n := by exact_mod_cast (show 1 ≤ n by omega) have ha1 := Real.rpow_le_one_of_one_le_of_nonpos hn1 (by norm_num : (-1 / 4 : ℝ) ≤ 0) have hr : rate n epsilon = (n : ℝ)^(-1 / 4 : ℝ) := by simp only [rate, max_eq_left (max_le hsampling.1 hsampling.2), min_eq_right ha1] refine sampling_sign_output_TV_le boundedDifferences_of_gate n hL hhL ?_ M have hp : ((n : ℝ)^(-1 / 4 : ℝ))^8 = ((n : ℝ)^2)⁻¹ := by rw [← Real.rpow_mul_natCast hn0.le] norm_num dsimp [hL] rw [hr, div_pow, hp] have hn2 : (n : ℝ)^2 ≠ 0 := pow_ne_zero _ hn0.ne' field_simp [hn2] norm_num · have hn0 : (0 : ℝ) < n := by exact_mod_cast (show 0 < n by omega) have hn1 : (1 : ℝ) ≤ n := by exact_mod_cast (show 1 ≤ n by omega) let b := ((n : ℝ)^2*epsilon)^(-1 / 7 : ℝ) have he0 := he.1 have hbase : 0 < (n : ℝ)^2*epsilon := by positivity have hb : 0 < b := Real.rpow_pos_of_pos hbase _ have hbase1 : 1 ≤ (n : ℝ)^2*epsilon := by nlinarith have hb1 : b ≤ 1 := Real.rpow_le_one_of_one_le_of_nonpos hbase1 (by norm_num) have hr : rate n epsilon = b := by simp only [rate, max_eq_left hsparse.2.le, max_eq_right hsparse.1.le] exact min_eq_right hb1 have hocc : (n : ℝ)*b^5 ≤ 1 := by have hc0 : 0 < ((n : ℝ)*epsilon)^(-1 / 2 : ℝ) := by positivity have hl := (Real.log_le_log_iff hc0 hb).mpr hsparse.2.le dsimp [b] at hl rw [Real.log_rpow (by positivity), Real.log_rpow hbase, Real.log_mul hn0.ne' he.1.ne', Real.log_mul (by positivity) he.1.ne', Real.log_pow] at hl rw [← Real.log_le_log_iff (by positivity : 0 < (n : ℝ)*b^5) zero_lt_one, Real.log_mul hn0.ne' (pow_pos hb 5).ne', Real.log_pow, Real.log_one] dsimp [b] rw [Real.log_rpow hbase, Real.log_mul (by positivity) he.1.ne', Real.log_pow] linarith have hcap : (n : ℝ)*deltaL hL ≤ 1 / 128 := by dsimp [deltaL, hL] rw [hr, div_pow] nlinarith have hout := ((measurable_component_contraction hL hhL n cayley_of_gate boundedDifferences_of_gate epsilon he M hM).2.2.2.2 hcap).2 have hp : b^7 = ((n : ℝ)^2*epsilon)⁻¹ := by dsimp [b] rw [← Real.rpow_mul_natCast hbase.le] norm_num [Real.rpow_neg_one] have hid : 2048*epsilon*separation hL*(n : ℝ)^2*hL*deltaL hL = 2048*kappa / 4^7 := by dsimp [separation, deltaL, hL] rw [hr] calc _ = (2048*kappa / 4^7) * (((n : ℝ)^2*epsilon)*b^7) := by ring _ = _ := by rw [hp, mul_inv_cancel₀ hbase.ne', mul_one] change tvDist _ _ ≤ _ rw [tvDist_symm] rw [hid] at hout exact hout.trans (by norm_num [kappa]) · refine ⟨1, 1, (fun _ => fairNull), (fun _ => directAlternative hL hhL), separation hL, by omega, by omega, hsep.ge, ?_, ?_, ?_, ?_⟩ · intro i exact ⟨fairNull_completeModel, fairNull_target⟩ · intro i exact ⟨directAlternative_completeModel hL hhL, directAlternative_target hL hhL⟩ · refine ⟨hL, hhL, rfl, (fun _ => rfl), ?_, ?_⟩ · intro hy exact False.elim (hsign hy) · intro _ exact ⟨fun _ => rfl, finiteProductMixture_singleton n _⟩ · intro B _ _ M _ hM rw [finiteProductMixture_singleton, finiteProductMixture_singleton] have hm : Measurable observe := by unfold observe X A Y; fun_prop let : IsProbabilityMeasure (Pobs fairNull) := Measure.isProbabilityMeasure_map hm.aemeasurable let : IsProbabilityMeasure (Pobs (directAlternative hL hhL)) := Measure.isProbabilityMeasure_map hm.aemeasurable let : IsProbabilityMeasure (dataLaw n fairNull) := by unfold dataLaw; infer_instance let : IsProbabilityMeasure (dataLaw n (directAlternative hL hhL)) := by unfold dataLaw; infer_instance have hcoupling : ∃ γ : Measure (Dataset n × Dataset n), IsCoupling γ (dataLaw n fairNull) (dataLaw n (directAlternative hL hhL)) ∧ (∫⁻ z, (dHam n z.1 z.2 : ℝ≥0∞) ∂γ) ≤ ofReal ((n : ℝ)*separation hL*hL) := by exact ⟨directDatasetCoupling hL n, directDatasetCoupling_isCoupling hL hhL n, directDatasetCoupling_cost_le hL hhL n⟩ obtain ⟨γ, hγ, hcost⟩ := hcoupling have hout := private_TV_le_coupling_cost n epsilon he M hM _ _ γ hγ have hscale : 2*epsilon*((n : ℝ)*separation hL*hL) ≤ kappa/8 := by simpa only [mul_assoc] using testing_direct_privacy_scale_le n epsilon hn he.1 hsign have htv : ofReal (TV (M ∘ₘ dataLaw n fairNull) (M ∘ₘ dataLaw n (directAlternative hL hhL))) ≤ ofReal (kappa/8) := by calc _ ≤ ofReal (2*epsilon)*ofReal ((n : ℝ)*separation hL*hL) := hout.trans (mul_le_mul' le_rfl hcost) _ = ofReal (2*epsilon*((n : ℝ)*separation hL*hL)) := by rw [ENNReal.ofReal_mul (mul_nonneg (by norm_num) he.1.le : 0 ≤ 2*epsilon)] _ ≤ _ := ENNReal.ofReal_le_ofReal hscale have hreal := (ENNReal.ofReal_le_ofReal_iff (by norm_num [kappa] : 0 ≤ kappa/8)).mp htv exact hreal.trans (by norm_num [kappa])
CausalSmith.Stat.PrivateCateRoughdesign.frontier_testing_priors · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TestingPriors.lean:211
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.TreeGeometry 10 declarations Geometric support restrictions and rooted integration bounds for shared-sign trees.

Geometric support restrictions and rooted integration bounds for shared-sign trees. Each child is integrated in its parent's micro neighborhood; the root is in the macro window.

theorem weighted_frame_nonzero_radii Lemma weighted_frame_nonzero_radii in the paper ↗

A nonzero localized frame is strictly inside both the macro and micro supports. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
j :
ℤ
x :
hx :
envelope hL x * frame hL j x ≠ 0
conclusion 1
|(x : ℝ) - x0| < hL
conclusion 2
|(x : ℝ) - j * deltaL hL| < deltaL hL
Proof (Lean source)
-- @node: weighted_frame_nonzero_radii lemma weighted_frame_nonzero_radii (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (j : ℤ) (x : Covariate) (hx : envelope hL x * frame hL j x ≠ 0) : |(x : ℝ) - x0| < hL ∧ |(x : ℝ) - j * deltaL hL| < deltaL hL := by constructor · by_contra h exact hx (by rw [envelope_zero_of_radius_le hL hhL x (le_of_not_gt h), zero_mul]) · by_contra h exact hx (by rw [frame_zero_of_radius_le hL hhL j x (le_of_not_gt h), mul_zero])
CausalSmith.Stat.PrivateCateRoughdesign.weighted_frame_nonzero_radii · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeGeometry.lean:11
theorem shared_frame_distance_lt Lemma shared_frame_distance_lt in the paper ↗

Two points sharing a localized sign are separated by less than two micro radii. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
j :
ℤ
x y :
hx :
envelope hL x * frame hL j x ≠ 0
hy :
envelope hL y * frame hL j y ≠ 0
|(x : ℝ) - y| < 2 * deltaL hL
Proof (Lean source)
-- @node: shared_frame_distance_lt lemma shared_frame_distance_lt (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (j : ℤ) (x y : Covariate) (hx : envelope hL x * frame hL j x ≠ 0) (hy : envelope hL y * frame hL j y ≠ 0) : |(x : ℝ) - y| < 2 * deltaL hL := by have hx' := (weighted_frame_nonzero_radii hL hhL j x hx).2 have hy' := (weighted_frame_nonzero_radii hL hhL j y hy).2 calc _ = |((x : ℝ) - j * deltaL hL) - ((y : ℝ) - j * deltaL hL)| := by congr 1; ring _ ≤ |(x : ℝ) - j * deltaL hL| + |(y : ℝ) - j * deltaL hL| := abs_sub _ _ _ < _ := by linarith
CausalSmith.Stat.PrivateCateRoughdesign.shared_frame_distance_lt · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeGeometry.lean:22
theorem sharedAdj_geometric_restrictions Lemma sharedAdj_geometric_restrictions in the paper ↗

Every shared-sign edge has both endpoints in the open macro window and short length. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
x :
i l :
Fin n
hi :
sharedAdj hL n x i l
conclusion 1
|(x i : ℝ) - x0| < hL
conclusion 2
|(x l : ℝ) - x0| < hL
conclusion 3
|(x i : ℝ) - x l| < 2 * deltaL hL
Proof (Lean source)
-- @node: sharedAdj_geometric_restrictions lemma sharedAdj_geometric_restrictions (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (x : Fin n → Covariate) (i l : Fin n) (hi : sharedAdj hL n x i l) : |(x i : ℝ) - x0| < hL ∧ |(x l : ℝ) - x0| < hL ∧ |(x i : ℝ) - x l| < 2 * deltaL hL := by obtain ⟨_, j, _, hij, hlj⟩ := hi exact ⟨(weighted_frame_nonzero_radii hL hhL j (x i) hij).1, (weighted_frame_nonzero_radii hL hhL j (x l) hlj).1, shared_frame_distance_lt hL hhL j (x i) (x l) hij hlj⟩
CausalSmith.Stat.PrivateCateRoughdesign.sharedAdj_geometric_restrictions · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeGeometry.lean:36
theorem not_sharedAdj_of_macro_boundary Lemma not_sharedAdj_of_macro_boundary in the paper ↗

A record on or outside the macro boundary has no shared-sign neighbor. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
x :
i l :
Fin n
hi :
hL ≤ |(x i : ℝ) - x0|
¬ sharedAdj hL n x i l
Proof (Lean source)
-- @node: not_sharedAdj_of_macro_boundary lemma not_sharedAdj_of_macro_boundary (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (x : Fin n → Covariate) (i l : Fin n) (hi : hL ≤ |(x i : ℝ) - x0|) : ¬ sharedAdj hL n x i l := by intro hedge exact (not_lt_of_ge hi) (sharedAdj_geometric_restrictions hL hhL n x i l hedge).1
CausalSmith.Stat.PrivateCateRoughdesign.not_sharedAdj_of_macro_boundary · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeGeometry.lean:47
theorem volume_covariate_neighborhood_le Lemma volume_covariate_neighborhood_le in the paper ↗

Any subset of a real-radius neighborhood in the unit interval has volume at most its length. The displayed conclusion follows.

Formal statement
c r :
ℝ
(volume : Measure Covariate) {x | |(x : ℝ) - c| < r} ≤ ofReal (2 * r)
Proof (Lean source)
-- @node: volume_covariate_neighborhood_le lemma volume_covariate_neighborhood_le (c r : ℝ) : (volume : Measure Covariate) {x | |(x : ℝ) - c| < r} ≤ ofReal (2 * r) := by rw [unitInterval.volume_apply] calc _ ≤ (volume : Measure ℝ) (Ioo (c-r) (c+r)) := by apply measure_mono rintro z ⟨x, hx, rfl⟩ have hx' := abs_lt.mp (show |(x : ℝ) - c| < r from hx) constructor <;> linarith _ = _ := by rw [Real.volume_Ioo]; congr 1; ring
CausalSmith.Stat.PrivateCateRoughdesign.volume_covariate_neighborhood_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeGeometry.lean:55
theorem volume_tree_child_region_le Lemma volume_tree_child_region_le in the paper ↗

The potential child region of a frozen parent has length at most four micro radii. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
x :
(volume : Measure Covariate) {y | |(y : ℝ) - x| < 2 * deltaL hL}
≤ ofReal (4 * deltaL hL)
Proof (Lean source)
-- @node: volume_tree_child_region_le lemma volume_tree_child_region_le (hL : ℝ) (x : Covariate) : (volume : Measure Covariate) {y | |(y : ℝ) - x| < 2 * deltaL hL} ≤ ofReal (4 * deltaL hL) := by simpa only [← mul_assoc, show (2 : ℝ) * 2 = 4 by norm_num] using volume_covariate_neighborhood_le (x : ℝ) (2 * deltaL hL)
CausalSmith.Stat.PrivateCateRoughdesign.volume_tree_child_region_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeGeometry.lean:68
theorem volume_tree_root_region_le Lemma volume_tree_root_region_le in the paper ↗

The root region has length at most two macro radii. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
(volume : Measure Covariate) {x | |(x : ℝ) - x0| < hL} ≤ ofReal (2 * hL)
Proof (Lean source)
-- @node: volume_tree_root_region_le lemma volume_tree_root_region_le (hL : ℝ) : (volume : Measure Covariate) {x | |(x : ℝ) - x0| < hL} ≤ ofReal (2 * hL) := volume_covariate_neighborhood_le x0 hL
CausalSmith.Stat.PrivateCateRoughdesign.volume_tree_root_region_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeGeometry.lean:76

The exact rooted-order integral for successive children constrained to their parent's neighborhood. The parent selector reads only the already sampled covariates.

Definition (Lean source)
d :
ℝ
parent :
treeExtensionVolume d parent :
ℕ → List Covariate → ℝ≥0∞
clause 1
| 0, _ => 1
clause 2
| m+1, xs
=> ∫⁻ y : Covariate, {y : Covariate | |(y : ℝ) - parent xs| < 2 * d}.indicator (fun y => treeExtensionVolume d parent m (xs ++ [y])) y
CausalSmith.Stat.PrivateCateRoughdesign.treeExtensionVolume · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeGeometry.lean:82
theorem treeExtensionVolume_le

Each newly integrated child costs at most four micro radii, regardless of the previous covariates or the choice of its parent among them. The displayed conclusion follows.

Formal statement
d :
ℝ
parent :
m :
ℕ
treeExtensionVolume d parent m xs ≤ (ofReal (4 * d)) ^ m
Proof (Lean source)
-- @node: treeExtensionVolume_le lemma treeExtensionVolume_le (d : ℝ) (parent : List Covariate → Covariate) (m : ℕ) (xs : List Covariate) : treeExtensionVolume d parent m xs ≤ (ofReal (4 * d)) ^ m := by classical induction m generalizing xs with | zero => simp [treeExtensionVolume] | succ m ih => rw [treeExtensionVolume] calc _ ≤ ∫⁻ y : Covariate, {y : Covariate | |(y : ℝ) - parent xs| < 2 * d}.indicator (fun _ => (ofReal (4 * d)) ^ m) y := by apply lintegral_mono intro y exact Set.indicator_le_indicator (ih _) _ = (ofReal (4 * d)) ^ m * (volume : Measure Covariate) {y | |(y : ℝ) - parent xs| < 2 * d} := lintegral_indicator_const (measurableSet_lt (by fun_prop) measurable_const) _ _ ≤ (ofReal (4 * d)) ^ m * ofReal (4 * d) := by apply mul_le_mul' le_rfl simpa only [← mul_assoc, show (2 : ℝ) * 2 = 4 by norm_num] using volume_covariate_neighborhood_le (parent xs : ℝ) (2 * d) _ = _ := (pow_succ _ m).symm
CausalSmith.Stat.PrivateCateRoughdesign.treeExtensionVolume_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeGeometry.lean:92
theorem rooted_tree_iterated_volume_le

Integrating the root and then the children gives the roadmap's specified-tree envelope. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
h d :
ℝ
parent :
m :
ℕ
(∫⁻ x : Covariate, {x : Covariate | |(x : ℝ) - x0| < h}.indicator (fun x => treeExtensionVolume d parent m [x]) x)
≤ ofReal (2 * h) * (ofReal (4 * d)) ^ m
Proof (Lean source)
-- @node: rooted_tree_iterated_volume_le lemma rooted_tree_iterated_volume_le (h d : ℝ) (parent : List Covariate → Covariate) (m : ℕ) : (∫⁻ x : Covariate, {x : Covariate | |(x : ℝ) - x0| < h}.indicator (fun x => treeExtensionVolume d parent m [x]) x) ≤ ofReal (2 * h) * (ofReal (4 * d)) ^ m := by classical calc _ ≤ ∫⁻ x : Covariate, {x : Covariate | |(x : ℝ) - x0| < h}.indicator (fun _ => (ofReal (4 * d)) ^ m) x := by apply lintegral_mono intro x exact Set.indicator_le_indicator (treeExtensionVolume_le d parent m _) _ = (ofReal (4 * d)) ^ m * (volume : Measure Covariate) {x | |(x : ℝ) - x0| < h} := lintegral_indicator_const (measurableSet_lt (by fun_prop) measurable_const) _ _ ≤ (ofReal (4 * d)) ^ m * ofReal (2 * h) := mul_le_mul' le_rfl (volume_tree_root_region_le h) _ = _ := mul_comm _ _
CausalSmith.Stat.PrivateCateRoughdesign.rooted_tree_iterated_volume_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeGeometry.lean:119
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.TreeOrdering 6 declarations Parent-before-child enumerations of finite connected graphs and the resulting specified labeled-tree probability bound.

Parent-before-child enumerations of finite connected graphs and the resulting specified labeled-tree probability bound. This closes the geometric input to the general Cayley component-count estimate and sparse common-mass Hamming-cost bound.

Every finite connected graph has an ordering in which each non-root vertex has an earlier neighbor. Removing a non-cut vertex constructs the ordering inductively. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
m :
ℕ
G :
SimpleGraph (Fin (m + 1))
hG :
G.Connected
∃ e : Fin (m + 1) ≃ Fin (m + 1), ∀ i, i ≠ 0 → ∃ j, j < i ∧ G.Adj (e i) (e j)
Proof (Lean source)
-- @node: connected_parent_order lemma connected_parent_order (m : ℕ) (G : SimpleGraph (Fin (m + 1))) (hG : G.Connected) : ∃ e : Fin (m + 1) ≃ Fin (m + 1), ∀ i, i ≠ 0 → ∃ j, j < i ∧ G.Adj (e i) (e j) := by classical induction m with | zero => refine ⟨Equiv.refl _, ?_⟩ intro i hi apply (hi _).elim apply Fin.ext have := i.isLt simp only [Fin.val_zero] omega | succ m ih => obtain ⟨v, hv⟩ := hG.exists_connected_induce_compl_singleton_of_finite_nontrivial let a : Fin (m + 1) ≃ {x : Fin (m + 2) // x ≠ v} := finSuccAboveEquiv v let H := (G.induce {v}ᶜ).comap a have hH : H.Connected := (SimpleGraph.Iso.comap a _).connected_iff.mpr hv obtain ⟨e, he⟩ := ih H hH let f : Fin (m + 2) ≃ Fin (m + 2) := (finSuccEquivLast.trans (Equiv.optionCongr e)).trans (finSuccEquiv' v).symm have hf (i : Fin (m + 1)) : f i.castSucc = v.succAbove (e i) := by simp [f, Equiv.trans_apply, finSuccEquivLast_castSucc] have hfl : f (last (m + 1)) = v := by simp [f, Equiv.trans_apply] refine ⟨f, ?_⟩ intro i refine Fin.lastCases ?_ (fun k => ?_) i · intro hi obtain ⟨w, hw⟩ := hG.preconnected.exists_adj_of_nontrivial v let b : {x : Fin (m + 2) // x ≠ v} := ⟨w, hw.ne.symm⟩ let j := e.symm (a.symm b) refine ⟨j.castSucc, Fin.castSucc_lt_last j, ?_⟩ rw [hfl, hf] have hb : v.succAbove (e j) = w := by change (a (e j)).val = w simp [j, b] rw [hb] exact hw · intro hi have hk : k ≠ 0 := by intro hk apply hi simp [hk] obtain ⟨j, hj, hadj⟩ := he k hk refine ⟨j.castSucc, by simpa using hj, ?_⟩ rw [hf, hf] exact hadj
CausalSmith.Stat.PrivateCateRoughdesign.connected_parent_order · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeOrdering.lean:11
theorem mem_orderedSharedTreeEvent_of_edges

Shared-sign edges from each child to its earlier parent imply membership in the recursive ordered-tree event. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
p :
(k : ℕ) → Fin (k + 1)
m :
ℕ
x :
Fin (m + 1) → Covariate
hedge :
∀ k (hk : k < m),
sharedAdj hL (m + 1) x ⟨k + 1, by omega⟩ ⟨(p k).val, by have := (p k).isLt; omega⟩
Proof (Lean source)
-- @node: mem_orderedSharedTreeEvent_of_edges lemma mem_orderedSharedTreeEvent_of_edges (hL : ℝ) (p : (k : ℕ) → Fin (k + 1)) (m : ℕ) (x : Fin (m + 1) → Covariate) (hedge : ∀ k (hk : k < m), sharedAdj hL (m + 1) x ⟨k + 1, by omega⟩ ⟨(p k).val, by have := (p k).isLt; omega⟩) : x ∈ orderedSharedTreeEvent hL p m := by induction m with | zero => exact Set.mem_univ _ | succ m ih => refine ⟨ih (fun i => x i.castSucc) ?_, ?_⟩ · intro k hk have h := hedge k (by omega) simpa only [sharedAdj, Fin.castSucc_mk, ne_eq, Fin.mk.injEq] using h · exact hedge m (by omega)
CausalSmith.Stat.PrivateCateRoughdesign.mem_orderedSharedTreeEvent_of_edges · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeOrdering.lean:64
theorem labeledSharedTreeEvent_volume_le

A specified connected labeled graph on at least two iid uniform covariates obeys the root-length times child-length envelope. A fixed connected ordering discards every unused edge. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
m :
ℕ
hm :
1 ≤ m
T :
SimpleGraph (Fin (m + 1))
hT :
T.Connected
(Measure.pi (fun _ : Fin (m + 1) => (volume : Measure Covariate))) (labeledSharedTreeEvent hL (m + 1) (m + 1) id T)
≤ ofReal (2 * hL * (4 * deltaL hL) ^ m)
Proof (Lean source)
-- @node: labeledSharedTreeEvent_volume_le lemma labeledSharedTreeEvent_volume_le (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (m : ℕ) (hm : 1 ≤ m) (T : SimpleGraph (Fin (m + 1))) (hT : T.Connected) : (Measure.pi (fun _ : Fin (m + 1) => (volume : Measure Covariate))) (labeledSharedTreeEvent hL (m + 1) (m + 1) id T) ≤ ofReal (2 * hL * (4 * deltaL hL) ^ m) := by classical obtain ⟨e, he⟩ := connected_parent_order m T hT have hparent (k : ℕ) (hk : k < m) : ∃ j : Fin (k + 1), T.Adj (e ⟨k + 1, by omega⟩) (e ⟨j.val, by have := j.isLt; omega⟩) := by obtain ⟨j, hj, hadj⟩ := he ⟨k + 1, by omega⟩ (by intro h; have := congrArg val h; simp at this) exact ⟨⟨j.val, by exact hj⟩, hadj⟩ let p : (k : ℕ) → Fin (k + 1) := fun k => if hk : k < m then (hparent k hk).choose else 0 have hp (k : ℕ) (hk : k < m) : T.Adj (e ⟨k + 1, by omega⟩) (e ⟨(p k).val, by have := (p k).isLt; omega⟩) := by simpa only [p, dif_pos hk] using (hparent k hk).choose_spec calc _ ≤ (Measure.pi (fun _ : Fin (m + 1) => (volume : Measure Covariate))) {x | (fun i => x (e i)) ∈ orderedSharedTreeEvent hL p m} := by apply measure_mono intro x hx apply mem_orderedSharedTreeEvent_of_edges intro k hk have h := hx _ _ (hp k hk) exact ⟨fun heq => (hp k hk).ne (congrArg e heq), h.2⟩ _ ≤ _ := selected_orderedSharedTreeEvent_volume_le hL hhL (m + 1) m hm e e.injective p
CausalSmith.Stat.PrivateCateRoughdesign.labeledSharedTreeEvent_volume_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeOrdering.lean:81
theorem uniform_labeled_tree_probability_bound

Every specified labeled tree has the roadmap probability envelope, without an assumed enumeration or probability bound. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
s :
ℕ
hs :
2 ≤ s
T :
{T : SimpleGraph (Fin s) // T.IsTree}
(Measure.pi (fun _ : Fin s => (volume : Measure Covariate))) (labeledSharedTreeEvent hL s s id T.val)
≤ ofReal (2 * hL * (4 * deltaL hL) ^ (s - 1))
Proof (Lean source)
-- @node: uniform_labeled_tree_probability_bound lemma uniform_labeled_tree_probability_bound (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (s : ℕ) (hs : 2 ≤ s) (T : {T : SimpleGraph (Fin s) // T.IsTree}) : (Measure.pi (fun _ : Fin s => (volume : Measure Covariate))) (labeledSharedTreeEvent hL s s id T.val) ≤ ofReal (2 * hL * (4 * deltaL hL) ^ (s - 1)) := by obtain ⟨m, rfl⟩ : ∃ m, s = m + 1 := ⟨s - 1, by omega⟩ simpa using labeledSharedTreeEvent_volume_le hL hhL m (by omega) T.val T.property.connected
CausalSmith.Stat.PrivateCateRoughdesign.uniform_labeled_tree_probability_bound · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeOrdering.lean:116
theorem lintegral_sizeComponentCount_le_cayley

The actual size-s component count has the binomial Cayley expectation bound under iid uniform design. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n s :
ℕ
hs :
2 ≤ s
(∫⁻ x, (sizeComponentCount hL n x s : ℝ≥0∞) ∂(Measure.pi (fun _ : Fin n => (volume : Measure Covariate))))
≤ ofReal ((n.choose s : ℝ) * 2 * hL * (s : ℝ) ^ (s - 2) * (4 * deltaL hL) ^ (s - 1))
Proof (Lean source)
-- @node: lintegral_sizeComponentCount_le_cayley lemma lintegral_sizeComponentCount_le_cayley (cayley : CayleyLabeledTreeCount) (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n s : ℕ) (hs : 2 ≤ s) : (∫⁻ x, (sizeComponentCount hL n x s : ℝ≥0∞) ∂(Measure.pi (fun _ : Fin n => (volume : Measure Covariate)))) ≤ ofReal ((n.choose s : ℝ) * 2 * hL * (s : ℝ) ^ (s - 2) * (4 * deltaL hL) ^ (s - 1)) := by exact lintegral_sizeComponentCount_le_of_uniform_labeled_tree_bound cayley hL n s hs (uniform_labeled_tree_probability_bound hL hhL s hs)
CausalSmith.Stat.PrivateCateRoughdesign.lintegral_sizeComponentCount_le_cayley · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeOrdering.lean:129
theorem commonMassCoupling_hamming_cost_le_sparse

The constructed common-mass coupling has expected Hamming cost at most 1024 times separation, squared sample size, macro radius, and micro radius in the sparse regime. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
hn :
1 ≤ n
hcap :
(n : ℝ) * deltaL hL ≤ 1 / 128
(∫⁻ zw, (dHam n zw.1 zw.2 : ℝ≥0∞) ∂commonMassCoupling hL n)
≤ ofReal (1024 * separation hL * (n : ℝ) ^ 2 * hL * deltaL hL)
Proof (Lean source)
-- @node: commonMassCoupling_hamming_cost_le_sparse lemma commonMassCoupling_hamming_cost_le_sparse (cayley : CayleyLabeledTreeCount) (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (hn : 1 ≤ n) (hcap : (n : ℝ) * deltaL hL ≤ 1 / 128) : (∫⁻ zw, (dHam n zw.1 zw.2 : ℝ≥0∞) ∂commonMassCoupling hL n) ≤ ofReal (1024 * separation hL * (n : ℝ) ^ 2 * hL * deltaL hL) := by exact commonMassCoupling_hamming_cost_le_of_labeled_tree_bound cayley hL hhL n hn hcap (fun s hs _ => uniform_labeled_tree_probability_bound hL hhL s hs)
CausalSmith.Stat.PrivateCateRoughdesign.commonMassCoupling_hamming_cost_le_sparse · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeOrdering.lean:141
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.TreeProbability 8 declarations Product-measure bounds for rooted trees enumerated in parent-before-child order.

Product-measure bounds for rooted trees enumerated in parent-before-child order.

theorem uniform_child_extension_volume_le Lemma uniform_child_extension_volume_le in the paper ↗

Appending an independent uniform child multiplies any prefix event's probability by at most four micro radii. The selector can be any measurable function of the prefix. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
m :
ℕ
d :
ℝ
A :
Set (Fin m → Covariate)
hA :
parent :
(Fin m → Covariate) → Covariate
hp :
Measurable parent
((volume : Measure Covariate).prod (Measure.pi (fun _ : Fin m => (volume : Measure Covariate)))) {yx | yx.2 ∈ A ∧ |(yx.1 : ℝ) - parent yx.2| < 2 * d}
≤ ofReal (4 * d) * (Measure.pi (fun _ : Fin m => (volume : Measure Covariate))) A
Proof (Lean source)
-- @node: uniform_child_extension_volume_le lemma uniform_child_extension_volume_le (m : ℕ) (d : ℝ) (A : Set (Fin m → Covariate)) (hA : MeasurableSet A) (parent : (Fin m → Covariate) → Covariate) (hp : Measurable parent) : ((volume : Measure Covariate).prod (Measure.pi (fun _ : Fin m => (volume : Measure Covariate)))) {yx | yx.2 ∈ A ∧ |(yx.1 : ℝ) - parent yx.2| < 2 * d} ≤ ofReal (4 * d) * (Measure.pi (fun _ : Fin m => (volume : Measure Covariate))) A := by classical have hS : MeasurableSet {yx : Covariate × (Fin m → Covariate) | yx.2 ∈ A ∧ |(yx.1 : ℝ) - parent yx.2| < 2 * d} := by exact (hA.preimage measurable_snd).inter (measurableSet_lt (show Measurable (fun yx : Covariate × (Fin m → Covariate) => |(yx.1 : ℝ) - parent yx.2|) by fun_prop) measurable_const) rw [Measure.prod_apply_symm hS] calc _ ≤ ∫⁻ x : Fin m → Covariate, A.indicator (fun _ => ofReal (4 * d)) x ∂(Measure.pi (fun _ : Fin m => (volume : Measure Covariate))) := by apply lintegral_mono intro x by_cases hx : x ∈ A · simp only [Set.indicator_of_mem hx] have he : (fun y : Covariate => (y, x)) ⁻¹' {yx | yx.2 ∈ A ∧ |(yx.1 : ℝ) - parent yx.2| < 2 * d} = {y : Covariate | |(y : ℝ) - parent x| < 2 * d} := by ext y; simp [hx] rw [he] simpa only [← mul_assoc, show (2 : ℝ) * 2 = 4 by norm_num] using volume_covariate_neighborhood_le (parent x : ℝ) (2 * d) · simp [hx] _ = _ := lintegral_indicator_const hA _
CausalSmith.Stat.PrivateCateRoughdesign.uniform_child_extension_volume_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeProbability.lean:10
theorem pi_uniform_child_extension_volume_le Lemma pi_uniform_child_extension_volume_le in the paper ↗

An independent last coordinate obeys the child-extension bound in the original finite product space, without introducing a conditional probability version. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
m :
ℕ
d :
ℝ
A :
Set (Fin m → Covariate)
hA :
parent :
(Fin m → Covariate) → Covariate
hp :
Measurable parent
(Measure.pi (fun _ : Fin (m + 1) => (volume : Measure Covariate))) {x | (fun i : Fin m => x i.castSucc) ∈ A ∧ |(x (last m) : ℝ) - parent (fun i : Fin m => x i.castSucc)| < 2 * d}
≤ ofReal (4 * d) * (Measure.pi (fun _ : Fin m => (volume : Measure Covariate))) A
Proof (Lean source)
-- @node: pi_uniform_child_extension_volume_le lemma pi_uniform_child_extension_volume_le (m : ℕ) (d : ℝ) (A : Set (Fin m → Covariate)) (hA : MeasurableSet A) (parent : (Fin m → Covariate) → Covariate) (hp : Measurable parent) : (Measure.pi (fun _ : Fin (m + 1) => (volume : Measure Covariate))) {x | (fun i : Fin m => x i.castSucc) ∈ A ∧ |(x (last m) : ℝ) - parent (fun i : Fin m => x i.castSucc)| < 2 * d} ≤ ofReal (4 * d) * (Measure.pi (fun _ : Fin m => (volume : Measure Covariate))) A := by let e := piFinSuccAbove (fun _ : Fin (m + 1) => Covariate) (last m) have hS : MeasurableSet {yx : Covariate × (Fin m → Covariate) | yx.2 ∈ A ∧ |(yx.1 : ℝ) - parent yx.2| < 2 * d} := by exact (hA.preimage measurable_snd).inter (measurableSet_lt (show Measurable (fun yx : Covariate × (Fin m → Covariate) => |(yx.1 : ℝ) - parent yx.2|) by fun_prop) measurable_const) have hmap := (measurePreserving_piFinSuccAbove (fun _ : Fin (m + 1) => (volume : Measure Covariate)) (last m)).map_eq have he : e ⁻¹' {yx : Covariate × (Fin m → Covariate) | yx.2 ∈ A ∧ |(yx.1 : ℝ) - parent yx.2| < 2 * d} = {x | (fun i : Fin m => x i.castSucc) ∈ A ∧ |(x (last m) : ℝ) - parent (fun i : Fin m => x i.castSucc)| < 2 * d} := by ext x simp [e, piFinSuccAbove, Fin.init_def] have hm : (Measure.pi (fun _ : Fin (m + 1) => (volume : Measure Covariate))) (e ⁻¹' {yx : Covariate × (Fin m → Covariate) | yx.2 ∈ A ∧ |(yx.1 : ℝ) - parent yx.2| < 2 * d}) = ((volume : Measure Covariate).prod (Measure.pi (fun _ : Fin m => (volume : Measure Covariate)))) {yx | yx.2 ∈ A ∧ |(yx.1 : ℝ) - parent yx.2| < 2 * d} := by rw [← hmap, Measure.map_apply e.measurable hS] rw [he] at hm rw [hm] exact uniform_child_extension_volume_le m d A hA parent hp
CausalSmith.Stat.PrivateCateRoughdesign.pi_uniform_child_extension_volume_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeProbability.lean:44

The rooted geometric event obtained by successively adding a child whose parent is a function of the earlier covariates. Coordinate projections give ordinary ordered labeled trees.

Definition (Lean source)
h d :
ℝ
parent :
(m : ℕ) → (Fin (m + 1) → Covariate) → Covariate
m :
ℕ
orderedTreeRegion h d parent m :
Set (Fin (m + 1) → Covariate)
clause 1
| 0 => {x | |(x 0 : ℝ) - x0| < h}
clause 2
| m+1 => {x | (fun i : Fin (m + 1) => x i.castSucc) ∈ orderedTreeRegion h d parent m ∧
clause 3
|(x (last (m + 1)) : ℝ) - parent m (fun i : Fin (m + 1) => x i.castSucc)| < 2 * d}
theorem measurableSet_orderedTreeRegion

The ordered rooted-tree event is Borel whenever each parent selector is Borel. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
h d :
ℝ
parent :
(m : ℕ) → (Fin (m + 1) → Covariate) → Covariate
hp :
∀ m, Measurable (parent m)
m :
ℕ
Proof (Lean source)
-- @node: measurableSet_orderedTreeRegion lemma measurableSet_orderedTreeRegion (h d : ℝ) (parent : (m : ℕ) → (Fin (m + 1) → Covariate) → Covariate) (hp : ∀ m, Measurable (parent m)) (m : ℕ) : MeasurableSet (orderedTreeRegion h d parent m) := by induction m with | zero => exact measurableSet_lt (by fun_prop) measurable_const | succ m ih => change MeasurableSet {x : Fin (m + 2) → Covariate | (fun i : Fin (m + 1) => x i.castSucc) ∈ orderedTreeRegion h d parent m ∧ |(x (last (m + 1)) : ℝ) - parent m (fun i : Fin (m + 1) => x i.castSucc)| < 2 * d} exact (ih.preimage (by fun_prop)).inter (measurableSet_lt (show Measurable (fun x : Fin (m + 2) → Covariate => |(x (last (m + 1)) : ℝ) - parent m (fun i : Fin (m + 1) => x i.castSucc)|) by fun_prop) measurable_const)
CausalSmith.Stat.PrivateCateRoughdesign.measurableSet_orderedTreeRegion · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeProbability.lean:90
theorem orderedTreeRegion_volume_le

Under iid uniform design, any parent-before-child rooted tree has probability bounded by its root length times one child length per edge. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
h d :
ℝ
parent :
(m : ℕ) → (Fin (m + 1) → Covariate) → Covariate
hp :
∀ m, Measurable (parent m)
m :
ℕ
(Measure.pi (fun _ : Fin (m + 1) => (volume : Measure Covariate))) (orderedTreeRegion h d parent m)
≤ ofReal (2 * h) * (ofReal (4 * d)) ^ m
Proof (Lean source)
-- @node: orderedTreeRegion_volume_le lemma orderedTreeRegion_volume_le (h d : ℝ) (parent : (m : ℕ) → (Fin (m + 1) → Covariate) → Covariate) (hp : ∀ m, Measurable (parent m)) (m : ℕ) : (Measure.pi (fun _ : Fin (m + 1) => (volume : Measure Covariate))) (orderedTreeRegion h d parent m) ≤ ofReal (2 * h) * (ofReal (4 * d)) ^ m := by induction m with | zero => have he : orderedTreeRegion h d parent 0 = pi univ (fun _ : Fin 1 => {x : Covariate | |(x : ℝ) - x0| < h}) := by ext x simp [orderedTreeRegion, Set.mem_pi, Fin.forall_fin_one] rw [he, Measure.pi_pi] simpa using volume_tree_root_region_le h | succ m ih => calc _ ≤ ofReal (4 * d) * (Measure.pi (fun _ : Fin (m + 1) => (volume : Measure Covariate))) (orderedTreeRegion h d parent m) := pi_uniform_child_extension_volume_le (m + 1) d _ (measurableSet_orderedTreeRegion h d parent hp m) (parent m) (hp m) _ ≤ ofReal (4 * d) * (ofReal (2 * h) * (ofReal (4 * d)) ^ m) := mul_le_mul' le_rfl ih _ = _ := by rw [pow_succ]; ac_rfl
CausalSmith.Stat.PrivateCateRoughdesign.orderedTreeRegion_volume_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeProbability.lean:107

A labeled tree event in a fixed parent-before-child enumeration. The zero-edge event imposes no root restriction; the first shared-sign edge supplies localization.

Definition (Lean source)
hL :
ℝ
p :
(m : ℕ) → Fin (m + 1)
m :
ℕ
orderedSharedTreeEvent hL p m :
Set (Fin (m + 1) → Covariate)
clause 1
| 0 => univ
clause 2
| m+1
=> {x | (fun i : Fin (m + 1) => x i.castSucc) ∈ orderedSharedTreeEvent hL p m ∧ sharedAdj hL (m + 2) x (last (m + 1)) (p m).castSucc}
CausalSmith.Stat.PrivateCateRoughdesign.orderedSharedTreeEvent · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeProbability.lean:136
theorem orderedSharedTreeEvent_subset_region

The first edge localizes the root, and each later edge supplies its child's geometric constraint. No isolation restrictions are needed for this event inclusion. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
p :
(m : ℕ) → Fin (m + 1)
m :
ℕ
orderedSharedTreeEvent hL p (m + 1) ⊆ orderedTreeRegion hL (deltaL hL) (fun k x => x (p k)) (m + 1)
Proof (Lean source)
-- @node: orderedSharedTreeEvent_subset_region lemma orderedSharedTreeEvent_subset_region (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (p : (m : ℕ) → Fin (m + 1)) (m : ℕ) : orderedSharedTreeEvent hL p (m + 1) ⊆ orderedTreeRegion hL (deltaL hL) (fun k x => x (p k)) (m + 1) := by induction m with | zero => intro x hx obtain ⟨_, hedge⟩ := hx have hg := sharedAdj_geometric_restrictions hL hhL 2 x (last 1) (p 0).castSucc hedge have hp0 : p 0 = 0 := by apply Fin.ext; have := (p 0).isLt; simp only [Fin.val_zero]; omega change (|(x ((0 : Fin 1).castSucc) : ℝ) - x0| < hL) ∧ _ constructor · simpa [hp0] using hg.2.1 · exact hg.2.2 | succ m ih => intro x hx obtain ⟨hprefix, hedge⟩ := hx exact ⟨ih hprefix, (sharedAdj_geometric_restrictions hL hhL _ x _ _ hedge).2.2⟩
CausalSmith.Stat.PrivateCateRoughdesign.orderedSharedTreeEvent_subset_region · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeProbability.lean:145
theorem orderedSharedTreeEvent_volume_le

A specified shared-sign tree on at least two iid uniform covariates has probability at most two macro radii times four micro radii for every edge. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
p :
(m : ℕ) → Fin (m + 1)
m :
ℕ
hm :
1 ≤ m
(Measure.pi (fun _ : Fin (m + 1) => (volume : Measure Covariate))) (orderedSharedTreeEvent hL p m)
≤ ofReal (2 * hL * (4 * deltaL hL) ^ m)
Proof (Lean source)
-- @node: orderedSharedTreeEvent_volume_le lemma orderedSharedTreeEvent_volume_le (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (p : (m : ℕ) → Fin (m + 1)) (m : ℕ) (hm : 1 ≤ m) : (Measure.pi (fun _ : Fin (m + 1) => (volume : Measure Covariate))) (orderedSharedTreeEvent hL p m) ≤ ofReal (2 * hL * (4 * deltaL hL) ^ m) := by have hh : 0 < hL := hhL.1 obtain ⟨k, rfl⟩ : ∃ k, m = k + 1 := ⟨m - 1, by omega⟩ calc _ ≤ (Measure.pi (fun _ : Fin (k + 1 + 1) => (volume : Measure Covariate))) (orderedTreeRegion hL (deltaL hL) (fun j x => x (p j)) (k + 1)) := measure_mono (orderedSharedTreeEvent_subset_region hL hhL p k) _ ≤ ofReal (2 * hL) * (ofReal (4 * deltaL hL)) ^ (k + 1) := orderedTreeRegion_volume_le hL (deltaL hL) (fun j x => x (p j)) (by intro j; fun_prop) (k + 1) _ = _ := by rw [← ENNReal.ofReal_pow (show 0 ≤ 4 * deltaL hL by unfold deltaL; positivity)] exact (ENNReal.ofReal_mul (show 0 ≤ 2 * hL by positivity)).symm
CausalSmith.Stat.PrivateCateRoughdesign.orderedSharedTreeEvent_volume_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeProbability.lean:169
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.TreeSeries 17 declarations Numerical summation of the labeled-tree envelope for sparse shared-sign components.

Numerical summation of the labeled-tree envelope for sparse shared-sign components.

theorem shifted_geometric_sum_le_three Lemma shifted_geometric_sum_le_three in the paper ↗

In the sparse regime, the differentiated geometric envelope is at most three. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
z :
ℝ
hz :
0 ≤ z
hzcap :
z ≤ 1 / 8
N :
ℕ
(∑ i ∈ range N, ((i : ℝ) + 2) * z ^ i) ≤ 3
Proof (Lean source)
-- @node: shifted_geometric_sum_le_three lemma shifted_geometric_sum_le_three (z : ℝ) (hz : 0 ≤ z) (hzcap : z ≤ 1 / 8) (N : ℕ) : (∑ i ∈ range N, ((i : ℝ) + 2) * z ^ i) ≤ 3 := by apply (shiftedArithmeticGeometric_sum_le z hz (by linarith) N).trans apply (div_le_iff₀ (sq_pos_of_pos (by linarith : 0 < 1 - z))).mpr have hs : (7/8 : ℝ) ^ 2 ≤ (1 - z) ^ 2 := by nlinarith nlinarith
CausalSmith.Stat.PrivateCateRoughdesign.shifted_geometric_sum_le_three · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeSeries.lean:14

Each tree-series coefficient is bounded by the differentiated geometric majorant. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
a :
ℝ
ha :
0 ≤ a
i :
ℕ
((i + 2 : ℕ) : ℝ) ^ ((i + 2) + 1) / ((i + 2).factorial : ℝ) * a ^ i
≤ (exp 1) ^ 2 * ((i : ℝ) + 2) * ((exp 1) * a) ^ i
Proof (Lean source)
-- @node: tree_series_term_le lemma tree_series_term_le (a : ℝ) (ha : 0 ≤ a) (i : ℕ) : ((i + 2 : ℕ) : ℝ) ^ ((i + 2) + 1) / ((i + 2).factorial : ℝ) * a ^ i ≤ (exp 1) ^ 2 * ((i : ℝ) + 2) * ((exp 1) * a) ^ i := by have h : (((i + 2 : ℕ) : ℝ) ^ (i + 2)) / (((i + 2).factorial : ℕ) : ℝ) ≤ (exp 1) ^ (i + 2) := by have hExp := Real.pow_div_factorial_le_exp (x := ((i + 2 : ℕ) : ℝ)) (by positivity) (i + 2) simpa only [← Real.exp_nat_mul, mul_one] using hExp have hc : 0 ≤ ((i + 2 : ℕ) : ℝ) * a ^ i := by positivity have hm := mul_le_mul_of_nonneg_right h hc calc _ = ((i + 2 : ℕ) : ℝ) ^ (i + 2) / ((i + 2).factorial : ℝ) * (((i + 2 : ℕ) : ℝ) * a ^ i) := by rw [pow_succ]; ring _ ≤ (exp 1) ^ (i + 2) * (((i + 2 : ℕ) : ℝ) * a ^ i) := hm _ = _ := by rw [pow_add, mul_pow]; push_cast; ring
CausalSmith.Stat.PrivateCateRoughdesign.tree_series_term_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeSeries.lean:23
theorem tree_series_sum_le_thirty_two Lemma tree_series_sum_le_thirty_two in the paper ↗

Summing the tree coefficients under the sparse cap gives the roadmap's constant thirty-two. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
a :
ℝ
ha :
0 ≤ a
hcap :
(exp 1) * a ≤ 1 / 8
N :
ℕ
(∑ i ∈ range N, ((i + 2 : ℕ) : ℝ) ^ ((i + 2) + 1) / ((i + 2).factorial : ℝ) * a ^ i)
≤ 32
Proof (Lean source)
-- @node: tree_series_sum_le_thirty_two lemma tree_series_sum_le_thirty_two (a : ℝ) (ha : 0 ≤ a) (hcap : (exp 1) * a ≤ 1 / 8) (N : ℕ) : (∑ i ∈ range N, ((i + 2 : ℕ) : ℝ) ^ ((i + 2) + 1) / ((i + 2).factorial : ℝ) * a ^ i) ≤ 32 := by calc _ ≤ ∑ i ∈ range N, (exp 1) ^ 2 * ((i : ℝ) + 2) * ((exp 1) * a) ^ i := Finset.sum_le_sum (fun i _ => tree_series_term_le a ha i) _ = (exp 1) ^ 2 * ∑ i ∈ range N, ((i : ℝ) + 2) * ((exp 1) * a) ^ i := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro i _ ring _ ≤ (exp 1) ^ 2 * 3 := mul_le_mul_of_nonneg_left (shifted_geometric_sum_le_three _ (mul_nonneg (Real.exp_pos 1).le ha) hcap N) (sq_nonneg _) _ ≤ 32 := by have he := Real.exp_one_lt_d9 have hp := Real.exp_pos 1 nlinarith
CausalSmith.Stat.PrivateCateRoughdesign.tree_series_sum_le_thirty_two · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeSeries.lean:41
theorem sparse_tree_series_argument_le Lemma sparse_tree_series_argument_le in the paper ↗

The sample sparsity cap places the exponential tree-series argument below one eighth. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
d :
ℝ
hd :
0 ≤ d
hcap :
(n : ℝ) * d ≤ 1 / 128
(exp 1) * (4 * (n : ℝ) * d) ≤ 1 / 8
Proof (Lean source)
-- @node: sparse_tree_series_argument_le lemma sparse_tree_series_argument_le (n : ℕ) (d : ℝ) (hd : 0 ≤ d) (hcap : (n : ℝ) * d ≤ 1 / 128) : (exp 1) * (4 * (n : ℝ) * d) ≤ 1 / 8 := by have he := Real.exp_one_lt_three have hn : 0 ≤ (n : ℝ) * d := mul_nonneg (Nat.cast_nonneg n) hd have hm := mul_le_mul_of_nonneg_right he.le hn nlinarith
CausalSmith.Stat.PrivateCateRoughdesign.sparse_tree_series_argument_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeSeries.lean:65
theorem sparse_tree_series_sum_le Lemma sparse_tree_series_sum_le in the paper ↗

The finite numerical tree series is uniformly bounded in the sparse sample regime. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n N :
ℕ
d :
ℝ
hd :
0 ≤ d
hcap :
(n : ℝ) * d ≤ 1 / 128
(∑ i ∈ range N, ((i + 2 : ℕ) : ℝ) ^ ((i + 2) + 1) / ((i + 2).factorial : ℝ) * (4 * (n : ℝ) * d) ^ i)
≤ 32
Proof (Lean source)
-- @node: sparse_tree_series_sum_le lemma sparse_tree_series_sum_le (n N : ℕ) (d : ℝ) (hd : 0 ≤ d) (hcap : (n : ℝ) * d ≤ 1 / 128) : (∑ i ∈ range N, ((i + 2 : ℕ) : ℝ) ^ ((i + 2) + 1) / ((i + 2).factorial : ℝ) * (4 * (n : ℝ) * d) ^ i) ≤ 32 := by exact tree_series_sum_le_thirty_two _ (by positivity) (sparse_tree_series_argument_le n d hd hcap) N
CausalSmith.Stat.PrivateCateRoughdesign.sparse_tree_series_sum_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeSeries.lean:75
theorem cubic_tree_envelope_term_le Lemma cubic_tree_envelope_term_le in the paper ↗

Each cubic component-count envelope factors into the numerical tree coefficient. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n i :
ℕ
t h d :
ℝ
ht :
0 ≤ t
hh :
0 ≤ h
hd :
0 ≤ d
4 * t * ((i + 2 : ℕ) : ℝ) ^ 3 * (n.choose (i + 2) : ℝ) * (2 * h * ((i + 2 : ℕ) : ℝ) ^ i * (4 * d) ^ (i + 1))
≤ 32 * t * (n : ℝ) ^ 2 * h * d * (((i + 2 : ℕ) : ℝ) ^ ((i + 2) + 1) / ((i + 2).factorial : ℝ) * (4 * (n : ℝ) * d) ^ i)
Proof (Lean source)
-- @node: cubic_tree_envelope_term_le lemma cubic_tree_envelope_term_le (n i : ℕ) (t h d : ℝ) (ht : 0 ≤ t) (hh : 0 ≤ h) (hd : 0 ≤ d) : 4 * t * ((i + 2 : ℕ) : ℝ) ^ 3 * (n.choose (i + 2) : ℝ) * (2 * h * ((i + 2 : ℕ) : ℝ) ^ i * (4 * d) ^ (i + 1)) ≤ 32 * t * (n : ℝ) ^ 2 * h * d * (((i + 2 : ℕ) : ℝ) ^ ((i + 2) + 1) / ((i + 2).factorial : ℝ) * (4 * (n : ℝ) * d) ^ i) := by have hb : (n.choose (i + 2) : ℝ) ≤ (n : ℝ) ^ (i + 2) / (((i + 2).factorial : ℕ) : ℝ) := Nat.choose_le_pow_div (i + 2) n have hm := mul_le_mul_of_nonneg_left hb (show 0 ≤ 4 * t * ((i + 2 : ℕ) : ℝ) ^ 3 * (2 * h * ((i + 2 : ℕ) : ℝ) ^ i * (4 * d) ^ (i + 1)) by positivity) calc _ ≤ 4 * t * ((i + 2 : ℕ) : ℝ) ^ 3 * ((n : ℝ) ^ (i + 2) / ((i + 2).factorial : ℝ)) * (2 * h * ((i + 2 : ℕ) : ℝ) ^ i * (4 * d) ^ (i + 1)) := by simpa only [mul_assoc, mul_left_comm, mul_comm] using hm _ = _ := by rw [show (i + 2) + 1 = i + 3 by omega] simp only [pow_add, mul_pow] ring
CausalSmith.Stat.PrivateCateRoughdesign.cubic_tree_envelope_term_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeSeries.lean:84
theorem cubic_tree_envelope_sum_le Lemma cubic_tree_envelope_sum_le in the paper ↗

The full labeled-tree cubic envelope is at most the transport constant in the roadmap. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n N :
ℕ
t h d :
ℝ
ht :
0 ≤ t
hh :
0 ≤ h
hd :
0 ≤ d
hcap :
(n : ℝ) * d ≤ 1 / 128
(∑ i ∈ range N, 4 * t * ((i + 2 : ℕ) : ℝ) ^ 3 * (n.choose (i + 2) : ℝ) * (2 * h * ((i + 2 : ℕ) : ℝ) ^ i * (4 * d) ^ (i + 1)))
≤ 1024 * t * (n : ℝ) ^ 2 * h * d
Proof (Lean source)
-- @node: cubic_tree_envelope_sum_le lemma cubic_tree_envelope_sum_le (n N : ℕ) (t h d : ℝ) (ht : 0 ≤ t) (hh : 0 ≤ h) (hd : 0 ≤ d) (hcap : (n : ℝ) * d ≤ 1 / 128) : (∑ i ∈ range N, 4 * t * ((i + 2 : ℕ) : ℝ) ^ 3 * (n.choose (i + 2) : ℝ) * (2 * h * ((i + 2 : ℕ) : ℝ) ^ i * (4 * d) ^ (i + 1))) ≤ 1024 * t * (n : ℝ) ^ 2 * h * d := by calc _ ≤ ∑ i ∈ range N, 32 * t * (n : ℝ) ^ 2 * h * d * (((i + 2 : ℕ) : ℝ) ^ ((i + 2) + 1) / ((i + 2).factorial : ℝ) * (4 * (n : ℝ) * d) ^ i) := Finset.sum_le_sum (fun i _ => cubic_tree_envelope_term_le n i t h d ht hh hd) _ = 32 * t * (n : ℝ) ^ 2 * h * d * ∑ i ∈ range N, (((i + 2 : ℕ) : ℝ) ^ ((i + 2) + 1) / ((i + 2).factorial : ℝ) * (4 * (n : ℝ) * d) ^ i) := by rw [Finset.mul_sum] _ ≤ 32 * t * (n : ℝ) ^ 2 * h * d * 32 := mul_le_mul_of_nonneg_left (sparse_tree_series_sum_le n N d hd hcap) (by positivity) _ = _ := by ring
CausalSmith.Stat.PrivateCateRoughdesign.cubic_tree_envelope_sum_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeSeries.lean:103

The number of shared-sign components with a specified size, counted without repeated roots.

Definition (Lean source)
hL :
ℝ
n :
ℕ
x :
s :
ℕ
sizeComponentCount hL n x s :
ℕ
((orderedComponents hL n x).toFinset.filter (fun C => C.card = s)).card
CausalSmith.Stat.PrivateCateRoughdesign.sizeComponentCount · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeSeries.lean:120
theorem orderedComponents_card_range Lemma orderedComponents_card_range in the paper ↗

Every ordered component has between one and the sample size many vertices. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
n :
ℕ
x :
C :
hC :
C ∈ orderedComponents hL n x
conclusion 1
1 ≤ C.card
conclusion 2
C.card ≤ n
Proof (Lean source)
-- @node: orderedComponents_card_range lemma orderedComponents_card_range (hL : ℝ) (n : ℕ) (x : Fin n → Covariate) (C : Finset (Fin n)) (hC : C ∈ orderedComponents hL n x) : 1 ≤ C.card ∧ C.card ≤ n := by exact ⟨(orderedComponents_nonempty hL n x C hC).card_pos, (Finset.card_le_univ C).trans_eq (Fintype.card_fin n)⟩
CausalSmith.Stat.PrivateCateRoughdesign.orderedComponents_card_range · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeSeries.lean:125
theorem sizeComponentCount_zero

Empty components never contribute to the component-size count. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
n :
ℕ
x :
sizeComponentCount hL n x 0 = 0
Proof (Lean source)
-- @node: sizeComponentCount_zero lemma sizeComponentCount_zero (hL : ℝ) (n : ℕ) (x : Fin n → Covariate) : sizeComponentCount hL n x 0 = 0 := by classical unfold sizeComponentCount apply Finset.card_eq_zero.mpr apply Finset.eq_empty_iff_forall_notMem.mpr intro C hC obtain ⟨hC, hc⟩ := Finset.mem_filter.mp hC have hp := (orderedComponents_card_range hL n x C (List.mem_toFinset.mp hC)).1 omega
CausalSmith.Stat.PrivateCateRoughdesign.sizeComponentCount_zero · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeSeries.lean:133
theorem orderedComponents_sum_by_size

Grouping a component observable by size is an exact finite counting identity. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
R :
hL :
ℝ
n :
ℕ
x :
f :
ℕ → R
(∑ C ∈ (orderedComponents hL n x).toFinset, f C.card)
= ∑ s ∈ range (n + 1), (sizeComponentCount hL n x s : R) * f s
Proof (Lean source)
-- @node: orderedComponents_sum_by_size lemma orderedComponents_sum_by_size {R : Type*} [CommSemiring R] (hL : ℝ) (n : ℕ) (x : Fin n → Covariate) (f : ℕ → R) : (∑ C ∈ (orderedComponents hL n x).toFinset, f C.card) = ∑ s ∈ range (n + 1), (sizeComponentCount hL n x s : R) * f s := by classical have hsingle (C : Finset (Fin n)) (hC : C ∈ (orderedComponents hL n x).toFinset) : f C.card = ∑ s ∈ range (n + 1), if C.card = s then f s else 0 := by have hc := (orderedComponents_card_range hL n x C (List.mem_toFinset.mp hC)).2 simp [Finset.mem_range, show C.card < n + 1 by omega] rw [Finset.sum_congr rfl (fun C hC => hsingle C hC), Finset.sum_comm] apply Finset.sum_congr rfl intro s _ rw [← Finset.sum_filter] have he : (∑ C ∈ (orderedComponents hL n x).toFinset.filter (fun C => C.card = s), f s) = (sizeComponentCount hL n x s : R) * f s := by simp [sizeComponentCount, nsmul_eq_mul] exact he
CausalSmith.Stat.PrivateCateRoughdesign.orderedComponents_sum_by_size · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeSeries.lean:146
theorem measurable_sizeComponentCount

Component counts are Borel because they are constant on each finite labeled-graph stratum. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
n s :
ℕ
Measurable (fun x => sizeComponentCount hL n x s)
Proof (Lean source)
-- @node: measurable_sizeComponentCount @[fun_prop] lemma measurable_sizeComponentCount (hL : ℝ) (n s : ℕ) : Measurable (fun x => sizeComponentCount hL n x s) := by classical have hm : Measurable (fun x : Fin n → Covariate => ∑ G : SimpleGraph (Fin n), {x | sharedGraph hL n x = G}.indicator (fun _ => ((componentsOfGraph n G).toFinset.filter (fun C => C.card = s)).card) x) := by apply Finset.measurable_sum intro G _ exact measurable_const.indicator (measurableSet_sharedGraph_eq hL n G) convert hm using 1 funext x simp only [indicator, Set.mem_ofPred_eq] rw [Finset.sum_ite_eq, if_pos (Finset.mem_univ _)] rfl
CausalSmith.Stat.PrivateCateRoughdesign.measurable_sizeComponentCount · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeSeries.lean:166
theorem lintegral_component_cubic_sum_by_size

The expected nonsingleton cubic sum is exactly the sum of the expected component counts. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
n :
ℕ
t :
ℝ
μ :
(∫⁻ x, ∑ C ∈ (orderedComponents hL n x).toFinset, if C.card = 1 then 0 else ofReal (4 * t * (C.card : ℝ) ^ 3) ∂μ)
= ∑ s ∈ range (n + 1), (if s = 1 then 0 else ofReal (4 * t * (s : ℝ) ^ 3)) * ∫⁻ x, (sizeComponentCount hL n x s : ℝ≥0∞) ∂μ
Proof (Lean source)
-- @node: lintegral_component_cubic_sum_by_size lemma lintegral_component_cubic_sum_by_size (hL : ℝ) (n : ℕ) (t : ℝ) (μ : Measure (Fin n → Covariate)) : (∫⁻ x, ∑ C ∈ (orderedComponents hL n x).toFinset, if C.card = 1 then 0 else ofReal (4 * t * (C.card : ℝ) ^ 3) ∂μ) = ∑ s ∈ range (n + 1), (if s = 1 then 0 else ofReal (4 * t * (s : ℝ) ^ 3)) * ∫⁻ x, (sizeComponentCount hL n x s : ℝ≥0∞) ∂μ := by classical simp_rw [orderedComponents_sum_by_size hL n _ (fun s => if s = 1 then 0 else ofReal (4 * t * (s : ℝ) ^ 3))] rw [lintegral_finsetSum _ (fun s _ => by fun_prop)] apply Finset.sum_congr rfl intro s _ simp_rw [mul_comm (sizeComponentCount hL n _ s : ℝ≥0∞)] exact lintegral_const_mul _ (by fun_prop)
CausalSmith.Stat.PrivateCateRoughdesign.lintegral_component_cubic_sum_by_size · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeSeries.lean:183

Removing sizes zero and one reindexes any vanishing observable by nonsingleton sizes. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
R :
n :
ℕ
hn :
1 ≤ n
f :
ℕ → R
h0 :
f 0 = 0
h1 :
f 1 = 0
(∑ s ∈ range (n + 1), f s) = ∑ i ∈ range (n - 1), f (i + 2)
Proof (Lean source)
-- @node: sum_sizes_eq_shifted lemma sum_sizes_eq_shifted {R : Type*} [AddCommMonoid R] (n : ℕ) (hn : 1 ≤ n) (f : ℕ → R) (h0 : f 0 = 0) (h1 : f 1 = 0) : (∑ s ∈ range (n + 1), f s) = ∑ i ∈ range (n - 1), f (i + 2) := by rw [show n + 1 = 2 + (n - 1) by omega, Finset.sum_range_add] simp only [Finset.sum_range_succ, Finset.sum_range_zero, h0, h1, add_zero, zero_add] apply Finset.sum_congr rfl intro i _ rw [Nat.add_comm]
CausalSmith.Stat.PrivateCateRoughdesign.sum_sizes_eq_shifted · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeSeries.lean:200
theorem lintegral_component_cubic_sum_shifted

The expected nonsingleton cubic component cost is indexed by sizes two through n. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
hL :
ℝ
n :
ℕ
hn :
1 ≤ n
t :
ℝ
μ :
(∫⁻ x, ∑ C ∈ (orderedComponents hL n x).toFinset, if C.card = 1 then 0 else ofReal (4 * t * (C.card : ℝ) ^ 3) ∂μ)
= ∑ i ∈ range (n - 1), ofReal (4 * t * ((i + 2 : ℕ) : ℝ) ^ 3) * ∫⁻ x, (sizeComponentCount hL n x (i + 2) : ℝ≥0∞) ∂μ
Proof (Lean source)
-- @node: lintegral_component_cubic_sum_shifted lemma lintegral_component_cubic_sum_shifted (hL : ℝ) (n : ℕ) (hn : 1 ≤ n) (t : ℝ) (μ : Measure (Fin n → Covariate)) : (∫⁻ x, ∑ C ∈ (orderedComponents hL n x).toFinset, if C.card = 1 then 0 else ofReal (4 * t * (C.card : ℝ) ^ 3) ∂μ) = ∑ i ∈ range (n - 1), ofReal (4 * t * ((i + 2 : ℕ) : ℝ) ^ 3) * ∫⁻ x, (sizeComponentCount hL n x (i + 2) : ℝ≥0∞) ∂μ := by rw [lintegral_component_cubic_sum_by_size] rw [sum_sizes_eq_shifted n hn _ (by simp) (by simp)] apply Finset.sum_congr rfl intro i _ rw [if_neg (by omega : i + 2 ≠ 1)]
CausalSmith.Stat.PrivateCateRoughdesign.lintegral_component_cubic_sum_shifted · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeSeries.lean:211
theorem lintegral_component_cubic_sum_le_tree_envelope

Component-count expectations bounded by the labeled-tree envelope give the claimed cubic cost. This implication leaves the geometric spanning - tree probability estimate as an explicit input, without inserting it into a frozen paper theorem. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
n :
ℕ
hn :
1 ≤ n
t h d :
ℝ
ht :
0 ≤ t
hh :
0 ≤ h
hd :
0 ≤ d
hcap :
(n : ℝ) * d ≤ 1 / 128
μ :
hcounts :
∀ i ∈ range (n - 1),
(∫⁻ x, (sizeComponentCount hL n x (i + 2) : ℝ≥0∞) ∂μ)
≤ ofReal ((n.choose (i + 2) : ℝ) * (2 * h * ((i + 2 : ℕ) : ℝ) ^ i * (4 * d) ^ (i + 1)))
(∫⁻ x, ∑ C ∈ (orderedComponents hL n x).toFinset, if C.card = 1 then 0 else ofReal (4 * t * (C.card : ℝ) ^ 3) ∂μ)
≤ ofReal (1024 * t * (n : ℝ) ^ 2 * h * d)
Proof (Lean source)
-- @node: lintegral_component_cubic_sum_le_tree_envelope lemma lintegral_component_cubic_sum_le_tree_envelope (hL : ℝ) (n : ℕ) (hn : 1 ≤ n) (t h d : ℝ) (ht : 0 ≤ t) (hh : 0 ≤ h) (hd : 0 ≤ d) (hcap : (n : ℝ) * d ≤ 1 / 128) (μ : Measure (Fin n → Covariate)) (hcounts : ∀ i ∈ range (n - 1), (∫⁻ x, (sizeComponentCount hL n x (i + 2) : ℝ≥0∞) ∂μ) ≤ ofReal ((n.choose (i + 2) : ℝ) * (2 * h * ((i + 2 : ℕ) : ℝ) ^ i * (4 * d) ^ (i + 1)))) : (∫⁻ x, ∑ C ∈ (orderedComponents hL n x).toFinset, if C.card = 1 then 0 else ofReal (4 * t * (C.card : ℝ) ^ 3) ∂μ) ≤ ofReal (1024 * t * (n : ℝ) ^ 2 * h * d) := by rw [lintegral_component_cubic_sum_shifted hL n hn] calc _ ≤ ∑ i ∈ range (n - 1), ofReal (4 * t * ((i + 2 : ℕ) : ℝ) ^ 3) * ofReal ((n.choose (i + 2) : ℝ) * (2 * h * ((i + 2 : ℕ) : ℝ) ^ i * (4 * d) ^ (i + 1))) := Finset.sum_le_sum (fun i hi => mul_le_mul le_rfl (hcounts i hi) zero_le zero_le) _ = ofReal (∑ i ∈ range (n - 1), 4 * t * ((i + 2 : ℕ) : ℝ) ^ 3 * (n.choose (i + 2) : ℝ) * (2 * h * ((i + 2 : ℕ) : ℝ) ^ i * (4 * d) ^ (i + 1))) := by rw [ENNReal.ofReal_sum_of_nonneg (fun i _ => by positivity)] apply Finset.sum_congr rfl intro i _ rw [← ENNReal.ofReal_mul (by positivity)] congr 1 ring _ ≤ _ := ENNReal.ofReal_le_ofReal (cubic_tree_envelope_sum_le n (n - 1) t h d ht hh hd hcap)
CausalSmith.Stat.PrivateCateRoughdesign.lintegral_component_cubic_sum_le_tree_envelope · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeSeries.lean:224
theorem commonMassCoupling_hamming_cost_le_of_tree_counts

For the actual dataset coupling, the remaining tree-count probability estimate implies its full sparse Hamming cost certificate. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
hL :
ℝ
hhL :
0 < hL ∧ hL ≤ 1 / 4
n :
ℕ
hn :
1 ≤ n
hcap :
(n : ℝ) * deltaL hL ≤ 1 / 128
hcounts :
∀ i ∈ range (n - 1),
(∫⁻ x, (sizeComponentCount hL n x (i + 2) : ℝ≥0∞) ∂(Measure.pi (fun _ : Fin n => (volume : Measure Covariate))))
≤ ofReal ((n.choose (i + 2) : ℝ) * (2 * hL * ((i + 2 : ℕ) : ℝ) ^ i * (4 * deltaL hL) ^ (i + 1)))
(∫⁻ zw, (dHam n zw.1 zw.2 : ℝ≥0∞) ∂commonMassCoupling hL n)
≤ ofReal (1024 * separation hL * (n : ℝ) ^ 2 * hL * deltaL hL)
Proof (Lean source)
-- @node: commonMassCoupling_hamming_cost_le_of_tree_counts lemma commonMassCoupling_hamming_cost_le_of_tree_counts (hL : ℝ) (hhL : 0 < hL ∧ hL ≤ 1 / 4) (n : ℕ) (hn : 1 ≤ n) (hcap : (n : ℝ) * deltaL hL ≤ 1 / 128) (hcounts : ∀ i ∈ range (n - 1), (∫⁻ x, (sizeComponentCount hL n x (i + 2) : ℝ≥0∞) ∂(Measure.pi (fun _ : Fin n => (volume : Measure Covariate)))) ≤ ofReal ((n.choose (i + 2) : ℝ) * (2 * hL * ((i + 2 : ℕ) : ℝ) ^ i * (4 * deltaL hL) ^ (i + 1)))) : (∫⁻ zw, (dHam n zw.1 zw.2 : ℝ≥0∞) ∂commonMassCoupling hL n) ≤ ofReal (1024 * separation hL * (n : ℝ) ^ 2 * hL * deltaL hL) := by have hp : 0 < hL := hhL.1 apply (commonMassCoupling_hamming_cost_le_cubic_sum hL hhL n).trans apply lintegral_component_cubic_sum_le_tree_envelope hL n hn (separation hL) hL (deltaL hL) _ hhL.1.le (by unfold deltaL; positivity) hcap _ hcounts unfold separation kappa positivity
CausalSmith.Stat.PrivateCateRoughdesign.commonMassCoupling_hamming_cost_le_of_tree_counts · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TreeSeries.lean:252
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.TunedLength 4 declarations Uniform expected interval length under the public tuning, including its fallback branch.

Uniform expected interval length under the public tuning, including its fallback branch.

theorem tuned_interval_radius_le

The tuned variance envelope bounds twice the conservative interval radius. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
epsilon :
ℝ
hn :
2 ≤ n
he :
0 < epsilon ∧ epsilon ≤ 1
hr :
rate n epsilon < 1 / 8
2 * sqrt (10 * Vbound n epsilon (tunedH n epsilon) (tunedK n epsilon))
≤ 2^22 * rate n epsilon
Proof (Lean source)
-- @node: tuned_interval_radius_le lemma tuned_interval_radius_le (n : ℕ) (epsilon : ℝ) (hn : 2 ≤ n) (he : 0 < epsilon ∧ epsilon ≤ 1) (hr : rate n epsilon < 1 / 8) : 2 * sqrt (10 * Vbound n epsilon (tunedH n epsilon) (tunedK n epsilon)) ≤ 2^22 * rate n epsilon := by have hv := tuned_Vbound_le n epsilon hn he hr have hr0 := (rate_pos n epsilon (by omega)).le have hs : sqrt (10 * Vbound n epsilon (tunedH n epsilon) (tunedK n epsilon)) ≤ 2^21 * rate n epsilon := by apply (Real.sqrt_le_iff).mpr constructor · positivity · nlinarith [sq_nonneg (rate n epsilon)] nlinarith
CausalSmith.Stat.PrivateCateRoughdesign.tuned_interval_radius_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TunedLength.lean:10
theorem full_interval_expectedLength

The public full-range fallback has length two under every model law. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
P :
expectedLength n (Kernel.const (Dataset n) (Measure.dirac (closedInterval (-1) 1))) P = 2
Proof (Lean source)
-- @node: full_interval_expectedLength lemma full_interval_expectedLength (n : ℕ) (P : CausalLaw) : expectedLength n (Kernel.const (Dataset n) (Measure.dirac (closedInterval (-1) 1))) P = 2 := by let : IsProbabilityMeasure (Pobs P) := by unfold Pobs exact Measure.isProbabilityMeasure_map measurable_observe.aemeasurable let : IsProbabilityMeasure (dataLaw n P) := by unfold dataLaw; infer_instance unfold expectedLength change (∫⁻ c, c.leb ∂(dataLaw n P).bind (fun _ => Measure.dirac (closedInterval (-1) 1))) = 2 rw [Measure.bind_const, measure_univ, one_smul, lintegral_dirac] rw [closedInterval_leb] norm_num
CausalSmith.Stat.PrivateCateRoughdesign.full_interval_expectedLength · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TunedLength.lean:26
theorem publicTunedInterval_expectedLength_le

The tuned interval obeys the stated expected-length rate at every law, from the deterministic radius bound on the active branch and the full-range length on the fallback branch. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
epsilon :
ℝ
hn :
2 ≤ n
he :
0 < epsilon ∧ epsilon ≤ 1
P :
≤ ofReal (2^22 * rate n epsilon)
Proof (Lean source)
-- @node: publicTunedInterval_expectedLength_le lemma publicTunedInterval_expectedLength_le (n : ℕ) (epsilon : ℝ) (hn : 2 ≤ n) (he : 0 < epsilon ∧ epsilon ≤ 1) (P : CausalLaw) : expectedLength n (publicTunedInterval n epsilon) P ≤ ofReal (2^22 * rate n epsilon) := by classical unfold publicTunedInterval split_ifs with hr · rw [full_interval_expectedLength] have hb : (2 : ℝ) ≤ 2^22 * rate n epsilon := by nlinarith calc (2 : ℝ≥0∞) = ofReal (2 : ℝ) := by norm_num _ ≤ _ := ENNReal.ofReal_le_ofReal hb · exact (Ihk_expectedLength_le n _ epsilon _ he.1 P).trans (ENNReal.ofReal_le_ofReal ((min_le_right _ _).trans (tuned_interval_radius_le n epsilon hn he (lt_of_not_ge hr))))
CausalSmith.Stat.PrivateCateRoughdesign.publicTunedInterval_expectedLength_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TunedLength.lean:41
theorem publicTunedInterval_worstLength_le

Taking the supremum over the full model preserves the public interval-length bound. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
epsilon :
ℝ
hn :
2 ≤ n
he :
0 < epsilon ∧ epsilon ≤ 1
worstLength n (publicTunedInterval n epsilon) ≤ ofReal (2^22 * rate n epsilon)
Proof (Lean source)
-- @node: publicTunedInterval_worstLength_le lemma publicTunedInterval_worstLength_le (n : ℕ) (epsilon : ℝ) (hn : 2 ≤ n) (he : 0 < epsilon ∧ epsilon ≤ 1) : worstLength n (publicTunedInterval n epsilon) ≤ ofReal (2^22 * rate n epsilon) := by unfold worstLength exact iSup_le fun P => iSup_le fun _ => publicTunedInterval_expectedLength_le n epsilon hn he P
CausalSmith.Stat.PrivateCateRoughdesign.publicTunedInterval_worstLength_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TunedLength.lean:60
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.TunedRisk 4 declarations Absolute risk from the squared-error envelope under public tuning.

Absolute risk from the squared-error envelope under public tuning.

theorem absolute_moment_le_of_squared_moment Lemma absolute_moment_le_of_squared_moment in the paper ↗

Young's quadratic inequality converts a second moment to an absolute first moment. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
t B :
ℝ
hB :
0 < B
hmse :
(∫⁻ u, ofReal ((u-t)^2) ∂Q) ≤ ofReal (B^2)
(∫⁻ u, ofReal |u-t| ∂Q) ≤ ofReal B
Proof (Lean source)
-- @node: absolute_moment_le_of_squared_moment lemma absolute_moment_le_of_squared_moment (Q : Measure ℝ) [IsProbabilityMeasure Q] (t B : ℝ) (hB : 0 < B) (hmse : (∫⁻ u, ofReal ((u-t)^2) ∂Q) ≤ ofReal (B^2)) : (∫⁻ u, ofReal |u-t| ∂Q) ≤ ofReal B := by have hy (u : ℝ) : |u-t| ≤ (2*B)⁻¹ * (u-t)^2 + B/2 := by rw [inv_mul_eq_div] have hs := sq_nonneg (|u-t|-B) have heq : (2*B) * ((u-t)^2 / (2*B) + B/2) = (u-t)^2 + B^2 := by field_simp apply (mul_le_mul_iff_right₀ (show 0 < 2*B by positivity)).mp rw [heq] nlinarith [sq_abs (u-t)] calc (∫⁻ u, ofReal |u-t| ∂Q) ≤ ∫⁻ u, ofReal ((2*B)⁻¹) * ofReal ((u-t)^2) + ofReal (B/2) ∂Q := by apply lintegral_mono intro u dsimp only rw [← ENNReal.ofReal_mul (by positivity), ← ENNReal.ofReal_add (by positivity) (by positivity)] exact ENNReal.ofReal_le_ofReal (hy u) _ = ofReal ((2*B)⁻¹) * (∫⁻ u, ofReal ((u-t)^2) ∂Q) + ofReal (B/2) := by rw [lintegral_add_right _ measurable_const, lintegral_const_mul] · simp · fun_prop _ ≤ ofReal ((2*B)⁻¹) * ofReal (B^2) + ofReal (B/2) := add_le_add (mul_le_mul le_rfl hmse zero_le zero_le) le_rfl _ = ofReal B := by rw [← ENNReal.ofReal_mul (by positivity), ← ENNReal.ofReal_add (by positivity) (by positivity)] congr 1 field_simp ring
CausalSmith.Stat.PrivateCateRoughdesign.absolute_moment_le_of_squared_moment · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TunedRisk.lean:9
theorem zero_release_scalarRisk_le

The data-independent zero release has absolute risk at most one throughout the model. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
P :
hP :
scalarRisk n (Kernel.const (Dataset n) (Measure.dirac 0)) P ≤ 1
Proof (Lean source)
-- @node: zero_release_scalarRisk_le lemma zero_release_scalarRisk_le (n : ℕ) (P : CausalLaw) (hP : CompleteModel P) : scalarRisk n (Kernel.const (Dataset n) (Measure.dirac 0)) P ≤ 1 := by letI : IsProbabilityMeasure (Pobs P) := by unfold Pobs exact Measure.isProbabilityMeasure_map measurable_observe.aemeasurable letI : IsProbabilityMeasure (dataLaw n P) := by unfold dataLaw; infer_instance unfold scalarRisk change (∫⁻ u, ofReal |u-theta P| ∂(dataLaw n P).bind (fun _ => Measure.dirac 0)) ≤ 1 rw [Measure.bind_const, measure_univ, one_smul, lintegral_dirac] have ht := theta_mem_Icc P hP have ha : |0-theta P| ≤ 1 := by rw [zero_sub, abs_neg]; exact abs_le.mpr ht simpa using ENNReal.ofReal_le_ofReal ha
CausalSmith.Stat.PrivateCateRoughdesign.zero_release_scalarRisk_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TunedRisk.lean:45
theorem tuned_scalarRisk_le_of_squared_error_le

The active tuned scalar release attains the absolute-risk rate from its second moment. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
epsilon :
ℝ
hn :
2 ≤ n
he :
0 < epsilon ∧ epsilon ≤ 1
hr :
rate n epsilon < 1/8
P :
hmse :
(∫⁻ u, ofReal ((u-theta P)^2) ∂(Thk n epsilon (tunedH n epsilon) (tunedK n epsilon) ∘ₘ dataLaw n P))
≤ ofReal (Vbound n epsilon (tunedH n epsilon) (tunedK n epsilon))
scalarRisk n (Thk n epsilon (tunedH n epsilon) (tunedK n epsilon)) P
≤ ofReal (2^18 * rate n epsilon)
Proof (Lean source)
-- @node: tuned_scalarRisk_le_of_squared_error_le lemma tuned_scalarRisk_le_of_squared_error_le (n : ℕ) (epsilon : ℝ) (hn : 2 ≤ n) (he : 0 < epsilon ∧ epsilon ≤ 1) (hr : rate n epsilon < 1/8) (P : CausalLaw) (hmse : (∫⁻ u, ofReal ((u-theta P)^2) ∂(Thk n epsilon (tunedH n epsilon) (tunedK n epsilon) ∘ₘ dataLaw n P)) ≤ ofReal (Vbound n epsilon (tunedH n epsilon) (tunedK n epsilon))) : scalarRisk n (Thk n epsilon (tunedH n epsilon) (tunedK n epsilon)) P ≤ ofReal (2^18 * rate n epsilon) := by letI : IsProbabilityMeasure (Pobs P) := by unfold Pobs exact Measure.isProbabilityMeasure_map measurable_observe.aemeasurable letI : IsProbabilityMeasure (dataLaw n P) := by unfold dataLaw; infer_instance letI := (Thk_private n (tunedK n epsilon) epsilon (tunedH n epsilon) he.1 (public_tuning_parameters n epsilon hn he hr).1 (by have hp := public_tuning_parameters n epsilon hn he hr; omega)).markov have hv := tuned_Vbound_le n epsilon hn he hr have hb : Vbound n epsilon (tunedH n epsilon) (tunedK n epsilon) ≤ (2^18 * rate n epsilon)^2 := by nlinarith [sq_nonneg (rate n epsilon)] exact absolute_moment_le_of_squared_moment _ _ _ (by have hp := rate_pos n epsilon (by omega); positivity) (hmse.trans (ENNReal.ofReal_le_ofReal hb))
CausalSmith.Stat.PrivateCateRoughdesign.tuned_scalarRisk_le_of_squared_error_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TunedRisk.lean:61
theorem publicTunedRelease_worstRisk_of_squared_error_le

The fallback and active tuning branches give the uniform scalar-risk rate once the uniform statistical second moment has been proved. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
n :
ℕ
epsilon :
ℝ
hn :
2 ≤ n
he :
0 < epsilon ∧ epsilon ≤ 1
hmse :
∀ (k : ℕ) (h : ℝ),
2
≤ k → (0 < h ∧ h ≤ 1/4) → ∀ P : CausalLaw, CompleteModel P → (∫⁻ u, ofReal ((u-theta P)^2) ∂(Thk n epsilon h k ∘ₘ dataLaw n P)) ≤ ofReal (Vbound n epsilon h k)
worstRisk n (publicTunedRelease n epsilon) ≤ ofReal (2^18 * rate n epsilon)
Proof (Lean source)
-- @node: publicTunedRelease_worstRisk_of_squared_error_le lemma publicTunedRelease_worstRisk_of_squared_error_le (n : ℕ) (epsilon : ℝ) (hn : 2 ≤ n) (he : 0 < epsilon ∧ epsilon ≤ 1) (hmse : ∀ (k : ℕ) (h : ℝ), 2 ≤ k → (0 < h ∧ h ≤ 1/4) → ∀ P : CausalLaw, CompleteModel P → (∫⁻ u, ofReal ((u-theta P)^2) ∂(Thk n epsilon h k ∘ₘ dataLaw n P)) ≤ ofReal (Vbound n epsilon h k)) : worstRisk n (publicTunedRelease n epsilon) ≤ ofReal (2^18 * rate n epsilon) := by classical unfold worstRisk refine iSup_le fun P => iSup_le fun hP => ?_ unfold publicTunedRelease split_ifs with hr · have hb : (1 : ℝ) ≤ 2^18 * rate n epsilon := by nlinarith exact (zero_release_scalarRisk_le n P hP).trans (by simpa using ENNReal.ofReal_le_ofReal hb) · have hr' := lt_of_not_ge hr have hp := public_tuning_parameters n epsilon hn he hr' exact tuned_scalarRisk_le_of_squared_error_le n epsilon hn he hr' P (hmse _ _ hp.2.2.1 ⟨hp.1, hp.2.1⟩ P hP)
CausalSmith.Stat.PrivateCateRoughdesign.publicTunedRelease_worstRisk_of_squared_error_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TunedRisk.lean:85
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.TuningEnvelope 7 declarations The benchmark constraints and the dyadic public tuning variance envelope.

The benchmark constraints and the dyadic public tuning variance envelope.

theorem reciprocal_root_constraint Lemma reciprocal_root_constraint in the paper ↗

A reciprocal-root lower bound is equivalent to the corresponding polynomial constraint. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
x r :
ℝ
m :
ℕ
hx :
0 < x
hm :
0 < m
_hr :
0 ≤ r
h :
x ^ (-1 / (m : ℝ)) ≤ r
1 ≤ x * r^m
Proof (Lean source)
-- @node: reciprocal_root_constraint lemma reciprocal_root_constraint (x r : ℝ) (m : ℕ) (hx : 0 < x) (hm : 0 < m) (_hr : 0 ≤ r) (h : x ^ (-1 / (m : ℝ)) ≤ r) : 1 ≤ x * r^m := by have hp := pow_le_pow_left₀ (Real.rpow_nonneg hx.le _) h m have heq : (x ^ (-1 / (m : ℝ))) ^ m = x⁻¹ := by rw [← Real.rpow_mul_natCast hx.le] have hm' : (m : ℝ) ≠ 0 := by exact_mod_cast hm.ne' rw [div_mul_cancel₀ _ hm', Real.rpow_neg_one] rw [heq] at hp have := mul_le_mul_of_nonneg_left hp hx.le simpa [hx.ne'] using this
CausalSmith.Stat.PrivateCateRoughdesign.reciprocal_root_constraint · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TuningEnvelope.lean:7
theorem active_rate_constraints

Below the public fallback threshold the cap is inactive, so each candidate scale bounds its polynomial information constraint. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
epsilon :
ℝ
hn :
2 ≤ n
he :
0 < epsilon
hr :
rate n epsilon < 1 / 8
conclusion 1
1 ≤ (n : ℝ) * (rate n epsilon)^4
conclusion 2
1 ≤ (n : ℝ)^2 * epsilon * (rate n epsilon)^7
conclusion 3
1 ≤ (n : ℝ) * epsilon * (rate n epsilon)^2
Proof (Lean source)
-- @node: active_rate_constraints lemma active_rate_constraints (n : ℕ) (epsilon : ℝ) (hn : 2 ≤ n) (he : 0 < epsilon) (hr : rate n epsilon < 1 / 8) : 1 ≤ (n : ℝ) * (rate n epsilon)^4 ∧ 1 ≤ (n : ℝ)^2 * epsilon * (rate n epsilon)^7 ∧ 1 ≤ (n : ℝ) * epsilon * (rate n epsilon)^2 := by have hn0 : (0 : ℝ) < n := Nat.cast_pos.mpr (by omega) have hr0 := (rate_pos n epsilon (by omega)).le have hcap : rate n epsilon = max ((n : ℝ)^(-1/4 : ℝ)) (max (((n : ℝ)^2*epsilon)^(-1/7 : ℝ)) (((n : ℝ)*epsilon)^(-1/2 : ℝ))) := by unfold rate at hr ⊢ exact min_eq_right (by rcases min_lt_iff.mp hr with h | h <;> linarith) have ha : (n : ℝ)^(-1/4 : ℝ) ≤ rate n epsilon := by rw [hcap]; exact le_max_left _ _ have hb : ((n : ℝ)^2*epsilon)^(-1/7 : ℝ) ≤ rate n epsilon := by rw [hcap]; exact (le_max_left _ _).trans (le_max_right _ _) have hc : ((n : ℝ)*epsilon)^(-1/2 : ℝ) ≤ rate n epsilon := by rw [hcap]; exact (le_max_right _ _).trans (le_max_right _ _) exact ⟨reciprocal_root_constraint _ _ 4 hn0 (by norm_num) hr0 ha, reciprocal_root_constraint _ _ 7 (by positivity) (by norm_num) hr0 hb, reciprocal_root_constraint _ _ 2 (by positivity) (by norm_num) hr0 hc⟩
CausalSmith.Stat.PrivateCateRoughdesign.active_rate_constraints · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TuningEnvelope.lean:20
theorem tuned_info_lower

Dyadic rounding loses at most a factor of sixty-four in the occupancy scale. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
epsilon :
ℝ
hn :
2 ≤ n
he :
0 < epsilon ∧ epsilon ≤ 1
hr :
rate n epsilon < 1 / 8
min ((n : ℝ) * rate n epsilon) ((n : ℝ)^2 * (rate n epsilon)^6) / 64
≤ info n (tunedH n epsilon) (tunedK n epsilon)
Proof (Lean source)
-- @node: tuned_info_lower lemma tuned_info_lower (n : ℕ) (epsilon : ℝ) (hn : 2 ≤ n) (he : 0 < epsilon ∧ epsilon ≤ 1) (hr : rate n epsilon < 1 / 8) : min ((n : ℝ) * rate n epsilon) ((n : ℝ)^2 * (rate n epsilon)^6) / 64 ≤ info n (tunedH n epsilon) (tunedK n epsilon) := by have hp := public_tuning_parameters n epsilon hn he hr have hb := tunedH_bounds n epsilon (by omega) have hr0 := (rate_pos n epsilon (by omega)).le have hn0 : (0 : ℝ) ≤ n := Nat.cast_nonneg n have h6 := pow_le_pow_left₀ (by positivity : 0 ≤ rate n epsilon / 2) hb.2.1 6 have h1 : rate n epsilon / 64 ≤ tunedH n epsilon := by linarith have h6' : (rate n epsilon)^6 / 64 ≤ (tunedH n epsilon)^6 := by nlinarith [h6] have hi : info n (tunedH n epsilon) (tunedK n epsilon) = min ((n : ℝ) * tunedH n epsilon) ((n : ℝ)^2 * (tunedH n epsilon)^6) := by unfold info rw [hp.2.2.2.2, mul_min_of_nonneg] · congr 1 <;> ring · exact mul_nonneg hn0 hb.1.le rw [hi] apply le_min · calc _ ≤ ((n : ℝ) * rate n epsilon) / 64 := div_le_div_of_nonneg_right (min_le_left _ _) (by norm_num) _ ≤ _ := by nlinarith [mul_le_mul_of_nonneg_left h1 hn0] · calc _ ≤ ((n : ℝ)^2 * (rate n epsilon)^6) / 64 := div_le_div_of_nonneg_right (min_le_right _ _) (by norm_num) _ ≤ _ := by nlinarith [mul_le_mul_of_nonneg_left h6' (sq_nonneg (n : ℝ))]
theorem tuned_scaled_info_lower

The three candidate rate constraints imply the two scaled information lower bounds used by the public variance envelope. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
epsilon :
ℝ
hn :
2 ≤ n
he :
0 < epsilon ∧ epsilon ≤ 1
hr :
rate n epsilon < 1 / 8
conclusion 1
1 / 64 ≤ (rate n epsilon)^2 * info n (tunedH n epsilon) (tunedK n epsilon)
conclusion 2
1 / 64 ≤ rate n epsilon * epsilon * info n (tunedH n epsilon) (tunedK n epsilon)
Proof (Lean source)
-- @node: tuned_scaled_info_lower lemma tuned_scaled_info_lower (n : ℕ) (epsilon : ℝ) (hn : 2 ≤ n) (he : 0 < epsilon ∧ epsilon ≤ 1) (hr : rate n epsilon < 1 / 8) : 1 / 64 ≤ (rate n epsilon)^2 * info n (tunedH n epsilon) (tunedK n epsilon) ∧ 1 / 64 ≤ rate n epsilon * epsilon * info n (tunedH n epsilon) (tunedK n epsilon) := by have hc := active_rate_constraints n epsilon hn he.1 hr have hi := tuned_info_lower n epsilon hn he hr have hr0 := (rate_pos n epsilon (by omega)).le have hn0 : (0 : ℝ) ≤ n := Nat.cast_nonneg n have h3 : 1 ≤ (n : ℝ) * (rate n epsilon)^3 := by have hpow : (rate n epsilon)^4 ≤ (rate n epsilon)^3 := by have := mul_le_mul_of_nonneg_left (show rate n epsilon ≤ 1 by linarith) (pow_nonneg hr0 3) nlinarith exact hc.1.trans (mul_le_mul_of_nonneg_left hpow hn0) have h8 : 1 ≤ (n : ℝ)^2 * (rate n epsilon)^8 := by nlinarith [sq_nonneg ((n : ℝ) * (rate n epsilon)^4 - 1)] constructor · have hm : 1 ≤ (rate n epsilon)^2 * min ((n : ℝ) * rate n epsilon) ((n : ℝ)^2 * (rate n epsilon)^6) := by rw [mul_min_of_nonneg _ _ (sq_nonneg _)] apply le_min <;> nlinarith nlinarith [mul_le_mul_of_nonneg_left hi (sq_nonneg (rate n epsilon))] · have hm : 1 ≤ (rate n epsilon) * epsilon * min ((n : ℝ) * rate n epsilon) ((n : ℝ)^2 * (rate n epsilon)^6) := by rw [mul_min_of_nonneg _ _ (mul_nonneg hr0 he.1.le)] apply le_min <;> nlinarith [hc.2.1, hc.2.2] nlinarith [mul_le_mul_of_nonneg_left hi (mul_nonneg hr0 he.1.le)]
CausalSmith.Stat.PrivateCateRoughdesign.tuned_scaled_info_lower · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TuningEnvelope.lean:75
theorem tuned_inverse_info_upper

The scaled information bounds control the inverse occupancy and inverse privacy scales. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
epsilon :
ℝ
hn :
2 ≤ n
he :
0 < epsilon ∧ epsilon ≤ 1
hr :
rate n epsilon < 1 / 8
conclusion 1
(info n (tunedH n epsilon) (tunedK n epsilon))⁻¹ ≤ 64 * (rate n epsilon)^2
conclusion 2
(epsilon * info n (tunedH n epsilon) (tunedK n epsilon))^(-2 : ℤ)
≤ 4096 * (rate n epsilon)^2
Proof (Lean source)
-- @node: tuned_inverse_info_upper lemma tuned_inverse_info_upper (n : ℕ) (epsilon : ℝ) (hn : 2 ≤ n) (he : 0 < epsilon ∧ epsilon ≤ 1) (hr : rate n epsilon < 1 / 8) : (info n (tunedH n epsilon) (tunedK n epsilon))⁻¹ ≤ 64 * (rate n epsilon)^2 ∧ (epsilon * info n (tunedH n epsilon) (tunedK n epsilon))^(-2 : ℤ) ≤ 4096 * (rate n epsilon)^2 := by have hp := public_tuning_parameters n epsilon hn he hr have hn0 : (0 : ℝ) < n := Nat.cast_pos.mpr (by omega) have hh0 := hp.1 have ha : 0 < info n (tunedH n epsilon) (tunedK n epsilon) := by unfold info rw [hp.2.2.2.2] positivity have hs := tuned_scaled_info_lower n epsilon hn he hr have hi : (info n (tunedH n epsilon) (tunedK n epsilon))⁻¹ ≤ 64 * (rate n epsilon)^2 := by rw [inv_eq_one_div] apply (div_le_iff₀ ha).mpr nlinarith [hs.1] have hea : 0 < epsilon * info n (tunedH n epsilon) (tunedK n epsilon) := mul_pos he.1 ha have hie : (epsilon * info n (tunedH n epsilon) (tunedK n epsilon))⁻¹ ≤ 64 * rate n epsilon := by rw [inv_eq_one_div] apply (div_le_iff₀ hea).mpr nlinarith [hs.2] refine ⟨hi, ?_⟩ have hsq := pow_le_pow_left₀ (inv_nonneg.mpr hea.le) hie 2 simpa only [zpow_neg, zpow_ofNat, inv_pow, mul_pow, show (64 : ℝ)^2 = 4096 by norm_num] using hsq
CausalSmith.Stat.PrivateCateRoughdesign.tuned_inverse_info_upper · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TuningEnvelope.lean:105
theorem tuned_cell_roughness

At the tuned cell width, the roughness term equals the squared macro radius. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
epsilon :
ℝ
hn :
2 ≤ n
he :
0 < epsilon ∧ epsilon ≤ 1
hr :
rate n epsilon < 1 / 8
(cellWidth (tunedH n epsilon) (tunedK n epsilon))^(2/5 : ℝ) = (tunedH n epsilon)^2
Proof (Lean source)
-- @node: tuned_cell_roughness lemma tuned_cell_roughness (n : ℕ) (epsilon : ℝ) (hn : 2 ≤ n) (he : 0 < epsilon ∧ epsilon ≤ 1) (hr : rate n epsilon < 1 / 8) : (cellWidth (tunedH n epsilon) (tunedK n epsilon))^(2/5 : ℝ) = (tunedH n epsilon)^2 := by have hp := public_tuning_parameters n epsilon hn he hr rw [hp.2.2.2.2, ← Real.rpow_natCast, ← Real.rpow_mul hp.1.le] norm_num
CausalSmith.Stat.PrivateCateRoughdesign.tuned_cell_roughness · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/TuningEnvelope.lean:137
theorem tuned_Vbound_le

The public tuning puts the entire second-moment envelope below the roadmap's squared-rate constant, independently of the law or the statistical second-moment proof. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
epsilon :
ℝ
hn :
2 ≤ n
he :
0 < epsilon ∧ epsilon ≤ 1
hr :
rate n epsilon < 1 / 8
Vbound n epsilon (tunedH n epsilon) (tunedK n epsilon) ≤ 2^33 * (rate n epsilon)^2
Proof (Lean source)
-- @node: tuned_Vbound_le lemma tuned_Vbound_le (n : ℕ) (epsilon : ℝ) (hn : 2 ≤ n) (he : 0 < epsilon ∧ epsilon ≤ 1) (hr : rate n epsilon < 1 / 8) : Vbound n epsilon (tunedH n epsilon) (tunedK n epsilon) ≤ 2^33 * (rate n epsilon)^2 := by have hi := tuned_inverse_info_upper n epsilon hn he hr have hb := tunedH_bounds n epsilon (by omega) have hsq := pow_le_pow_left₀ hb.1.le hb.2.2 2 unfold Vbound rw [tuned_cell_roughness n epsilon hn he hr] nlinarith [hi.1, hi.2, sq_nonneg (rate n epsilon)]
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.Helpers.UpperGuarantees 35 declarations Uniform private scalar-risk, coverage and length guarantees for the total single-release construction and its public tuning, over the full unknown measurable-density model.

Uniform private scalar-risk, coverage and length guarantees for the total single-release construction and its public tuning, over the full unknown measurable-density model.

theorem privateRatioRelease_markov

The positive public budget normalizes the everywhere-defined noisy pair release. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
epsilon h :
ℝ
he :
0 < epsilon
Proof (Lean source)
-- @node: privateRatioRelease_markov lemma privateRatioRelease_markov (n k : ℕ) (epsilon h : ℝ) (he : 0 < epsilon) : IsMarkovKernel (privateRatioRelease n epsilon h k) := by constructor intro D exact laplaceMechPi_isProbabilityMeasure (12 / epsilon) (by positivity) (pairQuery n h k) D
CausalSmith.Stat.PrivateCateRoughdesign.privateRatioRelease_markov · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/UpperGuarantees.lean:11
theorem privateRatioRelease_private

The all-count sensitivity bound gives pure privacy for the single joint release. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
epsilon h :
ℝ
he :
0 < epsilon
hh :
0 < h
hk :
0 < k
PrivateKernel n epsilon (privateRatioRelease n epsilon h k)
Proof (Lean source)
-- @node: privateRatioRelease_private lemma privateRatioRelease_private (n k : ℕ) (epsilon h : ℝ) (he : 0 < epsilon) (hh : 0 < h) (hk : 0 < k) : PrivateKernel n epsilon (privateRatioRelease n epsilon h k) := by refine ⟨privateRatioRelease_markov n k epsilon h he, ?_⟩ apply laplaceMechPi_pure_dp (fun D D' => dHam n D D' = 1) (pairQuery n h k) (by norm_num) he intro D D' hadj simpa [pairQuery, Fin.sum_univ_two] using statistic_hamming_sensitivity n k h hh hk D D' hadj
CausalSmith.Stat.PrivateCateRoughdesign.privateRatioRelease_private · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/UpperGuarantees.lean:20
theorem privateKernel_mapOfMeasurable

Measurable postprocessing preserves normalization and replacement privacy for any output carrier. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
epsilon :
ℝ
M :
hM :
PrivateKernel n epsilon M
f :
B → C
hf :
PrivateKernel n epsilon (M.mapOfMeasurable f hf)
Proof (Lean source)
-- @node: privateKernel_mapOfMeasurable lemma privateKernel_mapOfMeasurable {n : ℕ} {epsilon : ℝ} {B C : Type*} [MeasurableSpace B] [MeasurableSpace C] (M : Kernel (Dataset n) B) (hM : PrivateKernel n epsilon M) (f : B → C) (hf : Measurable f) : PrivateKernel n epsilon (M.mapOfMeasurable f hf) := by let := hM.markov refine ⟨?_, ?_⟩ · rw [Kernel.mapOfMeasurable_eq_map] exact Kernel.IsMarkovKernel.map M hf · intro D D' hadj E hE change ((M D).map f E).toReal ≤ exp epsilon * ((M D').map f E).toReal rw [Measure.map_apply hf hE, Measure.map_apply hf hE] exact hM.pure_privacy D D' hadj (f ⁻¹' E) (hE.preimage hf)
CausalSmith.Stat.PrivateCateRoughdesign.privateKernel_mapOfMeasurable · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/UpperGuarantees.lean:32
theorem Thk_private

The clipped, floored ratio inherits pure privacy on all datasets. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
epsilon h :
ℝ
he :
0 < epsilon
hh :
0 < h
hk :
0 < k
PrivateKernel n epsilon (Thk n epsilon h k)
Proof (Lean source)
-- @node: Thk_private lemma Thk_private (n k : ℕ) (epsilon h : ℝ) (he : 0 < epsilon) (hh : 0 < h) (hk : 0 < k) : PrivateKernel n epsilon (Thk n epsilon h k) := by exact privateKernel_mapOfMeasurable _ (privateRatioRelease_private n k epsilon h he hh hk) _ (measurable_ratioMap n h k)
theorem Ihk_private

The conservative interval inherits pure privacy from the same joint release. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
epsilon h :
ℝ
he :
0 < epsilon
hh :
0 < h
hk :
0 < k
PrivateKernel n epsilon (Ihk n epsilon h k)
Proof (Lean source)
-- @node: Ihk_private lemma Ihk_private (n k : ℕ) (epsilon h : ℝ) (he : 0 < epsilon) (hh : 0 < h) (hk : 0 < k) : PrivateKernel n epsilon (Ihk n epsilon h k) := by exact privateKernel_mapOfMeasurable _ (privateRatioRelease_private n k epsilon h he hh hk) _ (measurable_intervalMap n epsilon h k)
theorem privateKernel_const

A data-independent probability release is private at every nonnegative budget. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
B :
epsilon :
ℝ
he :
0 ≤ epsilon
PrivateKernel n epsilon (Kernel.const (Dataset n) mu)
Proof (Lean source)
-- @node: privateKernel_const lemma privateKernel_const {n : ℕ} {B : Type*} [MeasurableSpace B] (epsilon : ℝ) (he : 0 ≤ epsilon) (mu : Measure B) [IsProbabilityMeasure mu] : PrivateKernel n epsilon (Kernel.const (Dataset n) mu) := by refine ⟨inferInstance, ?_⟩ intro D D' hadj E hE change mu.real E ≤ exp epsilon * mu.real E exact le_mul_of_one_le_left (measureReal_nonneg) (Real.one_le_exp_iff.mpr he)
theorem publicTunedRelease_private

Public tuning preserves privacy, including its data-independent fallback. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
epsilon :
ℝ
hn :
2 ≤ n
he :
0 < epsilon ∧ epsilon ≤ 1
PrivateKernel n epsilon (publicTunedRelease n epsilon)
Proof (Lean source)
-- @node: publicTunedRelease_private lemma publicTunedRelease_private (n : ℕ) (epsilon : ℝ) (hn : 2 ≤ n) (he : 0 < epsilon ∧ epsilon ≤ 1) : PrivateKernel n epsilon (publicTunedRelease n epsilon) := by classical unfold publicTunedRelease split_ifs with hr · exact privateKernel_const epsilon he.1.le _ · have hp := public_tuning_parameters n epsilon hn he (lt_of_not_ge hr) exact Thk_private n _ epsilon _ he.1 hp.1 (by omega)
CausalSmith.Stat.PrivateCateRoughdesign.publicTunedRelease_private · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/UpperGuarantees.lean:76
theorem publicTunedInterval_private

The tuned interval remains private in both public branches. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
epsilon :
ℝ
hn :
2 ≤ n
he :
0 < epsilon ∧ epsilon ≤ 1
PrivateKernel n epsilon (publicTunedInterval n epsilon)
Proof (Lean source)
-- @node: publicTunedInterval_private lemma publicTunedInterval_private (n : ℕ) (epsilon : ℝ) (hn : 2 ≤ n) (he : 0 < epsilon ∧ epsilon ≤ 1) : PrivateKernel n epsilon (publicTunedInterval n epsilon) := by classical unfold publicTunedInterval split_ifs with hr · exact privateKernel_const epsilon he.1.le _ · have hp := public_tuning_parameters n epsilon hn he (lt_of_not_ge hr) exact Ihk_private n _ epsilon _ he.1 hp.1 (by omega)
CausalSmith.Stat.PrivateCateRoughdesign.publicTunedInterval_private · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/UpperGuarantees.lean:88

Finite closed endpoint codes denote the usual real closed interval. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
l u :
ℝ
Proof (Lean source)
-- @node: closedInterval_toSet lemma closedInterval_toSet (l u : ℝ) : (closedInterval l u).toSet = Icc l u := by ext x simp [closedInterval, IntervalCode.toSet]
CausalSmith.Stat.PrivateCateRoughdesign.closedInterval_toSet · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/UpperGuarantees.lean:100

The length of a finite closed interval is its nonnegative endpoint difference. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
l u :
ℝ
(closedInterval l u).leb = ofReal (u - l)
Proof (Lean source)
-- @node: closedInterval_leb lemma closedInterval_leb (l u : ℝ) : (closedInterval l u).leb = ofReal (u - l) := by rw [IntervalCode.leb, closedInterval_toSet, Real.volume_Icc]

The ratio center always belongs to the target range, even on arbitrary datasets. The displayed conclusion follows.

Formal statement
n k :
ℕ
h :
ℝ
v :
Fin 2 → ℝ
ratioMap n h k v ∈ Icc (-1 : ℝ) 1
Proof (Lean source)
-- @node: ratioMap_mem_Icc lemma ratioMap_mem_Icc (n k : ℕ) (h : ℝ) (v : Fin 2 → ℝ) : ratioMap n h k v ∈ Icc (-1 : ℝ) 1 := by unfold ratioMap clip exact ⟨le_max_left _ _, max_le (by norm_num) (min_le_left _ _)⟩
theorem truncated_interval_endpoints Lemma truncated_interval_endpoints in the paper ↗

A nonnegative radius around a center in the target range has ordered truncated endpoints. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
z r :
ℝ
hz :
z ∈ Icc (-1 : ℝ) 1
hr :
0 ≤ r
conclusion 1
max (-1) (z - r) ≤ z
conclusion 2
z ≤ min 1 (z + r)
Proof (Lean source)
-- @node: truncated_interval_endpoints lemma truncated_interval_endpoints (z r : ℝ) (hz : z ∈ Icc (-1 : ℝ) 1) (hr : 0 ≤ r) : max (-1) (z - r) ≤ z ∧ z ≤ min 1 (z + r) := by constructor · exact max_le hz.1 (by linarith) · exact le_min hz.2 (by linarith)
CausalSmith.Stat.PrivateCateRoughdesign.truncated_interval_endpoints · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/UpperGuarantees.lean:120
theorem ratioMap_mem_intervalMap Lemma ratioMap_mem_intervalMap in the paper ↗

The released conservative interval is nonempty and contains its clipped center. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
epsilon h :
ℝ
v :
Fin 2 → ℝ
ratioMap n h k v ∈ (intervalMap n epsilon h k v).toSet
Proof (Lean source)
-- @node: ratioMap_mem_intervalMap lemma ratioMap_mem_intervalMap (n k : ℕ) (epsilon h : ℝ) (v : Fin 2 → ℝ) : ratioMap n h k v ∈ (intervalMap n epsilon h k v).toSet := by rw [intervalMap, closedInterval_toSet] exact truncated_interval_endpoints _ _ (ratioMap_mem_Icc n k h v) (Real.sqrt_nonneg _)
CausalSmith.Stat.PrivateCateRoughdesign.ratioMap_mem_intervalMap · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/UpperGuarantees.lean:128
theorem intervalMap_leb_le

Truncation bounds each interval by the target diameter and twice its public radius. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
epsilon h :
ℝ
v :
Fin 2 → ℝ
(intervalMap n epsilon h k v).leb
≤ ofReal (min 2 (2 * sqrt (10 * Vbound n epsilon h k)))
Proof (Lean source)
-- @node: intervalMap_leb_le lemma intervalMap_leb_le (n k : ℕ) (epsilon h : ℝ) (v : Fin 2 → ℝ) : (intervalMap n epsilon h k v).leb ≤ ofReal (min 2 (2 * sqrt (10 * Vbound n epsilon h k))) := by rw [intervalMap, closedInterval_leb] apply ENNReal.ofReal_le_ofReal apply le_min · have hl := le_max_left (-1 : ℝ) (ratioMap n h k v - sqrt (10 * Vbound n epsilon h k)) have hu := min_le_left (1 : ℝ) (ratioMap n h k v + sqrt (10 * Vbound n epsilon h k)) linarith · have hl := le_max_right (-1 : ℝ) (ratioMap n h k v - sqrt (10 * Vbound n epsilon h k)) have hu := min_le_right (1 : ℝ) (ratioMap n h k v + sqrt (10 * Vbound n epsilon h k)) linarith
theorem Ihk_expectedLength_le

Integrating the deterministic interval-length bound gives the finite-sample guarantee. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
epsilon h :
ℝ
he :
0 < epsilon
P :
expectedLength n (Ihk n epsilon h k) P
≤ ofReal (min 2 (2 * sqrt (10 * Vbound n epsilon h k)))
Proof (Lean source)
-- @node: Ihk_expectedLength_le lemma Ihk_expectedLength_le (n k : ℕ) (epsilon h : ℝ) (he : 0 < epsilon) (P : CausalLaw) : expectedLength n (Ihk n epsilon h k) P ≤ ofReal (min 2 (2 * sqrt (10 * Vbound n epsilon h k))) := by letI : IsProbabilityMeasure (Pobs P) := by unfold Pobs exact Measure.isProbabilityMeasure_map measurable_observe.aemeasurable letI : IsProbabilityMeasure (dataLaw n P) := by unfold dataLaw infer_instance letI := privateRatioRelease_markov n k epsilon h he unfold expectedLength Ihk rw [Kernel.mapOfMeasurable_eq_map, ← Measure.map_comp _ _ (measurable_intervalMap n epsilon h k)] exact (lintegral_map_le _ _).trans (lintegral_le_const (Filter.Eventually.of_forall (intervalMap_leb_le n k epsilon h)))
CausalSmith.Stat.PrivateCateRoughdesign.Ihk_expectedLength_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/UpperGuarantees.lean:155

Projection to the target range cannot increase distance to a target in that range. the asserted conclusion follows. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
z t :
ℝ
ht :
t ∈ Icc (-1 : ℝ) 1
|clip (-1) 1 z - t| ≤ |z - t|
Proof (Lean source)
-- @node: clip_abs_sub_le lemma clip_abs_sub_le (z t : ℝ) (ht : t ∈ Icc (-1 : ℝ) 1) : |clip (-1) 1 z - t| ≤ |z - t| := by unfold clip apply abs_le.mpr constructor · have hz := neg_abs_le (z - t) have hl : t - |z - t| ≤ min 1 z := le_min (by linarith [abs_nonneg (z-t), ht.1, ht.2]) (by linarith) have hm := hl.trans (le_max_right (-1 : ℝ) (min 1 z)) linarith · have hz := le_abs_self (z - t) have hu : max (-1) (min 1 z) ≤ t + |z - t| := max_le (by linarith [abs_nonneg (z-t), ht.1, ht.2]) ((min_le_right 1 z).trans (by linarith)) linarith
theorem floor_denominator_abs_sub_le Lemma floor_denominator_abs_sub_le in the paper ↗

The denominator floor fixes the population denominator and contracts its perturbation. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
d y D :
ℝ
hD :
d ≤ D
|max d y - D| ≤ |y - D|
Proof (Lean source)
-- @node: floor_denominator_abs_sub_le lemma floor_denominator_abs_sub_le (d y D : ℝ) (hD : d ≤ D) : |max d y - D| ≤ |y - D| := by have h := abs_max_sub_max_le_abs y D d simpa only [max_comm y d, max_eq_left hD] using h
CausalSmith.Stat.PrivateCateRoughdesign.floor_denominator_abs_sub_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/UpperGuarantees.lean:192
theorem floored_ratio_perturbation Lemma floored_ratio_perturbation in the paper ↗

The raw floored ratio is controlled by the two coordinate perturbations over the floor. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
d x y N D :
ℝ
hd :
0 < d
hD :
d ≤ D
hN :
|N / D| ≤ 1
|x / max d y - N / D| ≤ (|x - N| + |y - D|) / d
Proof (Lean source)
-- @node: floored_ratio_perturbation lemma floored_ratio_perturbation (d x y N D : ℝ) (hd : 0 < d) (hD : d ≤ D) (hN : |N / D| ≤ 1) : |x / max d y - N / D| ≤ (|x - N| + |y - D|) / d := by have hDp : 0 < D := hd.trans_le hD have hBp : 0 < max d y := hd.trans_le (le_max_left _ _) have hfloor := floor_denominator_abs_sub_le d y D hD have hid : x / max d y - N / D = ((x - N) + (N / D) * (D - max d y)) / max d y := by field_simp <;> ring calc |x / max d y - N / D| = |(x - N) + (N / D) * (D - max d y)| / max d y := by rw [hid, abs_div, abs_of_pos hBp] _ ≤ (|x - N| + |y - D|) / max d y := by apply div_le_div_of_nonneg_right _ hBp.le calc |(x - N) + (N / D) * (D - max d y)| ≤ |x - N| + |N / D| * |D - max d y| := by simpa only [abs_mul] using abs_add_le (x-N) ((N/D)*(D-max d y)) _ ≤ |x - N| + |D - max d y| := by exact add_le_add_right (by simpa using mul_le_mul_of_nonneg_right hN (abs_nonneg (D - max d y))) _ _ ≤ |x - N| + |y - D| := by rw [abs_sub_comm D] exact add_le_add_right hfloor _ _ ≤ (|x - N| + |y - D|) / d := div_le_div_of_nonneg_left (by positivity) hd (le_max_left _ _)
CausalSmith.Stat.PrivateCateRoughdesign.floored_ratio_perturbation · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/UpperGuarantees.lean:199

Bias plus the two released coordinate perturbations controls the clipped estimator error. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
n k :
ℕ
h N D t b :
ℝ
v :
Fin 2 → ℝ
hd :
0 < d0 n h k
hD :
d0 n h k ≤ D
hN :
|N / D| ≤ 1
ht :
t ∈ Icc (-1 : ℝ) 1
hb :
|N / D - t| ≤ b
|ratioMap n h k v - t| ≤ b + (|v 0 - N| + |v 1 - D|) / d0 n h k
Proof (Lean source)
-- @node: ratioMap_error_le lemma ratioMap_error_le (n k : ℕ) (h N D t b : ℝ) (v : Fin 2 → ℝ) (hd : 0 < d0 n h k) (hD : d0 n h k ≤ D) (hN : |N / D| ≤ 1) (ht : t ∈ Icc (-1 : ℝ) 1) (hb : |N / D - t| ≤ b) : |ratioMap n h k v - t| ≤ b + (|v 0 - N| + |v 1 - D|) / d0 n h k := by calc |ratioMap n h k v - t| ≤ |v 0 / max (d0 n h k) (v 1) - t| := clip_abs_sub_le _ _ ht _ ≤ |v 0 / max (d0 n h k) (v 1) - N / D| + |N / D - t| := abs_sub_le _ _ _ _ ≤ (|v 0 - N| + |v 1 - D|) / d0 n h k + b := add_le_add (floored_ratio_perturbation _ _ _ _ _ hd hD hN) hb _ = b + (|v 0 - N| + |v 1 - D|) / d0 n h k := add_comm _ _
theorem population_numerator_abs_le_denominator

Nonnegative occupancy weights preserve the binary pair numerator domination. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
hn :
2 ≤ n
hk :
2 ≤ k
hh :
0 < h ∧ h ≤ 1 / 4
P :
hP :
|Nbar n h k (dataLaw n P)| ≤ Dbar n h k (dataLaw n P)
Proof (Lean source)
-- @node: population_numerator_abs_le_denominator lemma population_numerator_abs_le_denominator (n k : ℕ) (h : ℝ) (hn : 2 ≤ n) (hk : 2 ≤ k) (hh : 0 < h ∧ h ≤ 1 / 4) (P : CausalLaw) (hP : CompleteModel P) : |Nbar n h k (dataLaw n P)| ≤ Dbar n h k (dataLaw n P) := by have hc := occupancy_cancellation n k h hn hk hh P (dataLaw n P) rfl hP rw [hc.1, hc.2.1] calc |∑ j : Fin k, occupancyWeight n h k P j * nu h k P j| ≤ ∑ j : Fin k, |occupancyWeight n h k P j * nu h k P j| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ j : Fin k, occupancyWeight n h k P j * dj h k P j := by apply Finset.sum_le_sum intro j hj rw [abs_mul, abs_of_nonneg (occupancyWeight_nonneg n k h P j)] exact mul_le_mul_of_nonneg_left (conditional_cell_numerator_abs_le_denominator k h (by omega) hh P hP j) (occupancyWeight_nonneg n k h P j)
CausalSmith.Stat.PrivateCateRoughdesign.population_numerator_abs_le_denominator · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/UpperGuarantees.lean:245
theorem population_ratio_abs_le_one

The population comparison ratio belongs to the target range. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
hn :
2 ≤ n
hk :
2 ≤ k
hh :
0 < h ∧ h ≤ 1 / 4
P :
hP :
|Nbar n h k (dataLaw n P) / Dbar n h k (dataLaw n P)| ≤ 1
Proof (Lean source)
-- @node: population_ratio_abs_le_one lemma population_ratio_abs_le_one (n k : ℕ) (h : ℝ) (hn : 2 ≤ n) (hk : 2 ≤ k) (hh : 0 < h ∧ h ≤ 1 / 4) (P : CausalLaw) (hP : CompleteModel P) : |Nbar n h k (dataLaw n P) / Dbar n h k (dataLaw n P)| ≤ 1 := by have hc := occupancy_cancellation n k h hn hk hh P (dataLaw n P) rfl hP have hpos : 0 < Dbar n h k (dataLaw n P) := (info_d0_pos n k h (by omega) (by omega) hh.1).2.trans_le hc.2.2.2.2.2.1 rw [abs_div, abs_of_pos hpos, div_le_one hpos] exact population_numerator_abs_le_denominator n k h hn hk hh P hP
CausalSmith.Stat.PrivateCateRoughdesign.population_ratio_abs_le_one · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/UpperGuarantees.lean:265
theorem ratioMap_squared_error_le Lemma ratioMap_squared_error_le in the paper ↗

Two applications of the quadratic sum bound give the roadmap's pointwise squared error. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
n k :
ℕ
h N D t b :
ℝ
v :
Fin 2 → ℝ
hd :
0 < d0 n h k
hD :
d0 n h k ≤ D
hN :
|N / D| ≤ 1
ht :
t ∈ Icc (-1 : ℝ) 1
hb :
|N / D - t| ≤ b
(ratioMap n h k v - t)^2 ≤ 2*b^2 + 4/(d0 n h k)^2 * ((v 0-N)^2 + (v 1-D)^2)
Proof (Lean source)
-- @node: ratioMap_squared_error_le lemma ratioMap_squared_error_le (n k : ℕ) (h N D t b : ℝ) (v : Fin 2 → ℝ) (hd : 0 < d0 n h k) (hD : d0 n h k ≤ D) (hN : |N / D| ≤ 1) (ht : t ∈ Icc (-1 : ℝ) 1) (hb : |N / D - t| ≤ b) : (ratioMap n h k v - t)^2 ≤ 2*b^2 + 4/(d0 n h k)^2 * ((v 0-N)^2 + (v 1-D)^2) := by have hbpos : 0 ≤ b := (abs_nonneg _).trans hb have herr := ratioMap_error_le n k h N D t b v hd hD hN ht hb have hsquare : (ratioMap n h k v - t)^2 ≤ (b + (|v 0-N| + |v 1-D|) / d0 n h k)^2 := by simpa only [sq_abs] using pow_le_pow_left₀ (abs_nonneg _) herr 2 have hsum : (|v 0-N| + |v 1-D|)^2 ≤ 2*((v 0-N)^2 + (v 1-D)^2) := by simpa only [sq_abs] using (add_sq_le (a := |v 0-N|) (b := |v 1-D|)) have hdiv : ((|v 0-N| + |v 1-D|) / d0 n h k)^2 ≤ 2/(d0 n h k)^2 * ((v 0-N)^2 + (v 1-D)^2) := by rw [div_pow] calc (|v 0-N| + |v 1-D|)^2 / (d0 n h k)^2 ≤ (2*((v 0-N)^2 + (v 1-D)^2)) / (d0 n h k)^2 := div_le_div_of_nonneg_right hsum (sq_nonneg _) _ = _ := by ring have hquad := add_sq_le (a := b) (b := (|v 0-N| + |v 1-D|) / d0 n h k) calc (ratioMap n h k v - t)^2 ≤ 2 * (b^2 + ((|v 0-N| + |v 1-D|) / d0 n h k)^2) := hsquare.trans hquad _ ≤ 2 * (b^2 + 2/(d0 n h k)^2 * ((v 0-N)^2 + (v 1-D)^2)) := by gcongr _ = _ := by ring
CausalSmith.Stat.PrivateCateRoughdesign.ratioMap_squared_error_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/UpperGuarantees.lean:277
theorem ratioMap_model_squared_error_le

For each model law, only the public bias and released centered coordinate squares are needed. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
h :
ℝ
hn :
2 ≤ n
hk :
2 ≤ k
hh :
0 < h ∧ h ≤ 1 / 4
P :
hP :
v :
Fin 2 → ℝ
(ratioMap n h k v - theta P)^2
≤ 2*(bias h k)^2
+ 4/(d0 n h k)^2 * ((v 0-Nbar n h k (dataLaw n P))^2 + (v 1-Dbar n h k (dataLaw n P))^2)
Proof (Lean source)
-- @node: ratioMap_model_squared_error_le lemma ratioMap_model_squared_error_le (n k : ℕ) (h : ℝ) (hn : 2 ≤ n) (hk : 2 ≤ k) (hh : 0 < h ∧ h ≤ 1 / 4) (P : CausalLaw) (hP : CompleteModel P) (v : Fin 2 → ℝ) : (ratioMap n h k v - theta P)^2 ≤ 2*(bias h k)^2 + 4/(d0 n h k)^2 * ((v 0-Nbar n h k (dataLaw n P))^2 + (v 1-Dbar n h k (dataLaw n P))^2) := by have hc := occupancy_cancellation n k h hn hk hh P (dataLaw n P) rfl hP exact ratioMap_squared_error_le n k h _ _ _ _ v (info_d0_pos n k h (by omega) (by omega) hh.1).2 hc.2.2.2.2.2.1 (population_ratio_abs_le_one n k h hn hk hh P hP) (theta_mem_Icc P hP) hc.2.2.2.2.2.2
CausalSmith.Stat.PrivateCateRoughdesign.ratioMap_model_squared_error_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/UpperGuarantees.lean:307
theorem cellWidth_fifth_power_sq Lemma cellWidth_fifth_power_sq in the paper ↗

Squaring the roughness term converts its fifth-root power to the two-fifths power. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
k :
ℕ
h :
ℝ
hh :
0 ≤ h
((cellWidth h k)^(1/5 : ℝ))^2 = (cellWidth h k)^(2/5 : ℝ)
Proof (Lean source)
-- @node: cellWidth_fifth_power_sq lemma cellWidth_fifth_power_sq (k : ℕ) (h : ℝ) (hh : 0 ≤ h) : ((cellWidth h k)^(1/5 : ℝ))^2 = (cellWidth h k)^(2/5 : ℝ) := by have hw : 0 ≤ cellWidth h k := by unfold cellWidth; positivity have hp := Real.rpow_mul_natCast hw (1/5 : ℝ) 2 norm_num at hp exact hp.symm
CausalSmith.Stat.PrivateCateRoughdesign.cellWidth_fifth_power_sq · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/UpperGuarantees.lean:321

The quadratic sum inequality bounds the two contributions to the public bias. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
k :
ℕ
h :
ℝ
hh :
0 ≤ h
2*(bias h k)^2 ≤ 36*h^2 + 2304*(cellWidth h k)^(2/5 : ℝ)
Proof (Lean source)
-- @node: bias_squared_le lemma bias_squared_le (k : ℕ) (h : ℝ) (hh : 0 ≤ h) : 2*(bias h k)^2 ≤ 36*h^2 + 2304*(cellWidth h k)^(2/5 : ℝ) := by have hquad := add_sq_le (a := 3*h) (b := 24*(cellWidth h k)^(1/5 : ℝ)) have hp := cellWidth_fifth_power_sq k h hh unfold bias nlinarith [hp]
theorem variance_floor_envelope_le Lemma variance_floor_envelope_le in the paper ↗

Substitution of the public floor converts the occupancy and noise terms to inverse scales. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
epsilon h W :
ℝ
ha :
0 < info n h k
he :
0 < epsilon
hW :
W ≤ 9 / 2 * info n h k
144*W/(d0 n h k)^2 + 2304/(epsilon^2*(d0 n h k)^2)
≤ 294912*(info n h k)⁻¹ + 1048576*(epsilon*info n h k)^(-2 : ℤ)
Proof (Lean source)
-- @node: variance_floor_envelope_le lemma variance_floor_envelope_le (n k : ℕ) (epsilon h W : ℝ) (ha : 0 < info n h k) (he : 0 < epsilon) (hW : W ≤ 9 / 2 * info n h k) : 144*W/(d0 n h k)^2 + 2304/(epsilon^2*(d0 n h k)^2) ≤ 294912*(info n h k)⁻¹ + 1048576*(epsilon*info n h k)^(-2 : ℤ) := by have hocc : 144*W/(d0 n h k)^2 ≤ 294912*(info n h k)⁻¹ := by calc 144*W/(d0 n h k)^2 ≤ 144*(9/2*info n h k)/(d0 n h k)^2 := div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left hW (by norm_num)) (sq_nonneg _) _ = _ := by unfold d0 field_simp [ha.ne'] ring have hnoise : 2304/(epsilon^2*(d0 n h k)^2) = 1048576*(epsilon*info n h k)^(-2 : ℤ) := by unfold d0 simp only [zpow_neg, zpow_ofNat] field_simp [ha.ne', he.ne'] ring rw [hnoise] exact add_le_add hocc le_rfl
CausalSmith.Stat.PrivateCateRoughdesign.variance_floor_envelope_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/UpperGuarantees.lean:339
theorem model_variance_envelope_le

The roadmap's bias, occupancy variance and independent Laplace variance fit the public envelope. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
epsilon h :
ℝ
hn :
2 ≤ n
hk :
2 ≤ k
he :
0 < epsilon
hh :
0 < h ∧ h ≤ 1 / 4
P :
hP :
2*(bias h k)^2 + 144*Wocc n h k P/(d0 n h k)^2 + 2304/(epsilon^2*(d0 n h k)^2)
≤ Vbound n epsilon h k
Proof (Lean source)
-- @node: model_variance_envelope_le lemma model_variance_envelope_le (n k : ℕ) (epsilon h : ℝ) (hn : 2 ≤ n) (hk : 2 ≤ k) (he : 0 < epsilon) (hh : 0 < h ∧ h ≤ 1 / 4) (P : CausalLaw) (hP : CompleteModel P) : 2*(bias h k)^2 + 144*Wocc n h k P/(d0 n h k)^2 + 2304/(epsilon^2*(d0 n h k)^2) ≤ Vbound n epsilon h k := by have ha := (info_d0_pos n k h (by omega) (by omega) hh.1).1 have hc := occupancy_cancellation n k h hn hk hh P (dataLaw n P) rfl hP have hv := variance_floor_envelope_le n k epsilon h (Wocc n h k P) ha he (by linarith [hc.2.2.2.2.1]) have hb := bias_squared_le k h hh.1.le have hcell : 0 ≤ (cellWidth h k)^(2/5 : ℝ) := Real.rpow_nonneg (by unfold cellWidth; exact div_nonneg (by linarith) (Nat.cast_nonneg _)) _ have hi : 0 ≤ (info n h k)⁻¹ := inv_nonneg.mpr ha.le have heps : 0 ≤ (epsilon*info n h k)^(-2 : ℤ) := by simp only [zpow_neg, zpow_ofNat] positivity unfold Vbound norm_num only [zpow_neg, zpow_ofNat, pow_succ, pow_zero, mul_one, OfNat.ofNat] at hv heps ⊢ nlinarith [sq_nonneg h]
CausalSmith.Stat.PrivateCateRoughdesign.model_variance_envelope_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/UpperGuarantees.lean:364
theorem target_mem_intervalMap_of_error_le

Truncation retains any target in the model range within the public radius of the center. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
n k :
ℕ
epsilon h t :
ℝ
v :
Fin 2 → ℝ
ht :
t ∈ Icc (-1 : ℝ) 1
herr :
|ratioMap n h k v - t| ≤ sqrt (10 * Vbound n epsilon h k)
t ∈ (intervalMap n epsilon h k v).toSet
Proof (Lean source)
-- @node: target_mem_intervalMap_of_error_le lemma target_mem_intervalMap_of_error_le (n k : ℕ) (epsilon h t : ℝ) (v : Fin 2 → ℝ) (ht : t ∈ Icc (-1 : ℝ) 1) (herr : |ratioMap n h k v - t| ≤ sqrt (10 * Vbound n epsilon h k)) : t ∈ (intervalMap n epsilon h k v).toSet := by rw [intervalMap, closedInterval_toSet] have he := abs_le.mp herr exact ⟨max_le ht.1 (by linarith), le_min ht.2 (by linarith)⟩
CausalSmith.Stat.PrivateCateRoughdesign.target_mem_intervalMap_of_error_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/UpperGuarantees.lean:387
theorem Vbound_pos

The public variance envelope is strictly positive on admissible radii and cell counts. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
epsilon h :
ℝ
hn :
0 < n
hk :
0 < k
hh :
0 < h
0 < Vbound n epsilon h k
Proof (Lean source)
-- @node: Vbound_pos lemma Vbound_pos (n k : ℕ) (epsilon h : ℝ) (hn : 0 < n) (hk : 0 < k) (hh : 0 < h) : 0 < Vbound n epsilon h k := by have ha := (info_d0_pos n k h hn hk hh).1 have hw : 0 ≤ cellWidth h k := by unfold cellWidth; positivity unfold Vbound have hc := Real.rpow_nonneg hw (2/5 : ℝ) have hi := inv_pos.mpr ha have he : 0 ≤ (epsilon*info n h k)^(-2 : ℤ) := by simp only [zpow_neg, zpow_ofNat] positivity positivity
theorem squared_error_radius_tail_le Lemma squared_error_radius_tail_le in the paper ↗

Markov's inequality turns a second-moment envelope into a one-tenth radius-tail bound. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
B :
Q :
f :
B → ℝ
hf :
t V :
ℝ
hV :
0 < V
hmse :
(∫⁻ x, ofReal ((f x-t)^2) ∂Q) ≤ ofReal V
Q {x | sqrt (10*V) < |f x-t|} ≤ ofReal (1/10 : ℝ)
Proof (Lean source)
-- @node: squared_error_radius_tail_le lemma squared_error_radius_tail_le {B : Type*} [MeasurableSpace B] (Q : Measure B) (f : B → ℝ) (hf : Measurable f) (t V : ℝ) (hV : 0 < V) (hmse : (∫⁻ x, ofReal ((f x-t)^2) ∂Q) ≤ ofReal V) : Q {x | sqrt (10*V) < |f x-t|} ≤ ofReal (1/10 : ℝ) := by have hmeas : Measurable (fun x => ofReal ((f x-t)^2)) := by fun_prop have ht := meas_ge_le_lintegral_div (μ := Q) hmeas.aemeasurable (ne_of_gt (by positivity : 0 < ofReal (10*V))) ENNReal.ofReal_ne_top have hsub : {x | sqrt (10*V) < |f x-t|} ⊆ {x | ofReal (10*V) ≤ ofReal ((f x-t)^2)} := by intro x hx apply ENNReal.ofReal_le_ofReal have hs := Real.sq_sqrt (by positivity : 0 ≤ 10*V) have hr := Real.sqrt_nonneg (10*V) have ha := abs_nonneg (f x-t) have habs := sq_abs (f x-t) change sqrt (10*V) < |f x-t| at hx nlinarith calc Q {x | sqrt (10*V) < |f x-t|} ≤ Q {x | ofReal (10*V) ≤ ofReal ((f x-t)^2)} := measure_mono hsub _ ≤ (∫⁻ x, ofReal ((f x-t)^2) ∂Q) / ofReal (10*V) := ht _ ≤ ofReal V / ofReal (10*V) := ENNReal.div_le_div_right hmse _ _ = ofReal (1/10 : ℝ) := by rw [← ENNReal.ofReal_div_of_pos (by positivity : 0 < 10*V)] congr 1 field_simp
CausalSmith.Stat.PrivateCateRoughdesign.squared_error_radius_tail_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/UpperGuarantees.lean:411
theorem intervalMap_miss_probability_le

The truncated interval misses a model-range target only on the radius-tail event. The result uses the stated assumptions and establishes the displayed conclusion.

Formal statement
n k :
ℕ
epsilon h t :
ℝ
Q :
Measure (Fin 2 → ℝ)
ht :
t ∈ Icc (-1 : ℝ) 1
hV :
0 < Vbound n epsilon h k
hmse :
(∫⁻ v, ofReal ((ratioMap n h k v - t) ^ 2) ∂Q)
≤ ofReal (Vbound n epsilon h k)
Q {v | t ∉ (intervalMap n epsilon h k v).toSet} ≤ ofReal (1/10 : ℝ)
Proof (Lean source)
-- @node: intervalMap_miss_probability_le lemma intervalMap_miss_probability_le (n k : ℕ) (epsilon h t : ℝ) (Q : Measure (Fin 2 → ℝ)) (ht : t ∈ Icc (-1 : ℝ) 1) (hV : 0 < Vbound n epsilon h k) (hmse : (∫⁻ v, ofReal ((ratioMap n h k v - t) ^ 2) ∂Q) ≤ ofReal (Vbound n epsilon h k)) : Q {v | t ∉ (intervalMap n epsilon h k v).toSet} ≤ ofReal (1/10 : ℝ) := by refine (measure_mono ?_).trans (squared_error_radius_tail_le Q _ (measurable_ratioMap n h k) t _ hV hmse) intro v hv exact lt_of_not_ge (fun herr => hv (target_mem_intervalMap_of_error_le n k epsilon h t v ht herr))
CausalSmith.Stat.PrivateCateRoughdesign.intervalMap_miss_probability_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/UpperGuarantees.lean:440
theorem Thk_squared_error_eq

Scalar postprocessing expresses the mean-square error as an integral over the joint release. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
epsilon h t :
ℝ
P :
(∫⁻ u, ofReal ((u-t)^2) ∂(Thk n epsilon h k ∘ₘ dataLaw n P))
= ∫⁻ v, ofReal ((ratioMap n h k v-t)^2) ∂(privateRatioRelease n epsilon h k ∘ₘ dataLaw n P)
Proof (Lean source)
-- @node: Thk_squared_error_eq lemma Thk_squared_error_eq (n k : ℕ) (epsilon h t : ℝ) (P : CausalLaw) : (∫⁻ u, ofReal ((u-t)^2) ∂(Thk n epsilon h k ∘ₘ dataLaw n P)) = ∫⁻ v, ofReal ((ratioMap n h k v-t)^2) ∂(privateRatioRelease n epsilon h k ∘ₘ dataLaw n P) := by unfold Thk rw [Kernel.mapOfMeasurable_eq_map, ← Measure.map_comp _ _ (measurable_ratioMap n h k)] exact lintegral_map (by fun_prop) (measurable_ratioMap n h k)
CausalSmith.Stat.PrivateCateRoughdesign.Thk_squared_error_eq · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/UpperGuarantees.lean:454
theorem Ihk_coverage_of_squared_error_le

The finite-sample second-moment guarantee implies coverage for the interval from the same joint release, including targets on the boundary of the model range. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
epsilon h :
ℝ
hn :
0 < n
hk :
0 < k
he :
0 < epsilon
hh :
0 < h
P :
hP :
hmse :
(∫⁻ u, ofReal ((u-theta P)^2) ∂(Thk n epsilon h k ∘ₘ dataLaw n P))
≤ ofReal (Vbound n epsilon h k)
9/10 ≤ coverage n (Ihk n epsilon h k) P
Proof (Lean source)
-- @node: Ihk_coverage_of_squared_error_le lemma Ihk_coverage_of_squared_error_le (n k : ℕ) (epsilon h : ℝ) (hn : 0 < n) (hk : 0 < k) (he : 0 < epsilon) (hh : 0 < h) (P : CausalLaw) (hP : CompleteModel P) (hmse : (∫⁻ u, ofReal ((u-theta P)^2) ∂(Thk n epsilon h k ∘ₘ dataLaw n P)) ≤ ofReal (Vbound n epsilon h k)) : 9/10 ≤ coverage n (Ihk n epsilon h k) P := by letI : IsProbabilityMeasure (Pobs P) := by unfold Pobs exact Measure.isProbabilityMeasure_map measurable_observe.aemeasurable letI : IsProbabilityMeasure (dataLaw n P) := by unfold dataLaw; infer_instance letI := privateRatioRelease_markov n k epsilon h he let Q := privateRatioRelease n epsilon h k ∘ₘ dataLaw n P let E : Set (Fin 2 → ℝ) := {v | theta P ∈ (intervalMap n epsilon h k v).toSet} have hE : MeasurableSet E := (measurableSet_interval_contains (theta P)).preimage (measurable_intervalMap n epsilon h k) have hmiss : Q Eᶜ ≤ ofReal (1/10 : ℝ) := by exact intervalMap_miss_probability_le n k epsilon h (theta P) Q (theta_mem_Icc P hP) (Vbound_pos n k epsilon h hn hk hh) ((Thk_squared_error_eq n k epsilon h (theta P) P) ▸ hmse) have hmissReal : Q.real Eᶜ ≤ 1/10 := by simpa [Measure.real] using ENNReal.toReal_mono ENNReal.ofReal_ne_top hmiss have hsum := probReal_compl_eq_one_sub (μ := Q) hE have hcov : coverage n (Ihk n epsilon h k) P = Q.real E := by unfold coverage Ihk Measure.real rw [Kernel.mapOfMeasurable_eq_map, ← Measure.map_comp _ _ (measurable_intervalMap n epsilon h k), Measure.map_apply (measurable_intervalMap n epsilon h k) (measurableSet_interval_contains (theta P))] rfl rw [hcov] linarith
CausalSmith.Stat.PrivateCateRoughdesign.Ihk_coverage_of_squared_error_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/UpperGuarantees.lean:464
theorem full_interval_coverage

The public fallback interval covers every law in the complete model with probability one. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
P :
hP :
coverage n (Kernel.const (Dataset n) (Measure.dirac (closedInterval (-1) 1))) P = 1
Proof (Lean source)
-- @node: full_interval_coverage lemma full_interval_coverage (n : ℕ) (P : CausalLaw) (hP : CompleteModel P) : coverage n (Kernel.const (Dataset n) (Measure.dirac (closedInterval (-1) 1))) P = 1 := by letI : IsProbabilityMeasure (Pobs P) := by unfold Pobs exact Measure.isProbabilityMeasure_map measurable_observe.aemeasurable letI : IsProbabilityMeasure (dataLaw n P) := by unfold dataLaw; infer_instance have ht : theta P ∈ (closedInterval (-1) 1).toSet := by rw [closedInterval_toSet] exact theta_mem_Icc P hP unfold coverage Measure.real change ((dataLaw n P).bind (fun _ => Measure.dirac (closedInterval (-1) 1)) {c | theta P ∈ c.toSet}).toReal = 1 rw [Measure.bind_const] simp [Measure.dirac_apply' _ (measurableSet_interval_contains (theta P)), ht]
CausalSmith.Stat.PrivateCateRoughdesign.full_interval_coverage · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/UpperGuarantees.lean:498
theorem publicTunedInterval_coverage_of_squared_error_le

Coverage of the tuned interval follows from the tuned second moment on its active branch and full-range coverage on its fallback branch. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
epsilon :
ℝ
hn :
2 ≤ n
he :
0 < epsilon ∧ epsilon ≤ 1
P :
hP :
hmse :
rate n epsilon < 1/8 → (∫⁻ u, ofReal ((u-theta P)^2) ∂(Thk n epsilon (tunedH n epsilon) (tunedK n epsilon) ∘ₘ dataLaw n P))
≤ ofReal (Vbound n epsilon (tunedH n epsilon) (tunedK n epsilon))
9/10 ≤ coverage n (publicTunedInterval n epsilon) P
Proof (Lean source)
-- @node: publicTunedInterval_coverage_of_squared_error_le lemma publicTunedInterval_coverage_of_squared_error_le (n : ℕ) (epsilon : ℝ) (hn : 2 ≤ n) (he : 0 < epsilon ∧ epsilon ≤ 1) (P : CausalLaw) (hP : CompleteModel P) (hmse : rate n epsilon < 1/8 → (∫⁻ u, ofReal ((u-theta P)^2) ∂(Thk n epsilon (tunedH n epsilon) (tunedK n epsilon) ∘ₘ dataLaw n P)) ≤ ofReal (Vbound n epsilon (tunedH n epsilon) (tunedK n epsilon))) : 9/10 ≤ coverage n (publicTunedInterval n epsilon) P := by classical unfold publicTunedInterval split_ifs with hr · rw [full_interval_coverage n P hP] norm_num · have hp := public_tuning_parameters n epsilon hn he (lt_of_not_ge hr) exact Ihk_coverage_of_squared_error_le n _ epsilon _ (by omega) (by omega) he.1 hp.1 P hP (hmse (lt_of_not_ge hr))
CausalSmith.Stat.PrivateCateRoughdesign.publicTunedInterval_coverage_of_squared_error_le · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/Helpers/UpperGuarantees.lean:515
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.TMatchedRiskFrontier 6 declarations Matched private absolute-risk frontier over all total randomized mechanisms in the same observation experiment, attained above by the explicit publicly tuned release.

Matched private absolute-risk frontier over all total randomized mechanisms in the same observation experiment, attained above by the explicit publicly tuned release.

theorem finiteProductMixture_probability

A nonempty finite uniform prior is a probability measure. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n s :
ℕ
F :
hs :
0 < s
Proof (Lean source)
-- @node: finiteProductMixture_probability lemma finiteProductMixture_probability (n s : ℕ) (F : Fin s → CausalLaw) (hs : 0 < s) : IsProbabilityMeasure (finiteProductMixture n s F) := by have hprob : ∀ i, IsProbabilityMeasure (dataLaw n (F i)) := by intro i let : IsProbabilityMeasure (Pobs (F i)) := Measure.isProbabilityMeasure_map measurable_observe.aemeasurable unfold dataLaw infer_instance constructor simp only [finiteProductMixture, Measure.smul_apply, smul_eq_mul, Measure.finsetSum_apply, measure_univ, Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul, mul_one] exact ENNReal.inv_mul_cancel (by exact_mod_cast (Nat.ne_of_gt hs)) (by simp)
CausalSmith.Stat.PrivateCateRoughdesign.finiteProductMixture_probability · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/TMatchedRiskFrontier.lean:10

Kernel composition distributes over a finite sum of input laws. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
ι B :
n :
ℕ
M :
s :
Q :
ι → Measure (Dataset n)
M ∘ₘ (∑ i ∈ s, Q i) = ∑ i ∈ s, M ∘ₘ Q i
Proof (Lean source)
-- @node: prior_comp_finsetSum lemma prior_comp_finsetSum {ι B : Type*} [MeasurableSpace B] (n : ℕ) (M : Kernel (Dataset n) B) (s : Finset ι) (Q : ι → Measure (Dataset n)) : M ∘ₘ (∑ i ∈ s, Q i) = ∑ i ∈ s, M ∘ₘ Q i := by classical induction s using Finset.induction_on with | empty => simp | @insert i s hi ih => simp [Finset.sum_insert hi, Measure.comp_add, ih]
CausalSmith.Stat.PrivateCateRoughdesign.prior_comp_finsetSum · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/TMatchedRiskFrontier.lean:26
theorem finite_prior_loss_le_worstRisk

Prior-averaged loss at a common target is bounded by the maximal class risk, including when the latter is infinite. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n s :
ℕ
F :
hs :
0 < s
M :
Kernel (Dataset n) ℝ
target :
ℝ
hF :
∀ i, CompleteModel (F i) ∧ theta (F i) = target
(∫⁻ u, ofReal |u - target| ∂(M ∘ₘ finiteProductMixture n s F)) ≤ worstRisk n M
Proof (Lean source)
-- @node: finite_prior_loss_le_worstRisk lemma finite_prior_loss_le_worstRisk (n s : ℕ) (F : Fin s → CausalLaw) (hs : 0 < s) (M : Kernel (Dataset n) ℝ) (target : ℝ) (hF : ∀ i, CompleteModel (F i) ∧ theta (F i) = target) : (∫⁻ u, ofReal |u - target| ∂(M ∘ₘ finiteProductMixture n s F)) ≤ worstRisk n M := by rw [finiteProductMixture, Measure.comp_smul, prior_comp_finsetSum, lintegral_smul_measure, lintegral_finsetSum_measure] have hbound : ∀ i : Fin s, (∫⁻ u, ofReal |u - target| ∂(M ∘ₘ dataLaw n (F i))) ≤ worstRisk n M := by intro i rw [← (hF i).2] exact le_iSup_of_le (F i) (le_iSup_of_le (hF i).1 le_rfl) calc _ ≤ (s : ℝ≥0∞)⁻¹ * ∑ _i : Fin s, worstRisk n M := mul_le_mul_of_nonneg_left (Finset.sum_le_sum fun i _ => hbound i) (zero_le) _ = worstRisk n M := by simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] rw [← mul_assoc, ENNReal.inv_mul_cancel (by exact_mod_cast (Nat.ne_of_gt hs)) (by simp), one_mul]
CausalSmith.Stat.PrivateCateRoughdesign.finite_prior_loss_le_worstRisk · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/TMatchedRiskFrontier.lean:36
theorem absolute_loss_of_error_probability Lemma absolute_loss_of_error_probability in the paper ↗

A real error event of probability at least three eighths forces absolute loss. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
target a :
ℝ
ha :
0 ≤ a
hp :
3 / 8 ≤ L.real {u | a ≤ dist u target}
ofReal (a * (3 / 8)) ≤ ∫⁻ u, ofReal |u - target| ∂L
Proof (Lean source)
-- @node: absolute_loss_of_error_probability lemma absolute_loss_of_error_probability (L : Measure ℝ) [IsProbabilityMeasure L] (target a : ℝ) (ha : 0 ≤ a) (hp : 3 / 8 ≤ L.real {u | a ≤ dist u target}) : ofReal (a * (3 / 8)) ≤ ∫⁻ u, ofReal |u - target| ∂L := by have hm : Measurable (fun u : ℝ => ofReal |u - target|) := by fun_prop have hmarkov := mul_meas_ge_le_lintegral (μ := L) hm (ofReal a) have hset : {u : ℝ | ofReal a ≤ ofReal |u - target|} = {u | a ≤ dist u target} := by ext u simp only [Set.mem_setOf_eq, Real.dist_eq] exact ENNReal.ofReal_le_ofReal_iff (abs_nonneg _) rw [hset] at hmarkov have hmass : ofReal (3 / 8 : ℝ) ≤ L {u | a ≤ dist u target} := by rw [← ENNReal.ofReal_toReal (measure_ne_top L _)] exact ENNReal.ofReal_le_ofReal hp rw [ENNReal.ofReal_mul ha] exact (mul_le_mul_of_nonneg_left hmass (zero_le)).trans hmarkov
CausalSmith.Stat.PrivateCateRoughdesign.absolute_loss_of_error_probability · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/TMatchedRiskFrontier.lean:59
theorem finite_priors_scalar_lower

Le Cam's two-error inequality and finite-prior averaging give the scalar converse. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n s0 s1 :
ℕ
F0 :
Fin s0 → CausalLaw
F1 :
Fin s1 → CausalLaw
hs0 :
0 < s0
hs1 :
0 < s1
Delta :
ℝ
hd :
0 ≤ Delta
hF0 :
∀ i, CompleteModel (F0 i) ∧ theta (F0 i) = 0
hF1 :
∀ i, CompleteModel (F1 i) ∧ theta (F1 i) = Delta
htv :
TV (M ∘ₘ finiteProductMixture n s0 F0) (M ∘ₘ finiteProductMixture n s1 F1) ≤ 1 / 4
ofReal (3 * Delta / 16) ≤ worstRisk n M
Proof (Lean source)
-- @node: finite_priors_scalar_lower lemma finite_priors_scalar_lower (n s0 s1 : ℕ) (F0 : Fin s0 → CausalLaw) (F1 : Fin s1 → CausalLaw) (hs0 : 0 < s0) (hs1 : 0 < s1) (M : Kernel (Dataset n) ℝ) [IsMarkovKernel M] (Delta : ℝ) (hd : 0 ≤ Delta) (hF0 : ∀ i, CompleteModel (F0 i) ∧ theta (F0 i) = 0) (hF1 : ∀ i, CompleteModel (F1 i) ∧ theta (F1 i) = Delta) (htv : TV (M ∘ₘ finiteProductMixture n s0 F0) (M ∘ₘ finiteProductMixture n s1 F1) ≤ 1 / 4) : ofReal (3 * Delta / 16) ≤ worstRisk n M := by let L0 := M ∘ₘ finiteProductMixture n s0 F0 let L1 := M ∘ₘ finiteProductMixture n s1 F1 let : IsProbabilityMeasure (finiteProductMixture n s0 F0) := finiteProductMixture_probability n s0 F0 hs0 let : IsProbabilityMeasure (finiteProductMixture n s1 F1) := finiteProductMixture_probability n s1 F1 hs1 have hsep : 2 * (Delta / 2) ≤ dist (0 : ℝ) Delta := by rw [Real.dist_eq, zero_sub, abs_neg, abs_of_nonneg hd] linarith have htest := one_sub_tvDist_le_error_sum (P₀ := L0) (P₁ := L1) measurable_id hsep have hsum : 3 / 4 ≤ L0.real {u | Delta / 2 ≤ dist u 0} + L1.real {u | Delta / 2 ≤ dist u Delta} := by change TV L0 L1 ≤ 1 / 4 at htv simp only [id_eq] at htest linarith have hcases : 3 / 8 ≤ L0.real {u | Delta / 2 ≤ dist u 0} ∨ 3 / 8 ≤ L1.real {u | Delta / 2 ≤ dist u Delta} := by by_contra h push_neg at h linarith have heq : 3 * Delta / 16 = (Delta / 2) * (3 / 8) := by ring rw [heq] rcases hcases with h0 | h1 · exact (absolute_loss_of_error_probability L0 0 (Delta / 2) (by positivity) h0).trans (finite_prior_loss_le_worstRisk n s0 F0 hs0 M 0 hF0) · exact (absolute_loss_of_error_probability L1 Delta (Delta / 2) (by positivity) h1).trans (finite_prior_loss_le_worstRisk n s1 F1 hs1 M Delta hF1)
CausalSmith.Stat.PrivateCateRoughdesign.finite_priors_scalar_lower · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/TMatchedRiskFrontier.lean:79
theorem matched_risk_frontier

The minimax risk lies between the specified fixed multiples of the benchmark. The total publicly tuned kernel attains the upper bound across the entire complete model. The public parameters and their domains and the Efron--Stein gate, bounded-differences gate, and Cayley gate specify the conditional scope.

Formal statement
efronStein_of_gate :
boundedDifferences_of_gate :
cayley_of_gate :
n :
ℕ
epsilon :
ℝ
hn :
2 ≤ n
he :
0 < epsilon ∧ epsilon ≤ 1
conclusion 1
ofReal ((2 : ℝ)^(-20 : ℤ)*rate n epsilon) ≤ privateMinimaxRisk n epsilon
conclusion 2
privateMinimaxRisk n epsilon ≤ ofReal (2^18*rate n epsilon)
conclusion 3
conclusion 4
PrivateKernel n epsilon (publicTunedRelease n epsilon)
conclusion 5
worstRisk n (publicTunedRelease n epsilon) ≤ ofReal (2^18*rate n epsilon)
Proof (Lean source)
-- @node: thm:matched-risk-frontier theorem matched_risk_frontier (efronStein_of_gate : EfronSteinReplacement) (boundedDifferences_of_gate : BoundedDifferencesMGF) (cayley_of_gate : CayleyLabeledTreeCount) (n : ℕ) (epsilon : ℝ) (hn : 2 ≤ n) (he : 0 < epsilon ∧ epsilon ≤ 1) : ofReal ((2 : ℝ)^(-20 : ℤ)*rate n epsilon) ≤ privateMinimaxRisk n epsilon ∧ privateMinimaxRisk n epsilon ≤ ofReal (2^18*rate n epsilon) ∧ IsMarkovKernel (publicTunedRelease n epsilon) ∧ PrivateKernel n epsilon (publicTunedRelease n epsilon) ∧ worstRisk n (publicTunedRelease n epsilon) ≤ ofReal (2^18*rate n epsilon) := by obtain ⟨s0, s1, F0, F1, Delta, hs0, hs1, hd, hF0, hF1, _, htv⟩ := frontier_testing_priors boundedDifferences_of_gate cayley_of_gate n epsilon hn he have hr : 0 < rate n epsilon := rate_pos n epsilon (by omega) have hd0 : 0 ≤ Delta := le_trans (by positivity) hd have hlower : ofReal ((2 : ℝ)^(-20 : ℤ) * rate n epsilon) ≤ privateMinimaxRisk n epsilon := by unfold privateMinimaxRisk refine le_iInf fun M => le_iInf fun hM => ?_ let : IsMarkovKernel M := hM.1 have htest := finite_priors_scalar_lower n s0 s1 F0 F1 hs0 hs1 M Delta hd0 hF0 hF1 (htv ℝ M hM.2) apply le_trans (ENNReal.ofReal_le_ofReal ?_) htest have hscale : (2 : ℝ)^(-20 : ℤ) ≤ (3 / 16) * (2 : ℝ)^(-14 : ℤ) := by norm_num calc _ ≤ ((3 / 16) * (2 : ℝ)^(-14 : ℤ)) * rate n epsilon := mul_le_mul_of_nonneg_right hscale hr.le _ = (3 / 16) * ((2 : ℝ)^(-14 : ℤ) * rate n epsilon) := by ring _ ≤ (3 / 16) * Delta := mul_le_mul_of_nonneg_left hd (by norm_num) _ = _ := by ring obtain ⟨_, _, _, _, _, _, _, hmarkov, hprivate, _, _, hrisk, _, _⟩ := uniform_private_upper efronStein_of_gate n 2 epsilon (1 / 4) hn (by omega) he ⟨by norm_num, le_rfl⟩ have hupper : privateMinimaxRisk n epsilon ≤ worstRisk n (publicTunedRelease n epsilon) := iInf_le_of_le (publicTunedRelease n epsilon) (iInf_le_of_le ⟨hmarkov, hprivate⟩ le_rfl) exact ⟨hlower, hupper.trans hrisk, hmarkov, hprivate, hrisk⟩
CausalSmith.Stat.PrivateCateRoughdesign.matched_risk_frontier · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/TMatchedRiskFrontier.lean:119
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.TRegimeAndSanity 5 declarations Exact public-budget regimes, the unrestricted nonprivate order, and the exact condition for consistency along budget sequences.

Exact public-budget regimes, the unrestricted nonprivate order, and the exact condition for consistency along budget sequences.

theorem private_risk_consistency_iff

The matched risk frontier transfers the benchmark's exact consistency criterion to risk. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
efronStein_of_gate :
boundedDifferences_of_gate :
cayley_of_gate :
budgets :
ℕ → ℝ
he :
∀ j
if
2 ≤ j
then
0 < budgets j ∧ budgets j ≤ 1
Tendsto (fun j => privateMinimaxRisk j (budgets j)) atTop (𝓝 0)
↔ Tendsto (fun j : ℕ => (j : ℝ)*budgets j) atTop atTop
Proof (Lean source)
-- @node: private_risk_consistency_iff lemma private_risk_consistency_iff (efronStein_of_gate : EfronSteinReplacement) (boundedDifferences_of_gate : BoundedDifferencesMGF) (cayley_of_gate : CayleyLabeledTreeCount) (budgets : ℕ → ℝ) (he : ∀ j, 2 ≤ j → 0 < budgets j ∧ budgets j ≤ 1) : Tendsto (fun j => privateMinimaxRisk j (budgets j)) atTop (𝓝 0) ↔ Tendsto (fun j : ℕ => (j : ℝ)*budgets j) atTop atTop := by have hfront := fun j hj => matched_risk_frontier efronStein_of_gate boundedDifferences_of_gate cayley_of_gate j (budgets j) hj (he j hj) rw [← rate_consistency_iff budgets (fun j hj => (he j hj).1)] constructor · intro hrisk apply tendsto_order.2 constructor · intro a ha filter_upwards [eventually_ge_atTop 2] with j hj exact ha.trans (rate_pos j (budgets j) (by omega)) · intro a ha have hc : (0 : ℝ) < (2 : ℝ)^(-20 : ℤ) := by positivity have hca : 0 < (2 : ℝ)^(-20 : ℤ)*a := mul_pos hc ha have hbound := (tendsto_order.1 hrisk).2 _ (ENNReal.ofReal_pos.mpr hca) filter_upwards [hbound, eventually_ge_atTop 2] with j hj hj2 have hlt := lt_of_le_of_lt (hfront j hj2).1 hj have hre := (ENNReal.ofReal_lt_ofReal_iff hca).mp hlt exact (mul_lt_mul_iff_right₀ hc).mp hre · intro hr have hu : Tendsto (fun j => ofReal (2^18*rate j (budgets j))) atTop (𝓝 0) := by simpa only [mul_zero, ENNReal.ofReal_zero] using ENNReal.tendsto_ofReal (hr.const_mul (2^18 : ℝ)) apply tendsto_of_tendsto_of_tendsto_of_le_of_le' tendsto_const_nhds hu · exact Filter.Eventually.of_forall (fun _ => bot_le) · filter_upwards [eventually_ge_atTop 2] with j hj exact (hfront j hj).2.1
CausalSmith.Stat.PrivateCateRoughdesign.private_risk_consistency_iff · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/TRegimeAndSanity.lean:10
theorem nonprivate_sampling_upper

The unit-budget release also attains the sampling upper bound without privacy constraints. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
efronStein_of_gate :
boundedDifferences_of_gate :
cayley_of_gate :
n :
ℕ
hn :
2 ≤ n
nonprivateMinimaxRisk n ≤ ofReal (2^18*(n : ℝ)^(-1/4 : ℝ))
Proof (Lean source)
-- @node: nonprivate_sampling_upper lemma nonprivate_sampling_upper (efronStein_of_gate : EfronSteinReplacement) (boundedDifferences_of_gate : BoundedDifferencesMGF) (cayley_of_gate : CayleyLabeledTreeCount) (n : ℕ) (hn : 2 ≤ n) : nonprivateMinimaxRisk n ≤ ofReal (2^18*(n : ℝ)^(-1/4 : ℝ)) := by obtain ⟨_, _, hM, _, hR⟩ := matched_risk_frontier efronStein_of_gate boundedDifferences_of_gate cayley_of_gate n 1 hn ⟨zero_lt_one, le_rfl⟩ rw [rate_unit_budget n hn] at hR exact (iInf_le_of_le (publicTunedRelease n 1) (iInf_le_of_le hM le_rfl)).trans hR
CausalSmith.Stat.PrivateCateRoughdesign.nonprivate_sampling_upper · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/TRegimeAndSanity.lean:44
theorem nonprivate_sampling_lower

The explicit sign mixture at one quarter of the sampling radius gives the unrestricted nonprivate lower bound, through chi-square comparison and Le Cam testing. the theorem's stated inputs and assumptions, and the asserted conclusion follows.

Formal statement
boundedDifferences_of_gate :
cayley_of_gate :
n :
ℕ
hn :
2 ≤ n
ofReal ((2 : ℝ)^(-20 : ℤ)*(n : ℝ)^(-1/4 : ℝ)) ≤ nonprivateMinimaxRisk n
Proof (Lean source)
-- @node: nonprivate_sampling_lower lemma nonprivate_sampling_lower (boundedDifferences_of_gate : BoundedDifferencesMGF) (cayley_of_gate : CayleyLabeledTreeCount) (n : ℕ) (hn : 2 ≤ n) : ofReal ((2 : ℝ)^(-20 : ℤ)*(n : ℝ)^(-1/4 : ℝ)) ≤ nonprivateMinimaxRisk n := by obtain ⟨s0, s1, F0, F1, Delta, hs0, hs1, hd, hF0, hF1, hrepr, _⟩ := frontier_testing_priors.{0} boundedDifferences_of_gate cayley_of_gate n 1 hn ⟨zero_lt_one, le_rfl⟩ obtain ⟨hL, hhL, hradius, hnull, hsign, _⟩ := hrepr have hx : 0 < (n : ℝ) := by exact_mod_cast (show 0 < n by omega) have hx1 : 1 ≤ (n : ℝ) := by exact_mod_cast (show 1 ≤ n by omega) have hr := rate_unit_budget n hn have huses : testingUsesSigns n 1 := by dsimp [testingUsesSigns] refine ⟨by simpa using (show (1 : ℝ) < n from by exact_mod_cast (show 1 < n by omega)), inl ?_⟩ constructor · exact (sparse_le_sampling_iff (n : ℝ) 1 hx zero_lt_one).2 (Real.rpow_le_one_of_one_le_of_nonpos hx1 (by norm_num)) · exact (dense_le_sampling_iff (n : ℝ) 1 hx zero_lt_one).2 (Real.rpow_le_one_of_one_le_of_nonpos hx1 (by norm_num)) obtain ⟨_, hmix⟩ := hsign huses have hnullmix : finiteProductMixture n s0 F0 = dataLaw n fairNull := by ext E hE simp only [finiteProductMixture, Measure.smul_apply, smul_eq_mul, Measure.finsetSum_apply, hnull, Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] rw [← mul_assoc, ENNReal.inv_mul_cancel (by exact_mod_cast hs0.ne') (by simp), one_mul] obtain ⟨_, _, _, _, _, hchi, hac, hint⟩ := positive_family_certificate hL hhL boundedDifferences_of_gate n have hrad : hL = (n : ℝ)^(-1/4 : ℝ) / 4 := by simpa [hr] using hradius have hpow : (n : ℝ)^2 * ((n : ℝ)^(-1/4 : ℝ))^8 = 1 := by rw [← Real.rpow_mul_natCast hx.le] norm_num exact mul_inv_cancel₀ (pow_ne_zero _ hx.ne') have hexponent : 160*(n : ℝ)^2*(separation hL)^2*hL*deltaL hL = 160 * (2 : ℝ)^(-40 : ℤ) := by rw [hrad] dsimp [separation, kappa, deltaL] norm_num nlinarith [hpow] have hexp : exp (160 * (2 : ℝ)^(-40 : ℤ)) - 1 ≤ 1/4 := by have h := exp_privacy_increment_le (160 * (2 : ℝ)^(-40 : ℤ)) ⟨by norm_num, by norm_num⟩ norm_num at h ⊢ linarith let : IsProbabilityMeasure (finiteProductMixture n s0 F0) := finiteProductMixture_probability n s0 F0 hs0 let : IsProbabilityMeasure (finiteProductMixture n s1 F1) := finiteProductMixture_probability n s1 F1 hs1 have hprob0 : IsProbabilityMeasure (dataLaw n fairNull) := hnullmix ▸ inferInstance have hprob1 : IsProbabilityMeasure (signMixture hL hhL n) := hmix ▸ inferInstance let : IsProbabilityMeasure (dataLaw n fairNull) := hprob0 let : IsProbabilityMeasure (signMixture hL hhL n) := hprob1 have hdata : TV (finiteProductMixture n s0 F0) (finiteProductMixture n s1 F1) ≤ 1/4 := by rw [hnullmix, hmix] change tvDist _ _ ≤ _ rw [tvDist_symm] have htv := tvDist_le_half_sqrt_chiSqDiv (signMixture hL hhL n) (dataLaw n fairNull) hac hint have hb : chiSqDiv (signMixture hL hhL n) (dataLaw n fairNull) ≤ 1/4 := by rw [hexponent] at hchi exact hchi.trans hexp have hsqrt : sqrt (chiSqDiv (signMixture hL hhL n) (dataLaw n fairNull)) ≤ 1/2 := (Real.sqrt_le_iff).2 ⟨by norm_num, by nlinarith [hb]⟩ linarith have hrpos : 0 < rate n 1 := rate_pos n 1 (by omega) unfold nonprivateMinimaxRisk refine le_iInf fun M => le_iInf fun hM => ?_ let : IsMarkovKernel M := hM have htest := finite_priors_scalar_lower n s0 s1 F0 F1 hs0 hs1 M Delta (le_trans (by positivity) hd) hF0 hF1 ((kernel_TV_contraction M _ _).trans hdata) apply (ENNReal.ofReal_le_ofReal ?_).trans htest rw [hr] at hd have hc : (2 : ℝ)^(-20 : ℤ) ≤ (3/16) * (2 : ℝ)^(-14 : ℤ) := by norm_num have ha : 0 ≤ (n : ℝ)^(-1/4 : ℝ) := by positivity nlinarith [mul_le_mul_of_nonneg_right hc ha]
CausalSmith.Stat.PrivateCateRoughdesign.nonprivate_sampling_lower · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/TRegimeAndSanity.lean:55
theorem nonprivate_sampling_bounds

Given the Efron--Stein gate, bounded-differences gate, and Cayley gate, the unrestricted minimax risk at every sample size at least two lies between the explicit constants 2⁻²⁰ and 2¹⁸ times the fourth-root rate.

Formal statement
efronStein_of_gate :
boundedDifferences_of_gate :
cayley_of_gate :
n :
ℕ
hn :
2 ≤ n
conclusion 1
ofReal ((2 : ℝ)^(-20 : ℤ)*(n : ℝ)^(-1/4 : ℝ)) ≤ nonprivateMinimaxRisk n
conclusion 2
nonprivateMinimaxRisk n ≤ ofReal (2^18*(n : ℝ)^(-1/4 : ℝ))
Proof (Lean source)
-- keep: separate unrestricted two-sided minimax benchmark required by the resolved R1 scope lemma nonprivate_sampling_bounds (efronStein_of_gate : EfronSteinReplacement) (boundedDifferences_of_gate : BoundedDifferencesMGF) (cayley_of_gate : CayleyLabeledTreeCount) (n : ℕ) (hn : 2 ≤ n) : ofReal ((2 : ℝ)^(-20 : ℤ)*(n : ℝ)^(-1/4 : ℝ)) ≤ nonprivateMinimaxRisk n ∧ nonprivateMinimaxRisk n ≤ ofReal (2^18*(n : ℝ)^(-1/4 : ℝ)) := by exact ⟨nonprivate_sampling_lower boundedDifferences_of_gate cayley_of_gate n hn, nonprivate_sampling_upper efronStein_of_gate boundedDifferences_of_gate cayley_of_gate n hn⟩
CausalSmith.Stat.PrivateCateRoughdesign.nonprivate_sampling_bounds · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/TRegimeAndSanity.lean:139
theorem regime_and_sanity

The benchmark has four exact regimes, its unit-budget scale is exactly the nonprivate fourth-root order, and private minimax consistency holds exactly when sample size times the privacy budget diverges. The Efron--Stein gate, bounded-differences gate, and Cayley gate specify the conditional scope.

Formal statement
efronStein_of_gate :
boundedDifferences_of_gate :
cayley_of_gate :
conclusion 1
n :
ℕ
epsilon :
ℝ
2 ≤ n
0 < epsilon ∧ epsilon ≤ 1
((n : ℝ)^(-1/4 : ℝ) ≤ epsilon)
rate n epsilon = (n : ℝ)^(-1/4 : ℝ)
((n : ℝ)^(-3/5 : ℝ) ≤ epsilon ∧ epsilon ≤ (n : ℝ)^(-1/4 : ℝ))
rate n epsilon = ((n : ℝ)^2*epsilon)^(-1/7 : ℝ)
((n : ℝ)^(-1 : ℤ) ≤ epsilon ∧ epsilon ≤ (n : ℝ)^(-3/5 : ℝ))
rate n epsilon = ((n : ℝ)*epsilon)^(-1/2 : ℝ)
epsilon ≤ (n : ℝ)^(-1 : ℤ)
rate n epsilon = 1
rate n 1 = (n : ℝ)^(-1/4 : ℝ)
conclusion 2
budgets :
ℕ → ℝ
(∀ j, 2 ≤ j → 0 < budgets j ∧ budgets j ≤ 1)
Tendsto (fun j => privateMinimaxRisk j (budgets j)) atTop (𝓝 0)
↔ Tendsto (fun j : ℕ => (j : ℝ)*budgets j) atTop atTop
Proof (Lean source)
-- @node: prop:regime-and-sanity theorem regime_and_sanity (efronStein_of_gate : EfronSteinReplacement) (boundedDifferences_of_gate : BoundedDifferencesMGF) (cayley_of_gate : CayleyLabeledTreeCount) : (∀ (n : ℕ) (epsilon : ℝ), 2 ≤ n → 0 < epsilon ∧ epsilon ≤ 1 → (((n : ℝ)^(-1/4 : ℝ) ≤ epsilon) → rate n epsilon = (n : ℝ)^(-1/4 : ℝ)) ∧ (((n : ℝ)^(-3/5 : ℝ) ≤ epsilon ∧ epsilon ≤ (n : ℝ)^(-1/4 : ℝ)) → rate n epsilon = ((n : ℝ)^2*epsilon)^(-1/7 : ℝ)) ∧ (((n : ℝ)^(-1 : ℤ) ≤ epsilon ∧ epsilon ≤ (n : ℝ)^(-3/5 : ℝ)) → rate n epsilon = ((n : ℝ)*epsilon)^(-1/2 : ℝ)) ∧ (epsilon ≤ (n : ℝ)^(-1 : ℤ) → rate n epsilon = 1) ∧ rate n 1 = (n : ℝ)^(-1/4 : ℝ)) ∧ (∀ budgets : ℕ → ℝ, (∀ j, 2 ≤ j → 0 < budgets j ∧ budgets j ≤ 1) → (Tendsto (fun j => privateMinimaxRisk j (budgets j)) atTop (𝓝 0) ↔ Tendsto (fun j : ℕ => (j : ℝ)*budgets j) atTop atTop)) := by constructor · intro n epsilon hn he exact ⟨rate_sampling_regime n epsilon hn he.1, rate_sparse_regime n epsilon hn he.1, rate_dense_regime n epsilon hn he.1, rate_capped_regime n epsilon hn he.1, rate_unit_budget n hn⟩ · intro budgets he exact private_risk_consistency_iff efronStein_of_gate boundedDifferences_of_gate cayley_of_gate budgets he
CausalSmith.Stat.PrivateCateRoughdesign.regime_and_sanity · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/TRegimeAndSanity.lean:153
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.TSharpIntervalFrontier 9 declarations Honest private expected-length frontier, explicit inversion identity, and uniform equivalence to the scalar absolute-risk frontier.

Honest private expected-length frontier, explicit inversion identity, and uniform equivalence to the scalar absolute-risk frontier.

Clipping a numerator commutes with division by a positive denominator. the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
b z :
ℝ
hb :
0 < b
clip (-b) b z / b = clip (-1) 1 (z / b)
Proof (Lean source)
-- @node: clip_div_positive lemma clip_div_positive (b z : ℝ) (hb : 0 < b) : clip (-b) b z / b = clip (-1) 1 (z / b) := by unfold clip rw [← max_div_div_right hb.le, ← min_div_div_right hb.le] simp [hb.ne']
theorem inversionMap_eq_intervalMap Lemma inversionMap_eq_intervalMap in the paper ↗

At legal public parameters the acceptance hull is the released interval. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n k :
ℕ
epsilon h :
ℝ
hn :
0 < n
hk :
0 < k
hh :
0 < h
inversionMap n epsilon h k = intervalMap n epsilon h k
Proof (Lean source)
-- @node: inversionMap_eq_intervalMap lemma inversionMap_eq_intervalMap (n k : ℕ) (epsilon h : ℝ) (hn : 0 < n) (hk : 0 < k) (hh : 0 < h) : inversionMap n epsilon h k = intervalMap n epsilon h k := by funext v have hb : 0 < max (d0 n h k) (v 1) := lt_of_lt_of_le (info_d0_pos n k h hn hk hh).2 (le_max_left _ _) rw [inversionMap_eq_endpoints, if_pos hb, clip_div_positive _ _ hb] rfl
CausalSmith.Stat.PrivateCateRoughdesign.inversionMap_eq_intervalMap · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/TSharpIntervalFrontier.lean:18
theorem optimalIntervalHandle_eq_publicTunedInterval

Public tuning uses the same interval on both release branches. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n :
ℕ
epsilon :
ℝ
hn :
2 ≤ n
he :
0 < epsilon ∧ epsilon ≤ 1
Proof (Lean source)
-- @node: optimalIntervalHandle_eq_publicTunedInterval lemma optimalIntervalHandle_eq_publicTunedInterval (n : ℕ) (epsilon : ℝ) (hn : 2 ≤ n) (he : 0 < epsilon ∧ epsilon ≤ 1) : optimalIntervalHandle n epsilon = publicTunedInterval n epsilon := by classical by_cases hr : 1 / 8 ≤ rate n epsilon · simp only [optimalIntervalHandle, publicTunedInterval, if_pos hr] · have hp := public_tuning_parameters n epsilon hn he (lt_of_not_ge hr) simp only [optimalIntervalHandle, publicTunedInterval, hr, ↓reduceIte, Ihk] congr 1 exact inversionMap_eq_intervalMap n (tunedK n epsilon) epsilon (tunedH n epsilon) (by omega) (by omega) hp.1
CausalSmith.Stat.PrivateCateRoughdesign.optimalIntervalHandle_eq_publicTunedInterval · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/TSharpIntervalFrontier.lean:29

An interval containing two ordered points contains the open span between them. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
a b :
ℝ
ha :
a ∈ c.toSet
hb :
b ∈ c.toSet
Ioo a b ⊆ c.toSet
Proof (Lean source)
-- @node: interval_span_subset lemma interval_span_subset (c : IntervalCode) (a b : ℝ) (ha : a ∈ c.toSet) (hb : b ∈ c.toSet) : Ioo a b ⊆ c.toSet := by cases c with | inl u => simp [IntervalCode.toSet] at ha | inr p => rcases p with ⟨l, u, lc, uc⟩ intro x hx simp only [IntervalCode.toSet, Set.mem_ofPred_eq] at ha hb ⊢ have hax := EReal.coe_lt_coe hx.1 have hxb := EReal.coe_lt_coe hx.2 constructor · cases lc <;> simp only [Bool.false_eq_true, ↓reduceIte] at ha ⊢ · exact ha.1.trans hax · exact (ha.1.trans_lt hax).le · cases uc <;> simp only [Bool.false_eq_true, ↓reduceIte] at hb ⊢ · exact hxb.trans hb.2 · exact (hxb.trans_le hb.2).le
CausalSmith.Stat.PrivateCateRoughdesign.interval_span_subset · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/TSharpIntervalFrontier.lean:43

Simultaneous containment forces Lebesgue length even for unbounded codes. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
Delta :
ℝ
h0 :
0 ∈ c.toSet
h1 :
Delta ∈ c.toSet
ofReal Delta ≤ c.leb
Proof (Lean source)
-- @node: interval_leb_ge_span lemma interval_leb_ge_span (c : IntervalCode) (Delta : ℝ) (h0 : 0 ∈ c.toSet) (h1 : Delta ∈ c.toSet) : ofReal Delta ≤ c.leb := by have h := measure_mono (μ := (volume : Measure ℝ)) (interval_span_subset c 0 Delta h0 h1) simpa [IntervalCode.leb, Real.volume_Ioo] using h
CausalSmith.Stat.PrivateCateRoughdesign.interval_leb_ge_span · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/TSharpIntervalFrontier.lean:63
theorem finite_prior_coverage_lower

A finite class prior inherits honesty at its common target. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n s :
ℕ
F :
hs :
0 < s
target :
ℝ
hF :
∀ i, CompleteModel (F i) ∧ theta (F i) = target
hhonest :
∀ P
then
9 / 10 ≤ coverage n I P
9 / 10 ≤ (I ∘ₘ finiteProductMixture n s F).real {c | target ∈ c.toSet}
Proof (Lean source)
-- @node: finite_prior_coverage_lower lemma finite_prior_coverage_lower (n s : ℕ) (F : Fin s → CausalLaw) (hs : 0 < s) (I : Kernel (Dataset n) IntervalCode) [IsMarkovKernel I] (target : ℝ) (hF : ∀ i, CompleteModel (F i) ∧ theta (F i) = target) (hhonest : ∀ P, CompleteModel P → 9 / 10 ≤ coverage n I P) : 9 / 10 ≤ (I ∘ₘ finiteProductMixture n s F).real {c | target ∈ c.toSet} := by let : IsProbabilityMeasure (finiteProductMixture n s F) := finiteProductMixture_probability n s F hs have hmass : ofReal (9 / 10 : ℝ) ≤ (I ∘ₘ finiteProductMixture n s F) {c | target ∈ c.toSet} := by rw [finiteProductMixture, Measure.comp_smul, prior_comp_finsetSum, Measure.smul_apply, smul_eq_mul, Measure.finsetSum_apply] have hrow : ∀ i : Fin s, ofReal (9 / 10 : ℝ) ≤ (I ∘ₘ dataLaw n (F i)) {c | target ∈ c.toSet} := by intro i let : IsProbabilityMeasure (Pobs (F i)) := Measure.isProbabilityMeasure_map measurable_observe.aemeasurable let : IsProbabilityMeasure (dataLaw n (F i)) := by unfold dataLaw; infer_instance have hc := hhonest (F i) (hF i).1 unfold coverage at hc rw [(hF i).2] at hc rw [← ENNReal.ofReal_toReal (measure_ne_top (I ∘ₘ dataLaw n (F i)) _)] exact ENNReal.ofReal_le_ofReal hc calc _ = (s : ℝ≥0∞)⁻¹ * ∑ _i : Fin s, ofReal (9 / 10 : ℝ) := by simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] rw [← mul_assoc, ENNReal.inv_mul_cancel (by exact_mod_cast (Nat.ne_of_gt hs)) (by simp), one_mul] _ ≤ _ := mul_le_mul_of_nonneg_left (Finset.sum_le_sum fun i _ => hrow i) (zero_le) exact (ENNReal.ofReal_le_iff_le_toReal (measure_ne_top _ _)).mp hmass
CausalSmith.Stat.PrivateCateRoughdesign.finite_prior_coverage_lower · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/TSharpIntervalFrontier.lean:72
theorem finite_prior_length_le_worstLength

Prior expected length is no greater than maximal class expected length. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n s :
ℕ
F :
hs :
0 < s
hF :
∀ i, CompleteModel (F i)
(∫⁻ c, c.leb ∂(I ∘ₘ finiteProductMixture n s F)) ≤ worstLength n I
Proof (Lean source)
-- @node: finite_prior_length_le_worstLength lemma finite_prior_length_le_worstLength (n s : ℕ) (F : Fin s → CausalLaw) (hs : 0 < s) (I : Kernel (Dataset n) IntervalCode) (hF : ∀ i, CompleteModel (F i)) : (∫⁻ c, c.leb ∂(I ∘ₘ finiteProductMixture n s F)) ≤ worstLength n I := by rw [finiteProductMixture, Measure.comp_smul, prior_comp_finsetSum, lintegral_smul_measure, lintegral_finsetSum_measure] have hbound : ∀ i : Fin s, (∫⁻ c, c.leb ∂(I ∘ₘ dataLaw n (F i))) ≤ worstLength n I := fun i => le_iSup_of_le (F i) (le_iSup_of_le (hF i) le_rfl) calc _ ≤ (s : ℝ≥0∞)⁻¹ * ∑ _i : Fin s, worstLength n I := mul_le_mul_of_nonneg_left (Finset.sum_le_sum fun i _ => hbound i) (zero_le) _ = worstLength n I := by simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] rw [← mul_assoc, ENNReal.inv_mul_cancel (by exact_mod_cast (Nat.ne_of_gt hs)) (by simp), one_mul]
CausalSmith.Stat.PrivateCateRoughdesign.finite_prior_length_le_worstLength · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/TSharpIntervalFrontier.lean:104
theorem finite_priors_interval_lower

Two honest finite priors force simultaneous containment under the null output law. the theorem's stated inputs and assumptions, and the asserted conclusion follows. the theorem's stated inputs and assumptions.

Formal statement
n s0 s1 :
ℕ
F0 :
Fin s0 → CausalLaw
F1 :
Fin s1 → CausalLaw
hs0 :
0 < s0
hs1 :
0 < s1
Delta :
ℝ
hd :
0 ≤ Delta
hF0 :
∀ i, CompleteModel (F0 i) ∧ theta (F0 i) = 0
hF1 :
∀ i, CompleteModel (F1 i) ∧ theta (F1 i) = Delta
hhonest :
∀ P
then
9 / 10 ≤ coverage n I P
htv :
TV (I ∘ₘ finiteProductMixture n s0 F0) (I ∘ₘ finiteProductMixture n s1 F1) ≤ 1 / 4
ofReal ((11 / 20) * Delta) ≤ worstLength n I
Proof (Lean source)
-- @node: finite_priors_interval_lower lemma finite_priors_interval_lower (n s0 s1 : ℕ) (F0 : Fin s0 → CausalLaw) (F1 : Fin s1 → CausalLaw) (hs0 : 0 < s0) (hs1 : 0 < s1) (I : Kernel (Dataset n) IntervalCode) [IsMarkovKernel I] (Delta : ℝ) (hd : 0 ≤ Delta) (hF0 : ∀ i, CompleteModel (F0 i) ∧ theta (F0 i) = 0) (hF1 : ∀ i, CompleteModel (F1 i) ∧ theta (F1 i) = Delta) (hhonest : ∀ P, CompleteModel P → 9 / 10 ≤ coverage n I P) (htv : TV (I ∘ₘ finiteProductMixture n s0 F0) (I ∘ₘ finiteProductMixture n s1 F1) ≤ 1 / 4) : ofReal ((11 / 20) * Delta) ≤ worstLength n I := by let L0 := I ∘ₘ finiteProductMixture n s0 F0 let L1 := I ∘ₘ finiteProductMixture n s1 F1 let : IsProbabilityMeasure (finiteProductMixture n s0 F0) := finiteProductMixture_probability n s0 F0 hs0 let : IsProbabilityMeasure (finiteProductMixture n s1 F1) := finiteProductMixture_probability n s1 F1 hs1 let E0 : Set IntervalCode := {c | 0 ∈ c.toSet} let E1 : Set IntervalCode := {c | Delta ∈ c.toSet} have hm0 : MeasurableSet E0 := measurableSet_interval_contains 0 have hm1 : MeasurableSet E1 := measurableSet_interval_contains Delta have hc0 : 9 / 10 ≤ L0.real E0 := finite_prior_coverage_lower n s0 F0 hs0 I 0 hF0 hhonest have hc1 : 9 / 10 ≤ L1.real E1 := finite_prior_coverage_lower n s1 F1 hs1 I Delta hF1 hhonest have hgap := measureReal_sub_le_tvDist (μ := L0) (ν := L1) hm1 change TV L0 L1 ≤ 1 / 4 at htv have hboth : 11 / 20 ≤ L0.real (E0 ∩ E1) := by have hu := measureReal_union_add_inter (μ := L0) (s := E0) hm1 have hb : L0.real (E0 ∪ E1) ≤ 1 := measureReal_le_one linarith have hmass : ofReal (11 / 20 : ℝ) ≤ L0 (E0 ∩ E1) := by rw [← ENNReal.ofReal_toReal (measure_ne_top L0 _)] exact ENNReal.ofReal_le_ofReal hboth have hind : (∫⁻ c, (E0 ∩ E1).indicator (fun _ => ofReal Delta) c ∂L0) = ofReal Delta * L0 (E0 ∩ E1) := by rw [lintegral_indicator (hm0.inter hm1)] simp calc _ = ofReal Delta * ofReal (11 / 20 : ℝ) := by rw [← ENNReal.ofReal_mul hd] congr 1 ring _ ≤ ofReal Delta * L0 (E0 ∩ E1) := mul_le_mul_of_nonneg_left hmass (zero_le) _ = ∫⁻ c, (E0 ∩ E1).indicator (fun _ => ofReal Delta) c ∂L0 := hind.symm _ ≤ ∫⁻ c, c.leb ∂L0 := by apply lintegral_mono intro c by_cases hc : c ∈ E0 ∩ E1 · rw [Set.indicator_of_mem hc] exact interval_leb_ge_span c Delta hc.1 hc.2 · rw [Set.indicator_of_notMem hc] exact zero_le _ ≤ worstLength n I := finite_prior_length_le_worstLength n s0 F0 hs0 I (fun i => (hF0 i).1)
CausalSmith.Stat.PrivateCateRoughdesign.finite_priors_interval_lower · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/TSharpIntervalFrontier.lean:122
theorem sharp_interval_frontier

The explicit inversion kernel equals the conservative tuned interval and attains honest coverage and optimal maximal expected length. The scalar and interval frontiers are uniformly comparable with the stated numerical constants. The public parameters and their domains and the Efron--Stein gate, bounded-differences gate, and Cayley gate specify the conditional scope.

Formal statement
efronStein_of_gate :
boundedDifferences_of_gate :
cayley_of_gate :
n :
ℕ
epsilon :
ℝ
hn :
2 ≤ n
he :
0 < epsilon ∧ epsilon ≤ 1
conclusion 1
ell n epsilon = rate n epsilon
conclusion 2
cI = (2 : ℝ)^(-20 : ℤ)
conclusion 3
CI = (2 : ℝ)^22
conclusion 4
0 < ell n epsilon
conclusion 5
0 < cI
conclusion 6
0 < CI
conclusion 7
conclusion 8
conclusion 9
PrivateKernel n epsilon (optimalIntervalHandle n epsilon)
conclusion 10
ofReal ((2 : ℝ)^(-20 : ℤ)*rate n epsilon) ≤ privateHonestLength n epsilon
conclusion 11
conclusion 12
worstLength n (optimalIntervalHandle n epsilon) ≤ ofReal (2^22*rate n epsilon)
conclusion 13
9/10 ≤ coverage n (optimalIntervalHandle n epsilon) P
conclusion 14
ofReal ((2 : ℝ)^(-38 : ℤ))*privateMinimaxRisk n epsilon
≤ privateHonestLength n epsilon
conclusion 15
privateHonestLength n epsilon ≤ ofReal (2^42)*privateMinimaxRisk n epsilon
Proof (Lean source)
-- @node: thm:sharp-interval-frontier theorem sharp_interval_frontier (efronStein_of_gate : EfronSteinReplacement) (boundedDifferences_of_gate : BoundedDifferencesMGF) (cayley_of_gate : CayleyLabeledTreeCount) (n : ℕ) (epsilon : ℝ) (hn : 2 ≤ n) (he : 0 < epsilon ∧ epsilon ≤ 1) : ell n epsilon = rate n epsilon ∧ cI = (2 : ℝ)^(-20 : ℤ) ∧ CI = (2 : ℝ)^22 ∧ 0 < ell n epsilon ∧ 0 < cI ∧ 0 < CI ∧ optimalIntervalHandle n epsilon = publicTunedInterval n epsilon ∧ IsMarkovKernel (optimalIntervalHandle n epsilon) ∧ PrivateKernel n epsilon (optimalIntervalHandle n epsilon) ∧ ofReal ((2 : ℝ)^(-20 : ℤ)*rate n epsilon) ≤ privateHonestLength n epsilon ∧ privateHonestLength n epsilon ≤ worstLength n (optimalIntervalHandle n epsilon) ∧ worstLength n (optimalIntervalHandle n epsilon) ≤ ofReal (2^22*rate n epsilon) ∧ (∀ P, CompleteModel P → 9/10 ≤ coverage n (optimalIntervalHandle n epsilon) P) ∧ ofReal ((2 : ℝ)^(-38 : ℤ))*privateMinimaxRisk n epsilon ≤ privateHonestLength n epsilon ∧ privateHonestLength n epsilon ≤ ofReal (2^42)*privateMinimaxRisk n epsilon := by have hr : 0 < rate n epsilon := rate_pos n epsilon (by omega) have hhandle := optimalIntervalHandle_eq_publicTunedInterval n epsilon hn he obtain ⟨s0, s1, F0, F1, Delta, hs0, hs1, hd, hF0, hF1, _, htv⟩ := frontier_testing_priors boundedDifferences_of_gate cayley_of_gate n epsilon hn he have hd0 : 0 ≤ Delta := le_trans (by positivity) hd have hlower : ofReal ((2 : ℝ)^(-20 : ℤ) * rate n epsilon) ≤ privateHonestLength n epsilon := by unfold privateHonestLength refine le_iInf fun I => le_iInf fun hI => ?_ let : IsMarkovKernel I := hI.1 have htest := finite_priors_interval_lower n s0 s1 F0 F1 hs0 hs1 I Delta hd0 hF0 hF1 hI.2.2 (htv IntervalCode I hI.2.1) apply le_trans (ENNReal.ofReal_le_ofReal ?_) htest have hscale : (2 : ℝ)^(-20 : ℤ) ≤ (11 / 20) * (2 : ℝ)^(-14 : ℤ) := by norm_num calc _ ≤ ((11 / 20) * (2 : ℝ)^(-14 : ℤ)) * rate n epsilon := mul_le_mul_of_nonneg_right hscale hr.le _ = (11 / 20) * ((2 : ℝ)^(-14 : ℤ) * rate n epsilon) := by ring _ ≤ (11 / 20) * Delta := mul_le_mul_of_nonneg_left hd (by norm_num) obtain ⟨_, _, _, _, _, _, _, _, _, hmarkov, hprivate, _, hlength, hcoverage⟩ := uniform_private_upper efronStein_of_gate n 2 epsilon (1 / 4) hn (by omega) he ⟨by norm_num, le_rfl⟩ have hfeasible : privateHonestLength n epsilon ≤ worstLength n (publicTunedInterval n epsilon) := iInf_le_of_le (publicTunedInterval n epsilon) (iInf_le_of_le ⟨hmarkov, hprivate, hcoverage⟩ le_rfl) have hfront := matched_risk_frontier efronStein_of_gate boundedDifferences_of_gate cayley_of_gate n epsilon hn he have hcompareLower : ofReal ((2 : ℝ)^(-38 : ℤ)) * privateMinimaxRisk n epsilon ≤ privateHonestLength n epsilon := by calc _ ≤ ofReal ((2 : ℝ)^(-38 : ℤ)) * ofReal (2^18 * rate n epsilon) := mul_le_mul_of_nonneg_left hfront.2.1 (zero_le) _ = ofReal ((2 : ℝ)^(-20 : ℤ) * rate n epsilon) := by rw [← ENNReal.ofReal_mul (by positivity)] congr 1 norm_num ring _ ≤ _ := hlower have hcompareUpper : privateHonestLength n epsilon ≤ ofReal (2^42) * privateMinimaxRisk n epsilon := by calc _ ≤ ofReal (2^22 * rate n epsilon) := hfeasible.trans hlength _ = ofReal (2^42 : ℝ) * ofReal ((2 : ℝ)^(-20 : ℤ) * rate n epsilon) := by rw [← ENNReal.ofReal_mul (by positivity)] congr 1 norm_num ring _ ≤ _ := mul_le_mul_of_nonneg_left hfront.1 (zero_le) rw [hhandle] exact ⟨rfl, rfl, rfl, hr, by norm_num [cI], by norm_num [CI], rfl, hmarkov, hprivate, hlower, hfeasible, hlength, hcoverage, hcompareLower, hcompareUpper⟩
CausalSmith.Stat.PrivateCateRoughdesign.sharp_interval_frontier · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/TSharpIntervalFrontier.lean:180
CausalSmith.Stat.STAT_PrivateCateRoughdesignFrontier_Research.TUniformPrivateUpper 1 declarations Assembly of the uniform private scalar-risk, coverage and length guarantees.

Assembly of the uniform private scalar-risk, coverage and length guarantees.

theorem uniform_private_upper

The constructed kernels are Markov and pure private on every input. Their second moments, coverage and interval lengths obey the public envelopes throughout the complete model, and public tuning attains the stated scalar-risk and interval-length constants. The public parameters and their domains and published substrate gates specify the conditional scope.

Formal statement
efronStein_of_gate :
n k :
ℕ
epsilon h :
ℝ
hn :
2 ≤ n
@realizes n(sample size at least two)
hk :
2 ≤ k
@realizes k(cell count at least two)
he :
0 < epsilon ∧ epsilon ≤ 1
@realizes epsilon(budget in (0,1])
hh :
0 < h ∧ h ≤ 1 / 4
conclusion 1
conclusion 2
PrivateKernel n epsilon (privateRatioRelease n epsilon h k)
conclusion 3
IsMarkovKernel (Thk n epsilon h k)
conclusion 4
PrivateKernel n epsilon (Thk n epsilon h k)
conclusion 5
IsMarkovKernel (Ihk n epsilon h k)
conclusion 6
PrivateKernel n epsilon (Ihk n epsilon h k)
conclusion 7
(∫⁻ u, ofReal ((u-theta P)^2) ∂(Thk n epsilon h k ∘ₘ dataLaw n P))
≤ ofReal (Vbound n epsilon h k)
9/10 ≤ coverage n (Ihk n epsilon h k) P
expectedLength n (Ihk n epsilon h k) P
≤ ofReal (min 2 (2*sqrt (10*Vbound n epsilon h k)))
conclusion 8
conclusion 9
PrivateKernel n epsilon (publicTunedRelease n epsilon)
conclusion 10
conclusion 11
PrivateKernel n epsilon (publicTunedInterval n epsilon)
conclusion 12
worstRisk n (publicTunedRelease n epsilon) ≤ ofReal (2^18*rate n epsilon)
conclusion 13
worstLength n (publicTunedInterval n epsilon) ≤ ofReal (2^22*rate n epsilon)
conclusion 14
9/10 ≤ coverage n (publicTunedInterval n epsilon) P
Proof (Lean source)
-- @node: thm:uniform-private-upper theorem uniform_private_upper (efronStein_of_gate : EfronSteinReplacement) (n k : ℕ) (epsilon h : ℝ) (hn : 2 ≤ n) -- @realizes n(sample size at least two) (hk : 2 ≤ k) -- @realizes k(cell count at least two) (he : 0 < epsilon ∧ epsilon ≤ 1) -- @realizes epsilon(budget in (0,1]) (hh : 0 < h ∧ h ≤ 1 / 4) : -- @realizes h(radius in (0,1/4]) IsMarkovKernel (privateRatioRelease n epsilon h k) ∧ PrivateKernel n epsilon (privateRatioRelease n epsilon h k) ∧ IsMarkovKernel (Thk n epsilon h k) ∧ PrivateKernel n epsilon (Thk n epsilon h k) ∧ IsMarkovKernel (Ihk n epsilon h k) ∧ PrivateKernel n epsilon (Ihk n epsilon h k) ∧ (∀ P : CausalLaw, CompleteModel P → (∫⁻ u, ofReal ((u-theta P)^2) ∂(Thk n epsilon h k ∘ₘ dataLaw n P)) ≤ ofReal (Vbound n epsilon h k) ∧ 9/10 ≤ coverage n (Ihk n epsilon h k) P ∧ expectedLength n (Ihk n epsilon h k) P ≤ ofReal (min 2 (2*sqrt (10*Vbound n epsilon h k)))) ∧ IsMarkovKernel (publicTunedRelease n epsilon) ∧ PrivateKernel n epsilon (publicTunedRelease n epsilon) ∧ IsMarkovKernel (publicTunedInterval n epsilon) ∧ PrivateKernel n epsilon (publicTunedInterval n epsilon) ∧ worstRisk n (publicTunedRelease n epsilon) ≤ ofReal (2^18*rate n epsilon) ∧ worstLength n (publicTunedInterval n epsilon) ≤ ofReal (2^22*rate n epsilon) ∧ (∀ P, CompleteModel P → 9/10 ≤ coverage n (publicTunedInterval n epsilon) P) := by have hpair := privateRatioRelease_private n k epsilon h he.1 hh.1 (by omega) have hscalar := Thk_private n k epsilon h he.1 hh.1 (by omega) have hinterval := Ihk_private n k epsilon h he.1 hh.1 (by omega) refine ⟨hpair.markov, hpair, hscalar.markov, hscalar, hinterval.markov, hinterval, ?_⟩ have htuned := publicTunedRelease_private n epsilon hn he have htunedInterval := publicTunedInterval_private n epsilon hn he suffices hstats : ∀ (k' : ℕ) (h' : ℝ), 2 ≤ k' → (0 < h' ∧ h' ≤ 1/4) → ∀ P : CausalLaw, CompleteModel P → (∫⁻ u, ofReal ((u-theta P)^2) ∂(Thk n epsilon h' k' ∘ₘ dataLaw n P)) ≤ ofReal (Vbound n epsilon h' k') by refine ⟨?_, htuned.markov, htuned, htunedInterval.markov, htunedInterval, publicTunedRelease_worstRisk_of_squared_error_le n epsilon hn he hstats, publicTunedInterval_worstLength_le n epsilon hn he, ?_⟩ · intro P hP have hmse := hstats k h hk hh P hP exact ⟨hmse, Ihk_coverage_of_squared_error_le n k epsilon h (by omega) (by omega) he.1 hh.1 P hP hmse, Ihk_expectedLength_le n k epsilon h he.1 P⟩ · intro P hP apply publicTunedInterval_coverage_of_squared_error_le n epsilon hn he P hP intro hr have hp := public_tuning_parameters n epsilon hn he hr exact hstats _ _ hp.2.2.1 ⟨hp.1, hp.2.1⟩ P hP intro k' h' hk' hh' P hP exact Thk_model_squared_error_le efronStein_of_gate n k' epsilon h' hn hk' he.1 hh' P hP
CausalSmith.Stat.PrivateCateRoughdesign.uniform_private_upper · CausalSmith/Stat/STAT_PrivateCateRoughdesignFrontier_Research/TUniformPrivateUpper.lean:9