l3lab/ntp-mathlib huggingface dataset:
theorem liftR_map_last [lawful : LawfulMvFunctor F]
    {α : TypeVec n} {ι ι'} (R : ι' → ι' → Prop)
    (x : F (α ::: ι)) (f g : ι → ι') (hh : ∀ x : ι, R (f x) (g x)) :
    LiftR' (RelLast' _ R) ((id ::: f) <$$> x) ((id ::: g) <$$> x) :=
  let h : ι → { x : ι' × ι' // uncurry R x } := fun x => ⟨(f x, g x), hh x⟩
  let b : (α ::: ι) ⟹ _ := @diagSub n α ::: h
  let c :
    (Subtype_ α.repeatEq ::: { x // uncurry R x }) ⟹
      ((fun i : Fin2 n => { x // ofRepeat (α.RelLast' R i.fs x) }) ::: Subtype (uncurry R)) :=
    ofSubtype _ ::: id
  have hh :
    subtypeVal _ ⊚ toSubtype _ ⊚ fromAppend1DropLast ⊚ c ⊚ b =
      ((id ::: f) ⊗' (id ::: g)) ⊚ prod.diag := by
    dsimp
    apply eq_of_drop_last_eq
    · dsimp
      simp only [prod_map_id, dropFun_prod, dropFun_appendFun, dropFun_diag, id_comp,
        dropFun_toSubtype]
      erw [toSubtype_of_subtype_assoc, id_comp]
      clear liftR_map_last q mvf lawful F x R f g hh h b c
      

Proof state:
case h₀
n : ℕ
α : TypeVec.{u} n
ι ι' : Type u
⊢ (fun i x => subtypeVal (repeatEq α) i (diagSub i x)) = prod.diag

Next tactic:
ext (i x) : 2
theorem liftR_map_last [lawful : LawfulMvFunctor F]
    {α : TypeVec n} {ι ι'} (R : ι' → ι' → Prop)
    (x : F (α ::: ι)) (f g : ι → ι') (hh : ∀ x : ι, R (f x) (g x)) :
    LiftR' (RelLast' _ R) ((id ::: f) <$$> x) ((id ::: g) <$$> x) :=
  let h : ι → { x : ι' × ι' // uncurry R x } := fun x => ⟨(f x, g x), hh x⟩
  let b : (α ::: ι) ⟹ _ := @diagSub n α ::: h
  let c :
    (Subtype_ α.repeatEq ::: { x // uncurry R x }) ⟹
      ((fun i : Fin2 n => { x // ofRepeat (α.RelLast' R i.fs x) }) ::: Subtype (uncurry R)) :=
    ofSubtype _ ::: id
  have hh :
    subtypeVal _ ⊚ toSubtype _ ⊚ fromAppend1DropLast ⊚ c ⊚ b =
      ((id ::: f) ⊗' (id ::: g)) ⊚ prod.diag := by
    dsimp
    apply eq_of_drop_last_eq
    · dsimp
      simp only [prod_map_id, dropFun_prod, dropFun_appendFun, dropFun_diag, id_comp,
        dropFun_toSubtype]
      erw [toSubtype_of_subtype_assoc, id_comp]
      clear liftR_map_last q mvf lawful F x R f g hh h b c
      ext (i x) : 2
      

Proof state:
case h₀.a.h
n : ℕ
α : TypeVec.{u} n
ι ι' : Type u
i : Fin2 n
x : TypeVec.drop (α ::: ι) i
⊢ subtypeVal (repeatEq α) i (diagSub i x) = prod.diag i x

Next tactic:
induction i with
      | fz => rfl
      | fs _ ih =>
        apply ih
theorem liftR_map_last [lawful : LawfulMvFunctor F]
    {α : TypeVec n} {ι ι'} (R : ι' → ι' → Prop)
    (x : F (α ::: ι)) (f g : ι → ι') (hh : ∀ x : ι, R (f x) (g x)) :
    LiftR' (RelLast' _ R) ((id ::: f) <$$> x) ((id ::: g) <$$> x) :=
  let h : ι → { x : ι' × ι' // uncurry R x } := fun x => ⟨(f x, g x), hh x⟩
  let b : (α ::: ι) ⟹ _ := @diagSub n α ::: h
  let c :
    (Subtype_ α.repeatEq ::: { x // uncurry R x }) ⟹
      ((fun i : Fin2 n => { x // ofRepeat (α.RelLast' R i.fs x) }) ::: Subtype (uncurry R)) :=
    ofSubtype _ ::: id
  have hh :
    subtypeVal _ ⊚ toSubtype _ ⊚ fromAppend1DropLast ⊚ c ⊚ b =
      ((id ::: f) ⊗' (id ::: g)) ⊚ prod.diag := by
    dsimp
    apply eq_of_drop_last_eq
    · dsimp
      simp only [prod_map_id, dropFun_prod, dropFun_appendFun, dropFun_diag, id_comp,
        dropFun_toSubtype]
      erw [toSubtype_of_subtype_assoc, id_comp]
      clear liftR_map_last q mvf lawful F x R f g hh h b c
      ext (i x) : 2
      induction i with
      

Proof state:
case h₀.a.h.fz
n : ℕ
ι ι' : Type u
n✝ : ℕ
α : TypeVec.{u} (Nat.succ n✝)
x : TypeVec.drop (α ::: ι) Fin2.fz
⊢ subtypeVal (repeatEq α) Fin2.fz (diagSub Fin2.fz x) = prod.diag Fin2.fz x

Next tactic:
| fz => rfl
theorem liftR_map_last [lawful : LawfulMvFunctor F]
    {α : TypeVec n} {ι ι'} (R : ι' → ι' → Prop)
    (x : F (α ::: ι)) (f g : ι → ι') (hh : ∀ x : ι, R (f x) (g x)) :
    LiftR' (RelLast' _ R) ((id ::: f) <$$> x) ((id ::: g) <$$> x) :=
  let h : ι → { x : ι' × ι' // uncurry R x } := fun x => ⟨(f x, g x), hh x⟩
  let b : (α ::: ι) ⟹ _ := @diagSub n α ::: h
  let c :
    (Subtype_ α.repeatEq ::: { x // uncurry R x }) ⟹
      ((fun i : Fin2 n => { x // ofRepeat (α.RelLast' R i.fs x) }) ::: Subtype (uncurry R)) :=
    ofSubtype _ ::: id
  have hh :
    subtypeVal _ ⊚ toSubtype _ ⊚ fromAppend1DropLast ⊚ c ⊚ b =
      ((id ::: f) ⊗' (id ::: g)) ⊚ prod.diag := by
    dsimp
    apply eq_of_drop_last_eq
    · dsimp
      simp only [prod_map_id, dropFun_prod, dropFun_appendFun, dropFun_diag, id_comp,
        dropFun_toSubtype]
      erw [toSubtype_of_subtype_assoc, id_comp]
      clear liftR_map_last q mvf lawful F x R f g hh h b c
      ext (i x) : 2
      induction i with
      | fz => 

Proof state:
case h₀.a.h.fz
n : ℕ
ι ι' : Type u
n✝ : ℕ
α : TypeVec.{u} (Nat.succ n✝)
x : TypeVec.drop (α ::: ι) Fin2.fz
⊢ subtypeVal (repeatEq α) Fin2.fz (diagSub Fin2.fz x) = prod.diag Fin2.fz x

Next tactic:
rfl
theorem liftR_map_last [lawful : LawfulMvFunctor F]
    {α : TypeVec n} {ι ι'} (R : ι' → ι' → Prop)
    (x : F (α ::: ι)) (f g : ι → ι') (hh : ∀ x : ι, R (f x) (g x)) :
    LiftR' (RelLast' _ R) ((id ::: f) <$$> x) ((id ::: g) <$$> x) :=
  let h : ι → { x : ι' × ι' // uncurry R x } := fun x => ⟨(f x, g x), hh x⟩
  let b : (α ::: ι) ⟹ _ := @diagSub n α ::: h
  let c :
    (Subtype_ α.repeatEq ::: { x // uncurry R x }) ⟹
      ((fun i : Fin2 n => { x // ofRepeat (α.RelLast' R i.fs x) }) ::: Subtype (uncurry R)) :=
    ofSubtype _ ::: id
  have hh :
    subtypeVal _ ⊚ toSubtype _ ⊚ fromAppend1DropLast ⊚ c ⊚ b =
      ((id ::: f) ⊗' (id ::: g)) ⊚ prod.diag := by
    dsimp
    apply eq_of_drop_last_eq
    · dsimp
      simp only [prod_map_id, dropFun_prod, dropFun_appendFun, dropFun_diag, id_comp,
        dropFun_toSubtype]
      erw [toSubtype_of_subtype_assoc, id_comp]
      clear liftR_map_last q mvf lawful F x R f g hh h b c
      ext (i x) : 2
      induction i with
      | fz => rfl
      

Proof state:
case h₀.a.h.fs
n : ℕ
ι ι' : Type u
n✝ : ℕ
a✝ : Fin2 n✝
ih : ∀ {α : TypeVec.{u} n✝} (x : TypeVec.drop (α ::: ι) a✝), subtypeVal (repeatEq α) a✝ (diagSub a✝ x) = prod.diag a✝ x
α : TypeVec.{u} (Nat.succ n✝)
x : TypeVec.drop (α ::: ι) (Fin2.fs a✝)
⊢ subtypeVal (repeatEq α) (Fin2.fs a✝) (diagSub (Fin2.fs a✝) x) = prod.diag (Fin2.fs a✝) x

Next tactic:
| fs _ ih =>
        apply ih
theorem liftR_map_last [lawful : LawfulMvFunctor F]
    {α : TypeVec n} {ι ι'} (R : ι' → ι' → Prop)
    (x : F (α ::: ι)) (f g : ι → ι') (hh : ∀ x : ι, R (f x) (g x)) :
    LiftR' (RelLast' _ R) ((id ::: f) <$$> x) ((id ::: g) <$$> x) :=
  let h : ι → { x : ι' × ι' // uncurry R x } := fun x => ⟨(f x, g x), hh x⟩
  let b : (α ::: ι) ⟹ _ := @diagSub n α ::: h
  let c :
    (Subtype_ α.repeatEq ::: { x // uncurry R x }) ⟹
      ((fun i : Fin2 n => { x // ofRepeat (α.RelLast' R i.fs x) }) ::: Subtype (uncurry R)) :=
    ofSubtype _ ::: id
  have hh :
    subtypeVal _ ⊚ toSubtype _ ⊚ fromAppend1DropLast ⊚ c ⊚ b =
      ((id ::: f) ⊗' (id ::: g)) ⊚ prod.diag := by
    dsimp
    apply eq_of_drop_last_eq
    · dsimp
      simp only [prod_map_id, dropFun_prod, dropFun_appendFun, dropFun_diag, id_comp,
        dropFun_toSubtype]
      erw [toSubtype_of_subtype_assoc, id_comp]
      clear liftR_map_last q mvf lawful F x R f g hh h b c
      ext (i x) : 2
      induction i with
      | fz => rfl
      | fs _ ih =>
        

Proof state:
case h₀.a.h.fs
n : ℕ
ι ι' : Type u
n✝ : ℕ
a✝ : Fin2 n✝
ih : ∀ {α : TypeVec.{u} n✝} (x : TypeVec.drop (α ::: ι) a✝), subtypeVal (repeatEq α) a✝ (diagSub a✝ x) = prod.diag a✝ x
α : TypeVec.{u} (Nat.succ n✝)
x : TypeVec.drop (α ::: ι) (Fin2.fs a✝)
⊢ subtypeVal (repeatEq α) (Fin2.fs a✝) (diagSub (Fin2.fs a✝) x) = prod.diag (Fin2.fs a✝) x

Next tactic:
apply ih
theorem liftR_map_last [lawful : LawfulMvFunctor F]
    {α : TypeVec n} {ι ι'} (R : ι' → ι' → Prop)
    (x : F (α ::: ι)) (f g : ι → ι') (hh : ∀ x : ι, R (f x) (g x)) :
    LiftR' (RelLast' _ R) ((id ::: f) <$$> x) ((id ::: g) <$$> x) :=
  let h : ι → { x : ι' × ι' // uncurry R x } := fun x => ⟨(f x, g x), hh x⟩
  let b : (α ::: ι) ⟹ _ := @diagSub n α ::: h
  let c :
    (Subtype_ α.repeatEq ::: { x // uncurry R x }) ⟹
      ((fun i : Fin2 n => { x // ofRepeat (α.RelLast' R i.fs x) }) ::: Subtype (uncurry R)) :=
    ofSubtype _ ::: id
  have hh :
    subtypeVal _ ⊚ toSubtype _ ⊚ fromAppend1DropLast ⊚ c ⊚ b =
      ((id ::: f) ⊗' (id ::: g)) ⊚ prod.diag := by
    dsimp
    apply eq_of_drop_last_eq
    · dsimp
      simp only [prod_map_id, dropFun_prod, dropFun_appendFun, dropFun_diag, id_comp,
        dropFun_toSubtype]
      erw [toSubtype_of_subtype_assoc, id_comp]
      clear liftR_map_last q mvf lawful F x R f g hh h b c
      ext (i x) : 2
      induction i with
      | fz => rfl
      | fs _ ih =>
        apply ih
    

Proof state:
case h₁
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
lawful : LawfulMvFunctor F
α : TypeVec.{u} n
ι ι' : Type u
R : ι' → ι' → Prop
x : F (α ::: ι)
f g : ι → ι'
hh : ∀ (x : ι), R (f x) (g x)
h : ι → { x // uncurry R x } := fun x => { val := (f x, g x), property := (_ : R (f x) (g x)) }
b : α ::: ι ⟹ Subtype_ (repeatEq α) ::: { x // uncurry R x } := diagSub ::: h
c : Subtype_ (repeatEq α) ::: { x // uncurry R x } ⟹
  (fun i => { x // ofRepeat (RelLast' α R (Fin2.fs i) x) }) ::: Subtype (uncurry R) :=
  ofSubtype (repeatEq α) ::: _root_.id
⊢ lastFun
      (subtypeVal (RelLast' α R) ⊚
        toSubtype (RelLast' α R) ⊚
          fromAppend1DropLast ⊚
            (ofSubtype (repeatEq α) ::: _root_.id) ⊚
              (diagSub ::: fun x => { val := (f x, g x), property := (_ : R (f x) (g x)) })) =
    lastFun (((TypeVec.id ::: f) ⊗' (TypeVec.id ::: g)) ⊚ prod.diag)

Next tactic:
simp only [lastFun_from_append1_drop_last, lastFun_toSubtype, lastFun_appendFun,
      lastFun_subtypeVal, comp.left_id, lastFun_comp, lastFun_prod]
theorem liftR_map_last [lawful : LawfulMvFunctor F]
    {α : TypeVec n} {ι ι'} (R : ι' → ι' → Prop)
    (x : F (α ::: ι)) (f g : ι → ι') (hh : ∀ x : ι, R (f x) (g x)) :
    LiftR' (RelLast' _ R) ((id ::: f) <$$> x) ((id ::: g) <$$> x) :=
  let h : ι → { x : ι' × ι' // uncurry R x } := fun x => ⟨(f x, g x), hh x⟩
  let b : (α ::: ι) ⟹ _ := @diagSub n α ::: h
  let c :
    (Subtype_ α.repeatEq ::: { x // uncurry R x }) ⟹
      ((fun i : Fin2 n => { x // ofRepeat (α.RelLast' R i.fs x) }) ::: Subtype (uncurry R)) :=
    ofSubtype _ ::: id
  have hh :
    subtypeVal _ ⊚ toSubtype _ ⊚ fromAppend1DropLast ⊚ c ⊚ b =
      ((id ::: f) ⊗' (id ::: g)) ⊚ prod.diag := by
    dsimp
    apply eq_of_drop_last_eq
    · dsimp
      simp only [prod_map_id, dropFun_prod, dropFun_appendFun, dropFun_diag, id_comp,
        dropFun_toSubtype]
      erw [toSubtype_of_subtype_assoc, id_comp]
      clear liftR_map_last q mvf lawful F x R f g hh h b c
      ext (i x) : 2
      induction i with
      | fz => rfl
      | fs _ ih =>
        apply ih
    simp only [lastFun_from_append1_drop_last, lastFun_toSubtype, lastFun_appendFun,
      lastFun_subtypeVal, comp.left_id, lastFun_comp, lastFun_prod]
    

Proof state:
case h₁
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
lawful : LawfulMvFunctor F
α : TypeVec.{u} n
ι ι' : Type u
R : ι' → ι' → Prop
x : F (α ::: ι)
f g : ι → ι'
hh : ∀ (x : ι), R (f x) (g x)
h : ι → { x // uncurry R x } := fun x => { val := (f x, g x), property := (_ : R (f x) (g x)) }
b : α ::: ι ⟹ Subtype_ (repeatEq α) ::: { x // uncurry R x } := diagSub ::: h
c : Subtype_ (repeatEq α) ::: { x // uncurry R x } ⟹
  (fun i => { x // ofRepeat (RelLast' α R (Fin2.fs i) x) }) ::: Subtype (uncurry R) :=
  ofSubtype (repeatEq α) ::: _root_.id
⊢ (Subtype.val ∘ fun x => { val := (f x, g x), property := (_ : R (f x) (g x)) }) = Prod.map f g ∘ lastFun prod.diag

Next tactic:
ext1
theorem liftR_map_last [lawful : LawfulMvFunctor F]
    {α : TypeVec n} {ι ι'} (R : ι' → ι' → Prop)
    (x : F (α ::: ι)) (f g : ι → ι') (hh : ∀ x : ι, R (f x) (g x)) :
    LiftR' (RelLast' _ R) ((id ::: f) <$$> x) ((id ::: g) <$$> x) :=
  let h : ι → { x : ι' × ι' // uncurry R x } := fun x => ⟨(f x, g x), hh x⟩
  let b : (α ::: ι) ⟹ _ := @diagSub n α ::: h
  let c :
    (Subtype_ α.repeatEq ::: { x // uncurry R x }) ⟹
      ((fun i : Fin2 n => { x // ofRepeat (α.RelLast' R i.fs x) }) ::: Subtype (uncurry R)) :=
    ofSubtype _ ::: id
  have hh :
    subtypeVal _ ⊚ toSubtype _ ⊚ fromAppend1DropLast ⊚ c ⊚ b =
      ((id ::: f) ⊗' (id ::: g)) ⊚ prod.diag := by
    dsimp
    apply eq_of_drop_last_eq
    · dsimp
      simp only [prod_map_id, dropFun_prod, dropFun_appendFun, dropFun_diag, id_comp,
        dropFun_toSubtype]
      erw [toSubtype_of_subtype_assoc, id_comp]
      clear liftR_map_last q mvf lawful F x R f g hh h b c
      ext (i x) : 2
      induction i with
      | fz => rfl
      | fs _ ih =>
        apply ih
    simp only [lastFun_from_append1_drop_last, lastFun_toSubtype, lastFun_appendFun,
      lastFun_subtypeVal, comp.left_id, lastFun_comp, lastFun_prod]
    ext1
    

Proof state:
case h₁.h
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
lawful : LawfulMvFunctor F
α : TypeVec.{u} n
ι ι' : Type u
R : ι' → ι' → Prop
x : F (α ::: ι)
f g : ι → ι'
hh : ∀ (x : ι), R (f x) (g x)
h : ι → { x // uncurry R x } := fun x => { val := (f x, g x), property := (_ : R (f x) (g x)) }
b : α ::: ι ⟹ Subtype_ (repeatEq α) ::: { x // uncurry R x } := diagSub ::: h
c : Subtype_ (repeatEq α) ::: { x // uncurry R x } ⟹
  (fun i => { x // ofRepeat (RelLast' α R (Fin2.fs i) x) }) ::: Subtype (uncurry R) :=
  ofSubtype (repeatEq α) ::: _root_.id
x✝ : TypeVec.last (α ::: ι)
⊢ (Subtype.val ∘ fun x => { val := (f x, g x), property := (_ : R (f x) (g x)) }) x✝ =
    (Prod.map f g ∘ lastFun prod.diag) x✝

Next tactic:
rfl
theorem liftR_map_last' [LawfulMvFunctor F] {α : TypeVec n} {ι} (R : ι → ι → Prop) (x : F (α ::: ι))
    (f : ι → ι) (hh : ∀ x : ι, R (f x) x) : LiftR' (RelLast' _ R) ((id ::: f) <$$> x) x := by
  

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
inst✝ : LawfulMvFunctor F
α : TypeVec.{u} n
ι : Type u
R : ι → ι → Prop
x : F (α ::: ι)
f : ι → ι
hh : ∀ (x : ι), R (f x) x
⊢ LiftR' (RelLast' α R) ((TypeVec.id ::: f) <$$> x) x

Next tactic:
have := liftR_map_last R x f id hh
theorem liftR_map_last' [LawfulMvFunctor F] {α : TypeVec n} {ι} (R : ι → ι → Prop) (x : F (α ::: ι))
    (f : ι → ι) (hh : ∀ x : ι, R (f x) x) : LiftR' (RelLast' _ R) ((id ::: f) <$$> x) x := by
  have := liftR_map_last R x f id hh
  

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
inst✝ : LawfulMvFunctor F
α : TypeVec.{u} n
ι : Type u
R : ι → ι → Prop
x : F (α ::: ι)
f : ι → ι
hh : ∀ (x : ι), R (f x) x
this : LiftR' (RelLast' α R) ((TypeVec.id ::: f) <$$> x) ((TypeVec.id ::: _root_.id) <$$> x)
⊢ LiftR' (RelLast' α R) ((TypeVec.id ::: f) <$$> x) x

Next tactic:
rwa [appendFun_id_id, MvFunctor.id_map] at this
theorem Cofix.abs_repr {α} (x : Cofix F α) : Quot.mk _ (Cofix.repr x) = x := by
  

Proof state:
n : ℕ
F✝ : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F✝
q✝ : MvQPF F✝
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
x : Cofix F α
⊢ Quot.mk Mcongr (repr x) = x

Next tactic:
let R := fun x y : Cofix F α => abs (repr y) = x
theorem Cofix.abs_repr {α} (x : Cofix F α) : Quot.mk _ (Cofix.repr x) = x := by
  let R := fun x y : Cofix F α => abs (repr y) = x
  

Proof state:
n : ℕ
F✝ : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F✝
q✝ : MvQPF F✝
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
x : Cofix F α
R : Cofix F α → Cofix F α → Prop := fun x y => abs (repr y) = x
⊢ Quot.mk Mcongr (repr x) = x

Next tactic:
refine' Cofix.bisim₂ R _ _ _ rfl
theorem Cofix.abs_repr {α} (x : Cofix F α) : Quot.mk _ (Cofix.repr x) = x := by
  let R := fun x y : Cofix F α => abs (repr y) = x
  refine' Cofix.bisim₂ R _ _ _ rfl
  

Proof state:
n : ℕ
F✝ : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F✝
q✝ : MvQPF F✝
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
x : Cofix F α
R : Cofix F α → Cofix F α → Prop := fun x y => abs (repr y) = x
⊢ ∀ (x y : Cofix F α), R x y → LiftR' (RelLast' α R) (dest x) (dest y)

Next tactic:
clear x
theorem Cofix.abs_repr {α} (x : Cofix F α) : Quot.mk _ (Cofix.repr x) = x := by
  let R := fun x y : Cofix F α => abs (repr y) = x
  refine' Cofix.bisim₂ R _ _ _ rfl
  clear x;
  

Proof state:
n : ℕ
F✝ : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F✝
q✝ : MvQPF F✝
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
R : Cofix F α → Cofix F α → Prop := fun x y => abs (repr y) = x
⊢ ∀ (x y : Cofix F α), R x y → LiftR' (RelLast' α R) (dest x) (dest y)

Next tactic:
rintro x y h
theorem Cofix.abs_repr {α} (x : Cofix F α) : Quot.mk _ (Cofix.repr x) = x := by
  let R := fun x y : Cofix F α => abs (repr y) = x
  refine' Cofix.bisim₂ R _ _ _ rfl
  clear x;
  rintro x y h;
  

Proof state:
n : ℕ
F✝ : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F✝
q✝ : MvQPF F✝
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
R : Cofix F α → Cofix F α → Prop := fun x y => abs (repr y) = x
x y : Cofix F α
h : R x y
⊢ LiftR' (RelLast' α R) (dest x) (dest y)

Next tactic:
subst h
theorem Cofix.abs_repr {α} (x : Cofix F α) : Quot.mk _ (Cofix.repr x) = x := by
  let R := fun x y : Cofix F α => abs (repr y) = x
  refine' Cofix.bisim₂ R _ _ _ rfl
  clear x;
  rintro x y h;
  subst h
  

Proof state:
n : ℕ
F✝ : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F✝
q✝ : MvQPF F✝
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
R : Cofix F α → Cofix F α → Prop := fun x y => abs (repr y) = x
y : Cofix F α
⊢ LiftR' (RelLast' α R) (dest (abs (repr y))) (dest y)

Next tactic:
dsimp [Cofix.dest, Cofix.abs]
theorem Cofix.abs_repr {α} (x : Cofix F α) : Quot.mk _ (Cofix.repr x) = x := by
  let R := fun x y : Cofix F α => abs (repr y) = x
  refine' Cofix.bisim₂ R _ _ _ rfl
  clear x;
  rintro x y h;
  subst h
  dsimp [Cofix.dest, Cofix.abs]
  

Proof state:
n : ℕ
F✝ : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F✝
q✝ : MvQPF F✝
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
R : Cofix F α → Cofix F α → Prop := fun x y => abs (repr y) = x
y : Cofix F α
⊢ LiftR' (RelLast' α fun x y => Quot.mk Mcongr (repr y) = x)
    ((TypeVec.id ::: Quot.mk Mcongr) <$$> MvQPF.abs (M.dest (P F) (repr y)))
    (Quot.lift (fun x => (TypeVec.id ::: Quot.mk Mcongr) <$$> MvQPF.abs (M.dest (P F) x))
      (_ :
        ∀ (x y : M (P F) α),
          Mcongr x y →
            (fun x => (TypeVec.id ::: Quot.mk Mcongr) <$$> MvQPF.abs (M.dest (P F) x)) x =
              (fun x => (TypeVec.id ::: Quot.mk Mcongr) <$$> MvQPF.abs (M.dest (P F) x)) y)
      y)

Next tactic:
induction y using Quot.ind
theorem Cofix.abs_repr {α} (x : Cofix F α) : Quot.mk _ (Cofix.repr x) = x := by
  let R := fun x y : Cofix F α => abs (repr y) = x
  refine' Cofix.bisim₂ R _ _ _ rfl
  clear x;
  rintro x y h;
  subst h
  dsimp [Cofix.dest, Cofix.abs]
  induction y using Quot.ind
  

Proof state:
case mk
n : ℕ
F✝ : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F✝
q✝ : MvQPF F✝
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
R : Cofix F α → Cofix F α → Prop := fun x y => abs (repr y) = x
a✝ : M (P F) α
⊢ LiftR' (RelLast' α fun x y => Quot.mk Mcongr (repr y) = x)
    ((TypeVec.id ::: Quot.mk Mcongr) <$$> MvQPF.abs (M.dest (P F) (repr (Quot.mk Mcongr a✝))))
    (Quot.lift (fun x => (TypeVec.id ::: Quot.mk Mcongr) <$$> MvQPF.abs (M.dest (P F) x))
      (_ :
        ∀ (x y : M (P F) α),
          Mcongr x y →
            (fun x => (TypeVec.id ::: Quot.mk Mcongr) <$$> MvQPF.abs (M.dest (P F) x)) x =
              (fun x => (TypeVec.id ::: Quot.mk Mcongr) <$$> MvQPF.abs (M.dest (P F) x)) y)
      (Quot.mk Mcongr a✝))

Next tactic:
simp only [Cofix.repr, M.dest_corec, abs_map, MvQPF.abs_repr, Function.comp]
theorem Cofix.abs_repr {α} (x : Cofix F α) : Quot.mk _ (Cofix.repr x) = x := by
  let R := fun x y : Cofix F α => abs (repr y) = x
  refine' Cofix.bisim₂ R _ _ _ rfl
  clear x;
  rintro x y h;
  subst h
  dsimp [Cofix.dest, Cofix.abs]
  induction y using Quot.ind
  simp only [Cofix.repr, M.dest_corec, abs_map, MvQPF.abs_repr, Function.comp]
  

Proof state:
case mk
n : ℕ
F✝ : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F✝
q✝ : MvQPF F✝
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
R : Cofix F α → Cofix F α → Prop := fun x y => abs (repr y) = x
a✝ : M (P F) α
⊢ LiftR' (RelLast' α fun x y => Quot.mk Mcongr (M.corec (P F) (fun x => MvQPF.repr (dest x)) y) = x)
    ((TypeVec.id ::: Quot.mk Mcongr) <$$>
      (TypeVec.id ::: M.corec (P F) fun x => MvQPF.repr (dest x)) <$$> dest (Quot.mk Mcongr a✝))
    ((TypeVec.id ::: Quot.mk Mcongr) <$$> MvQPF.abs (M.dest (P F) a✝))

Next tactic:
conv =>
    congr
    rfl
    rw [Cofix.dest]
theorem Cofix.abs_repr {α} (x : Cofix F α) : Quot.mk _ (Cofix.repr x) = x := by
  let R := fun x y : Cofix F α => abs (repr y) = x
  refine' Cofix.bisim₂ R _ _ _ rfl
  clear x;
  rintro x y h;
  subst h
  dsimp [Cofix.dest, Cofix.abs]
  induction y using Quot.ind
  simp only [Cofix.repr, M.dest_corec, abs_map, MvQPF.abs_repr, Function.comp]
  conv =>
    

Proof state:
n : ℕ
F✝ : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F✝
q✝ : MvQPF F✝
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
R : Cofix F α → Cofix F α → Prop := fun x y => abs (repr y) = x
a✝ : M (P F) α
| LiftR' (RelLast' α fun x y => Quot.mk Mcongr (M.corec (P F) (fun x => MvQPF.repr (dest x)) y) = x)
    ((TypeVec.id ::: Quot.mk Mcongr) <$$>
      (TypeVec.id ::: M.corec (P F) fun x => MvQPF.repr (dest x)) <$$> dest (Quot.mk Mcongr a✝))
    ((TypeVec.id ::: Quot.mk Mcongr) <$$> MvQPF.abs (M.dest (P F) a✝))

Next tactic:
congr
    rfl
    rw [Cofix.dest]
theorem Cofix.abs_repr {α} (x : Cofix F α) : Quot.mk _ (Cofix.repr x) = x := by
  let R := fun x y : Cofix F α => abs (repr y) = x
  refine' Cofix.bisim₂ R _ _ _ rfl
  clear x;
  rintro x y h;
  subst h
  dsimp [Cofix.dest, Cofix.abs]
  induction y using Quot.ind
  simp only [Cofix.repr, M.dest_corec, abs_map, MvQPF.abs_repr, Function.comp]
  conv =>
    

Proof state:
n : ℕ
F✝ : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F✝
q✝ : MvQPF F✝
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
R : Cofix F α → Cofix F α → Prop := fun x y => abs (repr y) = x
a✝ : M (P F) α
| LiftR' (RelLast' α fun x y => Quot.mk Mcongr (M.corec (P F) (fun x => MvQPF.repr (dest x)) y) = x)
    ((TypeVec.id ::: Quot.mk Mcongr) <$$>
      (TypeVec.id ::: M.corec (P F) fun x => MvQPF.repr (dest x)) <$$> dest (Quot.mk Mcongr a✝))
    ((TypeVec.id ::: Quot.mk Mcongr) <$$> MvQPF.abs (M.dest (P F) a✝))

Next tactic:
congr
theorem Cofix.abs_repr {α} (x : Cofix F α) : Quot.mk _ (Cofix.repr x) = x := by
  let R := fun x y : Cofix F α => abs (repr y) = x
  refine' Cofix.bisim₂ R _ _ _ rfl
  clear x;
  rintro x y h;
  subst h
  dsimp [Cofix.dest, Cofix.abs]
  induction y using Quot.ind
  simp only [Cofix.repr, M.dest_corec, abs_map, MvQPF.abs_repr, Function.comp]
  conv =>
    congr
    

Proof state:
case R
n : ℕ
F✝ : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F✝
q✝ : MvQPF F✝
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
R : Cofix F α → Cofix F α → Prop := fun x y => abs (repr y) = x
a✝ : M (P F) α
| RelLast' α fun x y => Quot.mk Mcongr (M.corec (P F) (fun x => MvQPF.repr (dest x)) y) = x
case a
n : ℕ
F✝ : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F✝
q✝ : MvQPF F✝
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
R : Cofix F α → Cofix F α → Prop := fun x y => abs (repr y) = x
a✝ : M (P F) α
| (TypeVec.id ::: Quot.mk Mcongr) <$$>
    (TypeVec.id ::: M.corec (P F) fun x => MvQPF.repr (dest x)) <$$> dest (Quot.mk Mcongr a✝)
case a
n : ℕ
F✝ : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F✝
q✝ : MvQPF F✝
F : TypeVec.{u} (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
R : Cofix F α → Cofix F α → Prop := fun x y => abs (repr y) = x
a✝ : M (P F) α
| (TypeVec.id ::: Quot.mk Mcongr) <$$> MvQPF.abs (M.dest (P F) a✝)

Next tactic:
rfl