l3lab/ntp-mathlib huggingface dataset:
theorem IsAcyclic.path_unique {G : SimpleGraph V} (h : G.IsAcyclic) {v w : V} (p q : G.Path v w) :
    p = q := by
  obtain ⟨p, hp⟩ := p
  obtain ⟨q, hq⟩ := q
  rw [Subtype.mk.injEq]
  induction p with
  | nil =>
    cases (Walk.isPath_iff_eq_nil _).mp hq
    rfl
  | cons ph p ih =>
    rw [isAcyclic_iff_forall_adj_isBridge] at h
    specialize h ph
    

Proof state:
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 : IsPath p → ∀ (q : Walk G v✝ w✝), IsPath q → p = q
hp : IsPath (cons ph p)
q : Walk G u✝ w✝
hq : IsPath q
h : IsBridge G ⟦(u✝, v✝)⟧
⊢ cons ph p = q

Next tactic:
rw [isBridge_iff_adj_and_forall_walk_mem_edges] at h
theorem IsAcyclic.path_unique {G : SimpleGraph V} (h : G.IsAcyclic) {v w : V} (p q : G.Path v w) :
    p = q := by
  obtain ⟨p, hp⟩ := p
  obtain ⟨q, hq⟩ := q
  rw [Subtype.mk.injEq]
  induction p with
  | nil =>
    cases (Walk.isPath_iff_eq_nil _).mp hq
    rfl
  | cons ph p ih =>
    rw [isAcyclic_iff_forall_adj_isBridge] at h
    specialize h ph
    rw [isBridge_iff_adj_and_forall_walk_mem_edges] at h
    

Proof state:
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 : IsPath p → ∀ (q : Walk G v✝ w✝), IsPath q → p = q
hp : IsPath (cons ph p)
q : Walk G u✝ w✝
hq : IsPath q
h : Adj G u✝ v✝ ∧ ∀ (p : Walk G u✝ v✝), ⟦(u✝, v✝)⟧ ∈ edges p
⊢ cons ph p = q

Next tactic:
replace h := h.2 (q.append p.reverse)
theorem IsAcyclic.path_unique {G : SimpleGraph V} (h : G.IsAcyclic) {v w : V} (p q : G.Path v w) :
    p = q := by
  obtain ⟨p, hp⟩ := p
  obtain ⟨q, hq⟩ := q
  rw [Subtype.mk.injEq]
  induction p with
  | nil =>
    cases (Walk.isPath_iff_eq_nil _).mp hq
    rfl
  | cons ph p ih =>
    rw [isAcyclic_iff_forall_adj_isBridge] at h
    specialize h ph
    rw [isBridge_iff_adj_and_forall_walk_mem_edges] at h
    replace h := h.2 (q.append p.reverse)
    

Proof state:
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 : IsPath p → ∀ (q : Walk G v✝ w✝), IsPath q → p = q
hp : IsPath (cons ph p)
q : Walk G u✝ w✝
hq : IsPath q
h : ⟦(u✝, v✝)⟧ ∈ edges (append q (reverse p))
⊢ cons ph p = q

Next tactic:
simp only [Walk.edges_append, Walk.edges_reverse, List.mem_append, List.mem_reverse] at h
theorem IsAcyclic.path_unique {G : SimpleGraph V} (h : G.IsAcyclic) {v w : V} (p q : G.Path v w) :
    p = q := by
  obtain ⟨p, hp⟩ := p
  obtain ⟨q, hq⟩ := q
  rw [Subtype.mk.injEq]
  induction p with
  | nil =>
    cases (Walk.isPath_iff_eq_nil _).mp hq
    rfl
  | cons ph p ih =>
    rw [isAcyclic_iff_forall_adj_isBridge] at h
    specialize h ph
    rw [isBridge_iff_adj_and_forall_walk_mem_edges] at h
    replace h := h.2 (q.append p.reverse)
    simp only [Walk.edges_append, Walk.edges_reverse, List.mem_append, List.mem_reverse] at h
    

Proof state:
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 : IsPath p → ∀ (q : Walk G v✝ w✝), IsPath q → p = q
hp : IsPath (cons ph p)
q : Walk G u✝ w✝
hq : IsPath q
h : ⟦(u✝, v✝)⟧ ∈ edges q ∨ ⟦(u✝, v✝)⟧ ∈ edges p
⊢ cons ph p = q

Next tactic:
cases' h with h h
theorem IsAcyclic.path_unique {G : SimpleGraph V} (h : G.IsAcyclic) {v w : V} (p q : G.Path v w) :
    p = q := by
  obtain ⟨p, hp⟩ := p
  obtain ⟨q, hq⟩ := q
  rw [Subtype.mk.injEq]
  induction p with
  | nil =>
    cases (Walk.isPath_iff_eq_nil _).mp hq
    rfl
  | cons ph p ih =>
    rw [isAcyclic_iff_forall_adj_isBridge] at h
    specialize h ph
    rw [isBridge_iff_adj_and_forall_walk_mem_edges] at h
    replace h := h.2 (q.append p.reverse)
    simp only [Walk.edges_append, Walk.edges_reverse, List.mem_append, List.mem_reverse] at h
    cases' h with h h
    · 

Proof state:
case mk.mk.cons.inl
V : Type u
G✝ G : SimpleGraph V
v w u✝ v✝ w✝ : V
ph : Adj G u✝ v✝
p : Walk G v✝ w✝
ih : IsPath p → ∀ (q : Walk G v✝ w✝), IsPath q → p = q
hp : IsPath (cons ph p)
q : Walk G u✝ w✝
hq : IsPath q
h : ⟦(u✝, v✝)⟧ ∈ edges q
⊢ cons ph p = q

Next tactic:
cases q with
      | nil => simp [Walk.isPath_def] at hp
      | cons _ q =>
        rw [Walk.cons_isPath_iff] at hp hq
        simp only [Walk.edges_cons, List.mem_cons, Sym2.eq_iff, true_and] at h
        rcases h with (⟨h, rfl⟩ | ⟨rfl, rfl⟩) | h
        · cases ih hp.1 q hq.1
          rfl
        · simp at hq
        · exact absurd (Walk.fst_mem_support_of_mem_edges _ h) hq.2
theorem IsAcyclic.path_unique {G : SimpleGraph V} (h : G.IsAcyclic) {v w : V} (p q : G.Path v w) :
    p = q := by
  obtain ⟨p, hp⟩ := p
  obtain ⟨q, hq⟩ := q
  rw [Subtype.mk.injEq]
  induction p with
  | nil =>
    cases (Walk.isPath_iff_eq_nil _).mp hq
    rfl
  | cons ph p ih =>
    rw [isAcyclic_iff_forall_adj_isBridge] at h
    specialize h ph
    rw [isBridge_iff_adj_and_forall_walk_mem_edges] at h
    replace h := h.2 (q.append p.reverse)
    simp only [Walk.edges_append, Walk.edges_reverse, List.mem_append, List.mem_reverse] at h
    cases' h with h h
    · cases q with
      

Proof state:
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 : IsPath p → ∀ (q : Walk G v✝ u✝), IsPath q → p = q
hp : IsPath (cons ph p)
hq : IsPath nil
h : ⟦(u✝, v✝)⟧ ∈ edges nil
⊢ cons ph p = nil

Next tactic:
| nil => simp [Walk.isPath_def] at hp
theorem IsAcyclic.path_unique {G : SimpleGraph V} (h : G.IsAcyclic) {v w : V} (p q : G.Path v w) :
    p = q := by
  obtain ⟨p, hp⟩ := p
  obtain ⟨q, hq⟩ := q
  rw [Subtype.mk.injEq]
  induction p with
  | nil =>
    cases (Walk.isPath_iff_eq_nil _).mp hq
    rfl
  | cons ph p ih =>
    rw [isAcyclic_iff_forall_adj_isBridge] at h
    specialize h ph
    rw [isBridge_iff_adj_and_forall_walk_mem_edges] at h
    replace h := h.2 (q.append p.reverse)
    simp only [Walk.edges_append, Walk.edges_reverse, List.mem_append, List.mem_reverse] at h
    cases' h with h h
    · cases q with
      | nil => 

Proof state:
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 : IsPath p → ∀ (q : Walk G v✝ u✝), IsPath q → p = q
hp : IsPath (cons ph p)
hq : IsPath nil
h : ⟦(u✝, v✝)⟧ ∈ edges nil
⊢ cons ph p = nil

Next tactic:
simp [Walk.isPath_def] at hp
theorem IsAcyclic.path_unique {G : SimpleGraph V} (h : G.IsAcyclic) {v w : V} (p q : G.Path v w) :
    p = q := by
  obtain ⟨p, hp⟩ := p
  obtain ⟨q, hq⟩ := q
  rw [Subtype.mk.injEq]
  induction p with
  | nil =>
    cases (Walk.isPath_iff_eq_nil _).mp hq
    rfl
  | cons ph p ih =>
    rw [isAcyclic_iff_forall_adj_isBridge] at h
    specialize h ph
    rw [isBridge_iff_adj_and_forall_walk_mem_edges] at h
    replace h := h.2 (q.append p.reverse)
    simp only [Walk.edges_append, Walk.edges_reverse, List.mem_append, List.mem_reverse] at h
    cases' h with h h
    · cases q with
      | nil => simp [Walk.isPath_def] at hp
      

Proof state:
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 : IsPath p → ∀ (q : Walk G v✝¹ w✝), IsPath q → p = q
hp : IsPath (cons ph p)
v✝ : V
h✝ : Adj G u✝ v✝
q : Walk G v✝ w✝
hq : IsPath (cons h✝ q)
h : ⟦(u✝, v✝¹)⟧ ∈ edges (cons h✝ q)
⊢ cons ph p = cons h✝ q

Next tactic:
| cons _ q =>
        rw [Walk.cons_isPath_iff] at hp hq
        simp only [Walk.edges_cons, List.mem_cons, Sym2.eq_iff, true_and] at h
        rcases h with (⟨h, rfl⟩ | ⟨rfl, rfl⟩) | h
        · cases ih hp.1 q hq.1
          rfl
        · simp at hq
        · exact absurd (Walk.fst_mem_support_of_mem_edges _ h) hq.2
theorem IsAcyclic.path_unique {G : SimpleGraph V} (h : G.IsAcyclic) {v w : V} (p q : G.Path v w) :
    p = q := by
  obtain ⟨p, hp⟩ := p
  obtain ⟨q, hq⟩ := q
  rw [Subtype.mk.injEq]
  induction p with
  | nil =>
    cases (Walk.isPath_iff_eq_nil _).mp hq
    rfl
  | cons ph p ih =>
    rw [isAcyclic_iff_forall_adj_isBridge] at h
    specialize h ph
    rw [isBridge_iff_adj_and_forall_walk_mem_edges] at h
    replace h := h.2 (q.append p.reverse)
    simp only [Walk.edges_append, Walk.edges_reverse, List.mem_append, List.mem_reverse] at h
    cases' h with h h
    · cases q with
      | nil => simp [Walk.isPath_def] at hp
      | cons _ q =>
        

Proof state:
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 : IsPath p → ∀ (q : Walk G v✝¹ w✝), IsPath q → p = q
hp : IsPath (cons ph p)
v✝ : V
h✝ : Adj G u✝ v✝
q : Walk G v✝ w✝
hq : IsPath (cons h✝ q)
h : ⟦(u✝, v✝¹)⟧ ∈ edges (cons h✝ q)
⊢ cons ph p = cons h✝ q

Next tactic:
rw [Walk.cons_isPath_iff] at hp hq
theorem IsAcyclic.path_unique {G : SimpleGraph V} (h : G.IsAcyclic) {v w : V} (p q : G.Path v w) :
    p = q := by
  obtain ⟨p, hp⟩ := p
  obtain ⟨q, hq⟩ := q
  rw [Subtype.mk.injEq]
  induction p with
  | nil =>
    cases (Walk.isPath_iff_eq_nil _).mp hq
    rfl
  | cons ph p ih =>
    rw [isAcyclic_iff_forall_adj_isBridge] at h
    specialize h ph
    rw [isBridge_iff_adj_and_forall_walk_mem_edges] at h
    replace h := h.2 (q.append p.reverse)
    simp only [Walk.edges_append, Walk.edges_reverse, List.mem_append, List.mem_reverse] at h
    cases' h with h h
    · cases q with
      | nil => simp [Walk.isPath_def] at hp
      | cons _ q =>
        rw [Walk.cons_isPath_iff] at hp hq
        

Proof state:
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 : IsPath p → ∀ (q : Walk G v✝¹ w✝), IsPath q → p = q
hp : IsPath p ∧ u✝ ∉ Walk.support p
v✝ : V
h✝ : Adj G u✝ v✝
q : Walk G v✝ w✝
hq : IsPath q ∧ u✝ ∉ Walk.support q
h : ⟦(u✝, v✝¹)⟧ ∈ edges (cons h✝ q)
⊢ cons ph p = cons h✝ q

Next tactic:
simp only [Walk.edges_cons, List.mem_cons, Sym2.eq_iff, true_and] at h
theorem IsAcyclic.path_unique {G : SimpleGraph V} (h : G.IsAcyclic) {v w : V} (p q : G.Path v w) :
    p = q := by
  obtain ⟨p, hp⟩ := p
  obtain ⟨q, hq⟩ := q
  rw [Subtype.mk.injEq]
  induction p with
  | nil =>
    cases (Walk.isPath_iff_eq_nil _).mp hq
    rfl
  | cons ph p ih =>
    rw [isAcyclic_iff_forall_adj_isBridge] at h
    specialize h ph
    rw [isBridge_iff_adj_and_forall_walk_mem_edges] at h
    replace h := h.2 (q.append p.reverse)
    simp only [Walk.edges_append, Walk.edges_reverse, List.mem_append, List.mem_reverse] at h
    cases' h with h h
    · cases q with
      | nil => simp [Walk.isPath_def] at hp
      | cons _ q =>
        rw [Walk.cons_isPath_iff] at hp hq
        simp only [Walk.edges_cons, List.mem_cons, Sym2.eq_iff, true_and] at h
        

Proof state:
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 : IsPath p → ∀ (q : Walk G v✝¹ w✝), IsPath q → p = q
hp : IsPath p ∧ u✝ ∉ Walk.support p
v✝ : V
h✝ : Adj G u✝ v✝
q : Walk G v✝ w✝
hq : IsPath q ∧ u✝ ∉ Walk.support q
h : (v✝¹ = v✝ ∨ u✝ = v✝ ∧ v✝¹ = u✝) ∨ ⟦(u✝, v✝¹)⟧ ∈ edges q
⊢ cons ph p = cons h✝ q

Next tactic:
rcases h with (⟨h, rfl⟩ | ⟨rfl, rfl⟩) | h
theorem IsAcyclic.path_unique {G : SimpleGraph V} (h : G.IsAcyclic) {v w : V} (p q : G.Path v w) :
    p = q := by
  obtain ⟨p, hp⟩ := p
  obtain ⟨q, hq⟩ := q
  rw [Subtype.mk.injEq]
  induction p with
  | nil =>
    cases (Walk.isPath_iff_eq_nil _).mp hq
    rfl
  | cons ph p ih =>
    rw [isAcyclic_iff_forall_adj_isBridge] at h
    specialize h ph
    rw [isBridge_iff_adj_and_forall_walk_mem_edges] at h
    replace h := h.2 (q.append p.reverse)
    simp only [Walk.edges_append, Walk.edges_reverse, List.mem_append, List.mem_reverse] at h
    cases' h with h h
    · cases q with
      | nil => simp [Walk.isPath_def] at hp
      | cons _ q =>
        rw [Walk.cons_isPath_iff] at hp hq
        simp only [Walk.edges_cons, List.mem_cons, Sym2.eq_iff, true_and] at h
        rcases h with (⟨h, rfl⟩ | ⟨rfl, rfl⟩) | h
        · 

Proof state:
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 : IsPath p → ∀ (q : Walk G v✝ w✝), IsPath q → p = q
hp : IsPath p ∧ u✝ ∉ Walk.support p
h✝ : Adj G u✝ v✝
q : Walk G v✝ w✝
hq : IsPath q ∧ u✝ ∉ Walk.support q
⊢ cons ph p = cons h✝ q

Next tactic:
cases ih hp.1 q hq.1
theorem IsAcyclic.path_unique {G : SimpleGraph V} (h : G.IsAcyclic) {v w : V} (p q : G.Path v w) :
    p = q := by
  obtain ⟨p, hp⟩ := p
  obtain ⟨q, hq⟩ := q
  rw [Subtype.mk.injEq]
  induction p with
  | nil =>
    cases (Walk.isPath_iff_eq_nil _).mp hq
    rfl
  | cons ph p ih =>
    rw [isAcyclic_iff_forall_adj_isBridge] at h
    specialize h ph
    rw [isBridge_iff_adj_and_forall_walk_mem_edges] at h
    replace h := h.2 (q.append p.reverse)
    simp only [Walk.edges_append, Walk.edges_reverse, List.mem_append, List.mem_reverse] at h
    cases' h with h h
    · cases q with
      | nil => simp [Walk.isPath_def] at hp
      | cons _ q =>
        rw [Walk.cons_isPath_iff] at hp hq
        simp only [Walk.edges_cons, List.mem_cons, Sym2.eq_iff, true_and] at h
        rcases h with (⟨h, rfl⟩ | ⟨rfl, rfl⟩) | h
        · cases ih hp.1 q hq.1
          

Proof state:
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 : IsPath p → ∀ (q : Walk G v✝ w✝), IsPath q → p = q
hp : IsPath p ∧ u✝ ∉ Walk.support p
h✝ : Adj G u✝ v✝
hq : IsPath p ∧ u✝ ∉ Walk.support p
⊢ cons ph p = cons h✝ p

Next tactic:
rfl
theorem IsAcyclic.path_unique {G : SimpleGraph V} (h : G.IsAcyclic) {v w : V} (p q : G.Path v w) :
    p = q := by
  obtain ⟨p, hp⟩ := p
  obtain ⟨q, hq⟩ := q
  rw [Subtype.mk.injEq]
  induction p with
  | nil =>
    cases (Walk.isPath_iff_eq_nil _).mp hq
    rfl
  | cons ph p ih =>
    rw [isAcyclic_iff_forall_adj_isBridge] at h
    specialize h ph
    rw [isBridge_iff_adj_and_forall_walk_mem_edges] at h
    replace h := h.2 (q.append p.reverse)
    simp only [Walk.edges_append, Walk.edges_reverse, List.mem_append, List.mem_reverse] at h
    cases' h with h h
    · cases q with
      | nil => simp [Walk.isPath_def] at hp
      | cons _ q =>
        rw [Walk.cons_isPath_iff] at hp hq
        simp only [Walk.edges_cons, List.mem_cons, Sym2.eq_iff, true_and] at h
        rcases h with (⟨h, rfl⟩ | ⟨rfl, rfl⟩) | h
        · cases ih hp.1 q hq.1
          rfl
        · 

Proof state:
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 : IsPath p → ∀ (q : Walk G v✝ w✝), IsPath q → p = q
ph : Adj G v✝ v✝
hp : IsPath p ∧ v✝ ∉ Walk.support p
h✝ : Adj G v✝ v✝
q : Walk G v✝ w✝
hq : IsPath q ∧ v✝ ∉ Walk.support q
⊢ cons ph p = cons h✝ q

Next tactic:
simp at hq
theorem IsAcyclic.path_unique {G : SimpleGraph V} (h : G.IsAcyclic) {v w : V} (p q : G.Path v w) :
    p = q := by
  obtain ⟨p, hp⟩ := p
  obtain ⟨q, hq⟩ := q
  rw [Subtype.mk.injEq]
  induction p with
  | nil =>
    cases (Walk.isPath_iff_eq_nil _).mp hq
    rfl
  | cons ph p ih =>
    rw [isAcyclic_iff_forall_adj_isBridge] at h
    specialize h ph
    rw [isBridge_iff_adj_and_forall_walk_mem_edges] at h
    replace h := h.2 (q.append p.reverse)
    simp only [Walk.edges_append, Walk.edges_reverse, List.mem_append, List.mem_reverse] at h
    cases' h with h h
    · cases q with
      | nil => simp [Walk.isPath_def] at hp
      | cons _ q =>
        rw [Walk.cons_isPath_iff] at hp hq
        simp only [Walk.edges_cons, List.mem_cons, Sym2.eq_iff, true_and] at h
        rcases h with (⟨h, rfl⟩ | ⟨rfl, rfl⟩) | h
        · cases ih hp.1 q hq.1
          rfl
        · simp at hq
        · 

Proof state:
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 : IsPath p → ∀ (q : Walk G v✝¹ w✝), IsPath q → p = q
hp : IsPath p ∧ u✝ ∉ Walk.support p
v✝ : V
h✝ : Adj G u✝ v✝
q : Walk G v✝ w✝
hq : IsPath q ∧ u✝ ∉ Walk.support q
h : ⟦(u✝, v✝¹)⟧ ∈ edges q
⊢ cons ph p = cons h✝ q

Next tactic:
exact absurd (Walk.fst_mem_support_of_mem_edges _ h) hq.2
theorem IsAcyclic.path_unique {G : SimpleGraph V} (h : G.IsAcyclic) {v w : V} (p q : G.Path v w) :
    p = q := by
  obtain ⟨p, hp⟩ := p
  obtain ⟨q, hq⟩ := q
  rw [Subtype.mk.injEq]
  induction p with
  | nil =>
    cases (Walk.isPath_iff_eq_nil _).mp hq
    rfl
  | cons ph p ih =>
    rw [isAcyclic_iff_forall_adj_isBridge] at h
    specialize h ph
    rw [isBridge_iff_adj_and_forall_walk_mem_edges] at h
    replace h := h.2 (q.append p.reverse)
    simp only [Walk.edges_append, Walk.edges_reverse, List.mem_append, List.mem_reverse] at h
    cases' h with h h
    · cases q with
      | nil => simp [Walk.isPath_def] at hp
      | cons _ q =>
        rw [Walk.cons_isPath_iff] at hp hq
        simp only [Walk.edges_cons, List.mem_cons, Sym2.eq_iff, true_and] at h
        rcases h with (⟨h, rfl⟩ | ⟨rfl, rfl⟩) | h
        · cases ih hp.1 q hq.1
          rfl
        · simp at hq
        · exact absurd (Walk.fst_mem_support_of_mem_edges _ h) hq.2
    · 

Proof state:
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 : IsPath p → ∀ (q : Walk G v✝ w✝), IsPath q → p = q
hp : IsPath (cons ph p)
q : Walk G u✝ w✝
hq : IsPath q
h : ⟦(u✝, v✝)⟧ ∈ edges p
⊢ cons ph p = q

Next tactic:
rw [Walk.cons_isPath_iff] at hp
theorem IsAcyclic.path_unique {G : SimpleGraph V} (h : G.IsAcyclic) {v w : V} (p q : G.Path v w) :
    p = q := by
  obtain ⟨p, hp⟩ := p
  obtain ⟨q, hq⟩ := q
  rw [Subtype.mk.injEq]
  induction p with
  | nil =>
    cases (Walk.isPath_iff_eq_nil _).mp hq
    rfl
  | cons ph p ih =>
    rw [isAcyclic_iff_forall_adj_isBridge] at h
    specialize h ph
    rw [isBridge_iff_adj_and_forall_walk_mem_edges] at h
    replace h := h.2 (q.append p.reverse)
    simp only [Walk.edges_append, Walk.edges_reverse, List.mem_append, List.mem_reverse] at h
    cases' h with h h
    · cases q with
      | nil => simp [Walk.isPath_def] at hp
      | cons _ q =>
        rw [Walk.cons_isPath_iff] at hp hq
        simp only [Walk.edges_cons, List.mem_cons, Sym2.eq_iff, true_and] at h
        rcases h with (⟨h, rfl⟩ | ⟨rfl, rfl⟩) | h
        · cases ih hp.1 q hq.1
          rfl
        · simp at hq
        · exact absurd (Walk.fst_mem_support_of_mem_edges _ h) hq.2
    · rw [Walk.cons_isPath_iff] at hp
      

Proof state:
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 : IsPath p → ∀ (q : Walk G v✝ w✝), IsPath q → p = q
hp : IsPath p ∧ u✝ ∉ Walk.support p
q : Walk G u✝ w✝
hq : IsPath q
h : ⟦(u✝, v✝)⟧ ∈ edges p
⊢ cons ph p = q

Next tactic:
exact absurd (Walk.fst_mem_support_of_mem_edges _ h) hp.2
theorem isAcyclic_of_path_unique (h : ∀ (v w : V) (p q : G.Path v w), p = q) : G.IsAcyclic := by
  

Proof state:
V : Type u
G : SimpleGraph V
h : ∀ (v w : V) (p q : Path G v w), p = q
⊢ IsAcyclic G

Next tactic:
intro v c hc
theorem isAcyclic_of_path_unique (h : ∀ (v w : V) (p q : G.Path v w), p = q) : G.IsAcyclic := by
  intro v c hc
  

Proof state:
V : Type u
G : SimpleGraph V
h : ∀ (v w : V) (p q : Path G v w), p = q
v : V
c : Walk G v v
hc : IsCycle c
⊢ False

Next tactic:
simp only [Walk.isCycle_def, Ne.def] at hc
theorem isAcyclic_of_path_unique (h : ∀ (v w : V) (p q : G.Path v w), p = q) : G.IsAcyclic := by
  intro v c hc
  simp only [Walk.isCycle_def, Ne.def] at hc
  

Proof state:
V : Type u
G : SimpleGraph V
h : ∀ (v w : V) (p q : Path G v w), p = q
v : V
c : Walk G v v
hc : IsTrail c ∧ ¬c = nil ∧ List.Nodup (List.tail (Walk.support c))
⊢ False

Next tactic:
cases c with
  | nil => cases hc.2.1 rfl
  | cons ha c' =>
    simp only [Walk.cons_isTrail_iff, Walk.support_cons, List.tail_cons, true_and_iff] at hc
    specialize h _ _ ⟨c', by simp only [Walk.isPath_def, hc.2]⟩ (Path.singleton ha.symm)
    rw [Path.singleton, Subtype.mk.injEq] at h
    simp [h] at hc
theorem isAcyclic_of_path_unique (h : ∀ (v w : V) (p q : G.Path v w), p = q) : G.IsAcyclic := by
  intro v c hc
  simp only [Walk.isCycle_def, Ne.def] at hc
  cases c with
  

Proof state:
case nil
V : Type u
G : SimpleGraph V
h : ∀ (v w : V) (p q : Path G v w), p = q
v : V
hc : IsTrail nil ∧ ¬nil = nil ∧ List.Nodup (List.tail (Walk.support nil))
⊢ False

Next tactic:
| nil => cases hc.2.1 rfl
theorem isAcyclic_of_path_unique (h : ∀ (v w : V) (p q : G.Path v w), p = q) : G.IsAcyclic := by
  intro v c hc
  simp only [Walk.isCycle_def, Ne.def] at hc
  cases c with
  | nil => 

Proof state:
case nil
V : Type u
G : SimpleGraph V
h : ∀ (v w : V) (p q : Path G v w), p = q
v : V
hc : IsTrail nil ∧ ¬nil = nil ∧ List.Nodup (List.tail (Walk.support nil))
⊢ False

Next tactic:
cases hc.2.1 rfl
theorem isAcyclic_of_path_unique (h : ∀ (v w : V) (p q : G.Path v w), p = q) : G.IsAcyclic := by
  intro v c hc
  simp only [Walk.isCycle_def, Ne.def] at hc
  cases c with
  | nil => cases hc.2.1 rfl
  

Proof state:
case cons
V : Type u
G : SimpleGraph V
h : ∀ (v w : V) (p q : Path G v w), p = q
v v✝ : V
ha : Adj G v v✝
c' : Walk G v✝ v
hc : IsTrail (cons ha c') ∧ ¬cons ha c' = nil ∧ List.Nodup (List.tail (Walk.support (cons ha c')))
⊢ False

Next tactic:
| cons ha c' =>
    simp only [Walk.cons_isTrail_iff, Walk.support_cons, List.tail_cons, true_and_iff] at hc
    specialize h _ _ ⟨c', by simp only [Walk.isPath_def, hc.2]⟩ (Path.singleton ha.symm)
    rw [Path.singleton, Subtype.mk.injEq] at h
    simp [h] at hc
theorem isAcyclic_of_path_unique (h : ∀ (v w : V) (p q : G.Path v w), p = q) : G.IsAcyclic := by
  intro v c hc
  simp only [Walk.isCycle_def, Ne.def] at hc
  cases c with
  | nil => cases hc.2.1 rfl
  | cons ha c' =>
    

Proof state:
case cons
V : Type u
G : SimpleGraph V
h : ∀ (v w : V) (p q : Path G v w), p = q
v v✝ : V
ha : Adj G v v✝
c' : Walk G v✝ v
hc : IsTrail (cons ha c') ∧ ¬cons ha c' = nil ∧ List.Nodup (List.tail (Walk.support (cons ha c')))
⊢ False

Next tactic:
simp only [Walk.cons_isTrail_iff, Walk.support_cons, List.tail_cons, true_and_iff] at hc
theorem isAcyclic_of_path_unique (h : ∀ (v w : V) (p q : G.Path v w), p = q) : G.IsAcyclic := by
  intro v c hc
  simp only [Walk.isCycle_def, Ne.def] at hc
  cases c with
  | nil => cases hc.2.1 rfl
  | cons ha c' =>
    simp only [Walk.cons_isTrail_iff, Walk.support_cons, List.tail_cons, true_and_iff] at hc
    

Proof state:
case cons
V : Type u
G : SimpleGraph V
h : ∀ (v w : V) (p q : Path G v w), p = q
v v✝ : V
ha : Adj G v v✝
c' : Walk G v✝ v
hc : (IsTrail c' ∧ ⟦(v, v✝)⟧ ∉ edges c') ∧ ¬False ∧ List.Nodup (Walk.support c')
⊢ False

Next tactic:
specialize h _ _ ⟨c', by simp only [Walk.isPath_def, hc.2]⟩ (Path.singleton ha.symm)
theorem isAcyclic_of_path_unique (h : ∀ (v w : V) (p q : G.Path v w), p = q) : G.IsAcyclic := by
  intro v c hc
  simp only [Walk.isCycle_def, Ne.def] at hc
  cases c with
  | nil => cases hc.2.1 rfl
  | cons ha c' =>
    simp only [Walk.cons_isTrail_iff, Walk.support_cons, List.tail_cons, true_and_iff] at hc
    specialize h _ _ ⟨c', by 

Proof state:
V : Type u
G : SimpleGraph V
h : ∀ (v w : V) (p q : Path G v w), p = q
v v✝ : V
ha : Adj G v v✝
c' : Walk G v✝ v
hc : (IsTrail c' ∧ ⟦(v, v✝)⟧ ∉ edges c') ∧ ¬False ∧ List.Nodup (Walk.support c')
⊢ IsPath c'

Next tactic:
simp only [Walk.isPath_def, hc.2]
theorem isAcyclic_of_path_unique (h : ∀ (v w : V) (p q : G.Path v w), p = q) : G.IsAcyclic := by
  intro v c hc
  simp only [Walk.isCycle_def, Ne.def] at hc
  cases c with
  | nil => cases hc.2.1 rfl
  | cons ha c' =>
    simp only [Walk.cons_isTrail_iff, Walk.support_cons, List.tail_cons, true_and_iff] at hc
    specialize h _ _ ⟨c', by simp only [Walk.isPath_def, hc.2]⟩ (Path.singleton ha.symm)
    

Proof state:
case cons
V : Type u
G : SimpleGraph V
v v✝ : V
ha : Adj G v v✝
c' : Walk G v✝ v
hc : (IsTrail c' ∧ ⟦(v, v✝)⟧ ∉ edges c') ∧ ¬False ∧ List.Nodup (Walk.support c')
h : { val := c', property := (_ : IsPath c') } = Path.singleton (_ : Adj G v✝ v)
⊢ False

Next tactic:
rw [Path.singleton, Subtype.mk.injEq] at h
theorem isAcyclic_of_path_unique (h : ∀ (v w : V) (p q : G.Path v w), p = q) : G.IsAcyclic := by
  intro v c hc
  simp only [Walk.isCycle_def, Ne.def] at hc
  cases c with
  | nil => cases hc.2.1 rfl
  | cons ha c' =>
    simp only [Walk.cons_isTrail_iff, Walk.support_cons, List.tail_cons, true_and_iff] at hc
    specialize h _ _ ⟨c', by simp only [Walk.isPath_def, hc.2]⟩ (Path.singleton ha.symm)
    rw [Path.singleton, Subtype.mk.injEq] at h
    

Proof state:
case cons
V : Type u
G : SimpleGraph V
v v✝ : V
ha : Adj G v v✝
c' : Walk G v✝ v
hc : (IsTrail c' ∧ ⟦(v, v✝)⟧ ∉ edges c') ∧ ¬False ∧ List.Nodup (Walk.support c')
h : c' = cons (_ : Adj G v✝ v) nil
⊢ False

Next tactic:
simp [h] at hc