Directed forest completion
Abstract
A finite directed linear forest on its full original carrier has an endpoint-compatible equivalence between actual full-cycle permutation completions and actual full cycles of its weak components, with the exact conditional uniform law and a completion count factorial in the number of components, and the exact raw endpoint marginals.
Theorem 1.1 (Actual components and exhaustive cycle contraction).
\forall V \in \mathrm{Type},\; [\operatorname{Finite}\left(V\right)], \forall E \in \operatorname{Relation}\left(V\right),\; \left(\operatorname{RightUnique}\left(E\right) \land \left(\operatorname{LeftUnique}\left(E\right) \land \left(\operatorname{Acyclic}\left(E\right) \land 2 \le \operatorname{card}\left(\operatorname{Component}\left(E\right)\right)\right)\right)\right) \Rightarrow \left(\exists q \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{CycleCompletion}\left(E\right), \operatorname{FullCycle}\left(\operatorname{Component}\left(E\right)\right)\right),\; \left(\forall A \in \operatorname{Component}\left(E\right),\; \operatorname{component}\left(E, \operatorname{value}\left(\operatorname{apply}\left(q, 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{CycleCompletion}\left(E\right),\; \forall A \in \operatorname{Component}\left(E\right),\; \operatorname{apply}\left(\operatorname{value}\left(sigma\right), \operatorname{value}\left(\operatorname{apply}\left(q, 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(\operatorname{Nonempty}\left(\operatorname{CycleCompletion}\left(E\right)\right) \land \left(\operatorname{card}\left(\operatorname{CycleCompletion}\left(E\right)\right) = \operatorname{factorial}\left(\operatorname{sub}\left(\operatorname{card}\left(\operatorname{Component}\left(E\right)\right), 1\right)\right) \land \operatorname{UniformCompletionLaw}\left(E, q, h, Phi\right)\right)\right)\right)\right)\right)
Proof. Machine-checked in Lean as D5/S3/Combinatorics/Graph/LinearForests/DirectedForestCompletion.directed_forest_completion (✓ std3). ∎
Citation. 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.
Let V be any finite labelled type and E a binary relation on V. RightUnique means that E(x,y) and E(x,z) imply y=z. LeftUnique means that E(y,x) and E(z,x) imply y=z. Acyclic means that there is no nonempty directed E-path from a vertex to itself, expressed as the irreflexivity of Relation.TransGen E. Component(E) is the quotient of all of V by Relation.EqvGen E, the equivalence relation generated by E. Thus these are the true weak components, and every isolated vertex is a singleton component. Assume c=card(Component(E)) is at least two.
Head(E) is the subtype of vertices with no incoming E-edge; Tail(E) is the subtype with no outgoing E-edge. The result supplies equivalences h:Component(E) to Head(E) and q:Component(E) to Tail(E) whose values belong to the specified component. Consequently each actual component has a unique head and a unique tail. For a singleton component both underlying vertices coincide. In the formula, component(E,x) denotes the class of x and value denotes the underlying value of a subtype.
FullCycle(W) consists of actual permutations rho of W satisfying rho.IsCycleOn univ. CycleCompletion(E) consists of actual permutations sigma of V satisfying both sigma.IsCycleOn univ and sigma(x)=y for every E(x,y). These sets are defined independently of any constructor. The equivalence Phi maps exactly CycleCompletion(E) onto FullCycle(Component(E)), and for every sigma and component A its endpoint equation is sigma(q(A))=h(Phi(sigma)(A)). The completion set is nonempty and has cardinality (c-1)!. Full-cycle completions on two vertices and c=2 are included; no SimpleGraph cycle convention is used.
First split vertices according to whether an outgoing or incoming E-edge exists. The original relation gives an equivalence between those two occupied subtypes. Mathlib’s subtypeCongr combines it with any tail-to-head equivalence. Conversely, injectivity of every actual extension forces tails into heads, and its inverse shows that every head is reached. The two constructions are inverse on the entire original carrier.
Termination and uniqueness of successors identify a terminal vertex in each actual weak component; applying the same construction to the reversed relation identifies its head. A directed E-path from a head to its component’s tail gives a positive first-return segment to the actual head set under every extension. Its intermediate vertices have an incoming E-edge and cannot be heads. The next vertex is exactly the connector head. FiniteEndpointPairing.same_cycle_of_first_visit supplies the orbit equivalence. Every original interior vertex lies in the same extension orbit as its component head, so the marked orbit comparison is equivalent to the full-carrier orbit comparison.
The count uses Mathlib’s card_of_cycleType_singleton after the full-support cycle correspondence. The small normalization helper is adapted from leanprover/cslib, and the full-support correspondence is adapted from Xingchen Liu and Xiangyu Ye; the source attributions and licenses are preserved in the Lean source and Library/PermutationPatterns/liuye2026cyclesupport.md.
The cited classical source treats acyclic partial permutation graphs, isolated components, their extrema, all full-cycle extensions and the uniform choice among other components in Section 1, Lemmas 1.1–1.3, Definition 1.4 and Lemma 1.5 on pages 107–109. This is mathematical lineage, not a Lean dependency or a literature priority claim.
UniformCompletionLaw(E,q,h,Phi) asserts that there exist probability mass functions mu0 on FullCycle(V) and muE on CycleCompletion(E). Every mu0 point mass is the reciprocal of card(FullCycle(V)), and every muE point mass is the reciprocal of card(CycleCompletion(E)). The extension event inside FullCycle(V) has a point in the support of mu0, and filtering and renormalizing mu0 by that event equals the pushforward of muE along the inclusion sigma maps to its actual full-cycle permutation. Every point mass of muE.map(Phi) is the reciprocal of card(FullCycle(Component(E))). For the same muE witness, its pushforward by sigma maps to sigma(q(A)), evaluated at the actual vertex h(B), is zero when A=B and the reciprocal of c-1 otherwise. Thus the event is nonnull, conditioning gives the uniform completion law, and Phi pushes it to the uniform law on actual component cycles. The raw event bridge uses the endpoint equation and injectivity of h: sigma(q(A))=h(B) if and only if Phi(sigma)(A)=B. Conjugation by a transposition fixing A makes all other component images equiprobable; a full cycle fixes no component and PMF normalization makes each remaining mass 1/(c-1). The proof reuses the repository finite uniform PMF, Mathlib PMF.map and PMF.filter, and finite sum identities.
This result establishes the structural equivalence, nonemptiness, exact cardinality, conditioning, uniform pushforward and the individual raw endpoint probabilities zero and 1/(c-1), including c=2. It gives no undirected orientation multiplicity, alternating-cycle law, adaptive transcript or random-label conditioning, query bound, or EXIT probability. Those statements require their own distribution and correspondence proofs.