Documentation

HexBerlekampZassenhausMathlib.SignatureClasses

Representative columns for the sig j = sig k equivalence on {0, …, r-1}: the columns whose signature has not been seen at any earlier column. The list is ascending by construction.

Equations
Instances For

    Canonical partition of {0, …, r-1} by signature equivalence: one class per representative column, listing exactly the columns with the same signature as that representative. Classes appear in ascending representative order; each class's member list is ascending.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      The full (signature, members) payload after folding Hex.bhksInsertSignatureClass over List.range r. Each pair pairs a representative column's signature with the ascending list of columns sharing that signature.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        Forgetting the signatures in partitionAcc leaves the canonical min-column partition.

        If no entry of acc carries signature s, then Hex.bhksInsertSignatureClass s j acc appends (s, [j]) at the end.

        theorem HexBerlekampZassenhausMathlib.BHKS.bhksInsertSignatureClass_eq_replace (s : Array ) (j : ) (l r : List (Array × List )) (members : List ) (hnotin : pl, p.1 s) :
        Hex.bhksInsertSignatureClass s j (l ++ (s, members) :: r) = l ++ (s, members ++ [j]) :: r

        If acc = l ++ (s, members) :: r and no entry of l carries signature s, then Hex.bhksInsertSignatureClass s j acc replaces the single matching entry's member list with members ++ [j].

        A fresh signature at column m appends m as a new representative.

        theorem HexBerlekampZassenhausMathlib.BHKS.representativeColumns_succ_of_match (m : ) (sig : Array ) (k₀ : ) (hk₀ : k₀ < m) (hsig : sig k₀ = sig m) :

        A column whose signature was already seen adds no new representative.

        theorem HexBerlekampZassenhausMathlib.BHKS.mem_representativeColumns_iff (m : ) (sig : Array ) (rep : ) :
        rep representativeColumns m sig rep < m k < rep, sig k sig rep

        A representative column is the least index with its row-reduced signature.

        Representative columns lie in {0, …, m-1}.

        theorem HexBerlekampZassenhausMathlib.BHKS.representativeColumns_fresh (m : ) (sig : Array ) (rep : ) (h : rep representativeColumns m sig) (k : ) :
        k < repsig k sig rep

        A representative column's signature does not occur at any earlier column.

        Filtering List.range (m + 1) splits as filtering range m plus the trailing element.

        theorem HexBerlekampZassenhausMathlib.BHKS.filter_range_succ_sig_eq (m : ) (sig : Array ) (rep : ) :
        List.filter (fun (j : ) => decide (sig j = sig rep)) (List.range (m + 1)) = List.filter (fun (j : ) => decide (sig j = sig rep)) (List.range m) ++ if sig m = sig rep then [m] else []

        The members list of the entry for rep in partitionAcc (m + 1) sig factors as the members at step m plus m itself if sig m = sig rep.

        theorem HexBerlekampZassenhausMathlib.BHKS.partitionAcc_entry_eq_of_ne (m : ) (sig : Array ) (rep : ) (hne : sig m sig rep) :
        (sig rep, List.filter (fun (j : ) => decide (sig j = sig rep)) (List.range (m + 1))) = (sig rep, List.filter (fun (j : ) => decide (sig j = sig rep)) (List.range m))

        If signatures are decidably distinct at rep and m, the partitionAcc m sig entry for rep extends trivially to step m + 1.

        theorem HexBerlekampZassenhausMathlib.BHKS.representativeColumns_decompose_at (m : ) (sig : Array ) (k₀ : ) (hk₀ : k₀ representativeColumns m sig) :
        ∃ (suffix : List ), representativeColumns m sig = representativeColumns k₀ sig ++ k₀ :: suffix repsuffix, k₀ < rep rep representativeColumns m sig

        Decompose representativeColumns m sig around a known representative k₀ ∈ representativeColumns m sig. The list splits as the representativeColumns k₀ sig prefix, then k₀, then a suffix of reps in (k₀, m).

        The inductive step: partitionAcc (m + 1) sig is one bhksInsertSignatureClass application above partitionAcc m sig.

        The fold over List.range r of Hex.bhksInsertSignatureClass produces exactly the canonical partition accumulator.

        Partition semantics of Hex.bhksInsertSignatureClass.

        The classes emitted by folding Hex.bhksInsertSignatureClass over List.range r form the canonical min-column partition of {0, …, r-1} by signature equality.

        Two columns of the RREF echelon matrix agree iff every vector in the original row span has equal entries at those columns.

        This is the abstract row-span version of the executable bhksColumnSignature comparison: equality of column slices of the echelon rows is represented here by pointwise equality over the Fin n row index.