Documentation

DescriptiveComplexity.Permanent.Flat

The gadgets attached at every site, flattened #

DescriptiveComplexity.Site.attachAll attaches Valiant's gadget at the sites of a list, one sum type ⊕ Fin 4 at a time; the reductions draw the same matrix on the flat node type V ⊕ (S × Fin 4), the gadget nodes indexed by the sites themselves (DescriptiveComplexity.Site.flatAttach). The two have the same permanent (DescriptiveComplexity.Site.bperm_flatAttach): the nested type and the flat one are in bijection, entry by entry.

def DescriptiveComplexity.Site.flatAttach {V S : Type} [DecidableEq V] [DecidableEq S] (M₀ : V → V → ℤ) (site : S → Site V) :
V ⊕ S × Fin 4 → V ⊕ S × Fin 4 → ℤ

The gadgets attached at every site, on the flat node type: the base matrix on V, and four gadget nodes per site. The first edge of a site enters its gadget at node 0 and leaves from node 3, the second enters at 3 and leaves from 0, as in DescriptiveComplexity.attachValiant.

Equations
Instances For
    Dependency graph

    The nested node type, flattened #

    def DescriptiveComplexity.Site.toFlat {V S : Type} (site : S → Site V) (l : List S) :
    AttachType V (List.map site l) → V ⊕ { s : S // s ∈ l } × Fin 4

    The nested node type of the attachments along a list, read on the flat node type.

    Equations
    Instances For
      Dependency graph
      def DescriptiveComplexity.Site.ofFlat {V S : Type} [DecidableEq S] (site : S → Site V) (l : List S) :
      V ⊕ { s : S // s ∈ l } × Fin 4 → AttachType V (List.map site l)

      The flat node type, read on the nested one.

      Equations
      Instances For
        Dependency graph
        theorem DescriptiveComplexity.Site.toFlat_base {V S : Type} (site : S → Site V) (l : List S) (a : V) :
        toFlat site l (base (List.map site l) a) = Sum.inl a
        Dependency graph
        theorem DescriptiveComplexity.Site.ofFlat_inl {V S : Type} [DecidableEq S] (site : S → Site V) (l : List S) (a : V) :
        ofFlat site l (Sum.inl a) = base (List.map site l) a
        Dependency graph
        theorem DescriptiveComplexity.Site.ofFlat_toFlat {V S : Type} [DecidableEq S] (site : S → Site V) (l : List S) :
        l.Nodup → ∀ (n : AttachType V (List.map site l)), ofFlat site l (toFlat site l n) = n
        Dependency graph
        theorem DescriptiveComplexity.Site.toFlat_ofFlat {V S : Type} [DecidableEq S] (site : S → Site V) (l : List S) (n : V ⊕ { s : S // s ∈ l } × Fin 4) :
        toFlat site l (ofFlat site l n) = n
        Dependency graph
        theorem DescriptiveComplexity.Site.toFlat_injective {V S : Type} (site : S → Site V) (l : List S) (hl : l.Nodup) :
        Dependency graph
        theorem DescriptiveComplexity.Site.toFlat_eq_inl_iff {V S : Type} (site : S → Site V) (l : List S) (hl : l.Nodup) (n : AttachType V (List.map site l)) (a : V) :
        toFlat site l n = Sum.inl a ↔ n = base (List.map site l) a
        Dependency graph
        theorem DescriptiveComplexity.Site.bperm_flatAttach {V S : Type} [Fintype V] [DecidableEq V] [DecidableEq S] (site : S → Site V) [Fintype S] (M₀ : V → V → ℤ) :

        The permanent of the flat attachment is that of the nested one, the sites enumerated in any order.

        Dependency graph