Skip to content

Commit 3e317f2

Browse files
committed
style(Combinatorics/SimpleGraph/InducedCopy): use Embedding G H instead of G ↪g H
Mirror the spelled-out `Copy G H` / `UnlabeledEmbedding G H` style throughout signatures, return types, subtype clauses, type-level operations (`Nat.card`, `Unique`, `Finite`, `Nonempty`), and docstring prose. The 2×2 grid Copy G H UnlabeledCopy G H Embedding G H UnlabeledEmbedding G H now reads as a grid everywhere. Re-flow two docstring lines to stay under the 100-char limit.
1 parent c6d766d commit 3e317f2

1 file changed

Lines changed: 21 additions & 22 deletions

File tree

Mathlib/Combinatorics/SimpleGraph/InducedCopy.lean

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ This file develops the induced analogues of the containment notions from
1414
`Mathlib/Combinatorics/SimpleGraph/Copy.lean`.
1515
1616
For two simple graphs `G` and `H`, an *induced copy* of `G` in `H` is an induced subgraph of `H`
17-
isomorphic to `G`. Equivalently, it is a graph embedding `G ↪g H`.
17+
isomorphic to `G`. Equivalently, it is a graph embedding `Embedding G H`.
1818
1919
## Main declarations
2020
2121
* `SimpleGraph.IsIndContained G H`, `G ⊴ H` is the relation that `H` contains an induced copy of
22-
`G`, that is, the type `G ↪g H` is nonempty. This is equivalent to the existence of an
22+
`G`, that is, the type `Embedding G H` is nonempty. This is equivalent to the existence of an
2323
isomorphism from `G` to an induced subgraph of `H`.
2424
* `SimpleGraph.IndFree` is the predicate that `H` does not contain an induced copy of `G`. This
2525
is the negation of `SimpleGraph.IsIndContained` implemented for convenience.
2626
* `SimpleGraph.UnlabeledEmbedding G H`: Type of induced `SimpleGraph.Subgraph`s of `H`
2727
isomorphic to `G`.
2828
* `SimpleGraph.embeddingCount H G`: Number of induced labeled copies of `G` in `H`, i.e. the
29-
number of graph embeddings `G ↪g H`.
29+
number of graph embeddings `Embedding G H`.
3030
* `SimpleGraph.unlabeledEmbeddingCount H G`: Number of induced `SimpleGraph.Subgraph`s of `H`
3131
isomorphic to `G`.
3232
@@ -60,21 +60,21 @@ variable {V V' W W' X : Type*}
6060
/-!
6161
### Embedding to subgraph
6262
63-
For a graph embedding `f : G ↪g H`, the image is an induced subgraph of `H` isomorphic to `G`.
64-
This packages the image as a `H.Subgraph`, together with the inducedness and isomorphism
63+
For a graph embedding `f : Embedding G H`, the image is an induced subgraph of `H` isomorphic
64+
to `G`. This packages the image as a `H.Subgraph`, together with the inducedness and isomorphism
6565
characterisations needed downstream.
6666
-/
6767

6868
namespace Embedding
6969

7070
/-- The induced subgraph corresponding to an embedding. -/
71-
abbrev toSubgraph (f : G ↪g H) : H.Subgraph := f.toCopy.toSubgraph
71+
abbrev toSubgraph (f : Embedding G H) : H.Subgraph := f.toCopy.toSubgraph
7272

73-
@[simp] lemma toSubgraph_isInduced (f : G ↪g H) : (toSubgraph f).IsInduced := by
73+
@[simp] lemma toSubgraph_isInduced (f : Embedding G H) : (toSubgraph f).IsInduced := by
7474
simp [toSubgraph, Copy.toSubgraph, Subgraph.IsInduced, Relation.map_apply_apply, f.injective]
7575

7676
@[simp] lemma range_toSubgraph :
77-
Set.range (toSubgraph : (G ↪g H) → H.Subgraph) =
77+
Set.range (toSubgraph : (Embedding G H) → H.Subgraph) =
7878
{H' : H.Subgraph | H'.IsInduced ∧ Nonempty (G ≃g H'.coe)} := by
7979
ext H'
8080
simp only [Set.mem_range, Set.mem_setOf_eq]
@@ -92,7 +92,7 @@ end Embedding
9292
/-!
9393
### Induced containment
9494
95-
A graph `H` *inducingly contains* a graph `G` if there is some graph embedding `G ↪g H`. This
95+
A graph `H` *inducingly contains* a graph `G` if there is some graph embedding `Embedding G H`. This
9696
amounts to `H` having an induced subgraph isomorphic to `G`.
9797
9898
We denote "`G` is inducingly contained in `H`" by `G ⊴ H` (`\trianglelefteq`).
@@ -101,14 +101,14 @@ We denote "`G` is inducingly contained in `H`" by `G ⊴ H` (`\trianglelefteq`).
101101
section IsIndContained
102102

103103
/-- The relation `IsIndContained G H`, `G ⊴ H` says that `H` contains an induced copy of `G`,
104-
i.e. there exists a graph embedding `G ↪g H`.
104+
i.e. there exists a graph embedding `Embedding G H`.
105105
106106
This is equivalent to the existence of an isomorphism from `G` to an induced subgraph of `H`. -/
107-
abbrev IsIndContained (G : SimpleGraph V) (H : SimpleGraph W) : Prop := Nonempty (G ↪g H)
107+
abbrev IsIndContained (G : SimpleGraph V) (H : SimpleGraph W) : Prop := Nonempty (Embedding G H)
108108

109109
@[inherit_doc] scoped infixl:50 " ⊴ " => SimpleGraph.IsIndContained
110110

111-
protected lemma Embedding.isIndContained (f : G ↪g H) : G ⊴ H := ⟨f⟩
111+
protected lemma Embedding.isIndContained (f : Embedding G H) : G ⊴ H := ⟨f⟩
112112

113113
protected lemma IsIndContained.isContained : G ⊴ H → G ⊑ H := fun ⟨f⟩ ↦ f.isContained
114114

@@ -231,24 +231,23 @@ copies of `G` in `H`.
231231

232232
section EmbeddingCount
233233

234-
/-- `H.embeddingCount G` is the number of induced labeled copies of `G` in `H`, i.e. the number of
235-
graph embeddings `G ↪g H`. See `SimpleGraph.unlabeledEmbeddingCount` for the number of induced
236-
unlabeled
237-
copies. -/
234+
/-- `H.embeddingCount G` is the number of induced labeled copies of `G` in `H`, i.e. the number
235+
of graph embeddings `Embedding G H`. See `SimpleGraph.unlabeledEmbeddingCount` for the number of
236+
induced unlabeled copies. -/
238237
noncomputable def embeddingCount (H : SimpleGraph W) (G : SimpleGraph V) : ℕ :=
239-
Nat.card (G ↪g H)
238+
Nat.card (Embedding G H)
240239

241240
lemma embeddingCount_eq_nat_card (H : SimpleGraph W) (G : SimpleGraph V) :
242-
H.embeddingCount G = Nat.card (G ↪g H) := by rw [embeddingCount]
241+
H.embeddingCount G = Nat.card (Embedding G H) := by rw [embeddingCount]
243242

244-
private instance [IsEmpty V] : Unique (G ↪g H) :=
243+
private instance [IsEmpty V] : Unique (Embedding G H) :=
245244
⟨⟨RelEmbedding.ofIsEmpty G.Adj H.Adj⟩,
246245
fun _ => RelEmbedding.ext fun a => isEmptyElim a⟩
247246

248247
@[simp] lemma embeddingCount_of_isEmpty [IsEmpty V] (H : SimpleGraph W) (G : SimpleGraph V) :
249248
H.embeddingCount G = 1 := Nat.card_unique
250249

251-
instance [Finite V] [Finite W] : Finite (G ↪g H) :=
250+
instance [Finite V] [Finite W] : Finite (Embedding G H) :=
252251
Finite.of_injective _ DFunLike.coe_injective
253252

254253
@[simp] lemma embeddingCount_eq_zero [Finite V] [Finite W] :
@@ -306,10 +305,10 @@ lemma unlabeledEmbeddingCount_le_embeddingCount [Finite V] [Finite W] :
306305
H.unlabeledEmbeddingCount G ≤ H.embeddingCount G := by
307306
rw [unlabeledEmbeddingCount, embeddingCount]
308307
apply Nat.card_le_card_of_surjective
309-
(fun f : G ↪g H ↦ (⟨Embedding.toSubgraph f, f.toSubgraph_isInduced,
308+
(fun f : Embedding G H ↦ (⟨Embedding.toSubgraph f, f.toSubgraph_isInduced,
310309
⟨f.toCopy.isoToSubgraph⟩⟩ : G.UnlabeledEmbedding H))
311310
rintro ⟨H', hInd, ⟨e⟩⟩
312-
obtain ⟨f, hf⟩ : ∃ f : G ↪g H, Embedding.toSubgraph f = H' := by
311+
obtain ⟨f, hf⟩ : ∃ f : Embedding G H, Embedding.toSubgraph f = H' := by
313312
rw [← Set.mem_range, Embedding.range_toSubgraph]; exact ⟨hInd, ⟨e⟩⟩
314313
exact ⟨f, Subtype.ext hf⟩
315314

0 commit comments

Comments
 (0)