l3lab/ntp-mathlib huggingface dataset:
@[simp] lemma induceHom_comp :
    (induceHom ψ ψtr).comp (induceHom φ φst) = induceHom (ψ.comp φ) (ψtr.comp φst) := by
  

Proof state:
ι : Sort u_1
𝕜 : Type u_2
V : Type u
W : Type v
X : Type w
G : SimpleGraph V
G' : SimpleGraph W
a b c u v w : V
e : Sym2 V
G'' : SimpleGraph X
s : Set V
t : Set W
r : Set X
φ : G →g G'
φst : Set.MapsTo (⇑φ) s t
ψ : G' →g G''
ψtr : Set.MapsTo (⇑ψ) t r
⊢ Hom.comp (induceHom ψ ψtr) (induceHom φ φst) = induceHom (Hom.comp ψ φ) (_ : Set.MapsTo (⇑ψ ∘ fun x => φ x) s r)

Next tactic:
ext x
@[simp] lemma induceHom_comp :
    (induceHom ψ ψtr).comp (induceHom φ φst) = induceHom (ψ.comp φ) (ψtr.comp φst) := by
  ext x
  

Proof state:
case h.a
ι : Sort u_1
𝕜 : Type u_2
V : Type u
W : Type v
X : Type w
G : SimpleGraph V
G' : SimpleGraph W
a b c u v w : V
e : Sym2 V
G'' : SimpleGraph X
s : Set V
t : Set W
r : Set X
φ : G →g G'
φst : Set.MapsTo (⇑φ) s t
ψ : G' →g G''
ψtr : Set.MapsTo (⇑ψ) t r
x : ↑s
⊢ ↑((Hom.comp (induceHom ψ ψtr) (induceHom φ φst)) x) =
    ↑((induceHom (Hom.comp ψ φ) (_ : Set.MapsTo (⇑ψ ∘ fun x => φ x) s r)) x)

Next tactic:
rfl
lemma induceHom_injective (hi : Set.InjOn φ s) :
    Function.Injective (induceHom φ φst) := by
  

Proof state:
ι : Sort u_1
𝕜 : Type u_2
V : Type u
W : Type v
X : Type w
G : SimpleGraph V
G' : SimpleGraph W
a b c u v w : V
e : Sym2 V
G'' : SimpleGraph X
s : Set V
t : Set W
r : Set X
φ : G →g G'
φst : Set.MapsTo (⇑φ) s t
ψ : G' →g G''
ψtr : Set.MapsTo (⇑ψ) t r
hi : Set.InjOn (⇑φ) s
⊢ Injective ⇑(induceHom φ φst)

Next tactic:
erw [Set.MapsTo.restrict_inj]
lemma induceHom_injective (hi : Set.InjOn φ s) :
    Function.Injective (induceHom φ φst) := by
  erw [Set.MapsTo.restrict_inj] <;> 

Proof state:
ι : Sort u_1
𝕜 : Type u_2
V : Type u
W : Type v
X : Type w
G : SimpleGraph V
G' : SimpleGraph W
a b c u v w : V
e : Sym2 V
G'' : SimpleGraph X
s : Set V
t : Set W
r : Set X
φ : G →g G'
φst : Set.MapsTo (⇑φ) s t
ψ : G' →g G''
ψtr : Set.MapsTo (⇑ψ) t r
hi : Set.InjOn (⇑φ) s
⊢ Set.InjOn (⇑φ) s

Next tactic:
assumption
lemma induceHom_injective (hi : Set.InjOn φ s) :
    Function.Injective (induceHom φ φst) := by
  erw [Set.MapsTo.restrict_inj] <;> 

Proof state:
ι : Sort u_1
𝕜 : Type u_2
V : Type u
W : Type v
X : Type w
G : SimpleGraph V
G' : SimpleGraph W
a b c u v w : V
e : Sym2 V
G'' : SimpleGraph X
s : Set V
t : Set W
r : Set X
φ : G →g G'
φst : Set.MapsTo (⇑φ) s t
ψ : G' →g G''
ψtr : Set.MapsTo (⇑ψ) t r
hi : Set.InjOn (⇑φ) s
⊢ Set.MapsTo (⇑φ) s t

Next tactic:
assumption
/-- Given an inclusion of vertex subsets, the induced embedding on induced graphs.
This is not an abbreviation for `induceHom` since we get an embedding in this case. -/
def induceHomOfLE (h : s ≤ s') : G.induce s ↪g G.induce s' where
  toEmbedding := Set.embeddingOfSubset s s' h
  map_rel_iff' := by 

Proof state:
ι : Sort u_1
𝕜 : Type u_2
V : Type u
W : Type v
X : Type w
G : SimpleGraph V
G' : SimpleGraph W
a b c u v w : V
e : Sym2 V
s s' : Set V
h✝ h : s ≤ s'
⊢ ∀ {a b : ↑s},
    Adj (induce s' G) ((Set.embeddingOfSubset s s' h) a) ((Set.embeddingOfSubset s s' h) b) ↔ Adj (induce s G) a b

Next tactic:
simp
@[simp] lemma induceHomOfLE_toHom :
    (G.induceHomOfLE h).toHom = induceHom (.id : G →g G) ((Set.mapsTo_id s).mono_right h) := by
  

Proof state:
ι : Sort u_1
𝕜 : Type u_2
V : Type u
W : Type v
X : Type w
G : SimpleGraph V
G' : SimpleGraph W
a b c u v w : V
e : Sym2 V
s s' : Set V
h : s ≤ s'
⊢ Embedding.toHom (induceHomOfLE G h) = induceHom Hom.id (_ : Set.MapsTo id s s')

Next tactic:
ext
@[simp] lemma induceHomOfLE_toHom :
    (G.induceHomOfLE h).toHom = induceHom (.id : G →g G) ((Set.mapsTo_id s).mono_right h) := by
  ext; 

Proof state:
case h.a
ι : Sort u_1
𝕜 : Type u_2
V : Type u
W : Type v
X : Type w
G : SimpleGraph V
G' : SimpleGraph W
a b c u v w : V
e : Sym2 V
s s' : Set V
h : s ≤ s'
x✝ : ↑s
⊢ ↑((Embedding.toHom (induceHomOfLE G h)) x✝) = ↑((induceHom Hom.id (_ : Set.MapsTo id s s')) x✝)

Next tactic:
simp
/-- An isomorphism of graphs induces an equivalence of edge sets. -/
@[simps]
def mapEdgeSet : G.edgeSet ≃ G'.edgeSet
    where
  toFun := Hom.mapEdgeSet f
  invFun := Hom.mapEdgeSet f.symm
  left_inv := by
    

Proof state:
ι : Sort u_1
𝕜 : Type u_2
V : Type u
W : Type v
X : Type w
G : SimpleGraph V
G' : SimpleGraph W
a b c u v w : V
e : Sym2 V
f : G ≃g G'
⊢ LeftInverse (Hom.mapEdgeSet (RelEmbedding.toRelHom (RelIso.toRelEmbedding (symm f))))
    (Hom.mapEdgeSet (RelEmbedding.toRelHom (RelIso.toRelEmbedding f)))

Next tactic:
rintro ⟨e, h⟩
/-- An isomorphism of graphs induces an equivalence of edge sets. -/
@[simps]
def mapEdgeSet : G.edgeSet ≃ G'.edgeSet
    where
  toFun := Hom.mapEdgeSet f
  invFun := Hom.mapEdgeSet f.symm
  left_inv := by
    rintro ⟨e, h⟩
    

Proof state:
case mk
ι : Sort u_1
𝕜 : Type u_2
V : Type u
W : Type v
X : Type w
G : SimpleGraph V
G' : SimpleGraph W
a b c u v w : V
e✝ : Sym2 V
f : G ≃g G'
e : Sym2 V
h : e ∈ edgeSet G
⊢ Hom.mapEdgeSet (RelEmbedding.toRelHom (RelIso.toRelEmbedding (symm f)))
      (Hom.mapEdgeSet (RelEmbedding.toRelHom (RelIso.toRelEmbedding f)) { val := e, property := h }) =
    { val := e, property := h }

Next tactic:
simp only [Hom.mapEdgeSet, RelEmbedding.toRelHom, Embedding.toFun_eq_coe,
      RelEmbedding.coe_toEmbedding, RelIso.coe_toRelEmbedding, Sym2.map_map, comp_apply,
      Subtype.mk.injEq]
/-- An isomorphism of graphs induces an equivalence of edge sets. -/
@[simps]
def mapEdgeSet : G.edgeSet ≃ G'.edgeSet
    where
  toFun := Hom.mapEdgeSet f
  invFun := Hom.mapEdgeSet f.symm
  left_inv := by
    rintro ⟨e, h⟩
    simp only [Hom.mapEdgeSet, RelEmbedding.toRelHom, Embedding.toFun_eq_coe,
      RelEmbedding.coe_toEmbedding, RelIso.coe_toRelEmbedding, Sym2.map_map, comp_apply,
      Subtype.mk.injEq]
    

Proof state:
case mk
ι : Sort u_1
𝕜 : Type u_2
V : Type u
W : Type v
X : Type w
G : SimpleGraph V
G' : SimpleGraph W
a b c u v w : V
e✝ : Sym2 V
f : G ≃g G'
e : Sym2 V
h : e ∈ edgeSet G
⊢ Sym2.map
      (fun x =>
        { toFun := ⇑(symm f), map_rel' := (_ : ∀ {a b : W}, Adj G' a b → Adj G ((symm f) a) ((symm f) b)) }
          ({ toFun := ⇑f, map_rel' := (_ : ∀ {a b : V}, Adj G a b → Adj G' (f a) (f b)) } x))
      e =
    e

Next tactic:
convert congr_fun Sym2.map_id e
/-- An isomorphism of graphs induces an equivalence of edge sets. -/
@[simps]
def mapEdgeSet : G.edgeSet ≃ G'.edgeSet
    where
  toFun := Hom.mapEdgeSet f
  invFun := Hom.mapEdgeSet f.symm
  left_inv := by
    rintro ⟨e, h⟩
    simp only [Hom.mapEdgeSet, RelEmbedding.toRelHom, Embedding.toFun_eq_coe,
      RelEmbedding.coe_toEmbedding, RelIso.coe_toRelEmbedding, Sym2.map_map, comp_apply,
      Subtype.mk.injEq]
    convert congr_fun Sym2.map_id e
    

Proof state:
case h.e'_2.h
ι : Sort u_1
𝕜 : Type u_2
V : Type u
W : Type v
X : Type w
G : SimpleGraph V
G' : SimpleGraph W
a b c u v w : V
e✝ : Sym2 V
f : G ≃g G'
e : Sym2 V
h : e ∈ edgeSet G
x✝ : V
a✝ : x✝ ∈ e
⊢ { toFun := ⇑(symm f), map_rel' := (_ : ∀ {a b : W}, Adj G' a b → Adj G ((symm f) a) ((symm f) b)) }
      ({ toFun := ⇑f, map_rel' := (_ : ∀ {a b : V}, Adj G a b → Adj G' (f a) (f b)) } x✝) =
    id x✝

Next tactic:
exact RelIso.symm_apply_apply _ _
/-- An isomorphism of graphs induces an equivalence of edge sets. -/
@[simps]
def mapEdgeSet : G.edgeSet ≃ G'.edgeSet
    where
  toFun := Hom.mapEdgeSet f
  invFun := Hom.mapEdgeSet f.symm
  left_inv := by
    rintro ⟨e, h⟩
    simp only [Hom.mapEdgeSet, RelEmbedding.toRelHom, Embedding.toFun_eq_coe,
      RelEmbedding.coe_toEmbedding, RelIso.coe_toRelEmbedding, Sym2.map_map, comp_apply,
      Subtype.mk.injEq]
    convert congr_fun Sym2.map_id e
    exact RelIso.symm_apply_apply _ _
  right_inv := by
    

Proof state:
ι : Sort u_1
𝕜 : Type u_2
V : Type u
W : Type v
X : Type w
G : SimpleGraph V
G' : SimpleGraph W
a b c u v w : V
e : Sym2 V
f : G ≃g G'
⊢ Function.RightInverse (Hom.mapEdgeSet (RelEmbedding.toRelHom (RelIso.toRelEmbedding (symm f))))
    (Hom.mapEdgeSet (RelEmbedding.toRelHom (RelIso.toRelEmbedding f)))

Next tactic:
rintro ⟨e, h⟩
/-- An isomorphism of graphs induces an equivalence of edge sets. -/
@[simps]
def mapEdgeSet : G.edgeSet ≃ G'.edgeSet
    where
  toFun := Hom.mapEdgeSet f
  invFun := Hom.mapEdgeSet f.symm
  left_inv := by
    rintro ⟨e, h⟩
    simp only [Hom.mapEdgeSet, RelEmbedding.toRelHom, Embedding.toFun_eq_coe,
      RelEmbedding.coe_toEmbedding, RelIso.coe_toRelEmbedding, Sym2.map_map, comp_apply,
      Subtype.mk.injEq]
    convert congr_fun Sym2.map_id e
    exact RelIso.symm_apply_apply _ _
  right_inv := by
    rintro ⟨e, h⟩
    

Proof state:
case mk
ι : Sort u_1
𝕜 : Type u_2
V : Type u
W : Type v
X : Type w
G : SimpleGraph V
G' : SimpleGraph W
a b c u v w : V
e✝ : Sym2 V
f : G ≃g G'
e : Sym2 W
h : e ∈ edgeSet G'
⊢ Hom.mapEdgeSet (RelEmbedding.toRelHom (RelIso.toRelEmbedding f))
      (Hom.mapEdgeSet (RelEmbedding.toRelHom (RelIso.toRelEmbedding (symm f))) { val := e, property := h }) =
    { val := e, property := h }

Next tactic:
simp only [Hom.mapEdgeSet, RelEmbedding.toRelHom, Embedding.toFun_eq_coe,
      RelEmbedding.coe_toEmbedding, RelIso.coe_toRelEmbedding, Sym2.map_map, comp_apply,
      Subtype.mk.injEq]
/-- An isomorphism of graphs induces an equivalence of edge sets. -/
@[simps]
def mapEdgeSet : G.edgeSet ≃ G'.edgeSet
    where
  toFun := Hom.mapEdgeSet f
  invFun := Hom.mapEdgeSet f.symm
  left_inv := by
    rintro ⟨e, h⟩
    simp only [Hom.mapEdgeSet, RelEmbedding.toRelHom, Embedding.toFun_eq_coe,
      RelEmbedding.coe_toEmbedding, RelIso.coe_toRelEmbedding, Sym2.map_map, comp_apply,
      Subtype.mk.injEq]
    convert congr_fun Sym2.map_id e
    exact RelIso.symm_apply_apply _ _
  right_inv := by
    rintro ⟨e, h⟩
    simp only [Hom.mapEdgeSet, RelEmbedding.toRelHom, Embedding.toFun_eq_coe,
      RelEmbedding.coe_toEmbedding, RelIso.coe_toRelEmbedding, Sym2.map_map, comp_apply,
      Subtype.mk.injEq]
    

Proof state:
case mk
ι : Sort u_1
𝕜 : Type u_2
V : Type u
W : Type v
X : Type w
G : SimpleGraph V
G' : SimpleGraph W
a b c u v w : V
e✝ : Sym2 V
f : G ≃g G'
e : Sym2 W
h : e ∈ edgeSet G'
⊢ Sym2.map
      (fun x =>
        { toFun := ⇑f, map_rel' := (_ : ∀ {a b : V}, Adj G a b → Adj G' (f a) (f b)) }
          ({ toFun := ⇑(symm f), map_rel' := (_ : ∀ {a b : W}, Adj G' a b → Adj G ((symm f) a) ((symm f) b)) } x))
      e =
    e

Next tactic:
convert congr_fun Sym2.map_id e
/-- An isomorphism of graphs induces an equivalence of edge sets. -/
@[simps]
def mapEdgeSet : G.edgeSet ≃ G'.edgeSet
    where
  toFun := Hom.mapEdgeSet f
  invFun := Hom.mapEdgeSet f.symm
  left_inv := by
    rintro ⟨e, h⟩
    simp only [Hom.mapEdgeSet, RelEmbedding.toRelHom, Embedding.toFun_eq_coe,
      RelEmbedding.coe_toEmbedding, RelIso.coe_toRelEmbedding, Sym2.map_map, comp_apply,
      Subtype.mk.injEq]
    convert congr_fun Sym2.map_id e
    exact RelIso.symm_apply_apply _ _
  right_inv := by
    rintro ⟨e, h⟩
    simp only [Hom.mapEdgeSet, RelEmbedding.toRelHom, Embedding.toFun_eq_coe,
      RelEmbedding.coe_toEmbedding, RelIso.coe_toRelEmbedding, Sym2.map_map, comp_apply,
      Subtype.mk.injEq]
    convert congr_fun Sym2.map_id e
    

Proof state:
case h.e'_2.h
ι : Sort u_1
𝕜 : Type u_2
V : Type u
W : Type v
X : Type w
G : SimpleGraph V
G' : SimpleGraph W
a b c u v w : V
e✝ : Sym2 V
f : G ≃g G'
e : Sym2 W
h : e ∈ edgeSet G'
x✝ : W
a✝ : x✝ ∈ e
⊢ { toFun := ⇑f, map_rel' := (_ : ∀ {a b : V}, Adj G a b → Adj G' (f a) (f b)) }
      ({ toFun := ⇑(symm f), map_rel' := (_ : ∀ {a b : W}, Adj G' a b → Adj G ((symm f) a) ((symm f) b)) } x✝) =
    id x✝

Next tactic:
exact RelIso.apply_symm_apply _ _
/-- A graph isomorphism induces an equivalence of neighbor sets. -/
@[simps]
def mapNeighborSet (v : V) : G.neighborSet v ≃ G'.neighborSet (f v)
    where
  toFun w := ⟨f w, f.apply_mem_neighborSet_iff.mpr w.2⟩
  invFun w :=
    ⟨f.symm w, by
      

Proof state:
ι : Sort u_1
𝕜 : Type u_2
V : Type u
W : Type v
X : Type w
G : SimpleGraph V
G' : SimpleGraph W
a b c u v✝ w✝ : V
e : Sym2 V
f : G ≃g G'
v : V
w : ↑(neighborSet G' (f v))
⊢ (symm f) ↑w ∈ neighborSet G v

Next tactic:
simpa [RelIso.symm_apply_apply] using f.symm.apply_mem_neighborSet_iff.mpr w.2
/-- A graph isomorphism induces an equivalence of neighbor sets. -/
@[simps]
def mapNeighborSet (v : V) : G.neighborSet v ≃ G'.neighborSet (f v)
    where
  toFun w := ⟨f w, f.apply_mem_neighborSet_iff.mpr w.2⟩
  invFun w :=
    ⟨f.symm w, by
      simpa [RelIso.symm_apply_apply] using f.symm.apply_mem_neighborSet_iff.mpr w.2⟩
  left_inv w := by 

Proof state:
ι : Sort u_1
𝕜 : Type u_2
V : Type u
W : Type v
X : Type w
G : SimpleGraph V
G' : SimpleGraph W
a b c u v✝ w✝ : V
e : Sym2 V
f : G ≃g G'
v : V
w : ↑(neighborSet G v)
⊢ (fun w => { val := (symm f) ↑w, property := (_ : (symm f) ↑w ∈ neighborSet G v) })
      ((fun w => { val := f ↑w, property := (_ : f ↑w ∈ neighborSet G' (f v)) }) w) =
    w

Next tactic:
simp
/-- A graph isomorphism induces an equivalence of neighbor sets. -/
@[simps]
def mapNeighborSet (v : V) : G.neighborSet v ≃ G'.neighborSet (f v)
    where
  toFun w := ⟨f w, f.apply_mem_neighborSet_iff.mpr w.2⟩
  invFun w :=
    ⟨f.symm w, by
      simpa [RelIso.symm_apply_apply] using f.symm.apply_mem_neighborSet_iff.mpr w.2⟩
  left_inv w := by simp
  right_inv w := by 

Proof state:
ι : Sort u_1
𝕜 : Type u_2
V : Type u
W : Type v
X : Type w
G : SimpleGraph V
G' : SimpleGraph W
a b c u v✝ w✝ : V
e : Sym2 V
f : G ≃g G'
v : V
w : ↑(neighborSet G' (f v))
⊢ (fun w => { val := f ↑w, property := (_ : f ↑w ∈ neighborSet G' (f v)) })
      ((fun w => { val := (symm f) ↑w, property := (_ : (symm f) ↑w ∈ neighborSet G v) }) w) =
    w

Next tactic:
simp
theorem card_eq_of_iso [Fintype V] [Fintype W] (f : G ≃g G') : Fintype.card V = Fintype.card W := by
  

Proof state:
ι : Sort u_1
𝕜 : Type u_2
V : Type u
W : Type v
X : Type w
G : SimpleGraph V
G' : SimpleGraph W
a b c u v w : V
e : Sym2 V
f✝ : G ≃g G'
inst✝¹ : Fintype V
inst✝ : Fintype W
f : G ≃g G'
⊢ Fintype.card V = Fintype.card W

Next tactic:
rw [← Fintype.ofEquiv_card f.toEquiv]
theorem card_eq_of_iso [Fintype V] [Fintype W] (f : G ≃g G') : Fintype.card V = Fintype.card W := by
  rw [← Fintype.ofEquiv_card f.toEquiv]
  -- porting note: need to help it to find the typeclass instances from the target expression
  

Proof state:
ι : Sort u_1
𝕜 : Type u_2
V : Type u
W : Type v
X : Type w
G : SimpleGraph V
G' : SimpleGraph W
a b c u v w : V
e : Sym2 V
f✝ : G ≃g G'
inst✝¹ : Fintype V
inst✝ : Fintype W
f : G ≃g G'
⊢ Fintype.card W = Fintype.card W

Next tactic:
apply @Fintype.card_congr' _ _ (_) (_) rfl
/-- Given a bijection, there is an embedding from the comapped graph into the original
graph. -/
-- porting note: `@[simps]` does not work here anymore since `f` is not a constructor application.
-- `@[simps toEmbedding]` could work, but Floris suggested writing `comap_apply` for now.
protected def comap (f : V ≃ W) (G : SimpleGraph W) : G.comap f.toEmbedding ≃g G :=
  { f with map_rel_iff' := by 

Proof state:
ι : Sort u_1
𝕜 : Type u_2
V : Type u
W : Type v
X : Type w
G✝ : SimpleGraph V
G' : SimpleGraph W
a b c u v w : V
e : Sym2 V
f✝ : G✝ ≃g G'
f : V ≃ W
G : SimpleGraph W
⊢ ∀ {a b : V},
    Adj G
        ({ toFun := f.toFun, invFun := f.invFun, left_inv := (_ : LeftInverse f.invFun f.toFun),
            right_inv := (_ : Function.RightInverse f.invFun f.toFun) }
          a)
        ({ toFun := f.toFun, invFun := f.invFun, left_inv := (_ : LeftInverse f.invFun f.toFun),
            right_inv := (_ : Function.RightInverse f.invFun f.toFun) }
          b) ↔
      Adj (SimpleGraph.comap (⇑(Equiv.toEmbedding f)) G) a b

Next tactic:
simp
/-- Given an injective function, there is an embedding from a graph into the mapped graph. -/
-- porting note: `@[simps]` does not work here anymore since `f` is not a constructor application.
-- `@[simps toEmbedding]` could work, but Floris suggested writing `map_apply` for now.
protected def map (f : V ≃ W) (G : SimpleGraph V) : G ≃g G.map f.toEmbedding :=
  { f with map_rel_iff' := by 

Proof state:
ι : Sort u_1
𝕜 : Type u_2
V : Type u
W : Type v
X : Type w
G✝ : SimpleGraph V
G' : SimpleGraph W
a b c u v w : V
e : Sym2 V
f✝ : G✝ ≃g G'
f : V ≃ W
G : SimpleGraph V
⊢ ∀ {a b : V},
    Adj (SimpleGraph.map (Equiv.toEmbedding f) G)
        ({ toFun := f.toFun, invFun := f.invFun, left_inv := (_ : LeftInverse f.invFun f.toFun),
            right_inv := (_ : Function.RightInverse f.invFun f.toFun) }
          a)
        ({ toFun := f.toFun, invFun := f.invFun, left_inv := (_ : LeftInverse f.invFun f.toFun),
            right_inv := (_ : Function.RightInverse f.invFun f.toFun) }
          b) ↔
      Adj G a b

Next tactic:
simp
/-- Equivalences of types induce isomorphisms of complete graphs on those types. -/
protected def completeGraph {α β : Type*} (f : α ≃ β) :
    (⊤ : SimpleGraph α) ≃g (⊤ : SimpleGraph β) :=
  { f with map_rel_iff' := by 

Proof state:
ι : Sort u_1
𝕜 : Type u_2
V : Type u
W : Type v
X : Type w
G : SimpleGraph V
G' : SimpleGraph W
a b c u v w : V
e : Sym2 V
f✝ : G ≃g G'
α : Type u_3
β : Type u_4
f : α ≃ β
⊢ ∀ {a b : α},
    Adj ⊤
        ({ toFun := f.toFun, invFun := f.invFun, left_inv := (_ : LeftInverse f.invFun f.toFun),
            right_inv := (_ : Function.RightInverse f.invFun f.toFun) }
          a)
        ({ toFun := f.toFun, invFun := f.invFun, left_inv := (_ : LeftInverse f.invFun f.toFun),
            right_inv := (_ : Function.RightInverse f.invFun f.toFun) }
          b) ↔
      Adj ⊤ a b

Next tactic:
simp
/-- The graph induced on `Set.univ` is isomorphic to the original graph. -/
@[simps!]
def induceUnivIso (G : SimpleGraph V) : G.induce Set.univ ≃g G where
  toEquiv := Equiv.Set.univ V
  map_rel_iff' := by 

Proof state:
ι : Sort u_1
𝕜 : Type u_2
V : Type u
W : Type v
X : Type w
G✝ : SimpleGraph V
G' : SimpleGraph W
a b c u v w : V
e : Sym2 V
G : SimpleGraph V
⊢ ∀ {a b : ↑Set.univ}, Adj G ((Equiv.Set.univ V) a) ((Equiv.Set.univ V) b) ↔ Adj (induce Set.univ G) a b

Next tactic:
simp only [Equiv.Set.univ, Equiv.coe_fn_mk, comap_adj, Embedding.coe_subtype,
                                Subtype.forall, Set.mem_univ, forall_true_left, implies_true]
/-- Scott-continuity takes on a simpler form in complete partial orders. -/
lemma CompletePartialOrder.scottContinuous {f : α → β} :
    ScottContinuous f ↔
    ∀ ⦃d : Set α⦄, d.Nonempty → DirectedOn (. ≤ .) d → IsLUB (f '' d) (f (sSup d)) := by
  

Proof state:
ι : Sort u_1
α : Type u_2
β : Type u_3
inst✝¹ : CompletePartialOrder α
inst✝ : Preorder β
f✝ : ι → α
d : Set α
a : α
f : α → β
⊢ ScottContinuous f ↔ ∀ ⦃d : Set α⦄, Set.Nonempty d → DirectedOn (fun x x_1 => x ≤ x_1) d → IsLUB (f '' d) (f (sSup d))

Next tactic:
refine' ⟨λ h d hd₁ hd₂ ↦ h hd₁ hd₂ hd₂.isLUB_sSup, λ h d hne hd a hda ↦ _⟩
/-- Scott-continuity takes on a simpler form in complete partial orders. -/
lemma CompletePartialOrder.scottContinuous {f : α → β} :
    ScottContinuous f ↔
    ∀ ⦃d : Set α⦄, d.Nonempty → DirectedOn (. ≤ .) d → IsLUB (f '' d) (f (sSup d)) := by
  refine' ⟨λ h d hd₁ hd₂ ↦ h hd₁ hd₂ hd₂.isLUB_sSup, λ h d hne hd a hda ↦ _⟩
  

Proof state:
ι : Sort u_1
α : Type u_2
β : Type u_3
inst✝¹ : CompletePartialOrder α
inst✝ : Preorder β
f✝ : ι → α
d✝ : Set α
a✝ : α
f : α → β
h : ∀ ⦃d : Set α⦄, Set.Nonempty d → DirectedOn (fun x x_1 => x ≤ x_1) d → IsLUB (f '' d) (f (sSup d))
d : Set α
hne : Set.Nonempty d
hd : DirectedOn (fun x x_1 => x ≤ x_1) d
a : α
hda : IsLUB d a
⊢ IsLUB (f '' d) (f a)

Next tactic:
rw [hda.unique hd.isLUB_sSup]
/-- Scott-continuity takes on a simpler form in complete partial orders. -/
lemma CompletePartialOrder.scottContinuous {f : α → β} :
    ScottContinuous f ↔
    ∀ ⦃d : Set α⦄, d.Nonempty → DirectedOn (. ≤ .) d → IsLUB (f '' d) (f (sSup d)) := by
  refine' ⟨λ h d hd₁ hd₂ ↦ h hd₁ hd₂ hd₂.isLUB_sSup, λ h d hne hd a hda ↦ _⟩
  rw [hda.unique hd.isLUB_sSup]
  

Proof state:
ι : Sort u_1
α : Type u_2
β : Type u_3
inst✝¹ : CompletePartialOrder α
inst✝ : Preorder β
f✝ : ι → α
d✝ : Set α
a✝ : α
f : α → β
h : ∀ ⦃d : Set α⦄, Set.Nonempty d → DirectedOn (fun x x_1 => x ≤ x_1) d → IsLUB (f '' d) (f (sSup d))
d : Set α
hne : Set.Nonempty d
hd : DirectedOn (fun x x_1 => x ≤ x_1) d
a : α
hda : IsLUB d a
⊢ IsLUB (f '' d) (f (sSup d))

Next tactic:
exact h hne hd
@[simp] theorem encard_univ_coe (s : Set α) : encard (univ : Set s) = encard s := by
  

Proof state:
α : Type u_1
s✝ t s : Set α
⊢ encard univ = encard s

Next tactic:
rw [encard, encard, PartENat.card_congr (Equiv.Set.univ ↑s)]
theorem encard_univ (α : Type*) :
    encard (univ : Set α) = PartENat.withTopEquiv (PartENat.card α) := by
  

Proof state:
α✝ : Type ?u.610
s t : Set α✝
α : Type u_1
⊢ encard univ = PartENat.withTopEquiv (PartENat.card α)

Next tactic:
rw [encard, PartENat.card_congr (Equiv.Set.univ α)]
theorem Finite.encard_eq_coe_toFinset_card (h : s.Finite) : s.encard = h.toFinset.card := by
  

Proof state:
α : Type u_1
s t : Set α
h : Set.Finite s
⊢ encard s = ↑(Finset.card (Finite.toFinset h))

Next tactic:
have := h.fintype
theorem Finite.encard_eq_coe_toFinset_card (h : s.Finite) : s.encard = h.toFinset.card := by
  have := h.fintype
  

Proof state:
α : Type u_1
s t : Set α
h : Set.Finite s
this : Fintype ↑s
⊢ encard s = ↑(Finset.card (Finite.toFinset h))

Next tactic:
rw [encard, PartENat.card_eq_coe_fintype_card,
    PartENat.withTopEquiv_natCast, toFinite_toFinset, toFinset_card]
theorem encard_eq_coe_toFinset_card (s : Set α) [Fintype s] : encard s = s.toFinset.card := by
  

Proof state:
α : Type u_1
s✝ t s : Set α
inst✝ : Fintype ↑s
⊢ encard s = ↑(Finset.card (toFinset s))

Next tactic:
have h := toFinite s
theorem encard_eq_coe_toFinset_card (s : Set α) [Fintype s] : encard s = s.toFinset.card := by
  have h := toFinite s
  

Proof state:
α : Type u_1
s✝ t s : Set α
inst✝ : Fintype ↑s
h : Set.Finite s
⊢ encard s = ↑(Finset.card (toFinset s))

Next tactic:
rw [h.encard_eq_coe_toFinset_card, toFinite_toFinset, toFinset_card]
theorem encard_coe_eq_coe_finsetCard (s : Finset α) : encard (s : Set α) = s.card := by
  

Proof state:
α : Type u_1
s✝ t : Set α
s : Finset α
⊢ encard ↑s = ↑(Finset.card s)

Next tactic:
rw [Finite.encard_eq_coe_toFinset_card (Finset.finite_toSet s)]
theorem encard_coe_eq_coe_finsetCard (s : Finset α) : encard (s : Set α) = s.card := by
  rw [Finite.encard_eq_coe_toFinset_card (Finset.finite_toSet s)]; 

Proof state:
α : Type u_1
s✝ t : Set α
s : Finset α
⊢ ↑(Finset.card (Finite.toFinset (_ : Set.Finite ↑s))) = ↑(Finset.card s)

Next tactic:
simp
theorem Infinite.encard_eq {s : Set α} (h : s.Infinite) : s.encard = ⊤ := by
  

Proof state:
α : Type u_1
s✝ t s : Set α
h : Set.Infinite s
⊢ encard s = ⊤

Next tactic:
have := h.to_subtype
theorem Infinite.encard_eq {s : Set α} (h : s.Infinite) : s.encard = ⊤ := by
  have := h.to_subtype
  

Proof state:
α : Type u_1
s✝ t s : Set α
h : Set.Infinite s
this : Infinite ↑s
⊢ encard s = ⊤

Next tactic:
rw [encard, ← PartENat.withTopEquiv.symm.injective.eq_iff, Equiv.symm_apply_apply,
    PartENat.withTopEquiv_symm_top, PartENat.card_eq_top_of_infinite]
@[simp] theorem encard_eq_zero : s.encard = 0 ↔ s = ∅ := by
  

Proof state:
α : Type u_1
s t : Set α
⊢ encard s = 0 ↔ s = ∅

Next tactic:
rw [encard, ← PartENat.withTopEquiv.symm.injective.eq_iff, Equiv.symm_apply_apply,
    PartENat.withTopEquiv_symm_zero, PartENat.card_eq_zero_iff_empty, isEmpty_subtype,
    eq_empty_iff_forall_not_mem]
@[simp] theorem encard_empty : (∅ : Set α).encard = 0 := by
  

Proof state:
α : Type u_1
s t : Set α
⊢ encard ∅ = 0

Next tactic:
rw [encard_eq_zero]
theorem nonempty_of_encard_ne_zero (h : s.encard ≠ 0) : s.Nonempty := by
  

Proof state:
α : Type u_1
s t : Set α
h : encard s ≠ 0
⊢ Set.Nonempty s

Next tactic:
rwa [nonempty_iff_ne_empty, Ne.def, ← encard_eq_zero]
theorem encard_ne_zero : s.encard ≠ 0 ↔ s.Nonempty := by
  

Proof state:
α : Type u_1
s t : Set α
⊢ encard s ≠ 0 ↔ Set.Nonempty s

Next tactic:
rw [ne_eq, encard_eq_zero, nonempty_iff_ne_empty]
@[simp] theorem encard_pos : 0 < s.encard ↔ s.Nonempty := by
  

Proof state:
α : Type u_1
s t : Set α
⊢ 0 < encard s ↔ Set.Nonempty s

Next tactic:
rw [pos_iff_ne_zero, encard_ne_zero]
@[simp] theorem encard_singleton (e : α) : ({e} : Set α).encard = 1 := by
  

Proof state:
α : Type u_1
s t : Set α
e : α
⊢ encard {e} = 1

Next tactic:
rw [encard, ← PartENat.withTopEquiv.symm.injective.eq_iff, Equiv.symm_apply_apply,
    PartENat.card_eq_coe_fintype_card, Fintype.card_ofSubsingleton, Nat.cast_one]