The areas / V30. Combinatorics
Mathlib.Combinatorics.SimpleGraph.Connectivity.Subgraph
109 declarations. Mathlib docs · Source
Connectivity of subgraphs and induced graphs
Main definitions
SimpleGraph.Subgraph.PreconnectedandSimpleGraph.Subgraph.Connectedgive subgraphs connectivity predicates viaSimpleGraph.Subgraph.coe.
Walks as subgraphs
theorem SimpleGraph.Walk.toSubgraph.match_1.congr_eq_2 E1 #
∀ {V : Type u_1} {G : SimpleGraph V} {u : V} (motive : (v : V) → G.Walk u v → Sort u_2) (v : V) (x : G.Walk u v)
(h_1 : Unit → motive u SimpleGraph.Walk.nil)
(h_2 : (v v_1 : V) → (h : G.Adj u v_1) → (p : G.Walk v_1 v) → motive v (SimpleGraph.Walk.cons h p)) (v_1 v_2 : V)
(h : G.Adj u v_2) (p : G.Walk v_2 v_1),
v = v_1 →
x ≍ SimpleGraph.Walk.cons h p →
(match v, x with
| .(u), SimpleGraph.Walk.nil => h_1 ()
| v, SimpleGraph.Walk.cons h p => h_2 v v_3 h p) ≍
h_2 v_1 v_2 h p
theorem SimpleGraph.Walk.map.match_1.congr_eq_2 E1 #
∀ {V : Type u_1} {G : SimpleGraph V} {u : V} (motive : (v : V) → G.Walk u v → Sort u_2) (v : V) (x : G.Walk u v)
(h_1 : Unit → motive u SimpleGraph.Walk.nil)
(h_2 : (v v_1 : V) → (h : G.Adj u v_1) → (p : G.Walk v_1 v) → motive v (SimpleGraph.Walk.cons h p)) (v_1 v_2 : V)
(h : G.Adj u v_2) (p : G.Walk v_2 v_1),
v = v_1 →
x ≍ SimpleGraph.Walk.cons h p →
(match v, x with
| .(u), SimpleGraph.Walk.nil => h_1 ()
| v, SimpleGraph.Walk.cons h p => h_2 v v_3 h p) ≍
h_2 v_1 v_2 h p
theorem SimpleGraph.Walk.map.match_1.congr_eq_1 E1 #
∀ {V : Type u_1} {G : SimpleGraph V} {u : V} (motive : (v : V) → G.Walk u v → Sort u_2) (v : V) (x : G.Walk u v)
(h_1 : Unit → motive u SimpleGraph.Walk.nil)
(h_2 : (v v_1 : V) → (h : G.Adj u v_1) → (p : G.Walk v_1 v) → motive v (SimpleGraph.Walk.cons h p)),
v = u →
x ≍ SimpleGraph.Walk.nil →
(match v, x with
| .(u), SimpleGraph.Walk.nil => h_1 ()
| v, SimpleGraph.Walk.cons h p => h_2 v v_1 h p) ≍
h_1 ()
theorem SimpleGraph.Walk.toSubgraph.match_1.congr_eq_1 E1 #
∀ {V : Type u_1} {G : SimpleGraph V} {u : V} (motive : (v : V) → G.Walk u v → Sort u_2) (v : V) (x : G.Walk u v)
(h_1 : Unit → motive u SimpleGraph.Walk.nil)
(h_2 : (v v_1 : V) → (h : G.Adj u v_1) → (p : G.Walk v_1 v) → motive v (SimpleGraph.Walk.cons h p)),
v = u →
x ≍ SimpleGraph.Walk.nil →
(match v, x with
| .(u), SimpleGraph.Walk.nil => h_1 ()
| v, SimpleGraph.Walk.cons h p => h_2 v v_1 h p) ≍
h_1 ()
structure SimpleGraph.Subgraph.Preconnected E3 #
{V : Type u} → {G : SimpleGraph V} → G.Subgraph → Prop
A subgraph is preconnected if it is preconnected when coerced to be a simple graph.
Note: This is a structure to make it so one can be precise about how dot notation resolves.
ctor SimpleGraph.Subgraph.Preconnected.mk E0 #
∀ {V : Type u} {G : SimpleGraph V} {H : G.Subgraph}, H.coe.Preconnected → H.Preconnected
theorem SimpleGraph.Subgraph.Preconnected.coe E1 #
∀ {V : Type u} {G : SimpleGraph V} {H : G.Subgraph}, H.Preconnected → H.coe.Preconnected
instance SimpleGraph.Subgraph.instCoePreconnectedPreconnectedElemVertsCoe E0 #
{V : Type u} → {G : SimpleGraph V} → {H : G.Subgraph} → Coe H.Preconnected H.coe.Preconnected
instance SimpleGraph.Subgraph.instCoeFunPreconnectedForallForallReachableElemVertsCoe E0 #
{V : Type u} →
{G : SimpleGraph V} → {H : G.Subgraph} → CoeFun H.Preconnected fun x ↦ ∀ (u v : ↑H.verts), H.coe.Reachable u v
theorem SimpleGraph.Subgraph.preconnected_iff E0 #
∀ {V : Type u} {G : SimpleGraph V} {H : G.Subgraph}, H.Preconnected ↔ H.coe.Preconnected
structure SimpleGraph.Subgraph.Connected E3 #
{V : Type u} → {G : SimpleGraph V} → G.Subgraph → Prop
A subgraph is connected if it is connected when coerced to be a simple graph.
Note: This is a structure to make it so one can be precise about how dot notation resolves.
ctor SimpleGraph.Subgraph.Connected.mk E0 #
∀ {V : Type u} {G : SimpleGraph V} {H : G.Subgraph}, H.coe.Connected → H.Connected
theorem SimpleGraph.Subgraph.Connected.coe E1 #
∀ {V : Type u} {G : SimpleGraph V} {H : G.Subgraph}, H.Connected → H.coe.Connected
instance SimpleGraph.Subgraph.instCoeConnectedConnectedElemVertsCoe E0 #
{V : Type u} → {G : SimpleGraph V} → {H : G.Subgraph} → Coe H.Connected H.coe.Connected
instance SimpleGraph.Subgraph.instCoeFunConnectedForallForallReachableElemVertsCoe E0 #
{V : Type u} →
{G : SimpleGraph V} → {H : G.Subgraph} → CoeFun H.Connected fun x ↦ ∀ (u v : ↑H.verts), H.coe.Reachable u v
theorem SimpleGraph.Subgraph.connected_iff' E1 #
∀ {V : Type u} {G : SimpleGraph V} {H : G.Subgraph}, H.Connected ↔ H.coe.Connected
theorem SimpleGraph.Subgraph.connected_iff E0 #
∀ {V : Type u} {G : SimpleGraph V} {H : G.Subgraph}, H.Connected ↔ H.Preconnected ∧ H.verts.Nonempty
theorem SimpleGraph.Subgraph.Connected.preconnected E1 #
∀ {V : Type u} {G : SimpleGraph V} {H : G.Subgraph}, H.Connected → H.Preconnected
theorem SimpleGraph.Subgraph.Connected.nonempty E1 #
∀ {V : Type u} {G : SimpleGraph V} {H : G.Subgraph}, H.Connected → H.verts.Nonempty
theorem SimpleGraph.Subgraph.singletonSubgraph_connected E1 #
∀ {V : Type u} {G : SimpleGraph V} {v : V}, (G.singletonSubgraph v).Connected
theorem SimpleGraph.Subgraph.subgraphOfAdj_connected E0 #
∀ {V : Type u} {G : SimpleGraph V} {v w : V} (hvw : G.Adj v w), (G.subgraphOfAdj hvw).Connected
theorem SimpleGraph.Subgraph.top_induce_pair_connected_of_adj E1 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V}, G.Adj u v → (⊤.induce {u, v}).Connected
theorem SimpleGraph.Subgraph.Connected.mono E1 #
∀ {V : Type u} {G : SimpleGraph V} {H H' : G.Subgraph}, H ≤ H' → H.verts = H'.verts → H.Connected → H'.Connected
theorem SimpleGraph.Subgraph.Connected.mono' E1 #
∀ {V : Type u} {G : SimpleGraph V} {H H' : G.Subgraph},
(∀ (v w : V), H.Adj v w → H'.Adj v w) → H.verts = H'.verts → H.Connected → H'.Connected
theorem SimpleGraph.Subgraph.connected_sup E1 #
∀ {V : Type u} {G : SimpleGraph V} {H K : G.Subgraph},
H.Preconnected → K.Preconnected → (H ⊓ K).verts.Nonempty → (H ⊔ K).Connected
theorem SimpleGraph.Subgraph.Preconnected.degree_zero_iff E0 #
∀ {V : Type u} {G : SimpleGraph V} {H : G.Subgraph},
H.Preconnected → ∀ (v : ↑H.verts) [inst : Fintype ↑(H.neighborSet ↑v)], H.degree ↑v = 0 ↔ H.verts.Subsingleton
theorem SimpleGraph.Subgraph.Preconnected.exists_adj_of_nontrivial E1 #
∀ {V : Type u} {G : SimpleGraph V} {H : G.Subgraph} [Nontrivial ↑H.verts],
H.Preconnected → ∀ (v : ↑H.verts), ∃ u, H.Adj (↑v) u
theorem SimpleGraph.Subgraph.Connected.exists_verts_eq_connectedComponentSupp E2 #
∀ {V : Type u} {G : SimpleGraph V} {H : G.Subgraph},
H.Connected → (∀ v ∈ H.verts, ∀ (w : V), G.Adj v w → H.Adj v w) → ∃ c, H.verts = c.supp
This lemma establishes a condition under which a subgraph is the same as a connected component.
Note the asymmetry in the hypothesis h: v is in H.verts, but w is not required to be.
abbrev SimpleGraph.ConnectedComponent.toSubgraph E1 #
{V : Type u} → {G : SimpleGraph V} → G.ConnectedComponent → G.Subgraph
The induced subgraph of a connected component.
theorem SimpleGraph.ConnectedComponent.coe_toSubgraph E0 #
∀ {V : Type u} {G : SimpleGraph V} (C : G.ConnectedComponent), C.toSubgraph.coe = C.toSimpleGraph
theorem SimpleGraph.ConnectedComponent.spanningCoe_toSubgraph E0 #
∀ {V : Type u} {G : SimpleGraph V} (C : G.ConnectedComponent), C.toSubgraph.spanningCoe = C.toSimpleGraph.spanningCoe
theorem SimpleGraph.ConnectedComponent.connected_toSubgraph E1 #
∀ {V : Type u} {G : SimpleGraph V} (C : G.ConnectedComponent), C.toSubgraph.Connected
theorem SimpleGraph.ConnectedComponent.maximal_connected_toSubgraph E1 #
∀ {V : Type u} {G : SimpleGraph V} (C : G.ConnectedComponent), Maximal SimpleGraph.Subgraph.Connected C.toSubgraph
theorem SimpleGraph.ConnectedComponent.maximal_subgraph_connected_iff E0 #
∀ {V : Type u} {G : SimpleGraph V} (G' : G.Subgraph), Maximal SimpleGraph.Subgraph.Connected G' ↔ ∃ C, C.toSubgraph = G'
def SimpleGraph.Walk.toSubgraph E1 #
{V : Type u} → {G : SimpleGraph V} → {u v : V} → G.Walk u v → G.Subgraph
The subgraph consisting of the vertices and edges of the walk.
theorem SimpleGraph.Walk.toSubgraph_cons_nil_eq_subgraphOfAdj E1 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} (h : G.Adj u v),
(SimpleGraph.Walk.cons h SimpleGraph.Walk.nil).toSubgraph = G.subgraphOfAdj h
theorem SimpleGraph.Walk.mem_verts_toSubgraph E0 #
∀ {V : Type u} {G : SimpleGraph V} {u v w : V} (p : G.Walk u v), w ∈ p.toSubgraph.verts ↔ w ∈ p.support
theorem SimpleGraph.Walk.not_nil_of_adj_toSubgraph E1 #
∀ {V : Type u} {G : SimpleGraph V} {w u v x : V} {p : G.Walk u v}, p.toSubgraph.Adj w x → ¬p.Nil
theorem SimpleGraph.Walk.start_mem_verts_toSubgraph E1 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v), u ∈ p.toSubgraph.verts
theorem SimpleGraph.Walk.end_mem_verts_toSubgraph E1 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v), v ∈ p.toSubgraph.verts
theorem SimpleGraph.Walk.verts_toSubgraph E0 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v), p.toSubgraph.verts = {w | w ∈ p.support}
theorem SimpleGraph.Walk.mem_edges_toSubgraph E0 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v) {e : Sym2 V}, e ∈ p.toSubgraph.edgeSet ↔ e ∈ p.edges
theorem SimpleGraph.Walk.edgeSet_toSubgraph E0 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v), p.toSubgraph.edgeSet = p.edgeSet
theorem SimpleGraph.Adj.toSubgraph_toWalk E1 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} (h : G.Adj u v), h.toWalk.toSubgraph = G.subgraphOfAdj h
theorem SimpleGraph.Walk.fromEdgeSet_edgeSet E0 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v),
SimpleGraph.fromEdgeSet p.edgeSet = p.toSubgraph.spanningCoe
theorem SimpleGraph.Walk.toSubgraph_append E0 #
∀ {V : Type u} {G : SimpleGraph V} {u v w : V} (p : G.Walk u v) (q : G.Walk v w),
(p.append q).toSubgraph = p.toSubgraph ⊔ q.toSubgraph
theorem SimpleGraph.Walk.toSubgraph_reverse E0 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v), p.reverse.toSubgraph = p.toSubgraph
theorem SimpleGraph.Walk.toSubgraph_rotate E0 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} [inst : DecidableEq V] (c : G.Walk v v) (h : u ∈ c.support),
(c.rotate u h).toSubgraph = c.toSubgraph
theorem SimpleGraph.Walk.toSubgraph_map E0 #
∀ {V : Type u} {V' : Type v} {G : SimpleGraph V} {G' : SimpleGraph V'} {u v : V} (f : G →g G') (p : G.Walk u v),
(SimpleGraph.Walk.map f p).toSubgraph = SimpleGraph.Subgraph.map f p.toSubgraph
theorem SimpleGraph.Walk.adj_toSubgraph_mapLe E1 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} {G' : SimpleGraph V} {w x : V} {p : G.Walk u v} (h : G ≤ G'),
(SimpleGraph.Walk.mapLe h p).toSubgraph.Adj w x ↔ p.toSubgraph.Adj w x
theorem SimpleGraph.Walk.finite_neighborSet_toSubgraph E0 #
∀ {V : Type u} {G : SimpleGraph V} {u v w : V} (p : G.Walk u v), (p.toSubgraph.neighborSet w).Finite
theorem SimpleGraph.Walk.toSubgraph_le_induce_support E1 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v), p.toSubgraph ≤ ⊤.induce {v_1 | v_1 ∈ p.support}
theorem SimpleGraph.Walk.toSubgraph_adj_getVert E1 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} (w : G.Walk u v) {i : ℕ},
i < w.length → w.toSubgraph.Adj (w.getVert i) (w.getVert (i + 1))
theorem SimpleGraph.Walk.toSubgraph_adj_snd E1 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} (w : G.Walk u v), ¬w.Nil → w.toSubgraph.Adj u w.snd
theorem SimpleGraph.Walk.toSubgraph_adj_penultimate E1 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} (w : G.Walk u v), ¬w.Nil → w.toSubgraph.Adj w.penultimate v
theorem SimpleGraph.Walk.adj_toSubgraph_iff_mem_edges E1 #
∀ {V : Type u} {G : SimpleGraph V} {u v u' v' : V} {p : G.Walk u v}, p.toSubgraph.Adj u' v' ↔ s(u', v') ∈ p.edges
theorem SimpleGraph.Walk.toSubgraph_adj_iff E0 #
∀ {V : Type u} {G : SimpleGraph V} {u v u' v' : V} (w : G.Walk u v),
w.toSubgraph.Adj u' v' ↔ ∃ i, s(w.getVert i, w.getVert (i + 1)) = s(u', v') ∧ i < w.length
theorem SimpleGraph.Walk.mem_support_of_adj_toSubgraph E0 #
∀ {V : Type u} {G : SimpleGraph V} {u v u' v' : V} {p : G.Walk u v}, p.toSubgraph.Adj u' v' → u' ∈ p.support
theorem SimpleGraph.Walk.toSubgraph_le_iff E0 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} {w : G.Walk u v},
¬w.Nil → ∀ {G' : G.Subgraph}, w.toSubgraph ≤ G' ↔ w.edgeSet ⊆ G'.edgeSet
theorem SimpleGraph.Walk.toSubgraph_bypass_le_toSubgraph E1 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v} [inst : DecidableEq V], p.bypass.toSubgraph ≤ p.toSubgraph
def SimpleGraph.Walk.mapToSubgraph E1 #
{V : Type u} → {G : SimpleGraph V} → {u v : V} → (w : G.Walk u v) → w.toSubgraph.coe.Walk ⟨u, ⋯⟩ ⟨v, ⋯⟩
Map a walk to its own subgraph.
theorem SimpleGraph.Walk.map_mapToSubgraph_hom E0 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} (w : G.Walk u v), SimpleGraph.Walk.map w.toSubgraph.hom w.mapToSubgraph = w
Mapping a walk to its own subgraph and then to the original graph produces the same walk.
theorem SimpleGraph.Walk.map_mapToSubgraph_eq_induce E0 #
∀ {V : Type u} {G : SimpleGraph V} (s : Set V) {u v : V} (w : G.Walk u v) (hs : ∀ x ∈ w.support, x ∈ s),
SimpleGraph.Walk.map { toFun := fun x ↦ ⟨↑x, ⋯⟩, map_rel' := ⋯ } w.mapToSubgraph = SimpleGraph.Walk.induce s w hs
Mapping a walk to its own subgraph and then to G[s] where s contains the walk's support is
the same as inducing the walk to s.
theorem SimpleGraph.Walk.map_support_mapToSubgraph E0 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v}, List.map Subtype.val p.mapToSubgraph.support = p.support
theorem SimpleGraph.Walk.map_edges_mapToSubgraph E0 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v},
List.map (Sym2.map Subtype.val) p.mapToSubgraph.edges = p.edges
theorem SimpleGraph.Walk.map_darts_mapToSubgraph E0 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v},
List.map p.toSubgraph.hom.mapDart p.mapToSubgraph.darts = p.darts
theorem SimpleGraph.Walk.image_edgeSet_mapToSubgraph E1 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v},
Sym2.map Subtype.val '' p.mapToSubgraph.edgeSet = p.edgeSet
theorem SimpleGraph.Walk.edgeSet_mapToSubgraph E1 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v},
p.mapToSubgraph.edgeSet = Sym2.map Subtype.val ⁻¹' p.edgeSet
theorem SimpleGraph.Walk.isTrail_mapToSubgraph E0 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v}, p.mapToSubgraph.IsTrail ↔ p.IsTrail
theorem SimpleGraph.Walk.isPath_mapToSubgraph E0 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v}, p.mapToSubgraph.IsPath ↔ p.IsPath
theorem SimpleGraph.Walk.isCircuit_mapToSubgraph E0 #
∀ {V : Type u} {G : SimpleGraph V} {v : V} {p : G.Walk v v}, p.mapToSubgraph.IsCircuit ↔ p.IsCircuit
theorem SimpleGraph.Walk.isCycle_mapToSubgraph E0 #
∀ {V : Type u} {G : SimpleGraph V} {v : V} {p : G.Walk v v}, p.mapToSubgraph.IsCycle ↔ p.IsCycle
theorem SimpleGraph.Walk.map_mapToSubgraph_eq_induce_id E0 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} (w : G.Walk u v),
SimpleGraph.Walk.map { toFun := fun v_1 ↦ ⟨↑v_1, ⋯⟩, map_rel' := ⋯ } w.mapToSubgraph =
SimpleGraph.Walk.induce {x | x ∈ w.support} w ⋯
Mapping a walk to its own subgraph and then to G[w.support] is the same as inducing the walk
to its support.
theorem SimpleGraph.Walk.isInduced_toSubgraph E1 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} {w : G.Walk u v}, w.toSubgraph.IsInduced ↔ w.IsChordless
theorem SimpleGraph.Walk.IsPath.neighborSet_toSubgraph_startpoint E1 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v}, p.IsPath → ¬p.Nil → p.toSubgraph.neighborSet u = {p.snd}
theorem SimpleGraph.Walk.IsPath.neighborSet_toSubgraph_endpoint E1 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u v},
p.IsPath → ¬p.Nil → p.toSubgraph.neighborSet v = {p.penultimate}
theorem SimpleGraph.Walk.IsPath.neighborSet_toSubgraph_internal E1 #
∀ {V : Type u} {G : SimpleGraph V} {v u : V} {i : ℕ} {p : G.Walk u v},
p.IsPath → i ≠ 0 → i < p.length → p.toSubgraph.neighborSet (p.getVert i) = {p.getVert (i - 1), p.getVert (i + 1)}
theorem SimpleGraph.Walk.IsPath.ncard_neighborSet_toSubgraph_internal_eq_two E1 #
∀ {V : Type u} {G : SimpleGraph V} {v u : V} {i : ℕ} {p : G.Walk u v},
p.IsPath → i ≠ 0 → i < p.length → (p.toSubgraph.neighborSet (p.getVert i)).ncard = 2
theorem SimpleGraph.Walk.IsPath.snd_of_toSubgraph_adj E1 #
∀ {V : Type u} {G : SimpleGraph V} {u v v' : V} {p : G.Walk u v}, p.IsPath → p.toSubgraph.Adj u v' → p.snd = v'
theorem SimpleGraph.Walk.IsCycle.neighborSet_toSubgraph_endpoint E1 #
∀ {V : Type u} {G : SimpleGraph V} {u : V} {p : G.Walk u u},
p.IsCycle → p.toSubgraph.neighborSet u = {p.snd, p.penultimate}
theorem SimpleGraph.Walk.IsCycle.neighborSet_toSubgraph_internal E1 #
∀ {V : Type u} {G : SimpleGraph V} {u : V} {i : ℕ} {p : G.Walk u u},
p.IsCycle → i ≠ 0 → i < p.length → p.toSubgraph.neighborSet (p.getVert i) = {p.getVert (i - 1), p.getVert (i + 1)}
theorem SimpleGraph.Walk.IsCycle.ncard_neighborSet_toSubgraph_eq_two E1 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} {p : G.Walk u u},
p.IsCycle → v ∈ p.support → (p.toSubgraph.neighborSet v).ncard = 2
theorem SimpleGraph.Walk.IsCycle.exists_isCycle_snd_verts_eq E0 #
∀ {V : Type u} {G : SimpleGraph V} {v w : V} {p : G.Walk v v},
p.IsCycle → p.toSubgraph.Adj v w → ∃ p', p'.IsCycle ∧ p'.snd = w ∧ p'.toSubgraph.verts = p.toSubgraph.verts
theorem SimpleGraph.Walk.exists_mem_support_mem_erase_mem_support_takeUntil_eq_empty E2 #
∀ {V : Type u} {G : SimpleGraph V} [inst : DecidableEq V] {u v : V} {p : G.Walk u v} (s : Finset V),
{x ∈ s | x ∈ p.support}.Nonempty →
∃ x ∈ s, ∃ (hx : x ∈ p.support), {t ∈ s.erase x | t ∈ (p.takeUntil x hx).support} = ∅
This lemma states that given some finite set of vertices, of which at least one is in the
support of a given walk, one of them is the first to be encountered. This consequence is encoded
as the set of vertices, restricted to those in the support, except for the first, being empty.
You could interpret this as being takeUntilSet, but defining this is slightly involved due to
not knowing what the final vertex is. This could be done by defining a function to obtain the
first encountered vertex and then use that to define takeUntilSet. That direction could be
worthwhile if this concept is used more widely.
theorem SimpleGraph.Walk.exists_mem_support_forall_mem_support_imp_eq E0 #
∀ {V : Type u} {G : SimpleGraph V} [inst : DecidableEq V] {u v : V} {p : G.Walk u v} (s : Finset V),
{x ∈ s | x ∈ p.support}.Nonempty → ∃ x ∈ s, ∃ (hx : x ∈ p.support), ∀ t ∈ s, t ∈ (p.takeUntil x hx).support → t = x
theorem SimpleGraph.Walk.toSubgraph_connected E1 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v), p.toSubgraph.Connected
theorem SimpleGraph.Subgraph.induce_union_connected E1 #
∀ {V : Type u} {G : SimpleGraph V} {H : G.Subgraph} {s t : Set V},
(H.induce s).Preconnected → (H.induce t).Preconnected → (s ∩ t).Nonempty → (H.induce (s ∪ t)).Connected
theorem SimpleGraph.Subgraph.connected_induce_top_sup E1 #
∀ {V : Type u} {G : SimpleGraph V} {H K : G.Subgraph},
H.Preconnected →
K.Preconnected → ∀ {u v : V}, u ∈ H.verts → v ∈ K.verts → G.Adj u v → (⊤.induce {u, v} ⊔ H ⊔ K).Connected
theorem SimpleGraph.Subgraph.preconnected_iff_forall_exists_walk_subgraph E1 #
∀ {V : Type u} {G : SimpleGraph V} (H : G.Subgraph),
H.Preconnected ↔ ∀ {u v : V}, u ∈ H.verts → v ∈ H.verts → ∃ p, p.toSubgraph ≤ H
theorem SimpleGraph.Subgraph.connected_iff_forall_exists_walk_subgraph E1 #
∀ {V : Type u} {G : SimpleGraph V} (H : G.Subgraph),
H.Connected ↔ H.verts.Nonempty ∧ ∀ {u v : V}, u ∈ H.verts → v ∈ H.verts → ∃ p, p.toSubgraph ≤ H
theorem SimpleGraph.preconnected_induce_iff E0 #
∀ {V : Type u} {G : SimpleGraph V} {s : Set V}, (SimpleGraph.induce s G).Preconnected ↔ (⊤.induce s).Preconnected
theorem SimpleGraph.connected_induce_iff E0 #
∀ {V : Type u} {G : SimpleGraph V} {s : Set V}, (SimpleGraph.induce s G).Connected ↔ (⊤.induce s).Connected
theorem SimpleGraph.induce_union_connected E1 #
∀ {V : Type u} {G : SimpleGraph V} {s t : Set V},
(SimpleGraph.induce s G).Preconnected →
(SimpleGraph.induce t G).Preconnected → (s ∩ t).Nonempty → (SimpleGraph.induce (s ∪ t) G).Connected
theorem SimpleGraph.induce_pair_connected_of_adj E1 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V}, G.Adj u v → (SimpleGraph.induce {u, v} G).Connected
theorem SimpleGraph.Subgraph.Connected.induce_verts E1 #
∀ {V : Type u} {G : SimpleGraph V} {H : G.Subgraph}, H.Connected → (SimpleGraph.induce H.verts G).Connected
theorem SimpleGraph.Walk.connected_induce_support E1 #
∀ {V : Type u} {G : SimpleGraph V} {u v : V} (p : G.Walk u v), (SimpleGraph.induce {v_1 | v_1 ∈ p.support} G).Connected
theorem SimpleGraph.connected_induce_union E1 #
∀ {V : Type u} {G : SimpleGraph V} {v w : V} {s t : Set V},
(SimpleGraph.induce s G).Preconnected →
(SimpleGraph.induce t G).Preconnected → v ∈ s → w ∈ t → G.Adj v w → (SimpleGraph.induce (s ∪ t) G).Connected
theorem SimpleGraph.induce_connected_of_patches E1 #
∀ {V : Type u} {G : SimpleGraph V} {s : Set V},
∀ u ∈ s,
(∀ {v : V},
v ∈ s → ∃ s' ⊆ s, ∃ (hu' : u ∈ s') (hv' : v ∈ s'), (SimpleGraph.induce s' G).Reachable ⟨u, hu'⟩ ⟨v, hv'⟩) →
(SimpleGraph.induce s G).Connected
theorem SimpleGraph.induce_sUnion_connected_of_pairwise_not_disjoint E1 #
∀ {V : Type u} {G : SimpleGraph V} {S : Set (Set V)},
S.Nonempty →
(∀ {s t : Set V}, s ∈ S → t ∈ S → (s ∩ t).Nonempty) →
(∀ {s : Set V}, s ∈ S → (SimpleGraph.induce s G).Connected) → (SimpleGraph.induce (⋃₀ S) G).Connected
theorem SimpleGraph.extend_finset_to_connected E1 #
∀ {V : Type u} {G : SimpleGraph V},
G.Preconnected → ∀ {t : Finset V}, t.Nonempty → ∃ t', t ⊆ t' ∧ (SimpleGraph.induce (↑t') G).Connected
theorem SimpleGraph.Reachable.coe_toSubgraph E0 #
∀ {V : Type u} {G H : SimpleGraph V} {u v : V} (h : H ≤ G),
H.Reachable u v → (SimpleGraph.toSubgraph H h).coe.Reachable ⟨u, trivial⟩ ⟨v, trivial⟩
theorem SimpleGraph.Preconnected.toSubgraph E1 #
∀ {V : Type u} {G H : SimpleGraph V} (h : H ≤ G), H.Preconnected → (SimpleGraph.toSubgraph H h).Preconnected
theorem SimpleGraph.Connected.toSubgraph E1 #
∀ {V : Type u} {G H : SimpleGraph V} (h : H ≤ G), H.Connected → (SimpleGraph.toSubgraph H h).Connected
theorem SimpleGraph.Reachable.coe_subgraphMap E0 #
∀ {V : Type u} {G : SimpleGraph V} {G' : G.Subgraph} {G'' : G'.coe.Subgraph} (f : G'.coe →g G) {u v : ↑G''.verts},
G''.coe.Reachable u v → (SimpleGraph.Subgraph.map f G'').coe.Reachable ⟨f ↑u, ⋯⟩ ⟨f ↑v, ⋯⟩
theorem SimpleGraph.Reachable.coe_coeSubgraph E0 #
∀ {V : Type u} {G : SimpleGraph V} {G' : G.Subgraph} (G'' : G'.coe.Subgraph) {u v : ↑G''.verts},
G''.coe.Reachable u v →
(SimpleGraph.Subgraph.coeSubgraph G'').coe.Reachable ((SimpleGraph.Subgraph.coeSubgraph G'').vert ↑↑u ⋯)
((SimpleGraph.Subgraph.coeSubgraph G'').vert ↑↑v ⋯)
theorem SimpleGraph.Subgraph.Preconnected.map E1 #
∀ {V : Type u} {G : SimpleGraph V} {G' : G.Subgraph} {G'' : G'.coe.Subgraph} (f : G'.coe →g G),
G''.Preconnected → (SimpleGraph.Subgraph.map f G'').Preconnected
theorem SimpleGraph.Subgraph.Connected.map E1 #
∀ {V : Type u} {G : SimpleGraph V} {G' : G.Subgraph} {G'' : G'.coe.Subgraph} (f : G'.coe →g G),
G''.Connected → (SimpleGraph.Subgraph.map f G'').Connected
theorem SimpleGraph.Subgraph.Preconnected.coeSubgraph E1 #
∀ {V : Type u} {G : SimpleGraph V} {G' : G.Subgraph} (G'' : G'.coe.Subgraph),
G''.Preconnected → (SimpleGraph.Subgraph.coeSubgraph G'').Preconnected
theorem SimpleGraph.Subgraph.Connected.coeSubgraph E1 #
∀ {V : Type u} {G : SimpleGraph V} {G' : G.Subgraph} (G'' : G'.coe.Subgraph),
G''.Connected → (SimpleGraph.Subgraph.coeSubgraph G'').Connected