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

tactic: apply Quot.ind
state_before: n : ℕ
F : TypeVec (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec n
β : Type u
g₁ g₂ : Fix F α → β
h : ∀ (x : F (α ::: Fix F α)), (TypeVec.id ::: g₁) <$$> x = (TypeVec.id ::: g₂) <$$> x → g₁ (mk x) = g₂ (mk x)
⊢ ∀ (x : Fix F α), g₁ x = g₂ x

tactic: intro x
state_before: case mk
n : ℕ
F : TypeVec (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec n
β : Type u
g₁ g₂ : Fix F α → β
h : ∀ (x : F (α ::: Fix F α)), (TypeVec.id ::: g₁) <$$> x = (TypeVec.id ::: g₂) <$$> x → g₁ (mk x) = g₂ (mk x)
⊢ ∀ (a : MvPFunctor.W (P F) α), g₁ (Quot.mk Setoid.r a) = g₂ (Quot.mk Setoid.r a)

tactic: apply q.P.w_ind _ x
state_before: case mk
n : ℕ
F : TypeVec (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec n
β : Type u
g₁ g₂ : Fix F α → β
h : ∀ (x : F (α ::: Fix F α)), (TypeVec.id ::: g₁) <$$> x = (TypeVec.id ::: g₂) <$$> x → g₁ (mk x) = g₂ (mk x)
x : MvPFunctor.W (P F) α
⊢ g₁ (Quot.mk Setoid.r x) = g₂ (Quot.mk Setoid.r x)

tactic: intro a f' f ih
state_before: n : ℕ
F : TypeVec (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec n
β : Type u
g₁ g₂ : Fix F α → β
h : ∀ (x : F (α ::: Fix F α)), (TypeVec.id ::: g₁) <$$> x = (TypeVec.id ::: g₂) <$$> x → g₁ (mk x) = g₂ (mk x)
x : MvPFunctor.W (P F) α
⊢ ∀ (a : (P F).A) (f' : MvPFunctor.B (MvPFunctor.drop (P F)) a ⟹ α)
    (f : PFunctor.B (MvPFunctor.last (P F)) a → MvPFunctor.W (P F) α),
    (∀ (i : PFunctor.B (MvPFunctor.last (P F)) a), g₁ (Quot.mk Setoid.r (f i)) = g₂ (Quot.mk Setoid.r (f i))) →
      g₁ (Quot.mk Setoid.r (MvPFunctor.wMk (P F) a f' f)) = g₂ (Quot.mk Setoid.r (MvPFunctor.wMk (P F) a f' f))

tactic: show g₁ ⟦q.P.wMk a f' f⟧ = g₂ ⟦q.P.wMk a f' f⟧
state_before: n : ℕ
F : TypeVec (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec n
β : Type u
g₁ g₂ : Fix F α → β
h : ∀ (x : F (α ::: Fix F α)), (TypeVec.id ::: g₁) <$$> x = (TypeVec.id ::: g₂) <$$> x → g₁ (mk x) = g₂ (mk x)
x : MvPFunctor.W (P F) α
a : (P F).A
f' : MvPFunctor.B (MvPFunctor.drop (P F)) a ⟹ α
f : PFunctor.B (MvPFunctor.last (P F)) a → MvPFunctor.W (P F) α
ih : ∀ (i : PFunctor.B (MvPFunctor.last (P F)) a), g₁ (Quot.mk Setoid.r (f i)) = g₂ (Quot.mk Setoid.r (f i))
⊢ g₁ (Quot.mk Setoid.r (MvPFunctor.wMk (P F) a f' f)) = g₂ (Quot.mk Setoid.r (MvPFunctor.wMk (P F) a f' f))

tactic: rw [← Fix.ind_aux a f' f]
state_before: n : ℕ
F : TypeVec (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec n
β : Type u
g₁ g₂ : Fix F α → β
h : ∀ (x : F (α ::: Fix F α)), (TypeVec.id ::: g₁) <$$> x = (TypeVec.id ::: g₂) <$$> x → g₁ (mk x) = g₂ (mk x)
x : MvPFunctor.W (P F) α
a : (P F).A
f' : MvPFunctor.B (MvPFunctor.drop (P F)) a ⟹ α
f : PFunctor.B (MvPFunctor.last (P F)) a → MvPFunctor.W (P F) α
ih : ∀ (i : PFunctor.B (MvPFunctor.last (P F)) a), g₁ (Quot.mk Setoid.r (f i)) = g₂ (Quot.mk Setoid.r (f i))
⊢ g₁ (Quotient.mk (wSetoid α) (MvPFunctor.wMk (P F) a f' f)) =
    g₂ (Quotient.mk (wSetoid α) (MvPFunctor.wMk (P F) a f' f))

tactic: apply h
state_before: n : ℕ
F : TypeVec (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec n
β : Type u
g₁ g₂ : Fix F α → β
h : ∀ (x : F (α ::: Fix F α)), (TypeVec.id ::: g₁) <$$> x = (TypeVec.id ::: g₂) <$$> x → g₁ (mk x) = g₂ (mk x)
x : MvPFunctor.W (P F) α
a : (P F).A
f' : MvPFunctor.B (MvPFunctor.drop (P F)) a ⟹ α
f : PFunctor.B (MvPFunctor.last (P F)) a → MvPFunctor.W (P F) α
ih : ∀ (i : PFunctor.B (MvPFunctor.last (P F)) a), g₁ (Quot.mk Setoid.r (f i)) = g₂ (Quot.mk Setoid.r (f i))
⊢ g₁ (mk (abs { fst := a, snd := MvPFunctor.appendContents (P F) f' fun x => Quotient.mk (wSetoid α) (f x) })) =
    g₂ (mk (abs { fst := a, snd := MvPFunctor.appendContents (P F) f' fun x => Quotient.mk (wSetoid α) (f x) }))

tactic: rw [← abs_map, ← abs_map, MvPFunctor.map_eq, MvPFunctor.map_eq]
state_before: case a
n : ℕ
F : TypeVec (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec n
β : Type u
g₁ g₂ : Fix F α → β
h : ∀ (x : F (α ::: Fix F α)), (TypeVec.id ::: g₁) <$$> x = (TypeVec.id ::: g₂) <$$> x → g₁ (mk x) = g₂ (mk x)
x : MvPFunctor.W (P F) α
a : (P F).A
f' : MvPFunctor.B (MvPFunctor.drop (P F)) a ⟹ α
f : PFunctor.B (MvPFunctor.last (P F)) a → MvPFunctor.W (P F) α
ih : ∀ (i : PFunctor.B (MvPFunctor.last (P F)) a), g₁ (Quot.mk Setoid.r (f i)) = g₂ (Quot.mk Setoid.r (f i))
⊢ (TypeVec.id ::: g₁) <$$>
      abs { fst := a, snd := MvPFunctor.appendContents (P F) f' fun x => Quotient.mk (wSetoid α) (f x) } =
    (TypeVec.id ::: g₂) <$$>
      abs { fst := a, snd := MvPFunctor.appendContents (P F) f' fun x => Quotient.mk (wSetoid α) (f x) }

tactic: congr 2
state_before: case a
n : ℕ
F : TypeVec (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec n
β : Type u
g₁ g₂ : Fix F α → β
h : ∀ (x : F (α ::: Fix F α)), (TypeVec.id ::: g₁) <$$> x = (TypeVec.id ::: g₂) <$$> x → g₁ (mk x) = g₂ (mk x)
x : MvPFunctor.W (P F) α
a : (P F).A
f' : MvPFunctor.B (MvPFunctor.drop (P F)) a ⟹ α
f : PFunctor.B (MvPFunctor.last (P F)) a → MvPFunctor.W (P F) α
ih : ∀ (i : PFunctor.B (MvPFunctor.last (P F)) a), g₁ (Quot.mk Setoid.r (f i)) = g₂ (Quot.mk Setoid.r (f i))
⊢ abs
      { fst := a,
        snd := (TypeVec.id ::: g₁) ⊚ MvPFunctor.appendContents (P F) f' fun x => Quotient.mk (wSetoid α) (f x) } =
    abs
      { fst := a,
        snd := (TypeVec.id ::: g₂) ⊚ MvPFunctor.appendContents (P F) f' fun x => Quotient.mk (wSetoid α) (f x) }

tactic: rw [MvPFunctor.appendContents, appendFun, appendFun, ← splitFun_comp, ← splitFun_comp]
state_before: case a.e_a.e_snd
n : ℕ
F : TypeVec (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec n
β : Type u
g₁ g₂ : Fix F α → β
h : ∀ (x : F (α ::: Fix F α)), (TypeVec.id ::: g₁) <$$> x = (TypeVec.id ::: g₂) <$$> x → g₁ (mk x) = g₂ (mk x)
x : MvPFunctor.W (P F) α
a : (P F).A
f' : MvPFunctor.B (MvPFunctor.drop (P F)) a ⟹ α
f : PFunctor.B (MvPFunctor.last (P F)) a → MvPFunctor.W (P F) α
ih : ∀ (i : PFunctor.B (MvPFunctor.last (P F)) a), g₁ (Quot.mk Setoid.r (f i)) = g₂ (Quot.mk Setoid.r (f i))
⊢ ((TypeVec.id ::: g₁) ⊚ MvPFunctor.appendContents (P F) f' fun x => Quotient.mk (wSetoid α) (f x)) =
    (TypeVec.id ::: g₂) ⊚ MvPFunctor.appendContents (P F) f' fun x => Quotient.mk (wSetoid α) (f x)

tactic: have : (g₁ ∘ fun x => ⟦f x⟧) = g₂ ∘ fun x => ⟦f x⟧ := by
  ext x
  exact ih x
state_before: case a.e_a.e_snd
n : ℕ
F : TypeVec (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec n
β : Type u
g₁ g₂ : Fix F α → β
h : ∀ (x : F (α ::: Fix F α)), (TypeVec.id ::: g₁) <$$> x = (TypeVec.id ::: g₂) <$$> x → g₁ (mk x) = g₂ (mk x)
x : MvPFunctor.W (P F) α
a : (P F).A
f' : MvPFunctor.B (MvPFunctor.drop (P F)) a ⟹ α
f : PFunctor.B (MvPFunctor.last (P F)) a → MvPFunctor.W (P F) α
ih : ∀ (i : PFunctor.B (MvPFunctor.last (P F)) a), g₁ (Quot.mk Setoid.r (f i)) = g₂ (Quot.mk Setoid.r (f i))
⊢ splitFun (TypeVec.id ⊚ f') (g₁ ∘ fun x => Quotient.mk (wSetoid α) (f x)) =
    splitFun (TypeVec.id ⊚ f') (g₂ ∘ fun x => Quotient.mk (wSetoid α) (f x))

tactic: rw [this]
state_before: case a.e_a.e_snd
n : ℕ
F : TypeVec (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec n
β : Type u
g₁ g₂ : Fix F α → β
h : ∀ (x : F (α ::: Fix F α)), (TypeVec.id ::: g₁) <$$> x = (TypeVec.id ::: g₂) <$$> x → g₁ (mk x) = g₂ (mk x)
x : MvPFunctor.W (P F) α
a : (P F).A
f' : MvPFunctor.B (MvPFunctor.drop (P F)) a ⟹ α
f : PFunctor.B (MvPFunctor.last (P F)) a → MvPFunctor.W (P F) α
ih : ∀ (i : PFunctor.B (MvPFunctor.last (P F)) a), g₁ (Quot.mk Setoid.r (f i)) = g₂ (Quot.mk Setoid.r (f i))
this : (g₁ ∘ fun x => Quotient.mk (wSetoid α) (f x)) = g₂ ∘ fun x => Quotient.mk (wSetoid α) (f x)
⊢ splitFun (TypeVec.id ⊚ f') (g₁ ∘ fun x => Quotient.mk (wSetoid α) (f x)) =
    splitFun (TypeVec.id ⊚ f') (g₂ ∘ fun x => Quotient.mk (wSetoid α) (f x))

tactic: ext x
state_before: n : ℕ
F : TypeVec (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec n
β : Type u
g₁ g₂ : Fix F α → β
h : ∀ (x : F (α ::: Fix F α)), (TypeVec.id ::: g₁) <$$> x = (TypeVec.id ::: g₂) <$$> x → g₁ (mk x) = g₂ (mk x)
x : MvPFunctor.W (P F) α
a : (P F).A
f' : MvPFunctor.B (MvPFunctor.drop (P F)) a ⟹ α
f : PFunctor.B (MvPFunctor.last (P F)) a → MvPFunctor.W (P F) α
ih : ∀ (i : PFunctor.B (MvPFunctor.last (P F)) a), g₁ (Quot.mk Setoid.r (f i)) = g₂ (Quot.mk Setoid.r (f i))
⊢ (g₁ ∘ fun x => Quotient.mk (wSetoid α) (f x)) = g₂ ∘ fun x => Quotient.mk (wSetoid α) (f x)

tactic: exact ih x
state_before: case h
n : ℕ
F : TypeVec (n + 1) → Type u
inst✝ : MvFunctor F
q : MvQPF F
α : TypeVec n
β : Type u
g₁ g₂ : Fix F α → β
h : ∀ (x : F (α ::: Fix F α)), (TypeVec.id ::: g₁) <$$> x = (TypeVec.id ::: g₂) <$$> x → g₁ (mk x) = g₂ (mk x)
x✝ : MvPFunctor.W (P F) α
a : (P F).A
f' : MvPFunctor.B (MvPFunctor.drop (P F)) a ⟹ α
f : PFunctor.B (MvPFunctor.last (P F)) a → MvPFunctor.W (P F) α
ih : ∀ (i : PFunctor.B (MvPFunctor.last (P F)) a), g₁ (Quot.mk Setoid.r (f i)) = g₂ (Quot.mk Setoid.r (f i))
x : PFunctor.B (MvPFunctor.last (P F)) a
⊢ (g₁ ∘ fun x => Quotient.mk (wSetoid α) (f x)) x = (g₂ ∘ fun x => Quotient.mk (wSetoid α) (f x)) x