Documentation

QEC1.Remarks.Rem_3_BinaryVectorNotation

Rem_3: Binary Vector Notation #

Statement #

Throughout this work, we abuse notation by identifying a subset of vertices, edges, or cycles with its characteristic binary vector over $\mathbb{Z}_2 = \mathbb{F}_2$. For a set $S$ of vertices/edges/cycles, the corresponding binary vector has a 1 in position $i$ if and only if element $i$ belongs to $S$. Addition of binary vectors corresponds to symmetric difference of sets. This identification allows us to use linear algebra over $\mathbb{Z}_2$ to reason about graph-theoretic properties.

Main Definitions #

Key Properties #

Corollaries #

Binary Vectors over ZMod 2 #

@[reducible, inline]
abbrev BinaryVector (α : Type u_1) :
Type u_1

A binary vector over an index set α is a function to ZMod 2. This is the type of characteristic vectors.

Equations
Instances For

    The zero vector (all zeros)

    Equations
    Instances For

      The all-ones vector

      Equations
      Instances For
        def BinaryVector.add {α : Type u_1} (v w : BinaryVector α) :

        Addition of binary vectors (componentwise in ZMod 2)

        Equations
        Instances For
          @[simp]
          theorem BinaryVector.zero_apply {α : Type u_1} (i : α) :
          0 i = 0
          @[simp]
          theorem BinaryVector.add_apply {α : Type u_1} (v w : BinaryVector α) (i : α) :
          (v + w) i = v i + w i

          Binary vectors form an additive group (every element is its own inverse in ZMod 2)

          Equations

          Binary vectors form a ZMod 2 module (i.e., a vector space over F_2)

          Equations

          Characteristic Vector of a Set #

          def characteristicVector {α : Type u_1} [DecidableEq α] (S : Finset α) :

          The characteristic vector of a finset S: position i has value 1 iff i ∈ S.

          Equations
          Instances For
            noncomputable def characteristicVector' {α : Type u_1} (S : Finset α) :

            Alternative definition using Set.indicator

            Equations
            Instances For
              @[simp]
              theorem characteristicVector_apply_mem {α : Type u_1} [DecidableEq α] (S : Finset α) (i : α) (h : i S) :
              @[simp]
              theorem characteristicVector_apply_not_mem {α : Type u_1} [DecidableEq α] (S : Finset α) (i : α) (h : iS) :
              theorem characteristicVector_mem_iff {α : Type u_1} [DecidableEq α] (S : Finset α) (i : α) :

              Key characterization: position i is 1 iff element i belongs to S

              theorem characteristicVector_not_mem_iff {α : Type u_1} [DecidableEq α] (S : Finset α) (i : α) :
              characteristicVector S i = 0 iS
              @[simp]

              The characteristic vector of the empty set is zero

              @[simp]

              The characteristic vector of the bottom element (used for symmDiff_self)

              @[simp]
              theorem characteristicVector_singleton {α : Type u_1} [DecidableEq α] (a : α) :
              characteristicVector {a} = fun (i : α) => if i = a then 1 else 0

              The characteristic vector of a singleton

              Symmetric Difference and Vector Addition #

              Key theorem: Addition of characteristic vectors corresponds to symmetric difference. This is the fundamental property that allows linear algebra over Z_2 to encode set operations.

              Symmetric difference is encoded as addition

              @[simp]

              Self-symmetric difference is empty (S Δ S = ∅)

              In ZMod 2, every element is its own additive inverse

              Inverse Map: From Binary Vector to Finset #

              def fromBinaryVector {α : Type u_1} [Fintype α] (v : BinaryVector α) :

              Convert a binary vector back to a finset (the support of the vector)

              Equations
              Instances For
                @[simp]
                theorem mem_fromBinaryVector {α : Type u_1} [DecidableEq α] [Fintype α] (v : BinaryVector α) (i : α) :
                @[simp]

                Round-trip: characteristic vector then back to finset gives the original finset

                @[simp]

                Round-trip: finset to vector then back gives the original vector (for vectors that only take values 0 and 1, which is automatic in ZMod 2)

                The characteristic vector map is injective

                The characteristic vector map is surjective

                The characteristic vector map is a bijection

                The characteristic vector map as an equivalence

                Equations
                Instances For

                  Algebraic Structure: Finsets as a Vector Space over ZMod 2 #

                  instance finsetAdd {α : Type u_1} [DecidableEq α] :
                  Add (Finset α)

                  Addition on Finsets via symmetric difference

                  Equations
                  instance finsetZero {α : Type u_1} :

                  Zero element is the empty set

                  Equations
                  instance finsetNeg {α : Type u_1} :
                  Neg (Finset α)

                  Negation is identity (every element is its own inverse)

                  Equations
                  instance finsetAddCommGroup {α : Type u_1} [DecidableEq α] [Fintype α] :

                  Finsets form an additive commutative group with symmetric difference as addition

                  Equations
                  • One or more equations did not get rendered due to their size.
                  instance finsetSMul {α : Type u_1} :
                  SMul (ZMod 2) (Finset α)

                  Scalar multiplication by ZMod 2: 0 * S = ∅, 1 * S = S

                  Equations
                  @[simp]
                  theorem zero_smul_finset {α : Type u_1} [DecidableEq α] [Fintype α] (S : Finset α) :
                  0 S =
                  @[simp]
                  theorem one_smul_finset {α : Type u_1} [DecidableEq α] [Fintype α] (S : Finset α) :
                  1 S = S
                  instance finsetModule {α : Type u_1} [DecidableEq α] [Fintype α] :
                  Module (ZMod 2) (Finset α)

                  Finsets form a module (vector space) over ZMod 2

                  Equations
                  • finsetModule = { toSMul := finsetSMul, mul_smul := , one_smul := , smul_zero := , smul_add := , add_smul := , zero_smul := }

                  The characteristic vector map is a linear map

                  The characteristic vector map preserves scalar multiplication

                  The characteristic vector map is a linear equivalence

                  Equations
                  Instances For

                    Properties Useful for Graph Theory Applications #

                    The union of disjoint sets corresponds to addition (which is XOR/symmetric difference)

                    Intersection can be expressed in terms of the algebraic structure

                    Complement relative to the universe

                    theorem card_eq_sum_characteristicVector {α : Type u_1} [DecidableEq α] [Fintype α] (S : Finset α) :
                    S.card = i : α, (characteristicVector S i).val

                    The cardinality of a set can be recovered from its characteristic vector

                    Two sets are equal iff their characteristic vectors are equal

                    theorem card_symmDiff_add_twice_inter {α : Type u_1} [DecidableEq α] [Fintype α] (S T : Finset α) :
                    (symmDiff S T).card + 2 * (S T).card = S.card + T.card

                    The symmetric difference has cardinality related to the original sets

                    Summary #

                    The binary vector notation convention establishes:

                    1. Identification: A finset S ⊆ α corresponds to its characteristic vector χ_S : α → ZMod 2 where χ_S(i) = 1 iff i ∈ S

                    2. Addition = Symmetric Difference: χ_{S Δ T} = χ_S + χ_T (componentwise in ZMod 2)

                    3. Bijectivity: This identification is a bijection, so sets and vectors can be used interchangeably

                    4. Linear Structure: Under this identification, Finset α becomes a ZMod 2-vector space where addition is symmetric difference

                    5. Application: This allows linear algebra techniques over F_2 to be applied to graph-theoretic problems involving sets of vertices, edges, or cycles.

                    The key insight is that XOR (symmetric difference) becomes ordinary addition in ZMod 2, making linear algebraic techniques available for reasoning about graph properties.