Documentation

Complexitylib.Algebraic.LowerBound.Cutwidth.Network

Constraint networks and the cut-counting lemma #

A Network is a multigraph whose vertices carry local checks on the bits written on their incident edges, together with a port for each input variable read by the network: a vertex and an incident edge that must carry the variable's value. The network computes f when the accepted inputs are exactly those for which some edge assignment satisfies every check and every port.

For a vertex ordering, the bits on a prefix cut summarize what the processed part of the network remembers. The past assignments consistent with a cut assignment and the future assignments consistent with it form a one-rectangle of f (accepted_of_mem_pastSet_of_mem_futureSet). Charging every accepted input to the first vertex at which its past set becomes large, the cut-counting lemma card_accepting_le_of_realized bounds the number of accepted inputs of a K-rectangle-free function by |V| · P · (K - 1) ^ 2, where P bounds the number of bit patterns that satisfying assignments realize on the cut before a vertex together with its incident edges (realized). A subset of those edges that determines the rest under every satisfying assignment (Determines) bounds the patterns by a power of two (card_realized_le_of_determines). Taking all edges, the classical form card_accepting_le charges 2 ^ (w + 3), where w bounds every prefix cut and each vertex has at most three incident edges.

A constraint network over n input variables: a multigraph with a local check at every vertex and a port for every variable it reads.

  • fst : E → V
  • snd : E → V
  • Check : V → (E → Bool) → Prop

    The local check of a vertex on an assignment of bits to edges.

  • check_local (v : V) (α β : E → Bool) : (∀ (e : E), self.fst e = v ∨ self.snd e = v → α e = β e) → self.Check v α → self.Check v β

    A check depends only on the bits of the incident edges.

  • read : Finset (Fin n)

    The variables read by the network.

  • portVertex : Fin n → V

    The vertex at which a variable is read. Irrelevant outside read.

  • portEdge : Fin n → E

    The edge carrying a variable's value. Irrelevant outside read.

  • port_incident (j : Fin n) : j ∈ self.read → self.fst (self.portEdge j) = self.portVertex j ∨ self.snd (self.portEdge j) = self.portVertex j

    The port edge of a read variable is incident to its port vertex.

Instances For
    def Algebraic.Cutwidth.Network.Satisfies {n : ℕ} {V E : Type} (N : Network n V E) (x : Fin n → Bool) (α : E → Bool) :

    An edge assignment satisfies every check and carries the input on every port.

    Equations
    Instances For

      The accepted inputs are those with a satisfying edge assignment.

      Equations
      Instances For

        A computed function depends only on the variables the network reads.

        noncomputable def Algebraic.Cutwidth.Network.past {n : ℕ} {V E : Type} (N : Network n V E) (L : Finset V) :

        The variables read at a vertex of L.

        Equations
        Instances For
          theorem Algebraic.Cutwidth.Network.mem_past {n : ℕ} {V E : Type} (N : Network n V E) {L : Finset V} {j : Fin n} :
          j ∈ N.past L ↔ j ∈ N.read ∧ N.portVertex j ∈ L
          @[simp]
          theorem Algebraic.Cutwidth.Network.past_empty {n : ℕ} {V E : Type} (N : Network n V E) :
          @[simp]
          def Algebraic.Cutwidth.Network.Determines {n : ℕ} {V E : Type} (N : Network n V E) (C T : Finset E) :

          T determines C: two satisfying assignments that agree on T agree on C.

          Equations
          Instances For
            theorem Algebraic.Cutwidth.Network.determines_self {n : ℕ} {V E : Type} (N : Network n V E) (C : Finset E) :
            theorem Algebraic.Cutwidth.Network.Determines.anti {n : ℕ} {V E : Type} (N : Network n V E) {C C' T : Finset E} (h : N.Determines C T) (hC : C' ⊆ C) :
            N.Determines C' T
            theorem Algebraic.Cutwidth.Network.Determines.mono {n : ℕ} {V E : Type} (N : Network n V E) {C T T' : Finset E} (h : N.Determines C T) (hT : T ⊆ T') :
            N.Determines C T'
            noncomputable def Algebraic.Cutwidth.Network.pastSet {n : ℕ} {V E : Type} (N : Network n V E) [Fintype V] [Fintype E] (L : Finset V) (σ : E → Bool) :
            Finset (↥(N.past L) → Bool)

            The past assignments consistent with a cut assignment: assignments to the variables read in L extended by an edge assignment satisfying the checks of L and agreeing with σ on the cut.

            Equations
            Instances For
              noncomputable def Algebraic.Cutwidth.Network.futureSet {n : ℕ} {V E : Type} (N : Network n V E) [Fintype V] [Fintype E] (L : Finset V) (σ : E → Bool) :
              Finset (↥(N.past L)ᶜ → Bool)

              The future assignments consistent with a cut assignment: assignments to the remaining variables extended by an edge assignment satisfying the checks outside L, agreeing with σ on the cut, and carrying the read variables.

              Equations
              Instances For
                theorem Algebraic.Cutwidth.Network.mem_pastSet {n : ℕ} {V E : Type} (N : Network n V E) [Fintype V] [Fintype E] {L : Finset V} {σ : E → Bool} {p : ↥(N.past L) → Bool} :
                p ∈ N.pastSet L σ ↔ ∃ (α : E → Bool), (∀ v ∈ L, N.Check v α) ∧ (∀ e ∈ N.cut L, α e = σ e) ∧ ∀ (j : ↥(N.past L)), α (N.portEdge ↑j) = p j
                theorem Algebraic.Cutwidth.Network.mem_futureSet {n : ℕ} {V E : Type} (N : Network n V E) [Fintype V] [Fintype E] {L : Finset V} {σ : E → Bool} {q : ↥(N.past L)ᶜ → Bool} :
                q ∈ N.futureSet L σ ↔ ∃ (β : E → Bool), (∀ v ∉ L, N.Check v β) ∧ (∀ e ∈ N.cut L, β e = σ e) ∧ ∀ (j : ↥(N.past L)ᶜ), ↑j ∈ N.read → β (N.portEdge ↑j) = q j
                theorem Algebraic.Cutwidth.Network.pastSet_congr {n : ℕ} {V E : Type} (N : Network n V E) [Fintype V] [Fintype E] {L : Finset V} {σ σ' : E → Bool} (h : ∀ e ∈ N.cut L, σ e = σ' e) :
                N.pastSet L σ = N.pastSet L σ'

                The past set depends on the cut assignment only through the cut.

                theorem Algebraic.Cutwidth.Network.futureSet_congr {n : ℕ} {V E : Type} (N : Network n V E) [Fintype V] [Fintype E] {L : Finset V} {σ σ' : E → Bool} (h : ∀ e ∈ N.cut L, σ e = σ' e) :
                N.futureSet L σ = N.futureSet L σ'

                The future set depends on the cut assignment only through the cut.

                theorem Algebraic.Cutwidth.Network.restrict_mem_pastSet {n : ℕ} {V E : Type} (N : Network n V E) [Fintype V] [Fintype E] {x : Fin n → Bool} {α : E → Bool} (h : N.Satisfies x α) (L : Finset V) :
                (fun (j : ↥(N.past L)) => x ↑j) ∈ N.pastSet L α

                The past of an accepted input lies in the past set of its own assignment.

                theorem Algebraic.Cutwidth.Network.restrict_mem_futureSet {n : ℕ} {V E : Type} (N : Network n V E) [Fintype V] [Fintype E] {x : Fin n → Bool} {α : E → Bool} (h : N.Satisfies x α) (L : Finset V) :
                (fun (j : ↥(N.past L)ᶜ) => x ↑j) ∈ N.futureSet L α

                The future of an accepted input lies in the future set of its own assignment.

                theorem Algebraic.Cutwidth.Network.card_pastSet_empty_le {n : ℕ} {V E : Type} (N : Network n V E) [Fintype V] [Fintype E] (σ : E → Bool) :
                (N.pastSet ∅ σ).card ≤ 1

                Before any vertex is processed, only the empty past assignment exists.

                theorem Algebraic.Cutwidth.Network.accepted_of_mem_pastSet_of_mem_futureSet {n : ℕ} {V E : Type} (N : Network n V E) [Fintype V] [Fintype E] {f : Cslib.BooleanFunction n} (hf : N.Computes f) {L : Finset V} {σ : E → Bool} {p : ↥(N.past L) → Bool} (hp : p ∈ N.pastSet L σ) {q : ↥(N.past L)ᶜ → Bool} (hq : q ∈ N.futureSet L σ) :
                f (glue (N.past L) p q) = true

                A consistent past and future together form an accepted input: the past and future sets of a cut assignment form a one-rectangle.

                theorem Algebraic.Cutwidth.Network.card_accepting_lt_of_card_pastSet_univ_lt {n : ℕ} {V E : Type} (N : Network n V E) [Fintype V] [Fintype E] {f : Cslib.BooleanFunction n} (hf : N.Computes f) {K : ℕ} (small : (N.pastSet Finset.univ fun (x : E) => false).card < K) :
                (accepting f).card < K * 2 ^ (n - N.read.card)

                Every accepted input restricts into a fixed past set of the whole vertex set, so a small final past set forces few accepted inputs.

                Realized patterns #

                noncomputable def Algebraic.Cutwidth.Network.realized {n : ℕ} {V E : Type} (N : Network n V E) [Fintype E] (C : Finset E) :
                Finset (E → Bool)

                The bit patterns on C realized by satisfying assignments, each extended by false off C.

                Equations
                Instances For
                  theorem Algebraic.Cutwidth.Network.mem_realized {n : ℕ} {V E : Type} (N : Network n V E) [Fintype E] {C : Finset E} {τ : E → Bool} :
                  τ ∈ N.realized C ↔ ∃ (x : Fin n → Bool) (α : E → Bool), N.Satisfies x α ∧ ∀ (e : E), τ e = if e ∈ C then α e else false
                  theorem Algebraic.Cutwidth.Network.card_realized_le_of_determines {n : ℕ} {V E : Type} (N : Network n V E) [Fintype E] {C T : Finset E} (hT : T ⊆ C) (h : N.Determines C T) :
                  (N.realized C).card ≤ 2 ^ T.card

                  A determining subset of C bounds the patterns realized on C: restriction to T is injective on them.

                  theorem Algebraic.Cutwidth.Network.card_realized_le {n : ℕ} {V E : Type} (N : Network n V E) [Fintype E] (C : Finset E) :
                  (N.realized C).card ≤ 2 ^ C.card

                  At most 2 ^ |C| patterns are realized on C.

                  noncomputable def Algebraic.Cutwidth.Network.below {V : Type} [Fintype V] [LinearOrder V] (v : V) :

                  The vertices strictly before v.

                  Equations
                  Instances For
                    noncomputable def Algebraic.Cutwidth.Network.upto {V : Type} [Fintype V] [LinearOrder V] (v : V) :

                    The vertices up to and including v.

                    Equations
                    Instances For

                      The prefix through the last vertex is everything.

                      The vertices before v are empty or the prefix through an earlier vertex.

                      theorem Algebraic.Cutwidth.Network.cut_upto_subset {n : ℕ} {V E : Type} (N : Network n V E) [Fintype V] [Fintype E] [LinearOrder V] (v : V) :
                      N.cut (upto v) ⊆ N.cut (below v) ∪ N.edgesAt v

                      Processing one vertex changes the cut only among its incident edges.

                      noncomputable def Algebraic.Cutwidth.Network.charged {n : ℕ} {V E : Type} (N : Network n V E) [Fintype V] [Fintype E] [LinearOrder V] (v : V) :

                      The edges charged at a vertex: the cut before it and its incident edges.

                      Equations
                      Instances For
                        theorem Algebraic.Cutwidth.Network.cut_below_subset_charged {n : ℕ} {V E : Type} (N : Network n V E) [Fintype V] [Fintype E] [LinearOrder V] (v : V) :
                        N.cut (below v) ⊆ N.charged v
                        theorem Algebraic.Cutwidth.Network.cut_upto_subset_charged {n : ℕ} {V E : Type} (N : Network n V E) [Fintype V] [Fintype E] [LinearOrder V] (v : V) :
                        N.cut (upto v) ⊆ N.charged v
                        theorem Algebraic.Cutwidth.Network.edgesAt_subset_charged {n : ℕ} {V E : Type} (N : Network n V E) [Fintype V] [Fintype E] [LinearOrder V] (v : V) :
                        N.edgesAt v ⊆ N.charged v
                        theorem Algebraic.Cutwidth.Network.card_charged_le {n : ℕ} {V E : Type} (N : Network n V E) [Fintype V] [Fintype E] [LinearOrder V] {v : V} {w : ℕ} (hdeg : N.MaxDegreeLE 3) (hw : (N.cut (below v)).card ≤ w) :
                        (N.charged v).card ≤ w + 3

                        With prefix cuts of size at most w and degrees at most three, at most w + 3 edges are charged at any vertex.

                        theorem Algebraic.Cutwidth.Network.card_accepting_le_of_realized {n : ℕ} {V E : Type} (N : Network n V E) [Fintype V] [Fintype E] [LinearOrder V] [Nonempty V] {f : Cslib.BooleanFunction n} (hf : N.Computes f) {P : ℕ} (hP : ∀ (v : V), (N.realized (N.charged v)).card ≤ P) {K : ℕ} (hK : 1 < K) (hrect : RectangleFree f K) :
                        (accepting f).card < K * 2 ^ (n - N.read.card) ∨ (accepting f).card ≤ Fintype.card V * P * (K - 1) ^ 2

                        The cut-counting lemma, charged by realized patterns. For a network computing a K-rectangle-free function and a vertex ordering, suppose that satisfying assignments realize at most P bit patterns on the cut before any vertex together with that vertex's incident edges. Then either the final past set is small, so that fewer than K · 2 ^ (n - |read|) inputs are accepted, or at most |V| · P · (K - 1) ^ 2 inputs are accepted.

                        theorem Algebraic.Cutwidth.Network.card_accepting_le {n : ℕ} {V E : Type} (N : Network n V E) [Fintype V] [Fintype E] [LinearOrder V] [Nonempty V] {f : Cslib.BooleanFunction n} (hf : N.Computes f) (hdeg : N.MaxDegreeLE 3) {w : ℕ} (hw : ∀ (v : V), (N.cut (below v)).card ≤ w) {K : ℕ} (hK : 1 < K) (hrect : RectangleFree f K) :
                        (accepting f).card < K * 2 ^ (n - N.read.card) ∨ (accepting f).card ≤ Fintype.card V * 2 ^ (w + 3) * (K - 1) ^ 2

                        The cut-counting lemma. For a network computing a K-rectangle-free function, with every vertex of degree at most three and every prefix cut of the ordering of size at most w, either the final past set is small, so that fewer than K · 2 ^ (n - |read|) inputs are accepted, or at most |V| · 2 ^ (w + 3) · (K - 1) ^ 2 inputs are accepted.