l3lab/ntp-mathlib huggingface dataset:
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 (have := mk_inj ‹_›; 

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✝ }
this : { fst := a✝⁸, snd := x✝¹ } = { 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:
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.refl
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
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
hrec :
  ∀ (ps : Path F),
    succ n = length ps → iselect ps (M.mk { fst := a✝⁵, snd := f✝¹ }) = iselect ps (M.mk { fst := a✝³, snd := f✝ })
y✝ : B F a✝⁷ → M F
a✝² : M.mk { fst := a✝³, snd := f✝ } = M.mk { fst := a✝⁷, snd := y✝ }
a✝¹ : ∀ (i : B F a✝⁷), Agree' n (x✝ i) (y✝ i)
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 ‹_›
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 (have := mk_inj ‹_›; 

Proof state:
case succ.step.step.f.f.refl
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
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
hrec :
  ∀ (ps : Path F),
    succ n = length ps → iselect ps (M.mk { fst := a✝⁵, snd := f✝¹ }) = iselect ps (M.mk { fst := a✝³, snd := f✝ })
y✝ : B F a✝⁷ → M F
a✝² : M.mk { fst := a✝³, snd := f✝ } = M.mk { fst := a✝⁷, snd := y✝ }
a✝¹ : ∀ (i : B F a✝⁷), Agree' n (x✝ i) (y✝ i)
a✝ : M.mk { fst := a✝⁷, snd := x✝ } = M.mk { fst := a✝⁷, snd := x✝ }
this : { fst := a✝⁷, snd := x✝ } = { 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:
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.refl.refl
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
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
hrec :
  ∀ (ps : Path F),
    succ n = length ps → iselect ps (M.mk { fst := a✝⁵, snd := f✝¹ }) = iselect ps (M.mk { fst := a✝³, snd := f✝ })
y✝ : B F a✝⁷ → M F
a✝² : M.mk { fst := a✝³, snd := f✝ } = M.mk { fst := a✝⁷, snd := y✝ }
a✝¹ : ∀ (i : B F a✝⁷), Agree' n (x✝ i) (y✝ i)
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 ‹_›
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 (have := mk_inj ‹_›; 

Proof state:
case succ.step.step.f.f.refl.refl
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
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
hrec :
  ∀ (ps : Path F),
    succ n = length ps → iselect ps (M.mk { fst := a✝⁵, snd := f✝¹ }) = iselect ps (M.mk { fst := a✝³, snd := f✝ })
y✝ : B F a✝⁷ → M F
a✝² : M.mk { fst := a✝³, snd := f✝ } = M.mk { fst := a✝⁷, snd := y✝ }
a✝¹ : ∀ (i : B F a✝⁷), Agree' n (x✝ i) (y✝ i)
a✝ : M.mk { fst := a✝⁷, snd := x✝ } = M.mk { fst := a✝⁷, snd := x✝ }
this : { fst := a✝⁷, snd := x✝ } = { 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:
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 (have := mk_inj ‹_›; cases this)
    

Proof state:
case succ.step.step.f.f.refl.refl.refl
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
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
hrec :
  ∀ (ps : Path F),
    succ n = length ps → iselect ps (M.mk { fst := a✝⁵, snd := f✝¹ }) = iselect ps (M.mk { fst := a✝³, snd := f✝ })
y✝ : B F a✝⁷ → M F
a✝² : M.mk { fst := a✝³, snd := f✝ } = M.mk { fst := a✝⁷, snd := y✝ }
a✝¹ : ∀ (i : B F a✝⁷), Agree' n (x✝ i) (y✝ i)
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:
rename_i n_ih a f₃ f₂ hAgree₂ _ _ h₂ _ _ f₁ h₁ hAgree₁ clr
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 (have := mk_inj ‹_›; cases this)
    rename_i n_ih a f₃ f₂ hAgree₂ _ _ h₂ _ _ f₁ h₁ hAgree₁ clr
    

Proof state:
case succ.step.step.f.f.refl.refl.refl
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝ : Inhabited (M F)
n_ih✝ : 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
f₃ f₂ : B F a → M F
hAgree₂ : ∀ (i : B F a), Agree' n (f₃ i) (f₂ i)
a✝¹ : F.A
f✝¹ : B F a✝¹ → M F
h₂ : M.mk { fst := a✝¹, snd := f✝¹ } = M.mk { fst := a, snd := f₂ }
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 (M.mk { fst := a✝, snd := f✝ })
f₁ : B F a → M F
h₁ : M.mk { fst := a✝, snd := f✝ } = M.mk { fst := a, snd := f₁ }
hAgree₁ : ∀ (i : B F a), Agree' n (f₃ i) (f₁ i)
clr : M.mk { fst := a, snd := f₃ } = 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:
simp only [approx_mk, true_and_iff, eq_self_iff_true, heq_iff_eq]
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 (have := mk_inj ‹_›; cases this)
    rename_i n_ih a f₃ f₂ hAgree₂ _ _ h₂ _ _ f₁ h₁ hAgree₁ clr
    simp only [approx_mk, true_and_iff, eq_self_iff_true, heq_iff_eq]

    

Proof state:
case succ.step.step.f.f.refl.refl.refl
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝ : Inhabited (M F)
n_ih✝ : 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
f₃ f₂ : B F a → M F
hAgree₂ : ∀ (i : B F a), Agree' n (f₃ i) (f₂ i)
a✝¹ : F.A
f✝¹ : B F a✝¹ → M F
h₂ : M.mk { fst := a✝¹, snd := f✝¹ } = M.mk { fst := a, snd := f₂ }
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 (M.mk { fst := a✝, snd := f✝ })
f₁ : B F a → M F
h₁ : M.mk { fst := a✝, snd := f✝ } = M.mk { fst := a, snd := f₁ }
hAgree₁ : ∀ (i : B F a), Agree' n (f₃ i) (f₁ i)
clr : M.mk { fst := a, snd := f₃ } = M.mk { fst := a, snd := f₃ }
⊢ (CofixA.intro a✝¹ fun j => MIntl.approx (f✝¹ j) (n + 1)) = CofixA.intro a✝ fun j => MIntl.approx (f✝ j) (n + 1)

Next tactic:
have := mk_inj h₁
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 (have := mk_inj ‹_›; cases this)
    rename_i n_ih a f₃ f₂ hAgree₂ _ _ h₂ _ _ f₁ h₁ hAgree₁ clr
    simp only [approx_mk, true_and_iff, eq_self_iff_true, heq_iff_eq]

    have := mk_inj h₁
    

Proof state:
case succ.step.step.f.f.refl.refl.refl
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝ : Inhabited (M F)
n_ih✝ : 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
f₃ f₂ : B F a → M F
hAgree₂ : ∀ (i : B F a), Agree' n (f₃ i) (f₂ i)
a✝¹ : F.A
f✝¹ : B F a✝¹ → M F
h₂ : M.mk { fst := a✝¹, snd := f✝¹ } = M.mk { fst := a, snd := f₂ }
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 (M.mk { fst := a✝, snd := f✝ })
f₁ : B F a → M F
h₁ : M.mk { fst := a✝, snd := f✝ } = M.mk { fst := a, snd := f₁ }
hAgree₁ : ∀ (i : B F a), Agree' n (f₃ i) (f₁ i)
clr : M.mk { fst := a, snd := f₃ } = M.mk { fst := a, snd := f₃ }
this : { fst := a✝, snd := f✝ } = { fst := a, snd := f₁ }
⊢ (CofixA.intro a✝¹ fun j => MIntl.approx (f✝¹ j) (n + 1)) = CofixA.intro a✝ fun j => MIntl.approx (f✝ j) (n + 1)

Next tactic:
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 (have := mk_inj ‹_›; cases this)
    rename_i n_ih a f₃ f₂ hAgree₂ _ _ h₂ _ _ f₁ h₁ hAgree₁ clr
    simp only [approx_mk, true_and_iff, eq_self_iff_true, heq_iff_eq]

    have := mk_inj h₁
    cases this; 

Proof state:
case succ.step.step.f.f.refl.refl.refl.refl
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝ : Inhabited (M F)
n_ih✝ : 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
f₃ f₂ : B F a → M F
hAgree₂ : ∀ (i : B F a), Agree' n (f₃ i) (f₂ i)
a✝ : F.A
f✝ : B F a✝ → M F
h₂ : M.mk { fst := a✝, snd := f✝ } = M.mk { fst := a, snd := f₂ }
f₁ : B F a → M F
hAgree₁ : ∀ (i : B F a), Agree' n (f₃ i) (f₁ i)
clr : M.mk { fst := a, snd := f₃ } = M.mk { fst := a, snd := f₃ }
hrec :
  ∀ (ps : Path F),
    succ n = length ps → iselect ps (M.mk { fst := a✝, snd := f✝ }) = iselect ps (M.mk { fst := a, snd := f₁ })
h₁ : M.mk { fst := a, snd := f₁ } = M.mk { fst := a, snd := f₁ }
⊢ (CofixA.intro a✝ fun j => MIntl.approx (f✝ j) (n + 1)) = CofixA.intro a fun j => MIntl.approx (f₁ j) (n + 1)

Next tactic:
clear h₁
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 (have := mk_inj ‹_›; cases this)
    rename_i n_ih a f₃ f₂ hAgree₂ _ _ h₂ _ _ f₁ h₁ hAgree₁ clr
    simp only [approx_mk, true_and_iff, eq_self_iff_true, heq_iff_eq]

    have := mk_inj h₁
    cases this; clear h₁
    

Proof state:
case succ.step.step.f.f.refl.refl.refl.refl
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝ : Inhabited (M F)
n_ih✝ : 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
f₃ f₂ : B F a → M F
hAgree₂ : ∀ (i : B F a), Agree' n (f₃ i) (f₂ i)
a✝ : F.A
f✝ : B F a✝ → M F
h₂ : M.mk { fst := a✝, snd := f✝ } = M.mk { fst := a, snd := f₂ }
f₁ : B F a → M F
hAgree₁ : ∀ (i : B F a), Agree' n (f₃ i) (f₁ i)
clr : M.mk { fst := a, snd := f₃ } = M.mk { fst := a, snd := f₃ }
hrec :
  ∀ (ps : Path F),
    succ n = length ps → iselect ps (M.mk { fst := a✝, snd := f✝ }) = iselect ps (M.mk { fst := a, snd := f₁ })
⊢ (CofixA.intro a✝ fun j => MIntl.approx (f✝ j) (n + 1)) = CofixA.intro a fun j => MIntl.approx (f₁ j) (n + 1)

Next tactic:
have := mk_inj h₂
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 (have := mk_inj ‹_›; cases this)
    rename_i n_ih a f₃ f₂ hAgree₂ _ _ h₂ _ _ f₁ h₁ hAgree₁ clr
    simp only [approx_mk, true_and_iff, eq_self_iff_true, heq_iff_eq]

    have := mk_inj h₁
    cases this; clear h₁
    have := mk_inj h₂
    

Proof state:
case succ.step.step.f.f.refl.refl.refl.refl
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
inst✝ : Inhabited (M F)
n_ih✝ : 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
f₃ f₂ : B F a → M F
hAgree₂ : ∀ (i : B F a), Agree' n (f₃ i) (f₂ i)
a✝ : F.A
f✝ : B F a✝ → M F
h₂ : M.mk { fst := a✝, snd := f✝ } = M.mk { fst := a, snd := f₂ }
f₁ : B F a → M F
hAgree₁ : ∀ (i : B F a), Agree' n (f₃ i) (f₁ i)
clr : M.mk { fst := a, snd := f₃ } = M.mk { fst := a, snd := f₃ }
hrec :
  ∀ (ps : Path F),
    succ n = length ps → iselect ps (M.mk { fst := a✝, snd := f✝ }) = iselect ps (M.mk { fst := a, snd := f₁ })
this : { fst := a✝, snd := f✝ } = { fst := a, snd := f₂ }
⊢ (CofixA.intro a✝ fun j => MIntl.approx (f✝ j) (n + 1)) = CofixA.intro a fun j => MIntl.approx (f₁ j) (n + 1)

Next tactic:
cases this