Theorem: Digraph.Walk.map_isTrail_iff_of_injective (GraphProjects/DigraphConnectivity.lean)

State before:
V : Type u
V' : Type v
V'' : Type w
G : Digraph V
G' : Digraph V'
G'' : Digraph 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
Tactic:
induction p with
| nil => simp
| cons _ _ ih =>
  rw [map_cons, cons_isTrail_iff, ih, cons_isTrail_iff]
  apply and_congr_right'
  rw [edges_map, ← List.mem_map_of_injective (Injective.Prod_map hinj hinj)]
  exact Iff.rfl
State after:
no goals

State before:
case nil
V : Type u
V' : Type v
V'' : Type w
G : Digraph V
G' : Digraph V'
G'' : Digraph 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
Tactic:
simp
State after:
no goals

State before:
case cons
V : Type u
V' : Type v
V'' : Type w
G : Digraph V
G' : Digraph V'
G'' : Digraph 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✝ : G.Adj 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✝)
Tactic:
rw [map_cons, cons_isTrail_iff, ih, cons_isTrail_iff]
State after:
case cons
V : Type u
V' : Type v
V'' : Type w
G : Digraph V
G' : Digraph V'
G'' : Digraph 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✝ : G.Adj u✝ v✝
p✝ : Walk G v✝ w✝
ih : IsTrail (Walk.map f p✝) ↔ IsTrail p✝
⊢ IsTrail p✝ ∧ ¬(↑f u✝, ↑f v✝) ∈ edges (Walk.map f p✝) ↔ IsTrail p✝ ∧ ¬(u✝, v✝) ∈ edges p✝

State before:
case cons
V : Type u
V' : Type v
V'' : Type w
G : Digraph V
G' : Digraph V'
G'' : Digraph 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✝ : G.Adj u✝ v✝
p✝ : Walk G v✝ w✝
ih : IsTrail (Walk.map f p✝) ↔ IsTrail p✝
⊢ IsTrail p✝ ∧ ¬(↑f u✝, ↑f v✝) ∈ edges (Walk.map f p✝) ↔ IsTrail p✝ ∧ ¬(u✝, v✝) ∈ edges p✝
Tactic:
apply and_congr_right'
State after:
case cons.h
V : Type u
V' : Type v
V'' : Type w
G : Digraph V
G' : Digraph V'
G'' : Digraph 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✝ : G.Adj u✝ v✝
p✝ : Walk G v✝ w✝
ih : IsTrail (Walk.map f p✝) ↔ IsTrail p✝
⊢ ¬(↑f u✝, ↑f v✝) ∈ edges (Walk.map f p✝) ↔ ¬(u✝, v✝) ∈ edges p✝

State before:
case cons.h
V : Type u
V' : Type v
V'' : Type w
G : Digraph V
G' : Digraph V'
G'' : Digraph 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✝ : G.Adj u✝ v✝
p✝ : Walk G v✝ w✝
ih : IsTrail (Walk.map f p✝) ↔ IsTrail p✝
⊢ ¬(↑f u✝, ↑f v✝) ∈ edges (Walk.map f p✝) ↔ ¬(u✝, v✝) ∈ edges p✝
Tactic:
rw [edges_map, ← List.mem_map_of_injective (Injective.Prod_map hinj hinj)]
State after:
case cons.h
V : Type u
V' : Type v
V'' : Type w
G : Digraph V
G' : Digraph V'
G'' : Digraph 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✝ : G.Adj u✝ v✝
p✝ : Walk G v✝ w✝
ih : IsTrail (Walk.map f p✝) ↔ IsTrail p✝
⊢ ¬(↑f u✝, ↑f v✝) ∈ List.map (Prod.map ↑f ↑f) (edges p✝) ↔
    ¬Prod.map ↑f ↑f (u✝, v✝) ∈ List.map (Prod.map ↑f ↑f) (edges p✝)

State before:
case cons.h
V : Type u
V' : Type v
V'' : Type w
G : Digraph V
G' : Digraph V'
G'' : Digraph 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✝ : G.Adj u✝ v✝
p✝ : Walk G v✝ w✝
ih : IsTrail (Walk.map f p✝) ↔ IsTrail p✝
⊢ ¬(↑f u✝, ↑f v✝) ∈ List.map (Prod.map ↑f ↑f) (edges p✝) ↔
    ¬Prod.map ↑f ↑f (u✝, v✝) ∈ List.map (Prod.map ↑f ↑f) (edges p✝)
Tactic:
exact Iff.rfl
State after:
no goals