l3lab/ntp-mathlib huggingface dataset:
theorem comap_monotone {G' : SimpleGraph W} (f : G →g G') : Monotone (Subgraph.comap f) := by
  intro H H' h
  constructor
  · intro
    simp only [comap_verts, Set.mem_preimage]
    

Proof state:
case left
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G₁ G₂ : Subgraph G
a b : V
G' : SimpleGraph W
f : G →g G'
H H' : Subgraph G'
h : H ≤ H'
a✝ : V
⊢ f a✝ ∈ H.verts → f a✝ ∈ H'.verts

Next tactic:
apply h.1
theorem comap_monotone {G' : SimpleGraph W} (f : G →g G') : Monotone (Subgraph.comap f) := by
  intro H H' h
  constructor
  · intro
    simp only [comap_verts, Set.mem_preimage]
    apply h.1
  · 

Proof state:
case right
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G₁ G₂ : Subgraph G
a b : V
G' : SimpleGraph W
f : G →g G'
H H' : Subgraph G'
h : H ≤ H'
⊢ ∀ ⦃v w : V⦄, Adj (Subgraph.comap f H) v w → Adj (Subgraph.comap f H') v w

Next tactic:
intro v w
theorem comap_monotone {G' : SimpleGraph W} (f : G →g G') : Monotone (Subgraph.comap f) := by
  intro H H' h
  constructor
  · intro
    simp only [comap_verts, Set.mem_preimage]
    apply h.1
  · intro v w
    

Proof state:
case right
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G₁ G₂ : Subgraph G
a b : V
G' : SimpleGraph W
f : G →g G'
H H' : Subgraph G'
h : H ≤ H'
v w : V
⊢ Adj (Subgraph.comap f H) v w → Adj (Subgraph.comap f H') v w

Next tactic:
simp (config := { contextual := true }) only [comap_adj, and_imp, true_and_iff]
theorem comap_monotone {G' : SimpleGraph W} (f : G →g G') : Monotone (Subgraph.comap f) := by
  intro H H' h
  constructor
  · intro
    simp only [comap_verts, Set.mem_preimage]
    apply h.1
  · intro v w
    simp (config := { contextual := true }) only [comap_adj, and_imp, true_and_iff]
    

Proof state:
case right
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G₁ G₂ : Subgraph G
a b : V
G' : SimpleGraph W
f : G →g G'
H H' : Subgraph G'
h : H ≤ H'
v w : V
⊢ SimpleGraph.Adj G v w → Adj H (f v) (f w) → Adj H' (f v) (f w)

Next tactic:
intro
theorem comap_monotone {G' : SimpleGraph W} (f : G →g G') : Monotone (Subgraph.comap f) := by
  intro H H' h
  constructor
  · intro
    simp only [comap_verts, Set.mem_preimage]
    apply h.1
  · intro v w
    simp (config := { contextual := true }) only [comap_adj, and_imp, true_and_iff]
    intro
    

Proof state:
case right
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G₁ G₂ : Subgraph G
a b : V
G' : SimpleGraph W
f : G →g G'
H H' : Subgraph G'
h : H ≤ H'
v w : V
a✝ : SimpleGraph.Adj G v w
⊢ Adj H (f v) (f w) → Adj H' (f v) (f w)

Next tactic:
apply h.2
theorem map_le_iff_le_comap {G' : SimpleGraph W} (f : G →g G') (H : G.Subgraph) (H' : G'.Subgraph) :
    H.map f ≤ H' ↔ H ≤ H'.comap f := by
  

Proof state:
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G₁ G₂ : Subgraph G
a b : V
G' : SimpleGraph W
f : G →g G'
H : Subgraph G
H' : Subgraph G'
⊢ Subgraph.map f H ≤ H' ↔ H ≤ Subgraph.comap f H'

Next tactic:
refine' ⟨fun h ↦ ⟨fun v hv ↦ _, fun v w hvw ↦ _⟩, fun h ↦ ⟨fun v ↦ _, fun v w ↦ _⟩⟩
theorem map_le_iff_le_comap {G' : SimpleGraph W} (f : G →g G') (H : G.Subgraph) (H' : G'.Subgraph) :
    H.map f ≤ H' ↔ H ≤ H'.comap f := by
  refine' ⟨fun h ↦ ⟨fun v hv ↦ _, fun v w hvw ↦ _⟩, fun h ↦ ⟨fun v ↦ _, fun v w ↦ _⟩⟩
  · 

Proof state:
case refine'_1
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G₁ G₂ : Subgraph G
a b : V
G' : SimpleGraph W
f : G →g G'
H : Subgraph G
H' : Subgraph G'
h : Subgraph.map f H ≤ H'
v : V
hv : v ∈ H.verts
⊢ v ∈ (Subgraph.comap f H').verts

Next tactic:
simp only [comap_verts, Set.mem_preimage]
theorem map_le_iff_le_comap {G' : SimpleGraph W} (f : G →g G') (H : G.Subgraph) (H' : G'.Subgraph) :
    H.map f ≤ H' ↔ H ≤ H'.comap f := by
  refine' ⟨fun h ↦ ⟨fun v hv ↦ _, fun v w hvw ↦ _⟩, fun h ↦ ⟨fun v ↦ _, fun v w ↦ _⟩⟩
  · simp only [comap_verts, Set.mem_preimage]
    

Proof state:
case refine'_1
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G₁ G₂ : Subgraph G
a b : V
G' : SimpleGraph W
f : G →g G'
H : Subgraph G
H' : Subgraph G'
h : Subgraph.map f H ≤ H'
v : V
hv : v ∈ H.verts
⊢ f v ∈ H'.verts

Next tactic:
exact h.1 ⟨v, hv, rfl⟩
theorem map_le_iff_le_comap {G' : SimpleGraph W} (f : G →g G') (H : G.Subgraph) (H' : G'.Subgraph) :
    H.map f ≤ H' ↔ H ≤ H'.comap f := by
  refine' ⟨fun h ↦ ⟨fun v hv ↦ _, fun v w hvw ↦ _⟩, fun h ↦ ⟨fun v ↦ _, fun v w ↦ _⟩⟩
  · simp only [comap_verts, Set.mem_preimage]
    exact h.1 ⟨v, hv, rfl⟩
  · 

Proof state:
case refine'_2
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G₁ G₂ : Subgraph G
a b : V
G' : SimpleGraph W
f : G →g G'
H : Subgraph G
H' : Subgraph G'
h : Subgraph.map f H ≤ H'
v w : V
hvw : Adj H v w
⊢ Adj (Subgraph.comap f H') v w

Next tactic:
simp only [H.adj_sub hvw, comap_adj, true_and_iff]
theorem map_le_iff_le_comap {G' : SimpleGraph W} (f : G →g G') (H : G.Subgraph) (H' : G'.Subgraph) :
    H.map f ≤ H' ↔ H ≤ H'.comap f := by
  refine' ⟨fun h ↦ ⟨fun v hv ↦ _, fun v w hvw ↦ _⟩, fun h ↦ ⟨fun v ↦ _, fun v w ↦ _⟩⟩
  · simp only [comap_verts, Set.mem_preimage]
    exact h.1 ⟨v, hv, rfl⟩
  · simp only [H.adj_sub hvw, comap_adj, true_and_iff]
    

Proof state:
case refine'_2
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G₁ G₂ : Subgraph G
a b : V
G' : SimpleGraph W
f : G →g G'
H : Subgraph G
H' : Subgraph G'
h : Subgraph.map f H ≤ H'
v w : V
hvw : Adj H v w
⊢ Adj H' (f v) (f w)

Next tactic:
exact h.2 ⟨v, w, hvw, rfl, rfl⟩
theorem map_le_iff_le_comap {G' : SimpleGraph W} (f : G →g G') (H : G.Subgraph) (H' : G'.Subgraph) :
    H.map f ≤ H' ↔ H ≤ H'.comap f := by
  refine' ⟨fun h ↦ ⟨fun v hv ↦ _, fun v w hvw ↦ _⟩, fun h ↦ ⟨fun v ↦ _, fun v w ↦ _⟩⟩
  · simp only [comap_verts, Set.mem_preimage]
    exact h.1 ⟨v, hv, rfl⟩
  · simp only [H.adj_sub hvw, comap_adj, true_and_iff]
    exact h.2 ⟨v, w, hvw, rfl, rfl⟩
  · 

Proof state:
case refine'_3
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G₁ G₂ : Subgraph G
a b : V
G' : SimpleGraph W
f : G →g G'
H : Subgraph G
H' : Subgraph G'
h : H ≤ Subgraph.comap f H'
v : W
⊢ v ∈ (Subgraph.map f H).verts → v ∈ H'.verts

Next tactic:
simp only [map_verts, Set.mem_image, forall_exists_index, and_imp]
theorem map_le_iff_le_comap {G' : SimpleGraph W} (f : G →g G') (H : G.Subgraph) (H' : G'.Subgraph) :
    H.map f ≤ H' ↔ H ≤ H'.comap f := by
  refine' ⟨fun h ↦ ⟨fun v hv ↦ _, fun v w hvw ↦ _⟩, fun h ↦ ⟨fun v ↦ _, fun v w ↦ _⟩⟩
  · simp only [comap_verts, Set.mem_preimage]
    exact h.1 ⟨v, hv, rfl⟩
  · simp only [H.adj_sub hvw, comap_adj, true_and_iff]
    exact h.2 ⟨v, w, hvw, rfl, rfl⟩
  · simp only [map_verts, Set.mem_image, forall_exists_index, and_imp]
    

Proof state:
case refine'_3
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G₁ G₂ : Subgraph G
a b : V
G' : SimpleGraph W
f : G →g G'
H : Subgraph G
H' : Subgraph G'
h : H ≤ Subgraph.comap f H'
v : W
⊢ ∀ x ∈ H.verts, f x = v → v ∈ H'.verts

Next tactic:
rintro w hw rfl
theorem map_le_iff_le_comap {G' : SimpleGraph W} (f : G →g G') (H : G.Subgraph) (H' : G'.Subgraph) :
    H.map f ≤ H' ↔ H ≤ H'.comap f := by
  refine' ⟨fun h ↦ ⟨fun v hv ↦ _, fun v w hvw ↦ _⟩, fun h ↦ ⟨fun v ↦ _, fun v w ↦ _⟩⟩
  · simp only [comap_verts, Set.mem_preimage]
    exact h.1 ⟨v, hv, rfl⟩
  · simp only [H.adj_sub hvw, comap_adj, true_and_iff]
    exact h.2 ⟨v, w, hvw, rfl, rfl⟩
  · simp only [map_verts, Set.mem_image, forall_exists_index, and_imp]
    rintro w hw rfl
    

Proof state:
case refine'_3
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G₁ G₂ : Subgraph G
a b : V
G' : SimpleGraph W
f : G →g G'
H : Subgraph G
H' : Subgraph G'
h : H ≤ Subgraph.comap f H'
w : V
hw : w ∈ H.verts
⊢ f w ∈ H'.verts

Next tactic:
exact h.1 hw
theorem map_le_iff_le_comap {G' : SimpleGraph W} (f : G →g G') (H : G.Subgraph) (H' : G'.Subgraph) :
    H.map f ≤ H' ↔ H ≤ H'.comap f := by
  refine' ⟨fun h ↦ ⟨fun v hv ↦ _, fun v w hvw ↦ _⟩, fun h ↦ ⟨fun v ↦ _, fun v w ↦ _⟩⟩
  · simp only [comap_verts, Set.mem_preimage]
    exact h.1 ⟨v, hv, rfl⟩
  · simp only [H.adj_sub hvw, comap_adj, true_and_iff]
    exact h.2 ⟨v, w, hvw, rfl, rfl⟩
  · simp only [map_verts, Set.mem_image, forall_exists_index, and_imp]
    rintro w hw rfl
    exact h.1 hw
  · 

Proof state:
case refine'_4
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G₁ G₂ : Subgraph G
a b : V
G' : SimpleGraph W
f : G →g G'
H : Subgraph G
H' : Subgraph G'
h : H ≤ Subgraph.comap f H'
v w : W
⊢ Adj (Subgraph.map f H) v w → Adj H' v w

Next tactic:
simp only [Relation.Map, map_adj, forall_exists_index, and_imp]
theorem map_le_iff_le_comap {G' : SimpleGraph W} (f : G →g G') (H : G.Subgraph) (H' : G'.Subgraph) :
    H.map f ≤ H' ↔ H ≤ H'.comap f := by
  refine' ⟨fun h ↦ ⟨fun v hv ↦ _, fun v w hvw ↦ _⟩, fun h ↦ ⟨fun v ↦ _, fun v w ↦ _⟩⟩
  · simp only [comap_verts, Set.mem_preimage]
    exact h.1 ⟨v, hv, rfl⟩
  · simp only [H.adj_sub hvw, comap_adj, true_and_iff]
    exact h.2 ⟨v, w, hvw, rfl, rfl⟩
  · simp only [map_verts, Set.mem_image, forall_exists_index, and_imp]
    rintro w hw rfl
    exact h.1 hw
  · simp only [Relation.Map, map_adj, forall_exists_index, and_imp]
    

Proof state:
case refine'_4
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G₁ G₂ : Subgraph G
a b : V
G' : SimpleGraph W
f : G →g G'
H : Subgraph G
H' : Subgraph G'
h : H ≤ Subgraph.comap f H'
v w : W
⊢ ∀ (x x_1 : V), Adj H x x_1 → f x = v → f x_1 = w → Adj H' v w

Next tactic:
rintro u u' hu rfl rfl
theorem map_le_iff_le_comap {G' : SimpleGraph W} (f : G →g G') (H : G.Subgraph) (H' : G'.Subgraph) :
    H.map f ≤ H' ↔ H ≤ H'.comap f := by
  refine' ⟨fun h ↦ ⟨fun v hv ↦ _, fun v w hvw ↦ _⟩, fun h ↦ ⟨fun v ↦ _, fun v w ↦ _⟩⟩
  · simp only [comap_verts, Set.mem_preimage]
    exact h.1 ⟨v, hv, rfl⟩
  · simp only [H.adj_sub hvw, comap_adj, true_and_iff]
    exact h.2 ⟨v, w, hvw, rfl, rfl⟩
  · simp only [map_verts, Set.mem_image, forall_exists_index, and_imp]
    rintro w hw rfl
    exact h.1 hw
  · simp only [Relation.Map, map_adj, forall_exists_index, and_imp]
    rintro u u' hu rfl rfl
    

Proof state:
case refine'_4
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G₁ G₂ : Subgraph G
a b : V
G' : SimpleGraph W
f : G →g G'
H : Subgraph G
H' : Subgraph G'
h : H ≤ Subgraph.comap f H'
u u' : V
hu : Adj H u u'
⊢ Adj H' (f u) (f u')

Next tactic:
exact (h.2 hu).2
theorem inclusion.injective {x y : Subgraph G} (h : x ≤ y) : Function.Injective (inclusion h) := by
  

Proof state:
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G₁ G₂ : Subgraph G
a b : V
x y : Subgraph G
h : x ≤ y
⊢ Function.Injective ⇑(inclusion h)

Next tactic:
intro v w h
theorem inclusion.injective {x y : Subgraph G} (h : x ≤ y) : Function.Injective (inclusion h) := by
  intro v w h
  

Proof state:
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G₁ G₂ : Subgraph G
a b : V
x y : Subgraph G
h✝ : x ≤ y
v w : ↑x.verts
h : (inclusion h✝) v = (inclusion h✝) w
⊢ v = w

Next tactic:
rw [inclusion, FunLike.coe, Subtype.mk_eq_mk] at h
theorem inclusion.injective {x y : Subgraph G} (h : x ≤ y) : Function.Injective (inclusion h) := by
  intro v w h
  rw [inclusion, FunLike.coe, Subtype.mk_eq_mk] at h
  

Proof state:
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G₁ G₂ : Subgraph G
a b : V
x y : Subgraph G
h✝ : x ≤ y
v w : ↑x.verts
h :
  ↑(RelHomClass.toFunLike.1
        { toFun := fun v => { val := ↑v, property := (_ : ↑v ∈ y.verts) },
          map_rel' :=
            (_ :
              ∀ {a b : ↑x.verts},
                SimpleGraph.Adj (Subgraph.coe x) a b →
                  Adj y ↑((fun v => { val := ↑v, property := (_ : ↑v ∈ y.verts) }) a)
                    ↑((fun v => { val := ↑v, property := (_ : ↑v ∈ y.verts) }) b)) }
        v) =
    ↑(RelHomClass.toFunLike.1
        { toFun := fun v => { val := ↑v, property := (_ : ↑v ∈ y.verts) },
          map_rel' :=
            (_ :
              ∀ {a b : ↑x.verts},
                SimpleGraph.Adj (Subgraph.coe x) a b →
                  Adj y ↑((fun v => { val := ↑v, property := (_ : ↑v ∈ y.verts) }) a)
                    ↑((fun v => { val := ↑v, property := (_ : ↑v ∈ y.verts) }) b)) }
        w)
⊢ v = w

Next tactic:
exact Subtype.ext h
theorem IsSpanning.card_verts [Fintype V] {G' : Subgraph G} [Fintype G'.verts] (h : G'.IsSpanning) :
    G'.verts.toFinset.card = Fintype.card V := by
  

Proof state:
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G₁ G₂ : Subgraph G
a b : V
inst✝¹ : Fintype V
G' : Subgraph G
inst✝ : Fintype ↑G'.verts
h : IsSpanning G'
⊢ Finset.card (Set.toFinset G'.verts) = Fintype.card V

Next tactic:
simp only [isSpanning_iff.1 h, Set.toFinset_univ]
theorem IsSpanning.card_verts [Fintype V] {G' : Subgraph G} [Fintype G'.verts] (h : G'.IsSpanning) :
    G'.verts.toFinset.card = Fintype.card V := by
  simp only [isSpanning_iff.1 h, Set.toFinset_univ]
  

Proof state:
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G₁ G₂ : Subgraph G
a b : V
inst✝¹ : Fintype V
G' : Subgraph G
inst✝ : Fintype ↑G'.verts
h : IsSpanning G'
⊢ Finset.card Finset.univ = Fintype.card V

Next tactic:
congr
theorem finset_card_neighborSet_eq_degree {G' : Subgraph G} {v : V} [Fintype (G'.neighborSet v)] :
    (G'.neighborSet v).toFinset.card = G'.degree v := by
  

Proof state:
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G₁ G₂ : Subgraph G
a b : V
G' : Subgraph G
v : V
inst✝ : Fintype ↑(neighborSet G' v)
⊢ Finset.card (Set.toFinset (neighborSet G' v)) = degree G' v

Next tactic:
rw [degree, Set.toFinset_card]
theorem degree_le (G' : Subgraph G) (v : V) [Fintype (G'.neighborSet v)]
    [Fintype (G.neighborSet v)] : G'.degree v ≤ G.degree v := by
  

Proof state:
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G₁ G₂ : Subgraph G
a b : V
G' : Subgraph G
v : V
inst✝¹ : Fintype ↑(neighborSet G' v)
inst✝ : Fintype ↑(SimpleGraph.neighborSet G v)
⊢ degree G' v ≤ SimpleGraph.degree G v

Next tactic:
rw [← card_neighborSet_eq_degree]
theorem degree_le (G' : Subgraph G) (v : V) [Fintype (G'.neighborSet v)]
    [Fintype (G.neighborSet v)] : G'.degree v ≤ G.degree v := by
  rw [← card_neighborSet_eq_degree]
  

Proof state:
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G₁ G₂ : Subgraph G
a b : V
G' : Subgraph G
v : V
inst✝¹ : Fintype ↑(neighborSet G' v)
inst✝ : Fintype ↑(SimpleGraph.neighborSet G v)
⊢ degree G' v ≤ Fintype.card ↑(SimpleGraph.neighborSet G v)

Next tactic:
exact Set.card_le_of_subset (G'.neighborSet_subset v)
@[simp]
theorem coe_degree (G' : Subgraph G) (v : G'.verts) [Fintype (G'.coe.neighborSet v)]
    [Fintype (G'.neighborSet v)] : G'.coe.degree v = G'.degree v := by
  

Proof state:
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G₁ G₂ : Subgraph G
a b : V
G' : Subgraph G
v : ↑G'.verts
inst✝¹ : Fintype ↑(SimpleGraph.neighborSet (Subgraph.coe G') v)
inst✝ : Fintype ↑(neighborSet G' ↑v)
⊢ SimpleGraph.degree (Subgraph.coe G') v = degree G' ↑v

Next tactic:
rw [← card_neighborSet_eq_degree]
@[simp]
theorem coe_degree (G' : Subgraph G) (v : G'.verts) [Fintype (G'.coe.neighborSet v)]
    [Fintype (G'.neighborSet v)] : G'.coe.degree v = G'.degree v := by
  rw [← card_neighborSet_eq_degree]
  

Proof state:
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G₁ G₂ : Subgraph G
a b : V
G' : Subgraph G
v : ↑G'.verts
inst✝¹ : Fintype ↑(SimpleGraph.neighborSet (Subgraph.coe G') v)
inst✝ : Fintype ↑(neighborSet G' ↑v)
⊢ Fintype.card ↑(SimpleGraph.neighborSet (Subgraph.coe G') v) = degree G' ↑v

Next tactic:
exact Fintype.card_congr (coeNeighborSetEquiv v)
@[simp]
theorem degree_spanningCoe {G' : G.Subgraph} (v : V) [Fintype (G'.neighborSet v)]
    [Fintype (G'.spanningCoe.neighborSet v)] : G'.spanningCoe.degree v = G'.degree v := by
  

Proof state:
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G₁ G₂ : Subgraph G
a b : V
G' : Subgraph G
v : V
inst✝¹ : Fintype ↑(neighborSet G' v)
inst✝ : Fintype ↑(SimpleGraph.neighborSet (Subgraph.spanningCoe G') v)
⊢ SimpleGraph.degree (Subgraph.spanningCoe G') v = degree G' v

Next tactic:
rw [← card_neighborSet_eq_degree, Subgraph.degree]
@[simp]
theorem degree_spanningCoe {G' : G.Subgraph} (v : V) [Fintype (G'.neighborSet v)]
    [Fintype (G'.spanningCoe.neighborSet v)] : G'.spanningCoe.degree v = G'.degree v := by
  rw [← card_neighborSet_eq_degree, Subgraph.degree]
  

Proof state:
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G₁ G₂ : Subgraph G
a b : V
G' : Subgraph G
v : V
inst✝¹ : Fintype ↑(neighborSet G' v)
inst✝ : Fintype ↑(SimpleGraph.neighborSet (Subgraph.spanningCoe G') v)
⊢ Fintype.card ↑(SimpleGraph.neighborSet (Subgraph.spanningCoe G') v) = Fintype.card ↑(neighborSet G' v)

Next tactic:
congr!
theorem degree_eq_one_iff_unique_adj {G' : Subgraph G} {v : V} [Fintype (G'.neighborSet v)] :
    G'.degree v = 1 ↔ ∃! w : V, G'.Adj v w := by
  

Proof state:
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G₁ G₂ : Subgraph G
a b : V
G' : Subgraph G
v : V
inst✝ : Fintype ↑(neighborSet G' v)
⊢ degree G' v = 1 ↔ ∃! w, Adj G' v w

Next tactic:
rw [← finset_card_neighborSet_eq_degree, Finset.card_eq_one, Finset.singleton_iff_unique_mem]
theorem degree_eq_one_iff_unique_adj {G' : Subgraph G} {v : V} [Fintype (G'.neighborSet v)] :
    G'.degree v = 1 ↔ ∃! w : V, G'.Adj v w := by
  rw [← finset_card_neighborSet_eq_degree, Finset.card_eq_one, Finset.singleton_iff_unique_mem]
  

Proof state:
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G₁ G₂ : Subgraph G
a b : V
G' : Subgraph G
v : V
inst✝ : Fintype ↑(neighborSet G' v)
⊢ (∃! a, a ∈ Set.toFinset (neighborSet G' v)) ↔ ∃! w, Adj G' v w

Next tactic:
simp only [Set.mem_toFinset, mem_neighborSet]
@[simp]
theorem singletonSubgraph_le_iff (v : V) (H : G.Subgraph) :
    G.singletonSubgraph v ≤ H ↔ v ∈ H.verts := by
  

Proof state:
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G' : SimpleGraph W
v : V
H : Subgraph G
⊢ SimpleGraph.singletonSubgraph G v ≤ H ↔ v ∈ H.verts

Next tactic:
refine' ⟨fun h ↦ h.1 (Set.mem_singleton v), _⟩
@[simp]
theorem singletonSubgraph_le_iff (v : V) (H : G.Subgraph) :
    G.singletonSubgraph v ≤ H ↔ v ∈ H.verts := by
  refine' ⟨fun h ↦ h.1 (Set.mem_singleton v), _⟩
  

Proof state:
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G' : SimpleGraph W
v : V
H : Subgraph G
⊢ v ∈ H.verts → SimpleGraph.singletonSubgraph G v ≤ H

Next tactic:
intro h
@[simp]
theorem singletonSubgraph_le_iff (v : V) (H : G.Subgraph) :
    G.singletonSubgraph v ≤ H ↔ v ∈ H.verts := by
  refine' ⟨fun h ↦ h.1 (Set.mem_singleton v), _⟩
  intro h
  

Proof state:
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G' : SimpleGraph W
v : V
H : Subgraph G
h : v ∈ H.verts
⊢ SimpleGraph.singletonSubgraph G v ≤ H

Next tactic:
constructor
@[simp]
theorem singletonSubgraph_le_iff (v : V) (H : G.Subgraph) :
    G.singletonSubgraph v ≤ H ↔ v ∈ H.verts := by
  refine' ⟨fun h ↦ h.1 (Set.mem_singleton v), _⟩
  intro h
  constructor
  · 

Proof state:
case left
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G' : SimpleGraph W
v : V
H : Subgraph G
h : v ∈ H.verts
⊢ (SimpleGraph.singletonSubgraph G v).verts ⊆ H.verts

Next tactic:
rwa [singletonSubgraph_verts, Set.singleton_subset_iff]
@[simp]
theorem singletonSubgraph_le_iff (v : V) (H : G.Subgraph) :
    G.singletonSubgraph v ≤ H ↔ v ∈ H.verts := by
  refine' ⟨fun h ↦ h.1 (Set.mem_singleton v), _⟩
  intro h
  constructor
  · rwa [singletonSubgraph_verts, Set.singleton_subset_iff]
  · 

Proof state:
case right
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G' : SimpleGraph W
v : V
H : Subgraph G
h : v ∈ H.verts
⊢ ∀ ⦃v_1 w : V⦄, Subgraph.Adj (SimpleGraph.singletonSubgraph G v) v_1 w → Subgraph.Adj H v_1 w

Next tactic:
exact fun _ _ ↦ False.elim
@[simp]
theorem map_singletonSubgraph (f : G →g G') {v : V} :
    Subgraph.map f (G.singletonSubgraph v) = G'.singletonSubgraph (f v) := by
  

Proof state:
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G' : SimpleGraph W
f : G →g G'
v : V
⊢ Subgraph.map f (SimpleGraph.singletonSubgraph G v) = SimpleGraph.singletonSubgraph G' (f v)

Next tactic:
ext
@[simp]
theorem map_singletonSubgraph (f : G →g G') {v : V} :
    Subgraph.map f (G.singletonSubgraph v) = G'.singletonSubgraph (f v) := by
  ext <;> 

Proof state:
case verts.h
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G' : SimpleGraph W
f : G →g G'
v : V
x✝ : W
⊢ x✝ ∈ (Subgraph.map f (SimpleGraph.singletonSubgraph G v)).verts ↔ x✝ ∈ (SimpleGraph.singletonSubgraph G' (f v)).verts

Next tactic:
simp only [Relation.Map, Subgraph.map_adj, singletonSubgraph_adj, Pi.bot_apply,
    exists_and_left, and_iff_left_iff_imp, IsEmpty.forall_iff, Subgraph.map_verts,
    singletonSubgraph_verts, Set.image_singleton]
@[simp]
theorem map_singletonSubgraph (f : G →g G') {v : V} :
    Subgraph.map f (G.singletonSubgraph v) = G'.singletonSubgraph (f v) := by
  ext <;> 

Proof state:
case Adj.h.h.a
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G' : SimpleGraph W
f : G →g G'
v : V
x✝¹ x✝ : W
⊢ Subgraph.Adj (Subgraph.map f (SimpleGraph.singletonSubgraph G v)) x✝¹ x✝ ↔
    Subgraph.Adj (SimpleGraph.singletonSubgraph G' (f v)) x✝¹ x✝

Next tactic:
simp only [Relation.Map, Subgraph.map_adj, singletonSubgraph_adj, Pi.bot_apply,
    exists_and_left, and_iff_left_iff_imp, IsEmpty.forall_iff, Subgraph.map_verts,
    singletonSubgraph_verts, Set.image_singleton]
@[simp]
theorem map_singletonSubgraph (f : G →g G') {v : V} :
    Subgraph.map f (G.singletonSubgraph v) = G'.singletonSubgraph (f v) := by
  ext <;> simp only [Relation.Map, Subgraph.map_adj, singletonSubgraph_adj, Pi.bot_apply,
    exists_and_left, and_iff_left_iff_imp, IsEmpty.forall_iff, Subgraph.map_verts,
    singletonSubgraph_verts, Set.image_singleton]
  

Proof state:
case Adj.h.h.a
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G' : SimpleGraph W
f : G →g G'
v : V
x✝¹ x✝ : W
⊢ ⊥ → ∃ x, f x = x✝¹ ∧ ∃ x, f x = x✝

Next tactic:
exact False.elim
theorem eq_singletonSubgraph_iff_verts_eq (H : G.Subgraph) {v : V} :
    H = G.singletonSubgraph v ↔ H.verts = {v} := by
  

Proof state:
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G' : SimpleGraph W
H : Subgraph G
v : V
⊢ H = SimpleGraph.singletonSubgraph G v ↔ H.verts = {v}

Next tactic:
refine' ⟨fun h ↦ by rw [h, singletonSubgraph_verts], fun h ↦ _⟩
theorem eq_singletonSubgraph_iff_verts_eq (H : G.Subgraph) {v : V} :
    H = G.singletonSubgraph v ↔ H.verts = {v} := by
  refine' ⟨fun h ↦ by 

Proof state:
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G' : SimpleGraph W
H : Subgraph G
v : V
h : H = SimpleGraph.singletonSubgraph G v
⊢ H.verts = {v}

Next tactic:
rw [h, singletonSubgraph_verts]
theorem eq_singletonSubgraph_iff_verts_eq (H : G.Subgraph) {v : V} :
    H = G.singletonSubgraph v ↔ H.verts = {v} := by
  refine' ⟨fun h ↦ by rw [h, singletonSubgraph_verts], fun h ↦ _⟩
  

Proof state:
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G' : SimpleGraph W
H : Subgraph G
v : V
h : H.verts = {v}
⊢ H = SimpleGraph.singletonSubgraph G v

Next tactic:
ext
theorem eq_singletonSubgraph_iff_verts_eq (H : G.Subgraph) {v : V} :
    H = G.singletonSubgraph v ↔ H.verts = {v} := by
  refine' ⟨fun h ↦ by rw [h, singletonSubgraph_verts], fun h ↦ _⟩
  ext
  · 

Proof state:
case verts.h
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G' : SimpleGraph W
H : Subgraph G
v : V
h : H.verts = {v}
x✝ : V
⊢ x✝ ∈ H.verts ↔ x✝ ∈ (SimpleGraph.singletonSubgraph G v).verts

Next tactic:
rw [h, singletonSubgraph_verts]
theorem eq_singletonSubgraph_iff_verts_eq (H : G.Subgraph) {v : V} :
    H = G.singletonSubgraph v ↔ H.verts = {v} := by
  refine' ⟨fun h ↦ by rw [h, singletonSubgraph_verts], fun h ↦ _⟩
  ext
  · rw [h, singletonSubgraph_verts]
  · 

Proof state:
case Adj.h.h.a
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G' : SimpleGraph W
H : Subgraph G
v : V
h : H.verts = {v}
x✝¹ x✝ : V
⊢ Subgraph.Adj H x✝¹ x✝ ↔ Subgraph.Adj (SimpleGraph.singletonSubgraph G v) x✝¹ x✝

Next tactic:
simp only [Prop.bot_eq_false, singletonSubgraph_adj, Pi.bot_apply, iff_false_iff]
theorem eq_singletonSubgraph_iff_verts_eq (H : G.Subgraph) {v : V} :
    H = G.singletonSubgraph v ↔ H.verts = {v} := by
  refine' ⟨fun h ↦ by rw [h, singletonSubgraph_verts], fun h ↦ _⟩
  ext
  · rw [h, singletonSubgraph_verts]
  · simp only [Prop.bot_eq_false, singletonSubgraph_adj, Pi.bot_apply, iff_false_iff]
    

Proof state:
case Adj.h.h.a
ι : Sort u_1
V : Type u
W : Type v
G : SimpleGraph V
G' : SimpleGraph W
H : Subgraph G
v : V
h : H.verts = {v}
x✝¹ x✝ : V
⊢ ¬Subgraph.Adj H x✝¹ x✝

Next tactic:
intro ha