Skip to content

Commit 6fc9d09

Browse files
committed
chore(Combinatorics.SimpleGraph.Copy): replace file-wide @[expose] with selective exposure
Remove `@[expose] public section`; add `@[expose]` selectively to `toEmbedding`, `id`, `ofLE`, and `topEmbedding`, which have exported `rfl`-proved `@[simp]` lemmas. Change `IsIndContained` from `def` to `abbrev` for elaborator transparency. Replace `@[simps!]` on `topEmbedding` with an explicit `topEmbedding_apply` lemma. Add missing `toEmbedding_apply` simp lemma for API symmetry with `toHom_apply`.
1 parent cd24027 commit 6fc9d09

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

Mathlib/Combinatorics/SimpleGraph/Copy.lean

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ The following notation is declared in scope `SimpleGraph`:
5959
* Make `copyCount`/`labeledCopyCount` computable (not necessarily efficiently).
6060
-/
6161

62-
@[expose] public section
62+
public section
6363

6464
open Finset Function
6565
open Fintype (card)
@@ -125,10 +125,12 @@ def mapNeighborSet (f : Copy A B) (a : α) :
125125
exact f.injective h
126126

127127
/-- A copy gives rise to an embedding of vertex types. -/
128-
def toEmbedding (f : Copy A B) : α ↪ β := ⟨f, f.injective⟩
128+
@[expose] def toEmbedding (f : Copy A B) : α ↪ β := ⟨f, f.injective⟩
129+
130+
@[simp] lemma toEmbedding_apply (f : Copy A B) (a : α) : f.toEmbedding a = f a := rfl
129131

130132
/-- The identity copy from a simple graph to itself. -/
131-
@[refl] def id (G : SimpleGraph V) : Copy G G := ⟨Hom.id, Function.injective_id⟩
133+
@[expose, refl] def id (G : SimpleGraph V) : Copy G G := ⟨Hom.id, Function.injective_id⟩
132134

133135
@[simp, norm_cast] lemma coe_id : ⇑(id G) = _root_.id := rfl
134136

@@ -143,7 +145,8 @@ theorem comp_apply (g : Copy B C) (f : Copy A B) (a : α) : g.comp f a = g (f a)
143145
RelHom.comp_apply g.toHom f.toHom a
144146

145147
/-- The copy from a subgraph to the supergraph. -/
146-
def ofLE (G₁ G₂ : SimpleGraph V) (h : G₁ ≤ G₂) : Copy G₁ G₂ := ⟨Hom.ofLE h, Function.injective_id⟩
148+
@[expose] def ofLE (G₁ G₂ : SimpleGraph V) (h : G₁ ≤ G₂) : Copy G₁ G₂ :=
149+
⟨Hom.ofLE h, Function.injective_id⟩
147150

148151
@[simp, norm_cast]
149152
theorem coe_comp (g : Copy B C) (f : Copy A B) : ⇑(g.comp f) = g ∘ f := by ext; simp
@@ -200,10 +203,12 @@ instance [Fintype {f : G →g H // Injective f}] : Fintype (G.Copy H) :=
200203
}
201204

202205
/-- A copy of `⊤` gives rise to an embedding of `⊤`. -/
203-
@[simps!]
204-
def topEmbedding (f : Copy (⊤ : SimpleGraph α) G) : (⊤ : SimpleGraph α) ↪g G :=
206+
@[expose] def topEmbedding (f : Copy (⊤ : SimpleGraph α) G) : (⊤ : SimpleGraph α) ↪g G :=
205207
{ f.toEmbedding with
206-
map_rel_iff' := fun {v w} ↦ ⟨fun h ↦ by simpa using h.ne, f.toHom.map_adj⟩}
208+
map_rel_iff' := fun {_ _} ↦ ⟨fun h ↦ f.injective.ne_iff.mp h.ne, f.toHom.map_adj⟩ }
209+
210+
@[simp] lemma topEmbedding_apply (f : Copy (⊤ : SimpleGraph α) G) (v : α) :
211+
f.topEmbedding v = f v := rfl
207212

208213
end Copy
209214

@@ -385,7 +390,7 @@ We denote "`G` is inducingly contained in `H`" by `G ⊴ H` (`\trianglelefteq`).
385390

386391
/-- A simple graph `G` is inducingly contained in a simple graph `H` if there exists an induced
387392
subgraph of `H` isomorphic to `G`. This is denoted by `G ⊴ H`. -/
388-
def IsIndContained (G : SimpleGraph V) (H : SimpleGraph W) : Prop := Nonempty (G ↪g H)
393+
abbrev IsIndContained (G : SimpleGraph V) (H : SimpleGraph W) : Prop := Nonempty (G ↪g H)
389394

390395
@[inherit_doc] scoped infixl:50 " ⊴ " => SimpleGraph.IsIndContained
391396

0 commit comments

Comments
 (0)