Theorem: SimpleGraph.IsAcyclic.path_unique
File: Mathlib/Combinatorics/SimpleGraph/Acyclic.lean

tactic: obtain ⟨p, hp⟩ := p
state_before: V : Type u
G✝ G : SimpleGraph V
h : IsAcyclic G
v w : V
p q : Path G v w
⊢ p = q

tactic: obtain ⟨q, hq⟩ := q
state_before: case mk
V : Type u
G✝ G : SimpleGraph V
h : IsAcyclic G
v w : V
q : Path G v w
p : Walk G v w
hp : Walk.IsPath p
⊢ { val := p, property := hp } = q

tactic: rw [Subtype.mk.injEq]
state_before: case mk.mk
V : Type u
G✝ G : SimpleGraph V
h : IsAcyclic G
v w : V
p : Walk G v w
hp : Walk.IsPath p
q : Walk G v w
hq : Walk.IsPath q
⊢ { val := p, property := hp } = { val := q, property := hq }

tactic: cases (Walk.isPath_iff_eq_nil _).mp hq
state_before: case mk.mk.nil
V : Type u
G✝ G : SimpleGraph V
h : IsAcyclic G
v w u✝ : V
hp : Walk.IsPath Walk.nil
q : Walk G u✝ u✝
hq : Walk.IsPath q
⊢ Walk.nil = q

tactic: rfl
state_before: case mk.mk.nil.refl
V : Type u
G✝ G : SimpleGraph V
h : IsAcyclic G
v w u✝ : V
hp hq : Walk.IsPath Walk.nil
⊢ Walk.nil = Walk.nil

tactic: rw [isAcyclic_iff_forall_adj_isBridge] at h
state_before: case mk.mk.cons
V : Type u
G✝ G : SimpleGraph V
h : IsAcyclic G
v w u✝ v✝ w✝ : V
ph : Adj G u✝ v✝
p : Walk G v✝ w✝
ih : Walk.IsPath p → ∀ (q : Walk G v✝ w✝), Walk.IsPath q → p = q
hp : Walk.IsPath (Walk.cons ph p)
q : Walk G u✝ w✝
hq : Walk.IsPath q
⊢ Walk.cons ph p = q

tactic: specialize h ph
state_before: case mk.mk.cons
V : Type u
G✝ G : SimpleGraph V
h : ∀ ⦃v w : V⦄, Adj G v w → IsBridge G (Quotient.mk (Sym2.Rel.setoid V) (v, w))
v w u✝ v✝ w✝ : V
ph : Adj G u✝ v✝
p : Walk G v✝ w✝
ih : Walk.IsPath p → ∀ (q : Walk G v✝ w✝), Walk.IsPath q → p = q
hp : Walk.IsPath (Walk.cons ph p)
q : Walk G u✝ w✝
hq : Walk.IsPath q
⊢ Walk.cons ph p = q

tactic: rw [isBridge_iff_adj_and_forall_walk_mem_edges] at h
state_before: case mk.mk.cons
V : Type u
G✝ G : SimpleGraph V
v w u✝ v✝ w✝ : V
ph : Adj G u✝ v✝
p : Walk G v✝ w✝
ih : Walk.IsPath p → ∀ (q : Walk G v✝ w✝), Walk.IsPath q → p = q
hp : Walk.IsPath (Walk.cons ph p)
q : Walk G u✝ w✝
hq : Walk.IsPath q
h : IsBridge G (Quotient.mk (Sym2.Rel.setoid V) (u✝, v✝))
⊢ Walk.cons ph p = q

tactic: replace h := h.2 (q.append p.reverse)
state_before: case mk.mk.cons
V : Type u
G✝ G : SimpleGraph V
v w u✝ v✝ w✝ : V
ph : Adj G u✝ v✝
p : Walk G v✝ w✝
ih : Walk.IsPath p → ∀ (q : Walk G v✝ w✝), Walk.IsPath q → p = q
hp : Walk.IsPath (Walk.cons ph p)
q : Walk G u✝ w✝
hq : Walk.IsPath q
h : Adj G u✝ v✝ ∧ ∀ (p : Walk G u✝ v✝), Quotient.mk (Sym2.Rel.setoid V) (u✝, v✝) ∈ Walk.edges p
⊢ Walk.cons ph p = q

tactic: simp only [Walk.edges_append, Walk.edges_reverse, List.mem_append, List.mem_reverse'] at h
state_before: case mk.mk.cons
V : Type u
G✝ G : SimpleGraph V
v w u✝ v✝ w✝ : V
ph : Adj G u✝ v✝
p : Walk G v✝ w✝
ih : Walk.IsPath p → ∀ (q : Walk G v✝ w✝), Walk.IsPath q → p = q
hp : Walk.IsPath (Walk.cons ph p)
q : Walk G u✝ w✝
hq : Walk.IsPath q
h : Quotient.mk (Sym2.Rel.setoid V) (u✝, v✝) ∈ Walk.edges (Walk.append q (Walk.reverse p))
⊢ Walk.cons ph p = q

tactic: cases' h with h h
state_before: case mk.mk.cons
V : Type u
G✝ G : SimpleGraph V
v w u✝ v✝ w✝ : V
ph : Adj G u✝ v✝
p : Walk G v✝ w✝
ih : Walk.IsPath p → ∀ (q : Walk G v✝ w✝), Walk.IsPath q → p = q
hp : Walk.IsPath (Walk.cons ph p)
q : Walk G u✝ w✝
hq : Walk.IsPath q
h : Quotient.mk (Sym2.Rel.setoid V) (u✝, v✝) ∈ Walk.edges q ∨ Quotient.mk (Sym2.Rel.setoid V) (u✝, v✝) ∈ Walk.edges p
⊢ Walk.cons ph p = q

tactic: simp [Walk.isPath_def] at hp
state_before: case mk.mk.cons.inl.nil
V : Type u
G✝ G : SimpleGraph V
v w u✝ v✝ : V
ph : Adj G u✝ v✝
p : Walk G v✝ u✝
ih : Walk.IsPath p → ∀ (q : Walk G v✝ u✝), Walk.IsPath q → p = q
hp : Walk.IsPath (Walk.cons ph p)
hq : Walk.IsPath Walk.nil
h : Quotient.mk (Sym2.Rel.setoid V) (u✝, v✝) ∈ Walk.edges Walk.nil
⊢ Walk.cons ph p = Walk.nil

tactic: rw [Walk.cons_isPath_iff] at hp hq
state_before: case mk.mk.cons.inl.cons
V : Type u
G✝ G : SimpleGraph V
v w u✝ v✝¹ w✝ : V
ph : Adj G u✝ v✝¹
p : Walk G v✝¹ w✝
ih : Walk.IsPath p → ∀ (q : Walk G v✝¹ w✝), Walk.IsPath q → p = q
hp : Walk.IsPath (Walk.cons ph p)
v✝ : V
h✝ : Adj G u✝ v✝
q : Walk G v✝ w✝
hq : Walk.IsPath (Walk.cons h✝ q)
h : Quotient.mk (Sym2.Rel.setoid V) (u✝, v✝¹) ∈ Walk.edges (Walk.cons h✝ q)
⊢ Walk.cons ph p = Walk.cons h✝ q

tactic: simp only [Walk.edges_cons, List.mem_cons, Sym2.eq_iff, true_and] at h
state_before: case mk.mk.cons.inl.cons
V : Type u
G✝ G : SimpleGraph V
v w u✝ v✝¹ w✝ : V
ph : Adj G u✝ v✝¹
p : Walk G v✝¹ w✝
ih : Walk.IsPath p → ∀ (q : Walk G v✝¹ w✝), Walk.IsPath q → p = q
hp : Walk.IsPath p ∧ ¬u✝ ∈ Walk.support p
v✝ : V
h✝ : Adj G u✝ v✝
q : Walk G v✝ w✝
hq : Walk.IsPath q ∧ ¬u✝ ∈ Walk.support q
h : Quotient.mk (Sym2.Rel.setoid V) (u✝, v✝¹) ∈ Walk.edges (Walk.cons h✝ q)
⊢ Walk.cons ph p = Walk.cons h✝ q

tactic: rcases h with (⟨h, rfl⟩ | ⟨rfl, rfl⟩) | h
state_before: case mk.mk.cons.inl.cons
V : Type u
G✝ G : SimpleGraph V
v w u✝ v✝¹ w✝ : V
ph : Adj G u✝ v✝¹
p : Walk G v✝¹ w✝
ih : Walk.IsPath p → ∀ (q : Walk G v✝¹ w✝), Walk.IsPath q → p = q
hp : Walk.IsPath p ∧ ¬u✝ ∈ Walk.support p
v✝ : V
h✝ : Adj G u✝ v✝
q : Walk G v✝ w✝
hq : Walk.IsPath q ∧ ¬u✝ ∈ Walk.support q
h : (v✝¹ = v✝ ∨ u✝ = v✝ ∧ v✝¹ = u✝) ∨ Quotient.mk (Sym2.Rel.setoid V) (u✝, v✝¹) ∈ Walk.edges q
⊢ Walk.cons ph p = Walk.cons h✝ q

tactic: cases ih hp.1 q hq.1
state_before: case mk.mk.cons.inl.cons.inl.inl.refl
V : Type u
G✝ G : SimpleGraph V
v w u✝ v✝ w✝ : V
ph : Adj G u✝ v✝
p : Walk G v✝ w✝
ih : Walk.IsPath p → ∀ (q : Walk G v✝ w✝), Walk.IsPath q → p = q
hp : Walk.IsPath p ∧ ¬u✝ ∈ Walk.support p
h✝ : Adj G u✝ v✝
q : Walk G v✝ w✝
hq : Walk.IsPath q ∧ ¬u✝ ∈ Walk.support q
⊢ Walk.cons ph p = Walk.cons h✝ q

tactic: rfl
state_before: case mk.mk.cons.inl.cons.inl.inl.refl.refl
V : Type u
G✝ G : SimpleGraph V
v w u✝ v✝ w✝ : V
ph : Adj G u✝ v✝
p : Walk G v✝ w✝
ih : Walk.IsPath p → ∀ (q : Walk G v✝ w✝), Walk.IsPath q → p = q
hp : Walk.IsPath p ∧ ¬u✝ ∈ Walk.support p
h✝ : Adj G u✝ v✝
hq : Walk.IsPath p ∧ ¬u✝ ∈ Walk.support p
⊢ Walk.cons ph p = Walk.cons h✝ p

tactic: simp at hq
state_before: case mk.mk.cons.inl.cons.inl.inr.intro
V : Type u
G✝ G : SimpleGraph V
v w v✝ w✝ : V
p : Walk G v✝ w✝
ih : Walk.IsPath p → ∀ (q : Walk G v✝ w✝), Walk.IsPath q → p = q
ph : Adj G v✝ v✝
hp : Walk.IsPath p ∧ ¬v✝ ∈ Walk.support p
h✝ : Adj G v✝ v✝
q : Walk G v✝ w✝
hq : Walk.IsPath q ∧ ¬v✝ ∈ Walk.support q
⊢ Walk.cons ph p = Walk.cons h✝ q

tactic: exact absurd (Walk.fst_mem_support_of_mem_edges _ h) hq.2
state_before: case mk.mk.cons.inl.cons.inr
V : Type u
G✝ G : SimpleGraph V
v w u✝ v✝¹ w✝ : V
ph : Adj G u✝ v✝¹
p : Walk G v✝¹ w✝
ih : Walk.IsPath p → ∀ (q : Walk G v✝¹ w✝), Walk.IsPath q → p = q
hp : Walk.IsPath p ∧ ¬u✝ ∈ Walk.support p
v✝ : V
h✝ : Adj G u✝ v✝
q : Walk G v✝ w✝
hq : Walk.IsPath q ∧ ¬u✝ ∈ Walk.support q
h : Quotient.mk (Sym2.Rel.setoid V) (u✝, v✝¹) ∈ Walk.edges q
⊢ Walk.cons ph p = Walk.cons h✝ q

tactic: rw [Walk.cons_isPath_iff] at hp
state_before: case mk.mk.cons.inr
V : Type u
G✝ G : SimpleGraph V
v w u✝ v✝ w✝ : V
ph : Adj G u✝ v✝
p : Walk G v✝ w✝
ih : Walk.IsPath p → ∀ (q : Walk G v✝ w✝), Walk.IsPath q → p = q
hp : Walk.IsPath (Walk.cons ph p)
q : Walk G u✝ w✝
hq : Walk.IsPath q
h : Quotient.mk (Sym2.Rel.setoid V) (u✝, v✝) ∈ Walk.edges p
⊢ Walk.cons ph p = q

tactic: exact absurd (Walk.fst_mem_support_of_mem_edges _ h) hp.2
state_before: case mk.mk.cons.inr
V : Type u
G✝ G : SimpleGraph V
v w u✝ v✝ w✝ : V
ph : Adj G u✝ v✝
p : Walk G v✝ w✝
ih : Walk.IsPath p → ∀ (q : Walk G v✝ w✝), Walk.IsPath q → p = q
hp : Walk.IsPath p ∧ ¬u✝ ∈ Walk.support p
q : Walk G u✝ w✝
hq : Walk.IsPath q
h : Quotient.mk (Sym2.Rel.setoid V) (u✝, v✝) ∈ Walk.edges p
⊢ Walk.cons ph p = q