Exact fair-bit sampling in the four-element field #
Mathlib's QuadraticAlgebra (ZMod 2) 1 1 represents the field with generator satisfying
θ² = 1 + θ. Its two coordinates are independent bits. The sampler draws those two bits
and returns the corresponding element of the existing quadratic algebra; no new field carrier
or arithmetic is defined here. This is one fixed field, not a growing extension-field family.
Main definitions #
Cslib.F4.equivBits: the two Boolean coordinates of the quadratic algebra.Cslib.F4.sample: two independent fair bits interpreted in that field.
Main results #
Cslib.F4.card: the field has four elements.Cslib.F4.eval_sample: the sampler is exactly uniform.
Boolean coordinates in the basis 1, θ, where θ² = 1 + θ.
The quadratic algebra over two bits has exactly four elements.
Sample the real and imaginary coordinates using two independent fair bits.
theorem Cslib.F4.eval_sample :
The two-fair-bit program has the exact uniform field distribution.