l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem mk_dest (x : M F) : M.mk (dest x) = x := by
  apply ext'
  intro n
  dsimp only [M.mk]
  induction' n with n
  · apply @Subsingleton.elim _ CofixA.instSubsingleton
  dsimp only [Approx.sMk, dest, head]
  cases' h : x.approx (succ n) with _ hd ch
  have h' : hd = head' (x.approx 1) := by
    rw [← head_succ' n, h, head']
    apply x.consistent
  revert ch
  rw [h']
  intros ch h
  congr
  · ext a
    

Proof state:
case H.succ.intro.e_a.h
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : M F
n : ℕ
n_ih✝ : Approx.sMk (dest x) n = MIntl.approx x n
hd : F.A
h' : hd = head' (MIntl.approx x 1)
ch : B F (head' (MIntl.approx x 1)) → CofixA F n
h : MIntl.approx x (succ n) = CofixA.intro (head' (MIntl.approx x 1)) ch
a : B F (head' (MIntl.approx x 1))
⊢ MIntl.approx (children x a) n = ch a

Next tactic:
dsimp only [children]
@[simp]
theorem mk_dest (x : M F) : M.mk (dest x) = x := by
  apply ext'
  intro n
  dsimp only [M.mk]
  induction' n with n
  · apply @Subsingleton.elim _ CofixA.instSubsingleton
  dsimp only [Approx.sMk, dest, head]
  cases' h : x.approx (succ n) with _ hd ch
  have h' : hd = head' (x.approx 1) := by
    rw [← head_succ' n, h, head']
    apply x.consistent
  revert ch
  rw [h']
  intros ch h
  congr
  · ext a
    dsimp only [children]
    

Proof state:
case H.succ.intro.e_a.h
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : M F
n : ℕ
n_ih✝ : Approx.sMk (dest x) n = MIntl.approx x n
hd : F.A
h' : hd = head' (MIntl.approx x 1)
ch : B F (head' (MIntl.approx x 1)) → CofixA F n
h : MIntl.approx x (succ n) = CofixA.intro (head' (MIntl.approx x 1)) ch
a : B F (head' (MIntl.approx x 1))
⊢ children' (MIntl.approx x (succ n)) (cast (_ : B F (head x) = B F (head' (MIntl.approx x (succ n)))) a) = ch a

Next tactic:
generalize hh : cast _ a = a''
@[simp]
theorem mk_dest (x : M F) : M.mk (dest x) = x := by
  apply ext'
  intro n
  dsimp only [M.mk]
  induction' n with n
  · apply @Subsingleton.elim _ CofixA.instSubsingleton
  dsimp only [Approx.sMk, dest, head]
  cases' h : x.approx (succ n) with _ hd ch
  have h' : hd = head' (x.approx 1) := by
    rw [← head_succ' n, h, head']
    apply x.consistent
  revert ch
  rw [h']
  intros ch h
  congr
  · ext a
    dsimp only [children]
    generalize hh : cast _ a = a''
    

Proof state:
case H.succ.intro.e_a.h
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : M F
n : ℕ
n_ih✝ : Approx.sMk (dest x) n = MIntl.approx x n
hd : F.A
h' : hd = head' (MIntl.approx x 1)
ch : B F (head' (MIntl.approx x 1)) → CofixA F n
h : MIntl.approx x (succ n) = CofixA.intro (head' (MIntl.approx x 1)) ch
a : B F (head' (MIntl.approx x 1))
a'' : B F (head' (MIntl.approx x (succ n)))
hh : cast (_ : B F (head x) = B F (head' (MIntl.approx x (succ n)))) a = a''
⊢ children' (MIntl.approx x (succ n)) a'' = ch a

Next tactic:
rw [cast_eq_iff_heq] at hh
@[simp]
theorem mk_dest (x : M F) : M.mk (dest x) = x := by
  apply ext'
  intro n
  dsimp only [M.mk]
  induction' n with n
  · apply @Subsingleton.elim _ CofixA.instSubsingleton
  dsimp only [Approx.sMk, dest, head]
  cases' h : x.approx (succ n) with _ hd ch
  have h' : hd = head' (x.approx 1) := by
    rw [← head_succ' n, h, head']
    apply x.consistent
  revert ch
  rw [h']
  intros ch h
  congr
  · ext a
    dsimp only [children]
    generalize hh : cast _ a = a''
    rw [cast_eq_iff_heq] at hh
    

Proof state:
case H.succ.intro.e_a.h
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : M F
n : ℕ
n_ih✝ : Approx.sMk (dest x) n = MIntl.approx x n
hd : F.A
h' : hd = head' (MIntl.approx x 1)
ch : B F (head' (MIntl.approx x 1)) → CofixA F n
h : MIntl.approx x (succ n) = CofixA.intro (head' (MIntl.approx x 1)) ch
a : B F (head' (MIntl.approx x 1))
a'' : B F (head' (MIntl.approx x (succ n)))
hh : HEq a a''
⊢ children' (MIntl.approx x (succ n)) a'' = ch a

Next tactic:
revert a''
@[simp]
theorem mk_dest (x : M F) : M.mk (dest x) = x := by
  apply ext'
  intro n
  dsimp only [M.mk]
  induction' n with n
  · apply @Subsingleton.elim _ CofixA.instSubsingleton
  dsimp only [Approx.sMk, dest, head]
  cases' h : x.approx (succ n) with _ hd ch
  have h' : hd = head' (x.approx 1) := by
    rw [← head_succ' n, h, head']
    apply x.consistent
  revert ch
  rw [h']
  intros ch h
  congr
  · ext a
    dsimp only [children]
    generalize hh : cast _ a = a''
    rw [cast_eq_iff_heq] at hh
    revert a''
    

Proof state:
case H.succ.intro.e_a.h
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : M F
n : ℕ
n_ih✝ : Approx.sMk (dest x) n = MIntl.approx x n
hd : F.A
h' : hd = head' (MIntl.approx x 1)
ch : B F (head' (MIntl.approx x 1)) → CofixA F n
h : MIntl.approx x (succ n) = CofixA.intro (head' (MIntl.approx x 1)) ch
a : B F (head' (MIntl.approx x 1))
⊢ ∀ (a'' : B F (head' (MIntl.approx x (succ n)))), HEq a a'' → children' (MIntl.approx x (succ n)) a'' = ch a

Next tactic:
rw [h]
@[simp]
theorem mk_dest (x : M F) : M.mk (dest x) = x := by
  apply ext'
  intro n
  dsimp only [M.mk]
  induction' n with n
  · apply @Subsingleton.elim _ CofixA.instSubsingleton
  dsimp only [Approx.sMk, dest, head]
  cases' h : x.approx (succ n) with _ hd ch
  have h' : hd = head' (x.approx 1) := by
    rw [← head_succ' n, h, head']
    apply x.consistent
  revert ch
  rw [h']
  intros ch h
  congr
  · ext a
    dsimp only [children]
    generalize hh : cast _ a = a''
    rw [cast_eq_iff_heq] at hh
    revert a''
    rw [h]
    

Proof state:
case H.succ.intro.e_a.h
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : M F
n : ℕ
n_ih✝ : Approx.sMk (dest x) n = MIntl.approx x n
hd : F.A
h' : hd = head' (MIntl.approx x 1)
ch : B F (head' (MIntl.approx x 1)) → CofixA F n
h : MIntl.approx x (succ n) = CofixA.intro (head' (MIntl.approx x 1)) ch
a : B F (head' (MIntl.approx x 1))
⊢ ∀ (a'' : B F (head' (CofixA.intro (head' (MIntl.approx x 1)) ch))),
    HEq a a'' → children' (CofixA.intro (head' (MIntl.approx x 1)) ch) a'' = ch a

Next tactic:
intros _ hh
@[simp]
theorem mk_dest (x : M F) : M.mk (dest x) = x := by
  apply ext'
  intro n
  dsimp only [M.mk]
  induction' n with n
  · apply @Subsingleton.elim _ CofixA.instSubsingleton
  dsimp only [Approx.sMk, dest, head]
  cases' h : x.approx (succ n) with _ hd ch
  have h' : hd = head' (x.approx 1) := by
    rw [← head_succ' n, h, head']
    apply x.consistent
  revert ch
  rw [h']
  intros ch h
  congr
  · ext a
    dsimp only [children]
    generalize hh : cast _ a = a''
    rw [cast_eq_iff_heq] at hh
    revert a''
    rw [h]
    intros _ hh
    

Proof state:
case H.succ.intro.e_a.h
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : M F
n : ℕ
n_ih✝ : Approx.sMk (dest x) n = MIntl.approx x n
hd : F.A
h' : hd = head' (MIntl.approx x 1)
ch : B F (head' (MIntl.approx x 1)) → CofixA F n
h : MIntl.approx x (succ n) = CofixA.intro (head' (MIntl.approx x 1)) ch
a : B F (head' (MIntl.approx x 1))
a''✝ : B F (head' (CofixA.intro (head' (MIntl.approx x 1)) ch))
hh : HEq a a''✝
⊢ children' (CofixA.intro (head' (MIntl.approx x 1)) ch) a''✝ = ch a

Next tactic:
cases hh
@[simp]
theorem mk_dest (x : M F) : M.mk (dest x) = x := by
  apply ext'
  intro n
  dsimp only [M.mk]
  induction' n with n
  · apply @Subsingleton.elim _ CofixA.instSubsingleton
  dsimp only [Approx.sMk, dest, head]
  cases' h : x.approx (succ n) with _ hd ch
  have h' : hd = head' (x.approx 1) := by
    rw [← head_succ' n, h, head']
    apply x.consistent
  revert ch
  rw [h']
  intros ch h
  congr
  · ext a
    dsimp only [children]
    generalize hh : cast _ a = a''
    rw [cast_eq_iff_heq] at hh
    revert a''
    rw [h]
    intros _ hh
    cases hh
    

Proof state:
case H.succ.intro.e_a.h.refl
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : M F
n : ℕ
n_ih✝ : Approx.sMk (dest x) n = MIntl.approx x n
hd : F.A
h' : hd = head' (MIntl.approx x 1)
ch : B F (head' (MIntl.approx x 1)) → CofixA F n
h : MIntl.approx x (succ n) = CofixA.intro (head' (MIntl.approx x 1)) ch
a : B F (head' (MIntl.approx x 1))
⊢ children' (CofixA.intro (head' (MIntl.approx x 1)) ch) a = ch a

Next tactic:
rfl
theorem mk_inj {x y : F (M F)} (h : M.mk x = M.mk y) : x = y := by 

Proof state:
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x y : ↑F (M F)
h : M.mk x = M.mk y
⊢ x = y

Next tactic:
rw [← dest_mk x, h, dest_mk]
/-- destructor for M-types -/
protected def cases {r : M F → Sort w} (f : ∀ x : F (M F), r (M.mk x)) (x : M F) : r x :=
  suffices r (M.mk (dest x)) by
    

Proof state:
F : PFunctor.{u}
X : Type u_1
f✝ : X → ↑F X
r : M F → Sort w
f : (x : ↑F (M F)) → r (M.mk x)
x : M F
this : r (M.mk (dest x))
⊢ r x

Next tactic:
rw [← mk_dest x]
/-- destructor for M-types -/
protected def cases {r : M F → Sort w} (f : ∀ x : F (M F), r (M.mk x)) (x : M F) : r x :=
  suffices r (M.mk (dest x)) by
    rw [← mk_dest x]
    

Proof state:
F : PFunctor.{u}
X : Type u_1
f✝ : X → ↑F X
r : M F → Sort w
f : (x : ↑F (M F)) → r (M.mk x)
x : M F
this : r (M.mk (dest x))
⊢ r (M.mk (dest x))

Next tactic:
exact this
@[simp]
theorem agree'_refl {n : ℕ} (x : M F) : Agree' n x x := by
  

Proof state:
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
n : ℕ
x : M F
⊢ Agree' n x x

Next tactic:
induction' n with _ n_ih generalizing x
@[simp]
theorem agree'_refl {n : ℕ} (x : M F) : Agree' n x x := by
  induction' n with _ n_ih generalizing x <;>
  

Proof state:
case zero
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x : M F
⊢ Agree' zero x x

Next tactic:
induction x using PFunctor.M.casesOn'
@[simp]
theorem agree'_refl {n : ℕ} (x : M F) : Agree' n x x := by
  induction' n with _ n_ih generalizing x <;>
  

Proof state:
case succ
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
n✝ : ℕ
n_ih : ∀ (x : M F), Agree' n✝ x x
x : M F
⊢ Agree' (succ n✝) x x

Next tactic:
induction x using PFunctor.M.casesOn'
@[simp]
theorem agree'_refl {n : ℕ} (x : M F) : Agree' n x x := by
  induction' n with _ n_ih generalizing x <;>
  induction x using PFunctor.M.casesOn' <;> 

Proof state:
case zero.f
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
a✝ : F.A
f✝ : B F a✝ → M F
⊢ Agree' zero (M.mk { fst := a✝, snd := f✝ }) (M.mk { fst := a✝, snd := f✝ })

Next tactic:
constructor
@[simp]
theorem agree'_refl {n : ℕ} (x : M F) : Agree' n x x := by
  induction' n with _ n_ih generalizing x <;>
  induction x using PFunctor.M.casesOn' <;> 

Proof state:
case succ.f
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
n✝ : ℕ
n_ih : ∀ (x : M F), Agree' n✝ x x
a✝ : F.A
f✝ : B F a✝ → M F
⊢ Agree' (succ n✝) (M.mk { fst := a✝, snd := f✝ }) (M.mk { fst := a✝, snd := f✝ })

Next tactic:
constructor
@[simp]
theorem agree'_refl {n : ℕ} (x : M F) : Agree' n x x := by
  induction' n with _ n_ih generalizing x <;>
  induction x using PFunctor.M.casesOn' <;> constructor <;> 

Proof state:
case succ.f.a
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
n✝ : ℕ
n_ih : ∀ (x : M F), Agree' n✝ x x
a✝ : F.A
f✝ : B F a✝ → M F
⊢ M.mk { fst := a✝, snd := f✝ } = M.mk { fst := ?succ.f.a, snd := ?succ.f.x }

Next tactic:
try rfl
@[simp]
theorem agree'_refl {n : ℕ} (x : M F) : Agree' n x x := by
  induction' n with _ n_ih generalizing x <;>
  induction x using PFunctor.M.casesOn' <;> constructor <;> try 

Proof state:
case succ.f.a
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
n✝ : ℕ
n_ih : ∀ (x : M F), Agree' n✝ x x
a✝ : F.A
f✝ : B F a✝ → M F
⊢ M.mk { fst := a✝, snd := f✝ } = M.mk { fst := ?succ.f.a, snd := ?succ.f.x }

Next tactic:
rfl
@[simp]
theorem agree'_refl {n : ℕ} (x : M F) : Agree' n x x := by
  induction' n with _ n_ih generalizing x <;>
  induction x using PFunctor.M.casesOn' <;> constructor <;> 

Proof state:
case succ.f.a
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
n✝ : ℕ
n_ih : ∀ (x : M F), Agree' n✝ x x
a✝ : F.A
f✝ : B F a✝ → M F
⊢ M.mk { fst := a✝, snd := f✝ } = M.mk { fst := a✝, snd := ?succ.f.y }

Next tactic:
try rfl
@[simp]
theorem agree'_refl {n : ℕ} (x : M F) : Agree' n x x := by
  induction' n with _ n_ih generalizing x <;>
  induction x using PFunctor.M.casesOn' <;> constructor <;> try 

Proof state:
case succ.f.a
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
n✝ : ℕ
n_ih : ∀ (x : M F), Agree' n✝ x x
a✝ : F.A
f✝ : B F a✝ → M F
⊢ M.mk { fst := a✝, snd := f✝ } = M.mk { fst := a✝, snd := ?succ.f.y }

Next tactic:
rfl
@[simp]
theorem agree'_refl {n : ℕ} (x : M F) : Agree' n x x := by
  induction' n with _ n_ih generalizing x <;>
  induction x using PFunctor.M.casesOn' <;> constructor <;> 

Proof state:
case succ.f.a
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
n✝ : ℕ
n_ih : ∀ (x : M F), Agree' n✝ x x
a✝ : F.A
f✝ : B F a✝ → M F
⊢ ∀ (i : B F a✝), Agree' n✝ (f✝ i) (f✝ i)

Next tactic:
try rfl
@[simp]
theorem agree'_refl {n : ℕ} (x : M F) : Agree' n x x := by
  induction' n with _ n_ih generalizing x <;>
  induction x using PFunctor.M.casesOn' <;> constructor <;> try 

Proof state:
case succ.f.a
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
n✝ : ℕ
n_ih : ∀ (x : M F), Agree' n✝ x x
a✝ : F.A
f✝ : B F a✝ → M F
⊢ ∀ (i : B F a✝), Agree' n✝ (f✝ i) (f✝ i)

Next tactic:
rfl
@[simp]
theorem agree'_refl {n : ℕ} (x : M F) : Agree' n x x := by
  induction' n with _ n_ih generalizing x <;>
  induction x using PFunctor.M.casesOn' <;> constructor <;> try rfl
  

Proof state:
case succ.f.a
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
n✝ : ℕ
n_ih : ∀ (x : M F), Agree' n✝ x x
a✝ : F.A
f✝ : B F a✝ → M F
⊢ ∀ (i : B F a✝), Agree' n✝ (f✝ i) (f✝ i)

Next tactic:
intros
@[simp]
theorem agree'_refl {n : ℕ} (x : M F) : Agree' n x x := by
  induction' n with _ n_ih generalizing x <;>
  induction x using PFunctor.M.casesOn' <;> constructor <;> try rfl
  intros
  

Proof state:
case succ.f.a
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
n✝ : ℕ
n_ih : ∀ (x : M F), Agree' n✝ x x
a✝ : F.A
f✝ : B F a✝ → M F
i✝ : B F a✝
⊢ Agree' n✝ (f✝ i✝) (f✝ i✝)

Next tactic:
apply n_ih
theorem agree_iff_agree' {n : ℕ} (x y : M F) :
    Agree (x.approx n) (y.approx <| n + 1) ↔ Agree' n x y := by
  

Proof state:
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
n : ℕ
x y : M F
⊢ Agree (MIntl.approx x n) (MIntl.approx y (n + 1)) ↔ Agree' n x y

Next tactic:
constructor
theorem agree_iff_agree' {n : ℕ} (x y : M F) :
    Agree (x.approx n) (y.approx <| n + 1) ↔ Agree' n x y := by
  constructor <;> 

Proof state:
case mp
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
n : ℕ
x y : M F
⊢ Agree (MIntl.approx x n) (MIntl.approx y (n + 1)) → Agree' n x y

Next tactic:
intro h
theorem agree_iff_agree' {n : ℕ} (x y : M F) :
    Agree (x.approx n) (y.approx <| n + 1) ↔ Agree' n x y := by
  constructor <;> 

Proof state:
case mpr
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
n : ℕ
x y : M F
⊢ Agree' n x y → Agree (MIntl.approx x n) (MIntl.approx y (n + 1))

Next tactic:
intro h
theorem agree_iff_agree' {n : ℕ} (x y : M F) :
    Agree (x.approx n) (y.approx <| n + 1) ↔ Agree' n x y := by
  constructor <;> intro h
  · 

Proof state:
case mp
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
n : ℕ
x y : M F
h : Agree (MIntl.approx x n) (MIntl.approx y (n + 1))
⊢ Agree' n x y

Next tactic:
induction' n with _ n_ih generalizing x y
theorem agree_iff_agree' {n : ℕ} (x y : M F) :
    Agree (x.approx n) (y.approx <| n + 1) ↔ Agree' n x y := by
  constructor <;> intro h
  · induction' n with _ n_ih generalizing x y
    

Proof state:
case mp.zero
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
x y : M F
h : Agree (MIntl.approx x zero) (MIntl.approx y (zero + 1))
⊢ Agree' zero x y
case mp.succ
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
n✝ : ℕ
n_ih : ∀ (x y : M F), Agree (MIntl.approx x n✝) (MIntl.approx y (n✝ + 1)) → Agree' n✝ x y
x y : M F
h : Agree (MIntl.approx x (succ n✝)) (MIntl.approx y (succ n✝ + 1))
⊢ Agree' (succ n✝) x y

Next tactic:
constructor
theorem agree_iff_agree' {n : ℕ} (x y : M F) :
    Agree (x.approx n) (y.approx <| n + 1) ↔ Agree' n x y := by
  constructor <;> intro h
  · induction' n with _ n_ih generalizing x y
    constructor
    · 

Proof state:
case mp.succ
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
n✝ : ℕ
n_ih : ∀ (x y : M F), Agree (MIntl.approx x n✝) (MIntl.approx y (n✝ + 1)) → Agree' n✝ x y
x y : M F
h : Agree (MIntl.approx x (succ n✝)) (MIntl.approx y (succ n✝ + 1))
⊢ Agree' (succ n✝) x y

Next tactic:
induction x using PFunctor.M.casesOn'
theorem agree_iff_agree' {n : ℕ} (x y : M F) :
    Agree (x.approx n) (y.approx <| n + 1) ↔ Agree' n x y := by
  constructor <;> intro h
  · induction' n with _ n_ih generalizing x y
    constructor
    · induction x using PFunctor.M.casesOn'
      

Proof state:
case mp.succ.f
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
n✝ : ℕ
n_ih : ∀ (x y : M F), Agree (MIntl.approx x n✝) (MIntl.approx y (n✝ + 1)) → Agree' n✝ x y
y : M F
a✝ : F.A
f✝ : B F a✝ → M F
h : Agree (MIntl.approx (M.mk { fst := a✝, snd := f✝ }) (succ n✝)) (MIntl.approx y (succ n✝ + 1))
⊢ Agree' (succ n✝) (M.mk { fst := a✝, snd := f✝ }) y

Next tactic:
induction y using PFunctor.M.casesOn'
theorem agree_iff_agree' {n : ℕ} (x y : M F) :
    Agree (x.approx n) (y.approx <| n + 1) ↔ Agree' n x y := by
  constructor <;> intro h
  · induction' n with _ n_ih generalizing x y
    constructor
    · induction x using PFunctor.M.casesOn'
      induction y using PFunctor.M.casesOn'
      

Proof state:
case mp.succ.f.f
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
n✝ : ℕ
n_ih : ∀ (x y : M F), Agree (MIntl.approx x n✝) (MIntl.approx y (n✝ + 1)) → Agree' n✝ x y
a✝¹ : F.A
f✝¹ : B F a✝¹ → M F
a✝ : F.A
f✝ : B F a✝ → M F
h :
  Agree (MIntl.approx (M.mk { fst := a✝¹, snd := f✝¹ }) (succ n✝))
    (MIntl.approx (M.mk { fst := a✝, snd := f✝ }) (succ n✝ + 1))
⊢ Agree' (succ n✝) (M.mk { fst := a✝¹, snd := f✝¹ }) (M.mk { fst := a✝, snd := f✝ })

Next tactic:
simp only [approx_mk] at h
theorem agree_iff_agree' {n : ℕ} (x y : M F) :
    Agree (x.approx n) (y.approx <| n + 1) ↔ Agree' n x y := by
  constructor <;> intro h
  · induction' n with _ n_ih generalizing x y
    constructor
    · induction x using PFunctor.M.casesOn'
      induction y using PFunctor.M.casesOn'
      simp only [approx_mk] at h
      

Proof state:
case mp.succ.f.f
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
n✝ : ℕ
n_ih : ∀ (x y : M F), Agree (MIntl.approx x n✝) (MIntl.approx y (n✝ + 1)) → Agree' n✝ x y
a✝¹ : F.A
f✝¹ : B F a✝¹ → M F
a✝ : F.A
f✝ : B F a✝ → M F
h : Agree (CofixA.intro a✝¹ fun j => MIntl.approx (f✝¹ j) n✝) (CofixA.intro a✝ fun j => MIntl.approx (f✝ j) (n✝ + 1))
⊢ Agree' (succ n✝) (M.mk { fst := a✝¹, snd := f✝¹ }) (M.mk { fst := a✝, snd := f✝ })

Next tactic:
cases' h with _ _ _ _ _ _ hagree
theorem agree_iff_agree' {n : ℕ} (x y : M F) :
    Agree (x.approx n) (y.approx <| n + 1) ↔ Agree' n x y := by
  constructor <;> intro h
  · induction' n with _ n_ih generalizing x y
    constructor
    · induction x using PFunctor.M.casesOn'
      induction y using PFunctor.M.casesOn'
      simp only [approx_mk] at h
      cases' h with _ _ _ _ _ _ hagree
      

Proof state:
case mp.succ.f.f.intro
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
n✝ : ℕ
n_ih : ∀ (x y : M F), Agree (MIntl.approx x n✝) (MIntl.approx y (n✝ + 1)) → Agree' n✝ x y
a✝ : F.A
f✝¹ f✝ : B F a✝ → M F
hagree : ∀ (i : B F a✝), Agree ((fun j => MIntl.approx (f✝¹ j) n✝) i) ((fun j => MIntl.approx (f✝ j) (n✝ + 1)) i)
⊢ Agree' (succ n✝) (M.mk { fst := a✝, snd := f✝¹ }) (M.mk { fst := a✝, snd := f✝ })

Next tactic:
constructor
theorem agree_iff_agree' {n : ℕ} (x y : M F) :
    Agree (x.approx n) (y.approx <| n + 1) ↔ Agree' n x y := by
  constructor <;> intro h
  · induction' n with _ n_ih generalizing x y
    constructor
    · induction x using PFunctor.M.casesOn'
      induction y using PFunctor.M.casesOn'
      simp only [approx_mk] at h
      cases' h with _ _ _ _ _ _ hagree
      constructor <;> 

Proof state:
case mp.succ.f.f.intro.a
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
n✝ : ℕ
n_ih : ∀ (x y : M F), Agree (MIntl.approx x n✝) (MIntl.approx y (n✝ + 1)) → Agree' n✝ x y
a✝ : F.A
f✝¹ f✝ : B F a✝ → M F
hagree : ∀ (i : B F a✝), Agree ((fun j => MIntl.approx (f✝¹ j) n✝) i) ((fun j => MIntl.approx (f✝ j) (n✝ + 1)) i)
⊢ M.mk { fst := a✝, snd := f✝¹ } = M.mk { fst := ?mp.succ.f.f.intro.a, snd := ?mp.succ.f.f.intro.x }

Next tactic:
try rfl
theorem agree_iff_agree' {n : ℕ} (x y : M F) :
    Agree (x.approx n) (y.approx <| n + 1) ↔ Agree' n x y := by
  constructor <;> intro h
  · induction' n with _ n_ih generalizing x y
    constructor
    · induction x using PFunctor.M.casesOn'
      induction y using PFunctor.M.casesOn'
      simp only [approx_mk] at h
      cases' h with _ _ _ _ _ _ hagree
      constructor <;> try 

Proof state:
case mp.succ.f.f.intro.a
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
n✝ : ℕ
n_ih : ∀ (x y : M F), Agree (MIntl.approx x n✝) (MIntl.approx y (n✝ + 1)) → Agree' n✝ x y
a✝ : F.A
f✝¹ f✝ : B F a✝ → M F
hagree : ∀ (i : B F a✝), Agree ((fun j => MIntl.approx (f✝¹ j) n✝) i) ((fun j => MIntl.approx (f✝ j) (n✝ + 1)) i)
⊢ M.mk { fst := a✝, snd := f✝¹ } = M.mk { fst := ?mp.succ.f.f.intro.a, snd := ?mp.succ.f.f.intro.x }

Next tactic:
rfl
theorem agree_iff_agree' {n : ℕ} (x y : M F) :
    Agree (x.approx n) (y.approx <| n + 1) ↔ Agree' n x y := by
  constructor <;> intro h
  · induction' n with _ n_ih generalizing x y
    constructor
    · induction x using PFunctor.M.casesOn'
      induction y using PFunctor.M.casesOn'
      simp only [approx_mk] at h
      cases' h with _ _ _ _ _ _ hagree
      constructor <;> 

Proof state:
case mp.succ.f.f.intro.a
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
n✝ : ℕ
n_ih : ∀ (x y : M F), Agree (MIntl.approx x n✝) (MIntl.approx y (n✝ + 1)) → Agree' n✝ x y
a✝ : F.A
f✝¹ f✝ : B F a✝ → M F
hagree : ∀ (i : B F a✝), Agree ((fun j => MIntl.approx (f✝¹ j) n✝) i) ((fun j => MIntl.approx (f✝ j) (n✝ + 1)) i)
⊢ M.mk { fst := a✝, snd := f✝ } = M.mk { fst := a✝, snd := ?mp.succ.f.f.intro.y }

Next tactic:
try rfl
theorem agree_iff_agree' {n : ℕ} (x y : M F) :
    Agree (x.approx n) (y.approx <| n + 1) ↔ Agree' n x y := by
  constructor <;> intro h
  · induction' n with _ n_ih generalizing x y
    constructor
    · induction x using PFunctor.M.casesOn'
      induction y using PFunctor.M.casesOn'
      simp only [approx_mk] at h
      cases' h with _ _ _ _ _ _ hagree
      constructor <;> try 

Proof state:
case mp.succ.f.f.intro.a
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
n✝ : ℕ
n_ih : ∀ (x y : M F), Agree (MIntl.approx x n✝) (MIntl.approx y (n✝ + 1)) → Agree' n✝ x y
a✝ : F.A
f✝¹ f✝ : B F a✝ → M F
hagree : ∀ (i : B F a✝), Agree ((fun j => MIntl.approx (f✝¹ j) n✝) i) ((fun j => MIntl.approx (f✝ j) (n✝ + 1)) i)
⊢ M.mk { fst := a✝, snd := f✝ } = M.mk { fst := a✝, snd := ?mp.succ.f.f.intro.y }

Next tactic:
rfl
theorem agree_iff_agree' {n : ℕ} (x y : M F) :
    Agree (x.approx n) (y.approx <| n + 1) ↔ Agree' n x y := by
  constructor <;> intro h
  · induction' n with _ n_ih generalizing x y
    constructor
    · induction x using PFunctor.M.casesOn'
      induction y using PFunctor.M.casesOn'
      simp only [approx_mk] at h
      cases' h with _ _ _ _ _ _ hagree
      constructor <;> 

Proof state:
case mp.succ.f.f.intro.a
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
n✝ : ℕ
n_ih : ∀ (x y : M F), Agree (MIntl.approx x n✝) (MIntl.approx y (n✝ + 1)) → Agree' n✝ x y
a✝ : F.A
f✝¹ f✝ : B F a✝ → M F
hagree : ∀ (i : B F a✝), Agree ((fun j => MIntl.approx (f✝¹ j) n✝) i) ((fun j => MIntl.approx (f✝ j) (n✝ + 1)) i)
⊢ ∀ (i : B F a✝), Agree' n✝ (f✝¹ i) (f✝ i)

Next tactic:
try rfl
theorem agree_iff_agree' {n : ℕ} (x y : M F) :
    Agree (x.approx n) (y.approx <| n + 1) ↔ Agree' n x y := by
  constructor <;> intro h
  · induction' n with _ n_ih generalizing x y
    constructor
    · induction x using PFunctor.M.casesOn'
      induction y using PFunctor.M.casesOn'
      simp only [approx_mk] at h
      cases' h with _ _ _ _ _ _ hagree
      constructor <;> try 

Proof state:
case mp.succ.f.f.intro.a
F : PFunctor.{u}
X : Type u_1
f : X → ↑F X
n✝ : ℕ
n_ih : ∀ (x y : M F), Agree (MIntl.approx x n✝) (MIntl.approx y (n✝ + 1)) → Agree' n✝ x y
a✝ : F.A
f✝¹ f✝ : B F a✝ → M F
hagree : ∀ (i : B F a✝), Agree ((fun j => MIntl.approx (f✝¹ j) n✝) i) ((fun j => MIntl.approx (f✝ j) (n✝ + 1)) i)
⊢ ∀ (i : B F a✝), Agree' n✝ (f✝¹ i) (f✝ i)

Next tactic:
rfl