l3lab/ntp-mathlib huggingface dataset:
theorem Wequiv.symm (x y : q.P.W) : Wequiv x y → Wequiv y x := by
  intro h
  induction h
  case ind a f f' _ ih => exact Wequiv.ind _ _ _ ih
  

Proof state:
case abs
F : Type u → Type u
inst✝ : Functor F
q : QPF F
x y : PFunctor.W (P F)
a✝¹ : (P F).A
f✝ : PFunctor.B (P F) a✝¹ → PFunctor.W (P F)
a'✝ : (P F).A
f'✝ : PFunctor.B (P F) a'✝ → PFunctor.W (P F)
a✝ : QPF.abs { fst := a✝¹, snd := f✝ } = QPF.abs { fst := a'✝, snd := f'✝ }
⊢ Wequiv (WType.mk a'✝ f'✝) (WType.mk a✝¹ f✝)
case trans
F : Type u → Type u
inst✝ : Functor F
q : QPF F
x y u✝ v✝ w✝ : PFunctor.W (P F)
a✝¹ : Wequiv u✝ v✝
a✝ : Wequiv v✝ w✝
a_ih✝¹ : Wequiv v✝ u✝
a_ih✝ : Wequiv w✝ v✝
⊢ Wequiv w✝ u✝

Next tactic:
case abs a f a' f' h => exact Wequiv.abs _ _ _ _ h.symm
theorem Wequiv.symm (x y : q.P.W) : Wequiv x y → Wequiv y x := by
  intro h
  induction h
  case ind a f f' _ ih => exact Wequiv.ind _ _ _ ih
  

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
x y : PFunctor.W (P F)
a : (P F).A
f : PFunctor.B (P F) a → PFunctor.W (P F)
a' : (P F).A
f' : PFunctor.B (P F) a' → PFunctor.W (P F)
h : QPF.abs { fst := a, snd := f } = QPF.abs { fst := a', snd := f' }
⊢ Wequiv (WType.mk a' f') (WType.mk a f)

Next tactic:
case abs a f a' f' h => exact Wequiv.abs _ _ _ _ h.symm
theorem Wequiv.symm (x y : q.P.W) : Wequiv x y → Wequiv y x := by
  intro h
  induction h
  case ind a f f' _ ih => exact Wequiv.ind _ _ _ ih
  case abs a f a' f' h => 

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
x y : PFunctor.W (P F)
a : (P F).A
f : PFunctor.B (P F) a → PFunctor.W (P F)
a' : (P F).A
f' : PFunctor.B (P F) a' → PFunctor.W (P F)
h : QPF.abs { fst := a, snd := f } = QPF.abs { fst := a', snd := f' }
⊢ Wequiv (WType.mk a' f') (WType.mk a f)

Next tactic:
exact Wequiv.abs _ _ _ _ h.symm
theorem Wequiv.symm (x y : q.P.W) : Wequiv x y → Wequiv y x := by
  intro h
  induction h
  case ind a f f' _ ih => exact Wequiv.ind _ _ _ ih
  case abs a f a' f' h => exact Wequiv.abs _ _ _ _ h.symm
  

Proof state:
case trans
F : Type u → Type u
inst✝ : Functor F
q : QPF F
x y u✝ v✝ w✝ : PFunctor.W (P F)
a✝¹ : Wequiv u✝ v✝
a✝ : Wequiv v✝ w✝
a_ih✝¹ : Wequiv v✝ u✝
a_ih✝ : Wequiv w✝ v✝
⊢ Wequiv w✝ u✝

Next tactic:
case trans x y z _ _ ih₁ ih₂ => exact QPF.Wequiv.trans _ _ _ ih₂ ih₁
theorem Wequiv.symm (x y : q.P.W) : Wequiv x y → Wequiv y x := by
  intro h
  induction h
  case ind a f f' _ ih => exact Wequiv.ind _ _ _ ih
  case abs a f a' f' h => exact Wequiv.abs _ _ _ _ h.symm
  

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
x✝ y✝ x y z : PFunctor.W (P F)
a✝¹ : Wequiv x y
a✝ : Wequiv y z
ih₁ : Wequiv y x
ih₂ : Wequiv z y
⊢ Wequiv z x

Next tactic:
case trans x y z _ _ ih₁ ih₂ => exact QPF.Wequiv.trans _ _ _ ih₂ ih₁
theorem Wequiv.symm (x y : q.P.W) : Wequiv x y → Wequiv y x := by
  intro h
  induction h
  case ind a f f' _ ih => exact Wequiv.ind _ _ _ ih
  case abs a f a' f' h => exact Wequiv.abs _ _ _ _ h.symm
  case trans x y z _ _ ih₁ ih₂ => 

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
x✝ y✝ x y z : PFunctor.W (P F)
a✝¹ : Wequiv x y
a✝ : Wequiv y z
ih₁ : Wequiv y x
ih₂ : Wequiv z y
⊢ Wequiv z x

Next tactic:
exact QPF.Wequiv.trans _ _ _ ih₂ ih₁
theorem Wrepr_equiv (x : q.P.W) : Wequiv (Wrepr x) x := by
  

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
x : PFunctor.W (P F)
⊢ Wequiv (Wrepr x) x

Next tactic:
induction' x with a f ih
theorem Wrepr_equiv (x : q.P.W) : Wequiv (Wrepr x) x := by
  induction' x with a f ih
  

Proof state:
case mk
F : Type u → Type u
inst✝ : Functor F
q : QPF F
a : (P F).A
f : PFunctor.B (P F) a → WType (P F).B
ih : ∀ (a : PFunctor.B (P F) a), Wequiv (Wrepr (f a)) (f a)
⊢ Wequiv (Wrepr (WType.mk a f)) (WType.mk a f)

Next tactic:
apply Wequiv.trans
theorem Wrepr_equiv (x : q.P.W) : Wequiv (Wrepr x) x := by
  induction' x with a f ih
  apply Wequiv.trans
  · 

Proof state:
case mk.a
F : Type u → Type u
inst✝ : Functor F
q : QPF F
a : (P F).A
f : PFunctor.B (P F) a → WType (P F).B
ih : ∀ (a : PFunctor.B (P F) a), Wequiv (Wrepr (f a)) (f a)
⊢ Wequiv (Wrepr (WType.mk a f)) ?mk.v

Next tactic:
change Wequiv (Wrepr ⟨a, f⟩) (PFunctor.W.mk (q.P.map Wrepr ⟨a, f⟩))
theorem Wrepr_equiv (x : q.P.W) : Wequiv (Wrepr x) x := by
  induction' x with a f ih
  apply Wequiv.trans
  · change Wequiv (Wrepr ⟨a, f⟩) (PFunctor.W.mk (q.P.map Wrepr ⟨a, f⟩))
    

Proof state:
case mk.a
F : Type u → Type u
inst✝ : Functor F
q : QPF F
a : (P F).A
f : PFunctor.B (P F) a → WType (P F).B
ih : ∀ (a : PFunctor.B (P F) a), Wequiv (Wrepr (f a)) (f a)
⊢ Wequiv (Wrepr (WType.mk a f)) (PFunctor.W.mk (PFunctor.map (P F) Wrepr { fst := a, snd := f }))

Next tactic:
apply Wequiv.abs'
theorem Wrepr_equiv (x : q.P.W) : Wequiv (Wrepr x) x := by
  induction' x with a f ih
  apply Wequiv.trans
  · change Wequiv (Wrepr ⟨a, f⟩) (PFunctor.W.mk (q.P.map Wrepr ⟨a, f⟩))
    apply Wequiv.abs'
    

Proof state:
case mk.a.h
F : Type u → Type u
inst✝ : Functor F
q : QPF F
a : (P F).A
f : PFunctor.B (P F) a → WType (P F).B
ih : ∀ (a : PFunctor.B (P F) a), Wequiv (Wrepr (f a)) (f a)
⊢ abs (PFunctor.W.dest (Wrepr (WType.mk a f))) =
    abs (PFunctor.W.dest (PFunctor.W.mk (PFunctor.map (P F) Wrepr { fst := a, snd := f })))

Next tactic:
have : Wrepr ⟨a, f⟩ = PFunctor.W.mk (repr (abs (q.P.map Wrepr ⟨a, f⟩))) := rfl
theorem Wrepr_equiv (x : q.P.W) : Wequiv (Wrepr x) x := by
  induction' x with a f ih
  apply Wequiv.trans
  · change Wequiv (Wrepr ⟨a, f⟩) (PFunctor.W.mk (q.P.map Wrepr ⟨a, f⟩))
    apply Wequiv.abs'
    have : Wrepr ⟨a, f⟩ = PFunctor.W.mk (repr (abs (q.P.map Wrepr ⟨a, f⟩))) := rfl
    

Proof state:
case mk.a.h
F : Type u → Type u
inst✝ : Functor F
q : QPF F
a : (P F).A
f : PFunctor.B (P F) a → WType (P F).B
ih : ∀ (a : PFunctor.B (P F) a), Wequiv (Wrepr (f a)) (f a)
this : Wrepr (WType.mk a f) = PFunctor.W.mk (repr (abs (PFunctor.map (P F) Wrepr { fst := a, snd := f })))
⊢ abs (PFunctor.W.dest (Wrepr (WType.mk a f))) =
    abs (PFunctor.W.dest (PFunctor.W.mk (PFunctor.map (P F) Wrepr { fst := a, snd := f })))

Next tactic:
rw [this, PFunctor.W.dest_mk, abs_repr]
theorem Wrepr_equiv (x : q.P.W) : Wequiv (Wrepr x) x := by
  induction' x with a f ih
  apply Wequiv.trans
  · change Wequiv (Wrepr ⟨a, f⟩) (PFunctor.W.mk (q.P.map Wrepr ⟨a, f⟩))
    apply Wequiv.abs'
    have : Wrepr ⟨a, f⟩ = PFunctor.W.mk (repr (abs (q.P.map Wrepr ⟨a, f⟩))) := rfl
    rw [this, PFunctor.W.dest_mk, abs_repr]
    

Proof state:
case mk.a.h
F : Type u → Type u
inst✝ : Functor F
q : QPF F
a : (P F).A
f : PFunctor.B (P F) a → WType (P F).B
ih : ∀ (a : PFunctor.B (P F) a), Wequiv (Wrepr (f a)) (f a)
this : Wrepr (WType.mk a f) = PFunctor.W.mk (repr (abs (PFunctor.map (P F) Wrepr { fst := a, snd := f })))
⊢ abs (PFunctor.map (P F) Wrepr { fst := a, snd := f }) =
    abs (PFunctor.W.dest (PFunctor.W.mk (PFunctor.map (P F) Wrepr { fst := a, snd := f })))

Next tactic:
rfl
theorem Wrepr_equiv (x : q.P.W) : Wequiv (Wrepr x) x := by
  induction' x with a f ih
  apply Wequiv.trans
  · change Wequiv (Wrepr ⟨a, f⟩) (PFunctor.W.mk (q.P.map Wrepr ⟨a, f⟩))
    apply Wequiv.abs'
    have : Wrepr ⟨a, f⟩ = PFunctor.W.mk (repr (abs (q.P.map Wrepr ⟨a, f⟩))) := rfl
    rw [this, PFunctor.W.dest_mk, abs_repr]
    rfl
  

Proof state:
case mk.a
F : Type u → Type u
inst✝ : Functor F
q : QPF F
a : (P F).A
f : PFunctor.B (P F) a → WType (P F).B
ih : ∀ (a : PFunctor.B (P F) a), Wequiv (Wrepr (f a)) (f a)
⊢ Wequiv (PFunctor.W.mk (PFunctor.map (P F) Wrepr { fst := a, snd := f })) (WType.mk a f)

Next tactic:
apply Wequiv.ind
theorem Wrepr_equiv (x : q.P.W) : Wequiv (Wrepr x) x := by
  induction' x with a f ih
  apply Wequiv.trans
  · change Wequiv (Wrepr ⟨a, f⟩) (PFunctor.W.mk (q.P.map Wrepr ⟨a, f⟩))
    apply Wequiv.abs'
    have : Wrepr ⟨a, f⟩ = PFunctor.W.mk (repr (abs (q.P.map Wrepr ⟨a, f⟩))) := rfl
    rw [this, PFunctor.W.dest_mk, abs_repr]
    rfl
  apply Wequiv.ind; 

Proof state:
case mk.a.a
F : Type u → Type u
inst✝ : Functor F
q : QPF F
a : (P F).A
f : PFunctor.B (P F) a → WType (P F).B
ih : ∀ (a : PFunctor.B (P F) a), Wequiv (Wrepr (f a)) (f a)
⊢ ∀ (x : PFunctor.B (P F) a), Wequiv ((Wrepr ∘ f) x) (f x)

Next tactic:
exact ih
theorem Fix.rec_eq {α : Type _} (g : F α → α) (x : F (Fix F)) :
    Fix.rec g (Fix.mk x) = g (Fix.rec g <$> x) := by
  

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
g : F α → α
x : F (Fix F)
⊢ rec g (mk x) = g (rec g <$> x)

Next tactic:
have : recF g ∘ fixToW = Fix.rec g := by
    apply funext
    apply Quotient.ind
    intro x
    apply recF_eq_of_Wequiv
    rw [fixToW]
    apply Wrepr_equiv
theorem Fix.rec_eq {α : Type _} (g : F α → α) (x : F (Fix F)) :
    Fix.rec g (Fix.mk x) = g (Fix.rec g <$> x) := by
  have : recF g ∘ fixToW = Fix.rec g := by
    

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
g : F α → α
x : F (Fix F)
⊢ recF g ∘ fixToW = rec g

Next tactic:
apply funext
theorem Fix.rec_eq {α : Type _} (g : F α → α) (x : F (Fix F)) :
    Fix.rec g (Fix.mk x) = g (Fix.rec g <$> x) := by
  have : recF g ∘ fixToW = Fix.rec g := by
    apply funext
    

Proof state:
case h
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
g : F α → α
x : F (Fix F)
⊢ ∀ (x : Fix F), (recF g ∘ fixToW) x = rec g x

Next tactic:
apply Quotient.ind
theorem Fix.rec_eq {α : Type _} (g : F α → α) (x : F (Fix F)) :
    Fix.rec g (Fix.mk x) = g (Fix.rec g <$> x) := by
  have : recF g ∘ fixToW = Fix.rec g := by
    apply funext
    apply Quotient.ind
    

Proof state:
case h.a
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
g : F α → α
x : F (Fix F)
⊢ ∀ (a : PFunctor.W (P F)), (recF g ∘ fixToW) ⟦a⟧ = rec g ⟦a⟧

Next tactic:
intro x
theorem Fix.rec_eq {α : Type _} (g : F α → α) (x : F (Fix F)) :
    Fix.rec g (Fix.mk x) = g (Fix.rec g <$> x) := by
  have : recF g ∘ fixToW = Fix.rec g := by
    apply funext
    apply Quotient.ind
    intro x
    

Proof state:
case h.a
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
g : F α → α
x✝ : F (Fix F)
x : PFunctor.W (P F)
⊢ (recF g ∘ fixToW) ⟦x⟧ = rec g ⟦x⟧

Next tactic:
apply recF_eq_of_Wequiv
theorem Fix.rec_eq {α : Type _} (g : F α → α) (x : F (Fix F)) :
    Fix.rec g (Fix.mk x) = g (Fix.rec g <$> x) := by
  have : recF g ∘ fixToW = Fix.rec g := by
    apply funext
    apply Quotient.ind
    intro x
    apply recF_eq_of_Wequiv
    

Proof state:
case h.a.a
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
g : F α → α
x✝ : F (Fix F)
x : PFunctor.W (P F)
⊢ Wequiv (fixToW ⟦x⟧) x

Next tactic:
rw [fixToW]
theorem Fix.rec_eq {α : Type _} (g : F α → α) (x : F (Fix F)) :
    Fix.rec g (Fix.mk x) = g (Fix.rec g <$> x) := by
  have : recF g ∘ fixToW = Fix.rec g := by
    apply funext
    apply Quotient.ind
    intro x
    apply recF_eq_of_Wequiv
    rw [fixToW]
    

Proof state:
case h.a.a
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
g : F α → α
x✝ : F (Fix F)
x : PFunctor.W (P F)
⊢ Wequiv
    (Quotient.lift Wrepr
      (_ :
        ∀ (x y : PFunctor.W (P F)),
          Wequiv x y → recF (fun x => PFunctor.W.mk (repr x)) x = recF (fun x => PFunctor.W.mk (repr x)) y)
      ⟦x⟧)
    x

Next tactic:
apply Wrepr_equiv
theorem Fix.rec_eq {α : Type _} (g : F α → α) (x : F (Fix F)) :
    Fix.rec g (Fix.mk x) = g (Fix.rec g <$> x) := by
  have : recF g ∘ fixToW = Fix.rec g := by
    apply funext
    apply Quotient.ind
    intro x
    apply recF_eq_of_Wequiv
    rw [fixToW]
    apply Wrepr_equiv
  

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
g : F α → α
x : F (Fix F)
this : recF g ∘ fixToW = rec g
⊢ rec g (mk x) = g (rec g <$> x)

Next tactic:
conv =>
    lhs
    rw [Fix.rec, Fix.mk]
    dsimp
theorem Fix.rec_eq {α : Type _} (g : F α → α) (x : F (Fix F)) :
    Fix.rec g (Fix.mk x) = g (Fix.rec g <$> x) := by
  have : recF g ∘ fixToW = Fix.rec g := by
    apply funext
    apply Quotient.ind
    intro x
    apply recF_eq_of_Wequiv
    rw [fixToW]
    apply Wrepr_equiv
  conv =>
    

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
g : F α → α
x : F (Fix F)
this : recF g ∘ fixToW = rec g
| rec g (mk x) = g (rec g <$> x)

Next tactic:
lhs
    rw [Fix.rec, Fix.mk]
    dsimp
theorem Fix.rec_eq {α : Type _} (g : F α → α) (x : F (Fix F)) :
    Fix.rec g (Fix.mk x) = g (Fix.rec g <$> x) := by
  have : recF g ∘ fixToW = Fix.rec g := by
    apply funext
    apply Quotient.ind
    intro x
    apply recF_eq_of_Wequiv
    rw [fixToW]
    apply Wrepr_equiv
  conv =>
    

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
g : F α → α
x : F (Fix F)
this : recF g ∘ fixToW = rec g
| rec g (mk x) = g (rec g <$> x)

Next tactic:
lhs
theorem Fix.rec_eq {α : Type _} (g : F α → α) (x : F (Fix F)) :
    Fix.rec g (Fix.mk x) = g (Fix.rec g <$> x) := by
  have : recF g ∘ fixToW = Fix.rec g := by
    apply funext
    apply Quotient.ind
    intro x
    apply recF_eq_of_Wequiv
    rw [fixToW]
    apply Wrepr_equiv
  conv =>
    lhs
    

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
g : F α → α
x : F (Fix F)
this : recF g ∘ fixToW = rec g
| rec g (mk x)

Next tactic:
rw [Fix.rec, Fix.mk]
theorem Fix.rec_eq {α : Type _} (g : F α → α) (x : F (Fix F)) :
    Fix.rec g (Fix.mk x) = g (Fix.rec g <$> x) := by
  have : recF g ∘ fixToW = Fix.rec g := by
    apply funext
    apply Quotient.ind
    intro x
    apply recF_eq_of_Wequiv
    rw [fixToW]
    apply Wrepr_equiv
  conv =>
    lhs
    rw [Fix.rec, Fix.mk]
    

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
g : F α → α
x : F (Fix F)
this : recF g ∘ fixToW = rec g
| Quot.lift (recF g) (_ : ∀ (x y : PFunctor.W (P F)), Wequiv x y → recF g x = recF g y)
    (Quot.mk Setoid.r (PFunctor.W.mk (PFunctor.map (P F) fixToW (repr x))))

Next tactic:
dsimp
theorem Fix.rec_eq {α : Type _} (g : F α → α) (x : F (Fix F)) :
    Fix.rec g (Fix.mk x) = g (Fix.rec g <$> x) := by
  have : recF g ∘ fixToW = Fix.rec g := by
    apply funext
    apply Quotient.ind
    intro x
    apply recF_eq_of_Wequiv
    rw [fixToW]
    apply Wrepr_equiv
  conv =>
    lhs
    rw [Fix.rec, Fix.mk]
    dsimp
  

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
g : F α → α
x : F (Fix F)
this : recF g ∘ fixToW = rec g
⊢ recF g (PFunctor.W.mk (PFunctor.map (P F) fixToW (repr x))) = g (rec g <$> x)

Next tactic:
cases' h : repr x with a f
theorem Fix.rec_eq {α : Type _} (g : F α → α) (x : F (Fix F)) :
    Fix.rec g (Fix.mk x) = g (Fix.rec g <$> x) := by
  have : recF g ∘ fixToW = Fix.rec g := by
    apply funext
    apply Quotient.ind
    intro x
    apply recF_eq_of_Wequiv
    rw [fixToW]
    apply Wrepr_equiv
  conv =>
    lhs
    rw [Fix.rec, Fix.mk]
    dsimp
  cases' h : repr x with a f
  

Proof state:
case mk
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
g : F α → α
x : F (Fix F)
this : recF g ∘ fixToW = rec g
a : (P F).A
f : PFunctor.B (P F) a → Fix F
h : repr x = { fst := a, snd := f }
⊢ recF g (PFunctor.W.mk (PFunctor.map (P F) fixToW { fst := a, snd := f })) = g (rec g <$> x)

Next tactic:
rw [PFunctor.map_eq, recF_eq, ← PFunctor.map_eq, PFunctor.W.dest_mk, PFunctor.map_map, abs_map,
    ← h, abs_repr, this]
theorem Fix.ind_aux (a : q.P.A) (f : q.P.B a → q.P.W) :
    Fix.mk (abs ⟨a, fun x => ⟦f x⟧⟩) = ⟦⟨a, f⟩⟧ := by
  

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
a : (P F).A
f : PFunctor.B (P F) a → PFunctor.W (P F)
⊢ mk (abs { fst := a, snd := fun x => ⟦f x⟧ }) = ⟦WType.mk a f⟧

Next tactic:
have : Fix.mk (abs ⟨a, fun x => ⟦f x⟧⟩) = ⟦Wrepr ⟨a, f⟩⟧ := by
    apply Quot.sound; apply Wequiv.abs'
    rw [PFunctor.W.dest_mk, abs_map, abs_repr, ← abs_map, PFunctor.map_eq]
    conv =>
      rhs
      simp only [Wrepr, recF_eq, PFunctor.W.dest_mk, abs_repr, Function.comp]
theorem Fix.ind_aux (a : q.P.A) (f : q.P.B a → q.P.W) :
    Fix.mk (abs ⟨a, fun x => ⟦f x⟧⟩) = ⟦⟨a, f⟩⟧ := by
  have : Fix.mk (abs ⟨a, fun x => ⟦f x⟧⟩) = ⟦Wrepr ⟨a, f⟩⟧ := by
    

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
a : (P F).A
f : PFunctor.B (P F) a → PFunctor.W (P F)
⊢ mk (abs { fst := a, snd := fun x => ⟦f x⟧ }) = ⟦Wrepr (WType.mk a f)⟧

Next tactic:
apply Quot.sound
theorem Fix.ind_aux (a : q.P.A) (f : q.P.B a → q.P.W) :
    Fix.mk (abs ⟨a, fun x => ⟦f x⟧⟩) = ⟦⟨a, f⟩⟧ := by
  have : Fix.mk (abs ⟨a, fun x => ⟦f x⟧⟩) = ⟦Wrepr ⟨a, f⟩⟧ := by
    apply Quot.sound; 

Proof state:
case a
F : Type u → Type u
inst✝ : Functor F
q : QPF F
a : (P F).A
f : PFunctor.B (P F) a → PFunctor.W (P F)
⊢ Setoid.r (PFunctor.W.mk (PFunctor.map (P F) fixToW (repr (abs { fst := a, snd := fun x => ⟦f x⟧ }))))
    (Wrepr (WType.mk a f))

Next tactic:
apply Wequiv.abs'
theorem Fix.ind_aux (a : q.P.A) (f : q.P.B a → q.P.W) :
    Fix.mk (abs ⟨a, fun x => ⟦f x⟧⟩) = ⟦⟨a, f⟩⟧ := by
  have : Fix.mk (abs ⟨a, fun x => ⟦f x⟧⟩) = ⟦Wrepr ⟨a, f⟩⟧ := by
    apply Quot.sound; apply Wequiv.abs'
    

Proof state:
case a.h
F : Type u → Type u
inst✝ : Functor F
q : QPF F
a : (P F).A
f : PFunctor.B (P F) a → PFunctor.W (P F)
⊢ abs (PFunctor.W.dest (PFunctor.W.mk (PFunctor.map (P F) fixToW (repr (abs { fst := a, snd := fun x => ⟦f x⟧ }))))) =
    abs (PFunctor.W.dest (Wrepr (WType.mk a f)))

Next tactic:
rw [PFunctor.W.dest_mk, abs_map, abs_repr, ← abs_map, PFunctor.map_eq]
theorem Fix.ind_aux (a : q.P.A) (f : q.P.B a → q.P.W) :
    Fix.mk (abs ⟨a, fun x => ⟦f x⟧⟩) = ⟦⟨a, f⟩⟧ := by
  have : Fix.mk (abs ⟨a, fun x => ⟦f x⟧⟩) = ⟦Wrepr ⟨a, f⟩⟧ := by
    apply Quot.sound; apply Wequiv.abs'
    rw [PFunctor.W.dest_mk, abs_map, abs_repr, ← abs_map, PFunctor.map_eq]
    

Proof state:
case a.h
F : Type u → Type u
inst✝ : Functor F
q : QPF F
a : (P F).A
f : PFunctor.B (P F) a → PFunctor.W (P F)
⊢ abs { fst := a, snd := fixToW ∘ fun x => ⟦f x⟧ } = abs (PFunctor.W.dest (Wrepr (WType.mk a f)))

Next tactic:
conv =>
      rhs
      simp only [Wrepr, recF_eq, PFunctor.W.dest_mk, abs_repr, Function.comp]
theorem Fix.ind_aux (a : q.P.A) (f : q.P.B a → q.P.W) :
    Fix.mk (abs ⟨a, fun x => ⟦f x⟧⟩) = ⟦⟨a, f⟩⟧ := by
  have : Fix.mk (abs ⟨a, fun x => ⟦f x⟧⟩) = ⟦Wrepr ⟨a, f⟩⟧ := by
    apply Quot.sound; apply Wequiv.abs'
    rw [PFunctor.W.dest_mk, abs_map, abs_repr, ← abs_map, PFunctor.map_eq]
    conv =>
      

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
a : (P F).A
f : PFunctor.B (P F) a → PFunctor.W (P F)
| abs { fst := a, snd := fixToW ∘ fun x => ⟦f x⟧ } = abs (PFunctor.W.dest (Wrepr (WType.mk a f)))

Next tactic:
rhs
      simp only [Wrepr, recF_eq, PFunctor.W.dest_mk, abs_repr, Function.comp]
theorem Fix.ind_aux (a : q.P.A) (f : q.P.B a → q.P.W) :
    Fix.mk (abs ⟨a, fun x => ⟦f x⟧⟩) = ⟦⟨a, f⟩⟧ := by
  have : Fix.mk (abs ⟨a, fun x => ⟦f x⟧⟩) = ⟦Wrepr ⟨a, f⟩⟧ := by
    apply Quot.sound; apply Wequiv.abs'
    rw [PFunctor.W.dest_mk, abs_map, abs_repr, ← abs_map, PFunctor.map_eq]
    conv =>
      

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
a : (P F).A
f : PFunctor.B (P F) a → PFunctor.W (P F)
| abs { fst := a, snd := fixToW ∘ fun x => ⟦f x⟧ } = abs (PFunctor.W.dest (Wrepr (WType.mk a f)))

Next tactic:
rhs
theorem Fix.ind_aux (a : q.P.A) (f : q.P.B a → q.P.W) :
    Fix.mk (abs ⟨a, fun x => ⟦f x⟧⟩) = ⟦⟨a, f⟩⟧ := by
  have : Fix.mk (abs ⟨a, fun x => ⟦f x⟧⟩) = ⟦Wrepr ⟨a, f⟩⟧ := by
    apply Quot.sound; apply Wequiv.abs'
    rw [PFunctor.W.dest_mk, abs_map, abs_repr, ← abs_map, PFunctor.map_eq]
    conv =>
      rhs
      

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
a : (P F).A
f : PFunctor.B (P F) a → PFunctor.W (P F)
| abs (PFunctor.W.dest (Wrepr (WType.mk a f)))

Next tactic:
simp only [Wrepr, recF_eq, PFunctor.W.dest_mk, abs_repr, Function.comp]
theorem Fix.ind_aux (a : q.P.A) (f : q.P.B a → q.P.W) :
    Fix.mk (abs ⟨a, fun x => ⟦f x⟧⟩) = ⟦⟨a, f⟩⟧ := by
  have : Fix.mk (abs ⟨a, fun x => ⟦f x⟧⟩) = ⟦Wrepr ⟨a, f⟩⟧ := by
    apply Quot.sound; apply Wequiv.abs'
    rw [PFunctor.W.dest_mk, abs_map, abs_repr, ← abs_map, PFunctor.map_eq]
    conv =>
      rhs
      simp only [Wrepr, recF_eq, PFunctor.W.dest_mk, abs_repr, Function.comp]
  

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
a : (P F).A
f : PFunctor.B (P F) a → PFunctor.W (P F)
this : mk (abs { fst := a, snd := fun x => ⟦f x⟧ }) = ⟦Wrepr (WType.mk a f)⟧
⊢ mk (abs { fst := a, snd := fun x => ⟦f x⟧ }) = ⟦WType.mk a f⟧

Next tactic:
rw [this]
theorem Fix.ind_aux (a : q.P.A) (f : q.P.B a → q.P.W) :
    Fix.mk (abs ⟨a, fun x => ⟦f x⟧⟩) = ⟦⟨a, f⟩⟧ := by
  have : Fix.mk (abs ⟨a, fun x => ⟦f x⟧⟩) = ⟦Wrepr ⟨a, f⟩⟧ := by
    apply Quot.sound; apply Wequiv.abs'
    rw [PFunctor.W.dest_mk, abs_map, abs_repr, ← abs_map, PFunctor.map_eq]
    conv =>
      rhs
      simp only [Wrepr, recF_eq, PFunctor.W.dest_mk, abs_repr, Function.comp]
  rw [this]
  

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
a : (P F).A
f : PFunctor.B (P F) a → PFunctor.W (P F)
this : mk (abs { fst := a, snd := fun x => ⟦f x⟧ }) = ⟦Wrepr (WType.mk a f)⟧
⊢ ⟦Wrepr (WType.mk a f)⟧ = ⟦WType.mk a f⟧

Next tactic:
apply Quot.sound
theorem Fix.ind_aux (a : q.P.A) (f : q.P.B a → q.P.W) :
    Fix.mk (abs ⟨a, fun x => ⟦f x⟧⟩) = ⟦⟨a, f⟩⟧ := by
  have : Fix.mk (abs ⟨a, fun x => ⟦f x⟧⟩) = ⟦Wrepr ⟨a, f⟩⟧ := by
    apply Quot.sound; apply Wequiv.abs'
    rw [PFunctor.W.dest_mk, abs_map, abs_repr, ← abs_map, PFunctor.map_eq]
    conv =>
      rhs
      simp only [Wrepr, recF_eq, PFunctor.W.dest_mk, abs_repr, Function.comp]
  rw [this]
  apply Quot.sound
  

Proof state:
case a
F : Type u → Type u
inst✝ : Functor F
q : QPF F
a : (P F).A
f : PFunctor.B (P F) a → PFunctor.W (P F)
this : mk (abs { fst := a, snd := fun x => ⟦f x⟧ }) = ⟦Wrepr (WType.mk a f)⟧
⊢ Setoid.r (Wrepr (WType.mk a f)) (WType.mk a f)

Next tactic:
apply Wrepr_equiv
theorem Fix.ind_rec {α : Type u} (g₁ g₂ : Fix F → α)
    (h : ∀ x : F (Fix F), g₁ <$> x = g₂ <$> x → g₁ (Fix.mk x) = g₂ (Fix.mk x)) :
    ∀ x, g₁ x = g₂ x := by
  

Proof state:
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
g₁ g₂ : Fix F → α
h : ∀ (x : F (Fix F)), g₁ <$> x = g₂ <$> x → g₁ (mk x) = g₂ (mk x)
⊢ ∀ (x : Fix F), g₁ x = g₂ x

Next tactic:
apply Quot.ind
theorem Fix.ind_rec {α : Type u} (g₁ g₂ : Fix F → α)
    (h : ∀ x : F (Fix F), g₁ <$> x = g₂ <$> x → g₁ (Fix.mk x) = g₂ (Fix.mk x)) :
    ∀ x, g₁ x = g₂ x := by
  apply Quot.ind
  

Proof state:
case mk
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
g₁ g₂ : Fix F → α
h : ∀ (x : F (Fix F)), g₁ <$> x = g₂ <$> x → g₁ (mk x) = g₂ (mk x)
⊢ ∀ (a : PFunctor.W (P F)), g₁ (Quot.mk Setoid.r a) = g₂ (Quot.mk Setoid.r a)

Next tactic:
intro x
theorem Fix.ind_rec {α : Type u} (g₁ g₂ : Fix F → α)
    (h : ∀ x : F (Fix F), g₁ <$> x = g₂ <$> x → g₁ (Fix.mk x) = g₂ (Fix.mk x)) :
    ∀ x, g₁ x = g₂ x := by
  apply Quot.ind
  intro x
  

Proof state:
case mk
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
g₁ g₂ : Fix F → α
h : ∀ (x : F (Fix F)), g₁ <$> x = g₂ <$> x → g₁ (mk x) = g₂ (mk x)
x : PFunctor.W (P F)
⊢ g₁ (Quot.mk Setoid.r x) = g₂ (Quot.mk Setoid.r x)

Next tactic:
induction' x with a f ih
theorem Fix.ind_rec {α : Type u} (g₁ g₂ : Fix F → α)
    (h : ∀ x : F (Fix F), g₁ <$> x = g₂ <$> x → g₁ (Fix.mk x) = g₂ (Fix.mk x)) :
    ∀ x, g₁ x = g₂ x := by
  apply Quot.ind
  intro x
  induction' x with a f ih
  

Proof state:
case mk.mk
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
g₁ g₂ : Fix F → α
h : ∀ (x : F (Fix F)), g₁ <$> x = g₂ <$> x → g₁ (mk x) = g₂ (mk x)
a : (P F).A
f : PFunctor.B (P F) a → WType (P F).B
ih : ∀ (a : PFunctor.B (P F) a), g₁ (Quot.mk Setoid.r (f a)) = g₂ (Quot.mk Setoid.r (f a))
⊢ g₁ (Quot.mk Setoid.r (WType.mk a f)) = g₂ (Quot.mk Setoid.r (WType.mk a f))

Next tactic:
change g₁ ⟦⟨a, f⟩⟧ = g₂ ⟦⟨a, f⟩⟧
theorem Fix.ind_rec {α : Type u} (g₁ g₂ : Fix F → α)
    (h : ∀ x : F (Fix F), g₁ <$> x = g₂ <$> x → g₁ (Fix.mk x) = g₂ (Fix.mk x)) :
    ∀ x, g₁ x = g₂ x := by
  apply Quot.ind
  intro x
  induction' x with a f ih
  change g₁ ⟦⟨a, f⟩⟧ = g₂ ⟦⟨a, f⟩⟧
  

Proof state:
case mk.mk
F : Type u → Type u
inst✝ : Functor F
q : QPF F
α : Type u
g₁ g₂ : Fix F → α
h : ∀ (x : F (Fix F)), g₁ <$> x = g₂ <$> x → g₁ (mk x) = g₂ (mk x)
a : (P F).A
f : PFunctor.B (P F) a → WType (P F).B
ih : ∀ (a : PFunctor.B (P F) a), g₁ (Quot.mk Setoid.r (f a)) = g₂ (Quot.mk Setoid.r (f a))
⊢ g₁ ⟦WType.mk a f⟧ = g₂ ⟦WType.mk a f⟧

Next tactic:
rw [← Fix.ind_aux a f]