Finite random restrictions #
This file defines a completely finite sample space for sparse restrictions on
exactly N variables. A symbol is either:
- one distinguished free symbol; or
- a Boolean value together with one of
qcopies.
Uniform sampling from Symbol q therefore leaves a coordinate free with
probability 1 / (2 * q + 1) and fixes it to either Boolean value with
probability q / (2 * q + 1). Retaining the copy label makes the distribution
uniform on an honest finite type; no measure-theoretic or rational-probability
convention is hidden in later counting arguments.
One coordinate of the sparse-restriction sample space.
The left summand is the unique free symbol. The right summand fixes the
coordinate and records one of q equiprobable copies of the chosen bit.
Instances For
An independent sparse-restriction seed on exactly N variables.
Equations
Instances For
Forget the multiplicity label and interpret a sample symbol as a partial Boolean assignment.
Equations
Instances For
Decode a finite seed to the corresponding finite-arity restriction.
Equations
- Complexity.RandomRestriction.decode seed index = Complexity.RandomRestriction.decodeSymbol (seed index)
Instances For
The set of coordinates left free by a seed.
Equations
Instances For
The exact number of seeds whose decoded restriction satisfies event.
Equations
- Complexity.RandomRestriction.eventCount q event = {seed : Complexity.RandomRestriction.Seed N q | event (Complexity.RandomRestriction.decode seed)}.card
Instances For
Seeds whose decoded restriction satisfies event. This subtype is the
domain used by injective finite-encoding arguments.
Equations
- Complexity.RandomRestriction.EventSeed N q event = { seed : Complexity.RandomRestriction.Seed N q // event (Complexity.RandomRestriction.decode seed) }
Instances For
Locate an input coordinate in the range of an embedding.
Equations
- Complexity.RandomRestriction.positionOf queries index = if h : ∃ (position : Fin s), queries position = index then some (Classical.choose h) else none
Instances For
The finite partial assignment induced by embedded coordinates and their Boolean values.
Equations
- Complexity.RandomRestriction.assignmentAlong queries values index = Option.map values (Complexity.RandomRestriction.positionOf queries index)
Instances For
Replace the coordinates selected by queries by fixed symbols carrying
the supplied copy labels and branch values.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Restore every coordinate selected by queries to the unique free
symbol.
Equations
- Complexity.RandomRestriction.freeAlong seed queries index = match Complexity.RandomRestriction.positionOf queries index with | none => seed index | some val => Sum.inl ()