[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u' v' u'' v'' : V
p : Walk G u v
hu : u = u'
hv : v = v'
hu' : u' = u''
hv' : v' = v''
⊢ Walk.copy (Walk.copy p hu hv) hu' hv' = Walk.copy p (_ : u = u'') (_ : v = v'')
[PROOFSTEP]
subst_vars
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u'' v'' : V
p : Walk G u'' v''
⊢ Walk.copy (Walk.copy p (_ : u'' = u'') (_ : v'' = v'')) (_ : u'' = u'') (_ : v'' = v'') =
    Walk.copy p (_ : u'' = u'') (_ : v'' = v'')
[PROOFSTEP]
rfl
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u u' : V
hu : u = u'
⊢ Walk.copy nil hu hu = nil
[PROOFSTEP]
subst_vars
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u' : V
⊢ Walk.copy nil (_ : u' = u') (_ : u' = u') = nil
[PROOFSTEP]
rfl
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u' w' : V
h : Adj G u v
p : Walk G v w
hu : u = u'
hw : w = w'
⊢ Walk.copy (cons h p) hu hw = cons (_ : Adj G u' v) (Walk.copy p (_ : v = v) hw)
[PROOFSTEP]
subst_vars
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v u' w' : V
h : Adj G u' v
p : Walk G v w'
⊢ Walk.copy (cons h p) (_ : u' = u') (_ : w' = w') = cons (_ : Adj G u' v) (Walk.copy p (_ : v = v) (_ : w' = w'))
[PROOFSTEP]
rfl
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w v' w' : V
h : Adj G u v
p : Walk G v' w'
hv : v' = v
hw : w' = w
⊢ cons h (Walk.copy p hv hw) = Walk.copy (cons (_ : Adj G u v') p) (_ : u = u) hw
[PROOFSTEP]
subst_vars
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v' w' : V
p : Walk G v' w'
h : Adj G u v'
⊢ cons h (Walk.copy p (_ : v' = v') (_ : w' = w')) = Walk.copy (cons (_ : Adj G u v') p) (_ : u = u) (_ : w' = w')
[PROOFSTEP]
rfl
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
w : Walk G u v
⊢ getVert w 0 = u
[PROOFSTEP]
cases w
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u : V
⊢ getVert nil 0 = u
[PROOFSTEP]
rfl
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v✝ : V
h✝ : Adj G u v✝
p✝ : Walk G v✝ v
⊢ getVert (cons h✝ p✝) 0 = u
[PROOFSTEP]
rfl
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
w : Walk G u v
i : ℕ
hi : length w ≤ i
⊢ getVert w i = v
[PROOFSTEP]
induction w generalizing i with
| nil => rfl
| cons _ _ ih =>
  cases i
  · cases hi
  · exact ih (Nat.succ_le_succ_iff.1 hi)
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
w : Walk G u v
i : ℕ
hi : length w ≤ i
⊢ getVert w i = v
[PROOFSTEP]
induction w generalizing i with
| nil => rfl
| cons _ _ ih =>
  cases i
  · cases hi
  · exact ih (Nat.succ_le_succ_iff.1 hi)
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ : V
i : ℕ
hi : length nil ≤ i
⊢ getVert nil i = u✝
[PROOFSTEP]

| nil => rfl
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ : V
i : ℕ
hi : length nil ≤ i
⊢ getVert nil i = u✝
[PROOFSTEP]
rfl
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ {i : ℕ}, length p✝ ≤ i → getVert p✝ i = w✝
i : ℕ
hi : length (cons h✝ p✝) ≤ i
⊢ getVert (cons h✝ p✝) i = w✝
[PROOFSTEP]

| cons _ _ ih =>
  cases i
  · cases hi
  · exact ih (Nat.succ_le_succ_iff.1 hi)
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ {i : ℕ}, length p✝ ≤ i → getVert p✝ i = w✝
i : ℕ
hi : length (cons h✝ p✝) ≤ i
⊢ getVert (cons h✝ p✝) i = w✝
[PROOFSTEP]
cases i
[GOAL]
case cons.zero
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ {i : ℕ}, length p✝ ≤ i → getVert p✝ i = w✝
hi : length (cons h✝ p✝) ≤ Nat.zero
⊢ getVert (cons h✝ p✝) Nat.zero = w✝
[PROOFSTEP]
cases hi
[GOAL]
case cons.succ
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ {i : ℕ}, length p✝ ≤ i → getVert p✝ i = w✝
n✝ : ℕ
hi : length (cons h✝ p✝) ≤ Nat.succ n✝
⊢ getVert (cons h✝ p✝) (Nat.succ n✝) = w✝
[PROOFSTEP]
exact ih (Nat.succ_le_succ_iff.1 hi)
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
w : Walk G u v
i : ℕ
hi : i < length w
⊢ Adj G (getVert w i) (getVert w (i + 1))
[PROOFSTEP]
induction w generalizing i with
| nil => cases hi
| cons hxy _ ih =>
  cases i
  · simp [getVert, hxy]
  · exact ih (Nat.succ_lt_succ_iff.1 hi)
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
w : Walk G u v
i : ℕ
hi : i < length w
⊢ Adj G (getVert w i) (getVert w (i + 1))
[PROOFSTEP]
induction w generalizing i with
| nil => cases hi
| cons hxy _ ih =>
  cases i
  · simp [getVert, hxy]
  · exact ih (Nat.succ_lt_succ_iff.1 hi)
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ : V
i : ℕ
hi : i < length nil
⊢ Adj G (getVert nil i) (getVert nil (i + 1))
[PROOFSTEP]

| nil => cases hi
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ : V
i : ℕ
hi : i < length nil
⊢ Adj G (getVert nil i) (getVert nil (i + 1))
[PROOFSTEP]
cases hi
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ v✝ w✝ : V
hxy : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ {i : ℕ}, i < length p✝ → Adj G (getVert p✝ i) (getVert p✝ (i + 1))
i : ℕ
hi : i < length (cons hxy p✝)
⊢ Adj G (getVert (cons hxy p✝) i) (getVert (cons hxy p✝) (i + 1))
[PROOFSTEP]

| cons hxy _ ih =>
  cases i
  · simp [getVert, hxy]
  · exact ih (Nat.succ_lt_succ_iff.1 hi)
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ v✝ w✝ : V
hxy : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ {i : ℕ}, i < length p✝ → Adj G (getVert p✝ i) (getVert p✝ (i + 1))
i : ℕ
hi : i < length (cons hxy p✝)
⊢ Adj G (getVert (cons hxy p✝) i) (getVert (cons hxy p✝) (i + 1))
[PROOFSTEP]
cases i
[GOAL]
case cons.zero
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ v✝ w✝ : V
hxy : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ {i : ℕ}, i < length p✝ → Adj G (getVert p✝ i) (getVert p✝ (i + 1))
hi : Nat.zero < length (cons hxy p✝)
⊢ Adj G (getVert (cons hxy p✝) Nat.zero) (getVert (cons hxy p✝) (Nat.zero + 1))
[PROOFSTEP]
simp [getVert, hxy]
[GOAL]
case cons.succ
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ v✝ w✝ : V
hxy : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ {i : ℕ}, i < length p✝ → Adj G (getVert p✝ i) (getVert p✝ (i + 1))
n✝ : ℕ
hi : Nat.succ n✝ < length (cons hxy p✝)
⊢ Adj G (getVert (cons hxy p✝) (Nat.succ n✝)) (getVert (cons hxy p✝) (Nat.succ n✝ + 1))
[PROOFSTEP]
exact ih (Nat.succ_lt_succ_iff.1 hi)
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
⊢ append p nil = p
[PROOFSTEP]
induction p with
| nil => rfl
| cons _ _ ih => rw [cons_append, ih]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
⊢ append p nil = p
[PROOFSTEP]
induction p with
| nil => rfl
| cons _ _ ih => rw [cons_append, ih]
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ : V
⊢ append nil nil = nil
[PROOFSTEP]

| nil => rfl
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ : V
⊢ append nil nil = nil
[PROOFSTEP]
rfl
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : append p✝ nil = p✝
⊢ append (cons h✝ p✝) nil = cons h✝ p✝
[PROOFSTEP]

| cons _ _ ih => rw [cons_append, ih]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : append p✝ nil = p✝
⊢ append (cons h✝ p✝) nil = cons h✝ p✝
[PROOFSTEP]
rw [cons_append, ih]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x : V
p : Walk G u v
q : Walk G v w
r : Walk G w x
⊢ append p (append q r) = append (append p q) r
[PROOFSTEP]
induction p with
| nil => rfl
| cons h p' ih =>
  dsimp only [append]
  rw [ih]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x : V
p : Walk G u v
q : Walk G v w
r : Walk G w x
⊢ append p (append q r) = append (append p q) r
[PROOFSTEP]
induction p with
| nil => rfl
| cons h p' ih =>
  dsimp only [append]
  rw [ih]
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x : V
r : Walk G w x
u✝ : V
q : Walk G u✝ w
⊢ append nil (append q r) = append (append nil q) r
[PROOFSTEP]

| nil => rfl
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x : V
r : Walk G w x
u✝ : V
q : Walk G u✝ w
⊢ append nil (append q r) = append (append nil q) r
[PROOFSTEP]
rfl
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x : V
r : Walk G w x
u✝ v✝ w✝ : V
h : Adj G u✝ v✝
p' : Walk G v✝ w✝
ih : ∀ (q : Walk G w✝ w), append p' (append q r) = append (append p' q) r
q : Walk G w✝ w
⊢ append (cons h p') (append q r) = append (append (cons h p') q) r
[PROOFSTEP]

| cons h p' ih =>
  dsimp only [append]
  rw [ih]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x : V
r : Walk G w x
u✝ v✝ w✝ : V
h : Adj G u✝ v✝
p' : Walk G v✝ w✝
ih : ∀ (q : Walk G w✝ w), append p' (append q r) = append (append p' q) r
q : Walk G w✝ w
⊢ append (cons h p') (append q r) = append (append (cons h p') q) r
[PROOFSTEP]
dsimp only [append]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x : V
r : Walk G w x
u✝ v✝ w✝ : V
h : Adj G u✝ v✝
p' : Walk G v✝ w✝
ih : ∀ (q : Walk G w✝ w), append p' (append q r) = append (append p' q) r
q : Walk G w✝ w
⊢ cons h (append p' (append q r)) = cons h (append (append p' q) r)
[PROOFSTEP]
rw [ih]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u' v' w' : V
p : Walk G u v
q : Walk G v w
hu : u = u'
hv : v = v'
hw : w = w'
⊢ append (Walk.copy p hu hv) (Walk.copy q hv hw) = Walk.copy (append p q) hu hw
[PROOFSTEP]
subst_vars
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u' v' w' : V
p : Walk G u' v'
q : Walk G v' w'
⊢ append (Walk.copy p (_ : u' = u') (_ : v' = v')) (Walk.copy q (_ : v' = v') (_ : w' = w')) =
    Walk.copy (append p q) (_ : u' = u') (_ : w' = w')
[PROOFSTEP]
rfl
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x : V
p : Walk G u v
h : Adj G v w
q : Walk G w x
⊢ append (concat p h) q = append p (cons h q)
[PROOFSTEP]
rw [concat_eq_append, ← append_assoc, cons_nil_append]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
h : Adj G u v
p : Walk G v w
⊢ ∃ x q h', cons h p = concat q h'
[PROOFSTEP]
induction p generalizing u with
| nil => exact ⟨_, nil, h, rfl⟩
| cons h' p ih =>
  obtain ⟨y, q, h'', hc⟩ := ih h'
  refine' ⟨y, cons h q, h'', _⟩
  rw [concat_cons, hc]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
h : Adj G u v
p : Walk G v w
⊢ ∃ x q h', cons h p = concat q h'
[PROOFSTEP]
induction p generalizing u with
| nil => exact ⟨_, nil, h, rfl⟩
| cons h' p ih =>
  obtain ⟨y, q, h'', hc⟩ := ih h'
  refine' ⟨y, cons h q, h'', _⟩
  rw [concat_cons, hc]
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w u✝ u : V
h : Adj G u u✝
⊢ ∃ x q h', cons h nil = concat q h'
[PROOFSTEP]

| nil => exact ⟨_, nil, h, rfl⟩
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w u✝ u : V
h : Adj G u u✝
⊢ ∃ x q h', cons h nil = concat q h'
[PROOFSTEP]
exact ⟨_, nil, h, rfl⟩
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w u✝ v✝ w✝ : V
h' : Adj G u✝ v✝
p : Walk G v✝ w✝
ih : ∀ {u : V} (h : Adj G u v✝), ∃ x q h', cons h p = concat q h'
u : V
h : Adj G u u✝
⊢ ∃ x q h'_1, cons h (cons h' p) = concat q h'_1
[PROOFSTEP]

| cons h' p ih =>
  obtain ⟨y, q, h'', hc⟩ := ih h'
  refine' ⟨y, cons h q, h'', _⟩
  rw [concat_cons, hc]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w u✝ v✝ w✝ : V
h' : Adj G u✝ v✝
p : Walk G v✝ w✝
ih : ∀ {u : V} (h : Adj G u v✝), ∃ x q h', cons h p = concat q h'
u : V
h : Adj G u u✝
⊢ ∃ x q h'_1, cons h (cons h' p) = concat q h'_1
[PROOFSTEP]
obtain ⟨y, q, h'', hc⟩ := ih h'
[GOAL]
case cons.intro.intro.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w u✝ v✝ w✝ : V
h' : Adj G u✝ v✝
p : Walk G v✝ w✝
ih : ∀ {u : V} (h : Adj G u v✝), ∃ x q h', cons h p = concat q h'
u : V
h : Adj G u u✝
y : V
q : Walk G u✝ y
h'' : Adj G y w✝
hc : cons h' p = concat q h''
⊢ ∃ x q h'_1, cons h (cons h' p) = concat q h'_1
[PROOFSTEP]
refine' ⟨y, cons h q, h'', _⟩
[GOAL]
case cons.intro.intro.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w u✝ v✝ w✝ : V
h' : Adj G u✝ v✝
p : Walk G v✝ w✝
ih : ∀ {u : V} (h : Adj G u v✝), ∃ x q h', cons h p = concat q h'
u : V
h : Adj G u u✝
y : V
q : Walk G u✝ y
h'' : Adj G y w✝
hc : cons h' p = concat q h''
⊢ cons h (cons h' p) = concat (cons h q) h''
[PROOFSTEP]
rw [concat_cons, hc]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x : V
p : Walk G u v
q : Walk G v w
r : Walk G u x
⊢ Walk.reverseAux (append p q) r = Walk.reverseAux q (Walk.reverseAux p r)
[PROOFSTEP]
induction p with
| nil => rfl
| cons h _ ih => exact ih q (cons (G.symm h) r)
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x : V
p : Walk G u v
q : Walk G v w
r : Walk G u x
⊢ Walk.reverseAux (append p q) r = Walk.reverseAux q (Walk.reverseAux p r)
[PROOFSTEP]
induction p with
| nil => rfl
| cons h _ ih => exact ih q (cons (G.symm h) r)
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x u✝ : V
q : Walk G u✝ w
r : Walk G u✝ x
⊢ Walk.reverseAux (append nil q) r = Walk.reverseAux q (Walk.reverseAux nil r)
[PROOFSTEP]

| nil => rfl
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x u✝ : V
q : Walk G u✝ w
r : Walk G u✝ x
⊢ Walk.reverseAux (append nil q) r = Walk.reverseAux q (Walk.reverseAux nil r)
[PROOFSTEP]
rfl
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x u✝ v✝ w✝ : V
h : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ (q : Walk G w✝ w) (r : Walk G v✝ x), Walk.reverseAux (append p✝ q) r = Walk.reverseAux q (Walk.reverseAux p✝ r)
q : Walk G w✝ w
r : Walk G u✝ x
⊢ Walk.reverseAux (append (cons h p✝) q) r = Walk.reverseAux q (Walk.reverseAux (cons h p✝) r)
[PROOFSTEP]

| cons h _ ih => exact ih q (cons (G.symm h) r)
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x u✝ v✝ w✝ : V
h : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ (q : Walk G w✝ w) (r : Walk G v✝ x), Walk.reverseAux (append p✝ q) r = Walk.reverseAux q (Walk.reverseAux p✝ r)
q : Walk G w✝ w
r : Walk G u✝ x
⊢ Walk.reverseAux (append (cons h p✝) q) r = Walk.reverseAux q (Walk.reverseAux (cons h p✝) r)
[PROOFSTEP]
exact ih q (cons (G.symm h) r)
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x : V
p : Walk G u v
q : Walk G u w
r : Walk G w x
⊢ append (Walk.reverseAux p q) r = Walk.reverseAux p (append q r)
[PROOFSTEP]
induction p with
| nil => rfl
| cons h _ ih => simp [ih (cons (G.symm h) q)]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x : V
p : Walk G u v
q : Walk G u w
r : Walk G w x
⊢ append (Walk.reverseAux p q) r = Walk.reverseAux p (append q r)
[PROOFSTEP]
induction p with
| nil => rfl
| cons h _ ih => simp [ih (cons (G.symm h) q)]
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x : V
r : Walk G w x
u✝ : V
q : Walk G u✝ w
⊢ append (Walk.reverseAux nil q) r = Walk.reverseAux nil (append q r)
[PROOFSTEP]

| nil => rfl
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x : V
r : Walk G w x
u✝ : V
q : Walk G u✝ w
⊢ append (Walk.reverseAux nil q) r = Walk.reverseAux nil (append q r)
[PROOFSTEP]
rfl
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x : V
r : Walk G w x
u✝ v✝ w✝ : V
h : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ (q : Walk G v✝ w), append (Walk.reverseAux p✝ q) r = Walk.reverseAux p✝ (append q r)
q : Walk G u✝ w
⊢ append (Walk.reverseAux (cons h p✝) q) r = Walk.reverseAux (cons h p✝) (append q r)
[PROOFSTEP]

| cons h _ ih => simp [ih (cons (G.symm h) q)]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x : V
r : Walk G w x
u✝ v✝ w✝ : V
h : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ (q : Walk G v✝ w), append (Walk.reverseAux p✝ q) r = Walk.reverseAux p✝ (append q r)
q : Walk G u✝ w
⊢ append (Walk.reverseAux (cons h p✝) q) r = Walk.reverseAux (cons h p✝) (append q r)
[PROOFSTEP]
simp [ih (cons (G.symm h) q)]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
q : Walk G u w
⊢ Walk.reverseAux p q = append (reverse p) q
[PROOFSTEP]
simp [reverse]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
h : Adj G u v
p : Walk G v w
⊢ reverse (cons h p) = append (reverse p) (cons (_ : Adj G v u) nil)
[PROOFSTEP]
simp [reverse]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u' v' : V
p : Walk G u v
hu : u = u'
hv : v = v'
⊢ reverse (Walk.copy p hu hv) = Walk.copy (reverse p) hv hu
[PROOFSTEP]
subst_vars
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u' v' : V
p : Walk G u' v'
⊢ reverse (Walk.copy p (_ : u' = u') (_ : v' = v')) = Walk.copy (reverse p) (_ : v' = v') (_ : u' = u')
[PROOFSTEP]
rfl
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
q : Walk G v w
⊢ reverse (append p q) = append (reverse q) (reverse p)
[PROOFSTEP]
simp [reverse]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
h : Adj G v w
⊢ reverse (concat p h) = cons (_ : Adj G w v) (reverse p)
[PROOFSTEP]
simp [concat_eq_append]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
⊢ reverse (reverse p) = p
[PROOFSTEP]
induction p with
| nil => rfl
| cons _ _ ih => simp [ih]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
⊢ reverse (reverse p) = p
[PROOFSTEP]
induction p with
| nil => rfl
| cons _ _ ih => simp [ih]
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ : V
⊢ reverse (reverse nil) = nil
[PROOFSTEP]

| nil => rfl
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ : V
⊢ reverse (reverse nil) = nil
[PROOFSTEP]
rfl
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : reverse (reverse p✝) = p✝
⊢ reverse (reverse (cons h✝ p✝)) = cons h✝ p✝
[PROOFSTEP]

| cons _ _ ih => simp [ih]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : reverse (reverse p✝) = p✝
⊢ reverse (reverse (cons h✝ p✝)) = cons h✝ p✝
[PROOFSTEP]
simp [ih]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u' v' : V
p : Walk G u v
hu : u = u'
hv : v = v'
⊢ length (Walk.copy p hu hv) = length p
[PROOFSTEP]
subst_vars
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u' v' : V
p : Walk G u' v'
⊢ length (Walk.copy p (_ : u' = u') (_ : v' = v')) = length p
[PROOFSTEP]
rfl
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
q : Walk G v w
⊢ length (append p q) = length p + length q
[PROOFSTEP]
induction p with
| nil => simp
| cons _ _ ih => simp [ih, add_comm, add_left_comm, add_assoc]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
q : Walk G v w
⊢ length (append p q) = length p + length q
[PROOFSTEP]
induction p with
| nil => simp
| cons _ _ ih => simp [ih, add_comm, add_left_comm, add_assoc]
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ : V
q : Walk G u✝ w
⊢ length (append nil q) = length nil + length q
[PROOFSTEP]

| nil => simp
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ : V
q : Walk G u✝ w
⊢ length (append nil q) = length nil + length q
[PROOFSTEP]
simp
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ (q : Walk G w✝ w), length (append p✝ q) = length p✝ + length q
q : Walk G w✝ w
⊢ length (append (cons h✝ p✝) q) = length (cons h✝ p✝) + length q
[PROOFSTEP]

| cons _ _ ih => simp [ih, add_comm, add_left_comm, add_assoc]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ (q : Walk G w✝ w), length (append p✝ q) = length p✝ + length q
q : Walk G w✝ w
⊢ length (append (cons h✝ p✝) q) = length (cons h✝ p✝) + length q
[PROOFSTEP]
simp [ih, add_comm, add_left_comm, add_assoc]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
q : Walk G u w
⊢ length (Walk.reverseAux p q) = length p + length q
[PROOFSTEP]
induction p with
| nil => simp!
| cons _ _ ih => simp [ih, Nat.add_succ, Nat.succ_add]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
q : Walk G u w
⊢ length (Walk.reverseAux p q) = length p + length q
[PROOFSTEP]
induction p with
| nil => simp!
| cons _ _ ih => simp [ih, Nat.add_succ, Nat.succ_add]
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ : V
q : Walk G u✝ w
⊢ length (Walk.reverseAux nil q) = length nil + length q
[PROOFSTEP]

| nil => simp!
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ : V
q : Walk G u✝ w
⊢ length (Walk.reverseAux nil q) = length nil + length q
[PROOFSTEP]
simp!
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ (q : Walk G v✝ w), length (Walk.reverseAux p✝ q) = length p✝ + length q
q : Walk G u✝ w
⊢ length (Walk.reverseAux (cons h✝ p✝) q) = length (cons h✝ p✝) + length q
[PROOFSTEP]

| cons _ _ ih => simp [ih, Nat.add_succ, Nat.succ_add]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ (q : Walk G v✝ w), length (Walk.reverseAux p✝ q) = length p✝ + length q
q : Walk G u✝ w
⊢ length (Walk.reverseAux (cons h✝ p✝) q) = length (cons h✝ p✝) + length q
[PROOFSTEP]
simp [ih, Nat.add_succ, Nat.succ_add]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
⊢ length (reverse p) = length p
[PROOFSTEP]
simp [reverse]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
⊢ (∃ p, length p = 0) ↔ u = v
[PROOFSTEP]
constructor
[GOAL]
case mp
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
⊢ (∃ p, length p = 0) → u = v
[PROOFSTEP]
rintro ⟨p, hp⟩
[GOAL]
case mp.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
hp : length p = 0
⊢ u = v
[PROOFSTEP]
exact eq_of_length_eq_zero hp
[GOAL]
case mpr
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
⊢ u = v → ∃ p, length p = 0
[PROOFSTEP]
rintro rfl
[GOAL]
case mpr
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u : V
⊢ ∃ p, length p = 0
[PROOFSTEP]
exact ⟨nil, rfl⟩
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u : V
p : Walk G u u
⊢ length p = 0 ↔ p = nil
[PROOFSTEP]
cases p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u : V
⊢ length nil = 0 ↔ nil = nil
[PROOFSTEP]
simp
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v✝ : V
h✝ : Adj G u v✝
p✝ : Walk G v✝ u
⊢ length (cons h✝ p✝) = 0 ↔ cons h✝ p✝ = nil
[PROOFSTEP]
simp
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
motive : (u v : V) → Walk G u v → Sort u_1
Hnil : {u : V} → motive u u nil
Hconcat : {u v w : V} → (p : Walk G u v) → (h : Adj G v w) → motive u v p → motive u w (concat p h)
u v w : V
p : Walk G u v
h : Adj G v w
⊢ concatRec Hnil Hconcat (concat p h) = Hconcat p h (concatRec Hnil Hconcat p)
[PROOFSTEP]
simp only [concatRec]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
motive : (u v : V) → Walk G u v → Sort u_1
Hnil : {u : V} → motive u u nil
Hconcat : {u v w : V} → (p : Walk G u v) → (h : Adj G v w) → motive u v p → motive u w (concat p h)
u v w : V
p : Walk G u v
h : Adj G v w
⊢ (_ : reverse (reverse (concat p h)) = concat p h) ▸ concatRecAux Hnil Hconcat (reverse (concat p h)) =
    Hconcat p h ((_ : reverse (reverse p) = p) ▸ concatRecAux Hnil Hconcat (reverse p))
[PROOFSTEP]
apply eq_of_heq
[GOAL]
case h
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
motive : (u v : V) → Walk G u v → Sort u_1
Hnil : {u : V} → motive u u nil
Hconcat : {u v w : V} → (p : Walk G u v) → (h : Adj G v w) → motive u v p → motive u w (concat p h)
u v w : V
p : Walk G u v
h : Adj G v w
⊢ HEq ((_ : reverse (reverse (concat p h)) = concat p h) ▸ concatRecAux Hnil Hconcat (reverse (concat p h)))
    (Hconcat p h ((_ : reverse (reverse p) = p) ▸ concatRecAux Hnil Hconcat (reverse p)))
[PROOFSTEP]
apply rec_heq_of_heq
[GOAL]
case h.h
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
motive : (u v : V) → Walk G u v → Sort u_1
Hnil : {u : V} → motive u u nil
Hconcat : {u v w : V} → (p : Walk G u v) → (h : Adj G v w) → motive u v p → motive u w (concat p h)
u v w : V
p : Walk G u v
h : Adj G v w
⊢ HEq (concatRecAux Hnil Hconcat (reverse (concat p h)))
    (Hconcat p h ((_ : reverse (reverse p) = p) ▸ concatRecAux Hnil Hconcat (reverse p)))
[PROOFSTEP]
trans concatRecAux @Hnil @Hconcat (cons h.symm p.reverse)
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
motive : (u v : V) → Walk G u v → Sort u_1
Hnil : {u : V} → motive u u nil
Hconcat : {u v w : V} → (p : Walk G u v) → (h : Adj G v w) → motive u v p → motive u w (concat p h)
u v w : V
p : Walk G u v
h : Adj G v w
⊢ HEq (concatRecAux Hnil Hconcat (reverse (concat p h))) (concatRecAux Hnil Hconcat (cons (_ : Adj G w v) (reverse p)))
[PROOFSTEP]
congr
[GOAL]
case e_8.h
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
motive : (u v : V) → Walk G u v → Sort u_1
Hnil : {u : V} → motive u u nil
Hconcat : {u v w : V} → (p : Walk G u v) → (h : Adj G v w) → motive u v p → motive u w (concat p h)
u v w : V
p : Walk G u v
h : Adj G v w
⊢ reverse (concat p h) = cons (_ : Adj G w v) (reverse p)
[PROOFSTEP]
simp
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
motive : (u v : V) → Walk G u v → Sort u_1
Hnil : {u : V} → motive u u nil
Hconcat : {u v w : V} → (p : Walk G u v) → (h : Adj G v w) → motive u v p → motive u w (concat p h)
u v w : V
p : Walk G u v
h : Adj G v w
⊢ HEq (concatRecAux Hnil Hconcat (cons (_ : Adj G w v) (reverse p)))
    (Hconcat p h ((_ : reverse (reverse p) = p) ▸ concatRecAux Hnil Hconcat (reverse p)))
[PROOFSTEP]
rw [concatRecAux, rec_heq_iff_heq]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
motive : (u v : V) → Walk G u v → Sort u_1
Hnil : {u : V} → motive u u nil
Hconcat : {u v w : V} → (p : Walk G u v) → (h : Adj G v w) → motive u v p → motive u w (concat p h)
u v w : V
p : Walk G u v
h : Adj G v w
⊢ HEq (Hconcat (reverse (reverse p)) (_ : Adj G v w) (concatRecAux Hnil Hconcat (reverse p)))
    (Hconcat p h ((_ : reverse (reverse p) = p) ▸ concatRecAux Hnil Hconcat (reverse p)))
[PROOFSTEP]
congr
[GOAL]
case e_4.h
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
motive : (u v : V) → Walk G u v → Sort u_1
Hnil : {u : V} → motive u u nil
Hconcat : {u v w : V} → (p : Walk G u v) → (h : Adj G v w) → motive u v p → motive u w (concat p h)
u v w : V
p : Walk G u v
h : Adj G v w
⊢ reverse (reverse p) = p
[PROOFSTEP]
simp [heq_rec_iff_heq]
[GOAL]
case e_6
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
motive : (u v : V) → Walk G u v → Sort u_1
Hnil : {u : V} → motive u u nil
Hconcat : {u v w : V} → (p : Walk G u v) → (h : Adj G v w) → motive u v p → motive u w (concat p h)
u v w : V
p : Walk G u v
h : Adj G v w
⊢ HEq (concatRecAux Hnil Hconcat (reverse p)) ((_ : reverse (reverse p) = p) ▸ concatRecAux Hnil Hconcat (reverse p))
[PROOFSTEP]
simp [heq_rec_iff_heq]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
h : Adj G v u
⊢ concat p h ≠ nil
[PROOFSTEP]
cases p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u : V
h : Adj G u u
⊢ concat nil h ≠ nil
[PROOFSTEP]
simp [concat]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
h : Adj G v u
v✝ : V
h✝ : Adj G u v✝
p✝ : Walk G v✝ v
⊢ concat (cons h✝ p✝) h ≠ nil
[PROOFSTEP]
simp [concat]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' w : V
p : Walk G u v
h : Adj G v w
p' : Walk G u v'
h' : Adj G v' w
he : concat p h = concat p' h'
⊢ ∃ hv, Walk.copy p (_ : u = u) hv = p'
[PROOFSTEP]
induction p with
| nil =>
  cases p'
  · exact ⟨rfl, rfl⟩
  · exfalso
    simp only [concat_nil, concat_cons, cons.injEq] at he 
    obtain ⟨rfl, he⟩ := he
    simp only [heq_iff_eq] at he 
    exact concat_ne_nil _ _ he.symm
| cons _ _ ih =>
  rw [concat_cons] at he 
  cases p'
  · exfalso
    simp only [concat_nil, cons.injEq] at he 
    obtain ⟨rfl, he⟩ := he
    rw [heq_iff_eq] at he 
    exact concat_ne_nil _ _ he
  · rw [concat_cons, cons.injEq] at he 
    obtain ⟨rfl, he⟩ := he
    rw [heq_iff_eq] at he 
    obtain ⟨rfl, rfl⟩ := ih he
    exact ⟨rfl, rfl⟩
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' w : V
p : Walk G u v
h : Adj G v w
p' : Walk G u v'
h' : Adj G v' w
he : concat p h = concat p' h'
⊢ ∃ hv, Walk.copy p (_ : u = u) hv = p'
[PROOFSTEP]
induction p with
| nil =>
  cases p'
  · exact ⟨rfl, rfl⟩
  · exfalso
    simp only [concat_nil, concat_cons, cons.injEq] at he 
    obtain ⟨rfl, he⟩ := he
    simp only [heq_iff_eq] at he 
    exact concat_ne_nil _ _ he.symm
| cons _ _ ih =>
  rw [concat_cons] at he 
  cases p'
  · exfalso
    simp only [concat_nil, cons.injEq] at he 
    obtain ⟨rfl, he⟩ := he
    rw [heq_iff_eq] at he 
    exact concat_ne_nil _ _ he
  · rw [concat_cons, cons.injEq] at he 
    obtain ⟨rfl, he⟩ := he
    rw [heq_iff_eq] at he 
    obtain ⟨rfl, rfl⟩ := ih he
    exact ⟨rfl, rfl⟩
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' w : V
h' : Adj G v' w
u✝ : V
h : Adj G u✝ w
p' : Walk G u✝ v'
he : concat nil h = concat p' h'
⊢ ∃ hv, Walk.copy nil (_ : u✝ = u✝) hv = p'
[PROOFSTEP]

| nil =>
  cases p'
  · exact ⟨rfl, rfl⟩
  · exfalso
    simp only [concat_nil, concat_cons, cons.injEq] at he 
    obtain ⟨rfl, he⟩ := he
    simp only [heq_iff_eq] at he 
    exact concat_ne_nil _ _ he.symm
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' w : V
h' : Adj G v' w
u✝ : V
h : Adj G u✝ w
p' : Walk G u✝ v'
he : concat nil h = concat p' h'
⊢ ∃ hv, Walk.copy nil (_ : u✝ = u✝) hv = p'
[PROOFSTEP]
cases p'
[GOAL]
case nil.nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' w : V
h' h : Adj G v' w
he : concat nil h = concat nil h'
⊢ ∃ hv, Walk.copy nil (_ : v' = v') hv = nil
[PROOFSTEP]
exact ⟨rfl, rfl⟩
[GOAL]
case nil.cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' w : V
h' : Adj G v' w
u✝ : V
h : Adj G u✝ w
v✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ v'
he : concat nil h = concat (cons h✝ p✝) h'
⊢ ∃ hv, Walk.copy nil (_ : u✝ = u✝) hv = cons h✝ p✝
[PROOFSTEP]
exfalso
[GOAL]
case nil.cons.h
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' w : V
h' : Adj G v' w
u✝ : V
h : Adj G u✝ w
v✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ v'
he : concat nil h = concat (cons h✝ p✝) h'
⊢ False
[PROOFSTEP]
simp only [concat_nil, concat_cons, cons.injEq] at he 
[GOAL]
case nil.cons.h
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' w : V
h' : Adj G v' w
u✝ : V
h : Adj G u✝ w
v✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ v'
he : w = v✝ ∧ HEq nil (concat p✝ h')
⊢ False
[PROOFSTEP]
obtain ⟨rfl, he⟩ := he
[GOAL]
case nil.cons.h.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' w : V
h' : Adj G v' w
u✝ : V
h h✝ : Adj G u✝ w
p✝ : Walk G w v'
he : HEq nil (concat p✝ h')
⊢ False
[PROOFSTEP]
simp only [heq_iff_eq] at he 
[GOAL]
case nil.cons.h.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' w : V
h' : Adj G v' w
u✝ : V
h h✝ : Adj G u✝ w
p✝ : Walk G w v'
he : nil = concat p✝ h'
⊢ False
[PROOFSTEP]
exact concat_ne_nil _ _ he.symm
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' w : V
h' : Adj G v' w
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ {h : Adj G w✝ w} {p' : Walk G v✝ v'}, concat p✝ h = concat p' h' → ∃ hv, Walk.copy p✝ (_ : v✝ = v✝) hv = p'
h : Adj G w✝ w
p' : Walk G u✝ v'
he : concat (cons h✝ p✝) h = concat p' h'
⊢ ∃ hv, Walk.copy (cons h✝ p✝) (_ : u✝ = u✝) hv = p'
[PROOFSTEP]

| cons _ _ ih =>
  rw [concat_cons] at he 
  cases p'
  · exfalso
    simp only [concat_nil, cons.injEq] at he 
    obtain ⟨rfl, he⟩ := he
    rw [heq_iff_eq] at he 
    exact concat_ne_nil _ _ he
  · rw [concat_cons, cons.injEq] at he 
    obtain ⟨rfl, he⟩ := he
    rw [heq_iff_eq] at he 
    obtain ⟨rfl, rfl⟩ := ih he
    exact ⟨rfl, rfl⟩
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' w : V
h' : Adj G v' w
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ {h : Adj G w✝ w} {p' : Walk G v✝ v'}, concat p✝ h = concat p' h' → ∃ hv, Walk.copy p✝ (_ : v✝ = v✝) hv = p'
h : Adj G w✝ w
p' : Walk G u✝ v'
he : concat (cons h✝ p✝) h = concat p' h'
⊢ ∃ hv, Walk.copy (cons h✝ p✝) (_ : u✝ = u✝) hv = p'
[PROOFSTEP]
rw [concat_cons] at he 
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' w : V
h' : Adj G v' w
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ {h : Adj G w✝ w} {p' : Walk G v✝ v'}, concat p✝ h = concat p' h' → ∃ hv, Walk.copy p✝ (_ : v✝ = v✝) hv = p'
h : Adj G w✝ w
p' : Walk G u✝ v'
he : cons h✝ (concat p✝ h) = concat p' h'
⊢ ∃ hv, Walk.copy (cons h✝ p✝) (_ : u✝ = u✝) hv = p'
[PROOFSTEP]
cases p'
[GOAL]
case cons.nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' w : V
h' : Adj G v' w
v✝ w✝ : V
p✝ : Walk G v✝ w✝
ih : ∀ {h : Adj G w✝ w} {p' : Walk G v✝ v'}, concat p✝ h = concat p' h' → ∃ hv, Walk.copy p✝ (_ : v✝ = v✝) hv = p'
h : Adj G w✝ w
h✝ : Adj G v' v✝
he : cons h✝ (concat p✝ h) = concat nil h'
⊢ ∃ hv, Walk.copy (cons h✝ p✝) (_ : v' = v') hv = nil
[PROOFSTEP]
exfalso
[GOAL]
case cons.nil.h
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' w : V
h' : Adj G v' w
v✝ w✝ : V
p✝ : Walk G v✝ w✝
ih : ∀ {h : Adj G w✝ w} {p' : Walk G v✝ v'}, concat p✝ h = concat p' h' → ∃ hv, Walk.copy p✝ (_ : v✝ = v✝) hv = p'
h : Adj G w✝ w
h✝ : Adj G v' v✝
he : cons h✝ (concat p✝ h) = concat nil h'
⊢ False
[PROOFSTEP]
simp only [concat_nil, cons.injEq] at he 
[GOAL]
case cons.nil.h
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' w : V
h' : Adj G v' w
v✝ w✝ : V
p✝ : Walk G v✝ w✝
ih : ∀ {h : Adj G w✝ w} {p' : Walk G v✝ v'}, concat p✝ h = concat p' h' → ∃ hv, Walk.copy p✝ (_ : v✝ = v✝) hv = p'
h : Adj G w✝ w
h✝ : Adj G v' v✝
he : v✝ = w ∧ HEq (concat p✝ h) nil
⊢ False
[PROOFSTEP]
obtain ⟨rfl, he⟩ := he
[GOAL]
case cons.nil.h.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' v✝ w✝ : V
p✝ : Walk G v✝ w✝
h✝ h' : Adj G v' v✝
ih : ∀ {h : Adj G w✝ v✝} {p' : Walk G v✝ v'}, concat p✝ h = concat p' h' → ∃ hv, Walk.copy p✝ (_ : v✝ = v✝) hv = p'
h : Adj G w✝ v✝
he : HEq (concat p✝ h) nil
⊢ False
[PROOFSTEP]
rw [heq_iff_eq] at he 
[GOAL]
case cons.nil.h.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' v✝ w✝ : V
p✝ : Walk G v✝ w✝
h✝ h' : Adj G v' v✝
ih : ∀ {h : Adj G w✝ v✝} {p' : Walk G v✝ v'}, concat p✝ h = concat p' h' → ∃ hv, Walk.copy p✝ (_ : v✝ = v✝) hv = p'
h : Adj G w✝ v✝
he : concat p✝ h = nil
⊢ False
[PROOFSTEP]
exact concat_ne_nil _ _ he
[GOAL]
case cons.cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' w : V
h' : Adj G v' w
u✝ v✝¹ w✝ : V
h✝¹ : Adj G u✝ v✝¹
p✝¹ : Walk G v✝¹ w✝
ih : ∀ {h : Adj G w✝ w} {p' : Walk G v✝¹ v'}, concat p✝¹ h = concat p' h' → ∃ hv, Walk.copy p✝¹ (_ : v✝¹ = v✝¹) hv = p'
h : Adj G w✝ w
v✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ v'
he : cons h✝¹ (concat p✝¹ h) = concat (cons h✝ p✝) h'
⊢ ∃ hv, Walk.copy (cons h✝¹ p✝¹) (_ : u✝ = u✝) hv = cons h✝ p✝
[PROOFSTEP]
rw [concat_cons, cons.injEq] at he 
[GOAL]
case cons.cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' w : V
h' : Adj G v' w
u✝ v✝¹ w✝ : V
h✝¹ : Adj G u✝ v✝¹
p✝¹ : Walk G v✝¹ w✝
ih : ∀ {h : Adj G w✝ w} {p' : Walk G v✝¹ v'}, concat p✝¹ h = concat p' h' → ∃ hv, Walk.copy p✝¹ (_ : v✝¹ = v✝¹) hv = p'
h : Adj G w✝ w
v✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ v'
he : v✝¹ = v✝ ∧ HEq (concat p✝¹ h) (concat p✝ h')
⊢ ∃ hv, Walk.copy (cons h✝¹ p✝¹) (_ : u✝ = u✝) hv = cons h✝ p✝
[PROOFSTEP]
obtain ⟨rfl, he⟩ := he
[GOAL]
case cons.cons.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' w : V
h' : Adj G v' w
u✝ v✝ w✝ : V
h✝¹ : Adj G u✝ v✝
p✝¹ : Walk G v✝ w✝
ih : ∀ {h : Adj G w✝ w} {p' : Walk G v✝ v'}, concat p✝¹ h = concat p' h' → ∃ hv, Walk.copy p✝¹ (_ : v✝ = v✝) hv = p'
h : Adj G w✝ w
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ v'
he : HEq (concat p✝¹ h) (concat p✝ h')
⊢ ∃ hv, Walk.copy (cons h✝¹ p✝¹) (_ : u✝ = u✝) hv = cons h✝ p✝
[PROOFSTEP]
rw [heq_iff_eq] at he 
[GOAL]
case cons.cons.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v' w : V
h' : Adj G v' w
u✝ v✝ w✝ : V
h✝¹ : Adj G u✝ v✝
p✝¹ : Walk G v✝ w✝
ih : ∀ {h : Adj G w✝ w} {p' : Walk G v✝ v'}, concat p✝¹ h = concat p' h' → ∃ hv, Walk.copy p✝¹ (_ : v✝ = v✝) hv = p'
h : Adj G w✝ w
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ v'
he : concat p✝¹ h = concat p✝ h'
⊢ ∃ hv, Walk.copy (cons h✝¹ p✝¹) (_ : u✝ = u✝) hv = cons h✝ p✝
[PROOFSTEP]
obtain ⟨rfl, rfl⟩ := ih he
[GOAL]
case cons.cons.intro.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ v✝ w✝ : V
h✝¹ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
h : Adj G w✝ w
h✝ : Adj G u✝ v✝
h' : Adj G w✝ w
ih : ∀ {h : Adj G w✝ w} {p' : Walk G v✝ w✝}, concat p✝ h = concat p' h' → ∃ hv, Walk.copy p✝ (_ : v✝ = v✝) hv = p'
he : concat p✝ h = concat (Walk.copy p✝ (_ : v✝ = v✝) (_ : w✝ = w✝)) h'
⊢ ∃ hv, Walk.copy (cons h✝¹ p✝) (_ : u✝ = u✝) hv = cons h✝ (Walk.copy p✝ (_ : v✝ = v✝) (_ : w✝ = w✝))
[PROOFSTEP]
exact ⟨rfl, rfl⟩
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
h : Adj G v w
⊢ support (concat p h) = List.concat (support p) w
[PROOFSTEP]
induction p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ : V
h : Adj G u✝ w
⊢ support (concat nil h) = List.concat (support nil) w
[PROOFSTEP]
simp [*, concat_nil]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : ∀ (h : Adj G w✝ w), support (concat p✝ h) = List.concat (support p✝) w
h : Adj G w✝ w
⊢ support (concat (cons h✝ p✝) h) = List.concat (support (cons h✝ p✝)) w
[PROOFSTEP]
simp [*, concat_nil]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u' v' : V
p : Walk G u v
hu : u = u'
hv : v = v'
⊢ support (Walk.copy p hu hv) = support p
[PROOFSTEP]
subst_vars
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u' v' : V
p : Walk G u' v'
⊢ support (Walk.copy p (_ : u' = u') (_ : v' = v')) = support p
[PROOFSTEP]
rfl
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
p' : Walk G v w
⊢ support (append p p') = support p ++ List.tail (support p')
[PROOFSTEP]
induction p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ : V
p' : Walk G u✝ w
⊢ support (append nil p') = support nil ++ List.tail (support p')
[PROOFSTEP]
cases p'
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : ∀ (p' : Walk G w✝ w), support (append p✝ p') = support p✝ ++ List.tail (support p')
p' : Walk G w✝ w
⊢ support (append (cons h✝ p✝) p') = support (cons h✝ p✝) ++ List.tail (support p')
[PROOFSTEP]
cases p'
[GOAL]
case nil.nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
⊢ support (append nil nil) = support nil ++ List.tail (support nil)
[PROOFSTEP]
simp [*]
[GOAL]
case nil.cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ v✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w
⊢ support (append nil (cons h✝ p✝)) = support nil ++ List.tail (support (cons h✝ p✝))
[PROOFSTEP]
simp [*]
[GOAL]
case cons.nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ v✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w
p_ih✝ : ∀ (p' : Walk G w w), support (append p✝ p') = support p✝ ++ List.tail (support p')
⊢ support (append (cons h✝ p✝) nil) = support (cons h✝ p✝) ++ List.tail (support nil)
[PROOFSTEP]
simp [*]
[GOAL]
case cons.cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ v✝¹ w✝ : V
h✝¹ : Adj G u✝ v✝¹
p✝¹ : Walk G v✝¹ w✝
p_ih✝ : ∀ (p' : Walk G w✝ w), support (append p✝¹ p') = support p✝¹ ++ List.tail (support p')
v✝ : V
h✝ : Adj G w✝ v✝
p✝ : Walk G v✝ w
⊢ support (append (cons h✝¹ p✝¹) (cons h✝ p✝)) = support (cons h✝¹ p✝¹) ++ List.tail (support (cons h✝ p✝))
[PROOFSTEP]
simp [*]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
⊢ support (reverse p) = List.reverse (support p)
[PROOFSTEP]
induction p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ : V
⊢ support (reverse nil) = List.reverse (support nil)
[PROOFSTEP]
simp [support_append, *]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : support (reverse p✝) = List.reverse (support p✝)
⊢ support (reverse (cons h✝ p✝)) = List.reverse (support (cons h✝ p✝))
[PROOFSTEP]
simp [support_append, *]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
⊢ support p ≠ []
[PROOFSTEP]
cases p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u : V
⊢ support nil ≠ []
[PROOFSTEP]
simp
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v✝ : V
h✝ : Adj G u v✝
p✝ : Walk G v✝ v
⊢ support (cons h✝ p✝) ≠ []
[PROOFSTEP]
simp
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
p' : Walk G v w
⊢ List.tail (support (append p p')) = List.tail (support p) ++ List.tail (support p')
[PROOFSTEP]
rw [support_append, List.tail_append_of_ne_nil _ _ (support_ne_nil _)]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
⊢ support p = u :: List.tail (support p)
[PROOFSTEP]
cases p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u : V
⊢ support nil = u :: List.tail (support nil)
[PROOFSTEP]
simp
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v✝ : V
h✝ : Adj G u v✝
p✝ : Walk G v✝ v
⊢ support (cons h✝ p✝) = u :: List.tail (support (cons h✝ p✝))
[PROOFSTEP]
simp
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
⊢ u ∈ support p
[PROOFSTEP]
cases p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u : V
⊢ u ∈ support nil
[PROOFSTEP]
simp
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v✝ : V
h✝ : Adj G u v✝
p✝ : Walk G v✝ v
⊢ u ∈ support (cons h✝ p✝)
[PROOFSTEP]
simp
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
⊢ v ∈ support p
[PROOFSTEP]
induction p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ : V
⊢ u✝ ∈ support nil
[PROOFSTEP]
simp [*]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : w✝ ∈ support p✝
⊢ w✝ ∈ support (cons h✝ p✝)
[PROOFSTEP]
simp [*]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
⊢ u ∈ {w | w ∈ support p}
[PROOFSTEP]
simp
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
⊢ w ∈ support p ↔ w = u ∨ w ∈ List.tail (support p)
[PROOFSTEP]
cases p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u w : V
⊢ w ∈ support nil ↔ w = u ∨ w ∈ List.tail (support nil)
[PROOFSTEP]
simp
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w v✝ : V
h✝ : Adj G u v✝
p✝ : Walk G v✝ v
⊢ w ∈ support (cons h✝ p✝) ↔ w = u ∨ w ∈ List.tail (support (cons h✝ p✝))
[PROOFSTEP]
simp
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
⊢ u ∈ support nil ↔ u = v
[PROOFSTEP]
simp
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
t u v w : V
p : Walk G u v
p' : Walk G v w
⊢ t ∈ List.tail (support (append p p')) ↔ t ∈ List.tail (support p) ∨ t ∈ List.tail (support p')
[PROOFSTEP]
rw [tail_support_append, List.mem_append]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
h : u ≠ v
p : Walk G u v
⊢ v ∈ List.tail (support p)
[PROOFSTEP]
obtain ⟨_, _, _, rfl⟩ := exists_eq_cons_of_ne h p
[GOAL]
case intro.intro.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
h : u ≠ v
w✝² : V
w✝¹ : Adj G u w✝²
w✝ : Walk G w✝² v
⊢ v ∈ List.tail (support (cons w✝¹ w✝))
[PROOFSTEP]
simp
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
t u v w : V
p : Walk G u v
p' : Walk G v w
⊢ t ∈ support (append p p') ↔ t ∈ support p ∨ t ∈ support p'
[PROOFSTEP]
simp only [mem_support_iff, mem_tail_support_append_iff]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
t u v w : V
p : Walk G u v
p' : Walk G v w
⊢ t = u ∨ t ∈ List.tail (support p) ∨ t ∈ List.tail (support p') ↔
    (t = u ∨ t ∈ List.tail (support p)) ∨ t = v ∨ t ∈ List.tail (support p')
[PROOFSTEP]
obtain rfl | h := eq_or_ne t v
[GOAL]
case inl
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
t u w : V
p : Walk G u t
p' : Walk G t w
⊢ t = u ∨ t ∈ List.tail (support p) ∨ t ∈ List.tail (support p') ↔
    (t = u ∨ t ∈ List.tail (support p)) ∨ t = t ∨ t ∈ List.tail (support p')
[PROOFSTEP]
obtain rfl | h' := eq_or_ne t u
[GOAL]
case inr
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
t u v w : V
p : Walk G u v
p' : Walk G v w
h : t ≠ v
⊢ t = u ∨ t ∈ List.tail (support p) ∨ t ∈ List.tail (support p') ↔
    (t = u ∨ t ∈ List.tail (support p)) ∨ t = v ∨ t ∈ List.tail (support p')
[PROOFSTEP]
obtain rfl | h' := eq_or_ne t u
[GOAL]
case inl.inl
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
t w : V
p' : Walk G t w
p : Walk G t t
⊢ t = t ∨ t ∈ List.tail (support p) ∨ t ∈ List.tail (support p') ↔
    (t = t ∨ t ∈ List.tail (support p)) ∨ t = t ∨ t ∈ List.tail (support p')
[PROOFSTEP]
try have := h'.symm
[GOAL]
case inl.inl
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
t w : V
p' : Walk G t w
p : Walk G t t
⊢ t = t ∨ t ∈ List.tail (support p) ∨ t ∈ List.tail (support p') ↔
    (t = t ∨ t ∈ List.tail (support p)) ∨ t = t ∨ t ∈ List.tail (support p')
[PROOFSTEP]
have := h'.symm
[GOAL]
case inl.inr
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
t u w : V
p : Walk G u t
p' : Walk G t w
h' : t ≠ u
⊢ t = u ∨ t ∈ List.tail (support p) ∨ t ∈ List.tail (support p') ↔
    (t = u ∨ t ∈ List.tail (support p)) ∨ t = t ∨ t ∈ List.tail (support p')
[PROOFSTEP]
try have := h'.symm
[GOAL]
case inl.inr
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
t u w : V
p : Walk G u t
p' : Walk G t w
h' : t ≠ u
⊢ t = u ∨ t ∈ List.tail (support p) ∨ t ∈ List.tail (support p') ↔
    (t = u ∨ t ∈ List.tail (support p)) ∨ t = t ∨ t ∈ List.tail (support p')
[PROOFSTEP]
have := h'.symm
[GOAL]
case inr.inl
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
t v w : V
p' : Walk G v w
h : t ≠ v
p : Walk G t v
⊢ t = t ∨ t ∈ List.tail (support p) ∨ t ∈ List.tail (support p') ↔
    (t = t ∨ t ∈ List.tail (support p)) ∨ t = v ∨ t ∈ List.tail (support p')
[PROOFSTEP]
try have := h'.symm
[GOAL]
case inr.inl
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
t v w : V
p' : Walk G v w
h : t ≠ v
p : Walk G t v
⊢ t = t ∨ t ∈ List.tail (support p) ∨ t ∈ List.tail (support p') ↔
    (t = t ∨ t ∈ List.tail (support p)) ∨ t = v ∨ t ∈ List.tail (support p')
[PROOFSTEP]
have := h'.symm
[GOAL]
case inr.inr
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
t u v w : V
p : Walk G u v
p' : Walk G v w
h : t ≠ v
h' : t ≠ u
⊢ t = u ∨ t ∈ List.tail (support p) ∨ t ∈ List.tail (support p') ↔
    (t = u ∨ t ∈ List.tail (support p)) ∨ t = v ∨ t ∈ List.tail (support p')
[PROOFSTEP]
try have := h'.symm
[GOAL]
case inr.inr
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
t u v w : V
p : Walk G u v
p' : Walk G v w
h : t ≠ v
h' : t ≠ u
⊢ t = u ∨ t ∈ List.tail (support p) ∨ t ∈ List.tail (support p') ↔
    (t = u ∨ t ∈ List.tail (support p)) ∨ t = v ∨ t ∈ List.tail (support p')
[PROOFSTEP]
have := h'.symm
[GOAL]
case inl.inl
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
t w : V
p' : Walk G t w
p : Walk G t t
⊢ t = t ∨ t ∈ List.tail (support p) ∨ t ∈ List.tail (support p') ↔
    (t = t ∨ t ∈ List.tail (support p)) ∨ t = t ∨ t ∈ List.tail (support p')
[PROOFSTEP]
simp [*]
[GOAL]
case inl.inr
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
t u w : V
p : Walk G u t
p' : Walk G t w
h' : t ≠ u
this : u ≠ t
⊢ t = u ∨ t ∈ List.tail (support p) ∨ t ∈ List.tail (support p') ↔
    (t = u ∨ t ∈ List.tail (support p)) ∨ t = t ∨ t ∈ List.tail (support p')
[PROOFSTEP]
simp [*]
[GOAL]
case inr.inl
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
t v w : V
p' : Walk G v w
h : t ≠ v
p : Walk G t v
⊢ t = t ∨ t ∈ List.tail (support p) ∨ t ∈ List.tail (support p') ↔
    (t = t ∨ t ∈ List.tail (support p)) ∨ t = v ∨ t ∈ List.tail (support p')
[PROOFSTEP]
simp [*]
[GOAL]
case inr.inr
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
t u v w : V
p : Walk G u v
p' : Walk G v w
h : t ≠ v
h' : t ≠ u
this : u ≠ t
⊢ t = u ∨ t ∈ List.tail (support p) ∨ t ∈ List.tail (support p') ↔
    (t = u ∨ t ∈ List.tail (support p)) ∨ t = v ∨ t ∈ List.tail (support p')
[PROOFSTEP]
simp [*]
[GOAL]
V✝ : Type u
V' : Type v
V'' : Type w
G✝ : SimpleGraph V✝
G' : SimpleGraph V'
G'' : SimpleGraph V''
V : Type u
G : SimpleGraph V
u v w : V
p : Walk G u v
q : Walk G v w
⊢ support p ⊆ support (append p q)
[PROOFSTEP]
simp only [Walk.support_append, List.subset_append_left]
[GOAL]
V✝ : Type u
V' : Type v
V'' : Type w
G✝ : SimpleGraph V✝
G' : SimpleGraph V'
G'' : SimpleGraph V''
V : Type u
G : SimpleGraph V
u v w : V
p : Walk G u v
q : Walk G v w
⊢ support q ⊆ support (append p q)
[PROOFSTEP]
intro h
[GOAL]
V✝ : Type u
V' : Type v
V'' : Type w
G✝ : SimpleGraph V✝
G' : SimpleGraph V'
G'' : SimpleGraph V''
V : Type u
G : SimpleGraph V
u v w : V
p : Walk G u v
q : Walk G v w
h : V
⊢ h ∈ support q → h ∈ support (append p q)
[PROOFSTEP]
simp (config := { contextual := true }) only [mem_support_append_iff, or_true_iff, imp_true_iff]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
⊢ ↑(support p) = {u} + ↑(List.tail (support p))
[PROOFSTEP]
cases p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u : V
⊢ ↑(support nil) = {u} + ↑(List.tail (support nil))
[PROOFSTEP]
rfl
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v✝ : V
h✝ : Adj G u v✝
p✝ : Walk G v✝ v
⊢ ↑(support (cons h✝ p✝)) = {u} + ↑(List.tail (support (cons h✝ p✝)))
[PROOFSTEP]
rfl
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
p' : Walk G v w
⊢ ↑(support (append p p')) = {u} + ↑(List.tail (support p)) + ↑(List.tail (support p'))
[PROOFSTEP]
rw [support_append, ← Multiset.coe_add, coe_support]
[GOAL]
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 u v
p' : Walk G v w
⊢ ↑(support (append p p')) = ↑(support p) + ↑(support p') - {v}
[PROOFSTEP]
rw [support_append, ← Multiset.coe_add]
[GOAL]
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 u v
p' : Walk G v w
⊢ ↑(support p) + ↑(List.tail (support p')) = ↑(support p) + ↑(support p') - {v}
[PROOFSTEP]
simp only [coe_support]
[GOAL]
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 u v
p' : Walk G v w
⊢ {u} + ↑(List.tail (support p)) + ↑(List.tail (support p')) =
    {u} + ↑(List.tail (support p)) + ({v} + ↑(List.tail (support p'))) - {v}
[PROOFSTEP]
rw [add_comm ({ v } : Multiset V)]
[GOAL]
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 u v
p' : Walk G v w
⊢ {u} + ↑(List.tail (support p)) + ↑(List.tail (support p')) =
    {u} + ↑(List.tail (support p)) + (↑(List.tail (support p')) + {v}) - {v}
[PROOFSTEP]
simp only [← add_assoc, add_tsub_cancel_right]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
d : Dart G
v w : V
h : d.snd = v
p : Walk G v w
⊢ List.Chain (DartAdj G) d (darts p)
[PROOFSTEP]
induction p generalizing d with
| nil => exact List.Chain.nil
| cons h' p ih => exact List.Chain.cons (by exact h) (ih (by rfl))
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
d : Dart G
v w : V
h : d.snd = v
p : Walk G v w
⊢ List.Chain (DartAdj G) d (darts p)
[PROOFSTEP]
induction p generalizing d with
| nil => exact List.Chain.nil
| cons h' p ih => exact List.Chain.cons (by exact h) (ih (by rfl))
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w u✝ : V
d : Dart G
h : d.snd = u✝
⊢ List.Chain (DartAdj G) d (darts nil)
[PROOFSTEP]

| nil => exact List.Chain.nil
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w u✝ : V
d : Dart G
h : d.snd = u✝
⊢ List.Chain (DartAdj G) d (darts nil)
[PROOFSTEP]
exact List.Chain.nil
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w u✝ v✝ w✝ : V
h' : Adj G u✝ v✝
p : Walk G v✝ w✝
ih : ∀ {d : Dart G}, d.snd = v✝ → List.Chain (DartAdj G) d (darts p)
d : Dart G
h : d.snd = u✝
⊢ List.Chain (DartAdj G) d (darts (cons h' p))
[PROOFSTEP]

| cons h' p ih => exact List.Chain.cons (by exact h) (ih (by rfl))
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w u✝ v✝ w✝ : V
h' : Adj G u✝ v✝
p : Walk G v✝ w✝
ih : ∀ {d : Dart G}, d.snd = v✝ → List.Chain (DartAdj G) d (darts p)
d : Dart G
h : d.snd = u✝
⊢ List.Chain (DartAdj G) d (darts (cons h' p))
[PROOFSTEP]
exact List.Chain.cons (by exact h) (ih (by rfl))
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w u✝ v✝ w✝ : V
h' : Adj G u✝ v✝
p : Walk G v✝ w✝
ih : ∀ {d : Dart G}, d.snd = v✝ → List.Chain (DartAdj G) d (darts p)
d : Dart G
h : d.snd = u✝
⊢ DartAdj G d { toProd := (u✝, v✝), is_adj := h' }
[PROOFSTEP]
exact h
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w u✝ v✝ w✝ : V
h' : Adj G u✝ v✝
p : Walk G v✝ w✝
ih : ∀ {d : Dart G}, d.snd = v✝ → List.Chain (DartAdj G) d (darts p)
d : Dart G
h : d.snd = u✝
⊢ { toProd := (u✝, v✝), is_adj := h' }.toProd.snd = v✝
[PROOFSTEP]
rfl
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v✝¹ v v✝ : V
h : Adj G u v✝
p : Walk G v✝ v
⊢ { toProd := (u, v✝), is_adj := h }.toProd.snd = v✝
[PROOFSTEP]
rfl
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v✝ : V
h' : Adj G u v✝
p' : Walk G v✝ v
e : Sym2 V
h : e ∈ edges (cons h' p')
⊢ e ∈ edgeSet G
[PROOFSTEP]
cases h
[GOAL]
case head
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v✝ : V
h' : Adj G u v✝
p' : Walk G v✝ v
⊢ Dart.edge { toProd := (u, v✝), is_adj := h' } ∈ edgeSet G
[PROOFSTEP]
exact h'
[GOAL]
case tail
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v✝ : V
h' : Adj G u v✝
p' : Walk G v✝ v
e : Sym2 V
a✝ : List.Mem e (List.map Dart.edge (darts p'))
⊢ e ∈ edgeSet G
[PROOFSTEP]
next h' => exact edges_subset_edgeSet p' h'
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v✝ : V
h'✝ : Adj G u v✝
p' : Walk G v✝ v
e : Sym2 V
h' : List.Mem e (List.map Dart.edge (darts p'))
⊢ e ∈ edgeSet G
[PROOFSTEP]
exact edges_subset_edgeSet p' h'
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
h : Adj G v w
⊢ darts (concat p h) = List.concat (darts p) { toProd := (v, w), is_adj := h }
[PROOFSTEP]
induction p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ : V
h : Adj G u✝ w
⊢ darts (concat nil h) = List.concat (darts nil) { toProd := (u✝, w), is_adj := h }
[PROOFSTEP]
simp [*, concat_nil]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : ∀ (h : Adj G w✝ w), darts (concat p✝ h) = List.concat (darts p✝) { toProd := (w✝, w), is_adj := h }
h : Adj G w✝ w
⊢ darts (concat (cons h✝ p✝) h) = List.concat (darts (cons h✝ p✝)) { toProd := (w✝, w), is_adj := h }
[PROOFSTEP]
simp [*, concat_nil]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u' v' : V
p : Walk G u v
hu : u = u'
hv : v = v'
⊢ darts (Walk.copy p hu hv) = darts p
[PROOFSTEP]
subst_vars
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u' v' : V
p : Walk G u' v'
⊢ darts (Walk.copy p (_ : u' = u') (_ : v' = v')) = darts p
[PROOFSTEP]
rfl
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
p' : Walk G v w
⊢ darts (append p p') = darts p ++ darts p'
[PROOFSTEP]
induction p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ : V
p' : Walk G u✝ w
⊢ darts (append nil p') = darts nil ++ darts p'
[PROOFSTEP]
simp [*]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : ∀ (p' : Walk G w✝ w), darts (append p✝ p') = darts p✝ ++ darts p'
p' : Walk G w✝ w
⊢ darts (append (cons h✝ p✝) p') = darts (cons h✝ p✝) ++ darts p'
[PROOFSTEP]
simp [*]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
⊢ darts (reverse p) = List.reverse (List.map Dart.symm (darts p))
[PROOFSTEP]
induction p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ : V
⊢ darts (reverse nil) = List.reverse (List.map Dart.symm (darts nil))
[PROOFSTEP]
simp [*, Sym2.eq_swap]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : darts (reverse p✝) = List.reverse (List.map Dart.symm (darts p✝))
⊢ darts (reverse (cons h✝ p✝)) = List.reverse (List.map Dart.symm (darts (cons h✝ p✝)))
[PROOFSTEP]
simp [*, Sym2.eq_swap]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
d : Dart G
p : Walk G u v
⊢ d ∈ darts (reverse p) ↔ Dart.symm d ∈ darts p
[PROOFSTEP]
simp
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
⊢ u :: List.map (fun x => x.snd) (darts p) = support p
[PROOFSTEP]
induction p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ : V
⊢ u✝ :: List.map (fun x => x.snd) (darts nil) = support nil
[PROOFSTEP]
simp! [*]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : v✝ :: List.map (fun x => x.snd) (darts p✝) = support p✝
⊢ u✝ :: List.map (fun x => x.snd) (darts (cons h✝ p✝)) = support (cons h✝ p✝)
[PROOFSTEP]
simp! [*]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
⊢ List.map (fun x => x.snd) (darts p) = List.tail (support p)
[PROOFSTEP]
simpa using congr_arg List.tail (cons_map_snd_darts p)
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
⊢ List.map (fun x => x.fst) (darts p) ++ [v] = support p
[PROOFSTEP]
induction p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ : V
⊢ List.map (fun x => x.fst) (darts nil) ++ [u✝] = support nil
[PROOFSTEP]
simp! [*]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : List.map (fun x => x.fst) (darts p✝) ++ [w✝] = support p✝
⊢ List.map (fun x => x.fst) (darts (cons h✝ p✝)) ++ [w✝] = support (cons h✝ p✝)
[PROOFSTEP]
simp! [*]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
⊢ List.map (fun x => x.fst) (darts p) = List.dropLast (support p)
[PROOFSTEP]
simpa! using congr_arg List.dropLast (map_fst_darts_append p)
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
h : Adj G v w
⊢ edges (concat p h) = List.concat (edges p) (Quotient.mk (Sym2.Rel.setoid V) (v, w))
[PROOFSTEP]
simp [edges]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u' v' : V
p : Walk G u v
hu : u = u'
hv : v = v'
⊢ edges (Walk.copy p hu hv) = edges p
[PROOFSTEP]
subst_vars
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u' v' : V
p : Walk G u' v'
⊢ edges (Walk.copy p (_ : u' = u') (_ : v' = v')) = edges p
[PROOFSTEP]
rfl
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
p' : Walk G v w
⊢ edges (append p p') = edges p ++ edges p'
[PROOFSTEP]
simp [edges]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
⊢ edges (reverse p) = List.reverse (edges p)
[PROOFSTEP]
simp [edges, List.map_reverse]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
⊢ List.length (support p) = length p + 1
[PROOFSTEP]
induction p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ : V
⊢ List.length (support nil) = length nil + 1
[PROOFSTEP]
simp [*]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : List.length (support p✝) = length p✝ + 1
⊢ List.length (support (cons h✝ p✝)) = length (cons h✝ p✝) + 1
[PROOFSTEP]
simp [*]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
⊢ List.length (darts p) = length p
[PROOFSTEP]
induction p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ : V
⊢ List.length (darts nil) = length nil
[PROOFSTEP]
simp [*]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : List.length (darts p✝) = length p✝
⊢ List.length (darts (cons h✝ p✝)) = length (cons h✝ p✝)
[PROOFSTEP]
simp [*]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
⊢ List.length (edges p) = length p
[PROOFSTEP]
simp [edges]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v✝ : V
h : Adj G u v✝
p' : Walk G v✝ v
d : Dart G
hd : d ∈ darts (cons h p')
⊢ d.fst ∈ support (cons h p')
[PROOFSTEP]
simp only [support_cons, darts_cons, List.mem_cons] at hd ⊢
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v✝ : V
h : Adj G u v✝
p' : Walk G v✝ v
d : Dart G
hd : d = { toProd := (u, v✝), is_adj := h } ∨ d ∈ darts p'
⊢ d.fst = u ∨ d.fst ∈ support p'
[PROOFSTEP]
rcases hd with (rfl | hd)
[GOAL]
case inl
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v✝ : V
h : Adj G u v✝
p' : Walk G v✝ v
⊢ { toProd := (u, v✝), is_adj := h }.toProd.fst = u ∨ { toProd := (u, v✝), is_adj := h }.toProd.fst ∈ support p'
[PROOFSTEP]
exact Or.inl rfl
[GOAL]
case inr
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v v✝ : V
h : Adj G u v✝
p' : Walk G v✝ v
d : Dart G
hd : d ∈ darts p'
⊢ d.fst = u ∨ d.fst ∈ support p'
[PROOFSTEP]
exact Or.inr (dart_fst_mem_support_of_mem_darts _ hd)
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
d : Dart G
h : d ∈ darts p
⊢ d.snd ∈ support p
[PROOFSTEP]
simpa using p.reverse.dart_fst_mem_support_of_mem_darts (by simp [h] : d.symm ∈ p.reverse.darts)
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
d : Dart G
h : d ∈ darts p
⊢ Dart.symm d ∈ darts (reverse p)
[PROOFSTEP]
simp [h]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
t u v w : V
p : Walk G v w
he : Quotient.mk (Sym2.Rel.setoid V) (t, u) ∈ edges p
⊢ t ∈ support p
[PROOFSTEP]
obtain ⟨d, hd, he⟩ := List.mem_map.mp he
[GOAL]
case intro.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
t u v w : V
p : Walk G v w
he✝ : Quotient.mk (Sym2.Rel.setoid V) (t, u) ∈ edges p
d : Dart G
hd : d ∈ darts p
he : Dart.edge d = Quotient.mk (Sym2.Rel.setoid V) (t, u)
⊢ t ∈ support p
[PROOFSTEP]
rw [dart_edge_eq_mk'_iff'] at he 
[GOAL]
case intro.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
t u v w : V
p : Walk G v w
he✝ : Quotient.mk (Sym2.Rel.setoid V) (t, u) ∈ edges p
d : Dart G
hd : d ∈ darts p
he : d.fst = t ∧ d.snd = u ∨ d.fst = u ∧ d.snd = t
⊢ t ∈ support p
[PROOFSTEP]
rcases he with (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩)
[GOAL]
case intro.intro.inl.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
p : Walk G v w
d : Dart G
hd : d ∈ darts p
he : Quotient.mk (Sym2.Rel.setoid V) (d.fst, d.snd) ∈ edges p
⊢ d.fst ∈ support p
[PROOFSTEP]
exact dart_fst_mem_support_of_mem_darts _ hd
[GOAL]
case intro.intro.inr.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
p : Walk G v w
d : Dart G
hd : d ∈ darts p
he : Quotient.mk (Sym2.Rel.setoid V) (d.snd, d.fst) ∈ edges p
⊢ d.snd ∈ support p
[PROOFSTEP]
exact dart_snd_mem_support_of_mem_darts _ hd
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
t u v w : V
p : Walk G v w
he : Quotient.mk (Sym2.Rel.setoid V) (t, u) ∈ edges p
⊢ u ∈ support p
[PROOFSTEP]
rw [Sym2.eq_swap] at he 
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
t u v w : V
p : Walk G v w
he : Quotient.mk (Sym2.Rel.setoid V) (u, t) ∈ edges p
⊢ u ∈ support p
[PROOFSTEP]
exact p.fst_mem_support_of_mem_edges he
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
h : List.Nodup (support p)
⊢ List.Nodup (darts p)
[PROOFSTEP]
induction p with
| nil => simp
| cons _ p' ih =>
  simp only [darts_cons, support_cons, List.nodup_cons] at h ⊢
  exact ⟨fun h' => h.1 (dart_fst_mem_support_of_mem_darts p' h'), ih h.2⟩
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
h : List.Nodup (support p)
⊢ List.Nodup (darts p)
[PROOFSTEP]
induction p with
| nil => simp
| cons _ p' ih =>
  simp only [darts_cons, support_cons, List.nodup_cons] at h ⊢
  exact ⟨fun h' => h.1 (dart_fst_mem_support_of_mem_darts p' h'), ih h.2⟩
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ : V
h : List.Nodup (support nil)
⊢ List.Nodup (darts nil)
[PROOFSTEP]

| nil => simp
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ : V
h : List.Nodup (support nil)
⊢ List.Nodup (darts nil)
[PROOFSTEP]
simp
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p' : Walk G v✝ w✝
ih : List.Nodup (support p') → List.Nodup (darts p')
h : List.Nodup (support (cons h✝ p'))
⊢ List.Nodup (darts (cons h✝ p'))
[PROOFSTEP]

| cons _ p' ih =>
  simp only [darts_cons, support_cons, List.nodup_cons] at h ⊢
  exact ⟨fun h' => h.1 (dart_fst_mem_support_of_mem_darts p' h'), ih h.2⟩
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p' : Walk G v✝ w✝
ih : List.Nodup (support p') → List.Nodup (darts p')
h : List.Nodup (support (cons h✝ p'))
⊢ List.Nodup (darts (cons h✝ p'))
[PROOFSTEP]
simp only [darts_cons, support_cons, List.nodup_cons] at h ⊢
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p' : Walk G v✝ w✝
ih : List.Nodup (support p') → List.Nodup (darts p')
h : ¬u✝ ∈ support p' ∧ List.Nodup (support p')
⊢ ¬{ toProd := (u✝, v✝), is_adj := h✝ } ∈ darts p' ∧ List.Nodup (darts p')
[PROOFSTEP]
exact ⟨fun h' => h.1 (dart_fst_mem_support_of_mem_darts p' h'), ih h.2⟩
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
h : List.Nodup (support p)
⊢ List.Nodup (edges p)
[PROOFSTEP]
induction p with
| nil => simp
| cons _ p' ih =>
  simp only [edges_cons, support_cons, List.nodup_cons] at h ⊢
  exact ⟨fun h' => h.1 (fst_mem_support_of_mem_edges p' h'), ih h.2⟩
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
h : List.Nodup (support p)
⊢ List.Nodup (edges p)
[PROOFSTEP]
induction p with
| nil => simp
| cons _ p' ih =>
  simp only [edges_cons, support_cons, List.nodup_cons] at h ⊢
  exact ⟨fun h' => h.1 (fst_mem_support_of_mem_edges p' h'), ih h.2⟩
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ : V
h : List.Nodup (support nil)
⊢ List.Nodup (edges nil)
[PROOFSTEP]

| nil => simp
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ : V
h : List.Nodup (support nil)
⊢ List.Nodup (edges nil)
[PROOFSTEP]
simp
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p' : Walk G v✝ w✝
ih : List.Nodup (support p') → List.Nodup (edges p')
h : List.Nodup (support (cons h✝ p'))
⊢ List.Nodup (edges (cons h✝ p'))
[PROOFSTEP]

| cons _ p' ih =>
  simp only [edges_cons, support_cons, List.nodup_cons] at h ⊢
  exact ⟨fun h' => h.1 (fst_mem_support_of_mem_edges p' h'), ih h.2⟩
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p' : Walk G v✝ w✝
ih : List.Nodup (support p') → List.Nodup (edges p')
h : List.Nodup (support (cons h✝ p'))
⊢ List.Nodup (edges (cons h✝ p'))
[PROOFSTEP]
simp only [edges_cons, support_cons, List.nodup_cons] at h ⊢
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p' : Walk G v✝ w✝
ih : List.Nodup (support p') → List.Nodup (edges p')
h : ¬u✝ ∈ support p' ∧ List.Nodup (support p')
⊢ ¬Quotient.mk (Sym2.Rel.setoid V) (u✝, v✝) ∈ edges p' ∧ List.Nodup (edges p')
[PROOFSTEP]
exact ⟨fun h' => h.1 (fst_mem_support_of_mem_edges p' h'), ih h.2⟩
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
p : Walk G v w
⊢ Nil p ↔ support p = [v]
[PROOFSTEP]
cases p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v : V
⊢ Nil nil ↔ support nil = [v]
[PROOFSTEP]
simp
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w v✝ : V
h✝ : Adj G v v✝
p✝ : Walk G v✝ w
⊢ Nil (cons h✝ p✝) ↔ support (cons h✝ p✝) = [v]
[PROOFSTEP]
simp
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
p : Walk G v w
⊢ Nil p ↔ length p = 0
[PROOFSTEP]
cases p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v : V
⊢ Nil nil ↔ length nil = 0
[PROOFSTEP]
simp
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w v✝ : V
h✝ : Adj G v v✝
p✝ : Walk G v✝ w
⊢ Nil (cons h✝ p✝) ↔ length (cons h✝ p✝) = 0
[PROOFSTEP]
simp
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
p : Walk G v w
⊢ ¬Nil p ↔ ∃ u h q, p = cons h q
[PROOFSTEP]
cases p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v : V
⊢ ¬Nil nil ↔ ∃ u h q, nil = cons h q
[PROOFSTEP]
simp [*]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w v✝ : V
h✝ : Adj G v v✝
p✝ : Walk G v✝ w
⊢ ¬Nil (cons h✝ p✝) ↔ ∃ u h q, cons h✝ p✝ = cons h q
[PROOFSTEP]
simp [*]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
x y : V
p : Walk G x y
hp : ¬Nil p
⊢ x :: support (tail p hp) = support p
[PROOFSTEP]
rw [← support_cons, cons_tail_eq]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
x y : V
p : Walk G x y
hp : ¬Nil p
⊢ length (tail p hp) + 1 = length p
[PROOFSTEP]
rw [← length_cons, cons_tail_eq]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
x y x' y' : V
p : Walk G x y
hx : x = x'
hy : y = y'
⊢ Nil (Walk.copy p hx hy) = Nil p
[PROOFSTEP]
subst_vars
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
x' y' : V
p : Walk G x' y'
⊢ Nil (Walk.copy p (_ : x' = x') (_ : y' = y')) = Nil p
[PROOFSTEP]
rfl
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u' v' : V
p : Walk G u v
hu : u = u'
hv : v = v'
⊢ IsTrail (Walk.copy p hu hv) ↔ IsTrail p
[PROOFSTEP]
subst_vars
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u' v' : V
p : Walk G u' v'
⊢ IsTrail (Walk.copy p (_ : u' = u') (_ : v' = v')) ↔ IsTrail p
[PROOFSTEP]
rfl
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u' v' : V
p : Walk G u v
hu : u = u'
hv : v = v'
⊢ IsPath (Walk.copy p hu hv) ↔ IsPath p
[PROOFSTEP]
subst_vars
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u' v' : V
p : Walk G u' v'
⊢ IsPath (Walk.copy p (_ : u' = u') (_ : v' = v')) ↔ IsPath p
[PROOFSTEP]
rfl
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u u' : V
p : Walk G u u
hu : u = u'
⊢ IsCircuit (Walk.copy p hu hu) ↔ IsCircuit p
[PROOFSTEP]
subst_vars
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u' : V
p : Walk G u' u'
⊢ IsCircuit (Walk.copy p (_ : u' = u') (_ : u' = u')) ↔ IsCircuit p
[PROOFSTEP]
rfl
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u u' : V
p : Walk G u u
hu : u = u'
⊢ IsCycle (Walk.copy p hu hu) ↔ IsCycle p
[PROOFSTEP]
subst_vars
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u' : V
p : Walk G u' u'
⊢ IsCycle (Walk.copy p (_ : u' = u') (_ : u' = u')) ↔ IsCycle p
[PROOFSTEP]
rfl
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u : V
⊢ List.Nodup (edges Walk.nil)
[PROOFSTEP]
simp [edges]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
h : Adj G u v
p : Walk G v w
⊢ IsTrail (cons h p) → IsTrail p
[PROOFSTEP]
simp [isTrail_def]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
h : Adj G u v
p : Walk G v w
⊢ IsTrail (cons h p) ↔ IsTrail p ∧ ¬Quotient.mk (Sym2.Rel.setoid V) (u, v) ∈ edges p
[PROOFSTEP]
simp [isTrail_def, and_comm]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
h : IsTrail p
⊢ IsTrail (Walk.reverse p)
[PROOFSTEP]
simpa [isTrail_def] using h
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
⊢ IsTrail (reverse p) ↔ IsTrail p
[PROOFSTEP]
constructor
[GOAL]
case mp
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
⊢ IsTrail (reverse p) → IsTrail p
[PROOFSTEP]
intro h
[GOAL]
case mp
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
h : IsTrail (reverse p)
⊢ IsTrail p
[PROOFSTEP]
convert h.reverse _
[GOAL]
case h.e'_5
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
h : IsTrail (reverse p)
⊢ p = reverse (reverse p)
[PROOFSTEP]
try rw [reverse_reverse]
[GOAL]
case h.e'_5
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
h : IsTrail (reverse p)
⊢ p = reverse (reverse p)
[PROOFSTEP]
rw [reverse_reverse]
[GOAL]
case mpr
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
⊢ IsTrail p → IsTrail (reverse p)
[PROOFSTEP]
intro h
[GOAL]
case mpr
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
h : IsTrail p
⊢ IsTrail (reverse p)
[PROOFSTEP]
convert h.reverse _
[GOAL]

[PROOFSTEP]
try rw [reverse_reverse]
[GOAL]

[PROOFSTEP]
rw [reverse_reverse]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
q : Walk G v w
h : IsTrail (append p q)
⊢ IsTrail p
[PROOFSTEP]
rw [isTrail_def, edges_append, List.nodup_append] at h 
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
q : Walk G v w
h : List.Nodup (edges p) ∧ List.Nodup (edges q) ∧ List.Disjoint (edges p) (edges q)
⊢ IsTrail p
[PROOFSTEP]
exact ⟨h.1⟩
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
q : Walk G v w
h : IsTrail (append p q)
⊢ IsTrail q
[PROOFSTEP]
rw [isTrail_def, edges_append, List.nodup_append] at h 
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
q : Walk G v w
h : List.Nodup (edges p) ∧ List.Nodup (edges q) ∧ List.Disjoint (edges p) (edges q)
⊢ IsTrail q
[PROOFSTEP]
exact ⟨h.2.1⟩
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u : V
⊢ IsPath Walk.nil
[PROOFSTEP]
constructor
[GOAL]
case toIsTrail
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u : V
⊢ IsTrail Walk.nil
[PROOFSTEP]
simp
[GOAL]
case support_nodup
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u : V
⊢ List.Nodup (support Walk.nil)
[PROOFSTEP]
simp
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
h : Adj G u v
p : Walk G v w
⊢ IsPath (cons h p) → IsPath p
[PROOFSTEP]
simp [isPath_def]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
h : Adj G u v
p : Walk G v w
⊢ IsPath (cons h p) ↔ IsPath p ∧ ¬u ∈ support p
[PROOFSTEP]
constructor
[GOAL]
case mp
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
h : Adj G u v
p : Walk G v w
⊢ IsPath (cons h p) → IsPath p ∧ ¬u ∈ support p
[PROOFSTEP]
simp (config := { contextual := true }) [isPath_def]
[GOAL]
case mpr
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
h : Adj G u v
p : Walk G v w
⊢ IsPath p ∧ ¬u ∈ support p → IsPath (cons h p)
[PROOFSTEP]
simp (config := { contextual := true }) [isPath_def]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u : V
p : Walk G u u
⊢ IsPath p ↔ p = nil
[PROOFSTEP]
cases p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u : V
⊢ IsPath nil ↔ nil = nil
[PROOFSTEP]
simp [IsPath.nil]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v✝ : V
h✝ : Adj G u v✝
p✝ : Walk G v✝ u
⊢ IsPath (cons h✝ p✝) ↔ cons h✝ p✝ = nil
[PROOFSTEP]
simp [IsPath.nil]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
h : IsPath p
⊢ IsPath (Walk.reverse p)
[PROOFSTEP]
simpa [isPath_def] using h
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
⊢ IsPath (reverse p) ↔ IsPath p
[PROOFSTEP]
constructor
[GOAL]
case mp
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
⊢ IsPath (reverse p) → IsPath p
[PROOFSTEP]
intro h
[GOAL]
case mpr
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
⊢ IsPath p → IsPath (reverse p)
[PROOFSTEP]
intro h
[GOAL]
case mp
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
h : IsPath (reverse p)
⊢ IsPath p
[PROOFSTEP]
convert h.reverse
[GOAL]
case mpr
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
h : IsPath p
⊢ IsPath (reverse p)
[PROOFSTEP]
convert h.reverse
[GOAL]
case h.e'_5
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
h : IsPath (reverse p)
⊢ p = reverse (reverse p)
[PROOFSTEP]
simp
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
q : Walk G v w
⊢ IsPath (append p q) → IsPath p
[PROOFSTEP]
simp only [isPath_def, support_append]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
q : Walk G v w
⊢ List.Nodup (support p ++ List.tail (support q)) → List.Nodup (support p)
[PROOFSTEP]
exact List.Nodup.of_append_left
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
q : Walk G v w
h : IsPath (append p q)
⊢ IsPath q
[PROOFSTEP]
rw [← isPath_reverse_iff] at h ⊢
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
q : Walk G v w
h : IsPath (Walk.reverse (append p q))
⊢ IsPath (Walk.reverse q)
[PROOFSTEP]
rw [reverse_append] at h 
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
q : Walk G v w
h : IsPath (append (Walk.reverse q) (Walk.reverse p))
⊢ IsPath (Walk.reverse q)
[PROOFSTEP]
apply h.of_append_left
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G v u
h : Adj G u v
⊢ IsCycle (cons h p) ↔ IsPath p ∧ ¬Quotient.mk (Sym2.Rel.setoid V) (u, v) ∈ edges p
[PROOFSTEP]
simp only [Walk.isCycle_def, Walk.isPath_def, Walk.isTrail_def, edges_cons, List.nodup_cons, support_cons,
  List.tail_cons]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G v u
h : Adj G u v
⊢ (¬Quotient.mk (Sym2.Rel.setoid V) (u, v) ∈ edges p ∧ List.Nodup (edges p)) ∧ cons h p ≠ nil ∧ List.Nodup (support p) ↔
    List.Nodup (support p) ∧ ¬Quotient.mk (Sym2.Rel.setoid V) (u, v) ∈ edges p
[PROOFSTEP]
have : p.support.Nodup → p.edges.Nodup := edges_nodup_of_support_nodup
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G v u
h : Adj G u v
this : List.Nodup (support p) → List.Nodup (edges p)
⊢ (¬Quotient.mk (Sym2.Rel.setoid V) (u, v) ∈ edges p ∧ List.Nodup (edges p)) ∧ cons h p ≠ nil ∧ List.Nodup (support p) ↔
    List.Nodup (support p) ∧ ¬Quotient.mk (Sym2.Rel.setoid V) (u, v) ∈ edges p
[PROOFSTEP]
tauto
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
hp : IsPath p
hp' : ¬Nil p
⊢ IsPath (Walk.tail p hp')
[PROOFSTEP]
rw [Walk.isPath_def] at hp ⊢
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
hp : List.Nodup (support p)
hp' : ¬Nil p
⊢ List.Nodup (support (Walk.tail p hp'))
[PROOFSTEP]
rw [← cons_support_tail _ hp', List.nodup_cons] at hp 
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
hp' : ¬Nil p
hp : ¬u ∈ support (Walk.tail p hp') ∧ List.Nodup (support (Walk.tail p hp'))
⊢ List.Nodup (support (Walk.tail p hp'))
[PROOFSTEP]
exact hp.2
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v : V
p : Walk G u v
⊢ Decidable (IsPath p)
[PROOFSTEP]
rw [isPath_def]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v : V
p : Walk G u v
⊢ Decidable (List.Nodup (support p))
[PROOFSTEP]
infer_instance
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : Fintype V
u v : V
p : Walk G u v
hp : IsPath p
⊢ length p < Fintype.card V
[PROOFSTEP]
rw [Nat.lt_iff_add_one_le, ← length_support]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : Fintype V
u v : V
p : Walk G u v
hp : IsPath p
⊢ List.length (support p) ≤ Fintype.card V
[PROOFSTEP]
exact hp.support_nodup.length_le_card
[GOAL]
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
h : u ∈ support nil
⊢ Walk G v u
[PROOFSTEP]
rw [mem_support_nil_iff.mp h]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
v w✝ w v✝ : V
r : Adj G v v✝
p : Walk G v✝ w
u : V
h : u ∈ support (cons r p)
hx : v = u
⊢ Walk G v u
[PROOFSTEP]
subst u
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
v w✝ w v✝ : V
r : Adj G v v✝
p : Walk G v✝ w
h : v ∈ support (cons r p)
⊢ Walk G v v
[PROOFSTEP]
exact Walk.nil
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
v w✝ w v✝ : V
r : Adj G v v✝
p : Walk G v✝ w
u : V
h : u ∈ support (cons r p)
hx : ¬v = u
⊢ u ∈ support p
[PROOFSTEP]
cases h
[GOAL]
case head
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
v w✝ w v✝ : V
r : Adj G v v✝
p : Walk G v✝ w
hx : ¬v = v
⊢ v ∈ support p
case tail
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
v w✝ w v✝ : V
r : Adj G v v✝
p : Walk G v✝ w
u : V
hx : ¬v = u
a✝ : List.Mem u (support p)
⊢ u ∈ support p
[PROOFSTEP]
exact (hx rfl).elim
[GOAL]
case tail
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
v w✝ w v✝ : V
r : Adj G v v✝
p : Walk G v✝ w
u : V
hx : ¬v = u
a✝ : List.Mem u (support p)
⊢ u ∈ support p
[PROOFSTEP]
assumption
[GOAL]
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
h : u ∈ support nil
⊢ Walk G u v
[PROOFSTEP]
rw [mem_support_nil_iff.mp h]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
v w✝ w v✝ : V
r : Adj G v v✝
p : Walk G v✝ w
u : V
h : u ∈ support (cons r p)
hx : v = u
⊢ Walk G u w
[PROOFSTEP]
subst u
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
v w✝ w v✝ : V
r : Adj G v v✝
p : Walk G v✝ w
h : v ∈ support (cons r p)
⊢ Walk G v w
[PROOFSTEP]
exact cons r p
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
v w✝ w v✝ : V
r : Adj G v v✝
p : Walk G v✝ w
u : V
h : u ∈ support (cons r p)
hx : ¬v = u
⊢ u ∈ support p
[PROOFSTEP]
cases h
[GOAL]
case head
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
v w✝ w v✝ : V
r : Adj G v v✝
p : Walk G v✝ w
hx : ¬v = v
⊢ v ∈ support p
case tail
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
v w✝ w v✝ : V
r : Adj G v v✝
p : Walk G v✝ w
u : V
hx : ¬v = u
a✝ : List.Mem u (support p)
⊢ u ∈ support p
[PROOFSTEP]
exact (hx rfl).elim
[GOAL]
case tail
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
v w✝ w v✝ : V
r : Adj G v v✝
p : Walk G v✝ w
u : V
hx : ¬v = u
a✝ : List.Mem u (support p)
⊢ u ∈ support p
[PROOFSTEP]
assumption
[GOAL]
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
⊢ append (takeUntil p u h) (dropUntil p u h) = p
[PROOFSTEP]
induction p
[GOAL]
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 u✝ : V
h : u ∈ support nil
⊢ append (takeUntil nil u h) (dropUntil nil u h) = nil
[PROOFSTEP]
rw [mem_support_nil_iff] at h 
[GOAL]
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 u✝ : V
h✝ : u ∈ support nil
h : u = u✝
⊢ append (takeUntil nil u h✝) (dropUntil nil u h✝) = nil
[PROOFSTEP]
subst u
[GOAL]
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 u✝ : V
h : u✝ ∈ support nil
⊢ append (takeUntil nil u✝ h) (dropUntil nil u✝ h) = nil
[PROOFSTEP]
rfl
[GOAL]
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 u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : ∀ (h : u ∈ support p✝), append (takeUntil p✝ u h) (dropUntil p✝ u h) = p✝
h : u ∈ support (cons h✝ p✝)
⊢ append (takeUntil (cons h✝ p✝) u h) (dropUntil (cons h✝ p✝) u h) = cons h✝ p✝
[PROOFSTEP]
cases h
[GOAL]
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 v✝ w✝ : V
p✝ : Walk G v✝ w✝
p_ih✝ : ∀ (h : u ∈ support p✝), append (takeUntil p✝ u h) (dropUntil p✝ u h) = p✝
h✝ : Adj G u v✝
⊢ append (takeUntil (cons h✝ p✝) u (_ : List.Mem u (u :: support p✝)))
      (dropUntil (cons h✝ p✝) u (_ : List.Mem u (u :: support p✝))) =
    cons h✝ p✝
[PROOFSTEP]
simp!
[GOAL]
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 u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : ∀ (h : u ∈ support p✝), append (takeUntil p✝ u h) (dropUntil p✝ u h) = p✝
a✝ : List.Mem u (support p✝)
⊢ append (takeUntil (cons h✝ p✝) u (_ : List.Mem u (u✝ :: support p✝)))
      (dropUntil (cons h✝ p✝) u (_ : List.Mem u (u✝ :: support p✝))) =
    cons h✝ p✝
[PROOFSTEP]
simp! only
[GOAL]
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 u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : ∀ (h : u ∈ support p✝), append (takeUntil p✝ u h) (dropUntil p✝ u h) = p✝
a✝ : List.Mem u (support p✝)
⊢ append
      (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 h✝ (takeUntil p✝ u (_ : u ∈ support p✝)))
      (if h : u✝ = u then
        Eq.rec (motive := fun x x_1 => x ∈ u✝ :: support p✝ → Walk G x w✝) (fun h => cons h✝ p✝) (_ : u✝ = u)
          (_ : List.Mem u (u✝ :: support p✝))
      else dropUntil p✝ u (_ : u ∈ support p✝)) =
    cons h✝ p✝
[PROOFSTEP]
split_ifs with h'
[GOAL]
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✝), append (takeUntil p✝ u h) (dropUntil p✝ u h) = p✝
a✝ : List.Mem u (support p✝)
h' : u✝ = u
⊢ append
      (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✝)))
      (Eq.rec (motive := fun x x_1 => x ∈ u✝ :: support p✝ → Walk G x w✝) (fun h => cons h✝ p✝) (_ : u✝ = u)
        (_ : List.Mem u (u✝ :: support p✝))) =
    cons h✝ p✝
[PROOFSTEP]
subst_vars
[GOAL]
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✝), append (takeUntil p✝ u h) (dropUntil p✝ u h) = p✝
a✝ : List.Mem u (support p✝)
h' : ¬u✝ = u
⊢ append (cons h✝ (takeUntil p✝ u (_ : u ∈ support p✝))) (dropUntil p✝ u (_ : u ∈ support p✝)) = cons h✝ p✝
[PROOFSTEP]
subst_vars
[GOAL]
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✝), append (takeUntil p✝ u✝ h) (dropUntil p✝ u✝ h) = p✝
a✝ : List.Mem u✝ (support p✝)
⊢ append
      (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✝)))
      (Eq.rec (motive := fun x x_1 => x ∈ u✝ :: support p✝ → Walk G x w✝) (fun h => cons h✝ p✝) (_ : u✝ = u✝)
        (_ : List.Mem u✝ (u✝ :: support p✝))) =
    cons h✝ p✝
[PROOFSTEP]
simp [*]
[GOAL]
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✝), append (takeUntil p✝ u h) (dropUntil p✝ u h) = p✝
a✝ : List.Mem u (support p✝)
h' : ¬u✝ = u
⊢ append (cons h✝ (takeUntil p✝ u (_ : u ∈ support p✝))) (dropUntil p✝ u (_ : u ∈ support p✝)) = cons h✝ p✝
[PROOFSTEP]
simp [*]
[GOAL]
V✝ : Type u
V' : Type v
V'' : Type w
G✝ : SimpleGraph V✝
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V✝
V : Type u
G : SimpleGraph V
u v w : V
p : Walk G u v
⊢ w ∈ support p ↔ ∃ q r, p = append q r
[PROOFSTEP]
classical
constructor
· exact fun h => ⟨_, _, (p.take_spec h).symm⟩
· rintro ⟨q, r, rfl⟩
  simp only [mem_support_append_iff, end_mem_support, start_mem_support, or_self_iff]
[GOAL]
V✝ : Type u
V' : Type v
V'' : Type w
G✝ : SimpleGraph V✝
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V✝
V : Type u
G : SimpleGraph V
u v w : V
p : Walk G u v
⊢ w ∈ support p ↔ ∃ q r, p = append q r
[PROOFSTEP]
constructor
[GOAL]
case mp
V✝ : Type u
V' : Type v
V'' : Type w
G✝ : SimpleGraph V✝
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V✝
V : Type u
G : SimpleGraph V
u v w : V
p : Walk G u v
⊢ w ∈ support p → ∃ q r, p = append q r
[PROOFSTEP]
exact fun h => ⟨_, _, (p.take_spec h).symm⟩
[GOAL]
case mpr
V✝ : Type u
V' : Type v
V'' : Type w
G✝ : SimpleGraph V✝
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V✝
V : Type u
G : SimpleGraph V
u v w : V
p : Walk G u v
⊢ (∃ q r, p = append q r) → w ∈ support p
[PROOFSTEP]
rintro ⟨q, r, rfl⟩
[GOAL]
case mpr.intro.intro
V✝ : Type u
V' : Type v
V'' : Type w
G✝ : SimpleGraph V✝
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V✝
V : Type u
G : SimpleGraph V
u v w : V
q : Walk G u w
r : Walk G w v
⊢ w ∈ support (append q r)
[PROOFSTEP]
simp only [mem_support_append_iff, end_mem_support, start_mem_support, or_self_iff]
[GOAL]
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
⊢ List.count u (support (takeUntil p u h)) = 1
[PROOFSTEP]
induction p
[GOAL]
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 u✝ : V
h : u ∈ support nil
⊢ List.count u (support (takeUntil nil u h)) = 1
[PROOFSTEP]
rw [mem_support_nil_iff] at h 
[GOAL]
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 u✝ : V
h✝ : u ∈ support nil
h : u = u✝
⊢ List.count u (support (takeUntil nil u h✝)) = 1
[PROOFSTEP]
subst u
[GOAL]
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 u✝ : V
h : u✝ ∈ support nil
⊢ List.count u✝ (support (takeUntil nil u✝ h)) = 1
[PROOFSTEP]
simp!
[GOAL]
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 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
h : u ∈ support (cons h✝ p✝)
⊢ List.count u (support (takeUntil (cons h✝ p✝) u h)) = 1
[PROOFSTEP]
cases h
[GOAL]
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 v✝ w✝ : V
p✝ : Walk G v✝ w✝
p_ih✝ : ∀ (h : u ∈ support p✝), List.count u (support (takeUntil p✝ u h)) = 1
h✝ : Adj G u v✝
⊢ List.count u (support (takeUntil (cons h✝ p✝) u (_ : List.Mem u (u :: support p✝)))) = 1
[PROOFSTEP]
simp!
[GOAL]
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 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✝)
⊢ List.count u (support (takeUntil (cons h✝ p✝) u (_ : List.Mem u (u✝ :: support p✝)))) = 1
[PROOFSTEP]
simp! only
[GOAL]
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 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✝)
⊢ List.count u
      (support
        (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 h✝ (takeUntil p✝ u (_ : u ∈ support p✝)))) =
    1
[PROOFSTEP]
split_ifs with h'
[GOAL]
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
[PROOFSTEP]
rw [eq_comm] at h' 
[GOAL]
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
[PROOFSTEP]
rw [eq_comm] at h' 
[GOAL]
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
[PROOFSTEP]
subst_vars
[GOAL]
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
[PROOFSTEP]
subst_vars
[GOAL]
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
[PROOFSTEP]
simp! [*, List.count_cons]
[GOAL]
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
[PROOFSTEP]
simp! [*, List.count_cons]
[GOAL]
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 (Quotient.mk (Sym2.Rel.setoid V) (u, x)) (edges (takeUntil p u h)) ≤ 1
[PROOFSTEP]
induction' p with u' u' v' w' ha p' ih
[GOAL]
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 : V
p : Walk G v w
h✝ : u ∈ support p
x u' : V
h : u ∈ support nil
⊢ List.count (Quotient.mk (Sym2.Rel.setoid V) (u, x)) (edges (takeUntil nil u h)) ≤ 1
[PROOFSTEP]
rw [mem_support_nil_iff] at h 
[GOAL]
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 : V
p : Walk G v w
h✝¹ : u ∈ support p
x u' : V
h✝ : u ∈ support nil
h : u = u'
⊢ List.count (Quotient.mk (Sym2.Rel.setoid V) (u, x)) (edges (takeUntil nil u h✝)) ≤ 1
[PROOFSTEP]
subst u
[GOAL]
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 : V
p : Walk G v w
x u' : V
h✝ : u' ∈ support p
h : u' ∈ support nil
⊢ List.count (Quotient.mk (Sym2.Rel.setoid V) (u', x)) (edges (takeUntil nil u' h)) ≤ 1
[PROOFSTEP]
simp!
[GOAL]
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 : V
p : Walk G v w
h✝ : u ∈ support p
x u' v' w' : V
ha : Adj G u' v'
p' : Walk G v' w'
ih : ∀ (h : u ∈ support p'), List.count (Quotient.mk (Sym2.Rel.setoid V) (u, x)) (edges (takeUntil p' u h)) ≤ 1
h : u ∈ support (cons ha p')
⊢ List.count (Quotient.mk (Sym2.Rel.setoid V) (u, x)) (edges (takeUntil (cons ha p') u h)) ≤ 1
[PROOFSTEP]
cases h
[GOAL]
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 : V
p : Walk G v w
h : u ∈ support p
x v' w' : V
p' : Walk G v' w'
ih : ∀ (h : u ∈ support p'), List.count (Quotient.mk (Sym2.Rel.setoid V) (u, x)) (edges (takeUntil p' u h)) ≤ 1
ha : Adj G u v'
⊢ List.count (Quotient.mk (Sym2.Rel.setoid V) (u, x))
      (edges (takeUntil (cons ha p') u (_ : List.Mem u (u :: support p')))) ≤
    1
[PROOFSTEP]
simp!
[GOAL]
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 : V
p : Walk G v w
h : u ∈ support p
x u' v' w' : V
ha : Adj G u' v'
p' : Walk G v' w'
ih : ∀ (h : u ∈ support p'), List.count (Quotient.mk (Sym2.Rel.setoid V) (u, x)) (edges (takeUntil p' u h)) ≤ 1
a✝ : List.Mem u (support p')
⊢ List.count (Quotient.mk (Sym2.Rel.setoid V) (u, x))
      (edges (takeUntil (cons ha p') u (_ : List.Mem u (u' :: support p')))) ≤
    1
[PROOFSTEP]
simp! only
[GOAL]
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 : V
p : Walk G v w
h : u ∈ support p
x u' v' w' : V
ha : Adj G u' v'
p' : Walk G v' w'
ih : ∀ (h : u ∈ support p'), List.count (Quotient.mk (Sym2.Rel.setoid V) (u, x)) (edges (takeUntil p' u h)) ≤ 1
a✝ : List.Mem u (support p')
⊢ List.count (Quotient.mk (Sym2.Rel.setoid V) (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
[PROOFSTEP]
split_ifs with h'
[GOAL]
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 : V
p : Walk G v w
h : u ∈ support p
x u' v' w' : V
ha : Adj G u' v'
p' : Walk G v' w'
ih : ∀ (h : u ∈ support p'), List.count (Quotient.mk (Sym2.Rel.setoid V) (u, x)) (edges (takeUntil p' u h)) ≤ 1
a✝ : List.Mem u (support p')
h' : u' = u
⊢ List.count (Quotient.mk (Sym2.Rel.setoid V) (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
[PROOFSTEP]
subst h'
[GOAL]
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 : V
p : Walk G v w
x u' v' w' : V
ha : Adj G u' v'
p' : Walk G v' w'
h : u' ∈ support p
ih : ∀ (h : u' ∈ support p'), List.count (Quotient.mk (Sym2.Rel.setoid V) (u', x)) (edges (takeUntil p' u' h)) ≤ 1
a✝ : List.Mem u' (support p')
⊢ List.count (Quotient.mk (Sym2.Rel.setoid V) (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
[PROOFSTEP]
simp
[GOAL]
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 : V
p : Walk G v w
h : u ∈ support p
x u' v' w' : V
ha : Adj G u' v'
p' : Walk G v' w'
ih : ∀ (h : u ∈ support p'), List.count (Quotient.mk (Sym2.Rel.setoid V) (u, x)) (edges (takeUntil p' u h)) ≤ 1
a✝ : List.Mem u (support p')
h' : ¬u' = u
⊢ List.count (Quotient.mk (Sym2.Rel.setoid V) (u, x)) (edges (cons ha (takeUntil p' u (_ : u ∈ support p')))) ≤ 1
[PROOFSTEP]
rw [edges_cons, List.count_cons]
[GOAL]
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 : V
p : Walk G v w
h : u ∈ support p
x u' v' w' : V
ha : Adj G u' v'
p' : Walk G v' w'
ih : ∀ (h : u ∈ support p'), List.count (Quotient.mk (Sym2.Rel.setoid V) (u, x)) (edges (takeUntil p' u h)) ≤ 1
a✝ : List.Mem u (support p')
h' : ¬u' = u
⊢ (if Quotient.mk (Sym2.Rel.setoid V) (u, x) = Quotient.mk (Sym2.Rel.setoid V) (u', v') then
      Nat.succ (List.count (Quotient.mk (Sym2.Rel.setoid V) (u, x)) (edges (takeUntil p' u (_ : u ∈ support p'))))
    else List.count (Quotient.mk (Sym2.Rel.setoid V) (u, x)) (edges (takeUntil p' u (_ : u ∈ support p')))) ≤
    1
[PROOFSTEP]
split_ifs with h''
[GOAL]
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 : V
p : Walk G v w
h : u ∈ support p
x u' v' w' : V
ha : Adj G u' v'
p' : Walk G v' w'
ih : ∀ (h : u ∈ support p'), List.count (Quotient.mk (Sym2.Rel.setoid V) (u, x)) (edges (takeUntil p' u h)) ≤ 1
a✝ : List.Mem u (support p')
h' : ¬u' = u
h'' : Quotient.mk (Sym2.Rel.setoid V) (u, x) = Quotient.mk (Sym2.Rel.setoid V) (u', v')
⊢ Nat.succ (List.count (Quotient.mk (Sym2.Rel.setoid V) (u, x)) (edges (takeUntil p' u (_ : u ∈ support p')))) ≤ 1
[PROOFSTEP]
rw [Sym2.eq_iff] at h'' 
[GOAL]
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 : V
p : Walk G v w
h : u ∈ support p
x u' v' w' : V
ha : Adj G u' v'
p' : Walk G v' w'
ih : ∀ (h : u ∈ support p'), List.count (Quotient.mk (Sym2.Rel.setoid V) (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'
⊢ Nat.succ (List.count (Quotient.mk (Sym2.Rel.setoid V) (u, x)) (edges (takeUntil p' u (_ : u ∈ support p')))) ≤ 1
[PROOFSTEP]
obtain ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ := h''
[GOAL]
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 : V
p : Walk G v w
h : u ∈ support p
x w' : V
h' : ¬u = u
p' : Walk G x w'
ih : ∀ (h : u ∈ support p'), List.count (Quotient.mk (Sym2.Rel.setoid V) (u, x)) (edges (takeUntil p' u h)) ≤ 1
a✝ : List.Mem u (support p')
ha : Adj G u x
⊢ Nat.succ (List.count (Quotient.mk (Sym2.Rel.setoid V) (u, x)) (edges (takeUntil p' u (_ : u ∈ support p')))) ≤ 1
[PROOFSTEP]
exact (h' rfl).elim
[GOAL]
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 : V
p : Walk G v w
h : u ∈ support p
x w' : V
p' : Walk G u w'
ih : ∀ (h : u ∈ support p'), List.count (Quotient.mk (Sym2.Rel.setoid V) (u, x)) (edges (takeUntil p' u h)) ≤ 1
a✝ : List.Mem u (support p')
h' : ¬x = u
ha : Adj G x u
⊢ Nat.succ (List.count (Quotient.mk (Sym2.Rel.setoid V) (u, x)) (edges (takeUntil p' u (_ : u ∈ support p')))) ≤ 1
[PROOFSTEP]
cases p'
[GOAL]
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 : V
p : Walk G v w
h : u ∈ support p
x : V
h' : ¬x = u
ha : Adj G x u
ih : ∀ (h : u ∈ support nil), List.count (Quotient.mk (Sym2.Rel.setoid V) (u, x)) (edges (takeUntil nil u h)) ≤ 1
a✝ : List.Mem u (support nil)
⊢ Nat.succ (List.count (Quotient.mk (Sym2.Rel.setoid V) (u, x)) (edges (takeUntil nil u (_ : u ∈ support nil)))) ≤ 1
[PROOFSTEP]
simp!
[GOAL]
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 : V
p : Walk G v w
h : u ∈ support p
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 (Quotient.mk (Sym2.Rel.setoid V) (u, x)) (edges (takeUntil (cons h✝ p✝) u h)) ≤ 1
a✝ : List.Mem u (support (cons h✝ p✝))
⊢ Nat.succ
      (List.count (Quotient.mk (Sym2.Rel.setoid V) (u, x))
        (edges (takeUntil (cons h✝ p✝) u (_ : u ∈ support (cons h✝ p✝))))) ≤
    1
[PROOFSTEP]
simp!
[GOAL]
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 : V
p : Walk G v w
h : u ∈ support p
x u' v' w' : V
ha : Adj G u' v'
p' : Walk G v' w'
ih : ∀ (h : u ∈ support p'), List.count (Quotient.mk (Sym2.Rel.setoid V) (u, x)) (edges (takeUntil p' u h)) ≤ 1
a✝ : List.Mem u (support p')
h' : ¬u' = u
h'' : ¬Quotient.mk (Sym2.Rel.setoid V) (u, x) = Quotient.mk (Sym2.Rel.setoid V) (u', v')
⊢ List.count (Quotient.mk (Sym2.Rel.setoid V) (u, x)) (edges (takeUntil p' u (_ : u ∈ support p'))) ≤ 1
[PROOFSTEP]
apply ih
[GOAL]
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
[PROOFSTEP]
subst_vars
[GOAL]
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
[PROOFSTEP]
exact h
[GOAL]
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)
[PROOFSTEP]
subst_vars
[GOAL]
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)
[PROOFSTEP]
rfl
[GOAL]
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
[PROOFSTEP]
subst_vars
[GOAL]
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
[PROOFSTEP]
exact h
[GOAL]
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
[PROOFSTEP]
subst_vars
[GOAL]
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')
[PROOFSTEP]
rfl
[GOAL]
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
[PROOFSTEP]
rw [← take_spec p h, mem_support_append_iff]
[GOAL]
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 (takeUntil p u h) ∨ x ∈ support (dropUntil p u h)
[PROOFSTEP]
exact Or.inl hx
[GOAL]
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 (dropUntil p u h)
⊢ x ∈ support p
[PROOFSTEP]
rw [← take_spec p h, mem_support_append_iff]
[GOAL]
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 (dropUntil p u h)
⊢ x ∈ support (takeUntil p u h) ∨ x ∈ support (dropUntil p u h)
[PROOFSTEP]
exact Or.inr hx
[GOAL]
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 : Dart G
hx : x ∈ darts (takeUntil p u h)
⊢ x ∈ darts p
[PROOFSTEP]
rw [← take_spec p h, darts_append, List.mem_append]
[GOAL]
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 : Dart G
hx : x ∈ darts (takeUntil p u h)
⊢ x ∈ darts (takeUntil p u h) ∨ x ∈ darts (dropUntil p u h)
[PROOFSTEP]
exact Or.inl hx
[GOAL]
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 : Dart G
hx : x ∈ darts (dropUntil p u h)
⊢ x ∈ darts p
[PROOFSTEP]
rw [← take_spec p h, darts_append, List.mem_append]
[GOAL]
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 : Dart G
hx : x ∈ darts (dropUntil p u h)
⊢ x ∈ darts (takeUntil p u h) ∨ x ∈ darts (dropUntil p u h)
[PROOFSTEP]
exact Or.inr hx
[GOAL]
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
⊢ length (takeUntil p u h) ≤ length p
[PROOFSTEP]
have := congr_arg Walk.length (p.take_spec h)
[GOAL]
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
this : length (append (takeUntil p u h) (dropUntil p u h)) = length p
⊢ length (takeUntil p u h) ≤ length p
[PROOFSTEP]
rw [length_append] at this 
[GOAL]
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
this : length (takeUntil p u h) + length (dropUntil p u h) = length p
⊢ length (takeUntil p u h) ≤ length p
[PROOFSTEP]
exact Nat.le.intro this
[GOAL]
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
⊢ length (dropUntil p u h) ≤ length p
[PROOFSTEP]
have := congr_arg Walk.length (p.take_spec h)
[GOAL]
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
this : length (append (takeUntil p u h) (dropUntil p u h)) = length p
⊢ length (dropUntil p u h) ≤ length p
[PROOFSTEP]
rw [length_append, add_comm] at this 
[GOAL]
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
this : length (dropUntil p u h) + length (takeUntil p u h) = length p
⊢ length (dropUntil p u h) ≤ length p
[PROOFSTEP]
exact Nat.le.intro this
[GOAL]
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
hc : IsTrail p
h : u ∈ support p
⊢ IsTrail (append (takeUntil p u h) (?m.291006 hc h))
[PROOFSTEP]
rwa [← take_spec _ h] at hc 
[GOAL]
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
hc : IsTrail p
h : u ∈ support p
⊢ IsTrail (append (?m.291258 hc h) (dropUntil p u h))
[PROOFSTEP]
rwa [← take_spec _ h] at hc 
[GOAL]
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
hc : IsPath p
h : u ∈ support p
⊢ IsPath (append (takeUntil p u h) (?m.291510 hc h))
[PROOFSTEP]
rwa [← take_spec _ h] at hc 
[GOAL]
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
hc : IsPath p
h : u ∈ support p
⊢ IsPath (append (?m.291762 hc h) (dropUntil p u h))
[PROOFSTEP]
rwa [← take_spec _ h] at hc 
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v : V
c : Walk G v v
h : u ∈ support c
⊢ List.tail (support (rotate c h)) ~r List.tail (support c)
[PROOFSTEP]
simp only [rotate, tail_support_append]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v : V
c : Walk G v v
h : u ∈ support c
⊢ (List.tail (support (dropUntil c u h)) ++ List.tail (support (takeUntil c u h))) ~r List.tail (support c)
[PROOFSTEP]
apply List.IsRotated.trans List.isRotated_append
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v : V
c : Walk G v v
h : u ∈ support c
⊢ (List.tail (support (takeUntil c u h)) ++ List.tail (support (dropUntil c u h))) ~r List.tail (support c)
[PROOFSTEP]
rw [← tail_support_append, take_spec]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v : V
c : Walk G v v
h : u ∈ support c
⊢ darts (rotate c h) ~r darts c
[PROOFSTEP]
simp only [rotate, darts_append]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v : V
c : Walk G v v
h : u ∈ support c
⊢ (darts (dropUntil c u h) ++ darts (takeUntil c u h)) ~r darts c
[PROOFSTEP]
apply List.IsRotated.trans List.isRotated_append
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v : V
c : Walk G v v
h : u ∈ support c
⊢ (darts (takeUntil c u h) ++ darts (dropUntil c u h)) ~r darts c
[PROOFSTEP]
rw [← darts_append, take_spec]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v : V
c : Walk G v v
hc : IsTrail c
h : u ∈ support c
⊢ IsTrail (rotate c h)
[PROOFSTEP]
rw [isTrail_def, (c.rotate_edges h).perm.nodup_iff]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v : V
c : Walk G v v
hc : IsTrail c
h : u ∈ support c
⊢ List.Nodup (edges c)
[PROOFSTEP]
exact hc.edges_nodup
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v : V
c : Walk G v v
hc : IsCircuit c
h : u ∈ support c
⊢ IsCircuit (rotate c h)
[PROOFSTEP]
refine ⟨hc.isTrail.rotate _, ?_⟩
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v : V
c : Walk G v v
hc : IsCircuit c
h : u ∈ support c
⊢ rotate c h ≠ nil
[PROOFSTEP]
cases c
[GOAL]
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 : V
hc : IsCircuit nil
h : u ∈ support nil
⊢ rotate nil h ≠ nil
[PROOFSTEP]
exact (hc.ne_nil rfl).elim
[GOAL]
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 v✝ : V
h✝ : Adj G v v✝
p✝ : Walk G v✝ v
hc : IsCircuit (cons h✝ p✝)
h : u ∈ support (cons h✝ p✝)
⊢ rotate (cons h✝ p✝) h ≠ nil
[PROOFSTEP]
intro hn
[GOAL]
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 v✝ : V
h✝ : Adj G v v✝
p✝ : Walk G v✝ v
hc : IsCircuit (cons h✝ p✝)
h : u ∈ support (cons h✝ p✝)
hn : rotate (cons h✝ p✝) h = nil
⊢ False
[PROOFSTEP]
have hn' := congr_arg length hn
[GOAL]
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 v✝ : V
h✝ : Adj G v v✝
p✝ : Walk G v✝ v
hc : IsCircuit (cons h✝ p✝)
h : u ∈ support (cons h✝ p✝)
hn : rotate (cons h✝ p✝) h = nil
hn' : length (rotate (cons h✝ p✝) h) = length nil
⊢ False
[PROOFSTEP]
rw [rotate, length_append, add_comm, ← length_append, take_spec] at hn' 
[GOAL]
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 v✝ : V
h✝ : Adj G v v✝
p✝ : Walk G v✝ v
hc : IsCircuit (cons h✝ p✝)
h : u ∈ support (cons h✝ p✝)
hn : rotate (cons h✝ p✝) h = nil
hn' : length (cons h✝ p✝) = length nil
⊢ False
[PROOFSTEP]
simp at hn' 
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v : V
c : Walk G v v
hc : IsCycle c
h : u ∈ support c
⊢ IsCycle (rotate c h)
[PROOFSTEP]
refine ⟨hc.isCircuit.rotate _, ?_⟩
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v : V
c : Walk G v v
hc : IsCycle c
h : u ∈ support c
⊢ List.Nodup (List.tail (support (rotate c h)))
[PROOFSTEP]
rw [List.IsRotated.nodup_iff (support_rotate _ _)]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v : V
c : Walk G v v
hc : IsCycle c
h : u ∈ support c
⊢ List.Nodup (List.tail (support c))
[PROOFSTEP]
exact hc.support_nodup
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
S : Set V
uS : u ∈ S
vS : ¬v ∈ S
⊢ ∃ d, d ∈ darts p ∧ d.fst ∈ S ∧ ¬d.snd ∈ S
[PROOFSTEP]
induction' p with _ x y w a p' ih
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
S : Set V
uS✝ : u ∈ S
vS✝ : ¬v ∈ S
u✝ : V
uS : u✝ ∈ S
vS : ¬u✝ ∈ S
⊢ ∃ d, d ∈ darts nil ∧ d.fst ∈ S ∧ ¬d.snd ∈ S
[PROOFSTEP]
cases vS uS
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
S : Set V
uS✝ : u ∈ S
vS✝ : ¬v ∈ S
x y w : V
a : Adj G x y
p' : Walk G y w
ih : y ∈ S → ¬w ∈ S → ∃ d, d ∈ darts p' ∧ d.fst ∈ S ∧ ¬d.snd ∈ S
uS : x ∈ S
vS : ¬w ∈ S
⊢ ∃ d, d ∈ darts (cons a p') ∧ d.fst ∈ S ∧ ¬d.snd ∈ S
[PROOFSTEP]
by_cases h : y ∈ S
[GOAL]
case pos
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
S : Set V
uS✝ : u ∈ S
vS✝ : ¬v ∈ S
x y w : V
a : Adj G x y
p' : Walk G y w
ih : y ∈ S → ¬w ∈ S → ∃ d, d ∈ darts p' ∧ d.fst ∈ S ∧ ¬d.snd ∈ S
uS : x ∈ S
vS : ¬w ∈ S
h : y ∈ S
⊢ ∃ d, d ∈ darts (cons a p') ∧ d.fst ∈ S ∧ ¬d.snd ∈ S
[PROOFSTEP]
obtain ⟨d, hd, hcd⟩ := ih h vS
[GOAL]
case pos.intro.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
S : Set V
uS✝ : u ∈ S
vS✝ : ¬v ∈ S
x y w : V
a : Adj G x y
p' : Walk G y w
ih : y ∈ S → ¬w ∈ S → ∃ d, d ∈ darts p' ∧ d.fst ∈ S ∧ ¬d.snd ∈ S
uS : x ∈ S
vS : ¬w ∈ S
h : y ∈ S
d : Dart G
hd : d ∈ darts p'
hcd : d.fst ∈ S ∧ ¬d.snd ∈ S
⊢ ∃ d, d ∈ darts (cons a p') ∧ d.fst ∈ S ∧ ¬d.snd ∈ S
[PROOFSTEP]
exact ⟨d, List.Mem.tail _ hd, hcd⟩
[GOAL]
case neg
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
S : Set V
uS✝ : u ∈ S
vS✝ : ¬v ∈ S
x y w : V
a : Adj G x y
p' : Walk G y w
ih : y ∈ S → ¬w ∈ S → ∃ d, d ∈ darts p' ∧ d.fst ∈ S ∧ ¬d.snd ∈ S
uS : x ∈ S
vS : ¬w ∈ S
h : ¬y ∈ S
⊢ ∃ d, d ∈ darts (cons a p') ∧ d.fst ∈ S ∧ ¬d.snd ∈ S
[PROOFSTEP]
exact ⟨⟨(x, y), a⟩, List.Mem.head _, uS, h⟩
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
h : Adj G u v
⊢ Walk.IsPath (Walk.cons h Walk.nil)
[PROOFSTEP]
simp [h.ne]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
h : Adj G u v
⊢ Quotient.mk (Sym2.Rel.setoid V) (u, v) ∈ Walk.edges ↑(singleton h)
[PROOFSTEP]
simp [singleton]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v : V
p : Path G v v
⊢ p = Path.nil
[PROOFSTEP]
obtain ⟨_ | _, h⟩ := p
[GOAL]
case mk.nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v : V
h : Walk.IsPath Walk.nil
⊢ { val := Walk.nil, property := h } = Path.nil
[PROOFSTEP]
rfl
[GOAL]
case mk.cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v v✝ : V
h✝ : Adj G v v✝
p✝ : Walk G v✝ v
h : Walk.IsPath (Walk.cons h✝ p✝)
⊢ { val := Walk.cons h✝ p✝, property := h } = Path.nil
[PROOFSTEP]
simp at h 
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v : V
e : Sym2 V
p : Path G v v
⊢ ¬e ∈ Walk.edges ↑p
[PROOFSTEP]
simp [p.loop_eq]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Path G v u
h : Adj G u v
he : ¬Quotient.mk (Sym2.Rel.setoid V) (u, v) ∈ Walk.edges ↑p
⊢ Walk.IsCycle (Walk.cons h ↑p)
[PROOFSTEP]
simp [Walk.isCycle_def, Walk.cons_isTrail_iff, he]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v u' v' : V
p : Walk G u v
hu : u = u'
hv : v = v'
⊢ bypass (Walk.copy p hu hv) = Walk.copy (bypass p) hu hv
[PROOFSTEP]
subst_vars
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u' v' : V
p : Walk G u' v'
⊢ bypass (Walk.copy p (_ : u' = u') (_ : v' = v')) = Walk.copy (bypass p) (_ : u' = u') (_ : v' = v')
[PROOFSTEP]
rfl
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v : V
p : Walk G u v
⊢ IsPath (bypass p)
[PROOFSTEP]
induction p with
| nil => simp!
| cons _ p' ih =>
  simp only [bypass]
  split_ifs with hs
  · exact ih.dropUntil hs
  · simp [*, cons_isPath_iff]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v : V
p : Walk G u v
⊢ IsPath (bypass p)
[PROOFSTEP]
induction p with
| nil => simp!
| cons _ p' ih =>
  simp only [bypass]
  split_ifs with hs
  · exact ih.dropUntil hs
  · simp [*, cons_isPath_iff]
[GOAL]
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 u✝ : V
⊢ IsPath (bypass nil)
[PROOFSTEP]

| nil => simp!
[GOAL]
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 u✝ : V
⊢ IsPath (bypass nil)
[PROOFSTEP]
simp!
[GOAL]
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 u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p' : Walk G v✝ w✝
ih : IsPath (bypass p')
⊢ IsPath (bypass (cons h✝ p'))
[PROOFSTEP]

| cons _ p' ih =>
  simp only [bypass]
  split_ifs with hs
  · exact ih.dropUntil hs
  · simp [*, cons_isPath_iff]
[GOAL]
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 u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p' : Walk G v✝ w✝
ih : IsPath (bypass p')
⊢ IsPath (bypass (cons h✝ p'))
[PROOFSTEP]
simp only [bypass]
[GOAL]
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 u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p' : Walk G v✝ w✝
ih : IsPath (bypass p')
⊢ IsPath (if hs : u✝ ∈ support (bypass p') then dropUntil (bypass p') u✝ hs else cons h✝ (bypass p'))
[PROOFSTEP]
split_ifs with hs
[GOAL]
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 u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p' : Walk G v✝ w✝
ih : IsPath (bypass p')
hs : u✝ ∈ support (bypass p')
⊢ IsPath (dropUntil (bypass p') u✝ hs)
[PROOFSTEP]
exact ih.dropUntil hs
[GOAL]
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 u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p' : Walk G v✝ w✝
ih : IsPath (bypass p')
hs : ¬u✝ ∈ support (bypass p')
⊢ IsPath (cons h✝ (bypass p'))
[PROOFSTEP]
simp [*, cons_isPath_iff]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v : V
p : Walk G u v
⊢ length (bypass p) ≤ length p
[PROOFSTEP]
induction p with
| nil => rfl
| cons _ _ ih =>
  simp only [bypass]
  split_ifs
  · trans
    apply length_dropUntil_le
    rw [length_cons]
    exact le_add_right ih
  · rw [length_cons, length_cons]
    exact add_le_add_right ih 1
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v : V
p : Walk G u v
⊢ length (bypass p) ≤ length p
[PROOFSTEP]
induction p with
| nil => rfl
| cons _ _ ih =>
  simp only [bypass]
  split_ifs
  · trans
    apply length_dropUntil_le
    rw [length_cons]
    exact le_add_right ih
  · rw [length_cons, length_cons]
    exact add_le_add_right ih 1
[GOAL]
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 u✝ : V
⊢ length (bypass nil) ≤ length nil
[PROOFSTEP]

| nil => rfl
[GOAL]
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 u✝ : V
⊢ length (bypass nil) ≤ length nil
[PROOFSTEP]
rfl
[GOAL]
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 u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : length (bypass p✝) ≤ length p✝
⊢ length (bypass (cons h✝ p✝)) ≤ length (cons h✝ p✝)
[PROOFSTEP]

| cons _ _ ih =>
  simp only [bypass]
  split_ifs
  · trans
    apply length_dropUntil_le
    rw [length_cons]
    exact le_add_right ih
  · rw [length_cons, length_cons]
    exact add_le_add_right ih 1
[GOAL]
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 u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : length (bypass p✝) ≤ length p✝
⊢ length (bypass (cons h✝ p✝)) ≤ length (cons h✝ p✝)
[PROOFSTEP]
simp only [bypass]
[GOAL]
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 u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : length (bypass p✝) ≤ length p✝
⊢ length (if hs : u✝ ∈ support (bypass p✝) then dropUntil (bypass p✝) u✝ hs else cons h✝ (bypass p✝)) ≤
    length (cons h✝ p✝)
[PROOFSTEP]
split_ifs
[GOAL]
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 u✝ v✝ w✝ : V
h✝¹ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : length (bypass p✝) ≤ length p✝
h✝ : u✝ ∈ support (bypass p✝)
⊢ length (dropUntil (bypass p✝) u✝ h✝) ≤ length (cons h✝¹ p✝)
[PROOFSTEP]
trans
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v u✝ v✝ w✝ : V
h✝¹ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : length (bypass p✝) ≤ length p✝
h✝ : u✝ ∈ support (bypass p✝)
⊢ length (dropUntil (bypass p✝) u✝ h✝) ≤ ?m.315632
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v u✝ v✝ w✝ : V
h✝¹ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : length (bypass p✝) ≤ length p✝
h✝ : u✝ ∈ support (bypass p✝)
⊢ ?m.315632 ≤ length (cons h✝¹ p✝)
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v u✝ v✝ w✝ : V
h✝¹ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : length (bypass p✝) ≤ length p✝
h✝ : u✝ ∈ support (bypass p✝)
⊢ ℕ
[PROOFSTEP]
apply length_dropUntil_le
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v u✝ v✝ w✝ : V
h✝¹ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : length (bypass p✝) ≤ length p✝
h✝ : u✝ ∈ support (bypass p✝)
⊢ length (bypass p✝) ≤ length (cons h✝¹ p✝)
[PROOFSTEP]
rw [length_cons]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v u✝ v✝ w✝ : V
h✝¹ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : length (bypass p✝) ≤ length p✝
h✝ : u✝ ∈ support (bypass p✝)
⊢ length (bypass p✝) ≤ length p✝ + 1
[PROOFSTEP]
exact le_add_right ih
[GOAL]
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 u✝ v✝ w✝ : V
h✝¹ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : length (bypass p✝) ≤ length p✝
h✝ : ¬u✝ ∈ support (bypass p✝)
⊢ length (cons h✝¹ (bypass p✝)) ≤ length (cons h✝¹ p✝)
[PROOFSTEP]
rw [length_cons, length_cons]
[GOAL]
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 u✝ v✝ w✝ : V
h✝¹ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : length (bypass p✝) ≤ length p✝
h✝ : ¬u✝ ∈ support (bypass p✝)
⊢ length (bypass p✝) + 1 ≤ length p✝ + 1
[PROOFSTEP]
exact add_le_add_right ih 1
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v : V
p : Walk G u v
⊢ support (bypass p) ⊆ support p
[PROOFSTEP]
induction p with
| nil => simp!
| cons _ _ ih =>
  simp! only
  split_ifs
  · apply List.Subset.trans (support_dropUntil_subset _ _)
    apply List.subset_cons_of_subset
    assumption
  · rw [support_cons]
    apply List.cons_subset_cons
    assumption
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v : V
p : Walk G u v
⊢ support (bypass p) ⊆ support p
[PROOFSTEP]
induction p with
| nil => simp!
| cons _ _ ih =>
  simp! only
  split_ifs
  · apply List.Subset.trans (support_dropUntil_subset _ _)
    apply List.subset_cons_of_subset
    assumption
  · rw [support_cons]
    apply List.cons_subset_cons
    assumption
[GOAL]
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 u✝ : V
⊢ support (bypass nil) ⊆ support nil
[PROOFSTEP]

| nil => simp!
[GOAL]
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 u✝ : V
⊢ support (bypass nil) ⊆ support nil
[PROOFSTEP]
simp!
[GOAL]
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 u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : support (bypass p✝) ⊆ support p✝
⊢ support (bypass (cons h✝ p✝)) ⊆ support (cons h✝ p✝)
[PROOFSTEP]

| cons _ _ ih =>
  simp! only
  split_ifs
  · apply List.Subset.trans (support_dropUntil_subset _ _)
    apply List.subset_cons_of_subset
    assumption
  · rw [support_cons]
    apply List.cons_subset_cons
    assumption
[GOAL]
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 u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : support (bypass p✝) ⊆ support p✝
⊢ support (bypass (cons h✝ p✝)) ⊆ support (cons h✝ p✝)
[PROOFSTEP]
simp! only
[GOAL]
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 u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : support (bypass p✝) ⊆ support p✝
⊢ support (if hs : u✝ ∈ support (bypass p✝) then dropUntil (bypass p✝) u✝ hs else cons h✝ (bypass p✝)) ⊆
    u✝ :: support p✝
[PROOFSTEP]
split_ifs
[GOAL]
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 u✝ v✝ w✝ : V
h✝¹ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : support (bypass p✝) ⊆ support p✝
h✝ : u✝ ∈ support (bypass p✝)
⊢ support (dropUntil (bypass p✝) u✝ h✝) ⊆ u✝ :: support p✝
[PROOFSTEP]
apply List.Subset.trans (support_dropUntil_subset _ _)
[GOAL]
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 u✝ v✝ w✝ : V
h✝¹ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : support (bypass p✝) ⊆ support p✝
h✝ : u✝ ∈ support (bypass p✝)
⊢ support (bypass p✝) ⊆ u✝ :: support p✝
[PROOFSTEP]
apply List.subset_cons_of_subset
[GOAL]
case pos.a
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v u✝ v✝ w✝ : V
h✝¹ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : support (bypass p✝) ⊆ support p✝
h✝ : u✝ ∈ support (bypass p✝)
⊢ support (bypass p✝) ⊆ support p✝
[PROOFSTEP]
assumption
[GOAL]
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 u✝ v✝ w✝ : V
h✝¹ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : support (bypass p✝) ⊆ support p✝
h✝ : ¬u✝ ∈ support (bypass p✝)
⊢ support (cons h✝¹ (bypass p✝)) ⊆ u✝ :: support p✝
[PROOFSTEP]
rw [support_cons]
[GOAL]
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 u✝ v✝ w✝ : V
h✝¹ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : support (bypass p✝) ⊆ support p✝
h✝ : ¬u✝ ∈ support (bypass p✝)
⊢ u✝ :: support (bypass p✝) ⊆ u✝ :: support p✝
[PROOFSTEP]
apply List.cons_subset_cons
[GOAL]
case neg.s
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v u✝ v✝ w✝ : V
h✝¹ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : support (bypass p✝) ⊆ support p✝
h✝ : ¬u✝ ∈ support (bypass p✝)
⊢ support (bypass p✝) ⊆ support p✝
[PROOFSTEP]
assumption
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v : V
p : Walk G u v
⊢ darts (bypass p) ⊆ darts p
[PROOFSTEP]
induction p with
| nil => simp!
| cons _ _ ih =>
  simp! only
  split_ifs
  · apply List.Subset.trans (darts_dropUntil_subset _ _)
    apply List.subset_cons_of_subset _ ih
  · rw [darts_cons]
    exact List.cons_subset_cons _ ih
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v : V
p : Walk G u v
⊢ darts (bypass p) ⊆ darts p
[PROOFSTEP]
induction p with
| nil => simp!
| cons _ _ ih =>
  simp! only
  split_ifs
  · apply List.Subset.trans (darts_dropUntil_subset _ _)
    apply List.subset_cons_of_subset _ ih
  · rw [darts_cons]
    exact List.cons_subset_cons _ ih
[GOAL]
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 u✝ : V
⊢ darts (bypass nil) ⊆ darts nil
[PROOFSTEP]

| nil => simp!
[GOAL]
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 u✝ : V
⊢ darts (bypass nil) ⊆ darts nil
[PROOFSTEP]
simp!
[GOAL]
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 u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : darts (bypass p✝) ⊆ darts p✝
⊢ darts (bypass (cons h✝ p✝)) ⊆ darts (cons h✝ p✝)
[PROOFSTEP]

| cons _ _ ih =>
  simp! only
  split_ifs
  · apply List.Subset.trans (darts_dropUntil_subset _ _)
    apply List.subset_cons_of_subset _ ih
  · rw [darts_cons]
    exact List.cons_subset_cons _ ih
[GOAL]
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 u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : darts (bypass p✝) ⊆ darts p✝
⊢ darts (bypass (cons h✝ p✝)) ⊆ darts (cons h✝ p✝)
[PROOFSTEP]
simp! only
[GOAL]
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 u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : darts (bypass p✝) ⊆ darts p✝
⊢ darts (if hs : u✝ ∈ support (bypass p✝) then dropUntil (bypass p✝) u✝ hs else cons h✝ (bypass p✝)) ⊆
    { toProd := (u✝, v✝), is_adj := h✝ } :: darts p✝
[PROOFSTEP]
split_ifs
[GOAL]
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 u✝ v✝ w✝ : V
h✝¹ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : darts (bypass p✝) ⊆ darts p✝
h✝ : u✝ ∈ support (bypass p✝)
⊢ darts (dropUntil (bypass p✝) u✝ h✝) ⊆ { toProd := (u✝, v✝), is_adj := h✝¹ } :: darts p✝
[PROOFSTEP]
apply List.Subset.trans (darts_dropUntil_subset _ _)
[GOAL]
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 u✝ v✝ w✝ : V
h✝¹ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : darts (bypass p✝) ⊆ darts p✝
h✝ : u✝ ∈ support (bypass p✝)
⊢ darts (bypass p✝) ⊆ { toProd := (u✝, v✝), is_adj := h✝¹ } :: darts p✝
[PROOFSTEP]
apply List.subset_cons_of_subset _ ih
[GOAL]
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 u✝ v✝ w✝ : V
h✝¹ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : darts (bypass p✝) ⊆ darts p✝
h✝ : ¬u✝ ∈ support (bypass p✝)
⊢ darts (cons h✝¹ (bypass p✝)) ⊆ { toProd := (u✝, v✝), is_adj := h✝¹ } :: darts p✝
[PROOFSTEP]
rw [darts_cons]
[GOAL]
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 u✝ v✝ w✝ : V
h✝¹ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : darts (bypass p✝) ⊆ darts p✝
h✝ : ¬u✝ ∈ support (bypass p✝)
⊢ { toProd := (u✝, v✝), is_adj := h✝¹ } :: darts (bypass p✝) ⊆ { toProd := (u✝, v✝), is_adj := h✝¹ } :: darts p✝
[PROOFSTEP]
exact List.cons_subset_cons _ ih
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
hu : u = u'
hv : v = v'
⊢ Walk.map f (Walk.copy p hu hv) = Walk.copy (Walk.map f p) (_ : ↑f u = ↑f u') (_ : ↑f v = ↑f v')
[PROOFSTEP]
subst_vars
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u' v' : V
p : Walk G u' v'
⊢ Walk.map f (Walk.copy p (_ : u' = u') (_ : v' = v')) =
    Walk.copy (Walk.map f p) (_ : ↑f u' = ↑f u') (_ : ↑f v' = ↑f v')
[PROOFSTEP]
rfl
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p✝ p : Walk G u v
⊢ Walk.map Hom.id p = p
[PROOFSTEP]
induction p with
| nil => rfl
| cons _ p' ih => simp [ih p']
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p✝ p : Walk G u v
⊢ Walk.map Hom.id p = p
[PROOFSTEP]
induction p with
| nil => rfl
| cons _ p' ih => simp [ih p']
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' u✝ : V
p : Walk G u✝ u✝
⊢ Walk.map Hom.id nil = nil
[PROOFSTEP]

| nil => rfl
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' u✝ : V
p : Walk G u✝ u✝
⊢ Walk.map Hom.id nil = nil
[PROOFSTEP]
rfl
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p' : Walk G v✝ w✝
ih : Walk G v✝ w✝ → Walk.map Hom.id p' = p'
p : Walk G u✝ w✝
⊢ Walk.map Hom.id (cons h✝ p') = cons h✝ p'
[PROOFSTEP]

| cons _ p' ih => simp [ih p']
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p' : Walk G v✝ w✝
ih : Walk G v✝ w✝ → Walk.map Hom.id p' = p'
p : Walk G u✝ w✝
⊢ Walk.map Hom.id (cons h✝ p') = cons h✝ p'
[PROOFSTEP]
simp [ih p']
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
⊢ Walk.map f' (Walk.map f p) = Walk.map (Hom.comp f' f) p
[PROOFSTEP]
induction p with
| nil => rfl
| cons _ _ ih => simp [ih]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
⊢ Walk.map f' (Walk.map f p) = Walk.map (Hom.comp f' f) p
[PROOFSTEP]
induction p with
| nil => rfl
| cons _ _ ih => simp [ih]
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
u✝ : V
⊢ Walk.map f' (Walk.map f nil) = Walk.map (Hom.comp f' f) nil
[PROOFSTEP]

| nil => rfl
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
u✝ : V
⊢ Walk.map f' (Walk.map f nil) = Walk.map (Hom.comp f' f) nil
[PROOFSTEP]
rfl
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : Walk.map f' (Walk.map f p✝) = Walk.map (Hom.comp f' f) p✝
⊢ Walk.map f' (Walk.map f (cons h✝ p✝)) = Walk.map (Hom.comp f' f) (cons h✝ p✝)
[PROOFSTEP]

| cons _ _ ih => simp [ih]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : Walk.map f' (Walk.map f p✝) = Walk.map (Hom.comp f' f) p✝
⊢ Walk.map f' (Walk.map f (cons h✝ p✝)) = Walk.map (Hom.comp f' f) (cons h✝ p✝)
[PROOFSTEP]
simp [ih]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f'✝ : G' →g G''
u v u' v' : V
p : Walk G u v
f f' : G →g G'
h : f = f'
⊢ Walk.map f p = Walk.copy (Walk.map f' p) (_ : ↑f' u = ↑f u) (_ : ↑f' v = ↑f v)
[PROOFSTEP]
subst_vars
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f'✝ : G' →g G''
u v u' v' : V
p : Walk G u v
f' : G →g G'
⊢ Walk.map f' p = Walk.copy (Walk.map f' p) (_ : ↑f' u = ↑f' u) (_ : ↑f' v = ↑f' v)
[PROOFSTEP]
rfl
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p✝ : Walk G u v
p : Walk G u u
⊢ Walk.map f p = nil ↔ p = nil
[PROOFSTEP]
cases p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
⊢ Walk.map f nil = nil ↔ nil = nil
[PROOFSTEP]
simp
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
v✝ : V
h✝ : Adj G u v✝
p✝ : Walk G v✝ u
⊢ Walk.map f (cons h✝ p✝) = nil ↔ cons h✝ p✝ = nil
[PROOFSTEP]
simp
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
⊢ length (Walk.map f p) = length p
[PROOFSTEP]
induction p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
u✝ : V
⊢ length (Walk.map f nil) = length nil
[PROOFSTEP]
simp [*]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : length (Walk.map f p✝) = length p✝
⊢ length (Walk.map f (cons h✝ p✝)) = length (cons h✝ p✝)
[PROOFSTEP]
simp [*]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u✝ v✝ u' v' : V
p✝ : Walk G u✝ v✝
u v w : V
p : Walk G u v
q : Walk G v w
⊢ Walk.map f (append p q) = append (Walk.map f p) (Walk.map f q)
[PROOFSTEP]
induction p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u✝¹ v✝ u' v' : V
p : Walk G u✝¹ v✝
u v w u✝ : V
q : Walk G u✝ w
⊢ Walk.map f (append nil q) = append (Walk.map f nil) (Walk.map f q)
[PROOFSTEP]
simp [*]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u✝¹ v✝¹ u' v' : V
p : Walk G u✝¹ v✝¹
u v w u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : ∀ (q : Walk G w✝ w), Walk.map f (append p✝ q) = append (Walk.map f p✝) (Walk.map f q)
q : Walk G w✝ w
⊢ Walk.map f (append (cons h✝ p✝) q) = append (Walk.map f (cons h✝ p✝)) (Walk.map f q)
[PROOFSTEP]
simp [*]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
⊢ reverse (Walk.map f p) = Walk.map f (reverse p)
[PROOFSTEP]
induction p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
u✝ : V
⊢ reverse (Walk.map f nil) = Walk.map f (reverse nil)
[PROOFSTEP]
simp [map_append, *]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : reverse (Walk.map f p✝) = Walk.map f (reverse p✝)
⊢ reverse (Walk.map f (cons h✝ p✝)) = Walk.map f (reverse (cons h✝ p✝))
[PROOFSTEP]
simp [map_append, *]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
⊢ support (Walk.map f p) = List.map (↑f) (support p)
[PROOFSTEP]
induction p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
u✝ : V
⊢ support (Walk.map f nil) = List.map (↑f) (support nil)
[PROOFSTEP]
simp [*]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : support (Walk.map f p✝) = List.map (↑f) (support p✝)
⊢ support (Walk.map f (cons h✝ p✝)) = List.map (↑f) (support (cons h✝ p✝))
[PROOFSTEP]
simp [*]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
⊢ darts (Walk.map f p) = List.map (Hom.mapDart f) (darts p)
[PROOFSTEP]
induction p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
u✝ : V
⊢ darts (Walk.map f nil) = List.map (Hom.mapDart f) (darts nil)
[PROOFSTEP]
simp [*]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : darts (Walk.map f p✝) = List.map (Hom.mapDart f) (darts p✝)
⊢ darts (Walk.map f (cons h✝ p✝)) = List.map (Hom.mapDart f) (darts (cons h✝ p✝))
[PROOFSTEP]
simp [*]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
⊢ edges (Walk.map f p) = List.map (Sym2.map ↑f) (edges p)
[PROOFSTEP]
induction p with
| nil => rfl
| cons _ _ ih => simp only [Walk.map_cons, edges_cons, List.map_cons, Sym2.map_pair_eq, List.cons.injEq, true_and, ih]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
⊢ edges (Walk.map f p) = List.map (Sym2.map ↑f) (edges p)
[PROOFSTEP]
induction p with
| nil => rfl
| cons _ _ ih => simp only [Walk.map_cons, edges_cons, List.map_cons, Sym2.map_pair_eq, List.cons.injEq, true_and, ih]
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
u✝ : V
⊢ edges (Walk.map f nil) = List.map (Sym2.map ↑f) (edges nil)
[PROOFSTEP]

| nil => rfl
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
u✝ : V
⊢ edges (Walk.map f nil) = List.map (Sym2.map ↑f) (edges nil)
[PROOFSTEP]
rfl
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : edges (Walk.map f p✝) = List.map (Sym2.map ↑f) (edges p✝)
⊢ edges (Walk.map f (cons h✝ p✝)) = List.map (Sym2.map ↑f) (edges (cons h✝ p✝))
[PROOFSTEP]

| cons _ _ ih => simp only [Walk.map_cons, edges_cons, List.map_cons, Sym2.map_pair_eq, List.cons.injEq, true_and, ih]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : edges (Walk.map f p✝) = List.map (Sym2.map ↑f) (edges p✝)
⊢ edges (Walk.map f (cons h✝ p✝)) = List.map (Sym2.map ↑f) (edges (cons h✝ p✝))
[PROOFSTEP]
simp only [Walk.map_cons, edges_cons, List.map_cons, Sym2.map_pair_eq, List.cons.injEq, true_and, ih]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
hinj : Injective ↑f
hp : IsPath p
⊢ IsPath (Walk.map f p)
[PROOFSTEP]
induction p with
| nil => simp
| cons _ _ ih =>
  rw [Walk.cons_isPath_iff] at hp 
  simp [ih hp.1]
  intro x hx hf
  cases hinj hf
  exact hp.2 hx
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
hinj : Injective ↑f
hp : IsPath p
⊢ IsPath (Walk.map f p)
[PROOFSTEP]
induction p with
| nil => simp
| cons _ _ ih =>
  rw [Walk.cons_isPath_iff] at hp 
  simp [ih hp.1]
  intro x hx hf
  cases hinj hf
  exact hp.2 hx
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
hinj : Injective ↑f
u✝ : V
hp : IsPath nil
⊢ IsPath (Walk.map f nil)
[PROOFSTEP]

| nil => simp
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
hinj : Injective ↑f
u✝ : V
hp : IsPath nil
⊢ IsPath (Walk.map f nil)
[PROOFSTEP]
simp
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
hinj : Injective ↑f
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : IsPath p✝ → IsPath (Walk.map f p✝)
hp : IsPath (cons h✝ p✝)
⊢ IsPath (Walk.map f (cons h✝ p✝))
[PROOFSTEP]

| cons _ _ ih =>
  rw [Walk.cons_isPath_iff] at hp 
  simp [ih hp.1]
  intro x hx hf
  cases hinj hf
  exact hp.2 hx
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
hinj : Injective ↑f
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : IsPath p✝ → IsPath (Walk.map f p✝)
hp : IsPath (cons h✝ p✝)
⊢ IsPath (Walk.map f (cons h✝ p✝))
[PROOFSTEP]
rw [Walk.cons_isPath_iff] at hp 
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
hinj : Injective ↑f
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : IsPath p✝ → IsPath (Walk.map f p✝)
hp : IsPath p✝ ∧ ¬u✝ ∈ support p✝
⊢ IsPath (Walk.map f (cons h✝ p✝))
[PROOFSTEP]
simp [ih hp.1]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
hinj : Injective ↑f
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : IsPath p✝ → IsPath (Walk.map f p✝)
hp : IsPath p✝ ∧ ¬u✝ ∈ support p✝
⊢ ∀ (x : V), x ∈ support p✝ → ¬↑f x = ↑f u✝
[PROOFSTEP]
intro x hx hf
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
hinj : Injective ↑f
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : IsPath p✝ → IsPath (Walk.map f p✝)
hp : IsPath p✝ ∧ ¬u✝ ∈ support p✝
x : V
hx : x ∈ support p✝
hf : ↑f x = ↑f u✝
⊢ False
[PROOFSTEP]
cases hinj hf
[GOAL]
case cons.refl
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
hinj : Injective ↑f
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : IsPath p✝ → IsPath (Walk.map f p✝)
hp : IsPath p✝ ∧ ¬u✝ ∈ support p✝
hx : u✝ ∈ support p✝
hf : ↑f u✝ = ↑f u✝
⊢ False
[PROOFSTEP]
exact hp.2 hx
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
f : G →g G'
hp : IsPath (Walk.map f p)
⊢ IsPath p
[PROOFSTEP]
induction p with
| nil => simp
| cons _ _ ih =>
  rw [map_cons, Walk.cons_isPath_iff, support_map] at hp 
  rw [Walk.cons_isPath_iff]
  cases' hp with hp1 hp2
  refine' ⟨ih hp1, _⟩
  contrapose! hp2
  exact List.mem_map_of_mem f hp2
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
f : G →g G'
hp : IsPath (Walk.map f p)
⊢ IsPath p
[PROOFSTEP]
induction p with
| nil => simp
| cons _ _ ih =>
  rw [map_cons, Walk.cons_isPath_iff, support_map] at hp 
  rw [Walk.cons_isPath_iff]
  cases' hp with hp1 hp2
  refine' ⟨ih hp1, _⟩
  contrapose! hp2
  exact List.mem_map_of_mem f hp2
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
f : G →g G'
u✝ : V
hp : IsPath (Walk.map f Walk.nil)
⊢ IsPath Walk.nil
[PROOFSTEP]

| nil => simp
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
f : G →g G'
u✝ : V
hp : IsPath (Walk.map f Walk.nil)
⊢ IsPath Walk.nil
[PROOFSTEP]
simp
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
f : G →g G'
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : IsPath (Walk.map f p✝) → IsPath p✝
hp : IsPath (Walk.map f (cons h✝ p✝))
⊢ IsPath (cons h✝ p✝)
[PROOFSTEP]

| cons _ _ ih =>
  rw [map_cons, Walk.cons_isPath_iff, support_map] at hp 
  rw [Walk.cons_isPath_iff]
  cases' hp with hp1 hp2
  refine' ⟨ih hp1, _⟩
  contrapose! hp2
  exact List.mem_map_of_mem f hp2
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
f : G →g G'
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : IsPath (Walk.map f p✝) → IsPath p✝
hp : IsPath (Walk.map f (cons h✝ p✝))
⊢ IsPath (cons h✝ p✝)
[PROOFSTEP]
rw [map_cons, Walk.cons_isPath_iff, support_map] at hp 
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
f : G →g G'
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : IsPath (Walk.map f p✝) → IsPath p✝
hp : IsPath (Walk.map f p✝) ∧ ¬↑f u✝ ∈ List.map (↑f) (support p✝)
⊢ IsPath (cons h✝ p✝)
[PROOFSTEP]
rw [Walk.cons_isPath_iff]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
f : G →g G'
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : IsPath (Walk.map f p✝) → IsPath p✝
hp : IsPath (Walk.map f p✝) ∧ ¬↑f u✝ ∈ List.map (↑f) (support p✝)
⊢ IsPath p✝ ∧ ¬u✝ ∈ support p✝
[PROOFSTEP]
cases' hp with hp1 hp2
[GOAL]
case cons.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
f : G →g G'
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : IsPath (Walk.map f p✝) → IsPath p✝
hp1 : IsPath (Walk.map f p✝)
hp2 : ¬↑f u✝ ∈ List.map (↑f) (support p✝)
⊢ IsPath p✝ ∧ ¬u✝ ∈ support p✝
[PROOFSTEP]
refine' ⟨ih hp1, _⟩
[GOAL]
case cons.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
f : G →g G'
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : IsPath (Walk.map f p✝) → IsPath p✝
hp1 : IsPath (Walk.map f p✝)
hp2 : ¬↑f u✝ ∈ List.map (↑f) (support p✝)
⊢ ¬u✝ ∈ support p✝
[PROOFSTEP]
contrapose! hp2
[GOAL]
case cons.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
f : G →g G'
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : IsPath (Walk.map f p✝) → IsPath p✝
hp1 : IsPath (Walk.map f p✝)
hp2 : u✝ ∈ support p✝
⊢ ↑f u✝ ∈ List.map (↑f) (support p✝)
[PROOFSTEP]
exact List.mem_map_of_mem f hp2
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
hinj : Injective ↑f
⊢ IsTrail (Walk.map f p) ↔ IsTrail p
[PROOFSTEP]
induction p with
| nil => simp
| cons _ _ ih =>
  rw [map_cons, cons_isTrail_iff, ih, cons_isTrail_iff]
  apply and_congr_right'
  rw [← Sym2.map_pair_eq, edges_map, ← List.mem_map_of_injective (Sym2.map.injective hinj)]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
hinj : Injective ↑f
⊢ IsTrail (Walk.map f p) ↔ IsTrail p
[PROOFSTEP]
induction p with
| nil => simp
| cons _ _ ih =>
  rw [map_cons, cons_isTrail_iff, ih, cons_isTrail_iff]
  apply and_congr_right'
  rw [← Sym2.map_pair_eq, edges_map, ← List.mem_map_of_injective (Sym2.map.injective hinj)]
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
hinj : Injective ↑f
u✝ : V
⊢ IsTrail (Walk.map f nil) ↔ IsTrail nil
[PROOFSTEP]

| nil => simp
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
hinj : Injective ↑f
u✝ : V
⊢ IsTrail (Walk.map f nil) ↔ IsTrail nil
[PROOFSTEP]
simp
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
hinj : Injective ↑f
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : IsTrail (Walk.map f p✝) ↔ IsTrail p✝
⊢ IsTrail (Walk.map f (cons h✝ p✝)) ↔ IsTrail (cons h✝ p✝)
[PROOFSTEP]

| cons _ _ ih =>
  rw [map_cons, cons_isTrail_iff, ih, cons_isTrail_iff]
  apply and_congr_right'
  rw [← Sym2.map_pair_eq, edges_map, ← List.mem_map_of_injective (Sym2.map.injective hinj)]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
hinj : Injective ↑f
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : IsTrail (Walk.map f p✝) ↔ IsTrail p✝
⊢ IsTrail (Walk.map f (cons h✝ p✝)) ↔ IsTrail (cons h✝ p✝)
[PROOFSTEP]
rw [map_cons, cons_isTrail_iff, ih, cons_isTrail_iff]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
hinj : Injective ↑f
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : IsTrail (Walk.map f p✝) ↔ IsTrail p✝
⊢ IsTrail p✝ ∧ ¬Quotient.mk (Sym2.Rel.setoid V') (↑f u✝, ↑f v✝) ∈ edges (Walk.map f p✝) ↔
    IsTrail p✝ ∧ ¬Quotient.mk (Sym2.Rel.setoid V) (u✝, v✝) ∈ edges p✝
[PROOFSTEP]
apply and_congr_right'
[GOAL]
case cons.h
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p : Walk G u v
hinj : Injective ↑f
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : IsTrail (Walk.map f p✝) ↔ IsTrail p✝
⊢ ¬Quotient.mk (Sym2.Rel.setoid V') (↑f u✝, ↑f v✝) ∈ edges (Walk.map f p✝) ↔
    ¬Quotient.mk (Sym2.Rel.setoid V) (u✝, v✝) ∈ edges p✝
[PROOFSTEP]
rw [← Sym2.map_pair_eq, edges_map, ← List.mem_map_of_injective (Sym2.map.injective hinj)]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
f' : G' →g G''
u v u' v' : V
p✝ : Walk G u v
p : Walk G u u
hinj : Injective ↑f
⊢ IsCycle (Walk.map f p) ↔ IsCycle p
[PROOFSTEP]
rw [isCycle_def, isCycle_def, map_isTrail_iff_of_injective hinj, Ne.def, map_eq_nil_iff, support_map, ← List.map_tail,
  List.nodup_map_iff hinj]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u✝ v✝ u' v' : V
p : Walk G u✝ v✝
f : G →g G'
hinj : Injective ↑f
u v : V
⊢ Injective (Walk.map f)
[PROOFSTEP]
intro p p' h
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u✝ v✝ u' v' : V
p✝ : Walk G u✝ v✝
f : G →g G'
hinj : Injective ↑f
u v : V
p p' : Walk G u v
h : Walk.map f p = Walk.map f p'
⊢ p = p'
[PROOFSTEP]
induction p with
| nil =>
  cases p'
  · rfl
  · simp at h 
| cons _ _ ih =>
  cases p' with
  | nil => simp at h 
  | cons _ _ =>
    simp only [map_cons, cons.injEq] at h 
    cases hinj h.1
    simp only [cons.injEq, heq_iff_eq, true_and_iff]
    apply ih
    simpa using h.2
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u✝ v✝ u' v' : V
p✝ : Walk G u✝ v✝
f : G →g G'
hinj : Injective ↑f
u v : V
p p' : Walk G u v
h : Walk.map f p = Walk.map f p'
⊢ p = p'
[PROOFSTEP]
induction p with
| nil =>
  cases p'
  · rfl
  · simp at h 
| cons _ _ ih =>
  cases p' with
  | nil => simp at h 
  | cons _ _ =>
    simp only [map_cons, cons.injEq] at h 
    cases hinj h.1
    simp only [cons.injEq, heq_iff_eq, true_and_iff]
    apply ih
    simpa using h.2
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u✝¹ v✝ u' v' : V
p : Walk G u✝¹ v✝
f : G →g G'
hinj : Injective ↑f
u v u✝ : V
p' : Walk G u✝ u✝
h : Walk.map f nil = Walk.map f p'
⊢ nil = p'
[PROOFSTEP]

| nil =>
  cases p'
  · rfl
  · simp at h 
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u✝¹ v✝ u' v' : V
p : Walk G u✝¹ v✝
f : G →g G'
hinj : Injective ↑f
u v u✝ : V
p' : Walk G u✝ u✝
h : Walk.map f nil = Walk.map f p'
⊢ nil = p'
[PROOFSTEP]
cases p'
[GOAL]
case nil.nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u✝¹ v✝ u' v' : V
p : Walk G u✝¹ v✝
f : G →g G'
hinj : Injective ↑f
u v u✝ : V
h : Walk.map f nil = Walk.map f nil
⊢ nil = nil
[PROOFSTEP]
rfl
[GOAL]
case nil.cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u✝¹ v✝¹ u' v' : V
p : Walk G u✝¹ v✝¹
f : G →g G'
hinj : Injective ↑f
u v u✝ v✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ u✝
h : Walk.map f nil = Walk.map f (cons h✝ p✝)
⊢ nil = cons h✝ p✝
[PROOFSTEP]
simp at h 
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u✝¹ v✝¹ u' v' : V
p : Walk G u✝¹ v✝¹
f : G →g G'
hinj : Injective ↑f
u v u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ ⦃p' : Walk G v✝ w✝⦄, Walk.map f p✝ = Walk.map f p' → p✝ = p'
p' : Walk G u✝ w✝
h : Walk.map f (cons h✝ p✝) = Walk.map f p'
⊢ cons h✝ p✝ = p'
[PROOFSTEP]

| cons _ _ ih =>
  cases p' with
  | nil => simp at h 
  | cons _ _ =>
    simp only [map_cons, cons.injEq] at h 
    cases hinj h.1
    simp only [cons.injEq, heq_iff_eq, true_and_iff]
    apply ih
    simpa using h.2
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u✝¹ v✝¹ u' v' : V
p : Walk G u✝¹ v✝¹
f : G →g G'
hinj : Injective ↑f
u v u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ ⦃p' : Walk G v✝ w✝⦄, Walk.map f p✝ = Walk.map f p' → p✝ = p'
p' : Walk G u✝ w✝
h : Walk.map f (cons h✝ p✝) = Walk.map f p'
⊢ cons h✝ p✝ = p'
[PROOFSTEP]
cases p' with
| nil => simp at h 
| cons _ _ =>
  simp only [map_cons, cons.injEq] at h 
  cases hinj h.1
  simp only [cons.injEq, heq_iff_eq, true_and_iff]
  apply ih
  simpa using h.2
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u✝¹ v✝¹ u' v' : V
p : Walk G u✝¹ v✝¹
f : G →g G'
hinj : Injective ↑f
u v u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ ⦃p' : Walk G v✝ w✝⦄, Walk.map f p✝ = Walk.map f p' → p✝ = p'
p' : Walk G u✝ w✝
h : Walk.map f (cons h✝ p✝) = Walk.map f p'
⊢ cons h✝ p✝ = p'
[PROOFSTEP]
cases p' with
| nil => simp at h 
| cons _ _ =>
  simp only [map_cons, cons.injEq] at h 
  cases hinj h.1
  simp only [cons.injEq, heq_iff_eq, true_and_iff]
  apply ih
  simpa using h.2
[GOAL]
case cons.nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u✝¹ v✝¹ u' v' : V
p : Walk G u✝¹ v✝¹
f : G →g G'
hinj : Injective ↑f
u v u✝ v✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ u✝
ih : ∀ ⦃p' : Walk G v✝ u✝⦄, Walk.map f p✝ = Walk.map f p' → p✝ = p'
h : Walk.map f (cons h✝ p✝) = Walk.map f nil
⊢ cons h✝ p✝ = nil
[PROOFSTEP]

| nil => simp at h 
[GOAL]
case cons.nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u✝¹ v✝¹ u' v' : V
p : Walk G u✝¹ v✝¹
f : G →g G'
hinj : Injective ↑f
u v u✝ v✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ u✝
ih : ∀ ⦃p' : Walk G v✝ u✝⦄, Walk.map f p✝ = Walk.map f p' → p✝ = p'
h : Walk.map f (cons h✝ p✝) = Walk.map f nil
⊢ cons h✝ p✝ = nil
[PROOFSTEP]
simp at h 
[GOAL]
case cons.cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u✝¹ v✝² u' v' : V
p : Walk G u✝¹ v✝²
f : G →g G'
hinj : Injective ↑f
u v u✝ v✝¹ w✝ : V
h✝¹ : Adj G u✝ v✝¹
p✝¹ : Walk G v✝¹ w✝
ih : ∀ ⦃p' : Walk G v✝¹ w✝⦄, Walk.map f p✝¹ = Walk.map f p' → p✝¹ = p'
v✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
h : Walk.map f (cons h✝¹ p✝¹) = Walk.map f (cons h✝ p✝)
⊢ cons h✝¹ p✝¹ = cons h✝ p✝
[PROOFSTEP]

| cons _ _ =>
  simp only [map_cons, cons.injEq] at h 
  cases hinj h.1
  simp only [cons.injEq, heq_iff_eq, true_and_iff]
  apply ih
  simpa using h.2
[GOAL]
case cons.cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u✝¹ v✝² u' v' : V
p : Walk G u✝¹ v✝²
f : G →g G'
hinj : Injective ↑f
u v u✝ v✝¹ w✝ : V
h✝¹ : Adj G u✝ v✝¹
p✝¹ : Walk G v✝¹ w✝
ih : ∀ ⦃p' : Walk G v✝¹ w✝⦄, Walk.map f p✝¹ = Walk.map f p' → p✝¹ = p'
v✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
h : Walk.map f (cons h✝¹ p✝¹) = Walk.map f (cons h✝ p✝)
⊢ cons h✝¹ p✝¹ = cons h✝ p✝
[PROOFSTEP]
simp only [map_cons, cons.injEq] at h 
[GOAL]
case cons.cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u✝¹ v✝² u' v' : V
p : Walk G u✝¹ v✝²
f : G →g G'
hinj : Injective ↑f
u v u✝ v✝¹ w✝ : V
h✝¹ : Adj G u✝ v✝¹
p✝¹ : Walk G v✝¹ w✝
ih : ∀ ⦃p' : Walk G v✝¹ w✝⦄, Walk.map f p✝¹ = Walk.map f p' → p✝¹ = p'
v✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
h : ↑f v✝¹ = ↑f v✝ ∧ HEq (Walk.map f p✝¹) (Walk.map f p✝)
⊢ cons h✝¹ p✝¹ = cons h✝ p✝
[PROOFSTEP]
cases hinj h.1
[GOAL]
case cons.cons.refl
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u✝¹ v✝¹ u' v' : V
p : Walk G u✝¹ v✝¹
f : G →g G'
hinj : Injective ↑f
u v u✝ v✝ w✝ : V
h✝¹ : Adj G u✝ v✝
p✝¹ : Walk G v✝ w✝
ih : ∀ ⦃p' : Walk G v✝ w✝⦄, Walk.map f p✝¹ = Walk.map f p' → p✝¹ = p'
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
h : ↑f v✝ = ↑f v✝ ∧ HEq (Walk.map f p✝¹) (Walk.map f p✝)
⊢ cons h✝¹ p✝¹ = cons h✝ p✝
[PROOFSTEP]
simp only [cons.injEq, heq_iff_eq, true_and_iff]
[GOAL]
case cons.cons.refl
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u✝¹ v✝¹ u' v' : V
p : Walk G u✝¹ v✝¹
f : G →g G'
hinj : Injective ↑f
u v u✝ v✝ w✝ : V
h✝¹ : Adj G u✝ v✝
p✝¹ : Walk G v✝ w✝
ih : ∀ ⦃p' : Walk G v✝ w✝⦄, Walk.map f p✝¹ = Walk.map f p' → p✝¹ = p'
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
h : ↑f v✝ = ↑f v✝ ∧ HEq (Walk.map f p✝¹) (Walk.map f p✝)
⊢ p✝¹ = p✝
[PROOFSTEP]
apply ih
[GOAL]
case cons.cons.refl.h
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f✝ : G →g G'
f' : G' →g G''
u✝¹ v✝¹ u' v' : V
p : Walk G u✝¹ v✝¹
f : G →g G'
hinj : Injective ↑f
u v u✝ v✝ w✝ : V
h✝¹ : Adj G u✝ v✝
p✝¹ : Walk G v✝ w✝
ih : ∀ ⦃p' : Walk G v✝ w✝⦄, Walk.map f p✝¹ = Walk.map f p' → p✝¹ = p'
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
h : ↑f v✝ = ↑f v✝ ∧ HEq (Walk.map f p✝¹) (Walk.map f p✝)
⊢ Walk.map f p✝¹ = Walk.map f p✝
[PROOFSTEP]
simpa using h.2
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
hinj : Injective ↑f
u v : V
⊢ Injective (Path.map f hinj)
[PROOFSTEP]
rintro ⟨p, hp⟩ ⟨p', hp'⟩ h
[GOAL]
case mk.mk
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
hinj : Injective ↑f
u v : V
p : Walk G u v
hp : Walk.IsPath p
p' : Walk G u v
hp' : Walk.IsPath p'
h : Path.map f hinj { val := p, property := hp } = Path.map f hinj { val := p', property := hp' }
⊢ { val := p, property := hp } = { val := p', property := hp' }
[PROOFSTEP]
simp only [Path.map, Subtype.coe_mk, Subtype.mk.injEq] at h 
[GOAL]
case mk.mk
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
f : G →g G'
hinj : Injective ↑f
u v : V
p : Walk G u v
hp : Walk.IsPath p
p' : Walk G u v
hp' : Walk.IsPath p'
h : Walk.map f p = Walk.map f p'
⊢ { val := p, property := hp } = { val := p', property := hp' }
[PROOFSTEP]
simp [Walk.map_injective_of_injective hinj u v h]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u✝ v✝ : V
p✝ : Walk G u✝ v✝
H : SimpleGraph V
u w v : V
a : Adj G u v
p : Walk G v w
h : ∀ (e : Sym2 V), e ∈ edges (cons' u v w a p) → e ∈ edgeSet H
⊢ Quotient.mk (Sym2.Rel.setoid V) (u, v) ∈ edges (cons' u v w a p)
[PROOFSTEP]
simp
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u✝ v✝ : V
p✝ : Walk G u✝ v✝
H : SimpleGraph V
u w v : V
a : Adj G u v
p : Walk G v w
h : ∀ (e : Sym2 V), e ∈ edges (cons' u v w a p) → e ∈ edgeSet H
e : Sym2 V
he : e ∈ edges p
⊢ e ∈ edges (cons' u v w a p)
[PROOFSTEP]
simp [he]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
⊢ Walk.transfer p G (_ : ∀ ⦃e : Sym2 V⦄, e ∈ edges p → e ∈ edgeSet G) = p
[PROOFSTEP]
induction p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
u✝ : V
⊢ Walk.transfer nil G (_ : ∀ ⦃e : Sym2 V⦄, e ∈ edges nil → e ∈ edgeSet G) = nil
[PROOFSTEP]
simp [*]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : Walk.transfer p✝ G (_ : ∀ ⦃e : Sym2 V⦄, e ∈ edges p✝ → e ∈ edgeSet G) = p✝
⊢ Walk.transfer (cons h✝ p✝) G (_ : ∀ ⦃e : Sym2 V⦄, e ∈ edges (cons h✝ p✝) → e ∈ edgeSet G) = cons h✝ p✝
[PROOFSTEP]
simp [*]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
hp : ∀ (e : Sym2 V), e ∈ edges p → e ∈ edgeSet H
GH : G ≤ H
⊢ Walk.transfer p H hp = Walk.map (Hom.mapSpanningSubgraphs GH) p
[PROOFSTEP]
induction p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
GH : G ≤ H
u✝ : V
hp : ∀ (e : Sym2 V), e ∈ edges nil → e ∈ edgeSet H
⊢ Walk.transfer nil H hp = Walk.map (Hom.mapSpanningSubgraphs GH) nil
[PROOFSTEP]
simp [*]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
GH : G ≤ H
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ :
  ∀ (hp : ∀ (e : Sym2 V), e ∈ edges p✝ → e ∈ edgeSet H),
    Walk.transfer p✝ H hp = Walk.map (Hom.mapSpanningSubgraphs GH) p✝
hp : ∀ (e : Sym2 V), e ∈ edges (cons h✝ p✝) → e ∈ edgeSet H
⊢ Walk.transfer (cons h✝ p✝) H hp = Walk.map (Hom.mapSpanningSubgraphs GH) (cons h✝ p✝)
[PROOFSTEP]
simp [*]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
hp : ∀ (e : Sym2 V), e ∈ edges p → e ∈ edgeSet H
⊢ edges (Walk.transfer p H hp) = edges p
[PROOFSTEP]
induction p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
u✝ : V
hp : ∀ (e : Sym2 V), e ∈ edges nil → e ∈ edgeSet H
⊢ edges (Walk.transfer nil H hp) = edges nil
[PROOFSTEP]
simp [*]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : ∀ (hp : ∀ (e : Sym2 V), e ∈ edges p✝ → e ∈ edgeSet H), edges (Walk.transfer p✝ H hp) = edges p✝
hp : ∀ (e : Sym2 V), e ∈ edges (cons h✝ p✝) → e ∈ edgeSet H
⊢ edges (Walk.transfer (cons h✝ p✝) H hp) = edges (cons h✝ p✝)
[PROOFSTEP]
simp [*]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
hp : ∀ (e : Sym2 V), e ∈ edges p → e ∈ edgeSet H
⊢ support (Walk.transfer p H hp) = support p
[PROOFSTEP]
induction p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
u✝ : V
hp : ∀ (e : Sym2 V), e ∈ edges nil → e ∈ edgeSet H
⊢ support (Walk.transfer nil H hp) = support nil
[PROOFSTEP]
simp [*]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : ∀ (hp : ∀ (e : Sym2 V), e ∈ edges p✝ → e ∈ edgeSet H), support (Walk.transfer p✝ H hp) = support p✝
hp : ∀ (e : Sym2 V), e ∈ edges (cons h✝ p✝) → e ∈ edgeSet H
⊢ support (Walk.transfer (cons h✝ p✝) H hp) = support (cons h✝ p✝)
[PROOFSTEP]
simp [*]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
hp : ∀ (e : Sym2 V), e ∈ edges p → e ∈ edgeSet H
⊢ length (Walk.transfer p H hp) = length p
[PROOFSTEP]
induction p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
u✝ : V
hp : ∀ (e : Sym2 V), e ∈ edges nil → e ∈ edgeSet H
⊢ length (Walk.transfer nil H hp) = length nil
[PROOFSTEP]
simp [*]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : ∀ (hp : ∀ (e : Sym2 V), e ∈ edges p✝ → e ∈ edgeSet H), length (Walk.transfer p✝ H hp) = length p✝
hp : ∀ (e : Sym2 V), e ∈ edges (cons h✝ p✝) → e ∈ edgeSet H
⊢ length (Walk.transfer (cons h✝ p✝) H hp) = length (cons h✝ p✝)
[PROOFSTEP]
simp [*]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
hp : ∀ (e : Sym2 V), e ∈ edges p → e ∈ edgeSet H
pp : IsPath p
⊢ IsPath (Walk.transfer p H hp)
[PROOFSTEP]
induction p with
| nil => simp
| cons _ _ ih =>
  simp only [Walk.transfer, cons_isPath_iff, support_transfer _] at pp ⊢
  exact ⟨ih _ pp.1, pp.2⟩
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
hp : ∀ (e : Sym2 V), e ∈ edges p → e ∈ edgeSet H
pp : IsPath p
⊢ IsPath (Walk.transfer p H hp)
[PROOFSTEP]
induction p with
| nil => simp
| cons _ _ ih =>
  simp only [Walk.transfer, cons_isPath_iff, support_transfer _] at pp ⊢
  exact ⟨ih _ pp.1, pp.2⟩
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
u✝ : V
hp : ∀ (e : Sym2 V), e ∈ edges Walk.nil → e ∈ edgeSet H
pp : IsPath Walk.nil
⊢ IsPath (Walk.transfer Walk.nil H hp)
[PROOFSTEP]

| nil => simp
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
u✝ : V
hp : ∀ (e : Sym2 V), e ∈ edges Walk.nil → e ∈ edgeSet H
pp : IsPath Walk.nil
⊢ IsPath (Walk.transfer Walk.nil H hp)
[PROOFSTEP]
simp
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ (hp : ∀ (e : Sym2 V), e ∈ edges p✝ → e ∈ edgeSet H), IsPath p✝ → IsPath (Walk.transfer p✝ H hp)
hp : ∀ (e : Sym2 V), e ∈ edges (cons h✝ p✝) → e ∈ edgeSet H
pp : IsPath (cons h✝ p✝)
⊢ IsPath (Walk.transfer (cons h✝ p✝) H hp)
[PROOFSTEP]

| cons _ _ ih =>
  simp only [Walk.transfer, cons_isPath_iff, support_transfer _] at pp ⊢
  exact ⟨ih _ pp.1, pp.2⟩
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ (hp : ∀ (e : Sym2 V), e ∈ edges p✝ → e ∈ edgeSet H), IsPath p✝ → IsPath (Walk.transfer p✝ H hp)
hp : ∀ (e : Sym2 V), e ∈ edges (cons h✝ p✝) → e ∈ edgeSet H
pp : IsPath (cons h✝ p✝)
⊢ IsPath (Walk.transfer (cons h✝ p✝) H hp)
[PROOFSTEP]
simp only [Walk.transfer, cons_isPath_iff, support_transfer _] at pp ⊢
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : ∀ (hp : ∀ (e : Sym2 V), e ∈ edges p✝ → e ∈ edgeSet H), IsPath p✝ → IsPath (Walk.transfer p✝ H hp)
hp : ∀ (e : Sym2 V), e ∈ edges (cons h✝ p✝) → e ∈ edgeSet H
pp : IsPath p✝ ∧ ¬u✝ ∈ support p✝
⊢ IsPath (Walk.transfer p✝ H (_ : ∀ (e : Sym2 V), e ∈ edges p✝ → e ∈ edgeSet H)) ∧ ¬u✝ ∈ support p✝
[PROOFSTEP]
exact ⟨ih _ pp.1, pp.2⟩
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
q : Walk G u u
qc : IsCycle q
hq : ∀ (e : Sym2 V), e ∈ edges q → e ∈ edgeSet H
⊢ IsCycle (Walk.transfer q H hq)
[PROOFSTEP]
cases q with
| nil => simp at qc 
| cons _ q =>
  simp only [edges_cons, List.find?, List.mem_cons, forall_eq_or_imp, mem_edgeSet] at hq 
  simp only [Walk.transfer, cons_isCycle_iff, edges_transfer q hq.2] at qc ⊢
  exact ⟨qc.1.transfer hq.2, qc.2⟩
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
q : Walk G u u
qc : IsCycle q
hq : ∀ (e : Sym2 V), e ∈ edges q → e ∈ edgeSet H
⊢ IsCycle (Walk.transfer q H hq)
[PROOFSTEP]
cases q with
| nil => simp at qc 
| cons _ q =>
  simp only [edges_cons, List.find?, List.mem_cons, forall_eq_or_imp, mem_edgeSet] at hq 
  simp only [Walk.transfer, cons_isCycle_iff, edges_transfer q hq.2] at qc ⊢
  exact ⟨qc.1.transfer hq.2, qc.2⟩
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
qc : IsCycle nil
hq : ∀ (e : Sym2 V), e ∈ edges nil → e ∈ edgeSet H
⊢ IsCycle (Walk.transfer nil H hq)
[PROOFSTEP]

| nil => simp at qc 
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
qc : IsCycle nil
hq : ∀ (e : Sym2 V), e ∈ edges nil → e ∈ edgeSet H
⊢ IsCycle (Walk.transfer nil H hq)
[PROOFSTEP]
simp at qc 
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
v✝ : V
h✝ : Adj G u v✝
q : Walk G v✝ u
qc : IsCycle (cons h✝ q)
hq : ∀ (e : Sym2 V), e ∈ edges (cons h✝ q) → e ∈ edgeSet H
⊢ IsCycle (Walk.transfer (cons h✝ q) H hq)
[PROOFSTEP]

| cons _ q =>
  simp only [edges_cons, List.find?, List.mem_cons, forall_eq_or_imp, mem_edgeSet] at hq 
  simp only [Walk.transfer, cons_isCycle_iff, edges_transfer q hq.2] at qc ⊢
  exact ⟨qc.1.transfer hq.2, qc.2⟩
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
v✝ : V
h✝ : Adj G u v✝
q : Walk G v✝ u
qc : IsCycle (cons h✝ q)
hq : ∀ (e : Sym2 V), e ∈ edges (cons h✝ q) → e ∈ edgeSet H
⊢ IsCycle (Walk.transfer (cons h✝ q) H hq)
[PROOFSTEP]
simp only [edges_cons, List.find?, List.mem_cons, forall_eq_or_imp, mem_edgeSet] at hq 
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
v✝ : V
h✝ : Adj G u v✝
q : Walk G v✝ u
qc : IsCycle (cons h✝ q)
hq✝ : ∀ (e : Sym2 V), e ∈ edges (cons h✝ q) → e ∈ edgeSet H
hq : Adj H u v✝ ∧ ∀ (a : Sym2 V), a ∈ edges q → a ∈ edgeSet H
⊢ IsCycle (Walk.transfer (cons h✝ q) H hq✝)
[PROOFSTEP]
simp only [Walk.transfer, cons_isCycle_iff, edges_transfer q hq.2] at qc ⊢
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
v✝ : V
h✝ : Adj G u v✝
q : Walk G v✝ u
hq✝ : ∀ (e : Sym2 V), e ∈ edges (cons h✝ q) → e ∈ edgeSet H
hq : Adj H u v✝ ∧ ∀ (a : Sym2 V), a ∈ edges q → a ∈ edgeSet H
qc : IsPath q ∧ ¬Quotient.mk (Sym2.Rel.setoid V) (u, v✝) ∈ edges q
⊢ IsPath (Walk.transfer q H (_ : ∀ (e : Sym2 V), e ∈ edges q → e ∈ edgeSet H)) ∧
    ¬Quotient.mk (Sym2.Rel.setoid V) (u, v✝) ∈ edges q
[PROOFSTEP]
exact ⟨qc.1.transfer hq.2, qc.2⟩
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
hp : ∀ (e : Sym2 V), e ∈ edges p → e ∈ edgeSet H
K : SimpleGraph V
hp' : ∀ (e : Sym2 V), e ∈ edges (Walk.transfer p H hp) → e ∈ edgeSet K
⊢ Walk.transfer (Walk.transfer p H hp) K hp' = Walk.transfer p K (_ : ∀ (e : Sym2 V), e ∈ edges p → e ∈ edgeSet K)
[PROOFSTEP]
induction p with
| nil => simp
| cons _ _ ih =>
  simp only [Walk.transfer, cons.injEq, heq_eq_eq, true_and]
  apply ih
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
hp : ∀ (e : Sym2 V), e ∈ edges p → e ∈ edgeSet H
K : SimpleGraph V
hp' : ∀ (e : Sym2 V), e ∈ edges (Walk.transfer p H hp) → e ∈ edgeSet K
⊢ Walk.transfer (Walk.transfer p H hp) K hp' = Walk.transfer p K (_ : ∀ (e : Sym2 V), e ∈ edges p → e ∈ edgeSet K)
[PROOFSTEP]
induction p with
| nil => simp
| cons _ _ ih =>
  simp only [Walk.transfer, cons.injEq, heq_eq_eq, true_and]
  apply ih
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H K : SimpleGraph V
u✝ : V
hp : ∀ (e : Sym2 V), e ∈ edges nil → e ∈ edgeSet H
hp' : ∀ (e : Sym2 V), e ∈ edges (Walk.transfer nil H hp) → e ∈ edgeSet K
⊢ Walk.transfer (Walk.transfer nil H hp) K hp' = Walk.transfer nil K (_ : ∀ (e : Sym2 V), e ∈ edges nil → e ∈ edgeSet K)
[PROOFSTEP]

| nil => simp
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H K : SimpleGraph V
u✝ : V
hp : ∀ (e : Sym2 V), e ∈ edges nil → e ∈ edgeSet H
hp' : ∀ (e : Sym2 V), e ∈ edges (Walk.transfer nil H hp) → e ∈ edgeSet K
⊢ Walk.transfer (Walk.transfer nil H hp) K hp' = Walk.transfer nil K (_ : ∀ (e : Sym2 V), e ∈ edges nil → e ∈ edgeSet K)
[PROOFSTEP]
simp
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H K : SimpleGraph V
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih :
  ∀ (hp : ∀ (e : Sym2 V), e ∈ edges p✝ → e ∈ edgeSet H)
    (hp' : ∀ (e : Sym2 V), e ∈ edges (Walk.transfer p✝ H hp) → e ∈ edgeSet K),
    Walk.transfer (Walk.transfer p✝ H hp) K hp' = Walk.transfer p✝ K (_ : ∀ (e : Sym2 V), e ∈ edges p✝ → e ∈ edgeSet K)
hp : ∀ (e : Sym2 V), e ∈ edges (cons h✝ p✝) → e ∈ edgeSet H
hp' : ∀ (e : Sym2 V), e ∈ edges (Walk.transfer (cons h✝ p✝) H hp) → e ∈ edgeSet K
⊢ Walk.transfer (Walk.transfer (cons h✝ p✝) H hp) K hp' =
    Walk.transfer (cons h✝ p✝) K (_ : ∀ (e : Sym2 V), e ∈ edges (cons h✝ p✝) → e ∈ edgeSet K)
[PROOFSTEP]

| cons _ _ ih =>
  simp only [Walk.transfer, cons.injEq, heq_eq_eq, true_and]
  apply ih
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H K : SimpleGraph V
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih :
  ∀ (hp : ∀ (e : Sym2 V), e ∈ edges p✝ → e ∈ edgeSet H)
    (hp' : ∀ (e : Sym2 V), e ∈ edges (Walk.transfer p✝ H hp) → e ∈ edgeSet K),
    Walk.transfer (Walk.transfer p✝ H hp) K hp' = Walk.transfer p✝ K (_ : ∀ (e : Sym2 V), e ∈ edges p✝ → e ∈ edgeSet K)
hp : ∀ (e : Sym2 V), e ∈ edges (cons h✝ p✝) → e ∈ edgeSet H
hp' : ∀ (e : Sym2 V), e ∈ edges (Walk.transfer (cons h✝ p✝) H hp) → e ∈ edgeSet K
⊢ Walk.transfer (Walk.transfer (cons h✝ p✝) H hp) K hp' =
    Walk.transfer (cons h✝ p✝) K (_ : ∀ (e : Sym2 V), e ∈ edges (cons h✝ p✝) → e ∈ edgeSet K)
[PROOFSTEP]
simp only [Walk.transfer, cons.injEq, heq_eq_eq, true_and]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H K : SimpleGraph V
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih :
  ∀ (hp : ∀ (e : Sym2 V), e ∈ edges p✝ → e ∈ edgeSet H)
    (hp' : ∀ (e : Sym2 V), e ∈ edges (Walk.transfer p✝ H hp) → e ∈ edgeSet K),
    Walk.transfer (Walk.transfer p✝ H hp) K hp' = Walk.transfer p✝ K (_ : ∀ (e : Sym2 V), e ∈ edges p✝ → e ∈ edgeSet K)
hp : ∀ (e : Sym2 V), e ∈ edges (cons h✝ p✝) → e ∈ edgeSet H
hp' : ∀ (e : Sym2 V), e ∈ edges (Walk.transfer (cons h✝ p✝) H hp) → e ∈ edgeSet K
⊢ Walk.transfer (Walk.transfer p✝ H (_ : ∀ (e : Sym2 V), e ∈ edges p✝ → e ∈ edgeSet H)) K
      (_ :
        ∀ (e : Sym2 V),
          e ∈ edges (Walk.transfer p✝ H (_ : ∀ (e : Sym2 V), e ∈ edges p✝ → e ∈ edgeSet H)) → e ∈ edgeSet K) =
    Walk.transfer p✝ K (_ : ∀ (e : Sym2 V), e ∈ edges p✝ → e ∈ edgeSet K)
[PROOFSTEP]
apply ih
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
w : V
H : SimpleGraph V
q : Walk G v w
hpq : ∀ (e : Sym2 V), e ∈ edges (append p q) → e ∈ edgeSet H
e : Sym2 V
he : e ∈ edges p
⊢ e ∈ edges (append p q)
[PROOFSTEP]
simp [he]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
w : V
H : SimpleGraph V
q : Walk G v w
hpq : ∀ (e : Sym2 V), e ∈ edges (append p q) → e ∈ edgeSet H
e : Sym2 V
he : e ∈ edges q
⊢ e ∈ edges (append p q)
[PROOFSTEP]
simp [he]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
w : V
H : SimpleGraph V
q : Walk G v w
hpq : ∀ (e : Sym2 V), e ∈ edges (append p q) → e ∈ edgeSet H
⊢ Walk.transfer (append p q) H hpq =
    append (Walk.transfer p H (_ : ∀ (e : Sym2 V), e ∈ edges p → e ∈ edgeSet H))
      (Walk.transfer q H (_ : ∀ (e : Sym2 V), e ∈ edges q → e ∈ edgeSet H))
[PROOFSTEP]
induction p with
| nil => simp
| cons _ _ ih => simp only [Walk.transfer, cons_append, cons.injEq, heq_eq_eq, true_and, ih]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
w : V
H : SimpleGraph V
q : Walk G v w
hpq : ∀ (e : Sym2 V), e ∈ edges (append p q) → e ∈ edgeSet H
⊢ Walk.transfer (append p q) H hpq =
    append (Walk.transfer p H (_ : ∀ (e : Sym2 V), e ∈ edges p → e ∈ edgeSet H))
      (Walk.transfer q H (_ : ∀ (e : Sym2 V), e ∈ edges q → e ∈ edgeSet H))
[PROOFSTEP]
induction p with
| nil => simp
| cons _ _ ih => simp only [Walk.transfer, cons_append, cons.injEq, heq_eq_eq, true_and, ih]
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
w : V
H : SimpleGraph V
u✝ : V
q : Walk G u✝ w
hpq : ∀ (e : Sym2 V), e ∈ edges (append nil q) → e ∈ edgeSet H
⊢ Walk.transfer (append nil q) H hpq =
    append (Walk.transfer nil H (_ : ∀ (e : Sym2 V), e ∈ edges nil → e ∈ edgeSet H))
      (Walk.transfer q H (_ : ∀ (e : Sym2 V), e ∈ edges q → e ∈ edgeSet H))
[PROOFSTEP]

| nil => simp
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
w : V
H : SimpleGraph V
u✝ : V
q : Walk G u✝ w
hpq : ∀ (e : Sym2 V), e ∈ edges (append nil q) → e ∈ edgeSet H
⊢ Walk.transfer (append nil q) H hpq =
    append (Walk.transfer nil H (_ : ∀ (e : Sym2 V), e ∈ edges nil → e ∈ edgeSet H))
      (Walk.transfer q H (_ : ∀ (e : Sym2 V), e ∈ edges q → e ∈ edgeSet H))
[PROOFSTEP]
simp
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
w : V
H : SimpleGraph V
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih :
  ∀ (q : Walk G w✝ w) (hpq : ∀ (e : Sym2 V), e ∈ edges (append p✝ q) → e ∈ edgeSet H),
    Walk.transfer (append p✝ q) H hpq =
      append (Walk.transfer p✝ H (_ : ∀ (e : Sym2 V), e ∈ edges p✝ → e ∈ edgeSet H))
        (Walk.transfer q H (_ : ∀ (e : Sym2 V), e ∈ edges q → e ∈ edgeSet H))
q : Walk G w✝ w
hpq : ∀ (e : Sym2 V), e ∈ edges (append (cons h✝ p✝) q) → e ∈ edgeSet H
⊢ Walk.transfer (append (cons h✝ p✝) q) H hpq =
    append (Walk.transfer (cons h✝ p✝) H (_ : ∀ (e : Sym2 V), e ∈ edges (cons h✝ p✝) → e ∈ edgeSet H))
      (Walk.transfer q H (_ : ∀ (e : Sym2 V), e ∈ edges q → e ∈ edgeSet H))
[PROOFSTEP]

| cons _ _ ih => simp only [Walk.transfer, cons_append, cons.injEq, heq_eq_eq, true_and, ih]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
w : V
H : SimpleGraph V
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih :
  ∀ (q : Walk G w✝ w) (hpq : ∀ (e : Sym2 V), e ∈ edges (append p✝ q) → e ∈ edgeSet H),
    Walk.transfer (append p✝ q) H hpq =
      append (Walk.transfer p✝ H (_ : ∀ (e : Sym2 V), e ∈ edges p✝ → e ∈ edgeSet H))
        (Walk.transfer q H (_ : ∀ (e : Sym2 V), e ∈ edges q → e ∈ edgeSet H))
q : Walk G w✝ w
hpq : ∀ (e : Sym2 V), e ∈ edges (append (cons h✝ p✝) q) → e ∈ edgeSet H
⊢ Walk.transfer (append (cons h✝ p✝) q) H hpq =
    append (Walk.transfer (cons h✝ p✝) H (_ : ∀ (e : Sym2 V), e ∈ edges (cons h✝ p✝) → e ∈ edgeSet H))
      (Walk.transfer q H (_ : ∀ (e : Sym2 V), e ∈ edges q → e ∈ edgeSet H))
[PROOFSTEP]
simp only [Walk.transfer, cons_append, cons.injEq, heq_eq_eq, true_and, ih]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
hp : ∀ (e : Sym2 V), e ∈ edges p → e ∈ edgeSet H
⊢ ∀ (e : Sym2 V), e ∈ edges (reverse p) → e ∈ edgeSet H
[PROOFSTEP]
simp only [edges_reverse, List.mem_reverse]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
hp : ∀ (e : Sym2 V), e ∈ edges p → e ∈ edgeSet H
⊢ ∀ (e : Sym2 V), e ∈ edges p → e ∈ edgeSet H
[PROOFSTEP]
exact hp
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
hp : ∀ (e : Sym2 V), e ∈ edges p → e ∈ edgeSet H
⊢ reverse (Walk.transfer p H hp) =
    Walk.transfer (reverse p) H (_ : ∀ (e : Sym2 V), e ∈ edges (reverse p) → e ∈ edgeSet H)
[PROOFSTEP]
induction p with
| nil => simp
| cons _ _ ih => simp only [transfer_append, Walk.transfer, reverse_nil, reverse_cons, ih]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
hp : ∀ (e : Sym2 V), e ∈ edges p → e ∈ edgeSet H
⊢ reverse (Walk.transfer p H hp) =
    Walk.transfer (reverse p) H (_ : ∀ (e : Sym2 V), e ∈ edges (reverse p) → e ∈ edgeSet H)
[PROOFSTEP]
induction p with
| nil => simp
| cons _ _ ih => simp only [transfer_append, Walk.transfer, reverse_nil, reverse_cons, ih]
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
u✝ : V
hp : ∀ (e : Sym2 V), e ∈ edges nil → e ∈ edgeSet H
⊢ reverse (Walk.transfer nil H hp) =
    Walk.transfer (reverse nil) H (_ : ∀ (e : Sym2 V), e ∈ edges (reverse nil) → e ∈ edgeSet H)
[PROOFSTEP]

| nil => simp
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
u✝ : V
hp : ∀ (e : Sym2 V), e ∈ edges nil → e ∈ edgeSet H
⊢ reverse (Walk.transfer nil H hp) =
    Walk.transfer (reverse nil) H (_ : ∀ (e : Sym2 V), e ∈ edges (reverse nil) → e ∈ edgeSet H)
[PROOFSTEP]
simp
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih :
  ∀ (hp : ∀ (e : Sym2 V), e ∈ edges p✝ → e ∈ edgeSet H),
    reverse (Walk.transfer p✝ H hp) =
      Walk.transfer (reverse p✝) H (_ : ∀ (e : Sym2 V), e ∈ edges (reverse p✝) → e ∈ edgeSet H)
hp : ∀ (e : Sym2 V), e ∈ edges (cons h✝ p✝) → e ∈ edgeSet H
⊢ reverse (Walk.transfer (cons h✝ p✝) H hp) =
    Walk.transfer (reverse (cons h✝ p✝)) H (_ : ∀ (e : Sym2 V), e ∈ edges (reverse (cons h✝ p✝)) → e ∈ edgeSet H)
[PROOFSTEP]

| cons _ _ ih => simp only [transfer_append, Walk.transfer, reverse_nil, reverse_cons, ih]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
p : Walk G u v
H : SimpleGraph V
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih :
  ∀ (hp : ∀ (e : Sym2 V), e ∈ edges p✝ → e ∈ edgeSet H),
    reverse (Walk.transfer p✝ H hp) =
      Walk.transfer (reverse p✝) H (_ : ∀ (e : Sym2 V), e ∈ edges (reverse p✝) → e ∈ edgeSet H)
hp : ∀ (e : Sym2 V), e ∈ edges (cons h✝ p✝) → e ∈ edgeSet H
⊢ reverse (Walk.transfer (cons h✝ p✝) H hp) =
    Walk.transfer (reverse (cons h✝ p✝)) H (_ : ∀ (e : Sym2 V), e ∈ edges (reverse (cons h✝ p✝)) → e ∈ edgeSet H)
[PROOFSTEP]
simp only [transfer_append, Walk.transfer, reverse_nil, reverse_cons, ih]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
s : Set (Sym2 V)
v w : V
p : Walk G v w
hp : ∀ (e : Sym2 V), e ∈ edges p → ¬e ∈ s
⊢ ∀ (e : Sym2 V), e ∈ edges p → e ∈ edgeSet (deleteEdges G s)
[PROOFSTEP]
simp only [edgeSet_deleteEdges, Set.mem_diff]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
s : Set (Sym2 V)
v w : V
p : Walk G v w
hp : ∀ (e : Sym2 V), e ∈ edges p → ¬e ∈ s
⊢ ∀ (e : Sym2 V), e ∈ edges p → e ∈ edgeSet G ∧ ¬e ∈ s
[PROOFSTEP]
exact fun e ep => ⟨edges_subset_edgeSet p ep, hp e ep⟩
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
e : Sym2 V
p : Walk G v w
hp : ¬e ∈ edges p
e' : Sym2 V
⊢ e' ∈ edges p → ¬e' ∈ {e}
[PROOFSTEP]
contrapose!
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
e : Sym2 V
p : Walk G v w
hp : ¬e ∈ edges p
e' : Sym2 V
⊢ e' ∈ {e} → ¬e' ∈ edges p
[PROOFSTEP]
simp (config := { contextual := true }) [hp]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
s : Set (Sym2 V)
p : Walk G v w
hp : ∀ (e : Sym2 V), e ∈ edges p → ¬e ∈ s
⊢ Walk.map (Hom.mapSpanningSubgraphs (_ : deleteEdges G s ≤ G)) (toDeleteEdges s p hp) = p
[PROOFSTEP]
rw [← transfer_eq_map_of_le, transfer_transfer, transfer_self]
[GOAL]
case hp'
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
s : Set (Sym2 V)
p : Walk G v w
hp : ∀ (e : Sym2 V), e ∈ edges p → ¬e ∈ s
⊢ ∀ (e : Sym2 V),
    e ∈ edges (Walk.transfer p (deleteEdges G s) (_ : ∀ (e : Sym2 V), e ∈ edges p → e ∈ edgeSet (deleteEdges G s))) →
      e ∈ edgeSet G
[PROOFSTEP]
intros e
[GOAL]
case hp'
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
s : Set (Sym2 V)
p : Walk G v w
hp : ∀ (e : Sym2 V), e ∈ edges p → ¬e ∈ s
e : Sym2 V
⊢ e ∈ edges (Walk.transfer p (deleteEdges G s) (_ : ∀ (e : Sym2 V), e ∈ edges p → e ∈ edgeSet (deleteEdges G s))) →
    e ∈ edgeSet G
[PROOFSTEP]
rw [edges_transfer]
[GOAL]
case hp'
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
s : Set (Sym2 V)
p : Walk G v w
hp : ∀ (e : Sym2 V), e ∈ edges p → ¬e ∈ s
e : Sym2 V
⊢ e ∈ edges p → e ∈ edgeSet G
[PROOFSTEP]
apply edges_subset_edgeSet p
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u' v' : V
s : Set (Sym2 V)
p : Walk G u v
hu : u = u'
hv : v = v'
h : ∀ (e : Sym2 V), e ∈ edges (Walk.copy p hu hv) → ¬e ∈ s
⊢ ∀ (e : Sym2 V), e ∈ edges p → ¬e ∈ s
[PROOFSTEP]
subst_vars
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u' v' : V
s : Set (Sym2 V)
p : Walk G u' v'
h : ∀ (e : Sym2 V), e ∈ edges (Walk.copy p (_ : u' = u') (_ : v' = v')) → ¬e ∈ s
⊢ ∀ (e : Sym2 V), e ∈ edges p → ¬e ∈ s
[PROOFSTEP]
exact h
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u' v' : V
s : Set (Sym2 V)
p : Walk G u v
hu : u = u'
hv : v = v'
h : ∀ (e : Sym2 V), e ∈ edges (Walk.copy p hu hv) → ¬e ∈ s
⊢ toDeleteEdges s (Walk.copy p hu hv) h = Walk.copy (toDeleteEdges s p (_ : ∀ (e : Sym2 V), e ∈ edges p → ¬e ∈ s)) hu hv
[PROOFSTEP]
subst_vars
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u' v' : V
s : Set (Sym2 V)
p : Walk G u' v'
h : ∀ (e : Sym2 V), e ∈ edges (Walk.copy p (_ : u' = u') (_ : v' = v')) → ¬e ∈ s
⊢ toDeleteEdges s (Walk.copy p (_ : u' = u') (_ : v' = v')) h =
    Walk.copy (toDeleteEdges s p (_ : ∀ (e : Sym2 V), e ∈ edges p → ¬e ∈ s)) (_ : u' = u') (_ : v' = v')
[PROOFSTEP]
rfl
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
p : Prop
u v : V
h : Reachable G u v
hp : Path G u v → p
⊢ p
[PROOFSTEP]
classical exact h.elim fun q => hp q.toPath
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
p : Prop
u v : V
h : Reachable G u v
hp : Path G u v → p
⊢ p
[PROOFSTEP]
exact h.elim fun q => hp q.toPath
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
⊢ Reachable G u v ↔ Relation.ReflTransGen G.Adj u v
[PROOFSTEP]
constructor
[GOAL]
case mp
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
⊢ Reachable G u v → Relation.ReflTransGen G.Adj u v
[PROOFSTEP]
rintro ⟨h⟩
[GOAL]
case mp.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
h : Walk G u v
⊢ Relation.ReflTransGen G.Adj u v
[PROOFSTEP]
induction h with
| nil => rfl
| cons h' _ ih => exact (Relation.ReflTransGen.single h').trans ih
[GOAL]
case mp.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
h : Walk G u v
⊢ Relation.ReflTransGen G.Adj u v
[PROOFSTEP]
induction h with
| nil => rfl
| cons h' _ ih => exact (Relation.ReflTransGen.single h').trans ih
[GOAL]
case mp.intro.nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ : V
⊢ Relation.ReflTransGen G.Adj u✝ u✝
[PROOFSTEP]

| nil => rfl
[GOAL]
case mp.intro.nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ : V
⊢ Relation.ReflTransGen G.Adj u✝ u✝
[PROOFSTEP]
rfl
[GOAL]
case mp.intro.cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ v✝ w✝ : V
h' : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : Relation.ReflTransGen G.Adj v✝ w✝
⊢ Relation.ReflTransGen G.Adj u✝ w✝
[PROOFSTEP]

| cons h' _ ih => exact (Relation.ReflTransGen.single h').trans ih
[GOAL]
case mp.intro.cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v u✝ v✝ w✝ : V
h' : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : Relation.ReflTransGen G.Adj v✝ w✝
⊢ Relation.ReflTransGen G.Adj u✝ w✝
[PROOFSTEP]
exact (Relation.ReflTransGen.single h').trans ih
[GOAL]
case mpr
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
⊢ Relation.ReflTransGen G.Adj u v → Reachable G u v
[PROOFSTEP]
intro h
[GOAL]
case mpr
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
h : Relation.ReflTransGen G.Adj u v
⊢ Reachable G u v
[PROOFSTEP]
induction h with
| refl => rfl
| tail _ ha hr => exact Reachable.trans hr ⟨Walk.cons ha Walk.nil⟩
[GOAL]
case mpr
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
h : Relation.ReflTransGen G.Adj u v
⊢ Reachable G u v
[PROOFSTEP]
induction h with
| refl => rfl
| tail _ ha hr => exact Reachable.trans hr ⟨Walk.cons ha Walk.nil⟩
[GOAL]
case mpr.refl
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
⊢ Reachable G u u
[PROOFSTEP]

| refl => rfl
[GOAL]
case mpr.refl
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
⊢ Reachable G u u
[PROOFSTEP]
rfl
[GOAL]
case mpr.tail
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v b✝ c✝ : V
a✝ : Relation.ReflTransGen G.Adj u b✝
ha : Adj G b✝ c✝
hr : Reachable G u b✝
⊢ Reachable G u c✝
[PROOFSTEP]

| tail _ ha hr => exact Reachable.trans hr ⟨Walk.cons ha Walk.nil⟩
[GOAL]
case mpr.tail
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v b✝ c✝ : V
a✝ : Relation.ReflTransGen G.Adj u b✝
ha : Adj G b✝ c✝
hr : Reachable G u b✝
⊢ Reachable G u c✝
[PROOFSTEP]
exact Reachable.trans hr ⟨Walk.cons ha Walk.nil⟩
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G✝ : SimpleGraph V
G'✝ : SimpleGraph V'
G'' : SimpleGraph V''
G : SimpleGraph V
G' : SimpleGraph V'
φ : G ≃g G'
u : V
v : V'
⊢ Reachable G (↑(symm φ) v) u ↔ Reachable G' v (↑φ u)
[PROOFSTEP]
rw [← Iso.reachable_iff, RelIso.apply_symm_apply]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
x y : V
⊢ Reachable ⊤ x y
[PROOFSTEP]
if h : x = y then rw [h] else exact Adj.reachable h
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
x y : V
h : x = y
⊢ Reachable ⊤ x y
[PROOFSTEP]
rw [h]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
x y : V
h : ¬x = y
⊢ Reachable ⊤ x y
[PROOFSTEP]
exact Adj.reachable h
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
⊢ Connected G ↔ ∃ v, ∀ (w : V), Reachable G v w
[PROOFSTEP]
rw [connected_iff]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
⊢ Preconnected G ∧ Nonempty V ↔ ∃ v, ∀ (w : V), Reachable G v w
[PROOFSTEP]
constructor
[GOAL]
case mp
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
⊢ Preconnected G ∧ Nonempty V → ∃ v, ∀ (w : V), Reachable G v w
[PROOFSTEP]
rintro ⟨hp, ⟨v⟩⟩
[GOAL]
case mp.intro.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
hp : Preconnected G
v : V
⊢ ∃ v, ∀ (w : V), Reachable G v w
[PROOFSTEP]
exact ⟨v, fun w => hp v w⟩
[GOAL]
case mpr
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
⊢ (∃ v, ∀ (w : V), Reachable G v w) → Preconnected G ∧ Nonempty V
[PROOFSTEP]
rintro ⟨v, h⟩
[GOAL]
case mpr.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v : V
h : ∀ (w : V), Reachable G v w
⊢ Preconnected G ∧ Nonempty V
[PROOFSTEP]
exact ⟨fun u w => (h u).symm.trans (h w), ⟨v⟩⟩
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
C : ConnectedComponent G
⊢ map Hom.id C = C
[PROOFSTEP]
refine' C.ind _
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
C : ConnectedComponent G
⊢ ∀ (v : V), map Hom.id (connectedComponentMk G v) = connectedComponentMk G v
[PROOFSTEP]
exact fun _ => rfl
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
C : ConnectedComponent G
φ : G →g G'
ψ : G' →g G''
⊢ map ψ (map φ C) = map (Hom.comp ψ φ) C
[PROOFSTEP]
refine' C.ind _
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
C : ConnectedComponent G
φ : G →g G'
ψ : G' →g G''
⊢ ∀ (v : V), map ψ (map φ (connectedComponentMk G v)) = map (Hom.comp ψ φ) (connectedComponentMk G v)
[PROOFSTEP]
exact fun _ => rfl
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
φ : G ≃g G'
v : V
v' : V'
C : ConnectedComponent G
⊢ connectedComponentMk G' (↑φ v) = map (RelEmbedding.toRelHom (RelIso.toRelEmbedding φ)) C ↔
    connectedComponentMk G v = C
[PROOFSTEP]
refine' C.ind fun u => _
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
φ : G ≃g G'
v : V
v' : V'
C : ConnectedComponent G
u : V
⊢ connectedComponentMk G' (↑φ v) = map (RelEmbedding.toRelHom (RelIso.toRelEmbedding φ)) (connectedComponentMk G u) ↔
    connectedComponentMk G v = connectedComponentMk G u
[PROOFSTEP]
simp only [Iso.reachable_iff, ConnectedComponent.map_mk, RelEmbedding.coe_toRelHom, RelIso.coe_toRelEmbedding,
  ConnectedComponent.eq]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
φ : G ≃g G'
v : V
v' : V'
C : ConnectedComponent G
⊢ connectedComponentMk G (↑(Iso.symm φ) v') = C ↔
    connectedComponentMk G' v' = map (RelEmbedding.toRelHom (RelIso.toRelEmbedding φ)) C
[PROOFSTEP]
refine' C.ind fun u => _
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
φ : G ≃g G'
v : V
v' : V'
C : ConnectedComponent G
u : V
⊢ connectedComponentMk G (↑(Iso.symm φ) v') = connectedComponentMk G u ↔
    connectedComponentMk G' v' = map (RelEmbedding.toRelHom (RelIso.toRelEmbedding φ)) (connectedComponentMk G u)
[PROOFSTEP]
simp only [Iso.symm_apply_reachable, ConnectedComponent.eq, ConnectedComponent.map_mk, RelEmbedding.coe_toRelHom,
  RelIso.coe_toRelEmbedding]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
⊢ connectedComponentEquiv refl = Equiv.refl (ConnectedComponent G)
[PROOFSTEP]
ext ⟨v⟩
[GOAL]
case H.mk
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
x✝ : ConnectedComponent G
v : V
⊢ ↑(connectedComponentEquiv refl) (Quot.mk (Reachable G) v) =
    ↑(Equiv.refl (ConnectedComponent G)) (Quot.mk (Reachable G) v)
[PROOFSTEP]
rfl
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
φ : G ≃g G'
⊢ connectedComponentEquiv (symm φ) = (connectedComponentEquiv φ).symm
[PROOFSTEP]
ext ⟨_⟩
[GOAL]
case H.mk
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
φ : G ≃g G'
x✝ : ConnectedComponent G'
a✝ : V'
⊢ ↑(connectedComponentEquiv (symm φ)) (Quot.mk (Reachable G') a✝) =
    ↑(connectedComponentEquiv φ).symm (Quot.mk (Reachable G') a✝)
[PROOFSTEP]
rfl
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
φ : G ≃g G'
φ' : G' ≃g G''
⊢ connectedComponentEquiv (RelIso.trans φ φ') = (connectedComponentEquiv φ).trans (connectedComponentEquiv φ')
[PROOFSTEP]
ext ⟨_⟩
[GOAL]
case H.mk
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
φ : G ≃g G'
φ' : G' ≃g G''
x✝ : ConnectedComponent G
a✝ : V
⊢ ↑(connectedComponentEquiv (RelIso.trans φ φ')) (Quot.mk (Reachable G) a✝) =
    ↑((connectedComponentEquiv φ).trans (connectedComponentEquiv φ')) (Quot.mk (Reachable G) a✝)
[PROOFSTEP]
rfl
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
⊢ Injective supp
[PROOFSTEP]
refine' ConnectedComponent.ind₂ _
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
⊢ ∀ (v w : V),
    supp (connectedComponentMk G v) = supp (connectedComponentMk G w) →
      connectedComponentMk G v = connectedComponentMk G w
[PROOFSTEP]
intro v w
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
⊢ supp (connectedComponentMk G v) = supp (connectedComponentMk G w) →
    connectedComponentMk G v = connectedComponentMk G w
[PROOFSTEP]
simp only [ConnectedComponent.supp, Set.ext_iff, ConnectedComponent.eq, Set.mem_setOf_eq]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
⊢ (∀ (x : V), Reachable G x v ↔ Reachable G x w) → Reachable G v w
[PROOFSTEP]
intro h
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
h : ∀ (x : V), Reachable G x v ↔ Reachable G x w
⊢ Reachable G v w
[PROOFSTEP]
rw [reachable_comm, h]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
hconn : Preconnected G
u v : V
⊢ Set.Nonempty Set.univ
[PROOFSTEP]
rw [← Set.nonempty_iff_univ_nonempty]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
hconn : Preconnected G
u v : V
⊢ Nonempty (Walk G u v)
[PROOFSTEP]
exact hconn u v
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
h : Adj G u v
⊢ Walk.toSubgraph (cons h nil) = subgraphOfAdj G h
[PROOFSTEP]
simp
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
⊢ w ∈ (Walk.toSubgraph p).verts ↔ w ∈ support p
[PROOFSTEP]
induction' p with _ x y z h p' ih
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ : V
⊢ w ∈ (Walk.toSubgraph nil).verts ↔ w ∈ support nil
[PROOFSTEP]
simp
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x y z : V
h : Adj G x y
p' : Walk G y z
ih : w ∈ (Walk.toSubgraph p').verts ↔ w ∈ support p'
⊢ w ∈ (Walk.toSubgraph (cons h p')).verts ↔ w ∈ support (cons h p')
[PROOFSTEP]
have : w = y ∨ w ∈ p'.support ↔ w ∈ p'.support :=
  ⟨by rintro (rfl | h) <;> simp [*], by simp (config := { contextual := true })⟩
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x y z : V
h : Adj G x y
p' : Walk G y z
ih : w ∈ (Walk.toSubgraph p').verts ↔ w ∈ support p'
⊢ w = y ∨ w ∈ support p' → w ∈ support p'
[PROOFSTEP]
rintro (rfl | h)
[GOAL]
case inl
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x z : V
h : Adj G x w
p' : Walk G w z
ih : w ∈ (Walk.toSubgraph p').verts ↔ w ∈ support p'
⊢ w ∈ support p'
[PROOFSTEP]
simp [*]
[GOAL]
case inr
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x y z : V
h✝ : Adj G x y
p' : Walk G y z
ih : w ∈ (Walk.toSubgraph p').verts ↔ w ∈ support p'
h : w ∈ support p'
⊢ w ∈ support p'
[PROOFSTEP]
simp [*]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x y z : V
h : Adj G x y
p' : Walk G y z
ih : w ∈ (Walk.toSubgraph p').verts ↔ w ∈ support p'
⊢ w ∈ support p' → w = y ∨ w ∈ support p'
[PROOFSTEP]
simp (config := { contextual := true })
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w x y z : V
h : Adj G x y
p' : Walk G y z
ih : w ∈ (Walk.toSubgraph p').verts ↔ w ∈ support p'
this : w = y ∨ w ∈ support p' ↔ w ∈ support p'
⊢ w ∈ (Walk.toSubgraph (cons h p')).verts ↔ w ∈ support (cons h p')
[PROOFSTEP]
simp [ih, or_assoc, this]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
⊢ u ∈ (Walk.toSubgraph p).verts
[PROOFSTEP]
simp [mem_verts_toSubgraph]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
⊢ v ∈ (Walk.toSubgraph p).verts
[PROOFSTEP]
simp [mem_verts_toSubgraph]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
e : Sym2 V
⊢ e ∈ Subgraph.edgeSet (Walk.toSubgraph p) ↔ e ∈ edges p
[PROOFSTEP]
induction p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
e : Sym2 V
u✝ : V
⊢ e ∈ Subgraph.edgeSet (Walk.toSubgraph nil) ↔ e ∈ edges nil
[PROOFSTEP]
simp [*]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
e : Sym2 V
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : e ∈ Subgraph.edgeSet (Walk.toSubgraph p✝) ↔ e ∈ edges p✝
⊢ e ∈ Subgraph.edgeSet (Walk.toSubgraph (cons h✝ p✝)) ↔ e ∈ edges (cons h✝ p✝)
[PROOFSTEP]
simp [*]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
q : Walk G v w
⊢ Walk.toSubgraph (append p q) = Walk.toSubgraph p ⊔ Walk.toSubgraph q
[PROOFSTEP]
induction p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ : V
q : Walk G u✝ w
⊢ Walk.toSubgraph (append nil q) = Walk.toSubgraph nil ⊔ Walk.toSubgraph q
[PROOFSTEP]
simp [*, sup_assoc]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : ∀ (q : Walk G w✝ w), Walk.toSubgraph (append p✝ q) = Walk.toSubgraph p✝ ⊔ Walk.toSubgraph q
q : Walk G w✝ w
⊢ Walk.toSubgraph (append (cons h✝ p✝) q) = Walk.toSubgraph (cons h✝ p✝) ⊔ Walk.toSubgraph q
[PROOFSTEP]
simp [*, sup_assoc]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
⊢ Walk.toSubgraph (reverse p) = Walk.toSubgraph p
[PROOFSTEP]
induction p with
| nil => simp
| cons _ _ _ =>
  simp only [*, Walk.toSubgraph, reverse_cons, toSubgraph_append, subgraphOfAdj_symm]
  rw [sup_comm]
  congr
  ext <;> simp [-Set.bot_eq_empty]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
⊢ Walk.toSubgraph (reverse p) = Walk.toSubgraph p
[PROOFSTEP]
induction p with
| nil => simp
| cons _ _ _ =>
  simp only [*, Walk.toSubgraph, reverse_cons, toSubgraph_append, subgraphOfAdj_symm]
  rw [sup_comm]
  congr
  ext <;> simp [-Set.bot_eq_empty]
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ : V
⊢ Walk.toSubgraph (reverse nil) = Walk.toSubgraph nil
[PROOFSTEP]

| nil => simp
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ : V
⊢ Walk.toSubgraph (reverse nil) = Walk.toSubgraph nil
[PROOFSTEP]
simp
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : Walk.toSubgraph (reverse p✝) = Walk.toSubgraph p✝
⊢ Walk.toSubgraph (reverse (cons h✝ p✝)) = Walk.toSubgraph (cons h✝ p✝)
[PROOFSTEP]

| cons _ _ _ =>
  simp only [*, Walk.toSubgraph, reverse_cons, toSubgraph_append, subgraphOfAdj_symm]
  rw [sup_comm]
  congr
  ext <;> simp [-Set.bot_eq_empty]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : Walk.toSubgraph (reverse p✝) = Walk.toSubgraph p✝
⊢ Walk.toSubgraph (reverse (cons h✝ p✝)) = Walk.toSubgraph (cons h✝ p✝)
[PROOFSTEP]
simp only [*, Walk.toSubgraph, reverse_cons, toSubgraph_append, subgraphOfAdj_symm]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : Walk.toSubgraph (reverse p✝) = Walk.toSubgraph p✝
⊢ Walk.toSubgraph p✝ ⊔ (subgraphOfAdj G (_ : Adj G u✝ v✝) ⊔ SimpleGraph.singletonSubgraph G u✝) =
    subgraphOfAdj G h✝ ⊔ Walk.toSubgraph p✝
[PROOFSTEP]
rw [sup_comm]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : Walk.toSubgraph (reverse p✝) = Walk.toSubgraph p✝
⊢ subgraphOfAdj G (_ : Adj G u✝ v✝) ⊔ SimpleGraph.singletonSubgraph G u✝ ⊔ Walk.toSubgraph p✝ =
    subgraphOfAdj G h✝ ⊔ Walk.toSubgraph p✝
[PROOFSTEP]
congr
[GOAL]
case cons.e_a
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : Walk.toSubgraph (reverse p✝) = Walk.toSubgraph p✝
⊢ subgraphOfAdj G (_ : Adj G u✝ v✝) ⊔ SimpleGraph.singletonSubgraph G u✝ = subgraphOfAdj G h✝
[PROOFSTEP]
ext
[GOAL]
case cons.e_a.verts.h
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : Walk.toSubgraph (reverse p✝) = Walk.toSubgraph p✝
x✝ : V
⊢ x✝ ∈ (subgraphOfAdj G (_ : Adj G u✝ v✝) ⊔ SimpleGraph.singletonSubgraph G u✝).verts ↔ x✝ ∈ (subgraphOfAdj G h✝).verts
[PROOFSTEP]
simp [-Set.bot_eq_empty]
[GOAL]
case cons.e_a.Adj.h.h.a
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : Walk.toSubgraph (reverse p✝) = Walk.toSubgraph p✝
x✝¹ x✝ : V
⊢ Subgraph.Adj (subgraphOfAdj G (_ : Adj G u✝ v✝) ⊔ SimpleGraph.singletonSubgraph G u✝) x✝¹ x✝ ↔
    Subgraph.Adj (subgraphOfAdj G h✝) x✝¹ x✝
[PROOFSTEP]
simp [-Set.bot_eq_empty]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
inst✝ : DecidableEq V
c : Walk G v v
h : u ∈ support c
⊢ Walk.toSubgraph (rotate c h) = Walk.toSubgraph c
[PROOFSTEP]
rw [rotate, toSubgraph_append, sup_comm, ← toSubgraph_append, take_spec]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
f : G →g G'
p : Walk G u v
⊢ Walk.toSubgraph (Walk.map f p) = Subgraph.map f (Walk.toSubgraph p)
[PROOFSTEP]
induction p
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
f : G →g G'
u✝ : V
⊢ Walk.toSubgraph (Walk.map f nil) = Subgraph.map f (Walk.toSubgraph nil)
[PROOFSTEP]
simp [*, Subgraph.map_sup]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
f : G →g G'
u✝ v✝ w✝ : V
h✝ : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
p_ih✝ : Walk.toSubgraph (Walk.map f p✝) = Subgraph.map f (Walk.toSubgraph p✝)
⊢ Walk.toSubgraph (Walk.map f (cons h✝ p✝)) = Subgraph.map f (Walk.toSubgraph (cons h✝ p✝))
[PROOFSTEP]
simp [*, Subgraph.map_sup]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
⊢ Set.Finite (Subgraph.neighborSet (Walk.toSubgraph p) w)
[PROOFSTEP]
induction p with
| nil =>
  rw [Walk.toSubgraph, neighborSet_singletonSubgraph]
  apply Set.toFinite
| cons ha _ ih =>
  rw [Walk.toSubgraph, Subgraph.neighborSet_sup]
  refine Set.Finite.union ?_ ih
  refine Set.Finite.subset ?_ (neighborSet_subgraphOfAdj_subset ha)
  apply Set.toFinite
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
⊢ Set.Finite (Subgraph.neighborSet (Walk.toSubgraph p) w)
[PROOFSTEP]
induction p with
| nil =>
  rw [Walk.toSubgraph, neighborSet_singletonSubgraph]
  apply Set.toFinite
| cons ha _ ih =>
  rw [Walk.toSubgraph, Subgraph.neighborSet_sup]
  refine Set.Finite.union ?_ ih
  refine Set.Finite.subset ?_ (neighborSet_subgraphOfAdj_subset ha)
  apply Set.toFinite
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ : V
⊢ Set.Finite (Subgraph.neighborSet (Walk.toSubgraph nil) w)
[PROOFSTEP]

| nil =>
  rw [Walk.toSubgraph, neighborSet_singletonSubgraph]
  apply Set.toFinite
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ : V
⊢ Set.Finite (Subgraph.neighborSet (Walk.toSubgraph nil) w)
[PROOFSTEP]
rw [Walk.toSubgraph, neighborSet_singletonSubgraph]
[GOAL]
case nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ : V
⊢ Set.Finite ∅
[PROOFSTEP]
apply Set.toFinite
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ v✝ w✝ : V
ha : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : Set.Finite (Subgraph.neighborSet (Walk.toSubgraph p✝) w)
⊢ Set.Finite (Subgraph.neighborSet (Walk.toSubgraph (cons ha p✝)) w)
[PROOFSTEP]

| cons ha _ ih =>
  rw [Walk.toSubgraph, Subgraph.neighborSet_sup]
  refine Set.Finite.union ?_ ih
  refine Set.Finite.subset ?_ (neighborSet_subgraphOfAdj_subset ha)
  apply Set.toFinite
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ v✝ w✝ : V
ha : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : Set.Finite (Subgraph.neighborSet (Walk.toSubgraph p✝) w)
⊢ Set.Finite (Subgraph.neighborSet (Walk.toSubgraph (cons ha p✝)) w)
[PROOFSTEP]
rw [Walk.toSubgraph, Subgraph.neighborSet_sup]
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ v✝ w✝ : V
ha : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : Set.Finite (Subgraph.neighborSet (Walk.toSubgraph p✝) w)
⊢ Set.Finite (Subgraph.neighborSet (subgraphOfAdj G ha) w ∪ Subgraph.neighborSet (Walk.toSubgraph p✝) w)
[PROOFSTEP]
refine Set.Finite.union ?_ ih
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ v✝ w✝ : V
ha : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : Set.Finite (Subgraph.neighborSet (Walk.toSubgraph p✝) w)
⊢ Set.Finite (Subgraph.neighborSet (subgraphOfAdj G ha) w)
[PROOFSTEP]
refine Set.Finite.subset ?_ (neighborSet_subgraphOfAdj_subset ha)
[GOAL]
case cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w u✝ v✝ w✝ : V
ha : Adj G u✝ v✝
p✝ : Walk G v✝ w✝
ih : Set.Finite (Subgraph.neighborSet (Walk.toSubgraph p✝) w)
⊢ Set.Finite {u✝, v✝}
[PROOFSTEP]
apply Set.toFinite
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
⊢ Walk.toSubgraph p ≤ Subgraph.induce ⊤ {v_1 | v_1 ∈ support p}
[PROOFSTEP]
convert Subgraph.le_induce_top_verts
[GOAL]
case h.e'_4.h.e'_4
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
p : Walk G u v
⊢ {v_1 | v_1 ∈ support p} = (Walk.toSubgraph p).verts
[PROOFSTEP]
exact p.verts_toSubgraph.symm
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u : V
⊢ {p | Walk.length p = 0} = {Walk.nil}
[PROOFSTEP]
ext p
[GOAL]
case h
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u : V
p : Walk G u u
⊢ p ∈ {p | Walk.length p = 0} ↔ p ∈ {Walk.nil}
[PROOFSTEP]
simp
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
h : u ≠ v
⊢ {p | Walk.length p = 0} = ∅
[PROOFSTEP]
ext p
[GOAL]
case h
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
h : u ≠ v
p : Walk G u v
⊢ p ∈ {p | Walk.length p = 0} ↔ p ∈ ∅
[PROOFSTEP]
simp only [Set.mem_setOf_eq, Set.mem_empty_iff_false, iff_false_iff]
[GOAL]
case h
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
h : u ≠ v
p : Walk G u v
⊢ ¬Walk.length p = 0
[PROOFSTEP]
exact fun h' => absurd (Walk.eq_of_length_eq_zero h') h
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
n : ℕ
⊢ {p | Walk.length p = Nat.succ n} = ⋃ (w : V) (h : Adj G u w), Walk.cons h '' {p' | Walk.length p' = n}
[PROOFSTEP]
ext p
[GOAL]
case h
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
n : ℕ
p : Walk G u v
⊢ p ∈ {p | Walk.length p = Nat.succ n} ↔ p ∈ ⋃ (w : V) (h : Adj G u w), Walk.cons h '' {p' | Walk.length p' = n}
[PROOFSTEP]
cases' p with _ _ w _ huw pwv
[GOAL]
case h.nil
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u : V
n : ℕ
⊢ Walk.nil ∈ {p | Walk.length p = Nat.succ n} ↔
    Walk.nil ∈ ⋃ (w : V) (h : Adj G u w), Walk.cons h '' {p' | Walk.length p' = n}
[PROOFSTEP]
simp [eq_comm]
[GOAL]
case h.cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
n : ℕ
w : V
huw : Adj G u w
pwv : Walk G w v
⊢ Walk.cons huw pwv ∈ {p | Walk.length p = Nat.succ n} ↔
    Walk.cons huw pwv ∈ ⋃ (w : V) (h : Adj G u w), Walk.cons h '' {p' | Walk.length p' = n}
[PROOFSTEP]
simp only [Nat.succ_eq_add_one, Set.mem_setOf_eq, Walk.length_cons, add_left_inj, Set.mem_iUnion, Set.mem_image,
  exists_prop]
[GOAL]
case h.cons
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
n : ℕ
w : V
huw : Adj G u w
pwv : Walk G w v
⊢ Walk.length pwv = n ↔ ∃ i h x, Walk.length x = n ∧ Walk.cons (_ : Adj G u i) x = Walk.cons huw pwv
[PROOFSTEP]
constructor
[GOAL]
case h.cons.mp
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
n : ℕ
w : V
huw : Adj G u w
pwv : Walk G w v
⊢ Walk.length pwv = n → ∃ i h x, Walk.length x = n ∧ Walk.cons (_ : Adj G u i) x = Walk.cons huw pwv
[PROOFSTEP]
rintro rfl
[GOAL]
case h.cons.mp
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
huw : Adj G u w
pwv : Walk G w v
⊢ ∃ i h x, Walk.length x = Walk.length pwv ∧ Walk.cons (_ : Adj G u i) x = Walk.cons huw pwv
[PROOFSTEP]
exact ⟨w, huw, pwv, rfl, rfl⟩
[GOAL]
case h.cons.mpr
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v : V
n : ℕ
w : V
huw : Adj G u w
pwv : Walk G w v
⊢ (∃ i h x, Walk.length x = n ∧ Walk.cons (_ : Adj G u i) x = Walk.cons huw pwv) → Walk.length pwv = n
[PROOFSTEP]
rintro ⟨w, huw, pwv, rfl, rfl, rfl⟩
[GOAL]
case h.cons.mpr.intro.intro.intro.intro.refl
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
u v w : V
huw✝ : Adj G u w
pwv : Walk G w v
huw : Adj G u w
⊢ Walk.length pwv = Walk.length pwv
[PROOFSTEP]
rfl
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝ : DecidableEq V
u v v✝ : V
h✝¹ : Adj G u v✝
h✝ : Adj G v✝ v
hp : Walk.length (Walk.cons h✝¹ (Walk.cons h✝ Walk.nil)) = 2
⊢ (fun w =>
        { val := Walk.concat (Adj.toWalk (_ : ↑w ∈ neighborSet G u)) (_ : Adj G (↑w) v),
          property :=
            (_ :
              Walk.length (Walk.concat (Adj.toWalk (_ : ↑w ∈ neighborSet G u)) (_ : Adj G (↑w) v)) =
                Walk.length (Walk.concat (Adj.toWalk (_ : ↑w ∈ neighborSet G u)) (_ : Adj G (↑w) v))) })
      ((fun p => { val := Walk.getVert (↑p) 1, property := (_ : Walk.getVert (↑p) 1 ∈ commonNeighbors G u v) })
        { val := Walk.cons h✝¹ (Walk.cons h✝ Walk.nil), property := hp }) =
    { val := Walk.cons h✝¹ (Walk.cons h✝ Walk.nil), property := hp }
[PROOFSTEP]
rfl
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝¹ : DecidableEq V
inst✝ : LocallyFinite G
n : ℕ
u v : V
h : u = v
⊢ Finset (Walk G u v)
[PROOFSTEP]
subst u
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝¹ : DecidableEq V
inst✝ : LocallyFinite G
n : ℕ
v : V
⊢ Finset (Walk G v v)
[PROOFSTEP]
exact { Walk.nil }
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝¹ : DecidableEq V
inst✝ : LocallyFinite G
n✝ : ℕ
u v : V
n : ℕ
w : ↑(neighborSet G u)
x✝¹ x✝ : Walk G (↑w) v
⊢ (fun p => Walk.cons (_ : ↑w ∈ neighborSet G u) p) x✝¹ = (fun p => Walk.cons (_ : ↑w ∈ neighborSet G u) p) x✝ →
    x✝¹ = x✝
[PROOFSTEP]
simp
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝¹ : DecidableEq V
inst✝ : LocallyFinite G
n : ℕ
u v : V
⊢ ↑(finsetWalkLength G n u v) = {p | Walk.length p = n}
[PROOFSTEP]
induction' n with n ih generalizing u v
[GOAL]
case zero
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝¹ : DecidableEq V
inst✝ : LocallyFinite G
u✝ v✝ u v : V
⊢ ↑(finsetWalkLength G Nat.zero u v) = {p | Walk.length p = Nat.zero}
[PROOFSTEP]
obtain rfl | huv := eq_or_ne u v
[GOAL]
case zero.inl
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝¹ : DecidableEq V
inst✝ : LocallyFinite G
u✝ v u : V
⊢ ↑(finsetWalkLength G Nat.zero u u) = {p | Walk.length p = Nat.zero}
[PROOFSTEP]
simp [finsetWalkLength, set_walk_length_zero_eq_of_ne, *]
[GOAL]
case zero.inr
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝¹ : DecidableEq V
inst✝ : LocallyFinite G
u✝ v✝ u v : V
huv : u ≠ v
⊢ ↑(finsetWalkLength G Nat.zero u v) = {p | Walk.length p = Nat.zero}
[PROOFSTEP]
simp [finsetWalkLength, set_walk_length_zero_eq_of_ne, *]
[GOAL]
case succ
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝¹ : DecidableEq V
inst✝ : LocallyFinite G
u✝ v✝ : V
n : ℕ
ih : ∀ (u v : V), ↑(finsetWalkLength G n u v) = {p | Walk.length p = n}
u v : V
⊢ ↑(finsetWalkLength G (Nat.succ n) u v) = {p | Walk.length p = Nat.succ n}
[PROOFSTEP]
simp only [finsetWalkLength, set_walk_length_succ_eq, Finset.coe_biUnion, Finset.mem_coe, Finset.mem_univ,
  Set.iUnion_true]
[GOAL]
case succ
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝¹ : DecidableEq V
inst✝ : LocallyFinite G
u✝ v✝ : V
n : ℕ
ih : ∀ (u v : V), ↑(finsetWalkLength G n u v) = {p | Walk.length p = n}
u v : V
⊢ ⋃ (x : ↑(neighborSet G u)),
      ↑(Finset.map
          { toFun := fun p => Walk.cons (_ : ↑x ∈ neighborSet G u) p,
            inj' :=
              (_ :
                ∀ (x_1 x_2 : Walk G (↑x) v),
                  Walk.cons (_ : ↑x ∈ neighborSet G u) x_1 = Walk.cons (_ : ↑x ∈ neighborSet G u) x_2 → x_1 = x_2) }
          (finsetWalkLength G n (↑x) v)) =
    ⋃ (w : V) (h : Adj G u w), Walk.cons h '' {p' | Walk.length p' = n}
[PROOFSTEP]
ext p
[GOAL]
case succ.h
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝¹ : DecidableEq V
inst✝ : LocallyFinite G
u✝ v✝ : V
n : ℕ
ih : ∀ (u v : V), ↑(finsetWalkLength G n u v) = {p | Walk.length p = n}
u v : V
p : Walk G u v
⊢ p ∈
      ⋃ (x : ↑(neighborSet G u)),
        ↑(Finset.map
            { toFun := fun p => Walk.cons (_ : ↑x ∈ neighborSet G u) p,
              inj' :=
                (_ :
                  ∀ (x_1 x_2 : Walk G (↑x) v),
                    Walk.cons (_ : ↑x ∈ neighborSet G u) x_1 = Walk.cons (_ : ↑x ∈ neighborSet G u) x_2 → x_1 = x_2) }
            (finsetWalkLength G n (↑x) v)) ↔
    p ∈ ⋃ (w : V) (h : Adj G u w), Walk.cons h '' {p' | Walk.length p' = n}
[PROOFSTEP]
simp only [mem_neighborSet, Finset.coe_map, Embedding.coeFn_mk, Set.iUnion_coe_set, Set.mem_iUnion, Set.mem_image,
  Finset.mem_coe, Set.mem_setOf_eq]
[GOAL]
case succ.h
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝¹ : DecidableEq V
inst✝ : LocallyFinite G
u✝ v✝ : V
n : ℕ
ih : ∀ (u v : V), ↑(finsetWalkLength G n u v) = {p | Walk.length p = n}
u v : V
p : Walk G u v
⊢ (∃ i h x,
      x ∈ finsetWalkLength G n i v ∧
        Walk.cons (_ : ↑{ val := i, property := (_ : i ∈ neighborSet G u) } ∈ neighborSet G u) x = p) ↔
    ∃ i h x, Walk.length x = n ∧ Walk.cons (_ : Adj G u i) x = p
[PROOFSTEP]
congr!
[GOAL]
case succ.h.a.h.e'_2.h.h.e'_2.h.h.e'_2.h.h.e'_1.a
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝¹ : DecidableEq V
inst✝ : LocallyFinite G
u✝ v✝ : V
n : ℕ
ih : ∀ (u v : V), ↑(finsetWalkLength G n u v) = {p | Walk.length p = n}
u v : V
p : Walk G u v
x✝² : V
x✝¹ : Adj G u x✝²
x✝ : Walk G x✝² v
⊢ x✝ ∈ finsetWalkLength G n x✝² v ↔ Walk.length x✝ = n
[PROOFSTEP]
rename_i w _ q
[GOAL]
case succ.h.a.h.e'_2.h.h.e'_2.h.h.e'_2.h.h.e'_1.a
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝¹ : DecidableEq V
inst✝ : LocallyFinite G
u✝ v✝ : V
n : ℕ
ih : ∀ (u v : V), ↑(finsetWalkLength G n u v) = {p | Walk.length p = n}
u v : V
p : Walk G u v
w : V
x✝ : Adj G u w
q : Walk G w v
⊢ q ∈ finsetWalkLength G n w v ↔ Walk.length q = n
[PROOFSTEP]
have := Set.ext_iff.mp (ih w v) q
[GOAL]
case succ.h.a.h.e'_2.h.h.e'_2.h.h.e'_2.h.h.e'_1.a
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝¹ : DecidableEq V
inst✝ : LocallyFinite G
u✝ v✝ : V
n : ℕ
ih : ∀ (u v : V), ↑(finsetWalkLength G n u v) = {p | Walk.length p = n}
u v : V
p : Walk G u v
w : V
x✝ : Adj G u w
q : Walk G w v
this : q ∈ ↑(finsetWalkLength G n w v) ↔ q ∈ {p | Walk.length p = n}
⊢ q ∈ finsetWalkLength G n w v ↔ Walk.length q = n
[PROOFSTEP]
simp only [Finset.mem_coe, Set.mem_setOf_eq] at this 
[GOAL]
case succ.h.a.h.e'_2.h.h.e'_2.h.h.e'_2.h.h.e'_1.a
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝¹ : DecidableEq V
inst✝ : LocallyFinite G
u✝ v✝ : V
n : ℕ
ih : ∀ (u v : V), ↑(finsetWalkLength G n u v) = {p | Walk.length p = n}
u v : V
p : Walk G u v
w : V
x✝ : Adj G u w
q : Walk G w v
this : q ∈ finsetWalkLength G n w v ↔ Walk.length q = n
⊢ q ∈ finsetWalkLength G n w v ↔ Walk.length q = n
[PROOFSTEP]
rw [← this]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝¹ : DecidableEq V
inst✝ : LocallyFinite G
u v : V
n : ℕ
p : Walk G u v
⊢ p ∈ finsetWalkLength G n u v ↔ p ∈ {p | Walk.length p = n}
[PROOFSTEP]
rw [← Finset.mem_coe, coe_finsetWalkLength_eq]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝¹ : DecidableEq V
inst✝ : LocallyFinite G
n : ℕ
u v : V
⊢ Set.toFinset {p | Walk.length p = n} = finsetWalkLength G n u v
[PROOFSTEP]
ext p
[GOAL]
case a
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝¹ : DecidableEq V
inst✝ : LocallyFinite G
n : ℕ
u v : V
p : Walk G u v
⊢ p ∈ Set.toFinset {p | Walk.length p = n} ↔ p ∈ finsetWalkLength G n u v
[PROOFSTEP]
simp [← coe_finsetWalkLength_eq]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝¹ : DecidableEq V
inst✝ : LocallyFinite G
u v : V
n : ℕ
p : Walk G u v
⊢ p ∈ finsetWalkLength G n u v ↔ p ∈ {p | Walk.length p = n}
[PROOFSTEP]
rw [← Finset.mem_coe, coe_finsetWalkLength_eq]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝¹ : DecidableEq V
inst✝ : LocallyFinite G
u v : V
n : ℕ
⊢ ∀ (x : Walk G u v),
    x ∈ Finset.filter Walk.IsPath (finsetWalkLength G n u v) ↔ x ∈ {p | Walk.IsPath p ∧ Walk.length p = n}
[PROOFSTEP]
simp [Walk.mem_finsetWalkLength_iff_length_eq, and_comm]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝² : DecidableEq V
inst✝¹ : Fintype V
inst✝ : DecidableRel G.Adj
u v : V
⊢ Reachable G u v ↔ ∃ n, Finset.Nonempty (finsetWalkLength G (↑n) u v)
[PROOFSTEP]
constructor
[GOAL]
case mp
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝² : DecidableEq V
inst✝¹ : Fintype V
inst✝ : DecidableRel G.Adj
u v : V
⊢ Reachable G u v → ∃ n, Finset.Nonempty (finsetWalkLength G (↑n) u v)
[PROOFSTEP]
intro r
[GOAL]
case mp
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝² : DecidableEq V
inst✝¹ : Fintype V
inst✝ : DecidableRel G.Adj
u v : V
r : Reachable G u v
⊢ ∃ n, Finset.Nonempty (finsetWalkLength G (↑n) u v)
[PROOFSTEP]
refine r.elim_path fun p => ?_
[GOAL]
case mp
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝² : DecidableEq V
inst✝¹ : Fintype V
inst✝ : DecidableRel G.Adj
u v : V
r : Reachable G u v
p : Path G u v
⊢ ∃ n, Finset.Nonempty (finsetWalkLength G (↑n) u v)
[PROOFSTEP]
refine ⟨⟨_, p.isPath.length_lt⟩, p, ?_⟩
[GOAL]
case mp
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝² : DecidableEq V
inst✝¹ : Fintype V
inst✝ : DecidableRel G.Adj
u v : V
r : Reachable G u v
p : Path G u v
⊢ ↑p ∈ finsetWalkLength G (↑{ val := Walk.length ↑p, isLt := (_ : Walk.length ↑p < Fintype.card V) }) u v
[PROOFSTEP]
simp [Walk.mem_finsetWalkLength_iff_length_eq]
[GOAL]
case mpr
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝² : DecidableEq V
inst✝¹ : Fintype V
inst✝ : DecidableRel G.Adj
u v : V
⊢ (∃ n, Finset.Nonempty (finsetWalkLength G (↑n) u v)) → Reachable G u v
[PROOFSTEP]
rintro ⟨_, p, _⟩
[GOAL]
case mpr.intro.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝² : DecidableEq V
inst✝¹ : Fintype V
inst✝ : DecidableRel G.Adj
u v : V
w✝ : Fin (Fintype.card V)
p : Walk G u v
h✝ : p ∈ finsetWalkLength G (↑w✝) u v
⊢ Reachable G u v
[PROOFSTEP]
exact ⟨p⟩
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝² : DecidableEq V
inst✝¹ : Fintype V
inst✝ : DecidableRel G.Adj
⊢ Decidable (Connected G)
[PROOFSTEP]
rw [connected_iff, ← Finset.univ_nonempty_iff]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
inst✝² : DecidableEq V
inst✝¹ : Fintype V
inst✝ : DecidableRel G.Adj
⊢ Decidable (Preconnected G ∧ Finset.Nonempty Finset.univ)
[PROOFSTEP]
infer_instance
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G✝ : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
G : SimpleGraph V
e : Sym2 V
⊢ ∀ (a₁ a₂ : V),
    (fun v w => ¬Reachable (G \ fromEdgeSet {e}) v w) a₁ a₂ = (fun v w => ¬Reachable (G \ fromEdgeSet {e}) v w) a₂ a₁
[PROOFSTEP]
simp [reachable_comm]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
⊢ Reachable (G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)}) v w ↔
    ∃ p, ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
[PROOFSTEP]
constructor
[GOAL]
case mp
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
⊢ Reachable (G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)}) v w →
    ∃ p, ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
[PROOFSTEP]
rintro ⟨p⟩
[GOAL]
case mp.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
p : Walk (G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)}) v w
⊢ ∃ p, ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
[PROOFSTEP]
use p.map (Hom.mapSpanningSubgraphs (by simp))
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
p : Walk (G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)}) v w
⊢ G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)} ≤ G
[PROOFSTEP]
simp
[GOAL]
case h
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
p : Walk (G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)}) v w
⊢ ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈
      Walk.edges
        (Walk.map (Hom.mapSpanningSubgraphs (_ : G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)} ≤ G)) p)
[PROOFSTEP]
simp_rw [Walk.edges_map, List.mem_map, Hom.mapSpanningSubgraphs_apply, Sym2.map_id', id.def]
[GOAL]
case h
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
p : Walk (G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)}) v w
⊢ ¬∃ a, a ∈ Walk.edges p ∧ a = Quotient.mk (Sym2.Rel.setoid V) (v, w)
[PROOFSTEP]
rintro ⟨e, h, rfl⟩
[GOAL]
case h.intro.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
p : Walk (G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)}) v w
h : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
⊢ False
[PROOFSTEP]
simpa using p.edges_subset_edgeSet h
[GOAL]
case mpr
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
⊢ (∃ p, ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p) →
    Reachable (G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)}) v w
[PROOFSTEP]
rintro ⟨p, h⟩
[GOAL]
case mpr.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
p : Walk G v w
h : ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
⊢ Reachable (G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)}) v w
[PROOFSTEP]
refine ⟨p.transfer _ fun e ep => ?_⟩
[GOAL]
case mpr.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
p : Walk G v w
h : ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
e : Sym2 V
ep : e ∈ Walk.edges p
⊢ e ∈ edgeSet (G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)})
[PROOFSTEP]
simp only [edgeSet_sdiff, edgeSet_fromEdgeSet, edgeSet_sdiff_sdiff_isDiag, Set.mem_diff, Set.mem_singleton_iff]
[GOAL]
case mpr.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
p : Walk G v w
h : ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
e : Sym2 V
ep : e ∈ Walk.edges p
⊢ e ∈ edgeSet G ∧ ¬e = Quotient.mk (Sym2.Rel.setoid V) (v, w)
[PROOFSTEP]
exact ⟨p.edges_subset_edgeSet ep, fun h' => h (h' ▸ ep)⟩
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
⊢ IsBridge G (Quotient.mk (Sym2.Rel.setoid V) (v, w)) ↔
    Adj G v w ∧ ∀ (p : Walk G v w), Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
[PROOFSTEP]
rw [isBridge_iff, and_congr_right']
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
⊢ ¬Reachable (G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)}) v w ↔
    ∀ (p : Walk G v w), Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
[PROOFSTEP]
rw [reachable_delete_edges_iff_exists_walk, not_exists_not]
[GOAL]
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
hb : ∀ (p : Walk G v w), Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
c : Walk G u u
hc : Walk.IsTrail c
he : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges c
hw : w ∈ Walk.support (Walk.takeUntil c v (_ : v ∈ Walk.support c))
⊢ False
[PROOFSTEP]
have hv := c.fst_mem_support_of_mem_edges he
[GOAL]
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
hb : ∀ (p : Walk G v w), Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
c : Walk G u u
hc : Walk.IsTrail c
he : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges c
hw : w ∈ Walk.support (Walk.takeUntil c v (_ : v ∈ Walk.support c))
hv : v ∈ Walk.support c
⊢ False
[PROOFSTEP]
let puw := (c.takeUntil v hv).takeUntil w hw
[GOAL]
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
hb : ∀ (p : Walk G v w), Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
c : Walk G u u
hc : Walk.IsTrail c
he : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges c
hw : w ∈ Walk.support (Walk.takeUntil c v (_ : v ∈ Walk.support c))
hv : v ∈ Walk.support c
puw : Walk G u w := Walk.takeUntil (Walk.takeUntil c v hv) w hw
⊢ False
[PROOFSTEP]
let pwv := (c.takeUntil v hv).dropUntil w hw
[GOAL]
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
hb : ∀ (p : Walk G v w), Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
c : Walk G u u
hc : Walk.IsTrail c
he : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges c
hw : w ∈ Walk.support (Walk.takeUntil c v (_ : v ∈ Walk.support c))
hv : v ∈ Walk.support c
puw : Walk G u w := Walk.takeUntil (Walk.takeUntil c v hv) w hw
pwv : Walk G w v := Walk.dropUntil (Walk.takeUntil c v hv) w hw
⊢ False
[PROOFSTEP]
let pvu := c.dropUntil v hv
[GOAL]
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
hb : ∀ (p : Walk G v w), Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
c : Walk G u u
hc : Walk.IsTrail c
he : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges c
hw : w ∈ Walk.support (Walk.takeUntil c v (_ : v ∈ Walk.support c))
hv : v ∈ Walk.support c
puw : Walk G u w := Walk.takeUntil (Walk.takeUntil c v hv) w hw
pwv : Walk G w v := Walk.dropUntil (Walk.takeUntil c v hv) w hw
pvu : Walk G v u := Walk.dropUntil c v hv
⊢ False
[PROOFSTEP]
have : c = (puw.append pwv).append pvu := by
  simp
    -- We have two walks from v to w
      --      pvu     puw
      --   v ----> u ----> w
      --   |               ^
      --    `-------------'
      --      pwv.reverse
      -- so they both contain the edge ⟦(v, w)⟧, but that's a contradiction since c is a trail.
[GOAL]
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
hb : ∀ (p : Walk G v w), Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
c : Walk G u u
hc : Walk.IsTrail c
he : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges c
hw : w ∈ Walk.support (Walk.takeUntil c v (_ : v ∈ Walk.support c))
hv : v ∈ Walk.support c
puw : Walk G u w := Walk.takeUntil (Walk.takeUntil c v hv) w hw
pwv : Walk G w v := Walk.dropUntil (Walk.takeUntil c v hv) w hw
pvu : Walk G v u := Walk.dropUntil c v hv
⊢ c = Walk.append (Walk.append puw pwv) pvu
[PROOFSTEP]
simp
  -- We have two walks from v to w
    --      pvu     puw
    --   v ----> u ----> w
    --   |               ^
    --    `-------------'
    --      pwv.reverse
    -- so they both contain the edge ⟦(v, w)⟧, but that's a contradiction since c is a trail.
[GOAL]
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
hb : ∀ (p : Walk G v w), Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
c : Walk G u u
hc : Walk.IsTrail c
he : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges c
hw : w ∈ Walk.support (Walk.takeUntil c v (_ : v ∈ Walk.support c))
hv : v ∈ Walk.support c
puw : Walk G u w := Walk.takeUntil (Walk.takeUntil c v hv) w hw
pwv : Walk G w v := Walk.dropUntil (Walk.takeUntil c v hv) w hw
pvu : Walk G v u := Walk.dropUntil c v hv
this : c = Walk.append (Walk.append puw pwv) pvu
⊢ False
[PROOFSTEP]
have hbq := hb (pvu.append puw)
[GOAL]
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
hb : ∀ (p : Walk G v w), Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
c : Walk G u u
hc : Walk.IsTrail c
he : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges c
hw : w ∈ Walk.support (Walk.takeUntil c v (_ : v ∈ Walk.support c))
hv : v ∈ Walk.support c
puw : Walk G u w := Walk.takeUntil (Walk.takeUntil c v hv) w hw
pwv : Walk G w v := Walk.dropUntil (Walk.takeUntil c v hv) w hw
pvu : Walk G v u := Walk.dropUntil c v hv
this : c = Walk.append (Walk.append puw pwv) pvu
hbq : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges (Walk.append pvu puw)
⊢ False
[PROOFSTEP]
have hpq' := hb pwv.reverse
[GOAL]
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
hb : ∀ (p : Walk G v w), Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
c : Walk G u u
hc : Walk.IsTrail c
he : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges c
hw : w ∈ Walk.support (Walk.takeUntil c v (_ : v ∈ Walk.support c))
hv : v ∈ Walk.support c
puw : Walk G u w := Walk.takeUntil (Walk.takeUntil c v hv) w hw
pwv : Walk G w v := Walk.dropUntil (Walk.takeUntil c v hv) w hw
pvu : Walk G v u := Walk.dropUntil c v hv
this : c = Walk.append (Walk.append puw pwv) pvu
hbq : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges (Walk.append pvu puw)
hpq' : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges (Walk.reverse pwv)
⊢ False
[PROOFSTEP]
rw [Walk.edges_reverse, List.mem_reverse] at hpq' 
[GOAL]
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
hb : ∀ (p : Walk G v w), Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
c : Walk G u u
hc : Walk.IsTrail c
he : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges c
hw : w ∈ Walk.support (Walk.takeUntil c v (_ : v ∈ Walk.support c))
hv : v ∈ Walk.support c
puw : Walk G u w := Walk.takeUntil (Walk.takeUntil c v hv) w hw
pwv : Walk G w v := Walk.dropUntil (Walk.takeUntil c v hv) w hw
pvu : Walk G v u := Walk.dropUntil c v hv
this : c = Walk.append (Walk.append puw pwv) pvu
hbq : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges (Walk.append pvu puw)
hpq' : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges pwv
⊢ False
[PROOFSTEP]
rw [Walk.isTrail_def, this, Walk.edges_append, Walk.edges_append, List.nodup_append_comm, ← List.append_assoc, ←
  Walk.edges_append] at hc 
[GOAL]
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
hb : ∀ (p : Walk G v w), Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
c : Walk G u u
he : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges c
hw : w ∈ Walk.support (Walk.takeUntil c v (_ : v ∈ Walk.support c))
hv : v ∈ Walk.support c
puw : Walk G u w := Walk.takeUntil (Walk.takeUntil c v hv) w hw
pwv : Walk G w v := Walk.dropUntil (Walk.takeUntil c v hv) w hw
pvu : Walk G v u := Walk.dropUntil c v hv
hc : List.Nodup (Walk.edges (Walk.append pvu puw) ++ Walk.edges pwv)
this : c = Walk.append (Walk.append puw pwv) pvu
hbq : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges (Walk.append pvu puw)
hpq' : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges pwv
⊢ False
[PROOFSTEP]
exact List.disjoint_of_nodup_append hc hbq hpq'
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
⊢ Adj G v w ∧ Reachable (G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)}) v w ↔
    ∃ u p, Walk.IsCycle p ∧ Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
[PROOFSTEP]
classical
rw [reachable_delete_edges_iff_exists_walk]
constructor
· rintro ⟨h, p, hp⟩
  refine ⟨w, Walk.cons h.symm p.toPath, ?_, ?_⟩
  · apply Path.cons_isCycle
    rw [Sym2.eq_swap]
    intro h
    cases hp (Walk.edges_toPath_subset p h)
  · simp only [Sym2.eq_swap, Walk.edges_cons, List.mem_cons, eq_self_iff_true, true_or_iff]
· rintro ⟨u, c, hc, he⟩
  refine ⟨c.adj_of_mem_edges he, ?_⟩
  by_contra' hb
  have hb' : ∀ p : G.Walk w v, ⟦(w, v)⟧ ∈ p.edges := by
    intro p
    simpa [Sym2.eq_swap] using hb p.reverse
  have hvc : v ∈ c.support := Walk.fst_mem_support_of_mem_edges c he
  refine
    reachable_deleteEdges_iff_exists_cycle.aux hb' (c.rotate hvc) (hc.isTrail.rotate hvc) ?_ (Walk.start_mem_support _)
  rwa [(Walk.rotate_edges c hvc).mem_iff, Sym2.eq_swap]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
⊢ Adj G v w ∧ Reachable (G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)}) v w ↔
    ∃ u p, Walk.IsCycle p ∧ Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
[PROOFSTEP]
rw [reachable_delete_edges_iff_exists_walk]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
⊢ (Adj G v w ∧ ∃ p, ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p) ↔
    ∃ u p, Walk.IsCycle p ∧ Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
[PROOFSTEP]
constructor
[GOAL]
case mp
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
⊢ (Adj G v w ∧ ∃ p, ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p) →
    ∃ u p, Walk.IsCycle p ∧ Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
[PROOFSTEP]
rintro ⟨h, p, hp⟩
[GOAL]
case mp.intro.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
h : Adj G v w
p : Walk G v w
hp : ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
⊢ ∃ u p, Walk.IsCycle p ∧ Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
[PROOFSTEP]
refine ⟨w, Walk.cons h.symm p.toPath, ?_, ?_⟩
[GOAL]
case mp.intro.intro.refine_1
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
h : Adj G v w
p : Walk G v w
hp : ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
⊢ Walk.IsCycle (Walk.cons (_ : Adj G w v) ↑(Walk.toPath p))
[PROOFSTEP]
apply Path.cons_isCycle
[GOAL]
case mp.intro.intro.refine_1.he
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
h : Adj G v w
p : Walk G v w
hp : ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
⊢ ¬Quotient.mk (Sym2.Rel.setoid V) (w, v) ∈ Walk.edges ↑(Walk.toPath p)
[PROOFSTEP]
rw [Sym2.eq_swap]
[GOAL]
case mp.intro.intro.refine_1.he
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
h : Adj G v w
p : Walk G v w
hp : ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
⊢ ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges ↑(Walk.toPath p)
[PROOFSTEP]
intro h
[GOAL]
case mp.intro.intro.refine_1.he
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
h✝ : Adj G v w
p : Walk G v w
hp : ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
h : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges ↑(Walk.toPath p)
⊢ False
[PROOFSTEP]
cases hp (Walk.edges_toPath_subset p h)
[GOAL]
case mp.intro.intro.refine_2
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
h : Adj G v w
p : Walk G v w
hp : ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
⊢ Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges (Walk.cons (_ : Adj G w v) ↑(Walk.toPath p))
[PROOFSTEP]
simp only [Sym2.eq_swap, Walk.edges_cons, List.mem_cons, eq_self_iff_true, true_or_iff]
[GOAL]
case mpr
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
⊢ (∃ u p, Walk.IsCycle p ∧ Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p) →
    Adj G v w ∧ ∃ p, ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
[PROOFSTEP]
rintro ⟨u, c, hc, he⟩
[GOAL]
case mpr.intro.intro.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w u : V
c : Walk G u u
hc : Walk.IsCycle c
he : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges c
⊢ Adj G v w ∧ ∃ p, ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
[PROOFSTEP]
refine ⟨c.adj_of_mem_edges he, ?_⟩
[GOAL]
case mpr.intro.intro.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w u : V
c : Walk G u u
hc : Walk.IsCycle c
he : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges c
⊢ ∃ p, ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
[PROOFSTEP]
by_contra' hb
[GOAL]
case mpr.intro.intro.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w u : V
c : Walk G u u
hc : Walk.IsCycle c
he : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges c
hb : ∀ (p : Walk G v w), Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
⊢ False
[PROOFSTEP]
have hb' : ∀ p : G.Walk w v, ⟦(w, v)⟧ ∈ p.edges := by
  intro p
  simpa [Sym2.eq_swap] using hb p.reverse
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w u : V
c : Walk G u u
hc : Walk.IsCycle c
he : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges c
hb : ∀ (p : Walk G v w), Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
⊢ ∀ (p : Walk G w v), Quotient.mk (Sym2.Rel.setoid V) (w, v) ∈ Walk.edges p
[PROOFSTEP]
intro p
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w u : V
c : Walk G u u
hc : Walk.IsCycle c
he : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges c
hb : ∀ (p : Walk G v w), Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
p : Walk G w v
⊢ Quotient.mk (Sym2.Rel.setoid V) (w, v) ∈ Walk.edges p
[PROOFSTEP]
simpa [Sym2.eq_swap] using hb p.reverse
[GOAL]
case mpr.intro.intro.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w u : V
c : Walk G u u
hc : Walk.IsCycle c
he : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges c
hb : ∀ (p : Walk G v w), Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
hb' : ∀ (p : Walk G w v), Quotient.mk (Sym2.Rel.setoid V) (w, v) ∈ Walk.edges p
⊢ False
[PROOFSTEP]
have hvc : v ∈ c.support := Walk.fst_mem_support_of_mem_edges c he
[GOAL]
case mpr.intro.intro.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w u : V
c : Walk G u u
hc : Walk.IsCycle c
he : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges c
hb : ∀ (p : Walk G v w), Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
hb' : ∀ (p : Walk G w v), Quotient.mk (Sym2.Rel.setoid V) (w, v) ∈ Walk.edges p
hvc : v ∈ Walk.support c
⊢ False
[PROOFSTEP]
refine
  reachable_deleteEdges_iff_exists_cycle.aux hb' (c.rotate hvc) (hc.isTrail.rotate hvc) ?_ (Walk.start_mem_support _)
[GOAL]
case mpr.intro.intro.intro
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w u : V
c : Walk G u u
hc : Walk.IsCycle c
he : Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges c
hb : ∀ (p : Walk G v w), Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
hb' : ∀ (p : Walk G w v), Quotient.mk (Sym2.Rel.setoid V) (w, v) ∈ Walk.edges p
hvc : v ∈ Walk.support c
⊢ Quotient.mk (Sym2.Rel.setoid V) (w, v) ∈ Walk.edges (Walk.rotate c hvc)
[PROOFSTEP]
rwa [(Walk.rotate_edges c hvc).mem_iff, Sym2.eq_swap]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
⊢ IsBridge G (Quotient.mk (Sym2.Rel.setoid V) (v, w)) ↔
    Adj G v w ∧ ∀ ⦃u : V⦄ (p : Walk G u u), Walk.IsCycle p → ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
[PROOFSTEP]
rw [isBridge_iff, and_congr_right_iff]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
⊢ Adj G v w →
    (¬Reachable (G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)}) v w ↔
      ∀ ⦃u : V⦄ (p : Walk G u u), Walk.IsCycle p → ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p)
[PROOFSTEP]
intro h
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
h : Adj G v w
⊢ ¬Reachable (G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)}) v w ↔
    ∀ ⦃u : V⦄ (p : Walk G u u), Walk.IsCycle p → ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
[PROOFSTEP]
rw [← not_iff_not]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
h : Adj G v w
⊢ ¬¬Reachable (G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)}) v w ↔
    ¬∀ ⦃u : V⦄ (p : Walk G u u), Walk.IsCycle p → ¬Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
[PROOFSTEP]
push_neg
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
h : Adj G v w
⊢ Reachable (G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)}) v w ↔
    Exists fun ⦃u⦄ => ∃ p, Walk.IsCycle p ∧ Quotient.mk (Sym2.Rel.setoid V) (v, w) ∈ Walk.edges p
[PROOFSTEP]
rw [← adj_and_reachable_delete_edges_iff_exists_cycle]
[GOAL]
V : Type u
V' : Type v
V'' : Type w
G : SimpleGraph V
G' : SimpleGraph V'
G'' : SimpleGraph V''
v w : V
h : Adj G v w
⊢ Reachable (G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)}) v w ↔
    Adj G v w ∧ Reachable (G \ fromEdgeSet {Quotient.mk (Sym2.Rel.setoid V) (v, w)}) v w
[PROOFSTEP]
simp only [h, true_and_iff]
