l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem ichildren_mk [DecidableEq F.A] [Inhabited (M F)] (x : F (M F)) (i : F.Idx) :
    ichildren i (M.mk x) = x.iget i := by
  

Proof state:
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited (M F)
x : ↑F (M F)
i : Idx F
⊢ ichildren i (M.mk x) = Obj.iget x i

Next tactic:
dsimp only [ichildren, PFunctor.Obj.iget]
@[simp]
theorem ichildren_mk [DecidableEq F.A] [Inhabited (M F)] (x : F (M F)) (i : F.Idx) :
    ichildren i (M.mk x) = x.iget i := by
  dsimp only [ichildren, PFunctor.Obj.iget]
  

Proof state:
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited (M F)
x : ↑F (M F)
i : Idx F
⊢ (if H' : i.fst = head (M.mk x) then children (M.mk x) (cast (_ : B F i.fst = B F (head (M.mk x))) i.snd)
    else default) =
    if h : i.fst = x.fst then Sigma.snd x (cast (_ : B F i.fst = B F x.fst) i.snd) else default

Next tactic:
congr with h
@[simp]
theorem isubtree_cons [DecidableEq F.A] [Inhabited (M F)] (ps : Path F) {a} (f : F.B a → M F)
    {i : F.B a} : isubtree (⟨_, i⟩ :: ps) (M.mk ⟨a, f⟩) = isubtree ps (f i) := by
  

Proof state:
F : PFunctor.{u}
X : Type u_1
f✝ : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited (M F)
ps : Path F
a : F.A
f : B F a → M F
i : B F a
⊢ isubtree ({ fst := a, snd := i } :: ps) (M.mk { fst := a, snd := f }) = isubtree ps (f i)

Next tactic:
simp only [isubtree, ichildren_mk, PFunctor.Obj.iget, dif_pos, isubtree, M.casesOn_mk']
@[simp]
theorem isubtree_cons [DecidableEq F.A] [Inhabited (M F)] (ps : Path F) {a} (f : F.B a → M F)
    {i : F.B a} : isubtree (⟨_, i⟩ :: ps) (M.mk ⟨a, f⟩) = isubtree ps (f i) := by
  simp only [isubtree, ichildren_mk, PFunctor.Obj.iget, dif_pos, isubtree, M.casesOn_mk']; 

Proof state:
F : PFunctor.{u}
X : Type u_1
f✝ : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited (M F)
ps : Path F
a : F.A
f : B F a → M F
i : B F a
⊢ isubtree ps (f (cast (_ : B F a = B F a) i)) = isubtree ps (f i)

Next tactic:
rfl
@[simp]
theorem iselect_cons [DecidableEq F.A] [Inhabited (M F)] (ps : Path F) {a} (f : F.B a → M F) {i} :
    iselect (⟨a, i⟩ :: ps) (M.mk ⟨a, f⟩) = iselect ps (f i) := by 

Proof state:
F : PFunctor.{u}
X : Type u_1
f✝ : X → ↑F X
inst✝¹ : DecidableEq F.A
inst✝ : Inhabited (M F)
ps : Path F
a : F.A
f : B F a → M F
i : B F a
⊢ iselect ({ fst := a, snd := i } :: ps) (M.mk { fst := a, snd := f }) = iselect ps (f i)

Next tactic:
simp only [iselect, isubtree_cons]
theorem corec_def {X} (f : X → F X) (x₀ : X) : M.corec f x₀ = M.mk (F.map (M.corec f) (f x₀)) := by
  

Proof state:
F : PFunctor.{u}
X✝ : Type u_1
f✝ : X✝ → ↑F X✝
X : Type u_2
f : X → ↑F X
x₀ : X
⊢ M.corec f x₀ = M.mk (map F (M.corec f) (f x₀))

Next tactic:
dsimp only [M.corec, M.mk]
theorem corec_def {X} (f : X → F X) (x₀ : X) : M.corec f x₀ = M.mk (F.map (M.corec f) (f x₀)) := by
  dsimp only [M.corec, M.mk]
  

Proof state:
F : PFunctor.{u}
X✝ : Type u_1
f✝ : X✝ → ↑F X✝
X : Type u_2
f : X → ↑F X
x₀ : X
⊢ { approx := sCorec f x₀, consistent := (_ : ∀ (n : ℕ), Agree (sCorec f x₀ n) (sCorec f x₀ (succ n))) } =
    { approx := Approx.sMk (map F (M.corec f) (f x₀)),
      consistent := (_ : AllAgree (Approx.sMk (map F (M.corec f) (f x₀)))) }

Next tactic:
congr with n
theorem corec_def {X} (f : X → F X) (x₀ : X) : M.corec f x₀ = M.mk (F.map (M.corec f) (f x₀)) := by
  dsimp only [M.corec, M.mk]
  congr with n
  

Proof state:
case e_approx.h
F : PFunctor.{u}
X✝ : Type u_1
f✝ : X✝ → ↑F X✝
X : Type u_2
f : X → ↑F X
x₀ : X
n : ℕ
⊢ sCorec f x₀ n = Approx.sMk (map F (M.corec f) (f x₀)) n

Next tactic:
cases' n with n
theorem corec_def {X} (f : X → F X) (x₀ : X) : M.corec f x₀ = M.mk (F.map (M.corec f) (f x₀)) := by
  dsimp only [M.corec, M.mk]
  congr with n
  cases' n with n
  · 

Proof state:
case e_approx.h.zero
F : PFunctor.{u}
X✝ : Type u_1
f✝ : X✝ → ↑F X✝
X : Type u_2
f : X → ↑F X
x₀ : X
⊢ sCorec f x₀ zero = Approx.sMk (map F (M.corec f) (f x₀)) zero

Next tactic:
dsimp only [sCorec, Approx.sMk]
theorem corec_def {X} (f : X → F X) (x₀ : X) : M.corec f x₀ = M.mk (F.map (M.corec f) (f x₀)) := by
  dsimp only [M.corec, M.mk]
  congr with n
  cases' n with n
  · dsimp only [sCorec, Approx.sMk]
  · 

Proof state:
case e_approx.h.succ
F : PFunctor.{u}
X✝ : Type u_1
f✝ : X✝ → ↑F X✝
X : Type u_2
f : X → ↑F X
x₀ : X
n : ℕ
⊢ sCorec f x₀ (succ n) = Approx.sMk (map F (M.corec f) (f x₀)) (succ n)

Next tactic:
dsimp only [sCorec, Approx.sMk]
theorem corec_def {X} (f : X → F X) (x₀ : X) : M.corec f x₀ = M.mk (F.map (M.corec f) (f x₀)) := by
  dsimp only [M.corec, M.mk]
  congr with n
  cases' n with n
  · dsimp only [sCorec, Approx.sMk]
  · dsimp only [sCorec, Approx.sMk]
    

Proof state:
case e_approx.h.succ
F : PFunctor.{u}
X✝ : Type u_1
f✝ : X✝ → ↑F X✝
X : Type u_2
f : X → ↑F X
x₀ : X
n : ℕ
⊢ (CofixA.intro (f x₀).fst fun i => sCorec f (Sigma.snd (f x₀) i) n) =
    CofixA.intro (map F (M.corec f) (f x₀)).fst fun i => MIntl.approx (Sigma.snd (map F (M.corec f) (f x₀)) i) n

Next tactic:
cases h : f x₀
theorem corec_def {X} (f : X → F X) (x₀ : X) : M.corec f x₀ = M.mk (F.map (M.corec f) (f x₀)) := by
  dsimp only [M.corec, M.mk]
  congr with n
  cases' n with n
  · dsimp only [sCorec, Approx.sMk]
  · dsimp only [sCorec, Approx.sMk]
    cases h : f x₀
    

Proof state:
case e_approx.h.succ.mk
F : PFunctor.{u}
X✝ : Type u_1
f✝ : X✝ → ↑F X✝
X : Type u_2
f : X → ↑F X
x₀ : X
n : ℕ
fst✝ : F.A
snd✝ : B F fst✝ → X
h : f x₀ = { fst := fst✝, snd := snd✝ }
⊢ (CofixA.intro { fst := fst✝, snd := snd✝ }.fst fun i => sCorec f (Sigma.snd { fst := fst✝, snd := snd✝ } i) n) =
    CofixA.intro (map F (M.corec f) { fst := fst✝, snd := snd✝ }).fst fun i =>
      MIntl.approx (Sigma.snd (map F (M.corec f) { fst := fst✝, snd := snd✝ }) i) n

Next tactic:
dsimp only [PFunctor.map]
theorem corec_def {X} (f : X → F X) (x₀ : X) : M.corec f x₀ = M.mk (F.map (M.corec f) (f x₀)) := by
  dsimp only [M.corec, M.mk]
  congr with n
  cases' n with n
  · dsimp only [sCorec, Approx.sMk]
  · dsimp only [sCorec, Approx.sMk]
    cases h : f x₀
    dsimp only [PFunctor.map]
    

Proof state:
case e_approx.h.succ.mk
F : PFunctor.{u}
X✝ : Type u_1
f✝ : X✝ → ↑F X✝
X : Type u_2
f : X → ↑F X
x₀ : X
n : ℕ
fst✝ : F.A
snd✝ : B F fst✝ → X
h : f x₀ = { fst := fst✝, snd := snd✝ }
⊢ (CofixA.intro fst✝ fun i => sCorec f (snd✝ i) n) = CofixA.intro fst✝ fun i => MIntl.approx ((M.corec f ∘ snd✝) i) n

Next tactic:
congr
theorem ext_aux [Inhabited (M F)] [DecidableEq F.A] {n : ℕ} (x y z : M F) (hx : Agree' n z x)
    (hy : Agree' n z y) (hrec : ∀ ps : Path F, n = ps.length → iselect ps x = iselect ps y) :
    x.approx (n + 1) = y.approx (n + 1) := by
  

Proof state:
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : Inhabited (M F)
inst✝ : DecidableEq F.A
n : ℕ
x y z : M F
hx : Agree' n z x
hy : Agree' n z y
hrec : ∀ (ps : Path F), n = length ps → iselect ps x = iselect ps y
⊢ MIntl.approx x (n + 1) = MIntl.approx y (n + 1)

Next tactic:
induction' n with n n_ih generalizing x y z
theorem ext_aux [Inhabited (M F)] [DecidableEq F.A] {n : ℕ} (x y z : M F) (hx : Agree' n z x)
    (hy : Agree' n z y) (hrec : ∀ ps : Path F, n = ps.length → iselect ps x = iselect ps y) :
    x.approx (n + 1) = y.approx (n + 1) := by
  induction' n with n n_ih generalizing x y z
  · 

Proof state:
case zero
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : Inhabited (M F)
inst✝ : DecidableEq F.A
x y z : M F
hx : Agree' zero z x
hy : Agree' zero z y
hrec : ∀ (ps : Path F), zero = length ps → iselect ps x = iselect ps y
⊢ MIntl.approx x (zero + 1) = MIntl.approx y (zero + 1)

Next tactic:
specialize hrec [] rfl
theorem ext_aux [Inhabited (M F)] [DecidableEq F.A] {n : ℕ} (x y z : M F) (hx : Agree' n z x)
    (hy : Agree' n z y) (hrec : ∀ ps : Path F, n = ps.length → iselect ps x = iselect ps y) :
    x.approx (n + 1) = y.approx (n + 1) := by
  induction' n with n n_ih generalizing x y z
  · specialize hrec [] rfl
    

Proof state:
case zero
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : Inhabited (M F)
inst✝ : DecidableEq F.A
x y z : M F
hx : Agree' zero z x
hy : Agree' zero z y
hrec : iselect [] x = iselect [] y
⊢ MIntl.approx x (zero + 1) = MIntl.approx y (zero + 1)

Next tactic:
induction x using PFunctor.M.casesOn'
theorem ext_aux [Inhabited (M F)] [DecidableEq F.A] {n : ℕ} (x y z : M F) (hx : Agree' n z x)
    (hy : Agree' n z y) (hrec : ∀ ps : Path F, n = ps.length → iselect ps x = iselect ps y) :
    x.approx (n + 1) = y.approx (n + 1) := by
  induction' n with n n_ih generalizing x y z
  · specialize hrec [] rfl
    induction x using PFunctor.M.casesOn'
    

Proof state:
case zero.f
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : Inhabited (M F)
inst✝ : DecidableEq F.A
y z : M F
hy : Agree' zero z y
a✝ : F.A
f✝ : B F a✝ → M F
hx : Agree' zero z (M.mk { fst := a✝, snd := f✝ })
hrec : iselect [] (M.mk { fst := a✝, snd := f✝ }) = iselect [] y
⊢ MIntl.approx (M.mk { fst := a✝, snd := f✝ }) (zero + 1) = MIntl.approx y (zero + 1)

Next tactic:
induction y using PFunctor.M.casesOn'
theorem ext_aux [Inhabited (M F)] [DecidableEq F.A] {n : ℕ} (x y z : M F) (hx : Agree' n z x)
    (hy : Agree' n z y) (hrec : ∀ ps : Path F, n = ps.length → iselect ps x = iselect ps y) :
    x.approx (n + 1) = y.approx (n + 1) := by
  induction' n with n n_ih generalizing x y z
  · specialize hrec [] rfl
    induction x using PFunctor.M.casesOn'
    induction y using PFunctor.M.casesOn'
    

Proof state:
case zero.f.f
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : Inhabited (M F)
inst✝ : DecidableEq F.A
z : M F
a✝¹ : F.A
f✝¹ : B F a✝¹ → M F
hx : Agree' zero z (M.mk { fst := a✝¹, snd := f✝¹ })
a✝ : F.A
f✝ : B F a✝ → M F
hy : Agree' zero z (M.mk { fst := a✝, snd := f✝ })
hrec : iselect [] (M.mk { fst := a✝¹, snd := f✝¹ }) = iselect [] (M.mk { fst := a✝, snd := f✝ })
⊢ MIntl.approx (M.mk { fst := a✝¹, snd := f✝¹ }) (zero + 1) = MIntl.approx (M.mk { fst := a✝, snd := f✝ }) (zero + 1)

Next tactic:
simp only [iselect_nil] at hrec
theorem ext_aux [Inhabited (M F)] [DecidableEq F.A] {n : ℕ} (x y z : M F) (hx : Agree' n z x)
    (hy : Agree' n z y) (hrec : ∀ ps : Path F, n = ps.length → iselect ps x = iselect ps y) :
    x.approx (n + 1) = y.approx (n + 1) := by
  induction' n with n n_ih generalizing x y z
  · specialize hrec [] rfl
    induction x using PFunctor.M.casesOn'
    induction y using PFunctor.M.casesOn'
    simp only [iselect_nil] at hrec
    

Proof state:
case zero.f.f
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : Inhabited (M F)
inst✝ : DecidableEq F.A
z : M F
a✝¹ : F.A
f✝¹ : B F a✝¹ → M F
hx : Agree' zero z (M.mk { fst := a✝¹, snd := f✝¹ })
a✝ : F.A
f✝ : B F a✝ → M F
hy : Agree' zero z (M.mk { fst := a✝, snd := f✝ })
hrec : a✝¹ = a✝
⊢ MIntl.approx (M.mk { fst := a✝¹, snd := f✝¹ }) (zero + 1) = MIntl.approx (M.mk { fst := a✝, snd := f✝ }) (zero + 1)

Next tactic:
subst hrec
theorem ext_aux [Inhabited (M F)] [DecidableEq F.A] {n : ℕ} (x y z : M F) (hx : Agree' n z x)
    (hy : Agree' n z y) (hrec : ∀ ps : Path F, n = ps.length → iselect ps x = iselect ps y) :
    x.approx (n + 1) = y.approx (n + 1) := by
  induction' n with n n_ih generalizing x y z
  · specialize hrec [] rfl
    induction x using PFunctor.M.casesOn'
    induction y using PFunctor.M.casesOn'
    simp only [iselect_nil] at hrec
    subst hrec
    

Proof state:
case zero.f.f
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : Inhabited (M F)
inst✝ : DecidableEq F.A
z : M F
a✝ : F.A
f✝¹ : B F a✝ → M F
hx : Agree' zero z (M.mk { fst := a✝, snd := f✝¹ })
f✝ : B F a✝ → M F
hy : Agree' zero z (M.mk { fst := a✝, snd := f✝ })
⊢ MIntl.approx (M.mk { fst := a✝, snd := f✝¹ }) (zero + 1) = MIntl.approx (M.mk { fst := a✝, snd := f✝ }) (zero + 1)

Next tactic:
simp only [approx_mk, true_and_iff, eq_self_iff_true, heq_iff_eq, zero_eq, CofixA.intro.injEq,
                heq_eq_eq, eq_iff_true_of_subsingleton, and_self]
theorem ext_aux [Inhabited (M F)] [DecidableEq F.A] {n : ℕ} (x y z : M F) (hx : Agree' n z x)
    (hy : Agree' n z y) (hrec : ∀ ps : Path F, n = ps.length → iselect ps x = iselect ps y) :
    x.approx (n + 1) = y.approx (n + 1) := by
  induction' n with n n_ih generalizing x y z
  · specialize hrec [] rfl
    induction x using PFunctor.M.casesOn'
    induction y using PFunctor.M.casesOn'
    simp only [iselect_nil] at hrec
    subst hrec
    simp only [approx_mk, true_and_iff, eq_self_iff_true, heq_iff_eq, zero_eq, CofixA.intro.injEq,
                heq_eq_eq, eq_iff_true_of_subsingleton, and_self]
  · 

Proof state:
case succ
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : Inhabited (M F)
inst✝ : DecidableEq F.A
n : ℕ
n_ih :
  ∀ (x y z : M F),
    Agree' n z x →
      Agree' n z y →
        (∀ (ps : Path F), n = length ps → iselect ps x = iselect ps y) → MIntl.approx x (n + 1) = MIntl.approx y (n + 1)
x y z : M F
hx : Agree' (succ n) z x
hy : Agree' (succ n) z y
hrec : ∀ (ps : Path F), succ n = length ps → iselect ps x = iselect ps y
⊢ MIntl.approx x (succ n + 1) = MIntl.approx y (succ n + 1)

Next tactic:
cases hx
theorem ext_aux [Inhabited (M F)] [DecidableEq F.A] {n : ℕ} (x y z : M F) (hx : Agree' n z x)
    (hy : Agree' n z y) (hrec : ∀ ps : Path F, n = ps.length → iselect ps x = iselect ps y) :
    x.approx (n + 1) = y.approx (n + 1) := by
  induction' n with n n_ih generalizing x y z
  · specialize hrec [] rfl
    induction x using PFunctor.M.casesOn'
    induction y using PFunctor.M.casesOn'
    simp only [iselect_nil] at hrec
    subst hrec
    simp only [approx_mk, true_and_iff, eq_self_iff_true, heq_iff_eq, zero_eq, CofixA.intro.injEq,
                heq_eq_eq, eq_iff_true_of_subsingleton, and_self]
  · cases hx
    

Proof state:
case succ.step
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : Inhabited (M F)
inst✝ : DecidableEq F.A
n : ℕ
n_ih :
  ∀ (x y z : M F),
    Agree' n z x →
      Agree' n z y →
        (∀ (ps : Path F), n = length ps → iselect ps x = iselect ps y) → MIntl.approx x (n + 1) = MIntl.approx y (n + 1)
x y z : M F
hy : Agree' (succ n) z y
hrec : ∀ (ps : Path F), succ n = length ps → iselect ps x = iselect ps y
a✝³ : F.A
x✝ y✝ : B F a✝³ → M F
a✝² : ∀ (i : B F a✝³), Agree' n (x✝ i) (y✝ i)
a✝¹ : z = M.mk { fst := a✝³, snd := x✝ }
a✝ : x = M.mk { fst := a✝³, snd := y✝ }
⊢ MIntl.approx x (succ n + 1) = MIntl.approx y (succ n + 1)

Next tactic:
cases hy
theorem ext_aux [Inhabited (M F)] [DecidableEq F.A] {n : ℕ} (x y z : M F) (hx : Agree' n z x)
    (hy : Agree' n z y) (hrec : ∀ ps : Path F, n = ps.length → iselect ps x = iselect ps y) :
    x.approx (n + 1) = y.approx (n + 1) := by
  induction' n with n n_ih generalizing x y z
  · specialize hrec [] rfl
    induction x using PFunctor.M.casesOn'
    induction y using PFunctor.M.casesOn'
    simp only [iselect_nil] at hrec
    subst hrec
    simp only [approx_mk, true_and_iff, eq_self_iff_true, heq_iff_eq, zero_eq, CofixA.intro.injEq,
                heq_eq_eq, eq_iff_true_of_subsingleton, and_self]
  · cases hx
    cases hy
    

Proof state:
case succ.step.step
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : Inhabited (M F)
inst✝ : DecidableEq F.A
n : ℕ
n_ih :
  ∀ (x y z : M F),
    Agree' n z x →
      Agree' n z y →
        (∀ (ps : Path F), n = length ps → iselect ps x = iselect ps y) → MIntl.approx x (n + 1) = MIntl.approx y (n + 1)
x y z : M F
hrec : ∀ (ps : Path F), succ n = length ps → iselect ps x = iselect ps y
a✝⁷ : F.A
x✝¹ y✝¹ : B F a✝⁷ → M F
a✝⁶ : ∀ (i : B F a✝⁷), Agree' n (x✝¹ i) (y✝¹ i)
a✝⁵ : z = M.mk { fst := a✝⁷, snd := x✝¹ }
a✝⁴ : x = M.mk { fst := a✝⁷, snd := y✝¹ }
a✝³ : F.A
x✝ y✝ : B F a✝³ → M F
a✝² : ∀ (i : B F a✝³), Agree' n (x✝ i) (y✝ i)
a✝¹ : z = M.mk { fst := a✝³, snd := x✝ }
a✝ : y = M.mk { fst := a✝³, snd := y✝ }
⊢ MIntl.approx x (succ n + 1) = MIntl.approx y (succ n + 1)

Next tactic:
induction x using PFunctor.M.casesOn'
theorem ext_aux [Inhabited (M F)] [DecidableEq F.A] {n : ℕ} (x y z : M F) (hx : Agree' n z x)
    (hy : Agree' n z y) (hrec : ∀ ps : Path F, n = ps.length → iselect ps x = iselect ps y) :
    x.approx (n + 1) = y.approx (n + 1) := by
  induction' n with n n_ih generalizing x y z
  · specialize hrec [] rfl
    induction x using PFunctor.M.casesOn'
    induction y using PFunctor.M.casesOn'
    simp only [iselect_nil] at hrec
    subst hrec
    simp only [approx_mk, true_and_iff, eq_self_iff_true, heq_iff_eq, zero_eq, CofixA.intro.injEq,
                heq_eq_eq, eq_iff_true_of_subsingleton, and_self]
  · cases hx
    cases hy
    induction x using PFunctor.M.casesOn'
    

Proof state:
case succ.step.step.f
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : Inhabited (M F)
inst✝ : DecidableEq F.A
n : ℕ
n_ih :
  ∀ (x y z : M F),
    Agree' n z x →
      Agree' n z y →
        (∀ (ps : Path F), n = length ps → iselect ps x = iselect ps y) → MIntl.approx x (n + 1) = MIntl.approx y (n + 1)
y z : M F
a✝⁸ : F.A
x✝¹ y✝¹ : B F a✝⁸ → M F
a✝⁷ : ∀ (i : B F a✝⁸), Agree' n (x✝¹ i) (y✝¹ i)
a✝⁶ : z = M.mk { fst := a✝⁸, snd := x✝¹ }
a✝⁵ : F.A
x✝ y✝ : B F a✝⁵ → M F
a✝⁴ : ∀ (i : B F a✝⁵), Agree' n (x✝ i) (y✝ i)
a✝³ : z = M.mk { fst := a✝⁵, snd := x✝ }
a✝² : y = M.mk { fst := a✝⁵, snd := y✝ }
a✝¹ : F.A
f✝ : B F a✝¹ → M F
hrec : ∀ (ps : Path F), succ n = length ps → iselect ps (M.mk { fst := a✝¹, snd := f✝ }) = iselect ps y
a✝ : M.mk { fst := a✝¹, snd := f✝ } = M.mk { fst := a✝⁸, snd := y✝¹ }
⊢ MIntl.approx (M.mk { fst := a✝¹, snd := f✝ }) (succ n + 1) = MIntl.approx y (succ n + 1)

Next tactic:
induction y using PFunctor.M.casesOn'
theorem ext_aux [Inhabited (M F)] [DecidableEq F.A] {n : ℕ} (x y z : M F) (hx : Agree' n z x)
    (hy : Agree' n z y) (hrec : ∀ ps : Path F, n = ps.length → iselect ps x = iselect ps y) :
    x.approx (n + 1) = y.approx (n + 1) := by
  induction' n with n n_ih generalizing x y z
  · specialize hrec [] rfl
    induction x using PFunctor.M.casesOn'
    induction y using PFunctor.M.casesOn'
    simp only [iselect_nil] at hrec
    subst hrec
    simp only [approx_mk, true_and_iff, eq_self_iff_true, heq_iff_eq, zero_eq, CofixA.intro.injEq,
                heq_eq_eq, eq_iff_true_of_subsingleton, and_self]
  · cases hx
    cases hy
    induction x using PFunctor.M.casesOn'
    induction y using PFunctor.M.casesOn'
    

Proof state:
case succ.step.step.f.f
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : Inhabited (M F)
inst✝ : DecidableEq F.A
n : ℕ
n_ih :
  ∀ (x y z : M F),
    Agree' n z x →
      Agree' n z y →
        (∀ (ps : Path F), n = length ps → iselect ps x = iselect ps y) → MIntl.approx x (n + 1) = MIntl.approx y (n + 1)
z : M F
a✝⁹ : F.A
x✝¹ y✝¹ : B F a✝⁹ → M F
a✝⁸ : ∀ (i : B F a✝⁹), Agree' n (x✝¹ i) (y✝¹ i)
a✝⁷ : z = M.mk { fst := a✝⁹, snd := x✝¹ }
a✝⁶ : F.A
x✝ y✝ : B F a✝⁶ → M F
a✝⁵ : ∀ (i : B F a✝⁶), Agree' n (x✝ i) (y✝ i)
a✝⁴ : z = M.mk { fst := a✝⁶, snd := x✝ }
a✝³ : F.A
f✝¹ : B F a✝³ → M F
a✝² : M.mk { fst := a✝³, snd := f✝¹ } = M.mk { fst := a✝⁹, snd := y✝¹ }
a✝¹ : F.A
f✝ : B F a✝¹ → M F
a✝ : M.mk { fst := a✝¹, snd := f✝ } = M.mk { fst := a✝⁶, snd := y✝ }
hrec :
  ∀ (ps : Path F),
    succ n = length ps → iselect ps (M.mk { fst := a✝³, snd := f✝¹ }) = iselect ps (M.mk { fst := a✝¹, snd := f✝ })
⊢ MIntl.approx (M.mk { fst := a✝³, snd := f✝¹ }) (succ n + 1) =
    MIntl.approx (M.mk { fst := a✝¹, snd := f✝ }) (succ n + 1)

Next tactic:
subst z
theorem ext_aux [Inhabited (M F)] [DecidableEq F.A] {n : ℕ} (x y z : M F) (hx : Agree' n z x)
    (hy : Agree' n z y) (hrec : ∀ ps : Path F, n = ps.length → iselect ps x = iselect ps y) :
    x.approx (n + 1) = y.approx (n + 1) := by
  induction' n with n n_ih generalizing x y z
  · specialize hrec [] rfl
    induction x using PFunctor.M.casesOn'
    induction y using PFunctor.M.casesOn'
    simp only [iselect_nil] at hrec
    subst hrec
    simp only [approx_mk, true_and_iff, eq_self_iff_true, heq_iff_eq, zero_eq, CofixA.intro.injEq,
                heq_eq_eq, eq_iff_true_of_subsingleton, and_self]
  · cases hx
    cases hy
    induction x using PFunctor.M.casesOn'
    induction y using PFunctor.M.casesOn'
    subst z
    

Proof state:
case succ.step.step.f.f
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : Inhabited (M F)
inst✝ : DecidableEq F.A
n : ℕ
n_ih :
  ∀ (x y z : M F),
    Agree' n z x →
      Agree' n z y →
        (∀ (ps : Path F), n = length ps → iselect ps x = iselect ps y) → MIntl.approx x (n + 1) = MIntl.approx y (n + 1)
a✝⁸ : F.A
x✝¹ y✝¹ : B F a✝⁸ → M F
a✝⁷ : ∀ (i : B F a✝⁸), Agree' n (x✝¹ i) (y✝¹ i)
a✝⁶ : F.A
x✝ y✝ : B F a✝⁶ → M F
a✝⁵ : ∀ (i : B F a✝⁶), Agree' n (x✝ i) (y✝ i)
a✝⁴ : F.A
f✝¹ : B F a✝⁴ → M F
a✝³ : M.mk { fst := a✝⁴, snd := f✝¹ } = M.mk { fst := a✝⁸, snd := y✝¹ }
a✝² : F.A
f✝ : B F a✝² → M F
a✝¹ : M.mk { fst := a✝², snd := f✝ } = M.mk { fst := a✝⁶, snd := y✝ }
hrec :
  ∀ (ps : Path F),
    succ n = length ps → iselect ps (M.mk { fst := a✝⁴, snd := f✝¹ }) = iselect ps (M.mk { fst := a✝², snd := f✝ })
a✝ : M.mk { fst := a✝⁸, snd := x✝¹ } = M.mk { fst := a✝⁶, snd := x✝ }
⊢ MIntl.approx (M.mk { fst := a✝⁴, snd := f✝¹ }) (succ n + 1) =
    MIntl.approx (M.mk { fst := a✝², snd := f✝ }) (succ n + 1)

Next tactic:
iterate 3 (have := mk_inj ‹_›; cases this)
theorem ext_aux [Inhabited (M F)] [DecidableEq F.A] {n : ℕ} (x y z : M F) (hx : Agree' n z x)
    (hy : Agree' n z y) (hrec : ∀ ps : Path F, n = ps.length → iselect ps x = iselect ps y) :
    x.approx (n + 1) = y.approx (n + 1) := by
  induction' n with n n_ih generalizing x y z
  · specialize hrec [] rfl
    induction x using PFunctor.M.casesOn'
    induction y using PFunctor.M.casesOn'
    simp only [iselect_nil] at hrec
    subst hrec
    simp only [approx_mk, true_and_iff, eq_self_iff_true, heq_iff_eq, zero_eq, CofixA.intro.injEq,
                heq_eq_eq, eq_iff_true_of_subsingleton, and_self]
  · cases hx
    cases hy
    induction x using PFunctor.M.casesOn'
    induction y using PFunctor.M.casesOn'
    subst z
    iterate 3 (

Proof state:
case succ.step.step.f.f
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝¹ : Inhabited (M F)
inst✝ : DecidableEq F.A
n : ℕ
n_ih :
  ∀ (x y z : M F),
    Agree' n z x →
      Agree' n z y →
        (∀ (ps : Path F), n = length ps → iselect ps x = iselect ps y) → MIntl.approx x (n + 1) = MIntl.approx y (n + 1)
a✝⁸ : F.A
x✝¹ y✝¹ : B F a✝⁸ → M F
a✝⁷ : ∀ (i : B F a✝⁸), Agree' n (x✝¹ i) (y✝¹ i)
a✝⁶ : F.A
x✝ y✝ : B F a✝⁶ → M F
a✝⁵ : ∀ (i : B F a✝⁶), Agree' n (x✝ i) (y✝ i)
a✝⁴ : F.A
f✝¹ : B F a✝⁴ → M F
a✝³ : M.mk { fst := a✝⁴, snd := f✝¹ } = M.mk { fst := a✝⁸, snd := y✝¹ }
a✝² : F.A
f✝ : B F a✝² → M F
a✝¹ : M.mk { fst := a✝², snd := f✝ } = M.mk { fst := a✝⁶, snd := y✝ }
hrec :
  ∀ (ps : Path F),
    succ n = length ps → iselect ps (M.mk { fst := a✝⁴, snd := f✝¹ }) = iselect ps (M.mk { fst := a✝², snd := f✝ })
a✝ : M.mk { fst := a✝⁸, snd := x✝¹ } = M.mk { fst := a✝⁶, snd := x✝ }
⊢ MIntl.approx (M.mk { fst := a✝⁴, snd := f✝¹ }) (succ n + 1) =
    MIntl.approx (M.mk { fst := a✝², snd := f✝ }) (succ n + 1)

Next tactic:
have := mk_inj ‹_›