Skip to content

Commit 00f0743

Browse files
committed
feat(Combinatorics/SimpleGraph): extract apply_mem_verts_toSubgraph for Copy + Embedding
`f v ∈ f.toSubgraph.verts` is a basic membership fact about `Copy.toSubgraph` — combining `verts_toSubgraph` (`f.toSubgraph.verts = Set.range f`) with the obvious `v ∈ Set.range f`. It was inlined twice as `f.verts_toSubgraph ▸ Set.mem_range_self _` inside `Copy.toEmbeddingOfIsInduced`. Extract and use the named lemma; mirror on the Embedding side.
1 parent 1a1a4e8 commit 00f0743

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

Mathlib/Combinatorics/SimpleGraph/Copy.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@ lemma toSubgraph_surjOn :
201201
@[simp] lemma verts_toSubgraph (f : Copy G H) : f.toSubgraph.verts = Set.range f := by
202202
simp [toSubgraph, Subgraph.map_verts, Set.image_univ]
203203

204+
lemma apply_mem_verts_toSubgraph (f : Copy G H) (v : V) : f v ∈ f.toSubgraph.verts :=
205+
f.verts_toSubgraph ▸ Set.mem_range_self v
206+
204207
@[simp] lemma toSubgraph_adj_iff (f : Copy G H) {a b : V} :
205208
f.toSubgraph.Adj (f a) (f b) ↔ G.Adj a b := by
206209
simp only [toSubgraph, Subgraph.map_adj, Subgraph.top_adj, Relation.map_apply]

Mathlib/Combinatorics/SimpleGraph/InducedCopy.lean

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ abbrev toSubgraph (f : Embedding G H) : H.Subgraph := f.toCopy.toSubgraph
8383
@[simp] lemma verts_toSubgraph (f : Embedding G H) : f.toSubgraph.verts = Set.range f :=
8484
f.toCopy.verts_toSubgraph
8585

86+
lemma apply_mem_verts_toSubgraph (f : Embedding G H) (v : V) : f v ∈ f.toSubgraph.verts :=
87+
f.toCopy.apply_mem_verts_toSubgraph v
88+
8689
@[simp] lemma toSubgraph_adj_iff (f : Embedding G H) {a b : V} :
8790
f.toSubgraph.Adj (f a) (f b) ↔ G.Adj a b :=
8891
f.toCopy.toSubgraph_adj_iff
@@ -130,8 +133,7 @@ providing the converse direction to `Embedding.toSubgraph` / `Embedding.toSubgra
130133
inj' := f.injective
131134
map_rel_iff' {a b} :=
132135
fun hAdj ↦ f.toSubgraph_adj_iff.mp <|
133-
hInd (f.verts_toSubgraph ▸ Set.mem_range_self a)
134-
(f.verts_toSubgraph ▸ Set.mem_range_self b) hAdj,
136+
hInd (f.apply_mem_verts_toSubgraph a) (f.apply_mem_verts_toSubgraph b) hAdj,
135137
fun hAdj ↦ f.toHom.map_adj hAdj⟩
136138

137139
@[simp] lemma Copy.toEmbeddingOfIsInduced_apply (f : Copy G H) (hInd : f.toSubgraph.IsInduced)

0 commit comments

Comments
 (0)