Weighted encodings for switching arguments #
The switching lemma is proved by injecting each bad random restriction into a more fully assigned restriction together with bounded finite advice. This module isolates the exact finite probability calculation behind that method.
Its principal statement is division-free. If every encoded restriction fixes
exactly s formerly live variables, multiplying the bad-event probability by
((1 - p) / 2) ^ s is at most the number of advice strings times p ^ s.
Later estimates may divide by the fixed-coordinate weight under an explicit
positivity hypothesis. No asymptotics or search enter this layer.
Fixing only previously live variables gives an exact, division-free point
mass identity. Each newly fixed coordinate exchanges one factor of p for
one factor of (1 - p) / 2.
A weighted injection from an event into restrictions paired with finite advice bounds the scaled event probability by the advice cardinality times the output-side factor.
Exact encoding bound specialized to extensions that fix exactly
fixedCount live variables. This is the probability engine used by the
canonical switching-path encoding.