Expanding a weighted graph into a 0-1 graph: ladders #
A matrix of natural numbers is the adjacency matrix of a digraph with
parallel edges, and its permanent counts its cycle covers, an edge of weight
k counting k times. The ladder expansion
(DescriptiveComplexity.ladder) replaces every edge a → b by a ladder: a
sequence of levels ℓ : Λ, a finite linear order with a least and a
greatest level, with wd a b ℓ rungs at level ℓ; a reaches every rung
of the least level, every rung reaches every rung of the next level, every
rung of the greatest level reaches b, and every rung loops on itself. The
result is a 0-1 matrix, and its permanent is the permanent of the matrix of
the products ∏ ℓ, wd a b ℓ (DescriptiveComplexity.bperm_ladder): a cycle
cover of the ladder graph is a cycle cover of the weighted graph together
with a choice of one rung at each level of each edge it uses, the other
rungs looping.
Series and parallel composition at once, which is what a reduction needs: an
edge of weight 2 ^ n costs n levels of two rungs, an edge of weight 3 a
single level of three rungs.
The rungs of the ladders: the copy j of the level ℓ of the ladder
from a to b, for j < wd a b ℓ.
Equations
Instances For
Dependency graph
Equations
- DescriptiveComplexity.Rung.instFintype = Subtype.fintype fun (q : V × V × Λ × Fin K) => ↑q.2.2.2 < wd q.1 q.2.1 q.2.2.1
Dependency graph
Dependency graph
Dependency graph
The source of the ladder a rung belongs to.
Instances For
Dependency graph
The target of the ladder a rung belongs to.
Instances For
Dependency graph
The level of a rung.
Instances For
Dependency graph
The index of a rung at its level.
Instances For
Dependency graph
Dependency graph
The edges of the ladder graph.
- enter
{V Λ : Type}
[LinearOrder Λ]
[BoundedOrder Λ]
{K : ℕ}
{wd : V → V → Λ → ℕ}
(q : Rung K wd)
(h : q.lvl = ⊥)
: LadderEdge K wd (Sum.inl q.src) (Sum.inr q)
The source reaches every rung of the least level.
- loop
{V Λ : Type}
[LinearOrder Λ]
[BoundedOrder Λ]
{K : ℕ}
{wd : V → V → Λ → ℕ}
(q : Rung K wd)
: LadderEdge K wd (Sum.inr q) (Sum.inr q)
Every rung loops.
- step
{V Λ : Type}
[LinearOrder Λ]
[BoundedOrder Λ]
{K : ℕ}
{wd : V → V → Λ → ℕ}
(q q' : Rung K wd)
(ha : q.src = q'.src)
(hb : q.tgt = q'.tgt)
(hℓ : q.lvl ⋖ q'.lvl)
: LadderEdge K wd (Sum.inr q) (Sum.inr q')
Every rung reaches every rung of the next level.
- leave
{V Λ : Type}
[LinearOrder Λ]
[BoundedOrder Λ]
{K : ℕ}
{wd : V → V → Λ → ℕ}
(q : Rung K wd)
(h : q.lvl = ⊤)
: LadderEdge K wd (Sum.inr q) (Sum.inl q.tgt)
Every rung of the greatest level reaches the target.
Instances For
Dependency graph
The ladder expansion of a weighted matrix: the 0-1 adjacency matrix of the ladder graph.
Equations
- DescriptiveComplexity.ladder K wd n n' = if DescriptiveComplexity.LadderEdge K wd n n' then 1 else 0
Instances For
Dependency graph
Levels #
Choices #
A choice: a cycle cover of the weighted graph with one rung chosen at each level of each edge it uses.
Equations
- DescriptiveComplexity.Choice wd = ((σ : V ≃ V) × ((a : V) → (ℓ : Λ) → Fin (wd a (σ a) ℓ)))
Instances For
Dependency graph
Every cover comes from a choice #
A rung is active in a cover when it does not loop.
Equations
- DescriptiveComplexity.Act e q = (e (Sum.inr q) ≠ Sum.inr q)
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
The target of the edge leaving a: where the cover sends a.
Equations
- DescriptiveComplexity.tgt e a = Sum.elim (fun (x : V) => a) DescriptiveComplexity.Rung.tgt (e (Sum.inl a))
Instances For
Dependency graph
Dependency graph
The permanent of the ladder expansion is the permanent of the matrix of the products of the widths.