Theorem: PFunctor.M.mk_dest
File: Mathlib/Data/PFunctor/Univariate/M.lean

Proof steps:
state_before: F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
⊢ M.mk x.dest = x
state_after: case H
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
⊢ ∀ (i : ℕ), (M.mk x.dest).approx i = x.approx i
tactic: apply ext'
state_before: case H
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
⊢ ∀ (i : ℕ), (M.mk x.dest).approx i = x.approx i
state_after: case H
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
⊢ (M.mk x.dest).approx n = x.approx n
tactic: intro n
state_before: case H
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
⊢ (M.mk x.dest).approx n = x.approx n
state_after: case H
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
⊢ Approx.sMk x.dest n = x.approx n
tactic: dsimp only [M.mk]
state_before: case H
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
⊢ Approx.sMk x.dest n = x.approx n
state_after: case H.zero
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
⊢ Approx.sMk x.dest 0 = x.approx 0

case H.succ
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
a✝ : Approx.sMk x.dest n = x.approx n
⊢ Approx.sMk x.dest (n + 1) = x.approx (n + 1)
tactic: induction' n with n
state_before: case H.succ
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
a✝ : Approx.sMk x.dest n = x.approx n
⊢ Approx.sMk x.dest (n + 1) = x.approx (n + 1)
state_after: case H.succ
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
a✝ : Approx.sMk x.dest n = x.approx n
⊢ (CofixA.intro (head' (x.approx 1)) fun i => (x.children i).approx n) = x.approx (n + 1)
tactic: dsimp only [Approx.sMk, dest, head]
state_before: case H.succ
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
a✝ : Approx.sMk x.dest n = x.approx n
⊢ (CofixA.intro (head' (x.approx 1)) fun i => (x.children i).approx n) = x.approx (n + 1)
state_after: case H.succ.intro
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
a✝ : Approx.sMk x.dest n = x.approx n
hd : F.A
ch : F.B hd → CofixA F n
h : x.approx n.succ = CofixA.intro hd ch
⊢ (CofixA.intro (head' (x.approx 1)) fun i => (x.children i).approx n) = CofixA.intro hd ch
tactic: cases' h : x.approx (succ n) with _ hd ch
state_before: case H.succ.intro
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
a✝ : Approx.sMk x.dest n = x.approx n
hd : F.A
ch : F.B hd → CofixA F n
h : x.approx n.succ = CofixA.intro hd ch
h' : hd = head' (x.approx 1)
⊢ (CofixA.intro (head' (x.approx 1)) fun i => (x.children i).approx n) = CofixA.intro hd ch
state_after: case H.succ.intro
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
a✝ : Approx.sMk x.dest n = x.approx n
hd : F.A
h' : hd = head' (x.approx 1)
⊢ ∀ (ch : F.B hd → CofixA F n),
    x.approx n.succ = CofixA.intro hd ch →
      (CofixA.intro (head' (x.approx 1)) fun i => (x.children i).approx n) = CofixA.intro hd ch
tactic: revert ch
state_before: case H.succ.intro
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
a✝ : Approx.sMk x.dest n = x.approx n
hd : F.A
h' : hd = head' (x.approx 1)
⊢ ∀ (ch : F.B hd → CofixA F n),
    x.approx n.succ = CofixA.intro hd ch →
      (CofixA.intro (head' (x.approx 1)) fun i => (x.children i).approx n) = CofixA.intro hd ch
state_after: case H.succ.intro
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
a✝ : Approx.sMk x.dest n = x.approx n
hd : F.A
h' : hd = head' (x.approx 1)
⊢ ∀ (ch : F.B (head' (x.approx 1)) → CofixA F n),
    x.approx n.succ = CofixA.intro (head' (x.approx 1)) ch →
      (CofixA.intro (head' (x.approx 1)) fun i => (x.children i).approx n) = CofixA.intro (head' (x.approx 1)) ch
tactic: rw [h']
state_before: case H.succ.intro
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
a✝ : Approx.sMk x.dest n = x.approx n
hd : F.A
h' : hd = head' (x.approx 1)
⊢ ∀ (ch : F.B (head' (x.approx 1)) → CofixA F n),
    x.approx n.succ = CofixA.intro (head' (x.approx 1)) ch →
      (CofixA.intro (head' (x.approx 1)) fun i => (x.children i).approx n) = CofixA.intro (head' (x.approx 1)) ch
state_after: case H.succ.intro
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
a✝ : Approx.sMk x.dest n = x.approx n
hd : F.A
h' : hd = head' (x.approx 1)
ch : F.B (head' (x.approx 1)) → CofixA F n
h : x.approx n.succ = CofixA.intro (head' (x.approx 1)) ch
⊢ (CofixA.intro (head' (x.approx 1)) fun i => (x.children i).approx n) = CofixA.intro (head' (x.approx 1)) ch
tactic: intros ch h
state_before: case H.succ.intro
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
a✝ : Approx.sMk x.dest n = x.approx n
hd : F.A
h' : hd = head' (x.approx 1)
ch : F.B (head' (x.approx 1)) → CofixA F n
h : x.approx n.succ = CofixA.intro (head' (x.approx 1)) ch
⊢ (CofixA.intro (head' (x.approx 1)) fun i => (x.children i).approx n) = CofixA.intro (head' (x.approx 1)) ch
state_after: case H.succ.intro.e_a
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
a✝ : Approx.sMk x.dest n = x.approx n
hd : F.A
h' : hd = head' (x.approx 1)
ch : F.B (head' (x.approx 1)) → CofixA F n
h : x.approx n.succ = CofixA.intro (head' (x.approx 1)) ch
⊢ (fun i => (x.children i).approx n) = ch
tactic: congr
state_before: case H.succ.intro.e_a
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
a✝ : Approx.sMk x.dest n = x.approx n
hd : F.A
h' : hd = head' (x.approx 1)
ch : F.B (head' (x.approx 1)) → CofixA F n
h : x.approx n.succ = CofixA.intro (head' (x.approx 1)) ch
⊢ (fun i => (x.children i).approx n) = ch
state_after: case H.succ.intro.e_a.h
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
a✝ : Approx.sMk x.dest n = x.approx n
hd : F.A
h' : hd = head' (x.approx 1)
ch : F.B (head' (x.approx 1)) → CofixA F n
h : x.approx n.succ = CofixA.intro (head' (x.approx 1)) ch
a : F.B (head' (x.approx 1))
⊢ (x.children a).approx n = ch a
tactic: ext a
state_before: case H.succ.intro.e_a.h
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
a✝ : Approx.sMk x.dest n = x.approx n
hd : F.A
h' : hd = head' (x.approx 1)
ch : F.B (head' (x.approx 1)) → CofixA F n
h : x.approx n.succ = CofixA.intro (head' (x.approx 1)) ch
a : F.B (head' (x.approx 1))
⊢ (x.children a).approx n = ch a
state_after: case H.succ.intro.e_a.h
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
a✝ : Approx.sMk x.dest n = x.approx n
hd : F.A
h' : hd = head' (x.approx 1)
ch : F.B (head' (x.approx 1)) → CofixA F n
h : x.approx n.succ = CofixA.intro (head' (x.approx 1)) ch
a : F.B (head' (x.approx 1))
⊢ children' (x.approx n.succ) (cast ⋯ a) = ch a
tactic: dsimp only [children]
state_before: case H.succ.intro.e_a.h
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
a✝ : Approx.sMk x.dest n = x.approx n
hd : F.A
h' : hd = head' (x.approx 1)
ch : F.B (head' (x.approx 1)) → CofixA F n
h : x.approx n.succ = CofixA.intro (head' (x.approx 1)) ch
a : F.B (head' (x.approx 1))
⊢ children' (x.approx n.succ) (cast ⋯ a) = ch a
state_after: case H.succ.intro.e_a.h
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
a✝ : Approx.sMk x.dest n = x.approx n
hd : F.A
h' : hd = head' (x.approx 1)
ch : F.B (head' (x.approx 1)) → CofixA F n
h : x.approx n.succ = CofixA.intro (head' (x.approx 1)) ch
a : F.B (head' (x.approx 1))
a'' : F.B (head' (x.approx n.succ))
hh : cast ⋯ a = a''
⊢ children' (x.approx n.succ) a'' = ch a
tactic: generalize hh : cast _ a = a''
state_before: case H.succ.intro.e_a.h
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
a✝ : Approx.sMk x.dest n = x.approx n
hd : F.A
h' : hd = head' (x.approx 1)
ch : F.B (head' (x.approx 1)) → CofixA F n
h : x.approx n.succ = CofixA.intro (head' (x.approx 1)) ch
a : F.B (head' (x.approx 1))
a'' : F.B (head' (x.approx n.succ))
hh : cast ⋯ a = a''
⊢ children' (x.approx n.succ) a'' = ch a
state_after: case H.succ.intro.e_a.h
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
a✝ : Approx.sMk x.dest n = x.approx n
hd : F.A
h' : hd = head' (x.approx 1)
ch : F.B (head' (x.approx 1)) → CofixA F n
h : x.approx n.succ = CofixA.intro (head' (x.approx 1)) ch
a : F.B (head' (x.approx 1))
a'' : F.B (head' (x.approx n.succ))
hh : HEq a a''
⊢ children' (x.approx n.succ) a'' = ch a
tactic: rw [cast_eq_iff_heq] at hh
state_before: case H.succ.intro.e_a.h
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
a✝ : Approx.sMk x.dest n = x.approx n
hd : F.A
h' : hd = head' (x.approx 1)
ch : F.B (head' (x.approx 1)) → CofixA F n
h : x.approx n.succ = CofixA.intro (head' (x.approx 1)) ch
a : F.B (head' (x.approx 1))
a'' : F.B (head' (x.approx n.succ))
hh : HEq a a''
⊢ children' (x.approx n.succ) a'' = ch a
state_after: case H.succ.intro.e_a.h
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
a✝ : Approx.sMk x.dest n = x.approx n
hd : F.A
h' : hd = head' (x.approx 1)
ch : F.B (head' (x.approx 1)) → CofixA F n
h : x.approx n.succ = CofixA.intro (head' (x.approx 1)) ch
a : F.B (head' (x.approx 1))
⊢ ∀ (a'' : F.B (head' (x.approx n.succ))), HEq a a'' → children' (x.approx n.succ) a'' = ch a
tactic: revert a''
state_before: case H.succ.intro.e_a.h
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
a✝ : Approx.sMk x.dest n = x.approx n
hd : F.A
h' : hd = head' (x.approx 1)
ch : F.B (head' (x.approx 1)) → CofixA F n
h : x.approx n.succ = CofixA.intro (head' (x.approx 1)) ch
a : F.B (head' (x.approx 1))
⊢ ∀ (a'' : F.B (head' (x.approx n.succ))), HEq a a'' → children' (x.approx n.succ) a'' = ch a
state_after: case H.succ.intro.e_a.h
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
a✝ : Approx.sMk x.dest n = x.approx n
hd : F.A
h' : hd = head' (x.approx 1)
ch : F.B (head' (x.approx 1)) → CofixA F n
h : x.approx n.succ = CofixA.intro (head' (x.approx 1)) ch
a : F.B (head' (x.approx 1))
⊢ ∀ (a'' : F.B (head' (CofixA.intro (head' (x.approx 1)) ch))),
    HEq a a'' → children' (CofixA.intro (head' (x.approx 1)) ch) a'' = ch a
tactic: rw [h]
state_before: case H.succ.intro.e_a.h
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
a✝ : Approx.sMk x.dest n = x.approx n
hd : F.A
h' : hd = head' (x.approx 1)
ch : F.B (head' (x.approx 1)) → CofixA F n
h : x.approx n.succ = CofixA.intro (head' (x.approx 1)) ch
a : F.B (head' (x.approx 1))
⊢ ∀ (a'' : F.B (head' (CofixA.intro (head' (x.approx 1)) ch))),
    HEq a a'' → children' (CofixA.intro (head' (x.approx 1)) ch) a'' = ch a
state_after: case H.succ.intro.e_a.h
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
a✝ : Approx.sMk x.dest n = x.approx n
hd : F.A
h' : hd = head' (x.approx 1)
ch : F.B (head' (x.approx 1)) → CofixA F n
h : x.approx n.succ = CofixA.intro (head' (x.approx 1)) ch
a : F.B (head' (x.approx 1))
a''✝ : F.B (head' (CofixA.intro (head' (x.approx 1)) ch))
hh : HEq a a''✝
⊢ children' (CofixA.intro (head' (x.approx 1)) ch) a''✝ = ch a
tactic: intros _ hh
state_before: case H.succ.intro.e_a.h
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
a✝ : Approx.sMk x.dest n = x.approx n
hd : F.A
h' : hd = head' (x.approx 1)
ch : F.B (head' (x.approx 1)) → CofixA F n
h : x.approx n.succ = CofixA.intro (head' (x.approx 1)) ch
a : F.B (head' (x.approx 1))
a''✝ : F.B (head' (CofixA.intro (head' (x.approx 1)) ch))
hh : HEq a a''✝
⊢ children' (CofixA.intro (head' (x.approx 1)) ch) a''✝ = ch a
state_after: case H.succ.intro.e_a.h.refl
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
a✝ : Approx.sMk x.dest n = x.approx n
hd : F.A
h' : hd = head' (x.approx 1)
ch : F.B (head' (x.approx 1)) → CofixA F n
h : x.approx n.succ = CofixA.intro (head' (x.approx 1)) ch
a : F.B (head' (x.approx 1))
⊢ children' (CofixA.intro (head' (x.approx 1)) ch) a = ch a
tactic: cases hh
state_before: case H.succ.intro.e_a.h.refl
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : F.M
n : ℕ
a✝ : Approx.sMk x.dest n = x.approx n
hd : F.A
h' : hd = head' (x.approx 1)
ch : F.B (head' (x.approx 1)) → CofixA F n
h : x.approx n.succ = CofixA.intro (head' (x.approx 1)) ch
a : F.B (head' (x.approx 1))
⊢ children' (CofixA.intro (head' (x.approx 1)) ch) a = ch a
state_after: no goals
tactic: rfl