Bits as numbers: 0/1 values and ±1 signs #
Analysis on the Boolean cube reads a bit in two ways. As a value in a commutative ring R, a bit
is 0 or 1 (BitString.bitVal); this is the reading of multilinear polynomials and of 𝔽₂.
As a real sign, a bit is 1 or -1 (BitString.signVal), with false ↦ 1 and true ↦ -1;
this is the reading of Fourier analysis, under which exclusive or becomes multiplication
(BitString.signVal_xor) O'Donnell, Chapter 1. The two readings are related by
signVal b = 1 - 2 bitVal b (BitString.signVal_eq_one_sub_two_mul_bitVal).
This module holds only these atoms, so that modules which read bits as numbers need not import the Fourier or low-degree theory built on them.
Main definitions #
Cslib.BitString.bitVal: a bit read as0or1in a commutative ring.Cslib.BitString.signVal: a bit read as a real sign,false ↦ 1andtrue ↦ -1.
Main results #
Cslib.BitString.signVal_xor,Cslib.BitString.neg_one_pow_toNat_xor: the sign of an exclusive or is the product of the signs.Cslib.BitString.signVal_mul_self,Cslib.BitString.abs_signVal,Cslib.BitString.signVal_mul_signVal,Cslib.BitString.sq_signVal_sub_signVal: arithmetic of signs.Cslib.BitString.signVal_eq_neg_one_pow,Cslib.BitString.neg_one_pow_toNat_eq_one_sub_two_mul_bitVal,Cslib.BitString.signVal_eq_one_sub_two_mul_bitVal: the readings as powers of-1and as each other.Cslib.BitString.bitVal_pow,Cslib.BitString.bitVal_not: a bit read inRis idempotent, and negation is1 - b.
References #
Bits read as 0 or 1 #
A bit read as 0 or 1 in R.
Instances For
Bits read as signs #
A bit read as a real sign: false ↦ 1 and true ↦ -1.
Instances For
The bit false reads as the sign 1.
The bit true reads as the sign -1.