Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

Alternating completion inventories

Abstract

Actual labelled alternating completions of every finite balanced two-color directed linear forest are exhaustively classified by compatible cycles on its true components and have the four endpoint-inventory counts.

Theorem 1.1 (Exhaustive two-state inventory count).

\forall C \in \mathrm{Type},\; [\operatorname{Finite}\left(C\right)], \forall s \in \operatorname{BoolMaps}\left(C\right),\; \forall d \in \operatorname{BoolMaps}\left(C\right),\; \operatorname{inventory}\left(s, d, 0, 1\right) = \operatorname{inventory}\left(s, d, 1, 0\right) \Rightarrow \operatorname{card}\left(\operatorname{Compatible}\left(s, d\right)\right) = \operatorname{ite}\left(\operatorname{card}\left(C\right) = 0, 0, \operatorname{ite}\left(0 < \operatorname{inventory}\left(s, d, 0, 1\right), \operatorname{inventory}\left(s, d, 0, 1\right) \cdot \operatorname{factorial}\left(\operatorname{card}\left(\operatorname{Side}\left(s, 0\right)\right) - 1\right) \cdot \operatorname{factorial}\left(\operatorname{card}\left(\operatorname{Side}\left(s, 1\right)\right) - 1\right), \operatorname{ite}\left(\operatorname{inventory}\left(s, d, 0, 0\right) = 0 \lor \operatorname{inventory}\left(s, d, 1, 1\right) = 0, \operatorname{factorial}\left(\operatorname{card}\left(C\right) - 1\right), 0\right)\right)\right)

Proof. Machine-checked in Lean as D5/S3/Combinatorics/Graph/LinearForests/CompatibleCycleInventory.compatible_cycle_card (✓ std3). ∎

Source. Repository-derived.

Acknowledgement. Paidi Creed; Mary Cryan (2013). The number of Euler tours of random directed graphs. DOI: 10.37236/2377.

Commentary.

C is any finite labelled type. BoolMaps(C) means C to Bool; the displayed states 0 and 1 mean false and true. Side(s,b) is the subtype of labels x with s(x)=b. inventory(s,d,a,b) is the cardinality of labels x with s(x)=a and d(x)=b. Compatible(s,d) consists of actual permutations rho of C with Nonempty(C), rho.IsCycleOn(univ), and d(x)=s(rho(x)) for every x. Thus the empty carrier has no compatible cycles, while the identity on a singleton is accepted exactly when its states agree. ite is the ordinary if-then-else; all factorial arguments use natural subtraction.

Interpret every label x as an auxiliary arc from s(x) to d(x). Labels are never merged, including parallel arcs and loops. For a label c with s(c)=d(c), assume that the retained carrier A of labels other than c is nonempty. Deleting c from an actual cycle then leaves its actual successor y in A as an insertion slot of state s(c). Conversely, swap(none,some(y)) composed with optionCongr(rho) inserts the deleted label immediately before y. Mathlib Perm.decomposeOption proves exhaustive inverse reconstruction on the whole permutation carrier. The first-return comparison through the retained labels proves single-cycle equivalence; compatibility is equivalent to s(y)=s(c) together with compatibility of the retained cycle. Under Nonempty(A), this is a product equivalence with all slots and all compatible retained cycles. The positive-crossing induction derives Nonempty(A) from its preserved positive crossing inventory. A singleton loop is handled separately by the zero-crossing branch.

When there are no loops, the balanced inventory consists of m arcs in each direction. Every compatible permutation is uniquely specified by a bijection f from the false fiber to the true fiber and a bijection g back. It is a single cycle exactly when the first-return permutation f followed by g is a single cycle on the false fiber. Consequently the exhaustive carrier is equivalent to the product of all f and all full cycles of the false fiber. Existing unrestricted cycle counting gives m! times (m-1)!. Strong induction deletes loops using the exhaustive insertion equivalence; the number of actual insertion slots is the remaining cardinality of the corresponding source fiber. The factorial recurrence yields m(r-1)!(t-1)!, with r and t the two source-fiber sizes. This inference is consumed by the original forest completion count below.

If both crossing inventories vanish, compatibility preserves s. A single orbit forces s constant. If one loop inventory is empty, every permutation cycle is compatible and the count is (card(C)-1)!. If both loop inventories are nonempty, no full cycle is compatible. The separate empty-carrier case prevents the natural-subtraction factorial convention from creating an empty cycle.

The positive-crossing count specializes the classical BEST Euler-tour formula for labelled directed multigraphs, as stated in the cited Creed-Cryan Theorem 1, pages 2-3. Its tours are identified modulo cyclic rotation; the adjoining discussion and footnote allow loops and parallel arcs. For m positive the auxiliary two-vertex graph is strongly connected, the rooted in-tree count is m and the outdegrees are m+p and m+q. The complete statement here also handles empty carriers and disconnected zero-crossing inventories; those clauses are not attributed to that positive strongly-connected source theorem. The Lean proof supplies deletion and first-return inventory equivalences and imports no general BEST theorem. This is a local synthesis with classical positive-inventory lineage and no literature priority claim.

Theorem 1.2 (The original raw forest and all four cases).

\forall V \in \mathrm{Type},\; [\operatorname{Finite}\left(V\right)], \forall n \in \mathrm{Nat},\; \forall E \in \operatorname{Relation}\left(V\right),\; \forall k \in \operatorname{BoolMaps}\left(V\right),\; \left(\operatorname{RightUnique}\left(E\right) \land \left(\operatorname{LeftUnique}\left(E\right) \land \left(\operatorname{Acyclic}\left(E\right) \land \left(\operatorname{EdgeAlternating}\left(E, k\right) \land \left(\operatorname{card}\left(\operatorname{Side}\left(k, 0\right)\right) = n \land \operatorname{card}\left(\operatorname{Side}\left(k, 1\right)\right) = n\right)\right)\right)\right)\right) \Rightarrow \left(\exists t \in \operatorname{Equiv}\left(\operatorname{Component}\left(E\right), \operatorname{Tail}\left(E\right)\right),\; \exists h \in \operatorname{Equiv}\left(\operatorname{Component}\left(E\right), \operatorname{Head}\left(E\right)\right),\; \exists Phi \in \operatorname{Equiv}\left(\operatorname{AlternatingCompletion}\left(E, k\right), \operatorname{Compatible}\left(\operatorname{headColor}\left(k, h\right), \operatorname{oppositeTailColor}\left(k, t\right)\right)\right),\; \left(\forall A \in \operatorname{Component}\left(E\right),\; \operatorname{component}\left(E, \operatorname{value}\left(\operatorname{apply}\left(t, A\right)\right)\right) = A\right) \land \left(\left(\forall A \in \operatorname{Component}\left(E\right),\; \operatorname{component}\left(E, \operatorname{value}\left(\operatorname{apply}\left(h, A\right)\right)\right) = A\right) \land \left(\left(\forall sigma \in \operatorname{AlternatingCompletion}\left(E, k\right),\; \forall A \in \operatorname{Component}\left(E\right),\; \operatorname{apply}\left(\operatorname{value}\left(sigma\right), \operatorname{value}\left(\operatorname{apply}\left(t, A\right)\right)\right) = \operatorname{value}\left(\operatorname{apply}\left(h, \operatorname{apply}\left(\operatorname{value}\left(\operatorname{apply}\left(Phi, sigma\right)\right), A\right)\right)\right)\right) \land \left(\mathrm{let} s: \operatorname{BoolMaps}\left(\operatorname{Component}\left(E\right)\right) = \operatorname{headColor}\left(k, h\right); \left(\mathrm{let} d: \operatorname{BoolMaps}\left(\operatorname{Component}\left(E\right)\right) = \operatorname{oppositeTailColor}\left(k, t\right); \left(\mathrm{let} a: \mathrm{Nat} = \operatorname{inventory}\left(s, d, 0, 1\right); \left(\mathrm{let} b: \mathrm{Nat} = \operatorname{inventory}\left(s, d, 1, 0\right); \left(\mathrm{let} p: \mathrm{Nat} = \operatorname{inventory}\left(s, d, 0, 0\right); \left(\mathrm{let} q: \mathrm{Nat} = \operatorname{inventory}\left(s, d, 1, 1\right); a = b \land \left(\operatorname{card}\left(\operatorname{Component}\left(E\right)\right) = a + b + p + q \land \left(\left(\operatorname{Nonzero}\left(n\right) \Rightarrow 0 < \operatorname{card}\left(\operatorname{Component}\left(E\right)\right)\right) \land \operatorname{card}\left(\operatorname{AlternatingCompletion}\left(E, k\right)\right) = \operatorname{ite}\left(n = 0, 0, \operatorname{ite}\left(0 < a, a \cdot \operatorname{factorial}\left(a + p - 1\right) \cdot \operatorname{factorial}\left(a + q - 1\right), \operatorname{ite}\left(p \cdot q = 0, \operatorname{factorial}\left(p + q - 1\right), 0\right)\right)\right)\right)\right)\right)\right)\right)\right)\right)\right)\right)\right)\right)

Proof. Machine-checked in Lean as D5/S3/Combinatorics/Graph/LinearForests/CompatibleCycleInventory.alternating_completion_classification (✓ std3). ∎

Source. Repository-derived.

Acknowledgement. Paidi Creed; Mary Cryan (2013). The number of Euler tours of random directed graphs. DOI: 10.37236/2377.

Acknowledgement. Boaz Tsaban (2003). Permutation graphs, fast forward permutations, and sampling the cycle structure of a permutation. DOI: 10.1016/S0196-6774(03)00017-8.

Commentary.

V is any finite labelled type, n is any natural number, E is a binary relation and k:V to Bool colors exactly n vertices false and n vertices true. RightUnique and LeftUnique express at most one outgoing and incoming E-edge respectively. Acyclic means that Relation.TransGen(E) is irreflexive. EdgeAlternating means k(x) differs from k(y) for every E(x,y). No extension, path decomposition, connectivity or positive-count premise is assumed.

Component(E) is the quotient of all V by Relation.EqvGen(E), including isolated vertices. Head(E) and Tail(E) are the actual vertices with no incoming and no outgoing E-edge. The supplied equivalences h and t identify every component with its unique actual head and tail; both membership equations remain part of the statement. component(E,x) denotes the quotient class, and value denotes the underlying value of a subtype. AlternatingCompletion(E,k) consists of actual permutations sigma with Nonempty(V), sigma.IsCycleOn(univ), sigma(x)=y for every E(x,y), and k(sigma(x)) different from k(x) for every x.

headColor(k,h)(A)=k(h(A)) and oppositeTailColor(k,t)(A)=not(k(t(A))). Therefore d(A)=s(tau(A)) is exactly k(t(A)) different from k(h(tau(A))). Phi is an equivalence onto all compatible actual nonempty single-cycle permutations of Component(E), and the displayed connector equation is sigma(t(A))=h(Phi(sigma)(A)) for every sigma and A. It is obtained by restricting the original DirectedForestCompletion.full_cycle_completion_equiv: internal edges use the supplied edge-color condition; at actual tails the original connector equation gives both directions. Nonemptiness is transported through the actual quotient map, explicitly excluding the empty full-cycle convention of that supplier.

The inventories a,b,p,q are respectively the actual component endpoint types (false,false), (true,true), (false,true), and (true,false). They retain original labels. The existing edgeEquiv pairs vertices with an outgoing edge with vertices with an incoming edge. Restricting it by the given edge colors pairs occupied false outgoing vertices with occupied true incoming vertices. Splitting the two equally sized raw color fibers gives card(Tail false)=card(Head true). Transport through t and h then gives a=b. No path decomposition or component color-sum premise is supplied.

Write m=a=b. The statement gives card(Component(E))=a+b+p+q, and this cardinality is positive whenever n is nonzero. The four cases are: n=0 gives zero completions; n positive and m positive gives m(m+p-1)!(m+q-1)!; n positive and m=0 with pq=0 gives (p+q-1)!; n positive and m=0 with both p and q positive gives zero. In the third and fourth cases p+q is positive by the component cardinality equation. In particular p+q=1 is permitted: the unique component cycle is its identity and the actual path closes by its tail-to-head edge.

Ordinary forest contraction is reused from the original declarations. Its classical provenance is the cited Tsaban Section 1, Lemmas 1.1-1.3, Definition 1.4 and Lemma 1.5, pages 107-109. The positive-inventory count has the BEST lineage described above. The complete raw-forest statement combines these ingredients with the derived endpoint balance and the separate empty and zero-crossing cases; neither cited source is asserted to state this complete theorem verbatim. This is a local synthesis with no literature priority claim. Existing source attributions, permission and licenses in DirectedForestCompletion and its linked Library notes remain applicable. This result counts directed cycles modulo rotation only. It makes no undirected reversal, adaptive-history, posterior, oracle, query-bound, configuration multiplicity or welded-tree EXIT assertion.

References