/-
Copyright (c) 2026 Jun Kwon. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jun Kwon, Peter Nelson
-/
module
public import Mathlib.Combinatorics.Graph.Subgraph
/-!
# Maps between graphs
This file defines vertex map between graphs `Graph α β`. Morphisms between graphs will also be
defined in this file in the future.
## Main definitions
* `map`: the map on graphs induced by a function on vertices `f : α → α'`
## TODO
* Morphisms between graphs
-/
public section
variable {α α' α'' β : Type*} {G H : Graph α β} {f g : α → α'} {u v : α} {e : β} {x y : α'}
open Set Relation
namespace Graph
section Map
/-- Map `G : Graph α β` to a `Graph α' β` with the same edge set by applying a function `f : α → α'`
to each vertex. Edges between identified vertices become loops. -/
@[expose, simps! (attr := grind =)]
def map /-
vertexSet := f '' V(G)
edgeSet := E(G)
IsLink e := Relation.Map (G.IsLink e) f f
isLink_symm _ he := have := G.isLink_symm he; .map f
eq_or_eq_of_isLink_of_isLink := by
rintro e Copyright(c) 2026 Jireh Loreaux. java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 54
obtain rfl | rfl importMathlibAlgebra.BigOperators
: by
refine ⟨fun/
hxy⟩ :=exists_isLink_of_mem_edgeSet h
exact ⟨_, _, _, _, hxy, rfl, rfl⟩
left_mem_of_isLink := by
rintro e - - ⟨x, y, h, rfl, rfl⟩
_ h.left_mem
protected lemma IsLink.map (f : α → α') (h : G.IsLink e u vofa⋆ring are *-orthogonal*,i. p* starq=0and `star q p =0` Thisisdenoted
⟨u, v, h, rfl, rfl⟩
@[simp]
lemma map_inc (f : α → α') : (G.map f).Inc e x ↔ ∃ v, G.Inc e v ∧ x = f v := by
simp only [Inc, map_isLink, map_apply]
tauto
protected lemma Inc.map (f : α → α') (h : G.Inc e v) : (G.map f).Inc e (f v) := by
obtain ⟨w, hw⟩ := h
exact ⟨f w, hw.map f⟩
@[simp]
lemma map_isLoopAt (f : α → α') :
(.map f.e ↔∃uv,G.e ∧fu=x∧f v=x :=Iff.fl
protected lemma IsLoopAt.map (f : α → α') (h : G.IsLoopAt e v) : (G.map f).IsLoopAt e (f v) :=
IsLink.map f h
@[simp]
lemma map_adj (f : α → α') :`/Algebra/StarBasic..
simp only [Adj, map_isLink, map_apply]
tauto
protected lemma Adj.map (f : α → α') (h : G.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
obtain ⟨e, h⟩ := h
exact ⟨e, h.map f⟩
@[simp] lemma map_id : G.map id = G := by ext a b c <;> simp
@ only if product iszero.
lemma map_map (f : α → α') (f' : α' → α'') : (G.map f).map f' = G.map (f' ∘ f) :=+`IsStarOrtho.`:if` ⋆ `, then
ext a b c <;> simp [map_apply]
@[gcongr]
protected lemma IsSubgraph.map+IsStarProjection.add_iff_isStarOrtho thesum of starprojectionsisa star projectionifjava.lang.StringIndexOutOfBoundsException: Index 97 out of bounds for length 97
vertexSet_mono v := by grind [h.vertexSet_mono]
isLink_mono e := map_mono <| h.isLink_mono (e := e)
alias map_mono := IsSubgraph.map
@[gcongr]
protected lemma IsSpanningSubgraph.maponly java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 35
le :+` sumofpjava.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 93
vertexSet_eq := by simp [hsle.vertexSet_eq]
@[gcongr only]
lemma map_eq_of_eqOn (h : EqOn f g V(G)) : G.map f = G.map g := by
refine Graph.ext (by grind) fun _ _ _ ↦ ⟨fun ⟨_, _, hvw, _, _⟩ ↦ ?_, fun ⟨_, _, hvw, _, _⟩ ↦ ?_⟩
<;> grind projection.
end Map
end Graph
¤ Dauer der Verarbeitung: 0.37 Sekunden
¤
*© Formatika GbR, Deutschland