Theorem: PFunctor.M.iselect_eq_default
File: Mathlib/Data/PFunctor/Univariate/M.lean

tactic: induction' ps with ps_hd ps_tail ps_ih generalizing x
state_before: F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
ps : Path F
x : F.M
h : ¬IsPath ps x
⊢ iselect ps x = default.head
state_after: case nil
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
x : F.M
h : ¬IsPath [] x
⊢ iselect [] x = default.head

case cons
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
ps_hd : F.Idx
ps_tail : List F.Idx
ps_ih : ∀ (x : F.M), ¬IsPath ps_tail x → iselect ps_tail x = default.head
x : F.M
h : ¬IsPath (ps_hd :: ps_tail) x
⊢ iselect (ps_hd :: ps_tail) x = default.head

tactic: exfalso
state_before: case nil
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
x : F.M
h : ¬IsPath [] x
⊢ iselect [] x = default.head
state_after: case nil
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
x : F.M
h : ¬IsPath [] x
⊢ False

tactic: apply h
state_before: case nil
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
x : F.M
h : ¬IsPath [] x
⊢ False
state_after: case nil
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
x : F.M
h : ¬IsPath [] x
⊢ IsPath [] x

tactic: constructor
state_before: case nil
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
x : F.M
h : ¬IsPath [] x
⊢ IsPath [] x
state_after: no goals

tactic: cases' ps_hd with a i
state_before: case cons
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
ps_hd : F.Idx
ps_tail : List F.Idx
ps_ih : ∀ (x : F.M), ¬IsPath ps_tail x → iselect ps_tail x = default.head
x : F.M
h : ¬IsPath (ps_hd :: ps_tail) x
⊢ iselect (ps_hd :: ps_tail) x = default.head
state_after: case cons.mk
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
ps_tail : List F.Idx
ps_ih : ∀ (x : F.M), ¬IsPath ps_tail x → iselect ps_tail x = default.head
x : F.M
a : F.A
i : F.B a
h : ¬IsPath (⟨a, i⟩ :: ps_tail) x
⊢ iselect (⟨a, i⟩ :: ps_tail) x = default.head

tactic: induction' x using PFunctor.M.casesOn' with x_a x_f
state_before: case cons.mk
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
ps_tail : List F.Idx
ps_ih : ∀ (x : F.M), ¬IsPath ps_tail x → iselect ps_tail x = default.head
x : F.M
a : F.A
i : F.B a
h : ¬IsPath (⟨a, i⟩ :: ps_tail) x
⊢ iselect (⟨a, i⟩ :: ps_tail) x = default.head
state_after: case cons.mk.f
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
ps_tail : List F.Idx
ps_ih : ∀ (x : F.M), ¬IsPath ps_tail x → iselect ps_tail x = default.head
a : F.A
i : F.B a
x_a : F.A
x_f : F.B x_a → F.M
h : ¬IsPath (⟨a, i⟩ :: ps_tail) (M.mk ⟨x_a, x_f⟩)
⊢ iselect (⟨a, i⟩ :: ps_tail) (M.mk ⟨x_a, x_f⟩) = default.head

tactic: simp only [iselect, isubtree] at ps_ih ⊢
state_before: case cons.mk.f
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
ps_tail : List F.Idx
ps_ih : ∀ (x : F.M), ¬IsPath ps_tail x → iselect ps_tail x = default.head
a : F.A
i : F.B a
x_a : F.A
x_f : F.B x_a → F.M
h : ¬IsPath (⟨a, i⟩ :: ps_tail) (M.mk ⟨x_a, x_f⟩)
⊢ iselect (⟨a, i⟩ :: ps_tail) (M.mk ⟨x_a, x_f⟩) = default.head
state_after: case cons.mk.f
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
ps_tail : List F.Idx
ps_ih : ∀ (x : F.M), ¬IsPath ps_tail x → (isubtree ps_tail x).head = default.head
a : F.A
i : F.B a
x_a : F.A
x_f : F.B x_a → F.M
h : ¬IsPath (⟨a, i⟩ :: ps_tail) (M.mk ⟨x_a, x_f⟩)
⊢ ((M.mk ⟨x_a, x_f⟩).casesOn' fun a' f => if h : a = a' then isubtree ps_tail (f (cast ⋯ i)) else default).head =
    default.head

tactic: by_cases h'' : a = x_a
state_before: case cons.mk.f
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
ps_tail : List F.Idx
ps_ih : ∀ (x : F.M), ¬IsPath ps_tail x → (isubtree ps_tail x).head = default.head
a : F.A
i : F.B a
x_a : F.A
x_f : F.B x_a → F.M
h : ¬IsPath (⟨a, i⟩ :: ps_tail) (M.mk ⟨x_a, x_f⟩)
⊢ ((M.mk ⟨x_a, x_f⟩).casesOn' fun a' f => if h : a = a' then isubtree ps_tail (f (cast ⋯ i)) else default).head =
    default.head
state_after: case pos
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
ps_tail : List F.Idx
ps_ih : ∀ (x : F.M), ¬IsPath ps_tail x → (isubtree ps_tail x).head = default.head
a : F.A
i : F.B a
x_a : F.A
x_f : F.B x_a → F.M
h : ¬IsPath (⟨a, i⟩ :: ps_tail) (M.mk ⟨x_a, x_f⟩)
h'' : a = x_a
⊢ ((M.mk ⟨x_a, x_f⟩).casesOn' fun a' f => if h : a = a' then isubtree ps_tail (f (cast ⋯ i)) else default).head =
    default.head

case neg
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
ps_tail : List F.Idx
ps_ih : ∀ (x : F.M), ¬IsPath ps_tail x → (isubtree ps_tail x).head = default.head
a : F.A
i : F.B a
x_a : F.A
x_f : F.B x_a → F.M
h : ¬IsPath (⟨a, i⟩ :: ps_tail) (M.mk ⟨x_a, x_f⟩)
h'' : ¬a = x_a
⊢ ((M.mk ⟨x_a, x_f⟩).casesOn' fun a' f => if h : a = a' then isubtree ps_tail (f (cast ⋯ i)) else default).head =
    default.head

tactic: subst x_a
state_before: case pos
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
ps_tail : List F.Idx
ps_ih : ∀ (x : F.M), ¬IsPath ps_tail x → (isubtree ps_tail x).head = default.head
a : F.A
i : F.B a
x_a : F.A
x_f : F.B x_a → F.M
h : ¬IsPath (⟨a, i⟩ :: ps_tail) (M.mk ⟨x_a, x_f⟩)
h'' : a = x_a
⊢ ((M.mk ⟨x_a, x_f⟩).casesOn' fun a' f => if h : a = a' then isubtree ps_tail (f (cast ⋯ i)) else default).head =
    default.head
state_after: case pos
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
ps_tail : List F.Idx
ps_ih : ∀ (x : F.M), ¬IsPath ps_tail x → (isubtree ps_tail x).head = default.head
a : F.A
i : F.B a
x_f : F.B a → F.M
h : ¬IsPath (⟨a, i⟩ :: ps_tail) (M.mk ⟨a, x_f⟩)
⊢ ((M.mk ⟨a, x_f⟩).casesOn' fun a' f => if h : a = a' then isubtree ps_tail (f (cast ⋯ i)) else default).head =
    default.head

tactic: simp only [dif_pos, eq_self_iff_true, casesOn_mk']
state_before: case pos
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
ps_tail : List F.Idx
ps_ih : ∀ (x : F.M), ¬IsPath ps_tail x → (isubtree ps_tail x).head = default.head
a : F.A
i : F.B a
x_f : F.B a → F.M
h : ¬IsPath (⟨a, i⟩ :: ps_tail) (M.mk ⟨a, x_f⟩)
⊢ ((M.mk ⟨a, x_f⟩).casesOn' fun a' f => if h : a = a' then isubtree ps_tail (f (cast ⋯ i)) else default).head =
    default.head
state_after: case pos
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
ps_tail : List F.Idx
ps_ih : ∀ (x : F.M), ¬IsPath ps_tail x → (isubtree ps_tail x).head = default.head
a : F.A
i : F.B a
x_f : F.B a → F.M
h : ¬IsPath (⟨a, i⟩ :: ps_tail) (M.mk ⟨a, x_f⟩)
⊢ (isubtree ps_tail (x_f (cast ⋯ i))).head = default.head

tactic: rw [ps_ih]
state_before: case pos
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
ps_tail : List F.Idx
ps_ih : ∀ (x : F.M), ¬IsPath ps_tail x → (isubtree ps_tail x).head = default.head
a : F.A
i : F.B a
x_f : F.B a → F.M
h : ¬IsPath (⟨a, i⟩ :: ps_tail) (M.mk ⟨a, x_f⟩)
⊢ (isubtree ps_tail (x_f (cast ⋯ i))).head = default.head
state_after: case pos.h
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
ps_tail : List F.Idx
ps_ih : ∀ (x : F.M), ¬IsPath ps_tail x → (isubtree ps_tail x).head = default.head
a : F.A
i : F.B a
x_f : F.B a → F.M
h : ¬IsPath (⟨a, i⟩ :: ps_tail) (M.mk ⟨a, x_f⟩)
⊢ ¬IsPath ps_tail (x_f (cast ⋯ i))

tactic: intro h'
state_before: case pos.h
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
ps_tail : List F.Idx
ps_ih : ∀ (x : F.M), ¬IsPath ps_tail x → (isubtree ps_tail x).head = default.head
a : F.A
i : F.B a
x_f : F.B a → F.M
h : ¬IsPath (⟨a, i⟩ :: ps_tail) (M.mk ⟨a, x_f⟩)
⊢ ¬IsPath ps_tail (x_f (cast ⋯ i))
state_after: case pos.h
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
ps_tail : List F.Idx
ps_ih : ∀ (x : F.M), ¬IsPath ps_tail x → (isubtree ps_tail x).head = default.head
a : F.A
i : F.B a
x_f : F.B a → F.M
h : ¬IsPath (⟨a, i⟩ :: ps_tail) (M.mk ⟨a, x_f⟩)
h' : IsPath ps_tail (x_f (cast ⋯ i))
⊢ False

tactic: apply h
state_before: case pos.h
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
ps_tail : List F.Idx
ps_ih : ∀ (x : F.M), ¬IsPath ps_tail x → (isubtree ps_tail x).head = default.head
a : F.A
i : F.B a
x_f : F.B a → F.M
h : ¬IsPath (⟨a, i⟩ :: ps_tail) (M.mk ⟨a, x_f⟩)
h' : IsPath ps_tail (x_f (cast ⋯ i))
⊢ False
state_after: case pos.h
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
ps_tail : List F.Idx
ps_ih : ∀ (x : F.M), ¬IsPath ps_tail x → (isubtree ps_tail x).head = default.head
a : F.A
i : F.B a
x_f : F.B a → F.M
h : ¬IsPath (⟨a, i⟩ :: ps_tail) (M.mk ⟨a, x_f⟩)
h' : IsPath ps_tail (x_f (cast ⋯ i))
⊢ IsPath (⟨a, i⟩ :: ps_tail) (M.mk ⟨a, x_f⟩)

tactic: constructor <;> try rfl
state_before: case pos.h
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
ps_tail : List F.Idx
ps_ih : ∀ (x : F.M), ¬IsPath ps_tail x → (isubtree ps_tail x).head = default.head
a : F.A
i : F.B a
x_f : F.B a → F.M
h : ¬IsPath (⟨a, i⟩ :: ps_tail) (M.mk ⟨a, x_f⟩)
h' : IsPath ps_tail (x_f (cast ⋯ i))
⊢ IsPath (⟨a, i⟩ :: ps_tail) (M.mk ⟨a, x_f⟩)
state_after: case pos.h.a
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
ps_tail : List F.Idx
ps_ih : ∀ (x : F.M), ¬IsPath ps_tail x → (isubtree ps_tail x).head = default.head
a : F.A
i : F.B a
x_f : F.B a → F.M
h : ¬IsPath (⟨a, i⟩ :: ps_tail) (M.mk ⟨a, x_f⟩)
h' : IsPath ps_tail (x_f (cast ⋯ i))
⊢ IsPath ps_tail (x_f i)

tactic: apply h'
state_before: case pos.h.a
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
ps_tail : List F.Idx
ps_ih : ∀ (x : F.M), ¬IsPath ps_tail x → (isubtree ps_tail x).head = default.head
a : F.A
i : F.B a
x_f : F.B a → F.M
h : ¬IsPath (⟨a, i⟩ :: ps_tail) (M.mk ⟨a, x_f⟩)
h' : IsPath ps_tail (x_f (cast ⋯ i))
⊢ IsPath ps_tail (x_f i)
state_after: no goals

tactic: rfl
state_before: case pos.h.a
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
ps_tail : List F.Idx
ps_ih : ∀ (x : F.M), ¬IsPath ps_tail x → (isubtree ps_tail x).head = default.head
a : F.A
i : F.B a
x_f : F.B a → F.M
h : ¬IsPath (⟨a, i⟩ :: ps_tail) (M.mk ⟨a, x_f⟩)
h' : IsPath ps_tail (x_f (cast ⋯ i))
⊢ M.mk ⟨a, x_f⟩ = M.mk ⟨a, ?pos.h.f✝⟩
state_after: no goals

tactic: simp [*]
state_before: case neg
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited F.M
ps_tail : List F.Idx
ps_ih : ∀ (x : F.M), ¬IsPath ps_tail x → (isubtree ps_tail x).head = default.head
a : F.A
i : F.B a
x_a : F.A
x_f : F.B x_a → F.M
h : ¬IsPath (⟨a, i⟩ :: ps_tail) (M.mk ⟨x_a, x_f⟩)
h'' : ¬a = x_a
⊢ ((M.mk ⟨x_a, x_f⟩).casesOn' fun a' f => if h : a = a' then isubtree ps_tail (f (cast ⋯ i)) else default).head =
    default.head
state_after: no goals