StateT σ ProbComp Invariant Theory #
Support-based invariant reasoning for shared, stateful oracle simulations
(ROM/AGM/hybrids) whose handlers live in StateT σ ProbComp. A user-supplied
predicate Inv : σ → Prop is preserved by an implementation when every reachable
post-state satisfies it.
We use support-based formulations (rather than Pr[ ...] = 1) to keep
downstream proofs lightweight.
The WriterT analogue of this theory lives in
SimSemantics/WriterT/PreservesInv.lean.
Main definitions #
QueryImpl.PreservesInv— every oracle query implementation step preservesInvOracleComp.simulateQ_run_preservesInv— simulating any oracle computation with a preserving implementation preservesInvon the final stateInitSatisfiesInv— every sampled initial state satisfies the invariantStateT.StatePreserving— computation never changes the stateStateT.PreservesInv— computation preserves an invariant on the stateStateT.NeverFailsUnder— computation does not fail under an invariantStateT.OutputIndependent— output distribution is independent of the initial state under an invariantStateT.outputIndependent_after_preservesInv— non-interference: output-independent computation remains so after sequencing with an invariant-preserving computation
PreservesInv impl Inv means every oracle query implementation step preserves Inv
on all reachable post-states (support-based).
Instances For
If impl preserves Inv, then simulating any oracle computation with simulateQ impl
preserves Inv on the final state (support-wise).
If so' preserves Inv, then so' ∘ₛ so also preserves Inv for any so.
InitSatisfiesInv init Inv means every possible initial state sampled by init
satisfies Inv (support-based).
Instances For
StateT invariant properties #
These properties are useful for non-interference arguments in sequential composition proofs.
They are stated for general StateT σ ProbComp computations.
StatePreserving mx means mx never changes the state: for every starting state σ0,
every outcome in the support of mx.run σ0 has final state equal to σ0.
Instances For
NeverFailsUnder mx Inv means that starting from any state satisfying Inv, the computation
does not fail (its failure probability is 0).
Instances For
OutputIndependent mx Inv means the output distribution of mx does not depend on the
initial state, as long as the initial state satisfies Inv.
This is distributional equality of run' (which discards the final state).
Instances For
If mx is output-independent on Inv, and my preserves Inv and never fails under Inv,
then the output distribution of mx is unchanged by running my first and then running mx
on the resulting state.