Documentation

CslibFrontier.Foundations.Combinatorics.Digraph.Layered.Subdivision

Vertex-chain subdivision of a weighted layered graph #

A vertex of weight w is replaced by a chain of w edges, followed by the original outgoing edges. Slots beyond its weight are isolated. This prepares weighted paths for the unweighted scans in #6747. The subdivision is an ordinary digraph: weighted routes need not have equal lengths. This vertex-chain variant is an original construction.

pathEquiv identifies original paths with subdivided paths ending at any valid auxiliary offset. Expansion charges each departure vertex's weight plus one per original edge. For fixed endpoints the original layer difference fixes that edge count, so minimizing expanded length is equivalent to minimizing internal vertex weight. Original empty paths are handled separately: they expand only along the final partial source chain.

Main results #

The consumer CslibFrontier.Algorithms.Reachability.MinIsolation.Subdivision transfers this to the existing scan transcript contract. Native adjacency certificates are in CslibFrontier.Computability.Machines.Turing.MultiTape.Complexity.LogSpace.Subdivision.

structure Cslib.LayeredDigraph.Subdivision.Vertex (V : Type u_1) (bound : ℕ) :
Type u_1

A vertex and a bounded position in its subdivision chain.

  • vertex : V

    The original vertex whose chain contains this position.

  • offset : Fin (bound + 1)

    The chain position; positions above the vertex weight are unused.

Instances For
    theorem Cslib.LayeredDigraph.Subdivision.Vertex.ext_iff {V : Type u_1} {bound : ℕ} {x y : Vertex V bound} :
    theorem Cslib.LayeredDigraph.Subdivision.Vertex.ext {V : Type u_1} {bound : ℕ} {x y : Vertex V bound} (vertex : x.vertex = y.vertex) (offset : x.offset = y.offset) :
    x = y
    @[instance_reducible]
    instance Cslib.LayeredDigraph.Subdivision.instDecidableEqVertex {V✝ : Type u_1} {bound✝ : ℕ} [DecidableEq V✝] :
    DecidableEq (Vertex V✝ bound✝)
    def Cslib.LayeredDigraph.Subdivision.instDecidableEqVertex.decEq {V✝ : Type u_1} {bound✝ : ℕ} [DecidableEq V✝] (x✝ x✝¹ : Vertex V✝ bound✝) :
    Decidable (x✝ = x✝¹)
    def Cslib.LayeredDigraph.Subdivision.equivProd (V : Type u_1) (bound : ℕ) :
    Vertex V bound ≃ V × Fin (bound + 1)

    The rectangular carrier, with one slot index for each original vertex.

    @[simp]
    theorem Cslib.LayeredDigraph.Subdivision.equivProd_apply {V : Type u_1} {bound : ℕ} (v : Vertex V bound) :
    (equivProd V bound) v = (v.vertex, v.offset)
    @[instance_reducible]
    @[reducible, inline]
    abbrev Cslib.LayeredDigraph.Subdivision.root {V : Type u_1} (bound : ℕ) (v : V) :
    Vertex V bound

    The entry of an original vertex's chain.

    @[reducible, inline]
    abbrev Cslib.LayeredDigraph.Subdivision.graph {V : Type u_1} (G : LayeredDigraph V) (weight : V → ℕ) (bound : ℕ) :
    Digraph (Vertex V bound)

    Chain steps precede each original outgoing edge. Unused offsets are isolated.

    @[reducible, inline]
    abbrev Cslib.LayeredDigraph.Subdivision.toQuiver {V : Type u_1} (G : LayeredDigraph V) (weight : V → ℕ) (bound : ℕ) :
    Quiver (Vertex V bound)

    One arrow for every adjacent pair in the subdivision.

    instance Cslib.LayeredDigraph.Subdivision.instSubsingletonHomVertex {V : Type u_1} (G : LayeredDigraph V) (weight : V → ℕ) (bound : ℕ) (a b : Vertex V bound) :
    @[reducible, inline]
    abbrev Cslib.LayeredDigraph.Subdivision.Path {V : Type u_1} (G : LayeredDigraph V) (weight : V → ℕ) (bound : ℕ) (a b : Vertex V bound) :
    Type u_1

    Paths in the subdivision's ordinary directed graph.

    theorem Cslib.LayeredDigraph.Subdivision.offset_le {V : Type u_1} {G : LayeredDigraph V} {weight : V → ℕ} {bound : ℕ} {s : V} {v : Vertex V bound} (p : Path G weight bound (root bound s) v) :
    ↑v.offset ≤ weight v.vertex

    Every reached chain position is at most its vertex weight.

    def Cslib.LayeredDigraph.Subdivision.chain {V : Type u_1} {G : LayeredDigraph V} {weight : V → ℕ} {bound : ℕ} (v : V) (i : ℕ) (hi : i ≤ weight v) (hb : i ≤ bound) :
    Path G weight bound (root bound v) { vertex := v, offset := ⟨i, ⋯⟩ }

    The deterministic prefix of a vertex chain, ending at position i.

    def Cslib.LayeredDigraph.Subdivision.expand {V : Type u_1} {G : LayeredDigraph V} {weight : V → ℕ} {bound : ℕ} (hw : ∀ (v : V), weight v ≤ bound) {a b : V} (p : G.Path a b) :
    Path G weight bound (root bound a) (root bound b)

    Expand each original edge through its departure vertex's chain.

    noncomputable def Cslib.LayeredDigraph.Subdivision.contract {V : Type u_1} {G : LayeredDigraph V} {weight : V → ℕ} {bound : ℕ} {a b : Vertex V bound} (p : Path G weight bound a b) :

    Contract chain edges and keep exactly the original graph edges.

    theorem Cslib.LayeredDigraph.Subdivision.contract_expand {V : Type u_1} {G : LayeredDigraph V} {weight : V → ℕ} {bound : ℕ} (hw : ∀ (v : V), weight v ≤ bound) {a b : V} (p : G.Path a b) :
    contract (expand hw p) = p

    Expanding and contracting recovers the path, not just its endpoints.

    theorem Cslib.LayeredDigraph.Subdivision.normal_form {V : Type u_1} {G : LayeredDigraph V} {weight : V → ℕ} {bound : ℕ} (hw : ∀ (v : V), weight v ≤ bound) {s : V} {v : Vertex V bound} (p : Path G weight bound (root bound s) v) :
    p = Quiver.Path.comp (expand hw (contract p)) (chain v.vertex ↑v.offset ⋯ ⋯)

    Every subdivided path is an expanded original path followed by a final chain prefix. The statement includes auxiliary endpoints, not only the original graph's vertices.

    noncomputable def Cslib.LayeredDigraph.Subdivision.pathEquiv {V : Type u_1} {G : LayeredDigraph V} {weight : V → ℕ} {bound : ℕ} (hw : ∀ (v : V), weight v ≤ bound) (s : V) (v : Vertex V bound) (hv : ↑v.offset ≤ weight v.vertex) :
    G.Path s v.vertex ≃ Path G weight bound (root bound s) v

    Original paths correspond bijectively to subdivided paths ending at any valid offset.

    theorem Cslib.LayeredDigraph.Subdivision.reachable_root_iff {V : Type u_1} {G : LayeredDigraph V} {weight : V → ℕ} {bound : ℕ} (hw : ∀ (v : V), weight v ≤ bound) (s t : V) :
    Relation.ReflTransGen (graph G weight bound).Adj (root bound s) (root bound t) ↔ Relation.ReflTransGen G.Adj s t

    Reachability between subdivision roots is exactly reachability between the original vertices, for every weight assignment within the subdivision bound.

    theorem Cslib.LayeredDigraph.Subdivision.card_vertex {V : Type u_1} {bound : ℕ} :
    Nat.card (Vertex V bound) = Nat.card V * (bound + 1)

    The rectangular subdivision has at most the number of vertices times one plus the uniform weight bound; unused positions remain isolated.

    theorem Cslib.LayeredDigraph.Subdivision.length_expand {V : Type u_1} {G : LayeredDigraph V} {weight : V → ℕ} {bound : ℕ} (hw : ∀ (v : V), weight v ≤ bound) {a b : V} (p : G.Path a b) :
    Quiver.Path.length (expand hw p) = Quiver.Path.addWeightOfEPs (fun (v x : V) => weight v + 1) p

    Expansion replaces departure weight by literal unweighted edges, with one extra edge per original edge. The formula includes the empty path.

    theorem Cslib.LayeredDigraph.Subdivision.length_pathEquiv {V : Type u_1} {G : LayeredDigraph V} {weight : V → ℕ} {bound : ℕ} (hw : ∀ (v : V), weight v ≤ bound) (s : V) (v : Vertex V bound) (hv : ↑v.offset ≤ weight v.vertex) (p : G.Path s v.vertex) :
    Quiver.Path.length ((pathEquiv hw s v hv) p) = Quiver.Path.addWeightOfEPs (fun (u x : V) => weight u + 1) p + ↑v.offset

    The path bijection preserves length as departure cost plus the final partial chain.

    theorem Cslib.LayeredDigraph.Subdivision.length_pathEquiv_le_iff {V : Type u_1} {G : LayeredDigraph V} {weight : V → ℕ} {bound : ℕ} (hw : ∀ (v : V), weight v ≤ bound) (s : V) (v : Vertex V bound) (hv : ↑v.offset ≤ weight v.vertex) (p q : G.Path s v.vertex) :

    For a fixed pair of endpoints and final offset, expansion orders paths by internal weight.

    theorem Cslib.LayeredDigraph.Subdivision.existsUnique_shortest_of_isMinIsolating {V : Type u_1} {G : LayeredDigraph V} {weight : V → ℕ} {bound : ℕ} (hw : ∀ (v : V), weight v ≤ bound) (hG : G.IsMinIsolating weight) (s : V) (v : Vertex V bound) (hv : Nonempty (Path G weight bound (root bound s) v)) :
    ∃! p : Path G weight bound (root bound s) v, ∀ (q : Path G weight bound (root bound s) v), Quiver.Path.length p ≤ Quiver.Path.length q

    Min-isolation of the original vertex weights gives a unique shortest unweighted path from each original source to every reachable subdivision vertex, including auxiliary slots. Zero weights are allowed: the original outgoing edge still contributes one positive step.