Formalization: Parametric Rates for Stationary Policy Evaluation with Binary Hidden States

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_PomdpBinaryhiddenRate_Research.Basic 68 declarations The paper-local carrier for a finite partially observed Markov decision process, its observable-data decision problem, and the partial-history importance-weighted estimators.

Fixed-binary POMDP minimax model

The paper-local carrier for a finite partially observed Markov decision process, its observable-data decision problem, and the partial-history importance-weighted estimators. Causalean's generic real-valued minimax API is reused, while the dependent-trajectory model is defined locally because the substrate contains no POMDP experiment at this abstraction level.

def Policy

A memoryless policy on the finite observed-state alphabet.

Definition (Lean source)
nX :
Policy nX :
Type
Fin nX → Bool → ℝ
CausalSmith.Stat.PomdpBinaryhiddenRate.Policy · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:30
def JointState

The finite observed/latent joint-state alphabet.

Definition (Lean source)
nX nH :
JointState nX nH :
Type
Fin nX × Fin nH
CausalSmith.Stat.PomdpBinaryhiddenRate.JointState · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:34
def BinaryObservedState

The observed alphabet of this fixed-binary paper.

Definition (Lean source)
BinaryObservedState :
Type
Fin 2
CausalSmith.Stat.PomdpBinaryhiddenRate.BinaryObservedState · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:37
def BinaryHiddenState

The hidden alphabet of this fixed-binary paper.

Definition (Lean source)
BinaryHiddenState :
Type
Fin 2
CausalSmith.Stat.PomdpBinaryhiddenRate.BinaryHiddenState · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:41
def BinaryJointState

The four-state product used by the paper's model class.

Definition (Lean source)
BinaryJointState :
Type
CausalSmith.Stat.PomdpBinaryhiddenRate.BinaryJointState · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:45
def BinaryPolicy

Memoryless policies on the paper's binary observed alphabet.

Definition (Lean source)
BinaryPolicy :
Type
CausalSmith.Stat.PomdpBinaryhiddenRate.BinaryPolicy · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:49
def Step

One reward and successor-state block emitted by the POMDP kernel.

Definition (Lean source)
nX nH :
Step nX nH :
Type
ℝ × JointState nX nH
CausalSmith.Stat.PomdpBinaryhiddenRate.Step · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:53
def FullTrajectory

A length-T trajectory has T+1 states and T action/reward pairs.

Definition (Lean source)
T nX nH :
FullTrajectory T nX nH :
Type
(Fin (T + 1) → JointState nX nH) × (Fin T → Bool × ℝ)
CausalSmith.Stat.PomdpBinaryhiddenRate.FullTrajectory · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:56
def ObsView

The observable trajectory, with latent and terminal states removed.

Definition (Lean source)
T nX :
ObsView T nX :
Type
Fin T → (Fin nX × Bool × ℝ)
CausalSmith.Stat.PomdpBinaryhiddenRate.ObsView · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:61

Raw ingredients of one trajectory experiment.

Definition (Lean source)
T nX nH :
K :
JointState nX nH → Bool → Measure (Step nX nH)
b :
e :
Auxiliary initialization vector used only by finite witness constructors. Model-class membership is deliberately independent of this field.
init :
JointState nX nH → ℝ
law :
law_isProbability :
CausalSmith.Stat.PomdpBinaryhiddenRate.RawPomdpExperiment · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:65
def BinaryPomdpExperiment

The binary experiment carrier used by every class member and testing law.

Definition (Lean source)
T :
BinaryPomdpExperiment T :
Type
CausalSmith.Stat.PomdpBinaryhiddenRate.BinaryPomdpExperiment · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:76
instance instIsProbabilityMeasureFullTrajectoryLaw

For the M input, this supplies the inst Is Probability Measure Full Trajectory Law instance.

Definition (Lean source)
instance {T nX nH : Nat} (M : RawPomdpExperiment T nX nH) : IsProbabilityMeasure M.law := M.law_isProbability
CausalSmith.Stat.PomdpBinaryhiddenRate.instIsProbabilityMeasureFullTrajectoryLaw · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:80
def stateAt

The joint state at a path coordinate, including the terminal coordinate.

Definition (Lean source)
T nX nH :
i :
Fin (T + 1)
tau :
stateAt i tau :
tau.1 i
CausalSmith.Stat.PomdpBinaryhiddenRate.stateAt · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:88
def curState

The current state at epoch t.

Definition (Lean source)
T nX nH :
t :
Fin T
tau :
curState t tau :
tau.1 t.castSucc
CausalSmith.Stat.PomdpBinaryhiddenRate.curState · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:92
def nextState

The successor state at epoch t, including the final transition.

Definition (Lean source)
T nX nH :
t :
Fin T
tau :
nextState t tau :
tau.1 t.succ
CausalSmith.Stat.PomdpBinaryhiddenRate.nextState · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:98
def actionAt

The observed action at epoch t.

Definition (Lean source)
T nX nH :
t :
Fin T
tau :
actionAt t tau :
tau.2 t |>.1
CausalSmith.Stat.PomdpBinaryhiddenRate.actionAt · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:103
def rewardAt

The observed real reward at epoch t.

Definition (Lean source)
T nX nH :
t :
Fin T
tau :
rewardAt t tau :
ℝ
tau.2 t |>.2
CausalSmith.Stat.PomdpBinaryhiddenRate.rewardAt · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:107
def obsProj

Projection from the full trajectory to exactly the information observed by an estimator.

Definition (Lean source)
T nX nH :
tau :
obsProj tau :
ObsView T nX
fun t ↦ ((curState t tau).1, actionAt t tau, rewardAt t tau)
CausalSmith.Stat.PomdpBinaryhiddenRate.obsProj · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:111

The observed trajectory law.

Definition (Lean source)
T nX nH :
M :
obsLaw M :
M.law.map obsProj
CausalSmith.Stat.PomdpBinaryhiddenRate.obsLaw · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:115
def prefixIndex

Embed an index strictly before t into the epoch index set.

Definition (Lean source)
T :
t :
Fin T
j :
Fin t.val
prefixIndex t j :
Fin T
⟨j.val, lt_trans j.isLt t.isLt⟩
CausalSmith.Stat.PomdpBinaryhiddenRate.prefixIndex · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:120
def StateHistoryView

State-and-epoch history strictly before t, together with the current state.

Definition (Lean source)
T nX nH :
t :
Fin T
StateHistoryView T nX nH t :
Type
((Fin t.val → JointState nX nH) × (Fin t.val → Bool × ℝ)) × JointState nX nH
CausalSmith.Stat.PomdpBinaryhiddenRate.StateHistoryView · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:123
def ActionHistoryView

A state-history view with the current action adjoined.

Definition (Lean source)
T nX nH :
t :
Fin T
ActionHistoryView T nX nH t :
Type
StateHistoryView T nX nH t × Bool
CausalSmith.Stat.PomdpBinaryhiddenRate.ActionHistoryView · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:127
def histStateView

State-and-epoch history strictly before t, together with the current state.

Definition (Lean source)
T nX nH :
t :
Fin T
tau :
histStateView t tau :
(((fun j ↦ curState (prefixIndex t j) tau), (fun j ↦ tau.2 (prefixIndex t j))), curState t tau)
CausalSmith.Stat.PomdpBinaryhiddenRate.histStateView · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:131
def histActionPair

The state history with the current action adjoined.

Definition (Lean source)
T nX nH :
t :
Fin T
tau :
histActionPair t tau :
StateHistoryView T nX nH t × Bool
(histStateView t tau, actionAt t tau)
CausalSmith.Stat.PomdpBinaryhiddenRate.histActionPair · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:137
def histView

The conditioning view for the reward-transition kernel identity.

Definition (Lean source)
T nX nH :
t :
Fin T
histView t :
StateHistoryView T nX nH t × Bool
histActionPair (T := T) (nX := nX) (nH := nH) t
CausalSmith.Stat.PomdpBinaryhiddenRate.histView · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:141
def histNextPair

The kernel conditioning view with (Y_t,S_{t+1}) adjoined.

Definition (Lean source)
T nX nH :
t :
Fin T
tau :
histNextPair t tau :
(StateHistoryView T nX nH t × Bool) × ℝ × JointState nX nH
(histView t tau, (rewardAt t tau, nextState t tau))
CausalSmith.Stat.PomdpBinaryhiddenRate.histNextPair · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:145
def currentObsState

Read the observed current state from the state-history view.

Definition (Lean source)
T nX nH :
t :
Fin T
h :
currentObsState t h :
Fin nX
h.2.1
CausalSmith.Stat.PomdpBinaryhiddenRate.currentObsState · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:149
def currentStateAction

Read (S_t,A_t) from the kernel-conditioning view.

Definition (Lean source)
T nX nH :
t :
Fin T
h :
currentStateAction t h :
JointState nX nH × Bool
(h.1.2, h.2)
CausalSmith.Stat.PomdpBinaryhiddenRate.currentStateAction · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:153
def kernelOfK

The time-homogeneous reward-transition kernel as a Mathlib kernel.

Definition (Lean source)
T nX nH :
M :
kernelOfK M :
Kernel (JointState nX nH × Bool) (Step nX nH)
Kernel.ofFunOfCountable (fun sa ↦ M.K sa.1 sa.2)
CausalSmith.Stat.PomdpBinaryhiddenRate.kernelOfK · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:158
def behaviourKernel

The behavior action kernel.

Definition (Lean source)
T nX nH :
M :
behaviourKernel M :
Kernel.ofFunOfCountable fun x ↦ ∑ a : Bool, ofReal (M.b x a) • Measure.dirac a
CausalSmith.Stat.PomdpBinaryhiddenRate.behaviourKernel · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:163
theorem measurable_currentStateAction

the measurable current State Action assertion holds.

Formal statement
T nX nH :
t :
Fin T
Measurable (currentStateAction (nX := nX) (nH := nH) t)
Proof (Lean source)
lemma measurable_currentStateAction {T nX nH : Nat} (t : Fin T) : Measurable (currentStateAction (nX := nX) (nH := nH) t) := by unfold currentStateAction fun_prop
CausalSmith.Stat.PomdpBinaryhiddenRate.measurable_currentStateAction · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:169
theorem measurable_currentObsState

the measurable current Obs State assertion holds.

Formal statement
T nX nH :
t :
Fin T
Measurable (currentObsState (nX := nX) (nH := nH) t)
Proof (Lean source)
lemma measurable_currentObsState {T nX nH : Nat} (t : Fin T) : Measurable (currentObsState (nX := nX) (nH := nH) t) := by unfold currentObsState fun_prop
CausalSmith.Stat.PomdpBinaryhiddenRate.measurable_currentObsState · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:175
def ProbabilityVector

A finite vector is a probability vector.

Definition (Lean source)
S :
Type*
p :
S → ℝ
ProbabilityVector p :
Prop
CausalSmith.Stat.PomdpBinaryhiddenRate.ProbabilityVector · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:181

A policy is pointwise a probability vector on the binary action set.

Definition (Lean source)
nX :
p :
x :
PolicyVector p :
Prop
clause 1
a :
0 ≤ p x a
clause 2
∑ a : Bool, p x a = 1
CausalSmith.Stat.PomdpBinaryhiddenRate.PolicyVector · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:185

The joint-state transition matrix induced by a memoryless policy.

Definition (Lean source)
T nX nH :
M :
p :
s s' :
policyKernel M p s s' :
ℝ
∑ a : Bool, p s.1 a * (M.K s a {q | q.2 = s'}).toReal
CausalSmith.Stat.PomdpBinaryhiddenRate.policyKernel · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:189

Stationarity of a finite probability vector for a transition matrix.

Definition (Lean source)
S :
Type*
P :
S → S → ℝ
d :
S → ℝ
IsStationary P d :
Prop
CausalSmith.Stat.PomdpBinaryhiddenRate.IsStationary · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:195

A totalized stationary law, equal to a stationary probability vector whenever one exists.

Definition (Lean source)
S :
Type*
P :
S → S → ℝ
stationaryLaw P :
S → ℝ
Classical.epsilon (IsStationary P)
CausalSmith.Stat.PomdpBinaryhiddenRate.stationaryLaw · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:199
theorem stationaryLaw_isStationary_of_exists

The selected stationary law satisfies the stationarity equations whenever a witness exists. the h condition. the stated conclusion.

Formal statement
S :
Type*
S → S → ℝ
h :
∃ d, IsStationary P d
IsStationary P (stationaryLaw P)
Proof (Lean source)
lemma stationaryLaw_isStationary_of_exists {S : Type*} [Fintype S] {P : S → S → ℝ} (h : ∃ d, IsStationary P d) : IsStationary P (stationaryLaw P) := by exact Classical.epsilon_spec h
CausalSmith.Stat.PomdpBinaryhiddenRate.stationaryLaw_isStationary_of_exists · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:205
def tvNorm

Half the finite ℓ1 norm, the discrete total-variation norm.

Definition (Lean source)
S :
Type*
v :
S → ℝ
tvNorm v :
ℝ
(1 / 2 : ℝ) * ∑ i, |v i|
CausalSmith.Stat.PomdpBinaryhiddenRate.tvNorm · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:211
def applyKernel

Apply a finite row kernel to a signed row vector.

Definition (Lean source)
S :
Type*
v :
S → ℝ
P :
S → S → ℝ
applyKernel v P :
S → ℝ
fun s' ↦ ∑ s, v s * P s s'
CausalSmith.Stat.PomdpBinaryhiddenRate.applyKernel · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:215
def rewardRegression

Target-policy conditional mean reward at a joint state.

Definition (Lean source)
T nX nH :
M :
s :
rewardRegression M s :
ℝ
∑ a : Bool, M.e s.1 a * ∫ p, p.1 ∂(M.K s a)
CausalSmith.Stat.PomdpBinaryhiddenRate.rewardRegression · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:220

The derived contraction factor.

Definition (Lean source)
t0 :
ℝ
mixingAlpha t0 :
ℝ
exp (-(1 / t0))
CausalSmith.Stat.PomdpBinaryhiddenRate.mixingAlpha · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:226

The derived policy-overlap factor.

Definition (Lean source)
zeta :
ℝ
policyFactor zeta :
ℝ
exp zeta
CausalSmith.Stat.PomdpBinaryhiddenRate.policyFactor · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:230
def PomdpKernelLaw

The time-homogeneous reward/successor law, with rewards supported on [0,1].

Definition (Lean source)
T :
M :
PomdpKernelLaw M :
Prop
clause 1
s a :
clause 2
s a :
M.K s a {q | q.1 ∈ Icc (0 : ℝ) 1} = 1
clause 3
t :
Fin T
M.law.map (histNextPair t)
= (M.law.map (histView t)).compProd (Kernel.comap (kernelOfK M) (currentStateAction t) (measurable_currentStateAction t))
CausalSmith.Stat.PomdpBinaryhiddenRate.PomdpKernelLaw · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:236
def SequentialIgnorability

Conditional action randomization through the observed state.

Definition (Lean source)
T :
M :
SequentialIgnorability M :
Prop
clause 1
clause 2
t :
Fin T
M.law.map (histActionPair t)
= (M.law.map (histStateView t)).compProd (Kernel.comap (behaviourKernel M) (currentObsState t) (measurable_currentObsState t))
CausalSmith.Stat.PomdpBinaryhiddenRate.SequentialIgnorability · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:247
def StationaryStart

The trajectory starts in the behavior stationary law.

Definition (Lean source)
T :
M :
StationaryStart M :
Prop
clause 1
IsStationary (policyKernel M M.b) (stationaryLaw (policyKernel M M.b))
clause 2
s :
(M.law.map (stateAt (T := T) (nX := 2) (nH := 2) 0)) {s}
CausalSmith.Stat.PomdpBinaryhiddenRate.StationaryStart · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:257
def PolicyOverlap

The target policy is a probability policy dominated by L times behavior.

Definition (Lean source)
T :
L :
ℝ
M :
PolicyOverlap L M :
Prop
clause 1
clause 2
x a :
M.e x a ≤ L * M.b x a
CausalSmith.Stat.PomdpBinaryhiddenRate.PolicyOverlap · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:264
def BehaviorContraction

Behavior-induced joint-state kernel contracts probability vectors.

Definition (Lean source)
T :
alpha :
ℝ
M :
BehaviorContraction alpha M :
Prop
CausalSmith.Stat.PomdpBinaryhiddenRate.BehaviorContraction · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:270
def TargetContraction

Target-induced joint-state kernel contracts probability vectors.

Definition (Lean source)
T :
alpha :
ℝ
M :
TargetContraction alpha M :
Prop
CausalSmith.Stat.PomdpBinaryhiddenRate.TargetContraction · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:278
structure BinaryPomdpClass

The six-condition binary observed/hidden POMDP class.

Definition (Lean source)
t0 zeta :
ℝ
T :
t0_pos :
0 < t0

@realizes X\mathcal X(Fin 2 observed alphabet) @realizes H\mathcal H(Fin 2 hidden alphabet) @realizes XtX_t(binary observed coordinate) @realizes HtH_t(binary hidden coordinate)

zeta_nonneg :
0 ≤ zeta
pomdp_kernel :
sequential_ignorability :
stationary_start :
policy_overlap :
behavior_contraction :
target_contraction :
CausalSmith.Stat.PomdpBinaryhiddenRate.BinaryPomdpClass · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:286
def targetValue

Stationary target-policy expected reward.

Definition (Lean source)
T :
M :
targetValue M :
ℝ
CausalSmith.Stat.PomdpBinaryhiddenRate.targetValue · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:301
def ratio

The likelihood ratio with zero-cell convention.

Definition (Lean source)
b e :
x :
Fin 2
a :
ratio b e x a :
ℝ
if b x a = 0 then 0 else e x a / b x a
CausalSmith.Stat.PomdpBinaryhiddenRate.ratio · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:306
def score

The score at zero-based epoch t; valid in statements when k ≤ t.val.

Definition (Lean source)
T :
k :
b e :
w :
t :
Fin T
score k b e w t :
ℝ
(w t).2.2 * ∏ j ∈ Finset.univ.filter (fun j : Fin T ↦ j.val ≤ t.val ∧ t.val - j.val ≤ k), ratio b e (w j).1 (w j).2.1
CausalSmith.Stat.PomdpBinaryhiddenRate.score · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:311
def populationMoment

Population score expectation at a specified eligible epoch.

Definition (Lean source)
T :
M :
k :
t :
Fin T
populationMoment M k t :
ℝ
∫ tau, score k M.b M.e (obsProj tau) t ∂M.law
CausalSmith.Stat.PomdpBinaryhiddenRate.populationMoment · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:319
def empiricalMoment

Seven empirical intervention moments use epochs 7 through T.

Definition (Lean source)
T :
k :
b e :
w :
empiricalMoment k b e w :
ℝ
(((T - 6 : Nat) : ℝ)⁻¹) * ∑ t ∈ Finset.univ.filter (fun t : Fin T ↦ 6 ≤ t.val), score k b e w t
CausalSmith.Stat.PomdpBinaryhiddenRate.empiricalMoment · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:326
def FourMatrix

A four-state matrix.

Definition (Lean source)
FourMatrix :
Type
Matrix (JointState 2 2) (JointState 2 2) ℝ
CausalSmith.Stat.PomdpBinaryhiddenRate.FourMatrix · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:333
def dobrushin

Finite Dobrushin coefficient: maximal row total-variation distance.

Definition (Lean source)
dobrushin P :
ℝ
⨆ i : JointState 2 2, ⨆ j : JointState 2 2, (1 / 2 : ℝ) * ∑ s, |P i s - P j s|
CausalSmith.Stat.PomdpBinaryhiddenRate.dobrushin · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:336
def transientPoly

Transient characteristic factor, dividing by the stationary root.

Definition (Lean source)
transientPoly P :
charpoly P /ₘ (X - C 1)
CausalSmith.Stat.PomdpBinaryhiddenRate.transientPoly · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:341
def pairPoly

Product of two transient characteristic factors.

Definition (Lean source)
P P' :
pairPoly P P' :
CausalSmith.Stat.PomdpBinaryhiddenRate.pairPoly · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:346

Seven-moment modulus factor.

Definition (Lean source)
alpha :
ℝ
stabilityFactor alpha :
ℝ
((1 + alpha) / (1 - alpha)) ^ (6 : Nat)
CausalSmith.Stat.PomdpBinaryhiddenRate.stabilityFactor · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:351

Variance constant for the seven scores.

Definition (Lean source)
alpha L :
ℝ
varianceFactor alpha L :
ℝ
13 * L ^ (7 : Nat) + 2 / (1 - alpha)
CausalSmith.Stat.PomdpBinaryhiddenRate.varianceFactor · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:356

The overlap radius in the cardinality-uniform comparator.

Definition (Lean source)
C :
ℝ
overlapRadius C :
ℝ
(C - 1) / C
CausalSmith.Stat.PomdpBinaryhiddenRate.overlapRadius · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:368

The exponent in the cardinality-uniform comparator.

Definition (Lean source)
t0 zeta :
ℝ
rateExponent t0 zeta :
ℝ
2 / (2 + t0 * zeta)
CausalSmith.Stat.PomdpBinaryhiddenRate.rateExponent · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:372

Hidden alphabet used by the comparator reset construction at depth Q T.

Definition (Lean source)
Q :
Nat → Nat
T :
ComparatorHiddenAlphabet Q T :
Type
Fin (2 * (Q T + 1))
CausalSmith.Stat.PomdpBinaryhiddenRate.ComparatorHiddenAlphabet · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:381

The cited reset-depth family at the same logarithmic depth witnesses the fixed-radius two-point lower bound.

Definition (Lean source)
t0 zeta C cReset :
ℝ
Q :
Nat → Nat
ht0 :
0 < t0
hzeta :
0 < zeta
hC :
1 < C
ComparatorResetLowerWitness t0 zeta C cReset Q ht0 hzeta hC :
Prop
∀ᶠ T : Nat in atTop, ∃ (hT : 1 ≤ T) (hQ : 1 ≤ Q T), let M0 := CausalSmith.Stat.PomdpLatentOverlapMinimax.signedDepthModel T (Q T) t0 zeta C false hT ht0 hzeta hC hQ let M1 := CausalSmith.Stat.PomdpLatentOverlapMinimax.signedDepthModel T (Q T) t0 zeta C true hT ht0 hzeta hC hQ M0.nH
= 2 * (Q T + 1) ∧
M1.nH = 2 * (Q T + 1) ∧
∀ est : CausalSmith.Stat.PomdpLatentOverlapMinimax.ObservableEstimator T,
cReset * (T : ℝ) ^ (-CausalSmith.Stat.PomdpLatentOverlapMinimax.rateExponent t0 zeta)
≤ max (CausalSmith.Stat.PomdpLatentOverlapMinimax.observedRisk est M0) (CausalSmith.Stat.PomdpLatentOverlapMinimax.observedRisk est M1)
CausalSmith.Stat.PomdpBinaryhiddenRate.ComparatorResetLowerWitness · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:386

The cited cardinality-uniform comparator. CausalSmith (2026), Latent Stationary Overlap and Minimax Off-Policy Evaluation in Finite POMDPs, main minimax theorem and reset-chain lower-bound construction, handle CausalSmithLatentOverlap2026. This is a cited input.

Definition (Lean source)
t0 zeta :
ℝ
C :
{ c : ℝ // 1 < c }
CardinalityUniformComparator t0 zeta C :
Sort 0
∀ (ht0 : 0 < t0) (hzeta : 0 < zeta),
∃ c1 c2 cReset : ℝ,
0 < c1 ∧
0 < c2 ∧
0 < cReset ∧
(∀ᶠ T : Nat in atTop, c1 * ((T : ℝ)⁻¹ + (T : ℝ) ^ (-(rateExponent t0 zeta)) * overlapRadius C.val ^ (2 * (1 - rateExponent t0 zeta))) ≤ CausalSmith.Stat.PomdpLatentOverlapMinimax.minimaxRisk T t0 zeta C.val ∧ CausalSmith.Stat.PomdpLatentOverlapMinimax.minimaxRisk T t0 zeta C.val ≤ c2 * ((T : ℝ)⁻¹ + (T : ℝ) ^ (-(rateExponent t0 zeta)) * overlapRadius C.val ^ (2 * (1 - rateExponent t0 zeta)))) ∧
∃ Q : Nat → Nat,
(∃ a1 a2 : ℝ, 0 < a1 ∧ 0 < a2 ∧ ∀ᶠ T : Nat in atTop, a1 * log T ≤ Q T ∧ Q T ≤ a2 * log T) ∧
ComparatorResetLowerWitness t0 zeta C.val cReset Q ht0 hzeta C.property
CausalSmith.Stat.PomdpBinaryhiddenRate.CardinalityUniformComparator · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:405
def polynomialTimeHandle Definition 6 in the paper ↗

The handle is the problem of constructing a cost-certified algorithm in an explicit arithmetic or bit-complexity and precision model. Start from the 3×3 Hankel matrix of m̂_(i+j+1)−m̂_(i+j); adapt over recurrence ranks 0–3; constrain transient roots to |z|≤α; return a stable four-state scalar realization with globally certified seven-moment objective gap at most T⁻¹, uniformly on rank-deficient strata and without a positive singular-value margin. The exhaustive grid has a finite candidate list of size O(T^19) for fixed t0, but no runtime or arithmetic-operation bound for fitting and selection is asserted.

Definition (Lean source)
polynomialTimeHandle :
_root_.String
"The handle is the problem of constructing, in an explicit arithmetic or bit-complexity and precision model, a cost-certified algorithm that starts from the 3x3 Hankel matrix of differences mhat_(i+j+1)-mhat_(i+j), adapts over recurrence ranks zero through three, enforces transient roots in |z| <
= alpha, and returns a stable four-state scalar realization whose seven-moment objective is globally certified within T^-1 of the optimum, uniformly over rank-deficient strata and without a positive singular-value margin. The exhaustive estimator is defined over a finite candidate list of size O(T^19) for fixed t0, but no runtime or arithmetic-operation bound for fitting and selection is asserted."
CausalSmith.Stat.PomdpBinaryhiddenRate.polynomialTimeHandle · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:428
def polynomialTimeAttainmentQuestion Remark 1 in the paper ↗

The frozen open question, recorded as a nonassertive string.

Definition (Lean source)
polynomialTimeAttainmentQuestion :
_root_.String
"Can the handle H_poly implement fitting and lexicographic selection over, or replace, the O(T^19)-sized stable-grid candidate list by a rank-adaptive algorithm with explicit runtime, bit-complexity, and precision semantics that returns over M_T^(2)(t0,zeta) a globally certified seven-moment stable fit within objective gap T^-1, uniformly over every rank-deficient Hankel stratum and without a positive singular-value margin?"
CausalSmith.Stat.PomdpBinaryhiddenRate.polynomialTimeAttainmentQuestion · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Basic.lean:441
CausalSmith.Stat.STAT_PomdpBinaryhiddenRate_Research.Constructions 43 declarations The exhaustive rational grid, observable-data minimax functional, and finite four-state testing family are defined from the binary POMDP carrier.

Finite grid and positive testing constructions

The exhaustive rational grid, observable-data minimax functional, and finite four-state testing family are defined from the binary POMDP carrier.

def gridSize

Grid resolution in the estimator construction.

Definition (Lean source)
T :
alpha :
ℝ
gridSize T alpha :
ceil ((22 + 36 / alpha) * T)
CausalSmith.Stat.PomdpBinaryhiddenRate.gridSize · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:22
def GridCode

Unfiltered finite tuple carrying an initial law, four transition rows, and rewards.

Definition (Lean source)
M :
GridCode M :
Type
(Fin 4 → Fin (M + 1)) × (Fin 4 → Fin 4 → Fin (M + 1)) × (Fin 4 → Fin (M + 1))
CausalSmith.Stat.PomdpBinaryhiddenRate.GridCode · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:27

A simplex grid row is a nonnegative integer tuple summing to M.

Definition (Lean source)
M :
u :
Fin 4 → Fin (M + 1)
IsGridRow M u :
Prop
∑ i, (u i).val = M
CausalSmith.Stat.PomdpBinaryhiddenRate.IsGridRow · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:32
def simplexGrid

Enumerate just the four-coordinate simplex rows.

Definition (Lean source)
M :
simplexGrid M :
Finset (Fin 4 → Fin (M + 1))
by classical exact Finset.univ.filter (IsGridRow M)
CausalSmith.Stat.PomdpBinaryhiddenRate.simplexGrid · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:36
def gridMatrixRows

Enumerate four simplex rows as a transition matrix.

Definition (Lean source)
M :
gridMatrixRows M :
Finset (Fin 4 → Fin 4 → Fin (M + 1))
by classical let rows : Finset ((i : Fin 4) → i ∈ (Finset.univ : Finset (Fin 4)) → Fin 4 → Fin (M + 1)) := Finset.pi Finset.univ (fun _ ↦ simplexGrid M) exact rows.image (fun R i ↦ R i (Finset.mem_univ i))
CausalSmith.Stat.PomdpBinaryhiddenRate.gridMatrixRows · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:41
def gridCandidateUniverse

Cartesian enumeration before the Dobrushin filter.

Definition (Lean source)
M :
gridCandidateUniverse M :
by classical exact (simplexGrid M).biUnion (fun nu ↦ (gridMatrixRows M).biUnion (fun R ↦ (Finset.univ : Finset (Fin 4 → Fin (M + 1))).image (fun r ↦ (nu, R, r))))
CausalSmith.Stat.PomdpBinaryhiddenRate.gridCandidateUniverse · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:50
def gridNu

The grid code's initial distribution.

Definition (Lean source)
M :
c :
gridNu c :
Fin 4 → ℝ
fun i ↦ (c.1 i).val / (M : ℝ)
def gridR

The grid code's stochastic matrix before the stability filter.

Definition (Lean source)
M :
c :
gridR c :
Matrix (Fin 4) (Fin 4) ℝ
fun i j ↦ (c.2.1 i j).val / (M : ℝ)
def gridReward

The grid code's reward vector.

Definition (Lean source)
M :
c :
gridReward c :
Fin 4 → ℝ
fun i ↦ (c.2.2 i).val / (M : ℝ)
CausalSmith.Stat.PomdpBinaryhiddenRate.gridReward · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:66
def stabilizedGridMatrix

The stable transition matrix is mixed with the uniform reset kernel.

Definition (Lean source)
alpha :
ℝ
M :
c :
stabilizedGridMatrix alpha c :
Matrix (Fin 4) (Fin 4) ℝ
lambda :
alpha / (alpha + 6 / (M : ℝ))
fun i j ↦ lambda * gridR c i j + (1 - lambda) / 4
CausalSmith.Stat.PomdpBinaryhiddenRate.stabilizedGridMatrix · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:70
def gridDobrushin

A four-point version of the Dobrushin coefficient for grid rows.

Definition (Lean source)
R :
Matrix (Fin 4) (Fin 4) ℝ
gridDobrushin R :
ℝ
⨆ i : Fin 4, ⨆ j : Fin 4, (1 / 2 : ℝ) * ∑ s, |R i s - R j s|
CausalSmith.Stat.PomdpBinaryhiddenRate.gridDobrushin · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:76
def gridCandidates

The finite candidate set, before fitting observable moments.

Definition (Lean source)
M :
alpha :
ℝ
gridCandidates M alpha :
by classical exact (gridCandidateUniverse M).filter (fun c ↦ gridDobrushin (gridR c) ≤ alpha + 6 / (M : ℝ))
CausalSmith.Stat.PomdpBinaryhiddenRate.gridCandidates · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:81
def gridObjective

Seven-moment worst residual of a stable candidate.

Definition (Lean source)
T M :
alpha :
ℝ
b e :
w :
c :
gridObjective alpha b e w c :
ℝ
⨆ k : Fin 7, |empiricalMoment k.val b e w
- ∑ s : Fin 4, (vecMul (gridNu c) ((stabilizedGridMatrix alpha c) ^ k.val)) s * gridReward c s|
CausalSmith.Stat.PomdpBinaryhiddenRate.gridObjective · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:88
def gridLexCode

A base-M+1 code supplies a fixed lexicographic tie break.

Definition (Lean source)
M :
c :
gridLexCode c :
digits :
(List.ofFn fun i : Fin 4 ↦ (c.1 i).val) ++ (List.ofFn fun i : Fin 4 ↦ (List.ofFn fun j : Fin 4 ↦ (c.2.1 i j).val)).flatten ++ (List.ofFn fun i : Fin 4 ↦ (c.2.2 i).val) (: List Nat)
digits.foldl (fun n d ↦ n * (M + 1) + d) 0
CausalSmith.Stat.PomdpBinaryhiddenRate.gridLexCode · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:97
def selectGridCode

Select a minimum-residual candidate, then the least grid code among ties.

Definition (Lean source)
T M :
alpha :
ℝ
b e :
w :
selectGridCode alpha b e w :
candidates :
if h : candidates.Nonempty then let c0 := choose (exists_min_image candidates (gridObjective alpha b e w) h) let minima := candidates.filter (fun c ↦ gridObjective alpha b e w c = gridObjective alpha b e w c0) if hm : minima.Nonempty then choose (exists_min_image minima gridLexCode hm) else c0 else default
CausalSmith.Stat.PomdpBinaryhiddenRate.selectGridCode · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:105
def stableGridEstimator Algorithm 1 in the paper ↗

Finite stable-grid estimator selected by seven observable moments.

Definition (Lean source)
T :
t0 :
ℝ
b e :
w :
stableGridEstimator T t0 b e w :
ℝ
alpha :
c :
selectGridCode (M := gridSize T alpha) alpha b e w
∑ s : Fin 4, stationaryLaw (stabilizedGridMatrix alpha c) s * gridReward c s
CausalSmith.Stat.PomdpBinaryhiddenRate.stableGridEstimator · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:120
def RawEstimator

Raw procedures see only policies and the observed trajectory.

Definition (Lean source)
T :
RawEstimator T :
Type
Policy 2 → Policy 2 → ObsView T 2 → ℝ
CausalSmith.Stat.PomdpBinaryhiddenRate.RawEstimator · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:129

Bounded measurable observable estimators; clipping to [0,1] is loss reducing.

Definition (Lean source)
T :
ObservableEstimator T :
Type
{est : RawEstimator T // (∀ b e w, est b e w ∈ Icc (0 : ℝ) 1) ∧ (∀ b e, Measurable (est b e))}
CausalSmith.Stat.PomdpBinaryhiddenRate.ObservableEstimator · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:132

A fixed binary model index carries exactly the six law conditions.

Definition (Lean source)
T :
t0 zeta :
ℝ
raw :
mem :
BinaryPomdpClass t0 zeta raw
CausalSmith.Stat.PomdpBinaryhiddenRate.ModelIndex · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:138

Observed-data squared risk at a binary POMDP law.

Definition (Lean source)
T :
t0 zeta :
ℝ
m :
ModelIndex T t0 zeta
observedRisk est m :
ℝ
sqRisk (obsLaw m.raw) (est.1 m.raw.b m.raw.e) (targetValue m.raw)
CausalSmith.Stat.PomdpBinaryhiddenRate.observedRisk · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:143

Observable-data minimax squared risk over the fixed binary class.

Definition (Lean source)
T :
t0 zeta :
ℝ
minimaxRisk T t0 zeta :
ℝ
minimaxValueReal (observedRisk (T := T) (t0 := t0) (zeta := zeta))
CausalSmith.Stat.PomdpBinaryhiddenRate.minimaxRisk · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:153

Perturbation amplitude for the two testing laws.

Definition (Lean source)
T :
vT T :
ℝ
1 / (16 * sqrt T)
theorem vT_mem_Ioc

On the theorem's positive-horizon domain, the testing amplitude has the paper's range. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
hTpos :
0 < T
vT T ∈ Ioc (0 : ℝ) (1 / 16)
Proof (Lean source)
lemma vT_mem_Ioc (T : Nat) (hTpos : 0 < T) : vT T ∈ Ioc (0 : ℝ) (1 / 16) := by -- @realizes \(v_T\)(positive-horizon formula and range) have hT' : (1 : ℝ) ≤ T := by exact_mod_cast hTpos have hsqrt : (1 : ℝ) ≤ sqrt T := by rw [← Real.sqrt_one] exact Real.sqrt_le_sqrt hT' have hpos : 0 < sqrt T := lt_of_lt_of_le (by norm_num) hsqrt unfold vT constructor · exact one_div_pos.mpr (by positivity) · apply (div_le_div_iff₀ (by positivity : (0 : ℝ) < 16 * sqrt T) (by norm_num : (0 : ℝ) < 16)).mpr nlinarith
CausalSmith.Stat.PomdpBinaryhiddenRate.vT_mem_Ioc · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:162
def testingRewardProb

Positive Bernoulli probability for a reward under hidden state h.

Definition (Lean source)
v :
ℝ
h :
Fin 2
testingRewardProb v h :
ℝ
1 / 2 + (if h = 1 then 1 / 8 else -(1 / 8)) + v
CausalSmith.Stat.PomdpBinaryhiddenRate.testingRewardProb · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:178
def testingHiddenProb

Hidden-state successor probability controlled by the action.

Definition (Lean source)
a :
testingHiddenProb a :
ℝ
if a then 3 / 4 else 1 / 4
CausalSmith.Stat.PomdpBinaryhiddenRate.testingHiddenProb · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:182
def testingEmission

Observed-state emission probability given the successor hidden state.

Definition (Lean source)
x h :
Fin 2
testingEmission x h :
ℝ
if x = h then 3 / 5 else 2 / 5
CausalSmith.Stat.PomdpBinaryhiddenRate.testingEmission · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:186

The successor hidden-state and emission factors form a probability row. the stated conclusion holds.

Formal statement
a :
∑ sp : JointState 2 2, (if sp.2 = 1 then testingHiddenProb a else 1 - testingHiddenProb a) * testingEmission sp.1 sp.2
= 1
Proof (Lean source)
lemma testingStepMass_sum (a : Bool) : ∑ sp : JointState 2 2, (if sp.2 = 1 then testingHiddenProb a else 1 - testingHiddenProb a) * testingEmission sp.1 sp.2 = 1 := by cases a <;> simp [Fintype.sum_prod_type, Fin.sum_univ_two, testingHiddenProb, testingEmission] <;> norm_num
CausalSmith.Stat.PomdpBinaryhiddenRate.testingStepMass_sum · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:191

The stationary initialization weights sum to one. the stated conclusion holds.

Formal statement
∑ s : JointState 2 2, (1 / 2 : ℝ) * testingEmission s.1 s.2 = 1
Proof (Lean source)
lemma testingInitialMass_sum : ∑ s : JointState 2 2, (1 / 2 : ℝ) * testingEmission s.1 s.2 = 1 := by simp [Fintype.sum_prod_type, Fin.sum_univ_two, testingEmission] norm_num
CausalSmith.Stat.PomdpBinaryhiddenRate.testingInitialMass_sum · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:201

The two conditional reward masses sum to one. Under the listed formal conditions, the stated conclusion holds.

Formal statement
v :
ℝ
h :
Fin 2
∑ y : Bool, (if y then testingRewardProb v h else 1 - testingRewardProb v h) = 1
Proof (Lean source)
lemma testingRewardMass_sum (v : ℝ) (h : Fin 2) : ∑ y : Bool, (if y then testingRewardProb v h else 1 - testingRewardProb v h) = 1 := by simp
CausalSmith.Stat.PomdpBinaryhiddenRate.testingRewardMass_sum · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:208

Summing a complete action, reward, and successor block gives unit mass. the stated conclusion holds.

Formal statement
v :
ℝ
s :
∑ a : Bool, ∑ y : Bool, ∑ sp : JointState 2 2, (1 / 2 : ℝ) * (if y then testingRewardProb v s.2 else 1 - testingRewardProb v s.2) * (if sp.2 = 1 then testingHiddenProb a else 1 - testingHiddenProb a) * testingEmission sp.1 sp.2
= 1
Proof (Lean source)
lemma testingOneStepMass_sum (v : ℝ) (s : JointState 2 2) : ∑ a : Bool, ∑ y : Bool, ∑ sp : JointState 2 2, (1 / 2 : ℝ) * (if y then testingRewardProb v s.2 else 1 - testingRewardProb v s.2) * (if sp.2 = 1 then testingHiddenProb a else 1 - testingHiddenProb a) * testingEmission sp.1 sp.2 = 1 := by simp_rw [mul_assoc] simp_rw [← Finset.mul_sum] simp_rw [testingStepMass_sum] simp_rw [mul_one] simp_rw [testingRewardMass_sum] simp
CausalSmith.Stat.PomdpBinaryhiddenRate.testingOneStepMass_sum · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:214

A normalized successor law at each epoch and the stationary initial law give a normalized sequence of joint states. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
q :
JointState 2 2 → ℝ
hq :
∑ s : JointState 2 2, q s = 1
∑ xs : Fin (T + 1) → JointState 2 2, ((1 / 2 : ℝ) * testingEmission (xs 0).1 (xs 0).2) * ∏ t : Fin T, q (xs t.succ)
= 1
Proof (Lean source)
lemma testingStateMass_sum (T : Nat) (q : JointState 2 2 → ℝ) (hq : ∑ s : JointState 2 2, q s = 1) : ∑ xs : Fin (T + 1) → JointState 2 2, ((1 / 2 : ℝ) * testingEmission (xs 0).1 (xs 0).2) * ∏ t : Fin T, q (xs t.succ) = 1 := by let e := Fin.consEquiv (fun _ : Fin (T + 1) => JointState 2 2) have he : (∑ xs : Fin (T + 1) → JointState 2 2, ((1 / 2 : ℝ) * testingEmission (xs 0).1 (xs 0).2) * ∏ t : Fin T, q (xs t.succ)) = ∑ z : JointState 2 2 × (Fin T → JointState 2 2), ((1 / 2 : ℝ) * testingEmission z.1.1 z.1.2) * ∏ t : Fin T, q (z.2 t) := by exact (Fintype.sum_equiv e _ _ (by intro z; simp [e])).symm rw [he, Fintype.sum_prod_type] simp_rw [← Finset.mul_sum] have hp : (∑ f : Fin T → JointState 2 2, ∏ t : Fin T, q (f t)) = 1 := by simpa [Fintype.piFinset_univ, hq] using (Finset.sum_prod_piFinset (Finset.univ : Finset (JointState 2 2)) (fun (_ : Fin T) s => q s)) rw [hp] simpa using testingInitialMass_sum
CausalSmith.Stat.PomdpBinaryhiddenRate.testingStateMass_sum · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:229

The successor-state mass after averaging over a fair action.

Definition (Lean source)
sp :
testingNextStateMass sp :
ℝ
∑ a : Bool, (1 / 2 : ℝ) * (if sp.2 = 1 then testingHiddenProb a else 1 - testingHiddenProb a) * testingEmission sp.1 sp.2
CausalSmith.Stat.PomdpBinaryhiddenRate.testingNextStateMass · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:255
theorem testingNextStateMass_sum

For the testing construction, the conditional next-state mass function sums to one. the stated conclusion holds.

Formal statement
∑ sp : JointState 2 2, testingNextStateMass sp = 1
Proof (Lean source)
-- @node: testingNextStateMass_sum lemma testingNextStateMass_sum : ∑ sp : JointState 2 2, testingNextStateMass sp = 1 := by simp only [testingNextStateMass] rw [Finset.sum_comm] simp_rw [mul_assoc, ← Finset.mul_sum, testingStepMass_sum] norm_num
CausalSmith.Stat.PomdpBinaryhiddenRate.testingNextStateMass_sum · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:261
theorem testingStepMarginal_sum

Summing a reward and action block leaves the successor-state mass. the stated conclusion holds.

Formal statement
v :
ℝ
s sp :
∑ ay : Bool × Bool, (1 / 2 : ℝ) * (if ay.2 then testingRewardProb v s.2 else 1 - testingRewardProb v s.2) * (if sp.2 = 1 then testingHiddenProb ay.1 else 1 - testingHiddenProb ay.1) * testingEmission sp.1 sp.2
Proof (Lean source)
lemma testingStepMarginal_sum (v : ℝ) (s sp : JointState 2 2) : ∑ ay : Bool × Bool, (1 / 2 : ℝ) * (if ay.2 then testingRewardProb v s.2 else 1 - testingRewardProb v s.2) * (if sp.2 = 1 then testingHiddenProb ay.1 else 1 - testingHiddenProb ay.1) * testingEmission sp.1 sp.2 = testingNextStateMass sp := by simp only [Fintype.sum_prod_type, testingNextStateMass] apply Finset.sum_congr rfl intro a _ calc _ = (1 / 2 : ℝ) * ((if sp.2 = 1 then testingHiddenProb a else 1 - testingHiddenProb a) * testingEmission sp.1 sp.2) * (∑ y : Bool, if y then testingRewardProb v s.2 else 1 - testingRewardProb v s.2) := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro y _ ring _ = _ := by rw [testingRewardMass_sum, mul_one, mul_assoc]
CausalSmith.Stat.PomdpBinaryhiddenRate.testingStepMarginal_sum · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:272
def testingKernel

The positive four-state testing reward/successor kernel.

Definition (Lean source)
v :
ℝ
s :
_a :
testingKernel v s _a :
∑ y : Bool, ∑ sp : JointState 2 2, ofReal ((if y then testingRewardProb v s.2 else 1 - testingRewardProb v s.2) * (if sp.2 = 1 then testingHiddenProb _a else 1 - testingHiddenProb _a) * testingEmission sp.1 sp.2) • Measure.dirac ((if y then (1 : ℝ) else 0), sp)
CausalSmith.Stat.PomdpBinaryhiddenRate.testingKernel · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:293
def TestingPath

A finite testing trajectory with Boolean rewards.

Definition (Lean source)
T :
TestingPath T :
Type
(Fin (T + 1) → JointState 2 2) × (Fin T → Bool × Bool)
CausalSmith.Stat.PomdpBinaryhiddenRate.TestingPath · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:304
def decodeTestingPath

Embed a Boolean-reward path into the real-reward trajectory carrier.

Definition (Lean source)
T :
c :
decodeTestingPath c :
(c.1, fun t ↦ ((c.2 t).1, if (c.2 t).2 then 1 else 0))
CausalSmith.Stat.PomdpBinaryhiddenRate.decodeTestingPath · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:308
def testingPathWeight

Product mass of one path under the testing kernel and fair behavior policy.

Definition (Lean source)
T :
v :
ℝ
c :
testingPathWeight v c :
ℝ
((1 / 2 : ℝ) * testingEmission (c.1 0).1 (c.1 0).2) * ∏ t : Fin T, (1 / 2 : ℝ) * (if (c.2 t).2 then testingRewardProb v (c.1 t.castSucc).2 else 1 - testingRewardProb v (c.1 t.castSucc).2) * (if (c.1 t.succ).2 = 1 then testingHiddenProb (c.2 t).1 else 1 - testingHiddenProb (c.2 t).1) * testingEmission (c.1 t.succ).1 (c.1 t.succ).2
CausalSmith.Stat.PomdpBinaryhiddenRate.testingPathWeight · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:312
theorem testingPathWeight_nonneg Lemma testingPathWeight_nonneg in the paper ↗

Every atom of the finite testing law has nonnegative mass. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
v :
ℝ
hv :
|v| ≤ 1 / 16
c :
Proof (Lean source)
lemma testingPathWeight_nonneg {T : Nat} (v : ℝ) (hv : |v| ≤ 1 / 16) (c : TestingPath T) : 0 ≤ testingPathWeight v c := by have hv' := abs_le.mp hv have hreward (h : Fin 2) : 0 ≤ testingRewardProb v h ∧ testingRewardProb v h ≤ 1 := by fin_cases h <;> simp [testingRewardProb] <;> constructor <;> linarith [hv'.1, hv'.2] have hhidden (a : Bool) : 0 ≤ testingHiddenProb a ∧ testingHiddenProb a ≤ 1 := by cases a <;> norm_num [testingHiddenProb] have hemission (x h : Fin 2) : 0 ≤ testingEmission x h := by fin_cases x <;> fin_cases h <;> norm_num [testingEmission] unfold testingPathWeight apply mul_nonneg · exact mul_nonneg (by norm_num) (hemission _ _) · apply Finset.prod_nonneg intro t _ apply mul_nonneg · apply mul_nonneg · apply mul_nonneg (by norm_num) split_ifs with hy · exact (hreward (c.1 t.castSucc).2).1 · linarith [(hreward (c.1 t.castSucc).2).2] · split_ifs with hs · exact (hhidden (c.2 t).1).1 · linarith [(hhidden (c.2 t).1).2] · exact hemission _ _
CausalSmith.Stat.PomdpBinaryhiddenRate.testingPathWeight_nonneg · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:324

The explicit finite path coefficients sum to one. the stated conclusion holds.

Formal statement
T :
v :
ℝ
∑ c : TestingPath T, testingPathWeight v c = 1
Proof (Lean source)
lemma testingPathWeight_sum (T : Nat) (v : ℝ) : ∑ c : TestingPath T, testingPathWeight v c = 1 := by let step (xs : Fin (T + 1) → JointState 2 2) (t : Fin T) (ay : Bool × Bool) : ℝ := (1 / 2 : ℝ) * (if ay.2 then testingRewardProb v (xs t.castSucc).2 else 1 - testingRewardProb v (xs t.castSucc).2) * (if (xs t.succ).2 = 1 then testingHiddenProb ay.1 else 1 - testingHiddenProb ay.1) * testingEmission (xs t.succ).1 (xs t.succ).2 have hpi (xs : Fin (T + 1) → JointState 2 2) : (∑ ys : Fin T → Bool × Bool, ∏ t : Fin T, step xs t (ys t)) = ∏ t : Fin T, ∑ ay : Bool × Bool, step xs t ay := by simpa [Fintype.piFinset_univ] using (Finset.sum_prod_piFinset (Finset.univ : Finset (Bool × Bool)) (step xs)) calc _ = ∑ xs : Fin (T + 1) → JointState 2 2, ((1 / 2 : ℝ) * testingEmission (xs 0).1 (xs 0).2) * ∏ t : Fin T, testingNextStateMass (xs t.succ) := by simp only [Fintype.sum_prod_type, testingPathWeight] apply Finset.sum_congr rfl intro xs _ rw [← Finset.mul_sum] congr 1 rw [hpi xs] apply Finset.prod_congr rfl intro t _ exact testingStepMarginal_sum v (xs t.castSucc) (xs t.succ) _ = 1 := testingStateMass_sum T testingNextStateMass testingNextStateMass_sum
CausalSmith.Stat.PomdpBinaryhiddenRate.testingPathWeight_sum · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:353
def testingTrajectoryLaw

The finite mixture of path Dirac laws for the testing experiment.

Definition (Lean source)
T :
v :
ℝ
testingTrajectoryLaw T v :
∑ c : TestingPath T, ofReal (testingPathWeight v c) • Measure.dirac (decodeTestingPath c)
CausalSmith.Stat.PomdpBinaryhiddenRate.testingTrajectoryLaw · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:384
theorem testingTrajectoryLaw_isProbability

Normalization of the explicit finite testing trajectory law. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
v :
ℝ
hv :
|v| ≤ 1 / 16
Proof (Lean source)
lemma testingTrajectoryLaw_isProbability (T : Nat) (v : ℝ) (hv : |v| ≤ 1 / 16) : IsProbabilityMeasure (testingTrajectoryLaw T v) := by constructor have hu : (testingTrajectoryLaw T v) univ = ∑ c : TestingPath T, ofReal (testingPathWeight v c) := by simp [testingTrajectoryLaw] rw [hu, ← ENNReal.ofReal_sum_of_nonneg] · rw [testingPathWeight_sum] norm_num · intro c _ exact testingPathWeight_nonneg v hv c
CausalSmith.Stat.PomdpBinaryhiddenRate.testingTrajectoryLaw_isProbability · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:390
def testingExperiment

Testing experiment with equal fair policies and the explicit finite trajectory law.

Definition (Lean source)
T :
v :
ℝ
_hvFamily :
v = vT T ∨ v = -(vT T)
hv :
|v| ≤ 1 / 16
testingExperiment T v _hvFamily hv :
clause 1
clause 2
b := fun _ _ ↦ 1 / 2
clause 3
e := fun _ _ ↦ 1 / 2
clause 4
init := fun s ↦ (1 / 2) * testingEmission s.1 s.2
clause 5
clause 6
law_isProbability := testingTrajectoryLaw_isProbability T v hv
CausalSmith.Stat.PomdpBinaryhiddenRate.testingExperiment · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Constructions.lean:405
CausalSmith.Stat.STAT_PomdpBinaryhiddenRate_Research.Helpers.ComplexOscillation 6 declarations Real TV duality applied to rotated real parts controls the diameter of complex functions.

Complex oscillation contraction

Real TV duality applied to rotated real parts controls the diameter of complex functions. This yields the transient eigenvalue bound without an eigenbasis.

Every pair of rows is within the Dobrushin TV coefficient. the stated conclusion holds.

Formal statement
i j :
(1 / 2 : ℝ) * ∑ s, |P i s - P j s| ≤ dobrushin P
Proof (Lean source)
-- @node: row_tv_le_dobrushin lemma row_tv_le_dobrushin (P : FourMatrix) (i j : JointState 2 2) : (1 / 2 : ℝ) * ∑ s, |P i s - P j s| ≤ dobrushin P := by have hj : (1 / 2 : ℝ) * ∑ s, |P i s - P j s| ≤ ⨆ j : JointState 2 2, (1 / 2 : ℝ) * ∑ s, |P i s - P j s| := le_ciSup (f := fun j : JointState 2 2 => (1 / 2 : ℝ) * ∑ s, |P i s - P j s|) (Finite.bddAbove_range _) j exact hj.trans (le_ciSup (f := fun i : JointState 2 2 => ⨆ j : JointState 2 2, (1 / 2 : ℝ) * ∑ s, |P i s - P j s|) (Finite.bddAbove_range _) i)
CausalSmith.Stat.PomdpBinaryhiddenRate.row_tv_le_dobrushin · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/ComplexOscillation.lean:21
theorem dobrushin_complex_diameter_contraction Lemma dobrushin_complex_diameter_contraction in the paper ↗

A stochastic Dobrushin contraction contracts complex diameters in one step. Under the listed formal conditions, the stated conclusion holds.

Formal statement
alpha B :
ℝ
hδ :
dobrushin P ≤ alpha
f :
JointState 2 2 → ℂ
hf :
∀ i j, ‖f i - f j‖ ≤ B
i j :
‖Matrix.mulVec (P.map (algebraMap ℝ ℂ)) f i - mulVec (P.map (algebraMap ℝ ℂ)) f j‖
≤ alpha * B
Proof (Lean source)
-- @node: dobrushin_complex_diameter_contraction lemma dobrushin_complex_diameter_contraction (P : FourMatrix) (hP : IsStochasticMatrix P) {alpha B : ℝ} (hδ : dobrushin P ≤ alpha) (f : JointState 2 2 → ℂ) (hf : ∀ i j, ‖f i - f j‖ ≤ B) (i j : JointState 2 2) : ‖Matrix.mulVec (P.map (algebraMap ℝ ℂ)) f i - mulVec (P.map (algebraMap ℝ ℂ)) f j‖ ≤ alpha * B := by have hB : 0 ≤ B := by simpa using hf i i have h := probability_complex_mean_tv_diameter (p := P i) (q := P j) ⟨hP.1 i, hP.2 i⟩ ⟨hP.1 j, hP.2 j⟩ hf have heq : mulVec (P.map (algebraMap ℝ ℂ)) f i - mulVec (P.map (algebraMap ℝ ℂ)) f j = ∑ s, ((P i s - P j s : ℝ) : ℂ) * f s := by simp only [mulVec, dotProduct, Matrix.map_apply, ← Finset.sum_sub_distrib, Complex.ofReal_sub, sub_mul] rfl rw [heq] exact h.trans (by simpa only [mul_comm] using mul_le_mul_of_nonneg_left ((row_tv_le_dobrushin P i j).trans hδ) hB)
CausalSmith.Stat.PomdpBinaryhiddenRate.dobrushin_complex_diameter_contraction · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/ComplexOscillation.lean:33
theorem stochastic_complex_constant Lemma stochastic_complex_constant in the paper ↗

A stochastic matrix fixes complex constant vectors. Under the listed formal conditions, the stated conclusion holds.

Formal statement
c :
ℂ
mulVec (P.map (algebraMap ℝ ℂ)) (fun _ => c) = fun _ => c
Proof (Lean source)
-- @node: stochastic_complex_constant lemma stochastic_complex_constant (P : FourMatrix) (hP : IsStochasticMatrix P) (c : ℂ) : mulVec (P.map (algebraMap ℝ ℂ)) (fun _ => c) = fun _ => c := by ext i change (∑ j, (P i j : ℂ) * c) = c rw [← Finset.sum_mul, ← Complex.ofReal_sum, hP.2 i] simp
CausalSmith.Stat.PomdpBinaryhiddenRate.stochastic_complex_constant · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/ComplexOscillation.lean:55
theorem stochastic_complex_eigenvector_nonconstant Lemma stochastic_complex_eigenvector_nonconstant in the paper ↗

A nonstationary complex eigenvector cannot be constant. Under the listed formal conditions, the stated conclusion holds.

Formal statement
z :
ℂ
hz :
z ≠ 1
f :
JointState 2 2 → ℂ
hf0 :
f ≠ 0
hfe :
mulVec (P.map (algebraMap ℝ ℂ)) f = z • f
∃ i j, f i ≠ f j
Proof (Lean source)
-- @node: stochastic_complex_eigenvector_nonconstant lemma stochastic_complex_eigenvector_nonconstant (P : FourMatrix) (hP : IsStochasticMatrix P) {z : ℂ} (hz : z ≠ 1) {f : JointState 2 2 → ℂ} (hf0 : f ≠ 0) (hfe : mulVec (P.map (algebraMap ℝ ℂ)) f = z • f) : ∃ i j, f i ≠ f j := by classical by_contra hc have hc : ∀ i j, f i = f j := by simpa using hc let i : JointState 2 2 := (0, 0) have hconst : f = fun _ => f i := funext fun j => hc j i have hfi : f i ≠ 0 := by intro h apply hf0 simpa [h, Pi.zero_def] using hconst have he : f i = z * f i := by have h := congrFun hfe i rw [hconst, stochastic_complex_constant P hP] at h simpa using h apply hz exact (mul_right_cancel₀ hfi (by simpa using he.symm : z * f i = 1 * f i))
CausalSmith.Stat.PomdpBinaryhiddenRate.stochastic_complex_eigenvector_nonconstant · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/ComplexOscillation.lean:64
theorem dobrushin_complex_eigenvector_norm_le Lemma dobrushin_complex_eigenvector_norm_le in the paper ↗

Nonconstant modes of a stochastic matrix lie in its Dobrushin disk. Under the listed formal conditions, the stated conclusion holds.

Formal statement
alpha :
ℝ
hδ :
dobrushin P ≤ alpha
z :
ℂ
hz :
z ≠ 1
f :
JointState 2 2 → ℂ
hf0 :
f ≠ 0
hfe :
mulVec (P.map (algebraMap ℝ ℂ)) f = z • f
‖z‖ ≤ alpha
Proof (Lean source)
-- @node: dobrushin_complex_eigenvector_norm_le lemma dobrushin_complex_eigenvector_norm_le (P : FourMatrix) (hP : IsStochasticMatrix P) {alpha : ℝ} (hδ : dobrushin P ≤ alpha) {z : ℂ} (hz : z ≠ 1) {f : JointState 2 2 → ℂ} (hf0 : f ≠ 0) (hfe : mulVec (P.map (algebraMap ℝ ℂ)) f = z • f) : ‖z‖ ≤ alpha := by obtain ⟨ij, hmax⟩ := Finite.exists_max (fun ij : JointState 2 2 × JointState 2 2 => ‖f ij.1 - f ij.2‖) have hdiam : ∀ i j, ‖f i - f j‖ ≤ ‖f ij.1 - f ij.2‖ := fun i j => hmax (i, j) obtain ⟨i, j, hij⟩ := stochastic_complex_eigenvector_nonconstant P hP hz hf0 hfe have hpos : 0 < ‖f ij.1 - f ij.2‖ := (norm_pos_iff.mpr (sub_ne_zero.mpr hij)).trans_le (hdiam i j) have h := dobrushin_complex_diameter_contraction P hP hδ f hdiam ij.1 ij.2 rw [hfe] at h simp only [Pi.smul_apply, smul_eq_mul, ← mul_sub, norm_mul] at h exact le_of_mul_le_mul_right h hpos
CausalSmith.Stat.PomdpBinaryhiddenRate.dobrushin_complex_eigenvector_norm_le · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/ComplexOscillation.lean:87
theorem dobrushin_complex_charpoly_root_norm_le Lemma dobrushin_complex_charpoly_root_norm_le in the paper ↗

Every characteristic root other than one obeys the Dobrushin bound. Under the listed formal conditions, the stated conclusion holds.

Formal statement
alpha :
ℝ
hδ :
dobrushin P ≤ alpha
z :
ℂ
hz :
z ≠ 1
hroot :
IsRoot ((charpoly P).map (algebraMap ℝ ℂ)) z
‖z‖ ≤ alpha
Proof (Lean source)
-- @node: dobrushin_complex_charpoly_root_norm_le lemma dobrushin_complex_charpoly_root_norm_le (P : FourMatrix) (hP : IsStochasticMatrix P) {alpha : ℝ} (hδ : dobrushin P ≤ alpha) {z : ℂ} (hz : z ≠ 1) (hroot : IsRoot ((charpoly P).map (algebraMap ℝ ℂ)) z) : ‖z‖ ≤ alpha := by have heig : Module.End.HasEigenvalue (P.map (algebraMap ℝ ℂ)).mulVecLin z := by rw [Module.End.hasEigenvalue_iff_isRoot_charpoly, Matrix.charpoly_mulVecLin, Matrix.charpoly_map] exact hroot obtain ⟨f, hf⟩ := heig.exists_hasEigenvector exact dobrushin_complex_eigenvector_norm_le P hP hδ hz hf.2 hf.apply_eq_smul
CausalSmith.Stat.PomdpBinaryhiddenRate.dobrushin_complex_charpoly_root_norm_le · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/ComplexOscillation.lean:105
CausalSmith.Stat.STAT_PomdpBinaryhiddenRate_Research.Helpers.EmpiricalMoments 12 declarations Each retained score is square-integrable and has the same intervention mean.

Unbiased observable empirical moments

Each retained score is square-integrable and has the same intervention mean. Averaging the T−6 retained epochs therefore gives an unbiased observable moment.

theorem binary_obsProj_measurable Lemma binary_obsProj_measurable in the paper ↗

Projection to observed coordinates satisfies the measurability conclusion.

Formal statement
T :
Measurable (obsProj (T := T) (nX := 2) (nH := 2))
Proof (Lean source)
-- @node: binary_obsProj_measurable @[fun_prop] lemma binary_obsProj_measurable {T : Nat} : Measurable (obsProj (T := T) (nX := 2) (nH := 2)) := by unfold obsProj curState actionAt rewardAt fun_prop
CausalSmith.Stat.PomdpBinaryhiddenRate.binary_obsProj_measurable · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/EmpiricalMoments.lean:21
theorem binary_obsLaw_isProbability

The observed law inherits probability mass one from the trajectory law. the stated conclusion holds.

Formal statement
T :
M :
Proof (Lean source)
-- @node: binary_obsLaw_isProbability lemma binary_obsLaw_isProbability {T : Nat} (M : RawPomdpExperiment T 2 2) : IsProbabilityMeasure (obsLaw M) := Measure.isProbabilityMeasure_map binary_obsProj_measurable.aemeasurable
CausalSmith.Stat.PomdpBinaryhiddenRate.binary_obsLaw_isProbability · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/EmpiricalMoments.lean:28
theorem binary_score_memLp_two

Policy overlap and bounded rewards make every observable score square-integrable. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
t0 zeta :
ℝ
M :
hM :
k :
t :
Fin T
MemLp (fun w => score k M.b M.e w t) 2 (obsLaw M)
Proof (Lean source)
-- @node: binary_score_memLp_two lemma binary_score_memLp_two {T : Nat} {t0 zeta : ℝ} (M : RawPomdpExperiment T 2 2) (hM : BinaryPomdpClass t0 zeta M) (k : Nat) (t : Fin T) : MemLp (fun w => score k M.b M.e w t) 2 (obsLaw M) := by obtain ⟨hK, hI, hO, hY⟩ := finitePomdpView_laws M hM.pomdp_kernel hM.sequential_ignorability hM.policy_overlap have hL : 1 ≤ policyFactor zeta := by simpa only [policyFactor, Real.exp_zero] using Real.exp_le_exp.mpr hM.zeta_nonneg exact PomdpLatentOverlapMinimax.phiwScore_memLp (k := k) hI hO hL hY 2 t
CausalSmith.Stat.PomdpBinaryhiddenRate.binary_score_memLp_two · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/EmpiricalMoments.lean:34
theorem integral_observable_score_eq_matrixMoment

The mean of an eligible score, computed using only its observed-data law, equals the target-policy matrix-power moment. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
t0 zeta :
ℝ
M :
hM :
k :
Fin 7
t :
Fin T
hkt :
k.val ≤ t.val
(∫ w, score k.val M.b M.e w t ∂obsLaw M)
Proof (Lean source)
-- @node: integral_observable_score_eq_matrixMoment lemma integral_observable_score_eq_matrixMoment {T : Nat} {t0 zeta : ℝ} (M : RawPomdpExperiment T 2 2) (hM : BinaryPomdpClass t0 zeta M) (k : Fin 7) (t : Fin T) (hkt : k.val ≤ t.val) : (∫ w, score k.val M.b M.e w t ∂obsLaw M) = matrixMoment (stationaryLaw (policyKernel M M.b)) (of (policyKernel M M.e)) (rewardRegression M) k.val := by rw [obsLaw, integral_map binary_obsProj_measurable.aemeasurable (score_measurable k.val M.b M.e t).aestronglyMeasurable] exact (observable_intervention_moments M hM k t hkt).1
CausalSmith.Stat.PomdpBinaryhiddenRate.integral_observable_score_eq_matrixMoment · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/EmpiricalMoments.lean:45
theorem empiricalMoment_unbiased

The average over epochs seven through T is unbiased for each of the seven intervention moments; its normalization uses exactly T−6 summands. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
t0 zeta :
ℝ
hT :
12 ≤ T
M :
hM :
k :
Fin 7
(∫ w, empiricalMoment k.val M.b M.e w ∂obsLaw M)
Proof (Lean source)
-- @node: empiricalMoment_unbiased lemma empiricalMoment_unbiased {T : Nat} {t0 zeta : ℝ} (hT : 12 ≤ T) (M : RawPomdpExperiment T 2 2) (hM : BinaryPomdpClass t0 zeta M) (k : Fin 7) : (∫ w, empiricalMoment k.val M.b M.e w ∂obsLaw M) = matrixMoment (stationaryLaw (policyKernel M M.b)) (of (policyKernel M M.e)) (rewardRegression M) k.val := by classical let := binary_obsLaw_isProbability M let I := Finset.univ.filter (fun t : Fin T => 6 ≤ t.val) have hI : I = Finset.Ici (⟨6, by omega⟩ : Fin T) := by ext t simp only [I, mem_filter, Finset.mem_univ, true_and, Finset.mem_Ici] rfl have hcard : I.card = T - 6 := by rw [hI, Fin.card_Ici] have hN : ((T - 6 : Nat) : ℝ) ≠ 0 := by exact_mod_cast (show T - 6 ≠ 0 by omega) unfold empiricalMoment rw [integral_const_mul, integral_finsetSum] · have hmean (t : Fin T) (ht : t ∈ I) : (∫ w, score k.val M.b M.e w t ∂obsLaw M) = matrixMoment (stationaryLaw (policyKernel M M.b)) (of (policyKernel M M.e)) (rewardRegression M) k.val := by apply integral_observable_score_eq_matrixMoment M hM k t have ht6 := (Finset.mem_filter.mp ht).2 omega change ((T - 6 : Nat) : ℝ)⁻¹ * (∑ t ∈ I, _) = _ rw [Finset.sum_congr rfl hmean] simp only [Finset.sum_const, nsmul_eq_mul, hcard] rw [← mul_assoc, inv_mul_cancel₀ hN, one_mul] · intro t ht exact (binary_score_memLp_two M hM k.val t).integrable one_le_two
CausalSmith.Stat.PomdpBinaryhiddenRate.empiricalMoment_unbiased · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/EmpiricalMoments.lean:59
theorem observable_score_variance_le

The score variance inherits the second-moment bound in the intervention lemma. This controls the diagonal term in equation (8). Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
t0 zeta :
ℝ
M :
hM :
k :
Fin 7
t :
Fin T
hkt :
k.val ≤ t.val
variance (fun w => score k.val M.b M.e w t) (obsLaw M)
≤ policyFactor zeta ^ (k.val + 1)
Proof (Lean source)
-- @node: observable_score_variance_le lemma observable_score_variance_le {T : Nat} {t0 zeta : ℝ} (M : RawPomdpExperiment T 2 2) (hM : BinaryPomdpClass t0 zeta M) (k : Fin 7) (t : Fin T) (hkt : k.val ≤ t.val) : variance (fun w => score k.val M.b M.e w t) (obsLaw M) ≤ policyFactor zeta ^ (k.val + 1) := by let := binary_obsLaw_isProbability M apply (ProbabilityTheory.variance_le_expectation_sq (binary_score_memLp_two M hM k.val t).aestronglyMeasurable).trans change (∫ w, score k.val M.b M.e w t ^ 2 ∂obsLaw M) ≤ _ rw [obsLaw, integral_map binary_obsProj_measurable.aemeasurable ((score_measurable k.val M.b M.e t).pow_const 2).aestronglyMeasurable] exact (observable_intervention_moments M hM k t hkt).2.1
CausalSmith.Stat.PomdpBinaryhiddenRate.observable_score_variance_le · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/EmpiricalMoments.lean:94
theorem observable_score_covariance_le

Without a separation assumption, nonnegativity of the variances of the sum and difference controls covariance by the common score variance bound. This is the short-lag bound in equation (8). Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
t0 zeta :
ℝ
M :
hM :
k :
Fin 7
t u :
Fin T
hkt :
k.val ≤ t.val
hku :
k.val ≤ u.val
|covariance (fun w => score k.val M.b M.e w t) (fun w => score k.val M.b M.e w u) (obsLaw M)|
≤ policyFactor zeta ^ (k.val + 1)
Proof (Lean source)
-- @node: observable_score_covariance_le lemma observable_score_covariance_le {T : Nat} {t0 zeta : ℝ} (M : RawPomdpExperiment T 2 2) (hM : BinaryPomdpClass t0 zeta M) (k : Fin 7) (t u : Fin T) (hkt : k.val ≤ t.val) (hku : k.val ≤ u.val) : |covariance (fun w => score k.val M.b M.e w t) (fun w => score k.val M.b M.e w u) (obsLaw M)| ≤ policyFactor zeta ^ (k.val + 1) := by let := binary_obsLaw_isProbability M have ht := binary_score_memLp_two M hM k.val t have hu := binary_score_memLp_two M hM k.val u have hvt := observable_score_variance_le M hM k t hkt have hvu := observable_score_variance_le M hM k u hku have hadd := ProbabilityTheory.variance_nonneg (fun w => score k.val M.b M.e w t + score k.val M.b M.e w u) (obsLaw M) have hsub := ProbabilityTheory.variance_nonneg (fun w => score k.val M.b M.e w t - score k.val M.b M.e w u) (obsLaw M) rw [ProbabilityTheory.variance_fun_add ht hu] at hadd rw [ProbabilityTheory.variance_fun_sub ht hu] at hsub exact abs_le.mpr ⟨by linarith, by linarith⟩
CausalSmith.Stat.PomdpBinaryhiddenRate.observable_score_covariance_le · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/EmpiricalMoments.lean:110
theorem observable_score_covariance_le_separated

The separated-window covariance estimate also holds under the observed law used by the estimator, by measurable projection of the full trajectory. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
t0 zeta :
ℝ
M :
hM :
k :
Fin 7
t u :
Fin T
hkt :
k.val ≤ t.val
hu :
k.val + 1 ≤ u.val - t.val
|covariance (fun w => score k.val M.b M.e w t) (fun w => score k.val M.b M.e w u) (obsLaw M)|
≤ mixingAlpha t0 ^ (u.val - t.val - k.val - 1)
Proof (Lean source)
-- @node: observable_score_covariance_le_separated lemma observable_score_covariance_le_separated {T : Nat} {t0 zeta : ℝ} (M : RawPomdpExperiment T 2 2) (hM : BinaryPomdpClass t0 zeta M) (k : Fin 7) (t u : Fin T) (hkt : k.val ≤ t.val) (hu : k.val + 1 ≤ u.val - t.val) : |covariance (fun w => score k.val M.b M.e w t) (fun w => score k.val M.b M.e w u) (obsLaw M)| ≤ mixingAlpha t0 ^ (u.val - t.val - k.val - 1) := by rw [obsLaw, ProbabilityTheory.covariance_map_fun (score_measurable k.val M.b M.e t).aestronglyMeasurable (score_measurable k.val M.b M.e u).aestronglyMeasurable binary_obsProj_measurable.aemeasurable] exact scoreCovariance_le_separated M hM t u hkt hu
CausalSmith.Stat.PomdpBinaryhiddenRate.observable_score_covariance_le_separated · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/EmpiricalMoments.lean:133
theorem empiricalMoment_memLp_two

Finite averaging preserves the scores' square integrability. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
t0 zeta :
ℝ
M :
hM :
k :
MemLp (empiricalMoment k M.b M.e) 2 (obsLaw M)
Proof (Lean source)
-- @node: empiricalMoment_memLp_two lemma empiricalMoment_memLp_two {T : Nat} {t0 zeta : ℝ} (M : RawPomdpExperiment T 2 2) (hM : BinaryPomdpClass t0 zeta M) (k : Nat) : MemLp (empiricalMoment k M.b M.e) 2 (obsLaw M) := by classical exact (memLp_finsetSum _ (fun t _ => binary_score_memLp_two M hM k t)).const_mul _
CausalSmith.Stat.PomdpBinaryhiddenRate.empiricalMoment_memLp_two · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/EmpiricalMoments.lean:149
theorem empiricalMoment_mse_eq_covariance_sum

The unbiased empirical squared error is exactly the normalized finite covariance sum, before bounding short and separated lags in equation (8). Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
t0 zeta :
ℝ
hT :
12 ≤ T
M :
hM :
k :
Fin 7
(∫ w, (empiricalMoment k.val M.b M.e w - matrixMoment (stationaryLaw (policyKernel M M.b)) (of (policyKernel M M.e)) (rewardRegression M) k.val) ^ 2 ∂obsLaw M)
= ((T - 6 : Nat) : ℝ)⁻¹ ^ 2 * ∑ t ∈ Finset.univ.filter (fun t : Fin T => 6 ≤ t.val), ∑ u ∈ Finset.univ.filter (fun u : Fin T => 6 ≤ u.val), covariance (fun w => score k.val M.b M.e w t) (fun w => score k.val M.b M.e w u) (obsLaw M)
Proof (Lean source)
-- @node: empiricalMoment_mse_eq_covariance_sum lemma empiricalMoment_mse_eq_covariance_sum {T : Nat} {t0 zeta : ℝ} (hT : 12 ≤ T) (M : RawPomdpExperiment T 2 2) (hM : BinaryPomdpClass t0 zeta M) (k : Fin 7) : (∫ w, (empiricalMoment k.val M.b M.e w - matrixMoment (stationaryLaw (policyKernel M M.b)) (of (policyKernel M M.e)) (rewardRegression M) k.val) ^ 2 ∂obsLaw M) = ((T - 6 : Nat) : ℝ)⁻¹ ^ 2 * ∑ t ∈ Finset.univ.filter (fun t : Fin T => 6 ≤ t.val), ∑ u ∈ Finset.univ.filter (fun u : Fin T => 6 ≤ u.val), covariance (fun w => score k.val M.b M.e w t) (fun w => score k.val M.b M.e w u) (obsLaw M) := by classical let := binary_obsLaw_isProbability M rw [← empiricalMoment_unbiased hT M hM k, ← ProbabilityTheory.variance_eq_integral (empiricalMoment_memLp_two M hM k.val).aemeasurable] unfold empiricalMoment rw [ProbabilityTheory.variance_const_mul, ProbabilityTheory.variance_fun_sum'] intro t _ exact binary_score_memLp_two M hM k.val t
CausalSmith.Stat.PomdpBinaryhiddenRate.empiricalMoment_mse_eq_covariance_sum · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/EmpiricalMoments.lean:157
theorem seven_error_max_sq_le_sum Lemma seven_error_max_sq_le_sum in the paper ↗

The square of the maximum of seven absolute errors is bounded by their sum of squares, pointwise, as used in equation (9). the stated conclusion holds.

Formal statement
x :
Fin 7 → ℝ
(⨆ k : Fin 7, |x k|) ^ 2 ≤ ∑ k : Fin 7, x k ^ 2
Proof (Lean source)
-- @node: seven_error_max_sq_le_sum lemma seven_error_max_sq_le_sum (x : Fin 7 → ℝ) : (⨆ k : Fin 7, |x k|) ^ 2 ≤ ∑ k : Fin 7, x k ^ 2 := by obtain ⟨k, hk⟩ := exists_eq_ciSup_of_finite (f := fun k => |x k|) rw [← hk, sq_abs] exact Finset.single_le_sum (fun j _ => sq_nonneg (x j)) (Finset.mem_univ k)
CausalSmith.Stat.PomdpBinaryhiddenRate.seven_error_max_sq_le_sum · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/EmpiricalMoments.lean:181
theorem empiricalMoment_max_mse_le_sum

Integrating the maximum error costs at most the sum of the seven empirical mean-squared errors; no independence between the seven moments is needed. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
t0 zeta :
ℝ
M :
hM :
m :
Fin 7 → ℝ
(∫ w, (⨆ k : Fin 7, |empiricalMoment k.val M.b M.e w - m k|) ^ 2 ∂obsLaw M)
≤ ∑ k : Fin 7, ∫ w, (empiricalMoment k.val M.b M.e w - m k) ^ 2 ∂obsLaw M
Proof (Lean source)
-- @node: empiricalMoment_max_mse_le_sum lemma empiricalMoment_max_mse_le_sum {T : Nat} {t0 zeta : ℝ} (M : RawPomdpExperiment T 2 2) (hM : BinaryPomdpClass t0 zeta M) (m : Fin 7 → ℝ) : (∫ w, (⨆ k : Fin 7, |empiricalMoment k.val M.b M.e w - m k|) ^ 2 ∂obsLaw M) ≤ ∑ k : Fin 7, ∫ w, (empiricalMoment k.val M.b M.e w - m k) ^ 2 ∂obsLaw M := by classical let := binary_obsLaw_isProbability M have hint (k : Fin 7) : Integrable (fun w => (empiricalMoment k.val M.b M.e w - m k) ^ 2) (obsLaw M) := ((empiricalMoment_memLp_two M hM k.val).sub (memLp_const (m k))).integrable_sq have hsum : Integrable (fun w => ∑ k : Fin 7, (empiricalMoment k.val M.b M.e w - m k) ^ 2) (obsLaw M) := integrable_finsetSum _ (fun k _ => hint k) have hmeas : AEStronglyMeasurable (fun w => (⨆ k : Fin 7, |empiricalMoment k.val M.b M.e w - m k|) ^ 2) (obsLaw M) := by apply Measurable.aestronglyMeasurable unfold empiricalMoment fun_prop have hmax : Integrable (fun w => (⨆ k : Fin 7, |empiricalMoment k.val M.b M.e w - m k|) ^ 2) (obsLaw M) := hsum.mono' hmeas (Filter.Eventually.of_forall (fun w => by rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] exact seven_error_max_sq_le_sum _)) calc _ ≤ ∫ w, ∑ k : Fin 7, (empiricalMoment k.val M.b M.e w - m k) ^ 2 ∂obsLaw M := integral_mono hmax hsum (fun w => seven_error_max_sq_le_sum _) _ = _ := integral_finsetSum _ (fun k _ => hint k)
CausalSmith.Stat.PomdpBinaryhiddenRate.empiricalMoment_max_mse_le_sum · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/EmpiricalMoments.lean:190
CausalSmith.Stat.STAT_PomdpBinaryhiddenRate_Research.Helpers.EmpiricalVariance 6 declarations Short lags cost at most six score second moments per epoch; separated lags are summed through the geometric mixing tail.

Finite lag summation for the seven empirical moments

Short lags cost at most six score second moments per epoch; separated lags are summed through the geometric mixing tail. This proves equations (8) and (9).

theorem binary_sum_pow_image_le_range Lemma binary_sum_pow_image_le_range in the paper ↗

For a finite collection of nonnegative powers whose distinct exponents all lie below a horizon, the selected power sum is at most the complete geometric sum up to that horizon. Under the listed formal conditions, the stated conclusion holds.

Formal statement
ι :
Type*
s :
f :
ι → Nat
n :
r :
ℝ
hr :
0 ≤ r
hf :
∀ i ∈ s, f i < n
hinj :
InjOn f ↑s
∑ i ∈ s, r ^ f i ≤ ∑ j ∈ range n, r ^ j
Proof (Lean source)
-- @node: binary_sum_pow_image_le_range lemma binary_sum_pow_image_le_range {ι : Type*} (s : Finset ι) (f : ι → Nat) (n : Nat) (r : ℝ) (hr : 0 ≤ r) (hf : ∀ i ∈ s, f i < n) (hinj : InjOn f ↑s) : ∑ i ∈ s, r ^ f i ≤ ∑ j ∈ range n, r ^ j := by classical rw [← Finset.sum_image hinj] apply Finset.sum_le_sum_of_subset_of_nonneg · intro j hj obtain ⟨i, hi, rfl⟩ := Finset.mem_image.mp hj exact Finset.mem_range.mpr (hf i hi) · intro j _ _ positivity
CausalSmith.Stat.PomdpBinaryhiddenRate.binary_sum_pow_image_le_range · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/EmpiricalVariance.lean:18
theorem binary_geom_partial_le_inv Lemma binary_geom_partial_le_inv in the paper ↗

A finite geometric sum with a nonnegative ratio strictly below one is bounded by the reciprocal of one minus that ratio. Under the listed formal conditions, the stated conclusion holds.

Formal statement
a :
ℝ
ha0 :
0 ≤ a
ha1 :
a < 1
n :
∑ j ∈ range n, a ^ j ≤ 1 / (1 - a)
Proof (Lean source)
-- @node: binary_geom_partial_le_inv lemma binary_geom_partial_le_inv {a : ℝ} (ha0 : 0 ≤ a) (ha1 : a < 1) (n : Nat) : ∑ j ∈ range n, a ^ j ≤ 1 / (1 - a) := by calc ∑ j ∈ range n, a ^ j ≤ ∑' j : Nat, a ^ j := by apply Summable.sum_le_tsum · intro j _ positivity · exact summable_geometric_of_norm_lt_one (by simpa [Real.norm_eq_abs, abs_of_nonneg ha0]) _ = 1 / (1 - a) := by rw [tsum_geometric_of_lt_one ha0 ha1]; ring
CausalSmith.Stat.PomdpBinaryhiddenRate.binary_geom_partial_le_inv · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/EmpiricalVariance.lean:34
theorem binary_sum_abs_symmetric_eq_diag_add_two_upper Lemma binary_sum_abs_symmetric_eq_diag_add_two_upper in the paper ↗

For a symmetric pairwise quantity on a finite ordered sample, the sum of its absolute values equals the diagonal contribution plus twice the strictly upper-triangular contribution. Under the listed formal conditions, the stated conclusion holds.

Formal statement
ι :
Type*
s :
f :
ι → ι → ℝ
hsymm :
∀ i j, |f i j| = |f j i|
∑ i ∈ s, ∑ j ∈ s, |f i j|
= ∑ i ∈ s, |f i i| + 2 * ∑ i ∈ s, ∑ j ∈ s.filter (i < ·), |f i j|
Proof (Lean source)
-- @node: binary_sum_abs_symmetric_eq_diag_add_two_upper lemma binary_sum_abs_symmetric_eq_diag_add_two_upper {ι : Type*} [LinearOrder ι] (s : Finset ι) (f : ι → ι → ℝ) (hsymm : ∀ i j, |f i j| = |f j i|) : ∑ i ∈ s, ∑ j ∈ s, |f i j| = ∑ i ∈ s, |f i i| + 2 * ∑ i ∈ s, ∑ j ∈ s.filter (i < ·), |f i j| := by classical have hsplit (i : ι) (hi : i ∈ s) : ∑ j ∈ s, |f i j| = |f i i| + ∑ j ∈ s.filter (fun j ↦ j < i), |f i j| + ∑ j ∈ s.filter (fun j ↦ i < j), |f i j| := by rw [← Finset.sum_filter_add_sum_filter_not s (fun j ↦ j < i)] simp only [not_lt] rw [← Finset.sum_filter_add_sum_filter_not (s.filter fun j ↦ i ≤ j) (fun j ↦ i = j)] simp only [Finset.filter_filter] have heq : s.filter (fun j ↦ i ≤ j ∧ i = j) = {i} := by ext j constructor · intro hj obtain ⟨_, _, hji⟩ := Finset.mem_filter.mp hj simpa using hji.symm · intro hj have hji : j = i := by simpa using hj subst j exact Finset.mem_filter.mpr ⟨hi, le_rfl, rfl⟩ have hgt : s.filter (fun j ↦ i ≤ j ∧ ¬i = j) = s.filter (fun j ↦ i < j) := by ext j simp [lt_iff_le_and_ne] rw [heq, hgt] simp ring rw [Finset.sum_congr rfl (fun i hi ↦ hsplit i hi), Finset.sum_add_distrib, Finset.sum_add_distrib] have hpast : ∑ i ∈ s, ∑ j ∈ s.filter (fun j ↦ j < i), |f i j| = ∑ i ∈ s, ∑ j ∈ s.filter (fun j ↦ i < j), |f i j| := by simp_rw [Finset.sum_filter] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro i hi apply Finset.sum_congr rfl intro j hj by_cases h : i < j · simp [h, hsymm] · simp [h] rw [hpast] ring
CausalSmith.Stat.PomdpBinaryhiddenRate.binary_sum_abs_symmetric_eq_diag_add_two_upper · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/EmpiricalVariance.lean:47
theorem binary_sum_abs_covariance_future_le

The sum over future retained scores has at most k short lags and a geometrically summable separated tail. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
t0 zeta :
ℝ
M :
hM :
k :
Fin 7
t :
Fin T
htk :
k.val ≤ t.val
∑ u ∈ (Finset.univ.filter (fun u : Fin T => 6 ≤ u.val)).filter (fun u => t < u), |covariance (fun w => score k.val M.b M.e w t) (fun w => score k.val M.b M.e w u) (obsLaw M)|
≤ k.val * policyFactor zeta ^ (k.val + 1) + 1 / (1 - mixingAlpha t0)
Proof (Lean source)
-- @node: binary_sum_abs_covariance_future_le lemma binary_sum_abs_covariance_future_le {T : Nat} {t0 zeta : ℝ} (M : RawPomdpExperiment T 2 2) (hM : BinaryPomdpClass t0 zeta M) (k : Fin 7) (t : Fin T) (htk : k.val ≤ t.val) : ∑ u ∈ (Finset.univ.filter (fun u : Fin T => 6 ≤ u.val)).filter (fun u => t < u), |covariance (fun w => score k.val M.b M.e w t) (fun w => score k.val M.b M.e w u) (obsLaw M)| ≤ k.val * policyFactor zeta ^ (k.val + 1) + 1 / (1 - mixingAlpha t0) := by classical let I := Finset.univ.filter (fun u : Fin T => 6 ≤ u.val) let U := I.filter (fun u => t < u) let A := U.filter (fun u => u.val - t.val ≤ k.val) let D := U.filter (fun u => k.val + 1 ≤ u.val - t.val) have hpart : U = A ∪ D := by ext u simp only [U, A, D, mem_union, mem_filter] constructor · intro hu by_cases hlag : u.val - t.val ≤ k.val · exact inl ⟨hu, hlag⟩ · exact inr ⟨hu, by omega⟩ · rintro (hu | hu) <;> exact hu.1 have hdisj : Disjoint A D := by rw [Finset.disjoint_left] intro u huA huD simp only [A, D, mem_filter] at huA huD omega change (∑ u ∈ U, _) ≤ _ rw [hpart, Finset.sum_union hdisj] have hAcard : (A.card : ℝ) ≤ k.val := by have hb := binary_sum_pow_image_le_range A (fun u => u.val - t.val - 1) k.val 1 zero_le_one (by intro u hu obtain ⟨huU, hlag⟩ := Finset.mem_filter.mp hu have htu := (Finset.mem_filter.mp huU).2 omega) (by intro u hu v hv huv apply Fin.ext have htu := (Finset.mem_filter.mp (Finset.mem_filter.mp hu).1).2 have htv := (Finset.mem_filter.mp (Finset.mem_filter.mp hv).1).2 simp only at huv omega) simpa using hb have hA : (∑ u ∈ A, |covariance (fun w => score k.val M.b M.e w t) (fun w => score k.val M.b M.e w u) (obsLaw M)|) ≤ k.val * policyFactor zeta ^ (k.val + 1) := by calc _ ≤ ∑ _u ∈ A, policyFactor zeta ^ (k.val + 1) := by apply Finset.sum_le_sum intro u hu have htu := (Finset.mem_filter.mp (Finset.mem_filter.mp hu).1).2 exact observable_score_covariance_le M hM k t u htk (by omega) _ = A.card * policyFactor zeta ^ (k.val + 1) := by simp _ ≤ _ := mul_le_mul_of_nonneg_right hAcard (by unfold policyFactor; positivity) have ha0 : 0 ≤ mixingAlpha t0 := by unfold mixingAlpha; positivity have ha1 : mixingAlpha t0 < 1 := by rw [mixingAlpha, Real.exp_lt_one_iff] exact neg_neg_of_pos (one_div_pos.mpr hM.t0_pos) have hD : (∑ u ∈ D, |covariance (fun w => score k.val M.b M.e w t) (fun w => score k.val M.b M.e w u) (obsLaw M)|) ≤ 1 / (1 - mixingAlpha t0) := by calc _ ≤ ∑ u ∈ D, mixingAlpha t0 ^ (u.val - t.val - k.val - 1) := by apply Finset.sum_le_sum intro u hu exact observable_score_covariance_le_separated M hM k t u htk (Finset.mem_filter.mp hu).2 _ ≤ ∑ j ∈ range T, mixingAlpha t0 ^ j := by apply binary_sum_pow_image_le_range D (fun u => u.val - t.val - k.val - 1) T (mixingAlpha t0) ha0 · intro u hu omega · intro u hu v hv huv apply Fin.ext have hlu := (Finset.mem_filter.mp hu).2 have hlv := (Finset.mem_filter.mp hv).2 simp only at huv omega _ ≤ _ := binary_geom_partial_le_inv ha0 ha1 T exact add_le_add hA hD
CausalSmith.Stat.PomdpBinaryhiddenRate.binary_sum_abs_covariance_future_le · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/EmpiricalVariance.lean:97
theorem empiricalMoment_mse_le_varianceFactor

Equation (8): each unbiased empirical moment has mean-squared error at most V divided by the number of retained epochs. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
t0 zeta :
ℝ
hT :
12 ≤ T
M :
hM :
k :
Fin 7
(∫ w, (empiricalMoment k.val M.b M.e w - matrixMoment (stationaryLaw (policyKernel M M.b)) (of (policyKernel M M.e)) (rewardRegression M) k.val) ^ 2 ∂obsLaw M)
≤ varianceFactor (mixingAlpha t0) (policyFactor zeta) / (T - 6 : Nat)
Proof (Lean source)
-- @node: empiricalMoment_mse_le_varianceFactor lemma empiricalMoment_mse_le_varianceFactor {T : Nat} {t0 zeta : ℝ} (hT : 12 ≤ T) (M : RawPomdpExperiment T 2 2) (hM : BinaryPomdpClass t0 zeta M) (k : Fin 7) : (∫ w, (empiricalMoment k.val M.b M.e w - matrixMoment (stationaryLaw (policyKernel M M.b)) (of (policyKernel M M.e)) (rewardRegression M) k.val) ^ 2 ∂obsLaw M) ≤ varianceFactor (mixingAlpha t0) (policyFactor zeta) / (T - 6 : Nat) := by classical let := binary_obsLaw_isProbability M let I := Finset.univ.filter (fun t : Fin T => 6 ≤ t.val) let L := policyFactor zeta let a := mixingAlpha t0 have hI : I = Finset.Ici (⟨6, by omega⟩ : Fin T) := by ext t simp only [I, mem_filter, Finset.mem_univ, true_and, Finset.mem_Ici] rfl have hcard : I.card = T - 6 := by rw [hI, Fin.card_Ici] have hL : 1 ≤ L := by simpa only [L, policyFactor, Real.exp_zero] using Real.exp_le_exp.mpr hM.zeta_nonneg have hp : L ^ (k.val + 1) ≤ L ^ 7 := by exact pow_le_pow_right₀ hL (by omega) have hsum : (∑ t ∈ I, ∑ u ∈ I, covariance (fun w => score k.val M.b M.e w t) (fun w => score k.val M.b M.e w u) (obsLaw M)) ≤ (T - 6 : Nat) * varianceFactor a L := by calc _ ≤ ∑ t ∈ I, ∑ u ∈ I, |covariance (fun w => score k.val M.b M.e w t) (fun w => score k.val M.b M.e w u) (obsLaw M)| := by apply Finset.sum_le_sum intro t ht apply Finset.sum_le_sum intro u hu exact le_abs_self _ _ = (∑ t ∈ I, |covariance (fun w => score k.val M.b M.e w t) (fun w => score k.val M.b M.e w t) (obsLaw M)|) + 2 * ∑ t ∈ I, ∑ u ∈ I.filter (fun u => t < u), |covariance (fun w => score k.val M.b M.e w t) (fun w => score k.val M.b M.e w u) (obsLaw M)| := by apply binary_sum_abs_symmetric_eq_diag_add_two_upper intro t u rw [covariance_comm] _ ≤ I.card * L ^ (k.val + 1) + 2 * (I.card * (k.val * L ^ (k.val + 1) + 1 / (1 - a))) := by gcongr · calc _ ≤ ∑ _t ∈ I, L ^ (k.val + 1) := by apply Finset.sum_le_sum intro t ht have ht6 := (Finset.mem_filter.mp ht).2 rw [covariance_self (score_measurable k.val M.b M.e t).aemeasurable, abs_of_nonneg (variance_nonneg _ _)] exact observable_score_variance_le M hM k t (by omega) _ = _ := by simp · calc _ ≤ ∑ _t ∈ I, (k.val * L ^ (k.val + 1) + 1 / (1 - a)) := by apply Finset.sum_le_sum intro t ht have ht6 := (Finset.mem_filter.mp ht).2 exact binary_sum_abs_covariance_future_le M hM k t (by omega) _ = _ := by simp; ring _ = I.card * ((1 + 2 * k.val) * L ^ (k.val + 1) + 2 / (1 - a)) := by ring _ ≤ I.card * (13 * L ^ 7 + 2 / (1 - a)) := by gcongr · have hk : (k.val : ℝ) ≤ 6 := by exact_mod_cast (show k.val ≤ 6 by omega) linarith _ = _ := by rw [hcard]; rfl rw [empiricalMoment_mse_eq_covariance_sum hT M hM k] change ((T - 6 : Nat) : ℝ)⁻¹ ^ 2 * (∑ t ∈ I, ∑ u ∈ I, _) ≤ _ calc _ ≤ ((T - 6 : Nat) : ℝ)⁻¹ ^ 2 * ((T - 6 : Nat) * varianceFactor a L) := mul_le_mul_of_nonneg_left hsum (sq_nonneg _) _ = _ := by have hn : ((T - 6 : Nat) : ℝ) ≠ 0 := by exact_mod_cast (show T - 6 ≠ 0 by omega) dsimp [a, L] field_simp
CausalSmith.Stat.PomdpBinaryhiddenRate.empiricalMoment_mse_le_varianceFactor · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/EmpiricalVariance.lean:184
theorem empiricalMoment_max_mse_le_varianceFactor

Equation (9): taking the maximum of seven errors costs only a factor seven. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
t0 zeta :
ℝ
hT :
12 ≤ T
M :
hM :
(∫ w, (⨆ k : Fin 7, |empiricalMoment k.val M.b M.e w - matrixMoment (stationaryLaw (policyKernel M M.b)) (of (policyKernel M M.e)) (rewardRegression M) k.val|) ^ 2 ∂obsLaw M)
≤ 7 * varianceFactor (mixingAlpha t0) (policyFactor zeta) / (T - 6 : Nat)
Proof (Lean source)
-- @node: empiricalMoment_max_mse_le_varianceFactor lemma empiricalMoment_max_mse_le_varianceFactor {T : Nat} {t0 zeta : ℝ} (hT : 12 ≤ T) (M : RawPomdpExperiment T 2 2) (hM : BinaryPomdpClass t0 zeta M) : (∫ w, (⨆ k : Fin 7, |empiricalMoment k.val M.b M.e w - matrixMoment (stationaryLaw (policyKernel M M.b)) (of (policyKernel M M.e)) (rewardRegression M) k.val|) ^ 2 ∂obsLaw M) ≤ 7 * varianceFactor (mixingAlpha t0) (policyFactor zeta) / (T - 6 : Nat) := by calc _ ≤ ∑ k : Fin 7, ∫ w, (empiricalMoment k.val M.b M.e w - matrixMoment (stationaryLaw (policyKernel M M.b)) (of (policyKernel M M.e)) (rewardRegression M) k.val) ^ 2 ∂obsLaw M := empiricalMoment_max_mse_le_sum M hM _ _ ≤ ∑ _k : Fin 7, varianceFactor (mixingAlpha t0) (policyFactor zeta) / (T - 6 : Nat) := Finset.sum_le_sum (fun k _ => empiricalMoment_mse_le_varianceFactor hT M hM k) _ = _ := by simp; ring
CausalSmith.Stat.PomdpBinaryhiddenRate.empiricalMoment_max_mse_le_varianceFactor · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/EmpiricalVariance.lean:264
CausalSmith.Stat.STAT_PomdpBinaryhiddenRate_Research.Helpers.GridAdmissibility 14 declarations The finite candidate set contains a reset kernel.

Admissibility of the finite stable-grid estimator

The finite candidate set contains a reset kernel. Its selected matrix is stochastic, its stationary reward is bounded, and selection is measurable because it depends on finitely many measurable comparisons.

theorem gridCandidates_row

Every enumerated candidate has simplex transition rows. Under the listed formal conditions, the stated conclusion holds.

Formal statement
M :
alpha :
ℝ
c :
hc :
c ∈ gridCandidates M alpha
i :
Fin 4
IsGridRow M (c.2.1 i)
Proof (Lean source)
-- @node: gridCandidates_row lemma gridCandidates_row {M : Nat} {alpha : ℝ} {c : GridCode M} (hc : c ∈ gridCandidates M alpha) (i : Fin 4) : IsGridRow M (c.2.1 i) := by classical obtain ⟨nu, hnu, R, hR, r, hr, heq⟩ := by simpa only [gridCandidates, mem_filter, gridCandidateUniverse, Finset.mem_biUnion, mem_image] using (Finset.mem_filter.mp hc).1 cases heq obtain ⟨rows, hrows, hEq⟩ := Finset.mem_image.mp hR rw [← hEq] have hi := (Finset.mem_pi.mp hrows) i (Finset.mem_univ i) exact (Finset.mem_filter.mp hi).2
CausalSmith.Stat.PomdpBinaryhiddenRate.gridCandidates_row · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/GridAdmissibility.lean:21
theorem gridCandidates_nonempty Lemma gridCandidates_nonempty in the paper ↗

A point-mass row repeated four times supplies a grid candidate. Under the listed formal conditions, the stated conclusion holds.

Formal statement
M :
alpha :
ℝ
hα :
0 ≤ alpha
(gridCandidates M alpha).Nonempty
Proof (Lean source)
-- @node: gridCandidates_nonempty lemma gridCandidates_nonempty (M : Nat) (alpha : ℝ) (hα : 0 ≤ alpha) : (gridCandidates M alpha).Nonempty := by classical let u : Fin 4 → Fin (M + 1) := fun i => if i = 0 then ⟨M, by omega⟩ else 0 have hu : u ∈ simplexGrid M := by simp [simplexGrid, IsGridRow, u, Fin.sum_univ_succ] let R : Fin 4 → Fin 4 → Fin (M + 1) := fun _ => u have hR : R ∈ gridMatrixRows M := by apply Finset.mem_image.mpr refine ⟨fun _ _ => u, ?_, rfl⟩ exact Finset.mem_pi.mpr (fun _ _ => hu) let c : GridCode M := (u, R, fun _ => 0) refine ⟨c, Finset.mem_filter.mpr ⟨?_, ?_⟩⟩ · apply Finset.mem_biUnion.mpr refine ⟨u, hu, Finset.mem_biUnion.mpr ⟨R, hR, ?_⟩⟩ exact Finset.mem_image.mpr ⟨fun _ => 0, Finset.mem_univ _, rfl⟩ · have hz : gridDobrushin (gridR c) = 0 := by simp [gridDobrushin, gridR, c, R] rw [hz] positivity
CausalSmith.Stat.PomdpBinaryhiddenRate.gridCandidates_nonempty · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/GridAdmissibility.lean:36

Both stages of minimization retain membership in the candidate set. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T M :
alpha :
ℝ
hα :
0 ≤ alpha
b e :
w :
selectGridCode (M := M) alpha b e w ∈ gridCandidates M alpha
Proof (Lean source)
-- @node: selectGridCode_mem lemma selectGridCode_mem {T M : Nat} (alpha : ℝ) (hα : 0 ≤ alpha) (b e : Policy 2) (w : ObsView T 2) : selectGridCode (M := M) alpha b e w ∈ gridCandidates M alpha := by classical unfold selectGridCode rw [dif_pos (gridCandidates_nonempty M alpha hα)] dsimp only split_ifs with hm · exact (Finset.mem_filter.mp (Classical.choose_spec (exists_min_image _ gridLexCode hm)).1).1 · exact (Classical.choose_spec (exists_min_image _ _ (gridCandidates_nonempty M alpha hα))).1
CausalSmith.Stat.PomdpBinaryhiddenRate.selectGridCode_mem · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/GridAdmissibility.lean:59

Positive-resolution simplex grid rows decode to a stochastic matrix. Under the listed formal conditions, the stated conclusion holds.

Formal statement
M :
hM :
0 < M
alpha :
ℝ
c :
hc :
c ∈ gridCandidates M alpha
Proof (Lean source)
-- @node: gridR_stochastic lemma gridR_stochastic {M : Nat} (hM : 0 < M) {alpha : ℝ} {c : GridCode M} (hc : c ∈ gridCandidates M alpha) : IsStochasticMatrix (gridR c) := by constructor · intro i j exact div_nonneg (Nat.cast_nonneg _) (Nat.cast_nonneg _) · intro i simp only [gridR, ← Finset.sum_div] have hi : (∑ j : Fin 4, ((c.2.1 i j).val : ℝ)) = M := by exact_mod_cast gridCandidates_row hc i rw [hi, div_self (by positivity : (M : ℝ) ≠ 0)]
CausalSmith.Stat.PomdpBinaryhiddenRate.gridR_stochastic · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/GridAdmissibility.lean:74
theorem stabilizedGridMatrix_stationary

Mixing a stochastic grid matrix with a positive reset gives a stationary law. Under the listed formal conditions, the stated conclusion holds.

Formal statement
M :
hM :
0 < M
alpha :
ℝ
hα :
0 < alpha
c :
hc :
c ∈ gridCandidates M alpha
IsStationary (stabilizedGridMatrix alpha c) (stationaryLaw (stabilizedGridMatrix alpha c))
Proof (Lean source)
-- @node: stabilizedGridMatrix_stationary lemma stabilizedGridMatrix_stationary {M : Nat} (hM : 0 < M) {alpha : ℝ} (hα : 0 < alpha) {c : GridCode M} (hc : c ∈ gridCandidates M alpha) : IsStationary (stabilizedGridMatrix alpha c) (stationaryLaw (stabilizedGridMatrix alpha c)) := by have hR := gridR_stochastic hM hc let lam := alpha / (alpha + 6 / (M : ℝ)) have hden : 0 < alpha + 6 / (M : ℝ) := by positivity have hlam0 : 0 ≤ lam := by dsimp [lam]; positivity have hlam1 : lam < 1 := by dsimp [lam] apply (div_lt_one hden).mpr have : 0 < 6 / (M : ℝ) := by positivity linarith have hP : IsStochasticMatrix (stabilizedGridMatrix alpha c) := by constructor · intro i j change 0 ≤ lam * gridR c i j + (1 - lam) / 4 exact add_nonneg (mul_nonneg hlam0 (hR.1 i j)) (by positivity) · intro i dsimp only [stabilizedGridMatrix] change (∑ j : Fin 4, (lam * gridR c i j + (1 - lam) / 4)) = 1 rw [Finset.sum_add_distrib, ← Finset.mul_sum, hR.2 i] simp ring have hminor : Minorizes (stabilizedGridMatrix alpha c) (1 - lam) (fun _ : Fin 4 => (1 / 4 : ℝ)) := by refine ⟨⟨by intro i; norm_num, by norm_num⟩, by linarith, by linarith, ?_⟩ intro i j change (1 - lam) * (1 / 4) ≤ lam * gridR c i j + (1 - lam) / 4 nlinarith [mul_nonneg hlam0 (hR.1 i j)] have hcontract := contractsL1_of_minorization hP hminor have hex := existsUnique_stationary_of_contractsL1 hP (show 0 ≤ 1 - (1 - lam) by linarith) (show 1 - (1 - lam) < 1 by linarith) hcontract exact stationaryLaw_isStationary_of_exists hex.exists
CausalSmith.Stat.PomdpBinaryhiddenRate.stabilizedGridMatrix_stationary · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/GridAdmissibility.lean:87
theorem stableGridEstimator_range

Every selected candidate has a stationary reward between zero and one. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
t0 :
ℝ
_ht0 :
0 < t0
hT :
12 ≤ T
b e :
w :
stableGridEstimator T t0 b e w ∈ Icc (0 : ℝ) 1
Proof (Lean source)
-- @node: stableGridEstimator_range lemma stableGridEstimator_range (T : Nat) (t0 : ℝ) (_ht0 : 0 < t0) (hT : 12 ≤ T) (b e : Policy 2) (w : ObsView T 2) : stableGridEstimator T t0 b e w ∈ Icc (0 : ℝ) 1 := by have hα : 0 < mixingAlpha t0 := Real.exp_pos _ have hsize : 0 < gridSize T (mixingAlpha t0) := by unfold gridSize apply Nat.ceil_pos.mpr have : (0 : ℝ) < T := by exact_mod_cast (show 0 < T by omega) positivity let c := selectGridCode (M := gridSize T (mixingAlpha t0)) (mixingAlpha t0) b e w have hc : c ∈ gridCandidates (gridSize T (mixingAlpha t0)) (mixingAlpha t0) := selectGridCode_mem _ hα.le b e w have hp := (stabilizedGridMatrix_stationary hsize hα hc).1 have hr (i : Fin 4) : gridReward c i ∈ Icc (0 : ℝ) 1 := by constructor · exact div_nonneg (Nat.cast_nonneg _) (Nat.cast_nonneg _) · apply (div_le_one (by exact_mod_cast hsize : (0 : ℝ) < gridSize T (mixingAlpha t0))).mpr exact_mod_cast (le_of_lt_succ (c.2.2 i).isLt) change (∑ i, stationaryLaw (stabilizedGridMatrix (mixingAlpha t0) c) i * gridReward c i) ∈ Icc (0 : ℝ) 1 constructor · exact Finset.sum_nonneg (fun i _ => mul_nonneg (hp.1 i) (hr i).1) · calc _ ≤ ∑ i, stationaryLaw (stabilizedGridMatrix (mixingAlpha t0) c) i := by apply Finset.sum_le_sum intro i _ exact mul_le_of_le_one_right (hp.1 i) (hr i).2 _ = 1 := hp.2
CausalSmith.Stat.PomdpBinaryhiddenRate.stableGridEstimator_range · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/GridAdmissibility.lean:126

A fixed-window score satisfies the measurability conclusion.

Formal statement
T :
k :
b e :
t :
Fin T
Measurable (fun w : ObsView T 2 => score k b e w t)
Proof (Lean source)
-- @node: score_measurable @[fun_prop] lemma score_measurable {T : Nat} (k : Nat) (b e : Policy 2) (t : Fin T) : Measurable (fun w : ObsView T 2 => score k b e w t) := by unfold score have hratio : Measurable (fun z : Fin 2 × Bool => ratio b e z.1 z.2) := measurable_of_finite _ apply mul (by fun_prop) apply Finset.measurable_prod intro j hj exact hratio.comp (show Measurable (fun w : ObsView T 2 => ((w j).1, (w j).2.1)) by fun_prop)
theorem empiricalMoment_measurable

Each empirical moment satisfies the measurability conclusion.

Formal statement
T :
k :
b e :
Measurable (empiricalMoment (T := T) k b e)
Proof (Lean source)
-- @node: empiricalMoment_measurable @[fun_prop] lemma empiricalMoment_measurable {T : Nat} (k : Nat) (b e : Policy 2) : Measurable (empiricalMoment (T := T) k b e) := by unfold empiricalMoment fun_prop
CausalSmith.Stat.PomdpBinaryhiddenRate.empiricalMoment_measurable · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/GridAdmissibility.lean:171
theorem gridObjective_measurable Lemma gridObjective_measurable in the paper ↗

The seven-moment maximum discrepancy satisfies the measurability conclusion.

Formal statement
T M :
alpha :
ℝ
b e :
c :
Measurable (fun w : ObsView T 2 => gridObjective alpha b e w c)
Proof (Lean source)
-- @node: gridObjective_measurable @[fun_prop] lemma gridObjective_measurable {T M : Nat} (alpha : ℝ) (b e : Policy 2) (c : GridCode M) : Measurable (fun w : ObsView T 2 => gridObjective alpha b e w c) := by unfold gridObjective apply Measurable.iSup intro k simpa only [Real.norm_eq_abs, Pi.sub_apply] using ((empiricalMoment_measurable k.val b e).sub (measurable_const (a := ∑ s : Fin 4, (vecMul (gridNu c) ((stabilizedGridMatrix alpha c) ^ k.val)) s * gridReward c s))).norm
CausalSmith.Stat.PomdpBinaryhiddenRate.gridObjective_measurable · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/GridAdmissibility.lean:178

Choosing a minimum depends only on the pairwise order of the objectives. Under the listed formal conditions, the stated conclusion holds.

Formal statement
C :
Type*
s :
hs :
s.Nonempty
f g :
C → ℝ
h :
∀ c d, f c ≤ f d ↔ g c ≤ g d
Proof (Lean source)
-- @node: grid_min_choose_congr lemma grid_min_choose_congr {C : Type*} (s : Finset C) (hs : s.Nonempty) (f g : C → ℝ) (h : ∀ c d, f c ≤ f d ↔ g c ≤ g d) : choose (exists_min_image s f hs) = choose (exists_min_image s g hs) := by have heq : (fun c => c ∈ s ∧ ∀ d ∈ s, f c ≤ f d) = (fun c => c ∈ s ∧ ∀ d ∈ s, g c ≤ g d) := by funext c apply propext simp_rw [h] generalize hp : (exists_min_image s f hs) = p generalize hq : (exists_min_image s g hs) = q change @choose C (fun c => c ∈ s ∧ ∀ d ∈ s, f c ≤ f d) p = @choose C (fun c => c ∈ s ∧ ∀ d ∈ s, g c ≤ g d) q congr 1
CausalSmith.Stat.PomdpBinaryhiddenRate.grid_min_choose_congr · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/GridAdmissibility.lean:192
theorem selectGridCode_order_congr Lemma selectGridCode_order_congr in the paper ↗

The selected code is constant whenever all objective comparisons agree. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T M :
alpha :
ℝ
b e :
w w' :
h :
∀ c d : GridCode M,
gridObjective alpha b e w c
≤ gridObjective alpha b e w d ↔ gridObjective alpha b e w' c ≤ gridObjective alpha b e w' d
selectGridCode (M := M) alpha b e w = selectGridCode alpha b e w'
Proof (Lean source)
-- @node: selectGridCode_order_congr lemma selectGridCode_order_congr {T M : Nat} (alpha : ℝ) (b e : Policy 2) (w w' : ObsView T 2) (h : ∀ c d : GridCode M, gridObjective alpha b e w c ≤ gridObjective alpha b e w d ↔ gridObjective alpha b e w' c ≤ gridObjective alpha b e w' d) : selectGridCode (M := M) alpha b e w = selectGridCode alpha b e w' := by classical let s := gridCandidates M alpha let f : GridCode M → ℝ := gridObjective alpha b e w let g : GridCode M → ℝ := gridObjective alpha b e w' by_cases hs : s.Nonempty · let a := choose (exists_min_image s f hs) let a' := choose (exists_min_image s g hs) have ha : a = a' := grid_min_choose_congr s hs f g h let sf := s.filter (fun c => f c = f a) let sg := s.filter (fun c => g c = g a') have hsg : sf = sg := by apply Finset.ext intro c simp only [sf, sg, mem_filter, ha, le_antisymm_iff, f, g, h] unfold selectGridCode dsimp only rw [dif_pos hs, dif_pos hs] change (if hm : sf.Nonempty then choose (exists_min_image sf gridLexCode hm) else a) = (if hm : sg.Nonempty then choose (exists_min_image sg gridLexCode hm) else a') have hsf : sf.Nonempty := by refine ⟨a, Finset.mem_filter.mpr ⟨?_, rfl⟩⟩ exact (Classical.choose_spec (exists_min_image s f hs)).1 have hsg' : sg.Nonempty := hsg ▸ hsf rw [dif_pos hsf, dif_pos hsg'] congr 1 funext c rw [hsg] · unfold selectGridCode dsimp only rw [dif_neg hs, dif_neg hs]
CausalSmith.Stat.PomdpBinaryhiddenRate.selectGridCode_order_congr · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/GridAdmissibility.lean:209
theorem selectGridCode_measurable Lemma selectGridCode_measurable in the paper ↗

Finite measurable comparisons give a selected code satisfying the measurability conclusion.

Formal statement
T M :
alpha :
ℝ
b e :
Measurable (fun w : ObsView T 2 => selectGridCode (M := M) alpha b e w)
Proof (Lean source)
-- @node: selectGridCode_measurable @[fun_prop] lemma selectGridCode_measurable {T M : Nat} (alpha : ℝ) (b e : Policy 2) : Measurable (fun w : ObsView T 2 => selectGridCode (M := M) alpha b e w) := by classical let table : ObsView T 2 → (GridCode M × GridCode M → Bool) := fun w cd => decide (gridObjective alpha b e w cd.1 ≤ gridObjective alpha b e w cd.2) have htable : Measurable table := by apply measurable_pi_lambda intro cd apply measurable_to_bool simpa only [table, preimage, Set.mem_singleton_iff, decide_eq_true_eq] using measurableSet_le (gridObjective_measurable alpha b e cd.1) (gridObjective_measurable alpha b e cd.2) let decode : (GridCode M × GridCode M → Bool) → GridCode M := fun q => if hq : ∃ w, table w = q then selectGridCode alpha b e (choose hq) else default have hdecode : Measurable decode := measurable_of_finite _ have hfactor : (fun w : ObsView T 2 => selectGridCode (M := M) alpha b e w) = decode ∘ table := by funext w dsimp only [Function.comp_def, decode] rw [dif_pos (show ∃ w', table w' = table w from ⟨w, rfl⟩)] apply selectGridCode_order_congr intro c d have hq := Classical.choose_spec (show ∃ w', table w' = table w from ⟨w, rfl⟩) have hcd := congrFun hq (c, d) simpa only [table, decide_eq_decide] using hcd.symm rw [hfactor] exact hdecode.comp htable
CausalSmith.Stat.PomdpBinaryhiddenRate.selectGridCode_measurable · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/GridAdmissibility.lean:250
theorem stableGridEstimator_measurable

Composing the selected code with its stationary reward satisfies the measurability conclusion.

Formal statement
T :
t0 :
ℝ
b e :
Proof (Lean source)
-- @node: stableGridEstimator_measurable @[fun_prop] lemma stableGridEstimator_measurable (T : Nat) (t0 : ℝ) (b e : Policy 2) : Measurable (stableGridEstimator T t0 b e) := by let value : GridCode (gridSize T (mixingAlpha t0)) → ℝ := fun c => ∑ s : Fin 4, stationaryLaw (stabilizedGridMatrix (mixingAlpha t0) c) s * gridReward c s exact (measurable_of_finite value).comp (selectGridCode_measurable (mixingAlpha t0) b e)
CausalSmith.Stat.PomdpBinaryhiddenRate.stableGridEstimator_measurable · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/GridAdmissibility.lean:283
theorem stableGridEstimator_admissible

The finite-grid construction gives a unit-interval-valued measurable procedure for every supplied pair of policies in the theorem's regime. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
t0 :
ℝ
ht0 :
0 < t0
hT :
12 ≤ T
conclusion 1
b e w :
stableGridEstimator T t0 b e w ∈ Icc (0 : ℝ) 1
conclusion 2
b e :
Proof (Lean source)
-- @node: stableGridEstimator_admissible lemma stableGridEstimator_admissible (T : Nat) (t0 : ℝ) (ht0 : 0 < t0) (hT : 12 ≤ T) : (∀ b e w, stableGridEstimator T t0 b e w ∈ Icc (0 : ℝ) 1) ∧ (∀ b e, Measurable (stableGridEstimator T t0 b e)) := by exact ⟨stableGridEstimator_range T t0 ht0 hT, stableGridEstimator_measurable T t0⟩
CausalSmith.Stat.PomdpBinaryhiddenRate.stableGridEstimator_admissible · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/GridAdmissibility.lean:293
CausalSmith.Stat.STAT_PomdpBinaryhiddenRate_Research.Helpers.GridApprox 4 declarations Round the four-state initial distribution, transition rows, and reward vector onto the rational simplex grid and mix with the uniform reset kernel.

Finite stable-grid approximation

Round the four-state initial distribution, transition rows, and reward vector onto the rational simplex grid and mix with the uniform reset kernel.

theorem grid_candidate_moment_approximation Lemma grid_candidate_moment_approximation in the paper ↗

Simplex rounding supplies an enumerated stable candidate with the telescoping error. Under the listed formal conditions, the stated conclusion holds.

Formal statement
M :
hM :
0 < M
alpha :
ℝ
hα :
0 < alpha
p r :
Fin 4 → ℝ
P :
Matrix (Fin 4) (Fin 4) ℝ
hr :
∀ i, r i ∈ Icc (0 : ℝ) 1
hc :
ContractsL1 P alpha
∃ c ∈ gridCandidates M alpha,
∀ k : Nat,
|(∑ i, (vecMul p (P ^ k)) i * r i)
- ∑ i, (vecMul (gridNu c) ((stabilizedGridMatrix alpha c) ^ k)) i * gridReward c i|
≤ (4 + (k : ℝ) * (3 + 6 / alpha)) / M
Proof (Lean source)
-- @node: grid_candidate_moment_approximation lemma grid_candidate_moment_approximation {M : Nat} (hM : 0 < M) {alpha : ℝ} (hα : 0 < alpha) (p r : Fin 4 → ℝ) (P : Matrix (Fin 4) (Fin 4) ℝ) (hp : IsProbabilityVector p) (hP : IsStochasticMatrix P) (hr : ∀ i, r i ∈ Icc (0 : ℝ) 1) (hc : ContractsL1 P alpha) : ∃ c ∈ gridCandidates M alpha, ∀ k : Nat, |(∑ i, (vecMul p (P ^ k)) i * r i) - ∑ i, (vecMul (gridNu c) ((stabilizedGridMatrix alpha c) ^ k)) i * gridReward c i| ≤ (4 + (k : ℝ) * (3 + 6 / alpha)) / M := by classical have hMr : (0 : ℝ) < M := by exact_mod_cast hM obtain ⟨nu, hnu, hnuerr⟩ := simplex_grid_rounding hM p hp have hrows : ∀ i, ∃ u ∈ simplexGrid M, (1 / 2 : ℝ) * ∑ j, |P i j - (u j).val / (M : ℝ)| ≤ 3 / M := by intro i exact simplex_grid_rounding hM (P i) ⟨hP.1 i, hP.2 i⟩ choose R hR hRerr using hrows have hrew : ∀ i, ∃ u : Fin (M + 1), 0 ≤ r i - (u.val : ℝ) / M ∧ r i - (u.val : ℝ) / M ≤ (M : ℝ)⁻¹ := by intro i exact reward_grid_rounding hM (hr i) choose rr hrr using hrew let c : GridCode M := (nu, R, rr) have hdecoded : IsStochasticMatrix (gridR c) := by constructor · intro i j; exact div_nonneg (Nat.cast_nonneg _) hMr.le · intro i have hsum : (∑ j : Fin 4, ((R i j).val : ℝ)) = M := by exact_mod_cast (Finset.mem_filter.mp (hR i)).2 change (∑ j : Fin 4, ((R i j).val : ℝ) / M) = 1 rw [← Finset.sum_div, hsum, div_self hMr.ne'] have hν : IsProbabilityVector (gridNu c) := by constructor · intro i; exact div_nonneg (Nat.cast_nonneg _) hMr.le · have hsum : (∑ i : Fin 4, ((nu i).val : ℝ)) = M := by exact_mod_cast (Finset.mem_filter.mp hnu).2 change (∑ i : Fin 4, ((nu i).val : ℝ) / M) = 1 rw [← Finset.sum_div, hsum, div_self hMr.ne'] have hmem : c ∈ gridCandidates M alpha := by apply Finset.mem_filter.mpr constructor · apply Finset.mem_biUnion.mpr refine ⟨nu, hnu, Finset.mem_biUnion.mpr ⟨R, ?_, ?_⟩⟩ · apply Finset.mem_image.mpr refine ⟨fun i _ => R i, ?_, rfl⟩ exact Finset.mem_pi.mpr (fun i _ => hR i) · exact Finset.mem_image.mpr ⟨rr, Finset.mem_univ _, rfl⟩ · have hh := gridDobrushin_perturbation P (gridR c) hRerr have hd := contractsL1_gridDobrushin P hα.le hc linear_combination hh + hd have hstable := stabilizedGridMatrix_row_error hM hα c hdecoded have htransition (i : Fin 4) : (1 / 2 : ℝ) * ∑ j, |P i j - stabilizedGridMatrix alpha c i j| ≤ (3 + 6 / alpha) / M := by have htri := row_tv_triangle (P i) (gridR c i) (stabilizedGridMatrix alpha c i) have hh := add_le_add (hRerr i) (hstable.2 i) calc _ ≤ 3 / (M : ℝ) + 6 / (alpha * M) := htri.trans hh _ = _ := by ring have hreward (i : Fin 4) : |r i - gridReward c i| ≤ (M : ℝ)⁻¹ := by exact (abs_of_nonneg (hrr i).1).le.trans (hrr i).2 refine ⟨c, hmem, ?_⟩ intro k have hh := stochastic_moment_error hP hstable.1 hp hν hr hnuerr htransition hreward k calc _ ≤ 3 / (M : ℝ) + (k : ℝ) * ((3 + 6 / alpha) / M) + (M : ℝ)⁻¹ := hh _ = _ := by ring
CausalSmith.Stat.PomdpBinaryhiddenRate.grid_candidate_moment_approximation · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/GridApprox.lean:23

A finite relabeling preserves matrix-power moments. the stated conclusion holds.

Formal statement
e :
U ≃ S
p r :
S → ℝ
P :
Matrix S S ℝ
k :
(∑ i : U, (vecMul (p ∘ e) ((of fun i j => P (e i) (e j)) ^ k)) i * r (e i))
= ∑ i : S, (vecMul p (P ^ k)) i * r i
Proof (Lean source)
-- @node: matrix_moment_relabel lemma matrix_moment_relabel {S U : Type*} [Fintype S] [Fintype U] [DecidableEq S] [DecidableEq U] (e : U ≃ S) (p r : S → ℝ) (P : Matrix S S ℝ) (k : Nat) : (∑ i : U, (vecMul (p ∘ e) ((of fun i j => P (e i) (e j)) ^ k)) i * r (e i)) = ∑ i : S, (vecMul p (P ^ k)) i * r i := by have hpow : ((of fun i j => P (e i) (e j)) ^ k) = fun i j => (P ^ k) (e i) (e j) := by exact ((Matrix.reindexRingEquiv ℝ e.symm).map_pow P k).symm rw [hpow] have hvec (i : U) : vecMul (p ∘ e) (fun i j => (P ^ k) (e i) (e j)) i = vecMul p (P ^ k) (e i) := by exact e.sum_comp (fun j => p j * (P ^ k) j (e i)) simp_rw [hvec] exact e.sum_comp (fun i => (vecMul p (P ^ k)) i * r i)
CausalSmith.Stat.PomdpBinaryhiddenRate.matrix_moment_relabel · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/GridApprox.lean:92

Relabeling a finite state space preserves contraction of probability vectors. Under the listed formal conditions, the stated conclusion holds.

Formal statement
S U :
e :
U ≃ S
P :
Matrix S S ℝ
alpha :
ℝ
hc :
ContractsL1 P alpha
ContractsL1 (of fun i j => P (e i) (e j)) alpha
Proof (Lean source)
-- @node: contractsL1_relabel lemma contractsL1_relabel {S U : Type*} [Fintype S] [Fintype U] (e : U ≃ S) (P : Matrix S S ℝ) {alpha : ℝ} (hc : ContractsL1 P alpha) : ContractsL1 (of fun i j => P (e i) (e j)) alpha := by intro p q hp hq have hprob (v : U → ℝ) (hv : IsProbabilityVector v) : IsProbabilityVector (v ∘ e.symm) := ⟨fun i => hv.1 _, (e.symm.sum_comp v).trans hv.2⟩ have hstep (v : U → ℝ) (i : U) : markovStep (v ∘ e.symm) P (e i) = markovStep v (of fun i j => P (e i) (e j)) i := by symm simpa only [markovStep, vecMul, dotProduct, Function.comp_apply, Equiv.symm_apply_apply, Matrix.of_apply] using e.sum_comp (fun j => v (e.symm j) * P j (e i)) have hdist (v w : U → ℝ) : l1Distance (v ∘ e.symm) (w ∘ e.symm) = l1Distance v w := e.symm.sum_comp (fun i => |v i - w i|) have hh := hc (p ∘ e.symm) (q ∘ e.symm) (hprob p hp) (hprob q hq) rw [hdist] at hh have hl : l1Distance (markovStep (p ∘ e.symm) P) (markovStep (q ∘ e.symm) P) = l1Distance (markovStep p (of fun i j => P (e i) (e j))) (markovStep q (of fun i j => P (e i) (e j))) := by unfold l1Distance rw [← e.sum_comp (fun i => |markovStep (p ∘ e.symm) P i - markovStep (q ∘ e.symm) P i|)] simp_rw [hstep] rw [hl] at hh exact hh
CausalSmith.Stat.PomdpBinaryhiddenRate.contractsL1_relabel · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/GridApprox.lean:110
theorem grid_approximation

A stable grid candidate approximates all seven target-policy moments. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
t0 zeta :
ℝ
hT :
12 ≤ T
M :
hM :
∀ k : Fin 7,
|(∑ s, (vecMul (stationaryLaw (policyKernel M M.b)) (fourMatrixPower (of (policyKernel M M.e)) k.val)) s * rewardRegression M s)
- (∑ s : Fin 4, (vecMul (gridNu c) ((stabilizedGridMatrix (mixingAlpha t0) c) ^ k.val)) s * gridReward c s)|
≤ (T : ℝ)⁻¹
Proof (Lean source)
-- @node: grid_approximation lemma grid_approximation {T : Nat} {t0 zeta : ℝ} (hT : 12 ≤ T) (M : RawPomdpExperiment T 2 2) (hM : BinaryPomdpClass t0 zeta M) : ∃ c ∈ gridCandidates (gridSize T (mixingAlpha t0)) (mixingAlpha t0), ∀ k : Fin 7, |(∑ s, (vecMul (stationaryLaw (policyKernel M M.b)) (fourMatrixPower (of (policyKernel M M.e)) k.val)) s * rewardRegression M s) - (∑ s : Fin 4, (vecMul (gridNu c) ((stabilizedGridMatrix (mixingAlpha t0) c) ^ k.val)) s * gridReward c s)| ≤ (T : ℝ)⁻¹ := by classical let alpha := mixingAlpha t0 let N := gridSize T alpha let e : Fin 4 ≃ JointState 2 2 := (finProdFinEquiv : Fin 2 × Fin 2 ≃ Fin (2 * 2)).symm let d := stationaryLaw (policyKernel M M.b) let r := rewardRegression M let P : FourMatrix := of (policyKernel M M.e) let R : Matrix (Fin 4) (Fin 4) ℝ := of fun i j => P (e i) (e j) have hα : 0 < alpha := Real.exp_pos _ have hTr : (0 : ℝ) < T := by exact_mod_cast (show 0 < T by omega) have hN : 0 < N := by apply Nat.ceil_pos.mpr change 0 < (22 + 36 / alpha) * T positivity have hd : IsProbabilityVector d := hM.stationary_start.1.1 have hde : IsProbabilityVector (d ∘ e) := ⟨fun i => hd.1 _, (e.sum_comp d).trans hd.2⟩ have hP := policyKernel_stochastic_of_kernelLaw M hM.pomdp_kernel M.e hM.policy_overlap.1 have hR : IsStochasticMatrix R := by refine ⟨fun i j => hP.1 _ _, ?_⟩ intro i exact (e.sum_comp (fun j => P (e i) j)).trans (hP.2 (e i)) have hr : ∀ i, r i ∈ Icc (0 : ℝ) 1 := rewardRegression_unit M hM.pomdp_kernel hM.policy_overlap.1 have hc : ContractsL1 R alpha := contractsL1_relabel e P hM.target_contraction obtain ⟨c, hc, herr⟩ := grid_candidate_moment_approximation hN hα (d ∘ e) (r ∘ e) R hde hR (fun i => hr (e i)) hc refine ⟨c, hc, ?_⟩ intro k have hmoment := matrix_moment_relabel e d r P k.val have hh := herr k.val change |(∑ i, (vecMul (d ∘ e) (R ^ k.val)) i * r (e i)) - _| ≤ _ at hh rw [hmoment] at hh change |(∑ s, (vecMul d (P ^ k.val)) s * r s) - _| ≤ _ apply hh.trans have hk : (k.val : ℝ) ≤ 6 := by exact_mod_cast (show k.val ≤ 6 by omega) have hcoef : 4 + (k.val : ℝ) * (3 + 6 / alpha) ≤ 22 + 36 / alpha := by have h := mul_le_mul_of_nonneg_right hk (by positivity : 0 ≤ 3 + 6 / alpha) linear_combination h have hceil : (22 + 36 / alpha) * T ≤ (N : ℝ) := Nat.le_ceil _ have hNr : (0 : ℝ) < N := by exact_mod_cast hN calc (4 + (k.val : ℝ) * (3 + 6 / alpha)) / N ≤ (22 + 36 / alpha) / N := div_le_div_of_nonneg_right hcoef hNr.le _ ≤ (T : ℝ)⁻¹ := by rw [← one_div] apply (div_le_div_iff₀ hNr hTr).mpr simpa using hceil
CausalSmith.Stat.PomdpBinaryhiddenRate.grid_approximation · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/GridApprox.lean:140
CausalSmith.Stat.STAT_PomdpBinaryhiddenRate_Research.Helpers.GridFit 4 declarations Lexicographic tie breaking preserves the minimum empirical residual.

Error transfer for the finite stable-grid fit

Lexicographic tie breaking preserves the minimum empirical residual. A candidate that approximates the seven population moments then bounds the selected fit's population discrepancy by twice the sampling error plus the grid error.

The scalar moment represented by a decoded stable grid candidate.

Definition (Lean source)
M :
alpha :
ℝ
c :
k :
gridCodeMoment alpha c k :
ℝ
∑ s : Fin 4, (vecMul (gridNu c) ((stabilizedGridMatrix alpha c) ^ k)) s * gridReward c s
CausalSmith.Stat.PomdpBinaryhiddenRate.gridCodeMoment · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/GridFit.lean:20
theorem selectGridCode_objective_le Lemma selectGridCode_objective_le in the paper ↗

The lexicographic tie break selects a candidate with minimum empirical residual. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T M :
alpha :
ℝ
hα :
0 ≤ alpha
b e :
w :
c :
hc :
c ∈ gridCandidates M alpha
gridObjective alpha b e w (selectGridCode (M := M) alpha b e w)
≤ gridObjective alpha b e w c
Proof (Lean source)
-- @node: selectGridCode_objective_le lemma selectGridCode_objective_le {T M : Nat} (alpha : ℝ) (hα : 0 ≤ alpha) (b e : Policy 2) (w : ObsView T 2) {c : GridCode M} (hc : c ∈ gridCandidates M alpha) : gridObjective alpha b e w (selectGridCode (M := M) alpha b e w) ≤ gridObjective alpha b e w c := by classical unfold selectGridCode rw [dif_pos (gridCandidates_nonempty M alpha hα)] dsimp only split_ifs with hm · have htie := (Finset.mem_filter.mp (Classical.choose_spec (exists_min_image _ gridLexCode hm)).1).2 rw [htie] exact (Classical.choose_spec (exists_min_image _ _ (gridCandidates_nonempty M alpha hα))).2 c hc · exact (Classical.choose_spec (exists_min_image _ _ (gridCandidates_nonempty M alpha hα))).2 c hc
CausalSmith.Stat.PomdpBinaryhiddenRate.selectGridCode_objective_le · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/GridFit.lean:26
theorem selected_grid_moment_error

An approximating candidate transfers the empirical maximum error to the selected realization's population moments. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T M :
alpha :
ℝ
hα :
0 ≤ alpha
b e :
w :
m :
Fin 7 → ℝ
eta :
ℝ
c :
hc :
c ∈ gridCandidates M alpha
happrox :
∀ k : Fin 7, |m k - gridCodeMoment alpha c k.val| ≤ eta
(⨆ k : Fin 7, |gridCodeMoment alpha (selectGridCode (M := M) alpha b e w) k.val - m k|)
≤ 2 * (⨆ k : Fin 7, |empiricalMoment k.val b e w - m k|) + eta
Proof (Lean source)
-- @node: selected_grid_moment_error lemma selected_grid_moment_error {T M : Nat} (alpha : ℝ) (hα : 0 ≤ alpha) (b e : Policy 2) (w : ObsView T 2) (m : Fin 7 → ℝ) (eta : ℝ) {c : GridCode M} (hc : c ∈ gridCandidates M alpha) (happrox : ∀ k : Fin 7, |m k - gridCodeMoment alpha c k.val| ≤ eta) : (⨆ k : Fin 7, |gridCodeMoment alpha (selectGridCode (M := M) alpha b e w) k.val - m k|) ≤ 2 * (⨆ k : Fin 7, |empiricalMoment k.val b e w - m k|) + eta := by let eps := ⨆ k : Fin 7, |empiricalMoment k.val b e w - m k| have heps (k : Fin 7) : |empiricalMoment k.val b e w - m k| ≤ eps := by dsimp only [eps] exact le_ciSup (f := fun j : Fin 7 => |empiricalMoment j.val b e w - m j|) (Set.finite_range _).bddAbove k have hcobj : gridObjective alpha b e w c ≤ eps + eta := by apply ciSup_le intro k exact (abs_sub_le _ (m k) _).trans (add_le_add (heps k) (happrox k)) have hfit := (selectGridCode_objective_le alpha hα b e w hc).trans hcobj apply ciSup_le intro k have hres : |empiricalMoment k.val b e w - gridCodeMoment alpha (selectGridCode (M := M) alpha b e w) k.val| ≤ gridObjective alpha b e w (selectGridCode (M := M) alpha b e w) := by unfold gridObjective exact le_ciSup (f := fun j : Fin 7 => |empiricalMoment j.val b e w - gridCodeMoment alpha (selectGridCode (M := M) alpha b e w) j.val|) (Set.finite_range _).bddAbove k calc _ ≤ |gridCodeMoment alpha (selectGridCode (M := M) alpha b e w) k.val - empiricalMoment k.val b e w| + |empiricalMoment k.val b e w - m k| := abs_sub_le _ _ _ _ ≤ (eps + eta) + eps := by rw [abs_sub_comm (gridCodeMoment alpha _ k.val)] exact add_le_add (hres.trans hfit) (heps k) _ = _ := by dsimp only [eps]; ring
CausalSmith.Stat.PomdpBinaryhiddenRate.selected_grid_moment_error · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/GridFit.lean:46
theorem selected_grid_intervention_moment_error

Equation (15) of the upper-bound proof: the actual selected candidate fits all seven target-policy moments within twice their sampling error plus T⁻¹. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
t0 zeta :
ℝ
hT :
12 ≤ T
M :
hM :
w :
m :
fun k : Fin 7
(⨆ k : Fin 7, |gridCodeMoment (mixingAlpha t0) (selectGridCode (M := gridSize T (mixingAlpha t0)) (mixingAlpha t0) M.b M.e w) k.val - m k|)
≤ 2 * (⨆ k : Fin 7, |empiricalMoment k.val M.b M.e w - m k|) + (T : ℝ)⁻¹
Proof (Lean source)
-- @node: selected_grid_intervention_moment_error lemma selected_grid_intervention_moment_error {T : Nat} {t0 zeta : ℝ} (hT : 12 ≤ T) (M : RawPomdpExperiment T 2 2) (hM : BinaryPomdpClass t0 zeta M) (w : ObsView T 2) : let m := fun k : Fin 7 => matrixMoment (stationaryLaw (policyKernel M M.b)) (of (policyKernel M M.e)) (rewardRegression M) k.val (⨆ k : Fin 7, |gridCodeMoment (mixingAlpha t0) (selectGridCode (M := gridSize T (mixingAlpha t0)) (mixingAlpha t0) M.b M.e w) k.val - m k|) ≤ 2 * (⨆ k : Fin 7, |empiricalMoment k.val M.b M.e w - m k|) + (T : ℝ)⁻¹ := by obtain ⟨c, hc, herr⟩ := grid_approximation hT M hM apply selected_grid_moment_error (mixingAlpha t0) (Real.exp_nonneg _) M.b M.e w _ (T : ℝ)⁻¹ hc simpa only [matrixMoment, fourMatrixPower, gridCodeMoment] using herr
CausalSmith.Stat.PomdpBinaryhiddenRate.selected_grid_intervention_moment_error · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/GridFit.lean:84
CausalSmith.Stat.STAT_PomdpBinaryhiddenRate_Research.Helpers.GridRounding 2 declarations Floor the first three simplex coordinates and assign their discarded mass to the fourth coordinate.

Four-state simplex rounding

Floor the first three simplex coordinates and assign their discarded mass to the fourth coordinate. The decoded row has total-variation error at most 3/M.

Flooring a unit-interval reward gives a grid coordinate with error at most 1/M. Under the listed formal conditions, the stated conclusion holds.

Formal statement
M :
hM :
0 < M
x :
ℝ
hx :
x ∈ Icc (0 : ℝ) 1
∃ u : Fin (M + 1),
conclusion 1
0 ≤ x - (u.val : ℝ) / M
conclusion 2
x - (u.val : ℝ) / M ≤ (M : ℝ)⁻¹
Proof (Lean source)
-- @node: reward_grid_rounding lemma reward_grid_rounding {M : Nat} (hM : 0 < M) {x : ℝ} (hx : x ∈ Icc (0 : ℝ) 1) : ∃ u : Fin (M + 1), 0 ≤ x - (u.val : ℝ) / M ∧ x - (u.val : ℝ) / M ≤ (M : ℝ)⁻¹ := by have hMr : (0 : ℝ) < M := by exact_mod_cast hM have hfloor : Nat.floor ((M : ℝ) * x) ≤ M := Nat.floor_le_of_le (by nlinarith [hx.2]) refine ⟨⟨Nat.floor ((M : ℝ) * x), by omega⟩, ?_, ?_⟩ · have hf := Nat.floor_le (mul_nonneg hMr.le hx.1) dsimp only exact sub_nonneg.mpr ((div_le_iff₀ hMr).mpr (by nlinarith)) · have hf := Nat.lt_floor_add_one ((M : ℝ) * x) dsimp only rw [← one_div] apply (le_div_iff₀ hMr).mpr have he : (x - (Nat.floor ((M : ℝ) * x) : ℝ) / M) * M = x * M - Nat.floor ((M : ℝ) * x) := by field_simp rw [he] linarith
CausalSmith.Stat.PomdpBinaryhiddenRate.reward_grid_rounding · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/GridRounding.lean:18

Rounding three coordinates down and using a residual fourth coordinate preserves the simplex, with total-variation error at most 3/M. Under the listed formal conditions, the stated conclusion holds.

Formal statement
M :
hM :
0 < M
p :
Fin 4 → ℝ
∃ u ∈ simplexGrid M, (1 / 2 : ℝ) * ∑ i : Fin 4, |p i - (u i).val / (M : ℝ)| ≤ 3 / M
Proof (Lean source)
-- @node: simplex_grid_rounding lemma simplex_grid_rounding {M : Nat} (hM : 0 < M) (p : Fin 4 → ℝ) (hp : IsProbabilityVector p) : ∃ u ∈ simplexGrid M, (1 / 2 : ℝ) * ∑ i : Fin 4, |p i - (u i).val / (M : ℝ)| ≤ 3 / M := by classical have hMr : (0 : ℝ) < M := by exact_mod_cast hM have hsum : p 0 + p 1 + p 2 + p 3 = 1 := by simpa [Fin.sum_univ_succ, add_assoc] using hp.2 have hunit (i : Fin 4) : p i ∈ Icc (0 : ℝ) 1 := by refine ⟨hp.1 i, ?_⟩ calc p i ≤ ∑ j : Fin 4, p j := Finset.single_le_sum (fun j _ => hp.1 j) (Finset.mem_univ i) _ = 1 := hp.2 obtain ⟨u0, h0, e0⟩ := reward_grid_rounding hM (hunit 0) obtain ⟨u1, h1, e1⟩ := reward_grid_rounding hM (hunit 1) obtain ⟨u2, h2, e2⟩ := reward_grid_rounding hM (hunit 2) have hcount : u0.val + u1.val + u2.val ≤ M := by have hdiv : ((u0.val + u1.val + u2.val : Nat) : ℝ) / M ≤ 1 := by simp only [Nat.cast_add, add_div] linarith [hp.1 3] exact_mod_cast (div_le_one hMr).mp hdiv let u3 : Fin (M + 1) := ⟨M - (u0.val + u1.val + u2.val), by omega⟩ let u : Fin 4 → Fin (M + 1) := ![u0, u1, u2, u3] have hu : u ∈ simplexGrid M := by simp only [simplexGrid, mem_filter, Finset.mem_univ, true_and, IsGridRow] simp [u, u3, Fin.sum_univ_succ] omega have hres : p 3 - (u3.val : ℝ) / M = -((p 0 - (u0.val : ℝ) / M) + (p 1 - (u1.val : ℝ) / M) + (p 2 - (u2.val : ℝ) / M)) := by dsimp [u3] rw [Nat.cast_sub hcount] simp only [Nat.cast_add] field_simp nlinarith [hsum] refine ⟨u, hu, ?_⟩ simp [Fin.sum_univ_succ, u] rw [abs_of_nonneg h0, abs_of_nonneg h1, abs_of_nonneg h2, hres, abs_neg, abs_of_nonneg (by linarith : 0 ≤ (p 0 - (u0.val : ℝ) / M) + (p 1 - (u1.val : ℝ) / M) + (p 2 - (u2.val : ℝ) / M))] rw [← one_div] at e0 e1 e2 linear_combination e0 + e1 + e2
CausalSmith.Stat.PomdpBinaryhiddenRate.simplex_grid_rounding · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/GridRounding.lean:40
CausalSmith.Stat.STAT_PomdpBinaryhiddenRate_Research.Helpers.GridStability 4 declarations Row-wise rounding preserves the Dobrushin filter.

Stability and error of rounded grid kernels

Row-wise rounding preserves the Dobrushin filter. Mixing with the uniform kernel enforces contraction and costs at most 6/(alpha M) in row TV.

theorem contractsL1_gridDobrushin Lemma contractsL1_gridDobrushin in the paper ↗

Contraction of probability vectors bounds every pair of point-mass rows. Under the listed formal conditions, the stated conclusion holds.

Formal statement
P :
Matrix (Fin 4) (Fin 4) ℝ
alpha :
ℝ
hα :
0 ≤ alpha
hc :
ContractsL1 P alpha
gridDobrushin P ≤ alpha
Proof (Lean source)
-- @node: contractsL1_gridDobrushin lemma contractsL1_gridDobrushin (P : Matrix (Fin 4) (Fin 4) ℝ) {alpha : ℝ} (hα : 0 ≤ alpha) (hc : ContractsL1 P alpha) : gridDobrushin P ≤ alpha := by classical let d (i : Fin 4) : Fin 4 → ℝ := fun s => if s = i then 1 else 0 have hd (i : Fin 4) : IsProbabilityVector (d i) := by constructor · intro s; dsimp [d]; split_ifs <;> norm_num · simp [d] have hstep (i : Fin 4) : markovStep (d i) P = P i := by ext s simp [markovStep, vecMul, dotProduct, d] have hdist (i j : Fin 4) : l1Distance (d i) (d j) ≤ 2 := by unfold l1Distance calc _ ≤ ∑ s, (|d i s| + |d j s|) := Finset.sum_le_sum (fun s _ => abs_sub _ _) _ = 2 := by simp_rw [abs_of_nonneg ((hd i).1 _), abs_of_nonneg ((hd j).1 _)] rw [Finset.sum_add_distrib, (hd i).2, (hd j).2] norm_num apply ciSup_le intro i apply ciSup_le intro j have hh := hc (d i) (d j) (hd i) (hd j) rw [hstep, hstep] at hh have he := mul_le_mul_of_nonneg_left (hdist i j) hα unfold l1Distance at hh he linarith
CausalSmith.Stat.PomdpBinaryhiddenRate.contractsL1_gridDobrushin · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/GridStability.lean:19

TV obeys the triangle inequality between finite row vectors. the stated conclusion holds.

Formal statement
S :
Type*
p q r :
S → ℝ
(1 / 2 : ℝ) * ∑ i, |p i - r i|
≤ (1 / 2 : ℝ) * ∑ i, |p i - q i| + (1 / 2 : ℝ) * ∑ i, |q i - r i|
Proof (Lean source)
-- @node: row_tv_triangle lemma row_tv_triangle {S : Type*} [Fintype S] (p q r : S → ℝ) : (1 / 2 : ℝ) * ∑ i, |p i - r i| ≤ (1 / 2 : ℝ) * ∑ i, |p i - q i| + (1 / 2 : ℝ) * ∑ i, |q i - r i| := by have h := Finset.sum_le_sum (s := univ) (fun i _ => abs_sub_le (p i) (q i) (r i)) rw [Finset.sum_add_distrib] at h linarith
CausalSmith.Stat.PomdpBinaryhiddenRate.row_tv_triangle · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/GridStability.lean:51
theorem gridDobrushin_perturbation Lemma gridDobrushin_perturbation in the paper ↗

Row-wise TV approximation perturbs the Dobrushin coefficient by twice its error. Under the listed formal conditions, the stated conclusion holds.

Formal statement
P R :
Matrix (Fin 4) (Fin 4) ℝ
ε :
ℝ
hPR :
∀ i, (1 / 2 : ℝ) * ∑ j, |P i j - R i j| ≤ ε
gridDobrushin R ≤ gridDobrushin P + 2 * ε
Proof (Lean source)
-- @node: gridDobrushin_perturbation lemma gridDobrushin_perturbation (P R : Matrix (Fin 4) (Fin 4) ℝ) {ε : ℝ} (hPR : ∀ i, (1 / 2 : ℝ) * ∑ j, |P i j - R i j| ≤ ε) : gridDobrushin R ≤ gridDobrushin P + 2 * ε := by apply ciSup_le intro i apply ciSup_le intro j have hij : (1 / 2 : ℝ) * ∑ s, |P i s - P j s| ≤ gridDobrushin P := (le_ciSup (f := fun j : Fin 4 => (1 / 2 : ℝ) * ∑ s, |P i s - P j s|) (Set.finite_range _).bddAbove j).trans (le_ciSup (f := fun i : Fin 4 => ⨆ j : Fin 4, (1 / 2 : ℝ) * ∑ s, |P i s - P j s|) (Set.finite_range _).bddAbove i) have hi := hPR i have hj := hPR j have h1 := row_tv_triangle (R i) (P i) (R j) have h2 := row_tv_triangle (P i) (P j) (R j) have hsym : (∑ s, |R i s - P i s|) = ∑ s, |P i s - R i s| := by simp_rw [abs_sub_comm] rw [hsym] at h1 linarith
CausalSmith.Stat.PomdpBinaryhiddenRate.gridDobrushin_perturbation · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/GridStability.lean:60
theorem stabilizedGridMatrix_row_error Lemma stabilizedGridMatrix_row_error in the paper ↗

Uniform-reset stabilization preserves stochasticity and has the required row error. Under the listed formal conditions, the stated conclusion holds.

Formal statement
M :
hM :
0 < M
alpha :
ℝ
hα :
0 < alpha
c :
conclusion 2
i :
(1 / 2 : ℝ) * ∑ j, |gridR c i j - stabilizedGridMatrix alpha c i j| ≤ 6 / (alpha * M)
Proof (Lean source)
-- @node: stabilizedGridMatrix_row_error lemma stabilizedGridMatrix_row_error {M : Nat} (hM : 0 < M) {alpha : ℝ} (hα : 0 < alpha) (c : GridCode M) (hR : IsStochasticMatrix (gridR c)) : IsStochasticMatrix (stabilizedGridMatrix alpha c) ∧ ∀ i, (1 / 2 : ℝ) * ∑ j, |gridR c i j - stabilizedGridMatrix alpha c i j| ≤ 6 / (alpha * M) := by have hMr : (0 : ℝ) < M := by exact_mod_cast hM let lam := alpha / (alpha + 6 / (M : ℝ)) have hden : 0 < alpha + 6 / (M : ℝ) := by positivity have hlam0 : 0 ≤ lam := by dsimp [lam]; positivity have hlam1 : lam ≤ 1 := by exact (div_le_one hden).mpr (le_add_of_nonneg_right (by positivity)) have hmass : 1 - lam ≤ 6 / (alpha * M) := by calc 1 - lam = (6 / (M : ℝ)) / (alpha + 6 / (M : ℝ)) := by dsimp [lam] field_simp ring _ ≤ (6 / (M : ℝ)) / alpha := div_le_div_of_nonneg_left (by positivity) hα (le_add_of_nonneg_right (by positivity)) _ = _ := by ring refine ⟨?_, ?_⟩ · constructor · intro i j change 0 ≤ lam * gridR c i j + (1 - lam) / 4 exact add_nonneg (mul_nonneg hlam0 (hR.1 i j)) (by positivity) · intro i change (∑ j : Fin 4, (lam * gridR c i j + (1 - lam) / 4)) = 1 rw [Finset.sum_add_distrib, ← Finset.mul_sum, hR.2 i] simp ring · intro i have hunit : IsProbabilityVector (fun _ : Fin 4 => (1 / 4 : ℝ)) := ⟨by intro j; norm_num, by norm_num⟩ have htv : (1 / 2 : ℝ) * ∑ j : Fin 4, |gridR c i j - 1 / 4| ≤ 1 := by have h := Finset.sum_le_sum (s := univ) (fun j _ => abs_sub (gridR c i j) (1 / 4)) simp_rw [abs_of_nonneg (hR.1 i _)] at h norm_num only [abs_of_pos (by norm_num : (0 : ℝ) < 1 / 4)] at h rw [Finset.sum_add_distrib, hR.2 i] at h norm_num at h linarith calc _ = (1 - lam) * ((1 / 2 : ℝ) * ∑ j : Fin 4, |gridR c i j - 1 / 4|) := by change (1 / 2 : ℝ) * ∑ j : Fin 4, |gridR c i j - (lam * gridR c i j + (1 - lam) / 4)| = _ have he (j : Fin 4) : gridR c i j - (lam * gridR c i j + (1 - lam) / 4) = (1 - lam) * (gridR c i j - 1 / 4) := by ring simp_rw [he, abs_mul, abs_of_nonneg (sub_nonneg.mpr hlam1)] rw [← Finset.mul_sum] ring _ ≤ (1 - lam) * 1 := mul_le_mul_of_nonneg_left htv (sub_nonneg.mpr hlam1) _ ≤ _ := by simpa using hmass
CausalSmith.Stat.PomdpBinaryhiddenRate.stabilizedGridMatrix_row_error · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/GridStability.lean:83
CausalSmith.Stat.STAT_PomdpBinaryhiddenRate_Research.Helpers.GridValue 4 declarations Relabeling the four grid coordinates puts the selected realization on the joint-state carrier.

Stationary value transfer for the selected grid

Relabeling the four grid coordinates puts the selected realization on the joint-state carrier. The pair-polynomial modulus then gives equation (16).

The initial coordinates of an admissible positive-resolution code sum to one. Under the listed formal conditions, the stated conclusion holds.

Formal statement
N :
hN :
0 < N
a :
ℝ
c :
hc :
c ∈ gridCandidates N a
Proof (Lean source)
-- @node: gridNu_probability lemma gridNu_probability {N : Nat} (hN : 0 < N) {a : ℝ} {c : GridCode N} (hc : c ∈ gridCandidates N a) : IsProbabilityVector (gridNu c) := by classical obtain ⟨nu, hnu, R, hR, r, hr, heq⟩ := by simpa only [gridCandidateUniverse, Finset.mem_biUnion, mem_image] using (Finset.mem_filter.mp hc).1 cases heq constructor · intro i exact div_nonneg (Nat.cast_nonneg _) (Nat.cast_nonneg _) · simp only [gridNu, ← Finset.sum_div] have hsum : (∑ i : Fin 4, ((nu i).val : ℝ)) = N := by exact_mod_cast (Finset.mem_filter.mp hnu).2 rw [hsum, div_self (by positivity : (N : ℝ) ≠ 0)]
CausalSmith.Stat.PomdpBinaryhiddenRate.gridNu_probability · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/GridValue.lean:18
theorem stabilizedGridMatrix_dobrushin_le Lemma stabilizedGridMatrix_dobrushin_le in the paper ↗

The candidate filter and reset mixture enforce the specified contraction radius. Under the listed formal conditions, the stated conclusion holds.

Formal statement
N :
hN :
0 < N
a :
ℝ
ha :
0 < a
c :
hc :
c ∈ gridCandidates N a
Proof (Lean source)
-- @node: stabilizedGridMatrix_dobrushin_le lemma stabilizedGridMatrix_dobrushin_le {N : Nat} (hN : 0 < N) {a : ℝ} (ha : 0 < a) {c : GridCode N} (hc : c ∈ gridCandidates N a) : gridDobrushin (stabilizedGridMatrix a c) ≤ a := by let lam := a / (a + 6 / (N : ℝ)) have hden : 0 < a + 6 / (N : ℝ) := by positivity have hlam : 0 ≤ lam := by dsimp [lam]; positivity have hf := (Finset.mem_filter.mp hc).2 apply ciSup_le intro i apply ciSup_le intro j have hij : (1 / 2 : ℝ) * ∑ s, |gridR c i s - gridR c j s| ≤ gridDobrushin (gridR c) := (le_ciSup (f := fun j : Fin 4 => (1 / 2 : ℝ) * ∑ s, |gridR c i s - gridR c j s|) (Set.finite_range _).bddAbove j).trans (le_ciSup (f := fun i : Fin 4 => ⨆ j : Fin 4, (1 / 2 : ℝ) * ∑ s, |gridR c i s - gridR c j s|) (Set.finite_range _).bddAbove i) calc _ = lam * ((1 / 2 : ℝ) * ∑ s, |gridR c i s - gridR c j s|) := by have he (s : Fin 4) : stabilizedGridMatrix a c i s - stabilizedGridMatrix a c j s = lam * (gridR c i s - gridR c j s) := by dsimp [stabilizedGridMatrix, lam]; ring simp_rw [he, abs_mul, abs_of_nonneg hlam] rw [← Finset.mul_sum] ring _ ≤ lam * (a + 6 / (N : ℝ)) := mul_le_mul_of_nonneg_left (hij.trans hf) hlam _ = a := div_mul_cancel₀ a hden.ne'
CausalSmith.Stat.PomdpBinaryhiddenRate.stabilizedGridMatrix_dobrushin_le · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/GridValue.lean:35
theorem grid_value_modulus

Relabeling the grid coordinates allows direct use of the joint-state value modulus. Under the listed formal conditions, the stated conclusion holds.

Formal statement
N :
hN :
0 < N
a :
ℝ
ha :
0 < a
ha1 :
a < 1
c :
hc :
c ∈ gridCandidates N a
nu pi r :
JointState 2 2 → ℝ
hpi :
IsStationary P pi
hr :
∀ s, r s ∈ Icc (0 : ℝ) 1
hd :
dobrushin P ≤ a
|(∑ i : Fin 4, stationaryLaw (stabilizedGridMatrix a c) i * gridReward c i)
- matrixValue pi r|
≤ stabilityFactor a * (⨆ k : Fin 7, |gridCodeMoment a c k.val - matrixMoment nu P r k.val|)
Proof (Lean source)
-- @node: grid_value_modulus lemma grid_value_modulus {N : Nat} (hN : 0 < N) {a : ℝ} (ha : 0 < a) (ha1 : a < 1) {c : GridCode N} (hc : c ∈ gridCandidates N a) (P : FourMatrix) (nu pi r : JointState 2 2 → ℝ) (hP : IsStochasticMatrix P) (hnu : IsProbabilityVector nu) (hpi : IsStationary P pi) (hr : ∀ s, r s ∈ Icc (0 : ℝ) 1) (hd : dobrushin P ≤ a) : |(∑ i : Fin 4, stationaryLaw (stabilizedGridMatrix a c) i * gridReward c i) - matrixValue pi r| ≤ stabilityFactor a * (⨆ k : Fin 7, |gridCodeMoment a c k.val - matrixMoment nu P r k.val|) := by let e : JointState 2 2 ≃ Fin 4 := finProdFinEquiv let G := stabilizedGridMatrix a c let Q : FourMatrix := of fun i j => G (e i) (e j) let d := stationaryLaw G have hs := stabilizedGridMatrix_stationary hN ha hc have hg := (stabilizedGridMatrix_row_error hN ha c (gridR_stochastic hN hc)).1 have hQ : IsStochasticMatrix Q := by refine ⟨fun i j => hg.1 _ _, ?_⟩ intro i exact (e.sum_comp (fun j => G (e i) j)).trans (hg.2 _) have hprob (v : Fin 4 → ℝ) (hv : IsProbabilityVector v) : IsProbabilityVector (v ∘ e) := ⟨fun i => hv.1 _, (e.sum_comp v).trans hv.2⟩ have hstat : IsStationary Q (d ∘ e) := by refine ⟨hprob d hs.1, ?_⟩ funext i change (∑ j, d (e j) * G (e j) (e i)) = d (e i) exact (e.sum_comp (fun j => d j * G j (e i))).trans (congrFun hs.2 (e i)) have hreward : ∀ i, gridReward c i ∈ Icc (0 : ℝ) 1 := by intro i refine ⟨div_nonneg (Nat.cast_nonneg _) (Nat.cast_nonneg _), ?_⟩ apply (div_le_one (by exact_mod_cast hN : (0 : ℝ) < N)).mpr exact_mod_cast (le_of_lt_succ (c.2.2 i).isLt) have hdelta : dobrushin Q ≤ a := by apply ciSup_le intro i apply ciSup_le intro j change (1 / 2 : ℝ) * ∑ s, |G (e i) (e s) - G (e j) (e s)| ≤ a rw [e.sum_comp (fun s => |G (e i) s - G (e j) s|)] exact ((le_ciSup (f := fun j : Fin 4 => (1 / 2 : ℝ) * ∑ s, |G (e i) s - G j s|) (Set.finite_range _).bddAbove (e j)).trans (le_ciSup (f := fun i : Fin 4 => ⨆ j : Fin 4, (1 / 2 : ℝ) * ∑ s, |G i s - G j s|) (Set.finite_range _).bddAbove (e i))).trans (stabilizedGridMatrix_dobrushin_le hN ha hc) have hh := (pairPolynomial_value_modulus Q P (gridNu c ∘ e) nu (d ∘ e) pi (gridReward c ∘ e) r a ha ha1 hQ hP (hprob _ (gridNu_probability hN hc)) hnu hstat hpi (fun i => hreward (e i)) hr hdelta hd).2.2.2 have hvalue : matrixValue (d ∘ e) (gridReward c ∘ e) = ∑ i : Fin 4, d i * gridReward c i := by exact e.sum_comp (fun i => d i * gridReward c i) have hm (k : Nat) : matrixMoment (gridNu c ∘ e) Q (gridReward c ∘ e) k = gridCodeMoment a c k := matrix_moment_relabel e (gridNu c) (gridReward c) G k simpa only [hvalue, hm] using hh
CausalSmith.Stat.PomdpBinaryhiddenRate.grid_value_modulus · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/GridValue.lean:67
theorem stableGridEstimator_value_error

Equation (16): the selected stationary value inherits twice the empirical moment error. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
t0 zeta :
ℝ
hT :
12 ≤ T
M :
hM :
w :
|stableGridEstimator T t0 M.b M.e w - targetValue M|
≤ stabilityFactor (mixingAlpha t0) * (2 * (⨆ k : Fin 7, |empiricalMoment k.val M.b M.e w - matrixMoment (stationaryLaw (policyKernel M M.b)) (of (policyKernel M M.e)) (rewardRegression M) k.val|) + (T : ℝ)⁻¹)
Proof (Lean source)
-- @node: stableGridEstimator_value_error lemma stableGridEstimator_value_error {T : Nat} {t0 zeta : ℝ} (hT : 12 ≤ T) (M : RawPomdpExperiment T 2 2) (hM : BinaryPomdpClass t0 zeta M) (w : ObsView T 2) : |stableGridEstimator T t0 M.b M.e w - targetValue M| ≤ stabilityFactor (mixingAlpha t0) * (2 * (⨆ k : Fin 7, |empiricalMoment k.val M.b M.e w - matrixMoment (stationaryLaw (policyKernel M M.b)) (of (policyKernel M M.e)) (rewardRegression M) k.val|) + (T : ℝ)⁻¹) := by let a := mixingAlpha t0 have ha : 0 < a := Real.exp_pos _ have ha1 : a < 1 := by change mixingAlpha t0 < 1 rw [mixingAlpha, Real.exp_lt_one_iff] exact neg_neg_of_pos (one_div_pos.mpr hM.t0_pos) have hN : 0 < gridSize T a := by apply Nat.ceil_pos.mpr have hTr : (0 : ℝ) < T := by exact_mod_cast (show 0 < T by omega) change 0 < (22 + 36 / a) * T positivity let e : Fin 4 ≃ JointState 2 2 := (finProdFinEquiv : Fin 2 × Fin 2 ≃ Fin (2 * 2)).symm have hd : dobrushin (of (policyKernel M M.e)) ≤ a := by have hh := contractsL1_gridDobrushin (of fun i j => policyKernel M M.e (e i) (e j)) ha.le (contractsL1_relabel e _ hM.target_contraction) apply ciSup_le intro i apply ciSup_le intro j have heq := e.sum_comp (fun s => |policyKernel M M.e i s - policyKernel M M.e j s|) change (1 / 2 : ℝ) * ∑ s, |policyKernel M M.e i s - policyKernel M M.e j s| ≤ a rw [← heq] have hij := ((le_ciSup (f := fun j : Fin 4 => (1 / 2 : ℝ) * ∑ s, |policyKernel M M.e (e (e.symm i)) (e s) - policyKernel M M.e (e j) (e s)|) (Set.finite_range _).bddAbove (e.symm j)).trans (le_ciSup (f := fun i : Fin 4 => ⨆ j : Fin 4, (1 / 2 : ℝ) * ∑ s, |policyKernel M M.e (e i) (e s) - policyKernel M M.e (e j) (e s)|) (Set.finite_range _).bddAbove (e.symm i))).trans hh simpa only [Equiv.apply_symm_apply] using hij have hh := grid_value_modulus hN ha ha1 (selectGridCode_mem a ha.le M.b M.e w) (of (policyKernel M M.e)) _ _ _ (policyKernel_stochastic_of_kernelLaw M hM.pomdp_kernel M.e hM.policy_overlap.1) hM.stationary_start.1.1 (targetStationary_of_class M hM) (rewardRegression_unit M hM.pomdp_kernel hM.policy_overlap.1) hd exact hh.trans (mul_le_mul_of_nonneg_left (selected_grid_intervention_moment_error hT M hM w) (by unfold stabilityFactor; positivity))
CausalSmith.Stat.PomdpBinaryhiddenRate.stableGridEstimator_value_error · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/GridValue.lean:125
CausalSmith.Stat.STAT_PomdpBinaryhiddenRate_Research.Helpers.InterventionMoments 8 declarations The action-weighted short-history scores identify target-policy transition moments.

Observable intervention moments

The action-weighted short-history scores identify target-policy transition moments. Their second moments and separated-window covariances are controlled by policy overlap and behavior contraction.

Matrix power of a four-state kernel, using matrix multiplication.

Definition (Lean source)
k :
fourMatrixPower P k :
P ^ k
theorem fourMatrixPower_zero

This result establishes the stated mathematical relation for the construction under consideration. the stated conclusion holds.

Formal statement
Proof (Lean source)
CausalSmith.Stat.PomdpBinaryhiddenRate.fourMatrixPower_zero · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/InterventionMoments.lean:27
def scoreCovariance

Covariance of two observable score windows under the full trajectory law.

Definition (Lean source)
T :
M :
k :
t u :
Fin T
scoreCovariance M k t u :
ℝ
∫ tau, (score k M.b M.e (obsProj tau) t - populationMoment M k t) * (score k M.b M.e (obsProj tau) u - populationMoment M k u) ∂M.law
theorem scoreCovariance_le_separated

Likelihood peeling and backward Markov contraction control separated score windows. The unit reward support gives oscillation one, rather than the signed-reward constant two. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T k :
t0 zeta :
ℝ
M :
hM :
t u :
Fin T
htk :
k ≤ t.val
hu :
k + 1 ≤ u.val - t.val
|scoreCovariance M k t u| ≤ mixingAlpha t0 ^ (u.val - t.val - k - 1)
Proof (Lean source)
-- @node: scoreCovariance_le_separated lemma scoreCovariance_le_separated {T k : Nat} {t0 zeta : ℝ} (M : RawPomdpExperiment T 2 2) (hM : BinaryPomdpClass t0 zeta M) (t u : Fin T) (htk : k ≤ t.val) (hu : k + 1 ≤ u.val - t.val) : |scoreCovariance M k t u| ≤ mixingAlpha t0 ^ (u.val - t.val - k - 1) := by let N := finitePomdpView M let gap := u.val - t.val - k - 1 have hgap : t.val + 1 + gap + k < T := by dsimp [gap]; omega have hL : 1 ≤ policyFactor zeta := by simpa only [policyFactor, Real.exp_zero] using Real.exp_le_exp.mpr hM.zeta_nonneg obtain ⟨hK, hI, hO, hY⟩ := finitePomdpView_laws M hM.pomdp_kernel hM.sequential_ignorability hM.policy_overlap have hcross := PomdpLatentOverlapMinimax.integral_phiwScore_mul_eq_futureFunction_full (M := N) (k := k) (gap := gap) hI hO hL hK hY t htk hgap have hmean := PomdpLatentOverlapMinimax.integral_phiwScore_eq_futureFunction_full (M := N) (k := k) (gap := gap) hI hO hL hK hY t hgap let uu : Fin T := ⟨t.val + 1 + gap + k, hgap⟩ have huu : uu = u := by apply Fin.ext; dsimp [uu, gap]; omega change (∫ tau, score k M.b M.e (obsProj tau) t * score k M.b M.e (obsProj tau) uu ∂M.law) = _ at hcross change (∫ tau, score k M.b M.e (obsProj tau) uu ∂M.law) = _ at hmean rw [huu] at hcross hmean let F := PomdpLatentOverlapMinimax.phiwFutureFunction N gap k open Causalean.Mathlib.Probability.FiniteMarkovOscillation in have hFosc : OscillationBound (mixingAlpha t0 ^ gap) F := by have hr := rewardRegression_unit M hM.pomdp_kernel hM.policy_overlap.1 have hrosc : OscillationBound 1 (rewardRegression M) := by intro x y exact abs_le.mpr ⟨by linarith [(hr x).1, (hr y).2], by linarith [(hr x).2, (hr y).1]⟩ have ha0 : 0 ≤ mixingAlpha t0 := Real.exp_nonneg _ have ha1 : mixingAlpha t0 ≤ 1 := by exact Real.exp_le_one_iff.mpr (neg_nonpos.mpr (one_div_nonneg.mpr hM.t0_pos.le)) have he := oscillationBound_markovOperatorIter (policyKernel M M.e) (fun s => ⟨(policyKernel_stochastic_of_kernelLaw M hM.pomdp_kernel M.e hM.policy_overlap.1).1 s, (policyKernel_stochastic_of_kernelLaw M hM.pomdp_kernel M.e hM.policy_overlap.1).2 s⟩) ha0 (fun p q hp hq => by have hc := hM.target_contraction p q hp hq unfold l1Distance at hc nlinarith) hrosc k have he1 : OscillationBound 1 (markovOperatorIter (policyKernel M M.e) k (rewardRegression M)) := he.mono (by simpa using pow_le_one₀ ha0 ha1 (n := k)) have hb := oscillationBound_markovOperatorIter (policyKernel M M.b) (fun s => ⟨(policyKernel_stochastic_of_kernelLaw M hM.pomdp_kernel M.b hM.sequential_ignorability.1).1 s, (policyKernel_stochastic_of_kernelLaw M hM.pomdp_kernel M.b hM.sequential_ignorability.1).2 s⟩) ha0 (fun p q hp hq => by have hc := hM.behavior_contraction p q hp hq unfold l1Distance at hc nlinarith) he1 gap change OscillationBound (mixingAlpha t0 ^ gap) (markovOperatorIter (policyKernel M M.b) gap (markovOperatorIter (policyKernel M M.e) k (rewardRegression M))) simpa only [mul_one] using hb have hXt := PomdpLatentOverlapMinimax.phiwScore_memLp (k := k) hI hO hL hY 2 t have hXu := PomdpLatentOverlapMinimax.phiwScore_memLp (k := k) hI hO hL hY 2 u have hXtFull : MemLp (fun tau => score k M.b M.e (obsProj tau) t) 2 M.law := by exact (memLp_map_measure_iff (PomdpLatentOverlapMinimax.phiwScore_measurable M.b M.e t).aestronglyMeasurable PomdpLatentOverlapMinimax.measurable_obsProj.aemeasurable).mp hXt have hXuFull : MemLp (fun tau => score k M.b M.e (obsProj tau) u) 2 M.law := by exact (memLp_map_measure_iff (PomdpLatentOverlapMinimax.phiwScore_measurable M.b M.e u).aestronglyMeasurable PomdpLatentOverlapMinimax.measurable_obsProj.aemeasurable).mp hXu have hFint : Integrable (fun tau => F (nextState t tau)) M.law := by apply (integrable_const (∑ s, ‖F s‖)).mono' (by unfold nextState; fun_prop) exact Filter.Eventually.of_forall (fun tau => Finset.single_le_sum (fun s _ => norm_nonneg (F s)) (Finset.mem_univ _)) have hc := PomdpLatentOverlapMinimax.abs_integral_mul_sub_mul_integral_le_oscillation M.law (hXtFull.integrable one_le_two) hFint (score_abs_first_moment_le_one M hM.pomdp_kernel hM.sequential_ignorability hM.policy_overlap hL t htk) hFosc change |(∫ tau, score k M.b M.e (obsProj tau) t * F (nextState t tau) ∂M.law) - populationMoment M k t * ∫ tau, F (nextState t tau) ∂M.law| ≤ _ at hc change |covariance (fun tau => score k M.b M.e (obsProj tau) t) (fun tau => score k M.b M.e (obsProj tau) u) M.law| ≤ _ rw [ProbabilityTheory.covariance_eq_sub hXtFull hXuFull] simp only [Pi.mul_apply] rw [hcross, hmean] exact hc
CausalSmith.Stat.PomdpBinaryhiddenRate.scoreCovariance_le_separated · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/InterventionMoments.lean:40
theorem integral_binary_curState_eq_stationary

Each state coordinate integrates against the stationary behavior law. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
M :
t :
Fin T
F :
JointState 2 2 → ℝ
∫ tau, F (curState t tau) ∂M.law = ∑ s, stationaryLaw (policyKernel M M.b) s * F s
Proof (Lean source)
-- @node: integral_binary_curState_eq_stationary lemma integral_binary_curState_eq_stationary {T : Nat} (M : RawPomdpExperiment T 2 2) (hK : PomdpKernelLaw M) (hI : SequentialIgnorability M) (hS : StationaryStart M) (t : Fin T) (F : JointState 2 2 → ℝ) : ∫ tau, F (curState t tau) ∂M.law = ∑ s, stationaryLaw (policyKernel M M.b) s * F s := by have hK' : PomdpLatentOverlapMinimax.PomdpKernelLaw (finitePomdpView M) := ⟨hK.1, hK.2.2⟩ have hI' : PomdpLatentOverlapMinimax.SequentialIgnorability (finitePomdpView M) := hI induction hn : t.val using Nat.strong_induction_on generalizing t F with | h n ih => by_cases hn0 : n = 0 · have ht0 : t = ⟨0, by omega⟩ := Fin.ext (hn.trans hn0) rw [ht0] have hm : Measurable (stateAt (T := T) (nX := 2) (nH := 2) 0) := by unfold stateAt fun_prop have hi : Integrable F (M.law.map (stateAt (T := T) (nX := 2) (nH := 2) 0)) := Integrable.of_finite change ∫ tau, F (stateAt 0 tau) ∂M.law = _ rw [← integral_map hm.aemeasurable hi.aestronglyMeasurable, MeasureTheory.integral_fintype hi] apply Finset.sum_congr rfl intro s _ change (M.law.map (stateAt (T := T) (nX := 2) (nH := 2) 0) {s}).toReal * F s = _ rw [hS.2 s, ENNReal.toReal_ofReal (hS.1.1.1 s)] · let p : Fin T := ⟨n - 1, by omega⟩ have hp : p.val + 1 < T := by dsimp [p]; omega have ht : PomdpLatentOverlapMinimax.nextEpoch p hp = t := by apply Fin.ext dsimp [PomdpLatentOverlapMinimax.nextEpoch, p] omega have hFB (s : JointState 2 2) : |F s| ≤ ∑ x, |F x| := Finset.single_le_sum (fun x _ ↦ abs_nonneg (F x)) (Finset.mem_univ s) have hob := PomdpLatentOverlapMinimax.integrable_behaviorPeel_obligations hI' hK' p (fun _ ↦ (1 : ℝ)) measurable_const (integrable_const 1) F hFB have hstep := PomdpLatentOverlapMinimax.integral_history_mul_behavior_nextState hI' hK' p (fun _ ↦ (1 : ℝ)) F hob.1 hob.2 simp only [one_mul] at hstep have hleft : (∫ z, F z.2.2 ∂(M.law.map (histNextPair p))) = ∫ tau, F (curState (PomdpLatentOverlapMinimax.nextEpoch p hp) tau) ∂M.law := by have hmF : AEStronglyMeasurable (fun z : ActionHistoryView T 2 2 p × Step 2 2 ↦ F z.2.2) (M.law.map (histNextPair p)) := ((measurable_of_finite F).comp (measurable_snd.comp measurable_snd)).aestronglyMeasurable exact integral_map (f := fun z : ActionHistoryView T 2 2 p × Step 2 2 ↦ F z.2.2) (PomdpLatentOverlapMinimax.measurable_histNextPair p).aemeasurable hmF have hright : (∫ h, markovOperator (policyKernel M M.b) F h.2 ∂(M.law.map (histStateView p))) = ∫ tau, markovOperator (policyKernel M M.b) F (curState p tau) ∂M.law := by exact integral_map (f := fun h : StateHistoryView T 2 2 p ↦ markovOperator (policyKernel M M.b) F h.2) (PomdpLatentOverlapMinimax.measurable_histStateView p).aemeasurable (((measurable_of_finite (markovOperator (policyKernel M M.b) F)).comp measurable_snd).aestronglyMeasurable) change (∫ z, F z.2.2 ∂(M.law.map (histNextPair p))) = ∫ h, markovOperator (policyKernel M M.b) F h.2 ∂(M.law.map (histStateView p)) at hstep rw [hleft, hright] at hstep rw [← ht, hstep, ih (n - 1) (by omega) p (markovOperator (policyKernel M M.b) F) rfl] unfold markovOperator calc ∑ s, stationaryLaw (policyKernel M M.b) s * ∑ x, policyKernel M M.b s x * F x = ∑ s, ∑ x, stationaryLaw (policyKernel M M.b) s * (policyKernel M M.b s x * F x) := by apply Finset.sum_congr rfl intro s _ rw [Finset.mul_sum] _ = ∑ x, ∑ s, stationaryLaw (policyKernel M M.b) s * (policyKernel M M.b s x * F x) := Finset.sum_comm _ = ∑ x, (∑ s, stationaryLaw (policyKernel M M.b) s * policyKernel M M.b s x) * F x := by apply Finset.sum_congr rfl intro x _ rw [Finset.sum_mul] apply Finset.sum_congr rfl intro s _ ring _ = ∑ x, stationaryLaw (policyKernel M M.b) x * F x := by apply Finset.sum_congr rfl intro x _ have hx := congrFun hS.1.2 x change (∑ s, stationaryLaw (policyKernel M M.b) s * policyKernel M M.b s x) = stationaryLaw (policyKernel M M.b) x at hx rw [hx]
CausalSmith.Stat.PomdpBinaryhiddenRate.integral_binary_curState_eq_stationary · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/InterventionMoments.lean:124
theorem binary_markovOperatorIter_eq_mulVec Lemma binary_markovOperatorIter_eq_mulVec in the paper ↗

Iterating the Markov operator agrees with multiplying by matrix powers. the stated conclusion holds.

Formal statement
P :
Matrix (JointState 2 2) (JointState 2 2) ℝ
k :
r :
JointState 2 2 → ℝ
markovOperatorIter (fun i j => P i j) k r
= mulVec (P ^ k) r
Proof (Lean source)
-- @node: binary_markovOperatorIter_eq_mulVec lemma binary_markovOperatorIter_eq_mulVec (P : Matrix (JointState 2 2) (JointState 2 2) ℝ) (k : Nat) (r : JointState 2 2 → ℝ) : markovOperatorIter (fun i j => P i j) k r = mulVec (P ^ k) r := by induction k with | zero => simp [markovOperatorIter] | succ k ih => rw [markovOperatorIter_succ, ih, pow_succ'] change mulVec P (mulVec (P ^ k) r) = _ exact Matrix.mulVec_mulVec r P (P ^ k)
CausalSmith.Stat.PomdpBinaryhiddenRate.binary_markovOperatorIter_eq_mulVec · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/InterventionMoments.lean:217
theorem observable_intervention_moments

The seven observable scores have the intervention identity, bounded second moments, and geometric covariance decay for separated windows. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
t0 zeta :
ℝ
M :
hM :
k :
Fin 7
t :
Fin T
k.val ≤ t.val
conclusion 1
populationMoment M k.val t
= ∑ s, (vecMul (stationaryLaw (policyKernel M M.b)) (fourMatrixPower (of (policyKernel M M.e)) k.val)) s * rewardRegression M s
conclusion 2
(∫ tau, (score k.val M.b M.e (obsProj tau) t) ^ 2 ∂M.law)
≤ (policyFactor zeta) ^ (k.val + 1)
conclusion 3
u :
Fin T
k.val + 1 ≤ u.val - t.val
|scoreCovariance M k.val t u| ≤ (mixingAlpha t0) ^ (u.val - t.val - k.val - 1)
Proof (Lean source)
lemma observable_intervention_moments {T : Nat} {t0 zeta : ℝ} (M : RawPomdpExperiment T 2 2) (hM : BinaryPomdpClass t0 zeta M) : ∀ k : Fin 7, ∀ t : Fin T, k.val ≤ t.val → populationMoment M k.val t = ∑ s, (vecMul (stationaryLaw (policyKernel M M.b)) (fourMatrixPower (of (policyKernel M M.e)) k.val)) s * rewardRegression M s ∧ (∫ tau, (score k.val M.b M.e (obsProj tau) t) ^ 2 ∂M.law) ≤ (policyFactor zeta) ^ (k.val + 1) ∧ ∀ u : Fin T, k.val + 1 ≤ u.val - t.val → |scoreCovariance M k.val t u| ≤ (mixingAlpha t0) ^ (u.val - t.val - k.val - 1) := by intro k t hkt have hL : 1 ≤ policyFactor zeta := by simpa only [policyFactor, Real.exp_zero] using Real.exp_le_exp.mpr hM.zeta_nonneg refine ⟨?_, score_second_moment_le M hM.pomdp_kernel hM.sequential_ignorability hM.policy_overlap hL t hkt, ?_⟩ · obtain ⟨hK, hI, hO, hY⟩ := finitePomdpView_laws M hM.pomdp_kernel hM.sequential_ignorability hM.policy_overlap let r : Fin T := ⟨t.val - k.val, by omega⟩ have hhor : r.val + 0 + k.val < T := by dsimp [r]; omega have hp := PomdpLatentOverlapMinimax.integral_phiwScore_eq_futureFunction_from_state hI hO hL hK hY r hhor have hu : PomdpLatentOverlapMinimax.epochAdd (PomdpLatentOverlapMinimax.epochAdd r 0 (by omega)) k.val (by dsimp [PomdpLatentOverlapMinimax.epochAdd, r]; omega) = t := by apply Fin.ext dsimp [PomdpLatentOverlapMinimax.epochAdd, r] omega dsimp only at hp rw [hu] at hp simp only [finitePomdpView] at hp rw [PomdpLatentOverlapMinimax.obsLaw, integral_map PomdpLatentOverlapMinimax.measurable_obsProj.aemeasurable (PomdpLatentOverlapMinimax.phiwScore_measurable M.b M.e t).aestronglyMeasurable] at hp change populationMoment M k.val t = ∫ tau, markovOperatorIter (policyKernel M M.e) k.val (rewardRegression M) (curState r tau) ∂M.law at hp rw [hp, integral_binary_curState_eq_stationary M hM.pomdp_kernel hM.sequential_ignorability hM.stationary_start] have hiter := binary_markovOperatorIter_eq_mulVec (of (policyKernel M M.e)) k.val (rewardRegression M) change markovOperatorIter (policyKernel M M.e) k.val (rewardRegression M) = _ at hiter rw [hiter] exact Matrix.dotProduct_mulVec _ _ _ · intro u hu exact scoreCovariance_le_separated M hM t u hkt hu
CausalSmith.Stat.PomdpBinaryhiddenRate.observable_intervention_moments · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/InterventionMoments.lean:233
theorem observable_intervention_moment_zero

The zero-lag intervention identity under the four conditions used in the coincident-policy reduction. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
t0 :
ℝ
M :
ht0 :
0 < t0
heq :
M.e = M.b
t :
Fin T
populationMoment M 0 t = targetValue M
Proof (Lean source)
-- @node: observable_intervention_moment_zero lemma observable_intervention_moment_zero {T : Nat} {t0 : ℝ} (M : RawPomdpExperiment T 2 2) (ht0 : 0 < t0) (hK : PomdpKernelLaw M) (hI : SequentialIgnorability M) (hS : StationaryStart M) (hB : BehaviorContraction (mixingAlpha t0) M) (heq : M.e = M.b) (t : Fin T) : populationMoment M 0 t = targetValue M := by have hOverlap : PolicyOverlap (policyFactor 0) M := by refine ⟨?_, ?_⟩ · simpa only [heq] using hI.1 · intro x a simp only [heq, policyFactor, Real.exp_zero, one_mul, le_refl] have hClass : BinaryPomdpClass t0 0 M := { t0_pos := ht0 zeta_nonneg := le_refl 0 pomdp_kernel := hK sequential_ignorability := hI stationary_start := hS policy_overlap := hOverlap behavior_contraction := hB target_contraction := by change ContractsL1 (policyKernel M M.e) (mixingAlpha t0) rw [heq] exact hB } have hm := (observable_intervention_moments M hClass ⟨0, by norm_num⟩ t (by norm_num)).1 have hk : (⟨0, by norm_num⟩ : Fin 7).val = 0 := rfl rw [hk, fourMatrixPower_zero, Matrix.vecMul_one] at hm simpa only [targetValue, heq] using hm
CausalSmith.Stat.PomdpBinaryhiddenRate.observable_intervention_moment_zero · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/InterventionMoments.lean:283
CausalSmith.Stat.STAT_PomdpBinaryhiddenRate_Research.Helpers.ModelRegularity 4 declarations Probability policies give stochastic transition rows and unit-range reward regressions.

Binary POMDP kernel regularity

Probability policies give stochastic transition rows and unit-range reward regressions. Contracted target kernels have stationary probability laws.

theorem rewardRegression_unit

Probability target policies preserve the unit range of kernel rewards. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
M :
hE :
s :
rewardRegression M s ∈ Icc (0 : ℝ) 1
Proof (Lean source)
-- @node: rewardRegression_unit lemma rewardRegression_unit {T : Nat} (M : RawPomdpExperiment T 2 2) (hK : PomdpKernelLaw M) (hE : PolicyVector M.e) : ∀ s, rewardRegression M s ∈ Icc (0 : ℝ) 1 := by have hmean (s : JointState 2 2) (a : Bool) : (∫ p, p.1 ∂M.K s a) ∈ Icc (0 : ℝ) 1 := by letI : IsProbabilityMeasure (M.K s a) := hK.1 s a have hae : ∀ᵐ p ∂M.K s a, p.1 ∈ Icc (0 : ℝ) 1 := by apply (MeasureTheory.mem_ae_iff_prob_eq_one (measurable_fst measurableSet_Icc)).2 exact hK.2.1 s a have hn : 0 ≤ ∫ p, p.1 ∂M.K s a := MeasureTheory.integral_nonneg_of_ae (hae.mono (by intro p hp; exact hp.1)) have hnorm := MeasureTheory.norm_integral_le_of_norm_le_const (μ := M.K s a) (f := fun p => p.1) (C := 1) (hae.mono (by intro p hp simpa only [Real.norm_eq_abs] using (abs_le.mpr ⟨by linarith [hp.1], hp.2⟩ : |p.1| ≤ 1))) constructor · exact hn · simpa only [MeasureTheory.probReal_univ, mul_one, Real.norm_eq_abs] using le_trans (le_abs_self _) hnorm have hr (s : JointState 2 2) : rewardRegression M s ∈ Icc (0 : ℝ) 1 := by have hp := hE s.1 constructor · unfold rewardRegression apply Finset.sum_nonneg intro a _ exact mul_nonneg (hp.1 a) (hmean s a).1 · unfold rewardRegression calc (∑ a : Bool, M.e s.1 a * ∫ p, p.1 ∂M.K s a) ≤ ∑ a : Bool, M.e s.1 a * 1 := by apply Finset.sum_le_sum intro a _ exact mul_le_mul_of_nonneg_left (hmean s a).2 (hp.1 a) _ = 1 := by simpa only [mul_one] using hp.2 exact hr
CausalSmith.Stat.PomdpBinaryhiddenRate.rewardRegression_unit · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/ModelRegularity.lean:18
theorem targetValue_mem_unitInterval

Unit-range kernel rewards and probability policies keep the target value in [0,1]. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
M :
hπ :
IsStationary (policyKernel M M.e) (stationaryLaw (policyKernel M M.e))
hE :
targetValue M ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma targetValue_mem_unitInterval {T : Nat} (M : RawPomdpExperiment T 2 2) (hK : PomdpKernelLaw M) (hπ : IsStationary (policyKernel M M.e) (stationaryLaw (policyKernel M M.e))) (hE : PolicyVector M.e) : targetValue M ∈ Icc (0 : ℝ) 1 := by have hr := rewardRegression_unit M hK hE have hpi := hπ.1 constructor · unfold targetValue apply Finset.sum_nonneg intro s _ exact mul_nonneg (hpi.1 s) (hr s).1 · unfold targetValue calc (∑ s, stationaryLaw (policyKernel M M.e) s * rewardRegression M s) ≤ ∑ s, stationaryLaw (policyKernel M M.e) s * 1 := by apply Finset.sum_le_sum intro s _ exact mul_le_mul_of_nonneg_left (hr s).2 (hpi.1 s) _ = 1 := by simpa only [mul_one] using hpi.2
CausalSmith.Stat.PomdpBinaryhiddenRate.targetValue_mem_unitInterval · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/ModelRegularity.lean:59
theorem policyKernel_stochastic_of_kernelLaw

A probability reward-successor kernel and a probability policy induce stochastic rows. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
M :
p :
hp :
Proof (Lean source)
lemma policyKernel_stochastic_of_kernelLaw {T : Nat} (M : RawPomdpExperiment T 2 2) (hK : PomdpKernelLaw M) (p : Policy 2) (hp : PolicyVector p) : IsStochasticMatrix (policyKernel M p) := by constructor · intro s sp unfold policyKernel apply Finset.sum_nonneg intro a _ exact mul_nonneg ((hp s.1).1 a) MeasureTheory.measureReal_nonneg · intro s have hrow (a : Bool) : (∑ sp : JointState 2 2, (M.K s a {q | q.2 = sp}).toReal) = 1 := by letI : IsProbabilityMeasure (M.K s a) := hK.1 s a have hsum := MeasureTheory.sum_measureReal_preimage_singleton (μ := M.K s a) (f := fun q : Step 2 2 => q.2) (Finset.univ : Finset (JointState 2 2)) (by intro sp _ exact measurable_snd (MeasurableSet.singleton sp)) simpa [MeasureTheory.measureReal_def, preimage] using hsum calc (∑ sp, policyKernel M p s sp) = ∑ a : Bool, p s.1 a * ∑ sp : JointState 2 2, (M.K s a {q | q.2 = sp}).toReal := by unfold policyKernel rw [Finset.sum_comm] simp_rw [Finset.mul_sum] _ = ∑ a : Bool, p s.1 a := by simp_rw [hrow, mul_one] _ = 1 := (hp s.1).2
CausalSmith.Stat.PomdpBinaryhiddenRate.policyKernel_stochastic_of_kernelLaw · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/ModelRegularity.lean:82
theorem targetStationary_of_class

The contracted target kernel has the selected stationary probability law. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
t0 zeta :
ℝ
M :
hM :
IsStationary (policyKernel M M.e) (stationaryLaw (policyKernel M M.e))
Proof (Lean source)
lemma targetStationary_of_class {T : Nat} {t0 zeta : ℝ} (M : RawPomdpExperiment T 2 2) (hM : BinaryPomdpClass t0 zeta M) : IsStationary (policyKernel M M.e) (stationaryLaw (policyKernel M M.e)) := by have hα0 : 0 ≤ mixingAlpha t0 := by unfold mixingAlpha exact (Real.exp_pos _).le have hα1 : mixingAlpha t0 < 1 := by unfold mixingAlpha have hrec : 0 < 1 / t0 := one_div_pos.mpr hM.t0_pos have h := Real.exp_lt_exp.mpr (show -(1 / t0) < (0 : ℝ) by linarith) simpa only [Real.exp_zero] using h obtain ⟨pi, hpi, _⟩ := existsUnique_stationary_of_contractsL1 (policyKernel_stochastic_of_kernelLaw M hM.pomdp_kernel M.e hM.policy_overlap.1) hα0 hα1 hM.target_contraction exact stationaryLaw_isStationary_of_exists ⟨pi, hpi⟩
CausalSmith.Stat.PomdpBinaryhiddenRate.targetStationary_of_class · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/ModelRegularity.lean:114
CausalSmith.Stat.STAT_PomdpBinaryhiddenRate_Research.Helpers.PairPolynomial 30 declarations The four-state transient characteristic factors yield an exact stationary-value identity and a uniform seven-moment modulus under Dobrushin contraction, including complex and defective transient modes.

Seven-moment pair-polynomial stability

The four-state transient characteristic factors yield an exact stationary-value identity and a uniform seven-moment modulus under Dobrushin contraction, including complex and defective transient modes.

def matrixMoment

The moment of a row vector, transition matrix, and reward vector.

Definition (Lean source)
nu :
JointState 2 2 → ℝ
r :
JointState 2 2 → ℝ
k :
matrixMoment nu P r k :
ℝ
∑ s, (vecMul nu (P ^ k)) s * r s
def matrixValue

The stationary value of a finite reward vector.

Definition (Lean source)
pi r :
JointState 2 2 → ℝ
matrixValue pi r :
ℝ
∑ s, pi s * r s
theorem stationary_vecMul_pow

Stationarity is preserved by every matrix power. Under the listed formal conditions, the stated conclusion holds.

Formal statement
pi :
JointState 2 2 → ℝ
hpi :
IsStationary P pi
k :
ℕ
vecMul pi (P ^ k) = pi
Proof (Lean source)
-- @node: stationary_vecMul_pow lemma stationary_vecMul_pow (P : FourMatrix) (pi : JointState 2 2 → ℝ) (hpi : IsStationary P pi) (k : ℕ) : vecMul pi (P ^ k) = pi := by have hfix : vecMul pi P = pi := hpi.2 induction k with | zero => simp | succ k ih => rw [pow_succ, ← Matrix.vecMul_vecMul, ih, hfix]
CausalSmith.Stat.PomdpBinaryhiddenRate.stationary_vecMul_pow · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/PairPolynomial.lean:31
theorem stationary_vecMul_aeval

Left evaluation of a polynomial against a stationary law evaluates at one. Under the listed formal conditions, the stated conclusion holds.

Formal statement
pi :
JointState 2 2 → ℝ
hpi :
IsStationary P pi
f :
vecMul pi (aeval P f) = f.eval 1 • pi
Proof (Lean source)
-- @node: stationary_vecMul_aeval lemma stationary_vecMul_aeval (P : FourMatrix) (pi : JointState 2 2 → ℝ) (hpi : IsStationary P pi) (f : Polynomial ℝ) : vecMul pi (aeval P f) = f.eval 1 • pi := by classical rw [Polynomial.aeval_eq_sum_range, Matrix.vecMul_sum] simp_rw [Matrix.vecMul_smul, stationary_vecMul_pow P pi hpi] rw [← Finset.sum_smul] congr 1 simp [Polynomial.eval_eq_sum_range]
CausalSmith.Stat.PomdpBinaryhiddenRate.stationary_vecMul_aeval · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/PairPolynomial.lean:40
theorem stochastic_charpoly_isRoot_one Lemma stochastic_charpoly_isRoot_one in the paper ↗

The constant right vector witnesses the stationary characteristic root. Under the listed formal conditions, the stated conclusion holds.

Formal statement
Proof (Lean source)
-- @node: stochastic_charpoly_isRoot_one lemma stochastic_charpoly_isRoot_one (P : FourMatrix) (hP : IsStochasticMatrix P) : IsRoot (charpoly P) 1 := by have hconst : mulVec P (fun _ => (1 : ℝ)) = fun _ => 1 := by ext i simpa [mulVec, dotProduct] using hP.2 i have hzero : mulVec (Matrix.scalar _ (1 : ℝ) - P) (fun _ => (1 : ℝ)) = 0 := by simp [Matrix.sub_mulVec, hconst, Matrix.scalar] rw [IsRoot, Matrix.eval_charpoly] exact Matrix.det_eq_zero_of_mulVec_eq_zero_of_mem_nonZeroDivisors hzero (i := ((0 : Fin 2), (0 : Fin 2))) (by simp)
CausalSmith.Stat.PomdpBinaryhiddenRate.stochastic_charpoly_isRoot_one · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/PairPolynomial.lean:52
theorem stochastic_charpoly_factor Lemma stochastic_charpoly_factor in the paper ↗

Exact characteristic factorization, independent of diagonalizability. Under the listed formal conditions, the stated conclusion holds.

Formal statement
(X - C 1) * transientPoly P = charpoly P
Proof (Lean source)
-- @node: stochastic_charpoly_factor lemma stochastic_charpoly_factor (P : FourMatrix) (hP : IsStochasticMatrix P) : (X - C 1) * transientPoly P = charpoly P := by exact Polynomial.mul_divByMonic_eq_iff_isRoot.mpr (stochastic_charpoly_isRoot_one P hP)
CausalSmith.Stat.PomdpBinaryhiddenRate.stochastic_charpoly_factor · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/PairPolynomial.lean:65
theorem transientPoly_aeval_annihilated Lemma transientPoly_aeval_annihilated in the paper ↗

Cayley–Hamilton puts the transient polynomial's image in the fixed space. Under the listed formal conditions, the stated conclusion holds.

Formal statement
(P - 1) * aeval P (transientPoly P) = 0
Proof (Lean source)
-- @node: transientPoly_aeval_annihilated lemma transientPoly_aeval_annihilated (P : FourMatrix) (hP : IsStochasticMatrix P) : (P - 1) * aeval P (transientPoly P) = 0 := by have h := congrArg (aeval P) (stochastic_charpoly_factor P hP) simpa using h.trans (Matrix.aeval_self_charpoly P)
CausalSmith.Stat.PomdpBinaryhiddenRate.transientPoly_aeval_annihilated · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/PairPolynomial.lean:72
theorem matrixMoment_polynomial_sum Lemma matrixMoment_polynomial_sum in the paper ↗

Polynomial matrix evaluation is the corresponding finite moment sum. Under the listed formal conditions, the stated conclusion holds.

Formal statement
nu r :
JointState 2 2 → ℝ
f :
hf :
f.natDegree < 7
(∑ s, (vecMul nu (aeval P f)) s * r s)
= ∑ k : Fin 7, f.coeff k.val * matrixMoment nu P r k.val
Proof (Lean source)
-- @node: matrixMoment_polynomial_sum lemma matrixMoment_polynomial_sum (nu r : JointState 2 2 → ℝ) (P : FourMatrix) (f : Polynomial ℝ) (hf : f.natDegree < 7) : (∑ s, (vecMul nu (aeval P f)) s * r s) = ∑ k : Fin 7, f.coeff k.val * matrixMoment nu P r k.val := by classical rw [Polynomial.aeval_eq_sum_range' hf, Matrix.vecMul_sum] simp_rw [Finset.sum_apply, Matrix.vecMul_smul, Pi.smul_apply, smul_eq_mul, Finset.sum_mul] rw [Finset.sum_comm] simp_rw [mul_assoc, ← Finset.mul_sum] exact (Fin.sum_univ_eq_sum_range _ 7).symm
CausalSmith.Stat.PomdpBinaryhiddenRate.matrixMoment_polynomial_sum · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/PairPolynomial.lean:79
theorem probability_mean_tv_interval Lemma probability_mean_tv_interval in the paper ↗

Centering at the midpoint gives TV duality for any bounded real vector. Under the listed formal conditions, the stated conclusion holds.

Formal statement
S :
Type*
S → ℝ
lo hi :
ℝ
hf :
∀ i, f i ∈ Icc lo hi
|(∑ i, p i * f i) - ∑ i, q i * f i| ≤ ((1 / 2 : ℝ) * ∑ i, |p i - q i|) * (hi - lo)
Proof (Lean source)
-- @node: probability_mean_tv_interval lemma probability_mean_tv_interval {S : Type*} [Fintype S] {p q f : S → ℝ} (hp : IsProbabilityVector p) (hq : IsProbabilityVector q) {lo hi : ℝ} (hf : ∀ i, f i ∈ Icc lo hi) : |(∑ i, p i * f i) - ∑ i, q i * f i| ≤ ((1 / 2 : ℝ) * ∑ i, |p i - q i|) * (hi - lo) := by have hz : ∑ i, (p i - q i) = 0 := by rw [Finset.sum_sub_distrib, hp.2, hq.2]; ring have he : (∑ i, p i * f i) - ∑ i, q i * f i = ∑ i, (p i - q i) * (f i - (lo + hi) / 2) := by simp_rw [mul_sub] rw [Finset.sum_sub_distrib, ← Finset.sum_mul, hz, zero_mul, sub_zero, ← Finset.sum_sub_distrib] apply Finset.sum_congr rfl intro i _ ring rw [he] calc _ ≤ ∑ i, |(p i - q i) * (f i - (lo + hi) / 2)| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ i, |p i - q i| * ((hi - lo) / 2) := by apply Finset.sum_le_sum intro i _ rw [abs_mul] exact mul_le_mul_of_nonneg_left (abs_le.mpr ⟨by linarith [(hf i).1], by linarith [(hf i).2]⟩) (abs_nonneg _) _ = _ := by rw [← Finset.sum_mul]; ring
CausalSmith.Stat.PomdpBinaryhiddenRate.probability_mean_tv_interval · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/PairPolynomial.lean:93
theorem dobrushin_fixedVector_constant Lemma dobrushin_fixedVector_constant in the paper ↗

Dobrushin contraction below one leaves only constant right fixed vectors. Under the listed formal conditions, the stated conclusion holds.

Formal statement
alpha :
ℝ
hα :
alpha < 1
hδ :
dobrushin P ≤ alpha
f :
JointState 2 2 → ℝ
hfix :
mulVec P f = f
∃ c : ℝ, f = fun _ => c
Proof (Lean source)
-- @node: dobrushin_fixedVector_constant lemma dobrushin_fixedVector_constant (P : FourMatrix) (hP : IsStochasticMatrix P) {alpha : ℝ} (hα : alpha < 1) (hδ : dobrushin P ≤ alpha) (f : JointState 2 2 → ℝ) (hfix : mulVec P f = f) : ∃ c : ℝ, f = fun _ => c := by classical obtain ⟨imin, hmin⟩ := Finite.exists_min f obtain ⟨imax, hmax⟩ := Finite.exists_max f have hrows (i : JointState 2 2) : IsProbabilityVector (P i) := ⟨hP.1 i, hP.2 i⟩ have htv : (1 / 2 : ℝ) * ∑ s, |P imax s - P imin s| ≤ alpha := by have hj : (1 / 2 : ℝ) * ∑ s, |P imax s - P imin s| ≤ ⨆ j : JointState 2 2, (1 / 2 : ℝ) * ∑ s, |P imax s - P j s| := le_ciSup (f := fun j : JointState 2 2 => (1 / 2 : ℝ) * ∑ s, |P imax s - P j s|) (Finite.bddAbove_range _) imin have hi : (⨆ j : JointState 2 2, (1 / 2 : ℝ) * ∑ s, |P imax s - P j s|) ≤ dobrushin P := le_ciSup (f := fun i : JointState 2 2 => ⨆ j : JointState 2 2, (1 / 2 : ℝ) * ∑ s, |P i s - P j s|) (Finite.bddAbove_range _) imax exact hj.trans (hi.trans hδ) have hmean := probability_mean_tv_interval (hrows imax) (hrows imin) (f := f) (fun i => ⟨hmin i, hmax i⟩) have hmaxfix : (∑ i, P imax i * f i) = f imax := congrFun hfix imax have hminfix : (∑ i, P imin i * f i) = f imin := congrFun hfix imin rw [hmaxfix, hminfix, abs_of_nonneg (sub_nonneg.mpr (hmin imax))] at hmean have hbound := hmean.trans (mul_le_mul_of_nonneg_right htv (sub_nonneg.mpr (hmin imax))) have heq : f imax = f imin := by nlinarith [hmin imax] refine ⟨f imin, funext fun i => ?_⟩ exact le_antisymm (heq ▸ hmax i) (hmin i)
CausalSmith.Stat.PomdpBinaryhiddenRate.dobrushin_fixedVector_constant · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/PairPolynomial.lean:122
theorem stationary_shift_constant_eq_zero

Stationarity rules out a nonzero constant in the image of the shifted operator. Under the listed formal conditions, the stated conclusion holds.

Formal statement
pi w :
JointState 2 2 → ℝ
hpi :
IsStationary P pi
c :
ℝ
hw :
mulVec (P - 1) w = fun _ => c
c = 0
Proof (Lean source)
-- @node: stationary_shift_constant_eq_zero lemma stationary_shift_constant_eq_zero (P : FourMatrix) (pi w : JointState 2 2 → ℝ) (hpi : IsStationary P pi) (c : ℝ) (hw : mulVec (P - 1) w = fun _ => c) : c = 0 := by have hfix : vecMul pi P = pi := hpi.2 have hmean : dotProduct pi (mulVec (P - 1) w) = 0 := by rw [Matrix.dotProduct_mulVec, Matrix.vecMul_sub, hfix, Matrix.vecMul_one, sub_self, zero_dotProduct] rw [hw] at hmean simpa [dotProduct, ← Finset.sum_mul, hpi.1.2] using hmean
CausalSmith.Stat.PomdpBinaryhiddenRate.stationary_shift_constant_eq_zero · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/PairPolynomial.lean:155
theorem dobrushin_shift_sq_kernel

No nontrivial Jordan chain can end in the eigenspace at one. Under the listed formal conditions, the stated conclusion holds.

Formal statement
pi w :
JointState 2 2 → ℝ
hpi :
IsStationary P pi
alpha :
ℝ
hα :
alpha < 1
hδ :
dobrushin P ≤ alpha
hw :
mulVec (P - 1) (mulVec (P - 1) w) = 0
mulVec (P - 1) w = 0
Proof (Lean source)
-- @node: dobrushin_shift_sq_kernel lemma dobrushin_shift_sq_kernel (P : FourMatrix) (pi w : JointState 2 2 → ℝ) (hP : IsStochasticMatrix P) (hpi : IsStationary P pi) {alpha : ℝ} (hα : alpha < 1) (hδ : dobrushin P ≤ alpha) (hw : mulVec (P - 1) (mulVec (P - 1) w) = 0) : mulVec (P - 1) w = 0 := by let u := mulVec (P - 1) w have hfix : mulVec P u = u := by have h : mulVec (P - 1) u = 0 := hw simpa [Matrix.sub_mulVec, sub_eq_zero] using h obtain ⟨c, hc⟩ := dobrushin_fixedVector_constant P hP hα hδ u hfix have hz := stationary_shift_constant_eq_zero P pi w hpi c hc simpa [u, hz, Pi.zero_def] using hc
CausalSmith.Stat.PomdpBinaryhiddenRate.dobrushin_shift_sq_kernel · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/PairPolynomial.lean:167
theorem dobrushin_shift_pow_kernel

Every positive power of the shifted operator has the same kernel. Under the listed formal conditions, the stated conclusion holds.

Formal statement
pi w :
JointState 2 2 → ℝ
hpi :
IsStationary P pi
alpha :
ℝ
hα :
alpha < 1
hδ :
dobrushin P ≤ alpha
n :
ℕ
hw :
mulVec ((P - 1) ^ n) w = 0
mulVec (P - 1) w = 0
Proof (Lean source)
-- @node: dobrushin_shift_pow_kernel lemma dobrushin_shift_pow_kernel (P : FourMatrix) (pi w : JointState 2 2 → ℝ) (hP : IsStochasticMatrix P) (hpi : IsStationary P pi) {alpha : ℝ} (hα : alpha < 1) (hδ : dobrushin P ≤ alpha) (n : ℕ) (hw : mulVec ((P - 1) ^ n) w = 0) : mulVec (P - 1) w = 0 := by induction n generalizing w with | zero => have hz : w = 0 := by simpa using hw simp [hz] | succ n ih => have h := ih (mulVec (P - 1) w) (by simpa [pow_succ, Matrix.mulVec_mulVec] using hw) exact dobrushin_shift_sq_kernel P pi w hP hpi hα hδ h
CausalSmith.Stat.PomdpBinaryhiddenRate.dobrushin_shift_pow_kernel · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/PairPolynomial.lean:182
theorem dobrushin_maxGenEigenspace_one

The entire generalized eigenspace at one is the line of constant vectors. Under the listed formal conditions, the stated conclusion holds.

Formal statement
pi :
JointState 2 2 → ℝ
hpi :
IsStationary P pi
alpha :
ℝ
hα :
alpha < 1
hδ :
dobrushin P ≤ alpha
maxGenEigenspace P.mulVecLin 1
= span ℝ {fun _ : JointState 2 2 => (1 : ℝ)}
Proof (Lean source)
-- @node: dobrushin_maxGenEigenspace_one lemma dobrushin_maxGenEigenspace_one (P : FourMatrix) (pi : JointState 2 2 → ℝ) (hP : IsStochasticMatrix P) (hpi : IsStationary P pi) {alpha : ℝ} (hα : alpha < 1) (hδ : dobrushin P ≤ alpha) : maxGenEigenspace P.mulVecLin 1 = span ℝ {fun _ : JointState 2 2 => (1 : ℝ)} := by ext w rw [Module.End.mem_maxGenEigenspace, Submodule.mem_span_singleton] constructor · rintro ⟨n, hn⟩ have hpow : mulVec ((P - 1) ^ n) w = 0 := by change (Matrix.toLin' ((P - 1) ^ n)) w = 0 rw [Matrix.toLin'_pow, map_sub, Matrix.toLin'_one] simpa only [one_smul, Matrix.toLin'_apply', Module.End.one_eq_id] using hn have hz := dobrushin_shift_pow_kernel P pi w hP hpi hα hδ n hpow have hfix : mulVec P w = w := by simpa [Matrix.sub_mulVec, sub_eq_zero] using hz obtain ⟨c, hc⟩ := dobrushin_fixedVector_constant P hP hα hδ w hfix refine ⟨c, ?_⟩ ext i simpa using congrFun hc.symm i · rintro ⟨c, rfl⟩ refine ⟨1, ?_⟩ ext i simp [mulVecLin, mulVec, dotProduct, hP.2 i]
CausalSmith.Stat.PomdpBinaryhiddenRate.dobrushin_maxGenEigenspace_one · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/PairPolynomial.lean:198
theorem dobrushin_charpoly_rootMultiplicity_one

Strict Dobrushin contraction makes the stationary characteristic root simple. Under the listed formal conditions, the stated conclusion holds.

Formal statement
pi :
JointState 2 2 → ℝ
hpi :
IsStationary P pi
alpha :
ℝ
hα :
alpha < 1
hδ :
dobrushin P ≤ alpha
Proof (Lean source)
-- @node: dobrushin_charpoly_rootMultiplicity_one lemma dobrushin_charpoly_rootMultiplicity_one (P : FourMatrix) (pi : JointState 2 2 → ℝ) (hP : IsStochasticMatrix P) (hpi : IsStationary P pi) {alpha : ℝ} (hα : alpha < 1) (hδ : dobrushin P ≤ alpha) : rootMultiplicity 1 (charpoly P) = 1 := by rw [← Matrix.charpoly_mulVecLin, ← LinearMap.finrank_maxGenEigenspace_eq, dobrushin_maxGenEigenspace_one P pi hP hpi hα hδ] exact finrank_span_singleton (by intro h have := congrFun h ((0 : Fin 2), (0 : Fin 2)) norm_num at this)
CausalSmith.Stat.PomdpBinaryhiddenRate.dobrushin_charpoly_rootMultiplicity_one · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/PairPolynomial.lean:225
theorem transientPoly_eval_one_ne_zero

Algebraic simplicity makes the transient characteristic factor nonzero at one. Under the listed formal conditions, the stated conclusion holds.

Formal statement
pi :
JointState 2 2 → ℝ
hpi :
IsStationary P pi
alpha :
ℝ
hα :
alpha < 1
hδ :
dobrushin P ≤ alpha
(transientPoly P).eval 1 ≠ 0
Proof (Lean source)
-- @node: transientPoly_eval_one_ne_zero lemma transientPoly_eval_one_ne_zero (P : FourMatrix) (pi : JointState 2 2 → ℝ) (hP : IsStochasticMatrix P) (hpi : IsStationary P pi) {alpha : ℝ} (hα : alpha < 1) (hδ : dobrushin P ≤ alpha) : (transientPoly P).eval 1 ≠ 0 := by have hfactor := stochastic_charpoly_factor P hP have hnz : (X - C 1) * transientPoly P ≠ 0 := by rw [hfactor] exact (Matrix.charpoly_monic P).ne_zero have hmult := dobrushin_charpoly_rootMultiplicity_one P pi hP hpi hα hδ rw [← hfactor, Polynomial.rootMultiplicity_mul hnz, Polynomial.rootMultiplicity_X_sub_C_self] at hmult have hzero : rootMultiplicity 1 (transientPoly P) = 0 := by omega have hq : transientPoly P ≠ 0 := (mul_ne_zero_iff.mp hnz).2 intro hroot exact hq (Polynomial.rootMultiplicity_eq_zero_iff.mp hzero hroot)
CausalSmith.Stat.PomdpBinaryhiddenRate.transientPoly_eval_one_ne_zero · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/PairPolynomial.lean:239
theorem pairPoly_eval_one_ne_zero

The pair polynomial has a nonzero denominator at the stationary root. Under the listed formal conditions, the stated conclusion holds.

Formal statement
P P' :
pi pi' :
JointState 2 2 → ℝ
hpi :
IsStationary P pi
hpi' :
IsStationary P' pi'
alpha :
ℝ
hα :
alpha < 1
hδ :
dobrushin P ≤ alpha
hδ' :
dobrushin P' ≤ alpha
(pairPoly P P').eval 1 ≠ 0
Proof (Lean source)
-- @node: pairPoly_eval_one_ne_zero lemma pairPoly_eval_one_ne_zero (P P' : FourMatrix) (pi pi' : JointState 2 2 → ℝ) (hP : IsStochasticMatrix P) (hP' : IsStochasticMatrix P') (hpi : IsStationary P pi) (hpi' : IsStationary P' pi') {alpha : ℝ} (hα : alpha < 1) (hδ : dobrushin P ≤ alpha) (hδ' : dobrushin P' ≤ alpha) : (pairPoly P P').eval 1 ≠ 0 := by simpa [pairPoly, Polynomial.eval_mul] using mul_ne_zero (transientPoly_eval_one_ne_zero P pi hP hpi hα hδ) (transientPoly_eval_one_ne_zero P' pi' hP' hpi' hα hδ')
CausalSmith.Stat.PomdpBinaryhiddenRate.pairPoly_eval_one_ne_zero · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/PairPolynomial.lean:257
theorem transientPoly_aeval_projection

The transient polynomial is exactly the stationary rank-one projection. Under the listed formal conditions, the stated conclusion holds.

Formal statement
pi :
JointState 2 2 → ℝ
hpi :
IsStationary P pi
alpha :
ℝ
hα :
alpha < 1
hδ :
dobrushin P ≤ alpha
aeval P (transientPoly P) = fun _ j => (transientPoly P).eval 1 * pi j
Proof (Lean source)
-- @node: transientPoly_aeval_projection lemma transientPoly_aeval_projection (P : FourMatrix) (pi : JointState 2 2 → ℝ) (hP : IsStochasticMatrix P) (hpi : IsStationary P pi) {alpha : ℝ} (hα : alpha < 1) (hδ : dobrushin P ≤ alpha) : aeval P (transientPoly P) = fun _ j => (transientPoly P).eval 1 * pi j := by classical let A := aeval P (transientPoly P) have hPA : P * A = A := by have h := transientPoly_aeval_annihilated P hP rw [sub_mul, one_mul, sub_eq_zero] at h exact h have hleft := stationary_vecMul_aeval P pi hpi (transientPoly P) ext i j have hfixed : mulVec P (fun k => A k j) = fun k => A k j := by ext k exact congrFun (congrFun hPA k) j obtain ⟨c, hc⟩ := dobrushin_fixedVector_constant P hP hα hδ _ hfixed have hcol (k) : A k j = c := congrFun hc k have hcval : c = (transientPoly P).eval 1 * pi j := by have h := congrFun hleft j change (∑ k, pi k * A k j) = _ at h simp_rw [hcol] at h rw [← Finset.sum_mul, hpi.1.2, one_mul] at h exact h exact (hcol i).trans hcval
CausalSmith.Stat.PomdpBinaryhiddenRate.transientPoly_aeval_projection · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/PairPolynomial.lean:269

A stochastic matrix's transient characteristic factor is monic. Under the listed formal conditions, the stated conclusion holds.

Formal statement
Proof (Lean source)
-- @node: transientPoly_monic lemma transientPoly_monic (P : FourMatrix) (hP : IsStochasticMatrix P) : (transientPoly P).Monic := by apply (Polynomial.monic_X_sub_C (1 : ℝ)).of_mul_monic_left rw [stochastic_charpoly_factor P hP] exact Matrix.charpoly_monic P
CausalSmith.Stat.PomdpBinaryhiddenRate.transientPoly_monic · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/PairPolynomial.lean:297
theorem transientPoly_natDegree_three Lemma transientPoly_natDegree_three in the paper ↗

The four-state transient characteristic factor has degree three. the stated conclusion holds.

Formal statement
Proof (Lean source)
-- @node: transientPoly_natDegree_three lemma transientPoly_natDegree_three (P : FourMatrix) : (transientPoly P).natDegree = 3 := by change (charpoly P /ₘ (X - C 1)).natDegree = 3 rw [Polynomial.natDegree_divByMonic (charpoly P) (Polynomial.monic_X_sub_C (1 : ℝ)), Polynomial.natDegree_X_sub_C] simp [Matrix.charpoly_natDegree_eq_dim, JointState, Fintype.card_prod]
CausalSmith.Stat.PomdpBinaryhiddenRate.transientPoly_natDegree_three · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/PairPolynomial.lean:305

The product of stochastic transient factors is monic. Under the listed formal conditions, the stated conclusion holds.

Formal statement
Proof (Lean source)

The pair factor has exactly six roots counted with algebraic multiplicity. Under the listed formal conditions, the stated conclusion holds.

Formal statement
(pairPoly P P').natDegree = 6
Proof (Lean source)
-- @node: pairPoly_natDegree_six lemma pairPoly_natDegree_six (P P' : FourMatrix) (hP : IsStochasticMatrix P) (hP' : IsStochasticMatrix P') : (pairPoly P P').natDegree = 6 := by rw [pairPoly, Polynomial.natDegree_mul (transientPoly_monic P hP).ne_zero (transientPoly_monic P' hP').ne_zero, transientPoly_natDegree_three P, transientPoly_natDegree_three P']
CausalSmith.Stat.PomdpBinaryhiddenRate.pairPoly_natDegree_six · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/PairPolynomial.lean:321
theorem transientPoly_complex_root_norm_le

Transient roots exclude one and inherit the complex Dobrushin disk bound. Under the listed formal conditions, the stated conclusion holds.

Formal statement
pi :
JointState 2 2 → ℝ
hpi :
IsStationary P pi
alpha :
ℝ
hα :
alpha < 1
hδ :
dobrushin P ≤ alpha
z :
ℂ
hz :
z ∈ ((transientPoly P).map (algebraMap ℝ ℂ)).roots
‖z‖ ≤ alpha
Proof (Lean source)
-- @node: transientPoly_complex_root_norm_le lemma transientPoly_complex_root_norm_le (P : FourMatrix) (pi : JointState 2 2 → ℝ) (hP : IsStochasticMatrix P) (hpi : IsStationary P pi) {alpha : ℝ} (hα : alpha < 1) (hδ : dobrushin P ≤ alpha) {z : ℂ} (hz : z ∈ ((transientPoly P).map (algebraMap ℝ ℂ)).roots) : ‖z‖ ≤ alpha := by have hq : ((transientPoly P).map (algebraMap ℝ ℂ)).IsRoot z := Polynomial.isRoot_of_mem_roots hz have hne : z ≠ 1 := by intro heq subst z have hzero : (((transientPoly P).eval (1 : ℝ) : ℝ) : ℂ) = 0 := by simpa [IsRoot, Polynomial.eval_map] using hq exact transientPoly_eval_one_ne_zero P pi hP hpi hα hδ (Complex.ofReal_eq_zero.mp hzero) apply dobrushin_complex_charpoly_root_norm_le P hP hδ hne rw [← stochastic_charpoly_factor P hP, Polynomial.map_mul] simp only [IsRoot, Polynomial.eval_mul] at hq ⊢ rw [hq, mul_zero]
CausalSmith.Stat.PomdpBinaryhiddenRate.transientPoly_complex_root_norm_le · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/PairPolynomial.lean:330
theorem pairPoly_complex_roots_norm_le

Every root of the pair factor belongs to one of its two transient factors. Under the listed formal conditions, the stated conclusion holds.

Formal statement
P P' :
pi pi' :
JointState 2 2 → ℝ
hpi :
IsStationary P pi
hpi' :
IsStationary P' pi'
alpha :
ℝ
hα :
alpha < 1
hδ :
dobrushin P ≤ alpha
hδ' :
dobrushin P' ≤ alpha
z ∈ ((pairPoly P P').map (algebraMap ℝ ℂ)).roots :
‖z‖ ≤ alpha
Proof (Lean source)
-- @node: pairPoly_complex_roots_norm_le lemma pairPoly_complex_roots_norm_le (P P' : FourMatrix) (pi pi' : JointState 2 2 → ℝ) (hP : IsStochasticMatrix P) (hP' : IsStochasticMatrix P') (hpi : IsStationary P pi) (hpi' : IsStationary P' pi') {alpha : ℝ} (hα : alpha < 1) (hδ : dobrushin P ≤ alpha) (hδ' : dobrushin P' ≤ alpha) : ∀ z ∈ ((pairPoly P P').map (algebraMap ℝ ℂ)).roots, ‖z‖ ≤ alpha := by intro z hz have hnz : ((pairPoly P P').map (algebraMap ℝ ℂ)) ≠ 0 := ((pairPoly_monic P P' hP hP').map _).ne_zero rw [pairPoly, Polynomial.map_mul] at hz hnz rw [Polynomial.roots_mul hnz, Multiset.mem_add] at hz rcases hz with hz | hz · exact transientPoly_complex_root_norm_le P pi hP hpi hα hδ hz · exact transientPoly_complex_root_norm_le P' pi' hP' hpi' hα hδ' hz
CausalSmith.Stat.PomdpBinaryhiddenRate.pairPoly_complex_roots_norm_le · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/PairPolynomial.lean:351
theorem pairPoly_natDegree_lt_seven Lemma pairPoly_natDegree_lt_seven in the paper ↗

The pair factor has degree at most six on the four-state carrier. the stated conclusion holds.

Formal statement
P P' :
(pairPoly P P').natDegree < 7
Proof (Lean source)
-- @node: pairPoly_natDegree_lt_seven lemma pairPoly_natDegree_lt_seven (P P' : FourMatrix) : (pairPoly P P').natDegree < 7 := by have hdeg (R : FourMatrix) : (transientPoly R).natDegree = 3 := by change (charpoly R /ₘ (X - C 1)).natDegree = 3 rw [Polynomial.natDegree_divByMonic (charpoly R) (Polynomial.monic_X_sub_C (1 : ℝ)), Polynomial.natDegree_X_sub_C] simp [Matrix.charpoly_natDegree_eq_dim, JointState, Fintype.card_prod] have h := Polynomial.natDegree_mul_le (p := transientPoly P) (q := transientPoly P') rw [hdeg P, hdeg P'] at h exact lt_of_le_of_lt h (by norm_num)
CausalSmith.Stat.PomdpBinaryhiddenRate.pairPoly_natDegree_lt_seven · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/PairPolynomial.lean:367
theorem transientPoly_mul_aeval_projection

Multiplying by any other polynomial preserves the stationary projection. Under the listed formal conditions, the stated conclusion holds.

Formal statement
pi :
JointState 2 2 → ℝ
hpi :
IsStationary P pi
alpha :
ℝ
hα :
alpha < 1
hδ :
dobrushin P ≤ alpha
f :
aeval P (transientPoly P * f) = fun _ j => (transientPoly P * f).eval 1 * pi j
Proof (Lean source)
-- @node: transientPoly_mul_aeval_projection lemma transientPoly_mul_aeval_projection (P : FourMatrix) (pi : JointState 2 2 → ℝ) (hP : IsStochasticMatrix P) (hpi : IsStationary P pi) {alpha : ℝ} (hα : alpha < 1) (hδ : dobrushin P ≤ alpha) (f : Polynomial ℝ) : aeval P (transientPoly P * f) = fun _ j => (transientPoly P * f).eval 1 * pi j := by rw [map_mul, transientPoly_aeval_projection P pi hP hpi hα hδ] have hleft := stationary_vecMul_aeval P pi hpi f ext i j change (∑ k, ((transientPoly P).eval 1 * pi k) * (aeval P f) k j) = _ simp_rw [mul_assoc] rw [← Finset.mul_sum] change (transientPoly P).eval 1 * (vecMul pi (aeval P f)) j = _ rw [hleft] simp [mul_assoc]
CausalSmith.Stat.PomdpBinaryhiddenRate.transientPoly_mul_aeval_projection · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/PairPolynomial.lean:380
theorem polynomial_projection_value Lemma polynomial_projection_value in the paper ↗

Averaging the projection by any initial law gives the stationary value. Under the listed formal conditions, the stated conclusion holds.

Formal statement
nu pi r :
JointState 2 2 → ℝ
f :
hproj :
aeval P f = fun _ j => f.eval 1 * pi j
(∑ s, (vecMul nu (aeval P f)) s * r s) = f.eval 1 * matrixValue pi r
Proof (Lean source)
-- @node: polynomial_projection_value lemma polynomial_projection_value (nu pi r : JointState 2 2 → ℝ) (hnu : IsProbabilityVector nu) (f : Polynomial ℝ) (P : FourMatrix) (hproj : aeval P f = fun _ j => f.eval 1 * pi j) : (∑ s, (vecMul nu (aeval P f)) s * r s) = f.eval 1 * matrixValue pi r := by rw [hproj] simp only [vecMul, dotProduct] simp_rw [← Finset.sum_mul, hnu.2, one_mul, mul_assoc] exact (Finset.mul_sum _ _ _).symm
CausalSmith.Stat.PomdpBinaryhiddenRate.polynomial_projection_value · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/PairPolynomial.lean:398
theorem pairPolynomial_value_identity

The exact seven-moment identity follows without choosing an eigenbasis. Under the listed formal conditions, the stated conclusion holds.

Formal statement
P P' :
nu nu' pi pi' r r' :
JointState 2 2 → ℝ
alpha :
ℝ
hα :
alpha < 1
hnu' :
hpi :
IsStationary P pi
hpi' :
IsStationary P' pi'
hδ :
dobrushin P ≤ alpha
hδ' :
dobrushin P' ≤ alpha
(pairPoly P P').eval 1 * (matrixValue pi r - matrixValue pi' r')
= ∑ k : Fin 7, (pairPoly P P').coeff k.val * (matrixMoment nu P r k.val - matrixMoment nu' P' r' k.val)
Proof (Lean source)
-- @node: pairPolynomial_value_identity lemma pairPolynomial_value_identity (P P' : FourMatrix) (nu nu' pi pi' r r' : JointState 2 2 → ℝ) {alpha : ℝ} (hα : alpha < 1) (hP : IsStochasticMatrix P) (hP' : IsStochasticMatrix P') (hnu : IsProbabilityVector nu) (hnu' : IsProbabilityVector nu') (hpi : IsStationary P pi) (hpi' : IsStationary P' pi') (hδ : dobrushin P ≤ alpha) (hδ' : dobrushin P' ≤ alpha) : (pairPoly P P').eval 1 * (matrixValue pi r - matrixValue pi' r') = ∑ k : Fin 7, (pairPoly P P').coeff k.val * (matrixMoment nu P r k.val - matrixMoment nu' P' r' k.val) := by have hproj := transientPoly_mul_aeval_projection P pi hP hpi hα hδ (transientPoly P') have hproj' := transientPoly_mul_aeval_projection P' pi' hP' hpi' hα hδ' (transientPoly P) rw [mul_comm (transientPoly P') (transientPoly P)] at hproj' have hsum := matrixMoment_polynomial_sum nu r P (pairPoly P P') (pairPoly_natDegree_lt_seven P P') have hsum' := matrixMoment_polynomial_sum nu' r' P' (pairPoly P P') (pairPoly_natDegree_lt_seven P P') rw [polynomial_projection_value nu pi r hnu (pairPoly P P') P hproj] at hsum rw [polynomial_projection_value nu' pi' r' hnu' (pairPoly P P') P' hproj'] at hsum' rw [mul_sub, hsum, hsum', ← Finset.sum_sub_distrib] apply Finset.sum_congr rfl intro k _ exact (mul_sub _ _ _).symm
CausalSmith.Stat.PomdpBinaryhiddenRate.pairPolynomial_value_identity · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/PairPolynomial.lean:410
theorem pairPolynomial_value_coefficient_modulus

The exact identity transfers moment error with the actual polynomial coefficient ratio. Under the listed formal conditions, the stated conclusion holds.

Formal statement
P P' :
nu nu' pi pi' r r' :
JointState 2 2 → ℝ
alpha :
ℝ
hα :
alpha < 1
hnu' :
hpi :
IsStationary P pi
hpi' :
IsStationary P' pi'
hδ :
dobrushin P ≤ alpha
hδ' :
dobrushin P' ≤ alpha
|matrixValue pi r - matrixValue pi' r'|
≤ ((∑ k : Fin 7, |(pairPoly P P').coeff k.val|) / |(pairPoly P P').eval 1|) * (⨆ k : Fin 7, |matrixMoment nu P r k.val - matrixMoment nu' P' r' k.val|)
Proof (Lean source)
-- @node: pairPolynomial_value_coefficient_modulus lemma pairPolynomial_value_coefficient_modulus (P P' : FourMatrix) (nu nu' pi pi' r r' : JointState 2 2 → ℝ) {alpha : ℝ} (hα : alpha < 1) (hP : IsStochasticMatrix P) (hP' : IsStochasticMatrix P') (hnu : IsProbabilityVector nu) (hnu' : IsProbabilityVector nu') (hpi : IsStationary P pi) (hpi' : IsStationary P' pi') (hδ : dobrushin P ≤ alpha) (hδ' : dobrushin P' ≤ alpha) : |matrixValue pi r - matrixValue pi' r'| ≤ ((∑ k : Fin 7, |(pairPoly P P').coeff k.val|) / |(pairPoly P P').eval 1|) * (⨆ k : Fin 7, |matrixMoment nu P r k.val - matrixMoment nu' P' r' k.val|) := by classical let err := fun k : Fin 7 => |matrixMoment nu P r k.val - matrixMoment nu' P' r' k.val| have hidentity := pairPolynomial_value_identity P P' nu nu' pi pi' r r' hα hP hP' hnu hnu' hpi hpi' hδ hδ' have hweighted : |(pairPoly P P').eval 1| * |matrixValue pi r - matrixValue pi' r'| ≤ (∑ k : Fin 7, |(pairPoly P P').coeff k.val|) * (⨆ k, err k) := by calc _ = |(pairPoly P P').eval 1 * (matrixValue pi r - matrixValue pi' r')| := (abs_mul _ _).symm _ = |∑ k : Fin 7, (pairPoly P P').coeff k.val * (matrixMoment nu P r k.val - matrixMoment nu' P' r' k.val)| := congrArg abs hidentity _ ≤ ∑ k : Fin 7, |(pairPoly P P').coeff k.val * (matrixMoment nu P r k.val - matrixMoment nu' P' r' k.val)| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ k : Fin 7, |(pairPoly P P').coeff k.val| * (⨆ j, err j) := by apply Finset.sum_le_sum intro k _ rw [abs_mul] exact mul_le_mul_of_nonneg_left (le_ciSup (Finite.bddAbove_range err) k) (abs_nonneg _) _ = _ := (Finset.sum_mul _ _ _).symm have hpos : 0 < |(pairPoly P P').eval 1| := abs_pos.mpr (pairPoly_eval_one_ne_zero P P' pi pi' hP hP' hpi hpi' hα hδ hδ') rw [div_mul_eq_mul_div] apply (le_div_iff₀ hpos).mpr simpa only [mul_comm] using hweighted
CausalSmith.Stat.PomdpBinaryhiddenRate.pairPolynomial_value_coefficient_modulus · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/PairPolynomial.lean:437
theorem pairPolynomial_value_modulus

Exact pair-polynomial identity and seven-moment modulus, including defective and complex transient modes. Under the listed formal conditions, the stated conclusion holds.

Formal statement
P P' :
nu nu' pi pi' r r' :
JointState 2 2 → ℝ
alpha :
ℝ
hα0 :
0 < alpha
hα1 :
alpha < 1
hν' :
hπ :
IsStationary P pi
hπ' :
IsStationary P' pi'
hr :
∀ s, r s ∈ Icc (0 : ℝ) 1
hr' :
∀ s, r' s ∈ Icc (0 : ℝ) 1
hδ :
dobrushin P ≤ alpha
hδ' :
dobrushin P' ≤ alpha
conclusion 1
conclusion 2
conclusion 3
(pairPoly P P').eval 1 * (matrixValue pi r - matrixValue pi' r')
= ∑ k : Fin 7, (pairPoly P P').coeff k.val * (matrixMoment nu P r k.val - matrixMoment nu' P' r' k.val)
conclusion 4
|matrixValue pi r - matrixValue pi' r'|
≤ stabilityFactor alpha * (⨆ k : Fin 7, |matrixMoment nu P r k.val - matrixMoment nu' P' r' k.val|)
Proof (Lean source)
lemma pairPolynomial_value_modulus (P P' : FourMatrix) (nu nu' pi pi' r r' : JointState 2 2 → ℝ) (alpha : ℝ) (hα0 : 0 < alpha) (hα1 : alpha < 1) (hP : IsStochasticMatrix P) (hP' : IsStochasticMatrix P') (hν : IsProbabilityVector nu) (hν' : IsProbabilityVector nu') (hπ : IsStationary P pi) (hπ' : IsStationary P' pi') (hr : ∀ s, r s ∈ Icc (0 : ℝ) 1) (hr' : ∀ s, r' s ∈ Icc (0 : ℝ) 1) (hδ : dobrushin P ≤ alpha) (hδ' : dobrushin P' ≤ alpha) : rootMultiplicity 1 (charpoly P) = 1 ∧ rootMultiplicity 1 (charpoly P') = 1 ∧ (pairPoly P P').eval 1 * (matrixValue pi r - matrixValue pi' r') = ∑ k : Fin 7, (pairPoly P P').coeff k.val * (matrixMoment nu P r k.val - matrixMoment nu' P' r' k.val) ∧ |matrixValue pi r - matrixValue pi' r'| ≤ stabilityFactor alpha * (⨆ k : Fin 7, |matrixMoment nu P r k.val - matrixMoment nu' P' r' k.val|) := by have hidentity := pairPolynomial_value_identity P P' nu nu' pi pi' r r' hα1 hP hP' hν hν' hπ hπ' hδ hδ' have hsimp := dobrushin_charpoly_rootMultiplicity_one P pi hP hπ hα1 hδ have hsimp' := dobrushin_charpoly_rootMultiplicity_one P' pi' hP' hπ' hα1 hδ' refine ⟨hsimp, hsimp', hidentity, ?_⟩ have hdata := pairPolynomial_value_coefficient_modulus P P' nu nu' pi pi' r r' hα1 hP hP' hν hν' hπ hπ' hδ hδ' have hcoeff : (∑ k : Fin 7, |(pairPoly P P').coeff k.val|) / |(pairPoly P P').eval 1| ≤ stabilityFactor alpha := by have hroots : ∀ z ∈ ((pairPoly P P').map (algebraMap ℝ ℂ)).roots, ‖z‖ ≤ alpha := by exact pairPoly_complex_roots_norm_le P P' pi pi' hP hP' hπ hπ' hα1 hδ hδ' exact degreeSix_coefficient_ratio_le_of_roots_le (pairPoly P P') alpha (pairPoly_monic P P' hP hP') (pairPoly_natDegree_six P P' hP hP') hα1 hroots have hmax0 : 0 ≤ (⨆ k : Fin 7, |matrixMoment nu P r k.val - matrixMoment nu' P' r' k.val|) := by exact (abs_nonneg (matrixMoment nu P r 0 - matrixMoment nu' P' r' 0)).trans (le_ciSup (f := fun k : Fin 7 => |matrixMoment nu P r k.val - matrixMoment nu' P' r' k.val|) (Finite.bddAbove_range _) (0 : Fin 7)) exact hdata.trans (mul_le_mul_of_nonneg_right hcoeff hmax0)
CausalSmith.Stat.PomdpBinaryhiddenRate.pairPolynomial_value_modulus · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/PairPolynomial.lean:478
CausalSmith.Stat.STAT_PomdpBinaryhiddenRate_Research.Helpers.PairPolynomialBounds 4 declarations Coefficient and evaluation bounds for a monic degree-six polynomial whose complex roots lie in a disk of radius less than one, counted with algebraic multiplicity.

Root-based polynomial stability estimates

Coefficient and evaluation bounds for a monic degree-six polynomial whose complex roots lie in a disk of radius less than one, counted with algebraic multiplicity.

theorem degreeSix_coeff_sum_le_of_roots_le Lemma degreeSix_coeff_sum_le_of_roots_le in the paper ↗

Bounded complex roots control the sum of the seven real coefficients. Under the listed formal conditions, the stated conclusion holds.

Formal statement
p :
alpha :
ℝ
hm :
p.Monic
hd :
p.natDegree = 6
hr :
∀ z ∈ (p.map (algebraMap ℝ ℂ)).roots, ‖z‖ ≤ alpha
(∑ k : Fin 7, |p.coeff k.val|) ≤ (1 + alpha) ^ 6
Proof (Lean source)
-- @node: degreeSix_coeff_sum_le_of_roots_le lemma degreeSix_coeff_sum_le_of_roots_le (p : Polynomial ℝ) (alpha : ℝ) (hm : p.Monic) (hd : p.natDegree = 6) (hr : ∀ z ∈ (p.map (algebraMap ℝ ℂ)).roots, ‖z‖ ≤ alpha) : (∑ k : Fin 7, |p.coeff k.val|) ≤ (1 + alpha) ^ 6 := by have hc (k : Fin 7) : |p.coeff k.val| ≤ alpha ^ (6 - k.val) * (choose 6 k.val : ℝ) := by have h := Polynomial.coeff_le_of_roots_le k.val hm (IsAlgClosed.splits (p.map (algebraMap ℝ ℂ))) hr simpa [hd] using h calc _ ≤ ∑ k : Fin 7, alpha ^ (6 - k.val) * (choose 6 k.val : ℝ) := Finset.sum_le_sum fun k _ => hc k _ = (1 + alpha) ^ 6 := by simp [Fin.sum_univ_succ, choose] ring
CausalSmith.Stat.PomdpBinaryhiddenRate.degreeSix_coeff_sum_le_of_roots_le · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/PairPolynomialBounds.lean:19
theorem roots_distance_prod_lower Lemma roots_distance_prod_lower in the paper ↗

A root disk below one gives a lower bound on a product of distances to one. Under the listed formal conditions, the stated conclusion holds.

Formal statement
s :
alpha :
ℝ
hα :
alpha < 1
hr :
∀ z ∈ s, ‖z‖ ≤ alpha
(1 - alpha) ^ s.card ≤ ‖(s.map (fun z => 1 - z)).prod‖
Proof (Lean source)
-- @node: roots_distance_prod_lower lemma roots_distance_prod_lower (s : Multiset ℂ) (alpha : ℝ) (hα : alpha < 1) (hr : ∀ z ∈ s, ‖z‖ ≤ alpha) : (1 - alpha) ^ s.card ≤ ‖(s.map (fun z => 1 - z)).prod‖ := by induction s using Multiset.induction_on with | empty => simp | @cons z s ih => have hz := hr z (by simp) have hs := ih (fun w hw => hr w (by simp [hw])) have hdist : 1 - alpha ≤ ‖(1 : ℂ) - z‖ := by have h := norm_sub_norm_le (1 : ℂ) z simp only [norm_one] at h linarith simpa [pow_succ, mul_comm] using mul_le_mul hdist hs (by positivity) (norm_nonneg _)
CausalSmith.Stat.PomdpBinaryhiddenRate.roots_distance_prod_lower · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/PairPolynomialBounds.lean:37
theorem degreeSix_eval_one_lower_of_roots_le Lemma degreeSix_eval_one_lower_of_roots_le in the paper ↗

The degree-six monic factor is bounded away from zero at one. Under the listed formal conditions, the stated conclusion holds.

Formal statement
p :
alpha :
ℝ
hm :
p.Monic
hd :
p.natDegree = 6
hα :
alpha < 1
hr :
∀ z ∈ (p.map (algebraMap ℝ ℂ)).roots, ‖z‖ ≤ alpha
(1 - alpha) ^ 6 ≤ |p.eval 1|
Proof (Lean source)
-- @node: degreeSix_eval_one_lower_of_roots_le lemma degreeSix_eval_one_lower_of_roots_le (p : Polynomial ℝ) (alpha : ℝ) (hm : p.Monic) (hd : p.natDegree = 6) (hα : alpha < 1) (hr : ∀ z ∈ (p.map (algebraMap ℝ ℂ)).roots, ‖z‖ ≤ alpha) : (1 - alpha) ^ 6 ≤ |p.eval 1| := by let q := p.map (algebraMap ℝ ℂ) have hsplit : q.Splits := IsAlgClosed.splits q have hcard : q.roots.card = 6 := by rw [← hsplit.natDegree_eq_card_roots, hm.natDegree_map, hd] have h := roots_distance_prod_lower q.roots alpha hα hr rw [hcard, ← hsplit.eval_eq_prod_roots_of_monic (hm.map _) 1] at h simpa [q, Polynomial.eval_map] using h
CausalSmith.Stat.PomdpBinaryhiddenRate.degreeSix_eval_one_lower_of_roots_le · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/PairPolynomialBounds.lean:54
theorem degreeSix_coefficient_ratio_le_of_roots_le

The two root estimates yield the sharp seven-coefficient stability ratio. Under the listed formal conditions, the stated conclusion holds.

Formal statement
p :
alpha :
ℝ
hm :
p.Monic
hd :
p.natDegree = 6
hα :
alpha < 1
hr :
∀ z ∈ (p.map (algebraMap ℝ ℂ)).roots, ‖z‖ ≤ alpha
(∑ k : Fin 7, |p.coeff k.val|) / |p.eval 1| ≤ stabilityFactor alpha
Proof (Lean source)
-- @node: degreeSix_coefficient_ratio_le_of_roots_le lemma degreeSix_coefficient_ratio_le_of_roots_le (p : Polynomial ℝ) (alpha : ℝ) (hm : p.Monic) (hd : p.natDegree = 6) (hα : alpha < 1) (hr : ∀ z ∈ (p.map (algebraMap ℝ ℂ)).roots, ‖z‖ ≤ alpha) : (∑ k : Fin 7, |p.coeff k.val|) / |p.eval 1| ≤ stabilityFactor alpha := by have hnum := degreeSix_coeff_sum_le_of_roots_le p alpha hm hd hr have hden := degreeSix_eval_one_lower_of_roots_le p alpha hm hd hα hr have hpos : 0 < (1 - alpha) ^ 6 := pow_pos (by linarith) _ calc _ ≤ (1 + alpha) ^ 6 / (1 - alpha) ^ 6 := div_le_div₀ (by positivity) hnum hpos hden _ = stabilityFactor alpha := by rw [stabilityFactor, div_pow]
CausalSmith.Stat.PomdpBinaryhiddenRate.degreeSix_coefficient_ratio_le_of_roots_le · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/PairPolynomialBounds.lean:68
CausalSmith.Stat.STAT_PomdpBinaryhiddenRate_Research.Helpers.ScoreMoments 7 declarations Kernel reward support gives almost-sure unit rewards.

Likelihood-weighted score moments

Kernel reward support gives almost-sure unit rewards. The finite-history likelihood cancellation bounds first and second score moments, even when behavior action cells vanish. These bounds do not require stationarity.

theorem pomdp_reward_mem_Icc_ae

The kernel reward support transfers to every sampled reward coordinate. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
M :
t :
Fin T
∀ᵐ tau ∂M.law, rewardAt t tau ∈ Icc (0 : ℝ) 1
Proof (Lean source)
-- @node: pomdp_reward_mem_Icc_ae lemma pomdp_reward_mem_Icc_ae {T : Nat} (M : RawPomdpExperiment T 2 2) (hK : PomdpKernelLaw M) (t : Fin T) : ∀ᵐ tau ∂M.law, rewardAt t tau ∈ Icc (0 : ℝ) 1 := by have hm : Measurable (histNextPair (nX := 2) (nH := 2) t) := by unfold histNextPair histView histActionPair histStateView curState actionAt rewardAt nextState fun_prop have hp : MeasurableSet {h : ActionHistoryView T 2 2 t × Step 2 2 | h.2.1 ∈ Icc (0 : ℝ) 1} := by exact (measurable_fst.comp measurable_snd) measurableSet_Icc apply (ae_map_iff hm.aemeasurable hp).mp rw [hK.2.2 t] apply Measure.ae_compProd_of_ae_ae hp apply Filter.Eventually.of_forall intro h change ∀ᵐ q ∂M.K h.1.2 h.2, q.1 ∈ Icc (0 : ℝ) 1 let := hK.1 h.1.2 h.2 exact (mem_ae_iff_prob_eq_one (measurable_fst measurableSet_Icc)).mpr (hK.2.1 _ _)
CausalSmith.Stat.PomdpBinaryhiddenRate.pomdp_reward_mem_Icc_ae · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/ScoreMoments.lean:20
theorem pomdp_reward_integrable

Bounded kernel rewards are integrable under the trajectory probability law. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
M :
t :
Fin T
Proof (Lean source)
-- @node: pomdp_reward_integrable lemma pomdp_reward_integrable {T : Nat} (M : RawPomdpExperiment T 2 2) (hK : PomdpKernelLaw M) (t : Fin T) : Integrable (rewardAt t) M.law := by apply (integrable_const (1 : ℝ)).mono' (by unfold rewardAt; fun_prop) filter_upwards [pomdp_reward_mem_Icc_ae M hK t] with tau ht simpa only [Real.norm_eq_abs, abs_of_nonneg ht.1] using ht.2
CausalSmith.Stat.PomdpBinaryhiddenRate.pomdp_reward_integrable · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/ScoreMoments.lean:41
def finitePomdpView

View the same trajectory experiment in the general finite POMDP carrier.

Definition (Lean source)
T :
M :
finitePomdpView M :
CausalSmith.Stat.PomdpLatentOverlapMinimax.RawPomdpExperiment T 2 2
{ K := M.K, b := M.b, e := M.e, init := M.init, law := M.law, law_isProbability := M.law_isProbability }
CausalSmith.Stat.PomdpBinaryhiddenRate.finitePomdpView · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/ScoreMoments.lean:50
theorem finitePomdpView_laws

The general finite-history law conditions follow from the binary law conditions; the stronger kernel reward support supplies its reward premise. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
M :
L :
ℝ
hO :
conclusion 1
CausalSmith.Stat.PomdpLatentOverlapMinimax.PomdpKernelLaw (finitePomdpView M)
conclusion 2
CausalSmith.Stat.PomdpLatentOverlapMinimax.SequentialIgnorability (finitePomdpView M)
conclusion 3
CausalSmith.Stat.PomdpLatentOverlapMinimax.PolicyOverlap L (finitePomdpView M)
conclusion 4
CausalSmith.Stat.PomdpLatentOverlapMinimax.BoundedReward (finitePomdpView M)
Proof (Lean source)
-- @node: finitePomdpView_laws lemma finitePomdpView_laws {T : Nat} (M : RawPomdpExperiment T 2 2) (hK : PomdpKernelLaw M) (hI : SequentialIgnorability M) {L : ℝ} (hO : PolicyOverlap L M) : CausalSmith.Stat.PomdpLatentOverlapMinimax.PomdpKernelLaw (finitePomdpView M) ∧ CausalSmith.Stat.PomdpLatentOverlapMinimax.SequentialIgnorability (finitePomdpView M) ∧ CausalSmith.Stat.PomdpLatentOverlapMinimax.PolicyOverlap L (finitePomdpView M) ∧ CausalSmith.Stat.PomdpLatentOverlapMinimax.BoundedReward (finitePomdpView M) := by refine ⟨⟨hK.1, hK.2.2⟩, hI, hO, ?_⟩ intro t apply (mem_ae_iff_prob_eq_one (measurableSet_le (by unfold CausalSmith.Stat.PomdpLatentOverlapMinimax.rewardAt; fun_prop) measurable_const)).mp filter_upwards [pomdp_reward_mem_Icc_ae M hK t] with tau ht change |rewardAt t tau| ≤ 1 rw [abs_of_nonneg ht.1] exact ht.2
CausalSmith.Stat.PomdpBinaryhiddenRate.finitePomdpView_laws · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/ScoreMoments.lean:57

The observed score has the same definition in the general finite-history carrier. the stated conclusion holds.

Formal statement
T :
k :
b e :
w :
t :
Fin T
score k b e w t = CausalSmith.Stat.PomdpLatentOverlapMinimax.phiwScore k b e w t
Proof (Lean source)
-- @node: score_eq_phiwScore lemma score_eq_phiwScore {T : Nat} (k : Nat) (b e : Policy 2) (w : ObsView T 2) (t : Fin T) : score k b e w t = CausalSmith.Stat.PomdpLatentOverlapMinimax.phiwScore k b e w t := rfl
CausalSmith.Stat.PomdpBinaryhiddenRate.score_eq_phiwScore · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/ScoreMoments.lean:77
theorem score_abs_first_moment_le_one

Likelihood cancellation bounds the absolute first moment by one. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T k :
L :
ℝ
M :
hO :
hL :
1 ≤ L
t :
Fin T
htk :
k ≤ t.val
(∫ tau, |score k M.b M.e (obsProj tau) t| ∂M.law) ≤ 1
Proof (Lean source)
-- @node: score_abs_first_moment_le_one lemma score_abs_first_moment_le_one {T k : Nat} {L : ℝ} (M : RawPomdpExperiment T 2 2) (hK : PomdpKernelLaw M) (hI : SequentialIgnorability M) (hO : PolicyOverlap L M) (hL : 1 ≤ L) (t : Fin T) (htk : k ≤ t.val) : (∫ tau, |score k M.b M.e (obsProj tau) t| ∂M.law) ≤ 1 := by obtain ⟨hK', hI', hO', hY'⟩ := finitePomdpView_laws M hK hI hO have h := CausalSmith.Stat.PomdpLatentOverlapMinimax.integral_abs_phiwScore_le_one hI' hO' hL hK' hY' t htk simp only [finitePomdpView] at h rw [CausalSmith.Stat.PomdpLatentOverlapMinimax.obsLaw, integral_map (μ := M.law) (f := fun w => |CausalSmith.Stat.PomdpLatentOverlapMinimax.phiwScore k M.b M.e w t|) CausalSmith.Stat.PomdpLatentOverlapMinimax.measurable_obsProj.aemeasurable (continuous_abs.measurable.comp (CausalSmith.Stat.PomdpLatentOverlapMinimax.phiwScore_measurable (k := k) M.b M.e t)).aestronglyMeasurable] at h exact h
CausalSmith.Stat.PomdpBinaryhiddenRate.score_abs_first_moment_le_one · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/ScoreMoments.lean:84
theorem score_second_moment_le

Squaring a score costs one overlap factor per action, since the other likelihood-ratio product integrates to one under sequential randomization. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T k :
L :
ℝ
M :
hO :
hL :
1 ≤ L
t :
Fin T
htk :
k ≤ t.val
(∫ tau, (score k M.b M.e (obsProj tau) t) ^ 2 ∂M.law) ≤ L ^ (k + 1)
Proof (Lean source)
-- @node: score_second_moment_le lemma score_second_moment_le {T k : Nat} {L : ℝ} (M : RawPomdpExperiment T 2 2) (hK : PomdpKernelLaw M) (hI : SequentialIgnorability M) (hO : PolicyOverlap L M) (hL : 1 ≤ L) (t : Fin T) (htk : k ≤ t.val) : (∫ tau, (score k M.b M.e (obsProj tau) t) ^ 2 ∂M.law) ≤ L ^ (k + 1) := by obtain ⟨hK', hI', hO', hY'⟩ := finitePomdpView_laws M hK hI hO have h := CausalSmith.Stat.PomdpLatentOverlapMinimax.integral_sq_phiwScore_le hI' hO' hL hK' hY' t htk simp only [finitePomdpView] at h rw [CausalSmith.Stat.PomdpLatentOverlapMinimax.obsLaw, integral_map CausalSmith.Stat.PomdpLatentOverlapMinimax.measurable_obsProj.aemeasurable ((CausalSmith.Stat.PomdpLatentOverlapMinimax.phiwScore_measurable (k := k) M.b M.e t).pow_const 2).aestronglyMeasurable] at h exact h
CausalSmith.Stat.PomdpBinaryhiddenRate.score_second_moment_le · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/ScoreMoments.lean:104
CausalSmith.Stat.STAT_PomdpBinaryhiddenRate_Research.Helpers.TestingFamily 1 declarations Assemble the positive testing pair and its observed-data divergence bound.

Testing-family membership and separation

Assemble the positive testing pair and its observed-data divergence bound.

theorem testingFamily_membership

Both testing laws satisfy all six model conditions, have exact target separation, and are close after projection to observed data. Their policies coincide and their stationary joint-state laws coincide. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
t0 zeta :
ℝ
ht0 :
0 < t0
hzeta :
0 ≤ zeta
hT :
12 ≤ T
Mp :
Mm :
BinaryPomdpClass t0 zeta Mp
BinaryPomdpClass t0 zeta Mm
|targetValue Mp - targetValue Mm| = 1 / (8 * sqrt T)
klDiv (obsLaw Mp) (obsLaw Mm) ≠ ⊤
(klDiv (obsLaw Mp) (obsLaw Mm)).toReal ≤ 1 / 12
Mp.e = Mp.b
Mm.e = Mm.b
C :
ℝ
1 < C
s :
stationaryLaw (policyKernel Mp Mp.e) s ≤ C * stationaryLaw (policyKernel Mp Mp.b) s
stationaryLaw (policyKernel Mm Mm.e) s ≤ C * stationaryLaw (policyKernel Mm Mm.b) s
Proof (Lean source)
lemma testingFamily_membership (T : Nat) (t0 zeta : ℝ) (ht0 : 0 < t0) (hzeta : 0 ≤ zeta) (hT : 12 ≤ T) : let Mp := testingExperiment T (vT T) (inl rfl) (vT_bound T hT) let Mm := testingExperiment T (-(vT T)) (inr rfl) (neg_vT_bound T hT) BinaryPomdpClass t0 zeta Mp ∧ BinaryPomdpClass t0 zeta Mm ∧ |targetValue Mp - targetValue Mm| = 1 / (8 * sqrt T) ∧ klDiv (obsLaw Mp) (obsLaw Mm) ≠ ⊤ ∧ (klDiv (obsLaw Mp) (obsLaw Mm)).toReal ≤ 1 / 12 ∧ Mp.e = Mp.b ∧ Mm.e = Mm.b ∧ stationaryLaw (policyKernel Mp Mp.e) = stationaryLaw (policyKernel Mp Mp.b) ∧ stationaryLaw (policyKernel Mm Mm.e) = stationaryLaw (policyKernel Mm Mm.b) ∧ (∀ C : ℝ, 1 < C → ∀ s, stationaryLaw (policyKernel Mp Mp.e) s ≤ C * stationaryLaw (policyKernel Mp Mp.b) s ∧ stationaryLaw (policyKernel Mm Mm.e) s ≤ C * stationaryLaw (policyKernel Mm Mm.b) s) := by dsimp have hMp : BinaryPomdpClass t0 zeta (testingExperiment T (vT T) (inl rfl) (vT_bound T hT)) := by exact testingExperiment_class_of_history T t0 zeta (vT T) ht0 hzeta (inl rfl) (vT_bound T hT) have hMm : BinaryPomdpClass t0 zeta (testingExperiment T (-(vT T)) (inr rfl) (neg_vT_bound T hT)) := by exact testingExperiment_class_of_history T t0 zeta (-(vT T)) ht0 hzeta (inr rfl) (neg_vT_bound T hT) refine ⟨?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ · exact hMp · exact hMm · have hSp : IsStationary (policyKernel (testingExperiment T (vT T) (inl rfl) (vT_bound T hT)) (testingExperiment T (vT T) (inl rfl) (vT_bound T hT)).e) (stationaryLaw (policyKernel (testingExperiment T (vT T) (inl rfl) (vT_bound T hT)) (testingExperiment T (vT T) (inl rfl) (vT_bound T hT)).e)) := by exact stationaryLaw_isStationary_of_exists ⟨testingNextStateMass, testingExperiment_stationary T (vT T) (inl rfl) (vT_bound T hT)⟩ have hSm : IsStationary (policyKernel (testingExperiment T (-(vT T)) (inr rfl) (neg_vT_bound T hT)) (testingExperiment T (-(vT T)) (inr rfl) (neg_vT_bound T hT)).e) (stationaryLaw (policyKernel (testingExperiment T (-(vT T)) (inr rfl) (neg_vT_bound T hT)) (testingExperiment T (-(vT T)) (inr rfl) (neg_vT_bound T hT)).e)) := by exact stationaryLaw_isStationary_of_exists ⟨testingNextStateMass, testingExperiment_stationary T (-(vT T)) (inr rfl) (neg_vT_bound T hT)⟩ rw [testingExperiment_targetValue_eq T (vT T) (inl rfl) (vT_bound T hT) hSp, testingExperiment_targetValue_eq T (-(vT T)) (inr rfl) (neg_vT_bound T hT) hSm] have hsqrt : 0 < sqrt T := Real.sqrt_pos.2 (by exact_mod_cast (by omega : 0 < T)) have hvnonneg : 0 ≤ vT T := by unfold vT; positivity rw [show (1 / 2 + vT T) - (1 / 2 + -(vT T)) = 2 * vT T by ring, abs_of_nonneg (mul_nonneg (by norm_num) hvnonneg)] unfold vT field_simp <;> ring · exact testingObservedLaw_klDiv_ne_top T (vT T) (-(vT T)) (inl rfl) (vT_bound T hT) (inr rfl) (neg_vT_bound T hT) · have hbound := testingObservedLaw_klDiv_le T (vT T) (-(vT T)) (inl rfl) (vT_bound T hT) (inr rfl) (neg_vT_bound T hT) have hsqrt : 0 < sqrt T := Real.sqrt_pos.2 (by exact_mod_cast (by omega : 0 < T)) have hsquare : (sqrt (T : ℝ)) ^ 2 = T := Real.sq_sqrt (Nat.cast_nonneg T) have hbudget : (T : ℝ) * (4 * (vT T - -(vT T)) ^ 2) = 1 / 16 := by unfold vT field_simp nlinarith [hsquare] rw [hbudget] at hbound have hreal := ENNReal.toReal_mono (by simp : ofReal (1 / 16 : ℝ) ≠ ⊤) hbound calc _ ≤ (1 / 16 : ℝ) := by simpa using hreal _ ≤ 1 / 12 := by norm_num · rfl · rfl · rfl · rfl · intro C hC s constructor · exact coincidentPolicy_occupancy_bound _ hMp.stationary_start rfl C hC s · exact coincidentPolicy_occupancy_bound _ hMm.stationary_start rfl C hC s
CausalSmith.Stat.PomdpBinaryhiddenRate.testingFamily_membership · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingFamily.lean:18
CausalSmith.Stat.STAT_PomdpBinaryhiddenRate_Research.Helpers.TestingFamilyBasics 5 declarations History factorization, class membership, and positivity of the testing laws.

Testing family membership

History factorization, class membership, and positivity of the testing laws.

theorem testingExperiment_historyConditions

The finite path weights realize the conditional reward/transition law, fair-action assignment, and stationary initial state. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
v :
ℝ
hvFamily :
v = vT T ∨ v = -(vT T)
hv :
|v| ≤ 1 / 16
Proof (Lean source)
-- @node: testingExperiment_historyConditions lemma testingExperiment_historyConditions (T : Nat) (v : ℝ) (hvFamily : v = vT T ∨ v = -(vT T)) (hv : |v| ≤ 1 / 16) : let M := testingExperiment T v hvFamily hv PomdpKernelLaw M ∧ SequentialIgnorability M ∧ StationaryStart M := by dsimp constructor · refine ⟨testingKernel_probability v hv, testingKernel_rewardSupport v hv, ?_⟩ exact testingExperiment_kernelHistory T v hvFamily hv constructor · constructor · intro x constructor · intro a change 0 ≤ (1 / 2 : ℝ) norm_num · change (∑ _a : Bool, (1 / 2 : ℝ)) = 1 simp · exact testingExperiment_actionHistory T v hvFamily hv · constructor · exact stationaryLaw_isStationary_of_exists ⟨testingNextStateMass, testingExperiment_stationary T v hvFamily hv⟩ · intro s have hS : IsStationary (policyKernel (testingExperiment T v hvFamily hv) (testingExperiment T v hvFamily hv).e) (stationaryLaw (policyKernel (testingExperiment T v hvFamily hv) (testingExperiment T v hvFamily hv).e)) := stationaryLaw_isStationary_of_exists ⟨testingNextStateMass, testingExperiment_stationary T v hvFamily hv⟩ have hbe : (testingExperiment T v hvFamily hv).b = (testingExperiment T v hvFamily hv).e := rfl rw [hbe, testingExperiment_stationaryLaw_eq T v hvFamily hv hS] have hmass : testingNextStateMass s = (1 / 2 : ℝ) * testingEmission s.1 s.2 := by rcases s with ⟨x, h⟩ fin_cases x <;> fin_cases h <;> norm_num [testingNextStateMass, testingHiddenProb, testingEmission] rw [hmass] change ((testingTrajectoryLaw T v).map (stateAt (T := T) (nX := 2) (nH := 2) 0)) {s} = _ rw [Measure.map_apply (by unfold stateAt; fun_prop) (MeasurableSet.singleton s)] simp only [testingTrajectoryLaw, MeasureTheory.Measure.finsetSum_apply, MeasureTheory.Measure.smul_apply, MeasureTheory.Measure.dirac_apply] simp only [indicator, Set.mem_preimage, Set.mem_singleton_iff, stateAt, decodeTestingPath, Pi.one_apply, smul_eq_mul] conv_lhs => arg 2 ext c rw [show ofReal (testingPathWeight v c) * (if c.1 0 = s then (1 : ENNReal) else 0) = ofReal (if c.1 0 = s then testingPathWeight v c else 0) by split_ifs <;> simp] rw [← ENNReal.ofReal_sum_of_nonneg] · rw [testingPathWeight_initial_sum] · intro c _ split_ifs · exact testingPathWeight_nonneg v hv c · exact le_refl _
CausalSmith.Stat.PomdpBinaryhiddenRate.testingExperiment_historyConditions · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingFamilyBasics.lean:16
theorem testingExperiment_class_of_history

The explicit testing laws meet the remaining overlap and contraction conditions once their finite-history factorization is established. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
t0 zeta v :
ℝ
ht0 :
0 < t0
hzeta :
0 ≤ zeta
hvFamily :
v = vT T ∨ v = -(vT T)
hv :
|v| ≤ 1 / 16
BinaryPomdpClass t0 zeta (testingExperiment T v hvFamily hv)
Proof (Lean source)
lemma testingExperiment_class_of_history (T : Nat) (t0 zeta v : ℝ) (ht0 : 0 < t0) (hzeta : 0 ≤ zeta) (hvFamily : v = vT T ∨ v = -(vT T)) (hv : |v| ≤ 1 / 16) : BinaryPomdpClass t0 zeta (testingExperiment T v hvFamily hv) := by rcases testingExperiment_historyConditions T v hvFamily hv with ⟨hK, hI, hS⟩ have hAlpha : 0 ≤ mixingAlpha t0 := by unfold mixingAlpha exact (Real.exp_pos _).le have hContract := testingExperiment_contraction T v hvFamily hv (mixingAlpha t0) hAlpha exact { t0_pos := ht0 zeta_nonneg := hzeta pomdp_kernel := hK sequential_ignorability := hI stationary_start := hS policy_overlap := testingExperiment_policyOverlap T v zeta hvFamily hv hzeta behavior_contraction := hContract.1 target_contraction := hContract.2 }
CausalSmith.Stat.PomdpBinaryhiddenRate.testingExperiment_class_of_history · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingFamilyBasics.lean:79

Every testing path has strictly positive mass throughout the perturbation range. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
v :
ℝ
hv :
|v| ≤ 1 / 16
c :
Proof (Lean source)
-- @node: testingPathWeight_pos lemma testingPathWeight_pos {T : Nat} (v : ℝ) (hv : |v| ≤ 1 / 16) (c : TestingPath T) : 0 < testingPathWeight v c := by have hreward (h : Fin 2) : 0 < testingRewardProb v h ∧ testingRewardProb v h < 1 := by have hq := testingRewardProb_mem_Icc v hv h constructor <;> linarith [hq.1, hq.2] have hhidden (a : Bool) : 0 < testingHiddenProb a ∧ testingHiddenProb a < 1 := by cases a <;> norm_num [testingHiddenProb] have hemission (x h : Fin 2) : 0 < testingEmission x h := by unfold testingEmission split_ifs <;> norm_num unfold testingPathWeight apply mul_pos · exact mul_pos (by norm_num) (hemission _ _) · apply Finset.prod_pos intro t _ apply mul_pos · apply mul_pos · apply mul_pos (by norm_num) split_ifs · exact (hreward _).1 · linarith [(hreward (c.1 t.castSucc).2).2] · split_ifs · exact (hhidden _).1 · linarith [(hhidden (c.2 t).1).2] · exact hemission _ _
CausalSmith.Stat.PomdpBinaryhiddenRate.testingPathWeight_pos · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingFamilyBasics.lean:101
theorem testingTrajectoryLaw_absolutelyContinuous Lemma testingTrajectoryLaw_absolutelyContinuous in the paper ↗

The testing laws have common finite support, hence every alternative is absolutely continuous with respect to every other admissible alternative. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
v w :
ℝ
hw :
|w| ≤ 1 / 16
Proof (Lean source)
-- @node: testingTrajectoryLaw_absolutelyContinuous lemma testingTrajectoryLaw_absolutelyContinuous (T : Nat) (v w : ℝ) (hw : |w| ≤ 1 / 16) : testingTrajectoryLaw T v ≪ testingTrajectoryLaw T w := by intro A hA simp only [testingTrajectoryLaw, Measure.finsetSum_apply, Measure.smul_apply, smul_eq_mul] at hA ⊢ have hzero := Finset.sum_eq_zero_iff.mp hA apply Finset.sum_eq_zero_iff.mpr intro c hc have hc0 := hzero c hc have hpos : ofReal (testingPathWeight w c) ≠ 0 := ne_of_gt (ENNReal.ofReal_pos.mpr (testingPathWeight_pos w hw c)) have hdirac : Measure.dirac (decodeTestingPath c) A = 0 := (mul_eq_zero.mp hc0).resolve_left hpos rw [hdirac, mul_zero]
CausalSmith.Stat.PomdpBinaryhiddenRate.testingTrajectoryLaw_absolutelyContinuous · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingFamilyBasics.lean:131
theorem testingObservedLaw_klDiv_ne_top

Finite support and common positive path masses give finite KL divergence, which remains finite after projection to the observed trajectory. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
v w :
ℝ
hvFamily :
v = vT T ∨ v = -(vT T)
hv :
|v| ≤ 1 / 16
hwFamily :
w = vT T ∨ w = -(vT T)
hw :
|w| ≤ 1 / 16
klDiv (obsLaw (testingExperiment T v hvFamily hv)) (obsLaw (testingExperiment T w hwFamily hw))
≠ ⊤
Proof (Lean source)
-- @node: testingObservedLaw_klDiv_ne_top lemma testingObservedLaw_klDiv_ne_top (T : Nat) (v w : ℝ) (hvFamily : v = vT T ∨ v = -(vT T)) (hv : |v| ≤ 1 / 16) (hwFamily : w = vT T ∨ w = -(vT T)) (hw : |w| ≤ 1 / 16) : klDiv (obsLaw (testingExperiment T v hvFamily hv)) (obsLaw (testingExperiment T w hwFamily hw)) ≠ ⊤ := by let := testingTrajectoryLaw_isProbability T v hv let := testingTrajectoryLaw_isProbability T w hw have hI : Integrable (llr (testingTrajectoryLaw T v) (testingTrajectoryLaw T w)) (testingTrajectoryLaw T v) := by rw [testingTrajectoryLaw] apply integrable_finsetSum_measure.mpr intro c _ exact (integrable_dirac (by simp)).smul_measure (by simp) have hfin := InformationTheory.klDiv_ne_top (testingTrajectoryLaw_absolutelyContinuous T v w hw) hI have hproj : Measurable (obsProj (T := T) (nX := 2) (nH := 2)) := by unfold obsProj curState actionAt rewardAt fun_prop exact ne_top_of_le_ne_top hfin (InformationTheory.klDiv_map_le (testingTrajectoryLaw T v) (testingTrajectoryLaw T w) hproj)
CausalSmith.Stat.PomdpBinaryhiddenRate.testingObservedLaw_klDiv_ne_top · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingFamilyBasics.lean:150
CausalSmith.Stat.STAT_PomdpBinaryhiddenRate_Research.Helpers.TestingFamilyCore 15 declarations The fair-policy binary-hidden family gives two stationary models separated in target value while their observed trajectory laws have small KL divergence.

Positive four-state testing family

The fair-policy binary-hidden family gives two stationary models separated in target value while their observed trajectory laws have small KL divergence.

theorem vT_bound

The positive perturbation lies in the probability range. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
hT :
12 ≤ T
|vT T| ≤ 1 / 16
Proof (Lean source)
lemma vT_bound (T : Nat) (hT : 12 ≤ T) : |vT T| ≤ 1 / 16 := by have hv := vT_mem_Ioc T (by omega : 0 < T) rw [abs_of_pos hv.1] exact hv.2
theorem neg_vT_bound

The negative perturbation lies in the probability range. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
hT :
12 ≤ T
|-(vT T)| ≤ 1 / 16
Proof (Lean source)
lemma neg_vT_bound (T : Nat) (hT : 12 ≤ T) : |-(vT T)| ≤ 1 / 16 := by simpa only [abs_neg] using vT_bound T hT
theorem testingExperiment_policyOverlap

The fair coincident policies of either testing experiment satisfy target overlap for every nonnegative log-overlap radius. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
v zeta :
ℝ
hvFamily :
v = vT T ∨ v = -(vT T)
hv :
|v| ≤ 1 / 16
hzeta :
0 ≤ zeta
Proof (Lean source)
lemma testingExperiment_policyOverlap (T : Nat) (v zeta : ℝ) (hvFamily : v = vT T ∨ v = -(vT T)) (hv : |v| ≤ 1 / 16) (hzeta : 0 ≤ zeta) : PolicyOverlap (policyFactor zeta) (testingExperiment T v hvFamily hv) := by have hL : 1 ≤ policyFactor zeta := by unfold policyFactor simpa using (Real.exp_le_exp.mpr hzeta : exp 0 ≤ exp zeta) constructor · intro x constructor · intro a change 0 ≤ (1 / 2 : ℝ) norm_num · change (∑ _a : Bool, (1 / 2 : ℝ)) = 1 simp · intro x a change (1 / 2 : ℝ) ≤ policyFactor zeta * (1 / 2 : ℝ) nlinarith
CausalSmith.Stat.PomdpBinaryhiddenRate.testingExperiment_policyOverlap · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingFamilyCore.lean:30
theorem testingRewardProb_mem_Icc Lemma testingRewardProb_mem_Icc in the paper ↗

Both testing reward probabilities stay uniformly away from zero and one. Under the listed formal conditions, the stated conclusion holds.

Formal statement
v :
ℝ
hv :
|v| ≤ 1 / 16
h :
Fin 2
testingRewardProb v h ∈ Icc (1 / 4 : ℝ) (3 / 4 : ℝ)
Proof (Lean source)
lemma testingRewardProb_mem_Icc (v : ℝ) (hv : |v| ≤ 1 / 16) (h : Fin 2) : testingRewardProb v h ∈ Icc (1 / 4 : ℝ) (3 / 4 : ℝ) := by have hv' := abs_le.mp hv fin_cases h <;> simp only [testingRewardProb, Fin.isValue] <;> simp <;> constructor <;> norm_num at * <;> linarith
CausalSmith.Stat.PomdpBinaryhiddenRate.testingRewardProb_mem_Icc · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingFamilyCore.lean:52
theorem testingKernel_probability Lemma testingKernel_probability in the paper ↗

The explicit Bernoulli reward and successor-state kernel has unit mass. Under the listed formal conditions, the stated conclusion holds.

Formal statement
v :
ℝ
hv :
|v| ≤ 1 / 16
s :
a :
Proof (Lean source)
lemma testingKernel_probability (v : ℝ) (hv : |v| ≤ 1 / 16) (s : JointState 2 2) (a : Bool) : IsProbabilityMeasure (testingKernel v s a) := by constructor simp only [testingKernel, MeasureTheory.Measure.finsetSum_apply, MeasureTheory.Measure.smul_apply, MeasureTheory.Measure.dirac_apply] simp only [Set.indicator_univ, Pi.one_apply, smul_eq_mul, mul_one] let w (y : Bool) (sp : JointState 2 2) : ℝ := (if y then testingRewardProb v s.2 else 1 - testingRewardProb v s.2) * (if sp.2 = 1 then testingHiddenProb a else 1 - testingHiddenProb a) * testingEmission sp.1 sp.2 change (∑ y : Bool, ∑ sp : JointState 2 2, ofReal (w y sp)) = 1 have hq := testingRewardProb_mem_Icc v hv s.2 have hw (y : Bool) (sp : JointState 2 2) : 0 ≤ w y sp := by dsimp [w] apply mul_nonneg · apply mul_nonneg · split_ifs <;> linarith [hq.1, hq.2] · cases a <;> split_ifs <;> norm_num [testingHiddenProb] · rcases sp with ⟨x, h⟩ fin_cases x <;> fin_cases h <;> norm_num [testingEmission] have hinner (y : Bool) : (∑ sp : JointState 2 2, ofReal (w y sp)) = ofReal (∑ sp : JointState 2 2, w y sp) := by rw [ENNReal.ofReal_sum_of_nonneg] intro sp _ exact hw y sp simp_rw [hinner] rw [← ENNReal.ofReal_sum_of_nonneg] · have hsum : (∑ y : Bool, ∑ sp : JointState 2 2, w y sp) = 1 := by dsimp [w] simp_rw [mul_assoc, ← Finset.mul_sum, testingStepMass_sum, mul_one] exact testingRewardMass_sum v s.2 rw [hsum] norm_num · intro y _ exact Finset.sum_nonneg (by intro sp _; exact hw y sp)
CausalSmith.Stat.PomdpBinaryhiddenRate.testingKernel_probability · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingFamilyCore.lean:60
theorem testingKernel_rewardSupport Lemma testingKernel_rewardSupport in the paper ↗

Every atom of the testing kernel has reward zero or one. Under the listed formal conditions, the stated conclusion holds.

Formal statement
v :
ℝ
hv :
|v| ≤ 1 / 16
s :
a :
testingKernel v s a {q | q.1 ∈ Icc (0 : ℝ) 1} = 1
Proof (Lean source)
lemma testingKernel_rewardSupport (v : ℝ) (hv : |v| ≤ 1 / 16) (s : JointState 2 2) (a : Bool) : testingKernel v s a {q | q.1 ∈ Icc (0 : ℝ) 1} = 1 := by have hmass := (testingKernel_probability v hv s a).measure_univ convert hmass using 1 simp [testingKernel]
CausalSmith.Stat.PomdpBinaryhiddenRate.testingKernel_rewardSupport · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingFamilyCore.lean:100
theorem testingExperiment_policyKernel_eq

Averaging the testing transition over the fair action gives the same row at every current state, independently of the reward perturbation. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
v :
ℝ
hvFamily :
v = vT T ∨ v = -(vT T)
hv :
|v| ≤ 1 / 16
s sp :
policyKernel (testingExperiment T v hvFamily hv) (testingExperiment T v hvFamily hv).e s sp
Proof (Lean source)
lemma testingExperiment_policyKernel_eq (T : Nat) (v : ℝ) (hvFamily : v = vT T ∨ v = -(vT T)) (hv : |v| ≤ 1 / 16) (s sp : JointState 2 2) : policyKernel (testingExperiment T v hvFamily hv) (testingExperiment T v hvFamily hv).e s sp = testingNextStateMass sp := by have hq := testingRewardProb_mem_Icc v hv s.2 have hq0 : 0 ≤ testingRewardProb v s.2 := le_trans (by norm_num) hq.1 have hq1 : 0 ≤ 1 - testingRewardProb v s.2 := by linarith [hq.2] rcases sp with ⟨px, ph⟩ fin_cases px <;> fin_cases ph <;> simp [policyKernel, testingExperiment, testingKernel, testingNextStateMass, testingHiddenProb, testingEmission, Fintype.sum_prod_type, Fin.sum_univ_two, ENNReal.toReal_add] <;> norm_num [ENNReal.toReal_ofReal, hq0, hq1] <;> ring
CausalSmith.Stat.PomdpBinaryhiddenRate.testingExperiment_policyKernel_eq · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingFamilyCore.lean:109
theorem testingExperiment_stationary

The common transition row is a stationary probability vector. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
v :
ℝ
hvFamily :
v = vT T ∨ v = -(vT T)
hv :
|v| ≤ 1 / 16
IsStationary (policyKernel (testingExperiment T v hvFamily hv) (testingExperiment T v hvFamily hv).e) testingNextStateMass
Proof (Lean source)
lemma testingExperiment_stationary (T : Nat) (v : ℝ) (hvFamily : v = vT T ∨ v = -(vT T)) (hv : |v| ≤ 1 / 16) : IsStationary (policyKernel (testingExperiment T v hvFamily hv) (testingExperiment T v hvFamily hv).e) testingNextStateMass := by constructor · constructor · intro sp rcases sp with ⟨x, h⟩ fin_cases x <;> fin_cases h <;> norm_num [testingNextStateMass, testingHiddenProb, testingEmission] · exact testingNextStateMass_sum · funext sp change (∑ s, testingNextStateMass s * policyKernel (testingExperiment T v hvFamily hv) (testingExperiment T v hvFamily hv).e s sp) = testingNextStateMass sp simp_rw [testingExperiment_policyKernel_eq] simp [← Finset.sum_mul, testingNextStateMass_sum]
CausalSmith.Stat.PomdpBinaryhiddenRate.testingExperiment_stationary · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingFamilyCore.lean:127
theorem testingExperiment_stationaryLaw_eq

The selected stationary law of a testing experiment is its common transition row. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
v :
ℝ
hvFamily :
v = vT T ∨ v = -(vT T)
hv :
|v| ≤ 1 / 16
hS :
IsStationary (policyKernel (testingExperiment T v hvFamily hv) (testingExperiment T v hvFamily hv).e) (stationaryLaw (policyKernel (testingExperiment T v hvFamily hv) (testingExperiment T v hvFamily hv).e))
Proof (Lean source)
lemma testingExperiment_stationaryLaw_eq (T : Nat) (v : ℝ) (hvFamily : v = vT T ∨ v = -(vT T)) (hv : |v| ≤ 1 / 16) (hS : IsStationary (policyKernel (testingExperiment T v hvFamily hv) (testingExperiment T v hvFamily hv).e) (stationaryLaw (policyKernel (testingExperiment T v hvFamily hv) (testingExperiment T v hvFamily hv).e))) : stationaryLaw (policyKernel (testingExperiment T v hvFamily hv) (testingExperiment T v hvFamily hv).e) = testingNextStateMass := by funext sp have hh := congrFun hS.2 sp change (∑ s, stationaryLaw (policyKernel (testingExperiment T v hvFamily hv) (testingExperiment T v hvFamily hv).e) s * policyKernel (testingExperiment T v hvFamily hv) (testingExperiment T v hvFamily hv).e s sp) = _ at hh simp_rw [testingExperiment_policyKernel_eq] at hh simpa [← Finset.sum_mul, hS.1.2] using hh.symm
CausalSmith.Stat.PomdpBinaryhiddenRate.testingExperiment_stationaryLaw_eq · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingFamilyCore.lean:149
theorem testingExperiment_contraction

The common transition row contracts every pair of state distributions. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
v :
ℝ
hvFamily :
v = vT T ∨ v = -(vT T)
hv :
|v| ≤ 1 / 16
alpha :
ℝ
hAlpha :
0 ≤ alpha
conclusion 1
BehaviorContraction alpha (testingExperiment T v hvFamily hv)
conclusion 2
TargetContraction alpha (testingExperiment T v hvFamily hv)
Proof (Lean source)
lemma testingExperiment_contraction (T : Nat) (v : ℝ) (hvFamily : v = vT T ∨ v = -(vT T)) (hv : |v| ≤ 1 / 16) (alpha : ℝ) (hAlpha : 0 ≤ alpha) : BehaviorContraction alpha (testingExperiment T v hvFamily hv) ∧ TargetContraction alpha (testingExperiment T v hvFamily hv) := by let M := testingExperiment T v hvFamily hv have hcommon : ContractsL1 (policyKernel M M.e) alpha := by intro p q hp hq have hstep : markovStep p (policyKernel M M.e) = markovStep q (policyKernel M M.e) := by funext sp change (∑ s, p s * policyKernel M M.e s sp) = (∑ s, q s * policyKernel M M.e s sp) dsimp only [M] simp_rw [testingExperiment_policyKernel_eq] simp only [← Finset.sum_mul, hp.2, hq.2, one_mul] rw [hstep] simpa only [l1Distance, sub_self, abs_zero, Finset.sum_const_zero] using (mul_nonneg hAlpha (Finset.sum_nonneg (by intro i hi; exact abs_nonneg _))) constructor · change ContractsL1 (policyKernel M M.b) alpha simpa [M, testingExperiment] using hcommon · exact hcommon
CausalSmith.Stat.PomdpBinaryhiddenRate.testingExperiment_contraction · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingFamilyCore.lean:171
theorem testingKernel_reward_integral Lemma testingKernel_reward_integral in the paper ↗

Integrating the reward coordinate of a testing kernel recovers its Bernoulli parameter. Under the listed formal conditions, the stated conclusion holds.

Formal statement
v :
ℝ
hv :
|v| ≤ 1 / 16
s :
a :
(∫ p, p.1 ∂testingKernel v s a) = testingRewardProb v s.2
Proof (Lean source)
lemma testingKernel_reward_integral (v : ℝ) (hv : |v| ≤ 1 / 16) (s : JointState 2 2) (a : Bool) : (∫ p, p.1 ∂testingKernel v s a) = testingRewardProb v s.2 := by rw [testingKernel, MeasureTheory.integral_finsetSum_measure (by intro y hy apply MeasureTheory.integrable_finsetSum_measure.mpr intro sp hsp exact (MeasureTheory.integrable_dirac (by simp)).smul_measure (by simp))] simp only [Fintype.sum_bool, ite_true, Bool.false_eq_true, ite_false] rw [MeasureTheory.integral_finsetSum_measure (by intro sp hsp exact (MeasureTheory.integrable_dirac (by simp)).smul_measure (by simp))] rw [MeasureTheory.integral_finsetSum_measure (by intro sp hsp exact (MeasureTheory.integrable_dirac (by simp)).smul_measure (by simp))] simp only [MeasureTheory.integral_smul_measure, MeasureTheory.integral_dirac] have hq0 : 0 ≤ testingRewardProb v s.2 := le_trans (by norm_num) (testingRewardProb_mem_Icc v hv s.2).1 simp only [smul_eq_mul, mul_one, mul_zero, Finset.sum_const_zero, add_zero] cases a <;> simp [Fintype.sum_prod_type, Fin.sum_univ_two, testingHiddenProb, testingEmission, ENNReal.toReal_ofReal, hq0] <;> norm_num [ENNReal.toReal_ofReal, hq0] <;> ring
CausalSmith.Stat.PomdpBinaryhiddenRate.testingKernel_reward_integral · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingFamilyCore.lean:202
theorem testingExperiment_rewardRegression_eq

The testing reward regression depends only on the current hidden state. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
v :
ℝ
hvFamily :
v = vT T ∨ v = -(vT T)
hv :
|v| ≤ 1 / 16
s :
Proof (Lean source)
lemma testingExperiment_rewardRegression_eq (T : Nat) (v : ℝ) (hvFamily : v = vT T ∨ v = -(vT T)) (hv : |v| ≤ 1 / 16) (s : JointState 2 2) : rewardRegression (testingExperiment T v hvFamily hv) s = testingRewardProb v s.2 := by simp [rewardRegression, testingExperiment, testingKernel_reward_integral v hv]
CausalSmith.Stat.PomdpBinaryhiddenRate.testingExperiment_rewardRegression_eq · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingFamilyCore.lean:229
theorem testingExperiment_targetValue_eq

Every stationary testing experiment has target value one half plus its perturbation. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
v :
ℝ
hvFamily :
v = vT T ∨ v = -(vT T)
hv :
|v| ≤ 1 / 16
hS :
IsStationary (policyKernel (testingExperiment T v hvFamily hv) (testingExperiment T v hvFamily hv).e) (stationaryLaw (policyKernel (testingExperiment T v hvFamily hv) (testingExperiment T v hvFamily hv).e))
targetValue (testingExperiment T v hvFamily hv) = 1 / 2 + v
Proof (Lean source)
lemma testingExperiment_targetValue_eq (T : Nat) (v : ℝ) (hvFamily : v = vT T ∨ v = -(vT T)) (hv : |v| ≤ 1 / 16) (hS : IsStationary (policyKernel (testingExperiment T v hvFamily hv) (testingExperiment T v hvFamily hv).e) (stationaryLaw (policyKernel (testingExperiment T v hvFamily hv) (testingExperiment T v hvFamily hv).e))) : targetValue (testingExperiment T v hvFamily hv) = 1 / 2 + v := by simp only [targetValue] rw [testingExperiment_stationaryLaw_eq T v hvFamily hv hS] simp_rw [testingExperiment_rewardRegression_eq T v hvFamily hv] simp [testingNextStateMass, testingHiddenProb, testingEmission, testingRewardProb, Fintype.sum_prod_type, Fin.sum_univ_two] <;> ring
CausalSmith.Stat.PomdpBinaryhiddenRate.testingExperiment_targetValue_eq · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingFamilyCore.lean:238
theorem coincidentPolicy_occupancy_bound

A stationary on-policy law obeys every occupancy-ratio bound above one. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
M :
heq :
M.e = M.b
C :
ℝ
hC :
1 < C
s :
Proof (Lean source)
lemma coincidentPolicy_occupancy_bound {T : Nat} (M : RawPomdpExperiment T 2 2) (hS : StationaryStart M) (heq : M.e = M.b) (C : ℝ) (hC : 1 < C) (s : JointState 2 2) : stationaryLaw (policyKernel M M.e) s ≤ C * stationaryLaw (policyKernel M M.b) s := by rw [heq] have hs : 0 ≤ stationaryLaw (policyKernel M M.b) s := hS.1.1.1 s nlinarith
CausalSmith.Stat.PomdpBinaryhiddenRate.coincidentPolicy_occupancy_bound · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingFamilyCore.lean:255
theorem testingPathWeight_initial_sum Lemma testingPathWeight_initial_sum in the paper ↗

Summing every continuation of a fixed initial state recovers its initial mass. the stated conclusion holds.

Formal statement
T :
v :
ℝ
s :
(∑ c : TestingPath T, if c.1 0 = s then testingPathWeight v c else 0)
= (1 / 2 : ℝ) * testingEmission s.1 s.2
Proof (Lean source)
lemma testingPathWeight_initial_sum (T : Nat) (v : ℝ) (s : JointState 2 2) : (∑ c : TestingPath T, if c.1 0 = s then testingPathWeight v c else 0) = (1 / 2 : ℝ) * testingEmission s.1 s.2 := by let step (xs : Fin (T + 1) → JointState 2 2) (t : Fin T) (ay : Bool × Bool) : ℝ := (1 / 2 : ℝ) * (if ay.2 then testingRewardProb v (xs t.castSucc).2 else 1 - testingRewardProb v (xs t.castSucc).2) * (if (xs t.succ).2 = 1 then testingHiddenProb ay.1 else 1 - testingHiddenProb ay.1) * testingEmission (xs t.succ).1 (xs t.succ).2 have hpi (xs : Fin (T + 1) → JointState 2 2) : (∑ ys : Fin T → Bool × Bool, ∏ t : Fin T, step xs t (ys t)) = ∏ t : Fin T, ∑ ay : Bool × Bool, step xs t ay := by simpa [Fintype.piFinset_univ] using (Finset.sum_prod_piFinset (Finset.univ : Finset (Bool × Bool)) (step xs)) have hq : (∑ f : Fin T → JointState 2 2, ∏ t : Fin T, testingNextStateMass (f t)) = 1 := by simpa [Fintype.piFinset_univ, testingNextStateMass_sum] using (Finset.sum_prod_piFinset (Finset.univ : Finset (JointState 2 2)) (fun (_ : Fin T) sp => testingNextStateMass sp)) calc _ = ∑ xs : Fin (T + 1) → JointState 2 2, (if xs 0 = s then (1 / 2 : ℝ) * testingEmission (xs 0).1 (xs 0).2 else 0) * ∏ t : Fin T, testingNextStateMass (xs t.succ) := by simp only [Fintype.sum_prod_type, testingPathWeight] apply Finset.sum_congr rfl intro xs _ by_cases hs : xs 0 = s · simp only [if_pos hs] rw [← Finset.mul_sum, hpi xs] congr 1 apply Finset.prod_congr rfl intro t _ exact testingStepMarginal_sum v (xs t.castSucc) (xs t.succ) · simp [hs] _ = ∑ z : JointState 2 2 × (Fin T → JointState 2 2), (if z.1 = s then (1 / 2 : ℝ) * testingEmission z.1.1 z.1.2 else 0) * ∏ t : Fin T, testingNextStateMass (z.2 t) := by exact (Fintype.sum_equiv (Fin.consEquiv (fun _ : Fin (T + 1) => JointState 2 2)) _ _ (by intro z; simp)).symm _ = _ := by rw [Fintype.sum_prod_type] simp_rw [← Finset.mul_sum, hq, mul_one] simp
CausalSmith.Stat.PomdpBinaryhiddenRate.testingPathWeight_initial_sum · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingFamilyCore.lean:266
CausalSmith.Stat.STAT_PomdpBinaryhiddenRate_Research.Helpers.TestingHistoryEncoding 18 declarations The explicit testing weights are the chronological finite-model construction.

Finite encoding of the binary testing paths

The explicit testing weights are the chronological finite-model construction. Transporting its history factorizations gives the required conditional laws.

The testing reward and successor mass on a two-symbol reward alphabet.

Definition (Lean source)
v :
ℝ
s :
a :
q :
Fin 2 × JointState 2 2
testingFiniteWeight v s a q :
ℝ
(if finTwoEquiv q.1 then testingRewardProb v s.2 else 1 - testingRewardProb v s.2) * (if q.2.2 = 1 then testingHiddenProb a else 1 - testingHiddenProb a) * testingEmission q.2.1 q.2.2
CausalSmith.Stat.PomdpBinaryhiddenRate.testingFiniteWeight · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingHistoryEncoding.lean:21
theorem testingFiniteWeight_nonneg

All finite reward-transition weights are nonnegative in the testing range. Under the listed formal conditions, the stated conclusion holds.

Formal statement
v :
ℝ
hv :
|v| ≤ 1 / 16
s :
a :
q :
Fin 2 × JointState 2 2
0 ≤ testingFiniteWeight v s a q
Proof (Lean source)
-- @node: testingFiniteWeight_nonneg lemma testingFiniteWeight_nonneg (v : ℝ) (hv : |v| ≤ 1 / 16) (s : JointState 2 2) (a : Bool) (q : Fin 2 × JointState 2 2) : 0 ≤ testingFiniteWeight v s a q := by have hq := testingRewardProb_mem_Icc v hv s.2 rcases q with ⟨y, x, h⟩ fin_cases y <;> fin_cases x <;> fin_cases h <;> cases a <;> norm_num [testingFiniteWeight, finTwoEquiv, testingHiddenProb, testingEmission] <;> linarith [hq.1, hq.2]
CausalSmith.Stat.PomdpBinaryhiddenRate.testingFiniteWeight_nonneg · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingHistoryEncoding.lean:29
theorem testingFiniteWeight_sum

The finite reward-transition weights have unit total mass. the stated conclusion holds.

Formal statement
v :
ℝ
s :
a :
∑ q, testingFiniteWeight v s a q = 1
Proof (Lean source)
-- @node: testingFiniteWeight_sum lemma testingFiniteWeight_sum (v : ℝ) (s : JointState 2 2) (a : Bool) : ∑ q, testingFiniteWeight v s a q = 1 := by cases a <;> simp [testingFiniteWeight, finTwoEquiv, Fintype.sum_prod_type, Fin.sum_univ_two, testingHiddenProb, testingEmission] <;> ring
CausalSmith.Stat.PomdpBinaryhiddenRate.testingFiniteWeight_sum · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingHistoryEncoding.lean:40

The finite PMF version of the joint testing kernel.

Definition (Lean source)
v :
ℝ
s :
a :
testingFiniteKernel v s a :
PMF (Fin 2 × JointState 2 2)
CausalSmith.Stat.PomdpLatentOverlapMinimax.pmfOfRealWeight (testingFiniteWeight v s a)
CausalSmith.Stat.PomdpBinaryhiddenRate.testingFiniteKernel · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingHistoryEncoding.lean:48
theorem testingFiniteKernel_apply

Normalization preserves the explicit finite testing kernel weights. Under the listed formal conditions, the stated conclusion holds.

Formal statement
v :
ℝ
hv :
|v| ≤ 1 / 16
s :
a :
q :
Fin 2 × JointState 2 2
Proof (Lean source)
-- @node: testingFiniteKernel_apply lemma testingFiniteKernel_apply (v : ℝ) (hv : |v| ≤ 1 / 16) (s : JointState 2 2) (a : Bool) (q : Fin 2 × JointState 2 2) : testingFiniteKernel v s a q = ofReal (testingFiniteWeight v s a q) := by exact CausalSmith.Stat.PomdpLatentOverlapMinimax.pmfOfRealWeight_apply_of_nonneg_sum_one _ (testingFiniteWeight_nonneg v hv s a) (testingFiniteWeight_sum v s a) q
CausalSmith.Stat.PomdpBinaryhiddenRate.testingFiniteKernel_apply · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingHistoryEncoding.lean:53

The stationary initialization as a finite PMF.

Definition (Lean source)
testingFiniteInit :
CausalSmith.Stat.PomdpLatentOverlapMinimax.pmfOfRealWeight (fun s => (1 / 2 : ℝ) * testingEmission s.1 s.2)
theorem testingFiniteInit_apply

The initialization PMF preserves the displayed stationary masses. the stated conclusion holds.

Formal statement
s :
testingFiniteInit s = ofReal ((1 / 2 : ℝ) * testingEmission s.1 s.2)
Proof (Lean source)
-- @node: testingFiniteInit_apply lemma testingFiniteInit_apply (s : JointState 2 2) : testingFiniteInit s = ofReal ((1 / 2 : ℝ) * testingEmission s.1 s.2) := by apply CausalSmith.Stat.PomdpLatentOverlapMinimax.pmfOfRealWeight_apply_of_nonneg_sum_one · intro s rcases s with ⟨x, h⟩ fin_cases x <;> fin_cases h <;> norm_num [testingEmission] · norm_num [Fintype.sum_prod_type, Fin.sum_univ_two, testingEmission]
CausalSmith.Stat.PomdpBinaryhiddenRate.testingFiniteInit_apply · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingHistoryEncoding.lean:66

The fair action PMF.

Definition (Lean source)
testingFairPMF :
CausalSmith.Stat.PomdpLatentOverlapMinimax.pmfOfRealWeight (fun _ => (1 / 2 : ℝ))
theorem testingFairPMF_apply

Each action has probability one half. the stated conclusion holds.

Formal statement
a :
testingFairPMF a = ofReal (1 / 2 : ℝ)
Proof (Lean source)
-- @node: testingFairPMF_apply lemma testingFairPMF_apply (a : Bool) : testingFairPMF a = ofReal (1 / 2 : ℝ) := by apply CausalSmith.Stat.PomdpLatentOverlapMinimax.pmfOfRealWeight_apply_of_nonneg_sum_one · intro _; norm_num · simp
CausalSmith.Stat.PomdpBinaryhiddenRate.testingFairPMF_apply · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingHistoryEncoding.lean:81

A chronological finite reward model for the testing experiment.

Definition (Lean source)
T :
v :
ℝ
testingFiniteModel T v :
CausalSmith.Stat.PomdpLatentOverlapMinimax.FiniteRewardModel T 2 2 2
clause 1
clause 2
rew := fun y => if finTwoEquiv y then 1 else 0
clause 3
rew_mem := by intro y; split_ifs <;> norm_num
clause 5
b := fun _ => testingFairPMF
clause 6
e := fun _ => testingFairPMF
clause 7
law := CausalSmith.Stat.PomdpLatentOverlapMinimax.finitePathPMF (testingFiniteKernel v) testingFiniteInit (fun _ => testingFairPMF)
clause 8
law_generated := CausalSmith.Stat.PomdpLatentOverlapMinimax.finitePathPMF_apply _ _ _

Changing the reward alphabet between two finite symbols and Booleans.

Definition (Lean source)
T :
testingFinitePathEquiv T :
CausalSmith.Stat.PomdpLatentOverlapMinimax.FiniteTrajectory T 2 2 2 ≃ TestingPath T
Equiv.prodCongr (Equiv.refl _) (Equiv.piCongrRight fun _ => Equiv.prodCongr (Equiv.refl Bool) finTwoEquiv)
CausalSmith.Stat.PomdpBinaryhiddenRate.testingFinitePathEquiv · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingHistoryEncoding.lean:104
theorem testingFinitePathWeight_eq

The chronological finite weight is exactly the displayed testing weight. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
v :
ℝ
hv :
|v| ≤ 1 / 16
c :
CausalSmith.Stat.PomdpLatentOverlapMinimax.FiniteTrajectory T 2 2 2
CausalSmith.Stat.PomdpLatentOverlapMinimax.finitePathWeight (testingFiniteKernel v) testingFiniteInit (fun _ => testingFairPMF) c
Proof (Lean source)
-- @node: testingFinitePathWeight_eq lemma testingFinitePathWeight_eq (T : Nat) (v : ℝ) (hv : |v| ≤ 1 / 16) (c : CausalSmith.Stat.PomdpLatentOverlapMinimax.FiniteTrajectory T 2 2 2) : CausalSmith.Stat.PomdpLatentOverlapMinimax.finitePathWeight (testingFiniteKernel v) testingFiniteInit (fun _ => testingFairPMF) c = testingPathWeight v (testingFinitePathEquiv T c) := by have hi (s : JointState 2 2) : 0 ≤ (1 / 2 : ℝ) * testingEmission s.1 s.2 := by rcases s with ⟨x, h⟩ fin_cases x <;> fin_cases h <;> norm_num [testingEmission] simp only [CausalSmith.Stat.PomdpLatentOverlapMinimax.finitePathWeight, testingFiniteInit_apply, testingFairPMF_apply, testingFiniteKernel_apply v hv, ENNReal.toReal_ofReal (hi _), ENNReal.toReal_ofReal (by norm_num : (0 : ℝ) ≤ 1 / 2), ENNReal.toReal_ofReal (testingFiniteWeight_nonneg v hv _ _ _)] unfold testingPathWeight testingFinitePathEquiv testingFiniteWeight simp only [Equiv.prodCongr_apply, map, Pi.map, Equiv.refl_apply, Equiv.piCongrRight_apply] congr 1 apply Finset.prod_congr rfl intro t _ ring
CausalSmith.Stat.PomdpBinaryhiddenRate.testingFinitePathWeight_eq · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingHistoryEncoding.lean:111
theorem testingFiniteModel_law_apply

The finite path PMF has the explicit testing path masses. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
v :
ℝ
hv :
|v| ≤ 1 / 16
c :
CausalSmith.Stat.PomdpLatentOverlapMinimax.FiniteTrajectory T 2 2 2
Proof (Lean source)
-- @node: testingFiniteModel_law_apply lemma testingFiniteModel_law_apply (T : Nat) (v : ℝ) (hv : |v| ≤ 1 / 16) (c : CausalSmith.Stat.PomdpLatentOverlapMinimax.FiniteTrajectory T 2 2 2) : (testingFiniteModel T v).law c = ofReal (testingPathWeight v (testingFinitePathEquiv T c)) := by change CausalSmith.Stat.PomdpLatentOverlapMinimax.finitePathPMF _ _ _ c = _ rw [CausalSmith.Stat.PomdpLatentOverlapMinimax.finitePathPMF, CausalSmith.Stat.PomdpLatentOverlapMinimax.pmfOfRealWeight_apply_of_nonneg_sum_one _ (CausalSmith.Stat.PomdpLatentOverlapMinimax.finitePathWeight_nonneg _ _ _) (CausalSmith.Stat.PomdpLatentOverlapMinimax.sum_finitePathWeight_eq_one _ _ _), testingFinitePathWeight_eq T v hv]
CausalSmith.Stat.PomdpBinaryhiddenRate.testingFiniteModel_law_apply · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingHistoryEncoding.lean:132
theorem testingFiniteModel_kernel_eq

Decoding the finite kernel recovers the real-reward testing kernel. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
v :
ℝ
hv :
|v| ≤ 1 / 16
s :
a :
(CausalSmith.Stat.PomdpLatentOverlapMinimax.embed (testingFiniteModel T v)).K s a
Proof (Lean source)
-- @node: testingFiniteModel_kernel_eq lemma testingFiniteModel_kernel_eq (T : Nat) (v : ℝ) (hv : |v| ≤ 1 / 16) (s : JointState 2 2) (a : Bool) : (CausalSmith.Stat.PomdpLatentOverlapMinimax.embed (testingFiniteModel T v)).K s a = testingKernel v s a := by ext E hE change ((testingFiniteKernel v s a).map (fun q => ((if finTwoEquiv q.1 then (1 : ℝ) else 0), q.2))).toMeasure E = _ rw [PMF.toMeasure_map_apply _ _ _ (measurable_of_finite _) hE, PMF.toMeasure_apply_fintype] simp only [Set.indicator_apply, Set.mem_preimage, testingFiniteKernel_apply v hv, testingKernel, Measure.finsetSum_apply, Measure.smul_apply, Measure.dirac_apply, indicator, Pi.one_apply, smul_eq_mul, mul_ite, mul_one, mul_zero] rw [Fintype.sum_prod_type] apply Fintype.sum_equiv finTwoEquiv intro y apply Finset.sum_congr rfl intro sp _ simp only [testingFiniteWeight, mul_ite, Set.mem_preimage] rfl
CausalSmith.Stat.PomdpBinaryhiddenRate.testingFiniteModel_kernel_eq · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingHistoryEncoding.lean:145
theorem testingFiniteModel_law_eq

Decoding the finite path law recovers the displayed testing trajectory law. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
v :
ℝ
hv :
|v| ≤ 1 / 16
(CausalSmith.Stat.PomdpLatentOverlapMinimax.embed (testingFiniteModel T v)).law
Proof (Lean source)
-- @node: testingFiniteModel_law_eq lemma testingFiniteModel_law_eq (T : Nat) (v : ℝ) (hv : |v| ≤ 1 / 16) : (CausalSmith.Stat.PomdpLatentOverlapMinimax.embed (testingFiniteModel T v)).law = testingTrajectoryLaw T v := by ext E hE change ((testingFiniteModel T v).law.map (CausalSmith.Stat.PomdpLatentOverlapMinimax.decodeTraj (testingFiniteModel T v).rew)).toMeasure E = _ rw [PMF.toMeasure_map_apply _ _ _ (measurable_of_finite _) hE, PMF.toMeasure_apply_fintype] simp only [testingFiniteModel_law_apply T v hv, testingTrajectoryLaw, Measure.finsetSum_apply, Measure.smul_apply, Measure.dirac_apply] apply Fintype.sum_equiv (testingFinitePathEquiv T) intro c simp only [indicator, Set.mem_preimage, smul_eq_mul, mul_ite, mul_one, mul_zero] simp only [testingFiniteModel_law_apply T v hv, Pi.one_apply, mul_one] rfl
CausalSmith.Stat.PomdpBinaryhiddenRate.testingFiniteModel_law_eq · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingHistoryEncoding.lean:167
theorem testingFiniteModel_policy_eq

The decoded finite model has the fair behavior policy. the stated conclusion holds.

Formal statement
T :
v :
ℝ
(CausalSmith.Stat.PomdpLatentOverlapMinimax.embed (testingFiniteModel T v)).b
= fun _ _ => (1 / 2 : ℝ)
Proof (Lean source)
-- @node: testingFiniteModel_policy_eq lemma testingFiniteModel_policy_eq (T : Nat) (v : ℝ) : (CausalSmith.Stat.PomdpLatentOverlapMinimax.embed (testingFiniteModel T v)).b = fun _ _ => (1 / 2 : ℝ) := by funext x a change (testingFairPMF a).toReal = _ rw [testingFairPMF_apply, ENNReal.toReal_ofReal (by norm_num)]
CausalSmith.Stat.PomdpBinaryhiddenRate.testingFiniteModel_policy_eq · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingHistoryEncoding.lean:186
theorem testingExperiment_kernelHistory

The testing joint kernel is the conditional law given the complete action history. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
v :
ℝ
hvFamily :
v = vT T ∨ v = -(vT T)
hv :
|v| ≤ 1 / 16
t :
Fin T
(testingExperiment T v hvFamily hv).law.map (histNextPair t)
= ((testingExperiment T v hvFamily hv).law.map (histView t)).compProd (Kernel.comap (kernelOfK (testingExperiment T v hvFamily hv)) (currentStateAction t) (measurable_currentStateAction t))
Proof (Lean source)
-- @node: testingExperiment_kernelHistory lemma testingExperiment_kernelHistory (T : Nat) (v : ℝ) (hvFamily : v = vT T ∨ v = -(vT T)) (hv : |v| ≤ 1 / 16) : ∀ t : Fin T, (testingExperiment T v hvFamily hv).law.map (histNextPair t) = ((testingExperiment T v hvFamily hv).law.map (histView t)).compProd (Kernel.comap (kernelOfK (testingExperiment T v hvFamily hv)) (currentStateAction t) (measurable_currentStateAction t)) := by intro t have h := (CausalSmith.Stat.PomdpLatentOverlapMinimax.embed_pomdpKernelLaw (testingFiniteModel T v)).2 t have hkernel : (CausalSmith.Stat.PomdpLatentOverlapMinimax.embed (testingFiniteModel T v)).K = testingKernel v := by funext s a exact testingFiniteModel_kernel_eq T v hv s a unfold CausalSmith.Stat.PomdpLatentOverlapMinimax.kernelOfK at h rw [hkernel, testingFiniteModel_law_eq T v hv] at h exact h
CausalSmith.Stat.PomdpBinaryhiddenRate.testingExperiment_kernelHistory · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingHistoryEncoding.lean:195
theorem testingExperiment_actionHistory

The fair behavior policy is the conditional action law given the complete state history. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
v :
ℝ
hvFamily :
v = vT T ∨ v = -(vT T)
hv :
|v| ≤ 1 / 16
t :
Fin T
(testingExperiment T v hvFamily hv).law.map (histActionPair t)
= ((testingExperiment T v hvFamily hv).law.map (histStateView t)).compProd (Kernel.comap (behaviourKernel (testingExperiment T v hvFamily hv)) (currentObsState t) (measurable_currentObsState t))
Proof (Lean source)
-- @node: testingExperiment_actionHistory lemma testingExperiment_actionHistory (T : Nat) (v : ℝ) (hvFamily : v = vT T ∨ v = -(vT T)) (hv : |v| ≤ 1 / 16) : ∀ t : Fin T, (testingExperiment T v hvFamily hv).law.map (histActionPair t) = ((testingExperiment T v hvFamily hv).law.map (histStateView t)).compProd (Kernel.comap (behaviourKernel (testingExperiment T v hvFamily hv)) (currentObsState t) (measurable_currentObsState t)) := by intro t have h := (CausalSmith.Stat.PomdpLatentOverlapMinimax.embed_sequentialIgnorability (testingFiniteModel T v)).2 t unfold CausalSmith.Stat.PomdpLatentOverlapMinimax.behaviourKernel at h rw [testingFiniteModel_policy_eq, testingFiniteModel_law_eq T v hv] at h exact h
CausalSmith.Stat.PomdpBinaryhiddenRate.testingExperiment_actionHistory · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingHistoryEncoding.lean:215
CausalSmith.Stat.STAT_PomdpBinaryhiddenRate_Research.Helpers.TestingKL 12 declarations Cancel the common state and action factors and sum the conditional Bernoulli reward divergences before projecting the finite path law to observed data.

Quantitative divergence of the testing pair

Cancel the common state and action factors and sum the conditional Bernoulli reward divergences before projecting the finite path law to observed data.

theorem testing_product_entropy_le Lemma testing_product_entropy_le in the paper ↗

Independent finite factors with common masses and bounded one-factor entropy have a product entropy bounded by the sum of their budgets. Under the listed formal conditions, the stated conclusion holds.

Formal statement
A :
Type*
n :
p q :
Fin n → A → ℝ
m :
Fin n → ℝ
C :
ℝ
hp :
∀ i a, 0 < p i a
hq :
∀ i a, 0 < q i a
hm :
∀ i, 0 ≤ m i
hs :
∀ i, ∑ a, p i a = m i
hb :
∀ i, (∑ a, p i a * log (p i a / q i a)) ≤ C * m i
(∑ f : Fin n → A, (∏ i, p i (f i)) * log ((∏ i, p i (f i)) / (∏ i, q i (f i))))
≤ (n : ℝ) * C * ∏ i, m i
Proof (Lean source)
-- @node: testing_product_entropy_le lemma testing_product_entropy_le {A : Type*} [Fintype A] (n : Nat) (p q : Fin n → A → ℝ) (m : Fin n → ℝ) (C : ℝ) (hp : ∀ i a, 0 < p i a) (hq : ∀ i a, 0 < q i a) (hm : ∀ i, 0 ≤ m i) (hs : ∀ i, ∑ a, p i a = m i) (hb : ∀ i, (∑ a, p i a * log (p i a / q i a)) ≤ C * m i) : (∑ f : Fin n → A, (∏ i, p i (f i)) * log ((∏ i, p i (f i)) / (∏ i, q i (f i)))) ≤ (n : ℝ) * C * ∏ i, m i := by induction n with | zero => simp | succ n ih => let pt : Fin n → A → ℝ := fun i => p i.succ let qt : Fin n → A → ℝ := fun i => q i.succ let mt : Fin n → ℝ := fun i => m i.succ let D : ℝ := ∑ f : Fin n → A, (∏ i, pt i (f i)) * log ((∏ i, pt i (f i)) / (∏ i, qt i (f i))) let H : ℝ := ∑ a, p 0 a * log (p 0 a / q 0 a) let M : ℝ := ∏ i, mt i have htail : D ≤ (n : ℝ) * C * M := ih pt qt mt (by intro i a; exact hp _ _) (by intro i a; exact hq _ _) (by intro i; exact hm _) (by intro i; exact hs _) (by intro i; exact hb _) have hsum : (∑ f : Fin n → A, ∏ i, pt i (f i)) = M := by simpa [M, mt, pt, Fintype.piFinset_univ, hs] using (Finset.sum_prod_piFinset (Finset.univ : Finset A) pt) have hM : 0 ≤ M := Finset.prod_nonneg (by intro i _; exact hm _) have heq : (∑ f : Fin (n + 1) → A, (∏ i, p i (f i)) * log ((∏ i, p i (f i)) / (∏ i, q i (f i)))) = H * M + m 0 * D := by rw [← Fintype.sum_equiv (Fin.consEquiv (fun _ : Fin (n + 1) => A)) (fun z : A × (Fin n → A) => (∏ i, p i ((cons (α := fun _ => A) z.1 z.2) i)) * log ((∏ i, p i ((cons (α := fun _ => A) z.1 z.2) i)) / (∏ i, q i ((cons (α := fun _ => A) z.1 z.2) i)))) _ (by intro z; rfl)] simp only [Fintype.sum_prod_type, Fin.prod_univ_succ, Fin.cons_zero, Fin.cons_succ] have hlog (a : A) (f : Fin n → A) : log ((p 0 a * ∏ i, p i.succ (f i)) / (q 0 a * ∏ i, q i.succ (f i))) = log (p 0 a / q 0 a) + log ((∏ i, pt i (f i)) / (∏ i, qt i (f i))) := by rw [mul_div_mul_comm, Real.log_mul (ne_of_gt (div_pos (hp _ _) (hq _ _))) (ne_of_gt (div_pos (Finset.prod_pos (by intro i _; exact hp _ _)) (Finset.prod_pos (by intro i _; exact hq _ _))))] simp_rw [hlog] simp only [mul_add, Finset.sum_add_distrib] simp_rw [show ∀ (a : A) (f : Fin n → A), (p 0 a * ∏ i, p i.succ (f i)) * log (p 0 a / q 0 a) = (p 0 a * log (p 0 a / q 0 a)) * ∏ i, pt i (f i) by intro a f; dsimp [pt]; ring] simp_rw [← Finset.mul_sum, hsum] simp_rw [mul_assoc, ← Finset.mul_sum] simp only [← Finset.sum_mul, hs, H, D] simp only [← mul_assoc, ← Finset.sum_mul, pt] rw [heq, Fin.prod_univ_succ, Nat.cast_add, Nat.cast_one] calc H * M + m 0 * D ≤ (C * m 0) * M + m 0 * ((n : ℝ) * C * M) := add_le_add (mul_le_mul_of_nonneg_right (hb 0) hM) (mul_le_mul_of_nonneg_left htail (hm 0)) _ = _ := by dsimp [M, mt]; ring
CausalSmith.Stat.PomdpBinaryhiddenRate.testing_product_entropy_le · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingKL.lean:20

One fair-action epoch mass, with a Boolean reward.

Definition (Lean source)
v :
ℝ
s sp :
ay :
testingKLStep v s sp ay :
ℝ
(1 / 2 : ℝ) * (if ay.2 then testingRewardProb v s.2 else 1 - testingRewardProb v s.2) * (if sp.2 = 1 then testingHiddenProb ay.1 else 1 - testingHiddenProb ay.1) * testingEmission sp.1 sp.2
CausalSmith.Stat.PomdpBinaryhiddenRate.testingKLStep · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingKL.lean:80
theorem testingKLStep_pos

Every single-epoch testing mass is positive. Under the listed formal conditions, the stated conclusion holds.

Formal statement
v :
ℝ
hv :
|v| ≤ 1 / 16
s sp :
ay :
0 < testingKLStep v s sp ay
Proof (Lean source)
-- @node: testingKLStep_pos lemma testingKLStep_pos (v : ℝ) (hv : |v| ≤ 1 / 16) (s sp : JointState 2 2) (ay : Bool × Bool) : 0 < testingKLStep v s sp ay := by have hq := testingRewardProb_mem_Icc v hv s.2 unfold testingKLStep apply mul_pos · apply mul_pos · apply mul_pos (by norm_num) split_ifs <;> linarith [hq.1, hq.2] · cases ay.1 <;> split_ifs <;> norm_num [testingHiddenProb] · unfold testingEmission split_ifs <;> norm_num
CausalSmith.Stat.PomdpBinaryhiddenRate.testingKLStep_pos · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingKL.lean:89
theorem testingKLStep_sum

Reward and action marginalization leaves the common next-state mass. the stated conclusion holds.

Formal statement
v :
ℝ
s sp :
∑ ay, testingKLStep v s sp ay = testingNextStateMass sp
Proof (Lean source)
-- @node: testingKLStep_sum lemma testingKLStep_sum (v : ℝ) (s sp : JointState 2 2) : ∑ ay, testingKLStep v s sp ay = testingNextStateMass sp := testingStepMarginal_sum v s sp
CausalSmith.Stat.PomdpBinaryhiddenRate.testingKLStep_sum · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingKL.lean:103
theorem testingKLStep_entropy_le

The common transition factors cancel from the one-epoch KL contribution. Under the listed formal conditions, the stated conclusion holds.

Formal statement
v w :
ℝ
hv :
|v| ≤ 1 / 16
hw :
|w| ≤ 1 / 16
s sp :
(∑ ay, testingKLStep v s sp ay * log (testingKLStep v s sp ay / testingKLStep w s sp ay))
≤ (4 * (v - w) ^ 2) * testingNextStateMass sp
Proof (Lean source)
-- @node: testingKLStep_entropy_le lemma testingKLStep_entropy_le (v w : ℝ) (hv : |v| ≤ 1 / 16) (hw : |w| ≤ 1 / 16) (s sp : JointState 2 2) : (∑ ay, testingKLStep v s sp ay * log (testingKLStep v s sp ay / testingKLStep w s sp ay)) ≤ (4 * (v - w) ^ 2) * testingNextStateMass sp := by let p := testingRewardProb v s.2 let q := testingRewardProb w s.2 let c (a : Bool) : ℝ := (1 / 2 : ℝ) * (if sp.2 = 1 then testingHiddenProb a else 1 - testingHiddenProb a) * testingEmission sp.1 sp.2 have hc (a : Bool) : 0 < c a := by dsimp [c] apply mul_pos · apply mul_pos (by norm_num) cases a <;> split_ifs <;> norm_num [testingHiddenProb] · unfold testingEmission split_ifs <;> norm_num have hp := testingRewardProb_mem_Icc v hv s.2 have hq := testingRewardProb_mem_Icc w hw s.2 have hbern := Causalean.Mathlib.Analysis.bernoulli_kl_le_four_sq_sub_of_mem_quarter_band hp.1 hp.2 hq.1 hq.2 have hdiff : p - q = v - w := by dsimp [p, q, testingRewardProb] ring have hstep (a y : Bool) : testingKLStep v s sp (a, y) = c a * (if y then p else 1 - p) := by dsimp [testingKLStep, c, p] ring have hstep' (a y : Bool) : testingKLStep w s sp (a, y) = c a * (if y then q else 1 - q) := by dsimp [testingKLStep, c, q] ring have hmass : (∑ a, c a) = testingNextStateMass sp := by rcases sp with ⟨x, h⟩ fin_cases x <;> fin_cases h <;> norm_num [c, testingNextStateMass, testingHiddenProb, testingEmission, Fintype.sum_bool] calc _ = (∑ a, c a) * (p * log (p / q) + (1 - p) * log ((1 - p) / (1 - q))) := by rw [Fintype.sum_prod_type] simp_rw [hstep, hstep', mul_div_mul_left _ _ (ne_of_gt (hc _))] simp only [Fintype.sum_bool, ite_true, Bool.false_eq_true, ite_false] ring _ ≤ (∑ a, c a) * (4 * (v - w) ^ 2) := by apply mul_le_mul_of_nonneg_left · simpa only [← hdiff] using hbern · exact Finset.sum_nonneg (by intro a _; exact (hc a).le) _ = _ := by rw [hmass]; ring
CausalSmith.Stat.PomdpBinaryhiddenRate.testingKLStep_entropy_le · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingKL.lean:109

Canceling the common initial mass and adding epoch budgets bounds the complete-data finite path entropy. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
v w :
ℝ
hv :
|v| ≤ 1 / 16
hw :
|w| ≤ 1 / 16
≤ (T : ℝ) * (4 * (v - w) ^ 2)
Proof (Lean source)
-- @node: testingPath_entropy_le lemma testingPath_entropy_le (T : Nat) (v w : ℝ) (hv : |v| ≤ 1 / 16) (hw : |w| ≤ 1 / 16) : (∑ c : TestingPath T, testingPathWeight v c * log (testingPathWeight v c / testingPathWeight w c)) ≤ (T : ℝ) * (4 * (v - w) ^ 2) := by let init (xs : Fin (T + 1) → JointState 2 2) : ℝ := (1 / 2 : ℝ) * testingEmission (xs 0).1 (xs 0).2 have hi (xs : Fin (T + 1) → JointState 2 2) : 0 < init xs := by dsimp [init] apply mul_pos (by norm_num) unfold testingEmission split_ifs <;> norm_num have hm (sp : JointState 2 2) : 0 ≤ testingNextStateMass sp := by rcases sp with ⟨x, h⟩ fin_cases x <;> fin_cases h <;> norm_num [testingNextStateMass, testingHiddenProb, testingEmission] calc _ = ∑ xs : Fin (T + 1) → JointState 2 2, init xs * (∑ ay : Fin T → Bool × Bool, (∏ t, testingKLStep v (xs t.castSucc) (xs t.succ) (ay t)) * log ((∏ t, testingKLStep v (xs t.castSucc) (xs t.succ) (ay t)) / (∏ t, testingKLStep w (xs t.castSucc) (xs t.succ) (ay t)))) := by rw [Fintype.sum_prod_type] apply Finset.sum_congr rfl intro xs _ rw [Finset.mul_sum] apply Finset.sum_congr rfl intro ay _ change (init xs * ∏ t, testingKLStep v (xs t.castSucc) (xs t.succ) (ay t)) * log ((init xs * ∏ t, testingKLStep v (xs t.castSucc) (xs t.succ) (ay t)) / (init xs * ∏ t, testingKLStep w (xs t.castSucc) (xs t.succ) (ay t))) = _ rw [mul_div_mul_left _ _ (ne_of_gt (hi xs))] ring _ ≤ ∑ xs : Fin (T + 1) → JointState 2 2, init xs * ((T : ℝ) * (4 * (v - w) ^ 2) * ∏ t : Fin T, testingNextStateMass (xs t.succ)) := by apply Finset.sum_le_sum intro xs _ apply mul_le_mul_of_nonneg_left _ (hi xs).le exact testing_product_entropy_le T (fun t ay => testingKLStep v (xs t.castSucc) (xs t.succ) ay) (fun t ay => testingKLStep w (xs t.castSucc) (xs t.succ) ay) (fun t => testingNextStateMass (xs t.succ)) (4 * (v - w) ^ 2) (by intro t ay; exact testingKLStep_pos v hv _ _ ay) (by intro t ay; exact testingKLStep_pos w hw _ _ ay) (by intro t; exact hm _) (by intro t; exact testingKLStep_sum v _ _) (by intro t; exact testingKLStep_entropy_le v w hv hw _ _) _ = _ := by simp_rw [show ∀ xs : Fin (T + 1) → JointState 2 2, init xs * ((T : ℝ) * (4 * (v - w) ^ 2) * ∏ t : Fin T, testingNextStateMass (xs t.succ)) = ((T : ℝ) * (4 * (v - w) ^ 2)) * (init xs * ∏ t : Fin T, testingNextStateMass (xs t.succ)) by intro xs; ring] rw [← Finset.mul_sum] have hmass := testingStateMass_sum T testingNextStateMass testingNextStateMass_sum change (T : ℝ) * (4 * (v - w) ^ 2) * (∑ xs : Fin (T + 1) → JointState 2 2, ((1 / 2 : ℝ) * testingEmission (xs 0).1 (xs 0).2) * ∏ t : Fin T, testingNextStateMass (xs t.succ)) = _ rw [hmass, mul_one]
CausalSmith.Stat.PomdpBinaryhiddenRate.testingPath_entropy_le · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingKL.lean:160

Keep the finite Boolean path carrier before decoding to real rewards.

Definition (Lean source)
T :
v :
ℝ
testingFinitePathLaw T v :
∑ c : TestingPath T, ofReal (testingPathWeight v c) • Measure.dirac c
CausalSmith.Stat.PomdpBinaryhiddenRate.testingFinitePathLaw · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingKL.lean:223
theorem testingFinitePathLaw_mass

The finite path law assigns its displayed weight to each singleton. the stated conclusion holds.

Formal statement
T :
v :
ℝ
c :
Proof (Lean source)
-- @node: testingFinitePathLaw_mass lemma testingFinitePathLaw_mass (T : Nat) (v : ℝ) (c : TestingPath T) : testingFinitePathLaw T v {c} = ofReal (testingPathWeight v c) := by classical simp [testingFinitePathLaw, Measure.finsetSum_apply, Measure.smul_apply, Measure.dirac_apply, indicator, eq_comm]
CausalSmith.Stat.PomdpBinaryhiddenRate.testingFinitePathLaw_mass · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingKL.lean:228
theorem testingFinitePathLaw_probability

The finite path measure is normalized throughout the perturbation range. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
v :
ℝ
hv :
|v| ≤ 1 / 16
Proof (Lean source)
-- @node: testingFinitePathLaw_probability lemma testingFinitePathLaw_probability (T : Nat) (v : ℝ) (hv : |v| ≤ 1 / 16) : IsProbabilityMeasure (testingFinitePathLaw T v) := by constructor simp only [testingFinitePathLaw, Measure.finsetSum_apply, Measure.smul_apply, Measure.dirac_apply, Set.indicator_univ, Pi.one_apply, smul_eq_mul, mul_one] rw [← ENNReal.ofReal_sum_of_nonneg (by intro c _; exact testingPathWeight_nonneg v hv c), testingPathWeight_sum] norm_num
CausalSmith.Stat.PomdpBinaryhiddenRate.testingFinitePathLaw_probability · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingKL.lean:236
theorem testingFinitePathLaw_ac

Strictly positive finite path weights give common support. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
v w :
ℝ
hw :
|w| ≤ 1 / 16
Proof (Lean source)
-- @node: testingFinitePathLaw_ac lemma testingFinitePathLaw_ac (T : Nat) (v w : ℝ) (hw : |w| ≤ 1 / 16) : testingFinitePathLaw T v ≪ testingFinitePathLaw T w := by intro A hA simp only [testingFinitePathLaw, Measure.finsetSum_apply, Measure.smul_apply, smul_eq_mul] at hA ⊢ have hzero := Finset.sum_eq_zero_iff.mp hA apply Finset.sum_eq_zero_iff.mpr intro c hc have hc0 := hzero c hc have hpos : ofReal (testingPathWeight w c) ≠ 0 := ne_of_gt (ENNReal.ofReal_pos.mpr (testingPathWeight_pos w hw c)) rw [(mul_eq_zero.mp hc0).resolve_left hpos, mul_zero]
CausalSmith.Stat.PomdpBinaryhiddenRate.testingFinitePathLaw_ac · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingKL.lean:247
theorem testingFinitePathLaw_map

Decoding the finite path measure gives the declared full trajectory law. the stated conclusion holds.

Formal statement
T :
v :
ℝ
Proof (Lean source)
-- @node: testingFinitePathLaw_map lemma testingFinitePathLaw_map (T : Nat) (v : ℝ) : (testingFinitePathLaw T v).map decodeTestingPath = testingTrajectoryLaw T v := by have hf : Measurable (decodeTestingPath (T := T)) := by fun_prop unfold testingFinitePathLaw testingTrajectoryLaw have hmap (F : Finset (TestingPath T)) : (∑ c ∈ F, ofReal (testingPathWeight v c) • Measure.dirac c).map decodeTestingPath = ∑ c ∈ F, ofReal (testingPathWeight v c) • Measure.dirac (decodeTestingPath c) := by classical induction F using Finset.induction_on with | empty => simp | @insert c F hc ih => simp only [Finset.sum_insert hc] rw [Measure.map_add _ _ hf, ih] simp [Measure.map_smul, Measure.map_dirac' hf] exact hmap univ
CausalSmith.Stat.PomdpBinaryhiddenRate.testingFinitePathLaw_map · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingKL.lean:262
theorem testingObservedLaw_klDiv_le

Each reward contributes its Bernoulli divergence; data processing then bounds the observed-law divergence without assumptions on history identities. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
v w :
ℝ
hvFamily :
v = vT T ∨ v = -(vT T)
hv :
|v| ≤ 1 / 16
hwFamily :
w = vT T ∨ w = -(vT T)
hw :
|w| ≤ 1 / 16
klDiv (obsLaw (testingExperiment T v hvFamily hv)) (obsLaw (testingExperiment T w hwFamily hw))
≤ ofReal ((T : ℝ) * (4 * (v - w) ^ 2))
Proof (Lean source)
-- @node: testingObservedLaw_klDiv_le lemma testingObservedLaw_klDiv_le (T : Nat) (v w : ℝ) (hvFamily : v = vT T ∨ v = -(vT T)) (hv : |v| ≤ 1 / 16) (hwFamily : w = vT T ∨ w = -(vT T)) (hw : |w| ≤ 1 / 16) : klDiv (obsLaw (testingExperiment T v hvFamily hv)) (obsLaw (testingExperiment T w hwFamily hw)) ≤ ofReal ((T : ℝ) * (4 * (v - w) ^ 2)) := by let := testingFinitePathLaw_probability T v hv let := testingFinitePathLaw_probability T w hw have hac := testingFinitePathLaw_ac T v w hw have hfin : klDiv (testingFinitePathLaw T v) (testingFinitePathLaw T w) ≠ ⊤ := InformationTheory.klDiv_ne_top hac (Integrable.of_finite) have hbound : (klDiv (testingFinitePathLaw T v) (testingFinitePathLaw T w)).toReal ≤ (T : ℝ) * (4 * (v - w) ^ 2) := by rw [klDiv_toReal_eq_sum_measureReal _ _ hac] simp only [measureReal_def, testingFinitePathLaw_mass, ENNReal.toReal_ofReal (testingPathWeight_nonneg v hv _), ENNReal.toReal_ofReal (testingPathWeight_nonneg w hw _)] exact testingPath_entropy_le T v w hv hw have hfull : klDiv (testingTrajectoryLaw T v) (testingTrajectoryLaw T w) ≤ klDiv (testingFinitePathLaw T v) (testingFinitePathLaw T w) := by rw [← testingFinitePathLaw_map T v, ← testingFinitePathLaw_map T w] exact InformationTheory.klDiv_map_le _ _ (by fun_prop) have hobs : klDiv (obsLaw (testingExperiment T v hvFamily hv)) (obsLaw (testingExperiment T w hwFamily hw)) ≤ klDiv (testingTrajectoryLaw T v) (testingTrajectoryLaw T w) := by have hf : Measurable (obsProj (T := T) (nX := 2) (nH := 2)) := by unfold obsProj curState actionAt rewardAt fun_prop exact InformationTheory.klDiv_map_le _ _ hf apply hobs.trans (hfull.trans _) rw [← ENNReal.ofReal_toReal hfin] exact ENNReal.ofReal_le_ofReal hbound
CausalSmith.Stat.PomdpBinaryhiddenRate.testingObservedLaw_klDiv_le · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/Helpers/TestingKL.lean:282
CausalSmith.Stat.STAT_PomdpBinaryhiddenRate_Research.TCoincidentPolicyReduction 12 declarations When target and behavior policies agree, intervention moments reduce to the on-policy stationary reward mean and the empirical mean has parametric risk.

Coincident-policy reduction

When target and behavior policies agree, intervention moments reduce to the on-policy stationary reward mean and the empirical mean has parametric risk.

theorem coincidentPolicy_kernel_stationary

Coincident policies induce the same transition matrix and selected stationary law. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
M :
heq :
M.e = M.b
conclusion 1
Proof (Lean source)
-- @node: coincidentPolicy_kernel_stationary lemma coincidentPolicy_kernel_stationary {T : Nat} (M : RawPomdpExperiment T 2 2) (heq : M.e = M.b) : policyKernel M M.e = policyKernel M M.b ∧ stationaryLaw (policyKernel M M.e) = stationaryLaw (policyKernel M M.b) := by constructor <;> simp only [heq]
CausalSmith.Stat.PomdpBinaryhiddenRate.coincidentPolicy_kernel_stationary · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/TCoincidentPolicyReduction.lean:19
theorem sequentialIgnorability_supported_action

An action drawn from the behavior policy has positive behavior mass almost surely. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
M :
t :
Fin T
∀ᵐ tau ∂M.law, M.b (curState t tau).1 (actionAt t tau) ≠ 0
Proof (Lean source)
-- @node: sequentialIgnorability_supported_action lemma sequentialIgnorability_supported_action {T : Nat} (M : RawPomdpExperiment T 2 2) (hI : SequentialIgnorability M) (t : Fin T) : ∀ᵐ tau ∂M.law, M.b (curState t tau).1 (actionAt t tau) ≠ 0 := by have hm : Measurable (histActionPair (nX := 2) (nH := 2) t) := by unfold histActionPair histStateView curState actionAt fun_prop have hp : MeasurableSet {h : ActionHistoryView T 2 2 t | M.b h.1.2.1 h.2 ≠ 0} := by exact (measurableSet_eq_fun (by fun_prop) measurable_const).compl apply (ae_map_iff hm.aemeasurable hp).mp rw [hI.2 t] apply Measure.ae_compProd_of_ae_ae hp apply Filter.Eventually.of_forall intro h change ∀ᵐ a ∂(∑ a : Bool, ofReal (M.b h.2.1 a) • Measure.dirac a), M.b h.2.1 a ≠ 0 rw [ae_finsetSum_measure_iff] intro a ha by_cases hb : M.b h.2.1 a = 0 · simp [hb] · apply Measure.ae_smul_measure simpa using hb
CausalSmith.Stat.PomdpBinaryhiddenRate.sequentialIgnorability_supported_action · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/TCoincidentPolicyReduction.lean:27
theorem coincidentPolicy_score_zero_ae

At coincident policies the zero-lag importance score equals the reward, including when the behavior policy has zero cells. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
M :
heq :
M.e = M.b
t :
Fin T
(fun tau => score 0 M.b M.e (obsProj tau) t) =ᵐ[M.law] rewardAt t
Proof (Lean source)
-- @node: coincidentPolicy_score_zero_ae lemma coincidentPolicy_score_zero_ae {T : Nat} (M : RawPomdpExperiment T 2 2) (hI : SequentialIgnorability M) (heq : M.e = M.b) (t : Fin T) : (fun tau => score 0 M.b M.e (obsProj tau) t) =ᵐ[M.law] rewardAt t := by have hfilter : Finset.univ.filter (fun j : Fin T => j.val ≤ t.val ∧ t.val - j.val ≤ 0) = {t} := by ext j simp only [mem_filter, Finset.mem_univ, true_and, Finset.mem_singleton] constructor · intro hj apply Fin.ext omega · intro hj subst j omega filter_upwards [sequentialIgnorability_supported_action M hI t] with tau ht unfold score rw [hfilter] simp [ratio, heq, obsProj, ht]
CausalSmith.Stat.PomdpBinaryhiddenRate.coincidentPolicy_score_zero_ae · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/TCoincidentPolicyReduction.lean:51
theorem coincidentPolicy_reward_mean

The stationary reward mean is the causal target when policies coincide. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
t0 :
ℝ
M :
ht0 :
0 < t0
heq :
M.e = M.b
t :
Fin T
(∫ tau, rewardAt t tau ∂M.law) = targetValue M
Proof (Lean source)
-- @node: coincidentPolicy_reward_mean lemma coincidentPolicy_reward_mean {T : Nat} {t0 : ℝ} (M : RawPomdpExperiment T 2 2) (ht0 : 0 < t0) (hK : PomdpKernelLaw M) (hI : SequentialIgnorability M) (hS : StationaryStart M) (hB : BehaviorContraction (mixingAlpha t0) M) (heq : M.e = M.b) (t : Fin T) : (∫ tau, rewardAt t tau ∂M.law) = targetValue M := by calc _ = populationMoment M 0 t := (integral_congr_ae (coincidentPolicy_score_zero_ae M hI heq t)).symm _ = _ := observable_intervention_moment_zero M ht0 hK hI hS hB heq t
CausalSmith.Stat.PomdpBinaryhiddenRate.coincidentPolicy_reward_mean · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/TCoincidentPolicyReduction.lean:74
theorem coincidentPolicy_sampleMean_unbiased

The observed sample mean is unbiased at coincident policies. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
t0 :
ℝ
M :
ht0 :
0 < t0
hT :
1 ≤ T
heq :
M.e = M.b
(∫ tau, ((T : ℝ)⁻¹ * ∑ t : Fin T, rewardAt t tau) ∂M.law) = targetValue M
Proof (Lean source)
-- @node: coincidentPolicy_sampleMean_unbiased lemma coincidentPolicy_sampleMean_unbiased {T : Nat} {t0 : ℝ} (M : RawPomdpExperiment T 2 2) (ht0 : 0 < t0) (hT : 1 ≤ T) (hK : PomdpKernelLaw M) (hI : SequentialIgnorability M) (hS : StationaryStart M) (hB : BehaviorContraction (mixingAlpha t0) M) (heq : M.e = M.b) : (∫ tau, ((T : ℝ)⁻¹ * ∑ t : Fin T, rewardAt t tau) ∂M.law) = targetValue M := by rw [integral_const_mul, integral_finsetSum] · simp_rw [coincidentPolicy_reward_mean M ht0 hK hI hS hB heq] have hTne : (T : ℝ) ≠ 0 := by exact_mod_cast (by omega : T ≠ 0) simp [hTne] · intro t _ exact pomdp_reward_integrable M hK t
CausalSmith.Stat.PomdpBinaryhiddenRate.coincidentPolicy_sampleMean_unbiased · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/TCoincidentPolicyReduction.lean:87
theorem coincidentPolicy_binaryClass

Coincident policies supply overlap radius zero and the same contraction for both kernels. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
t0 :
ℝ
M :
ht0 :
0 < t0
heq :
M.e = M.b
Proof (Lean source)
-- @node: coincidentPolicy_binaryClass lemma coincidentPolicy_binaryClass {T : Nat} {t0 : ℝ} (M : RawPomdpExperiment T 2 2) (ht0 : 0 < t0) (hK : PomdpKernelLaw M) (hI : SequentialIgnorability M) (hS : StationaryStart M) (hB : BehaviorContraction (mixingAlpha t0) M) (heq : M.e = M.b) : BinaryPomdpClass t0 0 M := by refine ⟨ht0, le_refl 0, hK, hI, hS, ?_, hB, ?_⟩ · constructor · simpa only [heq] using hI.1 · intro x a simp only [heq, policyFactor, Real.exp_zero, one_mul, le_refl] · simpa only [TargetContraction, BehaviorContraction, heq] using hB
CausalSmith.Stat.PomdpBinaryhiddenRate.coincidentPolicy_binaryClass · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/TCoincidentPolicyReduction.lean:103
theorem coincidentPolicy_reward_covariance

Separated rewards have the geometric covariance bound at coincident policies. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
t0 :
ℝ
M :
ht0 :
0 < t0
heq :
M.e = M.b
t u :
Fin T
htu :
t < u
|covariance (rewardAt t) (rewardAt u) M.law| ≤ mixingAlpha t0 ^ (u.val - t.val - 1)
Proof (Lean source)
-- @node: coincidentPolicy_reward_covariance lemma coincidentPolicy_reward_covariance {T : Nat} {t0 : ℝ} (M : RawPomdpExperiment T 2 2) (ht0 : 0 < t0) (hK : PomdpKernelLaw M) (hI : SequentialIgnorability M) (hS : StationaryStart M) (hB : BehaviorContraction (mixingAlpha t0) M) (heq : M.e = M.b) (t u : Fin T) (htu : t < u) : |covariance (rewardAt t) (rewardAt u) M.law| ≤ mixingAlpha t0 ^ (u.val - t.val - 1) := by have hClass := coincidentPolicy_binaryClass M ht0 hK hI hS hB heq have hc := (observable_intervention_moments M hClass (0 : Fin 7) t (zero_le _)).2.2 u (by change 1 ≤ u.val - t.val; omega) have he : scoreCovariance M 0 t u = covariance (rewardAt t) (rewardAt u) M.law := by unfold scoreCovariance covariance rw [observable_intervention_moment_zero M ht0 hK hI hS hB heq t, observable_intervention_moment_zero M ht0 hK hI hS hB heq u, coincidentPolicy_reward_mean M ht0 hK hI hS hB heq t, coincidentPolicy_reward_mean M ht0 hK hI hS hB heq u] apply integral_congr_ae filter_upwards [coincidentPolicy_score_zero_ae M hI heq t, coincidentPolicy_score_zero_ae M hI heq u] with tau ht hu rw [ht, hu] simpa only [Fin.val_zero, Nat.sub_zero, he] using hc
CausalSmith.Stat.PomdpBinaryhiddenRate.coincidentPolicy_reward_covariance · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/TCoincidentPolicyReduction.lean:117

A finite geometric tail is bounded by the infinite-series value. Under the listed formal conditions, the stated conclusion holds.

Formal statement
a :
ℝ
ha0 :
0 ≤ a
ha1 :
a < 1
n :
∑ j ∈ range n, a ^ j ≤ 1 / (1 - a)
Proof (Lean source)
-- @node: finiteGeometric_sum_le lemma finiteGeometric_sum_le (a : ℝ) (ha0 : 0 ≤ a) (ha1 : a < 1) (n : Nat) : ∑ j ∈ range n, a ^ j ≤ 1 / (1 - a) := by have hgeom := geom_sum_mul a n have hp : 0 ≤ a ^ n := pow_nonneg ha0 n apply (le_div_iff₀ (sub_pos.mpr ha1)).mpr nlinarith
CausalSmith.Stat.PomdpBinaryhiddenRate.finiteGeometric_sum_le · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/TCoincidentPolicyReduction.lean:141
theorem finiteGeometric_sum_image_le Lemma finiteGeometric_sum_image_le in the paper ↗

An injectively indexed subset of a geometric tail satisfies the same bound. Under the listed formal conditions, the stated conclusion holds.

Formal statement
ι :
Type*
s :
f :
ι → Nat
n :
a :
ℝ
ha0 :
0 ≤ a
ha1 :
a < 1
hf :
∀ i ∈ s, f i < n
hinj :
InjOn f ↑s
∑ i ∈ s, a ^ f i ≤ 1 / (1 - a)
Proof (Lean source)
-- @node: finiteGeometric_sum_image_le lemma finiteGeometric_sum_image_le {ι : Type*} (s : Finset ι) (f : ι → Nat) (n : Nat) (a : ℝ) (ha0 : 0 ≤ a) (ha1 : a < 1) (hf : ∀ i ∈ s, f i < n) (hinj : InjOn f ↑s) : ∑ i ∈ s, a ^ f i ≤ 1 / (1 - a) := by classical apply le_trans _ (finiteGeometric_sum_le a ha0 ha1 n) rw [← Finset.sum_image hinj] apply Finset.sum_le_sum_of_subset_of_nonneg · intro j hj obtain ⟨i, hi, rfl⟩ := Finset.mem_image.mp hj exact Finset.mem_range.mpr (hf i hi) · intro j _ _ exact pow_nonneg ha0 j
CausalSmith.Stat.PomdpBinaryhiddenRate.finiteGeometric_sum_image_le · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/TCoincidentPolicyReduction.lean:150
theorem geometricCovariance_row_sum_le Lemma geometricCovariance_row_sum_le in the paper ↗

A symmetric covariance row with unit diagonal and geometric off-diagonal bounds has total mass at most one plus two geometric tails. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
f :
Fin T → Fin T → ℝ
a :
ℝ
ha0 :
0 ≤ a
ha1 :
a < 1
hsymm :
∀ t u, f t u = f u t
hdiag :
∀ t, f t t ≤ 1
hupper :
∀ t u
if
t < u
then
f t u ≤ a ^ (u.val - t.val - 1)
t :
Fin T
∑ u, f t u ≤ 1 + 2 / (1 - a)
Proof (Lean source)
-- @node: geometricCovariance_row_sum_le lemma geometricCovariance_row_sum_le {T : Nat} (f : Fin T → Fin T → ℝ) (a : ℝ) (ha0 : 0 ≤ a) (ha1 : a < 1) (hsymm : ∀ t u, f t u = f u t) (hdiag : ∀ t, f t t ≤ 1) (hupper : ∀ t u, t < u → f t u ≤ a ^ (u.val - t.val - 1)) (t : Fin T) : ∑ u, f t u ≤ 1 + 2 / (1 - a) := by have hsplit : (∑ u, f t u) = f t t + (∑ u ∈ Finset.univ.filter (fun u => u < t), f t u) + (∑ u ∈ Finset.univ.filter (fun u => t < u), f t u) := by calc _ = (∑ u : Fin T, if u = t then f t t else 0) + (∑ u : Fin T, if u < t then f t u else 0) + (∑ u : Fin T, if t < u then f t u else 0) := by rw [← Finset.sum_add_distrib, ← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro u _ rcases lt_trichotomy u t with h | h | h · simp [h, ne_of_lt h, not_lt_of_gt h] · subst u simp · simp [h, ne_of_gt h, not_lt_of_gt h] _ = _ := by simp [Finset.sum_filter] have hpast : (∑ u ∈ Finset.univ.filter (fun u => u < t), f t u) ≤ 1 / (1 - a) := by calc _ ≤ ∑ u ∈ Finset.univ.filter (fun u => u < t), a ^ (t.val - u.val - 1) := by apply Finset.sum_le_sum intro u hu rw [hsymm] exact hupper u t (Finset.mem_filter.mp hu).2 _ ≤ _ := by apply finiteGeometric_sum_image_le _ _ T a ha0 ha1 · intro u hu have hut := (Finset.mem_filter.mp hu).2 omega · intro u hu w hw heq have hut := (Finset.mem_filter.mp hu).2 have hwt := (Finset.mem_filter.mp hw).2 dsimp only at heq apply Fin.ext omega have hfuture : (∑ u ∈ Finset.univ.filter (fun u => t < u), f t u) ≤ 1 / (1 - a) := by calc _ ≤ ∑ u ∈ Finset.univ.filter (fun u => t < u), a ^ (u.val - t.val - 1) := by apply Finset.sum_le_sum intro u hu exact hupper t u (Finset.mem_filter.mp hu).2 _ ≤ _ := by apply finiteGeometric_sum_image_le _ _ T a ha0 ha1 · intro u hu have htu := (Finset.mem_filter.mp hu).2 omega · intro u hu w hw heq have htu := (Finset.mem_filter.mp hu).2 have htw := (Finset.mem_filter.mp hw).2 dsimp only at heq apply Fin.ext omega rw [hsplit] simp only [div_eq_mul_inv, one_mul] at hpast hfuture ⊢ linarith [hdiag t]
CausalSmith.Stat.PomdpBinaryhiddenRate.geometricCovariance_row_sum_le · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/TCoincidentPolicyReduction.lean:167
theorem coincidentPolicy_sampleMean_mse

Expanding the covariance sum gives the stated parametric on-policy risk bound. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
t0 :
ℝ
M :
ht0 :
0 < t0
hT :
1 ≤ T
heq :
M.e = M.b
(∫ tau, (((T : ℝ)⁻¹ * ∑ t : Fin T, rewardAt t tau) - targetValue M) ^ 2 ∂M.law)
≤ (1 + 2 / (1 - mixingAlpha t0)) / T
Proof (Lean source)
-- @node: coincidentPolicy_sampleMean_mse lemma coincidentPolicy_sampleMean_mse {T : Nat} {t0 : ℝ} (M : RawPomdpExperiment T 2 2) (ht0 : 0 < t0) (hT : 1 ≤ T) (hK : PomdpKernelLaw M) (hI : SequentialIgnorability M) (hS : StationaryStart M) (hB : BehaviorContraction (mixingAlpha t0) M) (heq : M.e = M.b) : (∫ tau, (((T : ℝ)⁻¹ * ∑ t : Fin T, rewardAt t tau) - targetValue M) ^ 2 ∂M.law) ≤ (1 + 2 / (1 - mixingAlpha t0)) / T := by have hLp (t : Fin T) : MemLp (rewardAt t) 2 M.law := memLp_of_bounded (pomdp_reward_mem_Icc_ae M hK t) (by unfold rewardAt; fun_prop) 2 have ha0 : 0 ≤ mixingAlpha t0 := (Real.exp_pos _).le have ha1 : mixingAlpha t0 < 1 := by unfold mixingAlpha exact Real.exp_lt_one_iff.mpr (neg_neg_of_pos (one_div_pos.mpr ht0)) have hdiag (t : Fin T) : covariance (rewardAt t) (rewardAt t) M.law ≤ 1 := by rw [covariance_self (by unfold rewardAt; fun_prop), variance_eq_sub (hLp t)] have hs : (∫ tau, rewardAt t tau ^ 2 ∂M.law) ≤ 1 := by calc _ ≤ ∫ _tau, (1 : ℝ) ∂M.law := by apply integral_mono_ae (hLp t).integrable_sq (integrable_const _) filter_upwards [pomdp_reward_mem_Icc_ae M hK t] with tau ht nlinarith [ht.1, ht.2] _ = 1 := by simp change (∫ tau, rewardAt t tau ^ 2 ∂M.law) - (∫ tau, rewardAt t tau ∂M.law) ^ 2 ≤ 1 linarith [sq_nonneg (∫ tau, rewardAt t tau ∂M.law)] have hsum : variance (fun tau => ∑ t : Fin T, rewardAt t tau) M.law ≤ (T : ℝ) * (1 + 2 / (1 - mixingAlpha t0)) := by rw [variance_fun_sum hLp] calc _ ≤ ∑ _t : Fin T, (1 + 2 / (1 - mixingAlpha t0)) := by apply Finset.sum_le_sum intro t _ apply geometricCovariance_row_sum_le (fun t u => covariance (rewardAt t) (rewardAt u) M.law) _ ha0 ha1 _ _ _ t · intro t u exact covariance_comm _ _ · exact hdiag · intro t u htu exact (le_abs_self _).trans (coincidentPolicy_reward_covariance M ht0 hK hI hS hB heq t u htu) _ = _ := by simp; ring have hmean := coincidentPolicy_sampleMean_unbiased M ht0 hT hK hI hS hB heq have hmeas : AEMeasurable (fun tau => (T : ℝ)⁻¹ * ∑ t : Fin T, rewardAt t tau) M.law := by unfold rewardAt fun_prop rw [← hmean, ← variance_eq_integral hmeas, variance_const_mul] calc _ ≤ (T : ℝ)⁻¹ ^ 2 * ((T : ℝ) * (1 + 2 / (1 - mixingAlpha t0))) := mul_le_mul_of_nonneg_left hsum (sq_nonneg _) _ = _ := by have hTne : (T : ℝ) ≠ 0 := by exact_mod_cast (by omega : T ≠ 0) field_simp
CausalSmith.Stat.PomdpBinaryhiddenRate.coincidentPolicy_sampleMean_mse · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/TCoincidentPolicyReduction.lean:232
theorem coincidentPolicy_reduction

For positive mixing time, a nonempty horizon, the POMDP kernel law, sequential ignorability, stationary start, behavior contraction, and coincident policies, the on-policy identity, unbiased sample mean, and variance bound hold.

Formal statement
T :
t0 :
ℝ
M :
ht0 :
0 < t0
hT :
1 ≤ T
heq :
M.e = M.b
conclusion 1
conclusion 3
t :
Fin T
populationMoment M 0 t = targetValue M
conclusion 4
(∫ tau, ((T : ℝ)⁻¹ * ∑ t : Fin T, rewardAt t tau) ∂M.law) = targetValue M
conclusion 5
(∫ tau, (((T : ℝ)⁻¹ * ∑ t : Fin T, rewardAt t tau) - targetValue M) ^ 2 ∂M.law)
≤ (1 + 2 / (1 - mixingAlpha t0)) / T
Proof (Lean source)
theorem coincidentPolicy_reduction {T : Nat} {t0 : ℝ} (M : RawPomdpExperiment T 2 2) (ht0 : 0 < t0) (hT : 1 ≤ T) (hK : PomdpKernelLaw M) (hI : SequentialIgnorability M) (hS : StationaryStart M) (hB : BehaviorContraction (mixingAlpha t0) M) (heq : M.e = M.b) : policyKernel M M.e = policyKernel M M.b ∧ stationaryLaw (policyKernel M M.e) = stationaryLaw (policyKernel M M.b) ∧ (∀ t : Fin T, populationMoment M 0 t = targetValue M) ∧ (∫ tau, ((T : ℝ)⁻¹ * ∑ t : Fin T, rewardAt t tau) ∂M.law) = targetValue M ∧ (∫ tau, (((T : ℝ)⁻¹ * ∑ t : Fin T, rewardAt t tau) - targetValue M) ^ 2 ∂M.law) ≤ (1 + 2 / (1 - mixingAlpha t0)) / T := by obtain ⟨hP, hd⟩ := coincidentPolicy_kernel_stationary M heq refine ⟨hP, hd, ?_, ?_⟩ · intro t exact observable_intervention_moment_zero M ht0 hK hI hS hB heq t constructor · exact coincidentPolicy_sampleMean_unbiased M ht0 hT hK hI hS hB heq · exact coincidentPolicy_sampleMean_mse M ht0 hT hK hI hS hB heq
CausalSmith.Stat.PomdpBinaryhiddenRate.coincidentPolicy_reduction · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/TCoincidentPolicyReduction.lean:291
CausalSmith.Stat.STAT_PomdpBinaryhiddenRate_Research.TExhaustiveGridComplexity 6 declarations The finite simplex grid has a stars-and-bars count.

Candidate count of the exhaustive grid

The finite simplex grid has a stars-and-bars count. Its candidate-list cardinality has degree-nineteen growth for fixed mixing scale.

Stars and bars for the four-coordinate grid. the stated conclusion holds.

Formal statement
M :
(simplexGrid M).card = choose (M + 3) 3
Proof (Lean source)
lemma simplexGrid_card (M : Nat) : (simplexGrid M).card = choose (M + 3) 3 := by classical let E : (simplexGrid M) ≃ {P : Fin 4 → Nat // ∑ i, P i = M} := { toFun := fun u => ⟨fun i => (u.1 i).val, by have h := u.2 simpa [simplexGrid, IsGridRow] using h⟩ invFun := fun v => ⟨fun i => ⟨v.1 i, by have h := Finset.single_le_sum_of_canonicallyOrdered (s := (Finset.univ : Finset (Fin 4))) (f := v.1) (Finset.mem_univ i) rw [v.2] at h omega⟩, by simp [simplexGrid, IsGridRow, v.2]⟩ left_inv := by intro u apply Subtype.ext funext i apply Fin.ext rfl right_inv := by intro v apply Subtype.ext funext i rfl } calc (simplexGrid M).card = card (simplexGrid M) := (Fintype.card_coe _).symm _ = card (Sym (Fin 4) M) := by exact Fintype.card_congr (E.trans (Sym.equivNatSumOfFintype (Fin 4) M).symm) _ = choose (M + 3) 3 := by rw [Sym.card_sym_eq_choose] simp only [Fintype.card_fin] simpa [Nat.add_comm, Nat.add_left_comm, Nat.add_assoc] using (Nat.choose_symm_add (a := M) (b := 3))
CausalSmith.Stat.PomdpBinaryhiddenRate.simplexGrid_card · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/TExhaustiveGridComplexity.lean:19

Four independently selected simplex rows form the matrix grid. the stated conclusion holds.

Formal statement
M :
(gridMatrixRows M).card = (simplexGrid M).card ^ 4
Proof (Lean source)
lemma gridMatrixRows_card (M : Nat) : (gridMatrixRows M).card = (simplexGrid M).card ^ 4 := by classical unfold gridMatrixRows simp only rw [Finset.card_image_of_injective] · rw [Finset.card_pi] simp · intro R S h funext i hi j have heq := congrFun h i exact congrFun heq j
CausalSmith.Stat.PomdpBinaryhiddenRate.gridMatrixRows_card · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/TExhaustiveGridComplexity.lean:58
theorem gridCandidateUniverse_card Lemma gridCandidateUniverse_card in the paper ↗

An unfiltered code consists of an initial row, four matrix rows, and rewards. the stated conclusion holds.

Formal statement
M :
(gridCandidateUniverse M).card = (simplexGrid M).card ^ 5 * (M + 1) ^ 4
Proof (Lean source)
lemma gridCandidateUniverse_card (M : Nat) : (gridCandidateUniverse M).card = (simplexGrid M).card ^ 5 * (M + 1) ^ 4 := by classical have heq : gridCandidateUniverse M = (simplexGrid M).product ((gridMatrixRows M).product (Finset.univ : Finset (Fin 4 → Fin (M + 1)))) := by ext c rcases c with ⟨nu, R, r⟩ simp [gridCandidateUniverse] rw [heq] change ((simplexGrid M) ×ˢ ((gridMatrixRows M) ×ˢ (Finset.univ : Finset (Fin 4 → Fin (M + 1))))).card = _ rw [Finset.card_product, Finset.card_product, gridMatrixRows_card] simp only [Finset.card_univ, Fintype.card_fun, Fintype.card_fin] ring
CausalSmith.Stat.PomdpBinaryhiddenRate.gridCandidateUniverse_card · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/TExhaustiveGridComplexity.lean:73
theorem gridCandidateUniverse_growth Lemma gridCandidateUniverse_growth in the paper ↗

The exact count is bounded by a degree-nineteen monomial. the stated conclusion holds.

Formal statement
M :
(gridCandidateUniverse M).card ≤ (M + 3) ^ 19
Proof (Lean source)
lemma gridCandidateUniverse_growth (M : Nat) : (gridCandidateUniverse M).card ≤ (M + 3) ^ 19 := by rw [gridCandidateUniverse_card, simplexGrid_card] calc (choose (M + 3) 3)^5 * (M + 1)^4 ≤ ((M + 3)^3)^5 * (M + 3)^4 := by gcongr · exact Nat.choose_le_pow (M + 3) 3 · omega _ = (M + 3)^19 := by ring
CausalSmith.Stat.PomdpBinaryhiddenRate.gridCandidateUniverse_growth · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/TExhaustiveGridComplexity.lean:92

The ceiling resolution grows linearly with the trajectory length. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
alpha :
ℝ
ha :
0 < alpha
hT :
1 ≤ T
((gridSize T alpha : Nat) : ℝ) + 3 ≤ (26 + 36 / alpha) * (T : ℝ)
Proof (Lean source)
lemma gridSize_linear_bound (T : Nat) (alpha : ℝ) (ha : 0 < alpha) (hT : 1 ≤ T) : ((gridSize T alpha : Nat) : ℝ) + 3 ≤ (26 + 36 / alpha) * (T : ℝ) := by have hA : 0 ≤ (22 + 36 / alpha) * (T : ℝ) := by positivity have hc := Nat.ceil_lt_add_one hA have hc' : ((gridSize T alpha : Nat) : ℝ) < (22 + 36 / alpha) * (T : ℝ) + 1 := by simpa [gridSize] using hc have hT' : (1 : ℝ) ≤ T := by exact_mod_cast hT have hdiv : 0 ≤ 36 / alpha := by positivity nlinarith
CausalSmith.Stat.PomdpBinaryhiddenRate.gridSize_linear_bound · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/TExhaustiveGridComplexity.lean:105
theorem exhaustiveGrid_candidate_count

For positive mixing time, the stars-and-bars grid size, exact unfiltered candidate count, and degree-nineteen candidate-list growth hold for fixed t0. No fitting or selection cost is assigned.

Formal statement
t0 :
ℝ
_ht0 :
0 < t0
conclusion 1
M :
(simplexGrid M).card = choose (M + 3) 3
conclusion 2
M :
(gridCandidateUniverse M).card = (choose (M + 3) 3) ^ 5 * (M + 1) ^ 4
conclusion 3
M :
alpha :
ℝ
(gridCandidates M alpha).card ≤ (gridCandidateUniverse M).card
conclusion 4
∃ c : ℝ,
0 < c
T :
1 ≤ T
((gridCandidateUniverse (gridSize T (mixingAlpha t0))).card : ℝ) ≤ c * (T : ℝ) ^ 19
((gridCandidates (gridSize T (mixingAlpha t0)) (mixingAlpha t0)).card : ℝ)
≤ c * (T : ℝ) ^ 19
Proof (Lean source)
theorem exhaustiveGrid_candidate_count (t0 : ℝ) (_ht0 : 0 < t0) : (∀ M : Nat, (simplexGrid M).card = choose (M + 3) 3) ∧ (∀ M : Nat, (gridCandidateUniverse M).card = (choose (M + 3) 3) ^ 5 * (M + 1) ^ 4) ∧ (∀ M : Nat, ∀ alpha : ℝ, (gridCandidates M alpha).card ≤ (gridCandidateUniverse M).card) ∧ (∃ c : ℝ, 0 < c ∧ ∀ T : Nat, 1 ≤ T → ((gridCandidateUniverse (gridSize T (mixingAlpha t0))).card : ℝ) ≤ c * (T : ℝ) ^ 19 ∧ ((gridCandidates (gridSize T (mixingAlpha t0)) (mixingAlpha t0)).card : ℝ) ≤ c * (T : ℝ) ^ 19) := by refine ⟨simplexGrid_card, ?_, ?_, ?_⟩ · intro M rw [gridCandidateUniverse_card, simplexGrid_card] · intro M alpha exact Finset.card_filter_le _ _ · let alpha := mixingAlpha t0 let c := (26 + 36 / alpha) ^ 19 have ha : 0 < alpha := by change 0 < exp (-(1 / t0)) exact Real.exp_pos _ have hc : 0 < c := by dsimp [c]; positivity refine ⟨c, hc, ?_⟩ intro T hT let M := gridSize T alpha have hM : ((M : Nat) : ℝ) + 3 ≤ (26 + 36 / alpha) * (T : ℝ) := gridSize_linear_bound T alpha ha hT have hcount : (gridCandidateUniverse M).card ≤ (M + 3) ^ 19 := gridCandidateUniverse_growth M have hreal : ((gridCandidateUniverse M).card : ℝ) ≤ (((M + 3) ^ 19 : Nat) : ℝ) := by exact_mod_cast hcount have hpower : (((M + 3) ^ 19 : Nat) : ℝ) ≤ c * (T : ℝ) ^ 19 := by calc (((M + 3) ^ 19 : Nat) : ℝ) = ((M : ℝ) + 3) ^ 19 := by simp only [Nat.cast_pow, Nat.cast_add, Nat.cast_ofNat] _ ≤ ((26 + 36 / alpha) * (T : ℝ)) ^ 19 := by exact pow_le_pow_left₀ (add_nonneg (Nat.cast_nonneg _) (by norm_num)) hM 19 _ = c * (T : ℝ) ^ 19 := by change ((26 + 36 / alpha) * (T : ℝ)) ^ 19 = (26 + 36 / alpha) ^ 19 * (T : ℝ) ^ 19 exact mul_pow _ _ _ have hfiltered : (gridCandidates M alpha).card ≤ (gridCandidateUniverse M).card := Finset.card_filter_le _ _ constructor · exact le_trans hreal hpower · exact le_trans (by exact_mod_cast hfiltered) (le_trans hreal hpower)
CausalSmith.Stat.PomdpBinaryhiddenRate.exhaustiveGrid_candidate_count · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/TExhaustiveGridComplexity.lean:120
CausalSmith.Stat.STAT_PomdpBinaryhiddenRate_Research.TFixedBinaryMinimax 6 declarations The seven-moment upper bound and positive four-state testing pair give a uniform parametric minimax rate.

Fixed-binary POMDP minimax rate

The seven-moment upper bound and positive four-state testing pair give a uniform parametric minimax rate. The cited cardinality-uniform comparator is an explicit input only to the contrast with growing hidden cardinality.

theorem sqRisk_ge_error_probability Lemma sqRisk_ge_error_probability in the paper ↗

A squared risk dominates the squared threshold times its error probability. Under the listed formal conditions, the stated conclusion holds.

Formal statement
Ω :
est :
Ω → ℝ
hest :
theta s :
ℝ
hs :
0 ≤ s
hint :
Integrable (fun ω => (est ω - theta) ^ 2) P
s ^ 2 * P.real {ω | s ≤ |est ω - theta|} ≤ sqRisk P est theta
Proof (Lean source)
lemma sqRisk_ge_error_probability {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] (est : Ω → ℝ) (hest : Measurable est) (theta s : ℝ) (hs : 0 ≤ s) (hint : Integrable (fun ω => (est ω - theta) ^ 2) P) : s ^ 2 * P.real {ω | s ≤ |est ω - theta|} ≤ sqRisk P est theta := by let A : Set Ω := {ω | s ≤ |est ω - theta|} have hpoint (ω : Ω) : (s ^ 2 * indicator A (fun _ : Ω => (1 : ℝ)) ω) ≤ (est ω - theta) ^ 2 := by by_cases hω : ω ∈ A · simp only [Set.indicator_of_mem hω, mul_one] have ha : s ≤ |est ω - theta| := hω nlinarith [sq_nonneg (est ω - theta), sq_nonneg (|est ω - theta|), abs_nonneg (est ω - theta), sq_abs (est ω - theta)] · simp [indicator, hω] positivity have hmono := MeasureTheory.integral_mono_of_nonneg (MeasureTheory.ae_of_all P (fun ω => mul_nonneg (sq_nonneg s) (Set.indicator_nonneg (fun _ _ => zero_le_one) ω))) hint (MeasureTheory.ae_of_all P hpoint) have hA : MeasurableSet A := by change MeasurableSet ((fun ω => |est ω - theta|) ⁻¹' Ici s) have hm : Measurable (fun ω => |est ω - theta|) := by fun_prop exact hm measurableSet_Ici have hind : (∫ ω, A.indicator (fun _ : Ω => (1 : ℝ)) ω ∂P) = P.real A := by exact MeasureTheory.integral_indicator_one hA calc s ^ 2 * P.real {ω | s ≤ |est ω - theta|} = ∫ ω, s ^ 2 * A.indicator (fun _ : Ω => (1 : ℝ)) ω ∂P := by rw [MeasureTheory.integral_const_mul, hind] _ ≤ sqRisk P est theta := hmono
CausalSmith.Stat.PomdpBinaryhiddenRate.sqRisk_ge_error_probability · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/TFixedBinaryMinimax.lean:22
theorem bounded_estimator_sqError_integrable Lemma bounded_estimator_sqError_integrable in the paper ↗

A measurable estimator taking values in the unit interval has integrable square loss. Under the listed formal conditions, the stated conclusion holds.

Formal statement
Ω :
est :
Ω → ℝ
hest :
hbound :
∀ ω, est ω ∈ Icc (0 : ℝ) 1
theta :
ℝ
Integrable (fun ω => (est ω - theta) ^ 2) P
Proof (Lean source)
lemma bounded_estimator_sqError_integrable {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] (est : Ω → ℝ) (hest : Measurable est) (hbound : ∀ ω, est ω ∈ Icc (0 : ℝ) 1) (theta : ℝ) : Integrable (fun ω => (est ω - theta) ^ 2) P := by apply MeasureTheory.Integrable.of_bound (by fun_prop) ((1 + |theta|) ^ 2) filter_upwards [] with ω have hb := hbound ω have heAbs : |est ω| ≤ 1 := abs_le.mpr ⟨by linarith [hb.1], hb.2⟩ have hd : |est ω - theta| ≤ 1 + |theta| := by calc |est ω - theta| ≤ |est ω| + |theta| := abs_sub _ _ _ ≤ 1 + |theta| := by linarith rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] have hmul := mul_nonneg (sub_nonneg.mpr hd) (add_nonneg (by positivity : 0 ≤ 1 + |theta|) (abs_nonneg (est ω - theta))) nlinarith [sq_abs (est ω - theta)]
CausalSmith.Stat.PomdpBinaryhiddenRate.bounded_estimator_sqError_integrable · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/TFixedBinaryMinimax.lean:56
theorem testingPair_observedRisk_lower

The finite-KL testing pair forces a squared-risk lower bound for each observable estimator. Under the listed formal conditions, the stated conclusion holds.

Formal statement
T :
hT :
12 ≤ T
Mp Mm :
hb :
Mp.b = Mm.b
he :
Mp.e = Mm.e
hsep :
|targetValue Mp - targetValue Mm| = 1 / (8 * sqrt T)
hfin :
klDiv (obsLaw Mp) (obsLaw Mm) ≠ ⊤
hkl :
(klDiv (obsLaw Mp) (obsLaw Mm)).toReal ≤ 1 / 12
1 / (1024 * (T : ℝ))
≤ max (sqRisk (obsLaw Mp) (est.1 Mp.b Mp.e) (targetValue Mp)) (sqRisk (obsLaw Mm) (est.1 Mm.b Mm.e) (targetValue Mm))
Proof (Lean source)
lemma testingPair_observedRisk_lower (T : Nat) (hT : 12 ≤ T) (Mp Mm : RawPomdpExperiment T 2 2) (hb : Mp.b = Mm.b) (he : Mp.e = Mm.e) (hsep : |targetValue Mp - targetValue Mm| = 1 / (8 * sqrt T)) (hfin : klDiv (obsLaw Mp) (obsLaw Mm) ≠ ⊤) (hkl : (klDiv (obsLaw Mp) (obsLaw Mm)).toReal ≤ 1 / 12) (est : ObservableEstimator T) : 1 / (1024 * (T : ℝ)) ≤ max (sqRisk (obsLaw Mp) (est.1 Mp.b Mp.e) (targetValue Mp)) (sqRisk (obsLaw Mm) (est.1 Mm.b Mm.e) (targetValue Mm)) := by let f := est.1 Mp.b Mp.e have hf : Measurable f := est.2.2 Mp.b Mp.e have hfBound : ∀ w, f w ∈ Icc (0 : ℝ) 1 := est.2.1 Mp.b Mp.e have hfo : est.1 Mm.b Mm.e = f := by simp only [← hb, ← he, f] letI : IsProbabilityMeasure (obsLaw Mp) := by unfold obsLaw exact isProbabilityMeasure_map (by unfold obsProj curState actionAt rewardAt fun_prop) letI : IsProbabilityMeasure (obsLaw Mm) := by unfold obsLaw exact isProbabilityMeasure_map (by unfold obsProj curState actionAt rewardAt fun_prop) have htv0 : tvDist (obsLaw Mp) (obsLaw Mm) ≤ sqrt ((klDiv (obsLaw Mp) (obsLaw Mm)).toReal / 2) := pinskerBound_of_ac_of_ne_top _ _ (InformationTheory.klDiv_ne_top_iff.mp hfin).1 hfin have htv : tvDist (obsLaw Mp) (obsLaw Mm) ≤ 1 / 4 := by have hk0 : 0 ≤ (klDiv (obsLaw Mp) (obsLaw Mm)).toReal := ENNReal.toReal_nonneg have hsq := Real.sq_sqrt (by positivity : 0 ≤ (klDiv (obsLaw Mp) (obsLaw Mm)).toReal / 2) have hroot := Real.sqrt_nonneg ((klDiv (obsLaw Mp) (obsLaw Mm)).toReal / 2) nlinarith let s : ℝ := 1 / (16 * sqrt T) have hsqrt : 0 < sqrt T := Real.sqrt_pos.2 (by exact_mod_cast (by omega : 0 < T)) have hs : 0 ≤ s := by dsimp [s]; positivity have hsep' : 2 * s ≤ |targetValue Mp - targetValue Mm| := by rw [hsep] dsimp [s] ring_nf exact le_refl _ have herr := two_point_lower_bound_of_tvDist_le (P₀ := obsLaw Mp) (P₁ := obsLaw Mm) (est := f) hf hsep' htv have hrp := sqRisk_ge_error_probability (obsLaw Mp) f hf (targetValue Mp) s hs (bounded_estimator_sqError_integrable (obsLaw Mp) f hf hfBound _) have hrm := sqRisk_ge_error_probability (obsLaw Mm) f hf (targetValue Mm) s hs (bounded_estimator_sqError_integrable (obsLaw Mm) f hf hfBound _) have htwo : s ^ 2 * ((1 - 1 / 4 : ℝ) / 2) ≤ max (sqRisk (obsLaw Mp) f (targetValue Mp)) (sqRisk (obsLaw Mm) f (targetValue Mm)) := by rcases le_total ((obsLaw Mp).real {ω | s ≤ |f ω - targetValue Mp|}) ((obsLaw Mm).real {ω | s ≤ |f ω - targetValue Mm|}) with hle | hle · rw [max_eq_right hle] at herr have h := (mul_le_mul_of_nonneg_left herr (sq_nonneg s)).trans hrm exact h.trans (le_max_right _ _) · rw [max_eq_left hle] at herr have h := (mul_le_mul_of_nonneg_left herr (sq_nonneg s)).trans hrp exact h.trans (le_max_left _ _) rw [hfo] have hsqrt_sq : (sqrt T) ^ 2 = T := Real.sq_sqrt (by exact_mod_cast (by omega : 0 ≤ T)) have hTpos : (0 : ℝ) < T := by exact_mod_cast (by omega : 0 < T) have hnum : 1 / (1024 * (T : ℝ)) ≤ s ^ 2 * ((1 - 1 / 4 : ℝ) / 2) := by dsimp [s] field_simp nlinarith [hsqrt_sq] exact hnum.trans htwo
CausalSmith.Stat.PomdpBinaryhiddenRate.testingPair_observedRisk_lower · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/TFixedBinaryMinimax.lean:76
theorem observedRisk_unit_bounds

Every admissible observable estimator has squared risk between zero and one. the stated conclusion holds.

Formal statement
T :
t0 zeta :
ℝ
m :
ModelIndex T t0 zeta
conclusion 1
0 ≤ observedRisk est m
conclusion 2
observedRisk est m ≤ 1
Proof (Lean source)
lemma observedRisk_unit_bounds {T : Nat} {t0 zeta : ℝ} (est : ObservableEstimator T) (m : ModelIndex T t0 zeta) : 0 ≤ observedRisk est m ∧ observedRisk est m ≤ 1 := by let M := m.raw let f := est.1 M.b M.e have hf : Measurable f := est.2.2 M.b M.e have hfB : ∀ w, f w ∈ Icc (0 : ℝ) 1 := est.2.1 M.b M.e have htheta : targetValue M ∈ Icc (0 : ℝ) 1 := targetValue_mem_unitInterval M m.mem.pomdp_kernel (targetStationary_of_class M m.mem) m.mem.policy_overlap.1 letI : IsProbabilityMeasure (obsLaw M) := by unfold obsLaw exact isProbabilityMeasure_map (by unfold obsProj curState actionAt rewardAt fun_prop) have hInt := bounded_estimator_sqError_integrable (obsLaw M) f hf hfB (targetValue M) have hpoint (w : ObsView T 2) : (f w - targetValue M) ^ 2 ≤ 1 := by have hb := hfB w have hd : |f w - targetValue M| ≤ 1 := abs_le.mpr ⟨by linarith [hb.1, hb.2, htheta.1, htheta.2], by linarith [hb.1, hb.2, htheta.1, htheta.2]⟩ nlinarith [sq_abs (f w - targetValue M), abs_nonneg (f w - targetValue M)] constructor · exact MeasureTheory.integral_nonneg (fun w => sq_nonneg _) · have h := MeasureTheory.integral_mono hInt (MeasureTheory.integrable_const (μ := obsLaw M) (1 : ℝ)) hpoint simpa only [observedRisk, sqRisk, MeasureTheory.integral_const, MeasureTheory.probReal_univ, one_smul] using h
CausalSmith.Stat.PomdpBinaryhiddenRate.observedRisk_unit_bounds · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/TFixedBinaryMinimax.lean:153
theorem comparator_reset_depth_growth

For positive mixing time, positive overlap exponent, a fixed overlap constant, and the cited comparator, the reset construction has logarithmic depth and eventually needs more than two hidden states.

Formal statement
t0 zeta C :
ℝ
ht0 :
0 < t0
hzeta :
0 < zeta
hC :
1 < C
hComparator :
CardinalityUniformComparator t0 zeta ⟨C, hC⟩
∃ cReset : ℝ, ∃ Q : Nat → Nat,
0 < cReset
conclusion 1
∃ a1 a2 : ℝ,
0 < a1
0 < a2
∀ᶠ n : Nat in atTop, a1 * log n ≤ Q n ∧ Q n ≤ a2 * log n
conclusion 2
ComparatorResetLowerWitness t0 zeta C cReset Q ht0 hzeta hC
conclusion 3
∀ᶠ n : Nat in atTop, ∃ (hT : 1 ≤ n) (hQ : 1 ≤ Q n), let M0 := CausalSmith.Stat.PomdpLatentOverlapMinimax.signedDepthModel n (Q n) t0 zeta C false hT ht0 hzeta hC hQ M0.nH
= 2 * (Q n + 1) ∧ 2 < M0.nH
Proof (Lean source)
lemma comparator_reset_depth_growth (t0 zeta C : ℝ) (ht0 : 0 < t0) (hzeta : 0 < zeta) (hC : 1 < C) (hComparator : CardinalityUniformComparator t0 zeta ⟨C, hC⟩) : ∃ cReset : ℝ, ∃ Q : Nat → Nat, 0 < cReset ∧ (∃ a1 a2 : ℝ, 0 < a1 ∧ 0 < a2 ∧ ∀ᶠ n : Nat in atTop, a1 * log n ≤ Q n ∧ Q n ≤ a2 * log n) ∧ ComparatorResetLowerWitness t0 zeta C cReset Q ht0 hzeta hC ∧ (∀ᶠ n : Nat in atTop, ∃ (hT : 1 ≤ n) (hQ : 1 ≤ Q n), let M0 := CausalSmith.Stat.PomdpLatentOverlapMinimax.signedDepthModel n (Q n) t0 zeta C false hT ht0 hzeta hC hQ M0.nH = 2 * (Q n + 1) ∧ 2 < M0.nH) := by obtain ⟨_, _, cReset, _, _, hcReset, _, Q, hlog, hreset⟩ := hComparator ht0 hzeta refine ⟨cReset, Q, hcReset, hlog, hreset, ?_⟩ filter_upwards [hreset] with n hn obtain ⟨hT, hQ, hn0, _, _⟩ := hn refine ⟨hT, hQ, hn0, ?_⟩ rw [hn0] omega
CausalSmith.Stat.PomdpBinaryhiddenRate.comparator_reset_depth_growth · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/TFixedBinaryMinimax.lean:184
theorem fixedBinary_minimax

For positive mixing time, nonnegative overlap exponent, the stated horizon range, and the cited comparator, the exact fixed-binary minimax rate, transferable testing pair, and asymptotic separation hold.

Formal statement
T :
t0 zeta C :
ℝ
ht0 :
0 < t0
hzeta :
0 ≤ zeta
hT :
12 ≤ T
hComparator_of_gate :
∀ hC : 1 < C, CardinalityUniformComparator t0 zeta ⟨C, hC⟩
conclusion 1
1 / (1024 * (T : ℝ)) ≤ minimaxRisk T t0 zeta
minimaxRisk T t0 zeta
≤ (stabilityFactor (mixingAlpha t0) ^ 2 * (112 * varianceFactor (mixingAlpha t0) (policyFactor zeta) + 2)) / T
conclusion 2
Mp :
Mm :
BinaryPomdpClass t0 zeta Mp
BinaryPomdpClass t0 zeta Mm
Mp.e = Mp.b
Mm.e = Mm.b
C0 :
ℝ
1 < C0
s :
stationaryLaw (policyKernel Mp Mp.e) s ≤ C0 * stationaryLaw (policyKernel Mp Mp.b) s
stationaryLaw (policyKernel Mm Mm.e) s ≤ C0 * stationaryLaw (policyKernel Mm Mm.b) s
hMp :
BinaryPomdpClass t0 zeta Mp
hMm :
BinaryPomdpClass t0 zeta Mm
1 / (1024 * (T : ℝ)) ≤ max (observedRisk est ⟨Mp, hMp⟩) (observedRisk est ⟨Mm, hMm⟩)
conclusion 3
hz :
0 < zeta
hC :
1 < C
0 < rateExponent t0 zeta
rateExponent t0 zeta < 1
Tendsto (fun n : Nat ↦ (n : ℝ)⁻¹ / ((n : ℝ) ^ (-(rateExponent t0 zeta)) * overlapRadius C ^ (2 * (1 - rateExponent t0 zeta)))) atTop (nhds 0)
∃ cReset : ℝ, ∃ Q : Nat → Nat,
0 < cReset
∃ a1 a2 : ℝ,
0 < a1
0 < a2
∀ᶠ n : Nat in atTop, a1 * log n ≤ Q n ∧ Q n ≤ a2 * log n
ComparatorResetLowerWitness t0 zeta C cReset Q ht0 hz hC
∀ᶠ n : Nat in atTop, ∃ (hn : 1 ≤ n) (hQ : 1 ≤ Q n), let M0 := CausalSmith.Stat.PomdpLatentOverlapMinimax.signedDepthModel n (Q n) t0 zeta C false hn ht0 hz hC hQ M0.nH
= 2 * (Q n + 1) ∧ 2 < M0.nH
Proof (Lean source)
theorem fixedBinary_minimax (T : Nat) (t0 zeta C : ℝ) (ht0 : 0 < t0) (hzeta : 0 ≤ zeta) (hT : 12 ≤ T) (hComparator_of_gate : ∀ hC : 1 < C, CardinalityUniformComparator t0 zeta ⟨C, hC⟩) : (1 / (1024 * (T : ℝ)) ≤ minimaxRisk T t0 zeta ∧ minimaxRisk T t0 zeta ≤ (stabilityFactor (mixingAlpha t0) ^ 2 * (112 * varianceFactor (mixingAlpha t0) (policyFactor zeta) + 2)) / T) ∧ (let Mp := testingExperiment T (vT T) (inl rfl) (vT_bound T hT) let Mm := testingExperiment T (-(vT T)) (inr rfl) (neg_vT_bound T hT) BinaryPomdpClass t0 zeta Mp ∧ BinaryPomdpClass t0 zeta Mm ∧ Mp.e = Mp.b ∧ Mm.e = Mm.b ∧ stationaryLaw (policyKernel Mp Mp.e) = stationaryLaw (policyKernel Mp Mp.b) ∧ stationaryLaw (policyKernel Mm Mm.e) = stationaryLaw (policyKernel Mm Mm.b) ∧ (∀ C0 : ℝ, 1 < C0 → ∀ s, stationaryLaw (policyKernel Mp Mp.e) s ≤ C0 * stationaryLaw (policyKernel Mp Mp.b) s ∧ stationaryLaw (policyKernel Mm Mm.e) s ≤ C0 * stationaryLaw (policyKernel Mm Mm.b) s) ∧ ∀ (hMp : BinaryPomdpClass t0 zeta Mp) (hMm : BinaryPomdpClass t0 zeta Mm) (est : ObservableEstimator T), 1 / (1024 * (T : ℝ)) ≤ max (observedRisk est ⟨Mp, hMp⟩) (observedRisk est ⟨Mm, hMm⟩)) ∧ (∀ (hz : 0 < zeta) (hC : 1 < C), 0 < rateExponent t0 zeta ∧ rateExponent t0 zeta < 1 ∧ Tendsto (fun n : Nat ↦ (n : ℝ)⁻¹ / ((n : ℝ) ^ (-(rateExponent t0 zeta)) * overlapRadius C ^ (2 * (1 - rateExponent t0 zeta)))) atTop (nhds 0) ∧ ∃ cReset : ℝ, ∃ Q : Nat → Nat, 0 < cReset ∧ (∃ a1 a2 : ℝ, 0 < a1 ∧ 0 < a2 ∧ ∀ᶠ n : Nat in atTop, a1 * log n ≤ Q n ∧ Q n ≤ a2 * log n) ∧ ComparatorResetLowerWitness t0 zeta C cReset Q ht0 hz hC ∧ (∀ᶠ n : Nat in atTop, ∃ (hn : 1 ≤ n) (hQ : 1 ≤ Q n), let M0 := CausalSmith.Stat.PomdpLatentOverlapMinimax.signedDepthModel n (Q n) t0 zeta C false hn ht0 hz hC hQ M0.nH = 2 * (Q n + 1) ∧ 2 < M0.nH)) := by have hpair := testingFamily_membership T t0 zeta ht0 hzeta hT rcases hpair with ⟨hMp, hMm, hsep, hfin, hkl, heqp, heqm, hdp, hdm, hoccup⟩ have htesting (est : ObservableEstimator T) : 1 / (1024 * (T : ℝ)) ≤ max (observedRisk est ⟨testingExperiment T (vT T) (inl rfl) (vT_bound T hT), hMp⟩) (observedRisk est ⟨testingExperiment T (-(vT T)) (inr rfl) (neg_vT_bound T hT), hMm⟩) := by simpa only [observedRisk] using testingPair_observedRisk_lower T hT (testingExperiment T (vT T) (inl rfl) (vT_bound T hT)) (testingExperiment T (-(vT T)) (inr rfl) (neg_vT_bound T hT)) rfl rfl hsep hfin hkl est refine ⟨?_, ?_, ?_⟩ · constructor · let mp : ModelIndex T t0 zeta := ⟨testingExperiment T (vT T) (inl rfl) (vT_bound T hT), hMp⟩ let mm : ModelIndex T t0 zeta := ⟨testingExperiment T (-(vT T)) (inr rfl) (neg_vT_bound T hT), hMm⟩ letI : Nonempty (ObservableEstimator T) := ⟨⟨(fun _ _ _ => 0), by constructor · intro b e w exact ⟨le_refl 0, zero_le_one⟩ · intro b e exact measurable_const⟩⟩ have hbdd (est : ObservableEstimator T) : BddAbove (range (observedRisk est (t0 := t0) (zeta := zeta))) := by refine ⟨1, ?_⟩ rintro x ⟨m, rfl⟩ exact (observedRisk_unit_bounds est m).2 have hlower := le_minimaxValue_of_two_point mp mm hbdd htesting simpa only [minimaxRisk] using hlower · let est : ObservableEstimator T := ⟨fun b e w => stableGridEstimator T t0 b e w, stableGridEstimator_admissible T t0 ht0 hT⟩ have hnonneg (e : ObservableEstimator T) (m : ModelIndex T t0 zeta) : 0 ≤ observedRisk e m := (observedRisk_unit_bounds e m).1 have hbound (m : ModelIndex T t0 zeta) : observedRisk est m ≤ (stabilityFactor (mixingAlpha t0) ^ 2 * (112 * varianceFactor (mixingAlpha t0) (policyFactor zeta) + 2)) / T := by exact stableGrid_upper T t0 zeta ht0 hzeta hT m letI : Nonempty (ModelIndex T t0 zeta) := ⟨⟨testingExperiment T (vT T) (inl rfl) (vT_bound T hT), hMp⟩⟩ calc minimaxRisk T t0 zeta ≤ worstCaseRiskReal observedRisk est := by exact minimaxValue_le_worstCaseRisk_of_nonneg hnonneg est _ ≤ _ := worstCaseRisk_le hbound · exact ⟨hMp, hMm, heqp, heqm, hdp, hdm, hoccup, fun _ _ est => htesting est⟩ · intro hz hC have hdepth := comparator_reset_depth_growth t0 zeta C ht0 hz hC (hComparator_of_gate hC) refine ⟨?_, ?_, ?_, hdepth⟩ · unfold rateExponent positivity · unfold rateExponent have hprod : 0 < t0 * zeta := mul_pos ht0 hz apply (div_lt_iff₀ (by linarith : 0 < 2 + t0 * zeta)).mpr nlinarith · have hbeta : 0 < 1 - rateExponent t0 zeta := by have hprod : 0 < t0 * zeta := mul_pos ht0 hz unfold rateExponent have hden : 0 < 2 + t0 * zeta := by linarith have hlt : 2 / (2 + t0 * zeta) < 1 := by apply (div_lt_iff₀ hden).mpr linarith linarith have hq : 0 < overlapRadius C := by unfold overlapRadius exact div_pos (by linarith) (by linarith) have hqpow : 0 < overlapRadius C ^ (2 * (1 - rateExponent t0 zeta)) := Real.rpow_pos_of_pos hq _ have ht : Tendsto (fun n : Nat => (n : ℝ) ^ (-(1 - rateExponent t0 zeta))) atTop (nhds 0) := (tendsto_rpow_neg_atTop hbeta).comp tendsto_natCast_atTop_atTop have hlim := ht.mul_const ((overlapRadius C ^ (2 * (1 - rateExponent t0 zeta)))⁻¹) simpa only [zero_mul] using hlim.congr' (by filter_upwards [Filter.eventually_gt_atTop (0 : Nat)] with n hn have hn' : (0 : ℝ) < n := by exact_mod_cast hn have hn0 : (n : ℝ) ≠ 0 := ne_of_gt hn' have hp : (n : ℝ) ^ rateExponent t0 zeta ≠ 0 := ne_of_gt (Real.rpow_pos_of_pos hn' _) have hr : (n : ℝ)⁻¹ / (n : ℝ) ^ (-rateExponent t0 zeta) = (n : ℝ) ^ (-(1 - rateExponent t0 zeta)) := by rw [show -(1 - rateExponent t0 zeta) = rateExponent t0 zeta - 1 by ring, Real.rpow_sub hn', Real.rpow_one, Real.rpow_neg (le_of_lt hn')] field_simp rw [← hr] field_simp [ne_of_gt hqpow])
CausalSmith.Stat.PomdpBinaryhiddenRate.fixedBinary_minimax · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/TFixedBinaryMinimax.lean:212
CausalSmith.Stat.STAT_PomdpBinaryhiddenRate_Research.TStableGridUpper 1 declarations The finite observed-data grid estimator attains a uniform parametric mean-squared-error bound over the six-condition binary POMDP class.

Fixed-binary stable-grid upper bound

The finite observed-data grid estimator attains a uniform parametric mean-squared-error bound over the six-condition binary POMDP class.

theorem stableGrid_upper

For positive mixing time, nonnegative overlap exponent, and the stated horizon range, the seven-moment stable-grid estimator satisfies the uniform mean-squared-error bound.

Formal statement
T :
t0 zeta :
ℝ
ht0 :
0 < t0
hzeta :
0 ≤ zeta
hT :
12 ≤ T
m :
ModelIndex T t0 zeta
sqRisk (obsLaw m.raw) (stableGridEstimator T t0 m.raw.b m.raw.e) (targetValue m.raw)
≤ (stabilityFactor (mixingAlpha t0) ^ 2 * (112 * varianceFactor (mixingAlpha t0) (policyFactor zeta) + 2)) / T
Proof (Lean source)
theorem stableGrid_upper (T : Nat) (t0 zeta : ℝ) (ht0 : 0 < t0) (hzeta : 0 ≤ zeta) (hT : 12 ≤ T) : ∀ m : ModelIndex T t0 zeta, sqRisk (obsLaw m.raw) (stableGridEstimator T t0 m.raw.b m.raw.e) (targetValue m.raw) ≤ (stabilityFactor (mixingAlpha t0) ^ 2 * (112 * varianceFactor (mixingAlpha t0) (policyFactor zeta) + 2)) / T := by intro m classical let M := m.raw let := binary_obsLaw_isProbability M let a := mixingAlpha t0 let B := stabilityFactor a let V := varianceFactor a (policyFactor zeta) let n : ℝ := (T - 6 : Nat) let pop := fun k : Fin 7 => matrixMoment (stationaryLaw (policyKernel M M.b)) (of (policyKernel M M.e)) (rewardRegression M) k.val let eps := fun w : ObsView T 2 => ⨆ k : Fin 7, |empiricalMoment k.val M.b M.e w - pop k| have ha1 : a < 1 := by change mixingAlpha t0 < 1 rw [mixingAlpha, Real.exp_lt_one_iff] exact neg_neg_of_pos (one_div_pos.mpr ht0) have hV : 0 ≤ V := by change 0 ≤ 13 * policyFactor zeta ^ 7 + 2 / (1 - a) have hden : 0 < 1 - a := sub_pos.mpr ha1 have hL : 1 ≤ policyFactor zeta := by simpa only [policyFactor, Real.exp_zero] using Real.exp_le_exp.mpr hzeta positivity have hTr : (0 : ℝ) < T := by exact_mod_cast (show 0 < T by omega) have hn : 0 < n := by dsimp [n]; exact_mod_cast (show 0 < T - 6 by omega) have hnt : (T : ℝ) ≤ 2 * n := by have hnat : T ≤ 2 * (T - 6) := by omega dsimp only [n] exact_mod_cast hnat have ht1 : (1 : ℝ) ≤ T := by exact_mod_cast (show 1 ≤ T by omega) have hint (k : Fin 7) : Integrable (fun w => (empiricalMoment k.val M.b M.e w - pop k) ^ 2) (obsLaw M) := ((empiricalMoment_memLp_two M m.mem k.val).sub (memLp_const (pop k))).integrable_sq have hsum : Integrable (fun w => ∑ k : Fin 7, (empiricalMoment k.val M.b M.e w - pop k) ^ 2) (obsLaw M) := integrable_finsetSum _ (fun k _ => hint k) have hmeas : AEStronglyMeasurable (fun w => eps w ^ 2) (obsLaw M) := by apply Measurable.aestronglyMeasurable dsimp [eps] fun_prop have heint : Integrable (fun w => eps w ^ 2) (obsLaw M) := hsum.mono' hmeas (Filter.Eventually.of_forall (fun w => by rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] exact seven_error_max_sq_le_sum _)) have he : (∫ w, eps w ^ 2 ∂obsLaw M) ≤ 7 * V / n := empiricalMoment_max_mse_le_varianceFactor hT M m.mem have hpoint (w : ObsView T 2) : (stableGridEstimator T t0 M.b M.e w - targetValue M) ^ 2 ≤ B ^ 2 * (8 * eps w ^ 2 + 2 * (T : ℝ)⁻¹ ^ 2) := by have herr := stableGridEstimator_value_error hT M m.mem w have hs : (stableGridEstimator T t0 M.b M.e w - targetValue M) ^ 2 ≤ (B * (2 * eps w + (T : ℝ)⁻¹)) ^ 2 := by rw [← sq_abs (stableGridEstimator T t0 M.b M.e w - targetValue M)] exact pow_le_pow_left₀ (abs_nonneg _) herr 2 calc _ ≤ (B * (2 * eps w + (T : ℝ)⁻¹)) ^ 2 := hs _ = B ^ 2 * (2 * eps w + (T : ℝ)⁻¹) ^ 2 := mul_pow _ _ _ _ ≤ B ^ 2 * (8 * eps w ^ 2 + 2 * (T : ℝ)⁻¹ ^ 2) := by apply mul_le_mul_of_nonneg_left _ (sq_nonneg B) nlinarith [sq_nonneg (2 * eps w - (T : ℝ)⁻¹)] have hboundint : Integrable (fun w => B ^ 2 * (8 * eps w ^ 2 + 2 * (T : ℝ)⁻¹ ^ 2)) (obsLaw M) := ((heint.const_mul 8).add (integrable_const _)).const_mul _ have hsampling : 8 * (7 * V / n) ≤ 112 * V / T := by have heq : 8 * (7 * V / n) = 56 * V / n := by ring rw [heq] apply (div_le_div_iff₀ hn hTr).mpr have hv := mul_le_mul_of_nonneg_right hnt (show 0 ≤ 56 * V by positivity) nlinarith have hgrid : (T : ℝ)⁻¹ ^ 2 ≤ 1 / T := by rw [inv_pow, one_div, inv_le_inv₀ (by positivity) hTr] nlinarith unfold sqRisk change (∫ w, (stableGridEstimator T t0 M.b M.e w - targetValue M) ^ 2 ∂obsLaw M) ≤ _ calc _ ≤ ∫ w, B ^ 2 * (8 * eps w ^ 2 + 2 * (T : ℝ)⁻¹ ^ 2) ∂obsLaw M := integral_mono_of_nonneg (Filter.Eventually.of_forall (fun w => sq_nonneg _)) hboundint (Filter.Eventually.of_forall hpoint) _ = B ^ 2 * (8 * (∫ w, eps w ^ 2 ∂obsLaw M) + 2 * (T : ℝ)⁻¹ ^ 2) := by rw [integral_const_mul, integral_add (heint.const_mul 8) (integrable_const _), integral_const_mul, integral_const] simp _ ≤ B ^ 2 * (8 * (7 * V / n) + 2 * (T : ℝ)⁻¹ ^ 2) := by gcongr _ ≤ B ^ 2 * (112 * V / T + 2 * (1 / T)) := by gcongr _ = _ := by dsimp [B, V, a]; ring
CausalSmith.Stat.PomdpBinaryhiddenRate.stableGrid_upper · CausalSmith/Stat/STAT_PomdpBinaryhiddenRate_Research/TStableGridUpper.lean:20