Theorem: SimpleGraph.ComponentCompl.exists_adj_boundary_pair
File: Mathlib/Combinatorics/SimpleGraph/Ends/Defs.lean

tactic: refine' ComponentCompl.ind fun v vnK => _
state_before: V : Type u
G : SimpleGraph V
K L L' M : Set V
Gc : Preconnected G
hK : Set.Nonempty K
⊢ ∀ (C : ComponentCompl G K), ∃ ck, ck.fst ∈ C ∧ ck.snd ∈ K ∧ Adj G ck.fst ck.snd

tactic: let C : G.ComponentCompl K := G.componentComplMk vnK
state_before: V : Type u
G : SimpleGraph V
K L L' M : Set V
Gc : Preconnected G
hK : Set.Nonempty K
v : V
vnK : ¬v ∈ K
⊢ ∃ ck, ck.fst ∈ componentComplMk G vnK ∧ ck.snd ∈ K ∧ Adj G ck.fst ck.snd

tactic: let dis := Set.disjoint_iff.mp C.disjoint_right
state_before: V : Type u
G : SimpleGraph V
K L L' M : Set V
Gc : Preconnected G
hK : Set.Nonempty K
v : V
vnK : ¬v ∈ K
C : ComponentCompl G K := componentComplMk G vnK
⊢ ∃ ck, ck.fst ∈ componentComplMk G vnK ∧ ck.snd ∈ K ∧ Adj G ck.fst ck.snd

tactic: by_contra' h
state_before: V : Type u
G : SimpleGraph V
K L L' M : Set V
Gc : Preconnected G
hK : Set.Nonempty K
v : V
vnK : ¬v ∈ K
C : ComponentCompl G K := componentComplMk G vnK
dis : K ∩ ↑C ⊆ ∅ := Iff.mp Set.disjoint_iff (ComponentCompl.disjoint_right C)
⊢ ∃ ck, ck.fst ∈ componentComplMk G vnK ∧ ck.snd ∈ K ∧ Adj G ck.fst ck.snd

tactic: simp only [not_exists, not_and] at h
state_before: V : Type u
G : SimpleGraph V
K L L' M : Set V
Gc : Preconnected G
hK : Set.Nonempty K
v : V
vnK : ¬v ∈ K
C : ComponentCompl G K := componentComplMk G vnK
dis : K ∩ ↑C ⊆ ∅ := Iff.mp Set.disjoint_iff (ComponentCompl.disjoint_right C)
h : ¬∃ ck, ck.fst ∈ componentComplMk G vnK ∧ ck.snd ∈ K ∧ Adj G ck.fst ck.snd
⊢ False

tactic: suffices Set.univ = (C : Set V) by exact dis ⟨hK.choose_spec, this ▸ Set.mem_univ hK.some⟩
state_before: V : Type u
G : SimpleGraph V
K L L' M : Set V
Gc : Preconnected G
hK : Set.Nonempty K
v : V
vnK : ¬v ∈ K
C : ComponentCompl G K := componentComplMk G vnK
dis : K ∩ ↑C ⊆ ∅ := Iff.mp Set.disjoint_iff (ComponentCompl.disjoint_right C)
h : ∀ (x : V × V), x.fst ∈ componentComplMk G vnK → x.snd ∈ K → ¬Adj G x.fst x.snd
⊢ False

tactic: symm
state_before: V : Type u
G : SimpleGraph V
K L L' M : Set V
Gc : Preconnected G
hK : Set.Nonempty K
v : V
vnK : ¬v ∈ K
C : ComponentCompl G K := componentComplMk G vnK
dis : K ∩ ↑C ⊆ ∅ := Iff.mp Set.disjoint_iff (ComponentCompl.disjoint_right C)
h : ∀ (x : V × V), x.fst ∈ componentComplMk G vnK → x.snd ∈ K → ¬Adj G x.fst x.snd
⊢ Set.univ = ↑C

tactic: rw [Set.eq_univ_iff_forall]
state_before: V : Type u
G : SimpleGraph V
K L L' M : Set V
Gc : Preconnected G
hK : Set.Nonempty K
v : V
vnK : ¬v ∈ K
C : ComponentCompl G K := componentComplMk G vnK
dis : K ∩ ↑C ⊆ ∅ := Iff.mp Set.disjoint_iff (ComponentCompl.disjoint_right C)
h : ∀ (x : V × V), x.fst ∈ componentComplMk G vnK → x.snd ∈ K → ¬Adj G x.fst x.snd
⊢ ↑C = Set.univ

tactic: rintro u
state_before: V : Type u
G : SimpleGraph V
K L L' M : Set V
Gc : Preconnected G
hK : Set.Nonempty K
v : V
vnK : ¬v ∈ K
C : ComponentCompl G K := componentComplMk G vnK
dis : K ∩ ↑C ⊆ ∅ := Iff.mp Set.disjoint_iff (ComponentCompl.disjoint_right C)
h : ∀ (x : V × V), x.fst ∈ componentComplMk G vnK → x.snd ∈ K → ¬Adj G x.fst x.snd
⊢ ∀ (x : V), x ∈ ↑C

tactic: by_contra unC
state_before: V : Type u
G : SimpleGraph V
K L L' M : Set V
Gc : Preconnected G
hK : Set.Nonempty K
v : V
vnK : ¬v ∈ K
C : ComponentCompl G K := componentComplMk G vnK
dis : K ∩ ↑C ⊆ ∅ := Iff.mp Set.disjoint_iff (ComponentCompl.disjoint_right C)
h : ∀ (x : V × V), x.fst ∈ componentComplMk G vnK → x.snd ∈ K → ¬Adj G x.fst x.snd
u : V
⊢ u ∈ ↑C

tactic: obtain ⟨p⟩ := Gc v u
state_before: V : Type u
G : SimpleGraph V
K L L' M : Set V
Gc : Preconnected G
hK : Set.Nonempty K
v : V
vnK : ¬v ∈ K
C : ComponentCompl G K := componentComplMk G vnK
dis : K ∩ ↑C ⊆ ∅ := Iff.mp Set.disjoint_iff (ComponentCompl.disjoint_right C)
h : ∀ (x : V × V), x.fst ∈ componentComplMk G vnK → x.snd ∈ K → ¬Adj G x.fst x.snd
u : V
unC : ¬u ∈ ↑C
⊢ False

tactic: obtain ⟨⟨⟨x, y⟩, xy⟩, -, xC, ynC⟩ :=
  p.exists_boundary_dart (C : Set V) (G.componentComplMk_mem vnK) unC
state_before: case intro
V : Type u
G : SimpleGraph V
K L L' M : Set V
Gc : Preconnected G
hK : Set.Nonempty K
v : V
vnK : ¬v ∈ K
C : ComponentCompl G K := componentComplMk G vnK
dis : K ∩ ↑C ⊆ ∅ := Iff.mp Set.disjoint_iff (ComponentCompl.disjoint_right C)
h : ∀ (x : V × V), x.fst ∈ componentComplMk G vnK → x.snd ∈ K → ¬Adj G x.fst x.snd
u : V
unC : ¬u ∈ ↑C
p : Walk G v u
⊢ False

tactic: exact ynC (mem_of_adj x y xC (fun yK : y ∈ K => h ⟨x, y⟩ xC yK xy) xy)
state_before: case intro.intro.mk.mk.intro.intro
V : Type u
G : SimpleGraph V
K L L' M : Set V
Gc : Preconnected G
hK : Set.Nonempty K
v : V
vnK : ¬v ∈ K
C : ComponentCompl G K := componentComplMk G vnK
dis : K ∩ ↑C ⊆ ∅ := Iff.mp Set.disjoint_iff (ComponentCompl.disjoint_right C)
h : ∀ (x : V × V), x.fst ∈ componentComplMk G vnK → x.snd ∈ K → ¬Adj G x.fst x.snd
u : V
unC : ¬u ∈ ↑C
p : Walk G v u
x y : V
xy : Adj G (x, y).fst (x, y).snd
xC : { toProd := (x, y), is_adj := xy }.toProd.fst ∈ ↑C
ynC : ¬{ toProd := (x, y), is_adj := xy }.toProd.snd ∈ ↑C
⊢ False

tactic: exact dis ⟨hK.choose_spec, this ▸ Set.mem_univ hK.some⟩
state_before: V : Type u
G : SimpleGraph V
K L L' M : Set V
Gc : Preconnected G
hK : Set.Nonempty K
v : V
vnK : ¬v ∈ K
C : ComponentCompl G K := componentComplMk G vnK
dis : K ∩ ↑C ⊆ ∅ := Iff.mp Set.disjoint_iff (ComponentCompl.disjoint_right C)
h : ∀ (x : V × V), x.fst ∈ componentComplMk G vnK → x.snd ∈ K → ¬Adj G x.fst x.snd
this : Set.univ = ↑C
⊢ False