Linear algebra of bit-string spaces via ZMod 2 #
Mathlib equips Bool with a BooleanRing instance (addition is xor, multiplication is and), so
ι → Bool and BitString n are Bool-modules, whereas field-level linear algebra (Basis,
Submodule.exists_isCompl, Matrix.rank, rank-nullity, and orthogonal duality) requires a Field
instance such as ZMod 2.
Building on the computable ring isomorphism Cslib.BitString.bitEquiv : ZMod 2 ≃+* Bool, this
module constructs the coordinatewise semilinear isomorphism Cslib.BitString.toZModSpace, the
induced submodule lattice isomorphism Cslib.BitString.submoduleZModIso, the linear-map equivalence
Cslib.BitString.linearMapZModEquiv, and the standard dot-product orthogonal complement
Cslib.BitString.orthogonal, transferring dimension, complements, rank-nullity, and dual-code
dimension between Bool and ZMod 2.
Main definitions #
Cslib.BitString.toZModSpace: coordinatewise semilinear isomorphism(ι → Bool) ≃ₛₗ[bitEquiv.symm.toRingHom] (ι → ZMod 2).Cslib.BitString.submoduleZModIso: order isomorphismSubmodule Bool (ι → Bool) ≃o Submodule (ZMod 2) (ι → ZMod 2).Cslib.BitString.linearMapZModEquiv: additive equivalence betweenBool-linear maps and(ZMod 2)-linear maps on coordinate spaces.Cslib.BitString.orthogonal: orthogonal complement{y | ∀ x ∈ V, x ⬝ᵥ y = 0}underdotProduct.
Main results #
Cslib.BitString.finrank_submoduleZModIso,Cslib.BitString.natCard_submodule_bool: preservation ofModule.finrankandNat.card V = 2 ^ finrank Bool V.Cslib.BitString.exists_isCompl_bool,Cslib.BitString.exists_isCompl_submodule_bool: complement existence forBool-submodules ofι → Bool.Cslib.BitString.finrank_sup_add_finrank_inf_bool,Cslib.BitString.finrank_map_add_finrank_inf_ker_bool,Cslib.BitString.finrank_range_add_finrank_ker_bool,Cslib.BitString.finrank_comap_codim_le_bool,Cslib.BitString.exists_submodule_finrank_eq_bool: modular dimension law, rank-nullity, slice codimension bound, and existence of subspaces of prescribed dimension overBool.Cslib.BitString.linearMapZModEquiv_mulVecLin,Cslib.BitString.submoduleZModIso_ker: matrix multiplication and kernel compatibility acrossBoolandZMod 2.Cslib.BitString.finrank_orthogonal_add_finrank,Cslib.BitString.orthogonal_orthogonal,Cslib.BitString.finrank_orthogonal_add_finrank_bool,Cslib.BitString.orthogonal_orthogonal_bool: dual orthogonal dimension and double-orthogonal involution over fields and overBool.
Coordinatewise and submodule isomorphisms #
toZModSpace intertwines standard dot products via bitEquiv.symm.
submoduleZModIso maps Bool-spans to (ZMod 2)-spans of the translated generators.
Linear map conjugation #
Conjugating H.mulVecLin along toZModSpace yields (H.map bitEquiv.symm).mulVecLin.
submoduleZModIso preserves Module.finrank.
Modular dimension identity for the sum and intersection of two Bool-submodules of ι → Bool.
Rank-nullity for a Bool-linear map restricted to a submodule V of ι₁ → Bool.
Preimage codimension bound: pulling back a Bool-submodule V of ι₂ → Bool along any
Bool-linear map f : (ι₁ → Bool) →ₗ[Bool] (ι₂ → Bool) increases codimension by at most 0, i.e.
codim (V.comap f) ≤ codim V.
submoduleZModIso commutes with orthogonal.
Double-orthogonal involution over Bool: orthogonal (orthogonal V) = V.