Theorem: MvQPF.Fix.rec_eq
File: Mathlib/Data/QPF/Multivariate/Constructions/Fix.lean

tactic: have : recF g ∘ fixToW = Fix.rec g := by
  apply funext
  apply Quotient.ind
  intro x
  apply recF_eq_of_wEquiv
  apply wrepr_equiv
state_before: n : ℕ
F : TypeVec (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec n
β : Type u
g : F (α ::: β) → β
x : F (α ::: Fix F α)
⊢ rec g (mk x) = g ((TypeVec.id ::: rec g) <$$> x)

tactic: conv =>
  lhs
  rw [Fix.rec, Fix.mk]
  dsimp
state_before: n : ℕ
F : TypeVec (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec n
β : Type u
g : F (α ::: β) → β
x : F (α ::: Fix F α)
this : recF g ∘ fixToW = rec g
⊢ rec g (mk x) = g ((TypeVec.id ::: rec g) <$$> x)

tactic: cases' h : repr x with a f
state_before: n : ℕ
F : TypeVec (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec n
β : Type u
g : F (α ::: β) → β
x : F (α ::: Fix F α)
this : recF g ∘ fixToW = rec g
⊢ recF g (MvPFunctor.wMk' (P F) ((TypeVec.id ::: fixToW) <$$> repr x)) = g ((TypeVec.id ::: rec g) <$$> x)

tactic: rw [MvPFunctor.map_eq, recF_eq', ← MvPFunctor.map_eq, MvPFunctor.wDest'_wMk']
state_before: case mk
n : ℕ
F : TypeVec (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec n
β : Type u
g : F (α ::: β) → β
x : F (α ::: Fix F α)
this : recF g ∘ fixToW = rec g
a : (P F).A
f : MvPFunctor.B (P F) a ⟹ α ::: Fix F α
h : repr x = { fst := a, snd := f }
⊢ recF g (MvPFunctor.wMk' (P F) ((TypeVec.id ::: fixToW) <$$> { fst := a, snd := f })) =
    g ((TypeVec.id ::: rec g) <$$> x)

tactic: rw [← MvPFunctor.comp_map, abs_map, ← h, abs_repr, ← appendFun_comp, id_comp, this]
state_before: case mk
n : ℕ
F : TypeVec (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec n
β : Type u
g : F (α ::: β) → β
x : F (α ::: Fix F α)
this : recF g ∘ fixToW = rec g
a : (P F).A
f : MvPFunctor.B (P F) a ⟹ α ::: Fix F α
h : repr x = { fst := a, snd := f }
⊢ g (abs ((TypeVec.id ::: recF g) <$$> (TypeVec.id ::: fixToW) <$$> { fst := a, snd := f })) =
    g ((TypeVec.id ::: rec g) <$$> x)

tactic: apply funext
state_before: n : ℕ
F : TypeVec (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec n
β : Type u
g : F (α ::: β) → β
x : F (α ::: Fix F α)
⊢ recF g ∘ fixToW = rec g

tactic: apply Quotient.ind
state_before: case h
n : ℕ
F : TypeVec (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec n
β : Type u
g : F (α ::: β) → β
x : F (α ::: Fix F α)
⊢ ∀ (x : Fix F α), (recF g ∘ fixToW) x = rec g x

tactic: intro x
state_before: case h.a
n : ℕ
F : TypeVec (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec n
β : Type u
g : F (α ::: β) → β
x : F (α ::: Fix F α)
⊢ ∀ (a : MvPFunctor.W (P F) α), (recF g ∘ fixToW) (Quotient.mk (wSetoid α) a) = rec g (Quotient.mk (wSetoid α) a)

tactic: apply recF_eq_of_wEquiv
state_before: case h.a
n : ℕ
F : TypeVec (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec n
β : Type u
g : F (α ::: β) → β
x✝ : F (α ::: Fix F α)
x : MvPFunctor.W (P F) α
⊢ (recF g ∘ fixToW) (Quotient.mk (wSetoid α) x) = rec g (Quotient.mk (wSetoid α) x)

tactic: apply wrepr_equiv
state_before: case h.a.a
n : ℕ
F : TypeVec (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec n
β : Type u
g : F (α ::: β) → β
x✝ : F (α ::: Fix F α)
x : MvPFunctor.W (P F) α
⊢ WEquiv (fixToW (Quotient.mk (wSetoid α) x)) x