l3lab/ntp-mathlib huggingface dataset:
/-- the map function for the functor `Cofix F` -/
def Cofix.map {α β : TypeVec n} (g : α ⟹ β) : Cofix F α → Cofix F β :=
  Quot.lift (fun x : q.P.M α => Quot.mk Mcongr (g <$$> x))
    (by
      rintro aa₁ aa₂ ⟨r, pr, ra₁a₂⟩; apply Quot.sound
      let r' b₁ b₂ := ∃ a₁ a₂ : q.P.M α, r a₁ a₂ ∧ b₁ = g <$$> a₁ ∧ b₂ = g <$$> a₂
      use r'; constructor
      · show IsPrecongr r'
        rintro b₁ b₂ ⟨a₁, a₂, ra₁a₂, b₁eq, b₂eq⟩
        let u : Quot r → Quot r' :=
          Quot.lift (fun x : q.P.M α => Quot.mk r' (g <$$> x))
            (by
              intro a₁ a₂ ra₁a₂
              apply Quot.sound
              exact ⟨a₁, a₂, ra₁a₂, rfl, rfl⟩)
        have hu : (Quot.mk r' ∘ fun x : q.P.M α => g <$$> x) = u ∘ Quot.mk r := by
          ext x
          rfl
        

Proof state:
case h.left.intro.intro.intro.intro
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α β : TypeVec.{u} n
g : α ⟹ β
aa₁ aa₂ : M (P F) α
r : M (P F) α → M (P F) α → Prop
pr : IsPrecongr r
ra₁a₂✝ : r aa₁ aa₂
r' : M (P F) β → M (P F) β → Prop := fun b₁ b₂ => ∃ a₁ a₂, r a₁ a₂ ∧ b₁ = g <$$> a₁ ∧ b₂ = g <$$> a₂
b₁ b₂ : M (P F) β
a₁ a₂ : M (P F) α
ra₁a₂ : r a₁ a₂
b₁eq : b₁ = g <$$> a₁
b₂eq : b₂ = g <$$> a₂
u : Quot r → Quot r' :=
  Quot.lift (fun x => Quot.mk r' (g <$$> x))
    (_ : ∀ (a₁ a₂ : M (P F) α), r a₁ a₂ → Quot.mk r' (g <$$> a₁) = Quot.mk r' (g <$$> a₂))
hu : (Quot.mk r' ∘ fun x => g <$$> x) = u ∘ Quot.mk r
⊢ abs ((TypeVec.id ::: Quot.mk r') <$$> M.dest (P F) b₁) = abs ((TypeVec.id ::: Quot.mk r') <$$> M.dest (P F) b₂)

Next tactic:
rw [b₁eq, b₂eq, M.dest_map, M.dest_map, ← q.P.comp_map, ← q.P.comp_map]
/-- the map function for the functor `Cofix F` -/
def Cofix.map {α β : TypeVec n} (g : α ⟹ β) : Cofix F α → Cofix F β :=
  Quot.lift (fun x : q.P.M α => Quot.mk Mcongr (g <$$> x))
    (by
      rintro aa₁ aa₂ ⟨r, pr, ra₁a₂⟩; apply Quot.sound
      let r' b₁ b₂ := ∃ a₁ a₂ : q.P.M α, r a₁ a₂ ∧ b₁ = g <$$> a₁ ∧ b₂ = g <$$> a₂
      use r'; constructor
      · show IsPrecongr r'
        rintro b₁ b₂ ⟨a₁, a₂, ra₁a₂, b₁eq, b₂eq⟩
        let u : Quot r → Quot r' :=
          Quot.lift (fun x : q.P.M α => Quot.mk r' (g <$$> x))
            (by
              intro a₁ a₂ ra₁a₂
              apply Quot.sound
              exact ⟨a₁, a₂, ra₁a₂, rfl, rfl⟩)
        have hu : (Quot.mk r' ∘ fun x : q.P.M α => g <$$> x) = u ∘ Quot.mk r := by
          ext x
          rfl
        rw [b₁eq, b₂eq, M.dest_map, M.dest_map, ← q.P.comp_map, ← q.P.comp_map]
        

Proof state:
case h.left.intro.intro.intro.intro
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α β : TypeVec.{u} n
g : α ⟹ β
aa₁ aa₂ : M (P F) α
r : M (P F) α → M (P F) α → Prop
pr : IsPrecongr r
ra₁a₂✝ : r aa₁ aa₂
r' : M (P F) β → M (P F) β → Prop := fun b₁ b₂ => ∃ a₁ a₂, r a₁ a₂ ∧ b₁ = g <$$> a₁ ∧ b₂ = g <$$> a₂
b₁ b₂ : M (P F) β
a₁ a₂ : M (P F) α
ra₁a₂ : r a₁ a₂
b₁eq : b₁ = g <$$> a₁
b₂eq : b₂ = g <$$> a₂
u : Quot r → Quot r' :=
  Quot.lift (fun x => Quot.mk r' (g <$$> x))
    (_ : ∀ (a₁ a₂ : M (P F) α), r a₁ a₂ → Quot.mk r' (g <$$> a₁) = Quot.mk r' (g <$$> a₂))
hu : (Quot.mk r' ∘ fun x => g <$$> x) = u ∘ Quot.mk r
⊢ abs (((TypeVec.id ::: Quot.mk r') ⊚ (g ::: fun x => g <$$> x)) <$$> M.dest (P F) a₁) =
    abs (((TypeVec.id ::: Quot.mk r') ⊚ (g ::: fun x => g <$$> x)) <$$> M.dest (P F) a₂)

Next tactic:
rw [← appendFun_comp, id_comp, hu, ← comp_id g, appendFun_comp]
/-- the map function for the functor `Cofix F` -/
def Cofix.map {α β : TypeVec n} (g : α ⟹ β) : Cofix F α → Cofix F β :=
  Quot.lift (fun x : q.P.M α => Quot.mk Mcongr (g <$$> x))
    (by
      rintro aa₁ aa₂ ⟨r, pr, ra₁a₂⟩; apply Quot.sound
      let r' b₁ b₂ := ∃ a₁ a₂ : q.P.M α, r a₁ a₂ ∧ b₁ = g <$$> a₁ ∧ b₂ = g <$$> a₂
      use r'; constructor
      · show IsPrecongr r'
        rintro b₁ b₂ ⟨a₁, a₂, ra₁a₂, b₁eq, b₂eq⟩
        let u : Quot r → Quot r' :=
          Quot.lift (fun x : q.P.M α => Quot.mk r' (g <$$> x))
            (by
              intro a₁ a₂ ra₁a₂
              apply Quot.sound
              exact ⟨a₁, a₂, ra₁a₂, rfl, rfl⟩)
        have hu : (Quot.mk r' ∘ fun x : q.P.M α => g <$$> x) = u ∘ Quot.mk r := by
          ext x
          rfl
        rw [b₁eq, b₂eq, M.dest_map, M.dest_map, ← q.P.comp_map, ← q.P.comp_map]
        rw [← appendFun_comp, id_comp, hu, ← comp_id g, appendFun_comp]
        

Proof state:
case h.left.intro.intro.intro.intro
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α β : TypeVec.{u} n
g : α ⟹ β
aa₁ aa₂ : M (P F) α
r : M (P F) α → M (P F) α → Prop
pr : IsPrecongr r
ra₁a₂✝ : r aa₁ aa₂
r' : M (P F) β → M (P F) β → Prop := fun b₁ b₂ => ∃ a₁ a₂, r a₁ a₂ ∧ b₁ = g <$$> a₁ ∧ b₂ = g <$$> a₂
b₁ b₂ : M (P F) β
a₁ a₂ : M (P F) α
ra₁a₂ : r a₁ a₂
b₁eq : b₁ = g <$$> a₁
b₂eq : b₂ = g <$$> a₂
u : Quot r → Quot r' :=
  Quot.lift (fun x => Quot.mk r' (g <$$> x))
    (_ : ∀ (a₁ a₂ : M (P F) α), r a₁ a₂ → Quot.mk r' (g <$$> a₁) = Quot.mk r' (g <$$> a₂))
hu : (Quot.mk r' ∘ fun x => g <$$> x) = u ∘ Quot.mk r
⊢ abs (((g ::: u) ⊚ (TypeVec.id ::: Quot.mk r)) <$$> M.dest (P F) a₁) =
    abs (((g ::: u) ⊚ (TypeVec.id ::: Quot.mk r)) <$$> M.dest (P F) a₂)

Next tactic:
rw [q.P.comp_map, q.P.comp_map, abs_map, pr ra₁a₂, ← abs_map]
/-- the map function for the functor `Cofix F` -/
def Cofix.map {α β : TypeVec n} (g : α ⟹ β) : Cofix F α → Cofix F β :=
  Quot.lift (fun x : q.P.M α => Quot.mk Mcongr (g <$$> x))
    (by
      rintro aa₁ aa₂ ⟨r, pr, ra₁a₂⟩; apply Quot.sound
      let r' b₁ b₂ := ∃ a₁ a₂ : q.P.M α, r a₁ a₂ ∧ b₁ = g <$$> a₁ ∧ b₂ = g <$$> a₂
      use r'; constructor
      · show IsPrecongr r'
        rintro b₁ b₂ ⟨a₁, a₂, ra₁a₂, b₁eq, b₂eq⟩
        let u : Quot r → Quot r' :=
          Quot.lift (fun x : q.P.M α => Quot.mk r' (g <$$> x))
            (by
              intro a₁ a₂ ra₁a₂
              apply Quot.sound
              exact ⟨a₁, a₂, ra₁a₂, rfl, rfl⟩)
        have hu : (Quot.mk r' ∘ fun x : q.P.M α => g <$$> x) = u ∘ Quot.mk r := by
          ext x
          rfl
        rw [b₁eq, b₂eq, M.dest_map, M.dest_map, ← q.P.comp_map, ← q.P.comp_map]
        rw [← appendFun_comp, id_comp, hu, ← comp_id g, appendFun_comp]
        rw [q.P.comp_map, q.P.comp_map, abs_map, pr ra₁a₂, ← abs_map]
      

Proof state:
case h.right
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α β : TypeVec.{u} n
g : α ⟹ β
aa₁ aa₂ : M (P F) α
r : M (P F) α → M (P F) α → Prop
pr : IsPrecongr r
ra₁a₂ : r aa₁ aa₂
r' : M (P F) β → M (P F) β → Prop := fun b₁ b₂ => ∃ a₁ a₂, r a₁ a₂ ∧ b₁ = g <$$> a₁ ∧ b₂ = g <$$> a₂
⊢ r' (g <$$> aa₁) (g <$$> aa₂)

Next tactic:
show r' (g <$$> aa₁) (g <$$> aa₂)
/-- the map function for the functor `Cofix F` -/
def Cofix.map {α β : TypeVec n} (g : α ⟹ β) : Cofix F α → Cofix F β :=
  Quot.lift (fun x : q.P.M α => Quot.mk Mcongr (g <$$> x))
    (by
      rintro aa₁ aa₂ ⟨r, pr, ra₁a₂⟩; apply Quot.sound
      let r' b₁ b₂ := ∃ a₁ a₂ : q.P.M α, r a₁ a₂ ∧ b₁ = g <$$> a₁ ∧ b₂ = g <$$> a₂
      use r'; constructor
      · show IsPrecongr r'
        rintro b₁ b₂ ⟨a₁, a₂, ra₁a₂, b₁eq, b₂eq⟩
        let u : Quot r → Quot r' :=
          Quot.lift (fun x : q.P.M α => Quot.mk r' (g <$$> x))
            (by
              intro a₁ a₂ ra₁a₂
              apply Quot.sound
              exact ⟨a₁, a₂, ra₁a₂, rfl, rfl⟩)
        have hu : (Quot.mk r' ∘ fun x : q.P.M α => g <$$> x) = u ∘ Quot.mk r := by
          ext x
          rfl
        rw [b₁eq, b₂eq, M.dest_map, M.dest_map, ← q.P.comp_map, ← q.P.comp_map]
        rw [← appendFun_comp, id_comp, hu, ← comp_id g, appendFun_comp]
        rw [q.P.comp_map, q.P.comp_map, abs_map, pr ra₁a₂, ← abs_map]
      show r' (g <$$> aa₁) (g <$$> aa₂); 

Proof state:
case h.right
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α β : TypeVec.{u} n
g : α ⟹ β
aa₁ aa₂ : M (P F) α
r : M (P F) α → M (P F) α → Prop
pr : IsPrecongr r
ra₁a₂ : r aa₁ aa₂
r' : M (P F) β → M (P F) β → Prop := fun b₁ b₂ => ∃ a₁ a₂, r a₁ a₂ ∧ b₁ = g <$$> a₁ ∧ b₂ = g <$$> a₂
⊢ r' (g <$$> aa₁) (g <$$> aa₂)

Next tactic:
exact ⟨aa₁, aa₂, ra₁a₂, rfl, rfl⟩
/-- Destructor for `Cofix F` -/
def Cofix.dest {α : TypeVec n} : Cofix F α → F (α.append1 (Cofix F α)) :=
  Quot.lift (fun x => appendFun id (Quot.mk Mcongr) <$$> abs (M.dest q.P x))
    (by
      

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
⊢ ∀ (a b : M (P F) α),
    Mcongr a b →
      (fun x => (TypeVec.id ::: Quot.mk Mcongr) <$$> abs (M.dest (P F) x)) a =
        (fun x => (TypeVec.id ::: Quot.mk Mcongr) <$$> abs (M.dest (P F) x)) b

Next tactic:
rintro x y ⟨r, pr, rxy⟩
/-- Destructor for `Cofix F` -/
def Cofix.dest {α : TypeVec n} : Cofix F α → F (α.append1 (Cofix F α)) :=
  Quot.lift (fun x => appendFun id (Quot.mk Mcongr) <$$> abs (M.dest q.P x))
    (by
      rintro x y ⟨r, pr, rxy⟩
      

Proof state:
case intro.intro
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
x y : M (P F) α
r : M (P F) α → M (P F) α → Prop
pr : IsPrecongr r
rxy : r x y
⊢ (fun x => (TypeVec.id ::: Quot.mk Mcongr) <$$> abs (M.dest (P F) x)) x =
    (fun x => (TypeVec.id ::: Quot.mk Mcongr) <$$> abs (M.dest (P F) x)) y

Next tactic:
dsimp
/-- Destructor for `Cofix F` -/
def Cofix.dest {α : TypeVec n} : Cofix F α → F (α.append1 (Cofix F α)) :=
  Quot.lift (fun x => appendFun id (Quot.mk Mcongr) <$$> abs (M.dest q.P x))
    (by
      rintro x y ⟨r, pr, rxy⟩
      dsimp
      

Proof state:
case intro.intro
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
x y : M (P F) α
r : M (P F) α → M (P F) α → Prop
pr : IsPrecongr r
rxy : r x y
⊢ (TypeVec.id ::: Quot.mk Mcongr) <$$> abs (M.dest (P F) x) = (TypeVec.id ::: Quot.mk Mcongr) <$$> abs (M.dest (P F) y)

Next tactic:
have : ∀ x y, r x y → Mcongr x y := by
        intro x y h
        exact ⟨r, pr, h⟩
/-- Destructor for `Cofix F` -/
def Cofix.dest {α : TypeVec n} : Cofix F α → F (α.append1 (Cofix F α)) :=
  Quot.lift (fun x => appendFun id (Quot.mk Mcongr) <$$> abs (M.dest q.P x))
    (by
      rintro x y ⟨r, pr, rxy⟩
      dsimp
      have : ∀ x y, r x y → Mcongr x y := by
        

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
x y : M (P F) α
r : M (P F) α → M (P F) α → Prop
pr : IsPrecongr r
rxy : r x y
⊢ ∀ (x y : M (P F) α), r x y → Mcongr x y

Next tactic:
intro x y h
/-- Destructor for `Cofix F` -/
def Cofix.dest {α : TypeVec n} : Cofix F α → F (α.append1 (Cofix F α)) :=
  Quot.lift (fun x => appendFun id (Quot.mk Mcongr) <$$> abs (M.dest q.P x))
    (by
      rintro x y ⟨r, pr, rxy⟩
      dsimp
      have : ∀ x y, r x y → Mcongr x y := by
        intro x y h
        

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
x✝ y✝ : M (P F) α
r : M (P F) α → M (P F) α → Prop
pr : IsPrecongr r
rxy : r x✝ y✝
x y : M (P F) α
h : r x y
⊢ Mcongr x y

Next tactic:
exact ⟨r, pr, h⟩
/-- Destructor for `Cofix F` -/
def Cofix.dest {α : TypeVec n} : Cofix F α → F (α.append1 (Cofix F α)) :=
  Quot.lift (fun x => appendFun id (Quot.mk Mcongr) <$$> abs (M.dest q.P x))
    (by
      rintro x y ⟨r, pr, rxy⟩
      dsimp
      have : ∀ x y, r x y → Mcongr x y := by
        intro x y h
        exact ⟨r, pr, h⟩
      

Proof state:
case intro.intro
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
x y : M (P F) α
r : M (P F) α → M (P F) α → Prop
pr : IsPrecongr r
rxy : r x y
this : ∀ (x y : M (P F) α), r x y → Mcongr x y
⊢ (TypeVec.id ::: Quot.mk Mcongr) <$$> abs (M.dest (P F) x) = (TypeVec.id ::: Quot.mk Mcongr) <$$> abs (M.dest (P F) y)

Next tactic:
rw [← Quot.factor_mk_eq _ _ this]
/-- Destructor for `Cofix F` -/
def Cofix.dest {α : TypeVec n} : Cofix F α → F (α.append1 (Cofix F α)) :=
  Quot.lift (fun x => appendFun id (Quot.mk Mcongr) <$$> abs (M.dest q.P x))
    (by
      rintro x y ⟨r, pr, rxy⟩
      dsimp
      have : ∀ x y, r x y → Mcongr x y := by
        intro x y h
        exact ⟨r, pr, h⟩
      rw [← Quot.factor_mk_eq _ _ this]
      

Proof state:
case intro.intro
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
x y : M (P F) α
r : M (P F) α → M (P F) α → Prop
pr : IsPrecongr r
rxy : r x y
this : ∀ (x y : M (P F) α), r x y → Mcongr x y
⊢ (TypeVec.id ::: Quot.factor (fun x y => r x y) (fun x y => Mcongr x y) this ∘ Quot.mk fun x y => r x y) <$$>
      abs (M.dest (P F) x) =
    (TypeVec.id ::: Quot.factor (fun x y => r x y) (fun x y => Mcongr x y) this ∘ Quot.mk fun x y => r x y) <$$>
      abs (M.dest (P F) y)

Next tactic:
conv =>
        lhs
        rw [appendFun_comp_id, comp_map, ← abs_map, pr rxy, abs_map, ← comp_map,
          ← appendFun_comp_id]
/-- Destructor for `Cofix F` -/
def Cofix.dest {α : TypeVec n} : Cofix F α → F (α.append1 (Cofix F α)) :=
  Quot.lift (fun x => appendFun id (Quot.mk Mcongr) <$$> abs (M.dest q.P x))
    (by
      rintro x y ⟨r, pr, rxy⟩
      dsimp
      have : ∀ x y, r x y → Mcongr x y := by
        intro x y h
        exact ⟨r, pr, h⟩
      rw [← Quot.factor_mk_eq _ _ this]
      conv =>
        

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
x y : M (P F) α
r : M (P F) α → M (P F) α → Prop
pr : IsPrecongr r
rxy : r x y
this : ∀ (x y : M (P F) α), r x y → Mcongr x y
| (TypeVec.id ::: Quot.factor (fun x y => r x y) (fun x y => Mcongr x y) this ∘ Quot.mk fun x y => r x y) <$$>
      abs (M.dest (P F) x) =
    (TypeVec.id ::: Quot.factor (fun x y => r x y) (fun x y => Mcongr x y) this ∘ Quot.mk fun x y => r x y) <$$>
      abs (M.dest (P F) y)

Next tactic:
lhs
        rw [appendFun_comp_id, comp_map, ← abs_map, pr rxy, abs_map, ← comp_map,
          ← appendFun_comp_id]
/-- Destructor for `Cofix F` -/
def Cofix.dest {α : TypeVec n} : Cofix F α → F (α.append1 (Cofix F α)) :=
  Quot.lift (fun x => appendFun id (Quot.mk Mcongr) <$$> abs (M.dest q.P x))
    (by
      rintro x y ⟨r, pr, rxy⟩
      dsimp
      have : ∀ x y, r x y → Mcongr x y := by
        intro x y h
        exact ⟨r, pr, h⟩
      rw [← Quot.factor_mk_eq _ _ this]
      conv =>
        

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
x y : M (P F) α
r : M (P F) α → M (P F) α → Prop
pr : IsPrecongr r
rxy : r x y
this : ∀ (x y : M (P F) α), r x y → Mcongr x y
| (TypeVec.id ::: Quot.factor (fun x y => r x y) (fun x y => Mcongr x y) this ∘ Quot.mk fun x y => r x y) <$$>
      abs (M.dest (P F) x) =
    (TypeVec.id ::: Quot.factor (fun x y => r x y) (fun x y => Mcongr x y) this ∘ Quot.mk fun x y => r x y) <$$>
      abs (M.dest (P F) y)

Next tactic:
lhs
/-- Destructor for `Cofix F` -/
def Cofix.dest {α : TypeVec n} : Cofix F α → F (α.append1 (Cofix F α)) :=
  Quot.lift (fun x => appendFun id (Quot.mk Mcongr) <$$> abs (M.dest q.P x))
    (by
      rintro x y ⟨r, pr, rxy⟩
      dsimp
      have : ∀ x y, r x y → Mcongr x y := by
        intro x y h
        exact ⟨r, pr, h⟩
      rw [← Quot.factor_mk_eq _ _ this]
      conv =>
        lhs
        

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
x y : M (P F) α
r : M (P F) α → M (P F) α → Prop
pr : IsPrecongr r
rxy : r x y
this : ∀ (x y : M (P F) α), r x y → Mcongr x y
| (TypeVec.id ::: Quot.factor (fun x y => r x y) (fun x y => Mcongr x y) this ∘ Quot.mk fun x y => r x y) <$$>
    abs (M.dest (P F) x)

Next tactic:
rw [appendFun_comp_id, comp_map, ← abs_map, pr rxy, abs_map, ← comp_map,
          ← appendFun_comp_id]
theorem Cofix.dest_corec {α : TypeVec n} {β : Type u} (g : β → F (α.append1 β)) (x : β) :
    Cofix.dest (Cofix.corec g x) = appendFun id (Cofix.corec g) <$$> g x := by
  

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
β : Type u
g : β → F (α ::: β)
x : β
⊢ dest (corec g x) = (TypeVec.id ::: corec g) <$$> g x

Next tactic:
conv =>
    lhs
    rw [Cofix.dest, Cofix.corec];
theorem Cofix.dest_corec {α : TypeVec n} {β : Type u} (g : β → F (α.append1 β)) (x : β) :
    Cofix.dest (Cofix.corec g x) = appendFun id (Cofix.corec g) <$$> g x := by
  conv =>
    

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
β : Type u
g : β → F (α ::: β)
x : β
| dest (corec g x) = (TypeVec.id ::: corec g) <$$> g x

Next tactic:
lhs
    rw [Cofix.dest, Cofix.corec];
theorem Cofix.dest_corec {α : TypeVec n} {β : Type u} (g : β → F (α.append1 β)) (x : β) :
    Cofix.dest (Cofix.corec g x) = appendFun id (Cofix.corec g) <$$> g x := by
  conv =>
    

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
β : Type u
g : β → F (α ::: β)
x : β
| dest (corec g x) = (TypeVec.id ::: corec g) <$$> g x

Next tactic:
lhs
theorem Cofix.dest_corec {α : TypeVec n} {β : Type u} (g : β → F (α.append1 β)) (x : β) :
    Cofix.dest (Cofix.corec g x) = appendFun id (Cofix.corec g) <$$> g x := by
  conv =>
    lhs
    

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
β : Type u
g : β → F (α ::: β)
x : β
| dest (corec g x)

Next tactic:
rw [Cofix.dest, Cofix.corec]
theorem Cofix.dest_corec {α : TypeVec n} {β : Type u} (g : β → F (α.append1 β)) (x : β) :
    Cofix.dest (Cofix.corec g x) = appendFun id (Cofix.corec g) <$$> g x := by
  conv =>
    lhs
    rw [Cofix.dest, Cofix.corec];
  

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
β : Type u
g : β → F (α ::: β)
x : β
⊢ 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 (corecF g x)) =
    (TypeVec.id ::: corec g) <$$> g x

Next tactic:
dsimp
theorem Cofix.dest_corec {α : TypeVec n} {β : Type u} (g : β → F (α.append1 β)) (x : β) :
    Cofix.dest (Cofix.corec g x) = appendFun id (Cofix.corec g) <$$> g x := by
  conv =>
    lhs
    rw [Cofix.dest, Cofix.corec];
  dsimp
  

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
β : Type u
g : β → F (α ::: β)
x : β
⊢ (TypeVec.id ::: Quot.mk Mcongr) <$$> MvQPF.abs (M.dest (P F) (corecF g x)) = (TypeVec.id ::: corec g) <$$> g x

Next tactic:
rw [corecF_eq, abs_map, abs_repr, ← comp_map, ← appendFun_comp]
theorem Cofix.dest_corec {α : TypeVec n} {β : Type u} (g : β → F (α.append1 β)) (x : β) :
    Cofix.dest (Cofix.corec g x) = appendFun id (Cofix.corec g) <$$> g x := by
  conv =>
    lhs
    rw [Cofix.dest, Cofix.corec];
  dsimp
  rw [corecF_eq, abs_map, abs_repr, ← comp_map, ← appendFun_comp]; 

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
β : Type u
g : β → F (α ::: β)
x : β
⊢ (TypeVec.id ⊚ TypeVec.id ::: Quot.mk Mcongr ∘ corecF g) <$$> g x = (TypeVec.id ::: corec g) <$$> g x

Next tactic:
rfl
private theorem Cofix.bisim_aux {α : TypeVec n} (r : Cofix F α → Cofix F α → Prop) (h' : ∀ x, r x x)
    (h : ∀ x y, r x y →
      appendFun id (Quot.mk r) <$$> Cofix.dest x = appendFun id (Quot.mk r) <$$> Cofix.dest y) :
    ∀ x y, r x y → x = y := by
  

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
r : Cofix F α → Cofix F α → Prop
h' : ∀ (x : Cofix F α), r x x
h : ∀ (x y : Cofix F α), r x y → (TypeVec.id ::: Quot.mk r) <$$> dest x = (TypeVec.id ::: Quot.mk r) <$$> dest y
⊢ ∀ (x y : Cofix F α), r x y → x = y

Next tactic:
intro x
private theorem Cofix.bisim_aux {α : TypeVec n} (r : Cofix F α → Cofix F α → Prop) (h' : ∀ x, r x x)
    (h : ∀ x y, r x y →
      appendFun id (Quot.mk r) <$$> Cofix.dest x = appendFun id (Quot.mk r) <$$> Cofix.dest y) :
    ∀ x y, r x y → x = y := by
  intro x
  

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
r : Cofix F α → Cofix F α → Prop
h' : ∀ (x : Cofix F α), r x x
h : ∀ (x y : Cofix F α), r x y → (TypeVec.id ::: Quot.mk r) <$$> dest x = (TypeVec.id ::: Quot.mk r) <$$> dest y
x : Cofix F α
⊢ ∀ (y : Cofix F α), r x y → x = y

Next tactic:
rcases x
private theorem Cofix.bisim_aux {α : TypeVec n} (r : Cofix F α → Cofix F α → Prop) (h' : ∀ x, r x x)
    (h : ∀ x y, r x y →
      appendFun id (Quot.mk r) <$$> Cofix.dest x = appendFun id (Quot.mk r) <$$> Cofix.dest y) :
    ∀ x y, r x y → x = y := by
  intro x
  rcases x; 

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

Next tactic:
clear x
private theorem Cofix.bisim_aux {α : TypeVec n} (r : Cofix F α → Cofix F α → Prop) (h' : ∀ x, r x x)
    (h : ∀ x y, r x y →
      appendFun id (Quot.mk r) <$$> Cofix.dest x = appendFun id (Quot.mk r) <$$> Cofix.dest y) :
    ∀ x y, r x y → x = y := by
  intro x
  rcases x; clear x; 

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

Next tactic:
rename M (P F) α => x
private theorem Cofix.bisim_aux {α : TypeVec n} (r : Cofix F α → Cofix F α → Prop) (h' : ∀ x, r x x)
    (h : ∀ x y, r x y →
      appendFun id (Quot.mk r) <$$> Cofix.dest x = appendFun id (Quot.mk r) <$$> Cofix.dest y) :
    ∀ x y, r x y → x = y := by
  intro x
  rcases x; clear x; rename M (P F) α => x;
  

Proof state:
case mk
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
r : Cofix F α → Cofix F α → Prop
h' : ∀ (x : Cofix F α), r x x
h : ∀ (x y : Cofix F α), r x y → (TypeVec.id ::: Quot.mk r) <$$> dest x = (TypeVec.id ::: Quot.mk r) <$$> dest y
x : M (P F) α
⊢ ∀ (y : Cofix F α), r (Quot.mk Mcongr x) y → Quot.mk Mcongr x = y

Next tactic:
intro y
private theorem Cofix.bisim_aux {α : TypeVec n} (r : Cofix F α → Cofix F α → Prop) (h' : ∀ x, r x x)
    (h : ∀ x y, r x y →
      appendFun id (Quot.mk r) <$$> Cofix.dest x = appendFun id (Quot.mk r) <$$> Cofix.dest y) :
    ∀ x y, r x y → x = y := by
  intro x
  rcases x; clear x; rename M (P F) α => x;
  intro y
  

Proof state:
case mk
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
r : Cofix F α → Cofix F α → Prop
h' : ∀ (x : Cofix F α), r x x
h : ∀ (x y : Cofix F α), r x y → (TypeVec.id ::: Quot.mk r) <$$> dest x = (TypeVec.id ::: Quot.mk r) <$$> dest y
x : M (P F) α
y : Cofix F α
⊢ r (Quot.mk Mcongr x) y → Quot.mk Mcongr x = y

Next tactic:
rcases y
private theorem Cofix.bisim_aux {α : TypeVec n} (r : Cofix F α → Cofix F α → Prop) (h' : ∀ x, r x x)
    (h : ∀ x y, r x y →
      appendFun id (Quot.mk r) <$$> Cofix.dest x = appendFun id (Quot.mk r) <$$> Cofix.dest y) :
    ∀ x y, r x y → x = y := by
  intro x
  rcases x; clear x; rename M (P F) α => x;
  intro y
  rcases y; 

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

Next tactic:
clear y