Documentation

CslibFrontier.Foundations.Data.BitString.Parity.Complete

Completing a word to a prescribed parity #

The final bit uniquely completes a word to a chosen parity. These declarations are extracted unchanged from the XOR sampling application for reuse by parity-constrained distributions.

Main definitions #

Main results #

The completion of j bits r to the j + 1 bits of parity c extending them: the last bit is c ⊕ parity r.

theorem Cslib.BitString.parity_parityComplete (c : Bool) {j : ℕ} (r : BitString j) :
parity (j + 1) (parityComplete c r) = c

The completion of r to parity c has parity c.

def Cslib.BitString.parityCompleteEquiv (c : Bool) (j : ℕ) :
BitString j ≃ ↥{b : BitString (j + 1) | parity (j + 1) b = c}

Completion to parity c is an equivalence onto the bit strings of parity c; the inverse drops the last bit.

theorem Cslib.BitString.parity_fiber_nonempty {n : ℕ} (hn : 0 < n) (b : Bool) :
{x : BitString n | parity n x = b}.Nonempty

A prescribed parity fiber is nonempty in positive dimension.