l3lab/ntp-mathlib huggingface dataset:
theorem Fix.mk_dest (x : Fix F α) : Fix.mk (Fix.dest x) = x := by
  change (Fix.mk ∘ Fix.dest) x = x
  apply Fix.ind_rec
  intro x; 

Proof state:
case h
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
x✝ : Fix F α
x : F (α ::: Fix F α)
⊢ (TypeVec.id ::: mk ∘ dest) <$$> x = (TypeVec.id ::: fun x => x) <$$> x → (mk ∘ dest) (mk x) = mk x

Next tactic:
dsimp
theorem Fix.mk_dest (x : Fix F α) : Fix.mk (Fix.dest x) = x := by
  change (Fix.mk ∘ Fix.dest) x = x
  apply Fix.ind_rec
  intro x; dsimp
  

Proof state:
case h
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
x✝ : Fix F α
x : F (α ::: Fix F α)
⊢ (TypeVec.id ::: mk ∘ dest) <$$> x = (TypeVec.id ::: fun x => x) <$$> x → mk (dest (mk x)) = mk x

Next tactic:
rw [Fix.dest, Fix.rec_eq, ← comp_map, ← appendFun_comp, id_comp]
theorem Fix.mk_dest (x : Fix F α) : Fix.mk (Fix.dest x) = x := by
  change (Fix.mk ∘ Fix.dest) x = x
  apply Fix.ind_rec
  intro x; dsimp
  rw [Fix.dest, Fix.rec_eq, ← comp_map, ← appendFun_comp, id_comp]
  

Proof state:
case h
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
x✝ : Fix F α
x : F (α ::: Fix F α)
⊢ (TypeVec.id ::: mk ∘ rec (MvFunctor.map (TypeVec.id ::: mk))) <$$> x = (TypeVec.id ::: fun x => x) <$$> x →
    mk ((TypeVec.id ::: mk ∘ rec (MvFunctor.map (TypeVec.id ::: mk))) <$$> x) = mk x

Next tactic:
intro h
theorem Fix.mk_dest (x : Fix F α) : Fix.mk (Fix.dest x) = x := by
  change (Fix.mk ∘ Fix.dest) x = x
  apply Fix.ind_rec
  intro x; dsimp
  rw [Fix.dest, Fix.rec_eq, ← comp_map, ← appendFun_comp, id_comp]
  intro h; 

Proof state:
case h
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
x✝ : Fix F α
x : F (α ::: Fix F α)
h : (TypeVec.id ::: mk ∘ rec (MvFunctor.map (TypeVec.id ::: mk))) <$$> x = (TypeVec.id ::: fun x => x) <$$> x
⊢ mk ((TypeVec.id ::: mk ∘ rec (MvFunctor.map (TypeVec.id ::: mk))) <$$> x) = mk x

Next tactic:
rw [h]
theorem Fix.mk_dest (x : Fix F α) : Fix.mk (Fix.dest x) = x := by
  change (Fix.mk ∘ Fix.dest) x = x
  apply Fix.ind_rec
  intro x; dsimp
  rw [Fix.dest, Fix.rec_eq, ← comp_map, ← appendFun_comp, id_comp]
  intro h; rw [h]
  

Proof state:
case h
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
x✝ : Fix F α
x : F (α ::: Fix F α)
h : (TypeVec.id ::: mk ∘ rec (MvFunctor.map (TypeVec.id ::: mk))) <$$> x = (TypeVec.id ::: fun x => x) <$$> x
⊢ mk ((TypeVec.id ::: fun x => x) <$$> x) = mk x

Next tactic:
show Fix.mk (appendFun id id <$$> x) = Fix.mk x
theorem Fix.mk_dest (x : Fix F α) : Fix.mk (Fix.dest x) = x := by
  change (Fix.mk ∘ Fix.dest) x = x
  apply Fix.ind_rec
  intro x; dsimp
  rw [Fix.dest, Fix.rec_eq, ← comp_map, ← appendFun_comp, id_comp]
  intro h; rw [h]
  show Fix.mk (appendFun id id <$$> x) = Fix.mk x
  

Proof state:
case h
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
x✝ : Fix F α
x : F (α ::: Fix F α)
h : (TypeVec.id ::: mk ∘ rec (MvFunctor.map (TypeVec.id ::: mk))) <$$> x = (TypeVec.id ::: fun x => x) <$$> x
⊢ mk ((TypeVec.id ::: _root_.id) <$$> x) = mk x

Next tactic:
rw [appendFun_id_id, MvFunctor.id_map]
theorem Fix.dest_mk (x : F (append1 α (Fix F α))) : Fix.dest (Fix.mk x) = x := by
  

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
x : F (α ::: Fix F α)
⊢ dest (mk x) = x

Next tactic:
unfold Fix.dest
theorem Fix.dest_mk (x : F (append1 α (Fix F α))) : Fix.dest (Fix.mk x) = x := by
  unfold Fix.dest
  

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
x : F (α ::: Fix F α)
⊢ rec (MvFunctor.map (TypeVec.id ::: mk)) (mk x) = x

Next tactic:
rw [Fix.rec_eq, ← Fix.dest, ← comp_map]
theorem Fix.dest_mk (x : F (append1 α (Fix F α))) : Fix.dest (Fix.mk x) = x := by
  unfold Fix.dest
  rw [Fix.rec_eq, ← Fix.dest, ← comp_map]
  

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
x : F (α ::: Fix F α)
⊢ ((TypeVec.id ::: mk) ⊚ (TypeVec.id ::: dest)) <$$> x = x

Next tactic:
conv =>
    rhs
    rw [← MvFunctor.id_map x]
theorem Fix.dest_mk (x : F (append1 α (Fix F α))) : Fix.dest (Fix.mk x) = x := by
  unfold Fix.dest
  rw [Fix.rec_eq, ← Fix.dest, ← comp_map]
  conv =>
    

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
x : F (α ::: Fix F α)
| ((TypeVec.id ::: mk) ⊚ (TypeVec.id ::: dest)) <$$> x = x

Next tactic:
rhs
    rw [← MvFunctor.id_map x]
theorem Fix.dest_mk (x : F (append1 α (Fix F α))) : Fix.dest (Fix.mk x) = x := by
  unfold Fix.dest
  rw [Fix.rec_eq, ← Fix.dest, ← comp_map]
  conv =>
    

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
x : F (α ::: Fix F α)
| ((TypeVec.id ::: mk) ⊚ (TypeVec.id ::: dest)) <$$> x = x

Next tactic:
rhs
theorem Fix.dest_mk (x : F (append1 α (Fix F α))) : Fix.dest (Fix.mk x) = x := by
  unfold Fix.dest
  rw [Fix.rec_eq, ← Fix.dest, ← comp_map]
  conv =>
    rhs
    

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
x : F (α ::: Fix F α)
| x

Next tactic:
rw [← MvFunctor.id_map x]
theorem Fix.dest_mk (x : F (append1 α (Fix F α))) : Fix.dest (Fix.mk x) = x := by
  unfold Fix.dest
  rw [Fix.rec_eq, ← Fix.dest, ← comp_map]
  conv =>
    rhs
    rw [← MvFunctor.id_map x]
  

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
x : F (α ::: Fix F α)
⊢ ((TypeVec.id ::: mk) ⊚ (TypeVec.id ::: dest)) <$$> x = TypeVec.id <$$> x

Next tactic:
rw [← appendFun_comp, id_comp]
theorem Fix.dest_mk (x : F (append1 α (Fix F α))) : Fix.dest (Fix.mk x) = x := by
  unfold Fix.dest
  rw [Fix.rec_eq, ← Fix.dest, ← comp_map]
  conv =>
    rhs
    rw [← MvFunctor.id_map x]
  rw [← appendFun_comp, id_comp]
  

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
x : F (α ::: Fix F α)
⊢ (TypeVec.id ::: mk ∘ dest) <$$> x = TypeVec.id <$$> x

Next tactic:
have : Fix.mk ∘ Fix.dest = _root_.id := by
    ext (x : Fix F α)
    apply Fix.mk_dest
theorem Fix.dest_mk (x : F (append1 α (Fix F α))) : Fix.dest (Fix.mk x) = x := by
  unfold Fix.dest
  rw [Fix.rec_eq, ← Fix.dest, ← comp_map]
  conv =>
    rhs
    rw [← MvFunctor.id_map x]
  rw [← appendFun_comp, id_comp]
  have : Fix.mk ∘ Fix.dest = _root_.id := by
    

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
x : F (α ::: Fix F α)
⊢ mk ∘ dest = _root_.id

Next tactic:
ext (x : Fix F α)
theorem Fix.dest_mk (x : F (append1 α (Fix F α))) : Fix.dest (Fix.mk x) = x := by
  unfold Fix.dest
  rw [Fix.rec_eq, ← Fix.dest, ← comp_map]
  conv =>
    rhs
    rw [← MvFunctor.id_map x]
  rw [← appendFun_comp, id_comp]
  have : Fix.mk ∘ Fix.dest = _root_.id := by
    ext (x : Fix F α)
    

Proof state:
case h
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
x✝ : F (α ::: Fix F α)
x : Fix F α
⊢ (mk ∘ dest) x = _root_.id x

Next tactic:
apply Fix.mk_dest
theorem Fix.dest_mk (x : F (append1 α (Fix F α))) : Fix.dest (Fix.mk x) = x := by
  unfold Fix.dest
  rw [Fix.rec_eq, ← Fix.dest, ← comp_map]
  conv =>
    rhs
    rw [← MvFunctor.id_map x]
  rw [← appendFun_comp, id_comp]
  have : Fix.mk ∘ Fix.dest = _root_.id := by
    ext (x : Fix F α)
    apply Fix.mk_dest
  

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
x : F (α ::: Fix F α)
this : mk ∘ dest = _root_.id
⊢ (TypeVec.id ::: mk ∘ dest) <$$> x = TypeVec.id <$$> x

Next tactic:
rw [this, appendFun_id_id]
theorem Fix.ind {α : TypeVec n} (p : Fix F α → Prop)
    (h : ∀ x : F (α.append1 (Fix F α)), LiftP (PredLast α p) x → p (Fix.mk x)) : ∀ x, p x := by
  

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α✝ α : TypeVec.{u} n
p : Fix F α → Prop
h : ∀ (x : F (α ::: Fix F α)), LiftP (PredLast α p) x → p (mk x)
⊢ ∀ (x : Fix F α), p x

Next tactic:
apply Quot.ind
theorem Fix.ind {α : TypeVec n} (p : Fix F α → Prop)
    (h : ∀ x : F (α.append1 (Fix F α)), LiftP (PredLast α p) x → p (Fix.mk x)) : ∀ x, p x := by
  apply Quot.ind
  

Proof state:
case mk
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α✝ α : TypeVec.{u} n
p : Fix F α → Prop
h : ∀ (x : F (α ::: Fix F α)), LiftP (PredLast α p) x → p (mk x)
⊢ ∀ (a : MvPFunctor.W (P F) α), p (Quot.mk Setoid.r a)

Next tactic:
intro x
theorem Fix.ind {α : TypeVec n} (p : Fix F α → Prop)
    (h : ∀ x : F (α.append1 (Fix F α)), LiftP (PredLast α p) x → p (Fix.mk x)) : ∀ x, p x := by
  apply Quot.ind
  intro x
  

Proof state:
case mk
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α✝ α : TypeVec.{u} n
p : Fix F α → Prop
h : ∀ (x : F (α ::: Fix F α)), LiftP (PredLast α p) x → p (mk x)
x : MvPFunctor.W (P F) α
⊢ p (Quot.mk Setoid.r x)

Next tactic:
apply q.P.w_ind _ x
theorem Fix.ind {α : TypeVec n} (p : Fix F α → Prop)
    (h : ∀ x : F (α.append1 (Fix F α)), LiftP (PredLast α p) x → p (Fix.mk x)) : ∀ x, p x := by
  apply Quot.ind
  intro x
  apply q.P.w_ind _ x; 

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α✝ α : TypeVec.{u} n
p : Fix F α → Prop
h : ∀ (x : F (α ::: Fix F α)), LiftP (PredLast α p) x → p (mk x)
x : MvPFunctor.W (P F) α
⊢ ∀ (a : (P F).A) (f' : MvPFunctor.B (MvPFunctor.drop (P F)) a ⟹ α)
    (f : PFunctor.B (MvPFunctor.last (P F)) a → MvPFunctor.W (P F) α),
    (∀ (i : PFunctor.B (MvPFunctor.last (P F)) a), p (Quot.mk Setoid.r (f i))) →
      p (Quot.mk Setoid.r (MvPFunctor.wMk (P F) a f' f))

Next tactic:
intro a f' f ih
theorem Fix.ind {α : TypeVec n} (p : Fix F α → Prop)
    (h : ∀ x : F (α.append1 (Fix F α)), LiftP (PredLast α p) x → p (Fix.mk x)) : ∀ x, p x := by
  apply Quot.ind
  intro x
  apply q.P.w_ind _ x; intro a f' f ih
  

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α✝ α : TypeVec.{u} n
p : Fix F α → Prop
h : ∀ (x : F (α ::: Fix F α)), LiftP (PredLast α p) x → p (mk x)
x : MvPFunctor.W (P F) α
a : (P F).A
f' : MvPFunctor.B (MvPFunctor.drop (P F)) a ⟹ α
f : PFunctor.B (MvPFunctor.last (P F)) a → MvPFunctor.W (P F) α
ih : ∀ (i : PFunctor.B (MvPFunctor.last (P F)) a), p (Quot.mk Setoid.r (f i))
⊢ p (Quot.mk Setoid.r (MvPFunctor.wMk (P F) a f' f))

Next tactic:
change p ⟦q.P.wMk a f' f⟧
theorem Fix.ind {α : TypeVec n} (p : Fix F α → Prop)
    (h : ∀ x : F (α.append1 (Fix F α)), LiftP (PredLast α p) x → p (Fix.mk x)) : ∀ x, p x := by
  apply Quot.ind
  intro x
  apply q.P.w_ind _ x; intro a f' f ih
  change p ⟦q.P.wMk a f' f⟧
  

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α✝ α : TypeVec.{u} n
p : Fix F α → Prop
h : ∀ (x : F (α ::: Fix F α)), LiftP (PredLast α p) x → p (mk x)
x : MvPFunctor.W (P F) α
a : (P F).A
f' : MvPFunctor.B (MvPFunctor.drop (P F)) a ⟹ α
f : PFunctor.B (MvPFunctor.last (P F)) a → MvPFunctor.W (P F) α
ih : ∀ (i : PFunctor.B (MvPFunctor.last (P F)) a), p (Quot.mk Setoid.r (f i))
⊢ p ⟦MvPFunctor.wMk (P F) a f' f⟧

Next tactic:
rw [← Fix.ind_aux a f' f]
theorem Fix.ind {α : TypeVec n} (p : Fix F α → Prop)
    (h : ∀ x : F (α.append1 (Fix F α)), LiftP (PredLast α p) x → p (Fix.mk x)) : ∀ x, p x := by
  apply Quot.ind
  intro x
  apply q.P.w_ind _ x; intro a f' f ih
  change p ⟦q.P.wMk a f' f⟧
  rw [← Fix.ind_aux a f' f]
  

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α✝ α : TypeVec.{u} n
p : Fix F α → Prop
h : ∀ (x : F (α ::: Fix F α)), LiftP (PredLast α p) x → p (mk x)
x : MvPFunctor.W (P F) α
a : (P F).A
f' : MvPFunctor.B (MvPFunctor.drop (P F)) a ⟹ α
f : PFunctor.B (MvPFunctor.last (P F)) a → MvPFunctor.W (P F) α
ih : ∀ (i : PFunctor.B (MvPFunctor.last (P F)) a), p (Quot.mk Setoid.r (f i))
⊢ p (mk (abs { fst := a, snd := MvPFunctor.appendContents (P F) f' fun x => ⟦f x⟧ }))

Next tactic:
apply h
theorem Fix.ind {α : TypeVec n} (p : Fix F α → Prop)
    (h : ∀ x : F (α.append1 (Fix F α)), LiftP (PredLast α p) x → p (Fix.mk x)) : ∀ x, p x := by
  apply Quot.ind
  intro x
  apply q.P.w_ind _ x; intro a f' f ih
  change p ⟦q.P.wMk a f' f⟧
  rw [← Fix.ind_aux a f' f]
  apply h
  

Proof state:
case a
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α✝ α : TypeVec.{u} n
p : Fix F α → Prop
h : ∀ (x : F (α ::: Fix F α)), LiftP (PredLast α p) x → p (mk x)
x : MvPFunctor.W (P F) α
a : (P F).A
f' : MvPFunctor.B (MvPFunctor.drop (P F)) a ⟹ α
f : PFunctor.B (MvPFunctor.last (P F)) a → MvPFunctor.W (P F) α
ih : ∀ (i : PFunctor.B (MvPFunctor.last (P F)) a), p (Quot.mk Setoid.r (f i))
⊢ LiftP (PredLast α p) (abs { fst := a, snd := MvPFunctor.appendContents (P F) f' fun x => ⟦f x⟧ })

Next tactic:
rw [MvQPF.liftP_iff]
theorem Fix.ind {α : TypeVec n} (p : Fix F α → Prop)
    (h : ∀ x : F (α.append1 (Fix F α)), LiftP (PredLast α p) x → p (Fix.mk x)) : ∀ x, p x := by
  apply Quot.ind
  intro x
  apply q.P.w_ind _ x; intro a f' f ih
  change p ⟦q.P.wMk a f' f⟧
  rw [← Fix.ind_aux a f' f]
  apply h
  rw [MvQPF.liftP_iff]
  

Proof state:
case a
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α✝ α : TypeVec.{u} n
p : Fix F α → Prop
h : ∀ (x : F (α ::: Fix F α)), LiftP (PredLast α p) x → p (mk x)
x : MvPFunctor.W (P F) α
a : (P F).A
f' : MvPFunctor.B (MvPFunctor.drop (P F)) a ⟹ α
f : PFunctor.B (MvPFunctor.last (P F)) a → MvPFunctor.W (P F) α
ih : ∀ (i : PFunctor.B (MvPFunctor.last (P F)) a), p (Quot.mk Setoid.r (f i))
⊢ ∃ a_1 f_1,
    abs { fst := a, snd := MvPFunctor.appendContents (P F) f' fun x => ⟦f x⟧ } = abs { fst := a_1, snd := f_1 } ∧
      ∀ (i : Fin2 (n + 1)) (j : MvPFunctor.B (P F) a_1 i), PredLast α p (f_1 i j)

Next tactic:
refine' ⟨_, _, rfl, _⟩
theorem Fix.ind {α : TypeVec n} (p : Fix F α → Prop)
    (h : ∀ x : F (α.append1 (Fix F α)), LiftP (PredLast α p) x → p (Fix.mk x)) : ∀ x, p x := by
  apply Quot.ind
  intro x
  apply q.P.w_ind _ x; intro a f' f ih
  change p ⟦q.P.wMk a f' f⟧
  rw [← Fix.ind_aux a f' f]
  apply h
  rw [MvQPF.liftP_iff]
  refine' ⟨_, _, rfl, _⟩
  

Proof state:
case a
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α✝ α : TypeVec.{u} n
p : Fix F α → Prop
h : ∀ (x : F (α ::: Fix F α)), LiftP (PredLast α p) x → p (mk x)
x : MvPFunctor.W (P F) α
a : (P F).A
f' : MvPFunctor.B (MvPFunctor.drop (P F)) a ⟹ α
f : PFunctor.B (MvPFunctor.last (P F)) a → MvPFunctor.W (P F) α
ih : ∀ (i : PFunctor.B (MvPFunctor.last (P F)) a), p (Quot.mk Setoid.r (f i))
⊢ ∀ (i : Fin2 (n + 1)) (j : MvPFunctor.B (P F) a i),
    PredLast α p (MvPFunctor.appendContents (P F) f' (fun x => ⟦f x⟧) i j)

Next tactic:
intro i j
theorem Fix.ind {α : TypeVec n} (p : Fix F α → Prop)
    (h : ∀ x : F (α.append1 (Fix F α)), LiftP (PredLast α p) x → p (Fix.mk x)) : ∀ x, p x := by
  apply Quot.ind
  intro x
  apply q.P.w_ind _ x; intro a f' f ih
  change p ⟦q.P.wMk a f' f⟧
  rw [← Fix.ind_aux a f' f]
  apply h
  rw [MvQPF.liftP_iff]
  refine' ⟨_, _, rfl, _⟩
  intro i j
  

Proof state:
case a
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α✝ α : TypeVec.{u} n
p : Fix F α → Prop
h : ∀ (x : F (α ::: Fix F α)), LiftP (PredLast α p) x → p (mk x)
x : MvPFunctor.W (P F) α
a : (P F).A
f' : MvPFunctor.B (MvPFunctor.drop (P F)) a ⟹ α
f : PFunctor.B (MvPFunctor.last (P F)) a → MvPFunctor.W (P F) α
ih : ∀ (i : PFunctor.B (MvPFunctor.last (P F)) a), p (Quot.mk Setoid.r (f i))
i : Fin2 (n + 1)
j : MvPFunctor.B (P F) a i
⊢ PredLast α p (MvPFunctor.appendContents (P F) f' (fun x => ⟦f x⟧) i j)

Next tactic:
cases i
theorem Fix.ind {α : TypeVec n} (p : Fix F α → Prop)
    (h : ∀ x : F (α.append1 (Fix F α)), LiftP (PredLast α p) x → p (Fix.mk x)) : ∀ x, p x := by
  apply Quot.ind
  intro x
  apply q.P.w_ind _ x; intro a f' f ih
  change p ⟦q.P.wMk a f' f⟧
  rw [← Fix.ind_aux a f' f]
  apply h
  rw [MvQPF.liftP_iff]
  refine' ⟨_, _, rfl, _⟩
  intro i j
  cases i
  · 

Proof state:
case a.fz
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α✝ α : TypeVec.{u} n
p : Fix F α → Prop
h : ∀ (x : F (α ::: Fix F α)), LiftP (PredLast α p) x → p (mk x)
x : MvPFunctor.W (P F) α
a : (P F).A
f' : MvPFunctor.B (MvPFunctor.drop (P F)) a ⟹ α
f : PFunctor.B (MvPFunctor.last (P F)) a → MvPFunctor.W (P F) α
ih : ∀ (i : PFunctor.B (MvPFunctor.last (P F)) a), p (Quot.mk Setoid.r (f i))
j : MvPFunctor.B (P F) a Fin2.fz
⊢ PredLast α p (MvPFunctor.appendContents (P F) f' (fun x => ⟦f x⟧) Fin2.fz j)

Next tactic:
apply ih
theorem Fix.ind {α : TypeVec n} (p : Fix F α → Prop)
    (h : ∀ x : F (α.append1 (Fix F α)), LiftP (PredLast α p) x → p (Fix.mk x)) : ∀ x, p x := by
  apply Quot.ind
  intro x
  apply q.P.w_ind _ x; intro a f' f ih
  change p ⟦q.P.wMk a f' f⟧
  rw [← Fix.ind_aux a f' f]
  apply h
  rw [MvQPF.liftP_iff]
  refine' ⟨_, _, rfl, _⟩
  intro i j
  cases i
  · apply ih
  · 

Proof state:
case a.fs
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α✝ α : TypeVec.{u} n
p : Fix F α → Prop
h : ∀ (x : F (α ::: Fix F α)), LiftP (PredLast α p) x → p (mk x)
x : MvPFunctor.W (P F) α
a : (P F).A
f' : MvPFunctor.B (MvPFunctor.drop (P F)) a ⟹ α
f : PFunctor.B (MvPFunctor.last (P F)) a → MvPFunctor.W (P F) α
ih : ∀ (i : PFunctor.B (MvPFunctor.last (P F)) a), p (Quot.mk Setoid.r (f i))
a✝ : Fin2 (Nat.add n 0)
j : MvPFunctor.B (P F) a (Fin2.fs a✝)
⊢ PredLast α p (MvPFunctor.appendContents (P F) f' (fun x => ⟦f x⟧) (Fin2.fs a✝) j)

Next tactic:
trivial
instance mvqpfFix : MvQPF (Fix F) where
  P := q.P.wp
  abs α := Quot.mk WEquiv α
  repr α := fixToW α
  abs_repr := by
    

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
⊢ ∀ {α : TypeVec.{u} n} (x : Fix F α), (fun {α} α_1 => Quot.mk WEquiv α_1) ((fun {α} α_1 => fixToW α_1) x) = x

Next tactic:
intro α
instance mvqpfFix : MvQPF (Fix F) where
  P := q.P.wp
  abs α := Quot.mk WEquiv α
  repr α := fixToW α
  abs_repr := by
    intro α
    

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α✝ α : TypeVec.{u} n
⊢ ∀ (x : Fix F α), (fun {α} α_1 => Quot.mk WEquiv α_1) ((fun {α} α_1 => fixToW α_1) x) = x

Next tactic:
apply Quot.ind
instance mvqpfFix : MvQPF (Fix F) where
  P := q.P.wp
  abs α := Quot.mk WEquiv α
  repr α := fixToW α
  abs_repr := by
    intro α
    apply Quot.ind
    

Proof state:
case mk
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α✝ α : TypeVec.{u} n
⊢ ∀ (a : MvPFunctor.W (P F) α),
    (fun {α} α_1 => Quot.mk WEquiv α_1) ((fun {α} α_1 => fixToW α_1) (Quot.mk Setoid.r a)) = Quot.mk Setoid.r a

Next tactic:
intro a
instance mvqpfFix : MvQPF (Fix F) where
  P := q.P.wp
  abs α := Quot.mk WEquiv α
  repr α := fixToW α
  abs_repr := by
    intro α
    apply Quot.ind
    intro a
    

Proof state:
case mk
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α✝ α : TypeVec.{u} n
a : MvPFunctor.W (P F) α
⊢ (fun {α} α_1 => Quot.mk WEquiv α_1) ((fun {α} α_1 => fixToW α_1) (Quot.mk Setoid.r a)) = Quot.mk Setoid.r a

Next tactic:
apply Quot.sound
instance mvqpfFix : MvQPF (Fix F) where
  P := q.P.wp
  abs α := Quot.mk WEquiv α
  repr α := fixToW α
  abs_repr := by
    intro α
    apply Quot.ind
    intro a
    apply Quot.sound
    

Proof state:
case mk.a
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α✝ α : TypeVec.{u} n
a : MvPFunctor.W (P F) α
⊢ WEquiv ((fun {α} α_1 => fixToW α_1) (Quot.mk Setoid.r a)) a

Next tactic:
apply wrepr_equiv
instance mvqpfFix : MvQPF (Fix F) where
  P := q.P.wp
  abs α := Quot.mk WEquiv α
  repr α := fixToW α
  abs_repr := by
    intro α
    apply Quot.ind
    intro a
    apply Quot.sound
    apply wrepr_equiv
  abs_map := by
    

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
⊢ ∀ {α β : TypeVec.{u} n} (f : α ⟹ β) (p : ↑(MvPFunctor.wp (P F)) α),
    (fun {α} α_1 => Quot.mk WEquiv α_1) (f <$$> p) = f <$$> (fun {α} α_1 => Quot.mk WEquiv α_1) p

Next tactic:
intro α β g x
instance mvqpfFix : MvQPF (Fix F) where
  P := q.P.wp
  abs α := Quot.mk WEquiv α
  repr α := fixToW α
  abs_repr := by
    intro α
    apply Quot.ind
    intro a
    apply Quot.sound
    apply wrepr_equiv
  abs_map := by
    intro α β g x;
    

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α✝ α β : TypeVec.{u} n
g : α ⟹ β
x : ↑(MvPFunctor.wp (P F)) α
⊢ (fun {α} α_1 => Quot.mk WEquiv α_1) (g <$$> x) = g <$$> (fun {α} α_1 => Quot.mk WEquiv α_1) x

Next tactic:
conv =>
      rhs
      dsimp [MvFunctor.map]
instance mvqpfFix : MvQPF (Fix F) where
  P := q.P.wp
  abs α := Quot.mk WEquiv α
  repr α := fixToW α
  abs_repr := by
    intro α
    apply Quot.ind
    intro a
    apply Quot.sound
    apply wrepr_equiv
  abs_map := by
    intro α β g x;
    conv =>
      

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α✝ α β : TypeVec.{u} n
g : α ⟹ β
x : ↑(MvPFunctor.wp (P F)) α
| (fun {α} α_1 => Quot.mk WEquiv α_1) (g <$$> x) = g <$$> (fun {α} α_1 => Quot.mk WEquiv α_1) x

Next tactic:
rhs
      dsimp [MvFunctor.map]
instance mvqpfFix : MvQPF (Fix F) where
  P := q.P.wp
  abs α := Quot.mk WEquiv α
  repr α := fixToW α
  abs_repr := by
    intro α
    apply Quot.ind
    intro a
    apply Quot.sound
    apply wrepr_equiv
  abs_map := by
    intro α β g x;
    conv =>
      

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α✝ α β : TypeVec.{u} n
g : α ⟹ β
x : ↑(MvPFunctor.wp (P F)) α
| (fun {α} α_1 => Quot.mk WEquiv α_1) (g <$$> x) = g <$$> (fun {α} α_1 => Quot.mk WEquiv α_1) x

Next tactic:
rhs
instance mvqpfFix : MvQPF (Fix F) where
  P := q.P.wp
  abs α := Quot.mk WEquiv α
  repr α := fixToW α
  abs_repr := by
    intro α
    apply Quot.ind
    intro a
    apply Quot.sound
    apply wrepr_equiv
  abs_map := by
    intro α β g x;
    conv =>
      rhs
      

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α✝ α β : TypeVec.{u} n
g : α ⟹ β
x : ↑(MvPFunctor.wp (P F)) α
| g <$$> (fun {α} α_1 => Quot.mk WEquiv α_1) x

Next tactic:
dsimp [MvFunctor.map]
/-- Dependent recursor for `fix F` -/
def Fix.drec {β : Fix F α → Type u}
    (g : ∀ x : F (α ::: Sigma β), β (Fix.mk <| (id ::: Sigma.fst) <$$> x)) (x : Fix F α) : β x :=
  let y := @Fix.rec _ F _ _ α (Sigma β) (fun i => ⟨_, g i⟩) x
  have : x = y.1 := by
    

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
β : Fix F α → Type u
g : (x : F (α ::: Sigma β)) → β (mk ((TypeVec.id ::: Sigma.fst) <$$> x))
x : Fix F α
y : Sigma β := rec (fun i => { fst := mk ((TypeVec.id ::: Sigma.fst) <$$> i), snd := g i }) x
⊢ x = y.fst

Next tactic:
symm
/-- Dependent recursor for `fix F` -/
def Fix.drec {β : Fix F α → Type u}
    (g : ∀ x : F (α ::: Sigma β), β (Fix.mk <| (id ::: Sigma.fst) <$$> x)) (x : Fix F α) : β x :=
  let y := @Fix.rec _ F _ _ α (Sigma β) (fun i => ⟨_, g i⟩) x
  have : x = y.1 := by
    symm
    

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
β : Fix F α → Type u
g : (x : F (α ::: Sigma β)) → β (mk ((TypeVec.id ::: Sigma.fst) <$$> x))
x : Fix F α
y : Sigma β := rec (fun i => { fst := mk ((TypeVec.id ::: Sigma.fst) <$$> i), snd := g i }) x
⊢ y.fst = x

Next tactic:
dsimp
/-- Dependent recursor for `fix F` -/
def Fix.drec {β : Fix F α → Type u}
    (g : ∀ x : F (α ::: Sigma β), β (Fix.mk <| (id ::: Sigma.fst) <$$> x)) (x : Fix F α) : β x :=
  let y := @Fix.rec _ F _ _ α (Sigma β) (fun i => ⟨_, g i⟩) x
  have : x = y.1 := by
    symm
    dsimp
    

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
β : Fix F α → Type u
g : (x : F (α ::: Sigma β)) → β (mk ((TypeVec.id ::: Sigma.fst) <$$> x))
x : Fix F α
y : Sigma β := rec (fun i => { fst := mk ((TypeVec.id ::: Sigma.fst) <$$> i), snd := g i }) x
⊢ (rec (fun i => { fst := mk ((TypeVec.id ::: Sigma.fst) <$$> i), snd := g i }) x).fst = x

Next tactic:
apply Fix.ind_rec _ id _ x