Skip to content

Commit 2fd915d

Browse files
committed
feat: the image of a subgraph under its embedding is itself (#22955)
From ExtrProbCombi (LeanCamCombi)
1 parent 5266e70 commit 2fd915d

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

Mathlib/Combinatorics/SimpleGraph/Copy.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ protected def bot (f : α ↪ β) : Copy (⊥ : SimpleGraph α) B := ⟨⟨f, Fa
121121
end Copy
122122

123123
/-- A `Subgraph G` gives rise to a copy from the coercion to `G`. -/
124-
def Subgraph.coeCopy (G' : G.Subgraph) : Copy G'.coe G := G'.hom.toCopy Subgraph.hom.injective
124+
def Subgraph.coeCopy (G' : G.Subgraph) : Copy G'.coe G := G'.hom.toCopy hom_injective
125125

126126
end Copy
127127

Mathlib/Combinatorics/SimpleGraph/Subgraph.lean

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,9 @@ lemma map_monotone : Monotone (Subgraph.map f) := fun _ _ ↦ map_mono
644644
theorem map_sup (f : G →g G') (H₁ H₂ : G.Subgraph) : (H₁ ⊔ H₂).map f = H₁.map f ⊔ H₂.map f := by
645645
ext <;> simp [Set.image_union, map_adj, sup_adj, Relation.Map, or_and_right, exists_or]
646646

647+
@[simp] lemma map_iso_top {H : SimpleGraph W} (e : G ≃g H) : Subgraph.map e.toHom ⊤ = ⊤ := by
648+
ext <;> simp [Relation.Map, e.apply_eq_iff_eq_symm_apply, ← e.map_rel_iff]
649+
647650
@[simp] lemma edgeSet_map (f : G →g G') (H : G.Subgraph) :
648651
(H.map f).edgeSet = Sym2.map f '' H.edgeSet := Sym2.fromRel_relationMap ..
649652

@@ -669,6 +672,9 @@ theorem comap_monotone {G' : SimpleGraph W} (f : G →g G') : Monotone (Subgraph
669672
intro
670673
apply h.2
671674

675+
@[simp] lemma comap_equiv_top {H : SimpleGraph W} (f : G →g H) : Subgraph.comap f ⊤ = ⊤ := by
676+
ext <;> simp +contextual [f.map_adj]
677+
672678
theorem map_le_iff_le_comap {G' : SimpleGraph W} (f : G →g G') (H : G.Subgraph) (H' : G'.Subgraph) :
673679
H.map f ≤ H' ↔ H ≤ H'.comap f := by
674680
refine ⟨fun h ↦ ⟨fun v hv ↦ ?_, fun v w hvw ↦ ?_⟩, fun h ↦ ⟨fun v ↦ ?_, fun v w ↦ ?_⟩⟩
@@ -718,19 +724,26 @@ protected def hom (x : Subgraph G) : x.coe →g G where
718724
@[simp] lemma coe_hom (x : Subgraph G) :
719725
(x.hom : x.verts → V) = (fun (v : x.verts) => (v : V)) := rfl
720726

721-
theorem hom.injective {x : Subgraph G} : Function.Injective x.hom :=
727+
theorem hom_injective {x : Subgraph G} : Function.Injective x.hom :=
722728
fun _ _ ↦ Subtype.ext
723729

730+
@[deprecated (since := "2025-03-15")] alias hom.injective := hom_injective
731+
732+
@[simp] lemma map_hom_top (G' : G.Subgraph) : Subgraph.map G'.hom ⊤ = G' := by
733+
aesop (add unfold safe Relation.Map, unsafe G'.edge_vert, unsafe Adj.symm)
734+
724735
/-- There is an induced injective homomorphism of a subgraph of `G` as
725736
a spanning subgraph into `G`. -/
726737
@[simps]
727738
def spanningHom (x : Subgraph G) : x.spanningCoe →g G where
728739
toFun := id
729740
map_rel' := x.adj_sub
730741

731-
theorem spanningHom.injective {x : Subgraph G} : Function.Injective x.spanningHom :=
742+
theorem spanningHom_injective {x : Subgraph G} : Function.Injective x.spanningHom :=
732743
fun _ _ ↦ id
733744

745+
@[deprecated (since := "2025-03-15")] alias spanningHom.injective := spanningHom_injective
746+
734747
theorem neighborSet_subset_of_subgraph {x y : Subgraph G} (h : x ≤ y) (v : V) :
735748
x.neighborSet v ⊆ y.neighborSet v :=
736749
fun _ h' ↦ h.2 h'

0 commit comments

Comments
 (0)