Forests and Mathlib simple graphs #
Bridge between the edge-set forests of BKAR.Forest and Mathlib's
SimpleGraph API. Associates to a finite edge set the simple graph it
generates, translates adjacency, walks, and acyclicity back and forth
(SimpleGraph.IsAcyclic), and derives the graph-theoretic facts used
elsewhere: existence and uniqueness of simple paths in an acyclic edge set,
and stability of acyclicity under adding an edge between distinct
components.
theorem
BKAR.simpleGraph_isAcyclic_sup_edge_of_not_reachable
{V : Type u_1}
{G : SimpleGraph V}
{x y : V}
(hG : G.IsAcyclic)
(hxy : ¬G.Reachable x y)
:
(G ⊔ SimpleGraph.edge x y).IsAcyclic
theorem
BKAR.EdgePath.edgeSetGraph_adj_of_mem_between
{V : Type u_1}
{S : Finset (Edge V)}
{e : Edge V}
{i j : V}
(he : e ∈ S)
(hbetween : e.Between i j)
:
(edgeSetGraph S).Adj i j
theorem
BKAR.EdgePath.exists_mem_between_of_edgeSetGraph_adj
{V : Type u_1}
{S : Finset (Edge V)}
{i j : V}
(h : (edgeSetGraph S).Adj i j)
:
∃ e ∈ S, e.Between i j
noncomputable def
BKAR.EdgePath.edgeOfAdj
{V : Type u_1}
{S : Finset (Edge V)}
{i j : V}
(h : (edgeSetGraph S).Adj i j)
:
Edge V
The local edge selected by an adjacency in edgeSetGraph S.
Equations
Instances For
theorem
BKAR.EdgePath.edgeOfAdj_mem
{V : Type u_1}
{S : Finset (Edge V)}
{i j : V}
(h : (edgeSetGraph S).Adj i j)
:
theorem
BKAR.EdgePath.edgeOfAdj_between
{V : Type u_1}
{S : Finset (Edge V)}
{i j : V}
(h : (edgeSetGraph S).Adj i j)
:
theorem
BKAR.EdgePath.edgeSetGraph_insert
{V : Type u_1}
[DecidableEq V]
(S : Finset (Edge V))
(e : Edge V)
:
theorem
BKAR.EdgePath.IsSimplePath.exists_graph_path_of_isAcyclic
{V : Type u_1}
{S : Finset (Edge V)}
{γ : List (Edge V)}
{i j : V}
(hG : (edgeSetGraph S).IsAcyclic)
(h : IsSimplePath S γ i j)
:
theorem
BKAR.EdgePath.IsSimplePath.unique_of_isAcyclic
{V : Type u_1}
{S : Finset (Edge V)}
{γ₁ γ₂ : List (Edge V)}
{i j : V}
(hG : (edgeSetGraph S).IsAcyclic)
(h₁ : IsSimplePath S γ₁ i j)
(h₂ : IsSimplePath S γ₂ i j)
:
def
BKAR.EdgePath.Walk.toEdgePath
{V : Type u_1}
{S : Finset (Edge V)}
{i j : V}
(p : (edgeSetGraph S).Walk i j)
:
Convert a Mathlib walk in edgeSetGraph S back to a local edge-list.
Equations
Instances For
theorem
BKAR.EdgePath.Walk.toEdgePath_isPath
{V : Type u_1}
{S : Finset (Edge V)}
{i j : V}
(p : (edgeSetGraph S).Walk i j)
:
IsPath S (toEdgePath p) i j
theorem
BKAR.EdgePath.Walk.toEdgePath_edges
{V : Type u_1}
{S : Finset (Edge V)}
{i j : V}
(p : (edgeSetGraph S).Walk i j)
:
theorem
BKAR.EdgePath.Walk.toEdgePath_isSimplePath_of_isTrail
{V : Type u_1}
{S : Finset (Edge V)}
{i j : V}
{p : (edgeSetGraph S).Walk i j}
(hp : p.IsTrail)
:
IsSimplePath S (toEdgePath p) i j
theorem
BKAR.EdgePath.Walk.toEdgePath_isSimplePath_of_isPath
{V : Type u_1}
{S : Finset (Edge V)}
{i j : V}
{p : (edgeSetGraph S).Walk i j}
(hp : p.IsPath)
:
IsSimplePath S (toEdgePath p) i j
theorem
BKAR.AcyclicEdgeSetData.edgeSetGraph_isAcyclic
{V : Type u_1}
[Fintype V]
[DecidableEq V]
{S : Finset (Edge V)}
(data : AcyclicEdgeSetData S)
:
theorem
BKAR.AcyclicEdgeSetData.inSameComponent_of_edgeSetGraph_reachable
{V : Type u_1}
[Fintype V]
[DecidableEq V]
{S : Finset (Edge V)}
(data : AcyclicEdgeSetData S)
{i j : V}
(h : (EdgePath.edgeSetGraph S).Reachable i j)
:
data.inSameComponent i j
theorem
BKAR.AcyclicEdgeSetData.inSameComponent_trans
{V : Type u_1}
[Fintype V]
[DecidableEq V]
{S : Finset (Edge V)}
(data : AcyclicEdgeSetData S)
{i j k : V}
(hij : data.inSameComponent i j)
(hjk : data.inSameComponent j k)
:
data.inSameComponent i k
theorem
BKAR.AcyclicEdgeSetData.inSameComponent_iff_of_between
{V : Type u_1}
[Fintype V]
[DecidableEq V]
{S : Finset (Edge V)}
(data : AcyclicEdgeSetData S)
{e : Edge V}
{i j : V}
(hbetween : e.Between i j)
:
theorem
BKAR.AcyclicEdgeSetData.isAcyclicEdgeSet_insert_of_not_inSameComponent
{V : Type u_1}
[Fintype V]
[DecidableEq V]
{S : Finset (Edge V)}
(data : AcyclicEdgeSetData S)
{e : Edge V}
(hnot : ¬data.inSameComponent e.left e.right)
:
IsAcyclicEdgeSet (insert e S)
theorem
BKAR.AcyclicEdgeSetData.acyclic_insert_iff
{V : Type u_1}
[Fintype V]
[DecidableEq V]
{S : Finset (Edge V)}
(data : AcyclicEdgeSetData S)
{e : Edge V}
(he : e ∉ S)
:
def
BKAR.AcyclicEdgeSetData.toForest
{V : Type u_1}
[Fintype V]
[DecidableEq V]
{S : Finset (Edge V)}
(data : AcyclicEdgeSetData S)
:
Forest V
Upgrade any acyclicity certificate to a Forest representative certificate.
Instances For
theorem
BKAR.AcyclicEdgeSetData.toForest_edges
{V : Type u_1}
[Fintype V]
[DecidableEq V]
{S : Finset (Edge V)}
(data : AcyclicEdgeSetData S)
:
theorem
BKAR.Forest.inSameComponent_trans
{V : Type u_1}
[Fintype V]
[DecidableEq V]
(F : Forest V)
{i j k : V}
(hij : F.inSameComponent i j)
(hjk : F.inSameComponent j k)
:
F.inSameComponent i k