l3lab/ntp-mathlib huggingface dataset:
theorem Cofix.dest_corec' {α : TypeVec.{u} n} {β : Type u}
    (g : β → F (α.append1 (Cofix F α ⊕ β))) (x : β) :
    Cofix.dest (Cofix.corec' g x) =
      appendFun id (Sum.elim _root_.id (Cofix.corec' g)) <$$> g x := by
  rw [Cofix.corec', Cofix.dest_corec]; dsimp
  congr!; ext (i | i) <;> erw [corec_roll] <;> dsimp [Cofix.corec']
  · mv_bisim i with R a b x Ha Hb
    rw [Ha, Hb, Cofix.dest_corec]
    dsimp [Function.comp_def]
    repeat 

Proof state:
case h.e'_6.h.e'_7.h.inl.intro.intro
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
β : Type u
g : β → F (α ::: (Cofix F α ⊕ β))
x✝ : β
i : Cofix F α
R : Cofix F α → Cofix F α → Prop :=
  fun a b =>
    ∃ x,
      a =
          corec
            (MvFunctor.map (TypeVec.id ::: fun x => x) ∘
              Sum.rec (fun val => (TypeVec.id ::: Sum.inl) <$$> dest val) fun val => g val)
            (Sum.inl x) ∧
        b = x
a b x : Cofix F α
Ha :
  a =
    corec
      (MvFunctor.map (TypeVec.id ::: fun x => x) ∘
        Sum.rec (fun val => (TypeVec.id ::: Sum.inl) <$$> dest val) fun val => g val)
      (Sum.inl x)
Hb : b = x
⊢ LiftR'
    (RelLast' α fun a b =>
      ∃ x,
        a =
            corec
              (fun x =>
                (TypeVec.id ::: fun x => x) <$$>
                  Sum.rec (fun val => (TypeVec.id ::: Sum.inl) <$$> dest val) (fun val => g val) x)
              (Sum.inl x) ∧
          b = x)
    ((TypeVec.id :::
        corec fun x =>
          (TypeVec.id ::: fun x => x) <$$>
            Sum.rec (fun val => (TypeVec.id ::: Sum.inl) <$$> dest val) (fun val => g val) x) <$$>
      (TypeVec.id ::: fun x => x) <$$> (TypeVec.id ::: Sum.inl) <$$> dest x)
    (dest x)

Next tactic:
rw [MvFunctor.map_map, ← appendFun_comp_id]
theorem Cofix.dest_corec' {α : TypeVec.{u} n} {β : Type u}
    (g : β → F (α.append1 (Cofix F α ⊕ β))) (x : β) :
    Cofix.dest (Cofix.corec' g x) =
      appendFun id (Sum.elim _root_.id (Cofix.corec' g)) <$$> g x := by
  rw [Cofix.corec', Cofix.dest_corec]; dsimp
  congr!; ext (i | i) <;> erw [corec_roll] <;> dsimp [Cofix.corec']
  · mv_bisim i with R a b x Ha Hb
    rw [Ha, Hb, Cofix.dest_corec]
    dsimp [Function.comp_def]
    repeat 

Proof state:
case h.e'_6.h.e'_7.h.inl.intro.intro
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
β : Type u
g : β → F (α ::: (Cofix F α ⊕ β))
x✝ : β
i : Cofix F α
R : Cofix F α → Cofix F α → Prop :=
  fun a b =>
    ∃ x,
      a =
          corec
            (MvFunctor.map (TypeVec.id ::: fun x => x) ∘
              Sum.rec (fun val => (TypeVec.id ::: Sum.inl) <$$> dest val) fun val => g val)
            (Sum.inl x) ∧
        b = x
a b x : Cofix F α
Ha :
  a =
    corec
      (MvFunctor.map (TypeVec.id ::: fun x => x) ∘
        Sum.rec (fun val => (TypeVec.id ::: Sum.inl) <$$> dest val) fun val => g val)
      (Sum.inl x)
Hb : b = x
⊢ LiftR'
    (RelLast' α fun a b =>
      ∃ x,
        a =
            corec
              (fun x =>
                (TypeVec.id ::: fun x => x) <$$>
                  Sum.rec (fun val => (TypeVec.id ::: Sum.inl) <$$> dest val) (fun val => g val) x)
              (Sum.inl x) ∧
          b = x)
    ((TypeVec.id :::
        (corec fun x =>
            (TypeVec.id ::: fun x => x) <$$>
              Sum.rec (fun val => (TypeVec.id ::: Sum.inl) <$$> dest val) (fun val => g val) x) ∘
          fun x => x) <$$>
      (TypeVec.id ::: Sum.inl) <$$> dest x)
    (dest x)

Next tactic:
rw [MvFunctor.map_map, ← appendFun_comp_id]
theorem Cofix.dest_corec' {α : TypeVec.{u} n} {β : Type u}
    (g : β → F (α.append1 (Cofix F α ⊕ β))) (x : β) :
    Cofix.dest (Cofix.corec' g x) =
      appendFun id (Sum.elim _root_.id (Cofix.corec' g)) <$$> g x := by
  rw [Cofix.corec', Cofix.dest_corec]; dsimp
  congr!; ext (i | i) <;> erw [corec_roll] <;> dsimp [Cofix.corec']
  · mv_bisim i with R a b x Ha Hb
    rw [Ha, Hb, Cofix.dest_corec]
    dsimp [Function.comp_def]
    repeat 

Proof state:
case h.e'_6.h.e'_7.h.inl.intro.intro
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
β : Type u
g : β → F (α ::: (Cofix F α ⊕ β))
x✝ : β
i : Cofix F α
R : Cofix F α → Cofix F α → Prop :=
  fun a b =>
    ∃ x,
      a =
          corec
            (MvFunctor.map (TypeVec.id ::: fun x => x) ∘
              Sum.rec (fun val => (TypeVec.id ::: Sum.inl) <$$> dest val) fun val => g val)
            (Sum.inl x) ∧
        b = x
a b x : Cofix F α
Ha :
  a =
    corec
      (MvFunctor.map (TypeVec.id ::: fun x => x) ∘
        Sum.rec (fun val => (TypeVec.id ::: Sum.inl) <$$> dest val) fun val => g val)
      (Sum.inl x)
Hb : b = x
⊢ LiftR'
    (RelLast' α fun a b =>
      ∃ x,
        a =
            corec
              (fun x =>
                (TypeVec.id ::: fun x => x) <$$>
                  Sum.rec (fun val => (TypeVec.id ::: Sum.inl) <$$> dest val) (fun val => g val) x)
              (Sum.inl x) ∧
          b = x)
    ((TypeVec.id :::
        ((corec fun x =>
              (TypeVec.id ::: fun x => x) <$$>
                Sum.rec (fun val => (TypeVec.id ::: Sum.inl) <$$> dest val) (fun val => g val) x) ∘
            fun x => x) ∘
          Sum.inl) <$$>
      dest x)
    (dest x)

Next tactic:
rw [MvFunctor.map_map, ← appendFun_comp_id]
theorem Cofix.dest_corec' {α : TypeVec.{u} n} {β : Type u}
    (g : β → F (α.append1 (Cofix F α ⊕ β))) (x : β) :
    Cofix.dest (Cofix.corec' g x) =
      appendFun id (Sum.elim _root_.id (Cofix.corec' g)) <$$> g x := by
  rw [Cofix.corec', Cofix.dest_corec]; dsimp
  congr!; ext (i | i) <;> erw [corec_roll] <;> dsimp [Cofix.corec']
  · mv_bisim i with R a b x Ha Hb
    rw [Ha, Hb, Cofix.dest_corec]
    dsimp [Function.comp_def]
    repeat rw [MvFunctor.map_map, ← appendFun_comp_id]
    

Proof state:
case h.e'_6.h.e'_7.h.inl.intro.intro
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
β : Type u
g : β → F (α ::: (Cofix F α ⊕ β))
x✝ : β
i : Cofix F α
R : Cofix F α → Cofix F α → Prop :=
  fun a b =>
    ∃ x,
      a =
          corec
            (MvFunctor.map (TypeVec.id ::: fun x => x) ∘
              Sum.rec (fun val => (TypeVec.id ::: Sum.inl) <$$> dest val) fun val => g val)
            (Sum.inl x) ∧
        b = x
a b x : Cofix F α
Ha :
  a =
    corec
      (MvFunctor.map (TypeVec.id ::: fun x => x) ∘
        Sum.rec (fun val => (TypeVec.id ::: Sum.inl) <$$> dest val) fun val => g val)
      (Sum.inl x)
Hb : b = x
⊢ LiftR'
    (RelLast' α fun a b =>
      ∃ x,
        a =
            corec
              (fun x =>
                (TypeVec.id ::: fun x => x) <$$>
                  Sum.rec (fun val => (TypeVec.id ::: Sum.inl) <$$> dest val) (fun val => g val) x)
              (Sum.inl x) ∧
          b = x)
    ((TypeVec.id :::
        ((corec fun x =>
              (TypeVec.id ::: fun x => x) <$$>
                Sum.rec (fun val => (TypeVec.id ::: Sum.inl) <$$> dest val) (fun val => g val) x) ∘
            fun x => x) ∘
          Sum.inl) <$$>
      dest x)
    (dest x)

Next tactic:
apply liftR_map_last'
theorem Cofix.dest_corec' {α : TypeVec.{u} n} {β : Type u}
    (g : β → F (α.append1 (Cofix F α ⊕ β))) (x : β) :
    Cofix.dest (Cofix.corec' g x) =
      appendFun id (Sum.elim _root_.id (Cofix.corec' g)) <$$> g x := by
  rw [Cofix.corec', Cofix.dest_corec]; dsimp
  congr!; ext (i | i) <;> erw [corec_roll] <;> dsimp [Cofix.corec']
  · mv_bisim i with R a b x Ha Hb
    rw [Ha, Hb, Cofix.dest_corec]
    dsimp [Function.comp_def]
    repeat rw [MvFunctor.map_map, ← appendFun_comp_id]
    apply liftR_map_last'
    

Proof state:
case h.e'_6.h.e'_7.h.inl.intro.intro.hh
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
β : Type u
g : β → F (α ::: (Cofix F α ⊕ β))
x✝ : β
i : Cofix F α
R : Cofix F α → Cofix F α → Prop :=
  fun a b =>
    ∃ x,
      a =
          corec
            (MvFunctor.map (TypeVec.id ::: fun x => x) ∘
              Sum.rec (fun val => (TypeVec.id ::: Sum.inl) <$$> dest val) fun val => g val)
            (Sum.inl x) ∧
        b = x
a b x : Cofix F α
Ha :
  a =
    corec
      (MvFunctor.map (TypeVec.id ::: fun x => x) ∘
        Sum.rec (fun val => (TypeVec.id ::: Sum.inl) <$$> dest val) fun val => g val)
      (Sum.inl x)
Hb : b = x
⊢ ∀ (x : Cofix F α),
    ∃ x_1,
      (((corec fun x =>
                  (TypeVec.id ::: fun x => x) <$$>
                    Sum.rec (fun val => (TypeVec.id ::: Sum.inl) <$$> dest val) (fun val => g val) x) ∘
                fun x => x) ∘
              Sum.inl)
            x =
          corec
            (fun x =>
              (TypeVec.id ::: fun x => x) <$$>
                Sum.rec (fun val => (TypeVec.id ::: Sum.inl) <$$> dest val) (fun val => g val) x)
            (Sum.inl x_1) ∧
        x = x_1

Next tactic:
dsimp [Function.comp_def]
theorem Cofix.dest_corec' {α : TypeVec.{u} n} {β : Type u}
    (g : β → F (α.append1 (Cofix F α ⊕ β))) (x : β) :
    Cofix.dest (Cofix.corec' g x) =
      appendFun id (Sum.elim _root_.id (Cofix.corec' g)) <$$> g x := by
  rw [Cofix.corec', Cofix.dest_corec]; dsimp
  congr!; ext (i | i) <;> erw [corec_roll] <;> dsimp [Cofix.corec']
  · mv_bisim i with R a b x Ha Hb
    rw [Ha, Hb, Cofix.dest_corec]
    dsimp [Function.comp_def]
    repeat rw [MvFunctor.map_map, ← appendFun_comp_id]
    apply liftR_map_last'
    dsimp [Function.comp_def]
    

Proof state:
case h.e'_6.h.e'_7.h.inl.intro.intro.hh
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
β : Type u
g : β → F (α ::: (Cofix F α ⊕ β))
x✝ : β
i : Cofix F α
R : Cofix F α → Cofix F α → Prop :=
  fun a b =>
    ∃ x,
      a =
          corec
            (MvFunctor.map (TypeVec.id ::: fun x => x) ∘
              Sum.rec (fun val => (TypeVec.id ::: Sum.inl) <$$> dest val) fun val => g val)
            (Sum.inl x) ∧
        b = x
a b x : Cofix F α
Ha :
  a =
    corec
      (MvFunctor.map (TypeVec.id ::: fun x => x) ∘
        Sum.rec (fun val => (TypeVec.id ::: Sum.inl) <$$> dest val) fun val => g val)
      (Sum.inl x)
Hb : b = x
⊢ ∀ (x : Cofix F α),
    ∃ x_1,
      corec
            (fun x =>
              (TypeVec.id ::: fun x => x) <$$>
                Sum.rec (fun val => (TypeVec.id ::: Sum.inl) <$$> dest val) (fun val => g val) x)
            (Sum.inl x) =
          corec
            (fun x =>
              (TypeVec.id ::: fun x => x) <$$>
                Sum.rec (fun val => (TypeVec.id ::: Sum.inl) <$$> dest val) (fun val => g val) x)
            (Sum.inl x_1) ∧
        x = x_1

Next tactic:
intros
theorem Cofix.dest_corec' {α : TypeVec.{u} n} {β : Type u}
    (g : β → F (α.append1 (Cofix F α ⊕ β))) (x : β) :
    Cofix.dest (Cofix.corec' g x) =
      appendFun id (Sum.elim _root_.id (Cofix.corec' g)) <$$> g x := by
  rw [Cofix.corec', Cofix.dest_corec]; dsimp
  congr!; ext (i | i) <;> erw [corec_roll] <;> dsimp [Cofix.corec']
  · mv_bisim i with R a b x Ha Hb
    rw [Ha, Hb, Cofix.dest_corec]
    dsimp [Function.comp_def]
    repeat rw [MvFunctor.map_map, ← appendFun_comp_id]
    apply liftR_map_last'
    dsimp [Function.comp_def]
    intros
    

Proof state:
case h.e'_6.h.e'_7.h.inl.intro.intro.hh
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
β : Type u
g : β → F (α ::: (Cofix F α ⊕ β))
x✝¹ : β
i : Cofix F α
R : Cofix F α → Cofix F α → Prop :=
  fun a b =>
    ∃ x,
      a =
          corec
            (MvFunctor.map (TypeVec.id ::: fun x => x) ∘
              Sum.rec (fun val => (TypeVec.id ::: Sum.inl) <$$> dest val) fun val => g val)
            (Sum.inl x) ∧
        b = x
a b x : Cofix F α
Ha :
  a =
    corec
      (MvFunctor.map (TypeVec.id ::: fun x => x) ∘
        Sum.rec (fun val => (TypeVec.id ::: Sum.inl) <$$> dest val) fun val => g val)
      (Sum.inl x)
Hb : b = x
x✝ : Cofix F α
⊢ ∃ x,
    corec
          (fun x =>
            (TypeVec.id ::: fun x => x) <$$>
              Sum.rec (fun val => (TypeVec.id ::: Sum.inl) <$$> dest val) (fun val => g val) x)
          (Sum.inl x✝) =
        corec
          (fun x =>
            (TypeVec.id ::: fun x => x) <$$>
              Sum.rec (fun val => (TypeVec.id ::: Sum.inl) <$$> dest val) (fun val => g val) x)
          (Sum.inl x) ∧
      x✝ = x

Next tactic:
exact ⟨_, rfl, rfl⟩
theorem Cofix.dest_corec' {α : TypeVec.{u} n} {β : Type u}
    (g : β → F (α.append1 (Cofix F α ⊕ β))) (x : β) :
    Cofix.dest (Cofix.corec' g x) =
      appendFun id (Sum.elim _root_.id (Cofix.corec' g)) <$$> g x := by
  rw [Cofix.corec', Cofix.dest_corec]; dsimp
  congr!; ext (i | i) <;> erw [corec_roll] <;> dsimp [Cofix.corec']
  · mv_bisim i with R a b x Ha Hb
    rw [Ha, Hb, Cofix.dest_corec]
    dsimp [Function.comp_def]
    repeat rw [MvFunctor.map_map, ← appendFun_comp_id]
    apply liftR_map_last'
    dsimp [Function.comp_def]
    intros
    exact ⟨_, rfl, rfl⟩
  · 

Proof state:
case h.e'_6.h.e'_7.h.inr
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
β : Type u
g : β → F (α ::: (Cofix F α ⊕ β))
x i : β
⊢ corec
      (MvFunctor.map (TypeVec.id ::: fun x => x) ∘
        Sum.rec (fun val => (TypeVec.id ::: Sum.inl) <$$> dest val) fun val => g val)
      (Sum.inr i) =
    corec (Sum.elim (MvFunctor.map (TypeVec.id ::: Sum.inl) ∘ dest) g) (Sum.inr i)

Next tactic:
congr with y
theorem Cofix.dest_corec' {α : TypeVec.{u} n} {β : Type u}
    (g : β → F (α.append1 (Cofix F α ⊕ β))) (x : β) :
    Cofix.dest (Cofix.corec' g x) =
      appendFun id (Sum.elim _root_.id (Cofix.corec' g)) <$$> g x := by
  rw [Cofix.corec', Cofix.dest_corec]; dsimp
  congr!; ext (i | i) <;> erw [corec_roll] <;> dsimp [Cofix.corec']
  · mv_bisim i with R a b x Ha Hb
    rw [Ha, Hb, Cofix.dest_corec]
    dsimp [Function.comp_def]
    repeat rw [MvFunctor.map_map, ← appendFun_comp_id]
    apply liftR_map_last'
    dsimp [Function.comp_def]
    intros
    exact ⟨_, rfl, rfl⟩
  · congr with y
    

Proof state:
case h.e'_6.h.e'_7.h.inr.e_g.h
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
β : Type u
g : β → F (α ::: (Cofix F α ⊕ β))
x i : β
y : Cofix F α ⊕ β
⊢ (MvFunctor.map (TypeVec.id ::: fun x => x) ∘
        Sum.rec (fun val => (TypeVec.id ::: Sum.inl) <$$> dest val) fun val => g val)
      y =
    Sum.elim (MvFunctor.map (TypeVec.id ::: Sum.inl) ∘ dest) g y

Next tactic:
erw [appendFun_id_id]
theorem Cofix.dest_corec' {α : TypeVec.{u} n} {β : Type u}
    (g : β → F (α.append1 (Cofix F α ⊕ β))) (x : β) :
    Cofix.dest (Cofix.corec' g x) =
      appendFun id (Sum.elim _root_.id (Cofix.corec' g)) <$$> g x := by
  rw [Cofix.corec', Cofix.dest_corec]; dsimp
  congr!; ext (i | i) <;> erw [corec_roll] <;> dsimp [Cofix.corec']
  · mv_bisim i with R a b x Ha Hb
    rw [Ha, Hb, Cofix.dest_corec]
    dsimp [Function.comp_def]
    repeat rw [MvFunctor.map_map, ← appendFun_comp_id]
    apply liftR_map_last'
    dsimp [Function.comp_def]
    intros
    exact ⟨_, rfl, rfl⟩
  · congr with y
    erw [appendFun_id_id]
    

Proof state:
case h.e'_6.h.e'_7.h.inr.e_g.h
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
β : Type u
g : β → F (α ::: (Cofix F α ⊕ β))
x i : β
y : Cofix F α ⊕ β
⊢ (MvFunctor.map TypeVec.id ∘ Sum.rec (fun val => (TypeVec.id ::: Sum.inl) <$$> dest val) fun val => g val) y =
    Sum.elim (MvFunctor.map (TypeVec.id ::: Sum.inl) ∘ dest) g y

Next tactic:
simp [MvFunctor.id_map, Sum.elim]
theorem Cofix.dest_corec₁ {α : TypeVec n} {β : Type u}
    (g : ∀ {X}, (Cofix F α → X) → (β → X) → β → F (α.append1 X)) (x : β)
    (h : ∀ (X Y) (f : Cofix F α → X) (f' : β → X) (k : X → Y),
      g (k ∘ f) (k ∘ f') x = (id ::: k) <$$> g f f' x) :
    Cofix.dest (Cofix.corec₁ (@g) x) = g id (Cofix.corec₁ @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 : {X : Type u} → (Cofix F α → X) → (β → X) → β → F (α ::: X)
x : β
h :
  ∀ (X Y : Type u) (f : Cofix F α → X) (f' : β → X) (k : X → Y), g (k ∘ f) (k ∘ f') x = (TypeVec.id ::: k) <$$> g f f' x
⊢ dest (corec₁ g x) = g _root_.id (corec₁ g) x

Next tactic:
rw [Cofix.corec₁, Cofix.dest_corec', ← h]
theorem Cofix.dest_corec₁ {α : TypeVec n} {β : Type u}
    (g : ∀ {X}, (Cofix F α → X) → (β → X) → β → F (α.append1 X)) (x : β)
    (h : ∀ (X Y) (f : Cofix F α → X) (f' : β → X) (k : X → Y),
      g (k ∘ f) (k ∘ f') x = (id ::: k) <$$> g f f' x) :
    Cofix.dest (Cofix.corec₁ (@g) x) = g id (Cofix.corec₁ @g) x := by
  rw [Cofix.corec₁, Cofix.dest_corec', ← h]; 

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α : TypeVec.{u} n
β : Type u
g : {X : Type u} → (Cofix F α → X) → (β → X) → β → F (α ::: X)
x : β
h :
  ∀ (X Y : Type u) (f : Cofix F α → X) (f' : β → X) (k : X → Y), g (k ∘ f) (k ∘ f') x = (TypeVec.id ::: k) <$$> g f f' x
⊢ g (Sum.elim _root_.id (corec' fun x => g Sum.inl Sum.inr x) ∘ Sum.inl)
      (Sum.elim _root_.id (corec' fun x => g Sum.inl Sum.inr x) ∘ Sum.inr) x =
    g _root_.id (corec₁ g) x

Next tactic:
rfl
instance mvqpfCofix : MvQPF (Cofix F) where
  P         := q.P.mp
  abs       := Quot.mk Mcongr
  repr      := Cofix.repr
  abs_repr  := Cofix.abs_repr
  abs_map   := by 

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

Next tactic:
intros
instance mvqpfCofix : MvQPF (Cofix F) where
  P         := q.P.mp
  abs       := Quot.mk Mcongr
  repr      := Cofix.repr
  abs_repr  := Cofix.abs_repr
  abs_map   := by intros; 

Proof state:
n : ℕ
F : TypeVec.{u} (n + 1) → Type u
mvf : MvFunctor F
q : MvQPF F
α✝ β✝ : TypeVec.{u} n
f✝ : α✝ ⟹ β✝
p✝ : ↑(mp (P F)) α✝
⊢ (fun {α} => Quot.mk Mcongr) (f✝ <$$> p✝) = f✝ <$$> (fun {α} => Quot.mk Mcongr) p✝

Next tactic:
rfl
@[simp]
theorem zero_right [MulZeroClass G₀] (a : G₀) : SemiconjBy a 0 0 := by
  

Proof state:
α : Type u_1
M₀ : Type u_2
G₀ : Type u_3
M₀' : Type u_4
G₀' : Type u_5
F : Type u_6
F' : Type u_7
inst✝ : MulZeroClass G₀
a : G₀
⊢ SemiconjBy a 0 0

Next tactic:
simp only [SemiconjBy, mul_zero, zero_mul]
@[simp]
theorem zero_left [MulZeroClass G₀] (x y : G₀) : SemiconjBy 0 x y := by
  

Proof state:
α : Type u_1
M₀ : Type u_2
G₀ : Type u_3
M₀' : Type u_4
G₀' : Type u_5
F : Type u_6
F' : Type u_7
inst✝ : MulZeroClass G₀
x y : G₀
⊢ SemiconjBy 0 x y

Next tactic:
simp only [SemiconjBy, mul_zero, zero_mul]
@[simp]
theorem inv_symm_left_iff₀ : SemiconjBy a⁻¹ x y ↔ SemiconjBy a y x :=
  Classical.by_cases (fun ha : a = 0 => by 

Proof state:
α : Type u_1
M₀ : Type u_2
G₀ : Type u_3
M₀' : Type u_4
G₀' : Type u_5
F : Type u_6
F' : Type u_7
inst✝ : GroupWithZero G₀
a x y x' y' : G₀
ha : a = 0
⊢ SemiconjBy a⁻¹ x y ↔ SemiconjBy a y x

Next tactic:
simp only [ha, inv_zero, SemiconjBy.zero_left]
theorem inv_right₀ (h : SemiconjBy a x y) : SemiconjBy a x⁻¹ y⁻¹ := by
  

Proof state:
α : Type u_1
M₀ : Type u_2
G₀ : Type u_3
M₀' : Type u_4
G₀' : Type u_5
F : Type u_6
F' : Type u_7
inst✝ : GroupWithZero G₀
a x y x' y' : G₀
h : SemiconjBy a x y
⊢ SemiconjBy a x⁻¹ y⁻¹

Next tactic:
by_cases ha : a = 0
theorem inv_right₀ (h : SemiconjBy a x y) : SemiconjBy a x⁻¹ y⁻¹ := by
  by_cases ha : a = 0
  · 

Proof state:
case pos
α : Type u_1
M₀ : Type u_2
G₀ : Type u_3
M₀' : Type u_4
G₀' : Type u_5
F : Type u_6
F' : Type u_7
inst✝ : GroupWithZero G₀
a x y x' y' : G₀
h : SemiconjBy a x y
ha : a = 0
⊢ SemiconjBy a x⁻¹ y⁻¹

Next tactic:
simp only [ha, zero_left]
theorem inv_right₀ (h : SemiconjBy a x y) : SemiconjBy a x⁻¹ y⁻¹ := by
  by_cases ha : a = 0
  · simp only [ha, zero_left]
  

Proof state:
case neg
α : Type u_1
M₀ : Type u_2
G₀ : Type u_3
M₀' : Type u_4
G₀' : Type u_5
F : Type u_6
F' : Type u_7
inst✝ : GroupWithZero G₀
a x y x' y' : G₀
h : SemiconjBy a x y
ha : ¬a = 0
⊢ SemiconjBy a x⁻¹ y⁻¹

Next tactic:
by_cases hx : x = 0
theorem inv_right₀ (h : SemiconjBy a x y) : SemiconjBy a x⁻¹ y⁻¹ := by
  by_cases ha : a = 0
  · simp only [ha, zero_left]
  by_cases hx : x = 0
  · 

Proof state:
case pos
α : Type u_1
M₀ : Type u_2
G₀ : Type u_3
M₀' : Type u_4
G₀' : Type u_5
F : Type u_6
F' : Type u_7
inst✝ : GroupWithZero G₀
a x y x' y' : G₀
h : SemiconjBy a x y
ha : ¬a = 0
hx : x = 0
⊢ SemiconjBy a x⁻¹ y⁻¹

Next tactic:
subst x
theorem inv_right₀ (h : SemiconjBy a x y) : SemiconjBy a x⁻¹ y⁻¹ := by
  by_cases ha : a = 0
  · simp only [ha, zero_left]
  by_cases hx : x = 0
  · subst x
    

Proof state:
case pos
α : Type u_1
M₀ : Type u_2
G₀ : Type u_3
M₀' : Type u_4
G₀' : Type u_5
F : Type u_6
F' : Type u_7
inst✝ : GroupWithZero G₀
a y x' y' : G₀
ha : ¬a = 0
h : SemiconjBy a 0 y
⊢ SemiconjBy a 0⁻¹ y⁻¹

Next tactic:
simp only [SemiconjBy, mul_zero, @eq_comm _ _ (y * a), mul_eq_zero] at h
theorem inv_right₀ (h : SemiconjBy a x y) : SemiconjBy a x⁻¹ y⁻¹ := by
  by_cases ha : a = 0
  · simp only [ha, zero_left]
  by_cases hx : x = 0
  · subst x
    simp only [SemiconjBy, mul_zero, @eq_comm _ _ (y * a), mul_eq_zero] at h
    

Proof state:
case pos
α : Type u_1
M₀ : Type u_2
G₀ : Type u_3
M₀' : Type u_4
G₀' : Type u_5
F : Type u_6
F' : Type u_7
inst✝ : GroupWithZero G₀
a y x' y' : G₀
ha : ¬a = 0
h : y = 0 ∨ a = 0
⊢ SemiconjBy a 0⁻¹ y⁻¹

Next tactic:
simp [h.resolve_right ha]
theorem inv_right₀ (h : SemiconjBy a x y) : SemiconjBy a x⁻¹ y⁻¹ := by
  by_cases ha : a = 0
  · simp only [ha, zero_left]
  by_cases hx : x = 0
  · subst x
    simp only [SemiconjBy, mul_zero, @eq_comm _ _ (y * a), mul_eq_zero] at h
    simp [h.resolve_right ha]
  · 

Proof state:
case neg
α : Type u_1
M₀ : Type u_2
G₀ : Type u_3
M₀' : Type u_4
G₀' : Type u_5
F : Type u_6
F' : Type u_7
inst✝ : GroupWithZero G₀
a x y x' y' : G₀
h : SemiconjBy a x y
ha : ¬a = 0
hx : ¬x = 0
⊢ SemiconjBy a x⁻¹ y⁻¹

Next tactic:
have := mul_ne_zero ha hx
theorem inv_right₀ (h : SemiconjBy a x y) : SemiconjBy a x⁻¹ y⁻¹ := by
  by_cases ha : a = 0
  · simp only [ha, zero_left]
  by_cases hx : x = 0
  · subst x
    simp only [SemiconjBy, mul_zero, @eq_comm _ _ (y * a), mul_eq_zero] at h
    simp [h.resolve_right ha]
  · have := mul_ne_zero ha hx
    

Proof state:
case neg
α : Type u_1
M₀ : Type u_2
G₀ : Type u_3
M₀' : Type u_4
G₀' : Type u_5
F : Type u_6
F' : Type u_7
inst✝ : GroupWithZero G₀
a x y x' y' : G₀
h : SemiconjBy a x y
ha : ¬a = 0
hx : ¬x = 0
this : a * x ≠ 0
⊢ SemiconjBy a x⁻¹ y⁻¹

Next tactic:
rw [h.eq, mul_ne_zero_iff] at this
theorem inv_right₀ (h : SemiconjBy a x y) : SemiconjBy a x⁻¹ y⁻¹ := by
  by_cases ha : a = 0
  · simp only [ha, zero_left]
  by_cases hx : x = 0
  · subst x
    simp only [SemiconjBy, mul_zero, @eq_comm _ _ (y * a), mul_eq_zero] at h
    simp [h.resolve_right ha]
  · have := mul_ne_zero ha hx
    rw [h.eq, mul_ne_zero_iff] at this
    

Proof state:
case neg
α : Type u_1
M₀ : Type u_2
G₀ : Type u_3
M₀' : Type u_4
G₀' : Type u_5
F : Type u_6
F' : Type u_7
inst✝ : GroupWithZero G₀
a x y x' y' : G₀
h : SemiconjBy a x y
ha : ¬a = 0
hx : ¬x = 0
this : y ≠ 0 ∧ a ≠ 0
⊢ SemiconjBy a x⁻¹ y⁻¹

Next tactic:
exact @units_inv_right _ _ _ (Units.mk0 x hx) (Units.mk0 y this.1) h
theorem div_right (h : SemiconjBy a x y) (h' : SemiconjBy a x' y') :
    SemiconjBy a (x / x') (y / y') := by
  

Proof state:
α : Type u_1
M₀ : Type u_2
G₀ : Type u_3
M₀' : Type u_4
G₀' : Type u_5
F : Type u_6
F' : Type u_7
inst✝ : GroupWithZero G₀
a x y x' y' : G₀
h : SemiconjBy a x y
h' : SemiconjBy a x' y'
⊢ SemiconjBy a (x / x') (y / y')

Next tactic:
rw [div_eq_mul_inv, div_eq_mul_inv]
theorem div_right (h : SemiconjBy a x y) (h' : SemiconjBy a x' y') :
    SemiconjBy a (x / x') (y / y') := by
  rw [div_eq_mul_inv, div_eq_mul_inv]
  

Proof state:
α : Type u_1
M₀ : Type u_2
G₀ : Type u_3
M₀' : Type u_4
G₀' : Type u_5
F : Type u_6
F' : Type u_7
inst✝ : GroupWithZero G₀
a x y x' y' : G₀
h : SemiconjBy a x y
h' : SemiconjBy a x' y'
⊢ SemiconjBy a (x * x'⁻¹) (y * y'⁻¹)

Next tactic:
exact h.mul_right h'.inv_right₀
@[simp]
theorem cast_eq_zero [AddGroupWithOne α] [CharZero α] {n : ℤ} : (n : α) = 0 ↔ n = 0 :=
  ⟨fun h => by
    

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : AddGroupWithOne α
inst✝ : CharZero α
n : ℤ
h : ↑n = 0
⊢ n = 0

Next tactic:
cases n
@[simp]
theorem cast_eq_zero [AddGroupWithOne α] [CharZero α] {n : ℤ} : (n : α) = 0 ↔ n = 0 :=
  ⟨fun h => by
    cases n
    · 

Proof state:
case ofNat
α : Type u_1
β : Type u_2
inst✝¹ : AddGroupWithOne α
inst✝ : CharZero α
a✝ : ℕ
h : ↑(ofNat a✝) = 0
⊢ ofNat a✝ = 0

Next tactic:
erw [Int.cast_ofNat] at h