The split graph
DefinitionRhoMin_SplitLet be a permutation of and . The split graph is defined as follows.
- Vertices. A P-copy for every , a V-copy for every , and the vertex itself, with the convention .
- P-line edges. for every P-edge of with .
- V-line edges. for every V-edge of .
- Rungs. for every .
A perfect matching of encodes a properly coloured path from to that leaves by a V-edge; the split graph is the auxiliary object in the proof of the Reach Lemma.
Formalization Note A vertex is a pair of a position and a Boolean, false for the P-copy and true for the V-copy, subject to: is true, or and . The single vertex of the paper is the pair . The graph is a SimpleGraph on this subtype; the file also contains the symmetry and irreflexivity facts about P- and V-adjacency that its definition needs.
import Definitions.Def_RhoMin_Defs
import Mathlib.Combinatorics.SimpleGraph.Matching
import Mathlib.Data.Fintype.Perm
import Mathlib.Data.Fintype.Card
import Mathlib.Data.List.Nodup
import Mathlib.Data.Nat.Find
import Mathlib.Data.List.FinRange
import Mathlib.Data.Finset.Lattice.Fold
namespace RhoMin
variable {n : ℕ}
/-- `(v, b)` is a vertex of G^t: every V-copy; P-copies of `v ∉ {0, t}`. -/
def Ok (t : Fin n) (p : Fin n × Bool) : Prop := p.2 = true ∨ (p.1.val ≠ 0 ∧ p.1 ≠ t)
instance (t : Fin n) : DecidablePred (Ok t) := fun p => by unfold Ok; infer_instance
/-- The vertex type of G^t. -/
abbrev SV (t : Fin n) := {p : Fin n × Bool // Ok t p}
/-- Adjacency of G^t on copies: rung, V-line edge, P-line edge. -/
def GAdj (σ : Equiv.Perm (Fin n)) (t : Fin n) (x y : Fin n × Bool) : Prop :=
(x.1 = y.1 ∧ x.2 ≠ y.2) ∨
(x.2 = true ∧ y.2 = true ∧ VAdj σ x.1 y.1) ∨
(PAdj x.1 y.1 ∧ (x.2 = false ∨ x.1 = t) ∧ (y.2 = false ∨ y.1 = t))
theorem PAdj.symm {u v : Fin n} (h : PAdj u v) : PAdj v u := by unfold PAdj at *; omega
theorem VAdj.symm {σ : Equiv.Perm (Fin n)} {u v : Fin n} (h : VAdj σ u v) : VAdj σ v u := by
unfold VAdj at *; omega
theorem PAdj.ne {u v : Fin n} (h : PAdj u v) : u ≠ v := by
rintro rfl; unfold PAdj at h; omega
theorem VAdj.ne {σ : Equiv.Perm (Fin n)} {u v : Fin n} (h : VAdj σ u v) : u ≠ v := by
rintro rfl; unfold VAdj at h; omega
/-- The split graph G^t. -/
def Gt (σ : Equiv.Perm (Fin n)) (t : Fin n) : SimpleGraph (SV t) where
Adj x y := GAdj σ t x.1 y.1
symm := ⟨fun x y h => by
rcases h with ⟨h1, h2⟩ | ⟨h1, h2, h3⟩ | ⟨h1, h2, h3⟩
· exact Or.inl ⟨h1.symm, Ne.symm h2⟩
· exact Or.inr (Or.inl ⟨h2, h1, h3.symm⟩)
· exact Or.inr (Or.inr ⟨h1.symm, h3, h2⟩)⟩
loopless := ⟨fun x h => by
rcases h with ⟨_, h2⟩ | ⟨_, _, h3⟩ | ⟨h1, _, _⟩
· exact h2 rfl
· exact h3.ne rfl
· exact h1.ne rfl⟩
end RhoMin
Read-back
What the Lean code literally says, in plain math · claude-fable-5-2
Throughout, is a natural number (an implicit parameter of every declaration), is the type of natural numbers strictly less than , and a "permutation of " is a bijection . Two relations from the imported definitions are used:
- for , holds if and only if or as natural numbers;
- for a permutation of and , holds if and only if or as natural numbers.
Whenever an element is given, necessarily. Pairs below consist of an element and a Boolean .
Definition Ok (predicate ). For and a pair , the proposition holds if and only if
where "" is a comparison of the underlying natural number of with . Thus every pair satisfies it, and a pair satisfies it exactly when . When the two excluded values coincide.
Unnamed instance (decidability). For every , the predicate is algorithmically decidable. No further mathematical content.
Abbreviation SV (the type ). For , is the subtype
that is, all pairs with together with all pairs with , , . In particular and are not in .
Definition GAdj (relation ). For a permutation of , an element , and two pairs and in (arbitrary pairs, not required to satisfy ), the proposition holds if and only if at least one of the following three conditions holds:
- and ;
- and and ;
- , and ( or ), and ( or ).
The three conditions are joined by a non-exclusive "or". In condition 3, an endpoint whose first component is is admitted with either Boolean value, so in particular the pair is related by condition 3 to whenever ; an endpoint whose first component is not must have Boolean value . The relation is also defined on the pairs and , which do not belong to .
Theorem PAdj.symm. For all : if then . The file contains a proof.
Theorem VAdj.symm. For every permutation of and all : if then . The file contains a proof.
Theorem PAdj.ne. For all : if then . The file contains a proof.
Theorem VAdj.ne. For every permutation of and all : if then . The file contains a proof.
Definition Gt (the graph ). For a permutation of and an element , is the simple graph (undirected, no loops, no multiple edges) whose vertex set is and in which two vertices are adjacent if and only if holds for the underlying pairs. The definition includes proofs that this adjacency is symmetric and irreflexive.
Spelled out on , two vertices and are adjacent if and only if at least one of the following holds:
- and (since both pairs must lie in , this occurs only for , joining and );
- both Booleans are and , differ by exactly ;
- and differ by exactly , and each of the two vertices either has Boolean or has first component (within , a vertex with first component is necessarily , and a vertex with Boolean has first component outside ).
The permutation enters only through condition 2.