l3lab/ntp-mathlib huggingface dataset:
theorem wPathCasesOn_eta {α : TypeVec n} {a : P.A} {f : P.last.B a → P.last.W}
    (h : P.WPath ⟨a, f⟩ ⟹ α) : P.wPathCasesOn (P.wPathDestLeft h) (P.wPathDestRight h) = h := by
  

Proof state:
n : ℕ
P : MvPFunctor.{u} (n + 1)
α : TypeVec.{u_1} n
a : P.A
f : PFunctor.B (last P) a → PFunctor.W (last P)
h : WPath P (WType.mk a f) ⟹ α
⊢ wPathCasesOn P (wPathDestLeft P h) (wPathDestRight P h) = h

Next tactic:
ext i x
theorem wPathCasesOn_eta {α : TypeVec n} {a : P.A} {f : P.last.B a → P.last.W}
    (h : P.WPath ⟨a, f⟩ ⟹ α) : P.wPathCasesOn (P.wPathDestLeft h) (P.wPathDestRight h) = h := by
  ext i x; 

Proof state:
case a.h
n : ℕ
P : MvPFunctor.{u} (n + 1)
α : TypeVec.{u_1} n
a : P.A
f : PFunctor.B (last P) a → PFunctor.W (last P)
h : WPath P (WType.mk a f) ⟹ α
i : Fin2 n
x : WPath P (WType.mk a fun j => f j) i
⊢ wPathCasesOn P (wPathDestLeft P h) (wPathDestRight P h) i x = h i x

Next tactic:
cases x
theorem wPathCasesOn_eta {α : TypeVec n} {a : P.A} {f : P.last.B a → P.last.W}
    (h : P.WPath ⟨a, f⟩ ⟹ α) : P.wPathCasesOn (P.wPathDestLeft h) (P.wPathDestRight h) = h := by
  ext i x; cases x <;> 

Proof state:
case a.h.root
n : ℕ
P : MvPFunctor.{u} (n + 1)
α : TypeVec.{u_1} n
a : P.A
f : PFunctor.B (last P) a → PFunctor.W (last P)
h : WPath P (WType.mk a f) ⟹ α
i : Fin2 n
c✝ : B (drop P) a i
⊢ wPathCasesOn P (wPathDestLeft P h) (wPathDestRight P h) i (WPath.root a (fun j => f j) i c✝) =
    h i (WPath.root a (fun j => f j) i c✝)

Next tactic:
rfl
theorem wPathCasesOn_eta {α : TypeVec n} {a : P.A} {f : P.last.B a → P.last.W}
    (h : P.WPath ⟨a, f⟩ ⟹ α) : P.wPathCasesOn (P.wPathDestLeft h) (P.wPathDestRight h) = h := by
  ext i x; cases x <;> 

Proof state:
case a.h.child
n : ℕ
P : MvPFunctor.{u} (n + 1)
α : TypeVec.{u_1} n
a : P.A
f : PFunctor.B (last P) a → PFunctor.W (last P)
h : WPath P (WType.mk a f) ⟹ α
i : Fin2 n
j✝ : PFunctor.B (last P) a
c✝ : WPath P ((fun j => f j) j✝) i
⊢ wPathCasesOn P (wPathDestLeft P h) (wPathDestRight P h) i (WPath.child a (fun j => f j) i j✝ c✝) =
    h i (WPath.child a (fun j => f j) i j✝ c✝)

Next tactic:
rfl
theorem comp_wPathCasesOn {α β : TypeVec n} (h : α ⟹ β) {a : P.A} {f : P.last.B a → P.last.W}
    (g' : P.drop.B a ⟹ α) (g : ∀ j : P.last.B a, P.WPath (f j) ⟹ α) :
    h ⊚ P.wPathCasesOn g' g = P.wPathCasesOn (h ⊚ g') fun i => h ⊚ g i := by
  

Proof state:
n : ℕ
P : MvPFunctor.{u} (n + 1)
α : TypeVec.{u_1} n
β : TypeVec.{u_2} n
h : α ⟹ β
a : P.A
f : PFunctor.B (last P) a → PFunctor.W (last P)
g' : B (drop P) a ⟹ α
g : (j : PFunctor.B (last P) a) → WPath P (f j) ⟹ α
⊢ h ⊚ wPathCasesOn P g' g = wPathCasesOn P (h ⊚ g') fun i => h ⊚ g i

Next tactic:
ext i x
theorem comp_wPathCasesOn {α β : TypeVec n} (h : α ⟹ β) {a : P.A} {f : P.last.B a → P.last.W}
    (g' : P.drop.B a ⟹ α) (g : ∀ j : P.last.B a, P.WPath (f j) ⟹ α) :
    h ⊚ P.wPathCasesOn g' g = P.wPathCasesOn (h ⊚ g') fun i => h ⊚ g i := by
  ext i x; 

Proof state:
case a.h
n : ℕ
P : MvPFunctor.{u} (n + 1)
α : TypeVec.{u_1} n
β : TypeVec.{u_2} n
h : α ⟹ β
a : P.A
f : PFunctor.B (last P) a → PFunctor.W (last P)
g' : B (drop P) a ⟹ α
g : (j : PFunctor.B (last P) a) → WPath P (f j) ⟹ α
i : Fin2 n
x : WPath P (WType.mk a fun j => f j) i
⊢ (h ⊚ wPathCasesOn P g' g) i x = wPathCasesOn P (h ⊚ g') (fun i => h ⊚ g i) i x

Next tactic:
cases x
theorem comp_wPathCasesOn {α β : TypeVec n} (h : α ⟹ β) {a : P.A} {f : P.last.B a → P.last.W}
    (g' : P.drop.B a ⟹ α) (g : ∀ j : P.last.B a, P.WPath (f j) ⟹ α) :
    h ⊚ P.wPathCasesOn g' g = P.wPathCasesOn (h ⊚ g') fun i => h ⊚ g i := by
  ext i x; cases x <;> 

Proof state:
case a.h.root
n : ℕ
P : MvPFunctor.{u} (n + 1)
α : TypeVec.{u_1} n
β : TypeVec.{u_2} n
h : α ⟹ β
a : P.A
f : PFunctor.B (last P) a → PFunctor.W (last P)
g' : B (drop P) a ⟹ α
g : (j : PFunctor.B (last P) a) → WPath P (f j) ⟹ α
i : Fin2 n
c✝ : B (drop P) a i
⊢ (h ⊚ wPathCasesOn P g' g) i (WPath.root a (fun j => f j) i c✝) =
    wPathCasesOn P (h ⊚ g') (fun i => h ⊚ g i) i (WPath.root a (fun j => f j) i c✝)

Next tactic:
rfl
theorem comp_wPathCasesOn {α β : TypeVec n} (h : α ⟹ β) {a : P.A} {f : P.last.B a → P.last.W}
    (g' : P.drop.B a ⟹ α) (g : ∀ j : P.last.B a, P.WPath (f j) ⟹ α) :
    h ⊚ P.wPathCasesOn g' g = P.wPathCasesOn (h ⊚ g') fun i => h ⊚ g i := by
  ext i x; cases x <;> 

Proof state:
case a.h.child
n : ℕ
P : MvPFunctor.{u} (n + 1)
α : TypeVec.{u_1} n
β : TypeVec.{u_2} n
h : α ⟹ β
a : P.A
f : PFunctor.B (last P) a → PFunctor.W (last P)
g' : B (drop P) a ⟹ α
g : (j : PFunctor.B (last P) a) → WPath P (f j) ⟹ α
i : Fin2 n
j✝ : PFunctor.B (last P) a
c✝ : WPath P ((fun j => f j) j✝) i
⊢ (h ⊚ wPathCasesOn P g' g) i (WPath.child a (fun j => f j) i j✝ c✝) =
    wPathCasesOn P (h ⊚ g') (fun i => h ⊚ g i) i (WPath.child a (fun j => f j) i j✝ c✝)

Next tactic:
rfl
instance mvfunctorW : MvFunctor P.W := by 

Proof state:
n : ℕ
P : MvPFunctor.{u} (n + 1)
⊢ MvFunctor (W P)

Next tactic:
delta MvPFunctor.W
instance mvfunctorW : MvFunctor P.W := by delta MvPFunctor.W; 

Proof state:
n : ℕ
P : MvPFunctor.{u} (n + 1)
⊢ MvFunctor fun α => ↑(wp P) α

Next tactic:
infer_instance
/-- Defining equation for the recursor of `W` -/
theorem wRec_eq {α : TypeVec n} {C : Type*}
    (g : ∀ a : P.A, P.drop.B a ⟹ α → (P.last.B a → P.W α) → (P.last.B a → C) → C) (a : P.A)
    (f' : P.drop.B a ⟹ α) (f : P.last.B a → P.W α) :
    P.wRec g (P.wMk a f' f) = g a f' f fun i => P.wRec g (f i) := by
  

Proof state:
n : ℕ
P : MvPFunctor.{u} (n + 1)
α : TypeVec.{u} n
C : Type u_1
g : (a : P.A) → B (drop P) a ⟹ α → (PFunctor.B (last P) a → W P α) → (PFunctor.B (last P) a → C) → C
a : P.A
f' : B (drop P) a ⟹ α
f : PFunctor.B (last P) a → W P α
⊢ wRec P g (wMk P a f' f) = g a f' f fun i => wRec P g (f i)

Next tactic:
rw [wMk, wRec]
/-- Defining equation for the recursor of `W` -/
theorem wRec_eq {α : TypeVec n} {C : Type*}
    (g : ∀ a : P.A, P.drop.B a ⟹ α → (P.last.B a → P.W α) → (P.last.B a → C) → C) (a : P.A)
    (f' : P.drop.B a ⟹ α) (f : P.last.B a → P.W α) :
    P.wRec g (P.wMk a f' f) = g a f' f fun i => P.wRec g (f i) := by
  rw [wMk, wRec]; 

Proof state:
n : ℕ
P : MvPFunctor.{u} (n + 1)
α : TypeVec.{u} n
C : Type u_1
g : (a : P.A) → B (drop P) a ⟹ α → (PFunctor.B (last P) a → W P α) → (PFunctor.B (last P) a → C) → C
a : P.A
f' : B (drop P) a ⟹ α
f : PFunctor.B (last P) a → W P α
⊢ (match
      let g := fun i => (f i).fst;
      let g' := wPathCasesOn P f' fun i => (f i).snd;
      { fst := WType.mk a g, snd := g' } with
    | { fst := a, snd := f' } =>
      let g' := fun a f h h' => g a (wPathDestLeft P h) (fun i => { fst := f i, snd := wPathDestRight P h i }) h';
      wpRec P g' a f') =
    g a f' f fun i => wRec P g (f i)

Next tactic:
dsimp
/-- Defining equation for the recursor of `W` -/
theorem wRec_eq {α : TypeVec n} {C : Type*}
    (g : ∀ a : P.A, P.drop.B a ⟹ α → (P.last.B a → P.W α) → (P.last.B a → C) → C) (a : P.A)
    (f' : P.drop.B a ⟹ α) (f : P.last.B a → P.W α) :
    P.wRec g (P.wMk a f' f) = g a f' f fun i => P.wRec g (f i) := by
  rw [wMk, wRec]; dsimp; 

Proof state:
n : ℕ
P : MvPFunctor.{u} (n + 1)
α : TypeVec.{u} n
C : Type u_1
g : (a : P.A) → B (drop P) a ⟹ α → (PFunctor.B (last P) a → W P α) → (PFunctor.B (last P) a → C) → C
a : P.A
f' : B (drop P) a ⟹ α
f : PFunctor.B (last P) a → W P α
⊢ wpRec P (fun a f h h' => g a (wPathDestLeft P h) (fun i => { fst := f i, snd := wPathDestRight P h i }) h')
      (WType.mk a fun i => (f i).fst) (wPathCasesOn P f' fun i => (f i).snd) =
    g a f' f fun i => wRec P g (f i)

Next tactic:
rw [wpRec_eq]
/-- Defining equation for the recursor of `W` -/
theorem wRec_eq {α : TypeVec n} {C : Type*}
    (g : ∀ a : P.A, P.drop.B a ⟹ α → (P.last.B a → P.W α) → (P.last.B a → C) → C) (a : P.A)
    (f' : P.drop.B a ⟹ α) (f : P.last.B a → P.W α) :
    P.wRec g (P.wMk a f' f) = g a f' f fun i => P.wRec g (f i) := by
  rw [wMk, wRec]; dsimp; rw [wpRec_eq]
  

Proof state:
n : ℕ
P : MvPFunctor.{u} (n + 1)
α : TypeVec.{u} n
C : Type u_1
g : (a : P.A) → B (drop P) a ⟹ α → (PFunctor.B (last P) a → W P α) → (PFunctor.B (last P) a → C) → C
a : P.A
f' : B (drop P) a ⟹ α
f : PFunctor.B (last P) a → W P α
⊢ (g a (wPathDestLeft P (wPathCasesOn P f' fun i => (f i).snd))
      (fun i => { fst := (f i).fst, snd := wPathDestRight P (wPathCasesOn P f' fun i => (f i).snd) i }) fun i =>
      wpRec P (fun a f h h' => g a (wPathDestLeft P h) (fun i => { fst := f i, snd := wPathDestRight P h i }) h')
        (f i).fst (wPathDestRight P (wPathCasesOn P f' fun i => (f i).snd) i)) =
    g a f' f fun i => wRec P g (f i)

Next tactic:
dsimp only [wPathDestLeft_wPathCasesOn, wPathDestRight_wPathCasesOn]
/-- Defining equation for the recursor of `W` -/
theorem wRec_eq {α : TypeVec n} {C : Type*}
    (g : ∀ a : P.A, P.drop.B a ⟹ α → (P.last.B a → P.W α) → (P.last.B a → C) → C) (a : P.A)
    (f' : P.drop.B a ⟹ α) (f : P.last.B a → P.W α) :
    P.wRec g (P.wMk a f' f) = g a f' f fun i => P.wRec g (f i) := by
  rw [wMk, wRec]; dsimp; rw [wpRec_eq]
  dsimp only [wPathDestLeft_wPathCasesOn, wPathDestRight_wPathCasesOn]
  

Proof state:
n : ℕ
P : MvPFunctor.{u} (n + 1)
α : TypeVec.{u} n
C : Type u_1
g : (a : P.A) → B (drop P) a ⟹ α → (PFunctor.B (last P) a → W P α) → (PFunctor.B (last P) a → C) → C
a : P.A
f' : B (drop P) a ⟹ α
f : PFunctor.B (last P) a → W P α
⊢ (g a f' (fun i => { fst := (f i).fst, snd := (f i).snd }) fun i =>
      wpRec P (fun a f h h' => g a (wPathDestLeft P h) (fun i => { fst := f i, snd := wPathDestRight P h i }) h')
        (f i).fst (f i).snd) =
    g a f' f fun i => wRec P g (f i)

Next tactic:
congr
/-- Induction principle for `W` -/
theorem w_ind {α : TypeVec n} {C : P.W α → Prop}
    (ih : ∀ (a : P.A) (f' : P.drop.B a ⟹ α) (f : P.last.B a → P.W α),
        (∀ i, C (f i)) → C (P.wMk a f' f)) :
    ∀ x, C x := by
  

Proof state:
n : ℕ
P : MvPFunctor.{u} (n + 1)
α : TypeVec.{u} n
C : W P α → Prop
ih :
  ∀ (a : P.A) (f' : B (drop P) a ⟹ α) (f : PFunctor.B (last P) a → W P α),
    (∀ (i : PFunctor.B (last P) a), C (f i)) → C (wMk P a f' f)
⊢ ∀ (x : W P α), C x

Next tactic:
intro x
/-- Induction principle for `W` -/
theorem w_ind {α : TypeVec n} {C : P.W α → Prop}
    (ih : ∀ (a : P.A) (f' : P.drop.B a ⟹ α) (f : P.last.B a → P.W α),
        (∀ i, C (f i)) → C (P.wMk a f' f)) :
    ∀ x, C x := by
  intro x; 

Proof state:
n : ℕ
P : MvPFunctor.{u} (n + 1)
α : TypeVec.{u} n
C : W P α → Prop
ih :
  ∀ (a : P.A) (f' : B (drop P) a ⟹ α) (f : PFunctor.B (last P) a → W P α),
    (∀ (i : PFunctor.B (last P) a), C (f i)) → C (wMk P a f' f)
x : W P α
⊢ C x

Next tactic:
cases' x with a f
/-- Induction principle for `W` -/
theorem w_ind {α : TypeVec n} {C : P.W α → Prop}
    (ih : ∀ (a : P.A) (f' : P.drop.B a ⟹ α) (f : P.last.B a → P.W α),
        (∀ i, C (f i)) → C (P.wMk a f' f)) :
    ∀ x, C x := by
  intro x; cases' x with a f
  

Proof state:
case mk
n : ℕ
P : MvPFunctor.{u} (n + 1)
α : TypeVec.{u} n
C : W P α → Prop
ih :
  ∀ (a : P.A) (f' : B (drop P) a ⟹ α) (f : PFunctor.B (last P) a → W P α),
    (∀ (i : PFunctor.B (last P) a), C (f i)) → C (wMk P a f' f)
a : (wp P).A
f : B (wp P) a ⟹ α
⊢ C { fst := a, snd := f }

Next tactic:
apply @wp_ind n P α fun a f => C ⟨a, f⟩
/-- Induction principle for `W` -/
theorem w_ind {α : TypeVec n} {C : P.W α → Prop}
    (ih : ∀ (a : P.A) (f' : P.drop.B a ⟹ α) (f : P.last.B a → P.W α),
        (∀ i, C (f i)) → C (P.wMk a f' f)) :
    ∀ x, C x := by
  intro x; cases' x with a f
  apply @wp_ind n P α fun a f => C ⟨a, f⟩
  

Proof state:
case mk.ih
n : ℕ
P : MvPFunctor.{u} (n + 1)
α : TypeVec.{u} n
C : W P α → Prop
ih :
  ∀ (a : P.A) (f' : B (drop P) a ⟹ α) (f : PFunctor.B (last P) a → W P α),
    (∀ (i : PFunctor.B (last P) a), C (f i)) → C (wMk P a f' f)
a : (wp P).A
f : B (wp P) a ⟹ α
⊢ ∀ (a : P.A) (f : PFunctor.B (last P) a → PFunctor.W (last P)) (f' : WPath P (WType.mk a f) ⟹ α),
    (∀ (i : PFunctor.B (last P) a), C { fst := f i, snd := wPathDestRight P f' i }) →
      C { fst := WType.mk a f, snd := f' }

Next tactic:
intro a f f' ih'
/-- Induction principle for `W` -/
theorem w_ind {α : TypeVec n} {C : P.W α → Prop}
    (ih : ∀ (a : P.A) (f' : P.drop.B a ⟹ α) (f : P.last.B a → P.W α),
        (∀ i, C (f i)) → C (P.wMk a f' f)) :
    ∀ x, C x := by
  intro x; cases' x with a f
  apply @wp_ind n P α fun a f => C ⟨a, f⟩
  intro a f f' ih'
  

Proof state:
case mk.ih
n : ℕ
P : MvPFunctor.{u} (n + 1)
α : TypeVec.{u} n
C : W P α → Prop
ih :
  ∀ (a : P.A) (f' : B (drop P) a ⟹ α) (f : PFunctor.B (last P) a → W P α),
    (∀ (i : PFunctor.B (last P) a), C (f i)) → C (wMk P a f' f)
a✝ : (wp P).A
f✝ : B (wp P) a✝ ⟹ α
a : P.A
f : PFunctor.B (last P) a → PFunctor.W (last P)
f' : WPath P (WType.mk a f) ⟹ α
ih' : ∀ (i : PFunctor.B (last P) a), C { fst := f i, snd := wPathDestRight P f' i }
⊢ C { fst := WType.mk a f, snd := f' }

Next tactic:
dsimp [wMk] at ih
/-- Induction principle for `W` -/
theorem w_ind {α : TypeVec n} {C : P.W α → Prop}
    (ih : ∀ (a : P.A) (f' : P.drop.B a ⟹ α) (f : P.last.B a → P.W α),
        (∀ i, C (f i)) → C (P.wMk a f' f)) :
    ∀ x, C x := by
  intro x; cases' x with a f
  apply @wp_ind n P α fun a f => C ⟨a, f⟩
  intro a f f' ih'
  dsimp [wMk] at ih
  

Proof state:
case mk.ih
n : ℕ
P : MvPFunctor.{u} (n + 1)
α : TypeVec.{u} n
C : W P α → Prop
ih :
  ∀ (a : P.A) (f' : B (drop P) a ⟹ α) (f : PFunctor.B (last P) a → W P α),
    (∀ (i : PFunctor.B (last P) a), C (f i)) →
      C { fst := WType.mk a fun i => (f i).fst, snd := wPathCasesOn P f' fun i => (f i).snd }
a✝ : (wp P).A
f✝ : B (wp P) a✝ ⟹ α
a : P.A
f : PFunctor.B (last P) a → PFunctor.W (last P)
f' : WPath P (WType.mk a f) ⟹ α
ih' : ∀ (i : PFunctor.B (last P) a), C { fst := f i, snd := wPathDestRight P f' i }
⊢ C { fst := WType.mk a f, snd := f' }

Next tactic:
let ih'' := ih a (P.wPathDestLeft f') fun i => ⟨f i, P.wPathDestRight f' i⟩
/-- Induction principle for `W` -/
theorem w_ind {α : TypeVec n} {C : P.W α → Prop}
    (ih : ∀ (a : P.A) (f' : P.drop.B a ⟹ α) (f : P.last.B a → P.W α),
        (∀ i, C (f i)) → C (P.wMk a f' f)) :
    ∀ x, C x := by
  intro x; cases' x with a f
  apply @wp_ind n P α fun a f => C ⟨a, f⟩
  intro a f f' ih'
  dsimp [wMk] at ih
  let ih'' := ih a (P.wPathDestLeft f') fun i => ⟨f i, P.wPathDestRight f' i⟩
  

Proof state:
case mk.ih
n : ℕ
P : MvPFunctor.{u} (n + 1)
α : TypeVec.{u} n
C : W P α → Prop
ih :
  ∀ (a : P.A) (f' : B (drop P) a ⟹ α) (f : PFunctor.B (last P) a → W P α),
    (∀ (i : PFunctor.B (last P) a), C (f i)) →
      C { fst := WType.mk a fun i => (f i).fst, snd := wPathCasesOn P f' fun i => (f i).snd }
a✝ : (wp P).A
f✝ : B (wp P) a✝ ⟹ α
a : P.A
f : PFunctor.B (last P) a → PFunctor.W (last P)
f' : WPath P (WType.mk a f) ⟹ α
ih' : ∀ (i : PFunctor.B (last P) a), C { fst := f i, snd := wPathDestRight P f' i }
ih'' : (∀ (i : PFunctor.B (last P) a), C { fst := f i, snd := wPathDestRight P f' i }) →
  C
    { fst := WType.mk a fun i => { fst := f i, snd := wPathDestRight P f' i }.fst,
      snd := wPathCasesOn P (wPathDestLeft P f') fun i => { fst := f i, snd := wPathDestRight P f' i }.snd } :=
  ih a (wPathDestLeft P f') fun i => { fst := f i, snd := wPathDestRight P f' i }
⊢ C { fst := WType.mk a f, snd := f' }

Next tactic:
dsimp at ih''
/-- Induction principle for `W` -/
theorem w_ind {α : TypeVec n} {C : P.W α → Prop}
    (ih : ∀ (a : P.A) (f' : P.drop.B a ⟹ α) (f : P.last.B a → P.W α),
        (∀ i, C (f i)) → C (P.wMk a f' f)) :
    ∀ x, C x := by
  intro x; cases' x with a f
  apply @wp_ind n P α fun a f => C ⟨a, f⟩
  intro a f f' ih'
  dsimp [wMk] at ih
  let ih'' := ih a (P.wPathDestLeft f') fun i => ⟨f i, P.wPathDestRight f' i⟩
  dsimp at ih''; 

Proof state:
case mk.ih
n : ℕ
P : MvPFunctor.{u} (n + 1)
α : TypeVec.{u} n
C : W P α → Prop
ih :
  ∀ (a : P.A) (f' : B (drop P) a ⟹ α) (f : PFunctor.B (last P) a → W P α),
    (∀ (i : PFunctor.B (last P) a), C (f i)) →
      C { fst := WType.mk a fun i => (f i).fst, snd := wPathCasesOn P f' fun i => (f i).snd }
a✝ : (wp P).A
f✝ : B (wp P) a✝ ⟹ α
a : P.A
f : PFunctor.B (last P) a → PFunctor.W (last P)
f' : WPath P (WType.mk a f) ⟹ α
ih' : ∀ (i : PFunctor.B (last P) a), C { fst := f i, snd := wPathDestRight P f' i }
ih'' : (∀ (i : PFunctor.B (last P) a), C { fst := f i, snd := wPathDestRight P f' i }) →
  C { fst := WType.mk a fun i => f i, snd := wPathCasesOn P (wPathDestLeft P f') fun i => wPathDestRight P f' i } :=
  ih a (wPathDestLeft P f') fun i => { fst := f i, snd := wPathDestRight P f' i }
⊢ C { fst := WType.mk a f, snd := f' }

Next tactic:
rw [wPathCasesOn_eta] at ih''
/-- Induction principle for `W` -/
theorem w_ind {α : TypeVec n} {C : P.W α → Prop}
    (ih : ∀ (a : P.A) (f' : P.drop.B a ⟹ α) (f : P.last.B a → P.W α),
        (∀ i, C (f i)) → C (P.wMk a f' f)) :
    ∀ x, C x := by
  intro x; cases' x with a f
  apply @wp_ind n P α fun a f => C ⟨a, f⟩
  intro a f f' ih'
  dsimp [wMk] at ih
  let ih'' := ih a (P.wPathDestLeft f') fun i => ⟨f i, P.wPathDestRight f' i⟩
  dsimp at ih''; rw [wPathCasesOn_eta] at ih''
  

Proof state:
case mk.ih
n : ℕ
P : MvPFunctor.{u} (n + 1)
α : TypeVec.{u} n
C : W P α → Prop
ih :
  ∀ (a : P.A) (f' : B (drop P) a ⟹ α) (f : PFunctor.B (last P) a → W P α),
    (∀ (i : PFunctor.B (last P) a), C (f i)) →
      C { fst := WType.mk a fun i => (f i).fst, snd := wPathCasesOn P f' fun i => (f i).snd }
a✝ : (wp P).A
f✝ : B (wp P) a✝ ⟹ α
a : P.A
f : PFunctor.B (last P) a → PFunctor.W (last P)
f' : WPath P (WType.mk a f) ⟹ α
ih' : ∀ (i : PFunctor.B (last P) a), C { fst := f i, snd := wPathDestRight P f' i }
ih'' :
  (∀ (i : PFunctor.B (last P) a), C { fst := f i, snd := wPathDestRight P f' i }) →
    C { fst := WType.mk a fun i => f i, snd := f' }
⊢ C { fst := WType.mk a f, snd := f' }

Next tactic:
apply ih''
/-- Induction principle for `W` -/
theorem w_ind {α : TypeVec n} {C : P.W α → Prop}
    (ih : ∀ (a : P.A) (f' : P.drop.B a ⟹ α) (f : P.last.B a → P.W α),
        (∀ i, C (f i)) → C (P.wMk a f' f)) :
    ∀ x, C x := by
  intro x; cases' x with a f
  apply @wp_ind n P α fun a f => C ⟨a, f⟩
  intro a f f' ih'
  dsimp [wMk] at ih
  let ih'' := ih a (P.wPathDestLeft f') fun i => ⟨f i, P.wPathDestRight f' i⟩
  dsimp at ih''; rw [wPathCasesOn_eta] at ih''
  apply ih''
  

Proof state:
case mk.ih
n : ℕ
P : MvPFunctor.{u} (n + 1)
α : TypeVec.{u} n
C : W P α → Prop
ih :
  ∀ (a : P.A) (f' : B (drop P) a ⟹ α) (f : PFunctor.B (last P) a → W P α),
    (∀ (i : PFunctor.B (last P) a), C (f i)) →
      C { fst := WType.mk a fun i => (f i).fst, snd := wPathCasesOn P f' fun i => (f i).snd }
a✝ : (wp P).A
f✝ : B (wp P) a✝ ⟹ α
a : P.A
f : PFunctor.B (last P) a → PFunctor.W (last P)
f' : WPath P (WType.mk a f) ⟹ α
ih' : ∀ (i : PFunctor.B (last P) a), C { fst := f i, snd := wPathDestRight P f' i }
ih'' :
  (∀ (i : PFunctor.B (last P) a), C { fst := f i, snd := wPathDestRight P f' i }) →
    C { fst := WType.mk a fun i => f i, snd := f' }
⊢ ∀ (i : PFunctor.B (last P) a), C { fst := f i, snd := wPathDestRight P f' i }

Next tactic:
apply ih'
theorem w_map_wMk {α β : TypeVec n} (g : α ⟹ β) (a : P.A) (f' : P.drop.B a ⟹ α)
    (f : P.last.B a → P.W α) : g <$$> P.wMk a f' f = P.wMk a (g ⊚ f') fun i => g <$$> f i := by
  

Proof state:
n : ℕ
P : MvPFunctor.{u} (n + 1)
α β : TypeVec.{u} n
g : α ⟹ β
a : P.A
f' : B (drop P) a ⟹ α
f : PFunctor.B (last P) a → W P α
⊢ g <$$> wMk P a f' f = wMk P a (g ⊚ f') fun i => g <$$> f i

Next tactic:
show _ = P.wMk a (g ⊚ f') (MvFunctor.map g ∘ f)
theorem w_map_wMk {α β : TypeVec n} (g : α ⟹ β) (a : P.A) (f' : P.drop.B a ⟹ α)
    (f : P.last.B a → P.W α) : g <$$> P.wMk a f' f = P.wMk a (g ⊚ f') fun i => g <$$> f i := by
  show _ = P.wMk a (g ⊚ f') (MvFunctor.map g ∘ f)
  

Proof state:
n : ℕ
P : MvPFunctor.{u} (n + 1)
α β : TypeVec.{u} n
g : α ⟹ β
a : P.A
f' : B (drop P) a ⟹ α
f : PFunctor.B (last P) a → W P α
⊢ g <$$> wMk P a f' f = wMk P a (g ⊚ f') (MvFunctor.map g ∘ f)

Next tactic:
have : MvFunctor.map g ∘ f = fun i => ⟨(f i).fst, g ⊚ (f i).snd⟩ := by
    ext i : 1
    dsimp [Function.comp_def]
    cases f i
    rfl
theorem w_map_wMk {α β : TypeVec n} (g : α ⟹ β) (a : P.A) (f' : P.drop.B a ⟹ α)
    (f : P.last.B a → P.W α) : g <$$> P.wMk a f' f = P.wMk a (g ⊚ f') fun i => g <$$> f i := by
  show _ = P.wMk a (g ⊚ f') (MvFunctor.map g ∘ f)
  have : MvFunctor.map g ∘ f = fun i => ⟨(f i).fst, g ⊚ (f i).snd⟩ := by
    

Proof state:
n : ℕ
P : MvPFunctor.{u} (n + 1)
α β : TypeVec.{u} n
g : α ⟹ β
a : P.A
f' : B (drop P) a ⟹ α
f : PFunctor.B (last P) a → W P α
⊢ MvFunctor.map g ∘ f = fun i => { fst := (f i).fst, snd := g ⊚ (f i).snd }

Next tactic:
ext i : 1
theorem w_map_wMk {α β : TypeVec n} (g : α ⟹ β) (a : P.A) (f' : P.drop.B a ⟹ α)
    (f : P.last.B a → P.W α) : g <$$> P.wMk a f' f = P.wMk a (g ⊚ f') fun i => g <$$> f i := by
  show _ = P.wMk a (g ⊚ f') (MvFunctor.map g ∘ f)
  have : MvFunctor.map g ∘ f = fun i => ⟨(f i).fst, g ⊚ (f i).snd⟩ := by
    ext i : 1
    

Proof state:
case h
n : ℕ
P : MvPFunctor.{u} (n + 1)
α β : TypeVec.{u} n
g : α ⟹ β
a : P.A
f' : B (drop P) a ⟹ α
f : PFunctor.B (last P) a → W P α
i : PFunctor.B (last P) a
⊢ (MvFunctor.map g ∘ f) i = { fst := (f i).fst, snd := g ⊚ (f i).snd }

Next tactic:
dsimp [Function.comp_def]
theorem w_map_wMk {α β : TypeVec n} (g : α ⟹ β) (a : P.A) (f' : P.drop.B a ⟹ α)
    (f : P.last.B a → P.W α) : g <$$> P.wMk a f' f = P.wMk a (g ⊚ f') fun i => g <$$> f i := by
  show _ = P.wMk a (g ⊚ f') (MvFunctor.map g ∘ f)
  have : MvFunctor.map g ∘ f = fun i => ⟨(f i).fst, g ⊚ (f i).snd⟩ := by
    ext i : 1
    dsimp [Function.comp_def]
    

Proof state:
case h
n : ℕ
P : MvPFunctor.{u} (n + 1)
α β : TypeVec.{u} n
g : α ⟹ β
a : P.A
f' : B (drop P) a ⟹ α
f : PFunctor.B (last P) a → W P α
i : PFunctor.B (last P) a
⊢ g <$$> f i = { fst := (f i).fst, snd := g ⊚ (f i).snd }

Next tactic:
cases f i
theorem w_map_wMk {α β : TypeVec n} (g : α ⟹ β) (a : P.A) (f' : P.drop.B a ⟹ α)
    (f : P.last.B a → P.W α) : g <$$> P.wMk a f' f = P.wMk a (g ⊚ f') fun i => g <$$> f i := by
  show _ = P.wMk a (g ⊚ f') (MvFunctor.map g ∘ f)
  have : MvFunctor.map g ∘ f = fun i => ⟨(f i).fst, g ⊚ (f i).snd⟩ := by
    ext i : 1
    dsimp [Function.comp_def]
    cases f i
    

Proof state:
case h.mk
n : ℕ
P : MvPFunctor.{u} (n + 1)
α β : TypeVec.{u} n
g : α ⟹ β
a : P.A
f' : B (drop P) a ⟹ α
f : PFunctor.B (last P) a → W P α
i : PFunctor.B (last P) a
fst✝ : (wp P).A
snd✝ : B (wp P) fst✝ ⟹ α
⊢ g <$$> { fst := fst✝, snd := snd✝ } =
    { fst := { fst := fst✝, snd := snd✝ }.fst, snd := g ⊚ { fst := fst✝, snd := snd✝ }.snd }

Next tactic:
rfl
theorem w_map_wMk {α β : TypeVec n} (g : α ⟹ β) (a : P.A) (f' : P.drop.B a ⟹ α)
    (f : P.last.B a → P.W α) : g <$$> P.wMk a f' f = P.wMk a (g ⊚ f') fun i => g <$$> f i := by
  show _ = P.wMk a (g ⊚ f') (MvFunctor.map g ∘ f)
  have : MvFunctor.map g ∘ f = fun i => ⟨(f i).fst, g ⊚ (f i).snd⟩ := by
    ext i : 1
    dsimp [Function.comp_def]
    cases f i
    rfl
  

Proof state:
n : ℕ
P : MvPFunctor.{u} (n + 1)
α β : TypeVec.{u} n
g : α ⟹ β
a : P.A
f' : B (drop P) a ⟹ α
f : PFunctor.B (last P) a → W P α
this : MvFunctor.map g ∘ f = fun i => { fst := (f i).fst, snd := g ⊚ (f i).snd }
⊢ g <$$> wMk P a f' f = wMk P a (g ⊚ f') (MvFunctor.map g ∘ f)

Next tactic:
rw [this]
theorem w_map_wMk {α β : TypeVec n} (g : α ⟹ β) (a : P.A) (f' : P.drop.B a ⟹ α)
    (f : P.last.B a → P.W α) : g <$$> P.wMk a f' f = P.wMk a (g ⊚ f') fun i => g <$$> f i := by
  show _ = P.wMk a (g ⊚ f') (MvFunctor.map g ∘ f)
  have : MvFunctor.map g ∘ f = fun i => ⟨(f i).fst, g ⊚ (f i).snd⟩ := by
    ext i : 1
    dsimp [Function.comp_def]
    cases f i
    rfl
  rw [this]
  

Proof state:
n : ℕ
P : MvPFunctor.{u} (n + 1)
α β : TypeVec.{u} n
g : α ⟹ β
a : P.A
f' : B (drop P) a ⟹ α
f : PFunctor.B (last P) a → W P α
this : MvFunctor.map g ∘ f = fun i => { fst := (f i).fst, snd := g ⊚ (f i).snd }
⊢ g <$$> wMk P a f' f = wMk P a (g ⊚ f') fun i => { fst := (f i).fst, snd := g ⊚ (f i).snd }

Next tactic:
have : f = fun i => ⟨(f i).fst, (f i).snd⟩ := by
    ext1 x
    cases f x
    rfl