AFTD Auto-Formalizing Theoretical Domains

op874_some_root_both_branches_return

theoremverified

In every nonempty finite strongly connected loopless two-in/two-out directed multigraph, some root has a successor whose two branches can return to the root without that successor. No no-even assumption is needed.

Statement

theorem op874_some_root_both_branches_return {X : Type*} [Fintype X] [DecidableEq X] [Nonempty X] (p q : Equiv.Perm X) (hfixed : ∀ x, p x ≠ x ∧ q x ≠ x) (hstrong : ∀ u v, ∃ w : List Bool, w.foldl (fun x bit => if bit then p x else q x) u = v) : ∃ r x : X, (p r = x ∨ q r = x) ∧ Relation.ReflTransGen (fun u v => u ≠ x ∧ v ≠ x ∧ (p u = v ∨ q u = v)) (p x) r ∧ Relation.ReflTransGen (fun u v => u ≠ x ∧ v ≠ x ∧ (p u = v ∨ q u = v)) (q x) r
Source
Non-articulation successor selection and balanced-cut return lemma.
Verified
22 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 2

The proof, explained

The argument combines two structural results about 2-in/2-out directed multigraphs. First, op874_exists_nonarticulation_successor provides a root r and a successor x whose removal leaves the underlying undirected graph connected. Second, op874_nonarticulation_successor_returns_both_branches guarantees that whenever X \ {x} is weakly connected, both directed branches leaving x can return to r without visiting x.

  1. There exist vertices r and x such that x is an out-neighbor of r and deleting x leaves the underlying undirected graph connected.

    Applying op874_exists_nonarticulation_successor to the graph yields a vertex r and a successor x (so p(r) = x or q(r) = x) such that between any two distinct vertices other than x, there is an undirected path avoiding x.

    line 2

    uses op874_exists_nonarticulation_successor

      obtain ⟨r, x, harc, hweak⟩ := op874_exists_nonarticulation_successor p q hfixed hstrong
  2. Directed paths avoiding x exist from both p(x) and q(x) back to r, satisfying the theorem.

    By op874_nonarticulation_successor_returns_both_branches, the undirected connectivity of the graph on X \ {x} ensures that both outgoing branches p(x) and q(x) from x can return to r via directed paths that avoid x. Supplying r, x, the edge witness, and these two return paths completes the proof.

    line 3

    uses op874_nonarticulation_successor_returns_both_branches

      exact ⟨r, x, harc, op874_nonarticulation_successor_returns_both_branches p q hfixed r x harc hweak⟩
op874_exists_nonarticulation_successor
In every nonempty finite strongly connected loopless 2-in/2-out directed multigraph, there exist a root r and a successor x of r such that removing x leaves the remaining vertices connected in the underlying undirected graph.
op874_nonarticulation_successor_returns_both_branches
In a loopless 2-in/2-out directed multigraph, if x is a successor of r and removing x leaves the remaining vertices connected in the undirected sense, then there are directed paths avoiding x from both successors of x (p(x) and q(x)) back to r.

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

theorem op874_some_root_both_branches_return {X : Type*} [Fintype X] [DecidableEq X] [Nonempty X] (p q : Equiv.Perm X) (hfixed : ∀ x, p x ≠ x ∧ q x ≠ x) (hstrong : ∀ u v, ∃ w : List Bool, w.foldl (fun x bit => if bit then p x else q x) u = v) : ∃ r x : X, (p r = x ∨ q r = x) ∧ Relation.ReflTransGen (fun u v => u ≠ x ∧ v ≠ x ∧ (p u = v ∨ q u = v)) (p x) r ∧ Relation.ReflTransGen (fun u v => u ≠ x ∧ v ≠ x ∧ (p u = v ∨ q u = v)) (q x) r := by  obtain ⟨r, x, harc, hweak⟩ := op874_exists_nonarticulation_successor p q hfixed hstrong  exact ⟨r, x, harc, op874_nonarticulation_successor_returns_both_branches p q hfixed r x harc hweak⟩
See it in the graphDiscuss this resultChallenge it