Documentation

Complexitylib.Algebraic.LowerBound.Cutwidth.MultiOutput.Ordering.Internal.Graph

The wire graph of a closed set of wires #

Fix a program over any signature whose gates have at most two arguments, and a closed set K of wires: a gate lies in K exactly when the wires it reads do. The wire graph of K has a vertex for every wire of K and, for a wire read by f ≥ 2 argument slots, f - 1 copy vertices of degree three through which the signal is routed. Its edges are the argument slots of the gates of K and the incoming edge of every copy vertex. This is the construction of Cutwidth.Wiring, freed from the binary basis and from the reachability restriction.

The main results are

theorem Algebraic.Cutwidth.MultiOutput.Internal.arity_le_of_fanInAtMost {σ : Signature} {n r s : ℕ} (p : Program σ n s) :
p.FanInAtMost r → ∀ (g : Fin s), σ.Arity (p.lines g).op ≤ r

A gate of a program with fan-in at most r has at most r arguments.

A closed set of wires: a gate lies in the set exactly when every wire it reads does.

Instances For
    @[reducible, inline]

    The wires of K: the signals of the wire graph.

    Equations
    Instances For
      @[reducible, inline]

      The argument slots of the gates of K.

      Equations
      Instances For

        The wire read by a slot.

        Equations
        Instances For
          noncomputable def Algebraic.Cutwidth.MultiOutput.Internal.WireGraph.slots {σ : Signature} {n s : ℕ} {p : Program σ n s} (K : ClosedSet p) (w : Signal K) :

          The slots fed by a signal.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            theorem Algebraic.Cutwidth.MultiOutput.Internal.WireGraph.mem_slots {σ : Signature} {n s : ℕ} {p : Program σ n s} (K : ClosedSet p) {w : Signal K} {t : Slot K} :
            t ∈ slots K w ↔ slotSignal K t = w
            @[reducible, inline]

            A signal feeding f ≥ 2 slots is routed through f - 1 copy vertices.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              @[reducible, inline]

              Edges: the slots of the gates of K and the incoming edges of the copy vertices.

              Equations
              Instances For
                noncomputable def Algebraic.Cutwidth.MultiOutput.Internal.WireGraph.slotIndex {σ : Signature} {n s : ℕ} {p : Program σ n s} (K : ClosedSet p) (t : Slot K) :

                The position of a slot among the slots of its signal.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  theorem Algebraic.Cutwidth.MultiOutput.Internal.WireGraph.slotIndex_injective {σ : Signature} {n s : ℕ} {p : Program σ n s} (K : ClosedSet p) {t t' : Slot K} (hsignal : slotSignal K t = slotSignal K t') (hindex : slotIndex K t = slotIndex K t') :
                  t = t'

                  Slots of one signal are determined by their positions.

                  noncomputable def Algebraic.Cutwidth.MultiOutput.Internal.WireGraph.copyIndex {σ : Signature} {n s : ℕ} {p : Program σ n s} (K : ClosedSet p) (t : Slot K) :

                  The copy vertex at which a slot is attached, when its signal has fan-out at least two: slots in order, with the last two slots sharing the last copy.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    noncomputable def Algebraic.Cutwidth.MultiOutput.Internal.WireGraph.fst {σ : Signature} {n s : ℕ} {p : Program σ n s} (K : ClosedSet p) :
                    Edge K → Vertex K

                    The first endpoint of an edge: the signal vertex or copy vertex supplying it.

                    Equations
                    Instances For
                      theorem Algebraic.Cutwidth.MultiOutput.Internal.WireGraph.fst_inr_succ {σ : Signature} {n s : ℕ} {p : Program σ n s} (K : ClosedSet p) (w : Signal K) (k : ℕ) (h : k + 1 < fanout K w - 1) :

                      Walks along one signal #

                      Two vertices are joined by an edge carrying the signal w.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        theorem Algebraic.Cutwidth.MultiOutput.Internal.WireGraph.signalAdj_of_edge {σ : Signature} {n s : ℕ} {p : Program σ n s} (K : ClosedSet p) (e : Edge K) :
                        SignalAdj K (signal K e) (fst K e) (snd K e)

                        An edge joins its endpoints along its own signal.

                        theorem Algebraic.Cutwidth.MultiOutput.Internal.WireGraph.SignalAdj.symm {σ : Signature} {n s : ℕ} {p : Program σ n s} (K : ClosedSet p) {w : Signal K} {u v : Vertex K} (h : SignalAdj K w u v) :
                        SignalAdj K w v u
                        theorem Algebraic.Cutwidth.MultiOutput.Internal.WireGraph.adj_of_signalAdj {σ : Signature} {n s : ℕ} {p : Program σ n s} (K : ClosedSet p) {w : Signal K} {u v : Vertex K} (h : SignalAdj K w u v) :
                        (graph K).Adj u v

                        An edge carrying a signal is an edge of the graph.

                        Every copy vertex of a signal is joined to the signal's vertex along its copy chain.

                        The vertex of a signal is joined to the vertex of every gate reading it, along edges carrying the signal.

                        theorem Algebraic.Cutwidth.MultiOutput.Internal.WireGraph.exists_mem_cut_of_reflTransGen {σ : Signature} {n s : ℕ} {p : Program σ n s} (K : ClosedSet p) (L : Finset (Vertex K)) {w : Signal K} {u v : Vertex K} (h : Relation.ReflTransGen (SignalAdj K w) u v) (huv : ¬(u ∈ L ↔ v ∈ L)) :
                        ∃ e ∈ (graph K).cut L, signal K e = w

                        A walk along one signal between the two sides of a vertex set crosses its cut with an edge carrying that signal.

                        Signals crossing a cut #

                        noncomputable def Algebraic.Cutwidth.MultiOutput.Internal.WireGraph.wiresIn {σ : Signature} {n s : ℕ} {p : Program σ n s} (K : ClosedSet p) (L : Finset (Vertex K)) :
                        Finset (Wire n s)

                        The wires of K whose vertices lie in L.

                        Equations
                        Instances For
                          theorem Algebraic.Cutwidth.MultiOutput.Internal.WireGraph.mem_wiresIn {σ : Signature} {n s : ℕ} {p : Program σ n s} (K : ClosedSet p) {L : Finset (Vertex K)} {w : Wire n s} :
                          w ∈ wiresIn K L ↔ ∃ (h : w ∈ K.carrier), Sum.inl ⟨w, h⟩ ∈ L
                          theorem Algebraic.Cutwidth.MultiOutput.Internal.WireGraph.exists_cut_edge {σ : Signature} {n s : ℕ} {p : Program σ n s} (K : ClosedSet p) (L : Finset (Vertex K)) {g : Fin s} {w : Wire n s} (hr : p.Reads g w) (hg : Wire.gate g ∈ K.carrier) (hside : ¬(w ∈ wiresIn K L ↔ Wire.gate g ∈ wiresIn K L)) :
                          ∃ e ∈ (graph K).cut L, ↑(signal K e) = w

                          A gate of K reading a wire on the other side of the split yields a cut edge carrying that wire's signal.

                          Crossing signals are bounded by the cut. For every set L of vertices, the forward and backward signals of the wires whose vertices lie in L number at most the edges of the cut of L.

                          Graph properties #

                          No edge joins a vertex to itself.

                          theorem Algebraic.Cutwidth.MultiOutput.Internal.WireGraph.mem_outEdges {σ : Signature} {n s : ℕ} {p : Program σ n s} (K : ClosedSet p) {v : Vertex K} {e : Edge K} :
                          e ∈ outEdges K v ↔ fst K e = v
                          theorem Algebraic.Cutwidth.MultiOutput.Internal.WireGraph.mem_inEdges {σ : Signature} {n s : ℕ} {p : Program σ n s} (K : ClosedSet p) {v : Vertex K} {e : Edge K} :
                          e ∈ inEdges K v ↔ snd K e = v

                          A signal vertex receives at most two edges: the slots of its gate.

                          At most one edge leaves a signal vertex.

                          Exactly one edge enters a copy vertex.

                          A slot attached to a copy vertex has its position at least the copy's.

                          At most two edges leave a copy vertex: the next copy edge and its slots.

                          Every vertex has at most three incident edges.

                          theorem Algebraic.Cutwidth.MultiOutput.Internal.WireGraph.reflTransGen_adj_of_linked {σ : Signature} {n s : ℕ} {p : Program σ n s} (K : ClosedSet p) {u v : Wire n s} (h : Linked p u v) (hu : u ∈ K.carrier) (hv : v ∈ K.carrier) :

                          Linked wires of K are joined in the wire graph.

                          Paths of linked wires starting in K stay in K and lift to the wire graph.

                          theorem Algebraic.Cutwidth.MultiOutput.Internal.WireGraph.connected {σ : Signature} {n s : ℕ} {p : Program σ n s} (K : ClosedSet p) (hne : K.carrier.Nonempty) (hconn : ∀ u ∈ K.carrier, ∀ v ∈ K.carrier, Relation.ReflTransGen (Linked p) u v) :

                          The wire graph of a nonempty set of wires connected in the program's wire graph is connected.

                          Counting vertices and edges #

                          The slots of K number at most twice its gates.

                          The signals of K are its inputs and its gates.

                          There are no more copy vertices than slots.

                          The excess of edges over vertices is at most the gates minus the inputs of K.

                          The wire graph of K has at most i + 3 g vertices for i inputs and g gates in K.