Formalization: Quotient-law Inference with Latent Treatment-effect Collisions

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_ProxyEffectlawEigencollisionFrontier_Research.Basic 86 declarations Core carriers, model assumptions, observable summaries, and finite-product sampling laws for the proxy effect-law collision frontier.

Core carriers, model assumptions, observable summaries, and finite-product sampling laws for the proxy effect-law collision frontier.

One full-data record. It uses the supplied parameters.

Definition (Lean source)
k dx dz :
U :
Fin k
T :
X :
Fin dx → ℝ
Z :
Fin dz → ℝ
Y0 :
Y1 :
Y :
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.FullData · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:18

One observed record. It uses the supplied parameters.

Definition (Lean source)
dx dz :
T :
X :
Fin dx → ℝ
Z :
Fin dz → ℝ
Y :
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.Obs · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:28
def toCoordinates

For the supplied parameters, to Coordinates is given by its defining clause.

Definition (Lean source)
k dx dz :
w :
FullData k dx dz
toCoordinates w :
Fin k × Bool × (Fin dx → ℝ) × (Fin dz → ℝ) × ℝ × ℝ × ℝ
(w.U, w.T, w.X, w.Z, w.Y0, w.Y1, w.Y)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.FullData.toCoordinates · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:35
def toCoordinates

For the supplied parameters, to Coordinates is given by its defining clause.

Definition (Lean source)
dx dz :
o :
Obs dx dz
toCoordinates o :
Bool × (Fin dx → ℝ) × (Fin dz → ℝ) × ℝ
(o.T, o.X, o.Z, o.Y)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.Obs.toCoordinates · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:39
instance instTopologicalSpaceFullData

For the ambient setting, the stated instance is given by its defining clause.

Definition (Lean source)
instance {k dx dz} : TopologicalSpace (FullData k dx dz) := TopologicalSpace.induced FullData.toCoordinates inferInstance
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.instTopologicalSpaceFullData · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:42
instance instMeasurableSpaceFullData

Standard product Borel structure on the full-data real coordinates and finite coordinates. For the ambient setting, the defined object is given by its defining clause.

Definition (Lean source)
instance {k dx dz} : MeasurableSpace (FullData k dx dz) := comap FullData.toCoordinates inferInstance
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.instMeasurableSpaceFullData · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:46
instance instBorelSpaceFullData

For the ambient setting, the stated instance is given by its defining clause.

Definition (Lean source)
instance {k dx dz} : BorelSpace (FullData k dx dz) := by constructor change comap FullData.toCoordinates inferInstance = _ rw [borel_comap] congr 1 exact BorelSpace.measurable_eq
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.instBorelSpaceFullData · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:50
instance instMeasurableSingletonClassFullData

Single full-data records are measurable in the induced product Borel structure. For the ambient setting, the defined object is given by its defining clause.

Definition (Lean source)
-- @node: instMeasurableSingletonClassFullData instance {k dx dz} : MeasurableSingletonClass (FullData k dx dz) := ⟨fun w => by change @MeasurableSet (FullData k dx dz) (comap FullData.toCoordinates inferInstance) {w} rw [MeasurableSpace.measurableSet_comap] refine ⟨{FullData.toCoordinates w}, measurableSet_singleton _, ?_⟩ ext x simp only [Set.mem_preimage, Set.mem_singleton_iff] constructor · intro h cases x cases w simp_all [FullData.toCoordinates] · exact fun h => congrArg FullData.toCoordinates h⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.instMeasurableSingletonClassFullData · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:58
instance instTopologicalSpaceObs

For the ambient setting, the stated instance is given by its defining clause.

Definition (Lean source)
instance {dx dz} : TopologicalSpace (Obs dx dz) := TopologicalSpace.induced Obs.toCoordinates inferInstance
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.instTopologicalSpaceObs · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:74
instance instMeasurableSpaceObs

Standard product Borel structure on the observed real coordinates and binary treatment. For the ambient setting, the defined object is given by its defining clause.

Definition (Lean source)
instance {dx dz} : MeasurableSpace (Obs dx dz) := comap Obs.toCoordinates inferInstance
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.instMeasurableSpaceObs · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:78
instance instBorelSpaceObs

For the ambient setting, the stated instance is given by its defining clause.

Definition (Lean source)
instance {dx dz} : BorelSpace (Obs dx dz) := by constructor change comap Obs.toCoordinates inferInstance = _ rw [borel_comap] congr 1 exact BorelSpace.measurable_eq
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.instBorelSpaceObs · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:82

Generic probability-law carrier on a measurable space. Model membership is deliberately consumer-local rather than part of this carrier. It uses the ambient setting. It uses the ambient setting. It uses the ambient setting. It uses the ambient setting. It uses the ambient setting. It uses the ambient setting. It uses the ambient setting.

Definition (Lean source)
α :
measure :
prob :
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.FullDataProbabilityLaw · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:90
def obsMap

Observed-coordinate map. @realizes OO(tuple T,X,Z,Y) For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz :
w :
FullData k dx dz
obsMap w :
Obs dx dz
⟨w.T, w.X, w.Z, w.Y⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.obsMap · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:96
theorem obsMap_measurable

Obs map measurable: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
Measurable (@obsMap k dx dz)
Proof (Lean source)
lemma obsMap_measurable (k dx dz : ℕ) : Measurable (@obsMap k dx dz) := by rw [measurable_comap_iff] apply Measurable.of_comap_le change comap (Obs.toCoordinates ∘ obsMap) inferInstancecomap FullData.toCoordinates inferInstance apply MeasurableSpace.comap_le_comap_of_eq_comp (fun x => (x.2.1, x.2.2.1, x.2.2.2.1, x.2.2.2.2.2.2)) · fun_prop · rfl
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.obsMap_measurable · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:100

The observed margin of a full-data law. @realizes POP_O(pushforward along O) For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz :
obsLaw P :
Measure (Obs dx dz)
P.map obsMap
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.obsLaw · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:111
instance obsLaw_isProbabilityMeasure

For the supplied parameters, obs Law is Probability Measure is given by its defining clause.

Definition (Lean source)
instance obsLaw_isProbabilityMeasure {k dx dz : ℕ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] : IsProbabilityMeasure (obsLaw P) := by exact Measure.isProbabilityMeasure_map (obsMap_measurable k dx dz).aemeasurable
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.obsLaw_isProbabilityMeasure · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:116

Finite observed iid product law. @realizes QP(n)Q_P^{(n)}(P_O tensor n) For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz n :
sampleLaw P :
Measure (Fin n → Obs dx dz)
Measure.pi (fun _ : Fin n => obsLaw P)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.sampleLaw · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:122
instance sampleLaw_isProbabilityMeasure

For the supplied parameters, sample Law is Probability Measure is given by its defining clause.

Definition (Lean source)
instance sampleLaw_isProbabilityMeasure {k dx dz n : ℕ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] : IsProbabilityMeasure (sampleLaw (n := n) P) := by exact Measure.pi.instIsProbabilityMeasure (fun _ : Fin n => obsLaw P)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.sampleLaw_isProbabilityMeasure · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:127
def potential

For the supplied parameters, potential is given by its defining clause.

Definition (Lean source)
k dx dz :
t :
w :
FullData k dx dz
potential t w :
if t then w.Y1 else w.Y0
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.potential · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:133
def latentCell

For the supplied parameters, latent Cell is given by its defining clause.

Definition (Lean source)
k dx dz :
u :
Fin k
t :
latentCell u t :
Set (FullData k dx dz)
{w | w.U = u ∧ w.T = t}
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.latentCell · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:137
def latentClass

For the supplied parameters, latent Class is given by its defining clause.

Definition (Lean source)
k dx dz :
u :
Fin k
latentClass u :
Set (FullData k dx dz)
{w | w.U = u}
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.latentClass · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:141
def conditionalMean

For the supplied parameters, conditional Mean is given by its defining clause.

Definition (Lean source)
α :
P :
A :
Set α
f :
α → ℝ
conditionalMean P A f :
(P.real A)⁻¹ * (∫ x in A, f x ∂P)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.conditionalMean · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:144

Latent-class mass. @realizes pup_u(P(U=u)) For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz :
P :
Measure (FullData k dx dz)
u :
Fin k
latentMass P u :
P.real (latentClass u)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.latentMass · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:149

Conditional potential-outcome mean. @realizes μtu\mu_{tu}(E[Y(t)|U=u]) For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz :
P :
Measure (FullData k dx dz)
t :
u :
Fin k
latentMean P t u :
conditionalMean P (latentClass u) (potential t)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.latentMean · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:153

Latent-class effect. @realizes τu\tau_u(mu_1u-mu_0u) For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz :
P :
Measure (FullData k dx dz)
u :
Fin k
latentEffect P u :
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.latentEffect · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:157

Derived effect-support radius. @realizes LτL_{\tau}(4 L sqrt(dz)/sigma0) For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
dz :
L sigma0 :
effectRadius dz L sigma0 :
4 * L * sqrt dz / sigma0
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.effectRadius · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:161

Conditional reference-proxy feature matrix. @realizes AtA_t(cell conditional Z means) For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz :
P :
Measure (FullData k dx dz)
t :
referenceFeature P t :
fun i u => conditionalMean P (latentCell u t) (fun w => w.Z i)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.referenceFeature · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:165

Conditional target-proxy feature matrix. @realizes BB(class conditional X means) For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz :
P :
Measure (FullData k dx dz)
targetFeature P :
fun i u => conditionalMean P (latentClass u) (fun w => w.X i)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.targetFeature · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:170

First canonical target-proxy vector. @realizes e1e_1(first basis vector) For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
dx :
firstBasis dx :
Fin dx → ℝ
fun i => if i.val = 0 then 1 else 0
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.firstBasis · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:175

Fixed model-parameter domain used throughout the paper. The individual conjuncts are the load-bearing symbol-space realizations, rather than comments on an unrelated declaration. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz :
L pi0 sigma0 :
CoreParameterDomain k dx dz L pi0 sigma0 :
Prop
clause 1
2 ≤ k
clause 2
k ≤ dx
clause 3
k ≤ dz
clause 4
1 ≤ L
clause 5
0 < pi0
clause 6
pi0 ≤ 1 / (2 * k : ℝ)
clause 7
0 < sigma0
clause 8
sigma0 ≤ 1
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.CoreParameterDomain · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:178

Domain of the effect-separation scale used by labeled-coordinate results. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
g :
GapScaleDomain g :
Prop
clause 1
0 < g
clause 2
g ≤ 1 / 4
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.GapScaleDomain · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:187

A real-valued function with a finite uniform envelope. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
α :
Type*
f :
α → ℝ
UniformlyBounded f :
Prop
∃ B : ℝ, ∀ x, |f x| ≤ B
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.UniformlyBounded · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:204
def ReferenceProxySeparation Assumption 1 in the paper ↗

For the ambient setting, Reference Proxy Separation is given by its defining clause.

Definition (Lean source)
k :
shared
dx :
shared
dz :
shared
P :
Measure (FullData k dx dz)
shared
u :
Fin k
t :
f :
(Fin dz → ℝ) → ℝ
q :
((Fin dx → ℝ) × ℝ) → ℝ
UniformlyBounded f
UniformlyBounded q
ReferenceProxySeparation P :
Prop
conditionalMean P (latentCell u t) (fun w => f w.Z * q (w.X, w.Y))
= conditionalMean P (latentCell u t) (fun w => f w.Z) * conditionalMean P (latentCell u t) (fun w => q (w.X, w.Y))
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ReferenceProxySeparation · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:209
def TargetProxySeparation Assumption 2 in the paper ↗

For the ambient setting, Target Proxy Separation is given by its defining clause.

Definition (Lean source)
k :
shared
dx :
shared
dz :
shared
P :
Measure (FullData k dx dz)
shared
u :
Fin k
f :
(Fin dx → ℝ) → ℝ
q :
(ℝ × Bool) → ℝ
UniformlyBounded f
UniformlyBounded q
TargetProxySeparation P :
Prop
conditionalMean P (latentClass u) (fun w => f w.X * q (w.Y, w.T))
= conditionalMean P (latentClass u) (fun w => f w.X) * conditionalMean P (latentClass u) (fun w => q (w.Y, w.T))
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.TargetProxySeparation · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:219
def CausalConsistency Assumption 3 in the paper ↗

For the ambient setting, Causal Consistency is given by its defining clause.

Definition (Lean source)
k :
shared
dx :
shared
dz :
shared
P :
Measure (FullData k dx dz)
shared
CausalConsistency P :
Prop
∀ᵐ w ∂P, w.Y = potential w.T w
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.CausalConsistency · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:228
def ArmwiseLatentIgnorability Assumption 4 in the paper ↗

For the ambient setting, Armwise Latent Ignorability is given by its defining clause.

Definition (Lean source)
k :
shared
dx :
shared
dz :
shared
P :
Measure (FullData k dx dz)
shared
u :
Fin k
t :
f :
ℝ → ℝ
q :
Bool → ℝ
UniformlyBounded f
UniformlyBounded q
ArmwiseLatentIgnorability P :
Prop
conditionalMean P (latentClass u) (fun w => f (potential t w) * q w.T)
= conditionalMean P (latentClass u) (fun w => f (potential t w)) * conditionalMean P (latentClass u) (fun w => q w.T)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ArmwiseLatentIgnorability · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:232
def AnchorNormalization Assumption 5 in the paper ↗

For the ambient setting, Anchor Normalization is given by its defining clause.

Definition (Lean source)
k :
shared
dx :
shared
dz :
shared
P :
Measure (FullData k dx dz)
shared
AnchorNormalization P :
Prop
∀ᵐ w ∂P, ∀ i : Fin dx, i.val = 0 → w.X i = 1
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AnchorNormalization · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:241
def BoundedTargetProxy Assumption 6 in the paper ↗

For the ambient setting, Bounded Target Proxy is given by its defining clause.

Definition (Lean source)
k :
shared
dx :
shared
dz :
shared
L :
shared
P :
Measure (FullData k dx dz)
shared
BoundedTargetProxy P :
Prop
∀ᵐ w ∂P, sqrt (∑ i, (w.X i) ^ 2) ≤ L
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.BoundedTargetProxy · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:245
def outerProduct

For the supplied parameters, outer Product is given by its defining clause.

Definition (Lean source)
dx dz :
z :
Fin dz → ℝ
x :
Fin dx → ℝ
outerProduct z x :
fun i j => z i * x j
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.outerProduct · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:249
def BoundedProxyProduct Assumption 7 in the paper ↗

For the ambient setting, Bounded Proxy Product is given by its defining clause.

Definition (Lean source)
k :
shared
dx :
shared
dz :
shared
L :
shared
P :
Measure (FullData k dx dz)
shared
BoundedProxyProduct P :
Prop
∀ᵐ w ∂P, ‖matrixCLM (outerProduct w.Z w.X)‖ ≤ L
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.BoundedProxyProduct · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:254
def BoundedOutcomeProxyProduct Assumption 8 in the paper ↗

For the ambient setting, Bounded Outcome Proxy Product is given by its defining clause.

Definition (Lean source)
k :
shared
dx :
shared
dz :
shared
L :
shared
P :
Measure (FullData k dx dz)
shared
BoundedOutcomeProxyProduct P :
Prop
∀ᵐ w ∂P, ‖matrixCLM (w.Y • outerProduct w.Z w.X)‖ ≤ L
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.BoundedOutcomeProxyProduct · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:259
def LatentArmPositivity Assumption 9 in the paper ↗

For the ambient setting, Latent Arm Positivity is given by its defining clause.

Definition (Lean source)
k :
shared
dx :
shared
dz :
shared
pi0 :
shared
P :
Measure (FullData k dx dz)
shared
u t :
LatentArmPositivity P :
Prop
pi0 ≤ P.real (latentCell u t)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.LatentArmPositivity · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:264

For the ambient setting, Proxy Rank Margin is given by its defining clause.

Definition (Lean source)
k :
shared
dx :
shared
dz :
shared
sigma0 :
shared
P :
Measure (FullData k dx dz)
shared
ProxyRankMargin P :
Prop
clause 2
clause 3
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ProxyRankMargin · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:268
structure UCVMWModel

The uniformly conditioned causal VMW submodel. @realizes M\mathcal M(ten model fields) It uses the supplied parameters.

Definition (Lean source)
k :
shared
dx :
shared
dz :
shared
L :
shared
pi0 :
shared
sigma0 :
shared
coreDomain :
CoreParameterDomain k dx dz L pi0 sigma0
referenceProxySeparation :
targetProxySeparation :
consistency :
latentIgnorability :
anchor :
boundedX :
boundedProxyProduct :
boundedOutcomeProxyProduct :
latentArmPositivity :
LatentArmPositivity (pi0 := pi0) P
proxyRankMargin :
ProxyRankMargin (sigma0 := sigma0) P
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.UCVMWModel · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:274

Smallest positive pairwise effect gap, with for a singleton support. @realizes δ(P)\delta(P)(nearest positive effect gap) For the ambient setting, the defined object is given by its defining clause.

Definition (Lean source)
k :
shared
dx :
shared
dz :
shared
P :
Measure (FullData k dx dz)
shared
effectGap P :
sInf {d : EReal | ∃ u v : Fin k, 0 < latentMass P u ∧ 0 < latentMass P v ∧ latentEffect P u ≠ latentEffect P v ∧ d = |latentEffect P u - latentEffect P v|}
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.effectGap · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:289

For the supplied parameters, Gap Window is given by its defining clause.

Definition (Lean source)
k :
shared
dx :
shared
dz :
shared
g :
shared
P :
Measure (FullData k dx dz)
shared
GapWindow P :
Prop
clause 1
(g / 2 : EReal) ≤ effectGap P
clause 2
effectGap P ≤ (2 * g : ℝ)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.GapWindow · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:297

For the ambient setting, Distinct Effects is given by its defining clause.

Definition (Lean source)
k :
shared
dx :
shared
dz :
shared
P :
Measure (FullData k dx dz)
shared
DistinctEffects P :
Prop
((Finset.univ.filter fun u => 0 < latentMass P u).image (latentEffect P)).card = k
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.DistinctEffects · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:301
structure GapStratum

Gap-localized model membership. @realizes M(g)\mathcal M(g)(model plus gap shell) It uses the supplied parameters.

Definition (Lean source)
k :
shared
dx :
shared
dz :
shared
L :
shared
pi0 :
shared
sigma0 :
shared
g :
shared
gapDomain :
gapWindow :
GapWindow (g := g) P
distinctEffects :
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.GapStratum · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:305

Five-block observable summary space. It uses the supplied parameters.

Definition (Lean source)
dx dz :
M0 :
M1 :
N0 :
N1 :
mX :
Fin dx → ℝ
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.SummarySpace · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:313
instance instZeroSummarySpace

For the ambient setting, the stated instance is given by its defining clause.

Definition (Lean source)
instance {dx dz} : Zero (SummarySpace dx dz) := ⟨⟨0, 0, 0, 0, 0⟩⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.instZeroSummarySpace · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:321
def SummaryCoordinates

For target- and reference-proxy dimensions, summary coordinates collect the four observable moment matrices and the target-proxy mean vector.

Definition (Lean source)
dx dz :
SummaryCoordinates dx dz :
Type
RectMatrix dz dx × RectMatrix dz dx × RectMatrix dz dx × RectMatrix dz dx × (Fin dx → ℝ)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.SummaryCoordinates · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:325
def toCoordinates

For the supplied parameters, to Coordinates is given by its defining clause.

Definition (Lean source)
dx dz :
s :
toCoordinates s :
(s.M0, s.M1, s.N0, s.N1, s.mX)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.SummarySpace.toCoordinates · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:329
instance instTopologicalSpaceSummarySpace

For the ambient setting, the stated instance is given by its defining clause.

Definition (Lean source)
instance {dx dz} : TopologicalSpace (SummarySpace dx dz) := TopologicalSpace.induced SummarySpace.toCoordinates inferInstance
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.instTopologicalSpaceSummarySpace · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:333
instance instMeasurableSpaceSummarySpace

For the ambient setting, the stated instance is given by its defining clause.

Definition (Lean source)
instance {dx dz} : MeasurableSpace (SummarySpace dx dz) := borel (SummarySpace dx dz)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.instMeasurableSpaceSummarySpace · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:337
instance instBorelSpaceSummarySpace

For the ambient setting, the stated instance is given by its defining clause.

Definition (Lean source)
instance {dx dz} : BorelSpace (SummarySpace dx dz) := by constructor rfl
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.instBorelSpaceSummarySpace · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:341
def obsArm

For the supplied parameters, obs Arm is given by its defining clause.

Definition (Lean source)
dx dz :
t :
obsArm t :
Set (Obs dx dz)
{o | o.T = t}
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.obsArm · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:346

Population observable moment summary. @realizes Mt(P)M_t(P)(armwise ZX moment) @realizes Nt(P)N_t(P)(armwise YZX moment) @realizes mX(P)m_X(P)(unconditional X mean) @realizes S(P)S(P)(five-block tuple) For the ambient setting, the defined object is given by its defining clause.

Definition (Lean source)
k :
shared
dx :
shared
dz :
shared
P :
Measure (FullData k dx dz)
shared
obsSummary P :
clause 1
M0 i j := conditionalMean (obsLaw P) (obsArm false) (fun o => o.Z i * o.X j)
clause 2
M1 i j := conditionalMean (obsLaw P) (obsArm true) (fun o => o.Z i * o.X j)
clause 3
N0 i j := conditionalMean (obsLaw P) (obsArm false) (fun o => o.Y * o.Z i * o.X j)
clause 4
N1 i j := conditionalMean (obsLaw P) (obsArm true) (fun o => o.Y * o.Z i * o.X j)
clause 5
mX j := (∫ o, o.X j ∂obsLaw P)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.obsSummary · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:349

Sum of four operator norms and the Euclidean mean norm. @realizes dSd_S(summary metric) For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
dx dz :
s q :
dS s q :
‖matrixCLM (s.M0 - q.M0)‖
+ ‖matrixCLM (s.M1 - q.M1)‖
+ ‖matrixCLM (s.N0 - q.N0)‖
+ ‖matrixCLM (s.N1 - q.N1)‖
+ sqrt (∑ i, (s.mX i - q.mX i) ^ 2)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.dS · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:359
theorem dS_symm

The summary loss is symmetric. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx dz :
s q :
dS s q = dS q s
Proof (Lean source)
-- @node: dS_symm lemma dS_symm {dx dz : ℕ} (s q : SummarySpace dx dz) : dS s q = dS q s := by unfold dS have block (A B : RectMatrix dz dx) : ‖matrixCLM (A - B)‖ = ‖matrixCLM (B - A)‖ := by have heq : matrixCLM (A - B) = -(matrixCLM (B - A)) := by ext x i simp [matrixCLM, Matrix.toEuclideanLin_apply] rw [heq, norm_neg] rw [block s.M0 q.M0, block s.M1 q.M1, block s.N0 q.N0, block s.N1 q.N1] congr 1 apply congrArg sqrt apply Finset.sum_congr rfl intro i _ ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.dS_symm · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:365
theorem dS_triangle

The summary loss obeys the triangle inequality. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx dz :
a b c :
dS a c ≤ dS a b + dS b c
Proof (Lean source)
-- @node: dS_triangle lemma dS_triangle {dx dz : ℕ} (a b c : SummarySpace dx dz) : dS a c ≤ dS a b + dS b c := by unfold dS have block (A B C : RectMatrix dz dx) : ‖matrixCLM (A - C)‖ ≤ ‖matrixCLM (A - B)‖ + ‖matrixCLM (B - C)‖ := by have heq : matrixCLM (A - C) = matrixCLM (A - B) + matrixCLM (B - C) := by ext x i simp [matrixCLM, Matrix.toEuclideanLin_apply] rw [heq] exact norm_add_le _ _ have h0 := block a.M0 b.M0 c.M0 have h1 := block a.M1 b.M1 c.M1 have h2 := block a.N0 b.N0 c.N0 have h3 := block a.N1 b.N1 c.N1 have hx : ‖(toLp 2 (a.mX - c.mX) : Euc dx)‖ ≤ ‖(toLp 2 (a.mX - b.mX) : Euc dx)‖ + ‖(toLp 2 (b.mX - c.mX) : Euc dx)‖ := by have heq : (toLp 2 (a.mX - c.mX) : Euc dx) = toLp 2 (a.mX - b.mX) + toLp 2 (b.mX - c.mX) := by ext i simp rw [heq] exact norm_add_le _ _ have hx' : sqrt (∑ i, (a.mX i - c.mX i) ^ 2) ≤ sqrt (∑ i, (a.mX i - b.mX i) ^ 2) + sqrt (∑ i, (b.mX i - c.mX i) ^ 2) := by simpa only [EuclideanSpace.norm_eq, Real.norm_eq_abs, Pi.sub_apply, sq_abs] using hx linarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.dS_triangle · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:381
theorem dS_continuous Lemma 23 in the paper ↗

D s continuous: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx dz :
Continuous (uncurry (@dS dx dz))
Proof (Lean source)
lemma dS_continuous (dx dz : ℕ) : Continuous (Function.uncurry (@dS dx dz)) := by unfold Function.uncurry dS have hcoord : Continuous (@SummarySpace.toCoordinates dx dz) := continuous_induced_dom have hM0coord : Continuous (fun s : SummarySpace dx dz => s.M0) := by exact continuous_fst.comp hcoord have hM1coord : Continuous (fun s : SummarySpace dx dz => s.M1) := by exact (continuous_fst.comp continuous_snd).comp hcoord have hN0coord : Continuous (fun s : SummarySpace dx dz => s.N0) := by exact (continuous_fst.comp (continuous_snd.comp continuous_snd)).comp hcoord have hN1coord : Continuous (fun s : SummarySpace dx dz => s.N1) := by exact (continuous_fst.comp (continuous_snd.comp (continuous_snd.comp continuous_snd))).comp hcoord have hmXcoord : Continuous (fun s : SummarySpace dx dz => s.mX) := by exact (continuous_snd.comp (continuous_snd.comp (continuous_snd.comp continuous_snd))).comp hcoord have hM0 : Continuous (fun a : SummarySpace dx dz × SummarySpace dx dz => matrixCLM (a.1.M0 - a.2.M0)) := (matrixCLM_continuous (rows := dz) (cols := dx)).comp ((hM0coord.comp continuous_fst).sub (hM0coord.comp continuous_snd)) have hM1 : Continuous (fun a : SummarySpace dx dz × SummarySpace dx dz => matrixCLM (a.1.M1 - a.2.M1)) := (matrixCLM_continuous (rows := dz) (cols := dx)).comp ((hM1coord.comp continuous_fst).sub (hM1coord.comp continuous_snd)) have hN0 : Continuous (fun a : SummarySpace dx dz × SummarySpace dx dz => matrixCLM (a.1.N0 - a.2.N0)) := (matrixCLM_continuous (rows := dz) (cols := dx)).comp ((hN0coord.comp continuous_fst).sub (hN0coord.comp continuous_snd)) have hN1 : Continuous (fun a : SummarySpace dx dz × SummarySpace dx dz => matrixCLM (a.1.N1 - a.2.N1)) := (matrixCLM_continuous (rows := dz) (cols := dx)).comp ((hN1coord.comp continuous_fst).sub (hN1coord.comp continuous_snd)) have hmX : Continuous (fun a : SummarySpace dx dz × SummarySpace dx dz => a.1.mX - a.2.mX) := (hmXcoord.comp continuous_fst).sub (hmXcoord.comp continuous_snd) have hsqrt : Continuous (fun a : SummarySpace dx dz × SummarySpace dx dz => sqrt (∑ i, (a.1.mX i - a.2.mX i) ^ 2)) := by fun_prop (disch := assumption) exact (((hM0.norm.add hM1.norm).add hN0.norm).add hN1.norm).add hsqrt
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.dS_continuous · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:412
structure ObservableSummaryData

The complete observable-summary node, bundling the five population moments with the stated continuous summary loss. It uses the supplied parameters.

Definition (Lean source)
dx dz :
summary :
loss :
SummarySpace dx dz → SummarySpace dx dz → ℝ
loss_eq :
loss = dS
loss_continuous :
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ObservableSummaryData · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:453
def observableSummaryData Definition 33 in the paper ↗

For the ambient setting, observable Summary Data is given by its defining clause.

Definition (Lean source)
k :
shared
dx :
shared
dz :
shared
P :
Measure (FullData k dx dz)
shared
observableSummaryData P :
⟨obsSummary P, dS, rfl, dS_continuous dx dz⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.observableSummaryData · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:462

For the supplied parameters, observed Proxy Moment is given by its defining clause.

Definition (Lean source)
dx dz :
s :
t :
observedProxyMoment s t :
if t then s.M1 else s.M0
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.observedProxyMoment · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:466
def observedOutcomeProxyMoment

For the supplied parameters, observed Outcome Proxy Moment is given by its defining clause.

Definition (Lean source)
dx dz :
s :
t :
observedOutcomeProxyMoment s t :
if t then s.N1 else s.N0
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.observedOutcomeProxyMoment · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:470
def latentArmWeights

For the supplied parameters, latent Arm Weights is given by its defining clause.

Definition (Lean source)
k dx dz :
P :
Measure (FullData k dx dz)
t :
latentArmWeights P t :
diagonal fun u => P.real (latentCell u t) / P.real {w | w.T = t}
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.latentArmWeights · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:474

For the supplied parameters, stacked Proxy Moment is given by its defining clause.

Definition (Lean source)
dx dz :
s :
stackedProxyMoment s :
RectMatrix (2 * dz) dx
fun i j => if h : i.val < dz then s.M0 ⟨i.val, h⟩ j else s.M1 ⟨i.val - dz, by omega⟩ j
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.stackedProxyMoment · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:479
def armCount

For the supplied parameters, arm Count is given by its defining clause.

Definition (Lean source)
n dx dz :
t :
sample :
Fin n → Obs dx dz
armCount t sample :
(Finset.univ.filter fun i => (sample i).T = t).card
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.armCount · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:485
def empiricalArmMatrix

For the supplied parameters, empirical Arm Matrix is given by its defining clause.

Definition (Lean source)
n dx dz :
weighted :
t :
sample :
Fin n → Obs dx dz
empiricalArmMatrix weighted t sample :
fun a b
=> (max 1 (armCount t sample) : ℝ)⁻¹ * ∑ i, if (sample i).T = t then (if weighted then (sample i).Y else 1) * (sample i).Z a * (sample i).X b else 0
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.empiricalArmMatrix · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:489

Total empirical summary, including the empty-arm zero branch. @realizes Nt,nN_{t,n}(armCount) @realizes M^t,n\widehat M_{t,n}(arm matrix) @realizes N^t,n\widehat N_{t,n}(weighted arm matrix) @realizes m^X,n\widehat m_{X,n}(sample mean) @realizes S^n\widehat S_n(five empirical blocks) For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
n dx dz :
sample :
Fin n → Obs dx dz
empSummary sample :
clause 1
clause 2
clause 3
clause 4
clause 5
mX j := (n : ℝ)⁻¹ * ∑ i, (sample i).X j
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.empSummary · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:495

A supplied orthonormal signal basis and its spanning condition. @realizes V(P)V(P)(basis) It uses the supplied parameters.

Definition (Lean source)
dx k :
V :
orthonormal :
∀ i j, (∑ a, V a i * V a j) = if i = j then 1 else 0
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.SignalBasis · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:507
def signalRowspace

Row space of the vertically stacked proxy moments. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
dx dz :
s :
signalRowspace s :
Submodule ℝ (Euc dx)
range (toEuclideanLin s.M0.transpose) ⊔ range (toEuclideanLin s.M1.transpose)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.signalRowspace · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:512
def SpansSignal

The supplied orthonormal columns span the stacked proxy row space. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
dx dz k :
s :
V :
SpansSignal s V :
Prop
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.SignalBasis.SpansSignal · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:518

Compressed effect operator. @realizes ΔQ(P)\Delta Q(P)(Penrose compressed contrast) For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
dx dz k :
s :
V :
_hV :
V.SpansSignal s
compressedOperator s V _hV :
genuinePenroseInverse (s.M1 * V.V) * (s.N1 * V.V)
- genuinePenroseInverse (s.M0 * V.V) * (s.N0 * V.V)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.compressedOperator · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:525
def leftAnchor

Left spectral anchor. @realizes a(P)a(P)(mX transpose V) For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
dx dz k :
s :
V :
leftAnchor s V :
Fin k → ℝ
fun j => ∑ i, s.mX i * V.V i j
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.leftAnchor · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:531
def rightAnchor

Right spectral anchor. @realizes c(P)c(P)(V transpose e1) For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
dx k :
V :
rightAnchor V :
Fin k → ℝ
fun j => ∑ i, V.V i j * firstBasis dx i
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.rightAnchor · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:535
structure CompressedOperatorData

All three constructions required by the compressed-operator definition, bundled together. It uses the supplied parameters.

Definition (Lean source)
k :
delta :
left :
Fin k → ℝ
right :
Fin k → ℝ
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.CompressedOperatorData · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:539
def compressedOperatorData

The compressed effect operator and anchors attached to a model law and any orthonormal basis spanning its stacked proxy row space. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
dx dz k :
V :
hV :
V.SpansSignal (obsSummary P)
compressedOperatorData P V hV :
⟨compressedOperator (obsSummary P) V hV, leftAnchor (obsSummary P) V, rightAnchor V⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.compressedOperatorData · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:546

The labelled formula before validity is bundled. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k :
shared
dx :
shared
dz :
shared
P :
Measure (FullData k dx dz)
shared
radius :
quotientLawRaw P radius :
AtomicLaw k radius
⟨latentMass P, latentEffect P⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.quotientLawRaw · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:554
def sampleExperiment

Observed iid experiment. @realizes En\mathcal E_n(set of model product laws) For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k :
shared
dx :
shared
dz :
shared
L :
shared
pi0 :
shared
sigma0 :
shared
n :
sampleExperiment n :
Set (Measure (Fin n → Obs dx dz))
{Q | ∃ (P : Measure (FullData k dx dz)) (hP : IsProbabilityMeasure P), letI := hP Nonempty (UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) ∧ Q = sampleLaw (n := n) P}
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.sampleExperiment · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:559

Domain of a nominal confidence-set miscoverage level. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
alpha :
MiscoverageDomain alpha :
Prop
clause 1
0 < alpha
clause 2
alpha < 1 / 2
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.MiscoverageDomain · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:566

Domain of a generic high-probability tail level. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
eta :
TailLevelDomain eta :
Prop
clause 1
0 < eta
clause 2
eta < 1 / 2
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.TailLevelDomain · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:571

Domain of the simultaneous-concentration constant. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
C0 :
ConcentrationConstantDomain C0 :
Prop
1 ≤ C0
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ConcentrationConstantDomain · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:576

Simultaneous summary radius. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
n :
alpha C0 L :
summaryRadius n alpha C0 L :
C0 * L * sqrt (log (C0 / alpha) / n)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summaryRadius · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:585
theorem summaryRadius_pos

Summary radius pos: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
n :
alpha C0 L :
hn :
0 < n
halpha :
0 < alpha
halphaHalf :
alpha < 1 / 2
hC0 :
1 ≤ C0
hL :
1 ≤ L
0 < summaryRadius n alpha C0 L
Proof (Lean source)
lemma summaryRadius_pos (n : ℕ) (alpha C0 L : ℝ) (hn : 0 < n) (halpha : 0 < alpha) (halphaHalf : alpha < 1 / 2) (hC0 : 1 ≤ C0) (hL : 1 ≤ L) : 0 < summaryRadius n alpha C0 L := by unfold summaryRadius have hdiv : 1 < C0 / alpha := by rw [one_lt_div halpha] linarith have hlog : 0 < log (C0 / alpha) := Real.log_pos hdiv positivity
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summaryRadius_pos · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:589
def summaryEvent

Summary concentration event. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k :
shared
n dx dz :
C0 L alpha :
summaryEvent P C0 L alpha :
Set (Fin n → Obs dx dz)
{sample | dS (empSummary sample) (obsSummary P) ≤ summaryRadius n alpha C0 L}
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summaryEvent · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Basic.lean:602
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.AmbientOperatorBridge 17 declarations Paper-local perturbation bounds for the ambient outcome-weighted Moore--Penrose contrast.

Paper-local perturbation bounds for the ambient outcome-weighted Moore--Penrose contrast. The bounds allow both row and column spaces to move and therefore remain valid across unrelated choices of signal coordinates.

def ambientEffectOperator

The basis-free ambient effect contrast formed from the two observed arm summaries. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
dx dz :
s :
ambientEffectOperator s :
moorePenroseInverse s.M1 * s.N1 - moorePenroseInverse s.M0 * s.N0
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AmbientOperatorBridge.ambientEffectOperator · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AmbientOperatorBridge.lean:22
theorem norm_product_difference

A single outcome-weighted Moore--Penrose product is stable under simultaneous movement of the proxy moment and outcome-weighted moment, assuming only equal rank and a singular margin. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx dz :
M M' N N' :
r :
s L :
hs :
0 < s
hrM :
M.rank = r
hrM' :
M'.rank = r
hmM :
s ≤ singularValue M (r - 1)
hmM' :
s ≤ singularValue M' (r - 1)
hN :
‖N‖ ≤ L
‖moorePenroseInverse M * N - moorePenroseInverse M' * N'‖
≤ 3 * s⁻¹ ^ 2 * ‖M - M'‖ * L + s⁻¹ * ‖N - N'‖
Proof (Lean source)
-- @node: ambientOperatorBridge_norm_product_difference lemma norm_product_difference {dx dz : ℕ} (M M' N N' : RectMatrix dz dx) {r : ℕ} {s L : ℝ} (hs : 0 < s) (hrM : M.rank = r) (hrM' : M'.rank = r) (hmM : s ≤ singularValue M (r - 1)) (hmM' : s ≤ singularValue M' (r - 1)) (hN : ‖N‖ ≤ L) : ‖moorePenroseInverse M * N - moorePenroseInverse M' * N'‖ ≤ 3 * s⁻¹ ^ 2 * ‖M - M'‖ * L + s⁻¹ * ‖N - N'‖ := by have hmp := norm_moorePenrose_sub_le_of_singularMargin M M' hrM hrM' hs hmM hmM' have hinv := norm_moorePenroseInverse_le_inv M' hrM' hs hmM' have hsplit : moorePenroseInverse M * N - moorePenroseInverse M' * N' = (moorePenroseInverse M - moorePenroseInverse M') * N + moorePenroseInverse M' * (N - N') := by rw [Matrix.sub_mul, Matrix.mul_sub] abel rw [hsplit] calc ‖(moorePenroseInverse M - moorePenroseInverse M') * N + moorePenroseInverse M' * (N - N')‖ ≤ ‖(moorePenroseInverse M - moorePenroseInverse M') * N‖ + ‖moorePenroseInverse M' * (N - N')‖ := norm_add_le _ _ _ ≤ ‖moorePenroseInverse M - moorePenroseInverse M'‖ * ‖N‖ + ‖moorePenroseInverse M'‖ * ‖N - N'‖ := add_le_add (Matrix.l2_opNorm_mul _ _) (Matrix.l2_opNorm_mul _ _) _ ≤ 3 * s⁻¹ ^ 2 * ‖M - M'‖ * L + s⁻¹ * ‖N - N'‖ := by have hL0 : 0 ≤ L := (norm_nonneg N).trans hN gcongr
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AmbientOperatorBridge.norm_product_difference · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AmbientOperatorBridge.lean:28
theorem norm_ambientEffectOperator_sub_le

The ambient two-arm contrast is Lipschitz in the paper's five-block summary metric. This is the model-local product-triangle bridge from the moving-space Moore--Penrose estimate. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx dz r :
p q :
s L :
hs :
0 < s
hL :
0 ≤ L
hrp0 :
p.M0.rank = r
hrq0 :
q.M0.rank = r
hrp1 :
p.M1.rank = r
hrq1 :
q.M1.rank = r
hmp0 :
s ≤ singularValue p.M0 (r - 1)
hmq0 :
s ≤ singularValue q.M0 (r - 1)
hmp1 :
s ≤ singularValue p.M1 (r - 1)
hmq1 :
s ≤ singularValue q.M1 (r - 1)
hNp0 :
‖p.N0‖ ≤ L
hNp1 :
‖p.N1‖ ≤ L
‖ambientEffectOperator p - ambientEffectOperator q‖ ≤ (3 * s⁻¹ ^ 2 * L + s⁻¹) * dS p q
Proof (Lean source)
-- @node: ambientOperatorBridge_norm_ambientEffectOperator_sub_le lemma norm_ambientEffectOperator_sub_le {dx dz r : ℕ} (p q : SummarySpace dx dz) {s L : ℝ} (hs : 0 < s) (hL : 0 ≤ L) (hrp0 : p.M0.rank = r) (hrq0 : q.M0.rank = r) (hrp1 : p.M1.rank = r) (hrq1 : q.M1.rank = r) (hmp0 : s ≤ singularValue p.M0 (r - 1)) (hmq0 : s ≤ singularValue q.M0 (r - 1)) (hmp1 : s ≤ singularValue p.M1 (r - 1)) (hmq1 : s ≤ singularValue q.M1 (r - 1)) (hNp0 : ‖p.N0‖ ≤ L) (hNp1 : ‖p.N1‖ ≤ L) : ‖ambientEffectOperator p - ambientEffectOperator q‖ ≤ (3 * s⁻¹ ^ 2 * L + s⁻¹) * dS p q := by let C : ℝ := 3 * s⁻¹ ^ 2 * L + s⁻¹ have hsInv : 0 ≤ s⁻¹ := (inv_pos.mpr hs).le have hC0 : 0 ≤ C := by dsimp [C]; positivity have hcoefM : 3 * s⁻¹ ^ 2 * L ≤ C := by dsimp [C] exact le_add_of_nonneg_right hsInv have hcoefN : s⁻¹ ≤ C := by dsimp [C] exact le_add_of_nonneg_left (by positivity) have h0 := norm_product_difference p.M0 q.M0 p.N0 q.N0 hs hrp0 hrq0 hmp0 hmq0 hNp0 have h1 := norm_product_difference p.M1 q.M1 p.N1 q.N1 hs hrp1 hrq1 hmp1 hmq1 hNp1 have h0' : ‖moorePenroseInverse p.M0 * p.N0 - moorePenroseInverse q.M0 * q.N0‖ ≤ C * (‖p.M0 - q.M0‖ + ‖p.N0 - q.N0‖) := by calc _ ≤ 3 * s⁻¹ ^ 2 * ‖p.M0 - q.M0‖ * L + s⁻¹ * ‖p.N0 - q.N0‖ := h0 _ = (3 * s⁻¹ ^ 2 * L) * ‖p.M0 - q.M0‖ + s⁻¹ * ‖p.N0 - q.N0‖ := by ring _ ≤ C * ‖p.M0 - q.M0‖ + C * ‖p.N0 - q.N0‖ := by gcongr _ = C * (‖p.M0 - q.M0‖ + ‖p.N0 - q.N0‖) := by ring have h1' : ‖moorePenroseInverse p.M1 * p.N1 - moorePenroseInverse q.M1 * q.N1‖ ≤ C * (‖p.M1 - q.M1‖ + ‖p.N1 - q.N1‖) := by calc _ ≤ 3 * s⁻¹ ^ 2 * ‖p.M1 - q.M1‖ * L + s⁻¹ * ‖p.N1 - q.N1‖ := h1 _ = (3 * s⁻¹ ^ 2 * L) * ‖p.M1 - q.M1‖ + s⁻¹ * ‖p.N1 - q.N1‖ := by ring _ ≤ C * ‖p.M1 - q.M1‖ + C * ‖p.N1 - q.N1‖ := by gcongr _ = C * (‖p.M1 - q.M1‖ + ‖p.N1 - q.N1‖) := by ring have hsplit : ambientEffectOperator p - ambientEffectOperator q = (moorePenroseInverse p.M1 * p.N1 - moorePenroseInverse q.M1 * q.N1) - (moorePenroseInverse p.M0 * p.N0 - moorePenroseInverse q.M0 * q.N0) := by simp only [ambientEffectOperator] abel rw [hsplit] calc ‖(moorePenroseInverse p.M1 * p.N1 - moorePenroseInverse q.M1 * q.N1) - (moorePenroseInverse p.M0 * p.N0 - moorePenroseInverse q.M0 * q.N0)‖ ≤ ‖moorePenroseInverse p.M1 * p.N1 - moorePenroseInverse q.M1 * q.N1‖ + ‖moorePenroseInverse p.M0 * p.N0 - moorePenroseInverse q.M0 * q.N0‖ := norm_sub_le _ _ _ ≤ C * (‖p.M1 - q.M1‖ + ‖p.N1 - q.N1‖) + C * (‖p.M0 - q.M0‖ + ‖p.N0 - q.N0‖) := add_le_add h1' h0' _ ≤ C * dS p q := by unfold dS change C * (‖p.M1 - q.M1‖ + ‖p.N1 - q.N1‖) + C * (‖p.M0 - q.M0‖ + ‖p.N0 - q.N0‖) ≤ C * (‖p.M0 - q.M0‖ + ‖p.M1 - q.M1‖ + ‖p.N0 - q.N0‖ + ‖p.N1 - q.N1‖ + sqrt (∑ i, (p.mX i - q.mX i) ^ 2)) have hsqrt : 0 ≤ sqrt (∑ i, (p.mX i - q.mX i) ^ 2) := Real.sqrt_nonneg _ nlinarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AmbientOperatorBridge.norm_ambientEffectOperator_sub_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AmbientOperatorBridge.lean:59
theorem norm_mX_sub_le_dS

The mean-coordinate block is dominated by the full five-block summary distance. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx dz :
p q :
‖(toLp 2 (p.mX - q.mX) : Euc dx)‖ ≤ dS p q
Proof (Lean source)
-- @node: ambientOperatorBridge_norm_mX_sub_le_dS lemma norm_mX_sub_le_dS {dx dz : ℕ} (p q : SummarySpace dx dz) : ‖(toLp 2 (p.mX - q.mX) : Euc dx)‖ ≤ dS p q := by rw [EuclideanSpace.norm_eq] unfold dS have h0 : 0 ≤ ‖matrixCLM (p.M0 - q.M0)‖ := norm_nonneg _ have h1 : 0 ≤ ‖matrixCLM (p.M1 - q.M1)‖ := norm_nonneg _ have h2 : 0 ≤ ‖matrixCLM (p.N0 - q.N0)‖ := norm_nonneg _ have h3 : 0 ≤ ‖matrixCLM (p.N1 - q.N1)‖ := norm_nonneg _ simp only [Pi.sub_apply, Real.norm_eq_abs, sq_abs] linarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AmbientOperatorBridge.norm_mX_sub_le_dS · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AmbientOperatorBridge.lean:130
theorem moorePenroseInverse_mul_eq_one_of_injective

For a full-column-rank rectangular matrix, its Moore--Penrose inverse is a genuine left inverse. This is the cancellation used when the proxy factorization is restricted to the latent signal coordinates. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols :
A :
RectMatrix rows cols
moorePenroseInverse A * A = (1 : RectMatrix cols cols)
Proof (Lean source)
-- @node: ambientOperatorBridge_moorePenroseInverse_mul_eq_one_of_injective lemma moorePenroseInverse_mul_eq_one_of_injective {rows cols : ℕ} (A : RectMatrix rows cols) (hA : Injective (toEuclideanLin A)) : moorePenroseInverse A * A = (1 : RectMatrix cols cols) := by apply Matrix.toEuclideanLin.injective apply LinearMap.ext intro x apply hA have hpenrose := (moorePenroseInverse_spec A).1 apply PiLp.ext intro i have hmatrix : A * (moorePenroseInverse A * A) = A := by rw [← Matrix.mul_assoc, hpenrose] simpa [Matrix.toEuclideanLin_apply, Matrix.mulVec_mulVec] using congrArg (fun M : RectMatrix rows cols => mulVec M x i) hmatrix
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AmbientOperatorBridge.moorePenroseInverse_mul_eq_one_of_injective · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AmbientOperatorBridge.lean:143
theorem moorePenroseInverse_mul_transpose

The Moore--Penrose inverse of a product of two full-column-rank factors is the reverse product of their Moore--Penrose inverses. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols r :
C :
RectMatrix rows r
B :
RectMatrix cols r
moorePenroseInverse (C * B.transpose)
= (moorePenroseInverse B).transpose * moorePenroseInverse C
Proof (Lean source)
-- @node: ambientOperatorBridge_moorePenroseInverse_mul_transpose lemma moorePenroseInverse_mul_transpose {rows cols r : ℕ} (C : RectMatrix rows r) (B : RectMatrix cols r) (hC : Injective (toEuclideanLin C)) (hB : Injective (toEuclideanLin B)) : moorePenroseInverse (C * B.transpose) = (moorePenroseInverse B).transpose * moorePenroseInverse C := by have hCleft := moorePenroseInverse_mul_eq_one_of_injective C hC have hBleft := moorePenroseInverse_mul_eq_one_of_injective B hB have hBtrans : B.transpose * (moorePenroseInverse B).transpose = (1 : RectMatrix r r) := by simpa only [Matrix.transpose_mul, Matrix.transpose_one] using congrArg transpose hBleft let G := (moorePenroseInverse B).transpose * moorePenroseInverse C have hspec : IsMoorePenroseInverse (C * B.transpose) G := by refine ⟨?_, ?_, ?_, ?_⟩ · simp only [G, Matrix.mul_assoc] rw [← Matrix.mul_assoc B.transpose, hBtrans, Matrix.one_mul, ← Matrix.mul_assoc (moorePenroseInverse C), hCleft, Matrix.one_mul] · simp only [G, Matrix.mul_assoc] rw [← Matrix.mul_assoc (moorePenroseInverse C), hCleft, Matrix.one_mul, ← Matrix.mul_assoc B.transpose, hBtrans, Matrix.one_mul] · have hMG : (C * B.transpose) * G = C * moorePenroseInverse C := by simp only [G, Matrix.mul_assoc] rw [← Matrix.mul_assoc B.transpose, hBtrans, Matrix.one_mul] rw [hMG] exact (moorePenroseInverse_spec C).2.2.1 · have hGM : G * (C * B.transpose) = (moorePenroseInverse B).transpose * B.transpose := by simp only [G, Matrix.mul_assoc] rw [← Matrix.mul_assoc (moorePenroseInverse C), hCleft, Matrix.one_mul] rw [hGM] have hsym := (moorePenroseInverse_spec B).2.2.1 have heq : (moorePenroseInverse B).transpose * B.transpose = B * moorePenroseInverse B := by simpa only [Matrix.transpose_mul, Matrix.transpose_transpose] using hsym rw [heq, hsym] exact isMoorePenroseInverse_unique (moorePenroseInverse_spec _) hspec
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AmbientOperatorBridge.moorePenroseInverse_mul_transpose · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AmbientOperatorBridge.lean:163
theorem moorePenrose_outcome_factorization Lemma 20 in the paper ↗

Cancelling a full-rank proxy factorization identifies the ambient outcome operator as the target-feature conjugation of the latent diagonal outcome means. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols r :
C :
RectMatrix rows r
B :
RectMatrix cols r
mu :
Fin r → ℝ
moorePenroseInverse (C * B.transpose) * (C * diagonal mu * B.transpose)
= (moorePenroseInverse B).transpose * diagonal mu * B.transpose
Proof (Lean source)
-- @node: ambientOperatorBridge_moorePenrose_outcome_factorization lemma moorePenrose_outcome_factorization {rows cols r : ℕ} (C : RectMatrix rows r) (B : RectMatrix cols r) (mu : Fin r → ℝ) (hC : Injective (toEuclideanLin C)) (hB : Injective (toEuclideanLin B)) : moorePenroseInverse (C * B.transpose) * (C * diagonal mu * B.transpose) = (moorePenroseInverse B).transpose * diagonal mu * B.transpose := by rw [moorePenroseInverse_mul_transpose C B hC hB] have hCleft := moorePenroseInverse_mul_eq_one_of_injective C hC simp only [Matrix.mul_assoc] rw [← Matrix.mul_assoc (moorePenroseInverse C), hCleft, Matrix.one_mul]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AmbientOperatorBridge.moorePenrose_outcome_factorization · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AmbientOperatorBridge.lean:203
theorem model_ambientEffectOperator_factorization

The model's basis-free ambient contrast is exactly the target-feature conjugation of the diagonal latent treatment effects. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hL :
1 ≤ L
hpi :
0 < pi0
hsigma :
0 < sigma0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
Proof (Lean source)
-- @node: ambientOperatorBridge_model_ambientEffectOperator_factorization lemma model_ambientEffectOperator_factorization {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hk : 2 ≤ k) (hkx : k ≤ dx) (hL : 1 ≤ L) (hpi : 0 < pi0) (hsigma : 0 < sigma0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) : ambientEffectOperator (obsSummary P) = (moorePenroseInverse (targetFeature P)).transpose * diagonal (latentEffect P) * (targetFeature P).transpose := by let B := targetFeature P have hinj {rows : ℕ} (A : RectMatrix rows k) (hmargin : sigma0 ≤ signalMinSingular A) : Injective (toEuclideanLin A) := by rw [LinearMap.injective_iff_forall_lt_finrank_singularValues_pos] intro i hi have hik : i ≤ k - 1 := by simpa using (Nat.le_sub_one_of_lt (by simpa using hi)) exact lt_of_lt_of_le (lt_of_lt_of_le hsigma hmargin) ((toEuclideanLin A).singularValues_antitone hik) have hB : Injective (toEuclideanLin B) := hinj B hM.proxyRankMargin.2.2 have harm (t : Bool) : Injective (toEuclideanLin (referenceFeature P t * latentArmWeights P t)) := by have hA : Injective (toEuclideanLin (referenceFeature P t)) := by cases t · exact hinj _ hM.proxyRankMargin.1 · exact hinj _ hM.proxyRankMargin.2.1 have hD := latentArmWeights_injective P hpi hM.latentArmPositivity t intro x y hxy apply hD apply hA apply PiLp.ext intro i simpa [Matrix.toEuclideanLin_apply, Matrix.mulVec_mulVec] using congrArg (fun z : Euc dz => z.ofLp i) hxy have ht (t : Bool) : moorePenroseInverse (observedProxyMoment (obsSummary P) t) * observedOutcomeProxyMoment (obsSummary P) t = (moorePenroseInverse B).transpose * diagonal (latentMean P t) * B.transpose := by rw [observedProxyMoment_factorization P hk hkx hL hpi hM t, observedOutcomeProxyMoment_factorization P hk hpi hM t] exact moorePenrose_outcome_factorization (referenceFeature P t * latentArmWeights P t) B (latentMean P t) (harm t) hB simp only [ambientEffectOperator] change moorePenroseInverse (observedProxyMoment (obsSummary P) true) * observedOutcomeProxyMoment (obsSummary P) true - moorePenroseInverse (observedProxyMoment (obsSummary P) false) * observedOutcomeProxyMoment (obsSummary P) false = _ rw [ht true, ht false] unfold B latentEffect have hdiag : diagonal (fun u => latentMean P true u - latentMean P false u) = diagonal (latentMean P true) - diagonal (latentMean P false) := by ext i j by_cases hij : i = j <;> simp [Matrix.diagonal_apply, hij] rw [hdiag] rw [Matrix.mul_sub, Matrix.sub_mul]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AmbientOperatorBridge.model_ambientEffectOperator_factorization · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AmbientOperatorBridge.lean:218
theorem model_summary_rank_eq

Every model-generated arm moment has exactly the latent rank. This packages the lower-rank consequence of the observed singular margin with the upper-rank consequence of the latent factorization, in the form required by the moving-space Moore--Penrose estimate. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hL :
1 ≤ L
hpi :
0 < pi0
hsigma :
0 < sigma0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
t :
Proof (Lean source)
-- @node: ambientOperatorBridge_model_summary_rank_eq lemma model_summary_rank_eq {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hk : 2 ≤ k) (hkx : k ≤ dx) (hL : 1 ≤ L) (hpi : 0 < pi0) (hsigma : 0 < sigma0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (t : Bool) : (observedProxyMoment (obsSummary P) t).rank = k := by let M := observedProxyMoment (obsSummary P) t have hfac := observedProxyMoment_factorization P hk hkx hL hpi hM t have hmargin := observedProxyMoment_minSingular_of_factorization P hk hpi hsigma hM t hfac have hpos : 0 < singularValue M (k - 1) := lt_of_lt_of_le (mul_pos hpi (sq_pos_of_pos hsigma)) (by simpa [M] using hmargin) have hlower : k ≤ M.rank := by have hlt : k - 1 < finrank ℝ (toEuclideanLin M).range := (toEuclideanLin M).singularValues_pos_iff_lt_finrank_range.mp hpos have hrank : finrank ℝ (toEuclideanLin M).range = M.rank := by exact (M.rank_eq_finrank_range_toLin (EuclideanSpace.basisFun (Fin dz) ℝ).toBasis (EuclideanSpace.basisFun (Fin dx) ℝ).toBasis).symm rw [hrank] at hlt omega have hupper : M.rank ≤ k := by rw [show M = referenceFeature P t * latentArmWeights P t * (targetFeature P).transpose by simpa [M] using hfac] exact (Matrix.rank_mul_le_left (referenceFeature P t * latentArmWeights P t) (targetFeature P).transpose).trans (Matrix.rank_le_width _) change M.rank = k omega
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AmbientOperatorBridge.model_summary_rank_eq · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AmbientOperatorBridge.lean:279
theorem model_summary_ambient_bounds

Model membership supplies, simultaneously in both arms, all quantitative hypotheses used by the ambient Moore--Penrose perturbation bound. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hsigma :
0 < sigma0
hsigmaMax :
sigma0 ≤ 1
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
conclusion 1
t :
pi0 * sigma0 ^ 2 ≤ singularValue (observedProxyMoment (obsSummary P) t) (k - 1)
‖matrixCLM (observedOutcomeProxyMoment (obsSummary P) t)‖ ≤ L
conclusion 2
‖(toLp 2 (obsSummary P).mX : Euc dx)‖ ≤ L
Proof (Lean source)
-- @node: ambientOperatorBridge_model_summary_ambient_bounds lemma model_summary_ambient_bounds {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hpiMax : pi0 ≤ 1 / (2 * k : ℝ)) (hsigma : 0 < sigma0) (hsigmaMax : sigma0 ≤ 1) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) : (∀ t : Bool, (observedProxyMoment (obsSummary P) t).rank = k ∧ pi0 * sigma0 ^ 2 ≤ singularValue (observedProxyMoment (obsSummary P) t) (k - 1) ∧ ‖matrixCLM (observedOutcomeProxyMoment (obsSummary P) t)‖ ≤ L) ∧ ‖(toLp 2 (obsSummary P).mX : Euc dx)‖ ≤ L := by have hEnv := observedSummary_envelopes_of_model P hk hkx hL hpi hM refine ⟨?_, ?_⟩ · intro t refine ⟨model_summary_rank_eq P hk hkx hL hpi hsigma hM t, ?_, ?_⟩ · exact observedProxyMoment_minSingular_of_factorization P hk hpi hsigma hM t (observedProxyMoment_factorization P hk hkx hL hpi hM t) · cases t with | false => simpa [observedOutcomeProxyMoment] using (hEnv.1 false).2 | true => simpa [observedOutcomeProxyMoment] using (hEnv.1 true).2 · exact hEnv.2
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AmbientOperatorBridge.model_summary_ambient_bounds · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AmbientOperatorBridge.lean:314
theorem targetFeature_transpose_firstBasis

The model anchor makes the first ambient coordinate the all-ones right anchor in latent coordinates. This is the paper-local identity Bᵀ e₁ = 1 used by the spectral-law representation certificate. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hpi :
0 < pi0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
Proof (Lean source)
-- @node: ambientOperatorBridge_targetFeature_transpose_firstBasis lemma targetFeature_transpose_firstBasis {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hk : 2 ≤ k) (hkx : k ≤ dx) (hpi : 0 < pi0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) : mulVec (targetFeature P).transpose (firstBasis dx) = fun _ => 1 := by have hdx : 0 < dx := lt_of_lt_of_le (by omega : 0 < k) hkx funext u let i0 : Fin dx := ⟨0, hdx⟩ have hclass : 0 < P (latentClass u) := by exact lt_of_lt_of_le (latentCell_pos_of_latentArmPositivity P hpi hM.latentArmPositivity u false) (MeasureTheory.measure_mono fun _ hw => hw.1) have hanchor : ∀ᵐ w ∂P.restrict (latentClass u), w.X i0 = 1 := MeasureTheory.ae_restrict_of_ae (hM.anchor.mono fun w hw => hw i0 rfl) let _ : IsProbabilityMeasure (normalizedRestrict P (latentClass u)) := normalizedRestrict_isProbabilityMeasure (measurableSet_latentClass u) hclass have hmean : targetFeature P i0 u = 1 := by rw [targetFeature, conditionalMean_eq_normalizedRestrictedIntegral hclass] unfold normalizedRestrictedIntegral rw [MeasureTheory.integral_congr_ae ((ae_normalizedRestrict_iff hclass).mpr hanchor)] simp have hfirst : firstBasis dx = single i0 1 := by funext i by_cases hi : i = i0 · subst i simp [firstBasis, i0] · have hval : i.val ≠ 0 := fun hz => hi (Fin.ext hz) simp [firstBasis, hi, hval] rw [hfirst] simp [mulVec, hmean]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AmbientOperatorBridge.targetFeature_transpose_firstBasis · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AmbientOperatorBridge.lean:339

The canonical right anchor has Euclidean norm one whenever the ambient dimension is positive. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx :
hdx :
0 < dx
‖(toLp 2 (firstBasis dx) : Euc dx)‖ = 1
Proof (Lean source)
-- @node: ambientOperatorBridge_norm_firstBasis lemma norm_firstBasis {dx : ℕ} (hdx : 0 < dx) : ‖(toLp 2 (firstBasis dx) : Euc dx)‖ = 1 := by cases dx with | zero => omega | succ n => rw [EuclideanSpace.norm_eq, Fin.sum_univ_succ] simp [firstBasis]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AmbientOperatorBridge.norm_firstBasis · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AmbientOperatorBridge.lean:375
theorem obsSummary_mX_factorization

Under positive latent-class mass and model membership, the observable target-proxy mean factors as the target-feature matrix times the latent-class mass vector.

Formal statement
k dx dz :
L pi0 sigma0 :
hpi :
0 < pi0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
Proof (Lean source)
-- @node: ambientOperatorBridge_obsSummary_mX_factorization lemma obsSummary_mX_factorization {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hpi : 0 < pi0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) : (obsSummary P).mX = mulVec (targetFeature P) (latentMass P) := by open MeasureTheory in ext j change (∫ o, o.X j ∂obsLaw P) = ∑ u, conditionalMean P (latentClass u) (fun w => w.X j) * P.real (latentClass u) rw [obsLaw] rw [integral_map (f := fun o : Obs dx dz => o.X j) (obsMap_measurable k dx dz).aemeasurable (((measurable_pi_apply j).comp measurable_obs_X).aestronglyMeasurable)] simp only [obsMap] have hXmeas : Measurable (fun w : FullData k dx dz => w.X j) := (measurable_pi_apply j).comp measurable_fullData_X have hXint : Integrable (fun w : FullData k dx dz => w.X j) P := by apply Integrable.of_bound hXmeas.aestronglyMeasurable L filter_upwards [hM.boundedX] with w hw have hj := PiLp.norm_apply_le (toLp 2 w.X : Euc dx) j have hcoord : |w.X j| ≤ ‖(toLp 2 w.X : Euc dx)‖ := by simpa [Real.norm_eq_abs] using hj exact hcoord.trans (by simpa [EuclideanSpace.norm_eq] using hw) have hdisj : Pairwise (onFun Disjoint (fun u : Fin k => latentClass (dx := dx) (dz := dz) u)) := by intro u v huv change Disjoint (latentClass (dx := dx) (dz := dz) u) (latentClass (dx := dx) (dz := dz) v) rw [Set.disjoint_left] intro w hwu hwv exact huv (hwu.symm.trans hwv) have hunion : (⋃ u : Fin k, latentClass (dx := dx) (dz := dz) u) = univ := by ext w simp [latentClass] have hpart : (∫ w, w.X j ∂P) = ∑ u : Fin k, ∫ w in latentClass (dx := dx) (dz := dz) u, w.X j ∂P := by calc (∫ w, w.X j ∂P) = ∫ w in univ, w.X j ∂P := by simp _ = ∫ w in (⋃ u : Fin k, latentClass (dx := dx) (dz := dz) u), w.X j ∂P := by rw [hunion] _ = _ := integral_iUnion_fintype (s := fun u : Fin k => latentClass (dx := dx) (dz := dz) u) (fun _ => measurableSet_latentClass _) hdisj (fun _ => hXint.integrableOn) rw [hpart] apply Finset.sum_congr rfl intro u _ have hclass : 0 < P (latentClass u) := by exact lt_of_lt_of_le (latentCell_pos_of_latentArmPositivity P hpi hM.latentArmPositivity u false) (measure_mono fun _ hw => hw.1) unfold conditionalMean have hreal : P.real (latentClass u) ≠ 0 := by exact ENNReal.toReal_ne_zero.mpr ⟨ne_of_gt hclass, measure_ne_top P _⟩ rw [inv_mul_eq_div, div_mul_cancel₀ _ hreal]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AmbientOperatorBridge.obsSummary_mX_factorization · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AmbientOperatorBridge.lean:386
theorem represents_raw_quotientLaw

An explicit functional-calculus formula for the target-feature factorization represents the labelled latent-effect law. This bridge uses only the mean and anchor identities and is insensitive to repeated effect values. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx :
D :
RealDiagonalization A
B :
p tau :
Fin k → ℝ
m c :
Euc dx
hm :
m = toLp 2 (mulVec B p)
hc :
mulVec B.transpose c = fun _ => 1
hcalc :
∀ f : ℝ → ℝ
if
f 0 = 0
then
D.applyFunction f
= (moorePenroseInverse B).transpose * diagonal (f ∘ tau) * B.transpose
hleft :
moorePenroseInverse B * B = 1
RepresentsAtomicLaw D m c ({ weight := p, atom := tau } : CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw (Fin k))
Proof (Lean source)
-- @node: ambientOperatorBridge_represents_raw_quotientLaw lemma represents_raw_quotientLaw {k dx : ℕ} {A : RectMatrix dx dx} (D : RealDiagonalization A) (B : RectMatrix dx k) (p tau : Fin k → ℝ) (m c : Euc dx) (hm : m = toLp 2 (mulVec B p)) (hc : mulVec B.transpose c = fun _ => 1) (hcalc : ∀ f : ℝ → ℝ, f 0 = 0 → D.applyFunction f = (moorePenroseInverse B).transpose * diagonal (f ∘ tau) * B.transpose) (hleft : moorePenroseInverse B * B = 1) : RepresentsAtomicLaw D m c ({ weight := p, atom := tau } : CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw (Fin k)) := by intro f _hf _hf0 rw [hcalc f _hf0, hm] unfold CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.integral anchorEval change (∑ u, p u * f (tau u)) = ∑ i, (((moorePenroseInverse B).transpose * diagonal (f ∘ tau) * B.transpose).mulVec c.ofLp i) * (B.mulVec p i) rw [← Matrix.mulVec_mulVec, hc, ← Matrix.mulVec_mulVec] have hdiag : (diagonal (f ∘ tau)).mulVec (fun _ => 1) = f ∘ tau := by ext u simp [mulVec, dotProduct, Matrix.diagonal_apply] rw [hdiag] change (∑ u, p u * f (tau u)) = ∑ i, (∑ u, moorePenroseInverse B u i * f (tau u)) * (∑ v, B i v * p v) simp_rw [Finset.mul_sum, Finset.sum_mul] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro y _ rw [Finset.sum_comm] calc p y * f (tau y) = ∑ i, (p y * f (tau i)) * ∑ x, moorePenroseInverse B i x * B x y := by simp_rw [show ∀ i, (∑ x, moorePenroseInverse B i x * B x y) = if i = y then 1 else 0 by intro i have hi := congrArg (fun M : RectMatrix k k => M i y) hleft simpa [Matrix.mul_apply, Matrix.one_apply] using hi] simp _ = ∑ i, ∑ x, moorePenroseInverse B i x * f (tau i) * (B x y * p y) := by symm apply Finset.sum_congr rfl intro i _ rw [Finset.mul_sum] apply Finset.sum_congr rfl intro x _ ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AmbientOperatorBridge.represents_raw_quotientLaw · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AmbientOperatorBridge.lean:443
theorem model_represents_raw_quotientLaw

A model-specific diagonalization whose functional calculus has the target-feature formula automatically represents the model's raw quotient law. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hpi :
0 < pi0
hsigma :
0 < sigma0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
D :
RealDiagonalization (ambientEffectOperator (obsSummary P))
hcalc :
∀ f : ℝ → ℝ
if
f 0 = 0
then
D.applyFunction f
= (moorePenroseInverse (targetFeature P)).transpose * diagonal (f ∘ latentEffect P) * (targetFeature P).transpose
RepresentsAtomicLaw D (toLp 2 (obsSummary P).mX) (toLp 2 (firstBasis dx)) (GapFreeModulusBridge.asNeutral (quotientLawRaw P (effectRadius dz L sigma0)))
Proof (Lean source)
-- @node: ambientOperatorBridge_model_represents_raw_quotientLaw lemma model_represents_raw_quotientLaw {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hk : 2 ≤ k) (hkx : k ≤ dx) (hpi : 0 < pi0) (hsigma : 0 < sigma0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (D : RealDiagonalization (ambientEffectOperator (obsSummary P))) (hcalc : ∀ f : ℝ → ℝ, f 0 = 0 → D.applyFunction f = (moorePenroseInverse (targetFeature P)).transpose * diagonal (f ∘ latentEffect P) * (targetFeature P).transpose) : RepresentsAtomicLaw D (toLp 2 (obsSummary P).mX) (toLp 2 (firstBasis dx)) (GapFreeModulusBridge.asNeutral (quotientLawRaw P (effectRadius dz L sigma0))) := by apply represents_raw_quotientLaw D (targetFeature P) (latentMass P) (latentEffect P) · exact congrArg (toLp 2) (obsSummary_mX_factorization P hpi hM) · simpa using targetFeature_transpose_firstBasis P hk hkx hpi hM · exact hcalc · apply moorePenroseInverse_mul_eq_one_of_injective rw [LinearMap.injective_iff_forall_lt_finrank_singularValues_pos] intro i hi have hik : i ≤ k - 1 := by simpa using (Nat.le_sub_one_of_lt (by simpa using hi)) exact lt_of_lt_of_le (lt_of_lt_of_le hsigma hM.proxyRankMargin.2.2) ((toEuclideanLin (targetFeature P)).singularValues_antitone hik)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AmbientOperatorBridge.model_represents_raw_quotientLaw · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AmbientOperatorBridge.lean:495
theorem atomicW1_le_dS_of_certificates

Once each model supplies its own bounded real diagonalization and representation certificate, the neutral collision-safe estimate and the moving-space Moore--Penrose bound assemble into a summary-metric modulus. The two diagonalizers are unrelated. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz r :
p q :
mu nu :
CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw (Fin k)
Dp :
RealDiagonalization (ambientEffectOperator p)
Dq :
RealDiagonalization (ambientEffectOperator q)
s L kappa R :
hs :
0 < s
hL :
0 ≤ L
hkappa :
0 ≤ kappa
hR :
0 ≤ R
hdx :
0 < dx
hrp0 :
p.M0.rank = r
hrq0 :
q.M0.rank = r
hrp1 :
p.M1.rank = r
hrq1 :
q.M1.rank = r
hmp0 :
s ≤ singularValue p.M0 (r - 1)
hmq0 :
s ≤ singularValue q.M0 (r - 1)
hmp1 :
s ≤ singularValue p.M1 (r - 1)
hmq1 :
s ≤ singularValue q.M1 (r - 1)
hNp0 :
‖p.N0‖ ≤ L
hNp1 :
‖p.N1‖ ≤ L
hmq :
‖(toLp 2 q.mX : Euc dx)‖ ≤ L
hmu :
mu.Valid
hnu :
nu.Valid
hrepP :
RepresentsAtomicLaw Dp (toLp 2 p.mX) (toLp 2 (firstBasis dx)) mu
hrepQ :
RepresentsAtomicLaw Dq (toLp 2 q.mX) (toLp 2 (firstBasis dx)) nu
hkP :
Dp.conditionNumber ≤ kappa
hkQ :
Dq.conditionNumber ≤ kappa
hRP :
Dp.SpectrumBound R
hRQ :
Dq.SpectrumBound R
CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.w1 mu nu
≤ (kappa * R + L * ((dx : ℝ) ^ 2 * kappa ^ 2) * (3 * s⁻¹ ^ 2 * L + s⁻¹)) * dS p q
Proof (Lean source)
-- @node: ambientOperatorBridge_atomicW1_le_dS_of_certificates theorem atomicW1_le_dS_of_certificates {k dx dz r : ℕ} (p q : SummarySpace dx dz) (mu nu : CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw (Fin k)) (Dp : RealDiagonalization (ambientEffectOperator p)) (Dq : RealDiagonalization (ambientEffectOperator q)) {s L kappa R : ℝ} (hs : 0 < s) (hL : 0 ≤ L) (hkappa : 0 ≤ kappa) (hR : 0 ≤ R) (hdx : 0 < dx) (hrp0 : p.M0.rank = r) (hrq0 : q.M0.rank = r) (hrp1 : p.M1.rank = r) (hrq1 : q.M1.rank = r) (hmp0 : s ≤ singularValue p.M0 (r - 1)) (hmq0 : s ≤ singularValue q.M0 (r - 1)) (hmp1 : s ≤ singularValue p.M1 (r - 1)) (hmq1 : s ≤ singularValue q.M1 (r - 1)) (hNp0 : ‖p.N0‖ ≤ L) (hNp1 : ‖p.N1‖ ≤ L) (hmq : ‖(toLp 2 q.mX : Euc dx)‖ ≤ L) (hmu : mu.Valid) (hnu : nu.Valid) (hrepP : RepresentsAtomicLaw Dp (toLp 2 p.mX) (toLp 2 (firstBasis dx)) mu) (hrepQ : RepresentsAtomicLaw Dq (toLp 2 q.mX) (toLp 2 (firstBasis dx)) nu) (hkP : Dp.conditionNumber ≤ kappa) (hkQ : Dq.conditionNumber ≤ kappa) (hRP : Dp.SpectrumBound R) (hRQ : Dq.SpectrumBound R) : CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.w1 mu nu ≤ (kappa * R + L * ((dx : ℝ) ^ 2 * kappa ^ 2) * (3 * s⁻¹ ^ 2 * L + s⁻¹)) * dS p q := by have hop := norm_ambientEffectOperator_sub_le p q hs hL hrp0 hrq0 hrp1 hrq1 hmp0 hmq0 hmp1 hmq1 hNp0 hNp1 have hm := norm_mX_sub_le_dS p q have hw := atomicW1_le_operator_anchor_perturbation Dp Dq (toLp 2 p.mX) (toLp 2 q.mX) (toLp 2 (firstBasis dx)) (toLp 2 (firstBasis dx)) mu nu hmu hnu hrepP hrepQ hkP hkQ hR hRP hRQ rw [norm_firstBasis hdx] at hw simp only [sub_self, norm_zero, mul_one, mul_zero, add_zero] at hw have hm' : ‖(toLp 2 p.mX : Euc dx) - toLp 2 q.mX‖ ≤ dS p q := by simpa using hm calc CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.w1 mu nu ≤ ‖(toLp 2 p.mX : Euc dx) - toLp 2 q.mX‖ * (kappa * R) + ‖(toLp 2 q.mX : Euc dx)‖ * ((dx : ℝ) ^ 2 * kappa * kappa * ‖ambientEffectOperator p - ambientEffectOperator q‖) := hw _ ≤ dS p q * (kappa * R) + L * ((dx : ℝ) ^ 2 * kappa * kappa * ((3 * s⁻¹ ^ 2 * L + s⁻¹) * dS p q)) := by have hsInv : 0 ≤ s⁻¹ := (inv_pos.mpr hs).le have hdS0 : 0 ≤ dS p q := by unfold dS positivity gcongr _ = (kappa * R + L * ((dx : ℝ) ^ 2 * kappa ^ 2) * (3 * s⁻¹ ^ 2 * L + s⁻¹)) * dS p q := by ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AmbientOperatorBridge.atomicW1_le_dS_of_certificates · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AmbientOperatorBridge.lean:524
theorem modelLaw_wass1_le_dS_of_certificates

Model membership discharges every analytic side condition in the ambient certificate comparison. What remains for the paper-specific spectral step is exactly one independently chosen real diagonalization and representation certificate for each model law. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 kappa :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hsigma :
0 < sigma0
hsigmaMax :
sigma0 ≤ 1
P Q :
ModelLaw k dx dz L pi0 sigma0
DP :
RealDiagonalization (ambientEffectOperator P.summary)
DQ :
RealDiagonalization (ambientEffectOperator Q.summary)
hrepP :
RepresentsAtomicLaw DP (toLp 2 P.summary.mX) (toLp 2 (firstBasis dx)) (GapFreeModulusBridge.asNeutral (quotientLawRaw P.P (effectRadius dz L sigma0)))
hrepQ :
RepresentsAtomicLaw DQ (toLp 2 Q.summary.mX) (toLp 2 (firstBasis dx)) (GapFreeModulusBridge.asNeutral (quotientLawRaw Q.P (effectRadius dz L sigma0)))
hkappa :
0 ≤ kappa
hkP :
DP.conditionNumber ≤ kappa
hkQ :
DQ.conditionNumber ≤ kappa
hRP :
DP.SpectrumBound (effectRadius dz L sigma0)
hRQ :
DQ.SpectrumBound (effectRadius dz L sigma0)
AtomicLaw.LawModulo.wass1 (by letI := P.prob exact quotientLaw P.P P.model) (by letI := Q.prob exact quotientLaw Q.P Q.model)
≤ (kappa * effectRadius dz L sigma0 + L * ((dx : ℝ) ^ 2 * kappa ^ 2) * (3 * (pi0 * sigma0 ^ 2)⁻¹ ^ 2 * L + (pi0 * sigma0 ^ 2)⁻¹)) * dS P.summary Q.summary
Proof (Lean source)
-- @node: ambientOperatorBridge_modelLaw_wass1_le_dS_of_certificates theorem modelLaw_wass1_le_dS_of_certificates {k dx dz : ℕ} {L pi0 sigma0 kappa : ℝ} (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hpiMax : pi0 ≤ 1 / (2 * k : ℝ)) (hsigma : 0 < sigma0) (hsigmaMax : sigma0 ≤ 1) (P Q : ModelLaw k dx dz L pi0 sigma0) (DP : RealDiagonalization (ambientEffectOperator P.summary)) (DQ : RealDiagonalization (ambientEffectOperator Q.summary)) (hrepP : RepresentsAtomicLaw DP (toLp 2 P.summary.mX) (toLp 2 (firstBasis dx)) (GapFreeModulusBridge.asNeutral (quotientLawRaw P.P (effectRadius dz L sigma0)))) (hrepQ : RepresentsAtomicLaw DQ (toLp 2 Q.summary.mX) (toLp 2 (firstBasis dx)) (GapFreeModulusBridge.asNeutral (quotientLawRaw Q.P (effectRadius dz L sigma0)))) (hkappa : 0 ≤ kappa) (hkP : DP.conditionNumber ≤ kappa) (hkQ : DQ.conditionNumber ≤ kappa) (hRP : DP.SpectrumBound (effectRadius dz L sigma0)) (hRQ : DQ.SpectrumBound (effectRadius dz L sigma0)) : AtomicLaw.LawModulo.wass1 (by letI := P.prob exact quotientLaw P.P P.model) (by letI := Q.prob exact quotientLaw Q.P Q.model) ≤ (kappa * effectRadius dz L sigma0 + L * ((dx : ℝ) ^ 2 * kappa ^ 2) * (3 * (pi0 * sigma0 ^ 2)⁻¹ ^ 2 * L + (pi0 * sigma0 ^ 2)⁻¹)) * dS P.summary Q.summary := by letI := P.prob have hPb := model_summary_ambient_bounds P.P hk hkx hkz hL hpi hpiMax hsigma hsigmaMax P.model letI := Q.prob have hQb := model_summary_ambient_bounds Q.P hk hkx hkz hL hpi hpiMax hsigma hsigmaMax Q.model rw [quotientLaw, quotientLaw, AtomicLaw.LawModulo.wass1_ofProbabilityLaw] rw [GapFreeModulusBridge.wass1_eq_neutralW1 (quotientLawRaw_valid P.P P.model) (quotientLawRaw_valid Q.P Q.model)] apply atomicW1_le_dS_of_certificates P.summary Q.summary (GapFreeModulusBridge.asNeutral (quotientLawRaw P.P (effectRadius dz L sigma0))) (GapFreeModulusBridge.asNeutral (quotientLawRaw Q.P (effectRadius dz L sigma0))) DP DQ (mul_pos hpi (sq_pos_of_pos hsigma)) (by linarith) hkappa (by unfold effectRadius; positivity) (by omega) · exact (hPb.1 false).1 · exact (hQb.1 false).1 · exact (hPb.1 true).1 · exact (hQb.1 true).1 · exact (hPb.1 false).2.1 · exact (hQb.1 false).2.1 · exact (hPb.1 true).2.1 · exact (hQb.1 true).2.1 · exact (hPb.1 false).2.2 · exact (hPb.1 true).2.2 · exact hQb.2 · exact GapFreeModulusBridge.asNeutral_valid (quotientLawRaw_valid P.P P.model) · exact GapFreeModulusBridge.asNeutral_valid (quotientLawRaw_valid Q.P Q.model) · exact hrepP · exact hrepQ · exact hkP · exact hkQ · exact hRP · exact hRQ
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AmbientOperatorBridge.modelLaw_wass1_le_dS_of_certificates · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AmbientOperatorBridge.lean:582
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.AtomicLaw 71 declarations Finite atomic probability laws and their finite-transport formulation of one-Wasserstein loss.

Finite atomic probability laws and their finite-transport formulation of one-Wasserstein loss.

A labelled representation of a probability law with at most k atoms in [-radius,radius]. Coincident locations are intentionally allowed; toMeasure aggregates them. It uses the supplied parameters.

Definition (Lean source)
k :
radius :
weight :
Fin k → ℝ
atom :
Fin k → ℝ
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:16
instance instTopologicalSpaceAtomicLaw

For the ambient setting, the stated instance is given by its defining clause.

Definition (Lean source)
instance {k : ℕ} {radius : ℝ} : TopologicalSpace (AtomicLaw k radius) := TopologicalSpace.induced (fun ν => (ν.weight, ν.atom)) inferInstance
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.instTopologicalSpaceAtomicLaw · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:22
instance instMeasurableSpaceAtomicLaw

The canonical Borel structure inherited from the two real coordinate vectors. For the ambient setting, the defined object is given by its defining clause.

Definition (Lean source)
instance {k : ℕ} {radius : ℝ} : MeasurableSpace (AtomicLaw k radius) := comap (fun ν => (ν.weight, ν.atom)) inferInstance
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.instMeasurableSpaceAtomicLaw · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:26
def deltaZero

The labelled representation of the unit point mass at zero. For the ambient setting, the defined object is given by its defining clause.

Definition (Lean source)
k :
radius :
deltaZero :
AtomicLaw k radius
{ weight := fun i => if i.val = 0 then 1 else 0 atom := fun _ => 0 }
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.deltaZero · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:32

The simplex and support constraints making a representation a probability law. For the ambient setting, the defined object is given by its defining clause.

Definition (Lean source)
k :
radius :
ν :
AtomicLaw k radius
Valid ν :
Prop
clause 1
i :
0 ≤ ν.weight i
clause 2
∑ i, ν.weight i = 1
clause 3
i :
ν.atom i ∈ Icc (-radius) radius
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.Valid · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:37
def coordinateHomeomorph

Atomic-law coordinates give a homeomorphism with the pair of finite real coordinate vectors. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k :
radius :
coordinateHomeomorph k radius :
AtomicLaw k radius ≃ₜ (Fin k → ℝ) × (Fin k → ℝ)
by refine Homeomorph.mk { toFun := fun nu => (nu.weight, nu.atom) invFun := fun p => ⟨p.1, p.2⟩ left_inv := fun nu => rfl right_inv := fun p => rfl } continuous_induced_dom ?_ apply continuous_induced_rng.mpr exact continuous_id
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.coordinateHomeomorph · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:43
theorem valid_isCompact

The valid labelled atomic parameter space is compact. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
IsCompact {nu : AtomicLaw k radius | Valid nu}
Proof (Lean source)
-- @node: atomicLaw_valid_isCompact lemma valid_isCompact (k : ℕ) (radius : ℝ) : IsCompact {nu : AtomicLaw k radius | Valid nu} := by let T : Set ((Fin k → ℝ) × (Fin k → ℝ)) := {p | (∀ i, 0 ≤ p.1 i) ∧ (∑ i, p.1 i = 1) ∧ ∀ i, p.2 i ∈ Icc (-radius) radius} have hTclosed : IsClosed T := by dsimp [T] simp only [Set.setOf_and] apply IsClosed.inter · simpa only [Set.iInter_ofPred] using (isClosed_iInter fun i => isClosed_le (continuous_const : Continuous (fun _ : (Fin k → ℝ) × (Fin k → ℝ) => (0 : ℝ))) (by fun_prop : Continuous (fun p : (Fin k → ℝ) × (Fin k → ℝ) => p.1 i))) apply IsClosed.inter · exact isClosed_eq (by fun_prop : Continuous (fun p : (Fin k → ℝ) × (Fin k → ℝ) => ∑ i, p.1 i)) (continuous_const : Continuous (fun _ : (Fin k → ℝ) × (Fin k → ℝ) => (1 : ℝ))) · rw [show {p : (Fin k → ℝ) × (Fin k → ℝ) | ∀ i, p.2 i ∈ Icc (-radius) radius} = ⋂ i, {p | -radius ≤ p.2 i} ∩ {p | p.2 i ≤ radius} by ext p simp [Set.mem_Icc]] exact isClosed_iInter fun i => IsClosed.inter (isClosed_le (continuous_const : Continuous (fun _ : (Fin k → ℝ) × (Fin k → ℝ) => -radius)) (by fun_prop : Continuous (fun p : (Fin k → ℝ) × (Fin k → ℝ) => p.2 i))) (isClosed_le (by fun_prop : Continuous (fun p : (Fin k → ℝ) × (Fin k → ℝ) => p.2 i)) (continuous_const : Continuous (fun _ : (Fin k → ℝ) × (Fin k → ℝ) => radius))) have hTsub : T ⊆ Icc ((fun _ => 0), (fun _ => -radius)) ((fun _ => 1), (fun _ => radius)) := by intro p hp refine ⟨⟨hp.1, fun i => hp.2.2 i |>.1⟩, ⟨?_, fun i => hp.2.2 i |>.2⟩⟩ intro i rw [← hp.2.1] exact Finset.single_le_sum (fun j _ => hp.1 j) (Finset.mem_univ i) have hTcompact : IsCompact T := IsCompact.of_isClosed_subset isCompact_Icc hTclosed hTsub rw [show {nu : AtomicLaw k radius | Valid nu} = (coordinateHomeomorph k radius) ⁻¹' T by rfl] exact (coordinateHomeomorph k radius).isCompact_preimage.mpr hTcompact
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.valid_isCompact · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:55

The actual carrier of at-most-k probability laws supported in the stated interval.

Definition (Lean source)
k :
radius :
ProbabilityLaw k radius :
Type
{ν : AtomicLaw k radius // Valid ν}
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.ProbabilityLaw · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:103
instance probabilityLawCompactSpace

Valid labelled laws inherit compactness from the compact valid coordinate set. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
-- @node: probabilityLaw_compactSpace instance probabilityLawCompactSpace (k : ℕ) (radius : ℝ) : CompactSpace (ProbabilityLaw k radius) := isCompact_iff_compactSpace.mp (valid_isCompact k radius)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.probabilityLawCompactSpace · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:106
theorem deltaZero_valid

Delta zero valid: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
hk :
0 < k
hradius :
0 ≤ radius
Valid (deltaZero : AtomicLaw k radius)
Proof (Lean source)
lemma deltaZero_valid {k : ℕ} {radius : ℝ} (hk : 0 < k) (hradius : 0 ≤ radius) : Valid (deltaZero : AtomicLaw k radius) := by classical unfold Valid constructor · intro i change 0 ≤ if i.val = 0 then 1 else 0 split_ifs <;> norm_num constructor · cases k with | zero => omega | succ k => change (∑ i : Fin (k + 1), if i.val = 0 then (1 : ℝ) else 0) = 1 rw [Fin.sum_univ_succ] simp · intro i change -radius ≤ 0 ∧ 0 ≤ radius constructor <;> linarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.deltaZero_valid · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:112
def deltaZeroLaw

The bundled unit point mass at zero. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k :
radius :
hk :
0 < k
hradius :
0 ≤ radius
deltaZeroLaw hk hradius :
⟨deltaZero, deltaZero_valid hk hradius⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.deltaZeroLaw · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:132
instance instCoe

For the ambient setting, the stated instance is given by its defining clause.

Definition (Lean source)
instance {k : ℕ} {radius : ℝ} : Coe (ProbabilityLaw k radius) (AtomicLaw k radius) := ⟨Subtype.val⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.ProbabilityLaw.instCoe · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:139
def toMeasure

The probability measure represented by a finite atomic law. For the ambient setting, the defined object is given by its defining clause.

Definition (Lean source)
k :
radius :
ν :
AtomicLaw k radius
toMeasure ν :
∑ i, ofReal (ν.weight i) • Measure.dirac (ν.atom i)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.toMeasure · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:145
def toMeasure

The represented measure of a bundled valid atomic probability law. For the ambient setting, the defined object is given by its defining clause.

Definition (Lean source)
k :
radius :
ν :
toMeasure ν :
AtomicLaw.toMeasure ν.1
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.ProbabilityLaw.toMeasure · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:149
theorem toMeasure_singleton

A finite atomic law assigns a singleton its aggregate weight at that location. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius x :
ν :
AtomicLaw k radius
:
Valid ν
ν.toMeasure {x} = ofReal (∑ i with ν.atom i = x, ν.weight i)
Proof (Lean source)
-- @node: atomicLaw_toMeasure_singleton lemma toMeasure_singleton {k : ℕ} {radius x : ℝ} (ν : AtomicLaw k radius) (hν : Valid ν) : ν.toMeasure {x} = ofReal (∑ i with ν.atom i = x, ν.weight i) := by simp only [toMeasure, Measure.coe_finsetSum, Finset.sum_apply, Measure.smul_apply, Measure.dirac_apply' _ (MeasurableSet.singleton x)] rw [ENNReal.ofReal_sum_of_nonneg] · simp [indicator, eq_comm, Finset.sum_filter] · intro i hi exact hν.1 i
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.toMeasure_singleton · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:154
theorem toMeasure_isProbability

To measure is probability: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
ν :
Proof (Lean source)
lemma ProbabilityLaw.toMeasure_isProbability {k : ℕ} {radius : ℝ} (ν : ProbabilityLaw k radius) : IsProbabilityMeasure ν.toMeasure := by constructor simp [ProbabilityLaw.toMeasure, AtomicLaw.toMeasure] convert congrArg ofReal ν.property.2.1 using 1 <;> simp [ENNReal.ofReal_sum_of_nonneg, ν.property.1]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.ProbabilityLaw.toMeasure_isProbability · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:166
instance instIsProbabilityMeasureRealToMeasure

For the ambient setting, the stated instance is given by its defining clause.

Definition (Lean source)
instance {k : ℕ} {radius : ℝ} (ν : ProbabilityLaw k radius) : IsProbabilityMeasure ν.toMeasure := ν.toMeasure_isProbability
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.instIsProbabilityMeasureRealToMeasure · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:174
def MeasureEquivalent

Two valid finite representations denote the same law exactly when their represented measures agree. This removes all dependence on zero-mass slots and on how coincident atoms are labelled. For the ambient setting, the defined object is given by its defining clause.

Definition (Lean source)
k :
radius :
ν ξ :
MeasureEquivalent ν ξ :
Prop
ν.toMeasure = ξ.toMeasure
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.ProbabilityLaw.MeasureEquivalent · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:178
theorem aggregate_weight

Equivalent labelled laws have the same aggregate weight at every location. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
h :
ν.MeasureEquivalent ξ
x :
(∑ i with ν.1.atom i = x, ν.1.weight i) = ∑ j with ξ.1.atom j = x, ξ.1.weight j
Proof (Lean source)
-- @node: measureEquivalent_aggregate_weight lemma ProbabilityLaw.MeasureEquivalent.aggregate_weight {k : ℕ} {radius : ℝ} {ν ξ : ProbabilityLaw k radius} (h : ν.MeasureEquivalent ξ) (x : ℝ) : (∑ i with ν.1.atom i = x, ν.1.weight i) = ∑ j with ξ.1.atom j = x, ξ.1.weight j := by have heq := congrArg (fun μ : Measure ℝ => μ {x}) h rw [ProbabilityLaw.toMeasure, ProbabilityLaw.toMeasure, toMeasure_singleton ν.1 ν.2, toMeasure_singleton ξ.1 ξ.2] at heq apply (ENNReal.ofReal_eq_ofReal_iff (sum_nonneg fun i _ => ν.2.1 i) (sum_nonneg fun j _ => ξ.2.1 j)).mp heq
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.ProbabilityLaw.MeasureEquivalent.aggregate_weight · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:184
instance probabilityLawSetoid

For the supplied parameters, probability Law Setoid is given by its defining clause.

Definition (Lean source)
instance probabilityLawSetoid (k : ℕ) (radius : ℝ) : Setoid (ProbabilityLaw k radius) where r := ProbabilityLaw.MeasureEquivalent iseqv := ⟨fun _ => rfl, fun h => h.symm, fun h₁ h₂ => h₁.trans h₂⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.probabilityLawSetoid · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:197

Extensional at-most-k probability laws: valid atomic representations modulo toMeasure. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k :
radius :
LawModulo k radius :
Type
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.LawModulo · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:202
def ofProbabilityLaw

Send a valid labelled representation to its extensional law. For the ambient setting, the defined object is given by its defining clause.

Definition (Lean source)
k :
radius :
ν :
ofProbabilityLaw ν :
LawModulo k radius
Quotient.mk _ ν
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.LawModulo.ofProbabilityLaw · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:207
def deltaZeroLaw

Extensional unit point mass at zero. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k :
radius :
hk :
0 < k
hradius :
0 ≤ radius
deltaZeroLaw hk hradius :
LawModulo k radius
ofProbabilityLaw (AtomicLaw.deltaZeroLaw hk hradius)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.LawModulo.deltaZeroLaw · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:211

A finite representative used internally by explicit algorithms. Public equality remains measure equality through the quotient. For the ambient setting, the defined object is given by its defining clause.

Definition (Lean source)
k :
radius :
ν :
LawModulo k radius
representative ν :
Quotient.out ν
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.LawModulo.representative · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:216
instance instTopologicalSpace

For the ambient setting, the stated instance is given by its defining clause.

Definition (Lean source)
instance {k : ℕ} {radius : ℝ} : TopologicalSpace (LawModulo k radius) := TopologicalSpace.coinduced (@ofProbabilityLaw k radius) inferInstance
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.LawModulo.instTopologicalSpace · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:221
instance instMeasurableSpace

For the ambient setting, the stated instance is given by its defining clause.

Definition (Lean source)
instance {k : ℕ} {radius : ℝ} : MeasurableSpace (LawModulo k radius) := MeasurableSpace.map (@ofProbabilityLaw k radius) inferInstance
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.LawModulo.instMeasurableSpace · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:225
instance compactSpace

The quotient of the compact valid labelled parameter space is compact in its coinduced topology. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
-- @node: lawModulo_compactSpace instance compactSpace (k : ℕ) (radius : ℝ) : CompactSpace (LawModulo k radius) := by rw [← isCompact_univ_iff] have hsurj : Surjective (@ofProbabilityLaw k radius) := by intro q exact ⟨q.out, Quotient.out_eq q⟩ rw [← Set.image_univ_of_surjective hsurj] exact isCompact_univ.image continuous_coinduced_rng
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.LawModulo.compactSpace · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:229
def toMeasure

The represented probability measure, independent of the chosen labelled representative. For the ambient setting, the defined object is given by its defining clause.

Definition (Lean source)
k :
radius :
ν :
LawModulo k radius
toMeasure ν :
ν.representative.toMeasure
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.LawModulo.toMeasure · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:240
theorem toMeasure_eq_of_mk

To measure eq of mk: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
ν :
toMeasure (ofProbabilityLaw ν) = ν.toMeasure
Proof (Lean source)
lemma toMeasure_eq_of_mk {k : ℕ} {radius : ℝ} (ν : ProbabilityLaw k radius) : toMeasure (ofProbabilityLaw ν) = ν.toMeasure := by exact Quotient.mk_out ν
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.LawModulo.toMeasure_eq_of_mk · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:244
instance instIsProbabilityMeasureRealToMeasure

For the ambient setting, the stated instance is given by its defining clause.

Definition (Lean source)
instance {k : ℕ} {radius : ℝ} (ν : LawModulo k radius) : IsProbabilityMeasure ν.toMeasure := by unfold toMeasure infer_instance
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.LawModulo.instIsProbabilityMeasureRealToMeasure · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:249

A finite coupling between two labelled atomic representations. It uses the ambient setting. It uses the ambient setting. It uses the ambient setting. It uses the ambient setting.

Definition (Lean source)
k :
radius :
ν ξ :
AtomicLaw k radius
mass :
Fin k → Fin k → ℝ
nonneg :
∀ i j, 0 ≤ mass i j
fst_marginal :
∀ i, ∑ j, mass i j = ν.weight i
snd_marginal :
∀ j, ∑ i, mass i j = ξ.weight j
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.TransportPlan · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:257
def zeroTransportPlan

Equivalent labelled probability laws have a coupling supported on equal locations. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k :
radius :
ν ξ :
h :
ν.MeasureEquivalent ξ
zeroTransportPlan ν ξ h :
TransportPlan ν.1 ξ.1
by let A : ℝ → ℝ := fun x
=> ∑ j with ξ.1.atom j = x, ξ.1.weight j refine { mass := fun i j => if ν.1.atom i = ξ.1.atom j then ν.1.weight i * ξ.1.weight j / A (ν.1.atom i) else 0 nonneg := ?_ fst_marginal := ?_ snd_marginal := ?_ } · intro i j split_ifs · exact div_nonneg (mul_nonneg (ν.2.1 i) (ξ.2.1 j)) (sum_nonneg fun l _ => ξ.2.1 l) · exact le_rfl · intro i by_cases hwi : ν.1.weight i = 0 · simp [hwi] have hAi : 0 < A (ν.1.atom i) := by change 0 < ∑ j with ξ.1.atom j = ν.1.atom i, ξ.1.weight j rw [← ProbabilityLaw.MeasureEquivalent.aggregate_weight h (ν.1.atom i)] exact lt_of_lt_of_le (lt_of_le_of_ne (ν.2.1 i) (Ne.symm hwi)) (Finset.single_le_sum (fun l _ => ν.2.1 l) (Finset.mem_filter.mpr ⟨Finset.mem_univ _, rfl⟩)) calc (∑ j, if ν.1.atom i = ξ.1.atom j then ν.1.weight i * ξ.1.weight j / A (ν.1.atom i) else 0) = ∑ j with ξ.1.atom j = ν.1.atom i, ν.1.weight i * ξ.1.weight j / A (ν.1.atom i) := by rw [Finset.sum_filter] apply Finset.sum_congr rfl intro j hj by_cases hij : ξ.1.atom j = ν.1.atom i · simp only [hij, if_pos] · have hij' : ¬ν.1.atom i = ξ.1.atom j := fun e => hij e.symm simp only [hij, hij'] _ = (ν.1.weight i / A (ν.1.atom i)) * (∑ j with ξ.1.atom j = ν.1.atom i, ξ.1.weight j) := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro j hj ring _ = ν.1.weight i := by rw [show (∑ j with ξ.1.atom j = ν.1.atom i, ξ.1.weight j) = A (ν.1.atom i) by rfl] exact div_mul_cancel₀ _ (ne_of_gt hAi) · intro j by_cases hwj : ξ.1.weight j = 0 · simp [hwj] have hAj : 0 < A (ξ.1.atom j) := lt_of_lt_of_le (lt_of_le_of_ne (ξ.2.1 j) (Ne.symm hwj)) (Finset.single_le_sum (fun l _ => ξ.2.1 l) (Finset.mem_filter.mpr ⟨Finset.mem_univ _, rfl⟩)) calc (∑ i, if ν.1.atom i = ξ.1.atom j then ν.1.weight i * ξ.1.weight j / A (ν.1.atom i) else 0) = ∑ i with ν.1.atom i = ξ.1.atom j, ν.1.weight i * ξ.1.weight j / A (ξ.1.atom j) := by rw [Finset.sum_filter] apply Finset.sum_congr rfl intro i hi by_cases hij : ν.1.atom i = ξ.1.atom j <;> simp [hij] _ = ((∑ i with ν.1.atom i = ξ.1.atom j, ν.1.weight i) * ξ.1.weight j) / A (ξ.1.atom j) := by simp only [div_eq_mul_inv, ← Finset.sum_mul] _ = ξ.1.weight j := by rw [ProbabilityLaw.MeasureEquivalent.aggregate_weight h (ξ.1.atom j)] change A (ξ.1.atom j) * ξ.1.weight j / A (ξ.1.atom j) = _ field_simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.ProbabilityLaw.MeasureEquivalent.zeroTransportPlan · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:264
def transportCost

Cost of a finite transport plan for absolute-distance loss. For the ambient setting, the defined object is given by its defining clause.

Definition (Lean source)
k :
radius :
AtomicLaw k radius
γ :
transportCost γ :
∑ i, ∑ j, γ.mass i j * |ν.atom i - ξ.atom j|
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.transportCost · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:336
theorem zeroTransportCost

The coupling between equivalent representations has zero transport cost. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
ν ξ :
h :
ν.MeasureEquivalent ξ
transportCost (h.zeroTransportPlan ν ξ) = 0
Proof (Lean source)
-- @node: measureEquivalent_zeroTransportCost lemma ProbabilityLaw.MeasureEquivalent.zeroTransportCost {k : ℕ} {radius : ℝ} (ν ξ : ProbabilityLaw k radius) (h : ν.MeasureEquivalent ξ) : transportCost (h.zeroTransportPlan ν ξ) = 0 := by classical unfold transportCost ProbabilityLaw.MeasureEquivalent.zeroTransportPlan apply Finset.sum_eq_zero intro i hi apply Finset.sum_eq_zero intro j hj by_cases hij : ν.1.atom i = ξ.1.atom j · simp [hij] · simp [hij]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.ProbabilityLaw.MeasureEquivalent.zeroTransportCost · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:341

One-Wasserstein distance, definitionally the infimum over the finite transport polytope. @realizes W1W_1(infimum of finite transport costs) For the ambient setting, the defined object is given by its defining clause.

Definition (Lean source)
k :
radius :
ν ξ :
AtomicLaw k radius
wass1 ν ξ :
sInf {c : ℝ | ∃ γ : TransportPlan ν ξ, transportCost γ = c}
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.wass1 · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:357
theorem wass1_le_of_plan

Every feasible transport plan upper-bounds the infimal transport cost. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
AtomicLaw k radius
γ :
wass1 ν ξ ≤ transportCost γ
Proof (Lean source)
-- @node: wass1_le_of_plan lemma wass1_le_of_plan {k : ℕ} {radius : ℝ} {ν ξ : AtomicLaw k radius} (γ : TransportPlan ν ξ) : wass1 ν ξ ≤ transportCost γ := by unfold wass1 apply csInf_le · refine ⟨0, ?_⟩ rintro c ⟨q, rfl⟩ unfold transportCost exact sum_nonneg fun i _ => sum_nonneg fun j _ => mul_nonneg (q.nonneg i j) (abs_nonneg _) · exact ⟨γ, rfl⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.wass1_le_of_plan · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:362
theorem wass1_optimal_plan

The finite transport polytope attains the infimum defining wass1. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
AtomicLaw k radius
:
Valid ν
:
Valid ξ
∃ γ : TransportPlan ν ξ, transportCost γ = wass1 ν ξ
Proof (Lean source)
-- @node: wass1_optimal_plan lemma wass1_optimal_plan {k : ℕ} {radius : ℝ} {ν ξ : AtomicLaw k radius} (hν : Valid ν) (hξ : Valid ξ) : ∃ γ : TransportPlan ν ξ, transportCost γ = wass1 ν ξ := by classical let S : Set (Fin k → Fin k → ℝ) := {m | (∀ i j, 0 ≤ m i j) ∧ (∀ i, ∑ j, m i j = ν.weight i) ∧ ∀ j, ∑ i, m i j = ξ.weight j} have hSne : S.Nonempty := by refine ⟨fun i j => ν.weight i * ξ.weight j, ?_⟩ refine ⟨fun i j => mul_nonneg (hν.1 i) (hξ.1 j), ?_, ?_⟩ · intro i rw [← Finset.mul_sum, hξ.2.1, mul_one] · intro j rw [← Finset.sum_mul, hν.2.1, one_mul] have hweight_le_one (i : Fin k) : ν.weight i ≤ 1 := by rw [← hν.2.1] exact Finset.single_le_sum (fun j _ => hν.1 j) (Finset.mem_univ i) have hSsub : S ⊆ Icc (fun _ _ => 0) (fun _ _ => 1) := by intro m hm refine ⟨fun i j => hm.1 i j, fun i j => ?_⟩ calc m i j ≤ ∑ r, m i r := Finset.single_le_sum (fun r _ => hm.1 i r) (Finset.mem_univ j) _ = ν.weight i := hm.2.1 i _ ≤ 1 := hweight_le_one i have hSclosed : IsClosed S := by dsimp [S] simp only [Set.setOf_and] apply IsClosed.inter · simpa only [Set.iInter_ofPred] using (isClosed_iInter fun i => isClosed_iInter fun j => isClosed_le (continuous_const : Continuous (fun _ : Fin k → Fin k → ℝ => (0 : ℝ))) (by fun_prop : Continuous (fun m : Fin k → Fin k → ℝ => m i j))) apply IsClosed.inter · simpa only [Set.iInter_ofPred] using (isClosed_iInter fun i => isClosed_eq (by fun_prop : Continuous (fun m : Fin k → Fin k → ℝ => ∑ j, m i j)) (by fun_prop : Continuous (fun _ : Fin k → Fin k → ℝ => ν.weight i))) · simpa only [Set.iInter_ofPred] using (isClosed_iInter fun j => isClosed_eq (by fun_prop : Continuous (fun m : Fin k → Fin k → ℝ => ∑ i, m i j)) (by fun_prop : Continuous (fun _ : Fin k → Fin k → ℝ => ξ.weight j))) have hScompact : IsCompact S := IsCompact.of_isClosed_subset isCompact_Icc hSclosed hSsub let cost : (Fin k → Fin k → ℝ) → ℝ := fun m => ∑ i, ∑ j, m i j * |ν.atom i - ξ.atom j| have hcost_cont : Continuous cost := by unfold cost fun_prop obtain ⟨m, hmS, hmmin⟩ := hScompact.exists_isMinOn hSne hcost_cont.continuousOn let γ : TransportPlan ν ξ := { mass := m nonneg := hmS.1 fst_marginal := hmS.2.1 snd_marginal := hmS.2.2 } refine ⟨γ, ?_⟩ have hcost_nonneg (q : TransportPlan ν ξ) : 0 ≤ transportCost q := by unfold transportCost exact sum_nonneg fun i _ => sum_nonneg fun j _ => mul_nonneg (q.nonneg i j) (abs_nonneg _) have hvalues_ne : ({c : ℝ | ∃ q : TransportPlan ν ξ, transportCost q = c}).Nonempty := ⟨transportCost γ, γ, rfl⟩ have hvalues_bdd : BddBelow {c : ℝ | ∃ q : TransportPlan ν ξ, transportCost q = c} := by refine ⟨0, ?_⟩ rintro c ⟨q, rfl⟩ exact hcost_nonneg q apply le_antisymm · unfold wass1 apply le_csInf hvalues_ne rintro c ⟨q, rfl⟩ simpa [cost, transportCost, γ] using hmmin ⟨q.nonneg, q.fst_marginal, q.snd_marginal⟩ · unfold wass1 exact csInf_le hvalues_bdd ⟨γ, rfl⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.wass1_optimal_plan · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:375
theorem wass1_nonneg

Finite-transport Wasserstein loss is nonnegative on valid labelled laws. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
AtomicLaw k radius
:
Valid ν
:
Valid ξ
0 ≤ wass1 ν ξ
Proof (Lean source)
-- @node: atomicLaw_wass1_nonneg lemma wass1_nonneg {k : ℕ} {radius : ℝ} {ν ξ : AtomicLaw k radius} (hν : Valid ν) (hξ : Valid ξ) : 0 ≤ wass1 ν ξ := by obtain ⟨γ, hγ⟩ := wass1_optimal_plan hν hξ rw [← hγ] unfold transportCost exact sum_nonneg fun i _ => sum_nonneg fun j _ => mul_nonneg (γ.nonneg i j) (abs_nonneg _)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.wass1_nonneg · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:454
theorem wass1_comm

Transposing a finite coupling proves symmetry of finite-transport Wasserstein loss. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
ν ξ :
AtomicLaw k radius
wass1 ν ξ = wass1 ξ ν
Proof (Lean source)
-- @node: atomicLaw_wass1_comm lemma wass1_comm {k : ℕ} {radius : ℝ} (ν ξ : AtomicLaw k radius) : wass1 ν ξ = wass1 ξ ν := by unfold wass1 congr 1 ext c constructor · rintro ⟨γ, rfl⟩ let γ' : TransportPlan ξ ν := { mass := fun i j => γ.mass j i nonneg := fun i j => γ.nonneg j i fst_marginal := γ.snd_marginal snd_marginal := γ.fst_marginal } refine ⟨γ', ?_⟩ unfold transportCost γ' rw [Finset.sum_comm] apply Finset.sum_congr rfl intro i hi apply Finset.sum_congr rfl intro j hj rw [abs_sub_comm] · rintro ⟨γ, rfl⟩ let γ' : TransportPlan ν ξ := { mass := fun i j => γ.mass j i nonneg := fun i j => γ.nonneg j i fst_marginal := γ.snd_marginal snd_marginal := γ.fst_marginal } refine ⟨γ', ?_⟩ unfold transportCost γ' rw [Finset.sum_comm] apply Finset.sum_congr rfl intro i hi apply Finset.sum_congr rfl intro j hj rw [abs_sub_comm]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.wass1_comm · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:464
theorem wass1_self

A valid labelled law has zero finite-transport Wasserstein loss from itself. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
ν :
AtomicLaw k radius
:
Valid ν
wass1 ν ν = 0
Proof (Lean source)
-- @node: atomicLaw_wass1_self lemma wass1_self {k : ℕ} {radius : ℝ} (ν : AtomicLaw k radius) (hν : Valid ν) : wass1 ν ν = 0 := by let γ : TransportPlan ν ν := { mass := fun i j => if i = j then ν.weight i else 0 nonneg := fun i j => by split_ifs with hij · exact hν.1 i · exact le_rfl fst_marginal := fun i => by simp snd_marginal := fun j => by simp [eq_comm] } apply le_antisymm · calc wass1 ν ν ≤ transportCost γ := wass1_le_of_plan γ _ = 0 := by simp [transportCost, γ] · exact wass1_nonneg hν hν
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.wass1_self · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:501
theorem wass1_eq_zero

Finite-transport loss vanishes between measure-equivalent valid representations. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
ν ξ :
h :
ν.MeasureEquivalent ξ
wass1 ν.1 ξ.1 = 0
Proof (Lean source)
-- @node: measureEquivalent_wass1_eq_zero lemma ProbabilityLaw.MeasureEquivalent.wass1_eq_zero {k : ℕ} {radius : ℝ} (ν ξ : ProbabilityLaw k radius) (h : ν.MeasureEquivalent ξ) : wass1 ν.1 ξ.1 = 0 := by apply le_antisymm · calc wass1 ν.1 ξ.1 ≤ transportCost (h.zeroTransportPlan ν ξ) := wass1_le_of_plan (h.zeroTransportPlan ν ξ) _ = 0 := h.zeroTransportCost ν ξ · exact wass1_nonneg ν.2 ξ.2
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.ProbabilityLaw.MeasureEquivalent.wass1_eq_zero · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:519
theorem mass_eq_zero_of_snd_weight_eq_zero

A zero marginal forces every entry in the corresponding column of a nonnegative plan to vanish. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
AtomicLaw k radius
gamma :
j :
Fin k
hj :
xi.weight j = 0
i :
Fin k
gamma.mass i j = 0
Proof (Lean source)
-- @node: transportPlan_mass_eq_zero_of_snd_weight_eq_zero lemma TransportPlan.mass_eq_zero_of_snd_weight_eq_zero {k : ℕ} {radius : ℝ} {nu xi : AtomicLaw k radius} (gamma : TransportPlan nu xi) {j : Fin k} (hj : xi.weight j = 0) (i : Fin k) : gamma.mass i j = 0 := by apply le_antisymm · calc gamma.mass i j ≤ ∑ r, gamma.mass r j := Finset.single_le_sum (fun r _ => gamma.nonneg r j) (Finset.mem_univ i) _ = 0 := by rw [gamma.snd_marginal j, hj] · exact gamma.nonneg i j
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.TransportPlan.mass_eq_zero_of_snd_weight_eq_zero · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:531
def glue

Glue two finite couplings through their common intermediate marginal, interpreting every zero-mass intermediate slice as zero. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k :
radius :
AtomicLaw k radius
gamma :
eta :
glue gamma eta :
by classical refine { mass := fun i l => ∑ j, if xi.weight j = 0 then 0 else gamma.mass i j * eta.mass j l / xi.weight j nonneg := ?_ fst_marginal := ?_ snd_marginal := ?_ } · intro i l exact sum_nonneg fun j _
=> by split_ifs with hj · exact le_rfl · exact div_nonneg (mul_nonneg (gamma.nonneg i j) (eta.nonneg j l)) (lt_of_le_of_ne (by rw [← gamma.snd_marginal j] exact sum_nonneg fun r _ => gamma.nonneg r j) (Ne.symm hj)).le · intro i rw [Finset.sum_comm] calc (∑ j, ∑ l, if xi.weight j = 0 then 0 else gamma.mass i j * eta.mass j l / xi.weight j) = ∑ j, gamma.mass i j := by apply Finset.sum_congr rfl intro j hjmem by_cases hj : xi.weight j = 0 · simp [hj, gamma.mass_eq_zero_of_snd_weight_eq_zero hj i] · simp only [hj, if_false, div_eq_mul_inv, ← Finset.sum_mul, ← Finset.mul_sum, eta.fst_marginal j] rw [mul_assoc, mul_inv_cancel₀ hj, mul_one] _ = nu.weight i := gamma.fst_marginal i · intro l rw [Finset.sum_comm] calc (∑ j, ∑ i, if xi.weight j = 0 then 0 else gamma.mass i j * eta.mass j l / xi.weight j) = ∑ j, eta.mass j l := by apply Finset.sum_congr rfl intro j hjmem by_cases hj : xi.weight j = 0 · have heta : eta.mass j l = 0 := by apply le_antisymm · calc eta.mass j l ≤ ∑ r, eta.mass j r := Finset.single_le_sum (fun r _ => eta.nonneg j r) (Finset.mem_univ l) _ = 0 := by rw [eta.fst_marginal j, hj] · exact eta.nonneg j l simp [hj, heta] · simp only [hj, if_false, div_eq_mul_inv, ← Finset.sum_mul, ← Finset.sum_mul, gamma.snd_marginal j] field_simp _ = zeta.weight l := eta.snd_marginal l
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.TransportPlan.glue · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:545
theorem transportCost_glue_le

The glued coupling costs at most the sum of the two input coupling costs. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
AtomicLaw k radius
gamma :
eta :
transportCost (gamma.glue eta) ≤ transportCost gamma + transportCost eta
Proof (Lean source)
-- @node: transportCost_glue_le lemma transportCost_glue_le {k : ℕ} {radius : ℝ} {nu xi zeta : AtomicLaw k radius} (gamma : TransportPlan nu xi) (eta : TransportPlan xi zeta) : transportCost (gamma.glue eta) ≤ transportCost gamma + transportCost eta := by classical let q : Fin k → Fin k → Fin k → ℝ := fun i j l => if xi.weight j = 0 then 0 else gamma.mass i j * eta.mass j l / xi.weight j have hq_nonneg (i j l : Fin k) : 0 ≤ q i j l := by dsimp [q] split_ifs with hj · exact le_rfl · exact div_nonneg (mul_nonneg (gamma.nonneg i j) (eta.nonneg j l)) (lt_of_le_of_ne (by rw [← gamma.snd_marginal j] exact sum_nonneg fun r _ => gamma.nonneg r j) (Ne.symm hj)).le have hleft : (∑ i, ∑ l, ∑ j, q i j l * |nu.atom i - xi.atom j|) = transportCost gamma := by rw [show (∑ i, ∑ l, ∑ j, q i j l * |nu.atom i - xi.atom j|) = ∑ i, ∑ j, ∑ l, q i j l * |nu.atom i - xi.atom j| by apply Finset.sum_congr rfl intro i hi exact Finset.sum_comm] unfold transportCost apply Finset.sum_congr rfl intro i hi apply Finset.sum_congr rfl intro j hjmem by_cases hj : xi.weight j = 0 · simp [q, hj, gamma.mass_eq_zero_of_snd_weight_eq_zero hj i] · simp only [q, hj, if_false] simp only [div_eq_mul_inv, ← Finset.sum_mul, ← Finset.mul_sum, eta.fst_marginal j] field_simp have hright : (∑ i, ∑ l, ∑ j, q i j l * |xi.atom j - zeta.atom l|) = transportCost eta := by rw [show (∑ i, ∑ l, ∑ j, q i j l * |xi.atom j - zeta.atom l|) = ∑ j, ∑ l, ∑ i, q i j l * |xi.atom j - zeta.atom l| by calc (∑ i, ∑ l, ∑ j, q i j l * |xi.atom j - zeta.atom l|) = ∑ i, ∑ j, ∑ l, q i j l * |xi.atom j - zeta.atom l| := by apply Finset.sum_congr rfl intro i hi exact Finset.sum_comm _ = ∑ j, ∑ i, ∑ l, q i j l * |xi.atom j - zeta.atom l| := Finset.sum_comm _ = ∑ j, ∑ l, ∑ i, q i j l * |xi.atom j - zeta.atom l| := by apply Finset.sum_congr rfl intro j hj exact Finset.sum_comm] unfold transportCost apply Finset.sum_congr rfl intro j hjmem apply Finset.sum_congr rfl intro l hlmem by_cases hj : xi.weight j = 0 · have heta : eta.mass j l = 0 := by apply le_antisymm · calc eta.mass j l ≤ ∑ r, eta.mass j r := Finset.single_le_sum (fun r _ => eta.nonneg j r) (Finset.mem_univ l) _ = 0 := by rw [eta.fst_marginal j, hj] · exact eta.nonneg j l simp [q, hj, heta] · simp only [q, hj, if_false] simp only [div_eq_mul_inv, ← Finset.sum_mul, ← Finset.sum_mul, gamma.snd_marginal j] field_simp calc transportCost (gamma.glue eta) = ∑ i, ∑ l, (∑ j, q i j l) * |nu.atom i - zeta.atom l| := by rfl _ ≤ ∑ i, ∑ l, ∑ j, q i j l * (|nu.atom i - xi.atom j| + |xi.atom j - zeta.atom l|) := by apply Finset.sum_le_sum intro i hi apply Finset.sum_le_sum intro l hl rw [Finset.sum_mul] apply Finset.sum_le_sum intro j hj exact mul_le_mul_of_nonneg_left (abs_sub_le _ _ _) (hq_nonneg i j l) _ = (∑ i, ∑ l, ∑ j, q i j l * |nu.atom i - xi.atom j|) + (∑ i, ∑ l, ∑ j, q i j l * |xi.atom j - zeta.atom l|) := by simp_rw [mul_add, Finset.sum_add_distrib] _ = transportCost gamma + transportCost eta := by rw [hleft, hright]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.transportCost_glue_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:602
theorem wass1_triangle

Finite-transport Wasserstein loss satisfies the triangle inequality on valid laws. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
nu xi zeta :
wass1 nu.1 zeta.1 ≤ wass1 nu.1 xi.1 + wass1 xi.1 zeta.1
Proof (Lean source)
-- @node: atomicLaw_wass1_triangle lemma wass1_triangle {k : ℕ} {radius : ℝ} (nu xi zeta : ProbabilityLaw k radius) : wass1 nu.1 zeta.1 ≤ wass1 nu.1 xi.1 + wass1 xi.1 zeta.1 := by obtain ⟨gamma, hgamma⟩ := wass1_optimal_plan nu.2 xi.2 obtain ⟨eta, heta⟩ := wass1_optimal_plan xi.2 zeta.2 calc wass1 nu.1 zeta.1 ≤ transportCost (gamma.glue eta) := wass1_le_of_plan _ _ ≤ transportCost gamma + transportCost eta := transportCost_glue_le gamma eta _ = wass1 nu.1 xi.1 + wass1 xi.1 zeta.1 := by rw [hgamma, heta]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.wass1_triangle · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:692
theorem mass_eq_zero_of_cost_eq_zero

A zero-cost nonnegative coupling has no mass between distinct locations. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
AtomicLaw k radius
gamma :
hcost :
transportCost gamma = 0
i j :
Fin k
hij :
nu.atom i ≠ xi.atom j
gamma.mass i j = 0
Proof (Lean source)
-- @node: transportPlan_mass_eq_zero_of_cost_eq_zero lemma TransportPlan.mass_eq_zero_of_cost_eq_zero {k : ℕ} {radius : ℝ} {nu xi : AtomicLaw k radius} (gamma : TransportPlan nu xi) (hcost : transportCost gamma = 0) {i j : Fin k} (hij : nu.atom i ≠ xi.atom j) : gamma.mass i j = 0 := by have hterm_nonneg (r s : Fin k) : 0 ≤ gamma.mass r s * |nu.atom r - xi.atom s| := mul_nonneg (gamma.nonneg r s) (abs_nonneg _) have hle : gamma.mass i j * |nu.atom i - xi.atom j| ≤ transportCost gamma := by unfold transportCost calc gamma.mass i j * |nu.atom i - xi.atom j| ≤ ∑ s, gamma.mass i s * |nu.atom i - xi.atom s| := Finset.single_le_sum (fun s _ => hterm_nonneg i s) (Finset.mem_univ j) _ ≤ ∑ r, ∑ s, gamma.mass r s * |nu.atom r - xi.atom s| := Finset.single_le_sum (fun r _ => sum_nonneg fun s _ => hterm_nonneg r s) (Finset.mem_univ i) have hprod : gamma.mass i j * |nu.atom i - xi.atom j| = 0 := by apply le_antisymm · simpa [hcost] using hle · exact hterm_nonneg i j rcases mul_eq_zero.mp hprod with hmass | habs · exact hmass · exact elim (hij (sub_eq_zero.mp (abs_eq_zero.mp habs)))
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.TransportPlan.mass_eq_zero_of_cost_eq_zero · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:703
theorem measureEquivalent_of_transportCost_eq_zero

A zero-cost coupling identifies the represented probability measures. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
nu xi :
gamma :
TransportPlan nu.1 xi.1
hcost :
transportCost gamma = 0
nu.MeasureEquivalent xi
Proof (Lean source)
-- @node: measureEquivalent_of_transportCost_eq_zero lemma measureEquivalent_of_transportCost_eq_zero {k : ℕ} {radius : ℝ} (nu xi : ProbabilityLaw k radius) (gamma : TransportPlan nu.1 xi.1) (hcost : transportCost gamma = 0) : nu.MeasureEquivalent xi := by classical unfold ProbabilityLaw.MeasureEquivalent ext s hs simp only [ProbabilityLaw.toMeasure, AtomicLaw.toMeasure, Measure.coe_finsetSum, Finset.sum_apply, Measure.smul_apply, Measure.dirac_apply' _ hs] have hnu : (∑ i, ofReal (nu.1.weight i) • s.indicator 1 (nu.1.atom i)) = ∑ i, ofReal (nu.1.weight i * s.indicator 1 (nu.1.atom i)) := by apply Finset.sum_congr rfl intro i hi by_cases his : nu.1.atom i ∈ s <;> simp [indicator, his] have hxi : (∑ j, ofReal (xi.1.weight j) • s.indicator 1 (xi.1.atom j)) = ∑ j, ofReal (xi.1.weight j * s.indicator 1 (xi.1.atom j)) := by apply Finset.sum_congr rfl intro j hj by_cases hjs : xi.1.atom j ∈ s <;> simp [indicator, hjs] rw [hnu, hxi] rw [← ENNReal.ofReal_sum_of_nonneg (fun i _ => by by_cases his : nu.1.atom i ∈ s <;> simp [indicator, his, nu.2.1 i]), ← ENNReal.ofReal_sum_of_nonneg (fun j _ => by by_cases hjs : xi.1.atom j ∈ s <;> simp [indicator, hjs, xi.2.1 j])] congr 1 calc (∑ i, nu.1.weight i * s.indicator 1 (nu.1.atom i)) = ∑ i, ∑ j, gamma.mass i j * s.indicator 1 (nu.1.atom i) := by apply Finset.sum_congr rfl intro i hi rw [← gamma.fst_marginal i, Finset.sum_mul] _ = ∑ j, ∑ i, gamma.mass i j * s.indicator 1 (xi.1.atom j) := by rw [Finset.sum_comm] apply Finset.sum_congr rfl intro j hj apply Finset.sum_congr rfl intro i hi by_cases hij : nu.1.atom i = xi.1.atom j · rw [hij] · rw [gamma.mass_eq_zero_of_cost_eq_zero hcost hij] simp _ = ∑ j, xi.1.weight j * s.indicator 1 (xi.1.atom j) := by apply Finset.sum_congr rfl intro j hj rw [← Finset.sum_mul, gamma.snd_marginal j]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.measureEquivalent_of_transportCost_eq_zero · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:729
theorem wass1_eq_zero_iff_measureEquivalent

Wasserstein loss vanishes exactly between measure-equivalent valid representations. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
nu xi :
wass1 nu.1 xi.1 = 0 ↔ nu.MeasureEquivalent xi
Proof (Lean source)
-- @node: wass1_eq_zero_iff_measureEquivalent lemma wass1_eq_zero_iff_measureEquivalent {k : ℕ} {radius : ℝ} (nu xi : ProbabilityLaw k radius) : wass1 nu.1 xi.1 = 0 ↔ nu.MeasureEquivalent xi := by constructor · intro h obtain ⟨gamma, hgamma⟩ := wass1_optimal_plan nu.2 xi.2 exact measureEquivalent_of_transportCost_eq_zero nu xi gamma (hgamma.trans h) · exact fun h => h.wass1_eq_zero nu xi
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.wass1_eq_zero_iff_measureEquivalent · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:779
theorem wass1_congr_left

Wasserstein loss is unchanged when its left labelled representation is replaced by an equivalent one. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
h :
nu.MeasureEquivalent nu'
wass1 nu.1 xi.1 = wass1 nu'.1 xi.1
Proof (Lean source)
-- @node: atomicLaw_wass1_congr_left lemma wass1_congr_left {k : ℕ} {radius : ℝ} {nu nu' xi : ProbabilityLaw k radius} (h : nu.MeasureEquivalent nu') : wass1 nu.1 xi.1 = wass1 nu'.1 xi.1 := by apply le_antisymm · calc wass1 nu.1 xi.1 ≤ wass1 nu.1 nu'.1 + wass1 nu'.1 xi.1 := wass1_triangle nu nu' xi _ = wass1 nu'.1 xi.1 := by rw [h.wass1_eq_zero nu nu', zero_add] · calc wass1 nu'.1 xi.1 ≤ wass1 nu'.1 nu.1 + wass1 nu.1 xi.1 := wass1_triangle nu' nu xi _ = wass1 nu.1 xi.1 := by rw [ProbabilityLaw.MeasureEquivalent.wass1_eq_zero nu' nu h.symm, zero_add]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.wass1_congr_left · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:790
theorem wass1_congr_right

Wasserstein loss is unchanged when its right labelled representation is replaced by an equivalent one. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
h :
xi.MeasureEquivalent xi'
wass1 nu.1 xi.1 = wass1 nu.1 xi'.1
Proof (Lean source)
-- @node: atomicLaw_wass1_congr_right lemma wass1_congr_right {k : ℕ} {radius : ℝ} {nu xi xi' : ProbabilityLaw k radius} (h : xi.MeasureEquivalent xi') : wass1 nu.1 xi.1 = wass1 nu.1 xi'.1 := by rw [wass1_comm nu.1 xi.1, wass1_comm nu.1 xi'.1] exact wass1_congr_left h
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.wass1_congr_right · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:807
theorem wass1_congr

Wasserstein loss is invariant under equivalent labelled representations in both arguments. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
hnu :
nu.MeasureEquivalent nu'
hxi :
xi.MeasureEquivalent xi'
wass1 nu.1 xi.1 = wass1 nu'.1 xi'.1
Proof (Lean source)
-- @node: atomicLaw_wass1_congr lemma wass1_congr {k : ℕ} {radius : ℝ} {nu nu' xi xi' : ProbabilityLaw k radius} (hnu : nu.MeasureEquivalent nu') (hxi : xi.MeasureEquivalent xi') : wass1 nu.1 xi.1 = wass1 nu'.1 xi'.1 := (wass1_congr_left hnu).trans (wass1_congr_right hxi)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.wass1_congr · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:816
def wass1

Wasserstein loss on extensional laws, computed using their finite representatives. For the ambient setting, the defined object is given by its defining clause.

Definition (Lean source)
k :
radius :
ν ξ :
LawModulo k radius
wass1 ν ξ :
AtomicLaw.wass1 ν.representative.1 ξ.representative.1
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.LawModulo.wass1 · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:824
theorem wass1_nonneg

Extensional Wasserstein loss is nonnegative. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
nu xi :
LawModulo k radius
0 ≤ nu.wass1 xi
Proof (Lean source)
lemma wass1_nonneg {k : ℕ} {radius : ℝ} (nu xi : LawModulo k radius) : 0 ≤ nu.wass1 xi := AtomicLaw.wass1_nonneg nu.representative.2 xi.representative.2
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.LawModulo.wass1_nonneg · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:831
theorem wass1_self

Extensional Wasserstein loss vanishes on the diagonal. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
nu :
LawModulo k radius
nu.wass1 nu = 0
Proof (Lean source)
-- @node: lawModulo_wass1_self lemma wass1_self {k : ℕ} {radius : ℝ} (nu : LawModulo k radius) : nu.wass1 nu = 0 := AtomicLaw.wass1_self nu.representative.1 nu.representative.2
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.LawModulo.wass1_self · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:836
theorem wass1_comm

Extensional Wasserstein loss is symmetric. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
nu xi :
LawModulo k radius
nu.wass1 xi = xi.wass1 nu
Proof (Lean source)
-- @node: lawModulo_wass1_comm lemma wass1_comm {k : ℕ} {radius : ℝ} (nu xi : LawModulo k radius) : nu.wass1 xi = xi.wass1 nu := AtomicLaw.wass1_comm _ _
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.LawModulo.wass1_comm · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:842
theorem wass1_triangle

Extensional Wasserstein loss satisfies the triangle inequality. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
nu xi zeta :
LawModulo k radius
nu.wass1 zeta ≤ nu.wass1 xi + xi.wass1 zeta
Proof (Lean source)
-- @node: lawModulo_wass1_triangle lemma wass1_triangle {k : ℕ} {radius : ℝ} (nu xi zeta : LawModulo k radius) : nu.wass1 zeta ≤ nu.wass1 xi + xi.wass1 zeta := AtomicLaw.wass1_triangle nu.representative xi.representative zeta.representative
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.LawModulo.wass1_triangle · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:848
theorem eq_of_wass1_eq_zero

Extensional Wasserstein loss separates quotient laws. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
LawModulo k radius
h :
nu.wass1 xi = 0
nu = xi
Proof (Lean source)
-- @node: lawModulo_eq_of_wass1_eq_zero lemma eq_of_wass1_eq_zero {k : ℕ} {radius : ℝ} {nu xi : LawModulo k radius} (h : nu.wass1 xi = 0) : nu = xi := by have hrel : nu.representative.MeasureEquivalent xi.representative := (AtomicLaw.wass1_eq_zero_iff_measureEquivalent _ _).mp h calc nu = ofProbabilityLaw nu.representative := (Quotient.out_eq nu).symm _ = ofProbabilityLaw xi.representative := Quotient.sound hrel _ = xi := Quotient.out_eq xi
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.LawModulo.eq_of_wass1_eq_zero · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:854
def rawMetricSpace

The raw metric structure whose distance is exactly extensional Wasserstein loss. Its induced topology is compared with the pre-existing quotient topology before an instance is installed. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k :
radius :
rawMetricSpace k radius :
by let d : Dist (LawModulo k radius) := ⟨LawModulo.wass1⟩ letI : Dist (LawModulo k radius) := d let pm : PseudoMetricSpace (LawModulo k radius) := { dist_self := wass1_self dist_comm := wass1_comm dist_triangle := wass1_triangle } exact @MetricSpace.mk _ pm (fun {_ _} h => eq_of_wass1_eq_zero h)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.LawModulo.rawMetricSpace · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:865
theorem rawMetricSpace_dist

The raw metric distance unfolds to extensional Wasserstein loss. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
nu xi :
LawModulo k radius
@dist (LawModulo k radius) (rawMetricSpace k radius).toPseudoMetricSpace.toDist nu xi
= nu.wass1 xi
Proof (Lean source)
-- @node: lawModulo_rawMetricSpace_dist lemma rawMetricSpace_dist {k : ℕ} {radius : ℝ} (nu xi : LawModulo k radius) : @dist (LawModulo k radius) (rawMetricSpace k radius).toPseudoMetricSpace.toDist nu xi = nu.wass1 xi := by rfl
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.LawModulo.rawMetricSpace_dist · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:877
def probabilityLaw_coordinateTransportPlan

Couple common coordinate mass diagonally and the two residual marginals by their normalized product. This coupling is used only to compare nearby labelled representatives. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k :
radius :
nu xi :
probabilityLaw_coordinateTransportPlan nu xi :
TransportPlan nu.1 xi.1
by classical let a : Fin k → ℝ := fun i
=> nu.1.weight i
- min (nu.1.weight i) (xi.1.weight i) let b : Fin k → ℝ := fun i => xi.1.weight i
- min (nu.1.weight i) (xi.1.weight i) let s : ℝ := ∑ i, a i have ha (i : Fin k) : 0
≤ a i := sub_nonneg.mpr (min_le_left _ _) have hb (i : Fin k) : 0 ≤ b i := sub_nonneg.mpr (min_le_right _ _) have hs : ∑ i, b i = s := by dsimp [a, b, s] rw [Finset.sum_sub_distrib, Finset.sum_sub_distrib, nu.2.2.1, xi.2.2.1] refine { mass := fun i j => (if i = j then min (nu.1.weight i) (xi.1.weight i) else 0) + if s = 0 then 0 else a i * b j / s nonneg := ?_ fst_marginal := ?_ snd_marginal := ?_ } · intro i j apply add_nonneg · split_ifs · exact le_min (nu.2.1 i) (xi.2.1 i) · exact le_rfl · split_ifs with hzero · exact le_rfl · exact div_nonneg (mul_nonneg (ha i) (hb j)) (sum_nonneg fun r _ => ha r) · intro i rw [Finset.sum_add_distrib] rw [show (∑ j, if i = j then min (nu.1.weight i) (xi.1.weight i) else 0) = min (nu.1.weight i) (xi.1.weight i) by simp] by_cases hzero : s = 0 · have hai : a i = 0 := by apply le_antisymm · calc a i ≤ ∑ r, a r := Finset.single_le_sum (fun r _ => ha r) (Finset.mem_univ i) _ = 0 := hzero · exact ha i have hmin : min (nu.1.weight i) (xi.1.weight i) = nu.1.weight i := (eq_of_sub_eq_zero (by simpa [a] using hai)).symm simp [hzero, hmin] · simp only [hzero, if_false] calc min (nu.1.weight i) (xi.1.weight i)
+ ∑ j, a i * b j / s = min (nu.1.weight i) (xi.1.weight i)
+ a i := by congr 1 calc (∑ j, a i * b j / s)
= a i * (∑ j, b j) / s := by simp only [div_eq_mul_inv, ← Finset.sum_mul, ← Finset.mul_sum] _ = a i := by rw [hs]; exact mul_div_cancel_right₀ _ hzero _ = nu.1.weight i := by dsimp [a]; ring · intro j rw [Finset.sum_add_distrib] rw [show (∑ i, if i = j then min (nu.1.weight i) (xi.1.weight i) else 0) = min (nu.1.weight j) (xi.1.weight j) by simp] by_cases hzero : s = 0 · have hbj : b j = 0 := by apply le_antisymm · calc b j ≤ ∑ r, b r := Finset.single_le_sum (fun r _ => hb r) (Finset.mem_univ j) _ = 0 := hs.trans hzero · exact hb j have hmin : min (nu.1.weight j) (xi.1.weight j) = xi.1.weight j := (eq_of_sub_eq_zero (by simpa [b] using hbj)).symm simp [hzero, hmin] · simp only [hzero, if_false] calc min (nu.1.weight j) (xi.1.weight j)
+ ∑ i, a i * b j / s = min (nu.1.weight j) (xi.1.weight j)
+ b j := by congr 1 calc (∑ i, a i * b j / s)
= (∑ i, a i) * b j / s := by simp only [div_eq_mul_inv, ← Finset.sum_mul] _ = b j := by change s * b j / s = b j; field_simp _ = xi.1.weight j := by dsimp [b]; ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.LawModulo.probabilityLaw_coordinateTransportPlan · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:884
theorem wass1_le_coordinateBound

The coordinate coupling gives a continuous upper bound for Wasserstein loss. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
nu xi :
AtomicLaw.wass1 nu.1 xi.1
≤ (∑ i, min (nu.1.weight i) (xi.1.weight i) * |nu.1.atom i - xi.1.atom i|)
+ 2 * radius * (∑ i, (nu.1.weight i - min (nu.1.weight i) (xi.1.weight i)))
Proof (Lean source)
-- @node: atomicLaw_wass1_le_coordinateBound lemma wass1_le_coordinateBound {k : ℕ} {radius : ℝ} (nu xi : ProbabilityLaw k radius) : AtomicLaw.wass1 nu.1 xi.1 ≤ (∑ i, min (nu.1.weight i) (xi.1.weight i) * |nu.1.atom i - xi.1.atom i|) + 2 * radius * (∑ i, (nu.1.weight i - min (nu.1.weight i) (xi.1.weight i))) := by classical let a : Fin k → ℝ := fun i => nu.1.weight i - min (nu.1.weight i) (xi.1.weight i) let b : Fin k → ℝ := fun i => xi.1.weight i - min (nu.1.weight i) (xi.1.weight i) let s : ℝ := ∑ i, a i let gamma := probabilityLaw_coordinateTransportPlan nu xi have ha (i : Fin k) : 0 ≤ a i := sub_nonneg.mpr (min_le_left _ _) have hb (i : Fin k) : 0 ≤ b i := sub_nonneg.mpr (min_le_right _ _) have hs : ∑ i, b i = s := by dsimp [a, b, s] rw [Finset.sum_sub_distrib, Finset.sum_sub_distrib, nu.2.2.1, xi.2.2.1] have hdist (i j : Fin k) : |nu.1.atom i - xi.1.atom j| ≤ 2 * radius := by calc |nu.1.atom i - xi.1.atom j| ≤ |nu.1.atom i| + |xi.1.atom j| := abs_sub _ _ _ ≤ radius + radius := add_le_add (abs_le.mpr (nu.2.2.2 i)) (abs_le.mpr (xi.2.2.2 j)) _ = 2 * radius := by ring calc AtomicLaw.wass1 nu.1 xi.1 ≤ transportCost gamma := wass1_le_of_plan gamma _ ≤ (∑ i, min (nu.1.weight i) (xi.1.weight i) * |nu.1.atom i - xi.1.atom i|) + 2 * radius * s := by unfold transportCost gamma probabilityLaw_coordinateTransportPlan simp_rw [add_mul, Finset.sum_add_distrib] apply add_le_add · apply Finset.sum_le_sum intro i hi simp · by_cases hzero : s = 0 · have hzero' : (∑ i, (nu.1.weight i - min (nu.1.weight i) (xi.1.weight i))) = 0 := by simpa [s, a] using hzero simp [hzero', hzero] · have hzero' : ¬(∑ i, (nu.1.weight i - min (nu.1.weight i) (xi.1.weight i))) = 0 := by simpa [s, a] using hzero simp only [hzero', if_false] change (∑ i, ∑ j, a i * b j / s * |nu.1.atom i - xi.1.atom j|) ≤ 2 * radius * s calc (∑ i, ∑ j, a i * b j / s * |nu.1.atom i - xi.1.atom j|) ≤ ∑ i, ∑ j, a i * b j / s * (2 * radius) := by apply Finset.sum_le_sum intro i hi apply Finset.sum_le_sum intro j hj exact mul_le_mul_of_nonneg_left (hdist i j) (div_nonneg (mul_nonneg (ha i) (hb j)) (sum_nonneg fun r _ => ha r)) _ = 2 * radius * s := by simp only [div_eq_mul_inv, ← Finset.sum_mul, ← Finset.mul_sum, hs] field_simp ring _ = _ := rfl
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.LawModulo.wass1_le_coordinateBound · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:965
theorem wass1_ofProbabilityLaw

Computing quotient Wasserstein loss on quotient constructors recovers the labelled loss. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
nu xi :
(ofProbabilityLaw nu).wass1 (ofProbabilityLaw xi) = AtomicLaw.wass1 nu.1 xi.1
Proof (Lean source)
-- @node: lawModulo_wass1_ofProbabilityLaw lemma wass1_ofProbabilityLaw {k : ℕ} {radius : ℝ} (nu xi : ProbabilityLaw k radius) : (ofProbabilityLaw nu).wass1 (ofProbabilityLaw xi) = AtomicLaw.wass1 nu.1 xi.1 := by have hnu : (ofProbabilityLaw nu).representative.MeasureEquivalent nu := by change (probabilityLawSetoid k radius).r (ofProbabilityLaw nu).representative nu exact (Quotient.eq_mk_iff_out (x := ofProbabilityLaw nu) (y := nu)).mp rfl have hxi : (ofProbabilityLaw xi).representative.MeasureEquivalent xi := by change (probabilityLawSetoid k radius).r (ofProbabilityLaw xi).representative xi exact (Quotient.eq_mk_iff_out (x := ofProbabilityLaw xi) (y := xi)).mp rfl exact AtomicLaw.wass1_congr hnu hxi
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.LawModulo.wass1_ofProbabilityLaw · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:1026
theorem continuous_ofProbabilityLaw_rawMetric

The quotient projection is continuous from labelled coordinates to the raw Wasserstein metric topology. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
@Continuous (ProbabilityLaw k radius) (LawModulo k radius) instTopologicalSpaceSubtype (rawMetricSpace k radius).toPseudoMetricSpace.toUniformSpace.toTopologicalSpace ofProbabilityLaw
Proof (Lean source)
-- @node: lawModulo_continuous_ofProbabilityLaw_rawMetric lemma continuous_ofProbabilityLaw_rawMetric (k : ℕ) (radius : ℝ) : @Continuous (ProbabilityLaw k radius) (LawModulo k radius) instTopologicalSpaceSubtype (rawMetricSpace k radius).toPseudoMetricSpace.toUniformSpace.toTopologicalSpace ofProbabilityLaw := by apply (@continuous_iff_continuousAt (ProbabilityLaw k radius) (LawModulo k radius) instTopologicalSpaceSubtype (rawMetricSpace k radius).toPseudoMetricSpace.toUniformSpace.toTopologicalSpace _).2 intro nu letI : MetricSpace (LawModulo k radius) := rawMetricSpace k radius apply Metric.tendsto_nhds.2 intro epsilon hepsilon let B : ProbabilityLaw k radius → ℝ := fun xi => (∑ i, min (nu.1.weight i) (xi.1.weight i) * |nu.1.atom i - xi.1.atom i|) + 2 * radius * (∑ i, (nu.1.weight i - min (nu.1.weight i) (xi.1.weight i))) have hB : Continuous B := by dsimp [B] have hc : Continuous (fun xi : ProbabilityLaw k radius => (xi.1.weight, xi.1.atom)) := (coordinateHomeomorph k radius).continuous.comp continuous_subtype_val have hw (i : Fin k) : Continuous (fun xi : ProbabilityLaw k radius => xi.1.weight i) := (continuous_apply i).comp (continuous_fst.comp hc) have ha (i : Fin k) : Continuous (fun xi : ProbabilityLaw k radius => xi.1.atom i) := (continuous_apply i).comp (continuous_snd.comp hc) apply Continuous.add · apply continuous_finsetSum intro i hi exact (continuous_const.min (hw i)).mul (continuous_const.sub (ha i)).abs · apply Continuous.mul continuous_const apply continuous_finsetSum intro i hi exact continuous_const.sub (continuous_const.min (hw i)) have hBnu : B nu = 0 := by simp [B] have hev : ∀ᶠ xi in nhds nu, B xi < epsilon := by have : {x | x < epsilon} ∈ nhds (B nu) := by rw [hBnu] exact Iio_mem_nhds hepsilon exact hB.continuousAt this filter_upwards [hev] with xi hxi rw [rawMetricSpace_dist] rw [LawModulo.wass1_comm, wass1_ofProbabilityLaw] exact lt_of_le_of_lt (wass1_le_coordinateBound nu xi) hxi
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.LawModulo.continuous_ofProbabilityLaw_rawMetric · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:1039
theorem rawMetricSpace_topology_eq

The raw Wasserstein metric topology agrees with the original coinduced quotient topology. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
= (rawMetricSpace k radius).toPseudoMetricSpace.toUniformSpace.toTopologicalSpace
Proof (Lean source)
-- @node: lawModulo_rawMetricSpace_topology_eq lemma rawMetricSpace_topology_eq (k : ℕ) (radius : ℝ) : instTopologicalSpace = (rawMetricSpace k radius).toPseudoMetricSpace.toUniformSpace.toTopologicalSpace := by letI : TopologicalSpace (LawModulo k radius) := (rawMetricSpace k radius).toPseudoMetricSpace.toUniformSpace.toTopologicalSpace letI : MetricSpace (LawModulo k radius) := rawMetricSpace k radius have hsurj : Surjective (@ofProbabilityLaw k radius) := by intro q exact ⟨q.out, Quotient.out_eq q⟩ have hquot : Topology.IsQuotientMap (@ofProbabilityLaw k radius) := Topology.IsQuotientMap.of_surjective_continuous hsurj (continuous_ofProbabilityLaw_rawMetric k radius) exact hquot.isCoinducing.eq_coinduced.symm
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.LawModulo.rawMetricSpace_topology_eq · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:1089
instance metricSpace

The Wasserstein metric installed on quotient laws, with the original quotient topology. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
-- @node: lawModulo_metricSpace noncomputable instance metricSpace (k : ℕ) (radius : ℝ) : MetricSpace (LawModulo k radius) := (rawMetricSpace k radius).replaceTopology (rawMetricSpace_topology_eq k radius)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.LawModulo.metricSpace · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:1105
theorem dist_eq_wass1

For any two quotient laws, the installed metric distance equals their extensional one-Wasserstein loss.

Formal statement
k :
radius :
nu xi :
LawModulo k radius
dist nu xi = nu.wass1 xi
Proof (Lean source)
-- @node: lawModulo_dist_eq_wass1 @[simp] lemma dist_eq_wass1 {k : ℕ} {radius : ℝ} (nu xi : LawModulo k radius) : dist nu xi = nu.wass1 xi := by rfl
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.LawModulo.dist_eq_wass1 · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:1111
instance completeSpace

Compact quotient laws are complete for their Wasserstein metric. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
-- @node: lawModulo_completeSpace noncomputable instance completeSpace (k : ℕ) (radius : ℝ) : CompleteSpace (LawModulo k radius) := complete_of_compact
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.LawModulo.completeSpace · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:1117
def support

The (finite) set of locations carrying positive represented mass. For the ambient setting, the defined object is given by its defining clause.

Definition (Lean source)
k :
radius :
ν :
AtomicLaw k radius
support ν :
Finset
(Finset.univ.filter (fun i => 0 < ν.weight i)).image ν.atom
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.support · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:1124

Every distinct represented atom has at least the prescribed aggregate mass. @realizes Pk,m([Lτ,Lτ])\mathcal P_{\le k,m_\star}([-L_{\tau},L_{\tau}])(atom-floor class) @realizes ξ\xi(generic member of the atom-floor class) For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
m :
k :
radius :
ν :
AtomicLaw k radius
x ∈ ν.support :
AtomFloor m ν :
Prop
m ≤ ∑ i with ν.atom i = x, ν.weight i
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.AtomFloor · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:1128
def distToFinset

Distance from a point to a finite set. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
x :
C :
Finset
distToFinset x C :
sInf {d : ℝ | ∃ y ∈ C, d = |x - y|}
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.distToFinset · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:1134
theorem support_close_of_wass1_le

Atom-floor transport implication used by the cluster report. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius m ρ :
AtomicLaw k radius
hνValid :
Valid ν
hξValid :
Valid ξ
:
:
hm :
0 < m
hW :
wass1 ν ξ ≤ m * ρ
conclusion 1
x ∈ ν.support :
distToFinset x ξ.support ≤ ρ
conclusion 2
y ∈ ξ.support :
distToFinset y ν.support ≤ ρ
Proof (Lean source)
-- @node: support_close_of_wass1_le lemma support_close_of_wass1_le {k : ℕ} {radius m ρ : ℝ} {ν ξ : AtomicLaw k radius} (hνValid : Valid ν) (hξValid : Valid ξ) (hν : AtomFloor m ν) (hξ : AtomFloor m ξ) (hm : 0 < m) (hW : wass1 ν ξ ≤ m * ρ) : (∀ x ∈ ν.support, distToFinset x ξ.support ≤ ρ) ∧ ∀ y ∈ ξ.support, distToFinset y ν.support ≤ ρ := by classical have planExists (a b : AtomicLaw k radius) (ha : Valid a) (hb : Valid b) : Nonempty (TransportPlan a b) := by refine ⟨{ mass := fun i j => a.weight i * b.weight j nonneg := fun i j => mul_nonneg (ha.1 i) (hb.1 j) fst_marginal := ?_ snd_marginal := ?_ }⟩ · intro i rw [← Finset.mul_sum, hb.2.1, mul_one] · intro j rw [← Finset.sum_mul, ha.2.1, one_mul] have supportNonempty (a : AtomicLaw k radius) (ha : Valid a) : a.support.Nonempty := by have hex : ∃ i, a.weight i ≠ 0 := by by_contra h push Not at h have hzero : ∑ i, a.weight i = 0 := by simp [h] linarith [ha.2.1] obtain ⟨i, hi⟩ := hex have hipos : 0 < a.weight i := lt_of_le_of_ne (ha.1 i) (Ne.symm hi) exact ⟨a.atom i, Finset.mem_image.mpr ⟨i, Finset.mem_filter.mpr ⟨Finset.mem_univ _, hipos⟩, rfl⟩⟩ have wassSymm (a b : AtomicLaw k radius) : wass1 a b = wass1 b a := by unfold wass1 congr 1 ext c constructor · rintro ⟨γ, rfl⟩ let γ' : TransportPlan b a := { mass := fun i j => γ.mass j i nonneg := fun i j => γ.nonneg j i fst_marginal := γ.snd_marginal snd_marginal := γ.fst_marginal } refine ⟨γ', ?_⟩ unfold transportCost γ' rw [Finset.sum_comm] apply Finset.sum_congr rfl intro i hi apply Finset.sum_congr rfl intro j hj rw [abs_sub_comm] · rintro ⟨γ, rfl⟩ let γ' : TransportPlan a b := { mass := fun i j => γ.mass j i nonneg := fun i j => γ.nonneg j i fst_marginal := γ.snd_marginal snd_marginal := γ.fst_marginal } refine ⟨γ', ?_⟩ unfold transportCost γ' rw [Finset.sum_comm] apply Finset.sum_congr rfl intro i hi apply Finset.sum_congr rfl intro j hj rw [abs_sub_comm] have oneSide (a b : AtomicLaw k radius) (ha : Valid a) (hb : Valid b) (hfloor : AtomFloor m a) (hab : wass1 a b ≤ m * ρ) (x : ℝ) (hx : x ∈ a.support) : distToFinset x b.support ≤ ρ := by let d := distToFinset x b.support have hbne : b.support.Nonempty := supportNonempty b hb have hdistSet : ({r : ℝ | ∃ y ∈ b.support, r = |x - y|}).Nonempty := by obtain ⟨y, hy⟩ := hbne exact ⟨|x - y|, y, hy, rfl⟩ have hdistLower : BddBelow {r : ℝ | ∃ y ∈ b.support, r = |x - y|} := by refine ⟨0, ?_⟩ rintro r ⟨y, hy, rfl⟩ exact abs_nonneg _ have hd_nonneg : 0 ≤ d := by apply le_csInf hdistSet rintro r ⟨y, hy, rfl⟩ exact abs_nonneg _ have hd_le (y : ℝ) (hy : y ∈ b.support) : d ≤ |x - y| := by exact csInf_le hdistLower ⟨y, hy, rfl⟩ by_contra hclose have hrho : ρ < d := lt_of_not_ge hclose have hcost (γ : TransportPlan a b) : m * d ≤ transportCost γ := by calc m * d ≤ (∑ i with a.atom i = x, a.weight i) * d := mul_le_mul_of_nonneg_right (hfloor x hx) hd_nonneg _ = ∑ i, (if a.atom i = x then a.weight i else 0) * d := by rw [Finset.sum_mul] rw [Finset.sum_filter] apply Finset.sum_congr rfl intro i hi by_cases hix : a.atom i = x <;> simp [hix] _ ≤ ∑ i, ∑ j, γ.mass i j * |a.atom i - b.atom j| := by apply Finset.sum_le_sum intro i hi by_cases hix : a.atom i = x · rw [if_pos hix, ← γ.fst_marginal i, Finset.sum_mul] apply Finset.sum_le_sum intro j hj by_cases hjpos : 0 < b.weight j · have hjSupp : b.atom j ∈ b.support := Finset.mem_image.mpr ⟨j, Finset.mem_filter.mpr ⟨Finset.mem_univ _, hjpos⟩, rfl⟩ simpa [hix] using (mul_le_mul_of_nonneg_left (hd_le (b.atom j) hjSupp) (γ.nonneg i j)) · have hjzero : b.weight j = 0 := le_antisymm (le_of_not_gt hjpos) (hb.1 j) have hij_le : γ.mass i j ≤ ∑ r, γ.mass r j := by exact Finset.single_le_sum (fun r _ => γ.nonneg r j) (Finset.mem_univ i) rw [γ.snd_marginal j, hjzero] at hij_le have hijzero : γ.mass i j = 0 := le_antisymm hij_le (γ.nonneg i j) simp [hijzero] · rw [if_neg hix] rw [zero_mul] exact sum_nonneg fun j _ => mul_nonneg (γ.nonneg i j) (abs_nonneg _) _ = transportCost γ := rfl have hcostSet : ({c : ℝ | ∃ γ : TransportPlan a b, transportCost γ = c}).Nonempty := by obtain ⟨γ⟩ := planExists a b ha hb exact ⟨transportCost γ, γ, rfl⟩ have hinf : m * d ≤ wass1 a b := by unfold wass1 apply le_csInf hcostSet rintro c ⟨γ, rfl⟩ exact hcost γ have hstrict : m * ρ < m * d := mul_lt_mul_of_pos_left hrho hm exact (not_lt_of_ge (hinf.trans hab)) hstrict exact ⟨oneSide ν ξ hνValid hξValid hν hW, oneSide ξ ν hξValid hνValid hξ ((wassSymm ξ ν).trans_le hW)⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.support_close_of_wass1_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/AtomicLaw.lean:1138
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.CitedGates 19 declarations Explicit cited logical gates used by the paper.

Explicit cited logical gates used by the paper.

A nominal handle for the parameter class and recovery regime defined in the published VMW paper. Its fields deliberately carry no local characterization: the cited gates below are the only bridge from these publication-level names to the conditions displayed in this development. It uses the ambient setting. It uses the ambient setting. It uses the ambient setting. It uses the ambient setting. It uses the ambient setting. It uses the ambient setting. It uses the ambient setting.

Definition (Lean source)
model :
∀ (k dx dz : ℕ)
if
Measure (FullData k dx dz)
then
Prop
assumption4 :
∀ (k dx dz : ℕ)
if
Measure (FullData k dx dz)
then
Prop
recoveryRegime :
∀ (k dx dz : ℕ)
if
Measure (FullData k dx dz)
then
Prop
The published Theorem 7.2 estimator, whose three components are the treatment effects, anchor-normalized feature matrix, and simplex-projected mixture weights.
theorem72Estimator :
∀ (k dx dz n : ℕ)
if
(Fin n → Obs dx dz)
then
(Fin k → ℝ) × RectMatrix dx k × (Fin k → ℝ)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.PublishedVMWScopeHandle · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/CitedGates.lean:10

The nominal published VMW parameter-class membership predicate. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
publishedScope :
k dx dz :
P :
Measure (FullData k dx dz)
PublishedVMWModel publishedScope P :
Prop
publishedScope.model k dx dz P
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.PublishedVMWModel · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/CitedGates.lean:22

A nominal record of quantitative margins imposed by a published model specification. It uses the ambient setting. It uses the ambient setting. It uses the ambient setting. It uses the ambient setting.

Definition (Lean source)
latentArmMargin :
Option
proxySingularMargin :
Option
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.PublishedVMWMarginRecord · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/CitedGates.lean:27

The qualitative conditions listed in VMW Assumptions 1--2 and §4.2. In particular, this predicate has no numerical latent-positivity or singular-value margin parameter. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz :
PublishedVMWQualitativeConditions P :
Prop
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.PublishedVMWQualitativeConditions · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/CitedGates.lean:32

The published qualitative scope fixes neither this paper's latent-arm margin nor its proxy singular-value margin. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
publishedMargins :
PublishedVMWNoFixedMargins publishedMargins :
Prop
clause 1
publishedMargins.latentArmMargin = none
clause 2
publishedMargins.proxySingularMargin = none
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.PublishedVMWNoFixedMargins · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/CitedGates.lean:45
theorem borelMeasurable_nearestPoint_selector

The local nearest-point wrapper, with the local top measurable-space instance adapted to the canonical Euclidean Borel instance used by the discharged Causalean theorem. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
d :
shared
K :
Set (Euc d)
shared
d :
K :
Set (Euc d)
K.Nonempty
∃ Pi : Euc d → Euc d,
conclusion 1
s :
Pi s ∈ K
dist s (Pi s) = infDist s K
Proof (Lean source)
lemma borelMeasurable_nearestPoint_selector : ∀ (d : ℕ) (K : Set (Euc d)), K.Nonempty → IsCompact K → ∃ Pi : Euc d → Euc d, Measurable Pi ∧ ∀ s, Pi s ∈ K ∧ dist s (Pi s) = infDist s K := by intro d K hKne hK exact _root_.Causalean.Mathlib.MeasureTheory.borelMeasurable_nearestPoint_selector K hK hKne
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.borelMeasurable_nearestPoint_selector · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/CitedGates.lean:51
theorem borelMeasurable_compactLoss_selector Lemma 2 in the paper ↗

Brown and Purves (1973), Corollary 1, specialized to a compact Euclidean action space and an arbitrary jointly continuous loss: the argmin correspondence admits a Borel measurable selector. DOI 10.1214/aos/1176342510. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
d :
shared
K :
Set (Euc d)
shared
dS :
Euc d → Euc d → ℝ
shared
d :
K :
Set (Euc d)
dS :
Euc d → Euc d → ℝ
K.Nonempty
∃ Pi : Euc d → Euc d,
conclusion 1
s :
Pi s ∈ K
q ∈ K :
dS s (Pi s) ≤ dS s q
Proof (Lean source)
-- @node: lem:borel-nearest-point-selector lemma borelMeasurable_compactLoss_selector : ∀ (d : ℕ) (K : Set (Euc d)) (dS : Euc d → Euc d → ℝ), K.Nonempty → IsCompact K → Continuous (uncurry dS) → ∃ Pi : Euc d → Euc d, Measurable Pi ∧ ∀ s, Pi s ∈ K ∧ ∀ q ∈ K, dS s (Pi s) ≤ dS s q := by intro d K dS hKne hK hdS exact _root_.Causalean.Mathlib.MeasureTheory.borelMeasurable_compact_argmin_selector K hK hKne (uncurry dS) hdS.measurable (fun s => (hdS.comp (continuous_const.prodMk continuous_id)).continuousOn)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.borelMeasurable_compactLoss_selector · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/CitedGates.lean:61
def VMWModelScope

Virk, Mazaheri, and Wu (2026), arXiv:2607.10926v1, Assumptions 1--2 and §4.2. The cited correspondence says that the displayed qualitative proxy independences, consistency, armwise ignorability, full column ranks, and strict latent positivity are the published model scope; the source does not impose this paper's fixed quantitative margins. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
publishedScope :
publishedMargins :
VMWModelScope publishedScope publishedMargins :
Sort 0
PublishedVMWNoFixedMargins publishedMargins ∧
∀ (k dx dz : ℕ) (P : Measure (FullData k dx dz)) (_hP : IsProbabilityMeasure P),
letI := _hP PublishedVMWModel publishedScope P ↔ PublishedVMWQualitativeConditions P
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.VMWModelScope · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/CitedGates.lean:76
theorem ucvmwModel_publishedQualitativeConditions

The paper's quantitative model membership implies all of the qualitative conditions; the cited gate is used separately to identify those conditions with the published scope. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hdom :
CoreParameterDomain k dx dz L pi0 sigma0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
Proof (Lean source)
lemma ucvmwModel_publishedQualitativeConditions (k dx dz : ℕ) (L pi0 sigma0 : ℝ) (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hdom : CoreParameterDomain k dx dz L pi0 sigma0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) : PublishedVMWQualitativeConditions P := by rcases hdom with ⟨hk, hkx, hkz, hL, hpi, hpiMax, hsigma, hsigmaMax⟩ have injective_of_margin {rows : ℕ} (A : RectMatrix rows k) (hA : sigma0 ≤ signalMinSingular A) : Injective (toEuclideanLin A) := by rw [LinearMap.injective_iff_forall_lt_finrank_singularValues_pos] intro i hi have hik : i ≤ k - 1 := by simpa using (Nat.le_sub_one_of_lt (by simpa using hi)) exact lt_of_lt_of_le (lt_of_lt_of_le hsigma hA) ((toEuclideanLin A).singularValues_antitone hik) exact ⟨hM.referenceProxySeparation, hM.targetProxySeparation, hM.consistency, hM.latentIgnorability, injective_of_margin _ hM.proxyRankMargin.1, injective_of_margin _ hM.proxyRankMargin.2.1, injective_of_margin _ hM.proxyRankMargin.2.2, fun u t => lt_of_lt_of_le hpi (hM.latentArmPositivity u t)⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ucvmwModel_publishedQualitativeConditions · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/CitedGates.lean:88

The qualitative simple-effect separation condition used by the published recovery regime. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k :
tau :
Fin k → ℝ
u v :
u ≠ v
PublishedSpectralSeparation tau :
Prop
tau u ≠ tau v
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.PublishedSpectralSeparation · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/CitedGates.lean:112

The full-column-rank requirement called Assumption 2 in the cited VMW paper. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz :
PublishedVMWAssumption2 P :
Prop
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.PublishedVMWAssumption2 · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/CitedGates.lean:116

The strict latent positivity requirement used by the cited VMW recovery theorem. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz :
u t :
PublishedVMWStrictLatentPositivity P :
Prop
0 < P.real (latentCell u t)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.PublishedVMWStrictLatentPositivity · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/CitedGates.lean:123

The nominal proposition called Assumption 4 in the published VMW paper. Its mathematical content remains attached to the publication handle rather than being replaced by an arbitrary proposition chosen by a consumer. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
publishedScope :
k dx dz :
P :
Measure (FullData k dx dz)
PublishedVMWAssumption4 publishedScope P :
Prop
publishedScope.assumption4 k dx dz P
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.PublishedVMWAssumption4 · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/CitedGates.lean:128

The positive-dimensional domain on which the cited VMW model and recovery statements apply. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz :
VMWPositiveDimensionDomain k dx dz :
Prop
clause 1
0 < k
clause 2
k ≤ dx
clause 3
k ≤ dz
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.VMWPositiveDimensionDomain · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/CitedGates.lean:135

The columns form a population top-k right singular basis of the stacked proxy moment. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz :
s :
basis :
j :
Fin k
PublishedVMWTopRightSingularBasis s basis :
Prop
mulVec ((stackedProxyMoment s).transpose * stackedProxyMoment s) (fun i => basis.V i j)
= (singularValue (stackedProxyMoment s) j.val) ^ 2 • (fun i => basis.V i j)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.PublishedVMWTopRightSingularBasis · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/CitedGates.lean:139

The law-level content of VMW Assumption 4: admissible positive dimensions, finite positive envelopes for the target proxy and the two proxy products, positive marginal treatment-arm probabilities, and a positive population singular-value margin. Sample-size and confidence-level conditions belong to the recovery theorem, not to this predicate. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz :
ConcreteVMWAssumption4 P :
Prop
clause 2
∃ LX LZX LYZX pi sigma : ℝ,
0 < LX
0 < LZX
0 < LYZX
0 < pi
0 < sigma
BoundedTargetProxy (L := LX) P
BoundedProxyProduct (L := LZX) P
t :
pi ≤ P.real {w | w.T = t}
∃ basis : SignalBasis dx k,
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ConcreteVMWAssumption4 · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/CitedGates.lean:147

The nominal published Theorem 7.2 recovery-regime membership predicate. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
publishedScope :
k dx dz :
P :
Measure (FullData k dx dz)
PublishedVMWRecoveryRegime publishedScope P :
Prop
publishedScope.recoveryRegime k dx dz P
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.PublishedVMWRecoveryRegime · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/CitedGates.lean:166

The theorem-level part of published VMW Theorem 7.2, kept separate from both population-law predicates. The universal constants are outermost. For the published estimator, the displayed sample-size and radius conditions imply one event of probability at least 1 - eta on which the treatment effects, anchor-normalized feature columns, and simplex-projected mixture weights obey their three simultaneous bounds. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
publishedScope :
PublishedVMWTheorem72FiniteSampleRecovery publishedScope :
Prop
∃ cW cMom cReg cTau cB cAnc cMu c0 : ℝ,
0 < cW
0 < cMom
0 < cReg
0 < cTau
0 < cB
0 < cAnc
0 < cMu
0 < c0
clause 1
k dx dz :
P :
Measure (FullData k dx dz)
n :
eta :
letI := _hP VMWPositiveDimensionDomain k dx dz
0 < eta
eta < 1
LX LZX LYZX pi sigma delta alphaAnc :
basis :
0 < LX ∧
0 < LZX ∧
0 < LYZX ∧
0 < pi ∧
0 < sigma ∧
BoundedTargetProxy (L := LX) P ∧
BoundedProxyProduct (L := LZX) P ∧
BoundedOutcomeProxyProduct (L := LYZX) P ∧
pi = min (P.real {w | w.T = false}) (P.real {w | w.T = true}) ∧
sigma
((k = 1 ∧ delta = 0) ∨ (2 ≤ k ∧ 0 < delta ∧ (∀ u v : Fin k, u ≠ v → delta ≤ |latentEffect P u - latentEffect P v|) ∧ ∃ u v : Fin k, u ≠ v ∧ delta = |latentEffect P u - latentEffect P v|))
0 < alphaAnc ∧
(∀ u : Fin k, alphaAnc ≤ (‖(toLp 2 (fun i ↦ targetFeature P i u) : Euc dx)‖)⁻¹) ∧
(∃ u : Fin k, alphaAnc = (‖(toLp 2 (fun i ↦ targetFeature P i u) : Euc dx)‖)⁻¹)
LQ :
max LZX LYZX
MX :
max ‖matrixCLM (observedProxyMoment (obsSummary P) false)‖ ‖matrixCLM (observedProxyMoment (obsSummary P) true)‖
MY :
kappaB :
‖matrixCLM Bt‖ * ‖matrixCLM (genuinePenroseInverse Bt)‖
GammaX :
1 + cW * MX / sigma
GammaY :
1 + cW * MY / sigma
kappaZX :
GammaY + 6 * GammaX * (MY / sigma + GammaY)
lambdaStar :
log (16 * (dx + dz : ℝ) / eta)
rootTerm :
sqrt (lambdaStar / (n * pi))
momentRadius :
cMom * LQ * rootTerm
gapInv :
if k = 1 then 0 else delta⁻¹
rTau :
cTau * kappaB * kappaZX * LQ / sigma * rootTerm
rB :
cB * LQ * (kappaB ^ 2 * kappaZX * gapInv / sigma + 1 / sigma) * rootTerm
epsB :
cAnc * (alphaAnc ^ 2)⁻¹ * rB
epsMu :
cMu * LX * sqrt (lambdaStar / n)
sigmaB :
Mmu :
‖(toLp 2 (obsSummary P).mX : Euc dx)‖
cReg * lambdaStar ≤ n * pi
momentRadius ≤ cReg * sigma / GammaX
(k = 1 ∨ rTau < delta / 2)
rB ≤ c0 * alphaAnc
sqrt k * epsB ≤ sigmaB / 2
1 - eta
≤ (sampleLaw (n := n) P).real {sample | ∃ rho : Perm (Fin k), (∀ u : Fin k, |(publishedScope.theorem72Estimator k dx dz n sample).1 (rho u) - latentEffect P u| ≤ rTau) ∧ (∀ u : Fin k, ‖(toLp 2 (fun i ↦ (publishedScope.theorem72Estimator k dx dz n sample).2.1 i (rho u) - targetFeature P i u) : Euc dx)‖ ≤ epsB) ∧ (∀ u : Fin k, 0 ≤ (publishedScope.theorem72Estimator k dx dz n sample).2.2 u) ∧ (∑ u : Fin k, (publishedScope.theorem72Estimator k dx dz n sample).2.2 u) = 1 ∧ ‖(toLp 2 (fun u ↦ (publishedScope.theorem72Estimator k dx dz n sample).2.2 (rho u) - latentMass P u) : Euc k)‖ ≤ 2 / sigmaB * epsMu + 6 * Mmu * sqrt k / sigmaB ^ 2 * epsB}
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.PublishedVMWTheorem72FiniteSampleRecovery · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/CitedGates.lean:171
def VMWSeparatedRecoveryScope

Virk, Mazaheri, and Wu (2026), arXiv:2607.10926v1, Assumption 3 and Theorem 7.2. The cited recovery regime remains inside the standing Assumption 1 proxy-separation, consistency, and armwise-ignorability conditions and the anchor normalization; it additionally requires Assumption 2, strict latent positivity, Assumption 4, and spectral separation. Theorem 7.2 separately quantifies the sample size and confidence level, imposes its displayed sample-size and radius conditions, applies its stated estimator, and gives simultaneous high-probability bounds for the effects, anchor-normalized feature matrix, and simplex-projected mixture proportions. None of those theorem-level data is a field of either population-law predicate below. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
publishedScope :
VMWSeparatedRecoveryScope publishedScope :
Sort 0
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.VMWSeparatedRecoveryScope · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/CitedGates.lean:253
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.ClusterBounds 10 declarations
theorem cluster_effectGap_nonneg

Cluster effect gap nonneg: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
P :
Measure (FullData k dx dz)
(0 : EReal) ≤ effectGap P
Proof (Lean source)
lemma cluster_effectGap_nonneg {k dx dz : ℕ} (P : Measure (FullData k dx dz)) : (0 : EReal) ≤ effectGap P := by unfold effectGap apply le_sInf intro d hd rcases hd with ⟨u, v, hu, hv, huv, rfl⟩ positivity
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.cluster_effectGap_nonneg · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ClusterBounds.lean:9
theorem cluster_effectGap_le_support_distance

Cluster effect gap le support distance: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
x y :
hx :
x ∈ (quotientLaw P hM).representative.1.support
hy :
y ∈ (quotientLaw P hM).representative.1.support
hxy :
x ≠ y
effectGap P ≤ (|x - y| : ℝ)
Proof (Lean source)
lemma cluster_effectGap_le_support_distance {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) {x y : ℝ} (hx : x ∈ (quotientLaw P hM).representative.1.support) (hy : y ∈ (quotientLaw P hM).representative.1.support) (hxy : x ≠ y) : effectGap P ≤ (|x - y| : ℝ) := by let raw : AtomicLaw.ProbabilityLaw k (effectRadius dz L sigma0) := ⟨quotientLawRaw P (effectRadius dz L sigma0), quotientLawRaw_valid P hM⟩ have heq : (quotientLaw P hM).representative.1.support = raw.1.support := by apply cluster_support_eq_of_measureEquivalent exact (Quotient.eq_mk_iff_out (x := quotientLaw P hM) (y := raw)).mp rfl rw [heq] at hx hy rcases Finset.mem_image.mp hx with ⟨u, hu, hux⟩ rcases Finset.mem_image.mp hy with ⟨v, hv, hvy⟩ change latentEffect P u = x at hux change latentEffect P v = y at hvy have huPos : 0 < latentMass P u := by simpa [raw, quotientLawRaw] using (Finset.mem_filter.mp hu).2 have hvPos : 0 < latentMass P v := by simpa [raw, quotientLawRaw] using (Finset.mem_filter.mp hv).2 apply sInf_le refine ⟨u, v, huPos, hvPos, ?_, ?_⟩ · intro huv exact hxy (hux.symm.trans (huv.trans hvy)) · rw [← hux, ← hvy]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.cluster_effectGap_le_support_distance · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ClusterBounds.lean:19
theorem cluster_effectGap_le_externalGap

Cluster effect gap le external gap: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 rho :
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
C :
Finset
hcard :
(associatedSupport (rho := rho) (quotientLaw P hM).representative.1 C).card = 1
effectGap P ≤ clusterExternalGap (rho := rho) (quotientLaw P hM).representative.1 C
Proof (Lean source)
lemma cluster_effectGap_le_externalGap {k dx dz : ℕ} {L pi0 sigma0 rho : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) {C : Finset ℝ} (hcard : (associatedSupport (rho := rho) (quotientLaw P hM).representative.1 C).card = 1) : effectGap P ≤ clusterExternalGap (rho := rho) (quotientLaw P hM).representative.1 C := by let nu := (quotientLaw P hM).representative.1 unfold clusterExternalGap split_ifs with hcomp · apply le_sInf intro d hd rcases hd with ⟨x, hx, y, hy, hyout, rfl⟩ apply cluster_effectGap_le_support_distance P hM · exact (Finset.mem_filter.mp hx).1 · exact hy · intro hxy subst y exact hyout hx · exact le_top
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.cluster_effectGap_le_externalGap · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ClusterBounds.lean:47
theorem cluster_effectGap_toReal_pos_of_external_ne_top

Cluster effect gap to real pos of external ne top: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 rho :
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
C :
Finset
hcard :
(associatedSupport (rho := rho) (quotientLaw P hM).representative.1 C).card = 1
htop :
clusterExternalGap (rho := rho) (quotientLaw P hM).representative.1 C ≠ ⊤
Proof (Lean source)
lemma cluster_effectGap_toReal_pos_of_external_ne_top {k dx dz : ℕ} {L pi0 sigma0 rho : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) {C : Finset ℝ} (hcard : (associatedSupport (rho := rho) (quotientLaw P hM).representative.1 C).card = 1) (htop : clusterExternalGap (rho := rho) (quotientLaw P hM).representative.1 C ≠ ⊤) : 0 < (effectGap P).toReal := by let nu := (quotientLaw P hM).representative.1 let A := associatedSupport (rho := rho) nu C have hAcard : A.card = 1 := by simpa [A, nu] using hcard have hA : A.Nonempty := Finset.card_pos.mp (by rw [hAcard]; norm_num) have hcomp : (nu.support \ A).Nonempty := by by_contra he apply htop rw [clusterExternalGap, if_neg] simpa [nu, A] using he obtain ⟨x, hx⟩ := hA obtain ⟨y, hyDiff⟩ := hcomp have hxSupp : x ∈ nu.support := (Finset.mem_filter.mp hx).1 have hySupp : y ∈ nu.support := (Finset.mem_sdiff.mp hyDiff).1 have hxy : x ≠ y := fun h => (Finset.mem_sdiff.mp hyDiff).2 (h ▸ hx) let raw : AtomicLaw.ProbabilityLaw k (effectRadius dz L sigma0) := ⟨quotientLawRaw P (effectRadius dz L sigma0), quotientLawRaw_valid P hM⟩ have heq : nu.support = raw.1.support := by apply cluster_support_eq_of_measureEquivalent exact (Quotient.eq_mk_iff_out (x := quotientLaw P hM) (y := raw)).mp rfl rw [heq] at hxSupp hySupp rcases Finset.mem_image.mp hxSupp with ⟨u, hu, hux⟩ rcases Finset.mem_image.mp hySupp with ⟨v, hv, hvy⟩ change latentEffect P u = x at hux change latentEffect P v = y at hvy have huPos : 0 < latentMass P u := by simpa [raw, quotientLawRaw] using (Finset.mem_filter.mp hu).2 have hvPos : 0 < latentMass P v := by simpa [raw, quotientLawRaw] using (Finset.mem_filter.mp hv).2 have huv : latentEffect P u ≠ latentEffect P v := by intro h exact hxy (hux.symm.trans (h.trans hvy)) let D : Set EReal := {d | ∃ a b : Fin k, 0 < latentMass P a ∧ 0 < latentMass P b ∧ latentEffect P a ≠ latentEffect P b ∧ d = |latentEffect P a - latentEffect P b|} have hDne : D.Nonempty := ⟨(|latentEffect P u - latentEffect P v| : ℝ), u, v, huPos, hvPos, huv, rfl⟩ have hDfin : D.Finite := by let F := (Finset.univ : Finset (Fin k)).product (Finset.univ : Finset (Fin k)) have hsub : D ⊆ (fun p : Fin k × Fin k => ((|latentEffect P p.1 - latentEffect P p.2| : ℝ) : EReal)) '' (F : Set (Fin k × Fin k)) := by rintro d ⟨a, b, ha, hb, hab, rfl⟩ exact ⟨(a, b), Finset.mem_product.mpr ⟨Finset.mem_univ _, Finset.mem_univ _⟩, rfl⟩ exact (F.finite_toSet.image _).subset hsub have hmin := hDne.csInf_mem hDfin rcases hmin with ⟨a, b, ha, hb, hab, hEq⟩ have hpos : (0 : EReal) < sInf D := by rw [hEq] exact_mod_cast (abs_pos.mpr (sub_ne_zero.mpr hab)) apply EReal.toReal_pos · simpa [effectGap, D] using hpos · have hle : effectGap P ≤ (|latentEffect P u - latentEffect P v| : ℝ) := sInf_le ⟨u, v, huPos, hvPos, huv, rfl⟩ intro he rw [he] at hle exact (not_le_of_gt (EReal.coe_lt_top _)) hle
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.cluster_effectGap_toReal_pos_of_external_ne_top · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ClusterBounds.lean:69
theorem cluster_singleton_width_from_external

Cluster singleton width from external: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 rho R width :
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
C :
Finset
hcard :
(associatedSupport (rho := rho) (quotientLaw P hM).representative.1 C).card = 1
hR :
0 ≤ R
hpi :
0 < pi0
htopZero :
clusterExternalGap (rho := rho) (quotientLaw P hM).representative.1 C = ⊤ → width = 0
hwidth :
width
≤ 8 / pi0 * min 1 (R / (clusterExternalGap (rho := rho) (quotientLaw P hM).representative.1 C).toReal)
width ≤ 8 / pi0 * min 1 (R / (effectGap P).toReal)
Proof (Lean source)
lemma cluster_singleton_width_from_external {k dx dz : ℕ} {L pi0 sigma0 rho R width : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) {C : Finset ℝ} (hcard : (associatedSupport (rho := rho) (quotientLaw P hM).representative.1 C).card = 1) (hR : 0 ≤ R) (hpi : 0 < pi0) (htopZero : clusterExternalGap (rho := rho) (quotientLaw P hM).representative.1 C = ⊤ → width = 0) (hwidth : width ≤ 8 / pi0 * min 1 (R / (clusterExternalGap (rho := rho) (quotientLaw P hM).representative.1 C).toReal)) : width ≤ 8 / pi0 * min 1 (R / (effectGap P).toReal) := by by_cases htop : clusterExternalGap (rho := rho) (quotientLaw P hM).representative.1 C = ⊤ · rw [htopZero htop] apply mul_nonneg · exact div_nonneg (by norm_num) hpi.le · apply le_min (by norm_num) exact div_nonneg hR (EReal.toReal_nonneg (cluster_effectGap_nonneg P)) · have hdeltaPos := cluster_effectGap_toReal_pos_of_external_ne_top P hM hcard htop have hle := cluster_effectGap_le_externalGap P hM hcard have hdeltaNotBot : effectGap P ≠ ⊥ := by intro he rw [he] at hdeltaPos simp at hdeltaPos have hreal : (effectGap P).toReal ≤ (clusterExternalGap (rho := rho) (quotientLaw P hM).representative.1 C).toReal := EReal.toReal_le_toReal hle hdeltaNotBot htop calc width ≤ 8 / pi0 * min 1 (R / (clusterExternalGap (rho := rho) (quotientLaw P hM).representative.1 C).toReal) := hwidth _ ≤ 8 / pi0 * min 1 (R / (effectGap P).toReal) := by gcongr
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.cluster_singleton_width_from_external · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ClusterBounds.lean:135
theorem clusterMass_mem_unitInterval

Cluster mass mem unit interval: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius rho :
ν :
AtomicLaw k radius
:
AtomicLaw.Valid ν
C :
Finset
conclusion 1
0 ≤ clusterMass rho ν C
conclusion 2
clusterMass rho ν C ≤ 1
Proof (Lean source)
lemma clusterMass_mem_unitInterval {k : ℕ} {radius rho : ℝ} (ν : AtomicLaw k radius) (hν : AtomicLaw.Valid ν) (C : Finset ℝ) : 0 ≤ clusterMass rho ν C ∧ clusterMass rho ν C ≤ 1 := by constructor · unfold clusterMass exact sum_nonneg fun i _ => by split_ifs <;> simp_all [hν.1] · unfold clusterMass calc (∑ i, if AtomicLaw.distToFinset (ν.atom i) C ≤ rho then ν.weight i else 0) ≤ ∑ i, ν.weight i := by apply Finset.sum_le_sum intro i hi split_ifs <;> simp_all [hν.1] _ = 1 := hν.2.1
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.clusterMass_mem_unitInterval · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ClusterBounds.lean:172
theorem clusterMass_eq_one_of_support_subset

Cluster mass eq one of support subset: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius rho :
ν :
AtomicLaw k radius
:
AtomicLaw.Valid ν
C :
Finset
hsub :
ν.support ⊆ associatedSupport (rho := rho) ν C
clusterMass rho ν C = 1
Proof (Lean source)
lemma clusterMass_eq_one_of_support_subset {k : ℕ} {radius rho : ℝ} (ν : AtomicLaw k radius) (hν : AtomicLaw.Valid ν) (C : Finset ℝ) (hsub : ν.support ⊆ associatedSupport (rho := rho) ν C) : clusterMass rho ν C = 1 := by unfold clusterMass rw [← hν.2.1] apply Finset.sum_congr rfl intro i hi by_cases hwi : 0 < ν.weight i · have hsupp : ν.atom i ∈ ν.support := Finset.mem_image.mpr ⟨i, Finset.mem_filter.mpr ⟨Finset.mem_univ _, hwi⟩, rfl⟩ rw [if_pos (Finset.mem_filter.mp (hsub hsupp)).2] · have hw0 : ν.weight i = 0 := le_antisymm (le_of_not_gt hwi) (hν.1 i) simp [hw0]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.clusterMass_eq_one_of_support_subset · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ClusterBounds.lean:189
theorem cluster_mass_gap_cost

Cluster mass gap cost: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius rho :
AtomicLaw k radius
hcenter :
AtomicLaw.Valid center
hnu :
AtomicLaw.Valid nu
hxi :
AtomicLaw.Valid xi
hrho :
0 ≤ rho
hcloseNu :
(∀ x ∈ nu.support, AtomicLaw.distToFinset x center.support ≤ rho) ∧
∀ y ∈ center.support, AtomicLaw.distToFinset y nu.support ≤ rho
hcloseXi :
(∀ x ∈ xi.support, AtomicLaw.distToFinset x center.support ≤ rho) ∧
∀ y ∈ center.support, AtomicLaw.distToFinset y xi.support ≤ rho
C :
Finset
hC :
C ∈ components (rho := rho) center
hgapTop :
clusterExternalGap (rho := rho) nu C ≠ ⊤
hgapLarge :
2 * rho ≤ (clusterExternalGap (rho := rho) nu C).toReal
γ :
AtomicLaw.TransportPlan xi nu
((clusterExternalGap (rho := rho) nu C).toReal - 2 * rho) * |clusterMass rho xi C
- clusterMass rho nu C|
≤ AtomicLaw.transportCost γ
Proof (Lean source)
lemma cluster_mass_gap_cost {k : ℕ} {radius rho : ℝ} {center nu xi : AtomicLaw k radius} (hcenter : AtomicLaw.Valid center) (hnu : AtomicLaw.Valid nu) (hxi : AtomicLaw.Valid xi) (hrho : 0 ≤ rho) (hcloseNu : (∀ x ∈ nu.support, AtomicLaw.distToFinset x center.support ≤ rho) ∧ ∀ y ∈ center.support, AtomicLaw.distToFinset y nu.support ≤ rho) (hcloseXi : (∀ x ∈ xi.support, AtomicLaw.distToFinset x center.support ≤ rho) ∧ ∀ y ∈ center.support, AtomicLaw.distToFinset y xi.support ≤ rho) {C : Finset ℝ} (hC : C ∈ components (rho := rho) center) (hgapTop : clusterExternalGap (rho := rho) nu C ≠ ⊤) (hgapLarge : 2 * rho ≤ (clusterExternalGap (rho := rho) nu C).toReal) (γ : AtomicLaw.TransportPlan xi nu) : ((clusterExternalGap (rho := rho) nu C).toReal - 2 * rho) * |clusterMass rho xi C - clusterMass rho nu C| ≤ AtomicLaw.transportCost γ := by classical let gap := (clusterExternalGap (rho := rho) nu C).toReal have hCne : C.Nonempty := by obtain ⟨z, hz, hCz⟩ := Finset.mem_image.mp hC rw [← hCz] exact ⟨z, cluster_componentOf_mem_self hz⟩ have hpartNu := cluster_association_partition hcenter hnu hrho hcloseNu have hpartXi := cluster_association_partition hcenter hxi hrho hcloseXi have hpos_support_left (i : Fin k) (j : Fin k) (hγ : 0 < γ.mass i j) : xi.atom i ∈ xi.support := by have hwi : 0 < xi.weight i := by rw [← γ.fst_marginal i] exact lt_of_lt_of_le hγ (Finset.single_le_sum (fun l _ => γ.nonneg i l) (Finset.mem_univ j)) exact Finset.mem_image.mpr ⟨i, Finset.mem_filter.mpr ⟨Finset.mem_univ _, hwi⟩, rfl⟩ have hpos_support_right (i : Fin k) (j : Fin k) (hγ : 0 < γ.mass i j) : nu.atom j ∈ nu.support := by have hwj : 0 < nu.weight j := by rw [← γ.snd_marginal j] exact lt_of_lt_of_le hγ (Finset.single_le_sum (fun l _ => γ.nonneg l j) (Finset.mem_univ i)) exact Finset.mem_image.mpr ⟨j, Finset.mem_filter.mpr ⟨Finset.mem_univ _, hwj⟩, rfl⟩ apply AtomicLaw.test_mass_gap γ (fun i => AtomicLaw.distToFinset (xi.atom i) C ≤ rho) (fun j => AtomicLaw.distToFinset (nu.atom j) C ≤ rho) (by linarith) intro i j hγ hcross have hxiSupp := hpos_support_left i j hγ have hnuSupp := hpos_support_right i j hγ rcases hcross with hcross | hcross · have hxiAssoc : xi.atom i ∈ associatedSupport (rho := rho) xi C := Finset.mem_filter.mpr ⟨hxiSupp, hcross.1⟩ obtain ⟨z, hzC, hxiz⟩ := cluster_distToFinset_attained (xi.atom i) hCne have hxiz_le : |xi.atom i - z| ≤ rho := hxiz ▸ hcross.1 have hzSupp : z ∈ center.support := by obtain ⟨root, hroot, hCr⟩ := Finset.mem_image.mp hC apply cluster_componentOf_subset_support center root rw [hCr] exact hzC obtain ⟨y, hySupp, hzy⟩ := cluster_distToFinset_attained z (cluster_support_nonempty hnu) have hzy_le : |z - y| ≤ rho := hzy ▸ hcloseNu.2 z hzSupp have hyAssoc : y ∈ associatedSupport (rho := rho) nu C := by apply Finset.mem_filter.mpr refine ⟨hySupp, (cluster_distToFinset_le_of_mem y hzC).trans ?_⟩ simpa [abs_sub_comm] using hzy_le have hgap := cluster_externalGap_le_cross hgapTop hyAssoc hnuSupp (by exact fun hj => hcross.2 (Finset.mem_filter.mp hj).2) have hyxi : |y - xi.atom i| ≤ 2 * rho := by calc |y - xi.atom i| ≤ |y - z| + |z - xi.atom i| := abs_sub_le y z (xi.atom i) _ ≤ 2 * rho := by rw [abs_sub_comm y z, abs_sub_comm z (xi.atom i)] linarith calc gap - 2 * rho ≤ |y - nu.atom j| - 2 * rho := sub_le_sub_right hgap _ _ ≤ |xi.atom i - nu.atom j| := by have ht := abs_sub_le y (xi.atom i) (nu.atom j) linarith · obtain ⟨z, hzSupp, hxiz⟩ := cluster_distToFinset_attained (xi.atom i) (cluster_support_nonempty hcenter) have hxiz_le : |xi.atom i - z| ≤ rho := hxiz ▸ hcloseXi.1 (xi.atom i) hxiSupp let D := componentOf (rho := rho) center z have hD : D ∈ components (rho := rho) center := Finset.mem_image.mpr ⟨z, hzSupp, rfl⟩ have hzD : z ∈ D := cluster_componentOf_mem_self hzSupp obtain ⟨y, hySupp, hzy⟩ := cluster_distToFinset_attained z (cluster_support_nonempty hnu) have hzy_le : |z - y| ≤ rho := hzy ▸ hcloseNu.2 z hzSupp have hyD : y ∈ associatedSupport (rho := rho) nu D := by exact Finset.mem_filter.mpr ⟨hySupp, (cluster_distToFinset_le_of_mem y hzD).trans (by simpa [abs_sub_comm] using hzy_le)⟩ have hyNotC : y ∉ associatedSupport (rho := rho) nu C := by intro hyC obtain ⟨E, hE, huniq⟩ := (hpartNu y).mp hySupp have hCu : C = D := (huniq C ⟨hC, hyC⟩).trans (huniq D ⟨hD, hyD⟩).symm have hzC : z ∈ C := hCu ▸ hzD exact hcross.1 ((cluster_distToFinset_le_of_mem (xi.atom i) hzC).trans hxiz_le) have hnuAssoc : nu.atom j ∈ associatedSupport (rho := rho) nu C := Finset.mem_filter.mpr ⟨hnuSupp, hcross.2⟩ have hgap := cluster_externalGap_le_cross hgapTop hnuAssoc hySupp hyNotC have hyxi : |y - xi.atom i| ≤ 2 * rho := by calc |y - xi.atom i| ≤ |y - z| + |z - xi.atom i| := abs_sub_le y z (xi.atom i) _ ≤ 2 * rho := by rw [abs_sub_comm y z, abs_sub_comm z (xi.atom i)] linarith calc gap - 2 * rho ≤ |nu.atom j - y| - 2 * rho := sub_le_sub_right hgap _ _ ≤ |xi.atom i - nu.atom j| := by have ht := abs_sub_le (nu.atom j) (xi.atom i) y rw [abs_sub_comm (nu.atom j) (xi.atom i), abs_sub_comm (xi.atom i) y] at ht linarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.cluster_mass_gap_cost · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ClusterBounds.lean:206
theorem cluster_candidate_mass_error

Cluster candidate mass error: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius m R rho :
AtomicLaw k radius
hcenter :
AtomicLaw.Valid center
hnu :
AtomicLaw.Valid nu
hxi :
AtomicLaw.Valid xi
hm :
0 < m
hmOne :
m ≤ 1
hR :
0 < R
hrho :
rho = R / m
hcenterFloor :
AtomicLaw.AtomFloor m center
hnuFloor :
AtomicLaw.AtomFloor m nu
hxiFloor :
AtomicLaw.AtomFloor m xi
hWnu :
AtomicLaw.wass1 nu center ≤ R
hWxi :
AtomicLaw.wass1 xi center ≤ R
C :
Finset
hC :
C ∈ components (rho := rho) center
if clusterExternalGap (rho := rho) nu C
= ⊤ then clusterMass rho xi C = clusterMass rho nu C else |clusterMass rho xi C
- clusterMass rho nu C|
≤ 4 / m * min 1 (R / (clusterExternalGap (rho := rho) nu C).toReal)
Proof (Lean source)
lemma cluster_candidate_mass_error {k : ℕ} {radius m R rho : ℝ} {center nu xi : AtomicLaw k radius} (hcenter : AtomicLaw.Valid center) (hnu : AtomicLaw.Valid nu) (hxi : AtomicLaw.Valid xi) (hm : 0 < m) (hmOne : m ≤ 1) (hR : 0 < R) (hrho : rho = R / m) (hcenterFloor : AtomicLaw.AtomFloor m center) (hnuFloor : AtomicLaw.AtomFloor m nu) (hxiFloor : AtomicLaw.AtomFloor m xi) (hWnu : AtomicLaw.wass1 nu center ≤ R) (hWxi : AtomicLaw.wass1 xi center ≤ R) {C : Finset ℝ} (hC : C ∈ components (rho := rho) center) : if clusterExternalGap (rho := rho) nu C = ⊤ then clusterMass rho xi C = clusterMass rho nu C else |clusterMass rho xi C - clusterMass rho nu C| ≤ 4 / m * min 1 (R / (clusterExternalGap (rho := rho) nu C).toReal) := by classical have hrho0 : 0 ≤ rho := by rw [hrho]; positivity have hscale : m * rho = R := by rw [hrho]; field_simp have hcloseNu := AtomicLaw.support_close_of_wass1_le hnu hcenter hnuFloor hcenterFloor hm (by rw [hscale]; exact hWnu) have hcloseXi := AtomicLaw.support_close_of_wass1_le hxi hcenter hxiFloor hcenterFloor hm (by rw [hscale]; exact hWxi) split_ifs with htop · have hcompEmpty : nu.support \ associatedSupport (rho := rho) nu C = ∅ := by by_contra hne have hcomp : (nu.support \ associatedSupport (rho := rho) nu C).Nonempty := Finset.nonempty_iff_ne_empty.mpr hne have hassoc : (associatedSupport (rho := rho) nu C).Nonempty := by obtain ⟨z, hz, hCz⟩ := Finset.mem_image.mp hC obtain ⟨x, hx, hzx⟩ := cluster_distToFinset_attained z (cluster_support_nonempty hnu) refine ⟨x, Finset.mem_filter.mpr ⟨hx, ?_⟩⟩ have hzC : z ∈ C := by rw [← hCz]; exact cluster_componentOf_mem_self hz exact (cluster_distToFinset_le_of_mem x hzC).trans (by simpa [abs_sub_comm] using (hzx ▸ hcloseNu.2 z hz)) obtain ⟨x, hx⟩ := hassoc obtain ⟨y, hyDiff⟩ := hcomp have hy := (Finset.mem_sdiff.mp hyDiff).1 have hyout := (Finset.mem_sdiff.mp hyDiff).2 have hfinite : (sInf {d : EReal | ∃ a ∈ associatedSupport (rho := rho) nu C, ∃ b ∈ nu.support, b ∉ associatedSupport (rho := rho) nu C ∧ d = |a - b|}) ≤ (|x - y| : ℝ) := by apply sInf_le exact ⟨x, hx, y, hy, hyout, rfl⟩ have hnotTop : sInf {d : EReal | ∃ a ∈ associatedSupport (rho := rho) nu C, ∃ b ∈ nu.support, b ∉ associatedSupport (rho := rho) nu C ∧ d = |a - b|} ≠ ⊤ := by intro heq rw [heq] at hfinite exact (not_le_of_gt (EReal.coe_lt_top _)) hfinite have hdef : clusterExternalGap (rho := rho) nu C = sInf {d : EReal | ∃ a ∈ associatedSupport (rho := rho) nu C, ∃ b ∈ nu.support, b ∉ associatedSupport (rho := rho) nu C ∧ d = |a - b|} := by rw [clusterExternalGap, if_pos ⟨y, hyDiff⟩] exact hnotTop (hdef.symm.trans htop) have hnuAll : nu.support ⊆ associatedSupport (rho := rho) nu C := by intro x hx by_contra hout have : x ∈ nu.support \ associatedSupport (rho := rho) nu C := Finset.mem_sdiff.mpr ⟨hx, hout⟩ simpa [hcompEmpty] using this have hpartNu := cluster_association_partition hcenter hnu hrho0 hcloseNu have hpartXi := cluster_association_partition hcenter hxi hrho0 hcloseXi have huniqueComp : ∀ D ∈ components (rho := rho) center, D = C := by intro D hD obtain ⟨z, hz, hDz⟩ := Finset.mem_image.mp hD obtain ⟨x, hx, hzx⟩ := cluster_distToFinset_attained z (cluster_support_nonempty hnu) have hzD : z ∈ D := by rw [← hDz]; exact cluster_componentOf_mem_self hz have hxD : x ∈ associatedSupport (rho := rho) nu D := Finset.mem_filter.mpr ⟨hx, (cluster_distToFinset_le_of_mem x hzD).trans (by simpa [abs_sub_comm] using (hzx ▸ hcloseNu.2 z hz))⟩ obtain ⟨E, hE, huniq⟩ := (hpartNu x).mp hx exact (huniq D ⟨hD, hxD⟩).trans (huniq C ⟨hC, hnuAll hx⟩).symm have hxiAll : xi.support ⊆ associatedSupport (rho := rho) xi C := by intro x hx obtain ⟨D, hD, huniq⟩ := (hpartXi x).mp hx have := hD.2 rwa [huniqueComp D hD.1] at this rw [clusterMass_eq_one_of_support_subset xi hxi C hxiAll, clusterMass_eq_one_of_support_subset nu hnu C hnuAll] · let gap := (clusterExternalGap (rho := rho) nu C).toReal have hgap0 : 0 ≤ gap := by exact EReal.toReal_nonneg (cluster_externalGap_nonneg nu C) have hWxin : AtomicLaw.wass1 xi nu ≤ 2 * R := by calc AtomicLaw.wass1 xi nu ≤ AtomicLaw.wass1 xi center + AtomicLaw.wass1 center nu := by simpa using AtomicLaw.wass1_triangle (⟨xi, hxi⟩ : AtomicLaw.ProbabilityLaw k radius) (⟨center, hcenter⟩ : AtomicLaw.ProbabilityLaw k radius) (⟨nu, hnu⟩ : AtomicLaw.ProbabilityLaw k radius) _ ≤ R + R := add_le_add hWxi (by rw [AtomicLaw.wass1_comm] exact hWnu) _ = 2 * R := by ring by_cases hlarge : 4 * rho < gap · obtain ⟨γ, hγ⟩ := AtomicLaw.wass1_optimal_plan hxi hnu have hcost := cluster_mass_gap_cost hcenter hnu hxi hrho0 hcloseNu hcloseXi hC htop (by linarith) γ have habs : |clusterMass rho xi C - clusterMass rho nu C| ≤ 4 * R / gap := by rw [← hγ] at hWxin have hden : 0 < gap - 2 * rho := by linarith change (gap - 2 * rho) * _ ≤ _ at hcost rw [le_div_iff₀ (by linarith : 0 < gap)] nlinarith [hcost, hWxin, abs_nonneg (clusterMass rho xi C - clusterMass rho nu C)] have hratio : R / gap < 1 := by rw [hrho] at hlarge have hm0 := hm have : R / gap < m / 4 := by rw [div_lt_div_iff₀ (by linarith : 0 < gap) (by norm_num : (0:ℝ)<4)] field_simp at hlarge ⊢ nlinarith linarith rw [min_eq_right hratio.le] calc _ ≤ 4 * R / gap := habs _ ≤ 4 / m * (R / gap) := by rw [show 4 * R / gap = 4 * (R / gap) by ring] gcongr rw [le_div_iff₀ hm] linarith · have habsOne : |clusterMass rho xi C - clusterMass rho nu C| ≤ 1 := by have hxiI := clusterMass_mem_unitInterval (rho := rho) xi hxi C have hnuI := clusterMass_mem_unitInterval (rho := rho) nu hnu C rw [abs_le] constructor <;> linarith by_cases hratio : 1 ≤ R / gap · rw [min_eq_left hratio] calc _ ≤ 1 := habsOne _ ≤ 4 / m := by rw [le_div_iff₀ hm] linarith _ = 4 / m * 1 := by ring · rw [min_eq_right (le_of_not_ge hratio)] calc _ ≤ 1 := habsOne _ ≤ 4 / m * (R / gap) := by have hgapPos : 0 < gap := by have hassoc : (associatedSupport (rho := rho) nu C).Nonempty := by obtain ⟨z, hz, hCz⟩ := Finset.mem_image.mp hC obtain ⟨x, hx, hzx⟩ := cluster_distToFinset_attained z (cluster_support_nonempty hnu) refine ⟨x, Finset.mem_filter.mpr ⟨hx, ?_⟩⟩ have hzC : z ∈ C := by rw [← hCz]; exact cluster_componentOf_mem_self hz exact (cluster_distToFinset_le_of_mem x hzC).trans (by simpa [abs_sub_comm] using (hzx ▸ hcloseNu.2 z hz)) exact cluster_externalGap_toReal_pos hassoc htop rw [hrho] at hlarge have hRg : m / 4 ≤ R / gap := by rw [div_le_div_iff₀ (by norm_num : (0:ℝ)<4) hgapPos] field_simp at hlarge ⊢ nlinarith calc 1 = 4 / m * (m / 4) := by field_simp _ ≤ 4 / m * (R / gap) := by gcongr
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.cluster_candidate_mass_error · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ClusterBounds.lean:319
theorem cluster_deterministic_report

Cluster deterministic report: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius m R rho :
AtomicLaw k radius
hcenter :
AtomicLaw.Valid center
hnu :
AtomicLaw.Valid nu
hm :
0 < m
hmOne :
m ≤ 1
hR :
0 < R
hrho :
rho = R / m
hcenterFloor :
AtomicLaw.AtomFloor m center
hnuFloor :
AtomicLaw.AtomFloor m nu
Calg :
Set (AtomicLaw.LawModulo k radius)
hCalg :
∀ q ∈ Calg,
AtomicLaw.AtomFloor m q.representative.1 ∧ AtomicLaw.wass1 q.representative.1 center ≤ R
hnuCalg :
AtomicLaw.LawModulo.ofProbabilityLaw ⟨nu, hnu⟩ ∈ Calg
hnuRep :
(AtomicLaw.LawModulo.ofProbabilityLaw ⟨nu, hnu⟩).representative.1 = nu
conclusion 1
x :
x ∈ nu.support
↔ ∃! C, C ∈ components (rho := rho) center ∧ x ∈ associatedSupport (rho := rho) nu C
conclusion 2
C ∈ components (rho := rho) center :
(associatedSupport (rho := rho) nu C).Nonempty
conclusion 3
C ∈ components (rho := rho) center :
associatedSupport (rho := rho) nu C ⊆ nu.support
conclusion 4
C ∈ components (rho := rho) center :
x ∈ associatedSupport (rho := rho) nu C :
sInf (C : Set ℝ) - rho ≤ x
x ≤ sSup (C : Set ℝ) + rho
conclusion 5
C ∈ components (rho := rho) center :
sInf {v | ∃ q ∈ Calg, v = clusterMass rho q.representative.1 C} ≤ clusterMass rho nu C
clusterMass rho nu C ≤ sSup {v | ∃ q ∈ Calg, v = clusterMass rho q.representative.1 C}
conclusion 6
C ∈ components (rho := rho) center :
(associatedSupport (rho := rho) nu C).card = 1
(sSup (C : Set ℝ) + rho) - (sInf (C : Set ℝ) - rho) ≤ 4 * rho
conclusion 7
C ∈ components (rho := rho) center :
clusterExternalGap (rho := rho) nu C = ⊤
sSup {v | ∃ q ∈ Calg, v = clusterMass rho q.representative.1 C}
- sInf {v | ∃ q ∈ Calg, v = clusterMass rho q.representative.1 C}
= 0
conclusion 8
C ∈ components (rho := rho) center :
sSup {v | ∃ q ∈ Calg, v = clusterMass rho q.representative.1 C}
- sInf {v | ∃ q ∈ Calg, v = clusterMass rho q.representative.1 C}
≤ 8 / m * min 1 (R / (clusterExternalGap (rho := rho) nu C).toReal)
Proof (Lean source)
lemma cluster_deterministic_report {k : ℕ} {radius m R rho : ℝ} {center nu : AtomicLaw k radius} (hcenter : AtomicLaw.Valid center) (hnu : AtomicLaw.Valid nu) (hm : 0 < m) (hmOne : m ≤ 1) (hR : 0 < R) (hrho : rho = R / m) (hcenterFloor : AtomicLaw.AtomFloor m center) (hnuFloor : AtomicLaw.AtomFloor m nu) (Calg : Set (AtomicLaw.LawModulo k radius)) (hCalg : ∀ q ∈ Calg, AtomicLaw.AtomFloor m q.representative.1 ∧ AtomicLaw.wass1 q.representative.1 center ≤ R) (hnuCalg : AtomicLaw.LawModulo.ofProbabilityLaw ⟨nu, hnu⟩ ∈ Calg) (hnuRep : (AtomicLaw.LawModulo.ofProbabilityLaw ⟨nu, hnu⟩).representative.1 = nu) : (∀ x, x ∈ nu.support ↔ ∃! C, C ∈ components (rho := rho) center ∧ x ∈ associatedSupport (rho := rho) nu C) ∧ (∀ C ∈ components (rho := rho) center, (associatedSupport (rho := rho) nu C).Nonempty) ∧ (∀ C ∈ components (rho := rho) center, associatedSupport (rho := rho) nu C ⊆ nu.support) ∧ (∀ C ∈ components (rho := rho) center, ∀ x ∈ associatedSupport (rho := rho) nu C, sInf (C : Set ℝ) - rho ≤ x ∧ x ≤ sSup (C : Set ℝ) + rho) ∧ (∀ C ∈ components (rho := rho) center, sInf {v | ∃ q ∈ Calg, v = clusterMass rho q.representative.1 C} ≤ clusterMass rho nu C ∧ clusterMass rho nu C ≤ sSup {v | ∃ q ∈ Calg, v = clusterMass rho q.representative.1 C}) ∧ (∀ C ∈ components (rho := rho) center, (associatedSupport (rho := rho) nu C).card = 1 → (sSup (C : Set ℝ) + rho) - (sInf (C : Set ℝ) - rho) ≤ 4 * rho) ∧ (∀ C ∈ components (rho := rho) center, clusterExternalGap (rho := rho) nu C = ⊤ → sSup {v | ∃ q ∈ Calg, v = clusterMass rho q.representative.1 C} - sInf {v | ∃ q ∈ Calg, v = clusterMass rho q.representative.1 C} = 0) ∧ (∀ C ∈ components (rho := rho) center, sSup {v | ∃ q ∈ Calg, v = clusterMass rho q.representative.1 C} - sInf {v | ∃ q ∈ Calg, v = clusterMass rho q.representative.1 C} ≤ 8 / m * min 1 (R / (clusterExternalGap (rho := rho) nu C).toReal)) := by classical have hrho0 : 0 ≤ rho := by rw [hrho]; positivity have hscale : m * rho = R := by rw [hrho]; field_simp have hWnu : AtomicLaw.wass1 nu center ≤ R := by have h := (hCalg _ hnuCalg).2 rwa [hnuRep] at h have hcloseNu := AtomicLaw.support_close_of_wass1_le hnu hcenter hnuFloor hcenterFloor hm (by rw [hscale]; exact hWnu) have hpart := cluster_association_partition hcenter hnu hrho0 hcloseNu refine ⟨hpart, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ · intro C hC obtain ⟨z, hz, hCz⟩ := Finset.mem_image.mp hC obtain ⟨x, hx, hzx⟩ := cluster_distToFinset_attained z (cluster_support_nonempty hnu) refine ⟨x, Finset.mem_filter.mpr ⟨hx, ?_⟩⟩ have hzC : z ∈ C := by rw [← hCz]; exact cluster_componentOf_mem_self hz exact (cluster_distToFinset_le_of_mem x hzC).trans (by simpa [abs_sub_comm] using (hzx ▸ hcloseNu.2 z hz)) · intro C hC x hx exact (Finset.mem_filter.mp hx).1 · intro C hC x hx have hCne : C.Nonempty := by obtain ⟨z, hz, hCz⟩ := Finset.mem_image.mp hC rw [← hCz] exact ⟨z, cluster_componentOf_mem_self hz⟩ obtain ⟨y, hy, hxy⟩ := cluster_distToFinset_attained x hCne have hdist : |x - y| ≤ rho := hxy ▸ (Finset.mem_filter.mp hx).2 have hbelow : BddBelow (C : Set ℝ) := C.finite_toSet.bddBelow have habove : BddAbove (C : Set ℝ) := C.finite_toSet.bddAbove have hinf : sInf (C : Set ℝ) ≤ y := csInf_le hbelow hy have hsup : y ≤ sSup (C : Set ℝ) := le_csSup habove hy rw [abs_le] at hdist constructor <;> linarith · intro C hC let S : Set ℝ := {v | ∃ q ∈ Calg, v = clusterMass rho q.representative.1 C} have hmS : clusterMass rho nu C ∈ S := by refine ⟨AtomicLaw.LawModulo.ofProbabilityLaw ⟨nu, hnu⟩, hnuCalg, ?_⟩ rw [hnuRep] have hbound : ∀ x ∈ S, |x - clusterMass rho nu C| ≤ 1 := by rintro x ⟨q, hq, rfl⟩ have hqI := clusterMass_mem_unitInterval (rho := rho) q.representative.1 q.representative.2 C have hnuI := clusterMass_mem_unitInterval (rho := rho) nu hnu C rw [abs_le] constructor <;> linarith have hext := cluster_extrema_contain_and_width hmS (by norm_num) hbound exact ⟨hext.1, hext.2.1⟩ · intro C hC hcard have hCne : C.Nonempty := by obtain ⟨z, hz, hCz⟩ := Finset.mem_image.mp hC rw [← hCz] exact ⟨z, cluster_componentOf_mem_self hz⟩ obtain ⟨x, hxAssoc⟩ : (associatedSupport (rho := rho) nu C).Nonempty := by obtain ⟨z, hzC⟩ := hCne have hzSupp : z ∈ center.support := by obtain ⟨root, hroot, hCr⟩ := Finset.mem_image.mp hC apply cluster_componentOf_subset_support center root rw [hCr] exact hzC obtain ⟨x, hx, hzx⟩ := cluster_distToFinset_attained z (cluster_support_nonempty hnu) refine ⟨x, Finset.mem_filter.mpr ⟨hx, ?_⟩⟩ exact (cluster_distToFinset_le_of_mem x hzC).trans (by simpa [abs_sub_comm] using (hzx ▸ hcloseNu.2 z hzSupp)) obtain ⟨a, ha⟩ := Finset.card_eq_one.mp hcard have hax : a = x := by have : x ∈ ({a} : Finset ℝ) := by rwa [← ha] have hxa : x = a := by simpa using this exact hxa.symm have hsingleton : associatedSupport (rho := rho) nu C = {x} := by rw [ha, hax] have hcenterClose : ∀ z ∈ C, |z - x| ≤ rho := by intro z hz have hzSupp : z ∈ center.support := by obtain ⟨root, hroot, hCr⟩ := Finset.mem_image.mp hC apply cluster_componentOf_subset_support center root rw [hCr] exact hz obtain ⟨y, hy, hzy⟩ := cluster_distToFinset_attained z (cluster_support_nonempty hnu) have hyAssoc : y ∈ associatedSupport (rho := rho) nu C := Finset.mem_filter.mpr ⟨hy, (cluster_distToFinset_le_of_mem y hz).trans (by simpa [abs_sub_comm] using (hzy ▸ hcloseNu.2 z hzSupp))⟩ have : y = x := by simpa [hsingleton] using hyAssoc subst y exact hzy ▸ hcloseNu.2 z hzSupp have hinfMem := hCne.csInf_mem have hsupMem := hCne.csSup_mem have h1 := hcenterClose (sInf (C : Set ℝ)) hinfMem have h2 := hcenterClose (sSup (C : Set ℝ)) hsupMem rw [abs_le] at h1 h2 linarith · intro C hC htop let S : Set ℝ := {v | ∃ q ∈ Calg, v = clusterMass rho q.representative.1 C} have hmS : clusterMass rho nu C ∈ S := by refine ⟨AtomicLaw.LawModulo.ofProbabilityLaw ⟨nu, hnu⟩, hnuCalg, ?_⟩ rw [hnuRep] have hzero : ∀ x ∈ S, |x - clusterMass rho nu C| ≤ 0 := by rintro x ⟨q, hq, rfl⟩ have herr := cluster_candidate_mass_error hcenter hnu q.representative.2 hm hmOne hR hrho hcenterFloor hnuFloor (hCalg q hq).1 hWnu (hCalg q hq).2 hC rw [if_pos htop] at herr rw [herr, sub_self, abs_zero] have hext := cluster_extrema_contain_and_width hmS (le_refl 0) hzero change sSup S - sInf S = 0 linarith · intro C hC let S : Set ℝ := {v | ∃ q ∈ Calg, v = clusterMass rho q.representative.1 C} let B := 4 / m * min 1 (R / (clusterExternalGap (rho := rho) nu C).toReal) have hmS : clusterMass rho nu C ∈ S := by refine ⟨AtomicLaw.LawModulo.ofProbabilityLaw ⟨nu, hnu⟩, hnuCalg, ?_⟩ rw [hnuRep] have hB : 0 ≤ B := by dsimp [B] apply mul_nonneg · exact div_nonneg (by norm_num) hm.le · apply le_min (by norm_num) exact div_nonneg hR.le (EReal.toReal_nonneg (cluster_externalGap_nonneg nu C)) have hbound : ∀ x ∈ S, |x - clusterMass rho nu C| ≤ B := by rintro x ⟨q, hq, rfl⟩ have herr := cluster_candidate_mass_error hcenter hnu q.representative.2 hm hmOne hR hrho hcenterFloor hnuFloor (hCalg q hq).1 hWnu (hCalg q hq).2 hC split_ifs at herr with htop · rw [herr, sub_self, abs_zero] exact hB · exact herr have hext := cluster_extrema_contain_and_width hmS hB hbound change sSup S - sInf S ≤ _ calc _ ≤ 2 * B := hext.2.2 _ = 8 / m * min 1 (R / (clusterExternalGap (rho := rho) nu C).toReal) := by dsimp [B] ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.cluster_deterministic_report · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ClusterBounds.lean:484
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.ClusterGeometry 17 declarations
theorem cluster_support_nonempty

Cluster support nonempty: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
AtomicLaw k radius
:
AtomicLaw.Valid ν
ν.support.Nonempty
Proof (Lean source)
lemma cluster_support_nonempty {k : ℕ} {radius : ℝ} {ν : AtomicLaw k radius} (hν : AtomicLaw.Valid ν) : ν.support.Nonempty := by by_contra he have hempty : ν.support = ∅ := Finset.not_nonempty_iff_eq_empty.mp he have hzero : ∑ i, ν.weight i = 0 := by apply Finset.sum_eq_zero intro i hi have hnpos : ¬ 0 < ν.weight i := by intro hp have hx : ν.atom i ∈ ν.support := Finset.mem_image.mpr ⟨i, Finset.mem_filter.mpr ⟨Finset.mem_univ _, hp⟩, rfl⟩ simpa [hempty] using hx exact le_antisymm (le_of_not_gt hnpos) (hν.1 i) linarith [hν.2.1]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.cluster_support_nonempty · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ClusterGeometry.lean:8
theorem cluster_support_eq_of_measureEquivalent Lemma cluster_support_eq_of_measureEquivalent in the paper ↗

Cluster support eq of measure equivalent: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
ν ξ :
AtomicLaw.ProbabilityLaw k radius
h :
ν.MeasureEquivalent ξ
ν.1.support = ξ.1.support
Proof (Lean source)
lemma cluster_support_eq_of_measureEquivalent {k : ℕ} {radius : ℝ} (ν ξ : AtomicLaw.ProbabilityLaw k radius) (h : ν.MeasureEquivalent ξ) : ν.1.support = ξ.1.support := by classical have oneSide (a b : AtomicLaw.ProbabilityLaw k radius) (hab : a.MeasureEquivalent b) : a.1.support ⊆ b.1.support := by intro x hx rcases Finset.mem_image.mp hx with ⟨i, hi, rfl⟩ have hipos := (Finset.mem_filter.mp hi).2 have hleft : 0 < ∑ l with a.1.atom l = a.1.atom i, a.1.weight l := Finset.sum_pos' (fun l _ => a.2.1 l) ⟨i, by simp, hipos⟩ have hright : 0 < ∑ l with b.1.atom l = a.1.atom i, b.1.weight l := by rw [← hab.aggregate_weight] exact hleft obtain ⟨j, hjmem, hjpos⟩ := (Finset.sum_pos_iff_of_nonneg (fun l _ => b.2.1 l)).mp hright exact Finset.mem_image.mpr ⟨j, Finset.mem_filter.mpr ⟨Finset.mem_univ _, hjpos⟩, (Finset.mem_filter.mp hjmem).2⟩ ext x exact ⟨fun hx => oneSide ν ξ h hx, fun hx => oneSide ξ ν h.symm hx⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.cluster_support_eq_of_measureEquivalent · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ClusterGeometry.lean:25
theorem cluster_distToFinset_attained Lemma cluster_distToFinset_attained in the paper ↗

Cluster dist to finset attained: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
x :
C :
Finset
hC :
C.Nonempty
∃ y ∈ C, AtomicLaw.distToFinset x C = |x - y|
Proof (Lean source)
lemma cluster_distToFinset_attained (x : ℝ) {C : Finset ℝ} (hC : C.Nonempty) : ∃ y ∈ C, AtomicLaw.distToFinset x C = |x - y| := by let S : Set ℝ := {d | ∃ y ∈ C, d = |x - y|} have hSne : S.Nonempty := by obtain ⟨y, hy⟩ := hC exact ⟨|x - y|, y, hy, rfl⟩ have hSfin : S.Finite := by have himg : S = (fun y : ℝ => |x - y|) '' (C : Set ℝ) := by ext d simp [S, eq_comm] rw [himg] exact C.finite_toSet.image _ have hm := hSne.csInf_mem hSfin simpa [AtomicLaw.distToFinset, S] using hm
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.cluster_distToFinset_attained · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ClusterGeometry.lean:48
theorem cluster_distToFinset_nonneg Lemma cluster_distToFinset_nonneg in the paper ↗

Cluster dist to finset nonneg: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
x :
C :
Finset
hC :
C.Nonempty
0 ≤ AtomicLaw.distToFinset x C
Proof (Lean source)
lemma cluster_distToFinset_nonneg (x : ℝ) {C : Finset ℝ} (hC : C.Nonempty) : 0 ≤ AtomicLaw.distToFinset x C := by obtain ⟨y, hy, hxy⟩ := cluster_distToFinset_attained x hC rw [hxy] exact abs_nonneg _
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.cluster_distToFinset_nonneg · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ClusterGeometry.lean:65
theorem cluster_distToFinset_le_of_mem Lemma cluster_distToFinset_le_of_mem in the paper ↗

Cluster dist to finset le of mem: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
x :
C :
Finset
y :
hy :
y ∈ C
AtomicLaw.distToFinset x C ≤ |x - y|
Proof (Lean source)
lemma cluster_distToFinset_le_of_mem (x : ℝ) {C : Finset ℝ} {y : ℝ} (hy : y ∈ C) : AtomicLaw.distToFinset x C ≤ |x - y| := by unfold AtomicLaw.distToFinset apply csInf_le · exact ⟨0, by rintro d ⟨z, hz, rfl⟩; exact abs_nonneg _⟩ · exact ⟨y, hy, rfl⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.cluster_distToFinset_le_of_mem · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ClusterGeometry.lean:73
theorem cluster_linked_symmetric

Cluster linked symmetric: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius rho :
ν :
AtomicLaw k radius
Symmetric (linked (rho := rho) ν)
Proof (Lean source)
lemma cluster_linked_symmetric {k : ℕ} {radius rho : ℝ} (ν : AtomicLaw k radius) : Symmetric (linked (rho := rho) ν) := by intro x y hxy exact ⟨hxy.2.1, hxy.1, by simpa [abs_sub_comm] using hxy.2.2⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.cluster_linked_symmetric · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ClusterGeometry.lean:82
theorem cluster_componentOf_mem_self

Cluster component of mem self: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius rho :
AtomicLaw k radius
x :
hx :
x ∈ ν.support
x ∈ componentOf (rho := rho) ν x
Proof (Lean source)
lemma cluster_componentOf_mem_self {k : ℕ} {radius rho : ℝ} {ν : AtomicLaw k radius} {x : ℝ} (hx : x ∈ ν.support) : x ∈ componentOf (rho := rho) ν x := by simp [componentOf, hx, Relation.ReflTransGen.refl]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.cluster_componentOf_mem_self · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ClusterGeometry.lean:89
theorem cluster_componentOf_subset_support

Cluster component of subset support: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius rho :
ν :
AtomicLaw k radius
x :
componentOf (rho := rho) ν x ⊆ ν.support
Proof (Lean source)
lemma cluster_componentOf_subset_support {k : ℕ} {radius rho : ℝ} (ν : AtomicLaw k radius) (x : ℝ) : componentOf (rho := rho) ν x ⊆ ν.support := by classical intro y hy exact (Finset.mem_filter.mp (by simpa [componentOf] using hy)).1
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.cluster_componentOf_subset_support · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ClusterGeometry.lean:95
theorem cluster_componentOf_eq_of_connected

Cluster component of eq of connected: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius rho :
AtomicLaw k radius
x y :
hxy :
ReflTransGen (linked (rho := rho) ν) x y
componentOf (rho := rho) ν x = componentOf (rho := rho) ν y
Proof (Lean source)
lemma cluster_componentOf_eq_of_connected {k : ℕ} {radius rho : ℝ} {ν : AtomicLaw k radius} {x y : ℝ} (hxy : ReflTransGen (linked (rho := rho) ν) x y) : componentOf (rho := rho) ν x = componentOf (rho := rho) ν y := by classical haveI : Std.Symm (linked (rho := rho) ν) := ⟨cluster_linked_symmetric ν⟩ ext z simp only [componentOf, mem_filter] constructor · rintro ⟨hz, hxz⟩ exact ⟨hz, (Std.Symm.symm x y hxy).trans hxz⟩ · rintro ⟨hz, hyz⟩ exact ⟨hz, hxy.trans hyz⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.cluster_componentOf_eq_of_connected · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ClusterGeometry.lean:103
theorem cluster_componentOf_eq_of_linked

Cluster component of eq of linked: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius rho :
AtomicLaw k radius
x y :
hxy :
linked (rho := rho) ν x y
componentOf (rho := rho) ν x = componentOf (rho := rho) ν y
Proof (Lean source)
lemma cluster_componentOf_eq_of_linked {k : ℕ} {radius rho : ℝ} {ν : AtomicLaw k radius} {x y : ℝ} (hxy : linked (rho := rho) ν x y) : componentOf (rho := rho) ν x = componentOf (rho := rho) ν y := cluster_componentOf_eq_of_connected (Relation.ReflTransGen.single hxy)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.cluster_componentOf_eq_of_linked · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ClusterGeometry.lean:119
theorem cluster_component_eq_componentOf_of_mem

Cluster component eq component of of mem: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius rho :
AtomicLaw k radius
C :
Finset
hC :
C ∈ components (rho := rho) ν
x :
hx :
x ∈ C
C = componentOf (rho := rho) ν x
Proof (Lean source)
lemma cluster_component_eq_componentOf_of_mem {k : ℕ} {radius rho : ℝ} {ν : AtomicLaw k radius} {C : Finset ℝ} (hC : C ∈ components (rho := rho) ν) {x : ℝ} (hx : x ∈ C) : C = componentOf (rho := rho) ν x := by classical obtain ⟨y, hy, hCy⟩ := Finset.mem_image.mp hC have hxComp : x ∈ componentOf (rho := rho) ν y := by rw [hCy]; exact hx have hyx : ReflTransGen (linked (rho := rho) ν) y x := (Finset.mem_filter.mp (by simpa [componentOf] using hxComp)).2 exact hCy.symm.trans (cluster_componentOf_eq_of_connected hyx)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.cluster_component_eq_componentOf_of_mem · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ClusterGeometry.lean:126
theorem cluster_components_partition_support

Cluster components partition support: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius rho :
ν :
AtomicLaw k radius
x :
x ∈ ν.support ↔ ∃! C, C ∈ components (rho := rho) ν ∧ x ∈ C
Proof (Lean source)
lemma cluster_components_partition_support {k : ℕ} {radius rho : ℝ} (ν : AtomicLaw k radius) : ∀ x, x ∈ ν.support ↔ ∃! C, C ∈ components (rho := rho) ν ∧ x ∈ C := by classical intro x constructor · intro hx refine ⟨componentOf (rho := rho) ν x, ?_, ?_⟩ · exact ⟨Finset.mem_image.mpr ⟨x, hx, rfl⟩, cluster_componentOf_mem_self hx⟩ · intro C hC obtain ⟨y, hy, hCy⟩ := Finset.mem_image.mp hC.1 have hxComp : x ∈ componentOf (rho := rho) ν y := by rw [hCy] exact hC.2 have hyx : ReflTransGen (linked (rho := rho) ν) y x := (Finset.mem_filter.mp (by simpa [componentOf] using hxComp)).2 exact hCy.symm.trans (cluster_componentOf_eq_of_connected hyx) · rintro ⟨C, ⟨hCcomp, hxC⟩, huniq⟩ obtain ⟨y, hy, hCy⟩ := Finset.mem_image.mp hCcomp apply cluster_componentOf_subset_support ν y rw [hCy] exact hxC
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.cluster_components_partition_support · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ClusterGeometry.lean:138
theorem cluster_association_partition

Cluster association partition: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius rho :
AtomicLaw k radius
hcenter :
AtomicLaw.Valid center
:
AtomicLaw.Valid ν
hrho :
0 ≤ rho
hclose :
(∀ x ∈ ν.support, AtomicLaw.distToFinset x center.support ≤ rho) ∧
∀ y ∈ center.support, AtomicLaw.distToFinset y ν.support ≤ rho
x :
x ∈ ν.support
↔ ∃! C, C ∈ components (rho := rho) center ∧ x ∈ ν.support.filter (fun z => AtomicLaw.distToFinset z C ≤ rho)
Proof (Lean source)
lemma cluster_association_partition {k : ℕ} {radius rho : ℝ} {center ν : AtomicLaw k radius} (hcenter : AtomicLaw.Valid center) (hν : AtomicLaw.Valid ν) (hrho : 0 ≤ rho) (hclose : (∀ x ∈ ν.support, AtomicLaw.distToFinset x center.support ≤ rho) ∧ ∀ y ∈ center.support, AtomicLaw.distToFinset y ν.support ≤ rho) : ∀ x, x ∈ ν.support ↔ ∃! C, C ∈ components (rho := rho) center ∧ x ∈ ν.support.filter (fun z => AtomicLaw.distToFinset z C ≤ rho) := by classical have hcenter_ne : center.support.Nonempty := cluster_support_nonempty hcenter intro x constructor · intro hx obtain ⟨y, hy, hdist⟩ := cluster_distToFinset_attained x hcenter_ne have hxy : |x - y| ≤ rho := hdist ▸ hclose.1 x hx let C := componentOf (rho := rho) center y have hyC : y ∈ C := cluster_componentOf_mem_self hy refine ⟨C, ⟨Finset.mem_image.mpr ⟨y, hy, rfl⟩, Finset.mem_filter.mpr ⟨hx, (cluster_distToFinset_le_of_mem x hyC).trans hxy⟩⟩, ?_⟩ intro D hD have hDne : D.Nonempty := by obtain ⟨root, hroot, hDr⟩ := Finset.mem_image.mp hD.1 rw [← hDr] exact ⟨root, cluster_componentOf_mem_self hroot⟩ obtain ⟨z, hz, hxz⟩ := cluster_distToFinset_attained x hDne have hxz_le : |x - z| ≤ rho := hxz ▸ (Finset.mem_filter.mp hD.2).2 have hzSupp : z ∈ center.support := by obtain ⟨root, hroot, hDr⟩ := Finset.mem_image.mp hD.1 apply cluster_componentOf_subset_support center root rw [hDr] exact hz have hlink : linked (rho := rho) center y z := by refine ⟨hy, hzSupp, ?_⟩ calc |y - z| ≤ |y - x| + |x - z| := abs_sub_le y x z _ ≤ 2 * rho := by rw [abs_sub_comm y x]; linarith _ ≤ 4 * rho := by linarith calc D = componentOf (rho := rho) center z := cluster_component_eq_componentOf_of_mem hD.1 hz _ = C := (cluster_componentOf_eq_of_linked hlink).symm · rintro ⟨C, ⟨hC, hx⟩, huniq⟩ exact (Finset.mem_filter.mp hx).1
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.cluster_association_partition · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ClusterGeometry.lean:163
theorem cluster_extrema_contain_and_width Lemma cluster_extrema_contain_and_width in the paper ↗

Cluster extrema contain and width: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
S :
Set
m B :
hm :
m ∈ S
hB :
0 ≤ B
hbound :
∀ x ∈ S, |x - m| ≤ B
conclusion 1
sInf S ≤ m
conclusion 2
m ≤ sSup S
conclusion 3
sSup S - sInf S ≤ 2 * B
Proof (Lean source)
lemma cluster_extrema_contain_and_width {S : Set ℝ} {m B : ℝ} (hm : m ∈ S) (hB : 0 ≤ B) (hbound : ∀ x ∈ S, |x - m| ≤ B) : sInf S ≤ m ∧ m ≤ sSup S ∧ sSup S - sInf S ≤ 2 * B := by have hbelow : BddBelow S := by refine ⟨m - B, ?_⟩ intro x hx have := hbound x hx rw [abs_le] at this linarith have habove : BddAbove S := by refine ⟨m + B, ?_⟩ intro x hx have := hbound x hx rw [abs_le] at this linarith refine ⟨csInf_le hbelow hm, le_csSup habove hm, ?_⟩ have hsup : sSup S ≤ m + B := csSup_le ⟨m, hm⟩ fun x hx => by have := hbound x hx rw [abs_le] at this linarith have hinf : m - B ≤ sInf S := le_csInf ⟨m, hm⟩ fun x hx => by have := hbound x hx rw [abs_le] at this linarith linarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.cluster_extrema_contain_and_width · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ClusterGeometry.lean:209
theorem cluster_externalGap_le_cross

Cluster external gap le cross: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius rho :
AtomicLaw k radius
C :
Finset
hgapTop :
clusterExternalGap (rho := rho) ν C ≠ ⊤
x y :
hx :
x ∈ associatedSupport (rho := rho) ν C
hy :
y ∈ ν.support
hyout :
y ∉ associatedSupport (rho := rho) ν C
(clusterExternalGap (rho := rho) ν C).toReal ≤ |x - y|
Proof (Lean source)
lemma cluster_externalGap_le_cross {k : ℕ} {radius rho : ℝ} {ν : AtomicLaw k radius} {C : Finset ℝ} (hgapTop : clusterExternalGap (rho := rho) ν C ≠ ⊤) {x y : ℝ} (hx : x ∈ associatedSupport (rho := rho) ν C) (hy : y ∈ ν.support) (hyout : y ∉ associatedSupport (rho := rho) ν C) : (clusterExternalGap (rho := rho) ν C).toReal ≤ |x - y| := by have hcomp : (ν.support \ associatedSupport (rho := rho) ν C).Nonempty := by exact ⟨y, Finset.mem_sdiff.mpr ⟨hy, hyout⟩⟩ have hle : clusterExternalGap (rho := rho) ν C ≤ (|x - y| : ℝ) := by rw [clusterExternalGap, if_pos hcomp] apply sInf_le exact ⟨x, hx, y, hy, hyout, rfl⟩ apply EReal.toReal_le_toReal hle · intro hbot have hnonneg : (0 : EReal) ≤ clusterExternalGap (rho := rho) ν C := by rw [clusterExternalGap, if_pos hcomp] apply le_sInf intro d hd rcases hd with ⟨a, ha, b, hb, hbout, rfl⟩ positivity rw [hbot] at hnonneg exact (not_le_of_gt EReal.bot_lt_zero) hnonneg · simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.cluster_externalGap_le_cross · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ClusterGeometry.lean:237
theorem cluster_externalGap_nonneg

Cluster external gap nonneg: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius rho :
ν :
AtomicLaw k radius
C :
Finset
(0 : EReal) ≤ clusterExternalGap (rho := rho) ν C
Proof (Lean source)
lemma cluster_externalGap_nonneg {k : ℕ} {radius rho : ℝ} (ν : AtomicLaw k radius) (C : Finset ℝ) : (0 : EReal) ≤ clusterExternalGap (rho := rho) ν C := by unfold clusterExternalGap split_ifs · apply le_sInf intro d hd rcases hd with ⟨x, hx, y, hy, hyout, rfl⟩ positivity · exact le_top
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.cluster_externalGap_nonneg · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ClusterGeometry.lean:263
theorem cluster_externalGap_toReal_pos

Cluster external gap to real pos: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius rho :
AtomicLaw k radius
C :
Finset
hA :
(associatedSupport (rho := rho) ν C).Nonempty
htop :
clusterExternalGap (rho := rho) ν C ≠ ⊤
0 < (clusterExternalGap (rho := rho) ν C).toReal
Proof (Lean source)
lemma cluster_externalGap_toReal_pos {k : ℕ} {radius rho : ℝ} {ν : AtomicLaw k radius} {C : Finset ℝ} (hA : (associatedSupport (rho := rho) ν C).Nonempty) (htop : clusterExternalGap (rho := rho) ν C ≠ ⊤) : 0 < (clusterExternalGap (rho := rho) ν C).toReal := by let A := associatedSupport (rho := rho) ν C let B := ν.support let D : Set EReal := {d | ∃ x ∈ A, ∃ y ∈ B, y ∉ A ∧ d = |x - y|} have hcomp : (B \ A).Nonempty := by by_contra he have hempty : B \ A = ∅ := Finset.not_nonempty_iff_eq_empty.mp he have : clusterExternalGap (rho := rho) ν C = ⊤ := by rw [clusterExternalGap, if_neg] simpa [A, B, hempty] exact htop this have hDne : D.Nonempty := by obtain ⟨x, hx⟩ := hA obtain ⟨y, hy⟩ := hcomp exact ⟨(|x - y| : ℝ), x, hx, y, (Finset.mem_sdiff.mp hy).1, (Finset.mem_sdiff.mp hy).2, rfl⟩ have hDfin : D.Finite := by let F := A.product B have hsub : D ⊆ (fun p : ℝ × ℝ => ((|p.1 - p.2| : ℝ) : EReal)) '' (F : Set (ℝ × ℝ)) := by rintro d ⟨x, hx, y, hy, hyout, rfl⟩ exact ⟨(x, y), Finset.mem_product.mpr ⟨hx, hy⟩, rfl⟩ exact (F.finite_toSet.image _).subset hsub have hmin := hDne.csInf_mem hDfin rcases hmin with ⟨x, hx, y, hy, hyout, hEq⟩ have hxy : x ≠ y := by intro h subst y exact hyout hx have hInfPos : (0 : EReal) < sInf D := by rw [hEq] exact_mod_cast (abs_pos.mpr (sub_ne_zero.mpr hxy)) have hdef : clusterExternalGap (rho := rho) ν C = sInf D := by rw [clusterExternalGap, if_pos (by simpa [A, B] using hcomp)] apply EReal.toReal_pos · rwa [hdef] · exact htop
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.cluster_externalGap_toReal_pos · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ClusterGeometry.lean:276
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.ClusterTransport 2 declarations
theorem test_mass_identity

Test mass identity: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
AtomicLaw k radius
γ :
p q :
(∑ i, if p i then a.weight i else 0) - (∑ j, if q j then b.weight j else 0)
= (∑ i, ∑ j, if p i ∧ ¬ q j then γ.mass i j else 0)
- (∑ i, ∑ j, if ¬ p i ∧ q j then γ.mass i j else 0)
Proof (Lean source)
lemma test_mass_identity {k : ℕ} {radius : ℝ} {a b : AtomicLaw k radius} (γ : TransportPlan a b) (p q : Fin k → Prop) [DecidablePred p] [DecidablePred q] : (∑ i, if p i then a.weight i else 0) - (∑ j, if q j then b.weight j else 0) = (∑ i, ∑ j, if p i ∧ ¬ q j then γ.mass i j else 0) - (∑ i, ∑ j, if ¬ p i ∧ q j then γ.mass i j else 0) := by simp_rw [← γ.fst_marginal, ← γ.snd_marginal] have hp : (∑ i, if p i then ∑ j, γ.mass i j else 0) = ∑ i, ∑ j, if p i then γ.mass i j else 0 := by apply Finset.sum_congr rfl intro i hi rw [Finset.sum_ite_irrel] simp have hq : (∑ j, if q j then ∑ i, γ.mass i j else 0) = ∑ j, ∑ i, if q j then γ.mass i j else 0 := by apply Finset.sum_congr rfl intro j hj rw [Finset.sum_ite_irrel] simp rw [hp, hq, Finset.sum_comm (f := fun j i => if q j then γ.mass i j else 0)] classical simp only [← Finset.sum_sub_distrib] apply Finset.sum_congr rfl intro i hi apply Finset.sum_congr rfl intro j hj by_cases hp : p i <;> by_cases hq : q j <;> simp [hp, hq]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.test_mass_identity · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ClusterTransport.lean:6
theorem test_mass_gap

Test mass gap: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius gap :
AtomicLaw k radius
γ :
p q :
hgap :
0 ≤ gap
hcross :
∀ i j
if
0 < γ.mass i j
and
(p i ∧ ¬ q j) ∨ (¬ p i ∧ q j)
then
gap ≤ |a.atom i - b.atom j|
gap * |(∑ i, if p i then a.weight i else 0) - (∑ j, if q j then b.weight j else 0)|
Proof (Lean source)
lemma test_mass_gap {k : ℕ} {radius gap : ℝ} {a b : AtomicLaw k radius} (γ : TransportPlan a b) (p q : Fin k → Prop) [DecidablePred p] [DecidablePred q] (hgap : 0 ≤ gap) (hcross : ∀ i j, 0 < γ.mass i j → (p i ∧ ¬ q j) ∨ (¬ p i ∧ q j) → gap ≤ |a.atom i - b.atom j|) : gap * |(∑ i, if p i then a.weight i else 0) - (∑ j, if q j then b.weight j else 0)| ≤ transportCost γ := by classical let S : ℝ := ∑ i, ∑ j, if p i ∧ ¬ q j then γ.mass i j else 0 let T : ℝ := ∑ i, ∑ j, if ¬ p i ∧ q j then γ.mass i j else 0 have hS : 0 ≤ S := sum_nonneg fun i _ => sum_nonneg fun j _ => by split_ifs <;> simp_all [γ.nonneg] have hT : 0 ≤ T := sum_nonneg fun i _ => sum_nonneg fun j _ => by split_ifs <;> simp_all [γ.nonneg] rw [test_mass_identity γ p q] calc gap * |S - T| ≤ gap * (S + T) := by gcongr rw [abs_le] constructor <;> linarith _ = ∑ i, ∑ j, gap * ((if p i ∧ ¬ q j then γ.mass i j else 0) + (if ¬ p i ∧ q j then γ.mass i j else 0)) := by simp [S, T, Finset.mul_sum, Finset.sum_add_distrib, mul_add] _ ≤ ∑ i, ∑ j, γ.mass i j * |a.atom i - b.atom j| := by apply Finset.sum_le_sum intro i hi apply Finset.sum_le_sum intro j hj by_cases hp : p i <;> by_cases hq : q j · simp [hp, hq, mul_nonneg (γ.nonneg i j) (abs_nonneg _)] · simp only [hp, hq, true_and, not_false_eq_true, ↓reduceIte, not_true_eq_false, false_and, add_zero] by_cases hm : 0 < γ.mass i j · nlinarith [hcross i j hm (inl ⟨hp, hq⟩)] · have : γ.mass i j = 0 := le_antisymm (le_of_not_gt hm) (γ.nonneg i j) simp [this] · simp only [hp, hq, false_and, ↓reduceIte, not_false_eq_true, true_and, not_true_eq_false, zero_add] by_cases hm : 0 < γ.mass i j · nlinarith [hcross i j hm (inr ⟨hp, hq⟩)] · have : γ.mass i j = 0 := le_antisymm (le_of_not_gt hm) (γ.nonneg i j) simp [this] · simp [hp, hq, mul_nonneg (γ.nonneg i j) (abs_nonneg _)] _ = transportCost γ := rfl
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.test_mass_gap · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ClusterTransport.lean:34
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.Concentration 1 declarations Uniform concentration of the finite-product observable summary.

Uniform concentration of the finite-product observable summary.

theorem uniform_summary_concentration Lemma 1 in the paper ↗

The five-block empirical summary concentrates uniformly, including the empty-arm event. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hsigma :
0 < sigma0
hsigmaMax :
sigma0 ≤ 1
conclusion 1
L :
n :
1 ≤ L
1 ≤ n
P :
Measure (FullData k dx dz)
letI
Proof (Lean source)
-- @node: lem:uniform-summary-concentration lemma uniform_summary_concentration (k dx dz : ℕ) (pi0 sigma0 : ℝ) (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hpi : 0 < pi0) (hpiMax : pi0 ≤ 1 / (2 * k : ℝ)) (hsigma : 0 < sigma0) (hsigmaMax : sigma0 ≤ 1) : ∃ C0 : ℝ, ConcentrationConstantDomain C0 ∧ ∀ (L : ℝ) (n : ℕ), 1 ≤ L → 1 ≤ n → ∀ (P : Measure (FullData k dx dz)) (_hP : IsProbabilityMeasure P), letI := _hP UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P → ∀ eta : ℝ, TailLevelDomain eta → (sampleLaw (n := n) P).real {sample | C0 * L * sqrt (log (C0 / eta) / n) < dS (empSummary sample) (obsSummary P)} ≤ eta ∧ ∀ t : Bool, (sampleLaw (n := n) P).real {sample | armCount t sample = 0} = (1 - (obsLaw P).real {o | o.T = t}) ^ n ∧ (sampleLaw (n := n) P).real {sample | armCount t sample = 0} ≤ (1 - k * pi0) ^ n := by let cardR : ℝ := card (SummaryCoord dx dz) let Ksmall : ℝ := 16 * entryNormConstant dz dx / (k * pi0) + dx let Klarge : ℝ := 4 * (entryNormConstant dz dx + 1) + dx + 1 let C0 : ℝ := max (cardR + 1) (max (2 * Ksmall) (4 * Klarge / (k * pi0))) refine ⟨C0, ?_, ?_⟩ · have hcard0 : 0 ≤ cardR := by positivity exact le_trans (by linarith) (le_max_left _ _) intro L n hL hn P hP letI := hP intro hM eta hEta rcases hEta with ⟨heta, hetaHalf⟩ have hn0 : 0 < n := by omega have hk0 : (0 : ℝ) < k := by exact_mod_cast (lt_of_lt_of_le (by omega : 0 < 2) hk) have hkpi : 0 < (k : ℝ) * pi0 := mul_pos hk0 hpi have hcard0 : 0 ≤ cardR := by positivity have hC_card : cardR ≤ C0 := le_trans (by linarith) (le_max_left _ _) have hC1 : 1 ≤ C0 := le_trans (by linarith) (le_max_left _ _) have hCpos : 0 < C0 := lt_of_lt_of_le zero_lt_one hC1 let s : ℝ := sqrt (log (C0 / eta) / n) let beta : ℝ := 2 * s let badDev : Set (Fin n → Obs dx dz) := {sample | ∃ c : SummaryCoord dx dz, summaryCoordScale L c * beta ≤ |(n : ℝ)⁻¹ * ∑ i, summaryCoordStat c (sample i) - ∫ o, summaryCoordStat c o ∂obsLaw P|} let badSupport : Set (Fin n → Obs dx dz) := {sample | ¬ ∀ i c, |summaryCoordStat c (sample i)| ≤ summaryCoordScale L c} have hs0 : 0 ≤ s := Real.sqrt_nonneg _ have hbeta0 : 0 ≤ beta := mul_nonneg (by norm_num) hs0 have hbadDev : (sampleLaw (n := n) P).real badDev ≤ eta := by have hUnion : (sampleLaw (n := n) P).real badDev ≤ ∑ c : SummaryCoord dx dz, (sampleLaw (n := n) P).real {sample | summaryCoordScale L c * beta ≤ |(n : ℝ)⁻¹ * ∑ i, summaryCoordStat c (sample i) - ∫ o, summaryCoordStat c o ∂obsLaw P|} := by rw [show badDev = ⋃ c : SummaryCoord dx dz, {sample | summaryCoordScale L c * beta ≤ |(n : ℝ)⁻¹ * ∑ i, summaryCoordStat c (sample i) - ∫ o, summaryCoordStat c o ∂obsLaw P|} by ext sample simp [badDev]] exact measureReal_iUnion_fintype_le _ have hcoord (c : SummaryCoord dx dz) : (sampleLaw (n := n) P).real {sample | summaryCoordScale L c * beta ≤ |(n : ℝ)⁻¹ * ∑ i, summaryCoordStat c (sample i) - ∫ o, summaryCoordStat c o ∂obsLaw P|} ≤ 2 * (eta / C0) ^ 2 := by simpa [beta, s] using summaryCoord_deviation_probability P hM hL hn0 heta (by linarith : eta < 1) hC1 c calc _ ≤ ∑ _c : SummaryCoord dx dz, 2 * (eta / C0) ^ 2 := hUnion.trans (Finset.sum_le_sum fun _ _ => hcoord _) _ = cardR * (2 * (eta / C0) ^ 2) := by simp [cardR] _ ≤ C0 * (2 * (eta / C0) ^ 2) := by gcongr _ = 2 * eta ^ 2 / C0 := by field_simp _ ≤ 2 * eta ^ 2 := by rw [div_le_iff₀ hCpos] nlinarith [sq_nonneg eta] _ ≤ eta := by nlinarith have hbadSupport : (sampleLaw (n := n) P).real badSupport = 0 := by have hae := sample_summaryCoordSupport_ae P hM hL (n := n) have hz : sampleLaw (n := n) P badSupport = 0 := by rw [← ae_iff] simpa [badSupport] using hae simp [Measure.real, hz] have hRiskSubset : {sample | C0 * L * s < dS (empSummary sample) (obsSummary P)} ⊆ badDev ∪ badSupport := by intro sample hrisk change C0 * L * s < dS (empSummary sample) (obsSummary P) at hrisk by_cases hsupp : ∀ i c, |summaryCoordStat c (sample i)| ≤ summaryCoordScale L c · left by_contra hnot have hdev : ∀ c : SummaryCoord dx dz, |(n : ℝ)⁻¹ * ∑ i, summaryCoordStat c (sample i) - ∫ o, summaryCoordStat c o ∂obsLaw P| < summaryCoordScale L c * beta := by intro c have hc : ¬ summaryCoordScale L c * beta ≤ |(n : ℝ)⁻¹ * ∑ i, summaryCoordStat c (sample i) - ∫ o, summaryCoordStat c o ∂obsLaw P| := by intro hc exact hnot (by exact ⟨c, hc⟩) exact lt_of_not_ge hc have hdS : dS (empSummary sample) (obsSummary P) ≤ C0 * L * s := by by_cases hsmall : beta < (k : ℝ) * pi0 / 2 · have hraw := empSummary_error_of_small_deviations P hM hL hpi hn0 hbeta0 hsmall sample hdev have hCsmall : 2 * Ksmall ≤ C0 := le_trans (le_max_left _ _) (le_max_right _ _) calc _ ≤ Ksmall * L * beta := by simpa [Ksmall] using hraw _ = (2 * Ksmall) * L * s := by simp [beta]; ring _ ≤ C0 * L * s := by gcongr · have hraw := empSummary_error_on_support P hM hL hpi hn0 sample hsupp have hsLower : (k : ℝ) * pi0 / 4 ≤ s := by dsimp [beta] at hsmall linarith have hClarge : 4 * Klarge / ((k : ℝ) * pi0) ≤ C0 := le_trans (le_max_right _ _) (le_max_right _ _) calc _ ≤ Klarge * L := by simpa [Klarge] using hraw _ ≤ (4 * Klarge / ((k : ℝ) * pi0)) * L * s := by have hKlarge0 : 0 ≤ Klarge := by dsimp [Klarge] have he := entryNormConstant_nonneg dz dx positivity have hfactor : 1 ≤ 4 * s / ((k : ℝ) * pi0) := by rw [le_div_iff₀ hkpi] linarith calc Klarge * L ≤ Klarge * L * (4 * s / ((k : ℝ) * pi0)) := by simpa using (mul_le_mul_of_nonneg_left hfactor (mul_nonneg hKlarge0 (le_trans zero_le_one hL))) _ = (4 * Klarge / ((k : ℝ) * pi0)) * L * s := by field_simp _ ≤ C0 * L * s := by simpa [mul_assoc] using (mul_le_mul_of_nonneg_right hClarge (mul_nonneg (le_trans zero_le_one hL) hs0)) exact (not_lt_of_ge hdS) hrisk · right simpa [badSupport] using hsupp have hRisk : (sampleLaw (n := n) P).real {sample | C0 * L * s < dS (empSummary sample) (obsSummary P)} ≤ eta := by calc _ ≤ (sampleLaw (n := n) P).real (badDev ∪ badSupport) := measureReal_mono hRiskSubset _ ≤ (sampleLaw (n := n) P).real badDev + (sampleLaw (n := n) P).real badSupport := measureReal_union_le _ _ _ ≤ eta := by rw [hbadSupport, add_zero]; exact hbadDev constructor · simpa [s] using hRisk intro t have hempty : (sampleLaw (n := n) P).real {sample | armCount t sample = 0} = (1 - (obsLaw P).real {o | o.T = t}) ^ n := by rw [show {sample : Fin n → Obs dx dz | armCount t sample = 0} = pi univ (fun _ => {o | o.T ≠ t}) by ext sample simp [armCount, Finset.card_eq_zero]] rw [sampleLaw, Measure.real, Measure.pi_pi] simp only [Finset.prod_const] rw [Finset.card_univ, Fintype.card_fin, ENNReal.toReal_pow] congr 1 rw [show {o : Obs dx dz | o.T ≠ t} = {o | o.T = t}ᶜ by ext; simp] change (obsLaw P).real ({o | o.T = t}ᶜ) = _ rw [measureReal_compl] · simp · exact measurable_obs_T (measurableSet_singleton t) refine ⟨hempty, hempty.trans_le ?_⟩ have hqLower : (k : ℝ) * pi0 ≤ (obsLaw P).real {o | o.T = t} := by rw [show {o : Obs dx dz | o.T = t} = obsArm t by rfl, obsLaw_real_obsArm] exact arm_mass_lower_of_latentArmPositivity P hM.latentArmPositivity t have hqUpper : (obsLaw P).real {o | o.T = t} ≤ 1 := measureReal_le_one have hbase0 : 0 ≤ 1 - (obsLaw P).real {o | o.T = t} := by linarith apply pow_le_pow_left₀ hbase0 (by linarith) n
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.uniform_summary_concentration · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Concentration.lean:9
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.ConcentrationCore 19 declarations Scalar concentration, ratio stability, and deterministic summary bounds.

Scalar concentration, ratio stability, and deterministic summary bounds.

For the proxy and outcome dimensions, the finite coordinate type for an observed summary enumerates matrix, mean, and treatment-probability coordinates.

Definition (Lean source)
inductive SummaryCoord (dx dz : ℕ) | matrix (weighted arm : Bool) (i : Fin dz) (j : Fin dx) | mean (j : Fin dx) | arm (t : Bool) deriving Fintype
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.SummaryCoord · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConcentrationCore.lean:15
instance instFintypeSummaryCoord

For the proxy and outcome dimensions, observed-summary coordinates form a finite type.

Definition (Lean source)
deriving Fintype
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.instFintypeSummaryCoord · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConcentrationCore.lean:20
def summaryCoordStat

For the supplied parameters, summary Coord Stat is given by its defining clause.

Definition (Lean source)
dx dz :
summaryCoordStat :
SummaryCoord dx dz → Obs dx dz → ℝ
clause 1
| .matrix weighted t i j
=> fun o => if o.T = t then (if weighted then o.Y else 1) * o.Z i * o.X j else 0
clause 2
| .mean j => fun o => o.X j
clause 3
| .arm t => fun o => if o.T = t then 1 else 0
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summaryCoordStat · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConcentrationCore.lean:27
def summaryCoordScale

For the supplied parameters, summary Coord Scale is given by its defining clause.

Definition (Lean source)
dx dz :
L :
summaryCoordScale L :
SummaryCoord dx dz → ℝ
clause 1
| .matrix .. => L
clause 2
| .mean .. => L
clause 3
| .arm .. => 1
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summaryCoordScale · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConcentrationCore.lean:35

Product hoeffding: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
X :
f :
X → ℝ
hf :
a b :
hab :
a < b
hbound :
∀ᵐ x ∂P, f x ∈ Icc a b
n :
hn :
0 < n
eps :
heps :
0 ≤ eps
(Measure.pi (fun _ : Fin n => P)).real {sample | eps ≤ |(n : ℝ)⁻¹ * ∑ i, f (sample i) - ∫ x, f x ∂P|}
≤ 2 * exp (-2 * n * eps ^ 2 / (b - a) ^ 2)
Proof (Lean source)
lemma product_hoeffding {X : Type*} [MeasurableSpace X] (P : Measure X) [IsProbabilityMeasure P] {f : X → ℝ} (hf : Measurable f) {a b : ℝ} (hab : a < b) (hbound : ∀ᵐ x ∂P, f x ∈ Icc a b) (n : ℕ) (hn : 0 < n) {eps : ℝ} (heps : 0 ≤ eps) : (Measure.pi (fun _ : Fin n => P)).real {sample | eps ≤ |(n : ℝ)⁻¹ * ∑ i, f (sample i) - ∫ x, f x ∂P|} ≤ 2 * exp (-2 * n * eps ^ 2 / (b - a) ^ 2) := by let S := iidSample_infinitePi P let mu := Measure.infinitePi (fun _ : ℕ => P) let psi : (ℕ → X) → (Fin n → X) := fun w i => S.Z i w let E : Set (Fin n → X) := {sample | eps ≤ |(n : ℝ)⁻¹ * ∑ i, f (sample i) - ∫ x, f x ∂P|} have hE : MeasurableSet E := by exact measurableSet_Ici.preimage <| (Measurable.abs <| Measurable.sub (mul measurable_const (measurable_sum univ fun i _ => hf.comp (measurable_pi_apply i))) measurable_const) have hpsi : Measurable psi := Causalean.Stat.iidSample_finN_measurable S n have hpush : Measure.map psi mu = Measure.pi (fun _ : Fin n => P) := Causalean.Stat.iidSample_finN_pushforward S n have hpre : psi ⁻¹' E = {w | eps ≤ |S.sampleMean f n w - ∫ x, f x ∂P|} := by ext w simp only [E, psi, Set.mem_preimage, Set.mem_ofPred_eq] rw [sampleMean, ← Fin.sum_univ_eq_sum_range] rw [← hpush, Measure.real, Measure.map_apply hpsi hE, ← Measure.real] rw [hpre] exact hoeffding_abs_ge S hf hab hbound n hn heps
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.product_hoeffding · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConcentrationCore.lean:42
theorem summaryCoordStat_measurable

Summary coord stat measurable: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx dz :
a :
Proof (Lean source)
lemma summaryCoordStat_measurable {dx dz : ℕ} (a : SummaryCoord dx dz) : Measurable (summaryCoordStat a) := by cases a with | matrix weighted t i j => apply Measurable.ite · exact measurable_obs_T (measurableSet_singleton t) · cases weighted · have hZ : Measurable (fun o : Obs dx dz => o.Z i) := (measurable_pi_apply i).comp measurable_obs_Z have hX : Measurable (fun o : Obs dx dz => o.X j) := (measurable_pi_apply j).comp measurable_obs_X convert hZ.mul hX using 1 <;> ext o <;> simp · have hZ : Measurable (fun o : Obs dx dz => o.Z i) := (measurable_pi_apply i).comp measurable_obs_Z have hX : Measurable (fun o : Obs dx dz => o.X j) := (measurable_pi_apply j).comp measurable_obs_X convert (measurable_obs_Y.mul hZ).mul hX using 1 <;> ext o <;> simp [summaryCoordStat, mul_assoc] · exact measurable_const | mean j => exact (measurable_pi_apply j).comp measurable_obs_X | arm t => exact Measurable.ite (measurable_obs_T (measurableSet_singleton t)) measurable_const measurable_const
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summaryCoordStat_measurable · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConcentrationCore.lean:74
theorem summaryCoordStat_ae_bound

Summary coord stat ae bound: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
hL :
1 ≤ L
a :
∀ᵐ o ∂obsLaw P, |summaryCoordStat a o| ≤ summaryCoordScale L a
Proof (Lean source)
lemma summaryCoordStat_ae_bound {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (hL : 1 ≤ L) (a : SummaryCoord dx dz) : ∀ᵐ o ∂obsLaw P, |summaryCoordStat a o| ≤ summaryCoordScale L a := by change ∀ᵐ o ∂obsLaw P, |summaryCoordStat a o| ∈ Iic (summaryCoordScale L a) rw [obsLaw, ae_map_iff (obsMap_measurable k dx dz).aemeasurable ((summaryCoordStat_measurable a).abs measurableSet_Iic)] cases a with | matrix weighted t i j => cases weighted · filter_upwards [hM.boundedProxyProduct] with w hw by_cases ht : w.T = t · simpa [summaryCoordStat, summaryCoordScale, obsMap, ht, outerProduct] using (abs_matrix_entry_le_matrixCLM_norm (outerProduct w.Z w.X) i j).trans hw · simp [summaryCoordStat, summaryCoordScale, obsMap, ht, le_trans zero_le_one hL] · filter_upwards [hM.boundedOutcomeProxyProduct] with w hw by_cases ht : w.T = t · simpa [summaryCoordStat, summaryCoordScale, obsMap, ht, outerProduct, mul_assoc] using (abs_matrix_entry_le_matrixCLM_norm (w.Y • outerProduct w.Z w.X) i j).trans hw · simp [summaryCoordStat, summaryCoordScale, obsMap, ht, le_trans zero_le_one hL] | mean j => filter_upwards [hM.boundedX] with w hw have hj := PiLp.norm_apply_le (toLp 2 w.X : Euc dx) j have hw' : ‖(toLp 2 w.X : Euc dx)‖ ≤ L := by simpa [EuclideanSpace.norm_eq, Real.norm_eq_abs, sq_abs] using hw simpa [summaryCoordStat, summaryCoordScale, obsMap, Real.norm_eq_abs] using hj.trans hw' | arm t => filter_upwards [] with w by_cases ht : w.T = t <;> simp [summaryCoordStat, summaryCoordScale, obsMap, ht]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summaryCoordStat_ae_bound · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConcentrationCore.lean:100
theorem summaryCoordStat_integral

Summary coord stat integral: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
hpi :
0 < pi0
a :
∫ o, summaryCoordStat a o ∂obsLaw P
= match a with | .matrix false false i j => (obsLaw P).real (obsArm false) * (obsSummary P).M0 i j | .matrix false true i j => (obsLaw P).real (obsArm true) * (obsSummary P).M1 i j | .matrix true false i j => (obsLaw P).real (obsArm false) * (obsSummary P).N0 i j | .matrix true true i j => (obsLaw P).real (obsArm true) * (obsSummary P).N1 i j | .mean j => (obsSummary P).mX j | .arm t => (obsLaw P).real (obsArm t)
Proof (Lean source)
lemma summaryCoordStat_integral {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (hpi : 0 < pi0) : ∀ a : SummaryCoord dx dz, ∫ o, summaryCoordStat a o ∂obsLaw P = match a with | .matrix false false i j => (obsLaw P).real (obsArm false) * (obsSummary P).M0 i j | .matrix false true i j => (obsLaw P).real (obsArm true) * (obsSummary P).M1 i j | .matrix true false i j => (obsLaw P).real (obsArm false) * (obsSummary P).N0 i j | .matrix true true i j => (obsLaw P).real (obsArm true) * (obsSummary P).N1 i j | .mean j => (obsSummary P).mX j | .arm t => (obsLaw P).real (obsArm t) := by intro a cases a with | mean j => rfl | arm t => rw [show summaryCoordStat (.arm t) = (obsArm t).indicator (fun _ => 1) by funext o; by_cases ho : o.T = t <;> simp [summaryCoordStat, obsArm, ho]] rw [integral_indicator (measurableSet_obsArm_generic t)] simp [Measure.restrict_apply_univ] | matrix weighted t i j => let f : Obs dx dz → ℝ := fun o => (if weighted then o.Y else 1) * o.Z i * o.X j have hf : Measurable f := by cases weighted · have hZ : Measurable (fun o : Obs dx dz => o.Z i) := (measurable_pi_apply i).comp measurable_obs_Z have hX : Measurable (fun o : Obs dx dz => o.X j) := (measurable_pi_apply j).comp measurable_obs_X convert hZ.mul hX using 1 <;> ext o <;> simp [f] · have hZ : Measurable (fun o : Obs dx dz => o.Z i) := (measurable_pi_apply i).comp measurable_obs_Z have hX : Measurable (fun o : Obs dx dz => o.X j) := (measurable_pi_apply j).comp measurable_obs_X convert (measurable_obs_Y.mul hZ).mul hX using 1 <;> ext o <;> simp [f, mul_assoc] have hq : 0 < (obsLaw P).real (obsArm t) := by rw [obsLaw_real_obsArm] have hl := arm_mass_lower_of_latentArmPositivity P hM.latentArmPositivity t have hk0 : (0 : ℝ) < k := by exact_mod_cast (by have hk := hM.coreDomain.1 omega : 0 < k) nlinarith rw [show summaryCoordStat (.matrix weighted t i j) = (obsArm t).indicator f by funext o; by_cases ho : o.T = t <;> simp [summaryCoordStat, obsArm, f, ho]] rw [integral_indicator (measurableSet_obsArm_generic t)] have hq0 : (obsLaw P).real (obsArm t) ≠ 0 := ne_of_gt hq cases weighted <;> cases t <;> simp only [obsSummary, f, conditionalMean] <;> field_simp <;> simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summaryCoordStat_integral · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConcentrationCore.lean:134
theorem summaryCoordStat_arm_sampleMean

Summary coord stat arm sample mean: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
n dx dz :
sample :
Fin n → Obs dx dz
t :
(n : ℝ)⁻¹ * ∑ i, summaryCoordStat (.arm t) (sample i) = (armCount t sample : ℝ) / n
Proof (Lean source)
lemma summaryCoordStat_arm_sampleMean {n dx dz : ℕ} (sample : Fin n → Obs dx dz) (t : Bool) : (n : ℝ)⁻¹ * ∑ i, summaryCoordStat (.arm t) (sample i) = (armCount t sample : ℝ) / n := by have hsum : (∑ i, summaryCoordStat (.arm t) (sample i)) = (armCount t sample : ℝ) := by rw [armCount, Finset.card_filter, Nat.cast_sum] apply Finset.sum_congr rfl intro i hi by_cases ht : (sample i).T = t <;> simp [summaryCoordStat, ht] rw [hsum] simp [div_eq_mul_inv, mul_comm]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summaryCoordStat_arm_sampleMean · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConcentrationCore.lean:186
theorem summaryCoordStat_matrix_sampleMean

Summary coord stat matrix sample mean: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
n dx dz :
sample :
Fin n → Obs dx dz
weighted t :
a :
Fin dz
b :
Fin dx
(n : ℝ)⁻¹ * ∑ i, summaryCoordStat (.matrix weighted t a b) (sample i)
= (n : ℝ)⁻¹ * ∑ i, if (sample i).T = t then (if weighted then (sample i).Y else 1) * (sample i).Z a * (sample i).X b else 0
Proof (Lean source)
lemma summaryCoordStat_matrix_sampleMean {n dx dz : ℕ} (sample : Fin n → Obs dx dz) (weighted t : Bool) (a : Fin dz) (b : Fin dx) : (n : ℝ)⁻¹ * ∑ i, summaryCoordStat (.matrix weighted t a b) (sample i) = (n : ℝ)⁻¹ * ∑ i, if (sample i).T = t then (if weighted then (sample i).Y else 1) * (sample i).Z a * (sample i).X b else 0 := by rfl
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summaryCoordStat_matrix_sampleMean · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConcentrationCore.lean:201
def populationArmCoord

For the supplied parameters, population Arm Coord is given by its defining clause.

Definition (Lean source)
k dx dz :
weighted t :
a :
Fin dz
b :
Fin dx
populationArmCoord P weighted t a b :
if weighted then observedOutcomeProxyMoment (obsSummary P) t a b else observedProxyMoment (obsSummary P) t a b
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.populationArmCoord · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConcentrationCore.lean:210
theorem empiricalArmMatrix_entry_error

Empirical arm matrix entry error: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 beta :
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
hL :
1 ≤ L
hpi :
0 < pi0
hn :
0 < n
hbeta0 :
0 ≤ beta
hbeta :
beta < k * pi0 / 2
sample :
Fin n → Obs dx dz
hdev :
∀ c : SummaryCoord dx dz,
|(n : ℝ)⁻¹ * ∑ i, summaryCoordStat c (sample i)
- ∫ o, summaryCoordStat c o ∂obsLaw P| < summaryCoordScale L c * beta
weighted t :
a :
Fin dz
b :
Fin dx
|empiricalArmMatrix weighted t sample a b - populationArmCoord P weighted t a b|
≤ 4 * L * beta / (k * pi0)
Proof (Lean source)
lemma empiricalArmMatrix_entry_error {k dx dz n : ℕ} {L pi0 sigma0 beta : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (hL : 1 ≤ L) (hpi : 0 < pi0) (hn : 0 < n) (hbeta0 : 0 ≤ beta) (hbeta : beta < k * pi0 / 2) (sample : Fin n → Obs dx dz) (hdev : ∀ c : SummaryCoord dx dz, |(n : ℝ)⁻¹ * ∑ i, summaryCoordStat c (sample i) - ∫ o, summaryCoordStat c o ∂obsLaw P| < summaryCoordScale L c * beta) (weighted t : Bool) (a : Fin dz) (b : Fin dx) : |empiricalArmMatrix weighted t sample a b - populationArmCoord P weighted t a b| ≤ 4 * L * beta / (k * pi0) := by let q := (obsLaw P).real (obsArm t) let qhat := (armCount t sample : ℝ) / n let rhat := (n : ℝ)⁻¹ * ∑ i, summaryCoordStat (.matrix weighted t a b) (sample i) let M := populationArmCoord P weighted t a b have hnR : (0 : ℝ) < n := by exact_mod_cast hn have hqLower : k * pi0 ≤ q := by dsimp [q] rw [obsLaw_real_obsArm] exact arm_mass_lower_of_latentArmPositivity P hM.latentArmPositivity t have harm := hdev (.arm t) rw [summaryCoordStat_arm_sampleMean sample t, summaryCoordStat_integral P hM hpi (.arm t)] at harm simp only [summaryCoordScale] at harm have hqhat : k * pi0 / 2 < qhat := by dsimp [qhat, q] at harm ⊢ rw [abs_lt] at harm linarith have hk0Nat : 0 < k := by have hk := hM.coreDomain.1 omega have hk0 : (0 : ℝ) < k := Nat.cast_pos.mpr hk0Nat have hkpi : 0 < k * pi0 := mul_pos hk0 hpi have hqhat0 : 0 < qhat := lt_of_lt_of_le (half_pos hkpi) hqhat.le have hcount : 0 < armCount t sample := by by_contra hc have hc0 : armCount t sample = 0 := Nat.eq_zero_of_not_pos hc simp [qhat, hc0] at hqhat0 have hMbound : |M| ≤ L := by dsimp [M, populationArmCoord] have henv := observedSummary_envelopes_of_model P hM.coreDomain.1 hM.coreDomain.2.1 hL hpi hM cases weighted · exact (abs_matrix_entry_le_matrixCLM_norm _ a b).trans (henv.1 t).1 · exact (abs_matrix_entry_le_matrixCLM_norm _ a b).trans (henv.1 t).2 have hr := hdev (.matrix weighted t a b) rw [summaryCoordStat_integral P hM hpi (.matrix weighted t a b)] at hr have hr' : |rhat - q * M| < L * beta := by dsimp [rhat, q, M, populationArmCoord] cases weighted <;> cases t <;> simpa [summaryCoordScale, observedProxyMoment, observedOutcomeProxyMoment] using hr have hformula : empiricalArmMatrix weighted t sample a b = rhat / qhat := by dsimp [rhat, qhat] unfold empiricalArmMatrix have hmax : max (1 : ℝ) (armCount t sample : ℝ) = armCount t sample := max_eq_right (by exact_mod_cast hcount) rw [hmax] rw [summaryCoordStat_matrix_sampleMean] field_simp rw [hformula] have hden : k * pi0 / 2 ≤ qhat := hqhat.le have hnum : |(rhat - q * M) + (q - qhat) * M| ≤ 2 * L * beta := by calc |_ + _| ≤ |rhat - q * M| + |(q - qhat) * M| := abs_add_le _ _ _ ≤ L * beta + beta * L := by apply add_le_add hr'.le rw [abs_mul] have hqdev : |q - qhat| ≤ beta := by simpa [abs_sub_comm] using harm.le exact mul_le_mul hqdev hMbound (abs_nonneg _) hbeta0 _ = 2 * L * beta := by ring have heq : rhat / qhat - M = ((rhat - q * M) + (q - qhat) * M) / qhat := by field_simp ring rw [heq, abs_div, abs_of_pos hqhat0] apply (div_le_div_of_nonneg_right hnum hqhat0.le).trans have hdenpos : 0 < k * pi0 / 2 := half_pos hkpi have hnum0 : 0 ≤ 2 * L * beta := by positivity calc 2 * L * beta / qhat ≤ 2 * L * beta / (k * pi0 / 2) := div_le_div_of_nonneg_left hnum0 hdenpos hden _ = 4 * L * beta / (k * pi0) := by field_simp; ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.empiricalArmMatrix_entry_error · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConcentrationCore.lean:218
theorem empSummary_error_of_small_deviations

Emp summary error of small deviations: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 beta :
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
hL :
1 ≤ L
hpi :
0 < pi0
hn :
0 < n
hbeta0 :
0 ≤ beta
hbeta :
beta < k * pi0 / 2
sample :
Fin n → Obs dx dz
hdev :
∀ c : SummaryCoord dx dz,
|(n : ℝ)⁻¹ * ∑ i, summaryCoordStat c (sample i)
- ∫ o, summaryCoordStat c o ∂obsLaw P| < summaryCoordScale L c * beta
dS (empSummary sample) (obsSummary P)
≤ (16 * entryNormConstant dz dx / (k * pi0) + dx) * L * beta
Proof (Lean source)
lemma empSummary_error_of_small_deviations {k dx dz n : ℕ} {L pi0 sigma0 beta : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (hL : 1 ≤ L) (hpi : 0 < pi0) (hn : 0 < n) (hbeta0 : 0 ≤ beta) (hbeta : beta < k * pi0 / 2) (sample : Fin n → Obs dx dz) (hdev : ∀ c : SummaryCoord dx dz, |(n : ℝ)⁻¹ * ∑ i, summaryCoordStat c (sample i) - ∫ o, summaryCoordStat c o ∂obsLaw P| < summaryCoordScale L c * beta) : dS (empSummary sample) (obsSummary P) ≤ (16 * entryNormConstant dz dx / (k * pi0) + dx) * L * beta := by have hk0Nat : 0 < k := by have hk := hM.coreDomain.1; omega have hkpi : 0 < (k : ℝ) * pi0 := mul_pos (Nat.cast_pos.mpr hk0Nat) hpi have hentry (weighted t : Bool) (a : Fin dz) (b : Fin dx) := empiricalArmMatrix_entry_error P hM hL hpi hn hbeta0 hbeta sample hdev weighted t a b have hblock (weighted t : Bool) : ‖matrixCLM (empiricalArmMatrix weighted t sample - (if weighted then observedOutcomeProxyMoment (obsSummary P) t else observedProxyMoment (obsSummary P) t))‖ ≤ entryNormConstant dz dx * (4 * L * beta / (k * pi0)) := by cases weighted · have hm := (matrixNorm_le_entryBound (empiricalArmMatrix false t sample - observedProxyMoment (obsSummary P) t) (4 * L * beta / (k * pi0)) (by positivity) (fun a b => by simpa [populationArmCoord] using hentry false t a b)) simp only [Bool.false_eq_true, ↓reduceIte] change ‖(toEuclideanLin ≪≫ₗ toContinuousLinearMap) (empiricalArmMatrix false t sample - observedProxyMoment (obsSummary P) t)‖ ≤ _ simpa only [Matrix.l2_opNorm_def] using hm · have hm := (matrixNorm_le_entryBound (empiricalArmMatrix true t sample - observedOutcomeProxyMoment (obsSummary P) t) (4 * L * beta / (k * pi0)) (by positivity) (fun a b => by simpa [populationArmCoord] using hentry true t a b)) simp only [↓reduceIte] change ‖(toEuclideanLin ≪≫ₗ toContinuousLinearMap) (empiricalArmMatrix true t sample - observedOutcomeProxyMoment (obsSummary P) t)‖ ≤ _ simpa only [Matrix.l2_opNorm_def] using hm have hmean : sqrt (∑ j, ((empSummary sample).mX j - (obsSummary P).mX j) ^ 2) ≤ (dx : ℝ) * (L * beta) := by have hnorm := eucNorm_le_card_mul_bound (toLp 2 ((empSummary sample).mX - (obsSummary P).mX) : Euc dx) (L * beta) (mul_nonneg (by linarith) hbeta0) (by intro j have hj := hdev (.mean j) rw [summaryCoordStat_integral P hM hpi (.mean j)] at hj simpa [empSummary, summaryCoordStat, summaryCoordScale, Real.norm_eq_abs] using hj.le) simpa [EuclideanSpace.norm_eq, Real.norm_eq_abs, sq_abs] using hnorm unfold dS have h0 := hblock false false have h1 := hblock false true have h2 := hblock true false have h3 := hblock true true simp [empSummary, observedProxyMoment, observedOutcomeProxyMoment] at h0 h1 h2 h3 simp only [empSummary] at hmean simp only [empSummary] calc _ ≤ 4 * (entryNormConstant dz dx * (4 * L * beta / (k * pi0))) + (dx : ℝ) * (L * beta) := by linarith _ = (16 * entryNormConstant dz dx / (k * pi0) + dx) * L * beta := by field_simp ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.empSummary_error_of_small_deviations · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConcentrationCore.lean:303

Abs fin average le: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
n :
hn :
0 < n
f :
Fin n → ℝ
B :
hB :
0 ≤ B
hf :
∀ i, |f i| ≤ B
|(n : ℝ)⁻¹ * ∑ i, f i| ≤ B
Proof (Lean source)
lemma abs_fin_average_le {n : ℕ} (hn : 0 < n) {f : Fin n → ℝ} {B : ℝ} (hB : 0 ≤ B) (hf : ∀ i, |f i| ≤ B) : |(n : ℝ)⁻¹ * ∑ i, f i| ≤ B := by have hnR : (0 : ℝ) < n := by exact_mod_cast hn calc |(n : ℝ)⁻¹ * ∑ i, f i| = (n : ℝ)⁻¹ * |∑ i, f i| := by rw [abs_mul, abs_of_pos (inv_pos.mpr hnR)] _ ≤ (n : ℝ)⁻¹ * ∑ i, |f i| := by gcongr exact Finset.abs_sum_le_sum_abs _ _ _ ≤ (n : ℝ)⁻¹ * ∑ _i : Fin n, B := by gcongr with i exact hf i _ = B := by rw [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] field_simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.abs_fin_average_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConcentrationCore.lean:370
theorem empiricalArmMatrix_entry_bound

Empirical arm matrix entry bound: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
n dx dz :
L :
hL :
0 ≤ L
sample :
Fin n → Obs dx dz
hsupport :
∀ i c, |summaryCoordStat c (sample i)| ≤ summaryCoordScale L c
weighted t :
a :
Fin dz
b :
Fin dx
|empiricalArmMatrix weighted t sample a b| ≤ L
Proof (Lean source)
lemma empiricalArmMatrix_entry_bound {n dx dz : ℕ} {L : ℝ} (hL : 0 ≤ L) (sample : Fin n → Obs dx dz) (hsupport : ∀ i c, |summaryCoordStat c (sample i)| ≤ summaryCoordScale L c) (weighted t : Bool) (a : Fin dz) (b : Fin dx) : |empiricalArmMatrix weighted t sample a b| ≤ L := by by_cases hc : armCount t sample = 0 · have hall : ∀ i : Fin n, (sample i).T ≠ t := by intro i hi have hmem : i ∈ Finset.univ.filter (fun j => (sample j).T = t) := by simp [hi] have hc' : Finset.univ.filter (fun j => (sample j).T = t) = ∅ := Finset.card_eq_zero.mp (by simpa [armCount] using hc) rw [hc'] at hmem simpa using hmem simp [empiricalArmMatrix, hc, hall, hL] · have hcpos : 0 < armCount t sample := Nat.pos_of_ne_zero hc have hcR : (0 : ℝ) < armCount t sample := by exact_mod_cast hcpos unfold empiricalArmMatrix rw [max_eq_right (by exact_mod_cast hcpos), ← div_eq_inv_mul, abs_div, abs_of_pos hcR] have hsum : |∑ i, if (sample i).T = t then (if weighted then (sample i).Y else 1) * (sample i).Z a * (sample i).X b else 0| ≤ (armCount t sample : ℝ) * L := by calc |∑ i, if (sample i).T = t then (if weighted then (sample i).Y else 1) * (sample i).Z a * (sample i).X b else 0| ≤ ∑ i, |if (sample i).T = t then (if weighted then (sample i).Y else 1) * (sample i).Z a * (sample i).X b else 0| := Finset.abs_sum_le_sum_abs _ _ _ ≤ (∑ i ∈ Finset.univ.filter (fun i => (sample i).T = t), L) := by rw [Finset.sum_filter] apply Finset.sum_le_sum intro i hi by_cases hit : (sample i).T = t · simpa [hit, summaryCoordStat, summaryCoordScale] using hsupport i (.matrix weighted t a b) · simp [hit, hL] _ = (armCount t sample : ℝ) * L := by simp [armCount] rw [div_le_iff₀ hcR] simpa [mul_comm] using hsum
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.empiricalArmMatrix_entry_bound · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConcentrationCore.lean:389
theorem empSummary_error_on_support

Emp summary error on support: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 :
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
hL :
1 ≤ L
hpi :
0 < pi0
hn :
0 < n
sample :
Fin n → Obs dx dz
hsupport :
∀ i c, |summaryCoordStat c (sample i)| ≤ summaryCoordScale L c
dS (empSummary sample) (obsSummary P) ≤ (4 * (entryNormConstant dz dx + 1) + dx + 1) * L
Proof (Lean source)
lemma empSummary_error_on_support {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (hL : 1 ≤ L) (hpi : 0 < pi0) (hn : 0 < n) (sample : Fin n → Obs dx dz) (hsupport : ∀ i c, |summaryCoordStat c (sample i)| ≤ summaryCoordScale L c) : dS (empSummary sample) (obsSummary P) ≤ (4 * (entryNormConstant dz dx + 1) + dx + 1) * L := by have henv := observedSummary_envelopes_of_model P hM.coreDomain.1 hM.coreDomain.2.1 hL hpi hM have hempBlock (weighted t : Bool) : ‖matrixCLM (empiricalArmMatrix weighted t sample)‖ ≤ entryNormConstant dz dx * L := by have hm := matrixNorm_le_entryBound (empiricalArmMatrix weighted t sample) L (by linarith) (fun a b => empiricalArmMatrix_entry_bound (by linarith) sample hsupport weighted t a b) change ‖(toEuclideanLin ≪≫ₗ toContinuousLinearMap) (empiricalArmMatrix weighted t sample)‖ ≤ _ simpa only [Matrix.l2_opNorm_def] using hm have hdiff (weighted t : Bool) : ‖matrixCLM (empiricalArmMatrix weighted t sample - (if weighted then observedOutcomeProxyMoment (obsSummary P) t else observedProxyMoment (obsSummary P) t))‖ ≤ (entryNormConstant dz dx + 1) * L := by have heq : matrixCLM (empiricalArmMatrix weighted t sample - (if weighted then observedOutcomeProxyMoment (obsSummary P) t else observedProxyMoment (obsSummary P) t)) = matrixCLM (empiricalArmMatrix weighted t sample) - matrixCLM (if weighted then observedOutcomeProxyMoment (obsSummary P) t else observedProxyMoment (obsSummary P) t) := by ext x i simp [matrixCLM, Matrix.toEuclideanLin_apply] rw [heq] apply (norm_sub_le _ _).trans calc ‖matrixCLM (empiricalArmMatrix weighted t sample)‖ + ‖matrixCLM (if weighted then observedOutcomeProxyMoment (obsSummary P) t else observedProxyMoment (obsSummary P) t)‖ ≤ entryNormConstant dz dx * L + L := by gcongr · exact hempBlock weighted t · cases weighted · exact (henv.1 t).1 · exact (henv.1 t).2 _ = _ := by ring have hempMeanCoord (j : Fin dx) : |(empSummary sample).mX j| ≤ L := by simpa [empSummary, summaryCoordStat, summaryCoordScale] using abs_fin_average_le hn (le_trans zero_le_one hL) (fun i => hsupport i (.mean j)) have hempMean : ‖(toLp 2 (empSummary sample).mX : Euc dx)‖ ≤ (dx : ℝ) * L := eucNorm_le_card_mul_bound _ L (by linarith) (by intro j simpa [Real.norm_eq_abs] using hempMeanCoord j) have hmeanDiff : ‖(toLp 2 ((empSummary sample).mX - (obsSummary P).mX) : Euc dx)‖ ≤ ((dx : ℝ) + 1) * L := by calc _ ≤ ‖(toLp 2 (empSummary sample).mX : Euc dx)‖ + ‖(toLp 2 (obsSummary P).mX : Euc dx)‖ := norm_sub_le _ _ _ ≤ (dx : ℝ) * L + L := add_le_add hempMean henv.2 _ = _ := by ring have hmeanDiff' : sqrt (∑ i, ((empSummary sample).mX i - (obsSummary P).mX i) ^ 2) ≤ ((dx : ℝ) + 1) * L := by simpa [EuclideanSpace.norm_eq, Real.norm_eq_abs, sq_abs] using hmeanDiff unfold dS have h0 := hdiff false false have h1 := hdiff false true have h2 := hdiff true false have h3 := hdiff true true simp only [Bool.false_eq_true, ↓reduceIte, ge_iff_le] at h0 h1 h2 h3 have h0' : ‖matrixCLM (empiricalArmMatrix false false sample - (obsSummary P).M0)‖ ≤ (entryNormConstant dz dx + 1) * L := by simpa [observedProxyMoment] using h0 have h1' : ‖matrixCLM (empiricalArmMatrix false true sample - (obsSummary P).M1)‖ ≤ (entryNormConstant dz dx + 1) * L := by simpa [observedProxyMoment] using h1 have h2' : ‖matrixCLM (empiricalArmMatrix true false sample - (obsSummary P).N0)‖ ≤ (entryNormConstant dz dx + 1) * L := by simpa [observedOutcomeProxyMoment] using h2 have h3' : ‖matrixCLM (empiricalArmMatrix true true sample - (obsSummary P).N1)‖ ≤ (entryNormConstant dz dx + 1) * L := by simpa [observedOutcomeProxyMoment] using h3 simp only [empSummary] at hmeanDiff' simp only [empSummary] calc _ ≤ 4 * ((entryNormConstant dz dx + 1) * L) + ((dx : ℝ) + 1) * L := by linarith [hmeanDiff', h0', h1', h2', h3'] _ = (4 * (entryNormConstant dz dx + 1) + dx + 1) * L := by ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.empSummary_error_on_support · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConcentrationCore.lean:432
theorem measurableSet_summaryCoordSupport

Measurable set summary coord support: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx dz :
L :
MeasurableSet {o : Obs dx dz | ∀ c : SummaryCoord dx dz, |summaryCoordStat c o| ≤ summaryCoordScale L c}
Proof (Lean source)
lemma measurableSet_summaryCoordSupport {dx dz : ℕ} (L : ℝ) : MeasurableSet {o : Obs dx dz | ∀ c : SummaryCoord dx dz, |summaryCoordStat c o| ≤ summaryCoordScale L c} := by simp only [Set.setOf_forall] exact MeasurableSet.iInter fun c => measurableSet_Iic.preimage (summaryCoordStat_measurable c).abs
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.measurableSet_summaryCoordSupport · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConcentrationCore.lean:518
theorem sample_summaryCoordSupport_ae

Sample summary coord support ae: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 :
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
hL :
1 ≤ L
∀ᵐ sample ∂sampleLaw (n := n) P, ∀ i c, |summaryCoordStat c (sample i)|
Proof (Lean source)
lemma sample_summaryCoordSupport_ae {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (hL : 1 ≤ L) : ∀ᵐ sample ∂sampleLaw (n := n) P, ∀ i c, |summaryCoordStat c (sample i)| ≤ summaryCoordScale L c := by let G : Set (Obs dx dz) := {o | ∀ c : SummaryCoord dx dz, |summaryCoordStat c o| ≤ summaryCoordScale L c} have hGmeas : MeasurableSet G := measurableSet_summaryCoordSupport L have hGae : ∀ᵐ o ∂obsLaw P, o ∈ G := by change ∀ᵐ o ∂obsLaw P, ∀ c : SummaryCoord dx dz, |summaryCoordStat c o| ≤ summaryCoordScale L c rw [ae_all_iff] exact fun c => summaryCoordStat_ae_bound P hM hL c have hGone : obsLaw P G = 1 := (mem_ae_iff_prob_eq_one hGmeas).mp hGae have hset : {sample : Fin n → Obs dx dz | ∀ i c, |summaryCoordStat c (sample i)| ≤ summaryCoordScale L c} = pi Set.univ (fun _ => G) := by ext sample simp [G] rw [show (∀ᵐ sample ∂sampleLaw (n := n) P, ∀ i c, |summaryCoordStat c (sample i)| ≤ summaryCoordScale L c) ↔ {sample : Fin n → Obs dx dz | ∀ i c, |summaryCoordStat c (sample i)| ≤ summaryCoordScale L c} ∈ ae (sampleLaw (n := n) P) by rfl] have hPiMeas : MeasurableSet (pi (Set.univ : Set (Fin n)) (fun _ => G)) := (measurableSet_pi Set.countable_univ).2 (inl fun _ _ => hGmeas) rw [hset, mem_ae_iff_prob_eq_one hPiMeas] rw [sampleLaw, Measure.pi_pi] simp [hGone]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.sample_summaryCoordSupport_ae · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConcentrationCore.lean:527
theorem summaryCoord_deviation_probability

Summary coord deviation probability: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 C eta :
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
hL :
1 ≤ L
hn :
0 < n
heta :
0 < eta
hetaUpper :
eta < 1
hC :
1 ≤ C
c :
(sampleLaw (n := n) P).real {sample | summaryCoordScale L c * (2 * sqrt (log (C / eta) / n)) ≤ |(n : ℝ)⁻¹ * ∑ i, summaryCoordStat c (sample i) - ∫ o, summaryCoordStat c o ∂obsLaw P|}
≤ 2 * (eta / C) ^ 2
Proof (Lean source)
lemma summaryCoord_deviation_probability {k dx dz n : ℕ} {L pi0 sigma0 C eta : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (hL : 1 ≤ L) (hn : 0 < n) (heta : 0 < eta) (hetaUpper : eta < 1) (hC : 1 ≤ C) (c : SummaryCoord dx dz) : (sampleLaw (n := n) P).real {sample | summaryCoordScale L c * (2 * sqrt (log (C / eta) / n)) ≤ |(n : ℝ)⁻¹ * ∑ i, summaryCoordStat c (sample i) - ∫ o, summaryCoordStat c o ∂obsLaw P|} ≤ 2 * (eta / C) ^ 2 := by have hscale : 0 < summaryCoordScale L c := by cases c <;> simp [summaryCoordScale] <;> linarith have hratio : 1 < C / eta := by apply (lt_div_iff₀ heta).2 nlinarith [hetaUpper] have hlog : 0 < log (C / eta) := Real.log_pos hratio have hnR : (0 : ℝ) < n := by exact_mod_cast hn have hsqrt : 0 ≤ sqrt (log (C / eta) / n) := Real.sqrt_nonneg _ have hbound : ∀ᵐ o ∂obsLaw P, summaryCoordStat c o ∈ Icc (-summaryCoordScale L c) (summaryCoordScale L c) := by filter_upwards [summaryCoordStat_ae_bound P hM hL c] with o ho rw [Set.mem_Icc] exact (abs_le.mp ho) have hH := product_hoeffding (obsLaw P) (summaryCoordStat_measurable c) (neg_lt_self hscale) hbound n hn (eps := summaryCoordScale L c * (2 * sqrt (log (C / eta) / n))) (mul_nonneg hscale.le (mul_nonneg (by norm_num) hsqrt)) rw [sampleLaw] apply hH.trans_eq have hsqrtSq : (sqrt (log (C / eta) / n)) ^ 2 = log (C / eta) / n := Real.sq_sqrt (div_nonneg hlog.le hnR.le) rw [show -2 * (n : ℝ) * (summaryCoordScale L c * (2 * sqrt (log (C / eta) / n))) ^ 2 / (summaryCoordScale L c - -summaryCoordScale L c) ^ 2 = -2 * log (C / eta) by rw [mul_pow] rw [show (2 * sqrt (log (C / eta) / (n : ℝ))) ^ 2 = 4 * (sqrt (log (C / eta) / (n : ℝ))) ^ 2 by ring, hsqrtSq] field_simp ring] rw [show -2 * log (C / eta) = -log (C / eta) + -log (C / eta) by ring, Real.exp_add, Real.exp_neg, Real.exp_log (lt_trans zero_lt_one hratio)] field_simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summaryCoord_deviation_probability · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConcentrationCore.lean:560
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.ConditionalMomentAdapters 14 declarations Paper-local adapters from the model's conditional-mean assumptions and almost-sure coordinate bounds to normalized restricted moments.

Paper-local adapters from the model's conditional-mean assumptions and almost-sure coordinate bounds to normalized restricted moments.

theorem abs_matrix_entry_le_matrixCLM_norm

Every entry of a rectangular matrix is bounded by its Euclidean operator norm. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols :
A :
RectMatrix rows cols
i :
Fin rows
j :
Fin cols
|A i j| ≤ ‖matrixCLM A‖
Proof (Lean source)
-- @node: abs_matrix_entry_le_matrixCLM_norm lemma abs_matrix_entry_le_matrixCLM_norm {rows cols : ℕ} (A : RectMatrix rows cols) (i : Fin rows) (j : Fin cols) : |A i j| ≤ ‖matrixCLM A‖ := by let e : Euc cols := toLp 2 (single j 1) have he : ‖e‖ = 1 := by simp [e] have hcoord : |(matrixCLM A e) i| ≤ ‖matrixCLM A e‖ := by simpa only [Real.norm_eq_abs] using PiLp.norm_apply_le (matrixCLM A e) i calc |A i j| = |(matrixCLM A e) i| := by simp [e, matrixCLM, Matrix.toEuclideanLin_apply] _ ≤ ‖matrixCLM A e‖ := hcoord _ ≤ ‖matrixCLM A‖ * ‖e‖ := ContinuousLinearMap.le_opNorm _ _ _ = ‖matrixCLM A‖ := by rw [he, mul_one]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.abs_matrix_entry_le_matrixCLM_norm · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConditionalMomentAdapters.lean:14
theorem proxy_coordinate_bounds_of_model Lemma 5 in the paper ↗

Anchor normalization converts the observable outer-product envelopes into coordinatewise bounds for both proxies and the observed outcome--reference-proxy product. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
conclusion 1
∀ᵐ w ∂P, ∀ i : Fin dx, |w.X i| ≤ L
conclusion 2
∀ᵐ w ∂P, ∀ j : Fin dz, |w.Z j| ≤ L
conclusion 3
∀ᵐ w ∂P, ∀ j : Fin dz, |w.Y * w.Z j| ≤ L
Proof (Lean source)
-- @node: proxy_coordinate_bounds_of_model lemma proxy_coordinate_bounds_of_model {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hk : 2 ≤ k) (hkx : k ≤ dx) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) : (∀ᵐ w ∂P, ∀ i : Fin dx, |w.X i| ≤ L) ∧ (∀ᵐ w ∂P, ∀ j : Fin dz, |w.Z j| ≤ L) ∧ (∀ᵐ w ∂P, ∀ j : Fin dz, |w.Y * w.Z j| ≤ L) := by let i0 : Fin dx := ⟨0, by omega⟩ have hX : ∀ᵐ w ∂P, ∀ i : Fin dx, |w.X i| ≤ L := by filter_upwards [hM.boundedX] with w hw i have hi : |w.X i| ≤ ‖(toLp 2 w.X : Euc dx)‖ := by simpa only [Real.norm_eq_abs] using PiLp.norm_apply_le (toLp 2 w.X : Euc dx) i have hnorm : ‖(toLp 2 w.X : Euc dx)‖ ≤ L := by simpa only [EuclideanSpace.norm_eq, Real.norm_eq_abs, sq_abs] using hw exact hi.trans hnorm have hZ : ∀ᵐ w ∂P, ∀ j : Fin dz, |w.Z j| ≤ L := by filter_upwards [hM.anchor, hM.boundedProxyProduct] with w hanchor hprod j have hi0 : w.X i0 = 1 := hanchor i0 rfl have hentry := abs_matrix_entry_le_matrixCLM_norm (outerProduct w.Z w.X) j i0 simpa [outerProduct, hi0] using hentry.trans hprod have hYZ : ∀ᵐ w ∂P, ∀ j : Fin dz, |w.Y * w.Z j| ≤ L := by filter_upwards [hM.anchor, hM.boundedOutcomeProxyProduct] with w hanchor hprod j have hi0 : w.X i0 = 1 := hanchor i0 rfl have hentry := abs_matrix_entry_le_matrixCLM_norm (w.Y • outerProduct w.Z w.X) j i0 simpa [outerProduct, hi0, mul_assoc] using hentry.trans hprod exact ⟨hX, hZ, hYZ⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.proxy_coordinate_bounds_of_model · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConditionalMomentAdapters.lean:29
def clampReal

Clamp a real value to the interval [-R, R]. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
R x :
clampReal R x :
max (-R) (min R x)
theorem measurable_clampReal

Measurable clamp real: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
Omega :
Type*
Omega → ℝ
hf :
R :
Measurable (fun omega => clampReal R (f omega))
Proof (Lean source)
lemma measurable_clampReal {Omega : Type*} [MeasurableSpace Omega] {f : Omega → ℝ} (hf : Measurable f) (R : ℝ) : Measurable (fun omega => clampReal R (f omega)) := by exact measurable_const.max (measurable_const.min hf)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.measurable_clampReal · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConditionalMomentAdapters.lean:64
theorem abs_clampReal_le

Abs clamp real le: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
R x :
hR :
0 ≤ R
|clampReal R x| ≤ R
Proof (Lean source)
lemma abs_clampReal_le (R x : ℝ) (hR : 0 ≤ R) : |clampReal R x| ≤ R := by rw [abs_le] constructor <;> simp [clampReal] <;> linarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.abs_clampReal_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConditionalMomentAdapters.lean:70
theorem clampReal_eq_self

Clamp real eq self: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
R x :
hx :
|x| ≤ R
clampReal R x = x
Proof (Lean source)
lemma clampReal_eq_self {R x : ℝ} (hx : |x| ≤ R) : clampReal R x = x := by rw [abs_le] at hx simp [clampReal, hx.1, hx.2]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.clampReal_eq_self · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConditionalMomentAdapters.lean:75
theorem integral_clampReal_eq_of_ae_abs_le

An a.e.-bounded measurable scalar has a globally bounded measurable clamped representative, and the two representatives have the same integral. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
Omega :
Type*
Measure Omega
Omega → ℝ
hf :
R :
hR :
0 ≤ R
hbound :
∀ᵐ omega ∂mu, |f omega| ≤ R
conclusion 1
Measurable (fun omega => clampReal R (f omega))
conclusion 2
UniformlyBounded (fun omega => clampReal R (f omega))
conclusion 3
f =ᵐ[mu] (fun omega => clampReal R (f omega))
conclusion 4
(∫ omega, f omega ∂mu) = ∫ omega, clampReal R (f omega) ∂mu
Proof (Lean source)
theorem integral_clampReal_eq_of_ae_abs_le {Omega : Type*} [MeasurableSpace Omega] {mu : Measure Omega} {f : Omega → ℝ} (hf : Measurable f) {R : ℝ} (hR : 0 ≤ R) (hbound : ∀ᵐ omega ∂mu, |f omega| ≤ R) : Measurable (fun omega => clampReal R (f omega)) ∧ UniformlyBounded (fun omega => clampReal R (f omega)) ∧ f =ᵐ[mu] (fun omega => clampReal R (f omega)) ∧ (∫ omega, f omega ∂mu) = ∫ omega, clampReal R (f omega) ∂mu := by have hae : f =ᵐ[mu] (fun omega => clampReal R (f omega)) := hbound.mono fun omega homega => (clampReal_eq_self homega).symm exact ⟨measurable_clampReal hf R, ⟨R, fun omega => abs_clampReal_le R (f omega) hR⟩, hae, integral_congr_ae hae⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.integral_clampReal_eq_of_ae_abs_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConditionalMomentAdapters.lean:80
theorem setIntegral_clampReal_eq_of_ae_abs_le

Clamping an a.e.-bounded coordinate on a cell does not change its restricted integral. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
Omega :
Type*
Measure Omega
Set Omega
Omega → ℝ
hf :
R :
hR :
0 ≤ R
hbound :
∀ᵐ omega ∂P.restrict C, |f omega| ≤ R
(∫ omega in C, f omega ∂P) = ∫ omega in C, clampReal R (f omega) ∂P
Proof (Lean source)
theorem setIntegral_clampReal_eq_of_ae_abs_le {Omega : Type*} [MeasurableSpace Omega] {P : Measure Omega} {C : Set Omega} {f : Omega → ℝ} (hf : Measurable f) {R : ℝ} (hR : 0 ≤ R) (hbound : ∀ᵐ omega ∂P.restrict C, |f omega| ≤ R) : (∫ omega in C, f omega ∂P) = ∫ omega in C, clampReal R (f omega) ∂P := (integral_clampReal_eq_of_ae_abs_le hf hR hbound).2.2.2
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.setIntegral_clampReal_eq_of_ae_abs_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConditionalMomentAdapters.lean:96
theorem normalizedRestrictedIntegral_clampReal_eq_of_ae_abs_le

Clamping an a.e.-bounded coordinate on a positive cell does not change its normalized restricted integral. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
Omega :
Type*
Measure Omega
C :
Set Omega
hCpos :
0 < P C
f :
Omega → ℝ
hf :
R :
hR :
0 ≤ R
hbound :
∀ᵐ omega ∂P.restrict C, |f omega| ≤ R
Proof (Lean source)
theorem normalizedRestrictedIntegral_clampReal_eq_of_ae_abs_le {Omega : Type*} [MeasurableSpace Omega] {P : Measure Omega} [IsFiniteMeasure P] {C : Set Omega} (hCpos : 0 < P C) {f : Omega → ℝ} (hf : Measurable f) {R : ℝ} (hR : 0 ≤ R) (hbound : ∀ᵐ omega ∂P.restrict C, |f omega| ≤ R) : normalizedRestrictedIntegral P C f = normalizedRestrictedIntegral P C (fun omega => clampReal R (f omega)) := by unfold normalizedRestrictedIntegral apply integral_congr_ae exact (ae_normalizedRestrict_iff hCpos).mpr (hbound.mono fun omega homega => (clampReal_eq_self homega).symm)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.normalizedRestrictedIntegral_clampReal_eq_of_ae_abs_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConditionalMomentAdapters.lean:105
theorem measurable_clampedVector_and_aeEq

Coordinatewise clamping gives a measurable, globally coordinate-bounded vector representative which agrees almost surely with the original vector when all coordinates obey the a.e. bound. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
Omega :
Type*
Measure Omega
n :
Omega → Fin n → ℝ
hX :
R :
hR :
0 ≤ R
hbound :
∀ᵐ omega ∂mu, ∀ i, |X omega i| ≤ R
conclusion 1
Measurable (fun omega i => clampReal R (X omega i))
conclusion 2
i :
UniformlyBounded (fun omega => clampReal R (X omega i))
conclusion 3
X =ᵐ[mu] (fun omega i => clampReal R (X omega i))
Proof (Lean source)
theorem measurable_clampedVector_and_aeEq {Omega : Type*} [MeasurableSpace Omega] {mu : Measure Omega} {n : ℕ} {X : Omega → Fin n → ℝ} (hX : Measurable X) {R : ℝ} (hR : 0 ≤ R) (hbound : ∀ᵐ omega ∂mu, ∀ i, |X omega i| ≤ R) : Measurable (fun omega i => clampReal R (X omega i)) ∧ (∀ i, UniformlyBounded (fun omega => clampReal R (X omega i))) ∧ X =ᵐ[mu] (fun omega i => clampReal R (X omega i)) := by have hmeas : Measurable (fun omega i => clampReal R (X omega i)) := by apply measurable_pi_lambda intro i exact measurable_clampReal ((measurable_pi_apply i).comp hX) R refine ⟨hmeas, fun i => ⟨R, fun omega => abs_clampReal_le R (X omega i) hR⟩, ?_⟩ filter_upwards [hbound] with omega homega funext i exact (clampReal_eq_self (homega i)).symm
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.measurable_clampedVector_and_aeEq · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConditionalMomentAdapters.lean:120
theorem conditionalMean_eq_normalizedRestrictedIntegral

The paper's conditional mean is exactly integration under the promoted normalized restriction on a positive-mass cell. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
Omega :
Type*
Measure Omega
C :
Set Omega
hCpos :
0 < P C
f :
Omega → ℝ
conditionalMean P C f = normalizedRestrictedIntegral P C f
Proof (Lean source)
theorem conditionalMean_eq_normalizedRestrictedIntegral {Omega : Type*} [MeasurableSpace Omega] {P : Measure Omega} [IsFiniteMeasure P] {C : Set Omega} (hCpos : 0 < P C) (f : Omega → ℝ) : conditionalMean P C f = normalizedRestrictedIntegral P C f := by rw [normalizedRestrictedIntegral_eq hCpos] rfl
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.conditionalMean_eq_normalizedRestrictedIntegral · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConditionalMomentAdapters.lean:138
theorem referenceProxySeparation_to_normalizedFactorization

Reference-proxy separation supplies the promoted bounded-test factorization on each positive latent cell. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
Measure (FullData k dx dz)
u :
Fin k
t :
hpos :
0 < P (latentCell u t)
NormalizedRestrictedBoundedTestFactorization P (latentCell u t) (fun w => w.Z) (fun w => (w.X, w.Y))
Proof (Lean source)
theorem referenceProxySeparation_to_normalizedFactorization {k dx dz : ℕ} {P : Measure (FullData k dx dz)} [IsProbabilityMeasure P] (hsep : ReferenceProxySeparation P) (u : Fin k) (t : Bool) (hpos : 0 < P (latentCell u t)) : NormalizedRestrictedBoundedTestFactorization P (latentCell u t) (fun w => w.Z) (fun w => (w.X, w.Y)) := by intro phi psi hphi hpsi hphiBound hpsiBound have hs := hsep u t phi psi hphi hpsi hphiBound hpsiBound rw [conditionalMean_eq_normalizedRestrictedIntegral hpos, conditionalMean_eq_normalizedRestrictedIntegral hpos, conditionalMean_eq_normalizedRestrictedIntegral hpos] at hs simpa only [normalizedRestrictedIntegral] using hs
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.referenceProxySeparation_to_normalizedFactorization · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConditionalMomentAdapters.lean:147
theorem targetProxySeparation_to_normalizedFactorization

Target-proxy separation supplies the promoted bounded-test factorization on each positive latent class. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
Measure (FullData k dx dz)
u :
Fin k
hpos :
0 < P (latentClass u)
NormalizedRestrictedBoundedTestFactorization P (latentClass u) (fun w => w.X) (fun w => (w.Y, w.T))
Proof (Lean source)
theorem targetProxySeparation_to_normalizedFactorization {k dx dz : ℕ} {P : Measure (FullData k dx dz)} [IsProbabilityMeasure P] (hsep : TargetProxySeparation P) (u : Fin k) (hpos : 0 < P (latentClass u)) : NormalizedRestrictedBoundedTestFactorization P (latentClass u) (fun w => w.X) (fun w => (w.Y, w.T)) := by intro phi psi hphi hpsi hphiBound hpsiBound have hs := hsep u phi psi hphi hpsi hphiBound hpsiBound rw [conditionalMean_eq_normalizedRestrictedIntegral hpos, conditionalMean_eq_normalizedRestrictedIntegral hpos, conditionalMean_eq_normalizedRestrictedIntegral hpos] at hs simpa only [normalizedRestrictedIntegral] using hs
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.targetProxySeparation_to_normalizedFactorization · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConditionalMomentAdapters.lean:162
theorem latentIgnorability_to_normalizedFactorization

Armwise latent ignorability supplies bounded-test factorization of a potential outcome and the treatment indicator under each positive latent-class law. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
Measure (FullData k dx dz)
u :
Fin k
t :
hpos :
0 < P (latentClass u)
Proof (Lean source)
-- @node: latentIgnorability_to_normalizedFactorization theorem latentIgnorability_to_normalizedFactorization {k dx dz : ℕ} {P : Measure (FullData k dx dz)} [IsProbabilityMeasure P] (hign : ArmwiseLatentIgnorability P) (u : Fin k) (t : Bool) (hpos : 0 < P (latentClass u)) : NormalizedRestrictedBoundedTestFactorization P (latentClass u) (potential t) (fun w => w.T) := by intro phi psi hphi hpsi hphiBound hpsiBound have hs := hign u t phi psi hphi hpsi hphiBound hpsiBound rw [conditionalMean_eq_normalizedRestrictedIntegral hpos, conditionalMean_eq_normalizedRestrictedIntegral hpos, conditionalMean_eq_normalizedRestrictedIntegral hpos] at hs simpa only [normalizedRestrictedIntegral] using hs
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.latentIgnorability_to_normalizedFactorization · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ConditionalMomentAdapters.lean:177
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.GapFreeClosureAssembly 6 declarations Dense extension while preserving the paper's explicit dS control function.

Dense extension while preserving the paper's explicit dS control function.

instance atomicLawBorelSpace

For the supplied parameters, atomic Law Borel Space is given by its defining clause.

Definition (Lean source)
noncomputable instance atomicLawBorelSpace (k : ℕ) (radius : ℝ) : BorelSpace (AtomicLaw k radius) := by constructor rw [borel_comap, ← BorelSpace.measurable_eq] rfl
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.GapFreeClosureAssembly.atomicLawBorelSpace · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/GapFreeClosureAssembly.lean:12
instance atomicLawPolishSpace

For the supplied parameters, atomic Law Polish Space is given by its defining clause.

Definition (Lean source)
noncomputable instance atomicLawPolishSpace (k : ℕ) (radius : ℝ) : PolishSpace (AtomicLaw k radius) := (AtomicLaw.coordinateHomeomorph k radius).toEquiv.polishSpace_induced
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.GapFreeClosureAssembly.atomicLawPolishSpace · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/GapFreeClosureAssembly.lean:20

For the supplied parameters, probability Law Polish Space is given by its defining clause.

Definition (Lean source)
noncomputable instance probabilityLawPolishSpace (k : ℕ) (radius : ℝ) : PolishSpace (AtomicLaw.ProbabilityLaw k radius) := (AtomicLaw.valid_isCompact k radius).isClosed.polishSpace
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.GapFreeClosureAssembly.probabilityLawPolishSpace · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/GapFreeClosureAssembly.lean:26

For the supplied parameters, law Modulo Opens Measurable Space is given by its defining clause.

Definition (Lean source)
noncomputable instance lawModuloOpensMeasurableSpace (k : ℕ) (radius : ℝ) : OpensMeasurableSpace (AtomicLaw.LawModulo k radius) := by constructor intro U hU change MeasurableSet (AtomicLaw.LawModulo.ofProbabilityLaw ⁻¹' U) have hpre : @MeasurableSet (AtomicLaw.ProbabilityLaw k radius) (borel (AtomicLaw.ProbabilityLaw k radius)) (AtomicLaw.LawModulo.ofProbabilityLaw ⁻¹' U) := hU.preimage continuous_coinduced_rng.borel_measurable change @MeasurableSet (AtomicLaw.ProbabilityLaw k radius) inferInstance (AtomicLaw.LawModulo.ofProbabilityLaw ⁻¹' U) rw [show (inferInstance : MeasurableSpace (AtomicLaw.ProbabilityLaw k radius)) = borel (AtomicLaw.ProbabilityLaw k radius) from BorelSpace.measurable_eq] exact hpre
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.GapFreeClosureAssembly.lawModuloOpensMeasurableSpace · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/GapFreeClosureAssembly.lean:32

For the supplied parameters, law Modulo Borel Space is given by its defining clause.

Definition (Lean source)
noncomputable instance lawModuloBorelSpace (k : ℕ) (radius : ℝ) : BorelSpace (AtomicLaw.LawModulo k radius) := by apply Measurable.borelSpace_codomain (f := @AtomicLaw.LawModulo.ofProbabilityLaw k radius) · exact Measurable.of_comap_le MeasurableSpace.comap_map_le · intro q exact ⟨q.out, Quotient.out_eq q⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.GapFreeClosureAssembly.lawModuloBorelSpace · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/GapFreeClosureAssembly.lean:49

Exists unique extension with control: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
α :
k :
radius :
s :
Set α
f :
s → AtomicLaw.LawModulo k radius
control :
α → α → ℝ
Kmetric :
C :
hfmetric :
LipschitzWith Kmetric f
hcontrol :
hfcontrol :
∀ x y : s, dist (f x) (f y) ≤ C * control x.1 y.1
∃ F : closure s → AtomicLaw.LawModulo k radius,
conclusion 1
q q' :
dist (F q) (F q') ≤ C * control q.1 q'.1
conclusion 2
x :
s
F ⟨x, subset_closure x.property⟩ = f x
conclusion 3
G :
closure s → AtomicLaw.LawModulo k radius
(∀ x : s, G ⟨x, subset_closure x.property⟩ = f x)
q :
G q = F q
Proof (Lean source)
theorem exists_unique_extension_with_control {α : Type*} [PseudoMetricSpace α] {k : ℕ} {radius : ℝ} (s : Set α) (f : s → AtomicLaw.LawModulo k radius) (control : α → α → ℝ) {Kmetric : NNReal} {C : ℝ} (hfmetric : LipschitzWith Kmetric f) (hcontrol : Continuous (uncurry control)) (hfcontrol : ∀ x y : s, dist (f x) (f y) ≤ C * control x.1 y.1) : ∃ F : closure s → AtomicLaw.LawModulo k radius, Continuous F ∧ (∀ q q', dist (F q) (F q') ≤ C * control q.1 q'.1) ∧ (∀ x : s, F ⟨x, subset_closure x.property⟩ = f x) ∧ ∀ G : closure s → AtomicLaw.LawModulo k radius, Continuous G → (∀ x : s, G ⟨x, subset_closure x.property⟩ = f x) → ∀ q, G q = F q := by obtain ⟨F, hFlip, hFext, hFunique⟩ := GapFreeModulusBridge.exists_unique_lipschitz_extension s f hfmetric refine ⟨F, hFlip.continuous, ?_, hFext, hFunique⟩ intro q q' obtain ⟨x, hxs, hx⟩ := (mem_closure_iff_seq_limit.mp q.property) obtain ⟨y, hys, hy⟩ := (mem_closure_iff_seq_limit.mp q'.property) let xc : ℕ → closure s := fun n => ⟨x n, subset_closure (hxs n)⟩ let yc : ℕ → closure s := fun n => ⟨y n, subset_closure (hys n)⟩ have hxc : Tendsto xc atTop (nhds q) := by rw [tendsto_subtype_rng] exact hx have hyc : Tendsto yc atTop (nhds q') := by rw [tendsto_subtype_rng] exact hy have hleft : Tendsto (fun n => dist (F (xc n)) (F (yc n))) atTop (nhds (dist (F q) (F q'))) := (hFlip.continuous.continuousAt.tendsto.comp hxc).dist (hFlip.continuous.continuousAt.tendsto.comp hyc) have hright : Tendsto (fun n => C * control (x n) (y n)) atTop (nhds (C * control q.1 q'.1)) := by apply tendsto_const_nhds.mul exact hcontrol.continuousAt.tendsto.comp (hx.prodMk_nhds hy) apply le_of_tendsto_of_tendsto' hleft hright intro n change dist (F ⟨x n, subset_closure (hxs n)⟩) (F ⟨y n, subset_closure (hys n)⟩) ≤ C * control (x n) (y n) rw [hFext ⟨x n, hxs n⟩, hFext ⟨y n, hys n⟩] exact hfcontrol ⟨x n, hxs n⟩ ⟨y n, hys n⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.GapFreeClosureAssembly.exists_unique_extension_with_control · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/GapFreeClosureAssembly.lean:59
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.GapFreeModulusBridge 5 declarations Paper-local bridges from the radius-indexed quotient-law carrier to the neutral collision-safe finite-atomic Wasserstein substrate.

Paper-local bridges from the radius-indexed quotient-law carrier to the neutral collision-safe finite-atomic Wasserstein substrate.

def asNeutral

Forget the support-radius index while retaining the labelled atomic law. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k :
radius :
mu :
AtomicLaw k radius
asNeutral mu :
CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw (Fin k)
⟨mu.weight, mu.atom⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.GapFreeModulusBridge.asNeutral · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/GapFreeModulusBridge.lean:14
theorem asNeutral_valid

Local validity supplies the positivity and normalization required by the neutral carrier. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
AtomicLaw k radius
hmu :
AtomicLaw.Valid mu
CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.Valid (asNeutral mu)
Proof (Lean source)
-- @node: gapFreeModulusBridge_asNeutral_valid lemma asNeutral_valid {k : ℕ} {radius : ℝ} {mu : AtomicLaw k radius} (hmu : AtomicLaw.Valid mu) : CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.Valid (asNeutral mu) := ⟨hmu.1, hmu.2.1⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.GapFreeModulusBridge.asNeutral_valid · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/GapFreeModulusBridge.lean:20
theorem wass1_eq_neutralW1

The paper-local and neutral finite transport formulations compute exactly the same cost. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
AtomicLaw k radius
hmu :
AtomicLaw.Valid mu
hnu :
AtomicLaw.Valid nu
AtomicLaw.wass1 mu nu
= CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.w1 (asNeutral mu) (asNeutral nu)
Proof (Lean source)
-- @node: gapFreeModulusBridge_wass1_eq_neutralW1 lemma wass1_eq_neutralW1 {k : ℕ} {radius : ℝ} {mu nu : AtomicLaw k radius} (hmu : AtomicLaw.Valid mu) (hnu : AtomicLaw.Valid nu) : AtomicLaw.wass1 mu nu = CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.w1 (asNeutral mu) (asNeutral nu) := by apply le_antisymm · obtain ⟨pi, hpi⟩ := CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.exists_optimalTransportPlan (asNeutral mu) (asNeutral nu) (asNeutral_valid hmu) (asNeutral_valid hnu) calc AtomicLaw.wass1 mu nu ≤ AtomicLaw.transportCost (planFromNeutral pi) := AtomicLaw.wass1_le_of_plan _ _ = CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.transportCost pi := cost_fromNeutral pi _ = CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.w1 (asNeutral mu) (asNeutral nu) := hpi · obtain ⟨pi, hpi⟩ := AtomicLaw.wass1_optimal_plan hmu hnu calc CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.w1 (asNeutral mu) (asNeutral nu) ≤ CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.transportCost (planToNeutral pi) := CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.w1_le_transportCost _ _ = AtomicLaw.transportCost pi := cost_toNeutral pi _ = AtomicLaw.wass1 mu nu := hpi
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.GapFreeModulusBridge.wass1_eq_neutralW1 · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/GapFreeModulusBridge.lean:58
theorem lawModulo_wass1_eq_neutralW1

Quotient Wasserstein distance can be evaluated by the neutral substrate on any chosen representatives. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
mu nu :
AtomicLaw.LawModulo k radius
mu.wass1 nu
= CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.w1 (asNeutral mu.representative.1) (asNeutral nu.representative.1)
Proof (Lean source)
-- @node: gapFreeModulusBridge_lawModulo_wass1_eq_neutralW1 lemma lawModulo_wass1_eq_neutralW1 {k : ℕ} {radius : ℝ} (mu nu : AtomicLaw.LawModulo k radius) : mu.wass1 nu = CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.w1 (asNeutral mu.representative.1) (asNeutral nu.representative.1) := by exact wass1_eq_neutralW1 mu.representative.2 nu.representative.2
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.GapFreeModulusBridge.lawModulo_wass1_eq_neutralW1 · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/GapFreeModulusBridge.lean:86

A Lipschitz map into the complete quotient-law space extends uniquely from a set to its closure. This packages the final completion step of the modulus argument independently of the model-specific operator construction. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
α :
k :
radius :
s :
Set α
f :
s → AtomicLaw.LawModulo k radius
K :
hf :
∃ F : closure s → AtomicLaw.LawModulo k radius,
conclusion 1
x :
s
F ⟨x, subset_closure x.property⟩ = f x
conclusion 2
G :
closure s → AtomicLaw.LawModulo k radius
(∀ x : s, G ⟨x, subset_closure x.property⟩ = f x)
q :
G q = F q
Proof (Lean source)
-- @node: gapFreeModulusBridge_exists_unique_lipschitz_extension theorem exists_unique_lipschitz_extension {α : Type*} [PseudoMetricSpace α] {k : ℕ} {radius : ℝ} (s : Set α) (f : s → AtomicLaw.LawModulo k radius) {K : NNReal} (hf : LipschitzWith K f) : ∃ F : closure s → AtomicLaw.LawModulo k radius, LipschitzWith K F ∧ (∀ x : s, F ⟨x, subset_closure x.property⟩ = f x) ∧ ∀ G : closure s → AtomicLaw.LawModulo k radius, Continuous G → (∀ x : s, G ⟨x, subset_closure x.property⟩ = f x) → ∀ q, G q = F q := by let t : Set (closure s) := {x | (x : α) ∈ s} have ht : Dense t := by rw [Subtype.dense_iff] intro x hx change x ∈ closure (val '' t) have himage : val '' t = s := by ext y constructor · rintro ⟨z, hz, rfl⟩ exact hz · intro hy exact ⟨⟨y, subset_closure hy⟩, hy, rfl⟩ simpa [himage] using hx let f' : t → AtomicLaw.LawModulo k radius := fun x => f ⟨x.1.1, x.2⟩ have hf' : LipschitzWith K f' := by intro x y exact hf ⟨x.1.1, x.2⟩ ⟨y.1.1, y.2⟩ let F : closure s → AtomicLaw.LawModulo k radius := ht.extend f' refine ⟨F, ht.lipschitzWith_extend hf', ?_, ?_⟩ · intro x exact ht.extend_eq hf'.continuous ⟨⟨x, subset_closure x.property⟩, x.property⟩ · intro G hG hGext q have hEq : G = F := by apply (ht.extend_unique (f := f') (g := G) _ hG).symm intro x exact hGext ⟨x.1.1, x.2⟩ exact congrFun hEq q
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.GapFreeModulusBridge.exists_unique_lipschitz_extension · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/GapFreeModulusBridge.lean:95
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.Inference 17 declarations The theoretical and computable confidence sets and the cluster-adaptive report.

The theoretical and computable confidence sets and the cluster-adaptive report.

Both confidence-set constructions at a fixed sample. It uses the supplied parameters.

Definition (Lean source)
k dx dz n :
radius :
Ctheory :
Set (AtomicLaw.LawModulo k radius)
@realizes \(\mathcal C_{n,\alpha}\)(theoretical image set)
Calg :
Set (AtomicLaw.LawModulo k radius)
@realizes \(\mathcal C^{\mathrm{alg}}_{n,\alpha}\)(outer W1 set)
pi0 :
mStar :
mStar_eq_pi0 :
mStar = pi0
mStar_pos :
0 < mStar
mStar_max :
mStar ≤ 1 / (2 * k : ℝ)
Ralpha :
Ralpha_pos :
0 < Ralpha
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ConfidenceSetData · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Inference.lean:10
def theoreticalConfidenceSet

The retained sharp summary-inversion image, independent of the computable outer set. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz n :
L pi0 sigma0 :
R :
SummaryRepairData k dx dz n L pi0 sigma0
sample :
Fin n → Obs dx dz
alpha C0 :
theoreticalConfidenceSet R sample alpha C0 :
Set (AtomicLaw.LawModulo k (effectRadius dz L sigma0))
r :
summaryRadius n alpha C0 L
if summaryClosure k dx dz L pi0 sigma0
= ∅ then {AtomicLaw.LawModulo.deltaZeroLaw R.k_pos R.radius_nonneg} else {ν | ∃ q : {q // q ∈ summaryClosure k dx dz L pi0 sigma0}, dS q.1 (R.Pi (empSummary sample)) ≤ 2 * r ∧ ν = R.Fbar q}
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.theoreticalConfidenceSet · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Inference.lean:24
theorem confidenceRadius_pos

Confidence radius pos: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
n :
alpha C0 L Clat :
hn :
0 < n
halpha :
0 < alpha
halphaHalf :
alpha < 1 / 2
hC0 :
1 ≤ C0
hL :
1 ≤ L
hClat :
0 < Clat
0 < Clat * (summaryRadius n alpha C0 L + (sqrt n)⁻¹)
Proof (Lean source)
lemma confidenceRadius_pos {n : ℕ} {alpha C0 L Clat : ℝ} (hn : 0 < n) (halpha : 0 < alpha) (halphaHalf : alpha < 1 / 2) (hC0 : 1 ≤ C0) (hL : 1 ≤ L) (hClat : 0 < Clat) : 0 < Clat * (summaryRadius n alpha C0 L + (sqrt n)⁻¹) := by positivity [summaryRadius_pos n alpha C0 L hn halpha halphaHalf hC0 hL]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.confidenceRadius_pos · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Inference.lean:35
def confidenceSets

The original summary-inversion image and the separate computable Wasserstein outer set. @realizes ξ\xi(candidate law in Calg) For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz n :
L pi0 sigma0 :
R :
SummaryRepairData k dx dz n L pi0 sigma0
A :
LatticeEstimator k dx dz n (effectRadius dz L sigma0)
_hA :
IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A
sample :
Fin n → Obs dx dz
alpha C0 Clat :
hn :
0 < n
halpha :
0 < alpha
halphaHalf :
alpha < 1 / 2
hC0 :
1 ≤ C0
hL :
1 ≤ L
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hClat :
0 < Clat
confidenceSets R A _hA sample alpha C0 Clat hn halpha halphaHalf hC0 hL hpi hpiMax hClat :
ConfidenceSetData k dx dz n (effectRadius dz L sigma0)
r :
summaryRadius n alpha C0 L
center :
latticeLaw A sample
:
Clat * (r + (sqrt n)⁻¹)
{ Ctheory := theoreticalConfidenceSet R sample alpha C0 Calg := {ν | AtomicLaw.AtomFloor pi0 ν.representative.1 ∧ AtomicLaw.LawModulo.wass1 ν center ≤ Rα} pi0 := pi0 mStar := pi0 mStar_eq_pi0 := rfl mStar_pos := hpi mStar_max := hpiMax Ralpha := Rα Ralpha_pos := confidenceRadius_pos hn halpha halphaHalf hC0 hL hClat }
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.confidenceSets · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Inference.lean:42

The finite transport-plan constraint representation of the computable outer set. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz n :
radius :
CS :
ConfidenceSetData k dx dz n radius
center :
AtomicLaw.LawModulo k radius
ν :
CalgHasConstrainedRepresentation CS center :
Prop
ν ∈ CS.Calg ↔ AtomicLaw.AtomFloor CS.mStar ν.representative.1 ∧
∃ γ : AtomicLaw.TransportPlan ν.representative.1 center.representative.1,
AtomicLaw.transportCost γ ≤ CS.Ralpha
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.CalgHasConstrainedRepresentation · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Inference.lean:68
theorem confidenceSets_constrainedRepresentation

Confidence sets constrained representation: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 :
R :
SummaryRepairData k dx dz n L pi0 sigma0
A :
LatticeEstimator k dx dz n (effectRadius dz L sigma0)
hA :
IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A
sample :
Fin n → Obs dx dz
alpha C0 Clat :
hn :
0 < n
halpha :
0 < alpha
halphaHalf :
alpha < 1 / 2
hC0 :
1 ≤ C0
hL :
1 ≤ L
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hClat :
0 < Clat
CalgHasConstrainedRepresentation (confidenceSets R A hA sample alpha C0 Clat hn halpha halphaHalf hC0 hL hpi hpiMax hClat) (latticeLaw A sample)
Proof (Lean source)
lemma confidenceSets_constrainedRepresentation {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} (R : SummaryRepairData k dx dz n L pi0 sigma0) (A : LatticeEstimator k dx dz n (effectRadius dz L sigma0)) (hA : IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A) (sample : Fin n → Obs dx dz) (alpha C0 Clat : ℝ) (hn : 0 < n) (halpha : 0 < alpha) (halphaHalf : alpha < 1 / 2) (hC0 : 1 ≤ C0) (hL : 1 ≤ L) (hpi : 0 < pi0) (hpiMax : pi0 ≤ 1 / (2 * k : ℝ)) (hClat : 0 < Clat) : CalgHasConstrainedRepresentation (confidenceSets R A hA sample alpha C0 Clat hn halpha halphaHalf hC0 hL hpi hpiMax hClat) (latticeLaw A sample) := by intro ν simp only [confidenceSets, Set.mem_setOf_eq] constructor · rintro ⟨hfloor, hwass⟩ obtain ⟨γ, hγ⟩ := AtomicLaw.wass1_optimal_plan ν.representative.2 (latticeLaw A sample).representative.2 exact ⟨hfloor, γ, hγ.symm ▸ hwass⟩ · rintro ⟨hfloor, γ, hγ⟩ exact ⟨hfloor, le_trans (AtomicLaw.wass1_le_of_plan γ) hγ⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.confidenceSets_constrainedRepresentation · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Inference.lean:77

For the supplied parameters, linked is given by its defining clause.

Definition (Lean source)
k :
radius rho :
ν :
AtomicLaw k radius
x y :
linked ν x y :
Prop
clause 1
x ∈ ν.support
clause 2
y ∈ ν.support
clause 3
|x - y| ≤ 4 * rho
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.linked · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Inference.lean:99
def componentOf

For the supplied parameters, component Of is given by its defining clause.

Definition (Lean source)
k :
radius rho :
ν :
AtomicLaw k radius
x :
componentOf ν x :
Finset
by classical exact ν.support.filter fun y
=> ReflTransGen (linked (rho := rho) ν) x y
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.componentOf · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Inference.lean:103
def components

For the ambient setting, components is given by its defining clause.

Definition (Lean source)
k :
radius rho :
ν :
AtomicLaw k radius
components ν :
ν.support.image (componentOf (rho := rho) ν)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.components · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Inference.lean:109
def clusterMass

For the supplied parameters, cluster Mass is given by its defining clause.

Definition (Lean source)
k :
radius :
rho :
ν :
AtomicLaw k radius
C :
Finset
clusterMass rho ν C :
∑ i, if AtomicLaw.distToFinset (ν.atom i) C ≤ rho then ν.weight i else 0
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.clusterMass · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Inference.lean:114
def associatedSupport

For the supplied parameters, associated Support is given by its defining clause.

Definition (Lean source)
k :
radius rho :
ν :
AtomicLaw k radius
C :
Finset
associatedSupport ν C :
Finset
ν.support.filter fun x => AtomicLaw.distToFinset x C ≤ rho
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.associatedSupport · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Inference.lean:120
def clusterExternalGap

For the supplied parameters, cluster External Gap is given by its defining clause.

Definition (Lean source)
k :
radius rho :
ν :
AtomicLaw k radius
C :
Finset
clusterExternalGap ν C :
if (ν.support \ associatedSupport (rho := rho) ν C).Nonempty then sInf {d : EReal | ∃ x ∈ associatedSupport (rho := rho) ν C, ∃ y ∈ ν.support, y ∉ associatedSupport (rho := rho) ν C ∧ d = |x - y|} else ⊤
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.clusterExternalGap · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Inference.lean:126
def ClusterEndpointFeasible

Feasible objective values in the ordered-support/weight/transport representation of one cluster-mass endpoint. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz n :
radius :
CS :
ConfidenceSetData k dx dz n radius
center :
AtomicLaw.LawModulo k radius
rho :
C :
Finset
m :
ClusterEndpointFeasible CS center rho C m :
Prop
∃ ν : AtomicLaw.LawModulo k radius,
clause 1
AtomicLaw.AtomFloor CS.mStar ν.representative.1
clause 2
∃ γ : AtomicLaw.TransportPlan ν.representative.1 center.representative.1,
AtomicLaw.transportCost γ ≤ CS.Ralpha
clause 3
m = clusterMass rho ν.representative.1 C
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ClusterEndpointFeasible · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Inference.lean:134
theorem clusterEndpoint_extrema_of_representation

Cluster endpoint extrema of representation: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
radius rho :
CS :
ConfidenceSetData k dx dz n radius
center :
AtomicLaw.LawModulo k radius
C :
Finset
(sInf {m | ∃ ν ∈ CS.Calg, m = clusterMass rho ν.representative.1 C}, sSup {m | ∃ ν ∈ CS.Calg, m = clusterMass rho ν.representative.1 C})
= (sInf {m | ClusterEndpointFeasible CS center rho C m}, sSup {m | ClusterEndpointFeasible CS center rho C m})
Proof (Lean source)
lemma clusterEndpoint_extrema_of_representation {k dx dz n : ℕ} {radius rho : ℝ} (CS : ConfidenceSetData k dx dz n radius) (center : AtomicLaw.LawModulo k radius) (hrep : CalgHasConstrainedRepresentation CS center) (C : Finset ℝ) : (sInf {m | ∃ ν ∈ CS.Calg, m = clusterMass rho ν.representative.1 C}, sSup {m | ∃ ν ∈ CS.Calg, m = clusterMass rho ν.representative.1 C}) = (sInf {m | ClusterEndpointFeasible CS center rho C m}, sSup {m | ClusterEndpointFeasible CS center rho C m}) := by congr 1 <;> apply congrArg <;> ext m <;> simp only [Set.mem_setOf_eq] all_goals constructor · rintro ⟨ν, hν, rfl⟩ exact ⟨ν, (hrep ν).mp hν |>.1, (hrep ν).mp hν |>.2, rfl⟩ · rintro ⟨ν, hf, hp, rfl⟩ exact ⟨ν, (hrep ν).mpr ⟨hf, hp⟩, rfl⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.clusterEndpoint_extrema_of_representation · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Inference.lean:145
structure ClusterReportData

One cluster report at a fixed sample. It uses the supplied parameters.

Definition (Lean source)
k dx dz n :
radius :
EP :
SummarySpace dx dz → Set (Fin n → Obs dx dz)
@realizes \(E_P\)(summary concentration event as a function of S(P))
rho :
rho_pos :
0 < rho
Kcomponents :
Ktrue :
AtomicLaw k radius → Finset ℝ → Finset
Kcand :
AtomicLaw k radius → Finset ℝ → Finset
supportInterval :
Finset ℝ → ℝ × ℝ
massInterval :
Finset ℝ → ℝ × ℝ
massInterval_valid :
∀ C,
0 ≤ (massInterval C).1 ∧ (massInterval C).1 ≤ (massInterval C).2 ∧ (massInterval C).2 ≤ 1
endpointFeasible :
Finset ℝ → ℝ → Prop
massInterval_program :
∀ C, massInterval C = (sInf {m | endpointFeasible C m}, sSup {m | endpointFeasible C m})
externalGap :
AtomicLaw k radius → Finset ℝ → EReal
externalGap_eq :
∀ ν C, externalGap ν C = clusterExternalGap (rho := rho) ν C
@realizes \(\Delta_C(P)\)(defining infimum; top when complement empty)
externalGap_range :
∀ ν
if
AtomicLaw.Valid ν
then
∀ C,
externalGap ν C = ⊤ ∨ (0 : EReal) ≤ externalGap ν C ∧ externalGap ν C ≤ (2 * radius : ℝ)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ClusterReportData · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Inference.lean:161
theorem clusterReport_side_conditions

Cluster report side conditions: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius rho :
hradius :
0 ≤ radius
hrho :
0 < rho
Calg :
Set (AtomicLaw.LawModulo k radius)
conclusion 1
C :
Finset
I :
(sInf {m | ∃ ν ∈ Calg, m = clusterMass rho ν.representative.1 C}, sSup {m | ∃ ν ∈ Calg, m = clusterMass rho ν.representative.1 C})
0 ≤ I.1
I.1 ≤ I.2
I.2 ≤ 1
conclusion 2
ν :
AtomicLaw k radius
AtomicLaw.Valid ν
C :
(if (ν.support \ (ν.support.filter fun x => AtomicLaw.distToFinset x C ≤ rho)).Nonempty then sInf {d : EReal | ∃ x ∈ ν.support.filter fun x => AtomicLaw.distToFinset x C ≤ rho, ∃ y ∈ ν.support, y ∉ ν.support.filter (fun x => AtomicLaw.distToFinset x C ≤ rho) ∧ d = |x - y|} else ⊤)
= ⊤ ∨ (0 : EReal) ≤ (if (ν.support \ (ν.support.filter fun x => AtomicLaw.distToFinset x C ≤ rho)).Nonempty then sInf {d : EReal | ∃ x ∈ ν.support.filter fun x => AtomicLaw.distToFinset x C ≤ rho, ∃ y ∈ ν.support, y ∉ ν.support.filter (fun x => AtomicLaw.distToFinset x C ≤ rho) ∧ d = |x - y|} else ⊤) ∧
(if (ν.support \ (ν.support.filter fun x => AtomicLaw.distToFinset x C ≤ rho)).Nonempty then sInf {d : EReal | ∃ x ∈ ν.support.filter fun x => AtomicLaw.distToFinset x C ≤ rho, ∃ y ∈ ν.support, y ∉ ν.support.filter (fun x => AtomicLaw.distToFinset x C ≤ rho) ∧ d = |x - y|} else ⊤)
≤ (2 * radius : ℝ)
Proof (Lean source)
lemma clusterReport_side_conditions {k : ℕ} {radius rho : ℝ} (hradius : 0 ≤ radius) (hrho : 0 < rho) (Calg : Set (AtomicLaw.LawModulo k radius)) : (∀ C : Finset ℝ, let I := (sInf {m | ∃ ν ∈ Calg, m = clusterMass rho ν.representative.1 C}, sSup {m | ∃ ν ∈ Calg, m = clusterMass rho ν.representative.1 C}) 0 ≤ I.1 ∧ I.1 ≤ I.2 ∧ I.2 ≤ 1) ∧ ∀ (ν : AtomicLaw k radius), AtomicLaw.Valid ν → ∀ C, (if (ν.support \ (ν.support.filter fun x => AtomicLaw.distToFinset x C ≤ rho)).Nonempty then sInf {d : EReal | ∃ x ∈ ν.support.filter fun x => AtomicLaw.distToFinset x C ≤ rho, ∃ y ∈ ν.support, y ∉ ν.support.filter (fun x => AtomicLaw.distToFinset x C ≤ rho) ∧ d = |x - y|} else ⊤) = ⊤ ∨ (0 : EReal) ≤ (if (ν.support \ (ν.support.filter fun x => AtomicLaw.distToFinset x C ≤ rho)).Nonempty then sInf {d : EReal | ∃ x ∈ ν.support.filter fun x => AtomicLaw.distToFinset x C ≤ rho, ∃ y ∈ ν.support, y ∉ ν.support.filter (fun x => AtomicLaw.distToFinset x C ≤ rho) ∧ d = |x - y|} else ⊤) ∧ (if (ν.support \ (ν.support.filter fun x => AtomicLaw.distToFinset x C ≤ rho)).Nonempty then sInf {d : EReal | ∃ x ∈ ν.support.filter fun x => AtomicLaw.distToFinset x C ≤ rho, ∃ y ∈ ν.support, y ∉ ν.support.filter (fun x => AtomicLaw.distToFinset x C ≤ rho) ∧ d = |x - y|} else ⊤) ≤ (2 * radius : ℝ) := by classical have clusterMass_nonneg (nu : AtomicLaw k radius) (hnu : AtomicLaw.Valid nu) (C : Finset ℝ) : 0 ≤ clusterMass rho nu C := by unfold clusterMass exact sum_nonneg fun i _ => by split_ifs · exact hnu.1 i · exact le_rfl have clusterMass_le_one (nu : AtomicLaw k radius) (hnu : AtomicLaw.Valid nu) (C : Finset ℝ) : clusterMass rho nu C ≤ 1 := by unfold clusterMass calc ∑ i, (if AtomicLaw.distToFinset (nu.atom i) C ≤ rho then nu.weight i else 0) ≤ ∑ i, nu.weight i := by apply Finset.sum_le_sum intro i _ split_ifs · exact le_rfl · exact hnu.1 i _ = 1 := hnu.2.1 constructor · intro C let S : Set ℝ := {m | ∃ nu ∈ Calg, m = clusterMass rho nu.representative.1 C} change 0 ≤ sInf S ∧ sInf S ≤ sSup S ∧ sSup S ≤ 1 by_cases hS : S.Nonempty · have hlower : ∀ m ∈ S, 0 ≤ m := by rintro m ⟨nu, -, rfl⟩ exact clusterMass_nonneg nu.representative.1 nu.representative.2 C have hupper : ∀ m ∈ S, m ≤ 1 := by rintro m ⟨nu, -, rfl⟩ exact clusterMass_le_one nu.representative.1 nu.representative.2 C refine ⟨le_csInf hS hlower, ?_, csSup_le hS hupper⟩ obtain ⟨m, hm⟩ := hS exact le_trans (csInf_le ⟨0, hlower⟩ hm) (le_csSup ⟨1, hupper⟩ hm) · have hEmpty : S = ∅ := Set.not_nonempty_iff_eq_empty.mp hS simp [hEmpty, Real.sInf_empty, Real.sSup_empty] · intro nu hnu C let A : Finset ℝ := nu.support.filter fun x => AtomicLaw.distToFinset x C ≤ rho let D : Set EReal := {d | ∃ x ∈ A, ∃ y ∈ nu.support, y ∉ A ∧ d = |x - y|} by_cases hcomp : (nu.support \ A).Nonempty · rw [if_pos (by simpa [A] using hcomp)] change sInf D = ⊤ ∨ (0 : EReal) ≤ sInf D ∧ sInf D ≤ (2 * radius : ℝ) by_cases hD : D.Nonempty · right constructor · apply le_sInf intro d hd rcases hd with ⟨x, hx, y, hy, hyA, rfl⟩ positivity · obtain ⟨d, hd⟩ := hD refine (sInf_le hd).trans ?_ rcases hd with ⟨x, hxA, y, hy, hyA, rfl⟩ have hxSupp : x ∈ nu.support := (Finset.mem_filter.mp hxA).1 rcases Finset.mem_image.mp hxSupp with ⟨i, hi, rfl⟩ rcases Finset.mem_image.mp hy with ⟨j, hj, rfl⟩ have hxi := hnu.2.2 i have hyj := hnu.2.2 j rw [EReal.coe_le_coe_iff] rw [abs_le] constructor <;> linarith [hxi.1, hxi.2, hyj.1, hyj.2] · left have hEmpty : D = ∅ := Set.not_nonempty_iff_eq_empty.mp hD simp [hEmpty] · left rw [if_neg (by simpa [A] using hcomp)]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.clusterReport_side_conditions · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Inference.lean:184
def clusterReport

Computable cluster-adaptive report. @realizes Rn,α\mathfrak R_{n,\alpha}(support and mass report) For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz n :
L pi0 sigma0 :
R :
SummaryRepairData k dx dz n L pi0 sigma0
A :
LatticeEstimator k dx dz n (effectRadius dz L sigma0)
hA :
IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A
sample :
Fin n → Obs dx dz
alpha C0 Clat :
hn :
0 < n
halpha :
0 < alpha
halphaHalf :
alpha < 1 / 2
hC0 :
1 ≤ C0
hL :
1 ≤ L
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hClat :
0 < Clat
clusterReport R A hA sample alpha C0 Clat hn halpha halphaHalf hC0 hL hpi hpiMax hClat :
ClusterReportData k dx dz n (effectRadius dz L sigma0)
CS :
confidenceSets R A hA sample alpha C0 Clat hn halpha halphaHalf hC0 hL hpi hpiMax hClat
rho :
CS.Ralpha / CS.mStar
center :
latticeLaw A sample
assoc :
fun (ν : AtomicLaw k (effectRadius dz L sigma0)) (C : Finset ℝ)
=> associatedSupport (rho := rho) ν C
{ EP := fun s => {sample' | dS (empSummary sample') s ≤ summaryRadius n alpha C0 L} rho := rho rho_pos := div_pos CS.Ralpha_pos CS.mStar_pos Kcomponents := components (rho := rho) center.representative.1 Ktrue := assoc Kcand := assoc supportInterval := fun C => (sInf (C : Set ℝ) - rho, sSup (C : Set ℝ) + rho) massInterval := fun C => (sInf {m | ∃ ν ∈ CS.Calg, m = clusterMass rho ν.representative.1 C}, sSup {m | ∃ ν ∈ CS.Calg, m = clusterMass rho ν.representative.1 C}) massInterval_valid := (clusterReport_side_conditions R.radius_nonneg (div_pos CS.Ralpha_pos CS.mStar_pos) CS.Calg).1 endpointFeasible := ClusterEndpointFeasible CS center rho massInterval_program := fun C => clusterEndpoint_extrema_of_representation CS center (confidenceSets_constrainedRepresentation R A hA sample alpha C0 Clat hn halpha halphaHalf hC0 hL hpi hpiMax hClat) C externalGap := fun ν C => clusterExternalGap (rho := rho) ν C externalGap_eq := fun ν C => rfl externalGap_range := (clusterReport_side_conditions R.radius_nonneg (div_pos CS.Ralpha_pos CS.mStar_pos) CS.Calg).2 }
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.clusterReport · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Inference.lean:279
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.LatticeEstimator 60 declarations Finite-library and no-advice lattice estimator carriers.

Finite-library and no-advice lattice estimator carriers.

Polynomial aggregate spectral projectors and the positive law they determine at one feasible representative. The law is not supplied independently: its atoms and masses are definitionally the displayed projector formula. It uses the supplied parameters.

Definition (Lean source)
k dx dz :
radius threshold :
s :
basis :
spans :
basis.SpansSignal s
armwiseFullRank :
thresholdRetainsExactlySignal :
∀ j, threshold ≤ singularValue (stackedProxyMoment s) j ↔ j < k
eigenvalue :
Fin k → ℝ
eigenvalue_complete :
∀ z : ℂ
then
∃ i, z = eigenvalue i
lawValid :
AtomicLaw.Valid (⟨fun i => ∑ a, leftAnchor s basis a * (∑ b, (polynomialAggregateProjector (compressedOperator s basis spans) eigenvalue i) a b * rightAnchor basis b), eigenvalue⟩ : AtomicLaw k radius)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.RepresentativeSpectralData · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:13
def effectLaw

For the supplied parameters, effect Law is given by its defining clause.

Definition (Lean source)
k dx dz :
radius threshold :
s :
D :
RepresentativeSpectralData k dx dz radius threshold s
effectLaw D :
AtomicLaw.LawModulo k radius
AtomicLaw.LawModulo.ofProbabilityLaw ⟨⟨fun i
=> ∑ a, leftAnchor s D.basis a * (∑ b, (polynomialAggregateProjector (compressedOperator s D.basis D.spans) D.eigenvalue i) a b * rightAnchor D.basis b), D.eigenvalue⟩, D.lawValid⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.RepresentativeSpectralData.effectLaw · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:33

Coordinatewise membership in one deterministic half-open summary cube. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
dx dz :
L :
s :
InSummaryBox L s :
Prop
clause 1
i j :
s.M0 i j ∈ Icc (-L) L
clause 2
i j :
s.M1 i j ∈ Icc (-L) L
clause 3
i j :
s.N0 i j ∈ Icc (-L) L
clause 4
i j :
s.N1 i j ∈ Icc (-L) L
clause 5
i :
s.mX i ∈ Icc (-L) L
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.InSummaryBox · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:43

For the supplied parameters, In Half Open Summary Cube is given by its defining clause.

Definition (Lean source)
dx dz :
scale :
lo s :
InHalfOpenSummaryCube scale lo s :
Prop
clause 1
i j :
lo.M0 i j ≤ s.M0 i j
s.M0 i j < lo.M0 i j + scale
clause 2
i j :
lo.M1 i j ≤ s.M1 i j
s.M1 i j < lo.M1 i j + scale
clause 3
i j :
lo.N0 i j ≤ s.N0 i j
s.N0 i j < lo.N0 i j + scale
clause 4
i j :
lo.N1 i j ≤ s.N1 i j
s.N1 i j < lo.N1 i j + scale
clause 5
i :
lo.mX i ≤ s.mX i
s.mX i < lo.mX i + scale
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.InHalfOpenSummaryCube · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:51
def summaryLexKey

For the supplied parameters, summary Lex Key is given by its defining clause.

Definition (Lean source)
dx dz :
s :
summaryLexKey s :
List
((Finset.univ.toList.flatMap fun i : Fin dz => Finset.univ.toList.map fun j : Fin dx => s.M0 i j) ++ (Finset.univ.toList.flatMap fun i : Fin dz => Finset.univ.toList.map fun j : Fin dx => s.M1 i j) ++ (Finset.univ.toList.flatMap fun i : Fin dz => Finset.univ.toList.map fun j : Fin dx => s.N0 i j) ++ (Finset.univ.toList.flatMap fun i : Fin dz => Finset.univ.toList.map fun j : Fin dx => s.N1 i j) ++ Finset.univ.toList.map fun i : Fin dx => s.mX i)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summaryLexKey · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:59

For the supplied parameters, Summary Lex LE is given by its defining clause.

Definition (Lean source)
dx dz :
s q :
SummaryLexLE s q :
Prop
summaryLexKey s = summaryLexKey q ∨ List.Lex (· < ·) (summaryLexKey s) (summaryLexKey q)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.SummaryLexLE · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:71

A faithfully well-formed class-dependent grid library of feasible representatives. It uses the supplied parameters.

Definition (Lean source)
k dx dz n :
L pi0 sigma0 :
index :
Type
finiteIndex :
Fintype index
summary :
index → SummarySpace dx dz
representative_feasible :
∀ i, summary i ∈ admissibleImage k dx dz L pi0 sigma0
scale :
scale_eq :
scale = (sqrt n)⁻¹ / (4 * sqrt (dz * dx) + sqrt dx)
covers :
∀ q
if
q ∈ admissibleImage k dx dz L pi0 sigma0
then
∃ i, dS (summary i) q ≤ (sqrt n)⁻¹
cube :
index → Set (SummarySpace dx dz)
cubeLower :
index → SummarySpace dx dz
cubeLower_on_grid :
∀ i,
(∀ a b, ∃ z : ℤ, (cubeLower i).M0 a b = -L + scale * z) ∧
(∀ a b, ∃ z : ℤ, (cubeLower i).M1 a b = -L + scale * z) ∧
(∀ a b, ∃ z : ℤ, (cubeLower i).N0 a b = -L + scale * z) ∧
(∀ a b, ∃ z : ℤ, (cubeLower i).N1 a b = -L + scale * z) ∧
∀ a, ∃ z : ℤ, (cubeLower i).mX a = -L + scale * z
cube_eq_halfOpen :
∀ i, cube i = {s | InSummaryBox L s ∧ InHalfOpenSummaryCube scale (cubeLower i) s}
representative_in_cube :
∀ i, summary i ∈ cube i
cubes_disjoint :
meeting_cube_complete :
∀ q
if
q ∈ admissibleImage k dx dz L pi0 sigma0
then
∃ i, q ∈ cube i
cube_diameter :
∀ i q
if
q ∈ cube i
then
dS q (summary i) ≤ (sqrt n)⁻¹
lexRank :
index → ℕ
lexRank_injective :
Injective lexRank
lexRank_order :
∀ i j, lexRank i ≤ lexRank j ↔ SummaryLexLE (cubeLower i) (cubeLower j)
k_pos :
0 < k
radius_nonneg :
0 ≤ effectRadius dz L sigma0
index_nonempty_iff :
Nonempty index ↔ admissibleImage k dx dz L pi0 sigma0 ≠ ∅
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.NetLibrary · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:75
def instFintypeIndex

For a finite representative library, its index type is finite.

Definition (Lean source)
local instance {k dx dz n L pi0 sigma0} (A : NetLibrary k dx dz n L pi0 sigma0) : Fintype A.index := A.finiteIndex
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.instFintypeIndex · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:108
def indexList

The actual finite list scanned by the advised estimator. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz n :
L pi0 sigma0 :
A :
NetLibrary k dx dz n L pi0 sigma0
indexList A :
List A.index
(Finset.univ : Finset A.index).toList
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.NetLibrary.indexList · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:112
def betterIndex

One exact-real comparison step: keep the closer representative, breaking distance ties by the prescribed lexicographic rank. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz n :
L pi0 sigma0 :
A :
NetLibrary k dx dz n L pi0 sigma0
s :
i j :
A.index
betterIndex A s i j :
A.index
if dS (A.summary j) s < dS (A.summary i) s then j else if dS (A.summary i) s < dS (A.summary j) s then i else if A.lexRank j < A.lexRank i then j else i
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.NetLibrary.betterIndex · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:117
def nearestLibraryIndex

Exhaustive smallest-index nearest-library search, implemented by a fold over the actual finite library rather than supplied as an oracle field. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz n :
L pi0 sigma0 :
A :
NetLibrary k dx dz n L pi0 sigma0
s :
nearestLibraryIndex A s :
Option A.index
match A.indexList with | [] => none | i :: is => some (is.foldl (A.betterIndex s) i)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.nearestLibraryIndex · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:126
theorem nearestLibraryIndex_spec

Successful exhaustive fold selection minimizes distance over the whole library and uses the stored lexicographic rank to break every distance tie. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 :
A :
NetLibrary k dx dz n L pi0 sigma0
s :
i :
A.index
hsel :
nearestLibraryIndex A s = some i
conclusion 1
j :
dS (A.summary i) s ≤ dS (A.summary j) s
conclusion 2
j :
dS (A.summary i) s = dS (A.summary j) s
A.lexRank i ≤ A.lexRank j
Proof (Lean source)
lemma nearestLibraryIndex_spec {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} (A : NetLibrary k dx dz n L pi0 sigma0) (s : SummarySpace dx dz) (i : A.index) (hsel : nearestLibraryIndex A s = some i) : (∀ j, dS (A.summary i) s ≤ dS (A.summary j) s) ∧ ∀ j, dS (A.summary i) s = dS (A.summary j) s → A.lexRank i ≤ A.lexRank j := by unfold nearestLibraryIndex at hsel generalize hlist : A.indexList = xs at hsel cases xs with | nil => simp at hsel | cons a as => simp only at hsel have hi : as.foldl (A.betterIndex s) a = i := Option.some.inj hsel subst i have hall := A.foldl_betterIndex_dominates s a as constructor · intro j exact (hall j (by rw [← hlist] simp [NetLibrary.indexList])).1 · intro j hj exact (hall j (by rw [← hlist] simp [NetLibrary.indexList])).2 hj
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.nearestLibraryIndex_spec · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:202
theorem representativeSpectralData_exists

Feasibility of a raw advised summary implies all spectral facts needed by the stored-summary rule. In particular, these are conclusions of the model assumptions, not certificates bundled into the advice. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
s :
hs :
s ∈ admissibleImage k dx dz L pi0 sigma0
Nonempty (RepresentativeSpectralData k dx dz (effectRadius dz L sigma0) (pi0 * sigma0 ^ 2 / 2) s)
Proof (Lean source)
lemma representativeSpectralData_exists {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (s : SummarySpace dx dz) (hs : s ∈ admissibleImage k dx dz L pi0 sigma0) : Nonempty (RepresentativeSpectralData k dx dz (effectRadius dz L sigma0) (pi0 * sigma0 ^ 2 / 2) s) := by classical rcases hs with ⟨Q, hQs⟩ subst s letI := Q.prob obtain ⟨facts⟩ := modelCompressedSpectralFacts_exists Q have hradius : 0 < effectRadius dz L sigma0 := by rcases Q.model.coreDomain with ⟨hk, _, hkz, hL, _, _, hsigma, _⟩ have hdz : 0 < dz := lt_of_lt_of_le (by omega : 0 < k) hkz unfold effectRadius positivity have hlatent := quotientLawRaw_valid Q.P Q.model have hmass : (∀ u, 0 ≤ latentMass Q.P u) ∧ ∑ u, latentMass Q.P u = 1 := ⟨hlatent.1, hlatent.2.1⟩ have hbound (u : Fin k) : facts.diagonalization.eigenvalue u ∈ Icc (-effectRadius dz L sigma0) (effectRadius dz L sigma0) := by rw [facts.eigenvalue_coordinates] exact hlatent.2.2 u obtain ⟨value, hinj, hcomplete, hvalueBound, hweightNonneg, hweightSum⟩ := CausalSmith.Substrate.CollisionSafeSpectralLaw.exists_polynomialSpectralLaw facts.diagonalization hradius (latentMass Q.P) (leftAnchor Q.summary facts.basis) (rightAnchor facts.basis) hmass hbound facts.left_coordinates facts.right_coordinates refine ⟨{ basis := facts.basis spans := facts.spans armwiseFullRank := facts.armwiseFullRank thresholdRetainsExactlySignal := facts.thresholdRetainsExactlySignal eigenvalue := value eigenvalue_complete := ?_ lawValid := ?_ }⟩ · intro z hz have hz' : CausalSmith.Substrate.CollisionSafeSpectralLaw.ComplexMatrixEigenvalue (compressedOperator Q.summary facts.basis facts.spans) z := hz obtain ⟨u, hu⟩ := CausalSmith.Substrate.CollisionSafeSpectralLaw.complexEigenvalue_mem_diagonal facts.diagonalization hz' obtain ⟨i, hi⟩ := hcomplete u exact ⟨i, hu.trans (congrArg ((↑) : ℝ → ℂ) hi.symm)⟩ · refine ⟨?_, ?_, hvalueBound⟩ · intro i simpa [polynomialAggregateProjector, CausalSmith.Substrate.CollisionSafeSpectralLaw.polynomialSpectralProjector] using hweightNonneg i · simpa [polynomialAggregateProjector, CausalSmith.Substrate.CollisionSafeSpectralLaw.polynomialSpectralProjector] using hweightSum
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.representativeSpectralData_exists · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:230

The operation classes charged by the paper's fixed-dimensional exact-real model. It uses the ambient setting. It uses the ambient setting. It uses the ambient setting. It uses the ambient setting.

Definition (Lean source)
arithmetic :
comparison :
singularValue :
rootIsolation :
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.NetOperationCount · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:284
def total

For the supplied parameters, total is given by its defining clause.

Definition (Lean source)
total cost :
cost.arithmetic + cost.comparison + cost.singularValue + cost.rootIsolation
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.NetOperationCount.total · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:291
inductive NetPrimitiveOperation

The finite instruction type records arithmetic, comparison, singular-value, and root-isolation operations in the exact-real implementation.

Definition (Lean source)
inductive NetPrimitiveOperation where | arithmetic | comparison | singularValue | rootIsolation deriving DecidableEq
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.NetPrimitiveOperation · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:295
instance instDecidableEqNetPrimitiveOperation

Equality of primitive net operations is decidable.

Definition (Lean source)
deriving DecidableEq
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.instDecidableEqNetPrimitiveOperation · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:301
def cost

For the supplied parameters, cost is given by its defining clause.

Definition (Lean source)
clause 1
| .arithmetic => ⟨1, 0, 0, 0⟩
clause 2
| .comparison => ⟨0, 1, 0, 0⟩
clause 3
| .singularValue => ⟨0, 0, 1, 0⟩
clause 4
| .rootIsolation => ⟨0, 0, 0, 1⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.NetPrimitiveOperation.cost · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:306
def add

For the supplied parameters, add is given by its defining clause.

Definition (Lean source)
add a b :
⟨a.arithmetic
+ b.arithmetic, a.comparison
+ b.comparison, a.singularValue
+ b.singularValue, a.rootIsolation
+ b.rootIsolation⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.NetOperationCount.add · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:313
def netTraceCost

For the supplied parameters, net Trace Cost is given by its defining clause.

Definition (Lean source)
netTraceCost trace :
trace.foldl (fun cost op => cost.add op.cost) ⟨0, 0, 0, 0⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.netTraceCost · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:318

Result returned by the singular-value primitive at one feasible representative. Its basis, rank certificates, and threshold decision are the data produced by this execution, not separately supplied advice. It uses the supplied parameters.

Definition (Lean source)
k dx dz :
L pi0 sigma0 :
s :
basis :
spans :
basis.SpansSignal s
armwiseFullRank :
thresholdRetainsExactlySignal :
∀ j, pi0 * sigma0 ^ 2 / 2 ≤ singularValue (stackedProxyMoment s) j ↔ j < k
trace_eq :
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ThresholdedSignalExecution · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:322

Result returned by fixed-degree real-root isolation and projector-mass arithmetic after the singular-value execution. The validity certificate concerns exactly the atoms and projector masses returned by this execution. It uses the supplied parameters.

Definition (Lean source)
k dx dz :
L pi0 sigma0 :
s :
signal :
ThresholdedSignalExecution (k := k) (L := L) (pi0 := pi0) (sigma0 := sigma0) s
eigenvalue :
Fin k → ℝ
eigenvalue_complete :
∀ z : ℂ
if
MatrixEigenvalue (compressedOperator s signal.basis signal.spans) z
then
∃ i, z = eigenvalue i
lawValid :
AtomicLaw.Valid (⟨fun i => ∑ a, leftAnchor s signal.basis a * (∑ b, (polynomialAggregateProjector (compressedOperator s signal.basis signal.spans) eigenvalue i) a b * rightAnchor signal.basis b), eigenvalue⟩ : AtomicLaw k (effectRadius dz L sigma0))
trace_eq :
trace = [.rootIsolation, .arithmetic]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.RootIsolationMassExecution · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:336

One execution of the result-bearing singular-value and root-isolation primitives. It uses the supplied parameters.

Definition (Lean source)
k dx dz :
L pi0 sigma0 :
s :
signal :
ThresholdedSignalExecution (k := k) (L := L) (pi0 := pi0) (sigma0 := sigma0) s
roots :
RootIsolationMassExecution (s := s) (L := L) signal
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ExactRealSpectralRun · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:354

Exact-real primitives at fixed admissible dimensions and constants. The combined primitive threads feasibility into both singular-value thresholding and root isolation, so no root run can be requested at an arbitrary summary. It uses the supplied parameters.

Definition (Lean source)
k dx dz :
L pi0 sigma0 :
spectralRun :
(s : SummarySpace dx dz) → s ∈ admissibleImage k dx dz L pi0 sigma0 → ExactRealSpectralRun (k := k) (L := L) (pi0 := pi0) (sigma0 := sigma0) s
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ExactRealPrimitivesAt · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:361

A uniform provider of fixed-parameter exact-real primitives, requested only on the admissible core parameter domain.

Definition (Lean source)
ExactRealPrimitives :
Type
{k dx dz : ℕ} → {L pi0 sigma0 : ℝ} → CoreParameterDomain k dx dz L pi0 sigma0 → ExactRealPrimitivesAt k dx dz L pi0 sigma0
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ExactRealPrimitives · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:369
theorem admissibleImage_coreParameterDomain

Feasibility identifies the admissible positive parameter domain carried by its model law. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
s :
hs :
s ∈ admissibleImage k dx dz L pi0 sigma0
CoreParameterDomain k dx dz L pi0 sigma0
Proof (Lean source)
lemma admissibleImage_coreParameterDomain {k dx dz : ℕ} {L pi0 sigma0 : ℝ} {s : SummarySpace dx dz} (hs : s ∈ admissibleImage k dx dz L pi0 sigma0) : CoreParameterDomain k dx dz L pi0 sigma0 := by rcases hs with ⟨Q, _⟩ letI := Q.prob exact Q.model.coreDomain
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.admissibleImage_coreParameterDomain · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:376
theorem exactRealPrimitives_nonempty

The exact-real primitive carrier is inhabited: representative spectral data on every admissible summary supplies a combined fixed-parameter run. Under the stated setting, the stated conclusion holds.

Formal statement
Proof (Lean source)
theorem exactRealPrimitives_nonempty : Nonempty ExactRealPrimitives := by classical refine ⟨fun {k dx dz} {L pi0 sigma0} _ => ⟨fun s hs => ?_⟩⟩ let D := choice (representativeSpectralData_exists s hs) let signal : ThresholdedSignalExecution (k := k) (L := L) (pi0 := pi0) (sigma0 := sigma0) s := { basis := D.basis spans := D.spans armwiseFullRank := D.armwiseFullRank thresholdRetainsExactlySignal := D.thresholdRetainsExactlySignal trace := replicate 3 .singularValue trace_eq := rfl } refine ({ signal := signal roots := { eigenvalue := D.eigenvalue eigenvalue_complete := D.eigenvalue_complete lawValid := ?_ trace := [.rootIsolation, .arithmetic] trace_eq := rfl } } : ExactRealSpectralRun (k := k) (L := L) (pi0 := pi0) (sigma0 := sigma0) s) exact D.lawValid
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.exactRealPrimitives_nonempty · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:385
def output

The representative spectral datum computed by an exact-real spectral execution. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz :
L pi0 sigma0 :
s :
run :
ExactRealSpectralRun (k := k) (L := L) (pi0 := pi0) (sigma0 := sigma0) s
output run :
RepresentativeSpectralData k dx dz (effectRadius dz L sigma0) (pi0 * sigma0 ^ 2 / 2) s
clause 1
basis := run.signal.basis
clause 2
spans := run.signal.spans
clause 3
armwiseFullRank := run.signal.armwiseFullRank
clause 4
thresholdRetainsExactlySignal := run.signal.thresholdRetainsExactlySignal
clause 5
eigenvalue := run.roots.eigenvalue
clause 6
eigenvalue_complete := run.roots.eigenvalue_complete
clause 7
lawValid := run.roots.lawValid
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ExactRealSpectralRun.output · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:410
def trace

The trace is assembled from the two result-bearing primitive executions that produced the spectral output. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz :
L pi0 sigma0 :
s :
run :
ExactRealSpectralRun (k := k) (L := L) (pi0 := pi0) (sigma0 := sigma0) s
run.signal.trace ++ run.roots.trace
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ExactRealSpectralRun.trace · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:424

Execute the result-bearing singular-value and root-isolation primitives. No choice operator or precomputed spectral selector participates in this definition. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz :
L pi0 sigma0 :
primitives :
s :
hs :
s ∈ admissibleImage k dx dz L pi0 sigma0
exactRealSpectralRun primitives s hs :
ExactRealSpectralRun (k := k) (L := L) (pi0 := pi0) (sigma0 := sigma0) s
(primitives (admissibleImage_coreParameterDomain hs)).spectralRun s hs
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.exactRealSpectralRun · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:432

Instructions used to form all coordinates of the empirical summary. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
n dx dz :
netSummaryTrace n dx dz :
replicate (n * (4 * dz * dx + dx)) .arithmetic
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.netSummaryTrace · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:440

Instructions used by the actual fold over the representative list. Each distance evaluates four fixed-dimensional operator norms, its scalar coordinate arithmetic, and one comparison. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz n :
L pi0 sigma0 :
A :
NetLibrary k dx dz n L pi0 sigma0
netSearchTrace A :
A.indexList.flatMap fun _
=> replicate (4 * dz * dx + dx) .arithmetic ++ replicate 4 .singularValue ++ [.comparison]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.netSearchTrace · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:444

The result and exact primitive trace of the finite-library program. It uses the supplied parameters.

Definition (Lean source)
k dx dz n :
L pi0 sigma0 :
A :
NetLibrary k dx dz n L pi0 sigma0
selected :
Option A.index
law :
AtomicLaw.LawModulo k (effectRadius dz L sigma0)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.NetProgramResult · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:452

The operationally linked exact-real program: form the summary, exhaustively scan the finite library, then run singular-value thresholding and fixed-degree root isolation only at the selected representative. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz n :
L pi0 sigma0 :
primitives :
A :
NetLibrary k dx dz n L pi0 sigma0
sample :
Fin n → Obs dx dz
netExactRealProgram primitives A sample :
baseTrace :
match hsel : nearestLibraryIndex A (empSummary sample) with | none
=> { selected := none law := AtomicLaw.LawModulo.deltaZeroLaw A.k_pos A.radius_nonneg trace := baseTrace } | some i => let run := exactRealSpectralRun primitives (A.summary i) (A.representative_feasible i) { selected := some i law := run.output.effectLaw trace := baseTrace ++ run.trace }
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.netExactRealProgram · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:459
def netLawEstimator

The advised finite-library estimator is the output of the explicit exhaustive-search and spectral program; the only advice is the representative-summary library. @realizes ν^nnet\widehat\nu_n^{\mathrm{net}}(nearest finite-library law) For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz n :
L pi0 sigma0 :
primitives :
A :
NetLibrary k dx dz n L pi0 sigma0
sample :
Fin n → Obs dx dz
netLawEstimator primitives A sample :
AtomicLaw.LawModulo k (effectRadius dz L sigma0)
(netExactRealProgram primitives A sample).law
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.netLawEstimator · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:478

The operation count is computed from the trace of the very execution producing the estimate. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz n :
L pi0 sigma0 :
primitives :
A :
NetLibrary k dx dz n L pi0 sigma0
sample :
Fin n → Obs dx dz
netOperationCount primitives A sample :
netTraceCost (netExactRealProgram primitives A sample).trace
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.netOperationCount · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:488
theorem trace_eq_fixed

A completed primitive run has the fixed five-operation spectral tail. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
s :
run :
ExactRealSpectralRun (k := k) (L := L) (pi0 := pi0) (sigma0 := sigma0) s
run.trace = replicate 3 .singularValue ++ [.rootIsolation, .arithmetic]
Proof (Lean source)
lemma ExactRealSpectralRun.trace_eq_fixed {k dx dz : ℕ} {L pi0 sigma0 : ℝ} {s : SummarySpace dx dz} (run : ExactRealSpectralRun (k := k) (L := L) (pi0 := pi0) (sigma0 := sigma0) s) : run.trace = replicate 3 .singularValue ++ [.rootIsolation, .arithmetic] := by unfold ExactRealSpectralRun.trace rw [run.signal.trace_eq, run.roots.trace_eq]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ExactRealSpectralRun.trace_eq_fixed · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:495
theorem netExactRealProgram_trace_eq

The operational program trace is definitionally linked to the selected primitive run. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 :
primitives :
A :
NetLibrary k dx dz n L pi0 sigma0
sample :
Fin n → Obs dx dz
(netExactRealProgram primitives A sample).trace
= netSummaryTrace n dx dz ++ netSearchTrace A ++ match (netExactRealProgram primitives A sample).selected with | none => [] | some i => (exactRealSpectralRun primitives (A.summary i) (A.representative_feasible i)).trace
Proof (Lean source)
lemma netExactRealProgram_trace_eq {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} (primitives : ExactRealPrimitives) (A : NetLibrary k dx dz n L pi0 sigma0) (sample : Fin n → Obs dx dz) : (netExactRealProgram primitives A sample).trace = netSummaryTrace n dx dz ++ netSearchTrace A ++ match (netExactRealProgram primitives A sample).selected with | none => [] | some i => (exactRealSpectralRun primitives (A.summary i) (A.representative_feasible i)).trace := by unfold netExactRealProgram split <;> simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.netExactRealProgram_trace_eq · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:503
theorem netLawEstimator_eq_of_selected

On a successful exhaustive selection, the returned law is exactly the law produced by the result-bearing spectral run at that selected representative. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 :
primitives :
A :
NetLibrary k dx dz n L pi0 sigma0
sample :
Fin n → Obs dx dz
i :
A.index
hsel :
(netExactRealProgram primitives A sample).selected = some i
netLawEstimator primitives A sample
= (exactRealSpectralRun primitives (A.summary i) (A.representative_feasible i)).output.effectLaw
Proof (Lean source)
lemma netLawEstimator_eq_of_selected {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} (primitives : ExactRealPrimitives) (A : NetLibrary k dx dz n L pi0 sigma0) (sample : Fin n → Obs dx dz) (i : A.index) (hsel : (netExactRealProgram primitives A sample).selected = some i) : netLawEstimator primitives A sample = (exactRealSpectralRun primitives (A.summary i) (A.representative_feasible i)).output.effectLaw := by unfold netLawEstimator unfold netExactRealProgram at hsel ⊢ split at * · simp_all · rename_i j hj change some j = some i at hsel have hji : j = i := Option.some.inj hsel subst i rfl
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.netLawEstimator_eq_of_selected · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:517
theorem exactRealSpectralRun_output_valid

Every result-bearing spectral execution returns a valid representative law. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
primitives :
s :
hs :
s ∈ admissibleImage k dx dz L pi0 sigma0
AtomicLaw.Valid ((exactRealSpectralRun primitives s hs).output.effectLaw.representative.1)
Proof (Lean source)
lemma exactRealSpectralRun_output_valid {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (primitives : ExactRealPrimitives) (s : SummarySpace dx dz) (hs : s ∈ admissibleImage k dx dz L pi0 sigma0) : AtomicLaw.Valid ((exactRealSpectralRun primitives s hs).output.effectLaw.representative.1) := by exact (exactRealSpectralRun primitives s hs).output.effectLaw.representative.2
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.exactRealSpectralRun_output_valid · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:537

A concrete structured-lattice estimator interface. It uses the supplied parameters.

Definition (Lean source)
k dx dz n :
radius :
summaryRule :
SummarySpace dx dz → AtomicLaw.LawModulo k radius
summaryRule_measurable :
Measurable summaryRule
estimate :
(Fin n → Obs dx dz) → AtomicLaw.LawModulo k radius
measurable :
Measurable estimate
atomFloor :
atomFloor_valid :
∀ sample, AtomicLaw.AtomFloor atomFloor (estimate sample).representative.1
estimate_eq :
estimate = fun sample => summaryRule (empSummary sample)
candidateCount :
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.LatticeEstimator · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:545
def latticeOperationCount

The exhaustive-search work count: one pass over the sample and one fixed-dimensional criterion evaluation for every enumerated lattice point. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz n :
radius :
A :
LatticeEstimator k dx dz n radius
latticeOperationCount A :
n + A.candidateCount
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.latticeOperationCount · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:557

One point in the prescribed no-advice product lattice. It uses the supplied parameters.

Definition (Lean source)
k dx :
radius :
gridBasis :
V :
R :
weight :
Fin k → ℝ
effect :
Fin k → ℝ
lawValid :
AtomicLaw.Valid (⟨weight, effect⟩ : AtomicLaw k radius)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.StructuredLatticePoint · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:563
def latticeHeight

For the supplied parameters, lattice Height is given by its defining clause.

Definition (Lean source)
k dx n :
pi0 sigma0 :
latticeHeight k dx n pi0 sigma0 :
⌈Real.sqrt n⌉₊ + ⌈pi0⁻¹⌉₊ + 2 * k + ⌈4 * sqrt (dx * k)⌉₊ + ⌈2 * k / sigma0⌉₊
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.latticeHeight · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:572
def latticeMesh

For the supplied parameters, lattice Mesh is given by its defining clause.

Definition (Lean source)
k dx n :
pi0 sigma0 :
latticeMesh k dx n pi0 sigma0 :
(latticeHeight k dx n pi0 sigma0 : ℝ)⁻¹
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.latticeMesh · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:577

The displayed constant C_lat from the structured-lattice construction. @realizes ClatC_{\mathrm{lat}}(explicit positive structured-lattice constant) For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz :
L pi0 sigma0 :
prescribedLatticeConstant k dx dz L pi0 sigma0 :
Ltau :
effectRadius dz L sigma0
s0 :
pi0 * sigma0 ^ 2
cV :
4 * sqrt (dx * k)
KD :
4 * sqrt k * L * Ltau / sigma0
AD :
8 / (3 * s0) + 32 * L / s0 ^ 2
Kf :
16 * sqrt dx * k * L ^ 2 / sigma0 ^ 2
cD :
2 * KD * cV
+ 4 * k * sqrt k * L * Ltau / sigma0 ^ 2
+ 2 * sqrt k * L / sigma0
+ k * Ltau / sigma0
cm :
2 * sqrt k * L * cV + k + k * L
cb :
k + 2 * sqrt k * L * cV
cgrid :
cD + cm + cb
Blat :
2 * (AD + 1) + cgrid
max (8 * Ltau / s0) ((Ltau + KD + L * Kf) * Blat)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.prescribedLatticeConstant · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:581

For the supplied parameters, Threshold Recovers Matrix Dimension is given by its defining clause.

Definition (Lean source)
rows cols :
k :
threshold :
G :
RectMatrix rows cols
ThresholdRecoversMatrixDimension k threshold G :
Prop
clause 1
j :
j < k
threshold ≤ singularValue G j
clause 2
j :
k ≤ j
singularValue G j < threshold
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ThresholdRecoversMatrixDimension · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:599
def ThresholdRecoversDimension

For the supplied parameters, Threshold Recovers Dimension is given by its defining clause.

Definition (Lean source)
dx dz :
k :
threshold :
s :
ThresholdRecoversDimension k threshold s :
Prop
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ThresholdRecoversDimension · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:605
theorem inverseGramSqrt_exists

Inverse gram sqrt exists: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx :
G :
_hG :
1 / 2 ≤ signalMinSingular G
∃ H : RectMatrix k k,
conclusion 1
H.PosSemidef
conclusion 2
H * H = (G.transpose * G)⁻¹
Proof (Lean source)
lemma inverseGramSqrt_exists {k dx : ℕ} (G : RectMatrix dx k) (_hG : 1 / 2 ≤ signalMinSingular G) : ∃ H : RectMatrix k k, H.PosSemidef ∧ H * H = (G.transpose * G)⁻¹ := by have hgram : (G.transpose * G).PosSemidef := by rw [← Matrix.conjTranspose_eq_transpose_of_trivial G] exact Matrix.posSemidef_conjTranspose_mul_self G have hinv : ((G.transpose * G)⁻¹).PosSemidef := hgram.inv refine ⟨CFC.sqrt ((G.transpose * G)⁻¹), ?_, ?_⟩ · exact Matrix.nonneg_iff_posSemidef.mp (CFC.sqrt_nonneg _) · simpa [pow_two] using CFC.sq_sqrt ((G.transpose * G)⁻¹)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.inverseGramSqrt_exists · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:611
def inverseGramSqrt

The inverse positive square root of the Gram matrix used in the paper's polar factor. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx :
G :
hG :
1 / 2 ≤ signalMinSingular G
inverseGramSqrt G hG :
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.inverseGramSqrt · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:623
def prescribedPolarFactor

The unique prescribed polar-factor basis G (G^T G)^(-1/2). For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx :
G :
hG :
1 / 2 ≤ signalMinSingular G
prescribedPolarFactor G hG :
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.prescribedPolarFactor · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:628
def WellFormed

Exact grid, polar-factor, conditioning, simplex-floor, and clipped-support constraints. For the ambient setting, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz n :
L pi0 sigma0 :
θ :
WellFormed θ :
Prop
H :
latticeHeight k dx n pi0 sigma0
q :
latticeMesh k dx n pi0 sigma0
i j :
∃ z : ℤ,
θ.gridBasis i j = q * z
|θ.gridBasis i j| ≤ 1
∃ hG : 1 / 2 ≤ signalMinSingular θ.gridBasis, θ.V = prescribedPolarFactor θ.gridBasis hG
i j :
∑ a, θ.V a i * θ.V a j = if i = j then 1 else 0
i j :
∃ z : ℤ, θ.R i j = q * z
sigma0 / 2 ≤ signalMinSingular θ.R
‖matrixCLM θ.R‖ ≤ 2 * sqrt k * L
∃ a : Fin k → ℕ,
u :
⌈pi0 * H⌉₊ ≤ a u
θ.weight u = a u / H
∑ u, a u = H
u :
θ.effect u ∈ Icc (-effectRadius dz L sigma0) (effectRadius dz L sigma0)
∃ z : ℤ, θ.effect u = q * z
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.StructuredLatticePoint.WellFormed · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:633
def structuredCandidateOperator

For the ambient setting, structured Candidate Operator is given by its defining clause.

Definition (Lean source)
k dx :
radius :
θ :
structuredCandidateOperator θ :
θ.V * θ.R⁻¹ * diagonal θ.effect * θ.R * θ.V.transpose
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredCandidateOperator · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:649
def empiricalCompressedOperator

For the supplied parameters, empirical Compressed Operator is given by its defining clause.

Definition (Lean source)
dx dz :
threshold :
s :
empiricalCompressedOperator threshold s :
thresholdedPenroseInverse threshold s.M1 * s.N1
- thresholdedPenroseInverse threshold s.M0 * s.N0
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.empiricalCompressedOperator · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:654
def structuredLatticeCriterion

For the supplied parameters, structured Lattice Criterion is given by its defining clause.

Definition (Lean source)
k dx dz :
radius :
threshold :
s :
θ :
structuredLatticeCriterion threshold s θ :
‖matrixCLM (structuredCandidateOperator θ - empiricalCompressedOperator threshold s)‖
+ sqrt (∑ i, ((∑ u, θ.V i u * (∑ v, θ.R v u * θ.weight v)) - s.mX i) ^ 2)
+ sqrt (∑ u, ((∑ v, θ.R u v * (∑ i, θ.V i v * firstBasis dx i)) - 1) ^ 2)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredLatticeCriterion · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:660
def effectLaw

For the ambient setting, effect Law is given by its defining clause.

Definition (Lean source)
k dx :
radius :
θ :
effectLaw θ :
AtomicLaw.LawModulo k radius
AtomicLaw.LawModulo.ofProbabilityLaw ⟨⟨θ.weight, θ.effect⟩, θ.lawValid⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.StructuredLatticePoint.effectLaw · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:668
def structuredLatticeLexKey

For the ambient setting, structured Lattice Lex Key is given by its defining clause.

Definition (Lean source)
k dx :
radius :
θ :
structuredLatticeLexKey θ :
List
(Finset.univ.toList.flatMap fun i : Fin dx => Finset.univ.toList.map fun j : Fin k => θ.V i j) ++ (Finset.univ.toList.flatMap fun i : Fin k => Finset.univ.toList.map fun j : Fin k => θ.R i j) ++ (Finset.univ.toList.map fun i : Fin k => θ.weight i) ++ (Finset.univ.toList.map fun i : Fin k => θ.effect i)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredLatticeLexKey · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:673
def LexLE

For the ambient setting, Lex LE is given by its defining clause.

Definition (Lean source)
k dx :
radius :
θ φ :
LexLE θ φ :
Prop
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.StructuredLatticePoint.LexLE · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:683

The estimator is exactly the first minimizer of the displayed H_n/q_n lattice, its candidate count is an actual exhaustive list size, and its runtime accounts for that search. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz n :
L pi0 sigma0 :
A :
LatticeEstimator k dx dz n (effectRadius dz L sigma0)
IsPrescribedStructuredLattice A :
Prop
∃ (candidate : Fin A.candidateCount → StructuredLatticePoint k dx (effectRadius dz L sigma0)) (first : (Fin n → Obs dx dz) → Fin A.candidateCount),
clause 1
i :
StructuredLatticePoint.WellFormed (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0) (candidate i)
clause 2
θ :
StructuredLatticePoint.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0) θ
∃ i,
(candidate i).V = θ.V
(candidate i).R = θ.R
(candidate i).weight = θ.weight
(candidate i).effect = θ.effect
clause 3
i j :
(candidate i).V = (candidate j).V
(candidate i).R = (candidate j).R
(candidate i).weight = (candidate j).weight
(candidate i).effect = (candidate j).effect
i = j
clause 4
i j :
i ≤ j ↔ StructuredLatticePoint.LexLE (candidate i) (candidate j)
clause 5
sample i :
structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) (empSummary sample) (candidate (first sample))
structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) (empSummary sample) (candidate i)
clause 6
sample i :
structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) (empSummary sample) (candidate (first sample))
= structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) (empSummary sample) (candidate i)
first sample ≤ i
clause 7
A.estimate = fun sample => (candidate (first sample)).effectLaw
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.IsPrescribedStructuredLattice · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/LatticeEstimator.lean:689

The explicit lattice-law output. @realizes λ^n\widehat\lambda_n(no-advice lattice estimate) For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz n :
radius :
A :
LatticeEstimator k dx dz n radius
latticeLaw A :
(Fin n → Obs dx dz) → AtomicLaw.LawModulo k radius
A.estimate
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.ModelRealDiagonalization 8 declarations Uniformly conditioned ambient real diagonalizations built from a model's thin target-feature singular-value decomposition and an orthonormal kernel complement.

Uniformly conditioned ambient real diagonalizations built from a model's thin target-feature singular-value decomposition and an orthonormal kernel complement.

structure ThinSignalFactorization

For the supplied parameters, Thin Signal Factorization is the stated data structure.

Definition (Lean source)
dx k :
B :
V :
coord :
coordInv :
factor :
B = V.V * coord
coord_mul_inv :
coord * coordInv = 1
inv_mul_coord :
coordInv * coord = 1
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ThinSignalFactorization · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelRealDiagonalization.lean:18
def thinSignalFactorization

For the supplied parameters, thin Signal Factorization is given by its defining clause.

Definition (Lean source)
dx k :
B :
hpos :
∀ r : Fin k, 0 < (singularSystem B).sigma r
thinSignalFactorization B hpos :
by let S := singularSystem B let V : SignalBasis dx k := { V := fun i r => S.left r i orthonormal := fun r s => S.left_orthonormal_of_pos r s (hpos r) (hpos s) } let C : RectMatrix k k := fun r j
=> S.sigma r * S.right r j let Cinv : RectMatrix k k := fun j r => S.right r j * (S.sigma r)⁻¹ have hfactor : B = V.V * C := by ext i j simp only [V, C, Matrix.mul_apply] rw [S.expansion] apply Finset.sum_congr rfl intro r _ ring have hmul : C * Cinv = 1 := by ext r s simp only [C, Cinv, Matrix.mul_apply, Matrix.one_apply] by_cases hrs : r = s · subst s rw [if_pos rfl] calc (∑ x, S.sigma r * S.right r x * (S.right r x * (S.sigma r)⁻¹)) = (S.sigma r * (S.sigma r)⁻¹) * ∑ x, S.right r x * S.right r x := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro x _ ring _ = 1 := by rw [mul_inv_cancel₀ (ne_of_gt (hpos r)), S.right_orthonormal r r]; simp · rw [if_neg hrs] calc (∑ x, S.sigma r * S.right r x * (S.right s x * (S.sigma s)⁻¹)) = (S.sigma r * (S.sigma s)⁻¹) * ∑ x, S.right r x * S.right s x := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro x _ ring _ = 0 := by rw [S.right_orthonormal r s, if_neg hrs]; ring exact ⟨V, C, Cinv, hfactor, hmul, (mul_eq_one_comm.mp hmul)⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.thinSignalFactorization · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelRealDiagonalization.lean:28
theorem transpose_mul_self

Transpose mul self: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
V :
V.V.transpose * V.V = (1 : RectMatrix k k)
Proof (Lean source)
lemma SignalBasis.transpose_mul_self {dx k : ℕ} (V : SignalBasis dx k) : V.V.transpose * V.V = (1 : RectMatrix k k) := by ext i j simpa [Matrix.mul_apply, Matrix.one_apply] using V.orthonormal i j
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.SignalBasis.transpose_mul_self · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelRealDiagonalization.lean:71
def forward

For the supplied parameters, forward is given by its defining clause.

Definition (Lean source)
dx k :
forward F :
F.V.V * F.coordInv.transpose * F.V.V.transpose + (1 - F.V.V * F.V.V.transpose)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ThinSignalFactorization.forward · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelRealDiagonalization.lean:78
def backward

For the supplied parameters, backward is given by its defining clause.

Definition (Lean source)
dx k :
backward F :
F.V.V * F.coord.transpose * F.V.V.transpose + (1 - F.V.V * F.V.V.transpose)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ThinSignalFactorization.backward · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelRealDiagonalization.lean:85
theorem forward_mul_backward

Forward mul backward: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
F.forward * F.backward = 1
Proof (Lean source)
lemma ThinSignalFactorization.forward_mul_backward {dx k : ℕ} {B : RectMatrix dx k} (F : ThinSignalFactorization B) : F.forward * F.backward = 1 := by let V := F.V.V let K : RectMatrix dx dx := 1 - V * V.transpose have hgram : V.transpose * V = (1 : RectMatrix k k) := F.V.transpose_mul_self have hci : F.coordInv.transpose * F.coord.transpose = (1 : RectMatrix k k) := by simpa only [Matrix.transpose_mul, Matrix.transpose_one] using congrArg Matrix.transpose F.coord_mul_inv have hVK : V.transpose * K = 0 := by calc V.transpose * K = V.transpose - (V.transpose * V) * V.transpose := by rw [Matrix.mul_sub, Matrix.mul_one, Matrix.mul_assoc] _ = 0 := by rw [hgram, Matrix.one_mul, sub_self] have hKV : K * V = 0 := by calc K * V = V - V * (V.transpose * V) := by rw [Matrix.sub_mul, Matrix.one_mul, Matrix.mul_assoc] _ = 0 := by rw [hgram, Matrix.mul_one, sub_self] have hKK : K * K = K := by calc K * K = (1 - V * V.transpose) * K := by rfl _ = K - V * (V.transpose * K) := by rw [Matrix.sub_mul, Matrix.one_mul, Matrix.mul_assoc] _ = K := by rw [hVK, Matrix.mul_zero, sub_zero] let A := V * F.coordInv.transpose * V.transpose let D := V * F.coord.transpose * V.transpose have hAD : A * D = V * V.transpose := by simp only [A, D, Matrix.mul_assoc] rw [← Matrix.mul_assoc V.transpose V, hgram, Matrix.one_mul, ← Matrix.mul_assoc F.coordInv.transpose F.coord.transpose, hci, Matrix.one_mul] have hAK : A * K = 0 := by simp [A, Matrix.mul_assoc, hVK] have hKD : K * D = 0 := by simp [D, ← Matrix.mul_assoc, hKV] change (A + K) * (D + K) = 1 rw [Matrix.add_mul, Matrix.mul_add, Matrix.mul_add, hAD, hAK, hKD, hKK] simp [K]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ThinSignalFactorization.forward_mul_backward · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelRealDiagonalization.lean:92
theorem backward_mul_forward

Backward mul forward: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
F.backward * F.forward = 1
Proof (Lean source)
lemma ThinSignalFactorization.backward_mul_forward {dx k : ℕ} {B : RectMatrix dx k} (F : ThinSignalFactorization B) : F.backward * F.forward = 1 := by let V := F.V.V let K : RectMatrix dx dx := 1 - V * V.transpose have hgram : V.transpose * V = (1 : RectMatrix k k) := F.V.transpose_mul_self have hci : F.coord.transpose * F.coordInv.transpose = (1 : RectMatrix k k) := by simpa only [Matrix.transpose_mul, Matrix.transpose_one] using congrArg Matrix.transpose F.inv_mul_coord have hVK : V.transpose * K = 0 := by calc V.transpose * K = V.transpose - (V.transpose * V) * V.transpose := by rw [Matrix.mul_sub, Matrix.mul_one, Matrix.mul_assoc] _ = 0 := by rw [hgram, Matrix.one_mul, sub_self] have hKV : K * V = 0 := by calc K * V = V - V * (V.transpose * V) := by rw [Matrix.sub_mul, Matrix.one_mul, Matrix.mul_assoc] _ = 0 := by rw [hgram, Matrix.mul_one, sub_self] have hKK : K * K = K := by calc K * K = (1 - V * V.transpose) * K := by rfl _ = K - V * (V.transpose * K) := by rw [Matrix.sub_mul, Matrix.one_mul, Matrix.mul_assoc] _ = K := by rw [hVK, Matrix.mul_zero, sub_zero] let A := V * F.coord.transpose * V.transpose let D := V * F.coordInv.transpose * V.transpose have hAD : A * D = V * V.transpose := by simp only [A, D, Matrix.mul_assoc] rw [← Matrix.mul_assoc V.transpose V, hgram, Matrix.one_mul, ← Matrix.mul_assoc F.coord.transpose F.coordInv.transpose, hci, Matrix.one_mul] have hAK : A * K = 0 := by simp [A, Matrix.mul_assoc, hVK] have hKD : K * D = 0 := by simp [D, ← Matrix.mul_assoc, hKV] change (A + K) * (D + K) = 1 rw [Matrix.add_mul, Matrix.mul_add, Matrix.mul_add, hAD, hAK, hKD, hKK] simp [K]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ThinSignalFactorization.backward_mul_forward · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelRealDiagonalization.lean:131
def linearEquiv

For the supplied parameters, linear Equiv is given by its defining clause.

Definition (Lean source)
dx k :
linearEquiv F :
Euc dx ≃ₗ[ℝ] Euc dx
by apply LinearEquiv.ofLinear (toEuclideanLin F.forward) (toEuclideanLin F.backward) · apply LinearMap.ext intro x apply PiLp.ext intro i simpa [LinearMap.comp_apply, Matrix.toEuclideanLin_apply, Matrix.mulVec_mulVec] using congrArg (fun M : RectMatrix dx dx => mulVec M x.ofLp i) F.forward_mul_backward · apply LinearMap.ext intro x apply PiLp.ext intro i simpa [LinearMap.comp_apply, Matrix.toEuclideanLin_apply, Matrix.mulVec_mulVec] using congrArg (fun M : RectMatrix dx dx => mulVec M x.ofLp i) F.backward_mul_forward
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ThinSignalFactorization.linearEquiv · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelRealDiagonalization.lean:170
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.ModelSpectralCertificate 2 declarations The model-local bounded real-diagonalization certificate used by the gap-free modulus.

The model-local bounded real-diagonalization certificate used by the gap-free modulus.

theorem targetFeature_entry_bound

Target feature entry bound: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hL :
1 ≤ L
hpi :
0 < pi0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
i :
Fin dx
u :
Fin k
|targetFeature P i u| ≤ L
Proof (Lean source)
lemma targetFeature_entry_bound {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hk : 2 ≤ k) (hkx : k ≤ dx) (hL : 1 ≤ L) (hpi : 0 < pi0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (i : Fin dx) (u : Fin k) : |targetFeature P i u| ≤ L := by have hclass : 0 < P (latentClass u) := lt_of_lt_of_le (latentCell_pos_of_latentArmPositivity P hpi hM.latentArmPositivity u false) (MeasureTheory.measure_mono fun _ hw => hw.1) let mu := normalizedRestrict P (latentClass u) let _ : IsProbabilityMeasure mu := normalizedRestrict_isProbabilityMeasure (measurableSet_latentClass u) hclass have hboundP := (proxy_coordinate_bounds_of_model P hk hkx hM).1 have hbound : ∀ᵐ w ∂mu, |w.X i| ≤ L := (ae_normalizedRestrict_iff hclass).mpr <| MeasureTheory.ae_restrict_of_ae (hboundP.mono fun w hw => hw i) have hint : Integrable (fun w : FullData k dx dz => w.X i) mu := MeasureTheory.Integrable.of_bound ((measurable_pi_apply i).comp measurable_fullData_X).aestronglyMeasurable L hbound rw [targetFeature, conditionalMean_eq_normalizedRestrictedIntegral hclass] unfold normalizedRestrictedIntegral calc |∫ w, w.X i ∂mu| ≤ ∫ w, |w.X i| ∂mu := MeasureTheory.abs_integral_le_integral_abs _ ≤ ∫ _w, L ∂mu := MeasureTheory.integral_mono_ae hint.abs (MeasureTheory.integrable_const L) hbound _ = L := by simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.targetFeature_entry_bound · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralCertificate.lean:15
theorem model_realDiagonalization_certificate

Model real diagonalization certificate: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hsigma :
0 < sigma0
hsigmaMax :
sigma0 ≤ 1
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
∃ D : RealDiagonalization (AmbientOperatorBridge.ambientEffectOperator (obsSummary P)),
conclusion 1
D.conditionNumber ≤ conditionBound dx k L sigma0
conclusion 2
D.SpectrumBound (effectRadius dz L sigma0)
conclusion 3
RepresentsAtomicLaw D (toLp 2 (obsSummary P).mX) (toLp 2 (firstBasis dx)) (GapFreeModulusBridge.asNeutral (quotientLawRaw P (effectRadius dz L sigma0)))
Proof (Lean source)
theorem model_realDiagonalization_certificate {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hpiMax : pi0 ≤ 1 / (2 * k : ℝ)) (hsigma : 0 < sigma0) (hsigmaMax : sigma0 ≤ 1) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) : ∃ D : RealDiagonalization (AmbientOperatorBridge.ambientEffectOperator (obsSummary P)), D.conditionNumber ≤ conditionBound dx k L sigma0 ∧ D.SpectrumBound (effectRadius dz L sigma0) ∧ RepresentsAtomicLaw D (toLp 2 (obsSummary P).mX) (toLp 2 (firstBasis dx)) (GapFreeModulusBridge.asNeutral (quotientLawRaw P (effectRadius dz L sigma0))) := by let B := targetFeature P have hsle (r : Fin k) : sigma0 ≤ (singularSystem B).sigma r := by rw [(singularSystem B).sigma_eq] exact hM.proxyRankMargin.2.2.trans <| (toEuclideanLin B).singularValues_antitone <| by simpa using Nat.le_sub_one_of_lt r.isLt have hpos (r : Fin k) : 0 < (singularSystem B).sigma r := hsigma.trans_le (hsle r) let F := thinSignalFactorization B hpos letI : Nonempty (Fin k) := ⟨⟨0, by omega⟩⟩ have hop : F.factorOperator (latentEffect P) = AmbientOperatorBridge.ambientEffectOperator (obsSummary P) := by calc F.factorOperator (latentEffect P) = (moorePenroseInverse B).transpose * diagonal (latentEffect P) * B.transpose := factorOperator_eq_moorePenrose F _ _ = AmbientOperatorBridge.ambientEffectOperator (obsSummary P) := (AmbientOperatorBridge.model_ambientEffectOperator_factorization P hk hkx hL hpi hsigma hM).symm rw [← hop] let D := F.realDiagonalization (latentEffect P) refine ⟨D, ?_, ?_, ?_⟩ · apply F.diagonalization_conditionNumber_le (latentEffect P) (by linarith) hsigma (fun i u => targetFeature_entry_bound P hk hkx hL hpi hM i u) (fun i j => thinSignalFactorization_coordInv_entry_bound B hpos hsigma hsle i j) omega · intro i by_cases hi : i ∈ range F.V.ambientExtension.signalIndex · obtain ⟨u, rfl⟩ := hi rw [show D.eigenvalue (F.V.ambientExtension.signalIndex u) = latentEffect P u by exact ambientEigenvalue_signal F.V (latentEffect P) u] exact latentEffect_abs_le_of_model P hk hkx hkz hL hpi hsigma hM u · rw [show D.eigenvalue i = 0 by exact ambientEigenvalue_nonsignal F.V _ i hi] have hr : 0 ≤ effectRadius dz L sigma0 := by unfold effectRadius; positivity simpa using hr · apply AmbientOperatorBridge.represents_raw_quotientLaw D (targetFeature P) (latentMass P) (latentEffect P) · exact congrArg (toLp 2) (AmbientOperatorBridge.obsSummary_mX_factorization P hpi hM) · simpa using AmbientOperatorBridge.targetFeature_transpose_firstBasis P hk hkx hpi hM · intro f hf0 exact realDiagonalization_applyFunction_moorePenrose F (latentEffect P) f hf0 · apply AmbientOperatorBridge.moorePenroseInverse_mul_eq_one_of_injective rw [LinearMap.injective_iff_forall_lt_finrank_singularValues_pos] intro i hi have hik : i ≤ k - 1 := by simpa using (Nat.le_sub_one_of_lt (by simpa using hi)) exact lt_of_lt_of_le (lt_of_lt_of_le hsigma hM.proxyRankMargin.2.2) ((toEuclideanLin (targetFeature P)).singularValues_antitone hik)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.model_realDiagonalization_certificate · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralCertificate.lean:44
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.ModelSpectralConstruction 32 declarations Ambient real diagonalizations and uniform finite-dimensional conditioning bounds built from the model's thin target-feature singular-value factorization.

Ambient real diagonalizations and uniform finite-dimensional conditioning bounds built from the model's thin target-feature singular-value factorization.

structure AmbientExtension

For the supplied parameters, Ambient Extension is the stated data structure.

Definition (Lean source)
dx k :
V :
basis :
OrthonormalBasis (Fin dx) ℝ (Euc dx)
signalIndex :
Fin k ↪ Fin dx
basis_signal :
∀ j, basis (signalIndex j) = toLp 2 (fun i => V.V i j)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AmbientExtension · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralConstruction.lean:14
def ambientExtension

For the supplied parameters, ambient Extension is given by its defining clause.

Definition (Lean source)
dx k :
V :
ambientExtension V :
by let b := choose V.exists_fin_ambient_orthonormalBasis let he := Classical.choose_spec V.exists_fin_ambient_orthonormalBasis let e := choose he exact ⟨b, e, Classical.choose_spec he⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.SignalBasis.ambientExtension · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralConstruction.lean:21
def ambientEigenvalue

For the supplied parameters, ambient Eigenvalue is given by its defining clause.

Definition (Lean source)
dx k :
Nonempty (Fin k)
V :
tau :
Fin k → ℝ
i :
Fin dx
ambientEigenvalue V tau i :
if _h : i ∈ range V.ambientExtension.signalIndex then tau (Function.invFun V.ambientExtension.signalIndex i) else 0
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ambientEigenvalue · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralConstruction.lean:30
theorem ambientEigenvalue_signal

Ambient eigenvalue signal: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
Nonempty (Fin k)
V :
tau :
Fin k → ℝ
j :
Fin k
ambientEigenvalue V tau (V.ambientExtension.signalIndex j) = tau j
Proof (Lean source)
lemma ambientEigenvalue_signal {dx k : ℕ} [Nonempty (Fin k)] (V : SignalBasis dx k) (tau : Fin k → ℝ) (j : Fin k) : ambientEigenvalue V tau (V.ambientExtension.signalIndex j) = tau j := by rw [ambientEigenvalue, dif_pos ⟨j, rfl⟩, Function.leftInverse_invFun V.ambientExtension.signalIndex.injective j]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ambientEigenvalue_signal · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralConstruction.lean:37
theorem ambientEigenvalue_nonsignal

Ambient eigenvalue nonsignal: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
Nonempty (Fin k)
V :
tau :
Fin k → ℝ
i :
Fin dx
hi :
i ∉ range V.ambientExtension.signalIndex
ambientEigenvalue V tau i = 0
Proof (Lean source)
lemma ambientEigenvalue_nonsignal {dx k : ℕ} [Nonempty (Fin k)] (V : SignalBasis dx k) (tau : Fin k → ℝ) (i : Fin dx) (hi : i ∉ range V.ambientExtension.signalIndex) : ambientEigenvalue V tau i = 0 := by simp [ambientEigenvalue, hi]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ambientEigenvalue_nonsignal · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralConstruction.lean:45
def eigenbasis

For the supplied parameters, eigenbasis is given by its defining clause.

Definition (Lean source)
dx k :
eigenbasis F :
Basis (Fin dx) ℝ (Euc dx)
F.V.ambientExtension.basis.toBasis.map F.linearEquiv
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ThinSignalFactorization.eigenbasis · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralConstruction.lean:53
theorem forward_signal

Forward signal: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
j :
Fin k
toEuclideanLin F.forward (toLp 2 (fun i => F.V.V i j))
= toLp 2 (fun i => (F.V.V * F.coordInv.transpose) i j)
Proof (Lean source)
lemma forward_signal {dx k : ℕ} {B : RectMatrix dx k} (F : ThinSignalFactorization B) (j : Fin k) : toEuclideanLin F.forward (toLp 2 (fun i => F.V.V i j)) = toLp 2 (fun i => (F.V.V * F.coordInv.transpose) i j) := by have hgram := F.V.transpose_mul_self have hmat : F.forward * F.V.V = F.V.V * F.coordInv.transpose := by unfold ThinSignalFactorization.forward rw [Matrix.add_mul, Matrix.sub_mul, Matrix.one_mul] simp only [Matrix.mul_assoc] rw [hgram, Matrix.mul_one, Matrix.mul_one, sub_self, add_zero] apply PiLp.ext intro i have hi := congrArg (fun M : RectMatrix dx k => M i j) hmat simpa [Matrix.toEuclideanLin_apply, Matrix.mul_apply, mulVec, dotProduct] using hi
def factorOperator

For the supplied parameters, factor Operator is given by its defining clause.

Definition (Lean source)
dx k :
tau :
Fin k → ℝ
factorOperator F tau :
F.V.V * F.coordInv.transpose * diagonal tau * F.coord.transpose * F.V.V.transpose
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ThinSignalFactorization.factorOperator · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralConstruction.lean:78
theorem factorOperator_mul_signalEigenvectors

Factor operator mul signal eigenvectors: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
tau :
Fin k → ℝ
F.factorOperator tau * (F.V.V * F.coordInv.transpose)
= (F.V.V * F.coordInv.transpose) * diagonal tau
Proof (Lean source)
lemma factorOperator_mul_signalEigenvectors {dx k : ℕ} {B : RectMatrix dx k} (F : ThinSignalFactorization B) (tau : Fin k → ℝ) : F.factorOperator tau * (F.V.V * F.coordInv.transpose) = (F.V.V * F.coordInv.transpose) * diagonal tau := by have hgram := F.V.transpose_mul_self have hci : F.coord.transpose * F.coordInv.transpose = (1 : RectMatrix k k) := by simpa only [Matrix.transpose_mul, Matrix.transpose_one] using congrArg transpose F.inv_mul_coord unfold ThinSignalFactorization.factorOperator simp only [Matrix.mul_assoc] rw [← Matrix.mul_assoc F.V.V.transpose F.V.V F.coordInv.transpose, hgram, Matrix.one_mul, hci, Matrix.mul_one]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.factorOperator_mul_signalEigenvectors · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralConstruction.lean:85
theorem transpose_mul_ambientBasis_nonsignal

Transpose mul ambient basis nonsignal: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
V :
i :
Fin dx
hi :
i ∉ range V.ambientExtension.signalIndex
mulVec V.V.transpose (V.ambientExtension.basis i).ofLp = 0
Proof (Lean source)
lemma transpose_mul_ambientBasis_nonsignal {dx k : ℕ} (V : SignalBasis dx k) (i : Fin dx) (hi : i ∉ range V.ambientExtension.signalIndex) : mulVec V.V.transpose (V.ambientExtension.basis i).ofLp = 0 := by ext j have hne : V.ambientExtension.signalIndex j ≠ i := fun h => hi ⟨j, h⟩ have horth := V.ambientExtension.basis.orthonormal rw [orthonormal_iff_ite] at horth have horth := horth (V.ambientExtension.signalIndex j) i rw [if_neg hne] at horth rw [V.ambientExtension.basis_signal j] at horth simpa [mulVec, dotProduct, PiLp.inner_apply, RCLike.inner_apply, conj_trivial, mul_comm] using horth
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.transpose_mul_ambientBasis_nonsignal · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralConstruction.lean:101
theorem forward_ambientBasis_nonsignal

Forward ambient basis nonsignal: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
i :
Fin dx
hi :
i ∉ range F.V.ambientExtension.signalIndex
toEuclideanLin F.forward (F.V.ambientExtension.basis i)
= F.V.ambientExtension.basis i
Proof (Lean source)
lemma forward_ambientBasis_nonsignal {dx k : ℕ} {B : RectMatrix dx k} (F : ThinSignalFactorization B) (i : Fin dx) (hi : i ∉ range F.V.ambientExtension.signalIndex) : toEuclideanLin F.forward (F.V.ambientExtension.basis i) = F.V.ambientExtension.basis i := by have hzero := transpose_mul_ambientBasis_nonsignal F.V i hi apply PiLp.ext intro a simp only [ThinSignalFactorization.forward, Matrix.toEuclideanLin_apply] change mulVec (F.V.V * F.coordInv.transpose * F.V.V.transpose + (1 - F.V.V * F.V.V.transpose)) (F.V.ambientExtension.basis i).ofLp a = _ have hp : mulVec (F.V.V * F.V.V.transpose) (F.V.ambientExtension.basis i).ofLp = 0 := by rw [← Matrix.mulVec_mulVec, hzero] simp rw [Matrix.add_mulVec, Matrix.sub_mulVec, Matrix.one_mulVec, ← Matrix.mulVec_mulVec, hzero, hp] simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.forward_ambientBasis_nonsignal · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralConstruction.lean:116
theorem factorOperator_eigenbasis

Factor operator eigenbasis: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
Nonempty (Fin k)
tau :
Fin k → ℝ
i :
toEuclideanLin (F.factorOperator tau) (F.eigenbasis i)
= ambientEigenvalue F.V tau i • F.eigenbasis i
Proof (Lean source)
lemma factorOperator_eigenbasis {dx k : ℕ} [Nonempty (Fin k)] {B : RectMatrix dx k} (F : ThinSignalFactorization B) (tau : Fin k → ℝ) : ∀ i, toEuclideanLin (F.factorOperator tau) (F.eigenbasis i) = ambientEigenvalue F.V tau i • F.eigenbasis i := by intro i by_cases hi : i ∈ range F.V.ambientExtension.signalIndex · obtain ⟨j, rfl⟩ := hi rw [ambientEigenvalue_signal] change toEuclideanLin (F.factorOperator tau) (F.linearEquiv (F.V.ambientExtension.basis.toBasis (F.V.ambientExtension.signalIndex j))) = tau j • F.linearEquiv (F.V.ambientExtension.basis.toBasis (F.V.ambientExtension.signalIndex j)) rw [show F.V.ambientExtension.basis.toBasis (F.V.ambientExtension.signalIndex j) = toLp 2 (fun i => F.V.V i j) by exact F.V.ambientExtension.basis_signal j] change toEuclideanLin (F.factorOperator tau) (toEuclideanLin F.forward (toLp 2 (fun i => F.V.V i j))) = tau j • toEuclideanLin F.forward (toLp 2 (fun i => F.V.V i j)) rw [forward_signal] apply PiLp.ext intro a have hmat := factorOperator_mul_signalEigenvectors F tau have ha := congrArg (fun M : RectMatrix dx k => M a j) hmat simpa [Matrix.toEuclideanLin_apply, mulVec, dotProduct, Matrix.mul_apply, Matrix.diagonal_apply, mul_comm] using ha · rw [ambientEigenvalue_nonsignal F.V tau i hi, zero_smul] change toEuclideanLin (F.factorOperator tau) (F.linearEquiv (F.V.ambientExtension.basis.toBasis i)) = 0 change toEuclideanLin (F.factorOperator tau) (toEuclideanLin F.forward (F.V.ambientExtension.basis i)) = 0 rw [forward_ambientBasis_nonsignal F i hi] have hzero := transpose_mul_ambientBasis_nonsignal F.V i hi apply PiLp.ext intro a simp only [ThinSignalFactorization.factorOperator, Matrix.toEuclideanLin_apply] simp only [← Matrix.mulVec_mulVec] rw [hzero] simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.factorOperator_eigenbasis · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralConstruction.lean:139
def realDiagonalization

For the supplied parameters, real Diagonalization is given by its defining clause.

Definition (Lean source)
dx k :
Nonempty (Fin k)
tau :
Fin k → ℝ
realDiagonalization F tau :
RealDiagonalization (F.factorOperator tau)
realDiagonalizationOfEigenbasis (F.factorOperator tau) F.eigenbasis (ambientEigenvalue F.V tau) (factorOperator_eigenbasis F tau)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ThinSignalFactorization.realDiagonalization · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralConstruction.lean:184
theorem ambientEigenvalue_comp

Ambient eigenvalue comp: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
Nonempty (Fin k)
V :
tau :
Fin k → ℝ
f :
ℝ → ℝ
hf0 :
f 0 = 0
i :
Fin dx
ambientEigenvalue V (f ∘ tau) i = f (ambientEigenvalue V tau i)
Proof (Lean source)
lemma ambientEigenvalue_comp {dx k : ℕ} [Nonempty (Fin k)] (V : SignalBasis dx k) (tau : Fin k → ℝ) (f : ℝ → ℝ) (hf0 : f 0 = 0) (i : Fin dx) : ambientEigenvalue V (f ∘ tau) i = f (ambientEigenvalue V tau i) := by by_cases hi : i ∈ range V.ambientExtension.signalIndex · obtain ⟨j, rfl⟩ := hi simp [ambientEigenvalue_signal, Function.comp_apply] · rw [ambientEigenvalue_nonsignal V (f ∘ tau) i hi, ambientEigenvalue_nonsignal V tau i hi, hf0]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ambientEigenvalue_comp · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralConstruction.lean:192
theorem realDiagonalization_applyFunction

Real diagonalization apply function: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
Nonempty (Fin k)
tau :
Fin k → ℝ
f :
ℝ → ℝ
hf0 :
f 0 = 0
(F.realDiagonalization tau).applyFunction f = F.factorOperator (f ∘ tau)
Proof (Lean source)
lemma realDiagonalization_applyFunction {dx k : ℕ} [Nonempty (Fin k)] {B : RectMatrix dx k} (F : ThinSignalFactorization B) (tau : Fin k → ℝ) (f : ℝ → ℝ) (hf0 : f 0 = 0) : (F.realDiagonalization tau).applyFunction f = F.factorOperator (f ∘ tau) := by apply realDiagonalizationOfEigenbasis_applyFunction_eq_of_apply_basis intro i rw [← ambientEigenvalue_comp F.V tau f hf0 i] exact factorOperator_eigenbasis F (f ∘ tau) i
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.realDiagonalization_applyFunction · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralConstruction.lean:203
theorem moorePenroseInverse_thinSignalFactorization

Moore penrose inverse thin signal factorization: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
moorePenroseInverse B = F.coordInv * F.V.V.transpose
Proof (Lean source)
lemma moorePenroseInverse_thinSignalFactorization {dx k : ℕ} {B : RectMatrix dx k} (F : ThinSignalFactorization B) : moorePenroseInverse B = F.coordInv * F.V.V.transpose := by apply isMoorePenroseInverse_unique (moorePenroseInverse_spec B) have hgram := F.V.transpose_mul_self have hprojSymm : (F.V.V * F.V.V.transpose).transpose = F.V.V * F.V.V.transpose := by simp only [Matrix.transpose_mul, Matrix.transpose_transpose] have hBG : B * (F.coordInv * F.V.V.transpose) = F.V.V * F.V.V.transpose := by calc B * (F.coordInv * F.V.V.transpose) = (F.V.V * F.coord) * (F.coordInv * F.V.V.transpose) := congrArg (fun X : RectMatrix dx k => X * (F.coordInv * F.V.V.transpose)) F.factor _ = F.V.V * (F.coord * F.coordInv) * F.V.V.transpose := by simp only [Matrix.mul_assoc] _ = _ := by rw [F.coord_mul_inv, Matrix.mul_one] have hGB : (F.coordInv * F.V.V.transpose) * B = 1 := by calc (F.coordInv * F.V.V.transpose) * B = (F.coordInv * F.V.V.transpose) * (F.V.V * F.coord) := congrArg (fun X : RectMatrix dx k => (F.coordInv * F.V.V.transpose) * X) F.factor _ = F.coordInv * (F.V.V.transpose * F.V.V) * F.coord := by simp only [Matrix.mul_assoc] _ = 1 := by rw [hgram, Matrix.mul_one, F.inv_mul_coord] refine ⟨?_, ?_, ?_, ?_⟩ · rw [hBG] calc (F.V.V * F.V.V.transpose) * B = (F.V.V * F.V.V.transpose) * (F.V.V * F.coord) := congrArg (fun X : RectMatrix dx k => (F.V.V * F.V.V.transpose) * X) F.factor _ = F.V.V * (F.V.V.transpose * F.V.V) * F.coord := by simp only [Matrix.mul_assoc] _ = B := by rw [hgram, Matrix.mul_one]; exact F.factor.symm · rw [hGB, Matrix.one_mul] · rw [hBG, hprojSymm] · rw [hGB, Matrix.transpose_one]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.moorePenroseInverse_thinSignalFactorization · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralConstruction.lean:214
theorem factorOperator_eq_moorePenrose

Factor operator eq moore penrose: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
tau :
Fin k → ℝ
F.factorOperator tau
= (moorePenroseInverse B).transpose * diagonal tau * B.transpose
Proof (Lean source)
lemma factorOperator_eq_moorePenrose {dx k : ℕ} {B : RectMatrix dx k} (F : ThinSignalFactorization B) (tau : Fin k → ℝ) : F.factorOperator tau = (moorePenroseInverse B).transpose * diagonal tau * B.transpose := by calc F.factorOperator tau = (F.coordInv * F.V.V.transpose).transpose * diagonal tau * (F.V.V * F.coord).transpose := by simp only [Matrix.transpose_mul, Matrix.transpose_transpose, ThinSignalFactorization.factorOperator, Matrix.mul_assoc] _ = (moorePenroseInverse B).transpose * diagonal tau * B.transpose := by rw [moorePenroseInverse_thinSignalFactorization F] exact congrArg (fun X : RectMatrix dx k => (F.coordInv * F.V.V.transpose).transpose * diagonal tau * X.transpose) F.factor.symm
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.factorOperator_eq_moorePenrose · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralConstruction.lean:253
theorem realDiagonalization_applyFunction_moorePenrose

Real diagonalization apply function moore penrose: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
Nonempty (Fin k)
tau :
Fin k → ℝ
f :
ℝ → ℝ
hf0 :
f 0 = 0
(F.realDiagonalization tau).applyFunction f
= (moorePenroseInverse B).transpose * diagonal (f ∘ tau) * B.transpose
Proof (Lean source)
lemma realDiagonalization_applyFunction_moorePenrose {dx k : ℕ} [Nonempty (Fin k)] {B : RectMatrix dx k} (F : ThinSignalFactorization B) (tau : Fin k → ℝ) (f : ℝ → ℝ) (hf0 : f 0 = 0) : (F.realDiagonalization tau).applyFunction f = (moorePenroseInverse B).transpose * diagonal (f ∘ tau) * B.transpose := by rw [realDiagonalization_applyFunction F tau f hf0, factorOperator_eq_moorePenrose]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.realDiagonalization_applyFunction_moorePenrose · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralConstruction.lean:272

Euc norm le card mul bound: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
n :
x :
Euc n
M :
_hM :
0 ≤ M
hx :
∀ i, |x.ofLp i| ≤ M
‖x‖ ≤ (n : ℝ) * M
Proof (Lean source)
lemma eucNorm_le_card_mul_bound {n : ℕ} (x : Euc n) (M : ℝ) (_hM : 0 ≤ M) (hx : ∀ i, |x.ofLp i| ≤ M) : ‖x‖ ≤ (n : ℝ) * M := by let b := EuclideanSpace.basisFun (Fin n) ℝ have hsum := b.sum_repr x rw [← hsum] calc ‖∑ i, b.repr x i • b i‖ ≤ ∑ i, ‖b.repr x i • b i‖ := norm_sum_le _ _ _ ≤ ∑ _i : Fin n, M := by apply Finset.sum_le_sum intro i _ rw [norm_smul, b.orthonormal.1 i, mul_one] simp only [Real.norm_eq_abs, b, EuclideanSpace.basisFun_repr] exact hx i _ = (n : ℝ) * M := by simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.eucNorm_le_card_mul_bound · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralConstruction.lean:282

For the supplied parameters, entry Norm Constant is given by its defining clause.

Definition (Lean source)
rows cols :
entryNormConstant rows cols :
(cols : ℝ) * ‖((EuclideanSpace.basisFun (Fin cols) ℝ).toBasis.equivFunL : Euc cols →L[ℝ] (Fin cols → ℝ))‖ * (rows : ℝ)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.entryNormConstant · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralConstruction.lean:300
theorem entryNormConstant_nonneg

Entry norm constant nonneg: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols :
0 ≤ entryNormConstant rows cols
Proof (Lean source)
lemma entryNormConstant_nonneg (rows cols : ℕ) : 0 ≤ entryNormConstant rows cols := by unfold entryNormConstant positivity
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.entryNormConstant_nonneg · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralConstruction.lean:307
theorem matrixNorm_le_entryBound

Matrix norm le entry bound: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols :
A :
RectMatrix rows cols
M :
hM :
0 ≤ M
hA :
∀ i j, |A i j| ≤ M
‖A‖ ≤ entryNormConstant rows cols * M
Proof (Lean source)
lemma matrixNorm_le_entryBound {rows cols : ℕ} (A : RectMatrix rows cols) (M : ℝ) (hM : 0 ≤ M) (hA : ∀ i j, |A i j| ≤ M) : ‖A‖ ≤ entryNormConstant rows cols * M := by rw [Matrix.l2_opNorm_def] have hb := (EuclideanSpace.basisFun (Fin cols) ℝ).toBasis.opNorm_le (u := (toEuclideanLin ≪≫ₗ toContinuousLinearMap) A) (M := (rows : ℝ) * M) (by positivity) (by intro j apply eucNorm_le_card_mul_bound _ M hM intro i simpa [Matrix.toEuclideanLin_apply] using hA i j) simpa [entryNormConstant, nsmul_eq_mul, mul_assoc] using hb
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.matrixNorm_le_entryBound · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralConstruction.lean:313

Orthonormal basis entry abs le one: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
n :
b :
i j :
Fin n
|(b j).ofLp i| ≤ 1
Proof (Lean source)
lemma orthonormalBasis_entry_abs_le_one {n : ℕ} (b : OrthonormalBasis (Fin n) ℝ (Euc n)) (i j : Fin n) : |(b j).ofLp i| ≤ 1 := by have hi := PiLp.norm_apply_le (b j) i rw [b.orthonormal.1 j] at hi simpa [Real.norm_eq_abs] using hi
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.orthonormalBasis_entry_abs_le_one · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralConstruction.lean:329
theorem entry_abs_le_one

Entry abs le one: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
V :
i :
Fin dx
j :
Fin k
|V.V i j| ≤ 1
Proof (Lean source)
lemma SignalBasis.entry_abs_le_one {dx k : ℕ} (V : SignalBasis dx k) (i : Fin dx) (j : Fin k) : |V.V i j| ≤ 1 := by let v : Euc dx := toLp 2 (fun a => V.V a j) have hv : ‖v‖ = 1 := by rw [EuclideanSpace.norm_eq] have hj := V.orthonormal j j rw [if_pos rfl] at hj rw [show (∑ x, ‖v.ofLp x‖ ^ 2) = 1 by simpa [v, Real.norm_eq_abs, sq_abs, pow_two] using hj, Real.sqrt_one] have hi := PiLp.norm_apply_le v i rw [hv] at hi simpa [v, Real.norm_eq_abs] using hi
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.SignalBasis.entry_abs_le_one · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralConstruction.lean:338
theorem coord_entry_bound

Coord entry bound: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
L :
hL :
0 ≤ L
hB :
∀ i j, |B i j| ≤ L
r j :
Fin k
|F.coord r j| ≤ (dx : ℝ) * L
Proof (Lean source)
lemma ThinSignalFactorization.coord_entry_bound {dx k : ℕ} {B : RectMatrix dx k} (F : ThinSignalFactorization B) {L : ℝ} (hL : 0 ≤ L) (hB : ∀ i j, |B i j| ≤ L) (r j : Fin k) : |F.coord r j| ≤ (dx : ℝ) * L := by have hcoord : F.coord = F.V.V.transpose * B := by calc F.coord = 1 * F.coord := by rw [Matrix.one_mul] _ = (F.V.V.transpose * F.V.V) * F.coord := by rw [F.V.transpose_mul_self] _ = F.V.V.transpose * (F.V.V * F.coord) := by rw [Matrix.mul_assoc] _ = F.V.V.transpose * B := by rw [← F.factor] rw [hcoord, Matrix.mul_apply] calc |∑ i, F.V.V i r * B i j| ≤ ∑ i, |F.V.V i r * B i j| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ _i : Fin dx, L := by apply Finset.sum_le_sum intro i _ rw [abs_mul] calc |F.V.V i r| * |B i j| ≤ 1 * L := mul_le_mul (F.V.entry_abs_le_one i r) (hB i j) (abs_nonneg _) (by norm_num) _ = L := one_mul L _ = (dx : ℝ) * L := by simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ThinSignalFactorization.coord_entry_bound · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralConstruction.lean:353
theorem forward_norm_bound

Forward norm bound: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
J :
hJ :
0 ≤ J
hCi :
∀ i j, |F.coordInv i j| ≤ J
hdx :
0 < dx
‖F.forward‖
Proof (Lean source)
lemma ThinSignalFactorization.forward_norm_bound {dx k : ℕ} {B : RectMatrix dx k} (F : ThinSignalFactorization B) {J : ℝ} (hJ : 0 ≤ J) (hCi : ∀ i j, |F.coordInv i j| ≤ J) (hdx : 0 < dx) : ‖F.forward‖ ≤ entryNormConstant dx k * entryNormConstant k k * entryNormConstant k dx * J + (entryNormConstant dx dx + entryNormConstant dx k * entryNormConstant k dx) := by have hCdxk := entryNormConstant_nonneg dx k have hCkk := entryNormConstant_nonneg k k have hCkdx := entryNormConstant_nonneg k dx have hV := matrixNorm_le_entryBound F.V.V 1 (by norm_num) F.V.entry_abs_le_one have hVt := matrixNorm_le_entryBound F.V.V.transpose 1 (by norm_num) (fun i j => by simpa using F.V.entry_abs_le_one j i) have hCit := matrixNorm_le_entryBound F.coordInv.transpose J hJ (fun i j => by simpa using hCi j i) have hone := matrixNorm_le_entryBound (1 : RectMatrix dx dx) 1 (by norm_num) (fun i j => by simp [Matrix.one_apply]; split <;> norm_num) have htriple : ‖F.V.V * F.coordInv.transpose * F.V.V.transpose‖ ≤ (entryNormConstant dx k * 1) * (entryNormConstant k k * J) * (entryNormConstant k dx * 1) := by calc _ ≤ (‖F.V.V‖ * ‖F.coordInv.transpose‖) * ‖F.V.V.transpose‖ := (Matrix.l2_opNorm_mul _ _).trans <| mul_le_mul_of_nonneg_right (Matrix.l2_opNorm_mul _ _) (norm_nonneg _) _ ≤ _ := by gcongr have hproj : ‖F.V.V * F.V.V.transpose‖ ≤ (entryNormConstant dx k * 1) * (entryNormConstant k dx * 1) := (Matrix.l2_opNorm_mul _ _).trans (mul_le_mul hV hVt (norm_nonneg _) (mul_nonneg hCdxk (by norm_num))) unfold ThinSignalFactorization.forward calc ‖F.V.V * F.coordInv.transpose * F.V.V.transpose + (1 - F.V.V * F.V.V.transpose)‖ ≤ ‖F.V.V * F.coordInv.transpose * F.V.V.transpose‖ + ‖1 - F.V.V * F.V.V.transpose‖ := norm_add_le _ _ _ ≤ (entryNormConstant dx k * 1 * (entryNormConstant k k * J)) * (entryNormConstant k dx * 1) + (entryNormConstant dx dx * 1 + (entryNormConstant dx k * 1) * (entryNormConstant k dx * 1)) := add_le_add htriple ((norm_sub_le _ _).trans (add_le_add hone hproj)) _ = _ := by ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ThinSignalFactorization.forward_norm_bound · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralConstruction.lean:379
theorem backward_norm_bound

Backward norm bound: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
L :
hL :
0 ≤ L
hB :
∀ i j, |B i j| ≤ L
hdx :
0 < dx
‖F.backward‖
entryNormConstant dx k * entryNormConstant k k * entryNormConstant k dx * ((dx : ℝ) * L)
Proof (Lean source)
lemma ThinSignalFactorization.backward_norm_bound {dx k : ℕ} {B : RectMatrix dx k} (F : ThinSignalFactorization B) {L : ℝ} (hL : 0 ≤ L) (hB : ∀ i j, |B i j| ≤ L) (hdx : 0 < dx) : ‖F.backward‖ ≤ entryNormConstant dx k * entryNormConstant k k * entryNormConstant k dx * ((dx : ℝ) * L) + (entryNormConstant dx dx + entryNormConstant dx k * entryNormConstant k dx) := by have hCdxk := entryNormConstant_nonneg dx k have hCkk := entryNormConstant_nonneg k k have hCkdx := entryNormConstant_nonneg k dx have hV := matrixNorm_le_entryBound F.V.V 1 (by norm_num) F.V.entry_abs_le_one have hVt := matrixNorm_le_entryBound F.V.V.transpose 1 (by norm_num) (fun i j => by simpa using F.V.entry_abs_le_one j i) have hCt := matrixNorm_le_entryBound F.coord.transpose ((dx : ℝ) * L) (by positivity) (fun i j => by simpa using F.coord_entry_bound hL hB j i) have hone := matrixNorm_le_entryBound (1 : RectMatrix dx dx) 1 (by norm_num) (fun i j => by simp [Matrix.one_apply]; split <;> norm_num) have htriple : ‖F.V.V * F.coord.transpose * F.V.V.transpose‖ ≤ (entryNormConstant dx k * 1) * (entryNormConstant k k * ((dx : ℝ) * L)) * (entryNormConstant k dx * 1) := by calc _ ≤ (‖F.V.V‖ * ‖F.coord.transpose‖) * ‖F.V.V.transpose‖ := (Matrix.l2_opNorm_mul _ _).trans <| mul_le_mul_of_nonneg_right (Matrix.l2_opNorm_mul _ _) (norm_nonneg _) _ ≤ _ := by gcongr have hproj : ‖F.V.V * F.V.V.transpose‖ ≤ (entryNormConstant dx k * 1) * (entryNormConstant k dx * 1) := (Matrix.l2_opNorm_mul _ _).trans (mul_le_mul hV hVt (norm_nonneg _) (mul_nonneg hCdxk (by norm_num))) unfold ThinSignalFactorization.backward calc ‖F.V.V * F.coord.transpose * F.V.V.transpose + (1 - F.V.V * F.V.V.transpose)‖ ≤ ‖F.V.V * F.coord.transpose * F.V.V.transpose‖ + ‖1 - F.V.V * F.V.V.transpose‖ := norm_add_le _ _ _ ≤ (entryNormConstant dx k * 1 * (entryNormConstant k k * ((dx : ℝ) * L))) * (entryNormConstant k dx * 1) + (entryNormConstant dx dx * 1 + (entryNormConstant dx k * 1) * (entryNormConstant k dx * 1)) := add_le_add htriple ((norm_sub_le _ _).trans (add_le_add hone hproj)) _ = _ := by ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ThinSignalFactorization.backward_norm_bound · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralConstruction.lean:422

For the supplied parameters, condition Bound is given by its defining clause.

Definition (Lean source)
dx k :
L sigma0 :
conditionBound dx k L sigma0 :
Kb :
entryNormConstant dx dx ^ 2 * Kf * Kb
theorem conditionBound_nonneg

Condition bound nonneg: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
L sigma0 :
hL :
0 ≤ L
hsigma :
0 < sigma0
0 ≤ conditionBound dx k L sigma0
Proof (Lean source)
lemma conditionBound_nonneg (dx k : ℕ) {L sigma0 : ℝ} (hL : 0 ≤ L) (hsigma : 0 < sigma0) : 0 ≤ conditionBound dx k L sigma0 := by unfold conditionBound have hdxk := entryNormConstant_nonneg dx k have hkk := entryNormConstant_nonneg k k have hkdx := entryNormConstant_nonneg k dx have hdxdx := entryNormConstant_nonneg dx dx positivity
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.conditionBound_nonneg · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralConstruction.lean:479
theorem diagonalization_conditionNumber_le Lemma 26 in the paper ↗

Diagonalization condition number le: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
Nonempty (Fin k)
tau :
Fin k → ℝ
L sigma0 :
hL :
0 ≤ L
hsigma :
0 < sigma0
hB :
∀ i j, |B i j| ≤ L
hCi :
∀ i j, |F.coordInv i j| ≤ sigma0⁻¹
hdx :
0 < dx
(F.realDiagonalization tau).conditionNumber ≤ conditionBound dx k L sigma0
Proof (Lean source)
lemma ThinSignalFactorization.diagonalization_conditionNumber_le {dx k : ℕ} [Nonempty (Fin k)] {B : RectMatrix dx k} (F : ThinSignalFactorization B) (tau : Fin k → ℝ) {L sigma0 : ℝ} (hL : 0 ≤ L) (hsigma : 0 < sigma0) (hB : ∀ i j, |B i j| ≤ L) (hCi : ∀ i j, |F.coordInv i j| ≤ sigma0⁻¹) (hdx : 0 < dx) : (F.realDiagonalization tau).conditionNumber ≤ conditionBound dx k L sigma0 := by let Kf := entryNormConstant dx k * entryNormConstant k k * entryNormConstant k dx * sigma0⁻¹ + (entryNormConstant dx dx + entryNormConstant dx k * entryNormConstant k dx) let Kb := entryNormConstant dx k * entryNormConstant k k * entryNormConstant k dx * ((dx : ℝ) * L) + (entryNormConstant dx dx + entryNormConstant dx k * entryNormConstant k dx) have hKf0 : 0 ≤ Kf := by dsimp [Kf] have := entryNormConstant_nonneg dx k have := entryNormConstant_nonneg k k have := entryNormConstant_nonneg k dx have := entryNormConstant_nonneg dx dx positivity have hKb0 : 0 ≤ Kb := by dsimp [Kb] have := entryNormConstant_nonneg dx k have := entryNormConstant_nonneg k k have := entryNormConstant_nonneg k dx have := entryNormConstant_nonneg dx dx positivity have hFwd : ‖F.forward‖ ≤ Kf := F.forward_norm_bound (inv_nonneg.mpr hsigma.le) hCi hdx have hBwd : ‖F.backward‖ ≤ Kb := F.backward_norm_bound hL hB hdx have hBasisEntry (i j : Fin dx) : |(F.realDiagonalization tau).basis i j| ≤ Kf := by change |(F.eigenbasis j).ofLp i| ≤ Kf rw [ThinSignalFactorization.eigenbasis, Module.Basis.map_apply] change |(toEuclideanLin F.forward (F.V.ambientExtension.basis j)).ofLp i| ≤ Kf calc _ ≤ ‖Matrix.toEuclideanLin F.forward (F.V.ambientExtension.basis j)‖ := by simpa [Real.norm_eq_abs] using PiLp.norm_apply_le (toEuclideanLin F.forward (F.V.ambientExtension.basis j)) i _ ≤ ‖F.forward‖ * ‖F.V.ambientExtension.basis j‖ := by simpa [Matrix.toEuclideanLin_apply] using Matrix.l2_opNorm_mulVec F.forward (F.V.ambientExtension.basis j) _ = ‖F.forward‖ := by rw [F.V.ambientExtension.basis.orthonormal.1 j, mul_one] _ ≤ Kf := hFwd have hBasis : ‖(F.realDiagonalization tau).basis‖ ≤ entryNormConstant dx dx * Kf := matrixNorm_le_entryBound _ Kf hKf0 hBasisEntry have hInvEntry (i j : Fin dx) : |(F.realDiagonalization tau).basisInv i j| ≤ Kb := by change |F.eigenbasis.repr (single j (1 : ℝ)) i| ≤ Kb rw [ThinSignalFactorization.eigenbasis, Module.Basis.map_repr] change |F.V.ambientExtension.basis.toBasis.repr (F.linearEquiv.symm (single j (1 : ℝ))) i| ≤ Kb change |F.V.ambientExtension.basis.toBasis.repr (toEuclideanLin F.backward (single j (1 : ℝ))) i| ≤ Kb rw [F.V.ambientExtension.basis.coe_toBasis_repr_apply] have hre := F.V.ambientExtension.basis.repr_apply_apply (toEuclideanLin F.backward (single j (1 : ℝ))) i change |(F.V.ambientExtension.basis.repr (toEuclideanLin F.backward (single j (1 : ℝ)))).ofLp i| ≤ Kb rw [hre] calc |inner ℝ (F.V.ambientExtension.basis i) (toEuclideanLin F.backward (single j (1 : ℝ)))| ≤ ‖F.V.ambientExtension.basis i‖ * ‖Matrix.toEuclideanLin F.backward (single j (1 : ℝ))‖ := abs_real_inner_le_norm _ _ _ = ‖Matrix.toEuclideanLin F.backward (single j (1 : ℝ))‖ := by rw [F.V.ambientExtension.basis.orthonormal.1 i, one_mul] _ ≤ ‖F.backward‖ * ‖EuclideanSpace.single j (1 : ℝ)‖ := by simpa [Matrix.toEuclideanLin_apply] using Matrix.l2_opNorm_mulVec F.backward (single j (1 : ℝ)) _ = ‖F.backward‖ := by rw [EuclideanSpace.norm_single, norm_one, mul_one] _ ≤ Kb := hBwd have hInv : ‖(F.realDiagonalization tau).basisInv‖ ≤ entryNormConstant dx dx * Kb := matrixNorm_le_entryBound _ Kb hKb0 hInvEntry unfold RealDiagonalization.conditionNumber conditionBound dsimp [Kf, Kb] at hBasis hInv ⊢ calc ‖(F.realDiagonalization tau).basis‖ * ‖(F.realDiagonalization tau).basisInv‖ ≤ (entryNormConstant dx dx * (entryNormConstant dx k * entryNormConstant k k * entryNormConstant k dx * sigma0⁻¹ + (entryNormConstant dx dx + entryNormConstant dx k * entryNormConstant k dx))) * (entryNormConstant dx dx * (entryNormConstant dx k * entryNormConstant k k * entryNormConstant k dx * (↑dx * L) + (entryNormConstant dx dx + entryNormConstant dx k * entryNormConstant k dx))) := mul_le_mul hBasis hInv (norm_nonneg _) (mul_nonneg (entryNormConstant_nonneg dx dx) hKf0) _ = _ := by ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ThinSignalFactorization.diagonalization_conditionNumber_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralConstruction.lean:491
theorem singularSystem_right_entry_abs_le_one

Singular system right entry abs le one: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols :
B :
RectMatrix rows cols
r j :
Fin cols
|(singularSystem B).right r j| ≤ 1
Proof (Lean source)
lemma singularSystem_right_entry_abs_le_one {rows cols : ℕ} (B : RectMatrix rows cols) (r j : Fin cols) : |(singularSystem B).right r j| ≤ 1 := by let v : Euc cols := toLp 2 ((singularSystem B).right r) have hv : ‖v‖ = 1 := by rw [EuclideanSpace.norm_eq] have hr := (singularSystem B).right_orthonormal r r rw [if_pos rfl] at hr rw [show (∑ x, ‖v.ofLp x‖ ^ 2) = 1 by simpa [v, Real.norm_eq_abs, sq_abs, pow_two] using hr, Real.sqrt_one] have hj := PiLp.norm_apply_le v j rw [hv] at hj simpa [v, Real.norm_eq_abs] using hj
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.singularSystem_right_entry_abs_le_one · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralConstruction.lean:585
theorem thinSignalFactorization_coordInv_entry_bound

Thin signal factorization coord inv entry bound: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
B :
hpos :
∀ r : Fin k, 0 < (singularSystem B).sigma r
sigma0 :
hsigma :
0 < sigma0
hsle :
∀ r, sigma0 ≤ (singularSystem B).sigma r
i j :
Fin k
|(thinSignalFactorization B hpos).coordInv i j| ≤ sigma0⁻¹
Proof (Lean source)
lemma thinSignalFactorization_coordInv_entry_bound {dx k : ℕ} (B : RectMatrix dx k) (hpos : ∀ r : Fin k, 0 < (singularSystem B).sigma r) {sigma0 : ℝ} (hsigma : 0 < sigma0) (hsle : ∀ r, sigma0 ≤ (singularSystem B).sigma r) (i j : Fin k) : |(thinSignalFactorization B hpos).coordInv i j| ≤ sigma0⁻¹ := by simp only [thinSignalFactorization] change |(singularSystem B).right j i * ((singularSystem B).sigma j)⁻¹| ≤ sigma0⁻¹ rw [abs_mul, abs_inv, abs_of_pos (hpos j)] have hinv : ((singularSystem B).sigma j)⁻¹ ≤ sigma0⁻¹ := inv_anti₀ hsigma (hsle j) calc |(singularSystem B).right j i| * ((singularSystem B).sigma j)⁻¹ ≤ 1 * sigma0⁻¹ := mul_le_mul (singularSystem_right_entry_abs_le_one B j i) hinv (inv_nonneg.mpr (hpos j).le) (by norm_num) _ = sigma0⁻¹ := one_mul _
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.thinSignalFactorization_coordInv_entry_bound · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ModelSpectralConstruction.lean:600
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.NetLibraryCertificates 18 declarations Derived certificates for the advised finite summary library

Derived certificates for the advised finite summary library

inductive NetSummaryCoord

For the proxy and outcome dimensions, the finite coordinate type for a stored summary enumerates its four matrix blocks and its target-feature mean coordinates.

Definition (Lean source)
inductive NetSummaryCoord (dx dz : ℕ) | M0 (i : Fin dz) (j : Fin dx) | M1 (i : Fin dz) (j : Fin dx) | N0 (i : Fin dz) (j : Fin dx) | N1 (i : Fin dz) (j : Fin dx) | mean (j : Fin dx) deriving Fintype, DecidableEq
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.NetSummaryCoord · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/NetLibraryCertificates.lean:14
instance instDecidableEqNetSummaryCoord

For the proxy and outcome dimensions, equality of summary coordinates is decidable.

Definition (Lean source)
deriving Fintype, DecidableEq
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.instDecidableEqNetSummaryCoord · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/NetLibraryCertificates.lean:21
instance instFintypeNetSummaryCoord

For the proxy and outcome dimensions, summary coordinates form a finite type.

Definition (Lean source)
deriving Fintype, DecidableEq
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.instFintypeNetSummaryCoord · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/NetLibraryCertificates.lean:21
def netSummaryCoord

For the supplied parameters, net Summary Coord is given by its defining clause.

Definition (Lean source)
dx dz :
s :
netSummaryCoord s :
NetSummaryCoord dx dz → ℝ
clause 1
| .M0 i j => s.M0 i j
clause 2
| .M1 i j => s.M1 i j
clause 3
| .N0 i j => s.N0 i j
clause 4
| .N1 i j => s.N1 i j
clause 5
| .mean j => s.mX j
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.netSummaryCoord · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/NetLibraryCertificates.lean:29
theorem netSummaryCoord_ext

Net summary coord ext: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx dz :
h :
s = q
Proof (Lean source)
lemma netSummaryCoord_ext {dx dz : ℕ} {s q : SummarySpace dx dz} (h : ∀ c, netSummaryCoord s c = netSummaryCoord q c) : s = q := by cases s cases q congr · ext i j; exact h (.M0 i j) · ext i j; exact h (.M1 i j) · ext i j; exact h (.N0 i j) · ext i j; exact h (.N1 i j) · funext j; exact h (.mean j)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.netSummaryCoord_ext · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/NetLibraryCertificates.lean:37
theorem netSummaryCoord_card

Net summary coord card: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx dz :
card (NetSummaryCoord dx dz) = 4 * dz * dx + dx
Proof (Lean source)
lemma netSummaryCoord_card (dx dz : ℕ) : card (NetSummaryCoord dx dz) = 4 * dz * dx + dx := by rw [Fintype.card_congr (NetSummaryCoord.proxyTypeEquiv dx dz).symm] simp ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.netSummaryCoord_card · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/NetLibraryCertificates.lean:49
theorem netLibrary_card_polynomial_bound

The half-open grid certificate bounds every advised library by a fixed polynomial in n. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
∃ C : ℝ,
0 < C
conclusion 1
n :
1 ≤ n
A :
NetLibrary k dx dz n L pi0 sigma0
((@Fintype.card A.index A.finiteIndex : ℕ) : ℝ)
≤ C * rpow (n : ℝ) ((4 * dz * dx + dx : ℝ) / 2)
Proof (Lean source)
theorem netLibrary_card_polynomial_bound (k dx dz : ℕ) (L pi0 sigma0 : ℝ) (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) : ∃ C : ℝ, 0 < C ∧ ∀ n : ℕ, 1 ≤ n → ∀ A : NetLibrary k dx dz n L pi0 sigma0, ((@Fintype.card A.index A.finiteIndex : ℕ) : ℝ) ≤ C * rpow (n : ℝ) ((4 * dz * dx + dx : ℝ) / 2) := by let D : ℝ := 4 * Real.sqrt (dz * dx) + Real.sqrt dx let K : ℝ := 2 * L * D + 2 let m : ℕ := 4 * dz * dx + dx refine ⟨K ^ m, ?_, ?_⟩ · have hD : 0 < D := by dsimp [D] have hdx : 0 < dx := lt_of_lt_of_le (by omega : 0 < k) hkx positivity have hK : 0 < K := by dsimp [K]; nlinarith positivity · intro n hn A letI : Fintype A.index := A.finiteIndex have hdx : 0 < dx := lt_of_lt_of_le (by omega : 0 < k) hkx have hdz : 0 < dz := lt_of_lt_of_le (by omega : 0 < k) hkz have hsqrt : 0 < Real.sqrt (n : ℝ) := Real.sqrt_pos.2 (by exact_mod_cast Nat.zero_lt_of_lt hn) have hsqrt1 : 1 ≤ Real.sqrt (n : ℝ) := Real.one_le_sqrt.mpr (by exact_mod_cast hn) have hscale := A.scale_pos hn hdx hdz have hcardNat : Fintype.card A.index ≤ (⌈2 * L / A.scale⌉₊ + 1) ^ Fintype.card (NetSummaryCoord dx dz) := by calc Fintype.card A.index ≤ Fintype.card (NetSummaryCoord dx dz → Fin (⌈2 * L / A.scale⌉₊ + 1)) := Fintype.card_le_of_injective _ (A.gridCode_injective hscale) _ = _ := by rw [Fintype.card_fun, Fintype.card_fin] have hscaleForm : 2 * L / A.scale = 2 * L * D * Real.sqrt (n : ℝ) := by rw [A.scale_eq] dsimp [D] field_simp have hx0 : 0 ≤ 2 * L / A.scale := by positivity have hceil : ((⌈2 * L / A.scale⌉₊ + 1 : ℕ) : ℝ) ≤ K * Real.sqrt (n : ℝ) := by rw [hscaleForm] have hc := Nat.ceil_lt_add_one hx0 rw [hscaleForm] at hc dsimp [K] norm_num at hc ⊢ nlinarith have hm : Fintype.card (NetSummaryCoord dx dz) = m := by simpa [m] using netSummaryCoord_card dx dz have hpow : (((⌈2 * L / A.scale⌉₊ + 1 : ℕ) : ℝ) ^ m) ≤ (K * Real.sqrt (n : ℝ)) ^ m := by gcongr calc ((Fintype.card A.index : ℕ) : ℝ) ≤ (((⌈2 * L / A.scale⌉₊ + 1 : ℕ) : ℝ) ^ m) := by exact_mod_cast (hm ▸ hcardNat) _ ≤ (K * Real.sqrt (n : ℝ)) ^ m := hpow _ = K ^ m * rpow (n : ℝ) ((m : ℝ) / 2) := by rw [mul_pow, Real.sqrt_eq_rpow] rw [← Real.rpow_mul_natCast (by positivity)] congr 2 ring _ = K ^ m * rpow (n : ℝ) ((4 * dz * dx + dx : ℝ) / 2) := by simp [m]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.netLibrary_card_polynomial_bound · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/NetLibraryCertificates.lean:203
theorem modelCompressedCoordinates_exists

Every signal basis at a model summary supplies latent-effect diagonal coordinates and the corresponding left/right anchor coordinates. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
Q :
ModelLaw k dx dz L pi0 sigma0
V :
hV :
V.SpansSignal Q.summary
∃ D : CausalSmith.Substrate.CollisionSafeSpectralLaw.RealDiagonalization (compressedOperator Q.summary V hV),
conclusion 1
D.eigenvalue = latentEffect Q.P
conclusion 2
leftAnchor Q.summary V = mulVec D.basisInv.transpose (latentMass Q.P)
conclusion 3
mulVec D.basisInv (rightAnchor V) = fun _ => 1
Proof (Lean source)
theorem modelCompressedCoordinates_exists {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (Q : ModelLaw k dx dz L pi0 sigma0) (V : SignalBasis dx k) (hV : V.SpansSignal Q.summary) : ∃ D : CausalSmith.Substrate.CollisionSafeSpectralLaw.RealDiagonalization (compressedOperator Q.summary V hV), D.eigenvalue = latentEffect Q.P ∧ leftAnchor Q.summary V = mulVec D.basisInv.transpose (latentMass Q.P) ∧ mulVec D.basisInv (rightAnchor V) = fun _ => 1 := by classical letI := Q.prob rcases Q.model.coreDomain with ⟨hk, hkx, _hkz, hL, hpi, _hpiMax, hsigma, _hsigmaMax⟩ let B := targetFeature Q.P let R : RectMatrix k k := B.transpose * V.V let C : BoolRectMatrix dz k := fun t => referenceFeature Q.P t * latentArmWeights Q.P t have hMfac (t : Bool) : observedProxyMoment Q.summary t * V.V = C t * R := by rw [show Q.summary = obsSummary Q.P from rfl, observedProxyMoment_factorization Q.P hk hkx hL hpi Q.model t] simp only [C, R, B, Matrix.mul_assoc] have hNfac (t : Bool) : observedOutcomeProxyMoment Q.summary t * V.V = C t * diagonal (latentMean Q.P t) * R := by rw [show Q.summary = obsSummary Q.P from rfl, observedOutcomeProxyMoment_factorization Q.P hk hpi Q.model t] simp only [C, R, B, Matrix.mul_assoc] have hAinj (t : Bool) : Injective (toEuclideanLin (observedProxyMoment Q.summary t * V.V)) := by have hm := observedProxyMoment_compression_margin Q.P hk hkx hL hpi hsigma Q.model t V hV apply publishedMomentIdentity_injective_of_signalMinSingular_pos exact (mul_pos hpi (sq_pos_of_pos hsigma)).trans_le hm.2 have hRinj : Injective (toEuclideanLin R) := by intro x y hxy apply hAinj false rw [hMfac false] simpa [Matrix.toEuclideanLin_apply, Matrix.mulVec_mulVec] using congrArg (toEuclideanLin (C false)) hxy have hRunit : IsUnit R.det := by apply (Matrix.isUnit_iff_isUnit_det _).mp apply Matrix.mulVec_injective_iff_isUnit.mp intro x y hxy apply congrArg ofLp apply hRinj simpa [Matrix.toEuclideanLin_apply] using congrArg (toLp 2) hxy letI := Matrix.invertibleOfIsUnitDet R hRunit have hterm (t : Bool) : penroseInverse (observedProxyMoment Q.summary t * V.V) * (observedOutcomeProxyMoment Q.summary t * V.V) = R⁻¹ * diagonal (latentMean Q.P t) * R := by have hNrewrite : observedOutcomeProxyMoment Q.summary t * V.V = (observedProxyMoment Q.summary t * V.V) * (R⁻¹ * diagonal (latentMean Q.P t) * R) := by rw [hMfac t, hNfac t] simp only [Matrix.mul_assoc] rw [← Matrix.mul_assoc R R⁻¹, Matrix.mul_inv_of_invertible, Matrix.one_mul] rw [hNrewrite, ← Matrix.mul_assoc, publishedMomentIdentity_penrose_left_inverse_of_injective _ (hAinj t), Matrix.one_mul] have hD : compressedOperator Q.summary V hV = R⁻¹ * diagonal (latentEffect Q.P) * R := by unfold compressedOperator change genuinePenroseInverse (observedProxyMoment Q.summary true * V.V) * (observedOutcomeProxyMoment Q.summary true * V.V) - genuinePenroseInverse (observedProxyMoment Q.summary false * V.V) * (observedOutcomeProxyMoment Q.summary false * V.V) = _ rw [genuinePenroseInverse_eq_penroseInverse_of_injective _ (hAinj true), genuinePenroseInverse_eq_penroseInverse_of_injective _ (hAinj false), hterm true, hterm false, ← Matrix.sub_mul, ← Matrix.mul_sub] congr 2 ext a b by_cases hab : a = b <;> simp [Matrix.diagonal_apply, hab, latentEffect] let D : CausalSmith.Substrate.CollisionSafeSpectralLaw.RealDiagonalization (compressedOperator Q.summary V hV) := { basis := R⁻¹ basisInv := R eigenvalue := latentEffect Q.P basis_mul_inv := Matrix.inv_mul_of_invertible R inv_mul_basis := Matrix.mul_inv_of_invertible R reconstruct := hD } have hCinj : Injective (toEuclideanLin (C false)) := by intro x y hxy have hpre : toEuclideanLin (observedProxyMoment Q.summary false * V.V) (toEuclideanLin R⁻¹ x) = toEuclideanLin (observedProxyMoment Q.summary false * V.V) (toEuclideanLin R⁻¹ y) := by rw [hMfac false] apply PiLp.ext intro i simpa [Matrix.toEuclideanLin_apply, Matrix.mulVec_mulVec] using congrArg (fun z : Euc dz => z i) hxy have hxy' := hAinj false hpre have h := congrArg (toEuclideanLin R) hxy' simpa [Matrix.toEuclideanLin_apply, Matrix.mulVec_mulVec, Matrix.mul_inv_of_invertible] using h have hMraw : observedProxyMoment Q.summary false = C false * B.transpose := by rw [show Q.summary = obsSummary Q.P from rfl, observedProxyMoment_factorization Q.P hk hkx hL hpi Q.model false] have hBt : penroseInverse (C false) * observedProxyMoment Q.summary false = B.transpose := by rw [hMraw, ← Matrix.mul_assoc, publishedMomentIdentity_penrose_left_inverse_of_injective _ hCinj, Matrix.one_mul] have hBfac : B = (observedProxyMoment Q.summary false).transpose * (penroseInverse (C false)).transpose := by have ht := congrArg transpose hBt simpa [Matrix.transpose_mul] using ht.symm have hBmem (x : Euc k) : toEuclideanLin B x ∈ range (toEuclideanLin V.V) := by rw [hV] apply show range (toEuclideanLin (observedProxyMoment Q.summary false).transpose) ≤ signalRowspace Q.summary from le_sup_left refine ⟨Matrix.toEuclideanLin (penroseInverse (C false)).transpose x, ?_⟩ rw [hBfac] apply PiLp.ext intro i simp [Matrix.toEuclideanLin_apply, Matrix.mulVec_mulVec] have hproj : V.V * V.V.transpose * B = B := by apply Matrix.toEuclideanLin.injective apply LinearMap.ext intro x rcases hBmem x with ⟨y, hy⟩ have hgram : V.V.transpose * V.V = (1 : RectMatrix k k) := by ext a b simpa [Matrix.mul_apply, Matrix.one_apply] using V.orthonormal a b apply PiLp.ext intro i change ((V.V * V.V.transpose * B).mulVec x.ofLp) i = (B.mulVec x.ofLp) i have hyfun : V.V.mulVec y.ofLp = B.mulVec x.ofLp := by simpa [Matrix.toEuclideanLin_apply] using congrArg ofLp hy calc _ = ((V.V * V.V.transpose).mulVec (B.mulVec x.ofLp)) i := by exact congrFun (Matrix.mulVec_mulVec x.ofLp (V.V * V.V.transpose) B).symm i _ = (V.V.mulVec (V.V.transpose.mulVec (B.mulVec x.ofLp))) i := by exact congrFun (Matrix.mulVec_mulVec (B.mulVec x.ofLp) V.V V.V.transpose).symm i _ = (V.V.mulVec (V.V.transpose.mulVec (V.V.mulVec y.ofLp))) i := by rw [hyfun] _ = (V.V.mulVec ((V.V.transpose * V.V).mulVec y.ofLp)) i := by exact congrArg (fun z : Fin k → ℝ => (V.V.mulVec z) i) (Matrix.mulVec_mulVec y.ofLp V.V.transpose V.V) _ = (V.V.mulVec y.ofLp) i := by rw [hgram, Matrix.one_mulVec] _ = (B.mulVec x.ofLp) i := congrFun hyfun i have hBfactor : B = V.V * R.transpose := by rw [show R.transpose = V.V.transpose * B by simp [R, Matrix.transpose_mul]] simpa [Matrix.mul_assoc] using hproj.symm have hmX : Q.summary.mX = mulVec B (latentMass Q.P) := publishedMomentIdentity_obsSummary_mX_factorization Q.P hpi Q.model have hanchor : mulVec B.transpose (firstBasis dx) = fun _ => 1 := publishedMomentIdentity_targetFeature_transpose_firstBasis Q.P hk hkx hpi Q.model have hRt : R.transpose = V.V.transpose * B := by simp [R, Matrix.transpose_mul] have hBt' : B.transpose = R * V.V.transpose := by have ht := congrArg transpose hBfactor simpa [Matrix.transpose_mul] using ht have hleft : leftAnchor Q.summary V = mulVec R.transpose (latentMass Q.P) := by calc leftAnchor Q.summary V = mulVec V.V.transpose Q.summary.mX := by funext a simp [leftAnchor, mulVec, dotProduct, mul_comm] _ = mulVec V.V.transpose (mulVec B (latentMass Q.P)) := by rw [hmX] _ = mulVec (V.V.transpose * B) (latentMass Q.P) := Matrix.mulVec_mulVec _ _ _ _ = _ := by rw [← hRt] have hright : mulVec R (rightAnchor V) = fun _ => 1 := by rw [show rightAnchor V = mulVec V.V.transpose (firstBasis dx) by funext a simp [rightAnchor, mulVec, dotProduct]] rw [Matrix.mulVec_mulVec, ← hBt', hanchor] exact ⟨D, rfl, hleft, hright⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.modelCompressedCoordinates_exists · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/NetLibraryCertificates.lean:266
theorem complete_projectorLaw_eq

Any valid complete projector enumeration gives the same extensional law as the positive diagonal-coordinate law, even when eigenvalues collide and the list contains dummy slots. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
A :
D :
CausalSmith.Substrate.CollisionSafeSpectralLaw.RealDiagonalization A
mass value left right :
Fin k → ℝ
hmasspos :
∀ u, 0 < mass u
htrue :
AtomicLaw.Valid ({ weight := mass, atom := D.eigenvalue } : AtomicLaw k radius)
hcomplete :
∀ u, ∃ i, value i = D.eigenvalue u
hleft :
left = mulVec D.basisInv.transpose mass
hright :
mulVec D.basisInv right = fun _ => 1
hout :
AtomicLaw.Valid (⟨fun i => ∑ a, left a * (∑ b, polynomialAggregateProjector A value i a b * right b), value⟩ : AtomicLaw k radius)
AtomicLaw.LawModulo.ofProbabilityLaw ⟨_, hout⟩
= AtomicLaw.LawModulo.ofProbabilityLaw ⟨_, htrue⟩
Proof (Lean source)
theorem complete_projectorLaw_eq {k : ℕ} {radius : ℝ} {A : RectMatrix k k} (D : CausalSmith.Substrate.CollisionSafeSpectralLaw.RealDiagonalization A) (mass value left right : Fin k → ℝ) (hmasspos : ∀ u, 0 < mass u) (htrue : AtomicLaw.Valid ({ weight := mass, atom := D.eigenvalue } : AtomicLaw k radius)) (hcomplete : ∀ u, ∃ i, value i = D.eigenvalue u) (hleft : left = mulVec D.basisInv.transpose mass) (hright : mulVec D.basisInv right = fun _ => 1) (hout : AtomicLaw.Valid (⟨fun i => ∑ a, left a * (∑ b, polynomialAggregateProjector A value i a b * right b), value⟩ : AtomicLaw k radius)) : AtomicLaw.LawModulo.ofProbabilityLaw ⟨_, hout⟩ = AtomicLaw.LawModulo.ofProbabilityLaw ⟨_, htrue⟩ := by classical let out : AtomicLaw k radius := ⟨fun i => ∑ a, left a * (∑ b, polynomialAggregateProjector A value i a b * right b), value⟩ let trueLaw : AtomicLaw k radius := ⟨mass, D.eigenvalue⟩ have hw (i : Fin k) : out.weight i = ∑ u, if D.eigenvalue u = value i then mass u else 0 := by dsimp [out] rw [show polynomialAggregateProjector A value i = if value i ∈ D.spectralValues then D.projector (value i) else 0 by change CausalSmith.Substrate.CollisionSafeSpectralLaw.polynomialSpectralProjector A value i = _ exact CausalSmith.Substrate.CollisionSafeSpectralLaw.polynomialSpectralProjector_eq_projector_or_zero_of_complete D value hcomplete i] split_ifs with hi · exact CausalSmith.Substrate.CollisionSafeSpectralLaw.anchor_projector_eq_clusterMass D mass left right hleft hright (value i) · have hn (u : Fin k) : D.eigenvalue u ≠ value i := by intro h apply hi simp [CausalSmith.Substrate.CollisionSafeSpectralLaw.RealDiagonalization.spectralValues, ← h] simp [hn] have hintegral := CausalSmith.Substrate.CollisionSafeSpectralLaw.complete_clusterMass_integral_eq mass D.eigenvalue value hmasspos htrue.2.1 (fun u => by obtain ⟨i, hi⟩ := hcomplete u exact ⟨i, hi.symm⟩) (by simpa [← hw] using hout.2.1) apply Quotient.sound change AtomicLaw.ProbabilityLaw.MeasureEquivalent ⟨out, hout⟩ ⟨trueLaw, htrue⟩ unfold AtomicLaw.ProbabilityLaw.MeasureEquivalent ext s hs simp only [AtomicLaw.ProbabilityLaw.toMeasure, AtomicLaw.toMeasure, Measure.coe_finsetSum, Finset.sum_apply, Measure.smul_apply, Measure.dirac_apply' _ hs] have hreal := hintegral (fun x => s.indicator 1 x) change (∑ i, ofReal (out.weight i) • s.indicator 1 (out.atom i)) = ∑ i, ofReal (trueLaw.weight i) • s.indicator 1 (trueLaw.atom i) simp_rw [hw] dsimp [out, trueLaw] at hreal ⊢ have hcluster (i : Fin k) : 0 ≤ ∑ u, if D.eigenvalue u = value i then mass u else 0 := by rw [← hw i] exact hout.1 i calc (∑ i, ofReal (∑ u, if D.eigenvalue u = value i then mass u else 0) * s.indicator 1 (value i)) = ofReal (∑ i, (∑ u, if D.eigenvalue u = value i then mass u else 0) * s.indicator 1 (value i)) := by rw [ENNReal.ofReal_sum_of_nonneg (fun i _ => by exact mul_nonneg (hcluster i) (Set.indicator_nonneg (fun _ _ => zero_le_one) _))] apply Finset.sum_congr rfl intro i _ by_cases hi : value i ∈ s <;> simp [indicator, hi] _ = ofReal (∑ i, mass i * s.indicator 1 (D.eigenvalue i)) := congrArg ofReal hreal _ = ∑ i, ofReal (mass i) * s.indicator 1 (D.eigenvalue i) := by rw [ENNReal.ofReal_sum_of_nonneg (fun i _ => by exact mul_nonneg (hmasspos i).le (Set.indicator_nonneg (fun _ _ => zero_le_one) _))] apply Finset.sum_congr rfl intro i _ by_cases hi : D.eigenvalue i ∈ s <;> simp [indicator, hi]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.complete_projectorLaw_eq · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/NetLibraryCertificates.lean:435
theorem exactRealSpectralRun_eq_quotient

An arbitrary result-bearing primitive run at a feasible summary denotes its model quotient law; no canonical choice of signal basis or root enumeration is assumed. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
primitives :
s :
hs :
s ∈ admissibleImage k dx dz L pi0 sigma0
∃ Q : ModelLaw k dx dz L pi0 sigma0,
conclusion 1
Q.summary = s
conclusion 2
(exactRealSpectralRun primitives s hs).output.effectLaw = by letI
Proof (Lean source)
theorem exactRealSpectralRun_eq_quotient {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (primitives : ExactRealPrimitives) (s : SummarySpace dx dz) (hs : s ∈ admissibleImage k dx dz L pi0 sigma0) : ∃ Q : ModelLaw k dx dz L pi0 sigma0, Q.summary = s ∧ (exactRealSpectralRun primitives s hs).output.effectLaw = by letI := Q.prob exact quotientLaw Q.P Q.model := by let Q : ModelLaw k dx dz L pi0 sigma0 := Classical.choose hs have hQs : Q.summary = s := Classical.choose_spec hs let hsQ : Q.summary ∈ admissibleImage k dx dz L pi0 sigma0 := ⟨Q, rfl⟩ refine intro Q (intro hQs ?_) exact (exactRealSpectralRun_effectLaw_congr primitives hQs.symm hs hsQ).trans (exactRealSpectralRun_eq_quotient_of_model primitives Q hsQ)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.exactRealSpectralRun_eq_quotient · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/NetLibraryCertificates.lean:565
theorem netLawEstimator_measurable

The exhaustive finite fold is Borel measurable, and hence so is the law returned by the result-bearing program. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 :
primitives :
A :
NetLibrary k dx dz n L pi0 sigma0
Proof (Lean source)
theorem netLawEstimator_measurable {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} (primitives : ExactRealPrimitives) (A : NetLibrary k dx dz n L pi0 sigma0) : Measurable (netLawEstimator primitives A) := by classical letI : Fintype A.index := A.finiteIndex letI : MeasurableSpace A.index := ⊤ letI : MeasurableSpace (Option A.index) := ⊤ have hsummary : Measurable A.summary := measurable_of_finite _ have hrank : Measurable A.lexRank := measurable_of_finite _ have hdist (f : SummarySpace dx dz → A.index) (hf : Measurable f) : Measurable (fun s => dS (A.summary (f s)) s) := by let g : SummarySpace dx dz → ℝ := fun s => ∑ i, {q | f q = i}.indicator (fun q => dS (A.summary i) q) s have hg : Measurable g := by dsimp [g] apply measurable_sum intro i _ apply Measurable.indicator · exact ((dS_continuous dx dz).uncurry_left (A.summary i)).measurable · exact hf (measurableSet_singleton i) convert hg using 1 funext s simp [g, indicator] have hbetter (f : SummarySpace dx dz → A.index) (hf : Measurable f) (j : A.index) : Measurable (fun s => A.betterIndex s (f s) j) := by unfold NetLibrary.betterIndex apply Measurable.ite · exact measurableSet_lt (by fun_prop) (hdist f hf) · exact measurable_const · apply Measurable.ite · exact measurableSet_lt (hdist f hf) (by fun_prop) · exact hf · apply Measurable.ite · exact measurableSet_lt (by fun_prop) (hrank.comp hf) · exact measurable_const · exact hf have hfold (l : List A.index) (i : A.index) : Measurable (fun s : SummarySpace dx dz => l.foldl (A.betterIndex s) i) := by induction l using List.reverseRecOn with | nil => exact measurable_const | append_singleton l j ih => simp only [List.foldl_append, List.foldl_cons, List.foldl_nil] exact hbetter _ ih j have hsel : Measurable (nearestLibraryIndex A) := by unfold nearestLibraryIndex split · exact measurable_const · exact (measurable_of_finite (fun i : A.index => some i)).comp (hfold _ _) let out : Option A.index → AtomicLaw.LawModulo k (effectRadius dz L sigma0) | none => AtomicLaw.LawModulo.deltaZeroLaw A.k_pos A.radius_nonneg | some i => (exactRealSpectralRun primitives (A.summary i) (A.representative_feasible i)).output.effectLaw have hout : Measurable out := measurable_of_finite _ have heq : netLawEstimator primitives A = out ∘ nearestLibraryIndex A ∘ empSummary := by funext sample unfold netLawEstimator netExactRealProgram split <;> simp [out, Function.comp_def, *] rw [heq] exact hout.comp (hsel.comp empSummary_measurable)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.netLawEstimator_measurable · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/NetLibraryCertificates.lean:582
theorem netTraceCost_total_eq_length

Net trace cost total eq length: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
(netTraceCost trace).total = trace.length
Proof (Lean source)
lemma netTraceCost_total_eq_length (trace : List NetPrimitiveOperation) : (netTraceCost trace).total = trace.length := by simpa [netTraceCost, NetOperationCount.total] using netTraceCost_total_aux trace ⟨0, 0, 0, 0⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.netTraceCost_total_eq_length · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/NetLibraryCertificates.lean:655
theorem netOperationCount_le

Exact trace accounting bounds the program work by the summary scan, the exhaustive library scan, and the fixed five-operation spectral tail. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 :
primitives :
A :
NetLibrary k dx dz n L pi0 sigma0
sample :
Fin n → Obs dx dz
(netOperationCount primitives A sample).total
≤ n * (4 * dz * dx + dx)
+ @card A.index A.finiteIndex * (4 * dz * dx + dx + 5)
+ 5
Proof (Lean source)
lemma netOperationCount_le {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} (primitives : ExactRealPrimitives) (A : NetLibrary k dx dz n L pi0 sigma0) (sample : Fin n → Obs dx dz) : (netOperationCount primitives A sample).total ≤ n * (4 * dz * dx + dx) + @card A.index A.finiteIndex * (4 * dz * dx + dx + 5) + 5 := by letI : Fintype A.index := A.finiteIndex rw [show (netOperationCount primitives A sample).total = (netExactRealProgram primitives A sample).trace.length by exact netTraceCost_total_eq_length _] rw [netExactRealProgram_trace_eq] simp only [length_append, netSummaryTrace, List.length_replicate, netSearchTrace, List.length_flatMap] simp only [List.length_singleton] have hindex : A.indexList.length = card A.index := by simp [NetLibrary.indexList] have hscalar : 4 * dz * dx + dx + 4 + 1 = 4 * dz * dx + dx + 5 := by omega have hsum : ∀ xs : List A.index, (xs.map (fun _ => 4 * dz * dx + dx + 4 + 1)).sum = xs.length * (4 * dz * dx + dx + 5) := by intro xs simp [hscalar] rw [hsum A.indexList] rw [hindex] split · simp only [List.length_nil] omega · rw [ExactRealSpectralRun.trace_eq_fixed] simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.netOperationCount_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/NetLibraryCertificates.lean:661
theorem netOperationCount_polynomial_bound

The exact trace accounting and the grid-cardinality certificate combine into the displayed polynomial work bound with one class-dependent positive constant. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
∃ C : ℝ,
0 < C
conclusion 1
n :
1 ≤ n
primitives :
A :
NetLibrary k dx dz n L pi0 sigma0
sample :
Fin n → Obs dx dz
((netOperationCount primitives A sample).total : ℝ)
≤ C * ((n : ℝ) + rpow (n : ℝ) ((4 * dz * dx + dx : ℝ) / 2))
Proof (Lean source)
theorem netOperationCount_polynomial_bound (k dx dz : ℕ) (L pi0 sigma0 : ℝ) (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) : ∃ C : ℝ, 0 < C ∧ ∀ n : ℕ, 1 ≤ n → ∀ primitives : ExactRealPrimitives, ∀ A : NetLibrary k dx dz n L pi0 sigma0, ∀ sample : Fin n → Obs dx dz, ((netOperationCount primitives A sample).total : ℝ) ≤ C * ((n : ℝ) + rpow (n : ℝ) ((4 * dz * dx + dx : ℝ) / 2)) := by obtain ⟨Ccard, hCcard, hcard⟩ := netLibrary_card_polynomial_bound k dx dz L pi0 sigma0 hk hkx hkz hL let m : ℝ := 4 * dz * dx + dx let Cwork : ℝ := m + Ccard * (m + 5) + 5 have hmpos : 0 < m := by dsimp [m] have hdx : 0 < dx := lt_of_lt_of_le (by omega : 0 < k) hkx positivity have hCwork : 0 < Cwork := by dsimp [Cwork]; positivity refine ⟨Cwork, hCwork, ?_⟩ intro n hn primitives A sample let r : ℝ := rpow (n : ℝ) ((4 * dz * dx + dx : ℝ) / 2) have hr0 : 0 ≤ r := Real.rpow_nonneg (Nat.cast_nonneg n) _ have hexp0 : 0 ≤ ((4 * dz * dx + dx : ℝ) / 2) := by positivity have hr1 : 1 ≤ r := by exact Real.one_le_rpow (by exact_mod_cast hn) hexp0 have hopNat := netOperationCount_le primitives A sample have hopConcrete : ((netOperationCount primitives A sample).total : ℝ) ≤ (n : ℝ) * (4 * dz * dx + dx : ℕ) + ((@Fintype.card A.index A.finiteIndex : ℕ) : ℝ) * (4 * dz * dx + dx + 5 : ℕ) + 5 := by exact_mod_cast hopNat have hop : ((netOperationCount primitives A sample).total : ℝ) ≤ (n : ℝ) * m + ((@Fintype.card A.index A.finiteIndex : ℕ) : ℝ) * (m + 5) + 5 := by simpa [m, Nat.cast_add, Nat.cast_mul] using hopConcrete have hcardA := hcard n hn A have hm5 : 0 ≤ m + 5 := by positivity have hM : m ≤ Cwork := by dsimp [Cwork]; nlinarith [hCcard.le, hmpos.le] have htail : Ccard * (m + 5) + 5 ≤ Cwork := by dsimp [Cwork] linarith [hmpos.le] calc ((netOperationCount primitives A sample).total : ℝ) ≤ (n : ℝ) * m + ((@Fintype.card A.index A.finiteIndex : ℕ) : ℝ) * (m + 5) + 5 := hop _ ≤ (n : ℝ) * m + (Ccard * r) * (m + 5) + 5 * r := by gcongr nlinarith _ = m * (n : ℝ) + (Ccard * (m + 5) + 5) * r := by ring _ ≤ Cwork * (n : ℝ) + Cwork * r := by exact add_le_add (mul_le_mul_of_nonneg_right hM (Nat.cast_nonneg n)) (mul_le_mul_of_nonneg_right htail hr0) _ = Cwork * ((n : ℝ) + r) := by ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.netOperationCount_polynomial_bound · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/NetLibraryCertificates.lean:694
theorem netProgram_selected_eq_nearest

Net program selected eq nearest: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 :
primitives :
A :
NetLibrary k dx dz n L pi0 sigma0
sample :
Fin n → Obs dx dz
(netExactRealProgram primitives A sample).selected
Proof (Lean source)
lemma netProgram_selected_eq_nearest {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} (primitives : ExactRealPrimitives) (A : NetLibrary k dx dz n L pi0 sigma0) (sample : Fin n → Obs dx dz) : (netExactRealProgram primitives A sample).selected = nearestLibraryIndex A (empSummary sample) := by unfold netExactRealProgram split <;> simp_all
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.netProgram_selected_eq_nearest · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/NetLibraryCertificates.lean:751
theorem thresholdRecoversMatrixDimension_of_rank_perturbation_half

A rank-r comparison with last signal singular value at least s0 remains exactly r-dimensional after thresholding at s0 / 2 under any perturbation strictly below that threshold. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols r :
s0 e :
A M :
RectMatrix rows cols
hrpos :
0 < r
hs0 :
0 < s0
hrank :
M.rank = r
hmargin :
s0 ≤ singularValue M (r - 1)
hAM :
‖matrixCLM (A - M)‖ ≤ e
hsmall :
e < s0 / 2
Proof (Lean source)
lemma thresholdRecoversMatrixDimension_of_rank_perturbation_half {rows cols r : ℕ} {s0 e : ℝ} (A M : RectMatrix rows cols) (hrpos : 0 < r) (hs0 : 0 < s0) (hrank : M.rank = r) (hmargin : s0 ≤ singularValue M (r - 1)) (hAM : ‖matrixCLM (A - M)‖ ≤ e) (hsmall : e < s0 / 2) : ThresholdRecoversMatrixDimension r (s0 / 2) A := by have hkth : s0 / 2 < singularValue A (r - 1) := by have h := singularValue_lower_of_perturbation A M hmargin hAM linarith constructor · intro j hj have hanti := (toEuclideanLin A).singularValues_antitone (Nat.le_sub_one_of_lt hj) change s0 / 2 ≤ (toEuclideanLin A).singularValues j change s0 / 2 < (toEuclideanLin A).singularValues (r - 1) at hkth exact hkth.le.trans hanti · intro j hj have hz : singularValue M j = 0 := by unfold singularValue apply (toEuclideanLin M).singularValues_eq_zero_iff_le_finrank_range.mpr have hrange : finrank ℝ (toEuclideanLin M).range = M.rank := (M.rank_eq_finrank_range_toLin (EuclideanSpace.basisFun (Fin rows) ℝ).toBasis (EuclideanSpace.basisFun (Fin cols) ℝ).toBasis).symm rw [hrange, hrank] exact hj have hadd : M + (A - M) = A := by abel have hw := singular_value_weyl (j := j) M (A - M) rw [hadd, hz, sub_zero] at hw have hnonneg : 0 ≤ singularValue A j := (toEuclideanLin A).singularValues_nonneg _ rw [abs_of_nonneg hnonneg] at hw exact lt_of_le_of_lt (hw.trans hAM) hsmall
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.thresholdRecoversMatrixDimension_of_rank_perturbation_half · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/NetLibraryCertificates.lean:761
theorem modelSummary_thresholdRecovers_of_perturbation

The quantitative model rank certificate gives the perturbation clause required by every stored representative summary. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
Q :
ModelLaw k dx dz L pi0 sigma0
H :
RectMatrix (2 * dz) dx
hH :
‖matrixCLM H‖ < pi0 * sigma0 ^ 2 / 2
ThresholdRecoversMatrixDimension k (pi0 * sigma0 ^ 2 / 2) (stackedProxyMoment Q.summary + H)
Proof (Lean source)
lemma modelSummary_thresholdRecovers_of_perturbation {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (Q : ModelLaw k dx dz L pi0 sigma0) (H : RectMatrix (2 * dz) dx) (hH : ‖matrixCLM H‖ < pi0 * sigma0 ^ 2 / 2) : ThresholdRecoversMatrixDimension k (pi0 * sigma0 ^ 2 / 2) (stackedProxyMoment Q.summary + H) := by letI := Q.prob rcases Q.model.coreDomain with ⟨hk, hkx, _hkz, hL, hpi, _hpiMax, hsigma, _hsigmaMax⟩ obtain ⟨facts⟩ := modelCompressedSpectralFacts_exists Q have hrank : (stackedProxyMoment Q.summary).rank = k := by rw [(stackedProxyMoment Q.summary).rank_eq_finrank_range_toLin (EuclideanSpace.basisFun (Fin (2 * dz)) ℝ).toBasis (EuclideanSpace.basisFun (Fin dx) ℝ).toBasis] exact facts.stackedRank apply thresholdRecoversMatrixDimension_of_rank_perturbation_half (e := ‖matrixCLM H‖) (stackedProxyMoment Q.summary + H) (stackedProxyMoment Q.summary) (by omega) (mul_pos hpi (sq_pos_of_pos hsigma)) hrank · rw [show Q.summary = obsSummary Q.P from rfl] exact stackedProxyMoment_minSingular Q.P hk hkx hL hpi hsigma Q.model · rw [show stackedProxyMoment Q.summary + H - stackedProxyMoment Q.summary = H by abel] · exact hH
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.modelSummary_thresholdRecovers_of_perturbation · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/NetLibraryCertificates.lean:798
theorem netEstimator_wass1_le

Nearest-library selection plus the gap-free model modulus gives the deterministic advised estimator bound. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 Cmod :
primitives :
A :
NetLibrary k dx dz n L pi0 sigma0
hCmod :
0 ≤ Cmod
hmodel :
∀ (P Q : ModelLaw k dx dz L pi0 sigma0),
AtomicLaw.LawModulo.wass1 (by letI := P.prob; exact quotientLaw P.P P.model) (by letI := Q.prob; exact quotientLaw Q.P Q.model)
≤ Cmod * dS P.summary Q.summary
P :
Measure (FullData k dx dz)
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
sample :
Fin n → Obs dx dz
AtomicLaw.LawModulo.wass1 (netLawEstimator primitives A sample) (by letI := hP; exact quotientLaw P hM)
≤ Cmod * (2 * dS (empSummary sample) (obsSummary P) + (sqrt n)⁻¹)
Proof (Lean source)
theorem netEstimator_wass1_le {k dx dz n : ℕ} {L pi0 sigma0 Cmod : ℝ} (primitives : ExactRealPrimitives) (A : NetLibrary k dx dz n L pi0 sigma0) (hCmod : 0 ≤ Cmod) (hmodel : ∀ (P Q : ModelLaw k dx dz L pi0 sigma0), AtomicLaw.LawModulo.wass1 (by letI := P.prob; exact quotientLaw P.P P.model) (by letI := Q.prob; exact quotientLaw Q.P Q.model) ≤ Cmod * dS P.summary Q.summary) (P : Measure (FullData k dx dz)) (hP : IsProbabilityMeasure P) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (sample : Fin n → Obs dx dz) : AtomicLaw.LawModulo.wass1 (netLawEstimator primitives A sample) (by letI := hP; exact quotientLaw P hM) ≤ Cmod * (2 * dS (empSummary sample) (obsSummary P) + (sqrt n)⁻¹) := by letI := hP let QP : ModelLaw k dx dz L pi0 sigma0 := ⟨P, hP, hM⟩ obtain ⟨i, hi⟩ := nearestLibraryIndex_exists_of_model A QP (empSummary sample) have hsel : (netExactRealProgram primitives A sample).selected = some i := by rw [netProgram_selected_eq_nearest, hi] have hnear := (nearestLibraryIndex_spec A (empSummary sample) i hi).1 obtain ⟨j, hj⟩ := A.covers QP.summary ⟨QP, rfl⟩ obtain ⟨Qi, hQi, hrun⟩ := exactRealSpectralRun_eq_quotient primitives (A.summary i) (A.representative_feasible i) have hdist : dS Qi.summary QP.summary ≤ 2 * dS (empSummary sample) QP.summary + (sqrt n)⁻¹ := by rw [hQi] calc dS (A.summary i) QP.summary ≤ dS (A.summary i) (empSummary sample) + dS (empSummary sample) QP.summary := dS_triangle _ _ _ _ ≤ dS (A.summary j) (empSummary sample) + dS (empSummary sample) QP.summary := by gcongr; exact hnear j _ ≤ (dS (A.summary j) QP.summary + dS QP.summary (empSummary sample)) + dS (empSummary sample) QP.summary := by gcongr exact dS_triangle _ _ _ _ ≤ (sqrt n)⁻¹ + dS (empSummary sample) QP.summary + dS (empSummary sample) QP.summary := by rw [dS_symm QP.summary (empSummary sample)] gcongr _ = 2 * dS (empSummary sample) QP.summary + (sqrt n)⁻¹ := by ring have hout := netLawEstimator_eq_of_selected primitives A sample i hsel rw [hout, hrun] have hw := hmodel Qi QP exact hw.trans (mul_le_mul_of_nonneg_left hdist hCmod)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.netEstimator_wass1_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/NetLibraryCertificates.lean:841
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.NetLibraryExistence 4 declarations Construction of the advised finite summary grid.

Construction of the advised finite summary grid.

theorem netLibrary_univList_map_injective Lemma netLibrary_univList_map_injective in the paper ↗

If the canonical mapped lists agree, the underlying finite-indexed maps agree.

Formal statement
a :
β :
Type*
f g :
Fin a → β
h :
Finset.univ.toList.map f = Finset.univ.toList.map g
f = g
Proof (Lean source)
-- @node: netLibrary_univList_map_injective lemma netLibrary_univList_map_injective {a : ℕ} {β : Type*} (f g : Fin a → β) (h : Finset.univ.toList.map f = Finset.univ.toList.map g) : f = g := by funext i have aux : ∀ (l : List (Fin a)), l.map f = l.map g → ∀ x ∈ l, f x = g x := by intro l hl induction l with | nil => simp | cons y l ih => simp only [map_cons, List.cons.injEq] at hl intro x hx rcases List.mem_cons.mp hx with rfl | hx · exact hl.1 · exact ih hl.2 x hx exact aux _ h i (by simp)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.netLibrary_univList_map_injective · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/NetLibraryExistence.lean:14
theorem netLibrary_univList_flatMap_injective Lemma netLibrary_univList_flatMap_injective in the paper ↗

If the canonical flattened coordinate lists agree, the underlying finite-indexed matrices agree.

Formal statement
a b :
β :
Type*
f g :
Fin a → Fin b → β
h :
Finset.univ.toList.flatMap (fun i => Finset.univ.toList.map (f i))
= Finset.univ.toList.flatMap (fun i => Finset.univ.toList.map (g i))
f = g
Proof (Lean source)
-- @node: netLibrary_univList_flatMap_injective lemma netLibrary_univList_flatMap_injective {a b : ℕ} {β : Type*} (f g : Fin a → Fin b → β) (h : Finset.univ.toList.flatMap (fun i => Finset.univ.toList.map (f i)) = Finset.univ.toList.flatMap (fun i => Finset.univ.toList.map (g i))) : f = g := by funext i have aux : ∀ (l : List (Fin a)), l.flatMap (fun i => Finset.univ.toList.map (f i)) = l.flatMap (fun i => Finset.univ.toList.map (g i)) → ∀ x ∈ l, f x = g x := by intro l hl induction l with | nil => simp | cons y l ih => simp only [List.flatMap_cons] at hl obtain ⟨hy, htail⟩ := List.append_inj hl (by simp) intro x hx rcases List.mem_cons.mp hx with rfl | hx · exact netLibrary_univList_map_injective _ _ hy · exact ih htail x hx exact aux _ h i (by simp)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.netLibrary_univList_flatMap_injective · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/NetLibraryExistence.lean:31
theorem summaryLexKey_injective Lemma summaryLexKey_injective in the paper ↗

The displayed lexicographic coordinate list determines a summary.

Formal statement
dx dz :
Proof (Lean source)
-- @node: summaryLexKey_injective lemma summaryLexKey_injective {dx dz : ℕ} : Injective (@summaryLexKey dx dz) := by intro s q h let s0 := Finset.univ.toList.flatMap fun i : Fin dz => Finset.univ.toList.map fun j : Fin dx => s.M0 i j let q0 := Finset.univ.toList.flatMap fun i : Fin dz => Finset.univ.toList.map fun j : Fin dx => q.M0 i j let s1 := Finset.univ.toList.flatMap fun i : Fin dz => Finset.univ.toList.map fun j : Fin dx => s.M1 i j let q1 := Finset.univ.toList.flatMap fun i : Fin dz => Finset.univ.toList.map fun j : Fin dx => q.M1 i j let s2 := Finset.univ.toList.flatMap fun i : Fin dz => Finset.univ.toList.map fun j : Fin dx => s.N0 i j let q2 := Finset.univ.toList.flatMap fun i : Fin dz => Finset.univ.toList.map fun j : Fin dx => q.N0 i j let s3 := Finset.univ.toList.flatMap fun i : Fin dz => Finset.univ.toList.map fun j : Fin dx => s.N1 i j let q3 := Finset.univ.toList.flatMap fun i : Fin dz => Finset.univ.toList.map fun j : Fin dx => q.N1 i j let s4 := Finset.univ.toList.map fun i : Fin dx => s.mX i let q4 := Finset.univ.toList.map fun i : Fin dx => q.mX i change s0 ++ s1 ++ s2 ++ s3 ++ s4 = q0 ++ q1 ++ q2 ++ q3 ++ q4 at h obtain ⟨hrest, h4⟩ := List.append_inj h (by simp [s0, q0, s1, q1, s2, q2, s3, q3]) obtain ⟨hrest, h3⟩ := List.append_inj hrest (by simp [s0, q0, s1, q1, s2, q2]) obtain ⟨hrest, h2⟩ := List.append_inj hrest (by simp [s0, q0, s1, q1]) obtain ⟨h0, h1⟩ := List.append_inj hrest (by simp [s0, q0]) cases s cases q congr · exact netLibrary_univList_flatMap_injective _ _ (by simpa [s0, q0] using h0) · exact netLibrary_univList_flatMap_injective _ _ (by simpa [s1, q1] using h1) · exact netLibrary_univList_flatMap_injective _ _ (by simpa [s2, q2] using h2) · exact netLibrary_univList_flatMap_injective _ _ (by simpa [s3, q3] using h3) · exact netLibrary_univList_map_injective _ _ (by simpa [s4, q4] using h4)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summaryLexKey_injective · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/NetLibraryExistence.lean:55
theorem netLibrary_nonempty

Given the latent lower bound, feature dimension bound, proxy dimension bound, radius bound, treatment positivity, treatment upper bound, noise positivity, noise upper bound, and positive mesh size, the bounded half-open coordinate grid supplies a finite feasible representative library.

Formal statement
k dx dz n :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hsigma :
0 < sigma0
hsigmaMax :
sigma0 ≤ 1
hn :
1 ≤ n
Nonempty (NetLibrary k dx dz n L pi0 sigma0)
Proof (Lean source)
-- @node: netLibrary_nonempty theorem netLibrary_nonempty (k dx dz n : ℕ) (L pi0 sigma0 : ℝ) (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hpiMax : pi0 ≤ 1 / (2 * k : ℝ)) (hsigma : 0 < sigma0) (hsigmaMax : sigma0 ≤ 1) (hn : 1 ≤ n) : Nonempty (NetLibrary k dx dz n L pi0 sigma0) := by classical let scale : ℝ := (sqrt n)⁻¹ / (4 * sqrt (dz * dx) + sqrt dx) have hdx : 0 < dx := lt_of_lt_of_le (by omega : 0 < k) hkx have hdz : 0 < dz := lt_of_lt_of_le (by omega : 0 < k) hkz have hnR : (0 : ℝ) < n := by exact_mod_cast Nat.zero_lt_of_lt hn have hden : 0 < 4 * sqrt (dz * dx) + sqrt dx := by positivity have hscale : 0 < scale := by dsimp [scale]; positivity let GridInt := {z : ℤ // z ∈ Icc 0 ⌈2 * L / scale⌉} let Grid := NetSummaryCoord dx dz → GridInt let lower : Grid → SummarySpace dx dz := fun g => { M0 := fun i j => -L + scale * (g (.M0 i j) : ℤ) M1 := fun i j => -L + scale * (g (.M1 i j) : ℤ) N0 := fun i j => -L + scale * (g (.N0 i j) : ℤ) N1 := fun i j => -L + scale * (g (.N1 i j) : ℤ) mX := fun j => -L + scale * (g (.mean j) : ℤ) } let GoodGrid := {g : Grid // ∃ q, q ∈ admissibleImage k dx dz L pi0 sigma0 ∧ InSummaryBox L q ∧ InHalfOpenSummaryCube scale (lower g) q} let Key := {l : List ℝ // ∃ g : GoodGrid, summaryLexKey (lower g.1) = l} let keyOf : GoodGrid → Key := fun g => ⟨summaryLexKey (lower g.1), g, rfl⟩ letI : Finite GridInt := Set.finite_mem_finset (Icc 0 ⌈2 * L / scale⌉) letI : Finite Grid := Pi.finite letI : Finite GoodGrid := inferInstance letI : Finite Key := Finite.of_surjective keyOf (by rintro ⟨l, g, hg⟩ refine ⟨g, Subtype.ext ?_⟩ exact hg) letI : Fintype Key := Fintype.ofFinite Key let e : Fin (card Key) ≃o Key := Fintype.orderIsoFinOfCardEq Key rfl let gridOf (i : Fin (card Key)) : GoodGrid := choose (e i).property have gridOf_key (i : Fin (card Key)) : summaryLexKey (lower (gridOf i).1) = (e i).1 := Classical.choose_spec (e i).property let representative (i : Fin (card Key)) : SummarySpace dx dz := choose (gridOf i).property have representative_spec (i : Fin (card Key)) : representative i ∈ admissibleImage k dx dz L pi0 sigma0 ∧ InSummaryBox L (representative i) ∧ InHalfOpenSummaryCube scale (lower (gridOf i).1) (representative i) := Classical.choose_spec (gridOf i).property have image_box : ∀ q, q ∈ admissibleImage k dx dz L pi0 sigma0 → InSummaryBox L q := by intro q hq have hb := admissibleImage_subset_summarySpaceBox k dx dz L pi0 sigma0 hk hkx hkz hL hpi hpiMax hsigma hsigmaMax hq change q.toCoordinates ∈ summaryCoordinateBox dx dz L at hb simpa [InSummaryBox, SummarySpace.toCoordinates, summaryCoordinateBox, summaryMatrixBox, summaryVectorBox] using hb have grid_for (q : SummarySpace dx dz) (hq : InSummaryBox L q) : ∃ g : Grid, InHalfOpenSummaryCube scale (lower g) q := by let z : NetSummaryCoord dx dz → ℤ := fun c => ⌊(netSummaryCoord q c + L) / scale⌋ have zmem (c : NetSummaryCoord dx dz) : z c ∈ Icc 0 ⌈2 * L / scale⌉ := by have hc : netSummaryCoord q c ∈ Icc (-L) L := by rcases hq with ⟨h0, h1, h2, h3, h4⟩ cases c with | M0 i j => exact h0 i j | M1 i j => exact h1 i j | N0 i j => exact h2 i j | N1 i j => exact h3 i j | mean j => exact h4 j have hy0 : 0 ≤ (netSummaryCoord q c + L) / scale := div_nonneg (by linarith [hc.1]) hscale.le have hyL : (netSummaryCoord q c + L) / scale ≤ 2 * L / scale := by exact div_le_div_of_nonneg_right (by linarith [hc.2]) hscale.le have hz0 : (0 : ℤ) ≤ z c := Int.floor_nonneg.mpr hy0 have hzleR : ((z c : ℤ) : ℝ) ≤ (⌈2 * L / scale⌉ : ℤ) := (Int.floor_le _).trans (hyL.trans (Int.le_ceil _)) exact Finset.mem_Icc.mpr ⟨hz0, by exact_mod_cast hzleR⟩ let g : Grid := fun c => ⟨z c, zmem c⟩ refine ⟨g, ?_⟩ have scalar (x : ℝ) : -L + scale * (⌊(x + L) / scale⌋ : ℤ) ≤ x ∧ x < -L + scale * (⌊(x + L) / scale⌋ : ℤ) + scale := by have hlo := Int.floor_le ((x + L) / scale) have hhi := Int.lt_floor_add_one ((x + L) / scale) have hlo' := mul_le_mul_of_nonneg_left hlo hscale.le have hhi' := mul_lt_mul_of_pos_left hhi hscale have hcancel : scale * ((x + L) / scale) = x + L := by field_simp rw [hcancel] at hlo' hhi' constructor <;> linarith have cell (c : NetSummaryCoord dx dz) : netSummaryCoord (lower g) c ≤ netSummaryCoord q c ∧ netSummaryCoord q c < netSummaryCoord (lower g) c + scale := by cases c with | M0 i j => simpa [netSummaryCoord, lower, g, z] using scalar (q.M0 i j) | M1 i j => simpa [netSummaryCoord, lower, g, z] using scalar (q.M1 i j) | N0 i j => simpa [netSummaryCoord, lower, g, z] using scalar (q.N0 i j) | N1 i j => simpa [netSummaryCoord, lower, g, z] using scalar (q.N1 i j) | mean j => simpa [netSummaryCoord, lower, g, z] using scalar (q.mX j) exact ⟨fun i j => cell (.M0 i j), fun i j => cell (.M1 i j), fun i j => cell (.N0 i j), fun i j => cell (.N1 i j), fun j => cell (.mean j)⟩ have same_grid {g h : Grid} {q : SummarySpace dx dz} (hg : InHalfOpenSummaryCube scale (lower g) q) (hh : InHalfOpenSummaryCube scale (lower h) q) : g = h := by funext c apply Subtype.ext have cell {lo s : SummarySpace dx dz} (hs : InHalfOpenSummaryCube scale lo s) (c : NetSummaryCoord dx dz) : netSummaryCoord lo c ≤ netSummaryCoord s c ∧ netSummaryCoord s c < netSummaryCoord lo c + scale := by rcases hs with ⟨h0, h1, h2, h3, h4⟩ cases c with | M0 i j => exact h0 i j | M1 i j => exact h1 i j | N0 i j => exact h2 i j | N1 i j => exact h3 i j | mean j => exact h4 j have gc₁ := (cell hg c).1 have gc₂ := (cell hg c).2 have hc₁ := (cell hh c).1 have hc₂ := (cell hh c).2 have lower_apply (a : Grid) : netSummaryCoord (lower a) c = -L + scale * (a c : ℤ) := by cases c <;> rfl rw [lower_apply] at gc₁ gc₂ hc₁ hc₂ have hlt₁ : ((g c : GridInt) : ℤ) < (h c : GridInt) + 1 := by have : ((g c : ℤ) : ℝ) < (h c : ℤ) + 1 := by change ((g c : ℤ) : ℝ) < ((h c : ℤ) : ℝ) + 1 change -L + scale * (g c : ℤ) ≤ netSummaryCoord q c at gc₁ change netSummaryCoord q c < -L + scale * (h c : ℤ) + scale at hc₂ nlinarith exact_mod_cast this have hlt₂ : ((h c : GridInt) : ℤ) < (g c : GridInt) + 1 := by have : ((h c : ℤ) : ℝ) < (g c : ℤ) + 1 := by change ((h c : ℤ) : ℝ) < ((g c : ℤ) : ℝ) + 1 change -L + scale * (h c : ℤ) ≤ netSummaryCoord q c at hc₁ change netSummaryCoord q c < -L + scale * (g c : ℤ) + scale at gc₂ nlinarith exact_mod_cast this omega have cube_bound {g : Grid} {q r : SummarySpace dx dz} (hq : InHalfOpenSummaryCube scale (lower g) q) (hr : InHalfOpenSummaryCube scale (lower g) r) : dS q r ≤ (sqrt n)⁻¹ := by have coord (c : NetSummaryCoord dx dz) : |netSummaryCoord q c - netSummaryCoord r c| ≤ scale := by have cell {lo s : SummarySpace dx dz} (hs : InHalfOpenSummaryCube scale lo s) (c : NetSummaryCoord dx dz) : netSummaryCoord lo c ≤ netSummaryCoord s c ∧ netSummaryCoord s c < netSummaryCoord lo c + scale := by rcases hs with ⟨h0, h1, h2, h3, h4⟩ cases c with | M0 i j => exact h0 i j | M1 i j => exact h1 i j | N0 i j => exact h2 i j | N1 i j => exact h3 i j | mean j => exact h4 j have qc := cell hq c have rc := cell hr c rw [abs_le] constructor <;> linarith have block (A B : RectMatrix dz dx) (hAB : ∀ i j, |A i j - B i j| ≤ scale) : ‖matrixCLM (A - B)‖ ≤ sqrt (dz * dx) * scale := by apply matrixCLM_norm_le_sqrt_card_mul_of_entry_abs_le hscale.le simpa using hAB have hv : sqrt (∑ i, (q.mX i - r.mX i) ^ 2) ≤ sqrt dx * scale := by have hs : ∑ i, (q.mX i - r.mX i) ^ 2 ≤ (dx : ℝ) * scale ^ 2 := by calc _ ≤ ∑ _i : Fin dx, scale ^ 2 := Finset.sum_le_sum fun i _ => by have hi := (sq_le_sq₀ (abs_nonneg _) hscale.le).2 (coord (.mean i)) simpa only [netSummaryCoord, sq_abs] using hi _ = (dx : ℝ) * scale ^ 2 := by simp calc _ ≤ sqrt ((dx : ℝ) * scale ^ 2) := Real.sqrt_le_sqrt hs _ = sqrt dx * scale := by rw [Real.sqrt_mul (Nat.cast_nonneg dx), Real.sqrt_sq hscale.le] unfold dS have h0 := block q.M0 r.M0 (fun i j => coord (.M0 i j)) have h1 := block q.M1 r.M1 (fun i j => coord (.M1 i j)) have h2 := block q.N0 r.N0 (fun i j => coord (.N0 i j)) have h3 := block q.N1 r.N1 (fun i j => coord (.N1 i j)) have hscale_eq : (4 * sqrt (dz * dx) + sqrt dx) * scale = (sqrt n)⁻¹ := by dsimp [scale] field_simp nlinarith refine ⟨{ index := Fin (card Key) finiteIndex := inferInstance summary := representative representative_feasible := fun i => (representative_spec i).1 scale := scale scale_eq := rfl covers := ?_ cube := fun i => {s | InSummaryBox L s ∧ InHalfOpenSummaryCube scale (lower (gridOf i).1) s} cubeLower := fun i => lower (gridOf i).1 cubeLower_on_grid := ?_ cube_eq_halfOpen := fun _ => rfl representative_in_cube := fun i => ⟨(representative_spec i).2.1, (representative_spec i).2.2⟩ cubes_disjoint := ?_ meeting_cube_complete := ?_ cube_diameter := ?_ lexRank := fun i => i lexRank_injective := Fin.val_injective lexRank_order := ?_ k_pos := by omega radius_nonneg := by unfold effectRadius; positivity index_nonempty_iff := ?_ }⟩ · intro q hq obtain ⟨g, hg⟩ := grid_for q (image_box q hq) let gg : GoodGrid := ⟨g, q, hq, image_box q hq, hg⟩ let key : Key := keyOf gg let i := e.symm key refine ⟨i, ?_⟩ refine cube_bound ?_ hg have hchosen := (representative_spec i).2.2 have hlower : lower (gridOf i).1 = lower g := by apply summaryLexKey_injective rw [gridOf_key i] simp [i, key, keyOf, gg] have hchosen' : InHalfOpenSummaryCube scale (lower g) (representative i) := by rw [← hlower] exact hchosen exact hchosen' · intro i refine ⟨?_, ?_, ?_, ?_, ?_⟩ · intro a b; exact ⟨(gridOf i).1 (.M0 a b), rfl⟩ · intro a b; exact ⟨(gridOf i).1 (.M1 a b), rfl⟩ · intro a b; exact ⟨(gridOf i).1 (.N0 a b), rfl⟩ · intro a b; exact ⟨(gridOf i).1 (.N1 a b), rfl⟩ · intro a; exact ⟨(gridOf i).1 (.mean a), rfl⟩ · rw [Set.pairwiseDisjoint_iff] intro i _ j _ hij rcases hij with ⟨q, hqi, hqj⟩ apply e.injective apply Subtype.ext rw [← gridOf_key i, ← gridOf_key j] exact congrArg summaryLexKey (congrArg lower (same_grid hqi.2 hqj.2)) · intro q hq obtain ⟨g, hg⟩ := grid_for q (image_box q hq) let gg : GoodGrid := ⟨g, q, hq, image_box q hq, hg⟩ let key : Key := keyOf gg let i := e.symm key refine ⟨i, image_box q hq, ?_⟩ -- … truncated; follow the source link for the rest …
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.netLibrary_nonempty · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/NetLibraryExistence.lean:95
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.ObservedLawAdapters 18 declarations Measurability and finite-partition adapters for transporting the full-data law to the observed law and decomposing treatment arms into latent cells.

Measurability and finite-partition adapters for transporting the full-data law to the observed law and decomposing treatment arms into latent cells.

theorem measurable_fullData_T

The full-data treatment coordinate is measurable. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
Measurable (fun w : FullData k dx dz => w.T)
Proof (Lean source)
-- @node: measurable_fullData_T lemma measurable_fullData_T {k dx dz : ℕ} : Measurable (fun w : FullData k dx dz => w.T) := by change Measurable (fun w : FullData k dx dz => (FullData.toCoordinates w).2.1) exact continuous_induced_dom.measurable.snd.fst
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.measurable_fullData_T · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ObservedLawAdapters.lean:13
theorem measurable_fullData_U

The full-data latent coordinate is measurable. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
Measurable (fun w : FullData k dx dz => w.U)
Proof (Lean source)
-- @node: measurable_fullData_U lemma measurable_fullData_U {k dx dz : ℕ} : Measurable (fun w : FullData k dx dz => w.U) := by change Measurable (fun w : FullData k dx dz => (FullData.toCoordinates w).1) exact continuous_induced_dom.measurable.fst
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.measurable_fullData_U · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ObservedLawAdapters.lean:20
theorem measurable_obs_T

The observed treatment coordinate is measurable. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx dz :
Measurable (fun o : Obs dx dz => o.T)
Proof (Lean source)
-- @node: measurable_obs_T lemma measurable_obs_T {dx dz : ℕ} : Measurable (fun o : Obs dx dz => o.T) := by change Measurable (fun o : Obs dx dz => (Obs.toCoordinates o).1) exact continuous_induced_dom.measurable.fst
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.measurable_obs_T · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ObservedLawAdapters.lean:27
theorem measurableSet_latentClass Lemma measurableSet_latentClass in the paper ↗

A latent class is a measurable full-data event. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
u :
Fin k
MeasurableSet (latentClass (dx := dx) (dz := dz) u)
Proof (Lean source)
-- @node: measurableSet_latentClass lemma measurableSet_latentClass {k dx dz : ℕ} (u : Fin k) : MeasurableSet (latentClass (dx := dx) (dz := dz) u) := by exact measurable_fullData_U (measurableSet_singleton u)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.measurableSet_latentClass · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ObservedLawAdapters.lean:33
theorem measurableSet_latentCell Lemma measurableSet_latentCell in the paper ↗

A latent-treatment cell is a measurable full-data event. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
u :
Fin k
t :
MeasurableSet (latentCell (dx := dx) (dz := dz) u t)
Proof (Lean source)
-- @node: measurableSet_latentCell lemma measurableSet_latentCell {k dx dz : ℕ} (u : Fin k) (t : Bool) : MeasurableSet (latentCell (dx := dx) (dz := dz) u t) := by change MeasurableSet ({w : FullData k dx dz | w.U = u} ∩ {w | w.T = t}) exact (measurable_fullData_U (measurableSet_singleton u)).inter (measurable_fullData_T (measurableSet_singleton t))
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.measurableSet_latentCell · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ObservedLawAdapters.lean:39
theorem measurableSet_fullDataArm

A treatment arm is a measurable full-data event. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
t :
MeasurableSet {w : FullData k dx dz | w.T = t}
Proof (Lean source)
-- @node: measurableSet_fullDataArm lemma measurableSet_fullDataArm {k dx dz : ℕ} (t : Bool) : MeasurableSet {w : FullData k dx dz | w.T = t} := by exact measurable_fullData_T (measurableSet_singleton t)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.measurableSet_fullDataArm · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ObservedLawAdapters.lean:47
theorem measurableSet_obsArm_generic Lemma measurableSet_obsArm_generic in the paper ↗

A treatment arm is a measurable observed-data event. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx dz :
t :
MeasurableSet (obsArm (dx := dx) (dz := dz) t)
Proof (Lean source)
-- @node: measurableSet_obsArm_generic lemma measurableSet_obsArm_generic {dx dz : ℕ} (t : Bool) : MeasurableSet (obsArm (dx := dx) (dz := dz) t) := by exact measurable_obs_T (measurableSet_singleton t)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.measurableSet_obsArm_generic · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ObservedLawAdapters.lean:53
theorem obsLaw_real_obsArm

The observed-law mass of an arm equals its full-data-law mass. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
t :
(obsLaw P).real (obsArm t) = P.real {w | w.T = t}
Proof (Lean source)
-- @node: obsLaw_real_obsArm lemma obsLaw_real_obsArm {k dx dz : ℕ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (t : Bool) : (obsLaw P).real (obsArm t) = P.real {w | w.T = t} := by rw [Measure.real, obsLaw, Measure.map_apply (obsMap_measurable k dx dz) (measurableSet_obsArm_generic t)] rfl
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.obsLaw_real_obsArm · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ObservedLawAdapters.lean:59
theorem conditionalMean_obsLaw_eq_fullData

Conditional means under the observed pushforward equal the corresponding full-data conditional means on the pulled-back event. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
A :
Set (Obs dx dz)
hA :
f :
Obs dx dz → ℝ
hf :
conditionalMean (obsLaw P) A f = conditionalMean P (obsMap ⁻¹' A) (f ∘ obsMap)
Proof (Lean source)
-- @node: conditionalMean_obsLaw_eq_fullData lemma conditionalMean_obsLaw_eq_fullData {k dx dz : ℕ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (A : Set (Obs dx dz)) (hA : MeasurableSet A) (f : Obs dx dz → ℝ) (hf : Measurable f) : conditionalMean (obsLaw P) A f = conditionalMean P (obsMap ⁻¹' A) (f ∘ obsMap) := by have hmap : (obsLaw P).restrict A = Measure.map obsMap (P.restrict (obsMap ⁻¹' A)) := by exact Measure.restrict_map (obsMap_measurable k dx dz) hA unfold conditionalMean rw [Measure.real, Measure.real, obsLaw, Measure.map_apply (obsMap_measurable k dx dz) hA] congr 1 change (∫ x, f x ∂(obsLaw P).restrict A) = ∫ x, (f ∘ obsMap) x ∂P.restrict (obsMap ⁻¹' A) rw [hmap] exact integral_map (obsMap_measurable k dx dz).aemeasurable hf.aestronglyMeasurable
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.conditionalMean_obsLaw_eq_fullData · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ObservedLawAdapters.lean:68

The observed treatment arm pulls back to the matching full-data arm. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
t :
@obsMap k dx dz ⁻¹' obsArm t = {w | w.T = t}
Proof (Lean source)
-- @node: obsMap_preimage_obsArm lemma obsMap_preimage_obsArm {k dx dz : ℕ} (t : Bool) : @obsMap k dx dz ⁻¹' obsArm t = {w | w.T = t} := rfl
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.obsMap_preimage_obsArm · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ObservedLawAdapters.lean:89
theorem conditionalMean_obsArm_eq_fullDataArm

An observed-arm conditional mean can be evaluated directly under the full-data law. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
t :
f :
Obs dx dz → ℝ
hf :
conditionalMean (obsLaw P) (obsArm t) f = conditionalMean P {w | w.T = t} (f ∘ obsMap)
Proof (Lean source)
-- @node: conditionalMean_obsArm_eq_fullDataArm lemma conditionalMean_obsArm_eq_fullDataArm {k dx dz : ℕ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (t : Bool) (f : Obs dx dz → ℝ) (hf : Measurable f) : conditionalMean (obsLaw P) (obsArm t) f = conditionalMean P {w | w.T = t} (f ∘ obsMap) := by simpa only [obsMap_preimage_obsArm] using conditionalMean_obsLaw_eq_fullData P (obsArm t) (measurableSet_obsArm_generic t) f hf
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.conditionalMean_obsArm_eq_fullDataArm · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ObservedLawAdapters.lean:94
theorem fullDataArm_eq_iUnion_latentCell

A full-data treatment arm is the disjoint union of its finitely many latent cells. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
t :
{w : FullData k dx dz | w.T = t} = ⋃ u : Fin k, latentCell u t
Proof (Lean source)
-- @node: fullDataArm_eq_iUnion_latentCell lemma fullDataArm_eq_iUnion_latentCell {k dx dz : ℕ} (t : Bool) : {w : FullData k dx dz | w.T = t} = ⋃ u : Fin k, latentCell u t := by ext w simp [latentCell]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.fullDataArm_eq_iUnion_latentCell · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ObservedLawAdapters.lean:104
theorem fullDataArm_real_eq_sum_latentCell

The real mass of an arm is the sum of the real masses of its latent cells. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
t :
P.real {w | w.T = t} = ∑ u : Fin k, P.real (latentCell u t)
Proof (Lean source)
-- @node: fullDataArm_real_eq_sum_latentCell lemma fullDataArm_real_eq_sum_latentCell {k dx dz : ℕ} (P : Measure (FullData k dx dz)) [IsFiniteMeasure P] (t : Bool) : P.real {w | w.T = t} = ∑ u : Fin k, P.real (latentCell u t) := by rw [fullDataArm_eq_iUnion_latentCell] apply measureReal_iUnion_fintype (h' := fun i => measure_ne_top P (latentCell i t)) · intro u v huv unfold onFun rw [Set.disjoint_left] intro w hwu hwv exact huv (hwu.1.symm.trans hwv.1) · exact fun u => measurableSet_latentCell u t
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.fullDataArm_real_eq_sum_latentCell · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ObservedLawAdapters.lean:111
theorem arm_mass_lower_of_latentArmPositivity Lemma 3 in the paper ↗

Joint latent-arm positivity yields the paper's quantitative marginal arm bound. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
pi0 :
hpos :
LatentArmPositivity (pi0 := pi0) P
t :
k * pi0 ≤ P.real {w | w.T = t}
Proof (Lean source)
-- @node: arm_mass_lower_of_latentArmPositivity lemma arm_mass_lower_of_latentArmPositivity {k dx dz : ℕ} {pi0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hpos : LatentArmPositivity (pi0 := pi0) P) (t : Bool) : k * pi0 ≤ P.real {w | w.T = t} := by rw [fullDataArm_real_eq_sum_latentCell] calc k * pi0 = ∑ _u : Fin k, pi0 := by simp _ ≤ ∑ u : Fin k, P.real (latentCell u t) := Finset.sum_le_sum fun u _ => hpos u t
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.arm_mass_lower_of_latentArmPositivity · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ObservedLawAdapters.lean:125
theorem latentCell_pos_of_latentArmPositivity

Every latent-treatment cell has strictly positive mass under a positive margin. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
pi0 :
hpi :
0 < pi0
hpos :
LatentArmPositivity (pi0 := pi0) P
u :
Fin k
t :
0 < P (latentCell u t)
Proof (Lean source)
-- @node: latentCell_pos_of_latentArmPositivity lemma latentCell_pos_of_latentArmPositivity {k dx dz : ℕ} {pi0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hpi : 0 < pi0) (hpos : LatentArmPositivity (pi0 := pi0) P) (u : Fin k) (t : Bool) : 0 < P (latentCell u t) := by have hr : 0 < P.real (latentCell u t) := lt_of_lt_of_le hpi (hpos u t) exact pos_iff_ne_zero.mpr fun hz => by simp [Measure.real, hz] at hr
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.latentCell_pos_of_latentArmPositivity · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ObservedLawAdapters.lean:137
theorem fullDataArm_pos_of_latentArmPositivity

Every treatment arm has strictly positive mass under joint latent-arm positivity. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
pi0 :
hk :
0 < k
hpi :
0 < pi0
hpos :
LatentArmPositivity (pi0 := pi0) P
t :
0 < P {w | w.T = t}
Proof (Lean source)
-- @node: fullDataArm_pos_of_latentArmPositivity lemma fullDataArm_pos_of_latentArmPositivity {k dx dz : ℕ} {pi0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hk : 0 < k) (hpi : 0 < pi0) (hpos : LatentArmPositivity (pi0 := pi0) P) (t : Bool) : 0 < P {w | w.T = t} := by have hr : 0 < P.real {w | w.T = t} := lt_of_lt_of_le (mul_pos (Nat.cast_pos.mpr hk) hpi) (arm_mass_lower_of_latentArmPositivity P hpos t) exact pos_iff_ne_zero.mpr fun hz => by simp [Measure.real, hz] at hr
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.fullDataArm_pos_of_latentArmPositivity · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ObservedLawAdapters.lean:146
theorem latentArmWeight_lower

Each normalized latent-arm weight retains the original joint-cell positivity margin. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
pi0 :
hpi :
0 < pi0
hpos :
LatentArmPositivity (pi0 := pi0) P
u :
Fin k
t :
pi0 ≤ latentArmWeights P t u u
Proof (Lean source)
-- @node: latentArmWeight_lower lemma latentArmWeight_lower {k dx dz : ℕ} {pi0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hpi : 0 < pi0) (hpos : LatentArmPositivity (pi0 := pi0) P) (u : Fin k) (t : Bool) : pi0 ≤ latentArmWeights P t u u := by have hcell : pi0 ≤ P.real (latentCell u t) := hpos u t have harmpos : 0 < P.real {w | w.T = t} := by have hsubset : latentCell u t ⊆ {w : FullData k dx dz | w.T = t} := fun _ hw => hw.2 exact lt_of_lt_of_le hpi (hcell.trans (measureReal_mono hsubset)) have harmle : P.real {w : FullData k dx dz | w.T = t} ≤ 1 := measureReal_le_one rw [latentArmWeights, Matrix.diagonal_apply_eq] exact (le_div_iff₀ harmpos).2 (by calc pi0 * P.real {w : FullData k dx dz | w.T = t} ≤ pi0 * 1 := mul_le_mul_of_nonneg_left harmle hpi.le _ = pi0 := mul_one _ _ ≤ P.real (latentCell u t) := hcell)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.latentArmWeight_lower · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ObservedLawAdapters.lean:157
theorem latentArmWeights_injective Lemma 19 in the paper ↗

The diagonal matrix of normalized latent-arm weights is injective. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
pi0 :
hpi :
0 < pi0
hpos :
LatentArmPositivity (pi0 := pi0) P
t :
Proof (Lean source)
-- @node: latentArmWeights_injective lemma latentArmWeights_injective {k dx dz : ℕ} {pi0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hpi : 0 < pi0) (hpos : LatentArmPositivity (pi0 := pi0) P) (t : Bool) : Injective (toEuclideanLin (latentArmWeights P t)) := by intro x y hxy apply PiLp.ext intro u have hwu : latentArmWeights P t u u ≠ 0 := ne_of_gt (lt_of_lt_of_le hpi (latentArmWeight_lower P hpi hpos u t)) have hu := congrArg (fun z : Euc k => z u) hxy rw [Matrix.toEuclideanLin_apply, Matrix.toEuclideanLin_apply] at hu have hu' : latentArmWeights P t u u * x u = latentArmWeights P t u u * y u := by simpa [latentArmWeights, Matrix.mulVec_diagonal] using hu exact mul_left_cancel₀ hwu hu'
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.latentArmWeights_injective · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ObservedLawAdapters.lean:178
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.ObservedMarginAssembly 13 declarations Assembly lemmas for the observed VMW margin proposition.

Assembly lemmas for the observed VMW margin proposition.

theorem measurable_fullData_X

The full-data target-proxy coordinate map is measurable. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
Measurable (fun w : FullData k dx dz => w.X)
Proof (Lean source)
-- @node: measurable_fullData_X lemma measurable_fullData_X {k dx dz : ℕ} : Measurable (fun w : FullData k dx dz => w.X) := by change Measurable (fun w : FullData k dx dz => (FullData.toCoordinates w).2.2.1) exact continuous_induced_dom.measurable.snd.snd.fst
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.measurable_fullData_X · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ObservedMarginAssembly.lean:16
theorem measurable_fullData_Z

The full-data reference-proxy coordinate map is measurable. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
Measurable (fun w : FullData k dx dz => w.Z)
Proof (Lean source)
-- @node: measurable_fullData_Z lemma measurable_fullData_Z {k dx dz : ℕ} : Measurable (fun w : FullData k dx dz => w.Z) := by change Measurable (fun w : FullData k dx dz => (FullData.toCoordinates w).2.2.2.1) exact continuous_induced_dom.measurable.snd.snd.snd.fst
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.measurable_fullData_Z · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ObservedMarginAssembly.lean:23
theorem measurable_fullData_Y

The full-data observed-outcome coordinate map is measurable. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
Measurable (fun w : FullData k dx dz => w.Y)
Proof (Lean source)
-- @node: measurable_fullData_Y lemma measurable_fullData_Y {k dx dz : ℕ} : Measurable (fun w : FullData k dx dz => w.Y) := by change Measurable (fun w : FullData k dx dz => (FullData.toCoordinates w).2.2.2.2.2.2) exact continuous_induced_dom.measurable.snd.snd.snd.snd.snd.snd
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.measurable_fullData_Y · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ObservedMarginAssembly.lean:30

Each binary potential-outcome coordinate map is measurable. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
t :
Measurable (@potential k dx dz t)
Proof (Lean source)
-- @node: measurable_potential lemma measurable_potential {k dx dz : ℕ} (t : Bool) : Measurable (@potential k dx dz t) := by cases t with | false => change Measurable (fun w : FullData k dx dz => (FullData.toCoordinates w).2.2.2.2.1) exact continuous_induced_dom.measurable.snd.snd.snd.snd.fst | true => change Measurable (fun w : FullData k dx dz => (FullData.toCoordinates w).2.2.2.2.2.1) exact continuous_induced_dom.measurable.snd.snd.snd.snd.snd.fst
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.measurable_potential · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ObservedMarginAssembly.lean:38
theorem measurable_obs_X

The observed target-proxy coordinate map is measurable. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx dz :
Measurable (fun o : Obs dx dz => o.X)
Proof (Lean source)
-- @node: measurable_obs_X lemma measurable_obs_X {dx dz : ℕ} : Measurable (fun o : Obs dx dz => o.X) := by change Measurable (fun o : Obs dx dz => (Obs.toCoordinates o).2.1) exact continuous_induced_dom.measurable.snd.fst
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.measurable_obs_X · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ObservedMarginAssembly.lean:52
theorem measurable_obs_Z

The observed reference-proxy coordinate map is measurable. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx dz :
Measurable (fun o : Obs dx dz => o.Z)
Proof (Lean source)
-- @node: measurable_obs_Z lemma measurable_obs_Z {dx dz : ℕ} : Measurable (fun o : Obs dx dz => o.Z) := by change Measurable (fun o : Obs dx dz => (Obs.toCoordinates o).2.2.1) exact continuous_induced_dom.measurable.snd.snd.fst
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.measurable_obs_Z · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ObservedMarginAssembly.lean:58
theorem measurable_obs_Y

The observed outcome coordinate map is measurable. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx dz :
Measurable (fun o : Obs dx dz => o.Y)
Proof (Lean source)
-- @node: measurable_obs_Y lemma measurable_obs_Y {dx dz : ℕ} : Measurable (fun o : Obs dx dz => o.Y) := by change Measurable (fun o : Obs dx dz => (Obs.toCoordinates o).2.2.2) exact continuous_induced_dom.measurable.snd.snd.snd
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.measurable_obs_Y · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ObservedMarginAssembly.lean:64
theorem conditionalMean_fullDataArm_eq_sum_latentCell

A conditional mean on a treatment arm is the finite mixture of the conditional means on its latent cells. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
t :
f :
FullData k dx dz → ℝ
hf :
∀ u : Fin k, IntegrableOn f (latentCell u t) P
hArm :
0 < P.real {w | w.T = t}
conditionalMean P {w | w.T = t} f
= ∑ u : Fin k, (P.real (latentCell u t) / P.real {w | w.T = t}) * conditionalMean P (latentCell u t) f
Proof (Lean source)
-- @node: conditionalMean_fullDataArm_eq_sum_latentCell lemma conditionalMean_fullDataArm_eq_sum_latentCell {k dx dz : ℕ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (t : Bool) (f : FullData k dx dz → ℝ) (hf : ∀ u : Fin k, IntegrableOn f (latentCell u t) P) (hArm : 0 < P.real {w | w.T = t}) : conditionalMean P {w | w.T = t} f = ∑ u : Fin k, (P.real (latentCell u t) / P.real {w | w.T = t}) * conditionalMean P (latentCell u t) f := by have hdisj : Pairwise (fun u v : Fin k => Disjoint (latentCell (dx := dx) (dz := dz) u t) (latentCell v t)) := by intro u v huv rw [Set.disjoint_left] intro w hwu hwv exact huv (hwu.1.symm.trans hwv.1) have hint : (∫ w in {w : FullData k dx dz | w.T = t}, f w ∂P) = ∑ u : Fin k, ∫ w in latentCell u t, f w ∂P := by rw [fullDataArm_eq_iUnion_latentCell] exact integral_iUnion_fintype (fun u => measurableSet_latentCell u t) hdisj hf rw [conditionalMean, hint, Finset.mul_sum] apply Finset.sum_congr rfl intro u _ unfold conditionalMean by_cases hcell : P.real (latentCell u t) = 0 · have hcell' : P (latentCell u t) = 0 := (measureReal_eq_zero_iff (measure_ne_top P (latentCell u t))).mp hcell simp [hcell, setIntegral_measure_zero f hcell'] · field_simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.conditionalMean_fullDataArm_eq_sum_latentCell · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ObservedMarginAssembly.lean:70
theorem latentCell_ZX_conditionalMean_factorization

Reference-proxy separation factors each latent-cell proxy cross moment, using bounded clamped representatives of the proxy coordinates. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hL :
1 ≤ L
hpi :
0 < pi0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
u :
Fin k
t :
i :
Fin dz
j :
Fin dx
conditionalMean P (latentCell u t) (fun w => w.Z i * w.X j)
= conditionalMean P (latentCell u t) (fun w => w.Z i) * conditionalMean P (latentCell u t) (fun w => w.X j)
Proof (Lean source)
-- @node: latentCell_ZX_conditionalMean_factorization lemma latentCell_ZX_conditionalMean_factorization {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hk : 2 ≤ k) (hkx : k ≤ dx) (hL : 1 ≤ L) (hpi : 0 < pi0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (u : Fin k) (t : Bool) (i : Fin dz) (j : Fin dx) : conditionalMean P (latentCell u t) (fun w => w.Z i * w.X j) = conditionalMean P (latentCell u t) (fun w => w.Z i) * conditionalMean P (latentCell u t) (fun w => w.X j) := by have hpos := latentCell_pos_of_latentArmPositivity P hpi hM.latentArmPositivity u t have hb := proxy_coordinate_bounds_of_model P hk hkx hM have hZb : ∀ᵐ w ∂P.restrict (latentCell u t), |w.Z i| ≤ L := ae_restrict_of_ae (hb.2.1.mono fun w hw => hw i) have hXb : ∀ᵐ w ∂P.restrict (latentCell u t), |w.X j| ≤ L := ae_restrict_of_ae (hb.1.mono fun w hw => hw j) let Zc : FullData k dx dz → ℝ := fun w => clampReal L (w.Z i) let Xc : FullData k dx dz → ℝ := fun w => clampReal L (w.X j) have hfac := referenceProxySeparation_to_normalizedFactorization hM.referenceProxySeparation u t hpos have hfact := hfac (fun z => clampReal L (z i)) (fun xy => clampReal L (xy.1 j)) (measurable_clampReal (measurable_pi_apply i) L) (measurable_clampReal ((measurable_pi_apply j).comp measurable_fst) L) ⟨L, fun z => abs_clampReal_le L (z i) (zero_le_one.trans hL)⟩ ⟨L, fun xy => abs_clampReal_le L (xy.1 j) (zero_le_one.trans hL)⟩ rw [conditionalMean_eq_normalizedRestrictedIntegral hpos, conditionalMean_eq_normalizedRestrictedIntegral hpos, conditionalMean_eq_normalizedRestrictedIntegral hpos] calc normalizedRestrictedIntegral P (latentCell u t) (fun w => w.Z i * w.X j) = normalizedRestrictedIntegral P (latentCell u t) (fun w => Zc w * Xc w) := by apply integral_congr_ae exact (ae_normalizedRestrict_iff hpos).mpr <| by filter_upwards [hZb, hXb] with w hz hx simp only [Zc, Xc, clampReal_eq_self hz, clampReal_eq_self hx] _ = normalizedRestrictedIntegral P (latentCell u t) Zc * normalizedRestrictedIntegral P (latentCell u t) Xc := by simpa only [Zc, Xc, normalizedRestrictedIntegral] using hfact _ = normalizedRestrictedIntegral P (latentCell u t) (fun w => w.Z i) * normalizedRestrictedIntegral P (latentCell u t) (fun w => w.X j) := by congr 1 <;> apply integral_congr_ae · exact (ae_normalizedRestrict_iff hpos).mpr <| hZb.mono fun w hz => by simpa only [Zc] using clampReal_eq_self hz · exact (ae_normalizedRestrict_iff hpos).mpr <| hXb.mono fun w hx => by simpa only [Xc] using clampReal_eq_self hx
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.latentCell_ZX_conditionalMean_factorization · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ObservedMarginAssembly.lean:101
theorem latentCell_X_conditionalMean_eq_latentClass

Target-proxy separation makes the target-proxy conditional mean invariant across treatment arms within a latent class. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hL :
1 ≤ L
hpi :
0 < pi0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
u :
Fin k
t :
j :
Fin dx
conditionalMean P (latentCell u t) (fun w => w.X j)
= conditionalMean P (latentClass u) (fun w => w.X j)
Proof (Lean source)
-- @node: latentCell_X_conditionalMean_eq_latentClass lemma latentCell_X_conditionalMean_eq_latentClass {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hk : 2 ≤ k) (hkx : k ≤ dx) (hL : 1 ≤ L) (hpi : 0 < pi0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (u : Fin k) (t : Bool) (j : Fin dx) : conditionalMean P (latentCell u t) (fun w => w.X j) = conditionalMean P (latentClass u) (fun w => w.X j) := by let A : Set (FullData k dx dz) := {w | w.T = t} let C : Set (FullData k dx dz) := latentClass u let f : (Fin dx → ℝ) → ℝ := fun x => clampReal L (x j) let q : (ℝ × Bool) → ℝ := fun yt => if yt.2 = t then 1 else 0 have hcellpos := latentCell_pos_of_latentArmPositivity P hpi hM.latentArmPositivity u t have hclasspos : 0 < P.real C := by have hsub : latentCell u t ⊆ C := fun _ hw => hw.1 exact lt_of_lt_of_le hpi ((hM.latentArmPositivity u t).trans (measureReal_mono hsub)) have hcellreal : 0 < P.real (latentCell u t) := lt_of_lt_of_le hpi (hM.latentArmPositivity u t) have hfac := hM.targetProxySeparation u f q (measurable_clampReal (measurable_pi_apply j) L) (by dsimp [q] apply Measurable.ite · exact measurable_snd (measurableSet_singleton t) · fun_prop · fun_prop) ⟨L, fun x => abs_clampReal_le L (x j) (zero_le_one.trans hL)⟩ ⟨1, fun yt => by dsimp [q]; split <;> simp⟩ have hinter : C ∩ A = latentCell u t := by ext w simp [C, A, latentClass, latentCell] have hprod : (fun w : FullData k dx dz => f w.X * q (w.Y, w.T)) = A.indicator (fun w => f w.X) := by funext w by_cases hw : w ∈ A · have hw' : w.T = t := hw simp [A, f, q, hw, hw'] · have hw' : w.T ≠ t := by simpa [A] using hw simp [A, f, q, hw, hw'] have hq : (fun w : FullData k dx dz => q (w.Y, w.T)) = A.indicator (fun _ => (1 : ℝ)) := by funext w by_cases hw : w ∈ A · have hw' : w.T = t := hw simp [A, q, hw, hw'] · have hw' : w.T ≠ t := by simpa [A] using hw simp [A, q, hw, hw'] rw [hprod, hq] at hfac unfold conditionalMean at hfac rw [setIntegral_indicator (measurableSet_fullDataArm t), setIntegral_indicator (measurableSet_fullDataArm t), hinter] at hfac have hclamp : conditionalMean P (latentCell u t) (fun w => f w.X) = conditionalMean P C (fun w => f w.X) := by unfold conditionalMean dsimp [C] at hclasspos ⊢ have hclassne := ne_of_gt hclasspos have hcellne := ne_of_gt hcellreal have hone : (∫ _w in latentCell u t, (1 : ℝ) ∂P) = P.real (latentCell u t) := by simp [Measure.real] rw [hone] at hfac field_simp at hfac ⊢ nlinarith have hb := (proxy_coordinate_bounds_of_model P hk hkx hM).1 have hcellb : ∀ᵐ w ∂P.restrict (latentCell u t), |w.X j| ≤ L := ae_restrict_of_ae (hb.mono fun w hw => hw j) have hclassb : ∀ᵐ w ∂P.restrict C, |w.X j| ≤ L := ae_restrict_of_ae (hb.mono fun w hw => hw j) calc conditionalMean P (latentCell u t) (fun w => w.X j) = conditionalMean P (latentCell u t) (fun w => f w.X) := by unfold conditionalMean congr 1 apply integral_congr_ae exact hcellb.mono fun w hw => by simp only [f, clampReal_eq_self hw] _ = conditionalMean P C (fun w => f w.X) := hclamp _ = conditionalMean P (latentClass u) (fun w => w.X j) := by unfold conditionalMean congr 1 apply integral_congr_ae exact hclassb.mono fun w hw => by simp only [f, clampReal_eq_self hw]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.latentCell_X_conditionalMean_eq_latentClass · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ObservedMarginAssembly.lean:151
theorem observedProxyMoment_factorization Lemma 4 in the paper ↗

The observed armwise proxy moment has the latent finite-mixture factorization. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hL :
1 ≤ L
hpi :
0 < pi0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
t :
Proof (Lean source)
-- @node: observedProxyMoment_factorization lemma observedProxyMoment_factorization {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hk : 2 ≤ k) (hkx : k ≤ dx) (hL : 1 ≤ L) (hpi : 0 < pi0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (t : Bool) : observedProxyMoment (obsSummary P) t = referenceFeature P t * latentArmWeights P t * (targetFeature P).transpose := by ext i j have hb := proxy_coordinate_bounds_of_model P hk hkx hM have hint : ∀ u : Fin k, IntegrableOn (fun w : FullData k dx dz => w.Z i * w.X j) (latentCell u t) P := by intro u apply IntegrableOn.of_bound (measure_lt_top P (latentCell u t)) · exact ((measurable_pi_apply i).comp measurable_fullData_Z).mul ((measurable_pi_apply j).comp measurable_fullData_X) |>.aestronglyMeasurable · exact ae_restrict_of_ae <| by filter_upwards [hb.2.1, hb.1] with w hz hx rw [Real.norm_eq_abs, abs_mul] exact mul_le_mul (hz i) (hx j) (abs_nonneg _) (zero_le_one.trans hL) have harmpos : 0 < P.real {w : FullData k dx dz | w.T = t} := by exact lt_of_lt_of_le (mul_pos (Nat.cast_pos.mpr (by omega)) hpi) (arm_mass_lower_of_latentArmPositivity P hM.latentArmPositivity t) have hmix := conditionalMean_fullDataArm_eq_sum_latentCell P t (fun w => w.Z i * w.X j) hint harmpos have hobs : conditionalMean (obsLaw P) (obsArm t) (fun o => o.Z i * o.X j) = conditionalMean P {w | w.T = t} (fun w => w.Z i * w.X j) := by exact conditionalMean_obsArm_eq_fullDataArm P t _ <| by exact ((measurable_pi_apply i).comp <| by change Measurable (fun o : Obs dx dz => (Obs.toCoordinates o).2.2.1) exact continuous_induced_dom.measurable.snd.snd.fst).mul ((measurable_pi_apply j).comp <| by change Measurable (fun o : Obs dx dz => (Obs.toCoordinates o).2.1) exact continuous_induced_dom.measurable.snd.fst) have heval : observedProxyMoment (obsSummary P) t i j = conditionalMean (obsLaw P) (obsArm t) (fun o => o.Z i * o.X j) := by cases t <;> rfl rw [heval, hobs, hmix] simp only [Matrix.mul_apply, Matrix.transpose_apply, latentArmWeights, Matrix.diagonal_apply, mul_ite, mul_zero, Finset.sum_ite_irrel, Finset.mem_univ, if_true] apply Finset.sum_congr rfl intro u _ rw [latentCell_ZX_conditionalMean_factorization P hk hkx hL hpi hM u t i j, latentCell_X_conditionalMean_eq_latentClass P hk hkx hL hpi hM u t j] simp only [referenceFeature, targetFeature] simp ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.observedProxyMoment_factorization · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ObservedMarginAssembly.lean:237
theorem matrixCLM_conditionalOuterMoment_eq_integral

Entrywise conditional outer-product moments agree with the Bochner integral of the corresponding continuous-linear maps under the normalized cell law. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
C :
Set (FullData k dx dz)
hCpos :
0 < P C
hcoord :
∀ i j, Integrable (fun w => w.Z i * w.X j) (normalizedRestrict P C)
hmap :
matrixCLM (fun i j => conditionalMean P C (fun w => w.Z i * w.X j))
= ∫ w, matrixCLM (outerProduct w.Z w.X) ∂normalizedRestrict P C
Proof (Lean source)
-- @node: matrixCLM_conditionalOuterMoment_eq_integral lemma matrixCLM_conditionalOuterMoment_eq_integral {k dx dz : ℕ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (C : Set (FullData k dx dz)) (hCpos : 0 < P C) (hcoord : ∀ i j, Integrable (fun w => w.Z i * w.X j) (normalizedRestrict P C)) (hmap : Integrable (fun w => matrixCLM (outerProduct w.Z w.X)) (normalizedRestrict P C)) : matrixCLM (fun i j => conditionalMean P C (fun w => w.Z i * w.X j)) = ∫ w, matrixCLM (outerProduct w.Z w.X) ∂normalizedRestrict P C := by ext x i rw [ContinuousLinearMap.integral_apply hmap x] have happ : Integrable (fun w => matrixCLM (outerProduct w.Z w.X) x) (normalizedRestrict P C) := (ContinuousLinearMap.apply ℝ (Euc dz) x).integrable_comp hmap rw [eval_integral_piLp (fun a => happ.eval_piLp a) i] simp only [matrixCLM, Matrix.toEuclideanLin_apply, outerProduct] change (∑ j, conditionalMean P C (fun w => w.Z i * w.X j) * x j) = (∫ w, ∑ j, (w.Z i * w.X j) * x j ∂normalizedRestrict P C) rw [integral_finsetSum] · apply Finset.sum_congr rfl intro j _ rw [conditionalMean_eq_normalizedRestrictedIntegral hCpos] unfold normalizedRestrictedIntegral exact (integral_mul_const (μ := normalizedRestrict P C) (x j) (fun w : FullData k dx dz => w.Z i * w.X j)).symm · intro j _ exact (hcoord i j).mul_const (x j)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.matrixCLM_conditionalOuterMoment_eq_integral · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ObservedMarginAssembly.lean:288
theorem matrixCLM_conditionalMatrix_eq_integral

A matrix of scalar conditional means is the Bochner conditional mean of the corresponding matrix-valued random element. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
C :
Set (FullData k dx dz)
hCpos :
0 < P C
A :
FullData k dx dz → RectMatrix dz dx
hcoord :
∀ i j, Integrable (fun w => A w i j) (normalizedRestrict P C)
hmap :
Integrable (fun w => matrixCLM (A w)) (normalizedRestrict P C)
matrixCLM (fun i j => conditionalMean P C (fun w => A w i j))
= ∫ w, matrixCLM (A w) ∂normalizedRestrict P C
Proof (Lean source)
-- @node: matrixCLM_conditionalMatrix_eq_integral lemma matrixCLM_conditionalMatrix_eq_integral {k dx dz : ℕ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (C : Set (FullData k dx dz)) (hCpos : 0 < P C) (A : FullData k dx dz → RectMatrix dz dx) (hcoord : ∀ i j, Integrable (fun w => A w i j) (normalizedRestrict P C)) (hmap : Integrable (fun w => matrixCLM (A w)) (normalizedRestrict P C)) : matrixCLM (fun i j => conditionalMean P C (fun w => A w i j)) = ∫ w, matrixCLM (A w) ∂normalizedRestrict P C := by ext x i rw [ContinuousLinearMap.integral_apply hmap x] have happ : Integrable (fun w => matrixCLM (A w) x) (normalizedRestrict P C) := (ContinuousLinearMap.apply ℝ (Euc dz) x).integrable_comp hmap rw [eval_integral_piLp (fun a => happ.eval_piLp a) i] simp only [matrixCLM, Matrix.toEuclideanLin_apply] change (∑ j, conditionalMean P C (fun w => A w i j) * x j) = (∫ w, ∑ j, A w i j * x j ∂normalizedRestrict P C) rw [integral_finsetSum] · apply Finset.sum_congr rfl intro j _ rw [conditionalMean_eq_normalizedRestrictedIntegral hCpos] unfold normalizedRestrictedIntegral exact (integral_mul_const (μ := normalizedRestrict P C) (x j) (fun w : FullData k dx dz => A w i j)).symm · intro j _ exact (hcoord i j).mul_const (x j)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.matrixCLM_conditionalMatrix_eq_integral · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/ObservedMarginAssembly.lean:318
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.OrderedMassStability 5 declarations Ordered masses of locally separated finite atomic laws

Ordered masses of locally separated finite atomic laws

theorem orderedMasses_eq_of_measureEquivalent Lemma 17 in the paper ↗

Ordered aggregate masses depend only on the represented probability measure, despite being computed from a chosen finite representative. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
nu xi :
AtomicLaw.ProbabilityLaw k radius
h :
nu.MeasureEquivalent xi
Proof (Lean source)
lemma orderedMasses_eq_of_measureEquivalent {k : ℕ} {radius : ℝ} (nu xi : AtomicLaw.ProbabilityLaw k radius) (h : nu.MeasureEquivalent xi) : orderedMasses nu.1 = orderedMasses xi.1 := by classical have hsupp := support_eq_of_measureEquivalent nu xi h by_cases hfull : nu.1.support.card = k · have hfullXi : xi.1.support.card = k := by rw [← hsupp]; exact hfull obtain ⟨hnuPos, hnuInj⟩ := (full_support_iff nu.1 nu.2).mp hfull obtain ⟨hxiPos, hxiInj⟩ := (full_support_iff xi.1 xi.2).mp hfullXi funext a obtain ⟨i, hi⟩ := (rank_bijective nu.1 hnuInj).2 a have hi' : a = ⟨atomicRank nu.1 i, atomicRank_lt nu.1 i⟩ := hi.symm rw [hi', orderedMasses_apply_rank nu.1 hnuPos hnuInj i] have hatomMem : nu.1.atom i ∈ xi.1.support := by rw [← hsupp] exact Finset.mem_image.mpr ⟨i, Finset.mem_filter.mpr ⟨Finset.mem_univ _, hnuPos i⟩, rfl⟩ rcases Finset.mem_image.mp hatomMem with ⟨j, hj, hji⟩ have hjpos := (Finset.mem_filter.mp hj).2 have hweightEq : nu.1.weight i = xi.1.weight j := by have ha := h.aggregate_weight (nu.1.atom i) have hnuSum : ∑ l with nu.1.atom l = nu.1.atom i, nu.1.weight l = nu.1.weight i := by apply Finset.sum_eq_single i · intro l hl hli exact elim (hli (hnuInj (Finset.mem_filter.mp hl).2)) · simp have hxiSum : ∑ l with xi.1.atom l = nu.1.atom i, xi.1.weight l = xi.1.weight j := by apply Finset.sum_eq_single j · intro l hl hlj exact elim (hlj (hxiInj ((Finset.mem_filter.mp hl).2.trans hji.symm))) · simp [hji] rwa [hnuSum, hxiSum] at ha have hmatch (l : Fin k) : ∃ q : Fin k, xi.1.atom q = nu.1.atom l := by have hm : nu.1.atom l ∈ xi.1.support := by rw [← hsupp] exact Finset.mem_image.mpr ⟨l, Finset.mem_filter.mpr ⟨Finset.mem_univ _, hnuPos l⟩, rfl⟩ rcases Finset.mem_image.mp hm with ⟨q, _hq, hql⟩ exact ⟨q, hql⟩ let psi : Fin k → Fin k := fun l => choose (hmatch l) have hpsi (l : Fin k) : xi.1.atom (psi l) = nu.1.atom l := Classical.choose_spec (hmatch l) have hpsiInj : Injective psi := by intro l q heq apply hnuInj rw [← hpsi l, ← hpsi q, heq] have hpsiBij : Bijective psi := ⟨hpsiInj, Finite.surjective_of_injective hpsiInj⟩ have hrankEq : atomicRank nu.1 i = atomicRank xi.1 j := by unfold atomicRank apply Finset.card_bijective psi hpsiBij intro l simp only [mem_filter, Finset.mem_univ, true_and] rw [hpsi, ← hji] have hfin : (⟨atomicRank nu.1 i, atomicRank_lt nu.1 i⟩ : Fin k) = ⟨atomicRank xi.1 j, atomicRank_lt xi.1 j⟩ := Fin.ext hrankEq rw [hfin, orderedMasses_apply_rank xi.1 hxiPos hxiInj j, hweightEq] · have hfullXi : xi.1.support.card ≠ k := by rwa [← hsupp] unfold orderedMasses rw [if_neg (fun hcond => hfull ((full_support_iff nu.1 nu.2).mpr hcond)), if_neg (fun hcond => hfullXi ((full_support_iff xi.1 xi.2).mpr hcond))]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.orderedMasses_eq_of_measureEquivalent · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/OrderedMassStability.lean:132
theorem orderedMasses_representative_measurable

Ordered masses descend to a measurable function on extensional atomic laws. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
Measurable (fun q : AtomicLaw.LawModulo k radius => orderedMasses q.representative.1)
Proof (Lean source)
lemma orderedMasses_representative_measurable {k : ℕ} {radius : ℝ} : Measurable (fun q : AtomicLaw.LawModulo k radius => orderedMasses q.representative.1) := by have heq : (fun q : AtomicLaw.LawModulo k radius => orderedMasses q.representative.1) ∘ AtomicLaw.LawModulo.ofProbabilityLaw = fun nu : AtomicLaw.ProbabilityLaw k radius => orderedMasses nu.1 := by funext nu apply orderedMasses_eq_of_measureEquivalent change (AtomicLaw.probabilityLawSetoid k radius).r (AtomicLaw.LawModulo.ofProbabilityLaw nu).representative nu exact (Quotient.eq_mk_iff_out (x := AtomicLaw.LawModulo.ofProbabilityLaw nu) (y := nu)).mp rfl change Measurable ((fun q : AtomicLaw.LawModulo k radius => orderedMasses q.representative.1) ∘ AtomicLaw.LawModulo.ofProbabilityLaw) rw [heq] exact orderedMasses_measurable.comp measurable_subtype_coe
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.orderedMasses_representative_measurable · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/OrderedMassStability.lean:194
theorem orderedWeightEstimator_measurable

The canonical ordered-weight estimator is measurable. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 :
R :
SummaryRepairData k dx dz n L pi0 sigma0
Proof (Lean source)
lemma orderedWeightEstimator_measurable {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} (R : SummaryRepairData k dx dz n L pi0 sigma0) : Measurable (orderedWeightEstimator R) := by exact orderedMasses_representative_measurable.comp R.measurableRepair
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.orderedWeightEstimator_measurable · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/OrderedMassStability.lean:213
theorem orderedMasses_l1_le_four_mul_wass1_div_gap

Below the localization radius, ordered atomic weights are Lipschitz in W₁ with the expected inverse support-gap factor. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius m delta :
nu xi :
AtomicLaw k radius
hnu :
AtomicLaw.Valid nu
hxi :
AtomicLaw.Valid xi
hm :
0 < m
hdelta :
0 < delta
hweight :
∀ i, m ≤ nu.weight i
hinj :
Injective nu.atom
hgap :
∀ i j
if
i ≠ j
then
delta ≤ |nu.atom i - nu.atom j|
hsmall :
AtomicLaw.wass1 nu xi < m * delta / 4
∑ a, |orderedMasses xi a - orderedMasses nu a| ≤ 4 * AtomicLaw.wass1 nu xi / delta
Proof (Lean source)
theorem orderedMasses_l1_le_four_mul_wass1_div_gap {k : ℕ} {radius m delta : ℝ} (nu xi : AtomicLaw k radius) (hnu : AtomicLaw.Valid nu) (hxi : AtomicLaw.Valid xi) (hm : 0 < m) (hdelta : 0 < delta) (hweight : ∀ i, m ≤ nu.weight i) (hinj : Injective nu.atom) (hgap : ∀ i j, i ≠ j → delta ≤ |nu.atom i - nu.atom j|) (hsmall : AtomicLaw.wass1 nu xi < m * delta / 4) : ∑ a, |orderedMasses xi a - orderedMasses nu a| ≤ 4 * AtomicLaw.wass1 nu xi / delta := by classical obtain ⟨gamma, hgamma⟩ := AtomicLaw.wass1_optimal_plan hnu hxi have hnear (i : Fin k) : ∃ j : Fin k, 0 < xi.weight j ∧ |nu.atom i - xi.atom j| < delta / 4 := by by_contra hnone push_neg at hnone have hrow (j : Fin k) : gamma.mass i j * (delta / 4) ≤ gamma.mass i j * |nu.atom i - xi.atom j| := by by_cases hz : gamma.mass i j = 0 · simp [hz] · have hmass : 0 < gamma.mass i j := lt_of_le_of_ne (gamma.nonneg i j) (Ne.symm hz) have hxipos : 0 < xi.weight j := by rw [← gamma.snd_marginal j] exact lt_of_lt_of_le hmass (Finset.single_le_sum (fun l _ => gamma.nonneg l j) (Finset.mem_univ i)) exact mul_le_mul_of_nonneg_left (hnone j hxipos) (gamma.nonneg i j) have hcost : m * delta / 4 ≤ AtomicLaw.transportCost gamma := by calc m * delta / 4 ≤ nu.weight i * (delta / 4) := by nlinarith [hweight i, hdelta] _ = (∑ j, gamma.mass i j) * (delta / 4) := by rw [gamma.fst_marginal] _ = ∑ j, gamma.mass i j * (delta / 4) := by rw [Finset.sum_mul] _ ≤ ∑ j, gamma.mass i j * |nu.atom i - xi.atom j| := Finset.sum_le_sum fun j _ => hrow j _ ≤ ∑ l, ∑ j, gamma.mass l j * |nu.atom l - xi.atom j| := by calc _ = sum {i} (fun l => ∑ j, gamma.mass l j * |nu.atom l - xi.atom j|) := by simp _ ≤ _ := Finset.sum_le_sum_of_subset_of_nonneg (by simp) fun l _ _ => sum_nonneg fun j _ => mul_nonneg (gamma.nonneg l j) (abs_nonneg _) _ = AtomicLaw.transportCost gamma := rfl linarith [hgamma] let phi : Fin k → Fin k := fun i => choose (hnear i) have hphiPos (i : Fin k) : 0 < xi.weight (phi i) := (Classical.choose_spec (hnear i)).1 have hphiClose (i : Fin k) : |nu.atom i - xi.atom (phi i)| < delta / 4 := (Classical.choose_spec (hnear i)).2 have hphiInj : Injective phi := by intro i j hij by_contra hne have hg := hgap i j hne have ht := abs_sub_le (nu.atom i) (xi.atom (phi i)) (nu.atom j) have hclosej : |xi.atom (phi i) - nu.atom j| < delta / 4 := by rw [hij, abs_sub_comm] exact hphiClose j linarith [hphiClose i] have hphiBij : Bijective phi := ⟨hphiInj, Finite.surjective_of_injective hphiInj⟩ let ephi : Fin k ≃ Fin k := Equiv.ofBijective phi hphiBij have hephi (i : Fin k) : ephi i = phi i := rfl have hxiPos (j : Fin k) : 0 < xi.weight j := by obtain ⟨i, rfl⟩ := hphiBij.2 j exact hphiPos i have hxiInj : Injective xi.atom := by intro a b hab obtain ⟨i, rfl⟩ := hphiBij.2 a obtain ⟨j, rfl⟩ := hphiBij.2 b apply congrArg phi apply hinj by_contra hneAtoms have hne : i ≠ j := fun h => hneAtoms (congrArg nu.atom h) have hg := hgap i j hne have ht := abs_sub_le (nu.atom i) (xi.atom (phi i)) (nu.atom j) have hclosej : |xi.atom (phi i) - nu.atom j| < delta / 4 := by rw [hab, abs_sub_comm] exact hphiClose j linarith [hphiClose i] have horder (i j : Fin k) : nu.atom i < nu.atom j ↔ xi.atom (phi i) < xi.atom (phi j) := by constructor · intro hij have hne : i ≠ j := fun h => by subst j; exact (lt_irrefl _ hij) have hg := hgap i j hne rw [abs_of_neg (sub_neg.mpr hij)] at hg have hi := (abs_lt.mp (hphiClose i)).1 have hj := (abs_lt.mp (hphiClose j)).2 linarith · intro hij by_contra hnot have hne : i ≠ j := fun h => by subst j; exact (lt_irrefl _ hij) have hji : nu.atom j < nu.atom i := lt_of_le_of_ne (le_of_not_gt hnot) (hinj.ne hne).symm have hg := hgap j i hne.symm rw [abs_of_neg (sub_neg.mpr hji)] at hg have hj := (abs_lt.mp (hphiClose j)).1 have hi := (abs_lt.mp (hphiClose i)).2 linarith have hrank (i : Fin k) : atomicRank xi (phi i) = atomicRank nu i := by unfold atomicRank symm apply Finset.card_bijective ephi hphiBij intro j simp only [mem_filter, Finset.mem_univ, true_and] simpa [hephi] using horder j i have hl1 : ∑ a, |orderedMasses xi a - orderedMasses nu a| = ∑ i, |xi.weight (phi i) - nu.weight i| := by rw [← (rank_bijective nu hinj).sum_comp] apply Finset.sum_congr rfl intro i _ rw [orderedMasses_apply_rank nu (fun i => hm.trans_le (hweight i)) hinj i] have hfin : (⟨atomicRank nu i, atomicRank_lt nu i⟩ : Fin k) = ⟨atomicRank xi (phi i), atomicRank_lt xi (phi i)⟩ := by apply Fin.ext exact (hrank i).symm rw [hfin, orderedMasses_apply_rank xi hxiPos hxiInj (phi i)] let diag : ℝ := ∑ i, gamma.mass i (phi i) let off : ℝ := 1 - diag have hrowOff (i : Fin k) : 0 ≤ nu.weight i - gamma.mass i (phi i) := by rw [← gamma.fst_marginal i] exact sub_nonneg.mpr (Finset.single_le_sum (fun j _ => gamma.nonneg i j) (Finset.mem_univ (phi i))) have hcolOff (i : Fin k) : 0 ≤ xi.weight (phi i) - gamma.mass i (phi i) := by rw [← gamma.snd_marginal (phi i)] exact sub_nonneg.mpr (Finset.single_le_sum (fun l _ => gamma.nonneg l (phi i)) (Finset.mem_univ i)) have hsumRow : ∑ i, (nu.weight i - gamma.mass i (phi i)) = off := by simp only [Finset.sum_sub_distrib, hnu.2.1, diag, off] have hsumCol : ∑ i, (xi.weight (phi i) - gamma.mass i (phi i)) = off := by rw [Finset.sum_sub_distrib] rw [hphiBij.sum_comp] simp [hxi.2.1, diag, off] have hl1off : ∑ i, |xi.weight (phi i) - nu.weight i| ≤ 2 * off := by calc _ = ∑ i, |(xi.weight (phi i) - gamma.mass i (phi i)) - (nu.weight i - gamma.mass i (phi i))| := by congr 1; funext i; ring _ ≤ ∑ i, ((xi.weight (phi i) - gamma.mass i (phi i)) + (nu.weight i - gamma.mass i (phi i))) := by gcongr with i rw [abs_le] constructor <;> linarith [hrowOff i, hcolOff i] _ = 2 * off := by rw [Finset.sum_add_distrib, hsumCol, hsumRow]; ring have hcost : delta / 2 * off ≤ AtomicLaw.transportCost gamma := by have hoffEq : off = ∑ i, sum (Finset.univ.erase (phi i)) (gamma.mass i) := by have hrow (i : Fin k) : sum (Finset.univ.erase (phi i)) (gamma.mass i) = nu.weight i - gamma.mass i (phi i) := by have hsplit := Finset.sum_erase_add univ (gamma.mass i) (Finset.mem_univ (phi i)) rw [gamma.fst_marginal] at hsplit linarith rw [show off = ∑ i, (nu.weight i - gamma.mass i (phi i)) by symm; exact hsumRow] apply Finset.sum_congr rfl intro i _ exact (hrow i).symm rw [hoffEq] rw [Finset.mul_sum] calc _ = ∑ i, sum (Finset.univ.erase (phi i)) (fun j => gamma.mass i j * (delta / 2)) := by apply Finset.sum_congr rfl intro i _ rw [mul_comm, Finset.sum_mul] _ ≤ ∑ i, sum (Finset.univ.erase (phi i)) (fun j => gamma.mass i j * |nu.atom i - xi.atom j|) := by apply Finset.sum_le_sum intro i _ apply Finset.sum_le_sum intro j hj have hjne : j ≠ phi i := Finset.ne_of_mem_erase hj obtain ⟨l, hl⟩ := hphiBij.2 j have hil : i ≠ l := fun h => hjne (by subst l; exact hl.symm) subst j have hg := hgap i l hil have ht := abs_sub_le (nu.atom i) (xi.atom (phi l)) (nu.atom l) have hdist : delta / 2 ≤ |nu.atom i - xi.atom (phi l)| := by rw [abs_sub_comm (xi.atom (phi l)) (nu.atom l)] at ht linarith [hphiClose l] exact mul_le_mul_of_nonneg_left hdist (gamma.nonneg i (phi l)) _ ≤ ∑ i, ∑ j, gamma.mass i j * |nu.atom i - xi.atom j| := by apply Finset.sum_le_sum intro i _ exact Finset.sum_le_sum_of_subset_of_nonneg (Finset.erase_subset _ _) fun j _ _ => mul_nonneg (gamma.nonneg i j) (abs_nonneg _) _ = AtomicLaw.transportCost gamma := rfl rw [hl1, ← hgamma] have hw0 : 0 ≤ AtomicLaw.transportCost gamma := by unfold AtomicLaw.transportCost exact sum_nonneg fun i _ => sum_nonneg fun j _ => mul_nonneg (gamma.nonneg i j) (abs_nonneg _) have hoffBound : off ≤ 2 * AtomicLaw.transportCost gamma / delta := by rw [le_div_iff₀ hdelta] nlinarith calc ∑ i, |xi.weight (phi i) - nu.weight i| ≤ 2 * off := hl1off _ ≤ 4 * AtomicLaw.transportCost gamma / delta := by rw [show 4 * AtomicLaw.transportCost gamma / delta = 2 * (2 * AtomicLaw.transportCost gamma / delta) by ring] gcongr
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.orderedMasses_l1_le_four_mul_wass1_div_gap · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/OrderedMassStability.lean:219
theorem gapStratum_orderedMasses_l1_le

Gap-stratum membership supplies the positive weights, injectivity, and numerical gap needed by the finite-atomic stability lemma. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 g :
hM :
GapStratum (L := L) (pi0 := pi0) (sigma0 := sigma0) (g := g) P
hg :
0 < g
xi :
AtomicLaw k (effectRadius dz L sigma0)
hxi :
AtomicLaw.Valid xi
hsmall :
AtomicLaw.wass1 (quotientLawRaw P (effectRadius dz L sigma0)) xi < pi0 * (g / 2) / 4
∑ a, |orderedMasses xi a - orderedMasses (quotientLawRaw P (effectRadius dz L sigma0)) a|
≤ 8 * AtomicLaw.wass1 (quotientLawRaw P (effectRadius dz L sigma0)) xi / g
Proof (Lean source)
theorem gapStratum_orderedMasses_l1_le {k dx dz : ℕ} {L pi0 sigma0 g : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hM : GapStratum (L := L) (pi0 := pi0) (sigma0 := sigma0) (g := g) P) (hg : 0 < g) (xi : AtomicLaw k (effectRadius dz L sigma0)) (hxi : AtomicLaw.Valid xi) (hsmall : AtomicLaw.wass1 (quotientLawRaw P (effectRadius dz L sigma0)) xi < pi0 * (g / 2) / 4) : ∑ a, |orderedMasses xi a - orderedMasses (quotientLawRaw P (effectRadius dz L sigma0)) a| ≤ 8 * AtomicLaw.wass1 (quotientLawRaw P (effectRadius dz L sigma0)) xi / g := by rcases hM.toUCVMWModel.coreDomain with ⟨_hk, _hkx, _hkz, _hL, hpi, _hpiMax, _hsigma, _hsigmaMax⟩ have hmass (u : Fin k) : pi0 ≤ latentMass P u := (hM.toUCVMWModel.latentArmPositivity u false).trans (measureReal_mono (fun _ hw => hw.1)) have hmassPos (u : Fin k) : 0 < latentMass P u := hpi.trans_le (hmass u) have hfilter : (Finset.univ.filter fun u : Fin k => 0 < latentMass P u) = Finset.univ := Finset.filter_eq_self.mpr fun u _ => hmassPos u have hcard : ((Finset.univ : Finset (Fin k)).image (latentEffect P)).card = (Finset.univ : Finset (Fin k)).card := by rw [Finset.card_univ] simpa [DistinctEffects, hfilter] using hM.distinctEffects have hinjOn := Finset.card_image_iff.mp hcard have hinj : Injective (latentEffect P) := by intro i j hij exact hinjOn (Finset.mem_univ i) (Finset.mem_univ j) hij have hgap (i j : Fin k) (hij : i ≠ j) : g / 2 ≤ |latentEffect P i - latentEffect P j| := by have hmem : ((|latentEffect P i - latentEffect P j| : ℝ) : EReal) ∈ {d : EReal | ∃ u v : Fin k, 0 < latentMass P u ∧ 0 < latentMass P v ∧ latentEffect P u ≠ latentEffect P v ∧ d = ((|latentEffect P u - latentEffect P v| : ℝ) : EReal)} := by exact ⟨i, j, hmassPos i, hmassPos j, hinj.ne hij, rfl⟩ have hsinf : effectGap P ≤ (|latentEffect P i - latentEffect P j| : ℝ) := sInf_le hmem have := hM.gapWindow.1.trans hsinf exact EReal.coe_le_coe_iff.mp this have hbase := orderedMasses_l1_le_four_mul_wass1_div_gap (quotientLawRaw P (effectRadius dz L sigma0)) xi (quotientLawRaw_valid P hM.toUCVMWModel) hxi hpi (by linarith) hmass hinj hgap hsmall convert hbase using 1 <;> field_simp <;> ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.gapStratum_orderedMasses_l1_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/OrderedMassStability.lean:419
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.OutcomeFactorization 8 declarations Paper-local conditional-moment identities used in the outcome-weighted proxy factorization.

Paper-local conditional-moment identities used in the outcome-weighted proxy factorization.

theorem conditionalMean_potential_latentCell

Armwise latent ignorability identifies the potential-outcome mean on a positive latent-treatment cell with its latent-class mean. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hpi :
0 < pi0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
u :
Fin k
t :
conditionalMean P (latentCell u t) (potential t) = latentMean P t u
Proof (Lean source)
-- @node: outcomeFactorization_conditionalMean_potential_latentCell lemma conditionalMean_potential_latentCell {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hpi : 0 < pi0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (u : Fin k) (t : Bool) : conditionalMean P (latentCell u t) (potential t) = latentMean P t u := by let C : Set (FullData k dx dz) := latentClass u let A : Set (FullData k dx dz) := {w | w.T = t} let μ := normalizedRestrict P C have hcellpos := latentCell_pos_of_latentArmPositivity P hpi hM.latentArmPositivity u t have hCpos : 0 < P C := lt_of_lt_of_le hcellpos <| measure_mono <| by intro w hw exact hw.1 let _ : IsProbabilityMeasure μ := normalizedRestrict_isProbabilityMeasure (measurableSet_latentClass u) hCpos have hfac := latentIgnorability_to_normalizedFactorization hM.latentIgnorability u t hCpos have hInd : IndepFun (fun w : FullData k dx dz => w.T) (potential t) μ := (indepFun_of_boundedTestFactorization (measurable_potential t) measurable_fullData_T hfac).symm have hdrop := hInd.integral_restrict_preimage_eq_mul measurable_fullData_T.aemeasurable (measurable_potential t).aemeasurable (measurableSet_singleton t) (measurableSet_fullDataArm t) (continuous_id.aestronglyMeasurable : AEStronglyMeasurable (fun x : ℝ => x) (μ.map (potential t))) have hA : (fun w : FullData k dx dz => w.T) ⁻¹' ({t} : Set Bool) = A := by ext w simp [A] rw [hA] at hdrop have hAC : A ∩ C = latentCell u t := by ext w simp [A, C, latentCell, latentClass, and_comm] have hmuA : (μ A).toReal = P.real (latentCell u t) / P.real C := by rw [normalizedRestrict_apply hCpos (measurableSet_fullDataArm t), hAC] simp [Measure.real] field_simp have hleft : (∫ w in A, potential t w ∂μ) = (P.real C)⁻¹ * ∫ w in latentCell u t, potential t w ∂P := by change (∫ w, potential t w ∂((P C)⁻¹ • P.restrict C).restrict A) = _ rw [Measure.restrict_smul, Measure.restrict_restrict (measurableSet_fullDataArm t), hAC, MeasureTheory.integral_smul_measure, ENNReal.toReal_inv] simp [Measure.real] have hright : (∫ w, potential t w ∂μ) = (P.real C)⁻¹ * ∫ w in C, potential t w ∂P := by rw [← normalizedRestrictedIntegral] exact normalizedRestrictedIntegral_eq hCpos (potential t) simp only [id_eq] at hdrop rw [hleft, hright, hmuA] at hdrop unfold latentMean conditionalMean dsimp [C] at hdrop ⊢ have hcellreal : P.real (latentCell u t) ≠ 0 := ne_of_gt (ENNReal.toReal_pos hcellpos.ne' (measure_ne_top _ _)) have hCreal : P.real (latentClass u) ≠ 0 := ne_of_gt (ENNReal.toReal_pos hCpos.ne' (measure_ne_top _ _)) field_simp at hdrop ⊢ nlinarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.conditionalMean_potential_latentCell · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/OutcomeFactorization.lean:13
theorem conditionalMean_observed_eq_potential

Consistency replaces the observed outcome by the arm-specific potential outcome inside a latent-treatment cell. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
u :
Fin k
t :
conditionalMean P (latentCell u t) (fun w => w.Y)
= conditionalMean P (latentCell u t) (potential t)
Proof (Lean source)
-- @node: outcomeFactorization_conditionalMean_observed_eq_potential lemma conditionalMean_observed_eq_potential {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (u : Fin k) (t : Bool) : conditionalMean P (latentCell u t) (fun w => w.Y) = conditionalMean P (latentCell u t) (potential t) := by unfold conditionalMean congr 1 apply integral_congr_ae filter_upwards [ae_restrict_of_ae hM.consistency, self_mem_ae_restrict (measurableSet_latentCell u t)] with w hcons hw have ht : w.T = t := hw.2 simpa [ht] using hcons
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.conditionalMean_observed_eq_potential · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/OutcomeFactorization.lean:74
theorem conditionalMean_observed_latentCell

Consequently the observed outcome mean on each latent-treatment cell equals the latent potential-outcome mean from the roadmap's factorization. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hpi :
0 < pi0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
u :
Fin k
t :
conditionalMean P (latentCell u t) (fun w => w.Y) = latentMean P t u
Proof (Lean source)
-- @node: outcomeFactorization_conditionalMean_observed_latentCell lemma conditionalMean_observed_latentCell {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hpi : 0 < pi0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (u : Fin k) (t : Bool) : conditionalMean P (latentCell u t) (fun w => w.Y) = latentMean P t u := by rw [conditionalMean_observed_eq_potential P hM u t] exact conditionalMean_potential_latentCell P hpi hM u t
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.conditionalMean_observed_latentCell · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/OutcomeFactorization.lean:92
theorem conditionalMean_target_mul_observed

Target-proxy separation remains valid after conditioning on treatment because the separated second random element contains both the outcome and treatment coordinates. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hpi :
0 < pi0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
u :
Fin k
t :
j :
Fin dx
conditionalMean P (latentCell u t) (fun w => w.X j * w.Y)
= targetFeature P j u * conditionalMean P (latentCell u t) (fun w => w.Y)
Proof (Lean source)
-- @node: outcomeFactorization_conditionalMean_target_mul_observed lemma conditionalMean_target_mul_observed {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hpi : 0 < pi0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (u : Fin k) (t : Bool) (j : Fin dx) : conditionalMean P (latentCell u t) (fun w => w.X j * w.Y) = targetFeature P j u * conditionalMean P (latentCell u t) (fun w => w.Y) := by let C : Set (FullData k dx dz) := latentClass u let A : Set (FullData k dx dz) := {w | w.T = t} let μ := normalizedRestrict P C have hcellpos := latentCell_pos_of_latentArmPositivity P hpi hM.latentArmPositivity u t have hCpos : 0 < P C := lt_of_lt_of_le hcellpos <| measure_mono <| by intro w hw exact hw.1 let _ : IsProbabilityMeasure μ := normalizedRestrict_isProbabilityMeasure (measurableSet_latentClass u) hCpos have hfac := targetProxySeparation_to_normalizedFactorization hM.targetProxySeparation u hCpos have hIndVec : IndepFun (fun w : FullData k dx dz => w.X) (fun w => (w.Y, w.T)) μ := indepFun_of_boundedTestFactorization measurable_fullData_X (measurable_fullData_Y.prodMk measurable_fullData_T) hfac have hInd : IndepFun (fun w : FullData k dx dz => w.X j) (fun w => (w.Y, w.T)) μ := hIndVec.comp (measurable_pi_apply j) measurable_id let psi : ℝ × Bool → ℝ := fun yt => if yt.2 = t then yt.1 else 0 have hprod := hInd.integral_fun_comp_mul_comp (((measurable_pi_apply j).comp measurable_fullData_X).aemeasurable) ((measurable_fullData_Y.prodMk measurable_fullData_T).aemeasurable) (continuous_id.aestronglyMeasurable : AEStronglyMeasurable (fun x : ℝ => x) (μ.map fun w => w.X j)) ((by dsimp [psi] exact Measurable.ite (measurable_snd (measurableSet_singleton t)) measurable_fst measurable_const : Measurable psi).aestronglyMeasurable) have hleft : (∫ w, (fun x : ℝ => x) (w.X j) * psi (w.Y, w.T) ∂μ) = ∫ w in A, w.X j * w.Y ∂μ := by rw [← integral_indicator (measurableSet_fullDataArm t)] apply integral_congr_ae filter_upwards [] with w by_cases hw : w.T = t <;> simp [psi, hw] have hy : (∫ w, psi (w.Y, w.T) ∂μ) = ∫ w in A, w.Y ∂μ := by rw [← integral_indicator (measurableSet_fullDataArm t)] apply integral_congr_ae filter_upwards [] with w by_cases hw : w.T = t <;> simp [psi, hw] simp only [id_eq] at hprod rw [hleft, hy] at hprod have hAC : A ∩ C = latentCell u t := by ext w simp [A, C, latentCell, latentClass, and_comm] have scaleSet (f : FullData k dx dz → ℝ) : (∫ w in A, f w ∂μ) = (P.real C)⁻¹ * ∫ w in latentCell u t, f w ∂P := by change (∫ w, f w ∂((P C)⁻¹ • P.restrict C).restrict A) = _ rw [Measure.restrict_smul, Measure.restrict_restrict (measurableSet_fullDataArm t), hAC, MeasureTheory.integral_smul_measure, ENNReal.toReal_inv] simp [Measure.real] have scaleClass : (∫ w, w.X j ∂μ) = (P.real C)⁻¹ * ∫ w in C, w.X j ∂P := by rw [← normalizedRestrictedIntegral] exact normalizedRestrictedIntegral_eq hCpos (fun w => w.X j) rw [scaleSet (fun w => w.X j * w.Y), scaleClass, scaleSet (fun w => w.Y)] at hprod unfold targetFeature conditionalMean dsimp [C] at hprod ⊢ have hcellreal : P.real (latentCell u t) ≠ 0 := ne_of_gt (ENNReal.toReal_pos hcellpos.ne' (measure_ne_top _ _)) have hCreal : P.real (latentClass u) ≠ 0 := ne_of_gt (ENNReal.toReal_pos hCpos.ne' (measure_ne_top _ _)) field_simp at hprod ⊢ nlinarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.conditionalMean_target_mul_observed · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/OutcomeFactorization.lean:105
theorem conditionalMean_targetOutcome_latentCell

The cell target--outcome moment therefore factors into the target feature and the latent potential-outcome mean. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hpi :
0 < pi0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
u :
Fin k
t :
j :
Fin dx
conditionalMean P (latentCell u t) (fun w => w.X j * w.Y)
= targetFeature P j u * latentMean P t u
Proof (Lean source)
-- @node: outcomeFactorization_conditionalMean_targetOutcome_latentCell lemma conditionalMean_targetOutcome_latentCell {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hpi : 0 < pi0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (u : Fin k) (t : Bool) (j : Fin dx) : conditionalMean P (latentCell u t) (fun w => w.X j * w.Y) = targetFeature P j u * latentMean P t u := by rw [conditionalMean_target_mul_observed P hpi hM u t j, conditionalMean_observed_latentCell P hpi hM u t]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.conditionalMean_targetOutcome_latentCell · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/OutcomeFactorization.lean:180
theorem conditionalMean_reference_targetOutcome

Reference-proxy separation factors the outcome-weighted proxy product on each positive latent-treatment cell. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hpi :
0 < pi0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
u :
Fin k
t :
i :
Fin dz
j :
Fin dx
conditionalMean P (latentCell u t) (fun w => w.Z i * w.X j * w.Y)
= conditionalMean P (latentCell u t) (fun w => w.Z i) * conditionalMean P (latentCell u t) (fun w => w.X j * w.Y)
Proof (Lean source)
-- @node: outcomeFactorization_conditionalMean_reference_targetOutcome lemma conditionalMean_reference_targetOutcome {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hpi : 0 < pi0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (u : Fin k) (t : Bool) (i : Fin dz) (j : Fin dx) : conditionalMean P (latentCell u t) (fun w => w.Z i * w.X j * w.Y) = conditionalMean P (latentCell u t) (fun w => w.Z i) * conditionalMean P (latentCell u t) (fun w => w.X j * w.Y) := by let C : Set (FullData k dx dz) := latentCell u t let μ := normalizedRestrict P C have hCpos := latentCell_pos_of_latentArmPositivity P hpi hM.latentArmPositivity u t let _ : IsProbabilityMeasure μ := normalizedRestrict_isProbabilityMeasure (measurableSet_latentCell u t) hCpos have hfac := referenceProxySeparation_to_normalizedFactorization hM.referenceProxySeparation u t hCpos have hIndVec : IndepFun (fun w : FullData k dx dz => w.Z) (fun w => (w.X, w.Y)) μ := indepFun_of_boundedTestFactorization measurable_fullData_Z (measurable_fullData_X.prodMk measurable_fullData_Y) hfac have hInd : IndepFun (fun w : FullData k dx dz => w.Z i) (fun w => (w.X, w.Y)) μ := hIndVec.comp (measurable_pi_apply i) measurable_id have hprod := hInd.integral_fun_comp_mul_comp (((measurable_pi_apply i).comp measurable_fullData_Z).aemeasurable) ((measurable_fullData_X.prodMk measurable_fullData_Y).aemeasurable) (continuous_id.aestronglyMeasurable : AEStronglyMeasurable (fun x : ℝ => x) (μ.map fun w => w.Z i)) (((measurable_pi_apply j).comp measurable_fst).mul measurable_snd).aestronglyMeasurable rw [conditionalMean_eq_normalizedRestrictedIntegral hCpos, conditionalMean_eq_normalizedRestrictedIntegral hCpos, conditionalMean_eq_normalizedRestrictedIntegral hCpos] simpa only [normalizedRestrictedIntegral, id_eq, mul_assoc, Function.comp_apply, Pi.mul_apply] using hprod
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.conditionalMean_reference_targetOutcome · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/OutcomeFactorization.lean:194
theorem latentCell_outcomeProxy_factorization

Combining the two proxy separations, consistency, and latent ignorability gives the cellwise outcome-weighted factorization in equation (16). Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hpi :
0 < pi0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
u :
Fin k
t :
i :
Fin dz
j :
Fin dx
conditionalMean P (latentCell u t) (fun w => w.Y * w.Z i * w.X j)
= referenceFeature P t i u * latentMean P t u * targetFeature P j u
Proof (Lean source)
-- @node: outcomeFactorization_latentCell_outcomeProxy lemma latentCell_outcomeProxy_factorization {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hpi : 0 < pi0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (u : Fin k) (t : Bool) (i : Fin dz) (j : Fin dx) : conditionalMean P (latentCell u t) (fun w => w.Y * w.Z i * w.X j) = referenceFeature P t i u * latentMean P t u * targetFeature P j u := by rw [show (fun w : FullData k dx dz => w.Y * w.Z i * w.X j) = (fun w => w.Z i * w.X j * w.Y) by funext w; ring, conditionalMean_reference_targetOutcome P hpi hM u t i j, conditionalMean_targetOutcome_latentCell P hpi hM u t j] unfold referenceFeature ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.latentCell_outcomeProxy_factorization · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/OutcomeFactorization.lean:232
theorem observedOutcomeProxyMoment_factorization Lemma 18 in the paper ↗

The observed armwise outcome-weighted proxy moment has the roadmap's finite-mixture factorization (16). Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hpi :
0 < pi0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
t :
Proof (Lean source)
-- @node: outcomeFactorization_observedOutcomeProxyMoment lemma observedOutcomeProxyMoment_factorization {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hk : 2 ≤ k) (hpi : 0 < pi0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (t : Bool) : observedOutcomeProxyMoment (obsSummary P) t = referenceFeature P t * latentArmWeights P t * diagonal (latentMean P t) * (targetFeature P).transpose := by ext i j have hint : ∀ u : Fin k, IntegrableOn (fun w : FullData k dx dz => w.Y * w.Z i * w.X j) (latentCell u t) P := by intro u apply IntegrableOn.of_bound (measure_lt_top P (latentCell u t)) · exact ((measurable_fullData_Y.mul ((measurable_pi_apply i).comp measurable_fullData_Z)).mul ((measurable_pi_apply j).comp measurable_fullData_X)).aestronglyMeasurable · exact ae_restrict_of_ae <| hM.boundedOutcomeProxyProduct.mono fun w hw => by rw [Real.norm_eq_abs] have hentry := abs_matrix_entry_le_matrixCLM_norm (w.Y • outerProduct w.Z w.X) i j simpa [outerProduct, mul_assoc] using hentry.trans hw have harmpos : 0 < P.real {w : FullData k dx dz | w.T = t} := by exact lt_of_lt_of_le (mul_pos (Nat.cast_pos.mpr (by omega)) hpi) (arm_mass_lower_of_latentArmPositivity P hM.latentArmPositivity t) have hmix := conditionalMean_fullDataArm_eq_sum_latentCell P t (fun w => w.Y * w.Z i * w.X j) hint harmpos have hobs : conditionalMean (obsLaw P) (obsArm t) (fun o => o.Y * o.Z i * o.X j) = conditionalMean P {w | w.T = t} (fun w => w.Y * w.Z i * w.X j) := by exact conditionalMean_obsArm_eq_fullDataArm P t _ <| by exact (measurable_obs_Y.mul ((measurable_pi_apply i).comp measurable_obs_Z)).mul ((measurable_pi_apply j).comp measurable_obs_X) have heval : observedOutcomeProxyMoment (obsSummary P) t i j = conditionalMean (obsLaw P) (obsArm t) (fun o => o.Y * o.Z i * o.X j) := by cases t <;> rfl rw [heval, hobs, hmix] simp only [Matrix.mul_apply, Matrix.transpose_apply, latentArmWeights, Matrix.diagonal_apply, mul_ite, mul_zero] apply Finset.sum_congr rfl intro u _ rw [latentCell_outcomeProxy_factorization P hpi hM u t i j] simp [referenceFeature, targetFeature] ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.observedOutcomeProxyMoment_factorization · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/OutcomeFactorization.lean:250
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.PathCertificates 21 declarations Paper-local finite-sum and model certificates for the factorization-preserving labelled path.

Paper-local finite-sum and model certificates for the factorization-preserving labelled path.

At zero displacement, the labelled path is exactly the collision witness with effect amplitude g / 2. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g :
u :
Fin 2
t x z y0 y1 :
pathWeight g 0 u t x z y0 y1 = witnessWeight (g / 2) u t x z y0 y1
Proof (Lean source)
-- @node: pathWeight_zero lemma pathWeight_zero (g : ℝ) (u : Fin 2) (t x z y0 y1 : Bool) : pathWeight g 0 u t x z y0 y1 = witnessWeight (g / 2) u t x z y0 y1 := by unfold pathWeight rw [pathReferenceFeature_second_formula t 0 u (by norm_num)] rw [pathArmWeights_formula true 0 u (by norm_num)] fin_cases u <;> cases t <;> cases x <;> cases z <;> cases y0 <;> cases y1 <;> norm_num [pathTargetFeature, witnessWeight, bernoulliMass]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathWeight_zero · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathCertificates.lean:12
theorem pathLaw_zero

The base labelled-path measure is the already validated collision witness. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g :
pathLaw g 0 = witnessLaw (g / 2)
Proof (Lean source)
-- @node: pathLaw_zero lemma pathLaw_zero (g : ℝ) : pathLaw g 0 = witnessLaw (g / 2) := by simp_rw [pathLaw, witnessLaw, pathPoint, pathWeight_zero g]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathLaw_zero · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathCertificates.lean:23
theorem pathLaw_zero_ucvmwModel Lemma pathLaw_zero_ucvmwModel in the paper ↗

The undisplaced labelled path inherits uniformly conditioned model validity from the collision witness. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g :
hg0 :
0 ≤ g
hg1 :
g ≤ 1 / 4
letI
Proof (Lean source)
-- @node: pathLaw_zero_ucvmwModel lemma pathLaw_zero_ucvmwModel (g : ℝ) (hg0 : 0 ≤ g) (hg1 : g ≤ 1 / 4) : letI := pathLaw_isProbabilityMeasure g 0 hg0 hg1 (by norm_num [TangentAmplitudeDomain]) (by norm_num) UCVMWModel (L := 2) (pi0 := 1 / 10) (sigma0 := 1 / 10) (pathLaw g 0) := by letI := pathLaw_isProbabilityMeasure g 0 hg0 hg1 (by norm_num [TangentAmplitudeDomain]) (by norm_num) letI : IsProbabilityMeasure (witnessLaw (g / 2)) := witnessLaw_isProbabilityMeasure (g / 2) (by positivity) (by linarith) have hM := witness_ucvmwModel (g / 2) (by positivity) (by linarith) simpa only [pathLaw_zero g] using hM
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathLaw_zero_ucvmwModel · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathCertificates.lean:28

Every atomic coefficient of the labelled path is nonnegative on the small rational neighborhood used by the lower-bound construction. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg0 :
0 ≤ g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
u :
Fin 2
t x z y0 y1 :
0 ≤ pathWeight g h u t x z y0 y1
Proof (Lean source)
-- @node: pathWeight_nonneg lemma pathWeight_nonneg (g h : ℝ) (hg0 : 0 ≤ g) (hg1 : g ≤ 1 / 4) (hh : |h| ≤ 1 / 100) (u : Fin 2) (t x z y0 y1 : Bool) : 0 ≤ pathWeight g h u t x z y0 y1 := by have hbounds := abs_le.mp hh have hpu : ∀ u : Fin 2, 0 ≤ (if u.val = 0 then 2 / 5 + h else 3 / 5 - h : ℝ) ∧ (if u.val = 0 then 2 / 5 + h else 3 / 5 - h : ℝ) ≤ 1 := by intro v fin_cases v <;> simp <;> constructor <;> nlinarith [hbounds.1, hbounds.2] have hpt : ∀ u : Fin 2, 0 ≤ pathArmWeights true h u / (if u.val = 0 then 2 / 5 + h else 3 / 5 - h) ∧ pathArmWeights true h u / (if u.val = 0 then 2 / 5 + h else 3 / 5 - h) ≤ 1 := by intro v rw [pathArmWeights_formula true h v hh] fin_cases v <;> simp all_goals constructor all_goals first | apply div_nonneg <;> nlinarith [hbounds.1, hbounds.2] | rw [div_le_one] <;> nlinarith [hbounds.1, hbounds.2] have hpx : ∀ u : Fin 2, 0 ≤ pathTargetFeature h 1 u ∧ pathTargetFeature h 1 u ≤ 1 := by intro v fin_cases v · norm_num [pathTargetFeature] · simp [pathTargetFeature] constructor · apply div_nonneg <;> nlinarith [hbounds.1, hbounds.2] · rw [div_le_one] <;> nlinarith [hbounds.1, hbounds.2] have hpz : ∀ (t : Bool) (u : Fin 2), 0 ≤ pathReferenceFeature t h 1 u ∧ pathReferenceFeature t h 1 u ≤ 1 := by intro s v rw [pathReferenceFeature_second_formula s h v hh] fin_cases v <;> cases s <;> simp all_goals constructor all_goals first | apply div_nonneg <;> nlinarith [hbounds.1, hbounds.2] | rw [div_le_one] <;> nlinarith [hbounds.1, hbounds.2] have hpy1 : ∀ u : Fin 2, 0 ≤ (if u.val = 0 then 1 / 2 - g / 2 else 1 / 2 + g / 2 : ℝ) ∧ (if u.val = 0 then 1 / 2 - g / 2 else 1 / 2 + g / 2 : ℝ) ≤ 1 := by intro v fin_cases v <;> simp <;> constructor <;> nlinarith unfold pathWeight exact mul_nonneg (mul_nonneg (mul_nonneg (mul_nonneg (mul_nonneg (hpu u).1 (bernoulliMass_nonneg _ t (hpt u).1 (hpt u).2)) (bernoulliMass_nonneg _ x (hpx u).1 (hpx u).2)) (bernoulliMass_nonneg _ z (hpz t u).1 (hpz t u).2)) (bernoulliMass_nonneg (1 / 4) y0 (by norm_num) (by norm_num))) (bernoulliMass_nonneg _ y1 (hpy1 u).1 (hpy1 u).2)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathWeight_nonneg · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathCertificates.lean:42
theorem pathWeight_sum_nuisance Lemma pathWeight_sum_nuisance in the paper ↗

Summing every nuisance coordinate of the labelled path leaves its prescribed latent mass. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
u :
Fin 2
∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, pathWeight g h u t x z y0 y1
= if u.val = 0 then 2 / 5 + h else 3 / 5 - h
Proof (Lean source)
-- @node: pathWeight_sum_nuisance lemma pathWeight_sum_nuisance (g h : ℝ) (u : Fin 2) : ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, pathWeight g h u t x z y0 y1 = if u.val = 0 then 2 / 5 + h else 3 / 5 - h := by simp only [pathWeight, sum_mul_bernoulliMass]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathWeight_sum_nuisance · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathCertificates.lean:101
theorem pathLaw_real

Restricted event masses under the labelled path reduce to the defining finite sum. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
A :
Set (FullData 2 2 2)
DecidablePred (· ∈ A)
hA :
(pathLaw g h).real A
= ∑ u : Fin 2, ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, (ofReal (pathWeight g h u t x z y0 y1)).toReal * if pathPoint u t x z y0 y1 ∈ A then 1 else 0
Proof (Lean source)
-- @node: pathLaw_real lemma pathLaw_real (g h : ℝ) (A : Set (FullData 2 2 2)) [DecidablePred (· ∈ A)] (hA : MeasurableSet A) : (pathLaw g h).real A = ∑ u : Fin 2, ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, (ofReal (pathWeight g h u t x z y0 y1)).toReal * if pathPoint u t x z y0 y1 ∈ A then 1 else 0 := by classical let c : Fin 2 × Bool × Bool × Bool × Bool × Bool → ℝ≥0∞ := fun i => ofReal (pathWeight g h i.1 i.2.1 i.2.2.1 i.2.2.2.1 i.2.2.2.2.1 i.2.2.2.2.2) let p : Fin 2 × Bool × Bool × Bool × Bool × BoolFullData 2 2 2 := fun i => pathPoint i.1 i.2.1 i.2.2.1 i.2.2.2.1 i.2.2.2.2.1 i.2.2.2.2.2 have hpath : pathLaw g h = ∑ i, c i • Measure.dirac (p i) := by simp only [pathLaw, c, p, Fintype.sum_prod_type] rw [show (pathLaw g h).real A = ∫ _ in A, (1 : ℝ) ∂pathLaw g h by simp] rw [← integral_indicator hA, hpath, integral_finsetSum_measure] · simp only [c, p, Fintype.sum_prod_type, integral_smul_measure, integral_dirac, smul_eq_mul, Set.indicator_apply] · intro i _ exact (integrable_dirac (by simp)).smul_measure (by simp [c])
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathLaw_real · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathCertificates.lean:109
def pathObsPoint

The observed support point indexed by the four visible Bernoulli coordinates. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
t x z y :
pathObsPoint t x z y :
Obs 2 2
⟨t, vec2 1 (boolReal x), vec2 1 (boolReal z), boolReal y⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathObsPoint · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathCertificates.lean:132
def pathObsIndicator

Indicator that a visible Bernoulli support point is the requested observed record. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
t x z y :
o :
Obs 2 2
pathObsIndicator t x z y o :
by classical exact if pathObsPoint t x z y = o then 1 else 0
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathObsIndicator · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathCertificates.lean:137
theorem measurableSet_singleton_obs

Singletons of the observed carrier are measurable in its induced Borel structure. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
o :
Obs 2 2
MeasurableSet ({o} : Set (Obs 2 2))
Proof (Lean source)
-- @node: measurableSet_singleton_obs lemma measurableSet_singleton_obs (o : Obs 2 2) : MeasurableSet ({o} : Set (Obs 2 2)) := by change @MeasurableSet (Obs 2 2) (comap Obs.toCoordinates inferInstance) {o} rw [MeasurableSpace.measurableSet_comap] refine ⟨{Obs.toCoordinates o}, measurableSet_singleton _, ?_⟩ ext x simp only [Set.mem_preimage, Set.mem_singleton_iff] constructor · intro h cases x cases o simp_all [Obs.toCoordinates] · exact fun h => congrArg Obs.toCoordinates h
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.measurableSet_singleton_obs · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathCertificates.lean:143
def pathObservedCellMass

The mass assigned by the labelled path to an observed singleton.

Definition (Lean source)
g h :
o :
Obs 2 2
pathObservedCellMass g h o :
(pathLaw g h).real (obsMap ⁻¹' ({o} : Set (Obs 2 2)))
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathObservedCellMass · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathCertificates.lean:159
theorem pathObservedCellMass_formula

Every observed-cell mass is the explicit finite sum over the path atoms mapping to that cell. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
o :
Obs 2 2
= ∑ u : Fin 2, ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, (ofReal (pathWeight g h u t x z y0 y1)).toReal * pathObsIndicator t x z (if t then y1 else y0) o
Proof (Lean source)
-- @node: pathObservedCellMass_formula lemma pathObservedCellMass_formula (g h : ℝ) (o : Obs 2 2) : pathObservedCellMass g h o = ∑ u : Fin 2, ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, (ofReal (pathWeight g h u t x z y0 y1)).toReal * pathObsIndicator t x z (if t then y1 else y0) o := by classical rw [pathObservedCellMass, pathLaw_real] · congr 1 · exact (measurableSet_singleton_obs o).preimage (obsMap_measurable 2 2 2)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathObservedCellMass_formula · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathCertificates.lean:164

The finite observed-cell formula after summing out the inactive potential outcome and the latent class. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
g h :
t x z y :
pathVisibleMass g h t x z y :
if t then ∑ u : Fin 2, ∑ y0 : Bool, pathWeight g h u true x z y0 y else ∑ u : Fin 2, ∑ y1 : Bool, pathWeight g h u false x z y y1
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathVisibleMass · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathCertificates.lean:176
theorem pathVisibleMass_diff_formula

Exact visible-cell displacement along the labelled path. The control arm is fixed, while each treated-arm cell changes by an explicit multiple of g * h. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hh :
|h| ≤ 1 / 100
t x z y :
pathVisibleMass g h t x z y - pathVisibleMass g 0 t x z y
= if t then (if y then -1 else 1) * (if x then (if z then 9 / 100 else 3 / 100) else (if z then 9 / 25 else 3 / 25)) * g * h else 0
Proof (Lean source)
-- @node: pathVisibleMass_diff_formula lemma pathVisibleMass_diff_formula (g h : ℝ) (hh : |h| ≤ 1 / 100) (t x z y : Bool) : pathVisibleMass g h t x z y - pathVisibleMass g 0 t x z y = if t then (if y then -1 else 1) * (if x then (if z then 9 / 100 else 3 / 100) else (if z then 9 / 25 else 3 / 25)) * g * h else 0 := by have hb := abs_le.mp hh have hp0 : 2 / 5 + h ≠ 0 := by nlinarith [hb.1, hb.2] have hp1 : 3 / 5 - h ≠ 0 := by nlinarith [hb.1, hb.2] have h4 : 15 * h + 4 ≠ 0 := by nlinarith [hb.1, hb.2] have h3 : 5 * h + 3 ≠ 0 := by nlinarith [hb.1, hb.2] have h4' : 4 + h * 15 ≠ 0 := by nlinarith [hb.1, hb.2] have h3' : 3 + h * 5 ≠ 0 := by nlinarith [hb.1, hb.2] have h2p : 2 + h * 5 ≠ 0 := by nlinarith [hb.1, hb.2] have h3m : 3 - h * 5 ≠ 0 := by nlinarith [hb.1, hb.2] have h50p : 50 + h * 125 ≠ 0 := by nlinarith [hb.1, hb.2] have h75m : 75 - h * 125 ≠ 0 := by nlinarith [hb.1, hb.2] have h80p : 80 + h * 300 ≠ 0 := by nlinarith [hb.1, hb.2] have h30p : 30 + h * 50 ≠ 0 := by nlinarith [hb.1, hb.2] have h20p : 20 + h * 75 ≠ 0 := by nlinarith [hb.1, hb.2] have h30m : 30 - h * 50 ≠ 0 := by nlinarith [hb.1, hb.2] have h45m : 45 - h * 75 ≠ 0 := by nlinarith [hb.1, hb.2] have hprod : 8 + h * 50 + h ^ 2 * 75 ≠ 0 := by rw [show 8 + h * 50 + h ^ 2 * 75 = (2 + h * 5) * (4 + h * 15) by ring] exact mul_ne_zero h2p h4' cases t <;> cases x <;> cases z <;> cases y all_goals simp only [pathVisibleMass, Fin.sum_univ_two, Fintype.sum_bool, pathWeight, if_false, if_true, bernoulliMass] repeat' first | rw [pathArmWeights_formula true h 0 hh] | rw [pathArmWeights_formula true h 1 hh] | rw [pathReferenceFeature_second_formula false h 0 hh] | rw [pathReferenceFeature_second_formula false h 1 hh] | rw [pathReferenceFeature_second_formula true h 0 hh] | rw [pathReferenceFeature_second_formula true h 1 hh] | rw [pathArmWeights_formula true 0 0 (by norm_num)] | rw [pathArmWeights_formula true 0 1 (by norm_num)] | rw [pathReferenceFeature_second_formula false 0 0 (by norm_num)] | rw [pathReferenceFeature_second_formula false 0 1 (by norm_num)] | rw [pathReferenceFeature_second_formula true 0 0 (by norm_num)] | rw [pathReferenceFeature_second_formula true 0 1 (by norm_num)] all_goals norm_num [pathTargetFeature] try simp_rw [inv_eq_one_div] field_simp [hp0, hp1, h4, h3, h2p, h3m, h50p, h75m, h80p, h30p, h20p, h30m, h45m] ring_nf field_simp [h2p, h3m, h4, h3, h4', h3', hprod] ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathVisibleMass_diff_formula · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathCertificates.lean:185
theorem pathVisibleMass_diff_bound

Uniform visible-cell displacement bound, with a numerical constant independent of the cell. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg0 :
0 ≤ g
hh :
|h| ≤ 1 / 100
t x z y :
|pathVisibleMass g h t x z y - pathVisibleMass g 0 t x z y| ≤ g * |h|
Proof (Lean source)
-- @node: pathVisibleMass_diff_bound lemma pathVisibleMass_diff_bound (g h : ℝ) (hg0 : 0 ≤ g) (hh : |h| ≤ 1 / 100) (t x z y : Bool) : |pathVisibleMass g h t x z y - pathVisibleMass g 0 t x z y| ≤ g * |h| := by rw [pathVisibleMass_diff_formula g h hh t x z y] cases t <;> cases x <;> cases z <;> cases y all_goals norm_num only [Bool.true_eq, Bool.false_eq_true, ↓reduceIte, if_false, if_true, abs_zero, abs_one, abs_neg] repeat' rw [abs_mul] try rw [abs_of_nonneg hg0] norm_num linarith [mul_nonneg hg0 (abs_nonneg h)]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathVisibleMass_diff_bound · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathCertificates.lean:240
theorem pathObservedCellMass_visible_formula

An observed singleton mass is the sum of the sixteen visible Bernoulli-cell masses selected by that singleton. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg0 :
0 ≤ g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
o :
Obs 2 2
= ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y : Bool, pathVisibleMass g h t x z y * pathObsIndicator t x z y o
Proof (Lean source)
-- @node: pathObservedCellMass_visible_formula lemma pathObservedCellMass_visible_formula (g h : ℝ) (hg0 : 0 ≤ g) (hg1 : g ≤ 1 / 4) (hh : |h| ≤ 1 / 100) (o : Obs 2 2) : pathObservedCellMass g h o = ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y : Bool, pathVisibleMass g h t x z y * pathObsIndicator t x z y o := by classical rw [pathObservedCellMass_formula] simp_rw [ENNReal.toReal_ofReal (pathWeight_nonneg g h hg0 hg1 hh _ _ _ _ _ _)] simp only [pathVisibleMass, pathObsIndicator] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro t _ rw [Finset.sum_comm] apply Finset.sum_congr rfl intro x _ rw [Finset.sum_comm] apply Finset.sum_congr rfl intro z _ cases t · simp only [Bool.false_eq_true, if_false] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro y _ split_ifs <;> simp · simp only [if_true] calc (∑ u : Fin 2, ∑ y0 : Bool, ∑ y1 : Bool, pathWeight g h u true x z y0 y1 * (if pathObsPoint true x z y1 = o then 1 else 0)) = ∑ u : Fin 2, ∑ y1 : Bool, ∑ y0 : Bool, pathWeight g h u true x z y0 y1 * (if pathObsPoint true x z y1 = o then 1 else 0) := by apply Finset.sum_congr rfl intro u _ rw [Finset.sum_comm] _ = ∑ y1 : Bool, ∑ u : Fin 2, ∑ y0 : Bool, pathWeight g h u true x z y0 y1 * (if pathObsPoint true x z y1 = o then 1 else 0) := by rw [Finset.sum_comm] _ = ∑ y : Bool, (∑ u : Fin 2, ∑ y0 : Bool, pathWeight g h u true x z y0 y) * (if pathObsPoint true x z y = o then 1 else 0) := by apply Finset.sum_congr rfl intro y _ split_ifs <;> simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathObservedCellMass_visible_formula · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathCertificates.lean:255
theorem pathObservedCellMass_diff_bound

Uniform observed-singleton displacement bound along the labelled path. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg0 :
0 ≤ g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
o :
Obs 2 2
|pathObservedCellMass g h o - pathObservedCellMass g 0 o| ≤ 16 * g * |h|
Proof (Lean source)
-- @node: pathObservedCellMass_diff_bound lemma pathObservedCellMass_diff_bound (g h : ℝ) (hg0 : 0 ≤ g) (hg1 : g ≤ 1 / 4) (hh : |h| ≤ 1 / 100) (o : Obs 2 2) : |pathObservedCellMass g h o - pathObservedCellMass g 0 o| ≤ 16 * g * |h| := by classical rw [pathObservedCellMass_visible_formula g h hg0 hg1 hh o, pathObservedCellMass_visible_formula g 0 hg0 hg1 (by norm_num) o] simp_rw [← Finset.sum_sub_distrib] calc _ ≤ ∑ t : Bool, |∑ x : Bool, ∑ z : Bool, ∑ y : Bool, (pathVisibleMass g h t x z y * pathObsIndicator t x z y o - pathVisibleMass g 0 t x z y * pathObsIndicator t x z y o)| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ t : Bool, ∑ x : Bool, |∑ z : Bool, ∑ y : Bool, (pathVisibleMass g h t x z y * pathObsIndicator t x z y o - pathVisibleMass g 0 t x z y * pathObsIndicator t x z y o)| := by apply Finset.sum_le_sum intro t _ exact Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, |∑ y : Bool, (pathVisibleMass g h t x z y * pathObsIndicator t x z y o - pathVisibleMass g 0 t x z y * pathObsIndicator t x z y o)| := by apply Finset.sum_le_sum intro t _ apply Finset.sum_le_sum intro x _ exact Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y : Bool, |pathVisibleMass g h t x z y * pathObsIndicator t x z y o - pathVisibleMass g 0 t x z y * pathObsIndicator t x z y o| := by apply Finset.sum_le_sum intro t _ apply Finset.sum_le_sum intro x _ apply Finset.sum_le_sum intro z _ exact Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ _t : Bool, ∑ _x : Bool, ∑ _z : Bool, ∑ _y : Bool, g * |h| := by apply Finset.sum_le_sum intro t _ apply Finset.sum_le_sum intro x _ apply Finset.sum_le_sum intro z _ apply Finset.sum_le_sum intro y _ rw [← sub_mul, abs_mul] unfold pathObsIndicator split_ifs · simpa using pathVisibleMass_diff_bound g h hg0 hh t x z y · simp [mul_nonneg hg0 (abs_nonneg h)] _ = 16 * g * |h| := by simp; ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathObservedCellMass_diff_bound · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathCertificates.lean:304
theorem pathVisibleMass_base_floor

Every one of the sixteen visible cells of the base path has a uniform positive mass. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g :
hg0 :
0 ≤ g
hg1 :
g ≤ 1 / 4
t x z y :
1 / 1000 ≤ pathVisibleMass g 0 t x z y
Proof (Lean source)
-- @node: pathVisibleMass_base_floor lemma pathVisibleMass_base_floor (g : ℝ) (hg0 : 0 ≤ g) (hg1 : g ≤ 1 / 4) (t x z y : Bool) : 1 / 1000 ≤ pathVisibleMass g 0 t x z y := by cases t <;> cases x <;> cases z <;> cases y all_goals simp [pathVisibleMass, pathWeight, pathTargetFeature, pathArmWeights_formula _ 0 _ (by norm_num), pathReferenceFeature_second_formula _ 0 _ (by norm_num), bernoulliMass] nlinarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathVisibleMass_base_floor · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathCertificates.lean:358
theorem pathObservedCellMass_base_floor

Every represented observed atom of the base path inherits the uniform visible-cell floor. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g :
hg0 :
0 ≤ g
hg1 :
g ≤ 1 / 4
t x z y :
1 / 1000 ≤ pathObservedCellMass g 0 (pathObsPoint t x z y)
Proof (Lean source)
-- @node: pathObservedCellMass_base_floor lemma pathObservedCellMass_base_floor (g : ℝ) (hg0 : 0 ≤ g) (hg1 : g ≤ 1 / 4) (t x z y : Bool) : 1 / 1000 ≤ pathObservedCellMass g 0 (pathObsPoint t x z y) := by rw [pathObservedCellMass_visible_formula g 0 hg0 hg1 (by norm_num)] have hterm : pathVisibleMass g 0 t x z y ≤ ∑ t' : Bool, ∑ x' : Bool, ∑ z' : Bool, ∑ y' : Bool, pathVisibleMass g 0 t' x' z' y' * pathObsIndicator t' x' z' y' (pathObsPoint t x z y) := by classical have hnonneg (t' x' z' y' : Bool) : 0 ≤ pathVisibleMass g 0 t' x' z' y' * pathObsIndicator t' x' z' y' (pathObsPoint t x z y) := by unfold pathObsIndicator split_ifs · exact mul_nonneg (le_trans (by norm_num) (pathVisibleMass_base_floor g hg0 hg1 _ _ _ _)) (by norm_num) · simp calc pathVisibleMass g 0 t x z y = pathVisibleMass g 0 t x z y * pathObsIndicator t x z y (pathObsPoint t x z y) := by simp [pathObsIndicator] _ ≤ ∑ y' : Bool, pathVisibleMass g 0 t x z y' * pathObsIndicator t x z y' (pathObsPoint t x z y) := Finset.single_le_sum (fun y' _ => hnonneg t x z y') (Finset.mem_univ y) _ ≤ ∑ z' : Bool, ∑ y' : Bool, pathVisibleMass g 0 t x z' y' * pathObsIndicator t x z' y' (pathObsPoint t x z y) := Finset.single_le_sum (fun z' _ => sum_nonneg fun y' _ => hnonneg t x z' y') (Finset.mem_univ z) _ ≤ ∑ x' : Bool, ∑ z' : Bool, ∑ y' : Bool, pathVisibleMass g 0 t x' z' y' * pathObsIndicator t x' z' y' (pathObsPoint t x z y) := Finset.single_le_sum (fun x' _ => sum_nonneg fun z' _ => sum_nonneg fun y' _ => hnonneg t x' z' y') (Finset.mem_univ x) _ ≤ ∑ t' : Bool, ∑ x' : Bool, ∑ z' : Bool, ∑ y' : Bool, pathVisibleMass g 0 t' x' z' y' * pathObsIndicator t' x' z' y' (pathObsPoint t x z y) := Finset.single_le_sum (fun t' _ => sum_nonneg fun x' _ => sum_nonneg fun z' _ => sum_nonneg fun y' _ => hnonneg t' x' z' y') (Finset.mem_univ t) exact le_trans (pathVisibleMass_base_floor g hg0 hg1 t x z y) hterm
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathObservedCellMass_base_floor · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathCertificates.lean:369
theorem path_sum_restrict_latentClass

For a path law, latent class, and integrand, restricting the finite path sum to that latent class selects exactly its atoms.

Formal statement
g h :
u :
F :
FullData 2 2 2 → ℝ
(∑ v : Fin 2, ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, pathWeight g h v t x z y0 y1 * @ite ℝ (pathPoint v t x z y0 y1 ∈ latentClass u) (dA (pathPoint v t x z y0 y1)) (F (pathPoint v t x z y0 y1)) 0)
= ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, pathWeight g h u t x z y0 y1 * F (pathPoint u t x z y0 y1)
Proof (Lean source)
-- @node: path_sum_restrict_latentClass lemma path_sum_restrict_latentClass (g h : ℝ) (u : Fin 2) [dA : DecidablePred (· ∈ latentClass u)] (F : FullData 2 2 2 → ℝ) : (∑ v : Fin 2, ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, pathWeight g h v t x z y0 y1 * @ite ℝ (pathPoint v t x z y0 y1 ∈ latentClass u) (dA (pathPoint v t x z y0 y1)) (F (pathPoint v t x z y0 y1)) 0) = ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, pathWeight g h u t x z y0 y1 * F (pathPoint u t x z y0 y1) := by classical rw [Finset.sum_eq_single u] · have hin (t x z y0 y1 : Bool) : pathPoint u t x z y0 y1 ∈ latentClass u := by simp [latentClass, pathPoint, witnessPoint] simp_rw [if_pos (hin _ _ _ _ _)] · intro v _ hvu have hout (t x z y0 y1 : Bool) : pathPoint v t x z y0 y1 ∉ latentClass u := by simp [latentClass, pathPoint, witnessPoint, hvu] simp_rw [if_neg (hout _ _ _ _ _)] simp · simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.path_sum_restrict_latentClass · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathCertificates.lean:414
theorem path_latentMass

The labelled path has exactly the displaced latent masses prescribed in its construction. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg0 :
0 ≤ g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
u :
Fin 2
latentMass (pathLaw g h) u = if u.val = 0 then 2 / 5 + h else 3 / 5 - h
Proof (Lean source)
-- @node: path_latentMass lemma path_latentMass (g h : ℝ) (hg0 : 0 ≤ g) (hg1 : g ≤ 1 / 4) (hh : |h| ≤ 1 / 100) (u : Fin 2) : latentMass (pathLaw g h) u = if u.val = 0 then 2 / 5 + h else 3 / 5 - h := by classical rw [latentMass, pathLaw_real g h _ (measurableSet_witness_latentClass u)] simp_rw [ENNReal.toReal_ofReal (pathWeight_nonneg g h hg0 hg1 hh _ _ _ _ _ _)] rw [path_sum_restrict_latentClass g h u (fun _ => (1 : ℝ))] simp only [mul_one] exact pathWeight_sum_nuisance g h u
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.path_latentMass · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathCertificates.lean:436
theorem path_latentMass_l1_displacement

The ordered-mass target moves by exactly twice the absolute tangent displacement. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg0 :
0 ≤ g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
(∑ i, |latentMass (pathLaw g h) i - latentMass (pathLaw g 0) i|) = 2 * |h|
Proof (Lean source)
-- @node: path_latentMass_l1_displacement lemma path_latentMass_l1_displacement (g h : ℝ) (hg0 : 0 ≤ g) (hg1 : g ≤ 1 / 4) (hh : |h| ≤ 1 / 100) : (∑ i, |latentMass (pathLaw g h) i - latentMass (pathLaw g 0) i|) = 2 * |h| := by simp_rw [path_latentMass g h hg0 hg1 hh, path_latentMass g 0 hg0 hg1 (by norm_num)] rw [Fin.sum_univ_two] norm_num ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.path_latentMass_l1_displacement · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathCertificates.lean:448
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.PathFactorization 7 declarations Paper-local conditional-moment factorization certificates for the labelled path.

Paper-local conditional-moment factorization certificates for the labelled path.

theorem path_sum_restrict_latentCell

Restricting the finite path sum to a latent-arm cell selects exactly that class and arm. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
u :
Fin 2
t :
F :
FullData 2 2 2 → ℝ
(∑ v : Fin 2, ∑ s : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, pathWeight g h v s x z y0 y1 * @ite ℝ (pathPoint v s x z y0 y1 ∈ latentCell u t) (dA (pathPoint v s x z y0 y1)) (F (pathPoint v s x z y0 y1)) 0)
= ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, pathWeight g h u t x z y0 y1 * F (pathPoint u t x z y0 y1)
Proof (Lean source)
-- @node: path_sum_restrict_latentCell lemma path_sum_restrict_latentCell (g h : ℝ) (u : Fin 2) (t : Bool) [dA : DecidablePred (· ∈ latentCell u t)] (F : FullData 2 2 2 → ℝ) : (∑ v : Fin 2, ∑ s : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, pathWeight g h v s x z y0 y1 * @ite ℝ (pathPoint v s x z y0 y1 ∈ latentCell u t) (dA (pathPoint v s x z y0 y1)) (F (pathPoint v s x z y0 y1)) 0) = ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, pathWeight g h u t x z y0 y1 * F (pathPoint u t x z y0 y1) := by classical rw [Finset.sum_eq_single u] · rw [Finset.sum_eq_single t] · have hin (x z y0 y1 : Bool) : pathPoint u t x z y0 y1 ∈ latentCell u t := by simp [latentCell, pathPoint, witnessPoint] simp_rw [if_pos (hin _ _ _ _)] · intro s _ hst have hout (x z y0 y1 : Bool) : pathPoint u s x z y0 y1 ∉ latentCell u t := by simp [latentCell, pathPoint, witnessPoint, hst] simp_rw [if_neg (hout _ _ _ _)] simp · simp · intro v _ hvu have hout (s x z y0 y1 : Bool) : pathPoint v s x z y0 y1 ∉ latentCell u t := by simp [latentCell, pathPoint, witnessPoint, hvu] simp_rw [if_neg (hout _ _ _ _ _)] simp · simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.path_sum_restrict_latentCell · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathFactorization.lean:12
theorem integral_pathLaw_restrict

Restricted integrals under the labelled path reduce to its defining finite sum. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
A :
Set (FullData 2 2 2)
DecidablePred (· ∈ A)
hA :
F :
FullData 2 2 2 → ℝ
∫ w in A, F w ∂pathLaw g h
= ∑ u : Fin 2, ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, (ofReal (pathWeight g h u t x z y0 y1)).toReal * if pathPoint u t x z y0 y1 ∈ A then F (pathPoint u t x z y0 y1) else 0
Proof (Lean source)
-- @node: integral_pathLaw_restrict lemma integral_pathLaw_restrict (g h : ℝ) (A : Set (FullData 2 2 2)) [DecidablePred (· ∈ A)] (hA : MeasurableSet A) (F : FullData 2 2 2 → ℝ) : ∫ w in A, F w ∂pathLaw g h = ∑ u : Fin 2, ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, (ofReal (pathWeight g h u t x z y0 y1)).toReal * if pathPoint u t x z y0 y1 ∈ A then F (pathPoint u t x z y0 y1) else 0 := by classical let c : Fin 2 × Bool × Bool × Bool × Bool × Bool → ℝ≥0∞ := fun i => ofReal (pathWeight g h i.1 i.2.1 i.2.2.1 i.2.2.2.1 i.2.2.2.2.1 i.2.2.2.2.2) let p : Fin 2 × Bool × Bool × Bool × Bool × BoolFullData 2 2 2 := fun i => pathPoint i.1 i.2.1 i.2.2.1 i.2.2.2.1 i.2.2.2.2.1 i.2.2.2.2.2 have hpath : pathLaw g h = ∑ i, c i • Measure.dirac (p i) := by simp only [pathLaw, c, p, Fintype.sum_prod_type] rw [← integral_indicator hA, hpath, integral_finsetSum_measure] · simp only [c, p, Fintype.sum_prod_type, integral_smul_measure, integral_dirac, smul_eq_mul, Set.indicator_apply] · intro i _ exact (integrable_dirac (by simp)).smul_measure (by simp [c])
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.integral_pathLaw_restrict · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathFactorization.lean:41
theorem conditionalMean_path_latentCell

Conditional means on a labelled-path latent-arm cell reduce to the corresponding finite sum. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg0 :
0 ≤ g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
u :
Fin 2
t :
F :
FullData 2 2 2 → ℝ
conditionalMean (pathLaw g h) (latentCell u t) F
= (∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, pathWeight g h u t x z y0 y1)⁻¹ * (∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, pathWeight g h u t x z y0 y1 * F (pathPoint u t x z y0 y1))
Proof (Lean source)
-- @node: conditionalMean_path_latentCell lemma conditionalMean_path_latentCell (g h : ℝ) (hg0 : 0 ≤ g) (hg1 : g ≤ 1 / 4) (hh : |h| ≤ 1 / 100) (u : Fin 2) (t : Bool) (F : FullData 2 2 2 → ℝ) : conditionalMean (pathLaw g h) (latentCell u t) F = (∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, pathWeight g h u t x z y0 y1)⁻¹ * (∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, pathWeight g h u t x z y0 y1 * F (pathPoint u t x z y0 y1)) := by classical rw [conditionalMean, pathLaw_real g h _ (measurableSet_witness_latentCell u t), integral_pathLaw_restrict g h _ (measurableSet_witness_latentCell u t)] simp_rw [ENNReal.toReal_ofReal (pathWeight_nonneg g h hg0 hg1 hh _ _ _ _ _ _)] rw [path_sum_restrict_latentCell g h u t (fun _ => (1 : ℝ)), path_sum_restrict_latentCell] simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.conditionalMean_path_latentCell · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathFactorization.lean:63
theorem conditionalMean_path_latentClass

Conditional means on a labelled-path latent class reduce to the corresponding finite sum. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg0 :
0 ≤ g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
u :
Fin 2
F :
FullData 2 2 2 → ℝ
conditionalMean (pathLaw g h) (latentClass u) F
= (∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, pathWeight g h u t x z y0 y1)⁻¹ * (∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, pathWeight g h u t x z y0 y1 * F (pathPoint u t x z y0 y1))
Proof (Lean source)
-- @node: conditionalMean_path_latentClass lemma conditionalMean_path_latentClass (g h : ℝ) (hg0 : 0 ≤ g) (hg1 : g ≤ 1 / 4) (hh : |h| ≤ 1 / 100) (u : Fin 2) (F : FullData 2 2 2 → ℝ) : conditionalMean (pathLaw g h) (latentClass u) F = (∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, pathWeight g h u t x z y0 y1)⁻¹ * (∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, pathWeight g h u t x z y0 y1 * F (pathPoint u t x z y0 y1)) := by classical rw [conditionalMean, pathLaw_real g h _ (measurableSet_witness_latentClass u), integral_pathLaw_restrict g h _ (measurableSet_witness_latentClass u)] simp_rw [ENNReal.toReal_ofReal (pathWeight_nonneg g h hg0 hg1 hh _ _ _ _ _ _)] rw [path_sum_restrict_latentClass g h u (fun _ => (1 : ℝ)), path_sum_restrict_latentClass] simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.conditionalMean_path_latentClass · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathFactorization.lean:80
theorem path_referenceProxySeparation

The labelled path preserves reference-proxy conditional independence. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg0 :
0 ≤ g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
Proof (Lean source)
-- @node: path_referenceProxySeparation lemma path_referenceProxySeparation (g h : ℝ) (hg0 : 0 ≤ g) (hg1 : g ≤ 1 / 4) (hh : |h| ≤ 1 / 100) : ReferenceProxySeparation (pathLaw g h) := by have hb := abs_le.mp hh have hp0 : 2 / 5 + h ≠ 0 := by nlinarith [hb.1, hb.2] have hp1 : 3 / 5 - h ≠ 0 := by nlinarith [hb.1, hb.2] have h4 : 15 * h + 4 ≠ 0 := by nlinarith [hb.1, hb.2] have h3 : 5 * h + 3 ≠ 0 := by nlinarith [hb.1, hb.2] have hw0f : 6 / 25 + 2 * h / 5 ≠ 0 := by nlinarith [hb.1, hb.2] have hw0t : 4 / 25 + 3 * h / 5 ≠ 0 := by nlinarith [hb.1, hb.2] have hw1f : 6 / 25 - 2 * h / 5 ≠ 0 := by nlinarith [hb.1, hb.2] have hw1t : 9 / 25 - 3 * h / 5 ≠ 0 := by nlinarith [hb.1, hb.2] intro u t f q _hf _hq _hfb _hqb rw [conditionalMean_path_latentCell g h hg0 hg1 hh, conditionalMean_path_latentCell g h hg0 hg1 hh, conditionalMean_path_latentCell g h hg0 hg1 hh] fin_cases u <;> cases t <;> simp (config := { maxSteps := 1000000 }) [pathWeight, pathPoint, witnessPoint, boolReal, bernoulliMass, pathArmWeights_formula _ _ _ hh, pathReferenceFeature_second_formula _ _ _ hh, pathTargetFeature] <;> field_simp [hp0, hp1, h4, h3, hw0f, hw0t, hw1f, hw1t]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.path_referenceProxySeparation · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathFactorization.lean:100
theorem path_targetProxySeparation

The labelled path preserves target-proxy conditional independence. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg0 :
0 ≤ g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
Proof (Lean source)
-- @node: path_targetProxySeparation lemma path_targetProxySeparation (g h : ℝ) (hg0 : 0 ≤ g) (hg1 : g ≤ 1 / 4) (hh : |h| ≤ 1 / 100) : TargetProxySeparation (pathLaw g h) := by have hb := abs_le.mp hh have hp0 : 2 / 5 + h ≠ 0 := by nlinarith [hb.1, hb.2] have hp1 : 3 / 5 - h ≠ 0 := by nlinarith [hb.1, hb.2] have h4 : 15 * h + 4 ≠ 0 := by nlinarith [hb.1, hb.2] have h3 : 5 * h + 3 ≠ 0 := by nlinarith [hb.1, hb.2] have hw0f : 6 / 25 + 2 * h / 5 ≠ 0 := by nlinarith [hb.1, hb.2] have hw0t : 4 / 25 + 3 * h / 5 ≠ 0 := by nlinarith [hb.1, hb.2] have hw1f : 6 / 25 - 2 * h / 5 ≠ 0 := by nlinarith [hb.1, hb.2] have hw1t : 9 / 25 - 3 * h / 5 ≠ 0 := by nlinarith [hb.1, hb.2] intro u f q _hf _hq _hfb _hqb rw [conditionalMean_path_latentClass g h hg0 hg1 hh, conditionalMean_path_latentClass g h hg0 hg1 hh, conditionalMean_path_latentClass g h hg0 hg1 hh] fin_cases u <;> simp (config := { maxSteps := 1000000 }) [pathWeight, pathPoint, witnessPoint, boolReal, bernoulliMass, pathArmWeights_formula _ _ _ hh, pathReferenceFeature_second_formula _ _ _ hh, pathTargetFeature] <;> field_simp [hp0, hp1, h4, h3, hw0f, hw0t, hw1f, hw1t]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.path_targetProxySeparation · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathFactorization.lean:127
theorem path_armwiseLatentIgnorability

The labelled path preserves armwise latent ignorability. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg0 :
0 ≤ g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
Proof (Lean source)
-- @node: path_armwiseLatentIgnorability lemma path_armwiseLatentIgnorability (g h : ℝ) (hg0 : 0 ≤ g) (hg1 : g ≤ 1 / 4) (hh : |h| ≤ 1 / 100) : ArmwiseLatentIgnorability (pathLaw g h) := by have hb := abs_le.mp hh have hp0 : 2 / 5 + h ≠ 0 := by nlinarith [hb.1, hb.2] have hp1 : 3 / 5 - h ≠ 0 := by nlinarith [hb.1, hb.2] have h4 : 15 * h + 4 ≠ 0 := by nlinarith [hb.1, hb.2] have h3 : 5 * h + 3 ≠ 0 := by nlinarith [hb.1, hb.2] have hw0f : 6 / 25 + 2 * h / 5 ≠ 0 := by nlinarith [hb.1, hb.2] have hw0t : 4 / 25 + 3 * h / 5 ≠ 0 := by nlinarith [hb.1, hb.2] have hw1f : 6 / 25 - 2 * h / 5 ≠ 0 := by nlinarith [hb.1, hb.2] have hw1t : 9 / 25 - 3 * h / 5 ≠ 0 := by nlinarith [hb.1, hb.2] intro u t f q _hf _hq _hfb _hqb rw [conditionalMean_path_latentClass g h hg0 hg1 hh, conditionalMean_path_latentClass g h hg0 hg1 hh, conditionalMean_path_latentClass g h hg0 hg1 hh] fin_cases u <;> cases t <;> simp (config := { maxSteps := 1000000 }) [pathWeight, pathPoint, witnessPoint, potential, boolReal, bernoulliMass, pathArmWeights_formula _ _ _ hh, pathReferenceFeature_second_formula _ _ _ hh, pathTargetFeature] <;> field_simp [hp0, hp1, h4, h3, hw0f, hw0t, hw1f, hw1t]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.path_armwiseLatentIgnorability · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathFactorization.lean:154
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.PathKL 13 declarations Finite observed-carrier and chi-square certificates for the labelled path.

Finite observed-carrier and chi-square certificates for the labelled path.

KL divergence is bounded by chi-square divergence. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
Ω :
hac :
μ ≪ ν
klDiv μ ν ≤ ofReal (chiSqDiv μ ν)
Proof (Lean source)
-- @node: klDiv_le_chiSqDiv lemma klDiv_le_chiSqDiv {Ω : Type*} [MeasurableSpace Ω] [MeasurableSingletonClass Ω] [Finite Ω] (μ ν : Measure Ω) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (hac : μ ≪ ν) : klDiv μ ν ≤ ofReal (chiSqDiv μ ν) := by rw [InformationTheory.klDiv_eq_integral_klFun, if_pos ⟨hac, Integrable.of_finite⟩] apply ENNReal.ofReal_le_ofReal rw [chiSqDiv] apply integral_mono_of_nonneg · exact Filter.Eventually.of_forall fun x => InformationTheory.klFun_nonneg ENNReal.toReal_nonneg · exact Integrable.of_finite · filter_upwards with x let r := (μ.rnDeriv ν x).toReal have hr : 0 ≤ r := ENNReal.toReal_nonneg by_cases hzero : r = 0 · simp [InformationTheory.klFun_apply, r, hzero] · have hlog := Real.log_le_sub_one_of_pos (lt_of_le_of_ne hr (Ne.symm hzero)) rw [InformationTheory.klFun_apply] nlinarith [mul_le_mul_of_nonneg_left hlog hr]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.klDiv_le_chiSqDiv · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathKL.lean:12

The finite sixteen-cell carrier of one observed labelled-path record.

Definition (Lean source)
PathVisibleCell :
Type
Bool × Bool × Bool × Bool
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.PathVisibleCell · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathKL.lean:35
def pathVisibleCoefficient

The atomic law of the four visible Bernoulli coordinates. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
g h :
pathVisibleCoefficient g h v :
ℝ≥0∞
if v.1 then ∑ u : Fin 2, ∑ y0 : Bool, ofReal (pathWeight g h u true v.2.1 v.2.2.1 y0 v.2.2.2) else ∑ u : Fin 2, ∑ y1 : Bool, ofReal (pathWeight g h u false v.2.1 v.2.2.1 v.2.2.2 y1)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathVisibleCoefficient · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathKL.lean:39
def pathVisibleLaw

The atomic law of the four visible Bernoulli coordinates. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
g h :
pathVisibleLaw g h :
∑ v : PathVisibleCell, pathVisibleCoefficient g h v • Measure.dirac v
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathVisibleLaw · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathKL.lean:47
theorem pathVisibleLaw_singleton

Every singleton of the finite visible carrier has its explicit cell mass. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg0 :
0 ≤ g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
(pathVisibleLaw g h).real {v} = pathVisibleMass g h v.1 v.2.1 v.2.2.1 v.2.2.2
Proof (Lean source)
-- @node: pathVisibleLaw_singleton lemma pathVisibleLaw_singleton (g h : ℝ) (hg0 : 0 ≤ g) (hg1 : g ≤ 1 / 4) (hh : |h| ≤ 1 / 100) (v : PathVisibleCell) : (pathVisibleLaw g h).real {v} = pathVisibleMass g h v.1 v.2.1 v.2.2.1 v.2.2.2 := by classical simp only [pathVisibleLaw, Measure.real_def, Measure.finsetSum_apply, MeasurableSet.singleton, Measure.smul_apply, Measure.dirac_apply'] rw [Finset.sum_eq_single v] · simp only [Set.indicator_of_mem (Set.mem_singleton v), smul_eq_mul, Pi.one_apply, mul_one] unfold pathVisibleCoefficient pathVisibleMass split_ifs all_goals rw [ENNReal.toReal_sum (by simp)] all_goals apply Finset.sum_congr rfl all_goals intro u _ all_goals rw [ENNReal.toReal_sum (by simp)] all_goals apply Finset.sum_congr rfl · intro y0 _ rw [ENNReal.toReal_ofReal (pathWeight_nonneg g h hg0 hg1 hh u true v.2.1 v.2.2.1 y0 v.2.2.2)] · intro y1 _ rw [ENNReal.toReal_ofReal (pathWeight_nonneg g h hg0 hg1 hh u false v.2.1 v.2.2.1 v.2.2.2 y1)] · intro w _ hw rw [Set.indicator_of_notMem] · simp · simpa using hw · simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathVisibleLaw_singleton · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathKL.lean:53

Mapping the finite visible carrier to observation records recovers the observed margin. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg0 :
0 ≤ g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
letI
Proof (Lean source)
-- @node: pathVisibleLaw_map lemma pathVisibleLaw_map (g h : ℝ) (hg0 : 0 ≤ g) (hg1 : g ≤ 1 / 4) (hh : |h| ≤ 1 / 100) : letI := pathLaw_isProbabilityMeasure g h hg0 hg1 (by constructor <;> linarith [abs_le.mp hh]) hh (pathVisibleLaw g h).map (fun v => pathObsPoint v.1 v.2.1 v.2.2.1 v.2.2.2) = obsLaw (pathLaw g h) := by letI := pathLaw_isProbabilityMeasure g h hg0 hg1 (by constructor <;> linarith [abs_le.mp hh]) hh rw [pathVisibleLaw, Measure.map_finset_sum' (measurable_of_finite (fun v : PathVisibleCell => pathObsPoint v.1 v.2.1 v.2.2.1 v.2.2.2)).aemeasurable] simp_rw [Measure.map_smul, Measure.map_dirac' (measurable_of_finite (fun v : PathVisibleCell => pathObsPoint v.1 v.2.1 v.2.2.1 v.2.2.2))] rw [obsLaw, pathLaw, Measure.map_finset_sum' (obsMap_measurable 2 2 2).aemeasurable] simp_rw [Measure.map_finset_sum' (obsMap_measurable 2 2 2).aemeasurable, Measure.map_smul, Measure.map_dirac' (obsMap_measurable 2 2 2)] simp [pathVisibleCoefficient, Fintype.sum_prod_type, Fin.sum_univ_two, pathObsPoint, pathPoint, witnessPoint, obsMap, add_smul] abel_nf
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathVisibleLaw_map · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathKL.lean:82
theorem pathVisibleLaw_isProbabilityMeasure

The visible atomic law has total mass one on the path domain. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg0 :
0 ≤ g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
Proof (Lean source)
-- @node: pathVisibleLaw_isProbabilityMeasure lemma pathVisibleLaw_isProbabilityMeasure (g h : ℝ) (hg0 : 0 ≤ g) (hg1 : g ≤ 1 / 4) (hh : |h| ≤ 1 / 100) : IsProbabilityMeasure (pathVisibleLaw g h) := by let hDomain : TangentAmplitudeDomain h := by constructor <;> linarith [abs_le.mp hh] letI hP := pathLaw_isProbabilityMeasure g h hg0 hg1 hDomain hh constructor have hmap := pathVisibleLaw_map g h hg0 hg1 hh have huniv := congrArg (fun μ : Measure (Obs 2 2) => μ univ) hmap rw [Measure.map_apply (measurable_of_finite (fun v : PathVisibleCell => pathObsPoint v.1 v.2.1 v.2.2.1 v.2.2.2)) MeasurableSet.univ] at huniv simpa using huniv
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathVisibleLaw_isProbabilityMeasure · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathKL.lean:106
theorem pathVisibleLaw_base_floor

Every base visible cell has a uniform positive mass. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g :
hg0 :
0 ≤ g
hg1 :
g ≤ 1 / 4
1 / 1000 ≤ (pathVisibleLaw g 0).real {v}
Proof (Lean source)
-- @node: pathVisibleLaw_base_floor lemma pathVisibleLaw_base_floor (g : ℝ) (hg0 : 0 ≤ g) (hg1 : g ≤ 1 / 4) (v : PathVisibleCell) : 1 / 1000 ≤ (pathVisibleLaw g 0).real {v} := by rw [pathVisibleLaw_singleton g 0 hg0 hg1 (by norm_num)] exact pathVisibleMass_base_floor g hg0 hg1 _ _ _ _
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathVisibleLaw_base_floor · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathKL.lean:120
theorem pathVisibleLaw_absolutelyContinuous

The displaced finite visible law is absolutely continuous with respect to the base law. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg0 :
0 ≤ g
hg1 :
g ≤ 1 / 4
Proof (Lean source)
-- @node: pathVisibleLaw_absolutelyContinuous lemma pathVisibleLaw_absolutelyContinuous (g h : ℝ) (hg0 : 0 ≤ g) (hg1 : g ≤ 1 / 4) : pathVisibleLaw g h ≪ pathVisibleLaw g 0 := by intro A hzero by_cases hA : A.Nonempty · obtain ⟨v, hv⟩ := hA have hmono : pathVisibleLaw g 0 {v} ≤ pathVisibleLaw g 0 A := measure_mono (singleton_subset_iff.mpr hv) have hposReal : 0 < (pathVisibleLaw g 0).real {v} := lt_of_lt_of_le (by norm_num) (pathVisibleLaw_base_floor g hg0 hg1 v) have hpos : pathVisibleLaw g 0 {v} ≠ 0 := by intro hz rw [Measure.real_def, hz, ENNReal.toReal_zero] at hposReal exact lt_irrefl 0 hposReal exact elim (hpos (nonpos_iff_eq_zero.mp (hzero ▸ hmono))) · rw [not_nonempty_iff_eq_empty.mp hA] simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathVisibleLaw_absolutelyContinuous · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathKL.lean:128
theorem pathObsLaw_absolutelyContinuous Lemma pathObsLaw_absolutelyContinuous in the paper ↗

The observed labelled-path law is absolutely continuous with respect to its base law. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg0 :
0 ≤ g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
letI
Proof (Lean source)
-- @node: pathObsLaw_absolutelyContinuous lemma pathObsLaw_absolutelyContinuous (g h : ℝ) (hg0 : 0 ≤ g) (hg1 : g ≤ 1 / 4) (hh : |h| ≤ 1 / 100) : letI := pathLaw_isProbabilityMeasure g h hg0 hg1 (by constructor <;> linarith [abs_le.mp hh]) hh letI := pathLaw_isProbabilityMeasure g 0 hg0 hg1 (by norm_num [TangentAmplitudeDomain]) (by norm_num) obsLaw (pathLaw g h) ≪ obsLaw (pathLaw g 0) := by letI := pathLaw_isProbabilityMeasure g h hg0 hg1 (by constructor <;> linarith [abs_le.mp hh]) hh letI := pathLaw_isProbabilityMeasure g 0 hg0 hg1 (by norm_num [TangentAmplitudeDomain]) (by norm_num) let f := fun v : PathVisibleCell => pathObsPoint v.1 v.2.1 v.2.2.1 v.2.2.2 rw [← pathVisibleLaw_map g h hg0 hg1 hh, ← pathVisibleLaw_map g 0 hg0 hg1 (by norm_num)] exact (pathVisibleLaw_absolutelyContinuous g h hg0 hg1).map (measurable_of_finite f)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathObsLaw_absolutelyContinuous · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathKL.lean:147
theorem pathObsLaw_llr_integrable Lemma pathObsLaw_llr_integrable in the paper ↗

The labelled-path observed log likelihood ratio is integrable. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg0 :
0 ≤ g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
letI
Proof (Lean source)
-- @node: pathObsLaw_llr_integrable lemma pathObsLaw_llr_integrable (g h : ℝ) (hg0 : 0 ≤ g) (hg1 : g ≤ 1 / 4) (hh : |h| ≤ 1 / 100) : letI := pathLaw_isProbabilityMeasure g h hg0 hg1 (by constructor <;> linarith [abs_le.mp hh]) hh letI := pathLaw_isProbabilityMeasure g 0 hg0 hg1 (by norm_num [TangentAmplitudeDomain]) (by norm_num) Integrable (llr (obsLaw (pathLaw g h)) (obsLaw (pathLaw g 0))) (obsLaw (pathLaw g h)) := by letI := pathLaw_isProbabilityMeasure g h hg0 hg1 (by constructor <;> linarith [abs_le.mp hh]) hh letI := pathLaw_isProbabilityMeasure g 0 hg0 hg1 (by norm_num [TangentAmplitudeDomain]) (by norm_num) letI := pathVisibleLaw_isProbabilityMeasure g h hg0 hg1 hh letI := pathVisibleLaw_isProbabilityMeasure g 0 hg0 hg1 (by norm_num) let f := fun v : PathVisibleCell => pathObsPoint v.1 v.2.1 v.2.2.1 v.2.2.2 rw [← pathVisibleLaw_map g h hg0 hg1 hh, ← pathVisibleLaw_map g 0 hg0 hg1 (by norm_num)] exact InformationTheory.integrable_llr_map (pathVisibleLaw_absolutelyContinuous g h hg0 hg1) (measurable_of_finite f) Integrable.of_finite
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathObsLaw_llr_integrable · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathKL.lean:165
theorem pathVisibleLaw_chiSqDiv_bound

The chi-square divergence of the finite visible path is quadratically bounded. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg0 :
0 ≤ g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
chiSqDiv (pathVisibleLaw g h) (pathVisibleLaw g 0) ≤ 16000 * g ^ 2 * h ^ 2
Proof (Lean source)
-- @node: pathVisibleLaw_chiSqDiv_bound lemma pathVisibleLaw_chiSqDiv_bound (g h : ℝ) (hg0 : 0 ≤ g) (hg1 : g ≤ 1 / 4) (hh : |h| ≤ 1 / 100) : chiSqDiv (pathVisibleLaw g h) (pathVisibleLaw g 0) ≤ 16000 * g ^ 2 * h ^ 2 := by letI := pathVisibleLaw_isProbabilityMeasure g h hg0 hg1 hh letI := pathVisibleLaw_isProbabilityMeasure g 0 hg0 hg1 (by norm_num) have hac := pathVisibleLaw_absolutelyContinuous g h hg0 hg1 have hformula := finite_one_add_chiSqDiv (pathVisibleLaw g h) (pathVisibleLaw g 0) hac have hmass (μ : Measure PathVisibleCell) [IsProbabilityMeasure μ] : ∑ v, μ.real {v} = 1 := by simpa using (MeasureTheory.sum_measureReal_singleton (μ := μ) univ) have hidentity : chiSqDiv (pathVisibleLaw g h) (pathVisibleLaw g 0) = ∑ v : PathVisibleCell, ((pathVisibleLaw g h).real {v} - (pathVisibleLaw g 0).real {v}) ^ 2 / (pathVisibleLaw g 0).real {v} := by have hp := hmass (pathVisibleLaw g h) have hq := hmass (pathVisibleLaw g 0) calc _ = (∑ v : PathVisibleCell, (pathVisibleLaw g h).real {v} ^ 2 / (pathVisibleLaw g 0).real {v}) - 1 := by linarith [hformula] _ = (∑ v : PathVisibleCell, (pathVisibleLaw g h).real {v} ^ 2 / (pathVisibleLaw g 0).real {v}) - 2 * (∑ v : PathVisibleCell, (pathVisibleLaw g h).real {v}) + ∑ v : PathVisibleCell, (pathVisibleLaw g 0).real {v} := by rw [hp, hq] ring _ = ∑ v : PathVisibleCell, ((pathVisibleLaw g h).real {v} - (pathVisibleLaw g 0).real {v}) ^ 2 / (pathVisibleLaw g 0).real {v} := by symm calc _ = ∑ v : PathVisibleCell, (((pathVisibleLaw g h).real {v} ^ 2 / (pathVisibleLaw g 0).real {v} - 2 * (pathVisibleLaw g h).real {v}) + (pathVisibleLaw g 0).real {v}) := by apply Finset.sum_congr rfl intro v _ have hqpos : 0 < (pathVisibleLaw g 0).real {v} := lt_of_lt_of_le (by norm_num) (pathVisibleLaw_base_floor g hg0 hg1 v) field_simp ring _ = _ := by rw [Finset.sum_add_distrib, Finset.sum_sub_distrib, ← Finset.mul_sum] rw [hidentity] calc _ ≤ ∑ _v : PathVisibleCell, 1000 * g ^ 2 * h ^ 2 := by apply Finset.sum_le_sum intro v _ have hqfloor := pathVisibleLaw_base_floor g hg0 hg1 v have hdiff := pathVisibleMass_diff_bound g h hg0 hh v.1 v.2.1 v.2.2.1 v.2.2.2 rw [← pathVisibleLaw_singleton g h hg0 hg1 hh, ← pathVisibleLaw_singleton g 0 hg0 hg1 (by norm_num)] at hdiff have hqpos : 0 < (pathVisibleLaw g 0).real {v} := lt_of_lt_of_le (by norm_num) hqfloor rw [div_le_iff₀ hqpos] have hsq := sq_le_sq₀ (abs_nonneg _) (mul_nonneg hg0 (abs_nonneg h)) |>.2 hdiff rw [sq_abs] at hsq calc _ ≤ (g * |h|) ^ 2 := hsq _ = g ^ 2 * h ^ 2 := by rw [mul_pow, sq_abs] _ ≤ 1000 * g ^ 2 * h ^ 2 * (pathVisibleLaw g 0).real {v} := by have hs : 1 ≤ 1000 * (pathVisibleLaw g 0).real {v} := by nlinarith have hn : 0 ≤ g ^ 2 * h ^ 2 := mul_nonneg (sq_nonneg g) (sq_nonneg h) simpa [mul_assoc, mul_left_comm, mul_comm] using (mul_le_mul_of_nonneg_left hs hn) _ = 16000 * g ^ 2 * h ^ 2 := by norm_num [Fintype.card_prod] ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathVisibleLaw_chiSqDiv_bound · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathKL.lean:188
theorem pathLaw_observed_kl_bound Lemma pathLaw_observed_kl_bound in the paper ↗

The observed one-record KL divergence along the labelled path is quadratic in g*h. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg0 :
0 ≤ g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
letI
Proof (Lean source)
-- @node: pathLaw_observed_kl_bound lemma pathLaw_observed_kl_bound (g h : ℝ) (hg0 : 0 ≤ g) (hg1 : g ≤ 1 / 4) (hh : |h| ≤ 1 / 100) : letI := pathLaw_isProbabilityMeasure g h hg0 hg1 (by constructor <;> linarith [abs_le.mp hh]) hh letI := pathLaw_isProbabilityMeasure g 0 hg0 hg1 (by norm_num [TangentAmplitudeDomain]) (by norm_num) klDiv (obsLaw (pathLaw g h)) (obsLaw (pathLaw g 0)) ≤ ofReal (16000 * g ^ 2 * h ^ 2) := by letI := pathLaw_isProbabilityMeasure g h hg0 hg1 (by constructor <;> linarith [abs_le.mp hh]) hh letI := pathLaw_isProbabilityMeasure g 0 hg0 hg1 (by norm_num [TangentAmplitudeDomain]) (by norm_num) letI := pathVisibleLaw_isProbabilityMeasure g h hg0 hg1 hh letI := pathVisibleLaw_isProbabilityMeasure g 0 hg0 hg1 (by norm_num) rw [← pathVisibleLaw_map g h hg0 hg1 hh, ← pathVisibleLaw_map g 0 hg0 hg1 (by norm_num)] calc _ ≤ klDiv (pathVisibleLaw g h) (pathVisibleLaw g 0) := InformationTheory.klDiv_map_le (pathVisibleLaw g h) (pathVisibleLaw g 0) (measurable_of_finite _) _ ≤ ofReal (chiSqDiv (pathVisibleLaw g h) (pathVisibleLaw g 0)) := klDiv_le_chiSqDiv _ _ (pathVisibleLaw_absolutelyContinuous g h hg0 hg1) _ ≤ ofReal (16000 * g ^ 2 * h ^ 2) := ENNReal.ofReal_le_ofReal (pathVisibleLaw_chiSqDiv_bound g h hg0 hg1 hh)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathLaw_observed_kl_bound · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathKL.lean:263
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.PathLocalExperiments 8 declarations Gap and local-experiment certificates for the factorization-preserving labelled path.

Gap and local-experiment certificates for the factorization-preserving labelled path.

Multiplying a Bernoulli mass by its Boolean outcome and summing returns its mean. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
a p :
∑ b : Bool, a * bernoulliMass p b * boolReal b = a * p
Proof (Lean source)
-- @node: pathBernoulli_mean lemma pathBernoulli_mean (a p : ℝ) : ∑ b : Bool, a * bernoulliMass p b * boolReal b = a * p := by norm_num [bernoulliMass, boolReal]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathBernoulli_mean · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathLocalExperiments.lean:11

A Bernoulli nuisance coordinate integrates out even with a trailing constant factor. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
a p c :
∑ b : Bool, a * bernoulliMass p b * c = a * c
Proof (Lean source)
-- @node: pathBernoulli_sum_mul lemma pathBernoulli_sum_mul (a p c : ℝ) : ∑ b : Bool, a * bernoulliMass p b * c = a * c := by norm_num [bernoulliMass] ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathBernoulli_sum_mul · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathLocalExperiments.lean:17
theorem path_latentMean

Potential-outcome means on the labelled path equal their construction probabilities. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg0 :
0 ≤ g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
u :
Fin 2
t :
= if t then (if u.val = 0 then 1 / 2 - g / 2 else 1 / 2 + g / 2) else 1 / 4
Proof (Lean source)
-- @node: path_latentMean lemma path_latentMean (g h : ℝ) (hg0 : 0 ≤ g) (hg1 : g ≤ 1 / 4) (hh : |h| ≤ 1 / 100) (u : Fin 2) (t : Bool) : latentMean (pathLaw g h) t u = if t then (if u.val = 0 then 1 / 2 - g / 2 else 1 / 2 + g / 2) else 1 / 4 := by rw [latentMean, conditionalMean_path_latentClass g h hg0 hg1 hh] have hb := abs_le.mp hh have hpu : (if u.val = 0 then 2 / 5 + h else 3 / 5 - h : ℝ) ≠ 0 := by fin_cases u <;> simp <;> nlinarith [hb.1, hb.2] rw [show (∑ s : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, pathWeight g h u s x z y0 y1) = (if u.val = 0 then 2 / 5 + h else 3 / 5 - h) from pathWeight_sum_nuisance g h u] simp only [pathWeight, pathPoint, witnessPoint, potential] by_cases ht : t = true · subst t simp only [↓reduceIte] simp_rw [pathBernoulli_mean] simp_rw [pathBernoulli_sum_mul] rw [← mul_assoc, inv_mul_cancel₀ hpu, one_mul] · have ht' : t = false := Bool.eq_false_of_not_eq_true ht subst t simp only [Bool.false_eq_true, ↓reduceIte] simp_rw [pathBernoulli_sum_mul] simp_rw [pathBernoulli_mean] simp_rw [pathBernoulli_sum_mul] rw [← mul_assoc, inv_mul_cancel₀ hpu, one_mul]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.path_latentMean · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathLocalExperiments.lean:26
theorem path_latentEffect

The two latent effects on the labelled path are exactly separated by g. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg0 :
0 ≤ g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
u :
Fin 2
latentEffect (pathLaw g h) u = if u.val = 0 then 1 / 4 - g / 2 else 1 / 4 + g / 2
Proof (Lean source)
-- @node: path_latentEffect lemma path_latentEffect (g h : ℝ) (hg0 : 0 ≤ g) (hg1 : g ≤ 1 / 4) (hh : |h| ≤ 1 / 100) (u : Fin 2) : latentEffect (pathLaw g h) u = if u.val = 0 then 1 / 4 - g / 2 else 1 / 4 + g / 2 := by rw [latentEffect, path_latentMean g h hg0 hg1 hh u true, path_latentMean g h hg0 hg1 hh u false] fin_cases u <;> norm_num <;> ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.path_latentEffect · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathLocalExperiments.lean:54
theorem path_effectGap

The nearest positive effect gap of the labelled path is exactly g. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg :
0 < g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
effectGap (pathLaw g h) = (g : EReal)
Proof (Lean source)
-- @node: path_effectGap lemma path_effectGap (g h : ℝ) (hg : 0 < g) (hg1 : g ≤ 1 / 4) (hh : |h| ≤ 1 / 100) : effectGap (pathLaw g h) = (g : EReal) := by unfold effectGap have hset : {d : EReal | ∃ u v : Fin 2, 0 < latentMass (pathLaw g h) u ∧ 0 < latentMass (pathLaw g h) v ∧ latentEffect (pathLaw g h) u ≠ latentEffect (pathLaw g h) v ∧ d = |latentEffect (pathLaw g h) u - latentEffect (pathLaw g h) v|} = {(g : EReal)} := by ext d constructor · rintro ⟨u, v, _hu, _hv, huv, rfl⟩ rw [path_latentEffect g h hg.le hg1 hh u, path_latentEffect g h hg.le hg1 hh v] fin_cases u <;> fin_cases v <;> simp_all [abs_of_pos hg] <;> try ring rw [abs_neg, abs_of_pos hg] · intro hd simp only [Set.mem_singleton_iff] at hd subst d refine ⟨0, 1, ?_, ?_, ?_, ?_⟩ · rw [path_latentMass g h hg.le hg1 hh] have hb := abs_le.mp hh norm_num linarith · rw [path_latentMass g h hg.le hg1 hh] have hb := abs_le.mp hh norm_num linarith · rw [path_latentEffect g h hg.le hg1 hh 0, path_latentEffect g h hg.le hg1 hh 1] norm_num linarith · rw [path_latentEffect g h hg.le hg1 hh 0, path_latentEffect g h hg.le hg1 hh 1] norm_num rw [show 1 / 4 - g / 2 - (1 / 4 + g / 2) = -g by ring, abs_neg, abs_of_pos hg] rw [hset] simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.path_effectGap · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathLocalExperiments.lean:64
theorem path_distinctEffects

Both positive-mass effects on the labelled path are distinct. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg :
0 < g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
Proof (Lean source)
-- @node: path_distinctEffects lemma path_distinctEffects (g h : ℝ) (hg : 0 < g) (hg1 : g ≤ 1 / 4) (hh : |h| ≤ 1 / 100) : DistinctEffects (pathLaw g h) := by unfold DistinctEffects have hmass (u : Fin 2) : 0 < latentMass (pathLaw g h) u := by rw [path_latentMass g h hg.le hg1 hh] have hb := abs_le.mp hh fin_cases u <;> norm_num <;> linarith rw [Finset.filter_eq_self.mpr (fun u _ => hmass u)] apply Finset.card_image_iff.mpr intro u _ v _ huv rw [path_latentEffect g h hg.le hg1 hh u, path_latentEffect g h hg.le hg1 hh v] at huv fin_cases u <;> fin_cases v <;> simp_all <;> linarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.path_distinctEffects · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathLocalExperiments.lean:102

Every small-displacement path law lies in the gap-localized model. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg :
0 < g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
letI
Proof (Lean source)
-- @node: path_gapStratum lemma path_gapStratum (g h : ℝ) (hg : 0 < g) (hg1 : g ≤ 1 / 4) (hh : |h| ≤ 1 / 100) : letI := pathLaw_isProbabilityMeasure g h hg.le hg1 (by constructor <;> linarith [abs_le.mp hh]) hh GapStratum (L := 2) (pi0 := 1 / 10) (sigma0 := 1 / 10) (g := g) (pathLaw g h) := by letI := pathLaw_isProbabilityMeasure g h hg.le hg1 (by constructor <;> linarith [abs_le.mp hh]) hh refine { toUCVMWModel := path_ucvmwModel g h hg.le hg1 hh gapDomain := ⟨hg, hg1⟩ gapWindow := ?_ distinctEffects := path_distinctEffects g h hg hg1 hh } unfold GapWindow rw [path_effectGap g h hg hg1 hh] constructor · change ((g / 2 : ℝ) : EReal) ≤ (g : EReal) exact EReal.coe_le_coe_iff.mpr (div_le_self hg.le (by norm_num)) · norm_cast nlinarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.path_gapStratum · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathLocalExperiments.lean:117
theorem path_localWeightExperiment Lemma 16 in the paper ↗

The observed KL certificate promotes a small labelled path into the local experiment. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
n :
cLoc g h :
hcLoc :
hg :
0 < g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
hKL :
16000 * g ^ 2 * h ^ 2 ≤ cLoc / n
letI
Proof (Lean source)
-- @node: path_localWeightExperiment lemma path_localWeightExperiment (n : ℕ) (cLoc g h : ℝ) (hcLoc : LocalRadiusDomain cLoc) (hg : 0 < g) (hg1 : g ≤ 1 / 4) (hh : |h| ≤ 1 / 100) (hKL : 16000 * g ^ 2 * h ^ 2 ≤ cLoc / n) : letI := pathLaw_isProbabilityMeasure g h hg.le hg1 (by constructor <;> linarith [abs_le.mp hh]) hh LocalWeightExperiment (n := n) (L := 2) (pi0 := 1 / 10) (sigma0 := 1 / 10) (cLoc := cLoc) (g := g) (pathLaw g h) := by letI := pathLaw_isProbabilityMeasure g h hg.le hg1 (by constructor <;> linarith [abs_le.mp hh]) hh letI : IsProbabilityMeasure (witnessLaw (g / 2)) := witnessLaw_isProbabilityMeasure (g / 2) (by positivity) (by linarith) refine { toGapStratum := path_gapStratum g h hg hg1 hh cLoc_pos := hcLoc.1 cLoc_lt_one := hcLoc.2 neighborhood := ?_ } unfold LocalWeightNeighborhood dsimp only change klDiv (obsLaw (pathLaw g h)) (obsLaw (witnessLaw (g / 2))) ≤ ofReal (cLoc / n) simpa only [obsLaw, pathLaw_zero] using ((pathLaw_observed_kl_bound g h hg.le hg1 hh).trans (ENNReal.ofReal_le_ofReal hKL))
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.path_localWeightExperiment · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathLocalExperiments.lean:139
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.PathModelCertificates 21 declarations Model-class and gap certificates for the factorization-preserving labelled path.

Model-class and gap certificates for the factorization-preserving labelled path.

theorem ae_pathLaw_of_points

A property true at every displayed path atom holds almost everywhere under the path law. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
p :
FullData 2 2 2 → Prop
hp :
∀ (u : Fin 2) (t x z y0 y1 : Bool), p (pathPoint u t x z y0 y1)
∀ᵐ w ∂pathLaw g h, p w
Proof (Lean source)
-- @node: ae_pathLaw_of_points lemma ae_pathLaw_of_points (g h : ℝ) (p : FullData 2 2 2 → Prop) (hp : ∀ (u : Fin 2) (t x z y0 y1 : Bool), p (pathPoint u t x z y0 y1)) : ∀ᵐ w ∂pathLaw g h, p w := by rw [pathLaw] simp only [ae_finsetSum_measure_iff] intro u _ t _ x _ z _ y0 _ y1 _ by_cases hc : ofReal (pathWeight g h u t x z y0 y1) = 0 · simp [hc] · rw [Measure.ae_ennreal_smul_measure_iff hc, ae_dirac_eq] exact hp u t x z y0 y1
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ae_pathLaw_of_points · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathModelCertificates.lean:13
theorem pathReferenceFeature_first_formula Lemma pathReferenceFeature_first_formula in the paper ↗

The constructed reference feature has the normalized constant first coordinate. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
t :
h :
u :
Fin 2
hh :
|h| ≤ 1 / 100
Proof (Lean source)
-- @node: pathReferenceFeature_first_formula lemma pathReferenceFeature_first_formula (t : Bool) (h : ℝ) (u : Fin 2) (hh : |h| ≤ 1 / 100) : pathReferenceFeature t h 0 u = 1 := by have hb := abs_le.mp hh have hp0 : 2 / 5 + h ≠ 0 := by nlinarith [hb.1, hb.2] have hp1 : 3 / 5 - h ≠ 0 := by nlinarith [hb.1, hb.2] have h4 : 15 * h + 4 ≠ 0 := by nlinarith [hb.1, hb.2] have h3 : 5 * h + 3 ≠ 0 := by nlinarith [hb.1, hb.2] have h2 : 2 + h * 5 ≠ 0 := by nlinarith [hb.1, hb.2] have h3m : 3 - h * 5 ≠ 0 := by nlinarith [hb.1, hb.2] have h30p : 30 + h * 50 ≠ 0 := by nlinarith [hb.1, hb.2] have h20p : 20 + h * 75 ≠ 0 := by nlinarith [hb.1, hb.2] have h30m : 30 - h * 50 ≠ 0 := by nlinarith [hb.1, hb.2] have h45m : 45 - h * 75 ≠ 0 := by nlinarith [hb.1, hb.2] have hw0f : 6 / 25 + 2 * h / 5 ≠ 0 := by nlinarith [hb.1, hb.2] have hw0t : 4 / 25 + 3 * h / 5 ≠ 0 := by nlinarith [hb.1, hb.2] have hw1f : 6 / 25 - 2 * h / 5 ≠ 0 := by nlinarith [hb.1, hb.2] have hw1t : 9 / 25 - 3 * h / 5 ≠ 0 := by nlinarith [hb.1, hb.2] have hw0f' : 6 * 5 + 25 * h * 2 ≠ 0 := by nlinarith [hb.1, hb.2] have hw0t' : 4 * 5 + 25 * 3 * h ≠ 0 := by nlinarith [hb.1, hb.2] have hw1f' : 6 * 5 - 25 * h * 2 ≠ 0 := by nlinarith [hb.1, hb.2] have hw1t' : 9 * 5 - 25 * 3 * h ≠ 0 := by nlinarith [hb.1, hb.2] have hweights : pathArmWeights t h = fun u => if t then (if u.val = 0 then 4 / 25 + 3 * h / 5 else 9 / 25 - 3 * h / 5) else (if u.val = 0 then 6 / 25 + 2 * h / 5 else 6 / 25 - 2 * h / 5) := funext fun u => pathArmWeights_formula t h u hh have hweights0 : pathArmWeights t 0 = fun u => if t then (if u.val = 0 then 4 / 25 else 9 / 25) else (if u.val = 0 then 6 / 25 else 6 / 25) := by funext u simpa using pathArmWeights_formula t 0 u (by norm_num : |(0 : ℝ)| ≤ 1 / 100) have hunit : IsUnit (fun u : Fin 2 => if t then (if u.val = 0 then 4 / 25 + 3 * h / 5 else 9 / 25 - 3 * h / 5) else (if u.val = 0 then 6 / 25 + 2 * h / 5 else 6 / 25 - 2 * h / 5)) := by rw [Pi.isUnit_iff] intro v rw [isUnit_iff_ne_zero] fin_cases v <;> cases t <;> simp <;> nlinarith [hb.1, hb.2] change (pathJointProxyMoment t * ((pathTargetFeature h).transpose)⁻¹ * (diagonal (pathArmWeights t h))⁻¹) (0 : Fin 2) u = 1 rw [pathTargetTransposeInverse_formula h hh, hweights] unfold pathJointProxyMoment rw [hweights0, Matrix.inv_diagonal] fin_cases u <;> cases t <;> simp_all [baseReferenceFeature, pathTargetFeature, Matrix.mul_apply, Ring.inverse] <;> simp_rw [inv_eq_one_div] <;> field_simp [hp0, hp1, h4, h3, h2, h3m, h30p, h20p, h30m, h45m, hw0f, hw0t, hw1f, hw1t] <;> try field_simp [h30p, h20p, h30m, h45m, hw0f', hw0t', hw1f', hw1t'] all_goals ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathReferenceFeature_first_formula · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathModelCertificates.lean:28
theorem path_targetFeature

The path's latent-class conditional target means equal its constructed target feature. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg0 :
0 ≤ g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
Proof (Lean source)
-- @node: path_targetFeature lemma path_targetFeature (g h : ℝ) (hg0 : 0 ≤ g) (hg1 : g ≤ 1 / 4) (hh : |h| ≤ 1 / 100) : targetFeature (pathLaw g h) = pathTargetFeature h := by have hb := abs_le.mp hh have h2 : 2 + h * 5 ≠ 0 := by nlinarith [hb.1, hb.2] have h3 : 3 - h * 5 ≠ 0 := by nlinarith [hb.1, hb.2] have hsq : 9 - h * 30 + h ^ 2 * 25 ≠ 0 := by rw [show 9 - h * 30 + h ^ 2 * 25 = (3 - h * 5) ^ 2 by ring] exact pow_ne_zero _ h3 ext i u rw [targetFeature, conditionalMean_path_latentClass g h hg0 hg1 hh] simp_rw [pathWeight] simp_rw [pathReferenceFeature_second_formula _ h _ hh] simp_rw [pathArmWeights_formula true h _ hh] simp only [pathPoint, witnessPoint] simp only [sum_mul_bernoulliMass] fin_cases i <;> fin_cases u <;> simp [pathTargetFeature, vec2, boolReal, bernoulliMass] <;> simp_rw [inv_eq_one_div] <;> field_simp [h2, h3, hsq] all_goals norm_num at * <;> field_simp [h2, h3, hsq] <;> ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.path_targetFeature · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathModelCertificates.lean:82
theorem path_referenceFeature

The path's latent-arm conditional reference means equal its constructed reference feature. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg0 :
0 ≤ g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
t :
Proof (Lean source)
-- @node: path_referenceFeature lemma path_referenceFeature (g h : ℝ) (hg0 : 0 ≤ g) (hg1 : g ≤ 1 / 4) (hh : |h| ≤ 1 / 100) (t : Bool) : referenceFeature (pathLaw g h) t = pathReferenceFeature t h := by have hb := abs_le.mp hh have h2 : 2 + h * 5 ≠ 0 := by nlinarith [hb.1, hb.2] have h3 : 3 - h * 5 ≠ 0 := by nlinarith [hb.1, hb.2] have h4 : 4 + h * 15 ≠ 0 := by nlinarith [hb.1, hb.2] have h5 : 3 + h * 5 ≠ 0 := by nlinarith [hb.1, hb.2] have hd30p : 30 + h * 50 ≠ 0 := by nlinarith [hb.1, hb.2] have hd40 : 40 + h * 250 + h ^ 2 * 375 ≠ 0 := by rw [show 40 + h * 250 + h ^ 2 * 375 = (4 + h * 15) * (10 + h * 25) by ring] exact mul_ne_zero h4 (by nlinarith [hb.1, hb.2]) have hd30m : 30 - h * 50 ≠ 0 := by nlinarith [hb.1, hb.2] have hd135 : 135 - h * 450 + h ^ 2 * 375 ≠ 0 := by rw [show 135 - h * 450 + h ^ 2 * 375 = 15 * (3 - h * 5) ^ 2 by ring] exact mul_ne_zero (by norm_num) (pow_ne_zero _ h3) have hd90 : 90 + h * 300 + h ^ 2 * 250 ≠ 0 := by rw [show 90 + h * 300 + h ^ 2 * 250 = 10 * (3 + h * 5) ^ 2 by ring] exact mul_ne_zero (by norm_num) (pow_ne_zero _ h5) have hd160 : 160 + h * 1600 + h ^ 2 * 5250 + h ^ 3 * 5625 ≠ 0 := by rw [show 160 + h * 1600 + h ^ 2 * 5250 + h ^ 3 * 5625 = (4 + h * 15) ^ 2 * (10 + h * 25) by ring] exact mul_ne_zero (pow_ne_zero _ h4) (by nlinarith [hb.1, hb.2]) ext i u rw [referenceFeature, conditionalMean_path_latentCell g h hg0 hg1 hh] have href : pathReferenceFeature t h i u = if i.val = 0 then 1 else if t then (if u.val = 0 then (225 * h + 28) / (20 * (15 * h + 4)) else 3 / 4) else (if u.val = 0 then (35 * h + 9) / (10 * (5 * h + 3)) else 7 / 10) := by by_cases hi : i.val = 0 · rw [if_pos hi] have hieq : i = 0 := Fin.ext hi subst i exact pathReferenceFeature_first_formula t h u hh · rw [if_neg hi] have hieq : i = 1 := Fin.ext (by omega) subst i exact pathReferenceFeature_second_formula t h u hh rw [href] simp_rw [pathWeight] simp_rw [pathReferenceFeature_second_formula _ h _ hh] simp_rw [pathArmWeights_formula true h _ hh] simp only [pathPoint, witnessPoint] simp only [sum_mul_bernoulliMass] fin_cases i <;> fin_cases u <;> cases t <;> simp [pathTargetFeature, vec2, boolReal, bernoulliMass] <;> simp_rw [inv_eq_one_div] <;> field_simp <;> ring all_goals norm_num at * <;> field_simp [h2, h3, h4, h5, hd30p, hd40, hd30m, hd135, hd90, hd160] <;> ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.path_referenceFeature · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathModelCertificates.lean:107
theorem path_consistency

The path obeys observed/potential-outcome consistency. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
Proof (Lean source)
-- @node: path_consistency lemma path_consistency (g h : ℝ) : CausalConsistency (pathLaw g h) := by unfold CausalConsistency apply ae_pathLaw_of_points intro u t x z y0 y1 cases t <;> simp [pathPoint, witnessPoint, potential]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.path_consistency · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathModelCertificates.lean:160
theorem path_anchor

The path preserves the constant first target-proxy coordinate. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
Proof (Lean source)
-- @node: path_anchor lemma path_anchor (g h : ℝ) : AnchorNormalization (pathLaw g h) := by unfold AnchorNormalization apply ae_pathLaw_of_points intro u t x z y0 y1 i hi simp [pathPoint, witnessPoint, vec2, hi]
theorem path_boundedX

The target proxy remains inside the envelope along the path. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
Proof (Lean source)
-- @node: path_boundedX lemma path_boundedX (g h : ℝ) : BoundedTargetProxy (L := 2) (pathLaw g h) := by unfold BoundedTargetProxy apply ae_pathLaw_of_points intro u t x z y0 y1 simp [pathPoint, witnessPoint, vec2, boolReal, Fin.sum_univ_two] cases x <;> norm_num [Real.sqrt_le_iff]
theorem path_boundedProxyProduct

Proxy outer products remain inside the envelope along the path. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
Proof (Lean source)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.path_boundedProxyProduct · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathModelCertificates.lean:185
theorem path_boundedOutcomeProxyProduct

Outcome-weighted proxy outer products remain inside the envelope along the path. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
Proof (Lean source)
-- @node: path_boundedOutcomeProxyProduct lemma path_boundedOutcomeProxyProduct (g h : ℝ) : BoundedOutcomeProxyProduct (L := 2) (pathLaw g h) := by unfold BoundedOutcomeProxyProduct apply ae_pathLaw_of_points intro u t x z y0 y1 cases t · cases y0 · change ‖matrixCLM (0 • outerProduct (vec2 1 (boolReal z)) (vec2 1 (boolReal x)))‖ ≤ 2 simp [matrixCLM] · change ‖matrixCLM (1 • outerProduct (vec2 1 (boolReal z)) (vec2 1 (boolReal x)))‖ ≤ 2 simpa using witness_outerProduct_norm x z · cases y1 · change ‖matrixCLM (0 • outerProduct (vec2 1 (boolReal z)) (vec2 1 (boolReal x)))‖ ≤ 2 simp [matrixCLM] · change ‖matrixCLM (1 • outerProduct (vec2 1 (boolReal z)) (vec2 1 (boolReal x)))‖ ≤ 2 simpa using witness_outerProduct_norm x z
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.path_boundedOutcomeProxyProduct · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathModelCertificates.lean:194
theorem path_latentCell_mass

The latent-arm cell masses are exactly the constructed arm weights. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg0 :
0 ≤ g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
u :
Fin 2
t :
Proof (Lean source)
-- @node: path_latentCell_mass lemma path_latentCell_mass (g h : ℝ) (hg0 : 0 ≤ g) (hg1 : g ≤ 1 / 4) (hh : |h| ≤ 1 / 100) (u : Fin 2) (t : Bool) : (pathLaw g h).real (latentCell u t) = pathArmWeights t h u := by classical rw [pathLaw_real g h _ (measurableSet_witness_latentCell u t)] simp_rw [ENNReal.toReal_ofReal (pathWeight_nonneg g h hg0 hg1 hh _ _ _ _ _ _)] rw [path_sum_restrict_latentCell g h u t (fun _ => (1 : ℝ))] simp only [mul_one, pathWeight, sum_mul_bernoulliMass] rw [pathArmWeights_formula true h u hh, pathArmWeights_formula t h u hh] have hb := abs_le.mp hh have hp0 : 2 / 5 + h ≠ 0 := by nlinarith [hb.1, hb.2] have hp1 : 3 / 5 - h ≠ 0 := by nlinarith [hb.1, hb.2] have h2 : 2 + h * 5 ≠ 0 := by nlinarith [hb.1, hb.2] have h3 : 3 - h * 5 ≠ 0 := by nlinarith [hb.1, hb.2] fin_cases u <;> cases t <;> norm_num only [Fin.isValue, Bool.false_eq_true, Bool.true_eq, if_false, if_true, bernoulliMass] all_goals field_simp [hp0, hp1, h2, h3] all_goals have h2' : 2 + 5 * h ≠ 0 := by nlinarith [hb.1, hb.2] all_goals have h3' : 3 - 5 * h ≠ 0 := by nlinarith [hb.1, hb.2] all_goals field_simp [h2', h3'] <;> ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.path_latentCell_mass · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathModelCertificates.lean:217
theorem path_latentArmPositivity

Every latent-arm cell retains the required one-tenth probability floor. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg0 :
0 ≤ g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
LatentArmPositivity (pi0 := 1 / 10) (pathLaw g h)
Proof (Lean source)
-- @node: path_latentArmPositivity lemma path_latentArmPositivity (g h : ℝ) (hg0 : 0 ≤ g) (hg1 : g ≤ 1 / 4) (hh : |h| ≤ 1 / 100) : LatentArmPositivity (pi0 := 1 / 10) (pathLaw g h) := by intro u t rw [path_latentCell_mass g h hg0 hg1 hh] rw [pathArmWeights_formula t h u hh] have hb := abs_le.mp hh fin_cases u <;> cases t <;> simp <;> nlinarith [hb.1, hb.2]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.path_latentArmPositivity · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathModelCertificates.lean:241
theorem path_lowerRight_opNorm

The operator norm of a two-by-two perturbation supported in the lower-right entry is bounded by the absolute value of that entry. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
a :
‖matrixCLM (!![(0 : ℝ), 0; 0, a])‖ ≤ |a|
Proof (Lean source)
-- @node: path_lowerRight_opNorm lemma path_lowerRight_opNorm (a : ℝ) : ‖matrixCLM (!![(0 : ℝ), 0; 0, a])‖ ≤ |a| := by apply ContinuousLinearMap.opNorm_le_bound _ (abs_nonneg a) intro x simp [matrixCLM, Matrix.toEuclideanLin_apply, mulVec, dotProduct, EuclideanSpace.norm_eq, Fin.sum_univ_two] have hx : |x.ofLp 1| ≤ sqrt (x.ofLp 0 ^ 2 + x.ofLp 1 ^ 2) := by rw [← Real.sqrt_sq_eq_abs] exact Real.sqrt_le_sqrt (by nlinarith [sq_nonneg (x.ofLp 0)]) rw [Real.sqrt_sq_eq_abs, abs_mul] exact mul_le_mul_of_nonneg_left hx (abs_nonneg a)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.path_lowerRight_opNorm · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathModelCertificates.lean:251
theorem path_lowerLeft_opNorm

The operator norm of a two-by-two perturbation supported in the lower-left entry is bounded by the absolute value of that entry. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
a :
‖matrixCLM (!![(0 : ℝ), 0; a, 0])‖ ≤ |a|
Proof (Lean source)
-- @node: path_lowerLeft_opNorm lemma path_lowerLeft_opNorm (a : ℝ) : ‖matrixCLM (!![(0 : ℝ), 0; a, 0])‖ ≤ |a| := by apply ContinuousLinearMap.opNorm_le_bound _ (abs_nonneg a) intro x simp [matrixCLM, Matrix.toEuclideanLin_apply, mulVec, dotProduct, EuclideanSpace.norm_eq, Fin.sum_univ_two] have hx : |x.ofLp 0| ≤ sqrt (x.ofLp 0 ^ 2 + x.ofLp 1 ^ 2) := by rw [← Real.sqrt_sq_eq_abs] exact Real.sqrt_le_sqrt (by nlinarith [sq_nonneg (x.ofLp 1)]) rw [Real.sqrt_sq_eq_abs, abs_mul] exact mul_le_mul_of_nonneg_left hx (abs_nonneg a)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.path_lowerLeft_opNorm · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathModelCertificates.lean:266
theorem pathTargetFeature_zero_strictRank Lemma pathTargetFeature_zero_strictRank in the paper ↗

The undisplaced target feature has enough strict singular-value slack to absorb the small labelled-path perturbation. Under the stated setting, the stated conclusion holds.

Formal statement
(1 / 5 : ℝ) ≤ signalMinSingular (pathTargetFeature 0)
Proof (Lean source)
-- @node: pathTargetFeature_zero_strictRank lemma pathTargetFeature_zero_strictRank : (1 / 5 : ℝ) ≤ signalMinSingular (pathTargetFeature 0) := by apply signalMinSingular_lower_fin_two _ _ (by norm_num) intro x simp [pathTargetFeature, Fin.sum_univ_two] nlinarith [sq_nonneg (3 * x 0 - 4 * x 1)]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathTargetFeature_zero_strictRank · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathModelCertificates.lean:281
theorem pathTargetFeature_entry_displacement Lemma pathTargetFeature_entry_displacement in the paper ↗

The displaced lower-right target-feature entry remains within one fiftieth of its undisplaced value. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
h :
hh :
|h| ≤ 1 / 100
|(12 / 25 - h / 5) / (3 / 5 - h) - 4 / 5| ≤ 1 / 50
Proof (Lean source)
-- @node: pathTargetFeature_entry_displacement lemma pathTargetFeature_entry_displacement (h : ℝ) (hh : |h| ≤ 1 / 100) : |(12 / 25 - h / 5) / (3 / 5 - h) - 4 / 5| ≤ 1 / 50 := by have hb := abs_le.mp hh have hd : 0 < 3 / 5 - h := by nlinarith have hdn : 3 / 5 - h ≠ 0 := ne_of_gt hd have heq : (12 / 25 - h / 5) / (3 / 5 - h) - 4 / 5 = (3 / 5 * h) / (3 / 5 - h) := by calc _ = (12 / 25 - h / 5) / (3 / 5 - h) - ((4 / 5) * (3 / 5 - h)) / (3 / 5 - h) := by rw [mul_div_cancel_right₀ _ hdn] _ = ((12 / 25 - h / 5) - (4 / 5) * (3 / 5 - h)) / (3 / 5 - h) := div_sub_div_same _ _ _ _ = _ := by congr 1; ring rw [heq, abs_div, abs_of_pos hd, abs_mul, abs_of_nonneg (by norm_num : (0 : ℝ) ≤ 3 / 5)] rw [div_le_iff₀ hd] nlinarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathTargetFeature_entry_displacement · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathModelCertificates.lean:291
theorem pathTargetFeature_rankMargin Lemma pathTargetFeature_rankMargin in the paper ↗

The target feature retains the one-tenth singular-value margin throughout the small labelled-path neighborhood. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
h :
hh :
|h| ≤ 1 / 100
(1 / 10 : ℝ) ≤ signalMinSingular (pathTargetFeature h)
Proof (Lean source)
-- @node: pathTargetFeature_rankMargin lemma pathTargetFeature_rankMargin (h : ℝ) (hh : |h| ≤ 1 / 100) : (1 / 10 : ℝ) ≤ signalMinSingular (pathTargetFeature h) := by let d := (12 / 25 - h / 5) / (3 / 5 - h) - 4 / 5 have hdecomp : pathTargetFeature h = pathTargetFeature 0 + !![(0 : ℝ), 0; 0, d] := by ext i j fin_cases i <;> fin_cases j <;> simp [pathTargetFeature, d] <;> ring have hw := singular_value_weyl (j := 1) (pathTargetFeature 0) (!![(0 : ℝ), 0; 0, d]) have hdn : ‖matrixCLM (!![(0 : ℝ), 0; 0, d])‖ ≤ 1 / 50 := (path_lowerRight_opNorm d).trans (pathTargetFeature_entry_displacement h hh) rw [← hdecomp] at hw have habs := abs_le.mp hw have hb := pathTargetFeature_zero_strictRank unfold signalMinSingular at * linarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathTargetFeature_rankMargin · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathModelCertificates.lean:313
theorem baseReferenceFeature_strictRank Lemma baseReferenceFeature_strictRank in the paper ↗

Each undisplaced reference feature has enough strict singular-value slack to absorb the labelled-path perturbation. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
t :
Proof (Lean source)
-- @node: baseReferenceFeature_strictRank lemma baseReferenceFeature_strictRank (t : Bool) : (1 / 5 : ℝ) ≤ signalMinSingular (baseReferenceFeature t) := by apply signalMinSingular_lower_fin_two _ _ (by norm_num) intro x cases t · simp [baseReferenceFeature, Fin.sum_univ_two] nlinarith [sq_nonneg (3 * x 0 - 7 * x 1)] · simp [baseReferenceFeature, Fin.sum_univ_two] nlinarith [sq_nonneg (7 * x 0 - 15 * x 1)]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.baseReferenceFeature_strictRank · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathModelCertificates.lean:333
theorem pathReferenceFeature_entry_displacement Lemma pathReferenceFeature_entry_displacement in the paper ↗

The varying lower-left reference-feature entry remains within one fiftieth of its undisplaced value in either treatment arm. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
t :
h :
hh :
|h| ≤ 1 / 100
|(if t then (225 * h + 28) / (20 * (15 * h + 4)) - 7 / 20 else (35 * h + 9) / (10 * (5 * h + 3)) - 3 / 10)|
≤ 1 / 50
Proof (Lean source)
-- @node: pathReferenceFeature_entry_displacement lemma pathReferenceFeature_entry_displacement (t : Bool) (h : ℝ) (hh : |h| ≤ 1 / 100) : |(if t then (225 * h + 28) / (20 * (15 * h + 4)) - 7 / 20 else (35 * h + 9) / (10 * (5 * h + 3)) - 3 / 10)| ≤ 1 / 50 := by have hb := abs_le.mp hh cases t · simp only [Bool.false_eq_true, if_false] have hd : 0 < 10 * (5 * h + 3) := by nlinarith have hdn : 10 * (5 * h + 3) ≠ 0 := ne_of_gt hd have heq : (35 * h + 9) / (10 * (5 * h + 3)) - 3 / 10 = (20 * h) / (10 * (5 * h + 3)) := by calc _ = (35 * h + 9) / (10 * (5 * h + 3)) - ((3 / 10) * (10 * (5 * h + 3))) / (10 * (5 * h + 3)) := by rw [mul_div_cancel_right₀ _ hdn] _ = ((35 * h + 9) - (3 / 10) * (10 * (5 * h + 3))) / (10 * (5 * h + 3)) := div_sub_div_same _ _ _ _ = _ := by congr 1; ring rw [heq, abs_div, abs_of_pos hd, abs_mul, abs_of_nonneg (by norm_num : (0 : ℝ) ≤ 20)] rw [div_le_iff₀ hd] nlinarith · simp only [if_true] have hd : 0 < 20 * (15 * h + 4) := by nlinarith have hdn : 20 * (15 * h + 4) ≠ 0 := ne_of_gt hd have heq : (225 * h + 28) / (20 * (15 * h + 4)) - 7 / 20 = (120 * h) / (20 * (15 * h + 4)) := by calc _ = (225 * h + 28) / (20 * (15 * h + 4)) - ((7 / 20) * (20 * (15 * h + 4))) / (20 * (15 * h + 4)) := by rw [mul_div_cancel_right₀ _ hdn] _ = ((225 * h + 28) - (7 / 20) * (20 * (15 * h + 4))) / (20 * (15 * h + 4)) := div_sub_div_same _ _ _ _ = _ := by congr 1; ring rw [heq, abs_div, abs_of_pos hd, abs_mul, abs_of_nonneg (by norm_num : (0 : ℝ) ≤ 120)] rw [div_le_iff₀ hd] nlinarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathReferenceFeature_entry_displacement · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathModelCertificates.lean:346
theorem pathReferenceFeature_rankMargin Lemma pathReferenceFeature_rankMargin in the paper ↗

Both reference features retain the one-tenth singular-value margin throughout the small labelled-path neighborhood. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
t :
h :
hh :
|h| ≤ 1 / 100
(1 / 10 : ℝ) ≤ signalMinSingular (pathReferenceFeature t h)
Proof (Lean source)
-- @node: pathReferenceFeature_rankMargin lemma pathReferenceFeature_rankMargin (t : Bool) (h : ℝ) (hh : |h| ≤ 1 / 100) : (1 / 10 : ℝ) ≤ signalMinSingular (pathReferenceFeature t h) := by let d := if t then (225 * h + 28) / (20 * (15 * h + 4)) - 7 / 20 else (35 * h + 9) / (10 * (5 * h + 3)) - 3 / 10 have hdecomp : pathReferenceFeature t h = baseReferenceFeature t + !![(0 : ℝ), 0; d, 0] := by ext i j fin_cases i <;> fin_cases j <;> cases t all_goals simp [baseReferenceFeature, d, pathReferenceFeature_first_formula _ _ _ hh, pathReferenceFeature_second_formula _ _ _ hh] have hw := singular_value_weyl (j := 1) (baseReferenceFeature t) (!![(0 : ℝ), 0; d, 0]) have hdn : ‖matrixCLM (!![(0 : ℝ), 0; d, 0])‖ ≤ 1 / 50 := (path_lowerLeft_opNorm d).trans (pathReferenceFeature_entry_displacement t h hh) rw [← hdecomp] at hw have habs := abs_le.mp hw have hb := baseReferenceFeature_strictRank t unfold signalMinSingular at * linarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathReferenceFeature_rankMargin · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathModelCertificates.lean:388
theorem path_proxyRankMargin Lemma 13 in the paper ↗

The factorization-preserving path has the full proxy-rank certificate required by the uniformly conditioned model. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg0 :
0 ≤ g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
ProxyRankMargin (sigma0 := 1 / 10) (pathLaw g h)
Proof (Lean source)
-- @node: path_proxyRankMargin lemma path_proxyRankMargin (g h : ℝ) (hg0 : 0 ≤ g) (hg1 : g ≤ 1 / 4) (hh : |h| ≤ 1 / 100) : ProxyRankMargin (sigma0 := 1 / 10) (pathLaw g h) := by unfold ProxyRankMargin rw [show referenceFeature (pathLaw g h) false = pathReferenceFeature false h from path_referenceFeature g h hg0 hg1 hh false, show referenceFeature (pathLaw g h) true = pathReferenceFeature true h from path_referenceFeature g h hg0 hg1 hh true, path_targetFeature g h hg0 hg1 hh] exact ⟨pathReferenceFeature_rankMargin false h hh, pathReferenceFeature_rankMargin true h hh, pathTargetFeature_rankMargin h hh⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.path_proxyRankMargin · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathModelCertificates.lean:412

Every sufficiently small labelled-path displacement remains in the uniformly conditioned model, uniformly over the displayed gap range. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg0 :
0 ≤ g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
letI
Proof (Lean source)
-- @node: path_ucvmwModel lemma path_ucvmwModel (g h : ℝ) (hg0 : 0 ≤ g) (hg1 : g ≤ 1 / 4) (hh : |h| ≤ 1 / 100) : letI := pathLaw_isProbabilityMeasure g h hg0 hg1 (by constructor <;> linarith [abs_le.mp hh]) hh UCVMWModel (L := 2) (pi0 := 1 / 10) (sigma0 := 1 / 10) (pathLaw g h) := by letI := pathLaw_isProbabilityMeasure g h hg0 hg1 (by constructor <;> linarith [abs_le.mp hh]) hh exact { coreDomain := by norm_num [CoreParameterDomain] referenceProxySeparation := path_referenceProxySeparation g h hg0 hg1 hh targetProxySeparation := path_targetProxySeparation g h hg0 hg1 hh consistency := path_consistency g h latentIgnorability := path_armwiseLatentIgnorability g h hg0 hg1 hh anchor := path_anchor g h boundedX := path_boundedX g h boundedProxyProduct := path_boundedProxyProduct g h boundedOutcomeProxyProduct := path_boundedOutcomeProxyProduct g h latentArmPositivity := path_latentArmPositivity g h hg0 hg1 hh proxyRankMargin := path_proxyRankMargin g h hg0 hg1 hh }
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.path_ucvmwModel · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/PathModelCertificates.lean:426
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.QuotientFunctionalCalculus 11 declarations Collision-stable finite functional calculus for quotient atomic laws.

Collision-stable finite functional calculus for quotient atomic laws.

The results deliberately use labelled diagonalizing coordinates only as a certificate. Repeated eigenvalues are allowed: the represented law is passed to LawModulo, so splitting, merging, or permuting equal-eigenvalue slots has no mathematical effect.

A square real operator together with diagonalizing coordinates. recover records the diagonal entry of basisInv * operator * basis; it is the only part of diagonalization needed by the perturbation bound, while expand is the usual reconstruction identity. It uses the supplied parameters.

Definition (Lean source)
k :
radius :
operator :
Matrix (Fin k) (Fin k) ℝ
basis :
Matrix (Fin k) (Fin k) ℝ
basisInv :
Matrix (Fin k) (Fin k) ℝ
spectrum :
Fin k → ℝ
spectrum_mem :
∀ i, spectrum i ∈ Icc (-radius) radius
expand :
∀ p q, operator p q = ∑ i, basis p i * spectrum i * basisInv i q
recover :
∀ i, spectrum i = ∑ p, ∑ q, basisInv i p * operator p q * basis q i
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.QuotientFunctionalCalculus.DiagonalizedOperator · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/QuotientFunctionalCalculus.lean:18
def spectralWeight

The left-right spectral weight occurring in aᵀ f(D) c. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k :
radius :
A :
a c :
Fin k → ℝ
i :
Fin k
spectralWeight A a c i :
(∑ p, a p * A.basis p i) * (∑ q, A.basisInv i q * c q)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.QuotientFunctionalCalculus.spectralWeight · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/QuotientFunctionalCalculus.lean:33
def applyFunction

The matrix obtained by applying a scalar function to diagonalized spectral coordinates. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k :
radius :
A :
f :
ℝ → ℝ
applyFunction A f :
Matrix (Fin k) (Fin k) ℝ
fun p q ↦ ∑ i, A.basis p i * f (A.spectrum i) * A.basisInv i q
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.QuotientFunctionalCalculus.applyFunction · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/QuotientFunctionalCalculus.lean:39

The bilinear anchor evaluation of a square matrix. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k :
a c :
Fin k → ℝ
M :
Matrix (Fin k) (Fin k) ℝ
anchorEval a c M :
∑ p, ∑ q, a p * M p q * c q
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.QuotientFunctionalCalculus.anchorEval · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/QuotientFunctionalCalculus.lean:45
theorem anchorEval_applyFunction

Left-right functional calculus is exactly integration against the labelled spectral weights: aᵀ f(D)c equals the weighted sum of f over the real spectrum. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
A :
a c :
Fin k → ℝ
f :
ℝ → ℝ
anchorEval a c (applyFunction A f) = ∑ i, spectralWeight A a c i * f (A.spectrum i)
Proof (Lean source)
-- @node: quotientFunctionalCalculus_anchorEval_applyFunction theorem anchorEval_applyFunction {k : ℕ} {radius : ℝ} (A : DiagonalizedOperator k radius) (a c : Fin k → ℝ) (f : ℝ → ℝ) : anchorEval a c (applyFunction A f) = ∑ i, spectralWeight A a c i * f (A.spectrum i) := by classical simp only [anchorEval, applyFunction, spectralWeight] calc (∑ p, ∑ q, a p * (∑ i, A.basis p i * f (A.spectrum i) * A.basisInv i q) * c q) = ∑ p, ∑ q, ∑ i, a p * (A.basis p i * f (A.spectrum i) * A.basisInv i q) * c q := by apply Finset.sum_congr rfl intro p hp apply Finset.sum_congr rfl intro q hq rw [Finset.mul_sum, Finset.sum_mul] _ = ∑ i, ∑ p, ∑ q, a p * (A.basis p i * f (A.spectrum i) * A.basisInv i q) * c q := by conv_lhs => enter [2, p] rw [Finset.sum_comm] rw [Finset.sum_comm] _ = ∑ i, (∑ p, a p * A.basis p i) * (∑ q, A.basisInv i q * c q) * f (A.spectrum i) := by apply Finset.sum_congr rfl intro i hi rw [Finset.mul_sum] simp_rw [Finset.sum_mul] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro q hq apply Finset.sum_congr rfl intro p hp ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.QuotientFunctionalCalculus.anchorEval_applyFunction · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/QuotientFunctionalCalculus.lean:51
def atomicLaw

The labelled atomic law extracted from left-right functional calculus. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k :
radius :
A :
a c :
Fin k → ℝ
atomicLaw A a c :
AtomicLaw k radius
⟨spectralWeight A a c, A.spectrum⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.QuotientFunctionalCalculus.atomicLaw · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/QuotientFunctionalCalculus.lean:88
theorem atomicLaw_valid

Positivity and normalization of the spectral weights turn functional-calculus coordinates into a valid atomic probability law. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
A :
a c :
Fin k → ℝ
hpos :
∀ i, 0 ≤ spectralWeight A a c i
hsum :
∑ i, spectralWeight A a c i = 1
AtomicLaw.Valid (atomicLaw A a c)
Proof (Lean source)
-- @node: quotientFunctionalCalculus_atomicLaw_valid theorem atomicLaw_valid {k : ℕ} {radius : ℝ} (A : DiagonalizedOperator k radius) (a c : Fin k → ℝ) (hpos : ∀ i, 0 ≤ spectralWeight A a c i) (hsum : ∑ i, spectralWeight A a c i = 1) : AtomicLaw.Valid (atomicLaw A a c) := by exact ⟨hpos, hsum, A.spectrum_mem⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.QuotientFunctionalCalculus.atomicLaw_valid · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/QuotientFunctionalCalculus.lean:94

Public quotient-law constructor for a positive normalized left-right functional calculus. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k :
radius :
A :
a c :
Fin k → ℝ
hpos :
∀ i, 0 ≤ spectralWeight A a c i
hsum :
∑ i, spectralWeight A a c i = 1
quotientLaw A a c hpos hsum :
AtomicLaw.LawModulo k radius
AtomicLaw.LawModulo.ofProbabilityLaw ⟨atomicLaw A a c, atomicLaw_valid A a c hpos hsum⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.QuotientFunctionalCalculus.quotientLaw · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/QuotientFunctionalCalculus.lean:103

Coordinatewise atom and weight perturbations control quotient Wasserstein loss. This lemma is independent of any eigengap and permits coincident atoms. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
AtomicLaw.ProbabilityLaw k radius
0 ≤ radius
AtomicLaw.wass1 nu.1 xi.1
≤ (∑ i, |nu.1.atom i - xi.1.atom i|) + 2 * radius * ∑ i, |nu.1.weight i - xi.1.weight i|
Proof (Lean source)
-- @node: quotientFunctionalCalculus_wass1_le_coordinateL1 theorem wass1_le_coordinateL1 {k : ℕ} {radius : ℝ} {nu xi : AtomicLaw.ProbabilityLaw k radius} : 0 ≤ radius → AtomicLaw.wass1 nu.1 xi.1 ≤ (∑ i, |nu.1.atom i - xi.1.atom i|) + 2 * radius * ∑ i, |nu.1.weight i - xi.1.weight i| := by intro hradius classical calc AtomicLaw.wass1 nu.1 xi.1 ≤ (∑ i, min (nu.1.weight i) (xi.1.weight i) * |nu.1.atom i - xi.1.atom i|) + 2 * radius * (∑ i, (nu.1.weight i - min (nu.1.weight i) (xi.1.weight i))) := AtomicLaw.LawModulo.wass1_le_coordinateBound nu xi _ ≤ (∑ i, |nu.1.atom i - xi.1.atom i|) + 2 * radius * ∑ i, |nu.1.weight i - xi.1.weight i| := by apply add_le_add · apply Finset.sum_le_sum intro i hi have hmin : min (nu.1.weight i) (xi.1.weight i) ≤ 1 := by exact (min_le_left _ _).trans (by rw [← nu.2.2.1] exact Finset.single_le_sum (fun j _ ↦ nu.2.1 j) (Finset.mem_univ i)) have hmin0 : 0 ≤ min (nu.1.weight i) (xi.1.weight i) := le_min (nu.2.1 i) (xi.2.1 i) nlinarith [abs_nonneg (nu.1.atom i - xi.1.atom i)] · apply mul_le_mul_of_nonneg_left _ (mul_nonneg (by norm_num) hradius) apply Finset.sum_le_sum intro i hi by_cases hle : nu.1.weight i ≤ xi.1.weight i · rw [min_eq_left hle] simpa using abs_nonneg (nu.1.weight i - xi.1.weight i) · rw [min_eq_right (le_of_not_ge hle)] exact le_abs_self _
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.QuotientFunctionalCalculus.wass1_le_coordinateL1 · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/QuotientFunctionalCalculus.lean:111
theorem gapFree_operatorAnchor_bound

Gap-free quotient-law modulus in diagonalized operator coordinates. The right side contains only the recovered operator entries and the left-right anchor weights; no eigenvalue separation or choice of distinct spectral projectors occurs. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
A B :
a c a' c' :
Fin k → ℝ
hradius :
0 ≤ radius
hApos :
∀ i, 0 ≤ spectralWeight A a c i
hAsum :
∑ i, spectralWeight A a c i = 1
hBpos :
∀ i, 0 ≤ spectralWeight B a' c' i
hBsum :
∑ i, spectralWeight B a' c' i = 1
(quotientLaw A a c hApos hAsum).wass1 (quotientLaw B a' c' hBpos hBsum)
≤ (∑ i, |(∑ p, ∑ q, A.basisInv i p * A.operator p q * A.basis q i) - (∑ p, ∑ q, B.basisInv i p * B.operator p q * B.basis q i)|)
+ 2 * radius * ∑ i, |spectralWeight A a c i
- spectralWeight B a' c' i|
Proof (Lean source)
-- @node: quotientFunctionalCalculus_gapFree_operatorAnchor_bound theorem gapFree_operatorAnchor_bound {k : ℕ} {radius : ℝ} (A B : DiagonalizedOperator k radius) (a c a' c' : Fin k → ℝ) (hradius : 0 ≤ radius) (hApos : ∀ i, 0 ≤ spectralWeight A a c i) (hAsum : ∑ i, spectralWeight A a c i = 1) (hBpos : ∀ i, 0 ≤ spectralWeight B a' c' i) (hBsum : ∑ i, spectralWeight B a' c' i = 1) : (quotientLaw A a c hApos hAsum).wass1 (quotientLaw B a' c' hBpos hBsum) ≤ (∑ i, |(∑ p, ∑ q, A.basisInv i p * A.operator p q * A.basis q i) - (∑ p, ∑ q, B.basisInv i p * B.operator p q * B.basis q i)|) + 2 * radius * ∑ i, |spectralWeight A a c i - spectralWeight B a' c' i| := by have hcoord := wass1_le_coordinateL1 (radius := radius) (nu := ⟨atomicLaw A a c, atomicLaw_valid A a c hApos hAsum⟩) (xi := ⟨atomicLaw B a' c', atomicLaw_valid B a' c' hBpos hBsum⟩) hradius have hlabel : AtomicLaw.wass1 (atomicLaw A a c) (atomicLaw B a' c') ≤ (∑ i, |A.spectrum i - B.spectrum i|) + 2 * radius * ∑ i, |spectralWeight A a c i - spectralWeight B a' c' i| := by simpa only [atomicLaw] using hcoord change (AtomicLaw.LawModulo.ofProbabilityLaw ⟨atomicLaw A a c, atomicLaw_valid A a c hApos hAsum⟩).wass1 (AtomicLaw.LawModulo.ofProbabilityLaw ⟨atomicLaw B a' c', atomicLaw_valid B a' c' hBpos hBsum⟩) ≤ _ rw [AtomicLaw.LawModulo.wass1_ofProbabilityLaw] calc AtomicLaw.wass1 (atomicLaw A a c) (atomicLaw B a' c') ≤ (∑ i, |A.spectrum i - B.spectrum i|) + 2 * radius * ∑ i, |spectralWeight A a c i - spectralWeight B a' c' i| := hlabel _ = _ := by congr 1 apply Finset.sum_congr rfl intro i hi rw [A.recover i, B.recover i]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.QuotientFunctionalCalculus.gapFree_operatorAnchor_bound · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/QuotientFunctionalCalculus.lean:150
theorem gapFree_fixedK_envelope

With bounded diagonalizers and anchors, quotient Wasserstein loss has an explicit fixed-k gap-free bound in entrywise operator, anchor, diagonalizer, and inverse perturbations. The formula is uniform over all real spectra in the radius interval, including arbitrary repeated eigenvalues. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
A B :
a c a' c' :
Fin k → ℝ
K U δD δa δc δS δT :
hradius :
0 ≤ radius
hK :
0 ≤ K
hU :
0 ≤ U
hAbasis :
∀ p i, |A.basis p i| ≤ K
hBbasis :
∀ p i, |B.basis p i| ≤ K
hAinv :
∀ i q, |A.basisInv i q| ≤ K
hBinv :
∀ i q, |B.basisInv i q| ≤ K
ha :
∀ p, |a p| ≤ U
ha' :
∀ p, |a' p| ≤ U
hc :
∀ q, |c q| ≤ U
hD :
∀ p q, |A.operator p q - B.operator p q| ≤ δD
hda :
∀ p, |a p - a' p| ≤ δa
hdc :
∀ q, |c q - c' q| ≤ δc
hS :
∀ p i, |A.basis p i - B.basis p i| ≤ δS
hT :
∀ i q, |A.basisInv i q - B.basisInv i q| ≤ δT
hApos :
∀ i, 0 ≤ spectralWeight A a c i
hAsum :
∑ i, spectralWeight A a c i = 1
hBpos :
∀ i, 0 ≤ spectralWeight B a' c' i
hBsum :
∑ i, spectralWeight B a' c' i = 1
(quotientLaw A a c hApos hAsum).wass1 (quotientLaw B a' c' hBpos hBsum)
≤ (k : ℝ) * ((k : ℝ) * ((k : ℝ) * (δT * ((k : ℝ) * (K * radius * K)) * K + K * δD * K + K * ((k : ℝ) * (K * radius * K)) * δS)))
+ 2 * radius * ((k : ℝ) * (((k : ℝ) * (δa * K + U * δS)) * ((k : ℝ) * (K * U)) + ((k : ℝ) * (U * K)) * ((k : ℝ) * (δT * U + K * δc))))
Proof (Lean source)
-- @node: quotientFunctionalCalculus_gapFree_fixedK_envelope theorem gapFree_fixedK_envelope {k : ℕ} {radius : ℝ} (A B : DiagonalizedOperator k radius) (a c a' c' : Fin k → ℝ) (K U δD δa δc δS δT : ℝ) (hradius : 0 ≤ radius) (hK : 0 ≤ K) (hU : 0 ≤ U) (hAbasis : ∀ p i, |A.basis p i| ≤ K) (hBbasis : ∀ p i, |B.basis p i| ≤ K) (hAinv : ∀ i q, |A.basisInv i q| ≤ K) (hBinv : ∀ i q, |B.basisInv i q| ≤ K) (ha : ∀ p, |a p| ≤ U) (ha' : ∀ p, |a' p| ≤ U) (hc : ∀ q, |c q| ≤ U) (hD : ∀ p q, |A.operator p q - B.operator p q| ≤ δD) (hda : ∀ p, |a p - a' p| ≤ δa) (hdc : ∀ q, |c q - c' q| ≤ δc) (hS : ∀ p i, |A.basis p i - B.basis p i| ≤ δS) (hT : ∀ i q, |A.basisInv i q - B.basisInv i q| ≤ δT) (hApos : ∀ i, 0 ≤ spectralWeight A a c i) (hAsum : ∑ i, spectralWeight A a c i = 1) (hBpos : ∀ i, 0 ≤ spectralWeight B a' c' i) (hBsum : ∑ i, spectralWeight B a' c' i = 1) : (quotientLaw A a c hApos hAsum).wass1 (quotientLaw B a' c' hBpos hBsum) ≤ (k : ℝ) * ((k : ℝ) * ((k : ℝ) * (δT * ((k : ℝ) * (K * radius * K)) * K + K * δD * K + K * ((k : ℝ) * (K * radius * K)) * δS))) + 2 * radius * ((k : ℝ) * (((k : ℝ) * (δa * K + U * δS)) * ((k : ℝ) * (K * U)) + ((k : ℝ) * (U * K)) * ((k : ℝ) * (δT * U + K * δc)))) := by calc (quotientLaw A a c hApos hAsum).wass1 (quotientLaw B a' c' hBpos hBsum) ≤ (∑ i, |A.spectrum i - B.spectrum i|) + 2 * radius * ∑ i, |spectralWeight A a c i - spectralWeight B a' c' i| := by have h := gapFree_operatorAnchor_bound A B a c a' c' hradius hApos hAsum hBpos hBsum simpa only [← A.recover, ← B.recover] using h _ ≤ _ := by apply add_le_add · calc (∑ i, |A.spectrum i - B.spectrum i|) ≤ ∑ _i : Fin k, ((k : ℝ) * ((k : ℝ) * (δT * ((k : ℝ) * (K * radius * K)) * K + K * δD * K + K * ((k : ℝ) * (K * radius * K)) * δS))) := by apply Finset.sum_le_sum intro i hi exact recovered_atom_difference_bound A B K δD δS δT hradius hK hAbasis hBbasis hAinv hBinv hD hS hT i _ = _ := by simp · apply mul_le_mul_of_nonneg_left _ (mul_nonneg (by norm_num) hradius) calc (∑ i, |spectralWeight A a c i - spectralWeight B a' c' i|) ≤ ∑ _i : Fin k, (((k : ℝ) * (δa * K + U * δS)) * ((k : ℝ) * (K * U)) + ((k : ℝ) * (U * K)) * ((k : ℝ) * (δT * U + K * δc))) := by apply Finset.sum_le_sum intro i hi exact spectral_weight_difference_bound A B a c a' c' K U δa δc δS δT hK hU hAbasis hBbasis hAinv hBinv ha ha' hc hda hdc hS hT i _ = _ := by simp; ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.QuotientFunctionalCalculus.gapFree_fixedK_envelope · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/QuotientFunctionalCalculus.lean:340
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.QuotientLaw 2 declarations Validity and bundling of the quotient latent-effect law, after the observed-margin consequences needed for its support bound are available.

Validity and bundling of the quotient latent-effect law, after the observed-margin consequences needed for its support bound are available.

theorem quotientLawRaw_valid

Quotient law raw valid: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
AtomicLaw.Valid (quotientLawRaw P (effectRadius dz L sigma0))
Proof (Lean source)
lemma quotientLawRaw_valid {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) : AtomicLaw.Valid (quotientLawRaw P (effectRadius dz L sigma0)) := by rcases hM.coreDomain with ⟨hk, hkx, hkz, hL, hpi, hpiMax, hsigma, hsigmaMax⟩ refine ⟨fun u => measureReal_nonneg, ?_, ?_⟩ · change (∑ u : Fin k, latentMass P u) = 1 rw [show (∑ u : Fin k, latentMass P u) = P.real univ by rw [show univ = ⋃ u : Fin k, latentClass (dx := dx) (dz := dz) u by ext w simp [latentClass]] symm apply measureReal_iUnion_fintype (h' := fun u => measure_ne_top P (latentClass u)) · intro u v huv unfold onFun rw [Set.disjoint_left] intro w hwu hwv exact huv (hwu.symm.trans hwv) · exact fun u => measurableSet_latentClass u] simp · intro u have hu : |latentEffect P u| ≤ effectRadius dz L sigma0 := latentEffect_abs_le_of_model P hk hkx hkz hL hpi hsigma hM u exact (abs_le.mp hu)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.quotientLawRaw_valid · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/QuotientLaw.lean:13
def quotientLaw

Quotient latent-effect probability law, supported at the derived radius; its represented measure automatically aggregates coincident effect values. @realizes νP\nu_P(valid probability law at latent effects) For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz :
L pi0 sigma0 :
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
quotientLaw P hM :
AtomicLaw.LawModulo k (effectRadius dz L sigma0)
AtomicLaw.LawModulo.ofProbabilityLaw ⟨quotientLawRaw P (effectRadius dz L sigma0), quotientLawRaw_valid P hM⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.quotientLaw · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/QuotientLaw.lean:41
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.RealDiagonalizationBridge 9 declarations Paper-local conversion of a real eigenbasis into the matrix certificate used by the collision-safe functional-calculus substrate.

Paper-local conversion of a real eigenbasis into the matrix certificate used by the collision-safe functional-calculus substrate.

theorem exists_ambient_orthonormalBasis

The orthonormal target-signal frame extends to an ambient orthonormal basis. This is the paper-local complement construction needed to add the zero eigenspace without choosing an eigengap or a basis inside any repeated signal eigenspace. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
V :
∃ (u : Finset (Euc dx)) (b : OrthonormalBasis u ℝ (Euc dx)),
conclusion 1
range (fun j : Fin k => toLp 2 (fun i => V.V i j)) ⊆ u
conclusion 2
⇑b = ((↑) : u → Euc dx)
Proof (Lean source)
-- @node: realDiagonalizationBridge_signalBasis_extension lemma SignalBasis.exists_ambient_orthonormalBasis {dx k : ℕ} (V : SignalBasis dx k) : ∃ (u : Finset (Euc dx)) (b : OrthonormalBasis u ℝ (Euc dx)), range (fun j : Fin k => toLp 2 (fun i => V.V i j)) ⊆ u ∧ ⇑b = ((↑) : u → Euc dx) := by have horth : Orthonormal ℝ (fun j : Fin k => (toLp 2 (fun i => V.V i j) : Euc dx)) := by rw [orthonormal_iff_ite] intro i j simpa only [PiLp.inner_apply, RCLike.inner_apply, conj_trivial, eq_comm, mul_comm] using V.orthonormal i j let f : Fin k → Euc dx := fun j => toLp 2 (fun i => V.V i j) have hf : Injective f := horth.linearIndependent.injective have hrange : Orthonormal ℝ ((↑) : range f → Euc dx) := by rwa [orthonormal_subtype_range hf] simpa [f] using hrange.exists_orthonormalBasis_extension
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.SignalBasis.exists_ambient_orthonormalBasis · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/RealDiagonalizationBridge.lean:13
theorem exists_fin_ambient_orthonormalBasis

The ambient orthonormal extension may be indexed by the standard ambient coordinates, with an explicit embedding recording which coordinates are the signal columns. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
V :
∃ (b : OrthonormalBasis (Fin dx) ℝ (Euc dx)) (e : Fin k ↪ Fin dx),
∀ j, b (e j) = toLp 2 (fun i => V.V i j)
Proof (Lean source)
-- @node: realDiagonalizationBridge_signalBasis_fin_extension lemma SignalBasis.exists_fin_ambient_orthonormalBasis {dx k : ℕ} (V : SignalBasis dx k) : ∃ (b : OrthonormalBasis (Fin dx) ℝ (Euc dx)) (e : Fin k ↪ Fin dx), ∀ j, b (e j) = toLp 2 (fun i => V.V i j) := by obtain ⟨u, b, hu, hb⟩ := V.exists_ambient_orthonormalBasis let f : Fin k → Euc dx := fun j => toLp 2 (fun i => V.V i j) have hforth : Orthonormal ℝ f := by rw [orthonormal_iff_ite] intro i j simpa only [f, PiLp.inner_apply, RCLike.inner_apply, conj_trivial, eq_comm, mul_comm] using V.orthonormal i j have hf : Injective f := hforth.linearIndependent.injective have hcard : card u = card (Fin dx) := by rw [← Module.finrank_eq_card_basis b.toBasis] simp let eu : u ≃ Fin dx := Fintype.equivOfCardEq hcard let e : Fin k ↪ Fin dx := ⟨fun j => eu ⟨f j, hu ⟨j, rfl⟩⟩, fun a b h => by apply hf exact congrArg val (eu.injective h)⟩ refine ⟨b.reindex eu, e, ?_⟩ intro j rw [OrthonormalBasis.reindex_apply] change b (eu.symm (eu ⟨f j, hu ⟨j, rfl⟩⟩)) = f j simp only [Equiv.symm_apply_apply] simpa [f] using congrFun hb ⟨f j, hu ⟨j, rfl⟩⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.SignalBasis.exists_fin_ambient_orthonormalBasis · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/RealDiagonalizationBridge.lean:34
def basisMatrix

The matrix whose columns are the vectors of a Euclidean basis. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
n :
b :
Basis (Fin n) ℝ (Euc n)
basisMatrix b :
fun i j => (b j).ofLp i
def basisInvMatrix

The inverse coordinate matrix of a Euclidean basis. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
n :
b :
Basis (Fin n) ℝ (Euc n)
basisInvMatrix b :
fun i j => b.repr (single j (1 : ℝ)) i
theorem basisMatrix_mul_inv

A basis matrix followed by its coordinate matrix is the identity. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
n :
b :
Basis (Fin n) ℝ (Euc n)
Proof (Lean source)
-- @node: realDiagonalizationBridge_basisMatrix_mul_inv lemma basisMatrix_mul_inv {n : ℕ} (b : Basis (Fin n) ℝ (Euc n)) : basisMatrix b * basisInvMatrix b = 1 := by ext i j have h := congrArg (fun x : Euc n => x.ofLp i) (b.sum_repr (single j (1 : ℝ))) have coord_sum (f : Fin n → Euc n) : (∑ x, f x).ofLp i = ∑ x, (f x).ofLp i := by induction (Finset.univ : Finset (Fin n)) using Finset.induction_on with | empty => simp | insert a s ha ih => simp [ha, ih] rw [coord_sum] at h change ∑ x, (b x).ofLp i * b.repr (single j (1 : ℝ)) x = _ rw [show (∑ x, (b x).ofLp i * b.repr (single j (1 : ℝ)) x) = ∑ x, b.repr (single j (1 : ℝ)) x * (b x).ofLp i by apply Finset.sum_congr rfl intro x _ ring] simpa only [WithLp.ofLp_smul, Pi.smul_apply, smul_eq_mul, PiLp.single_apply, one_mul, Matrix.one_apply] using h
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.basisMatrix_mul_inv · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/RealDiagonalizationBridge.lean:75
theorem basisInvMatrix_mul_basis

The coordinate matrix followed by its basis matrix is the identity. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
n :
b :
Basis (Fin n) ℝ (Euc n)
Proof (Lean source)
-- @node: realDiagonalizationBridge_basisInvMatrix_mul_basis lemma basisInvMatrix_mul_basis {n : ℕ} (b : Basis (Fin n) ℝ (Euc n)) : basisInvMatrix b * basisMatrix b = 1 := by ext i j let e := EuclideanSpace.basisFun (Fin n) ℝ have h0 : ∑ x, (b j).ofLp x • e x = b j := by simpa [e, EuclideanSpace.basisFun_repr] using e.sum_repr (b j) have h1 := congrArg b.repr h0 simp only [map_sum, map_smul] at h1 have h := congrArg (fun f : Fin n →₀ ℝ => f i) h1 change ∑ x, b.repr (single x (1 : ℝ)) i * (b j).ofLp x = _ rw [show b.repr (b j) = Finsupp.single j 1 from b.repr_self j] at h rw [Finsupp.single_apply] at h simpa [e, mul_comm, Matrix.one_apply, eq_comm] using h
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.basisInvMatrix_mul_basis · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/RealDiagonalizationBridge.lean:97
def realDiagonalizationOfEigenbasis

A full real eigenbasis yields the substrate's two-sided real diagonalization certificate. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
n :
A :
b :
Basis (Fin n) ℝ (Euc n)
lam :
Fin n → ℝ
heig :
∀ j, toEuclideanLin A (b j) = lam j • b j
realDiagonalizationOfEigenbasis A b lam heig :
RealDiagonalization A
by let S := basisMatrix b let T := basisInvMatrix b exact { basis := S basisInv := T eigenvalue := lam basis_mul_inv := basisMatrix_mul_inv b inv_mul_basis := basisInvMatrix_mul_basis b reconstruct := by have hAS : A * S = S * diagonal lam := by ext i j have h := congrArg (fun x : Euc n => x.ofLp i) (heig j) simpa [S, basisMatrix, Matrix.toEuclideanLin_apply, Matrix.mul_apply, mulVec, dotProduct, Matrix.diagonal_apply, mul_comm] using h calc A = A * 1 := by rw [Matrix.mul_one] _ = A * (S * T) := by rw [basisMatrix_mul_inv b] _ = (A * S) * T := by rw [Matrix.mul_assoc] _ = (S * diagonal lam) * T := by rw [hAS] }
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.realDiagonalizationOfEigenbasis · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/RealDiagonalizationBridge.lean:113
theorem realDiagonalizationOfEigenbasis_applyFunction

The functional calculus of the eigenbasis certificate is the expected conjugation formula. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
n :
A :
b :
Basis (Fin n) ℝ (Euc n)
lam :
Fin n → ℝ
heig :
∀ j, toEuclideanLin A (b j) = lam j • b j
f :
ℝ → ℝ
Proof (Lean source)
-- @node: realDiagonalizationBridge_applyFunction lemma realDiagonalizationOfEigenbasis_applyFunction {n : ℕ} (A : RectMatrix n n) (b : Basis (Fin n) ℝ (Euc n)) (lam : Fin n → ℝ) (heig : ∀ j, toEuclideanLin A (b j) = lam j • b j) (f : ℝ → ℝ) : (realDiagonalizationOfEigenbasis A b lam heig).applyFunction f = basisMatrix b * diagonal (f ∘ lam) * basisInvMatrix b := by rfl
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.realDiagonalizationOfEigenbasis_applyFunction · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/RealDiagonalizationBridge.lean:139
theorem realDiagonalizationOfEigenbasis_applyFunction_eq_of_apply_basis

A matrix agreeing with the scalar functional calculus on every vector of the eigenbasis is exactly the functional-calculus matrix. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
n :
A F :
b :
Basis (Fin n) ℝ (Euc n)
lam :
Fin n → ℝ
heig :
∀ j, toEuclideanLin A (b j) = lam j • b j
f :
ℝ → ℝ
hF :
∀ j, toEuclideanLin F (b j) = f (lam j) • b j
Proof (Lean source)
-- @node: realDiagonalizationBridge_applyFunction_eq_of_apply_basis lemma realDiagonalizationOfEigenbasis_applyFunction_eq_of_apply_basis {n : ℕ} (A F : RectMatrix n n) (b : Basis (Fin n) ℝ (Euc n)) (lam : Fin n → ℝ) (heig : ∀ j, toEuclideanLin A (b j) = lam j • b j) (f : ℝ → ℝ) (hF : ∀ j, toEuclideanLin F (b j) = f (lam j) • b j) : (realDiagonalizationOfEigenbasis A b lam heig).applyFunction f = F := by rw [realDiagonalizationOfEigenbasis_applyFunction] let S := basisMatrix b let T := basisInvMatrix b have hFS : F * S = S * diagonal (f ∘ lam) := by ext i j have h := congrArg (fun x : Euc n => x.ofLp i) (hF j) simpa [S, basisMatrix, Matrix.toEuclideanLin_apply, Matrix.mul_apply, mulVec, dotProduct, Matrix.diagonal_apply, Function.comp_apply, mul_comm] using h calc basisMatrix b * diagonal (f ∘ lam) * basisInvMatrix b = (F * S) * T := by rw [hFS] _ = F * (S * T) := by rw [Matrix.mul_assoc] _ = F := by rw [basisMatrix_mul_inv b, Matrix.mul_one]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.realDiagonalizationOfEigenbasis_applyFunction_eq_of_apply_basis · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/RealDiagonalizationBridge.lean:148
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.RepresentativeSpectralCertificate 2 declarations This file extracts from one model law a signal basis, its exact threshold rank, a real diagonalization of the compressed operator, and the two anchor-coordinate identities required by the generic collision-safe spectral

Model certificates for collision-safe representative spectra

This file extracts from one model law a signal basis, its exact threshold rank, a real diagonalization of the compressed operator, and the two anchor-coordinate identities required by the generic collision-safe spectral enumeration theorem.

structure ModelCompressedSpectralFacts

The model-generated facts needed to turn a compressed operator into collision-safe polynomial projector masses. It uses the supplied parameters.

Definition (Lean source)
k dx dz :
L pi0 sigma0 :
Q :
ModelLaw k dx dz L pi0 sigma0
basis :
spans :
basis.SpansSignal Q.summary
armwiseFullRank :
∀ t : Bool,
Injective (toEuclideanLin (observedProxyMoment Q.summary t * basis.V))
stackedRank :
thresholdRetainsExactlySignal :
∀ j, pi0 * sigma0 ^ 2 / 2 ≤ singularValue (stackedProxyMoment Q.summary) j ↔ j < k
diagonalization :
RealDiagonalization (compressedOperator Q.summary basis spans)
eigenvalue_coordinates :
diagonalization.eigenvalue = latentEffect Q.P
left_coordinates :
leftAnchor Q.summary basis
= mulVec diagonalization.basisInv.transpose (latentMass Q.P)
right_coordinates :
mulVec diagonalization.basisInv (rightAnchor basis) = fun _ => 1
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ModelCompressedSpectralFacts · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/RepresentativeSpectralCertificate.lean:18
theorem modelCompressedSpectralFacts_exists Lemma 25 in the paper ↗

Every model law supplies a compressed real diagonalization in latent-effect coordinates, together with an observable signal basis and exact threshold-rank certificates. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
Q :
ModelLaw k dx dz L pi0 sigma0
Proof (Lean source)
theorem modelCompressedSpectralFacts_exists {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (Q : ModelLaw k dx dz L pi0 sigma0) : Nonempty (ModelCompressedSpectralFacts Q) := by classical letI := Q.prob rcases Q.model.coreDomain with ⟨hk, hkx, _hkz, hL, hpi, _hpiMax, hsigma, _hsigmaMax⟩ let B := targetFeature Q.P have hBpos (r : Fin k) : 0 < (singularSystem B).sigma r := by rw [(singularSystem B).sigma_eq] exact lt_of_lt_of_le hsigma <| Q.model.proxyRankMargin.2.2.trans <| (toEuclideanLin B).singularValues_antitone <| by simpa using Nat.le_sub_one_of_lt r.isLt let F := thinSignalFactorization B hBpos let V := F.V let R : RectMatrix k k := B.transpose * V.V let Rinv : RectMatrix k k := F.coordInv.transpose let C : BoolRectMatrix dz k := fun t => referenceFeature Q.P t * latentArmWeights Q.P t have hR : R = F.coord.transpose := by calc R = B.transpose * V.V := rfl _ = (V.V * F.coord).transpose * V.V := by rw [← F.factor] _ = F.coord.transpose * (V.V.transpose * V.V) := by simp [Matrix.transpose_mul, Matrix.mul_assoc] _ = F.coord.transpose := by rw [V.transpose_mul_self, Matrix.mul_one] have hRRinv : R * Rinv = 1 := by rw [hR] simpa [Rinv, Matrix.transpose_mul] using congrArg Matrix.transpose F.inv_mul_coord have hRinvR : Rinv * R = 1 := by rw [hR] simpa [Rinv, Matrix.transpose_mul] using congrArg Matrix.transpose F.coord_mul_inv have hMfac (t : Bool) : observedProxyMoment Q.summary t * V.V = C t * R := by rw [show Q.summary = obsSummary Q.P from rfl, observedProxyMoment_factorization Q.P hk hkx hL hpi Q.model t] simp only [C, R, B, Matrix.mul_assoc] have hNfac (t : Bool) : observedOutcomeProxyMoment Q.summary t * V.V = C t * diagonal (latentMean Q.P t) * R := by rw [show Q.summary = obsSummary Q.P from rfl, observedOutcomeProxyMoment_factorization Q.P hk hpi Q.model t] simp only [C, R, B, Matrix.mul_assoc] have hMtranspose_sub (t : Bool) : range (toEuclideanLin (observedProxyMoment Q.summary t).transpose) ≤ range (toEuclideanLin V.V) := by intro x hx rcases hx with ⟨y, rfl⟩ refine ⟨Matrix.toEuclideanLin (F.coord * (C t).transpose) y, ?_⟩ apply PiLp.ext intro i rw [show (observedProxyMoment Q.summary t).transpose = V.V * (F.coord * (C t).transpose) by calc _ = (C t * B.transpose).transpose := by rw [show Q.summary = obsSummary Q.P from rfl] rw [observedProxyMoment_factorization Q.P hk hkx hL hpi Q.model t] _ = B * (C t).transpose := by simp [Matrix.transpose_mul] _ = (V.V * F.coord) * (C t).transpose := by rw [← F.factor] _ = _ := by simp [Matrix.mul_assoc]] simp [Matrix.toEuclideanLin_apply, Matrix.mulVec_mulVec] have hVrank : finrank ℝ (range (toEuclideanLin V.V)) = k := by change finrank ℝ (range (signalBasisLinearIsometry V).toLinearMap) = k rw [(signalBasisLinearIsometry V).toLinearMap.finrank_range_of_inj (signalBasisLinearIsometry V).injective, finrank_euclideanSpace] simp have hM0rank : finrank ℝ (range (toEuclideanLin (observedProxyMoment Q.summary false).transpose)) = k := by have hadj : toEuclideanLin (observedProxyMoment Q.summary false).transpose = (toEuclideanLin (observedProxyMoment Q.summary false)).adjoint := by rw [← Matrix.toEuclideanLin_conjTranspose_eq_adjoint] rfl rw [hadj] rw [(toEuclideanLin (observedProxyMoment Q.summary false)).finrank_range_adjoint] have hfac := observedProxyMoment_factorization Q.P hk hkx hL hpi Q.model false have hmargin := observedProxyMoment_minSingular_of_factorization Q.P hk hpi hsigma Q.model false hfac have hpos : 0 < singularValue (observedProxyMoment Q.summary false) (k - 1) := by rw [show Q.summary = obsSummary Q.P from rfl] exact (mul_pos hpi (sq_pos_of_pos hsigma)).trans_le hmargin have hlower := (toEuclideanLin (observedProxyMoment Q.summary false)).singularValues_pos_iff_lt_finrank_range.mp hpos have hupper : finrank ℝ (range (toEuclideanLin (observedProxyMoment Q.summary false))) ≤ k := by rw [← (toEuclideanLin (observedProxyMoment Q.summary false)).finrank_range_adjoint] rw [← show toEuclideanLin (observedProxyMoment Q.summary false).transpose = (toEuclideanLin (observedProxyMoment Q.summary false)).adjoint by rw [← Matrix.toEuclideanLin_conjTranspose_eq_adjoint] rfl] exact (Submodule.finrank_mono (hMtranspose_sub false)).trans_eq hVrank omega have hspans : V.SpansSignal Q.summary := by unfold SignalBasis.SpansSignal signalRowspace have hM0eq : range (toEuclideanLin (observedProxyMoment Q.summary false).transpose) = range (toEuclideanLin V.V) := by apply Submodule.eq_of_le_of_finrank_le (hMtranspose_sub false) rw [hVrank, hM0rank] apply le_antisymm · rw [← hM0eq] exact le_sup_left · apply sup_le (hMtranspose_sub false) (hMtranspose_sub true) have hAinj (t : Bool) : Injective (toEuclideanLin (observedProxyMoment Q.summary t * V.V)) := by have hm := observedProxyMoment_compression_margin Q.P hk hkx hL hpi hsigma Q.model t V hspans apply publishedMomentIdentity_injective_of_signalMinSingular_pos exact (mul_pos hpi (sq_pos_of_pos hsigma)).trans_le hm.2 have hterm (t : Bool) : penroseInverse (observedProxyMoment Q.summary t * V.V) * (observedOutcomeProxyMoment Q.summary t * V.V) = Rinv * diagonal (latentMean Q.P t) * R := by have hNrewrite : observedOutcomeProxyMoment Q.summary t * V.V = (observedProxyMoment Q.summary t * V.V) * (Rinv * diagonal (latentMean Q.P t) * R) := by rw [hMfac t, hNfac t] simp only [Matrix.mul_assoc] rw [← Matrix.mul_assoc R Rinv, hRRinv, Matrix.one_mul] rw [hNrewrite, ← Matrix.mul_assoc, publishedMomentIdentity_penrose_left_inverse_of_injective _ (hAinj t), Matrix.one_mul] have hD : compressedOperator Q.summary V hspans = Rinv * diagonal (latentEffect Q.P) * R := by unfold compressedOperator change genuinePenroseInverse (observedProxyMoment Q.summary true * V.V) * (observedOutcomeProxyMoment Q.summary true * V.V) - genuinePenroseInverse (observedProxyMoment Q.summary false * V.V) * (observedOutcomeProxyMoment Q.summary false * V.V) = _ rw [genuinePenroseInverse_eq_penroseInverse_of_injective _ (hAinj true), genuinePenroseInverse_eq_penroseInverse_of_injective _ (hAinj false), hterm true, hterm false, ← Matrix.sub_mul, ← Matrix.mul_sub] congr 2 ext a b by_cases hab : a = b <;> simp [Matrix.diagonal_apply, hab, latentEffect] let D : RealDiagonalization (compressedOperator Q.summary V hspans) := { basis := Rinv basisInv := R eigenvalue := latentEffect Q.P basis_mul_inv := hRinvR inv_mul_basis := hRRinv reconstruct := hD } have hmX : Q.summary.mX = mulVec B (latentMass Q.P) := publishedMomentIdentity_obsSummary_mX_factorization Q.P hpi Q.model have hanchor : mulVec B.transpose (firstBasis dx) = fun _ => 1 := publishedMomentIdentity_targetFeature_transpose_firstBasis Q.P hk hkx hpi Q.model have hleft : leftAnchor Q.summary V = mulVec R.transpose (latentMass Q.P) := by have hleftAnchor : leftAnchor Q.summary V = mulVec V.V.transpose Q.summary.mX := by funext a simp [leftAnchor, mulVec, dotProduct, mul_comm] have hRt : R.transpose = V.V.transpose * B := by simp [R, Matrix.transpose_mul] rw [hleftAnchor, hmX, Matrix.mulVec_mulVec, hRt] have hright : mulVec R (rightAnchor V) = fun _ => 1 := by have hproj : V.V * V.V.transpose * B = B := by calc V.V * V.V.transpose * B = V.V * (V.V.transpose * B) := by simp only [Matrix.mul_assoc] _ = V.V * (V.V.transpose * (V.V * F.coord)) := by rw [← F.factor] _ = V.V * ((V.V.transpose * V.V) * F.coord) := by simp only [Matrix.mul_assoc] _ = V.V * F.coord := by rw [V.transpose_mul_self, Matrix.one_mul] _ = B := F.factor.symm have hBt : B.transpose = R * V.V.transpose := by have ht := congrArg Matrix.transpose hproj simpa [R, Matrix.transpose_mul, Matrix.mul_assoc] using ht.symm change mulVec R (mulVec V.V.transpose (firstBasis dx)) = _ rw [Matrix.mulVec_mulVec, ← hBt, hanchor] have hstackLower : pi0 * sigma0 ^ 2 ≤ singularValue (stackedProxyMoment Q.summary) (k - 1) := by rw [show Q.summary = obsSummary Q.P from rfl] exact stackedProxyMoment_minSingular Q.P hk hkx hL hpi hsigma Q.model have hstackRank : finrank ℝ (range (toEuclideanLin (stackedProxyMoment Q.summary))) = k := by have hlower : k ≤ finrank ℝ (range (toEuclideanLin (stackedProxyMoment Q.summary))) := by have hp : 0 < singularValue (stackedProxyMoment Q.summary) (k - 1) := (mul_pos hpi (sq_pos_of_pos hsigma)).trans_le hstackLower have := (toEuclideanLin (stackedProxyMoment Q.summary)).singularValues_pos_iff_lt_finrank_range.mp hp omega have hupper : finrank ℝ (range (toEuclideanLin (stackedProxyMoment Q.summary))) ≤ k := by let Cstack : RectMatrix (2 * dz) k := fun i u => if hi : i.val < dz then C false ⟨i.val, hi⟩ u else C true ⟨i.val - dz, by omega⟩ u have hstackFac : stackedProxyMoment Q.summary = Cstack * B.transpose := by ext i j by_cases hi : i.val < dz · have hfac := congrArg (fun M : RectMatrix dz dx => M ⟨i.val, hi⟩ j) (observedProxyMoment_factorization Q.P hk hkx hL hpi Q.model false) rw [show Q.summary = obsSummary Q.P from rfl] unfold stackedProxyMoment rw [dif_pos hi] rw [Matrix.mul_apply] have hc (u : Fin k) : Cstack i u = C false ⟨i.val, hi⟩ u := by simp [Cstack, hi] simp_rw [hc] change (obsSummary Q.P).M0 ⟨i.val, hi⟩ j = (C false * B.transpose) ⟨i.val, hi⟩ j at hfac rw [Matrix.mul_apply] at hfac exact hfac · have hfac := congrArg (fun M : RectMatrix dz dx => M ⟨i.val - dz, by omega⟩ j) (observedProxyMoment_factorization Q.P hk hkx hL hpi Q.model true) rw [show Q.summary = obsSummary Q.P from rfl] unfold stackedProxyMoment rw [dif_neg hi] rw [Matrix.mul_apply] have hc (u : Fin k) : Cstack i u = C true ⟨i.val - dz, by omega⟩ u := by simp [Cstack, hi] simp_rw [hc] change (obsSummary Q.P).M1 ⟨i.val - dz, by omega⟩ j = (C true * B.transpose) ⟨i.val - dz, by omega⟩ j at hfac rw [Matrix.mul_apply] at hfac exact hfac have hrange : range (toEuclideanLin (stackedProxyMoment Q.summary)) ≤ range (toEuclideanLin Cstack) := by intro x hx rcases hx with ⟨y, rfl⟩ refine ⟨Matrix.toEuclideanLin B.transpose y, ?_⟩ rw [hstackFac] apply PiLp.ext intro i simp [Matrix.toEuclideanLin_apply, Matrix.mulVec_mulVec] exact (Submodule.finrank_mono hrange).trans <| (toEuclideanLin Cstack).finrank_range_le.trans (by simp) omega have hthreshold (j : ℕ) : pi0 * sigma0 ^ 2 / 2 ≤ singularValue (stackedProxyMoment Q.summary) j ↔ j < k := by constructor · intro hj by_contra hjk have hk_le : k ≤ j := by omega have hz := (toEuclideanLin (stackedProxyMoment Q.summary)).singularValues_eq_zero_iff_le_finrank_range (n := j) |>.mpr (by rw [hstackRank]; exact hk_le) have htpos : 0 < pi0 * sigma0 ^ 2 / 2 := by positivity change pi0 * sigma0 ^ 2 / 2 ≤ (toEuclideanLin (stackedProxyMoment Q.summary)).singularValues j at hj rw [hz] at hj -- … truncated; follow the source link for the rest …
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.modelCompressedSpectralFacts_exists · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/RepresentativeSpectralCertificate.lean:36
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.Risk 12 declarations Decision rules and finite-sample risks used in upper and lower bounds.

Decision rules and finite-sample risks used in upper and lower bounds.

For the supplied parameters, Law Estimator is the stated data structure.

Definition (Lean source)
k dx dz n :
radius :
eval :
(Fin n → Obs dx dz) → AtomicLaw.LawModulo k radius
@realizes \(\widetilde\nu_n\)(generic law estimator)
measurable :
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.LawEstimator · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Risk.lean:12

Probability-simplex constraint for labelled weight vectors. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k :
p :
Fin k → ℝ
InSimplex p :
Prop
clause 1
i :
0 ≤ p i
clause 2
∑ i, p i = 1
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.InSimplex · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Risk.lean:18

For the supplied parameters, Weight Estimator is the stated data structure.

Definition (Lean source)
k dx dz n :
eval :
(Fin n → Obs dx dz) → (Fin k → ℝ)
measurable :
simplex :
∀ sample, InSimplex (eval sample)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.WeightEstimator · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Risk.lean:22
theorem orderedMasses_measurable

Ordered masses are a Borel function of the labelled atomic coordinates. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
Proof (Lean source)
-- @node: orderedMasses_measurable lemma orderedMasses_measurable {k : ℕ} {radius : ℝ} : Measurable (@orderedMasses k radius) := by have hcoord : Measurable (fun ν : AtomicLaw k radius => (ν.weight, ν.atom)) := comap_measurable _ have hw (i : Fin k) : Measurable (fun ν : AtomicLaw k radius => ν.weight i) := (measurable_pi_apply i).comp measurable_fst |>.comp hcoord have ha (i : Fin k) : Measurable (fun ν : AtomicLaw k radius => ν.atom i) := (measurable_pi_apply i).comp measurable_snd |>.comp hcoord unfold orderedMasses apply Measurable.ite · apply MeasurableSet.inter · change MeasurableSet ({a : AtomicLaw k radius | ∀ i, 0 < a.weight i} : Set _) rw [show ({a : AtomicLaw k radius | ∀ i, 0 < a.weight i} : Set _) = ⋂ i, {a | 0 < a.weight i} by ext; simp] exact MeasurableSet.iInter fun i => measurableSet_lt measurable_const (hw i) · change MeasurableSet {ν : AtomicLaw k radius | ∀ i j, ν.atom i = ν.atom j → i = j} rw [show {ν : AtomicLaw k radius | ∀ i j, ν.atom i = ν.atom j → i = j} = ⋂ i, ⋂ j, {ν | i = j ∨ ν.atom i ≠ ν.atom j} by ext ν simp only [Set.mem_setOf_eq, Set.mem_iInter] constructor · intro h i j by_cases hij : i = j · exact inl hij · exact inr fun he => hij (h i j he) · intro h i j he rcases h i j with hij | hne · exact hij · exact elim (hne he)] exact MeasurableSet.iInter fun i => MeasurableSet.iInter fun j => MeasurableSet.union (MeasurableSet.const _) <| (measurableSet_eq_fun (ha i) (ha j)).compl · apply measurable_pi_lambda intro j apply measurable_sum intro i hi apply Measurable.ite · rw [show {ν : AtomicLaw k radius | (Finset.univ.filter fun l => ν.atom l < ν.atom i).card = j.val} = ⋃ s : Finset (Fin k), if s.card = j.val then (⋂ l ∈ s, {ν | ν.atom l < ν.atom i}) ∩ (⋂ l ∉ s, {ν | ¬ ν.atom l < ν.atom i}) else ∅ by ext ν simp only [Set.mem_setOf_eq, Set.mem_iUnion, Set.mem_ite_empty_right, Set.mem_inter_iff, Set.mem_iInter] constructor · intro h refine ⟨Finset.univ.filter fun l => ν.atom l < ν.atom i, h, ?_, ?_⟩ · intro l hl; exact (Finset.mem_filter.mp hl).2 · intro l hl hlt exact hl (Finset.mem_filter.mpr ⟨Finset.mem_univ _, hlt⟩) · rintro ⟨s, hs, hin, hout⟩ have heq : Finset.univ.filter (fun l => ν.atom l < ν.atom i) = s := by ext l simp only [mem_filter, Finset.mem_univ, true_and] constructor · intro hl by_contra hls exact hout l hls hl · exact hin l rw [heq, hs]] apply MeasurableSet.iUnion intro s split_ifs · apply MeasurableSet.inter · exact MeasurableSet.iInter fun l => MeasurableSet.iInter fun _ => measurableSet_lt (ha l) (ha i) · exact MeasurableSet.iInter fun l => MeasurableSet.iInter fun _ => (measurableSet_lt (ha l) (ha i)).compl · exact MeasurableSet.empty · exact hw i · fun_prop · fun_prop
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.orderedMasses_measurable · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Risk.lean:28
theorem orderedMasses_inSimplex

Ordered masses of a valid nonempty atomic law form a probability-simplex vector. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
hk :
0 < k
ν :
AtomicLaw k radius
:
AtomicLaw.Valid ν
InSimplex (orderedMasses ν)
Proof (Lean source)
-- @node: orderedMasses_inSimplex lemma orderedMasses_inSimplex {k : ℕ} {radius : ℝ} (hk : 0 < k) (ν : AtomicLaw k radius) (hν : AtomicLaw.Valid ν) : InSimplex (orderedMasses ν) := by classical unfold InSimplex orderedMasses split_ifs with h · constructor · intro j exact sum_nonneg fun i _ => by split_ifs · exact hν.1 i · exact le_rfl · rw [Finset.sum_comm] calc (∑ i : Fin k, ∑ j : Fin k, if (Finset.univ.filter fun l => ν.atom l < ν.atom i).card = j.val then ν.weight i else 0) = ∑ i : Fin k, ν.weight i := by apply Finset.sum_congr rfl intro i hi let r := (Finset.univ.filter fun l => ν.atom l < ν.atom i).card have hsub : (Finset.univ.filter fun l => ν.atom l < ν.atom i) ⊂ (Finset.univ : Finset (Fin k)) := by apply Finset.ssubset_iff_subset_ne.mpr refine ⟨Finset.filter_subset _ _, ?_⟩ intro heq have hi' : i ∈ Finset.univ.filter (fun l => ν.atom l < ν.atom i) := by rw [heq] exact Finset.mem_univ i exact (lt_irrefl _) (Finset.mem_filter.mp hi').2 have hr : r < k := by calc r < (Finset.univ : Finset (Fin k)).card := Finset.card_lt_card hsub _ = k := by simp change (∑ j : Fin k, if r = j.val then ν.weight i else 0) = ν.weight i calc _ = (if r = (⟨r, hr⟩ : Fin k).val then ν.weight i else 0) := Finset.sum_eq_single (⟨r, hr⟩ : Fin k) (fun b _ hne => by rw [if_neg] exact fun he => hne (Fin.ext he.symm)) (by simp) _ = ν.weight i := by simp _ = 1 := hν.2.1 · constructor · intro i exact inv_nonneg.mpr (Nat.cast_nonneg k) · rw [Finset.sum_const, Finset.card_univ] simp [nsmul_eq_mul, Nat.cast_ne_zero.mpr (Nat.ne_of_gt hk)]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.orderedMasses_inSimplex · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Risk.lean:105
theorem simplex_l1_le_two

The ℓ¹ diameter of the probability simplex is two. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
Fin k → ℝ
hp :
InSimplex p
hq :
InSimplex q
∑ i, |p i - q i| ≤ 2
Proof (Lean source)
-- @node: simplex_l1_le_two lemma simplex_l1_le_two {k : ℕ} {p q : Fin k → ℝ} (hp : InSimplex p) (hq : InSimplex q) : ∑ i, |p i - q i| ≤ 2 := by calc ∑ i, |p i - q i| ≤ ∑ i, (p i + q i) := by apply Finset.sum_le_sum intro i hi rw [abs_le] exact ⟨by linarith [hp.1 i, hq.1 i], by linarith [hp.1 i, hq.1 i]⟩ _ = 2 := by rw [Finset.sum_add_distrib, hp.2, hq.2]; norm_num
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.simplex_l1_le_two · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Risk.lean:154

For the supplied parameters, expected Law Risk is given by its defining clause.

Definition (Lean source)
k dx dz n :
L pi0 sigma0 :
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
est :
LawEstimator k dx dz n (effectRadius dz L sigma0)
expectedLawRisk P hM est :
∫ sample, AtomicLaw.LawModulo.wass1 (est.eval sample) (quotientLaw P hM) ∂sampleLaw (n := n) P
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.expectedLawRisk · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Risk.lean:166

For the supplied parameters, expected Weight Risk is given by its defining clause.

Definition (Lean source)
k dx dz n :
target :
Fin k → ℝ
est :
WeightEstimator k dx dz n
expectedWeightRisk P target est :
∫ sample, ∑ i, |est.eval sample i - target i| ∂sampleLaw (n := n) P
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.expectedWeightRisk · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Risk.lean:175
def expectedOrderedWeightRisk

Risk of the specified ordered-mass estimator derived from the common repaired law estimator. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz n :
L pi0 sigma0 :
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
R :
SummaryRepairData k dx dz n L pi0 sigma0
expectedOrderedWeightRisk P hM R :
∫ sample, ∑ i, |orderedWeightEstimator R sample i
- orderedMasses (quotientLaw P hM).representative.1 i| ∂sampleLaw (n := n) P
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.expectedOrderedWeightRisk · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Risk.lean:182
theorem lawModulo_wass1_nonneg

One-Wasserstein loss between two bundled finite probability laws is nonnegative. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
ν ξ :
AtomicLaw.LawModulo k radius
0 ≤ AtomicLaw.LawModulo.wass1 ν ξ
Proof (Lean source)
lemma lawModulo_wass1_nonneg {k : ℕ} {radius : ℝ} (ν ξ : AtomicLaw.LawModulo k radius) : 0 ≤ AtomicLaw.LawModulo.wass1 ν ξ := by obtain ⟨γ, hγ⟩ := AtomicLaw.wass1_optimal_plan ν.representative.2 ξ.representative.2 unfold AtomicLaw.LawModulo.wass1 rw [← hγ] unfold AtomicLaw.transportCost exact sum_nonneg fun i _ => sum_nonneg fun j _ => mul_nonneg (γ.nonneg i j) (abs_nonneg _)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.lawModulo_wass1_nonneg · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Risk.lean:192
theorem integral_le_of_gaussian_tail Lemma integral_le_of_gaussian_tail in the paper ↗

Integrating a Gaussian upper-tail envelope gives the corresponding mean bound. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
Ω :
Z :
Ω → ℝ
hZnn :
∀ ω, 0 ≤ Z ω
A b q :
hA :
0 ≤ A
hb :
0 < b
hq :
0 < q
htail :
∀ t : ℝ
if
b < t
then
μ.real {ω | t < Z ω} ≤ A * exp (-q * t ^ 2)
∫ ω, Z ω ∂μ ≤ b + A * sqrt (pi / q) / 2
Proof (Lean source)
-- @node: integral_le_of_gaussian_tail lemma integral_le_of_gaussian_tail {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (Z : Ω → ℝ) (hZnn : ∀ ω, 0 ≤ Z ω) (A b q : ℝ) (hA : 0 ≤ A) (hb : 0 < b) (hq : 0 < q) (htail : ∀ t : ℝ, b < t → μ.real {ω | t < Z ω} ≤ A * exp (-q * t ^ 2)) : ∫ ω, Z ω ∂μ ≤ b + A * sqrt (pi / q) / 2 := by by_cases hZi : Integrable Z μ · rw [hZi.integral_eq_integral_meas_lt (Eventually.of_forall hZnn)] let f : ℝ → ℝ := fun t => μ.real {ω | t < Z ω} let g : ℝ → ℝ := fun t => (Ioc 0 b).indicator (fun _ => 1) t + A * exp (-q * t ^ 2) have hf_meas : Measurable f := by exact Measurable.ennreal_toReal (Antitone.measurable (fun _ _ hst => measure_mono (fun _ h => lt_of_le_of_lt hst h))) have hIocfinite : volume (Ioc 0 b) ≠ ∞ := by rw [Real.volume_Ioc] finiteness have h1_int : IntegrableOn ((Ioc 0 b).indicator (fun _ : ℝ => (1 : ℝ))) (Ioi 0) := ((integrableOn_const hIocfinite).integrable_indicator measurableSet_Ioc).integrableOn have h2_int : IntegrableOn (fun t : ℝ => A * exp (-q * t ^ 2)) (Ioi 0) := (Integrable.const_mul (integrable_exp_neg_mul_sq hq) A).integrableOn have hg_int : IntegrableOn g (Ioi 0) := h1_int.add h2_int have hfg : ∀ t ∈ Ioi (0 : ℝ), f t ≤ g t := by intro t ht by_cases htb : t ≤ b · have hprob : f t ≤ 1 := measureReal_le_one rw [show g t = 1 + A * exp (-q * t ^ 2) by simp [g, Set.mem_Ioc.mpr ⟨ht, htb⟩]] exact hprob.trans (le_add_of_nonneg_right (mul_nonneg hA (Real.exp_pos _).le)) · have htail' := htail t (lt_of_not_ge htb) rw [show g t = A * exp (-q * t ^ 2) by simp [g, show t ∉ Ioc 0 b by intro ht'; exact htb ht'.2]] exact htail' have hf_int : IntegrableOn f (Ioi 0) := by exact hg_int.mono' (hf_meas.aestronglyMeasurable.restrict) ((ae_restrict_iff' measurableSet_Ioi).2 (Eventually.of_forall fun t ht => by rw [Real.norm_eq_abs, abs_of_nonneg (measureReal_nonneg : 0 ≤ f t)] exact hfg t ht)) change ∫ t in Ioi 0, f t ≤ b + A * sqrt (pi / q) / 2 calc ∫ t in Ioi 0, f t ≤ ∫ t in Ioi 0, g t := setIntegral_mono_on hf_int hg_int measurableSet_Ioi hfg _ = b + A * sqrt (pi / q) / 2 := by unfold g rw [integral_add h1_int h2_int] rw [setIntegral_indicator measurableSet_Ioc] rw [Set.inter_eq_right.mpr Set.Ioc_subset_Ioi_self] rw [integral_const, measureReal_restrict_apply_univ, Measure.real_def, Real.volume_Ioc, ENNReal.toReal_ofReal (by positivity), sub_zero, smul_eq_mul, mul_one] rw [integral_const_mul] rw [integral_gaussian_Ioi] ring · rw [integral_undef hZi] have hpq : 0 < pi / q := div_pos Real.pi_pos hq positivity
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.integral_le_of_gaussian_tail · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Risk.lean:204
theorem integral_le_of_sqrt_log_tail Lemma integral_le_of_sqrt_log_tail in the paper ↗

A square-root logarithmic deviation inequality, uniform over confidence levels, implies a root-sample-size mean bound. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
Ω :
Z :
Ω → ℝ
hZnn :
∀ ω, 0 ≤ Z ω
A :
n :
hA :
2 ≤ A
hn :
1 ≤ n
htail :
∀ eta : ℝ
if
0 < eta
and
eta < 1 / 2
then
μ.real {ω | A * sqrt (log (A / eta) / n) < Z ω} ≤ eta
∫ ω, Z ω ∂μ
≤ (A * sqrt (log (2 * A)) + A ^ 2 * sqrt pi / 2) / sqrt n
Proof (Lean source)
-- @node: integral_le_of_sqrt_log_tail lemma integral_le_of_sqrt_log_tail {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (Z : Ω → ℝ) (hZnn : ∀ ω, 0 ≤ Z ω) (A : ℝ) (n : ℕ) (hA : 2 ≤ A) (hn : 1 ≤ n) (htail : ∀ eta : ℝ, 0 < eta → eta < 1 / 2 → μ.real {ω | A * sqrt (log (A / eta) / n) < Z ω} ≤ eta) : ∫ ω, Z ω ∂μ ≤ (A * sqrt (log (2 * A)) + A ^ 2 * sqrt pi / 2) / sqrt n := by have hApos : 0 < A := lt_of_lt_of_le (by norm_num) hA have hnpos : (0 : ℝ) < n := Nat.cast_pos.mpr (lt_of_lt_of_le Nat.zero_lt_one hn) have hlogpos : 0 < log (2 * A) := Real.log_pos (by nlinarith) let b := A * sqrt (log (2 * A) / n) let q := (n : ℝ) / A ^ 2 have hb : 0 < b := mul_pos hApos (Real.sqrt_pos.2 (div_pos hlogpos hnpos)) have hq : 0 < q := div_pos hnpos (sq_pos_of_pos hApos) have hgauss : ∀ t : ℝ, b < t → μ.real {ω | t < Z ω} ≤ A * exp (-q * t ^ 2) := by intro t ht let eta := A * exp (-q * t ^ 2) have htpos : 0 < t := hb.trans ht have hbaseSq : b ^ 2 < t ^ 2 := (sq_lt_sq₀ hb.le htpos.le).2 ht have hinside : 0 ≤ log (2 * A) / (n : ℝ) := (div_pos hlogpos hnpos).le have hbSq : b ^ 2 = A ^ 2 * (log (2 * A) / (n : ℝ)) := by simp only [b, mul_pow, Real.sq_sqrt hinside] have hrel : q * (A ^ 2 * (log (2 * A) / (n : ℝ))) = log (2 * A) := by dsimp [q] field_simp have hqt : log (2 * A) < q * t ^ 2 := by rw [← hrel, ← hbSq] exact mul_lt_mul_of_pos_left hbaseSq hq have hetaPos : 0 < eta := mul_pos hApos (Real.exp_pos _) have hetaHalf : eta < 1 / 2 := by have he := Real.exp_lt_exp.mpr (neg_lt_neg hqt) rw [Real.exp_neg] at he rw [Real.exp_neg, Real.exp_log (by positivity : 0 < 2 * A)] at he have he' : exp (-q * t ^ 2) < (2 * A)⁻¹ := by simpa [Real.exp_neg] using he dsimp [eta] calc A * exp (-q * t ^ 2) < A * (2 * A)⁻¹ := mul_lt_mul_of_pos_left he' hApos _ = 1 / 2 := by field_simp have hthreshold : A * sqrt (log (A / eta) / n) = t := by have hratio : A / eta = exp (q * t ^ 2) := by dsimp [eta] rw [div_mul_eq_div_mul_one_div, div_self hApos.ne', one_mul] have hexp : exp (-q * t ^ 2) = (exp (q * t ^ 2))⁻¹ := by rw [show -q * t ^ 2 = -(q * t ^ 2) by ring, Real.exp_neg] rw [hexp, one_div, inv_inv] rw [hratio, Real.log_exp] have harg : q * t ^ 2 / (n : ℝ) = (t / A) ^ 2 := by dsimp [q] field_simp rw [harg, Real.sqrt_sq_eq_abs, abs_of_pos (div_pos htpos hApos)] field_simp calc μ.real {ω | t < Z ω} = μ.real {ω | A * sqrt (log (A / eta) / n) < Z ω} := by rw [hthreshold] _ ≤ eta := htail eta hetaPos hetaHalf _ = A * exp (-q * t ^ 2) := rfl have hmean := integral_le_of_gaussian_tail μ Z hZnn A b q hApos.le hb hq hgauss have hsqrtq : sqrt (pi / q) = A * sqrt pi / sqrt n := by rw [Real.sqrt_div Real.pi_pos.le] have hsqrtq' : sqrt q = sqrt n / A := by dsimp [q] rw [Real.sqrt_div (Nat.cast_nonneg n), Real.sqrt_sq_eq_abs, abs_of_pos hApos] rw [hsqrtq'] field_simp rw [hsqrtq] at hmean dsimp [b] at hmean calc ∫ ω, Z ω ∂μ ≤ A * sqrt (log (2 * A) / n) + A * (A * sqrt pi / sqrt n) / 2 := hmean _ = (A * sqrt (log (2 * A)) + A ^ 2 * sqrt pi / 2) / sqrt n := by rw [Real.sqrt_div (by positivity)] field_simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.integral_le_of_sqrt_log_tail · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Risk.lean:264
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.SpectralSubstrate 16 declarations Rectangular finite-dimensional spectral helpers used by the proxy-effect-law construction.

Rectangular finite-dimensional spectral helpers used by the proxy-effect-law construction.

def Euc

For a dimension, the Euclidean coordinate space is the real Euclidean space indexed by its d coordinates.

Definition (Lean source)
d :
Euc d :
Type

For numbers of rows and columns, the rectangular matrix space is the space of real matrices of that size.

Definition (Lean source)
rows cols :
RectMatrix rows cols :
Type
Matrix (Fin rows) (Fin cols) ℝ

For the supplied parameters, matrix CLM is given by its defining clause.

Definition (Lean source)
rows cols :
A :
RectMatrix rows cols
matrixCLM A :
Euc cols →L[ℝ] Euc rows
theorem matrixCLM_continuous

As a matrix varies, the associated continuous linear map varies continuously.

Formal statement
rows cols :
Continuous (@matrixCLM rows cols)
Proof (Lean source)
-- @node: matrixCLM_continuous @[fun_prop] lemma matrixCLM_continuous {rows cols : ℕ} : Continuous (@matrixCLM rows cols) := by let f : RectMatrix rows cols →ₗ[ℝ] (Euc cols →L[ℝ] Euc rows) := { toFun := matrixCLM map_add' := by intro A B ext x i simp [matrixCLM, Matrix.toEuclideanLin_apply] map_smul' := by intro c A ext x i simp [matrixCLM, Matrix.toEuclideanLin_apply] } exact f.continuous_of_finiteDimensional
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.matrixCLM_continuous · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SpectralSubstrate.lean:24

The singular value with zero-based index j. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
rows cols :
A :
RectMatrix rows cols
j :
singularValue A j :
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.singularValue · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SpectralSubstrate.lean:40
def signalMinSingular

The last signal singular value for a rows × k matrix. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
rows k :
A :
RectMatrix rows k
signalMinSingular A :
singularValue A (k - 1)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.signalMinSingular · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SpectralSubstrate.lean:44
def penroseInverse

Moore--Penrose formula for a full-column-rank rectangular matrix. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
rows cols :
A :
RectMatrix rows cols
penroseInverse A :
RectMatrix cols rows
((A.transpose * A)⁻¹) * A.transpose
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.penroseInverse · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SpectralSubstrate.lean:48

A genuine real thin singular-value decomposition. Besides reconstruction, the right singular vectors are orthonormal and every retained positive singular direction satisfies both singular-vector equations; these conditions prevent the thresholded inverse from using an arbitrary rank-one reconstruction. It uses the supplied parameters.

Definition (Lean source)
rows cols :
A :
RectMatrix rows cols
sigma :
Fin cols → ℝ
left :
Fin cols → Fin rows → ℝ
right :
Fin cols → Fin cols → ℝ
sigma_eq :
∀ j, sigma j = singularValue A j
sigma_nonneg :
∀ j, 0 ≤ sigma j
right_orthonormal :
∀ r s, ∑ i, right r i * right s i = if r = s then 1 else 0
left_orthonormal_of_pos :
∀ r s
if
0 < sigma r
and
0 < sigma s
then
∑ i, left r i * left s i = if r = s then 1 else 0
apply_right :
∀ r i, ∑ j, A i j * right r j = sigma r * left r i
apply_left_transpose :
∀ r j, ∑ i, A i j * left r i = sigma r * right r j
expansion :
∀ i j, A i j = ∑ r, sigma r * left r i * right r j
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.SingularSystem · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SpectralSubstrate.lean:53
theorem singularSystem_exists

Singular system exists: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols :
A :
RectMatrix rows cols
Nonempty (SingularSystem A)
Proof (Lean source)
lemma singularSystem_exists {rows cols : ℕ} (A : RectMatrix rows cols) : Nonempty (SingularSystem A) := by let T : Euc cols →ₗ[ℝ] Euc rows := Matrix.toEuclideanLin A let S : Euc cols →ₗ[ℝ] Euc cols := LinearMap.adjoint T ∘ₗ T have hS : S.IsSymmetric := T.isSymmetric_adjoint_comp_self let b : OrthonormalBasis (Fin cols) ℝ (Euc cols) := hS.eigenvectorBasis (by simp) let sigma : Fin cols → ℝ := fun r => T.singularValues r let right : Fin cols → Fin cols → ℝ := fun r => b r let left : Fin cols → Euc rows := fun r => if sigma r = 0 then 0 else (sigma r)⁻¹ • T (b r) have heigen (r : Fin cols) : S (b r) = (sigma r) ^ 2 • b r := by rw [hS.apply_eigenvectorBasis (by simp)] rw [T.sq_singularValues_fin (by simp) r] rfl have happly (r : Fin cols) : T (b r) = sigma r • left r := by by_cases hr : sigma r = 0 · have hrker : T (b r) = 0 := by rw [← @inner_self_eq_zero ℝ] rw [← LinearMap.adjoint_inner_right] change inner ℝ (b r) (S (b r)) = 0 rw [heigen, hr] simp simp [left, hr, hrker] · ext i simp [left, hr] have hadjoint (r : Fin cols) : LinearMap.adjoint T (left r) = sigma r • b r := by by_cases hr : sigma r = 0 · simp [left, hr] · rw [show left r = (sigma r)⁻¹ • T (b r) by simp [left, hr]] rw [LinearMap.map_smul, ← LinearMap.comp_apply] change (sigma r)⁻¹ • S (b r) = _ rw [heigen] rw [smul_smul] congr 1 field_simp refine ⟨{ sigma := sigma left := fun r i => left r i right := right sigma_eq := fun _ => rfl sigma_nonneg := fun r => T.singularValues_nonneg r right_orthonormal := ?_ left_orthonormal_of_pos := ?_ apply_right := ?_ apply_left_transpose := ?_ expansion := ?_ }⟩ · intro r s by_cases hrs : r = s · subst s rw [if_pos rfl] have hinner : inner ℝ (b r) (b r) = 1 := by rw [real_inner_self_eq_norm_sq, b.orthonormal.1 r] norm_num simpa only [right, PiLp.inner_apply, RCLike.inner_apply, conj_trivial] using hinner · rw [if_neg hrs] have horth := b.orthonormal.2 hrs calc ∑ i, right r i * right s i = ∑ i, right s i * right r i := by apply Finset.sum_congr rfl intro i _ exact mul_comm _ _ _ = 0 := by simpa only [right, PiLp.inner_apply, RCLike.inner_apply, conj_trivial] using horth · intro r s hr hs have hr0 : sigma r ≠ 0 := ne_of_gt hr have hs0 : sigma s ≠ 0 := ne_of_gt hs have hinner : inner ℝ (left r) (left s) = if r = s then 1 else 0 := by rw [show left r = (sigma r)⁻¹ • T (b r) by simp [left, hr0], show left s = (sigma s)⁻¹ • T (b s) by simp [left, hs0]] rw [inner_smul_left, inner_smul_right] rw [← LinearMap.adjoint_inner_left] rw [show LinearMap.adjoint T (T (b r)) = S (b r) by rfl] simp only [map_inv₀, RCLike.conj_to_real] rw [heigen, inner_smul_left] simp only [map_pow, RCLike.conj_to_real] by_cases hrs : r = s · subst s rw [if_pos rfl, real_inner_self_eq_norm_sq, b.orthonormal.1 r] field_simp · rw [if_neg hrs, b.orthonormal.2 hrs] ring calc ∑ i, (left r).ofLp i * (left s).ofLp i = ∑ i, (left s).ofLp i * (left r).ofLp i := by apply Finset.sum_congr rfl intro i _ exact mul_comm _ _ _ = if r = s then 1 else 0 := by simpa only [PiLp.inner_apply, RCLike.inner_apply, conj_trivial] using hinner · intro r i simpa [right, Matrix.toEuclideanLin_apply, mulVec, dotProduct, T] using congrArg (fun x : Euc rows => x.ofLp i) (happly r) · intro r j have h := congrArg (fun x : Euc cols => x.ofLp j) (hadjoint r) rw [← Matrix.toEuclideanLin_conjTranspose_eq_adjoint] at h simpa [right, Matrix.toEuclideanLin_apply, mulVec, dotProduct, T, Matrix.conjTranspose_apply, Matrix.transpose_apply] using h · intro i j have hb := b.sum_repr' (single j (1 : ℝ)) have hTb := congrArg T hb have hj (r : Fin cols) : inner ℝ (b r) (single j (1 : ℝ)) = b r j := by simp [PiLp.inner_apply] have hi : (T (single j (1 : ℝ))) i = A i j := by simp [T, Matrix.toEuclideanLin_apply] simp_rw [map_sum, map_smul] at hTb calc A i j = (T (single j (1 : ℝ))).ofLp i := hi.symm _ = (∑ r, inner ℝ (b r) (single j (1 : ℝ)) • T (b r)).ofLp i := congrArg (fun x : Euc rows => x.ofLp i) hTb.symm _ = ∑ r, sigma r * left r i * right r j := by have coord_sum (f : Fin cols → Euc rows) : (∑ r, f r).ofLp i = ∑ r, (f r).ofLp i := by induction (Finset.univ : Finset (Fin cols)) using Finset.induction_on with | empty => simp | insert a s ha ih => simp [ha, ih] rw [coord_sum] apply Finset.sum_congr rfl intro r _ rw [hj, happly] simp only [right, smul_smul, WithLp.ofLp_smul, Pi.smul_apply, smul_eq_mul] ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.singularSystem_exists · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SpectralSubstrate.lean:71
def singularSystem

A fixed real SVD of a rectangular matrix. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
rows cols :
A :
RectMatrix rows cols
singularSystem A :
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.singularSystem · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SpectralSubstrate.lean:194
def thresholdedPenroseInverse

The genuine SVD-thresholded Moore--Penrose inverse sum_{sigma_j >= threshold} sigma_j^{-1} v_j u_j^T. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
rows cols :
threshold :
A :
RectMatrix rows cols
thresholdedPenroseInverse threshold A :
RectMatrix cols rows
fun i j
=> ∑ r : Fin cols, if threshold ≤ (singularSystem A).sigma r then ((singularSystem A).sigma r)⁻¹ * (singularSystem A).right r i * (singularSystem A).left r j else 0
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.thresholdedPenroseInverse · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SpectralSubstrate.lean:198
def genuinePenroseInverse

The Moore--Penrose inverse of an arbitrary real rectangular matrix. This local spelling delegates to the paper-independent substrate construction, which satisfies all four Penrose equations without a rank assumption. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
rows cols :
A :
RectMatrix rows cols
genuinePenroseInverse A :
RectMatrix cols rows
CausalSmith.Substrate.CollisionSafeSpectralLaw.moorePenroseInverse A
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.genuinePenroseInverse · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SpectralSubstrate.lean:208
theorem singular_value_variational_lower

Singular value variational lower: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols :
A :
RectMatrix rows cols
x :
Euc cols
signalMinSingular A * ‖x‖ ≤ ‖Matrix.toEuclideanLin A x‖
Proof (Lean source)
lemma singular_value_variational_lower {rows cols : ℕ} (A : RectMatrix rows cols) (hA : Injective (Matrix.toEuclideanLin A)) (x : Euc cols) : signalMinSingular A * ‖x‖ ≤ ‖Matrix.toEuclideanLin A x‖ := by let T : Euc cols →ₗ[ℝ] Euc rows := Matrix.toEuclideanLin A by_cases hc : cols = 0 · subst cols change T.singularValues 0 * ‖x‖ ≤ ‖T x‖ rw [T.singularValues_of_finrank_le (by simp)] simp have hcpos : 0 < cols := Nat.pos_of_ne_zero hc let S : Euc cols →ₗ[ℝ] Euc cols := LinearMap.adjoint T ∘ₗ T have hS : S.IsSymmetric := T.isSymmetric_adjoint_comp_self let b : OrthonormalBasis (Fin cols) ℝ (Euc cols) := hS.eigenvectorBasis (by simp) have hmin : ∀ i : Fin cols, (T.singularValues (cols - 1)) ^ 2 ≤ hS.eigenvalues (by simp) i := by intro i rw [T.sq_singularValues_of_lt (by simp) (sub_lt hcpos Nat.zero_lt_one)] exact hS.eigenvalues_antitone (by simp) (Nat.le_sub_one_of_lt i.isLt) have hquad : ‖T x‖ ^ 2 = ∑ i : Fin cols, hS.eigenvalues (by simp) i * (inner ℝ (b i) x) ^ 2 := by rw [← real_inner_self_eq_norm_sq] rw [← LinearMap.adjoint_inner_right] change inner ℝ x (S x) = _ rw [← b.sum_inner_mul_inner x (S x)] apply Finset.sum_congr rfl intro i hi have heig := hS.eigenvectorBasis_apply_self_apply (by simp) x i have heig' : inner ℝ (b i) (S x) = hS.eigenvalues (by simp) i * inner ℝ (b i) x := by simpa [b, OrthonormalBasis.repr_apply_apply, RCLike.ofReal] using heig rw [heig', real_inner_comm] ring have hsq : (T.singularValues (cols - 1) * ‖x‖) ^ 2 ≤ ‖T x‖ ^ 2 := by rw [hquad, mul_pow, ← b.sum_sq_inner_right x, Finset.mul_sum] exact Finset.sum_le_sum fun i _ => mul_le_mul_of_nonneg_right (hmin i) (sq_nonneg _) exact (sq_le_sq₀ (mul_nonneg (T.singularValues_nonneg _) (norm_nonneg _)) (norm_nonneg _)).mp hsq
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.singular_value_variational_lower · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SpectralSubstrate.lean:217
theorem singular_value_weyl

Singular value weyl: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols j :
A H :
RectMatrix rows cols
|singularValue (A + H) j - singularValue A j| ≤ ‖matrixCLM H‖
Proof (Lean source)
lemma singular_value_weyl {rows cols j : ℕ} (A H : RectMatrix rows cols) : |singularValue (A + H) j - singularValue A j| ≤ ‖matrixCLM H‖ := by have hadd : toEuclideanLin (A + H) = toEuclideanLin A + toEuclideanLin H := by ext x i simp [Matrix.toEuclideanLin_apply] simpa only [singularValue, hadd, matrixCLM] using abs_singularValues_add_sub_singularValues_le_opNorm (toEuclideanLin A) (toEuclideanLin H) j
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.singular_value_weyl · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SpectralSubstrate.lean:258
theorem genuinePenroseInverse_eq_penroseInverse_of_injective

On the full-column-rank domain, the canonical Moore--Penrose inverse agrees with the Gram formula used by the perturbation and moment-identity proofs. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols :
A :
RectMatrix rows cols
Proof (Lean source)
-- @node: genuinePenroseInverse_eq_penroseInverse_of_injective lemma genuinePenroseInverse_eq_penroseInverse_of_injective {rows cols : ℕ} (A : RectMatrix rows cols) (hA : Injective (toEuclideanLin A)) : genuinePenroseInverse A = penroseInverse A := by let hunit := gram_det_isUnit_of_injective A hA letI := Matrix.invertibleOfIsUnitDet (A.transpose * A) hunit have hleft : penroseInverse A * A = 1 := penrose_left_inverse A hunit have hgram_symm : (A.transpose * A).transpose = A.transpose * A := by rw [Matrix.transpose_mul, Matrix.transpose_transpose] have hinv_symm : ((A.transpose * A)⁻¹).transpose = (A.transpose * A)⁻¹ := by rw [Matrix.transpose_nonsing_inv, hgram_symm] have hproj_symm : (A * penroseInverse A).transpose = A * penroseInverse A := by simp only [penroseInverse, Matrix.transpose_mul, Matrix.transpose_transpose, hinv_symm] rw [Matrix.mul_assoc] apply CausalSmith.Substrate.CollisionSafeSpectralLaw.isMoorePenroseInverse_unique (CausalSmith.Substrate.CollisionSafeSpectralLaw.moorePenroseInverse_spec A) refine ⟨?_, ?_, hproj_symm, ?_⟩ · rw [Matrix.mul_assoc, hleft, Matrix.mul_one] · rw [hleft, Matrix.one_mul] · rw [hleft, Matrix.transpose_one]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.genuinePenroseInverse_eq_penroseInverse_of_injective · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SpectralSubstrate.lean:319
theorem penrose_perturbation

Penrose perturbation: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols :
s₀ :
A B :
RectMatrix rows cols
hA :
hB :
hs :
0 < s₀
‖matrixCLM (penroseInverse A - penroseInverse B)‖ ≤ 3 * s₀⁻¹ ^ 2 * ‖matrixCLM (A - B)‖
Proof (Lean source)
lemma penrose_perturbation {rows cols : ℕ} {s₀ : ℝ} (A B : RectMatrix rows cols) (hA : s₀ ≤ signalMinSingular A) (hB : s₀ ≤ signalMinSingular B) (hs : 0 < s₀) : ‖matrixCLM (penroseInverse A - penroseInverse B)‖ ≤ 3 * s₀⁻¹ ^ 2 * ‖matrixCLM (A - B)‖ := by have hApos : 0 < signalMinSingular A := hs.trans_le hA have hBpos : 0 < signalMinSingular B := hs.trans_le hB have hAi := signalMinSingular_pos_injective A hApos have hBi := signalMinSingular_pos_injective B hBpos have hAlower (x : Euc cols) : s₀ * ‖x‖ ≤ ‖Matrix.toEuclideanLin A x‖ := (mul_le_mul_of_nonneg_right hA (norm_nonneg x)).trans (singular_value_variational_lower A hAi x) have hBlower (x : Euc cols) : s₀ * ‖x‖ ≤ ‖Matrix.toEuclideanLin B x‖ := (mul_le_mul_of_nonneg_right hB (norm_nonneg x)).trans (singular_value_variational_lower B hBi x) have hAu := gram_det_isUnit_of_injective A hAi have hBu := gram_det_isUnit_of_injective B hBi letI := Matrix.invertibleOfIsUnitDet (A.transpose * A) hAu letI := Matrix.invertibleOfIsUnitDet (B.transpose * B) hBu have hPA := penrose_norm_le A hs hAlower have hPB := penrose_norm_le B hs hBlower have hGA := gram_inverse_norm_le A hs hAlower have hresB : ‖matrixCLM (1 - B * penroseInverse B)‖ ≤ 1 := by apply ContinuousLinearMap.opNorm_le_bound _ zero_le_one intro y simpa using (penrose_projection_contracts B hBu y).2 have hnormalB : B.transpose * (1 - B * penroseInverse B) = 0 := by simp only [Matrix.mul_sub, Matrix.mul_one, penroseInverse] rw [← Matrix.mul_assoc B.transpose B, ← Matrix.mul_assoc (B.transpose * B), Matrix.mul_inv_of_invertible, Matrix.one_mul, sub_self] have hid : penroseInverse A - penroseInverse B = penroseInverse A * (B - A) * penroseInverse B + (A.transpose * A)⁻¹ * (A - B).transpose * (1 - B * penroseInverse B) := by have hleftA := penrose_left_inverse A hAu have hzero : (A.transpose * A)⁻¹ * B.transpose * (1 - B * penroseInverse B) = 0 := by rw [Matrix.mul_assoc, hnormalB, Matrix.mul_zero] have hdiff : (A.transpose * A)⁻¹ * (A.transpose - B.transpose) = (A.transpose * A)⁻¹ * A.transpose - (A.transpose * A)⁻¹ * B.transpose := Matrix.mul_sub _ _ _ rw [Matrix.transpose_sub, Matrix.mul_sub] symm rw [Matrix.sub_mul, hdiff, Matrix.sub_mul] rw [hleftA, Matrix.one_mul] rw [show (A.transpose * A)⁻¹ * A.transpose = penroseInverse A by rfl] rw [hzero, sub_zero, Matrix.mul_sub, Matrix.mul_one, Matrix.mul_assoc (penroseInverse A) B] abel open scoped Matrix.Norms.L2Operator in change ‖penroseInverse A - penroseInverse B‖ ≤ 3 * s₀⁻¹ ^ 2 * ‖A - B‖ rw [hid] change ‖penroseInverse A‖ ≤ s₀⁻¹ at hPA change ‖penroseInverse B‖ ≤ s₀⁻¹ at hPB change ‖(A.transpose * A)⁻¹‖ ≤ s₀⁻¹ ^ 2 at hGA change ‖1 - B * penroseInverse B‖ ≤ 1 at hresB have ht1 : ‖penroseInverse A * (B - A) * penroseInverse B‖ ≤ (s₀⁻¹ * ‖A - B‖) * s₀⁻¹ := by calc _ ≤ ‖penroseInverse A * (B - A)‖ * ‖penroseInverse B‖ := Matrix.l2_opNorm_mul _ _ _ ≤ (‖penroseInverse A‖ * ‖B - A‖) * ‖penroseInverse B‖ := by gcongr exact Matrix.l2_opNorm_mul _ _ _ ≤ (s₀⁻¹ * ‖A - B‖) * s₀⁻¹ := by rw [norm_sub_rev B A] gcongr have ht2 : ‖(A.transpose * A)⁻¹ * (A - B).transpose * (1 - B * penroseInverse B)‖ ≤ (s₀⁻¹ ^ 2 * ‖A - B‖) * 1 := by calc _ ≤ ‖(A.transpose * A)⁻¹ * (A - B).transpose‖ * ‖1 - B * penroseInverse B‖ := Matrix.l2_opNorm_mul _ _ _ ≤ (‖(A.transpose * A)⁻¹‖ * ‖(A - B).transpose‖) * ‖1 - B * penroseInverse B‖ := by gcongr exact Matrix.l2_opNorm_mul _ _ _ ≤ (s₀⁻¹ ^ 2 * ‖A - B‖) * 1 := by have htrans : ‖(A - B).transpose‖ = ‖A - B‖ := by rw [← Matrix.conjTranspose_eq_transpose_of_trivial, Matrix.l2_opNorm_conjTranspose] rw [htrans] gcongr calc ‖penroseInverse A * (B - A) * penroseInverse B + (A.transpose * A)⁻¹ * (A - B).transpose * (1 - B * penroseInverse B)‖ ≤ ‖penroseInverse A * (B - A) * penroseInverse B‖ + ‖(A.transpose * A)⁻¹ * (A - B).transpose * (1 - B * penroseInverse B)‖ := norm_add_le _ _ _ ≤ (s₀⁻¹ * ‖A - B‖) * s₀⁻¹ + (s₀⁻¹ ^ 2 * ‖A - B‖) * 1 := add_le_add ht1 ht2 _ ≤ 3 * s₀⁻¹ ^ 2 * ‖A - B‖ := by have hi : 0 ≤ s₀⁻¹ := inv_nonneg.mpr hs.le have hn : 0 ≤ ‖A - B‖ := norm_nonneg _ nlinarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.penrose_perturbation · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SpectralSubstrate.lean:443
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.StructuredLatticeAnalysis 7 declarations This module collects the paper-local numerical and model consequences used by the explicit structured-lattice estimator.

Quantitative facts for the paper's structured lattice

This module collects the paper-local numerical and model consequences used by the explicit structured-lattice estimator. It is intentionally separate from the reusable collision-safe spectral substrate: the lattice height and its constants belong to this paper's construction.

theorem prescribedLatticeConstant_pos

The displayed lattice constant is strictly positive throughout the core parameter domain. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
_hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hsigma :
0 < sigma0
0 < prescribedLatticeConstant k dx dz L pi0 sigma0
Proof (Lean source)
lemma prescribedLatticeConstant_pos (k dx dz : ℕ) (L pi0 sigma0 : ℝ) (hk : 2 ≤ k) (_hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hsigma : 0 < sigma0) : 0 < prescribedLatticeConstant k dx dz L pi0 sigma0 := by unfold prescribedLatticeConstant effectRadius apply lt_of_lt_of_le (b := 8 * (4 * L * sqrt dz / sigma0) / (pi0 * sigma0 ^ 2)) · have hdz : 0 < dz := lt_of_lt_of_le (by omega : 0 < k) hkz positivity · exact le_max_left _ _
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.prescribedLatticeConstant_pos · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeAnalysis.lean:16
theorem inverseGramSqrt_spec

The prescribed inverse-Gram square root has the two defining square-root properties. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx :
G :
hG :
1 / 2 ≤ signalMinSingular G
conclusion 1
conclusion 2
inverseGramSqrt G hG * inverseGramSqrt G hG = (G.transpose * G)⁻¹
Proof (Lean source)
lemma inverseGramSqrt_spec {k dx : ℕ} (G : RectMatrix dx k) (hG : 1 / 2 ≤ signalMinSingular G) : (inverseGramSqrt G hG).PosSemidefinverseGramSqrt G hG * inverseGramSqrt G hG = (G.transpose * G)⁻¹ := Classical.choose_spec (inverseGramSqrt_exists G hG)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.inverseGramSqrt_spec · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeAnalysis.lean:29
theorem prescribedPolarFactor_transpose_mul_self

The prescribed polar factor has orthonormal columns whenever its asserted singular margin is positive. This is the algebraic fact used for every rounded grid basis. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx :
G :
hG :
1 / 2 ≤ signalMinSingular G
Proof (Lean source)
lemma prescribedPolarFactor_transpose_mul_self {k dx : ℕ} (G : RectMatrix dx k) (hG : 1 / 2 ≤ signalMinSingular G) : (prescribedPolarFactor G hG).transpose * prescribedPolarFactor G hG = 1 := by let H := inverseGramSqrt G hG let gram := G.transpose * G have hpos : 0 < signalMinSingular G := lt_of_lt_of_le (by norm_num) hG have hinj := publishedMomentIdentity_injective_of_signalMinSingular_pos G hpos have hdet : IsUnit gram.det := by exact publishedMomentIdentity_gram_det_isUnit_of_injective G hinj have hHpsd : H.PosSemidef := (inverseGramSqrt_spec G hG).1 have hHsq : H * H = gram⁻¹ := (inverseGramSqrt_spec G hG).2 have hgram_inv : gram * gram⁻¹ = 1 := Matrix.mul_nonsing_inv gram hdet have hinv_gram : gram⁻¹ * gram = 1 := Matrix.nonsing_inv_mul gram hdet have hleft : (gram * H) * H = 1 := by rw [Matrix.mul_assoc, hHsq, hgram_inv] have hright : H * (H * gram) = 1 := by rw [← Matrix.mul_assoc, hHsq, hinv_gram] have hcomm : gram * H = H * gram := by calc gram * H = (gram * H) * 1 := by rw [Matrix.mul_one] _ = (gram * H) * (H * (H * gram)) := by rw [hright] _ = ((gram * H) * H) * (H * gram) := by simp only [Matrix.mul_assoc] _ = H * gram := by rw [hleft, Matrix.one_mul] have hmiddle : H * gram * H = 1 := by calc H * gram * H = H * (gram * H) := by rw [Matrix.mul_assoc] _ = H * (H * gram) := by rw [hcomm] _ = (H * H) * gram := by rw [Matrix.mul_assoc] _ = gram⁻¹ * gram := by rw [hHsq] _ = 1 := hinv_gram have hHt : H.transpose = H := by have hh := hHpsd.isHermitian.eq simpa [Matrix.conjTranspose_eq_transpose_of_trivial] using hh unfold prescribedPolarFactor rw [Matrix.transpose_mul, Matrix.mul_assoc, hHt] simpa only [gram, Matrix.mul_assoc] using hmiddle
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.prescribedPolarFactor_transpose_mul_self · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeAnalysis.lean:36
theorem model_thresholdRecoversDimension

At every model-generated summary, thresholding at half the population margin retains exactly the k signal singular values. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
ThresholdRecoversDimension k (pi0 * sigma0 ^ 2 / 2) (obsSummary P)
Proof (Lean source)
lemma model_thresholdRecoversDimension {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) : ThresholdRecoversDimension k (pi0 * sigma0 ^ 2 / 2) (obsSummary P) := by let Q : ModelLaw k dx dz L pi0 sigma0 := ⟨P, inferInstance, hM⟩ obtain ⟨facts⟩ := modelCompressedSpectralFacts_exists Q constructor · intro j hj exact (facts.thresholdRetainsExactlySignal j).2 hj · intro j hj have hnot : ¬j < k := Nat.not_lt.mpr hj exact lt_of_not_ge (fun h => hnot ((facts.thresholdRetainsExactlySignal j).1 h))
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.model_thresholdRecoversDimension · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeAnalysis.lean:75
theorem stackedProxyMoment_sub_norm_le

The operator norm of a perturbation of the vertically stacked proxy block is bounded by the two proxy-block terms already present in the summary metric. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx dz :
s q :
‖matrixCLM (stackedProxyMoment s - stackedProxyMoment q)‖
≤ ‖matrixCLM (s.M0 - q.M0)‖ + ‖matrixCLM (s.M1 - q.M1)‖
Proof (Lean source)
lemma stackedProxyMoment_sub_norm_le {dx dz : ℕ} (s q : SummarySpace dx dz) : ‖matrixCLM (stackedProxyMoment s - stackedProxyMoment q)‖ ≤ ‖matrixCLM (s.M0 - q.M0)‖ + ‖matrixCLM (s.M1 - q.M1)‖ := by let H := stackedProxyMoment s - stackedProxyMoment q let A0 := s.M0 - q.M0 let A1 := s.M1 - q.M1 apply ContinuousLinearMap.opNorm_le_bound _ (add_nonneg (norm_nonneg _) (norm_nonneg _)) intro x have hsplit : (∑ i : Fin (2 * dz), ((toEuclideanLin H x) i) ^ 2) = (∑ i : Fin dz, ((toEuclideanLin A0 x) i) ^ 2) + ∑ i : Fin dz, ((toEuclideanLin A1 x) i) ^ 2 := by let e : (Fin dz ⊕ Fin dz) ≃ Fin (2 * dz) := finSumFinEquiv.trans (finCongr (two_mul dz).symm) rw [← Equiv.sum_comp e, Fintype.sum_sum_type] congr 1 · apply Finset.sum_congr rfl intro i _ congr 1 have hi : e (inl i) = ⟨i.val, by omega⟩ := by apply Fin.ext simp [e] rw [hi] simp only [H, A0, Matrix.toEuclideanLin_apply, mulVec, Matrix.sub_apply, stackedProxyMoment] apply Finset.sum_congr rfl intro j _ simp [i.isLt] · apply Finset.sum_congr rfl intro i _ congr 1 have hi : e (inr i) = ⟨i.val + dz, by omega⟩ := by apply Fin.ext simp [e] rw [hi] simp only [H, A1, Matrix.toEuclideanLin_apply, mulVec, Matrix.sub_apply, stackedProxyMoment] apply Finset.sum_congr rfl intro j _ simp let a : ℝ := ∑ i : Fin dz, ((toEuclideanLin A0 x) i) ^ 2 let b : ℝ := ∑ i : Fin dz, ((toEuclideanLin A1 x) i) ^ 2 have ha : 0 ≤ a := sum_nonneg fun _ _ => sq_nonneg _ have hb : 0 ≤ b := sum_nonneg fun _ _ => sq_nonneg _ have hsqrt : sqrt (a + b) ≤ sqrt a + sqrt b := by apply (sq_le_sq₀ (Real.sqrt_nonneg _) (add_nonneg (Real.sqrt_nonneg _) (Real.sqrt_nonneg _))).mp rw [Real.sq_sqrt (add_nonneg ha hb), add_sq, Real.sq_sqrt ha, Real.sq_sqrt hb] nlinarith [mul_nonneg (Real.sqrt_nonneg a) (Real.sqrt_nonneg b)] calc ‖Matrix.toEuclideanLin H x‖ = sqrt (a + b) := by rw [EuclideanSpace.norm_eq] simp only [Real.norm_eq_abs, sq_abs] rw [hsplit] _ ≤ sqrt a + sqrt b := hsqrt _ = ‖Matrix.toEuclideanLin A0 x‖ + ‖Matrix.toEuclideanLin A1 x‖ := by rw [EuclideanSpace.norm_eq, EuclideanSpace.norm_eq] simp only [Real.norm_eq_abs, sq_abs] rfl _ ≤ ‖A0‖ * ‖x‖ + ‖A1‖ * ‖x‖ := add_le_add (Matrix.l2_opNorm_mulVec A0 x) (Matrix.l2_opNorm_mulVec A1 x) _ = (‖matrixCLM (s.M0 - q.M0)‖ + ‖matrixCLM (s.M1 - q.M1)‖) * ‖x‖ := by have h0 : ‖A0‖ = ‖matrixCLM (s.M0 - q.M0)‖ := by rfl have h1 : ‖A1‖ = ‖matrixCLM (s.M1 - q.M1)‖ := by rfl rw [h0, h1] ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.stackedProxyMoment_sub_norm_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeAnalysis.lean:91
theorem stackedProxyMoment_sub_norm_le_dS

The stacked proxy perturbation is controlled without an extra dimension factor by the summary metric used in the theorem. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx dz :
s q :
‖matrixCLM (stackedProxyMoment s - stackedProxyMoment q)‖ ≤ dS s q
Proof (Lean source)
lemma stackedProxyMoment_sub_norm_le_dS {dx dz : ℕ} (s q : SummarySpace dx dz) : ‖matrixCLM (stackedProxyMoment s - stackedProxyMoment q)‖ ≤ dS s q := by calc _ ≤ ‖matrixCLM (s.M0 - q.M0)‖ + ‖matrixCLM (s.M1 - q.M1)‖ := stackedProxyMoment_sub_norm_le s q _ ≤ dS s q := by unfold dS have hN0 : 0 ≤ ‖matrixCLM (s.N0 - q.N0)‖ := norm_nonneg _ have hN1 : 0 ≤ ‖matrixCLM (s.N1 - q.N1)‖ := norm_nonneg _ have hm : 0 ≤ sqrt (∑ i, (s.mX i - q.mX i) ^ 2) := Real.sqrt_nonneg _ linarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.stackedProxyMoment_sub_norm_le_dS · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeAnalysis.lean:159
theorem model_thresholdRecoversDimension_of_dS_lt

Any summary lying strictly inside half the population singular margin has exactly the same thresholded signal dimension. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
s :
hs :
dS s (obsSummary P) < pi0 * sigma0 ^ 2 / 2
ThresholdRecoversDimension k (pi0 * sigma0 ^ 2 / 2) s
Proof (Lean source)
lemma model_thresholdRecoversDimension_of_dS_lt {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (s : SummarySpace dx dz) (hs : dS s (obsSummary P) < pi0 * sigma0 ^ 2 / 2) : ThresholdRecoversDimension k (pi0 * sigma0 ^ 2 / 2) s := by rcases hM.coreDomain with ⟨hk, hkx, _hkz, hL, hpi, _hpiMax, hsigma, _hsigmaMax⟩ let Q : ModelLaw k dx dz L pi0 sigma0 := ⟨P, inferInstance, hM⟩ obtain ⟨facts⟩ := modelCompressedSpectralFacts_exists Q let threshold := pi0 * sigma0 ^ 2 / 2 have htpos : 0 < threshold := by dsimp [threshold] positivity have hpert : ∀ j, |singularValue (stackedProxyMoment s) j - singularValue (stackedProxyMoment Q.summary) j| < threshold := by intro j have hadd : stackedProxyMoment Q.summary + (stackedProxyMoment s - stackedProxyMoment Q.summary) = stackedProxyMoment s := by abel have hw := singular_value_weyl (j := j) (stackedProxyMoment Q.summary) (stackedProxyMoment s - stackedProxyMoment Q.summary) rw [hadd] at hw exact lt_of_le_of_lt hw <| lt_of_le_of_lt (stackedProxyMoment_sub_norm_le_dS s Q.summary) hs constructor · intro j hj have hjle := (toEuclideanLin (stackedProxyMoment Q.summary)).singularValues_antitone (Nat.le_sub_one_of_lt hj) have hlower : pi0 * sigma0 ^ 2 ≤ singularValue (stackedProxyMoment Q.summary) j := by exact (stackedProxyMoment_minSingular P hk hkx hL hpi hsigma hM).trans hjle have hp := hpert j rw [abs_lt] at hp dsimp [threshold] at hp ⊢ linarith · intro j hj have hz : singularValue (stackedProxyMoment Q.summary) j = 0 := by exact (toEuclideanLin (stackedProxyMoment Q.summary)).singularValues_eq_zero_iff_le_finrank_range.mpr <| by rw [facts.stackedRank] exact hj have hp := hpert j rw [hz, sub_zero, abs_lt] at hp exact hp.2
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.model_thresholdRecoversDimension_of_dS_lt · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeAnalysis.lean:173
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.StructuredLatticeCardinality 2 declarations Polynomial cardinality of the structured lattice

Polynomial cardinality of the structured lattice

theorem prescribed_candidateCount_polynomial_bound

For fixed structural parameters, the exact encoder (and hence every prescribed duplicate-free search) has the paper's n^(D/2) cardinality, where D = dx*k+k^2+2*k-1. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
_hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
_hpi :
0 < pi0
_hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hsigma :
0 < sigma0
_hsigmaMax :
sigma0 ≤ 1
∃ C : ℝ,
0 < C
conclusion 1
n :
1 ≤ n
A :
LatticeEstimator k dx dz n (effectRadius dz L sigma0)
IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A
(A.candidateCount : ℝ) ≤ C * rpow (n : ℝ) ((dx * k + k ^ 2 + 2 * k - 1 : ℝ) / 2)
Proof (Lean source)
theorem prescribed_candidateCount_polynomial_bound (k dx dz : ℕ) (L pi0 sigma0 : ℝ) (hk : 2 ≤ k) (_hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (_hpi : 0 < pi0) (_hpiMax : pi0 ≤ 1 / (2 * k : ℝ)) (hsigma : 0 < sigma0) (_hsigmaMax : sigma0 ≤ 1) : ∃ C : ℝ, 0 < C ∧ ∀ n : ℕ, 1 ≤ n → ∀ A : LatticeEstimator k dx dz n (effectRadius dz L sigma0), IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A → (A.candidateCount : ℝ) ≤ C * rpow (n : ℝ) ((dx * k + k ^ 2 + 2 * k - 1 : ℝ) / 2) := by let cH : ℝ := 2 + (⌈pi0⁻¹⌉₊ + 2 * k + ⌈4 * sqrt (dx * k)⌉₊ + ⌈2 * k / sigma0⌉₊ : ℕ) let cR : ℝ := 2 * effectRadius dz L sigma0 + 3 let cM : ℝ := 4 * sqrt k * L + 3 let D : ℕ := dx * k + k ^ 2 + 2 * k - 1 let C : ℝ := 5 ^ (dx * k) * cM ^ (k ^ 2) * 2 ^ (k - 1) * cR ^ k * cH ^ D have hdz : 0 < dz := lt_of_lt_of_le (by omega : 0 < k) hkz have hcH : 0 < cH := by dsimp [cH]; positivity have hcR : 0 < cR := by dsimp [cR, effectRadius] positivity have hcM : 0 < cM := by dsimp [cM] positivity have hC : 0 < C := by dsimp [C]; positivity refine ⟨C, hC, ?_⟩ intro n hn A hA let H := latticeHeight k dx n pi0 sigma0 have hH : 1 ≤ H := by dsimp [H, latticeHeight] omega have hcode := isPrescribedStructuredLattice_candidateCount_le_code A hA have hgrid := boundedLatticeInt_card_cast_le H 1 hH (by norm_num) have hcoord := boundedLatticeInt_card_cast_le H (2 * sqrt k * L) hH (by positivity) have heffect := boundedLatticeInt_card_cast_le H (effectRadius dz L sigma0) hH (by dsimp [effectRadius] positivity) have hmass : ((H + 1 : ℕ) : ℝ) ≤ 2 * H := by exact_mod_cast (by omega : H + 1 ≤ 2 * H) have hmass' : (H : ℝ) + 1 ≤ 2 * H := by simpa using hmass have hcodeReal : (card (StructuredLatticeCode k dx H L sigma0 (effectRadius dz L sigma0)) : ℝ) ≤ 5 ^ (dx * k) * cM ^ (k ^ 2) * 2 ^ (k - 1) * cR ^ k * H ^ D := by rw [structuredLatticeCode_card] push_cast have hD : dx * k + k ^ 2 + (k - 1) + k = dx * k + k ^ 2 + 2 * k - 1 := by omega have hgpow : (card (BoundedLatticeInt H 1) : ℝ) ^ (dx * k) ≤ (5 * H) ^ (dx * k) := by gcongr calc (card (BoundedLatticeInt H 1) : ℝ) ≤ (2 * 1 + 3) * H := hgrid _ = 5 * H := by ring have hcpow : (card (BoundedLatticeInt H (2 * sqrt k * L)) : ℝ) ^ (k ^ 2) ≤ (cM * H) ^ (k ^ 2) := by gcongr calc (card (BoundedLatticeInt H (2 * sqrt k * L)) : ℝ) ≤ (2 * (2 * sqrt k * L) + 3) * H := hcoord _ = cM * H := by simp only [cM]; ring have hmpow : ((H + 1 : ℕ) : ℝ) ^ (k - 1) ≤ (2 * H) ^ (k - 1) := by gcongr have hepow : (card (BoundedLatticeInt H (effectRadius dz L sigma0)) : ℝ) ^ k ≤ (cR * H) ^ k := by gcongr calc (card (BoundedLatticeInt H 1) : ℝ) ^ (dx * k) * (card (BoundedLatticeInt H (2 * sqrt k * L)) : ℝ) ^ (k ^ 2) * ((H : ℝ) + 1) ^ (k - 1) * (card (BoundedLatticeInt H (effectRadius dz L sigma0)) : ℝ) ^ k ≤ (5 * H) ^ (dx * k) * (cM * H) ^ (k ^ 2) * (2 * H) ^ (k - 1) * (cR * H) ^ k := by gcongr _ = 5 ^ (dx * k) * cM ^ (k ^ 2) * 2 ^ (k - 1) * cR ^ k * H ^ D := by rw [mul_pow, mul_pow, mul_pow, mul_pow] rw [show D = dx * k + k ^ 2 + (k - 1) + k by omega, pow_add, pow_add, pow_add] ring have hHeight : (H : ℝ) ≤ cH * sqrt n := by exact latticeHeight_cast_le_sqrt k dx n pi0 sigma0 hn have hpow : (H : ℝ) ^ D ≤ cH ^ D * sqrt n ^ D := by calc (H : ℝ) ^ D ≤ (cH * sqrt n) ^ D := by gcongr _ = cH ^ D * sqrt n ^ D := mul_pow _ _ _ have hDform : D = dx * k + k ^ 2 + 2 * k - 1 := rfl have hExp : (D : ℝ) / 2 = (dx * k + k ^ 2 + 2 * k - 1 : ℝ) / 2 := by dsimp [D] rw [Nat.cast_sub (by omega : 1 ≤ dx * k + k ^ 2 + 2 * k)] push_cast ring calc (A.candidateCount : ℝ) ≤ (card (StructuredLatticeCode k dx H L sigma0 (effectRadius dz L sigma0)) : ℝ) := by exact_mod_cast hcode _ ≤ 5 ^ (dx * k) * cM ^ (k ^ 2) * 2 ^ (k - 1) * cR ^ k * H ^ D := hcodeReal _ ≤ 5 ^ (dx * k) * cM ^ (k ^ 2) * 2 ^ (k - 1) * cR ^ k * (cH ^ D * sqrt n ^ D) := by gcongr _ = C * rpow (n : ℝ) ((dx * k + k ^ 2 + 2 * k - 1 : ℝ) / 2) := by rw [sqrt_pow_eq_rpow_half n D hn, hExp] simp only [C] ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.prescribed_candidateCount_polynomial_bound · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeCardinality.lean:62
theorem prescribed_latticeOperationCount_polynomial_bound

The charged exhaustive-search runtime obeys the matching polynomial bound. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hsigma :
0 < sigma0
hsigmaMax :
sigma0 ≤ 1
∃ C : ℝ,
0 < C
conclusion 1
n :
1 ≤ n
A :
LatticeEstimator k dx dz n (effectRadius dz L sigma0)
IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A
(A.candidateCount : ℝ) ≤ C * rpow (n : ℝ) ((dx * k + k ^ 2 + 2 * k - 1 : ℝ) / 2)
(latticeOperationCount A : ℝ)
≤ C * (n + rpow (n : ℝ) ((dx * k + k ^ 2 + 2 * k - 1 : ℝ) / 2))
Proof (Lean source)
theorem prescribed_latticeOperationCount_polynomial_bound (k dx dz : ℕ) (L pi0 sigma0 : ℝ) (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hpiMax : pi0 ≤ 1 / (2 * k : ℝ)) (hsigma : 0 < sigma0) (hsigmaMax : sigma0 ≤ 1) : ∃ C : ℝ, 0 < C ∧ ∀ n : ℕ, 1 ≤ n → ∀ A : LatticeEstimator k dx dz n (effectRadius dz L sigma0), IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A → (A.candidateCount : ℝ) ≤ C * rpow (n : ℝ) ((dx * k + k ^ 2 + 2 * k - 1 : ℝ) / 2) ∧ (latticeOperationCount A : ℝ) ≤ C * (n + rpow (n : ℝ) ((dx * k + k ^ 2 + 2 * k - 1 : ℝ) / 2)) := by obtain ⟨C0, hC0, hbound⟩ := prescribed_candidateCount_polynomial_bound k dx dz L pi0 sigma0 hk hkx hkz hL hpi hpiMax hsigma hsigmaMax let C := max 1 C0 have hC : 0 < C := lt_of_lt_of_le (by norm_num) (le_max_left _ _) refine ⟨C, hC, ?_⟩ intro n hn A hA have hcand0 := hbound n hn A hA have hC0le : C0 ≤ C := le_max_right _ _ have hrpow : 0 ≤ rpow (n : ℝ) ((dx * k + k ^ 2 + 2 * k - 1 : ℝ) / 2) := Real.rpow_nonneg (Nat.cast_nonneg n) _ have hcand : (A.candidateCount : ℝ) ≤ C * rpow (n : ℝ) ((dx * k + k ^ 2 + 2 * k - 1 : ℝ) / 2) := hcand0.trans (mul_le_mul_of_nonneg_right hC0le hrpow) refine ⟨hcand, ?_⟩ rw [latticeOperationCount, Nat.cast_add] calc (n : ℝ) + A.candidateCount ≤ (n : ℝ) + C * rpow (n : ℝ) ((dx * k + k ^ 2 + 2 * k - 1 : ℝ) / 2) := by simpa [add_comm] using add_le_add_right hcand (n : ℝ) _ ≤ C * ((n : ℝ) + rpow (n : ℝ) ((dx * k + k ^ 2 + 2 * k - 1 : ℝ) / 2)) := by have hCone : 1 ≤ C := le_max_left _ _ calc (n : ℝ) + C * rpow (n : ℝ) ((dx * k + k ^ 2 + 2 * k - 1 : ℝ) / 2) ≤ C * n + C * rpow (n : ℝ) ((dx * k + k ^ 2 + 2 * k - 1 : ℝ) / 2) := by gcongr simpa using mul_le_mul_of_nonneg_right hCone (Nat.cast_nonneg n) _ = C * ((n : ℝ) + rpow (n : ℝ) ((dx * k + k ^ 2 + 2 * k - 1 : ℝ) / 2)) := by ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.prescribed_latticeOperationCount_polynomial_bound · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeCardinality.lean:168
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.StructuredLatticeComparator 1 declarations Assembly of the rounded structured-lattice comparator

Assembly of the rounded structured-lattice comparator

theorem structuredLatticeComparator_exists

Assemble coordinate, polar, matrix, simplex, and effect rounding into one well-formed lattice point. The conclusion records the four approximation estimates used factorwise in (91). Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 :
hk :
2 ≤ k
hL :
1 ≤ L
hpi :
0 < pi0
hsigma :
0 < sigma0
hradius :
0 ≤ effectRadius dz L sigma0
V :
R :
p tau :
Fin k → ℝ
hRmin :
sigma0 ≤ signalMinSingular R
hRnorm :
‖matrixCLM R‖ ≤ sqrt k * L
hp :
∀ u, 2 * pi0 ≤ p u
hpSum :
∑ u, p u = 1
htau :
∀ u, tau u ∈ Icc (-effectRadius dz L sigma0) (effectRadius dz L sigma0)
∃ theta : StructuredLatticePoint k dx (effectRadius dz L sigma0),
theta.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)
‖matrixCLM (theta.V - V.V)‖ ≤ 4 * sqrt (dx * k) * latticeMesh k dx n pi0 sigma0
‖matrixCLM (theta.R - R)‖ ≤ (k : ℝ) * latticeMesh k dx n pi0 sigma0
sqrt (∑ u, (theta.weight u - p u) ^ 2) ≤ sqrt k * latticeMesh k dx n pi0 sigma0
conclusion 1
u :
|theta.effect u - tau u| ≤ latticeMesh k dx n pi0 sigma0
Proof (Lean source)
lemma structuredLatticeComparator_exists {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} (hk : 2 ≤ k) (hL : 1 ≤ L) (hpi : 0 < pi0) (hsigma : 0 < sigma0) (hradius : 0 ≤ effectRadius dz L sigma0) (V : SignalBasis dx k) (R : RectMatrix k k) (p tau : Fin k → ℝ) (hRmin : sigma0 ≤ signalMinSingular R) (hRnorm : ‖matrixCLM R‖ ≤ sqrt k * L) (hp : ∀ u, 2 * pi0 ≤ p u) (hpSum : ∑ u, p u = 1) (htau : ∀ u, tau u ∈ Icc (-effectRadius dz L sigma0) (effectRadius dz L sigma0)) : ∃ theta : StructuredLatticePoint k dx (effectRadius dz L sigma0), theta.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0) ∧ ‖matrixCLM (theta.V - V.V)‖ ≤ 4 * sqrt (dx * k) * latticeMesh k dx n pi0 sigma0 ∧ ‖matrixCLM (theta.R - R)‖ ≤ (k : ℝ) * latticeMesh k dx n pi0 sigma0 ∧ sqrt (∑ u, (theta.weight u - p u) ^ 2) ≤ sqrt k * latticeMesh k dx n pi0 sigma0 ∧ ∀ u, |theta.effect u - tau u| ≤ latticeMesh k dx n pi0 sigma0 := by classical let H := latticeHeight k dx n pi0 sigma0 let q := latticeMesh k dx n pi0 sigma0 have hkpos : 0 < k := by omega have hH : 0 < H := latticeHeight_pos hkpos have hmesh : sqrt (dx * k) * (H : ℝ)⁻¹ ≤ 1 / 4 := by simpa [q, latticeMesh, H] using (sqrt_card_mul_latticeMesh_le_quarter (k := k) (dx := dx) (n := n) (pi0 := pi0) (sigma0 := sigma0) hkpos) obtain ⟨G, hG, hgrid, hGclose, hVclose⟩ := V.exists_rounded_prescribedPolarFactor hkpos hH hmesh let Vn := prescribedPolarFactor G hG have hmargin : (k : ℝ) * (H : ℝ)⁻¹ ≤ sigma0 / 2 := by simpa [q, latticeMesh, H] using (k_mul_latticeMesh_le_half_sigma (k := k) (dx := dx) (n := n) (pi0 := pi0) (sigma0 := sigma0) hkpos hsigma) have hbudget : (k : ℝ) * (H : ℝ)⁻¹ ≤ sqrt k * L := by simpa [q, latticeMesh, H] using (k_mul_latticeMesh_le_sqrt_mul (k := k) (dx := dx) (n := n) (pi0 := pi0) (sigma0 := sigma0) hk hL) obtain ⟨Rn, hRgrid, hRclose, hRnmin, hRnnorm⟩ := exists_rounded_conditioned_matrix hH (by linarith) hsigma.le R hRmin hRnorm hmargin hbudget have hHpi : ⌈pi0⁻¹⌉₊ ≤ H := by simpa [H] using ceil_inv_le_latticeHeight k dx n pi0 sigma0 obtain ⟨a, haFloor, haClose, haSum⟩ := simplex_largestRemainder_round_with_floor_l2 hkpos hH hpi hHpi p hp hpSum let pn : Fin k → ℝ := fun u => (a u : ℝ) / H obtain ⟨taun, htauGrid, htauClose⟩ := clipped_lattice_round_vector hH hradius tau htau have hpnNonneg (u : Fin k) : 0 ≤ pn u := by dsimp [pn] positivity have hpnSum : ∑ u, pn u = 1 := by dsimp [pn] rw [← Finset.sum_div] have hcast : ∑ u, (a u : ℝ) = (H : ℝ) := by exact_mod_cast haSum rw [hcast, div_self] exact_mod_cast hH.ne' have hVorth : ∀ i j, ∑ b, Vn b i * Vn b j = if i = j then 1 else 0 := by have hm := prescribedPolarFactor_transpose_mul_self G hG intro i j have hij := congr_fun (congr_fun hm i) j simpa [Vn, Matrix.mul_apply, Matrix.one_apply] using hij let theta : StructuredLatticePoint k dx (effectRadius dz L sigma0) := { gridBasis := G V := Vn R := Rn weight := pn effect := taun lawValid := ⟨hpnNonneg, hpnSum, fun u => (htauGrid u).1⟩ } refine ⟨theta, ?_, ?_, ?_, ?_, ?_⟩ · unfold StructuredLatticePoint.WellFormed change (∀ i j, ∃ z : ℤ, G i j = (H : ℝ)⁻¹ * z ∧ |G i j| ≤ 1) ∧ (∃ hG' : 1 / 2 ≤ signalMinSingular G, Vn = prescribedPolarFactor G hG') ∧ (∀ i j, ∑ b, Vn b i * Vn b j = if i = j then 1 else 0) ∧ (∀ i j, ∃ z : ℤ, Rn i j = (H : ℝ)⁻¹ * z) ∧ sigma0 / 2 ≤ signalMinSingular Rn ∧ ‖matrixCLM Rn‖ ≤ 2 * sqrt k * L ∧ (∃ a' : Fin k → ℕ, (∀ u, ⌈pi0 * H⌉₊ ≤ a' u ∧ pn u = (a' u : ℝ) / H) ∧ ∑ u, a' u = H) ∧ ∀ u, taun u ∈ Icc (-effectRadius dz L sigma0) (effectRadius dz L sigma0) ∧ ∃ z : ℤ, taun u = (H : ℝ)⁻¹ * z refine ⟨hgrid, ⟨hG, rfl⟩, hVorth, hRgrid, hRnmin, hRnnorm, ?_, htauGrid⟩ exact ⟨a, fun u => ⟨haFloor u, rfl⟩, haSum⟩ · simpa [theta, Vn, q, latticeMesh, H] using hVclose · simpa [theta, q, latticeMesh, H] using hRclose · simpa [theta, pn, q, latticeMesh, H] using haClose · intro u simpa [theta, q, latticeMesh, H] using htauClose u
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredLatticeComparator_exists · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeComparator.lean:11
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.StructuredLatticeEnumeration 13 declarations The lattice is encoded by its bounded integer grid coordinates and simplex numerators.

Finite enumeration of the prescribed structured lattice

The lattice is encoded by its bounded integer grid coordinates and simplex numerators. This gives the finite coordinate-key set used by exhaustive minimization without introducing a precomputed library of model summaries.

def BoundedLatticeInt

Integer coordinates large enough to encode a mesh-1/H scalar bounded by B.

Definition (Lean source)
H :
B :
BoundedLatticeInt H B :
Type
{z : ℤ // z ∈ Icc (-⌈(H : ℝ) * B⌉ : ℤ) ⌈(H : ℝ) * B⌉}
structure StructuredLatticeCode

For the latent dimension, feature dimension, mesh denominator, and bounds, the finite code type for one structured-lattice point stores its grid, coordinate, mass, and effect entries.

Definition (Lean source)
structure StructuredLatticeCode (k dx : ℕ) (H : ℕ) (L sigma0 radius : ℝ) where grid : Fin dx → Fin k → BoundedLatticeInt H 1 coord : Fin k → Fin k → BoundedLatticeInt H (2 * sqrt k * L) mass : Fin (k - 1) → Fin (H + 1) effect : Fin k → BoundedLatticeInt H radius deriving Fintype
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.StructuredLatticeCode · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeEnumeration.lean:45
instance instFintypeStructuredLatticeCode

For the lattice dimensions and bounds, structured lattice codes form a finite type.

Definition (Lean source)
deriving Fintype
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.instFintypeStructuredLatticeCode · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeEnumeration.lean:51
theorem structuredLatticeCode_card

The encoder has exactly the paper's number of free mesh coordinates; the simplex contributes k-1 because its final mass is determined by the sum. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx H :
L sigma0 radius :
card (StructuredLatticeCode k dx H L sigma0 radius)
= card (BoundedLatticeInt H 1) ^ (dx * k) * card (BoundedLatticeInt H (2 * sqrt k * L)) ^ (k ^ 2) * (H + 1) ^ (k - 1) * card (BoundedLatticeInt H radius) ^ k
Proof (Lean source)
lemma structuredLatticeCode_card (k dx H : ℕ) (L sigma0 radius : ℝ) : card (StructuredLatticeCode k dx H L sigma0 radius) = card (BoundedLatticeInt H 1) ^ (dx * k) * card (BoundedLatticeInt H (2 * sqrt k * L)) ^ (k ^ 2) * (H + 1) ^ (k - 1) * card (BoundedLatticeInt H radius) ^ k := by let e : StructuredLatticeCode k dx H L sigma0 radius ≃ (Fin dx → Fin k → BoundedLatticeInt H 1) × (Fin k → Fin k → BoundedLatticeInt H (2 * sqrt k * L)) × (Fin (k - 1) → Fin (H + 1)) × (Fin k → BoundedLatticeInt H radius) := { toFun := fun c => (c.grid, c.coord, c.mass, c.effect) invFun := fun c => ⟨c.1, c.2.1, c.2.2.1, c.2.2.2⟩ left_inv := by intro c; cases c; rfl right_inv := by intro c; rcases c with ⟨_, _, _, _⟩; rfl } rw [Fintype.card_congr e] simp [pow_mul, pow_two] ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredLatticeCode_card · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeEnumeration.lean:57
instance structuredLatticeWellFormedFinite

The subtype of all well-formed points in the prescribed lattice is finite. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
noncomputable instance structuredLatticeWellFormedFinite {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} : Finite {θ : StructuredLatticePoint k dx (effectRadius dz L sigma0) // θ.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)} := Finite.of_injective (fun θ => structuredLatticeCode θ.1 θ.2) structuredLatticeCode_injective
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredLatticeWellFormedFinite · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeEnumeration.lean:334
def StructuredLatticeKey

Coordinate keys which are realized by at least one well-formed lattice point. Passing to keys removes harmless duplicate grid bases having the same prescribed visible coordinates. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz n :
L pi0 sigma0 :
StructuredLatticeKey k dx dz n L pi0 sigma0 :
Type
{key : List ℝ // ∃ θ : StructuredLatticePoint k dx (effectRadius dz L sigma0), θ.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0) ∧ structuredLatticeLexKey θ = key}
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.StructuredLatticeKey · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeEnumeration.lean:342
instance structuredLatticeKeyLinearOrder

For the ambient setting, structured Lattice Key Linear Order is given by its defining clause.

Definition (Lean source)
noncomputable instance structuredLatticeKeyLinearOrder {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} : LinearOrder (StructuredLatticeKey k dx dz n L pi0 sigma0) := by unfold StructuredLatticeKey infer_instance
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredLatticeKeyLinearOrder · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeEnumeration.lean:349
instance structuredLatticeKeyFinite

For the ambient setting, structured Lattice Key Finite is given by its defining clause.

Definition (Lean source)
noncomputable instance structuredLatticeKeyFinite {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} : Finite (StructuredLatticeKey k dx dz n L pi0 sigma0) := by let Source := {θ : StructuredLatticePoint k dx (effectRadius dz L sigma0) // θ.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)} let encode : Source → StructuredLatticeKey k dx dz n L pi0 sigma0 := fun θ => ⟨structuredLatticeLexKey θ.1, θ.1, θ.2, rfl⟩ exact Finite.of_surjective encode (by rintro ⟨key, θ, hθ, hkey⟩ refine ⟨⟨θ, hθ⟩, Subtype.ext ?_⟩ exact hkey)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredLatticeKeyFinite · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeEnumeration.lean:356
instance structuredLatticeKeyFintype

For the ambient setting, structured Lattice Key Fintype is given by its defining clause.

Definition (Lean source)
noncomputable instance structuredLatticeKeyFintype {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} : Fintype (StructuredLatticeKey k dx dz n L pi0 sigma0) := ofFinite _
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredLatticeKeyFintype · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeEnumeration.lean:369
theorem structuredLatticeKey_card_le_code

Realized visible-coordinate keys inject into the integer encoder, so their cardinality is bounded by the encoder's exact free-coordinate product. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 :
card (StructuredLatticeKey k dx dz n L pi0 sigma0)
card (StructuredLatticeCode k dx (latticeHeight k dx n pi0 sigma0) L sigma0 (effectRadius dz L sigma0))
Proof (Lean source)
lemma structuredLatticeKey_card_le_code {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} : card (StructuredLatticeKey k dx dz n L pi0 sigma0) ≤ card (StructuredLatticeCode k dx (latticeHeight k dx n pi0 sigma0) L sigma0 (effectRadius dz L sigma0)) := by classical let Key := StructuredLatticeKey k dx dz n L pi0 sigma0 letI : Fintype Key := Fintype.ofFinite Key let encode : Key → StructuredLatticeCode k dx (latticeHeight k dx n pi0 sigma0) L sigma0 (effectRadius dz L sigma0) := fun key => structuredLatticeCode (structuredLatticeKeyRepresentative key) (structuredLatticeKeyRepresentative_wellFormed key) apply Fintype.card_le_of_injective encode intro x y hxy have hreps : structuredLatticeKeyRepresentative x = structuredLatticeKeyRepresentative y := by dsimp [encode] at hxy let rx : {θ : StructuredLatticePoint k dx (effectRadius dz L sigma0) // θ.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)} := ⟨structuredLatticeKeyRepresentative x, structuredLatticeKeyRepresentative_wellFormed x⟩ let ry : {θ : StructuredLatticePoint k dx (effectRadius dz L sigma0) // θ.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)} := ⟨structuredLatticeKeyRepresentative y, structuredLatticeKeyRepresentative_wellFormed y⟩ have hxy' : structuredLatticeCode rx.1 rx.2 = structuredLatticeCode ry.1 ry.2 := by simpa only [rx, ry] using hxy have hsub := (@structuredLatticeCode_injective k dx dz n L pi0 sigma0) hxy' exact congrArg val hsub apply Subtype.ext calc x.1 = structuredLatticeLexKey (structuredLatticeKeyRepresentative x) := (structuredLatticeKeyRepresentative_key x).symm _ = structuredLatticeLexKey (structuredLatticeKeyRepresentative y) := congrArg structuredLatticeLexKey hreps _ = y.1 := structuredLatticeKeyRepresentative_key y
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredLatticeKey_card_le_code · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeEnumeration.lean:393
theorem structuredLatticeEnumeration_exists

There is a duplicate-free exhaustive enumeration of the well-formed lattice, ordered by the displayed lexicographic coordinate key. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 :
∃ (m : ℕ) (candidate : Fin m → StructuredLatticePoint k dx (effectRadius dz L sigma0)),
conclusion 1
i :
(candidate i).WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)
conclusion 2
θ :
θ.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)
∃ i,
(candidate i).V = θ.V
(candidate i).R = θ.R
(candidate i).weight = θ.weight
(candidate i).effect = θ.effect
conclusion 3
i j :
(candidate i).V = (candidate j).V
(candidate i).R = (candidate j).R
(candidate i).weight = (candidate j).weight
(candidate i).effect = (candidate j).effect
i = j
conclusion 4
i j :
i ≤ j ↔ StructuredLatticePoint.LexLE (candidate i) (candidate j)
Proof (Lean source)
theorem structuredLatticeEnumeration_exists {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} : ∃ (m : ℕ) (candidate : Fin m → StructuredLatticePoint k dx (effectRadius dz L sigma0)), (∀ i, (candidate i).WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)) ∧ (∀ θ : StructuredLatticePoint k dx (effectRadius dz L sigma0), θ.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0) → ∃ i, (candidate i).V = θ.V ∧ (candidate i).R = θ.R ∧ (candidate i).weight = θ.weight ∧ (candidate i).effect = θ.effect) ∧ (∀ i j, (candidate i).V = (candidate j).V → (candidate i).R = (candidate j).R → (candidate i).weight = (candidate j).weight → (candidate i).effect = (candidate j).effect → i = j) ∧ ∀ i j, i ≤ j ↔ StructuredLatticePoint.LexLE (candidate i) (candidate j) := by classical let Key := StructuredLatticeKey k dx dz n L pi0 sigma0 letI : Fintype Key := Fintype.ofFinite Key let e : Fin (card Key) ≃o Key := Fintype.orderIsoFinOfCardEq Key rfl let candidate : Fin (card Key) → StructuredLatticePoint k dx (effectRadius dz L sigma0) := fun i => structuredLatticeKeyRepresentative (e i) refine ⟨Fintype.card Key, candidate, ?_, ?_, ?_, ?_⟩ · intro i exact structuredLatticeKeyRepresentative_wellFormed (e i) · intro θ hθ let key : Key := ⟨structuredLatticeLexKey θ, θ, hθ, rfl⟩ obtain ⟨i, hi⟩ := e.surjective key refine ⟨i, ?_⟩ have hkeys : structuredLatticeLexKey (candidate i) = structuredLatticeLexKey θ := by rw [structuredLatticeKeyRepresentative_key] exact congrArg val hi exact structuredLatticeLexKey_injective_visible _ _ hkeys · intro i j hV hR hw heffect apply e.injective apply Subtype.ext rw [← structuredLatticeKeyRepresentative_key (e i), ← structuredLatticeKeyRepresentative_key (e j)] simp [candidate, structuredLatticeLexKey, hV, hR, hw, heffect] · intro i j rw [← e.le_iff_le] change (e i).1 ≤ (e j).1 ↔ _ rw [← structuredLatticeKeyRepresentative_key (e i), ← structuredLatticeKeyRepresentative_key (e j)] exact le_iff_eq_or_lt
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredLatticeEnumeration_exists · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeEnumeration.lean:498
theorem isPrescribedStructuredLattice_candidateCount_le_code

Any certified duplicate-free exhaustive lattice search has no more candidates than the exact integer/simplex encoder. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 :
A :
LatticeEstimator k dx dz n (effectRadius dz L sigma0)
hA :
IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A
A.candidateCount
card (StructuredLatticeCode k dx (latticeHeight k dx n pi0 sigma0) L sigma0 (effectRadius dz L sigma0))
Proof (Lean source)
lemma isPrescribedStructuredLattice_candidateCount_le_code {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} (A : LatticeEstimator k dx dz n (effectRadius dz L sigma0)) (hA : IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A) : A.candidateCount ≤ card (StructuredLatticeCode k dx (latticeHeight k dx n pi0 sigma0) L sigma0 (effectRadius dz L sigma0)) := by classical obtain ⟨candidate, _first, hwf, _hcomplete, _hinj, horder, _hmin, _htie, _hestimate⟩ := hA let Key := StructuredLatticeKey k dx dz n L pi0 sigma0 let encode : Fin A.candidateCount → Key := fun i => ⟨structuredLatticeLexKey (candidate i), candidate i, hwf i, rfl⟩ have hencode : Injective encode := by intro i j hij have hkey : structuredLatticeLexKey (candidate i) = structuredLatticeLexKey (candidate j) := congrArg val hij apply le_antisymm · exact (horder i j).2 (inl hkey) · exact (horder j i).2 (inl hkey.symm) calc A.candidateCount = card (Fin A.candidateCount) := by simp _ ≤ card Key := Fintype.card_le_of_injective encode hencode _ ≤ card (StructuredLatticeCode k dx (latticeHeight k dx n pi0 sigma0) L sigma0 (effectRadius dz L sigma0)) := structuredLatticeKey_card_le_code
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.isPrescribedStructuredLattice_candidateCount_le_code · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeEnumeration.lean:546
theorem finite_first_minimizer_exists

A nonempty finite candidate family has a unique first minimizer: first minimize the displayed real score, then minimize the enumeration index among ties. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
α :
Type*
m :
hm :
0 < m
score :
α → Fin m → ℝ
∃ first : α → Fin m,
conclusion 1
x i :
score x (first x) ≤ score x i
conclusion 2
x i :
score x (first x) = score x i
first x ≤ i
Proof (Lean source)
theorem finite_first_minimizer_exists {α : Type*} {m : ℕ} (hm : 0 < m) (score : α → Fin m → ℝ) : ∃ first : α → Fin m, (∀ x i, score x (first x) ≤ score x i) ∧ ∀ x i, score x (first x) = score x i → first x ≤ i := by classical haveI : Nonempty (Fin m) := ⟨⟨0, hm⟩⟩ have hpointwise : ∀ x : α, ∃ j : Fin m, (∀ i, score x j ≤ score x i) ∧ ∀ i, score x j = score x i → j ≤ i := by intro x obtain ⟨j, _hjmem, hj⟩ := Finset.exists_min_image univ (score x) (Finset.univ_nonempty : Finset.univ.Nonempty) let tied : Finset (Fin m) := Finset.univ.filter fun i => score x j = score x i have hjtied : j ∈ tied := by simp [tied] obtain ⟨j₀, hj₀mem, hj₀⟩ := Finset.exists_min_image tied id ⟨j, hjtied⟩ have hscore : score x j₀ = score x j := by exact (Finset.mem_filter.mp hj₀mem).2.symm refine ⟨j₀, ?_, ?_⟩ · intro i rw [hscore] exact hj i (by simp) · intro i hi exact hj₀ i (by simp only [tied, mem_filter, Finset.mem_univ, true_and] rw [← hscore, hi]) refine ⟨fun x => choose (hpointwise x), ?_, ?_⟩ · intro x i exact (Classical.choose_spec (hpointwise x)).1 i · intro x i hi exact (Classical.choose_spec (hpointwise x)).2 i hi
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.finite_first_minimizer_exists · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeEnumeration.lean:574
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.StructuredLatticeFunctionalCalculus 19 declarations Collision-safe functional calculus for selected structured-lattice tuples

Collision-safe functional calculus for selected structured-lattice tuples

theorem blockExtension_norm_le_max

Extending an operator on an orthonormal signal frame by the identity on its orthogonal complement has norm at most the larger of the signal-block norm and one. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
V :
C :
‖V.V * C * V.V.transpose + (1 - V.V * V.V.transpose)‖ ≤ max ‖C‖ 1
Proof (Lean source)
lemma SignalBasis.blockExtension_norm_le_max {dx k : ℕ} (V : SignalBasis dx k) (C : RectMatrix k k) : ‖V.V * C * V.V.transpose + (1 - V.V * V.V.transpose)‖ ≤ max ‖C‖ 1 := by let T : Euc k →ₗ[ℝ] Euc dx := Matrix.toEuclideanLin V.V let S : Euc k →ₗ[ℝ] Euc k := Matrix.toEuclideanLin C have hTadj : LinearMap.adjoint T = Matrix.toEuclideanLin V.V.transpose := by dsimp [T] rw [← Matrix.toEuclideanLin_conjTranspose_eq_adjoint] rfl apply ContinuousLinearMap.opNorm_le_bound _ (by positivity) intro x let y : Euc k := LinearMap.adjoint T x let p : Euc dx := T y let r : Euc dx := x - p let z : Euc dx := T (S y) have hTT : LinearMap.adjoint T ∘ₗ T = LinearMap.id := by rw [hTadj] ext u simp [T, Matrix.toEuclideanLin_apply, Matrix.mulVec_mulVec, V.transpose_mul_self] have hrnormal : LinearMap.adjoint T r = 0 := by have hy : LinearMap.adjoint T (T y) = y := by exact LinearMap.congr_fun hTT y simp [r, p, y, hy] have hpr : inner ℝ p r = 0 := by rw [show p = T y by rfl, ← LinearMap.adjoint_inner_right, hrnormal] simp have hzr : inner ℝ z r = 0 := by rw [show z = T (S y) by rfl, ← LinearMap.adjoint_inner_right, hrnormal] simp have hTnorm (u : Euc k) : ‖T u‖ = ‖u‖ := by exact (signalBasisLinearIsometry V).norm_map u have hdecomp : Matrix.toEuclideanLin (V.V * C * V.V.transpose + (1 - V.V * V.V.transpose)) x = z + r := by ext i simp [z, r, p, y, T, S, hTadj, Matrix.toEuclideanLin_apply, Matrix.mulVec_mulVec, Matrix.add_mulVec, Matrix.sub_mulVec, Matrix.one_mulVec] change ‖Matrix.toEuclideanLin (V.V * C * V.V.transpose + (1 - V.V * V.V.transpose)) x‖ ≤ _ rw [hdecomp] have hxsum : p + r = x := by simp [r] have hxSq := norm_add_sq_eq_norm_sq_add_norm_sq_of_inner_eq_zero p r hpr rw [hxsum] at hxSq have hxSq' : ‖x‖ ^ 2 = ‖p‖ ^ 2 + ‖r‖ ^ 2 := by simpa [pow_two] using hxSq have hzSq := norm_add_sq_eq_norm_sq_add_norm_sq_of_inner_eq_zero z r hzr have hzSq' : ‖z + r‖ ^ 2 = ‖z‖ ^ 2 + ‖r‖ ^ 2 := by simpa [pow_two] using hzSq have hzle : ‖z‖ ≤ max ‖C‖ 1 * ‖y‖ := by rw [show ‖z‖ = ‖S y‖ by simp [z, hTnorm]] calc ‖S y‖ ≤ ‖C‖ * ‖y‖ := Matrix.l2_opNorm_mulVec C y _ ≤ max ‖C‖ 1 * ‖y‖ := by gcongr; exact le_max_left _ _ have hM1 : 1 ≤ max ‖C‖ 1 := le_max_right _ _ have hM0 : 0 ≤ max ‖C‖ 1 := le_trans zero_le_one hM1 apply (sq_le_sq₀ (norm_nonneg _) (mul_nonneg hM0 (norm_nonneg _))).mp rw [hzSq'] have hzSqLe : ‖z‖ ^ 2 ≤ (max ‖C‖ 1) ^ 2 * ‖y‖ ^ 2 := by simpa [mul_pow] using (sq_le_sq₀ (norm_nonneg z) (mul_nonneg hM0 (norm_nonneg y))).2 hzle have hrSqLe : ‖r‖ ^ 2 ≤ (max ‖C‖ 1) ^ 2 * ‖r‖ ^ 2 := by nlinarith [sq_nonneg ‖r‖, sq_nonneg (max ‖C‖ 1 - 1)] calc ‖z‖ ^ 2 + ‖r‖ ^ 2 ≤ (max ‖C‖ 1) ^ 2 * ‖y‖ ^ 2 + (max ‖C‖ 1) ^ 2 * ‖r‖ ^ 2 := add_le_add hzSqLe hrSqLe _ = (max ‖C‖ 1) ^ 2 * ‖x‖ ^ 2 := by have hpNorm : ‖p‖ = ‖y‖ := by exact hTnorm y rw [← hpNorm, ← mul_add, ← hxSq'] _ = (max ‖C‖ 1 * ‖x‖) ^ 2 := by ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.SignalBasis.blockExtension_norm_le_max · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeFunctionalCalculus.lean:14
theorem realDiagonalization_conditionNumber_le_max

The ambient diagonalizer induced by a thin signal factorization has condition number at most the product of the sharp signal/complement extension bounds. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
Nonempty (Fin k)
tau :
Fin k → ℝ
(F.realDiagonalization tau).conditionNumber ≤ max ‖F.coordInv‖ 1 * max ‖F.coord‖ 1
Proof (Lean source)
lemma ThinSignalFactorization.realDiagonalization_conditionNumber_le_max {dx k : ℕ} [Nonempty (Fin k)] {B : RectMatrix dx k} (F : ThinSignalFactorization B) (tau : Fin k → ℝ) : (F.realDiagonalization tau).conditionNumber ≤ max ‖F.coordInv‖ 1 * max ‖F.coord‖ 1 := by let b := F.V.ambientExtension.basis have hBasisEq : (F.realDiagonalization tau).basis = F.forward * basisMatrix b.toBasis := by ext i j change (F.eigenbasis j).ofLp i = _ rw [ThinSignalFactorization.eigenbasis, Module.Basis.map_apply] dsimp [b] simp [ThinSignalFactorization.linearEquiv, Matrix.toEuclideanLin_apply, basisMatrix, Matrix.mul_apply, mulVec, dotProduct] have hInvEq : (F.realDiagonalization tau).basisInv = basisInvMatrix b.toBasis * F.backward := by ext i j change F.eigenbasis.repr (single j (1 : ℝ)) i = _ rw [ThinSignalFactorization.eigenbasis, Module.Basis.map_repr] change b.toBasis.repr (toEuclideanLin F.backward (single j (1 : ℝ))) i = _ rw [b.coe_toBasis_repr_apply] simp [basisInvMatrix, Matrix.mul_apply, Matrix.toEuclideanLin_apply, mulVec, dotProduct, b.repr_apply_apply, PiLp.inner_apply, RCLike.inner_apply, conj_trivial, mul_comm] have hCoordInvTranspose : ‖F.coordInv.transpose‖ = ‖F.coordInv‖ := by rw [← Matrix.conjTranspose_eq_transpose_of_trivial, Matrix.l2_opNorm_conjTranspose] have hCoordTranspose : ‖F.coord.transpose‖ = ‖F.coord‖ := by rw [← Matrix.conjTranspose_eq_transpose_of_trivial, Matrix.l2_opNorm_conjTranspose] have hForward : ‖F.forward‖ ≤ max ‖F.coordInv‖ 1 := by simpa [ThinSignalFactorization.forward, hCoordInvTranspose] using F.V.blockExtension_norm_le_max F.coordInv.transpose have hBackward : ‖F.backward‖ ≤ max ‖F.coord‖ 1 := by simpa [ThinSignalFactorization.backward, hCoordTranspose] using F.V.blockExtension_norm_le_max F.coord.transpose rw [RealDiagonalization.conditionNumber, hBasisEq, hInvEq] calc ‖F.forward * basisMatrix b.toBasis‖ * ‖basisInvMatrix b.toBasis * F.backward‖ ≤ (‖F.forward‖ * ‖basisMatrix b.toBasis‖) * (‖basisInvMatrix b.toBasis‖ * ‖F.backward‖) := by gcongr <;> exact Matrix.l2_opNorm_mul _ _ _ ≤ (max ‖F.coordInv‖ 1 * 1) * (1 * max ‖F.coord‖ 1) := by gcongr · exact orthonormalBasis_basisMatrix_norm_le_one b · exact orthonormalBasis_basisInvMatrix_norm_le_one b _ = _ := by ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ThinSignalFactorization.realDiagonalization_conditionNumber_le_max · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeFunctionalCalculus.lean:119
def structuredLatticeThinSignalFactorization

Regard a well-conditioned structured tuple as a thin signal factorization of its reconstructed feature matrix. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz n :
L pi0 sigma0 :
theta :
htheta :
theta.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)
hsigma :
0 < sigma0
structuredLatticeThinSignalFactorization theta htheta hsigma :
ThinSignalFactorization (theta.V * theta.R.transpose)
by let V : SignalBasis dx k := ⟨theta.V, htheta.2.2.1⟩ have hRpos : 0 < signalMinSingular theta.R := (by positivity : 0 < sigma0 / 2).trans_le htheta.2.2.2.2.1 have hdet := matrix_det_isUnit_of_signalMinSingular_pos theta.R hRpos refine { V := V coord := theta.R.transpose coordInv := theta.R⁻¹.transpose factor := rfl coord_mul_inv := ?_ inv_mul_coord := ?_ } · rw [← Matrix.transpose_mul, Matrix.nonsing_inv_mul theta.R hdet, Matrix.transpose_one] · rw [← Matrix.transpose_mul, Matrix.mul_nonsing_inv theta.R hdet, Matrix.transpose_one]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredLatticeThinSignalFactorization · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeFunctionalCalculus.lean:172
def structuredLatticeRealDiagonalization

Ambient diagonalization of the selected candidate operator, including zero on the orthogonal complement of the reconstructed signal space. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz n :
L pi0 sigma0 :
theta :
htheta :
theta.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)
hsigma :
0 < sigma0
Nonempty (Fin k)
structuredLatticeRealDiagonalization theta htheta hsigma :
RealDiagonalization (structuredCandidateOperator theta)
by let F := structuredLatticeThinSignalFactorization theta htheta hsigma have hop : F.factorOperator theta.effect
= structuredCandidateOperator theta := by simp only [F, structuredLatticeThinSignalFactorization, ThinSignalFactorization.factorOperator, structuredCandidateOperator] rw [Matrix.transpose_transpose, Matrix.transpose_transpose] rw [← hop] exact F.realDiagonalization theta.effect
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredLatticeRealDiagonalization · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeFunctionalCalculus.lean:197
theorem structuredLatticeRealDiagonalization_conditionNumber_le

Under the paper's parameter domain, every selected structured-lattice diagonalizer has condition number at most the frozen sharp value 4 * sqrt k * L / sigma0. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 :
theta :
htheta :
theta.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)
hk :
2 ≤ k
hL :
1 ≤ L
hsigma :
0 < sigma0
hsigmaMax :
sigma0 ≤ 1
Nonempty (Fin k)
(structuredLatticeRealDiagonalization theta htheta hsigma).conditionNumber
≤ 4 * sqrt k * L / sigma0
Proof (Lean source)
lemma structuredLatticeRealDiagonalization_conditionNumber_le {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} (theta : StructuredLatticePoint k dx (effectRadius dz L sigma0)) (htheta : theta.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)) (hk : 2 ≤ k) (hL : 1 ≤ L) (hsigma : 0 < sigma0) (hsigmaMax : sigma0 ≤ 1) [Nonempty (Fin k)] : (structuredLatticeRealDiagonalization theta htheta hsigma).conditionNumber ≤ 4 * sqrt k * L / sigma0 := by let F := structuredLatticeThinSignalFactorization theta htheta hsigma have hraw := F.realDiagonalization_conditionNumber_le_max theta.effect have hInv := matrix_inv_norm_le_of_signalMinSingular theta.R (by positivity : 0 < sigma0 / 2) htheta.2.2.2.2.1 have hInv' : ‖theta.R⁻¹‖ ≤ 2 / sigma0 := by have h := hInv change ‖theta.R⁻¹‖ ≤ 1 / (sigma0 / 2) at h convert h using 1 <;> field_simp have hOneInv : 1 ≤ 2 / sigma0 := by apply (le_div_iff₀ hsigma).2 linarith have hk1 : (1 : ℝ) ≤ sqrt k := by rw [Real.one_le_sqrt] exact_mod_cast (show 1 ≤ k by omega) have hOneR : 1 ≤ 2 * sqrt k * L := by nlinarith [Real.sqrt_nonneg k] have hRnorm : ‖theta.R‖ ≤ 2 * sqrt k * L := by change ‖matrixCLM theta.R‖ ≤ _ exact htheta.2.2.2.2.2.1 have hCoordInv : max ‖F.coordInv‖ 1 ≤ 2 / sigma0 := by apply max_le · simpa [F, structuredLatticeThinSignalFactorization, ← Matrix.conjTranspose_eq_transpose_of_trivial, Matrix.l2_opNorm_conjTranspose] using hInv' · exact hOneInv have hCoord : max ‖F.coord‖ 1 ≤ 2 * sqrt k * L := by apply max_le · simpa [F, structuredLatticeThinSignalFactorization, ← Matrix.conjTranspose_eq_transpose_of_trivial, Matrix.l2_opNorm_conjTranspose] using hRnorm · exact hOneR change (F.realDiagonalization theta.effect).conditionNumber ≤ _ calc _ ≤ max ‖F.coordInv‖ 1 * max ‖F.coord‖ 1 := hraw _ ≤ (2 / sigma0) * (2 * sqrt k * L) := by gcongr _ = 4 * sqrt k * L / sigma0 := by ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredLatticeRealDiagonalization_conditionNumber_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeFunctionalCalculus.lean:214
def structuredCorrectedAnchor

The corrected right anchor changes the observed anchor only inside the selected signal space and makes the structured feature transpose evaluate exactly to the all-ones vector. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx :
thetaV :
thetaR :
structuredCorrectedAnchor thetaV thetaR :
Euc dx
+ toEuclideanLin (thetaV * thetaR⁻¹) (toLp 2 ((fun _ => (1 : ℝ)) - mulVec (thetaR * thetaV.transpose) (firstBasis dx)))
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredCorrectedAnchor · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeFunctionalCalculus.lean:261
theorem structuredFeature_transpose_correctedAnchor

Structured feature transpose corrected anchor: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 :
theta :
htheta :
theta.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)
hsigma :
0 < sigma0
mulVec (theta.V * theta.R.transpose).transpose (structuredCorrectedAnchor theta.V theta.R).ofLp
= fun _ => 1
Proof (Lean source)
lemma structuredFeature_transpose_correctedAnchor {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} (theta : StructuredLatticePoint k dx (effectRadius dz L sigma0)) (htheta : theta.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)) (hsigma : 0 < sigma0) : mulVec (theta.V * theta.R.transpose).transpose (structuredCorrectedAnchor theta.V theta.R).ofLp = fun _ => 1 := by let V : SignalBasis dx k := ⟨theta.V, htheta.2.2.1⟩ have hRpos : 0 < signalMinSingular theta.R := (by positivity : 0 < sigma0 / 2).trans_le htheta.2.2.2.2.1 have hdet := matrix_det_isUnit_of_signalMinSingular_pos theta.R hRpos have hgram : theta.V.transpose * theta.V = (1 : RectMatrix k k) := V.transpose_mul_self have hcorr : (theta.V * theta.R.transpose).transpose * (theta.V * theta.R⁻¹) = (1 : RectMatrix k k) := by rw [Matrix.transpose_mul, Matrix.transpose_transpose, Matrix.mul_assoc, ← Matrix.mul_assoc theta.V.transpose, hgram, Matrix.one_mul, Matrix.mul_nonsing_inv theta.R hdet] ext u let res : Fin k → ℝ := (fun _ => (1 : ℝ)) - mulVec (theta.R * theta.V.transpose) (firstBasis dx) have hcvec : mulVec (theta.V * theta.R.transpose).transpose (mulVec (theta.V * theta.R⁻¹) res) = res := by rw [Matrix.mulVec_mulVec, hcorr, Matrix.one_mulVec] change mulVec (theta.V * theta.R.transpose).transpose (firstBasis dx + mulVec (theta.V * theta.R⁻¹) ((fun _ => (1 : ℝ)) - mulVec (theta.R * theta.V.transpose) (firstBasis dx))) u = 1 rw [Matrix.mulVec_add, show ((fun _ => (1 : ℝ)) - mulVec (theta.R * theta.V.transpose) (firstBasis dx)) = res from rfl, hcvec] simp [res]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredFeature_transpose_correctedAnchor · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeFunctionalCalculus.lean:270
theorem structuredCorrectedAnchor_sub_norm_le

The corrected-anchor displacement is controlled by the selected anchor residual and the inverse coordinate margin, with no eigengap condition. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 δ :
theta :
htheta :
theta.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)
hsigma :
0 < sigma0
hanchor :
sqrt (∑ u, ((∑ v, theta.R u v * (∑ i, theta.V i v * firstBasis dx i)) - 1) ^ 2) ≤ δ
‖structuredCorrectedAnchor theta.V theta.R - toLp 2 (firstBasis dx)‖
≤ 2 / sigma0 * δ
Proof (Lean source)
lemma structuredCorrectedAnchor_sub_norm_le {k dx dz n : ℕ} {L pi0 sigma0 δ : ℝ} (theta : StructuredLatticePoint k dx (effectRadius dz L sigma0)) (htheta : theta.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)) (hsigma : 0 < sigma0) (hanchor : sqrt (∑ u, ((∑ v, theta.R u v * (∑ i, theta.V i v * firstBasis dx i)) - 1) ^ 2) ≤ δ) : ‖structuredCorrectedAnchor theta.V theta.R - toLp 2 (firstBasis dx)‖ ≤ 2 / sigma0 * δ := by let V : SignalBasis dx k := ⟨theta.V, htheta.2.2.1⟩ have hInv := matrix_inv_norm_le_of_signalMinSingular theta.R (by positivity : 0 < sigma0 / 2) htheta.2.2.2.2.1 have hres : ‖(toLp 2 ((fun _ => (1 : ℝ)) - mulVec (theta.R * theta.V.transpose) (firstBasis dx)) : Euc k)‖ ≤ δ := by have hforward : ‖(toLp 2 (mulVec (theta.R * theta.V.transpose) (firstBasis dx) - (fun _ => (1 : ℝ))) : Euc k)‖ ≤ δ := by have heq (u : Fin k) : mulVec (theta.R * theta.V.transpose) (firstBasis dx) u = ∑ v, theta.R u v * (∑ i, theta.V i v * firstBasis dx i) := by rw [← Matrix.mulVec_mulVec] rfl rw [EuclideanSpace.norm_eq] simpa [Real.norm_eq_abs, sq_abs, heq] using hanchor calc _ = ‖(toLp 2 (mulVec (theta.R * theta.V.transpose) (firstBasis dx) - (fun _ => (1 : ℝ))) : Euc k)‖ := by rw [show (toLp 2 ((fun _ => (1 : ℝ)) - mulVec (theta.R * theta.V.transpose) (firstBasis dx)) : Euc k) = -(toLp 2 (mulVec (theta.R * theta.V.transpose) (firstBasis dx) - (fun _ => (1 : ℝ))) : Euc k) by apply PiLp.ext intro u simp, norm_neg] _ ≤ δ := hforward rw [structuredCorrectedAnchor, add_sub_cancel_left] have hInv2 : ‖theta.R⁻¹‖ ≤ 2 / sigma0 := by have hInv' : ‖theta.R⁻¹‖ ≤ 1 / (sigma0 / 2) := by exact hInv convert hInv' using 1 <;> field_simp calc _ ≤ ‖matrixCLM (theta.V * theta.R⁻¹)‖ * ‖(toLp 2 ((fun _ => (1 : ℝ)) - mulVec (theta.R * theta.V.transpose) (firstBasis dx)) : Euc k)‖ := (matrixCLM (theta.V * theta.R⁻¹)).le_opNorm _ _ ≤ (1 * (2 / sigma0)) * δ := by gcongr · exact (Matrix.l2_opNorm_mul theta.V theta.R⁻¹).trans <| by gcongr · exact V.matrixCLM_norm_le_one _ = 2 / sigma0 * δ := by ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredCorrectedAnchor_sub_norm_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeFunctionalCalculus.lean:306
theorem structuredLattice_represents_effectLaw

The selected labelled atomic law is represented exactly by its ambient collision-safe functional calculus at the reconstructed mean and corrected anchor. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 :
theta :
htheta :
theta.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)
hsigma :
0 < sigma0
Nonempty (Fin k)
RepresentsAtomicLaw (structuredLatticeRealDiagonalization theta htheta hsigma) (toEuclideanLin (theta.V * theta.R.transpose) (toLp 2 theta.weight)) (structuredCorrectedAnchor theta.V theta.R) (GapFreeModulusBridge.asNeutral ({ weight := theta.weight, atom := theta.effect } : AtomicLaw k (effectRadius dz L sigma0)))
Proof (Lean source)
-- keep: reusable representation certificate connecting structured lattices to atomic laws lemma structuredLattice_represents_effectLaw {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} (theta : StructuredLatticePoint k dx (effectRadius dz L sigma0)) (htheta : theta.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)) (hsigma : 0 < sigma0) [Nonempty (Fin k)] : RepresentsAtomicLaw (structuredLatticeRealDiagonalization theta htheta hsigma) (toEuclideanLin (theta.V * theta.R.transpose) (toLp 2 theta.weight)) (structuredCorrectedAnchor theta.V theta.R) (GapFreeModulusBridge.asNeutral ({ weight := theta.weight, atom := theta.effect } : AtomicLaw k (effectRadius dz L sigma0))) := by let F := structuredLatticeThinSignalFactorization theta htheta hsigma apply AmbientOperatorBridge.represents_raw_quotientLaw (structuredLatticeRealDiagonalization theta htheta hsigma) (theta.V * theta.R.transpose) theta.weight theta.effect · rfl · exact structuredFeature_transpose_correctedAnchor theta htheta hsigma · intro f hf0 change (F.realDiagonalization theta.effect).applyFunction f = _ rw [realDiagonalization_applyFunction_moorePenrose F theta.effect f hf0] · apply AmbientOperatorBridge.moorePenroseInverse_mul_eq_one_of_injective intro x y hxy have hRpos : 0 < signalMinSingular theta.R := (by positivity : 0 < sigma0 / 2).trans_le htheta.2.2.2.2.1 have hdet := matrix_det_isUnit_of_signalMinSingular_pos theta.R hRpos let V : SignalBasis dx k := ⟨theta.V, htheta.2.2.1⟩ have hgram : theta.V.transpose * theta.V = (1 : RectMatrix k k) := V.transpose_mul_self have hxRt : toEuclideanLin theta.R.transpose x = toEuclideanLin theta.R.transpose y := by have hx' := congrArg (fun z : Euc dx => toEuclideanLin theta.V.transpose z) hxy have hmat : theta.V.transpose * (theta.V * theta.R.transpose) = theta.R.transpose := by rw [← Matrix.mul_assoc, hgram, Matrix.one_mul] simpa [Matrix.toEuclideanLin_apply, Matrix.mulVec_mulVec, hmat] using hx' have hx' := congrArg (fun y : Euc k => toEuclideanLin theta.R⁻¹.transpose y) hxRt have hinv : theta.R⁻¹.transpose * theta.R.transpose = (1 : RectMatrix k k) := by rw [← Matrix.transpose_mul, Matrix.mul_nonsing_inv theta.R hdet, Matrix.transpose_one] simpa [Matrix.toEuclideanLin_apply, Matrix.mulVec_mulVec, hinv] using hx'
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredLattice_represents_effectLaw · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeFunctionalCalculus.lean:362
def signalTupleThinFactorization

A signal frame and a square coordinate factor with a positive singular margin determine the thin factorization used for the exact population tuple. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx :
V :
R :
s :
hs :
0 < s
hR :
signalTupleThinFactorization V R hs hR :
ThinSignalFactorization (V.V * R.transpose)
by have hdet := matrix_det_isUnit_of_signalMinSingular_pos R (hs.trans_le hR) refine { V := V coord := R.transpose coordInv := R⁻¹.transpose factor := rfl coord_mul_inv := ?_ inv_mul_coord := ?_ } · rw [← Matrix.transpose_mul, Matrix.nonsing_inv_mul R hdet, Matrix.transpose_one] · rw [← Matrix.transpose_mul, Matrix.mul_nonsing_inv R hdet, Matrix.transpose_one]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.signalTupleThinFactorization · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeFunctionalCalculus.lean:410
def signalTupleRealDiagonalization

Exact ambient real diagonalization of a population signal tuple. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx :
V :
R :
tau :
Fin k → ℝ
s :
hs :
0 < s
hR :
Nonempty (Fin k)
signalTupleRealDiagonalization V R tau hs hR :
RealDiagonalization (V.V * R⁻¹ * diagonal tau * R * V.V.transpose)
by let F := signalTupleThinFactorization V R hs hR have hop : F.factorOperator tau
= V.V * R⁻¹ * diagonal tau * R * V.V.transpose := by simp only [F, signalTupleThinFactorization, ThinSignalFactorization.factorOperator] rw [Matrix.transpose_transpose, Matrix.transpose_transpose] rw [← hop] exact F.realDiagonalization tau
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.signalTupleRealDiagonalization · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeFunctionalCalculus.lean:427
theorem signalTupleRealDiagonalization_conditionNumber_le

The exact population tuple has condition number at most the same frozen sharp value used for every selected lattice point. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx :
V :
R :
tau :
Fin k → ℝ
L sigma0 :
hk :
2 ≤ k
hL :
1 ≤ L
hsigma :
0 < sigma0
hsigmaMax :
sigma0 ≤ 1
hRmin :
sigma0 ≤ signalMinSingular R
hRnorm :
‖matrixCLM R‖ ≤ sqrt k * L
Nonempty (Fin k)
(signalTupleRealDiagonalization V R tau hsigma hRmin).conditionNumber
≤ 4 * sqrt k * L / sigma0
Proof (Lean source)
lemma signalTupleRealDiagonalization_conditionNumber_le {k dx : ℕ} (V : SignalBasis dx k) (R : RectMatrix k k) (tau : Fin k → ℝ) {L sigma0 : ℝ} (hk : 2 ≤ k) (hL : 1 ≤ L) (hsigma : 0 < sigma0) (hsigmaMax : sigma0 ≤ 1) (hRmin : sigma0 ≤ signalMinSingular R) (hRnorm : ‖matrixCLM R‖ ≤ sqrt k * L) [Nonempty (Fin k)] : (signalTupleRealDiagonalization V R tau hsigma hRmin).conditionNumber ≤ 4 * sqrt k * L / sigma0 := by let F := signalTupleThinFactorization V R hsigma hRmin have hraw := F.realDiagonalization_conditionNumber_le_max tau have hInv := matrix_inv_norm_le_of_signalMinSingular R hsigma hRmin have hInv' : ‖R⁻¹‖ ≤ 1 / sigma0 := by change ‖matrixCLM R⁻¹‖ ≤ _ exact hInv have hOneInv : 1 ≤ 2 / sigma0 := by apply (le_div_iff₀ hsigma).2 linarith have hk1 : (1 : ℝ) ≤ sqrt k := by rw [Real.one_le_sqrt] exact_mod_cast (show 1 ≤ k by omega) have hOneR : 1 ≤ 2 * sqrt k * L := by nlinarith [Real.sqrt_nonneg k] have hRnorm' : ‖R‖ ≤ sqrt k * L := by change ‖matrixCLM R‖ ≤ _ exact hRnorm have hCoordInv : max ‖F.coordInv‖ 1 ≤ 2 / sigma0 := by apply max_le · calc ‖F.coordInv‖ = ‖R⁻¹‖ := by simp [F, signalTupleThinFactorization, ← Matrix.conjTranspose_eq_transpose_of_trivial, Matrix.l2_opNorm_conjTranspose] _ ≤ 1 / sigma0 := hInv' _ ≤ 2 / sigma0 := by apply (div_le_div_iff_of_pos_right hsigma).2 norm_num · exact hOneInv have hCoord : max ‖F.coord‖ 1 ≤ 2 * sqrt k * L := by apply max_le · calc ‖F.coord‖ = ‖R‖ := by simp [F, signalTupleThinFactorization, ← Matrix.conjTranspose_eq_transpose_of_trivial, Matrix.l2_opNorm_conjTranspose] _ ≤ sqrt k * L := hRnorm' _ ≤ 2 * sqrt k * L := by nlinarith [Real.sqrt_nonneg k] · exact hOneR change (F.realDiagonalization tau).conditionNumber ≤ _ calc _ ≤ max ‖F.coordInv‖ 1 * max ‖F.coord‖ 1 := hraw _ ≤ (2 / sigma0) * (2 * sqrt k * L) := by gcongr _ = 4 * sqrt k * L / sigma0 := by ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.signalTupleRealDiagonalization_conditionNumber_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeFunctionalCalculus.lean:440
theorem signalTupleRealDiagonalization_spectrumBound

Support membership of the signal atoms bounds the full ambient spectrum, including the zero eigenvalues on the orthogonal complement. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx :
V :
R :
tau :
Fin k → ℝ
s radius :
hs :
0 < s
hR :
hradius :
0 ≤ radius
htau :
∀ u, tau u ∈ Icc (-radius) radius
Nonempty (Fin k)
(signalTupleRealDiagonalization V R tau hs hR).SpectrumBound radius
Proof (Lean source)
lemma signalTupleRealDiagonalization_spectrumBound {k dx : ℕ} (V : SignalBasis dx k) (R : RectMatrix k k) (tau : Fin k → ℝ) {s radius : ℝ} (hs : 0 < s) (hR : s ≤ signalMinSingular R) (hradius : 0 ≤ radius) (htau : ∀ u, tau u ∈ Icc (-radius) radius) [Nonempty (Fin k)] : (signalTupleRealDiagonalization V R tau hs hR).SpectrumBound radius := by intro i change |ambientEigenvalue V tau i| ≤ radius by_cases hi : i ∈ range V.ambientExtension.signalIndex · obtain ⟨u, rfl⟩ := hi rw [ambientEigenvalue_signal] exact (abs_le).2 (htau u) · rw [ambientEigenvalue_nonsignal V tau i hi, abs_zero] exact hradius
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.signalTupleRealDiagonalization_spectrumBound · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeFunctionalCalculus.lean:494
theorem structuredLatticeRealDiagonalization_spectrumBound

Every selected structured-lattice diagonalizer has its full ambient spectrum in the prescribed effect interval. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 :
theta :
htheta :
theta.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)
hsigma :
0 < sigma0
hradius :
0 ≤ effectRadius dz L sigma0
Nonempty (Fin k)
(structuredLatticeRealDiagonalization theta htheta hsigma).SpectrumBound (effectRadius dz L sigma0)
Proof (Lean source)
lemma structuredLatticeRealDiagonalization_spectrumBound {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} (theta : StructuredLatticePoint k dx (effectRadius dz L sigma0)) (htheta : theta.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)) (hsigma : 0 < sigma0) (hradius : 0 ≤ effectRadius dz L sigma0) [Nonempty (Fin k)] : (structuredLatticeRealDiagonalization theta htheta hsigma).SpectrumBound (effectRadius dz L sigma0) := by intro i change |ambientEigenvalue (structuredLatticeThinSignalFactorization theta htheta hsigma).V theta.effect i| ≤ _ by_cases hi : i ∈ range (structuredLatticeThinSignalFactorization theta htheta hsigma).V.ambientExtension.signalIndex · obtain ⟨u, rfl⟩ := hi rw [ambientEigenvalue_signal] exact (abs_le).2 (htheta.2.2.2.2.2.2.2 u).1 · rw [ambientEigenvalue_nonsignal _ _ i hi, abs_zero] exact hradius
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredLatticeRealDiagonalization_spectrumBound · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeFunctionalCalculus.lean:511
theorem signalTuple_represents_atomicLaw

The exact population tuple represents its labelled atomic law at the factorized mean and the uncorrected first-coordinate anchor. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx :
V :
R :
p tau :
Fin k → ℝ
s :
hs :
0 < s
hR :
hanchor :
mulVec (R * V.V.transpose) (firstBasis dx) = fun _ => 1
Nonempty (Fin k)
RepresentsAtomicLaw (signalTupleRealDiagonalization V R tau hs hR) (toEuclideanLin (V.V * R.transpose) (toLp 2 p)) (toLp 2 (firstBasis dx)) ({ weight := p, atom := tau } : CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw (Fin k))
Proof (Lean source)
lemma signalTuple_represents_atomicLaw {k dx : ℕ} (V : SignalBasis dx k) (R : RectMatrix k k) (p tau : Fin k → ℝ) {s : ℝ} (hs : 0 < s) (hR : s ≤ signalMinSingular R) (hanchor : mulVec (R * V.V.transpose) (firstBasis dx) = fun _ => 1) [Nonempty (Fin k)] : RepresentsAtomicLaw (signalTupleRealDiagonalization V R tau hs hR) (toEuclideanLin (V.V * R.transpose) (toLp 2 p)) (toLp 2 (firstBasis dx)) ({ weight := p, atom := tau } : CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw (Fin k)) := by let F := signalTupleThinFactorization V R hs hR apply AmbientOperatorBridge.represents_raw_quotientLaw (signalTupleRealDiagonalization V R tau hs hR) (V.V * R.transpose) p tau · rfl · simpa [Matrix.transpose_mul] using hanchor · intro f hf0 change (F.realDiagonalization tau).applyFunction f = _ rw [realDiagonalization_applyFunction_moorePenrose F tau f hf0] · apply AmbientOperatorBridge.moorePenroseInverse_mul_eq_one_of_injective intro x y hxy have hdet := matrix_det_isUnit_of_signalMinSingular_pos R (hs.trans_le hR) have hgram : V.V.transpose * V.V = (1 : RectMatrix k k) := V.transpose_mul_self have hxRt : toEuclideanLin R.transpose x = toEuclideanLin R.transpose y := by have hx' := congrArg (fun z : Euc dx => toEuclideanLin V.V.transpose z) hxy have hmat : V.V.transpose * (V.V * R.transpose) = R.transpose := by rw [← Matrix.mul_assoc, hgram, Matrix.one_mul] simpa [Matrix.toEuclideanLin_apply, Matrix.mulVec_mulVec, hmat] using hx' have hx' := congrArg (fun z : Euc k => toEuclideanLin R⁻¹.transpose z) hxRt have hinv : R⁻¹.transpose * R.transpose = (1 : RectMatrix k k) := by rw [← Matrix.transpose_mul, Matrix.mul_nonsing_inv R hdet, Matrix.transpose_one] simpa [Matrix.toEuclideanLin_apply, Matrix.mulVec_mulVec, hinv] using hx'
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.signalTuple_represents_atomicLaw · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeFunctionalCalculus.lean:533
theorem structuredLattice_uncorrectedAnchor_error_le

The uncorrected first-coordinate anchor costs at most the spectral radius times its Euclidean anchor residual. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 delta :
theta :
htheta :
theta.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)
hL :
0 ≤ L
hsigma :
0 < sigma0
Nonempty (Fin k)
f :
ℝ → ℝ
hf :
hf0 :
f 0 = 0
hanchor :
sqrt (∑ u, ((∑ v, theta.R u v * (∑ i, theta.V i v * firstBasis dx i)) - 1) ^ 2)
≤ delta
|({ weight := theta.weight, atom := theta.effect } : CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw (Fin k)).integral f
- anchorEval (toEuclideanLin (theta.V * theta.R.transpose) (toLp 2 theta.weight)) (toLp 2 (firstBasis dx)) ((structuredLatticeRealDiagonalization theta htheta hsigma).applyFunction f)|
effectRadius dz L sigma0 * delta
Proof (Lean source)
lemma structuredLattice_uncorrectedAnchor_error_le {k dx dz n : ℕ} {L pi0 sigma0 delta : ℝ} (theta : StructuredLatticePoint k dx (effectRadius dz L sigma0)) (htheta : theta.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)) (hL : 0 ≤ L) (hsigma : 0 < sigma0) [Nonempty (Fin k)] (f : ℝ → ℝ) (hf : LipschitzWith 1 f) (hf0 : f 0 = 0) (hanchor : sqrt (∑ u, ((∑ v, theta.R u v * (∑ i, theta.V i v * firstBasis dx i)) - 1) ^ 2) ≤ delta) : |({ weight := theta.weight, atom := theta.effect } : CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw (Fin k)).integral f - anchorEval (toEuclideanLin (theta.V * theta.R.transpose) (toLp 2 theta.weight)) (toLp 2 (firstBasis dx)) ((structuredLatticeRealDiagonalization theta htheta hsigma).applyFunction f)| ≤ effectRadius dz L sigma0 * delta := by let radius := effectRadius dz L sigma0 let q : Fin k → ℝ := mulVec (theta.R * theta.V.transpose) (firstBasis dx) let c : Euc k := toLp 2 (fun u => theta.weight u * f (theta.effect u)) let r : Euc k := toLp 2 (fun u => 1 - q u) have hradius : 0 ≤ radius := by dsimp [radius, effectRadius] positivity have hfbound (u : Fin k) : |f (theta.effect u)| ≤ radius := by calc |f (theta.effect u)| = ‖f (theta.effect u) - f 0‖ := by simp [hf0, Real.norm_eq_abs] _ ≤ ‖theta.effect u - 0‖ := by simpa using hf.norm_sub_le (theta.effect u) 0 _ = |theta.effect u| := by simp [Real.norm_eq_abs] _ ≤ radius := by exact abs_le.mpr (theta.lawValid.2.2 u) let p : Euc k := toLp 2 theta.weight have hp : ‖p‖ ≤ 1 := probabilityVector_euc_norm_le_one theta.weight theta.lawValid.1 theta.lawValid.2.1 have hdiag : ‖Matrix.diagonal (f ∘ theta.effect)‖ ≤ radius := by rw [Matrix.l2_opNorm_diagonal, pi_norm_le_iff_of_nonneg hradius] intro u simpa [Function.comp_apply, Real.norm_eq_abs] using hfbound u have hc_eq : c = toEuclideanLin (diagonal (f ∘ theta.effect)) p := by apply PiLp.ext intro u simp [c, p, Matrix.toEuclideanLin_apply, Matrix.mulVec_diagonal, mul_comm] have hc : ‖c‖ ≤ radius := by rw [hc_eq] calc ‖Matrix.toEuclideanLin (diagonal (f ∘ theta.effect)) p‖ ≤ ‖Matrix.diagonal (f ∘ theta.effect)‖ * ‖p‖ := by simpa [Matrix.toEuclideanLin_apply] using Matrix.l2_opNorm_mulVec (diagonal (f ∘ theta.effect)) p _ ≤ radius * 1 := mul_le_mul hdiag hp (norm_nonneg _) hradius _ = radius := mul_one _ have hr : ‖r‖ ≤ delta := by rw [EuclideanSpace.norm_eq] have hsquares : (∑ u, ‖r u‖ ^ 2) = ∑ u, (q u - 1) ^ 2 := by apply Finset.sum_congr rfl intro u _ change |1 - q u| ^ 2 = (q u - 1) ^ 2 rw [sq_abs] ring rw [hsquares] have hq (u : Fin k) : q u = ∑ v, theta.R u v * (∑ i, theta.V i v * firstBasis dx i) := by change mulVec (theta.R * theta.V.transpose) (firstBasis dx) u = _ rw [← Matrix.mulVec_mulVec] simp [mulVec, dotProduct] simpa only [hq] using hanchor rw [structuredLattice_uncorrectedAnchor_error_eq theta htheta hsigma f hf0] change |inner ℝ r c| ≤ radius * delta calc |inner ℝ r c| ≤ ‖r‖ * ‖c‖ := abs_real_inner_le_norm _ _ _ ≤ delta * radius := mul_le_mul hr hc (norm_nonneg _) (le_trans (norm_nonneg _) hr) _ = radius * delta := mul_comm _ _
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredLattice_uncorrectedAnchor_error_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeFunctionalCalculus.lean:644
theorem krPotential_attains_with_normalization Lemma 21 in the paper ↗

Local presentation wrapper for the attaining Kantorovich--Rubinstein potential used by the structured-lattice comparison. It records the normalization and the immediate uniform-bound consequence together with the substrate theorem.

Formal statement
ι κ :
Type*
μ :
CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw ι
ν :
CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw κ
:
μ.Valid
:
ν.Valid
conclusion 1
LipschitzWith 1 (CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.krPotential μ ν)
conclusion 2
CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.krPotential μ ν 0 = 0
conclusion 3
CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.w1 μ ν
= |μ.integral (CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.krPotential μ ν)
- ν.integral (CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.krPotential μ ν)|
conclusion 4
ε :
(∀ f : ℝ → ℝ, LipschitzWith 1 f → f 0 = 0 → |μ.integral f - ν.integral f| ≤ ε)
CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.w1 μ ν ≤ ε
Proof (Lean source)
theorem krPotential_attains_with_normalization {ι κ : Type*} [Fintype ι] [Fintype κ] (μ : CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw ι) (ν : CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw κ) (hμ : μ.Valid) (hν : ν.Valid) : LipschitzWith 1 (CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.krPotential μ ν) ∧ CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.krPotential μ ν 0 = 0 ∧ CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.w1 μ ν = |μ.integral (CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.krPotential μ ν) - ν.integral (CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.krPotential μ ν)| ∧ ∀ ε : ℝ, (∀ f : ℝ → ℝ, LipschitzWith 1 f → f 0 = 0 → |μ.integral f - ν.integral f| ≤ ε) → CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.w1 μ ν ≤ ε := by obtain ⟨hlip, hatt⟩ := CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.krPotential_attains μ ν hμ hν have hzero : CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.krPotential μ ν 0 = 0 := CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.krPotential_zero μ ν refine ⟨hlip, hzero, hatt, ?_⟩ intro ε hε rw [hatt] exact hε _ hlip hzero
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.krPotential_attains_with_normalization · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeFunctionalCalculus.lean:722
theorem selected_structuredLattice_wass1_le

Exact small-error Wasserstein estimate (paper display (102)) for the selected prescribed structured-lattice law. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 :
A :
LatticeEstimator k dx dz n (effectRadius dz L sigma0)
hA :
IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A
sample :
Fin n → Obs dx dz
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hsigma :
0 < sigma0
hsigmaMax :
sigma0 ≤ 1
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
hsmall :
dS (empSummary sample) (obsSummary P) < pi0 * sigma0 ^ 2 / 4
AtomicLaw.LawModulo.wass1 (A.estimate sample) (quotientLaw P hM)
≤ (effectRadius dz L sigma0 + 4 * sqrt k * L * effectRadius dz L sigma0 / sigma0 + L * (16 * sqrt dx * k * L ^ 2 / sigma0 ^ 2)) * structuredLatticePathCoefficient k dx dz L pi0 sigma0 * (dS (empSummary sample) (obsSummary P) + latticeMesh k dx n pi0 sigma0)
Proof (Lean source)
theorem selected_structuredLattice_wass1_le {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (A : LatticeEstimator k dx dz n (effectRadius dz L sigma0)) (hA : IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A) (sample : Fin n → Obs dx dz) (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hpiMax : pi0 ≤ 1 / (2 * k : ℝ)) (hsigma : 0 < sigma0) (hsigmaMax : sigma0 ≤ 1) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (hsmall : dS (empSummary sample) (obsSummary P) < pi0 * sigma0 ^ 2 / 4) : AtomicLaw.LawModulo.wass1 (A.estimate sample) (quotientLaw P hM) ≤ (effectRadius dz L sigma0 + 4 * sqrt k * L * effectRadius dz L sigma0 / sigma0 + L * (16 * sqrt dx * k * L ^ 2 / sigma0 ^ 2)) * structuredLatticePathCoefficient k dx dz L pi0 sigma0 * (dS (empSummary sample) (obsSummary P) + latticeMesh k dx n pi0 sigma0) := by let radius := effectRadius dz L sigma0 let kappa := 4 * sqrt k * L / sigma0 let B := structuredLatticePathCoefficient k dx dz L pi0 sigma0 let eps := dS (empSummary sample) (obsSummary P) + latticeMesh k dx n pi0 sigma0 obtain ⟨theta, htheta, hestimate, hop, hmean, hanchor⟩ := selected_structuredLattice_population_residuals_le P A hA sample hk hkx hkz hL hpi hpiMax hsigma hsigmaMax hM hsmall obtain ⟨V, R, p, tau, hm, hb, hD, hRmin, hRnorm, hp, hpSum, htau, hlaw⟩ := population_structured_tuple_exists P hk hkx hL hpi hsigma hM letI : Nonempty (Fin k) := ⟨⟨0, by omega⟩⟩ let muHat : CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw (Fin k) := ⟨theta.weight, theta.effect⟩ let muPop : CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw (Fin k) := ⟨p, tau⟩ let DHat := structuredLatticeRealDiagonalization theta htheta hsigma let DPop := signalTupleRealDiagonalization V R tau hsigma hRmin let mHat : Euc dx := toEuclideanLin (theta.V * theta.R.transpose) (toLp 2 theta.weight) let mPop : Euc dx := toEuclideanLin (V.V * R.transpose) (toLp 2 p) let e1 : Euc dx := toLp 2 (firstBasis dx) have hradius : 0 ≤ radius := by dsimp [radius, effectRadius]; positivity have hkappa : 0 ≤ kappa := by dsimp [kappa]; positivity have hdx : 0 < dx := by omega have he1 : ‖e1‖ = 1 := by exact AmbientOperatorBridge.norm_firstBasis hdx have hmuHat : muHat.Valid := ⟨theta.lawValid.1, theta.lawValid.2.1⟩ have hmuPop : muPop.Valid := by refine ⟨?_, hpSum⟩ intro u linarith [hp u, hpi] have hcondHat : DHat.conditionNumber ≤ kappa := by exact structuredLatticeRealDiagonalization_conditionNumber_le theta htheta hk hL hsigma hsigmaMax have hcondPop : DPop.conditionNumber ≤ kappa := by exact signalTupleRealDiagonalization_conditionNumber_le V R tau hk hL hsigma hsigmaMax hRmin hRnorm have hspecHat : DHat.SpectrumBound radius := by exact structuredLatticeRealDiagonalization_spectrumBound theta htheta hsigma hradius have hspecPop : DPop.SpectrumBound radius := by exact signalTupleRealDiagonalization_spectrumBound V R tau hsigma hRmin hradius htau have hrepPop : RepresentsAtomicLaw DPop mPop e1 muPop := by exact signalTuple_represents_atomicLaw V R p tau hsigma hRmin hb have hmPop : mPop = toLp 2 (obsSummary P).mX := by apply PiLp.ext intro i simpa [mPop, Matrix.toEuclideanLin_apply] using congrFun hm.symm i have hmHatCoord : mHat = toLp 2 (fun i => ∑ u, theta.V i u * (∑ v, theta.R v u * theta.weight v)) := by apply PiLp.ext intro i change mulVec (theta.V * theta.R.transpose) theta.weight i = _ rw [← Matrix.mulVec_mulVec] simp [mulVec, dotProduct] have hmean' : ‖mHat - mPop‖ ≤ B * eps := by rw [hmHatCoord, hmPop, EuclideanSpace.norm_eq] simpa [B, eps, Real.norm_eq_abs, sq_abs] using hmean have hop' : ‖structuredCandidateOperator theta - (V.V * R⁻¹ * diagonal tau * R * V.V.transpose)‖ ≤ B * eps := by change ‖matrixCLM (structuredCandidateOperator theta - (V.V * R⁻¹ * diagonal tau * R * V.V.transpose))‖ ≤ B * eps simpa [B, eps, hD] using hop have hmPopNorm : ‖mPop‖ ≤ L := by rw [hmPop] exact (AmbientOperatorBridge.model_summary_ambient_bounds P hk hkx hkz hL hpi hpiMax hsigma hsigmaMax hM).2 let f := CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.krPotential muHat muPop have hf : LipschitzWith 1 f := (CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.krPotential_attains muHat muPop hmuHat hmuPop).1 have hf0 : f 0 = 0 := CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.krPotential_zero muHat muPop have hatt : CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.w1 muHat muPop = |muHat.integral f - muPop.integral f| := (CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.krPotential_attains muHat muPop hmuHat hmuPop).2 have hanchorErr : |muHat.integral f - anchorEval mHat e1 (DHat.applyFunction f)| ≤ radius * (B * eps) := by exact structuredLattice_uncorrectedAnchor_error_le theta htheta (le_trans zero_le_one hL) hsigma f hf hf0 (by simpa [B, eps] using hanchor) have hcompare : |anchorEval mHat e1 (DHat.applyFunction f) - anchorEval mPop e1 (DPop.applyFunction f)| ≤ (B * eps) * (kappa * radius) + L * (sqrt dx * kappa * kappa * (B * eps)) := by have hsharp := abs_anchorEval_applyFunction_sub_le_sqrt_dim DHat DPop mHat mPop e1 e1 f hf hf0 hcondHat hcondPop hradius hspecHat hspecPop rw [he1, sub_self, norm_zero, mul_one, mul_zero, add_zero] at hsharp calc _ ≤ ‖mHat - mPop‖ * (kappa * radius) + ‖mPop‖ * (sqrt dx * kappa * kappa * ‖structuredCandidateOperator theta - (V.V * R⁻¹ * diagonal tau * R * V.V.transpose)‖) := by simpa only [mul_one] using hsharp _ ≤ _ := by gcongr have hwraw : CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.w1 muHat muPop ≤ (radius + kappa * radius + L * (sqrt dx * kappa * kappa)) * B * eps := by rw [hatt, hrepPop f hf hf0] calc |muHat.integral f - anchorEval mPop e1 (DPop.applyFunction f)| ≤ |muHat.integral f - anchorEval mHat e1 (DHat.applyFunction f)| + |anchorEval mHat e1 (DHat.applyFunction f) - anchorEval mPop e1 (DPop.applyFunction f)| := by rw [show muHat.integral f - anchorEval mPop e1 (DPop.applyFunction f) = (muHat.integral f - anchorEval mHat e1 (DHat.applyFunction f)) + (anchorEval mHat e1 (DHat.applyFunction f) - anchorEval mPop e1 (DPop.applyFunction f)) by ring] exact abs_add_le _ _ _ ≤ radius * (B * eps) + ((B * eps) * (kappa * radius) + L * (sqrt dx * kappa * kappa * (B * eps))) := add_le_add hanchorErr hcompare _ = _ := by ring rw [hestimate, StructuredLatticePoint.effectLaw, quotientLaw, AtomicLaw.LawModulo.wass1_ofProbabilityLaw] rw [GapFreeModulusBridge.wass1_eq_neutralW1 theta.lawValid (quotientLawRaw_valid P hM)] change CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.w1 muHat (GapFreeModulusBridge.asNeutral (quotientLawRaw P radius)) ≤ _ rw [← hlaw] change CausalSmith.Substrate.CollisionSafeSpectralLaw.AtomicLaw.w1 muHat muPop ≤ _ calc _ ≤ (radius + kappa * radius + L * (sqrt dx * kappa * kappa)) * B * eps := hwraw _ = _ := by dsimp [radius, kappa, B, eps] have hkroot : (sqrt (k : ℝ)) ^ 2 = k := Real.sq_sqrt (by positivity) field_simp [ne_of_gt hsigma] rw [hkroot] ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.selected_structuredLattice_wass1_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeFunctionalCalculus.lean:754
theorem prescribedEstimator_wass1_le

The small- and large-summary-error branches combine into the deterministic all-sample oracle bound with the frozen displayed lattice constant. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 :
A :
LatticeEstimator k dx dz n (effectRadius dz L sigma0)
hA :
IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A
sample :
Fin n → Obs dx dz
hn :
1 ≤ n
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hsigma :
0 < sigma0
hsigmaMax :
sigma0 ≤ 1
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
AtomicLaw.LawModulo.wass1 (A.estimate sample) (quotientLaw P hM)
prescribedLatticeConstant k dx dz L pi0 sigma0 * (dS (empSummary sample) (obsSummary P) + (sqrt n)⁻¹)
Proof (Lean source)
theorem prescribedEstimator_wass1_le {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (A : LatticeEstimator k dx dz n (effectRadius dz L sigma0)) (hA : IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A) (sample : Fin n → Obs dx dz) (hn : 1 ≤ n) (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hpiMax : pi0 ≤ 1 / (2 * k : ℝ)) (hsigma : 0 < sigma0) (hsigmaMax : sigma0 ≤ 1) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) : AtomicLaw.LawModulo.wass1 (A.estimate sample) (quotientLaw P hM) ≤ prescribedLatticeConstant k dx dz L pi0 sigma0 * (dS (empSummary sample) (obsSummary P) + (sqrt n)⁻¹) := by let smallCoeff := (effectRadius dz L sigma0 + 4 * sqrt k * L * effectRadius dz L sigma0 / sigma0 + L * (16 * sqrt dx * k * L ^ 2 / sigma0 ^ 2)) * structuredLatticePathCoefficient k dx dz L pi0 sigma0 let largeCoeff := 8 * effectRadius dz L sigma0 / (pi0 * sigma0 ^ 2) have hmesh := latticeMesh_le_sqrt_inv k dx n pi0 sigma0 hn have hClat0 : 0 ≤ prescribedLatticeConstant k dx dz L pi0 sigma0 := (prescribedLatticeConstant_pos k dx dz L pi0 sigma0 hk hkx hkz hL hpi hsigma).le have hsmallCoeff0 : 0 ≤ smallCoeff := by dsimp [smallCoeff, structuredLatticePathCoefficient, populationOperatorCoefficient, structuredGridCriterionCoefficient, structuredGridOperatorCoefficient, structuredGridMeanCoefficient, structuredGridAnchorCoefficient, structuredGridVConstant, effectRadius] positivity have hsmallCoeff : smallCoeff ≤ prescribedLatticeConstant k dx dz L pi0 sigma0 := by unfold prescribedLatticeConstant exact le_max_right _ _ have hlargeCoeff : largeCoeff ≤ prescribedLatticeConstant k dx dz L pi0 sigma0 := by unfold prescribedLatticeConstant exact le_max_left _ _ by_cases hsmall : dS (empSummary sample) (obsSummary P) < pi0 * sigma0 ^ 2 / 4 · have hw := selected_structuredLattice_wass1_le P A hA sample hk hkx hkz hL hpi hpiMax hsigma hsigmaMax hM hsmall change _ ≤ smallCoeff * (dS (empSummary sample) (obsSummary P) + latticeMesh k dx n pi0 sigma0) at hw calc _ ≤ smallCoeff * (dS (empSummary sample) (obsSummary P) + latticeMesh k dx n pi0 sigma0) := hw _ ≤ smallCoeff * (dS (empSummary sample) (obsSummary P) + (sqrt n)⁻¹) := by gcongr _ ≤ prescribedLatticeConstant k dx dz L pi0 sigma0 * (dS (empSummary sample) (obsSummary P) + (sqrt n)⁻¹) := by apply mul_le_mul_of_nonneg_right hsmallCoeff unfold dS positivity · have hw := prescribedEstimator_wass1_le_of_large_summary_error hk hkz hL hpi hsigma A P hM sample (le_of_not_gt hsmall) change _ ≤ largeCoeff * dS (empSummary sample) (obsSummary P) at hw calc _ ≤ largeCoeff * dS (empSummary sample) (obsSummary P) := hw _ ≤ prescribedLatticeConstant k dx dz L pi0 sigma0 * dS (empSummary sample) (obsSummary P) := by apply mul_le_mul_of_nonneg_right hlargeCoeff unfold dS positivity _ ≤ prescribedLatticeConstant k dx dz L pi0 sigma0 * (dS (empSummary sample) (obsSummary P) + (sqrt n)⁻¹) := by apply mul_le_mul_of_nonneg_left _ hClat0 exact le_add_of_nonneg_right (inv_nonneg.mpr (Real.sqrt_nonneg _))
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.prescribedEstimator_wass1_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeFunctionalCalculus.lean:901
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.StructuredLatticeMeasurability 11 declarations Borel measurability of the hard-threshold lattice criterion

Borel measurability of the hard-threshold lattice criterion

def instMeasurableSpaceRectMatrix

For the row and column dimensions, the measurable-space structure on rectangular matrices is the Borel structure.

Definition (Lean source)
noncomputable local instance {rows cols : ℕ} : MeasurableSpace (RectMatrix rows cols) := borel _
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.instMeasurableSpaceRectMatrix · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeMeasurability.lean:14
theorem instBorelSpaceRectMatrix

For the row and column dimensions, rectangular matrices form a Borel space.

Formal statement
∀ {rows cols : ℕ}, BorelSpace (RectMatrix rows cols)
Proof (Lean source)
local instance {rows cols : ℕ} : BorelSpace (RectMatrix rows cols) := ⟨rfl⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.instBorelSpaceRectMatrix · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeMeasurability.lean:16
theorem instOpensMeasurableSpaceRectMatrix

For the row and column dimensions, open sets of rectangular matrices are measurable.

Formal statement
∀ {rows cols : ℕ}, OpensMeasurableSpace (RectMatrix rows cols)
Proof (Lean source)
local instance {rows cols : ℕ} : OpensMeasurableSpace (RectMatrix rows cols) := ⟨le_rfl⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.instOpensMeasurableSpaceRectMatrix · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeMeasurability.lean:18
theorem instSecondCountableTopologyRectMatrix

For the row and column dimensions, the topology on rectangular matrices is second countable.

Formal statement
∀ {rows cols : ℕ}, SecondCountableTopology (RectMatrix rows cols)
Proof (Lean source)
local instance {rows cols : ℕ} : SecondCountableTopology (RectMatrix rows cols) := matrixCLM_isometry.isUniformInducing.isInducing.secondCountableTopology
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.instSecondCountableTopologyRectMatrix · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeMeasurability.lean:32
theorem thresholdedPenroseInverse_measurable

The genuine SVD hard-thresholded Moore--Penrose inverse is Borel measurable, including at the equality stratum of the convention tau ≤ sigma. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols :
tau :
htau :
0 < tau
Measurable (thresholdedPenroseInverse (rows := rows) (cols := cols) tau)
Proof (Lean source)
lemma thresholdedPenroseInverse_measurable {rows cols : ℕ} {tau : ℝ} (htau : 0 < tau) : Measurable (thresholdedPenroseInverse (rows := rows) (cols := cols) tau) := by apply CausalSmith.Substrate.CollisionSafeSpectralLaw.measurable_of_rationalThresholdApprox_tendsto htau intro A apply (tendsto_add_atTop_iff_nat (f := fun m => CausalSmith.Substrate.CollisionSafeSpectralLaw.rationalThresholdApprox tau m A) (l := nhds (thresholdedPenroseInverse tau A)) 1).mp simpa only [Nat.add_comm] using rationalThresholdApprox_succ_tendsto htau A
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.thresholdedPenroseInverse_measurable · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeMeasurability.lean:374
theorem empiricalCompressedOperator_measurable

Empirical compressed operator measurable: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx dz :
tau :
htau :
0 < tau
Measurable (empiricalCompressedOperator (dx := dx) (dz := dz) tau)
Proof (Lean source)
lemma empiricalCompressedOperator_measurable {dx dz : ℕ} {tau : ℝ} (htau : 0 < tau) : Measurable (empiricalCompressedOperator (dx := dx) (dz := dz) tau) := by have hpinv1 : Measurable (fun s : SummarySpace dx dz => thresholdedPenroseInverse tau s.M1) := (thresholdedPenroseInverse_measurable htau).comp summary_M1_continuous.measurable have hpinv0 : Measurable (fun s : SummarySpace dx dz => thresholdedPenroseInverse tau s.M0) := (thresholdedPenroseInverse_measurable htau).comp summary_M0_continuous.measurable have hmul : Continuous (fun p : RectMatrix dx dz × RectMatrix dz dx => p.1 * p.2) := continuous_fst.matrix_mul continuous_snd have hterm1 : Measurable (fun s : SummarySpace dx dz => thresholdedPenroseInverse tau s.M1 * s.N1) := hmul.measurable2 hpinv1 summary_N1_continuous.measurable have hterm0 : Measurable (fun s : SummarySpace dx dz => thresholdedPenroseInverse tau s.M0 * s.N0) := hmul.measurable2 hpinv0 summary_N0_continuous.measurable have hsub : Continuous (fun p : RectMatrix dx dx × RectMatrix dx dx => p.1 - p.2) := continuous_fst.sub continuous_snd exact hsub.measurable2 hterm1 hterm0
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.empiricalCompressedOperator_measurable · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeMeasurability.lean:415
theorem structuredLatticeCriterion_measurable

Structured lattice criterion measurable: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
radius tau :
htau :
0 < tau
theta :
Measurable (fun s : SummarySpace dx dz => structuredLatticeCriterion tau s theta)
Proof (Lean source)
lemma structuredLatticeCriterion_measurable {k dx dz : ℕ} {radius tau : ℝ} (htau : 0 < tau) (theta : StructuredLatticePoint k dx radius) : Measurable (fun s : SummarySpace dx dz => structuredLatticeCriterion tau s theta) := by have hop : Measurable (fun s : SummarySpace dx dz => ‖matrixCLM (structuredCandidateOperator theta - empiricalCompressedOperator tau s)‖) := by have hsub : Continuous (fun B : RectMatrix dx dx => structuredCandidateOperator theta - B) := by fun_prop exact (continuous_norm.comp (matrixCLM_continuous.comp hsub)).measurable.comp (empiricalCompressedOperator_measurable htau) have hmean : Continuous (fun s : SummarySpace dx dz => sqrt (∑ i, ((∑ u, theta.V i u * (∑ v, theta.R v u * theta.weight v)) - s.mX i) ^ 2)) := by have hm := summary_mX_continuous (dx := dx) (dz := dz) fun_prop have hconstant : Measurable (fun _s : SummarySpace dx dz => sqrt (∑ u, ((∑ v, theta.R u v * (∑ i, theta.V i v * firstBasis dx i)) - 1) ^ 2)) := measurable_const exact (hop.add hmean.measurable).add hconstant
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredLatticeCriterion_measurable · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeMeasurability.lean:438
theorem finite_first_minimizer_measurable_exists

A finite score family with measurable coordinates has a measurable smallest-index minimizer. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
α :
m :
hm :
0 < m
score :
α → Fin m → ℝ
hscore :
∀ i, Measurable fun x => score x i
∃ first : α → Fin m,
conclusion 1
x i :
score x (first x) ≤ score x i
conclusion 2
x i :
score x (first x) = score x i
first x ≤ i
Proof (Lean source)
lemma finite_first_minimizer_measurable_exists {α : Type*} [MeasurableSpace α] {m : ℕ} (hm : 0 < m) (score : α → Fin m → ℝ) (hscore : ∀ i, Measurable fun x => score x i) : ∃ first : α → Fin m, Measurable first ∧ (∀ x i, score x (first x) ≤ score x i) ∧ ∀ x i, score x (first x) = score x i → first x ≤ i := by classical obtain ⟨first, hmin, htie⟩ := finite_first_minimizer_exists hm score have hfiber (j : Fin m) : MeasurableSet {x : α | first x = j} := by have hchar : {x : α | first x = j} = {x : α | ∀ i, score x j ≤ score x i} ∩ {x : α | ∀ i, score x j = score x i → j ≤ i} := by ext x constructor · intro hx simp only [Set.mem_setOf_eq, Set.mem_inter_iff] subst j exact ⟨hmin x, htie x⟩ · rintro ⟨hjmin, hjtie⟩ apply le_antisymm · exact htie x j (le_antisymm (hmin x j) (hjmin (first x))) · exact hjtie (first x) (le_antisymm (hjmin (first x)) (hmin x j)) rw [hchar] apply MeasurableSet.inter · have hInter : MeasurableSet (⋂ i, {x : α | score x j ≤ score x i}) := MeasurableSet.iInter fun i => measurableSet_le (hscore j) (hscore i) simpa [Set.setOf_forall] using hInter · have hInter : MeasurableSet (⋂ i, {x : α | score x j = score x i → j ≤ i}) := by apply MeasurableSet.iInter intro i by_cases hji : j ≤ i · simp [hji] · rw [show {x : α | score x j = score x i → j ≤ i} = {x : α | score x j = score x i}ᶜ by ext x; simp [hji]] exact (measurableSet_eq_fun (hscore j) (hscore i)).compl simpa [Set.setOf_forall] using hInter refine ⟨first, ?_, hmin, htie⟩ intro t _ht rw [show first ⁻¹' t = ⋃ j : t, {x : α | first x = j.1} by ext x; simp] exact MeasurableSet.iUnion fun j => hfiber j
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.finite_first_minimizer_measurable_exists · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeMeasurability.lean:458
theorem structuredLatticeMeasurableSelector_exists

The paper's exhaustive family admits a Borel, lexicographically first criterion minimizer on the five-block summary space. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hsigma :
0 < sigma0
hsigmaMax :
sigma0 ≤ 1
∃ (m : ℕ) (candidate : Fin m → StructuredLatticePoint k dx (effectRadius dz L sigma0)) (first : SummarySpace dx dz → Fin m),
0 < m
conclusion 1
i :
(candidate i).WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)
conclusion 2
θ :
θ.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)
∃ i,
(candidate i).V = θ.V
(candidate i).R = θ.R
(candidate i).weight = θ.weight
(candidate i).effect = θ.effect
conclusion 3
i j :
(candidate i).V = (candidate j).V
(candidate i).R = (candidate j).R
(candidate i).weight = (candidate j).weight
(candidate i).effect = (candidate j).effect
i = j
conclusion 4
i j :
i ≤ j ↔ StructuredLatticePoint.LexLE (candidate i) (candidate j)
conclusion 5
conclusion 6
s i :
structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) s (candidate (first s))
structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) s (candidate i)
conclusion 7
s i :
structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) s (candidate (first s))
= structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) s (candidate i)
first s ≤ i
Proof (Lean source)
theorem structuredLatticeMeasurableSelector_exists {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hpiMax : pi0 ≤ 1 / (2 * k : ℝ)) (hsigma : 0 < sigma0) (hsigmaMax : sigma0 ≤ 1) : ∃ (m : ℕ) (candidate : Fin m → StructuredLatticePoint k dx (effectRadius dz L sigma0)) (first : SummarySpace dx dz → Fin m), 0 < m ∧ (∀ i, (candidate i).WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)) ∧ (∀ θ : StructuredLatticePoint k dx (effectRadius dz L sigma0), θ.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0) → ∃ i, (candidate i).V = θ.V ∧ (candidate i).R = θ.R ∧ (candidate i).weight = θ.weight ∧ (candidate i).effect = θ.effect) ∧ (∀ i j, (candidate i).V = (candidate j).V → (candidate i).R = (candidate j).R → (candidate i).weight = (candidate j).weight → (candidate i).effect = (candidate j).effect → i = j) ∧ (∀ i j, i ≤ j ↔ StructuredLatticePoint.LexLE (candidate i) (candidate j)) ∧ Measurable first ∧ (∀ s i, structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) s (candidate (first s)) ≤ structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) s (candidate i)) ∧ ∀ s i, structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) s (candidate (first s)) = structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) s (candidate i) → first s ≤ i := by classical obtain ⟨m, candidate, _sampleFirst, hm, hwf, hcomplete, hinj, horder, _hmin, _htie⟩ := structuredLatticeSearch_exists hk hkx hkz hL hpi hpiMax hsigma hsigmaMax let tau := pi0 * sigma0 ^ 2 / 2 have htau : 0 < tau := by dsimp [tau] positivity let score : SummarySpace dx dz → Fin m → ℝ := fun s i => structuredLatticeCriterion tau s (candidate i) have hscore : ∀ i, Measurable fun s => score s i := by intro i exact structuredLatticeCriterion_measurable htau (candidate i) obtain ⟨first, hfirst, hfirstMin, hfirstTie⟩ := finite_first_minimizer_measurable_exists hm score hscore exact ⟨m, candidate, first, hm, hwf, hcomplete, hinj, horder, hfirst, hfirstMin, hfirstTie⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredLatticeMeasurableSelector_exists · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeMeasurability.lean:502
theorem structuredLattice_empSummary_measurable

The total empirical five-block summary is measurable, including the empty-arm branch. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
n dx dz :
Proof (Lean source)
lemma structuredLattice_empSummary_measurable {n dx dz : ℕ} : Measurable (@empSummary n dx dz) := by have hc (t : Bool) : Measurable (@armCount n dx dz t) := by unfold armCount simp_rw [Finset.card_filter] apply measurable_sum intro i _hi exact Measurable.ite (measurableSet_eq_fun (measurable_obs_T.comp (measurable_pi_apply i)) measurable_const) measurable_const measurable_const have hm (weighted t : Bool) (a : Fin dz) (b : Fin dx) : Measurable (fun sample : Fin n → Obs dx dz => empiricalArmMatrix weighted t sample a b) := by unfold empiricalArmMatrix apply mul · exact (measurable_const.max ((measurable_from_nat : Measurable fun q : ℕ => (q : ℝ)).comp (hc t))).inv · apply measurable_sum intro i _hi exact Measurable.ite (measurableSet_eq_fun (measurable_obs_T.comp (measurable_pi_apply i)) measurable_const) (by have hX : Measurable (fun sample : Fin n → Obs dx dz => (sample i).X b) := ((measurable_pi_apply b).comp measurable_obs_X).comp (measurable_pi_apply i) have hZ : Measurable (fun sample : Fin n → Obs dx dz => (sample i).Z a) := ((measurable_pi_apply a).comp measurable_obs_Z).comp (measurable_pi_apply i) have hY : Measurable (fun sample : Fin n → Obs dx dz => (sample i).Y) := measurable_obs_Y.comp (measurable_pi_apply i) cases weighted · convert hZ.mul hX using 1 <;> ext sample <;> simp · exact (hY.mul hZ).mul hX) measurable_const let e := summaryRepairSpaceHomeomorph dx dz have he : Measurable (fun sample : Fin n → Obs dx dz => e (empSummary sample)) := by change Measurable (fun sample : Fin n → Obs dx dz => summaryRepairToEuc (empSummary sample)) apply (WithLp.measurable_toLp 2 _).comp apply measurable_pi_lambda intro i rcases i with ⟨b, a, j⟩ | j · fin_cases b · exact hm false false a j · exact hm false true a j · exact hm true false a j · exact hm true true a j · apply mul measurable_const apply measurable_sum intro i _hi exact ((measurable_pi_apply j).comp measurable_obs_X).comp (measurable_pi_apply i) convert e.symm.continuous.measurable.comp he using 1 ext sample exact e.symm_apply_apply (empSummary sample)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredLattice_empSummary_measurable · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeMeasurability.lean:549
theorem structuredLatticeEstimator_exists

The measurable structured search packages into the estimator interface, with the prescribed atom floor and exact exhaustive-search certificate. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hsigma :
0 < sigma0
hsigmaMax :
sigma0 ≤ 1
∃ A : LatticeEstimator k dx dz n (effectRadius dz L sigma0),
IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A
A.atomFloor = pi0
Measurable A.summaryRule
A.estimate = fun sample => A.summaryRule (empSummary sample)
conclusion 1
sample :
AtomicLaw.AtomFloor pi0 (A.estimate sample).representative.1
Proof (Lean source)
theorem structuredLatticeEstimator_exists {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hpiMax : pi0 ≤ 1 / (2 * k : ℝ)) (hsigma : 0 < sigma0) (hsigmaMax : sigma0 ≤ 1) : ∃ A : LatticeEstimator k dx dz n (effectRadius dz L sigma0), IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A ∧ A.atomFloor = pi0 ∧ Measurable A.summaryRule ∧ (A.estimate = fun sample => A.summaryRule (empSummary sample)) ∧ ∀ sample, AtomicLaw.AtomFloor pi0 (A.estimate sample).representative.1 := by classical obtain ⟨m, candidate, first, hm, hwf, hcomplete, hinj, horder, hfirst, hmin, htie⟩ := structuredLatticeMeasurableSelector_exists hk hkx hkz hL hpi hpiMax hsigma hsigmaMax let summaryRule : SummarySpace dx dz → AtomicLaw.LawModulo k (effectRadius dz L sigma0) := fun s => (candidate (first s)).effectLaw have hsummaryRule : Measurable summaryRule := (measurable_of_finite (fun i : Fin m => (candidate i).effectLaw)).comp hfirst let estimate : (Fin n → Obs dx dz) → AtomicLaw.LawModulo k (effectRadius dz L sigma0) := fun sample => summaryRule (empSummary sample) have hestimate : Measurable estimate := hsummaryRule.comp structuredLattice_empSummary_measurable let A : LatticeEstimator k dx dz n (effectRadius dz L sigma0) := { summaryRule := summaryRule summaryRule_measurable := hsummaryRule estimate := estimate measurable := hestimate atomFloor := pi0 atomFloor_valid := fun sample => structuredLatticePoint_atomFloor hk (candidate (first (empSummary sample))) (hwf _) estimate_eq := rfl candidateCount := m } refine ⟨A, ?_, rfl, hsummaryRule, rfl, ?_⟩ · refine ⟨candidate, fun sample => first (empSummary sample), hwf, hcomplete, hinj, horder, ?_, ?_, rfl⟩ · exact fun sample => hmin (empSummary sample) · exact fun sample => htie (empSummary sample) · exact A.atomFloor_valid
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredLatticeEstimator_exists · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeMeasurability.lean:662
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.StructuredLatticeNonempty 2 declarations The exhaustive search is nonempty for every core-domain parameter tuple.

A canonical point in the paper's structured lattice

The exhaustive search is nonempty for every core-domain parameter tuple. The witness uses the first k coordinate vectors, the identity coordinate matrix, zero effects, and an integer-simplex weight vector with the required floor.

theorem structuredLatticeWellFormed_nonempty

The core-domain inequalities guarantee that the prescribed structured lattice is nonempty. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hsigma :
0 < sigma0
hsigmaMax :
sigma0 ≤ 1
Nonempty {θ : StructuredLatticePoint k dx (effectRadius dz L sigma0) // θ.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)}
Proof (Lean source)
theorem structuredLatticeWellFormed_nonempty {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hpiMax : pi0 ≤ 1 / (2 * k : ℝ)) (hsigma : 0 < sigma0) (hsigmaMax : sigma0 ≤ 1) : Nonempty {θ : StructuredLatticePoint k dx (effectRadius dz L sigma0) // θ.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)} := by classical let H := latticeHeight k dx n pi0 sigma0 have hH : 0 < H := by have : 2 * k ≤ H := by dsimp [H, latticeHeight]; omega omega let G := canonicalGridBasis hkx have hG : 1 / 2 ≤ signalMinSingular G := (by norm_num : (1 : ℝ) / 2 ≤ 1).trans (canonicalGridBasis_signalMin (by omega) hkx) let V := prescribedPolarFactor G hG let R : RectMatrix k k := 1 obtain ⟨a, haFloor, haSum⟩ := lattice_floor_numerators (dx := dx) (n := n) (sigma0 := sigma0) hk hpi hpiMax let weight : Fin k → ℝ := fun u => a u / H let effect : Fin k → ℝ := fun _ => 0 have hradius : 0 ≤ effectRadius dz L sigma0 := by unfold effectRadius positivity have hlaw : AtomicLaw.Valid (⟨weight, effect⟩ : AtomicLaw k (effectRadius dz L sigma0)) := by refine ⟨?_, ?_, ?_⟩ · intro u dsimp [weight] positivity · dsimp [weight] rw [← Finset.sum_div] have haSumReal : (∑ i, (a i : ℝ)) = (H : ℝ) := by exact_mod_cast haSum rw [haSumReal] exact div_self (by exact_mod_cast hH.ne') · intro u exact ⟨by simpa [effect] using neg_nonpos.mpr hradius, by simpa [effect] using hradius⟩ let θ : StructuredLatticePoint k dx (effectRadius dz L sigma0) := ⟨G, V, R, weight, effect, hlaw⟩ refine ⟨⟨θ, ?_⟩⟩ dsimp [StructuredLatticePoint.WellFormed] refine ⟨?_, ⟨hG, rfl⟩, ?_, ?_, ?_, ?_, ?_, ?_⟩ · intro i j by_cases hij : i = castLE hkx j · refine ⟨H, ?_, by simp [θ, G, canonicalGridBasis, hij]⟩ simp [θ, G, canonicalGridBasis, hij, latticeMesh, H, hH.ne'] · refine ⟨0, ?_, by simp [θ, G, canonicalGridBasis, hij]⟩ simp [θ, G, canonicalGridBasis, hij] · intro i j have hp := prescribedPolarFactor_transpose_mul_self G hG have hpij := congrArg (fun M : RectMatrix k k => M i j) hp simpa [θ, V, Matrix.mul_apply, Matrix.one_apply] using hpij · intro i j by_cases hij : i = j · refine ⟨H, ?_⟩ simp [θ, R, hij, latticeMesh, H, hH.ne'] · refine ⟨0, ?_⟩ simp [θ, R, hij] · have hident := identity_signalMin (k := k) (by omega) nlinarith · calc ‖matrixCLM θ.R‖ ≤ 1 := by simpa [θ, R] using identity_matrixCLM_norm_le_one (k := k) _ ≤ 2 * sqrt k * L := by have hkreal : (1 : ℝ) ≤ k := by exact_mod_cast (show 1 ≤ k by omega) have hsqrtSq := Real.sq_sqrt (show (0 : ℝ) ≤ k by positivity) have hsqrt : 1 ≤ sqrt k := by nlinarith [Real.sqrt_nonneg (k : ℝ)] have hL0 : (0 : ℝ) ≤ L := le_trans (by norm_num) hL nlinarith [mul_nonneg (Real.sqrt_nonneg k) hL0] · refine ⟨a, ?_, haSum⟩ intro u exact ⟨haFloor u, rfl⟩ · intro u refine ⟨⟨by simpa [θ, effect] using neg_nonpos.mpr hradius, by simpa [θ, effect] using hradius⟩, 0, ?_⟩ simp [θ, effect]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredLatticeWellFormed_nonempty · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeNonempty.lean:110
theorem structuredLatticeSearch_exists

The core domain therefore supplies the exact exhaustive, lex-ordered search and its smallest-index empirical minimizer. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hsigma :
0 < sigma0
hsigmaMax :
sigma0 ≤ 1
∃ (m : ℕ) (candidate : Fin m → StructuredLatticePoint k dx (effectRadius dz L sigma0)) (first : (Fin n → Obs dx dz) → Fin m),
0 < m
conclusion 1
i :
(candidate i).WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)
conclusion 2
θ :
θ.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)
∃ i,
(candidate i).V = θ.V
(candidate i).R = θ.R
(candidate i).weight = θ.weight
(candidate i).effect = θ.effect
conclusion 3
i j :
(candidate i).V = (candidate j).V
(candidate i).R = (candidate j).R
(candidate i).weight = (candidate j).weight
(candidate i).effect = (candidate j).effect
i = j
conclusion 4
i j :
i ≤ j ↔ StructuredLatticePoint.LexLE (candidate i) (candidate j)
conclusion 5
sample i :
structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) (empSummary sample) (candidate (first sample))
structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) (empSummary sample) (candidate i)
conclusion 6
sample i :
structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) (empSummary sample) (candidate (first sample))
= structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) (empSummary sample) (candidate i)
first sample ≤ i
Proof (Lean source)
theorem structuredLatticeSearch_exists {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hpiMax : pi0 ≤ 1 / (2 * k : ℝ)) (hsigma : 0 < sigma0) (hsigmaMax : sigma0 ≤ 1) : ∃ (m : ℕ) (candidate : Fin m → StructuredLatticePoint k dx (effectRadius dz L sigma0)) (first : (Fin n → Obs dx dz) → Fin m), 0 < m ∧ (∀ i, (candidate i).WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)) ∧ (∀ θ : StructuredLatticePoint k dx (effectRadius dz L sigma0), θ.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0) → ∃ i, (candidate i).V = θ.V ∧ (candidate i).R = θ.R ∧ (candidate i).weight = θ.weight ∧ (candidate i).effect = θ.effect) ∧ (∀ i j, (candidate i).V = (candidate j).V → (candidate i).R = (candidate j).R → (candidate i).weight = (candidate j).weight → (candidate i).effect = (candidate j).effect → i = j) ∧ (∀ i j, i ≤ j ↔ StructuredLatticePoint.LexLE (candidate i) (candidate j)) ∧ (∀ sample i, structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) (empSummary sample) (candidate (first sample)) ≤ structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) (empSummary sample) (candidate i)) ∧ ∀ sample i, structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) (empSummary sample) (candidate (first sample)) = structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) (empSummary sample) (candidate i) → first sample ≤ i := by classical obtain ⟨m, candidate, hwf, hcomplete, hinj, horder⟩ := structuredLatticeEnumeration_exists (k := k) (dx := dx) (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0) obtain ⟨θ, hθ⟩ := structuredLatticeWellFormed_nonempty hk hkx hkz hL hpi hpiMax hsigma hsigmaMax obtain ⟨i, _⟩ := hcomplete θ hθ have hm : 0 < m := lt_of_le_of_lt (zero_le i.val) i.isLt let score : (Fin n → Obs dx dz) → Fin m → ℝ := fun sample j => structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) (empSummary sample) (candidate j) obtain ⟨first, hmin, htie⟩ := finite_first_minimizer_exists hm score exact ⟨m, candidate, first, hm, hwf, hcomplete, hinj, horder, hmin, htie⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredLatticeSearch_exists · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeNonempty.lean:188
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.StructuredLatticeOracle 9 declarations Deterministic oracle interfaces for the structured lattice

Deterministic oracle interfaces for the structured lattice

theorem isPrescribedStructuredLattice_selected_criterion_le

Exhaustive minimization compares the selected point with every well-formed lattice point, including points represented by a different harmless grid-basis witness. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 :
A :
LatticeEstimator k dx dz n (effectRadius dz L sigma0)
hA :
IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A
sample :
Fin n → Obs dx dz
theta :
htheta :
theta.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)
∃ thetaHat : StructuredLatticePoint k dx (effectRadius dz L sigma0),
conclusion 1
thetaHat.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)
conclusion 2
A.estimate sample = thetaHat.effectLaw
conclusion 3
structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) (empSummary sample) thetaHat
structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) (empSummary sample) theta
Proof (Lean source)
lemma isPrescribedStructuredLattice_selected_criterion_le {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} (A : LatticeEstimator k dx dz n (effectRadius dz L sigma0)) (hA : IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A) (sample : Fin n → Obs dx dz) (theta : StructuredLatticePoint k dx (effectRadius dz L sigma0)) (htheta : theta.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)) : ∃ thetaHat : StructuredLatticePoint k dx (effectRadius dz L sigma0), thetaHat.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0) ∧ A.estimate sample = thetaHat.effectLaw ∧ structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) (empSummary sample) thetaHat ≤ structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) (empSummary sample) theta := by obtain ⟨candidate, first, hwf, hcomplete, _hinj, _horder, hmin, _htie, hestimate⟩ := hA obtain ⟨i, hV, hR, hweight, heffect⟩ := hcomplete theta htheta refine ⟨candidate (first sample), hwf _, ?_, ?_⟩ · rw [hestimate] · calc structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) (empSummary sample) (candidate (first sample)) ≤ structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) (empSummary sample) (candidate i) := hmin sample i _ = structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) (empSummary sample) theta := by simp only [structuredLatticeCriterion, structuredCandidateOperator] rw [hV, hR, hweight, heffect]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.isPrescribedStructuredLattice_selected_criterion_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeOracle.lean:12
theorem structuredLatticeCriterion_le_of_residuals

The three coordinate/operator residual estimates combine to the displayed grid criterion constant, with no hidden multiplicative loss. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
radius tau q cD cm cb :
s :
theta :
hD :
≤ cD * q
hm :
sqrt (∑ i, ((∑ u, theta.V i u * (∑ v, theta.R v u * theta.weight v)) - s.mX i) ^ 2)
≤ cm * q
hb :
sqrt (∑ u, ((∑ v, theta.R u v * (∑ i, theta.V i v * firstBasis dx i)) - 1) ^ 2)
≤ cb * q
structuredLatticeCriterion tau s theta ≤ (cD + cm + cb) * q
Proof (Lean source)
lemma structuredLatticeCriterion_le_of_residuals {k dx dz : ℕ} {radius tau q cD cm cb : ℝ} (s : SummarySpace dx dz) (theta : StructuredLatticePoint k dx radius) (hD : ‖matrixCLM (structuredCandidateOperator theta - empiricalCompressedOperator tau s)‖ ≤ cD * q) (hm : sqrt (∑ i, ((∑ u, theta.V i u * (∑ v, theta.R v u * theta.weight v)) - s.mX i) ^ 2) ≤ cm * q) (hb : sqrt (∑ u, ((∑ v, theta.R u v * (∑ i, theta.V i v * firstBasis dx i)) - 1) ^ 2) ≤ cb * q) : structuredLatticeCriterion tau s theta ≤ (cD + cm + cb) * q := by unfold structuredLatticeCriterion linarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredLatticeCriterion_le_of_residuals · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeOracle.lean:43
theorem structuredLatticeCriterion_operator_le

Each of the three nonnegative residuals is bounded by the full criterion. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
radius tau :
s :
theta :
Proof (Lean source)
lemma structuredLatticeCriterion_operator_le {k dx dz : ℕ} {radius tau : ℝ} (s : SummarySpace dx dz) (theta : StructuredLatticePoint k dx radius) : ‖matrixCLM (structuredCandidateOperator theta - empiricalCompressedOperator tau s)‖ ≤ structuredLatticeCriterion tau s theta := by unfold structuredLatticeCriterion have hm : 0 ≤ sqrt (∑ i, ((∑ u, theta.V i u * (∑ v, theta.R v u * theta.weight v)) - s.mX i) ^ 2) := Real.sqrt_nonneg _ have hb : 0 ≤ sqrt (∑ u, ((∑ v, theta.R u v * (∑ i, theta.V i v * firstBasis dx i)) - 1) ^ 2) := Real.sqrt_nonneg _ linarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredLatticeCriterion_operator_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeOracle.lean:58
theorem structuredLatticeCriterion_mean_le

Structured lattice criterion mean le: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
radius tau :
s :
theta :
sqrt (∑ i, ((∑ u, theta.V i u * (∑ v, theta.R v u * theta.weight v)) - s.mX i) ^ 2)
Proof (Lean source)
lemma structuredLatticeCriterion_mean_le {k dx dz : ℕ} {radius tau : ℝ} (s : SummarySpace dx dz) (theta : StructuredLatticePoint k dx radius) : sqrt (∑ i, ((∑ u, theta.V i u * (∑ v, theta.R v u * theta.weight v)) - s.mX i) ^ 2) ≤ structuredLatticeCriterion tau s theta := by unfold structuredLatticeCriterion have hop : 0 ≤ ‖matrixCLM (structuredCandidateOperator theta - empiricalCompressedOperator tau s)‖ := norm_nonneg _ have hb : 0 ≤ sqrt (∑ u, ((∑ v, theta.R u v * (∑ i, theta.V i v * firstBasis dx i)) - 1) ^ 2) := Real.sqrt_nonneg _ linarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredLatticeCriterion_mean_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeOracle.lean:71
theorem structuredLatticeCriterion_anchor_le

Structured lattice criterion anchor le: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
radius tau :
s :
theta :
sqrt (∑ u, ((∑ v, theta.R u v * (∑ i, theta.V i v * firstBasis dx i)) - 1) ^ 2)
Proof (Lean source)
lemma structuredLatticeCriterion_anchor_le {k dx dz : ℕ} {radius tau : ℝ} (s : SummarySpace dx dz) (theta : StructuredLatticePoint k dx radius) : sqrt (∑ u, ((∑ v, theta.R u v * (∑ i, theta.V i v * firstBasis dx i)) - 1) ^ 2) ≤ structuredLatticeCriterion tau s theta := by unfold structuredLatticeCriterion have hop : 0 ≤ ‖matrixCLM (structuredCandidateOperator theta - empiricalCompressedOperator tau s)‖ := norm_nonneg _ have hm : 0 ≤ sqrt (∑ i, ((∑ u, theta.V i u * (∑ v, theta.R v u * theta.weight v)) - s.mX i) ^ 2) := Real.sqrt_nonneg _ linarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredLatticeCriterion_anchor_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeOracle.lean:85
theorem isPrescribedStructuredLattice_selected_criterion_le_grid

Once a rounded well-formed comparator has the three frozen residual bounds at the empirical summary, exhaustive minimization transfers their exact c_grid sum to the selected point. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 cD cm cb q :
A :
LatticeEstimator k dx dz n (effectRadius dz L sigma0)
hA :
IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A
sample :
Fin n → Obs dx dz
theta :
htheta :
theta.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)
hD :
‖matrixCLM (structuredCandidateOperator theta - empiricalCompressedOperator (pi0 * sigma0 ^ 2 / 2) (empSummary sample))‖
≤ cD * q
hm :
sqrt (∑ i, ((∑ u, theta.V i u * (∑ v, theta.R v u * theta.weight v)) - (empSummary sample).mX i) ^ 2)
≤ cm * q
hb :
sqrt (∑ u, ((∑ v, theta.R u v * (∑ i, theta.V i v * firstBasis dx i)) - 1) ^ 2)
≤ cb * q
∃ thetaHat : StructuredLatticePoint k dx (effectRadius dz L sigma0),
conclusion 1
thetaHat.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)
conclusion 2
A.estimate sample = thetaHat.effectLaw
conclusion 3
structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) (empSummary sample) thetaHat
≤ (cD + cm + cb) * q
Proof (Lean source)
lemma isPrescribedStructuredLattice_selected_criterion_le_grid {k dx dz n : ℕ} {L pi0 sigma0 cD cm cb q : ℝ} (A : LatticeEstimator k dx dz n (effectRadius dz L sigma0)) (hA : IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A) (sample : Fin n → Obs dx dz) (theta : StructuredLatticePoint k dx (effectRadius dz L sigma0)) (htheta : theta.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)) (hD : ‖matrixCLM (structuredCandidateOperator theta - empiricalCompressedOperator (pi0 * sigma0 ^ 2 / 2) (empSummary sample))‖ ≤ cD * q) (hm : sqrt (∑ i, ((∑ u, theta.V i u * (∑ v, theta.R v u * theta.weight v)) - (empSummary sample).mX i) ^ 2) ≤ cm * q) (hb : sqrt (∑ u, ((∑ v, theta.R u v * (∑ i, theta.V i v * firstBasis dx i)) - 1) ^ 2) ≤ cb * q) : ∃ thetaHat : StructuredLatticePoint k dx (effectRadius dz L sigma0), thetaHat.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0) ∧ A.estimate sample = thetaHat.effectLaw ∧ structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) (empSummary sample) thetaHat ≤ (cD + cm + cb) * q := by obtain ⟨thetaHat, hthetaHat, hestimate, hmin⟩ := isPrescribedStructuredLattice_selected_criterion_le A hA sample theta htheta refine ⟨thetaHat, hthetaHat, hestimate, hmin.trans ?_⟩ exact structuredLatticeCriterion_le_of_residuals (empSummary sample) theta hD hm hb
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.isPrescribedStructuredLattice_selected_criterion_le_grid · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeOracle.lean:100
theorem latticeMesh_le_sqrt_inv

The mesh is no larger than the nominal root-n scale. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx n :
pi0 sigma0 :
hn :
1 ≤ n
latticeMesh k dx n pi0 sigma0 ≤ (sqrt n)⁻¹
Proof (Lean source)
lemma latticeMesh_le_sqrt_inv (k dx n : ℕ) (pi0 sigma0 : ℝ) (hn : 1 ≤ n) : latticeMesh k dx n pi0 sigma0 ≤ (sqrt n)⁻¹ := by unfold latticeMesh latticeHeight have hsqrt : 0 < sqrt n := Real.sqrt_pos.2 (by exact_mod_cast (by omega : 0 < n)) have hceil : 1 ≤ ⌈Real.sqrt n⌉₊ := by have hsqrtOne : (1 : ℝ) ≤ sqrt n := Real.one_le_sqrt.mpr (by exact_mod_cast hn) exact_mod_cast (hsqrtOne.trans (Nat.le_ceil (sqrt n))) have hheight : (0 : ℝ) < (⌈Real.sqrt n⌉₊ + ⌈pi0⁻¹⌉₊ + 2 * k + ⌈4 * sqrt (dx * k)⌉₊ + ⌈2 * k / sigma0⌉₊ : ℕ) := by exact_mod_cast (by omega : 0 < ⌈Real.sqrt n⌉₊ + ⌈pi0⁻¹⌉₊ + 2 * k + ⌈4 * sqrt (dx * k)⌉₊ + ⌈2 * k / sigma0⌉₊) apply (inv_le_inv₀ hheight hsqrt).2 calc sqrt n ≤ (⌈Real.sqrt n⌉₊ : ℝ) := Nat.le_ceil _ _ ≤ (⌈Real.sqrt n⌉₊ + ⌈pi0⁻¹⌉₊ + 2 * k + ⌈4 * sqrt (dx * k)⌉₊ + ⌈2 * k / sigma0⌉₊ : ℕ) := by exact_mod_cast (by omega : ⌈Real.sqrt n⌉₊ ≤ ⌈Real.sqrt n⌉₊ + ⌈pi0⁻¹⌉₊ + 2 * k + ⌈4 * sqrt (dx * k)⌉₊ + ⌈2 * k / sigma0⌉₊)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.latticeMesh_le_sqrt_inv · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeOracle.lean:127
theorem wass1_le_two_radius

Two probability laws supported in the same radius interval are at Wasserstein distance at most the interval diameter. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius :
hradius :
0 ≤ radius
nu xi :
AtomicLaw.LawModulo k radius
nu.wass1 xi ≤ 2 * radius
Proof (Lean source)
lemma AtomicLaw.LawModulo.wass1_le_two_radius {k : ℕ} {radius : ℝ} (hradius : 0 ≤ radius) (nu xi : AtomicLaw.LawModulo k radius) : nu.wass1 xi ≤ 2 * radius := by let gamma : AtomicLaw.TransportPlan nu.representative.1 xi.representative.1 := { mass := fun i j => nu.representative.1.weight i * xi.representative.1.weight j nonneg := fun i j => mul_nonneg (nu.representative.2.1 i) (xi.representative.2.1 j) fst_marginal := by intro i rw [← Finset.mul_sum, xi.representative.2.2.1, mul_one] snd_marginal := by intro j rw [← Finset.sum_mul, nu.representative.2.2.1, one_mul] } calc nu.wass1 xi ≤ AtomicLaw.transportCost gamma := AtomicLaw.wass1_le_of_plan gamma _ ≤ ∑ i, ∑ j, gamma.mass i j * (2 * radius) := by unfold AtomicLaw.transportCost apply Finset.sum_le_sum intro i _hi apply Finset.sum_le_sum intro j _hj apply mul_le_mul_of_nonneg_left _ (gamma.nonneg i j) have hi := nu.representative.2.2.2 i have hj := xi.representative.2.2.2 j have hiL : -radius ≤ nu.representative.1.atom i := hi.1 have hiU : nu.representative.1.atom i ≤ radius := hi.2 have hjL : -radius ≤ xi.representative.1.atom j := hj.1 have hjU : xi.representative.1.atom j ≤ radius := hj.2 exact abs_sub_le_iff.mpr ⟨by linarith, by linarith⟩ _ = 2 * radius := by simp only [gamma, ← Finset.mul_sum, xi.representative.2.2.1, mul_one, ← Finset.sum_mul, nu.representative.2.2.1, one_mul]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.LawModulo.wass1_le_two_radius · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeOracle.lean:150
theorem prescribedEstimator_wass1_le_of_large_summary_error

The large-summary-error branch of the deterministic oracle inequality. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 :
hk :
2 ≤ k
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hsigma :
0 < sigma0
A :
LatticeEstimator k dx dz n (effectRadius dz L sigma0)
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
sample :
Fin n → Obs dx dz
he :
pi0 * sigma0 ^ 2 / 4 ≤ dS (empSummary sample) (obsSummary P)
AtomicLaw.LawModulo.wass1 (A.estimate sample) (quotientLaw P hM)
≤ (8 * effectRadius dz L sigma0 / (pi0 * sigma0 ^ 2)) * dS (empSummary sample) (obsSummary P)
Proof (Lean source)
lemma prescribedEstimator_wass1_le_of_large_summary_error {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} (hk : 2 ≤ k) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hsigma : 0 < sigma0) (A : LatticeEstimator k dx dz n (effectRadius dz L sigma0)) (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (sample : Fin n → Obs dx dz) (he : pi0 * sigma0 ^ 2 / 4 ≤ dS (empSummary sample) (obsSummary P)) : AtomicLaw.LawModulo.wass1 (A.estimate sample) (quotientLaw P hM) ≤ (8 * effectRadius dz L sigma0 / (pi0 * sigma0 ^ 2)) * dS (empSummary sample) (obsSummary P) := by have hradius : 0 ≤ effectRadius dz L sigma0 := by unfold effectRadius have hdz : 0 < dz := lt_of_lt_of_le (by omega : 0 < k) hkz positivity have hdiam := AtomicLaw.LawModulo.wass1_le_two_radius hradius (A.estimate sample) (quotientLaw P hM) have hs0 : 0 < pi0 * sigma0 ^ 2 := mul_pos hpi (sq_pos_of_pos hsigma) calc AtomicLaw.LawModulo.wass1 (A.estimate sample) (quotientLaw P hM) ≤ 2 * effectRadius dz L sigma0 := hdiam _ ≤ (8 * effectRadius dz L sigma0 / (pi0 * sigma0 ^ 2)) * dS (empSummary sample) (obsSummary P) := by have hcoeff : 0 ≤ 8 * effectRadius dz L sigma0 / (pi0 * sigma0 ^ 2) := by positivity calc 2 * effectRadius dz L sigma0 = (8 * effectRadius dz L sigma0 / (pi0 * sigma0 ^ 2)) * (pi0 * sigma0 ^ 2 / 4) := by field_simp; ring _ ≤ (8 * effectRadius dz L sigma0 / (pi0 * sigma0 ^ 2)) * dS (empSummary sample) (obsSummary P) := mul_le_mul_of_nonneg_left he hcoeff
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.prescribedEstimator_wass1_le_of_large_summary_error · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeOracle.lean:184
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.StructuredLatticePolar 2 declarations Stability of the prescribed polar factor

Stability of the prescribed polar factor

theorem prescribedPolarFactor_sub_signalBasis_norm_le

The prescribed polar factor is Lipschitz at an orthonormal basis. The factor 2 is stronger than the factor 4 used in the frozen comparator estimate. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
V :
G :
hG :
1 / 2 ≤ signalMinSingular G
e :
hclose :
‖matrixCLM (G - V.V)‖ ≤ e
‖matrixCLM (prescribedPolarFactor G hG - V.V)‖ ≤ 2 * e
Proof (Lean source)
lemma prescribedPolarFactor_sub_signalBasis_norm_le {dx k : ℕ} (V : SignalBasis dx k) (G : RectMatrix dx k) (hG : 1 / 2 ≤ signalMinSingular G) {e : ℝ} (hclose : ‖matrixCLM (G - V.V)‖ ≤ e) : ‖matrixCLM (prescribedPolarFactor G hG - V.V)‖ ≤ 2 * e := by classical let H := inverseGramSqrt G hG let gram := G.transpose * G let P := prescribedPolarFactor G hG let S := gram * H have hpos : 0 < signalMinSingular G := lt_of_lt_of_le (by norm_num) hG have hinj := publishedMomentIdentity_injective_of_signalMinSingular_pos G hpos have hdet : IsUnit gram.det := by exact publishedMomentIdentity_gram_det_isUnit_of_injective G hinj have hHpsd : H.PosSemidef := (inverseGramSqrt_spec G hG).1 have hHsq : H * H = gram⁻¹ := (inverseGramSqrt_spec G hG).2 have hgram_inv : gram * gram⁻¹ = 1 := Matrix.mul_nonsing_inv gram hdet have hinv_gram : gram⁻¹ * gram = 1 := Matrix.nonsing_inv_mul gram hdet have hleft : (gram * H) * H = 1 := by rw [Matrix.mul_assoc, hHsq, hgram_inv] have hright : H * (H * gram) = 1 := by rw [← Matrix.mul_assoc, hHsq, hinv_gram] have hcomm : gram * H = H * gram := by calc gram * H = (gram * H) * 1 := by rw [Matrix.mul_one] _ = (gram * H) * (H * (H * gram)) := by rw [hright] _ = ((gram * H) * H) * (H * gram) := by simp only [Matrix.mul_assoc] _ = H * gram := by rw [hleft, Matrix.one_mul] have hmiddle : H * gram * H = 1 := by calc H * gram * H = H * (gram * H) := by rw [Matrix.mul_assoc] _ = H * (H * gram) := by rw [hcomm] _ = (H * H) * gram := by rw [Matrix.mul_assoc] _ = gram⁻¹ * gram := by rw [hHsq] _ = 1 := hinv_gram have hgramPsd : gram.PosSemidef := by dsimp [gram] rw [← Matrix.conjTranspose_eq_transpose_of_trivial G] exact Matrix.posSemidef_conjTranspose_mul_self G have hSpsd : S.PosSemidef := by have hSinv : S = H⁻¹ := by exact hcomm.trans (Matrix.inv_eq_left_inv hmiddle).symm rw [hSinv] exact hHpsd.inv have hPS : P * S = G := by change (G * H) * (gram * H) = G calc (G * H) * (gram * H) = G * (H * gram * H) := by simp only [Matrix.mul_assoc] _ = G * (1 : RectMatrix k k) := by rw [hmiddle] _ = G := by rw [Matrix.mul_one] have hPorth : P.transpose * P = 1 := by exact prescribedPolarFactor_transpose_mul_self G hG let VP : SignalBasis dx k := ⟨P, fun i j => by have hij := congr_fun (congr_fun hPorth i) j simpa [Matrix.mul_apply, Matrix.one_apply] using hij⟩ have hHerm : S.IsHermitian := hSpsd.isHermitian let b := hHerm.eigenvectorBasis have heig_abs (i : Fin k) : |hHerm.eigenvalues i - 1| ≤ e := by let x : Euc k := b i have hxnorm : ‖x‖ = 1 := b.orthonormal.1 i have hlam0 : 0 ≤ hHerm.eigenvalues i := by simpa only [hHerm] using hSpsd.eigenvalues_nonneg i have hSx : toEuclideanLin S x = hHerm.eigenvalues i • x := by apply PiLp.ext intro j simpa [x, b, Matrix.toEuclideanLin_apply] using congr_fun (hHerm.mulVec_eigenvectorBasis i) j have hGnorm : ‖Matrix.toEuclideanLin G x‖ = hHerm.eigenvalues i := by calc ‖Matrix.toEuclideanLin G x‖ = ‖Matrix.toEuclideanLin P (toEuclideanLin S x)‖ := by rw [← hPS] simp [Matrix.toEuclideanLin_apply, Matrix.mulVec_mulVec] _ = ‖Matrix.toEuclideanLin S x‖ := by have hn := (signalBasisLinearIsometry VP).norm_map (toEuclideanLin S x) simpa [VP, signalBasisLinearIsometry] using hn _ = ‖hHerm.eigenvalues i • x‖ := by rw [hSx] _ = hHerm.eigenvalues i := by rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg hlam0, hxnorm, mul_one] have hVnorm : ‖Matrix.toEuclideanLin V.V x‖ = 1 := by have hn := (signalBasisLinearIsometry V).norm_map x simpa [signalBasisLinearIsometry, hxnorm] using hn calc |hHerm.eigenvalues i - 1| = |‖Matrix.toEuclideanLin G x‖ - ‖Matrix.toEuclideanLin V.V x‖| := by rw [hGnorm, hVnorm] _ ≤ ‖Matrix.toEuclideanLin G x - toEuclideanLin V.V x‖ := abs_norm_sub_norm_le _ _ _ = ‖matrixCLM (G - V.V) x‖ := by congr 1 simp [matrixCLM, Matrix.toEuclideanLin_apply] _ ≤ ‖matrixCLM (G - V.V)‖ * ‖x‖ := (matrixCLM (G - V.V)).le_opNorm x _ ≤ e := by rw [hxnorm, mul_one]; exact hclose have hSsub : ‖matrixCLM (S - 1)‖ ≤ e := by have hspectral := hHerm.spectral_theorem let U := hHerm.eigenvectorUnitary have hconj : S - 1 = (U : RectMatrix k k) * diagonal (fun i => hHerm.eigenvalues i - 1) * star (U : RectMatrix k k) := by calc S - 1 = ((Unitary.conjStarAlgAut ℝ (RectMatrix k k)) U) (diagonal (RCLike.ofReal ∘ hHerm.eigenvalues)) - 1 := by exact congrArg (fun A : RectMatrix k k => A - 1) hspectral _ = (U : RectMatrix k k) * diagonal (fun i => hHerm.eigenvalues i - 1) * star (U : RectMatrix k k) := by rw [Unitary.conjStarAlgAut_apply] have hUstar : (U : RectMatrix k k) * star (U : RectMatrix k k) = 1 := Unitary.coe_mul_star_self U rw [show (1 : RectMatrix k k) = (U : RectMatrix k k) * 1 * star (U : RectMatrix k k) by rw [Matrix.mul_one, hUstar]] rw [← Matrix.sub_mul, ← Matrix.mul_sub] congr 2 ext i j by_cases hij : i = j · subst j simp · simp [diagonal, hij] change ‖S - 1‖ ≤ e rw [hconj] calc ‖(U : RectMatrix k k) * diagonal (fun i => hHerm.eigenvalues i - 1) * star (U : RectMatrix k k)‖ = ‖(U : RectMatrix k k) * diagonal (fun i => hHerm.eigenvalues i - 1)‖ := by simpa using CStarRing.norm_mul_coe_unitary ((U : RectMatrix k k) * diagonal (fun i => hHerm.eigenvalues i - 1)) (star U) _ = ‖Matrix.diagonal (fun i => hHerm.eigenvalues i - 1)‖ := by exact CStarRing.norm_coe_unitary_mul U _ _ = ‖fun i => hHerm.eigenvalues i - 1‖ := Matrix.l2_opNorm_diagonal _ _ ≤ e := by apply (pi_norm_le_iff_of_nonneg (le_trans (norm_nonneg _) hclose)).2 intro i simpa [Real.norm_eq_abs] using heig_abs i have hPG : ‖matrixCLM (P - G)‖ ≤ e := by have hdiff : P - G = P * (1 - S) := by rw [Matrix.mul_sub, Matrix.mul_one, hPS] rw [hdiff] apply le_trans (Matrix.l2_opNorm_mul _ _) have hPnorm : ‖P‖ ≤ 1 := by apply ContinuousLinearMap.opNorm_le_bound _ (by norm_num) intro x have hn := (signalBasisLinearIsometry VP).norm_map x simpa [VP, signalBasisLinearIsometry] using hn.le calc ‖P‖ * ‖1 - S‖ ≤ 1 * ‖1 - S‖ := mul_le_mul_of_nonneg_right hPnorm (norm_nonneg _) _ = ‖S - 1‖ := by rw [one_mul, norm_sub_rev] _ ≤ e := hSsub have hdecomp : P - V.V = (P - G) + (G - V.V) := by abel rw [show prescribedPolarFactor G hG = P by rfl, hdecomp] calc ‖matrixCLM ((P - G) + (G - V.V))‖ ≤ ‖matrixCLM (P - G)‖ + ‖matrixCLM (G - V.V)‖ := by change ‖(P - G) + (G - V.V)‖ ≤ ‖P - G‖ + ‖G - V.V‖ exact norm_add_le _ _ _ ≤ e + e := add_le_add hPG hclose _ = 2 * e := by ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.prescribedPolarFactor_sub_signalBasis_norm_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePolar.lean:11
theorem exists_rounded_prescribedPolarFactor

The rounded grid and its prescribed polar factor satisfy the exact cV = 4 * sqrt (dx*k) comparator bound used in the frozen proof. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k H :
V :
hk :
0 < k
hH :
0 < H
hmesh :
sqrt (dx * k) * (H : ℝ)⁻¹ ≤ 1 / 4
∃ (G : RectMatrix dx k) (hG : 1 / 2 ≤ signalMinSingular G),
conclusion 1
i j :
∃ z : ℤ,
G i j = (H : ℝ)⁻¹ * z
|G i j| ≤ 1
conclusion 2
‖matrixCLM (G - V.V)‖ ≤ sqrt (dx * k) * (H : ℝ)⁻¹
conclusion 3
‖matrixCLM (prescribedPolarFactor G hG - V.V)‖ ≤ 4 * sqrt (dx * k) * (H : ℝ)⁻¹
Proof (Lean source)
lemma SignalBasis.exists_rounded_prescribedPolarFactor {dx k H : ℕ} (V : SignalBasis dx k) (hk : 0 < k) (hH : 0 < H) (hmesh : sqrt (dx * k) * (H : ℝ)⁻¹ ≤ 1 / 4) : ∃ (G : RectMatrix dx k) (hG : 1 / 2 ≤ signalMinSingular G), (∀ i j, ∃ z : ℤ, G i j = (H : ℝ)⁻¹ * z ∧ |G i j| ≤ 1) ∧ ‖matrixCLM (G - V.V)‖ ≤ sqrt (dx * k) * (H : ℝ)⁻¹ ∧ ‖matrixCLM (prescribedPolarFactor G hG - V.V)‖ ≤ 4 * sqrt (dx * k) * (H : ℝ)⁻¹ := by obtain ⟨G, hgrid, hclose, hG⟩ := V.exists_rounded_gridBasis hk hH hmesh refine ⟨G, hG, hgrid, hclose, ?_⟩ have hp := prescribedPolarFactor_sub_signalBasis_norm_le V G hG hclose have hq : 0 ≤ sqrt (dx * k) * (H : ℝ)⁻¹ := by positivity calc ‖matrixCLM (prescribedPolarFactor G hG - V.V)‖ ≤ 2 * (sqrt (dx * k) * (H : ℝ)⁻¹) := hp _ ≤ 4 * sqrt (dx * k) * (H : ℝ)⁻¹ := by nlinarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.SignalBasis.exists_rounded_prescribedPolarFactor · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePolar.lean:175
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.StructuredLatticePopulation 36 declarations Population tuple and ideal-to-summary residual bridges

Population tuple and ideal-to-summary residual bridges

def singularSystemRetainedSVD

The first r positive directions of the paper-local singular system, packaged for the neutral retained-SVD substrate. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
rows cols r :
A :
RectMatrix rows cols
hrc :
r ≤ cols
hpos :
∀ a : Fin r, 0 < (singularSystem A).sigma (castLE hrc a)
singularSystemRetainedSVD A hrc hpos :
RetainedSVD r rows cols
clause 1
sigma a := (singularSystem A).sigma (castLE hrc a)
clause 2
left i a := (singularSystem A).left (castLE hrc a) i
clause 3
right a j := (singularSystem A).right (castLE hrc a) j
clause 4
sigma_pos := hpos
clause 5
left_orthonormal := by ext a b change (∑ i, (singularSystem A).left (castLE hrc a) i * (singularSystem A).left (castLE hrc b) i)
= if a = b then 1 else 0 simpa using (singularSystem A).left_orthonormal_of_pos (castLE hrc a) (castLE hrc b) (hpos a) (hpos b)
clause 6
right_orthonormal := by ext a b change (∑ i, (singularSystem A).right (castLE hrc a) i * (singularSystem A).right (castLE hrc b) i)
= if a = b then 1 else 0 simpa using (singularSystem A).right_orthonormal (castLE hrc a) (castLE hrc b)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.singularSystemRetainedSVD · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:19
def thresholdSingularTruncation

Matrix obtained by retaining exactly the singular directions at or above a threshold. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
rows cols :
threshold :
A :
RectMatrix rows cols
thresholdSingularTruncation threshold A :
RectMatrix rows cols
fun i j
=> ∑ x, if threshold ≤ (singularSystem A).sigma x then (singularSystem A).sigma x * (singularSystem A).left x i * (singularSystem A).right x j else 0
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.thresholdSingularTruncation · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:43
theorem thresholdSingularTruncation_eq_retained

Threshold singular truncation eq retained: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols r :
threshold :
A :
RectMatrix rows cols
hrc :
r ≤ cols
hthreshold :
0 < threshold
hrec :
= (singularSystemRetainedSVD A hrc (fun a => hthreshold.trans_le (by simpa [(singularSystem A).sigma_eq] using hrec.1 (a : ℕ) a.isLt))).matrix
Proof (Lean source)
lemma thresholdSingularTruncation_eq_retained {rows cols r : ℕ} {threshold : ℝ} (A : RectMatrix rows cols) (hrc : r ≤ cols) (hthreshold : 0 < threshold) (hrec : ThresholdRecoversMatrixDimension r threshold A) : thresholdSingularTruncation threshold A = (singularSystemRetainedSVD A hrc (fun a => hthreshold.trans_le (by simpa [(singularSystem A).sigma_eq] using hrec.1 (a : ℕ) a.isLt))).matrix := by let hpos : ∀ a : Fin r, 0 < (singularSystem A).sigma (castLE hrc a) := fun a => hthreshold.trans_le (by simpa [(singularSystem A).sigma_eq] using hrec.1 (a : ℕ) a.isLt) let S := singularSystemRetainedSVD A hrc hpos ext i j have hsel (x : Fin cols) : threshold ≤ (singularSystem A).sigma x ↔ (x : ℕ) < r := by rw [(singularSystem A).sigma_eq] exact ⟨fun hx => by by_contra hn; exact (not_le_of_gt (hrec.2 x (by omega))) hx, hrec.1 x⟩ change (∑ x, if threshold ≤ (singularSystem A).sigma x then (singularSystem A).sigma x * (singularSystem A).left x i * (singularSystem A).right x j else 0) = _ rw [S.matrix_apply] simp only [S, singularSystemRetainedSVD] simp_rw [hsel] rw [← Finset.sum_filter] symm apply Finset.sum_bij (fun a _ => castLE hrc a) · intro a _; simp · intro a _ b _ hab; exact Fin.castLE_injective hrc hab · intro b hb simp only [mem_filter, Finset.mem_univ, true_and] at hb let a : Fin r := ⟨b, hb⟩ exact ⟨a, Finset.mem_univ a, Fin.ext rfl⟩ · intro a _ simp_all only [mul_ite, mul_zero, Finset.sum_ite_eq', Finset.mem_univ, if_true, mul_eq_mul_right_iff]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.thresholdSingularTruncation_eq_retained · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:50
theorem thresholdSingularTruncation_error_le_of_discardedBound

An upper bound on every discarded singular coefficient controls the truncation error. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols :
threshold bound :
A :
RectMatrix rows cols
hthreshold :
0 < threshold
hbound0 :
0 ≤ bound
hdiscard :
∀ a
if
¬ threshold ≤ (singularSystem A).sigma a
then
(singularSystem A).sigma a ≤ bound
‖matrixCLM (A - thresholdSingularTruncation threshold A)‖ ≤ bound
Proof (Lean source)
lemma thresholdSingularTruncation_error_le_of_discardedBound {rows cols : ℕ} {threshold bound : ℝ} (A : RectMatrix rows cols) (hthreshold : 0 < threshold) (hbound0 : 0 ≤ bound) (hdiscard : ∀ a, ¬ threshold ≤ (singularSystem A).sigma a → (singularSystem A).sigma a ≤ bound) : ‖matrixCLM (A - thresholdSingularTruncation threshold A)‖ ≤ bound := by let ss := singularSystem A let active : Type := {a : Fin cols // ¬ threshold ≤ ss.sigma a ∧ 0 < ss.sigma a} let u : active → Euc rows := fun a => toLp 2 (ss.left a) let v : Fin cols → Euc cols := fun a => toLp 2 (ss.right a) have hu : Orthonormal ℝ u := by rw [orthonormal_iff_ite] intro a b simpa only [u, PiLp.inner_apply, RCLike.inner_apply, conj_trivial, Subtype.coe_eta, Subtype.coe_inj, eq_comm] using ss.left_orthonormal_of_pos b a b.property.2 a.property.2 have hv : Orthonormal ℝ v := by rw [orthonormal_iff_ite] intro a b simpa only [v, PiLp.inner_apply, RCLike.inner_apply, conj_trivial, eq_comm] using ss.right_orthonormal b a apply ContinuousLinearMap.opNorm_le_bound _ hbound0 intro x let c : active → ℝ := fun a => ss.sigma a * inner ℝ (v a) x have haction : matrixCLM (A - thresholdSingularTruncation threshold A) x = ∑ a : active, c a • u a := by ext i simp [matrixCLM, Matrix.toEuclideanLin_apply, mulVec, dotProduct, c, u, v, PiLp.inner_apply, RCLike.inner_apply, conj_trivial, thresholdSingularTruncation] simp_rw [ss.expansion] simp_rw [Finset.sum_mul] have hsub : (∑ a : active, (ss.sigma a * ∑ j, x.ofLp j * ss.right a j) * ss.left a i) = ∑ a ∈ Finset.univ.filter (fun a => ¬ threshold ≤ ss.sigma a ∧ 0 < ss.sigma a), (ss.sigma a * ∑ j, x.ofLp j * ss.right a j) * ss.left a i := by symm apply Finset.sum_subtype intro a simp rw [hsub] rw [show singularSystem A = ss from rfl] have hcomm₁ : (∑ j : Fin cols, ∑ a : Fin cols, ss.sigma a * ss.left a i * ss.right a j * x.ofLp j) = ∑ a : Fin cols, ∑ j : Fin cols, ss.sigma a * ss.left a i * ss.right a j * x.ofLp j := by rw [Finset.sum_comm] have hcomm₂ : (∑ j : Fin cols, ∑ a : Fin cols, (if threshold ≤ ss.sigma a then ss.sigma a * ss.left a i * ss.right a j else 0) * x.ofLp j) = ∑ a : Fin cols, ∑ j : Fin cols, (if threshold ≤ ss.sigma a then ss.sigma a * ss.left a i * ss.right a j else 0) * x.ofLp j := by rw [Finset.sum_comm] rw [hcomm₁, hcomm₂, ← Finset.sum_sub_distrib, Finset.sum_filter] apply Finset.sum_congr rfl intro a _ by_cases hkeep : threshold ≤ ss.sigma a · simp_rw [hkeep] simp · by_cases hz : ss.sigma a = 0 · simp [hz] · have hp : 0 < ss.sigma a := lt_of_le_of_ne (ss.sigma_nonneg a) (Ne.symm hz) simp_rw [hkeep] simp [hp] rw [Finset.mul_sum, Finset.sum_mul] apply Finset.sum_congr rfl intro j _ ring rw [haction] have hinner := hu.inner_sum c c Finset.univ have hsq : ‖∑ a : active, c a • u a‖ ^ 2 ≤ bound ^ 2 * ‖x‖ ^ 2 := by rw [← real_inner_self_eq_norm_sq] rw [hinner] calc (∑ a : active, c a * c a) ≤ ∑ a : active, bound ^ 2 * ‖inner ℝ (v a) x‖ ^ 2 := by change Finset.univ.sum (fun a => c a * c a) ≤ Finset.univ.sum (fun a : active => bound ^ 2 * ‖inner ℝ (v (a : Fin cols)) x‖ ^ 2) apply Finset.sum_le_sum (s := (Finset.univ : Finset active)) intro a _ have hsle : ss.sigma a ≤ bound := hdiscard a a.property.1 have hs0 : 0 ≤ ss.sigma a := ss.sigma_nonneg a have hs2 : ss.sigma a ^ 2 ≤ bound ^ 2 := by nlinarith dsimp [c] calc ss.sigma a * inner ℝ (v a) x * (ss.sigma a * inner ℝ (v a) x) = ss.sigma a ^ 2 * inner ℝ (v a) x ^ 2 := by ring _ ≤ bound ^ 2 * inner ℝ (v a) x ^ 2 := mul_le_mul_of_nonneg_right hs2 (sq_nonneg _) _ = bound ^ 2 * ‖inner ℝ (v a) x‖ ^ 2 := by rw [Real.norm_eq_abs, sq_abs] _ = bound ^ 2 * ∑ a : active, ‖inner ℝ (v a) x‖ ^ 2 := by rw [Finset.mul_sum] _ ≤ bound ^ 2 * ‖x‖ ^ 2 := by gcongr have hsub : (∑ a : active, ‖inner ℝ (v a) x‖ ^ 2) = ∑ a ∈ Finset.univ.filter (fun a => ¬ threshold ≤ ss.sigma a ∧ 0 < ss.sigma a), ‖inner ℝ (v a) x‖ ^ 2 := by symm apply Finset.sum_subtype intro a simp rw [hsub] exact hv.sum_inner_products_le x exact (sq_le_sq₀ (norm_nonneg _) (mul_nonneg hbound0 (norm_nonneg _))).mp (by simpa [mul_pow] using hsq)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.thresholdSingularTruncation_error_le_of_discardedBound · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:86
theorem thresholdSingularTruncation_error_le

Discarding singular directions below a positive threshold changes the matrix by at most the threshold in operator norm. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols :
threshold :
A :
RectMatrix rows cols
hthreshold :
0 < threshold
‖matrixCLM (A - thresholdSingularTruncation threshold A)‖ ≤ threshold
Proof (Lean source)
lemma thresholdSingularTruncation_error_le {rows cols : ℕ} {threshold : ℝ} (A : RectMatrix rows cols) (hthreshold : 0 < threshold) : ‖matrixCLM (A - thresholdSingularTruncation threshold A)‖ ≤ threshold := by apply thresholdSingularTruncation_error_le_of_discardedBound A hthreshold (le_of_lt hthreshold) intro a ha exact le_of_lt (lt_of_not_ge ha)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.thresholdSingularTruncation_error_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:199
theorem thresholdSingularTruncation_rank

Dimension recovery makes the thresholded singular truncation have exactly the target rank. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols r :
threshold :
A :
RectMatrix rows cols
hrc :
r ≤ cols
hthreshold :
0 < threshold
hrec :
Proof (Lean source)
lemma thresholdSingularTruncation_rank {rows cols r : ℕ} {threshold : ℝ} (A : RectMatrix rows cols) (hrc : r ≤ cols) (hthreshold : 0 < threshold) (hrec : ThresholdRecoversMatrixDimension r threshold A) : (thresholdSingularTruncation threshold A).rank = r := by rw [thresholdSingularTruncation_eq_retained A hrc hthreshold hrec] exact RetainedSVD.rank_matrix _
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.thresholdSingularTruncation_rank · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:210
theorem thresholdSingularTruncation_sub_norm_le

Truncation costs at most one cutoff radius in addition to the original perturbation. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols :
threshold e :
A M :
RectMatrix rows cols
hthreshold :
0 < threshold
hAM :
‖matrixCLM (A - M)‖ ≤ e
‖matrixCLM (thresholdSingularTruncation threshold A - M)‖ ≤ threshold + e
Proof (Lean source)
lemma thresholdSingularTruncation_sub_norm_le {rows cols : ℕ} {threshold e : ℝ} (A M : RectMatrix rows cols) (hthreshold : 0 < threshold) (hAM : ‖matrixCLM (A - M)‖ ≤ e) : ‖matrixCLM (thresholdSingularTruncation threshold A - M)‖ ≤ threshold + e := by have hsplit : thresholdSingularTruncation threshold A - M = -(A - thresholdSingularTruncation threshold A) + (A - M) := by abel rw [hsplit] calc ‖matrixCLM (-(A - thresholdSingularTruncation threshold A) + (A - M))‖ ≤ ‖matrixCLM (-(A - thresholdSingularTruncation threshold A))‖ + ‖matrixCLM (A - M)‖ := by simpa only [matrixCLM, map_add] using norm_add_le (matrixCLM (-(A - thresholdSingularTruncation threshold A))) (matrixCLM (A - M)) _ = ‖matrixCLM (A - thresholdSingularTruncation threshold A)‖ + ‖matrixCLM (A - M)‖ := by simp only [matrixCLM, map_neg, norm_neg] _ ≤ threshold + e := add_le_add (thresholdSingularTruncation_error_le A hthreshold) hAM
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.thresholdSingularTruncation_sub_norm_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:220
theorem singularValue_lower_of_perturbation

Weyl's inequality transfers a last-signal singular margin to a nearby empirical matrix. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols r :
s e :
A M :
RectMatrix rows cols
hmargin :
s ≤ singularValue M (r - 1)
hAM :
‖matrixCLM (A - M)‖ ≤ e
s - e ≤ singularValue A (r - 1)
Proof (Lean source)
lemma singularValue_lower_of_perturbation {rows cols r : ℕ} {s e : ℝ} (A M : RectMatrix rows cols) (hmargin : s ≤ singularValue M (r - 1)) (hAM : ‖matrixCLM (A - M)‖ ≤ e) : s - e ≤ singularValue A (r - 1) := by have hadd : M + (A - M) = A := by abel have hw := singular_value_weyl (j := r - 1) M (A - M) rw [hadd] at hw rw [abs_le] at hw linarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.singularValue_lower_of_perturbation · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:240
theorem thresholdSingularTruncation_error_le_of_rank_perturbation

If the comparison matrix has rank r and recovery retains the first r directions, the discarded empirical tail is bounded by the original perturbation radius. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols r :
threshold e :
A M :
RectMatrix rows cols
hthreshold :
0 < threshold
hrec :
hrank :
M.rank = r
hAM :
‖matrixCLM (A - M)‖ ≤ e
‖matrixCLM (A - thresholdSingularTruncation threshold A)‖ ≤ e
Proof (Lean source)
lemma thresholdSingularTruncation_error_le_of_rank_perturbation {rows cols r : ℕ} {threshold e : ℝ} (A M : RectMatrix rows cols) (hthreshold : 0 < threshold) (hrec : ThresholdRecoversMatrixDimension r threshold A) (hrank : M.rank = r) (hAM : ‖matrixCLM (A - M)‖ ≤ e) : ‖matrixCLM (A - thresholdSingularTruncation threshold A)‖ ≤ e := by have he0 : 0 ≤ e := (norm_nonneg (matrixCLM (A - M))).trans hAM apply thresholdSingularTruncation_error_le_of_discardedBound A hthreshold he0 intro a hdrop have har : r ≤ (a : ℕ) := by by_contra hnot exact hdrop (by rw [(singularSystem A).sigma_eq] exact hrec.1 a (Nat.lt_of_not_ge hnot)) have hz : singularValue M a = 0 := by unfold singularValue apply (toEuclideanLin M).singularValues_eq_zero_iff_le_finrank_range.mpr have hrange : finrank ℝ (toEuclideanLin M).range = M.rank := (M.rank_eq_finrank_range_toLin (EuclideanSpace.basisFun (Fin rows) ℝ).toBasis (EuclideanSpace.basisFun (Fin cols) ℝ).toBasis).symm rw [hrange, hrank] exact har have hadd : M + (A - M) = A := by abel have hw := singular_value_weyl (j := (a : ℕ)) M (A - M) rw [hadd, hz, sub_zero] at hw change |(toEuclideanLin A).singularValues (a : ℕ)| ≤ _ at hw rw [abs_of_nonneg ((toEuclideanLin A).singularValues_nonneg _)] at hw rw [(singularSystem A).sigma_eq] exact hw.trans hAM
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.thresholdSingularTruncation_error_le_of_rank_perturbation · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:252
theorem thresholdSingularTruncation_sub_norm_le_two_mul

Rank-aware truncation stays within twice the original perturbation radius of the rank-r comparison matrix. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols r :
threshold e :
A M :
RectMatrix rows cols
hthreshold :
0 < threshold
hrec :
hrank :
M.rank = r
hAM :
‖matrixCLM (A - M)‖ ≤ e
‖matrixCLM (thresholdSingularTruncation threshold A - M)‖ ≤ 2 * e
Proof (Lean source)
lemma thresholdSingularTruncation_sub_norm_le_two_mul {rows cols r : ℕ} {threshold e : ℝ} (A M : RectMatrix rows cols) (hthreshold : 0 < threshold) (hrec : ThresholdRecoversMatrixDimension r threshold A) (hrank : M.rank = r) (hAM : ‖matrixCLM (A - M)‖ ≤ e) : ‖matrixCLM (thresholdSingularTruncation threshold A - M)‖ ≤ 2 * e := by have hsplit : thresholdSingularTruncation threshold A - M = -(A - thresholdSingularTruncation threshold A) + (A - M) := by abel rw [hsplit] calc _ ≤ ‖matrixCLM (A - thresholdSingularTruncation threshold A)‖ + ‖matrixCLM (A - M)‖ := by simpa only [matrixCLM, map_add, map_neg, norm_neg] using norm_add_le (matrixCLM (-(A - thresholdSingularTruncation threshold A))) (matrixCLM (A - M)) _ ≤ e + e := add_le_add (thresholdSingularTruncation_error_le_of_rank_perturbation A M hthreshold hrec hrank hAM) hAM _ = 2 * e := by ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.thresholdSingularTruncation_sub_norm_le_two_mul · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:285
theorem thresholdedPenroseInverse_eq_retained_moorePenrose

Dimension recovery identifies the paper's thresholded reciprocal expansion with the neutral Moore--Penrose inverse of the retained rank-r SVD matrix. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols r :
threshold :
A :
RectMatrix rows cols
hrc :
r ≤ cols
hthreshold :
0 < threshold
hrec :
= moorePenroseInverse ((singularSystemRetainedSVD A hrc (fun a => hthreshold.trans_le (by simpa [(singularSystem A).sigma_eq] using hrec.1 (a : ℕ) a.isLt))).matrix)
Proof (Lean source)
lemma thresholdedPenroseInverse_eq_retained_moorePenrose {rows cols r : ℕ} {threshold : ℝ} (A : RectMatrix rows cols) (hrc : r ≤ cols) (hthreshold : 0 < threshold) (hrec : ThresholdRecoversMatrixDimension r threshold A) : thresholdedPenroseInverse threshold A = moorePenroseInverse ((singularSystemRetainedSVD A hrc (fun a => hthreshold.trans_le (by simpa [(singularSystem A).sigma_eq] using hrec.1 (a : ℕ) a.isLt))).matrix) := by let hpos : ∀ a : Fin r, 0 < (singularSystem A).sigma (castLE hrc a) := fun a => hthreshold.trans_le (by simpa [(singularSystem A).sigma_eq] using hrec.1 (a : ℕ) a.isLt) let S := singularSystemRetainedSVD A hrc hpos rw [← S.inverse_eq_moorePenroseInverse] ext i j have hsel (x : Fin cols) : threshold ≤ (singularSystem A).sigma x ↔ (x : ℕ) < r := by rw [(singularSystem A).sigma_eq] exact ⟨fun hx => by by_contra hn; exact (not_le_of_gt (hrec.2 x (by omega))) hx, hrec.1 x⟩ change (∑ x, if threshold ≤ (singularSystem A).sigma x then ((singularSystem A).sigma x)⁻¹ * (singularSystem A).right x i * (singularSystem A).left x j else 0) = _ rw [RetainedSVD.inverse] simp only [Matrix.mul_apply, Matrix.transpose_apply, Matrix.diagonal_apply] simp only [S, singularSystemRetainedSVD] simp_rw [hsel] rw [← Finset.sum_filter] symm apply Finset.sum_bij (fun a _ => castLE hrc a) · intro a _ simp · intro a _ b _ hab exact Fin.castLE_injective hrc hab · intro b hb simp only [mem_filter, Finset.mem_univ, true_and] at hb let a : Fin r := ⟨b, hb⟩ refine ⟨a, Finset.mem_univ a, ?_⟩ exact Fin.ext rfl · intro a _ simp_all apply inl ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.thresholdedPenroseInverse_eq_retained_moorePenrose · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:307
theorem thresholdedPenroseInverse_norm_le_of_recovery

The thresholded reciprocal expansion inherits any lower bound on the last retained singular coefficient. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols r :
threshold s :
A :
RectMatrix rows cols
hrc :
r ≤ cols
_hrpos :
0 < r
hthreshold :
0 < threshold
hrec :
hs :
0 < s
hmargin :
s ≤ singularValue A (r - 1)
‖thresholdedPenroseInverse threshold A‖ ≤ s⁻¹
Proof (Lean source)
lemma thresholdedPenroseInverse_norm_le_of_recovery {rows cols r : ℕ} {threshold s : ℝ} (A : RectMatrix rows cols) (hrc : r ≤ cols) (_hrpos : 0 < r) (hthreshold : 0 < threshold) (hrec : ThresholdRecoversMatrixDimension r threshold A) (hs : 0 < s) (hmargin : s ≤ singularValue A (r - 1)) : ‖thresholdedPenroseInverse threshold A‖ ≤ s⁻¹ := by let hpos : ∀ a : Fin r, 0 < (singularSystem A).sigma (castLE hrc a) := fun a => hthreshold.trans_le (by simpa [(singularSystem A).sigma_eq] using hrec.1 (a : ℕ) a.isLt) let S := singularSystemRetainedSVD A hrc hpos rw [thresholdedPenroseInverse_eq_retained_moorePenrose A hrc hthreshold hrec, ← S.inverse_eq_moorePenroseInverse] apply S.norm_inverse_le hs intro a have hanti := (toEuclideanLin A).singularValues_antitone (Nat.le_sub_one_of_lt a.isLt) exact hmargin.trans (by simpa [S, singularSystemRetainedSVD, (singularSystem A).sigma_eq, singularValue] using hanti)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.thresholdedPenroseInverse_norm_le_of_recovery · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:351
theorem thresholded_product_perturbation_le

One arm of the empirical thresholded product is stable with the constants used by the frozen structured-lattice modulus. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols r :
s0 L eM eN :
A M N N₀ :
RectMatrix rows cols
hrc :
r ≤ cols
hrpos :
0 < r
hs0 :
0 < s0
hL0 :
0 ≤ L
hsmall :
eM < s0 / 4
hrec :
hrank :
M.rank = r
hmargin :
s0 ≤ singularValue M (r - 1)
hN₀ :
‖N₀‖ ≤ L
hMdiff :
‖matrixCLM (A - M)‖ ≤ eM
hNdiff :
‖matrixCLM (N - N₀)‖ ≤ eN
‖thresholdedPenroseInverse (s0 / 2) A * N - moorePenroseInverse M * N₀‖
≤ 16 * L / s0 ^ 2 * eM + 4 / (3 * s0) * eN
Proof (Lean source)
lemma thresholded_product_perturbation_le {rows cols r : ℕ} {s0 L eM eN : ℝ} (A M N N₀ : RectMatrix rows cols) (hrc : r ≤ cols) (hrpos : 0 < r) (hs0 : 0 < s0) (hL0 : 0 ≤ L) (hsmall : eM < s0 / 4) (hrec : ThresholdRecoversMatrixDimension r (s0 / 2) A) (hrank : M.rank = r) (hmargin : s0 ≤ singularValue M (r - 1)) (hN₀ : ‖N₀‖ ≤ L) (hMdiff : ‖matrixCLM (A - M)‖ ≤ eM) (hNdiff : ‖matrixCLM (N - N₀)‖ ≤ eN) : ‖thresholdedPenroseInverse (s0 / 2) A * N - moorePenroseInverse M * N₀‖ ≤ 16 * L / s0 ^ 2 * eM + 4 / (3 * s0) * eN := by let T := thresholdSingularTruncation (s0 / 2) A have hthreshold : 0 < s0 / 2 := by positivity have heM0 : 0 ≤ eM := (norm_nonneg (matrixCLM (A - M))).trans hMdiff have hs34 : 0 < 3 * s0 / 4 := by positivity have hmarginA : 3 * s0 / 4 ≤ singularValue A (r - 1) := by have hweyl := singularValue_lower_of_perturbation A M hmargin hMdiff linarith have hrankT : T.rank = r := by exact thresholdSingularTruncation_rank A hrc hthreshold hrec have hTdiff : ‖matrixCLM (T - M)‖ ≤ 2 * eM := by exact thresholdSingularTruncation_sub_norm_le_two_mul A M hthreshold hrec hrank hMdiff let hpos : ∀ a : Fin r, 0 < (singularSystem A).sigma (castLE hrc a) := fun a => hthreshold.trans_le (by simpa [(singularSystem A).sigma_eq] using hrec.1 (a : ℕ) a.isLt) let R := singularSystemRetainedSVD A hrc hpos have htr : T = R.matrix := by simpa [T, R, hpos] using thresholdSingularTruncation_eq_retained A hrc hthreshold hrec have heq : thresholdedPenroseInverse (s0 / 2) A = moorePenroseInverse T := by calc _ = moorePenroseInverse R.matrix := by simpa [R, hpos] using thresholdedPenroseInverse_eq_retained_moorePenrose A hrc hthreshold hrec _ = moorePenroseInverse T := congrArg moorePenroseInverse htr.symm have hinvT : ‖moorePenroseInverse T‖ ≤ 4 / (3 * s0) := by rw [← heq] have h := thresholdedPenroseInverse_norm_le_of_recovery A hrc hrpos hthreshold hrec hs34 hmarginA convert h using 1 <;> field_simp have hinvM0 : ‖moorePenroseInverse M‖ ≤ s0⁻¹ := norm_moorePenroseInverse_le_inv M hrank hs0 hmargin have hinvM : ‖moorePenroseInverse M‖ ≤ 4 / (3 * s0) := by have hs0ne : s0 ≠ 0 := ne_of_gt hs0 rw [inv_eq_one_div] at hinvM0 exact hinvM0.trans (by apply (div_le_div_iff₀ hs0 (mul_pos (by norm_num) hs0)).2 nlinarith) have hmp : ‖moorePenroseInverse T - moorePenroseInverse M‖ ≤ 16 / s0 ^ 2 * eM := by have hraw := norm_moorePenrose_sub_le T M (hrankT.trans hrank.symm) calc _ ≤ 3 * max (‖moorePenroseInverse T‖ ^ 2) (‖moorePenroseInverse M‖ ^ 2) * ‖T - M‖ := hraw _ ≤ 3 * (4 / (3 * s0)) ^ 2 * (2 * eM) := by gcongr · exact max_le (by nlinarith [norm_nonneg (moorePenroseInverse T)]) (by nlinarith [norm_nonneg (moorePenroseInverse M)]) · exact hTdiff _ ≤ 16 / s0 ^ 2 * eM := by field_simp [ne_of_gt hs0] nlinarith have hsplit : thresholdedPenroseInverse (s0 / 2) A * N - moorePenroseInverse M * N₀ = (moorePenroseInverse T - moorePenroseInverse M) * N₀ + thresholdedPenroseInverse (s0 / 2) A * (N - N₀) := by rw [heq, Matrix.sub_mul, Matrix.mul_sub] abel rw [hsplit] have hNdiff' : ‖N - N₀‖ ≤ eN := by change ‖matrixCLM (N - N₀)‖ ≤ eN exact hNdiff calc _ ≤ ‖(moorePenroseInverse T - moorePenroseInverse M) * N₀‖ + ‖thresholdedPenroseInverse (s0 / 2) A * (N - N₀)‖ := norm_add_le _ _ _ ≤ ‖moorePenroseInverse T - moorePenroseInverse M‖ * ‖N₀‖ + ‖thresholdedPenroseInverse (s0 / 2) A‖ * ‖N - N₀‖ := add_le_add (Matrix.l2_opNorm_mul _ _) (Matrix.l2_opNorm_mul _ _) _ ≤ (16 / s0 ^ 2 * eM) * L + (4 / (3 * s0)) * eN := by rw [heq] gcongr _ = 16 * L / s0 ^ 2 * eM + 4 / (3 * s0) * eN := by ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.thresholded_product_perturbation_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:373
theorem empiricalCompressedOperator_sub_ambientEffectOperator_norm_le

The two empirical arms obey the exact operator coefficient used in the frozen theorem. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx dz r :
s0 L :
s p :
hrc :
r ≤ dx
hrpos :
0 < r
hs0 :
0 < s0
hL0 :
0 ≤ L
hsmall :
dS s p < s0 / 4
hrec0 :
hrec1 :
hrank0 :
p.M0.rank = r
hrank1 :
p.M1.rank = r
hmargin0 :
s0 ≤ singularValue p.M0 (r - 1)
hmargin1 :
s0 ≤ singularValue p.M1 (r - 1)
hN0 :
‖p.N0‖ ≤ L
hN1 :
‖p.N1‖ ≤ L
‖matrixCLM (empiricalCompressedOperator (s0 / 2) s - AmbientOperatorBridge.ambientEffectOperator p)‖
≤ (8 / (3 * s0) + 32 * L / s0 ^ 2) * dS s p
Proof (Lean source)
lemma empiricalCompressedOperator_sub_ambientEffectOperator_norm_le {dx dz r : ℕ} {s0 L : ℝ} (s p : SummarySpace dx dz) (hrc : r ≤ dx) (hrpos : 0 < r) (hs0 : 0 < s0) (hL0 : 0 ≤ L) (hsmall : dS s p < s0 / 4) (hrec0 : ThresholdRecoversMatrixDimension r (s0 / 2) s.M0) (hrec1 : ThresholdRecoversMatrixDimension r (s0 / 2) s.M1) (hrank0 : p.M0.rank = r) (hrank1 : p.M1.rank = r) (hmargin0 : s0 ≤ singularValue p.M0 (r - 1)) (hmargin1 : s0 ≤ singularValue p.M1 (r - 1)) (hN0 : ‖p.N0‖ ≤ L) (hN1 : ‖p.N1‖ ≤ L) : ‖matrixCLM (empiricalCompressedOperator (s0 / 2) s - AmbientOperatorBridge.ambientEffectOperator p)‖ ≤ (8 / (3 * s0) + 32 * L / s0 ^ 2) * dS s p := by let e := dS s p have he0 : 0 ≤ e := by dsimp [e]; unfold dS; positivity have block_le (B : ℝ) (hB : B = ‖matrixCLM (s.M0 - p.M0)‖ ∨ B = ‖matrixCLM (s.M1 - p.M1)‖ ∨ B = ‖matrixCLM (s.N0 - p.N0)‖ ∨ B = ‖matrixCLM (s.N1 - p.N1)‖) : B ≤ e := by rcases hB with rfl | rfl | rfl | rfl <;> dsimp [e] <;> unfold dS <;> have h0 : 0 ≤ ‖matrixCLM (s.M0 - p.M0)‖ := norm_nonneg _ <;> have h1 : 0 ≤ ‖matrixCLM (s.M1 - p.M1)‖ := norm_nonneg _ <;> have h2 : 0 ≤ ‖matrixCLM (s.N0 - p.N0)‖ := norm_nonneg _ <;> have h3 : 0 ≤ ‖matrixCLM (s.N1 - p.N1)‖ := norm_nonneg _ <;> have hsqrt : 0 ≤ sqrt (∑ i, (s.mX i - p.mX i) ^ 2) := Real.sqrt_nonneg _ <;> linarith have hM0 : ‖matrixCLM (s.M0 - p.M0)‖ ≤ e := by exact block_le _ (inl rfl) have hM1 : ‖matrixCLM (s.M1 - p.M1)‖ ≤ e := by exact block_le _ (inr (inl rfl)) have hN0' : ‖matrixCLM (s.N0 - p.N0)‖ ≤ e := by exact block_le _ (inr (inr (inl rfl))) have hN1' : ‖matrixCLM (s.N1 - p.N1)‖ ≤ e := by exact block_le _ (inr (inr (inr rfl))) have hsmall' : e < s0 / 4 := hsmall have harm0 := thresholded_product_perturbation_le s.M0 p.M0 s.N0 p.N0 hrc hrpos hs0 hL0 hsmall' hrec0 hrank0 hmargin0 hN0 hM0 hN0' have harm1 := thresholded_product_perturbation_le s.M1 p.M1 s.N1 p.N1 hrc hrpos hs0 hL0 hsmall' hrec1 hrank1 hmargin1 hN1 hM1 hN1' have hsplit : empiricalCompressedOperator (s0 / 2) s - AmbientOperatorBridge.ambientEffectOperator p = (thresholdedPenroseInverse (s0 / 2) s.M1 * s.N1 - moorePenroseInverse p.M1 * p.N1) - (thresholdedPenroseInverse (s0 / 2) s.M0 * s.N0 - moorePenroseInverse p.M0 * p.N0) := by simp only [empiricalCompressedOperator, AmbientOperatorBridge.ambientEffectOperator] abel rw [hsplit] calc _ ≤ ‖thresholdedPenroseInverse (s0 / 2) s.M1 * s.N1 - moorePenroseInverse p.M1 * p.N1‖ + ‖thresholdedPenroseInverse (s0 / 2) s.M0 * s.N0 - moorePenroseInverse p.M0 * p.N0‖ := norm_sub_le _ _ _ ≤ (16 * L / s0 ^ 2 * e + 4 / (3 * s0) * e) + (16 * L / s0 ^ 2 * e + 4 / (3 * s0) * e) := add_le_add harm1 harm0 _ = (8 / (3 * s0) + 32 * L / s0 ^ 2) * dS s p := by dsimp [e] ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.empiricalCompressedOperator_sub_ambientEffectOperator_norm_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:460
theorem observedProxyMoment_sub_norm_le_dS

Each proxy-moment arm is dominated by the full summary distance. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx dz :
s p :
t :
‖matrixCLM (observedProxyMoment s t - observedProxyMoment p t)‖ ≤ dS s p
Proof (Lean source)
lemma observedProxyMoment_sub_norm_le_dS {dx dz : ℕ} (s p : SummarySpace dx dz) (t : Bool) : ‖matrixCLM (observedProxyMoment s t - observedProxyMoment p t)‖ ≤ dS s p := by cases t <;> simp [observedProxyMoment] <;> unfold dS · have h1 : 0 ≤ ‖matrixCLM (s.M1 - p.M1)‖ := norm_nonneg _ have h2 : 0 ≤ ‖matrixCLM (s.N0 - p.N0)‖ := norm_nonneg _ have h3 : 0 ≤ ‖matrixCLM (s.N1 - p.N1)‖ := norm_nonneg _ have hs : 0 ≤ sqrt (∑ i, (s.mX i - p.mX i) ^ 2) := Real.sqrt_nonneg _ linarith · have h0 : 0 ≤ ‖matrixCLM (s.M0 - p.M0)‖ := norm_nonneg _ have h2 : 0 ≤ ‖matrixCLM (s.N0 - p.N0)‖ := norm_nonneg _ have h3 : 0 ≤ ‖matrixCLM (s.N1 - p.N1)‖ := norm_nonneg _ have hs : 0 ≤ sqrt (∑ i, (s.mX i - p.mX i) ^ 2) := Real.sqrt_nonneg _ linarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.observedProxyMoment_sub_norm_le_dS · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:521
theorem thresholdedPenroseInverse_select_iff

Under the dimension-recovery certificate, the custom thresholded SVD retains exactly the first k singular directions. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols k :
threshold :
A :
RectMatrix rows cols
hrec :
r :
Fin cols
threshold ≤ (singularSystem A).sigma r ↔ (r : ℕ) < k
Proof (Lean source)
lemma thresholdedPenroseInverse_select_iff {rows cols k : ℕ} {threshold : ℝ} (A : RectMatrix rows cols) (hrec : ThresholdRecoversMatrixDimension k threshold A) (r : Fin cols) : threshold ≤ (singularSystem A).sigma r ↔ (r : ℕ) < k := by rw [(singularSystem A).sigma_eq] constructor · intro hr by_contra hnot exact (not_le_of_gt (hrec.2 r (by omega))) hr · exact hrec.1 r
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.thresholdedPenroseInverse_select_iff · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:538
theorem singularSystem_sigma_eq_zero_of_rank

Every direction discarded after the recovered rank is genuinely a zero singular direction of the rank-k comparison matrix. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols k :
A :
RectMatrix rows cols
hrank :
A.rank = k
r :
Fin cols
hr :
k ≤ (r : ℕ)
Proof (Lean source)
lemma singularSystem_sigma_eq_zero_of_rank {rows cols k : ℕ} (A : RectMatrix rows cols) (hrank : A.rank = k) (r : Fin cols) (hr : k ≤ (r : ℕ)) : (singularSystem A).sigma r = 0 := by rw [(singularSystem A).sigma_eq] unfold singularValue apply (toEuclideanLin A).singularValues_eq_zero_iff_le_finrank_range.mpr have hrange : finrank ℝ (toEuclideanLin A).range = A.rank := (A.rank_eq_finrank_range_toLin (EuclideanSpace.basisFun (Fin rows) ℝ).toBasis (EuclideanSpace.basisFun (Fin cols) ℝ).toBasis).symm rw [hrange, hrank] exact hr
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.singularSystem_sigma_eq_zero_of_rank · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:552
theorem thresholdRecoversMatrixDimension_of_rank_perturbation

A rank-r comparison with margin s0, perturbed by less than s0/4, is recovered by thresholding at s0/2. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols r :
s0 e :
A M :
RectMatrix rows cols
hrpos :
0 < r
hs0 :
0 < s0
hrank :
M.rank = r
hmargin :
s0 ≤ singularValue M (r - 1)
hAM :
‖matrixCLM (A - M)‖ ≤ e
hsmall :
e < s0 / 4
Proof (Lean source)
lemma thresholdRecoversMatrixDimension_of_rank_perturbation {rows cols r : ℕ} {s0 e : ℝ} (A M : RectMatrix rows cols) (hrpos : 0 < r) (hs0 : 0 < s0) (hrank : M.rank = r) (hmargin : s0 ≤ singularValue M (r - 1)) (hAM : ‖matrixCLM (A - M)‖ ≤ e) (hsmall : e < s0 / 4) : ThresholdRecoversMatrixDimension r (s0 / 2) A := by have hkth : 3 * s0 / 4 ≤ singularValue A (r - 1) := by have h := singularValue_lower_of_perturbation A M hmargin hAM linarith constructor · intro j hj have hanti := (toEuclideanLin A).singularValues_antitone (Nat.le_sub_one_of_lt hj) change s0 / 2 ≤ (toEuclideanLin A).singularValues j change 3 * s0 / 4 ≤ (toEuclideanLin A).singularValues (r - 1) at hkth linarith · intro j hj have hz : singularValue M j = 0 := by unfold singularValue apply (toEuclideanLin M).singularValues_eq_zero_iff_le_finrank_range.mpr have hrange : finrank ℝ (toEuclideanLin M).range = M.rank := (M.rank_eq_finrank_range_toLin (EuclideanSpace.basisFun (Fin rows) ℝ).toBasis (EuclideanSpace.basisFun (Fin cols) ℝ).toBasis).symm rw [hrange, hrank] exact hj have hadd : M + (A - M) = A := by abel have hw := singular_value_weyl (j := j) M (A - M) rw [hadd, hz, sub_zero] at hw have hnonneg : 0 ≤ singularValue A j := (toEuclideanLin A).singularValues_nonneg _ rw [abs_of_nonneg hnonneg] at hw exact lt_of_le_of_lt (hw.trans hAM) (hsmall.trans (by linarith))
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.thresholdRecoversMatrixDimension_of_rank_perturbation · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:568
theorem empiricalCompressedOperator_model_norm_le

Model membership specializes the two-arm perturbation certificate, including deriving threshold recovery rather than assuming it. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
s :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hsigma :
0 < sigma0
hsigmaMax :
sigma0 ≤ 1
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
hsmall :
dS s (obsSummary P) < pi0 * sigma0 ^ 2 / 4
‖matrixCLM (empiricalCompressedOperator (pi0 * sigma0 ^ 2 / 2) s - AmbientOperatorBridge.ambientEffectOperator (obsSummary P))‖
≤ (8 / (3 * (pi0 * sigma0 ^ 2)) + 32 * L / (pi0 * sigma0 ^ 2) ^ 2) * dS s (obsSummary P)
Proof (Lean source)
lemma empiricalCompressedOperator_model_norm_le {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (s : SummarySpace dx dz) (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hpiMax : pi0 ≤ 1 / (2 * k : ℝ)) (hsigma : 0 < sigma0) (hsigmaMax : sigma0 ≤ 1) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (hsmall : dS s (obsSummary P) < pi0 * sigma0 ^ 2 / 4) : ‖matrixCLM (empiricalCompressedOperator (pi0 * sigma0 ^ 2 / 2) s - AmbientOperatorBridge.ambientEffectOperator (obsSummary P))‖ ≤ (8 / (3 * (pi0 * sigma0 ^ 2)) + 32 * L / (pi0 * sigma0 ^ 2) ^ 2) * dS s (obsSummary P) := by let p := obsSummary P let s0 := pi0 * sigma0 ^ 2 have hs0 : 0 < s0 := by dsimp [s0]; positivity have hb := AmbientOperatorBridge.model_summary_ambient_bounds P hk hkx hkz hL hpi hpiMax hsigma hsigmaMax hM have hrec (t : Bool) : ThresholdRecoversMatrixDimension k (s0 / 2) (observedProxyMoment s t) := by apply thresholdRecoversMatrixDimension_of_rank_perturbation (observedProxyMoment s t) (observedProxyMoment p t) (by omega) hs0 (by simpa [p] using (hb.1 t).1) (by simpa [s0, p] using (hb.1 t).2.1) (observedProxyMoment_sub_norm_le_dS s p t) simpa [s0, p] using hsmall apply empiricalCompressedOperator_sub_ambientEffectOperator_norm_le s p hkx (by omega) hs0 (le_trans zero_le_one hL) · simpa [s0, p] using hsmall · simpa [observedProxyMoment] using hrec false · simpa [observedProxyMoment] using hrec true · exact (hb.1 false).1 · exact (hb.1 true).1 · exact (hb.1 false).2.1 · exact (hb.1 true).2.1 · exact (hb.1 false).2.2 · exact (hb.1 true).2.2
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.empiricalCompressedOperator_model_norm_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:604
theorem targetFeature_column_norm_le

Each latent-class conditional target-feature column retains the model's Euclidean envelope. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hpi :
0 < pi0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
u :
Fin k
‖(toLp 2 (fun i => targetFeature P i u) : Euc dx)‖ ≤ L
Proof (Lean source)
lemma targetFeature_column_norm_le {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hpi : 0 < pi0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (u : Fin k) : ‖(toLp 2 (fun i => targetFeature P i u) : Euc dx)‖ ≤ L := by have hclass : 0 < P (latentClass u) := lt_of_lt_of_le (latentCell_pos_of_latentArmPositivity P hpi hM.latentArmPositivity u false) (MeasureTheory.measure_mono fun _ hw => hw.1) let mu := normalizedRestrict P (latentClass u) let _ : IsProbabilityMeasure mu := normalizedRestrict_isProbabilityMeasure (measurableSet_latentClass u) hclass have hXMeas : Measurable (fun w : FullData k dx dz => (toLp 2 w.X : Euc dx)) := (WithLp.measurable_toLp 2 (Fin dx → ℝ)).comp measurable_fullData_X have hbound : ∀ᵐ w ∂mu, ‖(toLp 2 w.X : Euc dx)‖ ≤ L := (ae_normalizedRestrict_iff hclass).mpr <| MeasureTheory.ae_restrict_of_ae <| hM.boundedX.mono fun w hw => by simpa only [EuclideanSpace.norm_eq, Real.norm_eq_abs, sq_abs] using hw have hXint : Integrable (fun w : FullData k dx dz => (toLp 2 w.X : Euc dx)) mu := MeasureTheory.Integrable.of_bound hXMeas.aestronglyMeasurable L hbound have heq : (toLp 2 (fun i => targetFeature P i u) : Euc dx) = ∫ w, (toLp 2 w.X : Euc dx) ∂mu := by apply PiLp.ext intro i rw [eval_integral_piLp (fun j => hXint.eval_piLp j) i] change targetFeature P i u = _ rw [targetFeature, conditionalMean_eq_normalizedRestrictedIntegral hclass] rfl rw [heq] calc ‖∫ w, (toLp 2 w.X : Euc dx) ∂mu‖ ≤ ∫ w, ‖(toLp 2 w.X : Euc dx)‖ ∂mu := MeasureTheory.norm_integral_le_integral_norm _ _ ≤ ∫ _w, L ∂mu := MeasureTheory.integral_mono_ae hXint.norm (MeasureTheory.integrable_const _) hbound _ = L := by simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.targetFeature_column_norm_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:644
theorem matrixCLM_norm_le_sqrt_card_mul_of_column_norm_le

A matrix whose columns obey a common Euclidean envelope has the corresponding square-root-of-cardinality operator envelope. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols :
L :
hL :
0 ≤ L
A :
RectMatrix rows cols
hcol :
∀ j, ‖(toLp 2 (fun i => A i j) : Euc rows)‖ ≤ L
‖matrixCLM A‖ ≤ sqrt cols * L
Proof (Lean source)
lemma matrixCLM_norm_le_sqrt_card_mul_of_column_norm_le {rows cols : ℕ} {L : ℝ} (hL : 0 ≤ L) (A : RectMatrix rows cols) (hcol : ∀ j, ‖(toLp 2 (fun i => A i j) : Euc rows)‖ ≤ L) : ‖matrixCLM A‖ ≤ sqrt cols * L := by apply ContinuousLinearMap.opNorm_le_bound _ (mul_nonneg (Real.sqrt_nonneg _) hL) intro x let c : Fin cols → Euc rows := fun j => toLp 2 (fun i => A i j) have haction : toEuclideanLin A x = ∑ j, x j • c j := by apply PiLp.ext intro i simp [Matrix.toEuclideanLin_apply, mulVec, dotProduct, c, mul_comm] change ‖Matrix.toEuclideanLin A x‖ ≤ _ rw [haction] calc ‖∑ j, x j • c j‖ ≤ ∑ j, ‖x j • c j‖ := by exact norm_sum_le univ _ _ ≤ ∑ j, |x j| * L := by apply Finset.sum_le_sum intro j _ rw [norm_smul, Real.norm_eq_abs] exact mul_le_mul_of_nonneg_left (hcol j) (abs_nonneg _) _ = L * ∑ j, |x j| := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro j _ ring _ ≤ L * (sqrt cols * ‖x‖) := by gcongr let one : Euc cols := toLp 2 (fun _ => (1 : ℝ)) let ax : Euc cols := toLp 2 (fun j => |x j|) have hinner : ∑ j, |x j| = inner ℝ one ax := by simp [one, ax, PiLp.inner_apply, RCLike.inner_apply, conj_trivial] rw [hinner] calc inner ℝ one ax ≤ |inner ℝ one ax| := le_abs_self _ _ ≤ ‖one‖ * ‖ax‖ := abs_real_inner_le_norm _ _ _ = sqrt cols * ‖x‖ := by congr 1 · rw [EuclideanSpace.norm_eq] simp [one] · rw [EuclideanSpace.norm_eq, EuclideanSpace.norm_eq] simp [ax, Real.norm_eq_abs] _ = (sqrt cols * L) * ‖x‖ := by ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.matrixCLM_norm_le_sqrt_card_mul_of_column_norm_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:687
theorem thinSignalFactorization_coord_transpose_norm_le

The coordinate factor has no larger operator norm than the original matrix because its left factor has orthonormal columns. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
L :
B :
hpos :
∀ r : Fin k, 0 < (singularSystem B).sigma r
hL :
0 ≤ L
hcol :
∀ j, ‖(toLp 2 (fun i => B i j) : Euc dx)‖ ≤ L
‖matrixCLM (thinSignalFactorization B hpos).coord.transpose‖ ≤ sqrt k * L
Proof (Lean source)
lemma thinSignalFactorization_coord_transpose_norm_le {dx k : ℕ} {L : ℝ} (B : RectMatrix dx k) (hpos : ∀ r : Fin k, 0 < (singularSystem B).sigma r) (hL : 0 ≤ L) (hcol : ∀ j, ‖(toLp 2 (fun i => B i j) : Euc dx)‖ ≤ L) : ‖matrixCLM (thinSignalFactorization B hpos).coord.transpose‖ ≤ sqrt k * L := by let F := thinSignalFactorization B hpos have hB : ‖matrixCLM B‖ ≤ sqrt k * L := matrixCLM_norm_le_sqrt_card_mul_of_column_norm_le hL B hcol have hcoord : ‖matrixCLM F.coord‖ ≤ sqrt k * L := by apply ContinuousLinearMap.opNorm_le_bound _ (mul_nonneg (Real.sqrt_nonneg _) hL) intro x change ‖Matrix.toEuclideanLin F.coord x‖ ≤ _ have hiso := (signalBasisLinearIsometry F.V).norm_map (toEuclideanLin F.coord x) change ‖Matrix.toEuclideanLin F.V.V (toEuclideanLin F.coord x)‖ = _ at hiso rw [← hiso] have hfactor : toEuclideanLin F.V.V (toEuclideanLin F.coord x) = toEuclideanLin B x := by have hf := congrArg (fun A : RectMatrix dx k => toEuclideanLin A x) F.factor rw [show toEuclideanLin (F.V.V * F.coord) x = toEuclideanLin F.V.V (toEuclideanLin F.coord x) by apply PiLp.ext intro i simp [Matrix.toEuclideanLin_apply, Matrix.mulVec_mulVec]] at hf exact hf.symm rw [hfactor] exact (Matrix.l2_opNorm_mulVec B x).trans (mul_le_mul_of_nonneg_right hB (norm_nonneg x)) change ‖F.coord.transpose‖ ≤ _ change ‖F.coord‖ ≤ _ at hcoord rw [show ‖F.coord.transpose‖ = ‖F.coord‖ by simpa [Matrix.conjTranspose_eq_transpose_of_trivial] using Matrix.l2_opNorm_conjTranspose F.coord] exact hcoord
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.thinSignalFactorization_coord_transpose_norm_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:733
theorem thinSignalFactorization_coord_transpose_signalMinSingular

The transposed coordinate factor in the thin SVD inherits the certified lower singular margin of every retained direction. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
B :
hk :
0 < k
s :
hs :
0 ≤ s
hpos :
∀ r : Fin k, 0 < (singularSystem B).sigma r
hsle :
∀ r : Fin k, s ≤ (singularSystem B).sigma r
s ≤ signalMinSingular (thinSignalFactorization B hpos).coord.transpose
Proof (Lean source)
lemma thinSignalFactorization_coord_transpose_signalMinSingular {dx k : ℕ} (B : RectMatrix dx k) (hk : 0 < k) {s : ℝ} (hs : 0 ≤ s) (hpos : ∀ r : Fin k, 0 < (singularSystem B).sigma r) (hsle : ∀ r : Fin k, s ≤ (singularSystem B).sigma r) : s ≤ signalMinSingular (thinSignalFactorization B hpos).coord.transpose := by let S := singularSystem B let W : SignalBasis k k := { V := fun i r => S.right r i orthonormal := fun r t => S.right_orthonormal r t } have hcoord : (thinSignalFactorization B hpos).coord.transpose = W.V * diagonal S.sigma := by ext i j change (singularSystem B).sigma j * (singularSystem B).right j i = _ rw [Matrix.mul_apply] simp [W, S, Matrix.diagonal_apply, mul_comm] apply le_singularValues_of_subspace (toEuclideanLin (thinSignalFactorization B hpos).coord.transpose) ⊤ hs · simpa using hk · intro x _hx rw [hcoord] have hW := (signalBasisLinearIsometry W).norm_map (toEuclideanLin (diagonal S.sigma) x) change ‖Matrix.toEuclideanLin W.V (toEuclideanLin (diagonal S.sigma) x)‖ = _ at hW rw [show toEuclideanLin (W.V * diagonal S.sigma) x = toEuclideanLin W.V (toEuclideanLin (diagonal S.sigma) x) by apply PiLp.ext intro i simp [Matrix.toEuclideanLin_apply, Matrix.mulVec_mulVec]] rw [hW] apply (sq_le_sq₀ (mul_nonneg hs (norm_nonneg _)) (norm_nonneg _)).1 rw [mul_pow, EuclideanSpace.real_norm_sq_eq, EuclideanSpace.real_norm_sq_eq] rw [Finset.mul_sum] simp only [Matrix.toEuclideanLin_apply] simp [mulVec, dotProduct, Matrix.diagonal_apply] apply Finset.sum_le_sum intro r _ change s ^ 2 * x r ^ 2 ≤ (S.sigma r * x r) ^ 2 have hsigma : 0 ≤ S.sigma r := (S.sigma_nonneg r) have hsq : s ^ 2 ≤ (S.sigma r) ^ 2 := by nlinarith [hsle r] rw [mul_pow] exact mul_le_mul_of_nonneg_right hsq (sq_nonneg _)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.thinSignalFactorization_coord_transpose_signalMinSingular · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:772
theorem population_structured_tuple_exists

The model supplies one common latent tuple whose mean, anchor, and ambient effect operator have exactly the factorizations used by the structured lattice criterion. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hL :
1 ≤ L
hpi :
0 < pi0
hsigma :
0 < sigma0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
∃ (V : SignalBasis dx k) (R : RectMatrix k k) (p tau : Fin k → ℝ),
(obsSummary P).mX = mulVec (V.V * R.transpose) p
mulVec (R * V.V.transpose) (firstBasis dx) = (fun _ => (1 : ℝ))
AmbientOperatorBridge.ambientEffectOperator (obsSummary P)
= V.V * R⁻¹ * diagonal tau * R * V.V.transpose
sigma0 ≤ signalMinSingular R
‖matrixCLM R‖ ≤ sqrt k * L
conclusion 1
u :
2 * pi0 ≤ p u
conclusion 2
∑ u, p u = 1
conclusion 3
u :
tau u ∈ Icc (-effectRadius dz L sigma0) (effectRadius dz L sigma0)
conclusion 4
({ weight := p, atom := tau } : AtomicLaw k (effectRadius dz L sigma0))
= quotientLawRaw P (effectRadius dz L sigma0)
Proof (Lean source)
lemma population_structured_tuple_exists {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hk : 2 ≤ k) (hkx : k ≤ dx) (hL : 1 ≤ L) (hpi : 0 < pi0) (hsigma : 0 < sigma0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) : ∃ (V : SignalBasis dx k) (R : RectMatrix k k) (p tau : Fin k → ℝ), (obsSummary P).mX = mulVec (V.V * R.transpose) p ∧ mulVec (R * V.V.transpose) (firstBasis dx) = (fun _ => (1 : ℝ)) ∧ AmbientOperatorBridge.ambientEffectOperator (obsSummary P) = V.V * R⁻¹ * diagonal tau * R * V.V.transpose ∧ sigma0 ≤ signalMinSingular R ∧ ‖matrixCLM R‖ ≤ sqrt k * L ∧ (∀ u, 2 * pi0 ≤ p u) ∧ (∑ u, p u = 1) ∧ (∀ u, tau u ∈ Icc (-effectRadius dz L sigma0) (effectRadius dz L sigma0)) ∧ ({ weight := p, atom := tau } : AtomicLaw k (effectRadius dz L sigma0)) = quotientLawRaw P (effectRadius dz L sigma0) := by let B := targetFeature P have hsle (r : Fin k) : sigma0 ≤ (singularSystem B).sigma r := by rw [(singularSystem B).sigma_eq] exact hM.proxyRankMargin.2.2.trans ((toEuclideanLin B).singularValues_antitone (by simpa using Nat.le_sub_one_of_lt r.isLt)) have hpos (r : Fin k) : 0 < (singularSystem B).sigma r := hsigma.trans_le (hsle r) let F := thinSignalFactorization B hpos let R : RectMatrix k k := F.coord.transpose have hRt : R.transpose = F.coord := by simp [R] have hRinv : R⁻¹ = F.coordInv.transpose := by apply Matrix.inv_eq_left_inv simpa [R, Matrix.transpose_mul] using congrArg Matrix.transpose F.coord_mul_inv have hRmin : sigma0 ≤ signalMinSingular R := by exact thinSignalFactorization_coord_transpose_signalMinSingular B (by omega) hsigma.le hpos hsle have hRnorm : ‖matrixCLM R‖ ≤ sqrt k * L := by exact thinSignalFactorization_coord_transpose_norm_le B hpos (by linarith) (targetFeature_column_norm_le P hpi hM) have hp (u : Fin k) : 2 * pi0 ≤ latentMass P u := by rw [latentMass, show latentClass u = ⋃ t : Bool, latentCell u t by ext w simp [latentClass, latentCell]] rw [MeasureTheory.measureReal_iUnion_fintype (h' := fun t => MeasureTheory.measure_ne_top P (latentCell u t))] · rw [Fintype.sum_bool] simpa [two_mul] using add_le_add (hM.latentArmPositivity u true) (hM.latentArmPositivity u false) · intro t s hts unfold onFun rw [Set.disjoint_left] intro w hwt hws exact hts (hwt.2.symm.trans hws.2) · exact fun t => measurableSet_latentCell u t have hvalid := quotientLawRaw_valid P hM refine ⟨F.V, R, latentMass P, latentEffect P, ?_, ?_, ?_, hRmin, hRnorm, hp, ?_, ?_, rfl⟩ · rw [AmbientOperatorBridge.obsSummary_mX_factorization P hpi hM, hRt] exact congrArg (fun A => mulVec A (latentMass P)) F.factor · have hanchor := AmbientOperatorBridge.targetFeature_transpose_firstBasis P hk hkx hpi hM rw [show R * F.V.V.transpose = B.transpose by rw [show R = F.coord.transpose by rfl, ← Matrix.transpose_mul, ← F.factor]] exact hanchor · rw [AmbientOperatorBridge.model_ambientEffectOperator_factorization P hk hkx hL hpi hsigma hM, hRinv] have hmp := factorOperator_eq_moorePenrose F (latentEffect P) rw [← hmp] rfl · simpa [quotientLawRaw] using hvalid.2.1 · exact hvalid.2.2
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.population_structured_tuple_exists · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:819
theorem population_structuredLatticeComparator_exists

The exact population tuple admits a well-formed prescribed-grid comparator, retaining both its factorization identities and all four frozen rounding estimates. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hL :
1 ≤ L
hpi :
0 < pi0
hsigma :
0 < sigma0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
∃ (V : SignalBasis dx k) (R : RectMatrix k k) (p tau : Fin k → ℝ) (theta : StructuredLatticePoint k dx (effectRadius dz L sigma0)),
theta.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)
(obsSummary P).mX = mulVec (V.V * R.transpose) p
mulVec (R * V.V.transpose) (firstBasis dx) = (fun _ => (1 : ℝ))
AmbientOperatorBridge.ambientEffectOperator (obsSummary P)
= V.V * R⁻¹ * diagonal tau * R * V.V.transpose
sigma0 ≤ signalMinSingular R
‖matrixCLM R‖ ≤ sqrt k * L
conclusion 1
u :
2 * pi0 ≤ p u
conclusion 2
∑ u, p u = 1
conclusion 3
u :
tau u ∈ Icc (-effectRadius dz L sigma0) (effectRadius dz L sigma0)
conclusion 4
‖matrixCLM (theta.V - V.V)‖ ≤ 4 * sqrt (dx * k) * latticeMesh k dx n pi0 sigma0
conclusion 5
‖matrixCLM (theta.R - R)‖ ≤ (k : ℝ) * latticeMesh k dx n pi0 sigma0
conclusion 6
sqrt (∑ u, (theta.weight u - p u) ^ 2) ≤ sqrt k * latticeMesh k dx n pi0 sigma0
conclusion 7
u :
|theta.effect u - tau u| ≤ latticeMesh k dx n pi0 sigma0
Proof (Lean source)
lemma population_structuredLatticeComparator_exists {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hk : 2 ≤ k) (hkx : k ≤ dx) (hL : 1 ≤ L) (hpi : 0 < pi0) (hsigma : 0 < sigma0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) : ∃ (V : SignalBasis dx k) (R : RectMatrix k k) (p tau : Fin k → ℝ) (theta : StructuredLatticePoint k dx (effectRadius dz L sigma0)), theta.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0) ∧ (obsSummary P).mX = mulVec (V.V * R.transpose) p ∧ mulVec (R * V.V.transpose) (firstBasis dx) = (fun _ => (1 : ℝ)) ∧ AmbientOperatorBridge.ambientEffectOperator (obsSummary P) = V.V * R⁻¹ * diagonal tau * R * V.V.transpose ∧ sigma0 ≤ signalMinSingular R ∧ ‖matrixCLM R‖ ≤ sqrt k * L ∧ (∀ u, 2 * pi0 ≤ p u) ∧ (∑ u, p u = 1) ∧ (∀ u, tau u ∈ Icc (-effectRadius dz L sigma0) (effectRadius dz L sigma0)) ∧ ‖matrixCLM (theta.V - V.V)‖ ≤ 4 * sqrt (dx * k) * latticeMesh k dx n pi0 sigma0 ∧ ‖matrixCLM (theta.R - R)‖ ≤ (k : ℝ) * latticeMesh k dx n pi0 sigma0 ∧ sqrt (∑ u, (theta.weight u - p u) ^ 2) ≤ sqrt k * latticeMesh k dx n pi0 sigma0 ∧ ∀ u, |theta.effect u - tau u| ≤ latticeMesh k dx n pi0 sigma0 := by obtain ⟨V, R, p, tau, hm, hb, hD, hRmin, hRnorm, hp, hpSum, htau, _hlaw⟩ := population_structured_tuple_exists P hk hkx hL hpi hsigma hM obtain ⟨theta, htheta, hV, hR, hweight, heffect⟩ := structuredLatticeComparator_exists (n := n) hk hL hpi hsigma (by unfold effectRadius; positivity) V R p tau hRmin hRnorm hp hpSum htau exact ⟨V, R, p, tau, theta, htheta, hm, hb, hD, hRmin, hRnorm, hp, hpSum, htau, hV, hR, hweight, heffect⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.population_structuredLatticeComparator_exists · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:889
def populationOperatorCoefficient

For the supplied parameters, population Operator Coefficient is given by its defining clause.

Definition (Lean source)
L pi0 sigma0 :
populationOperatorCoefficient L pi0 sigma0 :
8 / (3 * (pi0 * sigma0 ^ 2)) + 32 * L / (pi0 * sigma0 ^ 2) ^ 2
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.populationOperatorCoefficient · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:923
def structuredGridVConstant

For the supplied parameters, structured Grid VConstant is given by its defining clause.

Definition (Lean source)
k dx :
structuredGridVConstant k dx :
4 * sqrt (dx * k)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredGridVConstant · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:927
def structuredGridMeanCoefficient

For the supplied parameters, structured Grid Mean Coefficient is given by its defining clause.

Definition (Lean source)
k dx :
L :
structuredGridMeanCoefficient k dx L :
2 * sqrt k * L * structuredGridVConstant k dx + k + k * L
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredGridMeanCoefficient · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:931
def structuredGridAnchorCoefficient

For the supplied parameters, structured Grid Anchor Coefficient is given by its defining clause.

Definition (Lean source)
k dx :
L :
structuredGridAnchorCoefficient k dx L :
k + 2 * sqrt k * L * structuredGridVConstant k dx
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredGridAnchorCoefficient · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:935
def structuredGridOperatorCoefficient

For the supplied parameters, structured Grid Operator Coefficient is given by its defining clause.

Definition (Lean source)
k dx dz :
L sigma0 :
structuredGridOperatorCoefficient k dx dz L sigma0 :
Ltau :
effectRadius dz L sigma0
KD :
4 * sqrt k * L * Ltau / sigma0
+ 4 * k * sqrt k * L * Ltau / sigma0 ^ 2
+ 2 * sqrt k * L / sigma0
+ k * Ltau / sigma0
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredGridOperatorCoefficient · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:939
def structuredGridCriterionCoefficient

For the supplied parameters, structured Grid Criterion Coefficient is given by its defining clause.

Definition (Lean source)
k dx dz :
L sigma0 :
structuredGridCriterionCoefficient k dx dz L sigma0 :
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredGridCriterionCoefficient · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:948
theorem selected_structuredLatticeCriterion_model_le

Model-specialized oracle inequality for the selected structured-lattice point, with the population perturbation and grid approximation contributions kept additively separate. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 :
A :
LatticeEstimator k dx dz n (effectRadius dz L sigma0)
hA :
IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A
sample :
Fin n → Obs dx dz
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hsigma :
0 < sigma0
hsigmaMax :
sigma0 ≤ 1
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
hsmall :
dS (empSummary sample) (obsSummary P) < pi0 * sigma0 ^ 2 / 4
∃ thetaHat : StructuredLatticePoint k dx (effectRadius dz L sigma0),
conclusion 1
thetaHat.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)
conclusion 2
A.estimate sample = thetaHat.effectLaw
conclusion 3
structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) (empSummary sample) thetaHat
≤ (populationOperatorCoefficient L pi0 sigma0 + 1) * dS (empSummary sample) (obsSummary P)
+ structuredGridCriterionCoefficient k dx dz L sigma0 * latticeMesh k dx n pi0 sigma0
Proof (Lean source)
lemma selected_structuredLatticeCriterion_model_le {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (A : LatticeEstimator k dx dz n (effectRadius dz L sigma0)) (hA : IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A) (sample : Fin n → Obs dx dz) (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hpiMax : pi0 ≤ 1 / (2 * k : ℝ)) (hsigma : 0 < sigma0) (hsigmaMax : sigma0 ≤ 1) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (hsmall : dS (empSummary sample) (obsSummary P) < pi0 * sigma0 ^ 2 / 4) : ∃ thetaHat : StructuredLatticePoint k dx (effectRadius dz L sigma0), thetaHat.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0) ∧ A.estimate sample = thetaHat.effectLaw ∧ structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) (empSummary sample) thetaHat ≤ (populationOperatorCoefficient L pi0 sigma0 + 1) * dS (empSummary sample) (obsSummary P) + structuredGridCriterionCoefficient k dx dz L sigma0 * latticeMesh k dx n pi0 sigma0 := by let s := empSummary sample let p0 := obsSummary P let q := latticeMesh k dx n pi0 sigma0 let e := dS s p0 let cV := structuredGridVConstant k dx let Ltau := effectRadius dz L sigma0 let KD := 4 * sqrt k * L * Ltau / sigma0 obtain ⟨V, R, p, tau, theta, htheta, hm0, hb0, hD0, hRmin, hRnorm, hp, hpSum, htau, hV, hR, hweight, heffect⟩ := population_structuredLatticeComparator_exists (n := n) P hk hkx hL hpi hsigma hM let Vn : SignalBasis dx k := ⟨theta.V, htheta.2.2.1⟩ have hq : 0 ≤ q := by dsimp [q, latticeMesh]; positivity have hp0 (u : Fin k) : 0 ≤ p u := by linarith [hp u] have hweight' : ‖(toLp 2 (theta.weight - p) : Euc k)‖ ≤ sqrt k * q := by rw [EuclideanSpace.norm_eq] simpa [q, Real.norm_eq_abs, sq_abs] using hweight have hRn : ‖matrixCLM theta.R‖ ≤ 2 * sqrt k * L := htheta.2.2.2.2.2.1 have hRnmin : sigma0 / 2 ≤ signalMinSingular theta.R := htheta.2.2.2.2.1 have hmeanRound := rounded_mean_factorization_residual_le V Vn R theta.R p theta.weight hp0 hpSum theta.lawValid.1 theta.lawValid.2.1 (by simpa [Vn, cV, structuredGridVConstant, q] using hV) (by simpa [q] using hR) hRn hRnorm hweight' (by linarith) hq have hmeanPop : ‖Matrix.toEuclideanLin (V.V * R.transpose) (toLp 2 p) - toLp 2 s.mX‖ ≤ e := by have heq : toEuclideanLin (V.V * R.transpose) (toLp 2 p) = toLp 2 p0.mX := by apply PiLp.ext intro i simpa [Matrix.toEuclideanLin_apply, hm0, p0] rw [heq] have hb := AmbientOperatorBridge.norm_mX_sub_le_dS s p0 calc ‖WithLp.toLp 2 p0.mX - toLp 2 s.mX‖ = ‖WithLp.toLp 2 s.mX - toLp 2 p0.mX‖ := norm_sub_rev _ _ _ = ‖(toLp 2 (s.mX - p0.mX) : Euc dx)‖ := by congr 1 _ ≤ e := hb have hmeanRound' : ‖Matrix.toEuclideanLin (Vn.V * theta.R.transpose) (toLp 2 theta.weight) - toEuclideanLin (V.V * R.transpose) (toLp 2 p)‖ ≤ structuredGridMeanCoefficient k dx L * q := by simpa [structuredGridMeanCoefficient, structuredGridVConstant] using hmeanRound have hmeanVec : ‖Matrix.toEuclideanLin (Vn.V * theta.R.transpose) (toLp 2 theta.weight) - toLp 2 s.mX‖ ≤ e + structuredGridMeanCoefficient k dx L * q := by have hdecomp : toEuclideanLin (Vn.V * theta.R.transpose) (toLp 2 theta.weight) - toLp 2 s.mX = (toEuclideanLin (Vn.V * theta.R.transpose) (toLp 2 theta.weight) - toEuclideanLin (V.V * R.transpose) (toLp 2 p)) + (toEuclideanLin (V.V * R.transpose) (toLp 2 p) - toLp 2 s.mX) := by abel rw [hdecomp] calc _ ≤ ‖Matrix.toEuclideanLin (Vn.V * theta.R.transpose) (toLp 2 theta.weight) - toEuclideanLin (V.V * R.transpose) (toLp 2 p)‖ + ‖Matrix.toEuclideanLin (V.V * R.transpose) (toLp 2 p) - toLp 2 s.mX‖ := norm_add_le _ _ _ ≤ structuredGridMeanCoefficient k dx L * q + e := add_le_add hmeanRound' hmeanPop _ = e + structuredGridMeanCoefficient k dx L * q := by ring have hmean : sqrt (∑ i, ((∑ u, theta.V i u * (∑ v, theta.R v u * theta.weight v)) - s.mX i) ^ 2) ≤ e + structuredGridMeanCoefficient k dx L * q := by have hmeanEq : ‖Matrix.toEuclideanLin (Vn.V * theta.R.transpose) (toLp 2 theta.weight) - toLp 2 s.mX‖ = sqrt (∑ i, ((∑ u, theta.V i u * (∑ v, theta.R v u * theta.weight v)) - s.mX i) ^ 2) := by rw [EuclideanSpace.norm_eq] congr 1 apply Finset.sum_congr rfl intro i _ simp only [Real.norm_eq_abs, sq_abs] congr 1 simp only [Matrix.toEuclideanLin_apply, PiLp.sub_apply] change ((Vn.V * theta.R.transpose).mulVec theta.weight) i - s.mX i = _ rw [← Matrix.mulVec_mulVec] simp only [Vn, Matrix.transpose_apply, mulVec, dotProduct] rw [← hmeanEq] exact hmeanVec have hanchorRound := rounded_anchor_factorization_residual_le (by omega) V Vn R theta.R (by simpa [Vn, cV, structuredGridVConstant, q] using hV) (by simpa [q] using hR) hRn (by linarith) hq have hanchor : sqrt (∑ u, ((∑ v, theta.R u v * (∑ i, theta.V i v * firstBasis dx i)) - 1) ^ 2) ≤ structuredGridAnchorCoefficient k dx L * q := by have hanchorEq : ‖Matrix.toEuclideanLin (theta.R * Vn.V.transpose) (toLp 2 (firstBasis dx)) - toEuclideanLin (R * V.V.transpose) (toLp 2 (firstBasis dx))‖ = sqrt (∑ u, ((∑ v, theta.R u v * (∑ i, theta.V i v * firstBasis dx i)) - 1) ^ 2) := by rw [EuclideanSpace.norm_eq] congr 1 apply Finset.sum_congr rfl intro u _ simp only [Real.norm_eq_abs, sq_abs] congr 1 simp only [Matrix.toEuclideanLin_apply, PiLp.sub_apply] rw [show (mulVec (R * V.V.transpose) (firstBasis dx)) u = 1 by simpa using congrFun hb0 u] rw [← Matrix.mulVec_mulVec] simp [Vn, mulVec, dotProduct, Finset.mul_sum] rw [← hanchorEq] simpa [structuredGridAnchorCoefficient, structuredGridVConstant] using hanchorRound have hDround := rounded_operator_factorization_residual_le_of_signalMinSingular V Vn R theta.R tau theta.effect (by simpa [Vn, cV, structuredGridVConstant, q] using hV) (by simpa [q] using hR) hRn hRnorm hRmin hRnmin (fun u => (abs_le.mpr (htau u))) (fun u => abs_le.mpr (theta.lawValid.2.2 u)) heffect (by linarith) (by unfold effectRadius; positivity) hsigma hq (by positivity) rfl have hDemp := empiricalCompressedOperator_model_norm_le P s hk hkx hkz hL hpi hpiMax hsigma hsigmaMax hM (by simpa [s, p0] using hsmall) have hD : ‖matrixCLM (structuredCandidateOperator theta - empiricalCompressedOperator (pi0 * sigma0 ^ 2 / 2) s)‖ ≤ populationOperatorCoefficient L pi0 sigma0 * e + structuredGridOperatorCoefficient k dx dz L sigma0 * q := by have hsplit : structuredCandidateOperator theta - empiricalCompressedOperator (pi0 * sigma0 ^ 2 / 2) s = (structuredCandidateOperator theta - AmbientOperatorBridge.ambientEffectOperator p0) + (AmbientOperatorBridge.ambientEffectOperator p0 - empiricalCompressedOperator (pi0 * sigma0 ^ 2 / 2) s) := by abel rw [hsplit] calc _ ≤ ‖matrixCLM (structuredCandidateOperator theta - AmbientOperatorBridge.ambientEffectOperator p0)‖ + ‖matrixCLM (AmbientOperatorBridge.ambientEffectOperator p0 - empiricalCompressedOperator (pi0 * sigma0 ^ 2 / 2) s)‖ := by simpa only [matrixCLM, map_add] using norm_add_le (matrixCLM (structuredCandidateOperator theta - AmbientOperatorBridge.ambientEffectOperator p0)) (matrixCLM (AmbientOperatorBridge.ambientEffectOperator p0 - empiricalCompressedOperator (pi0 * sigma0 ^ 2 / 2) s)) _ ≤ structuredGridOperatorCoefficient k dx dz L sigma0 * q + populationOperatorCoefficient L pi0 sigma0 * e := by apply add_le_add · simpa [structuredCandidateOperator, Vn, hD0, p0, cV, q, Ltau, KD, structuredGridOperatorCoefficient, structuredGridVConstant] using hDround · have hrev : ‖matrixCLM (AmbientOperatorBridge.ambientEffectOperator p0 - empiricalCompressedOperator (pi0 * sigma0 ^ 2 / 2) s)‖ = ‖matrixCLM (empiricalCompressedOperator (pi0 * sigma0 ^ 2 / 2) s - AmbientOperatorBridge.ambientEffectOperator p0)‖ := by change ‖AmbientOperatorBridge.ambientEffectOperator p0 - empiricalCompressedOperator (pi0 * sigma0 ^ 2 / 2) s‖ = _ exact norm_sub_rev _ _ rw [hrev] simpa [populationOperatorCoefficient, s, p0, e] using hDemp _ = _ := by ring obtain ⟨thetaHat, hthetaHat, hestimate, hmin⟩ := isPrescribedStructuredLattice_selected_criterion_le A hA sample theta htheta refine ⟨thetaHat, hthetaHat, hestimate, hmin.trans ?_⟩ unfold structuredLatticeCriterion change _ ≤ _ simp only [s, p0, e, q] at hD hmean hanchor ⊢ unfold structuredGridCriterionCoefficient linarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.selected_structuredLatticeCriterion_model_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:954
def structuredLatticePathCoefficient

The single frozen path coefficient used to dominate all three selected population residuals after adding the empirical-to-population bridge. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz :
L pi0 sigma0 :
structuredLatticePathCoefficient k dx dz L pi0 sigma0 :
2 * (populationOperatorCoefficient L pi0 sigma0 + 1)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.structuredLatticePathCoefficient · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:1136
theorem selected_structuredLattice_population_residuals_le

The selected grid point obeys the common paper-local path envelope against the population operator, population mean, and exact population anchor. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 :
A :
LatticeEstimator k dx dz n (effectRadius dz L sigma0)
hA :
IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A
sample :
Fin n → Obs dx dz
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hsigma :
0 < sigma0
hsigmaMax :
sigma0 ≤ 1
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
hsmall :
dS (empSummary sample) (obsSummary P) < pi0 * sigma0 ^ 2 / 4
∃ thetaHat : StructuredLatticePoint k dx (effectRadius dz L sigma0),
conclusion 1
thetaHat.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0)
conclusion 2
A.estimate sample = thetaHat.effectLaw
conclusion 3
‖matrixCLM (structuredCandidateOperator thetaHat - AmbientOperatorBridge.ambientEffectOperator (obsSummary P))‖
structuredLatticePathCoefficient k dx dz L pi0 sigma0 * (dS (empSummary sample) (obsSummary P) + latticeMesh k dx n pi0 sigma0)
conclusion 4
sqrt (∑ i, ((∑ u, thetaHat.V i u * (∑ v, thetaHat.R v u * thetaHat.weight v)) - (obsSummary P).mX i) ^ 2)
structuredLatticePathCoefficient k dx dz L pi0 sigma0 * (dS (empSummary sample) (obsSummary P) + latticeMesh k dx n pi0 sigma0)
conclusion 5
sqrt (∑ u, ((∑ v, thetaHat.R u v * (∑ i, thetaHat.V i v * firstBasis dx i)) - 1) ^ 2)
structuredLatticePathCoefficient k dx dz L pi0 sigma0 * (dS (empSummary sample) (obsSummary P) + latticeMesh k dx n pi0 sigma0)
Proof (Lean source)
lemma selected_structuredLattice_population_residuals_le {k dx dz n : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (A : LatticeEstimator k dx dz n (effectRadius dz L sigma0)) (hA : IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A) (sample : Fin n → Obs dx dz) (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hpiMax : pi0 ≤ 1 / (2 * k : ℝ)) (hsigma : 0 < sigma0) (hsigmaMax : sigma0 ≤ 1) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (hsmall : dS (empSummary sample) (obsSummary P) < pi0 * sigma0 ^ 2 / 4) : ∃ thetaHat : StructuredLatticePoint k dx (effectRadius dz L sigma0), thetaHat.WellFormed (dz := dz) (n := n) (L := L) (pi0 := pi0) (sigma0 := sigma0) ∧ A.estimate sample = thetaHat.effectLaw ∧ ‖matrixCLM (structuredCandidateOperator thetaHat - AmbientOperatorBridge.ambientEffectOperator (obsSummary P))‖ ≤ structuredLatticePathCoefficient k dx dz L pi0 sigma0 * (dS (empSummary sample) (obsSummary P) + latticeMesh k dx n pi0 sigma0) ∧ sqrt (∑ i, ((∑ u, thetaHat.V i u * (∑ v, thetaHat.R v u * thetaHat.weight v)) - (obsSummary P).mX i) ^ 2) ≤ structuredLatticePathCoefficient k dx dz L pi0 sigma0 * (dS (empSummary sample) (obsSummary P) + latticeMesh k dx n pi0 sigma0) ∧ sqrt (∑ u, ((∑ v, thetaHat.R u v * (∑ i, thetaHat.V i v * firstBasis dx i)) - 1) ^ 2) ≤ structuredLatticePathCoefficient k dx dz L pi0 sigma0 * (dS (empSummary sample) (obsSummary P) + latticeMesh k dx n pi0 sigma0) := by let s := empSummary sample let p0 := obsSummary P let e := dS s p0 let q := latticeMesh k dx n pi0 sigma0 let AD := populationOperatorCoefficient L pi0 sigma0 let cg := structuredGridCriterionCoefficient k dx dz L sigma0 let B := structuredLatticePathCoefficient k dx dz L pi0 sigma0 obtain ⟨thetaHat, htheta, hestimate, hcrit⟩ := selected_structuredLatticeCriterion_model_le P A hA sample hk hkx hkz hL hpi hpiMax hsigma hsigmaMax hM hsmall have hAD0 : 0 ≤ AD := by dsimp [AD, populationOperatorCoefficient] positivity have hcg0 : 0 ≤ cg := by dsimp [cg, structuredGridCriterionCoefficient, structuredGridOperatorCoefficient, structuredGridMeanCoefficient, structuredGridAnchorCoefficient, structuredGridVConstant] unfold effectRadius positivity have hB : B = 2 * (AD + 1) + cg := rfl have hB0 : 0 ≤ B := by rw [hB]; positivity have he0 : 0 ≤ e := by dsimp [e]; unfold dS; positivity have hq0 : 0 ≤ q := by dsimp [q, latticeMesh]; positivity have hcrit' : structuredLatticeCriterion (pi0 * sigma0 ^ 2 / 2) s thetaHat ≤ (AD + 1) * e + cg * q := by simpa [s, p0, e, q, AD, cg] using hcrit have hopEmp := structuredLatticeCriterion_operator_le (tau := pi0 * sigma0 ^ 2 / 2) s thetaHat have hmEmp := structuredLatticeCriterion_mean_le (tau := pi0 * sigma0 ^ 2 / 2) s thetaHat have hb := structuredLatticeCriterion_anchor_le (tau := pi0 * sigma0 ^ 2 / 2) s thetaHat have hDemp := empiricalCompressedOperator_model_norm_le P s hk hkx hkz hL hpi hpiMax hsigma hsigmaMax hM (by simpa [s, p0] using hsmall) have hDemp' : ‖matrixCLM (empiricalCompressedOperator (pi0 * sigma0 ^ 2 / 2) s - AmbientOperatorBridge.ambientEffectOperator p0)‖ ≤ AD * e := by simpa [AD, e, s, p0, populationOperatorCoefficient] using hDemp have hopRaw : ‖matrixCLM (structuredCandidateOperator thetaHat - AmbientOperatorBridge.ambientEffectOperator p0)‖ ≤ (2 * AD + 1) * e + cg * q := by have hsplit : structuredCandidateOperator thetaHat - AmbientOperatorBridge.ambientEffectOperator p0 = (structuredCandidateOperator thetaHat - empiricalCompressedOperator (pi0 * sigma0 ^ 2 / 2) s) + (empiricalCompressedOperator (pi0 * sigma0 ^ 2 / 2) s - AmbientOperatorBridge.ambientEffectOperator p0) := by abel rw [hsplit] calc _ ≤ ‖matrixCLM (structuredCandidateOperator thetaHat - empiricalCompressedOperator (pi0 * sigma0 ^ 2 / 2) s)‖ + ‖matrixCLM (empiricalCompressedOperator (pi0 * sigma0 ^ 2 / 2) s - AmbientOperatorBridge.ambientEffectOperator p0)‖ := by simpa only [matrixCLM, map_add] using norm_add_le (matrixCLM (structuredCandidateOperator thetaHat - empiricalCompressedOperator (pi0 * sigma0 ^ 2 / 2) s)) (matrixCLM (empiricalCompressedOperator (pi0 * sigma0 ^ 2 / 2) s - AmbientOperatorBridge.ambientEffectOperator p0)) _ ≤ ((AD + 1) * e + cg * q) + AD * e := add_le_add (hopEmp.trans hcrit') hDemp' _ = (2 * AD + 1) * e + cg * q := by ring have hmBlock := AmbientOperatorBridge.norm_mX_sub_le_dS s p0 have hmRaw : sqrt (∑ i, ((∑ u, thetaHat.V i u * (∑ v, thetaHat.R v u * thetaHat.weight v)) - p0.mX i) ^ 2) ≤ (AD + 2) * e + cg * q := by let mhat : Fin dx → ℝ := fun i => ∑ u, thetaHat.V i u * (∑ v, thetaHat.R v u * thetaHat.weight v) have hmEmpVec : ‖(toLp 2 (mhat - s.mX) : Euc dx)‖ ≤ (AD + 1) * e + cg * q := by rw [EuclideanSpace.norm_eq] simpa [mhat, Real.norm_eq_abs, sq_abs] using hmEmp.trans hcrit' have hmBlock' : ‖(toLp 2 (s.mX - p0.mX) : Euc dx)‖ ≤ e := hmBlock have hdecomp : (toLp 2 (mhat - p0.mX) : Euc dx) = toLp 2 (mhat - s.mX) + toLp 2 (s.mX - p0.mX) := by apply PiLp.ext intro i simp have hmEq : ‖(toLp 2 (mhat - p0.mX) : Euc dx)‖ = sqrt (∑ i, ((∑ u, thetaHat.V i u * (∑ v, thetaHat.R v u * thetaHat.weight v)) - p0.mX i) ^ 2) := by rw [EuclideanSpace.norm_eq] simp [mhat, Real.norm_eq_abs, sq_abs] rw [← hmEq] rw [hdecomp] exact (norm_add_le _ _).trans <| by calc _ ≤ ((AD + 1) * e + cg * q) + e := add_le_add hmEmpVec hmBlock' _ = (AD + 2) * e + cg * q := by ring have hAD2B : AD + 2 ≤ B := by rw [hB]; linarith have h2AD1B : 2 * AD + 1 ≤ B := by rw [hB]; linarith have hcgB : cg ≤ B := by rw [hB]; linarith have hopenv : (2 * AD + 1) * e + cg * q ≤ B * (e + q) := by calc _ ≤ B * e + B * q := add_le_add (mul_le_mul_of_nonneg_right h2AD1B he0) (mul_le_mul_of_nonneg_right hcgB hq0) _ = _ := by ring have hmenv : (AD + 2) * e + cg * q ≤ B * (e + q) := by calc _ ≤ B * e + B * q := add_le_add (mul_le_mul_of_nonneg_right hAD2B he0) (mul_le_mul_of_nonneg_right hcgB hq0) _ = _ := by ring have hbenv : (AD + 1) * e + cg * q ≤ B * (e + q) := by have hADB : AD + 1 ≤ B := by rw [hB]; linarith calc _ ≤ B * e + B * q := add_le_add (mul_le_mul_of_nonneg_right hADB he0) (mul_le_mul_of_nonneg_right hcgB hq0) _ = _ := by ring refine ⟨thetaHat, htheta, hestimate, ?_, ?_, ?_⟩ · simpa [B, e, q, s, p0] using hopRaw.trans hopenv · simpa [B, e, q, s, p0] using hmRaw.trans hmenv · simpa [B, e, q, s, p0] using hb.trans (hcrit'.trans hbenv)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.selected_structuredLattice_population_residuals_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:1143
theorem population_mean_residual_le_dS

The population mean factorization leaves only the mean block of the summary distance. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
s s0 :
V :
R :
p :
Fin k → ℝ
hm :
s0.mX = mulVec (V.V * R.transpose) p
‖Matrix.toEuclideanLin (V.V * R.transpose) (toLp 2 p) - toLp 2 s.mX‖
dS s s0
Proof (Lean source)
lemma population_mean_residual_le_dS {k dx dz : ℕ} (s s0 : SummarySpace dx dz) (V : SignalBasis dx k) (R : RectMatrix k k) (p : Fin k → ℝ) (hm : s0.mX = mulVec (V.V * R.transpose) p) : ‖Matrix.toEuclideanLin (V.V * R.transpose) (toLp 2 p) - toLp 2 s.mX‖ ≤ dS s s0 := by have hblock := AmbientOperatorBridge.norm_mX_sub_le_dS s s0 have heq : toEuclideanLin (V.V * R.transpose) (toLp 2 p) = toLp 2 s0.mX := by apply PiLp.ext intro i simpa [Matrix.toEuclideanLin_apply, hm] rw [heq] calc ‖WithLp.toLp 2 s0.mX - toLp 2 s.mX‖ = ‖WithLp.toLp 2 s.mX - toLp 2 s0.mX‖ := norm_sub_rev _ _ _ ≤ dS s s0 := hblock
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.population_mean_residual_le_dS · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:1286
theorem population_anchor_residual_eq_zero

Criterion-coordinate form of the exact population anchor residual. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx :
V :
R :
hanchor :
mulVec (R * V.V.transpose) (firstBasis dx) = (fun _ => (1 : ℝ))
sqrt (∑ u, ((∑ v, R u v * (∑ i, V.V i v * firstBasis dx i)) - 1) ^ 2) = 0
Proof (Lean source)
lemma population_anchor_residual_eq_zero {k dx : ℕ} (V : SignalBasis dx k) (R : RectMatrix k k) (hanchor : mulVec (R * V.V.transpose) (firstBasis dx) = (fun _ => (1 : ℝ))) : sqrt (∑ u, ((∑ v, R u v * (∑ i, V.V i v * firstBasis dx i)) - 1) ^ 2) = 0 := by have hu (u : Fin k) : (∑ v, R u v * (∑ i, V.V i v * firstBasis dx i)) = 1 := by have := congrFun hanchor u change (R.mulVec (V.V.transpose.mulVec (firstBasis dx))) u = 1 simpa only [Matrix.mulVec_mulVec] using this simp_rw [hu, sub_self, zero_pow (by norm_num : (2 : ℕ) ≠ 0)] simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.population_anchor_residual_eq_zero · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticePopulation.lean:1306
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.StructuredLatticeResiduals 9 declarations Factorwise residual estimates for the rounded comparator

Factorwise residual estimates for the rounded comparator

theorem matrixCLM_norm_le_one

Matrix clm norm le one: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
V :
‖matrixCLM V.V‖ ≤ 1
Proof (Lean source)
lemma SignalBasis.matrixCLM_norm_le_one {dx k : ℕ} (V : SignalBasis dx k) : ‖matrixCLM V.V‖ ≤ 1 := by apply ContinuousLinearMap.opNorm_le_bound _ (by norm_num) intro x have hn := (signalBasisLinearIsometry V).norm_map x rw [one_mul] change ‖Matrix.toEuclideanLin V.V x‖ ≤ ‖x‖ exact hn.le
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.SignalBasis.matrixCLM_norm_le_one · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeResiduals.lean:11
theorem matrix_det_isUnit_of_signalMinSingular_pos

A positive square signal margin makes the ordinary nonsingular inverse available. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
A :
hA :
IsUnit A.det
Proof (Lean source)
lemma matrix_det_isUnit_of_signalMinSingular_pos {k : ℕ} (A : RectMatrix k k) (hA : 0 < signalMinSingular A) : IsUnit A.det := by have hinj := publishedMomentIdentity_injective_of_signalMinSingular_pos A hA have hgram := publishedMomentIdentity_gram_det_isUnit_of_injective A hinj apply isUnit_iff_ne_zero.mpr intro hdet apply hgram.ne_zero rw [Matrix.det_mul, Matrix.det_transpose, hdet, mul_zero]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.matrix_det_isUnit_of_signalMinSingular_pos · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeResiduals.lean:21
theorem matrix_inv_norm_le_of_signalMinSingular

The inverse norm is the reciprocal of any certified lower singular margin. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
A :
s :
hs :
0 < s
hA :
‖matrixCLM A⁻¹‖ ≤ 1 / s
Proof (Lean source)
lemma matrix_inv_norm_le_of_signalMinSingular {k : ℕ} (A : RectMatrix k k) {s : ℝ} (hs : 0 < s) (hA : s ≤ signalMinSingular A) : ‖matrixCLM A⁻¹‖ ≤ 1 / s := by have hpos : 0 < signalMinSingular A := hs.trans_le hA have hinj := publishedMomentIdentity_injective_of_signalMinSingular_pos A hpos have hdet := matrix_det_isUnit_of_signalMinSingular_pos A hpos apply ContinuousLinearMap.opNorm_le_bound _ (by positivity) intro y have hlo := singular_value_variational_lower A hinj (matrixCLM A⁻¹ y) have hlower : s * ‖matrixCLM A⁻¹ y‖ ≤ ‖Matrix.toEuclideanLin A (matrixCLM A⁻¹ y)‖ := (mul_le_mul_of_nonneg_right hA (norm_nonneg _)).trans hlo have himage : toEuclideanLin A (matrixCLM A⁻¹ y) = y := by apply PiLp.ext intro i simp [matrixCLM, Matrix.toEuclideanLin_apply, Matrix.mulVec_mulVec, Matrix.mul_nonsing_inv A hdet] rw [himage] at hlower simpa [one_div] using (le_inv_mul_iff₀ hs).2 hlower
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.matrix_inv_norm_le_of_signalMinSingular · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeResiduals.lean:31
theorem matrix_inv_sub_inv_norm_le_of_signalMinSingular

The exact inverse perturbation estimate used by the frozen operator coefficient. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
R Rn :
sigma0 q :
hsigma0 :
0 < sigma0
hRmin :
sigma0 ≤ signalMinSingular R
hRnmin :
sigma0 / 2 ≤ signalMinSingular Rn
hR :
‖matrixCLM (Rn - R)‖ ≤ (k : ℝ) * q
hq :
0 ≤ q
‖matrixCLM (Rn⁻¹ - R⁻¹)‖ ≤ 2 * k * q / sigma0 ^ 2
Proof (Lean source)
lemma matrix_inv_sub_inv_norm_le_of_signalMinSingular {k : ℕ} (R Rn : RectMatrix k k) {sigma0 q : ℝ} (hsigma0 : 0 < sigma0) (hRmin : sigma0 ≤ signalMinSingular R) (hRnmin : sigma0 / 2 ≤ signalMinSingular Rn) (hR : ‖matrixCLM (Rn - R)‖ ≤ (k : ℝ) * q) (hq : 0 ≤ q) : ‖matrixCLM (Rn⁻¹ - R⁻¹)‖ ≤ 2 * k * q / sigma0 ^ 2 := by have hhalf : 0 < sigma0 / 2 := by positivity have hRnInv := matrix_inv_norm_le_of_signalMinSingular Rn hhalf hRnmin have hRInv := matrix_inv_norm_le_of_signalMinSingular R hsigma0 hRmin have hRdet := matrix_det_isUnit_of_signalMinSingular_pos R (hsigma0.trans_le hRmin) have hRndet := matrix_det_isUnit_of_signalMinSingular_pos Rn (hhalf.trans_le hRnmin) have hid : Rn⁻¹ - R⁻¹ = Rn⁻¹ * (R - Rn) * R⁻¹ := by calc Rn⁻¹ - R⁻¹ = Rn⁻¹ * R * R⁻¹ - Rn⁻¹ * Rn * R⁻¹ := by simp [Matrix.mul_assoc, Matrix.nonsing_inv_mul Rn hRndet, Matrix.mul_nonsing_inv R hRdet] _ = Rn⁻¹ * (R - Rn) * R⁻¹ := by noncomm_ring change ‖Rn⁻¹ - R⁻¹‖ ≤ _ change ‖Rn⁻¹‖ ≤ _ at hRnInv change ‖R⁻¹‖ ≤ _ at hRInv change ‖Rn - R‖ ≤ _ at hR rw [hid] calc ‖Rn⁻¹ * (R - Rn) * R⁻¹‖ ≤ ‖Rn⁻¹‖ * ‖R - Rn‖ * ‖R⁻¹‖ := by exact (Matrix.l2_opNorm_mul _ _).trans (mul_le_mul_of_nonneg_right (Matrix.l2_opNorm_mul _ _) (norm_nonneg _)) _ ≤ (2 / sigma0) * ((k : ℝ) * q) * (1 / sigma0) := by rw [norm_sub_rev] gcongr simpa [div_eq_mul_inv] using hRnInv _ = 2 * k * q / sigma0 ^ 2 := by field_simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.matrix_inv_sub_inv_norm_le_of_signalMinSingular · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeResiduals.lean:52
theorem probabilityVector_euc_norm_le_one

A finite probability vector has Euclidean norm at most one. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
p :
Fin k → ℝ
hp :
∀ u, 0 ≤ p u
hsum :
∑ u, p u = 1
‖(toLp 2 p : Euc k)‖ ≤ 1
Proof (Lean source)
lemma probabilityVector_euc_norm_le_one {k : ℕ} (p : Fin k → ℝ) (hp : ∀ u, 0 ≤ p u) (hsum : ∑ u, p u = 1) : ‖(toLp 2 p : Euc k)‖ ≤ 1 := by have hple (u : Fin k) : p u ≤ 1 := by calc p u ≤ ∑ v, p v := Finset.single_le_sum (fun v _ => hp v) (Finset.mem_univ u) _ = 1 := hsum apply (sq_le_sq₀ (norm_nonneg _) (by norm_num)).1 rw [EuclideanSpace.real_norm_sq_eq, one_pow] calc ∑ u, ((toLp 2 p : Euc k) u) ^ 2 ≤ ∑ u, p u := by apply Finset.sum_le_sum intro u _ change p u ^ 2 ≤ p u nlinarith [hp u, hple u] _ = 1 := hsum
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.probabilityVector_euc_norm_le_one · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeResiduals.lean:86
theorem rounded_mean_factorization_residual_le

Factorwise perturbation of the observable mean reconstruction. Substituting cV = 4*sqrt(dx*k) gives exactly the frozen cm coefficient. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
L q cV :
V Vn :
R Rn :
p pn :
Fin k → ℝ
hp :
∀ u, 0 ≤ p u
hpSum :
∑ u, p u = 1
hpn :
∀ u, 0 ≤ pn u
hpnSum :
∑ u, pn u = 1
hV :
‖matrixCLM (Vn.V - V.V)‖ ≤ cV * q
hR :
‖matrixCLM (Rn - R)‖ ≤ (k : ℝ) * q
hRn :
‖matrixCLM Rn‖ ≤ 2 * sqrt k * L
hR0 :
‖matrixCLM R‖ ≤ sqrt k * L
hweight :
‖(toLp 2 (pn - p) : Euc k)‖ ≤ sqrt k * q
hL :
0 ≤ L
hq :
0 ≤ q
‖Matrix.toEuclideanLin (Vn.V * Rn.transpose) (toLp 2 pn) - toEuclideanLin (V.V * R.transpose) (toLp 2 p)‖
≤ (2 * sqrt k * L * cV + k + k * L) * q
Proof (Lean source)
lemma rounded_mean_factorization_residual_le {dx k : ℕ} {L q cV : ℝ} (V Vn : SignalBasis dx k) (R Rn : RectMatrix k k) (p pn : Fin k → ℝ) (hp : ∀ u, 0 ≤ p u) (hpSum : ∑ u, p u = 1) (hpn : ∀ u, 0 ≤ pn u) (hpnSum : ∑ u, pn u = 1) (hV : ‖matrixCLM (Vn.V - V.V)‖ ≤ cV * q) (hR : ‖matrixCLM (Rn - R)‖ ≤ (k : ℝ) * q) (hRn : ‖matrixCLM Rn‖ ≤ 2 * sqrt k * L) (hR0 : ‖matrixCLM R‖ ≤ sqrt k * L) (hweight : ‖(toLp 2 (pn - p) : Euc k)‖ ≤ sqrt k * q) (hL : 0 ≤ L) (hq : 0 ≤ q) : ‖Matrix.toEuclideanLin (Vn.V * Rn.transpose) (toLp 2 pn) - toEuclideanLin (V.V * R.transpose) (toLp 2 p)‖ ≤ (2 * sqrt k * L * cV + k + k * L) * q := by let pnE : Euc k := toLp 2 pn let pE : Euc k := toLp 2 p let dE : Euc k := toLp 2 (pn - p) have hpnNorm : ‖pnE‖ ≤ 1 := probabilityVector_euc_norm_le_one pn hpn hpnSum change ‖Vn.V - V.V‖ ≤ cV * q at hV change ‖Rn - R‖ ≤ (k : ℝ) * q at hR change ‖Rn‖ ≤ 2 * sqrt k * L at hRn change ‖R‖ ≤ sqrt k * L at hR0 have hfirst : toEuclideanLin ((Vn.V - V.V) * Rn.transpose) pnE = toEuclideanLin (Vn.V * Rn.transpose) pnE - toEuclideanLin (V.V * Rn.transpose) pnE := by apply PiLp.ext intro i simp [Matrix.toEuclideanLin_apply, Matrix.sub_mul, Matrix.sub_mulVec] have hsecond : toEuclideanLin (V.V * (Rn - R).transpose) pnE = toEuclideanLin (V.V * Rn.transpose) pnE - toEuclideanLin (V.V * R.transpose) pnE := by apply PiLp.ext intro i simp [Matrix.toEuclideanLin_apply, Matrix.transpose_sub, Matrix.mul_sub, Matrix.sub_mulVec] have hthird : toEuclideanLin (V.V * R.transpose) dE = toEuclideanLin (V.V * R.transpose) pnE - toEuclideanLin (V.V * R.transpose) pE := by apply PiLp.ext intro i simp [pnE, pE, dE, Matrix.toEuclideanLin_apply, Matrix.mulVec_sub] have hdecomp : toEuclideanLin (Vn.V * Rn.transpose) pnE - toEuclideanLin (V.V * R.transpose) pE = toEuclideanLin ((Vn.V - V.V) * Rn.transpose) pnE + toEuclideanLin (V.V * (Rn - R).transpose) pnE + toEuclideanLin (V.V * R.transpose) dE := by rw [hfirst, hsecond, hthird] abel rw [hdecomp] calc ‖Matrix.toEuclideanLin ((Vn.V - V.V) * Rn.transpose) pnE + toEuclideanLin (V.V * (Rn - R).transpose) pnE + toEuclideanLin (V.V * R.transpose) dE‖ ≤ ‖Matrix.toEuclideanLin ((Vn.V - V.V) * Rn.transpose) pnE‖ + ‖Matrix.toEuclideanLin (V.V * (Rn - R).transpose) pnE‖ + ‖Matrix.toEuclideanLin (V.V * R.transpose) dE‖ := by exact (norm_add_le _ _).trans (add_le_add (norm_add_le _ _) le_rfl) _ ≤ (cV * q) * (2 * sqrt k * L) * 1 + (1 * ((k : ℝ) * q)) * 1 + (1 * (sqrt k * L)) * (sqrt k * q) := by have ht (A : RectMatrix k k) : ‖A.transpose‖ = ‖A‖ := by simpa [Matrix.conjTranspose_eq_transpose_of_trivial] using Matrix.l2_opNorm_conjTranspose A have hmul (A : RectMatrix dx k) (B : RectMatrix k k) (x : Euc k) : ‖Matrix.toEuclideanLin (A * B) x‖ ≤ ‖A‖ * ‖B‖ * ‖x‖ := by exact (Matrix.l2_opNorm_mulVec (A * B) x).trans (mul_le_mul_of_nonneg_right (Matrix.l2_opNorm_mul A B) (norm_nonneg x)) apply add_le_add · apply add_le_add · exact (hmul (Vn.V - V.V) Rn.transpose pnE).trans (by rw [ht Rn] have hV0 : 0 ≤ cV * q := (norm_nonneg _).trans hV gcongr) · exact (hmul V.V (Rn - R).transpose pnE).trans (by rw [ht (Rn - R)] gcongr exact V.matrixCLM_norm_le_one) · exact (hmul V.V R.transpose dE).trans (by rw [ht R] gcongr exact V.matrixCLM_norm_le_one) _ = (2 * sqrt k * L * cV + k + k * L) * q := by have hs : sqrt k * sqrt k = (k : ℝ) := Real.mul_self_sqrt (Nat.cast_nonneg k) calc cV * q * (2 * sqrt k * L) * 1 + 1 * ((k : ℝ) * q) * 1 + 1 * (sqrt k * L) * (sqrt k * q) = 2 * sqrt k * L * cV * q + (k : ℝ) * q + (sqrt k * sqrt k) * L * q := by ring _ = (2 * sqrt k * L * cV + k + k * L) * q := by rw [hs]; ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.rounded_mean_factorization_residual_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeResiduals.lean:104
theorem rounded_anchor_factorization_residual_le

Factorwise perturbation of the anchor reconstruction. This is the exact frozen cb coefficient after substituting cV = 4*sqrt(dx*k). Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
L q cV :
hdx :
0 < dx
V Vn :
R Rn :
hV :
‖matrixCLM (Vn.V - V.V)‖ ≤ cV * q
hR :
‖matrixCLM (Rn - R)‖ ≤ (k : ℝ) * q
hRn :
‖matrixCLM Rn‖ ≤ 2 * sqrt k * L
hL :
0 ≤ L
hq :
0 ≤ q
‖Matrix.toEuclideanLin (Rn * Vn.V.transpose) (toLp 2 (firstBasis dx)) - toEuclideanLin (R * V.V.transpose) (toLp 2 (firstBasis dx))‖
≤ ((k : ℝ) + 2 * sqrt k * L * cV) * q
Proof (Lean source)
lemma rounded_anchor_factorization_residual_le {dx k : ℕ} {L q cV : ℝ} (hdx : 0 < dx) (V Vn : SignalBasis dx k) (R Rn : RectMatrix k k) (hV : ‖matrixCLM (Vn.V - V.V)‖ ≤ cV * q) (hR : ‖matrixCLM (Rn - R)‖ ≤ (k : ℝ) * q) (hRn : ‖matrixCLM Rn‖ ≤ 2 * sqrt k * L) (hL : 0 ≤ L) (hq : 0 ≤ q) : ‖Matrix.toEuclideanLin (Rn * Vn.V.transpose) (toLp 2 (firstBasis dx)) - toEuclideanLin (R * V.V.transpose) (toLp 2 (firstBasis dx))‖ ≤ ((k : ℝ) + 2 * sqrt k * L * cV) * q := by let e1 : Euc dx := toLp 2 (firstBasis dx) have he1 : ‖e1‖ = 1 := by cases dx with | zero => omega | succ d => rw [EuclideanSpace.norm_eq, Fin.sum_univ_succ] simp [e1, firstBasis] change ‖Vn.V - V.V‖ ≤ cV * q at hV change ‖Rn - R‖ ≤ (k : ℝ) * q at hR change ‖Rn‖ ≤ 2 * sqrt k * L at hRn have hfirst : toEuclideanLin ((Rn - R) * V.V.transpose) e1 = toEuclideanLin (Rn * V.V.transpose) e1 - toEuclideanLin (R * V.V.transpose) e1 := by apply PiLp.ext intro i simp [Matrix.toEuclideanLin_apply, Matrix.sub_mul] have hsecond : toEuclideanLin (Rn * (Vn.V - V.V).transpose) e1 = toEuclideanLin (Rn * Vn.V.transpose) e1 - toEuclideanLin (Rn * V.V.transpose) e1 := by apply PiLp.ext intro i simp [Matrix.toEuclideanLin_apply, Matrix.transpose_sub, Matrix.mul_sub] have hdecomp : toEuclideanLin (Rn * Vn.V.transpose) e1 - toEuclideanLin (R * V.V.transpose) e1 = toEuclideanLin ((Rn - R) * V.V.transpose) e1 + toEuclideanLin (Rn * (Vn.V - V.V).transpose) e1 := by rw [hfirst, hsecond] abel rw [show (toLp 2 (firstBasis dx) : Euc dx) = e1 by rfl, hdecomp] calc ‖Matrix.toEuclideanLin ((Rn - R) * V.V.transpose) e1 + toEuclideanLin (Rn * (Vn.V - V.V).transpose) e1‖ ≤ ‖Matrix.toEuclideanLin ((Rn - R) * V.V.transpose) e1‖ + ‖Matrix.toEuclideanLin (Rn * (Vn.V - V.V).transpose) e1‖ := norm_add_le _ _ _ ≤ (((k : ℝ) * q) * 1) * 1 + ((2 * sqrt k * L) * (cV * q)) * 1 := by have htV : ‖V.V.transpose‖ = ‖V.V‖ := by simpa [Matrix.conjTranspose_eq_transpose_of_trivial] using Matrix.l2_opNorm_conjTranspose V.V have htD : ‖(Vn.V - V.V).transpose‖ = ‖Vn.V - V.V‖ := by simpa [Matrix.conjTranspose_eq_transpose_of_trivial] using Matrix.l2_opNorm_conjTranspose (Vn.V - V.V) have hmul (A : RectMatrix k k) (B : RectMatrix k dx) : ‖Matrix.toEuclideanLin (A * B) e1‖ ≤ ‖A‖ * ‖B‖ * ‖e1‖ := by exact (Matrix.l2_opNorm_mulVec (A * B) e1).trans (mul_le_mul_of_nonneg_right (Matrix.l2_opNorm_mul A B) (norm_nonneg e1)) apply add_le_add · exact (hmul (Rn - R) V.V.transpose).trans (by rw [htV, he1] gcongr exact V.matrixCLM_norm_le_one) · exact (hmul Rn (Vn.V - V.V).transpose).trans (by rw [htD, he1] have hV0 : 0 ≤ cV * q := (norm_nonneg _).trans hV gcongr) _ = ((k : ℝ) + 2 * sqrt k * L * cV) * q := by ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.rounded_anchor_factorization_residual_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeResiduals.lean:200
theorem rounded_operator_factorization_residual_le

Factorwise perturbation of the similarity-transformed diagonal operator. The hypotheses expose the three analytic ingredients needed downstream: inverse stability, inverse norm control, and coordinatewise effect rounding. With KD = 4 * sqrt k * L * Ltau / sigma0, the conclusion is the frozen cD coefficient. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
L Ltau sigma0 q cV KD :
V Vn :
R Rn :
tau taun :
Fin k → ℝ
hV :
‖matrixCLM (Vn.V - V.V)‖ ≤ cV * q
hR :
‖matrixCLM (Rn - R)‖ ≤ (k : ℝ) * q
hRn :
‖matrixCLM Rn‖ ≤ 2 * sqrt k * L
hR0 :
‖matrixCLM R‖ ≤ sqrt k * L
hRinv :
‖matrixCLM R⁻¹‖ ≤ 1 / sigma0
hRninv :
‖matrixCLM Rn⁻¹‖ ≤ 2 / sigma0
hInvDiff :
‖matrixCLM (Rn⁻¹ - R⁻¹)‖ ≤ 2 * k * q / sigma0 ^ 2
htau :
∀ u, |tau u| ≤ Ltau
htaun :
∀ u, |taun u| ≤ Ltau
htauDiff :
∀ u, |taun u - tau u| ≤ q
hL :
0 ≤ L
hLtau :
0 ≤ Ltau
hsigma0 :
0 < sigma0
hq :
0 ≤ q
hcV :
0 ≤ cV
hKD :
KD = 4 * sqrt k * L * Ltau / sigma0
‖matrixCLM (Vn.V * Rn⁻¹ * diagonal taun * Rn * Vn.V.transpose - V.V * R⁻¹ * diagonal tau * R * V.V.transpose)‖
≤ (2 * KD * cV + 4 * k * sqrt k * L * Ltau / sigma0 ^ 2 + 2 * sqrt k * L / sigma0 + k * Ltau / sigma0) * q
Proof (Lean source)
lemma rounded_operator_factorization_residual_le {dx k : ℕ} {L Ltau sigma0 q cV KD : ℝ} (V Vn : SignalBasis dx k) (R Rn : RectMatrix k k) (tau taun : Fin k → ℝ) (hV : ‖matrixCLM (Vn.V - V.V)‖ ≤ cV * q) (hR : ‖matrixCLM (Rn - R)‖ ≤ (k : ℝ) * q) (hRn : ‖matrixCLM Rn‖ ≤ 2 * sqrt k * L) (hR0 : ‖matrixCLM R‖ ≤ sqrt k * L) (hRinv : ‖matrixCLM R⁻¹‖ ≤ 1 / sigma0) (hRninv : ‖matrixCLM Rn⁻¹‖ ≤ 2 / sigma0) (hInvDiff : ‖matrixCLM (Rn⁻¹ - R⁻¹)‖ ≤ 2 * k * q / sigma0 ^ 2) (htau : ∀ u, |tau u| ≤ Ltau) (htaun : ∀ u, |taun u| ≤ Ltau) (htauDiff : ∀ u, |taun u - tau u| ≤ q) (hL : 0 ≤ L) (hLtau : 0 ≤ Ltau) (hsigma0 : 0 < sigma0) (hq : 0 ≤ q) (hcV : 0 ≤ cV) (hKD : KD = 4 * sqrt k * L * Ltau / sigma0) : ‖matrixCLM (Vn.V * Rn⁻¹ * diagonal taun * Rn * Vn.V.transpose - V.V * R⁻¹ * diagonal tau * R * V.V.transpose)‖ ≤ (2 * KD * cV + 4 * k * sqrt k * L * Ltau / sigma0 ^ 2 + 2 * sqrt k * L / sigma0 + k * Ltau / sigma0) * q := by change ‖Vn.V - V.V‖ ≤ cV * q at hV change ‖Rn - R‖ ≤ (k : ℝ) * q at hR change ‖Rn‖ ≤ 2 * sqrt k * L at hRn change ‖R‖ ≤ sqrt k * L at hR0 change ‖R⁻¹‖ ≤ 1 / sigma0 at hRinv change ‖Rn⁻¹‖ ≤ 2 / sigma0 at hRninv change ‖Rn⁻¹ - R⁻¹‖ ≤ 2 * k * q / sigma0 ^ 2 at hInvDiff have hVnNorm : ‖Vn.V‖ ≤ 1 := Vn.matrixCLM_norm_le_one have hVNorm : ‖V.V‖ ≤ 1 := V.matrixCLM_norm_le_one have htVn : ‖Vn.V.transpose‖ = ‖Vn.V‖ := by simpa [Matrix.conjTranspose_eq_transpose_of_trivial] using Matrix.l2_opNorm_conjTranspose Vn.V have htV : ‖V.V.transpose‖ = ‖V.V‖ := by simpa [Matrix.conjTranspose_eq_transpose_of_trivial] using Matrix.l2_opNorm_conjTranspose V.V have htDiff : ‖(Vn.V - V.V).transpose‖ = ‖Vn.V - V.V‖ := by simpa [Matrix.conjTranspose_eq_transpose_of_trivial] using Matrix.l2_opNorm_conjTranspose (Vn.V - V.V) have hDn : ‖Matrix.diagonal taun‖ ≤ Ltau := by rw [Matrix.l2_opNorm_diagonal, pi_norm_le_iff_of_nonneg hLtau] intro u simpa [Real.norm_eq_abs] using htaun u have hD : ‖Matrix.diagonal tau‖ ≤ Ltau := by rw [Matrix.l2_opNorm_diagonal, pi_norm_le_iff_of_nonneg hLtau] intro u simpa [Real.norm_eq_abs] using htau u have hDdiff : ‖Matrix.diagonal taun - diagonal tau‖ ≤ q := by have hdiagSub : diagonal taun - diagonal tau = diagonal (taun - tau) := by ext i j by_cases hij : i = j <;> simp [Matrix.diagonal_apply, hij] rw [hdiagSub, Matrix.l2_opNorm_diagonal, pi_norm_le_iff_of_nonneg hq] intro u simpa [Real.norm_eq_abs] using htauDiff u let a := (Vn.V - V.V) * Rn⁻¹ * diagonal taun * Rn * Vn.V.transpose let b := V.V * (Rn⁻¹ - R⁻¹) * diagonal taun * Rn * Vn.V.transpose let c := V.V * R⁻¹ * (diagonal taun - diagonal tau) * Rn * Vn.V.transpose let d := V.V * R⁻¹ * diagonal tau * (Rn - R) * Vn.V.transpose let e := V.V * R⁻¹ * diagonal tau * R * (Vn.V - V.V).transpose have hdecomp : Vn.V * Rn⁻¹ * diagonal taun * Rn * Vn.V.transpose - V.V * R⁻¹ * diagonal tau * R * V.V.transpose = a + b + c + d + e := by have ha : a = Vn.V * Rn⁻¹ * diagonal taun * Rn * Vn.V.transpose - V.V * Rn⁻¹ * diagonal taun * Rn * Vn.V.transpose := by simp [a, Matrix.sub_mul] have hb : b = V.V * Rn⁻¹ * diagonal taun * Rn * Vn.V.transpose - V.V * R⁻¹ * diagonal taun * Rn * Vn.V.transpose := by simp [b, Matrix.mul_sub, Matrix.sub_mul] have hc : c = V.V * R⁻¹ * diagonal taun * Rn * Vn.V.transpose - V.V * R⁻¹ * diagonal tau * Rn * Vn.V.transpose := by change V.V * R⁻¹ * (diagonal taun - diagonal tau) * Rn * Vn.V.transpose = _ simp only [Matrix.mul_sub, Matrix.sub_mul] have hd : d = V.V * R⁻¹ * diagonal tau * Rn * Vn.V.transpose - V.V * R⁻¹ * diagonal tau * R * Vn.V.transpose := by simp [d, Matrix.mul_sub, Matrix.sub_mul] have he : e = V.V * R⁻¹ * diagonal tau * R * Vn.V.transpose - V.V * R⁻¹ * diagonal tau * R * V.V.transpose := by simp [e, Matrix.transpose_sub, Matrix.mul_sub] rw [ha, hb, hc, hd, he] abel rw [hdecomp] have hsum : ‖a + b + c + d + e‖ ≤ ‖a‖ + ‖b‖ + ‖c‖ + ‖d‖ + ‖e‖ := by calc ‖a + b + c + d + e‖ ≤ ‖a + b + c + d‖ + ‖e‖ := norm_add_le _ _ _ ≤ (‖a + b + c‖ + ‖d‖) + ‖e‖ := by gcongr; exact norm_add_le _ _ _ ≤ ((‖a + b‖ + ‖c‖) + ‖d‖) + ‖e‖ := by gcongr; exact norm_add_le _ _ _ ≤ (((‖a‖ + ‖b‖) + ‖c‖) + ‖d‖) + ‖e‖ := by gcongr; exact norm_add_le _ _ apply hsum.trans have hmul (A : RectMatrix dx k) (B C D : RectMatrix k k) (E : RectMatrix k dx) : ‖A * B * C * D * E‖ ≤ ‖A‖ * ‖B‖ * ‖C‖ * ‖D‖ * ‖E‖ := by calc ‖A * B * C * D * E‖ ≤ ‖A * B * C * D‖ * ‖E‖ := Matrix.l2_opNorm_mul _ _ _ ≤ (‖A * B * C‖ * ‖D‖) * ‖E‖ := by gcongr; exact Matrix.l2_opNorm_mul _ _ _ ≤ ((‖A * B‖ * ‖C‖) * ‖D‖) * ‖E‖ := by gcongr; exact Matrix.l2_opNorm_mul _ _ _ ≤ (((‖A‖ * ‖B‖) * ‖C‖) * ‖D‖) * ‖E‖ := by gcongr; exact Matrix.l2_opNorm_mul _ _ have hsqrt : 0 ≤ sqrt k := Real.sqrt_nonneg _ have hsigmaInv : 0 ≤ 1 / sigma0 := by positivity have hsigmaSq : 0 < sigma0 ^ 2 := sq_pos_of_pos hsigma0 calc ‖a‖ + ‖b‖ + ‖c‖ + ‖d‖ + ‖e‖ ≤ (cV * q) * (2 / sigma0) * Ltau * (2 * sqrt k * L) * 1 + 1 * (2 * k * q / sigma0 ^ 2) * Ltau * (2 * sqrt k * L) * 1 + 1 * (1 / sigma0) * q * (2 * sqrt k * L) * 1 + 1 * (1 / sigma0) * Ltau * ((k : ℝ) * q) * 1 + 1 * (1 / sigma0) * Ltau * (sqrt k * L) * (cV * q) := by apply add_le_add · apply add_le_add · apply add_le_add · apply add_le_add · exact (hmul _ _ _ _ _).trans (by rw [htVn]; gcongr) · exact (hmul _ _ _ _ _).trans (by rw [htVn]; gcongr) · exact (hmul _ _ _ _ _).trans (by rw [htVn]; gcongr) · exact (hmul _ _ _ _ _).trans (by rw [htVn]; gcongr) · exact (hmul _ _ _ _ _).trans (by rw [htDiff]; gcongr) _ ≤ (2 * KD * cV + 4 * k * sqrt k * L * Ltau / sigma0 ^ 2 + 2 * sqrt k * L / sigma0 + k * Ltau / sigma0) * q := by rw [hKD] have hslack : 0 ≤ q * sqrt k * L * Ltau * cV * sigma0 := by positivity field_simp ring_nf nlinarith [hslack]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.rounded_operator_factorization_residual_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeResiduals.lean:272
theorem rounded_operator_factorization_residual_le_of_signalMinSingular

Signal-margin form of rounded_operator_factorization_residual_le, discharging all ordinary-inverse hypotheses from the ideal and rounded singular-value certificates. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
L Ltau sigma0 q cV KD :
V Vn :
R Rn :
tau taun :
Fin k → ℝ
hV :
‖matrixCLM (Vn.V - V.V)‖ ≤ cV * q
hR :
‖matrixCLM (Rn - R)‖ ≤ (k : ℝ) * q
hRn :
‖matrixCLM Rn‖ ≤ 2 * sqrt k * L
hR0 :
‖matrixCLM R‖ ≤ sqrt k * L
hRmin :
sigma0 ≤ signalMinSingular R
hRnmin :
sigma0 / 2 ≤ signalMinSingular Rn
htau :
∀ u, |tau u| ≤ Ltau
htaun :
∀ u, |taun u| ≤ Ltau
htauDiff :
∀ u, |taun u - tau u| ≤ q
hL :
0 ≤ L
hLtau :
0 ≤ Ltau
hsigma0 :
0 < sigma0
hq :
0 ≤ q
hcV :
0 ≤ cV
hKD :
KD = 4 * sqrt k * L * Ltau / sigma0
‖matrixCLM (Vn.V * Rn⁻¹ * diagonal taun * Rn * Vn.V.transpose - V.V * R⁻¹ * diagonal tau * R * V.V.transpose)‖
≤ (2 * KD * cV + 4 * k * sqrt k * L * Ltau / sigma0 ^ 2 + 2 * sqrt k * L / sigma0 + k * Ltau / sigma0) * q
Proof (Lean source)
lemma rounded_operator_factorization_residual_le_of_signalMinSingular {dx k : ℕ} {L Ltau sigma0 q cV KD : ℝ} (V Vn : SignalBasis dx k) (R Rn : RectMatrix k k) (tau taun : Fin k → ℝ) (hV : ‖matrixCLM (Vn.V - V.V)‖ ≤ cV * q) (hR : ‖matrixCLM (Rn - R)‖ ≤ (k : ℝ) * q) (hRn : ‖matrixCLM Rn‖ ≤ 2 * sqrt k * L) (hR0 : ‖matrixCLM R‖ ≤ sqrt k * L) (hRmin : sigma0 ≤ signalMinSingular R) (hRnmin : sigma0 / 2 ≤ signalMinSingular Rn) (htau : ∀ u, |tau u| ≤ Ltau) (htaun : ∀ u, |taun u| ≤ Ltau) (htauDiff : ∀ u, |taun u - tau u| ≤ q) (hL : 0 ≤ L) (hLtau : 0 ≤ Ltau) (hsigma0 : 0 < sigma0) (hq : 0 ≤ q) (hcV : 0 ≤ cV) (hKD : KD = 4 * sqrt k * L * Ltau / sigma0) : ‖matrixCLM (Vn.V * Rn⁻¹ * diagonal taun * Rn * Vn.V.transpose - V.V * R⁻¹ * diagonal tau * R * V.V.transpose)‖ ≤ (2 * KD * cV + 4 * k * sqrt k * L * Ltau / sigma0 ^ 2 + 2 * sqrt k * L / sigma0 + k * Ltau / sigma0) * q := by have hRinv := matrix_inv_norm_le_of_signalMinSingular R hsigma0 hRmin have hhalf : 0 < sigma0 / 2 := by positivity have hRninv0 := matrix_inv_norm_le_of_signalMinSingular Rn hhalf hRnmin have hRninv : ‖matrixCLM Rn⁻¹‖ ≤ 2 / sigma0 := by convert hRninv0 using 1 <;> field_simp have hInvDiff := matrix_inv_sub_inv_norm_le_of_signalMinSingular R Rn hsigma0 hRmin hRnmin hR hq exact rounded_operator_factorization_residual_le V Vn R Rn tau taun hV hR hRn hR0 hRinv hRninv hInvDiff htau htaun htauDiff hL hLtau hsigma0 hq hcV hKD
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.rounded_operator_factorization_residual_le_of_signalMinSingular · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeResiduals.lean:415
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.StructuredLatticeRounding 17 declarations Coordinate rounding for the structured lattice comparator

Coordinate rounding for the structured lattice comparator

theorem latticeHeight_pos

The prescribed height is positive on the core domain. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx n :
pi0 sigma0 :
hk :
0 < k
0 < latticeHeight k dx n pi0 sigma0
Proof (Lean source)
lemma latticeHeight_pos {k dx n : ℕ} {pi0 sigma0 : ℝ} (hk : 0 < k) : 0 < latticeHeight k dx n pi0 sigma0 := by unfold latticeHeight omega
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.latticeHeight_pos · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeRounding.lean:11
theorem ceil_inv_le_latticeHeight

The height contains the reciprocal-mass ceiling required by largest-remainder rounding. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx n :
pi0 sigma0 :
⌈pi0⁻¹⌉₊ ≤ latticeHeight k dx n pi0 sigma0
Proof (Lean source)
lemma ceil_inv_le_latticeHeight (k dx n : ℕ) (pi0 sigma0 : ℝ) : ⌈pi0⁻¹⌉₊ ≤ latticeHeight k dx n pi0 sigma0 := by unfold latticeHeight omega
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ceil_inv_le_latticeHeight · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeRounding.lean:17
theorem sqrt_card_mul_latticeMesh_le_quarter

The height's explicit polar term makes the signal-basis mesh at most one quarter. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx n :
pi0 sigma0 :
hk :
0 < k
sqrt (dx * k) * latticeMesh k dx n pi0 sigma0 ≤ 1 / 4
Proof (Lean source)
lemma sqrt_card_mul_latticeMesh_le_quarter {k dx n : ℕ} {pi0 sigma0 : ℝ} (hk : 0 < k) : sqrt (dx * k) * latticeMesh k dx n pi0 sigma0 ≤ 1 / 4 := by let H := latticeHeight k dx n pi0 sigma0 have hHnat : 0 < H := latticeHeight_pos hk have hHr : (0 : ℝ) < H := by exact_mod_cast hHnat have hceil : ⌈4 * sqrt (dx * k)⌉₊ ≤ H := by dsimp [H] unfold latticeHeight omega have hsqrt : 4 * sqrt (dx * k) ≤ (H : ℝ) := (Nat.le_ceil _).trans (by exact_mod_cast hceil) unfold latticeMesh change sqrt (dx * k) * (H : ℝ)⁻¹ ≤ 1 / 4 rw [← div_eq_mul_inv, div_le_iff₀ hHr] nlinarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.sqrt_card_mul_latticeMesh_le_quarter · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeRounding.lean:23
theorem k_mul_latticeMesh_le_half_sigma

The height's conditioning term makes square-coordinate rounding preserve half the model singular margin. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx n :
pi0 sigma0 :
hk :
0 < k
hsigma :
0 < sigma0
(k : ℝ) * latticeMesh k dx n pi0 sigma0 ≤ sigma0 / 2
Proof (Lean source)
lemma k_mul_latticeMesh_le_half_sigma {k dx n : ℕ} {pi0 sigma0 : ℝ} (hk : 0 < k) (hsigma : 0 < sigma0) : (k : ℝ) * latticeMesh k dx n pi0 sigma0 ≤ sigma0 / 2 := by let H := latticeHeight k dx n pi0 sigma0 have hHnat : 0 < H := latticeHeight_pos hk have hHr : (0 : ℝ) < H := by exact_mod_cast hHnat have hceil : ⌈2 * k / sigma0⌉₊ ≤ H := by dsimp [H] unfold latticeHeight omega have hbase : 2 * (k : ℝ) / sigma0 ≤ (H : ℝ) := (Nat.le_ceil _).trans (by exact_mod_cast hceil) unfold latticeMesh change (k : ℝ) * (H : ℝ)⁻¹ ≤ sigma0 / 2 rw [← div_eq_mul_inv, div_le_iff₀ hHr] have := (div_le_iff₀ hsigma).mp hbase nlinarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.k_mul_latticeMesh_le_half_sigma · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeRounding.lean:41
theorem k_mul_latticeMesh_le_sqrt_mul

On the core size and envelope domain, the basic 2k height term also leaves enough norm budget for square-coordinate rounding. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx n :
pi0 sigma0 L :
hk :
2 ≤ k
hL :
1 ≤ L
(k : ℝ) * latticeMesh k dx n pi0 sigma0 ≤ sqrt k * L
Proof (Lean source)
lemma k_mul_latticeMesh_le_sqrt_mul {k dx n : ℕ} {pi0 sigma0 L : ℝ} (hk : 2 ≤ k) (hL : 1 ≤ L) : (k : ℝ) * latticeMesh k dx n pi0 sigma0 ≤ sqrt k * L := by let H := latticeHeight k dx n pi0 sigma0 have hkpos : 0 < k := by omega have hHnat : 0 < H := latticeHeight_pos hkpos have hHr : (0 : ℝ) < H := by exact_mod_cast hHnat have h2k : 2 * k ≤ H := by dsimp [H] unfold latticeHeight omega have hhalf : (k : ℝ) / H ≤ 1 / 2 := by rw [div_le_iff₀ hHr] have h2k' : 2 * (k : ℝ) ≤ (H : ℝ) := by exact_mod_cast h2k nlinarith have hsqrt : 1 ≤ sqrt k := Real.one_le_sqrt.mpr (by exact_mod_cast (by omega : 1 ≤ k)) unfold latticeMesh change (k : ℝ) * (H : ℝ)⁻¹ ≤ sqrt k * L rw [← div_eq_mul_inv] calc (k : ℝ) / H ≤ 1 / 2 := hhalf _ ≤ 1 := by norm_num _ ≤ sqrt k * L := by nlinarith [mul_le_mul hsqrt hL (by norm_num) (by norm_num)]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.k_mul_latticeMesh_le_sqrt_mul · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeRounding.lean:61
theorem matrixCLM_norm_le_sqrt_card_mul_of_entry_abs_le

A rectangular matrix whose entries are uniformly bounded by M has Euclidean operator norm at most sqrt (rows * cols) * M. This is the sharp dimension factor needed when rounding the signal basis coordinatewise. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols :
M :
hM :
0 ≤ M
A :
RectMatrix rows cols
hA :
∀ i j, |A i j| ≤ M
‖matrixCLM A‖ ≤ sqrt (rows * cols) * M
Proof (Lean source)
lemma matrixCLM_norm_le_sqrt_card_mul_of_entry_abs_le {rows cols : ℕ} {M : ℝ} (hM : 0 ≤ M) (A : RectMatrix rows cols) (hA : ∀ i j, |A i j| ≤ M) : ‖matrixCLM A‖ ≤ sqrt (rows * cols) * M := by apply ContinuousLinearMap.opNorm_le_bound _ (mul_nonneg (Real.sqrt_nonneg _) hM) intro x have hrow (i : Fin rows) : ((toEuclideanLin A x) i) ^ 2 ≤ (cols : ℝ) * M ^ 2 * ‖x‖ ^ 2 := by have hcs := Finset.sum_mul_sq_le_sq_mul_sq (Finset.univ : Finset (Fin cols)) (A i) (fun j => x j) have hentries : ∑ j : Fin cols, (A i j) ^ 2 ≤ (cols : ℝ) * M ^ 2 := by calc _ ≤ ∑ _j : Fin cols, M ^ 2 := Finset.sum_le_sum fun j _ => by have := (sq_le_sq₀ (abs_nonneg (A i j)) hM).2 (hA i j) simpa [sq_abs] using this _ = (cols : ℝ) * M ^ 2 := by simp have hxsum : ∑ j : Fin cols, (x j) ^ 2 = ‖x‖ ^ 2 := by rw [EuclideanSpace.real_norm_sq_eq] simp only [Matrix.toEuclideanLin_apply, mulVec] calc (∑ j : Fin cols, A i j * x j) ^ 2 ≤ (∑ j : Fin cols, (A i j) ^ 2) * ∑ j : Fin cols, (x j) ^ 2 := by simpa using hcs _ ≤ ((cols : ℝ) * M ^ 2) * ‖x‖ ^ 2 := by rw [hxsum] exact mul_le_mul_of_nonneg_right hentries (sq_nonneg _) have hsum : ∑ i : Fin rows, ((toEuclideanLin A x) i) ^ 2 ≤ (rows : ℝ) * ((cols : ℝ) * M ^ 2 * ‖x‖ ^ 2) := by calc _ ≤ ∑ _i : Fin rows, ((cols : ℝ) * M ^ 2 * ‖x‖ ^ 2) := Finset.sum_le_sum fun i _ => hrow i _ = _ := by simp have hout0 : 0 ≤ ‖Matrix.toEuclideanLin A x‖ := norm_nonneg _ have hrhs0 : 0 ≤ sqrt (rows * cols) * M * ‖x‖ := by positivity apply (sq_le_sq₀ hout0 hrhs0).1 rw [EuclideanSpace.real_norm_sq_eq] calc ∑ i : Fin rows, ((toEuclideanLin A x) i) ^ 2 ≤ (rows : ℝ) * ((cols : ℝ) * M ^ 2 * ‖x‖ ^ 2) := hsum _ = (sqrt (rows * cols) * M * ‖x‖) ^ 2 := by rw [mul_pow, mul_pow, Real.sq_sqrt (mul_nonneg (Nat.cast_nonneg _) (Nat.cast_nonneg _))] ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.matrixCLM_norm_le_sqrt_card_mul_of_entry_abs_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeRounding.lean:87
theorem simplex_largestRemainder_round

Largest-remainder rounding of a finite probability vector. Each allocated numerator differs from its unrounded value by at most one, and any lower bound already satisfied by every floor is preserved. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k H :
hk :
0 < k
hH :
0 < H
p :
Fin k → ℝ
hp :
∀ u, 0 ≤ p u
hsum :
∑ u, p u = 1
∃ a : Fin k → ℕ,
conclusion 1
u :
⌊(H : ℝ) * p u⌋₊ ≤ a u
conclusion 2
u :
|(a u : ℝ) / H - p u| ≤ (H : ℝ)⁻¹
conclusion 3
∑ u, a u = H
Proof (Lean source)
lemma simplex_largestRemainder_round {k H : ℕ} (hk : 0 < k) (hH : 0 < H) (p : Fin k → ℝ) (hp : ∀ u, 0 ≤ p u) (hsum : ∑ u, p u = 1) : ∃ a : Fin k → ℕ, (∀ u, ⌊(H : ℝ) * p u⌋₊ ≤ a u) ∧ (∀ u, |(a u : ℝ) / H - p u| ≤ (H : ℝ)⁻¹) ∧ ∑ u, a u = H := by classical let b : Fin k → ℕ := fun u => ⌊(H : ℝ) * p u⌋₊ have hb_le (u : Fin k) : (b u : ℝ) ≤ (H : ℝ) * p u := by exact Nat.floor_le (mul_nonneg (Nat.cast_nonneg H) (hp u)) have hbSum_le : ∑ u, b u ≤ H := by have hreal : (∑ u, (b u : ℝ)) ≤ ∑ u, (H : ℝ) * p u := Finset.sum_le_sum fun u _ => hb_le u rw [← Finset.mul_sum, hsum, mul_one] at hreal exact_mod_cast hreal have hH_le : H ≤ ∑ u, b u + k := by have hterm (u : Fin k) : (H : ℝ) * p u ≤ (b u : ℝ) + 1 := (Nat.lt_floor_add_one ((H : ℝ) * p u)).le have hreal : ∑ u, (H : ℝ) * p u ≤ ∑ u, ((b u : ℝ) + 1) := Finset.sum_le_sum fun u _ => hterm u rw [← Finset.mul_sum, hsum, mul_one, Finset.sum_add_distrib] at hreal simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul, mul_one] at hreal exact_mod_cast hreal let d := H - ∑ u, b u have hd : d ≤ k := by dsimp [d]; omega have hd' : d ≤ (Finset.univ : Finset (Fin k)).card := by simpa using hd obtain ⟨S, hSuniv, hScard⟩ := Finset.exists_subset_card_eq (s := (Finset.univ : Finset (Fin k))) hd' let a : Fin k → ℕ := fun u => b u + if u ∈ S then 1 else 0 refine ⟨a, ?_, ?_, ?_⟩ · intro u dsimp [a] change b u ≤ b u + if u ∈ S then 1 else 0 omega · intro u have hbLower := hb_le u have hbUpper : (H : ℝ) * p u < (b u : ℝ) + 1 := Nat.lt_floor_add_one _ have hHr : (0 : ℝ) < H := by exact_mod_cast hH have hid : (a u : ℝ) / H - p u = ((a u : ℝ) - (H : ℝ) * p u) / H := by field_simp by_cases hu : u ∈ S · have habs : |(a u : ℝ) - (H : ℝ) * p u| ≤ 1 := by dsimp [a] rw [if_pos hu, abs_le] push_cast constructor <;> nlinarith rw [hid, abs_div, abs_of_pos hHr, inv_eq_one_div] exact (div_le_div_iff_of_pos_right hHr).2 habs · have habs : |(a u : ℝ) - (H : ℝ) * p u| ≤ 1 := by dsimp [a] rw [if_neg hu, add_zero, abs_le] constructor <;> nlinarith rw [hid, abs_div, abs_of_pos hHr, inv_eq_one_div] exact (div_le_div_iff_of_pos_right hHr).2 habs · dsimp [a] rw [Finset.sum_add_distrib] have hind : (∑ u : Fin k, if u ∈ S then 1 else 0) = S.card := by simpa using Finset.sum_boole (s := (Finset.univ : Finset (Fin k))) (p := fun u => u ∈ S) rw [hind, hScard] dsimp [d] omega
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.simplex_largestRemainder_round · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeRounding.lean:133
theorem simplex_largestRemainder_round_with_floor

Under the model's doubled latent-mass floor and H ≥ ceil(pi0⁻¹), largest-remainder rounding lands in the prescribed floor-constrained simplex. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k H :
pi0 :
hk :
0 < k
hH :
0 < H
hpi :
0 < pi0
hHpi :
⌈pi0⁻¹⌉₊ ≤ H
p :
Fin k → ℝ
hp :
∀ u, 2 * pi0 ≤ p u
hsum :
∑ u, p u = 1
∃ a : Fin k → ℕ,
conclusion 1
u :
⌈pi0 * H⌉₊ ≤ a u
|(a u : ℝ) / H - p u| ≤ (H : ℝ)⁻¹
conclusion 2
∑ u, a u = H
Proof (Lean source)
lemma simplex_largestRemainder_round_with_floor {k H : ℕ} {pi0 : ℝ} (hk : 0 < k) (hH : 0 < H) (hpi : 0 < pi0) (hHpi : ⌈pi0⁻¹⌉₊ ≤ H) (p : Fin k → ℝ) (hp : ∀ u, 2 * pi0 ≤ p u) (hsum : ∑ u, p u = 1) : ∃ a : Fin k → ℕ, (∀ u, ⌈pi0 * H⌉₊ ≤ a u ∧ |(a u : ℝ) / H - p u| ≤ (H : ℝ)⁻¹) ∧ ∑ u, a u = H := by have hp0 (u : Fin k) : 0 ≤ p u := (by linarith [hp u, hpi] : 0 ≤ p u) obtain ⟨a, haFloor, haError, haSum⟩ := simplex_largestRemainder_round hk hH p hp0 hsum refine ⟨a, ?_, haSum⟩ intro u refine ⟨?_, haError u⟩ apply (Nat.ceil_le).2 let x : ℝ := pi0 * H let y : ℝ := (H : ℝ) * p u have hHreal : (pi0⁻¹ : ℝ) ≤ H := (Nat.le_ceil (pi0⁻¹ : ℝ)).trans (by exact_mod_cast hHpi) have hx : 1 ≤ x := by dsimp [x] have := mul_le_mul_of_nonneg_left hHreal hpi.le field_simp at this simpa [mul_comm] using this have hy : 2 * x ≤ y := by dsimp [x, y] have hh := mul_le_mul_of_nonneg_left (hp u) (Nat.cast_nonneg H) nlinarith have hyFloor : y < (⌊y⌋₊ : ℝ) + 1 := Nat.lt_floor_add_one y have hxFloor : x ≤ (⌊y⌋₊ : ℝ) := by linarith exact hxFloor.trans (by exact_mod_cast haFloor u)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.simplex_largestRemainder_round_with_floor · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeRounding.lean:203
theorem simplex_largestRemainder_round_with_floor_l2

Euclidean form of the largest-remainder error bound used in the frozen estimate (88). Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k H :
pi0 :
hk :
0 < k
hH :
0 < H
hpi :
0 < pi0
hHpi :
⌈pi0⁻¹⌉₊ ≤ H
p :
Fin k → ℝ
hp :
∀ u, 2 * pi0 ≤ p u
hsum :
∑ u, p u = 1
∃ a : Fin k → ℕ,
conclusion 1
u :
⌈pi0 * H⌉₊ ≤ a u
conclusion 2
sqrt (∑ u, ((a u : ℝ) / H - p u) ^ 2) ≤ sqrt k * (H : ℝ)⁻¹
conclusion 3
∑ u, a u = H
Proof (Lean source)
lemma simplex_largestRemainder_round_with_floor_l2 {k H : ℕ} {pi0 : ℝ} (hk : 0 < k) (hH : 0 < H) (hpi : 0 < pi0) (hHpi : ⌈pi0⁻¹⌉₊ ≤ H) (p : Fin k → ℝ) (hp : ∀ u, 2 * pi0 ≤ p u) (hsum : ∑ u, p u = 1) : ∃ a : Fin k → ℕ, (∀ u, ⌈pi0 * H⌉₊ ≤ a u) ∧ sqrt (∑ u, ((a u : ℝ) / H - p u) ^ 2) ≤ sqrt k * (H : ℝ)⁻¹ ∧ ∑ u, a u = H := by obtain ⟨a, ha, haSum⟩ := simplex_largestRemainder_round_with_floor hk hH hpi hHpi p hp hsum refine ⟨a, fun u => (ha u).1, ?_, haSum⟩ let q : ℝ := (H : ℝ)⁻¹ have hq : 0 ≤ q := by dsimp [q]; positivity have hterm (u : Fin k) : ((a u : ℝ) / H - p u) ^ 2 ≤ q ^ 2 := by have habs : |(a u : ℝ) / H - p u| ≤ q := by simpa [q] using (ha u).2 have hsquare := (sq_le_sq₀ (abs_nonneg ((a u : ℝ) / H - p u)) hq).2 habs simpa [sq_abs] using hsquare have hsumSq : ∑ u, ((a u : ℝ) / H - p u) ^ 2 ≤ (k : ℝ) * q ^ 2 := by calc _ ≤ ∑ _u : Fin k, q ^ 2 := Finset.sum_le_sum fun u _ => hterm u _ = (k : ℝ) * q ^ 2 := by simp have hsum0 : 0 ≤ ∑ u, ((a u : ℝ) / H - p u) ^ 2 := sum_nonneg fun _ _ => sq_nonneg _ have hk0 : (0 : ℝ) ≤ k := Nat.cast_nonneg k have hsqrtk0 : 0 ≤ sqrt k := Real.sqrt_nonneg _ have hsqrtSum0 : 0 ≤ sqrt (∑ u, ((a u : ℝ) / H - p u) ^ 2) := Real.sqrt_nonneg _ rw [show (H : ℝ)⁻¹ = q by rfl] apply (sq_le_sq₀ hsqrtSum0 (mul_nonneg hsqrtk0 hq)).1 rw [Real.sq_sqrt hsum0, mul_pow, Real.sq_sqrt hk0] exact hsumSq
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.simplex_largestRemainder_round_with_floor_l2 · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeRounding.lean:238
theorem clipped_lattice_round

Rounding toward zero puts a bounded scalar on the clipped 1/H lattice without leaving its support interval. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
H :
radius x :
hH :
0 < H
hradius :
0 ≤ radius
hx :
x ∈ Icc (-radius) radius
∃ z : ℤ,
conclusion 1
(H : ℝ)⁻¹ * z ∈ Icc (-radius) radius
conclusion 2
|(H : ℝ)⁻¹ * z - x| ≤ (H : ℝ)⁻¹
Proof (Lean source)
lemma clipped_lattice_round {H : ℕ} {radius x : ℝ} (hH : 0 < H) (hradius : 0 ≤ radius) (hx : x ∈ Icc (-radius) radius) : ∃ z : ℤ, (H : ℝ)⁻¹ * z ∈ Icc (-radius) radius ∧ |(H : ℝ)⁻¹ * z - x| ≤ (H : ℝ)⁻¹ := by have hHr : (0 : ℝ) < H := by exact_mod_cast hH have hq : 0 < (H : ℝ)⁻¹ := inv_pos.mpr hHr by_cases hx0 : 0 ≤ x · let z : ℤ := ⌊(H : ℝ) * x⌋ have hz0 : (0 : ℝ) ≤ z := by exact_mod_cast (Int.floor_nonneg.mpr (mul_nonneg hHr.le hx0)) have hzle : (z : ℝ) ≤ (H : ℝ) * x := Int.floor_le _ have hxlt : (H : ℝ) * x < (z : ℝ) + 1 := Int.lt_floor_add_one _ have hy0 : 0 ≤ (H : ℝ)⁻¹ * (z : ℝ) := mul_nonneg hq.le hz0 have hyle : (H : ℝ)⁻¹ * (z : ℝ) ≤ x := by rw [inv_mul_eq_div, div_le_iff₀ hHr] simpa [mul_comm] using hzle refine ⟨z, ⟨?_, ?_⟩, ?_⟩ · exact (neg_nonpos.mpr hradius).trans hy0 · exact hyle.trans hx.2 · rw [abs_of_nonpos (sub_nonpos.mpr hyle)] rw [neg_sub] rw [sub_le_iff_le_add] rw [inv_mul_eq_div, inv_eq_one_div] rw [show 1 / (H : ℝ) + (z : ℝ) / H = (1 + (z : ℝ)) / H by ring] apply (le_div_iff₀ hHr).2 nlinarith · have hxneg : x < 0 := lt_of_not_ge hx0 let z : ℤ := ⌈(H : ℝ) * x⌉ have hz0 : (z : ℝ) ≤ 0 := by exact_mod_cast (Int.ceil_nonpos.mpr (mul_nonpos_of_nonneg_of_nonpos hHr.le hxneg.le)) have hxle : (H : ℝ) * x ≤ (z : ℝ) := Int.le_ceil _ have hzlt : (z : ℝ) < (H : ℝ) * x + 1 := Int.ceil_lt_add_one _ have hyle0 : (H : ℝ)⁻¹ * (z : ℝ) ≤ 0 := mul_nonpos_of_nonneg_of_nonpos hq.le hz0 have hxley : x ≤ (H : ℝ)⁻¹ * (z : ℝ) := by rw [inv_mul_eq_div, le_div_iff₀ hHr] simpa [mul_comm] using hxle refine ⟨z, ⟨?_, ?_⟩, ?_⟩ · exact hx.1.trans hxley · exact hyle0.trans hradius · rw [abs_of_nonneg (sub_nonneg.mpr hxley)] rw [sub_le_iff_le_add] rw [inv_mul_eq_div, inv_eq_one_div] apply (div_le_iff₀ hHr).2 field_simp nlinarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.clipped_lattice_round · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeRounding.lean:273
theorem clipped_lattice_round_matrix

Coordinatewise clipped rounding for rectangular matrices. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols H :
radius :
hH :
0 < H
hradius :
0 ≤ radius
A :
RectMatrix rows cols
hA :
∀ i j, |A i j| ≤ radius
∃ G : RectMatrix rows cols,
conclusion 1
i j :
∃ z : ℤ,
G i j = (H : ℝ)⁻¹ * z
|G i j| ≤ radius
conclusion 2
i j :
|G i j - A i j| ≤ (H : ℝ)⁻¹
Proof (Lean source)
lemma clipped_lattice_round_matrix {rows cols H : ℕ} {radius : ℝ} (hH : 0 < H) (hradius : 0 ≤ radius) (A : RectMatrix rows cols) (hA : ∀ i j, |A i j| ≤ radius) : ∃ G : RectMatrix rows cols, (∀ i j, ∃ z : ℤ, G i j = (H : ℝ)⁻¹ * z ∧ |G i j| ≤ radius) ∧ ∀ i j, |G i j - A i j| ≤ (H : ℝ)⁻¹ := by classical have hpoint (i : Fin rows) (j : Fin cols) : ∃ z : ℤ, (H : ℝ)⁻¹ * z ∈ Icc (-radius) radius ∧ |(H : ℝ)⁻¹ * z - A i j| ≤ (H : ℝ)⁻¹ := clipped_lattice_round hH hradius (abs_le.mp (hA i j)) let z : Fin rows → Fin cols → ℤ := fun i j => choose (hpoint i j) let G : RectMatrix rows cols := fun i j => (H : ℝ)⁻¹ * z i j refine ⟨G, ?_, ?_⟩ · intro i j refine ⟨z i j, rfl, ?_⟩ exact abs_le.mpr (Classical.choose_spec (hpoint i j)).1 · intro i j exact (Classical.choose_spec (hpoint i j)).2
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.clipped_lattice_round_matrix · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeRounding.lean:321
theorem clipped_lattice_round_matrix_norm

Operator-norm form of coordinatewise matrix rounding, with the exact Frobenius-to-operator dimension factor used by the comparator construction. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols H :
radius :
hH :
0 < H
hradius :
0 ≤ radius
A :
RectMatrix rows cols
hA :
∀ i j, |A i j| ≤ radius
∃ G : RectMatrix rows cols,
conclusion 1
i j :
∃ z : ℤ,
G i j = (H : ℝ)⁻¹ * z
|G i j| ≤ radius
conclusion 2
‖matrixCLM (G - A)‖ ≤ sqrt (rows * cols) * (H : ℝ)⁻¹
Proof (Lean source)
lemma clipped_lattice_round_matrix_norm {rows cols H : ℕ} {radius : ℝ} (hH : 0 < H) (hradius : 0 ≤ radius) (A : RectMatrix rows cols) (hA : ∀ i j, |A i j| ≤ radius) : ∃ G : RectMatrix rows cols, (∀ i j, ∃ z : ℤ, G i j = (H : ℝ)⁻¹ * z ∧ |G i j| ≤ radius) ∧ ‖matrixCLM (G - A)‖ ≤ sqrt (rows * cols) * (H : ℝ)⁻¹ := by obtain ⟨G, hgrid, herr⟩ := clipped_lattice_round_matrix hH hradius A hA refine ⟨G, hgrid, ?_⟩ apply matrixCLM_norm_le_sqrt_card_mul_of_entry_abs_le (by positivity) intro i j simpa only [Matrix.sub_apply] using herr i j
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.clipped_lattice_round_matrix_norm · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeRounding.lean:342
theorem one_le_signalMinSingular

Every supplied orthonormal signal basis has all of its k column singular values at least one (in fact equal to one). Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k :
V :
hk :
0 < k
Proof (Lean source)
lemma SignalBasis.one_le_signalMinSingular {dx k : ℕ} (V : SignalBasis dx k) (hk : 0 < k) : 1 ≤ signalMinSingular V.V := by apply le_singularValues_of_subspace (toEuclideanLin V.V) ⊤ (by norm_num) · simpa using hk · intro x _hx have hn := (signalBasisLinearIsometry V).norm_map x rw [one_mul] exact hn.symm.le
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.SignalBasis.one_le_signalMinSingular · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeRounding.lean:356
theorem exists_rounded_gridBasis

Coordinate rounding of an orthonormal signal basis produces a valid grid matrix. Weyl's inequality preserves the asserted singular margin under the frozen quarter-radius condition. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx k H :
V :
hk :
0 < k
hH :
0 < H
hmesh :
sqrt (dx * k) * (H : ℝ)⁻¹ ≤ 1 / 4
∃ G : RectMatrix dx k,
conclusion 1
i j :
∃ z : ℤ,
G i j = (H : ℝ)⁻¹ * z
|G i j| ≤ 1
conclusion 2
‖matrixCLM (G - V.V)‖ ≤ sqrt (dx * k) * (H : ℝ)⁻¹
conclusion 3
1 / 2 ≤ signalMinSingular G
Proof (Lean source)
lemma SignalBasis.exists_rounded_gridBasis {dx k H : ℕ} (V : SignalBasis dx k) (hk : 0 < k) (hH : 0 < H) (hmesh : sqrt (dx * k) * (H : ℝ)⁻¹ ≤ 1 / 4) : ∃ G : RectMatrix dx k, (∀ i j, ∃ z : ℤ, G i j = (H : ℝ)⁻¹ * z ∧ |G i j| ≤ 1) ∧ ‖matrixCLM (G - V.V)‖ ≤ sqrt (dx * k) * (H : ℝ)⁻¹ ∧ 1 / 2 ≤ signalMinSingular G := by have hentry (i : Fin dx) (j : Fin k) : |V.V i j| ≤ 1 := by let v : Euc dx := toLp 2 (fun a => V.V a j) have hv : ‖v‖ = 1 := by rw [EuclideanSpace.norm_eq] have hj := V.orthonormal j j rw [if_pos rfl] at hj rw [show (∑ x, ‖v.ofLp x‖ ^ 2) = 1 by simpa [v, Real.norm_eq_abs, sq_abs, pow_two] using hj, Real.sqrt_one] have hi := PiLp.norm_apply_le v i rw [hv] at hi simpa [v, Real.norm_eq_abs] using hi obtain ⟨G, hgrid, hnorm⟩ := clipped_lattice_round_matrix_norm hH (by norm_num) V.V hentry refine ⟨G, hgrid, hnorm, ?_⟩ have hw := singular_value_weyl (j := k - 1) V.V (G - V.V) have hadd : V.V + (G - V.V) = G := by abel rw [hadd] at hw have hbase := V.one_le_signalMinSingular hk simp only [signalMinSingular] at hw hbase ⊢ have hlower := (abs_le.mp hw).1 linarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.SignalBasis.exists_rounded_gridBasis · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeRounding.lean:368
theorem exists_rounded_conditioned_matrix

A well-conditioned square coordinate matrix can be rounded to the prescribed clipped lattice while retaining half its singular margin and the doubled norm budget. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k H :
L sigma0 :
hH :
0 < H
hL :
0 ≤ L
hsigma :
0 ≤ sigma0
R :
hRmin :
sigma0 ≤ signalMinSingular R
hRnorm :
‖matrixCLM R‖ ≤ sqrt k * L
hmargin :
(k : ℝ) * (H : ℝ)⁻¹ ≤ sigma0 / 2
hbudget :
(k : ℝ) * (H : ℝ)⁻¹ ≤ sqrt k * L
∃ Rn : RectMatrix k k,
conclusion 1
i j :
∃ z : ℤ, Rn i j = (H : ℝ)⁻¹ * z
conclusion 2
‖matrixCLM (Rn - R)‖ ≤ (k : ℝ) * (H : ℝ)⁻¹
conclusion 3
sigma0 / 2 ≤ signalMinSingular Rn
conclusion 4
‖matrixCLM Rn‖ ≤ 2 * sqrt k * L
Proof (Lean source)
lemma exists_rounded_conditioned_matrix {k H : ℕ} {L sigma0 : ℝ} (hH : 0 < H) (hL : 0 ≤ L) (hsigma : 0 ≤ sigma0) (R : RectMatrix k k) (hRmin : sigma0 ≤ signalMinSingular R) (hRnorm : ‖matrixCLM R‖ ≤ sqrt k * L) (hmargin : (k : ℝ) * (H : ℝ)⁻¹ ≤ sigma0 / 2) (hbudget : (k : ℝ) * (H : ℝ)⁻¹ ≤ sqrt k * L) : ∃ Rn : RectMatrix k k, (∀ i j, ∃ z : ℤ, Rn i j = (H : ℝ)⁻¹ * z) ∧ ‖matrixCLM (Rn - R)‖ ≤ (k : ℝ) * (H : ℝ)⁻¹ ∧ sigma0 / 2 ≤ signalMinSingular Rn ∧ ‖matrixCLM Rn‖ ≤ 2 * sqrt k * L := by have hradius : 0 ≤ 2 * sqrt k * L := by positivity have hentry (i j : Fin k) : |R i j| ≤ 2 * sqrt k * L := by calc |R i j| ≤ ‖matrixCLM R‖ := abs_matrix_entry_le_matrixCLM_norm R i j _ ≤ sqrt k * L := hRnorm _ ≤ 2 * sqrt k * L := by nlinarith [mul_nonneg (Real.sqrt_nonneg k) hL] obtain ⟨Rn, hgridClip, herr'⟩ := clipped_lattice_round_matrix_norm hH hradius R hentry have hsqrtkk : sqrt (k * k) = (k : ℝ) := by push_cast rw [show (k : ℝ) * k = (k : ℝ) ^ 2 by ring] rw [Real.sqrt_sq_eq_abs, abs_of_nonneg (Nat.cast_nonneg k)] have herr : ‖matrixCLM (Rn - R)‖ ≤ (k : ℝ) * (H : ℝ)⁻¹ := by simpa [hsqrtkk] using herr' refine ⟨Rn, fun i j => ⟨Classical.choose (hgridClip i j), (Classical.choose_spec (hgridClip i j)).1⟩, herr, ?_, ?_⟩ · have hw := singular_value_weyl (j := k - 1) R (Rn - R) have hadd : R + (Rn - R) = Rn := by abel rw [hadd] at hw simp only [signalMinSingular] at hw hRmin ⊢ have hlower := (abs_le.mp hw).1 linarith · calc ‖matrixCLM Rn‖ = ‖matrixCLM (R + (Rn - R))‖ := by congr 2 abel _ ≤ ‖matrixCLM R‖ + ‖matrixCLM (Rn - R)‖ := by change ‖R + (Rn - R)‖ ≤ ‖R‖ + ‖Rn - R‖ exact norm_add_le _ _ _ ≤ sqrt k * L + sqrt k * L := add_le_add hRnorm (herr.trans hbudget) _ = 2 * sqrt k * L := by ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.exists_rounded_conditioned_matrix · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeRounding.lean:399
theorem clipped_lattice_round_vector

Coordinatewise clipped rounding for the effect vector. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k H :
radius :
hH :
0 < H
hradius :
0 ≤ radius
x :
Fin k → ℝ
hx :
∀ u, x u ∈ Icc (-radius) radius
∃ y : Fin k → ℝ,
conclusion 1
u :
y u ∈ Icc (-radius) radius
∃ z : ℤ, y u = (H : ℝ)⁻¹ * z
conclusion 2
u :
|y u - x u| ≤ (H : ℝ)⁻¹
Proof (Lean source)
lemma clipped_lattice_round_vector {k H : ℕ} {radius : ℝ} (hH : 0 < H) (hradius : 0 ≤ radius) (x : Fin k → ℝ) (hx : ∀ u, x u ∈ Icc (-radius) radius) : ∃ y : Fin k → ℝ, (∀ u, y u ∈ Icc (-radius) radius ∧ ∃ z : ℤ, y u = (H : ℝ)⁻¹ * z) ∧ ∀ u, |y u - x u| ≤ (H : ℝ)⁻¹ := by classical have hpoint (u : Fin k) := clipped_lattice_round hH hradius (hx u) let z : Fin k → ℤ := fun u => choose (hpoint u) let y : Fin k → ℝ := fun u => (H : ℝ)⁻¹ * z u refine ⟨y, ?_, ?_⟩ · intro u exact ⟨(Classical.choose_spec (hpoint u)).1, z u, rfl⟩ · intro u exact (Classical.choose_spec (hpoint u)).2
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.clipped_lattice_round_vector · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeRounding.lean:446
theorem clipped_lattice_round_vector_l2

Euclidean error form of clipped coordinatewise vector rounding. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k H :
radius :
hH :
0 < H
hradius :
0 ≤ radius
x :
Fin k → ℝ
hx :
∀ u, x u ∈ Icc (-radius) radius
∃ y : Fin k → ℝ,
conclusion 1
u :
y u ∈ Icc (-radius) radius
∃ z : ℤ, y u = (H : ℝ)⁻¹ * z
conclusion 2
sqrt (∑ u, (y u - x u) ^ 2) ≤ sqrt k * (H : ℝ)⁻¹
Proof (Lean source)
lemma clipped_lattice_round_vector_l2 {k H : ℕ} {radius : ℝ} (hH : 0 < H) (hradius : 0 ≤ radius) (x : Fin k → ℝ) (hx : ∀ u, x u ∈ Icc (-radius) radius) : ∃ y : Fin k → ℝ, (∀ u, y u ∈ Icc (-radius) radius ∧ ∃ z : ℤ, y u = (H : ℝ)⁻¹ * z) ∧ sqrt (∑ u, (y u - x u) ^ 2) ≤ sqrt k * (H : ℝ)⁻¹ := by obtain ⟨y, hy, herr⟩ := clipped_lattice_round_vector hH hradius x hx refine ⟨y, hy, ?_⟩ have hq : 0 ≤ (H : ℝ)⁻¹ := by positivity have hterm (u : Fin k) : (y u - x u) ^ 2 ≤ ((H : ℝ)⁻¹) ^ 2 := by have hsquare := (sq_le_sq₀ (abs_nonneg (y u - x u)) hq).2 (herr u) simpa [sq_abs] using hsquare have hsum : ∑ u, (y u - x u) ^ 2 ≤ (k : ℝ) * ((H : ℝ)⁻¹) ^ 2 := by calc _ ≤ ∑ _u : Fin k, ((H : ℝ)⁻¹) ^ 2 := Finset.sum_le_sum fun u _ => hterm u _ = _ := by simp have hsum0 : 0 ≤ ∑ u, (y u - x u) ^ 2 := sum_nonneg fun _ _ => sq_nonneg _ apply (sq_le_sq₀ (Real.sqrt_nonneg _) (mul_nonneg (Real.sqrt_nonneg _) hq)).1 rw [Real.sq_sqrt hsum0, mul_pow, Real.sq_sqrt (Nat.cast_nonneg _)] exact hsum
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.clipped_lattice_round_vector_l2 · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/StructuredLatticeRounding.lean:465
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.SubspaceAlignment 4 declarations This module isolates the exact algebraic core of Procrustes alignment.

Alignment of orthonormal signal frames

This module isolates the exact algebraic core of Procrustes alignment. Two orthonormal rectangular frames with the same column space differ by an explicitly constructed square orthogonal matrix. The result is stated in the matrix operator norm used by the surrounding proxy-effect-law development.

theorem gram_eq_one

The Gram matrix of an orthonormal signal frame is the identity.

Formal statement
dx k :
V :
V.V.transpose * V.V = (1 : RectMatrix k k)
Proof (Lean source)
-- @node: subspace_alignment_signalBasis_gram lemma SignalBasis.gram_eq_one {dx k : ℕ} (V : SignalBasis dx k) : V.V.transpose * V.V = (1 : RectMatrix k k) := by ext i j simp only [Matrix.mul_apply, Matrix.transpose_apply, Matrix.one_apply] exact V.orthonormal i j
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.SignalBasis.gram_eq_one · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SubspaceAlignment.lean:16
theorem mul_transpose_mul_eq_of_range_eq

If two orthonormal signal frames have the same column space, then projecting either frame through the other recovers it exactly.

Formal statement
dx k :
V W :
hrange :
W.V * W.V.transpose * V.V = V.V
Proof (Lean source)
-- @node: subspace_alignment_cross_projection lemma SignalBasis.mul_transpose_mul_eq_of_range_eq {dx k : ℕ} (V W : SignalBasis dx k) (hrange : range (toEuclideanLin V.V) = range (toEuclideanLin W.V)) : W.V * W.V.transpose * V.V = V.V := by have hW := W.gram_eq_one apply Matrix.toEuclideanLin.injective apply LinearMap.ext intro x have hx : toEuclideanLin V.V x ∈ range (toEuclideanLin W.V) := by rw [← hrange] exact LinearMap.mem_range_self _ x rcases hx with ⟨y, hy⟩ have hleft : toEuclideanLin W.V.transpose (toEuclideanLin W.V y) = y := by apply PiLp.ext intro i simp [Matrix.toEuclideanLin_apply, Matrix.mulVec_mulVec, hW] have hmul : toEuclideanLin (W.V * W.V.transpose * V.V) x = toEuclideanLin W.V (toEuclideanLin W.V.transpose (toEuclideanLin V.V x)) := by apply PiLp.ext intro i simp [Matrix.toEuclideanLin_apply, Matrix.mulVec_mulVec, Matrix.mul_assoc] rw [hmul, ← hy, hleft, hy]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.SignalBasis.mul_transpose_mul_eq_of_range_eq · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SubspaceAlignment.lean:24
theorem exists_orthogonal_alignment_of_range_eq

If two orthonormal signal frames span the same subspace, there is a square matrix orthogonal on both sides that aligns the second frame with the first exactly. The alignment is the cross-Gram matrix WᵀV.

Formal statement
dx k :
V W :
hrange :
∃ O : RectMatrix k k,
conclusion 1
O.transpose * O = 1
conclusion 2
O * O.transpose = 1
conclusion 3
W.V * O = V.V
Proof (Lean source)
-- @node: subspace_alignment_exact_procrustes theorem SignalBasis.exists_orthogonal_alignment_of_range_eq {dx k : ℕ} (V W : SignalBasis dx k) (hrange : range (toEuclideanLin V.V) = range (toEuclideanLin W.V)) : ∃ O : RectMatrix k k, O.transpose * O = 1 ∧ O * O.transpose = 1 ∧ W.V * O = V.V := by refine ⟨W.V.transpose * V.V, ?_, ?_, ?_⟩ · rw [Matrix.transpose_mul, Matrix.transpose_transpose] calc V.V.transpose * W.V * (W.V.transpose * V.V) = V.V.transpose * (W.V * W.V.transpose * V.V) := by simp only [Matrix.mul_assoc] _ = V.V.transpose * V.V := by rw [V.mul_transpose_mul_eq_of_range_eq W hrange] _ = 1 := V.gram_eq_one · rw [Matrix.transpose_mul, Matrix.transpose_transpose] calc W.V.transpose * V.V * (V.V.transpose * W.V) = W.V.transpose * (V.V * V.V.transpose * W.V) := by simp only [Matrix.mul_assoc] _ = W.V.transpose * W.V := by rw [W.mul_transpose_mul_eq_of_range_eq V hrange.symm] _ = 1 := W.gram_eq_one · rw [← Matrix.mul_assoc] exact V.mul_transpose_mul_eq_of_range_eq W hrange
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.SignalBasis.exists_orthogonal_alignment_of_range_eq · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SubspaceAlignment.lean:54
theorem exists_orthogonal_alignment_bound_of_range_eq

Under a common signal row space, positive margin, and arbitrary matrix perturbation data, the exactly aligned orthonormal frames have zero operator distance, hence obey the requested inverse-margin perturbation bound.

Formal statement
rows dx k :
s₀ :
A B :
RectMatrix rows dx
V W :
hrange :
hs₀ :
0 < s₀
∃ O : RectMatrix k k,
conclusion 1
O.transpose * O = 1
conclusion 2
O * O.transpose = 1
conclusion 3
‖V.V - W.V * O‖ ≤ 8 * s₀⁻¹ * ‖A - B‖
Proof (Lean source)
-- @node: subspace_alignment_exact_bound theorem SignalBasis.exists_orthogonal_alignment_bound_of_range_eq {rows dx k : ℕ} {s₀ : ℝ} (A B : RectMatrix rows dx) (V W : SignalBasis dx k) (hrange : range (toEuclideanLin V.V) = range (toEuclideanLin W.V)) (hs₀ : 0 < s₀) : ∃ O : RectMatrix k k, O.transpose * O = 1 ∧ O * O.transpose = 1 ∧ ‖V.V - W.V * O‖ ≤ 8 * s₀⁻¹ * ‖A - B‖ := by obtain ⟨O, hOtO, hOOt, hO⟩ := V.exists_orthogonal_alignment_of_range_eq W hrange refine ⟨O, hOtO, hOOt, ?_⟩ rw [hO, sub_self, norm_zero] positivity
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.SignalBasis.exists_orthogonal_alignment_bound_of_range_eq · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SubspaceAlignment.lean:84
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.SummaryClosure 24 declarations Feasible-summary closure, nearest-summary repair, and ordered mass extraction.

Feasible-summary closure, nearest-summary repair, and ordered mass extraction.

A probability law together with membership in the uniformly conditioned model. It uses the supplied parameters.

Definition (Lean source)
k dx dz :
L pi0 sigma0 :
P :
Measure (FullData k dx dz)
model :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
def summary

For the supplied parameters, summary is given by its defining clause.

Definition (Lean source)
k dx dz :
L pi0 sigma0 :
Q :
ModelLaw k dx dz L pi0 sigma0
summary Q :
by letI := Q.prob exact obsSummary Q.P
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ModelLaw.summary · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryClosure.lean:18
def admissibleImage

Admissible summary image. @realizes S\mathscr S(S(M)) For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz :
L pi0 sigma0 :
admissibleImage k dx dz L pi0 sigma0 :
{s | ∃ Q : ModelLaw k dx dz L pi0 sigma0, Q.summary = s}
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.admissibleImage · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryClosure.lean:24

Closed feasible-summary space. @realizes K\mathcal K(closure of admissible image) For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz :
L pi0 sigma0 :
summaryClosure k dx dz L pi0 sigma0 :
closure (admissibleImage k dx dz L pi0 sigma0)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summaryClosure · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryClosure.lean:28
def publishedQuotientFunctional

The quotient-law functional on the admissible summary image. @realizes FF(quotient functional on admissible summaries) For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz :
L pi0 sigma0 :
s :
{q // q ∈ admissibleImage k dx dz L pi0 sigma0}
publishedQuotientFunctional k dx dz L pi0 sigma0 s :
AtomicLaw.LawModulo k (effectRadius dz L sigma0)
by let Q : ModelLaw k dx dz L pi0 sigma0 := choose s.property letI := Q.prob exact quotientLaw Q.P Q.model
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.publishedQuotientFunctional · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryClosure.lean:32
def PublishedMomentIdentity

The 2k spectral moments identify the quotient functional on the admissible image. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz :
L pi0 sigma0 :
Q :
ModelLaw k dx dz L pi0 sigma0
j :
Fin (2 * k)
V :
hV :
V.SpansSignal Q.summary
PublishedMomentIdentity k dx dz L pi0 sigma0 :
Prop
∑ u, latentMass Q.P u * (latentEffect Q.P u) ^ (j : ℕ)
= ∑ a, leftAnchor Q.summary V a * (∑ b, ((compressedOperator Q.summary V hV) ^ (j : ℕ)) a b * rightAnchor V b)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.PublishedMomentIdentity · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryClosure.lean:41
theorem publishedMomentIdentity_targetFeature_transpose_firstBasis

The model anchor makes the first ambient coordinate the all-ones right anchor in latent coordinates. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hpi :
0 < pi0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
Proof (Lean source)
-- @node: publishedMomentIdentity_targetFeature_transpose_firstBasis lemma publishedMomentIdentity_targetFeature_transpose_firstBasis {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hk : 2 ≤ k) (hkx : k ≤ dx) (hpi : 0 < pi0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) : mulVec (targetFeature P).transpose (firstBasis dx) = fun _ => 1 := by have hdx : 0 < dx := lt_of_lt_of_le (by omega : 0 < k) hkx funext u let i0 : Fin dx := ⟨0, hdx⟩ have hclass : 0 < P (latentClass u) := by exact lt_of_lt_of_le (latentCell_pos_of_latentArmPositivity P hpi hM.latentArmPositivity u false) (measure_mono fun _ hw => hw.1) have hanchor : ∀ᵐ w ∂P.restrict (latentClass u), w.X i0 = 1 := ae_restrict_of_ae (hM.anchor.mono fun w hw => hw i0 rfl) let _ : IsProbabilityMeasure (normalizedRestrict P (latentClass u)) := normalizedRestrict_isProbabilityMeasure (measurableSet_latentClass u) hclass have hmean : targetFeature P i0 u = 1 := by rw [targetFeature, conditionalMean_eq_normalizedRestrictedIntegral hclass] unfold normalizedRestrictedIntegral rw [integral_congr_ae ((ae_normalizedRestrict_iff hclass).mpr hanchor)] simp have hfirst : firstBasis dx = single i0 1 := by funext i by_cases hi : i = i0 · subst i simp [firstBasis, i0] · have hval : i.val ≠ 0 := fun hz => hi (Fin.ext hz) simp [firstBasis, hi, hval] rw [hfirst] simp [mulVec, hmean]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.publishedMomentIdentity_targetFeature_transpose_firstBasis · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryClosure.lean:50
theorem publishedMomentIdentity_obsSummary_mX_factorization

The observable target-proxy mean is the target-feature matrix applied to the latent masses. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hpi :
0 < pi0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
Proof (Lean source)
-- @node: publishedMomentIdentity_obsSummary_mX_factorization lemma publishedMomentIdentity_obsSummary_mX_factorization {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hpi : 0 < pi0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) : (obsSummary P).mX = mulVec (targetFeature P) (latentMass P) := by ext j change (∫ o, o.X j ∂obsLaw P) = ∑ u, conditionalMean P (latentClass u) (fun w => w.X j) * P.real (latentClass u) rw [obsLaw] rw [integral_map (f := fun o : Obs dx dz => o.X j) (obsMap_measurable k dx dz).aemeasurable (((measurable_pi_apply j).comp measurable_obs_X).aestronglyMeasurable)] simp only [obsMap] have hXmeas : Measurable (fun w : FullData k dx dz => w.X j) := (measurable_pi_apply j).comp measurable_fullData_X have hXint : Integrable (fun w : FullData k dx dz => w.X j) P := by apply Integrable.of_bound hXmeas.aestronglyMeasurable L filter_upwards [hM.boundedX] with w hw have hj := PiLp.norm_apply_le (toLp 2 w.X : Euc dx) j have hcoord : |w.X j| ≤ ‖(toLp 2 w.X : Euc dx)‖ := by simpa [Real.norm_eq_abs] using hj exact hcoord.trans (by simpa [EuclideanSpace.norm_eq] using hw) have hdisj : Pairwise (onFun Disjoint (fun u : Fin k => latentClass (dx := dx) (dz := dz) u)) := by intro u v huv change Disjoint (latentClass (dx := dx) (dz := dz) u) (latentClass (dx := dx) (dz := dz) v) rw [Set.disjoint_left] intro w hwu hwv exact huv (hwu.symm.trans hwv) have hunion : (⋃ u : Fin k, latentClass (dx := dx) (dz := dz) u) = univ := by ext w simp [latentClass] have hpart : (∫ w, w.X j ∂P) = ∑ u : Fin k, ∫ w in latentClass (dx := dx) (dz := dz) u, w.X j ∂P := by calc (∫ w, w.X j ∂P) = ∫ w in univ, w.X j ∂P := by simp _ = ∫ w in (⋃ u : Fin k, latentClass (dx := dx) (dz := dz) u), w.X j ∂P := by rw [hunion] _ = _ := integral_iUnion_fintype (s := fun u : Fin k => latentClass (dx := dx) (dz := dz) u) (fun _ => measurableSet_latentClass _) hdisj (fun _ => hXint.integrableOn) rw [hpart] apply Finset.sum_congr rfl intro u _ have hclass : 0 < P (latentClass u) := by exact lt_of_lt_of_le (latentCell_pos_of_latentArmPositivity P hpi hM.latentArmPositivity u false) (measure_mono fun _ hw => hw.1) unfold conditionalMean have hreal : P.real (latentClass u) ≠ 0 := by exact ENNReal.toReal_ne_zero.mpr ⟨ne_of_gt hclass, measure_ne_top P _⟩ rw [inv_mul_eq_div, div_mul_cancel₀ _ hreal]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.publishedMomentIdentity_obsSummary_mX_factorization · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryClosure.lean:85
theorem publishedMomentIdentity_injective_of_signalMinSingular_pos

The positive compressed signal singular value implies injectivity for the moment identity. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols :
A :
RectMatrix rows cols
h :
Proof (Lean source)
-- @node: publishedMomentIdentity_injective_of_signalMinSingular_pos lemma publishedMomentIdentity_injective_of_signalMinSingular_pos {rows cols : ℕ} (A : RectMatrix rows cols) (h : 0 < signalMinSingular A) : Injective (toEuclideanLin A) := by apply (LinearMap.injective_iff_forall_lt_finrank_singularValues_pos _).2 intro i hi rw [show finrank ℝ (Euc cols) = cols by simp] at hi exact lt_of_lt_of_le h ((toEuclideanLin A).singularValues_antitone (Nat.le_sub_one_of_lt hi))
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.publishedMomentIdentity_injective_of_signalMinSingular_pos · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryClosure.lean:142
theorem publishedMomentIdentity_gram_det_isUnit_of_injective

Injectivity makes the Gram determinant a unit for the moment-identity calculation. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols :
A :
RectMatrix rows cols
IsUnit (A.transpose * A).det
Proof (Lean source)
-- @node: publishedMomentIdentity_gram_det_isUnit_of_injective lemma publishedMomentIdentity_gram_det_isUnit_of_injective {rows cols : ℕ} (A : RectMatrix rows cols) (hA : Injective (Matrix.toEuclideanLin A)) : IsUnit (A.transpose * A).det := by let T := Matrix.toEuclideanLin A have hgram : Injective (Matrix.toEuclideanLin (A.transpose * A)) := by have hc : Matrix.toEuclideanLin (A.transpose * A) = adjoint T ∘ₗ T := by calc Matrix.toEuclideanLin (A.transpose * A) = Matrix.toEuclideanLin A.transpose ∘ₗ T := by ext x i simp [T, Matrix.toEuclideanLin_apply, Matrix.mulVec_mulVec] _ = adjoint T ∘ₗ T := by rw [← Matrix.conjTranspose_eq_transpose_of_trivial A, Matrix.toEuclideanLin_conjTranspose_eq_adjoint] rw [hc] exact (LinearMap.adjoint_comp_self_injective_iff T).2 hA apply (Matrix.isUnit_iff_isUnit_det _).mp apply Matrix.mulVec_injective_iff_isUnit.mp intro x y hxy have he : Matrix.toEuclideanLin (A.transpose * A) (toLp 2 x) = Matrix.toEuclideanLin (A.transpose * A) (toLp 2 y) := by simpa [Matrix.toEuclideanLin_apply] using congrArg (toLp 2) hxy have := hgram he simpa using congrArg ofLp this
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.publishedMomentIdentity_gram_det_isUnit_of_injective · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryClosure.lean:153
theorem publishedMomentIdentity_penrose_left_inverse_of_injective

The Gram-form inverse is a left inverse in the injective moment-identity calculation. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols :
A :
RectMatrix rows cols
penroseInverse A * A = 1
Proof (Lean source)
-- @node: publishedMomentIdentity_penrose_left_inverse_of_injective lemma publishedMomentIdentity_penrose_left_inverse_of_injective {rows cols : ℕ} (A : RectMatrix rows cols) (hA : Injective (toEuclideanLin A)) : penroseInverse A * A = 1 := by letI := Matrix.invertibleOfIsUnitDet (A.transpose * A) (publishedMomentIdentity_gram_det_isUnit_of_injective A hA) simp only [penroseInverse] rw [Matrix.mul_assoc, Matrix.inv_mul_of_invertible]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.publishedMomentIdentity_penrose_left_inverse_of_injective · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryClosure.lean:180
theorem publishedMomentIdentity_holds

Published moment identity holds: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
PublishedMomentIdentity k dx dz L pi0 sigma0
Proof (Lean source)
lemma publishedMomentIdentity_holds (k dx dz : ℕ) (L pi0 sigma0 : ℝ) : PublishedMomentIdentity k dx dz L pi0 sigma0 := by classical intro Q j V hV letI := Q.prob rcases Q.model.coreDomain with ⟨hk, hkx, _hkz, _hL, hpi, _hpiMax, hsigma, _hsigmaMax⟩ let B := targetFeature Q.P let R : RectMatrix k k := B.transpose * V.V let C : BoolRectMatrix dz k := fun t => referenceFeature Q.P t * latentArmWeights Q.P t have hMfac (t : Bool) : observedProxyMoment Q.summary t * V.V = C t * R := by rw [show Q.summary = obsSummary Q.P from rfl, observedProxyMoment_factorization Q.P hk hkx _hL hpi Q.model t] simp only [C, R, B, Matrix.mul_assoc] have hNfac (t : Bool) : observedOutcomeProxyMoment Q.summary t * V.V = C t * diagonal (latentMean Q.P t) * R := by rw [show Q.summary = obsSummary Q.P from rfl, observedOutcomeProxyMoment_factorization Q.P hk hpi Q.model t] simp only [C, R, B, Matrix.mul_assoc] have hAinj (t : Bool) : Injective (toEuclideanLin (observedProxyMoment Q.summary t * V.V)) := by have hm := observedProxyMoment_compression_margin Q.P hk hkx _hL hpi hsigma Q.model t V hV apply publishedMomentIdentity_injective_of_signalMinSingular_pos exact (mul_pos hpi (sq_pos_of_pos hsigma)).trans_le hm.2 have hRinj : Injective (toEuclideanLin R) := by intro x y hxy apply hAinj false rw [hMfac false] simpa [Matrix.toEuclideanLin_apply, Matrix.mulVec_mulVec] using congrArg (toEuclideanLin (C false)) hxy have hRunit : IsUnit R.det := by apply (Matrix.isUnit_iff_isUnit_det _).mp apply Matrix.mulVec_injective_iff_isUnit.mp intro x y hxy apply congrArg ofLp apply hRinj simpa [Matrix.toEuclideanLin_apply] using congrArg (toLp 2) hxy letI := Matrix.invertibleOfIsUnitDet R hRunit have hterm (t : Bool) : penroseInverse (observedProxyMoment Q.summary t * V.V) * (observedOutcomeProxyMoment Q.summary t * V.V) = R⁻¹ * diagonal (latentMean Q.P t) * R := by have hNrewrite : observedOutcomeProxyMoment Q.summary t * V.V = (observedProxyMoment Q.summary t * V.V) * (R⁻¹ * diagonal (latentMean Q.P t) * R) := by rw [hMfac t, hNfac t] simp only [Matrix.mul_assoc] rw [← Matrix.mul_assoc R R⁻¹, Matrix.mul_inv_of_invertible, Matrix.one_mul] rw [hNrewrite, ← Matrix.mul_assoc, publishedMomentIdentity_penrose_left_inverse_of_injective _ (hAinj t), Matrix.one_mul] have hD : compressedOperator Q.summary V hV = R⁻¹ * diagonal (latentEffect Q.P) * R := by unfold compressedOperator change genuinePenroseInverse (observedProxyMoment Q.summary true * V.V) * (observedOutcomeProxyMoment Q.summary true * V.V) - genuinePenroseInverse (observedProxyMoment Q.summary false * V.V) * (observedOutcomeProxyMoment Q.summary false * V.V) = _ rw [genuinePenroseInverse_eq_penroseInverse_of_injective _ (hAinj true), genuinePenroseInverse_eq_penroseInverse_of_injective _ (hAinj false), hterm true, hterm false] rw [← Matrix.sub_mul, ← Matrix.mul_sub] congr 2 ext a b by_cases hab : a = b <;> simp [Matrix.diagonal_apply, hab, latentEffect] have hpow (m : ℕ) : (compressedOperator Q.summary V hV) ^ m = R⁻¹ * diagonal (fun u => (latentEffect Q.P u) ^ m) * R := by induction m with | zero => simp [Matrix.diagonal_one] | succ m ih => rw [pow_succ, ih, hD] have hdiag : diagonal (fun u => (latentEffect Q.P u) ^ m) * diagonal (latentEffect Q.P) = diagonal (fun u => (latentEffect Q.P u) ^ (m + 1)) := by rw [Matrix.diagonal_mul_diagonal] congr 1 calc (R⁻¹ * diagonal (fun u => (latentEffect Q.P u) ^ m) * R) * (R⁻¹ * diagonal (latentEffect Q.P) * R) = R⁻¹ * diagonal (fun u => (latentEffect Q.P u) ^ m) * (R * R⁻¹) * diagonal (latentEffect Q.P) * R := by simp only [Matrix.mul_assoc] _ = R⁻¹ * (diagonal (fun u => (latentEffect Q.P u) ^ m) * diagonal (latentEffect Q.P)) * R := by rw [Matrix.mul_inv_of_invertible] simp [Matrix.mul_assoc] _ = _ := by rw [hdiag] have hCinj : Injective (toEuclideanLin (C false)) := by intro x y hxy have hpre : toEuclideanLin (observedProxyMoment Q.summary false * V.V) (toEuclideanLin R⁻¹ x) = toEuclideanLin (observedProxyMoment Q.summary false * V.V) (toEuclideanLin R⁻¹ y) := by rw [hMfac false] apply PiLp.ext intro i simpa [Matrix.toEuclideanLin_apply, Matrix.mulVec_mulVec] using congrArg (fun z : Euc dz => z i) hxy have hxy' := hAinj false hpre have := congrArg (toEuclideanLin R) hxy' simpa [Matrix.toEuclideanLin_apply, Matrix.mulVec_mulVec, Matrix.mul_inv_of_invertible] using this have hMraw : observedProxyMoment Q.summary false = C false * B.transpose := by rw [show Q.summary = obsSummary Q.P from rfl, observedProxyMoment_factorization Q.P hk hkx _hL hpi Q.model false] have hBt : penroseInverse (C false) * observedProxyMoment Q.summary false = B.transpose := by rw [hMraw, ← Matrix.mul_assoc, publishedMomentIdentity_penrose_left_inverse_of_injective _ hCinj, Matrix.one_mul] have hBfac : B = (observedProxyMoment Q.summary false).transpose * (penroseInverse (C false)).transpose := by have ht := congrArg transpose hBt simpa [Matrix.transpose_mul] using ht.symm have hBmem (x : Euc k) : toEuclideanLin B x ∈ range (toEuclideanLin V.V) := by rw [hV] apply show range (toEuclideanLin (observedProxyMoment Q.summary false).transpose) ≤ signalRowspace Q.summary from le_sup_left refine ⟨Matrix.toEuclideanLin (penroseInverse (C false)).transpose x, ?_⟩ rw [hBfac] apply PiLp.ext intro i simp [Matrix.toEuclideanLin_apply, Matrix.mulVec_mulVec] have hproj : V.V * V.V.transpose * B = B := by apply Matrix.toEuclideanLin.injective apply LinearMap.ext intro x rcases hBmem x with ⟨y, hy⟩ have hgram : V.V.transpose * V.V = (1 : RectMatrix k k) := by ext a b simpa [Matrix.mul_apply, Matrix.one_apply] using V.orthonormal a b apply PiLp.ext intro i change ((V.V * V.V.transpose * B).mulVec x.ofLp) i = (B.mulVec x.ofLp) i have hyfun : V.V.mulVec y.ofLp = B.mulVec x.ofLp := by simpa [Matrix.toEuclideanLin_apply] using congrArg ofLp hy calc ((V.V * V.V.transpose * B).mulVec x.ofLp) i = ((V.V * V.V.transpose).mulVec (B.mulVec x.ofLp)) i := by exact congrFun (Matrix.mulVec_mulVec x.ofLp (V.V * V.V.transpose) B).symm i _ = (V.V.mulVec (V.V.transpose.mulVec (B.mulVec x.ofLp))) i := by exact congrFun (Matrix.mulVec_mulVec (B.mulVec x.ofLp) V.V V.V.transpose).symm i _ = (V.V.mulVec (V.V.transpose.mulVec (V.V.mulVec y.ofLp))) i := by rw [hyfun] _ = (V.V.mulVec ((V.V.transpose * V.V).mulVec y.ofLp)) i := by exact congrArg (fun z : Fin k → ℝ => (V.V.mulVec z) i) (Matrix.mulVec_mulVec y.ofLp V.V.transpose V.V) _ = (V.V.mulVec y.ofLp) i := by rw [hgram, Matrix.one_mulVec] _ = (B.mulVec x.ofLp) i := congrFun hyfun i have hBfactor : B = V.V * R.transpose := by rw [show R.transpose = V.V.transpose * B by simp [R, Matrix.transpose_mul]] simpa [Matrix.mul_assoc] using hproj.symm rw [hpow (j : ℕ)] have hmX : Q.summary.mX = mulVec B (latentMass Q.P) := by exact publishedMomentIdentity_obsSummary_mX_factorization Q.P hpi Q.model have hanchor : mulVec B.transpose (firstBasis dx) = fun _ => 1 := by exact publishedMomentIdentity_targetFeature_transpose_firstBasis Q.P hk hkx hpi Q.model have hRt : R.transpose = V.V.transpose * B := by simp [R, Matrix.transpose_mul] have hBt : B.transpose = R * V.V.transpose := by have ht := congrArg transpose hBfactor simpa [Matrix.transpose_mul] using ht have hleftVec : mulVec V.V.transpose Q.summary.mX = mulVec R.transpose (latentMass Q.P) := by calc mulVec V.V.transpose Q.summary.mX = mulVec V.V.transpose (mulVec B (latentMass Q.P)) := by rw [hmX] _ = mulVec (V.V.transpose * B) (latentMass Q.P) := Matrix.mulVec_mulVec _ _ _ _ = mulVec R.transpose (latentMass Q.P) := by rw [← hRt] have hrightVec : mulVec R (mulVec V.V.transpose (firstBasis dx)) = fun _ => 1 := by calc mulVec R (mulVec V.V.transpose (firstBasis dx)) = mulVec (R * V.V.transpose) (firstBasis dx) := Matrix.mulVec_mulVec _ _ _ _ = mulVec B.transpose (firstBasis dx) := by rw [← hBt] _ = fun _ => 1 := hanchor have hleftAnchor : leftAnchor Q.summary V = mulVec V.V.transpose Q.summary.mX := by funext a simp [leftAnchor, mulVec, dotProduct, mul_comm] have hrightAnchor : rightAnchor V = mulVec V.V.transpose (firstBasis dx) := by funext a simp [rightAnchor, mulVec, dotProduct] have hoperatorVec : mulVec (R⁻¹ * diagonal (fun u => (latentEffect Q.P u) ^ (j : ℕ)) * R) (mulVec V.V.transpose (firstBasis dx)) = mulVec R⁻¹ (mulVec (diagonal (fun u => (latentEffect Q.P u) ^ (j : ℕ))) (fun _ => 1)) := by calc _ = mulVec (R⁻¹ * diagonal (fun u => (latentEffect Q.P u) ^ (j : ℕ))) (mulVec R (mulVec V.V.transpose (firstBasis dx))) := by symm exact Matrix.mulVec_mulVec _ _ _ _ = mulVec (R⁻¹ * diagonal (fun u => (latentEffect Q.P u) ^ (j : ℕ))) (fun _ => 1) := by rw [hrightVec] _ = _ := by symm exact Matrix.mulVec_mulVec _ _ _ rw [hleftAnchor, hrightAnchor] change (latentMass Q.P) ⬝ᵥ (fun u => (latentEffect Q.P u) ^ (j : ℕ)) = (mulVec V.V.transpose Q.summary.mX) ⬝ᵥ mulVec (R⁻¹ * diagonal (fun u => (latentEffect Q.P u) ^ (j : ℕ)) * R) (mulVec V.V.transpose (firstBasis dx)) rw [hleftVec] conv_rhs => rw [dotProduct_comm, Matrix.dotProduct_transpose_mulVec] rw [hoperatorVec, Matrix.mulVec_mulVec, Matrix.mul_inv_of_invertible, Matrix.one_mulVec] apply Finset.sum_congr rfl intro u _ simp [Matrix.mulVec_diagonal]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.publishedMomentIdentity_holds · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryClosure.lean:190
def HomogeneousEffects

Homogeneity at a common latent effect. @realizes τ\tau_\star(common value of all latent effects) For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz :
P :
Measure (FullData k dx dz)
tauStar :
u :
HomogeneousEffects P tauStar :
Prop
latentEffect P u = tauStar
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.HomogeneousEffects · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryClosure.lean:418
def HomogeneousSummarySpecialization

The homogeneous-effect specialization included in the closed-summary definition. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz :
L pi0 sigma0 :
Q :
ModelLaw k dx dz L pi0 sigma0
tauStar :
V :
hV :
V.SpansSignal Q.summary
HomogeneousEffects Q.P tauStar
HomogeneousSummarySpecialization k dx dz L pi0 sigma0 :
Prop
clause 1
compressedOperator Q.summary V hV = tauStar • (1 : RectMatrix k k)
clause 2
AtomicLaw.LawModulo.toMeasure (by letI := Q.prob exact quotientLaw Q.P Q.model)
= Measure.dirac tauStar
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.HomogeneousSummarySpecialization · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryClosure.lean:423
theorem summaryClosure_injective_of_signalMinSingular_pos

Positivity of the last singular value makes a finite rectangular map injective. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols :
A :
RectMatrix rows cols
h :
Proof (Lean source)
-- @node: summaryClosure_injective_of_signalMinSingular_pos lemma summaryClosure_injective_of_signalMinSingular_pos {rows cols : ℕ} (A : RectMatrix rows cols) (h : 0 < signalMinSingular A) : Injective (toEuclideanLin A) := by apply (LinearMap.injective_iff_forall_lt_finrank_singularValues_pos _).2 intro i hi rw [show finrank ℝ (Euc cols) = cols by simp] at hi exact lt_of_lt_of_le h ((toEuclideanLin A).singularValues_antitone (Nat.le_sub_one_of_lt hi))
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summaryClosure_injective_of_signalMinSingular_pos · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryClosure.lean:433
theorem summaryClosure_gram_det_isUnit_of_injective

Injectivity of a rectangular map makes its Gram determinant a unit. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols :
A :
RectMatrix rows cols
IsUnit (A.transpose * A).det
Proof (Lean source)
-- @node: summaryClosure_gram_det_isUnit_of_injective lemma summaryClosure_gram_det_isUnit_of_injective {rows cols : ℕ} (A : RectMatrix rows cols) (hA : Injective (Matrix.toEuclideanLin A)) : IsUnit (A.transpose * A).det := by let T := Matrix.toEuclideanLin A have hgram : Injective (Matrix.toEuclideanLin (A.transpose * A)) := by have hc : Matrix.toEuclideanLin (A.transpose * A) = adjoint T ∘ₗ T := by calc Matrix.toEuclideanLin (A.transpose * A) = Matrix.toEuclideanLin A.transpose ∘ₗ T := by ext x i simp [T, Matrix.toEuclideanLin_apply, Matrix.mulVec_mulVec] _ = adjoint T ∘ₗ T := by rw [← Matrix.conjTranspose_eq_transpose_of_trivial A, Matrix.toEuclideanLin_conjTranspose_eq_adjoint] rw [hc] exact (LinearMap.adjoint_comp_self_injective_iff T).2 hA apply (Matrix.isUnit_iff_isUnit_det _).mp apply Matrix.mulVec_injective_iff_isUnit.mp intro x y hxy have he : Matrix.toEuclideanLin (A.transpose * A) (toLp 2 x) = Matrix.toEuclideanLin (A.transpose * A) (toLp 2 y) := by simpa [Matrix.toEuclideanLin_apply] using congrArg (toLp 2) hxy have := hgram he simpa using congrArg ofLp this
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summaryClosure_gram_det_isUnit_of_injective · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryClosure.lean:444
theorem summaryClosure_penrose_left_inverse_of_injective

The Gram-form Penrose inverse is a left inverse on every injective rectangular map. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols :
A :
RectMatrix rows cols
penroseInverse A * A = 1
Proof (Lean source)
-- @node: summaryClosure_penrose_left_inverse_of_injective lemma summaryClosure_penrose_left_inverse_of_injective {rows cols : ℕ} (A : RectMatrix rows cols) (hA : Injective (toEuclideanLin A)) : penroseInverse A * A = 1 := by letI := Matrix.invertibleOfIsUnitDet (A.transpose * A) (summaryClosure_gram_det_isUnit_of_injective A hA) simp only [penroseInverse] rw [Matrix.mul_assoc, Matrix.inv_mul_of_invertible]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summaryClosure_penrose_left_inverse_of_injective · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryClosure.lean:471
theorem homogeneousSummarySpecialization_holds

Homogeneous summary specialization holds: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
Proof (Lean source)
lemma homogeneousSummarySpecialization_holds (k dx dz : ℕ) (L pi0 sigma0 : ℝ) : HomogeneousSummarySpecialization k dx dz L pi0 sigma0 := by intro Q tauStar V hV hhom unfold HomogeneousEffects at hhom letI := Q.prob rcases Q.model.coreDomain with ⟨hk, hkx, hkz, hL, hpi, hpiMax, hsigma, hsigmaMax⟩ let B := targetFeature Q.P let R : RectMatrix k k := B.transpose * V.V let C : BoolRectMatrix dz k := fun t => referenceFeature Q.P t * latentArmWeights Q.P t have hMfac (t : Bool) : observedProxyMoment Q.summary t * V.V = C t * R := by rw [show Q.summary = obsSummary Q.P from rfl, observedProxyMoment_factorization Q.P hk hkx hL hpi Q.model t] simp only [C, R, B, Matrix.mul_assoc] have hNfac (t : Bool) : observedOutcomeProxyMoment Q.summary t * V.V = C t * diagonal (latentMean Q.P t) * R := by rw [show Q.summary = obsSummary Q.P from rfl, observedOutcomeProxyMoment_factorization Q.P hk hpi Q.model t] simp only [C, R, B, Matrix.mul_assoc] have hAinj (t : Bool) : Injective (toEuclideanLin (observedProxyMoment Q.summary t * V.V)) := by have hm := observedProxyMoment_compression_margin Q.P hk hkx hL hpi hsigma Q.model t V hV apply summaryClosure_injective_of_signalMinSingular_pos exact (mul_pos hpi (sq_pos_of_pos hsigma)).trans_le hm.2 have hRinj : Injective (toEuclideanLin R) := by intro x y hxy apply hAinj false rw [hMfac false] simpa [Matrix.toEuclideanLin_apply, Matrix.mulVec_mulVec] using congrArg (toEuclideanLin (C false)) hxy have hRunit : IsUnit R.det := by apply (Matrix.isUnit_iff_isUnit_det _).mp apply Matrix.mulVec_injective_iff_isUnit.mp intro x y hxy apply congrArg ofLp apply hRinj simpa [Matrix.toEuclideanLin_apply] using congrArg (toLp 2) hxy letI := Matrix.invertibleOfIsUnitDet R hRunit have hterm (t : Bool) : penroseInverse (observedProxyMoment Q.summary t * V.V) * (observedOutcomeProxyMoment Q.summary t * V.V) = R⁻¹ * diagonal (latentMean Q.P t) * R := by have hNrewrite : observedOutcomeProxyMoment Q.summary t * V.V = (observedProxyMoment Q.summary t * V.V) * (R⁻¹ * diagonal (latentMean Q.P t) * R) := by rw [hMfac t, hNfac t] simp only [Matrix.mul_assoc] rw [← Matrix.mul_assoc R R⁻¹, Matrix.mul_inv_of_invertible, Matrix.one_mul] rw [hNrewrite, ← Matrix.mul_assoc, summaryClosure_penrose_left_inverse_of_injective _ (hAinj t), Matrix.one_mul] constructor · unfold compressedOperator change genuinePenroseInverse (observedProxyMoment Q.summary true * V.V) * (observedOutcomeProxyMoment Q.summary true * V.V) - genuinePenroseInverse (observedProxyMoment Q.summary false * V.V) * (observedOutcomeProxyMoment Q.summary false * V.V) = _ rw [genuinePenroseInverse_eq_penroseInverse_of_injective _ (hAinj true), genuinePenroseInverse_eq_penroseInverse_of_injective _ (hAinj false), hterm true, hterm false] have hdiag : diagonal (latentMean Q.P true) - diagonal (latentMean Q.P false) = diagonal (fun u => latentEffect Q.P u) := by ext i j by_cases hij : i = j <;> simp [Matrix.diagonal_apply, hij, latentEffect] rw [← Matrix.sub_mul, ← Matrix.mul_sub, hdiag] have hdiagStar : diagonal (fun u => latentEffect Q.P u) = tauStar • (1 : RectMatrix k k) := by ext i j by_cases hij : i = j · subst j simpa [Matrix.diagonal_apply] using hhom i · simp [Matrix.diagonal_apply, hij] rw [hdiagStar] simp only [Matrix.mul_smul, Matrix.smul_mul, Matrix.mul_one, Matrix.inv_mul_of_invertible, smul_eq_mul] · rw [quotientLaw, AtomicLaw.LawModulo.toMeasure_eq_of_mk] unfold AtomicLaw.ProbabilityLaw.toMeasure AtomicLaw.toMeasure quotientLawRaw change (∑ i : Fin k, ofReal (latentMass Q.P i) • Measure.dirac (latentEffect Q.P i)) = Measure.dirac tauStar rw [show (∑ i : Fin k, ofReal (latentMass Q.P i) • Measure.dirac (latentEffect Q.P i)) = ∑ i : Fin k, ofReal (latentMass Q.P i) • Measure.dirac tauStar by apply Finset.sum_congr rfl intro i _ rw [hhom i]] rw [← Finset.sum_smul] have hsumReal : ∑ i : Fin k, latentMass Q.P i = 1 := by simpa [quotientLawRaw] using (quotientLawRaw_valid Q.P Q.model).2.1 have hsum : ∑ i : Fin k, ofReal (latentMass Q.P i) = 1 := by change ∑ i : Fin k, ofReal (Q.P.real (latentClass i)) = 1 change (∑ i : Fin k, Q.P.real (latentClass i)) = 1 at hsumReal calc _ = ofReal (∑ i : Fin k, Q.P.real (latentClass i)) := by symm simpa using ENNReal.ofReal_sum_of_nonneg (s := univ) (f := fun i : Fin k => Q.P.real (latentClass i)) (fun _ _ => measureReal_nonneg) _ = 1 := by rw [hsumReal]; exact ENNReal.ofReal_one rw [hsum, one_smul]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.homogeneousSummarySpecialization_holds · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryClosure.lean:481
structure SummaryClosureData

The complete closed-summary node: its closure, identified quotient functional, spectral moment identity, and homogeneous-effect specialization. It uses the supplied parameters.

Definition (Lean source)
k dx dz :
L pi0 sigma0 :
K :
K_eq :
K = closure (admissibleImage k dx dz L pi0 sigma0)
F :
{q // q ∈ admissibleImage k dx dz L pi0 sigma0} → AtomicLaw.LawModulo k (effectRadius dz L sigma0)
momentIdentity :
PublishedMomentIdentity k dx dz L pi0 sigma0
homogeneous :
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.SummaryClosureData · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryClosure.lean:585
def summaryClosureData Definition 43 in the paper ↗

For the supplied parameters, summary Closure Data is given by its defining clause.

Definition (Lean source)
k dx dz :
L pi0 sigma0 :
summaryClosureData k dx dz L pi0 sigma0 :
SummaryClosureData k dx dz L pi0 sigma0
clause 1
K := summaryClosure k dx dz L pi0 sigma0
clause 2
K_eq := rfl
clause 3
F := publishedQuotientFunctional k dx dz L pi0 sigma0
clause 4
momentIdentity := publishedMomentIdentity_holds k dx dz L pi0 sigma0
clause 5
homogeneous := homogeneousSummarySpecialization_holds k dx dz L pi0 sigma0
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summaryClosureData · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryClosure.lean:596

Data supplied by the unique continuous extension and measurable nearest-point construction. The extension is defined only on K, at the paper's fixed effect radius. It uses the supplied parameters.

Definition (Lean source)
k dx dz n :
L pi0 sigma0 :
k_pos :
0 < k
radius_nonneg :
0 ≤ effectRadius dz L sigma0
Fbar :
{q // q ∈ summaryClosure k dx dz L pi0 sigma0} → AtomicLaw.LawModulo k (effectRadius dz L sigma0)
@realizes \(\overline F\)(continuous extension on K)
Pi :
SummarySpace dx dz → SummarySpace dx dz
continuousFbar :
extendsOnModel :
∀ Q : ModelLaw k dx dz L pi0 sigma0,
Fbar ⟨Q.summary, by apply subset_closure exact ⟨Q, rfl⟩⟩
= by letI := Q.prob exact quotientLaw Q.P Q.model
measurablePi :
nearest :
∀ s
if
summaryClosure k dx dz L pi0 sigma0 ≠ ∅
then
Pi s ∈ summaryClosure k dx dz L pi0 sigma0 ∧
∀ q ∈ summaryClosure k dx dz L pi0 sigma0, dS (Pi s) s ≤ dS q s
empty_fallback :
summaryClosure k dx dz L pi0 sigma0 = ∅ → ∀ s, Pi s = 0
measurableRepair :
Measurable (fun sample : Fin n → Obs dx dz => if hK : summaryClosure k dx dz L pi0 sigma0 = ∅ then AtomicLaw.LawModulo.deltaZeroLaw k_pos radius_nonneg else Fbar ⟨Pi (empSummary sample), (nearest _ hK).1⟩)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.SummaryRepairData · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryClosure.lean:605
def summaryRepair

The repaired estimator data. @realizes ν^n\widehat\nu_n(Fbar(Pi(empSummary))) For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz n :
L pi0 sigma0 :
R :
SummaryRepairData k dx dz n L pi0 sigma0
summaryRepair R :
(Fin n → Obs dx dz) → AtomicLaw.LawModulo k (effectRadius dz L sigma0)
fun sample
=> if hK : summaryClosure k dx dz L pi0 sigma0 = ∅ then AtomicLaw.LawModulo.deltaZeroLaw R.k_pos R.radius_nonneg else R.Fbar ⟨R.Pi (empSummary sample), (R.nearest _ hK).1⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summaryRepair · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryClosure.lean:631

For the ambient setting, ordered Masses is given by its defining clause.

Definition (Lean source)
k :
radius :
ν :
AtomicLaw k radius
orderedMasses ν :
Fin k → ℝ
if (∀ i, 0 < ν.weight i) ∧
Injective ν.atom then fun j
=> ∑ i, if (Finset.univ.filter fun l => ν.atom l < ν.atom i).card = j.val then ν.weight i else 0 else fun _ => (k : ℝ)⁻¹
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.orderedMasses · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryClosure.lean:640
def orderedWeightEstimator

Total effect-ordered mass estimator, with barycenter fallback. @realizes p(P)p^{\uparrow}(P)(ordered true masses) @realizes p^n\widehat p_n^{\uparrow}(ordered estimated masses) @realizes p~n\widetilde p_n(generic competitor type) For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz n :
L pi0 sigma0 :
R :
SummaryRepairData k dx dz n L pi0 sigma0
orderedWeightEstimator R :
(Fin n → Obs dx dz) → (Fin k → ℝ)
fun sample => orderedMasses (summaryRepair R sample).representative.1
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.orderedWeightEstimator · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryClosure.lean:647
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.SummaryMetric 11 declarations A concrete metric on finite-dimensional summary coordinates and comparison with dS.

A concrete metric on finite-dimensional summary coordinates and comparison with dS.

To coordinates injective: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx dz :
Injective (@SummarySpace.toCoordinates dx dz)
Proof (Lean source)
lemma SummarySpace.toCoordinates_injective {dx dz : ℕ} : Injective (@SummarySpace.toCoordinates dx dz) := by intro p q h cases p cases q simp only [SummarySpace.toCoordinates] at h simp_all
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.SummarySpace.toCoordinates_injective · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryMetric.lean:8

For target- and reference-proxy dimensions, metric summary coordinates are the Euclidean representation of the four moment matrices and target-proxy mean.

Definition (Lean source)
dx dz :
SummaryMetricCoordinates dx dz :
Type
EuclideanSpace ℝ (Fin dz × Fin dx) × EuclideanSpace ℝ (Fin dz × Fin dx) × EuclideanSpace ℝ (Fin dz × Fin dx) × EuclideanSpace ℝ (Fin dz × Fin dx) × Euc dx
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.SummaryMetricCoordinates · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryMetric.lean:17
def toMetricCoordinates

For the supplied parameters, to Metric Coordinates is given by its defining clause.

Definition (Lean source)
dx dz :
s :
toMetricCoordinates s :
(toLp 2 (fun ij => s.M0 ij.1 ij.2), toLp 2 (fun ij => s.M1 ij.1 ij.2), toLp 2 (fun ij => s.N0 ij.1 ij.2), toLp 2 (fun ij => s.N1 ij.1 ij.2), toLp 2 s.mX)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.SummarySpace.toMetricCoordinates · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryMetric.lean:24
theorem toMetricCoordinates_injective

To metric coordinates injective: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx dz :
Injective (@SummarySpace.toMetricCoordinates dx dz)
Proof (Lean source)
lemma SummarySpace.toMetricCoordinates_injective {dx dz : ℕ} : Injective (@SummarySpace.toMetricCoordinates dx dz) := by intro p q h cases p cases q simp only [SummarySpace.toMetricCoordinates, Prod.mk.injEq] at h rcases h with ⟨h0, h1, h2, h3, h4⟩ congr · funext i j exact congrFun (congrArg ofLp h0) (i, j) · funext i j exact congrFun (congrArg ofLp h1) (i, j) · funext i j exact congrFun (congrArg ofLp h2) (i, j) · funext i j exact congrFun (congrArg ofLp h3) (i, j) · exact congrArg ofLp h4
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.SummarySpace.toMetricCoordinates_injective · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryMetric.lean:33
def fromMetricCoordinates

For the supplied parameters, from Metric Coordinates is given by its defining clause.

Definition (Lean source)
dx dz :
fromMetricCoordinates c :
((fun i j => c.1.ofLp (i, j)), (fun i j => c.2.1.ofLp (i, j)), (fun i j => c.2.2.1.ofLp (i, j)), (fun i j => c.2.2.2.1.ofLp (i, j)), c.2.2.2.2.ofLp)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.fromMetricCoordinates · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryMetric.lean:53
theorem toMetricCoordinates_continuous

To metric coordinates continuous: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx dz :
Continuous (@SummarySpace.toMetricCoordinates dx dz)
Proof (Lean source)
lemma SummarySpace.toMetricCoordinates_continuous {dx dz : ℕ} : Continuous (@SummarySpace.toMetricCoordinates dx dz) := by unfold SummarySpace.toMetricCoordinates have hcoord : Continuous (@SummarySpace.toCoordinates dx dz) := continuous_induced_dom have hM0 : Continuous (fun s : SummarySpace dx dz => s.M0) := continuous_fst.comp hcoord have hM1 : Continuous (fun s : SummarySpace dx dz => s.M1) := (continuous_fst.comp continuous_snd).comp hcoord have hN0 : Continuous (fun s : SummarySpace dx dz => s.N0) := (continuous_fst.comp (continuous_snd.comp continuous_snd)).comp hcoord have hN1 : Continuous (fun s : SummarySpace dx dz => s.N1) := (continuous_fst.comp (continuous_snd.comp (continuous_snd.comp continuous_snd))).comp hcoord have hmX : Continuous (fun s : SummarySpace dx dz => s.mX) := (continuous_snd.comp (continuous_snd.comp (continuous_snd.comp continuous_snd))).comp hcoord fun_prop
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.SummarySpace.toMetricCoordinates_continuous · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryMetric.lean:61
theorem fromMetricCoordinates_continuous

From metric coordinates continuous: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx dz :
Proof (Lean source)
lemma fromMetricCoordinates_continuous {dx dz : ℕ} : Continuous (@fromMetricCoordinates dx dz) := by unfold fromMetricCoordinates fun_prop
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.fromMetricCoordinates_continuous · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryMetric.lean:81
theorem from_toMetricCoordinates

From to metric coordinates: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx dz :
s :
fromMetricCoordinates s.toMetricCoordinates = s.toCoordinates
Proof (Lean source)
lemma from_toMetricCoordinates {dx dz : ℕ} (s : SummarySpace dx dz) : fromMetricCoordinates s.toMetricCoordinates = s.toCoordinates := by rfl
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.from_toMetricCoordinates · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryMetric.lean:88
instance summaryMetricSpace

For the ambient setting, summary Metric Space is given by its defining clause.

Definition (Lean source)
noncomputable instance summaryMetricSpace {dx dz : ℕ} : MetricSpace (SummarySpace dx dz) := let m := MetricSpace.induced SummarySpace.toMetricCoordinates SummarySpace.toMetricCoordinates_injective inferInstance m.replaceTopology (by change TopologicalSpace.induced SummarySpace.toCoordinates inferInstance = TopologicalSpace.induced SummarySpace.toMetricCoordinates inferInstance apply le_antisymm · exact continuous_iff_le_induced.mp SummarySpace.toMetricCoordinates_continuous · apply continuous_iff_le_induced.mp have hc : @Continuous (SummarySpace dx dz) (SummaryCoordinates dx dz) (TopologicalSpace.induced SummarySpace.toMetricCoordinates inferInstance) inferInstance SummarySpace.toCoordinates := by have hind : @Continuous (SummarySpace dx dz) (SummaryMetricCoordinates dx dz) (TopologicalSpace.induced SummarySpace.toMetricCoordinates inferInstance) inferInstance SummarySpace.toMetricCoordinates := continuous_induced_dom have hcomp : @Continuous (SummarySpace dx dz) (SummaryCoordinates dx dz) (TopologicalSpace.induced SummarySpace.toMetricCoordinates inferInstance) instTopologicalSpaceProd (fromMetricCoordinates ∘ SummarySpace.toMetricCoordinates) := @Continuous.comp (SummarySpace dx dz) (SummaryMetricCoordinates dx dz) (SummaryCoordinates dx dz) (TopologicalSpace.induced SummarySpace.toMetricCoordinates inferInstance) inferInstance instTopologicalSpaceProd _ _ fromMetricCoordinates_continuous hind convert hcomp using 1 funext s exact from_toMetricCoordinates s exact hc)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summaryMetricSpace · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryMetric.lean:94
theorem dS_self

For any observable summary, its summary distance from itself is zero.

Formal statement
dx dz :
p :
dS p p = 0
Proof (Lean source)
-- @node: summaryMetric_dS_self @[simp] lemma dS_self {dx dz : ℕ} (p : SummarySpace dx dz) : dS p p = 0 := by unfold dS have hz : matrixCLM (0 : RectMatrix dz dx) = 0 := by ext x i simp [matrixCLM, Matrix.toEuclideanLin_apply] simp [hz]
theorem dS_le_dist_mul Lemma 22 in the paper ↗

D s le dist mul: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx dz :
p q :
dS p q ≤ (4 * entryNormConstant dz dx + dx) * dist p q
Proof (Lean source)
lemma dS_le_dist_mul {dx dz : ℕ} (p q : SummarySpace dx dz) : dS p q ≤ (4 * entryNormConstant dz dx + dx) * dist p q := by have hcomp0 : ‖WithLp.toLp 2 (fun ij : Fin dz × Fin dx => (p.M0 - q.M0) ij.1 ij.2)‖ ≤ dist p q := by have hproj : dist p.toMetricCoordinates.1 q.toMetricCoordinates.1 ≤ dist p.toMetricCoordinates q.toMetricCoordinates := by simp [Prod.dist_eq] calc _ = dist p.toMetricCoordinates.1 q.toMetricCoordinates.1 := by rw [dist_eq_norm] congr 1 _ ≤ dist p q := hproj have hcomp1 : ‖WithLp.toLp 2 (fun ij : Fin dz × Fin dx => (p.M1 - q.M1) ij.1 ij.2)‖ ≤ dist p q := by have hproj : dist p.toMetricCoordinates.2.1 q.toMetricCoordinates.2.1 ≤ dist p.toMetricCoordinates q.toMetricCoordinates := by simp [Prod.dist_eq] calc _ = dist p.toMetricCoordinates.2.1 q.toMetricCoordinates.2.1 := by rw [dist_eq_norm] congr 1 _ ≤ dist p q := hproj have hcomp2 : ‖WithLp.toLp 2 (fun ij : Fin dz × Fin dx => (p.N0 - q.N0) ij.1 ij.2)‖ ≤ dist p q := by have hproj : dist p.toMetricCoordinates.2.2.1 q.toMetricCoordinates.2.2.1 ≤ dist p.toMetricCoordinates q.toMetricCoordinates := by simp [Prod.dist_eq] calc _ = dist p.toMetricCoordinates.2.2.1 q.toMetricCoordinates.2.2.1 := by rw [dist_eq_norm] congr 1 _ ≤ dist p q := hproj have hcomp3 : ‖WithLp.toLp 2 (fun ij : Fin dz × Fin dx => (p.N1 - q.N1) ij.1 ij.2)‖ ≤ dist p q := by have hproj : dist p.toMetricCoordinates.2.2.2.1 q.toMetricCoordinates.2.2.2.1 ≤ dist p.toMetricCoordinates q.toMetricCoordinates := by simp [Prod.dist_eq] calc _ = dist p.toMetricCoordinates.2.2.2.1 q.toMetricCoordinates.2.2.2.1 := by rw [dist_eq_norm] congr 1 _ ≤ dist p q := hproj have hcomp4 : ‖(toLp 2 (p.mX - q.mX) : Euc dx)‖ ≤ dist p q := by have hproj : dist p.toMetricCoordinates.2.2.2.2 q.toMetricCoordinates.2.2.2.2 ≤ dist p.toMetricCoordinates q.toMetricCoordinates := by simp [Prod.dist_eq] calc _ = dist p.toMetricCoordinates.2.2.2.2 q.toMetricCoordinates.2.2.2.2 := by simp [dist_eq_norm, SummarySpace.toMetricCoordinates] _ ≤ dist p q := hproj have hblock (A B : RectMatrix dz dx) (hAB : ‖WithLp.toLp 2 (fun ij : Fin dz × Fin dx => (A - B) ij.1 ij.2)‖ ≤ dist p q) : ‖matrixCLM (A - B)‖ ≤ entryNormConstant dz dx * dist p q := by apply matrixNorm_le_entryBound (A - B) (dist p q) dist_nonneg intro i j have hij := PiLp.norm_apply_le (toLp 2 (fun ij : Fin dz × Fin dx => (A - B) ij.1 ij.2)) (i, j) have hflat : ‖WithLp.toLp 2 (fun ij : Fin dz × Fin dx => (A - B) ij.1 ij.2)‖ ≤ dist p q := by simpa [dist_eq_norm] using hAB simpa [Real.norm_eq_abs] using hij.trans hflat have hm : sqrt (∑ i, (p.mX i - q.mX i) ^ 2) ≤ dx * dist p q := by have hm' : ‖(toLp 2 (p.mX - q.mX) : Euc dx)‖ ≤ dx * dist p q := by apply eucNorm_le_card_mul_bound _ _ dist_nonneg intro i have hi := PiLp.norm_apply_le (toLp 2 (p.mX - q.mX) : Euc dx) i simpa [Real.norm_eq_abs] using hi.trans hcomp4 simpa [EuclideanSpace.norm_eq, Real.norm_eq_abs, sq_abs] using hm' unfold dS have h0 := hblock p.M0 q.M0 hcomp0 have h1 := hblock p.M1 q.M1 hcomp1 have h2 := hblock p.N0 q.N0 hcomp2 have h3 := hblock p.N1 q.N1 hcomp3 nlinarith [entryNormConstant_nonneg dz dx, dist_nonneg (x := p) (y := q)]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.dS_le_dist_mul · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/SummaryMetric.lean:134
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.Witness 58 declarations Explicit finite two-class witness laws and local experiments.

Explicit finite two-class witness laws and local experiments.

def bernoulliMass

For the supplied parameters, bernoulli Mass is given by its defining clause.

Definition (Lean source)
p :
b :
bernoulliMass p b :
if b then p else 1 - p
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.bernoulliMass · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:12

Bernoulli mass nonneg: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
p :
b :
hp0 :
0 ≤ p
hp1 :
p ≤ 1
0 ≤ bernoulliMass p b
Proof (Lean source)
lemma bernoulliMass_nonneg (p : ℝ) (b : Bool) (hp0 : 0 ≤ p) (hp1 : p ≤ 1) : 0 ≤ bernoulliMass p b := by cases b <;> simp [bernoulliMass] <;> linarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.bernoulliMass_nonneg · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:16

Sum bernoulli mass: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
p :
∑ b : Bool, bernoulliMass p b = 1
Proof (Lean source)
lemma sum_bernoulliMass (p : ℝ) : ∑ b : Bool, bernoulliMass p b = 1 := by simp [bernoulliMass]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.sum_bernoulliMass · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:22

Sum mul bernoulli mass: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
a p :
∑ b : Bool, a * bernoulliMass p b = a
Proof (Lean source)
lemma sum_mul_bernoulliMass (a p : ℝ) : ∑ b : Bool, a * bernoulliMass p b = a := by rw [← Finset.mul_sum, sum_bernoulliMass, mul_one]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.sum_mul_bernoulliMass · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:27
def vec2

For the supplied parameters, vec2 is given by its defining clause.

Definition (Lean source)
a b :
vec2 a b :
Fin 2 → ℝ
fun i => if i.val = 0 then a else b
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.vec2 · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:31
def boolReal

For the supplied parameters, bool Real is given by its defining clause.

Definition (Lean source)
b :
boolReal b :
if b then 1 else 0
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.boolReal · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:33
def det2

For the supplied parameters, det2 is given by its defining clause.

Definition (Lean source)
A :
det2 A :
A 0 0 * A 1 1 - A 0 1 * A 1 0
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.det2 · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:36
def witnessPoint

For the supplied parameters, witness Point is given by its defining clause.

Definition (Lean source)
u :
Fin 2
t x z y0 y1 :
witnessPoint u t x z y0 y1 :
FullData 2 2 2
clause 1
U := u
clause 2
T := t
clause 3
X := vec2 1 (boolReal x)
clause 4
Z := vec2 1 (boolReal z)
clause 5
Y0 := boolReal y0
clause 6
Y1 := boolReal y1
clause 7
Y := if t then boolReal y1 else boolReal y0
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witnessPoint · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:39
def witnessWeight

For the supplied parameters, witness Weight is given by its defining clause.

Definition (Lean source)
eps :
u :
Fin 2
t x z y0 y1 :
witnessWeight eps u t x z y0 y1 :
pu :
if u.val = 0 then 2 / 5 else 3 / 5
pt :
if u.val = 0 then 2 / 5 else 3 / 5
px :
if u.val = 0 then 1 / 5 else 4 / 5
pz :
if t then (if u.val = 0 then 7 / 20 else 3 / 4) else (if u.val = 0 then 3 / 10 else 7 / 10)
py0 :
1 / 4
py1 :
if u.val = 0 then 1 / 2 - eps else 1 / 2 + eps
pu * bernoulliMass pt t * bernoulliMass px x * bernoulliMass pz z * bernoulliMass py0 y0 * bernoulliMass py1 y1
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witnessWeight · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:49

Every elementary weight in the admissible witness family is nonnegative. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
hlo :
0 ≤ eps
hhi :
eps ≤ 1 / 8
u :
Fin 2
t x z y0 y1 :
0 ≤ witnessWeight eps u t x z y0 y1
Proof (Lean source)
-- @node: witnessWeight_nonneg lemma witnessWeight_nonneg (eps : ℝ) (hlo : 0 ≤ eps) (hhi : eps ≤ 1 / 8) (u : Fin 2) (t x z y0 y1 : Bool) : 0 ≤ witnessWeight eps u t x z y0 y1 := by fin_cases u <;> cases t <;> cases x <;> cases z <;> cases y0 <;> cases y1 <;> simp [witnessWeight, bernoulliMass] <;> nlinarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witnessWeight_nonneg · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:61
theorem measurableSet_witness_latentCell Lemma measurableSet_witness_latentCell in the paper ↗

Latent-arm cylinders are measurable in the witness full-data space. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
u :
Fin 2
t :
MeasurableSet (latentCell (dx := 2) (dz := 2) u t)
Proof (Lean source)
-- @node: measurableSet_witness_latentCell lemma measurableSet_witness_latentCell (u : Fin 2) (t : Bool) : MeasurableSet (latentCell (dx := 2) (dz := 2) u t) := by have hcoord : Measurable (@FullData.toCoordinates 2 2 2) := continuous_induced_dom.measurable have hUT : Measurable (fun w : FullData 2 2 2 => (w.U, w.T)) := by change Measurable (fun w => ((FullData.toCoordinates w).1, (FullData.toCoordinates w).2.1)) exact hcoord.fst.prodMk hcoord.snd.fst have hpre := hUT (measurableSet_singleton (u, t)) simpa [latentCell, preimage] using hpre
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.measurableSet_witness_latentCell · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:69
theorem measurableSet_witness_latentClass Lemma measurableSet_witness_latentClass in the paper ↗

Latent-class cylinders are measurable in the witness full-data space. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
u :
Fin 2
MeasurableSet (latentClass (dx := 2) (dz := 2) u)
Proof (Lean source)
-- @node: measurableSet_witness_latentClass lemma measurableSet_witness_latentClass (u : Fin 2) : MeasurableSet (latentClass (dx := 2) (dz := 2) u) := by have hcoord : Measurable (@FullData.toCoordinates 2 2 2) := continuous_induced_dom.measurable have hU : Measurable (fun w : FullData 2 2 2 => w.U) := by change Measurable (fun w => (FullData.toCoordinates w).1) exact hcoord.fst have hpre := hU (measurableSet_singleton u) simpa [latentClass, preimage] using hpre
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.measurableSet_witness_latentClass · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:82
def WitnessPerturbationDomain

Domain of the collision-witness perturbation. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
eps :
WitnessPerturbationDomain eps :
Prop
clause 1
0 ≤ eps
clause 2
eps ≤ 1 / 8
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.WitnessPerturbationDomain · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:94
def witnessLaw

Explicit two-class Bernoulli collision law. @realizes PεwitP_{\varepsilon}^{\mathrm{wit}}(finite Dirac law) @realizes ε\varepsilon(real carrier; range via WitnessPerturbationDomain) For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
eps :
witnessLaw eps :
∑ u : Fin 2, ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, ofReal (witnessWeight eps u t x z y0 y1) • Measure.dirac (witnessPoint u t x z y0 y1)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witnessLaw · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:99
theorem witnessLaw_isProbabilityMeasure

Witness law is probability measure: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
hlo :
0 ≤ eps
hhi :
eps ≤ 1 / 8
Proof (Lean source)
lemma witnessLaw_isProbabilityMeasure (eps : ℝ) (hlo : 0 ≤ eps) (hhi : eps ≤ 1 / 8) : IsProbabilityMeasure (witnessLaw eps) := by have hw : ∀ (u : Fin 2) (t x z y0 y1 : Bool), 0 ≤ witnessWeight eps u t x z y0 y1 := by intro u t x z y0 y1 fin_cases u <;> cases t <;> cases x <;> cases z <;> cases y0 <;> cases y1 <;> simp [witnessWeight, bernoulliMass] <;> nlinarith constructor rw [show (witnessLaw eps) univ = ∑ u : Fin 2, ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, ofReal (witnessWeight eps u t x z y0 y1) by simp [witnessLaw]] calc _ = ofReal (∑ u : Fin 2, ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps u t x z y0 y1) := by symm rw [ENNReal.ofReal_sum_of_nonneg] · apply Finset.sum_congr rfl intro u _ rw [ENNReal.ofReal_sum_of_nonneg] · apply Finset.sum_congr rfl intro t _ rw [ENNReal.ofReal_sum_of_nonneg] · apply Finset.sum_congr rfl intro x _ rw [ENNReal.ofReal_sum_of_nonneg] · apply Finset.sum_congr rfl intro z _ rw [ENNReal.ofReal_sum_of_nonneg] · apply Finset.sum_congr rfl intro y0 _ rw [ENNReal.ofReal_sum_of_nonneg] exact fun y1 _ => hw u t x z y0 y1 · exact fun y0 _ => sum_nonneg fun y1 _ => hw u t x z y0 y1 · exact fun z _ => sum_nonneg fun y0 _ => sum_nonneg fun y1 _ => hw u t x z y0 y1 · exact fun x _ => sum_nonneg fun z _ => sum_nonneg fun y0 _ => sum_nonneg fun y1 _ => hw u t x z y0 y1 · exact fun t _ => sum_nonneg fun x _ => sum_nonneg fun z _ => sum_nonneg fun y0 _ => sum_nonneg fun y1 _ => hw u t x z y0 y1 · exact fun u _ => sum_nonneg fun t _ => sum_nonneg fun x _ => sum_nonneg fun z _ => sum_nonneg fun y0 _ => sum_nonneg fun y1 _ => hw u t x z y0 y1 _ = 1 := by simp [witnessWeight, bernoulliMass] ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witnessLaw_isProbabilityMeasure · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:110
theorem witnessWeight_sum_nuisance Lemma witnessWeight_sum_nuisance in the paper ↗

Summing out the four Bernoulli nuisance coordinates leaves the prescribed latent-class and treatment masses. This is the finite-factorization calculation used by the witness-validity proof for its class and arm marginals. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
u :
Fin 2
t :
∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps u t x z y0 y1
= (if u.val = 0 then 2 / 5 else 3 / 5) * bernoulliMass (if u.val = 0 then 2 / 5 else 3 / 5) t
Proof (Lean source)
-- @node: witnessWeight_sum_nuisance lemma witnessWeight_sum_nuisance (eps : ℝ) (u : Fin 2) (t : Bool) : ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps u t x z y0 y1 = (if u.val = 0 then 2 / 5 else 3 / 5) * bernoulliMass (if u.val = 0 then 2 / 5 else 3 / 5) t := by simp only [witnessWeight, sum_mul_bernoulliMass]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witnessWeight_sum_nuisance · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:157
theorem integral_witnessLaw_restrict

Restricted integrals under the finite witness law reduce to its explicit 128-point sum. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
A :
Set (FullData 2 2 2)
DecidablePred (· ∈ A)
hA :
f :
FullData 2 2 2 → ℝ
∫ w in A, f w ∂witnessLaw eps
= ∑ u : Fin 2, ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, (ofReal (witnessWeight eps u t x z y0 y1)).toReal * if witnessPoint u t x z y0 y1 ∈ A then f (witnessPoint u t x z y0 y1) else 0
Proof (Lean source)
-- @node: integral_witnessLaw_restrict lemma integral_witnessLaw_restrict (eps : ℝ) (A : Set (FullData 2 2 2)) [DecidablePred (· ∈ A)] (hA : MeasurableSet A) (f : FullData 2 2 2 → ℝ) : ∫ w in A, f w ∂witnessLaw eps = ∑ u : Fin 2, ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, (ofReal (witnessWeight eps u t x z y0 y1)).toReal * if witnessPoint u t x z y0 y1 ∈ A then f (witnessPoint u t x z y0 y1) else 0 := by classical let c : Fin 2 × Bool × Bool × Bool × Bool × Bool → ℝ≥0∞ := fun i => ofReal (witnessWeight eps i.1 i.2.1 i.2.2.1 i.2.2.2.1 i.2.2.2.2.1 i.2.2.2.2.2) let p : Fin 2 × Bool × Bool × Bool × Bool × BoolFullData 2 2 2 := fun i => witnessPoint i.1 i.2.1 i.2.2.1 i.2.2.2.1 i.2.2.2.2.1 i.2.2.2.2.2 have hwitness : witnessLaw eps = ∑ i, c i • Measure.dirac (p i) := by simp only [witnessLaw, c, p, Fintype.sum_prod_type] rw [← integral_indicator hA, hwitness, integral_finsetSum_measure] · simp only [c, p, Fintype.sum_prod_type, integral_smul_measure, integral_dirac, smul_eq_mul, Set.indicator_apply] · intro i _ exact (integrable_dirac (by simp)).smul_measure (by simp [c])
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.integral_witnessLaw_restrict · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:168
theorem witnessLaw_real

Event masses under the finite witness law reduce to its explicit 128-point sum. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
A :
Set (FullData 2 2 2)
DecidablePred (· ∈ A)
hA :
= ∑ u : Fin 2, ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, (ofReal (witnessWeight eps u t x z y0 y1)).toReal * if witnessPoint u t x z y0 y1 ∈ A then 1 else 0
Proof (Lean source)
-- @node: witnessLaw_real lemma witnessLaw_real (eps : ℝ) (A : Set (FullData 2 2 2)) [DecidablePred (· ∈ A)] (hA : MeasurableSet A) : (witnessLaw eps).real A = ∑ u : Fin 2, ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, (ofReal (witnessWeight eps u t x z y0 y1)).toReal * if witnessPoint u t x z y0 y1 ∈ A then 1 else 0 := by classical simpa using integral_witnessLaw_restrict eps A hA (fun _ => (1 : ℝ))
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witnessLaw_real · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:190
theorem conditionalMean_witnessLaw

Conditional means under the witness law are ratios of two explicit 128-point sums. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
A :
Set (FullData 2 2 2)
DecidablePred (· ∈ A)
hA :
f :
FullData 2 2 2 → ℝ
conditionalMean (witnessLaw eps) A f
= (∑ u : Fin 2, ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, (ofReal (witnessWeight eps u t x z y0 y1)).toReal * if witnessPoint u t x z y0 y1 ∈ A then 1 else 0)⁻¹ * (∑ u : Fin 2, ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, (ofReal (witnessWeight eps u t x z y0 y1)).toReal * if witnessPoint u t x z y0 y1 ∈ A then f (witnessPoint u t x z y0 y1) else 0)
Proof (Lean source)
-- @node: conditionalMean_witnessLaw lemma conditionalMean_witnessLaw (eps : ℝ) (A : Set (FullData 2 2 2)) [DecidablePred (· ∈ A)] (hA : MeasurableSet A) (f : FullData 2 2 2 → ℝ) : conditionalMean (witnessLaw eps) A f = (∑ u : Fin 2, ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, (ofReal (witnessWeight eps u t x z y0 y1)).toReal * if witnessPoint u t x z y0 y1 ∈ A then 1 else 0)⁻¹ * (∑ u : Fin 2, ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, (ofReal (witnessWeight eps u t x z y0 y1)).toReal * if witnessPoint u t x z y0 y1 ∈ A then f (witnessPoint u t x z y0 y1) else 0) := by rw [conditionalMean, witnessLaw_real eps A hA, integral_witnessLaw_restrict eps A hA]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.conditionalMean_witnessLaw · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:201
def LocalQuotientNeighborhood

For the supplied parameters, Local Quotient Neighborhood is given by its defining clause.

Definition (Lean source)
n :
cLoc :
LocalQuotientNeighborhood P :
Prop
letI : IsProbabilityMeasure (witnessLaw 0) := witnessLaw_isProbabilityMeasure 0 (by norm_num) (by norm_num) klDiv (obsLaw P) (obsLaw (witnessLaw 0))
ofReal (cLoc / n)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.LocalQuotientNeighborhood · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:216
def LocalWeightNeighborhood

For the supplied parameters, Local Weight Neighborhood is given by its defining clause.

Definition (Lean source)
n :
g cLoc :
LocalWeightNeighborhood P :
Prop
eps :
g / 2
klDiv (obsLaw P) ((witnessLaw eps).map obsMap)
ofReal (cLoc / n)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.LocalWeightNeighborhood · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:224
structure LocalQuotientExperiment

Local quotient-law KL experiment. @realizes Lnν\mathcal L_{n}^{\nu}(model KL neighborhood) It uses the supplied parameters.

Definition (Lean source)
n :
L pi0 sigma0 cLoc :
toUCVMWModel :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
cLoc_pos :
0 < cLoc
cLoc_lt_one :
cLoc < 1
neighborhood :
LocalQuotientNeighborhood (n := n) (cLoc := cLoc) P
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.LocalQuotientExperiment · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:231
structure LocalWeightExperiment

Local separated labeled-weight experiment. @realizes Ln,gp\mathcal L_{n,g}^{p}(gap model KL neighborhood) It uses the supplied parameters.

Definition (Lean source)
n :
L pi0 sigma0 cLoc g :
toGapStratum :
GapStratum (L := L) (pi0 := pi0) (sigma0 := sigma0) (g := g) P
cLoc_pos :
0 < cLoc
cLoc_lt_one :
cLoc < 1
neighborhood :
LocalWeightNeighborhood (n := n) (g := g) (cLoc := cLoc) P
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.LocalWeightExperiment · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:240

A complex spectral point of a real square compressed operator. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k :
D :
z :
MatrixEigenvalue D z :
Prop
∃ v : Fin k → ℂ,
v ≠ 0
clause 1
i :
∑ j, (D i j : ℂ) * v j = z * v i
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.MatrixEigenvalue · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:250

For the supplied parameters, Matrix Eigenvector is given by its defining clause.

Definition (Lean source)
k :
D :
z :
v :
Fin k → ℂ
MatrixEigenvector D z v :
Prop
clause 1
v ≠ 0
clause 2
i :
∑ j, (D i j : ℂ) * v j = z * v i
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.MatrixEigenvector · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:255
def complexifyMatrix

For the supplied parameters, complexify Matrix is given by its defining clause.

Definition (Lean source)
k :
D :
complexifyMatrix D :
Matrix (Fin k) (Fin k) ℂ
fun i j => (D i j : ℂ)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.complexifyMatrix · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:259
def polynomialAggregateProjector

A polynomial aggregate projector used by the separate structured-lattice algebra. The constructive repair handle below deliberately does not use it: empirical clusters use Riesz contour projectors instead. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k :
D :
eigenvalue :
Fin k → ℝ
i :
Fin k
polynomialAggregateProjector D eigenvalue i :
(Finset.univ.filter (fun j => eigenvalue j ≠ eigenvalue i)).toList.foldl (fun E j => E * ((eigenvalue i - eigenvalue j)⁻¹ • (D - eigenvalue j • (1 : RectMatrix k k)))) 1
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.polynomialAggregateProjector · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:263
def aggregateMass

For the supplied parameters, aggregate Mass is given by its defining clause.

Definition (Lean source)
k :
radius :
ν :
AtomicLaw k radius
C :
Set
aggregateMass ν C :
by classical exact ∑ i, if (ν.atom i : ℂ) ∈ C then ν.weight i else 0
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.aggregateMass · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:272
def momentDiscrepancy

For the supplied parameters, moment Discrepancy is given by its defining clause.

Definition (Lean source)
k :
radius :
m :
Fin (2 * k) → ℝ
ν :
AtomicLaw k radius
momentDiscrepancy m ν :
∑ j, |m j - ∑ i, ν.weight i * ν.atom i ^ (j : ℕ)|
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.momentDiscrepancy · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:278
def summarySpectralMoments

The identifying moment vector computed from a compressed operator and its summary anchors. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz :
deltaQ :
s :
basis :
summarySpectralMoments deltaQ s basis :
Fin (2 * k) → ℝ
fun j => ∑ a, leftAnchor s basis a * (∑ b, (deltaQ ^ (j : ℕ)) a b * rightAnchor basis b)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summarySpectralMoments · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:283
def effectClusterDiameter

Full pairwise diameter of the effect cluster specified by the overlap relation. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k :
effect :
Fin k → ℝ
sameCluster :
Fin k → Fin k → Bool
i :
Fin k
effectClusterDiameter effect sameCluster i :
sSup {d : ℝ | ∃ u v, sameCluster i u = true ∧ sameCluster i v = true ∧ d = |effect u - effect v|}
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.effectClusterDiameter · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:290
def repairEmpiricalCompressedOperator

The compressed operator computed from the one empirical summary generated by sample. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz n :
pi0 sigma0 :
sample :
Fin n → Obs dx dz
basis :
repairEmpiricalCompressedOperator sample basis :
sHat :
empSummary sample
threshold :
pi0 * sigma0 ^ 2 / 2
thresholdedPenroseInverse threshold (sHat.M1 * basis.V) * (sHat.N1 * basis.V)
- thresholdedPenroseInverse threshold (sHat.M0 * basis.V) * (sHat.N0 * basis.V)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.repairEmpiricalCompressedOperator · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:296
def matrixResolvent

The complex resolvent appearing in the Kato/Riesz contour projector. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k :
D :
z :
matrixResolvent D z :
Matrix (Fin k) (Fin k) ℂ
(z • (1 : Matrix (Fin k) (Fin k) ℂ) - complexifyMatrix D)⁻¹
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.matrixResolvent · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:304
def rieszContourProjector

The Kato/Riesz contour integral of the resolvent of a real empirical operator. Contours are parametrized on [0,1]; certification that they close and avoid the spectrum is carried by RepairHandle. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k :
D :
contour :
ℝ → ℂ
rieszContourProjector D contour :
Matrix (Fin k) (Fin k) ℂ
fun a b
=> (2 * pi * I)⁻¹ * ∫ t in Icc (0 : ℝ) 1, (matrixResolvent D (contour t)) a b * deriv contour t
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.rieszContourProjector · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:309
def contourWindingIndex

The winding index used to tie the certified interior to its contour. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
contour :
ℝ → ℂ
z :
contourWindingIndex contour z :
(2 * pi * I)⁻¹ * ∫ t in Icc (0 : ℝ) 1, (contour t - z)⁻¹ * deriv contour t
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.contourWindingIndex · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:317
structure PGeneratedEmpiricalSummary

One empirical-summary carrier generated from the observed product law of P. Both its law and its summary are pinned, so neither can be chosen independently of the common DGP. It uses the supplied parameters.

Definition (Lean source)
k dx dz n :
carrierLaw :
Measure (Fin n → Obs dx dz)
carrierLaw_eq :
carrierLaw = sampleLaw (n := n) P
sample :
Fin n → Obs dx dz
summary :
summary_eq :
summary = empSummary sample
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.PGeneratedEmpiricalSummary · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:322
def enclosedSpectralMass

Total empirical spectral mass carried by the eigenvalues enclosed by one cluster contour. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k :
location :
Fin k → ℂ
mass :
Fin k → ℝ
interior :
Set
enclosedSpectralMass location mass interior :
by classical exact ∑ r, if location r ∈ interior then (mass r : ℂ) else 0
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.enclosedSpectralMass · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:332
def IsPositiveMomentConeProjection

A positive finite-atomic law is a moment-cone projection of one specified moment vector when it is valid and minimizes the fixed finite-moment discrepancy among valid laws. This relation is used only at the realized empirical summary; it does not choose projections for other inputs.

Definition (Lean source)
k :
radius :
m :
Fin (2 * k) → ℝ
projected :
AtomicLaw k radius
IsPositiveMomentConeProjection m projected :
Prop
clause 1
AtomicLaw.Valid projected
clause 2
candidate :
AtomicLaw k radius
AtomicLaw.Valid candidate
momentDiscrepancy m projected ≤ momentDiscrepancy m candidate
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.IsPositiveMomentConeProjection · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:338

A cluster-level constructive repair certificate indexed by one data-generating probability law, its model witness, one sample from its observed product carrier, and the corresponding population signal basis. No population operator, target law, empirical summary, or basis floats free: all clauses refer definitionally to this single package.

Definition (Lean source)
k dx dz n :
L pi0 sigma0 :
hModel :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
data :
basis :
hBasis :
basis.SpansSignal (obsSummary P)
diagonalizer :
population_diagonalization :
= diagonalizer⁻¹ * diagonal (latentEffect P) * diagonalizer
conditionNumber :
conditionNumber_eq :
conditionNumber = ‖matrixCLM diagonalizer‖ * ‖matrixCLM diagonalizer⁻¹‖
localizationRadius :
localizationRadius_eq :
localizationRadius
= conditionNumber * ‖matrixCLM (repairEmpiricalCompressedOperator (pi0 := pi0) (sigma0 := sigma0) data.sample basis - compressedOperator (obsSummary P) basis hBasis)‖
spectralDisc :
Fin k → Set
spectralDisc_eq :
∀ i, spectralDisc i = {z | ‖z - (latentEffect P i : ℂ)‖ ≤ localizationRadius}
sameCluster :
Fin k → Fin k → Bool
sameCluster_iff :
∀ i j,
sameCluster i j
= trueReflTransGen (fun a b => (spectralDisc a ∩ spectralDisc b).Nonempty) i j
bauerFike_localization :
∀ z
if
MatrixEigenvalue (repairEmpiricalCompressedOperator (pi0 := pi0) (sigma0 := sigma0) data.sample basis) z
then
∃ i, z ∈ spectralDisc i
contour :
Fin k → ℝ → ℂ
contour_closed :
∀ i, contour i 0 = contour i 1
contour_differentiable :
∀ i t
if
t ∈ Icc (0 : ℝ) 1
then
DifferentiableAt ℝ (contour i) t
contour_winding_integrable :
∀ i z
if
(∀ t ∈ Icc (0 : ℝ) 1, contour i t ≠ z)
then
IntegrableOn (fun t => (contour i t - z)⁻¹ * deriv (contour i) t) (Icc (0 : ℝ) 1)
contour_avoids_empirical_spectrum :
∀ i t
if
t ∈ Icc (0 : ℝ) 1
then
¬ MatrixEigenvalue (repairEmpiricalCompressedOperator (pi0 := pi0) (sigma0 := sigma0) data.sample basis) (contour i t)
contourInterior :
Fin k → Set
contourInterior_eq :
∀ i, contourInterior i = {z | contourWindingIndex (contour i) z ≠ 0}
cluster_discs_inside_contour :
∀ i j
if
sameCluster i j = true
then
spectralDisc j ⊆ contourInterior i
other_discs_outside_contour :
∀ i j
if
sameCluster i j = false
then
Disjoint (spectralDisc j) (contourInterior i)
enclosedEmpiricalSpectrum :
Fin k → Set
enclosedEmpiricalSpectrum_eq :
∀ i,
enclosedEmpiricalSpectrum i
= {z | MatrixEigenvalue (repairEmpiricalCompressedOperator (pi0 := pi0) (sigma0 := sigma0) data.sample basis) z ∧ z ∈ contourInterior i}
aggregateProjector :
Fin k → Matrix (Fin k) (Fin k) ℂ
aggregateProjector_riesz_identity :
∀ i,
aggregateProjector i
= rieszContourProjector (repairEmpiricalCompressedOperator (pi0 := pi0) (sigma0 := sigma0) data.sample basis) (contour i)
aggregateProjector_functional_calculus_inside :
∀ i z v
if
MatrixEigenvector (repairEmpiricalCompressedOperator (pi0 := pi0) (sigma0 := sigma0) data.sample basis) z v
and
z ∈ enclosedEmpiricalSpectrum i
then
mulVec (aggregateProjector i) v = v
aggregateProjector_functional_calculus_outside :
∀ i z v
if
MatrixEigenvector (repairEmpiricalCompressedOperator (pi0 := pi0) (sigma0 := sigma0) data.sample basis) z v
and
z ∉ enclosedEmpiricalSpectrum i
then
mulVec (aggregateProjector i) v = 0
empiricalSpectralLocation :
Fin k → ℂ
empiricalSpectralLocation_is_eigenvalue :
∀ r,
MatrixEigenvalue (repairEmpiricalCompressedOperator (pi0 := pi0) (sigma0 := sigma0) data.sample basis) (empiricalSpectralLocation r)
empiricalSpectralMass :
Fin k → ℝ
empiricalSpectralMass_nonneg :
∀ r, 0 ≤ empiricalSpectralMass r
empiricalProjectorMass :
Fin k → ℂ
empiricalProjectorMass_eq :
∀ i,
empiricalProjectorMass i
= ∑ a, (leftAnchor data.summary basis a : ℂ) * (∑ b, aggregateProjector i a b * (rightAnchor basis b : ℂ))
empiricalProjectorMass_spectral_sum :
∀ i,
empiricalProjectorMass i
= enclosedSpectralMass empiricalSpectralLocation empiricalSpectralMass (enclosedEmpiricalSpectrum i)
populationClusterMass :
Fin k → ℝ
populationClusterMass_eq :
∀ i,
populationClusterMass i
= aggregateMass (quotientLawRaw P (effectRadius dz L sigma0)) {z | ∃ j, sameCluster i j = true ∧ z = (latentEffect P j : ℂ)}
clusterDiameter :
Fin k → ℝ
clusterDiameter_eq :
∀ i, clusterDiameter i = effectClusterDiameter (latentEffect P) sameCluster i
clusterTransportPlan :
Fin k → Fin k → Fin k → ℝ
clusterTransportPlan_nonneg :
∀ i u r, 0 ≤ clusterTransportPlan i u r
clusterTransport_source_marginal :
∀ i u,
∑ r, clusterTransportPlan i u r = if sameCluster i u = true then latentMass P u else 0
clusterTransport_target_marginal_inside :
∀ i r
if
empiricalSpectralLocation r ∈ enclosedEmpiricalSpectrum i
then
∑ u, clusterTransportPlan i u r = empiricalSpectralMass r
clusterTransport_target_marginal_outside :
∀ i r
if
empiricalSpectralLocation r ∉ enclosedEmpiricalSpectrum i
then
∑ u, clusterTransportPlan i u r = 0
clusterTransport_support :
∀ i u r
if
0 < clusterTransportPlan i u r
then
sameCluster i u = true
empiricalSpectralLocation r ∈ enclosedEmpiricalSpectrum i ∧
‖empiricalSpectralLocation r - (latentEffect P u : ℂ)‖
≤ localizationRadius + effectClusterDiameter (latentEffect P) sameCluster i
repairedLaw :
AtomicLaw k (effectRadius dz L sigma0)
repairedLaw_isProjection :
IsPositiveMomentConeProjection (summarySpectralMoments (repairEmpiricalCompressedOperator (pi0 := pi0) (sigma0 := sigma0) data.sample basis) data.summary basis) repairedLaw
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.RepairHandle · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:347
def pathTargetFeature

For the supplied parameters, path Target Feature is given by its defining clause.

Definition (Lean source)
h :
pathTargetFeature h :
fun i u
=> if i.val = 0 then 1 else if u.val = 0 then 1 / 5 else (12 / 25 - h / 5) / (3 / 5 - h)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathTargetFeature · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:463
def pathArmTotals

For the supplied parameters, path Arm Totals is given by its defining clause.

Definition (Lean source)
t :
pathArmTotals t :
Fin 2 → ℝ
fun j
=> if j.val = 0 then (if t then 13 / 25 else 12 / 25) else if t then 8 / 25 else 6 / 25
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathArmTotals · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:467
def pathArmWeights

For the supplied parameters, path Arm Weights is given by its defining clause.

Definition (Lean source)
t :
h :
pathArmWeights t h :
Fin 2 → ℝ
fun u => ∑ j, pathArmTotals t j * ((pathTargetFeature h).transpose)⁻¹ j u
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathArmWeights · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:472

Path arm weights formula: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
t :
h :
u :
Fin 2
hh :
|h| ≤ 1 / 100
= if t then (if u.val = 0 then 4 / 25 + 3 * h / 5 else 9 / 25 - 3 * h / 5) else (if u.val = 0 then 6 / 25 + 2 * h / 5 else 6 / 25 - 2 * h / 5)
Proof (Lean source)
lemma pathArmWeights_formula (t : Bool) (h : ℝ) (u : Fin 2) (hh : |h| ≤ 1 / 100) : pathArmWeights t h u = if t then (if u.val = 0 then 4 / 25 + 3 * h / 5 else 9 / 25 - 3 * h / 5) else (if u.val = 0 then 6 / 25 + 2 * h / 5 else 6 / 25 - 2 * h / 5) := by have hne : 3 - h * 5 ≠ 0 := by intro heq have : h = 3 / 5 := by linarith rw [this] at hh norm_num at hh have hdet : -25 - h * (3 - h * 5)⁻¹ * 125 + (3 - h * 5)⁻¹ * 300 ≠ 0 := by intro heq field_simp [hne] at heq linarith fin_cases u <;> cases t <;> simp [pathArmWeights, pathArmTotals, pathTargetFeature, Matrix.inv_def, Matrix.det_fin_two, Matrix.adjugate_fin_two] <;> field_simp [hne, hdet] <;> ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathArmWeights_formula · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:477
theorem pathTargetTransposeInverse_formula Lemma pathTargetTransposeInverse_formula in the paper ↗

Path target transpose inverse formula: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
h :
hh :
|h| ≤ 1 / 100
= !![4 / 3 - 5 * h / 9, 5 * h / 9 - 1 / 3; 25 * h / 9 - 5 / 3, 5 / 3 - 25 * h / 9]
Proof (Lean source)
lemma pathTargetTransposeInverse_formula (h : ℝ) (hh : |h| ≤ 1 / 100) : ((pathTargetFeature h).transpose)⁻¹ = !![4 / 3 - 5 * h / 9, 5 * h / 9 - 1 / 3; 25 * h / 9 - 5 / 3, 5 / 3 - 25 * h / 9] := by have hne : 3 - h * 5 ≠ 0 := by intro heq have : h = 3 / 5 := by linarith rw [this] at hh norm_num at hh have hdet : -25 - h * (3 - h * 5)⁻¹ * 125 + (3 - h * 5)⁻¹ * 300 ≠ 0 := by intro heq field_simp [hne] at heq linarith ext i j fin_cases i <;> fin_cases j <;> simp [pathTargetFeature, Matrix.inv_def, Matrix.det_fin_two, Matrix.adjugate_fin_two] <;> field_simp [hne, hdet] <;> ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathTargetTransposeInverse_formula · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:497
def baseReferenceFeature

For the supplied parameters, base Reference Feature is given by its defining clause.

Definition (Lean source)
t :
baseReferenceFeature t :
fun i u
=> if i.val = 0 then 1 else if t then (if u.val = 0 then 7 / 20 else 3 / 4) else if u.val = 0 then 3 / 10 else 7 / 10
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.baseReferenceFeature · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:517
def pathJointProxyMoment

For the supplied parameters, path Joint Proxy Moment is given by its defining clause.

Definition (Lean source)
t :
pathJointProxyMoment t :
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathJointProxyMoment · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:523
def pathReferenceFeature

For the supplied parameters, path Reference Feature is given by its defining clause.

Definition (Lean source)
t :
h :
pathReferenceFeature t h :
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathReferenceFeature · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:527
theorem pathReferenceFeature_second_formula Lemma pathReferenceFeature_second_formula in the paper ↗

Path reference feature second formula: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
t :
h :
u :
Fin 2
hh :
|h| ≤ 1 / 100
= if t then (if u.val = 0 then (225 * h + 28) / (20 * (15 * h + 4)) else 3 / 4) else (if u.val = 0 then (35 * h + 9) / (10 * (5 * h + 3)) else 7 / 10)
Proof (Lean source)
lemma pathReferenceFeature_second_formula (t : Bool) (h : ℝ) (u : Fin 2) (hh : |h| ≤ 1 / 100) : pathReferenceFeature t h 1 u = if t then (if u.val = 0 then (225 * h + 28) / (20 * (15 * h + 4)) else 3 / 4) else (if u.val = 0 then (35 * h + 9) / (10 * (5 * h + 3)) else 7 / 10) := by have hne : 3 - h * 5 ≠ 0 := by intro heq have : h = 3 / 5 := by linarith rw [this] at hh norm_num at hh have h4 : 15 * h + 4 ≠ 0 := by intro heq have : h = -4 / 15 := by linarith rw [this] at hh norm_num at hh have h4' : 4 + h * 15 ≠ 0 := by nlinarith [abs_le.mp hh |>.1, abs_le.mp hh |>.2] have h3 : 5 * h + 3 ≠ 0 := by intro heq have : h = -3 / 5 := by linarith rw [this] at hh norm_num at hh have hbounds := abs_le.mp hh have huniv : (Finset.univ : Finset (Fin 2)) = {0, 1} := by decide change (pathJointProxyMoment t * ((pathTargetFeature h).transpose)⁻¹ * (diagonal (pathArmWeights t h))⁻¹) (1 : Fin 2) u = _ rw [pathTargetTransposeInverse_formula h hh] have hweights : pathArmWeights t h = fun u => if t then (if u.val = 0 then 4 / 25 + 3 * h / 5 else 9 / 25 - 3 * h / 5) else (if u.val = 0 then 6 / 25 + 2 * h / 5 else 6 / 25 - 2 * h / 5) := funext fun u => pathArmWeights_formula t h u hh have hweights0 : pathArmWeights t 0 = fun u => if t then (if u.val = 0 then 4 / 25 else 9 / 25) else (if u.val = 0 then 6 / 25 else 6 / 25) := by funext u simpa using pathArmWeights_formula t 0 u (by norm_num : |(0 : ℝ)| ≤ 1 / 100) have hunit : IsUnit (fun u : Fin 2 => if t then (if u.val = 0 then 4 / 25 + 3 * h / 5 else 9 / 25 - 3 * h / 5) else (if u.val = 0 then 6 / 25 + 2 * h / 5 else 6 / 25 - 2 * h / 5)) := by rw [Pi.isUnit_iff] intro u rw [isUnit_iff_ne_zero] fin_cases u <;> cases t <;> simp <;> nlinarith [hbounds.1, hbounds.2] have h30p : 30 + h * 50 ≠ 0 := by nlinarith [hbounds.1, hbounds.2] have h20p : 20 + h * 75 ≠ 0 := by nlinarith [hbounds.1, hbounds.2] have h30m : 30 - h * 50 ≠ 0 := by nlinarith [hbounds.1, hbounds.2] have h45m : 45 - h * 75 ≠ 0 := by nlinarith [hbounds.1, hbounds.2] have hw0f : 6 * 5 + 25 * h * 2 ≠ 0 := by nlinarith [hbounds.1, hbounds.2] have hw0t : 4 * 5 + 25 * 3 * h ≠ 0 := by nlinarith [hbounds.1, hbounds.2] have hw1f : 6 * 5 - 25 * h * 2 ≠ 0 := by nlinarith [hbounds.1, hbounds.2] have hw1t : 9 * 5 - 25 * 3 * h ≠ 0 := by nlinarith [hbounds.1, hbounds.2] rw [hweights] unfold pathJointProxyMoment rw [hweights0] rw [Matrix.inv_diagonal] fin_cases u <;> cases t <;> simp_all [baseReferenceFeature, pathTargetFeature, Matrix.mul_apply, Ring.inverse] <;> field_simp [h4, h4', h3, h30p, h20p, h30m, h45m, hw0f, hw0t, hw1f, hw1t] <;> norm_num <;> try field_simp [h4'] <;> ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathReferenceFeature_second_formula · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:533
def pathPoint

For the supplied parameters, path Point is given by its defining clause.

Definition (Lean source)
u :
Fin 2
t x z y0 y1 :
pathPoint u t x z y0 y1 :
FullData 2 2 2
witnessPoint u t x z y0 y1
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathPoint · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:593
def pathWeight

For the supplied parameters, path Weight is given by its defining clause.

Definition (Lean source)
g h :
u :
Fin 2
t x z y0 y1 :
pathWeight g h u t x z y0 y1 :
pu :
if u.val = 0 then 2 / 5 + h else 3 / 5 - h
pt :
px :
pz :
py0 :
1 / 4
py1 :
if u.val = 0 then 1 / 2 - g / 2 else 1 / 2 + g / 2
pu * bernoulliMass pt t * bernoulliMass px x * bernoulliMass pz z * bernoulliMass py0 y0 * bernoulliMass py1 y1
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathWeight · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:597

Exact domain of the generic tangent amplitude used by the labelled path. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
h :
TangentAmplitudeDomain h :
Prop
h ∈ Icc (-1 : ℝ) 1
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.TangentAmplitudeDomain · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:608

The factorization-preserving Bernoulli path of equations (68)--(72). Every theorem and certificate using its second argument carries TangentAmplitudeDomain. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
g h :
pathLaw g h :
∑ u : Fin 2, ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, ofReal (pathWeight g h u t x z y0 y1) • Measure.dirac (pathPoint u t x z y0 y1)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathLaw · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:612
theorem pathLaw_isProbabilityMeasure

Path law is probability measure: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg0 :
0 ≤ g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
Proof (Lean source)
lemma pathLaw_isProbabilityMeasure (g h : ℝ) (hg0 : 0 ≤ g) (hg1 : g ≤ 1 / 4) (hDomain : TangentAmplitudeDomain h) (hh : |h| ≤ 1 / 100) : IsProbabilityMeasure (pathLaw g h) := by have hbounds := abs_le.mp hh have hpu : ∀ u : Fin 2, 0 ≤ (if u.val = 0 then 2 / 5 + h else 3 / 5 - h : ℝ) ∧ (if u.val = 0 then 2 / 5 + h else 3 / 5 - h : ℝ) ≤ 1 := by intro u fin_cases u <;> simp <;> constructor <;> nlinarith [hbounds.1, hbounds.2] have hpt : ∀ u : Fin 2, 0 ≤ pathArmWeights true h u / (if u.val = 0 then 2 / 5 + h else 3 / 5 - h) ∧ pathArmWeights true h u / (if u.val = 0 then 2 / 5 + h else 3 / 5 - h) ≤ 1 := by intro u rw [pathArmWeights_formula true h u hh] fin_cases u <;> simp all_goals constructor all_goals first | apply div_nonneg <;> nlinarith [hbounds.1, hbounds.2] | rw [div_le_one] <;> nlinarith [hbounds.1, hbounds.2] have hpx : ∀ u : Fin 2, 0 ≤ pathTargetFeature h 1 u ∧ pathTargetFeature h 1 u ≤ 1 := by intro u fin_cases u · norm_num [pathTargetFeature] · simp [pathTargetFeature] constructor · apply div_nonneg <;> nlinarith [hbounds.1, hbounds.2] · rw [div_le_one] <;> nlinarith [hbounds.1, hbounds.2] have hpz : ∀ (t : Bool) (u : Fin 2), 0 ≤ pathReferenceFeature t h 1 u ∧ pathReferenceFeature t h 1 u ≤ 1 := by intro t u rw [pathReferenceFeature_second_formula t h u hh] fin_cases u <;> cases t <;> simp all_goals constructor all_goals first | apply div_nonneg <;> nlinarith [hbounds.1, hbounds.2] | rw [div_le_one] <;> nlinarith [hbounds.1, hbounds.2] have hpy1 : ∀ u : Fin 2, 0 ≤ (if u.val = 0 then 1 / 2 - g / 2 else 1 / 2 + g / 2 : ℝ) ∧ (if u.val = 0 then 1 / 2 - g / 2 else 1 / 2 + g / 2 : ℝ) ≤ 1 := by intro u fin_cases u <;> simp <;> constructor <;> nlinarith have hw : ∀ (u : Fin 2) (t x z y0 y1 : Bool), 0 ≤ pathWeight g h u t x z y0 y1 := by intro u t x z y0 y1 unfold pathWeight exact mul_nonneg (mul_nonneg (mul_nonneg (mul_nonneg (mul_nonneg (hpu u).1 (bernoulliMass_nonneg _ t (hpt u).1 (hpt u).2)) (bernoulliMass_nonneg _ x (hpx u).1 (hpx u).2)) (bernoulliMass_nonneg _ z (hpz t u).1 (hpz t u).2)) (bernoulliMass_nonneg (1 / 4) y0 (by norm_num) (by norm_num))) (bernoulliMass_nonneg _ y1 (hpy1 u).1 (hpy1 u).2) constructor rw [show (pathLaw g h) univ = ∑ u : Fin 2, ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, ofReal (pathWeight g h u t x z y0 y1) by simp [pathLaw]] calc _ = ofReal (∑ u : Fin 2, ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, pathWeight g h u t x z y0 y1) := by symm rw [ENNReal.ofReal_sum_of_nonneg] · apply Finset.sum_congr rfl intro u _ rw [ENNReal.ofReal_sum_of_nonneg] · apply Finset.sum_congr rfl intro t _ rw [ENNReal.ofReal_sum_of_nonneg] · apply Finset.sum_congr rfl intro x _ rw [ENNReal.ofReal_sum_of_nonneg] · apply Finset.sum_congr rfl intro z _ rw [ENNReal.ofReal_sum_of_nonneg] · apply Finset.sum_congr rfl intro y0 _ rw [ENNReal.ofReal_sum_of_nonneg] exact fun y1 _ => hw u t x z y0 y1 · exact fun y0 _ => sum_nonneg fun y1 _ => hw u t x z y0 y1 · exact fun z _ => sum_nonneg fun y0 _ => sum_nonneg fun y1 _ => hw u t x z y0 y1 · exact fun x _ => sum_nonneg fun z _ => sum_nonneg fun y0 _ => sum_nonneg fun y1 _ => hw u t x z y0 y1 · exact fun t _ => sum_nonneg fun x _ => sum_nonneg fun z _ => sum_nonneg fun y0 _ => sum_nonneg fun y1 _ => hw u t x z y0 y1 · exact fun u _ => sum_nonneg fun t _ => sum_nonneg fun x _ => sum_nonneg fun z _ => sum_nonneg fun y0 _ => sum_nonneg fun y1 _ => hw u t x z y0 y1 _ = 1 := by simp only [pathWeight, sum_mul_bernoulliMass] rw [Fin.sum_univ_two] simp ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.pathLaw_isProbabilityMeasure · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:619
structure FactorizationPathHandle

A labelled-path certificate for the explicit rational Bernoulli factorization used by the converse. The first four equalities tie every supplied path component to pathLaw and its proxy and weight primitives, so the remaining factorization, displacement, and score fields cannot be realized by an unrelated family of full-data laws. The coordinatewise derivative clause records the score-cancellation equations for Aₜ(h) diag(wₜ(h)) B(h)ᵀ.

Definition (Lean source)
path :
ℝ → ℝ → Measure (FullData 2 2 2)
referenceFeaturePath :
Bool → ℝ → RectMatrix 2 2
targetFeaturePath :
ℝ → RectMatrix 2 2
armWeightsPath :
Bool → ℝ → Fin 2 → ℝ
path_eq_explicit :
∀ g h, path g h = pathLaw g h
referenceFeaturePath_eq_explicit :
∀ t h, referenceFeaturePath t h = pathReferenceFeature t h
targetFeaturePath_eq_explicit :
∀ h, targetFeaturePath h = pathTargetFeature h
armWeightsPath_eq_explicit :
∀ t h, armWeightsPath t h = pathArmWeights t h
basePath :
∀ g
if
0 ≤ g
and
g ≤ 1 / 4
then
path g 0 = witnessLaw (g / 2)
pathFactorization :
∀ g h
and
0 ≤ g
and
g ≤ 1 / 4
and
|h| ≤ 1 / 100
then
∃ hP : IsProbabilityMeasure (path g h),
letI := hP ReferenceProxySeparation (path g h) ∧
TargetProxySeparation (path g h) ∧
∀ t : Bool,
= referenceFeaturePath t h * diagonal (armWeightsPath t h) * (targetFeaturePath h).transpose
proxyMomentPreserved :
∀ t g h
and
0 ≤ g
and
g ≤ 1 / 4
and
|h| ≤ 1 / 100
then
referenceFeaturePath t h * diagonal (armWeightsPath t h) * (targetFeaturePath h).transpose
= referenceFeaturePath t 0 * diagonal (armWeightsPath t 0) * (targetFeaturePath 0).transpose
proxyMomentDerivativeCancellation :
∀ t i j,
deriv (fun h => (referenceFeaturePath t h * diagonal (armWeightsPath t h) * (targetFeaturePath h).transpose) i j) 0
= 0
observedScore :
ℝ → ℝ → Obs 2 2 → ℝ
observedScore_eq :
∀ g h o,
observedScore g h o
= (path g h).real (obsMap ⁻¹' ({o} : Set (Obs 2 2)))
- (path g 0).real (obsMap ⁻¹' ({o} : Set (Obs 2 2)))
observedScore_order :
∃ Cscore : ℝ
if
0 < Cscore ∧ ∀ g h o, TangentAmplitudeDomain h
and
|h| ≤ 1 / 100
then
|observedScore g h o| ≤ Cscore * |g * h|
weightDisplacement :
∀ g h
and
0 ≤ g
and
g ≤ 1 / 4
and
|h| ≤ 1 / 100
then
∃ hP : IsProbabilityMeasure (path g h),
letI := hP latentMass (path g h) 0 = 2 / 5 + h ∧ latentMass (path g h) 1 = 3 / 5 - h
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.FactorizationPathHandle · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:718
def repairHandle

The open constructive object requested by the note. It does not assert existence of a repair algorithm or prove a headline theorem: an inhabitant must supply both the empirical contour/moment certificate tied to P and sample, and the separate factorization-preserving labelled path certificate. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
k dx dz n :
L pi0 sigma0 :
hModel :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
data :
basis :
hBasis :
basis.SpansSignal (obsSummary P)
repairHandle P hModel data basis hBasis :
Type
RepairHandle k dx dz n L pi0 sigma0 P hModel data basis hBasis × FactorizationPathHandle
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.repairHandle · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:768
def calibratedDisplacement Definition 58 in the paper ↗

Calibrated positive path displacement. @realizes h(n,g)h(n,g)(a min(1,(sqrt n g)^-1)) For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
a :
n :
g :
calibratedDisplacement a n g :
a * min 1 (sqrt n * g)⁻¹
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.calibratedDisplacement · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:780
theorem calibratedDisplacement_mem

Calibrated displacement mem: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
a :
n :
g :
ha :
0 < a
haMax :
a ≤ 1 / 8
hn :
0 < n
hg :
0 < g
conclusion 1
conclusion 2
Proof (Lean source)
lemma calibratedDisplacement_mem (a : ℝ) (n : ℕ) (g : ℝ) (ha : 0 < a) (haMax : a ≤ 1 / 8) (hn : 0 < n) (hg : 0 < g) : 0 < calibratedDisplacement a n g ∧ calibratedDisplacement a n g ≤ a := by unfold calibratedDisplacement constructor · positivity · have hmin : min 1 (sqrt ↑n * g)⁻¹ ≤ 1 := min_le_left _ _ nlinarith [mul_le_mul_of_nonneg_left hmin (le_of_lt ha)]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.calibratedDisplacement_mem · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:784

Range of the universal local-experiment radius. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
cLoc :
LocalRadiusDomain cLoc :
Prop
clause 1
0 < cLoc
clause 2
cLoc < 1
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.LocalRadiusDomain · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/Witness.lean:795
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.WitnessFactorization 7 declarations Conditional-independence verification for the explicit finite witness.

Conditional-independence verification for the explicit finite witness.

theorem witness_sum_restrict_latentCell

Witness sum restrict latent cell: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
u :
Fin 2
t :
F :
FullData 2 2 2 → ℝ
(∑ v : Fin 2, ∑ s : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps v s x z y0 y1 * @ite ℝ (witnessPoint v s x z y0 y1 ∈ latentCell u t) (dA (witnessPoint v s x z y0 y1)) (F (witnessPoint v s x z y0 y1)) 0)
= ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps u t x z y0 y1 * F (witnessPoint u t x z y0 y1)
Proof (Lean source)
lemma witness_sum_restrict_latentCell (eps : ℝ) (u : Fin 2) (t : Bool) [dA : DecidablePred (· ∈ latentCell u t)] (F : FullData 2 2 2 → ℝ) : (∑ v : Fin 2, ∑ s : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps v s x z y0 y1 * @ite ℝ (witnessPoint v s x z y0 y1 ∈ latentCell u t) (dA (witnessPoint v s x z y0 y1)) (F (witnessPoint v s x z y0 y1)) 0) = ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps u t x z y0 y1 * F (witnessPoint u t x z y0 y1) := by classical rw [Finset.sum_eq_single u] · rw [Finset.sum_eq_single t] · have hin (x z y0 y1 : Bool) : witnessPoint u t x z y0 y1 ∈ latentCell u t := by simp [latentCell, witnessPoint] simp_rw [if_pos (hin _ _ _ _)] · intro s _ hst have hout (x z y0 y1 : Bool) : witnessPoint u s x z y0 y1 ∉ latentCell u t := by simp [latentCell, witnessPoint, hst] simp_rw [if_neg (hout _ _ _ _)] simp · simp · intro v _ hvu have hout (s x z y0 y1 : Bool) : witnessPoint v s x z y0 y1 ∉ latentCell u t := by simp [latentCell, witnessPoint, hvu] simp_rw [if_neg (hout _ _ _ _ _)] simp · simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witness_sum_restrict_latentCell · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessFactorization.lean:13
theorem conditionalMean_witness_latentCell

Conditional mean witness latent cell: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
hlo :
0 ≤ eps
hhi :
eps ≤ 1 / 8
u :
Fin 2
t :
F :
FullData 2 2 2 → ℝ
conditionalMean (witnessLaw eps) (latentCell u t) F
= (∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps u t x z y0 y1)⁻¹ * (∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps u t x z y0 y1 * F (witnessPoint u t x z y0 y1))
Proof (Lean source)
lemma conditionalMean_witness_latentCell (eps : ℝ) (hlo : 0 ≤ eps) (hhi : eps ≤ 1 / 8) (u : Fin 2) (t : Bool) (F : FullData 2 2 2 → ℝ) : conditionalMean (witnessLaw eps) (latentCell u t) F = (∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps u t x z y0 y1)⁻¹ * (∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps u t x z y0 y1 * F (witnessPoint u t x z y0 y1)) := by classical rw [conditionalMean_witnessLaw eps _ (measurableSet_witness_latentCell u t)] simp_rw [ENNReal.toReal_ofReal (witnessWeight_nonneg eps hlo hhi _ _ _ _ _ _)] rw [witness_sum_restrict_latentCell eps u t (fun _ => (1 : ℝ)), witness_sum_restrict_latentCell] simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.conditionalMean_witness_latentCell · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessFactorization.lean:43
theorem witness_sum_restrict_latentClass

Witness sum restrict latent class: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
u :
F :
FullData 2 2 2 → ℝ
(∑ v : Fin 2, ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps v t x z y0 y1 * @ite ℝ (witnessPoint v t x z y0 y1 ∈ latentClass u) (dA (witnessPoint v t x z y0 y1)) (F (witnessPoint v t x z y0 y1)) 0)
= ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps u t x z y0 y1 * F (witnessPoint u t x z y0 y1)
Proof (Lean source)
lemma witness_sum_restrict_latentClass (eps : ℝ) (u : Fin 2) [dA : DecidablePred (· ∈ latentClass u)] (F : FullData 2 2 2 → ℝ) : (∑ v : Fin 2, ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps v t x z y0 y1 * @ite ℝ (witnessPoint v t x z y0 y1 ∈ latentClass u) (dA (witnessPoint v t x z y0 y1)) (F (witnessPoint v t x z y0 y1)) 0) = ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps u t x z y0 y1 * F (witnessPoint u t x z y0 y1) := by classical rw [Finset.sum_eq_single u] · have hin (t x z y0 y1 : Bool) : witnessPoint u t x z y0 y1 ∈ latentClass u := by simp [latentClass, witnessPoint] simp_rw [if_pos (hin _ _ _ _ _)] · intro v _ hvu have hout (t x z y0 y1 : Bool) : witnessPoint v t x z y0 y1 ∉ latentClass u := by simp [latentClass, witnessPoint, hvu] simp_rw [if_neg (hout _ _ _ _ _)] simp · simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witness_sum_restrict_latentClass · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessFactorization.lean:59
theorem conditionalMean_witness_latentClass

Conditional mean witness latent class: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
hlo :
0 ≤ eps
hhi :
eps ≤ 1 / 8
u :
Fin 2
F :
FullData 2 2 2 → ℝ
conditionalMean (witnessLaw eps) (latentClass u) F
= (∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps u t x z y0 y1)⁻¹ * (∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps u t x z y0 y1 * F (witnessPoint u t x z y0 y1))
Proof (Lean source)
lemma conditionalMean_witness_latentClass (eps : ℝ) (hlo : 0 ≤ eps) (hhi : eps ≤ 1 / 8) (u : Fin 2) (F : FullData 2 2 2 → ℝ) : conditionalMean (witnessLaw eps) (latentClass u) F = (∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps u t x z y0 y1)⁻¹ * (∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps u t x z y0 y1 * F (witnessPoint u t x z y0 y1)) := by classical rw [conditionalMean_witnessLaw eps _ (measurableSet_witness_latentClass u)] simp_rw [ENNReal.toReal_ofReal (witnessWeight_nonneg eps hlo hhi _ _ _ _ _ _)] rw [witness_sum_restrict_latentClass eps u (fun _ => (1 : ℝ)), witness_sum_restrict_latentClass] simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.conditionalMean_witness_latentClass · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessFactorization.lean:82
theorem witness_referenceProxySeparation

Witness reference proxy separation: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
hlo :
0 ≤ eps
hhi :
eps ≤ 1 / 8
Proof (Lean source)
lemma witness_referenceProxySeparation (eps : ℝ) (hlo : 0 ≤ eps) (hhi : eps ≤ 1 / 8) : ReferenceProxySeparation (witnessLaw eps) := by intro u t f q _hf _hq _hfb _hqb rw [conditionalMean_witness_latentCell eps hlo hhi, conditionalMean_witness_latentCell eps hlo hhi, conditionalMean_witness_latentCell eps hlo hhi] fin_cases u <;> cases t <;> simp (config := { maxSteps := 1000000 }) [witnessWeight, witnessPoint, boolReal, bernoulliMass] <;> ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witness_referenceProxySeparation · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessFactorization.lean:98
theorem witness_targetProxySeparation

Witness target proxy separation: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
hlo :
0 ≤ eps
hhi :
eps ≤ 1 / 8
Proof (Lean source)
lemma witness_targetProxySeparation (eps : ℝ) (hlo : 0 ≤ eps) (hhi : eps ≤ 1 / 8) : TargetProxySeparation (witnessLaw eps) := by intro u f q _hf _hq _hfb _hqb rw [conditionalMean_witness_latentClass eps hlo hhi, conditionalMean_witness_latentClass eps hlo hhi, conditionalMean_witness_latentClass eps hlo hhi] fin_cases u <;> simp (config := { maxSteps := 1000000 }) [witnessWeight, witnessPoint, boolReal, bernoulliMass] <;> ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witness_targetProxySeparation · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessFactorization.lean:110
theorem witness_armwiseLatentIgnorability

Witness armwise latent ignorability: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
hlo :
0 ≤ eps
hhi :
eps ≤ 1 / 8
Proof (Lean source)
lemma witness_armwiseLatentIgnorability (eps : ℝ) (hlo : 0 ≤ eps) (hhi : eps ≤ 1 / 8) : ArmwiseLatentIgnorability (witnessLaw eps) := by intro u t f q _hf _hq _hfb _hqb rw [conditionalMean_witness_latentClass eps hlo hhi, conditionalMean_witness_latentClass eps hlo hhi, conditionalMean_witness_latentClass eps hlo hhi] fin_cases u <;> cases t <;> simp (config := { maxSteps := 1000000 }) [witnessWeight, witnessPoint, potential, boolReal, bernoulliMass] <;> ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witness_armwiseLatentIgnorability · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessFactorization.lean:122
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.WitnessKL 14 declarations Finite-cell KL and quotient-law separation certificates for the collision witness.

Finite-cell KL and quotient-law separation certificates for the collision witness.

instance atomicLaw_borelSpace

The coordinate measurable structure on labelled atomic laws is their Borel structure. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
-- @node: atomicLaw_borelSpace instance atomicLaw_borelSpace (k : ℕ) (radius : ℝ) : BorelSpace (AtomicLaw k radius) where measurable_eq := by change comap (fun ν : AtomicLaw k radius => (ν.weight, ν.atom)) _ = _ calc comap (fun ν : AtomicLaw k radius => (ν.weight, ν.atom)) (inferInstance : MeasurableSpace ((Fin k → ℝ) × (Fin k → ℝ))) = comap (fun ν : AtomicLaw k radius => (ν.weight, ν.atom)) (borel ((Fin k → ℝ) × (Fin k → ℝ))) := by exact congrArg (comap (fun ν : AtomicLaw k radius => (ν.weight, ν.atom))) (@BorelSpace.measurable_eq ((Fin k → ℝ) × (Fin k → ℝ)) inferInstance inferInstance inferInstance) _ = borel (AtomicLaw k radius) := borel_comap.symm
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.atomicLaw_borelSpace · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessKL.lean:11
instance lawModulo_opensMeasurableSpace Definition lawModulo_opensMeasurableSpace in the paper ↗

The quotient law's mapped measurable structure contains all open sets of its installed Wasserstein topology. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
-- @node: lawModulo_opensMeasurableSpace instance lawModulo_opensMeasurableSpace (k : ℕ) (radius : ℝ) : OpensMeasurableSpace (AtomicLaw.LawModulo k radius) where borel_le := by apply MeasurableSpace.generateFrom_le intro U hU change MeasurableSet (AtomicLaw.LawModulo.ofProbabilityLaw ⁻¹' U) change IsOpen (AtomicLaw.LawModulo.ofProbabilityLaw ⁻¹' U) at hU exact hU.measurableSet
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.lawModulo_opensMeasurableSpace · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessKL.lean:28
def witnessVisibleLaw

The collision witness represented on the finite visible Bernoulli carrier. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
eps :
witnessVisibleLaw eps :
pathVisibleLaw (2 * eps) 0
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witnessVisibleLaw · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessKL.lean:40

Mapping the finite collision-witness carrier recovers its observed margin. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
heps0 :
0 ≤ eps
heps1 :
eps ≤ 1 / 8
letI
Proof (Lean source)
-- @node: witnessVisibleLaw_map lemma witnessVisibleLaw_map (eps : ℝ) (heps0 : 0 ≤ eps) (heps1 : eps ≤ 1 / 8) : letI := witnessLaw_isProbabilityMeasure eps heps0 heps1 (witnessVisibleLaw eps).map (fun v => pathObsPoint v.1 v.2.1 v.2.2.1 v.2.2.2) = obsLaw (witnessLaw eps) := by letI := witnessLaw_isProbabilityMeasure eps heps0 heps1 unfold witnessVisibleLaw have hmap := pathVisibleLaw_map (2 * eps) 0 (by positivity) (by linarith) (by norm_num) unfold obsLaw at hmap ⊢ simpa [pathLaw_zero] using hmap
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witnessVisibleLaw_map · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessKL.lean:45
theorem witnessVisibleLaw_isProbabilityMeasure

The finite visible collision-witness law has total mass one. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
heps0 :
0 ≤ eps
heps1 :
eps ≤ 1 / 8
Proof (Lean source)
-- @node: witnessVisibleLaw_isProbabilityMeasure lemma witnessVisibleLaw_isProbabilityMeasure (eps : ℝ) (heps0 : 0 ≤ eps) (heps1 : eps ≤ 1 / 8) : IsProbabilityMeasure (witnessVisibleLaw eps) := by unfold witnessVisibleLaw exact pathVisibleLaw_isProbabilityMeasure (2 * eps) 0 (by positivity) (by linarith) (by norm_num)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witnessVisibleLaw_isProbabilityMeasure · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessKL.lean:58
theorem witnessVisibleLaw_singleton_diff_bound

Each visible cell changes by at most the collision amplitude. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
heps0 :
0 ≤ eps
heps1 :
eps ≤ 1 / 8
|(witnessVisibleLaw eps).real {v} - (witnessVisibleLaw 0).real {v}| ≤ eps
Proof (Lean source)
-- @node: witnessVisibleLaw_singleton_diff_bound lemma witnessVisibleLaw_singleton_diff_bound (eps : ℝ) (heps0 : 0 ≤ eps) (heps1 : eps ≤ 1 / 8) (v : PathVisibleCell) : |(witnessVisibleLaw eps).real {v} - (witnessVisibleLaw 0).real {v}| ≤ eps := by unfold witnessVisibleLaw simp only [mul_zero] rw [pathVisibleLaw_singleton (2 * eps) 0 (by positivity) (by linarith) (by norm_num), pathVisibleLaw_singleton 0 0 (by norm_num) (by norm_num) (by norm_num)] rcases v with ⟨t, x, z, y⟩ cases t <;> cases x <;> cases z <;> cases y all_goals simp only [pathVisibleMass] simp_rw [pathWeight_zero (2 * eps), pathWeight_zero 0] norm_num [witnessWeight, bernoulliMass, div_eq_mul_inv] apply (abs_le).2 constructor <;> nlinarith
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witnessVisibleLaw_singleton_diff_bound · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessKL.lean:68
theorem witnessVisibleLaw_base_floor

Every base collision-witness visible cell has a uniform positive mass. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
1 / 1000 ≤ (witnessVisibleLaw 0).real {v}
Proof (Lean source)
-- @node: witnessVisibleLaw_base_floor lemma witnessVisibleLaw_base_floor (v : PathVisibleCell) : 1 / 1000 ≤ (witnessVisibleLaw 0).real {v} := by unfold witnessVisibleLaw simp only [mul_zero] exact pathVisibleLaw_base_floor 0 (by norm_num) (by norm_num) v
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witnessVisibleLaw_base_floor · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessKL.lean:86
theorem witnessVisibleLaw_absolutelyContinuous

Every collision-witness visible law is absolutely continuous with respect to the base law. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
Proof (Lean source)
-- @node: witnessVisibleLaw_absolutelyContinuous lemma witnessVisibleLaw_absolutelyContinuous (eps : ℝ) : witnessVisibleLaw eps ≪ witnessVisibleLaw 0 := by intro A hzero by_cases hA : A.Nonempty · obtain ⟨v, hv⟩ := hA have hmono : witnessVisibleLaw 0 {v} ≤ witnessVisibleLaw 0 A := measure_mono (singleton_subset_iff.mpr hv) have hposReal : 0 < (witnessVisibleLaw 0).real {v} := lt_of_lt_of_le (by norm_num) (witnessVisibleLaw_base_floor v) have hpos : witnessVisibleLaw 0 {v} ≠ 0 := by intro hz rw [Measure.real_def, hz, ENNReal.toReal_zero] at hposReal exact lt_irrefl 0 hposReal exact elim (hpos (nonpos_iff_eq_zero.mp (hzero ▸ hmono))) · rw [not_nonempty_iff_eq_empty.mp hA] simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witnessVisibleLaw_absolutelyContinuous · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessKL.lean:94
theorem witnessObsLaw_absolutelyContinuous Lemma witnessObsLaw_absolutelyContinuous in the paper ↗

The observed collision-witness law is absolutely continuous with respect to the base law. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
heps0 :
0 ≤ eps
heps1 :
eps ≤ 1 / 8
letI
Proof (Lean source)
-- @node: witnessObsLaw_absolutelyContinuous lemma witnessObsLaw_absolutelyContinuous (eps : ℝ) (heps0 : 0 ≤ eps) (heps1 : eps ≤ 1 / 8) : letI := witnessLaw_isProbabilityMeasure eps heps0 heps1 letI := witnessLaw_isProbabilityMeasure 0 (by norm_num) (by norm_num) obsLaw (witnessLaw eps) ≪ obsLaw (witnessLaw 0) := by letI := witnessLaw_isProbabilityMeasure eps heps0 heps1 letI := witnessLaw_isProbabilityMeasure 0 (by norm_num) (by norm_num) let f := fun v : PathVisibleCell => pathObsPoint v.1 v.2.1 v.2.2.1 v.2.2.2 rw [← witnessVisibleLaw_map eps heps0 heps1, ← witnessVisibleLaw_map 0 (by norm_num) (by norm_num)] exact (witnessVisibleLaw_absolutelyContinuous eps).map (measurable_of_finite f)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witnessObsLaw_absolutelyContinuous · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessKL.lean:113
theorem witnessObsLaw_llr_integrable Lemma witnessObsLaw_llr_integrable in the paper ↗

The collision-witness observed log likelihood ratio is integrable. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
heps0 :
0 ≤ eps
heps1 :
eps ≤ 1 / 8
letI
Proof (Lean source)
-- @node: witnessObsLaw_llr_integrable lemma witnessObsLaw_llr_integrable (eps : ℝ) (heps0 : 0 ≤ eps) (heps1 : eps ≤ 1 / 8) : letI := witnessLaw_isProbabilityMeasure eps heps0 heps1 letI := witnessLaw_isProbabilityMeasure 0 (by norm_num) (by norm_num) Integrable (llr (obsLaw (witnessLaw eps)) (obsLaw (witnessLaw 0))) (obsLaw (witnessLaw eps)) := by letI := witnessLaw_isProbabilityMeasure eps heps0 heps1 letI := witnessLaw_isProbabilityMeasure 0 (by norm_num) (by norm_num) letI := witnessVisibleLaw_isProbabilityMeasure eps heps0 heps1 letI := witnessVisibleLaw_isProbabilityMeasure 0 (by norm_num) (by norm_num) let f := fun v : PathVisibleCell => pathObsPoint v.1 v.2.1 v.2.2.1 v.2.2.2 rw [← witnessVisibleLaw_map eps heps0 heps1, ← witnessVisibleLaw_map 0 (by norm_num) (by norm_num)] exact InformationTheory.integrable_llr_map (witnessVisibleLaw_absolutelyContinuous eps) (measurable_of_finite f) Integrable.of_finite
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witnessObsLaw_llr_integrable · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessKL.lean:127
theorem witnessVisibleLaw_chiSqDiv_bound

The finite visible collision-witness chi-square divergence is quadratic. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
heps0 :
0 ≤ eps
heps1 :
eps ≤ 1 / 8
chiSqDiv (witnessVisibleLaw eps) (witnessVisibleLaw 0) ≤ 16000 * eps ^ 2
Proof (Lean source)
-- @node: witnessVisibleLaw_chiSqDiv_bound lemma witnessVisibleLaw_chiSqDiv_bound (eps : ℝ) (heps0 : 0 ≤ eps) (heps1 : eps ≤ 1 / 8) : chiSqDiv (witnessVisibleLaw eps) (witnessVisibleLaw 0) ≤ 16000 * eps ^ 2 := by letI := witnessVisibleLaw_isProbabilityMeasure eps heps0 heps1 letI := witnessVisibleLaw_isProbabilityMeasure 0 (by norm_num) (by norm_num) have hac := witnessVisibleLaw_absolutelyContinuous eps have hformula := finite_one_add_chiSqDiv (witnessVisibleLaw eps) (witnessVisibleLaw 0) hac have hmass (mu : Measure PathVisibleCell) [IsProbabilityMeasure mu] : ∑ v, mu.real {v} = 1 := by simpa using (MeasureTheory.sum_measureReal_singleton (μ := mu) univ) have hidentity : chiSqDiv (witnessVisibleLaw eps) (witnessVisibleLaw 0) = ∑ v : PathVisibleCell, ((witnessVisibleLaw eps).real {v} - (witnessVisibleLaw 0).real {v}) ^ 2 / (witnessVisibleLaw 0).real {v} := by have hp := hmass (witnessVisibleLaw eps) have hq := hmass (witnessVisibleLaw 0) calc _ = (∑ v : PathVisibleCell, (witnessVisibleLaw eps).real {v} ^ 2 / (witnessVisibleLaw 0).real {v}) - 1 := by linarith [hformula] _ = (∑ v : PathVisibleCell, (witnessVisibleLaw eps).real {v} ^ 2 / (witnessVisibleLaw 0).real {v}) - 2 * (∑ v : PathVisibleCell, (witnessVisibleLaw eps).real {v}) + ∑ v : PathVisibleCell, (witnessVisibleLaw 0).real {v} := by rw [hp, hq] ring _ = ∑ v : PathVisibleCell, ((witnessVisibleLaw eps).real {v} - (witnessVisibleLaw 0).real {v}) ^ 2 / (witnessVisibleLaw 0).real {v} := by symm calc _ = ∑ v : PathVisibleCell, (((witnessVisibleLaw eps).real {v} ^ 2 / (witnessVisibleLaw 0).real {v} - 2 * (witnessVisibleLaw eps).real {v}) + (witnessVisibleLaw 0).real {v}) := by apply Finset.sum_congr rfl intro v _ have hqpos : 0 < (witnessVisibleLaw 0).real {v} := lt_of_lt_of_le (by norm_num) (witnessVisibleLaw_base_floor v) field_simp ring _ = _ := by rw [Finset.sum_add_distrib, Finset.sum_sub_distrib, ← Finset.mul_sum] rw [hidentity] calc _ ≤ ∑ _v : PathVisibleCell, 1000 * eps ^ 2 := by apply Finset.sum_le_sum intro v _ have hqfloor := witnessVisibleLaw_base_floor v have hdiff := witnessVisibleLaw_singleton_diff_bound eps heps0 heps1 v have hqpos : 0 < (witnessVisibleLaw 0).real {v} := lt_of_lt_of_le (by norm_num) hqfloor rw [div_le_iff₀ hqpos] have hsq := sq_le_sq₀ (abs_nonneg _) heps0 |>.2 hdiff rw [sq_abs] at hsq calc _ ≤ eps ^ 2 := hsq _ ≤ 1000 * eps ^ 2 * (witnessVisibleLaw 0).real {v} := by have hs : 1 ≤ 1000 * (witnessVisibleLaw 0).real {v} := by nlinarith have := mul_le_mul_of_nonneg_left hs (sq_nonneg eps) simpa [mul_assoc, mul_left_comm, mul_comm] using this _ = 16000 * eps ^ 2 := by norm_num [Fintype.card_prod] ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witnessVisibleLaw_chiSqDiv_bound · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessKL.lean:146
theorem witnessLaw_observed_kl_bound Lemma witnessLaw_observed_kl_bound in the paper ↗

The observed one-record KL divergence of the collision witness is quadratic. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
heps0 :
0 ≤ eps
heps1 :
eps ≤ 1 / 8
letI
Proof (Lean source)
-- @node: witnessLaw_observed_kl_bound lemma witnessLaw_observed_kl_bound (eps : ℝ) (heps0 : 0 ≤ eps) (heps1 : eps ≤ 1 / 8) : letI := witnessLaw_isProbabilityMeasure eps heps0 heps1 letI := witnessLaw_isProbabilityMeasure 0 (by norm_num) (by norm_num) klDiv (obsLaw (witnessLaw eps)) (obsLaw (witnessLaw 0)) ≤ ofReal (16000 * eps ^ 2) := by letI := witnessLaw_isProbabilityMeasure eps heps0 heps1 letI := witnessLaw_isProbabilityMeasure 0 (by norm_num) (by norm_num) letI := witnessVisibleLaw_isProbabilityMeasure eps heps0 heps1 letI := witnessVisibleLaw_isProbabilityMeasure 0 (by norm_num) (by norm_num) rw [← witnessVisibleLaw_map eps heps0 heps1, ← witnessVisibleLaw_map 0 (by norm_num) (by norm_num)] calc _ ≤ klDiv (witnessVisibleLaw eps) (witnessVisibleLaw 0) := InformationTheory.klDiv_map_le _ _ (measurable_of_finite _) _ ≤ ofReal (chiSqDiv (witnessVisibleLaw eps) (witnessVisibleLaw 0)) := klDiv_le_chiSqDiv _ _ (witnessVisibleLaw_absolutelyContinuous eps) _ ≤ ofReal (16000 * eps ^ 2) := ENNReal.ofReal_le_ofReal (witnessVisibleLaw_chiSqDiv_bound eps heps0 heps1)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witnessLaw_observed_kl_bound · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessKL.lean:216
theorem witness_localQuotientExperiment

A collision witness whose quadratic KL is within the local radius belongs to the quotient local experiment. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
n :
cLoc eps :
hcLoc :
heps0 :
0 ≤ eps
heps1 :
eps ≤ 1 / 8
hKL :
16000 * eps ^ 2 ≤ cLoc / n
letI
Proof (Lean source)
-- @node: witness_localQuotientExperiment lemma witness_localQuotientExperiment (n : ℕ) (cLoc eps : ℝ) (hcLoc : LocalRadiusDomain cLoc) (heps0 : 0 ≤ eps) (heps1 : eps ≤ 1 / 8) (hKL : 16000 * eps ^ 2 ≤ cLoc / n) : letI := witnessLaw_isProbabilityMeasure eps heps0 heps1 LocalQuotientExperiment (n := n) (L := 2) (pi0 := 1 / 10) (sigma0 := 1 / 10) (cLoc := cLoc) (witnessLaw eps) := by letI := witnessLaw_isProbabilityMeasure eps heps0 heps1 refine { toUCVMWModel := witness_ucvmwModel eps heps0 heps1 cLoc_pos := hcLoc.1 cLoc_lt_one := hcLoc.2 neighborhood := ?_ } unfold LocalQuotientNeighborhood exact (witnessLaw_observed_kl_bound eps heps0 heps1).trans (ENNReal.ofReal_le_ofReal hKL)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witness_localQuotientExperiment · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessKL.lean:238
theorem witness_quotientLaw_wass1 Lemma witness_quotientLaw_wass1 in the paper ↗

The collision witness quotient laws are separated by exactly the collision amplitude. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
heps0 :
0 ≤ eps
heps1 :
eps ≤ 1 / 8
letI
Proof (Lean source)
-- @node: witness_quotientLaw_wass1 lemma witness_quotientLaw_wass1 (eps : ℝ) (heps0 : 0 ≤ eps) (heps1 : eps ≤ 1 / 8) : letI := witnessLaw_isProbabilityMeasure eps heps0 heps1 letI := witnessLaw_isProbabilityMeasure 0 (by norm_num) (by norm_num) AtomicLaw.LawModulo.wass1 (quotientLaw (witnessLaw 0) (witness_ucvmwModel 0 (by norm_num) (by norm_num))) (quotientLaw (witnessLaw eps) (witness_ucvmwModel eps heps0 heps1)) = eps := by letI := witnessLaw_isProbabilityMeasure eps heps0 heps1 letI := witnessLaw_isProbabilityMeasure 0 (by norm_num) (by norm_num) rw [quotientLaw, quotientLaw, AtomicLaw.LawModulo.wass1_ofProbabilityLaw] obtain ⟨gamma, hgamma⟩ := AtomicLaw.wass1_optimal_plan (quotientLawRaw_valid (witnessLaw 0) (witness_ucvmwModel 0 (by norm_num) (by norm_num))) (quotientLawRaw_valid (witnessLaw eps) (witness_ucvmwModel eps heps0 heps1)) rw [← hgamma] unfold AtomicLaw.transportCost change (∑ i, ∑ j, gamma.mass i j * |latentEffect (witnessLaw 0) i - latentEffect (witnessLaw eps) j|) = eps have hcost : ∀ i j : Fin 2, |latentEffect (witnessLaw 0) i - latentEffect (witnessLaw eps) j| = eps := by intro i j rw [witness_latentEffect 0 (by norm_num) (by norm_num), witness_latentEffect eps heps0 heps1] fin_cases i <;> fin_cases j <;> norm_num [abs_of_nonneg heps0] simp_rw [hcost, ← Finset.sum_mul] change (∑ i, ∑ j, gamma.mass i j) * eps = eps have hsum : ∑ i, ∑ j, gamma.mass i j = 1 := by simp_rw [gamma.fst_marginal] exact (quotientLawRaw_valid (witnessLaw 0) (witness_ucvmwModel 0 (by norm_num) (by norm_num))).2.1 rw [hsum, one_mul]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witness_quotientLaw_wass1 · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessKL.lean:256
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.WitnessSpectral 4 declarations A two-dimensional variational certificate for the explicit witness proxy matrices.

A two-dimensional variational certificate for the explicit witness proxy matrices.

theorem signalMinSingular_lower_fin_two

A coordinatewise quadratic lower bound certifies the last singular value of a real two-by-two matrix. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
A :
s :
hs :
0 < s
hquad :
∀ x : Fin 2 → ℝ, s ^ 2 * (∑ j, x j ^ 2) ≤ ∑ i, (∑ j, A i j * x j) ^ 2
Proof (Lean source)
-- @node: signalMinSingular_lower_fin_two lemma signalMinSingular_lower_fin_two (A : RectMatrix 2 2) (s : ℝ) (hs : 0 < s) (hquad : ∀ x : Fin 2 → ℝ, s ^ 2 * (∑ j, x j ^ 2) ≤ ∑ i, (∑ j, A i j * x j) ^ 2) : s ≤ signalMinSingular A := by let S := singularSystem A let r : Fin 2 := 1 let v : Fin 2 → ℝ := S.right r have hv : ∑ j, S.right r j ^ 2 = 1 := by simpa [pow_two] using S.right_orthonormal r r have hsigma : 0 < S.sigma r := by by_contra hn have hz : S.sigma r = 0 := le_antisymm (le_of_not_gt hn) (S.sigma_nonneg r) have h := hquad v dsimp [v] at h simp_rw [S.apply_right] at h rw [hv] at h simp [hz] at h nlinarith have hleft : ∑ i, S.left r i ^ 2 = 1 := by simpa [pow_two] using S.left_orthonormal_of_pos r r hsigma hsigma have h := hquad v dsimp [v] at h simp_rw [S.apply_right] at h rw [hv] at h simp only [mul_pow] at h rw [← Finset.mul_sum, hleft, mul_one, mul_one] at h have hle : s ≤ S.sigma r := (sq_le_sq₀ hs.le hsigma.le).mp h rw [S.sigma_eq r] at hle simpa [signalMinSingular, singularValue, r] using hle
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.signalMinSingular_lower_fin_two · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessSpectral.lean:9
theorem witnessTargetMatrix_signalMinSingular Lemma witnessTargetMatrix_signalMinSingular in the paper ↗

The target-proxy matrix of the collision witness has singular-value margin one tenth. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
(1 / 10 : ℝ)
signalMinSingular (fun i j : Fin 2 => if i.val = 0 then 1 else if j.val = 0 then 1 / 5 else 4 / 5)
Proof (Lean source)
-- @node: witnessTargetMatrix_signalMinSingular lemma witnessTargetMatrix_signalMinSingular : (1 / 10 : ℝ) ≤ signalMinSingular (fun i j : Fin 2 => if i.val = 0 then 1 else if j.val = 0 then 1 / 5 else 4 / 5) := by apply signalMinSingular_lower_fin_two _ _ (by norm_num) intro x simp [Fin.sum_univ_two] nlinarith [sq_nonneg (3 * x 0 - 4 * x 1)]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witnessTargetMatrix_signalMinSingular · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessSpectral.lean:42
theorem witnessReferenceMatrix_false_signalMinSingular Lemma witnessReferenceMatrix_false_signalMinSingular in the paper ↗

The control-arm reference-proxy matrix has singular-value margin one tenth. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
(1 / 10 : ℝ)
signalMinSingular (fun i j : Fin 2 => if i.val = 0 then 1 else if j.val = 0 then 3 / 10 else 7 / 10)
Proof (Lean source)
-- @node: witnessReferenceMatrix_false_signalMinSingular lemma witnessReferenceMatrix_false_signalMinSingular : (1 / 10 : ℝ) ≤ signalMinSingular (fun i j : Fin 2 => if i.val = 0 then 1 else if j.val = 0 then 3 / 10 else 7 / 10) := by apply signalMinSingular_lower_fin_two _ _ (by norm_num) intro x simp [Fin.sum_univ_two] nlinarith [sq_nonneg (3 * x 0 - 7 * x 1)]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witnessReferenceMatrix_false_signalMinSingular · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessSpectral.lean:52
theorem witnessReferenceMatrix_true_signalMinSingular Lemma witnessReferenceMatrix_true_signalMinSingular in the paper ↗

The treated-arm reference-proxy matrix has singular-value margin one tenth. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
(1 / 10 : ℝ)
signalMinSingular (fun i j : Fin 2 => if i.val = 0 then 1 else if j.val = 0 then 7 / 20 else 3 / 4)
Proof (Lean source)
-- @node: witnessReferenceMatrix_true_signalMinSingular lemma witnessReferenceMatrix_true_signalMinSingular : (1 / 10 : ℝ) ≤ signalMinSingular (fun i j : Fin 2 => if i.val = 0 then 1 else if j.val = 0 then 7 / 20 else 3 / 4) := by apply signalMinSingular_lower_fin_two _ _ (by norm_num) intro x simp [Fin.sum_univ_two] nlinarith [sq_nonneg (7 * x 0 - 15 * x 1)]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witnessReferenceMatrix_true_signalMinSingular · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessSpectral.lean:62
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.Helpers.WitnessValidity 29 declarations Finite-sum, envelope, matrix, and law calculations for the explicit collision witness.

Finite-sum, envelope, matrix, and law calculations for the explicit collision witness.

Measurable set obs arm: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
t :
MeasurableSet (obsArm (dx := 2) (dz := 2) t)
Proof (Lean source)
lemma measurableSet_obsArm (t : Bool) : MeasurableSet (obsArm (dx := 2) (dz := 2) t) := by have hcoord : Measurable (@Obs.toCoordinates 2 2) := continuous_induced_dom.measurable have hT : Measurable (fun o : Obs 2 2 => o.T) := by change Measurable (fun o => (Obs.toCoordinates o).1) exact hcoord.fst exact hT (measurableSet_singleton t)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.measurableSet_obsArm · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessValidity.lean:12
theorem measurable_obs_Z_mul_X

Measurable obs z mul x: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
i j :
Fin 2
Measurable (fun o : Obs 2 2 => o.Z i * o.X j)
Proof (Lean source)
lemma measurable_obs_Z_mul_X (i j : Fin 2) : Measurable (fun o : Obs 2 2 => o.Z i * o.X j) := by have hcoord : Measurable (@Obs.toCoordinates 2 2) := continuous_induced_dom.measurable have hX : Measurable (fun o : Obs 2 2 => o.X) := by change Measurable (fun o => (Obs.toCoordinates o).2.1) exact hcoord.snd.fst have hZ : Measurable (fun o : Obs 2 2 => o.Z) := by change Measurable (fun o => (Obs.toCoordinates o).2.2.1) exact hcoord.snd.snd.fst exact ((measurable_pi_apply i).comp hZ).mul ((measurable_pi_apply j).comp hX)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.measurable_obs_Z_mul_X · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessValidity.lean:21

Obs witness arm mass: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
hlo :
0 ≤ eps
hhi :
eps ≤ 1 / 8
t :
letI
Proof (Lean source)
lemma obs_witness_arm_mass (eps : ℝ) (hlo : 0 ≤ eps) (hhi : eps ≤ 1 / 8) (t : Bool) : letI := witnessLaw_isProbabilityMeasure eps hlo hhi (obsLaw (witnessLaw eps)).real (obsArm t) = if t then 13 / 25 else 12 / 25 := by classical letI := witnessLaw_isProbabilityMeasure eps hlo hhi have hfull : MeasurableSet {w : FullData 2 2 2 | w.T = t} := (obsMap_measurable 2 2 2) (measurableSet_obsArm t) change ((witnessLaw eps).map obsMap).real (obsArm t) = _ rw [Measure.real, Measure.map_apply (obsMap_measurable 2 2 2) (measurableSet_obsArm t)] change (witnessLaw eps).real {w | w.T = t} = _ rw [witnessLaw_real eps _ hfull] simp_rw [ENNReal.toReal_ofReal (witnessWeight_nonneg eps hlo hhi _ _ _ _ _ _)] simp only [witnessPoint, Set.mem_setOf_eq] have hselect (u : Fin 2) : (∑ s : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps u s x z y0 y1 * if s = t then 1 else 0) = ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps u t x z y0 y1 := by cases t <;> rw [show (Finset.univ : Finset Bool) = {false, true} by decide] <;> simp simp_rw [hselect, witnessWeight_sum_nuisance] fin_cases t <;> simp [bernoulliMass] <;> norm_num
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.obs_witness_arm_mass · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessValidity.lean:34
theorem witness_latentMass Lemma 8 in the paper ↗

Witness latent mass: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
hlo :
0 ≤ eps
hhi :
eps ≤ 1 / 8
u :
Fin 2
latentMass (witnessLaw eps) u = if u.val = 0 then 2 / 5 else 3 / 5
Proof (Lean source)
lemma witness_latentMass (eps : ℝ) (hlo : 0 ≤ eps) (hhi : eps ≤ 1 / 8) (u : Fin 2) : latentMass (witnessLaw eps) u = if u.val = 0 then 2 / 5 else 3 / 5 := by classical rw [latentMass, witnessLaw_real eps _ (measurableSet_witness_latentClass u)] simp_rw [ENNReal.toReal_ofReal (witnessWeight_nonneg eps hlo hhi _ _ _ _ _ _)] rw [witness_sum_restrict_latentClass eps u (fun _ => (1 : ℝ))] simp only [mul_one] simp_rw [witnessWeight_sum_nuisance] fin_cases u <;> simp [bernoulliMass] <;> norm_num
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witness_latentMass · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessValidity.lean:60
theorem witness_latentCell_mass

Witness latent cell mass: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
hlo :
0 ≤ eps
hhi :
eps ≤ 1 / 8
u :
Fin 2
t :
= (if u.val = 0 then 2 / 5 else 3 / 5) * bernoulliMass (if u.val = 0 then 2 / 5 else 3 / 5) t
Proof (Lean source)
lemma witness_latentCell_mass (eps : ℝ) (hlo : 0 ≤ eps) (hhi : eps ≤ 1 / 8) (u : Fin 2) (t : Bool) : (witnessLaw eps).real (latentCell u t) = (if u.val = 0 then 2 / 5 else 3 / 5) * bernoulliMass (if u.val = 0 then 2 / 5 else 3 / 5) t := by classical rw [witnessLaw_real eps _ (measurableSet_witness_latentCell u t)] simp_rw [ENNReal.toReal_ofReal (witnessWeight_nonneg eps hlo hhi _ _ _ _ _ _)] rw [witness_sum_restrict_latentCell eps u t (fun _ => (1 : ℝ))] simp only [mul_one] exact witnessWeight_sum_nuisance eps u t
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witness_latentCell_mass · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessValidity.lean:73
theorem witness_targetFeature

Witness target feature: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
hlo :
0 ≤ eps
hhi :
eps ≤ 1 / 8
= fun i u : Fin 2 => if i.val = 0 then 1 else if u.val = 0 then 1 / 5 else 4 / 5
Proof (Lean source)
lemma witness_targetFeature (eps : ℝ) (hlo : 0 ≤ eps) (hhi : eps ≤ 1 / 8) : targetFeature (witnessLaw eps) = fun i u : Fin 2 => if i.val = 0 then 1 else if u.val = 0 then 1 / 5 else 4 / 5 := by ext i u rw [targetFeature, conditionalMean_witness_latentClass eps hlo hhi] fin_cases i <;> fin_cases u <;> simp (config := { maxSteps := 1000000 }) [witnessWeight, witnessPoint, vec2, boolReal, bernoulliMass] <;> ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witness_targetFeature · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessValidity.lean:87
theorem witness_referenceFeature

Witness reference feature: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
hlo :
0 ≤ eps
hhi :
eps ≤ 1 / 8
t :
= fun i u : Fin 2 => if i.val = 0 then 1 else if t then (if u.val = 0 then 7 / 20 else 3 / 4) else (if u.val = 0 then 3 / 10 else 7 / 10)
Proof (Lean source)
lemma witness_referenceFeature (eps : ℝ) (hlo : 0 ≤ eps) (hhi : eps ≤ 1 / 8) (t : Bool) : referenceFeature (witnessLaw eps) t = fun i u : Fin 2 => if i.val = 0 then 1 else if t then (if u.val = 0 then 7 / 20 else 3 / 4) else (if u.val = 0 then 3 / 10 else 7 / 10) := by ext i u rw [referenceFeature, conditionalMean_witness_latentCell eps hlo hhi] fin_cases i <;> fin_cases u <;> cases t <;> simp (config := { maxSteps := 1000000 }) [witnessWeight, witnessPoint, vec2, boolReal, bernoulliMass] <;> ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witness_referenceFeature · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessValidity.lean:98
theorem witness_latentEffect Lemma 9 in the paper ↗

Witness latent effect: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
hlo :
0 ≤ eps
hhi :
eps ≤ 1 / 8
u :
Fin 2
latentEffect (witnessLaw eps) u = if u.val = 0 then 1 / 4 - eps else 1 / 4 + eps
Proof (Lean source)
lemma witness_latentEffect (eps : ℝ) (hlo : 0 ≤ eps) (hhi : eps ≤ 1 / 8) (u : Fin 2) : latentEffect (witnessLaw eps) u = if u.val = 0 then 1 / 4 - eps else 1 / 4 + eps := by unfold latentEffect latentMean rw [conditionalMean_witness_latentClass eps hlo hhi, conditionalMean_witness_latentClass eps hlo hhi] fin_cases u <;> simp (config := { maxSteps := 1000000 }) [witnessWeight, witnessPoint, potential, boolReal, bernoulliMass] <;> ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witness_latentEffect · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessValidity.lean:112
theorem conditionalMean_obsLaw_witness

Conditional mean obs law witness: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
hlo :
0 ≤ eps
hhi :
eps ≤ 1 / 8
A :
Set (Obs 2 2)
DecidablePred (· ∈ A)
hA :
f :
Obs 2 2 → ℝ
hf :
letI
Proof (Lean source)
lemma conditionalMean_obsLaw_witness (eps : ℝ) (hlo : 0 ≤ eps) (hhi : eps ≤ 1 / 8) (A : Set (Obs 2 2)) [DecidablePred (· ∈ A)] (hA : MeasurableSet A) (f : Obs 2 2 → ℝ) (hf : Measurable f) : letI := witnessLaw_isProbabilityMeasure eps hlo hhi conditionalMean (obsLaw (witnessLaw eps)) A f = (∑ u : Fin 2, ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps u t x z y0 y1 * if obsMap (witnessPoint u t x z y0 y1) ∈ A then 1 else 0)⁻¹ * (∑ u : Fin 2, ∑ t : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps u t x z y0 y1 * if obsMap (witnessPoint u t x z y0 y1) ∈ A then f (obsMap (witnessPoint u t x z y0 y1)) else 0) := by classical letI := witnessLaw_isProbabilityMeasure eps hlo hhi have hpre : MeasurableSet (obsMap ⁻¹' A) := (obsMap_measurable 2 2 2) hA have hmass : (obsLaw (witnessLaw eps)).real A = (witnessLaw eps).real (obsMap ⁻¹' A) := by change ((witnessLaw eps).map obsMap).real A = _ exact congrArg toReal (Measure.map_apply (obsMap_measurable 2 2 2) hA) have hint : ∫ o in A, f o ∂obsLaw (witnessLaw eps) = ∫ w in obsMap ⁻¹' A, f (obsMap w) ∂witnessLaw eps := by change ∫ o, f o ∂((witnessLaw eps).map obsMap).restrict A = _ rw [Measure.restrict_map (obsMap_measurable 2 2 2) hA] exact integral_map (obsMap_measurable 2 2 2).aemeasurable hf.aestronglyMeasurable rw [conditionalMean, hmass, hint, witnessLaw_real eps _ hpre, integral_witnessLaw_restrict eps _ hpre] simp_rw [ENNReal.toReal_ofReal (witnessWeight_nonneg eps hlo hhi _ _ _ _ _ _)] simp only [Set.mem_preimage]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.conditionalMean_obsLaw_witness · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessValidity.lean:125
theorem witness_sum_restrict_obsArm

Witness sum restrict obs arm: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
t :
F :
Obs 2 2 → ℝ
(∑ u : Fin 2, ∑ s : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps u s x z y0 y1 * if (obsMap (witnessPoint u s x z y0 y1)).T = t then F (obsMap (witnessPoint u s x z y0 y1)) else 0)
= ∑ u : Fin 2, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps u t x z y0 y1 * F (obsMap (witnessPoint u t x z y0 y1))
Proof (Lean source)
lemma witness_sum_restrict_obsArm (eps : ℝ) (t : Bool) (F : Obs 2 2 → ℝ) : (∑ u : Fin 2, ∑ s : Bool, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps u s x z y0 y1 * if (obsMap (witnessPoint u s x z y0 y1)).T = t then F (obsMap (witnessPoint u s x z y0 y1)) else 0) = ∑ u : Fin 2, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps u t x z y0 y1 * F (obsMap (witnessPoint u t x z y0 y1)) := by apply Finset.sum_congr rfl intro u _ cases t <;> rw [show (Finset.univ : Finset Bool) = {false, true} by decide] <;> simp [obsMap, witnessPoint]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witness_sum_restrict_obsArm · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessValidity.lean:157
theorem conditionalMean_obsArm_witness

Conditional mean obs arm witness: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
hlo :
0 ≤ eps
hhi :
eps ≤ 1 / 8
t :
f :
Obs 2 2 → ℝ
hf :
letI
Proof (Lean source)
lemma conditionalMean_obsArm_witness (eps : ℝ) (hlo : 0 ≤ eps) (hhi : eps ≤ 1 / 8) (t : Bool) (f : Obs 2 2 → ℝ) (hf : Measurable f) : letI := witnessLaw_isProbabilityMeasure eps hlo hhi conditionalMean (obsLaw (witnessLaw eps)) (obsArm t) f = (∑ u : Fin 2, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps u t x z y0 y1)⁻¹ * (∑ u : Fin 2, ∑ x : Bool, ∑ z : Bool, ∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps u t x z y0 y1 * f (obsMap (witnessPoint u t x z y0 y1))) := by classical rw [conditionalMean_obsLaw_witness eps hlo hhi _ (measurableSet_obsArm t) _ hf] simp only [obsArm, Set.mem_setOf_eq] rw [witness_sum_restrict_obsArm eps t (fun _ => (1 : ℝ)), witness_sum_restrict_obsArm eps t f] simp only [mul_one]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.conditionalMean_obsArm_witness · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessValidity.lean:172
theorem witnessWeight_sum_outcomes_mul Lemma witnessWeight_sum_outcomes_mul in the paper ↗

Witness weight sum outcomes mul: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
u :
Fin 2
t x z :
c :
∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps u t x z y0 y1 * c
= ((if u.val = 0 then 2 / 5 else 3 / 5) * bernoulliMass (if u.val = 0 then 2 / 5 else 3 / 5) t * bernoulliMass (if u.val = 0 then 1 / 5 else 4 / 5) x * bernoulliMass (if t then (if u.val = 0 then 7 / 20 else 3 / 4) else (if u.val = 0 then 3 / 10 else 7 / 10)) z) * c
Proof (Lean source)
lemma witnessWeight_sum_outcomes_mul (eps : ℝ) (u : Fin 2) (t x z : Bool) (c : ℝ) : ∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps u t x z y0 y1 * c = ((if u.val = 0 then 2 / 5 else 3 / 5) * bernoulliMass (if u.val = 0 then 2 / 5 else 3 / 5) t * bernoulliMass (if u.val = 0 then 1 / 5 else 4 / 5) x * bernoulliMass (if t then (if u.val = 0 then 7 / 20 else 3 / 4) else (if u.val = 0 then 3 / 10 else 7 / 10)) z) * c := by let a : ℝ := (if u.val = 0 then 2 / 5 else 3 / 5) * bernoulliMass (if u.val = 0 then 2 / 5 else 3 / 5) t * bernoulliMass (if u.val = 0 then 1 / 5 else 4 / 5) x * bernoulliMass (if t then (if u.val = 0 then 7 / 20 else 3 / 4) else (if u.val = 0 then 3 / 10 else 7 / 10)) z let p : ℝ := if u.val = 0 then 1 / 2 - eps else 1 / 2 + eps have hw (y0 y1 : Bool) : witnessWeight eps u t x z y0 y1 * c = (a * c * bernoulliMass (1 / 4) y0) * bernoulliMass p y1 := by simp only [witnessWeight, a, p] ring simp_rw [hw, sum_mul_bernoulliMass] rfl
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witnessWeight_sum_outcomes_mul · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessValidity.lean:189
theorem witnessWeight_sum_outcomes Lemma witnessWeight_sum_outcomes in the paper ↗

Witness weight sum outcomes: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
u :
Fin 2
t x z :
∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps u t x z y0 y1
= (if u.val = 0 then 2 / 5 else 3 / 5) * bernoulliMass (if u.val = 0 then 2 / 5 else 3 / 5) t * bernoulliMass (if u.val = 0 then 1 / 5 else 4 / 5) x * bernoulliMass (if t then (if u.val = 0 then 7 / 20 else 3 / 4) else (if u.val = 0 then 3 / 10 else 7 / 10)) z
Proof (Lean source)
lemma witnessWeight_sum_outcomes (eps : ℝ) (u : Fin 2) (t x z : Bool) : ∑ y0 : Bool, ∑ y1 : Bool, witnessWeight eps u t x z y0 y1 = (if u.val = 0 then 2 / 5 else 3 / 5) * bernoulliMass (if u.val = 0 then 2 / 5 else 3 / 5) t * bernoulliMass (if u.val = 0 then 1 / 5 else 4 / 5) x * bernoulliMass (if t then (if u.val = 0 then 7 / 20 else 3 / 4) else (if u.val = 0 then 3 / 10 else 7 / 10)) z := by simpa using witnessWeight_sum_outcomes_mul eps u t x z 1
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witnessWeight_sum_outcomes · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessValidity.lean:212
theorem conditionalMean_obsArm_ZX Lemma conditionalMean_obsArm_ZX in the paper ↗

Conditional mean obs arm zx: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
hlo :
0 ≤ eps
hhi :
eps ≤ 1 / 8
t :
i j :
Fin 2
letI
Proof (Lean source)
lemma conditionalMean_obsArm_ZX (eps : ℝ) (hlo : 0 ≤ eps) (hhi : eps ≤ 1 / 8) (t : Bool) (i j : Fin 2) : letI := witnessLaw_isProbabilityMeasure eps hlo hhi conditionalMean (obsLaw (witnessLaw eps)) (obsArm t) (fun o => o.Z i * o.X j) = (∑ u : Fin 2, ∑ x : Bool, ∑ z : Bool, (if u.val = 0 then 2 / 5 else 3 / 5) * bernoulliMass (if u.val = 0 then 2 / 5 else 3 / 5) t * bernoulliMass (if u.val = 0 then 1 / 5 else 4 / 5) x * bernoulliMass (if t then (if u.val = 0 then 7 / 20 else 3 / 4) else (if u.val = 0 then 3 / 10 else 7 / 10)) z)⁻¹ * (∑ u : Fin 2, ∑ x : Bool, ∑ z : Bool, ((if u.val = 0 then 2 / 5 else 3 / 5) * bernoulliMass (if u.val = 0 then 2 / 5 else 3 / 5) t * bernoulliMass (if u.val = 0 then 1 / 5 else 4 / 5) x * bernoulliMass (if t then (if u.val = 0 then 7 / 20 else 3 / 4) else (if u.val = 0 then 3 / 10 else 7 / 10)) z) * (vec2 1 (boolReal z) i * vec2 1 (boolReal x) j)) := by rw [conditionalMean_obsArm_witness eps hlo hhi t _ (measurable_obs_Z_mul_X i j)] apply congrArg₂ (· * ·) · apply congrArg inv simp_rw [witnessWeight_sum_outcomes] · simp only [obsMap, witnessPoint] simp_rw [witnessWeight_sum_outcomes_mul]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.conditionalMean_obsArm_ZX · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessValidity.lean:223
theorem witness_observedProxyMoment_entry Lemma witness_observedProxyMoment_entry in the paper ↗

Witness observed proxy moment entry: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
hlo :
0 ≤ eps
hhi :
eps ≤ 1 / 8
t :
i j :
Fin 2
letI
Proof (Lean source)
lemma witness_observedProxyMoment_entry (eps : ℝ) (hlo : 0 ≤ eps) (hhi : eps ≤ 1 / 8) (t : Bool) (i j : Fin 2) : letI := witnessLaw_isProbabilityMeasure eps hlo hhi observedProxyMoment (obsSummary (witnessLaw eps)) t i j = if i.val = 0 then (if j.val = 0 then 1 else if t then 8 / 13 else 1 / 2) else if j.val = 0 then (if t then 163 / 260 else 1 / 2) else if t then 142 / 325 else 31 / 100 := by classical letI := witnessLaw_isProbabilityMeasure eps hlo hhi unfold observedProxyMoment cases t <;> simp only [Bool.false_eq_true, eq_self, if_false, if_true] all_goals unfold obsSummary all_goals fin_cases i <;> fin_cases j <;> norm_num all_goals rw [conditionalMean_obsArm_ZX eps hlo hhi] all_goals simp (config := { maxSteps := 1000000 }) [obsMap, witnessPoint, vec2, boolReal, bernoulliMass] <;> ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witness_observedProxyMoment_entry · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessValidity.lean:251
theorem witness_observedProxyMoment_det Lemma witness_observedProxyMoment_det in the paper ↗

Witness observed proxy moment det: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
hlo :
0 ≤ eps
hhi :
eps ≤ 1 / 8
t :
letI
Proof (Lean source)
lemma witness_observedProxyMoment_det (eps : ℝ) (hlo : 0 ≤ eps) (hhi : eps ≤ 1 / 8) (t : Bool) : letI := witnessLaw_isProbabilityMeasure eps hlo hhi det2 (observedProxyMoment (obsSummary (witnessLaw eps)) t) = if t then (2 / 5 : ℝ) * (3 / 5) * (36 / 169) else 3 / 50 := by letI := witnessLaw_isProbabilityMeasure eps hlo hhi unfold det2 rw [witness_observedProxyMoment_entry eps hlo hhi, witness_observedProxyMoment_entry eps hlo hhi, witness_observedProxyMoment_entry eps hlo hhi, witness_observedProxyMoment_entry eps hlo hhi] cases t <;> norm_num
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witness_observedProxyMoment_det · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessValidity.lean:272
theorem ae_witnessLaw_of_points

Ae witness law of points: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
p :
FullData 2 2 2 → Prop
h :
∀ (u : Fin 2) (t x z y0 y1 : Bool), p (witnessPoint u t x z y0 y1)
∀ᵐ w ∂witnessLaw eps, p w
Proof (Lean source)
lemma ae_witnessLaw_of_points (eps : ℝ) (p : FullData 2 2 2 → Prop) (h : ∀ (u : Fin 2) (t x z y0 y1 : Bool), p (witnessPoint u t x z y0 y1)) : ∀ᵐ w ∂witnessLaw eps, p w := by rw [witnessLaw] simp only [ae_finsetSum_measure_iff] intro u _ t _ x _ z _ y0 _ y1 _ by_cases hc : ofReal (witnessWeight eps u t x z y0 y1) = 0 · simp [hc] · rw [Measure.ae_ennreal_smul_measure_iff hc, ae_dirac_eq] exact h u t x z y0 y1
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ae_witnessLaw_of_points · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessValidity.lean:287
theorem witness_consistency

Witness consistency: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
Proof (Lean source)
lemma witness_consistency (eps : ℝ) : CausalConsistency (witnessLaw eps) := by unfold CausalConsistency apply ae_witnessLaw_of_points intro u t x z y0 y1 cases t <;> simp [witnessPoint, potential]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witness_consistency · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessValidity.lean:300
theorem witness_anchor

Witness anchor: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
Proof (Lean source)
lemma witness_anchor (eps : ℝ) : AnchorNormalization (witnessLaw eps) := by unfold AnchorNormalization apply ae_witnessLaw_of_points intro u t x z y0 y1 i hi simp [witnessPoint, vec2, hi]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witness_anchor · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessValidity.lean:308
theorem witness_outerProduct_norm

Witness outer product norm: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
x z :
‖matrixCLM (outerProduct (vec2 1 (boolReal z)) (vec2 1 (boolReal x)))‖ ≤ 2
Proof (Lean source)
lemma witness_outerProduct_norm (x z : Bool) : ‖matrixCLM (outerProduct (vec2 1 (boolReal z)) (vec2 1 (boolReal x)))‖ ≤ 2 := by apply ContinuousLinearMap.opNorm_le_bound _ (by norm_num) intro v cases x <;> cases z <;> simp [matrixCLM, outerProduct, vec2, boolReal, Matrix.toEuclideanLin_apply, mulVec, dotProduct, EuclideanSpace.norm_eq, Fin.sum_univ_two] all_goals have hS : (sqrt (v.ofLp 0 ^ 2 + v.ofLp 1 ^ 2)) ^ 2 = v.ofLp 0 ^ 2 + v.ofLp 1 ^ 2 := Real.sq_sqrt (by positivity) have hA : (sqrt (v.ofLp 0 ^ 2)) ^ 2 = v.ofLp 0 ^ 2 := Real.sq_sqrt (by positivity) have hB : (sqrt ((v.ofLp 0 + v.ofLp 1) ^ 2)) ^ 2 = (v.ofLp 0 + v.ofLp 1) ^ 2 := Real.sq_sqrt (by positivity) have h2 : (sqrt 2) ^ 2 = 2 := Real.sq_sqrt (by norm_num) have hs0 := Real.sqrt_nonneg (v.ofLp 0 ^ 2 + v.ofLp 1 ^ 2) have ha0 := Real.sqrt_nonneg (v.ofLp 0 ^ 2) have hb0 := Real.sqrt_nonneg ((v.ofLp 0 + v.ofLp 1) ^ 2) have h20 := Real.sqrt_nonneg 2 nlinarith [sq_nonneg (v.ofLp 0 - v.ofLp 1)]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witness_outerProduct_norm · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessValidity.lean:316
theorem witness_boundedX

Witness bounded x: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
Proof (Lean source)
lemma witness_boundedX (eps : ℝ) : BoundedTargetProxy (L := 2) (witnessLaw eps) := by unfold BoundedTargetProxy apply ae_witnessLaw_of_points intro u t x z y0 y1 simp [witnessPoint, vec2, boolReal, Fin.sum_univ_two] cases x <;> norm_num [Real.sqrt_le_iff]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witness_boundedX · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessValidity.lean:339
theorem witness_boundedProxyProduct

Witness bounded proxy product: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
Proof (Lean source)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witness_boundedProxyProduct · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessValidity.lean:348
theorem witness_boundedOutcomeProxyProduct

Witness bounded outcome proxy product: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
Proof (Lean source)
lemma witness_boundedOutcomeProxyProduct (eps : ℝ) : BoundedOutcomeProxyProduct (L := 2) (witnessLaw eps) := by unfold BoundedOutcomeProxyProduct apply ae_witnessLaw_of_points intro u t x z y0 y1 cases t · cases y0 · change ‖matrixCLM (0 • outerProduct (vec2 1 (boolReal z)) (vec2 1 (boolReal x)))‖ ≤ 2 simp [matrixCLM] · change ‖matrixCLM (1 • outerProduct (vec2 1 (boolReal z)) (vec2 1 (boolReal x)))‖ ≤ 2 simpa using witness_outerProduct_norm x z · cases y1 · change ‖matrixCLM (0 • outerProduct (vec2 1 (boolReal z)) (vec2 1 (boolReal x)))‖ ≤ 2 simp [matrixCLM] · change ‖matrixCLM (1 • outerProduct (vec2 1 (boolReal z)) (vec2 1 (boolReal x)))‖ ≤ 2 simpa using witness_outerProduct_norm x z
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witness_boundedOutcomeProxyProduct · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessValidity.lean:357
theorem witness_latentArmPositivity

Witness latent arm positivity: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
hlo :
0 ≤ eps
hhi :
eps ≤ 1 / 8
LatentArmPositivity (pi0 := 1 / 10) (witnessLaw eps)
Proof (Lean source)
lemma witness_latentArmPositivity (eps : ℝ) (hlo : 0 ≤ eps) (hhi : eps ≤ 1 / 8) : LatentArmPositivity (pi0 := 1 / 10) (witnessLaw eps) := by intro u t rw [witness_latentCell_mass eps hlo hhi] fin_cases u <;> cases t <;> norm_num [bernoulliMass]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witness_latentArmPositivity · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessValidity.lean:380
theorem witness_proxyRankMargin

Witness proxy rank margin: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
hlo :
0 ≤ eps
hhi :
eps ≤ 1 / 8
ProxyRankMargin (sigma0 := 1 / 10) (witnessLaw eps)
Proof (Lean source)
lemma witness_proxyRankMargin (eps : ℝ) (hlo : 0 ≤ eps) (hhi : eps ≤ 1 / 8) : ProxyRankMargin (sigma0 := 1 / 10) (witnessLaw eps) := by constructor · rw [witness_referenceFeature eps hlo hhi false] exact witnessReferenceMatrix_false_signalMinSingular constructor · rw [witness_referenceFeature eps hlo hhi true] exact witnessReferenceMatrix_true_signalMinSingular · rw [witness_targetFeature eps hlo hhi] exact witnessTargetMatrix_signalMinSingular
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witness_proxyRankMargin · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessValidity.lean:388
theorem witness_det_targetFeature Lemma 11 in the paper ↗

Witness det target feature: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
hlo :
0 ≤ eps
hhi :
eps ≤ 1 / 8
det2 (targetFeature (witnessLaw eps)) = 3 / 5
Proof (Lean source)
lemma witness_det_targetFeature (eps : ℝ) (hlo : 0 ≤ eps) (hhi : eps ≤ 1 / 8) : det2 (targetFeature (witnessLaw eps)) = 3 / 5 := by rw [witness_targetFeature eps hlo hhi] norm_num [det2]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witness_det_targetFeature · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessValidity.lean:401
theorem witness_det_referenceFeature Lemma 12 in the paper ↗

Witness det reference feature: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
hlo :
0 ≤ eps
hhi :
eps ≤ 1 / 8
t :
det2 (referenceFeature (witnessLaw eps) t) = 2 / 5
Proof (Lean source)
lemma witness_det_referenceFeature (eps : ℝ) (hlo : 0 ≤ eps) (hhi : eps ≤ 1 / 8) (t : Bool) : det2 (referenceFeature (witnessLaw eps) t) = 2 / 5 := by rw [witness_referenceFeature eps hlo hhi] cases t <;> norm_num [det2]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witness_det_referenceFeature · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessValidity.lean:408
theorem two_by_two_injective_of_signalMinSingular_pos

Two by two injective of signal min singular pos: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
A :
hA :
Proof (Lean source)
lemma two_by_two_injective_of_signalMinSingular_pos (A : RectMatrix 2 2) (hA : 0 < signalMinSingular A) : Injective (toEuclideanLin A) := by apply (LinearMap.injective_iff_forall_lt_finrank_singularValues_pos _).2 intro i hi have hi_le : i ≤ 1 := by simpa using (Nat.le_pred_of_lt hi) have hant := (toEuclideanLin A).singularValues_antitone hi_le apply lt_of_lt_of_le hA simpa [signalMinSingular, singularValue] using hant
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.two_by_two_injective_of_signalMinSingular_pos · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessValidity.lean:416
theorem witness_ucvmwModel

The collision witness belongs to the uniformly conditioned model throughout its admissible amplitude interval. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
hlo :
0 ≤ eps
hhi :
eps ≤ 1 / 8
letI
Proof (Lean source)
lemma witness_ucvmwModel (eps : ℝ) (hlo : 0 ≤ eps) (hhi : eps ≤ 1 / 8) : letI := witnessLaw_isProbabilityMeasure eps hlo hhi UCVMWModel (L := 2) (pi0 := 1 / 10) (sigma0 := 1 / 10) (witnessLaw eps) := by letI := witnessLaw_isProbabilityMeasure eps hlo hhi exact { referenceProxySeparation := witness_referenceProxySeparation eps hlo hhi coreDomain := by norm_num [CoreParameterDomain] targetProxySeparation := witness_targetProxySeparation eps hlo hhi consistency := witness_consistency eps latentIgnorability := witness_armwiseLatentIgnorability eps hlo hhi anchor := witness_anchor eps boundedX := witness_boundedX eps boundedProxyProduct := witness_boundedProxyProduct eps boundedOutcomeProxyProduct := witness_boundedOutcomeProxyProduct eps latentArmPositivity := witness_latentArmPositivity eps hlo hhi proxyRankMargin := witness_proxyRankMargin eps hlo hhi }
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.witness_ucvmwModel · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/Helpers/WitnessValidity.lean:428
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.OpenQuestions 1 declarations The unresolved exact/sharp computation question, recorded as descriptive non-Prop data.

The unresolved exact/sharp computation question, recorded as descriptive non-Prop data.

def ConstructiveTotalRepairQuestion Remark 1 in the paper ↗

Can the original sharp summary-inversion image and its support-dependent extrema be evaluated by one fixed-dimensional exact-real algorithm, uniform in the sample size and polynomial in it, without compact nearest-summary optimization or black-box Fbar evaluation? The unresolved alternative also allows a sharp representation rather than direct exact evaluation. This payload is deliberately nonassertive because the note leaves the exact-real operation and forbidden-oracle criteria undefined. For the ambient setting, the defined object is given by its defining clause.

Definition (Lean source)
ConstructiveTotalRepairQuestion :
_root_.String
"Open: in the fixed-dimensional exact-real model, construct one algorithm uniform for every " ++ "n >
= 1 that computes exactly, or gives a sharp representation of, the original image " ++ "C_{n,alpha} = { Fbar(q) : q in K and d_S(q, Pi(S_hat_n)) <= 2*r_{n,alpha} } and its exact " ++ "support-dependent cluster extrema, with runtime polynomial in n, without compact " ++ "nearest-summary optimization or black-box evaluation of Fbar. The positive real law " ++ "estimator lambda_hat_n, the honest outer set C_alg_{n,alpha}, and every interval in its " ++ "report R_{n,alpha} already have explicit fixed-dimensional constrained representations, " ++ "including when the raw empirical operator has nonreal eigenpairs. Thus the remaining " ++ "question is only exact computation or sharp polynomial-time representation of the original " ++ "summary-inversion image and its extrema; it is not the existence of an evaluable confidence " ++ "set or report."
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ConstructiveTotalRepairQuestion · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/OpenQuestions.lean:9
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.TClusterAdaptiveReport 1 declarations
theorem cluster_adaptive_report Theorem 4 in the paper ↗

On the summary event, associated true clusters partition the target support, lie in their reported intervals, and obey the atom-floor external-gap mass bounds. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hsigma :
0 < sigma0
hsigmaMax :
sigma0 ≤ 1
∃ (C0 : ℝ) (hC0 : ConcentrationConstantDomain C0),
∀ (L : ℝ),
(hL : 1 ≤ L) → ∃ (hClat : 0 < prescribedLatticeConstant k dx dz L pi0 sigma0), ∀ n : ℕ, (hn : 1 ≤ n) → ∃ (A : LatticeEstimator k dx dz n (effectRadius dz L sigma0)) (R : SummaryRepairData k dx dz n L pi0 sigma0) (hA : IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A), ∀ alpha : ℝ, (hAlpha : MiscoverageDomain alpha) → A.atomFloor
= pi0 ∧
(∀ (P : Measure (FullData k dx dz)) (_hP : IsProbabilityMeasure P), letI := _hP (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) → ∀ sample, AtomicLaw.LawModulo.wass1 (A.estimate sample) (quotientLaw P hM) ≤ prescribedLatticeConstant k dx dz L pi0 sigma0 * (dS (empSummary sample) (obsSummary P) + (sqrt n)⁻¹)) ∧
∀ (P : Measure (FullData k dx dz)) (_hP : IsProbabilityMeasure P), letI
Proof (Lean source)
-- @node: thm:cluster-adaptive-report theorem cluster_adaptive_report (k dx dz : ℕ) (pi0 sigma0 : ℝ) (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hpi : 0 < pi0) (hpiMax : pi0 ≤ 1 / (2 * k : ℝ)) (hsigma : 0 < sigma0) (hsigmaMax : sigma0 ≤ 1) : ∃ (C0 : ℝ) (hC0 : ConcentrationConstantDomain C0), ∀ (L : ℝ), (hL : 1 ≤ L) → ∃ (hClat : 0 < prescribedLatticeConstant k dx dz L pi0 sigma0), ∀ n : ℕ, (hn : 1 ≤ n) → ∃ (A : LatticeEstimator k dx dz n (effectRadius dz L sigma0)) (R : SummaryRepairData k dx dz n L pi0 sigma0) (hA : IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A), ∀ alpha : ℝ, (hAlpha : MiscoverageDomain alpha) → A.atomFloor = pi0 ∧ (∀ (P : Measure (FullData k dx dz)) (_hP : IsProbabilityMeasure P), letI := _hP (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) → ∀ sample, AtomicLaw.LawModulo.wass1 (A.estimate sample) (quotientLaw P hM) ≤ prescribedLatticeConstant k dx dz L pi0 sigma0 * (dS (empSummary sample) (obsSummary P) + (sqrt n)⁻¹)) ∧ ∀ (P : Measure (FullData k dx dz)) (_hP : IsProbabilityMeasure P), letI := _hP (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) → (1 - alpha ≤ (sampleLaw (n := n) P).real (summaryEvent (n := n) P C0 L alpha)) ∧ ∀ sample ∈ summaryEvent (n := n) P C0 L alpha, let report := clusterReport R A hA sample alpha C0 (prescribedLatticeConstant k dx dz L pi0 sigma0) (by omega) hAlpha.1 hAlpha.2 hC0 hL hpi hpiMax hClat let nu := (quotientLaw P hM).representative.1 (∀ x, x ∈ nu.support ↔ ∃! C, C ∈ report.Kcomponents ∧ x ∈ report.Ktrue nu C) ∧ (∀ C ∈ report.Kcomponents, (report.Ktrue nu C).Nonempty) ∧ (∀ C ∈ report.Kcomponents, report.Ktrue nu C ⊆ nu.support) ∧ (∀ C ∈ report.Kcomponents, ∀ x ∈ report.Ktrue nu C, (report.supportInterval C).1 ≤ x ∧ x ≤ (report.supportInterval C).2) ∧ (∀ C ∈ report.Kcomponents, (report.massInterval C).1 ≤ clusterMass report.rho nu C ∧ clusterMass report.rho nu C ≤ (report.massInterval C).2) ∧ (∀ C ∈ report.Kcomponents, (report.Ktrue nu C).card = 1 → (report.supportInterval C).2 - (report.supportInterval C).1 ≤ 4 * report.rho ∧ (report.massInterval C).2 - (report.massInterval C).1 ≤ 8 / pi0 * min 1 ((confidenceSets R A hA sample alpha C0 (prescribedLatticeConstant k dx dz L pi0 sigma0) (by omega) hAlpha.1 hAlpha.2 hC0 hL hpi hpiMax hClat).Ralpha / (effectGap P).toReal)) ∧ (∀ C ∈ report.Kcomponents, report.externalGap nu C = ⊤ → (report.massInterval C).2 - (report.massInterval C).1 = 0) ∧ (∀ C ∈ report.Kcomponents, (report.massInterval C).2 - (report.massInterval C).1 ≤ 8 / pi0 * min 1 ((confidenceSets R A hA sample alpha C0 (prescribedLatticeConstant k dx dz L pi0 sigma0) (by omega) hAlpha.1 hAlpha.2 hC0 hL hpi hpiMax hClat).Ralpha / (report.externalGap nu C).toReal)) ∧ CalgHasConstrainedRepresentation (confidenceSets R A hA sample alpha C0 (prescribedLatticeConstant k dx dz L pi0 sigma0) (by omega) hAlpha.1 hAlpha.2 hC0 hL hpi hpiMax hClat) (latticeLaw A sample) := by obtain ⟨C0, hC0, hconc⟩ := uniform_summary_concentration k dx dz pi0 sigma0 hk hkx hkz hpi hpiMax hsigma hsigmaMax refine ⟨C0, hC0, ?_⟩ intro L hL obtain ⟨Ctail, hClat, hCtail, hlattice⟩ := polynomial_lattice_law_estimator k dx dz L pi0 sigma0 hk hkx hkz hL hpi hpiMax hsigma hsigmaMax refine ⟨hClat, ?_⟩ intro n hn obtain ⟨A, hA, hAfloor, hmeas, heval, hfloor, hthreshold, hcount, hops, hdet, htail⟩ := hlattice n hn obtain ⟨Cmod, hCmod, hmodel, Fbar, hFcont, hFmeas, hFlip, hFext, hFuniq⟩ := gap_free_positive_measure_modulus k dx dz L pi0 sigma0 hk hkx hkz hL hpi hpiMax hsigma hsigmaMax obtain ⟨R, hRlip⟩ := summaryRepair_with_modulus k dx dz n L pi0 sigma0 Cmod hk hkx hkz hL hpi hpiMax hsigma hsigmaMax Fbar hFcont hFlip hFext refine ⟨A, R, hA, ?_⟩ intro alpha hAlpha obtain ⟨halpha, halphaMax⟩ := hAlpha refine ⟨hAfloor, hdet, ?_⟩ intro P hP letI := hP intro hM have hnpos : 0 < n := by omega constructor · let bad : Set (Fin n → Obs dx dz) := {sample | summaryRadius n alpha C0 L < dS (empSummary sample) (obsSummary P)} have hbad : (sampleLaw (n := n) P).real bad ≤ alpha := by simpa [bad, summaryRadius] using (hconc L n hL hn P hP hM alpha ⟨halpha, halphaMax⟩).1 have hbadMeas : MeasurableSet bad := by apply measurableSet_lt measurable_const have hc : Continuous (fun s : SummarySpace dx dz => dS s (obsSummary P)) := (dS_continuous dx dz).uncurry_right (obsSummary P) exact hc.measurable.comp empSummary_measurable rw [show summaryEvent (n := n) P C0 L alpha = badᶜ by ext sample simp [summaryEvent, bad]] rw [measureReal_compl hbadMeas] have hone : (sampleLaw (n := n) P).real univ = 1 := by simp [Measure.real] rw [hone] exact sub_le_sub_left hbad 1 · intro sample hs let Clat := prescribedLatticeConstant k dx dz L pi0 sigma0 let CS := confidenceSets R A hA sample alpha C0 Clat hnpos halpha halphaMax hC0 hL hpi hpiMax hClat let report := clusterReport R A hA sample alpha C0 Clat hnpos halpha halphaMax hC0 hL hpi hpiMax hClat let nu := (quotientLaw P hM).representative.1 let center := (latticeLaw A sample).representative.1 let rho := CS.Ralpha / pi0 have hd : dS (empSummary sample) (obsSummary P) ≤ summaryRadius n alpha C0 L := hs have hW : AtomicLaw.LawModulo.wass1 (latticeLaw A sample) (quotientLaw P hM) ≤ CS.Ralpha := by have hb := hdet P hP hM sample change AtomicLaw.LawModulo.wass1 (latticeLaw A sample) (quotientLaw P hM) ≤ _ exact hb.trans (mul_le_mul_of_nonneg_left (add_le_add hd (le_refl _)) hClat.le) have hnuCalg : quotientLaw P hM ∈ CS.Calg := by change AtomicLaw.AtomFloor pi0 nu ∧ AtomicLaw.LawModulo.wass1 (quotientLaw P hM) (latticeLaw A sample) ≤ CS.Ralpha exact ⟨quotientLaw_atomFloor P hpi hM, by rw [AtomicLaw.LawModulo.wass1_comm] exact hW⟩ have hCalg : ∀ q ∈ CS.Calg, AtomicLaw.AtomFloor pi0 q.representative.1 ∧ AtomicLaw.wass1 q.representative.1 center ≤ CS.Ralpha := by intro q hq exact hq have hnuRep : (AtomicLaw.LawModulo.ofProbabilityLaw ⟨nu, (quotientLaw P hM).representative.2⟩).representative.1 = nu := by have heq : AtomicLaw.LawModulo.ofProbabilityLaw (quotientLaw P hM).representative = quotientLaw P hM := Quotient.out_eq _ rw [show (⟨nu, (quotientLaw P hM).representative.2⟩ : AtomicLaw.ProbabilityLaw k (effectRadius dz L sigma0)) = (quotientLaw P hM).representative from rfl, heq] have hcore := cluster_deterministic_report (center := center) (nu := nu) (rho := rho) (latticeLaw A sample).representative.2 (quotientLaw P hM).representative.2 hpi (by have hk0 : (0 : ℝ) < 2 * k := by positivity have hk1 : (1 : ℝ) ≤ 2 * k := by exact_mod_cast (show 1 ≤ 2 * k by omega) calc pi0 ≤ 1 / (2 * k : ℝ) := hpiMax _ ≤ 1 := (div_le_one hk0).mpr hk1) CS.Ralpha_pos (by rfl) (by simpa [center, latticeLaw] using hfloor sample) (quotientLaw_atomFloor P hpi hM) CS.Calg hCalg (by have heq : AtomicLaw.LawModulo.ofProbabilityLaw (quotientLaw P hM).representative = quotientLaw P hM := Quotient.out_eq _ rw [heq] exact hnuCalg) hnuRep rcases hcore with ⟨hpart, hnonempty, hsubset, hsupp, hmass, hsingleSupp, htop, hgeneral⟩ refine ⟨?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_ , ?_⟩ · change ∀ x, x ∈ nu.support ↔ ∃! C, C ∈ components (rho := rho) center ∧ x ∈ associatedSupport (rho := rho) nu C exact hpart · change ∀ C ∈ components (rho := rho) center, (associatedSupport (rho := rho) nu C).Nonempty exact hnonempty · intro C hC x hx exact (Finset.mem_filter.mp hx).1 · change ∀ C ∈ components (rho := rho) center, ∀ x ∈ associatedSupport (rho := rho) nu C, sInf (C : Set ℝ) - rho ≤ x ∧ x ≤ sSup (C : Set ℝ) + rho exact hsupp · change ∀ C ∈ components (rho := rho) center, sInf {m | ∃ q ∈ CS.Calg, m = clusterMass rho q.representative.1 C} ≤ clusterMass rho nu C ∧ clusterMass rho nu C ≤ sSup {m | ∃ q ∈ CS.Calg, m = clusterMass rho q.representative.1 C} exact hmass · intro C hC hcard have hC' : C ∈ components (rho := rho) center := by simpa [report, clusterReport, CS, confidenceSets, Clat, rho, center] using hC have hcard' : (associatedSupport (rho := rho) nu C).card = 1 := by change (associatedSupport (rho := rho) nu C).card = 1 at hcard exact hcard constructor · exact hsingleSupp C hC' hcard' · apply cluster_singleton_width_from_external P hM (by simpa [nu, rho] using hcard') CS.Ralpha_pos.le hpi · intro htopC exact htop C hC' htopC · exact hgeneral C hC' · intro C hC htopC have hC' : C ∈ components (rho := rho) center := by change C ∈ components (rho := rho) center at hC exact hC have htopC' : clusterExternalGap (rho := rho) nu C = ⊤ := by change clusterExternalGap (rho := rho) nu C = ⊤ at htopC exact htopC change sSup {m | ∃ q ∈ CS.Calg, m = clusterMass rho q.representative.1 C} - sInf {m | ∃ q ∈ CS.Calg, m = clusterMass rho q.representative.1 C} = 0 exact htop C hC' htopC' · intro C hC have hC' : C ∈ components (rho := rho) center := by change C ∈ components (rho := rho) center at hC exact hC change sSup {m | ∃ q ∈ CS.Calg, m = clusterMass rho q.representative.1 C} - sInf {m | ∃ q ∈ CS.Calg, m = clusterMass rho q.representative.1 C} ≤ 8 / pi0 * min 1 (CS.Ralpha / (clusterExternalGap (rho := rho) nu C).toReal) exact hgeneral C hC' · exact confidenceSets_constrainedRepresentation R A hA sample alpha C0 Clat hnpos halpha halphaMax hC0 hL hpi hpiMax hClat
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.cluster_adaptive_report · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TClusterAdaptiveReport.lean:8
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.TCollisionUniformRootN 2 declarations
theorem empSummary_measurable

The total empirical five-block summary is Borel measurable, including its empty-arm branches. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
n dx dz :
Proof (Lean source)
-- @node: empSummary_measurable lemma empSummary_measurable {n dx dz : ℕ} : Measurable (@empSummary n dx dz) := by have hc (t : Bool) : Measurable (@armCount n dx dz t) := by unfold armCount simp_rw [Finset.card_filter] apply measurable_sum intro i hi exact Measurable.ite (measurableSet_eq_fun (measurable_obs_T.comp (measurable_pi_apply i)) measurable_const) measurable_const measurable_const have hm (weighted t : Bool) (a : Fin dz) (b : Fin dx) : Measurable (fun sample : Fin n → Obs dx dz => empiricalArmMatrix weighted t sample a b) := by unfold empiricalArmMatrix apply mul · exact (measurable_const.max ((measurable_from_nat : Measurable fun m : ℕ => (m : ℝ)).comp (hc t))).inv · apply measurable_sum intro i hi exact Measurable.ite (measurableSet_eq_fun (measurable_obs_T.comp (measurable_pi_apply i)) measurable_const) (by have hX : Measurable (fun sample : Fin n → Obs dx dz => (sample i).X b) := ((measurable_pi_apply b).comp measurable_obs_X).comp (measurable_pi_apply i) have hZ : Measurable (fun sample : Fin n → Obs dx dz => (sample i).Z a) := ((measurable_pi_apply a).comp measurable_obs_Z).comp (measurable_pi_apply i) have hY : Measurable (fun sample : Fin n → Obs dx dz => (sample i).Y) := measurable_obs_Y.comp (measurable_pi_apply i) cases weighted · convert hZ.mul hX using 1 <;> ext sample <;> simp · exact (hY.mul hZ).mul hX) measurable_const let e := summaryRepairSpaceHomeomorph dx dz have he : Measurable (fun sample : Fin n → Obs dx dz => e (empSummary sample)) := by change Measurable (fun sample : Fin n → Obs dx dz => summaryRepairToEuc (empSummary sample)) apply (WithLp.measurable_toLp 2 _).comp apply measurable_pi_lambda intro i rcases i with ⟨b, a, j⟩ | j · fin_cases b · exact hm false false a j · exact hm false true a j · exact hm true false a j · exact hm true true a j · apply mul measurable_const apply measurable_sum intro i hi exact ((measurable_pi_apply j).comp measurable_obs_X).comp (measurable_pi_apply i) convert e.symm.continuous.measurable.comp he using 1 ext sample exact e.symm_apply_apply (empSummary sample)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.empSummary_measurable · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TCollisionUniformRootN.lean:10
theorem collision_uniform_root_n Theorem 2 in the paper ↗

The computable lattice and theoretical nearest-summary estimators simultaneously attain the collision-uniform root-n quotient-law rate. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hsigma :
0 < sigma0
hsigmaMax :
sigma0 ≤ 1
∃ C : ℝ,
0 < C
conclusion 1
n :
1 ≤ n
∃ (A : LatticeEstimator k dx dz n (effectRadius dz L sigma0)) (R : SummaryRepairData k dx dz n L pi0 sigma0),
IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A
Measurable A.estimate
eta :
P :
Measure (FullData k dx dz)
letI
Proof (Lean source)
-- @node: thm:collision-uniform-root-n theorem collision_uniform_root_n (k dx dz : ℕ) (L pi0 sigma0 : ℝ) (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hpiMax : pi0 ≤ 1 / (2 * k : ℝ)) (hsigma : 0 < sigma0) (hsigmaMax : sigma0 ≤ 1) : ∃ C : ℝ, 0 < C ∧ -- @realizes \(C\)(positive collision-uniform upper constant) ∀ n : ℕ, 1 ≤ n → ∃ (A : LatticeEstimator k dx dz n (effectRadius dz L sigma0)) (R : SummaryRepairData k dx dz n L pi0 sigma0), IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A ∧ Measurable A.estimate ∧ Measurable (summaryRepair R) ∧ ∀ eta : ℝ, TailLevelDomain eta → ∀ (P : Measure (FullData k dx dz)) (_hP : IsProbabilityMeasure P), letI := _hP (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) → (sampleLaw (n := n) P).real {sample | max (AtomicLaw.LawModulo.wass1 (A.estimate sample) (quotientLaw P hM)) (AtomicLaw.LawModulo.wass1 (summaryRepair R sample) (quotientLaw P hM)) > C * sqrt (log (C / eta) / n)} ≤ eta ∧ ∀ t : Bool, (sampleLaw (n := n) P).real {sample | armCount t sample = 0} ≤ (1 - k * pi0) ^ n := by obtain ⟨C0, hC0, hconc⟩ := uniform_summary_concentration k dx dz pi0 sigma0 hk hkx hkz hpi hpiMax hsigma hsigmaMax obtain ⟨ClatTail, hClat, hClatTail, hlattice⟩ := polynomial_lattice_law_estimator k dx dz L pi0 sigma0 hk hkx hkz hL hpi hpiMax hsigma hsigmaMax obtain ⟨Cmod, hCmod, hmod, Fbar, hFcont, hFmeas, hFlip, hFext, hFuniq⟩ := gap_free_positive_measure_modulus k dx dz L pi0 sigma0 hk hkx hkz hL hpi hpiMax hsigma hsigmaMax let C : ℝ := max (2 * ClatTail) (max (2 * C0) (4 * Cmod * C0 * L)) have hC : 0 < C := lt_of_lt_of_le (mul_pos (by norm_num) hClatTail) (le_max_left _ _) refine ⟨C, hC, ?_⟩ intro n hn obtain ⟨A, hAstruct, hAfloor, hAsummaryMeas, hAeval, hAfloorAll, hAthreshold, hAcount, hAops, hAdet, hAtail⟩ := hlattice n hn let K := summaryClosure k dx dz L pi0 sigma0 have hKc : IsCompact K := (summary_closure_compact k dx dz L pi0 sigma0 hk hkx hkz hL hpi hpiMax hsigma hsigmaMax).2.1 have hkp : 0 < k := by omega have hradius : 0 ≤ effectRadius dz L sigma0 := by unfold effectRadius; positivity have hRexists : ∃ R : SummaryRepairData k dx dz n L pi0 sigma0, Measurable (summaryRepair R) ∧ ∀ q q', AtomicLaw.LawModulo.wass1 (R.Fbar q) (R.Fbar q') ≤ Cmod * dS q.1 q'.1 := by by_cases he : K = ∅ · let R : SummaryRepairData k dx dz n L pi0 sigma0 := { k_pos := hkp, radius_nonneg := hradius, Fbar := Fbar, Pi := fun _ => 0 continuousFbar := hFcont extendsOnModel := hFext measurablePi := measurable_const nearest := by intro s hne; exact elim (hne (by simpa [K] using he)) empty_fallback := by intro _ s; rfl measurableRepair := by have he' : summaryClosure k dx dz L pi0 sigma0 = ∅ := by simpa [K] using he simp only [he', dite_true] exact measurable_const } exact ⟨R, R.measurableRepair, hFlip⟩ · have hne : K.Nonempty := nonempty_iff_ne_empty.mpr he let d := card (SummaryRepairCoordIndex dx dz) let e : SummarySpace dx dz ≃ₜ Euc d := (summaryRepairSpaceHomeomorph dx dz).trans (euclideanReindexHomeomorph (Fintype.equivFin (SummaryRepairCoordIndex dx dz))) obtain ⟨Pi, hPm, hPK, hPmin⟩ := compactLoss_selector_of_homeomorph d e K hne hKc dS (dS_continuous dx dz) let R : SummaryRepairData k dx dz n L pi0 sigma0 := { k_pos := hkp, radius_nonneg := hradius, Fbar := Fbar, Pi := Pi continuousFbar := hFcont, extendsOnModel := hFext, measurablePi := hPm nearest := fun s _ => ⟨hPK s, hPmin s⟩ empty_fallback := by intro hs; exact elim (he (by simpa [K] using hs)) measurableRepair := by have he' : summaryClosure k dx dz L pi0 sigma0 ≠ ∅ := by simpa [K] using he simp only [he', dite_false] have hsubmem : ∀ s, Pi s ∈ summaryClosure k dx dz L pi0 sigma0 := by intro s simpa [K] using hPK s have hsub : Measurable (fun s => (⟨Pi s, hsubmem s⟩ : {q // q ∈ summaryClosure k dx dz L pi0 sigma0})) := hPm.subtype_mk simpa [Function.comp_def] using hFmeas.comp (hsub.comp empSummary_measurable) } exact ⟨R, R.measurableRepair, hFlip⟩ obtain ⟨R, hRmeas, hRlip⟩ := hRexists refine ⟨A, R, hAstruct, ?_, hRmeas, ?_⟩ · rw [hAeval] exact hAsummaryMeas.comp empSummary_measurable · intro eta hEta P hP rcases hEta with ⟨heta, hetaHalf⟩ letI := hP intro hM have heta2 : 0 < eta / 2 := by positivity have heta2Half : eta / 2 < 1 / 2 := by linarith have hAt := hAtail (eta / 2) ⟨heta2, heta2Half⟩ P hP hM have hSt := (hconc L n hL hn P hP hM (eta / 2) ⟨heta2, heta2Half⟩).1 have hEmpty : ∀ t : Bool, (sampleLaw (n := n) P).real {sample | armCount t sample = 0} ≤ (1 - k * pi0) ^ n := fun t => ((hconc L n hL hn P hP hM (eta / 2) ⟨heta2, heta2Half⟩).2 t).2 let Q : ModelLaw k dx dz L pi0 sigma0 := ⟨P, hP, hM⟩ have hKne : summaryClosure k dx dz L pi0 sigma0 ≠ ∅ := by intro he have hmem : Q.summary ∈ summaryClosure k dx dz L pi0 sigma0 := subset_closure ⟨Q, rfl⟩ rw [he] at hmem exact hmem have hrepair (sample : Fin n → Obs dx dz) : AtomicLaw.LawModulo.wass1 (summaryRepair R sample) (quotientLaw P hM) ≤ 2 * Cmod * dS (empSummary sample) (obsSummary P) := by have hnear := (R.nearest (empSummary sample) hKne).2 Q.summary (subset_closure ⟨Q, rfl⟩) have htri := dS_triangle (R.Pi (empSummary sample)) (empSummary sample) Q.summary have hdist : dS (R.Pi (empSummary sample)) Q.summary ≤ 2 * dS (empSummary sample) Q.summary := by rw [dS_symm Q.summary (empSummary sample)] at hnear linarith have hqmem := (R.nearest (empSummary sample) hKne).1 have hLip := hRlip ⟨R.Pi (empSummary sample), hqmem⟩ ⟨Q.summary, subset_closure ⟨Q, rfl⟩⟩ have hrepairEq : summaryRepair R sample = R.Fbar ⟨R.Pi (empSummary sample), hqmem⟩ := by simp [summaryRepair, hKne] rw [hrepairEq] have hLip' : AtomicLaw.LawModulo.wass1 (R.Fbar ⟨R.Pi (empSummary sample), hqmem⟩) (quotientLaw P hM) ≤ Cmod * dS (R.Pi (empSummary sample)) Q.summary := by simpa only [R.extendsOnModel Q] using hLip exact hLip'.trans (by calc Cmod * dS (R.Pi (empSummary sample)) Q.summary ≤ Cmod * (2 * dS (empSummary sample) Q.summary) := mul_le_mul_of_nonneg_left hdist hCmod.le _ = 2 * Cmod * dS (empSummary sample) Q.summary := by ring) have hClat_le : 2 * ClatTail ≤ C := le_max_left _ _ have hC0_le : 2 * C0 ≤ C := le_trans (le_max_left _ _) (le_max_right _ _) have hrepairCoef : 4 * Cmod * C0 * L ≤ C := le_trans (le_max_right _ _) (le_max_right _ _) have threshold_mono (B : ℝ) (hB : 0 < B) (h2B : 2 * B ≤ C) : B * sqrt (log (B / (eta / 2)) / n) ≤ C * sqrt (log (C / eta) / n) := by have hBC : B ≤ C := le_trans (le_mul_of_one_le_left hB.le (by norm_num)) h2B have hratio : B / (eta / 2) ≤ C / eta := by calc B / (eta / 2) = (2 * B) / eta := by field_simp _ ≤ C / eta := div_le_div_of_nonneg_right h2B heta.le have hlog : log (B / (eta / 2)) ≤ log (C / eta) := Real.log_le_log (div_pos hB heta2) hratio have hsqrt : sqrt (log (B / (eta / 2)) / (n : ℝ)) ≤ sqrt (log (C / eta) / (n : ℝ)) := by apply Real.sqrt_le_sqrt exact div_le_div_of_nonneg_right hlog (Nat.cast_nonneg n) exact mul_le_mul hBC hsqrt (Real.sqrt_nonneg _) hC.le have hAthreshold := threshold_mono ClatTail hClatTail hClat_le have hSthreshold : 2 * Cmod * (C0 * L * sqrt (log (C0 / (eta / 2)) / n)) ≤ C * sqrt (log (C / eta) / n) := by have hC0pos : 0 < C0 := lt_of_lt_of_le (by norm_num) hC0 have hratio : C0 / (eta / 2) ≤ C / eta := by calc C0 / (eta / 2) = (2 * C0) / eta := by field_simp _ ≤ C / eta := div_le_div_of_nonneg_right hC0_le heta.le have hlog : log (C0 / (eta / 2)) ≤ log (C / eta) := Real.log_le_log (div_pos hC0pos heta2) hratio have hsqrt : sqrt (log (C0 / (eta / 2)) / (n : ℝ)) ≤ sqrt (log (C / eta) / (n : ℝ)) := by apply Real.sqrt_le_sqrt exact div_le_div_of_nonneg_right hlog (Nat.cast_nonneg n) have hcoef : 2 * Cmod * C0 * L ≤ C := by calc 2 * Cmod * C0 * L ≤ 4 * Cmod * C0 * L := by have hx : 0 ≤ Cmod * C0 * L := by positivity nlinarith _ ≤ C := hrepairCoef calc 2 * Cmod * (C0 * L * sqrt (log (C0 / (eta / 2)) / n)) = (2 * Cmod * C0 * L) * sqrt (log (C0 / (eta / 2)) / n) := by ring _ ≤ C * sqrt (log (C / eta) / n) := mul_le_mul hcoef hsqrt (Real.sqrt_nonneg _) (by positivity) have hsubset : {sample | max (AtomicLaw.LawModulo.wass1 (A.estimate sample) (quotientLaw P hM)) (AtomicLaw.LawModulo.wass1 (summaryRepair R sample) (quotientLaw P hM)) > C * sqrt (log (C / eta) / n)} ⊆ {sample | ClatTail * sqrt (log (ClatTail / (eta / 2)) / n) < AtomicLaw.LawModulo.wass1 (A.estimate sample) (quotientLaw P hM)} ∪ {sample | C0 * L * sqrt (log (C0 / (eta / 2)) / n) < dS (empSummary sample) (obsSummary P)} := by intro sample hs rw [Set.mem_union] by_cases ha : ClatTail * sqrt (log (ClatTail / (eta / 2)) / n) < AtomicLaw.LawModulo.wass1 (A.estimate sample) (quotientLaw P hM) · exact Or.inl ha · right have hmax : C * sqrt (log (C / eta) / n) < AtomicLaw.LawModulo.wass1 (summaryRepair R sample) (quotientLaw P hM) := by have haC : AtomicLaw.LawModulo.wass1 (A.estimate sample) (quotientLaw P hM) ≤ C * sqrt (log (C / eta) / n) := (le_of_not_gt ha).trans hAthreshold exact lt_of_not_ge fun hrle => (not_lt_of_ge (max_le haC hrle)) hs by_contra hsumm have hsummLe : dS (empSummary sample) (obsSummary P) ≤ C0 * L * sqrt (log (C0 / (eta / 2)) / n) := le_of_not_gt hsumm exact (not_lt_of_ge (hrepair sample |>.trans (mul_le_mul_of_nonneg_left hsummLe (by positivity)))) (lt_of_le_of_lt hSthreshold hmax) refine ⟨?_, hEmpty⟩ calc (sampleLaw (n := n) P).real {sample | max (AtomicLaw.LawModulo.wass1 (A.estimate sample) (quotientLaw P hM)) (AtomicLaw.LawModulo.wass1 (summaryRepair R sample) (quotientLaw P hM)) > C * sqrt (log (C / eta) / n)} ≤ (sampleLaw (n := n) P).real ({sample | ClatTail * sqrt (log (ClatTail / (eta / 2)) / n) < AtomicLaw.LawModulo.wass1 (A.estimate sample) (quotientLaw P hM)} ∪ {sample | C0 * L * sqrt (log (C0 / (eta / 2)) / n) < dS (empSummary sample) (obsSummary P)}) := measureReal_mono hsubset _ ≤ eta / 2 + eta / 2 := by exact (measureReal_union_le _ _).trans (add_le_add hAt hSt) _ = eta := by ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.collision_uniform_root_n · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TCollisionUniformRootN.lean:67
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.TFiniteNetLawEstimator 1 declarations
theorem finite_net_law_estimator Theorem 8 in the paper ↗

The advised class-dependent finite library is total and Borel, has the displayed polynomial size, and obeys the deterministic gap-free modulus bound. Its spectral output and operation count come from the same result-bearing exact-real primitive execution. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hsigma :
0 < sigma0
hsigmaMax :
sigma0 ≤ 1
∃ Cmod C : ℝ,
0 < Cmod
0 < C
conclusion 1
n :
1 ≤ n
∃ A : NetLibrary k dx dz n L pi0 sigma0,
∀ primitives : ExactRealPrimitives,
Measurable (netLawEstimator (n := n) primitives A) ∧
((@Fintype.card A.index A.finiteIndex : ℕ) : ℝ)
≤ C * rpow (n : ℝ) ((4 * dz * dx + dx : ℝ) / 2) ∧
(∀ sample : Fin n → Obs dx dz, ((netOperationCount primitives A sample).total : ℝ) ≤ C * (n + rpow (n : ℝ) ((4 * dz * dx + dx : ℝ) / 2)) ∧ (netExactRealProgram primitives A sample).trace = netSummaryTrace n dx dz ++ netSearchTrace A ++ match (netExactRealProgram primitives A sample).selected with | none => [] | some i => (exactRealSpectralRun primitives (A.summary i) (A.representative_feasible i)).trace) ∧
(∀ sample : Fin n → Obs dx dz, ∀ i, (netExactRealProgram primitives A sample).selected = some i → (∀ j, dS (A.summary i) (empSummary sample) ≤ dS (A.summary j) (empSummary sample)) ∧ (∀ j, dS (A.summary i) (empSummary sample) = dS (A.summary j) (empSummary sample) → A.lexRank i ≤ A.lexRank j) ∧ let run := exactRealSpectralRun primitives (A.summary i) (A.representative_feasible i) netLawEstimator primitives A sample = run.output.effectLaw ∧ (∀ t, Injective (toEuclideanLin (observedProxyMoment (A.summary i) t * run.output.basis.V))) ∧ (∀ j, pi0 * sigma0 ^ 2 / 2 ≤ singularValue (stackedProxyMoment (A.summary i)) j ↔ j < k) ∧ (∀ z : ℂ, MatrixEigenvalue (compressedOperator (A.summary i) run.output.basis run.output.spans) z → ∃ r, z = run.output.eigenvalue r)) ∧
(∀ i (H : RectMatrix (2 * dz) dx), ‖matrixCLM H‖ < pi0 * sigma0 ^ 2 / 2 → ThresholdRecoversMatrixDimension k (pi0 * sigma0 ^ 2 / 2) (stackedProxyMoment (A.summary i) + H)) ∧
(∀ i, ∃ Q : ModelLaw k dx dz L pi0 sigma0, Q.summary = A.summary i ∧ (exactRealSpectralRun primitives (A.summary i) (A.representative_feasible i)).output.effectLaw = by letI := Q.prob exact quotientLaw Q.P Q.model) ∧
(∀ i, AtomicLaw.Valid ((exactRealSpectralRun primitives (A.summary i) (A.representative_feasible i)).output.effectLaw.representative.1)) ∧
(∀ (P : Measure (FullData k dx dz)) (_hP : IsProbabilityMeasure P), letI := _hP (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) → ∀ sample : Fin n → Obs dx dz, AtomicLaw.LawModulo.wass1 (netLawEstimator primitives A sample) (quotientLaw P hM) ≤ Cmod * (2 * dS (empSummary sample) (obsSummary P) + (sqrt n)⁻¹)) ∧
∀ eta : ℝ,
TailLevelDomain eta → ∀ (P : Measure (FullData k dx dz)) (_hP : IsProbabilityMeasure P), letI
Proof (Lean source)
-- @node: thm:polynomial-net-law-estimator theorem finite_net_law_estimator (k dx dz : ℕ) (L pi0 sigma0 : ℝ) (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hpiMax : pi0 ≤ 1 / (2 * k : ℝ)) (hsigma : 0 < sigma0) (hsigmaMax : sigma0 ≤ 1) : ∃ Cmod C : ℝ, 0 < Cmod ∧ -- @realizes \(C_{\mathrm{mod}}\)(positive finite-net modulus constant) 0 < C ∧ -- @realizes \(C\)(positive finite-net complexity and tail constant) ∀ n : ℕ, 1 ≤ n → ∃ A : NetLibrary k dx dz n L pi0 sigma0, ∀ primitives : ExactRealPrimitives, Measurable (netLawEstimator (n := n) primitives A) ∧ ((@Fintype.card A.index A.finiteIndex : ℕ) : ℝ) ≤ C * rpow (n : ℝ) ((4 * dz * dx + dx : ℝ) / 2) ∧ (∀ sample : Fin n → Obs dx dz, ((netOperationCount primitives A sample).total : ℝ) ≤ C * (n + rpow (n : ℝ) ((4 * dz * dx + dx : ℝ) / 2)) ∧ (netExactRealProgram primitives A sample).trace = netSummaryTrace n dx dz ++ netSearchTrace A ++ match (netExactRealProgram primitives A sample).selected with | none => [] | some i => (exactRealSpectralRun primitives (A.summary i) (A.representative_feasible i)).trace) ∧ (∀ sample : Fin n → Obs dx dz, ∀ i, (netExactRealProgram primitives A sample).selected = some i → (∀ j, dS (A.summary i) (empSummary sample) ≤ dS (A.summary j) (empSummary sample)) ∧ (∀ j, dS (A.summary i) (empSummary sample) = dS (A.summary j) (empSummary sample) → A.lexRank i ≤ A.lexRank j) ∧ let run := exactRealSpectralRun primitives (A.summary i) (A.representative_feasible i) netLawEstimator primitives A sample = run.output.effectLaw ∧ (∀ t, Injective (toEuclideanLin (observedProxyMoment (A.summary i) t * run.output.basis.V))) ∧ (∀ j, pi0 * sigma0 ^ 2 / 2 ≤ singularValue (stackedProxyMoment (A.summary i)) j ↔ j < k) ∧ (∀ z : ℂ, MatrixEigenvalue (compressedOperator (A.summary i) run.output.basis run.output.spans) z → ∃ r, z = run.output.eigenvalue r)) ∧ (∀ i (H : RectMatrix (2 * dz) dx), ‖matrixCLM H‖ < pi0 * sigma0 ^ 2 / 2 → ThresholdRecoversMatrixDimension k (pi0 * sigma0 ^ 2 / 2) (stackedProxyMoment (A.summary i) + H)) ∧ (∀ i, ∃ Q : ModelLaw k dx dz L pi0 sigma0, Q.summary = A.summary i ∧ (exactRealSpectralRun primitives (A.summary i) (A.representative_feasible i)).output.effectLaw = by letI := Q.prob exact quotientLaw Q.P Q.model) ∧ (∀ i, AtomicLaw.Valid ((exactRealSpectralRun primitives (A.summary i) (A.representative_feasible i)).output.effectLaw.representative.1)) ∧ (∀ (P : Measure (FullData k dx dz)) (_hP : IsProbabilityMeasure P), letI := _hP (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) → ∀ sample : Fin n → Obs dx dz, AtomicLaw.LawModulo.wass1 (netLawEstimator primitives A sample) (quotientLaw P hM) ≤ Cmod * (2 * dS (empSummary sample) (obsSummary P) + (sqrt n)⁻¹)) ∧ ∀ eta : ℝ, TailLevelDomain eta → ∀ (P : Measure (FullData k dx dz)) (_hP : IsProbabilityMeasure P), letI := _hP (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) → (sampleLaw (n := n) P).real {sample | AtomicLaw.LawModulo.wass1 (netLawEstimator primitives A sample) (quotientLaw P hM) > C * sqrt (log (C / eta) / n)} ≤ eta := by obtain ⟨Cmod, hCmod, hmodel, _⟩ := gap_free_positive_measure_modulus k dx dz L pi0 sigma0 hk hkx hkz hL hpi hpiMax hsigma hsigmaMax obtain ⟨Ccard, hCcard, hcard⟩ := netLibrary_card_polynomial_bound k dx dz L pi0 sigma0 hk hkx hkz hL obtain ⟨Cwork, hCwork, hwork⟩ := netOperationCount_polynomial_bound k dx dz L pi0 sigma0 hk hkx hkz hL obtain ⟨C0, hC0, hconc⟩ := uniform_summary_concentration k dx dz pi0 sigma0 hk hkx hkz hpi hpiMax hsigma hsigmaMax let Ctail := max C0 (max (exp 1) (Cmod * (2 * C0 * L + 1))) let C := max Ccard (max Cwork Ctail) have hCtail : 0 < Ctail := lt_of_lt_of_le (Real.exp_pos 1) (le_trans (le_max_left _ _) (le_max_right _ _)) have hC : 0 < C := hCtail.trans_le ((le_max_right Cwork Ctail).trans (le_max_right Ccard (max Cwork Ctail))) refine ⟨Cmod, C, hCmod, hC, ?_⟩ intro n hn have hA : Nonempty (NetLibrary k dx dz n L pi0 sigma0) := by exact netLibrary_nonempty k dx dz n L pi0 sigma0 hk hkx hkz hL hpi hpiMax hsigma hsigmaMax hn obtain ⟨A⟩ := hA refine ⟨A, ?_⟩ intro primitives have hCcardLe : Ccard ≤ C := le_max_left _ _ have hCworkLe : Cwork ≤ C := (le_max_left _ _).trans (le_max_right _ _) have hrpow0 : 0 ≤ rpow (n : ℝ) ((4 * dz * dx + dx : ℝ) / 2) := Real.rpow_nonneg (Nat.cast_nonneg n) _ have hcardA : ((@Fintype.card A.index A.finiteIndex : ℕ) : ℝ) ≤ C * rpow (n : ℝ) ((4 * dz * dx + dx : ℝ) / 2) := (hcard n hn A).trans (mul_le_mul_of_nonneg_right hCcardLe hrpow0) refine ⟨netLawEstimator_measurable primitives A, hcardA, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ · intro sample have hs0 : 0 ≤ (n : ℝ) + rpow (n : ℝ) ((4 * dz * dx + dx : ℝ) / 2) := add_nonneg (Nat.cast_nonneg n) hrpow0 refine ⟨(hwork n hn primitives A sample).trans (mul_le_mul_of_nonneg_right hCworkLe hs0), ?_⟩ unfold netExactRealProgram split <;> simp · intro sample i hsel have hi := nearestLibraryIndex_spec A (empSummary sample) i (by rw [← netProgram_selected_eq_nearest primitives A sample] exact hsel) refine ⟨hi.1, hi.2, ?_⟩ let run := exactRealSpectralRun primitives (A.summary i) (A.representative_feasible i) change netLawEstimator primitives A sample = run.output.effectLaw ∧ (∀ t, Injective (toEuclideanLin (observedProxyMoment (A.summary i) t * run.output.basis.V))) ∧ (∀ j, pi0 * sigma0 ^ 2 / 2 ≤ singularValue (stackedProxyMoment (A.summary i)) j ↔ j < k) ∧ (∀ z : ℂ, MatrixEigenvalue (compressedOperator (A.summary i) run.output.basis run.output.spans) z → ∃ r, z = run.output.eigenvalue r) exact ⟨netLawEstimator_eq_of_selected primitives A sample i hsel, run.output.armwiseFullRank, run.output.thresholdRetainsExactlySignal, run.output.eigenvalue_complete⟩ · intro i H hH obtain ⟨Q, hQ⟩ := A.representative_feasible i rw [← hQ] exact modelSummary_thresholdRecovers_of_perturbation Q H hH · intro i exact exactRealSpectralRun_eq_quotient primitives (A.summary i) (A.representative_feasible i) · intro i exact exactRealSpectralRun_output_valid primitives (A.summary i) (A.representative_feasible i) · intro P hP letI := hP intro hM sample exact netEstimator_wass1_le primitives A hCmod.le hmodel P hP hM sample · intro eta hEta P hP rcases hEta with ⟨heta, hetaHalf⟩ letI := hP intro hM have hdev := (hconc L n hL hn P hP hM eta ⟨heta, hetaHalf⟩).1 have hCtailLe : Ctail ≤ C := (le_max_right Cwork Ctail).trans (le_max_right Ccard (max Cwork Ctail)) have hC0C : C0 ≤ C := (le_max_left _ _).trans hCtailLe have hexpC : exp 1 ≤ C := (le_trans (le_max_left _ _) (le_max_right _ _)).trans hCtailLe have hcoefC : Cmod * (2 * C0 * L + 1) ≤ C := (le_trans (le_max_right _ _) (le_max_right _ _)).trans hCtailLe have hC0pos : 0 < C0 := lt_of_lt_of_le zero_lt_one hC0 have hetaOne : eta ≤ 1 := by linarith have hratioExp : exp 1 ≤ C / eta := by rw [le_div_iff₀ heta] exact (mul_le_of_le_one_right (Real.exp_pos 1).le hetaOne).trans hexpC have hlogOne : 1 ≤ log (C / eta) := by rw [← Real.log_exp 1] exact Real.log_le_log (Real.exp_pos 1) hratioExp have hratio : C0 / eta ≤ C / eta := div_le_div_of_nonneg_right hC0C heta.le have hlog : log (C0 / eta) ≤ log (C / eta) := Real.log_le_log (div_pos hC0pos heta) hratio have hsqrt : sqrt (log (C0 / eta) / (n : ℝ)) ≤ sqrt (log (C / eta) / (n : ℝ)) := by apply Real.sqrt_le_sqrt exact div_le_div_of_nonneg_right hlog (Nat.cast_nonneg n) have hinv : (sqrt n)⁻¹ ≤ sqrt (log (C / eta) / (n : ℝ)) := by calc (sqrt n)⁻¹ = sqrt ((n : ℝ)⁻¹) := (Real.sqrt_inv _).symm _ = sqrt (1 / (n : ℝ)) := by rw [one_div] _ ≤ sqrt (log (C / eta) / (n : ℝ)) := by apply Real.sqrt_le_sqrt exact div_le_div_of_nonneg_right hlogOne (Nat.cast_nonneg n) have hsubset : {sample | AtomicLaw.LawModulo.wass1 (netLawEstimator primitives A sample) (quotientLaw P hM) > C * sqrt (log (C / eta) / n)} ⊆ {sample | C0 * L * sqrt (log (C0 / eta) / n) < dS (empSummary sample) (obsSummary P)} := by intro sample hs by_contra hgood have hdS : dS (empSummary sample) (obsSummary P) ≤ C0 * L * sqrt (log (C0 / eta) / n) := le_of_not_gt hgood have hw := netEstimator_wass1_le primitives A hCmod.le hmodel P hP hM sample have hbound : Cmod * (2 * dS (empSummary sample) (obsSummary P) + (sqrt n)⁻¹) ≤ C * sqrt (log (C / eta) / n) := by calc _ ≤ Cmod * (2 * (C0 * L * sqrt (log (C0 / eta) / n)) + (sqrt n)⁻¹) := mul_le_mul_of_nonneg_left (add_le_add (mul_le_mul_of_nonneg_left hdS (by norm_num)) (le_refl _)) hCmod.le _ ≤ Cmod * (2 * (C0 * L * sqrt (log (C / eta) / n)) + sqrt (log (C / eta) / n)) := by gcongr _ = (Cmod * (2 * C0 * L + 1)) * sqrt (log (C / eta) / n) := by ring _ ≤ C * sqrt (log (C / eta) / n) := mul_le_mul_of_nonneg_right hcoefC (Real.sqrt_nonneg _) exact (not_lt_of_ge (hw.trans hbound)) hs exact (measureReal_mono hsubset).trans hdev
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.finite_net_law_estimator · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TFiniteNetLawEstimator.lean:10
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.TGapFreePositiveMeasureModulus 1 declarations
theorem gap_free_positive_measure_modulus Theorem 1 in the paper ↗

Gap-free Lipschitz modulus for quotient effect laws and its positive-law continuous extension. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hsigma :
0 < sigma0
hsigmaMax :
sigma0 ≤ 1
∃ Cmod : ℝ,
0 < Cmod
conclusion 1
P Q :
ModelLaw k dx dz L pi0 sigma0
AtomicLaw.LawModulo.wass1 (by letI := P.prob; exact quotientLaw P.P P.model) (by letI := Q.prob; exact quotientLaw Q.P Q.model)
≤ Cmod * dS P.summary Q.summary
conclusion 2
∃ Fbar : {q // q ∈ summaryClosure k dx dz L pi0 sigma0} → AtomicLaw.LawModulo k (effectRadius dz L sigma0),
q q' :
AtomicLaw.LawModulo.wass1 (Fbar q) (Fbar q') ≤ Cmod * dS q.1 q'.1
Q :
ModelLaw k dx dz L pi0 sigma0
Fbar ⟨Q.summary, subset_closure ⟨Q, rfl⟩⟩
= by letI := Q.prob exact quotientLaw Q.P Q.model
Gbar :
{q // q ∈ summaryClosure k dx dz L pi0 sigma0} → AtomicLaw.LawModulo k (effectRadius dz L sigma0)
(∀ q q', AtomicLaw.LawModulo.wass1 (Gbar q) (Gbar q') ≤ Cmod * dS q.1 q'.1)
(∀ Q : ModelLaw k dx dz L pi0 sigma0, Gbar ⟨Q.summary, subset_closure ⟨Q, rfl⟩⟩ = by letI := Q.prob exact quotientLaw Q.P Q.model)
q :
Gbar q = Fbar q
Proof (Lean source)
-- @node: thm:gap-free-positive-measure-modulus theorem gap_free_positive_measure_modulus (k dx dz : ℕ) (L pi0 sigma0 : ℝ) (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hpiMax : pi0 ≤ 1 / (2 * k : ℝ)) (hsigma : 0 < sigma0) (hsigmaMax : sigma0 ≤ 1) : ∃ Cmod : ℝ, 0 < Cmod ∧ -- @realizes \(C_{\mathrm{mod}}\)(positive modulus constant) (∀ (P Q : ModelLaw k dx dz L pi0 sigma0), AtomicLaw.LawModulo.wass1 (by letI := P.prob; exact quotientLaw P.P P.model) (by letI := Q.prob; exact quotientLaw Q.P Q.model) ≤ Cmod * dS P.summary Q.summary) ∧ ∃ Fbar : {q // q ∈ summaryClosure k dx dz L pi0 sigma0} → AtomicLaw.LawModulo k (effectRadius dz L sigma0), Continuous Fbar ∧ Measurable Fbar ∧ (∀ q q', AtomicLaw.LawModulo.wass1 (Fbar q) (Fbar q') ≤ Cmod * dS q.1 q'.1) ∧ (∀ Q : ModelLaw k dx dz L pi0 sigma0, Fbar ⟨Q.summary, subset_closure ⟨Q, rfl⟩⟩ = by letI := Q.prob exact quotientLaw Q.P Q.model) ∧ ∀ Gbar : {q // q ∈ summaryClosure k dx dz L pi0 sigma0} → AtomicLaw.LawModulo k (effectRadius dz L sigma0), Continuous Gbar → (∀ q q', AtomicLaw.LawModulo.wass1 (Gbar q) (Gbar q') ≤ Cmod * dS q.1 q'.1) → (∀ Q : ModelLaw k dx dz L pi0 sigma0, Gbar ⟨Q.summary, subset_closure ⟨Q, rfl⟩⟩ = by letI := Q.prob exact quotientLaw Q.P Q.model) → ∀ q, Gbar q = Fbar q := by let kappa := conditionBound dx k L sigma0 let Cbase := kappa * effectRadius dz L sigma0 + L * ((dx : ℝ) ^ 2 * kappa ^ 2) * (3 * (pi0 * sigma0 ^ 2)⁻¹ ^ 2 * L + (pi0 * sigma0 ^ 2)⁻¹) let Cmod := Cbase + 1 have hkappa : 0 ≤ kappa := conditionBound_nonneg dx k (by linarith) hsigma have hCbase : 0 ≤ Cbase := by dsimp [Cbase] have hradius : 0 ≤ effectRadius dz L sigma0 := by unfold effectRadius; positivity positivity have hCmod : 0 < Cmod := by dsimp [Cmod]; linarith have hmodel : ∀ (P Q : ModelLaw k dx dz L pi0 sigma0), AtomicLaw.LawModulo.wass1 (by letI := P.prob; exact quotientLaw P.P P.model) (by letI := Q.prob; exact quotientLaw Q.P Q.model) ≤ Cmod * dS P.summary Q.summary := by intro P Q letI hPprob := P.prob letI hQprob := Q.prob obtain ⟨DP, hkP, hRP, hrepP⟩ := model_realDiagonalization_certificate P.P hk hkx hkz hL hpi hpiMax hsigma hsigmaMax P.model obtain ⟨DQ, hkQ, hRQ, hrepQ⟩ := model_realDiagonalization_certificate Q.P hk hkx hkz hL hpi hpiMax hsigma hsigmaMax Q.model have hraw := AmbientOperatorBridge.modelLaw_wass1_le_dS_of_certificates hk hkx hkz hL hpi hpiMax hsigma hsigmaMax P Q DP DQ hrepP hrepQ hkappa hkP hkQ hRP hRQ calc _ ≤ Cbase * dS P.summary Q.summary := by simpa [Cbase, kappa] using hraw _ ≤ Cmod * dS P.summary Q.summary := by have hdS : 0 ≤ dS P.summary Q.summary := by unfold dS; positivity gcongr dsimp [Cmod] linarith let s := admissibleImage k dx dz L pi0 sigma0 let f : s → AtomicLaw.LawModulo k (effectRadius dz L sigma0) := publishedQuotientFunctional k dx dz L pi0 sigma0 have hf_model (Q : ModelLaw k dx dz L pi0 sigma0) : f ⟨Q.summary, by exact ⟨Q, rfl⟩⟩ = by letI := Q.prob exact quotientLaw Q.P Q.model := by let R : ModelLaw k dx dz L pi0 sigma0 := Classical.choose (show Q.summary ∈ s by exact ⟨Q, rfl⟩) have hRsummary : R.summary = Q.summary := Classical.choose_spec (show Q.summary ∈ s by exact ⟨Q, rfl⟩) have hw := hmodel R Q have hzero : AtomicLaw.LawModulo.wass1 (by letI := R.prob; exact quotientLaw R.P R.model) (by letI := Q.prob; exact quotientLaw Q.P Q.model) = 0 := by apply le_antisymm · simpa [hRsummary] using hw · exact AtomicLaw.LawModulo.wass1_nonneg _ _ apply AtomicLaw.LawModulo.eq_of_wass1_eq_zero simpa [f, publishedQuotientFunctional, R] using hzero have hf_control : ∀ x y : s, dist (f x) (f y) ≤ Cmod * dS x.1 y.1 := by intro x y let P : ModelLaw k dx dz L pi0 sigma0 := Classical.choose x.property let Q : ModelLaw k dx dz L pi0 sigma0 := Classical.choose y.property have hP : P.summary = x.1 := Classical.choose_spec x.property have hQ : Q.summary = y.1 := Classical.choose_spec y.property simpa [AtomicLaw.LawModulo.dist_eq_wass1, f, publishedQuotientFunctional, P, Q, hP, hQ] using hmodel P Q let A : ℝ := 4 * entryNormConstant dz dx + dx have hA : 0 ≤ A := by dsimp [A] have hdx0 : (0 : ℝ) ≤ dx := Nat.cast_nonneg dx nlinarith [entryNormConstant_nonneg dz dx] let Kmetric : NNReal := ⟨Cmod * A, mul_nonneg hCmod.le hA⟩ have hf_metric : LipschitzWith Kmetric f := by apply LipschitzWith.of_dist_le_mul intro x y calc dist (f x) (f y) ≤ Cmod * dS x.1 y.1 := hf_control x y _ ≤ Cmod * (A * dist x y) := by gcongr exact dS_le_dist_mul x.1 y.1 _ = (Kmetric : ℝ) * dist x y := by change Cmod * (A * dist x y) = (Cmod * A) * dist x y ring obtain ⟨Fbar, hFcont, hFbound, hFext, hFunique⟩ := GapFreeClosureAssembly.exists_unique_extension_with_control s f dS hf_metric (dS_continuous dx dz) hf_control refine ⟨Cmod, hCmod, hmodel, Fbar, hFcont, hFcont.measurable, ?_, ?_, ?_⟩ · intro q q' simpa [AtomicLaw.LawModulo.dist_eq_wass1] using hFbound q q' · intro Q exact (hFext ⟨Q.summary, ⟨Q, rfl⟩⟩).trans (hf_model Q) · intro Gbar hGcont _hGlip hGmodel q apply hFunique Gbar hGcont intro x let Q : ModelLaw k dx dz L pi0 sigma0 := Classical.choose x.property have hQ : Q.summary = x.1 := Classical.choose_spec x.property have hGQ := hGmodel Q calc Gbar ⟨x.1, subset_closure x.property⟩ = Gbar ⟨Q.summary, subset_closure ⟨Q, rfl⟩⟩ := by congr 1 apply Subtype.ext exact hQ.symm _ = (by letI := Q.prob; exact quotientLaw Q.P Q.model) := hGQ _ = f ⟨Q.summary, ⟨Q, rfl⟩⟩ := (hf_model Q).symm _ = f x := by congr 1 apply Subtype.ext exact hQ
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.gap_free_positive_measure_modulus · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TGapFreePositiveMeasureModulus.lean:15
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.THonestRootNConfidence 7 declarations
theorem latentClass_real_eq_sum_cells

Latent class real eq sum cells: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
u :
Fin k
P.real (latentClass u) = ∑ t : Bool, P.real (latentCell u t)
Proof (Lean source)
lemma latentClass_real_eq_sum_cells {k dx dz : ℕ} (P : Measure (FullData k dx dz)) [IsFiniteMeasure P] (u : Fin k) : P.real (latentClass u) = ∑ t : Bool, P.real (latentCell u t) := by rw [show latentClass u = ⋃ t : Bool, latentCell u t by ext w simp [latentClass, latentCell]] apply measureReal_iUnion_fintype (h' := fun t => measure_ne_top P (latentCell u t)) · intro t s hts unfold onFun rw [Set.disjoint_left] intro w hwt hws exact hts (hwt.2.symm.trans hws.2) · exact fun t => measurableSet_latentCell u t
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.latentClass_real_eq_sum_cells · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/THonestRootNConfidence.lean:13
theorem latentMass_two_pi0_le

Latent mass two pi0 le: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
pi0 :
hpos :
LatentArmPositivity (pi0 := pi0) P
u :
Fin k
2 * pi0 ≤ latentMass P u
Proof (Lean source)
lemma latentMass_two_pi0_le {k dx dz : ℕ} {pi0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hpos : LatentArmPositivity (pi0 := pi0) P) (u : Fin k) : 2 * pi0 ≤ latentMass P u := by rw [latentMass, latentClass_real_eq_sum_cells P u, Fintype.sum_bool] simpa [two_mul] using add_le_add (hpos u true) (hpos u false)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.latentMass_two_pi0_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/THonestRootNConfidence.lean:29

Of measure equivalent: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k :
radius m :
AtomicLaw.ProbabilityLaw k radius
hab :
a.MeasureEquivalent b
hb :
AtomicLaw.AtomFloor m b.1
AtomicLaw.AtomFloor m a.1
Proof (Lean source)
lemma AtomicLaw.AtomFloor.of_measureEquivalent {k : ℕ} {radius m : ℝ} {a b : AtomicLaw.ProbabilityLaw k radius} (hab : a.MeasureEquivalent b) (hb : AtomicLaw.AtomFloor m b.1) : AtomicLaw.AtomFloor m a.1 := by classical intro x hx have hagg := hab.aggregate_weight x have hapos : 0 < ∑ i with a.1.atom i = x, a.1.weight i := by rcases Finset.mem_image.mp hx with ⟨i, hi, rfl⟩ have hi' := (Finset.mem_filter.mp hi).2 exact lt_of_lt_of_le hi' (Finset.single_le_sum (fun j _ => a.2.1 j) (Finset.mem_filter.mpr ⟨Finset.mem_univ i, rfl⟩)) have hbpos : 0 < ∑ i with b.1.atom i = x, b.1.weight i := by rwa [hagg] at hapos obtain ⟨i, hi, hipos⟩ := (Finset.sum_pos_iff_of_nonneg (fun i _ => b.2.1 i)).mp hbpos rw [hagg] apply hb x exact Finset.mem_image.mpr ⟨i, Finset.mem_filter.mpr ⟨Finset.mem_univ i, hipos⟩, (Finset.mem_filter.mp hi).2⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.AtomicLaw.AtomFloor.of_measureEquivalent · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/THonestRootNConfidence.lean:38
theorem quotientLaw_atomFloor

Quotient law atom floor: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hpi :
0 < pi0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
AtomicLaw.AtomFloor pi0 (quotientLaw P hM).representative.1
Proof (Lean source)
lemma quotientLaw_atomFloor {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hpi : 0 < pi0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) : AtomicLaw.AtomFloor pi0 (quotientLaw P hM).representative.1 := by let raw : AtomicLaw.ProbabilityLaw k (effectRadius dz L sigma0) := ⟨quotientLawRaw P (effectRadius dz L sigma0), quotientLawRaw_valid P hM⟩ have hraw : AtomicLaw.AtomFloor pi0 raw.1 := by intro x hx rcases Finset.mem_image.mp hx with ⟨u, hu, rfl⟩ have huPos := (Finset.mem_filter.mp hu).2 have hmass := latentMass_two_pi0_le P hM.latentArmPositivity u calc pi0 ≤ latentMass P u := by linarith _ ≤ ∑ i with raw.1.atom i = raw.1.atom u, raw.1.weight i := Finset.single_le_sum (fun i _ => raw.2.1 i) (Finset.mem_filter.mpr ⟨Finset.mem_univ u, rfl⟩) apply hraw.of_measureEquivalent exact (Quotient.eq_mk_iff_out (x := quotientLaw P hM) (y := raw)).mp rfl
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.quotientLaw_atomFloor · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/THonestRootNConfidence.lean:62

For the supplied parameters, wass Diameter is given by its defining clause.

Definition (Lean source)
k :
radius :
C :
Set (AtomicLaw.LawModulo k radius)
wassDiameter C :
sSup {d | ∃ x ∈ C, ∃ y ∈ C, d = AtomicLaw.LawModulo.wass1 x y}
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.wassDiameter · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/THonestRootNConfidence.lean:83
theorem summaryRepair_with_modulus

Summary repair with modulus: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 Cmod :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hsigma :
0 < sigma0
hsigmaMax :
sigma0 ≤ 1
Fbar :
{q // q ∈ summaryClosure k dx dz L pi0 sigma0} → AtomicLaw.LawModulo k (effectRadius dz L sigma0)
hFcont :
hFlip :
∀ q q', AtomicLaw.LawModulo.wass1 (Fbar q) (Fbar q') ≤ Cmod * dS q.1 q'.1
hFext :
∀ Q : ModelLaw k dx dz L pi0 sigma0,
Fbar ⟨Q.summary, subset_closure ⟨Q, rfl⟩⟩
= by letI := Q.prob exact quotientLaw Q.P Q.model
∃ R : SummaryRepairData k dx dz n L pi0 sigma0,
∀ q q', AtomicLaw.LawModulo.wass1 (R.Fbar q) (R.Fbar q') ≤ Cmod * dS q.1 q'.1
Proof (Lean source)
lemma summaryRepair_with_modulus (k dx dz n : ℕ) (L pi0 sigma0 Cmod : ℝ) (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hpiMax : pi0 ≤ 1 / (2 * k : ℝ)) (hsigma : 0 < sigma0) (hsigmaMax : sigma0 ≤ 1) (Fbar : {q // q ∈ summaryClosure k dx dz L pi0 sigma0} → AtomicLaw.LawModulo k (effectRadius dz L sigma0)) (hFcont : Continuous Fbar) (hFlip : ∀ q q', AtomicLaw.LawModulo.wass1 (Fbar q) (Fbar q') ≤ Cmod * dS q.1 q'.1) (hFext : ∀ Q : ModelLaw k dx dz L pi0 sigma0, Fbar ⟨Q.summary, subset_closure ⟨Q, rfl⟩⟩ = by letI := Q.prob exact quotientLaw Q.P Q.model) : ∃ R : SummaryRepairData k dx dz n L pi0 sigma0, ∀ q q', AtomicLaw.LawModulo.wass1 (R.Fbar q) (R.Fbar q') ≤ Cmod * dS q.1 q'.1 := by let K := summaryClosure k dx dz L pi0 sigma0 have hKc : IsCompact K := (summary_closure_compact k dx dz L pi0 sigma0 hk hkx hkz hL hpi hpiMax hsigma hsigmaMax).2.1 have hkp : 0 < k := by omega have hradius : 0 ≤ effectRadius dz L sigma0 := by unfold effectRadius; positivity by_cases he : K = ∅ · let R : SummaryRepairData k dx dz n L pi0 sigma0 := { k_pos := hkp, radius_nonneg := hradius, Fbar := Fbar, Pi := fun _ => 0 continuousFbar := hFcont, extendsOnModel := hFext, measurablePi := measurable_const nearest := by intro s hne; exact elim (hne (by simpa [K] using he)) empty_fallback := by intro _ s; rfl measurableRepair := by have he' : summaryClosure k dx dz L pi0 sigma0 = ∅ := by simpa [K] using he simp only [he', dite_true] exact measurable_const } exact ⟨R, hFlip⟩ · have hne : K.Nonempty := nonempty_iff_ne_empty.mpr he let d := card (SummaryRepairCoordIndex dx dz) let e : SummarySpace dx dz ≃ₜ Euc d := (summaryRepairSpaceHomeomorph dx dz).trans (euclideanReindexHomeomorph (Fintype.equivFin (SummaryRepairCoordIndex dx dz))) obtain ⟨Pi, hPm, hPK, hPmin⟩ := compactLoss_selector_of_homeomorph d e K hne hKc dS (dS_continuous dx dz) let R : SummaryRepairData k dx dz n L pi0 sigma0 := { k_pos := hkp, radius_nonneg := hradius, Fbar := Fbar, Pi := Pi continuousFbar := hFcont, extendsOnModel := hFext, measurablePi := hPm nearest := fun s _ => ⟨hPK s, hPmin s⟩ empty_fallback := by intro hs; exact elim (he (by simpa [K] using hs)) measurableRepair := by have he' : summaryClosure k dx dz L pi0 sigma0 ≠ ∅ := by simpa [K] using he simp only [he', dite_false] have hsubmem : ∀ s, Pi s ∈ summaryClosure k dx dz L pi0 sigma0 := by intro s simpa [K] using hPK s have hsub : Measurable (fun s => (⟨Pi s, hsubmem s⟩ : {q // q ∈ summaryClosure k dx dz L pi0 sigma0})) := hPm.subtype_mk simpa [Function.comp_def] using hFcont.measurable.comp (hsub.comp empSummary_measurable) } exact ⟨R, hFlip⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summaryRepair_with_modulus · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/THonestRootNConfidence.lean:89
theorem honest_root_n_confidence Theorem 3 in the paper ↗

Simultaneous honesty and the two separate root-n diameter bounds, without asserting an equality or inclusion between the confidence sets. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hsigma :
0 < sigma0
hsigmaMax :
sigma0 ≤ 1
∃ (C0 : ℝ) (hC0 : ConcentrationConstantDomain C0),
∀ L : ℝ,
(hL : 1 ≤ L) → ∃ (Cmod : ℝ) (hClat : 0 < prescribedLatticeConstant k dx dz L pi0 sigma0) (_hCmod : 0 < Cmod), ∀ n : ℕ, (hn : 1 ≤ n) → ∃ (A : LatticeEstimator k dx dz n (effectRadius dz L sigma0)) (R : SummaryRepairData k dx dz n L pi0 sigma0) (hA : IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A), ∀ alpha : ℝ, (hAlpha : MiscoverageDomain alpha) → (∀ sample, let CS := confidenceSets R A hA sample alpha C0 (prescribedLatticeConstant k dx dz L pi0 sigma0) (by omega) hAlpha.1 hAlpha.2 hC0 hL hpi hpiMax hClat CS.Ctheory.Nonempty ∧ CS.Calg.Nonempty ∧ CalgHasConstrainedRepresentation CS (latticeLaw A sample)) ∧ (∀ (P : Measure (FullData k dx dz)) (_hP : IsProbabilityMeasure P), letI := _hP (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) → (1 - alpha ≤ (sampleLaw (n := n) P).real {sample | let CS := confidenceSets R A hA sample alpha C0 (prescribedLatticeConstant k dx dz L pi0 sigma0) (by omega) hAlpha.1 hAlpha.2 hC0 hL hpi hpiMax hClat quotientLaw P hM ∈ CS.Ctheory ∩ CS.Calg})) ∧ ∀ sample, let CS := confidenceSets R A hA sample alpha C0 (prescribedLatticeConstant k dx dz L pi0 sigma0) (by omega) hAlpha.1 hAlpha.2 hC0 hL hpi hpiMax hClat wassDiameter CS.Ctheory
≤ 4 * Cmod * summaryRadius n alpha C0 L ∧ wassDiameter CS.Calg ≤ 2 * CS.Ralpha
Proof (Lean source)
-- @node: thm:honest-root-n-confidence theorem honest_root_n_confidence (k dx dz : ℕ) (pi0 sigma0 : ℝ) (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hpi : 0 < pi0) (hpiMax : pi0 ≤ 1 / (2 * k : ℝ)) (hsigma : 0 < sigma0) (hsigmaMax : sigma0 ≤ 1) : ∃ (C0 : ℝ) (hC0 : ConcentrationConstantDomain C0), ∀ L : ℝ, (hL : 1 ≤ L) → ∃ (Cmod : ℝ) (hClat : 0 < prescribedLatticeConstant k dx dz L pi0 sigma0) (_hCmod : 0 < Cmod), ∀ n : ℕ, (hn : 1 ≤ n) → ∃ (A : LatticeEstimator k dx dz n (effectRadius dz L sigma0)) (R : SummaryRepairData k dx dz n L pi0 sigma0) (hA : IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A), ∀ alpha : ℝ, (hAlpha : MiscoverageDomain alpha) → (∀ sample, let CS := confidenceSets R A hA sample alpha C0 (prescribedLatticeConstant k dx dz L pi0 sigma0) (by omega) hAlpha.1 hAlpha.2 hC0 hL hpi hpiMax hClat CS.Ctheory.Nonempty ∧ CS.Calg.Nonempty ∧ CalgHasConstrainedRepresentation CS (latticeLaw A sample)) ∧ (∀ (P : Measure (FullData k dx dz)) (_hP : IsProbabilityMeasure P), letI := _hP (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) → (1 - alpha ≤ (sampleLaw (n := n) P).real {sample | let CS := confidenceSets R A hA sample alpha C0 (prescribedLatticeConstant k dx dz L pi0 sigma0) (by omega) hAlpha.1 hAlpha.2 hC0 hL hpi hpiMax hClat quotientLaw P hM ∈ CS.Ctheory ∩ CS.Calg})) ∧ ∀ sample, let CS := confidenceSets R A hA sample alpha C0 (prescribedLatticeConstant k dx dz L pi0 sigma0) (by omega) hAlpha.1 hAlpha.2 hC0 hL hpi hpiMax hClat wassDiameter CS.Ctheory ≤ 4 * Cmod * summaryRadius n alpha C0 L ∧ wassDiameter CS.Calg ≤ 2 * CS.Ralpha := by obtain ⟨C0, hC0, hconc⟩ := uniform_summary_concentration k dx dz pi0 sigma0 hk hkx hkz hpi hpiMax hsigma hsigmaMax refine ⟨C0, hC0, ?_⟩ intro L hL obtain ⟨Cmod, hCmod, hmodel, Fbar, hFcont, hFmeas, hFlip, hFext, hFuniq⟩ := gap_free_positive_measure_modulus k dx dz L pi0 sigma0 hk hkx hkz hL hpi hpiMax hsigma hsigmaMax obtain ⟨Ctail, hClat, hCtail, hlattice⟩ := polynomial_lattice_law_estimator k dx dz L pi0 sigma0 hk hkx hkz hL hpi hpiMax hsigma hsigmaMax refine ⟨Cmod, hClat, hCmod, ?_⟩ intro n hn obtain ⟨A, hAstruct, hAfloor, hAsummaryMeas, hAeval, hAfloorAll, hAthreshold, hAcount, hAops, hAdet, hAtail⟩ := hlattice n hn obtain ⟨R, hRlip⟩ := summaryRepair_with_modulus k dx dz n L pi0 sigma0 Cmod hk hkx hkz hL hpi hpiMax hsigma hsigmaMax Fbar hFcont hFlip hFext refine ⟨A, R, hAstruct, ?_⟩ intro alpha hAlpha obtain ⟨halpha, halphaMax⟩ := hAlpha have hnpos : 0 < n := by omega let Clat := prescribedLatticeConstant k dx dz L pi0 sigma0 have hrpos : 0 < summaryRadius n alpha C0 L := summaryRadius_pos n alpha C0 L hnpos halpha halphaMax hC0 hL have theory_nonempty (sample : Fin n → Obs dx dz) : (theoreticalConfidenceSet R sample alpha C0).Nonempty := by by_cases hK : summaryClosure k dx dz L pi0 sigma0 = ∅ · rw [theoreticalConfidenceSet, if_pos hK] exact singleton_nonempty _ · rw [theoreticalConfidenceSet, if_neg hK] let q : {q // q ∈ summaryClosure k dx dz L pi0 sigma0} := ⟨R.Pi (empSummary sample), (R.nearest _ hK).1⟩ refine ⟨R.Fbar q, q, ?_, rfl⟩ have hz : 0 ≤ 2 * summaryRadius n alpha C0 L := by positivity simpa [q, dS, matrixCLM] using hz have calg_nonempty (sample : Fin n → Obs dx dz) : (confidenceSets R A hAstruct sample alpha C0 Clat hnpos halpha halphaMax hC0 hL hpi hpiMax hClat).Calg.Nonempty := by refine ⟨latticeLaw A sample, ?_⟩ simp only [confidenceSets, Set.mem_setOf_eq] exact ⟨by simpa [latticeLaw] using hAfloorAll sample, (AtomicLaw.LawModulo.wass1_self _).le.trans (confidenceRadius_pos hnpos halpha halphaMax hC0 hL hClat).le⟩ constructor · intro sample let CS := confidenceSets R A hAstruct sample alpha C0 Clat hnpos halpha halphaMax hC0 hL hpi hpiMax hClat exact ⟨theory_nonempty sample, calg_nonempty sample, confidenceSets_constrainedRepresentation R A hAstruct sample alpha C0 Clat hnpos halpha halphaMax hC0 hL hpi hpiMax hClat⟩ constructor · intro P hP letI := hP intro hM let Q : ModelLaw k dx dz L pi0 sigma0 := ⟨P, hP, hM⟩ have hKne : summaryClosure k dx dz L pi0 sigma0 ≠ ∅ := by intro hK have hmem : Q.summary ∈ summaryClosure k dx dz L pi0 sigma0 := subset_closure ⟨Q, rfl⟩ rw [hK] at hmem exact hmem let bad : Set (Fin n → Obs dx dz) := {sample | summaryRadius n alpha C0 L < dS (empSummary sample) (obsSummary P)} have hbad : (sampleLaw (n := n) P).real bad ≤ alpha := by simpa [bad, summaryRadius] using (hconc L n hL hn P hP hM alpha ⟨halpha, halphaMax⟩).1 have hbadMeas : MeasurableSet bad := by apply measurableSet_lt measurable_const have hc : Continuous (fun s : SummarySpace dx dz => dS s (obsSummary P)) := (dS_continuous dx dz).uncurry_right (obsSummary P) exact hc.measurable.comp empSummary_measurable have hgood : badᶜ ⊆ {sample | let CS := confidenceSets R A hAstruct sample alpha C0 Clat hnpos halpha halphaMax hC0 hL hpi hpiMax hClat quotientLaw P hM ∈ CS.Ctheory ∩ CS.Calg} := by intro sample hs have hd : dS (empSummary sample) (obsSummary P) ≤ summaryRadius n alpha C0 L := le_of_not_gt hs constructor · change quotientLaw P hM ∈ theoreticalConfidenceSet R sample alpha C0 rw [theoreticalConfidenceSet, if_neg hKne] refine ⟨⟨Q.summary, subset_closure ⟨Q, rfl⟩⟩, ?_, ?_⟩ · have hnear := (R.nearest (empSummary sample) hKne).2 Q.summary (subset_closure ⟨Q, rfl⟩) have hnear' : dS (empSummary sample) (R.Pi (empSummary sample)) ≤ dS (empSummary sample) Q.summary := by calc dS (empSummary sample) (R.Pi (empSummary sample)) = dS (R.Pi (empSummary sample)) (empSummary sample) := dS_symm _ _ _ ≤ dS Q.summary (empSummary sample) := hnear _ = dS (empSummary sample) Q.summary := dS_symm _ _ have htri := dS_triangle Q.summary (empSummary sample) (R.Pi (empSummary sample)) have hnearR : dS (empSummary sample) (R.Pi (empSummary sample)) ≤ summaryRadius n alpha C0 L := hnear'.trans (by rw [show Q.summary = obsSummary P from rfl] exact hd) calc dS Q.summary (R.Pi (empSummary sample)) ≤ dS Q.summary (empSummary sample) + dS (empSummary sample) (R.Pi (empSummary sample)) := htri _ ≤ 2 * summaryRadius n alpha C0 L := by rw [show Q.summary = obsSummary P from rfl, dS_symm (obsSummary P) (empSummary sample)] linarith [hnearR] · exact (R.extendsOnModel Q).symm · simp only [confidenceSets, Set.mem_setOf_eq] constructor · exact quotientLaw_atomFloor P hpi hM · rw [AtomicLaw.LawModulo.wass1_comm] have hdet := hAdet P hP hM sample change AtomicLaw.LawModulo.wass1 (latticeLaw A sample) (quotientLaw P hM) ≤ _ rw [latticeLaw] exact hdet.trans (mul_le_mul_of_nonneg_left (add_le_add hd (le_refl _)) hClat.le) have hcompl : 1 - alpha ≤ (sampleLaw (n := n) P).real badᶜ := by rw [measureReal_compl hbadMeas] have hone : (sampleLaw (n := n) P).real univ = 1 := by simp [Measure.real] rw [hone] exact sub_le_sub_left hbad 1 exact hcompl.trans (measureReal_mono hgood) · intro sample let CS := confidenceSets R A hAstruct sample alpha C0 Clat hnpos halpha halphaMax hC0 hL hpi hpiMax hClat constructor · unfold wassDiameter apply csSup_le · obtain ⟨x, hx⟩ := theory_nonempty sample exact ⟨AtomicLaw.LawModulo.wass1 x x, x, hx, x, hx, rfl⟩ · rintro d ⟨x, hx, y, hy, rfl⟩ by_cases hK : summaryClosure k dx dz L pi0 sigma0 = ∅ · rw [show CS.Ctheory = {AtomicLaw.LawModulo.deltaZeroLaw R.k_pos R.radius_nonneg} by simp [CS, confidenceSets, theoreticalConfidenceSet, hK]] at hx hy rw [Set.mem_singleton_iff.mp hx, Set.mem_singleton_iff.mp hy, AtomicLaw.LawModulo.wass1_self] positivity · rw [show CS.Ctheory = theoreticalConfidenceSet R sample alpha C0 by rfl, theoreticalConfidenceSet, if_neg hK] at hx hy rcases hx with ⟨qx, hqx, rfl⟩ rcases hy with ⟨qy, hqy, rfl⟩ have hqy' : dS (R.Pi (empSummary sample)) qy.1 ≤ 2 * summaryRadius n alpha C0 L := by rw [dS_symm] exact hqy have hqdist : dS qx.1 qy.1 ≤ 4 * summaryRadius n alpha C0 L := by calc dS qx.1 qy.1 ≤ dS qx.1 (R.Pi (empSummary sample)) + dS (R.Pi (empSummary sample)) qy.1 := dS_triangle _ _ _ _ ≤ 4 * summaryRadius n alpha C0 L := by calc _ ≤ 2 * summaryRadius n alpha C0 L + 2 * summaryRadius n alpha C0 L := add_le_add hqx hqy' _ = 4 * summaryRadius n alpha C0 L := by ring exact (hRlip qx qy).trans (by calc Cmod * dS qx.1 qy.1 ≤ Cmod * (4 * summaryRadius n alpha C0 L) := mul_le_mul_of_nonneg_left hqdist hCmod.le _ = 4 * Cmod * summaryRadius n alpha C0 L := by ring) · unfold wassDiameter apply csSup_le · obtain ⟨x, hx⟩ := calg_nonempty sample exact ⟨AtomicLaw.LawModulo.wass1 x x, x, hx, x, hx, rfl⟩ · rintro d ⟨x, hx, y, hy, rfl⟩ have hx' := hx.2 have hy' := hy.2 calc AtomicLaw.LawModulo.wass1 x y ≤ AtomicLaw.LawModulo.wass1 x (latticeLaw A sample) + AtomicLaw.LawModulo.wass1 (latticeLaw A sample) y := AtomicLaw.LawModulo.wass1_triangle _ _ _ _ ≤ CS.Ralpha + CS.Ralpha := by rw [AtomicLaw.LawModulo.wass1_comm (latticeLaw A sample) y] exact add_le_add hx' hy' _ = 2 * CS.Ralpha := by ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.honest_root_n_confidence · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/THonestRootNConfidence.lean:148
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.TLabeledWeightUpper 1 declarations
theorem labeled_weight_upper Theorem 5 in the paper ↗

Uniform labeled-coordinate upper bound on the gap stratum; inverse-gap behavior is confined to ordered labels. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hsigma :
0 < sigma0
hsigmaMax :
sigma0 ≤ 1
∃ C : ℝ,
0 < C
conclusion 1
n :
1 ≤ n
∃ R : SummaryRepairData k dx dz n L pi0 sigma0, ∃ est : WeightEstimator k dx dz n,
g :
P :
Measure (FullData k dx dz)
letI
Proof (Lean source)
-- @node: thm:labeled-weight-upper theorem labeled_weight_upper (k dx dz : ℕ) (L pi0 sigma0 : ℝ) (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hpiMax : pi0 ≤ 1 / (2 * k : ℝ)) (hsigma : 0 < sigma0) (hsigmaMax : sigma0 ≤ 1) : ∃ C : ℝ, 0 < C ∧ -- @realizes \(C\)(positive labeled-risk upper constant) ∀ n : ℕ, 1 ≤ n → ∃ R : SummaryRepairData k dx dz n L pi0 sigma0, ∃ est : WeightEstimator k dx dz n, est.eval = orderedWeightEstimator R ∧ ∀ g : ℝ, GapScaleDomain g → ∀ (P : Measure (FullData k dx dz)) (_hP : IsProbabilityMeasure P), letI := _hP (hM : GapStratum (L := L) (pi0 := pi0) (sigma0 := sigma0) (g := g) P) → expectedWeightRisk P (orderedMasses (quotientLaw P hM.toUCVMWModel).representative.1) est ≤ C * min 1 (sqrt n * g)⁻¹ := by obtain ⟨Ctail, hCtail, htail⟩ := collision_uniform_root_n k dx dz L pi0 sigma0 hk hkx hkz hL hpi hpiMax hsigma hsigmaMax let A : ℝ := max Ctail 2 let B : ℝ := A * sqrt (log (2 * A)) + A ^ 2 * sqrt pi / 2 let K : ℝ := 8 + 16 / pi0 let C : ℝ := max 2 (K * B) have hA : 2 ≤ A := le_max_right _ _ have hApos : 0 < A := lt_of_lt_of_le (by norm_num) hA have hBpos : 0 < B := by dsimp [B] have hlog : 0 < log (2 * A) := Real.log_pos (by nlinarith) positivity have hKpos : 0 < K := by dsimp [K]; positivity have hC : 0 < C := lt_of_lt_of_le (by norm_num) (le_max_left _ _) refine ⟨C, hC, ?_⟩ intro n hn obtain ⟨Alat, R, _hAlat, _hAlatMeas, hRMeas, htailR⟩ := htail n hn let est : WeightEstimator k dx dz n := { eval := orderedWeightEstimator R measurable := orderedWeightEstimator_measurable R simplex := fun sample => orderedMasses_inSimplex (by omega) (summaryRepair R sample).representative.1 (summaryRepair R sample).representative.2 } refine ⟨R, est, rfl, ?_⟩ intro g hGap P hP obtain ⟨hg, _hgMax⟩ := hGap letI := hP intro hM have htargetEq : orderedMasses (quotientLaw P hM.toUCVMWModel).representative.1 = orderedMasses (quotientLawRaw P (effectRadius dz L sigma0)) := by let nu : AtomicLaw.ProbabilityLaw k (effectRadius dz L sigma0) := ⟨quotientLawRaw P (effectRadius dz L sigma0), quotientLawRaw_valid P hM.toUCVMWModel⟩ have hrel : (quotientLaw P hM.toUCVMWModel).representative.MeasureEquivalent nu := by change (AtomicLaw.probabilityLawSetoid k (effectRadius dz L sigma0)).r (quotientLaw P hM.toUCVMWModel).representative nu change (AtomicLaw.probabilityLawSetoid k (effectRadius dz L sigma0)).r (AtomicLaw.LawModulo.ofProbabilityLaw nu).representative nu exact (Quotient.eq_mk_iff_out (x := AtomicLaw.LawModulo.ofProbabilityLaw nu) (y := nu)).mp rfl exact orderedMasses_eq_of_measureEquivalent (quotientLaw P hM.toUCVMWModel).representative nu hrel rw [htargetEq] let Z : (Fin n → Obs dx dz) → ℝ := fun sample => AtomicLaw.LawModulo.wass1 (summaryRepair R sample) (quotientLaw P hM.toUCVMWModel) have htailA : ∀ eta : ℝ, 0 < eta → eta < 1 / 2 → (sampleLaw (n := n) P).real {sample | A * sqrt (log (A / eta) / n) < Z sample} ≤ eta := by intro eta heta hetaMax have hprob := htailR eta ⟨heta, hetaMax⟩ P hP hM.toUCVMWModel have hCA : Ctail ≤ A := le_max_left _ _ have hratio : Ctail / eta ≤ A / eta := div_le_div_of_nonneg_right hCA heta.le have hlog : log (Ctail / eta) ≤ log (A / eta) := Real.log_le_log (div_pos hCtail heta) hratio have hsqrt : sqrt (log (Ctail / eta) / (n : ℝ)) ≤ sqrt (log (A / eta) / (n : ℝ)) := by apply Real.sqrt_le_sqrt exact div_le_div_of_nonneg_right hlog (Nat.cast_nonneg n) have hthreshold : Ctail * sqrt (log (Ctail / eta) / (n : ℝ)) ≤ A * sqrt (log (A / eta) / (n : ℝ)) := mul_le_mul hCA hsqrt (Real.sqrt_nonneg _) hApos.le refine (measureReal_mono (μ := sampleLaw (n := n) P) ?_).trans hprob.1 intro sample hs exact lt_of_le_of_lt hthreshold (lt_of_lt_of_le hs (le_max_right _ _)) have hmean : (∫ sample, Z sample ∂sampleLaw (n := n) P) ≤ B / sqrt n := by exact integral_le_of_sqrt_log_tail (sampleLaw (n := n) P) Z (fun sample => lawModulo_wass1_nonneg _ _) A n hA hn htailA have htargetSimplex : InSimplex (orderedMasses (quotientLawRaw P (effectRadius dz L sigma0))) := orderedMasses_inSimplex (by omega) _ (quotientLawRaw_valid P hM.toUCVMWModel) have hWraw (sample : Fin n → Obs dx dz) : AtomicLaw.wass1 (quotientLawRaw P (effectRadius dz L sigma0)) (summaryRepair R sample).representative.1 = Z sample := by calc AtomicLaw.wass1 (quotientLawRaw P (effectRadius dz L sigma0)) (summaryRepair R sample).representative.1 = AtomicLaw.LawModulo.wass1 (quotientLaw P hM.toUCVMWModel) (AtomicLaw.LawModulo.ofProbabilityLaw (summaryRepair R sample).representative) := by rw [quotientLaw, AtomicLaw.LawModulo.wass1_ofProbabilityLaw] _ = AtomicLaw.LawModulo.wass1 (quotientLaw P hM.toUCVMWModel) (summaryRepair R sample) := by congr 1 exact Quotient.out_eq _ _ = Z sample := AtomicLaw.LawModulo.wass1_comm _ _ have hpoint (sample : Fin n → Obs dx dz) : ∑ i, |est.eval sample i - orderedMasses (quotientLawRaw P (effectRadius dz L sigma0)) i| ≤ K * Z sample / g := by have hZnn : 0 ≤ Z sample := lawModulo_wass1_nonneg _ _ by_cases hsmall : AtomicLaw.wass1 (quotientLawRaw P (effectRadius dz L sigma0)) (summaryRepair R sample).representative.1 < pi0 * (g / 2) / 4 · have hlocal := gapStratum_orderedMasses_l1_le P hM hg (summaryRepair R sample).representative.1 (summaryRepair R sample).representative.2 hsmall change ∑ i, |orderedWeightEstimator R sample i - orderedMasses (quotientLawRaw P (effectRadius dz L sigma0)) i| ≤ _ have h8K : (8 : ℝ) ≤ K := by have hnonneg : 0 ≤ 16 / pi0 := div_nonneg (by norm_num) hpi.le dsimp [K] linarith calc _ ≤ 8 * AtomicLaw.wass1 (quotientLawRaw P (effectRadius dz L sigma0)) (summaryRepair R sample).representative.1 / g := hlocal _ = 8 * Z sample / g := by rw [hWraw] _ ≤ K * Z sample / g := by gcongr · have hdiam := simplex_l1_le_two (est.simplex sample) htargetSimplex have hlarge : pi0 * (g / 2) / 4 ≤ Z sample := by rw [← hWraw] exact le_of_not_gt hsmall have htwo : (2 : ℝ) ≤ 16 / pi0 * Z sample / g := by rw [show 16 / pi0 * Z sample / g = 16 * Z sample / (pi0 * g) by field_simp] rw [le_div_iff₀ (mul_pos hpi hg)] nlinarith have hcoeff : 16 / pi0 ≤ K := by dsimp [K]; linarith exact hdiam.trans (htwo.trans (by gcongr)) have hZmeas : Measurable Z := by dsimp [Z] simpa [AtomicLaw.LawModulo.dist_eq_wass1] using hRMeas.dist (measurable_const : Measurable (fun _ : Fin n → Obs dx dz => quotientLaw P hM.toUCVMWModel)) have hradius : 0 ≤ effectRadius dz L sigma0 := by unfold effectRadius; positivity have hZint : Integrable Z (sampleLaw (n := n) P) := by apply (integrable_const (2 * effectRadius dz L sigma0)).mono hZmeas.aestronglyMeasurable filter_upwards with sample rw [Real.norm_eq_abs, abs_of_nonneg (lawModulo_wass1_nonneg _ _), Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (by norm_num) hradius)] exact AtomicLaw.LawModulo.wass1_le_two_radius hradius _ _ have hriskRate : expectedWeightRisk P (orderedMasses (quotientLawRaw P (effectRadius dz L sigma0))) est ≤ (K * B) * (sqrt n * g)⁻¹ := by unfold expectedWeightRisk calc (∫ sample, ∑ i, |est.eval sample i - orderedMasses (quotientLawRaw P (effectRadius dz L sigma0)) i| ∂sampleLaw (n := n) P) ≤ ∫ sample, K * Z sample / g ∂sampleLaw (n := n) P := by apply integral_mono_of_nonneg · filter_upwards with sample exact sum_nonneg fun _ _ => abs_nonneg _ · exact (hZint.const_mul K).div_const g · filter_upwards with sample exact hpoint sample _ = K * (∫ sample, Z sample ∂sampleLaw (n := n) P) / g := by rw [integral_div, integral_const_mul] _ ≤ K * (B / sqrt n) / g := by gcongr _ = (K * B) * (sqrt n * g)⁻¹ := by have hsqrtn : 0 < sqrt n := Real.sqrt_pos.2 (by exact_mod_cast (lt_of_lt_of_le Nat.zero_lt_one hn)) field_simp have hriskTwo : expectedWeightRisk P (orderedMasses (quotientLawRaw P (effectRadius dz L sigma0))) est ≤ 2 := by unfold expectedWeightRisk calc (∫ sample, ∑ i, |est.eval sample i - orderedMasses (quotientLawRaw P (effectRadius dz L sigma0)) i| ∂sampleLaw (n := n) P) ≤ ∫ _sample, (2 : ℝ) ∂sampleLaw (n := n) P := by apply integral_mono_of_nonneg · filter_upwards with sample exact sum_nonneg fun _ _ => abs_nonneg _ · exact integrable_const _ · filter_upwards with sample exact simplex_l1_le_two (est.simplex sample) htargetSimplex _ = 2 := by simp by_cases hrate : (sqrt n * g)⁻¹ ≤ 1 · rw [min_eq_right hrate] exact hriskRate.trans (mul_le_mul_of_nonneg_right (le_max_right _ _) (inv_nonneg.mpr (mul_nonneg (Real.sqrt_nonneg _) hg.le))) · rw [min_eq_left (le_of_not_ge hrate)] rw [mul_one] exact hriskTwo.trans (show (2 : ℝ) ≤ C from le_max_left _ _)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.labeled_weight_upper · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TLabeledWeightUpper.lean:8
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.TMatchingLocalLowerBounds 9 declarations
theorem eventProbability_mul_threshold_le_risk Lemma eventProbability_mul_threshold_le_risk in the paper ↗

A tail event for a nonnegative integrable loss gives a lower bound on its mean. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
Ω :
f :
Ω → ℝ
hfmeas :
hf :
hf0 :
∀ᵐ ω ∂μ, 0 ≤ f ω
s :
s * μ.real {ω | s ≤ f ω} ≤ ∫ ω, f ω ∂μ
Proof (Lean source)
-- @node: eventProbability_mul_threshold_le_risk lemma eventProbability_mul_threshold_le_risk {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsFiniteMeasure μ] (f : Ω → ℝ) (hfmeas : Measurable f) (hf : Integrable f μ) (hf0 : ∀ᵐ ω ∂μ, 0 ≤ f ω) (s : ℝ) : s * μ.real {ω | s ≤ f ω} ≤ ∫ ω, f ω ∂μ := by have hs : MeasurableSet {ω | s ≤ f ω} := measurableSet_le measurable_const hfmeas have hi : Integrable ({ω | s ≤ f ω}.indicator fun _ => s) μ := (integrable_const s).indicator hs have hmono : ∀ᵐ ω ∂μ, ({ω | s ≤ f ω}.indicator fun _ => s) ω ≤ f ω := by filter_upwards [hf0] with ω hω by_cases h : s ≤ f ω · simp [h] · simp [h, hω] calc s * μ.real {ω | s ≤ f ω} = ∫ ω, ({ω | s ≤ f ω}.indicator fun _ => s) ω ∂μ := by rw [integral_indicator hs, setIntegral_const, smul_eq_mul] ring _ ≤ ∫ ω, f ω ∂μ := integral_mono_ae hi hf hmono
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.eventProbability_mul_threshold_le_risk · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TMatchingLocalLowerBounds.lean:17
theorem compactMetric_distance_integrable Lemma compactMetric_distance_integrable in the paper ↗

Distance to a fixed point is integrable for measurable maps into a compact metric space. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
est :
Ω → Θ
hest :
θ :
Θ
Integrable (fun ω => dist (est ω) θ) μ
Proof (Lean source)
-- @node: compactMetric_distance_integrable lemma compactMetric_distance_integrable {Ω Θ : Type*} [MeasurableSpace Ω] [PseudoMetricSpace Θ] [CompactSpace Θ] [MeasurableSpace Θ] [OpensMeasurableSpace Θ] (μ : Measure Ω) [IsFiniteMeasure μ] (est : Ω → Θ) (hest : Measurable est) (θ : Θ) : Integrable (fun ω => dist (est ω) θ) μ := by have hm : Measurable (fun ω => dist (est ω) θ) := hest.dist measurable_const apply (integrable_const (Metric.diam (Set.univ : Set Θ))).mono hm.aestronglyMeasurable filter_upwards with ω simpa [Real.norm_eq_abs, abs_of_nonneg dist_nonneg, abs_of_nonneg Metric.diam_nonneg] using Metric.dist_le_diam_of_mem isCompact_univ.isBounded (Set.mem_univ (est ω)) (Set.mem_univ θ)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.compactMetric_distance_integrable · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TMatchingLocalLowerBounds.lean:40
theorem twoPoint_expectedMetricRisk_lower Lemma twoPoint_expectedMetricRisk_lower in the paper ↗

Le Cam's inequality, tensorisation, and tail integration give an expected metric-risk lower bound for one member of a two-point experiment. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
n :
hac :
μ ≪ ν
hint :
Integrable (llr μ ν) μ
hKL :
(n : ℝ) * (klDiv μ ν).toReal ≤ 2 / 5
est :
(Fin n → Ω) → Θ
hest :
θμ θν :
Θ
hiμ :
Integrable (fun w => dist (est w) θμ) (Measure.pi (fun _ : Fin n => μ))
hiν :
Integrable (fun w => dist (est w) θν) (Measure.pi (fun _ : Fin n => ν))
dist θμ θν / 8
≤ ∫ w, dist (est w) θμ ∂Measure.pi (fun _ : Fin n => μ) ∨ dist θμ θν / 8 ≤ ∫ w, dist (est w) θν ∂Measure.pi (fun _ : Fin n => ν)
Proof (Lean source)
-- @node: twoPoint_expectedMetricRisk_lower lemma twoPoint_expectedMetricRisk_lower {Ω Θ : Type*} [MeasurableSpace Ω] [PseudoMetricSpace Θ] [SecondCountableTopology Θ] [MeasurableSpace Θ] [OpensMeasurableSpace Θ] (n : ℕ) (μ ν : Measure Ω) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (hac : μ ≪ ν) (hint : Integrable (llr μ ν) μ) (hKL : (n : ℝ) * (klDiv μ ν).toReal ≤ 2 / 5) (est : (Fin n → Ω) → Θ) (hest : Measurable est) (θμ θν : Θ) (hiμ : Integrable (fun w => dist (est w) θμ) (Measure.pi (fun _ : Fin n => μ))) (hiν : Integrable (fun w => dist (est w) θν) (Measure.pi (fun _ : Fin n => ν))) : dist θμ θν / 8 ≤ ∫ w, dist (est w) θμ ∂Measure.pi (fun _ : Fin n => μ) ∨ dist θμ θν / 8 ≤ ∫ w, dist (est w) θν ∂Measure.pi (fun _ : Fin n => ν) := by let Pμ := Measure.pi (fun _ : Fin n => μ) let Pν := Measure.pi (fun _ : Fin n => ν) have hprod := Causalean.Mathlib.InformationTheory.productKL_tensorization_of_finite n μ ν hac hint have hprodBound : (klDiv Pμ Pν).toReal ≤ 2 / 5 := by dsimp [Pμ, Pν] rw [hprod] exact hKL have hpinsker := pinskerBound_pi_iid μ ν hac hint n have hprob := klForm_two_point_lower_bound_of_pinsker (P₀ := Pμ) (P₁ := Pν) hpinsker hest (show 2 * (dist θμ θν / 2) ≤ dist θμ θν by linarith) have hsqrt : sqrt ((klDiv Pμ Pν).toReal / 2) ≤ 1 / 2 := by have hnonneg : 0 ≤ (klDiv Pμ Pν).toReal / 2 := by positivity rw [← Real.sqrt_sq (by norm_num : (0 : ℝ) ≤ 1 / 2)] apply Real.sqrt_le_sqrt nlinarith have hquarter : (1 / 4 : ℝ) ≤ max (Pμ.real {w | dist θμ θν / 2 ≤ dist (est w) θμ}) (Pν.real {w | dist θμ θν / 2 ≤ dist (est w) θν}) := by linarith have hrμ := eventProbability_mul_threshold_le_risk Pμ (fun w => dist (est w) θμ) (hest.dist measurable_const) hiμ (Filter.Eventually.of_forall fun _ => dist_nonneg) (dist θμ θν / 2) have hrν := eventProbability_mul_threshold_le_risk Pν (fun w => dist (est w) θν) (hest.dist measurable_const) hiν (Filter.Eventually.of_forall fun _ => dist_nonneg) (dist θμ θν / 2) rcases le_total (Pμ.real {w | dist θμ θν / 2 ≤ dist (est w) θμ}) (Pν.real {w | dist θμ θν / 2 ≤ dist (est w) θν}) with hle | hle · right have hp : 1 / 4 ≤ Pν.real {w | dist θμ θν / 2 ≤ dist (est w) θν} := by simpa [max_eq_right hle] using hquarter nlinarith [mul_le_mul_of_nonneg_left hp (div_nonneg (dist_nonneg : 0 ≤ dist θμ θν) (by norm_num : (0:ℝ) ≤ 2))] · left have hp : 1 / 4 ≤ Pμ.real {w | dist θμ θν / 2 ≤ dist (est w) θμ} := by simpa [max_eq_left hle] using hquarter nlinarith [mul_le_mul_of_nonneg_left hp (div_nonneg (dist_nonneg : 0 ≤ dist θμ θν) (by norm_num : (0:ℝ) ≤ 2))]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.twoPoint_expectedMetricRisk_lower · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TMatchingLocalLowerBounds.lean:52
theorem simplexWeightLoss_integrable

The ℓ¹ loss between two simplex-valued vectors is integrable. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
Ω :
k :
est :
Ω → (Fin k → ℝ)
hest :
hestSimplex :
∀ w, InSimplex (est w)
target :
Fin k → ℝ
htarget :
InSimplex target
Integrable (fun w => ∑ i, |est w i - target i|) μ
Proof (Lean source)
-- @node: simplexWeightLoss_integrable lemma simplexWeightLoss_integrable {Ω : Type*} [MeasurableSpace Ω] {k : ℕ} (μ : Measure Ω) [IsFiniteMeasure μ] (est : Ω → (Fin k → ℝ)) (hest : Measurable est) (hestSimplex : ∀ w, InSimplex (est w)) (target : Fin k → ℝ) (htarget : InSimplex target) : Integrable (fun w => ∑ i, |est w i - target i|) μ := by have hm : Measurable (fun w => ∑ i, |est w i - target i|) := by fun_prop apply (integrable_const (2 : ℝ)).mono hm.aestronglyMeasurable filter_upwards with w rw [Real.norm_eq_abs, abs_of_nonneg (sum_nonneg fun _ _ => abs_nonneg _)] norm_num only [Real.norm_eq_abs, abs_of_nonneg (by norm_num : (0 : ℝ) ≤ 2)] calc ∑ i, |est w i - target i| ≤ ∑ i, (est w i + target i) := by apply Finset.sum_le_sum intro i _ exact abs_sub_le_iff.mpr ⟨by linarith [hestSimplex w |>.1 i, htarget.1 i], by linarith [hestSimplex w |>.1 i, htarget.1 i]⟩ _ = 2 := by rw [Finset.sum_add_distrib, (hestSimplex w).2, htarget.2]; norm_num
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.simplexWeightLoss_integrable · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TMatchingLocalLowerBounds.lean:107
theorem twoPoint_expectedWeightRisk_lower

The scalar-coordinate Le Cam bound lower-bounds the full simplex ℓ¹ risk. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
Ω :
k :
n :
hac :
μ ≪ ν
hint :
Integrable (llr μ ν) μ
hKL :
(n : ℝ) * (klDiv μ ν).toReal ≤ 2 / 5
est :
(Fin n → Ω) → (Fin k → ℝ)
hest :
hestSimplex :
∀ w, InSimplex (est w)
pμ pν :
Fin k → ℝ
hpμ :
InSimplex pμ
hpν :
InSimplex pν
i :
Fin k
|pμ i - pν i| / 8
≤ ∫ w, ∑ j, |est w j
- pμ j| ∂Measure.pi (fun _ : Fin n => μ) ∨ |pμ i
- pν i| / 8 ≤ ∫ w, ∑ j, |est w j
- pν j| ∂Measure.pi (fun _ : Fin n => ν)
Proof (Lean source)
-- @node: twoPoint_expectedWeightRisk_lower lemma twoPoint_expectedWeightRisk_lower {Ω : Type*} [MeasurableSpace Ω] {k : ℕ} (n : ℕ) (μ ν : Measure Ω) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (hac : μ ≪ ν) (hint : Integrable (llr μ ν) μ) (hKL : (n : ℝ) * (klDiv μ ν).toReal ≤ 2 / 5) (est : (Fin n → Ω) → (Fin k → ℝ)) (hest : Measurable est) (hestSimplex : ∀ w, InSimplex (est w)) (pμ pν : Fin k → ℝ) (hpμ : InSimplex pμ) (hpν : InSimplex pν) (i : Fin k) : |pμ i - pν i| / 8 ≤ ∫ w, ∑ j, |est w j - pμ j| ∂Measure.pi (fun _ : Fin n => μ) ∨ |pμ i - pν i| / 8 ≤ ∫ w, ∑ j, |est w j - pν j| ∂Measure.pi (fun _ : Fin n => ν) := by have hiμ := simplexWeightLoss_integrable (Measure.pi (fun _ : Fin n => μ)) est hest hestSimplex pμ hpμ have hiν := simplexWeightLoss_integrable (Measure.pi (fun _ : Fin n => ν)) est hest hestSimplex pν hpν have hcμ : Integrable (fun w => |est w i - pμ i|) (Measure.pi (fun _ : Fin n => μ)) := by have hm : Measurable (fun w => |est w i - pμ i|) := by fun_prop exact hiμ.mono hm.aestronglyMeasurable (Filter.Eventually.of_forall fun w => by have hsum : 0 ≤ ∑ j, |est w j - pμ j| := sum_nonneg fun _ _ => abs_nonneg _ simp only [Real.norm_eq_abs, abs_abs, abs_of_nonneg hsum] exact Finset.single_le_sum (fun j (_ : j ∈ univ) => abs_nonneg (est w j - pμ j)) (Finset.mem_univ i)) have hcν : Integrable (fun w => |est w i - pν i|) (Measure.pi (fun _ : Fin n => ν)) := by have hm : Measurable (fun w => |est w i - pν i|) := by fun_prop exact hiν.mono hm.aestronglyMeasurable (Filter.Eventually.of_forall fun w => by have hsum : 0 ≤ ∑ j, |est w j - pν j| := sum_nonneg fun _ _ => abs_nonneg _ simp only [Real.norm_eq_abs, abs_abs, abs_of_nonneg hsum] exact Finset.single_le_sum (fun j (_ : j ∈ univ) => abs_nonneg (est w j - pν j)) (Finset.mem_univ i)) have hscalar := twoPoint_expectedMetricRisk_lower n μ ν hac hint hKL (fun w => est w i) (by fun_prop) (pμ i) (pν i) (by simpa [Real.dist_eq] using hcμ) (by simpa [Real.dist_eq] using hcν) rw [Real.dist_eq] at hscalar rcases hscalar with h | h · left exact h.trans (integral_mono hcμ hiμ fun w => by simpa [Real.dist_eq] using (Finset.single_le_sum (fun j (_ : j ∈ univ) => abs_nonneg (est w j - pμ j)) (Finset.mem_univ i))) · right exact h.trans (integral_mono hcν hiν fun w => by simpa [Real.dist_eq] using (Finset.single_le_sum (fun j (_ : j ∈ univ) => abs_nonneg (est w j - pν j)) (Finset.mem_univ i)))
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.twoPoint_expectedWeightRisk_lower · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TMatchingLocalLowerBounds.lean:127
theorem path_orderedMasses_eq_latentMass

Along the separated two-class path, ordering the quotient-law atoms preserves their latent coordinate order. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg :
0 < g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
Proof (Lean source)
-- @node: path_orderedMasses_eq_latentMass lemma path_orderedMasses_eq_latentMass (g h : ℝ) (hg : 0 < g) (hg1 : g ≤ 1 / 4) (hh : |h| ≤ 1 / 100) : orderedMasses (quotientLawRaw (pathLaw g h) (effectRadius 2 2 (1 / 10))) = latentMass (pathLaw g h) := by let lo : ℝ := 1 / 4 - g / 2 let hi : ℝ := 1 / 4 + g / 2 have hlt : lo < hi := by dsimp [lo, hi]; linarith have heff0 : latentEffect (pathLaw g h) (0 : Fin 2) = lo := by simpa [lo] using path_latentEffect g h hg.le hg1 hh (0 : Fin 2) have heff1 : latentEffect (pathLaw g h) (1 : Fin 2) = hi := by simpa [hi] using path_latentEffect g h hg.le hg1 hh (1 : Fin 2) have hmass0 : latentMass (pathLaw g h) (0 : Fin 2) = 2 / 5 + h := by simpa using path_latentMass g h hg.le hg1 hh (0 : Fin 2) have hmass1 : latentMass (pathLaw g h) (1 : Fin 2) = 3 / 5 - h := by simpa using path_latentMass g h hg.le hg1 hh (1 : Fin 2) have hfilter : (Finset.univ.filter fun i : Fin 2 => 0 < (quotientLawRaw (pathLaw g h) (effectRadius 2 2 (1 / 10))).weight i) = univ := by apply Finset.filter_eq_self.mpr intro i _hi change 0 < latentMass (pathLaw g h) i rw [path_latentMass g h hg.le hg1 hh i] have hb := abs_le.mp hh split_ifs <;> linarith have hgood : (∀ i, 0 < (quotientLawRaw (pathLaw g h) (effectRadius 2 2 (1 / 10))).weight i) ∧ Injective (quotientLawRaw (pathLaw g h) (effectRadius 2 2 (1 / 10))).atom := by constructor · intro i change 0 < latentMass (pathLaw g h) i rw [path_latentMass g h hg.le hg1 hh i] have hb := abs_le.mp hh split_ifs <;> linarith · intro i j hij change latentEffect (pathLaw g h) i = latentEffect (pathLaw g h) j at hij fin_cases i <;> fin_cases j <;> simp_all funext i unfold orderedMasses rw [if_pos hgood] have hle : lo ≤ hi := hlt.le have hflo : (Finset.univ.filter fun j : Fin 2 => latentEffect (pathLaw g h) j < lo) = ∅ := by ext j fin_cases j <;> simp [heff0, heff1, hle] have hfhi : (Finset.univ.filter fun j : Fin 2 => latentEffect (pathLaw g h) j < hi) = {0} := by ext j fin_cases j <;> simp [heff0, heff1, hlt] fin_cases i <;> simp [hflo, hfhi, quotientLawRaw, heff0, heff1, hmass0, hmass1]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.path_orderedMasses_eq_latentMass · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TMatchingLocalLowerBounds.lean:172
theorem path_orderedMasses_inSimplex

The ordered mass vector on the separated two-class path belongs to the probability simplex. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g h :
hg :
0 < g
hg1 :
g ≤ 1 / 4
hh :
|h| ≤ 1 / 100
InSimplex (orderedMasses (quotientLawRaw (pathLaw g h) (effectRadius 2 2 (1 / 10))))
Proof (Lean source)
-- @node: path_orderedMasses_inSimplex lemma path_orderedMasses_inSimplex (g h : ℝ) (hg : 0 < g) (hg1 : g ≤ 1 / 4) (hh : |h| ≤ 1 / 100) : InSimplex (orderedMasses (quotientLawRaw (pathLaw g h) (effectRadius 2 2 (1 / 10)))) := by rw [path_orderedMasses_eq_latentMass g h hg hg1 hh] constructor · intro i rw [path_latentMass g h hg.le hg1 hh] have hb := abs_le.mp hh fin_cases i <;> simp <;> linarith · rw [Fin.sum_univ_two] simp_rw [path_latentMass g h hg.le hg1 hh] norm_num
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.path_orderedMasses_inSimplex · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TMatchingLocalLowerBounds.lean:228
theorem calibratedDisplacement_sample_signal_sq_le

Calibrating by the inverse square-root signal bounds the squared product displacement. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
a :
n :
g :
hn :
1 ≤ n
hg :
0 < g
(n : ℝ) * g ^ 2 * (calibratedDisplacement a n g) ^ 2 ≤ a ^ 2
Proof (Lean source)
-- @node: calibratedDisplacement_sample_signal_sq_le lemma calibratedDisplacement_sample_signal_sq_le (a : ℝ) (n : ℕ) (g : ℝ) (hn : 1 ≤ n) (hg : 0 < g) : (n : ℝ) * g ^ 2 * (calibratedDisplacement a n g) ^ 2 ≤ a ^ 2 := by have hn0 : (0 : ℝ) < n := Nat.cast_pos.mpr (lt_of_lt_of_le Nat.zero_lt_one hn) have hsqrt : 0 < sqrt n := Real.sqrt_pos.2 hn0 let x := sqrt n * g let m := min 1 x⁻¹ have hx : 0 < x := mul_pos hsqrt hg have hm0 : 0 ≤ m := le_of_lt (lt_min (by norm_num) (inv_pos.mpr hx)) have hm : x * m ≤ 1 := by calc x * m ≤ x * x⁻¹ := mul_le_mul_of_nonneg_left (min_le_right 1 x⁻¹) hx.le _ = 1 := mul_inv_cancel₀ hx.ne' have hsq : (n : ℝ) = (sqrt n) ^ 2 := by symm exact Real.sq_sqrt (Nat.cast_nonneg n) have hmulSq : (x * m) ^ 2 ≤ 1 := by nlinarith [mul_nonneg hx.le hm0] rw [calibratedDisplacement] change (n : ℝ) * g ^ 2 * (a * m) ^ 2 ≤ a ^ 2 rw [hsq] nlinarith [sq_nonneg a]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.calibratedDisplacement_sample_signal_sq_le · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TMatchingLocalLowerBounds.lean:244
theorem matching_local_lower_bounds Theorem 6 in the paper ↗

Matching local converse witnesses for quotient-law and labeled-weight loss. The existential law form avoids supremum junk values and is equivalent to the displayed minimax lower bounds. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
cLoc :
hcLoc :
∃ a c C : ℝ,
0 < a
a ≤ 1 / 8
0 < c
0 < C
conclusion 1
n :
1 ≤ n
est :
LawEstimator 2 2 2 n (effectRadius 2 2 (1 / 10))
∃ (P : Measure (FullData 2 2 2)) (_hP : IsProbabilityMeasure P),
letI := _hP ∃ hLocal : LocalQuotientExperiment (n := n) (L := 2) (pi0 := 1 / 10) (sigma0 := 1 / 10) (cLoc := cLoc) P, (P = witnessLaw 0 ∨ P = witnessLaw (a / sqrt n)) ∧ c / sqrt n
expectedLawRisk P hLocal.toUCVMWModel est
g :
est :
∃ (P : Measure (FullData 2 2 2)) (_hP : IsProbabilityMeasure P),
letI := _hP ∃ hLocal : LocalWeightExperiment (n := n) (L := 2) (pi0 := 1 / 10) (sigma0 := 1 / 10) (cLoc := cLoc) (g := g) P, (P = pathLaw g 0 ∨ P = pathLaw g (calibratedDisplacement a n g)) ∧ c * min 1 (sqrt n * g)⁻¹
letI := h0 letI := h1 ∃ (hM0 : LocalQuotientExperiment (n := n) (L := 2) (pi0 := 1 / 10) (sigma0 := 1 / 10) (cLoc := cLoc) (witnessLaw 0)) (hM1 : LocalQuotientExperiment (n := n) (L := 2) (pi0 := 1 / 10) (sigma0 := 1 / 10) (cLoc := cLoc) (witnessLaw (a / sqrt n))), klDiv (obsLaw (witnessLaw (a / sqrt n))) (obsLaw (witnessLaw 0))
ofReal (C / n) ∧
c / sqrt n
≤ AtomicLaw.LawModulo.wass1 (quotientLaw (witnessLaw 0) hM0.toUCVMWModel) (quotientLaw (witnessLaw (a / sqrt n)) hM1.toUCVMWModel)
Proof (Lean source)
-- @node: thm:matching-local-lower-bounds theorem matching_local_lower_bounds (cLoc : ℝ) (hcLoc : LocalRadiusDomain cLoc) : ∃ a c C : ℝ, 0 < a ∧ -- @realizes \(a\)(universal path amplitude in (0,1/8]) a ≤ 1 / 8 ∧ 0 < c ∧ -- @realizes \(c\)(positive minimax lower-bound constant) 0 < C ∧ -- @realizes \(C\)(positive path KL upper constant) ∀ n : ℕ, 1 ≤ n → (∀ est : LawEstimator 2 2 2 n (effectRadius 2 2 (1 / 10)), ∃ (P : Measure (FullData 2 2 2)) (_hP : IsProbabilityMeasure P), letI := _hP ∃ hLocal : LocalQuotientExperiment (n := n) (L := 2) (pi0 := 1 / 10) (sigma0 := 1 / 10) (cLoc := cLoc) P, (P = witnessLaw 0 ∨ P = witnessLaw (a / Real.sqrt n)) ∧ c / Real.sqrt n ≤ expectedLawRisk P hLocal.toUCVMWModel est) ∧ (∀ g : ℝ, GapScaleDomain g → ∀ est : WeightEstimator 2 2 2 n, ∃ (P : Measure (FullData 2 2 2)) (_hP : IsProbabilityMeasure P), letI := _hP ∃ hLocal : LocalWeightExperiment (n := n) (L := 2) (pi0 := 1 / 10) (sigma0 := 1 / 10) (cLoc := cLoc) (g := g) P, (P = pathLaw g 0 ∨ P = pathLaw g (calibratedDisplacement a n g)) ∧ c * min 1 (Real.sqrt n * g)⁻¹ ≤ expectedWeightRisk P (orderedMasses (quotientLawRaw P (effectRadius 2 2 (1 / 10)))) est) ∧ (∃ (h0 : IsProbabilityMeasure (witnessLaw 0)) (h1 : IsProbabilityMeasure (witnessLaw (a / Real.sqrt n))), letI := h0 letI := h1 ∃ (hM0 : LocalQuotientExperiment (n := n) (L := 2) (pi0 := 1 / 10) (sigma0 := 1 / 10) (cLoc := cLoc) (witnessLaw 0)) (hM1 : LocalQuotientExperiment (n := n) (L := 2) (pi0 := 1 / 10) (sigma0 := 1 / 10) (cLoc := cLoc) (witnessLaw (a / Real.sqrt n))), klDiv (obsLaw (witnessLaw (a / Real.sqrt n))) (obsLaw (witnessLaw 0)) ≤ ofReal (C / n) ∧ c / Real.sqrt n ≤ AtomicLaw.LawModulo.wass1 (quotientLaw (witnessLaw 0) hM0.toUCVMWModel) (quotientLaw (witnessLaw (a / Real.sqrt n)) hM1.toUCVMWModel)) ∧ ∀ g : ℝ, GapScaleDomain g → let h := calibratedDisplacement a n g TangentAmplitudeDomain h ∧ ∃ (hPath : IsProbabilityMeasure (pathLaw g h)) (hBase : IsProbabilityMeasure (pathLaw g 0)), letI := hPath letI := hBase LocalWeightExperiment (n := n) (L := 2) (pi0 := 1 / 10) (sigma0 := 1 / 10) (cLoc := cLoc) (g := g) (pathLaw g h) ∧ LocalWeightExperiment (n := n) (L := 2) (pi0 := 1 / 10) (sigma0 := 1 / 10) (cLoc := cLoc) (g := g) (pathLaw g 0) ∧ klDiv (obsLaw (pathLaw g h)) (obsLaw (pathLaw g 0)) ≤ ofReal (C * g ^ 2 * h ^ 2) ∧ (∑ i, |orderedMasses (quotientLawRaw (pathLaw g h) (effectRadius 2 2 (1 / 10))) i - orderedMasses (quotientLawRaw (pathLaw g 0) (effectRadius 2 2 (1 / 10))) i|) = 2 * |h| := by obtain ⟨hcLocPos, hcLocLt⟩ := hcLoc let a : ℝ := min (1 / 3200) (Real.sqrt cLoc / 3200) have hsqrtCLoc : 0 < Real.sqrt cLoc := Real.sqrt_pos.2 hcLocPos have ha : 0 < a := by dsimp [a] exact lt_min (by norm_num) (div_pos hsqrtCLoc (by norm_num)) have haMax3200 : a ≤ 1 / 3200 := by dsimp [a] exact min_le_left _ _ have haRadius : a ≤ Real.sqrt cLoc / 3200 := by dsimp [a] exact min_le_right _ _ have haMax : a ≤ 1 / 8 := haMax3200.trans (by norm_num) have haRadiusSq : a ^ 2 ≤ (Real.sqrt cLoc / 3200) ^ 2 := (sq_le_sq₀ ha.le (by positivity)).2 haRadius have hsqrtCLocSq : (Real.sqrt cLoc) ^ 2 = cLoc := Real.sq_sqrt hcLocPos.le have hscaledRadius : 16000 * a ^ 2 ≤ cLoc := by rw [div_pow, hsqrtCLocSq] at haRadiusSq nlinarith have hscaledLeCam : 16000 * a ^ 2 ≤ 1 / 4 := by nlinarith [sq_nonneg (1 / 3200 - a)] refine ⟨a, a / 8, 16000, ha, haMax, div_pos ha (by norm_num), by norm_num, ?_⟩ intro n hn have hnR : (0 : ℝ) < n := Nat.cast_pos.mpr (lt_of_lt_of_le Nat.zero_lt_one hn) have hsqrt : 0 < Real.sqrt n := Real.sqrt_pos.2 hnR let eps : ℝ := a / Real.sqrt n have heps0 : 0 ≤ eps := by dsimp [eps]; positivity have heps1 : eps ≤ 1 / 8 := by have hsqrtOne : 1 ≤ Real.sqrt n := by rw [← Real.sqrt_one] exact Real.sqrt_le_sqrt (by exact_mod_cast hn) exact (div_le_self ha.le hsqrtOne).trans haMax have hepsLocal : 16000 * eps ^ 2 ≤ cLoc / n := by have hsqrtSq : (Real.sqrt n) ^ 2 = (n : ℝ) := Real.sq_sqrt hnR.le calc 16000 * eps ^ 2 = (16000 * a ^ 2) / n := by dsimp [eps] rw [div_pow, hsqrtSq] ring _ ≤ cLoc / n := div_le_div_of_nonneg_right hscaledRadius hnR.le let hW0 : IsProbabilityMeasure (witnessLaw 0) := witnessLaw_isProbabilityMeasure 0 (by norm_num) (by norm_num) let hW1 : IsProbabilityMeasure (witnessLaw eps) := witnessLaw_isProbabilityMeasure eps heps0 heps1 letI := hW0 letI := hW1 have hM0 := witness_localQuotientExperiment n cLoc 0 (by exact ⟨hcLocPos, hcLocLt⟩) (by norm_num) (by norm_num) (by norm_num only [zero_pow, mul_zero]; positivity) have hM1 := witness_localQuotientExperiment n cLoc eps (by exact ⟨hcLocPos, hcLocLt⟩) heps0 heps1 hepsLocal have hWitnessKLReal : (klDiv (obsLaw (witnessLaw eps)) (obsLaw (witnessLaw 0))).toReal ≤ 16000 * eps ^ 2 := by calc _ ≤ (ofReal (16000 * eps ^ 2)).toReal := ENNReal.toReal_mono (by finiteness) (witnessLaw_observed_kl_bound eps heps0 heps1) _ = 16000 * eps ^ 2 := ENNReal.toReal_ofReal (by positivity) have hWitnessProductKL : (n : ℝ) * (klDiv (obsLaw (witnessLaw eps)) (obsLaw (witnessLaw 0))).toReal ≤ 2 / 5 := by have hsqrtSq : (Real.sqrt n) ^ 2 = (n : ℝ) := Real.sq_sqrt hnR.le calc _ ≤ (n : ℝ) * (16000 * eps ^ 2) := mul_le_mul_of_nonneg_left hWitnessKLReal hnR.le _ = 16000 * a ^ 2 := by dsimp [eps] rw [div_pow, hsqrtSq] field_simp [hnR.ne'] _ ≤ 1 / 4 := hscaledLeCam _ ≤ 2 / 5 := by norm_num have hLawPair (est : LawEstimator 2 2 2 n (effectRadius 2 2 (1 / 10))) : (a / 8 : ℝ) / Real.sqrt n ≤ expectedLawRisk (witnessLaw 0) hM0.toUCVMWModel est ∨ (a / 8 : ℝ) / Real.sqrt n ≤ expectedLawRisk (witnessLaw eps) hM1.toUCVMWModel est := by have hsep : dist (quotientLaw (witnessLaw 0) hM0.toUCVMWModel) (quotientLaw (witnessLaw eps) hM1.toUCVMWModel) = eps := by simpa using witness_quotientLaw_wass1 eps heps0 heps1 have hsep' : dist (quotientLaw (witnessLaw eps) hM1.toUCVMWModel) (quotientLaw (witnessLaw 0) hM0.toUCVMWModel) = eps := by rw [dist_comm, hsep] have hscale : eps / 8 = (a / 8 : ℝ) / Real.sqrt n := by dsimp [eps] ring have hr := twoPoint_expectedMetricRisk_lower n (obsLaw (witnessLaw eps)) (obsLaw (witnessLaw 0)) (witnessObsLaw_absolutelyContinuous eps heps0 heps1) (witnessObsLaw_llr_integrable eps heps0 heps1) hWitnessProductKL est.eval est.measurable (quotientLaw (witnessLaw eps) hM1.toUCVMWModel) (quotientLaw (witnessLaw 0) hM0.toUCVMWModel) (compactMetric_distance_integrable _ est.eval est.measurable _) (compactMetric_distance_integrable _ est.eval est.measurable _) rcases hr with hr | hr · right rw [hsep', hscale] at hr simpa only [expectedLawRisk, sampleLaw, AtomicLaw.LawModulo.dist_eq_wass1] using hr · left rw [hsep', hscale] at hr simpa only [expectedLawRisk, sampleLaw, AtomicLaw.LawModulo.dist_eq_wass1] using hr refine ⟨?_, ?_, ?_, ?_⟩ · intro est rcases hLawPair est with hr | hr · exact ⟨witnessLaw 0, hW0, hM0, inl rfl, hr⟩ · exact ⟨witnessLaw eps, hW1, hM1, inr (by rfl), hr⟩ · intro g hGap est obtain ⟨hg, hg1⟩ := hGap let h := calibratedDisplacement a n g have hhmem := calibratedDisplacement_mem a n g ha haMax (Nat.zero_lt_of_lt hn) hg have hh0 : 0 < h := hhmem.1 have hh : |h| ≤ 1 / 100 := by rw [abs_of_pos hh0] exact hhmem.2.trans (haMax3200.trans (by norm_num)) have hdomain : TangentAmplitudeDomain h := by constructor <;> linarith [hhmem.2] let hPath : IsProbabilityMeasure (pathLaw g h) := pathLaw_isProbabilityMeasure g h hg.le hg1 hdomain hh let hBase : IsProbabilityMeasure (pathLaw g 0) := pathLaw_isProbabilityMeasure g 0 hg.le hg1 (by norm_num [TangentAmplitudeDomain]) (by norm_num) letI := hPath letI := hBase have hcal := calibratedDisplacement_sample_signal_sq_le a n g hn hg have hpathLocal : 16000 * g ^ 2 * h ^ 2 ≤ cLoc / n := by apply (le_div_iff₀ hnR).2 calc 16000 * g ^ 2 * h ^ 2 * n = 16000 * ((n : ℝ) * g ^ 2 * h ^ 2) := by ring _ ≤ 16000 * a ^ 2 := mul_le_mul_of_nonneg_left hcal (by norm_num) _ ≤ cLoc := hscaledRadius have hLocalPath := path_localWeightExperiment n cLoc g h (by exact ⟨hcLocPos, hcLocLt⟩) hg hg1 hh hpathLocal have hLocalBase := path_localWeightExperiment n cLoc g 0 (by exact ⟨hcLocPos, hcLocLt⟩) hg hg1 (by norm_num) (by norm_num only [zero_pow, mul_zero]; positivity) have hPathKLReal : (klDiv (obsLaw (pathLaw g h)) (obsLaw (pathLaw g 0))).toReal ≤ 16000 * g ^ 2 * h ^ 2 := by calc _ ≤ (ofReal (16000 * g ^ 2 * h ^ 2)).toReal := ENNReal.toReal_mono (by finiteness) (pathLaw_observed_kl_bound g h hg.le hg1 hh) _ = 16000 * g ^ 2 * h ^ 2 := ENNReal.toReal_ofReal (by positivity) have hPathProductKL : (n : ℝ) * (klDiv (obsLaw (pathLaw g h)) (obsLaw (pathLaw g 0))).toReal ≤ 2 / 5 := by have hscaled := mul_le_mul_of_nonneg_left hPathKLReal hnR.le calc _ ≤ (n : ℝ) * (16000 * g ^ 2 * h ^ 2) := hscaled _ = 16000 * ((n : ℝ) * g ^ 2 * h ^ 2) := by ring _ ≤ 16000 * a ^ 2 := mul_le_mul_of_nonneg_left hcal (by norm_num) _ ≤ 1 / 4 := hscaledLeCam _ ≤ 2 / 5 := by norm_num have hweights := twoPoint_expectedWeightRisk_lower n (obsLaw (pathLaw g h)) (obsLaw (pathLaw g 0)) (pathObsLaw_absolutelyContinuous g h hg.le hg1 hh) (pathObsLaw_llr_integrable g h hg.le hg1 hh) hPathProductKL est.eval est.measurable est.simplex (orderedMasses (quotientLawRaw (pathLaw g h) (effectRadius 2 2 (1 / 10)))) (orderedMasses (quotientLawRaw (pathLaw g 0) (effectRadius 2 2 (1 / 10)))) (path_orderedMasses_inSimplex g h hg hg1 hh) (path_orderedMasses_inSimplex g 0 hg hg1 (by norm_num)) 0 have hcoord : |orderedMasses (quotientLawRaw (pathLaw g h) (effectRadius 2 2 (1 / 10))) 0 - orderedMasses (quotientLawRaw (pathLaw g 0) (effectRadius 2 2 (1 / 10))) 0| = h := by rw [path_orderedMasses_eq_latentMass g h hg hg1 hh, path_orderedMasses_eq_latentMass g 0 hg hg1 (by norm_num), path_latentMass g h hg.le hg1 hh, path_latentMass g 0 hg.le hg1 (by norm_num)] norm_num exact hh0.le rw [hcoord] at hweights have hscale : (a / 8 : ℝ) * min 1 (Real.sqrt n * g)⁻¹ = h / 8 := by dsimp [h, calibratedDisplacement] ring rw [hscale] rcases hweights with hr | hr · exact ⟨pathLaw g h, hPath, hLocalPath, inr rfl, by simpa [expectedWeightRisk, sampleLaw] using hr⟩ · exact ⟨pathLaw g 0, hBase, hLocalBase, inl rfl, by simpa [expectedWeightRisk, sampleLaw] using hr⟩ · refine ⟨hW0, hW1, hM0, hM1, ?_, ?_⟩ · exact (witnessLaw_observed_kl_bound eps heps0 heps1).trans (ENNReal.ofReal_le_ofReal (by have hsqrtSq : (Real.sqrt n) ^ 2 = (n : ℝ) := Real.sq_sqrt hnR.le -- … truncated; follow the source link for the rest …
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.matching_local_lower_bounds · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TMatchingLocalLowerBounds.lean:270
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.TObservedVMWMarginInclusion 20 declarations
def instMeasurableSpaceContinuousLinearMapRealIdEuc

For Euclidean input and output dimensions, the measurable-space structure on continuous linear maps is the Borel structure.

Definition (Lean source)
noncomputable local instance {m n : ℕ} : MeasurableSpace (Euc n →L[ℝ] Euc m) := borel _
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.instMeasurableSpaceContinuousLinearMapRealIdEuc · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TObservedVMWMarginInclusion.lean:18
theorem instBorelSpaceContinuousLinearMapRealIdEuc

For Euclidean input and output dimensions, continuous linear maps form a Borel space.

Formal statement
∀ {m n : ℕ}, BorelSpace (Euc n →L[ℝ] Euc m)
Proof (Lean source)
local instance {m n : ℕ} : BorelSpace (Euc n →L[ℝ] Euc m) := ⟨rfl⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.instBorelSpaceContinuousLinearMapRealIdEuc · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TObservedVMWMarginInclusion.lean:20
theorem latentArmWeights_minSingular

The diagonal normalized latent-arm weight matrix retains the joint-cell positivity margin at its least signal singular value. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
pi0 :
hk :
2 ≤ k
hpi :
0 < pi0
hpos :
LatentArmPositivity (pi0 := pi0) P
t :
Proof (Lean source)
-- @node: latentArmWeights_minSingular lemma latentArmWeights_minSingular {k dx dz : ℕ} {pi0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hk : 2 ≤ k) (hpi : 0 < pi0) (hpos : LatentArmPositivity (pi0 := pi0) P) (t : Bool) : pi0 ≤ signalMinSingular (latentArmWeights P t) := by apply le_singularValues_of_subspace (toEuclideanLin (latentArmWeights P t)) ⊤ hpi.le · simp only [finrank_top, finrank_euclideanSpace, Fintype.card_fin] omega · intro x _hx have hsum : ∑ i : Fin k, (pi0 * x i) ^ 2 ≤ ∑ i : Fin k, (latentArmWeights P t i i * x i) ^ 2 := by apply Finset.sum_le_sum intro i _ have hwi := latentArmWeight_lower P hpi hpos i t have hw0 : 0 ≤ latentArmWeights P t i i := hpi.le.trans hwi have hw2 : pi0 ^ 2 ≤ latentArmWeights P t i i ^ 2 := (sq_le_sq₀ hpi.le hw0).2 hwi simpa only [mul_pow] using mul_le_mul_of_nonneg_right hw2 (sq_nonneg (x i)) rw [EuclideanSpace.norm_eq, EuclideanSpace.norm_eq] simp only [Matrix.toEuclideanLin_apply, Real.norm_eq_abs, sq_abs] simp only [latentArmWeights, Matrix.mulVec_diagonal] have hsqrt := Real.sqrt_le_sqrt hsum rw [← Real.sqrt_sq hpi.le] rw [← Real.sqrt_mul (sq_nonneg pi0)] simpa only [Finset.mul_sum, mul_pow, latentArmWeights, Matrix.diagonal_apply_eq] using hsqrt
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.latentArmWeights_minSingular · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TObservedVMWMarginInclusion.lean:23
theorem observedProxyMoment_minSingular_of_factorization

Once the promoted conditional-moment argument supplies the proxy factorization, the three quantitative factor margins yield the required armwise singular-value margin. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hpi :
0 < pi0
hsigma :
0 < sigma0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
t :
pi0 * sigma0 ^ 2 ≤ singularValue (observedProxyMoment (obsSummary P) t) (k - 1)
Proof (Lean source)
-- @node: observedProxyMoment_minSingular_of_factorization lemma observedProxyMoment_minSingular_of_factorization {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hk : 2 ≤ k) (hpi : 0 < pi0) (hsigma : 0 < sigma0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (t : Bool) (hfac : observedProxyMoment (obsSummary P) t = referenceFeature P t * latentArmWeights P t * (targetFeature P).transpose) : pi0 * sigma0 ^ 2 ≤ singularValue (observedProxyMoment (obsSummary P) t) (k - 1) := by have injective_of_margin {rows : ℕ} (A : RectMatrix rows k) (hA : sigma0 ≤ signalMinSingular A) : Injective (toEuclideanLin A) := by rw [LinearMap.injective_iff_forall_lt_finrank_singularValues_pos] intro i hi have hik : i ≤ k - 1 := by simpa using (Nat.le_sub_one_of_lt (by simpa using hi)) exact lt_of_lt_of_le (lt_of_lt_of_le hsigma hA) ((toEuclideanLin A).singularValues_antitone hik) have hAt : sigma0 ≤ signalMinSingular (referenceFeature P t) := by cases t with | false => exact hM.proxyRankMargin.1 | true => exact hM.proxyRankMargin.2.1 have hAinj := injective_of_margin (referenceFeature P t) hAt have hBinj := injective_of_margin (targetFeature P) hM.proxyRankMargin.2.2 have hDinj := latentArmWeights_injective P hpi hM.latentArmPositivity t letI : Nonempty (Fin k) := ⟨⟨0, by omega⟩⟩ have hprod := Matrix.singularValues_mul_mul_transpose_lower_bound (referenceFeature P t) (latentArmWeights P t) (targetFeature P) hAinj hDinj hBinj rw [hfac] have hA0 : 0 ≤ signalMinSingular (referenceFeature P t) := (toEuclideanLin (referenceFeature P t)).singularValues_nonneg _ have hD0 : 0 ≤ signalMinSingular (latentArmWeights P t) := (toEuclideanLin (latentArmWeights P t)).singularValues_nonneg _ have hB0 : 0 ≤ signalMinSingular (targetFeature P) := (toEuclideanLin (targetFeature P)).singularValues_nonneg _ have hD := latentArmWeights_minSingular P hk hpi hM.latentArmPositivity t have hAD : sigma0 * pi0 ≤ signalMinSingular (referenceFeature P t) * signalMinSingular (latentArmWeights P t) := mul_le_mul hAt hD hpi.le hA0 calc pi0 * sigma0 ^ 2 = sigma0 * pi0 * sigma0 := by ring _ ≤ signalMinSingular (referenceFeature P t) * signalMinSingular (latentArmWeights P t) * signalMinSingular (targetFeature P) := by exact mul_le_mul hAD hM.proxyRankMargin.2.2 hsigma.le (mul_nonneg hA0 hD0) _ ≤ singularValue (referenceFeature P t * latentArmWeights P t * (targetFeature P).transpose) (k - 1) := by simpa only [signalMinSingular, singularValue, Fintype.card_fin] using hprod
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.observedProxyMoment_minSingular_of_factorization · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TObservedVMWMarginInclusion.lean:53
def signalBasisLinearIsometry

The matrix carried by a SignalBasis is the linear isometric embedding determined by its orthonormal columns. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
dx k :
V :
signalBasisLinearIsometry V :
Euc k →ₗᵢ[ℝ] Euc dx
by refine LinearIsometry.mk (toEuclideanLin V.V) ?_ intro x have hgram : V.V.transpose * V.V
= (1 : RectMatrix k k) := by ext i j simp only [Matrix.mul_apply, Matrix.transpose_apply, Matrix.one_apply] exact V.orthonormal i j have hadj : (toEuclideanLin V.V).adjoint = toEuclideanLin V.V.transpose := by rw [← Matrix.toEuclideanLin_conjTranspose_eq_adjoint] congr 1 have hleft : (toEuclideanLin V.V).adjoint (toEuclideanLin V.V x) = x := by rw [hadj] apply PiLp.ext intro i simp only [Matrix.toEuclideanLin_apply, WithLp.ofLp_toLp, Matrix.mulVec_mulVec, ← Matrix.mul_apply, hgram, Matrix.one_apply, Matrix.one_mulVec] have hsq : ‖Matrix.toEuclideanLin V.V x‖ ^ 2 = ‖x‖ ^ 2 := by rw [← real_inner_self_eq_norm_sq, ← real_inner_self_eq_norm_sq, ← (toEuclideanLin V.V).adjoint_inner_left, hleft] nlinarith [norm_nonneg x, norm_nonneg (toEuclideanLin V.V x)]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.signalBasisLinearIsometry · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TObservedVMWMarginInclusion.lean:107
theorem observedProxyMoment_compression_margin

Compression by any orthonormal basis spanning the stacked signal rowspace preserves the last signal singular value and its quantitative lower margin. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hL :
1 ≤ L
hpi :
0 < pi0
hsigma :
0 < sigma0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
t :
V :
hV :
V.SpansSignal (obsSummary P)
conclusion 2
pi0 * sigma0 ^ 2 ≤ signalMinSingular (observedProxyMoment (obsSummary P) t * V.V)
Proof (Lean source)
-- @node: observedProxyMoment_compression_margin lemma observedProxyMoment_compression_margin {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hk : 2 ≤ k) (hkx : k ≤ dx) (hL : 1 ≤ L) (hpi : 0 < pi0) (hsigma : 0 < sigma0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (t : Bool) (V : SignalBasis dx k) (hV : V.SpansSignal (obsSummary P)) : signalMinSingular (observedProxyMoment (obsSummary P) t * V.V) = singularValue (observedProxyMoment (obsSummary P) t) (k - 1) ∧ pi0 * sigma0 ^ 2 ≤ signalMinSingular (observedProxyMoment (obsSummary P) t * V.V) := by have hfac := observedProxyMoment_factorization P hk hkx hL hpi hM t have hmin := observedProxyMoment_minSingular_of_factorization P hk hpi hsigma hM t hfac let Vi := signalBasisLinearIsometry V let M := observedProxyMoment (obsSummary P) t have hAdj : toEuclideanLin M.transpose = (toEuclideanLin M).adjoint := by rw [← Matrix.toEuclideanLin_conjTranspose_eq_adjoint] congr 1 have hsub : (toEuclideanLin M).adjoint.range ≤ Vi.toLinearMap.range := by rw [← hAdj] rw [show Vi.toLinearMap = toEuclideanLin V.V from rfl, hV] cases t with | false => exact le_sup_left | true => exact le_sup_right have hpos : 0 < singularValue M (k - 1) := lt_of_lt_of_le (mul_pos hpi (sq_pos_of_pos hsigma)) hmin have hrank : k ≤ finrank ℝ (toEuclideanLin M).adjoint.range := by rw [(toEuclideanLin M).finrank_range_adjoint] have := (toEuclideanLin M).singularValues_pos_iff_lt_finrank_range.mp hpos omega have hVirank : finrank ℝ Vi.toLinearMap.range = k := by rw [Vi.toLinearMap.finrank_range_of_inj Vi.injective, finrank_euclideanSpace] simp have hrange : Vi.toLinearMap.range = (toEuclideanLin M).adjoint.range := by symm apply Submodule.eq_of_le_of_finrank_le hsub rw [hVirank] exact hrank have hmul : toEuclideanLin (M * V.V) = toEuclideanLin M ∘ₗ Vi.toLinearMap := by apply LinearMap.ext intro x apply PiLp.ext intro i simp [Vi, signalBasisLinearIsometry, Matrix.toEuclideanLin_apply, Matrix.mulVec_mulVec] have heq := singularValues_comp_linearIsometry_last (toEuclideanLin M) Vi hrange rw [← hmul] at heq refine ⟨by simpa [signalMinSingular, singularValue, M] using heq, ?_⟩ simpa only [signalMinSingular, singularValue, Fintype.card_fin] using (show pi0 * sigma0 ^ 2 ≤ singularValue (M * V.V) (k - 1) by rw [show singularValue (M * V.V) (k - 1) = singularValue M (k - 1) by simpa [singularValue] using heq] exact hmin)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.observedProxyMoment_compression_margin · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TObservedVMWMarginInclusion.lean:134
theorem ae_abs_right_le_of_indep_product_bound Lemma ae_abs_right_le_of_indep_product_bound in the paper ↗

Independence transfers an almost-sure product envelope to the second factor whenever the first factor exceeds a positive threshold with positive probability. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
Ω :
X Y :
Ω → ℝ
hX :
hY :
hInd :
IndepFun X Y μ
a L :
ha :
0 < a
hL :
0 ≤ L
hEvent :
0 < μ {ω | a ≤ |X ω|}
hProduct :
∀ᵐ ω ∂μ, |X ω * Y ω| ≤ L
∀ᵐ ω ∂μ, |Y ω| ≤ L / a
Proof (Lean source)
-- @node: ae_abs_right_le_of_indep_product_bound lemma ae_abs_right_le_of_indep_product_bound {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] {X Y : Ω → ℝ} (hX : Measurable X) (hY : Measurable Y) (hInd : IndepFun X Y μ) {a L : ℝ} (ha : 0 < a) (hL : 0 ≤ L) (hEvent : 0 < μ {ω | a ≤ |X ω|}) (hProduct : ∀ᵐ ω ∂μ, |X ω * Y ω| ≤ L) : ∀ᵐ ω ∂μ, |Y ω| ≤ L / a := by let E : Set Ω := {ω | a ≤ |X ω|} let B : Set Ω := {ω | L / a < |Y ω|} have hErange : MeasurableSet {x : ℝ | a ≤ |x|} := measurableSet_le measurable_const continuous_abs.measurable have hBrange : MeasurableSet {y : ℝ | L / a < |y|} := measurableSet_lt measurable_const continuous_abs.measurable have hEBzero : μ (E ∩ B) = 0 := by rw [measure_eq_zero_iff_ae_notMem] filter_upwards [hProduct] with ω hprod hmem have hstrict : L < |X ω * Y ω| := by calc L = (L / a) * a := by field_simp _ < |Y ω| * a := mul_lt_mul_of_pos_right hmem.2 ha _ ≤ |Y ω| * |X ω| := mul_le_mul_of_nonneg_left hmem.1 (abs_nonneg _) _ = |X ω * Y ω| := by rw [abs_mul]; ring exact (not_lt_of_ge hprod) hstrict have hfactor : μ (E ∩ B) = μ E * μ B := by simpa [E, B] using hInd.measure_inter_preimage_eq_mul {x : ℝ | a ≤ |x|} {y : ℝ | L / a < |y|} hErange hBrange have hBzero : μ B = 0 := by by_contra hB have hprodne : μ E * μ B ≠ 0 := mul_ne_zero (ne_of_gt hEvent) hB exact hprodne (by rw [← hfactor, hEBzero]) rw [measure_eq_zero_iff_ae_notMem] at hBzero filter_upwards [hBzero] with ω hω exact le_of_not_gt (by simpa [B] using hω)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ae_abs_right_le_of_indep_product_bound · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TObservedVMWMarginInclusion.lean:195
theorem ae_abs_le_of_indep_positive_event Lemma ae_abs_le_of_indep_positive_event in the paper ↗

A bound holding on a positive-probability event transfers to an independent random variable on the whole probability space. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
Ω :
X :
Ω → ℝ
hX :
A :
Set Ω
hA :
hApos :
0 < μ A
hInd :
R :
hBound :
∀ᵐ ω ∂μ, ω ∈ A → |X ω| ≤ R
∀ᵐ ω ∂μ, |X ω| ≤ R
Proof (Lean source)
-- @node: ae_abs_le_of_indep_positive_event lemma ae_abs_le_of_indep_positive_event {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] {X : Ω → ℝ} (hX : Measurable X) {A : Set Ω} (hA : MeasurableSet A) (hApos : 0 < μ A) (hInd : IndepFun X (armIndicator A) μ) {R : ℝ} (hBound : ∀ᵐ ω ∂μ, ω ∈ A → |X ω| ≤ R) : ∀ᵐ ω ∂μ, |X ω| ≤ R := by let B : Set Ω := {ω | R < |X ω|} have hBrange : MeasurableSet {x : ℝ | R < |x|} := measurableSet_lt measurable_const continuous_abs.measurable have hBAzero : μ (B ∩ A) = 0 := by rw [measure_eq_zero_iff_ae_notMem] filter_upwards [hBound] with ω hω hmem exact (not_lt_of_ge (hω hmem.2)) hmem.1 have hArmPreimage : armIndicator A ⁻¹' ({1} : Set ℝ) = A := by ext ω simp [armIndicator] have hfactor : μ (B ∩ A) = μ B * μ A := by simpa [B, hArmPreimage] using hInd.measure_inter_preimage_eq_mul {x : ℝ | R < |x|} ({1} : Set ℝ) hBrange (measurableSet_singleton 1) have hBzero : μ B = 0 := by by_contra hB have hprodne : μ B * μ A ≠ 0 := mul_ne_zero hB (ne_of_gt hApos) exact hprodne (by rw [← hfactor, hBAzero]) rw [measure_eq_zero_iff_ae_notMem] at hBzero filter_upwards [hBzero] with ω hω exact le_of_not_gt (by simpa [B] using hω)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ae_abs_le_of_indep_positive_event · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TObservedVMWMarginInclusion.lean:235
theorem exists_reference_coordinate_positive_event

A reference-feature singular-value margin supplies a coordinate that is nontrivial with positive probability in every normalized latent cell. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hsigma :
0 < sigma0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
u :
Fin k
t :
∃ j : Fin dz,
0 < normalizedRestrict P (latentCell u t) {w | sigma0 / (2 * sqrt dz) ≤ |w.Z j|}
Proof (Lean source)
-- @node: exists_reference_coordinate_positive_event lemma exists_reference_coordinate_positive_event {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hsigma : 0 < sigma0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (u : Fin k) (t : Bool) : ∃ j : Fin dz, 0 < normalizedRestrict P (latentCell u t) {w | sigma0 / (2 * sqrt dz) ≤ |w.Z j|} := by have hdz : 0 < dz := lt_of_lt_of_le (by omega : 0 < k) hkz have hsqrt : 0 < sqrt dz := Real.sqrt_pos.2 (by positivity) have hAt : sigma0 ≤ signalMinSingular (referenceFeature P t) := by cases t with | false => exact hM.proxyRankMargin.1 | true => exact hM.proxyRankMargin.2.1 have hAinj : Injective (toEuclideanLin (referenceFeature P t)) := by rw [LinearMap.injective_iff_forall_lt_finrank_singularValues_pos] intro i hi have hik : i ≤ k - 1 := by simpa using (Nat.le_sub_one_of_lt (by simpa using hi)) exact lt_of_lt_of_le (lt_of_lt_of_le hsigma hAt) ((toEuclideanLin (referenceFeature P t)).singularValues_antitone hik) letI : Nonempty (Fin k) := ⟨⟨0, by omega⟩⟩ let e : Euc k := toLp 2 (single u 1) have he : ‖e‖ = 1 := by simp [e] have hcol : sigma0 ≤ ‖Matrix.toEuclideanLin (referenceFeature P t) e‖ := by calc sigma0 = sigma0 * ‖e‖ := by rw [he, mul_one] _ ≤ signalMinSingular (referenceFeature P t) * ‖e‖ := mul_le_mul_of_nonneg_right hAt (norm_nonneg _) _ ≤ ‖Matrix.toEuclideanLin (referenceFeature P t) e‖ := by simpa [signalMinSingular, singularValue, Fintype.card_fin] using least_singularValue_mul_norm_le (toEuclideanLin (referenceFeature P t)) hAinj e have hcoord : ∃ j : Fin dz, sigma0 / sqrt dz ≤ |referenceFeature P t j u| := by by_contra hnone push_neg at hnone have hsquares : ∀ j : Fin dz, (referenceFeature P t j u) ^ 2 < sigma0 ^ 2 / dz := by intro j have hsq := (sq_lt_sq₀ (abs_nonneg (referenceFeature P t j u)) (div_nonneg hsigma.le hsqrt.le)).2 (hnone j) rw [sq_abs] at hsq rw [div_pow] at hsq norm_num [Real.sq_sqrt hsqrt.le] at hsq ⊢ exact hsq have hsum : (∑ j : Fin dz, (referenceFeature P t j u) ^ 2) < sigma0 ^ 2 := by calc _ < ∑ _j : Fin dz, sigma0 ^ 2 / dz := Finset.sum_lt_sum (fun j _ => le_of_lt (hsquares j)) ⟨⟨0, hdz⟩, Finset.mem_univ _, hsquares _⟩ _ = sigma0 ^ 2 := by simp field_simp have hcolsq : sigma0 ^ 2 ≤ ∑ j : Fin dz, (referenceFeature P t j u) ^ 2 := by have hs := (sq_le_sq₀ hsigma.le (norm_nonneg _)).2 hcol simp [EuclideanSpace.norm_eq, Matrix.toEuclideanLin_apply, e, Real.norm_eq_abs, sq_abs] at hs rwa [Real.sq_sqrt (sum_nonneg fun _ _ => sq_nonneg _)] at hs linarith obtain ⟨j, hj⟩ := hcoord refine ⟨j, ?_⟩ let C : Set (FullData k dx dz) := latentCell u t let μ := normalizedRestrict P C have hCpos := latentCell_pos_of_latentArmPositivity P hpi hM.latentArmPositivity u t let _ : IsProbabilityMeasure μ := normalizedRestrict_isProbabilityMeasure (measurableSet_latentCell u t) hCpos have hb := (proxy_coordinate_bounds_of_model P hk hkx hM).2.1 have hZint : Integrable (fun w : FullData k dx dz => w.Z j) μ := by exact Integrable.of_bound ((measurable_pi_apply j).comp measurable_fullData_Z).aestronglyMeasurable L <| (ae_normalizedRestrict_iff hCpos).mpr <| ae_restrict_of_ae (hb.mono fun w hw => by simpa [Real.norm_eq_abs] using hw j) by_contra hzero have hzero' : μ {w | sigma0 / (2 * sqrt dz) ≤ |w.Z j|} = 0 := le_antisymm (not_lt.mp hzero) bot_le have hae : ∀ᵐ w ∂μ, |w.Z j| < sigma0 / (2 * sqrt dz) := by filter_upwards [measure_eq_zero_iff_ae_notMem.mp hzero'] with w hw exact lt_of_not_ge (by simpa using hw) have hmean : |referenceFeature P t j u| ≤ sigma0 / (2 * sqrt dz) := by rw [referenceFeature, conditionalMean_eq_normalizedRestrictedIntegral hCpos] unfold normalizedRestrictedIntegral calc |∫ w, w.Z j ∂μ| ≤ ∫ w, |w.Z j| ∂μ := abs_integral_le_integral_abs _ ≤ ∫ _w, sigma0 / (2 * sqrt dz) ∂μ := by exact integral_mono_ae hZint.abs (integrable_const _) (hae.mono fun _ h => h.le) _ = sigma0 / (2 * sqrt dz) := by simp have : sigma0 / (2 * sqrt dz) < sigma0 / sqrt dz := by calc sigma0 / (2 * sqrt dz) = (sigma0 / sqrt dz) / 2 := by field_simp _ < sigma0 / sqrt dz := by have := div_pos hsigma hsqrt linarith exact (not_lt_of_ge hj) (lt_of_le_of_lt hmean this)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.exists_reference_coordinate_positive_event · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TObservedVMWMarginInclusion.lean:268
theorem ae_abs_observedOutcome_le_on_latentCell

Proxy separation, a reference-rank margin, the anchor, and the observable outcome--proxy envelope bound the observed outcome on every latent treatment cell. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hsigma :
0 < sigma0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
u :
Fin k
t :
∀ᵐ w ∂P.restrict (latentCell u t), |w.Y| ≤ effectRadius dz L sigma0 / 2
Proof (Lean source)
-- @node: ae_abs_observedOutcome_le_on_latentCell lemma ae_abs_observedOutcome_le_on_latentCell {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hsigma : 0 < sigma0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (u : Fin k) (t : Bool) : ∀ᵐ w ∂P.restrict (latentCell u t), |w.Y| ≤ effectRadius dz L sigma0 / 2 := by let C : Set (FullData k dx dz) := latentCell u t let μ := normalizedRestrict P C have hCpos := latentCell_pos_of_latentArmPositivity P hpi hM.latentArmPositivity u t let _ : IsProbabilityMeasure μ := normalizedRestrict_isProbabilityMeasure (measurableSet_latentCell u t) hCpos obtain ⟨j, hj⟩ := exists_reference_coordinate_positive_event P hk hkx hkz hL hpi hsigma hM u t have hfac := referenceProxySeparation_to_normalizedFactorization hM.referenceProxySeparation u t hCpos have hXmeas : Measurable (fun w : FullData k dx dz => w.X) := measurable_fullData_X have hYmeas : Measurable (fun w : FullData k dx dz => w.Y) := measurable_fullData_Y have hIndVec : IndepFun (fun w : FullData k dx dz => w.Z) (fun w => (w.X, w.Y)) μ := indepFun_of_boundedTestFactorization measurable_fullData_Z (hXmeas.prodMk hYmeas) hfac have hInd : IndepFun (fun w : FullData k dx dz => w.Z j) (fun w => w.Y) μ := by simpa only [Function.comp_def] using hIndVec.comp (measurable_pi_apply j) measurable_snd have hb := (proxy_coordinate_bounds_of_model P hk hkx hM).2.2 have hprod : ∀ᵐ w ∂μ, |w.Z j * w.Y| ≤ L := (ae_normalizedRestrict_iff hCpos).mpr <| ae_restrict_of_ae <| hb.mono fun w hw => by simpa [mul_comm] using hw j have hdzreal : (0 : ℝ) < dz := by exact_mod_cast (lt_of_lt_of_le (by omega : 0 < k) hkz) have ha : 0 < sigma0 / (2 * sqrt dz) := div_pos hsigma (mul_pos (by norm_num) (Real.sqrt_pos.2 hdzreal)) have hL0 : 0 ≤ L := by linarith have hraw := ae_abs_right_le_of_indep_product_bound ((measurable_pi_apply j).comp measurable_fullData_Z) hYmeas hInd (a := sigma0 / (2 * sqrt dz)) (L := L) ha hL0 hj hprod apply (ae_normalizedRestrict_iff hCpos).mp filter_upwards [hraw] with w hw rw [effectRadius] have hsqrt : 0 < sqrt dz := Real.sqrt_pos.2 (by exact_mod_cast (lt_of_lt_of_le (by omega : 0 < k) hkz)) calc |w.Y| ≤ L / (sigma0 / (2 * sqrt dz)) := hw _ = (4 * L * sqrt dz / sigma0) / 2 := by field_simp; ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ae_abs_observedOutcome_le_on_latentCell · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TObservedVMWMarginInclusion.lean:370
theorem ae_abs_potential_le_on_latentClass

Consistency and armwise latent ignorability transfer the observed cell envelope to each potential outcome on the whole latent class. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hsigma :
0 < sigma0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
u :
Fin k
t :
∀ᵐ w ∂P.restrict (latentClass u), |potential t w| ≤ effectRadius dz L sigma0 / 2
Proof (Lean source)
-- @node: ae_abs_potential_le_on_latentClass lemma ae_abs_potential_le_on_latentClass {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hsigma : 0 < sigma0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (u : Fin k) (t : Bool) : ∀ᵐ w ∂P.restrict (latentClass u), |potential t w| ≤ effectRadius dz L sigma0 / 2 := by let C : Set (FullData k dx dz) := latentClass u let A : Set (FullData k dx dz) := {w | w.T = t} let μ := normalizedRestrict P C have hcellpos := latentCell_pos_of_latentArmPositivity P hpi hM.latentArmPositivity u t have hCpos : 0 < P C := lt_of_lt_of_le hcellpos <| measure_mono <| by intro w hw exact hw.1 let _ : IsProbabilityMeasure μ := normalizedRestrict_isProbabilityMeasure (measurableSet_latentClass u) hCpos have hfac := latentIgnorability_to_normalizedFactorization hM.latentIgnorability u t hCpos have hIndT : IndepFun (potential t) (fun w : FullData k dx dz => w.T) μ := indepFun_of_boundedTestFactorization (measurable_potential t) measurable_fullData_T hfac let q : Bool → ℝ := fun b => if b = t then 1 else 0 have hq : Measurable q := by fun_prop have hInd : IndepFun (potential t) (armIndicator A) μ := by have hc := hIndT.comp measurable_id hq have heq : (q ∘ fun w : FullData k dx dz => w.T) = armIndicator A := by funext w by_cases hw : w.T = t <;> simp [q, A, armIndicator, hw] rw [← heq] exact hc have hApos : 0 < μ A := by rw [normalizedRestrict_apply hCpos (measurableSet_fullDataArm t)] have hinter : A ∩ C = latentCell u t := by ext w simp [A, C, latentCell, latentClass, and_comm] rw [hinter] exact ENNReal.mul_pos (ENNReal.inv_pos.mpr (measure_ne_top P C)).ne' hcellpos.ne' have hobs := ae_abs_observedOutcome_le_on_latentCell P hk hkx hkz hL hpi hsigma hM u t have hOnArm : ∀ᵐ w ∂μ, w ∈ A → |potential t w| ≤ effectRadius dz L sigma0 / 2 := by apply (ae_normalizedRestrict_iff hCpos).mpr filter_upwards [ae_restrict_of_ae hM.consistency, ae_restrict_of_ae (ae_imp_of_ae_restrict hobs), self_mem_ae_restrict (measurableSet_latentClass u)] with w hcons hbound hwC hwA have hwcell : w ∈ latentCell u t := ⟨by simpa [C, latentClass] using hwC, by simpa [A] using hwA⟩ have ht : w.T = t := by simpa [A] using hwA rw [← ht, ← hcons] exact hbound hwcell exact (ae_normalizedRestrict_iff hCpos).mp <| ae_abs_le_of_indep_positive_event (measurable_potential t) (measurableSet_fullDataArm t) hApos hInd hOnArm
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.ae_abs_potential_le_on_latentClass · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TObservedVMWMarginInclusion.lean:421
theorem latentMean_abs_le_of_model Lemma 6 in the paper ↗

The derived potential-outcome envelope bounds every latent conditional mean. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hsigma :
0 < sigma0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
u :
Fin k
t :
|latentMean P t u| ≤ effectRadius dz L sigma0 / 2
Proof (Lean source)
lemma latentMean_abs_le_of_model {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hsigma : 0 < sigma0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (u : Fin k) (t : Bool) : |latentMean P t u| ≤ effectRadius dz L sigma0 / 2 := by have hcell := latentCell_pos_of_latentArmPositivity P hpi hM.latentArmPositivity u false have hclass : 0 < P (latentClass u) := lt_of_lt_of_le hcell <| measure_mono <| by intro w hw exact hw.1 let mu := normalizedRestrict P (latentClass u) let _ : IsProbabilityMeasure mu := normalizedRestrict_isProbabilityMeasure (measurableSet_latentClass u) hclass have hpot := ae_abs_potential_le_on_latentClass P hk hkx hkz hL hpi hsigma hM u t have hpotmu : ∀ᵐ w ∂mu, |potential t w| ≤ effectRadius dz L sigma0 / 2 := (ae_normalizedRestrict_iff hclass).mpr hpot have hint : Integrable (potential t) mu := Integrable.of_bound (measurable_potential t).aestronglyMeasurable (effectRadius dz L sigma0 / 2) hpotmu rw [latentMean, conditionalMean_eq_normalizedRestrictedIntegral hclass] unfold normalizedRestrictedIntegral calc |∫ w, potential t w ∂mu| ≤ ∫ w, |potential t w| ∂mu := abs_integral_le_integral_abs _ ≤ ∫ _w, effectRadius dz L sigma0 / 2 ∂mu := integral_mono_ae hint.abs (integrable_const _) hpotmu _ = effectRadius dz L sigma0 / 2 := by simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.latentMean_abs_le_of_model · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TObservedVMWMarginInclusion.lean:479
theorem latentEffect_abs_le_of_model Lemma 7 in the paper ↗

The two derived latent-mean bounds imply the gap-free support bound for every latent effect. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hsigma :
0 < sigma0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
u :
Fin k
|latentEffect P u| ≤ effectRadius dz L sigma0
Proof (Lean source)
lemma latentEffect_abs_le_of_model {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hsigma : 0 < sigma0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (u : Fin k) : |latentEffect P u| ≤ effectRadius dz L sigma0 := by rw [latentEffect] calc |latentMean P true u - latentMean P false u| ≤ |latentMean P true u| + |latentMean P false u| := abs_sub _ _ _ ≤ effectRadius dz L sigma0 / 2 + effectRadius dz L sigma0 / 2 := add_le_add (latentMean_abs_le_of_model P hk hkx hkz hL hpi hsigma hM u true) (latentMean_abs_le_of_model P hk hkx hkz hL hpi hsigma hM u false) _ = effectRadius dz L sigma0 := by ring
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.latentEffect_abs_le_of_model · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TObservedVMWMarginInclusion.lean:512
theorem effectGap_range_of_model

Given the latent dimension lower bound, feature dimension bound, proxy dimension bound, radius bound, treatment positivity, noise positivity, and model membership, the effect gap is infinite or lies in the declared positive bounded interval.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hsigma :
0 < sigma0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
effectGap P = ⊤ ∨ (0 < effectGap P ∧ effectGap P ≤ (2 * effectRadius dz L sigma0 : ℝ))
Proof (Lean source)
-- keep: tagged range certificate for the frozen δ(P) symbol space theorem effectGap_range_of_model {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hsigma : 0 < sigma0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) : effectGap P = ⊤ ∨ (0 < effectGap P ∧ effectGap P ≤ (2 * effectRadius dz L sigma0 : ℝ)) := by classical let D : Set EReal := {d | ∃ u v : Fin k, 0 < latentMass P u ∧ 0 < latentMass P v ∧ latentEffect P u ≠ latentEffect P v ∧ d = |latentEffect P u - latentEffect P v|} by_cases hD : D.Nonempty · right have hDfin : D.Finite := by let F := (Finset.univ : Finset (Fin k)).product (Finset.univ : Finset (Fin k)) have hsub : D ⊆ (fun p : Fin k × Fin k => ((|latentEffect P p.1 - latentEffect P p.2| : ℝ) : EReal)) '' (F : Set (Fin k × Fin k)) := by rintro d ⟨u, v, hu, hv, huv, rfl⟩ exact ⟨(u, v), Finset.mem_product.mpr ⟨Finset.mem_univ _, Finset.mem_univ _⟩, rfl⟩ exact (F.finite_toSet.image _).subset hsub have hmin := hD.csInf_mem hDfin rcases hmin with ⟨u, v, hu, hv, huv, hEq⟩ constructor · rw [show effectGap P = sInf D by rfl, hEq] exact_mod_cast (abs_pos.mpr (sub_ne_zero.mpr huv)) · rw [show effectGap P = sInf D by rfl, hEq] exact_mod_cast (calc |latentEffect P u - latentEffect P v| ≤ |latentEffect P u| + |latentEffect P v| := abs_sub _ _ _ ≤ effectRadius dz L sigma0 + effectRadius dz L sigma0 := add_le_add (latentEffect_abs_le_of_model P hk hkx hkz hL hpi hsigma hM u) (latentEffect_abs_le_of_model P hk hkx hkz hL hpi hsigma hM v) _ = 2 * effectRadius dz L sigma0 := by ring) · left have hDempty : D = ∅ := Set.not_nonempty_iff_eq_empty.mp hD rw [show effectGap P = sInf D by rfl, hDempty] exact sInf_empty
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.effectGap_range_of_model · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TObservedVMWMarginInclusion.lean:529
theorem conditionalMatrix_norm_le_of_ae_bound

The operator norm of a conditional matrix mean is bounded by an almost-sure operator envelope for the matrix-valued random element. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
t :
A :
FullData k dx dz → RectMatrix dz dx
hcoordMeas :
∀ i j, Measurable (fun w => A w i j)
hmapMeas :
Measurable (fun w => matrixCLM (A w))
L :
hL :
0 ≤ L
hbound :
∀ᵐ w ∂P, ‖matrixCLM (A w)‖ ≤ L
hArm :
0 < P {w | w.T = t}
‖matrixCLM (fun i j => conditionalMean P {w | w.T = t} (fun w => A w i j))‖ ≤ L
Proof (Lean source)
-- @node: conditionalMatrix_norm_le_of_ae_bound lemma conditionalMatrix_norm_le_of_ae_bound {k dx dz : ℕ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (t : Bool) (A : FullData k dx dz → RectMatrix dz dx) (hcoordMeas : ∀ i j, Measurable (fun w => A w i j)) (hmapMeas : Measurable (fun w => matrixCLM (A w))) {L : ℝ} (hL : 0 ≤ L) (hbound : ∀ᵐ w ∂P, ‖matrixCLM (A w)‖ ≤ L) (hArm : 0 < P {w | w.T = t}) : ‖matrixCLM (fun i j => conditionalMean P {w | w.T = t} (fun w => A w i j))‖ ≤ L := by let C : Set (FullData k dx dz) := {w | w.T = t} let μ := normalizedRestrict P C let _ : IsProbabilityMeasure μ := normalizedRestrict_isProbabilityMeasure (measurableSet_fullDataArm t) hArm have hboundμ : ∀ᵐ w ∂μ, ‖matrixCLM (A w)‖ ≤ L := (ae_normalizedRestrict_iff hArm).mpr (ae_restrict_of_ae hbound) have hmap : Integrable (fun w => matrixCLM (A w)) μ := Integrable.of_bound hmapMeas.aestronglyMeasurable L hboundμ have hcoord : ∀ i j, Integrable (fun w => A w i j) μ := by intro i j exact Integrable.of_bound (hcoordMeas i j).aestronglyMeasurable L <| hboundμ.mono fun w hw => by simpa [Real.norm_eq_abs] using (abs_matrix_entry_le_matrixCLM_norm (A w) i j).trans hw rw [matrixCLM_conditionalMatrix_eq_integral P C hArm A hcoord hmap] calc ‖∫ w, matrixCLM (A w) ∂μ‖ ≤ ∫ w, ‖matrixCLM (A w)‖ ∂μ := norm_integral_le_integral_norm _ _ ≤ ∫ _w, L ∂μ := integral_mono_ae hmap.norm (integrable_const _) hboundμ _ = L := by simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.conditionalMatrix_norm_le_of_ae_bound · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TObservedVMWMarginInclusion.lean:579
theorem observedSummary_envelopes_of_model

All five observable summary blocks inherit the common model envelope. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hL :
1 ≤ L
hpi :
0 < pi0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
conclusion 1
t :
‖matrixCLM (observedProxyMoment (obsSummary P) t)‖ ≤ L
‖matrixCLM (observedOutcomeProxyMoment (obsSummary P) t)‖ ≤ L
conclusion 2
‖(toLp 2 (obsSummary P).mX : Euc dx)‖ ≤ L
Proof (Lean source)
-- @node: observedSummary_envelopes_of_model lemma observedSummary_envelopes_of_model {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hk : 2 ≤ k) (hkx : k ≤ dx) (hL : 1 ≤ L) (hpi : 0 < pi0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) : (∀ t : Bool, ‖matrixCLM (observedProxyMoment (obsSummary P) t)‖ ≤ L ∧ ‖matrixCLM (observedOutcomeProxyMoment (obsSummary P) t)‖ ≤ L) ∧ ‖(toLp 2 (obsSummary P).mX : Euc dx)‖ ≤ L := by have hL0 : 0 ≤ L := by linarith have harm (t : Bool) : 0 < P {w : FullData k dx dz | w.T = t} := fullDataArm_pos_of_latentArmPositivity P (by omega) hpi hM.latentArmPositivity t have hOuterCoordMeas (i : Fin dz) (j : Fin dx) : Measurable (fun w : FullData k dx dz => outerProduct w.Z w.X i j) := ((measurable_pi_apply i).comp measurable_fullData_Z).mul ((measurable_pi_apply j).comp measurable_fullData_X) have hZlp : Measurable (fun w : FullData k dx dz => (toLp 2 w.Z : Euc dz)) := (WithLp.measurable_toLp 2 (Fin dz → ℝ)).comp measurable_fullData_Z have hXlp : Measurable (fun w : FullData k dx dz => (toLp 2 w.X : Euc dx)) := (WithLp.measurable_toLp 2 (Fin dx → ℝ)).comp measurable_fullData_X have hOuterCont : Continuous (fun p : Euc dz × Euc dx => matrixCLM (fun i j => p.1 i * p.2 j)) := by apply matrixCLM_continuous.comp fun_prop have hOuterMapMeas : Measurable (fun w : FullData k dx dz => matrixCLM (outerProduct w.Z w.X)) := by convert hOuterCont.measurable.comp (hZlp.prodMk hXlp) using 1 funext w rfl have hYOuterCoordMeas (i : Fin dz) (j : Fin dx) : Measurable (fun w : FullData k dx dz => (w.Y • outerProduct w.Z w.X) i j) := by change Measurable (fun w : FullData k dx dz => w.Y * (w.Z i * w.X j)) exact measurable_fullData_Y.mul (((measurable_pi_apply i).comp measurable_fullData_Z).mul ((measurable_pi_apply j).comp measurable_fullData_X)) have hYOuterMapMeas : Measurable (fun w : FullData k dx dz => matrixCLM (w.Y • outerProduct w.Z w.X)) := by have heq : (fun w : FullData k dx dz => matrixCLM (w.Y • outerProduct w.Z w.X)) = fun w => w.Y • matrixCLM (outerProduct w.Z w.X) := by funext w ext x i simp [matrixCLM, Matrix.toEuclideanLin_apply, outerProduct, Finset.mul_sum] rw [heq] exact measurable_fullData_Y.smul hOuterMapMeas have hMfull (t : Bool) : ‖matrixCLM (fun i j => conditionalMean P {w | w.T = t} (fun w => outerProduct w.Z w.X i j))‖ ≤ L := conditionalMatrix_norm_le_of_ae_bound P t _ hOuterCoordMeas hOuterMapMeas hL0 hM.boundedProxyProduct (harm t) have hNfull (t : Bool) : ‖matrixCLM (fun i j => conditionalMean P {w | w.T = t} (fun w => (w.Y • outerProduct w.Z w.X) i j))‖ ≤ L := conditionalMatrix_norm_le_of_ae_bound P t _ hYOuterCoordMeas hYOuterMapMeas hL0 hM.boundedOutcomeProxyProduct (harm t) have hMobs (t : Bool) : observedProxyMoment (obsSummary P) t = fun i j => conditionalMean P {w | w.T = t} (fun w => outerProduct w.Z w.X i j) := by ext i j have ht := conditionalMean_obsArm_eq_fullDataArm P t (fun o : Obs dx dz => o.Z i * o.X j) (((measurable_pi_apply i).comp measurable_obs_Z).mul ((measurable_pi_apply j).comp measurable_obs_X)) cases t <;> simpa [observedProxyMoment, obsSummary, obsMap, outerProduct, Function.comp_def] using ht have hNobs (t : Bool) : observedOutcomeProxyMoment (obsSummary P) t = fun i j => conditionalMean P {w | w.T = t} (fun w => (w.Y • outerProduct w.Z w.X) i j) := by ext i j have ht := conditionalMean_obsArm_eq_fullDataArm P t (fun o : Obs dx dz => o.Y * o.Z i * o.X j) ((measurable_obs_Y.mul ((measurable_pi_apply i).comp measurable_obs_Z)).mul ((measurable_pi_apply j).comp measurable_obs_X)) cases t <;> simpa [observedOutcomeProxyMoment, obsSummary, obsMap, outerProduct, Function.comp_def, mul_assoc] using ht have hXMeas : Measurable (fun w : FullData k dx dz => (toLp 2 w.X : Euc dx)) := by exact hXlp have hXint : Integrable (fun w : FullData k dx dz => (toLp 2 w.X : Euc dx)) P := by apply Integrable.of_bound hXMeas.aestronglyMeasurable L simpa only [BoundedTargetProxy, EuclideanSpace.norm_eq, Real.norm_eq_abs, sq_abs] using hM.boundedX have hmEq : (toLp 2 (obsSummary P).mX : Euc dx) = ∫ w, (toLp 2 w.X : Euc dx) ∂P := by apply PiLp.ext intro j rw [eval_integral_piLp (fun i => hXint.eval_piLp i) j] change (∫ o, o.X j ∂obsLaw P) = ∫ w, w.X j ∂P rw [obsLaw] exact integral_map (obsMap_measurable k dx dz).aemeasurable (((measurable_pi_apply j).comp measurable_obs_X).aestronglyMeasurable) refine ⟨fun t => ⟨?_, ?_⟩, ?_⟩ · rw [hMobs t] exact hMfull t · rw [hNobs t] exact hNfull t · rw [hmEq] calc ‖∫ w, (toLp 2 w.X : Euc dx) ∂P‖ ≤ ∫ w, ‖(toLp 2 w.X : Euc dx)‖ ∂P := norm_integral_le_integral_norm _ _ ≤ ∫ _w, L ∂P := by apply integral_mono_ae hXint.norm (integrable_const _) filter_upwards [hM.boundedX] with w hw simpa only [EuclideanSpace.norm_eq, Real.norm_eq_abs, sq_abs] using hw _ = L := by simp
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.observedSummary_envelopes_of_model · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TObservedVMWMarginInclusion.lean:614
theorem observedProxyMoment_norm_le_stackedProxyMoment

The Euclidean norm of either arm block is at most the norm of the vertically stacked proxy-moment operator. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx dz :
s :
x :
Euc dx
t :
‖Matrix.toEuclideanLin (observedProxyMoment s t) x‖
≤ ‖Matrix.toEuclideanLin (stackedProxyMoment s) x‖
Proof (Lean source)
-- @node: observedProxyMoment_norm_le_stackedProxyMoment lemma observedProxyMoment_norm_le_stackedProxyMoment {dx dz : ℕ} (s : SummarySpace dx dz) (x : Euc dx) (t : Bool) : ‖Matrix.toEuclideanLin (observedProxyMoment s t) x‖ ≤ ‖Matrix.toEuclideanLin (stackedProxyMoment s) x‖ := by rw [EuclideanSpace.norm_eq, EuclideanSpace.norm_eq] apply Real.sqrt_le_sqrt have hsplit : (∑ i : Fin (2 * dz), ((toEuclideanLin (stackedProxyMoment s) x) i) ^ 2) = (∑ i : Fin dz, ((toEuclideanLin (observedProxyMoment s false) x) i) ^ 2) + ∑ i : Fin dz, ((toEuclideanLin (observedProxyMoment s true) x) i) ^ 2 := by let e : (Fin dz ⊕ Fin dz) ≃ Fin (2 * dz) := finSumFinEquiv.trans (finCongr (two_mul dz).symm) rw [← Equiv.sum_comp e] rw [Fintype.sum_sum_type] congr 1 · apply Finset.sum_congr rfl intro i _ congr 1 have hi : e (inl i) = ⟨i.val, by omega⟩ := by apply Fin.ext simp [e] rw [hi] change (∑ j, (if h : i.val < dz then s.M0 ⟨i.val, h⟩ j else s.M1 ⟨i.val - dz, by omega⟩ j) * x j) = ∑ j, s.M0 i j * x j simp [i.isLt] · apply Finset.sum_congr rfl intro i _ congr 1 have hi : e (inr i) = ⟨i.val + dz, by omega⟩ := by apply Fin.ext simp [e] rw [hi] change (∑ j, (if h : i.val + dz < dz then s.M0 ⟨i.val + dz, h⟩ j else s.M1 ⟨i.val + dz - dz, by omega⟩ j) * x j) = ∑ j, s.M1 i j * x j simp simp only [Real.norm_eq_abs, sq_abs] rw [hsplit] cases t · exact le_add_of_nonneg_right (sum_nonneg fun _ _ => sq_nonneg _) · exact le_add_of_nonneg_left (sum_nonneg fun _ _ => sq_nonneg _)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.observedProxyMoment_norm_le_stackedProxyMoment · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TObservedVMWMarginInclusion.lean:723
theorem stackedProxyMoment_minSingular Lemma 24 in the paper ↗

The vertically stacked proxy moment retains the common quantitative signal margin. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hL :
1 ≤ L
hpi :
0 < pi0
hsigma :
0 < sigma0
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
pi0 * sigma0 ^ 2 ≤ singularValue (stackedProxyMoment (obsSummary P)) (k - 1)
Proof (Lean source)
-- @node: stackedProxyMoment_minSingular lemma stackedProxyMoment_minSingular {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hk : 2 ≤ k) (hkx : k ≤ dx) (hL : 1 ≤ L) (hpi : 0 < pi0) (hsigma : 0 < sigma0) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) : pi0 * sigma0 ^ 2 ≤ singularValue (stackedProxyMoment (obsSummary P)) (k - 1) := by let A := toEuclideanLin (referenceFeature P false) let D := toEuclideanLin (latentArmWeights P false) let B := toEuclideanLin (targetFeature P) let S := B.range letI : Nonempty (Fin k) := ⟨⟨0, by omega⟩⟩ have injective_of_margin {rows : ℕ} (G : RectMatrix rows k) (hG : sigma0 ≤ signalMinSingular G) : Injective (toEuclideanLin G) := by rw [LinearMap.injective_iff_forall_lt_finrank_singularValues_pos] intro i hi have hik : i ≤ k - 1 := by simpa using (Nat.le_sub_one_of_lt (by simpa using hi)) exact lt_of_lt_of_le (lt_of_lt_of_le hsigma hG) ((toEuclideanLin G).singularValues_antitone hik) have hAinj := injective_of_margin (referenceFeature P false) hM.proxyRankMargin.1 have hBinj := injective_of_margin (targetFeature P) hM.proxyRankMargin.2.2 have hDinj := latentArmWeights_injective P hpi hM.latentArmPositivity false apply le_singularValues_of_subspace (toEuclideanLin (stackedProxyMoment (obsSummary P))) S (mul_nonneg hpi.le (sq_nonneg sigma0)) · dsimp [S] rw [B.finrank_range_of_inj hBinj, finrank_euclideanSpace] simp omega · intro x hx have hBexp : sigma0 * ‖x‖ ≤ ‖B.adjoint x‖ := by calc sigma0 * ‖x‖ ≤ B.singularValues (k - 1) * ‖x‖ := mul_le_mul_of_nonneg_right hM.proxyRankMargin.2.2 (norm_nonneg _) _ ≤ ‖B.adjoint x‖ := by simpa [B, S, Fintype.card_fin] using least_singularValue_mul_norm_le_adjoint_on_range B hBinj x hx have hDmargin := latentArmWeights_minSingular P hk hpi hM.latentArmPositivity false have hDexp : pi0 * ‖B.adjoint x‖ ≤ ‖D (B.adjoint x)‖ := by calc pi0 * ‖B.adjoint x‖ ≤ D.singularValues (k - 1) * ‖B.adjoint x‖ := mul_le_mul_of_nonneg_right hDmargin (norm_nonneg _) _ ≤ ‖D (B.adjoint x)‖ := by simpa [D, Fintype.card_fin] using least_singularValue_mul_norm_le D hDinj (B.adjoint x) have hAexp : sigma0 * ‖D (B.adjoint x)‖ ≤ ‖A (D (B.adjoint x))‖ := by calc sigma0 * ‖D (B.adjoint x)‖ ≤ A.singularValues (k - 1) * ‖D (B.adjoint x)‖ := mul_le_mul_of_nonneg_right hM.proxyRankMargin.1 (norm_nonneg _) _ ≤ ‖A (D (B.adjoint x))‖ := by simpa [A, Fintype.card_fin] using least_singularValue_mul_norm_le A hAinj (D (B.adjoint x)) have hchain : pi0 * sigma0 ^ 2 * ‖x‖ ≤ ‖A (D (B.adjoint x))‖ := by calc pi0 * sigma0 ^ 2 * ‖x‖ = sigma0 * pi0 * (sigma0 * ‖x‖) := by ring _ ≤ sigma0 * pi0 * ‖B.adjoint x‖ := mul_le_mul_of_nonneg_left hBexp (mul_nonneg hsigma.le hpi.le) _ = sigma0 * (pi0 * ‖B.adjoint x‖) := by ring _ ≤ sigma0 * ‖D (B.adjoint x)‖ := mul_le_mul_of_nonneg_left hDexp hsigma.le _ ≤ ‖A (D (B.adjoint x))‖ := hAexp have hAdj : B.adjoint = toEuclideanLin (targetFeature P).transpose := by rw [← Matrix.toEuclideanLin_conjTranspose_eq_adjoint] rfl have hfac := observedProxyMoment_factorization P hk hkx hL hpi hM false calc pi0 * sigma0 ^ 2 * ‖x‖ ≤ ‖A (D (B.adjoint x))‖ := hchain _ = ‖Matrix.toEuclideanLin (observedProxyMoment (obsSummary P) false) x‖ := by rw [hfac, hAdj] simp [A, D, B, Matrix.toEuclideanLin_apply, Matrix.mulVec_mulVec] _ ≤ ‖Matrix.toEuclideanLin (stackedProxyMoment (obsSummary P)) x‖ := observedProxyMoment_norm_le_stackedProxyMoment (obsSummary P) x false
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.stackedProxyMoment_minSingular · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TObservedVMWMarginInclusion.lean:767
theorem observed_vmw_margin_inclusion Proposition 1 in the paper ↗

Uniform observed-moment and latent-outcome consequences of model membership, together with the conditional cited-scope transfer to the published VMW model. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
publishedScope :
publishedMargins :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hsigma :
0 < sigma0
hsigmaMax :
sigma0 ≤ 1
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
hVMWModelScope_of_gate :
VMWModelScope publishedScope publishedMargins
conclusion 1
t :
k * pi0 ≤ P.real {w | w.T = t}
conclusion 2
pi0 * sigma0 ^ 2 ≤ singularValue (stackedProxyMoment (obsSummary P)) (k - 1)
conclusion 3
t :
‖matrixCLM (if t then (obsSummary P).M1 else (obsSummary P).M0)‖ ≤ L
‖matrixCLM (if t then (obsSummary P).N1 else (obsSummary P).N0)‖ ≤ L
conclusion 4
‖(toLp 2 (obsSummary P).mX : Euc dx)‖ ≤ L
conclusion 5
u :
Fin k
t :
∀ᵐ w ∂P.restrict (latentClass u), |potential t w| ≤ effectRadius dz L sigma0 / 2
|latentMean P t u| ≤ effectRadius dz L sigma0 / 2
|latentEffect P u| ≤ effectRadius dz L sigma0
conclusion 6
PublishedVMWModel publishedScope P
Proof (Lean source)
-- @node: prop:observed-vmw-margin-inclusion theorem observed_vmw_margin_inclusion {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (publishedScope : PublishedVMWScopeHandle) (publishedMargins : PublishedVMWMarginRecord) (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hpiMax : pi0 ≤ 1 / (2 * k : ℝ)) (hsigma : 0 < sigma0) (hsigmaMax : sigma0 ≤ 1) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) (hVMWModelScope_of_gate : VMWModelScope publishedScope publishedMargins) : (∀ t : Bool, k * pi0 ≤ P.real {w | w.T = t} ∧ observedProxyMoment (obsSummary P) t = referenceFeature P t * latentArmWeights P t * (targetFeature P).transpose ∧ ∀ V : SignalBasis dx k, V.SpansSignal (obsSummary P) → signalMinSingular (observedProxyMoment (obsSummary P) t * V.V) = singularValue (observedProxyMoment (obsSummary P) t) (k - 1) ∧ pi0 * sigma0 ^ 2 ≤ signalMinSingular (observedProxyMoment (obsSummary P) t * V.V)) ∧ pi0 * sigma0 ^ 2 ≤ singularValue (stackedProxyMoment (obsSummary P)) (k - 1) ∧ (∀ t : Bool, ‖matrixCLM (if t then (obsSummary P).M1 else (obsSummary P).M0)‖ ≤ L ∧ ‖matrixCLM (if t then (obsSummary P).N1 else (obsSummary P).N0)‖ ≤ L) ∧ ‖(toLp 2 (obsSummary P).mX : Euc dx)‖ ≤ L ∧ (∀ u : Fin k, ∀ t : Bool, (∀ᵐ w ∂P.restrict (latentClass u), |potential t w| ≤ effectRadius dz L sigma0 / 2) ∧ |latentMean P t u| ≤ effectRadius dz L sigma0 / 2 ∧ |latentEffect P u| ≤ effectRadius dz L sigma0) ∧ PublishedVMWModel publishedScope P := by have hEnv := observedSummary_envelopes_of_model P hk hkx hL hpi hM have hMean (u : Fin k) (t : Bool) : |latentMean P t u| ≤ effectRadius dz L sigma0 / 2 := by exact latentMean_abs_le_of_model P hk hkx hkz hL hpi hsigma hM u t refine ⟨?_, stackedProxyMoment_minSingular P hk hkx hL hpi hsigma hM, ?_, hEnv.2, ?_, ?_⟩ · intro t refine ⟨arm_mass_lower_of_latentArmPositivity P hM.latentArmPositivity t, observedProxyMoment_factorization P hk hkx hL hpi hM t, ?_⟩ intro V hV exact observedProxyMoment_compression_margin P hk hkx hL hpi hsigma hM t V hV · intro t cases t with | false => simpa [observedProxyMoment, observedOutcomeProxyMoment] using hEnv.1 false | true => simpa [observedProxyMoment, observedOutcomeProxyMoment] using hEnv.1 true · intro u t refine ⟨ae_abs_potential_le_on_latentClass P hk hkx hkz hL hpi hsigma hM u t, hMean u t, ?_⟩ exact latentEffect_abs_le_of_model P hk hkx hkz hL hpi hsigma hM u · exact (hVMWModelScope_of_gate.2 k dx dz P inferInstance).2 (ucvmwModel_publishedQualitativeConditions k dx dz L pi0 sigma0 P ⟨hk, hkx, hkz, hL, hpi, hpiMax, hsigma, hsigmaMax⟩ hM)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.observed_vmw_margin_inclusion · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TObservedVMWMarginInclusion.lean:844
theorem observed_summary_block_bounds

The five observable blocks of a model-generated summary obey the common envelope. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hsigma :
0 < sigma0
hsigmaMax :
sigma0 ≤ 1
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
conclusion 1
‖matrixCLM (obsSummary P).M0‖ ≤ L
conclusion 2
‖matrixCLM (obsSummary P).M1‖ ≤ L
conclusion 3
‖matrixCLM (obsSummary P).N0‖ ≤ L
conclusion 4
‖matrixCLM (obsSummary P).N1‖ ≤ L
conclusion 5
‖(obsSummary P).mX‖ ≤ L
Proof (Lean source)
-- @node: observed_summary_block_bounds lemma observed_summary_block_bounds {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hpiMax : pi0 ≤ 1 / (2 * k : ℝ)) (hsigma : 0 < sigma0) (hsigmaMax : sigma0 ≤ 1) (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) : ‖matrixCLM (obsSummary P).M0‖ ≤ L ∧ ‖matrixCLM (obsSummary P).M1‖ ≤ L ∧ ‖matrixCLM (obsSummary P).N0‖ ≤ L ∧ ‖matrixCLM (obsSummary P).N1‖ ≤ L ∧ ‖(obsSummary P).mX‖ ≤ L := by have h := observedSummary_envelopes_of_model P hk hkx hL hpi hM have hmX : ‖(obsSummary P).mX‖ ≤ L := by rw [pi_norm_le_iff_of_nonneg (by linarith : 0 ≤ L)] intro i have hi := PiLp.norm_apply_le (toLp 2 (obsSummary P).mX : Euc dx) i simpa only [Real.norm_eq_abs] using hi.trans h.2 exact ⟨by simpa [observedProxyMoment] using (h.1 false).1, by simpa [observedProxyMoment] using (h.1 true).1, by simpa [observedOutcomeProxyMoment] using (h.1 false).2, by simpa [observedOutcomeProxyMoment] using (h.1 true).2, hmX⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.observed_summary_block_bounds · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TObservedVMWMarginInclusion.lean:898
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.TPolynomialLatticeEstimator 1 declarations
theorem polynomial_lattice_law_estimator Proposition 4 in the paper ↗

Existence and deterministic/high-probability guarantees of the explicit no-advice structured lattice estimator, including its atom floor and polynomial candidate count. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hsigma :
0 < sigma0
hsigmaMax :
sigma0 ≤ 1
∃ C : ℝ,
0 < prescribedLatticeConstant k dx dz L pi0 sigma0
0 < C
conclusion 1
n :
1 ≤ n
∃ A : LatticeEstimator k dx dz n (effectRadius dz L sigma0),
IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A
A.atomFloor = pi0
Measurable A.summaryRule
A.estimate = fun sample => A.summaryRule (empSummary sample)
sample :
AtomicLaw.AtomFloor pi0 (A.estimate sample).representative.1
P :
Measure (FullData k dx dz)
letI := _hP (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P)
ThresholdRecoversDimension k (pi0 * sigma0 ^ 2 / 2) (obsSummary P)
s :
dS s (obsSummary P) < pi0 * sigma0 ^ 2 / 2
ThresholdRecoversDimension k (pi0 * sigma0 ^ 2 / 2) s
(A.candidateCount : ℝ) ≤ C * rpow (n : ℝ) ((dx * k + k^2 + 2*k - 1 : ℝ) / 2)
(latticeOperationCount A : ℝ)
≤ C * (n + rpow (n : ℝ) ((dx * k + k^2 + 2*k - 1 : ℝ) / 2))
P :
Measure (FullData k dx dz)
letI := _hP (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P)
sample :
AtomicLaw.LawModulo.wass1 (A.estimate sample) (quotientLaw P hM)
prescribedLatticeConstant k dx dz L pi0 sigma0 * (dS (empSummary sample) (obsSummary P) + (sqrt n)⁻¹)
eta :
P :
Measure (FullData k dx dz)
letI
Proof (Lean source)
-- @node: prop:polynomial-net-law-estimator theorem polynomial_lattice_law_estimator (k dx dz : ℕ) (L pi0 sigma0 : ℝ) (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hpiMax : pi0 ≤ 1 / (2 * k : ℝ)) (hsigma : 0 < sigma0) (hsigmaMax : sigma0 ≤ 1) : ∃ C : ℝ, 0 < prescribedLatticeConstant k dx dz L pi0 sigma0 ∧ 0 < C ∧ -- @realizes \(C\)(positive lattice complexity and tail constant) ∀ n : ℕ, 1 ≤ n → ∃ A : LatticeEstimator k dx dz n (effectRadius dz L sigma0), IsPrescribedStructuredLattice (L := L) (pi0 := pi0) (sigma0 := sigma0) A ∧ A.atomFloor = pi0 ∧ Measurable A.summaryRule ∧ (A.estimate = fun sample => A.summaryRule (empSummary sample)) ∧ (∀ sample, AtomicLaw.AtomFloor pi0 (A.estimate sample).representative.1) ∧ (∀ (P : Measure (FullData k dx dz)) (_hP : IsProbabilityMeasure P), letI := _hP (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) → ThresholdRecoversDimension k (pi0 * sigma0 ^ 2 / 2) (obsSummary P) ∧ ∀ s, dS s (obsSummary P) < pi0 * sigma0 ^ 2 / 2 → ThresholdRecoversDimension k (pi0 * sigma0 ^ 2 / 2) s) ∧ (A.candidateCount : ℝ) ≤ C * rpow (n : ℝ) ((dx * k + k^2 + 2*k - 1 : ℝ) / 2) ∧ (latticeOperationCount A : ℝ) ≤ C * (n + rpow (n : ℝ) ((dx * k + k^2 + 2*k - 1 : ℝ) / 2)) ∧ (∀ (P : Measure (FullData k dx dz)) (_hP : IsProbabilityMeasure P), letI := _hP (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) → ∀ sample, AtomicLaw.LawModulo.wass1 (A.estimate sample) (quotientLaw P hM) ≤ prescribedLatticeConstant k dx dz L pi0 sigma0 * (dS (empSummary sample) (obsSummary P) + (sqrt n)⁻¹)) ∧ ∀ eta : ℝ, TailLevelDomain eta → ∀ (P : Measure (FullData k dx dz)) (_hP : IsProbabilityMeasure P), letI := _hP (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) → (sampleLaw (n := n) P).real {sample | AtomicLaw.LawModulo.wass1 (A.estimate sample) (quotientLaw P hM) > C * sqrt (log (C / eta) / n)} ≤ eta := by obtain ⟨Ccount, hCcount, hcount⟩ := prescribed_latticeOperationCount_polynomial_bound k dx dz L pi0 sigma0 hk hkx hkz hL hpi hpiMax hsigma hsigmaMax obtain ⟨C0, hC0, hconc⟩ := uniform_summary_concentration k dx dz pi0 sigma0 hk hkx hkz hpi hpiMax hsigma hsigmaMax let Clat := prescribedLatticeConstant k dx dz L pi0 sigma0 let Ctail := max C0 (max (exp 1) (Clat * (C0 * L + 1))) let C := max Ccount Ctail have hClat : 0 < Clat := prescribedLatticeConstant_pos k dx dz L pi0 sigma0 hk hkx hkz hL hpi hsigma have hCtail : 0 < Ctail := lt_of_lt_of_le (Real.exp_pos 1) (le_trans (le_max_left _ _) (le_max_right _ _)) have hC : 0 < C := hCtail.trans_le (le_max_right _ _) refine ⟨C, hClat, hC, ?_⟩ intro n hn obtain ⟨A, hA, hatom, hmeas, hestimate, hfloor⟩ := structuredLatticeEstimator_exists (n := n) hk hkx hkz hL hpi hpiMax hsigma hsigmaMax have hcounts := hcount n hn A hA have hCcountLe : Ccount ≤ C := le_max_left _ _ have hrpow0 : 0 ≤ rpow (n : ℝ) ((dx * k + k ^ 2 + 2 * k - 1 : ℝ) / 2) := Real.rpow_nonneg (Nat.cast_nonneg n) _ have hcand : (A.candidateCount : ℝ) ≤ C * rpow (n : ℝ) ((dx * k + k ^ 2 + 2 * k - 1 : ℝ) / 2) := hcounts.1.trans (mul_le_mul_of_nonneg_right hCcountLe hrpow0) have hwork : (latticeOperationCount A : ℝ) ≤ C * (n + rpow (n : ℝ) ((dx * k + k ^ 2 + 2 * k - 1 : ℝ) / 2)) := by have hsum0 : 0 ≤ (n : ℝ) + rpow (n : ℝ) ((dx * k + k ^ 2 + 2 * k - 1 : ℝ) / 2) := add_nonneg (Nat.cast_nonneg n) hrpow0 exact hcounts.2.trans (mul_le_mul_of_nonneg_right hCcountLe hsum0) refine ⟨A, hA, hatom, hmeas, hestimate, hfloor, ?_, hcand, hwork, ?_, ?_⟩ · intro P hP letI := hP intro hM exact ⟨model_thresholdRecoversDimension P hM, fun s hs => model_thresholdRecoversDimension_of_dS_lt P hM s hs⟩ · intro P hP letI := hP intro hM sample exact prescribedEstimator_wass1_le P A hA sample hn hk hkx hkz hL hpi hpiMax hsigma hsigmaMax hM · intro eta hEta P hP rcases hEta with ⟨heta, hetaHalf⟩ letI := hP intro hM have hdev := (hconc L n hL hn P hP hM eta ⟨heta, hetaHalf⟩).1 have hCtailLe : Ctail ≤ C := le_max_right _ _ have hC0C : C0 ≤ C := (le_max_left _ _).trans hCtailLe have hexpC : exp 1 ≤ C := (le_trans (le_max_left _ _) (le_max_right _ _)).trans hCtailLe have hcoefC : Clat * (C0 * L + 1) ≤ C := (le_trans (le_max_right _ _) (le_max_right _ _)).trans hCtailLe have hC0pos : 0 < C0 := lt_of_lt_of_le zero_lt_one hC0 have hetaOne : eta ≤ 1 := by linarith have hratioExp : exp 1 ≤ C / eta := by rw [le_div_iff₀ heta] exact (mul_le_of_le_one_right (Real.exp_pos 1).le hetaOne).trans hexpC have hlogOne : 1 ≤ log (C / eta) := by rw [← Real.log_exp 1] exact Real.log_le_log (Real.exp_pos 1) hratioExp have hratio : C0 / eta ≤ C / eta := div_le_div_of_nonneg_right hC0C heta.le have hlog : log (C0 / eta) ≤ log (C / eta) := Real.log_le_log (div_pos hC0pos heta) hratio have hsqrt : sqrt (log (C0 / eta) / (n : ℝ)) ≤ sqrt (log (C / eta) / (n : ℝ)) := by apply Real.sqrt_le_sqrt exact div_le_div_of_nonneg_right hlog (Nat.cast_nonneg n) have hinv : (sqrt n)⁻¹ ≤ sqrt (log (C / eta) / (n : ℝ)) := by calc (sqrt n)⁻¹ = sqrt ((n : ℝ)⁻¹) := (Real.sqrt_inv _).symm _ = sqrt (1 / (n : ℝ)) := by rw [one_div] _ ≤ sqrt (log (C / eta) / (n : ℝ)) := by apply Real.sqrt_le_sqrt exact div_le_div_of_nonneg_right hlogOne (Nat.cast_nonneg n) have hsubset : {sample | AtomicLaw.LawModulo.wass1 (A.estimate sample) (quotientLaw P hM) > C * sqrt (log (C / eta) / n)} ⊆ {sample | C0 * L * sqrt (log (C0 / eta) / n) < dS (empSummary sample) (obsSummary P)} := by intro sample hs by_contra hgood have hdS : dS (empSummary sample) (obsSummary P) ≤ C0 * L * sqrt (log (C0 / eta) / n) := le_of_not_gt hgood have hw := prescribedEstimator_wass1_le P A hA sample hn hk hkx hkz hL hpi hpiMax hsigma hsigmaMax hM have hbound : Clat * (dS (empSummary sample) (obsSummary P) + (sqrt n)⁻¹) ≤ C * sqrt (log (C / eta) / n) := by calc _ ≤ Clat * (C0 * L * sqrt (log (C0 / eta) / n) + (sqrt n)⁻¹) := mul_le_mul_of_nonneg_left (add_le_add hdS (le_refl _)) hClat.le _ ≤ Clat * (C0 * L * sqrt (log (C / eta) / n) + sqrt (log (C / eta) / n)) := by gcongr _ = (Clat * (C0 * L + 1)) * sqrt (log (C / eta) / n) := by ring _ ≤ C * sqrt (log (C / eta) / n) := mul_le_mul_of_nonneg_right hcoefC (Real.sqrt_nonneg _) exact (not_lt_of_ge (hw.trans (by simpa [Clat] using hbound))) hs exact (measureReal_mono hsubset).trans hdev
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.polynomial_lattice_law_estimator · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TPolynomialLatticeEstimator.lean:9
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.TPublishedVMWConverseTransfer 5 declarations
def lawRisk

For the supplied parameters, law Risk is given by its defining clause.

Definition (Lean source)
n :
hvalid :
AtomicLaw.Valid (quotientLawRaw Q.measure (effectRadius 2 2 (1 / 10)))
est :
LawEstimator 2 2 2 n (effectRadius 2 2 (1 / 10))
lawRisk Q hvalid est :
by letI := Q.prob let target := AtomicLaw.LawModulo.ofProbabilityLaw ⟨quotientLawRaw Q.measure (effectRadius 2 2 (1 / 10)), hvalid⟩ exact ∫ sample, AtomicLaw.LawModulo.wass1 (est.eval sample) target ∂sampleLaw (n := n) Q.measure
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.FullDataProbabilityLaw.lawRisk · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TPublishedVMWConverseTransfer.lean:14
def weightRisk

For the supplied parameters, weight Risk is given by its defining clause.

Definition (Lean source)
n :
est :
weightRisk Q est :
by letI := Q.prob exact expectedWeightRisk Q.measure (orderedMasses (quotientLawRaw Q.measure (effectRadius 2 2 (1 / 10)))) est
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.FullDataProbabilityLaw.weightRisk · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TPublishedVMWConverseTransfer.lean:25
theorem gapStratum_publishedSpectralSeparation

Distinct effects in a gap stratum imply the qualitative spectral-separation condition. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
g :
hM :
GapStratum (L := 2) (pi0 := 1 / 10) (sigma0 := 1 / 10) (g := g) P
Proof (Lean source)
-- @node: publishedVMWConverseTransfer_gapStratum_separated lemma gapStratum_publishedSpectralSeparation {g : ℝ} {P : Measure (FullData 2 2 2)} [IsProbabilityMeasure P] (hM : GapStratum (L := 2) (pi0 := 1 / 10) (sigma0 := 1 / 10) (g := g) P) : PublishedSpectralSeparation (latentEffect P) := by have hmass (u : Fin 2) : 0 < latentMass P u := by exact lt_of_lt_of_le (by norm_num : (0 : ℝ) < 1 / 10) ((hM.toUCVMWModel.latentArmPositivity u false).trans (measureReal_mono (fun _ hw => hw.1))) have hfilter : (Finset.univ.filter fun u : Fin 2 => 0 < latentMass P u) = Finset.univ := Finset.filter_eq_self.mpr fun u _ => hmass u have hcard : ((Finset.univ : Finset (Fin 2)).image (latentEffect P)).card = (Finset.univ : Finset (Fin 2)).card := by rw [Finset.card_univ] simpa [DistinctEffects, hfilter] using hM.distinctEffects have hinj := Finset.card_image_iff.mp hcard intro u v huv exact fun huvEq => huv (hinj (by simp) (by simp) huvEq)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.gapStratum_publishedSpectralSeparation · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TPublishedVMWConverseTransfer.lean:33
theorem publishedTopRightSignalBasis_exists

Under model membership, the leading right singular vectors of the stacked proxy moment give a signal-spanning basis satisfying the published population equations.

Formal statement
k dx dz :
L pi0 sigma0 :
hM :
UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P
∃ basis : SignalBasis dx k,
conclusion 2
basis.SpansSignal (obsSummary P)
Proof (Lean source)
-- @node: publishedTopRightSignalBasis_exists lemma publishedTopRightSignalBasis_exists {k dx dz : ℕ} {L pi0 sigma0 : ℝ} (P : Measure (FullData k dx dz)) [IsProbabilityMeasure P] (hM : UCVMWModel (L := L) (pi0 := pi0) (sigma0 := sigma0) P) : ∃ basis : SignalBasis dx k, PublishedVMWTopRightSingularBasis (obsSummary P) basis ∧ basis.SpansSignal (obsSummary P) := by classical rcases hM.coreDomain with ⟨hk, hkx, _hkz, hL, hpi, _hpiMax, hsigma, _hsigmaMax⟩ let Q : ModelLaw k dx dz L pi0 sigma0 := ⟨P, inferInstance, hM⟩ let facts := choice (modelCompressedSpectralFacts_exists Q) let A := stackedProxyMoment (obsSummary P) let S := singularSystem A let r : Fin k → Fin dx := fun j => ⟨j, j.isLt.trans_le hkx⟩ let V : SignalBasis dx k := { V := fun i j => S.right (r j) i orthonormal := by intro i j by_cases hij : i = j · subst j simpa using S.right_orthonormal (r i) (r i) · have hrij : r i ≠ r j := by intro h apply hij exact Fin.ext (by simpa [r] using congrArg val h) simpa [hij, hrij] using S.right_orthonormal (r i) (r j) } have hspos (j : Fin k) : 0 < S.sigma (r j) := by rw [S.sigma_eq] have hlast := stackedProxyMoment_minSingular P hk hkx hL hpi hsigma hM have hant := (toEuclideanLin A).singularValues_antitone (Nat.le_sub_one_of_lt j.isLt) exact (mul_pos hpi (sq_pos_of_pos hsigma)).trans_le (hlast.trans (by simpa [A, singularValue] using hant)) have htop : PublishedVMWTopRightSingularBasis (obsSummary P) V := by intro j change mulVec (A.transpose * A) (fun i => S.right (r j) i) = singularValue A j.val ^ 2 • (fun i => S.right (r j) i) rw [← Matrix.mulVec_mulVec] have hr : A.mulVec (fun i => S.right (r j) i) = S.sigma (r j) • (fun i => S.left (r j) i) := by funext y change (∑ x, A y x * S.right (r j) x) = _ exact S.apply_right (r j) y rw [hr, Matrix.mulVec_smul] have hl : A.transpose.mulVec (fun i => S.left (r j) i) = S.sigma (r j) • (fun i => S.right (r j) i) := by funext x change (∑ y, A y x * S.left (r j) y) = _ exact S.apply_left_transpose (r j) x rw [hl] ext i simp [S.sigma_eq, r] ring have hAdjRange : range (toEuclideanLin A).adjoint ≤ signalRowspace (obsSummary P) := by intro x hx rcases hx with ⟨y, rfl⟩ let y0 : Euc dz := toLp 2 (fun i : Fin dz => y.ofLp ⟨i, by omega⟩) let y1 : Euc dz := toLp 2 (fun i : Fin dz => y.ofLp ⟨dz + i, by omega⟩) have heq : (toEuclideanLin A).adjoint y = toEuclideanLin (obsSummary P).M0.transpose y0 + toEuclideanLin (obsSummary P).M1.transpose y1 := by rw [← Matrix.toEuclideanLin_conjTranspose_eq_adjoint] apply PiLp.ext intro i change (∑ q, A q i * y.ofLp q) = (∑ q, (obsSummary P).M0 q i * y0.ofLp q) + ∑ q, (obsSummary P).M1 q i * y1.ofLp q let e : Fin (dz + dz) ≃ Fin (2 * dz) := finCongr (by omega) rw [← e.sum_comp (fun q => A q i * y.ofLp q), Fin.sum_univ_add] simp [A, stackedProxyMoment, y0, y1, e] congr 1 apply Finset.sum_congr rfl intro x _ have hi : cast (by omega : dz + dz = 2 * dz) (Fin.addNat x dz) = (⟨dz + x.val, by omega⟩ : Fin (2 * dz)) := by apply Fin.ext simp [Nat.add_comm] rw [hi] rw [heq] exact Submodule.add_mem _ ((le_sup_left : range (toEuclideanLin (obsSummary P).M0.transpose) ≤ signalRowspace (obsSummary P)) ⟨y0, rfl⟩) ((le_sup_right : range (toEuclideanLin (obsSummary P).M1.transpose) ≤ signalRowspace (obsSummary P)) ⟨y1, rfl⟩) have hcol (j : Fin k) : toLp 2 (fun i => S.right (r j) i) ∈ range (toEuclideanLin A).adjoint := by have hadj : (toEuclideanLin A).adjoint = toEuclideanLin A.transpose := by rw [← Matrix.toEuclideanLin_conjTranspose_eq_adjoint] rfl let left : Euc (2 * dz) := toLp 2 (fun i => S.left (r j) i) refine ⟨(S.sigma (r j))⁻¹ • left, ?_⟩ rw [hadj, LinearMap.map_smul] have hl : toEuclideanLin A.transpose left = S.sigma (r j) • toLp 2 (fun i => S.right (r j) i) := by apply PiLp.ext intro i change (∑ y, A y i * S.left (r j) y) = _ exact S.apply_left_transpose (r j) i rw [hl, smul_smul] simp [hspos j |>.ne'] have hVle : range (toEuclideanLin V.V) ≤ signalRowspace (obsSummary P) := by intro x hx rcases hx with ⟨y, rfl⟩ have heq : toEuclideanLin V.V y = ∑ j : Fin k, y j • toLp 2 (fun i => S.right (r j) i) := by apply PiLp.ext intro i change (mulVec V.V y.ofLp) i = _ simp [V, mulVec, dotProduct, mul_comm] rw [heq] exact Submodule.sum_mem _ fun j _ => Submodule.smul_mem _ _ (hAdjRange (hcol j)) have hVrank : finrank ℝ (range (toEuclideanLin V.V)) = k := by change finrank ℝ (range (signalBasisLinearIsometry V).toLinearMap) = k rw [(signalBasisLinearIsometry V).toLinearMap.finrank_range_of_inj (signalBasisLinearIsometry V).injective, finrank_euclideanSpace] simp have hSignalRank : finrank ℝ (signalRowspace (obsSummary P)) = k := by change finrank ℝ (signalRowspace Q.summary) = k rw [← facts.spans] change finrank ℝ (range (signalBasisLinearIsometry facts.basis).toLinearMap) = k rw [(signalBasisLinearIsometry facts.basis).toLinearMap.finrank_range_of_inj (signalBasisLinearIsometry facts.basis).injective, finrank_euclideanSpace] simp refine ⟨V, htop, ?_⟩ exact Submodule.eq_of_le_of_finrank_le hVle (by rw [hVrank, hSignalRank])
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.publishedTopRightSignalBasis_exists · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TPublishedVMWConverseTransfer.lean:53
theorem published_vmw_converse_transfer Theorem 7 in the paper ↗

Relative to one fixed nominal published-scope handle, any comparator classes containing the explicit quotient and separated labeled witness pairs inherit the two Le Cam converses. No upper or confidence result is transferred. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
publishedScope :
publishedMargins :
hVMWModelScope_of_gate :
VMWModelScope publishedScope publishedMargins
hVMWSeparatedRecoveryScope_of_gate :
∃ a c : ℝ,
0 < a
a ≤ 1 / 8
0 < c
conclusion 1
n :
1 ≤ n
(∀ Q ∈ Vnu, letI := Q.prob; PublishedVMWModel publishedScope Q.measure ∧ ConcreteVMWAssumption4 Q.measure)
(∃ Q0 ∈ Vnu, ∃ Q1 ∈ Vnu, Q0.measure = witnessLaw 0 ∧ Q1.measure = witnessLaw (a / sqrt n))
est :
LawEstimator 2 2 2 n (effectRadius 2 2 (1 / 10))
∃ Q ∈ Vnu,
∃ hvalid : AtomicLaw.Valid (quotientLawRaw Q.measure (effectRadius 2 2 (1 / 10))),
c / sqrt n ≤ Q.lawRisk hvalid est
(∀ Q ∈ Vp, letI := Q.prob; PublishedVMWModel publishedScope Q.measure ∧ ConcreteVMWAssumption4 Q.measure)
(∃ Q0 ∈ Vp, ∃ Q1 ∈ Vp, Q0.measure = pathLaw g 0 ∧ Q1.measure = pathLaw g h)
est :
∃ Q ∈ Vp, c * min 1 (sqrt n * g)⁻¹ ≤ Q.weightRisk est
Proof (Lean source)
-- @node: thm:published-vmw-converse-transfer theorem published_vmw_converse_transfer (publishedScope : PublishedVMWScopeHandle) (publishedMargins : PublishedVMWMarginRecord) (hVMWModelScope_of_gate : VMWModelScope publishedScope publishedMargins) (hVMWSeparatedRecoveryScope_of_gate : VMWSeparatedRecoveryScope publishedScope) : ∃ a c : ℝ, 0 < a ∧ a ≤ 1 / 8 ∧ -- @realizes \(a\)(universal amplitude in (0,1/8]) 0 < c ∧ -- @realizes \(c\)(positive published-converse lower constant) ∀ n : ℕ, 1 ≤ n → (∃ (hW0 : IsProbabilityMeasure (witnessLaw 0)) (hW1 : IsProbabilityMeasure (witnessLaw (a / sqrt n))), letI := hW0 letI := hW1 PublishedVMWModel publishedScope (witnessLaw 0) ∧ ConcreteVMWAssumption4 (witnessLaw 0) ∧ PublishedVMWModel publishedScope (witnessLaw (a / sqrt n)) ∧ ConcreteVMWAssumption4 (witnessLaw (a / sqrt n)) ∧ ¬ PublishedVMWRecoveryRegime publishedScope (witnessLaw 0)) ∧ (∀ (Vnu : Set (FullDataProbabilityLaw (FullData 2 2 2))), (∀ Q ∈ Vnu, letI := Q.prob; PublishedVMWModel publishedScope Q.measure ∧ ConcreteVMWAssumption4 Q.measure) → (∃ Q0 ∈ Vnu, ∃ Q1 ∈ Vnu, Q0.measure = witnessLaw 0 ∧ Q1.measure = witnessLaw (a / sqrt n)) → (∀ est : LawEstimator 2 2 2 n (effectRadius 2 2 (1 / 10)), ∃ Q ∈ Vnu, ∃ hvalid : AtomicLaw.Valid (quotientLawRaw Q.measure (effectRadius 2 2 (1 / 10))), c / sqrt n ≤ Q.lawRisk hvalid est)) ∧ ∀ g : ℝ, GapScaleDomain g → let h := calibratedDisplacement a n g TangentAmplitudeDomain h ∧ (∃ (hPath0 : IsProbabilityMeasure (pathLaw g 0)) (hPath1 : IsProbabilityMeasure (pathLaw g h)), letI := hPath0 letI := hPath1 PublishedVMWModel publishedScope (pathLaw g 0) ∧ ConcreteVMWAssumption4 (pathLaw g 0) ∧ PublishedVMWModel publishedScope (pathLaw g h) ∧ ConcreteVMWAssumption4 (pathLaw g h) ∧ PublishedSpectralSeparation (latentEffect (pathLaw g 0)) ∧ PublishedSpectralSeparation (latentEffect (pathLaw g h))) ∧ ∀ (Vp : Set (FullDataProbabilityLaw (FullData 2 2 2))), (∀ Q ∈ Vp, letI := Q.prob; PublishedVMWModel publishedScope Q.measure ∧ ConcreteVMWAssumption4 Q.measure) → (∃ Q0 ∈ Vp, ∃ Q1 ∈ Vp, Q0.measure = pathLaw g 0 ∧ Q1.measure = pathLaw g h) → ∀ est : WeightEstimator 2 2 2 n, ∃ Q ∈ Vp, c * min 1 (sqrt n * g)⁻¹ ≤ Q.weightRisk est := by obtain ⟨a, cLower, CKL, ha, haMax, hcLower, hCKL, hlower⟩ := matching_local_lower_bounds (1 / 4) (by exact ⟨by norm_num, by norm_num⟩) refine ⟨a, cLower, ha, haMax, hcLower, ?_⟩ intro n hn have hpair := (hlower n hn).2.2.1 obtain ⟨hW0, hW1, hM0, hM1, hpairKL, hpairSep⟩ := hpair have hpub0 : PublishedVMWModel publishedScope (witnessLaw 0) := (hVMWModelScope_of_gate.2 2 2 2 (witnessLaw 0) hW0).2 (ucvmwModel_publishedQualitativeConditions 2 2 2 2 (1 / 10) (1 / 10) (witnessLaw 0) hM0.toUCVMWModel.coreDomain hM0.toUCVMWModel) have hpub1 : PublishedVMWModel publishedScope (witnessLaw (a / sqrt n)) := (hVMWModelScope_of_gate.2 2 2 2 (witnessLaw (a / sqrt n)) hW1).2 (ucvmwModel_publishedQualitativeConditions 2 2 2 2 (1 / 10) (1 / 10) (witnessLaw (a / sqrt n)) hM1.toUCVMWModel.coreDomain hM1.toUCVMWModel) have hA40 : ConcreteVMWAssumption4 (witnessLaw 0) := by exact concreteVMWAssumption4_of_ucvmwModel (witnessLaw 0) hM0.toUCVMWModel have hA41 : ConcreteVMWAssumption4 (witnessLaw (a / sqrt n)) := by exact concreteVMWAssumption4_of_ucvmwModel (witnessLaw (a / sqrt n)) hM1.toUCVMWModel have hnotsep : ¬ PublishedSpectralSeparation (latentEffect (witnessLaw 0)) := by intro hsep have h01 := hsep (0 : Fin 2) (1 : Fin 2) (by decide) rw [witness_latentEffect 0 (by norm_num) (by norm_num), witness_latentEffect 0 (by norm_num) (by norm_num)] at h01 norm_num at h01 have hnotRecovery : ¬ PublishedVMWRecoveryRegime publishedScope (witnessLaw 0) := by intro hRecovery have hscope := hVMWSeparatedRecoveryScope_of_gate.2.1 2 2 2 (witnessLaw 0) hW0 (by norm_num [VMWPositiveDimensionDomain]) |>.mp hRecovery exact hnotsep hscope.2.2.2.2.2.2.2.2 refine ⟨⟨hW0, hW1, hpub0, hA40, hpub1, hA41, hnotRecovery⟩, ?_, ?_⟩ · intro Vnu _hVPublished hcontain obtain ⟨Q0, hQ0, Q1, hQ1, hQ0eq, hQ1eq⟩ := hcontain intro est obtain ⟨P, hP, hLocal, hwhich, hRisk⟩ := (hlower n hn).1 est rcases hwhich with hP0 | hP1 · have hvalidQ0 : AtomicLaw.Valid (quotientLawRaw Q0.measure (effectRadius 2 2 (1 / 10))) := by simpa [hQ0eq] using quotientLawRaw_valid (witnessLaw 0) hM0.toUCVMWModel refine ⟨Q0, hQ0, hvalidQ0, ?_⟩ subst P simpa [FullDataProbabilityLaw.lawRisk, expectedLawRisk, quotientLaw, hQ0eq] using hRisk · have hvalidQ1 : AtomicLaw.Valid (quotientLawRaw Q1.measure (effectRadius 2 2 (1 / 10))) := by simpa [hQ1eq] using quotientLawRaw_valid (witnessLaw (a / sqrt n)) hM1.toUCVMWModel refine ⟨Q1, hQ1, hvalidQ1, ?_⟩ subst P simpa [FullDataProbabilityLaw.lawRisk, expectedLawRisk, quotientLaw, hQ1eq] using hRisk · intro g hGap obtain ⟨hg, hgMax⟩ := hGap have hlocalPair := (hlower n hn).2.2.2 g ⟨hg, hgMax⟩ dsimp only at hlocalPair obtain ⟨hDomain, hPath, hBase, hLocalPath, hLocalBase, hPathKL, hWeight⟩ := hlocalPair let h := calibratedDisplacement a n g have hpubPath : PublishedVMWModel publishedScope (pathLaw g h) := (hVMWModelScope_of_gate.2 2 2 2 (pathLaw g h) hPath).2 (ucvmwModel_publishedQualitativeConditions 2 2 2 2 (1 / 10) (1 / 10) (pathLaw g h) hLocalPath.toGapStratum.toUCVMWModel.coreDomain hLocalPath.toGapStratum.toUCVMWModel) have hpubBase : PublishedVMWModel publishedScope (pathLaw g 0) := (hVMWModelScope_of_gate.2 2 2 2 (pathLaw g 0) hBase).2 (ucvmwModel_publishedQualitativeConditions 2 2 2 2 (1 / 10) (1 / 10) (pathLaw g 0) hLocalBase.toGapStratum.toUCVMWModel.coreDomain hLocalBase.toGapStratum.toUCVMWModel) have hA4Path : ConcreteVMWAssumption4 (pathLaw g h) := by exact concreteVMWAssumption4_of_ucvmwModel (pathLaw g h) hLocalPath.toGapStratum.toUCVMWModel have hA4Base : ConcreteVMWAssumption4 (pathLaw g 0) := by exact concreteVMWAssumption4_of_ucvmwModel (pathLaw g 0) hLocalBase.toGapStratum.toUCVMWModel have hsepPath := gapStratum_publishedSpectralSeparation hLocalPath.toGapStratum have hsepBase := gapStratum_publishedSpectralSeparation hLocalBase.toGapStratum refine ⟨hDomain, ⟨hBase, hPath, hpubBase, hA4Base, hpubPath, hA4Path, hsepBase, hsepPath⟩, ?_⟩ intro Vp _hVPublished hcontain est obtain ⟨Q0, hQ0, Q1, hQ1, hQ0eq, hQ1eq⟩ := hcontain obtain ⟨P, hP, hLocal, hwhich, hRisk⟩ := (hlower n hn).2.1 g ⟨hg, hgMax⟩ est rcases hwhich with hP0 | hP1 · refine ⟨Q0, hQ0, ?_⟩ subst P simpa [FullDataProbabilityLaw.weightRisk, expectedWeightRisk, hQ0eq] using hRisk · refine ⟨Q1, hQ1, ?_⟩ subst P simpa [FullDataProbabilityLaw.weightRisk, expectedWeightRisk, hQ1eq] using hRisk
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.published_vmw_converse_transfer · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TPublishedVMWConverseTransfer.lean:211
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.TSameClassLabeledMinimax 1 declarations
theorem same_class_labeled_minimax Proposition 7 in the paper ↗

The inverse-gap lower and upper bounds hold on the same gap-localized two-class model. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
∃ c C : ℝ,
0 < c
0 < C
c < C
conclusion 1
n :
1 ≤ n
g :
est :
∃ (P : Measure (FullData 2 2 2)) (_hP : IsProbabilityMeasure P),
letI := _hP ∃ hM : GapStratum (L := 2) (pi0 := 1 / 10) (sigma0 := 1 / 10) (g := g) P, c * min 1 (sqrt n * g)⁻¹
∃ est : WeightEstimator 2 2 2 n,
∀ (P : Measure (FullData 2 2 2)) (_hP : IsProbabilityMeasure P), letI
Proof (Lean source)
-- @node: prop:same-class-labeled-minimax theorem same_class_labeled_minimax : ∃ c C : ℝ, 0 < c ∧ -- @realizes \(c\)(positive same-class labeled lower constant) 0 < C ∧ -- @realizes \(C\)(positive finite same-class labeled upper constant) c < C ∧ ∀ n : ℕ, 1 ≤ n → ∀ g : ℝ, GapScaleDomain g → (∀ est : WeightEstimator 2 2 2 n, ∃ (P : Measure (FullData 2 2 2)) (_hP : IsProbabilityMeasure P), letI := _hP ∃ hM : GapStratum (L := 2) (pi0 := 1 / 10) (sigma0 := 1 / 10) (g := g) P, c * min 1 (sqrt n * g)⁻¹ ≤ expectedWeightRisk P (orderedMasses (quotientLawRaw P (effectRadius 2 2 (1 / 10)))) est) ∧ ∃ est : WeightEstimator 2 2 2 n, ∀ (P : Measure (FullData 2 2 2)) (_hP : IsProbabilityMeasure P), letI := _hP (hM : GapStratum (L := 2) (pi0 := 1 / 10) (sigma0 := 1 / 10) (g := g) P) → expectedWeightRisk P (orderedMasses (quotientLawRaw P (effectRadius 2 2 (1 / 10)))) est ≤ C * min 1 (sqrt n * g)⁻¹ := by obtain ⟨a, cLower, CKL, ha, haMax, hcLower, hCKL, hlower⟩ := matching_local_lower_bounds (1 / 4) (by exact ⟨by norm_num, by norm_num⟩) obtain ⟨CUpper, hCUpper, hupper⟩ := labeled_weight_upper 2 2 2 2 (1 / 10) (1 / 10) (by norm_num) (by norm_num) (by norm_num) (by norm_num) (by norm_num) (by norm_num) (by norm_num) (by norm_num) let c : ℝ := min cLower (CUpper / 2) refine ⟨c, CUpper, lt_min hcLower (half_pos hCUpper), hCUpper, ?_, ?_⟩ · exact lt_of_le_of_lt (min_le_right _ _) (half_lt_self hCUpper) · intro n hn g hGap obtain ⟨hg, hgMax⟩ := hGap constructor · intro est obtain ⟨P, hP, hLocal, _hWitness, hRisk⟩ := (hlower n hn).2.1 g ⟨hg, hgMax⟩ est refine ⟨P, hP, hLocal.toGapStratum, ?_⟩ exact le_trans (mul_le_mul_of_nonneg_right (min_le_left _ _) (by positivity)) hRisk · obtain ⟨R, est, hest, hRisk⟩ := hupper n hn refine ⟨est, ?_⟩ intro P hP letI := hP intro hM have htargetEq : orderedMasses (quotientLaw P hM.toUCVMWModel).representative.1 = orderedMasses (quotientLawRaw P (effectRadius 2 2 (1 / 10))) := by let nu : AtomicLaw.ProbabilityLaw 2 (effectRadius 2 2 (1 / 10)) := ⟨quotientLawRaw P (effectRadius 2 2 (1 / 10)), quotientLawRaw_valid P hM.toUCVMWModel⟩ have hrel : (quotientLaw P hM.toUCVMWModel).representative.MeasureEquivalent nu := by change (AtomicLaw.probabilityLawSetoid 2 (effectRadius 2 2 (1 / 10))).r (quotientLaw P hM.toUCVMWModel).representative nu change (AtomicLaw.probabilityLawSetoid 2 (effectRadius 2 2 (1 / 10))).r (AtomicLaw.LawModulo.ofProbabilityLaw nu).representative nu exact (Quotient.eq_mk_iff_out (x := AtomicLaw.LawModulo.ofProbabilityLaw nu) (y := nu)).mp rfl exact orderedMasses_eq_of_measureEquivalent (quotientLaw P hM.toUCVMWModel).representative nu hrel rw [← htargetEq] exact hRisk g ⟨hg, hgMax⟩ P hP hM
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.same_class_labeled_minimax · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TSameClassLabeledMinimax.lean:8
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.TSameClassQuotientMinimax 1 declarations
theorem same_class_quotient_minimax Proposition 6 in the paper ↗

Root-n upper and lower bounds hold on the same uniformly conditioned two-class model. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
∃ c C : ℝ,
0 < c
0 < C
c < C
conclusion 1
n :
1 ≤ n
est :
LawEstimator 2 2 2 n (effectRadius 2 2 (1 / 10))
∃ (P : Measure (FullData 2 2 2)) (_hP : IsProbabilityMeasure P),
letI := _hP ∃ hM : UCVMWModel (L := 2) (pi0 := 1 / 10) (sigma0 := 1 / 10) P, c / sqrt n
expectedLawRisk P hM est
∃ est : LawEstimator 2 2 2 n (effectRadius 2 2 (1 / 10)),
∀ (P : Measure (FullData 2 2 2)) (_hP : IsProbabilityMeasure P), letI
Proof (Lean source)
-- @node: prop:same-class-quotient-minimax theorem same_class_quotient_minimax : ∃ c C : ℝ, 0 < c ∧ -- @realizes \(c\)(positive same-class quotient lower constant) 0 < C ∧ -- @realizes \(C\)(positive finite same-class quotient upper constant) c < C ∧ ∀ n : ℕ, 1 ≤ n → (∀ est : LawEstimator 2 2 2 n (effectRadius 2 2 (1 / 10)), ∃ (P : Measure (FullData 2 2 2)) (_hP : IsProbabilityMeasure P), letI := _hP ∃ hM : UCVMWModel (L := 2) (pi0 := 1 / 10) (sigma0 := 1 / 10) P, c / sqrt n ≤ expectedLawRisk P hM est) ∧ ∃ est : LawEstimator 2 2 2 n (effectRadius 2 2 (1 / 10)), ∀ (P : Measure (FullData 2 2 2)) (_hP : IsProbabilityMeasure P), letI := _hP (hM : UCVMWModel (L := 2) (pi0 := 1 / 10) (sigma0 := 1 / 10) P) → expectedLawRisk P hM est ≤ C / sqrt n := by obtain ⟨a, cLower, CKL, ha, haMax, hcLower, hCKL, hlower⟩ := matching_local_lower_bounds (1 / 4) (by exact ⟨by norm_num, by norm_num⟩) obtain ⟨Ctail, hCtail, hupper⟩ := collision_uniform_root_n 2 2 2 2 (1 / 10) (1 / 10) (by norm_num) (by norm_num) (by norm_num) (by norm_num) (by norm_num) (by norm_num) (by norm_num) (by norm_num) let A : ℝ := max Ctail 2 let B : ℝ := A * sqrt (log (2 * A)) + A ^ 2 * sqrt pi / 2 let C : ℝ := max B (2 * cLower) have hA : 2 ≤ A := le_max_right _ _ have hBpos : 0 < B := by dsimp [B] have hApos : 0 < A := lt_of_lt_of_le (by norm_num) hA have hlogpos : 0 < log (2 * A) := Real.log_pos (by nlinarith) positivity have hCpos : 0 < C := hBpos.trans_le (le_max_left _ _) have hcC : cLower < C := by apply lt_of_lt_of_le _ (le_max_right B (2 * cLower)) linarith refine ⟨cLower, C, hcLower, hCpos, hcC, ?_⟩ intro n hn constructor · intro est obtain ⟨P, hP, hLocal, _hWitness, hRisk⟩ := (hlower n hn).1 est exact ⟨P, hP, hLocal.toUCVMWModel, hRisk⟩ · obtain ⟨Alat, R, hAlat, hAlatMeas, hRMeas, htail⟩ := hupper n hn let est : LawEstimator 2 2 2 n (effectRadius 2 2 (1 / 10)) := ⟨Alat.estimate, hAlatMeas⟩ refine ⟨est, ?_⟩ intro P hP letI := hP intro hM let Z : (Fin n → Obs 2 2) → ℝ := fun sample => AtomicLaw.LawModulo.wass1 (Alat.estimate sample) (quotientLaw P hM) have htailA : ∀ eta : ℝ, 0 < eta → eta < 1 / 2 → (sampleLaw (n := n) P).real {sample | A * sqrt (log (A / eta) / n) < Z sample} ≤ eta := by intro eta heta hetaMax have hprob := htail eta ⟨heta, hetaMax⟩ P hP hM have hCA : Ctail ≤ A := le_max_left _ _ have hratio : Ctail / eta ≤ A / eta := by exact div_le_div_of_nonneg_right hCA heta.le have hlog : log (Ctail / eta) ≤ log (A / eta) := by exact Real.log_le_log (div_pos hCtail heta) hratio have hsqrt : sqrt (log (Ctail / eta) / (n : ℝ)) ≤ sqrt (log (A / eta) / (n : ℝ)) := by apply Real.sqrt_le_sqrt exact div_le_div_of_nonneg_right hlog (Nat.cast_nonneg n) have hthreshold : Ctail * sqrt (log (Ctail / eta) / (n : ℝ)) ≤ A * sqrt (log (A / eta) / (n : ℝ)) := by exact mul_le_mul hCA hsqrt (Real.sqrt_nonneg _) (le_trans (by norm_num) hA) refine (measureReal_mono (μ := sampleLaw (n := n) P) ?_).trans hprob.1 intro sample hs change Ctail * sqrt (log (Ctail / eta) / (n : ℝ)) < max (AtomicLaw.LawModulo.wass1 (Alat.estimate sample) (quotientLaw P hM)) (AtomicLaw.LawModulo.wass1 (summaryRepair R sample) (quotientLaw P hM)) exact lt_of_le_of_lt hthreshold (lt_of_lt_of_le hs (le_max_left _ _)) have hmean := integral_le_of_sqrt_log_tail (sampleLaw (n := n) P) Z (fun sample => lawModulo_wass1_nonneg _ _) A n hA hn htailA change (∫ sample, Z sample ∂sampleLaw (n := n) P) ≤ C / sqrt n exact hmean.trans (div_le_div_of_nonneg_right (le_max_left B (2 * cLower)) (Real.sqrt_nonneg n))
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.same_class_quotient_minimax · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TSameClassQuotientMinimax.lean:8
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.TSummaryClosureCompact 15 declarations
theorem matrixEntry_abs_le_operatorNorm

Every matrix entry is bounded by the Euclidean operator norm. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols :
A :
RectMatrix rows cols
i :
Fin rows
j :
Fin cols
|A i j| ≤ ‖matrixCLM A‖
Proof (Lean source)
-- @node: matrixEntry_abs_le_operatorNorm lemma matrixEntry_abs_le_operatorNorm {rows cols : ℕ} (A : RectMatrix rows cols) (i : Fin rows) (j : Fin cols) : |A i j| ≤ ‖matrixCLM A‖ := by let x : Euc cols := single j 1 calc |A i j| = ‖(matrixCLM A x) i‖ := by simp [x, matrixCLM, Matrix.toEuclideanLin_apply, Real.norm_eq_abs] _ ≤ ‖matrixCLM A x‖ := PiLp.norm_apply_le _ _ _ ≤ ‖matrixCLM A‖ * ‖x‖ := ContinuousLinearMap.le_opNorm _ _ _ = ‖matrixCLM A‖ := by simp [x]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.matrixEntry_abs_le_operatorNorm · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TSummaryClosureCompact.lean:9
def summaryMatrixBox

The entrywise closed cube of rectangular matrices. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
rows cols :
L :
summaryMatrixBox rows cols L :
Set (RectMatrix rows cols)
{A | ∀ i j, A i j ∈ Icc (-L) L}
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summaryMatrixBox · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TSummaryClosureCompact.lean:21
theorem summaryMatrixBox_compact

The entrywise matrix cube is compact in the finite product topology. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
rows cols :
L :
Proof (Lean source)
-- @node: summaryMatrixBox_compact lemma summaryMatrixBox_compact (rows cols : ℕ) (L : ℝ) : IsCompact (summaryMatrixBox rows cols L) := by exact isCompact_pi_infinite fun _ => isCompact_pi_infinite fun _ => isCompact_Icc
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summaryMatrixBox_compact · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TSummaryClosureCompact.lean:26

The coordinatewise closed cube for the unconditional proxy mean. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
d :
L :
summaryVectorBox d L :
Set (Fin d → ℝ)
{x | ∀ i, x i ∈ Icc (-L) L}
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summaryVectorBox · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TSummaryClosureCompact.lean:32
theorem summaryVectorBox_compact

The proxy-mean cube is compact in the finite product topology. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
d :
L :
Proof (Lean source)
-- @node: summaryVectorBox_compact lemma summaryVectorBox_compact (d : ℕ) (L : ℝ) : IsCompact (summaryVectorBox d L) := by exact isCompact_pi_infinite fun _ => isCompact_Icc
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summaryVectorBox_compact · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TSummaryClosureCompact.lean:37

Product cube containing every admissible five-block summary. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
dx dz :
L :
summaryCoordinateBox dx dz L :
summaryMatrixBox dz dx L ×ˢ summaryMatrixBox dz dx L ×ˢ summaryMatrixBox dz dx L ×ˢ summaryMatrixBox dz dx L ×ˢ summaryVectorBox dx L
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summaryCoordinateBox · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TSummaryClosureCompact.lean:43
theorem summaryCoordinateBox_compact

The five-block coordinate cube is compact. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx dz :
L :
Proof (Lean source)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summaryCoordinateBox_compact · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TSummaryClosureCompact.lean:49
def summarySpaceEquivCoordinates

The summary record is topologically identical to its five-coordinate product. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
dx dz :
summarySpaceEquivCoordinates dx dz :
clause 1
toFun := SummarySpace.toCoordinates
clause 2
invFun := fun c => ⟨c.1, c.2.1, c.2.2.1, c.2.2.2.1, c.2.2.2.2⟩
clause 3
left_inv := by rintro ⟨M0, M1, N0, N1, mX⟩; rfl
clause 4
right_inv := by rintro ⟨M0, M1, N0, N1, mX⟩; rfl
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summarySpaceEquivCoordinates · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TSummaryClosureCompact.lean:57
def summarySpaceHomeomorphCoordinates

The coordinate equivalence respects the induced summary topology. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
dx dz :
summarySpaceHomeomorphCoordinates dx dz :
SummarySpace dx dz ≃ₜ SummaryCoordinates dx dz
clause 1
clause 2
continuous_toFun := continuous_induced_dom
clause 3
continuous_invFun := by rw [continuous_induced_rng] change Continuous fun x : SummaryCoordinates dx dz
=> x exact continuous_id
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summarySpaceHomeomorphCoordinates · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TSummaryClosureCompact.lean:66
def summarySpaceBox

The summary-space cube corresponding to the coordinate product cube. For the supplied parameters, the defined object is given by its defining clause.

Definition (Lean source)
dx dz :
L :
summarySpaceBox dx dz L :
SummarySpace.toCoordinates ⁻¹' summaryCoordinateBox dx dz L
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summarySpaceBox · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TSummaryClosureCompact.lean:77
theorem summarySpaceBox_compact

The summary-space cube is compact. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
dx dz :
L :
Proof (Lean source)
-- @node: summarySpaceBox_compact lemma summarySpaceBox_compact (dx dz : ℕ) (L : ℝ) : IsCompact (summarySpaceBox dx dz L) := by let e := summarySpaceHomeomorphCoordinates dx dz have heq : summarySpaceBox dx dz L = e.symm '' summaryCoordinateBox dx dz L := by ext s constructor · intro hs exact ⟨e s, hs, e.symm_apply_apply s⟩ · rintro ⟨q, hq, rfl⟩ change e (e.symm q) ∈ summaryCoordinateBox dx dz L simpa using hq rw [heq] exact (summaryCoordinateBox_compact dx dz L).image e.symm.continuous
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summarySpaceBox_compact · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TSummaryClosureCompact.lean:82
theorem admissibleImage_subset_summarySpaceBox

Observable block envelopes place the admissible image in the finite coordinate cube. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hsigma :
0 < sigma0
hsigmaMax :
sigma0 ≤ 1
admissibleImage k dx dz L pi0 sigma0 ⊆ summarySpaceBox dx dz L
Proof (Lean source)
-- @node: admissibleImage_subset_summarySpaceBox lemma admissibleImage_subset_summarySpaceBox (k dx dz : ℕ) (L pi0 sigma0 : ℝ) (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hpiMax : pi0 ≤ 1 / (2 * k : ℝ)) (hsigma : 0 < sigma0) (hsigmaMax : sigma0 ≤ 1) : admissibleImage k dx dz L pi0 sigma0 ⊆ summarySpaceBox dx dz L := by intro s hs rcases hs with ⟨Q, rfl⟩ letI := Q.prob have h := observed_summary_block_bounds Q.P hk hkx hkz hL hpi hpiMax hsigma hsigmaMax Q.model change SummarySpace.toCoordinates Q.summary ∈ summaryCoordinateBox dx dz L refine ⟨?_, ?_, ?_, ?_, ?_⟩ · intro i j exact abs_le.mp ((matrixEntry_abs_le_operatorNorm Q.summary.M0 i j).trans (by simpa [ModelLaw.summary] using h.1)) · intro i j exact abs_le.mp ((matrixEntry_abs_le_operatorNorm Q.summary.M1 i j).trans (by simpa [ModelLaw.summary] using h.2.1)) · intro i j exact abs_le.mp ((matrixEntry_abs_le_operatorNorm Q.summary.N0 i j).trans (by simpa [ModelLaw.summary] using h.2.2.1)) · intro i j exact abs_le.mp ((matrixEntry_abs_le_operatorNorm Q.summary.N1 i j).trans (by simpa [ModelLaw.summary] using h.2.2.2.1)) · intro i have hi : |Q.summary.mX i| ≤ ‖Q.summary.mX‖ := by simpa [Real.norm_eq_abs] using norm_le_pi_norm Q.summary.mX i exact abs_le.mp (hi.trans (by simpa [ModelLaw.summary] using h.2.2.2.2))
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.admissibleImage_subset_summarySpaceBox · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TSummaryClosureCompact.lean:98
theorem summaryClosure_compact_of_block_bounds

The closure of an admissible image contained in the summary cube is compact. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hsub :
admissibleImage k dx dz L pi0 sigma0 ⊆ summarySpaceBox dx dz L
IsCompact (summaryClosure k dx dz L pi0 sigma0)
Proof (Lean source)
-- @node: summaryClosure_compact_of_block_bounds lemma summaryClosure_compact_of_block_bounds (k dx dz : ℕ) (L pi0 sigma0 : ℝ) (hsub : admissibleImage k dx dz L pi0 sigma0 ⊆ summarySpaceBox dx dz L) : IsCompact (summaryClosure k dx dz L pi0 sigma0) := by have hK := summarySpaceBox_compact dx dz L apply hK.of_isClosed_subset isClosed_closure exact closure_minimal hsub ((summaryCoordinateBox_compact dx dz L).isClosed.preimage continuous_induced_dom)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summaryClosure_compact_of_block_bounds · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TSummaryClosureCompact.lean:129
theorem admissibleImage_dS_bounded

Observable block bounds give a uniform bound for the continuous summary loss. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hsigma :
0 < sigma0
hsigmaMax :
sigma0 ≤ 1
∃ B : ℝ, ∀ s ∈ admissibleImage k dx dz L pi0 sigma0, dS s 0 ≤ B
Proof (Lean source)
-- @node: admissibleImage_dS_bounded lemma admissibleImage_dS_bounded (k dx dz : ℕ) (L pi0 sigma0 : ℝ) (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hpiMax : pi0 ≤ 1 / (2 * k : ℝ)) (hsigma : 0 < sigma0) (hsigmaMax : sigma0 ≤ 1) : ∃ B : ℝ, ∀ s ∈ admissibleImage k dx dz L pi0 sigma0, dS s 0 ≤ B := by refine ⟨(4 + dx) * L, ?_⟩ intro s hs rcases hs with ⟨Q, rfl⟩ letI := Q.prob have h := observed_summary_block_bounds Q.P hk hkx hkz hL hpi hpiMax hsigma hsigmaMax Q.model let x : Euc dx := toLp 2 Q.summary.mX have hx : x = ∑ i, single i (Q.summary.mX i) := by ext i simp [x] have hm : sqrt (∑ i, Q.summary.mX i ^ 2) ≤ dx * L := by calc sqrt (∑ i, Q.summary.mX i ^ 2) = ‖x‖ := by rw [EuclideanSpace.norm_eq] simp [x, Real.norm_eq_abs, sq_abs] _ = ‖∑ i, single i (Q.summary.mX i)‖ := by rw [← hx] _ ≤ ∑ i, ‖EuclideanSpace.single i (Q.summary.mX i)‖ := norm_sum_le _ _ _ = ∑ i, |Q.summary.mX i| := by simp [Real.norm_eq_abs] _ ≤ ∑ _i : Fin dx, L := by apply Finset.sum_le_sum intro i hi have hi' : |Q.summary.mX i| ≤ ‖Q.summary.mX‖ := by simpa [Real.norm_eq_abs] using norm_le_pi_norm Q.summary.mX i exact hi'.trans (by simpa [ModelLaw.summary] using h.2.2.2.2) _ = dx * L := by simp change dS Q.summary (⟨0, 0, 0, 0, 0⟩ : SummarySpace dx dz) ≤ (4 + dx) * L simp only [dS, Pi.zero_apply, sub_zero] have h' : ‖matrixCLM Q.summary.M0‖ ≤ L ∧ ‖matrixCLM Q.summary.M1‖ ≤ L ∧ ‖matrixCLM Q.summary.N0‖ ≤ L ∧ ‖matrixCLM Q.summary.N1‖ ≤ L ∧ ‖Q.summary.mX‖ ≤ L := by simpa [ModelLaw.summary] using h nlinarith [h'.1, h'.2.1, h'.2.2.1, h'.2.2.2.1, hm]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.admissibleImage_dS_bounded · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TSummaryClosureCompact.lean:139
theorem summary_closure_compact Proposition 2 in the paper ↗

The admissible image is uniformly dS-bounded, its closure is compact, and closure nonemptiness is equivalent to model nonemptiness. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz :
L pi0 sigma0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hsigma :
0 < sigma0
hsigmaMax :
sigma0 ≤ 1
conclusion 1
∃ B : ℝ, ∀ s ∈ admissibleImage k dx dz L pi0 sigma0, dS s 0 ≤ B
conclusion 2
IsCompact (summaryClosure k dx dz L pi0 sigma0)
conclusion 3
(summaryClosure k dx dz L pi0 sigma0).Nonempty ↔ Nonempty (ModelLaw k dx dz L pi0 sigma0)
Proof (Lean source)
-- @node: prop:summary-closure-compact theorem summary_closure_compact (k dx dz : ℕ) (L pi0 sigma0 : ℝ) (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hpiMax : pi0 ≤ 1 / (2 * k : ℝ)) (hsigma : 0 < sigma0) (hsigmaMax : sigma0 ≤ 1) : (∃ B : ℝ, ∀ s ∈ admissibleImage k dx dz L pi0 sigma0, dS s 0 ≤ B) ∧ IsCompact (summaryClosure k dx dz L pi0 sigma0) ∧ ((summaryClosure k dx dz L pi0 sigma0).Nonempty ↔ Nonempty (ModelLaw k dx dz L pi0 sigma0)) := by have hsub := admissibleImage_subset_summarySpaceBox k dx dz L pi0 sigma0 hk hkx hkz hL hpi hpiMax hsigma hsigmaMax refine ⟨admissibleImage_dS_bounded k dx dz L pi0 sigma0 hk hkx hkz hL hpi hpiMax hsigma hsigmaMax, summaryClosure_compact_of_block_bounds k dx dz L pi0 sigma0 hsub, ?_⟩ rw [summaryClosure, closure_nonempty_iff] constructor · rintro ⟨s, Q, hQs⟩ exact ⟨Q⟩ · rintro ⟨Q⟩ exact ⟨Q.summary, Q, rfl⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summary_closure_compact · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TSummaryClosureCompact.lean:179
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.TSummaryRepairTotalBorel 7 declarations
def SummaryRepairCoordIndex

For target- and reference-proxy dimensions, the summary-repair coordinate index labels four matrix blocks and one target-proxy mean block.

Definition (Lean source)
dx dz :
SummaryRepairCoordIndex dx dz :
Type
(Fin 4 × Fin dz × Fin dx) ⊕ Fin dx
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.SummaryRepairCoordIndex · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TSummaryRepairTotalBorel.lean:10
def summaryRepairToEuc

For the supplied parameters, summary Repair To Euc is given by its defining clause.

Definition (Lean source)
dx dz :
s :
summaryRepairToEuc s :
toLp 2 fun i
=> match i with | inl (b, a, j) => match b.val with | 0 => s.M0 a j | 1 => s.M1 a j | 2 => s.N0 a j | _ => s.N1 a j | inr j => s.mX j
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summaryRepairToEuc · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TSummaryRepairTotalBorel.lean:15
def summaryRepairOfEuc

For the supplied parameters, summary Repair Of Euc is given by its defining clause.

Definition (Lean source)
dx dz :
summaryRepairOfEuc x :
clause 1
M0 a j := x (inl (0, a, j)); M1 a j := x (inl (1, a, j))
clause 2
N0 a j := x (inl (2, a, j)); N1 a j := x (inl (3, a, j))
clause 3
mX j := x (inr j)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summaryRepairOfEuc · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TSummaryRepairTotalBorel.lean:24
def summaryRepairSpaceHomeomorph

For the supplied parameters, summary Repair Space Homeomorph is given by its defining clause.

Definition (Lean source)
dx dz :
summaryRepairSpaceHomeomorph dx dz :
clause 2
clause 3
left_inv := by intro s; cases s; simp [summaryRepairToEuc, summaryRepairOfEuc]
clause 4
right_inv := by intro x; ext i; rcases i with ⟨b, a, j⟩ | j · fin_cases b <;> simp [summaryRepairToEuc, summaryRepairOfEuc] · simp [summaryRepairToEuc, summaryRepairOfEuc]
clause 5
continuous_toFun := by have hc : Continuous (@SummarySpace.toCoordinates dx dz) := continuous_induced_dom have h0 : Continuous (fun s : SummarySpace dx dz => s.M0) := continuous_fst.comp hc have h1 : Continuous (fun s : SummarySpace dx dz => s.M1) := (continuous_fst.comp continuous_snd).comp hc have h2 : Continuous (fun s : SummarySpace dx dz => s.N0) := (continuous_fst.comp (continuous_snd.comp continuous_snd)).comp hc have h3 : Continuous (fun s : SummarySpace dx dz => s.N1) := (continuous_fst.comp (continuous_snd.comp (continuous_snd.comp continuous_snd))).comp hc have h4 : Continuous (fun s : SummarySpace dx dz => s.mX) := (continuous_snd.comp (continuous_snd.comp (continuous_snd.comp continuous_snd))).comp hc apply (PiLp.continuous_toLp 2 _).comp apply continuous_pi intro i; rcases i with ⟨b, a, j⟩ | j · fin_cases b · change Continuous ((fun p => p a j) ∘ fun s : SummarySpace dx dz => s.M0) exact (continuous_apply_apply a j).comp h0 · change Continuous ((fun p => p a j) ∘ fun s : SummarySpace dx dz => s.M1) exact (continuous_apply_apply a j).comp h1 · change Continuous ((fun p => p a j) ∘ fun s : SummarySpace dx dz => s.N0) exact (continuous_apply_apply a j).comp h2 · change Continuous ((fun p => p a j) ∘ fun s : SummarySpace dx dz => s.N1) exact (continuous_apply_apply a j).comp h3 · change Continuous ((fun p => p j) ∘ fun s : SummarySpace dx dz => s.mX) exact (continuous_apply j).comp h4
clause 6
continuous_invFun := by rw [continuous_induced_rng] repeat' apply Continuous.prodMk all_goals first | (apply continuous_pi; intro; apply continuous_pi; intro; fun_prop) | (apply continuous_pi; intro; fun_prop)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summaryRepairSpaceHomeomorph · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TSummaryRepairTotalBorel.lean:32

For the supplied parameters, euclidean Reindex Homeomorph is given by its defining clause.

Definition (Lean source)
ι κ :
Type*
e :
ι ≃ κ
euclideanReindexHomeomorph e :
EuclideanSpace ℝ ι ≃ₜ EuclideanSpace ℝ κ
clause 1
toFun x := toLp 2 fun j => x (e.symm j)
clause 2
invFun x := toLp 2 fun i => x (e i)
clause 3
left_inv := by intro x; ext i; simp
clause 4
right_inv := by intro x; ext j; simp
clause 5
continuous_toFun := by apply (PiLp.continuous_toLp 2 _).comp; apply continuous_pi; intro j exact PiLp.continuous_apply 2 (fun _ : ι => ℝ) (e.symm j)
clause 6
continuous_invFun := by apply (PiLp.continuous_toLp 2 _).comp; apply continuous_pi; intro i exact PiLp.continuous_apply 2 (fun _ : κ => ℝ) (e i)
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.euclideanReindexHomeomorph · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TSummaryRepairTotalBorel.lean:74
theorem compactLoss_selector_of_homeomorph Lemma compactLoss_selector_of_homeomorph in the paper ↗

Compact loss selector of homeomorph: under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
d :
e :
X ≃ₜ Euc d
K :
Set X
hKne :
K.Nonempty
hK :
loss :
X → X → ℝ
hloss :
∃ Pi : X → X,
conclusion 1
s :
Pi s ∈ K
conclusion 2
s q :
q ∈ K
loss (Pi s) s ≤ loss q s
Proof (Lean source)
lemma compactLoss_selector_of_homeomorph {X : Type*} [TopologicalSpace X] [MeasurableSpace X] [BorelSpace X] (d : ℕ) (e : X ≃ₜ Euc d) (K : Set X) (hKne : K.Nonempty) (hK : IsCompact K) (loss : X → X → ℝ) (hloss : Continuous (uncurry loss)) : ∃ Pi : X → X, Measurable Pi ∧ (∀ s, Pi s ∈ K) ∧ ∀ s q, q ∈ K → loss (Pi s) s ≤ loss q s := by let KE : Set (Euc d) := e '' K have hKEc : IsCompact KE := hK.image e.continuous have hKEn : KE.Nonempty := hKne.image e have hf : Continuous (uncurry (fun x y : Euc d => loss (e.symm y) (e.symm x))) := by exact hloss.comp ((e.symm.continuous.comp continuous_snd).prodMk (e.symm.continuous.comp continuous_fst)) obtain ⟨pi, hpm, hp⟩ := borelMeasurable_compactLoss_selector d KE (fun x y => loss (e.symm y) (e.symm x)) hKEn hKEc hf let Pi : X → X := fun s => e.symm (pi (e s)) refine ⟨Pi, e.symm.continuous.measurable.comp (hpm.comp e.continuous.measurable), ?_, ?_⟩ · intro s rcases (hp (e s)).1 with ⟨q, hq, heq⟩ change e.symm (pi (e s)) ∈ K rw [← heq, e.symm_apply_apply] exact hq · intro s q hq simpa [Pi] using (hp (e s)).2 (e q) ⟨q, hq, rfl⟩
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.compactLoss_selector_of_homeomorph · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TSummaryRepairTotalBorel.lean:89
theorem summary_repair_total_borel Proposition 3 in the paper ↗

The nearest-summary repair has a total Borel positive-law realization, with the stated zero-law fallback and a nonempty theoretical confidence set. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
k dx dz n :
L pi0 sigma0 alpha C0 :
hk :
2 ≤ k
hkx :
k ≤ dx
hkz :
k ≤ dz
hL :
1 ≤ L
hpi :
0 < pi0
hpiMax :
pi0 ≤ 1 / (2 * k : ℝ)
hsigma :
0 < sigma0
hsigmaMax :
sigma0 ≤ 1
hn :
1 ≤ n
hAlpha :
∃ R : SummaryRepairData k dx dz n L pi0 sigma0,
conclusion 1
sample :
summaryClosure k dx dz L pi0 sigma0 = ∅
summaryRepair R sample = AtomicLaw.LawModulo.deltaZeroLaw R.k_pos R.radius_nonneg
conclusion 2
sample :
(theoreticalConfidenceSet R sample alpha C0).Nonempty
Proof (Lean source)
-- @node: prop:summary-repair-total-borel theorem summary_repair_total_borel (k dx dz n : ℕ) (L pi0 sigma0 alpha C0 : ℝ) (hk : 2 ≤ k) (hkx : k ≤ dx) (hkz : k ≤ dz) (hL : 1 ≤ L) (hpi : 0 < pi0) (hpiMax : pi0 ≤ 1 / (2 * k : ℝ)) (hsigma : 0 < sigma0) (hsigmaMax : sigma0 ≤ 1) (hn : 1 ≤ n) (hAlpha : MiscoverageDomain alpha) (hC0 : ConcentrationConstantDomain C0) : Measurable (@empSummary n dx dz) → ∃ R : SummaryRepairData k dx dz n L pi0 sigma0, Measurable (summaryRepair R) ∧ (∀ sample, summaryClosure k dx dz L pi0 sigma0 = ∅ → summaryRepair R sample = AtomicLaw.LawModulo.deltaZeroLaw R.k_pos R.radius_nonneg) ∧ ∀ sample, (theoreticalConfidenceSet R sample alpha C0).Nonempty := by intro hemp obtain ⟨halpha, halphaMax⟩ := hAlpha let K := summaryClosure k dx dz L pi0 sigma0 have hKc : IsCompact K := (summary_closure_compact k dx dz L pi0 sigma0 hk hkx hkz hL hpi hpiMax hsigma hsigmaMax).2.1 obtain ⟨C, hC, hmod, Fbar, hFc, hFm, hFlip, hFext, huniq⟩ := gap_free_positive_measure_modulus k dx dz L pi0 sigma0 hk hkx hkz hL hpi hpiMax hsigma hsigmaMax have hkp : 0 < k := by omega have hr : 0 ≤ effectRadius dz L sigma0 := by unfold effectRadius; positivity by_cases he : K = ∅ · let R : SummaryRepairData k dx dz n L pi0 sigma0 := { k_pos := hkp, radius_nonneg := hr, Fbar := Fbar, Pi := fun _ => 0 continuousFbar := hFc extendsOnModel := by intro Q exfalso have hmem : Q.summary ∈ summaryClosure k dx dz L pi0 sigma0 := subset_closure (show Q.summary ∈ admissibleImage k dx dz L pi0 sigma0 from ⟨Q, rfl⟩) rw [show summaryClosure k dx dz L pi0 sigma0 = ∅ by simpa [K] using he] at hmem exact hmem measurablePi := measurable_const nearest := by intro s hn; exact elim (hn (by simpa [K] using he)) empty_fallback := by intro _ s; rfl measurableRepair := by have he' : summaryClosure k dx dz L pi0 sigma0 = ∅ := by simpa [K] using he simp only [he', dite_true]; exact measurable_const } refine ⟨R, R.measurableRepair, ?_, ?_⟩ · intro sample hs; simp [summaryRepair, hs] · intro sample; rw [theoreticalConfidenceSet, if_pos (by simpa [K] using he)] exact singleton_nonempty _ · have hne : K.Nonempty := nonempty_iff_ne_empty.mpr he let d := card (SummaryRepairCoordIndex dx dz) let e : SummarySpace dx dz ≃ₜ Euc d := (summaryRepairSpaceHomeomorph dx dz).trans (euclideanReindexHomeomorph (Fintype.equivFin (SummaryRepairCoordIndex dx dz))) obtain ⟨Pi, hPm, hPK, hPmin⟩ := compactLoss_selector_of_homeomorph d e K hne hKc dS (dS_continuous dx dz) let R : SummaryRepairData k dx dz n L pi0 sigma0 := { k_pos := hkp, radius_nonneg := hr, Fbar := Fbar, Pi := Pi continuousFbar := hFc, extendsOnModel := hFext, measurablePi := hPm nearest := fun s _ => ⟨hPK s, hPmin s⟩ empty_fallback := by intro hs; exact elim (he (by simpa [K] using hs)) measurableRepair := by have he' : summaryClosure k dx dz L pi0 sigma0 ≠ ∅ := by simpa [K] using he simp only [he', dite_false] have hsubmem : ∀ s, Pi s ∈ summaryClosure k dx dz L pi0 sigma0 := by intro s simpa [K] using hPK s have hsub : Measurable (fun s => (⟨Pi s, hsubmem s⟩ : {q // q ∈ summaryClosure k dx dz L pi0 sigma0})) := hPm.subtype_mk simpa [Function.comp_def] using hFm.comp (hsub.comp hemp) } refine ⟨R, R.measurableRepair, fun sample hs => elim (he (by simpa [K] using hs)), ?_⟩ intro sample rw [theoreticalConfidenceSet, if_neg (by simpa [K] using he)] refine ⟨summaryRepair R sample, ⟨⟨R.Pi (empSummary sample), (R.nearest _ ?_).1⟩, ?_, ?_⟩⟩ · simpa [K] using he · have hrpos := summaryRadius_pos n alpha C0 L (by omega) halpha halphaMax hC0 hL have hz : 0 ≤ 2 * summaryRadius n alpha C0 L := by positivity simpa [dS, matrixCLM] using hz · have he' : summaryClosure k dx dz L pi0 sigma0 ≠ ∅ := by simpa [K] using he simp only [summaryRepair, he', dite_false]
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.summary_repair_total_borel · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TSummaryRepairTotalBorel.lean:116
CausalSmith.Stat.STAT_ProxyEffectlawEigencollisionFrontier_Research.TTwoClassWitnessValid 1 declarations
theorem two_class_witness_valid Proposition 5 in the paper ↗

The explicit two-class law remains in the uniformly conditioned model through the collision, with unequal latent weights and nonsingular proxy matrices. Under the stated inputs and assumptions, the stated conclusion holds.

Formal statement
eps :
hlo :
hEps.1
hhi :
hEps.2
letI
Proof (Lean source)
-- @node: prop:two-class-witness-valid theorem two_class_witness_valid (eps : ℝ) (hEps : WitnessPerturbationDomain eps) : let hlo := hEps.1 let hhi := hEps.2 let _hP := witnessLaw_isProbabilityMeasure eps hlo hhi letI := _hP ∃ hM : UCVMWModel (L := 2) (pi0 := 1 / 10) (sigma0 := 1 / 10) (witnessLaw eps), (obsLaw (witnessLaw eps)).real {o | o.T = false} = 12 / 25 ∧ (obsLaw (witnessLaw eps)).real {o | o.T = true} = 13 / 25 ∧ det2 (targetFeature (witnessLaw eps)) = 3 / 5 ∧ det2 (referenceFeature (witnessLaw eps) false) = 2 / 5 ∧ det2 (referenceFeature (witnessLaw eps) true) = 2 / 5 ∧ det2 (observedProxyMoment (obsSummary (witnessLaw eps)) false) = 3 / 50 ∧ det2 (observedProxyMoment (obsSummary (witnessLaw eps)) true) = (2 / 5 : ℝ) * (3 / 5) * (36 / 169) ∧ latentMass (witnessLaw eps) 0 = 2 / 5 ∧ latentMass (witnessLaw eps) 1 = 3 / 5 ∧ AtomicLaw.LawModulo.toMeasure (quotientLaw (witnessLaw eps) hM) = ofReal (2 / 5 : ℝ) • Measure.dirac (1 / 4 - eps) + ofReal (3 / 5 : ℝ) • Measure.dirac (1 / 4 + eps) ∧ (eps = 0 → Injective (toEuclideanLin (targetFeature (witnessLaw eps))) ∧ Injective (toEuclideanLin (referenceFeature (witnessLaw eps) false)) ∧ Injective (toEuclideanLin (referenceFeature (witnessLaw eps) true)) ∧ AtomicLaw.LawModulo.toMeasure (quotientLaw (witnessLaw eps) hM) = Measure.dirac (1 / 4) ∧ latentMass (witnessLaw eps) 0 ≠ latentMass (witnessLaw eps) 1) := by obtain ⟨hlo, hhi⟩ := hEps letI := witnessLaw_isProbabilityMeasure eps hlo hhi let hM : UCVMWModel (L := 2) (pi0 := 1 / 10) (sigma0 := 1 / 10) (witnessLaw eps) := { referenceProxySeparation := witness_referenceProxySeparation eps hlo hhi coreDomain := by norm_num [CoreParameterDomain] targetProxySeparation := witness_targetProxySeparation eps hlo hhi consistency := witness_consistency eps latentIgnorability := witness_armwiseLatentIgnorability eps hlo hhi anchor := witness_anchor eps boundedX := witness_boundedX eps boundedProxyProduct := witness_boundedProxyProduct eps boundedOutcomeProxyProduct := witness_boundedOutcomeProxyProduct eps latentArmPositivity := witness_latentArmPositivity eps hlo hhi proxyRankMargin := witness_proxyRankMargin eps hlo hhi } have hq : AtomicLaw.LawModulo.toMeasure (quotientLaw (witnessLaw eps) hM) = ofReal (2 / 5 : ℝ) • Measure.dirac (1 / 4 - eps) + ofReal (3 / 5 : ℝ) • Measure.dirac (1 / 4 + eps) := by rw [quotientLaw, AtomicLaw.LawModulo.toMeasure_eq_of_mk] unfold AtomicLaw.ProbabilityLaw.toMeasure AtomicLaw.toMeasure quotientLawRaw rw [Fin.sum_univ_two] change ofReal (latentMass (witnessLaw eps) 0) • Measure.dirac (latentEffect (witnessLaw eps) 0) + ofReal (latentMass (witnessLaw eps) 1) • Measure.dirac (latentEffect (witnessLaw eps) 1) = _ rw [witness_latentMass eps hlo hhi, witness_latentMass eps hlo hhi, witness_latentEffect eps hlo hhi, witness_latentEffect eps hlo hhi] norm_num refine ⟨hM, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, hq, ?_⟩ · simpa [obsArm] using obs_witness_arm_mass eps hlo hhi false · simpa [obsArm] using obs_witness_arm_mass eps hlo hhi true · exact witness_det_targetFeature eps hlo hhi · exact witness_det_referenceFeature eps hlo hhi false · exact witness_det_referenceFeature eps hlo hhi true · exact witness_observedProxyMoment_det eps hlo hhi false · exact witness_observedProxyMoment_det eps hlo hhi true · simpa using witness_latentMass eps hlo hhi (0 : Fin 2) · simpa using witness_latentMass eps hlo hhi (1 : Fin 2) · intro heps subst eps constructor · rw [witness_targetFeature 0 (by norm_num) (by norm_num)] apply two_by_two_injective_of_signalMinSingular_pos exact lt_of_lt_of_le (by norm_num) witnessTargetMatrix_signalMinSingular constructor · rw [witness_referenceFeature 0 (by norm_num) (by norm_num) false] apply two_by_two_injective_of_signalMinSingular_pos exact lt_of_lt_of_le (by norm_num) witnessReferenceMatrix_false_signalMinSingular constructor · rw [witness_referenceFeature 0 (by norm_num) (by norm_num) true] apply two_by_two_injective_of_signalMinSingular_pos exact lt_of_lt_of_le (by norm_num) witnessReferenceMatrix_true_signalMinSingular constructor · rw [hq] norm_num rw [← add_smul] congr 1 rw [← ENNReal.ofReal_add (by norm_num : 0 ≤ (2 / 5 : ℝ))] <;> norm_num · rw [witness_latentMass 0 (by norm_num) (by norm_num), witness_latentMass 0 (by norm_num) (by norm_num)] norm_num
CausalSmith.Stat.ProxyEffectlawEigencollisionFrontier.two_class_witness_valid · CausalSmith/Stat/STAT_ProxyEffectlawEigencollisionFrontier_Research/TTwoClassWitnessValid.lean:11