Documentation

TauCeti.Combinatorics.Graph.Orientation.Hakimi

Prescribed and bounded indegree orientations #

For a finite multigraph G, loops and parallel edges allowed, and natural vertex bounds a ≤ b, an orientation with a v ≤ indegree v ≤ b v at every vertex exists exactly when every vertex set S satisfies

With a = b = d this is Hakimi's theorem: an orientation with indegree d exists exactly when d sums to the number of edges and |E(S)| ≤ d(S) for every S. The one-sided bounds and the outdegree forms are corollaries.

The proof is a reduction to interval-excess feasibility over ℤ. The edge-to-endpoint network Graph.EndpointHom has a node for each actual edge and each actual vertex, and a capacity-one arrow from an edge node to each distinct end of the edge, so that a loop has a single arrow. Prescribing excess -1 at edge nodes and excess in [a v, b v] at vertex nodes, the integral feasible assignments are exactly the orientations within the bounds: the unit leaving an edge node goes to the chosen head (Graph.orientationEndpointEquiv). The cut criterion of TauCeti.ExcessIntervalFlow.nonempty_iff for this network reduces to the two displayed families of inequalities (Graph.forall_cutBound_endpointBound_iff).

Main declarations #

References #

def Graph.EndpointHom {V : Type u} {E : Type v} (G : Graph V E) :
↑G.edgeSet ⊕ ↑G.vertexSet → ↑G.edgeSet ⊕ ↑G.vertexSet → Type

The arrows of the edge-to-endpoint network of G. Its nodes are the actual edges and the actual vertices of G. There is one arrow from each edge node to each distinct end of that edge, so a loop has a single arrow, and there are no other arrows. The family is exposed so that its Fintype instance compiles consistently in importing modules.

Instances For
    def Graph.EndpointHom.arrow {V : Type u} {E : Type v} {G : Graph V E} {e : ↑G.edgeSet} {x : ↑G.vertexSet} (h : G.Inc ↑e ↑x) :

    The arrow from an edge node to an end of the edge.

    Instances For
      theorem Graph.EndpointHom.inc {V : Type u} {E : Type v} {G : Graph V E} {e : ↑G.edgeSet} {x : ↑G.vertexSet} (p : G.EndpointHom (Sum.inl e) (Sum.inr x)) :
      G.Inc ↑e ↑x

      The target of an arrow leaving an edge node is an end of the edge.

      instance Graph.EndpointHom.instSubsingleton {V : Type u} {E : Type v} {G : Graph V E} (e : ↑G.edgeSet) (x : ↑G.vertexSet) :
      instance Graph.EndpointHom.instIsEmptyInl {V : Type u} {E : Type v} {G : Graph V E} (e f : ↑G.edgeSet) :
      instance Graph.EndpointHom.instIsEmptyInr {V : Type u} {E : Type v} {G : Graph V E} (x : ↑G.vertexSet) (y : ↑G.edgeSet ⊕ ↑G.vertexSet) :
      @[instance_reducible]
      noncomputable instance Graph.EndpointHom.instFintype {V : Type u} {E : Type v} {G : Graph V E} (y z : ↑G.edgeSet ⊕ ↑G.vertexSet) :
      theorem Graph.EndpointHom.arrowSum_eq {V : Type u} {E : Type v} {G : Graph V E} {K : Type u_1} [AddCommMonoid K] (f : TauCeti.Assignment G.EndpointHom K) (T T' : Finset (↑G.edgeSet ⊕ ↑G.vertexSet)) :
      TauCeti.arrowSum f T T' = ∑ e ∈ T.toLeft, ∑ x ∈ T'.toRight, ∑ p : G.EndpointHom (Sum.inl e) (Sum.inr x), f p

      Arrow sums in the edge-to-endpoint network only see arrows from edge nodes in T to vertex nodes in T'.

      theorem Graph.EndpointHom.excessAt_inl {V : Type u} {E : Type v} {G : Graph V E} [Fintype ↑G.edgeSet] [Fintype ↑G.vertexSet] {K : Type u_1} [AddCommGroup K] (f : TauCeti.Assignment G.EndpointHom K) (e : ↑G.edgeSet) :
      TauCeti.excessAt f (Sum.inl e) = -∑ x : ↑G.vertexSet, ∑ p : G.EndpointHom (Sum.inl e) (Sum.inr x), f p

      The excess at an edge node is minus the total value leaving it.

      theorem Graph.EndpointHom.excessAt_inr {V : Type u} {E : Type v} {G : Graph V E} [Fintype ↑G.edgeSet] [Fintype ↑G.vertexSet] {K : Type u_1} [AddCommGroup K] (f : TauCeti.Assignment G.EndpointHom K) (x : ↑G.vertexSet) :
      TauCeti.excessAt f (Sum.inr x) = ∑ e : ↑G.edgeSet, ∑ p : G.EndpointHom (Sum.inl e) (Sum.inr x), f p

      The excess at a vertex node is the total value entering it.

      def Graph.endpointBound {V : Type u} {E : Type v} {G : Graph V E} (c : ↑G.vertexSet → ℕ) :
      ↑G.edgeSet ⊕ ↑G.vertexSet → ℤ

      Vertex bounds for the edge-to-endpoint network: excess -1 at every edge node, so that each edge sends out one unit, and the bound c at every vertex node.

      Instances For
        @[simp]
        theorem Graph.endpointBound_inl {V : Type u} {E : Type v} {G : Graph V E} (c : ↑G.vertexSet → ℕ) (e : ↑G.edgeSet) :
        @[simp]
        theorem Graph.endpointBound_inr {V : Type u} {E : Type v} {G : Graph V E} (c : ↑G.vertexSet → ℕ) (x : ↑G.vertexSet) :
        endpointBound c (Sum.inr x) = ↑(c x)
        theorem Graph.endpointBound_mem_Icc_iff {V : Type u} {E : Type v} {G : Graph V E} {a b c : ↑G.vertexSet → ℕ} :
        endpointBound c ∈ Set.Icc (endpointBound a) (endpointBound b) ↔ ∀ (x : ↑G.vertexSet), c x ∈ Set.Icc (a x) (b x)

        Vertex bounds of the edge-to-endpoint network compare exactly as the bounds at vertex nodes.

        theorem Graph.endpointBound_mono {V : Type u} {E : Type v} {G : Graph V E} {a b : ↑G.vertexSet → ℕ} (h : a ≤ b) :

        Ordered vertex bounds give ordered bounds on the edge-to-endpoint network.

        noncomputable def Graph.Orientation.headAssignment {V : Type u} {E : Type v} {G : Graph V E} (o : G.Orientation) :

        The assignment of the edge-to-endpoint network sending the unit of each edge node to the chosen head of the edge.

        Instances For
          @[simp]
          theorem Graph.Orientation.headAssignment_apply {V : Type u} {E : Type v} {G : Graph V E} [DecidableEq ↑G.vertexSet] (o : G.Orientation) {e : ↑G.edgeSet} {x : ↑G.vertexSet} (p : G.EndpointHom (Sum.inl e) (Sum.inr x)) :
          o.headAssignment p = if o.head e = x then 1 else 0

          The head assignment takes values between 0 and 1.

          @[simp]

          The excess of the head assignment of an orientation is -1 at edge nodes and the indegree at vertex nodes.

          noncomputable def Graph.orientationEndpointEquiv {V : Type u} {E : Type v} {G : Graph V E} [Fintype ↑G.edgeSet] [Fintype ↑G.vertexSet] (a b : ↑G.vertexSet → ℕ) :

          Edge-to-endpoint reduction. Orientations of G with indegrees between a and b are equivalent to the integral assignments of the edge-to-endpoint network with arrow bounds 0 and 1, excess -1 at edge nodes, and excess between a and b at vertex nodes. An orientation sends the unit of each edge node to the chosen head of the edge.

          Instances For
            @[simp]
            theorem Graph.orientationEndpointEquiv_apply_coe {V : Type u} {E : Type v} {G : Graph V E} [Fintype ↑G.edgeSet] [Fintype ↑G.vertexSet] (a b : ↑G.vertexSet → ℕ) (o : { o : G.Orientation // ∀ (x : ↑G.vertexSet), o.indegree x ∈ Set.Icc (a x) (b x) }) :
            theorem Graph.orientationEndpointEquiv_symm_head_eq_iff {V : Type u} {E : Type v} {G : Graph V E} [Fintype ↑G.edgeSet] [Fintype ↑G.vertexSet] {a b : ↑G.vertexSet → ℕ} (f : TauCeti.ExcessIntervalFlow 0 1 (endpointBound a) (endpointBound b)) {e : ↑G.edgeSet} {x : ↑G.vertexSet} (h : G.Inc ↑e ↑x) :
            (↑((orientationEndpointEquiv a b).symm f)).head e = x ↔ ↑f (EndpointHom.arrow h) = 1

            The orientation of a feasible assignment of the edge-to-endpoint network chooses as head of an edge the end whose arrow carries the edge's unit.

            @[simp]
            theorem Graph.orientationEndpointEquiv_symm_indegree {V : Type u} {E : Type v} {G : Graph V E} [Fintype ↑G.edgeSet] [Fintype ↑G.vertexSet] {a b : ↑G.vertexSet → ℕ} (f : TauCeti.ExcessIntervalFlow 0 1 (endpointBound a) (endpointBound b)) (x : ↑G.vertexSet) :

            The indegree of the orientation recovered from a feasible endpoint assignment is the excess at the corresponding vertex node.

            theorem Graph.forall_cutBound_endpointBound_iff {V : Type u} {E : Type v} {G : Graph V E} [Fintype ↑G.edgeSet] [Fintype ↑G.vertexSet] {a b : ↑G.vertexSet → ℕ} [DecidableEq (↑G.edgeSet ⊕ ↑G.vertexSet)] :
            ((∀ (T : Finset (↑G.edgeSet ⊕ ↑G.vertexSet)), ∑ y ∈ T, endpointBound a y ≤ TauCeti.cutBound 0 1 Tᶜ) ∧ ∀ (T : Finset (↑G.edgeSet ⊕ ↑G.vertexSet)), -TauCeti.cutBound 0 1 T ≤ ∑ y ∈ T, endpointBound b y) ↔ (∀ (S : Finset ↑G.vertexSet), (G.internalEdges S).card ≤ ∑ x ∈ S, b x) ∧ ∀ (S : Finset ↑G.vertexSet), ∑ x ∈ S, a x ≤ (G.incidentEdges S).card

            Reduction of the cut inequalities. For the edge-to-endpoint network, the cut inequalities over all sets of nodes are equivalent to |E(S)| ≤ b(S) and a(S) ≤ |I(S)| over all sets S of vertices.

            theorem Graph.exists_orientation_indegree_mem_Icc_iff {V : Type u} {E : Type v} {G : Graph V E} [Fintype ↑G.edgeSet] [Finite ↑G.vertexSet] {a b : ↑G.vertexSet → ℕ} (hab : a ≤ b) :
            (∃ (o : G.Orientation), ∀ (x : ↑G.vertexSet), o.indegree x ∈ Set.Icc (a x) (b x)) ↔ (∀ (S : Finset ↑G.vertexSet), (G.internalEdges S).card ≤ ∑ x ∈ S, b x) ∧ ∀ (S : Finset ↑G.vertexSet), ∑ x ∈ S, a x ≤ (G.incidentEdges S).card

            Bounded-indegree orientations. For vertex bounds a ≤ b, a finite multigraph has an orientation with every indegree between a and b exactly when every vertex set S has at most b(S) internal edges and at least a(S) incident edges.

            theorem Graph.exists_orientation_indegree_mem_Icc_or_certificate {V : Type u} {E : Type v} {G : Graph V E} [Fintype ↑G.edgeSet] [Finite ↑G.vertexSet] {a b : ↑G.vertexSet → ℕ} (hab : a ≤ b) :
            (∃ (o : G.Orientation), ∀ (x : ↑G.vertexSet), o.indegree x ∈ Set.Icc (a x) (b x)) ∨ ∃ (S : Finset ↑G.vertexSet), ∑ x ∈ S, b x < (G.internalEdges S).card ∨ (G.incidentEdges S).card < ∑ x ∈ S, a x

            A finite multigraph has an orientation with indegrees between a ≤ b, or some vertex set has more than b(S) internal edges or fewer than a(S) incident edges.

            theorem Graph.exists_orientation_indegree_le_iff {V : Type u} {E : Type v} {G : Graph V E} [Fintype ↑G.edgeSet] [Finite ↑G.vertexSet] (b : ↑G.vertexSet → ℕ) :
            (∃ (o : G.Orientation), ∀ (x : ↑G.vertexSet), o.indegree x ≤ b x) ↔ ∀ (S : Finset ↑G.vertexSet), (G.internalEdges S).card ≤ ∑ x ∈ S, b x

            Upper-bounded indegrees. A finite multigraph has an orientation with every indegree at most b exactly when every vertex set S has at most b(S) internal edges.

            theorem Graph.exists_orientation_le_indegree_iff {V : Type u} {E : Type v} {G : Graph V E} [Fintype ↑G.edgeSet] [Finite ↑G.vertexSet] (a : ↑G.vertexSet → ℕ) :
            (∃ (o : G.Orientation), ∀ (x : ↑G.vertexSet), a x ≤ o.indegree x) ↔ ∀ (S : Finset ↑G.vertexSet), ∑ x ∈ S, a x ≤ (G.incidentEdges S).card

            Lower-bounded indegrees. A finite multigraph has an orientation with every indegree at least a exactly when every vertex set S has at least a(S) incident edges.

            theorem Graph.exists_orientation_indegree_eq_iff {V : Type u} {E : Type v} {G : Graph V E} [Fintype ↑G.edgeSet] [Fintype ↑G.vertexSet] (d : ↑G.vertexSet → ℕ) :
            (∃ (o : G.Orientation), ∀ (x : ↑G.vertexSet), o.indegree x = d x) ↔ ∑ x : ↑G.vertexSet, d x = Fintype.card ↑G.edgeSet ∧ ∀ (S : Finset ↑G.vertexSet), (G.internalEdges S).card ≤ ∑ x ∈ S, d x

            Hakimi's theorem. A finite multigraph has an orientation with indegree d exactly when d sums to the number of actual edges and every vertex set S has at most d(S) internal edges.

            theorem Graph.exists_orientation_indegree_eq_or_certificate {V : Type u} {E : Type v} {G : Graph V E} [Fintype ↑G.edgeSet] [Fintype ↑G.vertexSet] (d : ↑G.vertexSet → ℕ) :
            (∃ (o : G.Orientation), ∀ (x : ↑G.vertexSet), o.indegree x = d x) ∨ ∑ x : ↑G.vertexSet, d x ≠ Fintype.card ↑G.edgeSet ∨ ∃ (S : Finset ↑G.vertexSet), ∑ x ∈ S, d x < (G.internalEdges S).card

            A finite multigraph has an orientation with indegree d, or d does not sum to the number of actual edges, or some vertex set S has more than d(S) internal edges.

            Outdegree forms #

            theorem Graph.exists_orientation_outdegree_mem_Icc_iff {V : Type u} {E : Type v} {G : Graph V E} [Fintype ↑G.edgeSet] [Finite ↑G.vertexSet] {a b : ↑G.vertexSet → ℕ} (hab : a ≤ b) :
            (∃ (o : G.Orientation), ∀ (x : ↑G.vertexSet), o.outdegree x ∈ Set.Icc (a x) (b x)) ↔ (∀ (S : Finset ↑G.vertexSet), (G.internalEdges S).card ≤ ∑ x ∈ S, b x) ∧ ∀ (S : Finset ↑G.vertexSet), ∑ x ∈ S, a x ≤ (G.incidentEdges S).card

            The outdegree form of Graph.exists_orientation_indegree_mem_Icc_iff.

            theorem Graph.exists_orientation_outdegree_le_iff {V : Type u} {E : Type v} {G : Graph V E} [Fintype ↑G.edgeSet] [Finite ↑G.vertexSet] (b : ↑G.vertexSet → ℕ) :
            (∃ (o : G.Orientation), ∀ (x : ↑G.vertexSet), o.outdegree x ≤ b x) ↔ ∀ (S : Finset ↑G.vertexSet), (G.internalEdges S).card ≤ ∑ x ∈ S, b x

            The outdegree form of Graph.exists_orientation_indegree_le_iff.

            theorem Graph.exists_orientation_le_outdegree_iff {V : Type u} {E : Type v} {G : Graph V E} [Fintype ↑G.edgeSet] [Finite ↑G.vertexSet] (a : ↑G.vertexSet → ℕ) :
            (∃ (o : G.Orientation), ∀ (x : ↑G.vertexSet), a x ≤ o.outdegree x) ↔ ∀ (S : Finset ↑G.vertexSet), ∑ x ∈ S, a x ≤ (G.incidentEdges S).card

            The outdegree form of Graph.exists_orientation_le_indegree_iff.

            theorem Graph.exists_orientation_outdegree_eq_iff {V : Type u} {E : Type v} {G : Graph V E} [Fintype ↑G.edgeSet] [Fintype ↑G.vertexSet] (d : ↑G.vertexSet → ℕ) :
            (∃ (o : G.Orientation), ∀ (x : ↑G.vertexSet), o.outdegree x = d x) ↔ ∑ x : ↑G.vertexSet, d x = Fintype.card ↑G.edgeSet ∧ ∀ (S : Finset ↑G.vertexSet), (G.internalEdges S).card ≤ ∑ x ∈ S, d x

            The outdegree form of Hakimi's theorem Graph.exists_orientation_indegree_eq_iff.