@@ -281,42 +281,18 @@ theorem toSubgraph_adj_penultimate {u v} (w : G.Walk u v) (h : ¬ w.Nil) :
281281 simpa [show w.length - 1 + 1 = w.length by lia]
282282 using w.toSubgraph_adj_getVert (by lia : w.length - 1 < w.length)
283283
284+ lemma adj_toSubgraph_iff_mem_edges {u v u' v' : V} {p : G.Walk u v} :
285+ p.toSubgraph.Adj u' v' ↔ s(u', v') ∈ p.edges := by
286+ rw [← mem_edges_toSubgraph, Subgraph.mem_edgeSet]
287+
284288theorem toSubgraph_adj_iff {u v u' v'} (w : G.Walk u v) :
285289 w.toSubgraph.Adj u' v' ↔ ∃ i, s(w.getVert i, w.getVert (i + 1 )) =
286290 s(u', v') ∧ i < w.length := by
287- constructor
288- · intro hadj
289- unfold Walk.toSubgraph at hadj
290- match w with
291- | .nil =>
292- simp only [singletonSubgraph_adj, Pi.bot_apply, Prop .bot_eq_false] at hadj
293- | .cons h p =>
294- simp only [Subgraph.sup_adj, subgraphOfAdj_adj, Sym2.eq, Sym2.rel_iff', Prod.mk.injEq,
295- Prod.swap_prod_mk] at hadj
296- cases hadj with
297- | inl hl =>
298- use 0
299- simp only [Walk.getVert_zero, zero_add, getVert_cons_succ]
300- refine ⟨?_, by simp only [length_cons, Nat.zero_lt_succ]⟩
301- exact Sym2.eq_iff.mpr hl
302- | inr hr =>
303- obtain ⟨i, hi⟩ := (toSubgraph_adj_iff _).mp hr
304- use i + 1
305- simp only [getVert_cons_succ]
306- constructor
307- · exact hi.1
308- · simp only [Walk.length_cons, Nat.add_lt_add_right hi.2 1 ]
309- · rintro ⟨i, hi⟩
310- rw [← Subgraph.mem_edgeSet, ← hi.1 , Subgraph.mem_edgeSet]
311- exact toSubgraph_adj_getVert _ hi.2
291+ grind [adj_toSubgraph_iff_mem_edges, mk_mem_edges_iff_exists]
312292
313293lemma mem_support_of_adj_toSubgraph {u v u' v' : V} {p : G.Walk u v} (hp : p.toSubgraph.Adj u' v') :
314294 u' ∈ p.support := p.mem_verts_toSubgraph.mp (p.toSubgraph.edge_vert hp)
315295
316- lemma adj_toSubgraph_iff_mem_edges {u v u' v' : V} {p : G.Walk u v} :
317- p.toSubgraph.Adj u' v' ↔ s(u', v') ∈ p.edges := by
318- rw [← p.mem_edges_toSubgraph, Subgraph.mem_edgeSet]
319-
320296theorem toSubgraph_le_iff {w : G.Walk u v} (hnil : ¬w.Nil) {G' : G.Subgraph} :
321297 w.toSubgraph ≤ G' ↔ w.edgeSet ⊆ G'.edgeSet := by
322298 refine ⟨fun hw e he ↦ Subgraph.edgeSet_mono hw <| w.mem_edges_toSubgraph.mpr he, fun hw ↦ ?_⟩
0 commit comments