l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem count_support_takeUntil_eq_one {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) :
    (p.takeUntil u h).support.count u = 1 := by
  induction p
  · rw [mem_support_nil_iff] at h
    subst u
    simp!
  · cases h
    · simp!
    · simp! only
      split_ifs with h' <;> 

Proof state:
case pos
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v w u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : ∀ (h : u ∈ support p✝), List.count u (support (takeUntil p✝ u h)) = 1
a✝ : List.Mem u (support p✝)
h' : u✝ = u
⊢ List.count u
      (support
        (Eq.rec (motive := fun x x_1 => x ∈ u✝ :: support p✝ → Walk G u✝ x) (fun h => nil) (_ : u✝ = u)
          (_ : List.Mem u (u✝ :: support p✝)))) =
    1

Next tactic:
rw [eq_comm] at h'
@[simp]
theorem count_support_takeUntil_eq_one {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) :
    (p.takeUntil u h).support.count u = 1 := by
  induction p
  · rw [mem_support_nil_iff] at h
    subst u
    simp!
  · cases h
    · simp!
    · simp! only
      split_ifs with h' <;> 

Proof state:
case neg
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v w u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : ∀ (h : u ∈ support p✝), List.count u (support (takeUntil p✝ u h)) = 1
a✝ : List.Mem u (support p✝)
h' : ¬u✝ = u
⊢ List.count u (support (cons h✝ (takeUntil p✝ u (_ : u ∈ support p✝)))) = 1

Next tactic:
rw [eq_comm] at h'
@[simp]
theorem count_support_takeUntil_eq_one {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) :
    (p.takeUntil u h).support.count u = 1 := by
  induction p
  · rw [mem_support_nil_iff] at h
    subst u
    simp!
  · cases h
    · simp!
    · simp! only
      split_ifs with h' <;> rw [eq_comm] at h' <;> 

Proof state:
case pos
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v w u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : ∀ (h : u ∈ support p✝), List.count u (support (takeUntil p✝ u h)) = 1
a✝ : List.Mem u (support p✝)
h'✝ : u✝ = u
h' : u = u✝
⊢ List.count u
      (support
        (Eq.rec (motive := fun x x_1 => x ∈ u✝ :: support p✝ → Walk G u✝ x) (fun h => nil) (_ : u✝ = u)
          (_ : List.Mem u (u✝ :: support p✝)))) =
    1

Next tactic:
subst_vars
@[simp]
theorem count_support_takeUntil_eq_one {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) :
    (p.takeUntil u h).support.count u = 1 := by
  induction p
  · rw [mem_support_nil_iff] at h
    subst u
    simp!
  · cases h
    · simp!
    · simp! only
      split_ifs with h' <;> rw [eq_comm] at h' <;> 

Proof state:
case neg
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v w u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : ∀ (h : u ∈ support p✝), List.count u (support (takeUntil p✝ u h)) = 1
a✝ : List.Mem u (support p✝)
h'✝ : ¬u✝ = u
h' : ¬u = u✝
⊢ List.count u (support (cons h✝ (takeUntil p✝ u (_ : u ∈ support p✝)))) = 1

Next tactic:
subst_vars
@[simp]
theorem count_support_takeUntil_eq_one {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) :
    (p.takeUntil u h).support.count u = 1 := by
  induction p
  · rw [mem_support_nil_iff] at h
    subst u
    simp!
  · cases h
    · simp!
    · simp! only
      split_ifs with h' <;> rw [eq_comm] at h' <;> subst_vars <;> 

Proof state:
case pos
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
v w u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : ∀ (h : u✝ ∈ support p✝), List.count u✝ (support (takeUntil p✝ u✝ h)) = 1
a✝ : List.Mem u✝ (support p✝)
h' : u✝ = u✝
⊢ List.count u✝
      (support
        (Eq.rec (motive := fun x x_1 => x ∈ u✝ :: support p✝ → Walk G u✝ x) (fun h => nil) (_ : u✝ = u✝)
          (_ : List.Mem u✝ (u✝ :: support p✝)))) =
    1

Next tactic:
simp! [*, List.count_cons]
@[simp]
theorem count_support_takeUntil_eq_one {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) :
    (p.takeUntil u h).support.count u = 1 := by
  induction p
  · rw [mem_support_nil_iff] at h
    subst u
    simp!
  · cases h
    · simp!
    · simp! only
      split_ifs with h' <;> rw [eq_comm] at h' <;> subst_vars <;> 

Proof state:
case neg
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v w u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : ∀ (h : u ∈ support p✝), List.count u (support (takeUntil p✝ u h)) = 1
a✝ : List.Mem u (support p✝)
h'✝ : ¬u✝ = u
h' : ¬u = u✝
⊢ List.count u (support (cons h✝ (takeUntil p✝ u (_ : u ∈ support p✝)))) = 1

Next tactic:
simp! [*, List.count_cons]
theorem count_edges_takeUntil_le_one {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) (x : V) :
    (p.takeUntil u h).edges.count ⟦(u, x)⟧ ≤ 1 := by
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v w : V
p : Walk G v w
h : u ∈ support p
x : V
⊢ List.count ⟦(u, x)⟧ (edges (takeUntil p u h)) ≤ 1

Next tactic:
induction' p with u' u' v' w' ha p' ih
theorem count_edges_takeUntil_le_one {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) (x : V) :
    (p.takeUntil u h).edges.count ⟦(u, x)⟧ ≤ 1 := by
  induction' p with u' u' v' w' ha p' ih
  · 

Proof state:
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v w x u' : V
h : u ∈ support nil
⊢ List.count ⟦(u, x)⟧ (edges (takeUntil nil u h)) ≤ 1

Next tactic:
rw [mem_support_nil_iff] at h
theorem count_edges_takeUntil_le_one {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) (x : V) :
    (p.takeUntil u h).edges.count ⟦(u, x)⟧ ≤ 1 := by
  induction' p with u' u' v' w' ha p' ih
  · rw [mem_support_nil_iff] at h
    

Proof state:
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v w x u' : V
h✝ : u ∈ support nil
h : u = u'
⊢ List.count ⟦(u, x)⟧ (edges (takeUntil nil u h✝)) ≤ 1

Next tactic:
subst u
theorem count_edges_takeUntil_le_one {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) (x : V) :
    (p.takeUntil u h).edges.count ⟦(u, x)⟧ ≤ 1 := by
  induction' p with u' u' v' w' ha p' ih
  · rw [mem_support_nil_iff] at h
    subst u
    

Proof state:
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
v w x u' : V
h : u' ∈ support nil
⊢ List.count ⟦(u', x)⟧ (edges (takeUntil nil u' h)) ≤ 1

Next tactic:
simp!
theorem count_edges_takeUntil_le_one {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) (x : V) :
    (p.takeUntil u h).edges.count ⟦(u, x)⟧ ≤ 1 := by
  induction' p with u' u' v' w' ha p' ih
  · rw [mem_support_nil_iff] at h
    subst u
    simp!
  · 

Proof state:
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v w x u' v' w' : V
ha : Adj G u' v'
p' : Walk G v' w'
ih : ∀ (h : u ∈ support p'), List.count ⟦(u, x)⟧ (edges (takeUntil p' u h)) ≤ 1
h : u ∈ support (cons ha p')
⊢ List.count ⟦(u, x)⟧ (edges (takeUntil (cons ha p') u h)) ≤ 1

Next tactic:
cases h
theorem count_edges_takeUntil_le_one {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) (x : V) :
    (p.takeUntil u h).edges.count ⟦(u, x)⟧ ≤ 1 := by
  induction' p with u' u' v' w' ha p' ih
  · rw [mem_support_nil_iff] at h
    subst u
    simp!
  · cases h
    · 

Proof state:
case cons.head
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v w x v' w' : V
p' : Walk G v' w'
ih : ∀ (h : u ∈ support p'), List.count ⟦(u, x)⟧ (edges (takeUntil p' u h)) ≤ 1
ha : Adj G u v'
⊢ List.count ⟦(u, x)⟧ (edges (takeUntil (cons ha p') u (_ : List.Mem u (u :: support p')))) ≤ 1

Next tactic:
simp!
theorem count_edges_takeUntil_le_one {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) (x : V) :
    (p.takeUntil u h).edges.count ⟦(u, x)⟧ ≤ 1 := by
  induction' p with u' u' v' w' ha p' ih
  · rw [mem_support_nil_iff] at h
    subst u
    simp!
  · cases h
    · simp!
    · 

Proof state:
case cons.tail
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v w x u' v' w' : V
ha : Adj G u' v'
p' : Walk G v' w'
ih : ∀ (h : u ∈ support p'), List.count ⟦(u, x)⟧ (edges (takeUntil p' u h)) ≤ 1
a✝ : List.Mem u (support p')
⊢ List.count ⟦(u, x)⟧ (edges (takeUntil (cons ha p') u (_ : List.Mem u (u' :: support p')))) ≤ 1

Next tactic:
simp! only
theorem count_edges_takeUntil_le_one {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) (x : V) :
    (p.takeUntil u h).edges.count ⟦(u, x)⟧ ≤ 1 := by
  induction' p with u' u' v' w' ha p' ih
  · rw [mem_support_nil_iff] at h
    subst u
    simp!
  · cases h
    · simp!
    · simp! only
      

Proof state:
case cons.tail
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v w x u' v' w' : V
ha : Adj G u' v'
p' : Walk G v' w'
ih : ∀ (h : u ∈ support p'), List.count ⟦(u, x)⟧ (edges (takeUntil p' u h)) ≤ 1
a✝ : List.Mem u (support p')
⊢ List.count ⟦(u, x)⟧
      (edges
        (if h : u' = u then
          Eq.rec (motive := fun x x_1 => x ∈ u' :: support p' → Walk G u' x) (fun h => nil) (_ : u' = u)
            (_ : List.Mem u (u' :: support p'))
        else cons ha (takeUntil p' u (_ : u ∈ support p')))) ≤
    1

Next tactic:
split_ifs with h'
theorem count_edges_takeUntil_le_one {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) (x : V) :
    (p.takeUntil u h).edges.count ⟦(u, x)⟧ ≤ 1 := by
  induction' p with u' u' v' w' ha p' ih
  · rw [mem_support_nil_iff] at h
    subst u
    simp!
  · cases h
    · simp!
    · simp! only
      split_ifs with h'
      · 

Proof state:
case pos
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v w x u' v' w' : V
ha : Adj G u' v'
p' : Walk G v' w'
ih : ∀ (h : u ∈ support p'), List.count ⟦(u, x)⟧ (edges (takeUntil p' u h)) ≤ 1
a✝ : List.Mem u (support p')
h' : u' = u
⊢ List.count ⟦(u, x)⟧
      (edges
        (Eq.rec (motive := fun x x_1 => x ∈ u' :: support p' → Walk G u' x) (fun h => nil) (_ : u' = u)
          (_ : List.Mem u (u' :: support p')))) ≤
    1

Next tactic:
subst h'
theorem count_edges_takeUntil_le_one {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) (x : V) :
    (p.takeUntil u h).edges.count ⟦(u, x)⟧ ≤ 1 := by
  induction' p with u' u' v' w' ha p' ih
  · rw [mem_support_nil_iff] at h
    subst u
    simp!
  · cases h
    · simp!
    · simp! only
      split_ifs with h'
      · subst h'
        

Proof state:
case pos
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
v w x u' v' w' : V
ha : Adj G u' v'
p' : Walk G v' w'
ih : ∀ (h : u' ∈ support p'), List.count ⟦(u', x)⟧ (edges (takeUntil p' u' h)) ≤ 1
a✝ : List.Mem u' (support p')
⊢ List.count ⟦(u', x)⟧
      (edges
        (Eq.rec (motive := fun x x_1 => x ∈ u' :: support p' → Walk G u' x) (fun h => nil) (_ : u' = u')
          (_ : List.Mem u' (u' :: support p')))) ≤
    1

Next tactic:
simp
theorem count_edges_takeUntil_le_one {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) (x : V) :
    (p.takeUntil u h).edges.count ⟦(u, x)⟧ ≤ 1 := by
  induction' p with u' u' v' w' ha p' ih
  · rw [mem_support_nil_iff] at h
    subst u
    simp!
  · cases h
    · simp!
    · simp! only
      split_ifs with h'
      · subst h'
        simp
      · 

Proof state:
case neg
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v w x u' v' w' : V
ha : Adj G u' v'
p' : Walk G v' w'
ih : ∀ (h : u ∈ support p'), List.count ⟦(u, x)⟧ (edges (takeUntil p' u h)) ≤ 1
a✝ : List.Mem u (support p')
h' : ¬u' = u
⊢ List.count ⟦(u, x)⟧ (edges (cons ha (takeUntil p' u (_ : u ∈ support p')))) ≤ 1

Next tactic:
rw [edges_cons, List.count_cons]
theorem count_edges_takeUntil_le_one {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) (x : V) :
    (p.takeUntil u h).edges.count ⟦(u, x)⟧ ≤ 1 := by
  induction' p with u' u' v' w' ha p' ih
  · rw [mem_support_nil_iff] at h
    subst u
    simp!
  · cases h
    · simp!
    · simp! only
      split_ifs with h'
      · subst h'
        simp
      · rw [edges_cons, List.count_cons]
        

Proof state:
case neg
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v w x u' v' w' : V
ha : Adj G u' v'
p' : Walk G v' w'
ih : ∀ (h : u ∈ support p'), List.count ⟦(u, x)⟧ (edges (takeUntil p' u h)) ≤ 1
a✝ : List.Mem u (support p')
h' : ¬u' = u
⊢ (List.count ⟦(u, x)⟧ (edges (takeUntil p' u (_ : u ∈ support p'))) + if ⟦(u, x)⟧ = ⟦(u', v')⟧ then 1 else 0) ≤ 1

Next tactic:
split_ifs with h''
theorem count_edges_takeUntil_le_one {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) (x : V) :
    (p.takeUntil u h).edges.count ⟦(u, x)⟧ ≤ 1 := by
  induction' p with u' u' v' w' ha p' ih
  · rw [mem_support_nil_iff] at h
    subst u
    simp!
  · cases h
    · simp!
    · simp! only
      split_ifs with h'
      · subst h'
        simp
      · rw [edges_cons, List.count_cons]
        split_ifs with h''
        · 

Proof state:
case pos
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v w x u' v' w' : V
ha : Adj G u' v'
p' : Walk G v' w'
ih : ∀ (h : u ∈ support p'), List.count ⟦(u, x)⟧ (edges (takeUntil p' u h)) ≤ 1
a✝ : List.Mem u (support p')
h' : ¬u' = u
h'' : ⟦(u, x)⟧ = ⟦(u', v')⟧
⊢ List.count ⟦(u, x)⟧ (edges (takeUntil p' u (_ : u ∈ support p'))) + 1 ≤ 1

Next tactic:
rw [Sym2.eq_iff] at h''
theorem count_edges_takeUntil_le_one {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) (x : V) :
    (p.takeUntil u h).edges.count ⟦(u, x)⟧ ≤ 1 := by
  induction' p with u' u' v' w' ha p' ih
  · rw [mem_support_nil_iff] at h
    subst u
    simp!
  · cases h
    · simp!
    · simp! only
      split_ifs with h'
      · subst h'
        simp
      · rw [edges_cons, List.count_cons]
        split_ifs with h''
        · rw [Sym2.eq_iff] at h''
          

Proof state:
case pos
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v w x u' v' w' : V
ha : Adj G u' v'
p' : Walk G v' w'
ih : ∀ (h : u ∈ support p'), List.count ⟦(u, x)⟧ (edges (takeUntil p' u h)) ≤ 1
a✝ : List.Mem u (support p')
h' : ¬u' = u
h'' : u = u' ∧ x = v' ∨ u = v' ∧ x = u'
⊢ List.count ⟦(u, x)⟧ (edges (takeUntil p' u (_ : u ∈ support p'))) + 1 ≤ 1

Next tactic:
obtain ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ := h''
theorem count_edges_takeUntil_le_one {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) (x : V) :
    (p.takeUntil u h).edges.count ⟦(u, x)⟧ ≤ 1 := by
  induction' p with u' u' v' w' ha p' ih
  · rw [mem_support_nil_iff] at h
    subst u
    simp!
  · cases h
    · simp!
    · simp! only
      split_ifs with h'
      · subst h'
        simp
      · rw [edges_cons, List.count_cons]
        split_ifs with h''
        · rw [Sym2.eq_iff] at h''
          obtain ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ := h''
          · 

Proof state:
case pos.inl.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v w x w' : V
h' : ¬u = u
p' : Walk G x w'
ih : ∀ (h : u ∈ support p'), List.count ⟦(u, x)⟧ (edges (takeUntil p' u h)) ≤ 1
a✝ : List.Mem u (support p')
ha : Adj G u x
⊢ List.count ⟦(u, x)⟧ (edges (takeUntil p' u (_ : u ∈ support p'))) + 1 ≤ 1

Next tactic:
exact (h' rfl).elim
theorem count_edges_takeUntil_le_one {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) (x : V) :
    (p.takeUntil u h).edges.count ⟦(u, x)⟧ ≤ 1 := by
  induction' p with u' u' v' w' ha p' ih
  · rw [mem_support_nil_iff] at h
    subst u
    simp!
  · cases h
    · simp!
    · simp! only
      split_ifs with h'
      · subst h'
        simp
      · rw [edges_cons, List.count_cons]
        split_ifs with h''
        · rw [Sym2.eq_iff] at h''
          obtain ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ := h''
          · exact (h' rfl).elim
          · 

Proof state:
case pos.inr.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v w x w' : V
p' : Walk G u w'
ih : ∀ (h : u ∈ support p'), List.count ⟦(u, x)⟧ (edges (takeUntil p' u h)) ≤ 1
a✝ : List.Mem u (support p')
h' : ¬x = u
ha : Adj G x u
⊢ List.count ⟦(u, x)⟧ (edges (takeUntil p' u (_ : u ∈ support p'))) + 1 ≤ 1

Next tactic:
cases p'
theorem count_edges_takeUntil_le_one {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) (x : V) :
    (p.takeUntil u h).edges.count ⟦(u, x)⟧ ≤ 1 := by
  induction' p with u' u' v' w' ha p' ih
  · rw [mem_support_nil_iff] at h
    subst u
    simp!
  · cases h
    · simp!
    · simp! only
      split_ifs with h'
      · subst h'
        simp
      · rw [edges_cons, List.count_cons]
        split_ifs with h''
        · rw [Sym2.eq_iff] at h''
          obtain ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ := h''
          · exact (h' rfl).elim
          · cases p' <;> 

Proof state:
case pos.inr.intro.nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v w x : V
h' : ¬x = u
ha : Adj G x u
ih : ∀ (h : u ∈ support nil), List.count ⟦(u, x)⟧ (edges (takeUntil nil u h)) ≤ 1
a✝ : List.Mem u (support nil)
⊢ List.count ⟦(u, x)⟧ (edges (takeUntil nil u (_ : u ∈ support nil))) + 1 ≤ 1

Next tactic:
simp!
theorem count_edges_takeUntil_le_one {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) (x : V) :
    (p.takeUntil u h).edges.count ⟦(u, x)⟧ ≤ 1 := by
  induction' p with u' u' v' w' ha p' ih
  · rw [mem_support_nil_iff] at h
    subst u
    simp!
  · cases h
    · simp!
    · simp! only
      split_ifs with h'
      · subst h'
        simp
      · rw [edges_cons, List.count_cons]
        split_ifs with h''
        · rw [Sym2.eq_iff] at h''
          obtain ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ := h''
          · exact (h' rfl).elim
          · cases p' <;> 

Proof state:
case pos.inr.intro.cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v w x w' : V
h' : ¬x = u
ha : Adj G x u
v✝ : V
h✝ : Adj G u v✝
p✝ : Walk G v✝ w'
ih : ∀ (h : u ∈ support (cons h✝ p✝)), List.count ⟦(u, x)⟧ (edges (takeUntil (cons h✝ p✝) u h)) ≤ 1
a✝ : List.Mem u (support (cons h✝ p✝))
⊢ List.count ⟦(u, x)⟧ (edges (takeUntil (cons h✝ p✝) u (_ : u ∈ support (cons h✝ p✝)))) + 1 ≤ 1

Next tactic:
simp!
theorem count_edges_takeUntil_le_one {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) (x : V) :
    (p.takeUntil u h).edges.count ⟦(u, x)⟧ ≤ 1 := by
  induction' p with u' u' v' w' ha p' ih
  · rw [mem_support_nil_iff] at h
    subst u
    simp!
  · cases h
    · simp!
    · simp! only
      split_ifs with h'
      · subst h'
        simp
      · rw [edges_cons, List.count_cons]
        split_ifs with h''
        · rw [Sym2.eq_iff] at h''
          obtain ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ := h''
          · exact (h' rfl).elim
          · cases p' <;> simp!
        · 

Proof state:
case neg
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v w x u' v' w' : V
ha : Adj G u' v'
p' : Walk G v' w'
ih : ∀ (h : u ∈ support p'), List.count ⟦(u, x)⟧ (edges (takeUntil p' u h)) ≤ 1
a✝ : List.Mem u (support p')
h' : ¬u' = u
h'' : ¬⟦(u, x)⟧ = ⟦(u', v')⟧
⊢ List.count ⟦(u, x)⟧ (edges (takeUntil p' u (_ : u ∈ support p'))) + 0 ≤ 1

Next tactic:
apply ih
@[simp]
theorem takeUntil_copy {u v w v' w'} (p : G.Walk v w) (hv : v = v') (hw : w = w')
    (h : u ∈ (p.copy hv hw).support) :
    (p.copy hv hw).takeUntil u h = (p.takeUntil u (by 

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v w v' w' : V
p : Walk G v w
hv : v = v'
hw : w = w'
h : u ∈ support (Walk.copy p hv hw)
⊢ u ∈ support p

Next tactic:
subst_vars
@[simp]
theorem takeUntil_copy {u v w v' w'} (p : G.Walk v w) (hv : v = v') (hw : w = w')
    (h : u ∈ (p.copy hv hw).support) :
    (p.copy hv hw).takeUntil u h = (p.takeUntil u (by subst_vars; 

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v' w' : V
p : Walk G v' w'
h : u ∈ support (Walk.copy p (_ : v' = v') (_ : w' = w'))
⊢ u ∈ support p

Next tactic:
exact h
@[simp]
theorem takeUntil_copy {u v w v' w'} (p : G.Walk v w) (hv : v = v') (hw : w = w')
    (h : u ∈ (p.copy hv hw).support) :
    (p.copy hv hw).takeUntil u h = (p.takeUntil u (by subst_vars; exact h)).copy hv rfl := by
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v w v' w' : V
p : Walk G v w
hv : v = v'
hw : w = w'
h : u ∈ support (Walk.copy p hv hw)
⊢ takeUntil (Walk.copy p hv hw) u h = Walk.copy (takeUntil p u (_ : u ∈ support p)) hv (_ : u = u)

Next tactic:
subst_vars
@[simp]
theorem takeUntil_copy {u v w v' w'} (p : G.Walk v w) (hv : v = v') (hw : w = w')
    (h : u ∈ (p.copy hv hw).support) :
    (p.copy hv hw).takeUntil u h = (p.takeUntil u (by subst_vars; exact h)).copy hv rfl := by
  subst_vars
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v' w' : V
p : Walk G v' w'
h : u ∈ support (Walk.copy p (_ : v' = v') (_ : w' = w'))
⊢ takeUntil (Walk.copy p (_ : v' = v') (_ : w' = w')) u h =
    Walk.copy (takeUntil p u (_ : u ∈ support p)) (_ : v' = v') (_ : u = u)

Next tactic:
rfl
@[simp]
theorem dropUntil_copy {u v w v' w'} (p : G.Walk v w) (hv : v = v') (hw : w = w')
    (h : u ∈ (p.copy hv hw).support) :
    (p.copy hv hw).dropUntil u h = (p.dropUntil u (by 

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v w v' w' : V
p : Walk G v w
hv : v = v'
hw : w = w'
h : u ∈ support (Walk.copy p hv hw)
⊢ u ∈ support p

Next tactic:
subst_vars
@[simp]
theorem dropUntil_copy {u v w v' w'} (p : G.Walk v w) (hv : v = v') (hw : w = w')
    (h : u ∈ (p.copy hv hw).support) :
    (p.copy hv hw).dropUntil u h = (p.dropUntil u (by subst_vars; 

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v' w' : V
p : Walk G v' w'
h : u ∈ support (Walk.copy p (_ : v' = v') (_ : w' = w'))
⊢ u ∈ support p

Next tactic:
exact h
@[simp]
theorem dropUntil_copy {u v w v' w'} (p : G.Walk v w) (hv : v = v') (hw : w = w')
    (h : u ∈ (p.copy hv hw).support) :
    (p.copy hv hw).dropUntil u h = (p.dropUntil u (by subst_vars; exact h)).copy rfl hw := by
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v w v' w' : V
p : Walk G v w
hv : v = v'
hw : w = w'
h : u ∈ support (Walk.copy p hv hw)
⊢ dropUntil (Walk.copy p hv hw) u h = Walk.copy (dropUntil p u (_ : u ∈ support p)) (_ : u = u) hw

Next tactic:
subst_vars
@[simp]
theorem dropUntil_copy {u v w v' w'} (p : G.Walk v w) (hv : v = v') (hw : w = w')
    (h : u ∈ (p.copy hv hw).support) :
    (p.copy hv hw).dropUntil u h = (p.dropUntil u (by subst_vars; exact h)).copy rfl hw := by
  subst_vars
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v' w' : V
p : Walk G v' w'
h : u ∈ support (Walk.copy p (_ : v' = v') (_ : w' = w'))
⊢ dropUntil (Walk.copy p (_ : v' = v') (_ : w' = w')) u h =
    Walk.copy (dropUntil p u (_ : u ∈ support p)) (_ : u = u) (_ : w' = w')

Next tactic:
rfl
theorem support_takeUntil_subset {u v w : V} (p : G.Walk v w) (h : u ∈ p.support) :
    (p.takeUntil u h).support ⊆ p.support := fun x hx => by
  

Proof state:
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v w : V
p : Walk G v w
h : u ∈ support p
x : V
hx : x ∈ support (takeUntil p u h)
⊢ x ∈ support p

Next tactic:
rw [← take_spec p h, mem_support_append_iff]